@andorra-labs/code 0.1.16 → 0.1.17
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/acp-agent.d.ts +6 -0
- package/dist/src/acp-agent.js +15 -4
- package/dist/src/agent-execution.js +11 -8
- package/dist/src/agent-mcp-catalog.js +1 -0
- package/dist/src/agent-mcp.d.ts +3 -0
- package/dist/src/agent-mcp.js +33 -1
- package/dist/src/andorra/entry.d.ts +10 -0
- package/dist/src/andorra/entry.js +18 -4
- package/dist/src/andorra/hosted.d.ts +2 -1
- package/dist/src/andorra/hosted.js +2 -1
- package/dist/src/andorra/notices.d.ts +5 -0
- package/dist/src/andorra/notices.js +7 -0
- package/dist/src/andorra/state.d.ts +3 -2
- package/dist/src/andorra/state.js +4 -4
- package/dist/src/andorra/terminal.js +7 -2
- package/dist/src/anthropic-credentials.js +2 -0
- package/dist/src/app-server/error.d.ts +5 -0
- package/dist/src/app-server/error.js +7 -0
- package/dist/src/app-server/protocol.d.ts +19 -44
- package/dist/src/app-server/protocol.js +5 -1
- package/dist/src/app-server/workspace.d.ts +89 -0
- package/dist/src/app-server/workspace.js +457 -11
- package/dist/src/app-server.d.ts +358 -32
- package/dist/src/app-server.js +2429 -509
- package/dist/src/bridge/cloud.d.ts +27 -0
- package/dist/src/bridge/cloud.js +187 -0
- package/dist/src/bridge/command.d.ts +30 -0
- package/dist/src/bridge/command.js +347 -0
- package/dist/src/bridge/control.d.ts +68 -0
- package/dist/src/bridge/control.js +233 -0
- package/dist/src/bridge/engines.d.ts +90 -0
- package/dist/src/bridge/engines.js +601 -0
- package/dist/src/bridge/host-ops.d.ts +9 -0
- package/dist/src/bridge/host-ops.js +129 -0
- package/dist/src/bridge/host.d.ts +47 -0
- package/dist/src/bridge/host.js +540 -0
- package/dist/src/bridge/link.d.ts +38 -0
- package/dist/src/bridge/link.js +508 -0
- package/dist/src/bridge/login-link.d.ts +29 -0
- package/dist/src/bridge/login-link.js +54 -0
- package/dist/src/bridge/protocol.d.ts +136 -0
- package/dist/src/bridge/protocol.js +11 -0
- package/dist/src/bridge/store.d.ts +12 -0
- package/dist/src/bridge/store.js +61 -0
- package/dist/src/bridge/wording.d.ts +6 -0
- package/dist/src/bridge/wording.js +10 -0
- package/dist/src/browser-server.js +7 -1
- package/dist/src/browser-ui/tokens.css +1 -1
- package/dist/src/change-authors.d.ts +41 -0
- package/dist/src/change-authors.js +146 -0
- package/dist/src/cli.js +182 -32
- package/dist/src/coding-tools.js +15 -15
- package/dist/src/command-screens.d.ts +6 -0
- package/dist/src/command-screens.js +14 -11
- package/dist/src/commands.d.ts +14 -2
- package/dist/src/compaction-phrases.js +1 -1
- package/dist/src/completion.js +82 -5
- package/dist/src/config.d.ts +71 -3
- package/dist/src/config.js +202 -77
- package/dist/src/deadline.js +13 -1
- package/dist/src/decision/checks.js +1 -1
- package/dist/src/decision/requestPhrases.js +0 -1
- package/dist/src/default-graph.js +1 -1
- package/dist/src/file-diff.d.ts +4 -0
- package/dist/src/file-diff.js +2 -1
- package/dist/src/github-app/agent-writes.d.ts +102 -0
- package/dist/src/github-app/agent-writes.js +320 -0
- package/dist/src/github-app/client.d.ts +349 -0
- package/dist/src/github-app/client.js +810 -0
- package/dist/src/github-app/event-source.d.ts +208 -0
- package/dist/src/github-app/event-source.js +684 -0
- package/dist/src/github-app/metrics.d.ts +32 -0
- package/dist/src/github-app/metrics.js +49 -0
- package/dist/src/github-app/review-loop.d.ts +274 -0
- package/dist/src/github-app/review-loop.js +1177 -0
- package/dist/src/github-app/review-node.d.ts +81 -0
- package/dist/src/github-app/review-node.js +205 -0
- package/dist/src/github-app/review-post.d.ts +73 -0
- package/dist/src/github-app/review-post.js +139 -0
- package/dist/src/github-app/review-text.d.ts +107 -0
- package/dist/src/github-app/review-text.js +1133 -0
- package/dist/src/github-app/review-threads.d.ts +47 -0
- package/dist/src/github-app/review-threads.js +107 -0
- package/dist/src/github-app/reviewer.d.ts +121 -0
- package/dist/src/github-app/reviewer.js +598 -0
- package/dist/src/github-app/store.d.ts +59 -0
- package/dist/src/github-app/store.js +148 -0
- package/dist/src/github-app/triggers.d.ts +141 -0
- package/dist/src/github-app/triggers.js +441 -0
- package/dist/src/github-names.d.ts +8 -0
- package/dist/src/github-names.js +8 -0
- package/dist/src/glob-search.d.ts +61 -0
- package/dist/src/glob-search.js +180 -0
- package/dist/src/graph-health.js +6 -1
- package/dist/src/graph-manager-chat.js +1 -1
- package/dist/src/graph-preview.d.ts +46 -0
- package/dist/src/graph-preview.js +55 -0
- package/dist/src/graph-provider-portability.js +2 -1
- package/dist/src/graph-runner.js +64 -3
- package/dist/src/graph-server.js +3 -3
- package/dist/src/graph-sync.js +3 -3
- package/dist/src/graph-ui/app.js +91 -7
- package/dist/src/graph-ui/icons.js +2 -1
- package/dist/src/graph-ui/studio.js +15 -1
- package/dist/src/graph-ui/tokens.css +1 -1
- package/dist/src/graphs.d.ts +34 -1
- package/dist/src/graphs.js +158 -14
- package/dist/src/image-input.d.ts +16 -0
- package/dist/src/image-input.js +41 -0
- package/dist/src/membership.d.ts +10 -0
- package/dist/src/membership.js +19 -4
- package/dist/src/model-health-cache.js +1 -1
- package/dist/src/model-metadata.d.ts +6 -0
- package/dist/src/model-metadata.js +35 -15
- package/dist/src/model-relay/local.d.ts +116 -0
- package/dist/src/model-relay/local.js +468 -0
- package/dist/src/model-relay/remote.d.ts +129 -0
- package/dist/src/model-relay/remote.js +252 -0
- package/dist/src/model-relay/runs.d.ts +34 -0
- package/dist/src/model-relay/runs.js +146 -0
- package/dist/src/model-relay/wire.d.ts +5 -0
- package/dist/src/model-relay/wire.js +5 -0
- package/dist/src/project-registry.d.ts +21 -0
- package/dist/src/project-registry.js +74 -0
- package/dist/src/provider-import.d.ts +0 -12
- package/dist/src/provider-import.js +7 -195
- package/dist/src/providers.d.ts +23 -2
- package/dist/src/providers.js +25 -4
- package/dist/src/pull-request-logs.d.ts +12 -1
- package/dist/src/pull-request-logs.js +14 -3
- package/dist/src/pull-requests.d.ts +327 -7
- package/dist/src/pull-requests.js +429 -51
- package/dist/src/react-runtime.js +1 -1
- package/dist/src/remote/engine-pool.d.ts +88 -4
- package/dist/src/remote/engine-pool.js +366 -89
- package/dist/src/remote/roots.d.ts +19 -0
- package/dist/src/remote/roots.js +45 -7
- package/dist/src/remote/types.d.ts +0 -44
- package/dist/src/run-control.d.ts +7 -0
- package/dist/src/run-control.js +23 -0
- package/dist/src/run-records.d.ts +7 -2
- package/dist/src/run-records.js +71 -6
- package/dist/src/runtime.d.ts +5 -1
- package/dist/src/runtime.js +10 -2
- package/dist/src/session-changes.d.ts +35 -0
- package/dist/src/session-changes.js +194 -6
- package/dist/src/session-monitor.js +2 -1
- package/dist/src/session-reaper.d.ts +1 -1
- package/dist/src/session-reaper.js +6 -1
- package/dist/src/session-summary.d.ts +2 -1
- package/dist/src/session-summary.js +2 -1
- package/dist/src/sessions.d.ts +11 -1
- package/dist/src/sessions.js +17 -4
- package/dist/src/skills/bundled/diagram/SKILL.md +5 -3
- package/dist/src/skills/bundled/graph-manager/SKILL.md +7 -4
- package/dist/src/skills/bundled/provenance.json +2 -2
- package/dist/src/skills/runtime-skills.js +1 -1
- package/dist/src/telemetry/emitter.d.ts +15 -0
- package/dist/src/telemetry/emitter.js +35 -1
- package/dist/src/telemetry/schema.d.ts +25 -2
- package/dist/src/telemetry/schema.js +52 -4
- package/dist/src/telemetry/surface.d.ts +2 -1
- package/dist/src/telemetry/surface.js +4 -1
- package/dist/src/terminal-ui.d.ts +1 -0
- package/dist/src/terminal-ui.js +10 -3
- package/dist/src/test-edit-guard.d.ts +7 -0
- package/dist/src/test-edit-guard.js +49 -1
- package/dist/src/timers.d.ts +2 -0
- package/dist/src/tools.js +59 -9
- package/package.json +6 -1
- package/dist/src/remote/cert.d.ts +0 -11
- package/dist/src/remote/cert.js +0 -87
- package/dist/src/remote/client.d.ts +0 -119
- package/dist/src/remote/client.js +0 -544
- package/dist/src/remote/command.d.ts +0 -4
- package/dist/src/remote/command.js +0 -194
- package/dist/src/remote/errors.d.ts +0 -11
- package/dist/src/remote/errors.js +0 -14
- package/dist/src/remote/network.d.ts +0 -22
- package/dist/src/remote/network.js +0 -102
- package/dist/src/remote/pairing.d.ts +0 -63
- package/dist/src/remote/pairing.js +0 -299
- package/dist/src/remote/pem.d.ts +0 -2
- package/dist/src/remote/pem.js +0 -7
- package/dist/src/remote/serve.d.ts +0 -68
- package/dist/src/remote/serve.js +0 -244
- package/dist/src/remote/server.d.ts +0 -21
- package/dist/src/remote/server.js +0 -406
package/dist/src/app-server.d.ts
CHANGED
|
@@ -7,18 +7,43 @@ import { OpenCodeSignIn } from './managed-sign-in.js';
|
|
|
7
7
|
import { type SignInProbes } from './sign-in-detection.js';
|
|
8
8
|
import type { CliSignIn } from './cli-sign-in.js';
|
|
9
9
|
import { checkGraphModelHealth } from './graph-health.js';
|
|
10
|
-
import { loadAccessibleGraph } from './membership.js';
|
|
10
|
+
import { loadAccessibleGraph, type Membership } from './membership.js';
|
|
11
11
|
import { type SavedSession } from './sessions.js';
|
|
12
12
|
import { type GitRunner } from './pull-request-create.js';
|
|
13
13
|
import { type GhRunner } from './pull-requests.js';
|
|
14
14
|
import { type Completion, type RunResult } from './runtime.js';
|
|
15
|
+
import { type GitHubAppClient } from './github-app/client.js';
|
|
16
|
+
import { type ReviewLoopDependencies } from './github-app/review-loop.js';
|
|
15
17
|
import { CodeIntelligenceManager } from './code-intelligence/CodeIntelligenceManager.js';
|
|
16
|
-
import {
|
|
18
|
+
import { AppServerError } from './app-server/error.js';
|
|
19
|
+
import { type CloudStatus, type EnvironmentRecord } from './bridge/control.js';
|
|
20
|
+
import { RelayLink } from './bridge/link.js';
|
|
17
21
|
import { type HostedMonitorOptions } from './andorra/monitor.js';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
/** The account calls behind environments.*, each taking the desktop's Andorra access token. */
|
|
23
|
+
export interface EnvironmentControl {
|
|
24
|
+
list(accessToken: string): Promise<EnvironmentRecord[]>;
|
|
25
|
+
claim(accessToken: string, code: string, name: string): Promise<EnvironmentRecord>;
|
|
26
|
+
rename(accessToken: string, id: string, name: string): Promise<EnvironmentRecord>;
|
|
27
|
+
remove(accessToken: string, id: string): Promise<void>;
|
|
28
|
+
cloudGet(accessToken: string): Promise<CloudStatus>;
|
|
29
|
+
cloudStart(accessToken: string, version: string): Promise<CloudStatus>;
|
|
30
|
+
cloudStop(accessToken: string): Promise<CloudStatus>;
|
|
31
|
+
cloudDelete(accessToken: string, environmentId?: string): Promise<CloudStatus>;
|
|
21
32
|
}
|
|
33
|
+
/** What the desktop is told about its Cloud instance. */
|
|
34
|
+
export interface CloudView {
|
|
35
|
+
state: CloudStatus['state'];
|
|
36
|
+
enabled: boolean;
|
|
37
|
+
environmentId?: string;
|
|
38
|
+
label?: string;
|
|
39
|
+
step?: 'machine' | 'bridge';
|
|
40
|
+
deleteAt?: string;
|
|
41
|
+
error?: 'boot_timeout' | 'no_capacity';
|
|
42
|
+
stopReason?: CloudStatus['stopReason'];
|
|
43
|
+
/** True when the instance runs a different version from this engine. */
|
|
44
|
+
outdated: boolean;
|
|
45
|
+
}
|
|
46
|
+
export type RelayLinkPort = Pick<RelayLink, 'open' | 'request' | 'host' | 'close' | 'presence' | 'dispose'>;
|
|
22
47
|
type ManagedSignInService = Pick<CliSignIn, 'start' | 'status' | 'cancel' | 'logout' | 'submitCode' | 'close'>;
|
|
23
48
|
type OpenCodeSignInService = Pick<OpenCodeSignIn, 'start' | 'status' | 'cancel' | 'logout' | 'submitCode' | 'close'>;
|
|
24
49
|
export declare function rekeyProjectExtensions(config: Config, fromKey: string, toKey: string, merged: boolean): Config;
|
|
@@ -34,6 +59,8 @@ export interface AppServerOptions {
|
|
|
34
59
|
modelHealthTtlMs?: number;
|
|
35
60
|
createCodeIntelligence?: typeof CodeIntelligenceManager.create;
|
|
36
61
|
loadGraph?: typeof loadAccessibleGraph;
|
|
62
|
+
/** The clock the model relay's re-announce, claim-silence and away timers use; tests pass a manual one. */
|
|
63
|
+
modelRelayTimers?: typeof globalThis;
|
|
37
64
|
codexAuth?: Pick<CodexAccountAuth, 'start' | 'status' | 'cancel' | 'logout' | 'close'>;
|
|
38
65
|
removeCodexAccount?: typeof removeCodexAccount;
|
|
39
66
|
anthropicAuth?: Pick<AnthropicConsoleAuth, 'start' | 'status' | 'cancel' | 'logout' | 'discard' | 'close'>;
|
|
@@ -50,6 +77,31 @@ export interface AppServerOptions {
|
|
|
50
77
|
pullRequestPollMs?: number;
|
|
51
78
|
hostedCheck?: HostedMonitorOptions['check'];
|
|
52
79
|
hostedNow?: () => number;
|
|
80
|
+
/** The relay link, account calls and access token behind environments.* and remote.* (tests pass fakes). */
|
|
81
|
+
environments?: {
|
|
82
|
+
relayLink?: () => RelayLinkPort;
|
|
83
|
+
control?: EnvironmentControl;
|
|
84
|
+
accessToken?: () => Promise<string>;
|
|
85
|
+
};
|
|
86
|
+
/** The GitHub App's account routes and the sign-in check behind github.* and the event source (tests pass fakes). */
|
|
87
|
+
/** A review wait's timing, for tests: how often it reads Codex's signals, and how long a head stays quiet before "@codex review". */
|
|
88
|
+
reviewSignals?: {
|
|
89
|
+
intervalMs?: number;
|
|
90
|
+
bumpDelayMs?: number;
|
|
91
|
+
};
|
|
92
|
+
githubApp?: {
|
|
93
|
+
client?: GitHubAppClient;
|
|
94
|
+
signedIn?: (signal?: AbortSignal) => Promise<boolean>;
|
|
95
|
+
subject?: () => Promise<string | undefined>;
|
|
96
|
+
now?: () => number;
|
|
97
|
+
checkNowDelayMs?: number;
|
|
98
|
+
reactionBudgetMs?: number;
|
|
99
|
+
mentionRetryMs?: number[];
|
|
100
|
+
/** The plan read that gates switching the Andorra review loop on (tests answer it without the account service). */
|
|
101
|
+
membership?: (signal?: AbortSignal) => Promise<Membership>;
|
|
102
|
+
/** The review loop's reviewer, worktree, waits and ids (tests run it without a model or a child process). */
|
|
103
|
+
reviewLoop?: Partial<Pick<ReviewLoopDependencies, 'prepareWorkspace' | 'runReviewer' | 'sweep' | 'newRequestId' | 'sleep' | 'now' | 'tickMs' | 'reviewerEnv'>>;
|
|
104
|
+
};
|
|
53
105
|
}
|
|
54
106
|
export declare class AppServer {
|
|
55
107
|
private automationCheck?;
|
|
@@ -77,13 +129,34 @@ export declare class AppServer {
|
|
|
77
129
|
private readonly gh;
|
|
78
130
|
private readonly git;
|
|
79
131
|
private readonly pullRequestWatcher;
|
|
132
|
+
private readonly githubClient;
|
|
133
|
+
private readonly githubSignedIn;
|
|
134
|
+
/** The signed-in account's subject, for gating the `github.watch` telemetry on its plan and opt-out. */
|
|
135
|
+
private readonly githubAccount;
|
|
136
|
+
private readonly githubEvents;
|
|
137
|
+
/** "@andorra-code" mentions on a task's PR (phase 3): the access check, the 👀 and the wake. */
|
|
138
|
+
private readonly mentions;
|
|
139
|
+
/** The App's bot login (`bot` from `GET /v1/github`, or `as` from a bot write), for the Auto-fix prompt. */
|
|
140
|
+
private githubBot?;
|
|
80
141
|
private readonly pullRequestReader;
|
|
81
142
|
private readonly sessionChanges;
|
|
82
143
|
private readonly autoFixWakes;
|
|
83
144
|
/** Wakes the PR tab's Fix with Agent armed: delivered as the person's request, not as a timer. */
|
|
84
145
|
private readonly fixWakes;
|
|
146
|
+
/** Wakes a mention of the App's bot on the task's PR armed: delivered as "Mentioned on GitHub", not as a timer. */
|
|
147
|
+
private readonly mentionWakes;
|
|
85
148
|
private readonly reviewWaiters;
|
|
86
149
|
private readonly reviewWaitsStarting;
|
|
150
|
+
/** The Andorra review loop's fixer wakes, beside Auto-fix's: delivered as "Andorra review", routed like Auto-fix's. */
|
|
151
|
+
private readonly reviewWakes;
|
|
152
|
+
/** Each review wait's run, when it started, and the review loop it watches (the one running when it started, or after). */
|
|
153
|
+
private readonly reviewWaitRuns;
|
|
154
|
+
private readonly reviewLoop;
|
|
155
|
+
private readonly githubMembership;
|
|
156
|
+
private readonly reviewSignalMs;
|
|
157
|
+
private readonly reviewBumpDelayMs;
|
|
158
|
+
/** Repositories (lower-case owner/name) where Codex was seen on a recent PR, so the question is asked once. */
|
|
159
|
+
private readonly codexRepositories;
|
|
87
160
|
private readonly graphSync;
|
|
88
161
|
private readonly stopGraphVisibilityWatch;
|
|
89
162
|
private readonly terminals;
|
|
@@ -93,9 +166,39 @@ export declare class AppServer {
|
|
|
93
166
|
private readonly browserViews;
|
|
94
167
|
private readonly browserExtensions;
|
|
95
168
|
private extensionStatus;
|
|
169
|
+
/** The Files tab's search in flight per channel, so a newer query cancels the older one. */
|
|
170
|
+
private readonly workspaceSearches;
|
|
96
171
|
private readonly pending;
|
|
97
172
|
private readonly waiting;
|
|
98
173
|
private readonly panelRelays;
|
|
174
|
+
private readonly modelRelay;
|
|
175
|
+
/** Answers the model calls of relayed runs on linked machines with this computer's providers. */
|
|
176
|
+
private readonly localRelay;
|
|
177
|
+
/** Machines being removed: refused at once, before the config file drops them from `environments.modelRelay`. */
|
|
178
|
+
private readonly modelRelayRevoked;
|
|
179
|
+
/** Machines allowed here whose save to `environments.modelRelay` failed, as `subject\0env`: allowed for this engine's lifetime. */
|
|
180
|
+
private readonly modelRelayUnsaved;
|
|
181
|
+
/** The runs this computer started or resumed on each machine: only their model requests are answered. */
|
|
182
|
+
private readonly modelRelayRuns;
|
|
183
|
+
/** Runs whose record failed to save, as `subject\0env\0runId`: answered for this engine's lifetime, saved again at 30 s. */
|
|
184
|
+
private readonly modelRelayRunsUnsaved;
|
|
185
|
+
/**
|
|
186
|
+
* Allowed machines a fresh account listing did not name, as `subject\0env`, with when that was first seen. Only a
|
|
187
|
+
* machine missing from two fresh listings a refresh apart is forgotten.
|
|
188
|
+
*/
|
|
189
|
+
private readonly modelRelayMissing;
|
|
190
|
+
/** Each provider's resolved context windows for the relay block, by the fields that determine them. */
|
|
191
|
+
private readonly relayWindowsCache;
|
|
192
|
+
/** Reconciliations of the engine's own links in flight; close waits for them. */
|
|
193
|
+
private readonly modelRelayChores;
|
|
194
|
+
/** Machines whose removal is in flight: a run they take meanwhile does not allow them again. */
|
|
195
|
+
private readonly modelRelayRemoving;
|
|
196
|
+
/** This engine's own links to the machines allowed to use this computer's models, apart from the window's. */
|
|
197
|
+
private readonly modelRelayLinks;
|
|
198
|
+
private modelRelayRefresh?;
|
|
199
|
+
private readonly modelRelaySaveRetries;
|
|
200
|
+
/** Bumped by every reconciliation of the engine's links, so only the latest one acts. */
|
|
201
|
+
private modelRelaySync;
|
|
99
202
|
private readonly panelOperations;
|
|
100
203
|
private readonly panelOperationRuns;
|
|
101
204
|
private readonly requests;
|
|
@@ -127,10 +230,17 @@ export declare class AppServer {
|
|
|
127
230
|
private editorTask?;
|
|
128
231
|
private codeIntel?;
|
|
129
232
|
private codeIntelOpening;
|
|
130
|
-
private remoteServe?;
|
|
131
233
|
private readonly engineLinks;
|
|
132
|
-
private readonly
|
|
133
|
-
private
|
|
234
|
+
private readonly environmentOptions;
|
|
235
|
+
private relay?;
|
|
236
|
+
private environmentIds?;
|
|
237
|
+
private environmentIdsLoading?;
|
|
238
|
+
/** The id of the account's Cloud environment, once a list or a Cloud answer has named it. */
|
|
239
|
+
private cloudEnvironmentId?;
|
|
240
|
+
/** The last failed read of the account's list: within ENVIRONMENT_IDS_TTL_MS, reads fail with it without asking again. */
|
|
241
|
+
private environmentIdsFailure?;
|
|
242
|
+
/** Bumped when the account changes, so an answer fetched for the previous account is never cached. */
|
|
243
|
+
private accountGeneration;
|
|
134
244
|
private closed;
|
|
135
245
|
private emitsStopped;
|
|
136
246
|
private readonly hosted;
|
|
@@ -187,6 +297,11 @@ export declare class AppServer {
|
|
|
187
297
|
private skillRead;
|
|
188
298
|
private skillWrite;
|
|
189
299
|
private installExtension;
|
|
300
|
+
/**
|
|
301
|
+
* Whether a task's run is open anywhere on this home. A review loop's reviewer (a hidden session) is not a task: it
|
|
302
|
+
* uses no skill or plugin, so it never holds up an edit or a removal.
|
|
303
|
+
*/
|
|
304
|
+
private taskRunsOpen;
|
|
190
305
|
private removeExtension;
|
|
191
306
|
private setExtensionEnabled;
|
|
192
307
|
private mutateMcp;
|
|
@@ -211,6 +326,14 @@ export declare class AppServer {
|
|
|
211
326
|
private sessionStats;
|
|
212
327
|
private signIn;
|
|
213
328
|
private signOut;
|
|
329
|
+
/** The stored sign-in was rejected and removed: the account is signed out without anyone asking. */
|
|
330
|
+
private accountSignedOut;
|
|
331
|
+
/**
|
|
332
|
+
* The relay socket and every machine link were opened for the signed-in account. When the account changes or
|
|
333
|
+
* signs out they all end: each link with `remote.engine.closed` and `reason` (`login-required` after a sign-out,
|
|
334
|
+
* `account-changed` after a sign-in), and the socket itself, so the next use dials again with the new sign-in.
|
|
335
|
+
*/
|
|
336
|
+
private endAccountLinks;
|
|
214
337
|
/** Signing in or out changes what Andorra offers this account: ask now instead of at the next interval. */
|
|
215
338
|
private checkHostedAfterAccountChange;
|
|
216
339
|
private publishAccount;
|
|
@@ -235,6 +358,8 @@ export declare class AppServer {
|
|
|
235
358
|
private compactSession;
|
|
236
359
|
private saveFinalizedSession;
|
|
237
360
|
private setSessionArchived;
|
|
361
|
+
/** Pins or unpins a task in the rail. The pin is rail-owned like a rename, so this window's own run may be pinned too: the run carries it forward when it saves. */
|
|
362
|
+
private setSessionPinned;
|
|
238
363
|
private deleteSession;
|
|
239
364
|
private startRun;
|
|
240
365
|
private resumeRun;
|
|
@@ -242,6 +367,7 @@ export declare class AppServer {
|
|
|
242
367
|
private assertRunning;
|
|
243
368
|
private prepareRun;
|
|
244
369
|
private graphForRun;
|
|
370
|
+
/** `source`: a relayed run's graph, already read; it is bound to `config` (the run's relayed providers) instead of being loaded. */
|
|
245
371
|
private loadResumeGraph;
|
|
246
372
|
private prepareRunValidated;
|
|
247
373
|
private titleSessionFromPrompt;
|
|
@@ -273,6 +399,15 @@ export declare class AppServer {
|
|
|
273
399
|
private approve;
|
|
274
400
|
private ask;
|
|
275
401
|
private settleApproval;
|
|
402
|
+
/**
|
|
403
|
+
* The adapter a run talks to. A relayed provider's model is on the desktop, so its requests go through the model
|
|
404
|
+
* relay as `runId`'s (the live run's when none is given, read when the request is made).
|
|
405
|
+
*/
|
|
406
|
+
private adapterFor;
|
|
407
|
+
/** The id, run and claimant of a model.relay call; the claimant is the connection the desktop's engine speaks through. */
|
|
408
|
+
private relayCall;
|
|
409
|
+
private relayProgress;
|
|
410
|
+
private relayResult;
|
|
276
411
|
private panelBrowserRelayFor;
|
|
277
412
|
private settlePanelRelay;
|
|
278
413
|
private settleAnswer;
|
|
@@ -292,33 +427,134 @@ export declare class AppServer {
|
|
|
292
427
|
private selectGraph;
|
|
293
428
|
private openEditor;
|
|
294
429
|
private closeEditor;
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
private
|
|
298
|
-
private
|
|
299
|
-
private
|
|
300
|
-
private
|
|
301
|
-
private
|
|
302
|
-
private
|
|
303
|
-
private
|
|
304
|
-
private
|
|
305
|
-
private
|
|
306
|
-
private
|
|
307
|
-
|
|
308
|
-
|
|
430
|
+
/** The one relay link this engine uses for every machine, created on first use and disposed in `close`. */
|
|
431
|
+
private relayLink;
|
|
432
|
+
private environmentAccessToken;
|
|
433
|
+
private environmentControl;
|
|
434
|
+
private environmentError;
|
|
435
|
+
private onlineEnvironments;
|
|
436
|
+
private environmentsList;
|
|
437
|
+
private environmentClaim;
|
|
438
|
+
private environmentRename;
|
|
439
|
+
private environmentCloud;
|
|
440
|
+
private cloudView;
|
|
441
|
+
private environmentRemove;
|
|
442
|
+
/**
|
|
443
|
+
* Whether `env` is one of the caller's environments, from the control list cached for 30 s, or the account's Cloud. The relay answers
|
|
444
|
+
* not-found both for a machine whose bridge is away and for one the caller does not own; this tells them apart.
|
|
445
|
+
* 'unknown' when the list could not be read for a reason other than sign-in, which callers treat as offline.
|
|
446
|
+
*/
|
|
447
|
+
private environmentMembership;
|
|
448
|
+
/**
|
|
449
|
+
* The account's environment ids, cached for 30 s. A read that failed is remembered for as long, so callers that run
|
|
450
|
+
* by themselves (answering model requests, retrying links) do not ask the service again on every turn; `fresh`
|
|
451
|
+
* (a person's own action) asks it regardless.
|
|
452
|
+
*/
|
|
453
|
+
private listedEnvironmentIds;
|
|
454
|
+
/** A call for a machine whose link is waiting for it to come back fails now instead of at its deadline. */
|
|
455
|
+
private refuseWhileReconnecting;
|
|
456
|
+
private hostOperation;
|
|
309
457
|
private remoteEngineConnect;
|
|
458
|
+
/** What the machine's `whoami` adds to its host description (grant, capabilities); undefined when it could not be read. */
|
|
459
|
+
private machineIdentity;
|
|
460
|
+
/** A reopen whose `whoami` failed asks again once the link is up, and reports the full host with another `reopened`. */
|
|
461
|
+
private retryMachineIdentity;
|
|
462
|
+
/** Whether `link` is still the one held for `env` in its own map, and not ended. */
|
|
463
|
+
private linkIsCurrent;
|
|
464
|
+
private openEngineLink;
|
|
465
|
+
private emitEngineFrame;
|
|
466
|
+
private engineLinkEnded;
|
|
467
|
+
/** A transient end keeps the link: the desktop keeps its clients and transcript while the engine reopens it. */
|
|
468
|
+
private awaitMachine;
|
|
469
|
+
private retryEngineLink;
|
|
470
|
+
/**
|
|
471
|
+
* Opens `link` again (or, for the engine's own link, the first time); one that fails is retried in 5 s, or for the
|
|
472
|
+
* engine's own link on its backoff.
|
|
473
|
+
*/
|
|
474
|
+
private attemptEngineLink;
|
|
475
|
+
/**
|
|
476
|
+
* Ends `link` for good. The machine's model work stops with it unless the machine is still reachable through its
|
|
477
|
+
* other link; a machine that left the account stops either way.
|
|
478
|
+
*/
|
|
479
|
+
private forgetEngineLink;
|
|
480
|
+
/** Closes `link`. The machine's model work is kept: a new link may replace this one and deliver it. */
|
|
481
|
+
private dropEngineLink;
|
|
310
482
|
private remoteEngineDisconnect;
|
|
311
|
-
|
|
483
|
+
/**
|
|
484
|
+
* Whether a model request from `env` is answered here: allowed here for the signed-in account, not being removed,
|
|
485
|
+
* and on that account's list. Which of its runs are answered is the run store's to say.
|
|
486
|
+
*/
|
|
487
|
+
private modelRelayAnswers;
|
|
488
|
+
/** Whether `subject` started or resumed `runId` on `env` from this computer: recorded, or held in memory after a failed save. */
|
|
489
|
+
private relayRunStartedHere;
|
|
490
|
+
/** Forgets the unsaved runs of `env` (for `subject`, or every account). */
|
|
491
|
+
private forgetUnsavedRuns;
|
|
492
|
+
/**
|
|
493
|
+
* The machines `subject` allowed to use this computer's models: its saved list and any whose save failed, less those
|
|
494
|
+
* removed. Signed out, none.
|
|
495
|
+
*/
|
|
496
|
+
private modelRelayAllowed;
|
|
497
|
+
/** Brings the engine's own links in line with the machines allowed here and on the account's list. */
|
|
498
|
+
private syncModelRelayLinks;
|
|
499
|
+
private reconcileModelRelayLinks;
|
|
500
|
+
/**
|
|
501
|
+
* Drops from `subject`'s entry, and from its recorded runs, the machines no longer on its account's list: those
|
|
502
|
+
* missing from this fresh listing and from one at least a refresh interval earlier. Their links are closed at once by
|
|
503
|
+
* the reconcile; only this forgetting waits. Nothing is written once `stale` says the engine closed or the account changed.
|
|
504
|
+
*/
|
|
505
|
+
private pruneModelRelayList;
|
|
506
|
+
/** Closes the engine's link to a machine that is no longer answered here, and stops its model work. */
|
|
507
|
+
private releaseModelRelayLink;
|
|
508
|
+
private openModelRelayLink;
|
|
509
|
+
private scheduleModelRelayRefresh;
|
|
510
|
+
private stopModelRelayRefresh;
|
|
511
|
+
/** Runs `save` once, MODEL_RELAY_SAVE_RETRY_MS from now; a second failure is logged and left to memory. */
|
|
512
|
+
private retryModelRelaySave;
|
|
312
513
|
private remoteEngineRequest;
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
private
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
514
|
+
/**
|
|
515
|
+
* Records the run a relayed start or resume answered with as this computer's on `env` (from the answer's `runId`),
|
|
516
|
+
* lets a request of it that arrived first be taken now, and allows the machine.
|
|
517
|
+
*/
|
|
518
|
+
private adoptRelayedRun;
|
|
519
|
+
/**
|
|
520
|
+
* `params` of a run.start or run.resume for a machine that takes relayed providers, with `relay` added: this
|
|
521
|
+
* computer's providers by id, model, models, context windows and effort only (never an address, a key or a sign-in),
|
|
522
|
+
* and the graph to run when it is one only this computer has. A start always names its graph, so the machine never
|
|
523
|
+
* falls back to one of its own. Undefined when this computer has no provider to offer: the request then goes as it
|
|
524
|
+
* was, and the machine runs it on its own providers if it has any.
|
|
525
|
+
*/
|
|
526
|
+
private withModelRelay;
|
|
527
|
+
/**
|
|
528
|
+
* A run.setModel for a machine that takes relayed providers: a provider of this computer's may be switched only to a
|
|
529
|
+
* model on its list. A provider id this computer does not have is the machine's own and is left to it.
|
|
530
|
+
*/
|
|
531
|
+
private checkRelayedModel;
|
|
532
|
+
/**
|
|
533
|
+
* Each provider as a relay entry, with the effective window of each listed model resolved here within 5 s in all.
|
|
534
|
+
* A provider's windows are reused for 5 minutes while its address and models stay the same.
|
|
535
|
+
*/
|
|
536
|
+
private relayedProviders;
|
|
537
|
+
/** A graph this computer has, loaded under its membership rules; a graph it may not use fails with their message. */
|
|
538
|
+
private desktopGraph;
|
|
539
|
+
/** The graph a relayed run on `env` ran, from the machine's record of it, when it is one this computer has. */
|
|
540
|
+
private relayedResumeGraph;
|
|
541
|
+
/** `graph` with its portable provider ids bound to `providers`; one that cannot be bound is refused as a local start is. */
|
|
542
|
+
private relayBoundGraph;
|
|
543
|
+
/** Lists `env` among the machines `subject` allowed to use this computer's providers, the first time a relayed run starts there. */
|
|
544
|
+
private allowModelRelay;
|
|
545
|
+
/** Withdraws `env`'s permission to use this computer's providers, for every account that allowed it. */
|
|
546
|
+
private forgetModelRelayEnvironment;
|
|
547
|
+
/**
|
|
548
|
+
* Rewrites `environments.modelRelay`, a list per account; `change` answers undefined when there is nothing to change.
|
|
549
|
+
* The list shape from before accounts were told apart is read as empty and replaced.
|
|
550
|
+
*/
|
|
551
|
+
private changeModelRelayList;
|
|
552
|
+
/**
|
|
553
|
+
* A model.relay call to `env`'s engine `engine`. Without `via` it goes through the engine's own link when that is
|
|
554
|
+
* up, else the window's; with `via` only through that link, since the machine takes a claim's later calls only
|
|
555
|
+
* from the connection that claimed. A link that is gone or down answers cancelled or network.
|
|
556
|
+
*/
|
|
557
|
+
private sendModelRelay;
|
|
322
558
|
private remoteRootsList;
|
|
323
559
|
private remoteProjectsFetch;
|
|
324
560
|
private remoteBrowse;
|
|
@@ -339,13 +575,97 @@ export declare class AppServer {
|
|
|
339
575
|
private emitSessionSkills;
|
|
340
576
|
private updateSessionSkill;
|
|
341
577
|
private emitPullRequest;
|
|
578
|
+
/**
|
|
579
|
+
* The end of the review loop a wait watches: the loop running when the wait started, or the first one switched on
|
|
580
|
+
* while it waits. A loop that had already ended before is never answered again.
|
|
581
|
+
*/
|
|
582
|
+
private watchedLoopEnded;
|
|
583
|
+
/** A wait ended: the marker that held the review loop's round for it goes, unless a newer wait wrote its own. */
|
|
584
|
+
private clearReviewWaiting;
|
|
342
585
|
private awaitReview;
|
|
586
|
+
/**
|
|
587
|
+
* One read of Codex's signals on a waiting session's PR; answers how long until the next read.
|
|
588
|
+
*
|
|
589
|
+
* A sign-off on the head commit ends the wait as approved, unless a review comment is still to be handed
|
|
590
|
+
* over: comments come first. Where Codex shows nothing at all for the head (no eyes, no review, no comment,
|
|
591
|
+
* nobody asked yet), the next read comes after the bump delay, and if that one is as quiet the wait posts
|
|
592
|
+
* "@codex review", once per head and only in a repository Codex is known to review.
|
|
593
|
+
*/
|
|
594
|
+
private reviewWaitFromSignals;
|
|
595
|
+
/**
|
|
596
|
+
* One look at the record for a wait, in whichever engine process it runs: how the PR or the review loop ended, the
|
|
597
|
+
* review loop's next round (taken from the record, so a round another process posted reaches this wait), Auto-fix's
|
|
598
|
+
* comments, and the marker that tells the lease holder this run waits.
|
|
599
|
+
*/
|
|
343
600
|
private reviewWaitFromRecord;
|
|
344
601
|
private recordAutoFixDelivered;
|
|
345
602
|
private emitSessionChanges;
|
|
346
603
|
private attachPullRequest;
|
|
604
|
+
/** How many turns a task's history holds, a running turn included, for the review loop's transcript lines. */
|
|
605
|
+
private sessionTurnCount;
|
|
606
|
+
/** The reviewer's model from `reviewModel`: null clears it, undefined leaves it; a provider this engine lacks is refused. */
|
|
607
|
+
private reviewModelChange;
|
|
608
|
+
/** The Andorra review loop's settings on a record (the switch-on checks were made); the gh-backed settings are not here. */
|
|
609
|
+
private applyReviewSettingsTo;
|
|
610
|
+
/** A graph run's Andorra review nodes: rounds on the session's PR through the review loop (design/specs/andorra-review-loop.md, R12). */
|
|
611
|
+
private reviewNodeService;
|
|
612
|
+
/** R18: not on the Free plan, and not while the plan cannot be read. Read outside the PR record's lock (up to 10 s). */
|
|
613
|
+
private checkReviewPlan;
|
|
614
|
+
/**
|
|
615
|
+
* Why the Andorra review loop cannot be switched on for this PR (design/specs/andorra-review-loop.md, R11, R17), if it
|
|
616
|
+
* cannot: the checks on the record as it is now, under its lock. The plan (R18) is read before the lock.
|
|
617
|
+
*/
|
|
618
|
+
private checkReviewSwitchOn;
|
|
619
|
+
/** After a settings write: a switch-off ends the loop's round and wake; anything else is looked at by the loop. */
|
|
620
|
+
private reviewSettingsApplied;
|
|
621
|
+
/** A PR a task's `gh pr create` opened: with `github.app.reviewNewPullRequests`, its review loop starts on. A refusal is logged. */
|
|
622
|
+
private reviewNewPullRequest;
|
|
623
|
+
/** The PR's GitHub App coverage for the review loop: the event source's, or the lease holder's in another process. */
|
|
624
|
+
private reviewCoverage;
|
|
625
|
+
/** Whether a run of the session is open anywhere, leaving out `except`: the run held in await_review. */
|
|
626
|
+
private sessionBusyForReview;
|
|
347
627
|
private updatePullRequest;
|
|
628
|
+
/** With `agentChecked`, the agent's dismiss: the record is removed only while it is still that open PR. */
|
|
348
629
|
private dismissPullRequest;
|
|
630
|
+
/**
|
|
631
|
+
* The agent's own dismiss (the `pull_request` tool). A merged or closed PR stays on the task, where the
|
|
632
|
+
* sidebar and the PR tab show how the work ended; only the person removes that one. GitHub is asked first,
|
|
633
|
+
* because an agent that has just merged calls this before the watcher has recorded the merge.
|
|
634
|
+
*/
|
|
635
|
+
private dismissPullRequestForAgent;
|
|
636
|
+
private githubError;
|
|
637
|
+
/**
|
|
638
|
+
* Settings → GitHub: the account's GitHub connection and installations from the account API, whether this
|
|
639
|
+
* engine is in event mode, and each watched PR's coverage. `not-covered` for a PR this engine reads through
|
|
640
|
+
* gh becomes `not-installed`, with the hint to install the App there: the service never says "not installed".
|
|
641
|
+
*/
|
|
642
|
+
private githubStatus;
|
|
643
|
+
/** Settings → GitHub → "Agent replies on pull requests": `bot` (as the App's bot) or `me` (through gh as the person). Per engine. */
|
|
644
|
+
private githubSetAgentWrites;
|
|
645
|
+
/**
|
|
646
|
+
* Who an agent write on this session's PR goes to first, decided one way for the tool and the Auto-fix prompt:
|
|
647
|
+
* the setting, and the PR's coverage as the event source (or, in another process, the lease holder) last
|
|
648
|
+
* learned it. Events switched off here, or a PR the source has not looked at yet, are not covered.
|
|
649
|
+
*/
|
|
650
|
+
private agentWriteRoute;
|
|
651
|
+
/** The pull_request tool's reply, resolve and comment on the session's tracked PR (design/specs/github-app.md, "Bot replies"). */
|
|
652
|
+
private agentPullRequestWrite;
|
|
653
|
+
/** The App's bot login: `GET /v1/github`'s `bot`, read once (bounded) and kept, or learned from a write's `as`. */
|
|
654
|
+
private githubBotName;
|
|
655
|
+
/** For the Auto-fix prompt: whether this session's replies post as the bot (the tool's own rule), and the bot's name. */
|
|
656
|
+
private autoFixWrites;
|
|
657
|
+
/**
|
|
658
|
+
* For a mention's prompt: who the agent's answer posts as on this session's PR (the pull_request tool's rule),
|
|
659
|
+
* and the bot's login, which also names the mention (`@andorra-code`, `@andorra-code-dev` on staging).
|
|
660
|
+
*/
|
|
661
|
+
private mentionWrites;
|
|
662
|
+
/**
|
|
663
|
+
* Wakes the task for a mention, as Fix with Agent does: into a review wait the agent is in, or as the next
|
|
664
|
+
* turn, shown as "Mentioned on GitHub". Each comment wakes once (`MentionTriggers` keeps the ids).
|
|
665
|
+
*/
|
|
666
|
+
private wakeForMention;
|
|
667
|
+
private githubConnect;
|
|
668
|
+
private githubDisconnect;
|
|
349
669
|
/**
|
|
350
670
|
* The PR tab's read of a task's pull request: branches, author, mergeability, description, commits,
|
|
351
671
|
* checks and reviews, through the account that can read it. Answers come from a short cache (see
|
|
@@ -448,6 +768,12 @@ export declare class AppServer {
|
|
|
448
768
|
private syncPullRequestRecord;
|
|
449
769
|
private cancelAutoFixWake;
|
|
450
770
|
private pullRequestControl;
|
|
771
|
+
/**
|
|
772
|
+
* The Andorra review loop's fixer wake: straight into a run of the session waiting in await_review here (which then holds
|
|
773
|
+
* the round), or as the next turn, routed like Auto-fix's to the node that took the PR.
|
|
774
|
+
*/
|
|
775
|
+
private wakeForReview;
|
|
776
|
+
private cancelReviewWake;
|
|
451
777
|
private wakeForPullRequest;
|
|
452
778
|
private emitTimers;
|
|
453
779
|
private settleSessionTimers;
|