@karlorz/codexhost-cli-win32-arm64 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
|
@@ -15187,6 +15187,36 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
|
15187
15187
|
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
15188
15188
|
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
15189
15189
|
|
|
15190
|
+
// ../../shared-contracts/dist/realtime-call.js
|
|
15191
|
+
var REALTIME_CALL_FORWARDED_HEADERS = [
|
|
15192
|
+
"openai-alpha",
|
|
15193
|
+
"thread-id",
|
|
15194
|
+
"session-id",
|
|
15195
|
+
"originator",
|
|
15196
|
+
"x-codex-turn-metadata"
|
|
15197
|
+
];
|
|
15198
|
+
var FORWARDED_HEADERS = new Set(REALTIME_CALL_FORWARDED_HEADERS);
|
|
15199
|
+
var REALTIME_CALL_ID_PATTERN = /^rtc_[A-Za-z0-9_-]{1,128}$/u;
|
|
15200
|
+
var requestId = external_exports.string().min(1).max(128);
|
|
15201
|
+
var realtimeCallParamsSchema = external_exports.discriminatedUnion("operation", [
|
|
15202
|
+
external_exports.object({
|
|
15203
|
+
operation: external_exports.literal("create"),
|
|
15204
|
+
requestId,
|
|
15205
|
+
body: external_exports.string().min(1).max(16 << 20),
|
|
15206
|
+
headers: external_exports.record(external_exports.string(), external_exports.string()).default({})
|
|
15207
|
+
}),
|
|
15208
|
+
external_exports.object({ operation: external_exports.literal("cancel"), requestId }),
|
|
15209
|
+
external_exports.object({
|
|
15210
|
+
operation: external_exports.literal("hangup"),
|
|
15211
|
+
callId: external_exports.string().regex(REALTIME_CALL_ID_PATTERN)
|
|
15212
|
+
})
|
|
15213
|
+
]);
|
|
15214
|
+
var realtimeCallResponseSchema = external_exports.object({
|
|
15215
|
+
status: external_exports.number().int().min(200).max(599),
|
|
15216
|
+
body: external_exports.string(),
|
|
15217
|
+
headers: external_exports.record(external_exports.string(), external_exports.string())
|
|
15218
|
+
});
|
|
15219
|
+
|
|
15190
15220
|
// ../../shared-contracts/dist/console.js
|
|
15191
15221
|
var consoleAnnouncementSchema = external_exports.strictObject({
|
|
15192
15222
|
title: external_exports.string().trim().min(1).max(200),
|
|
@@ -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),
|
|
@@ -17408,7 +17438,7 @@ function count2(value) {
|
|
|
17408
17438
|
function isClaudeModelRequest(model2) {
|
|
17409
17439
|
return typeof model2 === "string" && model2.length > 0 && model2 !== SYNTHETIC_MODEL;
|
|
17410
17440
|
}
|
|
17411
|
-
function claudeUsageRecord(
|
|
17441
|
+
function claudeUsageRecord(requestId2, model2, usage, extra = {}) {
|
|
17412
17442
|
if (!isRecord2(usage))
|
|
17413
17443
|
return { kind: "missing" };
|
|
17414
17444
|
const input = count2(usage.input_tokens);
|
|
@@ -17427,7 +17457,7 @@ function claudeUsageRecord(requestId, model2, usage, extra = {}) {
|
|
|
17427
17457
|
return {
|
|
17428
17458
|
kind: "request",
|
|
17429
17459
|
request: parseHostUsageRequest({
|
|
17430
|
-
requestId,
|
|
17460
|
+
requestId: requestId2,
|
|
17431
17461
|
...extra.historical ? { historical: true } : {},
|
|
17432
17462
|
model: model2,
|
|
17433
17463
|
// Claude Code's providers (first-party, Bedrock, Vertex, gateways) differ in model IDs,
|
|
@@ -54466,11 +54496,11 @@ function parseLastRequestUsage(value, attribution = {}) {
|
|
|
54466
54496
|
if (!safeNonNegativeInteger(inputTokens) || !safeNonNegativeInteger(outputTokens) || !safeNonNegativeInteger(cacheCreationInputTokens) || !safeNonNegativeInteger(cacheReadInputTokens)) {
|
|
54467
54497
|
return void 0;
|
|
54468
54498
|
}
|
|
54469
|
-
const
|
|
54499
|
+
const requestId2 = boundedString(attribution.requestId, 500);
|
|
54470
54500
|
const model2 = boundedString(attribution.model, 500);
|
|
54471
54501
|
const provider = boundedString(attribution.provider, 100);
|
|
54472
54502
|
return {
|
|
54473
|
-
...
|
|
54503
|
+
...requestId2 ? { requestId: requestId2 } : {},
|
|
54474
54504
|
...model2 ? { model: model2 } : {},
|
|
54475
54505
|
...provider ? { provider } : {},
|
|
54476
54506
|
inputTokens,
|
|
@@ -54547,12 +54577,14 @@ function nativeSubagentId(nativeResult, outputText) {
|
|
|
54547
54577
|
}
|
|
54548
54578
|
function subagentContinuesInBackground(nativeResult, outputText) {
|
|
54549
54579
|
if (isRecord7(nativeResult)) {
|
|
54580
|
+
if (typeof nativeResult.status === "string")
|
|
54581
|
+
return nativeResult.status === "async_launched";
|
|
54550
54582
|
if (nativeResult.isAsync === true || nativeResult.is_async === true)
|
|
54551
54583
|
return true;
|
|
54552
|
-
if (nativeResult.
|
|
54553
|
-
return
|
|
54584
|
+
if (nativeResult.isAsync === false || nativeResult.is_async === false)
|
|
54585
|
+
return false;
|
|
54554
54586
|
}
|
|
54555
|
-
return
|
|
54587
|
+
return /^Async agent launched successfully\.\r?\nagentId: [A-Za-z0-9_-]+\r?\nThe agent is working in the background\.(?:\r?\n|$)/u.test(outputText ?? "");
|
|
54556
54588
|
}
|
|
54557
54589
|
function resultText(content, nativeResult) {
|
|
54558
54590
|
let text2 = "";
|
|
@@ -56692,7 +56724,7 @@ function permissionSuggestionScope(value) {
|
|
|
56692
56724
|
}
|
|
56693
56725
|
return value.some(({ destination }) => permissionUpdateDestination(destination) === "always") ? "always" : "session";
|
|
56694
56726
|
}
|
|
56695
|
-
function parseApprovalRequest(
|
|
56727
|
+
function parseApprovalRequest(requestId2, toolName, options, agentLabel) {
|
|
56696
56728
|
const toolTitle = [options.title, options.displayName, options.description, toolName].map((value) => boundedDisplayText(value, APPROVAL_TITLE_MAX_LENGTH)).find((value) => value !== null);
|
|
56697
56729
|
if (!toolTitle)
|
|
56698
56730
|
return null;
|
|
@@ -56701,7 +56733,7 @@ function parseApprovalRequest(requestId, toolName, options, agentLabel) {
|
|
|
56701
56733
|
const suggestedScope = permissionSuggestionScope(options.suggestions);
|
|
56702
56734
|
return {
|
|
56703
56735
|
type: "approval",
|
|
56704
|
-
requestId,
|
|
56736
|
+
requestId: requestId2,
|
|
56705
56737
|
title,
|
|
56706
56738
|
...description && description !== title ? { description } : {},
|
|
56707
56739
|
...suggestedScope ? { suggestedScope } : {}
|
|
@@ -57145,19 +57177,19 @@ var ClaudeSdkTransport = class {
|
|
|
57145
57177
|
}
|
|
57146
57178
|
const agentId = typeof options.agentID === "string" && options.agentID.length > 0 ? options.agentID : void 0;
|
|
57147
57179
|
this.#interactionOrdinal += 1;
|
|
57148
|
-
const
|
|
57180
|
+
const requestId2 = `claude-${toolName === "AskUserQuestion" ? "question" : "approval"}-${this.#interactionOrdinal}`;
|
|
57149
57181
|
let request;
|
|
57150
57182
|
if (toolName === "AskUserQuestion") {
|
|
57151
57183
|
const questions = parseQuestions(input);
|
|
57152
|
-
request = questions ? { type: "question", requestId, questions } : null;
|
|
57184
|
+
request = questions ? { type: "question", requestId: requestId2, questions } : null;
|
|
57153
57185
|
} else if (toolName === "ExitPlanMode") {
|
|
57154
57186
|
request = {
|
|
57155
57187
|
type: "planApproval",
|
|
57156
|
-
requestId,
|
|
57188
|
+
requestId: requestId2,
|
|
57157
57189
|
plan: typeof input.plan === "string" && input.plan.trim().length > 0 ? input.plan : null
|
|
57158
57190
|
};
|
|
57159
57191
|
} else {
|
|
57160
|
-
request = parseApprovalRequest(
|
|
57192
|
+
request = parseApprovalRequest(requestId2, toolName, options, agentId ? this.#workflowAgentLabels.get(agentId) : void 0);
|
|
57161
57193
|
}
|
|
57162
57194
|
if (!request) {
|
|
57163
57195
|
return Promise.resolve(denied(options.toolUseID, "Claude Tool permission request is invalid"));
|
|
@@ -59977,12 +60009,12 @@ var ClaudeHarnessSession = class {
|
|
|
59977
60009
|
active.interactionByRequestId.set(request.requestId, interactionId);
|
|
59978
60010
|
this.#channel.emit({ kind: "interaction", interaction: pending.interaction });
|
|
59979
60011
|
}
|
|
59980
|
-
#closeInteraction(active,
|
|
59981
|
-
const interactionId = active.interactionByRequestId.get(
|
|
60012
|
+
#closeInteraction(active, requestId2, reason) {
|
|
60013
|
+
const interactionId = active.interactionByRequestId.get(requestId2);
|
|
59982
60014
|
if (!interactionId)
|
|
59983
60015
|
throw new Error("Claude Code Interaction close references an unknown request");
|
|
59984
|
-
active.interactionByRequestId.delete(
|
|
59985
|
-
active.agentScopedRequestIds.delete(
|
|
60016
|
+
active.interactionByRequestId.delete(requestId2);
|
|
60017
|
+
active.agentScopedRequestIds.delete(requestId2);
|
|
59986
60018
|
active.interactions.delete(interactionId);
|
|
59987
60019
|
this.#event({
|
|
59988
60020
|
type: "interaction.closed",
|
|
@@ -60007,8 +60039,8 @@ var ClaudeHarnessSession = class {
|
|
|
60007
60039
|
}
|
|
60008
60040
|
}
|
|
60009
60041
|
#hasRootInteractions(active) {
|
|
60010
|
-
for (const
|
|
60011
|
-
if (!active.agentScopedRequestIds.has(
|
|
60042
|
+
for (const requestId2 of active.interactionByRequestId.keys()) {
|
|
60043
|
+
if (!active.agentScopedRequestIds.has(requestId2))
|
|
60012
60044
|
return true;
|
|
60013
60045
|
}
|
|
60014
60046
|
return false;
|
|
@@ -60359,10 +60391,10 @@ var ClaudeHarnessSession = class {
|
|
|
60359
60391
|
}
|
|
60360
60392
|
}
|
|
60361
60393
|
#applyLatestRequestUsage(active, usage) {
|
|
60362
|
-
const
|
|
60363
|
-
if (active.usageRequestIds.has(
|
|
60394
|
+
const requestId2 = usage.requestId ?? `${active.nativeTurnKey}:${usage.model ?? "unknown"}`;
|
|
60395
|
+
if (active.usageRequestIds.has(requestId2))
|
|
60364
60396
|
return;
|
|
60365
|
-
active.usageRequestIds.add(
|
|
60397
|
+
active.usageRequestIds.add(requestId2);
|
|
60366
60398
|
active.estimatedInputTokens += usage.inputTokens + usage.cacheCreationInputTokens + usage.cacheReadInputTokens;
|
|
60367
60399
|
active.estimatedOutputTokens += usage.outputTokens;
|
|
60368
60400
|
const estimatedCostUsd = estimateClaudeRequestCostUsd(usage);
|
|
@@ -15257,6 +15257,36 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
|
15257
15257
|
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
15258
15258
|
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
15259
15259
|
|
|
15260
|
+
// ../../shared-contracts/dist/realtime-call.js
|
|
15261
|
+
var REALTIME_CALL_FORWARDED_HEADERS = [
|
|
15262
|
+
"openai-alpha",
|
|
15263
|
+
"thread-id",
|
|
15264
|
+
"session-id",
|
|
15265
|
+
"originator",
|
|
15266
|
+
"x-codex-turn-metadata"
|
|
15267
|
+
];
|
|
15268
|
+
var FORWARDED_HEADERS = new Set(REALTIME_CALL_FORWARDED_HEADERS);
|
|
15269
|
+
var REALTIME_CALL_ID_PATTERN = /^rtc_[A-Za-z0-9_-]{1,128}$/u;
|
|
15270
|
+
var requestId = external_exports.string().min(1).max(128);
|
|
15271
|
+
var realtimeCallParamsSchema = external_exports.discriminatedUnion("operation", [
|
|
15272
|
+
external_exports.object({
|
|
15273
|
+
operation: external_exports.literal("create"),
|
|
15274
|
+
requestId,
|
|
15275
|
+
body: external_exports.string().min(1).max(16 << 20),
|
|
15276
|
+
headers: external_exports.record(external_exports.string(), external_exports.string()).default({})
|
|
15277
|
+
}),
|
|
15278
|
+
external_exports.object({ operation: external_exports.literal("cancel"), requestId }),
|
|
15279
|
+
external_exports.object({
|
|
15280
|
+
operation: external_exports.literal("hangup"),
|
|
15281
|
+
callId: external_exports.string().regex(REALTIME_CALL_ID_PATTERN)
|
|
15282
|
+
})
|
|
15283
|
+
]);
|
|
15284
|
+
var realtimeCallResponseSchema = external_exports.object({
|
|
15285
|
+
status: external_exports.number().int().min(200).max(599),
|
|
15286
|
+
body: external_exports.string(),
|
|
15287
|
+
headers: external_exports.record(external_exports.string(), external_exports.string())
|
|
15288
|
+
});
|
|
15289
|
+
|
|
15260
15290
|
// ../../shared-contracts/dist/console.js
|
|
15261
15291
|
var consoleAnnouncementSchema = external_exports.strictObject({
|
|
15262
15292
|
title: external_exports.string().trim().min(1).max(200),
|
|
@@ -18329,8 +18359,8 @@ function historyUsageRequests(contents, historical) {
|
|
|
18329
18359
|
}
|
|
18330
18360
|
const requests = [];
|
|
18331
18361
|
let complete = true;
|
|
18332
|
-
for (const [
|
|
18333
|
-
const request = providerUsageRequest(
|
|
18362
|
+
for (const [requestId2, data] of usages) {
|
|
18363
|
+
const request = providerUsageRequest(requestId2, data, historical);
|
|
18334
18364
|
if (request)
|
|
18335
18365
|
requests.push(request);
|
|
18336
18366
|
else
|
|
@@ -18338,7 +18368,7 @@ function historyUsageRequests(contents, historical) {
|
|
|
18338
18368
|
}
|
|
18339
18369
|
return { requests, complete };
|
|
18340
18370
|
}
|
|
18341
|
-
function providerUsageRequest(
|
|
18371
|
+
function providerUsageRequest(requestId2, data, historical) {
|
|
18342
18372
|
const usage = record2(data.rawUsage);
|
|
18343
18373
|
const model2 = text(data.model) || text(data.requestModelId);
|
|
18344
18374
|
const input = usageCount(usage.prompt_tokens);
|
|
@@ -18352,7 +18382,7 @@ function providerUsageRequest(requestId, data, historical) {
|
|
|
18352
18382
|
}
|
|
18353
18383
|
try {
|
|
18354
18384
|
return parseHostUsageRequest({
|
|
18355
|
-
requestId,
|
|
18385
|
+
requestId: requestId2,
|
|
18356
18386
|
...historical ? { historical: true } : {},
|
|
18357
18387
|
model: model2,
|
|
18358
18388
|
inputTokens: input,
|
|
@@ -20414,8 +20444,8 @@ var ConnectionContext = class {
|
|
|
20414
20444
|
/**
|
|
20415
20445
|
* Sends a protocol-level request cancellation notification.
|
|
20416
20446
|
*/
|
|
20417
|
-
sendCancelRequest(
|
|
20418
|
-
return this.connection.sendCancelRequest(
|
|
20447
|
+
sendCancelRequest(requestId2) {
|
|
20448
|
+
return this.connection.sendCancelRequest(requestId2);
|
|
20419
20449
|
}
|
|
20420
20450
|
/**
|
|
20421
20451
|
* Registers a handler that can be disposed independently.
|
|
@@ -20600,8 +20630,8 @@ var Connection = class {
|
|
|
20600
20630
|
/**
|
|
20601
20631
|
* Sends a protocol-level request cancellation notification.
|
|
20602
20632
|
*/
|
|
20603
|
-
sendCancelRequest(
|
|
20604
|
-
return this.sendNotification(CANCEL_REQUEST_METHOD, { requestId });
|
|
20633
|
+
sendCancelRequest(requestId2) {
|
|
20634
|
+
return this.sendNotification(CANCEL_REQUEST_METHOD, { requestId: requestId2 });
|
|
20605
20635
|
}
|
|
20606
20636
|
/**
|
|
20607
20637
|
* Sends a JSON-RPC notification.
|
|
@@ -20909,15 +20939,15 @@ var Connection = class {
|
|
|
20909
20939
|
if (message.method !== CANCEL_REQUEST_METHOD) {
|
|
20910
20940
|
return;
|
|
20911
20941
|
}
|
|
20912
|
-
const
|
|
20913
|
-
if (
|
|
20942
|
+
const requestId2 = cancelRequestId(message.params);
|
|
20943
|
+
if (requestId2 === void 0) {
|
|
20914
20944
|
return;
|
|
20915
20945
|
}
|
|
20916
|
-
const controller = this.incomingRequests.get(
|
|
20946
|
+
const controller = this.incomingRequests.get(requestId2);
|
|
20917
20947
|
if (!controller || controller.signal.aborted) {
|
|
20918
20948
|
return;
|
|
20919
20949
|
}
|
|
20920
|
-
controller.abort(RequestError.requestCancelled({ requestId }));
|
|
20950
|
+
controller.abort(RequestError.requestCancelled({ requestId: requestId2 }));
|
|
20921
20951
|
}
|
|
20922
20952
|
closedReason() {
|
|
20923
20953
|
return this.abortController.signal.reason ?? new Error("ACP connection closed");
|
|
@@ -21383,12 +21413,12 @@ var AcpContext = class {
|
|
|
21383
21413
|
}
|
|
21384
21414
|
};
|
|
21385
21415
|
var AgentContext = class _AgentContext extends AcpContext {
|
|
21386
|
-
constructor(cx,
|
|
21387
|
-
super(cx,
|
|
21416
|
+
constructor(cx, requestId2) {
|
|
21417
|
+
super(cx, requestId2);
|
|
21388
21418
|
}
|
|
21389
21419
|
/** @internal */
|
|
21390
|
-
static create(cx,
|
|
21391
|
-
return new _AgentContext(cx,
|
|
21420
|
+
static create(cx, requestId2) {
|
|
21421
|
+
return new _AgentContext(cx, requestId2);
|
|
21392
21422
|
}
|
|
21393
21423
|
request(method, params, options) {
|
|
21394
21424
|
const spec = clientRequestSpecsByMethod[method];
|
|
@@ -21399,12 +21429,12 @@ var AgentContext = class _AgentContext extends AcpContext {
|
|
|
21399
21429
|
}
|
|
21400
21430
|
};
|
|
21401
21431
|
var ClientContext = class _ClientContext extends AcpContext {
|
|
21402
|
-
constructor(cx,
|
|
21403
|
-
super(cx,
|
|
21432
|
+
constructor(cx, requestId2) {
|
|
21433
|
+
super(cx, requestId2);
|
|
21404
21434
|
}
|
|
21405
21435
|
/** @internal */
|
|
21406
|
-
static create(cx,
|
|
21407
|
-
return new _ClientContext(cx,
|
|
21436
|
+
static create(cx, requestId2) {
|
|
21437
|
+
return new _ClientContext(cx, requestId2);
|
|
21408
21438
|
}
|
|
21409
21439
|
/** @internal */
|
|
21410
21440
|
[startActiveSession](params, options) {
|
|
@@ -21837,10 +21867,10 @@ var agentRequestSpecsByMethod = specsByMethod(agentRequestSpecs);
|
|
|
21837
21867
|
var agentNotificationSpecsByMethod = specsByMethod(agentNotificationSpecs);
|
|
21838
21868
|
var clientRequestSpecsByMethod = specsByMethod(clientRequestSpecs);
|
|
21839
21869
|
var clientNotificationSpecsByMethod = specsByMethod(clientNotificationSpecs);
|
|
21840
|
-
function agentRequestContext(params, client2, signal,
|
|
21870
|
+
function agentRequestContext(params, client2, signal, requestId2) {
|
|
21841
21871
|
return {
|
|
21842
21872
|
params,
|
|
21843
|
-
requestId,
|
|
21873
|
+
requestId: requestId2,
|
|
21844
21874
|
signal,
|
|
21845
21875
|
client: client2
|
|
21846
21876
|
};
|
|
@@ -21852,10 +21882,10 @@ function agentNotificationContext(params, client2, signal) {
|
|
|
21852
21882
|
client: client2
|
|
21853
21883
|
};
|
|
21854
21884
|
}
|
|
21855
|
-
function clientRequestContext(params, agent, signal,
|
|
21885
|
+
function clientRequestContext(params, agent, signal, requestId2) {
|
|
21856
21886
|
return {
|
|
21857
21887
|
params,
|
|
21858
|
-
requestId,
|
|
21888
|
+
requestId: requestId2,
|
|
21859
21889
|
signal,
|
|
21860
21890
|
agent
|
|
21861
21891
|
};
|
|
@@ -21980,7 +22010,7 @@ var AgentApp = class {
|
|
|
21980
22010
|
return this.notification(spec, handlerOrParams);
|
|
21981
22011
|
}
|
|
21982
22012
|
request(spec, handler) {
|
|
21983
|
-
registerAppRequest(this.builder, spec, (params, cx, signal,
|
|
22013
|
+
registerAppRequest(this.builder, spec, (params, cx, signal, requestId2) => agentRequestContext(params, AgentContext.create(cx, requestId2), signal, requestId2), handler);
|
|
21984
22014
|
return this;
|
|
21985
22015
|
}
|
|
21986
22016
|
notification(spec, handler) {
|
|
@@ -22080,7 +22110,7 @@ var ClientApp = class {
|
|
|
22080
22110
|
return this.notification(spec, handlerOrParams);
|
|
22081
22111
|
}
|
|
22082
22112
|
request(spec, handler) {
|
|
22083
|
-
registerAppRequest(this.builder, spec, (params, cx, signal,
|
|
22113
|
+
registerAppRequest(this.builder, spec, (params, cx, signal, requestId2) => clientRequestContext(params, ClientContext.create(cx, requestId2), signal, requestId2), handler);
|
|
22084
22114
|
return this;
|
|
22085
22115
|
}
|
|
22086
22116
|
notification(spec, handler) {
|
|
@@ -24238,8 +24268,8 @@ var CodeBuddyChildObserver = class {
|
|
|
24238
24268
|
}
|
|
24239
24269
|
return next;
|
|
24240
24270
|
}
|
|
24241
|
-
async locate(
|
|
24242
|
-
if (!
|
|
24271
|
+
async locate(requestId2) {
|
|
24272
|
+
if (!requestId2)
|
|
24243
24273
|
return void 0;
|
|
24244
24274
|
const directory = await this.#directory();
|
|
24245
24275
|
const files = (await readdir2(directory, { withFileTypes: true })).filter((entry) => entry.isFile() && /^agent-[\w-]+\.jsonl$/u.test(entry.name));
|
|
@@ -24249,7 +24279,7 @@ var CodeBuddyChildObserver = class {
|
|
|
24249
24279
|
for (const file2 of files) {
|
|
24250
24280
|
const id = file2.name.slice(0, -6), data = await this.#child(directory, id);
|
|
24251
24281
|
const first = data.entries.find((row) => row.type === "message" && row.role === "user");
|
|
24252
|
-
if (record2(first?.providerData).conversationRequestId ===
|
|
24282
|
+
if (record2(first?.providerData).conversationRequestId === requestId2)
|
|
24253
24283
|
matches.push(id);
|
|
24254
24284
|
}
|
|
24255
24285
|
if (matches.length > 1)
|
|
@@ -24334,9 +24364,9 @@ var CodeBuddySubagents = class {
|
|
|
24334
24364
|
if (parentCallId) {
|
|
24335
24365
|
const call2 = this.#calls.get(parentCallId);
|
|
24336
24366
|
if (call2 && !call2.observationDone) {
|
|
24337
|
-
const
|
|
24338
|
-
if (
|
|
24339
|
-
call2.requestId =
|
|
24367
|
+
const requestId2 = text(meta3["codebuddy.ai/conversationRequestId"]);
|
|
24368
|
+
if (requestId2)
|
|
24369
|
+
call2.requestId = requestId2;
|
|
24340
24370
|
const progress = update.sessionUpdate === "tool_call" && meta3["codebuddy.ai/toolArgumentsComplete"] ? text(update.title) : "";
|
|
24341
24371
|
if (progress)
|
|
24342
24372
|
this.#update(call2, { resultSummary: progress.slice(0, 2e3) });
|
|
@@ -14775,6 +14775,36 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
|
14775
14775
|
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
14776
14776
|
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
14777
14777
|
|
|
14778
|
+
// ../../shared-contracts/dist/realtime-call.js
|
|
14779
|
+
var REALTIME_CALL_FORWARDED_HEADERS = [
|
|
14780
|
+
"openai-alpha",
|
|
14781
|
+
"thread-id",
|
|
14782
|
+
"session-id",
|
|
14783
|
+
"originator",
|
|
14784
|
+
"x-codex-turn-metadata"
|
|
14785
|
+
];
|
|
14786
|
+
var FORWARDED_HEADERS = new Set(REALTIME_CALL_FORWARDED_HEADERS);
|
|
14787
|
+
var REALTIME_CALL_ID_PATTERN = /^rtc_[A-Za-z0-9_-]{1,128}$/u;
|
|
14788
|
+
var requestId = external_exports.string().min(1).max(128);
|
|
14789
|
+
var realtimeCallParamsSchema = external_exports.discriminatedUnion("operation", [
|
|
14790
|
+
external_exports.object({
|
|
14791
|
+
operation: external_exports.literal("create"),
|
|
14792
|
+
requestId,
|
|
14793
|
+
body: external_exports.string().min(1).max(16 << 20),
|
|
14794
|
+
headers: external_exports.record(external_exports.string(), external_exports.string()).default({})
|
|
14795
|
+
}),
|
|
14796
|
+
external_exports.object({ operation: external_exports.literal("cancel"), requestId }),
|
|
14797
|
+
external_exports.object({
|
|
14798
|
+
operation: external_exports.literal("hangup"),
|
|
14799
|
+
callId: external_exports.string().regex(REALTIME_CALL_ID_PATTERN)
|
|
14800
|
+
})
|
|
14801
|
+
]);
|
|
14802
|
+
var realtimeCallResponseSchema = external_exports.object({
|
|
14803
|
+
status: external_exports.number().int().min(200).max(599),
|
|
14804
|
+
body: external_exports.string(),
|
|
14805
|
+
headers: external_exports.record(external_exports.string(), external_exports.string())
|
|
14806
|
+
});
|
|
14807
|
+
|
|
14778
14808
|
// ../../shared-contracts/dist/console.js
|
|
14779
14809
|
var consoleAnnouncementSchema = external_exports.strictObject({
|
|
14780
14810
|
title: external_exports.string().trim().min(1).max(200),
|