@andorra-labs/code 0.1.8 → 0.1.10
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/THIRD_PARTY_NOTICES.md +2 -1
- package/dist/src/account-presentation.d.ts +11 -0
- package/dist/src/account-presentation.js +29 -2
- package/dist/src/agent-execution.js +57 -4
- package/dist/src/agent-mcp.d.ts +12 -0
- package/dist/src/agent-mcp.js +81 -2
- package/dist/src/app-server/protocol.d.ts +120 -1
- package/dist/src/app-server/protocol.js +8 -1
- package/dist/src/app-server/reasoning.d.ts +0 -8
- package/dist/src/app-server/reasoning.js +15 -28
- package/dist/src/app-server.d.ts +32 -0
- package/dist/src/app-server.js +214 -21
- package/dist/src/auth/AuthManager.d.ts +15 -0
- package/dist/src/auth/AuthManager.js +66 -7
- package/dist/src/auth/index.d.ts +1 -1
- package/dist/src/auth/index.js +1 -1
- package/dist/src/auth/store.d.ts +17 -1
- package/dist/src/auth/store.js +25 -2
- package/dist/src/browser-runner.js +1 -2
- package/dist/src/browser-server.js +10 -2
- package/dist/src/browser-session.js +6 -2
- package/dist/src/browser-stealth.d.ts +29 -0
- package/dist/src/browser-stealth.js +166 -0
- package/dist/src/browser-ui/app.js +123 -28
- package/dist/src/browser-ui/icons/chevron-right.svg +8 -0
- package/dist/src/browser-ui/index.html +8 -8
- package/dist/src/browser-ui/style.css +199 -171
- package/dist/src/browser-ui/tokens.css +198 -0
- package/dist/src/browser-view.d.ts +57 -9
- package/dist/src/browser-view.js +187 -36
- package/dist/src/cli.js +31 -9
- package/dist/src/coding-tools.js +9 -5
- package/dist/src/command-screens.js +4 -4
- package/dist/src/commands.d.ts +1 -1
- package/dist/src/commands.js +3 -2
- package/dist/src/completion-gates.d.ts +35 -0
- package/dist/src/completion-gates.js +25 -0
- package/dist/src/completion.d.ts +7 -1
- package/dist/src/completion.js +37 -4
- package/dist/src/config.d.ts +1 -1
- package/dist/src/config.js +2 -2
- package/dist/src/context-budget.d.ts +11 -0
- package/dist/src/context-budget.js +13 -0
- package/dist/src/decision/DecisionEngine.d.ts +5 -1
- package/dist/src/decision/DecisionManager.d.ts +1 -0
- package/dist/src/decision/DecisionManager.js +14 -3
- package/dist/src/decision/FactContinuations.d.ts +6 -0
- package/dist/src/decision/FactContinuations.js +9 -1
- package/dist/src/decision/FactServiceGate.js +1 -1
- package/dist/src/decision/checks.js +1 -1
- package/dist/src/decision/hostedSkills.d.ts +37 -0
- package/dist/src/decision/hostedSkills.js +64 -0
- package/dist/src/decision/providers/AndorraDecisionProvider.d.ts +10 -2
- package/dist/src/decision/providers/AndorraDecisionProvider.js +121 -10
- package/dist/src/default-graph.d.ts +11 -0
- package/dist/src/default-graph.js +20 -0
- package/dist/src/duration.d.ts +13 -2
- package/dist/src/duration.js +27 -3
- package/dist/src/file-diff.d.ts +105 -0
- package/dist/src/file-diff.js +244 -0
- package/dist/src/graph-manager-chat.d.ts +302 -0
- package/dist/src/graph-manager-chat.js +940 -0
- package/dist/src/graph-runner.js +6 -0
- package/dist/src/graph-server.d.ts +9 -0
- package/dist/src/graph-server.js +171 -20
- package/dist/src/graph-studio-features.js +2 -2
- package/dist/src/graph-sync.js +5 -2
- package/dist/src/graph-ui/app.js +369 -183
- package/dist/src/graph-ui/controls.css +55 -32
- package/dist/src/graph-ui/controls.js +85 -9
- package/dist/src/graph-ui/edge-router.js +114 -13
- package/dist/src/graph-ui/embed.js +32 -17
- package/dist/src/graph-ui/icons.js +1 -0
- package/dist/src/graph-ui/index.html +4 -4
- package/dist/src/graph-ui/library.css +4 -10
- package/dist/src/graph-ui/manager-markdown.js +155 -0
- package/dist/src/graph-ui/manager-state.js +191 -0
- package/dist/src/graph-ui/manager.css +161 -0
- package/dist/src/graph-ui/manager.js +700 -0
- package/dist/src/graph-ui/skill-picker.js +6 -6
- package/dist/src/graph-ui/studio-canvas.js +17 -15
- package/dist/src/graph-ui/studio.css +24 -23
- package/dist/src/graph-ui/studio.js +69 -48
- package/dist/src/graph-ui/style.css +128 -93
- package/dist/src/graph-ui/theme.js +2 -2
- package/dist/src/graph-ui/tokens.css +217 -151
- package/dist/src/graphs.d.ts +76 -2
- package/dist/src/graphs.js +172 -9
- package/dist/src/hardened-runtime.js +8 -2
- package/dist/src/mcp.d.ts +75 -0
- package/dist/src/mcp.js +240 -8
- package/dist/src/membership-errors.d.ts +14 -0
- package/dist/src/membership-errors.js +24 -1
- package/dist/src/membership.d.ts +20 -0
- package/dist/src/membership.js +45 -16
- package/dist/src/palette.d.ts +25 -8
- package/dist/src/palette.js +26 -8
- package/dist/src/provider-engine.d.ts +4 -4
- package/dist/src/provider-engine.js +39 -22
- package/dist/src/provider-keys.d.ts +5 -1
- package/dist/src/provider-keys.js +7 -3
- package/dist/src/provider-settings.d.ts +4 -1
- package/dist/src/provider-settings.js +46 -5
- package/dist/src/providers.d.ts +24 -0
- package/dist/src/providers.js +47 -2
- package/dist/src/qa/guidance.d.ts +26 -0
- package/dist/src/qa/guidance.js +46 -0
- package/dist/src/qa/index.d.ts +1 -8
- package/dist/src/qa/index.js +1 -16
- package/dist/src/qa/profile/QaProfile.d.ts +5 -1
- package/dist/src/qa/profile/QaProfile.js +6 -2
- package/dist/src/qa/runtime/ProcessManager.d.ts +20 -2
- package/dist/src/qa/runtime/ProcessManager.js +69 -13
- package/dist/src/qa/tools.d.ts +19 -1
- package/dist/src/qa/tools.js +20 -145
- package/dist/src/react-runtime.d.ts +11 -0
- package/dist/src/react-runtime.js +203 -53
- package/dist/src/remote/engine-pool.js +21 -6
- package/dist/src/run-progress.d.ts +6 -0
- package/dist/src/run-progress.js +7 -0
- package/dist/src/runtime.d.ts +8 -0
- package/dist/src/screen-selection.d.ts +38 -0
- package/dist/src/screen-selection.js +103 -0
- package/dist/src/session-changes.d.ts +117 -0
- package/dist/src/session-changes.js +796 -0
- package/dist/src/session-skills.d.ts +75 -0
- package/dist/src/session-skills.js +151 -0
- package/dist/src/side-panel.d.ts +1 -1
- package/dist/src/side-panel.js +6 -12
- package/dist/src/skill-commands.js +1 -1
- package/dist/src/skills/bundled/control-browser/SKILL.md +9 -1
- package/dist/src/skills/bundled/graph-manager/SKILL.md +8 -0
- package/dist/src/skills/bundled/provenance.json +3 -3
- package/dist/src/skills/bundled/web-gui-tester/SKILL.md +1 -1
- package/dist/src/stall-recovery.d.ts +33 -0
- package/dist/src/stall-recovery.js +83 -0
- package/dist/src/subagent-run.js +1 -2
- package/dist/src/telemetry/schema.d.ts +1 -1
- package/dist/src/telemetry/schema.js +1 -2
- package/dist/src/terminal-ui.d.ts +66 -22
- package/dist/src/terminal-ui.js +327 -92
- package/dist/src/tool-diff-stats.d.ts +9 -0
- package/dist/src/tool-diff-stats.js +20 -0
- package/dist/src/tool-names.d.ts +1 -1
- package/dist/src/tool-result-filter.js +1 -1
- package/dist/src/tools.js +26 -2
- package/dist/src/transcript.d.ts +11 -0
- package/dist/src/transcript.js +23 -3
- package/dist/src/types.d.ts +24 -4
- package/dist/src/usage-analytics.d.ts +7 -0
- package/dist/src/usage-analytics.js +55 -15
- package/docs/concepts/README.md +1 -1
- package/docs/concepts/limits.md +9 -0
- package/docs/guides/desktop-app.md +1 -1
- package/docs/guides/graph-builder.md +16 -1
- package/docs/guides/tui.md +9 -9
- package/docs/reference/slash-commands.md +2 -1
- package/docs/superpowers/plans/2026-11-13-graph-manager-chat.md +203 -0
- package/docs/superpowers/plans/2026-11-14-jev-fair-use-pricing.md +79 -0
- package/docs/superpowers/specs/2026-11-13-graph-manager-chat-design.md +182 -0
- package/docs/superpowers/specs/2026-11-14-jev-fair-use-pricing-design.md +156 -0
- package/package.json +1 -1
- package/tests/chat-side-panel-test-plan.md +1 -1
- package/dist/src/qa/api/http-runner.d.ts +0 -3
- package/dist/src/qa/api/http-runner.js +0 -47
- package/dist/src/qa/git/ChangeDetector.d.ts +0 -26
- package/dist/src/qa/git/ChangeDetector.js +0 -177
- package/dist/src/qa/git/DiffReviewer.d.ts +0 -28
- package/dist/src/qa/git/DiffReviewer.js +0 -115
- package/dist/src/qa/orchestrator/ChangeClassifier.d.ts +0 -14
- package/dist/src/qa/orchestrator/ChangeClassifier.js +0 -28
- package/dist/src/qa/orchestrator/MergeGate.d.ts +0 -14
- package/dist/src/qa/orchestrator/MergeGate.js +0 -40
- package/dist/src/qa/orchestrator/QaOrchestrator.d.ts +0 -79
- package/dist/src/qa/orchestrator/QaOrchestrator.js +0 -373
- package/dist/src/qa/runners/CommandRunner.d.ts +0 -22
- package/dist/src/qa/runners/CommandRunner.js +0 -96
- package/dist/src/qa/runners/TestRunner.d.ts +0 -21
- package/dist/src/qa/runners/TestRunner.js +0 -66
- package/dist/src/qa/runtime/RuntimeSmoke.d.ts +0 -11
- package/dist/src/qa/runtime/RuntimeSmoke.js +0 -78
- package/dist/src/qa/runtime-detect.d.ts +0 -10
- package/dist/src/qa/runtime-detect.js +0 -72
- package/dist/src/qa/security/DependencyScanner.d.ts +0 -19
- package/dist/src/qa/security/DependencyScanner.js +0 -167
- package/dist/src/qa/security/SecretScanner.d.ts +0 -3
- package/dist/src/qa/security/SecretScanner.js +0 -55
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import type { Readable, Writable } from 'node:stream';
|
|
2
|
+
/** The canvas a message is about: the editor's current definition, saved or not. */
|
|
3
|
+
export interface ManagerGraphContext {
|
|
4
|
+
graph: Record<string, unknown>;
|
|
5
|
+
saved: boolean;
|
|
6
|
+
revision?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ManagerTurn extends ManagerGraphContext {
|
|
9
|
+
provider: string;
|
|
10
|
+
model: string;
|
|
11
|
+
text: string;
|
|
12
|
+
}
|
|
13
|
+
export type ManagerEvent = {
|
|
14
|
+
type: 'snapshot';
|
|
15
|
+
events: ManagerEvent[];
|
|
16
|
+
state: ManagerState;
|
|
17
|
+
} | {
|
|
18
|
+
type: 'user';
|
|
19
|
+
text: string;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'assistant';
|
|
22
|
+
text: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* One tool call, opened `running` and settled in place by `tool.settled`. `text` is the whole
|
|
26
|
+
* line (also what an approval for the call says); `verb` and `target` are the same call split the
|
|
27
|
+
* way the app's transcript draws a row: what it did, and to what.
|
|
28
|
+
*/
|
|
29
|
+
| {
|
|
30
|
+
type: 'tool';
|
|
31
|
+
id: string;
|
|
32
|
+
text: string;
|
|
33
|
+
verb: string;
|
|
34
|
+
target?: string;
|
|
35
|
+
status: ManagerToolStatus;
|
|
36
|
+
reason?: string;
|
|
37
|
+
startedAt: number;
|
|
38
|
+
endedAt?: number;
|
|
39
|
+
} | {
|
|
40
|
+
type: 'tool.settled';
|
|
41
|
+
id: string;
|
|
42
|
+
status: Exclude<ManagerToolStatus, 'running'>;
|
|
43
|
+
reason?: string;
|
|
44
|
+
endedAt: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* One model call's reasoning: opened `thinking` (or reopened when a retried request restarts it),
|
|
48
|
+
* grown by `thought.delta`, and settled `done` with the authoritative text. A call that streamed
|
|
49
|
+
* no reasoning is `thought.removed`. Reasoning is display-only: it is kept in this conversation's
|
|
50
|
+
* memory for the panels and never written anywhere.
|
|
51
|
+
*/
|
|
52
|
+
| {
|
|
53
|
+
type: 'thought';
|
|
54
|
+
id: string;
|
|
55
|
+
text: string;
|
|
56
|
+
status: 'thinking' | 'done';
|
|
57
|
+
startedAt: number;
|
|
58
|
+
durationMs?: number;
|
|
59
|
+
truncated?: boolean;
|
|
60
|
+
} | {
|
|
61
|
+
type: 'thought.delta';
|
|
62
|
+
id: string;
|
|
63
|
+
text: string;
|
|
64
|
+
} | {
|
|
65
|
+
type: 'thought.removed';
|
|
66
|
+
id: string;
|
|
67
|
+
} | {
|
|
68
|
+
type: 'approval';
|
|
69
|
+
id: string;
|
|
70
|
+
text: string;
|
|
71
|
+
} | {
|
|
72
|
+
type: 'question';
|
|
73
|
+
id: string;
|
|
74
|
+
question: string;
|
|
75
|
+
choices?: string[];
|
|
76
|
+
} | {
|
|
77
|
+
type: 'resolved';
|
|
78
|
+
id: string;
|
|
79
|
+
} | {
|
|
80
|
+
type: 'state';
|
|
81
|
+
state: ManagerState;
|
|
82
|
+
} | {
|
|
83
|
+
type: 'error';
|
|
84
|
+
message: string;
|
|
85
|
+
} | {
|
|
86
|
+
type: 'graph.saved';
|
|
87
|
+
graphId: string;
|
|
88
|
+
revision: number;
|
|
89
|
+
name?: string;
|
|
90
|
+
}
|
|
91
|
+
/** The graph's latest revision is a deletion. It is never a revision to load. */
|
|
92
|
+
| {
|
|
93
|
+
type: 'graph.deleted';
|
|
94
|
+
graphId: string;
|
|
95
|
+
};
|
|
96
|
+
/** A graph's latest stored revision. Deleting a graph publishes one more, marked `metadata.deletedAt`. */
|
|
97
|
+
export interface ManagerGraphRevision {
|
|
98
|
+
revision: number;
|
|
99
|
+
deleted: boolean;
|
|
100
|
+
}
|
|
101
|
+
export type ManagerState = 'idle' | 'starting' | 'working' | 'awaiting';
|
|
102
|
+
/** `stopped` is a call the run ended without reporting the end of. */
|
|
103
|
+
export type ManagerToolStatus = 'running' | 'done' | 'failed' | 'stopped';
|
|
104
|
+
export interface EngineChild {
|
|
105
|
+
stdin: Writable;
|
|
106
|
+
stdout: Readable;
|
|
107
|
+
stderr: Readable;
|
|
108
|
+
once(event: 'close', fn: (code: number | null) => void): unknown;
|
|
109
|
+
on(event: 'error', fn: (e: Error) => void): unknown;
|
|
110
|
+
kill(): boolean;
|
|
111
|
+
}
|
|
112
|
+
export interface GraphManagerChatOptions {
|
|
113
|
+
/** The config directory (ANDORRACODE_HOME) the engine runs against. */
|
|
114
|
+
directory: string;
|
|
115
|
+
/** Starts the engine in `cwd`. The default spawns this build's `app-server --stdio`. */
|
|
116
|
+
spawnEngine?: (cwd: string) => EngineChild;
|
|
117
|
+
/** The latest stored revision of a graph and whether it is a deletion, or undefined when it has none. */
|
|
118
|
+
readRevision: (graphId: string) => Promise<ManagerGraphRevision | undefined>;
|
|
119
|
+
/** How long an idle engine with no subscriber is kept. Default ten minutes. */
|
|
120
|
+
idleMs?: number;
|
|
121
|
+
/** The clock rows are stamped with, in epoch milliseconds. Default `Date.now`. */
|
|
122
|
+
now?: () => number;
|
|
123
|
+
}
|
|
124
|
+
/** Mirrors `MAX_TASK_CHARS` in `app-server.ts`: the engine refuses a longer `run.start` task or `run.steer` text. */
|
|
125
|
+
export declare const MANAGER_TASK_MAX_CHARS = 100000;
|
|
126
|
+
/**
|
|
127
|
+
* One line saying what a tool call or an approval is about, for the tools Graph Manager works with:
|
|
128
|
+
* the `graphs` action and the graph it names, the skill being read, the server being connected.
|
|
129
|
+
* A publish names only its draft, so `graphOfDraft` supplies the graph when the caller knows it.
|
|
130
|
+
* Every other tool keeps the transcript's wording. The line is at most 120 characters.
|
|
131
|
+
*/
|
|
132
|
+
export declare function describeManagerTool(name: string, value: unknown, graphOfDraft?: (draftId: string) => string | undefined): string;
|
|
133
|
+
/**
|
|
134
|
+
* A tool call split the way the app's transcript draws it: the verb, and the thing it acted on.
|
|
135
|
+
* A node is named by its name when the call carries one; a connection reads `source → target`
|
|
136
|
+
* with its outcome. The graph the call is about is left out when it is the open one, which every
|
|
137
|
+
* call of a conversation usually is. Any other tool keeps the transcript's one line as its verb.
|
|
138
|
+
*/
|
|
139
|
+
export declare function managerToolParts(name: string, value: unknown, openGraphId?: string): {
|
|
140
|
+
verb: string;
|
|
141
|
+
target?: string;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* The environment the chat's engine starts in: the parent's own, so the engine is signed in as the
|
|
145
|
+
* parent is. Stored credentials are scoped to an explicitly named home (`credentialIdentity`), so
|
|
146
|
+
* naming even the default home would move the engine to an empty credential slot. The home is
|
|
147
|
+
* named only when the chat runs against a different one than the environment already selects.
|
|
148
|
+
*
|
|
149
|
+
* The engine is marked as a worker, as the automation runner marks its own. An unmarked engine is a
|
|
150
|
+
* window's: it runs the user's automations, watches their pull requests and archives old sessions.
|
|
151
|
+
* This one is stopped when idle and when the editor closes, which would interrupt an automation it
|
|
152
|
+
* had claimed. The mark switches off those three background services and nothing else.
|
|
153
|
+
*
|
|
154
|
+
* A relative inherited home means the parent's working directory, and the engine starts in its own
|
|
155
|
+
* workspace, where the same words would name another folder with another configuration and another
|
|
156
|
+
* credential slot. It is handed the absolute path instead, which `credentialIdentity` resolves to
|
|
157
|
+
* the scope the parent reads.
|
|
158
|
+
*/
|
|
159
|
+
export declare function managerEngineEnvironment(directory: string, environment?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
160
|
+
/**
|
|
161
|
+
* What the agent is given with every message: which graph is open, the canvas as the user sees it
|
|
162
|
+
* now (unsaved edits included), the model the panel has selected, and the user's own words.
|
|
163
|
+
*/
|
|
164
|
+
export declare function managerTask(turn: ManagerTurn): string;
|
|
165
|
+
/**
|
|
166
|
+
* One Graph Manager conversation, run on an engine of its own.
|
|
167
|
+
*
|
|
168
|
+
* The engine that hosts Graph Studio may be busy with the user's task and runs one task at a time,
|
|
169
|
+
* so the chat spawns a dedicated `app-server --stdio` child in an empty workspace and speaks the
|
|
170
|
+
* same line protocol the automation runner does. Every panel connected to the graph server shares
|
|
171
|
+
* this one conversation: each subscriber is caught up with a snapshot and then receives the stream.
|
|
172
|
+
*
|
|
173
|
+
* Failures on the engine's side are reported as `error` events rather than rejections, because the
|
|
174
|
+
* message that failed is already on every panel's transcript and the stream is where panels listen.
|
|
175
|
+
*/
|
|
176
|
+
export declare class GraphManagerChat {
|
|
177
|
+
private readonly options;
|
|
178
|
+
private readonly directory;
|
|
179
|
+
private readonly workspace;
|
|
180
|
+
private readonly idleMs;
|
|
181
|
+
private readonly listeners;
|
|
182
|
+
private transcript;
|
|
183
|
+
private state;
|
|
184
|
+
private engine;
|
|
185
|
+
private sessionId;
|
|
186
|
+
private runId;
|
|
187
|
+
/** The run whose terminal event has been handled; its late `run.start` answer must not revive it. */
|
|
188
|
+
private finishedRunId;
|
|
189
|
+
/** Approvals and questions the panel has been shown and nobody has settled yet. */
|
|
190
|
+
private readonly prompts;
|
|
191
|
+
/** `graphs` calls in flight, by tool call id: the line shown for each, and the graph a begin opens or a publish saves. */
|
|
192
|
+
private readonly graphCalls;
|
|
193
|
+
/** Which graph each draft is of, learned from `andorra_graph_begin`, so a publish can name its graph. */
|
|
194
|
+
private readonly drafts;
|
|
195
|
+
/** The latest revision reported for each graph the agent saved other than the open one. */
|
|
196
|
+
private readonly otherRevisions;
|
|
197
|
+
/** The model the latest message chose, for a steering message that has to be sent again as a run. */
|
|
198
|
+
private lastModel;
|
|
199
|
+
/**
|
|
200
|
+
* Messages a run ended without reading, oldest first, each already a whole task. The engine keeps
|
|
201
|
+
* them out of the session's history, so they stay here until an engine has accepted them.
|
|
202
|
+
*/
|
|
203
|
+
private unread;
|
|
204
|
+
/** The pair the latest run was started on or last switched to, to tell when a message changes it. */
|
|
205
|
+
private runModel;
|
|
206
|
+
private openGraphId;
|
|
207
|
+
private lastRevision;
|
|
208
|
+
private revisionCheck;
|
|
209
|
+
private cancelling;
|
|
210
|
+
/** How many times Stop was pressed, so a message still waiting to be sent can tell it was stopped too. */
|
|
211
|
+
private stops;
|
|
212
|
+
private closed;
|
|
213
|
+
/** Messages and resets are delivered one at a time, in the order they were asked for. */
|
|
214
|
+
private queue;
|
|
215
|
+
private idleTimer;
|
|
216
|
+
private idleWaiters;
|
|
217
|
+
private readonly now;
|
|
218
|
+
/** Names the rows of tool calls the engine reported without an id of their own. */
|
|
219
|
+
private toolRows;
|
|
220
|
+
constructor(options: GraphManagerChatOptions);
|
|
221
|
+
/** The listener is first handed the conversation so far as one snapshot, then every later event. */
|
|
222
|
+
subscribe(listener: (event: ManagerEvent) => void): () => void;
|
|
223
|
+
/** Start the conversation, continue it, or steer the run that is working. */
|
|
224
|
+
send(turn: ManagerTurn): Promise<void>;
|
|
225
|
+
approve(id: string, approved: boolean): Promise<void>;
|
|
226
|
+
answer(id: string, value: string): Promise<void>;
|
|
227
|
+
cancel(): Promise<void>;
|
|
228
|
+
/** Forget the session and the transcript. The engine stays for the next conversation. */
|
|
229
|
+
reset(): Promise<void>;
|
|
230
|
+
/** Cancel the run, stop the child and clear the timers. Nothing is started afterwards. */
|
|
231
|
+
close(): Promise<void>;
|
|
232
|
+
private enqueue;
|
|
233
|
+
private deliver;
|
|
234
|
+
/**
|
|
235
|
+
* Hands the engine every message a run ended without reading. A message leaves `unread` only when
|
|
236
|
+
* it is on its way to an engine: as the next run when nothing is working, else steered into the run
|
|
237
|
+
* that is. A run that is itself ending refuses the steer, and the message then waits for the run after it.
|
|
238
|
+
*/
|
|
239
|
+
private deliverUnread;
|
|
240
|
+
/**
|
|
241
|
+
* Moves the working run to the pair a message chose, when it differs from the pair the run is on.
|
|
242
|
+
* `overrideAllNodes: false` is the scope `run.start` gave the first pair: the run's own, which
|
|
243
|
+
* Graph Manager's one agent node (it names no model) and whatever it delegates to answer from.
|
|
244
|
+
* Undefined when the run is on the pair; otherwise why it is not.
|
|
245
|
+
*/
|
|
246
|
+
private switchRunModel;
|
|
247
|
+
private start;
|
|
248
|
+
private cancelRun;
|
|
249
|
+
private ensureEngine;
|
|
250
|
+
private spawnDefault;
|
|
251
|
+
private wire;
|
|
252
|
+
private request;
|
|
253
|
+
/** A deliberate stop: EOF lets the engine finish its own cleanup, and it is reaped if it does not. */
|
|
254
|
+
private stopEngine;
|
|
255
|
+
private onEngineEvent;
|
|
256
|
+
private onRunEvent;
|
|
257
|
+
/** Settles a tool row in place. A call reported without an id, or never opened, has no row to settle. */
|
|
258
|
+
private settleTool;
|
|
259
|
+
/**
|
|
260
|
+
* One model call's reasoning, folded into a single row the way the app's transcript folds it: a
|
|
261
|
+
* retried request restarts the row, deltas grow it, and the completion settles it with the
|
|
262
|
+
* authoritative text, or takes it away when the call streamed no reasoning at all.
|
|
263
|
+
*/
|
|
264
|
+
private onReasoning;
|
|
265
|
+
/**
|
|
266
|
+
* Rows a run left open when it ended: a call it never reported the end of is stopped, a thought
|
|
267
|
+
* still streaming keeps what it streamed, and one that streamed nothing is taken away.
|
|
268
|
+
*/
|
|
269
|
+
private settleOpenRows;
|
|
270
|
+
private describe;
|
|
271
|
+
private endGraphCall;
|
|
272
|
+
/**
|
|
273
|
+
* The `graphs` tool also lists and reads, so a save is told by the stored revision rising. The
|
|
274
|
+
* open graph is checked after every call. A publish of another graph (the only way the agent can
|
|
275
|
+
* save its work on the bundled preset) is checked under that graph's id, and reported with the
|
|
276
|
+
* name it was begun with so the panel can offer to open it; so is a delete or a restore of one.
|
|
277
|
+
*
|
|
278
|
+
* Deleting a graph also raises its revision: the new one carries `metadata.deletedAt`. That is
|
|
279
|
+
* reported as `graph.deleted`, never as a save, so no panel loads a deleted graph as an editable
|
|
280
|
+
* one. A restore publishes a live revision above it, which is a save like any other.
|
|
281
|
+
*/
|
|
282
|
+
private checkRevision;
|
|
283
|
+
/** The run is over, however it ended. */
|
|
284
|
+
private finish;
|
|
285
|
+
private resolvePrompt;
|
|
286
|
+
private resolvePrompts;
|
|
287
|
+
private setState;
|
|
288
|
+
/** Read through a call so a check after an await sees the state as it is then. */
|
|
289
|
+
private isIdle;
|
|
290
|
+
private whenIdle;
|
|
291
|
+
/** An engine is kept while a run is working or waiting on the user, and while any panel is connected. */
|
|
292
|
+
private armIdleStop;
|
|
293
|
+
private emit;
|
|
294
|
+
/** Sends an event without adding a row: it changes a row the transcript already holds. */
|
|
295
|
+
private broadcast;
|
|
296
|
+
/**
|
|
297
|
+
* Replaces the latest row `match` finds with `next` of it, and tells the panels with `event`.
|
|
298
|
+
* False when no row matches, so the caller can add one instead.
|
|
299
|
+
*/
|
|
300
|
+
private replace;
|
|
301
|
+
private deliverTo;
|
|
302
|
+
}
|