@karlorz/codexhost-cli-win32-x64 0.13.3-3 → 0.13.3-5
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 +30 -0
- package/app/console-web.js +30 -0
- package/app/cpa-live-voice-hook.js +16158 -65
- package/app/desktop-controller.mjs +34 -3
- package/app/host-runtime.mjs +2678 -2267
- package/app/plugins/antigravity/plugin.mjs +30 -0
- package/app/plugins/claude-code/plugin.mjs +54 -22
- package/app/plugins/codebuddy/plugin.mjs +62 -32
- package/app/plugins/codex-usage/plugin.mjs +30 -0
- package/app/plugins/cursor-cli/plugin.mjs +73 -43
- package/app/plugins/deepseek-harness/plugin.mjs +35 -5
- package/app/plugins/grok/plugin.mjs +52 -22
- package/app/plugins/hermes/plugin.mjs +30 -0
- package/app/plugins/kimi-code/plugin.mjs +52 -22
- package/app/plugins/kiro-cli/plugin.mjs +52 -22
- package/app/plugins/omp/plugin.mjs +45 -15
- package/app/plugins/opencode/plugin.mjs +30 -0
- package/app/plugins/pi/plugin.mjs +51 -21
- package/app/plugins/qoder/plugin.mjs +38 -8
- package/app/plugins/qoder-cn/plugin.mjs +38 -8
- package/app/plugins/workbuddy/plugin.mjs +62 -32
- package/app/plugins/zcode/plugin.mjs +53 -23
- package/app/renderer-extension.js +461 -260
- 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
|
@@ -27836,6 +27836,36 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
|
27836
27836
|
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
27837
27837
|
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
27838
27838
|
|
|
27839
|
+
// ../../shared-contracts/dist/realtime-call.js
|
|
27840
|
+
var REALTIME_CALL_FORWARDED_HEADERS = [
|
|
27841
|
+
"openai-alpha",
|
|
27842
|
+
"thread-id",
|
|
27843
|
+
"session-id",
|
|
27844
|
+
"originator",
|
|
27845
|
+
"x-codex-turn-metadata"
|
|
27846
|
+
];
|
|
27847
|
+
var FORWARDED_HEADERS = new Set(REALTIME_CALL_FORWARDED_HEADERS);
|
|
27848
|
+
var REALTIME_CALL_ID_PATTERN = /^rtc_[A-Za-z0-9_-]{1,128}$/u;
|
|
27849
|
+
var requestId = external_exports.string().min(1).max(128);
|
|
27850
|
+
var realtimeCallParamsSchema = external_exports.discriminatedUnion("operation", [
|
|
27851
|
+
external_exports.object({
|
|
27852
|
+
operation: external_exports.literal("create"),
|
|
27853
|
+
requestId,
|
|
27854
|
+
body: external_exports.string().min(1).max(16 << 20),
|
|
27855
|
+
headers: external_exports.record(external_exports.string(), external_exports.string()).default({})
|
|
27856
|
+
}),
|
|
27857
|
+
external_exports.object({ operation: external_exports.literal("cancel"), requestId }),
|
|
27858
|
+
external_exports.object({
|
|
27859
|
+
operation: external_exports.literal("hangup"),
|
|
27860
|
+
callId: external_exports.string().regex(REALTIME_CALL_ID_PATTERN)
|
|
27861
|
+
})
|
|
27862
|
+
]);
|
|
27863
|
+
var realtimeCallResponseSchema = external_exports.object({
|
|
27864
|
+
status: external_exports.number().int().min(200).max(599),
|
|
27865
|
+
body: external_exports.string(),
|
|
27866
|
+
headers: external_exports.record(external_exports.string(), external_exports.string())
|
|
27867
|
+
});
|
|
27868
|
+
|
|
27839
27869
|
// ../../shared-contracts/dist/console.js
|
|
27840
27870
|
var consoleAnnouncementSchema = external_exports.strictObject({
|
|
27841
27871
|
title: external_exports.string().trim().min(1).max(200),
|
|
@@ -32023,8 +32053,8 @@ var ConnectionContext = class {
|
|
|
32023
32053
|
/**
|
|
32024
32054
|
* Sends a protocol-level request cancellation notification.
|
|
32025
32055
|
*/
|
|
32026
|
-
sendCancelRequest(
|
|
32027
|
-
return this.connection.sendCancelRequest(
|
|
32056
|
+
sendCancelRequest(requestId2) {
|
|
32057
|
+
return this.connection.sendCancelRequest(requestId2);
|
|
32028
32058
|
}
|
|
32029
32059
|
/**
|
|
32030
32060
|
* Registers a handler that can be disposed independently.
|
|
@@ -32209,8 +32239,8 @@ var Connection = class {
|
|
|
32209
32239
|
/**
|
|
32210
32240
|
* Sends a protocol-level request cancellation notification.
|
|
32211
32241
|
*/
|
|
32212
|
-
sendCancelRequest(
|
|
32213
|
-
return this.sendNotification(CANCEL_REQUEST_METHOD, { requestId });
|
|
32242
|
+
sendCancelRequest(requestId2) {
|
|
32243
|
+
return this.sendNotification(CANCEL_REQUEST_METHOD, { requestId: requestId2 });
|
|
32214
32244
|
}
|
|
32215
32245
|
/**
|
|
32216
32246
|
* Sends a JSON-RPC notification.
|
|
@@ -32518,15 +32548,15 @@ var Connection = class {
|
|
|
32518
32548
|
if (message.method !== CANCEL_REQUEST_METHOD) {
|
|
32519
32549
|
return;
|
|
32520
32550
|
}
|
|
32521
|
-
const
|
|
32522
|
-
if (
|
|
32551
|
+
const requestId2 = cancelRequestId(message.params);
|
|
32552
|
+
if (requestId2 === void 0) {
|
|
32523
32553
|
return;
|
|
32524
32554
|
}
|
|
32525
|
-
const controller = this.incomingRequests.get(
|
|
32555
|
+
const controller = this.incomingRequests.get(requestId2);
|
|
32526
32556
|
if (!controller || controller.signal.aborted) {
|
|
32527
32557
|
return;
|
|
32528
32558
|
}
|
|
32529
|
-
controller.abort(RequestError.requestCancelled({ requestId }));
|
|
32559
|
+
controller.abort(RequestError.requestCancelled({ requestId: requestId2 }));
|
|
32530
32560
|
}
|
|
32531
32561
|
closedReason() {
|
|
32532
32562
|
return this.abortController.signal.reason ?? new Error("ACP connection closed");
|
|
@@ -32992,12 +33022,12 @@ var AcpContext = class {
|
|
|
32992
33022
|
}
|
|
32993
33023
|
};
|
|
32994
33024
|
var AgentContext = class _AgentContext extends AcpContext {
|
|
32995
|
-
constructor(cx,
|
|
32996
|
-
super(cx,
|
|
33025
|
+
constructor(cx, requestId2) {
|
|
33026
|
+
super(cx, requestId2);
|
|
32997
33027
|
}
|
|
32998
33028
|
/** @internal */
|
|
32999
|
-
static create(cx,
|
|
33000
|
-
return new _AgentContext(cx,
|
|
33029
|
+
static create(cx, requestId2) {
|
|
33030
|
+
return new _AgentContext(cx, requestId2);
|
|
33001
33031
|
}
|
|
33002
33032
|
request(method, params, options) {
|
|
33003
33033
|
const spec = clientRequestSpecsByMethod[method];
|
|
@@ -33008,12 +33038,12 @@ var AgentContext = class _AgentContext extends AcpContext {
|
|
|
33008
33038
|
}
|
|
33009
33039
|
};
|
|
33010
33040
|
var ClientContext = class _ClientContext extends AcpContext {
|
|
33011
|
-
constructor(cx,
|
|
33012
|
-
super(cx,
|
|
33041
|
+
constructor(cx, requestId2) {
|
|
33042
|
+
super(cx, requestId2);
|
|
33013
33043
|
}
|
|
33014
33044
|
/** @internal */
|
|
33015
|
-
static create(cx,
|
|
33016
|
-
return new _ClientContext(cx,
|
|
33045
|
+
static create(cx, requestId2) {
|
|
33046
|
+
return new _ClientContext(cx, requestId2);
|
|
33017
33047
|
}
|
|
33018
33048
|
/** @internal */
|
|
33019
33049
|
[startActiveSession](params, options) {
|
|
@@ -33446,10 +33476,10 @@ var agentRequestSpecsByMethod = specsByMethod(agentRequestSpecs);
|
|
|
33446
33476
|
var agentNotificationSpecsByMethod = specsByMethod(agentNotificationSpecs);
|
|
33447
33477
|
var clientRequestSpecsByMethod = specsByMethod(clientRequestSpecs);
|
|
33448
33478
|
var clientNotificationSpecsByMethod = specsByMethod(clientNotificationSpecs);
|
|
33449
|
-
function agentRequestContext(params, client2, signal,
|
|
33479
|
+
function agentRequestContext(params, client2, signal, requestId2) {
|
|
33450
33480
|
return {
|
|
33451
33481
|
params,
|
|
33452
|
-
requestId,
|
|
33482
|
+
requestId: requestId2,
|
|
33453
33483
|
signal,
|
|
33454
33484
|
client: client2
|
|
33455
33485
|
};
|
|
@@ -33461,10 +33491,10 @@ function agentNotificationContext(params, client2, signal) {
|
|
|
33461
33491
|
client: client2
|
|
33462
33492
|
};
|
|
33463
33493
|
}
|
|
33464
|
-
function clientRequestContext(params, agent, signal,
|
|
33494
|
+
function clientRequestContext(params, agent, signal, requestId2) {
|
|
33465
33495
|
return {
|
|
33466
33496
|
params,
|
|
33467
|
-
requestId,
|
|
33497
|
+
requestId: requestId2,
|
|
33468
33498
|
signal,
|
|
33469
33499
|
agent
|
|
33470
33500
|
};
|
|
@@ -33589,7 +33619,7 @@ var AgentApp = class {
|
|
|
33589
33619
|
return this.notification(spec, handlerOrParams);
|
|
33590
33620
|
}
|
|
33591
33621
|
request(spec, handler) {
|
|
33592
|
-
registerAppRequest(this.builder, spec, (params, cx, signal,
|
|
33622
|
+
registerAppRequest(this.builder, spec, (params, cx, signal, requestId2) => agentRequestContext(params, AgentContext.create(cx, requestId2), signal, requestId2), handler);
|
|
33593
33623
|
return this;
|
|
33594
33624
|
}
|
|
33595
33625
|
notification(spec, handler) {
|
|
@@ -33689,7 +33719,7 @@ var ClientApp = class {
|
|
|
33689
33719
|
return this.notification(spec, handlerOrParams);
|
|
33690
33720
|
}
|
|
33691
33721
|
request(spec, handler) {
|
|
33692
|
-
registerAppRequest(this.builder, spec, (params, cx, signal,
|
|
33722
|
+
registerAppRequest(this.builder, spec, (params, cx, signal, requestId2) => clientRequestContext(params, ClientContext.create(cx, requestId2), signal, requestId2), handler);
|
|
33693
33723
|
return this;
|
|
33694
33724
|
}
|
|
33695
33725
|
notification(spec, handler) {
|
|
@@ -41236,10 +41266,10 @@ var Protocol = class {
|
|
|
41236
41266
|
while (queuedMessage = await this._taskMessageQueue.dequeue(taskId, extra.sessionId)) {
|
|
41237
41267
|
if (queuedMessage.type === "response" || queuedMessage.type === "error") {
|
|
41238
41268
|
const message = queuedMessage.message;
|
|
41239
|
-
const
|
|
41240
|
-
const resolver = this._requestResolvers.get(
|
|
41269
|
+
const requestId2 = message.id;
|
|
41270
|
+
const resolver = this._requestResolvers.get(requestId2);
|
|
41241
41271
|
if (resolver) {
|
|
41242
|
-
this._requestResolvers.delete(
|
|
41272
|
+
this._requestResolvers.delete(requestId2);
|
|
41243
41273
|
if (queuedMessage.type === "response") {
|
|
41244
41274
|
resolver(message);
|
|
41245
41275
|
} else {
|
|
@@ -41249,7 +41279,7 @@ var Protocol = class {
|
|
|
41249
41279
|
}
|
|
41250
41280
|
} else {
|
|
41251
41281
|
const messageType = queuedMessage.type === "response" ? "Response" : "Error";
|
|
41252
|
-
this._onerror(new Error(`${messageType} handler missing for request ${
|
|
41282
|
+
this._onerror(new Error(`${messageType} handler missing for request ${requestId2}`));
|
|
41253
41283
|
}
|
|
41254
41284
|
continue;
|
|
41255
41285
|
}
|
|
@@ -42018,13 +42048,13 @@ var Protocol = class {
|
|
|
42018
42048
|
const messages = await this._taskMessageQueue.dequeueAll(taskId, sessionId);
|
|
42019
42049
|
for (const message of messages) {
|
|
42020
42050
|
if (message.type === "request" && isJSONRPCRequest(message.message)) {
|
|
42021
|
-
const
|
|
42022
|
-
const resolver = this._requestResolvers.get(
|
|
42051
|
+
const requestId2 = message.message.id;
|
|
42052
|
+
const resolver = this._requestResolvers.get(requestId2);
|
|
42023
42053
|
if (resolver) {
|
|
42024
42054
|
resolver(new McpError(ErrorCode.InternalError, "Task cancelled or completed"));
|
|
42025
|
-
this._requestResolvers.delete(
|
|
42055
|
+
this._requestResolvers.delete(requestId2);
|
|
42026
42056
|
} else {
|
|
42027
|
-
this._onerror(new Error(`Resolver missing for request ${
|
|
42057
|
+
this._onerror(new Error(`Resolver missing for request ${requestId2} during task ${taskId} cleanup`));
|
|
42028
42058
|
}
|
|
42029
42059
|
}
|
|
42030
42060
|
}
|
|
@@ -45401,8 +45431,8 @@ data:
|
|
|
45401
45431
|
* Use this to implement polling behavior during long-running operations -
|
|
45402
45432
|
* client will reconnect after the retry interval specified in the priming event.
|
|
45403
45433
|
*/
|
|
45404
|
-
closeSSEStream(
|
|
45405
|
-
const streamId = this._requestToStreamMapping.get(
|
|
45434
|
+
closeSSEStream(requestId2) {
|
|
45435
|
+
const streamId = this._requestToStreamMapping.get(requestId2);
|
|
45406
45436
|
if (!streamId)
|
|
45407
45437
|
return;
|
|
45408
45438
|
const stream = this._streamMapping.get(streamId);
|
|
@@ -45421,11 +45451,11 @@ data:
|
|
|
45421
45451
|
}
|
|
45422
45452
|
}
|
|
45423
45453
|
async send(message, options) {
|
|
45424
|
-
let
|
|
45454
|
+
let requestId2 = options?.relatedRequestId;
|
|
45425
45455
|
if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
|
|
45426
|
-
|
|
45456
|
+
requestId2 = message.id;
|
|
45427
45457
|
}
|
|
45428
|
-
if (
|
|
45458
|
+
if (requestId2 === void 0) {
|
|
45429
45459
|
if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
|
|
45430
45460
|
throw new Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request");
|
|
45431
45461
|
}
|
|
@@ -45442,9 +45472,9 @@ data:
|
|
|
45442
45472
|
}
|
|
45443
45473
|
return;
|
|
45444
45474
|
}
|
|
45445
|
-
const streamId = this._requestToStreamMapping.get(
|
|
45475
|
+
const streamId = this._requestToStreamMapping.get(requestId2);
|
|
45446
45476
|
if (!streamId) {
|
|
45447
|
-
throw new Error(`No connection established for request ID: ${String(
|
|
45477
|
+
throw new Error(`No connection established for request ID: ${String(requestId2)}`);
|
|
45448
45478
|
}
|
|
45449
45479
|
let stream = this._streamMapping.get(streamId);
|
|
45450
45480
|
if (!this._enableJsonResponse) {
|
|
@@ -45461,7 +45491,7 @@ data:
|
|
|
45461
45491
|
}
|
|
45462
45492
|
}
|
|
45463
45493
|
if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
|
|
45464
|
-
this._requestResponseMap.set(
|
|
45494
|
+
this._requestResponseMap.set(requestId2, message);
|
|
45465
45495
|
const relatedIds = Array.from(this._requestToStreamMapping.entries()).filter(([_, sid]) => sid === streamId).map(([id]) => id);
|
|
45466
45496
|
const allResponsesReady = relatedIds.every((id) => this._requestResponseMap.has(id));
|
|
45467
45497
|
if (allResponsesReady) {
|
|
@@ -45485,7 +45515,7 @@ data:
|
|
|
45485
45515
|
this._requestResponseMap.delete(id);
|
|
45486
45516
|
this._requestToStreamMapping.delete(id);
|
|
45487
45517
|
}
|
|
45488
|
-
throw new Error(`No connection established for request ID: ${String(
|
|
45518
|
+
throw new Error(`No connection established for request ID: ${String(requestId2)}`);
|
|
45489
45519
|
}
|
|
45490
45520
|
if (this._enableJsonResponse && stream.resolveJson) {
|
|
45491
45521
|
const headers = {
|
|
@@ -45603,8 +45633,8 @@ var StreamableHTTPServerTransport = class {
|
|
|
45603
45633
|
* Use this to implement polling behavior during long-running operations -
|
|
45604
45634
|
* client will reconnect after the retry interval specified in the priming event.
|
|
45605
45635
|
*/
|
|
45606
|
-
closeSSEStream(
|
|
45607
|
-
this._webStandardTransport.closeSSEStream(
|
|
45636
|
+
closeSSEStream(requestId2) {
|
|
45637
|
+
this._webStandardTransport.closeSSEStream(requestId2);
|
|
45608
45638
|
}
|
|
45609
45639
|
/**
|
|
45610
45640
|
* Close the standalone GET SSE stream, triggering client reconnection.
|
|
@@ -45679,7 +45709,7 @@ async function createCursorDelegationBridge(cwd, environment, commandTimeoutMs =
|
|
|
45679
45709
|
thinking: text.optional(),
|
|
45680
45710
|
requestId: text.optional()
|
|
45681
45711
|
}
|
|
45682
|
-
}, ({ harness: harness2, task, cwd: cwd2, model: model2, thinking, requestId }) => run([
|
|
45712
|
+
}, ({ harness: harness2, task, cwd: cwd2, model: model2, thinking, requestId: requestId2 }) => run([
|
|
45683
45713
|
"delegate",
|
|
45684
45714
|
"start",
|
|
45685
45715
|
"--harness",
|
|
@@ -45689,7 +45719,7 @@ async function createCursorDelegationBridge(cwd, environment, commandTimeoutMs =
|
|
|
45689
45719
|
...optional2("--cwd", cwd2),
|
|
45690
45720
|
...optional2("--model", model2),
|
|
45691
45721
|
...optional2("--thinking", thinking),
|
|
45692
|
-
...optional2("--request-id",
|
|
45722
|
+
...optional2("--request-id", requestId2)
|
|
45693
45723
|
]));
|
|
45694
45724
|
server.registerTool("thread_send", {
|
|
45695
45725
|
description: "Send follow-up work to an existing idle task. Busy tasks must finish or be cancelled first.",
|
|
@@ -19019,6 +19019,36 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
|
19019
19019
|
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
19020
19020
|
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
19021
19021
|
|
|
19022
|
+
// ../../shared-contracts/dist/realtime-call.js
|
|
19023
|
+
var REALTIME_CALL_FORWARDED_HEADERS = [
|
|
19024
|
+
"openai-alpha",
|
|
19025
|
+
"thread-id",
|
|
19026
|
+
"session-id",
|
|
19027
|
+
"originator",
|
|
19028
|
+
"x-codex-turn-metadata"
|
|
19029
|
+
];
|
|
19030
|
+
var FORWARDED_HEADERS = new Set(REALTIME_CALL_FORWARDED_HEADERS);
|
|
19031
|
+
var REALTIME_CALL_ID_PATTERN = /^rtc_[A-Za-z0-9_-]{1,128}$/u;
|
|
19032
|
+
var requestId = external_exports.string().min(1).max(128);
|
|
19033
|
+
var realtimeCallParamsSchema = external_exports.discriminatedUnion("operation", [
|
|
19034
|
+
external_exports.object({
|
|
19035
|
+
operation: external_exports.literal("create"),
|
|
19036
|
+
requestId,
|
|
19037
|
+
body: external_exports.string().min(1).max(16 << 20),
|
|
19038
|
+
headers: external_exports.record(external_exports.string(), external_exports.string()).default({})
|
|
19039
|
+
}),
|
|
19040
|
+
external_exports.object({ operation: external_exports.literal("cancel"), requestId }),
|
|
19041
|
+
external_exports.object({
|
|
19042
|
+
operation: external_exports.literal("hangup"),
|
|
19043
|
+
callId: external_exports.string().regex(REALTIME_CALL_ID_PATTERN)
|
|
19044
|
+
})
|
|
19045
|
+
]);
|
|
19046
|
+
var realtimeCallResponseSchema = external_exports.object({
|
|
19047
|
+
status: external_exports.number().int().min(200).max(599),
|
|
19048
|
+
body: external_exports.string(),
|
|
19049
|
+
headers: external_exports.record(external_exports.string(), external_exports.string())
|
|
19050
|
+
});
|
|
19051
|
+
|
|
19022
19052
|
// ../../shared-contracts/dist/console.js
|
|
19023
19053
|
var consoleAnnouncementSchema = external_exports.strictObject({
|
|
19024
19054
|
title: external_exports.string().trim().min(1).max(200),
|
|
@@ -29293,8 +29323,8 @@ ${question.detail}` : question.question;
|
|
|
29293
29323
|
}
|
|
29294
29324
|
};
|
|
29295
29325
|
}
|
|
29296
|
-
const
|
|
29297
|
-
if (!
|
|
29326
|
+
const requestId2 = this.#randomUUID();
|
|
29327
|
+
if (!requestId2 || this.#pendingByRequestId.has(requestId2) || this.#boundRequestIds.has(requestId2)) {
|
|
29298
29328
|
return {
|
|
29299
29329
|
ok: false,
|
|
29300
29330
|
error: {
|
|
@@ -29307,7 +29337,7 @@ ${question.detail}` : question.question;
|
|
|
29307
29337
|
const abort = new AbortController();
|
|
29308
29338
|
const pending = {
|
|
29309
29339
|
command,
|
|
29310
|
-
requestId,
|
|
29340
|
+
requestId: requestId2,
|
|
29311
29341
|
abort,
|
|
29312
29342
|
admissionObserved: false,
|
|
29313
29343
|
observed: false,
|
|
@@ -29317,12 +29347,12 @@ ${question.detail}` : question.question;
|
|
|
29317
29347
|
grace: void 0,
|
|
29318
29348
|
correlationTimer: void 0
|
|
29319
29349
|
};
|
|
29320
|
-
this.#pendingByRequestId.set(
|
|
29350
|
+
this.#pendingByRequestId.set(requestId2, pending);
|
|
29321
29351
|
this.#operationControllers.add(abort);
|
|
29322
29352
|
try {
|
|
29323
29353
|
const response = await callAbortable(this.#remote.call("session/prompt", {
|
|
29324
29354
|
request: {
|
|
29325
|
-
requestId,
|
|
29355
|
+
requestId: requestId2,
|
|
29326
29356
|
sessionId: this.#sessionId,
|
|
29327
29357
|
mode: "queue",
|
|
29328
29358
|
content: command.input.map(({ text }) => ({ type: "text", text }))
|
|
@@ -15372,6 +15372,36 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
|
15372
15372
|
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
15373
15373
|
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
15374
15374
|
|
|
15375
|
+
// ../../shared-contracts/dist/realtime-call.js
|
|
15376
|
+
var REALTIME_CALL_FORWARDED_HEADERS = [
|
|
15377
|
+
"openai-alpha",
|
|
15378
|
+
"thread-id",
|
|
15379
|
+
"session-id",
|
|
15380
|
+
"originator",
|
|
15381
|
+
"x-codex-turn-metadata"
|
|
15382
|
+
];
|
|
15383
|
+
var FORWARDED_HEADERS = new Set(REALTIME_CALL_FORWARDED_HEADERS);
|
|
15384
|
+
var REALTIME_CALL_ID_PATTERN = /^rtc_[A-Za-z0-9_-]{1,128}$/u;
|
|
15385
|
+
var requestId = external_exports.string().min(1).max(128);
|
|
15386
|
+
var realtimeCallParamsSchema = external_exports.discriminatedUnion("operation", [
|
|
15387
|
+
external_exports.object({
|
|
15388
|
+
operation: external_exports.literal("create"),
|
|
15389
|
+
requestId,
|
|
15390
|
+
body: external_exports.string().min(1).max(16 << 20),
|
|
15391
|
+
headers: external_exports.record(external_exports.string(), external_exports.string()).default({})
|
|
15392
|
+
}),
|
|
15393
|
+
external_exports.object({ operation: external_exports.literal("cancel"), requestId }),
|
|
15394
|
+
external_exports.object({
|
|
15395
|
+
operation: external_exports.literal("hangup"),
|
|
15396
|
+
callId: external_exports.string().regex(REALTIME_CALL_ID_PATTERN)
|
|
15397
|
+
})
|
|
15398
|
+
]);
|
|
15399
|
+
var realtimeCallResponseSchema = external_exports.object({
|
|
15400
|
+
status: external_exports.number().int().min(200).max(599),
|
|
15401
|
+
body: external_exports.string(),
|
|
15402
|
+
headers: external_exports.record(external_exports.string(), external_exports.string())
|
|
15403
|
+
});
|
|
15404
|
+
|
|
15375
15405
|
// ../../shared-contracts/dist/console.js
|
|
15376
15406
|
var consoleAnnouncementSchema = external_exports.strictObject({
|
|
15377
15407
|
title: external_exports.string().trim().min(1).max(200),
|
|
@@ -18774,8 +18804,8 @@ var ConnectionContext = class {
|
|
|
18774
18804
|
/**
|
|
18775
18805
|
* Sends a protocol-level request cancellation notification.
|
|
18776
18806
|
*/
|
|
18777
|
-
sendCancelRequest(
|
|
18778
|
-
return this.connection.sendCancelRequest(
|
|
18807
|
+
sendCancelRequest(requestId2) {
|
|
18808
|
+
return this.connection.sendCancelRequest(requestId2);
|
|
18779
18809
|
}
|
|
18780
18810
|
/**
|
|
18781
18811
|
* Registers a handler that can be disposed independently.
|
|
@@ -18960,8 +18990,8 @@ var Connection = class {
|
|
|
18960
18990
|
/**
|
|
18961
18991
|
* Sends a protocol-level request cancellation notification.
|
|
18962
18992
|
*/
|
|
18963
|
-
sendCancelRequest(
|
|
18964
|
-
return this.sendNotification(CANCEL_REQUEST_METHOD, { requestId });
|
|
18993
|
+
sendCancelRequest(requestId2) {
|
|
18994
|
+
return this.sendNotification(CANCEL_REQUEST_METHOD, { requestId: requestId2 });
|
|
18965
18995
|
}
|
|
18966
18996
|
/**
|
|
18967
18997
|
* Sends a JSON-RPC notification.
|
|
@@ -19269,15 +19299,15 @@ var Connection = class {
|
|
|
19269
19299
|
if (message.method !== CANCEL_REQUEST_METHOD) {
|
|
19270
19300
|
return;
|
|
19271
19301
|
}
|
|
19272
|
-
const
|
|
19273
|
-
if (
|
|
19302
|
+
const requestId2 = cancelRequestId(message.params);
|
|
19303
|
+
if (requestId2 === void 0) {
|
|
19274
19304
|
return;
|
|
19275
19305
|
}
|
|
19276
|
-
const controller = this.incomingRequests.get(
|
|
19306
|
+
const controller = this.incomingRequests.get(requestId2);
|
|
19277
19307
|
if (!controller || controller.signal.aborted) {
|
|
19278
19308
|
return;
|
|
19279
19309
|
}
|
|
19280
|
-
controller.abort(RequestError.requestCancelled({ requestId }));
|
|
19310
|
+
controller.abort(RequestError.requestCancelled({ requestId: requestId2 }));
|
|
19281
19311
|
}
|
|
19282
19312
|
closedReason() {
|
|
19283
19313
|
return this.abortController.signal.reason ?? new Error("ACP connection closed");
|
|
@@ -19743,12 +19773,12 @@ var AcpContext = class {
|
|
|
19743
19773
|
}
|
|
19744
19774
|
};
|
|
19745
19775
|
var AgentContext = class _AgentContext extends AcpContext {
|
|
19746
|
-
constructor(cx,
|
|
19747
|
-
super(cx,
|
|
19776
|
+
constructor(cx, requestId2) {
|
|
19777
|
+
super(cx, requestId2);
|
|
19748
19778
|
}
|
|
19749
19779
|
/** @internal */
|
|
19750
|
-
static create(cx,
|
|
19751
|
-
return new _AgentContext(cx,
|
|
19780
|
+
static create(cx, requestId2) {
|
|
19781
|
+
return new _AgentContext(cx, requestId2);
|
|
19752
19782
|
}
|
|
19753
19783
|
request(method, params, options) {
|
|
19754
19784
|
const spec = clientRequestSpecsByMethod[method];
|
|
@@ -19759,12 +19789,12 @@ var AgentContext = class _AgentContext extends AcpContext {
|
|
|
19759
19789
|
}
|
|
19760
19790
|
};
|
|
19761
19791
|
var ClientContext = class _ClientContext extends AcpContext {
|
|
19762
|
-
constructor(cx,
|
|
19763
|
-
super(cx,
|
|
19792
|
+
constructor(cx, requestId2) {
|
|
19793
|
+
super(cx, requestId2);
|
|
19764
19794
|
}
|
|
19765
19795
|
/** @internal */
|
|
19766
|
-
static create(cx,
|
|
19767
|
-
return new _ClientContext(cx,
|
|
19796
|
+
static create(cx, requestId2) {
|
|
19797
|
+
return new _ClientContext(cx, requestId2);
|
|
19768
19798
|
}
|
|
19769
19799
|
/** @internal */
|
|
19770
19800
|
[startActiveSession](params, options) {
|
|
@@ -20197,10 +20227,10 @@ var agentRequestSpecsByMethod = specsByMethod(agentRequestSpecs);
|
|
|
20197
20227
|
var agentNotificationSpecsByMethod = specsByMethod(agentNotificationSpecs);
|
|
20198
20228
|
var clientRequestSpecsByMethod = specsByMethod(clientRequestSpecs);
|
|
20199
20229
|
var clientNotificationSpecsByMethod = specsByMethod(clientNotificationSpecs);
|
|
20200
|
-
function agentRequestContext(params, client2, signal,
|
|
20230
|
+
function agentRequestContext(params, client2, signal, requestId2) {
|
|
20201
20231
|
return {
|
|
20202
20232
|
params,
|
|
20203
|
-
requestId,
|
|
20233
|
+
requestId: requestId2,
|
|
20204
20234
|
signal,
|
|
20205
20235
|
client: client2
|
|
20206
20236
|
};
|
|
@@ -20212,10 +20242,10 @@ function agentNotificationContext(params, client2, signal) {
|
|
|
20212
20242
|
client: client2
|
|
20213
20243
|
};
|
|
20214
20244
|
}
|
|
20215
|
-
function clientRequestContext(params, agent, signal,
|
|
20245
|
+
function clientRequestContext(params, agent, signal, requestId2) {
|
|
20216
20246
|
return {
|
|
20217
20247
|
params,
|
|
20218
|
-
requestId,
|
|
20248
|
+
requestId: requestId2,
|
|
20219
20249
|
signal,
|
|
20220
20250
|
agent
|
|
20221
20251
|
};
|
|
@@ -20340,7 +20370,7 @@ var AgentApp = class {
|
|
|
20340
20370
|
return this.notification(spec, handlerOrParams);
|
|
20341
20371
|
}
|
|
20342
20372
|
request(spec, handler) {
|
|
20343
|
-
registerAppRequest(this.builder, spec, (params, cx, signal,
|
|
20373
|
+
registerAppRequest(this.builder, spec, (params, cx, signal, requestId2) => agentRequestContext(params, AgentContext.create(cx, requestId2), signal, requestId2), handler);
|
|
20344
20374
|
return this;
|
|
20345
20375
|
}
|
|
20346
20376
|
notification(spec, handler) {
|
|
@@ -20440,7 +20470,7 @@ var ClientApp = class {
|
|
|
20440
20470
|
return this.notification(spec, handlerOrParams);
|
|
20441
20471
|
}
|
|
20442
20472
|
request(spec, handler) {
|
|
20443
|
-
registerAppRequest(this.builder, spec, (params, cx, signal,
|
|
20473
|
+
registerAppRequest(this.builder, spec, (params, cx, signal, requestId2) => clientRequestContext(params, ClientContext.create(cx, requestId2), signal, requestId2), handler);
|
|
20444
20474
|
return this;
|
|
20445
20475
|
}
|
|
20446
20476
|
notification(spec, handler) {
|
|
@@ -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),
|