@karlorz/codexhost-cli-win32-arm64 0.13.3-4 → 0.13.3-6
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 +432 -31
- package/app/console-web.js +806 -186
- package/app/cpa-live-voice-hook.js +16310 -31
- package/app/desktop-controller.mjs +147 -37
- package/app/host-runtime.mjs +3535 -3126
- package/app/plugins/antigravity/plugin.mjs +77 -0
- package/app/plugins/claude-code/plugin.mjs +152 -29
- package/app/plugins/codebuddy/plugin.mjs +109 -32
- package/app/plugins/codex-usage/plugin.mjs +77 -0
- package/app/plugins/cursor-cli/plugin.mjs +120 -43
- package/app/plugins/deepseek-harness/plugin.mjs +82 -5
- package/app/plugins/grok/plugin.mjs +138 -24
- package/app/plugins/hermes/plugin.mjs +77 -0
- package/app/plugins/kimi-code/plugin.mjs +99 -22
- package/app/plugins/kiro-cli/plugin.mjs +99 -22
- package/app/plugins/omp/plugin.mjs +92 -15
- package/app/plugins/opencode/plugin.mjs +77 -0
- package/app/plugins/pi/plugin.mjs +98 -21
- package/app/plugins/qoder/plugin.mjs +85 -8
- package/app/plugins/qoder-cn/plugin.mjs +85 -8
- package/app/plugins/workbuddy/plugin.mjs +109 -32
- package/app/plugins/zcode/plugin.mjs +100 -23
- package/app/renderer-extension.js +2238 -860
- package/bin/codexhost.exe +0 -0
- package/libexec/codexhost-node-repl.exe +0 -0
- package/libexec/codexhost-shim.exe +0 -0
- package/libexec/codexhost-updater.exe +0 -0
- package/package.json +1 -1
|
@@ -15187,6 +15187,36 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
|
15187
15187
|
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
15188
15188
|
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
15189
15189
|
|
|
15190
|
+
// ../../shared-contracts/dist/realtime-call.js
|
|
15191
|
+
var REALTIME_CALL_FORWARDED_HEADERS = [
|
|
15192
|
+
"openai-alpha",
|
|
15193
|
+
"thread-id",
|
|
15194
|
+
"session-id",
|
|
15195
|
+
"originator",
|
|
15196
|
+
"x-codex-turn-metadata"
|
|
15197
|
+
];
|
|
15198
|
+
var FORWARDED_HEADERS = new Set(REALTIME_CALL_FORWARDED_HEADERS);
|
|
15199
|
+
var REALTIME_CALL_ID_PATTERN = /^rtc_[A-Za-z0-9_-]{1,128}$/u;
|
|
15200
|
+
var requestId = external_exports.string().min(1).max(128);
|
|
15201
|
+
var realtimeCallParamsSchema = external_exports.discriminatedUnion("operation", [
|
|
15202
|
+
external_exports.object({
|
|
15203
|
+
operation: external_exports.literal("create"),
|
|
15204
|
+
requestId,
|
|
15205
|
+
body: external_exports.string().min(1).max(16 << 20),
|
|
15206
|
+
headers: external_exports.record(external_exports.string(), external_exports.string()).default({})
|
|
15207
|
+
}),
|
|
15208
|
+
external_exports.object({ operation: external_exports.literal("cancel"), requestId }),
|
|
15209
|
+
external_exports.object({
|
|
15210
|
+
operation: external_exports.literal("hangup"),
|
|
15211
|
+
callId: external_exports.string().regex(REALTIME_CALL_ID_PATTERN)
|
|
15212
|
+
})
|
|
15213
|
+
]);
|
|
15214
|
+
var realtimeCallResponseSchema = external_exports.object({
|
|
15215
|
+
status: external_exports.number().int().min(200).max(599),
|
|
15216
|
+
body: external_exports.string(),
|
|
15217
|
+
headers: external_exports.record(external_exports.string(), external_exports.string())
|
|
15218
|
+
});
|
|
15219
|
+
|
|
15190
15220
|
// ../../shared-contracts/dist/console.js
|
|
15191
15221
|
var consoleAnnouncementSchema = external_exports.strictObject({
|
|
15192
15222
|
title: external_exports.string().trim().min(1).max(200),
|
|
@@ -15199,6 +15229,7 @@ var consoleOpenResultSchema = external_exports.strictObject({
|
|
|
15199
15229
|
url: external_exports.string().max(2048).regex(/^http:\/\/(?:127\.0\.0\.1|localhost):\d{1,5}\/(?:\?.*)?$/u)
|
|
15200
15230
|
});
|
|
15201
15231
|
var CONSOLE_HOST_METHODS = Object.freeze([
|
|
15232
|
+
"codexhost/voice/gateway-status",
|
|
15202
15233
|
"codexhost/console/remote-connections",
|
|
15203
15234
|
"codexhost/runtime/status",
|
|
15204
15235
|
"codexhost/remote/ssh-setup",
|
|
@@ -16308,6 +16339,52 @@ var remoteConnectionsReplySchema = external_exports.union([
|
|
|
16308
16339
|
external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
|
|
16309
16340
|
]);
|
|
16310
16341
|
|
|
16342
|
+
// ../../shared-contracts/dist/voice-settings.js
|
|
16343
|
+
var voiceRoutesSchema = external_exports.strictObject({
|
|
16344
|
+
chatExperience: external_exports.enum(["chatgpt", "codex"]),
|
|
16345
|
+
chatConnection: external_exports.enum(["desktop", "gateway"]),
|
|
16346
|
+
workConnection: external_exports.enum(["desktop", "gateway"])
|
|
16347
|
+
});
|
|
16348
|
+
var DEFAULT_VOICE_ROUTES = Object.freeze({
|
|
16349
|
+
chatExperience: "chatgpt",
|
|
16350
|
+
chatConnection: "desktop",
|
|
16351
|
+
workConnection: "gateway"
|
|
16352
|
+
});
|
|
16353
|
+
var voiceSettingsSchema = voiceRoutesSchema.extend({ inject: external_exports.boolean() });
|
|
16354
|
+
var voiceSettingsRequestSchema = external_exports.discriminatedUnion("operation", [
|
|
16355
|
+
external_exports.strictObject({
|
|
16356
|
+
operation: external_exports.literal("get"),
|
|
16357
|
+
runtime: external_exports.strictObject({
|
|
16358
|
+
id: external_exports.string().uuid(),
|
|
16359
|
+
revision: external_exports.string().max(64),
|
|
16360
|
+
activeCall: external_exports.boolean()
|
|
16361
|
+
}).optional()
|
|
16362
|
+
}),
|
|
16363
|
+
external_exports.strictObject({ operation: external_exports.literal("migrate"), routes: voiceRoutesSchema }),
|
|
16364
|
+
external_exports.strictObject({
|
|
16365
|
+
operation: external_exports.literal("set"),
|
|
16366
|
+
settings: voiceSettingsSchema,
|
|
16367
|
+
revision: external_exports.string().max(64)
|
|
16368
|
+
}),
|
|
16369
|
+
external_exports.strictObject({ operation: external_exports.literal("restart"), confirm: external_exports.literal(true) })
|
|
16370
|
+
]);
|
|
16371
|
+
var voiceSettingsStateSchema = external_exports.strictObject({
|
|
16372
|
+
settings: voiceSettingsSchema,
|
|
16373
|
+
initialized: external_exports.boolean(),
|
|
16374
|
+
revision: external_exports.string(),
|
|
16375
|
+
activeInject: external_exports.boolean().nullable(),
|
|
16376
|
+
envOverride: external_exports.enum(["0", "1"]).nullable(),
|
|
16377
|
+
activeEnvOverride: external_exports.enum(["0", "1"]).nullable(),
|
|
16378
|
+
routesActive: external_exports.boolean().nullable(),
|
|
16379
|
+
activeCall: external_exports.boolean().nullable(),
|
|
16380
|
+
gatewayReady: external_exports.boolean().nullable(),
|
|
16381
|
+
restartAvailable: external_exports.boolean(),
|
|
16382
|
+
restart: external_exports.strictObject({
|
|
16383
|
+
phase: external_exports.enum(["idle", "restarting", "succeeded", "failed"]),
|
|
16384
|
+
error: external_exports.string().nullable()
|
|
16385
|
+
})
|
|
16386
|
+
});
|
|
16387
|
+
|
|
16311
16388
|
// ../../shared-contracts/dist/index.js
|
|
16312
16389
|
var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
|
|
16313
16390
|
|
|
@@ -14781,6 +14781,36 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
|
14781
14781
|
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
14782
14782
|
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
14783
14783
|
|
|
14784
|
+
// ../../shared-contracts/dist/realtime-call.js
|
|
14785
|
+
var REALTIME_CALL_FORWARDED_HEADERS = [
|
|
14786
|
+
"openai-alpha",
|
|
14787
|
+
"thread-id",
|
|
14788
|
+
"session-id",
|
|
14789
|
+
"originator",
|
|
14790
|
+
"x-codex-turn-metadata"
|
|
14791
|
+
];
|
|
14792
|
+
var FORWARDED_HEADERS = new Set(REALTIME_CALL_FORWARDED_HEADERS);
|
|
14793
|
+
var REALTIME_CALL_ID_PATTERN = /^rtc_[A-Za-z0-9_-]{1,128}$/u;
|
|
14794
|
+
var requestId = external_exports.string().min(1).max(128);
|
|
14795
|
+
var realtimeCallParamsSchema = external_exports.discriminatedUnion("operation", [
|
|
14796
|
+
external_exports.object({
|
|
14797
|
+
operation: external_exports.literal("create"),
|
|
14798
|
+
requestId,
|
|
14799
|
+
body: external_exports.string().min(1).max(16 << 20),
|
|
14800
|
+
headers: external_exports.record(external_exports.string(), external_exports.string()).default({})
|
|
14801
|
+
}),
|
|
14802
|
+
external_exports.object({ operation: external_exports.literal("cancel"), requestId }),
|
|
14803
|
+
external_exports.object({
|
|
14804
|
+
operation: external_exports.literal("hangup"),
|
|
14805
|
+
callId: external_exports.string().regex(REALTIME_CALL_ID_PATTERN)
|
|
14806
|
+
})
|
|
14807
|
+
]);
|
|
14808
|
+
var realtimeCallResponseSchema = external_exports.object({
|
|
14809
|
+
status: external_exports.number().int().min(200).max(599),
|
|
14810
|
+
body: external_exports.string(),
|
|
14811
|
+
headers: external_exports.record(external_exports.string(), external_exports.string())
|
|
14812
|
+
});
|
|
14813
|
+
|
|
14784
14814
|
// ../../shared-contracts/dist/console.js
|
|
14785
14815
|
var consoleAnnouncementSchema = external_exports.strictObject({
|
|
14786
14816
|
title: external_exports.string().trim().min(1).max(200),
|
|
@@ -14793,6 +14823,7 @@ var consoleOpenResultSchema = external_exports.strictObject({
|
|
|
14793
14823
|
url: external_exports.string().max(2048).regex(/^http:\/\/(?:127\.0\.0\.1|localhost):\d{1,5}\/(?:\?.*)?$/u)
|
|
14794
14824
|
});
|
|
14795
14825
|
var CONSOLE_HOST_METHODS = Object.freeze([
|
|
14826
|
+
"codexhost/voice/gateway-status",
|
|
14796
14827
|
"codexhost/console/remote-connections",
|
|
14797
14828
|
"codexhost/runtime/status",
|
|
14798
14829
|
"codexhost/remote/ssh-setup",
|
|
@@ -15902,6 +15933,52 @@ var remoteConnectionsReplySchema = external_exports.union([
|
|
|
15902
15933
|
external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
|
|
15903
15934
|
]);
|
|
15904
15935
|
|
|
15936
|
+
// ../../shared-contracts/dist/voice-settings.js
|
|
15937
|
+
var voiceRoutesSchema = external_exports.strictObject({
|
|
15938
|
+
chatExperience: external_exports.enum(["chatgpt", "codex"]),
|
|
15939
|
+
chatConnection: external_exports.enum(["desktop", "gateway"]),
|
|
15940
|
+
workConnection: external_exports.enum(["desktop", "gateway"])
|
|
15941
|
+
});
|
|
15942
|
+
var DEFAULT_VOICE_ROUTES = Object.freeze({
|
|
15943
|
+
chatExperience: "chatgpt",
|
|
15944
|
+
chatConnection: "desktop",
|
|
15945
|
+
workConnection: "gateway"
|
|
15946
|
+
});
|
|
15947
|
+
var voiceSettingsSchema = voiceRoutesSchema.extend({ inject: external_exports.boolean() });
|
|
15948
|
+
var voiceSettingsRequestSchema = external_exports.discriminatedUnion("operation", [
|
|
15949
|
+
external_exports.strictObject({
|
|
15950
|
+
operation: external_exports.literal("get"),
|
|
15951
|
+
runtime: external_exports.strictObject({
|
|
15952
|
+
id: external_exports.string().uuid(),
|
|
15953
|
+
revision: external_exports.string().max(64),
|
|
15954
|
+
activeCall: external_exports.boolean()
|
|
15955
|
+
}).optional()
|
|
15956
|
+
}),
|
|
15957
|
+
external_exports.strictObject({ operation: external_exports.literal("migrate"), routes: voiceRoutesSchema }),
|
|
15958
|
+
external_exports.strictObject({
|
|
15959
|
+
operation: external_exports.literal("set"),
|
|
15960
|
+
settings: voiceSettingsSchema,
|
|
15961
|
+
revision: external_exports.string().max(64)
|
|
15962
|
+
}),
|
|
15963
|
+
external_exports.strictObject({ operation: external_exports.literal("restart"), confirm: external_exports.literal(true) })
|
|
15964
|
+
]);
|
|
15965
|
+
var voiceSettingsStateSchema = external_exports.strictObject({
|
|
15966
|
+
settings: voiceSettingsSchema,
|
|
15967
|
+
initialized: external_exports.boolean(),
|
|
15968
|
+
revision: external_exports.string(),
|
|
15969
|
+
activeInject: external_exports.boolean().nullable(),
|
|
15970
|
+
envOverride: external_exports.enum(["0", "1"]).nullable(),
|
|
15971
|
+
activeEnvOverride: external_exports.enum(["0", "1"]).nullable(),
|
|
15972
|
+
routesActive: external_exports.boolean().nullable(),
|
|
15973
|
+
activeCall: external_exports.boolean().nullable(),
|
|
15974
|
+
gatewayReady: external_exports.boolean().nullable(),
|
|
15975
|
+
restartAvailable: external_exports.boolean(),
|
|
15976
|
+
restart: external_exports.strictObject({
|
|
15977
|
+
phase: external_exports.enum(["idle", "restarting", "succeeded", "failed"]),
|
|
15978
|
+
error: external_exports.string().nullable()
|
|
15979
|
+
})
|
|
15980
|
+
});
|
|
15981
|
+
|
|
15905
15982
|
// ../../shared-contracts/dist/index.js
|
|
15906
15983
|
var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
|
|
15907
15984
|
|
|
@@ -17408,7 +17485,7 @@ function count2(value) {
|
|
|
17408
17485
|
function isClaudeModelRequest(model2) {
|
|
17409
17486
|
return typeof model2 === "string" && model2.length > 0 && model2 !== SYNTHETIC_MODEL;
|
|
17410
17487
|
}
|
|
17411
|
-
function claudeUsageRecord(
|
|
17488
|
+
function claudeUsageRecord(requestId2, model2, usage, extra = {}) {
|
|
17412
17489
|
if (!isRecord2(usage))
|
|
17413
17490
|
return { kind: "missing" };
|
|
17414
17491
|
const input = count2(usage.input_tokens);
|
|
@@ -17427,7 +17504,7 @@ function claudeUsageRecord(requestId, model2, usage, extra = {}) {
|
|
|
17427
17504
|
return {
|
|
17428
17505
|
kind: "request",
|
|
17429
17506
|
request: parseHostUsageRequest({
|
|
17430
|
-
requestId,
|
|
17507
|
+
requestId: requestId2,
|
|
17431
17508
|
...extra.historical ? { historical: true } : {},
|
|
17432
17509
|
model: model2,
|
|
17433
17510
|
// Claude Code's providers (first-party, Bedrock, Vertex, gateways) differ in model IDs,
|
|
@@ -53871,7 +53948,19 @@ function resolveHarnessExecutable(spec, input, dependencies = {}) {
|
|
|
53871
53948
|
|
|
53872
53949
|
// ../../harness-discovery/dist/installation.js
|
|
53873
53950
|
import { execFile as execFile2 } from "node:child_process";
|
|
53951
|
+
import { open as open3 } from "node:fs/promises";
|
|
53874
53952
|
import { homedir } from "node:os";
|
|
53953
|
+
async function readLauncherScript(command) {
|
|
53954
|
+
const file2 = await open3(command, "r");
|
|
53955
|
+
try {
|
|
53956
|
+
const buffer = Buffer.alloc(4096);
|
|
53957
|
+
const { bytesRead } = await file2.read(buffer, 0, buffer.length, 0);
|
|
53958
|
+
const prefix = buffer.toString("utf8", 0, bytesRead);
|
|
53959
|
+
return prefix.startsWith("#!") || /\.(cmd|bat|ps1)$/i.test(command) ? prefix : "";
|
|
53960
|
+
} finally {
|
|
53961
|
+
await file2.close();
|
|
53962
|
+
}
|
|
53963
|
+
}
|
|
53875
53964
|
function runInstallationCommand(command, args, environment, timeout = 3e4) {
|
|
53876
53965
|
const env = withNodeRuntimeOnPath(environment);
|
|
53877
53966
|
const invocation = /\.[cm]?js$/i.test(command) ? commandInvocation(process.execPath, [command, ...args], env) : commandInvocation(command, args, env);
|
|
@@ -54163,7 +54252,7 @@ function resolveClaudeCodeExecutable(input = {}, dependencies = {}) {
|
|
|
54163
54252
|
|
|
54164
54253
|
// dist/pending-session.js
|
|
54165
54254
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
54166
|
-
import { mkdir as mkdir3, open as
|
|
54255
|
+
import { mkdir as mkdir3, open as open4, readFile as readFile4, rename as rename3, rm as rm4, stat as stat3, unlink as unlink2 } from "node:fs/promises";
|
|
54167
54256
|
import os5 from "node:os";
|
|
54168
54257
|
import path10 from "node:path";
|
|
54169
54258
|
var reservationSchema = external_exports.strictObject({
|
|
@@ -54203,7 +54292,7 @@ var ClaudePendingSessions = class {
|
|
|
54203
54292
|
await mkdir3(this.#directory, { recursive: true, mode: 448 });
|
|
54204
54293
|
await mkdir3(directory, { mode: 448 });
|
|
54205
54294
|
try {
|
|
54206
|
-
const file2 = await
|
|
54295
|
+
const file2 = await open4(path10.join(directory, "session.json"), "wx", 384);
|
|
54207
54296
|
try {
|
|
54208
54297
|
await file2.writeFile(JSON.stringify(reservation));
|
|
54209
54298
|
await file2.sync();
|
|
@@ -54241,7 +54330,7 @@ var ClaudePendingSessions = class {
|
|
|
54241
54330
|
const directory = this.#path(ref, cwd);
|
|
54242
54331
|
const temporary = path10.join(directory, `${randomUUID3()}.tmp`);
|
|
54243
54332
|
try {
|
|
54244
|
-
const file2 = await
|
|
54333
|
+
const file2 = await open4(temporary, "wx", 384);
|
|
54245
54334
|
try {
|
|
54246
54335
|
await file2.writeFile(JSON.stringify(reservationSchema.parse({
|
|
54247
54336
|
version: 1,
|
|
@@ -54262,7 +54351,7 @@ var ClaudePendingSessions = class {
|
|
|
54262
54351
|
async #sync(directory) {
|
|
54263
54352
|
if (process.platform === "win32")
|
|
54264
54353
|
return;
|
|
54265
|
-
const handle = await
|
|
54354
|
+
const handle = await open4(directory, "r");
|
|
54266
54355
|
try {
|
|
54267
54356
|
await handle.sync();
|
|
54268
54357
|
} finally {
|
|
@@ -54271,7 +54360,7 @@ var ClaudePendingSessions = class {
|
|
|
54271
54360
|
}
|
|
54272
54361
|
async claim(ref, cwd) {
|
|
54273
54362
|
await this.read(ref, cwd);
|
|
54274
|
-
const claim = await
|
|
54363
|
+
const claim = await open4(path10.join(this.#path(ref, cwd), "started"), "wx", 384);
|
|
54275
54364
|
try {
|
|
54276
54365
|
await claim.sync();
|
|
54277
54366
|
} finally {
|
|
@@ -54427,6 +54516,12 @@ function subagentRole(argumentsValue) {
|
|
|
54427
54516
|
function subagentBackground(argumentsValue) {
|
|
54428
54517
|
return isRecord7(argumentsValue) && argumentsValue.run_in_background === true;
|
|
54429
54518
|
}
|
|
54519
|
+
function subagentModel(argumentsValue) {
|
|
54520
|
+
if (!isRecord7(argumentsValue))
|
|
54521
|
+
return void 0;
|
|
54522
|
+
const model2 = boundedString(argumentsValue.model, SUBAGENT_DESCRIPTION_LIMIT);
|
|
54523
|
+
return model2 === "inherit" ? void 0 : model2;
|
|
54524
|
+
}
|
|
54430
54525
|
function targetedSubagentId(argumentsValue) {
|
|
54431
54526
|
if (!isRecord7(argumentsValue))
|
|
54432
54527
|
return void 0;
|
|
@@ -54466,11 +54561,11 @@ function parseLastRequestUsage(value, attribution = {}) {
|
|
|
54466
54561
|
if (!safeNonNegativeInteger(inputTokens) || !safeNonNegativeInteger(outputTokens) || !safeNonNegativeInteger(cacheCreationInputTokens) || !safeNonNegativeInteger(cacheReadInputTokens)) {
|
|
54467
54562
|
return void 0;
|
|
54468
54563
|
}
|
|
54469
|
-
const
|
|
54564
|
+
const requestId2 = boundedString(attribution.requestId, 500);
|
|
54470
54565
|
const model2 = boundedString(attribution.model, 500);
|
|
54471
54566
|
const provider = boundedString(attribution.provider, 100);
|
|
54472
54567
|
return {
|
|
54473
|
-
...
|
|
54568
|
+
...requestId2 ? { requestId: requestId2 } : {},
|
|
54474
54569
|
...model2 ? { model: model2 } : {},
|
|
54475
54570
|
...provider ? { provider } : {},
|
|
54476
54571
|
inputTokens,
|
|
@@ -54547,12 +54642,14 @@ function nativeSubagentId(nativeResult, outputText) {
|
|
|
54547
54642
|
}
|
|
54548
54643
|
function subagentContinuesInBackground(nativeResult, outputText) {
|
|
54549
54644
|
if (isRecord7(nativeResult)) {
|
|
54645
|
+
if (typeof nativeResult.status === "string")
|
|
54646
|
+
return nativeResult.status === "async_launched";
|
|
54550
54647
|
if (nativeResult.isAsync === true || nativeResult.is_async === true)
|
|
54551
54648
|
return true;
|
|
54552
|
-
if (nativeResult.
|
|
54553
|
-
return
|
|
54649
|
+
if (nativeResult.isAsync === false || nativeResult.is_async === false)
|
|
54650
|
+
return false;
|
|
54554
54651
|
}
|
|
54555
|
-
return
|
|
54652
|
+
return /^Async agent launched successfully\.\r?\nagentId: [A-Za-z0-9_-]+\r?\nThe agent is working in the background\.(?:\r?\n|$)/u.test(outputText ?? "");
|
|
54556
54653
|
}
|
|
54557
54654
|
function resultText(content, nativeResult) {
|
|
54558
54655
|
let text2 = "";
|
|
@@ -54698,6 +54795,10 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
54698
54795
|
const parentTool = parentCallId ? this.#tools.get(parentCallId) : void 0;
|
|
54699
54796
|
if (parentCallId && parentTool && (message.type === "assistant" || message.type === "user")) {
|
|
54700
54797
|
if (parentTool.subagent) {
|
|
54798
|
+
const model2 = message.type === "assistant" ? subagentModel(message.message) : void 0;
|
|
54799
|
+
if (model2 && model2 !== "<synthetic>") {
|
|
54800
|
+
events.push({ type: "subagent.updated", callId: parentCallId, status: "running", model: model2 });
|
|
54801
|
+
}
|
|
54701
54802
|
events.push({ type: "subagent.transcript.changed", callId: parentCallId });
|
|
54702
54803
|
} else if (parentTool.workflow) {
|
|
54703
54804
|
events.push({ type: "workflow.activity", callId: parentCallId });
|
|
@@ -55067,6 +55168,7 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
55067
55168
|
} else if (subagent) {
|
|
55068
55169
|
const prompt = subagentPrompt(argumentsResult.data);
|
|
55069
55170
|
const role = subagentRole(argumentsResult.data);
|
|
55171
|
+
const model2 = block.name === "SendMessage" ? void 0 : subagentModel(argumentsResult.data);
|
|
55070
55172
|
const agentId = targetedSubagentId(argumentsResult.data);
|
|
55071
55173
|
events.push({
|
|
55072
55174
|
type: "subagent.started",
|
|
@@ -55075,6 +55177,7 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
55075
55177
|
description: subagentDescription(argumentsResult.data, block.name),
|
|
55076
55178
|
...prompt ? { prompt } : {},
|
|
55077
55179
|
...role ? { role } : {},
|
|
55180
|
+
...model2 ? { model: model2 } : {},
|
|
55078
55181
|
background: block.name === "SendMessage" || subagentBackground(argumentsResult.data),
|
|
55079
55182
|
...agentId ? { nativeSubagentId: agentId } : {}
|
|
55080
55183
|
});
|
|
@@ -56692,7 +56795,7 @@ function permissionSuggestionScope(value) {
|
|
|
56692
56795
|
}
|
|
56693
56796
|
return value.some(({ destination }) => permissionUpdateDestination(destination) === "always") ? "always" : "session";
|
|
56694
56797
|
}
|
|
56695
|
-
function parseApprovalRequest(
|
|
56798
|
+
function parseApprovalRequest(requestId2, toolName, options, agentLabel) {
|
|
56696
56799
|
const toolTitle = [options.title, options.displayName, options.description, toolName].map((value) => boundedDisplayText(value, APPROVAL_TITLE_MAX_LENGTH)).find((value) => value !== null);
|
|
56697
56800
|
if (!toolTitle)
|
|
56698
56801
|
return null;
|
|
@@ -56701,7 +56804,7 @@ function parseApprovalRequest(requestId, toolName, options, agentLabel) {
|
|
|
56701
56804
|
const suggestedScope = permissionSuggestionScope(options.suggestions);
|
|
56702
56805
|
return {
|
|
56703
56806
|
type: "approval",
|
|
56704
|
-
requestId,
|
|
56807
|
+
requestId: requestId2,
|
|
56705
56808
|
title,
|
|
56706
56809
|
...description && description !== title ? { description } : {},
|
|
56707
56810
|
...suggestedScope ? { suggestedScope } : {}
|
|
@@ -57145,19 +57248,19 @@ var ClaudeSdkTransport = class {
|
|
|
57145
57248
|
}
|
|
57146
57249
|
const agentId = typeof options.agentID === "string" && options.agentID.length > 0 ? options.agentID : void 0;
|
|
57147
57250
|
this.#interactionOrdinal += 1;
|
|
57148
|
-
const
|
|
57251
|
+
const requestId2 = `claude-${toolName === "AskUserQuestion" ? "question" : "approval"}-${this.#interactionOrdinal}`;
|
|
57149
57252
|
let request;
|
|
57150
57253
|
if (toolName === "AskUserQuestion") {
|
|
57151
57254
|
const questions = parseQuestions(input);
|
|
57152
|
-
request = questions ? { type: "question", requestId, questions } : null;
|
|
57255
|
+
request = questions ? { type: "question", requestId: requestId2, questions } : null;
|
|
57153
57256
|
} else if (toolName === "ExitPlanMode") {
|
|
57154
57257
|
request = {
|
|
57155
57258
|
type: "planApproval",
|
|
57156
|
-
requestId,
|
|
57259
|
+
requestId: requestId2,
|
|
57157
57260
|
plan: typeof input.plan === "string" && input.plan.trim().length > 0 ? input.plan : null
|
|
57158
57261
|
};
|
|
57159
57262
|
} else {
|
|
57160
|
-
request = parseApprovalRequest(
|
|
57263
|
+
request = parseApprovalRequest(requestId2, toolName, options, agentId ? this.#workflowAgentLabels.get(agentId) : void 0);
|
|
57161
57264
|
}
|
|
57162
57265
|
if (!request) {
|
|
57163
57266
|
return Promise.resolve(denied(options.toolUseID, "Claude Tool permission request is invalid"));
|
|
@@ -57675,6 +57778,7 @@ var ClaudeSubagentLifecycle = class {
|
|
|
57675
57778
|
...event.nativeSubagentId ? { nativeSubagentId: event.nativeSubagentId } : {},
|
|
57676
57779
|
description: event.description,
|
|
57677
57780
|
...event.role ? { role: event.role } : {},
|
|
57781
|
+
...event.model ? { model: event.model } : {},
|
|
57678
57782
|
background: event.background,
|
|
57679
57783
|
status: "running"
|
|
57680
57784
|
};
|
|
@@ -57701,6 +57805,7 @@ var ClaudeSubagentLifecycle = class {
|
|
|
57701
57805
|
...event.nativeSubagentId ? { nativeSubagentId: event.nativeSubagentId } : {},
|
|
57702
57806
|
...event.description ? { description: event.description } : {},
|
|
57703
57807
|
...event.role ? { role: event.role } : {},
|
|
57808
|
+
...event.model ? { model: event.model } : {},
|
|
57704
57809
|
...event.resultSummary ? { resultSummary: event.resultSummary } : {}
|
|
57705
57810
|
};
|
|
57706
57811
|
active.item = { ...active.item, subagents: [subagent] };
|
|
@@ -58035,7 +58140,7 @@ var ClaudeTaskTracker = class {
|
|
|
58035
58140
|
};
|
|
58036
58141
|
|
|
58037
58142
|
// dist/background-command-items.js
|
|
58038
|
-
import { open as
|
|
58143
|
+
import { open as open5 } from "node:fs/promises";
|
|
58039
58144
|
import { StringDecoder } from "node:string_decoder";
|
|
58040
58145
|
var POLL_INTERVAL_MS = 1e3;
|
|
58041
58146
|
var READ_CHUNK_BYTES = 64 * 1024;
|
|
@@ -58118,7 +58223,7 @@ var ClaudeBackgroundCommandItems = class {
|
|
|
58118
58223
|
return;
|
|
58119
58224
|
let handle;
|
|
58120
58225
|
try {
|
|
58121
|
-
handle = await
|
|
58226
|
+
handle = await open5(followed.outputFile, "r");
|
|
58122
58227
|
} catch {
|
|
58123
58228
|
return;
|
|
58124
58229
|
}
|
|
@@ -59977,12 +60082,12 @@ var ClaudeHarnessSession = class {
|
|
|
59977
60082
|
active.interactionByRequestId.set(request.requestId, interactionId);
|
|
59978
60083
|
this.#channel.emit({ kind: "interaction", interaction: pending.interaction });
|
|
59979
60084
|
}
|
|
59980
|
-
#closeInteraction(active,
|
|
59981
|
-
const interactionId = active.interactionByRequestId.get(
|
|
60085
|
+
#closeInteraction(active, requestId2, reason) {
|
|
60086
|
+
const interactionId = active.interactionByRequestId.get(requestId2);
|
|
59982
60087
|
if (!interactionId)
|
|
59983
60088
|
throw new Error("Claude Code Interaction close references an unknown request");
|
|
59984
|
-
active.interactionByRequestId.delete(
|
|
59985
|
-
active.agentScopedRequestIds.delete(
|
|
60089
|
+
active.interactionByRequestId.delete(requestId2);
|
|
60090
|
+
active.agentScopedRequestIds.delete(requestId2);
|
|
59986
60091
|
active.interactions.delete(interactionId);
|
|
59987
60092
|
this.#event({
|
|
59988
60093
|
type: "interaction.closed",
|
|
@@ -60007,8 +60112,8 @@ var ClaudeHarnessSession = class {
|
|
|
60007
60112
|
}
|
|
60008
60113
|
}
|
|
60009
60114
|
#hasRootInteractions(active) {
|
|
60010
|
-
for (const
|
|
60011
|
-
if (!active.agentScopedRequestIds.has(
|
|
60115
|
+
for (const requestId2 of active.interactionByRequestId.keys()) {
|
|
60116
|
+
if (!active.agentScopedRequestIds.has(requestId2))
|
|
60012
60117
|
return true;
|
|
60013
60118
|
}
|
|
60014
60119
|
return false;
|
|
@@ -60359,10 +60464,10 @@ var ClaudeHarnessSession = class {
|
|
|
60359
60464
|
}
|
|
60360
60465
|
}
|
|
60361
60466
|
#applyLatestRequestUsage(active, usage) {
|
|
60362
|
-
const
|
|
60363
|
-
if (active.usageRequestIds.has(
|
|
60467
|
+
const requestId2 = usage.requestId ?? `${active.nativeTurnKey}:${usage.model ?? "unknown"}`;
|
|
60468
|
+
if (active.usageRequestIds.has(requestId2))
|
|
60364
60469
|
return;
|
|
60365
|
-
active.usageRequestIds.add(
|
|
60470
|
+
active.usageRequestIds.add(requestId2);
|
|
60366
60471
|
active.estimatedInputTokens += usage.inputTokens + usage.cacheCreationInputTokens + usage.cacheReadInputTokens;
|
|
60367
60472
|
active.estimatedOutputTokens += usage.outputTokens;
|
|
60368
60473
|
const estimatedCostUsd = estimateClaudeRequestCostUsd(usage);
|
|
@@ -61142,6 +61247,24 @@ function createClaudeInstallation(environment, command) {
|
|
|
61142
61247
|
environment,
|
|
61143
61248
|
...command ? { command } : {}
|
|
61144
61249
|
});
|
|
61250
|
+
const launcherScript = await readLauncherScript(executable);
|
|
61251
|
+
if (launcherScript.includes("CLAWGOD_CLI=")) {
|
|
61252
|
+
return {
|
|
61253
|
+
currentVersion: versionFromOutput(await runInstallationCommand(executable, ["--version"], {
|
|
61254
|
+
...environment,
|
|
61255
|
+
DISABLE_AUTOUPDATER: "1"
|
|
61256
|
+
})),
|
|
61257
|
+
latestVersion: "Unknown",
|
|
61258
|
+
latestVersionKind: "unknown",
|
|
61259
|
+
updateAvailable: false,
|
|
61260
|
+
canUpdate: false,
|
|
61261
|
+
messageCode: "original-installer",
|
|
61262
|
+
notice: {
|
|
61263
|
+
en: "Managed by clawgod. Use clawgod's updater or installer to preserve the installed patches. The latest patched version is not checked here.",
|
|
61264
|
+
"zh-CN": "此安装由 clawgod 管理。请使用 clawgod 的更新程序或安装程序保留补丁;此处不检查最新补丁版本。"
|
|
61265
|
+
}
|
|
61266
|
+
};
|
|
61267
|
+
}
|
|
61145
61268
|
const home = environment.HOME ?? environment.USERPROFILE ?? homedir2();
|
|
61146
61269
|
const config2 = environment.CLAUDE_CONFIG_DIR ? path17.resolve(home, environment.CLAUDE_CONFIG_DIR) : path17.join(home, ".claude");
|
|
61147
61270
|
const managedFile = process.platform === "darwin" ? "/Library/Application Support/ClaudeCode/managed-settings.json" : process.platform === "win32" ? path17.join(environment.ProgramFiles ?? "C:\\Program Files", "ClaudeCode", "managed-settings.json") : "/etc/claude-code/managed-settings.json";
|