@codexhost/cli-linux-arm64 0.6.2 → 0.7.1
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/THIRD_PARTY_NOTICES.txt +4 -0
- package/app/codexhost-distribution.json +1 -1
- package/app/desktop-controller.mjs +18 -14
- package/app/host-runtime.mjs +665 -356
- package/app/plugins/antigravity/plugin.mjs +45 -198
- package/app/plugins/claude-code/plugin.mjs +223 -49
- package/app/plugins/codebuddy/assets/icon.svg +1 -0
- package/app/plugins/codebuddy/manifest.json +13 -0
- package/app/plugins/codebuddy/plugin.mjs +23045 -0
- package/app/plugins/cursor-cli/assets/icon.svg +1 -0
- package/app/plugins/cursor-cli/manifest.json +13 -0
- package/app/plugins/cursor-cli/plugin.mjs +22579 -0
- package/app/plugins/enabled.json +3 -1
- package/app/plugins/pi/plugin.mjs +0 -12
- package/app/renderer-extension.js +212 -62
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/licenses/Agent-Client-Protocol-SDK-LICENSE.txt +191 -0
- package/package.json +1 -1
|
@@ -15360,45 +15360,37 @@ var updateStatusResultSchema = external_exports.strictObject({
|
|
|
15360
15360
|
// ../../shared-contracts/dist/index.js
|
|
15361
15361
|
var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
|
|
15362
15362
|
|
|
15363
|
-
// ../../harness-adapter/dist/approval.js
|
|
15364
|
-
function invalidRequest(message) {
|
|
15365
|
-
return { code: "invalidRequest", message, retryable: false };
|
|
15366
|
-
}
|
|
15367
|
-
function validateHostApprovalResponse(interaction, response) {
|
|
15368
|
-
return interaction.actions.some(({ id }) => id === response.actionId) ? null : invalidRequest("Approval Response contains an undeclared action ID");
|
|
15369
|
-
}
|
|
15370
|
-
|
|
15371
15363
|
// ../../harness-adapter/dist/question.js
|
|
15372
|
-
function
|
|
15364
|
+
function invalidRequest(message) {
|
|
15373
15365
|
return { code: "invalidRequest", message, retryable: false };
|
|
15374
15366
|
}
|
|
15375
15367
|
function validateHostQuestionResponse(interaction, response) {
|
|
15376
15368
|
const questionIds = new Set(interaction.questions.map(({ id }) => id));
|
|
15377
15369
|
if (response.cancelled) {
|
|
15378
|
-
return Object.keys(response.answers).length === 0 ? null :
|
|
15370
|
+
return Object.keys(response.answers).length === 0 ? null : invalidRequest("Cancelled Question Response must not contain answers");
|
|
15379
15371
|
}
|
|
15380
15372
|
for (const answerId of Object.keys(response.answers)) {
|
|
15381
15373
|
if (!questionIds.has(answerId)) {
|
|
15382
|
-
return
|
|
15374
|
+
return invalidRequest("Question Response contains an unknown Question ID");
|
|
15383
15375
|
}
|
|
15384
15376
|
}
|
|
15385
15377
|
for (const question of interaction.questions) {
|
|
15386
15378
|
const answers = response.answers[question.id] ?? [];
|
|
15387
15379
|
if (!question.optional && answers.length === 0) {
|
|
15388
|
-
return
|
|
15380
|
+
return invalidRequest("Question Response omits a required answer");
|
|
15389
15381
|
}
|
|
15390
15382
|
if (question.type === "text") {
|
|
15391
15383
|
if (answers.length > 1) {
|
|
15392
|
-
return
|
|
15384
|
+
return invalidRequest("Text Question accepts at most one answer");
|
|
15393
15385
|
}
|
|
15394
15386
|
continue;
|
|
15395
15387
|
}
|
|
15396
15388
|
if (!question.multiple && answers.length > 1) {
|
|
15397
|
-
return
|
|
15389
|
+
return invalidRequest("Single-choice Question accepts at most one answer");
|
|
15398
15390
|
}
|
|
15399
15391
|
const declared = new Set(question.options.map(({ value }) => value));
|
|
15400
15392
|
if (!question.allowOther && answers.some((answer) => !declared.has(answer))) {
|
|
15401
|
-
return
|
|
15393
|
+
return invalidRequest("Question Response contains an undeclared choice");
|
|
15402
15394
|
}
|
|
15403
15395
|
}
|
|
15404
15396
|
return null;
|
|
@@ -16241,7 +16233,7 @@ async function forkAntigravitySession(options) {
|
|
|
16241
16233
|
}));
|
|
16242
16234
|
const model = sourceSession?.model ?? sourceHistory.model;
|
|
16243
16235
|
const thinkingOptionId = sourceSession?.thinkingOptionId ?? sourceHistory.thinkingOptionId;
|
|
16244
|
-
const permissionMode = sourceSession?.permissionMode ?? "
|
|
16236
|
+
const permissionMode = sourceSession?.permissionMode ?? "dangerously-skip-permissions";
|
|
16245
16237
|
const forkedHistory = await AntigravityHistory.createDerived({
|
|
16246
16238
|
environment: sessionEnvironment,
|
|
16247
16239
|
nativeSessionId: derivedNativeSessionId,
|
|
@@ -16366,23 +16358,13 @@ function antigravityAvailableThinkingOptions(catalog, model) {
|
|
|
16366
16358
|
}
|
|
16367
16359
|
|
|
16368
16360
|
// dist/permission-modes.js
|
|
16369
|
-
var ANTIGRAVITY_DEFAULT_PERMISSION_MODE_ID = harnessPermissionModeIdSchema.parse("
|
|
16361
|
+
var ANTIGRAVITY_DEFAULT_PERMISSION_MODE_ID = harnessPermissionModeIdSchema.parse("dangerously-skip-permissions");
|
|
16370
16362
|
var ANTIGRAVITY_PERMISSION_MODE_CATALOG = harnessPermissionModeCatalogSchema.parse({
|
|
16371
16363
|
modes: [
|
|
16372
|
-
{
|
|
16373
|
-
id: "configured",
|
|
16374
|
-
label: "Configured permissions",
|
|
16375
|
-
description: "Use Antigravity CLI permission rules; headless prompts are denied safely."
|
|
16376
|
-
},
|
|
16377
|
-
{
|
|
16378
|
-
id: "desktop-approvals",
|
|
16379
|
-
label: "Desktop approvals",
|
|
16380
|
-
description: "Ask Desktop before each parent tool action. Uses native auto-execution behind a verified, fail-closed Hook; does not use configured permission prompts."
|
|
16381
|
-
},
|
|
16382
16364
|
{
|
|
16383
16365
|
id: "dangerously-skip-permissions",
|
|
16384
16366
|
label: "Skip permissions",
|
|
16385
|
-
description: "
|
|
16367
|
+
description: "Run Antigravity CLI with --dangerously-skip-permissions. codexhost adds no tool approval or workspace restrictions.",
|
|
16386
16368
|
dangerous: true
|
|
16387
16369
|
}
|
|
16388
16370
|
],
|
|
@@ -16390,10 +16372,10 @@ var ANTIGRAVITY_PERMISSION_MODE_CATALOG = harnessPermissionModeCatalogSchema.par
|
|
|
16390
16372
|
});
|
|
16391
16373
|
function decodeAntigravityPermissionModeId(value) {
|
|
16392
16374
|
const parsed = harnessPermissionModeIdSchema.parse(value);
|
|
16393
|
-
if (parsed !== "
|
|
16394
|
-
throw new Error("Antigravity
|
|
16375
|
+
if (parsed !== "dangerously-skip-permissions") {
|
|
16376
|
+
throw new Error("Antigravity only supports Skip permissions (dangerous). Explicitly select Skip permissions to continue; codexhost does not enforce tool permissions.");
|
|
16395
16377
|
}
|
|
16396
|
-
return
|
|
16378
|
+
return "dangerously-skip-permissions";
|
|
16397
16379
|
}
|
|
16398
16380
|
|
|
16399
16381
|
// dist/rollback.js
|
|
@@ -16465,7 +16447,7 @@ async function rollbackAntigravityLastTurn(options) {
|
|
|
16465
16447
|
}));
|
|
16466
16448
|
const model = sourceSession?.model ?? sourceHistory.model;
|
|
16467
16449
|
const thinkingOptionId = sourceSession?.thinkingOptionId ?? sourceHistory.thinkingOptionId;
|
|
16468
|
-
const permissionMode = sourceSession?.permissionMode ?? "
|
|
16450
|
+
const permissionMode = sourceSession?.permissionMode ?? "dangerously-skip-permissions";
|
|
16469
16451
|
const rolledBackHistory = await AntigravityHistory.createDerived({
|
|
16470
16452
|
environment: sessionEnvironment,
|
|
16471
16453
|
nativeSessionId: derivedNativeSessionId,
|
|
@@ -17113,9 +17095,15 @@ function parseBuckets(groups) {
|
|
|
17113
17095
|
}
|
|
17114
17096
|
function leadingBucket(buckets) {
|
|
17115
17097
|
return [...buckets].sort((left, right) => {
|
|
17116
|
-
|
|
17098
|
+
const leftIsFiveHour = periodTypeFrom(left.window) === "five_hour";
|
|
17099
|
+
const rightIsFiveHour = periodTypeFrom(right.window) === "five_hour";
|
|
17100
|
+
if (leftIsFiveHour !== rightIsFiveHour) {
|
|
17101
|
+
return Number(rightIsFiveHour) - Number(leftIsFiveHour);
|
|
17102
|
+
}
|
|
17103
|
+
if (right.usagePercent !== left.usagePercent) {
|
|
17117
17104
|
return right.usagePercent - left.usagePercent;
|
|
17118
|
-
|
|
17105
|
+
}
|
|
17106
|
+
return 0;
|
|
17119
17107
|
})[0];
|
|
17120
17108
|
}
|
|
17121
17109
|
function parseAntigravityUsageCommand(command, fetchedAt = (/* @__PURE__ */ new Date()).toISOString()) {
|
|
@@ -17207,9 +17195,7 @@ process.stdin.on("end", () => {
|
|
|
17207
17195
|
target.pathname !== "/question" || target.username || target.password) {
|
|
17208
17196
|
return unavailable();
|
|
17209
17197
|
}
|
|
17210
|
-
|
|
17211
|
-
const approval = process.env.CODEXHOST_AGY_QUESTION_APPROVALS === "1" &&
|
|
17212
|
-
payload.toolCall && payload.toolCall.name !== "ask_question";
|
|
17198
|
+
JSON.parse(input);
|
|
17213
17199
|
request = http.request(target, {
|
|
17214
17200
|
method: "POST",
|
|
17215
17201
|
headers: {
|
|
@@ -17230,7 +17216,7 @@ process.stdin.on("end", () => {
|
|
|
17230
17216
|
try {
|
|
17231
17217
|
const value = JSON.parse(body);
|
|
17232
17218
|
if (response.statusCode !== 200 ||
|
|
17233
|
-
|
|
17219
|
+
value.decision !== "deny" ||
|
|
17234
17220
|
typeof value.reason !== "string") return unavailable();
|
|
17235
17221
|
finish(value);
|
|
17236
17222
|
} catch { unavailable(); }
|
|
@@ -17265,23 +17251,11 @@ var responseSchema = external_exports.object({
|
|
|
17265
17251
|
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string().max(8e3)).max(30)),
|
|
17266
17252
|
cancelled: external_exports.boolean().optional()
|
|
17267
17253
|
}).strict();
|
|
17268
|
-
|
|
17269
|
-
conversationId: external_exports.string().min(1).max(128),
|
|
17270
|
-
stepIdx: external_exports.number().int().nonnegative(),
|
|
17271
|
-
toolCall: external_exports.object({
|
|
17272
|
-
name: external_exports.string().min(1).max(256).refine((name) => name !== "ask_question"),
|
|
17273
|
-
args: jsonValueSchema
|
|
17274
|
-
})
|
|
17275
|
-
});
|
|
17276
|
-
var approvalResponseSchema = external_exports.strictObject({
|
|
17277
|
-
type: external_exports.literal("approval"),
|
|
17278
|
-
actionId: external_exports.string()
|
|
17279
|
-
});
|
|
17280
|
-
function deny(response, reason, status = 200, decision = "deny") {
|
|
17254
|
+
function deny(response, reason, status = 200) {
|
|
17281
17255
|
if (response.destroyed || response.writableEnded)
|
|
17282
17256
|
return;
|
|
17283
17257
|
response.writeHead(status, { "content-type": "application/json", connection: "close" });
|
|
17284
|
-
response.end(JSON.stringify({ decision, reason }));
|
|
17258
|
+
response.end(JSON.stringify({ decision: "deny", reason }));
|
|
17285
17259
|
}
|
|
17286
17260
|
var AntigravityQuestionBridge = class _AntigravityQuestionBridge {
|
|
17287
17261
|
directory;
|
|
@@ -17297,14 +17271,12 @@ var AntigravityQuestionBridge = class _AntigravityQuestionBridge {
|
|
|
17297
17271
|
#seenSteps = /* @__PURE__ */ new Set();
|
|
17298
17272
|
#stopped = false;
|
|
17299
17273
|
#disposal = null;
|
|
17300
|
-
#hookCommand = "";
|
|
17301
17274
|
constructor(directory, options) {
|
|
17302
17275
|
this.directory = directory;
|
|
17303
17276
|
this.#options = options;
|
|
17304
17277
|
this.environment = {
|
|
17305
17278
|
CODEXHOST_AGY_QUESTION_TOKEN: this.#token,
|
|
17306
|
-
CODEXHOST_AGY_QUESTION_TIMEOUT_MS: String(options.timeoutMs ?? QUESTION_TIMEOUT_MS)
|
|
17307
|
-
CODEXHOST_AGY_QUESTION_APPROVALS: options.approvals ? "1" : "0"
|
|
17279
|
+
CODEXHOST_AGY_QUESTION_TIMEOUT_MS: String(options.timeoutMs ?? QUESTION_TIMEOUT_MS)
|
|
17308
17280
|
};
|
|
17309
17281
|
this.#server.on("request", (request, response) => this.#receive(request, response));
|
|
17310
17282
|
}
|
|
@@ -17331,12 +17303,11 @@ var AntigravityQuestionBridge = class _AntigravityQuestionBridge {
|
|
|
17331
17303
|
bridge.environment.CODEXHOST_AGY_QUESTION_NODE = `"${process.execPath.replaceAll("\\", "/")}"`;
|
|
17332
17304
|
bridge.environment.CODEXHOST_AGY_QUESTION_CLIENT = `"${client.replaceAll("\\", "/")}"`;
|
|
17333
17305
|
const command = process.platform === "win32" ? "%CODEXHOST_AGY_QUESTION_NODE% %CODEXHOST_AGY_QUESTION_CLIENT%" : `${quote(process.execPath)} ${quote(client)}`;
|
|
17334
|
-
bridge.#hookCommand = command;
|
|
17335
17306
|
await writeFile2(path7.join(directory, ".agents", "hooks.json"), JSON.stringify({
|
|
17336
17307
|
"codexhost-question-bridge": {
|
|
17337
17308
|
PreToolUse: [
|
|
17338
17309
|
{
|
|
17339
|
-
matcher:
|
|
17310
|
+
matcher: "^ask_question$",
|
|
17340
17311
|
hooks: [
|
|
17341
17312
|
{
|
|
17342
17313
|
type: "command",
|
|
@@ -17354,38 +17325,6 @@ var AntigravityQuestionBridge = class _AntigravityQuestionBridge {
|
|
|
17354
17325
|
throw error51;
|
|
17355
17326
|
}
|
|
17356
17327
|
}
|
|
17357
|
-
verifyApprovalHooks(stdout) {
|
|
17358
|
-
if (!this.#options.approvals)
|
|
17359
|
-
return false;
|
|
17360
|
-
const hookSchema = external_exports.object({
|
|
17361
|
-
event: external_exports.literal("command_result"),
|
|
17362
|
-
command: external_exports.object({
|
|
17363
|
-
name: external_exports.literal("hooks"),
|
|
17364
|
-
data: external_exports.object({
|
|
17365
|
-
hooks: external_exports.array(external_exports.object({
|
|
17366
|
-
name: external_exports.string(),
|
|
17367
|
-
enabled: external_exports.boolean(),
|
|
17368
|
-
source: external_exports.string(),
|
|
17369
|
-
actions: external_exports.array(external_exports.object({
|
|
17370
|
-
event: external_exports.string(),
|
|
17371
|
-
matcher: external_exports.string(),
|
|
17372
|
-
command: external_exports.string()
|
|
17373
|
-
}))
|
|
17374
|
-
}))
|
|
17375
|
-
})
|
|
17376
|
-
})
|
|
17377
|
-
});
|
|
17378
|
-
for (const line of stdout.split("\n")) {
|
|
17379
|
-
try {
|
|
17380
|
-
const parsed = hookSchema.safeParse(JSON.parse(line));
|
|
17381
|
-
if (!parsed.success)
|
|
17382
|
-
continue;
|
|
17383
|
-
return parsed.data.command.data.hooks.some((hook) => hook.name === "codexhost-question-bridge" && hook.enabled && path7.resolve(hook.source) === path7.join(this.directory, ".agents", "hooks.json") && hook.actions.some((action) => action.event === "PreToolUse" && action.matcher === ".*" && action.command === this.#hookCommand));
|
|
17384
|
-
} catch {
|
|
17385
|
-
}
|
|
17386
|
-
}
|
|
17387
|
-
return false;
|
|
17388
|
-
}
|
|
17389
17328
|
#receive(request, response) {
|
|
17390
17329
|
const auth = Buffer.from(request.headers.authorization ?? "");
|
|
17391
17330
|
const expected = Buffer.from(`Bearer ${this.#token}`);
|
|
@@ -17419,13 +17358,6 @@ var AntigravityQuestionBridge = class _AntigravityQuestionBridge {
|
|
|
17419
17358
|
return;
|
|
17420
17359
|
}
|
|
17421
17360
|
if (!parsed.success) {
|
|
17422
|
-
if (this.#options.approvals) {
|
|
17423
|
-
const approval = approvalRequestSchema.safeParse(JSON.parse(body));
|
|
17424
|
-
if (approval.success) {
|
|
17425
|
-
this.#options.schedule(() => this.#approve(approval.data, response));
|
|
17426
|
-
return;
|
|
17427
|
-
}
|
|
17428
|
-
}
|
|
17429
17361
|
deny(response, "Invalid question payload", 400);
|
|
17430
17362
|
return;
|
|
17431
17363
|
}
|
|
@@ -17433,52 +17365,6 @@ var AntigravityQuestionBridge = class _AntigravityQuestionBridge {
|
|
|
17433
17365
|
this.#options.schedule(() => this.#ask(payload, response));
|
|
17434
17366
|
});
|
|
17435
17367
|
}
|
|
17436
|
-
#approve(payload, response) {
|
|
17437
|
-
if (this.#stopped || response.destroyed || payload.conversationId !== this.#options.nativeSessionId() && !this.#options.ownsApprovalSession?.(payload.conversationId)) {
|
|
17438
|
-
deny(response, "Tool approval does not belong to the active codexhost Turn.");
|
|
17439
|
-
return;
|
|
17440
|
-
}
|
|
17441
|
-
if (payload.toolCall.name === "ask_permission") {
|
|
17442
|
-
deny(response, "Desktop approves actual tool actions. Call the intended tool directly instead of ask_permission.");
|
|
17443
|
-
return;
|
|
17444
|
-
}
|
|
17445
|
-
const stepKey = `${payload.conversationId}:${payload.stepIdx}`;
|
|
17446
|
-
if (this.#seenSteps.has(stepKey) || this.#seenSteps.size >= 128) {
|
|
17447
|
-
deny(response, "Duplicate or overlapping tool approval. No permission was granted.");
|
|
17448
|
-
return;
|
|
17449
|
-
}
|
|
17450
|
-
this.#seenSteps.add(stepKey);
|
|
17451
|
-
const interaction = {
|
|
17452
|
-
type: "approval",
|
|
17453
|
-
interactionId: hostInteractionIdSchema.parse(randomUUID4()),
|
|
17454
|
-
turnId: this.#options.turnId,
|
|
17455
|
-
title: `Antigravity: ${payload.toolCall.name}`,
|
|
17456
|
-
description: `Tool: ${payload.toolCall.name}
|
|
17457
|
-
Session: ${payload.conversationId}
|
|
17458
|
-
Arguments:
|
|
17459
|
-
${JSON.stringify(payload.toolCall.args, null, 2)}`,
|
|
17460
|
-
subject: { type: "nativeAction" },
|
|
17461
|
-
actions: [
|
|
17462
|
-
{ id: "allow-once", label: "Allow once", effect: "allowOnce" },
|
|
17463
|
-
{ id: "deny", label: "Deny", effect: "deny" }
|
|
17464
|
-
]
|
|
17465
|
-
};
|
|
17466
|
-
const pending = {
|
|
17467
|
-
interaction,
|
|
17468
|
-
response,
|
|
17469
|
-
expiresAt: Date.now() + (this.#options.timeoutMs ?? QUESTION_TIMEOUT_MS),
|
|
17470
|
-
timer: setTimeout(() => {
|
|
17471
|
-
this.#finish(pending, "expired", "Tool approval expired. No permission was granted.");
|
|
17472
|
-
}, this.#options.timeoutMs ?? QUESTION_TIMEOUT_MS)
|
|
17473
|
-
};
|
|
17474
|
-
this.#pending.set(interaction.interactionId, pending);
|
|
17475
|
-
response.on("close", () => {
|
|
17476
|
-
if (!response.writableFinished) {
|
|
17477
|
-
this.#finish(pending, "cancelled", "Tool approval connection closed. No permission was granted.");
|
|
17478
|
-
}
|
|
17479
|
-
});
|
|
17480
|
-
this.#options.emit({ kind: "interaction", interaction });
|
|
17481
|
-
}
|
|
17482
17368
|
#ask(payload, response) {
|
|
17483
17369
|
if (this.#stopped || response.destroyed || payload.conversationId !== this.#options.nativeSessionId()) {
|
|
17484
17370
|
deny(response, "This question does not belong to the active codexhost Turn. No answer was received.");
|
|
@@ -17554,27 +17440,12 @@ ${JSON.stringify(payload.toolCall.args, null, 2)}`,
|
|
|
17554
17440
|
};
|
|
17555
17441
|
}
|
|
17556
17442
|
if (Date.now() >= pending.expiresAt) {
|
|
17557
|
-
this.#finish(pending, "expired",
|
|
17443
|
+
this.#finish(pending, "expired", EXPIRED_REASON);
|
|
17558
17444
|
return {
|
|
17559
17445
|
ok: false,
|
|
17560
17446
|
error: { code: "invalidState", message: "Question has expired", retryable: false }
|
|
17561
17447
|
};
|
|
17562
17448
|
}
|
|
17563
|
-
if (pending.interaction.type === "approval") {
|
|
17564
|
-
const parsed2 = approvalResponseSchema.safeParse(command.response);
|
|
17565
|
-
if (!parsed2.success) {
|
|
17566
|
-
return {
|
|
17567
|
-
ok: false,
|
|
17568
|
-
error: { code: "invalidRequest", message: "Invalid Approval response", retryable: false }
|
|
17569
|
-
};
|
|
17570
|
-
}
|
|
17571
|
-
const error52 = validateHostApprovalResponse(pending.interaction, parsed2.data);
|
|
17572
|
-
if (error52)
|
|
17573
|
-
return { ok: false, error: error52 };
|
|
17574
|
-
const allowed = parsed2.data.actionId === "allow-once";
|
|
17575
|
-
this.#finish(pending, "responded", allowed ? "User approved this tool call once." : "User denied this tool call.", allowed ? "allow" : "deny");
|
|
17576
|
-
return { ok: true, value: { accepted: true } };
|
|
17577
|
-
}
|
|
17578
17449
|
const parsed = responseSchema.safeParse(command.response);
|
|
17579
17450
|
if (!parsed.success) {
|
|
17580
17451
|
return {
|
|
@@ -17610,11 +17481,11 @@ ${JSON.stringify(payload.toolCall.args, null, 2)}`,
|
|
|
17610
17481
|
this.#finish(pending, parsed.data.cancelled ? "cancelled" : "responded", reason);
|
|
17611
17482
|
return { ok: true, value: { accepted: true } };
|
|
17612
17483
|
}
|
|
17613
|
-
#finish(pending, reason, text
|
|
17484
|
+
#finish(pending, reason, text) {
|
|
17614
17485
|
if (!this.#pending.delete(pending.interaction.interactionId))
|
|
17615
17486
|
return;
|
|
17616
17487
|
clearTimeout(pending.timer);
|
|
17617
|
-
deny(pending.response, text
|
|
17488
|
+
deny(pending.response, text);
|
|
17618
17489
|
this.#options.emit({
|
|
17619
17490
|
kind: "event",
|
|
17620
17491
|
event: {
|
|
@@ -17645,7 +17516,7 @@ ${JSON.stringify(payload.toolCall.args, null, 2)}`,
|
|
|
17645
17516
|
return;
|
|
17646
17517
|
this.#stopped = true;
|
|
17647
17518
|
for (const pending of this.#pending.values()) {
|
|
17648
|
-
this.#finish(pending, "cancelled",
|
|
17519
|
+
this.#finish(pending, "cancelled", "The codexhost Turn ended before an answer was received. Do not infer a user choice.");
|
|
17649
17520
|
}
|
|
17650
17521
|
}
|
|
17651
17522
|
dispose() {
|
|
@@ -18183,7 +18054,7 @@ function permissionDeniedTurnError(nativeMode, denial) {
|
|
|
18183
18054
|
const mode = nativeMode ? ` '${nativeMode}'` : "";
|
|
18184
18055
|
return {
|
|
18185
18056
|
code: "nativeFailure",
|
|
18186
|
-
message: `Antigravity denied a tool call under its${mode} permission mode and produced no response.
|
|
18057
|
+
message: `Antigravity denied a tool call under its${mode} permission mode and produced no response. codexhost uses native Skip permissions and does not enforce tool permissions. Check Antigravity CLI diagnostics and native Hooks for the denial; Desktop approvals and Configured permissions are not supported.`,
|
|
18187
18058
|
retryable: false,
|
|
18188
18059
|
diagnostic: sanitizeDiagnosticTail(denial)
|
|
18189
18060
|
};
|
|
@@ -18459,8 +18330,6 @@ var AntigravitySession = class {
|
|
|
18459
18330
|
}
|
|
18460
18331
|
let questions;
|
|
18461
18332
|
this.#preparingQuestions = AntigravityQuestionBridge.create({
|
|
18462
|
-
approvals: this.#permissionMode === "desktop-approvals",
|
|
18463
|
-
ownsApprovalSession: (id) => this.#active?.command === command && !this.#active.cancellationRequested && this.#active.subagents.state(id) !== void 0,
|
|
18464
18333
|
turnId: command.turnId,
|
|
18465
18334
|
nativeSessionId: () => this.#active?.command === command && !this.#active.cancellationRequested ? this.#nativeRef?.nativeSessionId : void 0,
|
|
18466
18335
|
schedule: (action) => {
|
|
@@ -18483,26 +18352,6 @@ var AntigravitySession = class {
|
|
|
18483
18352
|
}
|
|
18484
18353
|
this.#channel.emit(output);
|
|
18485
18354
|
}
|
|
18486
|
-
}).then(async (bridge) => {
|
|
18487
|
-
if (this.#permissionMode !== "desktop-approvals")
|
|
18488
|
-
return bridge;
|
|
18489
|
-
try {
|
|
18490
|
-
const { stdout } = await runBuffered(this.#executable, [
|
|
18491
|
-
"--add-dir",
|
|
18492
|
-
this.#cwd,
|
|
18493
|
-
"--add-dir",
|
|
18494
|
-
bridge.directory,
|
|
18495
|
-
"--print=/hooks",
|
|
18496
|
-
"--output-format",
|
|
18497
|
-
"stream-json"
|
|
18498
|
-
], this.#cwd, { ...this.#environment, ...bridge.environment }, DEFAULT_INSPECT_TIMEOUT_MS);
|
|
18499
|
-
if (!bridge.verifyApprovalHooks(stdout))
|
|
18500
|
-
throw new Error("Desktop approval Hook was not loaded");
|
|
18501
|
-
return bridge;
|
|
18502
|
-
} catch {
|
|
18503
|
-
await bridge.dispose();
|
|
18504
|
-
throw new Error("Desktop approval Hook verification failed; no tools were started");
|
|
18505
|
-
}
|
|
18506
18355
|
});
|
|
18507
18356
|
try {
|
|
18508
18357
|
questions = await this.#preparingQuestions;
|
|
@@ -18535,9 +18384,7 @@ var AntigravitySession = class {
|
|
|
18535
18384
|
if (this.#nativeRef)
|
|
18536
18385
|
arguments_.unshift("--conversation", this.#nativeRef.nativeSessionId);
|
|
18537
18386
|
arguments_.push(...antigravityModelArguments(this.#model, this.#thinkingOptionId));
|
|
18538
|
-
|
|
18539
|
-
arguments_.push("--dangerously-skip-permissions");
|
|
18540
|
-
}
|
|
18387
|
+
arguments_.push("--dangerously-skip-permissions");
|
|
18541
18388
|
arguments_.push("--add-dir", this.#cwd);
|
|
18542
18389
|
arguments_.push("--add-dir", questions.directory);
|
|
18543
18390
|
arguments_.push("--log-file", logPath);
|
|
@@ -19319,6 +19166,17 @@ var AntigravityAdapter = class {
|
|
|
19319
19166
|
async open(input) {
|
|
19320
19167
|
if (this.#closed)
|
|
19321
19168
|
return { ok: false, error: invalidState("Antigravity Adapter is closed") };
|
|
19169
|
+
let permissionMode = "dangerously-skip-permissions";
|
|
19170
|
+
if (input.kind !== "fork" && input.permissionModeId) {
|
|
19171
|
+
try {
|
|
19172
|
+
permissionMode = decodeAntigravityPermissionModeId(input.permissionModeId);
|
|
19173
|
+
} catch (error51) {
|
|
19174
|
+
return {
|
|
19175
|
+
ok: false,
|
|
19176
|
+
error: { code: "invalidRequest", message: errorMessage(error51), retryable: false }
|
|
19177
|
+
};
|
|
19178
|
+
}
|
|
19179
|
+
}
|
|
19322
19180
|
if (!input.cwd) {
|
|
19323
19181
|
return {
|
|
19324
19182
|
ok: false,
|
|
@@ -19430,17 +19288,6 @@ var AntigravityAdapter = class {
|
|
|
19430
19288
|
};
|
|
19431
19289
|
}
|
|
19432
19290
|
}
|
|
19433
|
-
let permissionMode = "configured";
|
|
19434
|
-
if (input.kind === "create" && input.permissionModeId) {
|
|
19435
|
-
try {
|
|
19436
|
-
permissionMode = decodeAntigravityPermissionModeId(input.permissionModeId);
|
|
19437
|
-
} catch (error51) {
|
|
19438
|
-
return {
|
|
19439
|
-
ok: false,
|
|
19440
|
-
error: { code: "invalidRequest", message: errorMessage(error51), retryable: false }
|
|
19441
|
-
};
|
|
19442
|
-
}
|
|
19443
|
-
}
|
|
19444
19291
|
const sessionEnvironment = { ...this.#environment, ...input.environment ?? {} };
|
|
19445
19292
|
const history = await AntigravityHistory.open({
|
|
19446
19293
|
environment: sessionEnvironment,
|