@centralu/win32-x64 0.1.0-beta.82 → 0.1.0-beta.84
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/Centralu/centralu.exe
CHANGED
|
Binary file
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"commit": "
|
|
2
|
+
"commit": "b9a5315",
|
|
3
3
|
"protocolVersion": 1,
|
|
4
4
|
"hostProof": 1,
|
|
5
5
|
"tokenOnStdin": 1,
|
|
6
6
|
"verifiers": 1,
|
|
7
7
|
"keyPairing": 1,
|
|
8
|
-
"builtAt": "2026-11-
|
|
8
|
+
"builtAt": "2026-11-28T06:13:26.011Z",
|
|
9
9
|
"runtime": "system-node",
|
|
10
10
|
"platform": "win32",
|
|
11
11
|
"arch": "x64"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "centralu",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.84",
|
|
4
4
|
"description": "Run, watch and steer Claude Code, Codex and other coding agents from one window",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ijun17",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"win32"
|
|
39
39
|
],
|
|
40
40
|
"optionalDependencies": {
|
|
41
|
-
"@centralu/darwin-arm64": "0.1.0-beta.
|
|
42
|
-
"@centralu/linux-arm64": "0.1.0-beta.
|
|
43
|
-
"@centralu/linux-x64": "0.1.0-beta.
|
|
44
|
-
"@centralu/win32-x64": "0.1.0-beta.
|
|
41
|
+
"@centralu/darwin-arm64": "0.1.0-beta.84",
|
|
42
|
+
"@centralu/linux-arm64": "0.1.0-beta.84",
|
|
43
|
+
"@centralu/linux-x64": "0.1.0-beta.84",
|
|
44
|
+
"@centralu/win32-x64": "0.1.0-beta.84"
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -43046,7 +43046,7 @@ import { dirname as dirname27, join as join57 } from "node:path";
|
|
|
43046
43046
|
import { mkdirSync as mkdirSync21, readFileSync as readFileSync28, writeSync as writeSync4 } from "node:fs";
|
|
43047
43047
|
|
|
43048
43048
|
// packages/protocol/src/version.generated.ts
|
|
43049
|
-
var APP_VERSION = "0.1.0-beta.
|
|
43049
|
+
var APP_VERSION = "0.1.0-beta.84";
|
|
43050
43050
|
|
|
43051
43051
|
// packages/protocol/src/brand.ts
|
|
43052
43052
|
var APP_NAME = "Centralu";
|
|
@@ -58907,7 +58907,9 @@ var UsageWindow = external_exports.object({
|
|
|
58907
58907
|
/** ISO; null if unknown */
|
|
58908
58908
|
resetsAt: external_exports.string().nullable().default(null),
|
|
58909
58909
|
/** If this window applies to one specific model only, that model's name */
|
|
58910
|
-
scope: external_exports.string().nullable().default(null)
|
|
58910
|
+
scope: external_exports.string().nullable().default(null),
|
|
58911
|
+
/** When a tool reports multiple scoped windows of the same cadence, the adapter marks its representative window here */
|
|
58912
|
+
primary: external_exports.boolean().optional()
|
|
58911
58913
|
});
|
|
58912
58914
|
var UsageSnapshot = external_exports.object({
|
|
58913
58915
|
plan: external_exports.string().nullable().default(null),
|
|
@@ -127593,7 +127595,8 @@ var AcpWire = class {
|
|
|
127593
127595
|
const version2 = init.agentInfo?.version ?? await this.deps.version();
|
|
127594
127596
|
if (version2) this.emit({ type: "agent_version", sessionId: this.sessionId, version: version2 });
|
|
127595
127597
|
this.canClose = init.agentCapabilities?.sessionCapabilities?.close !== void 0;
|
|
127596
|
-
const
|
|
127598
|
+
const meta3 = this.deps.shape?.sessionMeta?.(this.opts);
|
|
127599
|
+
const base2 = { cwd: this.opts.cwd, mcpServers: this.mcpServers(), ...meta3 ? { _meta: meta3 } : {} };
|
|
127597
127600
|
if (resume) {
|
|
127598
127601
|
const caps = init.agentCapabilities;
|
|
127599
127602
|
const method = caps?.loadSession ? "session/load" : caps?.sessionCapabilities?.resume !== void 0 ? "session/resume" : null;
|
|
@@ -128308,7 +128311,32 @@ var InstallFailure = class extends Error {
|
|
|
128308
128311
|
};
|
|
128309
128312
|
|
|
128310
128313
|
// packages/agent-host/src/adapters/antigravity/release.ts
|
|
128314
|
+
var AGY_PLATFORM_KEYS = ["darwin-aarch64", "darwin-x86_64", "linux-x86_64", "linux-aarch64", "windows-x86_64", "windows-aarch64"];
|
|
128311
128315
|
var BASE2 = "https://dl.google.com/agy-extensions/releases";
|
|
128316
|
+
var ALLOWED_ARCHIVE_ORIGIN = "https://dl.google.com";
|
|
128317
|
+
var ALLOWED_ARCHIVE_PREFIX = "/agy-extensions/releases/";
|
|
128318
|
+
var STRICT_SEMVER = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
|
|
128319
|
+
var SHA256_HEX = /^[0-9a-f]{64}$/i;
|
|
128320
|
+
var PLAIN_FILENAME = /^[\w.-]+$/;
|
|
128321
|
+
function isValidAgyVersion(version2) {
|
|
128322
|
+
return STRICT_SEMVER.test(version2) && !version2.includes("..");
|
|
128323
|
+
}
|
|
128324
|
+
function isAllowedAgyArchiveUrl(url2) {
|
|
128325
|
+
try {
|
|
128326
|
+
const parsed = new URL(url2);
|
|
128327
|
+
return parsed.origin === ALLOWED_ARCHIVE_ORIGIN && parsed.pathname.startsWith(ALLOWED_ARCHIVE_PREFIX) && !parsed.pathname.includes("..");
|
|
128328
|
+
} catch {
|
|
128329
|
+
return false;
|
|
128330
|
+
}
|
|
128331
|
+
}
|
|
128332
|
+
function normalizeSha256(sha256) {
|
|
128333
|
+
return SHA256_HEX.test(sha256) ? sha256.toLowerCase() : null;
|
|
128334
|
+
}
|
|
128335
|
+
function sanitizeAgyCommand(cmd) {
|
|
128336
|
+
const clean = cmd.replace(/^\.\//, "");
|
|
128337
|
+
if (clean === "." || clean === ".." || !PLAIN_FILENAME.test(clean)) return null;
|
|
128338
|
+
return clean;
|
|
128339
|
+
}
|
|
128312
128340
|
var posix4 = (url2, sha256, args = []) => ({
|
|
128313
128341
|
url: url2,
|
|
128314
128342
|
sha256,
|
|
@@ -128323,7 +128351,7 @@ var windows2 = (url2, sha256) => ({
|
|
|
128323
128351
|
args: [],
|
|
128324
128352
|
files: ["agy_acp_server.exe", "localharness_external.exe"]
|
|
128325
128353
|
});
|
|
128326
|
-
var
|
|
128354
|
+
var AGY_1_4_3_RELEASE = {
|
|
128327
128355
|
version: "1.4.3",
|
|
128328
128356
|
oauthClient: "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",
|
|
128329
128357
|
archives: {
|
|
@@ -128335,6 +128363,86 @@ var AGY_RELEASE = {
|
|
|
128335
128363
|
"windows-aarch64": windows2(`${BASE2}/windows/agy-acp-server-1.4.3-windows-arm64.zip`, "fcd46431ad33d3b510ce0b98fe7b43d095bd8b3f1c363ee2d57faa7ee981c7bb")
|
|
128336
128364
|
}
|
|
128337
128365
|
};
|
|
128366
|
+
var AGY_RELEASE = {
|
|
128367
|
+
version: "1.5.2",
|
|
128368
|
+
oauthClient: "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",
|
|
128369
|
+
archives: {
|
|
128370
|
+
"darwin-aarch64": posix4(`${BASE2}/macos/agy-acp-server-1.5.2-darwin-arm64.zip`, "123a16d5c40a8ac99e20f01a62b68dd860fd96b1c528dfb8eaa37ca8733d4845"),
|
|
128371
|
+
"darwin-x86_64": posix4(`${BASE2}/macos/agy-acp-server-1.5.2-darwin-x86_64.zip`, "92addb5580577b5356d35484d72d1a113d9c5312ad766bcb304983aa8e3fbb06"),
|
|
128372
|
+
"linux-x86_64": posix4(`${BASE2}/linux/agy-acp-server-1.5.2-linux-x86_64.zip`, "99dd8612450805011619d7b8447ce374c289e00549d8557f36790e1dd6256852", ["--uid="]),
|
|
128373
|
+
"linux-aarch64": posix4(`${BASE2}/linux/agy-acp-server-1.5.2-linux-arm64.zip`, "e729e05ef54ef0763e48900032466b47fa7c9939cde257f93ba49410ab577acb", ["--uid="]),
|
|
128374
|
+
"windows-x86_64": windows2(`${BASE2}/windows/agy-acp-server-1.5.2-windows-x86_64.zip`, "5cbadd4f4df698572473d8890fc26ec2dc1724501f06e3a963941daec2bd21d6"),
|
|
128375
|
+
"windows-aarch64": windows2(`${BASE2}/windows/agy-acp-server-1.5.2-windows-arm64.zip`, "8a4b2ea8df2ffefae33309348752e9119d21a6d36090c0eb48631c2e8f5781ab")
|
|
128376
|
+
}
|
|
128377
|
+
};
|
|
128378
|
+
var KNOWN_AGY_RELEASES = {
|
|
128379
|
+
"1.4.3": AGY_1_4_3_RELEASE,
|
|
128380
|
+
"1.5.2": AGY_RELEASE
|
|
128381
|
+
};
|
|
128382
|
+
var ACP_REGISTRY_URL = "https://cdn.agentclientprotocol.com/registry/v1/latest/registry.json";
|
|
128383
|
+
var acpBinaryEntrySchema = external_exports.object({
|
|
128384
|
+
archive: external_exports.string(),
|
|
128385
|
+
sha256: external_exports.string(),
|
|
128386
|
+
cmd: external_exports.string().optional(),
|
|
128387
|
+
args: external_exports.array(external_exports.string()).optional()
|
|
128388
|
+
});
|
|
128389
|
+
var acpRegistrySchema = external_exports.object({
|
|
128390
|
+
agents: external_exports.array(
|
|
128391
|
+
external_exports.object({
|
|
128392
|
+
id: external_exports.string(),
|
|
128393
|
+
version: external_exports.string().optional(),
|
|
128394
|
+
distribution: external_exports.object({
|
|
128395
|
+
binary: external_exports.record(external_exports.string(), acpBinaryEntrySchema).optional()
|
|
128396
|
+
}).optional()
|
|
128397
|
+
})
|
|
128398
|
+
)
|
|
128399
|
+
});
|
|
128400
|
+
function parseAgyReleaseFromRegistry(json2) {
|
|
128401
|
+
const parsed = acpRegistrySchema.safeParse(json2);
|
|
128402
|
+
if (!parsed.success) return null;
|
|
128403
|
+
const entry = parsed.data.agents.find((a) => a.id === "antigravity-acp");
|
|
128404
|
+
if (!entry?.version || !isValidAgyVersion(entry.version) || !entry.distribution?.binary) return null;
|
|
128405
|
+
const binary = entry.distribution.binary;
|
|
128406
|
+
const archives = {};
|
|
128407
|
+
for (const key2 of AGY_PLATFORM_KEYS) {
|
|
128408
|
+
const b2 = binary[key2];
|
|
128409
|
+
if (!b2) continue;
|
|
128410
|
+
if (!isAllowedAgyArchiveUrl(b2.archive)) return null;
|
|
128411
|
+
const sha256 = normalizeSha256(b2.sha256);
|
|
128412
|
+
if (!sha256) return null;
|
|
128413
|
+
const isWin = key2.startsWith("windows-");
|
|
128414
|
+
const cmd = b2.cmd !== void 0 ? sanitizeAgyCommand(b2.cmd) : isWin ? "agy_acp_server.exe" : "agy_acp_server.par";
|
|
128415
|
+
if (!cmd) return null;
|
|
128416
|
+
const harness = isWin ? "localharness_external.exe" : "localharness_external";
|
|
128417
|
+
archives[key2] = {
|
|
128418
|
+
url: b2.archive,
|
|
128419
|
+
sha256,
|
|
128420
|
+
command: cmd,
|
|
128421
|
+
args: b2.args ?? [],
|
|
128422
|
+
files: [cmd, harness]
|
|
128423
|
+
};
|
|
128424
|
+
}
|
|
128425
|
+
if (Object.keys(archives).length === 0) return null;
|
|
128426
|
+
return {
|
|
128427
|
+
version: entry.version,
|
|
128428
|
+
oauthClient: AGY_RELEASE.oauthClient,
|
|
128429
|
+
archives
|
|
128430
|
+
};
|
|
128431
|
+
}
|
|
128432
|
+
async function fetchLatestAgyRelease(registryUrl = ACP_REGISTRY_URL, timeoutMs = 1e4) {
|
|
128433
|
+
const ctrl = new AbortController();
|
|
128434
|
+
const timer = setTimeout(() => ctrl.abort(), timeoutMs);
|
|
128435
|
+
try {
|
|
128436
|
+
const res = await fetch(registryUrl, { signal: ctrl.signal });
|
|
128437
|
+
if (!res.ok) return null;
|
|
128438
|
+
const json2 = await res.json();
|
|
128439
|
+
return parseAgyReleaseFromRegistry(json2);
|
|
128440
|
+
} catch {
|
|
128441
|
+
return null;
|
|
128442
|
+
} finally {
|
|
128443
|
+
clearTimeout(timer);
|
|
128444
|
+
}
|
|
128445
|
+
}
|
|
128338
128446
|
var AGY_INSTALL_SPACE_BYTES = 700 * 1024 * 1024;
|
|
128339
128447
|
|
|
128340
128448
|
// packages/agent-host/src/adapters/antigravity/agent-files.ts
|
|
@@ -128365,6 +128473,10 @@ function agyHome(dataDir, version2) {
|
|
|
128365
128473
|
const root3 = join34(dataDir, "tools", "antigravity");
|
|
128366
128474
|
return { root: root3, versionDir: join34(root3, version2), geminiHome: join34(root3, "gemini-home") };
|
|
128367
128475
|
}
|
|
128476
|
+
function agyHomeWithVersion(home, version2) {
|
|
128477
|
+
if (!isValidAgyVersion(version2)) throw new Error(`Invalid Antigravity version: ${version2}`);
|
|
128478
|
+
return { root: home.root, versionDir: join34(home.root, version2), geminiHome: home.geminiHome };
|
|
128479
|
+
}
|
|
128368
128480
|
function agyProgram(home, archive) {
|
|
128369
128481
|
return join34(home.versionDir, archive.command);
|
|
128370
128482
|
}
|
|
@@ -128378,6 +128490,58 @@ function isInstalled(home, archive) {
|
|
|
128378
128490
|
return false;
|
|
128379
128491
|
}
|
|
128380
128492
|
}
|
|
128493
|
+
function readInstalledArchive(home) {
|
|
128494
|
+
try {
|
|
128495
|
+
const marker = asObj(JSON.parse(readFileSync13(join34(home.versionDir, INSTALL_MARKER), "utf8")));
|
|
128496
|
+
if (typeof marker.url !== "string" || !isAllowedAgyArchiveUrl(marker.url)) return null;
|
|
128497
|
+
if (typeof marker.sha256 !== "string") return null;
|
|
128498
|
+
const sha256 = normalizeSha256(marker.sha256);
|
|
128499
|
+
if (!sha256) return null;
|
|
128500
|
+
if (typeof marker.command !== "string") return null;
|
|
128501
|
+
const command = sanitizeAgyCommand(marker.command);
|
|
128502
|
+
if (!command) return null;
|
|
128503
|
+
if (!Array.isArray(marker.args) || !marker.args.every((a) => typeof a === "string")) return null;
|
|
128504
|
+
if (!Array.isArray(marker.files) || marker.files.length === 0) return null;
|
|
128505
|
+
const files2 = [];
|
|
128506
|
+
for (const f of marker.files) {
|
|
128507
|
+
if (typeof f !== "string") return null;
|
|
128508
|
+
const clean = sanitizeAgyCommand(f);
|
|
128509
|
+
if (!clean || clean !== f) return null;
|
|
128510
|
+
files2.push(clean);
|
|
128511
|
+
}
|
|
128512
|
+
if (!files2.includes(command)) return null;
|
|
128513
|
+
if (!files2.every((f) => existsSync18(join34(home.versionDir, f)))) return null;
|
|
128514
|
+
return { url: marker.url, sha256, command, args: marker.args, files: files2 };
|
|
128515
|
+
} catch {
|
|
128516
|
+
return null;
|
|
128517
|
+
}
|
|
128518
|
+
}
|
|
128519
|
+
function findInstalledAgyVersions(rootDir) {
|
|
128520
|
+
try {
|
|
128521
|
+
const entries = readdirSync11(rootDir, { withFileTypes: true });
|
|
128522
|
+
const versions = [];
|
|
128523
|
+
for (const ent2 of entries) {
|
|
128524
|
+
if (!ent2.isDirectory() || !isValidAgyVersion(ent2.name)) continue;
|
|
128525
|
+
const markerPath = join34(rootDir, ent2.name, INSTALL_MARKER);
|
|
128526
|
+
if (existsSync18(markerPath)) {
|
|
128527
|
+
versions.push(ent2.name);
|
|
128528
|
+
}
|
|
128529
|
+
}
|
|
128530
|
+
return versions.sort((a, b2) => isNewerVersion(a, b2) ? -1 : isNewerVersion(b2, a) ? 1 : 0);
|
|
128531
|
+
} catch {
|
|
128532
|
+
return [];
|
|
128533
|
+
}
|
|
128534
|
+
}
|
|
128535
|
+
function findInstalledAgy(baseHome, knownReleases, platformKey) {
|
|
128536
|
+
for (const version2 of findInstalledAgyVersions(baseHome.root)) {
|
|
128537
|
+
const home = agyHomeWithVersion(baseHome, version2);
|
|
128538
|
+
const fromMarker = readInstalledArchive(home);
|
|
128539
|
+
if (fromMarker) return { version: version2, home, archive: fromMarker };
|
|
128540
|
+
const known = platformKey ? knownReleases[version2]?.archives[platformKey] ?? null : null;
|
|
128541
|
+
if (known && isInstalled(home, known)) return { version: version2, home, archive: known };
|
|
128542
|
+
}
|
|
128543
|
+
return null;
|
|
128544
|
+
}
|
|
128381
128545
|
function hasSignIn(home) {
|
|
128382
128546
|
const dir = join34(home.geminiHome, "antigravity-acp");
|
|
128383
128547
|
try {
|
|
@@ -128449,8 +128613,11 @@ async function installAgy(home, archive, version2, opts) {
|
|
|
128449
128613
|
const pkg = join34(work, "pkg");
|
|
128450
128614
|
await unpack(zip, archive, pkg, signal, opts.platform ?? HOST_PLATFORM);
|
|
128451
128615
|
await realOs().files.promises.rm(zip, { force: true });
|
|
128452
|
-
await writeFile5(
|
|
128453
|
-
|
|
128616
|
+
await writeFile5(
|
|
128617
|
+
join34(pkg, INSTALL_MARKER),
|
|
128618
|
+
`${JSON.stringify({ version: version2, sha256: archive.sha256, url: archive.url, command: archive.command, args: archive.args, files: archive.files })}
|
|
128619
|
+
`
|
|
128620
|
+
);
|
|
128454
128621
|
cancelled(signal);
|
|
128455
128622
|
if (isInstalled(home, archive)) return;
|
|
128456
128623
|
await realOs().files.promises.rm(home.versionDir, { recursive: true, force: true });
|
|
@@ -128461,7 +128628,7 @@ async function installAgy(home, archive, version2, opts) {
|
|
|
128461
128628
|
await realOs().files.promises.rm(work, { recursive: true, force: true }).catch(() => {
|
|
128462
128629
|
});
|
|
128463
128630
|
}
|
|
128464
|
-
await removeOtherVersions(home);
|
|
128631
|
+
if (opts.pruneOldVersions !== false) await removeOtherVersions(home);
|
|
128465
128632
|
}
|
|
128466
128633
|
async function download(io2, url2, to, signal, onProgress) {
|
|
128467
128634
|
const body = await io2.download(url2, signal);
|
|
@@ -128565,6 +128732,7 @@ function asFailure(err, signal) {
|
|
|
128565
128732
|
async function removeLeftovers(home) {
|
|
128566
128733
|
await removeStale(home.root, ".install-");
|
|
128567
128734
|
await removeStale(home.root, ".sign-in-");
|
|
128735
|
+
if (existsSync18(join34(home.versionDir, INSTALL_MARKER))) await removeOtherVersions(home);
|
|
128568
128736
|
}
|
|
128569
128737
|
async function removeStale(root3, prefix) {
|
|
128570
128738
|
const names = await readdir8(root3).catch(() => []);
|
|
@@ -128997,12 +129165,19 @@ function scrubbed(text3) {
|
|
|
128997
129165
|
var AgySetup = class {
|
|
128998
129166
|
constructor(deps) {
|
|
128999
129167
|
this.deps = deps;
|
|
129000
|
-
this.
|
|
129168
|
+
this.currentHome = deps.home;
|
|
129169
|
+
this.currentArchive = deps.archive;
|
|
129170
|
+
this.currentVersion = deps.version;
|
|
129171
|
+
this.tidied = removeLeftovers(this.currentHome).catch(() => {
|
|
129001
129172
|
});
|
|
129002
129173
|
}
|
|
129003
129174
|
deps;
|
|
129175
|
+
currentHome;
|
|
129176
|
+
currentArchive;
|
|
129177
|
+
currentVersion;
|
|
129004
129178
|
installing = null;
|
|
129005
129179
|
signingIn = null;
|
|
129180
|
+
checking = null;
|
|
129006
129181
|
progress = null;
|
|
129007
129182
|
failure = void 0;
|
|
129008
129183
|
plan = void 0;
|
|
@@ -129011,23 +129186,84 @@ var AgySetup = class {
|
|
|
129011
129186
|
listeners = createListeners((e) => console.error(`[Antigravity] a setup listener failed: ${errorMessage(e)}`));
|
|
129012
129187
|
/** What an earlier host left of an install or a sign-in, removed as this host starts; every install and sign-in waits for it */
|
|
129013
129188
|
tidied;
|
|
129189
|
+
get version() {
|
|
129190
|
+
return this.currentVersion;
|
|
129191
|
+
}
|
|
129192
|
+
get archive() {
|
|
129193
|
+
return this.currentArchive;
|
|
129194
|
+
}
|
|
129195
|
+
get home() {
|
|
129196
|
+
return this.currentHome;
|
|
129197
|
+
}
|
|
129198
|
+
/**
|
|
129199
|
+
* Checks for a newer Antigravity ACP version in the registry. Runs only when Antigravity is already installed
|
|
129200
|
+
* and no manual install or sign-in is in flight. Concurrent calls share the same in-flight check.
|
|
129201
|
+
*/
|
|
129202
|
+
checkUpdate() {
|
|
129203
|
+
if (this.deps.autoUpdate === false || !this.deps.platformKey) return Promise.resolve(false);
|
|
129204
|
+
if (!this.installed() || this.installing || this.signingIn) return Promise.resolve(false);
|
|
129205
|
+
if (this.checking) return this.checking;
|
|
129206
|
+
const run2 = this.runCheckUpdate().finally(() => {
|
|
129207
|
+
if (this.checking === run2) this.checking = null;
|
|
129208
|
+
});
|
|
129209
|
+
this.checking = run2;
|
|
129210
|
+
return run2;
|
|
129211
|
+
}
|
|
129212
|
+
async runCheckUpdate() {
|
|
129213
|
+
const platformKey = this.deps.platformKey;
|
|
129214
|
+
if (!platformKey) return false;
|
|
129215
|
+
try {
|
|
129216
|
+
await this.tidied;
|
|
129217
|
+
if (!this.installed() || this.installing || this.signingIn) return false;
|
|
129218
|
+
const fetchRelease = this.deps.fetchRelease ?? fetchLatestAgyRelease;
|
|
129219
|
+
const release = await fetchRelease() ?? AGY_RELEASE;
|
|
129220
|
+
const newArchive = release?.archives[platformKey];
|
|
129221
|
+
if (!release || !newArchive) return false;
|
|
129222
|
+
const newVersion = release.version;
|
|
129223
|
+
if (!isNewerVersion(newVersion, this.currentVersion)) return false;
|
|
129224
|
+
const newHome = agyHomeWithVersion(this.currentHome, newVersion);
|
|
129225
|
+
if (!isInstalled(newHome, newArchive)) {
|
|
129226
|
+
if (this.installing || this.signingIn) return false;
|
|
129227
|
+
const run2 = this.deps.runInstall ?? ((signal, onProgress) => installAgy(newHome, newArchive, newVersion, {
|
|
129228
|
+
signal,
|
|
129229
|
+
onProgress,
|
|
129230
|
+
pruneOldVersions: false,
|
|
129231
|
+
...this.deps.installIo ? { io: this.deps.installIo } : {}
|
|
129232
|
+
}));
|
|
129233
|
+
const abort = new AbortController();
|
|
129234
|
+
await run2(abort.signal, () => {
|
|
129235
|
+
});
|
|
129236
|
+
}
|
|
129237
|
+
if (!this.installing && !this.signingIn && isInstalled(newHome, newArchive)) {
|
|
129238
|
+
this.currentVersion = newVersion;
|
|
129239
|
+
this.currentArchive = newArchive;
|
|
129240
|
+
this.currentHome = newHome;
|
|
129241
|
+
this.deps.onVersionUpdated?.({ version: newVersion, archive: newArchive, home: newHome });
|
|
129242
|
+
this.changed();
|
|
129243
|
+
return true;
|
|
129244
|
+
}
|
|
129245
|
+
} catch (e) {
|
|
129246
|
+
console.error(`[Antigravity] auto-update check failed: ${errorMessage(e)}`);
|
|
129247
|
+
}
|
|
129248
|
+
return false;
|
|
129249
|
+
}
|
|
129014
129250
|
/** Resolves once the leftovers of an earlier host are gone (for tests and the host's start) */
|
|
129015
129251
|
whenTidy() {
|
|
129016
129252
|
return this.tidied;
|
|
129017
129253
|
}
|
|
129018
129254
|
installed() {
|
|
129019
|
-
return this.
|
|
129255
|
+
return this.currentArchive !== null && isInstalled(this.currentHome, this.currentArchive);
|
|
129020
129256
|
}
|
|
129021
129257
|
appFound() {
|
|
129022
129258
|
return this.deps.appFound?.() ?? false;
|
|
129023
129259
|
}
|
|
129024
129260
|
signedIn() {
|
|
129025
|
-
return this.installed() && !this.signedOutSeen && hasSignIn(this.
|
|
129261
|
+
return this.installed() && !this.signedOutSeen && hasSignIn(this.currentHome);
|
|
129026
129262
|
}
|
|
129027
129263
|
current() {
|
|
129028
129264
|
const base2 = { install: "centralu", signIn: "centralu" };
|
|
129029
129265
|
const failure4 = this.failure ? { failure: this.failure } : {};
|
|
129030
|
-
if (this.
|
|
129266
|
+
if (this.currentArchive === null) {
|
|
129031
129267
|
return { ...base2, state: "not_installed", failure: { reason: "unsupported_platform", message: "Google ships no Antigravity agent for this system" } };
|
|
129032
129268
|
}
|
|
129033
129269
|
if (this.installing) return { ...base2, state: "installing", ...this.progress ? { progress: this.progress } : {} };
|
|
@@ -129043,12 +129279,14 @@ var AgySetup = class {
|
|
|
129043
129279
|
this.listeners.emit(this.current());
|
|
129044
129280
|
}
|
|
129045
129281
|
install() {
|
|
129046
|
-
const
|
|
129282
|
+
const home = this.currentHome;
|
|
129283
|
+
const archive = this.currentArchive;
|
|
129284
|
+
const version2 = this.currentVersion;
|
|
129047
129285
|
if (this.installing || !archive || this.installed()) return this.current();
|
|
129048
129286
|
const abort = new AbortController();
|
|
129049
129287
|
this.failure = void 0;
|
|
129050
129288
|
this.progress = { received: 0, total: null };
|
|
129051
|
-
const run2 = this.deps.runInstall ?? ((signal, onProgress) => installAgy(
|
|
129289
|
+
const run2 = this.deps.runInstall ?? ((signal, onProgress) => installAgy(home, archive, version2, { signal, onProgress, ...this.deps.installIo ? { io: this.deps.installIo } : {} }));
|
|
129052
129290
|
const done2 = this.tidied.then(
|
|
129053
129291
|
() => run2(abort.signal, (p) => {
|
|
129054
129292
|
this.progress = p;
|
|
@@ -129080,16 +129318,17 @@ var AgySetup = class {
|
|
|
129080
129318
|
return this.current();
|
|
129081
129319
|
}
|
|
129082
129320
|
signIn() {
|
|
129083
|
-
const
|
|
129321
|
+
const home = this.currentHome;
|
|
129322
|
+
const archive = this.currentArchive;
|
|
129084
129323
|
if (this.signingIn || !archive || !this.installed()) return this.current();
|
|
129085
129324
|
const abort = new AbortController();
|
|
129086
129325
|
this.failure = void 0;
|
|
129087
|
-
const run2 = this.deps.runSignIn ?? ((signal) => runSignIn(
|
|
129326
|
+
const run2 = this.deps.runSignIn ?? ((signal) => runSignIn(home, archive, signal, this.deps.signIn ?? {}));
|
|
129088
129327
|
const done2 = this.tidied.then(() => run2(abort.signal)).then(
|
|
129089
129328
|
(result) => {
|
|
129090
129329
|
this.signedOutSeen = false;
|
|
129091
129330
|
this.plan = result.plan ?? void 0;
|
|
129092
|
-
if (!hasSignIn(
|
|
129331
|
+
if (!hasSignIn(home)) this.failure = { reason: "failed", message: "Antigravity answered the sign-in but kept no account" };
|
|
129093
129332
|
},
|
|
129094
129333
|
(err) => {
|
|
129095
129334
|
this.failure = failureOf(err, "sign-in");
|
|
@@ -129207,14 +129446,6 @@ var AGY_SURFACE = {
|
|
|
129207
129446
|
offeredWhenMeasured: true,
|
|
129208
129447
|
note: `Only "Log in with Google" (oauth-personal) is offered, through Centralu's own sign-in. The others wait for a screen that takes their settings.`
|
|
129209
129448
|
})),
|
|
129210
|
-
{
|
|
129211
|
-
kind: "capability",
|
|
129212
|
-
name: "_meta.antigravity.systemPrompt.append",
|
|
129213
|
-
treatment: "blocked",
|
|
129214
|
-
measured: `${SPIKE}: offered at initialize, not tried`,
|
|
129215
|
-
offeredWhenMeasured: true,
|
|
129216
|
-
note: "Centralu's role text is not passed yet (roleText: false), so Antigravity is not the Assistant, a coordinator or an app's agent."
|
|
129217
|
-
},
|
|
129218
129449
|
{
|
|
129219
129450
|
kind: "capability",
|
|
129220
129451
|
name: "auth.logout",
|
|
@@ -129232,7 +129463,7 @@ var READ_TIMEOUT_MS = 12e3;
|
|
|
129232
129463
|
var AgyQuota = external_exports.array(
|
|
129233
129464
|
external_exports.object({
|
|
129234
129465
|
name: external_exports.string().min(1),
|
|
129235
|
-
buckets: external_exports.array(external_exports.object({ label: external_exports.string().min(1), remaining: external_exports.number().min(0).max(100), resetsAt: external_exports.iso.datetime() })).min(1)
|
|
129466
|
+
buckets: external_exports.array(external_exports.object({ label: external_exports.string().min(1), remaining: external_exports.number().min(0).max(100), resetsAt: external_exports.iso.datetime().nullable() })).min(1)
|
|
129236
129467
|
})
|
|
129237
129468
|
).min(1);
|
|
129238
129469
|
async function readAgyUsage(home, archive, signedOut, deps = {}) {
|
|
@@ -129307,8 +129538,8 @@ async function readAgyUsage(home, archive, signedOut, deps = {}) {
|
|
|
129307
129538
|
}
|
|
129308
129539
|
}
|
|
129309
129540
|
var GROUP = /^- \*\*(.+)\*\*$/;
|
|
129310
|
-
var NOTE =
|
|
129311
|
-
var BUCKET = /^- \*\*(.+):\*\* (\d+(?:\.\d+)?)% remaining \(resets (.+)\)
|
|
129541
|
+
var NOTE = /^\*?\(.*\)\*?$/;
|
|
129542
|
+
var BUCKET = /^- \*\*(.+):\*\* (\d+(?:\.\d+)?)% remaining(?: \(resets (.+)\))?$/;
|
|
129312
129543
|
var RESET = /^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{1,2}), (\d{4}), (\d{2}):(\d{2}) UTC$/;
|
|
129313
129544
|
var MONTHS2 = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
129314
129545
|
function unread2(what) {
|
|
@@ -129329,30 +129560,42 @@ function readAgyQuota(markdown2) {
|
|
|
129329
129560
|
const group2 = groups.at(-1);
|
|
129330
129561
|
if (!group2) throw unread2("a limit before any group");
|
|
129331
129562
|
const resetStr = bucket[3];
|
|
129332
|
-
|
|
129333
|
-
if (
|
|
129334
|
-
|
|
129563
|
+
let resetsAt = null;
|
|
129564
|
+
if (resetStr) {
|
|
129565
|
+
const reset = RESET.exec(resetStr);
|
|
129566
|
+
if (!reset) throw unread2("a reset time");
|
|
129567
|
+
const [, month, day4, year, hour, minute] = reset;
|
|
129568
|
+
if (!month || !day4 || !year || !hour || !minute) throw unread2("a reset time");
|
|
129569
|
+
const at2 = new Date(Date.UTC(Number(year), MONTHS2.indexOf(month), Number(day4), Number(hour), Number(minute)));
|
|
129570
|
+
resetsAt = at2.toISOString();
|
|
129571
|
+
}
|
|
129335
129572
|
const label = bucket[1];
|
|
129336
129573
|
const remainingStr = bucket[2];
|
|
129337
|
-
if (!
|
|
129338
|
-
|
|
129339
|
-
group2.buckets.push({ label, remaining: Number(remainingStr), resetsAt: at2.toISOString() });
|
|
129574
|
+
if (!label || !remainingStr) throw unread2("a bucket label or value");
|
|
129575
|
+
group2.buckets.push({ label, remaining: Number(remainingStr), resetsAt });
|
|
129340
129576
|
continue;
|
|
129341
129577
|
}
|
|
129342
129578
|
const group = GROUP.exec(line);
|
|
129343
|
-
if (
|
|
129344
|
-
|
|
129579
|
+
if (group && group[1]) {
|
|
129580
|
+
groups.push({ name: group[1], buckets: [] });
|
|
129581
|
+
continue;
|
|
129582
|
+
}
|
|
129583
|
+
throw unread2("a line of a kind it does not know");
|
|
129345
129584
|
}
|
|
129346
129585
|
const quota = AgyQuota.safeParse(groups);
|
|
129347
129586
|
if (!quota.success) throw unread2(groups.length === 0 ? "no limits" : "a group with no limits, or a value out of range");
|
|
129348
129587
|
return quota.data;
|
|
129349
129588
|
}
|
|
129350
129589
|
var slug = (s) => s.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
129590
|
+
var isPrimaryGeminiGroup = (name) => /^gemini\s+models$/i.test(name.trim());
|
|
129351
129591
|
function agyUsageSnapshot(quota, plan) {
|
|
129352
|
-
const
|
|
129592
|
+
const ordered = [...quota].sort((a, b2) => (/gemini/i.test(a.name) ? 0 : 1) - (/gemini/i.test(b2.name) ? 0 : 1));
|
|
129593
|
+
const windows3 = ordered.flatMap(
|
|
129353
129594
|
(g5) => g5.buckets.map((b2) => {
|
|
129354
129595
|
const label = b2.label.replace(/\s+Limit(\s+Remaining)?$/, "");
|
|
129355
|
-
|
|
129596
|
+
const id3 = `${slug(g5.name)}:${slug(label)}`;
|
|
129597
|
+
const primary = isPrimaryGeminiGroup(g5.name) && id3.endsWith(":weekly");
|
|
129598
|
+
return { id: id3, label, percent: 100 - b2.remaining, resetsAt: b2.resetsAt, scope: g5.name, ...primary ? { primary: true } : {} };
|
|
129356
129599
|
})
|
|
129357
129600
|
);
|
|
129358
129601
|
return { plan, windows: windows3, daily: [] };
|
|
@@ -129467,15 +129710,28 @@ async function listAgyModels(home, archive, setup, signedOut, label, install) {
|
|
|
129467
129710
|
}
|
|
129468
129711
|
|
|
129469
129712
|
// packages/agent-host/src/adapters/antigravity/index.ts
|
|
129713
|
+
var AGY_SUBAGENT_TOOL = "invoke_subagent";
|
|
129714
|
+
function agySystemPrompt(opts) {
|
|
129715
|
+
const apps = (opts.apps?.current().length ?? 0) > 0;
|
|
129716
|
+
const rawTools = opts.centraluTools && opts.centraluBridge ? instructionsFor(toolProfileOf(opts), void 0, apps, AGY_SUBAGENT_TOOL) : void 0;
|
|
129717
|
+
const tools = rawTools ? `# How to use the ${CENTRALU_MCP_NAME} MCP server tools
|
|
129718
|
+
|
|
129719
|
+
${rawTools}` : void 0;
|
|
129720
|
+
const text3 = [opts.systemPromptAppend, tools].filter(Boolean).join("\n\n");
|
|
129721
|
+
return text3 || void 0;
|
|
129722
|
+
}
|
|
129470
129723
|
var CAPABILITIES = {
|
|
129471
|
-
// What the agent does or lacks beyond these fields (`
|
|
129724
|
+
// What the agent does or lacks beyond these fields (`attachments` and `keepsRepoFilesOut` stay at the ACP defaults):
|
|
129472
129725
|
// - Files of its own in the project: on Linux (measured, 1.4.3 and 1.5.0) and macOS (seen), it writes its `run_workflow`
|
|
129473
129726
|
// skill as `skills/system/run-workflow/SKILL.md` into the session's project at `session/new`; Windows 1.4.3 writes none
|
|
129474
129727
|
// (#2320, docs/plans/antigravity-acp.md §1 has the cause)
|
|
129475
|
-
// -
|
|
129476
|
-
//
|
|
129728
|
+
// - System prompt & role text: passed through `_meta.antigravity.systemPrompt.append` on session/new, session/load, and session/resume
|
|
129729
|
+
// - Not offered yet: untrusted projects (it reads the project's own instruction files, as the other ACP tools), images in the prompt
|
|
129477
129730
|
...ACP_CAPABILITIES,
|
|
129478
|
-
autoTitle: false
|
|
129731
|
+
autoTitle: false,
|
|
129732
|
+
instructionChannel: "developer",
|
|
129733
|
+
subagentTool: AGY_SUBAGENT_TOOL,
|
|
129734
|
+
roleText: true
|
|
129479
129735
|
};
|
|
129480
129736
|
var DESCRIPTOR = {
|
|
129481
129737
|
name: "antigravity",
|
|
@@ -129485,10 +129741,22 @@ var DESCRIPTOR = {
|
|
|
129485
129741
|
login: "Sign in with Google from Antigravity's line in Centralu."
|
|
129486
129742
|
};
|
|
129487
129743
|
function antigravityProfile(deps = {}) {
|
|
129744
|
+
const root3 = deps.dataDir ?? dataRoot();
|
|
129745
|
+
const baseHome = agyHome(root3, AGY_RELEASE.version);
|
|
129488
129746
|
const key2 = agyPlatformKey(deps.platform, deps.arch);
|
|
129489
|
-
const
|
|
129490
|
-
const
|
|
129491
|
-
const
|
|
129747
|
+
const existing = key2 ? findInstalledAgy(baseHome, KNOWN_AGY_RELEASES, key2) : null;
|
|
129748
|
+
const initialVersion = existing?.version ?? AGY_RELEASE.version;
|
|
129749
|
+
const initialArchive = existing?.archive ?? (key2 ? AGY_RELEASE.archives[key2] : null);
|
|
129750
|
+
const initialHome = existing?.home ?? baseHome;
|
|
129751
|
+
const setup = new AgySetup({
|
|
129752
|
+
home: initialHome,
|
|
129753
|
+
archive: initialArchive,
|
|
129754
|
+
version: initialVersion,
|
|
129755
|
+
platformKey: key2,
|
|
129756
|
+
autoUpdate: true,
|
|
129757
|
+
appFound: agyAppFinder(deps.platform),
|
|
129758
|
+
...deps
|
|
129759
|
+
});
|
|
129492
129760
|
const signedOut = () => {
|
|
129493
129761
|
setup.noteSignedOut();
|
|
129494
129762
|
return rpcError(notSignedIn(DESCRIPTOR, "centralu"), "not_logged_in");
|
|
@@ -129499,9 +129767,15 @@ function antigravityProfile(deps = {}) {
|
|
|
129499
129767
|
capabilities: CAPABILITIES,
|
|
129500
129768
|
surface: AGY_SURFACE,
|
|
129501
129769
|
agySetup: setup,
|
|
129502
|
-
home
|
|
129503
|
-
|
|
129770
|
+
get home() {
|
|
129771
|
+
return setup.home;
|
|
129772
|
+
},
|
|
129773
|
+
get archive() {
|
|
129774
|
+
return setup.archive;
|
|
129775
|
+
},
|
|
129504
129776
|
async launch(opts) {
|
|
129777
|
+
const archive = setup.archive;
|
|
129778
|
+
const home = setup.home;
|
|
129505
129779
|
if (!archive || !setup.installed()) return null;
|
|
129506
129780
|
const folder = await browserFolder(home, deps.platform, deps.helperPlaces, opts.sessionId);
|
|
129507
129781
|
if (folder.browser === "") {
|
|
@@ -129522,15 +129796,15 @@ function antigravityProfile(deps = {}) {
|
|
|
129522
129796
|
}
|
|
129523
129797
|
};
|
|
129524
129798
|
},
|
|
129525
|
-
sweepSessionFiles: (kept) => sweepSessionTemps(home, kept),
|
|
129799
|
+
sweepSessionFiles: (kept) => sweepSessionTemps(setup.home, kept),
|
|
129526
129800
|
async installedVersion() {
|
|
129527
|
-
return setup.installed() ?
|
|
129801
|
+
return setup.installed() ? setup.version : null;
|
|
129528
129802
|
},
|
|
129529
129803
|
async detect() {
|
|
129530
129804
|
const now = setup.current();
|
|
129531
129805
|
const installed = setup.installed();
|
|
129532
129806
|
const loggedIn = now.state === "ready";
|
|
129533
|
-
const detail = !archive ? "Not available on this system" : !installed ? "Not installed" : loggedIn ? `antigravity-acp ${
|
|
129807
|
+
const detail = !setup.archive ? "Not available on this system" : !installed ? "Not installed" : loggedIn ? `antigravity-acp ${setup.version}` : `antigravity-acp ${setup.version} \xB7 sign-in required`;
|
|
129534
129808
|
return { tool: DESCRIPTOR.name, installed, loggedIn, detail, setup: now };
|
|
129535
129809
|
},
|
|
129536
129810
|
centraluToolOf: agyCentraluTool,
|
|
@@ -129544,18 +129818,24 @@ function antigravityProfile(deps = {}) {
|
|
|
129544
129818
|
interruptForInput: true,
|
|
129545
129819
|
onConfigOptions: (options) => {
|
|
129546
129820
|
const models = toModelOptions(options);
|
|
129547
|
-
if (models.length > 0) void saveAgyModels(home, models).catch(() => {
|
|
129821
|
+
if (models.length > 0) void saveAgyModels(setup.home, models).catch(() => {
|
|
129548
129822
|
});
|
|
129823
|
+
},
|
|
129824
|
+
sessionMeta: (opts) => {
|
|
129825
|
+
const append = agySystemPrompt(opts);
|
|
129826
|
+
return append ? { antigravity: { systemPrompt: { append } } } : void 0;
|
|
129549
129827
|
}
|
|
129550
129828
|
},
|
|
129551
129829
|
listModels() {
|
|
129552
|
-
return listAgyModels(home, archive, setup, signedOut, DESCRIPTOR.label, DESCRIPTOR.install);
|
|
129830
|
+
return listAgyModels(setup.home, setup.archive, setup, signedOut, DESCRIPTOR.label, DESCRIPTOR.install);
|
|
129553
129831
|
},
|
|
129554
129832
|
/*
|
|
129555
129833
|
* Its weekly and five-hour limits per model group, from the agent Centralu signed in (`readAgyUsage`), one read at a
|
|
129556
129834
|
* time. No `account()`: the sign-in is this machine's Centralu's own (plan §0), so a linked machine's usage is read there
|
|
129557
129835
|
*/
|
|
129558
129836
|
listUsage() {
|
|
129837
|
+
const archive = setup.archive;
|
|
129838
|
+
const home = setup.home;
|
|
129559
129839
|
if (!archive || !setup.installed()) return Promise.reject(toolNotInstalled(DESCRIPTOR.label, DESCRIPTOR.install));
|
|
129560
129840
|
if (setup.current().state !== "ready") return Promise.reject(signedOut());
|
|
129561
129841
|
reading ??= readAgyUsage(home, archive, signedOut, { platform: deps.platform, helperPlaces: deps.helperPlaces, ...deps.usage }).then((quota) => agyUsageSnapshot(quota, setup.current().plan?.name ?? null)).catch((err) => {
|
|
@@ -134466,6 +134746,7 @@ async function lastCompactSummary(threadId, sessionsDir) {
|
|
|
134466
134746
|
}
|
|
134467
134747
|
|
|
134468
134748
|
// packages/agent-host/src/adapters/codex/items.ts
|
|
134749
|
+
var CHILD_AGENT = "Child agent";
|
|
134469
134750
|
function resultSummary(item) {
|
|
134470
134751
|
const direct = str(item.aggregatedOutput) || str(item.output);
|
|
134471
134752
|
if (direct) return direct;
|
|
@@ -134552,8 +134833,16 @@ function itemSummary(item) {
|
|
|
134552
134833
|
const tool = str(item.tool) || type;
|
|
134553
134834
|
return { tool, title: firstLine2(str(item.prompt)) || tool, paths: [] };
|
|
134554
134835
|
}
|
|
134836
|
+
if (type === "subAgentActivity") {
|
|
134837
|
+
const path2 = str(item.agentPath);
|
|
134838
|
+
if (str(item.kind) === "started") return { tool: "spawnAgent", title: path2 || CHILD_AGENT, paths: [] };
|
|
134839
|
+
if (str(item.kind) === "interacted") return { tool: "sendMessage", title: path2 ? `Message to ${path2}` : `Message to a ${CHILD_AGENT.toLowerCase()}`, paths: [] };
|
|
134840
|
+
}
|
|
134555
134841
|
return { tool: type || "tool", title: str(item.title) || type, paths: [] };
|
|
134556
134842
|
}
|
|
134843
|
+
function childEnded(item) {
|
|
134844
|
+
return str(item.type) === "subAgentActivity" && (str(item.kind) === "completed" || str(item.kind) === "interrupted");
|
|
134845
|
+
}
|
|
134557
134846
|
function argsPreview(raw) {
|
|
134558
134847
|
let value = raw;
|
|
134559
134848
|
if (typeof raw === "string") {
|
|
@@ -134851,7 +135140,7 @@ function normalizeNotification(sessionId, n) {
|
|
|
134851
135140
|
if (type === "contextCompaction") return [{ type: "activity", sessionId, activity: "compacting" }];
|
|
134852
135141
|
if (type === "enteredReviewMode") return [{ type: "activity", sessionId, activity: "reviewing" }];
|
|
134853
135142
|
if (type === "exitedReviewMode") return [{ type: "activity", sessionId, activity: null }];
|
|
134854
|
-
if (type === "imageView") return [];
|
|
135143
|
+
if (type === "imageView" || childEnded(item)) return [];
|
|
134855
135144
|
const s = itemSummary(item);
|
|
134856
135145
|
return [{ type: "tool_call", sessionId, callId: str(item.id), summary: s, input: itemInput(item) }];
|
|
134857
135146
|
}
|
|
@@ -134861,7 +135150,7 @@ function normalizeNotification(sessionId, n) {
|
|
|
134861
135150
|
if (type === "agentMessage") {
|
|
134862
135151
|
return str(item.text) ? [{ type: "message_delta", sessionId, role: "assistant", text: "", ...messageIdOf2(item.id) }] : [];
|
|
134863
135152
|
}
|
|
134864
|
-
if (type === "userMessage" || type === "reasoning") return [];
|
|
135153
|
+
if (type === "userMessage" || type === "reasoning" || childEnded(item)) return [];
|
|
134865
135154
|
if (type === "contextCompaction") {
|
|
134866
135155
|
return [
|
|
134867
135156
|
{ type: "activity", sessionId, activity: null },
|
|
@@ -135352,11 +135641,22 @@ function childSteps(sessionId, parentCallId, n) {
|
|
|
135352
135641
|
}
|
|
135353
135642
|
return subagentSteps(sessionId, parentCallId, normalizeNotification(sessionId, n));
|
|
135354
135643
|
}
|
|
135355
|
-
function
|
|
135356
|
-
if (n.method !== "item/completed") return
|
|
135644
|
+
function launchOf(n) {
|
|
135645
|
+
if (n.method !== "item/started" && n.method !== "item/completed") return null;
|
|
135357
135646
|
const item = asObj(asObj(n.params).item);
|
|
135358
|
-
|
|
135359
|
-
|
|
135647
|
+
const callId = str(item.id);
|
|
135648
|
+
if (!callId) return null;
|
|
135649
|
+
if (str(item.type) === "subAgentActivity") {
|
|
135650
|
+
const thread = str(item.agentThreadId);
|
|
135651
|
+
return str(item.kind) === "started" && thread ? { callId, description: str(item.agentPath) || CHILD_AGENT, threads: [thread] } : null;
|
|
135652
|
+
}
|
|
135653
|
+
if (n.method !== "item/completed" || str(item.type) !== "collabAgentToolCall" || str(item.tool) !== "spawnAgent") return null;
|
|
135654
|
+
const threads = (Array.isArray(item.receiverThreadIds) ? item.receiverThreadIds : []).filter((t) => typeof t === "string" && t !== "");
|
|
135655
|
+
return { callId, description: firstLine2(str(item.prompt).trim()) || CHILD_AGENT, threads };
|
|
135656
|
+
}
|
|
135657
|
+
function launchedThreads(n) {
|
|
135658
|
+
if (n.method !== "item/completed" || !codexItemOk(asObj(asObj(n.params).item))) return [];
|
|
135659
|
+
return launchOf(n)?.threads ?? [];
|
|
135360
135660
|
}
|
|
135361
135661
|
var GOAL_ID = "goal";
|
|
135362
135662
|
var CodexChildTracker = class {
|
|
@@ -135404,10 +135704,10 @@ var CodexChildTracker = class {
|
|
|
135404
135704
|
}
|
|
135405
135705
|
return out;
|
|
135406
135706
|
}
|
|
135407
|
-
/** A
|
|
135408
|
-
link(thread, callId,
|
|
135707
|
+
/** A launch call named this thread (`launchOf`). */
|
|
135708
|
+
link(thread, callId, description) {
|
|
135409
135709
|
if (this.linked.has(thread)) return [];
|
|
135410
|
-
this.linked.set(thread, { callId, description
|
|
135710
|
+
this.linked.set(thread, { callId, description });
|
|
135411
135711
|
return this.changed();
|
|
135412
135712
|
}
|
|
135413
135713
|
/** A notification from a thread that is not the parent's. */
|
|
@@ -135624,7 +135924,11 @@ var CODEX_KNOWN_NOTIFICATIONS = /* @__PURE__ */ new Set([
|
|
|
135624
135924
|
"thread/realtime/outputAudio/delta",
|
|
135625
135925
|
"thread/realtime/sdp",
|
|
135626
135926
|
"thread/realtime/error",
|
|
135627
|
-
"thread/realtime/closed"
|
|
135927
|
+
"thread/realtime/closed",
|
|
135928
|
+
"thread/prediction/updated",
|
|
135929
|
+
"thread/readState/changed",
|
|
135930
|
+
"thread/search/partial",
|
|
135931
|
+
"thread/section/changed"
|
|
135628
135932
|
]);
|
|
135629
135933
|
|
|
135630
135934
|
// packages/agent-host/src/adapters/codex/reasoning-parts.ts
|
|
@@ -136050,8 +136354,7 @@ var CodexChildThreads = class {
|
|
|
136050
136354
|
}
|
|
136051
136355
|
host;
|
|
136052
136356
|
/**
|
|
136053
|
-
* Child threads (#222): a child's thread id, to the `
|
|
136054
|
-
* that card. Learned from the item's `receiverThreadIds` on `item/completed` (the `item/started` has an empty list).
|
|
136357
|
+
* Child threads (#222): a child's thread id, to the launch item (`launchOf`) that started it. Its steps are kept under that card.
|
|
136055
136358
|
*/
|
|
136056
136359
|
childCalls = /* @__PURE__ */ new Map();
|
|
136057
136360
|
/**
|
|
@@ -136082,18 +136385,16 @@ var CodexChildThreads = class {
|
|
|
136082
136385
|
this.unlinkedCount += 1;
|
|
136083
136386
|
}
|
|
136084
136387
|
/**
|
|
136085
|
-
* A
|
|
136086
|
-
*
|
|
136388
|
+
* A launch call named the threads it started (`launchOf`), from the parent or from a child that started its own: their steps go
|
|
136389
|
+
* under its card from now on, starting with whatever arrived before it.
|
|
136087
136390
|
*/
|
|
136088
136391
|
noteSpawn(n) {
|
|
136089
|
-
|
|
136090
|
-
|
|
136091
|
-
|
|
136092
|
-
|
|
136093
|
-
|
|
136094
|
-
|
|
136095
|
-
this.childCalls.set(thread, item.id);
|
|
136096
|
-
for (const e of this.children.link(thread, item.id, typeof item.prompt === "string" ? item.prompt : "")) this.host.emit(e);
|
|
136392
|
+
const launch2 = launchOf(n);
|
|
136393
|
+
if (!launch2) return;
|
|
136394
|
+
for (const thread of launch2.threads) {
|
|
136395
|
+
if (this.childCalls.has(thread)) continue;
|
|
136396
|
+
this.childCalls.set(thread, launch2.callId);
|
|
136397
|
+
for (const e of this.children.link(thread, launch2.callId, launch2.description)) this.host.emit(e);
|
|
136097
136398
|
const held3 = this.unlinked.get(thread) ?? [];
|
|
136098
136399
|
this.unlinked.delete(thread);
|
|
136099
136400
|
this.unlinkedCount -= held3.length;
|
|
@@ -136103,7 +136404,7 @@ var CodexChildThreads = class {
|
|
|
136103
136404
|
/** The parent's turn ended: what no launch call named by then is let go of (see `unlinked`) */
|
|
136104
136405
|
noteTurnEnd(n) {
|
|
136105
136406
|
if (n.method === "turn/completed" && this.unlinked.size > 0) {
|
|
136106
|
-
console.error(`[codex] ${this.host.sessionId.slice(0, 8)} let go of ${this.unlinkedCount} items from ${this.unlinked.size} threads no
|
|
136407
|
+
console.error(`[codex] ${this.host.sessionId.slice(0, 8)} let go of ${this.unlinkedCount} items from ${this.unlinked.size} threads no launch call named`);
|
|
136107
136408
|
this.unlinked.clear();
|
|
136108
136409
|
this.unlinkedCount = 0;
|
|
136109
136410
|
}
|
|
@@ -136861,8 +137162,8 @@ import { join as join45 } from "node:path";
|
|
|
136861
137162
|
|
|
136862
137163
|
// packages/agent-host/src/adapters/codex/surface-baseline.ts
|
|
136863
137164
|
var SURFACE_BASELINE2 = {
|
|
136864
|
-
recorded: "2026-
|
|
136865
|
-
version: "codex-cli 0.
|
|
137165
|
+
recorded: "2026-11-28",
|
|
137166
|
+
version: "codex-cli 0.172.0",
|
|
136866
137167
|
offered: {
|
|
136867
137168
|
command: [
|
|
136868
137169
|
"account/gatewayOAuth/cancel",
|
|
@@ -136874,6 +137175,7 @@ var SURFACE_BASELINE2 = {
|
|
|
136874
137175
|
"account/rateLimitResetCredit/consume",
|
|
136875
137176
|
"account/rateLimits/read",
|
|
136876
137177
|
"account/read",
|
|
137178
|
+
"account/securitySetup/read",
|
|
136877
137179
|
"account/sendAddCreditsNudgeEmail",
|
|
136878
137180
|
"account/usage/read",
|
|
136879
137181
|
"account/workspaceMessages/read",
|
|
@@ -136895,6 +137197,7 @@ var SURFACE_BASELINE2 = {
|
|
|
136895
137197
|
"externalAgentConfig/import",
|
|
136896
137198
|
"externalAgentConfig/import/readHistories",
|
|
136897
137199
|
"externalAgentConfig/import/recordHistory",
|
|
137200
|
+
"feedback/save",
|
|
136898
137201
|
"feedback/upload",
|
|
136899
137202
|
"fs/copy",
|
|
136900
137203
|
"fs/createDirectory",
|
|
@@ -136920,6 +137223,9 @@ var SURFACE_BASELINE2 = {
|
|
|
136920
137223
|
"mcpServerStatus/list",
|
|
136921
137224
|
"model/list",
|
|
136922
137225
|
"modelProvider/capabilities/read",
|
|
137226
|
+
"modelProvider/config/write",
|
|
137227
|
+
"modelProvider/default/set",
|
|
137228
|
+
"modelProvider/list",
|
|
136923
137229
|
"permissionProfile/list",
|
|
136924
137230
|
"plugin/install",
|
|
136925
137231
|
"plugin/installed",
|
|
@@ -136942,6 +137248,7 @@ var SURFACE_BASELINE2 = {
|
|
|
136942
137248
|
"thread/attachment/add",
|
|
136943
137249
|
"thread/attachment/list",
|
|
136944
137250
|
"thread/attachment/remove",
|
|
137251
|
+
"thread/attachmentOwner/list",
|
|
136945
137252
|
"thread/compact/start",
|
|
136946
137253
|
"thread/delete",
|
|
136947
137254
|
"thread/fork",
|
|
@@ -137042,8 +137349,10 @@ var SURFACE_BASELINE2 = {
|
|
|
137042
137349
|
"thread/goal/cleared",
|
|
137043
137350
|
"thread/goal/updated",
|
|
137044
137351
|
"thread/name/updated",
|
|
137352
|
+
"thread/prediction/updated",
|
|
137045
137353
|
"thread/project/updated",
|
|
137046
137354
|
"thread/queue/changed",
|
|
137355
|
+
"thread/readState/changed",
|
|
137047
137356
|
"thread/realtime/closed",
|
|
137048
137357
|
"thread/realtime/error",
|
|
137049
137358
|
"thread/realtime/item/completed",
|
|
@@ -137056,6 +137365,8 @@ var SURFACE_BASELINE2 = {
|
|
|
137056
137365
|
"thread/realtime/transcript/delta",
|
|
137057
137366
|
"thread/realtime/transcript/done",
|
|
137058
137367
|
"thread/reverted",
|
|
137368
|
+
"thread/search/partial",
|
|
137369
|
+
"thread/section/changed",
|
|
137059
137370
|
"thread/settings/updated",
|
|
137060
137371
|
"thread/started",
|
|
137061
137372
|
"thread/status/changed",
|
|
@@ -137110,6 +137421,7 @@ var SURFACE_BASELINE2 = {
|
|
|
137110
137421
|
"subcommand:login",
|
|
137111
137422
|
"subcommand:logout",
|
|
137112
137423
|
"subcommand:mcp",
|
|
137424
|
+
"subcommand:migrate-nfs-db",
|
|
137113
137425
|
"subcommand:migrate-rollouts",
|
|
137114
137426
|
"subcommand:plugin",
|
|
137115
137427
|
"subcommand:queue",
|
|
@@ -146711,6 +147023,8 @@ var ToolQueries = class {
|
|
|
146711
147023
|
* opens would make that click feel slow.
|
|
146712
147024
|
*/
|
|
146713
147025
|
modelCache = /* @__PURE__ */ new Map();
|
|
147026
|
+
/** Counts the times a tool's CLI changed (`forgetModels`): a read that began under an older count is of the old CLI and is not kept */
|
|
147027
|
+
modelEpoch = /* @__PURE__ */ new Map();
|
|
146714
147028
|
/** One read of a tool's list at a time: a second asker waits on it instead of starting another tool process */
|
|
146715
147029
|
modelFetches = /* @__PURE__ */ new Map();
|
|
146716
147030
|
/** When a read last failed, so a caller that cannot wait does not start another one at once (#660) */
|
|
@@ -146724,14 +147038,18 @@ var ToolQueries = class {
|
|
|
146724
147038
|
fetchModels(tool, adapter) {
|
|
146725
147039
|
const running2 = this.modelFetches.get(tool);
|
|
146726
147040
|
if (running2) return running2;
|
|
147041
|
+
const epoch = this.modelEpoch.get(tool) ?? 0;
|
|
147042
|
+
const current = () => (this.modelEpoch.get(tool) ?? 0) === epoch;
|
|
146727
147043
|
const p = withTimeout(adapter.listModels(), MODEL_LIST_READ_MS, `${tool}'s model list`).then(
|
|
146728
147044
|
(models) => {
|
|
146729
|
-
|
|
146730
|
-
|
|
147045
|
+
if (current()) {
|
|
147046
|
+
this.modelCache.set(tool, { models, at: Date.now() });
|
|
147047
|
+
this.modelFailures.delete(tool);
|
|
147048
|
+
}
|
|
146731
147049
|
return models;
|
|
146732
147050
|
},
|
|
146733
147051
|
(err) => {
|
|
146734
|
-
this.modelFailures.set(tool, Date.now());
|
|
147052
|
+
if (current()) this.modelFailures.set(tool, Date.now());
|
|
146735
147053
|
throw err;
|
|
146736
147054
|
}
|
|
146737
147055
|
);
|
|
@@ -146742,6 +147060,16 @@ var ToolQueries = class {
|
|
|
146742
147060
|
p.then(clear, clear);
|
|
146743
147061
|
return p;
|
|
146744
147062
|
}
|
|
147063
|
+
/**
|
|
147064
|
+
* The tool's CLI changed (`AgentVersionService`, #2544): the list it gave, and the failure that held the next read off, were the old
|
|
147065
|
+
* CLI's. The next ask reads the new one, and a read still running for the old one is not kept.
|
|
147066
|
+
*/
|
|
147067
|
+
forgetModels(tool) {
|
|
147068
|
+
this.modelCache.delete(tool);
|
|
147069
|
+
this.modelFailures.delete(tool);
|
|
147070
|
+
this.modelFetches.delete(tool);
|
|
147071
|
+
this.modelEpoch.set(tool, (this.modelEpoch.get(tool) ?? 0) + 1);
|
|
147072
|
+
}
|
|
146745
147073
|
async listModels(tool) {
|
|
146746
147074
|
const adapter = this.host.adapters.get(tool);
|
|
146747
147075
|
if (!adapter?.listModels) {
|
|
@@ -156853,6 +157181,8 @@ var AgentVersionService = class {
|
|
|
156853
157181
|
since;
|
|
156854
157182
|
constructor(deps) {
|
|
156855
157183
|
this.deps = {
|
|
157184
|
+
versionChanged: () => {
|
|
157185
|
+
},
|
|
156856
157186
|
readAutoApply: () => true,
|
|
156857
157187
|
writeAutoApply: () => {
|
|
156858
157188
|
},
|
|
@@ -156900,7 +157230,9 @@ var AgentVersionService = class {
|
|
|
156900
157230
|
const tools = this.deps.tools().filter((t) => t.installedVersion);
|
|
156901
157231
|
const read2 = await Promise.all(tools.map(async (t) => [t.tool, await t.installedVersion().catch(() => null)]));
|
|
156902
157232
|
const installed = Object.fromEntries(read2);
|
|
157233
|
+
const before = this.status.installed;
|
|
156903
157234
|
this.status = { ...this.status, installed, checkedAt: this.deps.now() };
|
|
157235
|
+
for (const [tool, version2] of read2) if (tool in before && before[tool] !== version2) this.deps.versionChanged?.(tool);
|
|
156904
157236
|
this.deps.publish(this.current());
|
|
156905
157237
|
if (this.status.autoApply) for (const s of this.deps.sessions.listSessions()) this.lookSoon(s.id);
|
|
156906
157238
|
return this.current();
|
|
@@ -164548,7 +164880,7 @@ var handedToken = launch.tokenOnStdin ? await readHandedToken(process.stdin).cat
|
|
|
164548
164880
|
console.error(`[agent-host] the launcher did not hand over the token: ${e.message}`);
|
|
164549
164881
|
process.exit(1);
|
|
164550
164882
|
}) : launch.token;
|
|
164551
|
-
var BUILD = true ? "
|
|
164883
|
+
var BUILD = true ? "b9a5315" : "dev";
|
|
164552
164884
|
var { values } = parseArgs({
|
|
164553
164885
|
options: {
|
|
164554
164886
|
port: { type: "string", default: "5175" },
|
|
@@ -164782,10 +165114,14 @@ var agentVersions = new AgentVersionService({
|
|
|
164782
165114
|
notes: mgr.sessionSettings,
|
|
164783
165115
|
// Not listening yet: the first window asks
|
|
164784
165116
|
publish: (status) => events.push({ type: "agent_versions", status }),
|
|
165117
|
+
versionChanged: (tool) => mgr.toolQueries.forgetModels(tool),
|
|
164785
165118
|
readAutoApply: autoApplyAgentVersions.read,
|
|
164786
165119
|
writeAutoApply: autoApplyAgentVersions.write
|
|
164787
165120
|
});
|
|
164788
|
-
for (const a of adapters.values())
|
|
165121
|
+
for (const a of adapters.values()) {
|
|
165122
|
+
a.setup?.onChange((setup) => events.push({ type: "tool_setup", tool: a.tool, setup }));
|
|
165123
|
+
void a.setup?.checkUpdate?.();
|
|
165124
|
+
}
|
|
164789
165125
|
versionsRef.current = agentVersions;
|
|
164790
165126
|
mgr.useVersionHint((tool) => agentVersions.installedNow(tool));
|
|
164791
165127
|
var SLEEP_AFTER_KEY = "agents.sleepAfterMinutes";
|