@andorra-labs/code 0.1.13 → 0.1.14
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/agent-execution.js +300 -140
- package/dist/src/agent-mcp.js +2 -2
- 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 +100 -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 +52 -0
- package/dist/src/andorra/hosted.js +126 -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 +7 -0
- package/dist/src/andorra/notices.js +15 -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 +68 -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 +6 -2
- package/dist/src/app-server/protocol.js +1 -1
- package/dist/src/app-server.d.ts +27 -0
- package/dist/src/app-server.js +292 -85
- package/dist/src/auth/AuthManager.d.ts +9 -0
- package/dist/src/auth/AuthManager.js +161 -21
- 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-runner.js +1 -1
- 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 +65 -0
- package/dist/src/browser-view.js +229 -16
- package/dist/src/cli.js +43 -26
- package/dist/src/command-screens.d.ts +17 -1
- package/dist/src/command-screens.js +192 -21
- package/dist/src/commands.d.ts +7 -1
- package/dist/src/commands.js +78 -27
- package/dist/src/config.d.ts +6 -1
- package/dist/src/config.js +86 -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/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 +159 -5
- package/dist/src/graph-runner.js +27 -0
- package/dist/src/graph-selection.js +2 -1
- package/dist/src/graph-ui/app.js +25 -2
- 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/graphs.js +1 -3
- package/dist/src/hardened-runtime.js +1 -1
- package/dist/src/membership-errors.js +1 -1
- package/dist/src/membership.d.ts +10 -2
- package/dist/src/membership.js +20 -6
- 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 +40 -3
- 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 +15 -0
- package/dist/src/provider-settings.d.ts +16 -1
- package/dist/src/provider-settings.js +36 -20
- package/dist/src/providers.d.ts +14 -2
- package/dist/src/providers.js +69 -11
- package/dist/src/react-runtime.js +12 -7
- package/dist/src/remote/engine-pool.js +5 -4
- package/dist/src/run-control.d.ts +2 -2
- package/dist/src/run-control.js +9 -6
- package/dist/src/runtime.d.ts +2 -0
- package/dist/src/runtime.js +2 -1
- package/dist/src/sessions.d.ts +1 -0
- package/dist/src/sessions.js +4 -2
- package/dist/src/skills/bundled/graph-manager/errors.md +1 -1
- package/dist/src/skills/bundled/provenance.json +738 -738
- 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/terminal-ui.d.ts +21 -0
- package/dist/src/terminal-ui.js +73 -10
- package/dist/src/transcript.js +3 -0
- package/dist/src/types.d.ts +3 -0
- package/dist/src/workspace-instructions.js +1 -1
- package/package.json +12 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { readFile, rename, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { type HostedAnswer } from './hosted.js';
|
|
3
|
+
export type HostedSurface = 'tui' | 'desktop';
|
|
4
|
+
export interface SurfaceState {
|
|
5
|
+
announced?: string;
|
|
6
|
+
available?: boolean;
|
|
7
|
+
models?: string[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* What the user decided about the Andorra provider on this installation. Absent: nothing yet, so nothing is
|
|
11
|
+
* created. `wanted`: they added it, so it is kept current and comes back if a stale save drops it.
|
|
12
|
+
* `removed`: they removed it, so nothing is created and no message is shown until they add it again.
|
|
13
|
+
*/
|
|
14
|
+
export type AndorraEntryState = 'wanted' | 'removed';
|
|
15
|
+
export interface HostedState {
|
|
16
|
+
answer?: HostedAnswer;
|
|
17
|
+
entry?: AndorraEntryState;
|
|
18
|
+
surfaces: Partial<Record<HostedSurface, SurfaceState>>;
|
|
19
|
+
}
|
|
20
|
+
/** The file calls the state goes through; tests replace one to stand in for a failing disk or another process. */
|
|
21
|
+
export declare const stateFs: {
|
|
22
|
+
readFile: typeof readFile;
|
|
23
|
+
writeFile: typeof writeFile;
|
|
24
|
+
rename: typeof rename;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Reads the state; unknown keys (the `entryRemoved` flag of builds before the opt-in rule among them) are dropped.
|
|
28
|
+
* A file that is not there, or whose content cannot be parsed, is an empty state. Any other read error (a file
|
|
29
|
+
* busy for a moment while another process renames over it, say) is thrown: an empty state built on it would be
|
|
30
|
+
* written back over the user's decision.
|
|
31
|
+
*/
|
|
32
|
+
export declare function readHostedState(home?: string): Promise<HostedState>;
|
|
33
|
+
/** How long an update waits for the lock before it gives the round up; tests shorten it. */
|
|
34
|
+
export declare const stateLock: {
|
|
35
|
+
timeoutMs: number;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* The one way the state file is changed. Under the cross-process lock (see `locked`) it reads the file fresh, hands
|
|
39
|
+
* it to `mutate`, and writes what `mutate` returns through a temporary file and a rename; `mutate` returns
|
|
40
|
+
* undefined to leave the file as it is. Because the whole read-modify-write is inside the lock, a decision another
|
|
41
|
+
* process records can never fall between this writer's read and its write.
|
|
42
|
+
*
|
|
43
|
+
* Resolves the state as it now is, or undefined when the lock could not be had in time: the round's write is
|
|
44
|
+
* skipped, never waited on forever. Rejects when the file cannot be read (other than "not there" or unparseable)
|
|
45
|
+
* or written; nothing is written over then.
|
|
46
|
+
*/
|
|
47
|
+
export declare function updateHostedState(home: string, mutate: (current: HostedState) => HostedState | undefined): Promise<HostedState | undefined>;
|
|
48
|
+
/**
|
|
49
|
+
* Records what the user decided: `removed` when they remove the Andorra provider, `wanted` after they added it
|
|
50
|
+
* (undefined puts back "nothing decided"). True when it was recorded.
|
|
51
|
+
* Never throws: when the state cannot be written the earlier decision stands, and the next add or removal records again.
|
|
52
|
+
*/
|
|
53
|
+
export declare function recordAndorraEntry(entry: AndorraEntryState | undefined, home?: string): Promise<boolean>;
|
|
54
|
+
/**
|
|
55
|
+
* Records the removal before the config without the entry is saved, runs `save`, and puts the earlier decision
|
|
56
|
+
* back when the save fails. In that order a check in another process can never read `wanted` after the entry is
|
|
57
|
+
* gone and create it again; `removed` while the entry still exists only means it is kept current. When the
|
|
58
|
+
* removal cannot be recorded the config is not saved at all: an entry removed with `wanted` still on record would
|
|
59
|
+
* be created again by the next check.
|
|
60
|
+
*/
|
|
61
|
+
/** Said when a removal could not be recorded, so nothing was removed. */
|
|
62
|
+
export declare const ANDORRA_REMOVE_FAILED = "The Andorra provider could not be removed right now. Try again.";
|
|
63
|
+
export declare function removingAndorraEntry<T>(home: string, save: () => Promise<T>): Promise<T>;
|
|
64
|
+
/**
|
|
65
|
+
* Records that the user removed the Andorra provider: nothing creates or lists it again until they add it.
|
|
66
|
+
* False when it could not be recorded (the state write failed or its lock timed out): the earlier decision stands
|
|
67
|
+
* and the caller must tell the user nothing was removed. Never throws.
|
|
68
|
+
*/
|
|
69
|
+
export declare function recordAndorraRemoved(home?: string): Promise<boolean>;
|
|
70
|
+
/**
|
|
71
|
+
* What one client surface should say about a new answer, and what it has now seen. `entry` is the user's decision:
|
|
72
|
+
* a removed provider is silent, and the turned-off notice is only for someone who added the provider. The surface
|
|
73
|
+
* is advanced in every case, so nothing replays later.
|
|
74
|
+
*/
|
|
75
|
+
export declare function advanceSurface(surface: SurfaceState | undefined, answer: HostedAnswer, entry?: AndorraEntryState): {
|
|
76
|
+
surface: SurfaceState;
|
|
77
|
+
announce: boolean;
|
|
78
|
+
notice: boolean;
|
|
79
|
+
};
|
|
80
|
+
export type AndorraAvailability = {
|
|
81
|
+
available: true;
|
|
82
|
+
} | {
|
|
83
|
+
available: false;
|
|
84
|
+
message: string;
|
|
85
|
+
};
|
|
86
|
+
export declare function andorraAvailability(answer: HostedAnswer | undefined, signedIn: boolean): AndorraAvailability;
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { mkdir, readFile, rename, rm, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { configDirectory } from '../config.js';
|
|
5
|
+
import { ANDORRA_SIGN_IN_MESSAGE, ANDORRA_UNAVAILABLE_MESSAGE } from './endpoint.js';
|
|
6
|
+
import { parseHostedAnswer } from './hosted.js';
|
|
7
|
+
import { acquireSaveLock, SaveLockBusyError } from '../save-lock.js';
|
|
8
|
+
const SURFACES = ['tui', 'desktop'];
|
|
9
|
+
const statePath = (home) => join(home, 'andorra-hosted.json');
|
|
10
|
+
/**
|
|
11
|
+
* The answer as the state file keeps it: without the allowance and the availability, which are only ever
|
|
12
|
+
* shown from a check made in the running process, never from an earlier run's answer.
|
|
13
|
+
*/
|
|
14
|
+
function storedAnswer(answer) {
|
|
15
|
+
const stored = { ...answer };
|
|
16
|
+
delete stored.allowance;
|
|
17
|
+
delete stored.available;
|
|
18
|
+
return stored;
|
|
19
|
+
}
|
|
20
|
+
function readSurface(value) {
|
|
21
|
+
const surface = {};
|
|
22
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
23
|
+
return surface;
|
|
24
|
+
const record = value;
|
|
25
|
+
if (typeof record.announced === 'string')
|
|
26
|
+
surface.announced = record.announced;
|
|
27
|
+
if (typeof record.available === 'boolean')
|
|
28
|
+
surface.available = record.available;
|
|
29
|
+
if (Array.isArray(record.models) && record.models.every(m => typeof m === 'string'))
|
|
30
|
+
surface.models = [...record.models];
|
|
31
|
+
return surface;
|
|
32
|
+
}
|
|
33
|
+
/** The file calls the state goes through; tests replace one to stand in for a failing disk or another process. */
|
|
34
|
+
export const stateFs = { readFile, writeFile, rename };
|
|
35
|
+
/**
|
|
36
|
+
* Reads the state; unknown keys (the `entryRemoved` flag of builds before the opt-in rule among them) are dropped.
|
|
37
|
+
* A file that is not there, or whose content cannot be parsed, is an empty state. Any other read error (a file
|
|
38
|
+
* busy for a moment while another process renames over it, say) is thrown: an empty state built on it would be
|
|
39
|
+
* written back over the user's decision.
|
|
40
|
+
*/
|
|
41
|
+
export async function readHostedState(home = configDirectory()) {
|
|
42
|
+
const state = { surfaces: {} };
|
|
43
|
+
let text;
|
|
44
|
+
try {
|
|
45
|
+
text = await stateFs.readFile(statePath(home), 'utf8');
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
if (error?.code === 'ENOENT')
|
|
49
|
+
return state;
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
const value = JSON.parse(text);
|
|
54
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
55
|
+
return state;
|
|
56
|
+
const record = value;
|
|
57
|
+
const answer = parseHostedAnswer(record.answer);
|
|
58
|
+
if (answer)
|
|
59
|
+
state.answer = storedAnswer(answer);
|
|
60
|
+
if (record.entry === 'wanted' || record.entry === 'removed')
|
|
61
|
+
state.entry = record.entry;
|
|
62
|
+
const surfaces = record.surfaces;
|
|
63
|
+
if (surfaces && typeof surfaces === 'object' && !Array.isArray(surfaces)) {
|
|
64
|
+
for (const name of SURFACES) {
|
|
65
|
+
const entry = surfaces[name];
|
|
66
|
+
if (entry !== undefined)
|
|
67
|
+
state.surfaces[name] = readSurface(entry);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return state;
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
return { surfaces: {} };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const queues = new Map();
|
|
77
|
+
/** One state write at a time per file in this process: on Windows two renames onto one file at once fail. */
|
|
78
|
+
function queued(home, body) {
|
|
79
|
+
const key = statePath(home);
|
|
80
|
+
const run = (queues.get(key) ?? Promise.resolve()).then(body, body);
|
|
81
|
+
const tail = run.then(() => undefined, () => undefined);
|
|
82
|
+
queues.set(key, tail);
|
|
83
|
+
void tail.then(() => { if (queues.get(key) === tail)
|
|
84
|
+
queues.delete(key); });
|
|
85
|
+
return run;
|
|
86
|
+
}
|
|
87
|
+
async function writeNow(state, home) {
|
|
88
|
+
await mkdir(home, { recursive: true });
|
|
89
|
+
const target = statePath(home);
|
|
90
|
+
// A name of its own per write: two writers, in one process or two, never share a temporary file.
|
|
91
|
+
const temporary = `${target}.${randomUUID()}.tmp`;
|
|
92
|
+
const stored = state.answer ? { ...state, answer: storedAnswer(state.answer) } : state;
|
|
93
|
+
try {
|
|
94
|
+
await stateFs.writeFile(temporary, JSON.stringify(stored) + '\n', 'utf8');
|
|
95
|
+
await stateFs.rename(temporary, target);
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
await rm(temporary, { force: true }).catch(() => { });
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/** How long an update waits for the lock before it gives the round up; tests shorten it. */
|
|
103
|
+
export const stateLock = { timeoutMs: 2_000 };
|
|
104
|
+
/**
|
|
105
|
+
* Runs `body` holding the home's save lock (`src/save-lock.ts`), the same cross-process lock every write of
|
|
106
|
+
* `config.json` takes. It recovers a lock left by a process that died the way that lock always does. Waiting is
|
|
107
|
+
* bounded: when the lock is still held after `stateLock.timeoutMs`, undefined is returned and `body` never ran.
|
|
108
|
+
*
|
|
109
|
+
* Lock rule: the lock is not reentrant, so it is never taken twice at once. Code that holds it for a config write
|
|
110
|
+
* (`changeConfigFile`, `saveConfig`) may READ the state file there (`andorraEntryMode` in its `prepare` step) but must
|
|
111
|
+
* not update it; a state update and a config write that belong together run one after the other, each taking and
|
|
112
|
+
* releasing the lock: a removal records the decision, then saves the config; an add records the decision, then saves
|
|
113
|
+
* the config (every config write reads the decision under the lock and drops an entry the user removed). With one lock and no nesting, two processes cannot wait on each other.
|
|
114
|
+
*/
|
|
115
|
+
async function locked(home, body) {
|
|
116
|
+
const deadline = Date.now() + stateLock.timeoutMs;
|
|
117
|
+
for (let attempt = 0;; attempt++) {
|
|
118
|
+
let release;
|
|
119
|
+
try {
|
|
120
|
+
release = await acquireSaveLock(home);
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
if (!(error instanceof SaveLockBusyError))
|
|
124
|
+
throw error;
|
|
125
|
+
const wait = Math.min(25 * (attempt + 1), 150);
|
|
126
|
+
if (Date.now() + wait > deadline)
|
|
127
|
+
return undefined;
|
|
128
|
+
await new Promise(resolve => setTimeout(resolve, wait));
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
try {
|
|
132
|
+
return await body();
|
|
133
|
+
}
|
|
134
|
+
finally {
|
|
135
|
+
await release().catch(() => { });
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* The one way the state file is changed. Under the cross-process lock (see `locked`) it reads the file fresh, hands
|
|
141
|
+
* it to `mutate`, and writes what `mutate` returns through a temporary file and a rename; `mutate` returns
|
|
142
|
+
* undefined to leave the file as it is. Because the whole read-modify-write is inside the lock, a decision another
|
|
143
|
+
* process records can never fall between this writer's read and its write.
|
|
144
|
+
*
|
|
145
|
+
* Resolves the state as it now is, or undefined when the lock could not be had in time: the round's write is
|
|
146
|
+
* skipped, never waited on forever. Rejects when the file cannot be read (other than "not there" or unparseable)
|
|
147
|
+
* or written; nothing is written over then.
|
|
148
|
+
*/
|
|
149
|
+
export function updateHostedState(home, mutate) {
|
|
150
|
+
return queued(home, () => locked(home, async () => {
|
|
151
|
+
const current = await readHostedState(home);
|
|
152
|
+
const next = mutate(current);
|
|
153
|
+
if (next === undefined)
|
|
154
|
+
return current;
|
|
155
|
+
await writeNow(next, home);
|
|
156
|
+
return next;
|
|
157
|
+
}));
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Records what the user decided: `removed` when they remove the Andorra provider, `wanted` after they added it
|
|
161
|
+
* (undefined puts back "nothing decided"). True when it was recorded.
|
|
162
|
+
* Never throws: when the state cannot be written the earlier decision stands, and the next add or removal records again.
|
|
163
|
+
*/
|
|
164
|
+
export async function recordAndorraEntry(entry, home = configDirectory()) {
|
|
165
|
+
try {
|
|
166
|
+
return await updateHostedState(home, state => { if (entry === undefined)
|
|
167
|
+
delete state.entry;
|
|
168
|
+
else
|
|
169
|
+
state.entry = entry; return state; }) !== undefined;
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Records the removal before the config without the entry is saved, runs `save`, and puts the earlier decision
|
|
177
|
+
* back when the save fails. In that order a check in another process can never read `wanted` after the entry is
|
|
178
|
+
* gone and create it again; `removed` while the entry still exists only means it is kept current. When the
|
|
179
|
+
* removal cannot be recorded the config is not saved at all: an entry removed with `wanted` still on record would
|
|
180
|
+
* be created again by the next check.
|
|
181
|
+
*/
|
|
182
|
+
/** Said when a removal could not be recorded, so nothing was removed. */
|
|
183
|
+
export const ANDORRA_REMOVE_FAILED = 'The Andorra provider could not be removed right now. Try again.';
|
|
184
|
+
export async function removingAndorraEntry(home, save) {
|
|
185
|
+
let previous;
|
|
186
|
+
let known = true;
|
|
187
|
+
try {
|
|
188
|
+
previous = (await readHostedState(home)).entry;
|
|
189
|
+
}
|
|
190
|
+
catch {
|
|
191
|
+
known = false;
|
|
192
|
+
}
|
|
193
|
+
if (!await recordAndorraEntry('removed', home))
|
|
194
|
+
throw new Error(ANDORRA_REMOVE_FAILED);
|
|
195
|
+
try {
|
|
196
|
+
return await save();
|
|
197
|
+
}
|
|
198
|
+
catch (error) {
|
|
199
|
+
// Putting the earlier decision back can fail too. `removed` then stays on record beside the entry, and the
|
|
200
|
+
// next config write drops the entry: what the user asked for, later. It is never created again meanwhile.
|
|
201
|
+
if (known)
|
|
202
|
+
await recordAndorraEntry(previous, home);
|
|
203
|
+
throw error;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Records that the user removed the Andorra provider: nothing creates or lists it again until they add it.
|
|
208
|
+
* False when it could not be recorded (the state write failed or its lock timed out): the earlier decision stands
|
|
209
|
+
* and the caller must tell the user nothing was removed. Never throws.
|
|
210
|
+
*/
|
|
211
|
+
export function recordAndorraRemoved(home = configDirectory()) {
|
|
212
|
+
return recordAndorraEntry('removed', home);
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* What one client surface should say about a new answer, and what it has now seen. `entry` is the user's decision:
|
|
216
|
+
* a removed provider is silent, and the turned-off notice is only for someone who added the provider. The surface
|
|
217
|
+
* is advanced in every case, so nothing replays later.
|
|
218
|
+
*/
|
|
219
|
+
export function advanceSurface(surface, answer, entry) {
|
|
220
|
+
const ids = answer.enabled ? answer.models.map(m => m.id) : [];
|
|
221
|
+
const fresh = answer.enabled && !!answer.promotionId && answer.promotionId !== surface?.announced;
|
|
222
|
+
const lostModel = (surface?.models ?? []).some(id => !ids.includes(id));
|
|
223
|
+
const changed = surface?.available === true && (!answer.enabled || lostModel);
|
|
224
|
+
const next = {};
|
|
225
|
+
const announced = fresh ? answer.promotionId : surface?.announced;
|
|
226
|
+
if (announced !== undefined)
|
|
227
|
+
next.announced = announced;
|
|
228
|
+
next.available = answer.enabled;
|
|
229
|
+
next.models = ids;
|
|
230
|
+
return { surface: next, announce: fresh && entry !== 'removed', notice: changed && entry === 'wanted' };
|
|
231
|
+
}
|
|
232
|
+
export function andorraAvailability(answer, signedIn) {
|
|
233
|
+
if (!signedIn)
|
|
234
|
+
return { available: false, message: ANDORRA_SIGN_IN_MESSAGE };
|
|
235
|
+
if (!answer?.enabled)
|
|
236
|
+
return { available: false, message: ANDORRA_UNAVAILABLE_MESSAGE };
|
|
237
|
+
return { available: true };
|
|
238
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type Config } from '../config.js';
|
|
2
|
+
import type { ProviderConfig } from '../providers.js';
|
|
3
|
+
import type { HostedModel } from './hosted.js';
|
|
4
|
+
import { HostedMonitor, type HostedMonitorOptions, type HostedUsage } from './monitor.js';
|
|
5
|
+
import { type AddAndorraResult } from './opt-in.js';
|
|
6
|
+
import { type AndorraAvailability } from './state.js';
|
|
7
|
+
/** What the terminal app's commands and screens can ask about Andorra. */
|
|
8
|
+
export interface TerminalAndorraHooks {
|
|
9
|
+
availability(): AndorraAvailability;
|
|
10
|
+
/** What to show for the hosted models (HostedMonitor.usage); undefined = nothing to show. */
|
|
11
|
+
usage?(): HostedUsage | undefined;
|
|
12
|
+
/** What a run about to start may rely on without a model request (see HostedMonitor.gate); undefined = not known. */
|
|
13
|
+
gate?(): Promise<AndorraAvailability | undefined>;
|
|
14
|
+
/** The provider list opened: runs the throttled check, waiting for a slow one at most 1.5 s. */
|
|
15
|
+
opened(): Promise<void>;
|
|
16
|
+
/** The hosted models while Andorra can be added (on for this account, no entry yet); undefined otherwise. */
|
|
17
|
+
offer?(): HostedModel[] | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The entry to list while Andorra is offered, not saved yet and not removed by the user: shown as an ordinary
|
|
20
|
+
* provider, first. It is not in the config; `add()` saves it the first time the user picks it.
|
|
21
|
+
*/
|
|
22
|
+
listed?(): ProviderConfig | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* The user removed the listed, never-saved Andorra: it is no longer listed (Add provider still offers it).
|
|
25
|
+
* False when the removal could not be recorded: it stays listed and the caller says so.
|
|
26
|
+
*/
|
|
27
|
+
hide?(): Promise<boolean>;
|
|
28
|
+
/** Adds Andorra because the user chose it; `model` is the model they picked, checked against the saved entry. */
|
|
29
|
+
add?(model?: string): Promise<AddAndorraResult>;
|
|
30
|
+
/** The entry was added or removed by a screen: the offer follows. */
|
|
31
|
+
entryChanged?(): Promise<void>;
|
|
32
|
+
/** The user signed in or out: ask again now. */
|
|
33
|
+
accountChanged?(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Calls `listener` after every check has settled and after the entry was added or removed; returns the way to stop.
|
|
36
|
+
* An open provider list uses it to redraw itself when the offer or an unavailable mark changed under it.
|
|
37
|
+
*/
|
|
38
|
+
subscribe?(listener: () => void): () => void;
|
|
39
|
+
}
|
|
40
|
+
/** The ids of the providers that serve Andorra's hosted models: the footer shows the usage while one of them is in play. */
|
|
41
|
+
export declare function andorraProviderIds(providers: readonly Pick<ProviderConfig, 'id' | 'type'>[]): string[];
|
|
42
|
+
/**
|
|
43
|
+
* Copies the saved Andorra entry, or its absence, into a client's in-memory config and leaves every other field
|
|
44
|
+
* as the client holds it. The selection moves only when it has to: onto Andorra for a config that had no
|
|
45
|
+
* providers, and off it when the entry is gone.
|
|
46
|
+
*/
|
|
47
|
+
export declare function adoptAndorraEntry(memory: Config, saved: Config): void;
|
|
48
|
+
/**
|
|
49
|
+
* Before the terminal saves its in-memory config: an Andorra entry it still holds after the user removed the
|
|
50
|
+
* provider elsewhere (the desktop app, say) is dropped, so the save does not bring it back. True when it dropped one.
|
|
51
|
+
*/
|
|
52
|
+
export declare function dropRemovedAndorraEntry(config: Config, home: string): Promise<boolean>;
|
|
53
|
+
export interface TerminalAndorraOptions {
|
|
54
|
+
/** The terminal's in-memory config; only its Andorra entry (and the selection, when it must move) is updated. */
|
|
55
|
+
config: Config;
|
|
56
|
+
directory: string;
|
|
57
|
+
print(text: string): void;
|
|
58
|
+
/** Called after the in-memory config or the hosted usage changed, to redraw what shows it. */
|
|
59
|
+
refreshStatus(): void;
|
|
60
|
+
check?: HostedMonitorOptions['check'];
|
|
61
|
+
now?: HostedMonitorOptions['now'];
|
|
62
|
+
timers?: HostedMonitorOptions['timers'];
|
|
63
|
+
}
|
|
64
|
+
/** The terminal app's Andorra monitor and the hooks its screens use. */
|
|
65
|
+
export declare function createTerminalAndorra(options: TerminalAndorraOptions): {
|
|
66
|
+
monitor: HostedMonitor;
|
|
67
|
+
hooks: TerminalAndorraHooks;
|
|
68
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { changeConfigFile, loadConfig, reconcileSubagentPair } from '../config.js';
|
|
2
|
+
import { ANDORRA_CHANGED_MESSAGE } from './endpoint.js';
|
|
3
|
+
import { fallbackProviderId, hasAndorraEntry, virtualAndorraEntry } from './entry.js';
|
|
4
|
+
import { HostedMonitor } from './monitor.js';
|
|
5
|
+
import { ANDORRA_ADD_HINT, ANDORRA_ANNOUNCEMENT, speechBubble } from './notices.js';
|
|
6
|
+
import { addAndorraEntry, saveAndorraAnswer } from './opt-in.js';
|
|
7
|
+
import { readHostedState, recordAndorraRemoved } from './state.js';
|
|
8
|
+
/** The ids of the providers that serve Andorra's hosted models: the footer shows the usage while one of them is in play. */
|
|
9
|
+
export function andorraProviderIds(providers) {
|
|
10
|
+
return providers.filter(provider => provider.type === 'andorra').map(provider => provider.id);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Copies the saved Andorra entry, or its absence, into a client's in-memory config and leaves every other field
|
|
14
|
+
* as the client holds it. The selection moves only when it has to: onto Andorra for a config that had no
|
|
15
|
+
* providers, and off it when the entry is gone.
|
|
16
|
+
*/
|
|
17
|
+
export function adoptAndorraEntry(memory, saved) {
|
|
18
|
+
copyAndorraEntry(memory, saved);
|
|
19
|
+
// The external subagent pair may name a model or an entry that just went: clear it here as the saved config did.
|
|
20
|
+
if (reconcileSubagentPair(memory).externalSubagent === undefined)
|
|
21
|
+
delete memory.externalSubagent;
|
|
22
|
+
}
|
|
23
|
+
function copyAndorraEntry(memory, saved) {
|
|
24
|
+
const entry = saved.providers.find(provider => provider.type === 'andorra');
|
|
25
|
+
const index = memory.providers.findIndex(provider => provider.type === 'andorra');
|
|
26
|
+
if (!entry) {
|
|
27
|
+
if (index < 0)
|
|
28
|
+
return;
|
|
29
|
+
const [dropped] = memory.providers.splice(index, 1);
|
|
30
|
+
if (memory.provider === dropped.id)
|
|
31
|
+
memory.provider = fallbackProviderId(memory.providers);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const copy = structuredClone(entry);
|
|
35
|
+
if (index >= 0) {
|
|
36
|
+
const previous = memory.providers[index];
|
|
37
|
+
memory.providers[index] = copy;
|
|
38
|
+
if (memory.provider === previous.id)
|
|
39
|
+
memory.provider = copy.id;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const empty = memory.providers.length === 0;
|
|
43
|
+
memory.providers.unshift(copy);
|
|
44
|
+
if (empty)
|
|
45
|
+
memory.provider = copy.id;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Before the terminal saves its in-memory config: an Andorra entry it still holds after the user removed the
|
|
49
|
+
* provider elsewhere (the desktop app, say) is dropped, so the save does not bring it back. True when it dropped one.
|
|
50
|
+
*/
|
|
51
|
+
export async function dropRemovedAndorraEntry(config, home) {
|
|
52
|
+
if (!hasAndorraEntry(config) || (await readHostedState(home)).entry !== 'removed')
|
|
53
|
+
return false;
|
|
54
|
+
adoptAndorraEntry(config, { ...config, providers: [] });
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
/** The terminal app's Andorra monitor and the hooks its screens use. */
|
|
58
|
+
export function createTerminalAndorra(options) {
|
|
59
|
+
const { config, directory } = options;
|
|
60
|
+
// Every write goes against the file as it is now, never the config this process loaded at startup: a
|
|
61
|
+
// change another client saved meanwhile stays.
|
|
62
|
+
const change = async (update) => {
|
|
63
|
+
let wrote = false;
|
|
64
|
+
const saved = await changeConfigFile(directory, current => {
|
|
65
|
+
const next = update(current);
|
|
66
|
+
wrote = next !== undefined;
|
|
67
|
+
return next ?? current;
|
|
68
|
+
});
|
|
69
|
+
if (!wrote)
|
|
70
|
+
return;
|
|
71
|
+
adoptAndorraEntry(config, saved);
|
|
72
|
+
options.refreshStatus();
|
|
73
|
+
};
|
|
74
|
+
const listeners = new Set();
|
|
75
|
+
const monitor = new HostedMonitor({
|
|
76
|
+
surface: 'tui', home: directory,
|
|
77
|
+
...(options.check === undefined ? {} : { check: options.check }),
|
|
78
|
+
...(options.now === undefined ? {} : { now: options.now }),
|
|
79
|
+
...(options.timers === undefined ? {} : { timers: options.timers }),
|
|
80
|
+
applyEntry: async (answer) => {
|
|
81
|
+
// Written or not, take the entry as the file has it, so one another client added or removed shows here.
|
|
82
|
+
const saved = await saveAndorraAnswer(directory, answer) ?? await loadConfig(directory);
|
|
83
|
+
const before = JSON.stringify([config.providers.find(provider => provider.type === 'andorra'), config.provider]);
|
|
84
|
+
adoptAndorraEntry(config, saved);
|
|
85
|
+
if (JSON.stringify([config.providers.find(provider => provider.type === 'andorra'), config.provider]) !== before)
|
|
86
|
+
options.refreshStatus();
|
|
87
|
+
},
|
|
88
|
+
hasEntry: () => hasAndorraEntry(config),
|
|
89
|
+
// The hint says where to choose it, while it is listed and not yet used.
|
|
90
|
+
onAnnounce: () => options.print(monitor.listed() ? speechBubble(ANDORRA_ANNOUNCEMENT, ANDORRA_ADD_HINT) : speechBubble(ANDORRA_ANNOUNCEMENT)),
|
|
91
|
+
onNotice: () => options.print(ANDORRA_CHANGED_MESSAGE),
|
|
92
|
+
onChange: () => options.refreshStatus(),
|
|
93
|
+
onSettled: () => { for (const listener of [...listeners]) {
|
|
94
|
+
try {
|
|
95
|
+
listener();
|
|
96
|
+
}
|
|
97
|
+
catch { /* a screen's listener never breaks the monitor */ }
|
|
98
|
+
} },
|
|
99
|
+
});
|
|
100
|
+
const hooks = {
|
|
101
|
+
availability: () => monitor.availability(),
|
|
102
|
+
usage: () => monitor.usage(),
|
|
103
|
+
gate: () => monitor.gate(),
|
|
104
|
+
// The provider list waits for a slow check at most 1.5 s, then shows the last answer.
|
|
105
|
+
opened: () => Promise.race([monitor.check('open').then(() => { }), new Promise(resolve => setTimeout(resolve, 1500).unref())]),
|
|
106
|
+
offer: () => monitor.offer(),
|
|
107
|
+
listed: () => { const answer = monitor.listed() ? monitor.enabledAnswer() : undefined; return answer ? virtualAndorraEntry(config, answer) : undefined; },
|
|
108
|
+
hide: async () => {
|
|
109
|
+
// Not recorded: it stays listed, and the screen says nothing was removed.
|
|
110
|
+
if (!await recordAndorraRemoved(directory))
|
|
111
|
+
return false;
|
|
112
|
+
await monitor.entryChanged();
|
|
113
|
+
return true;
|
|
114
|
+
},
|
|
115
|
+
add: async (model) => {
|
|
116
|
+
const result = await addAndorraEntry({ home: directory, monitor, change, ...(model === undefined ? {} : { model }) });
|
|
117
|
+
await monitor.entryChanged();
|
|
118
|
+
return result;
|
|
119
|
+
},
|
|
120
|
+
entryChanged: () => monitor.entryChanged(),
|
|
121
|
+
accountChanged: () => { void monitor.check('account'); },
|
|
122
|
+
subscribe: listener => { listeners.add(listener); return () => { listeners.delete(listener); }; },
|
|
123
|
+
};
|
|
124
|
+
return { monitor, hooks };
|
|
125
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** How full the weekly allowance reads: `warn` from 80 percent used, `full` at 100. */
|
|
2
|
+
export type UsageTone = 'ok' | 'warn' | 'full';
|
|
3
|
+
export declare function usageTone(usedPercent: number): UsageTone;
|
|
4
|
+
/**
|
|
5
|
+
* The last minute of the allowance week in the local time zone (or `timeZone`), such as `Sun 11:59 PM`: the
|
|
6
|
+
* router's reset instant is the first minute of the next week, so one minute before it is the week's last.
|
|
7
|
+
* An instant that cannot be read gives an empty string.
|
|
8
|
+
*/
|
|
9
|
+
export declare function formatWeekReset(resetsAt: string, timeZone?: string): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function usageTone(usedPercent) {
|
|
2
|
+
return usedPercent >= 100 ? 'full' : usedPercent >= 80 ? 'warn' : 'ok';
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* The last minute of the allowance week in the local time zone (or `timeZone`), such as `Sun 11:59 PM`: the
|
|
6
|
+
* router's reset instant is the first minute of the next week, so one minute before it is the week's last.
|
|
7
|
+
* An instant that cannot be read gives an empty string.
|
|
8
|
+
*/
|
|
9
|
+
export function formatWeekReset(resetsAt, timeZone) {
|
|
10
|
+
const at = Date.parse(resetsAt);
|
|
11
|
+
if (!Number.isFinite(at))
|
|
12
|
+
return '';
|
|
13
|
+
const parts = new Intl.DateTimeFormat('en-US', { weekday: 'short', hour: 'numeric', minute: '2-digit', ...(timeZone === undefined ? {} : { timeZone }) })
|
|
14
|
+
.formatToParts(new Date(at - 60_000));
|
|
15
|
+
const weekday = parts.find(part => part.type === 'weekday')?.value ?? '';
|
|
16
|
+
// From the hour on, so the separator after the weekday is not kept; some ICU builds put a narrow space before AM/PM.
|
|
17
|
+
const time = parts.slice(parts.findIndex(part => part.type === 'hour')).map(part => part.value).join('').replace(/\s+/gu, ' ').trim();
|
|
18
|
+
return `${weekday} ${time}`;
|
|
19
|
+
}
|
|
@@ -2,7 +2,8 @@ import { readFile } from 'node:fs/promises';
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { resolveCredentialsFromConfig } from '@anthropic-ai/sdk/lib/credentials';
|
|
4
4
|
import { configDirectory } from './config.js';
|
|
5
|
-
import { resolveProviderApiKey } from './providers.js';
|
|
5
|
+
import { assertProviderCredentials, resolveProviderApiKey } from './providers.js';
|
|
6
|
+
import { andorraAccessToken, ANDORRA_SIGN_IN_MESSAGE } from './andorra/endpoint.js';
|
|
6
7
|
export const ANTHROPIC_CONSOLE_BASE_URL = 'https://api.anthropic.com/v1';
|
|
7
8
|
const OAUTH_BETA = 'oauth-2025-04-20';
|
|
8
9
|
const PROFILE = 'default';
|
|
@@ -39,6 +40,13 @@ export function signInRequired(providerId) {
|
|
|
39
40
|
}
|
|
40
41
|
const REFRESH_FAILED = 'Your Claude Console sign-in expired or could not be refreshed. Sign in again.';
|
|
41
42
|
export async function providerAuthHeaders(provider, options = {}) {
|
|
43
|
+
if (provider.type === 'andorra') {
|
|
44
|
+
assertProviderCredentials(provider);
|
|
45
|
+
const token = await andorraAccessToken(options.signal);
|
|
46
|
+
if (!token)
|
|
47
|
+
throw new Error(ANDORRA_SIGN_IN_MESSAGE);
|
|
48
|
+
return { authorization: `Bearer ${token}` };
|
|
49
|
+
}
|
|
42
50
|
const anthropic = provider.type === 'anthropic';
|
|
43
51
|
const headers = anthropic ? { 'anthropic-version': '2023-06-01' } : {};
|
|
44
52
|
if (provider.anthropicAuth !== 'console') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const APP_SERVER_PROTOCOL_VERSION = 2;
|
|
2
|
-
export declare const APP_SERVER_CAPABILITIES: readonly ["run.start.runPermissions", "automations", "providers.models", "providers.test", "providers.test.model", "providers.streamIdleTimeout", "providers.modelContextWindows", "providers.name", "providers.claude", "providers.claudeAuth", "providers.grok", "providers.opencode", "providers.auth.submit", "providers.opencodeGo", "providers.discover.draft", "providers.detectSignIns", "providers.codexAuth", "providers.codexAuth.logout", "providers.codexAccounts", "providers.anthropicConsole", "run.resume.direction", "run.resume.model", "run.steer", "run.overrideAllNodes", "run.setModel", "run.setModel.node", "run.setPermissions", "run.start.continueSession", "run.start.entryHistory", "remote.owner.projects", "remote.workspaces.probe", "remote.engine.relay", "remote.hosting.device.grant", "extensions.manage", "extensions.resources", "skills.invoke", "mcp.manage", "mcp.edit", "mcp.status", "runs.files", "sessions.files", "account.profile", "sessions.stats", "sessions.usage", "config.analytics", "config.analytics.planGate", "sessions.trajectory", "config.externalSubagent", "config.codeIntel", "config.decisions", "browser.view", "attachments.read", "config.general", "sessions.pullRequest", "browser.view.go", "config.browser", "config.webSearch", "background.tasks", "workspace.warm", "browser.cookies.firefox", "browser.extensions", "sessions.compact", "sessions.goal", "sessions.changes", "run.current"];
|
|
2
|
+
export declare const APP_SERVER_CAPABILITIES: readonly ["run.start.runPermissions", "automations", "providers.models", "providers.test", "providers.test.model", "providers.streamIdleTimeout", "providers.modelContextWindows", "providers.name", "providers.claude", "providers.claudeAuth", "providers.grok", "providers.opencode", "providers.auth.submit", "providers.opencodeGo", "providers.discover.draft", "providers.detectSignIns", "providers.codexAuth", "providers.codexAuth.logout", "providers.codexAccounts", "providers.anthropicConsole", "run.resume.direction", "run.resume.model", "run.steer", "run.overrideAllNodes", "run.setModel", "run.setModel.node", "run.setPermissions", "run.start.continueSession", "run.start.entryHistory", "remote.owner.projects", "remote.workspaces.probe", "remote.engine.relay", "remote.hosting.device.grant", "extensions.manage", "extensions.resources", "skills.invoke", "mcp.manage", "mcp.edit", "mcp.status", "runs.files", "sessions.files", "account.profile", "sessions.stats", "sessions.usage", "config.analytics", "config.analytics.planGate", "sessions.trajectory", "config.externalSubagent", "config.codeIntel", "config.decisions", "browser.view", "attachments.read", "config.general", "sessions.pullRequest", "browser.view.go", "config.browser", "config.webSearch", "background.tasks", "workspace.warm", "browser.cookies.firefox", "browser.extensions", "sessions.compact", "sessions.goal", "sessions.changes", "run.current", "sessions.jev", "providers.andorra"];
|
|
3
3
|
export interface AppServerRequest {
|
|
4
4
|
id: number | string;
|
|
5
5
|
method: string;
|
|
@@ -67,12 +67,14 @@ export interface AppServerProviderAuth {
|
|
|
67
67
|
}
|
|
68
68
|
export interface AppServerProvider {
|
|
69
69
|
id: string;
|
|
70
|
-
type: 'openai-compatible' | 'anthropic' | 'codex' | 'claude' | 'opencode-go' | 'grok' | 'opencode';
|
|
70
|
+
type: 'openai-compatible' | 'anthropic' | 'codex' | 'claude' | 'opencode-go' | 'grok' | 'opencode' | 'andorra';
|
|
71
71
|
baseUrl: string;
|
|
72
72
|
model: string;
|
|
73
73
|
apiKeyEnv?: string;
|
|
74
74
|
models?: string[];
|
|
75
75
|
modelContextWindows?: Record<string, number>;
|
|
76
|
+
/** Andorra only: model id -> the router's display name. Labels only; ids stay the identity. */
|
|
77
|
+
modelNames?: Record<string, string>;
|
|
76
78
|
hasApiKey: boolean;
|
|
77
79
|
apiKeyRevision?: string;
|
|
78
80
|
contextWindow?: number;
|
|
@@ -161,6 +163,7 @@ export interface AppServerAccount {
|
|
|
161
163
|
dailyDecisionLimit?: number;
|
|
162
164
|
dailyDecisionUsed?: number;
|
|
163
165
|
fairUse?: boolean;
|
|
166
|
+
unlimited?: boolean;
|
|
164
167
|
windowDays?: number;
|
|
165
168
|
windowDecisionLimit?: number;
|
|
166
169
|
windowDecisionUsed?: number;
|
|
@@ -305,6 +308,7 @@ export interface AppServerSessionSummary {
|
|
|
305
308
|
turns: number;
|
|
306
309
|
lastTask?: string;
|
|
307
310
|
archived?: boolean;
|
|
311
|
+
jevEnabled?: boolean;
|
|
308
312
|
lastTurnStatus?: AppServerTurnStatus;
|
|
309
313
|
timers?: AppServerTimerState[];
|
|
310
314
|
usage: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const APP_SERVER_PROTOCOL_VERSION = 2;
|
|
2
|
-
export const APP_SERVER_CAPABILITIES = ['run.start.runPermissions', 'automations', 'providers.models', 'providers.test', 'providers.test.model', 'providers.streamIdleTimeout', 'providers.modelContextWindows', 'providers.name', 'providers.claude', 'providers.claudeAuth', 'providers.grok', 'providers.opencode', 'providers.auth.submit', 'providers.opencodeGo', 'providers.discover.draft', 'providers.detectSignIns', 'providers.codexAuth', 'providers.codexAuth.logout', 'providers.codexAccounts', 'providers.anthropicConsole', 'run.resume.direction', 'run.resume.model', 'run.steer', 'run.overrideAllNodes', 'run.setModel', 'run.setModel.node', 'run.setPermissions', 'run.start.continueSession', 'run.start.entryHistory', 'remote.owner.projects', 'remote.workspaces.probe', 'remote.engine.relay', 'remote.hosting.device.grant', 'extensions.manage', 'extensions.resources', 'skills.invoke', 'mcp.manage', 'mcp.edit', 'mcp.status', 'runs.files', 'sessions.files', 'account.profile', 'sessions.stats', 'sessions.usage', 'config.analytics', 'config.analytics.planGate', 'sessions.trajectory', 'config.externalSubagent', 'config.codeIntel', 'config.decisions', 'browser.view', 'attachments.read', 'config.general', 'sessions.pullRequest', 'browser.view.go', 'config.browser', 'config.webSearch', 'background.tasks', 'workspace.warm', 'browser.cookies.firefox', 'browser.extensions', 'sessions.compact', 'sessions.goal', 'sessions.changes', 'run.current'];
|
|
2
|
+
export const APP_SERVER_CAPABILITIES = ['run.start.runPermissions', 'automations', 'providers.models', 'providers.test', 'providers.test.model', 'providers.streamIdleTimeout', 'providers.modelContextWindows', 'providers.name', 'providers.claude', 'providers.claudeAuth', 'providers.grok', 'providers.opencode', 'providers.auth.submit', 'providers.opencodeGo', 'providers.discover.draft', 'providers.detectSignIns', 'providers.codexAuth', 'providers.codexAuth.logout', 'providers.codexAccounts', 'providers.anthropicConsole', 'run.resume.direction', 'run.resume.model', 'run.steer', 'run.overrideAllNodes', 'run.setModel', 'run.setModel.node', 'run.setPermissions', 'run.start.continueSession', 'run.start.entryHistory', 'remote.owner.projects', 'remote.workspaces.probe', 'remote.engine.relay', 'remote.hosting.device.grant', 'extensions.manage', 'extensions.resources', 'skills.invoke', 'mcp.manage', 'mcp.edit', 'mcp.status', 'runs.files', 'sessions.files', 'account.profile', 'sessions.stats', 'sessions.usage', 'config.analytics', 'config.analytics.planGate', 'sessions.trajectory', 'config.externalSubagent', 'config.codeIntel', 'config.decisions', 'browser.view', 'attachments.read', 'config.general', 'sessions.pullRequest', 'browser.view.go', 'config.browser', 'config.webSearch', 'background.tasks', 'workspace.warm', 'browser.cookies.firefox', 'browser.extensions', 'sessions.compact', 'sessions.goal', 'sessions.changes', 'run.current', 'sessions.jev', 'providers.andorra'];
|