@codexhost/cli-darwin-x64 0.14.0 → 0.16.0
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/README.md +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +55 -7
- package/app/console-web.js +281 -79
- package/app/desktop-controller.mjs +155 -22
- package/app/host-runtime.mjs +548 -148
- package/app/plugins/antigravity/plugin.mjs +342 -53
- package/app/plugins/claude-code/plugin.mjs +393 -162
- package/app/plugins/codebuddy/plugin.mjs +245 -49
- package/app/plugins/codex-usage/plugin.mjs +75 -28
- package/app/plugins/copilot/plugin.mjs +100 -53
- package/app/plugins/cursor-cli/plugin.mjs +207 -46
- package/app/plugins/deepseek-harness/plugin.mjs +103 -36
- package/app/plugins/grok/plugin.mjs +354 -84
- package/app/plugins/hermes/plugin.mjs +50 -3
- package/app/plugins/kimi-code/plugin.mjs +62 -15
- package/app/plugins/kiro-cli/plugin.mjs +62 -15
- package/app/plugins/omp/plugin.mjs +82 -35
- package/app/plugins/opencode/plugin.mjs +104 -57
- package/app/plugins/pi/plugin.mjs +134 -50
- package/app/plugins/qoder/plugin.mjs +72 -25
- package/app/plugins/qoder-cn/plugin.mjs +72 -25
- package/app/plugins/workbuddy/plugin.mjs +245 -49
- package/app/plugins/zcode/plugin.mjs +101 -29
- package/app/renderer-extension.js +2353 -344
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
|
@@ -413,8 +413,8 @@ import { spawn } from "node:child_process";
|
|
|
413
413
|
import { randomUUID as randomUUID6 } from "node:crypto";
|
|
414
414
|
import { readFile as readFile2, unlink } from "node:fs/promises";
|
|
415
415
|
import https3 from "node:https";
|
|
416
|
-
import
|
|
417
|
-
import
|
|
416
|
+
import os6 from "node:os";
|
|
417
|
+
import path11 from "node:path";
|
|
418
418
|
import readline from "node:readline";
|
|
419
419
|
|
|
420
420
|
// ../../../node_modules/zod/v4/classic/external.js
|
|
@@ -1183,10 +1183,10 @@ function mergeDefs(...defs) {
|
|
|
1183
1183
|
function cloneDef(schema) {
|
|
1184
1184
|
return mergeDefs(schema._zod.def);
|
|
1185
1185
|
}
|
|
1186
|
-
function getElementAtPath(obj,
|
|
1187
|
-
if (!
|
|
1186
|
+
function getElementAtPath(obj, path12) {
|
|
1187
|
+
if (!path12)
|
|
1188
1188
|
return obj;
|
|
1189
|
-
return
|
|
1189
|
+
return path12.reduce((acc, key) => acc?.[key], obj);
|
|
1190
1190
|
}
|
|
1191
1191
|
function promiseAllObject(promisesObj) {
|
|
1192
1192
|
const keys = Object.keys(promisesObj);
|
|
@@ -1595,11 +1595,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
1595
1595
|
}
|
|
1596
1596
|
return false;
|
|
1597
1597
|
}
|
|
1598
|
-
function prefixIssues(
|
|
1598
|
+
function prefixIssues(path12, issues) {
|
|
1599
1599
|
return issues.map((iss) => {
|
|
1600
1600
|
var _a3;
|
|
1601
1601
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
1602
|
-
iss.path.unshift(
|
|
1602
|
+
iss.path.unshift(path12);
|
|
1603
1603
|
return iss;
|
|
1604
1604
|
});
|
|
1605
1605
|
}
|
|
@@ -1746,16 +1746,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
|
|
|
1746
1746
|
}
|
|
1747
1747
|
function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
1748
1748
|
const fieldErrors = { _errors: [] };
|
|
1749
|
-
const processError = (error52,
|
|
1749
|
+
const processError = (error52, path12 = []) => {
|
|
1750
1750
|
for (const issue2 of error52.issues) {
|
|
1751
1751
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1752
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1752
|
+
issue2.errors.map((issues) => processError({ issues }, [...path12, ...issue2.path]));
|
|
1753
1753
|
} else if (issue2.code === "invalid_key") {
|
|
1754
|
-
processError({ issues: issue2.issues }, [...
|
|
1754
|
+
processError({ issues: issue2.issues }, [...path12, ...issue2.path]);
|
|
1755
1755
|
} else if (issue2.code === "invalid_element") {
|
|
1756
|
-
processError({ issues: issue2.issues }, [...
|
|
1756
|
+
processError({ issues: issue2.issues }, [...path12, ...issue2.path]);
|
|
1757
1757
|
} else {
|
|
1758
|
-
const fullpath = [...
|
|
1758
|
+
const fullpath = [...path12, ...issue2.path];
|
|
1759
1759
|
if (fullpath.length === 0) {
|
|
1760
1760
|
fieldErrors._errors.push(mapper(issue2));
|
|
1761
1761
|
} else {
|
|
@@ -1782,17 +1782,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
|
1782
1782
|
}
|
|
1783
1783
|
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
1784
1784
|
const result = { errors: [] };
|
|
1785
|
-
const processError = (error52,
|
|
1785
|
+
const processError = (error52, path12 = []) => {
|
|
1786
1786
|
var _a3, _b;
|
|
1787
1787
|
for (const issue2 of error52.issues) {
|
|
1788
1788
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1789
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1789
|
+
issue2.errors.map((issues) => processError({ issues }, [...path12, ...issue2.path]));
|
|
1790
1790
|
} else if (issue2.code === "invalid_key") {
|
|
1791
|
-
processError({ issues: issue2.issues }, [...
|
|
1791
|
+
processError({ issues: issue2.issues }, [...path12, ...issue2.path]);
|
|
1792
1792
|
} else if (issue2.code === "invalid_element") {
|
|
1793
|
-
processError({ issues: issue2.issues }, [...
|
|
1793
|
+
processError({ issues: issue2.issues }, [...path12, ...issue2.path]);
|
|
1794
1794
|
} else {
|
|
1795
|
-
const fullpath = [...
|
|
1795
|
+
const fullpath = [...path12, ...issue2.path];
|
|
1796
1796
|
if (fullpath.length === 0) {
|
|
1797
1797
|
result.errors.push(mapper(issue2));
|
|
1798
1798
|
continue;
|
|
@@ -1824,8 +1824,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
1824
1824
|
}
|
|
1825
1825
|
function toDotPath(_path) {
|
|
1826
1826
|
const segs = [];
|
|
1827
|
-
const
|
|
1828
|
-
for (const seg of
|
|
1827
|
+
const path12 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
1828
|
+
for (const seg of path12) {
|
|
1829
1829
|
if (typeof seg === "number")
|
|
1830
1830
|
segs.push(`[${seg}]`);
|
|
1831
1831
|
else if (typeof seg === "symbol")
|
|
@@ -3446,10 +3446,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3446
3446
|
const shape = def.shape;
|
|
3447
3447
|
const propValues = {};
|
|
3448
3448
|
for (const key in shape) {
|
|
3449
|
-
const
|
|
3450
|
-
if (
|
|
3449
|
+
const field2 = shape[key]._zod;
|
|
3450
|
+
if (field2.values) {
|
|
3451
3451
|
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
3452
|
-
for (const v of
|
|
3452
|
+
for (const v of field2.values)
|
|
3453
3453
|
propValues[key].add(v);
|
|
3454
3454
|
}
|
|
3455
3455
|
}
|
|
@@ -5053,8 +5053,8 @@ function az_default() {
|
|
|
5053
5053
|
}
|
|
5054
5054
|
|
|
5055
5055
|
// ../../../node_modules/zod/v4/locales/be.js
|
|
5056
|
-
function getBelarusianPlural(
|
|
5057
|
-
const absCount = Math.abs(
|
|
5056
|
+
function getBelarusianPlural(count3, one, few, many) {
|
|
5057
|
+
const absCount = Math.abs(count3);
|
|
5058
5058
|
const lastDigit = absCount % 10;
|
|
5059
5059
|
const lastTwoDigits = absCount % 100;
|
|
5060
5060
|
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
|
@@ -7132,8 +7132,8 @@ function hu_default() {
|
|
|
7132
7132
|
}
|
|
7133
7133
|
|
|
7134
7134
|
// ../../../node_modules/zod/v4/locales/hy.js
|
|
7135
|
-
function getArmenianPlural(
|
|
7136
|
-
return Math.abs(
|
|
7135
|
+
function getArmenianPlural(count3, one, many) {
|
|
7136
|
+
return Math.abs(count3) === 1 ? one : many;
|
|
7137
7137
|
}
|
|
7138
7138
|
function withDefiniteArticle(word) {
|
|
7139
7139
|
if (!word)
|
|
@@ -9261,8 +9261,8 @@ function ro_default() {
|
|
|
9261
9261
|
}
|
|
9262
9262
|
|
|
9263
9263
|
// ../../../node_modules/zod/v4/locales/ru.js
|
|
9264
|
-
function getRussianPlural(
|
|
9265
|
-
const absCount = Math.abs(
|
|
9264
|
+
function getRussianPlural(count3, one, few, many) {
|
|
9265
|
+
const absCount = Math.abs(count3);
|
|
9266
9266
|
const lastDigit = absCount % 10;
|
|
9267
9267
|
const lastTwoDigits = absCount % 100;
|
|
9268
9268
|
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
|
@@ -14517,13 +14517,13 @@ function resolveRef(ref, ctx) {
|
|
|
14517
14517
|
if (!ref.startsWith("#")) {
|
|
14518
14518
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
14519
14519
|
}
|
|
14520
|
-
const
|
|
14521
|
-
if (
|
|
14520
|
+
const path12 = ref.slice(1).split("/").filter(Boolean);
|
|
14521
|
+
if (path12.length === 0) {
|
|
14522
14522
|
return ctx.rootSchema;
|
|
14523
14523
|
}
|
|
14524
14524
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
14525
|
-
if (
|
|
14526
|
-
const key =
|
|
14525
|
+
if (path12[0] === defsKey) {
|
|
14526
|
+
const key = path12[1];
|
|
14527
14527
|
if (!key || !ctx.defs[key]) {
|
|
14528
14528
|
throw new Error(`Reference not found: ${ref}`);
|
|
14529
14529
|
}
|
|
@@ -15089,6 +15089,8 @@ var usageStatisticsTotalsSchema = external_exports.strictObject({
|
|
|
15089
15089
|
cachedInputTokens: count,
|
|
15090
15090
|
cacheWriteInputTokens: count,
|
|
15091
15091
|
cacheKnownInputTokens: count,
|
|
15092
|
+
cacheHitCachedInputTokens: count,
|
|
15093
|
+
cacheHitInputTokens: count,
|
|
15092
15094
|
outputTokens: count,
|
|
15093
15095
|
reasoningOutputTokens: count,
|
|
15094
15096
|
/** USD at the public price, summed over the priced requests only. */
|
|
@@ -15196,6 +15198,51 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
|
15196
15198
|
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
15197
15199
|
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
15198
15200
|
|
|
15201
|
+
// ../../shared-contracts/dist/thread-questions.js
|
|
15202
|
+
var field = external_exports.discriminatedUnion("type", [
|
|
15203
|
+
external_exports.object({
|
|
15204
|
+
id: external_exports.string().min(1),
|
|
15205
|
+
type: external_exports.literal("choice"),
|
|
15206
|
+
prompt: external_exports.string(),
|
|
15207
|
+
options: external_exports.array(external_exports.object({
|
|
15208
|
+
value: external_exports.string().min(1),
|
|
15209
|
+
label: external_exports.string(),
|
|
15210
|
+
description: external_exports.string().optional()
|
|
15211
|
+
})).min(1),
|
|
15212
|
+
multiple: external_exports.boolean(),
|
|
15213
|
+
allowOther: external_exports.boolean(),
|
|
15214
|
+
optional: external_exports.boolean()
|
|
15215
|
+
}),
|
|
15216
|
+
external_exports.object({
|
|
15217
|
+
id: external_exports.string().min(1),
|
|
15218
|
+
type: external_exports.literal("text"),
|
|
15219
|
+
prompt: external_exports.string(),
|
|
15220
|
+
multiline: external_exports.boolean(),
|
|
15221
|
+
secret: external_exports.literal(false),
|
|
15222
|
+
optional: external_exports.boolean(),
|
|
15223
|
+
placeholder: external_exports.string().optional(),
|
|
15224
|
+
prefill: external_exports.string().optional()
|
|
15225
|
+
})
|
|
15226
|
+
]);
|
|
15227
|
+
var threadQuestionSchema = external_exports.object({
|
|
15228
|
+
interactionId: external_exports.string().min(1),
|
|
15229
|
+
turnId: external_exports.string().min(1),
|
|
15230
|
+
title: external_exports.string().optional(),
|
|
15231
|
+
questions: external_exports.array(field).min(1)
|
|
15232
|
+
}).refine(({ questions }) => questions.some((q) => q.type === "choice" && q.multiple), {
|
|
15233
|
+
message: "Shared cards require at least one multi-select question"
|
|
15234
|
+
});
|
|
15235
|
+
var threadQuestionsListParamsSchema = external_exports.strictObject({ threadId: external_exports.string().min(1) });
|
|
15236
|
+
var threadQuestionsResultSchema = external_exports.object({ questions: external_exports.array(threadQuestionSchema) });
|
|
15237
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
15238
|
+
threadId: external_exports.string().min(1),
|
|
15239
|
+
turnId: external_exports.string().min(1),
|
|
15240
|
+
interactionId: external_exports.string().min(1),
|
|
15241
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
15242
|
+
cancelled: external_exports.boolean().default(false)
|
|
15243
|
+
});
|
|
15244
|
+
var threadQuestionRespondResultSchema = external_exports.object({ accepted: external_exports.literal(true) });
|
|
15245
|
+
|
|
15199
15246
|
// ../../shared-contracts/dist/console.js
|
|
15200
15247
|
var consoleAnnouncementSchema = external_exports.strictObject({
|
|
15201
15248
|
title: external_exports.string().trim().min(1).max(200),
|
|
@@ -16665,6 +16712,12 @@ function historyPath(environment) {
|
|
|
16665
16712
|
const threadId = safeThreadId(environment);
|
|
16666
16713
|
return threadId ? path5.join(historyRoot(environment), `${threadId}.json`) : null;
|
|
16667
16714
|
}
|
|
16715
|
+
function antigravityHookDirectory(environment) {
|
|
16716
|
+
const threadId = safeThreadId(environment);
|
|
16717
|
+
if (!threadId || threadId === "." || threadId === "..")
|
|
16718
|
+
return null;
|
|
16719
|
+
return path5.join(historyRoot(environment), "hooks", threadId);
|
|
16720
|
+
}
|
|
16668
16721
|
function jsonTurn(turn) {
|
|
16669
16722
|
return JSON.parse(JSON.stringify(turn));
|
|
16670
16723
|
}
|
|
@@ -16853,8 +16906,11 @@ var AntigravityHistory = class _AntigravityHistory {
|
|
|
16853
16906
|
function nativeConversationDbPath(nativeSessionId, homedir2 = os3.homedir()) {
|
|
16854
16907
|
return path6.join(homedir2, ".gemini", "antigravity-cli", "conversations", `${nativeSessionId}.db`);
|
|
16855
16908
|
}
|
|
16909
|
+
function nativeBrainRoot(homedir2 = os3.homedir()) {
|
|
16910
|
+
return path6.join(homedir2, ".gemini", "antigravity-cli", "brain");
|
|
16911
|
+
}
|
|
16856
16912
|
function nativeBrainDirPath(nativeSessionId, homedir2 = os3.homedir()) {
|
|
16857
|
-
return path6.join(homedir2,
|
|
16913
|
+
return path6.join(nativeBrainRoot(homedir2), nativeSessionId);
|
|
16858
16914
|
}
|
|
16859
16915
|
async function cloneNativeConversationDb(sourceSessionId, derivedSessionId, retainedTurnsCountOrHomedir, homedirOption = os3.homedir()) {
|
|
16860
16916
|
let retainedTurnsCount;
|
|
@@ -18107,7 +18163,7 @@ var AntigravityQuestionBridge = class _AntigravityQuestionBridge {
|
|
|
18107
18163
|
this.#server.on("request", (request, response) => this.#receive(request, response));
|
|
18108
18164
|
}
|
|
18109
18165
|
static async create(options) {
|
|
18110
|
-
const directory = await mkdtemp2(path8.join(os4.tmpdir(), "codexhost-agy-question-"));
|
|
18166
|
+
const directory = options.directory ?? await mkdtemp2(path8.join(os4.tmpdir(), "codexhost-agy-question-"));
|
|
18111
18167
|
const bridge = new _AntigravityQuestionBridge(directory, options);
|
|
18112
18168
|
try {
|
|
18113
18169
|
await new Promise((resolve, reject) => {
|
|
@@ -18123,7 +18179,7 @@ var AntigravityQuestionBridge = class _AntigravityQuestionBridge {
|
|
|
18123
18179
|
throw new Error("Question bridge did not bind");
|
|
18124
18180
|
bridge.environment.CODEXHOST_AGY_QUESTION_URL = `http://127.0.0.1:${address.port}/question`;
|
|
18125
18181
|
const client = path8.join(directory, "question-hook.cjs");
|
|
18126
|
-
await mkdir3(path8.join(directory, ".agents"));
|
|
18182
|
+
await mkdir3(path8.join(directory, ".agents"), { recursive: true, mode: 448 });
|
|
18127
18183
|
await writeFile3(client, ANTIGRAVITY_QUESTION_HOOK_CLIENT, "utf8");
|
|
18128
18184
|
const quote = (value) => `'${value.replaceAll("'", "'\\''")}'`;
|
|
18129
18185
|
bridge.environment.CODEXHOST_AGY_QUESTION_NODE = `"${process.execPath.replaceAll("\\", "/")}"`;
|
|
@@ -18352,7 +18408,9 @@ var AntigravityQuestionBridge = class _AntigravityQuestionBridge {
|
|
|
18352
18408
|
this.#server.close(() => resolve());
|
|
18353
18409
|
this.#server.closeAllConnections();
|
|
18354
18410
|
});
|
|
18355
|
-
|
|
18411
|
+
if (this.#options.directory === void 0) {
|
|
18412
|
+
await rm3(this.directory, { recursive: true, force: true, maxRetries: 5, retryDelay: 50 });
|
|
18413
|
+
}
|
|
18356
18414
|
})();
|
|
18357
18415
|
return this.#disposal;
|
|
18358
18416
|
}
|
|
@@ -18846,12 +18904,195 @@ var AntigravitySubagents = class {
|
|
|
18846
18904
|
}
|
|
18847
18905
|
};
|
|
18848
18906
|
|
|
18907
|
+
// dist/usage-statistics.js
|
|
18908
|
+
import { lstat, opendir } from "node:fs/promises";
|
|
18909
|
+
import os5 from "node:os";
|
|
18910
|
+
import path10 from "node:path";
|
|
18911
|
+
|
|
18912
|
+
// ../../harness-adapter/dist/usage-statistics.js
|
|
18913
|
+
import { createReadStream } from "node:fs";
|
|
18914
|
+
import { createInterface } from "node:readline";
|
|
18915
|
+
var HarnessUsageSourceChangedError = class extends Error {
|
|
18916
|
+
code = "HARNESS_USAGE_SOURCE_CHANGED";
|
|
18917
|
+
/** Plugins may bundle their own copy of this contract, so instanceof is insufficient. */
|
|
18918
|
+
static is(error51) {
|
|
18919
|
+
return typeof error51 === "object" && error51 !== null && "code" in error51 && error51.code === "HARNESS_USAGE_SOURCE_CHANGED";
|
|
18920
|
+
}
|
|
18921
|
+
};
|
|
18922
|
+
var MAX_SESSION_ID_LENGTH = 512;
|
|
18923
|
+
var MAX_CWD_LENGTH = 4096;
|
|
18924
|
+
var MAX_SESSION_TITLE_LENGTH = 200;
|
|
18925
|
+
function usageSessionTitle(value) {
|
|
18926
|
+
if (typeof value !== "string")
|
|
18927
|
+
return void 0;
|
|
18928
|
+
const normalized = value.replaceAll("\0", "").replaceAll(/\s+/gu, " ").trim();
|
|
18929
|
+
if (!normalized)
|
|
18930
|
+
return void 0;
|
|
18931
|
+
if (normalized.length <= MAX_SESSION_TITLE_LENGTH)
|
|
18932
|
+
return normalized;
|
|
18933
|
+
let title = "";
|
|
18934
|
+
for (const character of normalized) {
|
|
18935
|
+
if (title.length + character.length >= MAX_SESSION_TITLE_LENGTH)
|
|
18936
|
+
break;
|
|
18937
|
+
title += character;
|
|
18938
|
+
}
|
|
18939
|
+
return `${title.trimEnd()}…`;
|
|
18940
|
+
}
|
|
18941
|
+
function sessionIdOk(value) {
|
|
18942
|
+
return typeof value === "string" && value.length > 0 && value.length <= MAX_SESSION_ID_LENGTH;
|
|
18943
|
+
}
|
|
18944
|
+
function cwdOk(value) {
|
|
18945
|
+
return typeof value === "string" && value.length > 0 && value.length <= MAX_CWD_LENGTH && !value.includes("\0") && (value.startsWith("/") || /^[A-Za-z]:[\\/]/u.test(value) || value.startsWith("\\\\"));
|
|
18946
|
+
}
|
|
18947
|
+
function withUsageSession(entry, session) {
|
|
18948
|
+
const sessionId = sessionIdOk(session.sessionId) ? session.sessionId : void 0;
|
|
18949
|
+
const cwd = cwdOk(session.cwd) ? session.cwd : void 0;
|
|
18950
|
+
const sessionTitle = sessionId !== void 0 ? usageSessionTitle(session.title) : void 0;
|
|
18951
|
+
if (sessionId === void 0 && cwd === void 0)
|
|
18952
|
+
return entry;
|
|
18953
|
+
return {
|
|
18954
|
+
...entry,
|
|
18955
|
+
...sessionId !== void 0 ? { sessionId } : {},
|
|
18956
|
+
...cwd !== void 0 ? { cwd } : {},
|
|
18957
|
+
...sessionTitle !== void 0 ? { sessionTitle } : {}
|
|
18958
|
+
};
|
|
18959
|
+
}
|
|
18960
|
+
async function* jsonlRecords(file2, marker, signal) {
|
|
18961
|
+
const lines = createInterface({
|
|
18962
|
+
input: createReadStream(file2, { encoding: "utf8", signal }),
|
|
18963
|
+
crlfDelay: Infinity
|
|
18964
|
+
});
|
|
18965
|
+
for await (const line of lines) {
|
|
18966
|
+
if (!line.includes(marker))
|
|
18967
|
+
continue;
|
|
18968
|
+
let value;
|
|
18969
|
+
try {
|
|
18970
|
+
value = JSON.parse(line);
|
|
18971
|
+
} catch {
|
|
18972
|
+
continue;
|
|
18973
|
+
}
|
|
18974
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
18975
|
+
yield value;
|
|
18976
|
+
}
|
|
18977
|
+
}
|
|
18978
|
+
}
|
|
18979
|
+
function nativeTimeMs(value) {
|
|
18980
|
+
const time3 = typeof value === "number" ? value : typeof value === "string" ? Date.parse(value) : Number.NaN;
|
|
18981
|
+
return Number.isFinite(time3) && time3 > 0 ? Math.floor(time3) : null;
|
|
18982
|
+
}
|
|
18983
|
+
|
|
18984
|
+
// dist/usage-statistics.js
|
|
18985
|
+
function count2(value) {
|
|
18986
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : null;
|
|
18987
|
+
}
|
|
18988
|
+
function antigravityHome(environment) {
|
|
18989
|
+
return (process.platform === "win32" ? environment.USERPROFILE : environment.HOME) || os5.homedir();
|
|
18990
|
+
}
|
|
18991
|
+
function transcriptPath(brainRoot, conversationId) {
|
|
18992
|
+
return path10.join(brainRoot, conversationId, ".system_generated", "logs", "transcript.jsonl");
|
|
18993
|
+
}
|
|
18994
|
+
function isMissing(error51) {
|
|
18995
|
+
const code = error51?.code;
|
|
18996
|
+
return code === "ENOENT" || code === "ENOTDIR";
|
|
18997
|
+
}
|
|
18998
|
+
async function lstatIfPresent(target) {
|
|
18999
|
+
try {
|
|
19000
|
+
return await lstat(target);
|
|
19001
|
+
} catch (error51) {
|
|
19002
|
+
if (isMissing(error51))
|
|
19003
|
+
return null;
|
|
19004
|
+
throw error51;
|
|
19005
|
+
}
|
|
19006
|
+
}
|
|
19007
|
+
async function transcriptFingerprint(file2) {
|
|
19008
|
+
const logs = path10.dirname(file2);
|
|
19009
|
+
for (const directory of [path10.dirname(logs), logs]) {
|
|
19010
|
+
if (!(await lstatIfPresent(directory))?.isDirectory())
|
|
19011
|
+
return null;
|
|
19012
|
+
}
|
|
19013
|
+
const info = await lstatIfPresent(file2);
|
|
19014
|
+
return info?.isFile() && info.size > 0 ? `${info.ino}:${info.size}:${info.mtimeMs}` : null;
|
|
19015
|
+
}
|
|
19016
|
+
async function listTranscripts(brainRoot, signal) {
|
|
19017
|
+
signal.throwIfAborted();
|
|
19018
|
+
const conversations = await opendir(brainRoot).catch((error51) => {
|
|
19019
|
+
if (error51.code === "ENOENT")
|
|
19020
|
+
return null;
|
|
19021
|
+
throw error51;
|
|
19022
|
+
});
|
|
19023
|
+
if (!conversations)
|
|
19024
|
+
return [];
|
|
19025
|
+
const sources = [];
|
|
19026
|
+
for await (const entry of conversations) {
|
|
19027
|
+
signal.throwIfAborted();
|
|
19028
|
+
if (!entry.isDirectory())
|
|
19029
|
+
continue;
|
|
19030
|
+
const file2 = transcriptPath(brainRoot, entry.name);
|
|
19031
|
+
const fingerprint = await transcriptFingerprint(file2);
|
|
19032
|
+
if (fingerprint)
|
|
19033
|
+
sources.push({ id: file2, fingerprint });
|
|
19034
|
+
}
|
|
19035
|
+
return sources;
|
|
19036
|
+
}
|
|
19037
|
+
async function readAntigravityUsage(file2, signal) {
|
|
19038
|
+
const sessionId = path10.basename(path10.resolve(file2, "..", "..", ".."));
|
|
19039
|
+
const requests = /* @__PURE__ */ new Map();
|
|
19040
|
+
for await (const record2 of jsonlRecords(file2, '"input_tokens"', signal)) {
|
|
19041
|
+
if (record2.type !== "PLANNER_RESPONSE")
|
|
19042
|
+
continue;
|
|
19043
|
+
const step = count2(record2.step_index);
|
|
19044
|
+
const input = count2(record2.input_tokens);
|
|
19045
|
+
const output = count2(record2.output_tokens);
|
|
19046
|
+
const cached2 = count2(record2.cache_read_tokens);
|
|
19047
|
+
const at = nativeTimeMs(record2.created_at);
|
|
19048
|
+
if (step === null || input === null || output === null || at === null)
|
|
19049
|
+
continue;
|
|
19050
|
+
requests.set(step, withUsageSession({
|
|
19051
|
+
id: `${String(record2.created_at)}:${step}:${input}:${cached2 ?? "-"}:${output}`,
|
|
19052
|
+
occurredAtMs: at,
|
|
19053
|
+
inputTokens: input + (cached2 ?? 0),
|
|
19054
|
+
...cached2 !== null ? { cachedInputTokens: cached2 } : {},
|
|
19055
|
+
outputTokens: output
|
|
19056
|
+
}, { sessionId }));
|
|
19057
|
+
}
|
|
19058
|
+
return [...requests.values()];
|
|
19059
|
+
}
|
|
19060
|
+
function createAntigravityUsageStatistics(environment) {
|
|
19061
|
+
const brainRoot = nativeBrainRoot(antigravityHome(environment));
|
|
19062
|
+
let listed = /* @__PURE__ */ new Map();
|
|
19063
|
+
return Object.freeze({
|
|
19064
|
+
async listSources(signal) {
|
|
19065
|
+
const sources = await listTranscripts(brainRoot, signal);
|
|
19066
|
+
listed = new Map(sources.map(({ id, fingerprint }) => [id, fingerprint]));
|
|
19067
|
+
return sources;
|
|
19068
|
+
},
|
|
19069
|
+
async readSource(id, signal) {
|
|
19070
|
+
const expected = listed.get(id);
|
|
19071
|
+
let entries;
|
|
19072
|
+
try {
|
|
19073
|
+
entries = await readAntigravityUsage(id, signal);
|
|
19074
|
+
} catch (error51) {
|
|
19075
|
+
if (expected !== void 0 && isMissing(error51)) {
|
|
19076
|
+
throw new HarnessUsageSourceChangedError("Antigravity transcript disappeared before reading; refresh to retry");
|
|
19077
|
+
}
|
|
19078
|
+
throw error51;
|
|
19079
|
+
}
|
|
19080
|
+
if (expected !== void 0 && await transcriptFingerprint(id) !== expected) {
|
|
19081
|
+
throw new HarnessUsageSourceChangedError("Antigravity transcript changed while reading; refresh to retry");
|
|
19082
|
+
}
|
|
19083
|
+
return entries;
|
|
19084
|
+
}
|
|
19085
|
+
});
|
|
19086
|
+
}
|
|
19087
|
+
|
|
18849
19088
|
// dist/antigravity-adapter.js
|
|
18850
19089
|
var antigravityHarnessId = harnessIdSchema.parse("antigravity");
|
|
18851
19090
|
var DEFAULT_INSPECT_TIMEOUT_MS = 2e4;
|
|
18852
19091
|
var DEFAULT_PRINT_TIMEOUT = "30m";
|
|
18853
19092
|
var DEFAULT_TOOL_OUTPUT_LIMIT = 64e3;
|
|
18854
19093
|
var DEFAULT_SUBAGENT_OBSERVATION_TIMEOUT_MS = 3e4;
|
|
19094
|
+
var NATIVE_EXIT_GRACE_MS = 2e3;
|
|
19095
|
+
var DEFAULT_TURN_CLEANUP_WAIT_MS = 5e3;
|
|
18855
19096
|
var CONTEXT_USAGE_TIMEOUT_MS = 8e3;
|
|
18856
19097
|
var CONTEXT_USAGE_RETRY_MS = 100;
|
|
18857
19098
|
var TRAJECTORY_TIMEOUT_MS = 2e3;
|
|
@@ -18880,8 +19121,8 @@ function mergePendingStep(pending, step) {
|
|
|
18880
19121
|
};
|
|
18881
19122
|
}
|
|
18882
19123
|
function sameFile(left, right) {
|
|
18883
|
-
const a =
|
|
18884
|
-
const b =
|
|
19124
|
+
const a = path11.resolve(left);
|
|
19125
|
+
const b = path11.resolve(right);
|
|
18885
19126
|
return process.platform === "win32" ? a.toLowerCase() === b.toLowerCase() : a === b;
|
|
18886
19127
|
}
|
|
18887
19128
|
function resolveAntigravityContextWindow(modelId, reportedWindow) {
|
|
@@ -18909,12 +19150,28 @@ function errorMessage(error51) {
|
|
|
18909
19150
|
function invalidState(message) {
|
|
18910
19151
|
return { code: "invalidState", message, retryable: false };
|
|
18911
19152
|
}
|
|
19153
|
+
function settledWithin(promise2, timeoutMs) {
|
|
19154
|
+
return new Promise((resolve) => {
|
|
19155
|
+
const timer = setTimeout(resolve, timeoutMs);
|
|
19156
|
+
const settle = () => {
|
|
19157
|
+
clearTimeout(timer);
|
|
19158
|
+
resolve();
|
|
19159
|
+
};
|
|
19160
|
+
void promise2.then(settle, settle);
|
|
19161
|
+
});
|
|
19162
|
+
}
|
|
18912
19163
|
var ANTIGRAVITY_WORKSPACE_FILE_INSTRUCTION = "[System Instruction: When creating new files in the workspace, you MUST use the write_to_file tool. When modifying existing files, use the replace_file_content tool. CRITICAL: NEVER include ArtifactMetadata when calling write_to_file for workspace files (ArtifactMetadata is strictly reserved for artifacts in the brain directory, and providing it for workspace files causes a path validation rejection). Do NOT use terminal commands (such as Set-Content, Out-File, echo, or cat) to create or write code files. For clarification, ask_question is connected to the codexhost Desktop through a Hook. Use single-choice or text questions. The Hook returns the actual user response in its reason while blocking the native auto-skip behavior; do not retry merely because the native tool reports it was blocked.]\n\n";
|
|
18913
|
-
function
|
|
19164
|
+
function antigravityWorkingDirectoryInstruction(cwd) {
|
|
19165
|
+
return `[System Instruction: The project working directory is ${JSON.stringify(cwd)}. Run terminal commands and resolve relative file paths in this directory unless the task requires another one.]
|
|
19166
|
+
|
|
19167
|
+
`;
|
|
19168
|
+
}
|
|
19169
|
+
function formatAntigravityTurnPrompt(text, cwd) {
|
|
18914
19170
|
if (text.startsWith("/") || text.includes("ArtifactMetadata")) {
|
|
18915
19171
|
return text;
|
|
18916
19172
|
}
|
|
18917
|
-
|
|
19173
|
+
const workingDirectory = cwd ? antigravityWorkingDirectoryInstruction(cwd) : "";
|
|
19174
|
+
return `${ANTIGRAVITY_WORKSPACE_FILE_INSTRUCTION}${workingDirectory}${text}`;
|
|
18918
19175
|
}
|
|
18919
19176
|
function permissionDeniedTurnError(nativeMode, denial) {
|
|
18920
19177
|
const mode = nativeMode ? ` '${nativeMode}'` : "";
|
|
@@ -19016,14 +19273,15 @@ async function pollAntigravityContextUsage(logPath, conversationId, modelId, isD
|
|
|
19016
19273
|
}
|
|
19017
19274
|
return null;
|
|
19018
19275
|
}
|
|
19019
|
-
function hostUsage(value, modelId) {
|
|
19276
|
+
function hostUsage(value, modelId, scope) {
|
|
19020
19277
|
if (!value)
|
|
19021
19278
|
return null;
|
|
19022
19279
|
const inputTokens = safeToken(value.input_tokens);
|
|
19023
19280
|
const outputTokens = safeToken(value.output_tokens);
|
|
19024
19281
|
const reasoningOutputTokens = safeToken(value.thinking_tokens);
|
|
19025
19282
|
const totalTokens = safeToken(value.total_tokens);
|
|
19026
|
-
const
|
|
19283
|
+
const requestPromptTokens = scope === "request" && inputTokens !== void 0 ? inputTokens + (safeToken(value.cache_read_tokens) ?? 0) : void 0;
|
|
19284
|
+
const contextUsedTokens = safeToken(value.context_used_tokens ?? value.estimated_tokens_used) ?? requestPromptTokens;
|
|
19027
19285
|
const rawWindow = safeToken(value.context_window_tokens ?? value.max_context_tokens);
|
|
19028
19286
|
const contextWindowTokens = contextUsedTokens !== void 0 || rawWindow !== void 0 ? resolveAntigravityContextWindow(modelId, rawWindow) : void 0;
|
|
19029
19287
|
const usage = {
|
|
@@ -19100,6 +19358,7 @@ var AntigravitySession = class {
|
|
|
19100
19358
|
#printTimeout;
|
|
19101
19359
|
#toolOutputLimit;
|
|
19102
19360
|
#subagentObservationTimeoutMs;
|
|
19361
|
+
#turnCleanupWaitMs;
|
|
19103
19362
|
#history;
|
|
19104
19363
|
#subagentObservers = /* @__PURE__ */ new Set();
|
|
19105
19364
|
#active = null;
|
|
@@ -19126,6 +19385,7 @@ var AntigravitySession = class {
|
|
|
19126
19385
|
this.#thinkingOptionId = input.thinkingOptionId ?? input.history.thinkingOptionId;
|
|
19127
19386
|
this.#toolOutputLimit = input.toolOutputLimit;
|
|
19128
19387
|
this.#subagentObservationTimeoutMs = input.subagentObservationTimeoutMs;
|
|
19388
|
+
this.#turnCleanupWaitMs = input.turnCleanupWaitMs;
|
|
19129
19389
|
this.#onClosed = input.onClosed;
|
|
19130
19390
|
this.initialState = this.#state();
|
|
19131
19391
|
this.outputs = this.#channel.outputs;
|
|
@@ -19203,7 +19463,10 @@ var AntigravitySession = class {
|
|
|
19203
19463
|
};
|
|
19204
19464
|
}
|
|
19205
19465
|
let questions;
|
|
19206
|
-
|
|
19466
|
+
const hookDirectory = antigravityHookDirectory(this.#environment);
|
|
19467
|
+
const previousTurn = hookDirectory ? this.#questionCleanup : Promise.resolve();
|
|
19468
|
+
this.#preparingQuestions = previousTurn.then(() => AntigravityQuestionBridge.create({
|
|
19469
|
+
...hookDirectory ? { directory: hookDirectory } : {},
|
|
19207
19470
|
turnId: command.turnId,
|
|
19208
19471
|
nativeSessionId: () => this.#active?.command === command && !this.#active.cancellationRequested ? this.#nativeRef?.nativeSessionId : void 0,
|
|
19209
19472
|
schedule: (action) => {
|
|
@@ -19226,7 +19489,7 @@ var AntigravitySession = class {
|
|
|
19226
19489
|
}
|
|
19227
19490
|
this.#channel.emit(output);
|
|
19228
19491
|
}
|
|
19229
|
-
});
|
|
19492
|
+
}));
|
|
19230
19493
|
try {
|
|
19231
19494
|
questions = await this.#preparingQuestions;
|
|
19232
19495
|
} catch (error51) {
|
|
@@ -19246,7 +19509,7 @@ var AntigravitySession = class {
|
|
|
19246
19509
|
return { ok: false, error: invalidState("Antigravity Session is closed") };
|
|
19247
19510
|
}
|
|
19248
19511
|
const environment = { ...this.#environment, ...questions.environment };
|
|
19249
|
-
const logPath =
|
|
19512
|
+
const logPath = path11.join(os6.tmpdir(), `codexhost-antigravity-${randomUUID6()}.log`);
|
|
19250
19513
|
const arguments_ = [
|
|
19251
19514
|
"--input-format",
|
|
19252
19515
|
"stream-json",
|
|
@@ -19367,7 +19630,7 @@ ${line}`).slice(-8e3);
|
|
|
19367
19630
|
});
|
|
19368
19631
|
});
|
|
19369
19632
|
try {
|
|
19370
|
-
const turnPrompt = formatAntigravityTurnPrompt(text);
|
|
19633
|
+
const turnPrompt = formatAntigravityTurnPrompt(text, this.#cwd);
|
|
19371
19634
|
if (child.stdin.writable) {
|
|
19372
19635
|
child.stdin.write(`${JSON.stringify({ event: "user", message: { content: turnPrompt } })}
|
|
19373
19636
|
`, () => void 0);
|
|
@@ -19451,7 +19714,7 @@ ${line}`).slice(-8e3);
|
|
|
19451
19714
|
if (event.step_update.conversation_id !== this.#nativeRef?.nativeSessionId)
|
|
19452
19715
|
return;
|
|
19453
19716
|
await this.#handleStep(active, event.step_update);
|
|
19454
|
-
const usage = hostUsage(event.step_update.usage, active.model?.id);
|
|
19717
|
+
const usage = hostUsage(event.step_update.usage, active.model?.id, "request");
|
|
19455
19718
|
if (usage)
|
|
19456
19719
|
this.#publishUsage(active, usage);
|
|
19457
19720
|
this.#ensureContextUsage(active, event.step_update.conversation_id);
|
|
@@ -19477,7 +19740,7 @@ ${line}`).slice(-8e3);
|
|
|
19477
19740
|
});
|
|
19478
19741
|
return;
|
|
19479
19742
|
}
|
|
19480
|
-
const usage = hostUsage(event.result.usage, active.model?.id);
|
|
19743
|
+
const usage = hostUsage(event.result.usage, active.model?.id, "conversation");
|
|
19481
19744
|
if (usage)
|
|
19482
19745
|
this.#publishUsage(active, usage);
|
|
19483
19746
|
this.#ensureContextUsage(active, event.result.conversation_id);
|
|
@@ -19714,8 +19977,9 @@ ${line}`).slice(-8e3);
|
|
|
19714
19977
|
await active.subagents.settled;
|
|
19715
19978
|
if (active.process.stdin.writable)
|
|
19716
19979
|
active.process.stdin.end();
|
|
19717
|
-
const timer = setTimeout(() => active.process.kill(),
|
|
19718
|
-
await active.exited
|
|
19980
|
+
const timer = setTimeout(() => active.process.kill(), NATIVE_EXIT_GRACE_MS);
|
|
19981
|
+
await settledWithin(active.exited, NATIVE_EXIT_GRACE_MS + this.#turnCleanupWaitMs);
|
|
19982
|
+
clearTimeout(timer);
|
|
19719
19983
|
await active.questions.dispose();
|
|
19720
19984
|
this.#subagentObservers.delete(active.subagents);
|
|
19721
19985
|
}).catch(() => void 0);
|
|
@@ -19892,6 +20156,7 @@ function historySubagentState(history, id) {
|
|
|
19892
20156
|
var AntigravityAdapter = class {
|
|
19893
20157
|
commandCatalog = ANTIGRAVITY_COMMAND_CATALOG;
|
|
19894
20158
|
harnessId = antigravityHarnessId;
|
|
20159
|
+
usageStatistics;
|
|
19895
20160
|
subagents = {
|
|
19896
20161
|
readSnapshot: async (input) => {
|
|
19897
20162
|
if (this.#closed || input.parent.harnessId !== this.harnessId || !nativeSubagentIdSchema.safeParse(input.nativeSubagentId).success) {
|
|
@@ -19924,6 +20189,7 @@ var AntigravityAdapter = class {
|
|
|
19924
20189
|
#sessions = /* @__PURE__ */ new Set();
|
|
19925
20190
|
#toolOutputLimit;
|
|
19926
20191
|
#subagentObservationTimeoutMs;
|
|
20192
|
+
#turnCleanupWaitMs;
|
|
19927
20193
|
#closed = false;
|
|
19928
20194
|
#quota = null;
|
|
19929
20195
|
#quotaCwd = null;
|
|
@@ -19932,6 +20198,7 @@ var AntigravityAdapter = class {
|
|
|
19932
20198
|
constructor(options = {}) {
|
|
19933
20199
|
this.#command = options.command;
|
|
19934
20200
|
this.#environment = options.environment ?? process.env;
|
|
20201
|
+
this.usageStatistics = createAntigravityUsageStatistics(this.#environment);
|
|
19935
20202
|
this.#inspectTimeoutMs = options.inspectTimeoutMs ?? DEFAULT_INSPECT_TIMEOUT_MS;
|
|
19936
20203
|
this.#printTimeout = options.printTimeout ?? DEFAULT_PRINT_TIMEOUT;
|
|
19937
20204
|
this.#toolOutputLimit = options.toolOutputLimit ?? DEFAULT_TOOL_OUTPUT_LIMIT;
|
|
@@ -19940,12 +20207,17 @@ var AntigravityAdapter = class {
|
|
|
19940
20207
|
throw new RangeError("subagentObservationTimeoutMs must be a finite positive number");
|
|
19941
20208
|
}
|
|
19942
20209
|
this.#subagentObservationTimeoutMs = subagentObservationTimeoutMs;
|
|
20210
|
+
const turnCleanupWaitMs = options.turnCleanupWaitMs ?? DEFAULT_TURN_CLEANUP_WAIT_MS;
|
|
20211
|
+
if (!Number.isFinite(turnCleanupWaitMs) || turnCleanupWaitMs < 0) {
|
|
20212
|
+
throw new RangeError("turnCleanupWaitMs must be a finite non-negative number");
|
|
20213
|
+
}
|
|
20214
|
+
this.#turnCleanupWaitMs = turnCleanupWaitMs;
|
|
19943
20215
|
}
|
|
19944
20216
|
async inspect(input = {}) {
|
|
19945
20217
|
if (this.#closed) {
|
|
19946
20218
|
return { status: "unavailable", error: invalidState("Antigravity Adapter is closed") };
|
|
19947
20219
|
}
|
|
19948
|
-
const cwd =
|
|
20220
|
+
const cwd = path11.resolve(input.cwd ?? process.cwd());
|
|
19949
20221
|
const inFlight = this.#inspectionInFlight.get(cwd);
|
|
19950
20222
|
if (inFlight)
|
|
19951
20223
|
return inFlight;
|
|
@@ -20088,7 +20360,7 @@ var AntigravityAdapter = class {
|
|
|
20088
20360
|
}
|
|
20089
20361
|
};
|
|
20090
20362
|
}
|
|
20091
|
-
const cwd =
|
|
20363
|
+
const cwd = path11.resolve(input.cwd);
|
|
20092
20364
|
let catalog = this.#inspectionCache.get(cwd)?.catalog;
|
|
20093
20365
|
if (!catalog) {
|
|
20094
20366
|
const inspection = await this.inspect({ cwd: input.cwd });
|
|
@@ -20124,6 +20396,7 @@ var AntigravityAdapter = class {
|
|
|
20124
20396
|
...params.thinkingOptionId ? { thinkingOptionId: params.thinkingOptionId } : {},
|
|
20125
20397
|
toolOutputLimit: this.#toolOutputLimit,
|
|
20126
20398
|
subagentObservationTimeoutMs: this.#subagentObservationTimeoutMs,
|
|
20399
|
+
turnCleanupWaitMs: this.#turnCleanupWaitMs,
|
|
20127
20400
|
onClosed: () => this.#sessions.delete(session2)
|
|
20128
20401
|
});
|
|
20129
20402
|
this.#sessions.add(session2);
|
|
@@ -20160,6 +20433,7 @@ var AntigravityAdapter = class {
|
|
|
20160
20433
|
...params.thinkingOptionId ? { thinkingOptionId: params.thinkingOptionId } : {},
|
|
20161
20434
|
toolOutputLimit: this.#toolOutputLimit,
|
|
20162
20435
|
subagentObservationTimeoutMs: this.#subagentObservationTimeoutMs,
|
|
20436
|
+
turnCleanupWaitMs: this.#turnCleanupWaitMs,
|
|
20163
20437
|
onClosed: () => this.#sessions.delete(session2)
|
|
20164
20438
|
});
|
|
20165
20439
|
this.#sessions.add(session2);
|
|
@@ -20217,6 +20491,7 @@ var AntigravityAdapter = class {
|
|
|
20217
20491
|
...thinkingOptionId ? { thinkingOptionId } : {},
|
|
20218
20492
|
toolOutputLimit: this.#toolOutputLimit,
|
|
20219
20493
|
subagentObservationTimeoutMs: this.#subagentObservationTimeoutMs,
|
|
20494
|
+
turnCleanupWaitMs: this.#turnCleanupWaitMs,
|
|
20220
20495
|
onClosed: () => this.#sessions.delete(session)
|
|
20221
20496
|
});
|
|
20222
20497
|
this.#sessions.add(session);
|
|
@@ -20276,11 +20551,23 @@ function createAntigravityInstallation(environment, command, dependencies = {})
|
|
|
20276
20551
|
|
|
20277
20552
|
// dist/plugin.js
|
|
20278
20553
|
var ANTIGRAVITY_COMMAND_ENV = "CODEXHOST_ANTIGRAVITY_COMMAND";
|
|
20554
|
+
var ANTIGRAVITY_DISABLE_AUTO_UPDATE_ENV = "AGY_CLI_DISABLE_AUTO_UPDATE";
|
|
20555
|
+
function antigravityProcessEnvironment(environment, platform) {
|
|
20556
|
+
if (platform !== "win32" && platform !== "darwin")
|
|
20557
|
+
return environment;
|
|
20558
|
+
const isWindows = platform === "win32";
|
|
20559
|
+
const matchesSwitch = (name) => isWindows ? name.toUpperCase() === ANTIGRAVITY_DISABLE_AUTO_UPDATE_ENV : name === ANTIGRAVITY_DISABLE_AUTO_UPDATE_ENV;
|
|
20560
|
+
const entries = Object.entries(environment);
|
|
20561
|
+
const configured = entries.some(([name, value]) => matchesSwitch(name) && value !== void 0);
|
|
20562
|
+
const hasUndefinedSwitch = entries.some(([name, value]) => matchesSwitch(name) && value === void 0);
|
|
20563
|
+
const cleanEnvironment = hasUndefinedSwitch ? Object.fromEntries(entries.filter(([name, value]) => !matchesSwitch(name) || value !== void 0)) : environment;
|
|
20564
|
+
return configured ? cleanEnvironment : { ...cleanEnvironment, [ANTIGRAVITY_DISABLE_AUTO_UPDATE_ENV]: "true" };
|
|
20565
|
+
}
|
|
20279
20566
|
function createHarnessAdapter(context) {
|
|
20280
20567
|
const environment = { ...context.environment };
|
|
20281
20568
|
return Object.assign(new AntigravityAdapter({
|
|
20282
20569
|
...environment[ANTIGRAVITY_COMMAND_ENV] ? { command: environment[ANTIGRAVITY_COMMAND_ENV] } : {},
|
|
20283
|
-
environment
|
|
20570
|
+
environment: antigravityProcessEnvironment(environment, context.platform)
|
|
20284
20571
|
}), {
|
|
20285
20572
|
install: createHarnessInstaller(environment, {
|
|
20286
20573
|
posix: "https://antigravity.google/cli/install.sh",
|
|
@@ -20297,6 +20584,8 @@ async function warmup(adapter) {
|
|
|
20297
20584
|
}
|
|
20298
20585
|
export {
|
|
20299
20586
|
ANTIGRAVITY_COMMAND_ENV,
|
|
20587
|
+
ANTIGRAVITY_DISABLE_AUTO_UPDATE_ENV,
|
|
20588
|
+
antigravityProcessEnvironment,
|
|
20300
20589
|
createHarnessAdapter,
|
|
20301
20590
|
warmup
|
|
20302
20591
|
};
|