@codexhost/cli-darwin-x64 0.2.0 → 0.2.1
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/desktop-controller.mjs +2 -24
- package/app/host-runtime.mjs +426 -335
- package/app/renderer-extension.js +244 -39
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
|
@@ -14950,12 +14950,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14950
14950
|
});
|
|
14951
14951
|
}
|
|
14952
14952
|
});
|
|
14953
|
+
var usagePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
14954
|
+
var accountCreditsProductUsageSchema = external_exports.object({
|
|
14955
|
+
product: external_exports.string().min(1),
|
|
14956
|
+
usagePercent: usagePercentSchema
|
|
14957
|
+
}).strict();
|
|
14958
|
+
var accountCreditsSnapshotSchema = external_exports.object({
|
|
14959
|
+
usedPercent: usagePercentSchema,
|
|
14960
|
+
resetsAt: external_exports.string().min(1).optional(),
|
|
14961
|
+
periodType: external_exports.enum(["weekly", "monthly", "unknown"]),
|
|
14962
|
+
productUsage: external_exports.array(accountCreditsProductUsageSchema).min(1).optional()
|
|
14963
|
+
}).strict();
|
|
14953
14964
|
var threadUsageInspectionParamsSchema = external_exports.object({
|
|
14954
14965
|
threadId: hostThreadIdSchema
|
|
14955
14966
|
}).strict();
|
|
14956
14967
|
var threadUsageInspectionSchema = external_exports.object({
|
|
14957
14968
|
threadId: hostThreadIdSchema,
|
|
14958
|
-
usage: threadUsageSnapshotSchema.nullable()
|
|
14969
|
+
usage: threadUsageSnapshotSchema.nullable(),
|
|
14970
|
+
accountCredits: accountCreditsSnapshotSchema.optional()
|
|
14959
14971
|
}).strict();
|
|
14960
14972
|
|
|
14961
14973
|
// ../shared-contracts/dist/harness-models.js
|
|
@@ -16414,6 +16426,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16414
16426
|
if (absolute < 1e3) return `${sign}${Math.round(absolute)}`;
|
|
16415
16427
|
return `${sign}${decimal(absolute / 1e3, 1)}k`;
|
|
16416
16428
|
}
|
|
16429
|
+
function formatRendererCreditsPercent(value) {
|
|
16430
|
+
return `${decimal(value, 1)}%`;
|
|
16431
|
+
}
|
|
16432
|
+
function rendererUsageTriggerMaxWidth(hasAccountCredits) {
|
|
16433
|
+
return hasAccountCredits ? "min(300px, 44vw)" : "min(180px, 30vw)";
|
|
16434
|
+
}
|
|
16435
|
+
function formatRendererCreditsReset(value) {
|
|
16436
|
+
const date5 = new Date(value);
|
|
16437
|
+
if (Number.isNaN(date5.getTime())) return value;
|
|
16438
|
+
return date5.toLocaleString(void 0, {
|
|
16439
|
+
month: "long",
|
|
16440
|
+
day: "numeric",
|
|
16441
|
+
hour: "numeric",
|
|
16442
|
+
minute: "2-digit"
|
|
16443
|
+
});
|
|
16444
|
+
}
|
|
16445
|
+
function creditsPeriodLabel(periodType) {
|
|
16446
|
+
if (periodType === "weekly") return "Weekly limit";
|
|
16447
|
+
if (periodType === "monthly") return "Monthly limit";
|
|
16448
|
+
return "Account limit";
|
|
16449
|
+
}
|
|
16450
|
+
function productLabel(product) {
|
|
16451
|
+
if (product === "GrokBuild") return "Build";
|
|
16452
|
+
if (product === "GrokChat") return "Chat";
|
|
16453
|
+
if (product === "GrokImagine") return "Imagine";
|
|
16454
|
+
if (product === "GrokVoice") return "Voice";
|
|
16455
|
+
return product;
|
|
16456
|
+
}
|
|
16417
16457
|
function addDetailRow(parent, label, value) {
|
|
16418
16458
|
const row = document.createElement("div");
|
|
16419
16459
|
row.style.display = "grid";
|
|
@@ -16430,14 +16470,31 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16430
16470
|
row.append(labelElement, valueElement);
|
|
16431
16471
|
parent.append(row);
|
|
16432
16472
|
}
|
|
16433
|
-
function renderDetails(popover, usage) {
|
|
16473
|
+
function renderDetails(popover, usage, accountCredits) {
|
|
16434
16474
|
popover.replaceChildren();
|
|
16435
16475
|
const heading = document.createElement("div");
|
|
16436
16476
|
heading.textContent = "Usage";
|
|
16437
16477
|
heading.style.fontWeight = "600";
|
|
16438
16478
|
heading.style.marginBottom = "6px";
|
|
16439
16479
|
popover.append(heading);
|
|
16440
|
-
if (
|
|
16480
|
+
if (accountCredits) {
|
|
16481
|
+
addDetailRow(
|
|
16482
|
+
popover,
|
|
16483
|
+
creditsPeriodLabel(accountCredits.periodType),
|
|
16484
|
+
formatRendererCreditsPercent(accountCredits.usedPercent)
|
|
16485
|
+
);
|
|
16486
|
+
if (accountCredits.resetsAt) {
|
|
16487
|
+
addDetailRow(popover, "Resets", formatRendererCreditsReset(accountCredits.resetsAt));
|
|
16488
|
+
}
|
|
16489
|
+
for (const product of accountCredits.productUsage ?? []) {
|
|
16490
|
+
addDetailRow(
|
|
16491
|
+
popover,
|
|
16492
|
+
productLabel(product.product),
|
|
16493
|
+
formatRendererCreditsPercent(product.usagePercent)
|
|
16494
|
+
);
|
|
16495
|
+
}
|
|
16496
|
+
}
|
|
16497
|
+
if (usage?.contextUsedTokens !== void 0 && usage.contextWindowTokens !== void 0) {
|
|
16441
16498
|
const contextPercent = usage.contextWindowTokens > 0 ? usage.contextUsedTokens / usage.contextWindowTokens * 100 : null;
|
|
16442
16499
|
addDetailRow(
|
|
16443
16500
|
popover,
|
|
@@ -16445,33 +16502,33 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16445
16502
|
contextPercent === null ? `/${formatRendererTokenCount(usage.contextWindowTokens)}` : `${decimal(contextPercent, 1)}% / ${formatRendererTokenCount(usage.contextWindowTokens)}`
|
|
16446
16503
|
);
|
|
16447
16504
|
}
|
|
16448
|
-
if (usage
|
|
16505
|
+
if (usage?.cacheHitRatePercent !== void 0) {
|
|
16449
16506
|
addDetailRow(
|
|
16450
16507
|
popover,
|
|
16451
16508
|
"Latest cache hit",
|
|
16452
16509
|
formatRendererCacheHitRate(usage.cacheHitRatePercent)
|
|
16453
16510
|
);
|
|
16454
16511
|
}
|
|
16455
|
-
if (usage
|
|
16512
|
+
if (usage?.outputTokensPerSecond !== void 0) {
|
|
16456
16513
|
addDetailRow(popover, "Output speed", formatRendererTokenRate(usage.outputTokensPerSecond));
|
|
16457
16514
|
}
|
|
16458
|
-
if (usage
|
|
16515
|
+
if (usage?.cachedInputTokens !== void 0) {
|
|
16459
16516
|
addDetailRow(popover, "Cache read", formatRendererTokenCount(usage.cachedInputTokens));
|
|
16460
16517
|
}
|
|
16461
|
-
if (usage
|
|
16518
|
+
if (usage?.cacheWriteInputTokens !== void 0) {
|
|
16462
16519
|
addDetailRow(popover, "Cache write", formatRendererTokenCount(usage.cacheWriteInputTokens));
|
|
16463
16520
|
}
|
|
16464
|
-
if (usage
|
|
16521
|
+
if (usage?.reasoningOutputTokens !== void 0) {
|
|
16465
16522
|
addDetailRow(popover, "Reasoning", formatRendererTokenCount(usage.reasoningOutputTokens));
|
|
16466
16523
|
}
|
|
16467
|
-
if (usage
|
|
16524
|
+
if (usage?.inputTokens !== void 0 || usage?.outputTokens !== void 0) {
|
|
16468
16525
|
addDetailRow(
|
|
16469
16526
|
popover,
|
|
16470
16527
|
"Input / output",
|
|
16471
16528
|
`${formatRendererTokenCount(usage.inputTokens ?? 0)} / ${formatRendererTokenCount(usage.outputTokens ?? 0)}`
|
|
16472
16529
|
);
|
|
16473
16530
|
}
|
|
16474
|
-
if (usage
|
|
16531
|
+
if (usage?.totalCostUsd !== void 0) {
|
|
16475
16532
|
addDetailRow(popover, "Session cost estimate", formatRendererCost(usage.totalCostUsd));
|
|
16476
16533
|
}
|
|
16477
16534
|
}
|
|
@@ -16529,7 +16586,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16529
16586
|
trigger.style.display = "inline-flex";
|
|
16530
16587
|
trigger.style.alignItems = "center";
|
|
16531
16588
|
trigger.style.width = "fit-content";
|
|
16532
|
-
trigger.style.maxWidth =
|
|
16589
|
+
trigger.style.maxWidth = rendererUsageTriggerMaxWidth(false);
|
|
16533
16590
|
trigger.style.height = "24px";
|
|
16534
16591
|
trigger.style.padding = "0 4px";
|
|
16535
16592
|
trigger.style.borderRadius = "9999px";
|
|
@@ -16632,30 +16689,33 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16632
16689
|
document.body.append(popover);
|
|
16633
16690
|
return control;
|
|
16634
16691
|
}
|
|
16635
|
-
function renderRendererUsageControl(control, usage) {
|
|
16692
|
+
function renderRendererUsageControl(control, usage, accountCredits = null) {
|
|
16636
16693
|
const cacheHitRatePercent = usage?.cacheHitRatePercent;
|
|
16637
16694
|
const outputTokensPerSecond = usage?.outputTokensPerSecond;
|
|
16638
16695
|
const totalCostUsd = usage?.totalCostUsd;
|
|
16639
16696
|
const hasCacheHitRate = cacheHitRatePercent !== void 0;
|
|
16640
16697
|
const hasOutputSpeed = outputTokensPerSecond !== void 0;
|
|
16641
16698
|
const hasCost = totalCostUsd !== void 0;
|
|
16642
|
-
const
|
|
16699
|
+
const hasCredits = accountCredits !== null;
|
|
16700
|
+
const visible = hasCacheHitRate || hasOutputSpeed || hasCost || hasCredits;
|
|
16643
16701
|
control.root.style.display = visible ? "inline-flex" : "none";
|
|
16644
|
-
if (!visible
|
|
16702
|
+
if (!visible) {
|
|
16645
16703
|
closePopover(control);
|
|
16646
16704
|
return false;
|
|
16647
16705
|
}
|
|
16648
16706
|
const summary = [
|
|
16707
|
+
accountCredits ? `${creditsPeriodLabel(accountCredits.periodType)} ${formatRendererCreditsPercent(accountCredits.usedPercent)}` : null,
|
|
16649
16708
|
cacheHitRatePercent !== void 0 ? formatRendererCacheHitRate(cacheHitRatePercent) : null,
|
|
16650
16709
|
outputTokensPerSecond !== void 0 ? formatRendererTokenRate(outputTokensPerSecond) : null,
|
|
16651
16710
|
totalCostUsd !== void 0 ? formatRendererCost(totalCostUsd) : null
|
|
16652
16711
|
].filter((value) => value !== null);
|
|
16653
16712
|
const compactSummary = summary.join(" \xB7 ");
|
|
16654
16713
|
const accessibleSummary = `Thread Usage: ${compactSummary}`;
|
|
16714
|
+
control.trigger.style.maxWidth = rendererUsageTriggerMaxWidth(hasCredits);
|
|
16655
16715
|
control.trigger.setAttribute("aria-label", accessibleSummary);
|
|
16656
16716
|
control.trigger.title = accessibleSummary;
|
|
16657
16717
|
control.label.textContent = compactSummary;
|
|
16658
|
-
renderDetails(control.popover, usage);
|
|
16718
|
+
renderDetails(control.popover, usage, accountCredits);
|
|
16659
16719
|
return true;
|
|
16660
16720
|
}
|
|
16661
16721
|
|
|
@@ -16812,14 +16872,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16812
16872
|
}
|
|
16813
16873
|
control.usage.syncNativeModelClassName(candidate.className);
|
|
16814
16874
|
}
|
|
16815
|
-
function
|
|
16816
|
-
const
|
|
16817
|
-
if (
|
|
16875
|
+
function usagePlacementAnchor(control) {
|
|
16876
|
+
const context = nativeContextUsageControlForComposer(control.composer);
|
|
16877
|
+
if (context?.parentElement) return context;
|
|
16878
|
+
const modelRoot = control.modelPicker.root;
|
|
16879
|
+
if (modelRoot.parentElement) return modelRoot;
|
|
16880
|
+
const native = control.nativeModelControl?.element;
|
|
16881
|
+
return native?.parentElement ? native : null;
|
|
16882
|
+
}
|
|
16883
|
+
function refreshUsagePlacement(control) {
|
|
16884
|
+
const anchor = usagePlacementAnchor(control);
|
|
16885
|
+
if (!anchor) {
|
|
16818
16886
|
if (control.usage.anchor) control.usage.root.remove();
|
|
16819
16887
|
control.usage.anchor = null;
|
|
16820
16888
|
return;
|
|
16821
16889
|
}
|
|
16822
|
-
control.usage.place(
|
|
16890
|
+
control.usage.place(anchor);
|
|
16823
16891
|
}
|
|
16824
16892
|
function refreshNativePermissionModeControl(control) {
|
|
16825
16893
|
const semanticCandidate = semanticNativePermissionModeControlForComposer(control.composer);
|
|
@@ -16851,7 +16919,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16851
16919
|
}
|
|
16852
16920
|
function reconcileComposerNativeControls(control, hideModel, hidePermissionMode) {
|
|
16853
16921
|
refreshNativeModelControl(control);
|
|
16854
|
-
|
|
16922
|
+
refreshUsagePlacement(control);
|
|
16855
16923
|
refreshNativePermissionModeControl(control);
|
|
16856
16924
|
setNativeControlHidden(control.nativeModelControl, hideModel);
|
|
16857
16925
|
setNativeControlHidden(control.nativePermissionModeControl, hidePermissionMode);
|
|
@@ -16900,10 +16968,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16900
16968
|
sendButton,
|
|
16901
16969
|
sendDisabledBeforeSwitch: null
|
|
16902
16970
|
};
|
|
16903
|
-
|
|
16971
|
+
refreshUsagePlacement(control);
|
|
16904
16972
|
return control;
|
|
16905
16973
|
}
|
|
16906
|
-
function renderComposerAgentControl(control, state, adapterState, switching, availability = {}, modelView = { status: "idle" }, permissionModeView = { status: "idle" }, usage = null) {
|
|
16974
|
+
function renderComposerAgentControl(control, state, adapterState, switching, availability = {}, modelView = { status: "idle" }, permissionModeView = { status: "idle" }, usage = null, accountCredits = null) {
|
|
16907
16975
|
const selectedModel = modelView.selected;
|
|
16908
16976
|
const selectedCatalogModel = modelView.catalog?.models.find(
|
|
16909
16977
|
(model) => model.ref.id === selectedModel?.id
|
|
@@ -16940,7 +17008,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16940
17008
|
permissionModeView,
|
|
16941
17009
|
permissionModeVisible
|
|
16942
17010
|
);
|
|
16943
|
-
renderRendererUsageControl(control.usage, usage);
|
|
17011
|
+
renderRendererUsageControl(control.usage, usage, accountCredits);
|
|
16944
17012
|
}
|
|
16945
17013
|
function disposeComposerAgentControl(control) {
|
|
16946
17014
|
if (control.sendDisabledBeforeSwitch !== null) {
|
|
@@ -18540,6 +18608,124 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18540
18608
|
}
|
|
18541
18609
|
};
|
|
18542
18610
|
|
|
18611
|
+
// src/settings/release-notes.ts
|
|
18612
|
+
var HEADING_PATTERN = /^(#{1,6})[ \t]+(.+?)\s*$/u;
|
|
18613
|
+
var UNORDERED_ITEM_PATTERN = /^[-*][ \t]+(.+?)\s*$/u;
|
|
18614
|
+
var ORDERED_ITEM_PATTERN = /^\d+[.)][ \t]+(.+?)\s*$/u;
|
|
18615
|
+
var FENCE_PATTERN = /^```([\w+-]*)\s*$/u;
|
|
18616
|
+
var INLINE_PATTERN = /(`+)((?:(?!\1).)+)\1|\*\*(.+?)\*\*|\[([^\]]+)\]\(([^)\s]+)\)/gu;
|
|
18617
|
+
function createReleaseNotesElement(document2, markdown) {
|
|
18618
|
+
const root = document2.createElement("div");
|
|
18619
|
+
root.className = "settings-update-notes";
|
|
18620
|
+
appendReleaseNotesBlocks(document2, root, markdown);
|
|
18621
|
+
return root;
|
|
18622
|
+
}
|
|
18623
|
+
function appendReleaseNotesBlocks(document2, root, markdown) {
|
|
18624
|
+
const lines = markdown.replaceAll("\r\n", "\n").split("\n");
|
|
18625
|
+
let index = 0;
|
|
18626
|
+
while (index < lines.length) {
|
|
18627
|
+
const line = lines[index] ?? "";
|
|
18628
|
+
if (line.trim().length === 0) {
|
|
18629
|
+
index += 1;
|
|
18630
|
+
continue;
|
|
18631
|
+
}
|
|
18632
|
+
const fence = FENCE_PATTERN.exec(line);
|
|
18633
|
+
if (fence) {
|
|
18634
|
+
index = appendFencedCode(document2, root, lines, index, fence[1] ?? "");
|
|
18635
|
+
continue;
|
|
18636
|
+
}
|
|
18637
|
+
const heading = HEADING_PATTERN.exec(line);
|
|
18638
|
+
if (heading?.[1] && heading[2]) {
|
|
18639
|
+
const tag = `h${heading[1].length}`;
|
|
18640
|
+
const element = document2.createElement(tag);
|
|
18641
|
+
appendInline(document2, element, heading[2]);
|
|
18642
|
+
root.append(element);
|
|
18643
|
+
index += 1;
|
|
18644
|
+
continue;
|
|
18645
|
+
}
|
|
18646
|
+
if (UNORDERED_ITEM_PATTERN.test(line)) {
|
|
18647
|
+
index = appendList(document2, root, lines, index, "ul", UNORDERED_ITEM_PATTERN);
|
|
18648
|
+
continue;
|
|
18649
|
+
}
|
|
18650
|
+
if (ORDERED_ITEM_PATTERN.test(line)) {
|
|
18651
|
+
index = appendList(document2, root, lines, index, "ol", ORDERED_ITEM_PATTERN);
|
|
18652
|
+
continue;
|
|
18653
|
+
}
|
|
18654
|
+
index = appendParagraph(document2, root, lines, index);
|
|
18655
|
+
}
|
|
18656
|
+
}
|
|
18657
|
+
function appendFencedCode(document2, root, lines, start, language) {
|
|
18658
|
+
const body = [];
|
|
18659
|
+
let index = start + 1;
|
|
18660
|
+
while (index < lines.length && !FENCE_PATTERN.test(lines[index] ?? "")) {
|
|
18661
|
+
body.push(lines[index] ?? "");
|
|
18662
|
+
index += 1;
|
|
18663
|
+
}
|
|
18664
|
+
if (index < lines.length) index += 1;
|
|
18665
|
+
const pre = document2.createElement("pre");
|
|
18666
|
+
const code = document2.createElement("code");
|
|
18667
|
+
if (language.length > 0) code.className = `language-${language}`;
|
|
18668
|
+
code.textContent = body.join("\n");
|
|
18669
|
+
pre.append(code);
|
|
18670
|
+
root.append(pre);
|
|
18671
|
+
return index;
|
|
18672
|
+
}
|
|
18673
|
+
function appendList(document2, root, lines, start, tag, pattern) {
|
|
18674
|
+
const list = document2.createElement(tag);
|
|
18675
|
+
let index = start;
|
|
18676
|
+
while (index < lines.length) {
|
|
18677
|
+
const item = pattern.exec(lines[index] ?? "");
|
|
18678
|
+
if (!item?.[1]) break;
|
|
18679
|
+
const entry = document2.createElement("li");
|
|
18680
|
+
appendInline(document2, entry, item[1]);
|
|
18681
|
+
list.append(entry);
|
|
18682
|
+
index += 1;
|
|
18683
|
+
}
|
|
18684
|
+
root.append(list);
|
|
18685
|
+
return index;
|
|
18686
|
+
}
|
|
18687
|
+
function appendParagraph(document2, root, lines, start) {
|
|
18688
|
+
const paragraphLines = [];
|
|
18689
|
+
let index = start;
|
|
18690
|
+
while (index < lines.length) {
|
|
18691
|
+
const current = lines[index] ?? "";
|
|
18692
|
+
if (current.trim().length === 0 || FENCE_PATTERN.test(current) || HEADING_PATTERN.test(current) || UNORDERED_ITEM_PATTERN.test(current) || ORDERED_ITEM_PATTERN.test(current)) {
|
|
18693
|
+
break;
|
|
18694
|
+
}
|
|
18695
|
+
paragraphLines.push(current.trim());
|
|
18696
|
+
index += 1;
|
|
18697
|
+
}
|
|
18698
|
+
const paragraph = document2.createElement("p");
|
|
18699
|
+
appendInline(document2, paragraph, paragraphLines.join(" "));
|
|
18700
|
+
root.append(paragraph);
|
|
18701
|
+
return index;
|
|
18702
|
+
}
|
|
18703
|
+
function appendInline(document2, parent, text) {
|
|
18704
|
+
let lastIndex = 0;
|
|
18705
|
+
for (const match of text.matchAll(INLINE_PATTERN)) {
|
|
18706
|
+
const index = match.index ?? 0;
|
|
18707
|
+
if (index > lastIndex) parent.append(text.slice(lastIndex, index));
|
|
18708
|
+
if (match[2] !== void 0) {
|
|
18709
|
+
const code = document2.createElement("code");
|
|
18710
|
+
code.textContent = match[2];
|
|
18711
|
+
parent.append(code);
|
|
18712
|
+
} else if (match[3] !== void 0) {
|
|
18713
|
+
const strong = document2.createElement("strong");
|
|
18714
|
+
strong.textContent = match[3];
|
|
18715
|
+
parent.append(strong);
|
|
18716
|
+
} else {
|
|
18717
|
+
const link = document2.createElement("a");
|
|
18718
|
+
link.textContent = match[4] ?? "";
|
|
18719
|
+
link.setAttribute("href", match[5] ?? "");
|
|
18720
|
+
link.setAttribute("target", "_blank");
|
|
18721
|
+
link.setAttribute("rel", "noopener noreferrer");
|
|
18722
|
+
parent.append(link);
|
|
18723
|
+
}
|
|
18724
|
+
lastIndex = index + match[0].length;
|
|
18725
|
+
}
|
|
18726
|
+
if (lastIndex < text.length) parent.append(text.slice(lastIndex));
|
|
18727
|
+
}
|
|
18728
|
+
|
|
18543
18729
|
// src/settings/update-request.ts
|
|
18544
18730
|
var RENDERER_UPDATE_REQUEST_TIMEOUT_MS = 15e3;
|
|
18545
18731
|
var RendererUpdateRequestTimeoutError = class extends Error {
|
|
@@ -18832,10 +19018,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18832
19018
|
summary.textContent = operationMessage ?? (result.error ? messages.updateFailed : result.updateAvailable ? messages.updateAvailable : messages.updateUpToDate);
|
|
18833
19019
|
panel.append(summary);
|
|
18834
19020
|
if (result.releaseNotes) {
|
|
18835
|
-
|
|
18836
|
-
releaseNotes.className = "settings-update-notes";
|
|
18837
|
-
releaseNotes.textContent = result.releaseNotes;
|
|
18838
|
-
panel.append(releaseNotes);
|
|
19021
|
+
panel.append(createReleaseNotesElement(document2, result.releaseNotes));
|
|
18839
19022
|
}
|
|
18840
19023
|
if (result.status?.phase === "failed" && result.status.error) {
|
|
18841
19024
|
const error51 = document2.createElement("p");
|
|
@@ -18906,7 +19089,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18906
19089
|
}
|
|
18907
19090
|
|
|
18908
19091
|
// src/settings/shell.css
|
|
18909
|
-
var shell_default = ':host {\n --settings-bg: #181818;\n --settings-sidebar: #1c1c1c;\n --settings-panel: transparent;\n --settings-text: #f5f5f5;\n --settings-muted: #a1a1a1;\n --settings-border: rgb(255 255 255 / 10%);\n --settings-divider: rgb(255 255 255 / 10%);\n --settings-hover: rgb(255 255 255 / 6%);\n --settings-active: rgb(51 156 255 / 12%);\n --settings-focus: #339cff;\n color: var(--settings-text);\n color-scheme: dark;\n font:\n 14px/1.5 system-ui,\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n sans-serif;\n letter-spacing: 0;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n letter-spacing: 0;\n}\n\nbutton,\ninput,\nselect {\n font: inherit;\n}\n\nbutton {\n color: inherit;\n}\n\n[hidden] {\n display: none !important;\n}\n\n.codexhost-settings-dialog {\n width: min(1120px, calc(100vw - 32px));\n height: min(780px, calc(100vh - 32px));\n max-width: none;\n max-height: none;\n margin: auto;\n padding: 0;\n overflow: hidden;\n color: var(--settings-text);\n background: var(--settings-bg);\n border: 1px solid var(--settings-border);\n border-radius: 12px;\n box-shadow: 0 24px 64px rgb(0 0 0 / 38%);\n}\n\n.codexhost-settings-dialog::backdrop {\n background: rgb(0 0 0 / 52%);\n}\n\n.settings-frame,\n.settings-layout {\n width: 100%;\n height: 100%;\n min-width: 0;\n min-height: 0;\n}\n\n.settings-frame {\n display: flex;\n flex-direction: column;\n}\n\n.settings-layout {\n flex: 1;\n display: grid;\n grid-template-columns: 240px minmax(0, 1fr);\n background: var(--settings-bg);\n}\n\n.settings-sidebar {\n display: flex;\n min-width: 0;\n min-height: 0;\n flex-direction: column;\n overflow: hidden;\n background: var(--settings-sidebar);\n border-right: 1px solid var(--settings-border);\n padding-top: 28px;\n}\n\n.settings-header {\n display: flex;\n align-items: center;\n min-width: 0;\n height: 64px;\n flex: none;\n padding: 0 16px;\n border-bottom: 1px solid var(--settings-border);\n}\n\n.settings-header-actions {\n display: flex;\n align-items: center;\n flex: none;\n gap: 12px;\n margin-left: auto;\n}\n\n.settings-icon-button.settings-star-link {\n width: auto;\n gap: 6px;\n padding-inline: 8px;\n font-size: 12px;\n line-height: 18px;\n text-decoration: none;\n border: 2px dashed #f5c542;\n white-space: nowrap;\n}\n\n.settings-star-link .codexhost-settings-icon {\n color: #f5c542;\n fill: currentColor;\n stroke: currentColor;\n}\n\n.settings-brand {\n display: flex;\n align-items: center;\n min-width: 0;\n gap: 8px;\n}\n\n.settings-brand__mark {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n flex: none;\n color: var(--settings-text);\n}\n\n.settings-brand__mark .codexhost-settings-icon {\n width: 32px;\n height: 32px;\n object-fit: contain;\n}\n\n.settings-brand__copy {\n display: flex;\n min-width: 0;\n align-items: baseline;\n gap: 0;\n line-height: 20px;\n}\n\n.settings-brand__name {\n overflow: hidden;\n color: var(--settings-text);\n font-size: 14px;\n font-weight: 500;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.settings-brand__title {\n margin-left: 14px;\n padding-left: 14px;\n color: var(--settings-muted);\n font-size: 14px;\n font-weight: 400;\n border-left: 1px solid var(--settings-border);\n}\n\n.settings-nav {\n display: flex;\n min-width: 0;\n min-height: 0;\n flex: 1;\n flex-direction: column;\n gap: 4px;\n padding: 0 12px 16px;\n overflow-y: auto;\n}\n\n.settings-nav-button {\n display: grid;\n grid-template-columns: 16px minmax(0, 1fr);\n align-items: center;\n width: 100%;\n position: relative;\n min-height: 40px;\n flex: none;\n gap: 12px;\n padding: 8px 12px;\n color: var(--settings-text);\n font-size: 14px;\n line-height: 21px;\n text-align: left;\n background: transparent;\n border: 0;\n border-radius: 10px;\n cursor: pointer;\n}\n\n.settings-nav-button .codexhost-settings-icon {\n width: 18px;\n height: 18px;\n opacity: 0.9;\n}\n\n.settings-nav-button:hover {\n background: var(--settings-hover);\n}\n\n.settings-nav-button[aria-current="page"] {\n background: var(--settings-active);\n color: var(--settings-focus);\n}\n\n.settings-nav-button[aria-current="page"]::before {\n position: absolute;\n left: 0;\n width: 3px;\n height: 22px;\n content: "";\n background: var(--settings-focus);\n border-radius: 0 3px 3px 0;\n}\n\n.settings-nav-button span {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.settings-icon-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n flex: none;\n padding: 0;\n color: var(--settings-muted);\n background: transparent;\n border: 0;\n border-radius: 8px;\n cursor: pointer;\n}\n\n.settings-icon-button:hover {\n color: var(--settings-text);\n background: var(--settings-hover);\n}\n\n.settings-icon-button:focus-visible,\n.settings-nav-button:focus-visible {\n outline: 2px solid var(--settings-focus);\n outline-offset: 1px;\n}\n\n.settings-page {\n display: block;\n position: relative;\n min-width: 0;\n min-height: 0;\n overflow-y: auto;\n background: var(--settings-bg);\n scrollbar-gutter: stable;\n}\n\n.settings-page__content {\n width: min(930px, calc(100% - 80px));\n margin-inline: auto;\n}\n\n.settings-page__content {\n min-width: 0;\n padding: 44px 0 56px;\n}\n\n.settings-section-label {\n min-height: auto;\n padding: 0 0 28px;\n color: var(--settings-text);\n font-size: 24px;\n font-weight: 600;\n line-height: 30px;\n}\n\n.settings-status-list,\n.settings-empty {\n overflow: hidden;\n background: var(--settings-panel);\n}\n\n.settings-status-row {\n display: grid;\n grid-template-columns: minmax(170px, 1fr) auto minmax(280px, 1.45fr);\n position: relative;\n align-items: center;\n min-height: 88px;\n gap: 28px;\n padding: 16px 0;\n}\n\n.settings-status-row:not(:last-child)::after {\n content: "";\n position: absolute;\n right: 0;\n bottom: 0;\n left: 0;\n height: 1px;\n background: var(--settings-divider);\n}\n\n.settings-status-row__identity {\n display: inline-flex;\n align-items: center;\n min-width: 0;\n color: var(--settings-text);\n gap: 14px;\n font-size: 15px;\n font-weight: 500;\n line-height: 22px;\n}\n\n.settings-status-row__icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n flex: none;\n color: var(--settings-muted);\n background: rgb(255 255 255 / 7%);\n border-radius: 50%;\n}\n\n.settings-status-badge {\n flex: none;\n padding: 5px 12px;\n color: var(--settings-muted);\n font-size: 13px;\n font-weight: 500;\n line-height: 18px;\n background: rgb(255 255 255 / 9%);\n border: 1px solid rgb(255 255 255 / 6%);\n border-radius: 6px;\n}\n\n.settings-status-row__detail {\n min-width: 0;\n color: var(--settings-muted);\n font-size: 13px;\n line-height: 20px;\n}\n\n.settings-empty {\n display: flex;\n align-items: center;\n min-height: 72px;\n padding: 12px 16px;\n}\n\n.settings-empty > div {\n display: grid;\n min-width: 0;\n gap: 2px;\n}\n\n.settings-empty strong {\n color: var(--settings-text);\n font-size: 13px;\n font-weight: 500;\n line-height: 19px;\n}\n\n.settings-empty span {\n color: var(--settings-muted);\n font-size: 13px;\n line-height: 19px;\n}\n\n.settings-page-error {\n padding: 16px;\n color: var(--settings-text);\n font-size: 13px;\n background: var(--settings-panel);\n border: 1px solid var(--settings-border);\n border-radius: 20px;\n}\n\n.settings-update-metadata {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 24px;\n margin-bottom: 24px;\n padding: 0 4px 20px;\n border-bottom: 1px solid var(--settings-divider);\n}\n\n.settings-update-metadata__item {\n display: grid;\n min-width: 0;\n gap: 4px;\n}\n\n.settings-update-metadata__item span {\n color: var(--settings-muted);\n font-size: 12px;\n line-height: 18px;\n}\n\n.settings-update-metadata__item strong {\n min-width: 0;\n overflow-wrap: anywhere;\n color: var(--settings-text);\n font-size: 15px;\n font-weight: 500;\n line-height: 22px;\n}\n\n.settings-update-panel {\n display: grid;\n gap: 16px;\n min-height: 128px;\n padding: 20px;\n color: var(--settings-text);\n background: var(--settings-panel);\n border: 1px solid var(--settings-border);\n border-radius: 8px;\n}\n\n.settings-update-panel > strong,\n.settings-update-panel > span,\n.settings-update-summary,\n.settings-update-error {\n margin: 0;\n overflow-wrap: anywhere;\n font-size: 13px;\n line-height: 20px;\n}\n\n.settings-update-panel > span,\n.settings-update-summary {\n color: var(--settings-muted);\n}\n\n.settings-update-error {\n color: #ef4444;\n}\n\n.settings-update-progress {\n width: 100%;\n height: 8px;\n accent-color: #238be8;\n}\n\n.settings-update-progress-detail {\n color: var(--settings-muted);\n font-size: 12px;\n line-height: 18px;\n}\n\n.settings-update-notes {\n max-height: 240px;\n padding: 14px;\n overflow: auto;\n color: var(--settings-muted);\n font-size: 13px;\n line-height: 20px;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n background: rgb(255 255 255 / 4%);\n border: 1px solid var(--settings-divider);\n border-radius: 6px;\n}\n\n.settings-update-version-row {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: center;\n gap: 20px;\n min-height: 32px;\n color: var(--settings-muted);\n font-size: 13px;\n}\n\n.settings-update-version-row strong {\n color: var(--settings-text);\n font-size: 15px;\n}\n\n.settings-update-manual {\n display: grid;\n min-width: 0;\n gap: 6px;\n margin-top: 14px;\n padding-inline: 4px;\n}\n\n.settings-update-manual[hidden] {\n display: none;\n}\n\n.settings-update-manual span {\n color: var(--settings-muted);\n font-size: 12px;\n line-height: 18px;\n}\n\n.settings-update-manual code {\n overflow-wrap: anywhere;\n color: var(--settings-text);\n font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;\n font-size: 12px;\n line-height: 18px;\n}\n\n.settings-update-actions {\n display: flex;\n min-width: 0;\n margin-top: 16px;\n}\n\n.settings-command-button,\n.settings-update-link {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n min-height: 36px;\n gap: 8px;\n padding: 8px 12px;\n color: white;\n font: inherit;\n font-size: 13px;\n text-decoration: none;\n background: #1677d2;\n border: 1px solid #238be8;\n border-radius: 6px;\n cursor: pointer;\n}\n\n.settings-command-button--secondary,\n.settings-update-link {\n color: var(--settings-text);\n background: transparent;\n border-color: var(--settings-border);\n}\n\n.settings-command-button:hover,\n.settings-update-link:hover {\n filter: brightness(1.08);\n}\n\n.settings-command-button:focus-visible,\n.settings-update-link:focus-visible {\n outline: 2px solid var(--settings-focus);\n outline-offset: 2px;\n}\n\n.codexhost-settings-icon {\n display: block;\n flex: none;\n stroke: currentColor;\n}\n\n@media (max-width: 720px) {\n .codexhost-settings-dialog {\n width: calc(100vw - 16px);\n height: calc(100vh - 16px);\n border-radius: 10px;\n }\n\n .settings-layout {\n grid-template-columns: minmax(0, 1fr);\n grid-template-rows: auto minmax(0, 1fr);\n }\n\n .settings-sidebar {\n border-right: 0;\n border-bottom: 1px solid var(--settings-border);\n }\n\n .settings-header {\n height: 56px;\n padding-inline: 14px;\n }\n\n .settings-icon-button.settings-star-link {\n width: 28px;\n padding: 0;\n }\n\n .settings-star-link span {\n display: none;\n }\n\n .settings-sidebar {\n padding-top: 20px;\n }\n\n .settings-nav {\n flex: none;\n flex-direction: row;\n gap: 4px;\n padding: 7px 8px 8px;\n overflow-x: auto;\n overflow-y: hidden;\n }\n\n .settings-nav-button {\n width: auto;\n min-width: max-content;\n min-height: 34px;\n grid-template-columns: 16px auto;\n border-radius: 10px;\n }\n\n .settings-page__content {\n width: calc(100% - 40px);\n }\n\n .settings-page__content {\n padding-top: 32px;\n padding-bottom: 32px;\n }\n\n .settings-section-label {\n padding-bottom: 20px;\n font-size: 20px;\n line-height: 26px;\n }\n\n .settings-status-row {\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 16px;\n }\n\n .settings-status-row__detail {\n grid-column: 1 / -1;\n margin: -8px 0 0 58px;\n }\n}\n\n@media (forced-colors: active) {\n :host,\n :host([data-theme="dark"]) {\n --settings-bg: Canvas;\n --settings-sidebar: Canvas;\n --settings-panel: Canvas;\n --settings-text: CanvasText;\n --settings-muted: GrayText;\n --settings-border: ButtonBorder;\n --settings-divider: ButtonBorder;\n --settings-hover: Highlight;\n --settings-active: Highlight;\n --settings-focus: Highlight;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n *,\n *::before,\n *::after {\n scroll-behavior: auto !important;\n }\n}\n';
|
|
19092
|
+
var shell_default = ':host {\n --settings-bg: #181818;\n --settings-sidebar: #1c1c1c;\n --settings-panel: transparent;\n --settings-text: #f5f5f5;\n --settings-muted: #a1a1a1;\n --settings-border: rgb(255 255 255 / 10%);\n --settings-divider: rgb(255 255 255 / 10%);\n --settings-hover: rgb(255 255 255 / 6%);\n --settings-active: rgb(51 156 255 / 12%);\n --settings-focus: #339cff;\n color: var(--settings-text);\n color-scheme: dark;\n font:\n 14px/1.5 system-ui,\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n sans-serif;\n letter-spacing: 0;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n letter-spacing: 0;\n}\n\nbutton,\ninput,\nselect {\n font: inherit;\n}\n\nbutton {\n color: inherit;\n}\n\n[hidden] {\n display: none !important;\n}\n\n.codexhost-settings-dialog {\n width: min(1120px, calc(100vw - 32px));\n height: min(780px, calc(100vh - 32px));\n max-width: none;\n max-height: none;\n margin: auto;\n padding: 0;\n overflow: hidden;\n color: var(--settings-text);\n background: var(--settings-bg);\n border: 1px solid var(--settings-border);\n border-radius: 12px;\n box-shadow: 0 24px 64px rgb(0 0 0 / 38%);\n}\n\n.codexhost-settings-dialog::backdrop {\n background: rgb(0 0 0 / 52%);\n}\n\n.settings-frame,\n.settings-layout {\n width: 100%;\n height: 100%;\n min-width: 0;\n min-height: 0;\n}\n\n.settings-frame {\n display: flex;\n flex-direction: column;\n}\n\n.settings-layout {\n flex: 1;\n display: grid;\n grid-template-columns: 240px minmax(0, 1fr);\n background: var(--settings-bg);\n}\n\n.settings-sidebar {\n display: flex;\n min-width: 0;\n min-height: 0;\n flex-direction: column;\n overflow: hidden;\n background: var(--settings-sidebar);\n border-right: 1px solid var(--settings-border);\n padding-top: 28px;\n}\n\n.settings-header {\n display: flex;\n align-items: center;\n min-width: 0;\n height: 64px;\n flex: none;\n padding: 0 16px;\n border-bottom: 1px solid var(--settings-border);\n}\n\n.settings-header-actions {\n display: flex;\n align-items: center;\n flex: none;\n gap: 12px;\n margin-left: auto;\n}\n\n.settings-icon-button.settings-star-link {\n width: auto;\n gap: 6px;\n padding-inline: 8px;\n font-size: 12px;\n line-height: 18px;\n text-decoration: none;\n border: 2px dashed #f5c542;\n white-space: nowrap;\n}\n\n.settings-star-link .codexhost-settings-icon {\n color: #f5c542;\n fill: currentColor;\n stroke: currentColor;\n}\n\n.settings-brand {\n display: flex;\n align-items: center;\n min-width: 0;\n gap: 8px;\n}\n\n.settings-brand__mark {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n flex: none;\n color: var(--settings-text);\n}\n\n.settings-brand__mark .codexhost-settings-icon {\n width: 32px;\n height: 32px;\n object-fit: contain;\n}\n\n.settings-brand__copy {\n display: flex;\n min-width: 0;\n align-items: baseline;\n gap: 0;\n line-height: 20px;\n}\n\n.settings-brand__name {\n overflow: hidden;\n color: var(--settings-text);\n font-size: 14px;\n font-weight: 500;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.settings-brand__title {\n margin-left: 14px;\n padding-left: 14px;\n color: var(--settings-muted);\n font-size: 14px;\n font-weight: 400;\n border-left: 1px solid var(--settings-border);\n}\n\n.settings-nav {\n display: flex;\n min-width: 0;\n min-height: 0;\n flex: 1;\n flex-direction: column;\n gap: 4px;\n padding: 0 12px 16px;\n overflow-y: auto;\n}\n\n.settings-nav-button {\n display: grid;\n grid-template-columns: 16px minmax(0, 1fr);\n align-items: center;\n width: 100%;\n position: relative;\n min-height: 40px;\n flex: none;\n gap: 12px;\n padding: 8px 12px;\n color: var(--settings-text);\n font-size: 14px;\n line-height: 21px;\n text-align: left;\n background: transparent;\n border: 0;\n border-radius: 10px;\n cursor: pointer;\n}\n\n.settings-nav-button .codexhost-settings-icon {\n width: 18px;\n height: 18px;\n opacity: 0.9;\n}\n\n.settings-nav-button:hover {\n background: var(--settings-hover);\n}\n\n.settings-nav-button[aria-current="page"] {\n background: var(--settings-active);\n color: var(--settings-focus);\n}\n\n.settings-nav-button[aria-current="page"]::before {\n position: absolute;\n left: 0;\n width: 3px;\n height: 22px;\n content: "";\n background: var(--settings-focus);\n border-radius: 0 3px 3px 0;\n}\n\n.settings-nav-button span {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.settings-icon-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n flex: none;\n padding: 0;\n color: var(--settings-muted);\n background: transparent;\n border: 0;\n border-radius: 8px;\n cursor: pointer;\n}\n\n.settings-icon-button:hover {\n color: var(--settings-text);\n background: var(--settings-hover);\n}\n\n.settings-icon-button:focus-visible,\n.settings-nav-button:focus-visible {\n outline: 2px solid var(--settings-focus);\n outline-offset: 1px;\n}\n\n.settings-page {\n display: block;\n position: relative;\n min-width: 0;\n min-height: 0;\n overflow-y: auto;\n background: var(--settings-bg);\n scrollbar-gutter: stable;\n}\n\n.settings-page__content {\n width: min(930px, calc(100% - 80px));\n margin-inline: auto;\n}\n\n.settings-page__content {\n min-width: 0;\n padding: 44px 0 56px;\n}\n\n.settings-section-label {\n min-height: auto;\n padding: 0 0 28px;\n color: var(--settings-text);\n font-size: 24px;\n font-weight: 600;\n line-height: 30px;\n}\n\n.settings-status-list,\n.settings-empty {\n overflow: hidden;\n background: var(--settings-panel);\n}\n\n.settings-status-row {\n display: grid;\n grid-template-columns: minmax(170px, 1fr) auto minmax(280px, 1.45fr);\n position: relative;\n align-items: center;\n min-height: 88px;\n gap: 28px;\n padding: 16px 0;\n}\n\n.settings-status-row:not(:last-child)::after {\n content: "";\n position: absolute;\n right: 0;\n bottom: 0;\n left: 0;\n height: 1px;\n background: var(--settings-divider);\n}\n\n.settings-status-row__identity {\n display: inline-flex;\n align-items: center;\n min-width: 0;\n color: var(--settings-text);\n gap: 14px;\n font-size: 15px;\n font-weight: 500;\n line-height: 22px;\n}\n\n.settings-status-row__icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n flex: none;\n color: var(--settings-muted);\n background: rgb(255 255 255 / 7%);\n border-radius: 50%;\n}\n\n.settings-status-badge {\n flex: none;\n padding: 5px 12px;\n color: var(--settings-muted);\n font-size: 13px;\n font-weight: 500;\n line-height: 18px;\n background: rgb(255 255 255 / 9%);\n border: 1px solid rgb(255 255 255 / 6%);\n border-radius: 6px;\n}\n\n.settings-status-row__detail {\n min-width: 0;\n color: var(--settings-muted);\n font-size: 13px;\n line-height: 20px;\n}\n\n.settings-empty {\n display: flex;\n align-items: center;\n min-height: 72px;\n padding: 12px 16px;\n}\n\n.settings-empty > div {\n display: grid;\n min-width: 0;\n gap: 2px;\n}\n\n.settings-empty strong {\n color: var(--settings-text);\n font-size: 13px;\n font-weight: 500;\n line-height: 19px;\n}\n\n.settings-empty span {\n color: var(--settings-muted);\n font-size: 13px;\n line-height: 19px;\n}\n\n.settings-page-error {\n padding: 16px;\n color: var(--settings-text);\n font-size: 13px;\n background: var(--settings-panel);\n border: 1px solid var(--settings-border);\n border-radius: 20px;\n}\n\n.settings-update-metadata {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 24px;\n margin-bottom: 24px;\n padding: 0 4px 20px;\n border-bottom: 1px solid var(--settings-divider);\n}\n\n.settings-update-metadata__item {\n display: grid;\n min-width: 0;\n gap: 4px;\n}\n\n.settings-update-metadata__item span {\n color: var(--settings-muted);\n font-size: 12px;\n line-height: 18px;\n}\n\n.settings-update-metadata__item strong {\n min-width: 0;\n overflow-wrap: anywhere;\n color: var(--settings-text);\n font-size: 15px;\n font-weight: 500;\n line-height: 22px;\n}\n\n.settings-update-panel {\n display: grid;\n gap: 16px;\n min-height: 128px;\n padding: 20px;\n color: var(--settings-text);\n background: var(--settings-panel);\n border: 1px solid var(--settings-border);\n border-radius: 8px;\n}\n\n.settings-update-panel > strong,\n.settings-update-panel > span,\n.settings-update-summary,\n.settings-update-error {\n margin: 0;\n overflow-wrap: anywhere;\n font-size: 13px;\n line-height: 20px;\n}\n\n.settings-update-panel > span,\n.settings-update-summary {\n color: var(--settings-muted);\n}\n\n.settings-update-error {\n color: #ef4444;\n}\n\n.settings-update-progress {\n width: 100%;\n height: 8px;\n accent-color: #238be8;\n}\n\n.settings-update-progress-detail {\n color: var(--settings-muted);\n font-size: 12px;\n line-height: 18px;\n}\n\n.settings-update-notes {\n display: grid;\n gap: 10px;\n max-height: 320px;\n overflow: auto;\n color: var(--settings-muted);\n font-size: 13px;\n line-height: 20px;\n overflow-wrap: anywhere;\n}\n\n.settings-update-notes > :first-child {\n margin-top: 0;\n}\n\n.settings-update-notes > :last-child {\n margin-bottom: 0;\n}\n\n.settings-update-notes h1,\n.settings-update-notes h2,\n.settings-update-notes h3,\n.settings-update-notes h4,\n.settings-update-notes h5,\n.settings-update-notes h6 {\n margin: 6px 0 0;\n color: var(--settings-text);\n font-weight: 600;\n}\n\n.settings-update-notes h1 {\n font-size: 16px;\n line-height: 24px;\n}\n\n.settings-update-notes h2 {\n font-size: 15px;\n line-height: 22px;\n}\n\n.settings-update-notes h3,\n.settings-update-notes h4,\n.settings-update-notes h5,\n.settings-update-notes h6 {\n font-size: 13px;\n line-height: 20px;\n}\n\n.settings-update-notes p,\n.settings-update-notes ul,\n.settings-update-notes ol,\n.settings-update-notes pre {\n margin: 0;\n}\n\n.settings-update-notes ul,\n.settings-update-notes ol {\n padding-left: 20px;\n}\n\n.settings-update-notes li + li {\n margin-top: 4px;\n}\n\n.settings-update-notes strong {\n color: var(--settings-text);\n font-weight: 600;\n}\n\n.settings-update-notes a {\n color: #7cb8ff;\n text-decoration: none;\n}\n\n.settings-update-notes a:hover {\n text-decoration: underline;\n}\n\n.settings-update-notes code {\n font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;\n font-size: 12px;\n}\n\n.settings-update-notes :not(pre) > code {\n padding: 1px 5px;\n background: rgb(255 255 255 / 8%);\n border-radius: 4px;\n}\n\n.settings-update-notes pre {\n padding: 10px 12px;\n overflow: auto;\n background: rgb(0 0 0 / 28%);\n border-radius: 6px;\n}\n\n.settings-update-notes pre code {\n line-height: 18px;\n white-space: pre-wrap;\n}\n\n.settings-update-version-row {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: center;\n gap: 20px;\n min-height: 32px;\n color: var(--settings-muted);\n font-size: 13px;\n}\n\n.settings-update-version-row strong {\n color: var(--settings-text);\n font-size: 15px;\n}\n\n.settings-update-manual {\n display: grid;\n min-width: 0;\n gap: 6px;\n margin-top: 14px;\n padding-inline: 4px;\n}\n\n.settings-update-manual[hidden] {\n display: none;\n}\n\n.settings-update-manual span {\n color: var(--settings-muted);\n font-size: 12px;\n line-height: 18px;\n}\n\n.settings-update-manual code {\n overflow-wrap: anywhere;\n color: var(--settings-text);\n font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;\n font-size: 12px;\n line-height: 18px;\n}\n\n.settings-update-actions {\n display: flex;\n min-width: 0;\n margin-top: 16px;\n}\n\n.settings-command-button,\n.settings-update-link {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n min-height: 36px;\n gap: 8px;\n padding: 8px 12px;\n color: white;\n font: inherit;\n font-size: 13px;\n text-decoration: none;\n background: #1677d2;\n border: 1px solid #238be8;\n border-radius: 6px;\n cursor: pointer;\n}\n\n.settings-command-button--secondary,\n.settings-update-link {\n color: var(--settings-text);\n background: transparent;\n border-color: var(--settings-border);\n}\n\n.settings-command-button:hover,\n.settings-update-link:hover {\n filter: brightness(1.08);\n}\n\n.settings-command-button:focus-visible,\n.settings-update-link:focus-visible {\n outline: 2px solid var(--settings-focus);\n outline-offset: 2px;\n}\n\n.codexhost-settings-icon {\n display: block;\n flex: none;\n stroke: currentColor;\n}\n\n@media (max-width: 720px) {\n .codexhost-settings-dialog {\n width: calc(100vw - 16px);\n height: calc(100vh - 16px);\n border-radius: 10px;\n }\n\n .settings-layout {\n grid-template-columns: minmax(0, 1fr);\n grid-template-rows: auto minmax(0, 1fr);\n }\n\n .settings-sidebar {\n border-right: 0;\n border-bottom: 1px solid var(--settings-border);\n }\n\n .settings-header {\n height: 56px;\n padding-inline: 14px;\n }\n\n .settings-icon-button.settings-star-link {\n width: 28px;\n padding: 0;\n }\n\n .settings-star-link span {\n display: none;\n }\n\n .settings-sidebar {\n padding-top: 20px;\n }\n\n .settings-nav {\n flex: none;\n flex-direction: row;\n gap: 4px;\n padding: 7px 8px 8px;\n overflow-x: auto;\n overflow-y: hidden;\n }\n\n .settings-nav-button {\n width: auto;\n min-width: max-content;\n min-height: 34px;\n grid-template-columns: 16px auto;\n border-radius: 10px;\n }\n\n .settings-page__content {\n width: calc(100% - 40px);\n }\n\n .settings-page__content {\n padding-top: 32px;\n padding-bottom: 32px;\n }\n\n .settings-section-label {\n padding-bottom: 20px;\n font-size: 20px;\n line-height: 26px;\n }\n\n .settings-status-row {\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 16px;\n }\n\n .settings-status-row__detail {\n grid-column: 1 / -1;\n margin: -8px 0 0 58px;\n }\n}\n\n@media (forced-colors: active) {\n :host,\n :host([data-theme="dark"]) {\n --settings-bg: Canvas;\n --settings-sidebar: Canvas;\n --settings-panel: Canvas;\n --settings-text: CanvasText;\n --settings-muted: GrayText;\n --settings-border: ButtonBorder;\n --settings-divider: ButtonBorder;\n --settings-hover: Highlight;\n --settings-active: Highlight;\n --settings-focus: Highlight;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n *,\n *::before,\n *::after {\n scroll-behavior: auto !important;\n }\n}\n';
|
|
18910
19093
|
|
|
18911
19094
|
// src/settings/shell.ts
|
|
18912
19095
|
var SETTINGS_SHELL_ATTRIBUTE = "data-codexhost-settings-shell";
|
|
@@ -19553,8 +19736,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19553
19736
|
const index = Math.max(0, Math.min(Math.trunc(attempt), rendererUsageRefreshDelays.length - 1));
|
|
19554
19737
|
return rendererUsageRefreshDelays[index] ?? rendererUsageRefreshDelays[0];
|
|
19555
19738
|
}
|
|
19556
|
-
function shouldRetryExternalThreadUsage(agent, usage) {
|
|
19557
|
-
|
|
19739
|
+
function shouldRetryExternalThreadUsage(agent, usage, accountCredits = null) {
|
|
19740
|
+
if (agent === "codex") return false;
|
|
19741
|
+
if (usage === null) return true;
|
|
19742
|
+
return agent === "grok" && accountCredits === null;
|
|
19558
19743
|
}
|
|
19559
19744
|
function selectableThinkingOptionId(state) {
|
|
19560
19745
|
return state.effectiveThinkingOptionId && state.availableThinkingOptions?.some(({ id }) => id === state.effectiveThinkingOptionId) ? state.effectiveThinkingOptionId : void 0;
|
|
@@ -19742,7 +19927,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19742
19927
|
harnessAvailability,
|
|
19743
19928
|
mounted.modelView,
|
|
19744
19929
|
mounted.permissionModeView,
|
|
19745
|
-
mounted.usage
|
|
19930
|
+
mounted.usage,
|
|
19931
|
+
mounted.accountCredits
|
|
19746
19932
|
);
|
|
19747
19933
|
};
|
|
19748
19934
|
const applyThreadUsageUpdate = (update) => {
|
|
@@ -19750,6 +19936,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19750
19936
|
if (threadIdFromComposerModelTarget(mounted.modelTarget) !== update.threadId) continue;
|
|
19751
19937
|
mounted.usageRequestGeneration += 1;
|
|
19752
19938
|
mounted.usage = update.usage;
|
|
19939
|
+
mounted.accountCredits = update.accountCredits ?? null;
|
|
19753
19940
|
usageRefreshAttempts.delete(mounted.composer);
|
|
19754
19941
|
renderMounted(mounted);
|
|
19755
19942
|
}
|
|
@@ -19758,6 +19945,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19758
19945
|
const threadId = threadIdFromComposerModelTarget(mounted.modelTarget);
|
|
19759
19946
|
if (!threadId || !modelControl || controller.get(mounted.composer).agent === "codex") {
|
|
19760
19947
|
mounted.usage = null;
|
|
19948
|
+
mounted.accountCredits = null;
|
|
19761
19949
|
usageRefreshAttempts.delete(mounted.composer);
|
|
19762
19950
|
renderMounted(mounted);
|
|
19763
19951
|
return;
|
|
@@ -19769,15 +19957,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19769
19957
|
return;
|
|
19770
19958
|
}
|
|
19771
19959
|
mounted.usage = result.usage;
|
|
19772
|
-
|
|
19960
|
+
mounted.accountCredits = result.accountCredits ?? null;
|
|
19961
|
+
const agent = controller.get(mounted.composer).agent;
|
|
19962
|
+
if (result.usage !== null && (agent !== "grok" || result.accountCredits)) {
|
|
19963
|
+
usageRefreshAttempts.delete(mounted.composer);
|
|
19964
|
+
}
|
|
19773
19965
|
renderMounted(mounted);
|
|
19774
|
-
if (shouldRetryExternalThreadUsage(
|
|
19966
|
+
if (shouldRetryExternalThreadUsage(
|
|
19967
|
+
controller.get(mounted.composer).agent,
|
|
19968
|
+
result.usage,
|
|
19969
|
+
result.accountCredits ?? null
|
|
19970
|
+
)) {
|
|
19775
19971
|
scheduleThreadUsageRefresh(mounted);
|
|
19776
19972
|
}
|
|
19777
19973
|
} catch {
|
|
19778
19974
|
if (mountedByComposer.get(mounted.composer) === mounted && mounted.usageRequestGeneration === generation) {
|
|
19779
19975
|
renderMounted(mounted);
|
|
19780
|
-
if (shouldRetryExternalThreadUsage(controller.get(mounted.composer).agent, null)) {
|
|
19976
|
+
if (shouldRetryExternalThreadUsage(controller.get(mounted.composer).agent, null, null)) {
|
|
19781
19977
|
scheduleThreadUsageRefresh(mounted);
|
|
19782
19978
|
}
|
|
19783
19979
|
}
|
|
@@ -19866,7 +20062,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19866
20062
|
} finally {
|
|
19867
20063
|
if (isCurrentOwnershipRequest(mounted, generation)) {
|
|
19868
20064
|
renderMounted(mounted);
|
|
19869
|
-
if (mounted.ownershipStatus !== "error" && shouldRetryExternalThreadUsage(
|
|
20065
|
+
if (mounted.ownershipStatus !== "error" && shouldRetryExternalThreadUsage(
|
|
20066
|
+
controller.get(mounted.composer).agent,
|
|
20067
|
+
mounted.usage,
|
|
20068
|
+
mounted.accountCredits
|
|
20069
|
+
)) {
|
|
19870
20070
|
scheduleThreadUsageRefresh(mounted);
|
|
19871
20071
|
}
|
|
19872
20072
|
}
|
|
@@ -19891,7 +20091,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19891
20091
|
if (resolution === "transfer") {
|
|
19892
20092
|
mounted.ownershipStatus = "ready";
|
|
19893
20093
|
renderMounted(mounted);
|
|
19894
|
-
if (shouldRetryExternalThreadUsage(controller.get(mounted.composer).agent, null)) {
|
|
20094
|
+
if (shouldRetryExternalThreadUsage(controller.get(mounted.composer).agent, null, null)) {
|
|
19895
20095
|
scheduleThreadUsageRefresh(mounted);
|
|
19896
20096
|
}
|
|
19897
20097
|
} else {
|
|
@@ -19901,6 +20101,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19901
20101
|
mounted.threadConfiguration = void 0;
|
|
19902
20102
|
mounted.ownershipStatus = "loading";
|
|
19903
20103
|
mounted.usage = null;
|
|
20104
|
+
mounted.accountCredits = null;
|
|
19904
20105
|
mounted.usageRequestGeneration += 1;
|
|
19905
20106
|
usageRefreshAttempts.delete(mounted.composer);
|
|
19906
20107
|
if (previousTarget?.[0] === "conversation") renderMounted(mounted);
|
|
@@ -20438,11 +20639,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20438
20639
|
const refreshHarnessAvailability = (refresh = false) => {
|
|
20439
20640
|
if (!modelControl) return Promise.resolve();
|
|
20440
20641
|
const client = modelControl;
|
|
20642
|
+
if (availabilityRequest?.client === client) return availabilityRequest.promise;
|
|
20441
20643
|
harnessAvailability = Object.fromEntries(
|
|
20442
|
-
externalAgents.map((agent) => [
|
|
20644
|
+
externalAgents.map((agent) => [
|
|
20645
|
+
agent,
|
|
20646
|
+
harnessAvailability[agent] === "ready" ? "ready" : "checking"
|
|
20647
|
+
])
|
|
20443
20648
|
);
|
|
20444
20649
|
for (const mounted of mountedByComposer.values()) renderMounted(mounted);
|
|
20445
|
-
if (availabilityRequest?.client === client) return availabilityRequest.promise;
|
|
20446
20650
|
const generation = ++availabilityRequestGeneration;
|
|
20447
20651
|
const promise2 = (async () => {
|
|
20448
20652
|
await Promise.all(
|
|
@@ -20538,6 +20742,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20538
20742
|
ownershipStatus: threadIdFromComposerModelTarget(modelTarget) ? inherited ? "ready" : "loading" : "not-required",
|
|
20539
20743
|
threadConfiguration: inherited?.threadConfiguration,
|
|
20540
20744
|
usage: inherited?.usage ?? null,
|
|
20745
|
+
accountCredits: inherited?.accountCredits ?? null,
|
|
20541
20746
|
usageRequestGeneration: 0
|
|
20542
20747
|
};
|
|
20543
20748
|
mountedByComposer.set(composer, mounted);
|
|
@@ -20553,7 +20758,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20553
20758
|
renderMounted(mounted);
|
|
20554
20759
|
if (threadIdFromComposerModelTarget(modelTarget) && !inherited) {
|
|
20555
20760
|
void loadThreadOwnership(mounted);
|
|
20556
|
-
} else if (threadIdFromComposerModelTarget(modelTarget) && inherited && shouldRetryExternalThreadUsage(state.agent, mounted.usage)) {
|
|
20761
|
+
} else if (threadIdFromComposerModelTarget(modelTarget) && inherited && shouldRetryExternalThreadUsage(state.agent, mounted.usage, mounted.accountCredits)) {
|
|
20557
20762
|
scheduleThreadUsageRefresh(mounted);
|
|
20558
20763
|
} else if (state.agent !== "codex" && !isExternalConfigurationReady(mounted)) {
|
|
20559
20764
|
void loadExternalCatalog(mounted);
|
package/bin/codexhost
CHANGED
|
Binary file
|
package/libexec/codexhost-shim
CHANGED
|
Binary file
|
|
Binary file
|