@codexhost/cli-linux-arm64 0.14.0 → 0.16.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 +55 -7
- package/app/console-web.js +281 -79
- package/app/desktop-controller.mjs +155 -22
- package/app/host-runtime.mjs +548 -148
- package/app/plugins/antigravity/plugin.mjs +342 -53
- package/app/plugins/claude-code/plugin.mjs +393 -162
- package/app/plugins/codebuddy/plugin.mjs +245 -49
- package/app/plugins/codex-usage/plugin.mjs +75 -28
- package/app/plugins/copilot/plugin.mjs +100 -53
- package/app/plugins/cursor-cli/plugin.mjs +207 -46
- package/app/plugins/deepseek-harness/plugin.mjs +103 -36
- package/app/plugins/grok/plugin.mjs +354 -84
- package/app/plugins/hermes/plugin.mjs +50 -3
- package/app/plugins/kimi-code/plugin.mjs +62 -15
- package/app/plugins/kiro-cli/plugin.mjs +62 -15
- package/app/plugins/omp/plugin.mjs +82 -35
- package/app/plugins/opencode/plugin.mjs +104 -57
- package/app/plugins/pi/plugin.mjs +134 -50
- package/app/plugins/qoder/plugin.mjs +72 -25
- package/app/plugins/qoder-cn/plugin.mjs +72 -25
- package/app/plugins/workbuddy/plugin.mjs +245 -49
- package/app/plugins/zcode/plugin.mjs +101 -29
- package/app/renderer-extension.js +2353 -344
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
|
@@ -3308,10 +3308,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3308
3308
|
const shape = def.shape;
|
|
3309
3309
|
const propValues = {};
|
|
3310
3310
|
for (const key in shape) {
|
|
3311
|
-
const
|
|
3312
|
-
if (
|
|
3311
|
+
const field2 = shape[key]._zod;
|
|
3312
|
+
if (field2.values) {
|
|
3313
3313
|
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
3314
|
-
for (const v of
|
|
3314
|
+
for (const v of field2.values)
|
|
3315
3315
|
propValues[key].add(v);
|
|
3316
3316
|
}
|
|
3317
3317
|
}
|
|
@@ -14952,6 +14952,8 @@ var usageStatisticsTotalsSchema = external_exports.strictObject({
|
|
|
14952
14952
|
cachedInputTokens: count,
|
|
14953
14953
|
cacheWriteInputTokens: count,
|
|
14954
14954
|
cacheKnownInputTokens: count,
|
|
14955
|
+
cacheHitCachedInputTokens: count,
|
|
14956
|
+
cacheHitInputTokens: count,
|
|
14955
14957
|
outputTokens: count,
|
|
14956
14958
|
reasoningOutputTokens: count,
|
|
14957
14959
|
/** USD at the public price, summed over the priced requests only. */
|
|
@@ -15059,6 +15061,51 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
|
15059
15061
|
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
15060
15062
|
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
15061
15063
|
|
|
15064
|
+
// packages/shared-contracts/dist/thread-questions.js
|
|
15065
|
+
var field = external_exports.discriminatedUnion("type", [
|
|
15066
|
+
external_exports.object({
|
|
15067
|
+
id: external_exports.string().min(1),
|
|
15068
|
+
type: external_exports.literal("choice"),
|
|
15069
|
+
prompt: external_exports.string(),
|
|
15070
|
+
options: external_exports.array(external_exports.object({
|
|
15071
|
+
value: external_exports.string().min(1),
|
|
15072
|
+
label: external_exports.string(),
|
|
15073
|
+
description: external_exports.string().optional()
|
|
15074
|
+
})).min(1),
|
|
15075
|
+
multiple: external_exports.boolean(),
|
|
15076
|
+
allowOther: external_exports.boolean(),
|
|
15077
|
+
optional: external_exports.boolean()
|
|
15078
|
+
}),
|
|
15079
|
+
external_exports.object({
|
|
15080
|
+
id: external_exports.string().min(1),
|
|
15081
|
+
type: external_exports.literal("text"),
|
|
15082
|
+
prompt: external_exports.string(),
|
|
15083
|
+
multiline: external_exports.boolean(),
|
|
15084
|
+
secret: external_exports.literal(false),
|
|
15085
|
+
optional: external_exports.boolean(),
|
|
15086
|
+
placeholder: external_exports.string().optional(),
|
|
15087
|
+
prefill: external_exports.string().optional()
|
|
15088
|
+
})
|
|
15089
|
+
]);
|
|
15090
|
+
var threadQuestionSchema = external_exports.object({
|
|
15091
|
+
interactionId: external_exports.string().min(1),
|
|
15092
|
+
turnId: external_exports.string().min(1),
|
|
15093
|
+
title: external_exports.string().optional(),
|
|
15094
|
+
questions: external_exports.array(field).min(1)
|
|
15095
|
+
}).refine(({ questions }) => questions.some((q) => q.type === "choice" && q.multiple), {
|
|
15096
|
+
message: "Shared cards require at least one multi-select question"
|
|
15097
|
+
});
|
|
15098
|
+
var threadQuestionsListParamsSchema = external_exports.strictObject({ threadId: external_exports.string().min(1) });
|
|
15099
|
+
var threadQuestionsResultSchema = external_exports.object({ questions: external_exports.array(threadQuestionSchema) });
|
|
15100
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
15101
|
+
threadId: external_exports.string().min(1),
|
|
15102
|
+
turnId: external_exports.string().min(1),
|
|
15103
|
+
interactionId: external_exports.string().min(1),
|
|
15104
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
15105
|
+
cancelled: external_exports.boolean().default(false)
|
|
15106
|
+
});
|
|
15107
|
+
var threadQuestionRespondResultSchema = external_exports.object({ accepted: external_exports.literal(true) });
|
|
15108
|
+
|
|
15062
15109
|
// packages/shared-contracts/dist/console.js
|
|
15063
15110
|
var consoleAnnouncementSchema = external_exports.strictObject({
|
|
15064
15111
|
title: external_exports.string().trim().min(1).max(200),
|
|
@@ -16657,8 +16704,99 @@ function retainRendererHostResponses(client, hostId2, target) {
|
|
|
16657
16704
|
};
|
|
16658
16705
|
}
|
|
16659
16706
|
|
|
16707
|
+
// packages/desktop-control/src/renderer-prewarm-consumption.ts
|
|
16708
|
+
function isolateRendererPrewarmConsumption(manager, discardExternal) {
|
|
16709
|
+
const record2 = (value) => value !== null && typeof value === "object";
|
|
16710
|
+
if (!record2(manager) || !record2(manager.threadCreation)) return null;
|
|
16711
|
+
const creation = manager.threadCreation;
|
|
16712
|
+
const originalStart = manager.startConversation;
|
|
16713
|
+
const original = creation.createConversation;
|
|
16714
|
+
const params = creation.params;
|
|
16715
|
+
if (typeof originalStart !== "function" || typeof original !== "function" || !record2(params))
|
|
16716
|
+
return null;
|
|
16717
|
+
const prototype = Object.getPrototypeOf(creation);
|
|
16718
|
+
if (!record2(prototype) || typeof prototype.constructor !== "function") return null;
|
|
16719
|
+
if (Object.keys(creation).some((key) => key !== "params" && typeof creation[key] !== "function") || /#[A-Za-z_$]/u.test(Function.prototype.toString.call(prototype.constructor)))
|
|
16720
|
+
return null;
|
|
16721
|
+
const pool = params.prewarmedThreadManager;
|
|
16722
|
+
if (!record2(pool) || typeof pool.hasPrewarmedThread !== "function" || typeof pool.consumePrewarmedThread !== "function" || typeof pool.deletePrewarmedThread !== "function")
|
|
16723
|
+
return null;
|
|
16724
|
+
const consume = pool.consumePrewarmedThread;
|
|
16725
|
+
const hasPrewarm = pool.hasPrewarmedThread;
|
|
16726
|
+
const draftModels = /* @__PURE__ */ new Map();
|
|
16727
|
+
const draftIdentity = /* @__PURE__ */ Symbol("codexhost draft creation");
|
|
16728
|
+
const external = (model2) => typeof model2 === "string" && model2.startsWith("codexhost/");
|
|
16729
|
+
const routedStart = function(input, options, ...args) {
|
|
16730
|
+
const draftId = record2(options) ? options.clientThreadId : null;
|
|
16731
|
+
const mode = record2(input) && record2(input.collaborationMode) ? input.collaborationMode : null;
|
|
16732
|
+
const origin = mode ? Reflect.get(mode, draftIdentity) : void 0;
|
|
16733
|
+
if (mode && record2(mode.settings) && external(mode.settings.model))
|
|
16734
|
+
return originalStart.call(this, input, options, ...args);
|
|
16735
|
+
const model2 = (typeof draftId === "string" ? draftModels.get(draftId) : void 0) ?? (typeof origin === "string" ? draftModels.get(origin) : void 0);
|
|
16736
|
+
if (!model2) return originalStart.call(this, input, options, ...args);
|
|
16737
|
+
if (!record2(input) || !record2(input.collaborationMode) || !record2(input.collaborationMode.settings))
|
|
16738
|
+
throw new Error("External draft creation is missing its native Model settings");
|
|
16739
|
+
const routed = {
|
|
16740
|
+
...input,
|
|
16741
|
+
collaborationMode: {
|
|
16742
|
+
...input.collaborationMode,
|
|
16743
|
+
settings: { ...input.collaborationMode.settings, model: model2 }
|
|
16744
|
+
}
|
|
16745
|
+
};
|
|
16746
|
+
return originalStart.call(this, routed, options, ...args);
|
|
16747
|
+
};
|
|
16748
|
+
const wrapped = function(input, ...args) {
|
|
16749
|
+
const mode = record2(input) && record2(input.collaborationMode) ? input.collaborationMode : null;
|
|
16750
|
+
const expected = mode && record2(mode.settings) ? mode.settings.model : null;
|
|
16751
|
+
const scopedPool = Object.create(pool);
|
|
16752
|
+
scopedPool.hasPrewarmedThread = (...parameters) => hasPrewarm.apply(pool, parameters);
|
|
16753
|
+
scopedPool.consumePrewarmedThread = async (...consumeArgs) => {
|
|
16754
|
+
const warmed = await consume.apply(pool, consumeArgs);
|
|
16755
|
+
if (!record2(warmed) || !record2(warmed.response)) return warmed;
|
|
16756
|
+
const response = warmed.response;
|
|
16757
|
+
if (!external(expected) && !external(response.model)) return warmed;
|
|
16758
|
+
if (external(expected) && expected === response.model) return warmed;
|
|
16759
|
+
if (record2(response.thread) && typeof response.thread.id === "string") {
|
|
16760
|
+
const threadId = response.thread.id;
|
|
16761
|
+
if (external(response.model)) discardExternal(threadId);
|
|
16762
|
+
else
|
|
16763
|
+
void Promise.resolve().then(() => pool.deletePrewarmedThread(threadId)).catch(() => void 0);
|
|
16764
|
+
}
|
|
16765
|
+
return null;
|
|
16766
|
+
};
|
|
16767
|
+
const invocation = Object.create(creation);
|
|
16768
|
+
invocation.params = { ...params, prewarmedThreadManager: scopedPool };
|
|
16769
|
+
return original.call(invocation, input, ...args);
|
|
16770
|
+
};
|
|
16771
|
+
creation.createConversation = wrapped;
|
|
16772
|
+
manager.startConversation = routedStart;
|
|
16773
|
+
return {
|
|
16774
|
+
selectDraft(draftId, model2, creationModes = []) {
|
|
16775
|
+
if (draftId === void 0) {
|
|
16776
|
+
if (model2 === null) draftModels.clear();
|
|
16777
|
+
} else if (model2 === null) draftModels.delete(draftId);
|
|
16778
|
+
else {
|
|
16779
|
+
if (!draftId.startsWith("client-new-thread:") || !external(model2))
|
|
16780
|
+
throw new Error("External draft route is missing its client Thread identity");
|
|
16781
|
+
draftModels.set(draftId, model2);
|
|
16782
|
+
for (const mode of creationModes)
|
|
16783
|
+
Object.defineProperty(mode, draftIdentity, {
|
|
16784
|
+
configurable: true,
|
|
16785
|
+
enumerable: true,
|
|
16786
|
+
value: draftId
|
|
16787
|
+
});
|
|
16788
|
+
}
|
|
16789
|
+
},
|
|
16790
|
+
dispose() {
|
|
16791
|
+
draftModels.clear();
|
|
16792
|
+
if (manager.startConversation === routedStart) manager.startConversation = originalStart;
|
|
16793
|
+
if (creation.createConversation === wrapped) creation.createConversation = original;
|
|
16794
|
+
}
|
|
16795
|
+
};
|
|
16796
|
+
}
|
|
16797
|
+
|
|
16660
16798
|
// packages/desktop-control/src/renderer-draft-prewarm-runtime.ts
|
|
16661
|
-
function createDraftPrewarmPolicyBridge(manager, bridge, hostId2, target, prewarmedThreadManager, isCurrentManager, retainResponses = retainRendererHostResponses) {
|
|
16799
|
+
function createDraftPrewarmPolicyBridge(manager, bridge, hostId2, target, prewarmedThreadManager, isCurrentManager, retainResponses = retainRendererHostResponses, isolateConsumption = isolateRendererPrewarmConsumption) {
|
|
16662
16800
|
let disposed = false;
|
|
16663
16801
|
const originalSend = bridge.sendRequest;
|
|
16664
16802
|
const originalPrewarm = bridge.prewarmThreadStart;
|
|
@@ -17039,26 +17177,16 @@ function createDraftPrewarmPolicyBridge(manager, bridge, hostId2, target, prewar
|
|
|
17039
17177
|
if (threadId && knownOfficialThreadIds.has(threadId)) return false;
|
|
17040
17178
|
return selectedModel !== null && (method.startsWith("thread/") || method.startsWith("turn/") || method.startsWith("review/"));
|
|
17041
17179
|
};
|
|
17042
|
-
const routeThreadStart = (parameters) => {
|
|
17043
|
-
if (!isRecord3(parameters) || parameters.ephemeral === true) {
|
|
17044
|
-
return parameters;
|
|
17045
|
-
}
|
|
17046
|
-
return {
|
|
17047
|
-
...parameters,
|
|
17048
|
-
...selectedModel === null ? {} : { model: selectedModel }
|
|
17049
|
-
};
|
|
17050
|
-
};
|
|
17051
17180
|
const routedSend = (method, parameters, options) => {
|
|
17052
17181
|
if (method === "turn/start" || method === "thread/resume" || method === "codexhost/thread/command/execute") {
|
|
17053
17182
|
const threadId = threadIdFromParameters(parameters);
|
|
17054
17183
|
if (threadId) externalPrewarms.delete(threadId);
|
|
17055
17184
|
}
|
|
17056
|
-
const routedParameters = method === "thread/start" ? routeThreadStart(parameters) : parameters;
|
|
17057
17185
|
const sendBridged = () => initializeBridge().then(
|
|
17058
|
-
() => enqueueBridgeRequest(method,
|
|
17186
|
+
() => enqueueBridgeRequest(method, parameters, options)
|
|
17059
17187
|
);
|
|
17060
|
-
const sendDirect = () => options === void 0 ? originalSend.call(bridge, method,
|
|
17061
|
-
const unresolvedThreadId = shouldResolveThreadOwnership(method,
|
|
17188
|
+
const sendDirect = () => options === void 0 ? originalSend.call(bridge, method, parameters) : originalSend.call(bridge, method, parameters, options);
|
|
17189
|
+
const unresolvedThreadId = shouldResolveThreadOwnership(method, parameters);
|
|
17062
17190
|
if (unresolvedThreadId) {
|
|
17063
17191
|
return resolveThreadOwnership(unresolvedThreadId).then(
|
|
17064
17192
|
(owner) => owner === "external" ? sendBridged() : sendDirect(),
|
|
@@ -17074,7 +17202,7 @@ function createDraftPrewarmPolicyBridge(manager, bridge, hostId2, target, prewar
|
|
|
17074
17202
|
}
|
|
17075
17203
|
);
|
|
17076
17204
|
}
|
|
17077
|
-
return shouldUseBridge(method,
|
|
17205
|
+
return shouldUseBridge(method, parameters) ? sendBridged() : sendDirect();
|
|
17078
17206
|
};
|
|
17079
17207
|
const publishDraftWorkspace = (parameters) => {
|
|
17080
17208
|
if (!isRecord3(parameters) || parameters.ephemeral === true) return;
|
|
@@ -17104,10 +17232,10 @@ function createDraftPrewarmPolicyBridge(manager, bridge, hostId2, target, prewar
|
|
|
17104
17232
|
const discardExternalPrewarms = () => {
|
|
17105
17233
|
for (const threadId of externalPrewarms) discardExternalPrewarm(threadId);
|
|
17106
17234
|
};
|
|
17235
|
+
const restoreConsumption = isolateConsumption(manager, discardExternalPrewarm);
|
|
17107
17236
|
const routedPrewarm = (parameters, options) => {
|
|
17108
|
-
const
|
|
17109
|
-
const
|
|
17110
|
-
const routedParameters = external ? { ...routed, codexhostPrewarm: true } : routed;
|
|
17237
|
+
const external = isRecord3(parameters) && parameters.ephemeral !== true && typeof parameters.model === "string" && parameters.model.startsWith("codexhost/");
|
|
17238
|
+
const routedParameters = external ? { ...parameters, codexhostPrewarm: true } : parameters;
|
|
17111
17239
|
const generation = prewarmGeneration;
|
|
17112
17240
|
publishDraftWorkspace(routedParameters);
|
|
17113
17241
|
const pending = shouldUseBridge("thread/start", routedParameters) ? routedSend("thread/start", routedParameters, options) : options === void 0 ? originalPrewarm.call(bridge, routedParameters) : originalPrewarm.call(bridge, routedParameters, options);
|
|
@@ -17160,6 +17288,7 @@ function createDraftPrewarmPolicyBridge(manager, bridge, hostId2, target, prewar
|
|
|
17160
17288
|
const policy = Object.freeze({
|
|
17161
17289
|
state: "ready",
|
|
17162
17290
|
hostId: hostId2,
|
|
17291
|
+
scopedCreation: restoreConsumption !== null,
|
|
17163
17292
|
owns(candidateManager, candidate, candidateHostId, candidatePrewarmedThreadManager, requiresCurrentManager) {
|
|
17164
17293
|
return !disposed && candidateManager === manager && candidate === bridge && candidateHostId === hostId2 && candidatePrewarmedThreadManager === prewarmedThreadManager && requiresCurrentManager === !!isCurrentManager;
|
|
17165
17294
|
},
|
|
@@ -17168,12 +17297,13 @@ function createDraftPrewarmPolicyBridge(manager, bridge, hostId2, target, prewar
|
|
|
17168
17297
|
throw new Error("Renderer request manager is retired");
|
|
17169
17298
|
return manager;
|
|
17170
17299
|
},
|
|
17171
|
-
select(model2) {
|
|
17300
|
+
select(model2, draftId, creationModes) {
|
|
17172
17301
|
if (disposed || isCurrentManager && !isCurrentManager())
|
|
17173
17302
|
throw new Error("Renderer request manager is retired");
|
|
17174
17303
|
if (model2 !== null && (typeof model2 !== "string" || !model2.startsWith("codexhost/"))) {
|
|
17175
17304
|
throw new Error("Draft route Model must be a codexhost transport carrier");
|
|
17176
17305
|
}
|
|
17306
|
+
restoreConsumption?.selectDraft(draftId, model2, creationModes);
|
|
17177
17307
|
if (selectedModel === model2) return false;
|
|
17178
17308
|
selectedModel = model2;
|
|
17179
17309
|
prewarmGeneration += 1;
|
|
@@ -17194,6 +17324,7 @@ function createDraftPrewarmPolicyBridge(manager, bridge, hostId2, target, prewar
|
|
|
17194
17324
|
disposed = true;
|
|
17195
17325
|
prewarmGeneration += 1;
|
|
17196
17326
|
retireResponses();
|
|
17327
|
+
restoreConsumption?.dispose();
|
|
17197
17328
|
if (bridge.sendRequest === routedSend) bridge.sendRequest = originalSend;
|
|
17198
17329
|
if (bridge.prewarmThreadStart === routedPrewarm) {
|
|
17199
17330
|
bridge.prewarmThreadStart = originalPrewarm;
|
|
@@ -17458,12 +17589,14 @@ function directRendererInstaller() {
|
|
|
17458
17589
|
const resolveRendererHostManager = ${resolveRendererHostManager.toString()};
|
|
17459
17590
|
const retainRendererHostResponses = ${retainRendererHostResponses.toString()};
|
|
17460
17591
|
const createDraftPrewarmPolicyBridge = ${createDraftPrewarmPolicyBridge.toString()};
|
|
17592
|
+
const isolateRendererPrewarmConsumption = ${isolateRendererPrewarmConsumption.toString()};
|
|
17461
17593
|
const routing = (${installRendererHostRouting.toString()})(
|
|
17462
17594
|
document, window,
|
|
17463
17595
|
(root) => discoverRendererHosts(root, committedReactAncestors, requestManagerFromHookState),
|
|
17464
17596
|
(discovery, hostId) => resolveRendererHostManager(discovery, hostId, requestManagerFromHookState),
|
|
17465
17597
|
(manager, bridge, hostId, target, prewarmed, isCurrent) => createDraftPrewarmPolicyBridge(
|
|
17466
17598
|
manager, bridge, hostId, target, prewarmed, isCurrent, retainRendererHostResponses,
|
|
17599
|
+
isolateRendererPrewarmConsumption,
|
|
17467
17600
|
),
|
|
17468
17601
|
);
|
|
17469
17602
|
// Publish a default draft policy only when its Host is unambiguous. Host
|