@codexhost/cli-linux-arm64 0.13.1 → 0.13.2
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/host-runtime.mjs +470 -80
- package/app/plugins/claude-code/plugin.mjs +26 -15
- package/app/plugins/codex-usage/plugin.mjs +18 -9
- package/app/plugins/hermes/plugin.mjs +184 -40
- package/app/renderer-extension.js +64 -35
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
|
@@ -14754,6 +14754,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14754
14754
|
var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
|
|
14755
14755
|
var REMOTE_THREAD_READ_TIMEOUT_MS = 35e3;
|
|
14756
14756
|
var DELEGATION_READ_METHOD = "codexhost/thread/delegation-read";
|
|
14757
|
+
var THREAD_REFERENCE_SOURCE_HOST_PARAM = "codexhostSourceHostId";
|
|
14757
14758
|
var delegationReadParamsSchema = external_exports.strictObject({
|
|
14758
14759
|
threadId: external_exports.string().min(1).max(1024),
|
|
14759
14760
|
view: external_exports.enum(["result", "messages"]),
|
|
@@ -23946,7 +23947,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
23946
23947
|
});
|
|
23947
23948
|
};
|
|
23948
23949
|
}
|
|
23949
|
-
function installRendererExternalSteering(target, sendTurnStart) {
|
|
23950
|
+
function installRendererExternalSteering(target, sendTurnStart, prepareTurnInput) {
|
|
23950
23951
|
if (!isManager(target)) return null;
|
|
23951
23952
|
const manager = target;
|
|
23952
23953
|
const originalSteer = manager.steerTurn;
|
|
@@ -23955,6 +23956,9 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
23955
23956
|
const pending = /* @__PURE__ */ new Map();
|
|
23956
23957
|
let disposed = false;
|
|
23957
23958
|
const send = function(method, params, options) {
|
|
23959
|
+
if ((method === "turn/start" || method === "turn/steer") && prepareTurnInput) {
|
|
23960
|
+
params = prepareTurnInput(params);
|
|
23961
|
+
}
|
|
23958
23962
|
const messageId = isRecord6(params) ? params.clientUserMessageId : null;
|
|
23959
23963
|
const route = typeof messageId === "string" && isRecord6(params) ? routes.get(`${params.threadId}\0${messageId}`) : void 0;
|
|
23960
23964
|
if (method !== "turn/start" || !isRecord6(params) || !route || route.threadId !== params.threadId) {
|
|
@@ -23977,7 +23981,8 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
23977
23981
|
clientUserMessageId: messageId,
|
|
23978
23982
|
input: params.input,
|
|
23979
23983
|
additionalContext: params.additionalContext,
|
|
23980
|
-
responsesapiClientMetadata: params.responsesapiClientMetadata
|
|
23984
|
+
responsesapiClientMetadata: params.responsesapiClientMetadata,
|
|
23985
|
+
...params[THREAD_REFERENCE_SOURCE_HOST_PARAM] !== void 0 ? { [THREAD_REFERENCE_SOURCE_HOST_PARAM]: params[THREAD_REFERENCE_SOURCE_HOST_PARAM] } : {}
|
|
23981
23986
|
},
|
|
23982
23987
|
options
|
|
23983
23988
|
)
|
|
@@ -24320,6 +24325,25 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
24320
24325
|
return Object.freeze({ ...client, inspectThread });
|
|
24321
24326
|
}
|
|
24322
24327
|
|
|
24328
|
+
// src/renderer-thread-reference-context.ts
|
|
24329
|
+
var record4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
24330
|
+
function createThreadReferenceContext(manager, hostId2, isCurrent) {
|
|
24331
|
+
const prepared = /* @__PURE__ */ new WeakMap();
|
|
24332
|
+
return (params) => {
|
|
24333
|
+
if (hostId2 === "local" || !record4(manager) || typeof manager.getConversation !== "function" || !record4(params) || typeof params.threadId !== "string")
|
|
24334
|
+
return params;
|
|
24335
|
+
const conversation = manager.getConversation.call(manager, params.threadId);
|
|
24336
|
+
if (!record4(conversation) || conversation.id !== params.threadId || conversation.modelProvider !== "codexhost")
|
|
24337
|
+
return params;
|
|
24338
|
+
if (!isCurrent()) throw new Error("Thread reference connection is no longer available");
|
|
24339
|
+
const cached2 = prepared.get(params);
|
|
24340
|
+
if (cached2) return cached2;
|
|
24341
|
+
const result = { ...params, [THREAD_REFERENCE_SOURCE_HOST_PARAM]: hostId2 };
|
|
24342
|
+
prepared.set(params, result);
|
|
24343
|
+
return result;
|
|
24344
|
+
};
|
|
24345
|
+
}
|
|
24346
|
+
|
|
24323
24347
|
// src/renderer-manual-compaction.ts
|
|
24324
24348
|
function isRecord8(value) {
|
|
24325
24349
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -24427,6 +24451,11 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
24427
24451
|
target,
|
|
24428
24452
|
route.hostId,
|
|
24429
24453
|
() => !disposed && readRouting()?.forHost(route.hostId) === route
|
|
24454
|
+
),
|
|
24455
|
+
createThreadReferenceContext(
|
|
24456
|
+
target,
|
|
24457
|
+
route.hostId,
|
|
24458
|
+
() => !disposed && readRouting()?.forHost(route.hostId) === route
|
|
24430
24459
|
)
|
|
24431
24460
|
),
|
|
24432
24461
|
() => installRendererManualCompaction(target, route.hostId, messages)
|
|
@@ -31074,7 +31103,7 @@ ${detail}` : ""}`
|
|
|
31074
31103
|
}
|
|
31075
31104
|
function defaultImportName(source, existing) {
|
|
31076
31105
|
const base = source.provider === "openai-codex" ? "codex" : "grok";
|
|
31077
|
-
const used = new Set(existing.map((
|
|
31106
|
+
const used = new Set(existing.map((record5) => record5.name));
|
|
31078
31107
|
const valid = (name) => credentialImportNameSchema.safeParse(name).success;
|
|
31079
31108
|
if (!used.has(base)) return base;
|
|
31080
31109
|
const local = source.label.includes("@") ? source.label.split("@")[0] ?? "" : "";
|
|
@@ -31097,7 +31126,7 @@ ${detail}` : ""}`
|
|
|
31097
31126
|
const shown = (text) => accountDisplayText(text, hideEmails);
|
|
31098
31127
|
const targetButtons = /* @__PURE__ */ new Map();
|
|
31099
31128
|
const importedRecords = () => snapshot.targets.find((target) => target.harnessId === TARGET_HARNESS_ID)?.imports ?? [];
|
|
31100
|
-
const sourceOf = (
|
|
31129
|
+
const sourceOf = (record5) => snapshot.sources.find((source) => source.id === record5.source.id);
|
|
31101
31130
|
const piTarget = () => snapshot.targets.find((candidate) => candidate.harnessId === TARGET_HARNESS_ID);
|
|
31102
31131
|
const compatibleSources = () => {
|
|
31103
31132
|
const target = piTarget();
|
|
@@ -31135,7 +31164,7 @@ ${detail}` : ""}`
|
|
|
31135
31164
|
sectionImport.addEventListener("click", () => {
|
|
31136
31165
|
const sources = compatibleSources();
|
|
31137
31166
|
const free = sources.find(
|
|
31138
|
-
(source2) => !importedRecords().some((
|
|
31167
|
+
(source2) => !importedRecords().some((record5) => record5.source.id === source2.id)
|
|
31139
31168
|
);
|
|
31140
31169
|
const source = free ?? sources[0];
|
|
31141
31170
|
if (source) openDialog("add", { source, choose: true }, SECTION_IMPORT_KEY);
|
|
@@ -31185,30 +31214,30 @@ ${detail}` : ""}`
|
|
|
31185
31214
|
mark.append(createRendererAgentIcon(agent ?? "pi", 26, document2, pluginFor(agent ?? "pi")));
|
|
31186
31215
|
return mark;
|
|
31187
31216
|
};
|
|
31188
|
-
const renderRow = (
|
|
31217
|
+
const renderRow = (record5) => {
|
|
31189
31218
|
const row = document2.createElement("div");
|
|
31190
31219
|
row.className = "settings-pi-accounts__row";
|
|
31191
31220
|
row.tabIndex = -1;
|
|
31192
|
-
row.dataset.importName =
|
|
31193
|
-
row.setAttribute("aria-label", shown(
|
|
31194
|
-
const agent =
|
|
31221
|
+
row.dataset.importName = record5.name;
|
|
31222
|
+
row.setAttribute("aria-label", shown(record5.source.label));
|
|
31223
|
+
const agent = record5.source.harnessId;
|
|
31195
31224
|
const mark = createMark(agent);
|
|
31196
31225
|
const identity = document2.createElement("div");
|
|
31197
31226
|
identity.className = "settings-pi-accounts__identity";
|
|
31198
31227
|
const label = document2.createElement("strong");
|
|
31199
31228
|
label.className = "settings-account-email";
|
|
31200
|
-
label.textContent = shown(
|
|
31229
|
+
label.textContent = shown(record5.source.label);
|
|
31201
31230
|
label.title = label.textContent;
|
|
31202
31231
|
label.translate = false;
|
|
31203
31232
|
const meta3 = document2.createElement("div");
|
|
31204
31233
|
meta3.className = "settings-account-metadata";
|
|
31205
|
-
const source = sourceOf(
|
|
31234
|
+
const source = sourceOf(record5);
|
|
31206
31235
|
const parts = [
|
|
31207
31236
|
metaPart(rendererAgentLabel(agent, pluginFor(agent)), "settings-pi-accounts__agent"),
|
|
31208
|
-
metaPart(`${
|
|
31237
|
+
metaPart(`${record5.name}/\u2026`, void 0, true),
|
|
31209
31238
|
metaPart(messages.copied)
|
|
31210
31239
|
];
|
|
31211
|
-
const time3 = formatImportedAt(
|
|
31240
|
+
const time3 = formatImportedAt(record5.importedAt);
|
|
31212
31241
|
if (time3) parts.push(metaPart(time3));
|
|
31213
31242
|
parts.forEach((part, index) => {
|
|
31214
31243
|
if (index > 0) {
|
|
@@ -31225,23 +31254,23 @@ ${detail}` : ""}`
|
|
|
31225
31254
|
reimport.type = "button";
|
|
31226
31255
|
reimport.className = "settings-account-action";
|
|
31227
31256
|
reimport.textContent = messages.rowReimport;
|
|
31228
|
-
reimport.setAttribute("aria-label", `${messages.reimport}: ${shown(
|
|
31257
|
+
reimport.setAttribute("aria-label", `${messages.reimport}: ${shown(record5.source.label)}`);
|
|
31229
31258
|
reimport.disabled = busy || !source;
|
|
31230
31259
|
reimport.title = messages.reimport;
|
|
31231
31260
|
reimport.addEventListener("click", () => {
|
|
31232
|
-
if (source) openDialog("reimport", { source, record:
|
|
31261
|
+
if (source) openDialog("reimport", { source, record: record5 }, `row:${record5.name}`);
|
|
31233
31262
|
});
|
|
31234
31263
|
const remove = document2.createElement("button");
|
|
31235
31264
|
remove.type = "button";
|
|
31236
31265
|
remove.className = "settings-account-action settings-pi-accounts__remove";
|
|
31237
31266
|
remove.textContent = messages.rowRemove;
|
|
31238
|
-
remove.setAttribute("aria-label", `${messages.remove}: ${shown(
|
|
31267
|
+
remove.setAttribute("aria-label", `${messages.remove}: ${shown(record5.source.label)}`);
|
|
31239
31268
|
remove.disabled = busy;
|
|
31240
|
-
remove.addEventListener("click", () => openDialog("remove", { record:
|
|
31269
|
+
remove.addEventListener("click", () => openDialog("remove", { record: record5 }, `row:${record5.name}`));
|
|
31241
31270
|
if (source) actions.append(reimport);
|
|
31242
31271
|
actions.append(remove);
|
|
31243
31272
|
row.append(mark, identity, actions);
|
|
31244
|
-
rows.set(
|
|
31273
|
+
rows.set(record5.name, row);
|
|
31245
31274
|
return row;
|
|
31246
31275
|
};
|
|
31247
31276
|
const loginTypeLabel = (type) => type === "oauth" ? messages.typeOauth : type === "api_key" ? messages.typeApiKey : messages.typeOther;
|
|
@@ -31394,7 +31423,7 @@ ${detail}` : ""}`
|
|
|
31394
31423
|
const label = document2.createElement("strong");
|
|
31395
31424
|
label.textContent = shown(choice.label);
|
|
31396
31425
|
label.translate = false;
|
|
31397
|
-
const existing = importedRecords().find((
|
|
31426
|
+
const existing = importedRecords().find((record5) => record5.source.id === choice.id);
|
|
31398
31427
|
const agent = choice.harnessId;
|
|
31399
31428
|
const detail = document2.createElement("span");
|
|
31400
31429
|
detail.textContent = [
|
|
@@ -31435,7 +31464,7 @@ ${detail}` : ""}`
|
|
|
31435
31464
|
const name = request.action === "list" ? void 0 : request.name;
|
|
31436
31465
|
state = {
|
|
31437
31466
|
source: state.source,
|
|
31438
|
-
record: importedRecords().find((
|
|
31467
|
+
record: importedRecords().find((record5) => record5.name === name) ?? state.record
|
|
31439
31468
|
};
|
|
31440
31469
|
show(next);
|
|
31441
31470
|
} else {
|
|
@@ -31449,12 +31478,12 @@ ${detail}` : ""}`
|
|
|
31449
31478
|
sourceRadios = [];
|
|
31450
31479
|
body.replaceChildren();
|
|
31451
31480
|
controls.replaceChildren();
|
|
31452
|
-
const { source, record:
|
|
31481
|
+
const { source, record: record5 } = state;
|
|
31453
31482
|
const close = () => modal.close();
|
|
31454
31483
|
if (mode === "add" || mode === "reimport") {
|
|
31455
31484
|
title.textContent = mode === "add" ? messages.add : messages.reimport;
|
|
31456
31485
|
modal.setAttribute("aria-label", title.textContent);
|
|
31457
|
-
const active = source ??
|
|
31486
|
+
const active = source ?? record5?.source;
|
|
31458
31487
|
const choices = mode === "add" && state.choose ? compatibleSources() : [];
|
|
31459
31488
|
if (choices.length > 1) body.append(sourcePicker(choices));
|
|
31460
31489
|
else if (active) body.append(line(messages.source, shown(active.label)));
|
|
@@ -31463,8 +31492,8 @@ ${detail}` : ""}`
|
|
|
31463
31492
|
input.maxLength = 48;
|
|
31464
31493
|
input.autocomplete = "off";
|
|
31465
31494
|
input.spellcheck = false;
|
|
31466
|
-
input.value =
|
|
31467
|
-
input.readOnly = Boolean(
|
|
31495
|
+
input.value = record5?.name ?? (source ? defaultImportName(source, importedRecords()) : "codex");
|
|
31496
|
+
input.readOnly = Boolean(record5);
|
|
31468
31497
|
input.addEventListener("input", () => {
|
|
31469
31498
|
nameEdited = true;
|
|
31470
31499
|
});
|
|
@@ -31498,7 +31527,7 @@ ${detail}` : ""}`
|
|
|
31498
31527
|
{
|
|
31499
31528
|
action: mode === "reimport" ? "reimport" : "import",
|
|
31500
31529
|
sourceId: source2.id,
|
|
31501
|
-
name:
|
|
31530
|
+
name: record5?.name ?? input.value,
|
|
31502
31531
|
confirmed: true
|
|
31503
31532
|
},
|
|
31504
31533
|
"done"
|
|
@@ -31508,16 +31537,16 @@ ${detail}` : ""}`
|
|
|
31508
31537
|
)
|
|
31509
31538
|
);
|
|
31510
31539
|
(mode === "add" ? input : controls.children[0]).focus();
|
|
31511
|
-
} else if (mode === "remove" &&
|
|
31540
|
+
} else if (mode === "remove" && record5) {
|
|
31512
31541
|
title.textContent = messages.remove;
|
|
31513
31542
|
modal.setAttribute("aria-label", title.textContent);
|
|
31514
|
-
body.append(note(messages.removeWarning.replace("{name}",
|
|
31543
|
+
body.append(note(messages.removeWarning.replace("{name}", record5.name)));
|
|
31515
31544
|
const cancel = command(messages.cancel, close);
|
|
31516
31545
|
controls.append(
|
|
31517
31546
|
cancel,
|
|
31518
31547
|
command(
|
|
31519
31548
|
messages.remove,
|
|
31520
|
-
() => submit({ action: "remove", name:
|
|
31549
|
+
() => submit({ action: "remove", name: record5.name, confirmed: true }, null),
|
|
31521
31550
|
"danger"
|
|
31522
31551
|
)
|
|
31523
31552
|
);
|
|
@@ -31525,7 +31554,7 @@ ${detail}` : ""}`
|
|
|
31525
31554
|
} else {
|
|
31526
31555
|
title.textContent = messages.doneTitle;
|
|
31527
31556
|
modal.setAttribute("aria-label", title.textContent);
|
|
31528
|
-
const name =
|
|
31557
|
+
const name = record5?.name;
|
|
31529
31558
|
if (name) body.append(line(messages.entry, `${name}/\u2026`, true));
|
|
31530
31559
|
body.append(note(messages.done));
|
|
31531
31560
|
const done = command(messages.close, close, "primary");
|
|
@@ -31572,21 +31601,21 @@ ${detail}` : ""}`
|
|
|
31572
31601
|
(candidate) => candidate.harnessId === TARGET_HARNESS_ID && source && candidate.providers.includes(source.provider)
|
|
31573
31602
|
);
|
|
31574
31603
|
if (!source || !target) return null;
|
|
31575
|
-
const
|
|
31604
|
+
const record5 = target.imports.find((candidate) => candidate.source.id === source.id);
|
|
31576
31605
|
const key = `${harnessId}:${accountLabel}:import`;
|
|
31577
31606
|
const button2 = document2.createElement("button");
|
|
31578
31607
|
button2.type = "button";
|
|
31579
31608
|
button2.className = "settings-account-pi-import";
|
|
31580
31609
|
button2.dataset.accountFocus = key;
|
|
31581
31610
|
button2.disabled = busy;
|
|
31582
|
-
const hint =
|
|
31611
|
+
const hint = record5 ? messages.importedHint.replace("{name}", record5.name) : messages.add;
|
|
31583
31612
|
button2.title = hint;
|
|
31584
31613
|
button2.setAttribute("aria-label", hint);
|
|
31585
31614
|
button2.append(createRendererAgentIcon("pi", 12, document2, pluginFor("pi")));
|
|
31586
|
-
if (
|
|
31615
|
+
if (record5) {
|
|
31587
31616
|
button2.dataset.state = "imported";
|
|
31588
31617
|
const name = document2.createElement("code");
|
|
31589
|
-
name.textContent = `${
|
|
31618
|
+
name.textContent = `${record5.name}/\u2026`;
|
|
31590
31619
|
name.translate = false;
|
|
31591
31620
|
button2.append(name, createRendererSettingsIcon("check", 12));
|
|
31592
31621
|
} else {
|
|
@@ -31594,7 +31623,7 @@ ${detail}` : ""}`
|
|
|
31594
31623
|
button2.append(messages.add);
|
|
31595
31624
|
}
|
|
31596
31625
|
button2.addEventListener("click", () => {
|
|
31597
|
-
if (!
|
|
31626
|
+
if (!record5) {
|
|
31598
31627
|
openDialog("add", { source }, key);
|
|
31599
31628
|
return;
|
|
31600
31629
|
}
|
|
@@ -31603,7 +31632,7 @@ ${detail}` : ""}`
|
|
|
31603
31632
|
renderSection();
|
|
31604
31633
|
sectionToggle.setAttribute("aria-expanded", "true");
|
|
31605
31634
|
}
|
|
31606
|
-
const row = rows.get(
|
|
31635
|
+
const row = rows.get(record5.name);
|
|
31607
31636
|
row?.scrollIntoView({ block: "nearest", behavior: "smooth" });
|
|
31608
31637
|
row?.focus();
|
|
31609
31638
|
});
|
package/bin/codexhost
CHANGED
|
Binary file
|
package/libexec/codexhost-shim
CHANGED
|
Binary file
|
|
Binary file
|