@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
|
@@ -246,7 +246,19 @@ function resolveHarnessExecutable(spec, input, dependencies = {}) {
|
|
|
246
246
|
|
|
247
247
|
// ../../harness-discovery/dist/installation.js
|
|
248
248
|
import { execFile } from "node:child_process";
|
|
249
|
+
import { open } from "node:fs/promises";
|
|
249
250
|
import { homedir } from "node:os";
|
|
251
|
+
async function readLauncherScript(command) {
|
|
252
|
+
const file2 = await open(command, "r");
|
|
253
|
+
try {
|
|
254
|
+
const buffer = Buffer.alloc(4096);
|
|
255
|
+
const { bytesRead } = await file2.read(buffer, 0, buffer.length, 0);
|
|
256
|
+
const prefix = buffer.toString("utf8", 0, bytesRead);
|
|
257
|
+
return prefix.startsWith("#!") || /\.(cmd|bat|ps1)$/i.test(command) ? prefix : "";
|
|
258
|
+
} finally {
|
|
259
|
+
await file2.close();
|
|
260
|
+
}
|
|
261
|
+
}
|
|
250
262
|
function runInstallationCommand(command, args, environment, timeout = 3e4) {
|
|
251
263
|
const env = withNodeRuntimeOnPath(environment);
|
|
252
264
|
const invocation = /\.[cm]?js$/i.test(command) ? commandInvocation(process.execPath, [command, ...args], env) : commandInvocation(command, args, env);
|
|
@@ -274,6 +286,9 @@ function installationVersion(value) {
|
|
|
274
286
|
throw new Error("Harness returned an invalid version");
|
|
275
287
|
return value.trim().replace(/^v/, "");
|
|
276
288
|
}
|
|
289
|
+
function versionFromOutput(output) {
|
|
290
|
+
return installationVersion(output.match(/\b\d+(?:\.\d+){1,3}(?:-[\w.-]+)?(?:\+[\w.-]+)?\b/)?.[0]);
|
|
291
|
+
}
|
|
277
292
|
function createInstallationManager(options) {
|
|
278
293
|
let checking;
|
|
279
294
|
let updating;
|
|
@@ -15372,6 +15387,36 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
|
15372
15387
|
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
15373
15388
|
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
15374
15389
|
|
|
15390
|
+
// ../../shared-contracts/dist/realtime-call.js
|
|
15391
|
+
var REALTIME_CALL_FORWARDED_HEADERS = [
|
|
15392
|
+
"openai-alpha",
|
|
15393
|
+
"thread-id",
|
|
15394
|
+
"session-id",
|
|
15395
|
+
"originator",
|
|
15396
|
+
"x-codex-turn-metadata"
|
|
15397
|
+
];
|
|
15398
|
+
var FORWARDED_HEADERS = new Set(REALTIME_CALL_FORWARDED_HEADERS);
|
|
15399
|
+
var REALTIME_CALL_ID_PATTERN = /^rtc_[A-Za-z0-9_-]{1,128}$/u;
|
|
15400
|
+
var requestId = external_exports.string().min(1).max(128);
|
|
15401
|
+
var realtimeCallParamsSchema = external_exports.discriminatedUnion("operation", [
|
|
15402
|
+
external_exports.object({
|
|
15403
|
+
operation: external_exports.literal("create"),
|
|
15404
|
+
requestId,
|
|
15405
|
+
body: external_exports.string().min(1).max(16 << 20),
|
|
15406
|
+
headers: external_exports.record(external_exports.string(), external_exports.string()).default({})
|
|
15407
|
+
}),
|
|
15408
|
+
external_exports.object({ operation: external_exports.literal("cancel"), requestId }),
|
|
15409
|
+
external_exports.object({
|
|
15410
|
+
operation: external_exports.literal("hangup"),
|
|
15411
|
+
callId: external_exports.string().regex(REALTIME_CALL_ID_PATTERN)
|
|
15412
|
+
})
|
|
15413
|
+
]);
|
|
15414
|
+
var realtimeCallResponseSchema = external_exports.object({
|
|
15415
|
+
status: external_exports.number().int().min(200).max(599),
|
|
15416
|
+
body: external_exports.string(),
|
|
15417
|
+
headers: external_exports.record(external_exports.string(), external_exports.string())
|
|
15418
|
+
});
|
|
15419
|
+
|
|
15375
15420
|
// ../../shared-contracts/dist/console.js
|
|
15376
15421
|
var consoleAnnouncementSchema = external_exports.strictObject({
|
|
15377
15422
|
title: external_exports.string().trim().min(1).max(200),
|
|
@@ -15384,6 +15429,7 @@ var consoleOpenResultSchema = external_exports.strictObject({
|
|
|
15384
15429
|
url: external_exports.string().max(2048).regex(/^http:\/\/(?:127\.0\.0\.1|localhost):\d{1,5}\/(?:\?.*)?$/u)
|
|
15385
15430
|
});
|
|
15386
15431
|
var CONSOLE_HOST_METHODS = Object.freeze([
|
|
15432
|
+
"codexhost/voice/gateway-status",
|
|
15387
15433
|
"codexhost/console/remote-connections",
|
|
15388
15434
|
"codexhost/runtime/status",
|
|
15389
15435
|
"codexhost/remote/ssh-setup",
|
|
@@ -16493,6 +16539,52 @@ var remoteConnectionsReplySchema = external_exports.union([
|
|
|
16493
16539
|
external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
|
|
16494
16540
|
]);
|
|
16495
16541
|
|
|
16542
|
+
// ../../shared-contracts/dist/voice-settings.js
|
|
16543
|
+
var voiceRoutesSchema = external_exports.strictObject({
|
|
16544
|
+
chatExperience: external_exports.enum(["chatgpt", "codex"]),
|
|
16545
|
+
chatConnection: external_exports.enum(["desktop", "gateway"]),
|
|
16546
|
+
workConnection: external_exports.enum(["desktop", "gateway"])
|
|
16547
|
+
});
|
|
16548
|
+
var DEFAULT_VOICE_ROUTES = Object.freeze({
|
|
16549
|
+
chatExperience: "chatgpt",
|
|
16550
|
+
chatConnection: "desktop",
|
|
16551
|
+
workConnection: "gateway"
|
|
16552
|
+
});
|
|
16553
|
+
var voiceSettingsSchema = voiceRoutesSchema.extend({ inject: external_exports.boolean() });
|
|
16554
|
+
var voiceSettingsRequestSchema = external_exports.discriminatedUnion("operation", [
|
|
16555
|
+
external_exports.strictObject({
|
|
16556
|
+
operation: external_exports.literal("get"),
|
|
16557
|
+
runtime: external_exports.strictObject({
|
|
16558
|
+
id: external_exports.string().uuid(),
|
|
16559
|
+
revision: external_exports.string().max(64),
|
|
16560
|
+
activeCall: external_exports.boolean()
|
|
16561
|
+
}).optional()
|
|
16562
|
+
}),
|
|
16563
|
+
external_exports.strictObject({ operation: external_exports.literal("migrate"), routes: voiceRoutesSchema }),
|
|
16564
|
+
external_exports.strictObject({
|
|
16565
|
+
operation: external_exports.literal("set"),
|
|
16566
|
+
settings: voiceSettingsSchema,
|
|
16567
|
+
revision: external_exports.string().max(64)
|
|
16568
|
+
}),
|
|
16569
|
+
external_exports.strictObject({ operation: external_exports.literal("restart"), confirm: external_exports.literal(true) })
|
|
16570
|
+
]);
|
|
16571
|
+
var voiceSettingsStateSchema = external_exports.strictObject({
|
|
16572
|
+
settings: voiceSettingsSchema,
|
|
16573
|
+
initialized: external_exports.boolean(),
|
|
16574
|
+
revision: external_exports.string(),
|
|
16575
|
+
activeInject: external_exports.boolean().nullable(),
|
|
16576
|
+
envOverride: external_exports.enum(["0", "1"]).nullable(),
|
|
16577
|
+
activeEnvOverride: external_exports.enum(["0", "1"]).nullable(),
|
|
16578
|
+
routesActive: external_exports.boolean().nullable(),
|
|
16579
|
+
activeCall: external_exports.boolean().nullable(),
|
|
16580
|
+
gatewayReady: external_exports.boolean().nullable(),
|
|
16581
|
+
restartAvailable: external_exports.boolean(),
|
|
16582
|
+
restart: external_exports.strictObject({
|
|
16583
|
+
phase: external_exports.enum(["idle", "restarting", "succeeded", "failed"]),
|
|
16584
|
+
error: external_exports.string().nullable()
|
|
16585
|
+
})
|
|
16586
|
+
});
|
|
16587
|
+
|
|
16496
16588
|
// ../../shared-contracts/dist/index.js
|
|
16497
16589
|
var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
|
|
16498
16590
|
|
|
@@ -18774,8 +18866,8 @@ var ConnectionContext = class {
|
|
|
18774
18866
|
/**
|
|
18775
18867
|
* Sends a protocol-level request cancellation notification.
|
|
18776
18868
|
*/
|
|
18777
|
-
sendCancelRequest(
|
|
18778
|
-
return this.connection.sendCancelRequest(
|
|
18869
|
+
sendCancelRequest(requestId2) {
|
|
18870
|
+
return this.connection.sendCancelRequest(requestId2);
|
|
18779
18871
|
}
|
|
18780
18872
|
/**
|
|
18781
18873
|
* Registers a handler that can be disposed independently.
|
|
@@ -18960,8 +19052,8 @@ var Connection = class {
|
|
|
18960
19052
|
/**
|
|
18961
19053
|
* Sends a protocol-level request cancellation notification.
|
|
18962
19054
|
*/
|
|
18963
|
-
sendCancelRequest(
|
|
18964
|
-
return this.sendNotification(CANCEL_REQUEST_METHOD, { requestId });
|
|
19055
|
+
sendCancelRequest(requestId2) {
|
|
19056
|
+
return this.sendNotification(CANCEL_REQUEST_METHOD, { requestId: requestId2 });
|
|
18965
19057
|
}
|
|
18966
19058
|
/**
|
|
18967
19059
|
* Sends a JSON-RPC notification.
|
|
@@ -19269,15 +19361,15 @@ var Connection = class {
|
|
|
19269
19361
|
if (message.method !== CANCEL_REQUEST_METHOD) {
|
|
19270
19362
|
return;
|
|
19271
19363
|
}
|
|
19272
|
-
const
|
|
19273
|
-
if (
|
|
19364
|
+
const requestId2 = cancelRequestId(message.params);
|
|
19365
|
+
if (requestId2 === void 0) {
|
|
19274
19366
|
return;
|
|
19275
19367
|
}
|
|
19276
|
-
const controller = this.incomingRequests.get(
|
|
19368
|
+
const controller = this.incomingRequests.get(requestId2);
|
|
19277
19369
|
if (!controller || controller.signal.aborted) {
|
|
19278
19370
|
return;
|
|
19279
19371
|
}
|
|
19280
|
-
controller.abort(RequestError.requestCancelled({ requestId }));
|
|
19372
|
+
controller.abort(RequestError.requestCancelled({ requestId: requestId2 }));
|
|
19281
19373
|
}
|
|
19282
19374
|
closedReason() {
|
|
19283
19375
|
return this.abortController.signal.reason ?? new Error("ACP connection closed");
|
|
@@ -19743,12 +19835,12 @@ var AcpContext = class {
|
|
|
19743
19835
|
}
|
|
19744
19836
|
};
|
|
19745
19837
|
var AgentContext = class _AgentContext extends AcpContext {
|
|
19746
|
-
constructor(cx,
|
|
19747
|
-
super(cx,
|
|
19838
|
+
constructor(cx, requestId2) {
|
|
19839
|
+
super(cx, requestId2);
|
|
19748
19840
|
}
|
|
19749
19841
|
/** @internal */
|
|
19750
|
-
static create(cx,
|
|
19751
|
-
return new _AgentContext(cx,
|
|
19842
|
+
static create(cx, requestId2) {
|
|
19843
|
+
return new _AgentContext(cx, requestId2);
|
|
19752
19844
|
}
|
|
19753
19845
|
request(method, params, options) {
|
|
19754
19846
|
const spec = clientRequestSpecsByMethod[method];
|
|
@@ -19759,12 +19851,12 @@ var AgentContext = class _AgentContext extends AcpContext {
|
|
|
19759
19851
|
}
|
|
19760
19852
|
};
|
|
19761
19853
|
var ClientContext = class _ClientContext extends AcpContext {
|
|
19762
|
-
constructor(cx,
|
|
19763
|
-
super(cx,
|
|
19854
|
+
constructor(cx, requestId2) {
|
|
19855
|
+
super(cx, requestId2);
|
|
19764
19856
|
}
|
|
19765
19857
|
/** @internal */
|
|
19766
|
-
static create(cx,
|
|
19767
|
-
return new _ClientContext(cx,
|
|
19858
|
+
static create(cx, requestId2) {
|
|
19859
|
+
return new _ClientContext(cx, requestId2);
|
|
19768
19860
|
}
|
|
19769
19861
|
/** @internal */
|
|
19770
19862
|
[startActiveSession](params, options) {
|
|
@@ -20197,10 +20289,10 @@ var agentRequestSpecsByMethod = specsByMethod(agentRequestSpecs);
|
|
|
20197
20289
|
var agentNotificationSpecsByMethod = specsByMethod(agentNotificationSpecs);
|
|
20198
20290
|
var clientRequestSpecsByMethod = specsByMethod(clientRequestSpecs);
|
|
20199
20291
|
var clientNotificationSpecsByMethod = specsByMethod(clientNotificationSpecs);
|
|
20200
|
-
function agentRequestContext(params, client2, signal,
|
|
20292
|
+
function agentRequestContext(params, client2, signal, requestId2) {
|
|
20201
20293
|
return {
|
|
20202
20294
|
params,
|
|
20203
|
-
requestId,
|
|
20295
|
+
requestId: requestId2,
|
|
20204
20296
|
signal,
|
|
20205
20297
|
client: client2
|
|
20206
20298
|
};
|
|
@@ -20212,10 +20304,10 @@ function agentNotificationContext(params, client2, signal) {
|
|
|
20212
20304
|
client: client2
|
|
20213
20305
|
};
|
|
20214
20306
|
}
|
|
20215
|
-
function clientRequestContext(params, agent, signal,
|
|
20307
|
+
function clientRequestContext(params, agent, signal, requestId2) {
|
|
20216
20308
|
return {
|
|
20217
20309
|
params,
|
|
20218
|
-
requestId,
|
|
20310
|
+
requestId: requestId2,
|
|
20219
20311
|
signal,
|
|
20220
20312
|
agent
|
|
20221
20313
|
};
|
|
@@ -20340,7 +20432,7 @@ var AgentApp = class {
|
|
|
20340
20432
|
return this.notification(spec, handlerOrParams);
|
|
20341
20433
|
}
|
|
20342
20434
|
request(spec, handler) {
|
|
20343
|
-
registerAppRequest(this.builder, spec, (params, cx, signal,
|
|
20435
|
+
registerAppRequest(this.builder, spec, (params, cx, signal, requestId2) => agentRequestContext(params, AgentContext.create(cx, requestId2), signal, requestId2), handler);
|
|
20344
20436
|
return this;
|
|
20345
20437
|
}
|
|
20346
20438
|
notification(spec, handler) {
|
|
@@ -20440,7 +20532,7 @@ var ClientApp = class {
|
|
|
20440
20532
|
return this.notification(spec, handlerOrParams);
|
|
20441
20533
|
}
|
|
20442
20534
|
request(spec, handler) {
|
|
20443
|
-
registerAppRequest(this.builder, spec, (params, cx, signal,
|
|
20535
|
+
registerAppRequest(this.builder, spec, (params, cx, signal, requestId2) => clientRequestContext(params, ClientContext.create(cx, requestId2), signal, requestId2), handler);
|
|
20444
20536
|
return this;
|
|
20445
20537
|
}
|
|
20446
20538
|
notification(spec, handler) {
|
|
@@ -23976,8 +24068,12 @@ var GrokAcpTransport = class {
|
|
|
23976
24068
|
const response = await connection.request("session/set_model", {
|
|
23977
24069
|
sessionId: this.#sessionId,
|
|
23978
24070
|
modelId,
|
|
23979
|
-
...reasoningEffort
|
|
23980
|
-
|
|
24071
|
+
...reasoningEffort || contextWindowTokens !== void 0 ? {
|
|
24072
|
+
_meta: {
|
|
24073
|
+
...reasoningEffort ? { reasoningEffort } : {},
|
|
24074
|
+
...contextWindowTokens !== void 0 ? { contextWindow: contextWindowTokens } : {}
|
|
24075
|
+
}
|
|
24076
|
+
} : {}
|
|
23981
24077
|
});
|
|
23982
24078
|
if (!isRecord13(response) || !isRecord13(response._meta) || !isRecord13(response._meta.model)) {
|
|
23983
24079
|
throw new GrokTransportError("protocolError", "Grok rejected Model configuration");
|
|
@@ -26531,6 +26627,24 @@ function createGrokInstallation(environment, command) {
|
|
|
26531
26627
|
let installer = "";
|
|
26532
26628
|
return createInstallationManager({
|
|
26533
26629
|
async check() {
|
|
26630
|
+
const launcher = await readLauncherScript(resolveGrokExecutable({ environment, ...command ? { command } : {} }));
|
|
26631
|
+
if (launcher.includes("GROKGOD_HOME=") && launcher.includes("GROKGOD_BIN=")) {
|
|
26632
|
+
return {
|
|
26633
|
+
currentVersion: versionFromOutput(await run(["--version"], void 0, {
|
|
26634
|
+
GROK_DISABLE_AUTOUPDATER: "1",
|
|
26635
|
+
GROKGOD_UPDATE_CHECK_DISABLE: "1"
|
|
26636
|
+
})),
|
|
26637
|
+
latestVersion: "Unknown",
|
|
26638
|
+
latestVersionKind: "unknown",
|
|
26639
|
+
updateAvailable: false,
|
|
26640
|
+
canUpdate: false,
|
|
26641
|
+
messageCode: "original-installer",
|
|
26642
|
+
notice: {
|
|
26643
|
+
en: "Managed by grokgod. Use grokgod's updater or installer to preserve the installed patches. The latest patched version is not checked here.",
|
|
26644
|
+
"zh-CN": "此安装由 grokgod 管理。请使用 grokgod 的更新程序或安装程序保留补丁;此处不检查最新补丁版本。"
|
|
26645
|
+
}
|
|
26646
|
+
};
|
|
26647
|
+
}
|
|
26534
26648
|
const state = JSON.parse(await run(["update", "--check", "--json"]));
|
|
26535
26649
|
if (state.error || typeof state.updateAvailable !== "boolean")
|
|
26536
26650
|
throw new Error("Grok update check failed");
|
|
@@ -15142,6 +15142,36 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
|
15142
15142
|
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
15143
15143
|
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
15144
15144
|
|
|
15145
|
+
// ../../shared-contracts/dist/realtime-call.js
|
|
15146
|
+
var REALTIME_CALL_FORWARDED_HEADERS = [
|
|
15147
|
+
"openai-alpha",
|
|
15148
|
+
"thread-id",
|
|
15149
|
+
"session-id",
|
|
15150
|
+
"originator",
|
|
15151
|
+
"x-codex-turn-metadata"
|
|
15152
|
+
];
|
|
15153
|
+
var FORWARDED_HEADERS = new Set(REALTIME_CALL_FORWARDED_HEADERS);
|
|
15154
|
+
var REALTIME_CALL_ID_PATTERN = /^rtc_[A-Za-z0-9_-]{1,128}$/u;
|
|
15155
|
+
var requestId = external_exports.string().min(1).max(128);
|
|
15156
|
+
var realtimeCallParamsSchema = external_exports.discriminatedUnion("operation", [
|
|
15157
|
+
external_exports.object({
|
|
15158
|
+
operation: external_exports.literal("create"),
|
|
15159
|
+
requestId,
|
|
15160
|
+
body: external_exports.string().min(1).max(16 << 20),
|
|
15161
|
+
headers: external_exports.record(external_exports.string(), external_exports.string()).default({})
|
|
15162
|
+
}),
|
|
15163
|
+
external_exports.object({ operation: external_exports.literal("cancel"), requestId }),
|
|
15164
|
+
external_exports.object({
|
|
15165
|
+
operation: external_exports.literal("hangup"),
|
|
15166
|
+
callId: external_exports.string().regex(REALTIME_CALL_ID_PATTERN)
|
|
15167
|
+
})
|
|
15168
|
+
]);
|
|
15169
|
+
var realtimeCallResponseSchema = external_exports.object({
|
|
15170
|
+
status: external_exports.number().int().min(200).max(599),
|
|
15171
|
+
body: external_exports.string(),
|
|
15172
|
+
headers: external_exports.record(external_exports.string(), external_exports.string())
|
|
15173
|
+
});
|
|
15174
|
+
|
|
15145
15175
|
// ../../shared-contracts/dist/console.js
|
|
15146
15176
|
var consoleAnnouncementSchema = external_exports.strictObject({
|
|
15147
15177
|
title: external_exports.string().trim().min(1).max(200),
|
|
@@ -15154,6 +15184,7 @@ var consoleOpenResultSchema = external_exports.strictObject({
|
|
|
15154
15184
|
url: external_exports.string().max(2048).regex(/^http:\/\/(?:127\.0\.0\.1|localhost):\d{1,5}\/(?:\?.*)?$/u)
|
|
15155
15185
|
});
|
|
15156
15186
|
var CONSOLE_HOST_METHODS = Object.freeze([
|
|
15187
|
+
"codexhost/voice/gateway-status",
|
|
15157
15188
|
"codexhost/console/remote-connections",
|
|
15158
15189
|
"codexhost/runtime/status",
|
|
15159
15190
|
"codexhost/remote/ssh-setup",
|
|
@@ -16263,6 +16294,52 @@ var remoteConnectionsReplySchema = external_exports.union([
|
|
|
16263
16294
|
external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
|
|
16264
16295
|
]);
|
|
16265
16296
|
|
|
16297
|
+
// ../../shared-contracts/dist/voice-settings.js
|
|
16298
|
+
var voiceRoutesSchema = external_exports.strictObject({
|
|
16299
|
+
chatExperience: external_exports.enum(["chatgpt", "codex"]),
|
|
16300
|
+
chatConnection: external_exports.enum(["desktop", "gateway"]),
|
|
16301
|
+
workConnection: external_exports.enum(["desktop", "gateway"])
|
|
16302
|
+
});
|
|
16303
|
+
var DEFAULT_VOICE_ROUTES = Object.freeze({
|
|
16304
|
+
chatExperience: "chatgpt",
|
|
16305
|
+
chatConnection: "desktop",
|
|
16306
|
+
workConnection: "gateway"
|
|
16307
|
+
});
|
|
16308
|
+
var voiceSettingsSchema = voiceRoutesSchema.extend({ inject: external_exports.boolean() });
|
|
16309
|
+
var voiceSettingsRequestSchema = external_exports.discriminatedUnion("operation", [
|
|
16310
|
+
external_exports.strictObject({
|
|
16311
|
+
operation: external_exports.literal("get"),
|
|
16312
|
+
runtime: external_exports.strictObject({
|
|
16313
|
+
id: external_exports.string().uuid(),
|
|
16314
|
+
revision: external_exports.string().max(64),
|
|
16315
|
+
activeCall: external_exports.boolean()
|
|
16316
|
+
}).optional()
|
|
16317
|
+
}),
|
|
16318
|
+
external_exports.strictObject({ operation: external_exports.literal("migrate"), routes: voiceRoutesSchema }),
|
|
16319
|
+
external_exports.strictObject({
|
|
16320
|
+
operation: external_exports.literal("set"),
|
|
16321
|
+
settings: voiceSettingsSchema,
|
|
16322
|
+
revision: external_exports.string().max(64)
|
|
16323
|
+
}),
|
|
16324
|
+
external_exports.strictObject({ operation: external_exports.literal("restart"), confirm: external_exports.literal(true) })
|
|
16325
|
+
]);
|
|
16326
|
+
var voiceSettingsStateSchema = external_exports.strictObject({
|
|
16327
|
+
settings: voiceSettingsSchema,
|
|
16328
|
+
initialized: external_exports.boolean(),
|
|
16329
|
+
revision: external_exports.string(),
|
|
16330
|
+
activeInject: external_exports.boolean().nullable(),
|
|
16331
|
+
envOverride: external_exports.enum(["0", "1"]).nullable(),
|
|
16332
|
+
activeEnvOverride: external_exports.enum(["0", "1"]).nullable(),
|
|
16333
|
+
routesActive: external_exports.boolean().nullable(),
|
|
16334
|
+
activeCall: external_exports.boolean().nullable(),
|
|
16335
|
+
gatewayReady: external_exports.boolean().nullable(),
|
|
16336
|
+
restartAvailable: external_exports.boolean(),
|
|
16337
|
+
restart: external_exports.strictObject({
|
|
16338
|
+
phase: external_exports.enum(["idle", "restarting", "succeeded", "failed"]),
|
|
16339
|
+
error: external_exports.string().nullable()
|
|
16340
|
+
})
|
|
16341
|
+
});
|
|
16342
|
+
|
|
16266
16343
|
// ../../shared-contracts/dist/index.js
|
|
16267
16344
|
var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
|
|
16268
16345
|
|
|
@@ -15262,6 +15262,36 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
|
15262
15262
|
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
15263
15263
|
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
15264
15264
|
|
|
15265
|
+
// ../../shared-contracts/dist/realtime-call.js
|
|
15266
|
+
var REALTIME_CALL_FORWARDED_HEADERS = [
|
|
15267
|
+
"openai-alpha",
|
|
15268
|
+
"thread-id",
|
|
15269
|
+
"session-id",
|
|
15270
|
+
"originator",
|
|
15271
|
+
"x-codex-turn-metadata"
|
|
15272
|
+
];
|
|
15273
|
+
var FORWARDED_HEADERS = new Set(REALTIME_CALL_FORWARDED_HEADERS);
|
|
15274
|
+
var REALTIME_CALL_ID_PATTERN = /^rtc_[A-Za-z0-9_-]{1,128}$/u;
|
|
15275
|
+
var requestId = external_exports.string().min(1).max(128);
|
|
15276
|
+
var realtimeCallParamsSchema = external_exports.discriminatedUnion("operation", [
|
|
15277
|
+
external_exports.object({
|
|
15278
|
+
operation: external_exports.literal("create"),
|
|
15279
|
+
requestId,
|
|
15280
|
+
body: external_exports.string().min(1).max(16 << 20),
|
|
15281
|
+
headers: external_exports.record(external_exports.string(), external_exports.string()).default({})
|
|
15282
|
+
}),
|
|
15283
|
+
external_exports.object({ operation: external_exports.literal("cancel"), requestId }),
|
|
15284
|
+
external_exports.object({
|
|
15285
|
+
operation: external_exports.literal("hangup"),
|
|
15286
|
+
callId: external_exports.string().regex(REALTIME_CALL_ID_PATTERN)
|
|
15287
|
+
})
|
|
15288
|
+
]);
|
|
15289
|
+
var realtimeCallResponseSchema = external_exports.object({
|
|
15290
|
+
status: external_exports.number().int().min(200).max(599),
|
|
15291
|
+
body: external_exports.string(),
|
|
15292
|
+
headers: external_exports.record(external_exports.string(), external_exports.string())
|
|
15293
|
+
});
|
|
15294
|
+
|
|
15265
15295
|
// ../../shared-contracts/dist/console.js
|
|
15266
15296
|
var consoleAnnouncementSchema = external_exports.strictObject({
|
|
15267
15297
|
title: external_exports.string().trim().min(1).max(200),
|
|
@@ -15274,6 +15304,7 @@ var consoleOpenResultSchema = external_exports.strictObject({
|
|
|
15274
15304
|
url: external_exports.string().max(2048).regex(/^http:\/\/(?:127\.0\.0\.1|localhost):\d{1,5}\/(?:\?.*)?$/u)
|
|
15275
15305
|
});
|
|
15276
15306
|
var CONSOLE_HOST_METHODS = Object.freeze([
|
|
15307
|
+
"codexhost/voice/gateway-status",
|
|
15277
15308
|
"codexhost/console/remote-connections",
|
|
15278
15309
|
"codexhost/runtime/status",
|
|
15279
15310
|
"codexhost/remote/ssh-setup",
|
|
@@ -16383,6 +16414,52 @@ var remoteConnectionsReplySchema = external_exports.union([
|
|
|
16383
16414
|
external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
|
|
16384
16415
|
]);
|
|
16385
16416
|
|
|
16417
|
+
// ../../shared-contracts/dist/voice-settings.js
|
|
16418
|
+
var voiceRoutesSchema = external_exports.strictObject({
|
|
16419
|
+
chatExperience: external_exports.enum(["chatgpt", "codex"]),
|
|
16420
|
+
chatConnection: external_exports.enum(["desktop", "gateway"]),
|
|
16421
|
+
workConnection: external_exports.enum(["desktop", "gateway"])
|
|
16422
|
+
});
|
|
16423
|
+
var DEFAULT_VOICE_ROUTES = Object.freeze({
|
|
16424
|
+
chatExperience: "chatgpt",
|
|
16425
|
+
chatConnection: "desktop",
|
|
16426
|
+
workConnection: "gateway"
|
|
16427
|
+
});
|
|
16428
|
+
var voiceSettingsSchema = voiceRoutesSchema.extend({ inject: external_exports.boolean() });
|
|
16429
|
+
var voiceSettingsRequestSchema = external_exports.discriminatedUnion("operation", [
|
|
16430
|
+
external_exports.strictObject({
|
|
16431
|
+
operation: external_exports.literal("get"),
|
|
16432
|
+
runtime: external_exports.strictObject({
|
|
16433
|
+
id: external_exports.string().uuid(),
|
|
16434
|
+
revision: external_exports.string().max(64),
|
|
16435
|
+
activeCall: external_exports.boolean()
|
|
16436
|
+
}).optional()
|
|
16437
|
+
}),
|
|
16438
|
+
external_exports.strictObject({ operation: external_exports.literal("migrate"), routes: voiceRoutesSchema }),
|
|
16439
|
+
external_exports.strictObject({
|
|
16440
|
+
operation: external_exports.literal("set"),
|
|
16441
|
+
settings: voiceSettingsSchema,
|
|
16442
|
+
revision: external_exports.string().max(64)
|
|
16443
|
+
}),
|
|
16444
|
+
external_exports.strictObject({ operation: external_exports.literal("restart"), confirm: external_exports.literal(true) })
|
|
16445
|
+
]);
|
|
16446
|
+
var voiceSettingsStateSchema = external_exports.strictObject({
|
|
16447
|
+
settings: voiceSettingsSchema,
|
|
16448
|
+
initialized: external_exports.boolean(),
|
|
16449
|
+
revision: external_exports.string(),
|
|
16450
|
+
activeInject: external_exports.boolean().nullable(),
|
|
16451
|
+
envOverride: external_exports.enum(["0", "1"]).nullable(),
|
|
16452
|
+
activeEnvOverride: external_exports.enum(["0", "1"]).nullable(),
|
|
16453
|
+
routesActive: external_exports.boolean().nullable(),
|
|
16454
|
+
activeCall: external_exports.boolean().nullable(),
|
|
16455
|
+
gatewayReady: external_exports.boolean().nullable(),
|
|
16456
|
+
restartAvailable: external_exports.boolean(),
|
|
16457
|
+
restart: external_exports.strictObject({
|
|
16458
|
+
phase: external_exports.enum(["idle", "restarting", "succeeded", "failed"]),
|
|
16459
|
+
error: external_exports.string().nullable()
|
|
16460
|
+
})
|
|
16461
|
+
});
|
|
16462
|
+
|
|
16386
16463
|
// ../../shared-contracts/dist/index.js
|
|
16387
16464
|
var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
|
|
16388
16465
|
|
|
@@ -18578,8 +18655,8 @@ var ConnectionContext = class {
|
|
|
18578
18655
|
/**
|
|
18579
18656
|
* Sends a protocol-level request cancellation notification.
|
|
18580
18657
|
*/
|
|
18581
|
-
sendCancelRequest(
|
|
18582
|
-
return this.connection.sendCancelRequest(
|
|
18658
|
+
sendCancelRequest(requestId2) {
|
|
18659
|
+
return this.connection.sendCancelRequest(requestId2);
|
|
18583
18660
|
}
|
|
18584
18661
|
/**
|
|
18585
18662
|
* Registers a handler that can be disposed independently.
|
|
@@ -18764,8 +18841,8 @@ var Connection = class {
|
|
|
18764
18841
|
/**
|
|
18765
18842
|
* Sends a protocol-level request cancellation notification.
|
|
18766
18843
|
*/
|
|
18767
|
-
sendCancelRequest(
|
|
18768
|
-
return this.sendNotification(CANCEL_REQUEST_METHOD, { requestId });
|
|
18844
|
+
sendCancelRequest(requestId2) {
|
|
18845
|
+
return this.sendNotification(CANCEL_REQUEST_METHOD, { requestId: requestId2 });
|
|
18769
18846
|
}
|
|
18770
18847
|
/**
|
|
18771
18848
|
* Sends a JSON-RPC notification.
|
|
@@ -19073,15 +19150,15 @@ var Connection = class {
|
|
|
19073
19150
|
if (message.method !== CANCEL_REQUEST_METHOD) {
|
|
19074
19151
|
return;
|
|
19075
19152
|
}
|
|
19076
|
-
const
|
|
19077
|
-
if (
|
|
19153
|
+
const requestId2 = cancelRequestId(message.params);
|
|
19154
|
+
if (requestId2 === void 0) {
|
|
19078
19155
|
return;
|
|
19079
19156
|
}
|
|
19080
|
-
const controller = this.incomingRequests.get(
|
|
19157
|
+
const controller = this.incomingRequests.get(requestId2);
|
|
19081
19158
|
if (!controller || controller.signal.aborted) {
|
|
19082
19159
|
return;
|
|
19083
19160
|
}
|
|
19084
|
-
controller.abort(RequestError.requestCancelled({ requestId }));
|
|
19161
|
+
controller.abort(RequestError.requestCancelled({ requestId: requestId2 }));
|
|
19085
19162
|
}
|
|
19086
19163
|
closedReason() {
|
|
19087
19164
|
return this.abortController.signal.reason ?? new Error("ACP connection closed");
|
|
@@ -19547,12 +19624,12 @@ var AcpContext = class {
|
|
|
19547
19624
|
}
|
|
19548
19625
|
};
|
|
19549
19626
|
var AgentContext = class _AgentContext extends AcpContext {
|
|
19550
|
-
constructor(cx,
|
|
19551
|
-
super(cx,
|
|
19627
|
+
constructor(cx, requestId2) {
|
|
19628
|
+
super(cx, requestId2);
|
|
19552
19629
|
}
|
|
19553
19630
|
/** @internal */
|
|
19554
|
-
static create(cx,
|
|
19555
|
-
return new _AgentContext(cx,
|
|
19631
|
+
static create(cx, requestId2) {
|
|
19632
|
+
return new _AgentContext(cx, requestId2);
|
|
19556
19633
|
}
|
|
19557
19634
|
request(method, params, options) {
|
|
19558
19635
|
const spec = clientRequestSpecsByMethod[method];
|
|
@@ -19563,12 +19640,12 @@ var AgentContext = class _AgentContext extends AcpContext {
|
|
|
19563
19640
|
}
|
|
19564
19641
|
};
|
|
19565
19642
|
var ClientContext = class _ClientContext extends AcpContext {
|
|
19566
|
-
constructor(cx,
|
|
19567
|
-
super(cx,
|
|
19643
|
+
constructor(cx, requestId2) {
|
|
19644
|
+
super(cx, requestId2);
|
|
19568
19645
|
}
|
|
19569
19646
|
/** @internal */
|
|
19570
|
-
static create(cx,
|
|
19571
|
-
return new _ClientContext(cx,
|
|
19647
|
+
static create(cx, requestId2) {
|
|
19648
|
+
return new _ClientContext(cx, requestId2);
|
|
19572
19649
|
}
|
|
19573
19650
|
/** @internal */
|
|
19574
19651
|
[startActiveSession](params, options) {
|
|
@@ -20001,10 +20078,10 @@ var agentRequestSpecsByMethod = specsByMethod(agentRequestSpecs);
|
|
|
20001
20078
|
var agentNotificationSpecsByMethod = specsByMethod(agentNotificationSpecs);
|
|
20002
20079
|
var clientRequestSpecsByMethod = specsByMethod(clientRequestSpecs);
|
|
20003
20080
|
var clientNotificationSpecsByMethod = specsByMethod(clientNotificationSpecs);
|
|
20004
|
-
function agentRequestContext(params, client2, signal,
|
|
20081
|
+
function agentRequestContext(params, client2, signal, requestId2) {
|
|
20005
20082
|
return {
|
|
20006
20083
|
params,
|
|
20007
|
-
requestId,
|
|
20084
|
+
requestId: requestId2,
|
|
20008
20085
|
signal,
|
|
20009
20086
|
client: client2
|
|
20010
20087
|
};
|
|
@@ -20016,10 +20093,10 @@ function agentNotificationContext(params, client2, signal) {
|
|
|
20016
20093
|
client: client2
|
|
20017
20094
|
};
|
|
20018
20095
|
}
|
|
20019
|
-
function clientRequestContext(params, agent, signal,
|
|
20096
|
+
function clientRequestContext(params, agent, signal, requestId2) {
|
|
20020
20097
|
return {
|
|
20021
20098
|
params,
|
|
20022
|
-
requestId,
|
|
20099
|
+
requestId: requestId2,
|
|
20023
20100
|
signal,
|
|
20024
20101
|
agent
|
|
20025
20102
|
};
|
|
@@ -20144,7 +20221,7 @@ var AgentApp = class {
|
|
|
20144
20221
|
return this.notification(spec, handlerOrParams);
|
|
20145
20222
|
}
|
|
20146
20223
|
request(spec, handler) {
|
|
20147
|
-
registerAppRequest(this.builder, spec, (params, cx, signal,
|
|
20224
|
+
registerAppRequest(this.builder, spec, (params, cx, signal, requestId2) => agentRequestContext(params, AgentContext.create(cx, requestId2), signal, requestId2), handler);
|
|
20148
20225
|
return this;
|
|
20149
20226
|
}
|
|
20150
20227
|
notification(spec, handler) {
|
|
@@ -20244,7 +20321,7 @@ var ClientApp = class {
|
|
|
20244
20321
|
return this.notification(spec, handlerOrParams);
|
|
20245
20322
|
}
|
|
20246
20323
|
request(spec, handler) {
|
|
20247
|
-
registerAppRequest(this.builder, spec, (params, cx, signal,
|
|
20324
|
+
registerAppRequest(this.builder, spec, (params, cx, signal, requestId2) => clientRequestContext(params, ClientContext.create(cx, requestId2), signal, requestId2), handler);
|
|
20248
20325
|
return this;
|
|
20249
20326
|
}
|
|
20250
20327
|
notification(spec, handler) {
|