@codexhost/cli-darwin-x64 0.14.0 → 0.15.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.
@@ -3266,10 +3266,10 @@
3266
3266
  const shape = def.shape;
3267
3267
  const propValues = {};
3268
3268
  for (const key in shape) {
3269
- const field = shape[key]._zod;
3270
- if (field.values) {
3269
+ const field2 = shape[key]._zod;
3270
+ if (field2.values) {
3271
3271
  propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
3272
- for (const v of field.values)
3272
+ for (const v of field2.values)
3273
3273
  propValues[key].add(v);
3274
3274
  }
3275
3275
  }
@@ -15059,6 +15059,53 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15059
15059
  var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
15060
15060
  var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
15061
15061
 
15062
+ // ../shared-contracts/dist/thread-questions.js
15063
+ var THREAD_QUESTIONS_LIST_METHOD = "codexhost/thread/questions/list";
15064
+ var THREAD_QUESTION_RESPOND_METHOD = "codexhost/thread/question/respond";
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
  // ../shared-contracts/dist/console.js
15063
15110
  var consoleAnnouncementSchema = external_exports.strictObject({
15064
15111
  title: external_exports.string().trim().min(1).max(200),
@@ -16309,6 +16356,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16309
16356
  const candidates = [...urls].sort(
16310
16357
  (a, b) => Number(b.includes("/app-shared-")) - Number(a.includes("/app-shared-"))
16311
16358
  );
16359
+ const matches = /* @__PURE__ */ new Set();
16312
16360
  for (const url2 of candidates) {
16313
16361
  let module;
16314
16362
  try {
@@ -16316,11 +16364,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16316
16364
  } catch {
16317
16365
  continue;
16318
16366
  }
16319
- const matches = new Set(Object.values(module).filter(matchesServices));
16367
+ for (const value of Object.values(module).filter(matchesServices)) matches.add(value);
16320
16368
  if (matches.size > 1) throw new Error("Codex native services are unavailable in this window");
16321
- if (matches.size === 1) return [...matches][0] ?? null;
16322
16369
  }
16323
- return null;
16370
+ return [...matches][0] ?? null;
16324
16371
  }
16325
16372
 
16326
16373
  // src/codex-ssh-services.ts
@@ -16588,6 +16635,545 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16588
16635
  return control;
16589
16636
  }
16590
16637
 
16638
+ // ../../node_modules/lucide/dist/esm/defaultAttributes.mjs
16639
+ var defaultAttributes = {
16640
+ xmlns: "http://www.w3.org/2000/svg",
16641
+ width: 24,
16642
+ height: 24,
16643
+ viewBox: "0 0 24 24",
16644
+ fill: "none",
16645
+ stroke: "currentColor",
16646
+ "stroke-width": 2,
16647
+ "stroke-linecap": "round",
16648
+ "stroke-linejoin": "round"
16649
+ };
16650
+
16651
+ // ../../node_modules/lucide/dist/esm/createElement.mjs
16652
+ var createSVGElement = ([tag, attrs, children]) => {
16653
+ const element = document.createElementNS("http://www.w3.org/2000/svg", tag);
16654
+ Object.keys(attrs).forEach((name) => {
16655
+ element.setAttribute(name, String(attrs[name]));
16656
+ });
16657
+ if (children?.length) {
16658
+ children.forEach((child) => {
16659
+ const childElement = createSVGElement(child);
16660
+ element.appendChild(childElement);
16661
+ });
16662
+ }
16663
+ return element;
16664
+ };
16665
+ var createElement = (iconNode, customAttrs = {}) => {
16666
+ const tag = "svg";
16667
+ const attrs = {
16668
+ ...defaultAttributes,
16669
+ ...customAttrs
16670
+ };
16671
+ return createSVGElement([tag, attrs, iconNode]);
16672
+ };
16673
+
16674
+ // ../../node_modules/lucide/dist/esm/icons/check.mjs
16675
+ var Check = [["path", { d: "M20 6 9 17l-5-5" }]];
16676
+
16677
+ // ../../node_modules/lucide/dist/esm/icons/message-circle-question-mark.mjs
16678
+ var MessageCircleQuestionMark = [
16679
+ [
16680
+ "path",
16681
+ {
16682
+ d: "M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719"
16683
+ }
16684
+ ],
16685
+ ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }],
16686
+ ["path", { d: "M12 17h.01" }]
16687
+ ];
16688
+
16689
+ // ../../node_modules/lucide/dist/esm/icons/pencil.mjs
16690
+ var Pencil = [
16691
+ [
16692
+ "path",
16693
+ {
16694
+ d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"
16695
+ }
16696
+ ],
16697
+ ["path", { d: "m15 5 4 4" }]
16698
+ ];
16699
+
16700
+ // ../../node_modules/lucide/dist/esm/icons/x.mjs
16701
+ var X = [
16702
+ ["path", { d: "M18 6 6 18" }],
16703
+ ["path", { d: "m6 6 12 12" }]
16704
+ ];
16705
+
16706
+ // src/renderer-question-card-style.ts
16707
+ var QUESTION_CARD_CSS = `
16708
+ :host {
16709
+ display: block;
16710
+ min-width: 0;
16711
+ margin: 8px 0;
16712
+ color-scheme: inherit;
16713
+ --question-text: light-dark(#171717, #ececec);
16714
+ --question-muted: light-dark(#737373, #a3a3a3);
16715
+ --question-border: light-dark(rgb(0 0 0 / 8%), rgb(255 255 255 / 8%));
16716
+ --question-selected: light-dark(#e9e9e9, #333333);
16717
+ --question-primary: light-dark(#202020, #ececec);
16718
+ --question-primary-text: light-dark(#fff, #171717);
16719
+ }
16720
+ *, ::before, ::after { box-sizing: border-box; }
16721
+ .card {
16722
+ display: flex;
16723
+ flex-direction: column;
16724
+ max-height: min(60vh, 560px);
16725
+ overflow: hidden;
16726
+ padding: 16px 12px 12px;
16727
+ border: 1px solid var(--question-border);
16728
+ border-radius: 24px;
16729
+ background: light-dark(#f7f7f7, #262626);
16730
+ color: var(--question-text);
16731
+ font: 13px/1.5 system-ui, sans-serif;
16732
+ }
16733
+ .title { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin: 0 6px 14px; color: var(--question-muted); font-weight: 400; }
16734
+ .question-icon { display: inline-flex; justify-content: center; align-items: center; width: 16px; height: 16px; flex-shrink: 0; }
16735
+ svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
16736
+ .body { min-height: 0; overflow: auto; }
16737
+ fieldset { min-width: 0; border: 0; padding: 0; margin: 0 0 14px; }
16738
+ fieldset:last-child { margin-bottom: 0; }
16739
+ legend { width: 100%; padding: 0 6px; margin-bottom: 14px; font: inherit; }
16740
+ .hint { color: var(--question-muted); font-size: 12px; margin: -10px 6px 10px; }
16741
+ .option {
16742
+ position: relative;
16743
+ display: flex;
16744
+ align-items: flex-start;
16745
+ gap: 10px;
16746
+ min-height: 34px;
16747
+ padding: 6px;
16748
+ margin: 2px 0;
16749
+ border-radius: 12px;
16750
+ cursor: pointer;
16751
+ background: transparent;
16752
+ overflow-wrap: anywhere;
16753
+ }
16754
+ .option:hover, .option:has(:checked) { background: var(--question-selected); }
16755
+ input[type=checkbox], input[type=radio] {
16756
+ appearance: none;
16757
+ display: block;
16758
+ flex: 0 0 21px;
16759
+ width: 21px;
16760
+ height: 21px;
16761
+ margin: 0;
16762
+ padding: 0;
16763
+ border: 1px solid var(--question-border);
16764
+ border-radius: 5px;
16765
+ background: light-dark(#ededed, #303030);
16766
+ cursor: pointer;
16767
+ }
16768
+ .shortcut { position: absolute; top: 6px; left: 6px; width: 21px; height: 21px; text-align: center; line-height: 21px; color: var(--question-muted); pointer-events: none; font-size: 12px; }
16769
+ .option-copy { flex: 1; min-width: 0; white-space: pre-wrap; }
16770
+ .option-name { display: block; font-weight: 400; }
16771
+ .description { display: block; color: var(--question-muted); font-size: 12px; margin-top: 1px; }
16772
+ .selected-indicator { align-self: center; visibility: hidden; color: var(--question-muted); padding-right: 4px; }
16773
+ :checked ~ .selected-indicator { visibility: visible; }
16774
+ .other { align-items: center; flex: 1; min-width: 0; margin: 0; }
16775
+ .other input[type=checkbox], .other input[type=radio] { background: transparent; border-color: transparent; }
16776
+ .other:has(:checked), .other:focus-within { background: var(--question-selected); }
16777
+ .other:has(:checked) .pencil { color: var(--question-text); }
16778
+ .pencil { display: flex; align-items: center; justify-content: center; }
16779
+ .other-copy { display: flex; flex: 1; min-width: 0; }
16780
+ input:not([type=checkbox]):not([type=radio]), textarea {
16781
+ appearance: none;
16782
+ display: block;
16783
+ min-width: 0;
16784
+ width: 100%;
16785
+ padding: 6px;
16786
+ border: 1px solid var(--question-border);
16787
+ border-radius: 8px;
16788
+ background: transparent;
16789
+ color: var(--question-text);
16790
+ font: inherit;
16791
+ }
16792
+ .other-copy input:not([type=checkbox]):not([type=radio]) { border: 0; padding: 0; }
16793
+ textarea { min-height: 60px; resize: vertical; }
16794
+ input::placeholder, textarea::placeholder { color: var(--question-muted); opacity: .65; }
16795
+ input:focus-visible, textarea:focus-visible, button:focus-visible {
16796
+ outline: 2px solid var(--question-muted);
16797
+ outline-offset: 2px;
16798
+ }
16799
+ .other-copy input:focus-visible { outline: none; }
16800
+ .other:has(input:focus-visible) { outline: 2px solid var(--question-muted); outline-offset: -2px; }
16801
+ .error { flex-shrink: 0; color: light-dark(#b42318, #ffaaa3); font-size: 12px; }
16802
+ .error:not(:empty) { margin: 8px 6px 0; }
16803
+ .footer { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-top: 8px; }
16804
+ .actions { display: flex; justify-content: flex-end; gap: 8px; margin-left: auto; flex-shrink: 0; }
16805
+ button {
16806
+ appearance: none;
16807
+ min-height: 28px;
16808
+ padding: 3px 10px;
16809
+ border: 1px solid var(--question-border);
16810
+ border-radius: 999px;
16811
+ background: transparent;
16812
+ color: var(--question-text);
16813
+ font: inherit;
16814
+ font-weight: 400;
16815
+ cursor: pointer;
16816
+ }
16817
+ button:hover { background: var(--question-selected); }
16818
+ button.primary { background: var(--question-primary); color: var(--question-primary-text); border-color: transparent; }
16819
+ button.primary:hover { opacity: .85; }
16820
+ button.dismiss { display: flex; align-items: center; justify-content: center; border: 0; padding: 0; min-height: 24px; width: 24px; margin-left: auto; color: var(--question-muted); }
16821
+ :disabled { cursor: wait; opacity: .5; }
16822
+ @media (max-width: 420px) { .footer { flex-wrap: wrap; } .footer > .other { flex-basis: 100%; } }
16823
+ @media (forced-colors: active) {
16824
+ .card, input, textarea { background: Canvas; color: CanvasText; }
16825
+ button, .card, input[type=checkbox], input[type=radio] { border-color: ButtonBorder; }
16826
+ .option:has(:checked) { outline: 1px solid Highlight; outline-offset: -1px; }
16827
+ button.primary { background: Highlight; color: HighlightText; }
16828
+ }
16829
+ `;
16830
+
16831
+ // src/renderer-question-card.ts
16832
+ function createQuestionCard(document2, question, submit, initial = {}) {
16833
+ const icon2 = (node) => document2.adoptNode(
16834
+ createElement(node, {
16835
+ width: 16,
16836
+ height: 16,
16837
+ "aria-hidden": "true",
16838
+ focusable: "false"
16839
+ })
16840
+ );
16841
+ const selectedIndicator = () => {
16842
+ const selected = document2.createElement("span");
16843
+ selected.className = "selected-indicator";
16844
+ selected.setAttribute("aria-hidden", "true");
16845
+ selected.append(icon2(Check));
16846
+ return selected;
16847
+ };
16848
+ const root = document2.createElement("section");
16849
+ root.dataset.codexhostQuestion = question.interactionId;
16850
+ root.setAttribute("aria-label", question.title ?? "Question");
16851
+ root.addEventListener("keydown", (event) => {
16852
+ event.stopPropagation();
16853
+ if (event.key === "Enter" && event.composedPath()[0] instanceof HTMLInputElement)
16854
+ event.preventDefault();
16855
+ });
16856
+ const shadow = root.attachShadow({ mode: "open" });
16857
+ const style = document2.createElement("style");
16858
+ style.textContent = QUESTION_CARD_CSS;
16859
+ const surface = document2.createElement("div");
16860
+ surface.className = "card";
16861
+ shadow.append(style, surface);
16862
+ const title = document2.createElement("div");
16863
+ title.className = "title";
16864
+ const titleIcon = document2.createElement("span");
16865
+ titleIcon.className = "question-icon";
16866
+ titleIcon.append(icon2(MessageCircleQuestionMark));
16867
+ titleIcon.setAttribute("aria-hidden", "true");
16868
+ const titleText = document2.createElement("span");
16869
+ titleText.textContent = question.title?.trim() || "Question";
16870
+ const dismiss = document2.createElement("button");
16871
+ dismiss.type = "button";
16872
+ dismiss.className = "dismiss";
16873
+ dismiss.append(icon2(X));
16874
+ dismiss.setAttribute("aria-label", "Dismiss question");
16875
+ title.append(titleIcon, titleText, dismiss);
16876
+ const body = document2.createElement("div");
16877
+ body.className = "body";
16878
+ surface.append(title, body);
16879
+ const footer = document2.createElement("div");
16880
+ footer.className = "footer";
16881
+ const readers = /* @__PURE__ */ new Map();
16882
+ const controls = [dismiss];
16883
+ const validOther = [];
16884
+ for (const [index, field2] of question.questions.entries()) {
16885
+ const group = document2.createElement("fieldset");
16886
+ const legend = document2.createElement("legend");
16887
+ legend.textContent = field2.prompt;
16888
+ group.append(legend);
16889
+ const saved = initial[field2.id] ?? [];
16890
+ if (field2.type === "text") {
16891
+ const input = document2.createElement(field2.multiline ? "textarea" : "input");
16892
+ input.value = saved[0] ?? field2.prefill ?? "";
16893
+ input.placeholder = field2.placeholder ?? "Your answer";
16894
+ input.setAttribute("aria-label", field2.prompt);
16895
+ controls.push(input);
16896
+ group.append(input);
16897
+ readers.set(field2.id, () => input.value.trim() ? [input.value] : []);
16898
+ } else {
16899
+ const hint = document2.createElement("div");
16900
+ hint.className = "hint";
16901
+ hint.textContent = "Select all that apply";
16902
+ if (field2.multiple) group.append(hint);
16903
+ const inputs = [];
16904
+ const name = `codexhost-${question.interactionId}-${index}`;
16905
+ for (const [optionIndex, option] of field2.options.entries()) {
16906
+ const label = document2.createElement("label");
16907
+ label.className = "option";
16908
+ const input = document2.createElement("input");
16909
+ input.type = field2.multiple ? "checkbox" : "radio";
16910
+ input.name = name;
16911
+ input.value = option.value;
16912
+ input.checked = saved.includes(option.value);
16913
+ const shortcut = document2.createElement("span");
16914
+ shortcut.className = "shortcut";
16915
+ shortcut.setAttribute("aria-hidden", "true");
16916
+ shortcut.textContent = String(optionIndex + 1);
16917
+ const selected = selectedIndicator();
16918
+ const text = document2.createElement("span");
16919
+ text.className = "option-copy";
16920
+ const optionName = document2.createElement("span");
16921
+ optionName.className = "option-name";
16922
+ optionName.textContent = option.label;
16923
+ text.append(optionName);
16924
+ if (option.description) {
16925
+ const description = document2.createElement("span");
16926
+ description.className = "description";
16927
+ description.textContent = option.description;
16928
+ text.append(description);
16929
+ }
16930
+ label.append(input, shortcut, text, selected);
16931
+ group.append(label);
16932
+ inputs.push(input);
16933
+ controls.push(input);
16934
+ }
16935
+ let other;
16936
+ let notes;
16937
+ if (field2.allowOther) {
16938
+ const label = document2.createElement("label");
16939
+ label.className = "option other";
16940
+ other = document2.createElement("input");
16941
+ other.type = field2.multiple ? "checkbox" : "radio";
16942
+ other.name = name;
16943
+ other.setAttribute("aria-label", `Other: ${field2.prompt}`);
16944
+ const unknown2 = saved.find(
16945
+ (value) => !field2.options.some((option) => option.value === value)
16946
+ );
16947
+ other.checked = unknown2 !== void 0;
16948
+ notes = document2.createElement("input");
16949
+ notes.value = unknown2 ?? "";
16950
+ notes.placeholder = "Or write your own response";
16951
+ notes.setAttribute("aria-label", `${field2.prompt}: Other`);
16952
+ const checkbox = other;
16953
+ const otherText = notes;
16954
+ validOther.push(() => !checkbox.checked || otherText.value.trim().length > 0);
16955
+ notes.addEventListener("input", () => {
16956
+ checkbox.checked = true;
16957
+ });
16958
+ const copy = document2.createElement("span");
16959
+ copy.className = "other-copy";
16960
+ copy.append(notes);
16961
+ const pencil = document2.createElement("span");
16962
+ pencil.className = "shortcut pencil";
16963
+ pencil.append(icon2(Pencil));
16964
+ pencil.setAttribute("aria-hidden", "true");
16965
+ const selected = selectedIndicator();
16966
+ label.append(other, pencil, copy, selected);
16967
+ if (question.questions.length === 1) footer.append(label);
16968
+ else group.append(label);
16969
+ controls.push(other, notes);
16970
+ }
16971
+ readers.set(field2.id, () => [
16972
+ ...inputs.filter((input) => input.checked).map((input) => input.value),
16973
+ ...other?.checked && notes?.value.trim() ? [notes.value] : []
16974
+ ]);
16975
+ }
16976
+ body.append(group);
16977
+ }
16978
+ const error51 = document2.createElement("div");
16979
+ error51.setAttribute("role", "alert");
16980
+ error51.className = "error";
16981
+ const actions = document2.createElement("div");
16982
+ actions.className = "actions";
16983
+ const readAnswers = () => Object.fromEntries([...readers].map(([id, read]) => [id, read()]));
16984
+ let busy = false;
16985
+ const send = async (cancelled) => {
16986
+ if (busy) return;
16987
+ const answers = cancelled ? {} : readAnswers();
16988
+ if (!cancelled && validOther.some((valid) => !valid())) {
16989
+ error51.textContent = "Type an answer for each selected Other option.";
16990
+ return;
16991
+ }
16992
+ if (!cancelled && question.questions.some((field2) => !field2.optional && !answers[field2.id]?.length)) {
16993
+ error51.textContent = "Answer each required question before submitting.";
16994
+ return;
16995
+ }
16996
+ busy = true;
16997
+ error51.textContent = "";
16998
+ for (const control of controls) control.disabled = true;
16999
+ try {
17000
+ await submit(answers, cancelled);
17001
+ } catch {
17002
+ error51.textContent = "Could not submit. The question may have closed. Try again if it is still available.";
17003
+ } finally {
17004
+ busy = false;
17005
+ for (const control of controls) control.disabled = false;
17006
+ }
17007
+ };
17008
+ for (const [label, cancelled] of [
17009
+ ["Skip", true],
17010
+ ["Send", false]
17011
+ ]) {
17012
+ const button2 = document2.createElement("button");
17013
+ button2.type = "button";
17014
+ button2.textContent = label;
17015
+ if (!cancelled) button2.className = "primary";
17016
+ button2.addEventListener("click", () => {
17017
+ void send(cancelled);
17018
+ });
17019
+ controls.push(button2);
17020
+ actions.append(button2);
17021
+ }
17022
+ dismiss.addEventListener("click", () => {
17023
+ void send(true);
17024
+ });
17025
+ footer.append(actions);
17026
+ surface.append(error51, footer);
17027
+ return {
17028
+ root,
17029
+ readAnswers,
17030
+ dispose() {
17031
+ root.remove();
17032
+ }
17033
+ };
17034
+ }
17035
+
17036
+ // src/renderer-request-sender.ts
17037
+ var RendererMethodUnavailableError = class extends Error {
17038
+ constructor(method, cause) {
17039
+ super(`${method} is unsupported on this Host connection`, { cause });
17040
+ this.method = method;
17041
+ this.name = "RendererMethodUnavailableError";
17042
+ }
17043
+ method;
17044
+ code = -32601;
17045
+ };
17046
+ function isUnsupportedMethod(error51, method) {
17047
+ if (typeof error51 !== "object" || error51 === null) return false;
17048
+ const code = "code" in error51 ? error51.code : void 0;
17049
+ const message2 = "message" in error51 ? error51.message : void 0;
17050
+ return code === -32601 || code === -32600 && typeof message2 === "string" && message2.startsWith(`Invalid request: unknown variant \`${method}\``);
17051
+ }
17052
+ function createRendererRequestSender(send) {
17053
+ const unsupported = /* @__PURE__ */ new Map();
17054
+ return async (method, params, options) => {
17055
+ const known = unsupported.get(method);
17056
+ if (known) throw known;
17057
+ try {
17058
+ return await (options === void 0 ? send(method, params) : send(method, params, options));
17059
+ } catch (error51) {
17060
+ if (!method.startsWith("codexhost/") || !isUnsupportedMethod(error51, method)) throw error51;
17061
+ const unavailable = new RendererMethodUnavailableError(method, error51);
17062
+ unsupported.set(method, unavailable);
17063
+ throw unavailable;
17064
+ }
17065
+ };
17066
+ }
17067
+
17068
+ // src/renderer-questions.ts
17069
+ function same(a, b) {
17070
+ return a?.hostId === b?.hostId && a?.threadId === b?.threadId && a?.composer === b?.composer && a?.route === b?.route;
17071
+ }
17072
+ function installRendererQuestions(window2, readContext) {
17073
+ let disposed = false;
17074
+ let inFlight = false;
17075
+ let revision = 0;
17076
+ let context = null;
17077
+ let card = null;
17078
+ let cardKey = null;
17079
+ const unsupported = /* @__PURE__ */ new WeakSet();
17080
+ const drafts = /* @__PURE__ */ new Map();
17081
+ const clear = (retain = true) => {
17082
+ if (retain && card && cardKey) {
17083
+ drafts.set(cardKey, card.readAnswers());
17084
+ const oldest = drafts.keys().next().value;
17085
+ if (drafts.size > 50 && oldest !== void 0) drafts.delete(oldest);
17086
+ }
17087
+ card?.dispose();
17088
+ card = null;
17089
+ cardKey = null;
17090
+ };
17091
+ const refresh = async () => {
17092
+ if (disposed) return;
17093
+ const next = readContext();
17094
+ if (!same(context, next)) {
17095
+ clear();
17096
+ context = next;
17097
+ revision++;
17098
+ }
17099
+ const current = context;
17100
+ if (!current || inFlight || unsupported.has(current.route)) return;
17101
+ const startedRevision = revision;
17102
+ inFlight = true;
17103
+ try {
17104
+ const raw = await current.route.sendRequest(
17105
+ THREAD_QUESTIONS_LIST_METHOD,
17106
+ { threadId: current.threadId },
17107
+ { priority: "background", timeoutMs: 5e3 }
17108
+ );
17109
+ if (disposed || revision !== startedRevision || !same(current, readContext())) return;
17110
+ const question = threadQuestionsResultSchema.parse(raw).questions[0];
17111
+ if (!question) {
17112
+ if (cardKey) drafts.delete(cardKey);
17113
+ clear(false);
17114
+ return;
17115
+ }
17116
+ const key = JSON.stringify([
17117
+ current.hostId,
17118
+ current.threadId,
17119
+ question.turnId,
17120
+ question.interactionId
17121
+ ]);
17122
+ if (cardKey === key && card?.root.isConnected) return;
17123
+ clear(cardKey === key);
17124
+ cardKey = key;
17125
+ card = createQuestionCard(
17126
+ current.composer.ownerDocument,
17127
+ question,
17128
+ async (answers, cancelled) => {
17129
+ if (disposed || !same(current, readContext()) || cardKey !== key)
17130
+ throw new Error("Question owner changed");
17131
+ const raw2 = await current.route.sendRequest(
17132
+ THREAD_QUESTION_RESPOND_METHOD,
17133
+ {
17134
+ threadId: current.threadId,
17135
+ turnId: question.turnId,
17136
+ interactionId: question.interactionId,
17137
+ answers,
17138
+ cancelled
17139
+ },
17140
+ { priority: "interactive", timeoutMs: 1e4 }
17141
+ );
17142
+ threadQuestionRespondResultSchema.parse(raw2);
17143
+ drafts.delete(key);
17144
+ if (same(current, context)) {
17145
+ revision++;
17146
+ if (cardKey === key) clear(false);
17147
+ }
17148
+ },
17149
+ drafts.get(key)
17150
+ );
17151
+ current.composer.before(card.root);
17152
+ } catch (error51) {
17153
+ if (isUnsupportedMethod(error51, THREAD_QUESTIONS_LIST_METHOD)) unsupported.add(current.route);
17154
+ if (revision === startedRevision && same(current, context)) clear();
17155
+ } finally {
17156
+ inFlight = false;
17157
+ }
17158
+ };
17159
+ const timer = window2.setInterval(() => {
17160
+ void refresh();
17161
+ }, 750);
17162
+ void refresh();
17163
+ return {
17164
+ refresh,
17165
+ refreshContext() {
17166
+ if (!same(context, readContext()) || card && !card.root.isConnected) void refresh();
17167
+ },
17168
+ dispose() {
17169
+ disposed = true;
17170
+ window2.clearInterval(timer);
17171
+ clear(false);
17172
+ drafts.clear();
17173
+ }
17174
+ };
17175
+ }
17176
+
16591
17177
  // ../desktop-control/dist/renderer-react-ownership.js
