@karlorz/codexhost-cli-win32-arm64 0.13.3-4 → 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 +16122 -26
- package/app/desktop-controller.mjs +34 -3
- package/app/host-runtime.mjs +2597 -2341
- 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
|
@@ -27767,6 +27767,36 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
|
27767
27767
|
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
27768
27768
|
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
27769
27769
|
|
|
27770
|
+
// ../../shared-contracts/dist/realtime-call.js
|
|
27771
|
+
var REALTIME_CALL_FORWARDED_HEADERS = [
|
|
27772
|
+
"openai-alpha",
|
|
27773
|
+
"thread-id",
|
|
27774
|
+
"session-id",
|
|
27775
|
+
"originator",
|
|
27776
|
+
"x-codex-turn-metadata"
|
|
27777
|
+
];
|
|
27778
|
+
var FORWARDED_HEADERS = new Set(REALTIME_CALL_FORWARDED_HEADERS);
|
|
27779
|
+
var REALTIME_CALL_ID_PATTERN = /^rtc_[A-Za-z0-9_-]{1,128}$/u;
|
|
27780
|
+
var requestId = external_exports.string().min(1).max(128);
|
|
27781
|
+
var realtimeCallParamsSchema = external_exports.discriminatedUnion("operation", [
|
|
27782
|
+
external_exports.object({
|
|
27783
|
+
operation: external_exports.literal("create"),
|
|
27784
|
+
requestId,
|
|
27785
|
+
body: external_exports.string().min(1).max(16 << 20),
|
|
27786
|
+
headers: external_exports.record(external_exports.string(), external_exports.string()).default({})
|
|
27787
|
+
}),
|
|
27788
|
+
external_exports.object({ operation: external_exports.literal("cancel"), requestId }),
|
|
27789
|
+
external_exports.object({
|
|
27790
|
+
operation: external_exports.literal("hangup"),
|
|
27791
|
+
callId: external_exports.string().regex(REALTIME_CALL_ID_PATTERN)
|
|
27792
|
+
})
|
|
27793
|
+
]);
|
|
27794
|
+
var realtimeCallResponseSchema = external_exports.object({
|
|
27795
|
+
status: external_exports.number().int().min(200).max(599),
|
|
27796
|
+
body: external_exports.string(),
|
|
27797
|
+
headers: external_exports.record(external_exports.string(), external_exports.string())
|
|
27798
|
+
});
|
|
27799
|
+
|
|
27770
27800
|
// ../../shared-contracts/dist/console.js
|
|
27771
27801
|
var consoleAnnouncementSchema = external_exports.strictObject({
|
|
27772
27802
|
title: external_exports.string().trim().min(1).max(200),
|
|
@@ -37211,10 +37241,10 @@ var Protocol = class {
|
|
|
37211
37241
|
while (queuedMessage = await this._taskMessageQueue.dequeue(taskId, extra.sessionId)) {
|
|
37212
37242
|
if (queuedMessage.type === "response" || queuedMessage.type === "error") {
|
|
37213
37243
|
const message = queuedMessage.message;
|
|
37214
|
-
const
|
|
37215
|
-
const resolver = this._requestResolvers.get(
|
|
37244
|
+
const requestId2 = message.id;
|
|
37245
|
+
const resolver = this._requestResolvers.get(requestId2);
|
|
37216
37246
|
if (resolver) {
|
|
37217
|
-
this._requestResolvers.delete(
|
|
37247
|
+
this._requestResolvers.delete(requestId2);
|
|
37218
37248
|
if (queuedMessage.type === "response") {
|
|
37219
37249
|
resolver(message);
|
|
37220
37250
|
} else {
|
|
@@ -37224,7 +37254,7 @@ var Protocol = class {
|
|
|
37224
37254
|
}
|
|
37225
37255
|
} else {
|
|
37226
37256
|
const messageType = queuedMessage.type === "response" ? "Response" : "Error";
|
|
37227
|
-
this._onerror(new Error(`${messageType} handler missing for request ${
|
|
37257
|
+
this._onerror(new Error(`${messageType} handler missing for request ${requestId2}`));
|
|
37228
37258
|
}
|
|
37229
37259
|
continue;
|
|
37230
37260
|
}
|
|
@@ -37993,13 +38023,13 @@ var Protocol = class {
|
|
|
37993
38023
|
const messages = await this._taskMessageQueue.dequeueAll(taskId, sessionId);
|
|
37994
38024
|
for (const message of messages) {
|
|
37995
38025
|
if (message.type === "request" && isJSONRPCRequest(message.message)) {
|
|
37996
|
-
const
|
|
37997
|
-
const resolver = this._requestResolvers.get(
|
|
38026
|
+
const requestId2 = message.message.id;
|
|
38027
|
+
const resolver = this._requestResolvers.get(requestId2);
|
|
37998
38028
|
if (resolver) {
|
|
37999
38029
|
resolver(new McpError(ErrorCode.InternalError, "Task cancelled or completed"));
|
|
38000
|
-
this._requestResolvers.delete(
|
|
38030
|
+
this._requestResolvers.delete(requestId2);
|
|
38001
38031
|
} else {
|
|
38002
|
-
this._onerror(new Error(`Resolver missing for request ${
|
|
38032
|
+
this._onerror(new Error(`Resolver missing for request ${requestId2} during task ${taskId} cleanup`));
|
|
38003
38033
|
}
|
|
38004
38034
|
}
|
|
38005
38035
|
}
|
|
@@ -27364,6 +27364,36 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
|
27364
27364
|
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
27365
27365
|
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
27366
27366
|
|
|
27367
|
+
// ../../shared-contracts/dist/realtime-call.js
|
|
27368
|
+
var REALTIME_CALL_FORWARDED_HEADERS = [
|
|
27369
|
+
"openai-alpha",
|
|
27370
|
+
"thread-id",
|
|
27371
|
+
"session-id",
|
|
27372
|
+
"originator",
|
|
27373
|
+
"x-codex-turn-metadata"
|
|
27374
|
+
];
|
|
27375
|
+
var FORWARDED_HEADERS = new Set(REALTIME_CALL_FORWARDED_HEADERS);
|
|
27376
|
+
var REALTIME_CALL_ID_PATTERN = /^rtc_[A-Za-z0-9_-]{1,128}$/u;
|
|
27377
|
+
var requestId = external_exports.string().min(1).max(128);
|
|
27378
|
+
var realtimeCallParamsSchema = external_exports.discriminatedUnion("operation", [
|
|
27379
|
+
external_exports.object({
|
|
27380
|
+
operation: external_exports.literal("create"),
|
|
27381
|
+
requestId,
|
|
27382
|
+
body: external_exports.string().min(1).max(16 << 20),
|
|
27383
|
+
headers: external_exports.record(external_exports.string(), external_exports.string()).default({})
|
|
27384
|
+
}),
|
|
27385
|
+
external_exports.object({ operation: external_exports.literal("cancel"), requestId }),
|
|
27386
|
+
external_exports.object({
|
|
27387
|
+
operation: external_exports.literal("hangup"),
|
|
27388
|
+
callId: external_exports.string().regex(REALTIME_CALL_ID_PATTERN)
|
|
27389
|
+
})
|
|
27390
|
+
]);
|
|
27391
|
+
var realtimeCallResponseSchema = external_exports.object({
|
|
27392
|
+
status: external_exports.number().int().min(200).max(599),
|
|
27393
|
+
body: external_exports.string(),
|
|
27394
|
+
headers: external_exports.record(external_exports.string(), external_exports.string())
|
|
27395
|
+
});
|
|
27396
|
+
|
|
27367
27397
|
// ../../shared-contracts/dist/console.js
|
|
27368
27398
|
var consoleAnnouncementSchema = external_exports.strictObject({
|
|
27369
27399
|
title: external_exports.string().trim().min(1).max(200),
|
|
@@ -37213,10 +37243,10 @@ var Protocol = class {
|
|
|
37213
37243
|
while (queuedMessage = await this._taskMessageQueue.dequeue(taskId, extra.sessionId)) {
|
|
37214
37244
|
if (queuedMessage.type === "response" || queuedMessage.type === "error") {
|
|
37215
37245
|
const message = queuedMessage.message;
|
|
37216
|
-
const
|
|
37217
|
-
const resolver = this._requestResolvers.get(
|
|
37246
|
+
const requestId2 = message.id;
|
|
37247
|
+
const resolver = this._requestResolvers.get(requestId2);
|
|
37218
37248
|
if (resolver) {
|
|
37219
|
-
this._requestResolvers.delete(
|
|
37249
|
+
this._requestResolvers.delete(requestId2);
|
|
37220
37250
|
if (queuedMessage.type === "response") {
|
|
37221
37251
|
resolver(message);
|
|
37222
37252
|
} else {
|
|
@@ -37226,7 +37256,7 @@ var Protocol = class {
|
|
|
37226
37256
|
}
|
|
37227
37257
|
} else {
|
|
37228
37258
|
const messageType = queuedMessage.type === "response" ? "Response" : "Error";
|
|
37229
|
-
this._onerror(new Error(`${messageType} handler missing for request ${
|
|
37259
|
+
this._onerror(new Error(`${messageType} handler missing for request ${requestId2}`));
|
|
37230
37260
|
}
|
|
37231
37261
|
continue;
|
|
37232
37262
|
}
|
|
@@ -37995,13 +38025,13 @@ var Protocol = class {
|
|
|
37995
38025
|
const messages = await this._taskMessageQueue.dequeueAll(taskId, sessionId);
|
|
37996
38026
|
for (const message of messages) {
|
|
37997
38027
|
if (message.type === "request" && isJSONRPCRequest(message.message)) {
|
|
37998
|
-
const
|
|
37999
|
-
const resolver = this._requestResolvers.get(
|
|
38028
|
+
const requestId2 = message.message.id;
|
|
38029
|
+
const resolver = this._requestResolvers.get(requestId2);
|
|
38000
38030
|
if (resolver) {
|
|
38001
38031
|
resolver(new McpError(ErrorCode.InternalError, "Task cancelled or completed"));
|
|
38002
|
-
this._requestResolvers.delete(
|
|
38032
|
+
this._requestResolvers.delete(requestId2);
|
|
38003
38033
|
} else {
|
|
38004
|
-
this._onerror(new Error(`Resolver missing for request ${
|
|
38034
|
+
this._onerror(new Error(`Resolver missing for request ${requestId2} during task ${taskId} cleanup`));
|
|
38005
38035
|
}
|
|
38006
38036
|
}
|
|
38007
38037
|
}
|
|
@@ -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),
|
|
@@ -18899,8 +18929,8 @@ function historyUsageRequests(contents, historical) {
|
|
|
18899
18929
|
}
|
|
18900
18930
|
const requests = [];
|
|
18901
18931
|
let complete = true;
|
|
18902
|
-
for (const [
|
|
18903
|
-
const request = providerUsageRequest(
|
|
18932
|
+
for (const [requestId2, data] of usages) {
|
|
18933
|
+
const request = providerUsageRequest(requestId2, data, historical);
|
|
18904
18934
|
if (request)
|
|
18905
18935
|
requests.push(request);
|
|
18906
18936
|
else
|
|
@@ -18908,7 +18938,7 @@ function historyUsageRequests(contents, historical) {
|
|
|
18908
18938
|
}
|
|
18909
18939
|
return { requests, complete };
|
|
18910
18940
|
}
|
|
18911
|
-
function providerUsageRequest(
|
|
18941
|
+
function providerUsageRequest(requestId2, data, historical) {
|
|
18912
18942
|
const usage = record2(data.rawUsage);
|
|
18913
18943
|
const model2 = text(data.model) || text(data.requestModelId);
|
|
18914
18944
|
const input = usageCount(usage.prompt_tokens);
|
|
@@ -18922,7 +18952,7 @@ function providerUsageRequest(requestId, data, historical) {
|
|
|
18922
18952
|
}
|
|
18923
18953
|
try {
|
|
18924
18954
|
return parseHostUsageRequest({
|
|
18925
|
-
requestId,
|
|
18955
|
+
requestId: requestId2,
|
|
18926
18956
|
...historical ? { historical: true } : {},
|
|
18927
18957
|
model: model2,
|
|
18928
18958
|
inputTokens: input,
|
|
@@ -20984,8 +21014,8 @@ var ConnectionContext = class {
|
|
|
20984
21014
|
/**
|
|
20985
21015
|
* Sends a protocol-level request cancellation notification.
|
|
20986
21016
|
*/
|
|
20987
|
-
sendCancelRequest(
|
|
20988
|
-
return this.connection.sendCancelRequest(
|
|
21017
|
+
sendCancelRequest(requestId2) {
|
|
21018
|
+
return this.connection.sendCancelRequest(requestId2);
|
|
20989
21019
|
}
|
|
20990
21020
|
/**
|
|
20991
21021
|
* Registers a handler that can be disposed independently.
|
|
@@ -21170,8 +21200,8 @@ var Connection = class {
|
|
|
21170
21200
|
/**
|
|
21171
21201
|
* Sends a protocol-level request cancellation notification.
|
|
21172
21202
|
*/
|
|
21173
|
-
sendCancelRequest(
|
|
21174
|
-
return this.sendNotification(CANCEL_REQUEST_METHOD, { requestId });
|
|
21203
|
+
sendCancelRequest(requestId2) {
|
|
21204
|
+
return this.sendNotification(CANCEL_REQUEST_METHOD, { requestId: requestId2 });
|
|
21175
21205
|
}
|
|
21176
21206
|
/**
|
|
21177
21207
|
* Sends a JSON-RPC notification.
|
|
@@ -21479,15 +21509,15 @@ var Connection = class {
|
|
|
21479
21509
|
if (message.method !== CANCEL_REQUEST_METHOD) {
|
|
21480
21510
|
return;
|
|
21481
21511
|
}
|
|
21482
|
-
const
|
|
21483
|
-
if (
|
|
21512
|
+
const requestId2 = cancelRequestId(message.params);
|
|
21513
|
+
if (requestId2 === void 0) {
|
|
21484
21514
|
return;
|
|
21485
21515
|
}
|
|
21486
|
-
const controller = this.incomingRequests.get(
|
|
21516
|
+
const controller = this.incomingRequests.get(requestId2);
|
|
21487
21517
|
if (!controller || controller.signal.aborted) {
|
|
21488
21518
|
return;
|
|
21489
21519
|
}
|
|
21490
|
-
controller.abort(RequestError.requestCancelled({ requestId }));
|
|
21520
|
+
controller.abort(RequestError.requestCancelled({ requestId: requestId2 }));
|
|
21491
21521
|
}
|
|
21492
21522
|
closedReason() {
|
|
21493
21523
|
return this.abortController.signal.reason ?? new Error("ACP connection closed");
|
|
@@ -21953,12 +21983,12 @@ var AcpContext = class {
|
|
|
21953
21983
|
}
|
|
21954
21984
|
};
|
|
21955
21985
|
var AgentContext = class _AgentContext extends AcpContext {
|
|
21956
|
-
constructor(cx,
|
|
21957
|
-
super(cx,
|
|
21986
|
+
constructor(cx, requestId2) {
|
|
21987
|
+
super(cx, requestId2);
|
|
21958
21988
|
}
|
|
21959
21989
|
/** @internal */
|
|
21960
|
-
static create(cx,
|
|
21961
|
-
return new _AgentContext(cx,
|
|
21990
|
+
static create(cx, requestId2) {
|
|
21991
|
+
return new _AgentContext(cx, requestId2);
|
|
21962
21992
|
}
|
|
21963
21993
|
request(method, params, options) {
|
|
21964
21994
|
const spec = clientRequestSpecsByMethod[method];
|
|
@@ -21969,12 +21999,12 @@ var AgentContext = class _AgentContext extends AcpContext {
|
|
|
21969
21999
|
}
|
|
21970
22000
|
};
|
|
21971
22001
|
var ClientContext = class _ClientContext extends AcpContext {
|
|
21972
|
-
constructor(cx,
|
|
21973
|
-
super(cx,
|
|
22002
|
+
constructor(cx, requestId2) {
|
|
22003
|
+
super(cx, requestId2);
|
|
21974
22004
|
}
|
|
21975
22005
|
/** @internal */
|
|
21976
|
-
static create(cx,
|
|
21977
|
-
return new _ClientContext(cx,
|
|
22006
|
+
static create(cx, requestId2) {
|
|
22007
|
+
return new _ClientContext(cx, requestId2);
|
|
21978
22008
|
}
|
|
21979
22009
|
/** @internal */
|
|
21980
22010
|
[startActiveSession](params, options) {
|
|
@@ -22407,10 +22437,10 @@ var agentRequestSpecsByMethod = specsByMethod(agentRequestSpecs);
|
|
|
22407
22437
|
var agentNotificationSpecsByMethod = specsByMethod(agentNotificationSpecs);
|
|
22408
22438
|
var clientRequestSpecsByMethod = specsByMethod(clientRequestSpecs);
|
|
22409
22439
|
var clientNotificationSpecsByMethod = specsByMethod(clientNotificationSpecs);
|
|
22410
|
-
function agentRequestContext(params, client2, signal,
|
|
22440
|
+
function agentRequestContext(params, client2, signal, requestId2) {
|
|
22411
22441
|
return {
|
|
22412
22442
|
params,
|
|
22413
|
-
requestId,
|
|
22443
|
+
requestId: requestId2,
|
|
22414
22444
|
signal,
|
|
22415
22445
|
client: client2
|
|
22416
22446
|
};
|
|
@@ -22422,10 +22452,10 @@ function agentNotificationContext(params, client2, signal) {
|
|
|
22422
22452
|
client: client2
|
|
22423
22453
|
};
|
|
22424
22454
|
}
|
|
22425
|
-
function clientRequestContext(params, agent, signal,
|
|
22455
|
+
function clientRequestContext(params, agent, signal, requestId2) {
|
|
22426
22456
|
return {
|
|
22427
22457
|
params,
|
|
22428
|
-
requestId,
|
|
22458
|
+
requestId: requestId2,
|
|
22429
22459
|
signal,
|
|
22430
22460
|
agent
|
|
22431
22461
|
};
|
|
@@ -22550,7 +22580,7 @@ var AgentApp = class {
|
|
|
22550
22580
|
return this.notification(spec, handlerOrParams);
|
|
22551
22581
|
}
|
|
22552
22582
|
request(spec, handler) {
|
|
22553
|
-
registerAppRequest(this.builder, spec, (params, cx, signal,
|
|
22583
|
+
registerAppRequest(this.builder, spec, (params, cx, signal, requestId2) => agentRequestContext(params, AgentContext.create(cx, requestId2), signal, requestId2), handler);
|
|
22554
22584
|
return this;
|
|
22555
22585
|
}
|
|
22556
22586
|
notification(spec, handler) {
|
|
@@ -22650,7 +22680,7 @@ var ClientApp = class {
|
|
|
22650
22680
|
return this.notification(spec, handlerOrParams);
|
|
22651
22681
|
}
|
|
22652
22682
|
request(spec, handler) {
|
|
22653
|
-
registerAppRequest(this.builder, spec, (params, cx, signal,
|
|
22683
|
+
registerAppRequest(this.builder, spec, (params, cx, signal, requestId2) => clientRequestContext(params, ClientContext.create(cx, requestId2), signal, requestId2), handler);
|
|
22654
22684
|
return this;
|
|
22655
22685
|
}
|
|
22656
22686
|
notification(spec, handler) {
|
|
@@ -25092,8 +25122,8 @@ var CodeBuddyChildObserver = class {
|
|
|
25092
25122
|
}
|
|
25093
25123
|
return next;
|
|
25094
25124
|
}
|
|
25095
|
-
async locate(
|
|
25096
|
-
if (!
|
|
25125
|
+
async locate(requestId2) {
|
|
25126
|
+
if (!requestId2)
|
|
25097
25127
|
return void 0;
|
|
25098
25128
|
const directory = await this.#directory();
|
|
25099
25129
|
const files = (await readdir2(directory, { withFileTypes: true })).filter((entry) => entry.isFile() && /^agent-[\w-]+\.jsonl$/u.test(entry.name));
|
|
@@ -25103,7 +25133,7 @@ var CodeBuddyChildObserver = class {
|
|
|
25103
25133
|
for (const file2 of files) {
|
|
25104
25134
|
const id = file2.name.slice(0, -6), data = await this.#child(directory, id);
|
|
25105
25135
|
const first = data.entries.find((row) => row.type === "message" && row.role === "user");
|
|
25106
|
-
if (record2(first?.providerData).conversationRequestId ===
|
|
25136
|
+
if (record2(first?.providerData).conversationRequestId === requestId2)
|
|
25107
25137
|
matches.push(id);
|
|
25108
25138
|
}
|
|
25109
25139
|
if (matches.length > 1)
|
|
@@ -25188,9 +25218,9 @@ var CodeBuddySubagents = class {
|
|
|
25188
25218
|
if (parentCallId) {
|
|
25189
25219
|
const call2 = this.#calls.get(parentCallId);
|
|
25190
25220
|
if (call2 && !call2.observationDone) {
|
|
25191
|
-
const
|
|
25192
|
-
if (
|
|
25193
|
-
call2.requestId =
|
|
25221
|
+
const requestId2 = text(meta3["codebuddy.ai/conversationRequestId"]);
|
|
25222
|
+
if (requestId2)
|
|
25223
|
+
call2.requestId = requestId2;
|
|
25194
25224
|
const progress = update.sessionUpdate === "tool_call" && meta3["codebuddy.ai/toolArgumentsComplete"] ? text(update.title) : "";
|
|
25195
25225
|
if (progress)
|
|
25196
25226
|
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),
|
|
@@ -17414,24 +17444,24 @@ var CliTransport = class {
|
|
|
17414
17444
|
if (method === "session/requestRuntimePreferences")
|
|
17415
17445
|
reply({ result: RUNTIME_PREFERENCES });
|
|
17416
17446
|
else if (method === "interaction/requestPermission" || method === "interaction/requestUserInput") {
|
|
17417
|
-
const
|
|
17418
|
-
if (this.#reportedInteractions.has(
|
|
17447
|
+
const requestId2 = text(params.requestId);
|
|
17448
|
+
if (this.#reportedInteractions.has(requestId2))
|
|
17419
17449
|
return;
|
|
17420
|
-
this.#reportedInteractions.add(
|
|
17450
|
+
this.#reportedInteractions.add(requestId2);
|
|
17421
17451
|
this.#emitSession(params.sessionId, {
|
|
17422
17452
|
type: method === "interaction/requestPermission" ? "permission.request" : "userInput.request",
|
|
17423
17453
|
request: params
|
|
17424
17454
|
});
|
|
17425
17455
|
} else if (method === "interaction/requestProviderRuntimeHeaders") {
|
|
17426
|
-
const
|
|
17456
|
+
const requestId2 = text(params.requestId);
|
|
17427
17457
|
const controller = new AbortController();
|
|
17428
|
-
this.#headerRequests.set(
|
|
17458
|
+
this.#headerRequests.set(requestId2, controller);
|
|
17429
17459
|
try {
|
|
17430
17460
|
reply({
|
|
17431
17461
|
result: await providerRuntimeHeaders(params, controller.signal, this.#installation, this.options.environment, () => this.options.verifier(this.#installation.version), this.#codingPlan)
|
|
17432
17462
|
});
|
|
17433
17463
|
} finally {
|
|
17434
|
-
this.#headerRequests.delete(
|
|
17464
|
+
this.#headerRequests.delete(requestId2);
|
|
17435
17465
|
}
|
|
17436
17466
|
} else if (method === "interaction/requestOfficialMcpAuthHeaders")
|
|
17437
17467
|
reply({ result: { ok: false, reason: "official_auth_unavailable" } });
|
|
@@ -19162,10 +19192,10 @@ function history(snapshot, events = [], locator) {
|
|
|
19162
19192
|
|
|
19163
19193
|
// dist/interactions.js
|
|
19164
19194
|
function makeInteraction(method, params, turnId) {
|
|
19165
|
-
const p = record2(params),
|
|
19166
|
-
if (!
|
|
19195
|
+
const p = record2(params), requestId2 = text(p.requestId);
|
|
19196
|
+
if (!requestId2)
|
|
19167
19197
|
throw new ZcodeError("protocolError", "ZCode interaction has no request ID");
|
|
19168
|
-
const interactionId = hostInteractionIdSchema.parse(`zcode:${
|
|
19198
|
+
const interactionId = hostInteractionIdSchema.parse(`zcode:${requestId2}`);
|
|
19169
19199
|
if (method === "interaction/requestPermission") {
|
|
19170
19200
|
const options = Array.isArray(p.options) ? p.options.map(record2) : [];
|
|
19171
19201
|
const actions = options.flatMap((option) => {
|
|
@@ -19196,7 +19226,7 @@ function makeInteraction(method, params, turnId) {
|
|
|
19196
19226
|
};
|
|
19197
19227
|
return {
|
|
19198
19228
|
interaction: interaction2,
|
|
19199
|
-
requestId,
|
|
19229
|
+
requestId: requestId2,
|
|
19200
19230
|
response(value) {
|
|
19201
19231
|
if (value.type !== "approval")
|
|
19202
19232
|
throw new ZcodeError("invalidRequest", "Expected an approval response");
|
|
@@ -19241,7 +19271,7 @@ function makeInteraction(method, params, turnId) {
|
|
|
19241
19271
|
};
|
|
19242
19272
|
return {
|
|
19243
19273
|
interaction,
|
|
19244
|
-
requestId,
|
|
19274
|
+
requestId: requestId2,
|
|
19245
19275
|
response(value) {
|
|
19246
19276
|
if (value.type !== "question")
|
|
19247
19277
|
throw new ZcodeError("invalidRequest", "Expected a question response");
|
|
@@ -19498,10 +19528,10 @@ var ZcodeSession = class {
|
|
|
19498
19528
|
else if (event.type === "state.updated")
|
|
19499
19529
|
this.#message({ method: "state.updated", params: event.notification });
|
|
19500
19530
|
else if (event.type === "permission.request" || event.type === "userInput.request") {
|
|
19501
|
-
const request = record2(event.request),
|
|
19502
|
-
this.#nativeInteractions.set(
|
|
19531
|
+
const request = record2(event.request), requestId2 = text(request.requestId);
|
|
19532
|
+
this.#nativeInteractions.set(requestId2, { request, type: event.type });
|
|
19503
19533
|
this.#message({
|
|
19504
|
-
requestId,
|
|
19534
|
+
requestId: requestId2,
|
|
19505
19535
|
method: event.type === "permission.request" ? "interaction/requestPermission" : "interaction/requestUserInput",
|
|
19506
19536
|
params: request
|
|
19507
19537
|
});
|
|
@@ -19513,8 +19543,8 @@ var ZcodeSession = class {
|
|
|
19513
19543
|
await this.#readNative();
|
|
19514
19544
|
}
|
|
19515
19545
|
#nativeInteractions = /* @__PURE__ */ new Map();
|
|
19516
|
-
async #respond(
|
|
19517
|
-
const pending = this.#nativeInteractions.get(
|
|
19546
|
+
async #respond(requestId2, result) {
|
|
19547
|
+
const pending = this.#nativeInteractions.get(requestId2);
|
|
19518
19548
|
if (!pending)
|
|
19519
19549
|
throw new ZcodeError("invalidRequest", "ZCode interaction is no longer pending");
|
|
19520
19550
|
let answer = result;
|
|
@@ -19525,22 +19555,22 @@ var ZcodeSession = class {
|
|
|
19525
19555
|
throw new ZcodeError("invalidRequest", "ZCode approval does not match a native option");
|
|
19526
19556
|
answer = { optionId: option.optionId };
|
|
19527
19557
|
}
|
|
19528
|
-
this.#nativeInteractions.delete(
|
|
19558
|
+
this.#nativeInteractions.delete(requestId2);
|
|
19529
19559
|
try {
|
|
19530
19560
|
await this.transport.command(this.sessionId, "resolveInteraction", {
|
|
19531
|
-
interactionId:
|
|
19561
|
+
interactionId: requestId2,
|
|
19532
19562
|
answer
|
|
19533
19563
|
});
|
|
19534
19564
|
} catch (error51) {
|
|
19535
|
-
if (this.#pendingInteractions.has(`zcode:${
|
|
19536
|
-
this.#nativeInteractions.set(
|
|
19565
|
+
if (this.#pendingInteractions.has(`zcode:${requestId2}`))
|
|
19566
|
+
this.#nativeInteractions.set(requestId2, pending);
|
|
19537
19567
|
throw error51;
|
|
19538
19568
|
}
|
|
19539
19569
|
}
|
|
19540
|
-
#reject(
|
|
19541
|
-
const pending = this.#nativeInteractions.get(
|
|
19570
|
+
#reject(requestId2) {
|
|
19571
|
+
const pending = this.#nativeInteractions.get(requestId2);
|
|
19542
19572
|
if (pending)
|
|
19543
|
-
void this.#respond(
|
|
19573
|
+
void this.#respond(requestId2, pending.type === "permission.request" ? { decision: "deny" } : { action: "cancel" }).catch(() => void 0);
|
|
19544
19574
|
}
|
|
19545
19575
|
async #readNative() {
|
|
19546
19576
|
return snapshotSchema.parse(await this.transport.request("readSession", { sessionId: this.sessionId }));
|