@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
|
@@ -9,6 +9,8 @@ export interface DocumentReadOptions {
|
|
|
9
9
|
maxOutput: number;
|
|
10
10
|
maxLineChars: number;
|
|
11
11
|
}
|
|
12
|
+
/** The note a Read of anything but a PDF carries when the call named `pages` or `render`: they are dropped, not refused. */
|
|
13
|
+
export declare const pdfOnlyArgumentsIgnored: (options: Pick<DocumentReadOptions, "pages" | "render">, what: string) => string;
|
|
12
14
|
export declare function parsePageSelection(spec: string, pageCount: number): number[];
|
|
13
15
|
export declare function readDocumentObservation(context: ToolContext, shownPath: string, bytes: Buffer, options: DocumentReadOptions): Promise<string | undefined>;
|
|
14
16
|
export declare function legacyTextObservation(shownPath: string, decoded: {
|
|
@@ -7,6 +7,8 @@ export const READ_PDF_RENDER_PAGES = 4;
|
|
|
7
7
|
const CACHE_LIMIT = 3;
|
|
8
8
|
const LABEL = { pdf: 'PDF', docx: 'Word document', doc: 'Word 97-2003 document' };
|
|
9
9
|
const cache = new Map();
|
|
10
|
+
/** The note a Read of anything but a PDF carries when the call named `pages` or `render`: they are dropped, not refused. */
|
|
11
|
+
export const pdfOnlyArgumentsIgnored = (options, what) => options.pages !== undefined || options.render ? `[pages and render apply to PDF files only and were ignored: this is ${what}, paged with offset and limit.]` : '';
|
|
10
12
|
export function parsePageSelection(spec, pageCount) {
|
|
11
13
|
const selected = [];
|
|
12
14
|
const parts = spec.split(',').map(part => part.trim()).filter(Boolean);
|
|
@@ -75,9 +77,8 @@ export async function readDocumentObservation(context, shownPath, bytes, options
|
|
|
75
77
|
const size = formatBytes(bytes.length);
|
|
76
78
|
const notes = document.notes.length ? ` ${document.notes.join(' ')}` : '';
|
|
77
79
|
if (document.kind !== 'pdf') {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const header = `[${LABEL[document.kind]} ${shownPath} (${size}): its text follows. This is extracted text, not the file itself, so Edit and Write cannot change the document.${notes}]`;
|
|
80
|
+
const ignored = pdfOnlyArgumentsIgnored(options, 'a Word document');
|
|
81
|
+
const header = `[${LABEL[document.kind]} ${shownPath} (${size}): its text follows. This is extracted text, not the file itself, so Edit and Write cannot change the document.${notes}]${ignored && `\n${ignored}`}`;
|
|
81
82
|
return pageOfLines(header, document.text.split('\n'), options, 'the extracted text');
|
|
82
83
|
}
|
|
83
84
|
const pages = document.pages ?? [];
|
|
@@ -124,9 +125,8 @@ export async function readDocumentObservation(context, shownPath, bytes, options
|
|
|
124
125
|
return pageOfLines(header, lines, options, 'the extracted text');
|
|
125
126
|
}
|
|
126
127
|
export function legacyTextObservation(shownPath, decoded, options) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const header = `[${shownPath} is not UTF-8; it is shown decoded as ${decoded.encoding}. Edit and Write cannot change it in this encoding: convert it to UTF-8 with a script first if it has to be edited.]`;
|
|
128
|
+
const ignored = pdfOnlyArgumentsIgnored(options, 'a text file');
|
|
129
|
+
const header = `[${shownPath} is not UTF-8; it is shown decoded as ${decoded.encoding}. Edit and Write cannot change it in this encoding: convert it to UTF-8 with a script first if it has to be edited.]${ignored && `\n${ignored}`}`;
|
|
130
130
|
const lines = decoded.text.replace(/\r\n?/g, '\n').split('\n');
|
|
131
131
|
return pageOfLines(header, lines, options, 'the file');
|
|
132
132
|
}
|
|
@@ -23,19 +23,20 @@ const MAX_RESPONSE_BYTES = 2 * 1024 * 1024;
|
|
|
23
23
|
const MAX_LARGE_RESPONSE_BYTES = 12 * 1024 * 1024;
|
|
24
24
|
const LARGE_RESPONSE_METHODS = new Set(['runs.get', 'workspace.diff', 'workspace.git', 'sessions.trajectory', 'browser.view.selection', 'attachments.read', 'sessions.changes.list', 'sessions.changes.get']);
|
|
25
25
|
const PRIMARY_METHODS = new Set([
|
|
26
|
-
'sessions.list', 'sessions.get', 'sessions.create', 'sessions.rename', 'sessions.setArchived', 'sessions.delete',
|
|
26
|
+
'sessions.list', 'sessions.get', 'sessions.create', 'sessions.rename', 'sessions.setJev', 'sessions.setArchived', 'sessions.delete',
|
|
27
27
|
'sessions.trajectory',
|
|
28
28
|
'sessions.skill.get', 'sessions.skill.update',
|
|
29
|
+
'sessions.pullRequest.list',
|
|
29
30
|
'sessions.changes.list', 'sessions.changes.get', 'sessions.changes.keep', 'sessions.changes.undo',
|
|
30
31
|
'runs.list', 'runs.get', 'timers.list',
|
|
31
32
|
'workspace.tree', 'workspace.read', 'workspace.git', 'workspace.branches', 'workspace.checkout', 'workspace.diff',
|
|
32
|
-
'graphs.list', 'graphs.get', 'graphs.select',
|
|
33
|
+
'graphs.list', 'graphs.get', 'graphs.select', 'graphs.visibility.set', 'graphs.visibility.import',
|
|
33
34
|
'attachments.read',
|
|
34
35
|
'config.get', 'projects.list', 'projects.add', 'projects.remove', 'projects.relink',
|
|
35
36
|
'extensions.list', 'project.extensions',
|
|
36
37
|
'browser.runtime.status', 'browser.runtime.install',
|
|
37
38
|
'browser.view.status', 'browser.view.open', 'browser.view.navigate', 'browser.view.go', 'browser.view.activate',
|
|
38
|
-
'browser.view.closeTab', 'browser.view.stream', 'browser.view.input', 'browser.view.selection',
|
|
39
|
+
'browser.view.closeTab', 'browser.view.show', 'browser.view.hide', 'browser.view.stream', 'browser.view.input', 'browser.view.selection',
|
|
39
40
|
'browser.view.release', 'browser.view.cursor',
|
|
40
41
|
'browser.cookies.sources', 'browser.cookies.import',
|
|
41
42
|
'browser.extensions.list', 'browser.extensions.sources', 'browser.extensions.prepare', 'browser.extensions.commit',
|
|
@@ -47,12 +48,13 @@ const RUN_START_METHODS = new Set(['run.start', 'run.resume']);
|
|
|
47
48
|
const RUN_TARGET_METHODS = new Set(['run.setModel', 'run.setPermissions', 'run.cancel', 'run.steer', 'run.approve', 'run.answer', 'browser.panel.result']);
|
|
48
49
|
const TERMINAL_METHODS = new Set(['terminal.open', 'terminal.write', 'terminal.resize', 'terminal.close', 'terminal.closeAll']);
|
|
49
50
|
const ALLOWED_METHODS = new Set([...PRIMARY_METHODS, ...RUN_START_METHODS, ...RUN_TARGET_METHODS, ...TERMINAL_METHODS]);
|
|
50
|
-
const SESSION_MUTATION_METHODS = new Set(['sessions.rename', 'sessions.setArchived', 'sessions.delete']);
|
|
51
|
+
const SESSION_MUTATION_METHODS = new Set(['sessions.rename', 'sessions.setJev', 'sessions.setArchived', 'sessions.delete']);
|
|
51
52
|
const MUTATING_METHODS = new Set([
|
|
52
53
|
...RUN_START_METHODS, ...RUN_TARGET_METHODS, ...SESSION_MUTATION_METHODS, 'sessions.skill.update', 'sessions.changes.keep', 'sessions.changes.undo',
|
|
53
54
|
'terminal.open', 'terminal.write', 'terminal.close', 'terminal.closeAll', 'workspace.checkout', 'projects.add', 'projects.remove', 'projects.relink',
|
|
55
|
+
'graphs.visibility.set', 'graphs.visibility.import',
|
|
54
56
|
'browser.runtime.install', 'browser.view.open', 'browser.view.navigate', 'browser.view.go', 'browser.view.activate',
|
|
55
|
-
'browser.view.closeTab', 'browser.view.stream', 'browser.view.input', 'browser.cookies.import',
|
|
57
|
+
'browser.view.closeTab', 'browser.view.show', 'browser.view.hide', 'browser.view.stream', 'browser.view.input', 'browser.cookies.import',
|
|
56
58
|
'browser.panel.op', 'browser.panel.cancel',
|
|
57
59
|
'browser.extensions.commit', 'browser.extensions.discard', 'browser.extensions.remove', 'browser.extensions.setEnabled',
|
|
58
60
|
'browser.extensions.reload', 'browser.extensions.restart',
|
|
@@ -484,10 +486,17 @@ export class RemoteEngineRelay {
|
|
|
484
486
|
}
|
|
485
487
|
async translateParams(viewerWorkspaceId, params) {
|
|
486
488
|
const workspaces = Array.isArray(params.workspaces) ? params.workspaces : undefined;
|
|
489
|
+
// Graph visibility names projects: a list in graphs.visibility.set, lists per graph in graphs.visibility.import.
|
|
490
|
+
const projects = Array.isArray(params.projects) ? params.projects : undefined;
|
|
491
|
+
const visibility = params.visibility && typeof params.visibility === 'object' && !Array.isArray(params.visibility)
|
|
492
|
+
? params.visibility : undefined;
|
|
493
|
+
const spelledList = (list) => Array.isArray(list) && list.some(value => typeof value === 'string' && isRemoteProjectSpelling(value));
|
|
487
494
|
const needs = (typeof params.workspace === 'string' && isRemoteProjectSpelling(params.workspace))
|
|
488
495
|
|| (typeof params.cwd === 'string' && isRemoteProjectSpelling(params.cwd))
|
|
489
496
|
|| (typeof params.path === 'string' && isRemoteProjectSpelling(params.path))
|
|
490
|
-
|| (workspaces !== undefined && workspaces
|
|
497
|
+
|| (workspaces !== undefined && spelledList(workspaces))
|
|
498
|
+
|| (projects !== undefined && spelledList(projects))
|
|
499
|
+
|| (visibility !== undefined && Object.values(visibility).some(spelledList));
|
|
491
500
|
if (!needs)
|
|
492
501
|
return params;
|
|
493
502
|
const translation = await this.translation(viewerWorkspaceId);
|
|
@@ -510,6 +519,22 @@ export class RemoteEngineRelay {
|
|
|
510
519
|
}
|
|
511
520
|
});
|
|
512
521
|
}
|
|
522
|
+
// A visibility list is stored on this host, so it keeps host paths only. A viewer spelling this host cannot place
|
|
523
|
+
// names no folder it shares and could never match here; it is left out rather than saved as a viewer's ID.
|
|
524
|
+
const hostPaths = (list) => !Array.isArray(list) ? list : list.flatMap(value => {
|
|
525
|
+
if (typeof value !== 'string' || !isRemoteProjectSpelling(value))
|
|
526
|
+
return [value];
|
|
527
|
+
try {
|
|
528
|
+
return [translation.toHost(value)];
|
|
529
|
+
}
|
|
530
|
+
catch {
|
|
531
|
+
return [];
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
if (projects !== undefined)
|
|
535
|
+
next.projects = hostPaths(projects);
|
|
536
|
+
if (visibility !== undefined)
|
|
537
|
+
next.visibility = Object.fromEntries(Object.entries(visibility).map(([graph, list]) => [graph, hostPaths(list)]));
|
|
513
538
|
return next;
|
|
514
539
|
}
|
|
515
540
|
async restoreRequestedEcho(answer, original, viewerWorkspaceId) {
|
|
@@ -11,8 +11,8 @@ export declare class RunControl {
|
|
|
11
11
|
get revision(): number;
|
|
12
12
|
messagesSince(revision: number): string[];
|
|
13
13
|
onChange(listener: (paused: boolean) => void): () => void;
|
|
14
|
-
onSteer(listener: () => void): () => void;
|
|
15
|
-
notifySteer(): void;
|
|
14
|
+
onSteer(listener: () => void, subagentId?: string): () => void;
|
|
15
|
+
notifySteer(subagentId?: string): void;
|
|
16
16
|
pause(): boolean;
|
|
17
17
|
resume(direction: string): boolean;
|
|
18
18
|
wait(signal: AbortSignal): Promise<void>;
|
package/dist/src/run-control.js
CHANGED
|
@@ -3,7 +3,7 @@ export class RunControl {
|
|
|
3
3
|
paused = false;
|
|
4
4
|
listeners = new Set();
|
|
5
5
|
directions = [];
|
|
6
|
-
steerListeners = new
|
|
6
|
+
steerListeners = new Map();
|
|
7
7
|
yolo;
|
|
8
8
|
permissions;
|
|
9
9
|
get isPaused() { return this.paused; }
|
|
@@ -14,13 +14,16 @@ export class RunControl {
|
|
|
14
14
|
this.listeners.add(listener);
|
|
15
15
|
return () => { this.listeners.delete(listener); };
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
// A steer is addressed to one reader: the run's own agent (no subagentId) or one subagent. Only that
|
|
18
|
+
// reader is woken, so a message for the parent never cuts a subagent's work short and the reverse.
|
|
19
|
+
onSteer(listener, subagentId) {
|
|
20
|
+
this.steerListeners.set(listener, subagentId);
|
|
19
21
|
return () => { this.steerListeners.delete(listener); };
|
|
20
22
|
}
|
|
21
|
-
notifySteer() {
|
|
22
|
-
for (const listener of [...this.steerListeners])
|
|
23
|
-
|
|
23
|
+
notifySteer(subagentId) {
|
|
24
|
+
for (const [listener, target] of [...this.steerListeners])
|
|
25
|
+
if (target === subagentId)
|
|
26
|
+
listener();
|
|
24
27
|
}
|
|
25
28
|
pause() {
|
|
26
29
|
if (this.paused)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runtimeEnvironmentNote(platform?: NodeJS.Platform, arch?: string, release?: string): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import os from 'node:os';
|
|
2
|
+
// One line in the system message naming the host the tools run on, so the model picks commands
|
|
3
|
+
// for this operating system instead of guessing (a run on Linux once reached for powershell).
|
|
4
|
+
// It stays constant for the life of the process, so it does not disturb prompt caching.
|
|
5
|
+
export function runtimeEnvironmentNote(platform = process.platform, arch = process.arch, release = os.release()) {
|
|
6
|
+
if (platform === 'win32') {
|
|
7
|
+
return `Environment: the tools run on Windows (${arch}). The shell tool runs PowerShell; use PowerShell syntax and Windows paths.`;
|
|
8
|
+
}
|
|
9
|
+
const system = platform === 'darwin' ? 'macOS' : platform === 'linux' ? 'Linux' : platform;
|
|
10
|
+
const detail = platform === 'linux' && /microsoft|wsl/i.test(release) ? `WSL, ${arch}` : arch;
|
|
11
|
+
const userland = platform === 'darwin' ? ' with the BSD userland' : '';
|
|
12
|
+
return `Environment: the tools run on ${system} (${detail}). The shell tool runs Bash${userland}; use POSIX commands and paths. PowerShell and cmd.exe are not available.`;
|
|
13
|
+
}
|
package/dist/src/runtime.d.ts
CHANGED
|
@@ -120,6 +120,7 @@ export declare function turnModelTask(turn: {
|
|
|
120
120
|
text: string;
|
|
121
121
|
attachments?: readonly UserAttachmentRef[];
|
|
122
122
|
wake?: RetainedWake;
|
|
123
|
+
subagentId?: string;
|
|
123
124
|
}[];
|
|
124
125
|
}): string;
|
|
125
126
|
export interface RunOptions {
|
|
@@ -223,6 +224,7 @@ export interface ResolvedGraphModel {
|
|
|
223
224
|
export interface GraphRunOptions extends RunOptions {
|
|
224
225
|
installedSkillClaims?: (name: string) => boolean;
|
|
225
226
|
getNodeSteeringMessages?: (nodeId: string, signal: AbortSignal) => Promise<Message[]>;
|
|
227
|
+
getSubagentSteeringMessages?: (subagentId: string, signal: AbortSignal) => Promise<Message[]>;
|
|
226
228
|
decisionManager?: import('./decision/DecisionManager.js').DecisionManager;
|
|
227
229
|
decisionNodeOptIn?: boolean;
|
|
228
230
|
decisionPreflight?: {
|
package/dist/src/runtime.js
CHANGED
|
@@ -25,7 +25,8 @@ export function turnModelTask(turn) {
|
|
|
25
25
|
const text = turn.direction === undefined
|
|
26
26
|
? (turn.wake === undefined ? turn.task : woken(turn.task))
|
|
27
27
|
: `${turn.task}\n\n${turn.wake === undefined ? `Direction given when the attempt continued: ${turn.direction}` : `Delivered when the attempt continued: ${woken(turn.direction)}`}`;
|
|
28
|
-
|
|
28
|
+
// A message the user sent to a subagent was never for this agent, so it is not replayed to it.
|
|
29
|
+
const withSteers = (turn.steers ?? []).filter(steer => steer.subagentId === undefined).reduce((text, steer) => {
|
|
29
30
|
const line = steer.wake === undefined
|
|
30
31
|
? `\n\nSteering message the user sent while this attempt ran: ${steer.text}`
|
|
31
32
|
: `\n\nRead while this attempt ran: ${timerReminderText(steer.text)}`;
|
package/dist/src/save-lock.js
CHANGED
|
@@ -146,13 +146,20 @@ export async function acquireSaveLock(folder, options = {}) {
|
|
|
146
146
|
}
|
|
147
147
|
export async function removeLockedFolder(folder, onDetached) {
|
|
148
148
|
const detached = join(dirname(folder), `.removing-${basename(folder)}-${randomUUID()}`);
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
149
|
+
// Windows refuses to rename a folder while any file in it is open, and a sync pass opens them briefly.
|
|
150
|
+
for (let attempt = 0;; attempt++) {
|
|
151
|
+
try {
|
|
152
|
+
await rename(folder, detached);
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
const code = error.code;
|
|
157
|
+
if (code === 'ENOENT')
|
|
158
|
+
return;
|
|
159
|
+
if (attempt >= 4 || !['EPERM', 'EACCES', 'EBUSY'].includes(code ?? ''))
|
|
160
|
+
throw error;
|
|
161
|
+
await new Promise(resolve => setTimeout(resolve, 25 * (attempt + 1)));
|
|
162
|
+
}
|
|
156
163
|
}
|
|
157
164
|
try {
|
|
158
165
|
await onDetached?.();
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export type TabState = 'idle' | 'working' | 'input';
|
|
2
|
+
/** The working spinner: the terminal title while a run works, and the TUI's inline loading rows. */
|
|
3
|
+
export declare const WORKING_SPINNER_FRAMES: string[];
|
|
4
|
+
export declare const WORKING_SPINNER_TICK_MS = 125;
|
|
2
5
|
export declare class SessionTitle {
|
|
3
6
|
private readonly output;
|
|
4
7
|
private name;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { stripVTControlCharacters } from 'node:util';
|
|
2
|
-
|
|
2
|
+
/** The working spinner: the terminal title while a run works, and the TUI's inline loading rows. */
|
|
3
|
+
export const WORKING_SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
4
|
+
export const WORKING_SPINNER_TICK_MS = 125;
|
|
5
|
+
const workingFrames = WORKING_SPINNER_FRAMES;
|
|
3
6
|
export class SessionTitle {
|
|
4
7
|
output;
|
|
5
8
|
name = '';
|
|
@@ -31,7 +34,7 @@ export class SessionTitle {
|
|
|
31
34
|
}
|
|
32
35
|
this.render();
|
|
33
36
|
if (state !== 'idle') {
|
|
34
|
-
this.timer = setInterval(() => { this.frame++; this.render(); }, state === 'input' ? 500 :
|
|
37
|
+
this.timer = setInterval(() => { this.frame++; this.render(); }, state === 'input' ? 500 : WORKING_SPINNER_TICK_MS);
|
|
35
38
|
this.timer.unref?.();
|
|
36
39
|
}
|
|
37
40
|
}
|
package/dist/src/sessions.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export interface SavedSession {
|
|
|
38
38
|
autoArchived?: boolean;
|
|
39
39
|
renamed?: boolean;
|
|
40
40
|
goal?: SessionGoal;
|
|
41
|
+
jevEnabled?: boolean;
|
|
41
42
|
}
|
|
42
43
|
export declare const MAX_LINEAGE_ENTRIES = 64;
|
|
43
44
|
export declare function canExtendLineage(ancestors: string[] | undefined): boolean;
|
package/dist/src/sessions.js
CHANGED
|
@@ -31,7 +31,7 @@ export function lineagePoints(parent, parentUsage, parentTurns) {
|
|
|
31
31
|
return [...(parent.lineage ?? []), { usage: parentUsage, turns: parentTurns }].slice(-MAX_LINEAGE_ENTRIES);
|
|
32
32
|
}
|
|
33
33
|
export function savedSessionFields(session) {
|
|
34
|
-
const { version, id, name, workspace, updatedAt, history, usage, contextHistory, parentId, inheritedUsage, inheritedTurns, ancestors, lineage, projectId, trajectoryId, widgets, context, archived, autoArchived, renamed, goal } = session;
|
|
34
|
+
const { version, id, name, workspace, updatedAt, history, usage, contextHistory, parentId, inheritedUsage, inheritedTurns, ancestors, lineage, projectId, trajectoryId, widgets, context, archived, autoArchived, renamed, goal, jevEnabled } = session;
|
|
35
35
|
return { version, id, name, workspace, updatedAt, history, usage, contextHistory, parentId, projectId, widgets,
|
|
36
36
|
...(context === undefined ? {} : { context }),
|
|
37
37
|
...(inheritedUsage === undefined ? {} : { inheritedUsage }),
|
|
@@ -41,7 +41,8 @@ export function savedSessionFields(session) {
|
|
|
41
41
|
...(trajectoryId === undefined ? {} : { trajectoryId }),
|
|
42
42
|
...(archived === undefined ? {} : { archived }), ...(autoArchived === undefined ? {} : { autoArchived }),
|
|
43
43
|
...(renamed === undefined ? {} : { renamed }),
|
|
44
|
-
...(goal === undefined ? {} : { goal })
|
|
44
|
+
...(goal === undefined ? {} : { goal }),
|
|
45
|
+
...(jevEnabled === undefined ? {} : { jevEnabled }) };
|
|
45
46
|
}
|
|
46
47
|
export const primaryDigest = (session) => createHash('sha256').update(JSON.stringify(savedSessionFields(session))).digest('hex');
|
|
47
48
|
async function readRunUsage(path) {
|
|
@@ -167,6 +168,7 @@ export function validSavedSession(value) {
|
|
|
167
168
|
(session.autoArchived === undefined || typeof session.autoArchived === 'boolean') &&
|
|
168
169
|
(session.renamed === undefined || typeof session.renamed === 'boolean') &&
|
|
169
170
|
(session.goal === undefined || validSessionGoal(session.goal)) &&
|
|
171
|
+
(session.jevEnabled === undefined || typeof session.jevEnabled === 'boolean') &&
|
|
170
172
|
validUsage(session.usage) &&
|
|
171
173
|
(session.inheritedUsage === undefined || (validUsage(session.inheritedUsage)
|
|
172
174
|
&& (!session.usage || (session.inheritedUsage.inputTokens <= session.usage.inputTokens
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Config } from './config.js';
|
|
2
2
|
import type { ProviderConfig } from './providers.js';
|
|
3
|
-
export declare const DETECTABLE_SIGN_IN_TYPES: readonly ["claude", "codex", "grok", "opencode"];
|
|
3
|
+
export declare const DETECTABLE_SIGN_IN_TYPES: readonly ["claude", "codex", "grok", "opencode", "google"];
|
|
4
4
|
export type DetectableSignInType = typeof DETECTABLE_SIGN_IN_TYPES[number];
|
|
5
5
|
export declare function isDetectableSignInType(value: unknown): value is DetectableSignInType;
|
|
6
6
|
export interface DetectedSignIn {
|
|
@@ -4,19 +4,20 @@ import { resolveCliExecutable } from './cli-executable.js';
|
|
|
4
4
|
import { readCodexModels } from './codex-auth.js';
|
|
5
5
|
import { resolveCodexExecutable } from './codex-executable.js';
|
|
6
6
|
import { connectCodex } from './codex-rpc.js';
|
|
7
|
+
import { GOOGLE_BASE_URL, GOOGLE_EXECUTABLE, readGoogleCatalog } from './google-provider.js';
|
|
7
8
|
import { GROK_BASE_URL, GROK_EXECUTABLE, readGrokCatalog } from './grok-provider.js';
|
|
8
9
|
import { OPENCODE_BASE_URL, OPENCODE_EXECUTABLE, readOpenCodeCatalog, sharedOpenCodeServer } from './opencode-cli-provider.js';
|
|
9
10
|
import { uniqueProviderId } from './provider-import.js';
|
|
10
|
-
export const DETECTABLE_SIGN_IN_TYPES = ['claude', 'codex', 'grok', 'opencode'];
|
|
11
|
+
export const DETECTABLE_SIGN_IN_TYPES = ['claude', 'codex', 'grok', 'opencode', 'google'];
|
|
11
12
|
export function isDetectableSignInType(value) {
|
|
12
13
|
return DETECTABLE_SIGN_IN_TYPES.includes(value);
|
|
13
14
|
}
|
|
14
15
|
const SIGNED_OUT = { signedIn: false, models: [] };
|
|
15
16
|
const MAX_MODELS = 5000;
|
|
16
17
|
const FIXED_BASE_URL = {
|
|
17
|
-
claude: 'https://api.anthropic.com', codex: 'https://chatgpt.com/backend-api/codex', grok: GROK_BASE_URL, opencode: OPENCODE_BASE_URL,
|
|
18
|
+
claude: 'https://api.anthropic.com', codex: 'https://chatgpt.com/backend-api/codex', grok: GROK_BASE_URL, opencode: OPENCODE_BASE_URL, google: GOOGLE_BASE_URL,
|
|
18
19
|
};
|
|
19
|
-
const DISPLAY_NAME = { claude: 'Claude', codex: 'ChatGPT', grok: 'Grok', opencode: 'OpenCode' };
|
|
20
|
+
const DISPLAY_NAME = { claude: 'Claude', codex: 'ChatGPT', grok: 'Grok', opencode: 'OpenCode', google: 'Google' };
|
|
20
21
|
export function defaultSignInProbes() {
|
|
21
22
|
const present = async (resolve) => { try {
|
|
22
23
|
await resolve();
|
|
@@ -59,6 +60,12 @@ export function defaultSignInProbes() {
|
|
|
59
60
|
const catalog = await readGrokCatalog(signal);
|
|
60
61
|
return { signedIn: catalog.signedIn, models: catalog.models, ...(catalog.email ? { email: catalog.email } : {}) };
|
|
61
62
|
},
|
|
63
|
+
google: async (signal) => {
|
|
64
|
+
if (!await present(() => resolveCliExecutable(GOOGLE_EXECUTABLE)))
|
|
65
|
+
return SIGNED_OUT;
|
|
66
|
+
const catalog = await readGoogleCatalog(signal);
|
|
67
|
+
return { signedIn: catalog.signedIn, models: catalog.models };
|
|
68
|
+
},
|
|
62
69
|
opencode: async (signal) => {
|
|
63
70
|
if (!await present(() => resolveCliExecutable(OPENCODE_EXECUTABLE)))
|
|
64
71
|
return SIGNED_OUT;
|
|
@@ -5,7 +5,7 @@ import { changeConfigFile, configDirectory, loadConfig } from './config.js';
|
|
|
5
5
|
import { applySignInImports, detectSignIns } from './sign-in-detection.js';
|
|
6
6
|
const DETECT_TIMEOUT_MS = 8_000;
|
|
7
7
|
const MAX_ATTEMPTS = 3;
|
|
8
|
-
const NAME = { claude: 'Claude', codex: 'ChatGPT', grok: 'Grok', opencode: 'OpenCode' };
|
|
8
|
+
const NAME = { claude: 'Claude', codex: 'ChatGPT', grok: 'Grok', opencode: 'OpenCode', google: 'Google' };
|
|
9
9
|
const statePath = (home) => join(home, 'sign-in-offer.json');
|
|
10
10
|
export async function readSignInOfferState(home = configDirectory()) {
|
|
11
11
|
try {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const BUILTIN_COMMANDS = new Set([
|
|
2
|
-
'browser', 'session', 'login', 'auth', 'model', 'providers', 'subagent', 'reasoning',
|
|
2
|
+
'browser', 'session', 'resume', 'login', 'auth', 'model', 'providers', 'subagent', 'reasoning',
|
|
3
3
|
'graph', 'codegraph', 'dashboard', 'attach', 'usage', 'permissions', 'jev',
|
|
4
4
|
'feedback', 'yolo', 'tools', 'skill', 'skills', 'plugins', 'mcp', 'logout', 'status',
|
|
5
5
|
'clear', 'compact', 'goal', 'help', 'exit', 'quit',
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bug-report
|
|
3
|
+
description: "Report a bug in Andorra Code to the Andorra team: ask the user what went wrong, write it up, and send it once they approve. Use when the user types /bug-report or says something in Andorra Code itself is broken and wants it reported."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Report a bug in Andorra Code
|
|
7
|
+
|
|
8
|
+
This sends a bug report about **Andorra Code itself** (the terminal app, the desktop app, sign-in, graphs,
|
|
9
|
+
models, tools) to the Andorra team. It is not for bugs in the user's own project: if that is what they
|
|
10
|
+
describe, say so and help with the project instead.
|
|
11
|
+
|
|
12
|
+
You send the report with the `submit_bug_report` tool. The tool shows the user the exact text and sends it
|
|
13
|
+
only when they choose **Send report**, so you never send anything they have not read.
|
|
14
|
+
|
|
15
|
+
## Before you ask anything
|
|
16
|
+
|
|
17
|
+
- The report needs a signed-in Andorra account. Any plan can report, Free included. If you already know
|
|
18
|
+
the user is signed out (an earlier error said so, or `andorra auth status` reports it), tell them to sign
|
|
19
|
+
in first (`andorra login`, `/login`, or Account in the desktop app) and stop. Otherwise carry on: the
|
|
20
|
+
tool checks, and tells you if they are signed out.
|
|
21
|
+
- If `submit_bug_report` is not among your tools, this run cannot send reports. Say so and ask the user to
|
|
22
|
+
type `/bug-report` at the start of a new message.
|
|
23
|
+
- Use what the user already told you, in this message and earlier in the conversation. Do not ask again
|
|
24
|
+
for something they have said.
|
|
25
|
+
|
|
26
|
+
## The interview
|
|
27
|
+
|
|
28
|
+
Ask one question at a time, in plain words, and wait for each answer. Use `ask_user` when you have it;
|
|
29
|
+
otherwise ask in your reply and continue when they answer. Skip a question whose answer you already have.
|
|
30
|
+
|
|
31
|
+
1. **What went wrong?** What they were trying to do and what happened. Ask for the exact error text if
|
|
32
|
+
there was one.
|
|
33
|
+
2. **How to make it happen again.** The steps, from a known starting point. "I don't know" or "it happened
|
|
34
|
+
once" is a fine answer: record it as that.
|
|
35
|
+
3. **What they expected** to happen instead.
|
|
36
|
+
4. **How often and since when**, if it is not already clear: every time or sometimes, and whether it
|
|
37
|
+
worked before (an update, a new setting, a different model).
|
|
38
|
+
5. **Anything else that helps**: which model or graph, the terminal app or the desktop app, a screenshot
|
|
39
|
+
described in words.
|
|
40
|
+
|
|
41
|
+
Stop asking once you can write a report someone else could act on. Three or four questions is usual; do
|
|
42
|
+
not go through the list for its own sake, and do not ask for the app version or operating system (the
|
|
43
|
+
tool attaches those).
|
|
44
|
+
|
|
45
|
+
## Write the report
|
|
46
|
+
|
|
47
|
+
- `title`: one line naming the problem, specific enough to tell it from other reports ("Desktop: Send does
|
|
48
|
+
nothing after attaching a PDF"), at most 120 characters.
|
|
49
|
+
- `description`: what happened, in the user's words, with the error text. Add "Happens every time" or
|
|
50
|
+
"Happened once", and what changed recently if they said.
|
|
51
|
+
- `steps`: numbered steps. Leave it out if the user does not know them.
|
|
52
|
+
- `expected` and `actual`: one or two sentences each.
|
|
53
|
+
|
|
54
|
+
Rules for the text:
|
|
55
|
+
|
|
56
|
+
- Report what the user said. Do not add steps, causes or details they did not give you, and do not guess
|
|
57
|
+
at a diagnosis. If you looked something up yourself (a log line, a version), say that it is your
|
|
58
|
+
observation.
|
|
59
|
+
- **Leave private material out**: no API keys, tokens or passwords, no file contents or source code from
|
|
60
|
+
their project, no prompts or conversation text, no personal data about other people. Describe instead
|
|
61
|
+
("a 40-line TypeScript file"). If the user pasted a secret, do not repeat it, and tell them it was left
|
|
62
|
+
out.
|
|
63
|
+
- Keep it short. The limits are 4,000 bytes for the description, 2,000 for steps and actual, 1,000 for
|
|
64
|
+
expected.
|
|
65
|
+
|
|
66
|
+
## Send it
|
|
67
|
+
|
|
68
|
+
Call `submit_bug_report` once with the fields above. Then:
|
|
69
|
+
|
|
70
|
+
- `sent: true`: give the user the `reference` (for example `BR-1234`) and thank them. There is no page to
|
|
71
|
+
open: the tracker is private, so do not offer a link or promise a reply.
|
|
72
|
+
- `sent: false` with a `userReply`: they want a change. Make it and call the tool again so they confirm
|
|
73
|
+
the new text.
|
|
74
|
+
- `sent: false` without one: they chose not to send. Say nothing was sent and stop.
|
|
75
|
+
- An error: tell the user what it said in plain words. Signed out: they sign in and run `/bug-report`
|
|
76
|
+
again. Daily limit reached: say when they can send it. Service unavailable: say so; do not retry in a
|
|
77
|
+
loop.
|
|
78
|
+
|
|
79
|
+
Send one report per problem. If the user describes two separate bugs, finish the first, then ask whether
|
|
80
|
+
to report the second.
|
|
@@ -139,6 +139,13 @@ and the upsert reply's `placed` says where it went.
|
|
|
139
139
|
3. `andorra_graph_publish`. A `REVISION_CONFLICT` means someone saved a newer revision: begin a new edit draft
|
|
140
140
|
from the latest, reapply your changes, validate and publish again.
|
|
141
141
|
4. If the user stops partway, `andorra_graph_discard` the draft.
|
|
142
|
+
5. If the user said which projects should offer the graph ("only this project", "only in X"), set it right after
|
|
143
|
+
publishing with `andorra_graph_visibility_set`: `projects: "this"` for the project the task runs in, a list of
|
|
144
|
+
registered project paths for named projects (`andorra_graph_visibility_get` lists them in `registeredProjects`;
|
|
145
|
+
in the Graph Builder the task does not run in the user's project, so name it this way), or `"all"` to list it
|
|
146
|
+
everywhere again.
|
|
147
|
+
`andorra_graph_visibility_get` reads the current setting. Never record visibility in graph metadata, which
|
|
148
|
+
nothing reads. If the call fails (for example `PROJECT_NOT_REGISTERED`), tell the user it was not applied.
|
|
142
149
|
|
|
143
150
|
## 6. Delete or restore
|
|
144
151
|
|
|
@@ -158,5 +165,6 @@ it can be restored.
|
|
|
158
165
|
## 7. Report
|
|
159
166
|
|
|
160
167
|
The graph id and revision, what changed, how to run it (`/graph` in the terminal to select it, the desktop's
|
|
161
|
-
graph picker, or `andorra --graph <id>`), and that cloud sync may still be pending.
|
|
168
|
+
graph picker, or `andorra --graph <id>`), and that cloud sync may still be pending. Say which projects list the graph
|
|
169
|
+
when you set it. Name anything you could not
|
|
162
170
|
validate.
|
|
@@ -24,8 +24,9 @@ validation error.
|
|
|
24
24
|
| `DRAFT_NOT_FOUND` / `DRAFT_BUSY` | The draft expired (one hour), was discarded, or is publishing. | Begin a new draft; wait for a publish to finish. |
|
|
25
25
|
| `DRAFT_LIMIT` | 24 drafts are open. | Discard unused drafts. |
|
|
26
26
|
| `FREE_TIER_LIMIT` | A free account's limit: one custom graph, at most 3 nodes, no Orchestrator. | Stay within it, or tell the user a paid plan lifts it. |
|
|
27
|
+
| `MEMBERSHIP_UNAVAILABLE` | The account service did not answer the membership check. Not an account or plan problem. | Wait a few seconds and retry the same call; the draft is kept. Do not ask the user to sign in or question their subscription. Tell the user only if retries keep failing. |
|
|
27
28
|
| `AUTH_REQUIRED` / `MEMBERSHIP_REQUIRED` / `AUTH_CHANGED` | Not signed in, no membership, or the account changed mid-edit. | Ask the user to sign in (`andorra login`); retry with the current account. |
|
|
28
|
-
| `DEFAULT_GRAPH` | Deleting or restoring the Default graph
|
|
29
|
+
| `DEFAULT_GRAPH` | Deleting or restoring the Default graph. | Not allowed. |
|
|
29
30
|
| `CONFIRMATION_MISMATCH` | `confirm` is not the graph id. | Ask the user to confirm, then pass the id in `confirm`. |
|
|
30
31
|
| `GRAPH_IN_USE` | An automation runs the graph (`automations` lists them). | Tell the user; they change or remove the automation first. |
|
|
31
32
|
| `GRAPH_DELETED` | The graph is deleted (editing it, or deleting it again). | `andorra_graph_restore` first if the user wants it back. |
|