@andorra-labs/code 0.1.13 → 0.1.15
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/src/account-presentation.js +4 -1
- package/dist/src/acp-agent.d.ts +54 -0
- package/dist/src/acp-agent.js +991 -0
- package/dist/src/agent-execution.js +304 -140
- package/dist/src/agent-mcp-catalog.js +2 -0
- package/dist/src/agent-mcp.d.ts +2 -0
- package/dist/src/agent-mcp.js +86 -4
- package/dist/src/andorra/endpoint.d.ts +7 -0
- package/dist/src/andorra/endpoint.js +46 -0
- package/dist/src/andorra/entry.d.ts +21 -0
- package/dist/src/andorra/entry.js +118 -0
- package/dist/src/andorra/errors.d.ts +2 -0
- package/dist/src/andorra/errors.js +39 -0
- package/dist/src/andorra/hosted.d.ts +55 -0
- package/dist/src/andorra/hosted.js +130 -0
- package/dist/src/andorra/monitor.d.ts +151 -0
- package/dist/src/andorra/monitor.js +393 -0
- package/dist/src/andorra/notices.d.ts +16 -0
- package/dist/src/andorra/notices.js +38 -0
- package/dist/src/andorra/opt-in.d.ts +58 -0
- package/dist/src/andorra/opt-in.js +112 -0
- package/dist/src/andorra/request-watch.d.ts +6 -0
- package/dist/src/andorra/request-watch.js +10 -0
- package/dist/src/andorra/state.d.ts +86 -0
- package/dist/src/andorra/state.js +238 -0
- package/dist/src/andorra/terminal.d.ts +70 -0
- package/dist/src/andorra/terminal.js +125 -0
- package/dist/src/andorra/usage-format.d.ts +9 -0
- package/dist/src/andorra/usage-format.js +19 -0
- package/dist/src/anthropic-credentials.js +9 -1
- package/dist/src/app-server/protocol.d.ts +10 -2
- package/dist/src/app-server/protocol.js +1 -1
- package/dist/src/app-server/workspace.d.ts +1 -0
- package/dist/src/app-server/workspace.js +141 -10
- package/dist/src/app-server.d.ts +35 -0
- package/dist/src/app-server.js +377 -124
- package/dist/src/auth/AuthManager.d.ts +9 -0
- package/dist/src/auth/AuthManager.js +164 -24
- package/dist/src/auth/deployment.d.ts +1 -0
- package/dist/src/auth/deployment.js +1 -0
- package/dist/src/auth/index.d.ts +1 -1
- package/dist/src/auth/index.js +1 -1
- package/dist/src/auth/store.d.ts +26 -0
- package/dist/src/auth/store.js +34 -1
- package/dist/src/browser-bridge.d.ts +1 -0
- package/dist/src/browser-bridge.js +5 -2
- package/dist/src/browser-external-app.d.ts +27 -0
- package/dist/src/browser-external-app.js +60 -0
- package/dist/src/browser-panel-tool.d.ts +6 -0
- package/dist/src/browser-panel-tool.js +36 -0
- package/dist/src/browser-runner.js +1 -1
- package/dist/src/browser-server.d.ts +5 -0
- package/dist/src/browser-server.js +27 -3
- package/dist/src/browser-stealth.d.ts +19 -1
- package/dist/src/browser-stealth.js +23 -3
- package/dist/src/browser-ui/tokens.css +4 -4
- package/dist/src/browser-view.d.ts +81 -0
- package/dist/src/browser-view.js +289 -18
- package/dist/src/bug-report.d.ts +81 -0
- package/dist/src/bug-report.js +235 -0
- package/dist/src/claude-provider.d.ts +2 -1
- package/dist/src/claude-provider.js +10 -8
- package/dist/src/cli-sign-in.d.ts +3 -1
- package/dist/src/cli-sign-in.js +4 -1
- package/dist/src/cli.js +205 -58
- package/dist/src/coding-tools.js +7 -7
- package/dist/src/command-screens.d.ts +26 -3
- package/dist/src/command-screens.js +323 -85
- package/dist/src/commands.d.ts +7 -1
- package/dist/src/commands.js +79 -27
- package/dist/src/completion-gates.d.ts +22 -0
- package/dist/src/completion-gates.js +11 -0
- package/dist/src/config.d.ts +11 -1
- package/dist/src/config.js +134 -3
- package/dist/src/dashboard-view.d.ts +2 -0
- package/dist/src/dashboard-view.js +11 -2
- package/dist/src/decision/PreparedSteps.js +1 -1
- package/dist/src/decision/applyToolMenu.js +1 -1
- package/dist/src/decision/toolFamilies.js +1 -1
- package/dist/src/decision/types.d.ts +1 -0
- package/dist/src/google-provider.d.ts +31 -0
- package/dist/src/google-provider.js +153 -0
- package/dist/src/graph-health.d.ts +11 -0
- package/dist/src/graph-health.js +36 -4
- package/dist/src/graph-manager-chat.d.ts +33 -0
- package/dist/src/graph-manager-chat.js +165 -6
- package/dist/src/graph-runner.js +27 -0
- package/dist/src/graph-selection.js +2 -1
- package/dist/src/graph-sync.d.ts +1 -0
- package/dist/src/graph-sync.js +93 -34
- package/dist/src/graph-tool.d.ts +2 -0
- package/dist/src/graph-tool.js +2 -2
- package/dist/src/graph-ui/app.js +92 -10
- package/dist/src/graph-ui/edge-router.js +121 -53
- package/dist/src/graph-ui/manager.js +40 -5
- package/dist/src/graph-ui/style.css +5 -2
- package/dist/src/graph-ui/tokens.css +4 -4
- package/dist/src/graph-visibility.d.ts +31 -0
- package/dist/src/graph-visibility.js +102 -0
- package/dist/src/graphs.js +1 -3
- package/dist/src/hardened-runtime.js +1 -1
- package/dist/src/live-model.d.ts +24 -0
- package/dist/src/live-model.js +37 -0
- package/dist/src/managed-sign-in.d.ts +1 -0
- package/dist/src/managed-sign-in.js +13 -0
- package/dist/src/membership-errors.d.ts +2 -0
- package/dist/src/membership-errors.js +6 -2
- package/dist/src/membership.d.ts +13 -2
- package/dist/src/membership.js +39 -8
- package/dist/src/model-context-windows.d.ts +2 -0
- package/dist/src/model-context-windows.js +24 -0
- package/dist/src/model-health-cache.js +1 -1
- package/dist/src/model-metadata.d.ts +1 -0
- package/dist/src/model-metadata.js +47 -3
- package/dist/src/paged-transcript.d.ts +2 -0
- package/dist/src/paged-transcript.js +16 -0
- package/dist/src/palette.d.ts +1 -0
- package/dist/src/palette.js +1 -1
- package/dist/src/permissions.js +17 -4
- package/dist/src/provider-connection.js +32 -0
- package/dist/src/provider-engine.d.ts +5 -0
- package/dist/src/provider-engine.js +3 -3
- package/dist/src/provider-import.js +3 -1
- package/dist/src/provider-settings.d.ts +16 -1
- package/dist/src/provider-settings.js +50 -22
- package/dist/src/providers.d.ts +29 -3
- package/dist/src/providers.js +100 -18
- package/dist/src/react-runtime.js +33 -12
- package/dist/src/read-document-tool.d.ts +2 -0
- package/dist/src/read-document-tool.js +6 -6
- package/dist/src/remote/engine-pool.js +31 -6
- package/dist/src/run-control.d.ts +2 -2
- package/dist/src/run-control.js +9 -6
- package/dist/src/runtime-environment.d.ts +1 -0
- package/dist/src/runtime-environment.js +13 -0
- package/dist/src/runtime.d.ts +2 -0
- package/dist/src/runtime.js +2 -1
- package/dist/src/save-lock.js +14 -7
- package/dist/src/session-title.d.ts +3 -0
- package/dist/src/session-title.js +5 -2
- package/dist/src/sessions.d.ts +1 -0
- package/dist/src/sessions.js +4 -2
- package/dist/src/sign-in-detection.d.ts +1 -1
- package/dist/src/sign-in-detection.js +10 -3
- package/dist/src/sign-in-offer.js +1 -1
- package/dist/src/skill-commands.js +1 -1
- package/dist/src/skills/bundled/bug-report/SKILL.md +80 -0
- package/dist/src/skills/bundled/graph-manager/SKILL.md +9 -1
- package/dist/src/skills/bundled/graph-manager/errors.md +2 -1
- package/dist/src/skills/bundled/provenance.json +743 -738
- package/dist/src/skills/runtime-skills.js +1 -0
- package/dist/src/subagent-run.d.ts +2 -0
- package/dist/src/subagent-run.js +14 -3
- package/dist/src/telemetry/schema.d.ts +1 -1
- package/dist/src/telemetry/schema.js +2 -2
- package/dist/src/telemetry/uploader.d.ts +7 -1
- package/dist/src/telemetry/uploader.js +11 -2
- package/dist/src/terminal-links.d.ts +16 -0
- package/dist/src/terminal-links.js +113 -0
- package/dist/src/terminal-ui.d.ts +29 -1
- package/dist/src/terminal-ui.js +113 -24
- package/dist/src/tool-catalog.js +1 -1
- package/dist/src/trajectory.js +6 -1
- package/dist/src/transcript.d.ts +2 -0
- package/dist/src/transcript.js +5 -1
- package/dist/src/types.d.ts +5 -0
- package/dist/src/workspace-instructions.js +1 -1
- package/package.json +13 -1
package/dist/src/terminal-ui.js
CHANGED
|
@@ -4,15 +4,18 @@ import { PassThrough } from 'node:stream';
|
|
|
4
4
|
import { StringDecoder } from 'node:string_decoder';
|
|
5
5
|
import { stripVTControlCharacters } from 'node:util';
|
|
6
6
|
import stringWidth from 'string-width';
|
|
7
|
+
import { hyperlinkRow, wrappedLinks } from './terminal-links.js';
|
|
7
8
|
import { DashboardMetrics } from './dashboard.js';
|
|
8
9
|
import { dashboardRows } from './dashboard-view.js';
|
|
9
10
|
import { goalStatusLabel } from './session-goal.js';
|
|
10
11
|
import { transcriptColor } from './transcript.js';
|
|
12
|
+
import { ANDORRA_BUBBLE_SPEAKER, ANDORRA_BUBBLE_TAIL } from './andorra/notices.js';
|
|
11
13
|
import { ToolCallClock, toolHeaderRows } from './tool-call-clock.js';
|
|
12
14
|
import { formatDuration, formatHms } from './duration.js';
|
|
13
15
|
import { PagedTranscript } from './paged-transcript.js';
|
|
14
16
|
import { emptySelection, highlightRow, selectedSpan, selectedText, wordAt } from './screen-selection.js';
|
|
15
|
-
import { accentSgr, ATTACHMENT_TOKEN, ATTENTION, DIM, FAINT, GRAY, SKILL_CHIP, SUBTLE, WHITE } from './palette.js';
|
|
17
|
+
import { accentSgr, ATTACHMENT_TOKEN, ATTENTION, DIM, FAINT, GRAY, SKILL_CHIP, STATUS, SUBTLE, WHITE } from './palette.js';
|
|
18
|
+
import { usageTone } from './andorra/usage-format.js';
|
|
16
19
|
import { isCustomGraph, panelRowText, panelWidth, PANEL_MIN_COLUMNS, PANEL_MIN_ROWS, sidePanelRows, subagentTreeRows } from './side-panel.js';
|
|
17
20
|
import { TokenRateMeter } from './token-rate.js';
|
|
18
21
|
import { SubagentTracker } from './subagent-tree.js';
|
|
@@ -26,9 +29,9 @@ const SKILL_TOKEN = String.fromCodePoint(0x10FFFD);
|
|
|
26
29
|
const composerGraphemes = (text) => graphemes(text).flatMap(part => isToken(part) && part.length > 2 ? [part.slice(0, 2), part.slice(2)] : [part]);
|
|
27
30
|
const clean = (text) => stripVTControlCharacters(text).replace(/\r\n?/g, '\n').replace(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u202a-\u202e\u2066-\u2069]/g, '').replace(/[\u{100000}-\u{10FFFF}]/gu, '').replace(/\t/g, ' ');
|
|
28
31
|
const oneLine = (text) => clean(text).replace(/\n/g, ' ');
|
|
29
|
-
const commands = ['/model', '/providers', '/subagent', '/reasoning', '/graph', '/codegraph', '/dashboard', '/browser', '/attach', '/skills', '/skill', '/plugins', '/mcp', '/usage', '/permissions', '/yolo', '/jev', '/feedback', '/tools', '/session', '/status', '/clear', '/compact', '/goal', '/help', '/login', '/logout', '/auth status', '/auth logout', '/exit', '/quit'];
|
|
32
|
+
const commands = ['/model', '/providers', '/subagent', '/reasoning', '/graph', '/codegraph', '/dashboard', '/browser', '/attach', '/skills', '/skill', '/plugins', '/mcp', '/usage', '/permissions', '/yolo', '/jev', '/feedback', '/tools', '/session', '/resume', '/status', '/clear', '/compact', '/goal', '/help', '/login', '/logout', '/auth status', '/auth logout', '/exit', '/quit'];
|
|
30
33
|
const argumentCompletions = {
|
|
31
|
-
'/jev': ['/jev status', '/jev on', '/jev off'],
|
|
34
|
+
'/jev': ['/jev status', '/jev on', '/jev off', '/jev global on', '/jev global off'],
|
|
32
35
|
'/feedback': ['/feedback status', '/feedback on', '/feedback off'],
|
|
33
36
|
'/yolo': ['/yolo off', '/yolo on'],
|
|
34
37
|
'/reasoning': ['default', 'none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'].map(level => `/reasoning ${level}`),
|
|
@@ -58,7 +61,7 @@ const OVERRIDE_HINT = 'Choose a model to override the nodes with · /model';
|
|
|
58
61
|
const commandDescriptions = {
|
|
59
62
|
'/browser': 'Open the browser workspace',
|
|
60
63
|
'/attach': 'Attach a file or folder to your next task',
|
|
61
|
-
'/session': 'Browse and resume saved sessions',
|
|
64
|
+
'/session': 'Browse and resume saved sessions', '/resume': 'Browse and resume saved sessions',
|
|
62
65
|
'/login': 'Sign in or create an Andorra account', '/logout': 'Sign out of the Andorra account', '/logout codex': 'Sign out of every Codex account', '/auth logout': 'Sign out of the Andorra account', '/auth status': 'Account and membership status',
|
|
63
66
|
'/model': 'Choose a model', '/providers': 'Choose or edit providers',
|
|
64
67
|
'/subagent': 'Choose the provider and model external hosts run Andorra with',
|
|
@@ -66,7 +69,8 @@ const commandDescriptions = {
|
|
|
66
69
|
'/skill': 'Show the active skill', '/skill off': 'Pause the active skill', '/skill on': 'Resume the active skill', '/skill remove': 'End the active skill',
|
|
67
70
|
'/skills': 'Manage and install skills', '/plugins': 'Manage and install plugins',
|
|
68
71
|
'/mcp': 'Manage MCP servers',
|
|
69
|
-
'/jev': 'Turn Jev on or off for
|
|
72
|
+
'/jev': 'Turn Jev on or off for this session', '/jev on': 'Turn Jev on for this session', '/jev off': 'Turn Jev off for this session', '/jev status': 'Show the session and global Jev settings',
|
|
73
|
+
'/jev global on': 'Turn the Global Jev switch on', '/jev global off': 'Turn Jev off for every session and agent',
|
|
70
74
|
'/feedback': 'Show the anonymous-feedback setting; Paid accounts can turn it off', '/feedback on': 'Allow anonymous product feedback', '/feedback off': 'Stop anonymous product feedback (Paid plan)', '/feedback status': 'Show saved feedback setting',
|
|
71
75
|
'/graph': 'Choose a graph', '/codegraph': 'Code intelligence status and actions', '/usage': 'Usage and token totals', '/yolo': 'Turn automatic approvals on or off', '/yolo on': 'Approve everything for this session', '/yolo off': 'Restore Ask for approval',
|
|
72
76
|
'/permissions': 'Choose workspace permissions',
|
|
@@ -79,9 +83,9 @@ const submittedCommand = (value) => {
|
|
|
79
83
|
const [token] = value.trim().split(/\s+/);
|
|
80
84
|
return commands.some(command => command.split(/\s+/)[0] === token) ? token : undefined;
|
|
81
85
|
};
|
|
82
|
-
const workingCommandHint = (command) => `${command} doesn't run while a task is working.
|
|
86
|
+
const workingCommandHint = (command) => `${command} doesn't run while a task is working. Run ${command} once this task has finished.`
|
|
83
87
|
+ (command === '/graph' ? ' Switching graphs clears the previous graph progress and starts fresh.' : '');
|
|
84
|
-
const liveRunCommands = ['/browser', '/attach', '/yolo', '/permissions', '/jev', '/help', '/status', '/usage', '/tools', '/exit', '/quit'];
|
|
88
|
+
const liveRunCommands = ['/model', '/browser', '/attach', '/yolo', '/permissions', '/jev', '/help', '/status', '/usage', '/tools', '/exit', '/quit'];
|
|
85
89
|
const paint = (text, color = GRAY) => typeof color === 'number'
|
|
86
90
|
? `\x1b[38;5;${color}m${text}\x1b[0m`
|
|
87
91
|
: `\x1b[${color}m${text}\x1b[0m`;
|
|
@@ -294,6 +298,7 @@ export class TerminalUI extends EventEmitter {
|
|
|
294
298
|
finishTask() { this.runActive = false; this.dashboardMetrics.finishTask(); this.scheduleRender(); }
|
|
295
299
|
resetDashboardSession(usage) { this.dashboardMetrics.resetSession(usage); this.dashboardModel = 0; this.dashboardGraphOffset = 0; this.nodeModels.clear(); this.dashboardNotices = []; this.scheduleRender(); }
|
|
296
300
|
tokenClock;
|
|
301
|
+
sessionId;
|
|
297
302
|
speedMeters = new Map();
|
|
298
303
|
speedInvocations = new Map();
|
|
299
304
|
activeSpeedNode;
|
|
@@ -314,7 +319,7 @@ export class TerminalUI extends EventEmitter {
|
|
|
314
319
|
const modelLabel = typeof model === 'string' ? oneLine(model) : undefined;
|
|
315
320
|
const effort = typeof session.reasoningEffort === 'string' ? oneLine(session.reasoningEffort) : undefined;
|
|
316
321
|
if (providerLabel !== undefined && modelLabel !== undefined)
|
|
317
|
-
this.nodeModels.set(nodeId, oneLine(`${providerLabel}/${
|
|
322
|
+
this.nodeModels.set(nodeId, oneLine(`${providerLabel}/${this.modelText(provider, model)}`));
|
|
318
323
|
this.stampSpeedMeter(this.speedKey(nodeId, typeof session.copy === 'number' ? session.copy : undefined), providerLabel, modelLabel, effort);
|
|
319
324
|
}
|
|
320
325
|
if (event.type.startsWith('dashboard.'))
|
|
@@ -463,7 +468,7 @@ export class TerminalUI extends EventEmitter {
|
|
|
463
468
|
const perCopy = id === focus && this.activeSpeedCopy !== undefined ? node.copiesResolved?.get(this.activeSpeedCopy) : undefined;
|
|
464
469
|
const provider = perCopy?.provider ?? node.provider;
|
|
465
470
|
const model = perCopy?.model ?? node.model;
|
|
466
|
-
const label = provider !== undefined || model !== undefined ? `${provider ?? this.status.provider} / ${model ?? this.status.model}` : '';
|
|
471
|
+
const label = provider !== undefined || model !== undefined ? `${this.providerText(provider ?? this.status.provider)} / ${this.modelText(provider ?? this.status.provider, model ?? this.status.model)}` : '';
|
|
467
472
|
return { id, name: node.name, ...(detail ? { detail } : {}), ...(label ? { model: label } : {}) };
|
|
468
473
|
});
|
|
469
474
|
return sidePanelRows({
|
|
@@ -493,17 +498,50 @@ export class TerminalUI extends EventEmitter {
|
|
|
493
498
|
return padded + (text ? ` ${divider} ${text}` : ` ${divider}`);
|
|
494
499
|
});
|
|
495
500
|
}
|
|
501
|
+
/** What a person reads for a model: its display name when the provider has one (Andorra), else the id. */
|
|
502
|
+
// Model names are published only for the hosted Andorra provider, whose saved id is lower case;
|
|
503
|
+
// every other provider is shown by the id the user gave it.
|
|
504
|
+
providerText(provider) {
|
|
505
|
+
const names = this.status.modelNames;
|
|
506
|
+
return names && Object.hasOwn(names, provider) ? 'Andorra' : provider;
|
|
507
|
+
}
|
|
508
|
+
modelText(provider, model) {
|
|
509
|
+
const names = this.status.modelNames;
|
|
510
|
+
const own = names && Object.hasOwn(names, provider) ? names[provider] : undefined;
|
|
511
|
+
const name = own && Object.hasOwn(own, model) ? own[model] : undefined;
|
|
512
|
+
return typeof name === 'string' && name ? name : model;
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* The footer's Andorra usage segment, while an Andorra model is in play: the selected model, the model of the node
|
|
516
|
+
* answering, or an agent node of the shown graph resolves to an Andorra provider (a node without one runs the selected model).
|
|
517
|
+
* `forms` lists the texts to try, longest first; the footer shows the first that fits.
|
|
518
|
+
*/
|
|
519
|
+
andorraSegment() {
|
|
520
|
+
const usage = this.status.andorraUsage;
|
|
521
|
+
const andorra = new Set(this.status.andorraProviders ?? []);
|
|
522
|
+
if (!usage || andorra.size === 0)
|
|
523
|
+
return undefined;
|
|
524
|
+
const active = this.displayNode();
|
|
525
|
+
const inPlay = andorra.has(this.status.provider) || (active?.provider !== undefined && andorra.has(active.provider))
|
|
526
|
+
|| Object.values(this.status.graph?.nodes ?? {}).some(node => node.type === 'agent' && node.provider !== undefined && andorra.has(node.provider));
|
|
527
|
+
if (!inPlay)
|
|
528
|
+
return undefined;
|
|
529
|
+
if (usage.kind === 'not-available')
|
|
530
|
+
return { forms: ['Andorra: Not available', 'Andorra n/a'], color: FAINT };
|
|
531
|
+
const tone = usageTone(usage.usedPercent);
|
|
532
|
+
return { forms: [`Andorra ${usage.usedPercent}%`], color: tone === 'full' ? STATUS.error : tone === 'warn' ? STATUS.warn : GRAY };
|
|
533
|
+
}
|
|
496
534
|
activeModel() {
|
|
497
535
|
const node = this.displayNode();
|
|
498
536
|
if (!node)
|
|
499
|
-
return { label: oneLine(`${this.status.provider} / ${this.status.model}`), reasoningEffort: this.status.reasoningEffort, contextWindow: this.status.contextWindow };
|
|
537
|
+
return { label: oneLine(`${this.providerText(this.status.provider)} / ${this.modelText(this.status.provider, this.status.model)}`), reasoningEffort: this.status.reasoningEffort, contextWindow: this.status.contextWindow };
|
|
500
538
|
const more = this.activeNodes.size > 1 ? ` +${this.activeNodes.size - 1} more` : '';
|
|
501
539
|
const perCopy = this.activeSpeedCopy !== undefined ? node.copiesResolved?.get(this.activeSpeedCopy) : undefined;
|
|
502
540
|
const provider = perCopy?.provider ?? node.provider ?? this.status.provider;
|
|
503
541
|
const model = perCopy?.model ?? node.model ?? this.status.model;
|
|
504
542
|
const resolved = perCopy?.resolved ?? node.resolved;
|
|
505
543
|
return {
|
|
506
|
-
label: oneLine(`${node.name}${more} · ${provider} / ${model}`),
|
|
544
|
+
label: oneLine(`${node.name}${more} · ${this.providerText(provider)} / ${this.modelText(provider, model)}`),
|
|
507
545
|
reasoningEffort: resolved ? resolved.reasoningEffort : this.status.reasoningEffort,
|
|
508
546
|
contextWindow: resolved ? resolved.contextWindow : this.status.contextWindow,
|
|
509
547
|
};
|
|
@@ -518,6 +556,8 @@ export class TerminalUI extends EventEmitter {
|
|
|
518
556
|
value = [];
|
|
519
557
|
cursor = 0;
|
|
520
558
|
transcript = new PagedTranscript();
|
|
559
|
+
/** The newest transcript entry, while it is one that a later print with the same key rewrites. */
|
|
560
|
+
replaceable;
|
|
521
561
|
expandedTranscript = false;
|
|
522
562
|
todos = [];
|
|
523
563
|
expandedTodos = false;
|
|
@@ -619,6 +659,7 @@ export class TerminalUI extends EventEmitter {
|
|
|
619
659
|
this.appName = oneLine(options.appName ?? 'ANDORRA CODE');
|
|
620
660
|
this.status = { ...options };
|
|
621
661
|
this.tokenClock = options.tokenClock;
|
|
662
|
+
this.sessionId = options.sessionId;
|
|
622
663
|
this.clipboardImageProbe = options.clipboardImageProbe;
|
|
623
664
|
this.clipboardTextWriter = options.clipboardTextWriter;
|
|
624
665
|
emitKeypressEvents(this.keys);
|
|
@@ -716,7 +757,29 @@ export class TerminalUI extends EventEmitter {
|
|
|
716
757
|
let selected = Math.max(0, items.findIndex(item => item.id === options.selectedId));
|
|
717
758
|
while (items[selected]?.separator)
|
|
718
759
|
selected++;
|
|
719
|
-
|
|
760
|
+
const { refresh, ...rest } = options;
|
|
761
|
+
const opened = this.openModal({ kind: 'select', title, items: [...items], lines: [], selected, selectedId: options.selectedId, ...rest });
|
|
762
|
+
if (!refresh)
|
|
763
|
+
return opened;
|
|
764
|
+
const modal = this.modal;
|
|
765
|
+
const stop = refresh(next => {
|
|
766
|
+
// Only while this very select is the screen on top: a sub-screen opened from it is never redrawn under.
|
|
767
|
+
if (!modal || this.modal !== modal)
|
|
768
|
+
return;
|
|
769
|
+
const highlighted = modal.items[modal.selected]?.id;
|
|
770
|
+
modal.items = [...next];
|
|
771
|
+
const kept = modal.items.findIndex(item => item.id === highlighted && !item.separator);
|
|
772
|
+
modal.selected = kept >= 0 ? kept : Math.max(0, Math.min(modal.selected, modal.items.length - 1));
|
|
773
|
+
if (kept < 0)
|
|
774
|
+
this.moveSelection(modal, 0);
|
|
775
|
+
this.scheduleRender();
|
|
776
|
+
});
|
|
777
|
+
const done = () => { try {
|
|
778
|
+
stop();
|
|
779
|
+
}
|
|
780
|
+
catch { /* the caller's cleanup never breaks the screen */ } };
|
|
781
|
+
opened.then(done, done);
|
|
782
|
+
return opened;
|
|
720
783
|
}
|
|
721
784
|
moveSelection(modal, movement, homeEnd) {
|
|
722
785
|
const selectable = (index) => index >= 0 && index < modal.items.length && !modal.items[index].separator;
|
|
@@ -753,6 +816,9 @@ export class TerminalUI extends EventEmitter {
|
|
|
753
816
|
return Promise.reject(new Error('Terminal is closed'));
|
|
754
817
|
if (this.modal)
|
|
755
818
|
return Promise.reject(new Error('A terminal screen is already active'));
|
|
819
|
+
// A screen that yields to the run's questions never opens over one already asked: it yields at once.
|
|
820
|
+
if (options.yieldToQuestions && this.pending && !this.pending.conversationPrompt)
|
|
821
|
+
return Promise.reject(new DOMException('Screen yielded to a question', 'AbortError'));
|
|
756
822
|
if (options.signal?.aborted)
|
|
757
823
|
return Promise.reject(new DOMException('Screen aborted', 'AbortError'));
|
|
758
824
|
if (!this.started)
|
|
@@ -788,7 +854,7 @@ export class TerminalUI extends EventEmitter {
|
|
|
788
854
|
modal.resolve(value);
|
|
789
855
|
this.scheduleRender();
|
|
790
856
|
}
|
|
791
|
-
print(text, detail, toolCall, conversation = false, notice = true, alignRight = false, clipRows = false) {
|
|
857
|
+
print(text, detail, toolCall, conversation = false, notice = true, alignRight = false, clipRows = false, replaceKey) {
|
|
792
858
|
if (notice) {
|
|
793
859
|
this.dashboardNotices.push(clean(String(text)).slice(0, 100_000));
|
|
794
860
|
this.dashboardNotices = this.dashboardNotices.slice(-12);
|
|
@@ -798,9 +864,14 @@ export class TerminalUI extends EventEmitter {
|
|
|
798
864
|
this.modal.lines = [...this.modal.lines, ...lines].slice(-100);
|
|
799
865
|
const entry = { text: lines.join('\n'), ...(detail ? { detail: clean(detail) } : {}),
|
|
800
866
|
...(toolCall ? { toolCall, timing: this.toolClock.get(toolCall.key) } : {}), ...(conversation ? { conversation: true } : {}), ...(alignRight ? { alignRight: true } : {}), ...(clipRows && detail ? { clipRows: true } : {}) };
|
|
867
|
+
const replaced = replaceKey !== undefined && this.replaceable?.key === replaceKey ? this.replaceable.entry : undefined;
|
|
801
868
|
if (this.scroll)
|
|
802
|
-
this.scroll
|
|
803
|
-
|
|
869
|
+
this.scroll = Math.max(0, this.scroll + this.transcriptRows(entry, this.chatColumns()).length - (replaced ? this.transcriptRows(replaced, this.chatColumns()).length : 0));
|
|
870
|
+
if (replaced)
|
|
871
|
+
this.transcript.replaceLast(entry);
|
|
872
|
+
else
|
|
873
|
+
this.transcript.append(entry);
|
|
874
|
+
this.replaceable = replaceKey === undefined ? undefined : { key: replaceKey, entry };
|
|
804
875
|
this.scheduleRender();
|
|
805
876
|
}
|
|
806
877
|
printPrompt(text, title = '') {
|
|
@@ -844,6 +915,7 @@ export class TerminalUI extends EventEmitter {
|
|
|
844
915
|
if (this.scroll)
|
|
845
916
|
this.scroll += this.transcriptRows(entry, this.chatColumns()).length;
|
|
846
917
|
this.transcript.append(entry);
|
|
918
|
+
this.replaceable = undefined;
|
|
847
919
|
this.scheduleRender();
|
|
848
920
|
}
|
|
849
921
|
appendThinking(delta) {
|
|
@@ -865,6 +937,7 @@ export class TerminalUI extends EventEmitter {
|
|
|
865
937
|
if (this.closed)
|
|
866
938
|
return;
|
|
867
939
|
this.transcript.clear();
|
|
940
|
+
this.replaceable = undefined;
|
|
868
941
|
this.expandedTranscript = false;
|
|
869
942
|
this.expandedPromptIds.clear();
|
|
870
943
|
this.collapsedPromptIds.clear();
|
|
@@ -911,7 +984,8 @@ export class TerminalUI extends EventEmitter {
|
|
|
911
984
|
this.visitedNodes.clear();
|
|
912
985
|
this.stoppedNode = undefined;
|
|
913
986
|
}
|
|
914
|
-
|
|
987
|
+
const jevSettingChanged = partial.jevEnabled !== undefined && partial.jevEnabled !== this.status.jevEnabled && partial.jevOffThisRun === undefined;
|
|
988
|
+
this.status = { ...this.status, ...partial, ...(partial.activity !== undefined && partial.backgroundActivity === undefined ? { backgroundActivity: false } : {}), ...(jevSettingChanged ? { jevOffThisRun: false } : {}) };
|
|
915
989
|
if (partial.activity === 'Ready') {
|
|
916
990
|
this.activeNodes.clear();
|
|
917
991
|
this.toolClock.stop();
|
|
@@ -2302,7 +2376,8 @@ export class TerminalUI extends EventEmitter {
|
|
|
2302
2376
|
modal.offset = Math.max(0, Math.min(modal.offset, Math.max(0, content.length - viewport)));
|
|
2303
2377
|
const visible = content.slice(modal.offset, modal.offset + viewport);
|
|
2304
2378
|
const title = clip(` ${modal.title} `, cardWidth - 2);
|
|
2305
|
-
const
|
|
2379
|
+
const modalSession = oneLine(this.sessionId?.() ?? '');
|
|
2380
|
+
const rows = [paint(clip(`◈ ${this.appName}${modalSession ? ` ${modalSession}` : ''}`, width), GRAY), '', paint(` ╭${title}${'─'.repeat(Math.max(0, cardWidth - 2 - stringWidth(title)))}╮`, GRAY)];
|
|
2306
2381
|
for (const line of description)
|
|
2307
2382
|
rows.push(paint(' │ ', GRAY) + paint(pad(line, innerWidth), GRAY) + paint(' │', GRAY));
|
|
2308
2383
|
for (let index = 0; index < viewport; index++) {
|
|
@@ -2333,10 +2408,15 @@ export class TerminalUI extends EventEmitter {
|
|
|
2333
2408
|
const aligned = alignRight && stringWidth(line) <= allowance;
|
|
2334
2409
|
const lead = diff || box || isBrand || aligned ? undefined : /^\s*(?:(?:[•◦└]|\d{1,3}[.)])\s+)?/u.exec(line)?.[0];
|
|
2335
2410
|
const hang = lead ? stringWidth(lead) : 0;
|
|
2411
|
+
// The bubble's tail is part of its box; only the speaker's name keeps the text color.
|
|
2412
|
+
if (line === ANDORRA_BUBBLE_TAIL + ANDORRA_BUBBLE_SPEAKER)
|
|
2413
|
+
return [{ text: line, color, segments: [{ text: ANDORRA_BUBBLE_TAIL, color: GRAY }, { text: ANDORRA_BUBBLE_SPEAKER, color }] }];
|
|
2336
2414
|
const rows = lead && hang > 0 && hang <= allowance / 2 && stringWidth(line) > allowance
|
|
2337
2415
|
? wrap(line.slice(lead.length), allowance - hang).map((text, index) => (index ? ' '.repeat(hang) : lead) + text)
|
|
2338
2416
|
: wrap(line, allowance);
|
|
2339
|
-
|
|
2417
|
+
const shown = rows.map(text => aligned && text ? ' '.repeat(allowance - stringWidth(text)) + text : text);
|
|
2418
|
+
const links = wrappedLinks(line, shown);
|
|
2419
|
+
return shown.map((text, index) => ({ text, color, ...(links[index] ? { links: links[index] } : {}) }));
|
|
2340
2420
|
});
|
|
2341
2421
|
}
|
|
2342
2422
|
transcriptRows(entry, width) {
|
|
@@ -2367,7 +2447,8 @@ export class TerminalUI extends EventEmitter {
|
|
|
2367
2447
|
const rows = text.split('\n');
|
|
2368
2448
|
const elapsed = entry.timing ? formatDuration(this.toolClock.elapsed(entry.timing)) : undefined;
|
|
2369
2449
|
const right = [entry.toolCall.timestamp, elapsed].filter(Boolean).join(' · ');
|
|
2370
|
-
|
|
2450
|
+
// No blank row after a call: its result is the next entry and reads as part of it.
|
|
2451
|
+
return [...toolHeaderRows(rows[0], right, Math.max(1, width - 4)), ...rows.slice(1)].flatMap(row => this.wrapTranscript(row, width));
|
|
2371
2452
|
}
|
|
2372
2453
|
render() {
|
|
2373
2454
|
if (!this.started || this.closed)
|
|
@@ -2444,14 +2525,16 @@ export class TerminalUI extends EventEmitter {
|
|
|
2444
2525
|
revision: entry => entry.timing ? formatDuration(this.toolClock.elapsed(entry.timing)) ?? ''
|
|
2445
2526
|
: entry.promptDisclosure ? (this.promptExpanded(entry.promptDisclosure.id) ? 'expanded' : 'collapsed') : '' });
|
|
2446
2527
|
this.scroll = page.scroll;
|
|
2447
|
-
const visible = this.dashboard ? dashboardRows({ metrics: this.dashboardMetrics.snapshot(), selectedModel: this.dashboardModel, provider: this.status.provider, model: this.status.model, graph: this.status.graph, providerModels: this.status.providerModels, activeNodes: [...this.activeNodes.keys()], nodeModels: this.nodeModels, todos: this.todos, todoOffset: this.todoOffset, onTodoOffset: offset => { this.todoOffset = offset; }, graphOffset: this.dashboardGraphOffset, notices: this.dashboardNotices, question: this.pending && !this.pending.conversationPrompt ? this.pending.dashboardQuestion ?? this.pending.choiceTitle ?? this.pending.title ?? this.pending.label : undefined }, Math.max(2, width - 4), transcriptHeight).map(line => ({ text: panelRowText(line), color: DIM, segments: line.segments })) : page.rows;
|
|
2528
|
+
const visible = this.dashboard ? dashboardRows({ metrics: this.dashboardMetrics.snapshot(), selectedModel: this.dashboardModel, provider: this.status.provider, model: this.status.model, graph: this.status.graph, providerModels: this.status.providerModels, modelNames: this.status.modelNames, activeNodes: [...this.activeNodes.keys()], nodeModels: this.nodeModels, todos: this.todos, todoOffset: this.todoOffset, onTodoOffset: offset => { this.todoOffset = offset; }, graphOffset: this.dashboardGraphOffset, notices: this.dashboardNotices, question: this.pending && !this.pending.conversationPrompt ? this.pending.dashboardQuestion ?? this.pending.choiceTitle ?? this.pending.title ?? this.pending.label : undefined }, Math.max(2, width - 4), transcriptHeight).map(line => ({ text: panelRowText(line), color: DIM, segments: line.segments })) : page.rows;
|
|
2448
2529
|
while (visible.length < transcriptHeight)
|
|
2449
2530
|
visible.push({ text: '', color: DIM });
|
|
2450
2531
|
if (!this.dashboard && this.scroll && visible.length)
|
|
2451
2532
|
visible[0] = { text: `? Scrollback ? ${this.scroll} lines below ? Page Down to return`, color: DIM };
|
|
2452
2533
|
this.expandedPromptVisible = visible.some(row => row.promptExpanded);
|
|
2453
2534
|
const status = this.status;
|
|
2454
|
-
const
|
|
2535
|
+
const sessionId = oneLine(this.sessionId?.() ?? '');
|
|
2536
|
+
const title = sessionId ? `\u25c8 ${this.appName} ${sessionId}` : `\u25c8 ${this.appName}`;
|
|
2537
|
+
const top = this.dashboard ? `${title} \u00b7 Dashboard \u00b7 Ctrl+B transcript` : title;
|
|
2455
2538
|
const version = clip(`v${this.version}`, Math.floor(width / 3));
|
|
2456
2539
|
const header = paint(pad(top, width - stringWidth(version)), DIM) + paint(version, FAINT);
|
|
2457
2540
|
const label = choices ? this.pending?.choiceTitle || 'Choose an answer' : this.pending?.title ? this.pending.title : this.pending && !this.pending.regular ? 'Your approval' : this.pending?.conversationPrompt && this.value[0] === '/' ? 'Commands · Enter runs · Tab completes' : this.steering && status.activity && status.activity !== 'Ready' ? status.activity === 'Paused' ? 'Paused - Send direction to resume' : 'Steer this run · Enter to send' : '';
|
|
@@ -2463,7 +2546,7 @@ export class TerminalUI extends EventEmitter {
|
|
|
2463
2546
|
const workingLabel = clip(workingText, Math.max(0, width - 6));
|
|
2464
2547
|
const wave = Math.floor(elapsed / 120) % 11;
|
|
2465
2548
|
const topBorder = working && workingLabel ? paint('╭ ', GRAY) + [...workingLabel].map((character, index) => paint(character, index < 7 && Math.abs(index - wave) <= 1 ? 255 : GRAY)).join('') + paint(' ' + '─'.repeat(Math.max(0, width - 4 - stringWidth(workingLabel))) + '╮', GRAY) : paint('╭' + borderLabel + '─'.repeat(Math.max(0, width - 2 - stringWidth(borderLabel))) + '╮', GRAY);
|
|
2466
|
-
const lines = [header, paint(clip(` ${status.account ? `Account: ${oneLine(status.account.label)} | ` : ''}${oneLine(this.workspace)}`, width), FAINT), ...visible.map(line => line.segments ? ' ' + line.segments.map(segment => paint(segment.text, segment.color ?? GRAY)).join('') : paint(' ' + clip(line.text, width - 2), line.color)), ...thinkingLines.map(line => paint(' ' + pad(line, width - 4), GRAY)), ...agentLines, ...todoLines.map(line => paint(' ' + clip(line, width - 2), GRAY))];
|
|
2549
|
+
const lines = [header, paint(clip(` ${status.account ? `Account: ${oneLine(status.account.label)} | ` : ''}${oneLine(this.workspace)}`, width), FAINT), ...visible.map(line => line.segments ? ' ' + line.segments.map(segment => paint(segment.text, segment.color ?? GRAY)).join('') : paint(' ' + hyperlinkRow(clip(line.text, width - 2), line.links), line.color)), ...thinkingLines.map(line => paint(' ' + pad(line, width - 4), GRAY)), ...agentLines, ...todoLines.map(line => paint(' ' + clip(line, width - 2), GRAY))];
|
|
2467
2550
|
if (completion && popupRows) {
|
|
2468
2551
|
const cardWidth = width - 4;
|
|
2469
2552
|
const popupTitle = clip(' Commands · ↑↓ move · Enter runs · Tab completes ', cardWidth - 2);
|
|
@@ -2498,9 +2581,15 @@ export class TerminalUI extends EventEmitter {
|
|
|
2498
2581
|
const model = oneLine(`${active.label} · Thinking: ${active.reasoningEffort ?? 'provider default'}`);
|
|
2499
2582
|
const branch = oneLine(status.branch || 'no branch');
|
|
2500
2583
|
const branchWidth = Math.min(Math.floor(width / 3), stringWidth(branch) + 3);
|
|
2501
|
-
const jev = oneLine(status.account?.jevQuota ?? 'Jev unavailable').replace(/^Jev(?= )/, status.jevEnabled === false ? 'Jev [Disabled] ·' : status.jevEnabled === true ? 'Jev [Enabled] ·' : 'Jev');
|
|
2584
|
+
const jev = oneLine(status.account?.jevQuota ?? 'Jev unavailable').replace(/^Jev(?= )/, status.jevEnabled === false ? 'Jev [Disabled] ·' : status.jevEnabled === true ? (status.jevOffThisRun ? 'Jev [Off this run] ·' : 'Jev [Enabled] ·') : 'Jev');
|
|
2502
2585
|
const jevWidth = Math.min(stringWidth(jev), width - 1);
|
|
2503
|
-
|
|
2586
|
+
const andorraUsage = this.andorraSegment();
|
|
2587
|
+
const andorraText = andorraUsage?.forms.find(text => stringWidth(model) + 1 + stringWidth(text) + 3 + jevWidth <= width - 1);
|
|
2588
|
+
const andorraWidth = andorraText !== undefined ? stringWidth(andorraText) + 3 : 0;
|
|
2589
|
+
if (andorraUsage && andorraText !== undefined)
|
|
2590
|
+
lines.push(paint(pad(model, width - jevWidth - andorraWidth - 2) + ' ', GRAY) + paint(andorraText, andorraUsage.color) + paint(` · ${jev}`, GRAY));
|
|
2591
|
+
else
|
|
2592
|
+
lines.push(paint(pad(model, Math.max(0, width - jevWidth - 2)) + (width - jevWidth > 1 ? ' ' : '') + clip(jev, jevWidth), GRAY));
|
|
2504
2593
|
const graph = oneLine(`Graph: ${(status.graphSelection ?? (status.graph?.id === 'software-engineer' ? 'default' : status.graph?.id)) === 'default' ? 'Default' : status.graph?.name ?? 'Not selected'}${status.codeIntel ? ` · CodeGraph: ${status.codeIntel}` : ''}`);
|
|
2505
2594
|
if (!compactFooter)
|
|
2506
2595
|
lines.push(paint(pad(graph, width - branchWidth) + clip(`⎇ ${branch}`, branchWidth), GRAY));
|
package/dist/src/tool-catalog.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { toolFamily } from './decision/toolFamilies.js';
|
|
2
2
|
import { canonicalToolName } from './tool-names.js';
|
|
3
3
|
import { identifierTokens } from './context-selection.js';
|
|
4
|
-
const PROTECTED = new Set(['complete_agent', 'complete', 'complete_task', 'submit_completion', 'update_todos', 'ask_user', 'load_project_skill', 'restore_tools', 'prepare_steps', 'update_widget', 'Skill', 'read_skill_resource', 'expand_tool_output', 'read_artifact', 'write_artifact']);
|
|
4
|
+
const PROTECTED = new Set(['complete_agent', 'complete', 'complete_task', 'submit_completion', 'update_todos', 'ask_user', 'submit_bug_report', 'load_project_skill', 'restore_tools', 'prepare_steps', 'update_widget', 'Skill', 'read_skill_resource', 'expand_tool_output', 'read_artifact', 'write_artifact']);
|
|
5
5
|
const GIT_WORDS = /\b(git|commit|branch|rebase|merge|stash|diff|blame|checkout|pull request|pr\b|push|history|log)\b/i;
|
|
6
6
|
const MEMORY_WORDS = /\b(remember|recall|memory|previous(ly)?|last time|earlier|convention|decision history)\b/i;
|
|
7
7
|
const WEB_WORDS = /\b(docs?|documentation|https?:\/\/|url|website|web|online|latest version|api reference|changelog|npm package|look up|search the)\b/i;
|
package/dist/src/trajectory.js
CHANGED
|
@@ -12,6 +12,10 @@ function capReply(reply) {
|
|
|
12
12
|
return `[REDACTED: unparsable reply naming a browser tool, ${reply.length} characters]`;
|
|
13
13
|
return reply.length <= UNPARSED_REPLY_LIMIT ? reply : `${reply.slice(0, UNPARSED_REPLY_LIMIT)}… [${reply.length - UNPARSED_REPLY_LIMIT} more characters]`;
|
|
14
14
|
}
|
|
15
|
+
function connectionCauseOf(error) {
|
|
16
|
+
const cause = error?.connectionCause;
|
|
17
|
+
return typeof cause === 'string' && /^[A-Z][A-Z0-9_]{0,63}$/.test(cause) ? cause : undefined;
|
|
18
|
+
}
|
|
15
19
|
function unparsedReplyOf(error) {
|
|
16
20
|
const reply = error && typeof error === 'object' ? error.unparsedReply : undefined;
|
|
17
21
|
return typeof reply === 'string' ? reply : undefined;
|
|
@@ -365,7 +369,7 @@ export async function createSessionTrajectory(options = {}) {
|
|
|
365
369
|
const started = performance.now();
|
|
366
370
|
const forward = request.onRetry;
|
|
367
371
|
const onRetry = async ({ unparsedReply, ...retry }) => {
|
|
368
|
-
await record('model.retry', { ...metadata, durationMs: performance.now() - started, retry: retry.retry, reason: retry.reason,
|
|
372
|
+
await record('model.retry', { ...metadata, durationMs: performance.now() - started, retry: retry.retry, reason: retry.reason, ...(retry.cause === undefined ? {} : { cause: retry.cause }),
|
|
369
373
|
...(unparsedReply === undefined ? {} : { unparsedReply: capReply(unparsedReply) }) });
|
|
370
374
|
await forward?.(retry);
|
|
371
375
|
};
|
|
@@ -379,6 +383,7 @@ export async function createSessionTrajectory(options = {}) {
|
|
|
379
383
|
await record('model.error', {
|
|
380
384
|
...metadata, durationMs: performance.now() - started, aborted: request.signal.aborted,
|
|
381
385
|
error: { name: error instanceof Error ? error.name : 'Error', message: error instanceof Error ? error.message : String(error),
|
|
386
|
+
...(connectionCauseOf(error) === undefined ? {} : { connectionCause: connectionCauseOf(error) }),
|
|
382
387
|
...(unparsedReplyOf(error) === undefined ? {} : { unparsedReply: capReply(unparsedReplyOf(error)) }) },
|
|
383
388
|
});
|
|
384
389
|
throw error;
|
package/dist/src/transcript.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export interface TranscriptEntry {
|
|
|
7
7
|
detail?: string;
|
|
8
8
|
toolCall?: ToolCallStamp;
|
|
9
9
|
clipRows?: boolean;
|
|
10
|
+
/** A line with the same key that is still the newest one is rewritten by this entry, not followed by it. */
|
|
11
|
+
replaceKey?: string;
|
|
10
12
|
}
|
|
11
13
|
export declare function transcriptColor(text: string): number | string;
|
|
12
14
|
export declare function formatAnswer(summary: string): TranscriptEntry;
|
package/dist/src/transcript.js
CHANGED
|
@@ -43,7 +43,11 @@ export function describeTool(name, value) {
|
|
|
43
43
|
}
|
|
44
44
|
switch (name) {
|
|
45
45
|
case 'spawn_subagent': return `Delegate to ${line(args.role)}: ${line(args.task)}`;
|
|
46
|
+
case 'wait_subagent': return 'Wait for a subagent';
|
|
47
|
+
case 'message_subagent': return `Message a subagent: ${line(args.message)}`;
|
|
48
|
+
case 'cancel_subagent': return 'Stop a subagent';
|
|
46
49
|
case 'ask_user': return 'Ask a question';
|
|
50
|
+
case 'submit_bug_report': return `Send a bug report: ${line(args.title)}`;
|
|
47
51
|
case 'git_read':
|
|
48
52
|
case 'git_write': return `Git ${line(args.operation)}`;
|
|
49
53
|
case 'memory_search': return `Search memory for "${line(args.query)}"`;
|
|
@@ -117,7 +121,7 @@ export function formatEvent(event) {
|
|
|
117
121
|
if (event.type === 'agent.model.retry' && data.quiet === true)
|
|
118
122
|
return undefined;
|
|
119
123
|
if (event.type === 'agent.model.retry')
|
|
120
|
-
return { text: `\u2022 ${actor}Provider request retry ${line(data.retry)}/${line(data.maxRetries)} in ${formatRetryDelay(data.delayMs)}: ${line(data.reason)}` };
|
|
124
|
+
return { text: `\u2022 ${actor}Provider request retry ${line(data.retry)}/${line(data.maxRetries)} in ${formatRetryDelay(data.delayMs)}: ${line(data.reason)}${typeof data.cause === 'string' && /^[A-Z][A-Z0-9_]{0,63}$/.test(data.cause) ? ` (${data.cause})` : ''}`, replaceKey: `model-retry:${JSON.stringify([data.runId, data.nodeId, data.copy, data.subagentId, data.nodeName].map(part => part ?? null))}` };
|
|
121
125
|
if (event.type === 'graph.node.started')
|
|
122
126
|
return { text: `Step: ${line(data.nodeName ?? data.nodeId)}${Number(data.visit) > 1 ? ` (visit ${line(data.visit)})` : ''}` };
|
|
123
127
|
if (event.type === 'agent.modifier.iteration.started' && Number(data.maxIterations) > 1)
|
package/dist/src/types.d.ts
CHANGED
|
@@ -65,6 +65,8 @@ export interface ModelRetry {
|
|
|
65
65
|
reason: string;
|
|
66
66
|
quiet?: boolean;
|
|
67
67
|
unparsedReply?: string;
|
|
68
|
+
/** The system error code behind a connection that could not be made (`ECONNREFUSED`, `EAI_AGAIN`), for the record only: `reason` stays the plain sentence. */
|
|
69
|
+
cause?: string;
|
|
68
70
|
}
|
|
69
71
|
export interface GenerateRequest {
|
|
70
72
|
model: string;
|
|
@@ -109,7 +111,10 @@ export interface ToolContext {
|
|
|
109
111
|
runControl?: import('./run-control.js').RunControl;
|
|
110
112
|
workspace: string;
|
|
111
113
|
signal: AbortSignal;
|
|
114
|
+
toolCallId?: string;
|
|
115
|
+
toolInvocationId?: string;
|
|
112
116
|
userSignal?: AbortSignal;
|
|
117
|
+
steerSignal?: AbortSignal;
|
|
113
118
|
yolo: boolean;
|
|
114
119
|
permissions?: import('./permissions.js').PermissionMode;
|
|
115
120
|
pinFilePaths?: boolean;
|
|
@@ -13,7 +13,7 @@ export function selectGuideName(entries) {
|
|
|
13
13
|
return undefined;
|
|
14
14
|
}
|
|
15
15
|
// The system prompt override from Settings belongs to the Default graph (Andorra Agent) alone.
|
|
16
|
-
// Every other graph
|
|
16
|
+
// Every other graph reads the project's guide file. The Default
|
|
17
17
|
// selection runs as 'software-engineer' (SOFTWARE_ENGINEER_HARNESS in membership.ts).
|
|
18
18
|
export function systemPromptOverrideFor(graph, override) {
|
|
19
19
|
return graph.id === 'software-engineer' || graph.id === 'default' ? override : undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andorra-labs/code",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "Terminal-first coding agent with a ReAct graph runtime",
|
|
5
5
|
"homepage": "https://andorracode.com",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "node build.mjs",
|
|
33
|
+
"setup": "allow-scripts run",
|
|
33
34
|
"check": "node scripts/build-engine.mjs && tsc --noEmit && npm run check --prefix desktop",
|
|
34
35
|
"test": "npm run build && node scripts/run-tests.mjs",
|
|
35
36
|
"ci:local": "node scripts/ci-local.mjs",
|
|
@@ -46,6 +47,8 @@
|
|
|
46
47
|
"eval:jev:live": "node scripts/jev-efficiency-live.mjs"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
50
|
+
"@lavamoat/allow-scripts": "5.1.0",
|
|
51
|
+
"@lavamoat/preinstall-always-fail": "3.0.1",
|
|
49
52
|
"@types/cross-spawn": "6.0.6",
|
|
50
53
|
"@types/node": "^22.0.0",
|
|
51
54
|
"@types/proper-lockfile": "4.1.4",
|
|
@@ -53,6 +56,7 @@
|
|
|
53
56
|
"typescript": "~5.9.3"
|
|
54
57
|
},
|
|
55
58
|
"dependencies": {
|
|
59
|
+
"@agentclientprotocol/sdk": "2.9.1",
|
|
56
60
|
"@anthropic-ai/sdk": "0.124.0",
|
|
57
61
|
"@colbymchenry/codegraph": "^1.6.0",
|
|
58
62
|
"@google/genai": "2.21.0",
|
|
@@ -75,5 +79,13 @@
|
|
|
75
79
|
"string-width": "^8.2.2",
|
|
76
80
|
"typebox": "1.3.27",
|
|
77
81
|
"yaml": "2.9.0"
|
|
82
|
+
},
|
|
83
|
+
"lavamoat": {
|
|
84
|
+
"allowScripts": {
|
|
85
|
+
"@google/genai#2.21.0": false,
|
|
86
|
+
"@google/genai>protobufjs#7.6.6": false,
|
|
87
|
+
"node-pty#1.1.0": true,
|
|
88
|
+
"@lavamoat/preinstall-always-fail#3.0.1": false
|
|
89
|
+
}
|
|
78
90
|
}
|
|
79
91
|
}
|