16592
17178
  var REACT_FIBER_WALK_LIMIT_EVENT = "codexhost:react-fiber-walk-limit";
16593
17179
  function committedReactAncestors(value) {
@@ -16917,42 +17503,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16917
17503
  return fallback;
16918
17504
  }
16919
17505
 
16920
- // ../../node_modules/lucide/dist/esm/defaultAttributes.mjs
16921
- var defaultAttributes = {
16922
- xmlns: "http://www.w3.org/2000/svg",
16923
- width: 24,
16924
- height: 24,
16925
- viewBox: "0 0 24 24",
16926
- fill: "none",
16927
- stroke: "currentColor",
16928
- "stroke-width": 2,
16929
- "stroke-linecap": "round",
16930
- "stroke-linejoin": "round"
16931
- };
16932
-
16933
- // ../../node_modules/lucide/dist/esm/createElement.mjs
16934
- var createSVGElement = ([tag, attrs, children]) => {
16935
- const element = document.createElementNS("http://www.w3.org/2000/svg", tag);
16936
- Object.keys(attrs).forEach((name) => {
16937
- element.setAttribute(name, String(attrs[name]));
16938
- });
16939
- if (children?.length) {
16940
- children.forEach((child) => {
16941
- const childElement = createSVGElement(child);
16942
- element.appendChild(childElement);
16943
- });
16944
- }
16945
- return element;
16946
- };
16947
- var createElement = (iconNode, customAttrs = {}) => {
16948
- const tag = "svg";
16949
- const attrs = {
16950
- ...defaultAttributes,
16951
- ...customAttrs
16952
- };
16953
- return createSVGElement([tag, attrs, iconNode]);
16954
- };
16955
-
16956
17506
  // ../../node_modules/lucide/dist/esm/icons/boxes.mjs
