@compilr-dev/cli 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo.app +1 -1
- package/dist/.tsbuildinfo.data +1 -1
- package/dist/.tsbuildinfo.domain +1 -1
- package/dist/.tsbuildinfo.foundation +1 -1
- package/dist/agent.js +8 -6
- package/dist/commands-v2/handlers/core.js +26 -1
- package/dist/commands-v2/handlers/project.js +36 -3
- package/dist/commands-v2/handlers/reset.js +19 -6
- package/dist/commands-v2/handlers/session.d.ts +5 -1
- package/dist/commands-v2/handlers/session.js +54 -16
- package/dist/commands-v2/types.d.ts +5 -0
- package/dist/compilr-diff-companion.vsix +0 -0
- package/dist/index.js +99 -30
- package/dist/models/providers.d.ts +3 -1
- package/dist/models/providers.js +9 -0
- package/dist/repl-v2.d.ts +12 -0
- package/dist/repl-v2.js +11 -6
- package/dist/tool-names.d.ts +4 -0
- package/dist/tool-names.js +24 -0
- package/dist/tools.d.ts +14 -4
- package/dist/tools.js +57 -19
- package/dist/ui/terminal-ui.d.ts +7 -7
- package/dist/ui/terminal-ui.js +1 -1
- package/dist/ui/turn-metrics.d.ts +10 -10
- package/dist/ui/turn-metrics.js +5 -5
- package/dist/ui/types.d.ts +4 -4
- package/package.json +5 -5
package/dist/tools.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
// Re-export tool names from the dependency-free module
|
|
18
18
|
// This breaks circular dependencies while maintaining a single source of truth
|
|
19
|
-
export { TOOL_NAMES, DIRECT_TOOL_NAMES, META_TOOL_NAMES, META_REGISTRY_TOOL_NAMES, getAllToolNames, } from './tool-names.js';
|
|
19
|
+
export { TOOL_NAMES, DIRECT_TOOL_NAMES, HOT_TOOL_NAMES, WARM_TOOL_NAMES, META_TOOL_NAMES, META_REGISTRY_TOOL_NAMES, getAllToolNames, } from './tool-names.js';
|
|
20
20
|
// =============================================================================
|
|
21
21
|
// TOOL IMPORTS
|
|
22
22
|
// =============================================================================
|
|
@@ -136,29 +136,36 @@ export { setMetaToolFilter, getRegisteredMetaTools };
|
|
|
136
136
|
// DIRECT TOOLS - Always available, called by name
|
|
137
137
|
// =============================================================================
|
|
138
138
|
/**
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
* Estimated: ~3,500 tokens for definitions
|
|
139
|
+
* Hot tools — used in >50% of turns. Always declared as direct schemas.
|
|
140
|
+
* Estimated: ~2,100 tokens for definitions
|
|
142
141
|
*/
|
|
143
|
-
const
|
|
142
|
+
const HOT_TOOLS = [
|
|
144
143
|
// File operations (most common)
|
|
145
144
|
readFileTool,
|
|
146
145
|
writeFileTool,
|
|
147
146
|
editTool,
|
|
148
147
|
// Shell (very common)
|
|
149
148
|
bashTool,
|
|
150
|
-
bashOutputTool,
|
|
151
|
-
killShellTool,
|
|
152
149
|
// Search (very common)
|
|
153
150
|
globTool,
|
|
154
151
|
grepTool,
|
|
155
|
-
//
|
|
152
|
+
// User interaction (always needed)
|
|
153
|
+
askUserTool,
|
|
154
|
+
];
|
|
155
|
+
/**
|
|
156
|
+
* Warm tools — used occasionally. In hot-tools mode these move to meta-registry.
|
|
157
|
+
* Estimated: ~3,300 tokens for definitions
|
|
158
|
+
*/
|
|
159
|
+
const WARM_TOOLS = [
|
|
160
|
+
// Shell management
|
|
161
|
+
bashOutputTool,
|
|
162
|
+
killShellTool,
|
|
163
|
+
// Task tracking
|
|
156
164
|
todoWriteTool,
|
|
157
165
|
todoReadTool,
|
|
158
166
|
todoClaimTool,
|
|
159
167
|
todoHandoffTool,
|
|
160
|
-
// User interaction (
|
|
161
|
-
askUserTool,
|
|
168
|
+
// User interaction (simple variant)
|
|
162
169
|
askUserSimpleTool,
|
|
163
170
|
// Delegation (coordinator only)
|
|
164
171
|
delegateTool,
|
|
@@ -166,9 +173,14 @@ const DIRECT_TOOLS = [
|
|
|
166
173
|
delegateBackgroundTool,
|
|
167
174
|
// Handoff (specialist-to-specialist)
|
|
168
175
|
handoffTool,
|
|
169
|
-
// CLI documentation
|
|
176
|
+
// CLI documentation
|
|
170
177
|
guideTool,
|
|
171
178
|
];
|
|
179
|
+
/**
|
|
180
|
+
* All direct tools combined (hot + warm).
|
|
181
|
+
* Used in legacy mode (no meta-tools) and for backwards compatibility.
|
|
182
|
+
*/
|
|
183
|
+
const DIRECT_TOOLS = [...HOT_TOOLS, ...WARM_TOOLS];
|
|
172
184
|
// =============================================================================
|
|
173
185
|
// META-REGISTRY TOOLS - Available via use_tool()
|
|
174
186
|
// =============================================================================
|
|
@@ -248,9 +260,12 @@ export function createMinimalToolRegistry() {
|
|
|
248
260
|
// =============================================================================
|
|
249
261
|
/**
|
|
250
262
|
* Get direct tools that are always available.
|
|
251
|
-
*
|
|
263
|
+
* When hotOnly is true, returns only hot tools (7 tools, ~2.1K tokens).
|
|
264
|
+
* When false/undefined, returns all direct tools (18 tools, ~5.4K tokens).
|
|
252
265
|
*/
|
|
253
|
-
export function getDirectTools() {
|
|
266
|
+
export function getDirectTools(hotOnly) {
|
|
267
|
+
if (hotOnly)
|
|
268
|
+
return HOT_TOOLS;
|
|
254
269
|
return DIRECT_TOOLS;
|
|
255
270
|
}
|
|
256
271
|
/**
|
|
@@ -269,12 +284,29 @@ export function getMetaTools() {
|
|
|
269
284
|
export function createToolFallback() {
|
|
270
285
|
return createMetaToolFallback();
|
|
271
286
|
}
|
|
287
|
+
/** Whether hot-tools mode is active (warm tools in meta-registry) */
|
|
288
|
+
let hotToolsModeActive = false;
|
|
289
|
+
/**
|
|
290
|
+
* Check if hot-tools mode is active.
|
|
291
|
+
* When true, only hot tools are declared as direct schemas; warm tools are in meta-registry.
|
|
292
|
+
*/
|
|
293
|
+
export function isHotToolsMode() {
|
|
294
|
+
return hotToolsModeActive;
|
|
295
|
+
}
|
|
272
296
|
/**
|
|
273
297
|
* Initialize the meta-tool registry with specialized tools.
|
|
298
|
+
* When includeWarmTools is true, warm tools are also added to the meta-registry
|
|
299
|
+
* (enabling hot-tools mode where only 7 core tools are declared directly).
|
|
274
300
|
* Call this once at startup.
|
|
275
301
|
*/
|
|
276
|
-
export function initializeMetaTools() {
|
|
277
|
-
|
|
302
|
+
export function initializeMetaTools(includeWarmTools) {
|
|
303
|
+
const tools = includeWarmTools
|
|
304
|
+
? [...WARM_TOOLS, ...META_REGISTRY_TOOLS]
|
|
305
|
+
: META_REGISTRY_TOOLS;
|
|
306
|
+
initializeMetaToolRegistry(tools);
|
|
307
|
+
if (includeWarmTools) {
|
|
308
|
+
hotToolsModeActive = true;
|
|
309
|
+
}
|
|
278
310
|
}
|
|
279
311
|
/**
|
|
280
312
|
* Get the tool index for the system prompt.
|
|
@@ -303,16 +335,22 @@ export function isMetaToolsEnabled() {
|
|
|
303
335
|
* Get tool statistics for debugging/display.
|
|
304
336
|
*/
|
|
305
337
|
export function getToolStats() {
|
|
306
|
-
const
|
|
307
|
-
const
|
|
308
|
-
const
|
|
338
|
+
const hotCount = HOT_TOOLS.length;
|
|
339
|
+
const warmCount = WARM_TOOLS.length;
|
|
340
|
+
const directCount = hotToolsModeActive ? hotCount : hotCount + warmCount;
|
|
341
|
+
const metaCount = hotToolsModeActive
|
|
342
|
+
? META_REGISTRY_TOOLS.length + warmCount
|
|
343
|
+
: META_REGISTRY_TOOLS.length;
|
|
344
|
+
const totalCount = hotCount + warmCount + META_REGISTRY_TOOLS.length;
|
|
309
345
|
// Rough estimates: ~300 tokens per tool definition
|
|
310
346
|
const tokensPerTool = 300;
|
|
311
347
|
const estimatedDirectTokens = directCount * tokensPerTool;
|
|
312
|
-
const estimatedMetaTokens =
|
|
348
|
+
const estimatedMetaTokens = 1000; // Tool index + meta-tool definitions
|
|
313
349
|
const estimatedLegacyTokens = totalCount * tokensPerTool;
|
|
314
350
|
return {
|
|
315
351
|
directTools: directCount,
|
|
352
|
+
hotTools: hotCount,
|
|
353
|
+
warmTools: warmCount,
|
|
316
354
|
metaRegistryTools: metaCount,
|
|
317
355
|
totalTools: totalCount,
|
|
318
356
|
estimatedDirectTokens,
|
package/dist/ui/terminal-ui.d.ts
CHANGED
|
@@ -103,12 +103,12 @@ export declare class TerminalUI extends EventEmitter {
|
|
|
103
103
|
* Add input/output tokens for live display
|
|
104
104
|
* @param thinkingTokens - Optional thinking tokens (Gemini 2.5+ models)
|
|
105
105
|
* @param cacheReadTokens - Optional cache read tokens (Anthropic/Gemini)
|
|
106
|
-
* @param debugPayload - Optional debug payload sizes (
|
|
106
|
+
* @param debugPayload - Optional debug payload sizes (token estimates)
|
|
107
107
|
*/
|
|
108
108
|
addTokens(inputTokens: number, outputTokens: number, thinkingTokens?: number, cacheReadTokens?: number, debugPayload?: {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
systemTokens: number;
|
|
110
|
+
contentsTokens: number;
|
|
111
|
+
toolsTokens: number;
|
|
112
112
|
}): void;
|
|
113
113
|
/**
|
|
114
114
|
* Increment tool call counter
|
|
@@ -134,9 +134,9 @@ export declare class TerminalUI extends EventEmitter {
|
|
|
134
134
|
toolCalls: number;
|
|
135
135
|
apiCalls: number;
|
|
136
136
|
debugPayload?: {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
systemTokens: number;
|
|
138
|
+
contentsTokens: number;
|
|
139
|
+
toolsTokens: number;
|
|
140
140
|
};
|
|
141
141
|
};
|
|
142
142
|
setMode(mode: AgentMode): void;
|
package/dist/ui/terminal-ui.js
CHANGED
|
@@ -339,7 +339,7 @@ export class TerminalUI extends EventEmitter {
|
|
|
339
339
|
* Add input/output tokens for live display
|
|
340
340
|
* @param thinkingTokens - Optional thinking tokens (Gemini 2.5+ models)
|
|
341
341
|
* @param cacheReadTokens - Optional cache read tokens (Anthropic/Gemini)
|
|
342
|
-
* @param debugPayload - Optional debug payload sizes (
|
|
342
|
+
* @param debugPayload - Optional debug payload sizes (token estimates)
|
|
343
343
|
*/
|
|
344
344
|
addTokens(inputTokens, outputTokens, thinkingTokens, cacheReadTokens, debugPayload) {
|
|
345
345
|
this.turnMetrics.addTokens(inputTokens, outputTokens, thinkingTokens, cacheReadTokens, debugPayload);
|
|
@@ -13,9 +13,9 @@ export interface TurnMetricsSnapshot {
|
|
|
13
13
|
toolCalls: number;
|
|
14
14
|
apiCalls: number;
|
|
15
15
|
debugPayload?: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
systemTokens: number;
|
|
17
|
+
contentsTokens: number;
|
|
18
|
+
toolsTokens: number;
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
export declare class TurnMetrics {
|
|
@@ -24,9 +24,9 @@ export declare class TurnMetrics {
|
|
|
24
24
|
thinkingTokens: number;
|
|
25
25
|
cacheReadTokens: number;
|
|
26
26
|
debugPayload?: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
systemTokens: number;
|
|
28
|
+
contentsTokens: number;
|
|
29
|
+
toolsTokens: number;
|
|
30
30
|
};
|
|
31
31
|
startTime: number;
|
|
32
32
|
toolCalls: number;
|
|
@@ -36,12 +36,12 @@ export declare class TurnMetrics {
|
|
|
36
36
|
* Add input/output tokens for live display.
|
|
37
37
|
* @param thinkingTokens - Optional thinking tokens (Gemini 2.5+ models)
|
|
38
38
|
* @param cacheReadTokens - Optional cache read tokens (Anthropic/Gemini)
|
|
39
|
-
* @param debugPayload - Optional debug payload sizes (
|
|
39
|
+
* @param debugPayload - Optional debug payload sizes (token estimates)
|
|
40
40
|
*/
|
|
41
41
|
addTokens(inputTokens: number, outputTokens: number, thinkingTokens?: number, cacheReadTokens?: number, debugPayload?: {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
systemTokens: number;
|
|
43
|
+
contentsTokens: number;
|
|
44
|
+
toolsTokens: number;
|
|
45
45
|
}): void;
|
|
46
46
|
incrementToolCalls(): void;
|
|
47
47
|
incrementApiCalls(): void;
|
package/dist/ui/turn-metrics.js
CHANGED
|
@@ -18,7 +18,7 @@ export class TurnMetrics {
|
|
|
18
18
|
* Add input/output tokens for live display.
|
|
19
19
|
* @param thinkingTokens - Optional thinking tokens (Gemini 2.5+ models)
|
|
20
20
|
* @param cacheReadTokens - Optional cache read tokens (Anthropic/Gemini)
|
|
21
|
-
* @param debugPayload - Optional debug payload sizes (
|
|
21
|
+
* @param debugPayload - Optional debug payload sizes (token estimates)
|
|
22
22
|
*/
|
|
23
23
|
addTokens(inputTokens, outputTokens, thinkingTokens, cacheReadTokens, debugPayload) {
|
|
24
24
|
this.inputTokens += inputTokens;
|
|
@@ -31,11 +31,11 @@ export class TurnMetrics {
|
|
|
31
31
|
}
|
|
32
32
|
if (debugPayload) {
|
|
33
33
|
if (!this.debugPayload) {
|
|
34
|
-
this.debugPayload = {
|
|
34
|
+
this.debugPayload = { systemTokens: 0, contentsTokens: 0, toolsTokens: 0 };
|
|
35
35
|
}
|
|
36
|
-
this.debugPayload.
|
|
37
|
-
this.debugPayload.
|
|
38
|
-
this.debugPayload.
|
|
36
|
+
this.debugPayload.systemTokens += debugPayload.systemTokens;
|
|
37
|
+
this.debugPayload.contentsTokens += debugPayload.contentsTokens;
|
|
38
|
+
this.debugPayload.toolsTokens += debugPayload.toolsTokens;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
incrementToolCalls() {
|
package/dist/ui/types.d.ts
CHANGED
|
@@ -53,11 +53,11 @@ export interface TurnMetrics {
|
|
|
53
53
|
subagentOutputTokens: number;
|
|
54
54
|
toolCalls: number;
|
|
55
55
|
durationMs: number;
|
|
56
|
-
/** Debug payload info -
|
|
56
|
+
/** Debug payload info - token estimates sent to provider */
|
|
57
57
|
debugPayload?: {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
systemTokens: number;
|
|
59
|
+
contentsTokens: number;
|
|
60
|
+
toolsTokens: number;
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
export interface CommandOption {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@compilr-dev/cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "AI-powered coding assistant CLI using @compilr-dev/agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@anthropic-ai/sdk": "^0.74.0",
|
|
57
|
-
"@compilr-dev/agents": "^0.3.
|
|
58
|
-
"@compilr-dev/agents-coding": "^1.0.
|
|
57
|
+
"@compilr-dev/agents": "^0.3.22",
|
|
58
|
+
"@compilr-dev/agents-coding": "^1.0.4",
|
|
59
59
|
"@compilr-dev/editor-core": "^0.0.2",
|
|
60
|
-
"@compilr-dev/factory": "^0.1.
|
|
61
|
-
"@compilr-dev/sdk": "^0.1.
|
|
60
|
+
"@compilr-dev/factory": "^0.1.12",
|
|
61
|
+
"@compilr-dev/sdk": "^0.1.18",
|
|
62
62
|
"@compilr-dev/ui-core": "^0.0.1",
|
|
63
63
|
"@modelcontextprotocol/sdk": "^1.23.0",
|
|
64
64
|
"better-sqlite3": "^12.5.0",
|