@namzu/cli 14.3.0 → 15.1.0
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/README.md +117 -17
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +26 -26
- package/dist/cli.js.map +1 -1
- package/dist/commands/acp.d.ts.map +1 -1
- package/dist/commands/acp.js +3 -2
- package/dist/commands/acp.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +2 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/login.d.ts +2 -0
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +45 -7
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +36 -12
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/{stubs.d.ts → serve.d.ts} +1 -10
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/{stubs.js → serve.js} +1 -24
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/skills.d.ts +19 -0
- package/dist/commands/skills.d.ts.map +1 -0
- package/dist/commands/skills.js +107 -0
- package/dist/commands/skills.js.map +1 -0
- package/dist/integrations/mcp/servers.d.ts +7 -0
- package/dist/integrations/mcp/servers.d.ts.map +1 -1
- package/dist/integrations/mcp/servers.js +33 -8
- package/dist/integrations/mcp/servers.js.map +1 -1
- package/dist/integrations/sessions/store.d.ts +8 -0
- package/dist/integrations/sessions/store.d.ts.map +1 -1
- package/dist/integrations/sessions/store.js +15 -0
- package/dist/integrations/sessions/store.js.map +1 -1
- package/dist/integrations/subagents/runtime.d.ts +2 -0
- package/dist/integrations/subagents/runtime.d.ts.map +1 -1
- package/dist/integrations/subagents/runtime.js +86 -13
- package/dist/integrations/subagents/runtime.js.map +1 -1
- package/dist/integrations/updates.d.ts.map +1 -1
- package/dist/integrations/updates.js +29 -4
- package/dist/integrations/updates.js.map +1 -1
- package/dist/tui/App.d.ts +10 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +1039 -252
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/ChoicePicker.d.ts +2 -1
- package/dist/tui/ChoicePicker.d.ts.map +1 -1
- package/dist/tui/ChoicePicker.js +10 -6
- package/dist/tui/ChoicePicker.js.map +1 -1
- package/dist/tui/Composer.d.ts +19 -2
- package/dist/tui/Composer.d.ts.map +1 -1
- package/dist/tui/Composer.js +526 -70
- package/dist/tui/Composer.js.map +1 -1
- package/dist/tui/CopyPicker.d.ts.map +1 -1
- package/dist/tui/CopyPicker.js +3 -4
- package/dist/tui/CopyPicker.js.map +1 -1
- package/dist/tui/EditPromptPicker.d.ts.map +1 -1
- package/dist/tui/EditPromptPicker.js +3 -4
- package/dist/tui/EditPromptPicker.js.map +1 -1
- package/dist/tui/Markdown.d.ts +3 -1
- package/dist/tui/Markdown.d.ts.map +1 -1
- package/dist/tui/Markdown.js +11 -9
- package/dist/tui/Markdown.js.map +1 -1
- package/dist/tui/PermissionOverlay.d.ts +11 -6
- package/dist/tui/PermissionOverlay.d.ts.map +1 -1
- package/dist/tui/PermissionOverlay.js +13 -20
- package/dist/tui/PermissionOverlay.js.map +1 -1
- package/dist/tui/Picker.d.ts.map +1 -1
- package/dist/tui/Picker.js +47 -11
- package/dist/tui/Picker.js.map +1 -1
- package/dist/tui/ResumePicker.d.ts.map +1 -1
- package/dist/tui/ResumePicker.js +6 -1
- package/dist/tui/ResumePicker.js.map +1 -1
- package/dist/tui/StatusBar.js +3 -3
- package/dist/tui/StatusBar.js.map +1 -1
- package/dist/tui/TextPrompt.d.ts +21 -0
- package/dist/tui/TextPrompt.d.ts.map +1 -0
- package/dist/tui/TextPrompt.js +139 -0
- package/dist/tui/TextPrompt.js.map +1 -0
- package/dist/tui/Transcript.d.ts +9 -10
- package/dist/tui/Transcript.d.ts.map +1 -1
- package/dist/tui/Transcript.js +11 -12
- package/dist/tui/Transcript.js.map +1 -1
- package/dist/tui/agent.d.ts +57 -23
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/agent.js +136 -86
- package/dist/tui/agent.js.map +1 -1
- package/dist/tui/exit-summary.d.ts.map +1 -1
- package/dist/tui/exit-summary.js +2 -1
- package/dist/tui/exit-summary.js.map +1 -1
- package/dist/tui/external-editor.d.ts +25 -0
- package/dist/tui/external-editor.d.ts.map +1 -0
- package/dist/tui/external-editor.js +169 -0
- package/dist/tui/external-editor.js.map +1 -0
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/index.js +4 -0
- package/dist/tui/index.js.map +1 -1
- package/dist/tui/live-window.d.ts +17 -11
- package/dist/tui/live-window.d.ts.map +1 -1
- package/dist/tui/live-window.js +64 -20
- package/dist/tui/live-window.js.map +1 -1
- package/dist/tui/login-prompt.d.ts +2 -0
- package/dist/tui/login-prompt.d.ts.map +1 -1
- package/dist/tui/login-prompt.js +8 -1
- package/dist/tui/login-prompt.js.map +1 -1
- package/dist/tui/mentions.d.ts +19 -0
- package/dist/tui/mentions.d.ts.map +1 -1
- package/dist/tui/mentions.js +96 -5
- package/dist/tui/mentions.js.map +1 -1
- package/dist/tui/permission-review.d.ts +59 -0
- package/dist/tui/permission-review.d.ts.map +1 -0
- package/dist/tui/permission-review.js +219 -0
- package/dist/tui/permission-review.js.map +1 -0
- package/dist/tui/run-interruption.d.ts +14 -0
- package/dist/tui/run-interruption.d.ts.map +1 -0
- package/dist/tui/run-interruption.js +67 -0
- package/dist/tui/run-interruption.js.map +1 -0
- package/dist/tui/selection-window.d.ts +18 -0
- package/dist/tui/selection-window.d.ts.map +1 -0
- package/dist/tui/selection-window.js +37 -0
- package/dist/tui/selection-window.js.map +1 -0
- package/dist/tui/slashCommands.d.ts +48 -8
- package/dist/tui/slashCommands.d.ts.map +1 -1
- package/dist/tui/slashCommands.js +129 -47
- package/dist/tui/slashCommands.js.map +1 -1
- package/dist/tui/terminal-hyperlinks.d.ts +20 -0
- package/dist/tui/terminal-hyperlinks.d.ts.map +1 -0
- package/dist/tui/terminal-hyperlinks.js +70 -0
- package/dist/tui/terminal-hyperlinks.js.map +1 -0
- package/dist/tui/types.d.ts +2 -0
- package/dist/tui/types.d.ts.map +1 -1
- package/dist/tui/use-selection-index.d.ts +8 -0
- package/dist/tui/use-selection-index.d.ts.map +1 -0
- package/dist/tui/use-selection-index.js +13 -0
- package/dist/tui/use-selection-index.js.map +1 -0
- package/dist/tui/workspace-review.d.ts +15 -0
- package/dist/tui/workspace-review.d.ts.map +1 -0
- package/dist/tui/workspace-review.js +67 -0
- package/dist/tui/workspace-review.js.map +1 -0
- package/dist/version.d.ts +10 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +23 -0
- package/dist/version.js.map +1 -0
- package/package.json +8 -7
- package/dist/commands/stubs.d.ts.map +0 -1
- package/dist/commands/stubs.js.map +0 -1
- package/dist/tui/bottom-spacer.d.ts +0 -95
- package/dist/tui/bottom-spacer.d.ts.map +0 -1
- package/dist/tui/bottom-spacer.js +0 -83
- package/dist/tui/bottom-spacer.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permission-review.js","sourceRoot":"","sources":["../../src/tui/permission-review.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAE3D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,CAAA;AAEhD,2DAA2D;AAC3D,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAA;AAa5C,6EAA6E;AAC7E,MAAM,UAAU,uBAAuB,CAAC,MAAuC;IAC9E,OAAO,MAAM,KAAK,WAAW;QAC5B,CAAC,CAAC,gDAAgD,2BAA2B,sIAAsI;QACnN,CAAC,CAAC,0MAA0M,CAAA;AAC9M,CAAC;AAWD,MAAM,gBAAiB,SAAQ,KAAK;CAAG;AACvC,MAAM,gBAAiB,SAAQ,KAAK;CAAG;AAEvC;;;;;;;;;;GAUG;AACH,MAAM,UAA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AAC,CAAC,CAAC,CAAC,CAAA;YACvE,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,GAAG,UAAU,GAAG,KAAK,EAAE,CAAC;gBACnD,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAA;gBACrD,IAAI,GAAG,EAAE,CAAA;gBACT,KAAK,GAAG,CAAC,CAAA;gBACT,YAAY,GAAG,IAAI,CAAA;YACpB,CAAC;YACD,IAAI,IAAI,KAAK,CAAA;YACb,KAAK,IAAI,UAAU,CAAA;QACpB,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAA;IACtD,CAAC;IAED,OAAO,IAAI,CAAA;AACZ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgentEvent } from './agent.js';
|
|
2
|
+
type Interruption = Extract<AgentEvent, {
|
|
3
|
+
kind: 'error' | 'paused';
|
|
4
|
+
}>;
|
|
5
|
+
/**
|
|
6
|
+
* Human copy for a terminal interruption, derived only from event facts.
|
|
7
|
+
*
|
|
8
|
+
* No countdown: `retryAfterMs` is a duration reported at the failure boundary,
|
|
9
|
+
* not a clock this process keeps updating. No generic remedy either: when the
|
|
10
|
+
* SDK catalog did not claim a failure, the provider reason is all we know.
|
|
11
|
+
*/
|
|
12
|
+
export declare function describeRunInterruption(event: Interruption): string;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=run-interruption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-interruption.d.ts","sourceRoot":"","sources":["../../src/tui/run-interruption.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAG5C,KAAK,YAAY,GAAG,OAAO,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAA;CAAE,CAAC,CAAA;AAsCrE;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAyBnE"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { terminalDisplayText } from './terminal-display.js';
|
|
2
|
+
/** One terminal-safe line, bounded so a provider response cannot own the screen. */
|
|
3
|
+
function line(value, max = 480) {
|
|
4
|
+
const clean = terminalDisplayText(value).replace(/\s+/g, ' ').trim();
|
|
5
|
+
return clean.length <= max ? clean : `${clean.slice(0, Math.max(0, max - 1))}…`;
|
|
6
|
+
}
|
|
7
|
+
function retryAfterMs(event) {
|
|
8
|
+
const direct = event.providerError?.retryAfterMs;
|
|
9
|
+
const projected = event.failure?.details?.retryAfterMs;
|
|
10
|
+
const value = typeof direct === 'number' ? direct : projected;
|
|
11
|
+
return typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : undefined;
|
|
12
|
+
}
|
|
13
|
+
function duration(ms) {
|
|
14
|
+
if (ms < 1_000)
|
|
15
|
+
return `${Math.ceil(ms)} ms`;
|
|
16
|
+
const seconds = Math.ceil(ms / 1_000);
|
|
17
|
+
if (seconds < 120)
|
|
18
|
+
return `${seconds} second${seconds === 1 ? '' : 's'}`;
|
|
19
|
+
const minutes = Math.ceil(seconds / 60);
|
|
20
|
+
if (minutes < 120)
|
|
21
|
+
return `${minutes} minute${minutes === 1 ? '' : 's'}`;
|
|
22
|
+
const hours = Math.ceil(minutes / 60);
|
|
23
|
+
if (hours < 48)
|
|
24
|
+
return `${hours} hour${hours === 1 ? '' : 's'}`;
|
|
25
|
+
const days = Math.ceil(hours / 24);
|
|
26
|
+
return `${days} day${days === 1 ? '' : 's'}`;
|
|
27
|
+
}
|
|
28
|
+
function materiallyDifferent(candidate, earlier) {
|
|
29
|
+
const normalized = line(candidate).toLocaleLowerCase('en-US');
|
|
30
|
+
return (normalized.length > 0 &&
|
|
31
|
+
!earlier.some((value) => {
|
|
32
|
+
const prior = line(value).toLocaleLowerCase('en-US');
|
|
33
|
+
return prior === normalized || prior.includes(normalized) || normalized.includes(prior);
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Human copy for a terminal interruption, derived only from event facts.
|
|
38
|
+
*
|
|
39
|
+
* No countdown: `retryAfterMs` is a duration reported at the failure boundary,
|
|
40
|
+
* not a clock this process keeps updating. No generic remedy either: when the
|
|
41
|
+
* SDK catalog did not claim a failure, the provider reason is all we know.
|
|
42
|
+
*/
|
|
43
|
+
export function describeRunInterruption(event) {
|
|
44
|
+
const explained = event.explanation;
|
|
45
|
+
const rawReason = event.kind === 'paused' ? event.reason : event.message;
|
|
46
|
+
const lead = line(explained?.message || rawReason);
|
|
47
|
+
const id = explained?.id ? ` [${line(explained.id, 120)}]` : '';
|
|
48
|
+
const rows = [`${event.kind === 'paused' ? 'Run paused' : 'Error'}${id}: ${lead}`];
|
|
49
|
+
const providerDetail = event.providerError?.detail;
|
|
50
|
+
if (providerDetail && materiallyDifferent(providerDetail, [lead, rawReason])) {
|
|
51
|
+
rows.push(`Provider detail: ${line(providerDetail)}`);
|
|
52
|
+
}
|
|
53
|
+
if (explained && materiallyDifferent(rawReason, [lead, providerDetail ?? ''])) {
|
|
54
|
+
rows.push(`Reason: ${line(rawReason)}`);
|
|
55
|
+
}
|
|
56
|
+
const retryAfter = retryAfterMs(event);
|
|
57
|
+
if (retryAfter !== undefined) {
|
|
58
|
+
rows.push(`Provider retry delay: at least ${duration(retryAfter)} from this failure.`);
|
|
59
|
+
}
|
|
60
|
+
if (explained?.hint)
|
|
61
|
+
rows.push(`Next: ${line(explained.hint, 720)}`);
|
|
62
|
+
if (event.kind === 'paused') {
|
|
63
|
+
rows.push(`Checkpoint preserved: ${line(event.checkpointId, 180)}`);
|
|
64
|
+
}
|
|
65
|
+
return rows.join('\n');
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=run-interruption.js.map
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C,UAAU,CAAC,qBAAqB,CAAC,CAAA;IACvF,CAAC;IACD,IAAI,SAAS,EAAE,IAAI;QAAE,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC,CAAA;IACpE,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,IAAI,CAAC,IAAI,CAAC,yBAAyB,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,GAAG,CAAC,EAAE,CAAC,CAAA;IACpE,CAAC;IAED,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACvB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Default number of finite choices kept visible in terminal overlays. */
|
|
2
|
+
export declare const SELECTION_WINDOW_SIZE = 7;
|
|
3
|
+
export type SelectionMovement = 'previous' | 'next' | 'previous-page' | 'next-page' | 'first' | 'last';
|
|
4
|
+
export interface SelectionWindow<T> {
|
|
5
|
+
readonly start: number;
|
|
6
|
+
readonly items: readonly T[];
|
|
7
|
+
}
|
|
8
|
+
/** Move an absolute finite-list cursor without letting a UI invent its own page size. */
|
|
9
|
+
export declare function moveSelection(selected: number, itemCount: number, movement: SelectionMovement, pageSize?: number): number;
|
|
10
|
+
/**
|
|
11
|
+
* Keep an absolute selection inside a bounded, centred terminal window.
|
|
12
|
+
*
|
|
13
|
+
* The cursor remains in the caller's full-list coordinate space. Returning
|
|
14
|
+
* the absolute start beside the slice prevents a rendered row from being
|
|
15
|
+
* submitted as the wrong item after the first page scrolls away.
|
|
16
|
+
*/
|
|
17
|
+
export declare function selectionWindow<T>(items: readonly T[], selected: number, windowSize?: number): SelectionWindow<T>;
|
|
18
|
+
//# sourceMappingURL=selection-window.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-window.d.ts","sourceRoot":"","sources":["../../src/tui/selection-window.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,eAAO,MAAM,qBAAqB,IAAI,CAAA;AAEtC,MAAM,MAAM,iBAAiB,GAC1B,UAAU,GACV,MAAM,GACN,eAAe,GACf,WAAW,GACX,OAAO,GACP,MAAM,CAAA;AAET,MAAM,WAAW,eAAe,CAAC,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAA;CAC5B;AAED,yFAAyF;AACzF,wBAAgB,aAAa,CAC5B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,iBAAiB,EAC3B,QAAQ,SAAwB,GAC9B,MAAM,CAiBR;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAChC,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,QAAQ,EAAE,MAAM,EAChB,UAAU,SAAwB,GAChC,eAAe,CAAC,CAAC,CAAC,CAQpB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Default number of finite choices kept visible in terminal overlays. */
|
|
2
|
+
export const SELECTION_WINDOW_SIZE = 7;
|
|
3
|
+
/** Move an absolute finite-list cursor without letting a UI invent its own page size. */
|
|
4
|
+
export function moveSelection(selected, itemCount, movement, pageSize = SELECTION_WINDOW_SIZE) {
|
|
5
|
+
if (itemCount <= 0)
|
|
6
|
+
return 0;
|
|
7
|
+
const current = Math.max(0, Math.min(selected, itemCount - 1));
|
|
8
|
+
switch (movement) {
|
|
9
|
+
case 'previous':
|
|
10
|
+
return Math.max(0, current - 1);
|
|
11
|
+
case 'next':
|
|
12
|
+
return Math.min(itemCount - 1, current + 1);
|
|
13
|
+
case 'previous-page':
|
|
14
|
+
return Math.max(0, current - Math.max(1, pageSize));
|
|
15
|
+
case 'next-page':
|
|
16
|
+
return Math.min(itemCount - 1, current + Math.max(1, pageSize));
|
|
17
|
+
case 'first':
|
|
18
|
+
return 0;
|
|
19
|
+
case 'last':
|
|
20
|
+
return itemCount - 1;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Keep an absolute selection inside a bounded, centred terminal window.
|
|
25
|
+
*
|
|
26
|
+
* The cursor remains in the caller's full-list coordinate space. Returning
|
|
27
|
+
* the absolute start beside the slice prevents a rendered row from being
|
|
28
|
+
* submitted as the wrong item after the first page scrolls away.
|
|
29
|
+
*/
|
|
30
|
+
export function selectionWindow(items, selected, windowSize = SELECTION_WINDOW_SIZE) {
|
|
31
|
+
if (items.length === 0 || windowSize <= 0)
|
|
32
|
+
return { start: 0, items: [] };
|
|
33
|
+
const clamped = Math.max(0, Math.min(selected, items.length - 1));
|
|
34
|
+
const start = Math.max(0, Math.min(clamped - Math.floor(windowSize / 2), items.length - windowSize));
|
|
35
|
+
return { start, items: items.slice(start, start + windowSize) };
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=selection-window.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-window.js","sourceRoot":"","sources":["../../src/tui/selection-window.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAA;AAetC,yFAAyF;AACzF,MAAM,UAAU,aAAa,CAC5B,QAAgB,EAChB,SAAiB,EACjB,QAA2B,EAC3B,QAAQ,GAAG,qBAAqB;IAEhC,IAAI,SAAS,IAAI,CAAC;QAAE,OAAO,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,CAAC,CAAA;IAC9D,QAAQ,QAAQ,EAAE,CAAC;QAClB,KAAK,UAAU;YACd,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,CAAA;QAChC,KAAK,MAAM;YACV,OAAO,IAAI,CAAC,GAAG,CAAC,SA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import type { SandboxSummary } from '../context/sandbox.js';
|
|
28
28
|
import { type PermissionMode } from '../permissions/mode.js';
|
|
29
29
|
import { type UserCommand } from '../user-commands/store.js';
|
|
30
|
+
/** One row in the interactive `/help` command palette. */
|
|
31
|
+
export interface CommandPickerEntry {
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly description: string;
|
|
34
|
+
/** Present when a discovered command file exists but cannot be executed. */
|
|
35
|
+
readonly problem?: string;
|
|
36
|
+
}
|
|
30
37
|
export type SlashAction = {
|
|
31
38
|
kind: 'message';
|
|
32
39
|
role: 'system';
|
|
33
40
|
content: string;
|
|
41
|
+
}
|
|
42
|
+
/** Choose and dispatch one exact command from the session's live vocabulary. */
|
|
43
|
+
| {
|
|
44
|
+
kind: 'command-picker';
|
|
45
|
+
commands: readonly CommandPickerEntry[];
|
|
34
46
|
} | {
|
|
35
47
|
kind: 'exit';
|
|
36
48
|
}
|
|
@@ -38,10 +50,19 @@ export type SlashAction = {
|
|
|
38
50
|
| {
|
|
39
51
|
kind: 'clear-screen';
|
|
40
52
|
}
|
|
53
|
+
/** Replace the command invocation with an operator-editable composer draft. */
|
|
54
|
+
| {
|
|
55
|
+
kind: 'composer-draft';
|
|
56
|
+
text: string;
|
|
57
|
+
}
|
|
41
58
|
/** Start a fresh conversation, optionally clearing the rendered transcript too. */
|
|
42
59
|
| {
|
|
43
60
|
kind: 'new-conversation';
|
|
44
61
|
clearScreen: boolean;
|
|
62
|
+
}
|
|
63
|
+
/** Confirm before making the current durable conversation read-only and exiting. */
|
|
64
|
+
| {
|
|
65
|
+
kind: 'archive-picker';
|
|
45
66
|
} | {
|
|
46
67
|
kind: 'repick';
|
|
47
68
|
}
|
|
@@ -62,6 +83,11 @@ export type SlashAction = {
|
|
|
62
83
|
/** Open the current model's finite reasoning-effort chooser. */
|
|
63
84
|
| {
|
|
64
85
|
kind: 'reasoning-effort-picker';
|
|
86
|
+
}
|
|
87
|
+
/** Open the finite good/bad chooser for one exact assistant message. */
|
|
88
|
+
| {
|
|
89
|
+
kind: 'feedback-picker';
|
|
90
|
+
messageId: string;
|
|
65
91
|
} | {
|
|
66
92
|
kind: 'remember';
|
|
67
93
|
text: string;
|
|
@@ -69,6 +95,8 @@ export type SlashAction = {
|
|
|
69
95
|
kind: 'show-memory';
|
|
70
96
|
} | {
|
|
71
97
|
kind: 'list-skills';
|
|
98
|
+
} | {
|
|
99
|
+
kind: 'skill-picker';
|
|
72
100
|
} | {
|
|
73
101
|
kind: 'load-skill';
|
|
74
102
|
name: string;
|
|
@@ -76,12 +104,12 @@ export type SlashAction = {
|
|
|
76
104
|
kind: 'resume';
|
|
77
105
|
}
|
|
78
106
|
/**
|
|
79
|
-
* Name this conversation,
|
|
107
|
+
* Name this conversation, open its name editor, or take the name away.
|
|
80
108
|
*
|
|
81
109
|
* Its own kind rather than a message, because the write touches the
|
|
82
|
-
* session store and this union is pure. An empty `title` means "
|
|
83
|
-
* an explicit clear is the literal word, so a person cannot erase
|
|
84
|
-
* by pressing enter on a half-typed command.
|
|
110
|
+
* session store and this union is pure. An empty `title` means "open the
|
|
111
|
+
* editor"; an explicit clear is the literal word, so a person cannot erase
|
|
112
|
+
* a name by pressing enter on a half-typed command.
|
|
85
113
|
*/
|
|
86
114
|
| {
|
|
87
115
|
kind: 'title';
|
|
@@ -117,10 +145,14 @@ export type SlashAction = {
|
|
|
117
145
|
kind: 'raw';
|
|
118
146
|
enabled: boolean | 'toggle';
|
|
119
147
|
}
|
|
148
|
+
/** Choose whether the verified Markdown projection goes to the clipboard or a file. */
|
|
149
|
+
| {
|
|
150
|
+
kind: 'export-picker';
|
|
151
|
+
}
|
|
120
152
|
/** Write a verified, no-clobber Markdown projection of this conversation. */
|
|
121
153
|
| {
|
|
122
154
|
kind: 'export';
|
|
123
|
-
path
|
|
155
|
+
path: string;
|
|
124
156
|
}
|
|
125
157
|
/**
|
|
126
158
|
* Show what is uncommitted in the working tree.
|
|
@@ -140,6 +172,7 @@ export type SlashAction = {
|
|
|
140
172
|
*/
|
|
141
173
|
| {
|
|
142
174
|
kind: 'review';
|
|
175
|
+
instructions?: string;
|
|
143
176
|
}
|
|
144
177
|
/**
|
|
145
178
|
* A command the KERNEL registered, to be dispatched and rendered.
|
|
@@ -206,10 +239,13 @@ export type SlashAction = {
|
|
|
206
239
|
pasted?: string;
|
|
207
240
|
} | {
|
|
208
241
|
kind: 'logout';
|
|
242
|
+
target?: 'anthropic' | 'codex' | 'all';
|
|
209
243
|
} | {
|
|
210
244
|
kind: 'none';
|
|
211
245
|
};
|
|
212
246
|
export interface SlashContext {
|
|
247
|
+
/** Canonical working directory owned by this TUI session. */
|
|
248
|
+
readonly cwd: string;
|
|
213
249
|
/**
|
|
214
250
|
* Every tool the agent can call, read when the command runs.
|
|
215
251
|
*
|
|
@@ -233,13 +269,13 @@ export interface SlashContext {
|
|
|
233
269
|
*/
|
|
234
270
|
readonly sandbox: SandboxSummary | null;
|
|
235
271
|
/**
|
|
236
|
-
* Tool servers
|
|
272
|
+
* Tool servers as they stand when the command runs.
|
|
237
273
|
*
|
|
238
274
|
* `null` before a session exists. Reported at connect time as transcript
|
|
239
275
|
* rows that scroll away, and nowhere else — so an operator ten minutes into
|
|
240
276
|
* a session had no way to ask which servers answered and which did not.
|
|
241
277
|
*/
|
|
242
|
-
readonly mcp: {
|
|
278
|
+
readonly mcp: () => {
|
|
243
279
|
readonly connected: readonly {
|
|
244
280
|
readonly name: string;
|
|
245
281
|
readonly tools: readonly string[];
|
|
@@ -501,7 +537,11 @@ export declare function renderCost(usage: SlashContext['usage']): string;
|
|
|
501
537
|
* review of whatever fitted.
|
|
502
538
|
*/
|
|
503
539
|
export declare function reviewPrompt(stat: string, untracked: readonly string[]): string;
|
|
504
|
-
|
|
540
|
+
/** Review a branch comparison already resolved by the host to an immutable commit. */
|
|
541
|
+
export declare function baseBranchReviewPrompt(mergeBaseSha: string): string;
|
|
542
|
+
/** Review one immutable commit without asking the model to resolve a mutable ref. */
|
|
543
|
+
export declare function commitReviewPrompt(sha: string): string;
|
|
544
|
+
export declare function renderMcp(mcp: ReturnType<SlashContext['mcp']>): string;
|
|
505
545
|
export declare function renderStatus(ctx: SlashContext): string;
|
|
506
546
|
export declare function renderPermissions(permissions: SlashContext['permissions']): string;
|
|
507
547
|
/** Render the exact session control without inventing a global effort menu. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slashCommands.d.ts","sourceRoot":"","sources":["../../src/tui/slashCommands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAE5B,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,KAAK,mBAAmB,EAAqB,MAAM,oBAAoB,CAAA;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,KAAK,cAAc,EAAoB,MAAM,wBAAwB,CAAA;AAC9E,OAAO,EAAE,KAAK,WAAW,EAAiB,MAAM,2BAA2B,CAAA;AAG3E,MAAM,MAAM,WAAW,GACpB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"slashCommands.d.ts","sourceRoot":"","sources":["../../src/tui/slashCommands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAE5B,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,KAAK,mBAAmB,EAAqB,MAAM,oBAAoB,CAAA;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE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E,SAAS,YAAY,EAAuB,GACpD,WAAW,GAAG,IAAI,CAwBpB"}
|
|
@@ -27,6 +27,12 @@ import { renderConfigDebug } from '../config/debug.js';
|
|
|
27
27
|
import { isPermissionMode } from '../permissions/mode.js';
|
|
28
28
|
import { expandCommand } from '../user-commands/store.js';
|
|
29
29
|
import { isCompletionArgument } from './login-prompt.js';
|
|
30
|
+
function renameConversationAction(_ctx, args) {
|
|
31
|
+
const text = args.join(' ').trim();
|
|
32
|
+
if (text.toLowerCase() === 'clear')
|
|
33
|
+
return { kind: 'title', title: '', clear: true };
|
|
34
|
+
return { kind: 'title', title: text, clear: false };
|
|
35
|
+
}
|
|
30
36
|
/**
|
|
31
37
|
* Autocomplete matches for a composer value that is a command-in-progress
|
|
32
38
|
* (`/`, `/me`, `/mo…` — slash + a partial name, no space yet). Returns []
|
|
@@ -55,7 +61,16 @@ builtins = CLI_LOCAL_COMMANDS) {
|
|
|
55
61
|
description: c.problem ? `⚠ ${c.problem}` : c.description,
|
|
56
62
|
action: () => ({ kind: 'none' }),
|
|
57
63
|
}));
|
|
58
|
-
|
|
64
|
+
const matches = [...builtins, ...own].filter((command) => command.name.startsWith(prefix));
|
|
65
|
+
if (prefix.length === 0)
|
|
66
|
+
return matches;
|
|
67
|
+
const exact = matches.findIndex((command) => command.name === prefix);
|
|
68
|
+
if (exact <= 0)
|
|
69
|
+
return matches;
|
|
70
|
+
const exactMatch = matches[exact];
|
|
71
|
+
if (!exactMatch)
|
|
72
|
+
return matches;
|
|
73
|
+
return [exactMatch, ...matches.slice(0, exact), ...matches.slice(exact + 1)];
|
|
59
74
|
}
|
|
60
75
|
/** A registry command whose name a CLI-local one already answers to. */
|
|
61
76
|
export class CommandNameCollisionError extends Error {
|
|
@@ -183,32 +198,42 @@ export function parseSlash(line) {
|
|
|
183
198
|
export const CLI_LOCAL_COMMANDS = [
|
|
184
199
|
{
|
|
185
200
|
name: 'help',
|
|
186
|
-
description: '
|
|
201
|
+
description: 'Choose and run an available slash command.',
|
|
187
202
|
action: (ctx) => {
|
|
188
|
-
// Reads what this session OFFERS, not a module constant. A command
|
|
189
|
-
//
|
|
190
|
-
//
|
|
191
|
-
|
|
192
|
-
// Listed separately and always, including the refused ones with their
|
|
193
|
-
// reason. A command file that exists and does not work is exactly what
|
|
194
|
-
// its author needs to see here — leaving it out of `/help` is how it
|
|
195
|
-
// stays broken.
|
|
196
|
-
const own = ctx.userCommands.map((c) => c.problem
|
|
197
|
-
? `/${c.name.padEnd(12)} ⚠ ${c.problem}`
|
|
198
|
-
: `/${c.name.padEnd(12)} ${c.description}`);
|
|
203
|
+
// Reads what this session OFFERS, not a module constant. A command the
|
|
204
|
+
// kernel registered and `/help` did not list is a command nobody
|
|
205
|
+
// discovers. Refused command files remain rows with their reason; App
|
|
206
|
+
// refuses those rows instead of silently invoking a same-named builtin.
|
|
199
207
|
return {
|
|
200
|
-
kind: '
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
208
|
+
kind: 'command-picker',
|
|
209
|
+
commands: [
|
|
210
|
+
...(ctx.builtins ?? CLI_LOCAL_COMMANDS).map((command) => ({
|
|
211
|
+
name: command.name,
|
|
212
|
+
description: command.description,
|
|
213
|
+
})),
|
|
214
|
+
...ctx.userCommands.map((command) => ({
|
|
215
|
+
name: command.name,
|
|
216
|
+
description: command.description,
|
|
217
|
+
...(command.problem ? { problem: command.problem } : {}),
|
|
218
|
+
})),
|
|
219
|
+
],
|
|
205
220
|
};
|
|
206
221
|
},
|
|
207
222
|
},
|
|
208
223
|
{
|
|
209
224
|
name: 'feedback',
|
|
210
|
-
description: 'Rate the last answer
|
|
225
|
+
description: 'Rate the last answer; choose good/bad or add an optional note.',
|
|
211
226
|
action: (ctx, args) => {
|
|
227
|
+
if (args.length === 0) {
|
|
228
|
+
const messageId = ctx.lastAssistantMessageId();
|
|
229
|
+
return messageId
|
|
230
|
+
? { kind: 'feedback-picker', messageId }
|
|
231
|
+
: {
|
|
232
|
+
kind: 'message',
|
|
233
|
+
role: 'system',
|
|
234
|
+
content: 'Nothing to rate yet — /feedback applies to the last answer in this run.',
|
|
235
|
+
};
|
|
236
|
+
}
|
|
212
237
|
const [rating, ...rest] = args;
|
|
213
238
|
if (rating !== 'good' && rating !== 'bad') {
|
|
214
239
|
return {
|
|
@@ -243,6 +268,11 @@ export const CLI_LOCAL_COMMANDS = [
|
|
|
243
268
|
description: 'Start a fresh conversation without clearing the terminal.',
|
|
244
269
|
action: () => ({ kind: 'new-conversation', clearScreen: false }),
|
|
245
270
|
},
|
|
271
|
+
{
|
|
272
|
+
name: 'archive',
|
|
273
|
+
description: 'Archive this conversation and exit after confirmation.',
|
|
274
|
+
action: () => ({ kind: 'archive-picker' }),
|
|
275
|
+
},
|
|
246
276
|
{
|
|
247
277
|
name: 'clear-screen',
|
|
248
278
|
description: 'Clear only the terminal transcript; keep this conversation context.',
|
|
@@ -289,18 +319,15 @@ export const CLI_LOCAL_COMMANDS = [
|
|
|
289
319
|
: { kind: 'remember', text };
|
|
290
320
|
},
|
|
291
321
|
},
|
|
322
|
+
{
|
|
323
|
+
name: 'rename',
|
|
324
|
+
description: 'Rename this conversation; opens an editor when no name is supplied.',
|
|
325
|
+
action: renameConversationAction,
|
|
326
|
+
},
|
|
292
327
|
{
|
|
293
328
|
name: 'title',
|
|
294
|
-
description: '
|
|
295
|
-
action:
|
|
296
|
-
const text = args.join(' ').trim();
|
|
297
|
-
// `clear` is a word, not an empty argument. Bare `/title` is the
|
|
298
|
-
// question — the reading a person expects, and the one that cannot
|
|
299
|
-
// destroy anything by being typed early.
|
|
300
|
-
if (text.toLowerCase() === 'clear')
|
|
301
|
-
return { kind: 'title', title: '', clear: true };
|
|
302
|
-
return { kind: 'title', title: text, clear: false };
|
|
303
|
-
},
|
|
329
|
+
description: 'Alias for /rename; /title clear removes the saved name.',
|
|
330
|
+
action: renameConversationAction,
|
|
304
331
|
},
|
|
305
332
|
{
|
|
306
333
|
name: 'fork',
|
|
@@ -314,14 +341,26 @@ export const CLI_LOCAL_COMMANDS = [
|
|
|
314
341
|
},
|
|
315
342
|
{
|
|
316
343
|
name: 'skills',
|
|
317
|
-
description: '
|
|
318
|
-
action: () =>
|
|
344
|
+
description: 'Choose an available skill; use /skills list for the full roster.',
|
|
345
|
+
action: (_ctx, args) => {
|
|
346
|
+
const choice = args.join(' ').trim();
|
|
347
|
+
if (choice.length === 0)
|
|
348
|
+
return { kind: 'skill-picker' };
|
|
349
|
+
if (choice.toLowerCase() === 'list')
|
|
350
|
+
return { kind: 'list-skills' };
|
|
351
|
+
return { kind: 'load-skill', name: choice };
|
|
352
|
+
},
|
|
319
353
|
},
|
|
320
354
|
{
|
|
321
355
|
name: 'resume',
|
|
322
356
|
description: 'Resume a past conversation in this folder.',
|
|
323
357
|
action: () => ({ kind: 'resume' }),
|
|
324
358
|
},
|
|
359
|
+
{
|
|
360
|
+
name: 'mention',
|
|
361
|
+
description: 'Insert @ so a project file can be mentioned in the next prompt.',
|
|
362
|
+
action: () => ({ kind: 'composer-draft', text: '@' }),
|
|
363
|
+
},
|
|
325
364
|
{
|
|
326
365
|
name: 'expand',
|
|
327
366
|
description: 'Print a collapsed tool output in full: /expand [n].',
|
|
@@ -352,16 +391,10 @@ export const CLI_LOCAL_COMMANDS = [
|
|
|
352
391
|
},
|
|
353
392
|
{
|
|
354
393
|
name: 'skill',
|
|
355
|
-
description: '
|
|
394
|
+
description: 'Alias for /skills; choose a skill or type its name.',
|
|
356
395
|
action: (_ctx, args) => {
|
|
357
396
|
const name = args.join(' ').trim();
|
|
358
|
-
return name.length === 0
|
|
359
|
-
? {
|
|
360
|
-
kind: 'message',
|
|
361
|
-
role: 'system',
|
|
362
|
-
content: 'Usage: /skill <name> (see /skills)',
|
|
363
|
-
}
|
|
364
|
-
: { kind: 'load-skill', name };
|
|
397
|
+
return name.length === 0 ? { kind: 'skill-picker' } : { kind: 'load-skill', name };
|
|
365
398
|
},
|
|
366
399
|
},
|
|
367
400
|
{
|
|
@@ -375,6 +408,11 @@ export const CLI_LOCAL_COMMANDS = [
|
|
|
375
408
|
: `Provider: ${ctx.providerSummary}${ctx.modelSummary ? `\nModel: ${ctx.modelSummary}` : ''}`,
|
|
376
409
|
}),
|
|
377
410
|
},
|
|
411
|
+
{
|
|
412
|
+
name: 'pwd',
|
|
413
|
+
description: 'Show the active working directory.',
|
|
414
|
+
action: (ctx) => ({ kind: 'message', role: 'system', content: ctx.cwd }),
|
|
415
|
+
},
|
|
378
416
|
{
|
|
379
417
|
name: 'model',
|
|
380
418
|
description: 'Re-open the provider picker to switch the primary provider.',
|
|
@@ -389,8 +427,24 @@ export const CLI_LOCAL_COMMANDS = [
|
|
|
389
427
|
},
|
|
390
428
|
{
|
|
391
429
|
name: 'logout',
|
|
392
|
-
description: 'Remove
|
|
393
|
-
action: () =>
|
|
430
|
+
description: 'Remove a Namzu-owned subscription credential: /logout [claude|codex|all].',
|
|
431
|
+
action: (_ctx, args) => {
|
|
432
|
+
const target = args.join(' ').trim().toLowerCase();
|
|
433
|
+
if (target.length === 0)
|
|
434
|
+
return { kind: 'logout' };
|
|
435
|
+
if (target === 'claude' || target === 'anthropic') {
|
|
436
|
+
return { kind: 'logout', target: 'anthropic' };
|
|
437
|
+
}
|
|
438
|
+
if (target === 'codex' || target === 'chatgpt')
|
|
439
|
+
return { kind: 'logout', target: 'codex' };
|
|
440
|
+
if (target === 'all')
|
|
441
|
+
return { kind: 'logout', target: 'all' };
|
|
442
|
+
return {
|
|
443
|
+
kind: 'message',
|
|
444
|
+
role: 'system',
|
|
445
|
+
content: 'Usage: /logout [claude|codex|all]',
|
|
446
|
+
};
|
|
447
|
+
},
|
|
394
448
|
},
|
|
395
449
|
{
|
|
396
450
|
name: 'cost',
|
|
@@ -403,16 +457,19 @@ export const CLI_LOCAL_COMMANDS = [
|
|
|
403
457
|
},
|
|
404
458
|
{
|
|
405
459
|
name: 'review',
|
|
406
|
-
description: '
|
|
407
|
-
action: () =>
|
|
460
|
+
description: 'Choose a review target, or provide custom instructions: /review [instructions].',
|
|
461
|
+
action: (_ctx, args) => {
|
|
462
|
+
const instructions = args.join(' ').trim();
|
|
463
|
+
return instructions ? { kind: 'review', instructions } : { kind: 'review' };
|
|
464
|
+
},
|
|
408
465
|
},
|
|
409
466
|
{
|
|
410
467
|
name: 'mcp',
|
|
411
|
-
description: 'Show
|
|
468
|
+
description: 'Show current tool-server connections, tools, and failures.',
|
|
412
469
|
action: (ctx) => ({
|
|
413
470
|
kind: 'message',
|
|
414
471
|
role: 'system',
|
|
415
|
-
content: renderMcp(ctx.mcp),
|
|
472
|
+
content: renderMcp(ctx.mcp()),
|
|
416
473
|
}),
|
|
417
474
|
},
|
|
418
475
|
{
|
|
@@ -450,10 +507,10 @@ export const CLI_LOCAL_COMMANDS = [
|
|
|
450
507
|
},
|
|
451
508
|
{
|
|
452
509
|
name: 'export',
|
|
453
|
-
description: '
|
|
510
|
+
description: 'Export this verified conversation to the clipboard or a Markdown file.',
|
|
454
511
|
action: (_ctx, args) => {
|
|
455
512
|
const path = args.join(' ').trim();
|
|
456
|
-
return
|
|
513
|
+
return path.length > 0 ? { kind: 'export', path } : { kind: 'export-picker' };
|
|
457
514
|
},
|
|
458
515
|
},
|
|
459
516
|
{
|
|
@@ -707,6 +764,31 @@ export function reviewPrompt(stat, untracked) {
|
|
|
707
764
|
lines.push('', 'Read what you need — the diff, the files around it, the tests. Then report:', '', '- Correctness problems, each tied to a file and line, with the input or', ' state that produces the wrong behaviour. If you cannot name one, do not', ' raise the finding.', '- Anything the change claims in a comment or a message that the code does', ' not do.', '- Tests that would pass whether or not the change is correct.', '', 'Do not summarise the diff back to me — I can read it, and a summary is what', 'a review turns into when it has nothing to say. If the work looks right,', 'say so in one line and stop. Say plainly what you did not examine.');
|
|
708
765
|
return lines.join('\n');
|
|
709
766
|
}
|
|
767
|
+
/** Review a branch comparison already resolved by the host to an immutable commit. */
|
|
768
|
+
export function baseBranchReviewPrompt(mergeBaseSha) {
|
|
769
|
+
return reviewTargetPrompt([
|
|
770
|
+
'Review the changes between the current working tree and its selected base branch.',
|
|
771
|
+
`The host resolved the merge base to ${mergeBaseSha}.`,
|
|
772
|
+
`Use \`git diff ${mergeBaseSha}\` as the comparison boundary.`,
|
|
773
|
+
]);
|
|
774
|
+
}
|
|
775
|
+
/** Review one immutable commit without asking the model to resolve a mutable ref. */
|
|
776
|
+
export function commitReviewPrompt(sha) {
|
|
777
|
+
return reviewTargetPrompt([
|
|
778
|
+
`Review the code changes introduced by commit ${sha}.`,
|
|
779
|
+
`Use \`git show --stat --oneline ${sha}\` and \`git diff ${sha}^ ${sha}\` as the boundary.`,
|
|
780
|
+
]);
|
|
781
|
+
}
|
|
782
|
+
function reviewTargetPrompt(target) {
|
|
783
|
+
return [
|
|
784
|
+
...target,
|
|
785
|
+
'',
|
|
786
|
+
'Read the changed files and surrounding code, then report prioritized, actionable findings.',
|
|
787
|
+
'Every finding must name the file, line and concrete state that produces the wrong behavior.',
|
|
788
|
+
'Do not summarize the change back to me. If there are no findings, say so in one line.',
|
|
789
|
+
'Say plainly what you did not examine.',
|
|
790
|
+
].join('\n');
|
|
791
|
+
}
|
|
710
792
|
export function renderMcp(mcp) {
|
|
711
793
|
if (mcp === null)
|
|
712
794
|
return 'No session yet — no tool servers have been contacted.';
|