16957
17507
  var Boxes = [
16958
17508
  [
@@ -17257,12 +17807,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17257
17807
  ["path", { d: "M12 17h.01" }]
17258
17808
  ];
17259
17809
 
17260
- // ../../node_modules/lucide/dist/esm/icons/x.mjs
17261
- var X = [
17262
- ["path", { d: "M18 6 6 18" }],
17263
- ["path", { d: "m6 6 12 12" }]
17264
- ];
17265
-
17266
17810
  // ../../node_modules/lucide/dist/esm/icons/users.mjs
17267
17811
  var Users = [
17268
17812
  ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }],
@@ -18966,12 +19510,13 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
18966
19510
  notAvailable: "Not available",
18967
19511
  runtimeCapabilityNotInstalled: "This runtime capability is not installed yet.",
18968
19512
  sessionImportHarness: "Harness",
19513
+ sessionImportSelectHost: "Select the Host to import sessions from",
18969
19514
  sessionImportDescription: "Sessions keep their original project path. If a folder is not in the Codex sidebar, add it as a project first. Original history remains managed by the Harness.",
18970
- sessionImportAvailabilityNote: "Available Harnesses come from the local Host. If activity is unknown, close the session in its native client before importing to avoid concurrent writes.",
19515
+ sessionImportAvailabilityNote: "Available Harnesses come from the selected Host. If activity is unknown, close the session in its native client before importing to avoid concurrent writes.",
18971
19516
  sessionImportRefresh: "Refresh",
18972
- sessionImportRefreshing: "Loading local sessions...",
18973
- sessionImportUnavailable: "Session import is unavailable for this local Harness or its current protocol. Update the Host/plugin or choose another Harness.",
18974
- sessionImportEmpty: "No local sessions are available to import.",
19517
+ sessionImportRefreshing: "Loading sessions from the selected Host...",
19518
+ sessionImportUnavailable: "Session import is unavailable for this Harness or the selected Host protocol. Update the Host/plugin or choose another Harness.",
19519
+ sessionImportEmpty: "No sessions are available to import on the selected Host.",
18975
19520
  sessionImportSearch: "Search",
18976
19521
  sessionImportSearchPlaceholder: "Search titles, session IDs or project paths",
18977
19522
  sessionImportNoMatches: "No sessions match your search.",
@@ -18979,7 +19524,7 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
18979
19524
  sessionImportPrevious: "Previous",
18980
19525
  sessionImportNext: "Next",
18981
19526
  sessionImportPageSummary: "Page {page} of {pages} \xB7 {total} sessions",
18982
- sessionImportLoadFailed: "Local sessions could not be loaded. Check directory access or duplicate session IDs, then retry.",
19527
+ sessionImportLoadFailed: "Sessions could not be loaded from the selected Host. Check directory access or duplicate session IDs, then retry.",
18983
19528
  sessionImportFailed: "The session could not be imported.",
18984
19529
  sessionImportUntitled: "Untitled session",
18985
19530
  sessionImportUpdatedAt: "Updated",
@@ -19246,12 +19791,13 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
19246
19791
  notAvailable: "\u6682\u4E0D\u53EF\u7528",
19247
19792
  runtimeCapabilityNotInstalled: "\u8FD0\u884C\u65F6\u5C1A\u672A\u5B89\u88C5\u8BE5\u9879\u80FD\u529B\uFF0C\u56E0\u6B64\u6682\u4E0D\u53EF\u7528\u3002",
19248
19793
  sessionImportHarness: "Harness",
19794
+ sessionImportSelectHost: "\u8BF7\u9009\u62E9\u8981\u5BFC\u5165\u4F1A\u8BDD\u7684 Host",
19249
19795
  sessionImportDescription: "\u4F1A\u8BDD\u5C06\u4FDD\u7559\u539F\u59CB\u9879\u76EE\u8DEF\u5F84\uFF1B\u82E5\u8BE5\u6587\u4EF6\u5939\u5C1A\u672A\u51FA\u73B0\u5728 Codex \u4FA7\u680F\uFF0C\u8BF7\u5148\u5C06\u5176\u6DFB\u52A0\u4E3A\u9879\u76EE\u3002\u539F\u59CB\u5386\u53F2\u4ECD\u7531 Harness \u7BA1\u7406\u3002",
19250
- sessionImportAvailabilityNote: "\u53EF\u9009 Harness \u6765\u81EA\u672C\u5730 Host\u3002\u8FD0\u884C\u72B6\u6001\u672A\u77E5\u65F6\uFF0C\u8BF7\u5148\u5728\u539F\u751F\u5BA2\u6237\u7AEF\u5173\u95ED\u8BE5\u4F1A\u8BDD\u518D\u5BFC\u5165\uFF0C\u907F\u514D\u540C\u65F6\u5199\u5165\u3002",
19796
+ sessionImportAvailabilityNote: "\u53EF\u9009 Harness \u6765\u81EA\u5F53\u524D Host\u3002\u8FD0\u884C\u72B6\u6001\u672A\u77E5\u65F6\uFF0C\u8BF7\u5148\u5728\u539F\u751F\u5BA2\u6237\u7AEF\u5173\u95ED\u8BE5\u4F1A\u8BDD\u518D\u5BFC\u5165\uFF0C\u907F\u514D\u540C\u65F6\u5199\u5165\u3002",
19251
19797
  sessionImportRefresh: "\u5237\u65B0",
19252
- sessionImportRefreshing: "\u6B63\u5728\u8BFB\u53D6\u672C\u5730\u4F1A\u8BDD\u2026\u2026",
19253
- sessionImportUnavailable: "\u672C\u5730 Harness \u6216\u5F53\u524D\u534F\u8BAE\u6682\u4E0D\u652F\u6301\u4F1A\u8BDD\u5BFC\u5165\uFF0C\u8BF7\u66F4\u65B0 Host/\u63D2\u4EF6\u6216\u9009\u62E9\u5176\u4ED6 Harness\u3002",
19254
- sessionImportEmpty: "\u6CA1\u6709\u53EF\u5BFC\u5165\u7684\u672C\u5730\u4F1A\u8BDD\u3002",
19798
+ sessionImportRefreshing: "\u6B63\u5728\u8BFB\u53D6\u5F53\u524D Host \u4E0A\u7684\u4F1A\u8BDD\u2026\u2026",
19799
+ sessionImportUnavailable: "\u8BE5 Harness \u6216\u5F53\u524D Host \u534F\u8BAE\u6682\u4E0D\u652F\u6301\u4F1A\u8BDD\u5BFC\u5165\uFF0C\u8BF7\u66F4\u65B0 Host/\u63D2\u4EF6\u6216\u9009\u62E9\u5176\u4ED6 Harness\u3002",
19800
+ sessionImportEmpty: "\u5F53\u524D Host \u4E0A\u6CA1\u6709\u53EF\u5BFC\u5165\u7684\u4F1A\u8BDD\u3002",
19255
19801
  sessionImportSearch: "\u641C\u7D22",
19256
19802
  sessionImportSearchPlaceholder: "\u641C\u7D22\u6807\u9898\u3001\u4F1A\u8BDD ID \u6216\u9879\u76EE\u8DEF\u5F84",
19257
19803
  sessionImportNoMatches: "\u6CA1\u6709\u5339\u914D\u7684\u4F1A\u8BDD\u3002",
@@ -19259,7 +19805,7 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
19259
19805
  sessionImportPrevious: "\u4E0A\u4E00\u9875",
19260
19806
  sessionImportNext: "\u4E0B\u4E00\u9875",
19261
19807
  sessionImportPageSummary: "\u7B2C {page} / {pages} \u9875 \xB7 \u5171 {total} \u6761",
