@karlorz/codexhost-cli-win32-x64 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
|
@@ -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
|
|
|
@@ -18899,8 +18976,8 @@ function historyUsageRequests(contents, historical) {
|
|
|
18899
18976
|
}
|
|
18900
18977
|
const requests = [];
|
|
18901
18978
|
let complete = true;
|
|
18902
|
-
for (const [
|
|
18903
|
-
const request = providerUsageRequest(
|
|
18979
|
+
for (const [requestId2, data] of usages) {
|
|
18980
|
+
const request = providerUsageRequest(requestId2, data, historical);
|
|
18904
18981
|
if (request)
|
|
18905
18982
|
requests.push(request);
|
|
18906
18983
|
else
|
|
@@ -18908,7 +18985,7 @@ function historyUsageRequests(contents, historical) {
|
|
|
18908
18985
|
}
|
|
18909
18986
|
return { requests, complete };
|
|
18910
18987
|
}
|
|
18911
|
-
function providerUsageRequest(
|
|
18988
|
+
function providerUsageRequest(requestId2, data, historical) {
|
|
18912
18989
|
const usage = record2(data.rawUsage);
|
|
18913
18990
|
const model2 = text(data.model) || text(data.requestModelId);
|
|
18914
18991
|
const input = usageCount(usage.prompt_tokens);
|
|
@@ -18922,7 +18999,7 @@ function providerUsageRequest(requestId, data, historical) {
|
|
|
18922
18999
|
}
|
|
18923
19000
|
try {
|
|
18924
19001
|
return parseHostUsageRequest({
|
|
18925
|
-
requestId,
|
|
19002
|
+
requestId: requestId2,
|
|
18926
19003
|
...historical ? { historical: true } : {},
|
|
18927
19004
|
model: model2,
|
|
18928
19005
|
inputTokens: input,
|
|
@@ -20984,8 +21061,8 @@ var ConnectionContext = class {
|
|
|
20984
21061
|
/**
|
|
20985
21062
|
* Sends a protocol-level request cancellation notification.
|
|
20986
21063
|
*/
|
|
20987
|
-
sendCancelRequest(
|
|
20988
|
-
return this.connection.sendCancelRequest(
|
|
21064
|
+
sendCancelRequest(requestId2) {
|
|
21065
|
+
return this.connection.sendCancelRequest(requestId2);
|
|
20989
21066
|
}
|
|
20990
21067
|
/**
|
|
20991
21068
|
* Registers a handler that can be disposed independently.
|
|
@@ -21170,8 +21247,8 @@ var Connection = class {
|
|
|
21170
21247
|
/**
|
|
21171
21248
|
* Sends a protocol-level request cancellation notification.
|
|
21172
21249
|
*/
|
|
21173
|
-
sendCancelRequest(
|
|
21174
|
-
return this.sendNotification(CANCEL_REQUEST_METHOD, { requestId });
|
|
21250
|
+
sendCancelRequest(requestId2) {
|
|
21251
|
+
return this.sendNotification(CANCEL_REQUEST_METHOD, { requestId: requestId2 });
|
|
21175
21252
|
}
|
|
21176
21253
|
/**
|
|
21177
21254
|
* Sends a JSON-RPC notification.
|
|
@@ -21479,15 +21556,15 @@ var Connection = class {
|
|
|
21479
21556
|
if (message.method !== CANCEL_REQUEST_METHOD) {
|
|
21480
21557
|
return;
|
|
21481
21558
|
}
|
|
21482
|
-
const
|
|
21483
|
-
if (
|
|
21559
|
+
const requestId2 = cancelRequestId(message.params);
|
|
21560
|
+
if (requestId2 === void 0) {
|
|
21484
21561
|
return;
|
|
21485
21562
|
}
|
|
21486
|
-
const controller = this.incomingRequests.get(
|
|
21563
|
+
const controller = this.incomingRequests.get(requestId2);
|
|
21487
21564
|
if (!controller || controller.signal.aborted) {
|
|
21488
21565
|
return;
|
|
21489
21566
|
}
|
|
21490
|
-
controller.abort(RequestError.requestCancelled({ requestId }));
|
|
21567
|
+
controller.abort(RequestError.requestCancelled({ requestId: requestId2 }));
|
|
21491
21568
|
}
|
|
21492
21569
|
closedReason() {
|
|
21493
21570
|
return this.abortController.signal.reason ?? new Error("ACP connection closed");
|
|
@@ -21953,12 +22030,12 @@ var AcpContext = class {
|
|
|
21953
22030
|
}
|
|
21954
22031
|
};
|
|
21955
22032
|
var AgentContext = class _AgentContext extends AcpContext {
|
|
21956
|
-
constructor(cx,
|
|
21957
|
-
super(cx,
|
|
22033
|
+
constructor(cx, requestId2) {
|
|
22034
|
+
super(cx, requestId2);
|
|
21958
22035
|
}
|
|
21959
22036
|
/** @internal */
|
|
21960
|
-
static create(cx,
|
|
21961
|
-
return new _AgentContext(cx,
|
|
22037
|
+
static create(cx, requestId2) {
|
|
22038
|
+
return new _AgentContext(cx, requestId2);
|
|
21962
22039
|
}
|
|
21963
22040
|
request(method, params, options) {
|
|
21964
22041
|
const spec = clientRequestSpecsByMethod[method];
|
|
@@ -21969,12 +22046,12 @@ var AgentContext = class _AgentContext extends AcpContext {
|
|
|
21969
22046
|
}
|
|
21970
22047
|
};
|
|
21971
22048
|
var ClientContext = class _ClientContext extends AcpContext {
|
|
21972
|
-
constructor(cx,
|
|
21973
|
-
super(cx,
|
|
22049
|
+
constructor(cx, requestId2) {
|
|
22050
|
+
super(cx, requestId2);
|
|
21974
22051
|
}
|
|
21975
22052
|
/** @internal */
|
|
21976
|
-
static create(cx,
|
|
21977
|
-
return new _ClientContext(cx,
|
|
22053
|
+
static create(cx, requestId2) {
|
|
22054
|
+
return new _ClientContext(cx, requestId2);
|
|
21978
22055
|
}
|
|
21979
22056
|
/** @internal */
|
|
21980
22057
|
[startActiveSession](params, options) {
|
|
@@ -22407,10 +22484,10 @@ var agentRequestSpecsByMethod = specsByMethod(agentRequestSpecs);
|
|
|
22407
22484
|
var agentNotificationSpecsByMethod = specsByMethod(agentNotificationSpecs);
|
|
22408
22485
|
var clientRequestSpecsByMethod = specsByMethod(clientRequestSpecs);
|
|
22409
22486
|
var clientNotificationSpecsByMethod = specsByMethod(clientNotificationSpecs);
|
|
22410
|
-
function agentRequestContext(params, client2, signal,
|
|
22487
|
+
function agentRequestContext(params, client2, signal, requestId2) {
|
|
22411
22488
|
return {
|
|
22412
22489
|
params,
|
|
22413
|
-
requestId,
|
|
22490
|
+
requestId: requestId2,
|
|
22414
22491
|
signal,
|
|
22415
22492
|
client: client2
|
|
22416
22493
|
};
|
|
@@ -22422,10 +22499,10 @@ function agentNotificationContext(params, client2, signal) {
|
|
|
22422
22499
|
client: client2
|
|
22423
22500
|
};
|
|
22424
22501
|
}
|
|
22425
|
-
function clientRequestContext(params, agent, signal,
|
|
22502
|
+
function clientRequestContext(params, agent, signal, requestId2) {
|
|
22426
22503
|
return {
|
|
22427
22504
|
params,
|
|
22428
|
-
requestId,
|
|
22505
|
+
requestId: requestId2,
|
|
22429
22506
|
signal,
|
|
22430
22507
|
agent
|
|
22431
22508
|
};
|
|
@@ -22550,7 +22627,7 @@ var AgentApp = class {
|
|
|
22550
22627
|
return this.notification(spec, handlerOrParams);
|
|
22551
22628
|
}
|
|
22552
22629
|
request(spec, handler) {
|
|
22553
|
-
registerAppRequest(this.builder, spec, (params, cx, signal,
|
|
22630
|
+
registerAppRequest(this.builder, spec, (params, cx, signal, requestId2) => agentRequestContext(params, AgentContext.create(cx, requestId2), signal, requestId2), handler);
|
|
22554
22631
|
return this;
|
|
22555
22632
|
}
|
|
22556
22633
|
notification(spec, handler) {
|
|
@@ -22650,7 +22727,7 @@ var ClientApp = class {
|
|
|
22650
22727
|
return this.notification(spec, handlerOrParams);
|
|
22651
22728
|
}
|
|
22652
22729
|
request(spec, handler) {
|
|
22653
|
-
registerAppRequest(this.builder, spec, (params, cx, signal,
|
|
22730
|
+
registerAppRequest(this.builder, spec, (params, cx, signal, requestId2) => clientRequestContext(params, ClientContext.create(cx, requestId2), signal, requestId2), handler);
|
|
22654
22731
|
return this;
|
|
22655
22732
|
}
|
|
22656
22733
|
notification(spec, handler) {
|
|
@@ -25092,8 +25169,8 @@ var CodeBuddyChildObserver = class {
|
|
|
25092
25169
|
}
|
|
25093
25170
|
return next;
|
|
25094
25171
|
}
|
|
25095
|
-
async locate(
|
|
25096
|
-
if (!
|
|
25172
|
+
async locate(requestId2) {
|
|
25173
|
+
if (!requestId2)
|
|
25097
25174
|
return void 0;
|
|
25098
25175
|
const directory = await this.#directory();
|
|
25099
25176
|
const files = (await readdir2(directory, { withFileTypes: true })).filter((entry) => entry.isFile() && /^agent-[\w-]+\.jsonl$/u.test(entry.name));
|
|
@@ -25103,7 +25180,7 @@ var CodeBuddyChildObserver = class {
|
|
|
25103
25180
|
for (const file2 of files) {
|
|
25104
25181
|
const id = file2.name.slice(0, -6), data = await this.#child(directory, id);
|
|
25105
25182
|
const first = data.entries.find((row) => row.type === "message" && row.role === "user");
|
|
25106
|
-
if (record2(first?.providerData).conversationRequestId ===
|
|
25183
|
+
if (record2(first?.providerData).conversationRequestId === requestId2)
|
|
25107
25184
|
matches.push(id);
|
|
25108
25185
|
}
|
|
25109
25186
|
if (matches.length > 1)
|
|
@@ -25188,9 +25265,9 @@ var CodeBuddySubagents = class {
|
|
|
25188
25265
|
if (parentCallId) {
|
|
25189
25266
|
const call2 = this.#calls.get(parentCallId);
|
|
25190
25267
|
if (call2 && !call2.observationDone) {
|
|
25191
|
-
const
|
|
25192
|
-
if (
|
|
25193
|
-
call2.requestId =
|
|
25268
|
+
const requestId2 = text(meta3["codebuddy.ai/conversationRequestId"]);
|
|
25269
|
+
if (requestId2)
|
|
25270
|
+
call2.requestId = requestId2;
|
|
25194
25271
|
const progress = update.sessionUpdate === "tool_call" && meta3["codebuddy.ai/toolArgumentsComplete"] ? text(update.title) : "";
|
|
25195
25272
|
if (progress)
|
|
25196
25273
|
this.#update(call2, { resultSummary: progress.slice(0, 2e3) });
|
|
@@ -14964,6 +14964,36 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
|
14964
14964
|
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
14965
14965
|
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
14966
14966
|
|
|
14967
|
+
// ../../shared-contracts/dist/realtime-call.js
|
|
14968
|
+
var REALTIME_CALL_FORWARDED_HEADERS = [
|
|
14969
|
+
"openai-alpha",
|
|
14970
|
+
"thread-id",
|
|
14971
|
+
"session-id",
|
|
14972
|
+
"originator",
|
|
14973
|
+
"x-codex-turn-metadata"
|
|
14974
|
+
];
|
|
14975
|
+
var FORWARDED_HEADERS = new Set(REALTIME_CALL_FORWARDED_HEADERS);
|
|
14976
|
+
var REALTIME_CALL_ID_PATTERN = /^rtc_[A-Za-z0-9_-]{1,128}$/u;
|
|
14977
|
+
var requestId = external_exports.string().min(1).max(128);
|
|
14978
|
+
var realtimeCallParamsSchema = external_exports.discriminatedUnion("operation", [
|
|
14979
|
+
external_exports.object({
|
|
14980
|
+
operation: external_exports.literal("create"),
|
|
14981
|
+
requestId,
|
|
14982
|
+
body: external_exports.string().min(1).max(16 << 20),
|
|
14983
|
+
headers: external_exports.record(external_exports.string(), external_exports.string()).default({})
|
|
14984
|
+
}),
|
|
14985
|
+
external_exports.object({ operation: external_exports.literal("cancel"), requestId }),
|
|
14986
|
+
external_exports.object({
|
|
14987
|
+
operation: external_exports.literal("hangup"),
|
|
14988
|
+
callId: external_exports.string().regex(REALTIME_CALL_ID_PATTERN)
|
|
14989
|
+
})
|
|
14990
|
+
]);
|
|
14991
|
+
var realtimeCallResponseSchema = external_exports.object({
|
|
14992
|
+
status: external_exports.number().int().min(200).max(599),
|
|
14993
|
+
body: external_exports.string(),
|
|
14994
|
+
headers: external_exports.record(external_exports.string(), external_exports.string())
|
|
14995
|
+
});
|
|
14996
|
+
|
|
14967
14997
|
// ../../shared-contracts/dist/console.js
|
|
14968
14998
|
var consoleAnnouncementSchema = external_exports.strictObject({
|
|
14969
14999
|
title: external_exports.string().trim().min(1).max(200),
|
|
@@ -14976,6 +15006,7 @@ var consoleOpenResultSchema = external_exports.strictObject({
|
|
|
14976
15006
|
url: external_exports.string().max(2048).regex(/^http:\/\/(?:127\.0\.0\.1|localhost):\d{1,5}\/(?:\?.*)?$/u)
|
|
14977
15007
|
});
|
|
14978
15008
|
var CONSOLE_HOST_METHODS = Object.freeze([
|
|
15009
|
+
"codexhost/voice/gateway-status",
|
|
14979
15010
|
"codexhost/console/remote-connections",
|
|
14980
15011
|
"codexhost/runtime/status",
|
|
14981
15012
|
"codexhost/remote/ssh-setup",
|
|
@@ -16085,6 +16116,52 @@ var remoteConnectionsReplySchema = external_exports.union([
|
|
|
16085
16116
|
external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
|
|
16086
16117
|
]);
|
|
16087
16118
|
|
|
16119
|
+
// ../../shared-contracts/dist/voice-settings.js
|
|
16120
|
+
var voiceRoutesSchema = external_exports.strictObject({
|
|
16121
|
+
chatExperience: external_exports.enum(["chatgpt", "codex"]),
|
|
16122
|
+
chatConnection: external_exports.enum(["desktop", "gateway"]),
|
|
16123
|
+
workConnection: external_exports.enum(["desktop", "gateway"])
|
|
16124
|
+
});
|
|
16125
|
+
var DEFAULT_VOICE_ROUTES = Object.freeze({
|
|
16126
|
+
chatExperience: "chatgpt",
|
|
16127
|
+
chatConnection: "desktop",
|
|
16128
|
+
workConnection: "gateway"
|
|
16129
|
+
});
|
|
16130
|
+
var voiceSettingsSchema = voiceRoutesSchema.extend({ inject: external_exports.boolean() });
|
|
16131
|
+
var voiceSettingsRequestSchema = external_exports.discriminatedUnion("operation", [
|
|
16132
|
+
external_exports.strictObject({
|
|
16133
|
+
operation: external_exports.literal("get"),
|
|
16134
|
+
runtime: external_exports.strictObject({
|
|
16135
|
+
id: external_exports.string().uuid(),
|
|
16136
|
+
revision: external_exports.string().max(64),
|
|
16137
|
+
activeCall: external_exports.boolean()
|
|
16138
|
+
}).optional()
|
|
16139
|
+
}),
|
|
16140
|
+
external_exports.strictObject({ operation: external_exports.literal("migrate"), routes: voiceRoutesSchema }),
|
|
16141
|
+
external_exports.strictObject({
|
|
16142
|
+
operation: external_exports.literal("set"),
|
|
16143
|
+
settings: voiceSettingsSchema,
|
|
16144
|
+
revision: external_exports.string().max(64)
|
|
16145
|
+
}),
|
|
16146
|
+
external_exports.strictObject({ operation: external_exports.literal("restart"), confirm: external_exports.literal(true) })
|
|
16147
|
+
]);
|
|
16148
|
+
var voiceSettingsStateSchema = external_exports.strictObject({
|
|
16149
|
+
settings: voiceSettingsSchema,
|
|
16150
|
+
initialized: external_exports.boolean(),
|
|
16151
|
+
revision: external_exports.string(),
|
|
16152
|
+
activeInject: external_exports.boolean().nullable(),
|
|
16153
|
+
envOverride: external_exports.enum(["0", "1"]).nullable(),
|
|
16154
|
+
activeEnvOverride: external_exports.enum(["0", "1"]).nullable(),
|
|
16155
|
+
routesActive: external_exports.boolean().nullable(),
|
|
16156
|
+
activeCall: external_exports.boolean().nullable(),
|
|
16157
|
+
gatewayReady: external_exports.boolean().nullable(),
|
|
16158
|
+
restartAvailable: external_exports.boolean(),
|
|
16159
|
+
restart: external_exports.strictObject({
|
|
16160
|
+
phase: external_exports.enum(["idle", "restarting", "succeeded", "failed"]),
|
|
16161
|
+
error: external_exports.string().nullable()
|
|
16162
|
+
})
|
|
16163
|
+
});
|
|
16164
|
+
|
|
16088
16165
|
// ../../shared-contracts/dist/index.js
|
|
16089
16166
|
var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
|
|
16090
16167
|
|
|
@@ -17414,24 +17491,24 @@ var CliTransport = class {
|
|
|
17414
17491
|
if (method === "session/requestRuntimePreferences")
|
|
17415
17492
|
reply({ result: RUNTIME_PREFERENCES });
|
|
17416
17493
|
else if (method === "interaction/requestPermission" || method === "interaction/requestUserInput") {
|
|
17417
|
-
const
|
|
17418
|
-
if (this.#reportedInteractions.has(
|
|
17494
|
+
const requestId2 = text(params.requestId);
|
|
17495
|
+
if (this.#reportedInteractions.has(requestId2))
|
|
17419
17496
|
return;
|
|
17420
|
-
this.#reportedInteractions.add(
|
|
17497
|
+
this.#reportedInteractions.add(requestId2);
|
|
17421
17498
|
this.#emitSession(params.sessionId, {
|
|
17422
17499
|
type: method === "interaction/requestPermission" ? "permission.request" : "userInput.request",
|
|
17423
17500
|
request: params
|
|
17424
17501
|
});
|
|
17425
17502
|
} else if (method === "interaction/requestProviderRuntimeHeaders") {
|
|
17426
|
-
const
|
|
17503
|
+
const requestId2 = text(params.requestId);
|
|
17427
17504
|
const controller = new AbortController();
|
|
17428
|
-
this.#headerRequests.set(
|
|
17505
|
+
this.#headerRequests.set(requestId2, controller);
|
|
17429
17506
|
try {
|
|
17430
17507
|
reply({
|
|
17431
17508
|
result: await providerRuntimeHeaders(params, controller.signal, this.#installation, this.options.environment, () => this.options.verifier(this.#installation.version), this.#codingPlan)
|
|
17432
17509
|
});
|
|
17433
17510
|
} finally {
|
|
17434
|
-
this.#headerRequests.delete(
|
|
17511
|
+
this.#headerRequests.delete(requestId2);
|
|
17435
17512
|
}
|
|
17436
17513
|
} else if (method === "interaction/requestOfficialMcpAuthHeaders")
|
|
17437
17514
|
reply({ result: { ok: false, reason: "official_auth_unavailable" } });
|
|
@@ -19162,10 +19239,10 @@ function history(snapshot, events = [], locator) {
|
|
|
19162
19239
|
|
|
19163
19240
|
// dist/interactions.js
|
|
19164
19241
|
function makeInteraction(method, params, turnId) {
|
|
19165
|
-
const p = record2(params),
|
|
19166
|
-
if (!
|
|
19242
|
+
const p = record2(params), requestId2 = text(p.requestId);
|
|
19243
|
+
if (!requestId2)
|
|
19167
19244
|
throw new ZcodeError("protocolError", "ZCode interaction has no request ID");
|
|
19168
|
-
const interactionId = hostInteractionIdSchema.parse(`zcode:${
|
|
19245
|
+
const interactionId = hostInteractionIdSchema.parse(`zcode:${requestId2}`);
|
|
19169
19246
|
if (method === "interaction/requestPermission") {
|
|
19170
19247
|
const options = Array.isArray(p.options) ? p.options.map(record2) : [];
|
|
19171
19248
|
const actions = options.flatMap((option) => {
|
|
@@ -19196,7 +19273,7 @@ function makeInteraction(method, params, turnId) {
|
|
|
19196
19273
|
};
|
|
19197
19274
|
return {
|
|
19198
19275
|
interaction: interaction2,
|
|
19199
|
-
requestId,
|
|
19276
|
+
requestId: requestId2,
|
|
19200
19277
|
response(value) {
|
|
19201
19278
|
if (value.type !== "approval")
|
|
19202
19279
|
throw new ZcodeError("invalidRequest", "Expected an approval response");
|
|
@@ -19241,7 +19318,7 @@ function makeInteraction(method, params, turnId) {
|
|
|
19241
19318
|
};
|
|
19242
19319
|
return {
|
|
19243
19320
|
interaction,
|
|
19244
|
-
requestId,
|
|
19321
|
+
requestId: requestId2,
|
|
19245
19322
|
response(value) {
|
|
19246
19323
|
if (value.type !== "question")
|
|
19247
19324
|
throw new ZcodeError("invalidRequest", "Expected a question response");
|
|
@@ -19498,10 +19575,10 @@ var ZcodeSession = class {
|
|
|
19498
19575
|
else if (event.type === "state.updated")
|
|
19499
19576
|
this.#message({ method: "state.updated", params: event.notification });
|
|
19500
19577
|
else if (event.type === "permission.request" || event.type === "userInput.request") {
|
|
19501
|
-
const request = record2(event.request),
|
|
19502
|
-
this.#nativeInteractions.set(
|
|
19578
|
+
const request = record2(event.request), requestId2 = text(request.requestId);
|
|
19579
|
+
this.#nativeInteractions.set(requestId2, { request, type: event.type });
|
|
19503
19580
|
this.#message({
|
|
19504
|
-
requestId,
|
|
19581
|
+
requestId: requestId2,
|
|
19505
19582
|
method: event.type === "permission.request" ? "interaction/requestPermission" : "interaction/requestUserInput",
|
|
19506
19583
|
params: request
|
|
19507
19584
|
});
|
|
@@ -19513,8 +19590,8 @@ var ZcodeSession = class {
|
|
|
19513
19590
|
await this.#readNative();
|
|
19514
19591
|
}
|
|
19515
19592
|
#nativeInteractions = /* @__PURE__ */ new Map();
|
|
19516
|
-
async #respond(
|
|
19517
|
-
const pending = this.#nativeInteractions.get(
|
|
19593
|
+
async #respond(requestId2, result) {
|
|
19594
|
+
const pending = this.#nativeInteractions.get(requestId2);
|
|
19518
19595
|
if (!pending)
|
|
19519
19596
|
throw new ZcodeError("invalidRequest", "ZCode interaction is no longer pending");
|
|
19520
19597
|
let answer = result;
|
|
@@ -19525,22 +19602,22 @@ var ZcodeSession = class {
|
|
|
19525
19602
|
throw new ZcodeError("invalidRequest", "ZCode approval does not match a native option");
|
|
19526
19603
|
answer = { optionId: option.optionId };
|
|
19527
19604
|
}
|
|
19528
|
-
this.#nativeInteractions.delete(
|
|
19605
|
+
this.#nativeInteractions.delete(requestId2);
|
|
19529
19606
|
try {
|
|
19530
19607
|
await this.transport.command(this.sessionId, "resolveInteraction", {
|
|
19531
|
-
interactionId:
|
|
19608
|
+
interactionId: requestId2,
|
|
19532
19609
|
answer
|
|
19533
19610
|
});
|
|
19534
19611
|
} catch (error51) {
|
|
19535
|
-
if (this.#pendingInteractions.has(`zcode:${
|
|
19536
|
-
this.#nativeInteractions.set(
|
|
19612
|
+
if (this.#pendingInteractions.has(`zcode:${requestId2}`))
|
|
19613
|
+
this.#nativeInteractions.set(requestId2, pending);
|
|
19537
19614
|
throw error51;
|
|
19538
19615
|
}
|
|
19539
19616
|
}
|
|
19540
|
-
#reject(
|
|
19541
|
-
const pending = this.#nativeInteractions.get(
|
|
19617
|
+
#reject(requestId2) {
|
|
19618
|
+
const pending = this.#nativeInteractions.get(requestId2);
|
|
19542
19619
|
if (pending)
|
|
19543
|
-
void this.#respond(
|
|
19620
|
+
void this.#respond(requestId2, pending.type === "permission.request" ? { decision: "deny" } : { action: "cancel" }).catch(() => void 0);
|
|
19544
19621
|
}
|
|
19545
19622
|
async #readNative() {
|
|
19546
19623
|
return snapshotSchema.parse(await this.transport.request("readSession", { sessionId: this.sessionId }));
|