@codexhost/cli-linux-arm64 0.18.0 → 0.20.0
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 +83 -5
- package/app/console-web.js +1172 -687
- package/app/desktop-controller.mjs +314 -15
- package/app/host-runtime.mjs +13158 -2853
- package/app/plugins/antigravity/plugin.mjs +8861 -3944
- package/app/plugins/claude-code/plugin.mjs +164 -14
- package/app/plugins/codebuddy/plugin.mjs +193 -25
- package/app/plugins/codex-usage/plugin.mjs +85 -5
- package/app/plugins/copilot/plugin.mjs +85 -5
- package/app/plugins/cursor-cli/plugin.mjs +160 -15
- package/app/plugins/deepseek-harness/manifest.json +2 -2
- package/app/plugins/deepseek-harness/plugin.mjs +112 -10
- package/app/plugins/devin/plugin.mjs +84 -5
- package/app/plugins/grok/plugin.mjs +418 -272
- package/app/plugins/hermes/plugin.mjs +163 -17
- package/app/plugins/kimi-code/plugin.mjs +85 -5
- package/app/plugins/kiro-cli/plugin.mjs +313 -21
- package/app/plugins/omp/plugin.mjs +1018 -819
- package/app/plugins/opencode/plugin.mjs +85 -5
- package/app/plugins/pi/plugin.mjs +828 -663
- package/app/plugins/qoder/plugin.mjs +109 -10
- package/app/plugins/qoder-cn/plugin.mjs +109 -10
- package/app/plugins/qwen-code/plugin.mjs +194 -97
- package/app/plugins/workbuddy/plugin.mjs +197 -28
- package/app/plugins/zcode/plugin.mjs +158 -8
- package/app/renderer-extension.js +2065 -1004
- package/app/web/assets/index-D6-hvggd.css +1 -0
- package/app/web/assets/index-D85gPBbQ.js +201 -0
- package/app/web/assets/langs/{graphql-B8vkg11W.js → graphql-ChAeyPkT.js} +1 -1
- package/app/web/assets/langs/{http-DmoDEjMt.js → http-BvreBIbD.js} +1 -1
- package/app/web/assets/langs/{php-DJ5ovfAM.js → php-D8omCIuJ.js} +1 -1
- package/app/web/assets/langs/{rst-U5-R5x3p.js → rst-Do7RLLCS.js} +1 -1
- package/app/web/assets/langs/{ruby-VKVsnS0H.js → ruby-rH_O_vse.js} +1 -1
- package/app/web/assets/langs/{svelte-C20lOv9V.js → svelte-xZy73wAj.js} +1 -1
- package/app/web/assets/langs/{vue-z6Y-lzP-.js → vue-C4DW8agZ.js} +1 -1
- package/app/web/assets/{vendor-dSL872WO.js → vendor-C9g2bw8s.js} +3 -3
- package/app/web/codexhost-settings.js +1178 -689
- package/app/web/index.html +4 -3
- package/app/web/plugins/deepseek-ai__dsh-api-gateway/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +8 -8
- package/app/web/plugins/deepseek-ai__dsh-client-connection/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-file-upload/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-locale/client.js +3 -3
- package/app/web/plugins/deepseek-ai__dsh-client-ui-attachment/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +134 -8
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +65 -63
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +95 -93
- package/app/web/plugins/deepseek-ai__dsh-client-ui-input-trigger/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-model-selection/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-session/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-documentpreview/client.excel.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-files/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
- package/app/web/plugins/deepseek-ai__dsh-client-ui-user-questions/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +11 -11
- package/app/web-modules/server.mjs +2468 -1575
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
- package/app/web/assets/index-C0aXz2jD.js +0 -199
- package/app/web/assets/index-C3lniEH1.css +0 -1
|
@@ -327,15 +327,58 @@ async function rendererRemoteSession(target2, operation) {
|
|
|
327
327
|
return ids.map((hostId2) => ({ hostId: hostId2, online: !!routing.forHost(hostId2) }));
|
|
328
328
|
const configured = await api.remoteConnections({ action: "catalog" });
|
|
329
329
|
const connections = Array.isArray(configured) ? configured : [];
|
|
330
|
-
const
|
|
330
|
+
const previous = state.reconnectAttempts;
|
|
331
|
+
const attempts = state.reconnectAttempts = previous && !("get" in previous) ? new Map([...previous].map((id) => [id, { failures: 0, retryAt: Infinity }])) : previous ?? /* @__PURE__ */ new Map();
|
|
331
332
|
return Promise.all(
|
|
332
333
|
[.../* @__PURE__ */ new Set([...ids, ...connections.map((c) => c.hostId)])].map(async (hostId2) => {
|
|
333
334
|
const connection = connections.find((c) => c.hostId === hostId2);
|
|
334
335
|
let status = await api.remoteConnections({ action: "state", hostId: hostId2 }).catch(() => ({ state: "error" }));
|
|
335
|
-
if (connection?.autoConnect === false
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
336
|
+
if (connection?.autoConnect === false || status.state === "connected")
|
|
337
|
+
attempts.delete(hostId2);
|
|
338
|
+
if (connection?.autoConnect && status.state === "disconnected") {
|
|
339
|
+
let attempt = attempts.get(hostId2);
|
|
340
|
+
if (!attempt || !attempt.loading && Date.now() >= attempt.retryAt) {
|
|
341
|
+
attempt ??= { failures: 0, retryAt: Infinity };
|
|
342
|
+
const current = attempt;
|
|
343
|
+
current.retryAt = Infinity;
|
|
344
|
+
attempts.set(hostId2, current);
|
|
345
|
+
current.loading = Promise.resolve().then(async () => {
|
|
346
|
+
try {
|
|
347
|
+
const latestStatus = await api.remoteConnections({ action: "state", hostId: hostId2 });
|
|
348
|
+
const latest = await api.remoteConnections({ action: "catalog" });
|
|
349
|
+
if (attempts.get(hostId2) !== current || !Array.isArray(latest) || !latest.some((c) => c.hostId === hostId2 && c.autoConnect === true) || latestStatus.state !== "disconnected") {
|
|
350
|
+
if (attempts.get(hostId2) === current) attempts.delete(hostId2);
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
let acknowledged = false;
|
|
354
|
+
let failureCode;
|
|
355
|
+
try {
|
|
356
|
+
await api.remoteConnections({ action: "connect", hostId: hostId2, enabled: true });
|
|
357
|
+
acknowledged = true;
|
|
358
|
+
} catch (error51) {
|
|
359
|
+
failureCode = error51?.code;
|
|
360
|
+
}
|
|
361
|
+
const result = await api.remoteConnections({ action: "state", hostId: hostId2 });
|
|
362
|
+
const failed = acknowledged || [
|
|
363
|
+
"ECONNREFUSED",
|
|
364
|
+
"ECONNRESET",
|
|
365
|
+
"ENETUNREACH",
|
|
366
|
+
"EHOSTUNREACH",
|
|
367
|
+
"ENOTFOUND",
|
|
368
|
+
"EAI_AGAIN"
|
|
369
|
+
].includes(String(failureCode));
|
|
370
|
+
if (failed && result.state === "disconnected" && result.error) {
|
|
371
|
+
current.failures = Math.min(current.failures + 1, 4);
|
|
372
|
+
current.retryAt = Date.now() + Math.min(3e4, 5e3 * 2 ** (current.failures - 1));
|
|
373
|
+
}
|
|
374
|
+
} catch {
|
|
375
|
+
} finally {
|
|
376
|
+
delete current.loading;
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
attempt = current;
|
|
380
|
+
}
|
|
381
|
+
await attempt.loading;
|
|
339
382
|
status = await api.remoteConnections({ action: "state", hostId: hostId2 }).catch(() => ({ state: "error" }));
|
|
340
383
|
}
|
|
341
384
|
return {
|
|
@@ -373,12 +416,128 @@ async function rendererRemoteSession(target2, operation) {
|
|
|
373
416
|
return Array.isArray(conversation?.requests) ? conversation.requests : [];
|
|
374
417
|
};
|
|
375
418
|
if (operation.kind === "read") {
|
|
376
|
-
|
|
419
|
+
let result = await manager.sendRequest("thread/read", { threadId, includeTurns: false });
|
|
420
|
+
if (routing.forHost(operation.hostId) !== route)
|
|
421
|
+
throw new Error("Remote connection changed during read");
|
|
422
|
+
const header = result;
|
|
423
|
+
if (header.thread?.historyMode === "paginated") {
|
|
424
|
+
const turns = [], cursors = /* @__PURE__ */ new Set();
|
|
425
|
+
let cursor = null, bytes = 0, complete = false;
|
|
426
|
+
for (let page = 0; page < 100; page++) {
|
|
427
|
+
if (routing.forHost(operation.hostId) !== route)
|
|
428
|
+
throw new Error("Remote connection changed during read");
|
|
429
|
+
const response = await manager.sendRequest("thread/turns/list", {
|
|
430
|
+
threadId,
|
|
431
|
+
cursor,
|
|
432
|
+
limit: 50,
|
|
433
|
+
sortDirection: "asc",
|
|
434
|
+
itemsView: "full"
|
|
435
|
+
});
|
|
436
|
+
if (!Array.isArray(response.data) || response.nextCursor !== null && typeof response.nextCursor !== "string")
|
|
437
|
+
throw new Error("Invalid remote history page");
|
|
438
|
+
bytes += new TextEncoder().encode(JSON.stringify(response.data)).byteLength;
|
|
439
|
+
if (bytes > 14 * 1024 * 1024) throw new Error("Remote history exceeds the snapshot limit");
|
|
440
|
+
turns.push(...response.data);
|
|
441
|
+
cursor = response.nextCursor;
|
|
442
|
+
if (cursor === null) {
|
|
443
|
+
complete = true;
|
|
444
|
+
break;
|
|
445
|
+
}
|
|
446
|
+
if (cursors.has(cursor)) throw new Error("Remote history cursor repeated");
|
|
447
|
+
cursors.add(cursor);
|
|
448
|
+
}
|
|
449
|
+
if (!complete) throw new Error("Remote history exceeds the page limit");
|
|
450
|
+
result = { ...result, thread: { ...header.thread, turns } };
|
|
451
|
+
} else result = await manager.sendRequest("thread/read", { threadId, includeTurns: true });
|
|
452
|
+
if (routing.forHost(operation.hostId) !== route)
|
|
453
|
+
throw new Error("Remote connection changed during read");
|
|
454
|
+
let metadata = {};
|
|
455
|
+
if (header.thread) {
|
|
456
|
+
const cwd = header.thread.cwd;
|
|
457
|
+
try {
|
|
458
|
+
const configuration = await manager.sendRequest("codexhost/thread/inspect", {
|
|
459
|
+
threadId
|
|
460
|
+
});
|
|
461
|
+
if (routing.forHost(operation.hostId) !== route)
|
|
462
|
+
throw new Error("Remote connection changed during read");
|
|
463
|
+
metadata = {
|
|
464
|
+
configuration,
|
|
465
|
+
...configuration.owner === "codex" ? {
|
|
466
|
+
nativeSettings: {
|
|
467
|
+
model: header.thread.model,
|
|
468
|
+
reasoningEffort: header.thread.reasoningEffort,
|
|
469
|
+
serviceTier: header.thread.serviceTier
|
|
470
|
+
}
|
|
471
|
+
} : {}
|
|
472
|
+
};
|
|
473
|
+
if (configuration.owner === "codex" && manager.getConversation) {
|
|
474
|
+
const conversation = await Promise.resolve().then(() => manager.getConversation?.(threadId)).catch(() => void 0);
|
|
475
|
+
if (routing.forHost(operation.hostId) !== route)
|
|
476
|
+
throw new Error("Remote connection changed during read");
|
|
477
|
+
const settings = conversation?.latestThreadSettings;
|
|
478
|
+
if (settings?.model === header.thread.model && typeof settings?.model === "string")
|
|
479
|
+
metadata.nativeSettings = {
|
|
480
|
+
model: settings.model,
|
|
481
|
+
reasoningEffort: header.thread.reasoningEffort === void 0 ? settings.effort : header.thread.reasoningEffort,
|
|
482
|
+
serviceTier: header.thread.serviceTier === void 0 ? settings.serviceTier : header.thread.serviceTier
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
if (configuration.owner === "codex" || configuration.owner === "external" && configuration.harnessId) {
|
|
486
|
+
const harnessId = configuration.owner === "codex" ? "codex" : configuration.harnessId ?? "codex", key = JSON.stringify([harnessId, cwd]);
|
|
487
|
+
const cache = generation.metadata ??= /* @__PURE__ */ new Map();
|
|
488
|
+
let discovery = cache.get(key);
|
|
489
|
+
if (!discovery || Date.now() >= discovery.retryAt) {
|
|
490
|
+
const loading = Promise.all([
|
|
491
|
+
Promise.resolve().then(() => {
|
|
492
|
+
if (routing.forHost(operation.hostId) !== route)
|
|
493
|
+
throw new Error("Remote connection changed during read");
|
|
494
|
+
return manager.sendRequest("codexhost/harness/inspect", {
|
|
495
|
+
harnessId,
|
|
496
|
+
...cwd ? { cwd } : {}
|
|
497
|
+
});
|
|
498
|
+
}),
|
|
499
|
+
Promise.resolve().then(() => {
|
|
500
|
+
if (routing.forHost(operation.hostId) !== route)
|
|
501
|
+
throw new Error("Remote connection changed during read");
|
|
502
|
+
return manager.sendRequest("codexhost/harness/plugins/list", {});
|
|
503
|
+
}).catch(() => null)
|
|
504
|
+
]).then(([inspection, catalog]) => {
|
|
505
|
+
if (inspection?.status !== "ready")
|
|
506
|
+
throw new Error("Remote Harness discovery is unavailable");
|
|
507
|
+
return {
|
|
508
|
+
inspection,
|
|
509
|
+
harness: catalog?.plugins?.find(
|
|
510
|
+
(p) => p.id === harnessId
|
|
511
|
+
)
|
|
512
|
+
};
|
|
513
|
+
});
|
|
514
|
+
const attempt = {
|
|
515
|
+
loading,
|
|
516
|
+
failures: discovery?.failures ?? 0,
|
|
517
|
+
retryAt: Infinity
|
|
518
|
+
};
|
|
519
|
+
void loading.catch(() => {
|
|
520
|
+
attempt.failures = Math.min(attempt.failures + 1, 4);
|
|
521
|
+
attempt.retryAt = Date.now() + Math.min(3e4, 5e3 * 2 ** (attempt.failures - 1));
|
|
522
|
+
});
|
|
523
|
+
discovery = attempt;
|
|
524
|
+
if (cache.size >= 64 && !cache.has(key)) {
|
|
525
|
+
const oldest = cache.keys().next().value;
|
|
526
|
+
if (oldest !== void 0) cache.delete(oldest);
|
|
527
|
+
}
|
|
528
|
+
cache.set(key, discovery);
|
|
529
|
+
}
|
|
530
|
+
metadata = { ...metadata, ...await discovery.loading };
|
|
531
|
+
}
|
|
532
|
+
} catch {
|
|
533
|
+
}
|
|
534
|
+
}
|
|
377
535
|
if (routing.forHost(operation.hostId) !== route)
|
|
378
536
|
throw new Error("Remote connection changed during read");
|
|
379
537
|
const requests = await pendingRequests();
|
|
380
538
|
return {
|
|
381
539
|
result,
|
|
540
|
+
...metadata,
|
|
382
541
|
epoch: generation.epoch,
|
|
383
542
|
interactionsAvailable: !!manager.getConversation && !!manager.replyWithCommandExecutionApprovalDecision && !!manager.replyWithFileChangeApprovalDecision,
|
|
384
543
|
requests: requests.filter(
|
|
@@ -403,6 +562,34 @@ async function rendererRemoteSession(target2, operation) {
|
|
|
403
562
|
return { accepted: true };
|
|
404
563
|
}
|
|
405
564
|
switch (operation.kind) {
|
|
565
|
+
case "configure": {
|
|
566
|
+
const configuration = await manager.sendRequest("codexhost/thread/inspect", {
|
|
567
|
+
threadId
|
|
568
|
+
});
|
|
569
|
+
if (routing.forHost(operation.hostId) !== route)
|
|
570
|
+
throw new Error("Remote connection changed during configuration");
|
|
571
|
+
if (configuration.owner !== "external" && configuration.owner !== "codex")
|
|
572
|
+
throw new Error("Remote Thread configuration is unavailable");
|
|
573
|
+
let method, params;
|
|
574
|
+
if (operation.modelId !== void 0) {
|
|
575
|
+
method = "codexhost/thread/model/select";
|
|
576
|
+
params = { threadId, model: { id: operation.modelId } };
|
|
577
|
+
} else if (operation.thinkingOptionId !== void 0) {
|
|
578
|
+
method = "codexhost/thread/thinking/select";
|
|
579
|
+
params = { threadId, thinkingOptionId: operation.thinkingOptionId };
|
|
580
|
+
} else {
|
|
581
|
+
method = "codexhost/thread/permission-mode/select";
|
|
582
|
+
params = { threadId, permissionModeId: operation.permissionModeId };
|
|
583
|
+
}
|
|
584
|
+
try {
|
|
585
|
+
const result = await manager.sendRequest(method, params);
|
|
586
|
+
if (routing.forHost(operation.hostId) !== route)
|
|
587
|
+
throw new Error("Remote connection changed during configuration");
|
|
588
|
+
return result;
|
|
589
|
+
} finally {
|
|
590
|
+
generation.metadata?.clear();
|
|
591
|
+
}
|
|
592
|
+
}
|
|
406
593
|
case "prompt":
|
|
407
594
|
await manager.sendRequest("thread/resume", { threadId });
|
|
408
595
|
if (routing.forHost(operation.hostId) !== route)
|
|
@@ -15074,13 +15261,25 @@ var threadPermissionModeSelectParamsSchema = external_exports.object({
|
|
|
15074
15261
|
var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
|
|
15075
15262
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
15076
15263
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15264
|
+
var usageOutputTimingSchema = external_exports.object({
|
|
15265
|
+
version: external_exports.literal(3).optional(),
|
|
15266
|
+
requestId: external_exports.string().min(1),
|
|
15267
|
+
turnId: external_exports.string().min(1).max(1024),
|
|
15268
|
+
outputTokens: nonNegativeSafeIntegerSchema,
|
|
15269
|
+
startedAtMs: nonNegativeSafeIntegerSchema,
|
|
15270
|
+
completedAtMs: nonNegativeSafeIntegerSchema
|
|
15271
|
+
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
15077
15272
|
var usageMeasurementSchema = external_exports.object({
|
|
15273
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
15078
15274
|
value: finiteNonNegativeNumberSchema,
|
|
15079
15275
|
turnId: external_exports.string().min(1).max(1024),
|
|
15080
15276
|
at: nonNegativeSafeIntegerSchema
|
|
15081
15277
|
}).strict();
|
|
15082
15278
|
var usageMeasurementsSchema = external_exports.object({
|
|
15083
|
-
|
|
15279
|
+
// Unversioned intervals can omit hidden thinking time; do not restore them into averages.
|
|
15280
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 3)).optional(),
|
|
15281
|
+
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
15282
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 3).optional().catch(void 0),
|
|
15084
15283
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
15085
15284
|
}).strict();
|
|
15086
15285
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
@@ -15100,6 +15299,7 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
15100
15299
|
cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15101
15300
|
outputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15102
15301
|
outputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
15302
|
+
sessionOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
15103
15303
|
apiOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
15104
15304
|
reasoningOutputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15105
15305
|
totalTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
@@ -15511,11 +15711,19 @@ var threadSteeringInspectResultSchema = external_exports.object({
|
|
|
15511
15711
|
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
15512
15712
|
}).strict();
|
|
15513
15713
|
|
|
15714
|
+
// packages/shared-contracts/dist/thread-archive-confirm.js
|
|
15715
|
+
var threadArchiveConfirmParamsSchema = external_exports.object({ threadId: hostThreadIdSchema }).strict();
|
|
15716
|
+
var threadArchiveConfirmResultSchema = external_exports.object({ confirmed: external_exports.boolean() }).strict();
|
|
15717
|
+
|
|
15514
15718
|
// packages/shared-contracts/dist/client-channel.js
|
|
15515
15719
|
var CLIENT_CHANNEL_VERSION = 1;
|
|
15516
15720
|
var CLIENT_REQUEST_LIMIT_BYTES = 128 * 1024 * 1024;
|
|
15517
15721
|
var clientThreadPinsSchema = external_exports.object({ threadIds: external_exports.array(external_exports.string().min(1)) }).strict();
|
|
15518
15722
|
var clientThreadPinParamsSchema = external_exports.object({ threadId: external_exports.string().min(1).max(1024), pinned: external_exports.boolean() }).strict();
|
|
15723
|
+
var clientThreadTreeReadParamsSchema = external_exports.object({}).strict();
|
|
15724
|
+
var clientThreadTreeSchema = external_exports.object({
|
|
15725
|
+
parents: external_exports.record(external_exports.string().min(1), external_exports.string().min(1))
|
|
15726
|
+
}).strict();
|
|
15519
15727
|
var clientProjectlessWorkspaceSchema = external_exports.object({
|
|
15520
15728
|
prompt: external_exports.string().max(16384).optional()
|
|
15521
15729
|
}).strict();
|
|
@@ -15532,6 +15740,11 @@ var clientChannelCursorSchema = external_exports.object({
|
|
|
15532
15740
|
sequence: external_exports.number().int().nonnegative()
|
|
15533
15741
|
});
|
|
15534
15742
|
var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
15743
|
+
external_exports.object({
|
|
15744
|
+
type: external_exports.literal("skills-changed"),
|
|
15745
|
+
cursor: clientChannelCursorSchema,
|
|
15746
|
+
cwd: external_exports.string().optional()
|
|
15747
|
+
}),
|
|
15535
15748
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
15536
15749
|
external_exports.object({
|
|
15537
15750
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -15641,7 +15854,12 @@ var clientThreadSnapshotSchema = external_exports.object({
|
|
|
15641
15854
|
/** Current interruptible Host Turn, including command Turns omitted from client history. */
|
|
15642
15855
|
activeTurnId: external_exports.string().min(1).nullable().optional(),
|
|
15643
15856
|
/** Most recent explicit command in this Host process; not native conversation history. */
|
|
15644
|
-
command: external_exports.object({
|
|
15857
|
+
command: external_exports.object({
|
|
15858
|
+
name: external_exports.string().min(1),
|
|
15859
|
+
turn: clientTurnSchema,
|
|
15860
|
+
/** First ordinary Turn started after this command; its retained result is not a new event. */
|
|
15861
|
+
subsequentTurnId: external_exports.string().min(1).optional()
|
|
15862
|
+
}).optional(),
|
|
15645
15863
|
thread: external_exports.object({
|
|
15646
15864
|
id: external_exports.string().min(1),
|
|
15647
15865
|
cwd: external_exports.string(),
|
|
@@ -15729,6 +15947,28 @@ var voiceTranscribeResultSchema = external_exports.discriminatedUnion("ok", [
|
|
|
15729
15947
|
external_exports.object({ ok: external_exports.literal(false), error: external_exports.object({ code: voiceErrorCodeSchema }).strict() }).strict()
|
|
15730
15948
|
]);
|
|
15731
15949
|
|
|
15950
|
+
// packages/shared-contracts/dist/skills.js
|
|
15951
|
+
var skillsListParamsSchema = external_exports.object({
|
|
15952
|
+
threadId: hostThreadIdSchema.optional(),
|
|
15953
|
+
cwd: external_exports.string().min(1).optional()
|
|
15954
|
+
}).strict().refine((params) => !(params.threadId && params.cwd), {
|
|
15955
|
+
message: "Specify threadId or cwd, not both"
|
|
15956
|
+
});
|
|
15957
|
+
var librarySkillSchema = external_exports.object({
|
|
15958
|
+
name: external_exports.string().min(1).regex(/^[^\s[\]]+$/u),
|
|
15959
|
+
description: external_exports.string().optional(),
|
|
15960
|
+
path: external_exports.string().min(1),
|
|
15961
|
+
scope: external_exports.enum(["project", "global"]),
|
|
15962
|
+
source: external_exports.string().min(1)
|
|
15963
|
+
}).strict();
|
|
15964
|
+
var skillsListResultSchema = external_exports.object({
|
|
15965
|
+
revision: external_exports.number().int().nonnegative(),
|
|
15966
|
+
complete: external_exports.boolean(),
|
|
15967
|
+
skills: external_exports.array(librarySkillSchema),
|
|
15968
|
+
warnings: external_exports.array(external_exports.string()).optional()
|
|
15969
|
+
}).strict();
|
|
15970
|
+
var skillsChangedParamsSchema = external_exports.object({ cwd: external_exports.string().min(1).optional() }).strict();
|
|
15971
|
+
|
|
15732
15972
|
// packages/shared-contracts/dist/web-access-tokens.js
|
|
15733
15973
|
var webNetworkAccessUrlSchema = external_exports.object({
|
|
15734
15974
|
/**
|
|
@@ -15827,7 +16067,6 @@ var webAccessStateSchema = external_exports.object({
|
|
|
15827
16067
|
quotaUntil: external_exports.string().optional()
|
|
15828
16068
|
}).strict().optional()
|
|
15829
16069
|
}).strict();
|
|
15830
|
-
var webLocalAccessRequiredDetailsSchema = external_exports.object({ url: external_exports.string() }).strict();
|
|
15831
16070
|
|
|
15832
16071
|
// packages/shared-contracts/dist/delegation-read.js
|
|
15833
16072
|
var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
|
|
@@ -15835,8 +16074,8 @@ var REMOTE_THREAD_CONTROL_TIMEOUT_MS = 4e4;
|
|
|
15835
16074
|
var delegationReadParamsSchema = external_exports.strictObject({
|
|
15836
16075
|
threadId: external_exports.string().min(1).max(1024),
|
|
15837
16076
|
view: external_exports.enum(["result", "messages"]),
|
|
15838
|
-
|
|
15839
|
-
|
|
16077
|
+
from: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional(),
|
|
16078
|
+
to: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional()
|
|
15840
16079
|
});
|
|
15841
16080
|
|
|
15842
16081
|
// packages/shared-contracts/dist/credential-imports.js
|
|
@@ -16784,6 +17023,17 @@ var updateStatusResultSchema = external_exports.strictObject({
|
|
|
16784
17023
|
status: updateStatusSchema.nullable()
|
|
16785
17024
|
});
|
|
16786
17025
|
|
|
17026
|
+
// packages/shared-contracts/dist/thread-watch-notice.js
|
|
17027
|
+
var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
17028
|
+
"completed",
|
|
17029
|
+
"failed",
|
|
17030
|
+
"interrupted",
|
|
17031
|
+
"timedOut",
|
|
17032
|
+
"unreadable",
|
|
17033
|
+
"notFound"
|
|
17034
|
+
];
|
|
17035
|
+
var ENTRY_PATTERN = new RegExp(String.raw`^- \[([^\]\n]+)\]\(thread://([^\s()<>"?#/]+)\): ` + `(${THREAD_WATCH_NOTICE_OUTCOMES.join("|")})(?:. (.+))?$`, "u");
|
|
17036
|
+
|
|
16787
17037
|
// packages/shared-contracts/dist/remote-runtime.js
|
|
16788
17038
|
var remoteUpdatePhaseSchema = external_exports.enum([
|
|
16789
17039
|
"idle",
|
|
@@ -16831,6 +17081,14 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
|
16831
17081
|
archived: external_exports.boolean()
|
|
16832
17082
|
}),
|
|
16833
17083
|
external_exports.strictObject({ kind: external_exports.literal("read"), ...thread }),
|
|
17084
|
+
external_exports.strictObject({
|
|
17085
|
+
kind: external_exports.literal("configure"),
|
|
17086
|
+
...thread,
|
|
17087
|
+
epoch: identity,
|
|
17088
|
+
modelId: identity.optional(),
|
|
17089
|
+
thinkingOptionId: identity.optional(),
|
|
17090
|
+
permissionModeId: identity.optional()
|
|
17091
|
+
}).refine((value) => [value.modelId, value.thinkingOptionId, value.permissionModeId].filter((v) => v !== void 0).length === 1, "Select exactly one remote setting"),
|
|
16834
17092
|
external_exports.strictObject({
|
|
16835
17093
|
kind: external_exports.literal("prompt"),
|
|
16836
17094
|
...thread,
|
|
@@ -16903,6 +17161,13 @@ var remoteConnectionsReplySchema = external_exports.union([
|
|
|
16903
17161
|
external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
|
|
16904
17162
|
]);
|
|
16905
17163
|
|
|
17164
|
+
// packages/shared-contracts/dist/thread-title.js
|
|
17165
|
+
var threadTitleInputSchema = external_exports.strictObject({
|
|
17166
|
+
prompt: external_exports.string().trim().min(1).max(2e3),
|
|
17167
|
+
cwd: external_exports.string().max(4096).nullable()
|
|
17168
|
+
});
|
|
17169
|
+
var threadTitleResultSchema = external_exports.string().trim().min(1).max(60).nullable();
|
|
17170
|
+
|
|
16906
17171
|
// packages/shared-contracts/dist/web-ui-extensions.js
|
|
16907
17172
|
var webUiExtensionIdSchema = external_exports.string().max(214).regex(/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u);
|
|
16908
17173
|
var localizedTextSchema2 = external_exports.union([
|
|
@@ -18470,8 +18735,9 @@ function installRendererHostRpcRouting(root, target2, dependencies) {
|
|
|
18470
18735
|
model2 = carrier ? prewarmCarrier(carrier) : null;
|
|
18471
18736
|
}
|
|
18472
18737
|
if (!model2) return message;
|
|
18473
|
-
if (path3[0] === "startConversation" && nativeModel?.startsWith("codexhost/")
|
|
18474
|
-
|
|
18738
|
+
if (path3[0] === "startConversation" && nativeModel?.startsWith("codexhost/"))
|
|
18739
|
+
model2 = nativeModel;
|
|
18740
|
+
const config2 = input.config == null ? { model: model2 } : isRecord3(input.config) ? { model: model2, ...input.config } : input.config;
|
|
18475
18741
|
return [
|
|
18476
18742
|
"push",
|
|
18477
18743
|
[
|
|
@@ -18481,6 +18747,7 @@ function installRendererHostRpcRouting(root, target2, dependencies) {
|
|
|
18481
18747
|
[
|
|
18482
18748
|
{
|
|
18483
18749
|
...input,
|
|
18750
|
+
...path3[0] === "startConversation" ? { config: config2 } : {},
|
|
18484
18751
|
collaborationMode: { ...input.collaborationMode, settings: { ...settings, model: model2 } }
|
|
18485
18752
|
},
|
|
18486
18753
|
...args.slice(1)
|
|
@@ -20142,6 +20409,21 @@ var TRANSIENT_INSTALL_ATTEMPTS = 3;
|
|
|
20142
20409
|
var TRANSIENT_INSTALL_RETRY_MS = 250;
|
|
20143
20410
|
var RECOVERY_RETRY_INITIAL_MS = 3e4;
|
|
20144
20411
|
var RECOVERY_RETRY_MAX_MS = 3e5;
|
|
20412
|
+
var REMOTE_CONNECTION_RECOVERY_INTERVAL_MS = 5e3;
|
|
20413
|
+
var SHUTDOWN_OPERATION_WAIT_MS = 3e3;
|
|
20414
|
+
async function settleWithin(promise2, milliseconds) {
|
|
20415
|
+
let timer;
|
|
20416
|
+
try {
|
|
20417
|
+
await Promise.race([
|
|
20418
|
+
promise2,
|
|
20419
|
+
new Promise((resolve) => {
|
|
20420
|
+
timer = setTimeout(resolve, milliseconds);
|
|
20421
|
+
})
|
|
20422
|
+
]);
|
|
20423
|
+
} finally {
|
|
20424
|
+
clearTimeout(timer);
|
|
20425
|
+
}
|
|
20426
|
+
}
|
|
20145
20427
|
var startupTraceStartedAt = Date.now();
|
|
20146
20428
|
function startupTrace(stage, detail) {
|
|
20147
20429
|
if (process.env.CODEXHOST_STARTUP_TRACE !== "1") return;
|
|
@@ -20315,6 +20597,21 @@ ${rendererSource}`,
|
|
|
20315
20597
|
);
|
|
20316
20598
|
return next;
|
|
20317
20599
|
};
|
|
20600
|
+
let remoteRecovery;
|
|
20601
|
+
let nextRemoteRecoveryAt = 0;
|
|
20602
|
+
const restoreRemoteConnections = (current) => {
|
|
20603
|
+
if (signal.aborted || remoteRecovery || now() < nextRemoteRecoveryAt) return;
|
|
20604
|
+
nextRemoteRecoveryAt = now() + REMOTE_CONNECTION_RECOVERY_INTERVAL_MS;
|
|
20605
|
+
remoteRecovery = Promise.resolve().then(() => {
|
|
20606
|
+
if (!signal.aborted && session === current)
|
|
20607
|
+
return current.executeRenderer(
|
|
20608
|
+
remoteConnectionsExpression({ action: "session", operation: { kind: "hosts" } })
|
|
20609
|
+
);
|
|
20610
|
+
return void 0;
|
|
20611
|
+
}).catch(() => void 0).finally(() => {
|
|
20612
|
+
remoteRecovery = void 0;
|
|
20613
|
+
});
|
|
20614
|
+
};
|
|
20318
20615
|
const resetSession = () => {
|
|
20319
20616
|
session?.close();
|
|
20320
20617
|
session = void 0;
|
|
@@ -20369,6 +20666,7 @@ ${rendererSource}`,
|
|
|
20369
20666
|
try {
|
|
20370
20667
|
session = await createSession();
|
|
20371
20668
|
recordRecoverySuccess();
|
|
20669
|
+
restoreRemoteConnections(session);
|
|
20372
20670
|
} catch (error51) {
|
|
20373
20671
|
startupTrace("initial Renderer Session unavailable", error51);
|
|
20374
20672
|
session = void 0;
|
|
@@ -20381,15 +20679,16 @@ ${rendererSource}`,
|
|
|
20381
20679
|
await useSession(async () => {
|
|
20382
20680
|
if (!session && now() < nextRecoveryAt) return;
|
|
20383
20681
|
try {
|
|
20384
|
-
await recoverSession();
|
|
20682
|
+
restoreRemoteConnections(await recoverSession());
|
|
20385
20683
|
} catch {
|
|
20386
20684
|
}
|
|
20387
20685
|
});
|
|
20388
20686
|
}
|
|
20389
20687
|
} finally {
|
|
20390
20688
|
await attachmentServer?.close();
|
|
20391
|
-
await operation;
|
|
20689
|
+
await settleWithin(operation, SHUTDOWN_OPERATION_WAIT_MS);
|
|
20392
20690
|
resetSession();
|
|
20691
|
+
void operation.then(resetSession);
|
|
20393
20692
|
}
|
|
20394
20693
|
}
|
|
20395
20694
|
|