19262
- sessionImportLoadFailed: "\u65E0\u6CD5\u8BFB\u53D6\u672C\u5730\u4F1A\u8BDD\uFF0C\u8BF7\u68C0\u67E5\u76EE\u5F55\u8BBF\u95EE\u6743\u9650\u6216\u91CD\u590D\u7684\u4F1A\u8BDD ID \u540E\u91CD\u8BD5\u3002",
19808
+ sessionImportLoadFailed: "\u65E0\u6CD5\u8BFB\u53D6\u5F53\u524D Host \u4E0A\u7684\u4F1A\u8BDD\uFF0C\u8BF7\u68C0\u67E5\u76EE\u5F55\u8BBF\u95EE\u6743\u9650\u6216\u91CD\u590D\u7684\u4F1A\u8BDD ID \u540E\u91CD\u8BD5\u3002",
19263
19809
  sessionImportFailed: "\u65E0\u6CD5\u5BFC\u5165\u8BE5\u4F1A\u8BDD\u3002",
19264
19810
  sessionImportUntitled: "\u672A\u547D\u540D\u4F1A\u8BDD",
19265
19811
  sessionImportUpdatedAt: "\u66F4\u65B0\u65F6\u95F4",
@@ -20087,6 +20633,8 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
20087
20633
  var STYLE_ATTRIBUTE = "data-codexhost-trigger-chip-style";
20088
20634
  var TRIGGER_CHIP_CLASS = "codexhost-trigger-chip";
20089
20635
  var TRIGGER_CHIP_ROOT_CLASS = "codexhost-trigger-chip-root";
20636
+ var COMPACT_COMPOSER_ATTRIBUTE = "data-codexhost-compact-composer";
20637
+ var COMPACT_COMPOSER_WIDTH = 420;
20090
20638
  var TRIGGER_CHIP_SQUEEZE_MIN_WIDTH = "48px";
20091
20639
  function rendererModelTriggerMaxWidth() {
20092
20640
  return "min(200px, 26vw)";
@@ -20116,6 +20664,23 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
20116
20664
  trigger.style.maxWidth = "100%";
20117
20665
  trigger.style.overflow = "hidden";
20118
20666
  }
20667
+ function observeRendererCompactComposer(composer) {
20668
+ const update = () => {
20669
+ const width = composer.getBoundingClientRect().width;
20670
+ if (width > 0) {
20671
+ composer.toggleAttribute(COMPACT_COMPOSER_ATTRIBUTE, width <= COMPACT_COMPOSER_WIDTH);
20672
+ }
20673
+ };
20674
+ update();
20675
+ if (typeof ResizeObserver === "undefined")
20676
+ return () => composer.removeAttribute(COMPACT_COMPOSER_ATTRIBUTE);
20677
+ const observer = new ResizeObserver(update);
20678
+ observer.observe(composer, { box: "border-box" });
20679
+ return () => {
20680
+ observer.disconnect();
20681
+ composer.removeAttribute(COMPACT_COMPOSER_ATTRIBUTE);
20682
+ };
20683
+ }
20119
20684
  function ensureRendererTriggerChipStyle(ownerDocument) {
20120
20685
  if (ownerDocument.querySelector(`style[${STYLE_ATTRIBUTE}]`)) return;
20121
20686
  const style = ownerDocument.createElement("style");
@@ -20154,10 +20719,55 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
20154
20719
  cursor: not-allowed;
20155
20720
  opacity: 0.4;
20156
20721
  }
