@compilr-dev/cli 0.8.2 → 0.8.4
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/compilr-diff-companion.vsix +0 -0
- package/dist/handlers/delegation-handlers.js +8 -19
- package/dist/repl-helpers.d.ts +2 -1
- package/dist/repl-helpers.js +18 -2
- package/dist/repl-v2.js +4 -2
- package/dist/shared-handlers.d.ts +6 -0
- package/dist/tools/platform-adapter.js +5 -0
- package/package.json +3 -3
|
Binary file
|
|
@@ -390,14 +390,15 @@ export function registerDelegationHandlers(deps) {
|
|
|
390
390
|
question: input.question,
|
|
391
391
|
context: input.context,
|
|
392
392
|
});
|
|
393
|
-
// Snapshot the target's history so the consult is transient — the
|
|
394
|
-
// target's actual chat shouldn't grow a record of consults received.
|
|
395
|
-
const historySnapshot = targetAgent.getHistory();
|
|
396
393
|
try {
|
|
397
|
-
//
|
|
398
|
-
//
|
|
399
|
-
//
|
|
400
|
-
|
|
394
|
+
// Consult v2: the target runs history-aware and KEEPS the exchange in
|
|
395
|
+
// its history — the teammate now remembers what it was asked (no more
|
|
396
|
+
// snapshot/restore). `input.signal` is the SDK's wall-clock timeout;
|
|
397
|
+
// forwarding it lets an expired consult actually abort the target run.
|
|
398
|
+
// No onEvent forwarder → the target's tool calls and streaming text
|
|
399
|
+
// don't render to the REPL (the borrower's voice stays foregrounded;
|
|
400
|
+
// the answer comes back as a tool result).
|
|
401
|
+
const runResult = await targetAgent.run(consultMessage, { signal: input.signal });
|
|
401
402
|
return { answer: runResult.response, agentId: input.agentId };
|
|
402
403
|
}
|
|
403
404
|
catch (err) {
|
|
@@ -407,18 +408,6 @@ export function registerDelegationHandlers(deps) {
|
|
|
407
408
|
error: `Consult failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
408
409
|
};
|
|
409
410
|
}
|
|
410
|
-
finally {
|
|
411
|
-
// Restore history regardless of success/failure — even a partial run
|
|
412
|
-
// mutates the target's message log, and we promised it'd be transient.
|
|
413
|
-
try {
|
|
414
|
-
await targetAgent.setHistory(historySnapshot);
|
|
415
|
-
}
|
|
416
|
-
catch {
|
|
417
|
-
// History restore is best-effort; if it fails the next message the
|
|
418
|
-
// user sends to the target will see the consult artefacts. Logging
|
|
419
|
-
// happens via the agent's own error path.
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
411
|
});
|
|
423
412
|
}
|
|
424
413
|
/**
|
package/dist/repl-helpers.d.ts
CHANGED
|
@@ -39,7 +39,8 @@ export declare function detectCompilrProject(): CompilrProjectInfo;
|
|
|
39
39
|
*/
|
|
40
40
|
export declare function hasBacklogItems(backlogPath: string | null): boolean;
|
|
41
41
|
/**
|
|
42
|
-
* Get skill prompt by name. Delegates to SDK resolveSkillPrompt
|
|
42
|
+
* Get skill prompt by name. Delegates to SDK resolveSkillPrompt, minus any
|
|
43
|
+
* Desktop-only SDK skills (see DESKTOP_ONLY_SKILLS).
|
|
43
44
|
*/
|
|
44
45
|
export declare function getSkillPrompt(name: string): string | null;
|
|
45
46
|
/**
|
package/dist/repl-helpers.js
CHANGED
|
@@ -215,11 +215,25 @@ function getCliSkillSources() {
|
|
|
215
215
|
return { factorySkills, codingSkills };
|
|
216
216
|
}
|
|
217
217
|
/**
|
|
218
|
-
*
|
|
218
|
+
* SDK platform skills that are intentionally NOT exposed in the CLI because they
|
|
219
|
+
* require a visual render surface the terminal can't provide. `/canvas` authors a
|
|
220
|
+
* sandboxed HTML/SVG canvas — there is nowhere to display it in a terminal, so it
|
|
221
|
+
* stays a Desktop-only feature. This guard blocks the *SDK* version of these skills
|
|
222
|
+
* even if a future SDK bump adds them to `platformSkills`; a user's own custom skill
|
|
223
|
+
* of the same name (source 'project'/'user') is left untouched.
|
|
224
|
+
*/
|
|
225
|
+
const DESKTOP_ONLY_SKILLS = new Set(['canvas', 'infographic', 'carousel', 'board']);
|
|
226
|
+
/**
|
|
227
|
+
* Get skill prompt by name. Delegates to SDK resolveSkillPrompt, minus any
|
|
228
|
+
* Desktop-only SDK skills (see DESKTOP_ONLY_SKILLS).
|
|
219
229
|
*/
|
|
220
230
|
export function getSkillPrompt(name) {
|
|
221
231
|
const resolution = resolveSkillPrompt(name, getProjectDir(), getCliSkillSources());
|
|
222
|
-
|
|
232
|
+
if (!resolution)
|
|
233
|
+
return null;
|
|
234
|
+
if (resolution.source === 'sdk' && DESKTOP_ONLY_SKILLS.has(resolution.skillName))
|
|
235
|
+
return null;
|
|
236
|
+
return resolution.prompt;
|
|
223
237
|
}
|
|
224
238
|
/**
|
|
225
239
|
* Richer version of getSkillPrompt that returns attribution metadata.
|
|
@@ -229,6 +243,8 @@ export function getSkillResolution(name) {
|
|
|
229
243
|
const resolution = resolveSkillPrompt(name, getProjectDir(), getCliSkillSources());
|
|
230
244
|
if (!resolution)
|
|
231
245
|
return null;
|
|
246
|
+
if (resolution.source === 'sdk' && DESKTOP_ONLY_SKILLS.has(resolution.skillName))
|
|
247
|
+
return null;
|
|
232
248
|
return {
|
|
233
249
|
prompt: resolution.prompt,
|
|
234
250
|
skillName: resolution.skillName,
|
package/dist/repl-v2.js
CHANGED
|
@@ -649,7 +649,7 @@ export class ReplV2 {
|
|
|
649
649
|
tools.push(createConsultTool({
|
|
650
650
|
team,
|
|
651
651
|
currentAgentId,
|
|
652
|
-
onConsult: async (targetId, question, context) => {
|
|
652
|
+
onConsult: async (targetId, question, context, opts) => {
|
|
653
653
|
const handler = getConsultHandler();
|
|
654
654
|
if (!handler) {
|
|
655
655
|
return {
|
|
@@ -657,7 +657,9 @@ export class ReplV2 {
|
|
|
657
657
|
error: 'Consult handler not initialised. This shouldn\'t happen in normal use.',
|
|
658
658
|
};
|
|
659
659
|
}
|
|
660
|
-
|
|
660
|
+
// Forward the SDK's timeout signal (consult v2) so the handler can
|
|
661
|
+
// abort the target's run when the wall-clock cap fires.
|
|
662
|
+
const result = await handler({ agentId: targetId, question, context, signal: opts.signal });
|
|
661
663
|
return { answer: result.answer, error: result.error };
|
|
662
664
|
},
|
|
663
665
|
}));
|
|
@@ -127,6 +127,12 @@ export interface ConsultInput {
|
|
|
127
127
|
question: string;
|
|
128
128
|
/** Optional supporting material the target needs to answer well */
|
|
129
129
|
context?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Abort signal from the SDK's consult wall-clock timeout (consult v2).
|
|
132
|
+
* The handler MUST forward this into the target's `agent.run` so an
|
|
133
|
+
* expired consult actually stops the sub-run instead of orphaning it.
|
|
134
|
+
*/
|
|
135
|
+
signal?: AbortSignal;
|
|
130
136
|
}
|
|
131
137
|
export interface ConsultResult {
|
|
132
138
|
/** Final response text from the target agent. */
|
|
@@ -128,6 +128,11 @@ const context = {
|
|
|
128
128
|
anchors: anchorService,
|
|
129
129
|
artifacts: artifactService,
|
|
130
130
|
episodes: episodeService,
|
|
131
|
+
// NOTE: `canvases` is intentionally omitted. Canvas is a visual (HTML/SVG)
|
|
132
|
+
// feature with no render surface in a terminal, so it stays Desktop-only.
|
|
133
|
+
// Omitting the repo means createPlatformTools() never emits the canvas_* tools
|
|
134
|
+
// here. (The /canvas skill is likewise blocked in repl-helpers.ts.) Do NOT wire
|
|
135
|
+
// a canvases repo into the CLI unless the terminal gains a way to display one.
|
|
131
136
|
get currentProjectId() {
|
|
132
137
|
return getCurrentProject()?.id;
|
|
133
138
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@compilr-dev/cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4",
|
|
4
4
|
"description": "AI-powered coding assistant CLI using @compilr-dev/agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"@anthropic-ai/sdk": "^0.74.0",
|
|
58
58
|
"@compilr-dev/agents": "^0.6.0",
|
|
59
59
|
"@compilr-dev/agents-coding": "^1.0.4",
|
|
60
|
-
"@compilr-dev/editor-core": "^0.0.
|
|
60
|
+
"@compilr-dev/editor-core": "^0.0.3",
|
|
61
61
|
"@compilr-dev/factory": "^0.1.35",
|
|
62
62
|
"@compilr-dev/logger": "^0.1.0",
|
|
63
|
-
"@compilr-dev/sdk": "^0.
|
|
63
|
+
"@compilr-dev/sdk": "^0.18.0",
|
|
64
64
|
"@compilr-dev/ui-core": "^0.0.1",
|
|
65
65
|
"@modelcontextprotocol/sdk": "^1.23.0",
|
|
66
66
|
"ansi-escapes": "^7.3.0",
|