feat: Add RTK (Rust Token Killer) integration for token optimization
- Add RTK utility module (src/utils/rtk.js) - Integrate RTK into BashTool for all bash commands - Integrate RTK into GitTool for git operations - Initialize RTK on bot startup - Support 60+ command types (git, npm, cargo, pytest, docker, etc.) - Track and report token savings per command - Graceful fallback when RTK is not available Expected savings: 60-90% token reduction for supported commands
This commit is contained in:
@@ -6,6 +6,7 @@ import { WebSocketServer } from 'ws';
|
||||
import { spawn } from 'child_process';
|
||||
import fs from 'fs-extra';
|
||||
import path from 'path';
|
||||
import { getRTK } from "../utils/rtk.js";
|
||||
|
||||
export async function initBot(config, api, tools, skills) {
|
||||
const env = checkEnv();
|
||||
@@ -24,6 +25,7 @@ export async function initBot(config, api, tools, skills) {
|
||||
|
||||
// WebSocket for real-time updates
|
||||
const httpServer = createServer(app);
|
||||
// Initialize RTK integration\n const rtk = getRTK();\n await rtk.init();
|
||||
const wss = new WebSocketServer({ server: httpServer });
|
||||
|
||||
// Store active connections
|
||||
|
||||
Reference in New Issue
Block a user