20722
+ [${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-model-control] [data-codexhost-model-thinking] {
20723
+ display: none !important;
20724
+ }
20725
+ [${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-permission-mode-control] {
20726
+ min-width: 30px !important;
20727
+ max-width: 30px !important;
20728
+ }
20729
+ [${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-permission-mode-control] .${TRIGGER_CHIP_CLASS} {
20730
+ padding-inline: 6px !important;
20731
+ }
20732
+ [${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-permission-label],
20733
+ [${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-permission-chevron],
20734
+ [${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-credits-label],
20735
+ [${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-usage-label] {
20736
+ display: none !important;
20737
+ }
20738
+ [${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-permission-mode-control]:has([data-codexhost-permission-lock]:not([hidden])) [data-codexhost-permission-shield],
20739
+ [${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-permission-mode-control]:has([data-codexhost-permission-error]:not([hidden])) [data-codexhost-permission-shield] {
20740
+ display: none !important;
20741
+ }
20742
+ [${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-credits-control],
20743
+ [${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-usage-control] {
20744
+ min-width: 28px !important;
20745
+ max-width: 28px !important;
20746
+ }
20747
+ [${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-credits-control] .${TRIGGER_CHIP_CLASS},
20748
+ [${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-usage-control] .${TRIGGER_CHIP_CLASS} {
20749
+ padding-inline: 6px !important;
20750
+ }
20751
+ [${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-usage-icon] {
20752
+ display: inline-flex !important;
20753
+ }
20754
+ [${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-agent-control] {
20755
+ margin-inline: 0 !important;
20756
+ }
20157
20757
  `;
20158
20758
  (ownerDocument.head ?? ownerDocument.documentElement).append(style);
20159
20759
  }
20160
20760
 
20761
+ // ../../node_modules/lucide/dist/esm/icons/activity.mjs
20762
+ var Activity = [
20763
+ [
20764
+ "path",
20765
+ {
20766
+ d: "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"
20767
+ }
20768
+ ]
20769
+ ];
20770
+
20161
20771
  // src/renderer-usage-control.ts
20162
20772
  var ENGLISH_USAGE_MESSAGES = Object.freeze({
20163
20773
  usage: "Usage",
@@ -20511,13 +21121,19 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
20511
21121
  trigger.style.lineHeight = "16px";
20512
21122
  trigger.style.fontVariantNumeric = "tabular-nums";
20513
21123
  trigger.style.letterSpacing = "0";
21124
+ const icon2 = document.createElement("span");
21125
+ icon2.dataset.codexhostUsageIcon = "";
21126
+ icon2.style.display = "none";
21127
+ icon2.style.alignItems = "center";
21128
+ icon2.append(createElement(Activity, { width: 16, height: 16, "aria-hidden": "true" }));
20514
21129
  const label = document.createElement("span");
21130
+ label.dataset.codexhostUsageLabel = "";
20515
21131
  label.style.display = "inline-block";
20516
21132
  label.style.maxWidth = "100%";
20517
21133
  label.style.overflow = "hidden";
20518
21134
  label.style.textOverflow = "ellipsis";
20519
21135
  label.style.whiteSpace = "nowrap";
20520
- trigger.append(label);
21136
+ trigger.append(icon2, label);
20521
21137
  const popover = document.createElement("div");
20522
21138
  popover.id = `${composerId}-usage-popover`;
20523
21139
  popover.setAttribute("role", "dialog");
@@ -21383,6 +21999,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
21383
21999
  label.style.textOverflow = "ellipsis";
21384
22000
  label.style.whiteSpace = "nowrap";
21385
22001
  const thinkingLabel = document.createElement("span");
22002
+ thinkingLabel.dataset.codexhostModelThinking = "";
21386
22003
  thinkingLabel.style.color = "var(--color-text-tertiary, #8f8f8f)";
21387
22004
  thinkingLabel.style.flex = "0 1 auto";
21388
22005
  thinkingLabel.style.maxWidth = "72px";
@@ -21828,9 +22445,6 @@ Codex Fast mode prioritizes requests and may increase usage.`
21828
22445
  syncModelSelectionNotice(control, view, locale);
21829
22446
  }
21830
22447
 
21831
- // ../../node_modules/lucide/dist/esm/icons/check.mjs
21832
- var Check = [["path", { d: "M20 6 9 17l-5-5" }]];
21833
-
21834
22448
  // ../../node_modules/lucide/dist/esm/icons/lock.mjs
21835
22449
  var Lock = [
21836
22450
  ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }],
@@ -21945,9 +22559,11 @@ Codex Fast mode prioritizes requests and may increase usage.`
21945
22559
  trigger.className = TRIGGER_CHIP_CLASS;
21946
22560
  applyRendererTriggerChipSqueezeTrigger(trigger);
21947
22561
  const shield = document.createElement("span");
22562
+ shield.dataset.codexhostPermissionShield = "";
21948
22563
  shield.className = "inline-flex shrink-0 items-center";
21949
22564
  shield.append(icon(Shield, 15));
21950
22565
  const label = document.createElement("span");
22566
+ label.dataset.codexhostPermissionLabel = "";
21951
22567
  label.className = "truncate";
21952
22568
  label.style.flex = "1 1 auto";
21953
22569
  label.style.minWidth = "0";
@@ -21955,15 +22571,18 @@ Codex Fast mode prioritizes requests and may increase usage.`
21955
22571
  label.style.textOverflow = "ellipsis";
21956
22572
  label.style.whiteSpace = "nowrap";
21957
22573
  const chevron = document.createElement("span");
22574
+ chevron.dataset.codexhostPermissionChevron = "";
21958
22575
  chevron.className = "inline-flex shrink-0 items-center";
21959
22576
  chevron.style.color = "var(--color-text-tertiary, #8f8f8f)";
21960
22577
  chevron.append(icon(ChevronDown, 14));
21961
22578
  const lockMark = document.createElement("span");
22579
+ lockMark.dataset.codexhostPermissionLock = "";
21962
22580
  lockMark.className = "inline-flex shrink-0 items-center";
21963
22581
  lockMark.style.color = "var(--color-text-tertiary, #8f8f8f)";
21964
22582
  lockMark.hidden = true;
21965
22583
  lockMark.append(icon(Lock, 14));
21966
22584
  const errorMark = document.createElement("span");
22585
+ errorMark.dataset.codexhostPermissionError = "";
21967
22586
  errorMark.className = "inline-flex shrink-0 items-center";
21968
22587
  errorMark.style.color = "var(--color-text-danger, #c2413b)";
21969
22588
  errorMark.hidden = true;
@@ -22670,6 +23289,21 @@ Codex Fast mode prioritizes requests and may increase usage.`
22670
23289
  };
22671
23290
  }
22672
23291
 
23292
+ // src/renderer-composer-request.ts
23293
+ var NATIVE_COMPOSER_REQUEST_ATTRIBUTES = [
23294
+ "data-codex-composer-request-navigation",
23295
+ "data-codex-composer-request"
23296
+ ];
23297
+ var NATIVE_REQUEST_SELECTOR = NATIVE_COMPOSER_REQUEST_ATTRIBUTES.map(
23298
+ (attribute) => `[${attribute}]`
23299
+ ).join(", ");
23300
+ function isNativeComposerRequest(element) {
23301
+ return element.closest(NATIVE_REQUEST_SELECTOR) !== null;
23302
+ }
23303
+ function hasNativeComposerRequest(composer) {
23304
+ return isNativeComposerRequest(composer) || composer.querySelector(NATIVE_REQUEST_SELECTOR) !== null;
23305
+ }
23306
+
22673
23307
  // src/renderer-harness-command-control.ts
22674
23308
  var CONTROL_ATTRIBUTE2 = "data-codexhost-harness-command-control";
22675
23309
  var SVG_NS2 = "http://www.w3.org/2000/svg";
@@ -22831,10 +23465,13 @@ Codex Fast mode prioritizes requests and may increase usage.`
22831
23465
  const buttons = [...element.querySelectorAll("button")];
22832
23466
  return buttons.length > 0 && buttons.every((button2) => isComposerTrailingActionButton(button2));
22833
23467
  }
23468
+ function composerButtonsWithin(root) {
23469
+ return [...root.querySelectorAll("button")].filter(
23470
+ (button2) => !isNativeComposerRequest(button2)
23471
+ );
23472
+ }
22834
23473
  function sendButtonWithin(root) {
22835
- return [...root.querySelectorAll("button")].find(
22836
- (button2) => isComposerSubmitButton(button2)
22837
- ) ?? null;
23474
+ return composerButtonsWithin(root).find(isComposerSubmitButton) ?? null;
22838
23475
  }
22839
23476
  function leftmostTrailingSibling(container, before) {
22840
23477
  for (const child of container.children) {
@@ -22877,7 +23514,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
22877
23514
  }
22878
23515
  function composerForElement(element) {
22879
23516
  const composer = element.closest(CODEX_COMPOSER_SELECTOR);
22880
- return composer && !isOrbitComposer(composer) ? composer : null;
23517
+ return composer && !hasNativeComposerRequest(composer) && !isOrbitComposer(composer) ? composer : null;
22881
23518
  }
22882
23519
  function isRecord(value) {
22883
23520
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -23001,7 +23638,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
23001
23638
  return root?.parentElement ? root : null;
23002
23639
  }
23003
23640
  function lastNativeButtonWithin(composer) {
23004
- const buttons = [...composer.querySelectorAll("button")];
23641
+ const buttons = composerButtonsWithin(composer);
23005
23642
  for (let index = buttons.length - 1; index >= 0; index -= 1) {
23006
23643
  const button2 = buttons[index];
23007
23644
  if (button2 && !isInsideOwnedRendererControl(button2, composer)) return button2;
@@ -23015,6 +23652,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
23015
23652
  return false;
23016
23653
  }
23017
23654
  function refreshSendButton(control) {
23655
+ if (hasNativeComposerRequest(control.composer)) return null;
23018
23656
  const current = control.sendButton;
23019
23657
  if (current?.isConnected && control.composer.contains(current)) return current;
23020
23658
  const replacement = sendButtonWithin(control.composer) ?? (current && !isComposerSubmitButton(current) ? lastNativeButtonWithin(control.composer) : null);
@@ -23185,6 +23823,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
23185
23823
  refreshTrailingClusterPlacement(control);
23186
23824
  refreshUsagePlacement(control);
23187
23825
  refreshCreditsPlacement(control);
23826
+ control.stopCompactLayout = observeRendererCompactComposer(composer);
23188
23827
  return control;
23189
23828
  }
23190
23829
  function nativeSendDisabled(button2, fallback) {
@@ -23256,6 +23895,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
23256
23895
  return state.agent !== "codex" && adapterState === "ready" && !submissionBlocked;
23257
23896
  }
23258
23897
  function disposeComposerAgentControl(control) {
23898
+ control.stopCompactLayout?.();
23259
23899
  if (control.sendDisabledBeforeSwitch !== null) {
23260
23900
  control.sendButton.disabled = nativeSendDisabled(
23261
23901
  control.sendButton,
@@ -23840,38 +24480,6 @@ Codex Fast mode prioritizes requests and may increase usage.`
23840
24480
  return task.result;
23841
24481
  }
23842
24482
 
23843
- // src/renderer-request-sender.ts
23844
- var RendererMethodUnavailableError = class extends Error {
23845
- constructor(method, cause) {
23846
- super(`${method} is unsupported on this Host connection`, { cause });
23847
- this.method = method;
23848
- this.name = "RendererMethodUnavailableError";
23849
- }
23850
- method;
23851
- code = -32601;
23852
- };
23853
- function isUnsupportedMethod(error51, method) {
23854
- if (typeof error51 !== "object" || error51 === null) return false;
23855
- const code = "code" in error51 ? error51.code : void 0;
23856
- const message2 = "message" in error51 ? error51.message : void 0;
23857
- return code === -32601 || code === -32600 && typeof message2 === "string" && message2.startsWith(`Invalid request: unknown variant \`${method}\``);
23858
- }
23859
- function createRendererRequestSender(send) {
23860
- const unsupported = /* @__PURE__ */ new Map();
23861
- return async (method, params, options) => {
23862
- const known = unsupported.get(method);
23863
- if (known) throw known;
23864
- try {
23865
- return await (options === void 0 ? send(method, params) : send(method, params, options));
23866
- } catch (error51) {
23867
- if (!method.startsWith("codexhost/") || !isUnsupportedMethod(error51, method)) throw error51;
23868
- const unavailable = new RendererMethodUnavailableError(method, error51);
23869
- unsupported.set(method, unavailable);
23870
- throw unavailable;
23871
- }
23872
- };
23873
- }
23874
-
23875
24483
  // src/renderer-native-thread.ts
23876
24484
  function isRecord4(value) {
23877
24485
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -26342,14 +26950,17 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
26342
26950
  }
26343
26951
 
26344
26952
  // src/codex-locale-adapter.ts
26345
- var GET_LOCALE_OVERRIDE_URL = "vscode://codex/get-setting";
26346
- var GET_LOCALE_INFO_URL = "vscode://codex/locale-info";
26347
26953
  var DEFAULT_LOCALE_REQUEST_TIMEOUT_MS = 750;
26348
26954
  function isNativeLocaleServices(value) {
26349
26955
  if (!isRecord14(value) || !Object.hasOwn(value, "appInfo")) return false;
26350
26956
  const appInfo = value.appInfo;
26351
26957
  return appInfo != null && typeof appInfo.getLocaleInfo === "function";
26352
26958
  }
26959
+ function isNativeSettingsServices(value) {
26960
+ if (!isRecord14(value) || !Object.hasOwn(value, "settings")) return false;
26961
+ const settings = value.settings;
26962
+ return typeof settings?.read === "function" && typeof settings?.write === "function";
26963
+ }
26353
26964
  function isRecord14(value) {
26354
26965
  return typeof value === "object" && value !== null && !Array.isArray(value);
26355
26966
  }
@@ -26371,19 +26982,19 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
26371
26982
  function abortError2() {
26372
26983
  return new DOMException("The operation was aborted", "AbortError");
26373
26984
  }
26374
- function parseLocaleOverride(value) {
26375
- if (!isRecord14(value) || !("value" in value)) {
26376
- throw new Error("Codex locale override response is malformed");
26985
+ function parseLocaleOverride(response) {
26986
+ if (!isRecord14(response) || !Object.hasOwn(response, "effective")) {
26987
+ throw new Error("Codex native locale override response is malformed");
26377
26988
  }
26378
- if (value.value === null) return { value: null };
26379
- const locale = canonicalLocale(value.value);
26989
+ if (response.effective === null) return null;
26990
+ const locale = canonicalLocale(response.effective);
26380
26991
  if (!locale) throw new Error("Codex locale override is invalid");
26381
- return { value: locale };
26992
+ return locale;
26382
26993
  }
26383
- function optionalLocale(value, field) {
26994
+ function optionalLocale(value, field2) {
26384
26995
  if (value === void 0 || value === null) return void 0;
26385
26996
  const locale = canonicalLocale(value);
26386
- if (!locale) throw new Error(`Codex ${field} is invalid`);
26997
+ if (!locale) throw new Error(`Codex ${field2} is invalid`);
26387
26998
  return locale;
26388
26999
  }
26389
27000
  function parseLocaleInfo(value) {
@@ -26393,95 +27004,39 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
26393
27004
  systemLocale: optionalLocale(value.systemLocale, "system locale")
26394
27005
  };
26395
27006
  }
26396
- function sendFixedLocaleRequest(request, ownerWindow, signal, timeoutMs) {
26397
- const bridge = ownerWindow.electronBridge;
26398
- if (request.kind !== "locale-info" && typeof bridge?.sendMessageFromView !== "function") {
26399
- return Promise.reject(new Error("Codex locale bridge is unavailable"));
26400
- }
27007
+ function requestNativeLocale(ownerWindow, signal, timeoutMs, matchesServices, invoke) {
26401
27008
  if (signal?.aborted) return Promise.reject(abortError2());
26402
- const requestId = ownerWindow.crypto.randomUUID();
26403
27009
  return new Promise((resolve, reject) => {
26404
27010
  let settled = false;
26405
- const cleanup = () => {
26406
- ownerWindow.clearTimeout(timer);
26407
- ownerWindow.removeEventListener("message", onMessage);
26408
- signal?.removeEventListener("abort", onAbort);
26409
- };
27011
+ let nativeRequest;
26410
27012
  const settle = (operation) => {
26411
27013
  if (settled) return;
26412
27014
  settled = true;
26413
- cleanup();
26414
- operation();
26415
- };
26416
- const onAbort = () => settle(() => reject(abortError2()));
26417
- const onMessage = (event) => {
26418
- const message3 = event.data;
26419
- if (!isRecord14(message3) || message3.type !== "fetch-response") return;
26420
- if (message3.requestId !== requestId) return;
26421
- if (message3.responseType !== "success" || typeof message3.status !== "number" || message3.status < 200 || message3.status >= 300 || typeof message3.bodyJsonString !== "string") {
26422
- settle(() => reject(new Error("Codex locale request failed")));
26423
- return;
26424
- }
27015
+ ownerWindow.clearTimeout(timer);
27016
+ signal?.removeEventListener("abort", onAbort);
26425
27017
  try {
26426
- const body = JSON.parse(message3.bodyJsonString);
26427
- settle(() => resolve(body));
26428
- } catch {
26429
- settle(() => reject(new Error("Codex locale response is not valid JSON")));
27018
+ nativeRequest?.[Symbol.dispose]?.();
27019
+ operation();
27020
+ } catch (error51) {
27021
+ reject(error51);
26430
27022
  }
26431
27023
  };
27024
+ const onAbort = () => settle(() => reject(abortError2()));
26432
27025
  const timer = ownerWindow.setTimeout(
26433
27026
  () => settle(() => reject(new Error("Codex locale request timed out"))),
26434
27027
  timeoutMs
26435
27028
  );
26436
- ownerWindow.addEventListener("message", onMessage);
26437
27029
  signal?.addEventListener("abort", onAbort, { once: true });
26438
- const message2 = {
26439
- type: "fetch",
26440
- requestId,
26441
- method: "POST",
26442
- url: request.url,
26443
- ...request.body === void 0 ? {} : { body: request.body },
26444
- reportUploadProgress: false
26445
- };
26446
27030
  void (async () => {
26447
- if (request.kind === "locale-info") {
26448
- const native = await loadCodexNativeServices(ownerWindow, isNativeLocaleServices);
26449
- if (settled) return;
26450
- if (native) {
26451
- const response = await native.appInfo.getLocaleInfo();
26452
- settle(() => resolve(response));
26453
- return;
26454
- }
26455
- }
26456
- if (typeof bridge?.sendMessageFromView !== "function") {
26457
- throw new Error("Codex locale bridge is unavailable");
26458
- }
26459
- await bridge.sendMessageFromView(message2);
27031
+ const native = await loadCodexNativeServices(ownerWindow, matchesServices);
27032
+ if (settled) return;
27033
+ if (!native) throw new Error("Codex native locale services are unavailable");
27034
+ nativeRequest = invoke(native);
27035
+ const response = await nativeRequest;
27036
+ settle(() => resolve(response));
26460
27037
  })().catch((error51) => settle(() => reject(error51)));
26461
27038
  });
26462
27039
  }
26463
- async function readLocaleOverride(ownerWindow, signal, timeoutMs) {
26464
- const response = await sendFixedLocaleRequest(
26465
- {
26466
- kind: "locale-override",
26467
- url: GET_LOCALE_OVERRIDE_URL,
26468
- body: JSON.stringify({ key: "localeOverride" })
26469
- },
26470
- ownerWindow,
26471
- signal,
26472
- timeoutMs
26473
- );
26474
- return parseLocaleOverride(response);
26475
- }
26476
- async function readLocaleInfo(ownerWindow, signal, timeoutMs) {
26477
- const response = await sendFixedLocaleRequest(
26478
- { kind: "locale-info", url: GET_LOCALE_INFO_URL },
26479
- ownerWindow,
26480
- signal,
26481
- timeoutMs
26482
- );
26483
- return parseLocaleInfo(response);
26484
- }
26485
27040
  async function readCodexLocaleSettings(options = {}) {
26486
27041
  const ownerWindow = options.ownerWindow ?? window;
26487
27042
  const timeoutMs = options.timeoutMs ?? DEFAULT_LOCALE_REQUEST_TIMEOUT_MS;
@@ -26490,13 +27045,25 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
26490
27045
  }
26491
27046
  if (options.signal?.aborted) throw abortError2();
26492
27047
  const [overrideResult, localeInfoResult] = await Promise.allSettled([
26493
- readLocaleOverride(ownerWindow, options.signal, timeoutMs),
26494
- readLocaleInfo(ownerWindow, options.signal, timeoutMs)
27048
+ requestNativeLocale(
27049
+ ownerWindow,
27050
+ options.signal,
27051
+ timeoutMs,
27052
+ isNativeSettingsServices,
27053
+ (native) => native.settings.read("localeOverride")
27054
+ ).then(parseLocaleOverride),
27055
+ requestNativeLocale(
27056
+ ownerWindow,
27057
+ options.signal,
27058
+ timeoutMs,
27059
+ isNativeLocaleServices,
27060
+ (native) => native.appInfo.getLocaleInfo()
27061
+ ).then(parseLocaleInfo)
26495
27062
  ]);
26496
27063
  if (options.signal?.aborted) throw abortError2();
26497
27064
  const navigatorLocale = firstNavigatorLocale(ownerWindow);
26498
27065
  const overrideKnown = overrideResult.status === "fulfilled";
26499
- const localeOverride = overrideKnown ? overrideResult.value.value : void 0;
27066
+ const localeOverride = overrideKnown ? overrideResult.value : void 0;
26500
27067
  const localeInfo = localeInfoResult.status === "fulfilled" ? localeInfoResult.value : { ideLocale: void 0, systemLocale: void 0 };
26501
27068
  if (typeof localeOverride === "string") {
26502
27069
  return Object.freeze({
@@ -26841,7 +27408,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
26841
27408
  var DECIMAL = /^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/iu;
26842
27409
  function modelPriceDraft(key, price) {
26843
27410
  const prices = Object.fromEntries(
26844
- MODEL_PRICE_FIELDS.map((field) => [field, price?.[field]?.toString() ?? ""])
27411
+ MODEL_PRICE_FIELDS.map((field2) => [field2, price?.[field2]?.toString() ?? ""])
26845
27412
  );
26846
27413
  return { model: key, prices };
26847
27414
  }
@@ -26852,18 +27419,18 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
26852
27419
  return { error: { kind: "duplicate", key } };
26853
27420
  }
26854
27421
  const price = {};
26855
- for (const field of MODEL_PRICE_FIELDS) {
26856
- const text = draft.prices[field].trim();
27422
+ for (const field2 of MODEL_PRICE_FIELDS) {
27423
+ const text = draft.prices[field2].trim();
26857
27424
  if (text === "") {
26858
- if (field === "input" || field === "output")
26859
- return { error: { kind: "priceRequired", field } };
27425
+ if (field2 === "input" || field2 === "output")
27426
+ return { error: { kind: "priceRequired", field: field2 } };
26860
27427
  continue;
26861
27428
  }
26862
27429
  const value = Number(text);
26863
27430
  if (!DECIMAL.test(text) || !Number.isFinite(value)) {
26864
- return { error: { kind: "priceInvalid", field } };
27431
+ return { error: { kind: "priceInvalid", field: field2 } };
26865
27432
  }
26866
- price[field] = value;
27433
+ price[field2] = value;
26867
27434
  }
26868
27435
  return {
26869
27436
  change: {
@@ -26883,7 +27450,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
26883
27450
  }
26884
27451
  function formatPrice(messages, price) {
26885
27452
  return MODEL_PRICE_FIELDS.map(
26886
- (field) => `${messages.fields[field]} ${price[field] ?? messages.unset}`
27453
+ (field2) => `${messages.fields[field2]} ${price[field2] ?? messages.unset}`
26887
27454
  ).join(" \xB7 ");
26888
27455
  }
26889
27456
  function draftErrorText(messages, error51) {
@@ -26951,18 +27518,18 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
26951
27518
  function renderEditor(modelId, view, isCurrent) {
26952
27519
  const existing = view.entries.find((entry) => entry.key === modelId);
26953
27520
  const draft = modelPriceDraft(modelId, existing?.price ?? null);
26954
- const field = (label, value, placeholder = "") => h(document2, "input", {
27521
+ const field2 = (label, value, placeholder = "") => h(document2, "input", {
26955
27522
  type: "text",
26956
27523
  className: "console-input",
26957
27524
  value,
26958
27525
  placeholder,
26959
27526
  "aria-label": label
26960
27527
  });
26961
- const model2 = field(messages.model, modelId);
27528
+ const model2 = field2(messages.model, modelId);
26962
27529
  model2.readOnly = true;
26963
27530
  const prices = Object.fromEntries(
26964
27531
  MODEL_PRICE_FIELDS.map((name) => {
26965
- const input = field(
27532
+ const input = field2(
26966
27533
  messages.fields[name],
26967
27534
  draft.prices[name],
26968
27535
  name === "input" || name === "output" ? messages.required : messages.notSet
@@ -27774,8 +28341,8 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
27774
28341
  for (const cell of options.cells) {
27775
28342
  const key = options.singleDay ? cell.hour : cell.weekday * 24 + cell.hour;
27776
28343
  const totals2 = byHour.get(key) ?? emptyTotals();
27777
- for (const field of Object.keys(totals2))
27778
- totals2[field] += cell.totals[field];
28344
+ for (const field2 of Object.keys(totals2))
28345
+ totals2[field2] += cell.totals[field2];
27779
28346
  byHour.set(key, totals2);
27780
28347
  }
27781
28348
  const max = Math.max(0, ...[...byHour.values()].map((totals2) => measured(totals2, measure)));
@@ -28138,8 +28705,8 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
28138
28705
  save();
28139
28706
  load();
28140
28707
  }
28141
- function toggleFilter(field, key) {
28142
- view[field] = view[field] === key ? "" : key;
28708
+ function toggleFilter(field2, key) {
28709
+ view[field2] = view[field2] === key ? "" : key;
28143
28710
  changed();
28144
28711
  }
28145
28712
  function selectDate(next) {
@@ -28555,8 +29122,8 @@ ${messages.creditsCoverage}: ${value.reportedRequests} / ${row.requests}` : void
28555
29122
  }
28556
29123
  ];
28557
29124
  }
28558
- function rowFilter(field, key, label, detail) {
28559
- const selected = view[field] === key;
29125
+ function rowFilter(field2, key, label, detail) {
29126
+ const selected = view[field2] === key;
28560
29127
  const button2 = focusKey(
28561
29128
  h(
28562
29129
  document2,
@@ -28570,9 +29137,9 @@ ${detail}` : ""}`
28570
29137
  },
28571
29138
  label
28572
29139
  ),
28573
- `${field}:row:${key}`
29140
+ `${field2}:row:${key}`
28574
29141
  );
28575
- button2.addEventListener("click", () => toggleFilter(field, key));
29142
+ button2.addEventListener("click", () => toggleFilter(field2, key));
28576
29143
  return button2;
28577
29144
  }
28578
29145
  function panel(title, content, extra = null, wide = false) {
@@ -29771,8 +30338,8 @@ ${detail}` : ""}`
29771
30338
  return input;
29772
30339
  }
29773
30340
  function createNumberField(document2, input) {
29774
- const field = document2.createElement("div");
29775
- field.className = "flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-settings-border bg-settings-surface px-2.5 transition-colors focus-within:border-settings-focus data-[invalid=true]:border-settings-danger";
30341
+ const field2 = document2.createElement("div");
30342
+ field2.className = "flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-settings-border bg-settings-surface px-2.5 transition-colors focus-within:border-settings-focus data-[invalid=true]:border-settings-danger";
29776
30343
  const control = document2.createElement("input");
29777
30344
  control.type = "number";
29778
30345
  control.id = input.id;
@@ -29785,8 +30352,8 @@ ${detail}` : ""}`
29785
30352
  unit.className = "text-xs text-settings-muted";
29786
30353
  unit.setAttribute("aria-hidden", "true");
29787
30354
  unit.textContent = input.unit;
29788
- field.append(control, unit);
29789
- return { field, control };
30355
+ field2.append(control, unit);
30356
+ return { field: field2, control };
29790
30357
  }
29791
30358
 
29792
30359
  // src/settings/remote-connections-dialogs.ts
@@ -29870,7 +30437,7 @@ ${detail}` : ""}`
29870
30437
  );
29871
30438
  if (!dialog) return;
29872
30439
  const document2 = options.container.ownerDocument;
29873
- const field = (label, value, placeholder = "", hint = "") => {
30440
+ const field2 = (label, value, placeholder = "", hint = "") => {
29874
30441
  const wrapper = remoteElement(document2, "div", "settings-credential-dialog__field");
29875
30442
  const input = remoteElement(document2, "input");
29876
30443
  input.id = preferenceId("remote-field");
@@ -29890,13 +30457,13 @@ ${detail}` : ""}`
29890
30457
  dialog.body.append(wrapper);
29891
30458
  return input;
29892
30459
  };
29893
- const name = field(t("\u540D\u79F0", "Name"), previous?.displayName ?? "");
30460
+ const name = field2(t("\u540D\u79F0", "Name"), previous?.displayName ?? "");
29894
30461
  name.required = true;
29895
30462
  const addressHint = t(
29896
30463
  "user@hostname\uFF0C\u6216 ~/.ssh/config \u4E2D\u7684\u4E3B\u673A\u522B\u540D",
29897
30464
  "user@hostname, or a host alias from ~/.ssh/config"
29898
30465
  );
29899
- const hostname3 = field(
30466
+ const hostname3 = field2(
29900
30467
  t("SSH \u5730\u5740", "SSH address"),
29901
30468
  previous?.sshHost ?? "",
29902
30469
  "user@hostname",
@@ -29905,7 +30472,7 @@ ${detail}` : ""}`
29905
30472
  hostname3.required = true;
29906
30473
  hostname3.pattern = "[^\\s\\-]\\S*";
29907
30474
  hostname3.title = addressHint;
29908
- const port = field(
30475
+ const port = field2(
29909
30476
  t("\u7AEF\u53E3\uFF08\u53EF\u9009\uFF09", "Port (optional)"),
29910
30477
  previous?.sshPort?.toString() ?? "",
29911
30478
  "22"
@@ -29914,7 +30481,7 @@ ${detail}` : ""}`
29914
30481
  port.min = "1";
29915
30482
  port.max = "65535";
29916
30483
  port.step = "1";
29917
- const identity = field(
30484
+ const identity = field2(
29918
30485
  t("\u79C1\u94A5\u8DEF\u5F84\uFF08\u53EF\u9009\uFF09", "Identity file (optional)"),
29919
30486
  previous?.identity ?? "",
29920
30487
  "~/.ssh/id_ed25519"
@@ -30831,6 +31398,50 @@ ${detail}` : ""}`
30831
31398
  };
30832
31399
  setRefreshLabel(false);
30833
31400
  header.append(heading, refresh);
31401
+ let selectedHostId;
31402
+ let availableHostIds = [];
31403
+ let displayedHostId = "";
31404
+ let hostsLocked = false;
31405
+ const hostButtons = [];
31406
+ const hostLabel = document2.createElement("div");
31407
+ hostLabel.className = "settings-session-import-host";
31408
+ const hostCaption = document2.createElement("span");
31409
+ hostCaption.textContent = "Host";
31410
+ const hostOptions = document2.createElement("div");
31411
+ hostOptions.className = "settings-connection-host-tabs";
31412
+ hostOptions.setAttribute("role", "group");
31413
+ hostOptions.setAttribute("aria-label", "Host");
31414
+ hostLabel.append(hostCaption, hostOptions);
31415
+ const lockHosts = (locked) => {
31416
+ hostsLocked = locked;
31417
+ for (const button2 of hostButtons) button2.disabled = locked;
31418
+ };
31419
+ const renderHosts = (client) => {
31420
+ const current = selectedHostId ?? (client ? client.hostId ?? "local" : "");
31421
+ availableHostIds = [
31422
+ .../* @__PURE__ */ new Set([
31423
+ ...getDiagnostics()?.snapshot().hosts.map(({ hostId: hostId2 }) => hostId2) ?? [],
31424
+ ...current ? [current] : []
31425
+ ])
31426
+ ];
31427
+ displayedHostId = current;
31428
+ const scrollLeft = hostOptions.scrollLeft;
31429
+ hostOptions.replaceChildren();
31430
+ hostButtons.length = 0;
31431
+ for (const hostId2 of availableHostIds) {
31432
+ const button2 = document2.createElement("button");
31433
+ button2.type = "button";
31434
+ button2.className = "settings-connection-host-tab";
31435
+ button2.dataset.sessionImportHost = hostId2;
31436
+ button2.textContent = connectionHostName(hostId2, messages);
31437
+ button2.setAttribute("aria-pressed", String(hostId2 === current));
31438
+ button2.disabled = hostsLocked;
31439
+ button2.addEventListener("click", () => selectHost(hostId2));
31440
+ hostButtons.push(button2);
31441
+ hostOptions.append(button2);
31442
+ }
31443
+ hostOptions.scrollLeft = scrollLeft;
31444
+ };
30834
31445
  const harness2 = document2.createElement("div");
30835
31446
  harness2.className = "settings-session-import-harness";
30836
31447
  const harnessLabel = document2.createElement("span");
@@ -30891,6 +31502,7 @@ ${detail}` : ""}`
30891
31502
  const listControls = createSessionImportListControls(document2, messages, () => load());
30892
31503
  context.content.append(
30893
31504
  header,
31505
+ hostLabel,
30894
31506
  harness2,
30895
31507
  description,
30896
31508
  availabilityNote,
@@ -30900,9 +31512,11 @@ ${detail}` : ""}`
30900
31512
  listControls.pagination
30901
31513
  );
30902
31514
  let candidates = [];
31515
+ let loadedClient = null;
30903
31516
  let importingId = null;
30904
31517
  let actions = [];
30905
31518
  const updateImportActions = () => {
31519
+ lockHosts(importingId !== null);
30906
31520
  listControls.setBusy(importingId !== null, importingId !== null);
30907
31521
  for (const button2 of sourceButtons) button2.disabled = importingId !== null;
30908
31522
  for (const { button: button2, candidate } of actions) {
@@ -30923,7 +31537,10 @@ ${detail}` : ""}`
30923
31537
  listControls.setTotal(0);
30924
31538
  candidates = [];
30925
31539
  actions = [];
30926
- const status = createStatus(document2, messages.sessionImportUnavailable);
31540
+ const status = createStatus(
31541
+ document2,
31542
+ !displayedHostId && availableHostIds.length > 1 ? messages.sessionImportSelectHost : messages.sessionImportUnavailable
31543
+ );
30927
31544
  content.replaceChildren(status);
30928
31545
  if (focus) {
30929
31546
  status.tabIndex = -1;
@@ -30948,7 +31565,7 @@ ${detail}` : ""}`
30948
31565
  status.focus();
30949
31566
  }
30950
31567
  };
30951
- const renderOpenRecovery = (candidate, threadId) => {
31568
+ const renderOpenRecovery = (candidate, threadId, hostId2) => {
30952
31569
  if (!openImportedThread) return;
30953
31570
  actions = [];
30954
31571
  refresh.disabled = false;
@@ -31001,6 +31618,7 @@ ${detail}` : ""}`
31001
31618
  retry.className = "settings-command-button";
31002
31619
  retry.dataset.sessionImportAction = "retry-open";
31003
31620
  const setRetrying = (pending) => {
31621
+ lockHosts(pending);
31004
31622
  listControls.setBusy(pending, pending);
31005
31623
  for (const button2 of sourceButtons) button2.disabled = pending;
31006
31624
  retry.disabled = pending;
@@ -31015,12 +31633,12 @@ ${detail}` : ""}`
31015
31633
  retry.addEventListener("click", () => {
31016
31634
  if (retry.disabled) return;
31017
31635
  setRetrying(true);
31018
- void context.runLatest((signal) => openImportedThread(threadId, signal), {
31636
+ void context.runLatest((signal) => openImportedThread(threadId, signal, hostId2), {
31019
31637
  success() {
31020
31638
  setRetrying(false);
31021
31639
  },
31022
31640
  failure() {
31023
- renderOpenRecovery(candidate, threadId);
31641
+ renderOpenRecovery(candidate, threadId, hostId2);
31024
31642
  }
31025
31643
  });
31026
31644
  });
@@ -31097,7 +31715,7 @@ ${detail}` : ""}`
31097
31715
  if (candidate.running === true || importingId !== null || selectedHarness === null)
31098
31716
  return;
31099
31717
  const harnessId = selectedHarness;
31100
- const client = getClient();
31718
+ const client = loadedClient;
31101
31719
  if (!client) {
31102
31720
  renderUnavailable(true);
31103
31721
  return;
@@ -31115,7 +31733,7 @@ ${detail}` : ""}`
31115
31733
  });
31116
31734
  committedThreadId = result.threadId;
31117
31735
  if (!signal.aborted && openImportedThread)
31118
- await openImportedThread(result.threadId, signal);
31736
+ await openImportedThread(result.threadId, signal, client.hostId);
31119
31737
  },
31120
31738
  {
31121
31739
  success() {
@@ -31133,7 +31751,7 @@ ${detail}` : ""}`
31133
31751
  updateImportActions();
31134
31752
  refresh.disabled = false;
31135
31753
  if (committedThreadId) {
31136
- renderOpenRecovery(candidate, committedThreadId);
31754
+ renderOpenRecovery(candidate, committedThreadId, client.hostId);
31137
31755
  } else {
31138
31756
  renderFailure(error51, "import");
31139
31757
  }
@@ -31151,23 +31769,22 @@ ${detail}` : ""}`
31151
31769
  };
31152
31770
  const load = () => {
31153
31771
  if (importingId !== null || context.signal.aborted) return;
31154
- const client = getClient();
31155
- if (!client) {
31156
- refresh.disabled = false;
31157
- setRefreshLabel(false);
31158
- renderUnavailable();
31159
- return;
31160
- }
31161
- listControls.setBusy(true);
31162
- refresh.disabled = true;
31163
- setRefreshLabel(true);
31164
- content.replaceChildren(createStatus(document2, messages.sessionImportRefreshing));
31772
+ loadedClient = null;
31773
+ const client = getClient(selectedHostId);
31774
+ renderHosts(client);
31775
+ listControls.setBusy(client !== null);
31776
+ refresh.disabled = client !== null;
31777
+ setRefreshLabel(client !== null);
31778
+ if (client)
31779
+ content.replaceChildren(createStatus(document2, messages.sessionImportRefreshing));
31780
+ else renderUnavailable();
31165
31781
  const requestedHarness = selectedHarness;
31166
31782
  const pageParams = listControls.params();
31167
31783
  void context.runLatest(
31168
31784
  async (signal) => {
31785
+ if (!client) throw new RendererSessionImportUnavailableError();
31169
31786
  const missing = new Set(
31170
- getDiagnostics()?.snapshot().hosts.find(({ hostId: hostId2 }) => hostId2 === "local")?.agents.filter(({ availability }) => availability === "notInstalled").map(({ agent }) => agent)
31787
+ getDiagnostics()?.snapshot().hosts.find(({ hostId: hostId2 }) => hostId2 === (client.hostId ?? "local"))?.agents.filter(({ availability }) => availability === "notInstalled").map(({ agent }) => agent)
31171
31788
  );
31172
31789
  const harnesses = (await client.listSessionImportSources()).harnesses.filter(
31173
31790
  ({ harnessId }) => !missing.has(harnessId)
@@ -31185,6 +31802,7 @@ ${detail}` : ""}`
31185
31802
  },
31186
31803
  {
31187
31804
  success(result) {
31805
+ loadedClient = client;
31188
31806
  listControls.setBusy(false);
31189
31807
  if (listControls.setTotal(result.total)) {
31190
31808
  load();
@@ -31197,6 +31815,7 @@ ${detail}` : ""}`
31197
31815
  else renderCandidates();
31198
31816
  },
31199
31817
  failure(error51) {
31818
+ loadedClient = null;
31200
31819
  listControls.setBusy(false);
31201
31820
  candidates = [];
31202
31821
  refresh.disabled = false;
@@ -31206,6 +31825,19 @@ ${detail}` : ""}`
31206
31825
  }
31207
31826
  );
31208
31827
  };
31828
+ const selectHost = (hostId2) => {
31829
+ if (hostsLocked || !availableHostIds.includes(hostId2) || hostId2 === selectedHostId) return;
31830
+ selectedHostId = hostId2;
31831
+ selectedHarness = null;
31832
+ sources = [];
31833
+ candidates = [];
31834
+ actions = [];
31835
+ importStatus.replaceChildren();
31836
+ listControls.reset();
31837
+ renderHarnessOptions();
31838
+ load();
31839
+ hostButtons.find((button2) => button2.dataset.sessionImportHost === hostId2)?.focus();
31840
+ };
31209
31841
  refresh.addEventListener("click", load);
31210
31842
  load();
31211
31843
  return void 0;
@@ -31346,14 +31978,14 @@ ${detail}` : ""}`
31346
31978
  description: messages.idleReleaseTimeoutDescription,
31347
31979
  controlId: minutesId
31348
31980
  });
31349
- const { field, control: minutes } = createNumberField(document2, {
31981
+ const { field: field2, control: minutes } = createNumberField(document2, {
31350
31982
  id: minutesId,
31351
31983
  describedBy: timeout.description.id,
31352
31984
  unit: messages.idleReleaseMinutes,
31353
31985
  min: IDLE_RELEASE_TIMEOUT_MINUTES_MIN,
31354
31986
  max: IDLE_RELEASE_TIMEOUT_MINUTES_MAX
31355
31987
  });
31356
- timeout.item.append(field);
31988
+ timeout.item.append(field2);
31357
31989
  timeout.item.id = preferenceId("idle-release-timeout");
31358
31990
  enabled.setAttribute("aria-controls", timeout.item.id);
31359
31991
  card.append(toggle.item, timeout.item);
@@ -31374,7 +32006,7 @@ ${detail}` : ""}`
31374
32006
  statusText.textContent = value === "applied" ? "" : statusMessages[value];
31375
32007
  };
31376
32008
  const setInvalid = (invalid) => {
31377
- field.dataset.invalid = String(invalid);
32009
+ field2.dataset.invalid = String(invalid);
31378
32010
  timeout.description.dataset.invalid = String(invalid);
31379
32011
  timeout.description.textContent = invalid ? messages.idleReleaseInvalid : messages.idleReleaseTimeoutDescription;
31380
32012
  minutes.setAttribute("aria-invalid", String(invalid));
@@ -34363,6 +34995,41 @@ ${detail}` : ""}`
34363
34995
  margin-top: 0;
34364
34996
  }
34365
34997
 
34998
+ .settings-session-import-host {
34999
+ display: flex;
35000
+ align-items: center;
35001
+ min-width: 0;
35002
+ gap: 12px;
35003
+ margin: -12px 0 12px;
35004
+ color: var(--settings-muted);
35005
+ font-size: 13px;
35006
+ }
35007
+
35008
+ .settings-session-import-host > span,
35009
+ .settings-session-import-host + .settings-session-import-harness > span {
35010
+ flex: none;
35011
+ min-width: 60px;
35012
+ }
35013
+
35014
+ .settings-session-import-host > .settings-connection-host-tabs {
35015
+ flex: 1;
35016
+ }
35017
+
35018
+ .settings-session-import-host .settings-connection-host-tab {
35019
+ height: 34px;
35020
+ padding: 0 12px;
35021
+ font-size: 13px;
35022
+ }
35023
+
35024
+ .settings-session-import-host .settings-connection-host-tab:disabled {
35025
+ opacity: 0.38;
35026
+ cursor: not-allowed;
35027
+ }
35028
+
35029
+ .settings-session-import-host + .settings-session-import-harness {
35030
+ margin-top: 0;
35031
+ }
35032
+
34366
35033
  .settings-session-import-search,
34367
35034
  .settings-session-import-pagination {
34368
35035
  display: flex;
@@ -34719,7 +35386,8 @@ ${detail}` : ""}`
34719
35386
  background: var(--settings-hover);
34720
35387
  }
34721
35388
 
34722
- .settings-connection-host-tab[aria-selected="true"] {
35389
+ .settings-connection-host-tab[aria-selected="true"],
35390
+ .settings-connection-host-tab[aria-pressed="true"] {
34723
35391
  color: var(--settings-text);
34724
35392
  font-weight: 600;
34725
35393
  background: var(--settings-active);
@@ -39015,11 +39683,11 @@ ${usage_default}`;
39015
39683
  options.getConnectionDiagnostics ?? (() => null),
39016
39684
  options.getAccountClient ?? (() => null),
39017
39685
  options.getSessionImportClient ?? (() => null),
39018
- async (threadId, signal) => {
39686
+ async (threadId, signal, hostId2) => {
39019
39687
  if (!options.openImportedThread) {
39020
39688
  throw new Error("Imported Thread navigation is unavailable");
39021
39689
  }
39022
- await options.openImportedThread(threadId, signal);
39690
+ await options.openImportedThread(threadId, signal, hostId2);
39023
39691
  if (!disposed && !signal.aborted) shell?.close();
39024
39692
  },
39025
39693
  options.getLoadedSessionsClient ?? (() => null),
@@ -40033,9 +40701,13 @@ ${usage_default}`;
40033
40701
  function mutationMayAffectComposer(mutation) {
40034
40702
  const target = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
40035
40703
  if (!target) return true;
40036
- if (mutation.type === "attributes" && mutation.attributeName === "data-codex-composer-root")
40704
+ if (mutation.type === "attributes" && (mutation.attributeName === "data-codex-composer-root" || NATIVE_COMPOSER_REQUEST_ATTRIBUTES.some((attribute) => attribute === mutation.attributeName)))
40037
40705
  return true;
40038
- if (mutation.type !== "attributes" && editorForElement(target)) return false;
40706
+ if (mutation.type !== "attributes" && editorForElement(target)) {
40707
+ return mutation.type === "childList" && [...mutation.addedNodes, ...mutation.removedNodes].some(
40708
+ (node) => node instanceof Element && hasNativeComposerRequest(node)
40709
+ );
40710
+ }
40039
40711
  if (target.closest(CODEX_COMPOSER_SELECTOR)) return true;
40040
40712
  if (mutation.type === "characterData") return false;
40041
40713
  if (!target.closest(
@@ -40139,19 +40811,22 @@ ${usage_default}`;
40139
40811
  getLoadedSessionsClient: () => modelClientForHost("local"),
40140
40812
  requestUsageStatistics: usageStatistics.request,
40141
40813
  usageStatisticsHosts: usageStatistics.hosts,
40142
- getSessionImportClient: () => {
40143
- const client = modelClientForHost("local");
40814
+ getSessionImportClient: (requestedHostId) => {
40815
+ const hostId2 = requestedHostId ?? activeModelHostId();
40816
+ if (!hostId2) return null;
40817
+ const client = modelClientForHost(hostId2);
40144
40818
  const sources = client?.listSessionImportSources;
40145
40819
  const list = client?.listHarnessSessions;
40146
40820
  const importSession = client?.importHarnessSession;
40147
40821
  if (!sources || !list || !importSession) return null;
40148
40822
  return {
40823
+ hostId: hostId2,
40149
40824
  listSessionImportSources: () => sources(),
40150
40825
  listHarnessSessions: (input) => list(input),
40151
40826
  importHarnessSession: (input) => importSession(input)
40152
40827
  };
40153
40828
  },
40154
- openImportedThread: (threadId, signal) => openRendererThread(threadId, { hostId: "local", signal }),
40829
+ openImportedThread: (threadId, signal, hostId2) => openRendererThread(threadId, { hostId: hostId2 ?? "local", signal }),
40155
40830
  onLocaleChange() {
40156
40831
  for (const mounted of mountedByComposer.values()) renderMounted(mounted);
40157
40832
  }
@@ -40222,7 +40897,7 @@ ${usage_default}`;
40222
40897
  const ownershipRecovery = /* @__PURE__ */ new WeakMap();
40223
40898
  const modelRecovery = /* @__PURE__ */ new WeakMap();
40224
40899
  const isRetainedComposer = (mounted) => mounted.composer.isConnected && mounted.composer.matches(CODEX_COMPOSER_SELECTOR) && mountedByComposer.get(mounted.composer) === mounted;
40225
- const isMountedComposer = (composer) => composer.isConnected && composer.matches(CODEX_COMPOSER_SELECTOR) && orbitComposerKind(composer) === "codex" && mountedByComposer.has(composer);
40900
+ const isMountedComposer = (composer) => composer.isConnected && composer.matches(CODEX_COMPOSER_SELECTOR) && !hasNativeComposerRequest(composer) && orbitComposerKind(composer) === "codex" && mountedByComposer.has(composer);
40226
40901
  const isCurrentModelRequest = (mounted, generation) => isMountedComposer(mounted.composer) && mountedByComposer.get(mounted.composer) === mounted && controller.isCurrentModelRequest(mounted.composer, generation);
40227
40902
  const isCurrentOwnershipRequest = (mounted, generation) => isMountedComposer(mounted.composer) && mountedByComposer.get(mounted.composer) === mounted && controller.isCurrentOwnershipRequest(mounted.composer, generation);
40228
40903
  const finishModelRequest = (mounted, generation) => {
@@ -41617,10 +42292,10 @@ ${usage_default}`;
41617
42292
  }
41618
42293
  };
41619
42294
  const mount = (composer) => {
41620
- if (mountedByComposer.has(composer) || !composer.isConnected || orbitComposerKind(composer) !== "codex" || !composer.matches(CODEX_COMPOSER_SELECTOR)) {
42295
+ if (mountedByComposer.has(composer) || !composer.isConnected || hasNativeComposerRequest(composer) || orbitComposerKind(composer) !== "codex" || !composer.matches(CODEX_COMPOSER_SELECTOR)) {
41621
42296
  return;
41622
42297
  }
41623
- const allButtons = [...composer.querySelectorAll("button")];
42298
+ const allButtons = composerButtonsWithin(composer);
41624
42299
  const sendButton = sendButtonWithin(composer) ?? allButtons.at(-1) ?? null;
41625
42300
  if (!sendButton) return;
41626
42301
  const modelTarget = findComposerModelTarget(composer);
@@ -41715,7 +42390,7 @@ ${usage_default}`;
41715
42390
  const sourceState = controller.get(replacement.source.composer);
41716
42391
  const replacementTarget = findComposerModelTarget(target);
41717
42392
  const replacementHostId = activeModelHostId(target);
41718
- if (orbitComposerKind(target) !== "codex" || !shouldTransferComposerState(
42393
+ if (hasNativeComposerRequest(target) || orbitComposerKind(target) !== "codex" || !shouldTransferComposerState(
41719
42394
  replacement.sourceModelTarget,
41720
42395
  replacementTarget,
41721
42396
  sourceState.phase,
@@ -41732,7 +42407,7 @@ ${usage_default}`;
41732
42407
  }
41733
42408
  for (const [composer, mounted] of mountedByComposer) {
41734
42409
  const kind = orbitComposerKind(composer);
41735
- if (!composer.isConnected || kind === "orbit" || !composer.matches(CODEX_COMPOSER_SELECTOR) || !mounted.control.root.isConnected) {
42410
+ if (!composer.isConnected || hasNativeComposerRequest(composer) || kind === "orbit" || !composer.matches(CODEX_COMPOSER_SELECTOR) || !mounted.control.root.isConnected) {
41736
42411
  mounted.usageRequestGeneration += 1;
41737
42412
  usageRefreshAttempts.delete(composer);
41738
42413
  const timer = usageRefreshTimers.get(composer);
@@ -41781,6 +42456,7 @@ ${usage_default}`;
41781
42456
  void refreshHarnessAvailability();
41782
42457
  }
41783
42458
  pendingReplacements.clear();
42459
+ questions.refreshContext();
41784
42460
  };
41785
42461
  const scheduleScan = (refreshTargets = false) => {
41786
42462
  refreshTargetsOnNextScan ||= refreshTargets;
@@ -41964,7 +42640,12 @@ ${usage_default}`;
41964
42640
  };
41965
42641
  mutationObserver.observe(document.documentElement, {
41966
42642
  attributes: true,
41967
- attributeFilter: ["hidden", "aria-hidden", "data-codex-composer-root"],
42643
+ attributeFilter: [
42644
+ "hidden",
42645
+ "aria-hidden",
42646
+ "data-codex-composer-root",
42647
+ ...NATIVE_COMPOSER_REQUEST_ATTRIBUTES
42648
+ ],
41968
42649
  characterData: true,
41969
42650
  childList: true,
41970
42651
  subtree: true
@@ -42061,6 +42742,16 @@ ${usage_default}`;
42061
42742
  const connectedComposers = () => [...mountedByComposer.values()].filter(
42062
42743
  (mounted) => isMountedComposer(mounted.composer) && mounted.control.root.isConnected
42063
42744
  );
42745
+ const questions = installRendererQuestions(window, () => {
42746
+ const visible = connectedComposers().filter(
42747
+ (mounted2) => mounted2.composer.getClientRects().length > 0 && window.getComputedStyle(mounted2.composer).visibility === "visible" && !mounted2.composer.closest('[hidden], [inert], [aria-hidden="true"]') && controller.get(mounted2.composer).agent !== "codex"
42748
+ );
42749
+ const mounted = visible.length === 1 ? visible[0] : void 0;
42750
+ const threadId = mounted ? threadIdFromComposerModelTarget(findComposerModelTarget(mounted.composer)) : null;
42751
+ const hostId2 = mounted?.hostId;
42752
+ const route = hostId2 ? window.__codexhostHostRoutingV1?.forHost(hostId2) : null;
42753
+ return mounted && threadId && hostId2 && route ? { hostId: hostId2, threadId, composer: mounted.composer, route: route.manager } : null;
42754
+ });
42064
42755
  const api = {
42065
42756
  remoteConnections: (request) => handleRemoteConnectionsRequest(remoteConnections, request),
42066
42757
  currentThreadId() {
@@ -42152,6 +42843,7 @@ ${usage_default}`;
42152
42843
  dispose() {
42153
42844
  if (disposed) return;
42154
42845
  disposed = true;
42846
+ questions.dispose();
42155
42847
  usageNotificationDispose();
42156
42848
  adapterDispose?.();
42157
42849
  adapterDispose = null;
@@ -42232,6 +42924,10 @@ ${usage_default}`;
42232
42924
 
42233
42925
  lucide/dist/esm/defaultAttributes.mjs:
42234
42926
  lucide/dist/esm/createElement.mjs:
42927
+ lucide/dist/esm/icons/check.mjs:
42928
+ lucide/dist/esm/icons/message-circle-question-mark.mjs:
42929
+ lucide/dist/esm/icons/pencil.mjs:
42930
+ lucide/dist/esm/icons/x.mjs:
42235
42931
  lucide/dist/esm/icons/boxes.mjs:
42236
42932
  lucide/dist/esm/icons/circle-check.mjs:
42237
42933
  lucide/dist/esm/icons/chevron-down.mjs:
@@ -42267,11 +42963,10 @@ lucide/dist/esm/icons/terminal.mjs:
42267
42963
  lucide/dist/esm/icons/scroll-text.mjs:
42268
42964
  lucide/dist/esm/icons/search.mjs:
42269
42965
  lucide/dist/esm/icons/circle-question-mark.mjs:
42270
- lucide/dist/esm/icons/x.mjs:
42271
42966
  lucide/dist/esm/icons/users.mjs:
42272
42967
  lucide/dist/esm/icons/plus.mjs:
42273
42968
  lucide/dist/esm/icons/circle-alert.mjs:
42274
- lucide/dist/esm/icons/check.mjs:
42969
+ lucide/dist/esm/icons/activity.mjs:
42275
42970
  lucide/dist/esm/icons/lock.mjs:
42276
42971
  lucide/dist/esm/icons/shield.mjs:
42277
42972
  lucide/dist/esm/icons/shield-alert.mjs: