@zvada/agent-server 0.3.27 → 0.3.28
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/CHANGELOG.md +38 -0
- package/README.md +6 -4
- package/dist/core/agents/acp/account.js +111 -0
- package/dist/core/agents/acp/acp-agent.js +247 -158
- package/dist/core/agents/acp/adapter.js +103 -34
- package/dist/core/agents/acp/client.js +169 -42
- package/dist/core/agents/acp/known-agents.js +12 -5
- package/dist/core/agents/acp/mappings.js +84 -20
- package/dist/core/agents/acp/models.js +59 -0
- package/dist/core/agents/acp/profile.js +36 -0
- package/dist/core/agents/acp/prompts.js +248 -0
- package/dist/core/agents/acp/requests.js +4 -4
- package/dist/core/agents/claude-code/login.js +4 -1
- package/dist/core/agents/claude-code/session.js +38 -10
- package/dist/core/agents/claude-code/spawn.js +0 -26
- package/dist/core/agents/codex-app-server/client.js +12 -13
- package/dist/core/agents/codex-app-server/login.js +4 -1
- package/dist/core/agents/gemini/failures.js +133 -0
- package/dist/core/agents/gemini/login.js +173 -0
- package/dist/core/agents/gemini/profile.js +137 -0
- package/dist/core/agents/gemini/tools.js +91 -0
- package/dist/core/agents/login.js +8 -6
- package/dist/core/agents/stderr-tail.js +5 -2
- package/dist/core/presets.js +13 -0
- package/dist/core/processes/native-processes.js +23 -1
- package/dist/core/provision/install-build.js +70 -26
- package/dist/core/provision/pins.js +5 -0
- package/dist/core/provision/provisioner.js +39 -16
- package/dist/core/provision/releases.js +39 -1
- package/dist/core/provision/tools.js +87 -28
- package/dist/operator/errors.js +2 -2
- package/dist/operator/operator.js +171 -74
- package/dist/operator/render.js +33 -25
- package/dist/operator/session-tools.js +2 -1
- package/dist/protocol/account.js +5 -1
- package/dist/protocol/auth.js +5 -1
- package/dist/protocol/credentials.js +9 -1
- package/dist/protocol/harness.js +9 -1
- package/dist/server/bin.js +22 -7
- package/dist/server/install.js +6 -4
- package/dist/types/core/agents/acp/account.d.ts +55 -0
- package/dist/types/core/agents/acp/account.d.ts.map +1 -0
- package/dist/types/core/agents/acp/acp-agent.d.ts +65 -36
- package/dist/types/core/agents/acp/acp-agent.d.ts.map +1 -1
- package/dist/types/core/agents/acp/adapter.d.ts +28 -3
- package/dist/types/core/agents/acp/adapter.d.ts.map +1 -1
- package/dist/types/core/agents/acp/client.d.ts +66 -4
- package/dist/types/core/agents/acp/client.d.ts.map +1 -1
- package/dist/types/core/agents/acp/known-agents.d.ts +4 -2
- package/dist/types/core/agents/acp/known-agents.d.ts.map +1 -1
- package/dist/types/core/agents/acp/mappings.d.ts +53 -7
- package/dist/types/core/agents/acp/mappings.d.ts.map +1 -1
- package/dist/types/core/agents/acp/models.d.ts +22 -0
- package/dist/types/core/agents/acp/models.d.ts.map +1 -0
- package/dist/types/core/agents/acp/profile.d.ts +92 -0
- package/dist/types/core/agents/acp/profile.d.ts.map +1 -0
- package/dist/types/core/agents/acp/prompts.d.ts +108 -0
- package/dist/types/core/agents/acp/prompts.d.ts.map +1 -0
- package/dist/types/core/agents/acp/requests.d.ts +7 -1
- package/dist/types/core/agents/acp/requests.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/login.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/session.d.ts +3 -0
- package/dist/types/core/agents/claude-code/session.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/spawn.d.ts +0 -8
- package/dist/types/core/agents/claude-code/spawn.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/client.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/login.d.ts.map +1 -1
- package/dist/types/core/agents/gemini/failures.d.ts +25 -0
- package/dist/types/core/agents/gemini/failures.d.ts.map +1 -0
- package/dist/types/core/agents/gemini/login.d.ts +28 -0
- package/dist/types/core/agents/gemini/login.d.ts.map +1 -0
- package/dist/types/core/agents/gemini/profile.d.ts +30 -0
- package/dist/types/core/agents/gemini/profile.d.ts.map +1 -0
- package/dist/types/core/agents/gemini/tools.d.ts +18 -0
- package/dist/types/core/agents/gemini/tools.d.ts.map +1 -0
- package/dist/types/core/agents/login.d.ts +15 -5
- package/dist/types/core/agents/login.d.ts.map +1 -1
- package/dist/types/core/agents/stderr-tail.d.ts +1 -1
- package/dist/types/core/agents/stderr-tail.d.ts.map +1 -1
- package/dist/types/core/presets.d.ts +2 -2
- package/dist/types/core/presets.d.ts.map +1 -1
- package/dist/types/core/processes/native-processes.d.ts +6 -0
- package/dist/types/core/processes/native-processes.d.ts.map +1 -1
- package/dist/types/core/provision/checksums.d.ts +7 -1
- package/dist/types/core/provision/checksums.d.ts.map +1 -1
- package/dist/types/core/provision/install-build.d.ts +32 -6
- package/dist/types/core/provision/install-build.d.ts.map +1 -1
- package/dist/types/core/provision/pins.d.ts +4 -0
- package/dist/types/core/provision/pins.d.ts.map +1 -1
- package/dist/types/core/provision/provisioner.d.ts +18 -7
- package/dist/types/core/provision/provisioner.d.ts.map +1 -1
- package/dist/types/core/provision/releases.d.ts +2 -1
- package/dist/types/core/provision/releases.d.ts.map +1 -1
- package/dist/types/core/provision/tools.d.ts +36 -7
- package/dist/types/core/provision/tools.d.ts.map +1 -1
- package/dist/types/operator/errors.d.ts +5 -1
- package/dist/types/operator/errors.d.ts.map +1 -1
- package/dist/types/operator/operator.d.ts.map +1 -1
- package/dist/types/operator/render.d.ts +11 -6
- package/dist/types/operator/render.d.ts.map +1 -1
- package/dist/types/operator/session-tools.d.ts.map +1 -1
- package/dist/types/operator/types.d.ts +1 -0
- package/dist/types/operator/types.d.ts.map +1 -1
- package/dist/types/protocol/account.d.ts +4 -2
- package/dist/types/protocol/account.d.ts.map +1 -1
- package/dist/types/protocol/auth.d.ts +10 -7
- package/dist/types/protocol/auth.d.ts.map +1 -1
- package/dist/types/protocol/clis.d.ts +4 -3
- package/dist/types/protocol/clis.d.ts.map +1 -1
- package/dist/types/protocol/config.d.ts +2 -0
- package/dist/types/protocol/config.d.ts.map +1 -1
- package/dist/types/protocol/conversation.d.ts +3 -3
- package/dist/types/protocol/credentials.d.ts +8 -0
- package/dist/types/protocol/credentials.d.ts.map +1 -1
- package/dist/types/protocol/execution.d.ts +1 -1
- package/dist/types/protocol/harness.d.ts +5 -2
- package/dist/types/protocol/harness.d.ts.map +1 -1
- package/dist/types/protocol/lifecycle.d.ts +8 -8
- package/dist/types/protocol/models.d.ts +3 -0
- package/dist/types/protocol/models.d.ts.map +1 -1
- package/dist/types/protocol/wire-api.d.ts +39 -29
- package/dist/types/protocol/wire-api.d.ts.map +1 -1
- package/dist/types/protocol/wire.d.ts +13 -10
- package/dist/types/protocol/wire.d.ts.map +1 -1
- package/dist/types/server/install.d.ts +2 -1
- package/dist/types/server/install.d.ts.map +1 -1
- package/docs/consuming.md +6 -0
- package/docs/deploy.md +17 -8
- package/docs/harnesses.md +166 -44
- package/package.json +1 -1
- package/src/core/agents/acp/account.ts +158 -0
- package/src/core/agents/acp/acp-agent.ts +288 -178
- package/src/core/agents/acp/adapter.ts +126 -35
- package/src/core/agents/acp/client.ts +196 -49
- package/src/core/agents/acp/known-agents.ts +14 -5
- package/src/core/agents/acp/mappings.ts +112 -21
- package/src/core/agents/acp/models.ts +72 -0
- package/src/core/agents/acp/profile.ts +127 -0
- package/src/core/agents/acp/prompts.ts +287 -0
- package/src/core/agents/acp/requests.ts +16 -9
- package/src/core/agents/claude-code/login.ts +4 -1
- package/src/core/agents/claude-code/session.ts +38 -8
- package/src/core/agents/claude-code/spawn.ts +0 -26
- package/src/core/agents/codex-app-server/client.ts +11 -18
- package/src/core/agents/codex-app-server/login.ts +4 -5
- package/src/core/agents/gemini/failures.ts +148 -0
- package/src/core/agents/gemini/login.ts +188 -0
- package/src/core/agents/gemini/profile.ts +162 -0
- package/src/core/agents/gemini/tools.ts +99 -0
- package/src/core/agents/login.ts +14 -8
- package/src/core/agents/stderr-tail.ts +5 -2
- package/src/core/presets.ts +15 -2
- package/src/core/processes/native-processes.ts +32 -1
- package/src/core/provision/checksums.ts +12 -2
- package/src/core/provision/install-build.ts +122 -55
- package/src/core/provision/pins.ts +5 -0
- package/src/core/provision/provisioner.ts +62 -27
- package/src/core/provision/releases.ts +47 -1
- package/src/core/provision/tools.ts +124 -31
- package/src/operator/errors.ts +5 -2
- package/src/operator/operator.ts +181 -77
- package/src/operator/render.ts +60 -28
- package/src/operator/session-tools.ts +2 -1
- package/src/operator/types.ts +1 -0
- package/src/protocol/account.ts +5 -2
- package/src/protocol/auth.ts +5 -1
- package/src/protocol/credentials.ts +11 -2
- package/src/protocol/harness.ts +9 -1
- package/src/server/bin.ts +20 -6
- package/src/server/install.ts +6 -3
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
} from "node:fs";
|
|
9
9
|
import { readdir } from "node:fs/promises";
|
|
10
10
|
import { createRequire } from "node:module";
|
|
11
|
+
import { homedir } from "node:os";
|
|
11
12
|
import { dirname, join, resolve } from "node:path";
|
|
12
13
|
import { pathToFileURL } from "node:url";
|
|
13
14
|
import type { AgentHarness } from "../../protocol/index.ts";
|
|
@@ -22,12 +23,13 @@ import {
|
|
|
22
23
|
} from "./platform.ts";
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
|
-
* The managed CLIs. Each native harness maps onto exactly one of these
|
|
26
|
+
* The managed CLIs. Each native harness maps onto exactly one of these, and
|
|
27
|
+
* so does `gemini`, a profile on the ACP agent that runs Google's `agy`; the
|
|
26
28
|
* `acp` harness maps onto none (its agent binaries are arbitrary third-party
|
|
27
29
|
* commands the operator supplies, not something we pin or download), nor does
|
|
28
30
|
* `scripted`, which runs no process.
|
|
29
31
|
*/
|
|
30
|
-
export const CLI_TOOLS = ["claude", "codex"] as const;
|
|
32
|
+
export const CLI_TOOLS = ["claude", "codex", "agy"] as const;
|
|
31
33
|
export type CliTool = (typeof CLI_TOOLS)[number];
|
|
32
34
|
|
|
33
35
|
/**
|
|
@@ -38,6 +40,7 @@ export type CliTool = (typeof CLI_TOOLS)[number];
|
|
|
38
40
|
const TOOL_FOR_HARNESS: Record<AgentHarness, CliTool | undefined> = {
|
|
39
41
|
"claude-code": "claude",
|
|
40
42
|
"codex-app-server": "codex",
|
|
43
|
+
gemini: "agy",
|
|
41
44
|
acp: undefined,
|
|
42
45
|
scripted: undefined,
|
|
43
46
|
};
|
|
@@ -46,7 +49,7 @@ export function toolForHarness(harness: AgentHarness): CliTool | undefined {
|
|
|
46
49
|
return TOOL_FOR_HARNESS[harness];
|
|
47
50
|
}
|
|
48
51
|
|
|
49
|
-
/** What to download for one tool on one platform. */
|
|
52
|
+
/** What to download from npm for one tool on one platform. */
|
|
50
53
|
export interface ToolPackage {
|
|
51
54
|
name: string;
|
|
52
55
|
/** Exact version string the registry knows (codex encodes the platform here). */
|
|
@@ -55,6 +58,35 @@ export interface ToolPackage {
|
|
|
55
58
|
suffix: string;
|
|
56
59
|
}
|
|
57
60
|
|
|
61
|
+
/** A tool published as npm packages: the registry's metadata names each tarball and its integrity. */
|
|
62
|
+
export interface NpmSource {
|
|
63
|
+
readonly kind: "npm";
|
|
64
|
+
/** The registry package carrying this platform's build of `version`. */
|
|
65
|
+
package(platform: PlatformInfo, version: string): ToolPackage;
|
|
66
|
+
/** The directory of an extracted tarball that becomes the install. */
|
|
67
|
+
payload(extractedRoot: string): Promise<string>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// @ref LLP 0010#source-kinds — a `url` build is the table's: nothing at run time can vouch for another
|
|
71
|
+
/**
|
|
72
|
+
* A tool published as files at addresses its vendor names: only this
|
|
73
|
+
* release's table says where each build is and what it must match
|
|
74
|
+
* (`CliBuild.url`), so a version the table does not hold is not downloaded.
|
|
75
|
+
* Its cache folders are named by the platform (`platformName`).
|
|
76
|
+
*/
|
|
77
|
+
export interface UrlSource {
|
|
78
|
+
readonly kind: "url";
|
|
79
|
+
/**
|
|
80
|
+
* This platform's executable: its name in the install (one of
|
|
81
|
+
* `binaries`), and its name in the gzipped tarball the download is; no
|
|
82
|
+
* `member`, the download is the executable itself.
|
|
83
|
+
*/
|
|
84
|
+
executable(platform: PlatformInfo): { readonly binary: string; readonly member?: string };
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Where a tool's builds come from. */
|
|
88
|
+
export type CliSource = NpmSource | UrlSource;
|
|
89
|
+
|
|
58
90
|
/** Where a host install is looked for. */
|
|
59
91
|
export interface HostMachine {
|
|
60
92
|
platform: PlatformInfo;
|
|
@@ -68,14 +100,16 @@ export interface HostMachine {
|
|
|
68
100
|
|
|
69
101
|
/** What the provisioner knows of one managed CLI. */
|
|
70
102
|
export interface CliToolSpec {
|
|
103
|
+
/** What people call it: `install` says it (`Codex CLI 0.169.1`). */
|
|
104
|
+
readonly title: string;
|
|
71
105
|
/** The variable an operator points at the binary to run instead (never the wire's). */
|
|
72
106
|
readonly overrideEnv: string;
|
|
73
107
|
/** Where the binary sits in an installed tree; the first regular file wins. */
|
|
74
108
|
readonly binaries: readonly string[];
|
|
75
109
|
/** The platforms the vendor publishes a build for, as the cache names them. */
|
|
76
110
|
readonly platforms: readonly string[];
|
|
77
|
-
/**
|
|
78
|
-
|
|
111
|
+
/** Where its builds come from, and how one becomes the install. */
|
|
112
|
+
readonly source: CliSource;
|
|
79
113
|
/** The version to download when no pin is set. */
|
|
80
114
|
defaultVersion(): string;
|
|
81
115
|
/** Why the default may not be the build that runs, when this machine cannot tell (said once). */
|
|
@@ -88,8 +122,6 @@ export interface CliToolSpec {
|
|
|
88
122
|
* SDK's manifest names its own CLI's sha256.
|
|
89
123
|
*/
|
|
90
124
|
localBuild?(suffix: string, version: string): LocalBuild | undefined;
|
|
91
|
-
/** The directory of an extracted tarball that becomes the install. */
|
|
92
|
-
payload(extractedRoot: string): Promise<string>;
|
|
93
125
|
/**
|
|
94
126
|
* What `system` mode fails with when the host has none; absent, the
|
|
95
127
|
* harness's own resolution speaks (the Claude SDK finds its sibling
|
|
@@ -228,6 +260,7 @@ const CODEX_BINARIES = [join("bin", "codex"), join("bin", "codex.exe")];
|
|
|
228
260
|
*/
|
|
229
261
|
export const CLI_TOOL_SPECS: Record<CliTool, CliToolSpec> = {
|
|
230
262
|
claude: {
|
|
263
|
+
title: "Claude Code",
|
|
231
264
|
overrideEnv: "CLAUDE_CLI_PATH",
|
|
232
265
|
binaries: ["claude", "claude.exe"],
|
|
233
266
|
platforms: [
|
|
@@ -240,10 +273,22 @@ export const CLI_TOOL_SPECS: Record<CliTool, CliToolSpec> = {
|
|
|
240
273
|
"win32-arm64",
|
|
241
274
|
"win32-x64",
|
|
242
275
|
],
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
276
|
+
source: {
|
|
277
|
+
kind: "npm",
|
|
278
|
+
// The platform packages carry the native CLI matched to the SDK JS.
|
|
279
|
+
package: (platform, version) => {
|
|
280
|
+
const suffix = claudePackageSuffix(platform);
|
|
281
|
+
return {
|
|
282
|
+
name: `@anthropic-ai/claude-agent-sdk-${suffix}`,
|
|
283
|
+
registryVersion: version,
|
|
284
|
+
suffix,
|
|
285
|
+
};
|
|
286
|
+
},
|
|
287
|
+
payload: async (extractedRoot) => {
|
|
288
|
+
const dir = join(extractedRoot, "package");
|
|
289
|
+
if (existsSync(dir)) return dir;
|
|
290
|
+
throw new CliProvisionError("claude tarball has no package/ directory");
|
|
291
|
+
},
|
|
247
292
|
},
|
|
248
293
|
// The on-disk SDK's version (the pair that actually runs) over the
|
|
249
294
|
// release default, which only decides inside compiled binaries. Even
|
|
@@ -277,11 +322,6 @@ export const CLI_TOOL_SPECS: Record<CliTool, CliToolSpec> = {
|
|
|
277
322
|
const path = join(platformDir, claudeManifestBuild(sdk.dir, suffix)?.binary ?? "claude");
|
|
278
323
|
return existsSync(path) ? { path, version: sdk.version } : undefined;
|
|
279
324
|
},
|
|
280
|
-
payload: async (extractedRoot) => {
|
|
281
|
-
const dir = join(extractedRoot, "package");
|
|
282
|
-
if (existsSync(dir)) return dir;
|
|
283
|
-
throw new CliProvisionError("claude tarball has no package/ directory");
|
|
284
|
-
},
|
|
285
325
|
// The SDK on disk names its own CLI's checksum, for a version this
|
|
286
326
|
// release did not pin (a consumer's lockfile moved the SDK).
|
|
287
327
|
localBuild: (suffix, version) => {
|
|
@@ -292,6 +332,7 @@ export const CLI_TOOL_SPECS: Record<CliTool, CliToolSpec> = {
|
|
|
292
332
|
},
|
|
293
333
|
},
|
|
294
334
|
codex: {
|
|
335
|
+
title: "Codex CLI",
|
|
295
336
|
overrideEnv: "CODEX_CLI_PATH",
|
|
296
337
|
binaries: CODEX_BINARIES,
|
|
297
338
|
// Its linux builds are static, so there is no musl variant.
|
|
@@ -303,10 +344,24 @@ export const CLI_TOOL_SPECS: Record<CliTool, CliToolSpec> = {
|
|
|
303
344
|
"win32-arm64",
|
|
304
345
|
"win32-x64",
|
|
305
346
|
],
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
347
|
+
source: {
|
|
348
|
+
kind: "npm",
|
|
349
|
+
// Codex publishes its platform builds as version suffixes of one package.
|
|
350
|
+
package: (platform, version) => {
|
|
351
|
+
const suffix = codexPackageSuffix(platform);
|
|
352
|
+
return { name: "@openai/codex", registryVersion: `${version}-${suffix}`, suffix };
|
|
353
|
+
},
|
|
354
|
+
// Codex vendors per-target trees: package/vendor/<rust-triple>/bin/codex.
|
|
355
|
+
// Install the whole tree — the CLI expects its vendored rg/zsh siblings.
|
|
356
|
+
payload: async (extractedRoot) => {
|
|
357
|
+
const vendor = join(extractedRoot, "package", "vendor");
|
|
358
|
+
const entries = existsSync(vendor) ? await readdir(vendor) : [];
|
|
359
|
+
for (const entry of entries) {
|
|
360
|
+
const dir = join(vendor, entry);
|
|
361
|
+
if (binaryIn(dir, CODEX_BINARIES)) return dir;
|
|
362
|
+
}
|
|
363
|
+
throw new CliProvisionError("codex tarball has no vendor/<target>/bin/codex");
|
|
364
|
+
},
|
|
310
365
|
},
|
|
311
366
|
defaultVersion: () => DEFAULT_PINS.codex,
|
|
312
367
|
// @ref LLP 0001#d18--the-engine-installs-the-clis-it-runs-pinned-builds-checked-before-a-turn — a lockfile's build, or in `system` the operator's PATH
|
|
@@ -333,17 +388,6 @@ export const CLI_TOOL_SPECS: Record<CliTool, CliToolSpec> = {
|
|
|
333
388
|
const path = searchPath ? findOnPath("codex", env, platform.platform) : undefined;
|
|
334
389
|
return path ? { path } : undefined;
|
|
335
390
|
},
|
|
336
|
-
// Codex vendors per-target trees: package/vendor/<rust-triple>/bin/codex.
|
|
337
|
-
// Install the whole tree — the CLI expects its vendored rg/zsh siblings.
|
|
338
|
-
payload: async (extractedRoot) => {
|
|
339
|
-
const vendor = join(extractedRoot, "package", "vendor");
|
|
340
|
-
const entries = existsSync(vendor) ? await readdir(vendor) : [];
|
|
341
|
-
for (const entry of entries) {
|
|
342
|
-
const dir = join(vendor, entry);
|
|
343
|
-
if (binaryIn(dir, CODEX_BINARIES)) return dir;
|
|
344
|
-
}
|
|
345
|
-
throw new CliProvisionError("codex tarball has no vendor/<target>/bin/codex");
|
|
346
|
-
},
|
|
347
391
|
// A bare spawn would just ENOENT.
|
|
348
392
|
notOnHost: () =>
|
|
349
393
|
new CliNotFoundError(
|
|
@@ -351,4 +395,53 @@ export const CLI_TOOL_SPECS: Record<CliTool, CliToolSpec> = {
|
|
|
351
395
|
'install it, set $CODEX_CLI_PATH, or use provision mode "auto"',
|
|
352
396
|
),
|
|
353
397
|
},
|
|
398
|
+
// Google's Antigravity CLI, for the gemini harness.
|
|
399
|
+
agy: {
|
|
400
|
+
title: "Antigravity CLI",
|
|
401
|
+
overrideEnv: "ANTIGRAVITY_CLI_PATH",
|
|
402
|
+
binaries: ["agy", "agy.exe"],
|
|
403
|
+
platforms: [
|
|
404
|
+
"darwin-arm64",
|
|
405
|
+
"darwin-x64",
|
|
406
|
+
"linux-arm64",
|
|
407
|
+
"linux-x64",
|
|
408
|
+
"linux-arm64-musl",
|
|
409
|
+
"linux-x64-musl",
|
|
410
|
+
"win32-arm64",
|
|
411
|
+
"win32-x64",
|
|
412
|
+
],
|
|
413
|
+
// Google publishes no package: each build is a file its update manifest
|
|
414
|
+
// names, with a sha512 and no signature, recorded at refresh
|
|
415
|
+
// (`scripts/refresh-cli-releases.ts`). The tarball's one member is
|
|
416
|
+
// `antigravity`, which its installer puts in place as `agy`; Windows'
|
|
417
|
+
// build is the executable itself.
|
|
418
|
+
source: {
|
|
419
|
+
kind: "url",
|
|
420
|
+
executable: ({ platform }) =>
|
|
421
|
+
platform === "win32" ? { binary: "agy.exe" } : { binary: "agy", member: "antigravity" },
|
|
422
|
+
},
|
|
423
|
+
defaultVersion: () => DEFAULT_PINS.agy,
|
|
424
|
+
// @ref LLP 0010#source-kinds — the person's own agy updates itself: only `system` runs it
|
|
425
|
+
// Where Google's installers put it (`install.sh`: ~/.local/bin/agy;
|
|
426
|
+
// `install.ps1` and `install.cmd`: %LOCALAPPDATA%\agy\bin\agy.exe),
|
|
427
|
+
// then PATH, in `system` mode only: nobody chose that build for this
|
|
428
|
+
// engine, and it updates itself.
|
|
429
|
+
hostInstall: ({ platform, env, searchPath }) => {
|
|
430
|
+
if (!searchPath) return undefined;
|
|
431
|
+
const windows = platform.platform === "win32";
|
|
432
|
+
const local = windows ? env.LOCALAPPDATA : (env.HOME ?? homedir());
|
|
433
|
+
const installed =
|
|
434
|
+
local &&
|
|
435
|
+
binaryIn(windows ? join(local, "agy", "bin") : join(local, ".local", "bin"), [
|
|
436
|
+
windows ? "agy.exe" : "agy",
|
|
437
|
+
]);
|
|
438
|
+
const path = installed || findOnPath("agy", env, platform.platform);
|
|
439
|
+
return path ? { path } : undefined;
|
|
440
|
+
},
|
|
441
|
+
notOnHost: () =>
|
|
442
|
+
new CliNotFoundError(
|
|
443
|
+
"agy",
|
|
444
|
+
'install Google\'s Antigravity CLI (https://antigravity.google/docs/getting-started), set $ANTIGRAVITY_CLI_PATH, or use provision mode "auto"',
|
|
445
|
+
),
|
|
446
|
+
},
|
|
354
447
|
};
|
package/src/operator/errors.ts
CHANGED
|
@@ -200,12 +200,15 @@ export const refuse = {
|
|
|
200
200
|
`This computer cannot take another session now. Nothing was started.${retryAfter ? ` Try again in ${retryAfter}s.` : ""}`,
|
|
201
201
|
{ detail, retryAfter },
|
|
202
202
|
),
|
|
203
|
-
staleCursor: (hint: Hint, ref: string) =>
|
|
203
|
+
staleCursor: (hint: Hint, ref: string, selection?: { after: string } | { last: number }) =>
|
|
204
204
|
new OperatorError(
|
|
205
205
|
"stale_cursor",
|
|
206
206
|
`That cursor no longer points into ${q(ref)}. Nothing was read.`,
|
|
207
207
|
{
|
|
208
|
-
next: hint(
|
|
208
|
+
next: hint(
|
|
209
|
+
"read_session",
|
|
210
|
+
selection ? { session: ref, ...selection, full: true } : { session: ref },
|
|
211
|
+
),
|
|
209
212
|
},
|
|
210
213
|
),
|
|
211
214
|
unsupported: (detail?: string) =>
|