@liberseek/boft-cli-win32-arm64 0.6.7 → 0.6.9
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 +8 -0
- package/app/codexhost-distribution.json +1 -1
- package/app/desktop-controller.mjs +137 -36
- package/app/host-runtime.mjs +4164 -3710
- package/app/plugins/antigravity/plugin.mjs +71 -244
- package/app/plugins/claude-code/plugin.mjs +271 -104
- package/app/plugins/codebuddy/assets/icon.svg +1 -0
- package/app/plugins/codebuddy/manifest.json +13 -0
- package/app/plugins/codebuddy/plugin.mjs +23159 -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 +22693 -0
- package/app/plugins/deepseek-harness/plugin.mjs +26 -46
- package/app/plugins/enabled.json +3 -1
- package/app/plugins/grok/plugin.mjs +26 -46
- package/app/plugins/hermes/plugin.mjs +268 -92
- package/app/plugins/kiro-cli/plugin.mjs +26 -46
- package/app/plugins/muse/plugin.mjs +26 -46
- package/app/plugins/omp/plugin.mjs +26 -46
- package/app/plugins/opencode/plugin.mjs +50 -51
- package/app/plugins/pi/plugin.mjs +26 -58
- package/app/renderer-extension.js +858 -1145
- package/bin/boft.exe +0 -0
- package/libexec/boft-node-repl.exe +0 -0
- package/libexec/boft-shim.exe +0 -0
- package/libexec/boft-updater.exe +0 -0
- package/licenses/Agent-Client-Protocol-SDK-LICENSE.txt +191 -0
- package/licenses/opencodex-LICENSE.txt +21 -0
- package/package.json +1 -1
|
@@ -14651,12 +14651,21 @@ var harnessAccountSnapshotSchema = external_exports.object({
|
|
|
14651
14651
|
plan: external_exports.string().trim().min(1).max(128).optional(),
|
|
14652
14652
|
credits: accountCreditsSnapshotSchema
|
|
14653
14653
|
}).strict();
|
|
14654
|
-
var
|
|
14654
|
+
var harnessAccountIdentityShape = {
|
|
14655
|
+
harnessId: harnessIdSchema,
|
|
14656
|
+
harnessName: external_exports.string().trim().min(1).max(128)
|
|
14657
|
+
};
|
|
14658
|
+
var harnessAccountSourceSchema = external_exports.object(harnessAccountIdentityShape).strict();
|
|
14659
|
+
var harnessAccountSourceListParamsSchema = external_exports.object({}).strict();
|
|
14660
|
+
var harnessAccountSourceListResultSchema = external_exports.object({ sources: external_exports.array(harnessAccountSourceSchema).max(128) }).strict();
|
|
14661
|
+
var harnessAccountInspectParamsSchema = external_exports.object({ harnessId: harnessIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
14662
|
+
var harnessAccountInspectResultSchema = external_exports.object({
|
|
14663
|
+
...harnessAccountIdentityShape,
|
|
14664
|
+
account: harnessAccountSnapshotSchema.nullable()
|
|
14665
|
+
}).strict();
|
|
14666
|
+
var harnessAccountListParamsSchema = external_exports.object({ refresh: external_exports.boolean().optional() }).strict();
|
|
14655
14667
|
var harnessAccountListResultSchema = external_exports.object({
|
|
14656
|
-
accounts: external_exports.array(harnessAccountSnapshotSchema.extend(
|
|
14657
|
-
harnessId: harnessIdSchema,
|
|
14658
|
-
harnessName: external_exports.string().min(1)
|
|
14659
|
-
})).max(128)
|
|
14668
|
+
accounts: external_exports.array(harnessAccountSnapshotSchema.extend(harnessAccountIdentityShape)).max(128)
|
|
14660
14669
|
}).strict();
|
|
14661
14670
|
|
|
14662
14671
|
// ../../shared-contracts/dist/json-value.js
|
|
@@ -14952,7 +14961,6 @@ var threadInspectionParamsSchema = external_exports.object({
|
|
|
14952
14961
|
}).strict();
|
|
14953
14962
|
var codexThreadInspectionSchema = external_exports.object({
|
|
14954
14963
|
owner: external_exports.literal("codex"),
|
|
14955
|
-
accountId: nonBlankTextSchema2.optional(),
|
|
14956
14964
|
locked: external_exports.literal(true)
|
|
14957
14965
|
}).strict();
|
|
14958
14966
|
var externalThreadInspectionSchema = external_exports.object({
|
|
@@ -15094,53 +15102,25 @@ var codexAccountSchema = external_exports.object({
|
|
|
15094
15102
|
label: nonBlankTextSchema3.max(256),
|
|
15095
15103
|
email: external_exports.string().email().max(320).optional(),
|
|
15096
15104
|
planType: codexAccountPlanTypeSchema.optional(),
|
|
15097
|
-
codexHome: nonBlankTextSchema3.max(16384),
|
|
15098
|
-
active: external_exports.boolean(),
|
|
15099
|
-
isDefault: external_exports.boolean(),
|
|
15100
15105
|
authKind: codexAccountAuthKindSchema.optional(),
|
|
15101
15106
|
authIdentity: nonBlankTextSchema3.max(256).optional()
|
|
15102
15107
|
}).strict();
|
|
15103
|
-
var
|
|
15104
|
-
var
|
|
15105
|
-
|
|
15106
|
-
|
|
15107
|
-
|
|
15108
|
-
|
|
15109
|
-
|
|
15110
|
-
|
|
15111
|
-
accountId: accountIdSchema,
|
|
15112
|
-
loginId: nonBlankTextSchema3.max(1024),
|
|
15113
|
-
verificationUrl: external_exports.string().url().max(16384),
|
|
15114
|
-
userCode: nonBlankTextSchema3.max(1024)
|
|
15115
|
-
}).strict();
|
|
15116
|
-
var codexAccountLoginCancelParamsSchema = external_exports.object({ accountId: accountIdSchema.optional(), loginId: nonBlankTextSchema3.max(1024) }).strict();
|
|
15117
|
-
var codexAccountLoginCancelResultSchema = external_exports.object({ cancelled: external_exports.boolean() }).strict();
|
|
15118
|
-
var codexAccountLoginCompletedSchema = external_exports.object({
|
|
15119
|
-
accountId: accountIdSchema,
|
|
15120
|
-
loginId: nonBlankTextSchema3.max(1024),
|
|
15121
|
-
success: external_exports.boolean(),
|
|
15122
|
-
error: external_exports.string().max(4096).nullable()
|
|
15108
|
+
var codexAccountPhaseSchema = external_exports.enum(["ready", "unavailable"]);
|
|
15109
|
+
var codexAccountListResultSchema = external_exports.object({
|
|
15110
|
+
version: external_exports.literal(2),
|
|
15111
|
+
currentAccountId: accountIdSchema.nullable(),
|
|
15112
|
+
phase: codexAccountPhaseSchema,
|
|
15113
|
+
revision: external_exports.number().int().nonnegative(),
|
|
15114
|
+
instanceId: nonBlankTextSchema3.max(1024).optional(),
|
|
15115
|
+
accounts: external_exports.array(codexAccountSchema).max(1)
|
|
15123
15116
|
}).strict();
|
|
15124
|
-
var codexAccountUsageParamsSchema = external_exports.object({ accountId: accountIdSchema }).strict();
|
|
15117
|
+
var codexAccountUsageParamsSchema = external_exports.object({ accountId: accountIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
15125
15118
|
var codexAccountUsageResultSchema = external_exports.object({
|
|
15126
15119
|
accountId: accountIdSchema,
|
|
15127
15120
|
usage: threadUsageSnapshotSchema.nullable(),
|
|
15128
|
-
accountCredits: accountCreditsSnapshotSchema.optional()
|
|
15129
|
-
|
|
15130
|
-
|
|
15131
|
-
accountId: accountIdSchema,
|
|
15132
|
-
idempotencyKey: external_exports.string().uuid().optional()
|
|
15133
|
-
}).strict();
|
|
15134
|
-
var codexAccountResetCreditConsumeOutcomeSchema = external_exports.enum([
|
|
15135
|
-
"reset",
|
|
15136
|
-
"nothingToReset",
|
|
15137
|
-
"noCredit",
|
|
15138
|
-
"alreadyRedeemed"
|
|
15139
|
-
]);
|
|
15140
|
-
var codexAccountResetCreditConsumeResultSchema = external_exports.object({
|
|
15141
|
-
accountId: accountIdSchema,
|
|
15142
|
-
outcome: codexAccountResetCreditConsumeOutcomeSchema,
|
|
15143
|
-
accountCredits: accountCreditsSnapshotSchema.optional()
|
|
15121
|
+
accountCredits: accountCreditsSnapshotSchema.optional(),
|
|
15122
|
+
freshness: external_exports.enum(["live", "cached"]),
|
|
15123
|
+
observedAt: external_exports.string().datetime().nullable()
|
|
15144
15124
|
}).strict();
|
|
15145
15125
|
|
|
15146
15126
|
// ../../shared-contracts/dist/harness-session-import.js
|
|
@@ -15384,45 +15364,37 @@ var updateStatusResultSchema = external_exports.strictObject({
|
|
|
15384
15364
|
// ../../shared-contracts/dist/index.js
|
|
15385
15365
|
var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
|
|
15386
15366
|
|
|
15387
|
-
// ../../harness-adapter/dist/approval.js
|
|
15388
|
-
function invalidRequest(message) {
|
|
15389
|
-
return { code: "invalidRequest", message, retryable: false };
|
|
15390
|
-
}
|
|
15391
|
-
function validateHostApprovalResponse(interaction, response) {
|
|
15392
|
-
return interaction.actions.some(({ id }) => id === response.actionId) ? null : invalidRequest("Approval Response contains an undeclared action ID");
|
|
15393
|
-
}
|
|
15394
|
-
|
|
15395
15367
|
// ../../harness-adapter/dist/question.js
|
|
15396
|
-
function
|
|
15368
|
+
function invalidRequest(message) {
|
|
15397
15369
|
return { code: "invalidRequest", message, retryable: false };
|
|
15398
15370
|
}
|
|
15399
15371
|
function validateHostQuestionResponse(interaction, response) {
|
|
15400
15372
|
const questionIds = new Set(interaction.questions.map(({ id }) => id));
|
|
15401
15373
|
if (response.cancelled) {
|
|
15402
|
-
return Object.keys(response.answers).length === 0 ? null :
|
|
15374
|
+
return Object.keys(response.answers).length === 0 ? null : invalidRequest("Cancelled Question Response must not contain answers");
|
|
15403
15375
|
}
|
|
15404
15376
|
for (const answerId of Object.keys(response.answers)) {
|
|
15405
15377
|
if (!questionIds.has(answerId)) {
|
|
15406
|
-
return
|
|
15378
|
+
return invalidRequest("Question Response contains an unknown Question ID");
|
|
15407
15379
|
}
|
|
15408
15380
|
}
|
|
15409
15381
|
for (const question of interaction.questions) {
|
|
15410
15382
|
const answers = response.answers[question.id] ?? [];
|
|
15411
15383
|
if (!question.optional && answers.length === 0) {
|
|
15412
|
-
return
|
|
15384
|
+
return invalidRequest("Question Response omits a required answer");
|
|
15413
15385
|
}
|
|
15414
15386
|
if (question.type === "text") {
|
|
15415
15387
|
if (answers.length > 1) {
|
|
15416
|
-
return
|
|
15388
|
+
return invalidRequest("Text Question accepts at most one answer");
|
|
15417
15389
|
}
|
|
15418
15390
|
continue;
|
|
15419
15391
|
}
|
|
15420
15392
|
if (!question.multiple && answers.length > 1) {
|
|
15421
|
-
return
|
|
15393
|
+
return invalidRequest("Single-choice Question accepts at most one answer");
|
|
15422
15394
|
}
|
|
15423
15395
|
const declared = new Set(question.options.map(({ value }) => value));
|
|
15424
15396
|
if (!question.allowOther && answers.some((answer) => !declared.has(answer))) {
|
|
15425
|
-
return
|
|
15397
|
+
return invalidRequest("Question Response contains an undeclared choice");
|
|
15426
15398
|
}
|
|
15427
15399
|
}
|
|
15428
15400
|
return null;
|
|
@@ -16265,7 +16237,7 @@ async function forkAntigravitySession(options) {
|
|
|
16265
16237
|
}));
|
|
16266
16238
|
const model = sourceSession?.model ?? sourceHistory.model;
|
|
16267
16239
|
const thinkingOptionId = sourceSession?.thinkingOptionId ?? sourceHistory.thinkingOptionId;
|
|
16268
|
-
const permissionMode = sourceSession?.permissionMode ?? "
|
|
16240
|
+
const permissionMode = sourceSession?.permissionMode ?? "dangerously-skip-permissions";
|
|
16269
16241
|
const forkedHistory = await AntigravityHistory.createDerived({
|
|
16270
16242
|
environment: sessionEnvironment,
|
|
16271
16243
|
nativeSessionId: derivedNativeSessionId,
|
|
@@ -16390,23 +16362,13 @@ function antigravityAvailableThinkingOptions(catalog, model) {
|
|
|
16390
16362
|
}
|
|
16391
16363
|
|
|
16392
16364
|
// dist/permission-modes.js
|
|
16393
|
-
var ANTIGRAVITY_DEFAULT_PERMISSION_MODE_ID = harnessPermissionModeIdSchema.parse("
|
|
16365
|
+
var ANTIGRAVITY_DEFAULT_PERMISSION_MODE_ID = harnessPermissionModeIdSchema.parse("dangerously-skip-permissions");
|
|
16394
16366
|
var ANTIGRAVITY_PERMISSION_MODE_CATALOG = harnessPermissionModeCatalogSchema.parse({
|
|
16395
16367
|
modes: [
|
|
16396
|
-
{
|
|
16397
|
-
id: "configured",
|
|
16398
|
-
label: "Configured permissions",
|
|
16399
|
-
description: "Use Antigravity CLI permission rules; headless prompts are denied safely."
|
|
16400
|
-
},
|
|
16401
|
-
{
|
|
16402
|
-
id: "desktop-approvals",
|
|
16403
|
-
label: "Desktop approvals",
|
|
16404
|
-
description: "Ask Desktop before each parent tool action. Uses native auto-execution behind a verified, fail-closed Hook; does not use configured permission prompts."
|
|
16405
|
-
},
|
|
16406
16368
|
{
|
|
16407
16369
|
id: "dangerously-skip-permissions",
|
|
16408
16370
|
label: "Skip permissions",
|
|
16409
|
-
description: "
|
|
16371
|
+
description: "Run Antigravity CLI with --dangerously-skip-permissions. codexhost adds no tool approval or workspace restrictions.",
|
|
16410
16372
|
dangerous: true
|
|
16411
16373
|
}
|
|
16412
16374
|
],
|
|
@@ -16414,10 +16376,10 @@ var ANTIGRAVITY_PERMISSION_MODE_CATALOG = harnessPermissionModeCatalogSchema.par
|
|
|
16414
16376
|
});
|
|
16415
16377
|
function decodeAntigravityPermissionModeId(value) {
|
|
16416
16378
|
const parsed = harnessPermissionModeIdSchema.parse(value);
|
|
16417
|
-
if (parsed !== "
|
|
16418
|
-
throw new Error("Antigravity
|
|
16379
|
+
if (parsed !== "dangerously-skip-permissions") {
|
|
16380
|
+
throw new Error("Antigravity only supports Skip permissions (dangerous). Explicitly select Skip permissions to continue; codexhost does not enforce tool permissions.");
|
|
16419
16381
|
}
|
|
16420
|
-
return
|
|
16382
|
+
return "dangerously-skip-permissions";
|
|
16421
16383
|
}
|
|
16422
16384
|
|
|
16423
16385
|
// dist/rollback.js
|
|
@@ -16489,7 +16451,7 @@ async function rollbackAntigravityLastTurn(options) {
|
|
|
16489
16451
|
}));
|
|
16490
16452
|
const model = sourceSession?.model ?? sourceHistory.model;
|
|
16491
16453
|
const thinkingOptionId = sourceSession?.thinkingOptionId ?? sourceHistory.thinkingOptionId;
|
|
16492
|
-
const permissionMode = sourceSession?.permissionMode ?? "
|
|
16454
|
+
const permissionMode = sourceSession?.permissionMode ?? "dangerously-skip-permissions";
|
|
16493
16455
|
const rolledBackHistory = await AntigravityHistory.createDerived({
|
|
16494
16456
|
environment: sessionEnvironment,
|
|
16495
16457
|
nativeSessionId: derivedNativeSessionId,
|
|
@@ -17137,9 +17099,15 @@ function parseBuckets(groups) {
|
|
|
17137
17099
|
}
|
|
17138
17100
|
function leadingBucket(buckets) {
|
|
17139
17101
|
return [...buckets].sort((left, right) => {
|
|
17140
|
-
|
|
17102
|
+
const leftIsFiveHour = periodTypeFrom(left.window) === "five_hour";
|
|
17103
|
+
const rightIsFiveHour = periodTypeFrom(right.window) === "five_hour";
|
|
17104
|
+
if (leftIsFiveHour !== rightIsFiveHour) {
|
|
17105
|
+
return Number(rightIsFiveHour) - Number(leftIsFiveHour);
|
|
17106
|
+
}
|
|
17107
|
+
if (right.usagePercent !== left.usagePercent) {
|
|
17141
17108
|
return right.usagePercent - left.usagePercent;
|
|
17142
|
-
|
|
17109
|
+
}
|
|
17110
|
+
return 0;
|
|
17143
17111
|
})[0];
|
|
17144
17112
|
}
|
|
17145
17113
|
function parseAntigravityUsageCommand(command, fetchedAt = (/* @__PURE__ */ new Date()).toISOString()) {
|
|
@@ -17231,9 +17199,7 @@ process.stdin.on("end", () => {
|
|
|
17231
17199
|
target.pathname !== "/question" || target.username || target.password) {
|
|
17232
17200
|
return unavailable();
|
|
17233
17201
|
}
|
|
17234
|
-
|
|
17235
|
-
const approval = process.env.CODEXHOST_AGY_QUESTION_APPROVALS === "1" &&
|
|
17236
|
-
payload.toolCall && payload.toolCall.name !== "ask_question";
|
|
17202
|
+
JSON.parse(input);
|
|
17237
17203
|
request = http.request(target, {
|
|
17238
17204
|
method: "POST",
|
|
17239
17205
|
headers: {
|
|
@@ -17254,7 +17220,7 @@ process.stdin.on("end", () => {
|
|
|
17254
17220
|
try {
|
|
17255
17221
|
const value = JSON.parse(body);
|
|
17256
17222
|
if (response.statusCode !== 200 ||
|
|
17257
|
-
|
|
17223
|
+
value.decision !== "deny" ||
|
|
17258
17224
|
typeof value.reason !== "string") return unavailable();
|
|
17259
17225
|
finish(value);
|
|
17260
17226
|
} catch { unavailable(); }
|
|
@@ -17289,23 +17255,11 @@ var responseSchema = external_exports.object({
|
|
|
17289
17255
|
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string().max(8e3)).max(30)),
|
|
17290
17256
|
cancelled: external_exports.boolean().optional()
|
|
17291
17257
|
}).strict();
|
|
17292
|
-
|
|
17293
|
-
conversationId: external_exports.string().min(1).max(128),
|
|
17294
|
-
stepIdx: external_exports.number().int().nonnegative(),
|
|
17295
|
-
toolCall: external_exports.object({
|
|
17296
|
-
name: external_exports.string().min(1).max(256).refine((name) => name !== "ask_question"),
|
|
17297
|
-
args: jsonValueSchema
|
|
17298
|
-
})
|
|
17299
|
-
});
|
|
17300
|
-
var approvalResponseSchema = external_exports.strictObject({
|
|
17301
|
-
type: external_exports.literal("approval"),
|
|
17302
|
-
actionId: external_exports.string()
|
|
17303
|
-
});
|
|
17304
|
-
function deny(response, reason, status = 200, decision = "deny") {
|
|
17258
|
+
function deny(response, reason, status = 200) {
|
|
17305
17259
|
if (response.destroyed || response.writableEnded)
|
|
17306
17260
|
return;
|
|
17307
17261
|
response.writeHead(status, { "content-type": "application/json", connection: "close" });
|
|
17308
|
-
response.end(JSON.stringify({ decision, reason }));
|
|
17262
|
+
response.end(JSON.stringify({ decision: "deny", reason }));
|
|
17309
17263
|
}
|
|
17310
17264
|
var AntigravityQuestionBridge = class _AntigravityQuestionBridge {
|
|
17311
17265
|
directory;
|
|
@@ -17321,14 +17275,12 @@ var AntigravityQuestionBridge = class _AntigravityQuestionBridge {
|
|
|
17321
17275
|
#seenSteps = /* @__PURE__ */ new Set();
|
|
17322
17276
|
#stopped = false;
|
|
17323
17277
|
#disposal = null;
|
|
17324
|
-
#hookCommand = "";
|
|
17325
17278
|
constructor(directory, options) {
|
|
17326
17279
|
this.directory = directory;
|
|
17327
17280
|
this.#options = options;
|
|
17328
17281
|
this.environment = {
|
|
17329
17282
|
CODEXHOST_AGY_QUESTION_TOKEN: this.#token,
|
|
17330
|
-
CODEXHOST_AGY_QUESTION_TIMEOUT_MS: String(options.timeoutMs ?? QUESTION_TIMEOUT_MS)
|
|
17331
|
-
CODEXHOST_AGY_QUESTION_APPROVALS: options.approvals ? "1" : "0"
|
|
17283
|
+
CODEXHOST_AGY_QUESTION_TIMEOUT_MS: String(options.timeoutMs ?? QUESTION_TIMEOUT_MS)
|
|
17332
17284
|
};
|
|
17333
17285
|
this.#server.on("request", (request, response) => this.#receive(request, response));
|
|
17334
17286
|
}
|
|
@@ -17355,12 +17307,11 @@ var AntigravityQuestionBridge = class _AntigravityQuestionBridge {
|
|
|
17355
17307
|
bridge.environment.CODEXHOST_AGY_QUESTION_NODE = `"${process.execPath.replaceAll("\\", "/")}"`;
|
|
17356
17308
|
bridge.environment.CODEXHOST_AGY_QUESTION_CLIENT = `"${client.replaceAll("\\", "/")}"`;
|
|
17357
17309
|
const command = process.platform === "win32" ? "%CODEXHOST_AGY_QUESTION_NODE% %CODEXHOST_AGY_QUESTION_CLIENT%" : `${quote(process.execPath)} ${quote(client)}`;
|
|
17358
|
-
bridge.#hookCommand = command;
|
|
17359
17310
|
await writeFile2(path7.join(directory, ".agents", "hooks.json"), JSON.stringify({
|
|
17360
17311
|
"codexhost-question-bridge": {
|
|
17361
17312
|
PreToolUse: [
|
|
17362
17313
|
{
|
|
17363
|
-
matcher:
|
|
17314
|
+
matcher: "^ask_question$",
|
|
17364
17315
|
hooks: [
|
|
17365
17316
|
{
|
|
17366
17317
|
type: "command",
|
|
@@ -17378,38 +17329,6 @@ var AntigravityQuestionBridge = class _AntigravityQuestionBridge {
|
|
|
17378
17329
|
throw error51;
|
|
17379
17330
|
}
|
|
17380
17331
|
}
|
|
17381
|
-
verifyApprovalHooks(stdout) {
|
|
17382
|
-
if (!this.#options.approvals)
|
|
17383
|
-
return false;
|
|
17384
|
-
const hookSchema = external_exports.object({
|
|
17385
|
-
event: external_exports.literal("command_result"),
|
|
17386
|
-
command: external_exports.object({
|
|
17387
|
-
name: external_exports.literal("hooks"),
|
|
17388
|
-
data: external_exports.object({
|
|
17389
|
-
hooks: external_exports.array(external_exports.object({
|
|
17390
|
-
name: external_exports.string(),
|
|
17391
|
-
enabled: external_exports.boolean(),
|
|
17392
|
-
source: external_exports.string(),
|
|
17393
|
-
actions: external_exports.array(external_exports.object({
|
|
17394
|
-
event: external_exports.string(),
|
|
17395
|
-
matcher: external_exports.string(),
|
|
17396
|
-
command: external_exports.string()
|
|
17397
|
-
}))
|
|
17398
|
-
}))
|
|
17399
|
-
})
|
|
17400
|
-
})
|
|
17401
|
-
});
|
|
17402
|
-
for (const line of stdout.split("\n")) {
|
|
17403
|
-
try {
|
|
17404
|
-
const parsed = hookSchema.safeParse(JSON.parse(line));
|
|
17405
|
-
if (!parsed.success)
|
|
17406
|
-
continue;
|
|
17407
|
-
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));
|
|
17408
|
-
} catch {
|
|
17409
|
-
}
|
|
17410
|
-
}
|
|
17411
|
-
return false;
|
|
17412
|
-
}
|
|
17413
17332
|
#receive(request, response) {
|
|
17414
17333
|
const auth = Buffer.from(request.headers.authorization ?? "");
|
|
17415
17334
|
const expected = Buffer.from(`Bearer ${this.#token}`);
|
|
@@ -17443,13 +17362,6 @@ var AntigravityQuestionBridge = class _AntigravityQuestionBridge {
|
|
|
17443
17362
|
return;
|
|
17444
17363
|
}
|
|
17445
17364
|
if (!parsed.success) {
|
|
17446
|
-
if (this.#options.approvals) {
|
|
17447
|
-
const approval = approvalRequestSchema.safeParse(JSON.parse(body));
|
|
17448
|
-
if (approval.success) {
|
|
17449
|
-
this.#options.schedule(() => this.#approve(approval.data, response));
|
|
17450
|
-
return;
|
|
17451
|
-
}
|
|
17452
|
-
}
|
|
17453
17365
|
deny(response, "Invalid question payload", 400);
|
|
17454
17366
|
return;
|
|
17455
17367
|
}
|
|
@@ -17457,52 +17369,6 @@ var AntigravityQuestionBridge = class _AntigravityQuestionBridge {
|
|
|
17457
17369
|
this.#options.schedule(() => this.#ask(payload, response));
|
|
17458
17370
|
});
|
|
17459
17371
|
}
|
|
17460
|
-
#approve(payload, response) {
|
|
17461
|
-
if (this.#stopped || response.destroyed || payload.conversationId !== this.#options.nativeSessionId() && !this.#options.ownsApprovalSession?.(payload.conversationId)) {
|
|
17462
|
-
deny(response, "Tool approval does not belong to the active codexhost Turn.");
|
|
17463
|
-
return;
|
|
17464
|
-
}
|
|
17465
|
-
if (payload.toolCall.name === "ask_permission") {
|
|
17466
|
-
deny(response, "Desktop approves actual tool actions. Call the intended tool directly instead of ask_permission.");
|
|
17467
|
-
return;
|
|
17468
|
-
}
|
|
17469
|
-
const stepKey = `${payload.conversationId}:${payload.stepIdx}`;
|
|
17470
|
-
if (this.#seenSteps.has(stepKey) || this.#seenSteps.size >= 128) {
|
|
17471
|
-
deny(response, "Duplicate or overlapping tool approval. No permission was granted.");
|
|
17472
|
-
return;
|
|
17473
|
-
}
|
|
17474
|
-
this.#seenSteps.add(stepKey);
|
|
17475
|
-
const interaction = {
|
|
17476
|
-
type: "approval",
|
|
17477
|
-
interactionId: hostInteractionIdSchema.parse(randomUUID4()),
|
|
17478
|
-
turnId: this.#options.turnId,
|
|
17479
|
-
title: `Antigravity: ${payload.toolCall.name}`,
|
|
17480
|
-
description: `Tool: ${payload.toolCall.name}
|
|
17481
|
-
Session: ${payload.conversationId}
|
|
17482
|
-
Arguments:
|
|
17483
|
-
${JSON.stringify(payload.toolCall.args, null, 2)}`,
|
|
17484
|
-
subject: { type: "nativeAction" },
|
|
17485
|
-
actions: [
|
|
17486
|
-
{ id: "allow-once", label: "Allow once", effect: "allowOnce" },
|
|
17487
|
-
{ id: "deny", label: "Deny", effect: "deny" }
|
|
17488
|
-
]
|
|
17489
|
-
};
|
|
17490
|
-
const pending = {
|
|
17491
|
-
interaction,
|
|
17492
|
-
response,
|
|
17493
|
-
expiresAt: Date.now() + (this.#options.timeoutMs ?? QUESTION_TIMEOUT_MS),
|
|
17494
|
-
timer: setTimeout(() => {
|
|
17495
|
-
this.#finish(pending, "expired", "Tool approval expired. No permission was granted.");
|
|
17496
|
-
}, this.#options.timeoutMs ?? QUESTION_TIMEOUT_MS)
|
|
17497
|
-
};
|
|
17498
|
-
this.#pending.set(interaction.interactionId, pending);
|
|
17499
|
-
response.on("close", () => {
|
|
17500
|
-
if (!response.writableFinished) {
|
|
17501
|
-
this.#finish(pending, "cancelled", "Tool approval connection closed. No permission was granted.");
|
|
17502
|
-
}
|
|
17503
|
-
});
|
|
17504
|
-
this.#options.emit({ kind: "interaction", interaction });
|
|
17505
|
-
}
|
|
17506
17372
|
#ask(payload, response) {
|
|
17507
17373
|
if (this.#stopped || response.destroyed || payload.conversationId !== this.#options.nativeSessionId()) {
|
|
17508
17374
|
deny(response, "This question does not belong to the active codexhost Turn. No answer was received.");
|
|
@@ -17578,27 +17444,12 @@ ${JSON.stringify(payload.toolCall.args, null, 2)}`,
|
|
|
17578
17444
|
};
|
|
17579
17445
|
}
|
|
17580
17446
|
if (Date.now() >= pending.expiresAt) {
|
|
17581
|
-
this.#finish(pending, "expired",
|
|
17447
|
+
this.#finish(pending, "expired", EXPIRED_REASON);
|
|
17582
17448
|
return {
|
|
17583
17449
|
ok: false,
|
|
17584
17450
|
error: { code: "invalidState", message: "Question has expired", retryable: false }
|
|
17585
17451
|
};
|
|
17586
17452
|
}
|
|
17587
|
-
if (pending.interaction.type === "approval") {
|
|
17588
|
-
const parsed2 = approvalResponseSchema.safeParse(command.response);
|
|
17589
|
-
if (!parsed2.success) {
|
|
17590
|
-
return {
|
|
17591
|
-
ok: false,
|
|
17592
|
-
error: { code: "invalidRequest", message: "Invalid Approval response", retryable: false }
|
|
17593
|
-
};
|
|
17594
|
-
}
|
|
17595
|
-
const error52 = validateHostApprovalResponse(pending.interaction, parsed2.data);
|
|
17596
|
-
if (error52)
|
|
17597
|
-
return { ok: false, error: error52 };
|
|
17598
|
-
const allowed = parsed2.data.actionId === "allow-once";
|
|
17599
|
-
this.#finish(pending, "responded", allowed ? "User approved this tool call once." : "User denied this tool call.", allowed ? "allow" : "deny");
|
|
17600
|
-
return { ok: true, value: { accepted: true } };
|
|
17601
|
-
}
|
|
17602
17453
|
const parsed = responseSchema.safeParse(command.response);
|
|
17603
17454
|
if (!parsed.success) {
|
|
17604
17455
|
return {
|
|
@@ -17634,11 +17485,11 @@ ${JSON.stringify(payload.toolCall.args, null, 2)}`,
|
|
|
17634
17485
|
this.#finish(pending, parsed.data.cancelled ? "cancelled" : "responded", reason);
|
|
17635
17486
|
return { ok: true, value: { accepted: true } };
|
|
17636
17487
|
}
|
|
17637
|
-
#finish(pending, reason, text
|
|
17488
|
+
#finish(pending, reason, text) {
|
|
17638
17489
|
if (!this.#pending.delete(pending.interaction.interactionId))
|
|
17639
17490
|
return;
|
|
17640
17491
|
clearTimeout(pending.timer);
|
|
17641
|
-
deny(pending.response, text
|
|
17492
|
+
deny(pending.response, text);
|
|
17642
17493
|
this.#options.emit({
|
|
17643
17494
|
kind: "event",
|
|
17644
17495
|
event: {
|
|
@@ -17669,7 +17520,7 @@ ${JSON.stringify(payload.toolCall.args, null, 2)}`,
|
|
|
17669
17520
|
return;
|
|
17670
17521
|
this.#stopped = true;
|
|
17671
17522
|
for (const pending of this.#pending.values()) {
|
|
17672
|
-
this.#finish(pending, "cancelled",
|
|
17523
|
+
this.#finish(pending, "cancelled", "The codexhost Turn ended before an answer was received. Do not infer a user choice.");
|
|
17673
17524
|
}
|
|
17674
17525
|
}
|
|
17675
17526
|
dispose() {
|
|
@@ -18207,7 +18058,7 @@ function permissionDeniedTurnError(nativeMode, denial) {
|
|
|
18207
18058
|
const mode = nativeMode ? ` '${nativeMode}'` : "";
|
|
18208
18059
|
return {
|
|
18209
18060
|
code: "nativeFailure",
|
|
18210
|
-
message: `Antigravity denied a tool call under its${mode} permission mode and produced no response.
|
|
18061
|
+
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.`,
|
|
18211
18062
|
retryable: false,
|
|
18212
18063
|
diagnostic: sanitizeDiagnosticTail(denial)
|
|
18213
18064
|
};
|
|
@@ -18483,8 +18334,6 @@ var AntigravitySession = class {
|
|
|
18483
18334
|
}
|
|
18484
18335
|
let questions;
|
|
18485
18336
|
this.#preparingQuestions = AntigravityQuestionBridge.create({
|
|
18486
|
-
approvals: this.#permissionMode === "desktop-approvals",
|
|
18487
|
-
ownsApprovalSession: (id) => this.#active?.command === command && !this.#active.cancellationRequested && this.#active.subagents.state(id) !== void 0,
|
|
18488
18337
|
turnId: command.turnId,
|
|
18489
18338
|
nativeSessionId: () => this.#active?.command === command && !this.#active.cancellationRequested ? this.#nativeRef?.nativeSessionId : void 0,
|
|
18490
18339
|
schedule: (action) => {
|
|
@@ -18507,26 +18356,6 @@ var AntigravitySession = class {
|
|
|
18507
18356
|
}
|
|
18508
18357
|
this.#channel.emit(output);
|
|
18509
18358
|
}
|
|
18510
|
-
}).then(async (bridge) => {
|
|
18511
|
-
if (this.#permissionMode !== "desktop-approvals")
|
|
18512
|
-
return bridge;
|
|
18513
|
-
try {
|
|
18514
|
-
const { stdout } = await runBuffered(this.#executable, [
|
|
18515
|
-
"--add-dir",
|
|
18516
|
-
this.#cwd,
|
|
18517
|
-
"--add-dir",
|
|
18518
|
-
bridge.directory,
|
|
18519
|
-
"--print=/hooks",
|
|
18520
|
-
"--output-format",
|
|
18521
|
-
"stream-json"
|
|
18522
|
-
], this.#cwd, { ...this.#environment, ...bridge.environment }, DEFAULT_INSPECT_TIMEOUT_MS);
|
|
18523
|
-
if (!bridge.verifyApprovalHooks(stdout))
|
|
18524
|
-
throw new Error("Desktop approval Hook was not loaded");
|
|
18525
|
-
return bridge;
|
|
18526
|
-
} catch {
|
|
18527
|
-
await bridge.dispose();
|
|
18528
|
-
throw new Error("Desktop approval Hook verification failed; no tools were started");
|
|
18529
|
-
}
|
|
18530
18359
|
});
|
|
18531
18360
|
try {
|
|
18532
18361
|
questions = await this.#preparingQuestions;
|
|
@@ -18559,9 +18388,7 @@ var AntigravitySession = class {
|
|
|
18559
18388
|
if (this.#nativeRef)
|
|
18560
18389
|
arguments_.unshift("--conversation", this.#nativeRef.nativeSessionId);
|
|
18561
18390
|
arguments_.push(...antigravityModelArguments(this.#model, this.#thinkingOptionId));
|
|
18562
|
-
|
|
18563
|
-
arguments_.push("--dangerously-skip-permissions");
|
|
18564
|
-
}
|
|
18391
|
+
arguments_.push("--dangerously-skip-permissions");
|
|
18565
18392
|
arguments_.push("--add-dir", this.#cwd);
|
|
18566
18393
|
arguments_.push("--add-dir", questions.directory);
|
|
18567
18394
|
arguments_.push("--log-file", logPath);
|
|
@@ -19343,6 +19170,17 @@ var AntigravityAdapter = class {
|
|
|
19343
19170
|
async open(input) {
|
|
19344
19171
|
if (this.#closed)
|
|
19345
19172
|
return { ok: false, error: invalidState("Antigravity Adapter is closed") };
|
|
19173
|
+
let permissionMode = "dangerously-skip-permissions";
|
|
19174
|
+
if (input.kind !== "fork" && input.permissionModeId) {
|
|
19175
|
+
try {
|
|
19176
|
+
permissionMode = decodeAntigravityPermissionModeId(input.permissionModeId);
|
|
19177
|
+
} catch (error51) {
|
|
19178
|
+
return {
|
|
19179
|
+
ok: false,
|
|
19180
|
+
error: { code: "invalidRequest", message: errorMessage(error51), retryable: false }
|
|
19181
|
+
};
|
|
19182
|
+
}
|
|
19183
|
+
}
|
|
19346
19184
|
if (!input.cwd) {
|
|
19347
19185
|
return {
|
|
19348
19186
|
ok: false,
|
|
@@ -19454,17 +19292,6 @@ var AntigravityAdapter = class {
|
|
|
19454
19292
|
};
|
|
19455
19293
|
}
|
|
19456
19294
|
}
|
|
19457
|
-
let permissionMode = "configured";
|
|
19458
|
-
if (input.kind === "create" && input.permissionModeId) {
|
|
19459
|
-
try {
|
|
19460
|
-
permissionMode = decodeAntigravityPermissionModeId(input.permissionModeId);
|
|
19461
|
-
} catch (error51) {
|
|
19462
|
-
return {
|
|
19463
|
-
ok: false,
|
|
19464
|
-
error: { code: "invalidRequest", message: errorMessage(error51), retryable: false }
|
|
19465
|
-
};
|
|
19466
|
-
}
|
|
19467
|
-
}
|
|
19468
19295
|
const sessionEnvironment = { ...this.#environment, ...input.environment ?? {} };
|
|
19469
19296
|
const history = await AntigravityHistory.open({
|
|
19470
19297
|
environment: sessionEnvironment,
|