@codex-app-sdk/vue 0.21.1 → 0.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { Comment as e, Fragment as t, Teleport as n, Text as r, Transition as i, TransitionGroup as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createSlots as d, createStaticVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, getCurrentScope as g, guardReactiveProps as _, h as v, hasInjectionContext as y, inject as b, isMemoSame as x, mergeProps as S, nextTick as C, normalizeClass as w, normalizeProps as T, normalizeStyle as E, onBeforeUnmount as D, onMounted as ee, onScopeDispose as O, openBlock as k, provide as A, reactive as j, readonly as M, ref as N, render as te, renderList as P, renderSlot as F, resolveComponent as I, resolveDynamicComponent as L, shallowReactive as ne, shallowRef as R, toDisplayString as z, toValue as B, unref as V, useSlots as re, vModelText as H, vShow as ie, watch as U, withCtx as W, withDirectives as G, withKeys as K, withModifiers as q } from "vue";
2
- import { normalizePromptContent as ae, promptContentDispatchText as oe, promptContentText as se, replacePromptContentRange as ce, slicePromptContent as le, trimPromptContent as ue } from "@codex-app-sdk/core/surface";
3
- import { Lexer as de, Marked as fe, Renderer as J } from "marked";
4
- import { IconArrowDown as Y, IconArrowFork as pe, IconBolt as me, IconBrain as he, IconCheck as ge, IconCheck as _e, IconChevronDown as ve, IconChevronLeft as ye, IconChevronRight as be, IconChevronUp as X, IconCircleX as xe, IconCode as Se, IconCopy as Ce, IconDownload as we, IconExternalLink as Te, IconEye as Ee, IconFileText as De, IconFolder as Oe, IconHandStop as ke, IconInfoCircle as Ae, IconLayoutDashboard as je, IconListDetails as Me, IconLoader2 as Ne, IconMaximize as Pe, IconMessageQuestion as Fe, IconMicrophone as Ie, IconMicrophoneOff as Le, IconPaperclip as Re, IconPencil as ze, IconPhoto as Be, IconPlayerPlayFilled as Ve, IconPlugConnected as He, IconPlus as Ue, IconQuote as We, IconRotateClockwise as Ge, IconSearch as Ke, IconShieldCheck as qe, IconSparkleHighlight as Je, IconSparkles as Ye, IconSquareCheck as Xe, IconSquareDashed as Ze, IconSquareX as Qe, IconSteeringWheel as $e, IconTargetArrow as et, IconTerminal as tt, IconTerminal2 as nt, IconTool as rt, IconTrash as it, IconWorldSearch as at, IconX as ot } from "@tabler/icons-vue";
1
+ import { Comment as e, Fragment as t, Teleport as n, Text as r, Transition as i, TransitionGroup as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createSlots as d, createStaticVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, getCurrentScope as g, guardReactiveProps as _, h as v, hasInjectionContext as y, inject as b, isMemoSame as x, mergeProps as S, nextTick as C, normalizeClass as w, normalizeProps as T, normalizeStyle as E, onBeforeUnmount as D, onMounted as ee, onScopeDispose as O, openBlock as k, provide as A, reactive as j, readonly as M, ref as N, render as te, renderList as P, renderSlot as F, resolveComponent as I, resolveDynamicComponent as L, shallowReactive as ne, shallowRef as R, toDisplayString as z, toValue as B, unref as V, useSlots as H, vModelText as U, vShow as re, watch as W, withCtx as G, withDirectives as K, withKeys as q, withModifiers as J } from "vue";
2
+ import { normalizePromptContent as ie, promptContentDispatchText as ae, promptContentText as oe, replacePromptContentRange as se, slicePromptContent as ce, trimPromptContent as le } from "@codex-app-sdk/core/surface";
3
+ import { Lexer as ue, Marked as de, Renderer as Y } from "marked";
4
+ import { IconArrowDown as X, IconArrowFork as fe, IconBolt as pe, IconBrain as me, IconCheck as he, IconCheck as ge, IconChevronDown as _e, IconChevronLeft as ve, IconChevronRight as ye, IconChevronUp as be, IconCircleX as xe, IconCode as Se, IconCopy as Ce, IconDownload as we, IconExternalLink as Te, IconEye as Ee, IconFileText as De, IconFolder as Oe, IconHandStop as ke, IconInfoCircle as Ae, IconLayoutDashboard as je, IconListDetails as Me, IconLoader2 as Ne, IconMaximize as Pe, IconMessageQuestion as Fe, IconMicrophone as Ie, IconMicrophoneOff as Le, IconPaperclip as Re, IconPencil as ze, IconPhoto as Be, IconPlayerPlayFilled as Ve, IconPlugConnected as He, IconPlus as Ue, IconQuote as We, IconRotateClockwise as Ge, IconSearch as Ke, IconShieldCheck as qe, IconSparkleHighlight as Je, IconSparkles as Ye, IconSquareCheck as Xe, IconSquareDashed as Ze, IconSquareX as Qe, IconSteeringWheel as $e, IconTargetArrow as et, IconTerminal as tt, IconTerminal2 as nt, IconTool as rt, IconTrash as it, IconWorldSearch as at, IconX as ot } from "@tabler/icons-vue";
5
5
  import st from "fix-webm-duration";
6
6
  import { renderMermaidSVG as ct } from "beautiful-mermaid";
7
7
  import lt from "katex";
@@ -348,7 +348,7 @@ function ln(e, t) {
348
348
  //#endregion
349
349
  //#region src/chat/user-text.ts
350
350
  function un(e, t, n = [], r = [], i = []) {
351
- return t === void 0 ? fn(e, n, r, i, !1) : ae(t).flatMap((e) => e.type === "text" ? mn(e.text, (e) => e.split(/(`[^`\n]+`|\n)/g).filter(Boolean).map((e) => e === "\n" ? { type: "line-break" } : e.startsWith("`") && e.endsWith("`") ? {
351
+ return t === void 0 ? fn(e, n, r, i, !1) : ie(t).flatMap((e) => e.type === "text" ? mn(e.text, (e) => e.split(/(`[^`\n]+`|\n)/g).filter(Boolean).map((e) => e === "\n" ? { type: "line-break" } : e.startsWith("`") && e.endsWith("`") ? {
352
352
  type: "code",
353
353
  text: e.slice(1, -1)
354
354
  } : {
@@ -396,7 +396,7 @@ function fn(e, t = [], n = [], r = [], i = !0) {
396
396
  return mn(e, (e) => hn(e, t, n, r, i));
397
397
  }
398
398
  function pn(e, t = [], n = [], r = []) {
399
- return ae(fn(e, t, n, r, !1).map((e) => {
399
+ return ie(fn(e, t, n, r, !1).map((e) => {
400
400
  switch (e.type) {
401
401
  case "skill-mention": return {
402
402
  type: "mention",
@@ -443,7 +443,7 @@ function pn(e, t = [], n = [], r = []) {
443
443
  }));
444
444
  }
445
445
  function mn(e, t) {
446
- return /https?:\/\//i.test(e) ? de.lexInline(e, { gfm: !0 }).flatMap((e) => {
446
+ return /https?:\/\//i.test(e) ? ue.lexInline(e, { gfm: !0 }).flatMap((e) => {
447
447
  let n = e.type === "link" && /^https?:\/\//i.test(e.raw) ? Vt(e.href) : null;
448
448
  return n?.kind === "external" ? [{
449
449
  type: "link",
@@ -622,21 +622,21 @@ var Tn = [
622
622
  "disabled",
623
623
  "aria-disabled",
624
624
  "aria-label"
625
- ], Z = {
625
+ ], En = {
626
626
  key: 1,
627
627
  class: "codex-composer-send-button__spinner",
628
628
  "aria-hidden": "true",
629
629
  width: "16",
630
630
  height: "16",
631
631
  viewBox: "0 0 16 16"
632
- }, Q = {
632
+ }, Z = {
633
633
  key: 2,
634
634
  class: "codex-composer-send-button__stop",
635
635
  "aria-hidden": "true",
636
636
  width: "16",
637
637
  height: "16",
638
638
  viewBox: "0 0 16 16"
639
- }, En = /*@__PURE__*/ h({
639
+ }, Q = /*@__PURE__*/ h({
640
640
  __name: "CodexComposerSendButton",
641
641
  props: {
642
642
  busy: {
@@ -684,7 +684,7 @@ var Tn = [
684
684
  "aria-hidden": "true",
685
685
  size: 16
686
686
  })) : c("", !0),
687
- e.busy ? (k(), l("svg", Z, [...n[2] ||= [u("circle", {
687
+ e.busy ? (k(), l("svg", En, [...n[2] ||= [u("circle", {
688
688
  cx: "8",
689
689
  cy: "8",
690
690
  r: "6",
@@ -694,7 +694,7 @@ var Tn = [
694
694
  "stroke-dasharray": "28",
695
695
  "stroke-dashoffset": "10"
696
696
  }, null, -1)]])) : c("", !0),
697
- e.busy || e.interruptArmed ? (k(), l("svg", Q, [...n[3] ||= [u("rect", {
697
+ e.busy || e.interruptArmed ? (k(), l("svg", Z, [...n[3] ||= [u("rect", {
698
698
  x: "4",
699
699
  y: "4",
700
700
  width: "8",
@@ -708,7 +708,7 @@ var Tn = [
708
708
  let n = e.__vccOpts || e;
709
709
  for (let [e, r] of t) n[e] = r;
710
710
  return n;
711
- }, Dn = /*#__PURE__*/ $(En, [["__scopeId", "data-v-8a422712"]]), On = {
711
+ }, Dn = /*#__PURE__*/ $(Q, [["__scopeId", "data-v-8a422712"]]), On = {
712
712
  key: 0,
713
713
  class: "codex-chat-theme chat-composer__modes",
714
714
  "aria-label": "Active composer modes"
@@ -857,7 +857,7 @@ function Ln(e, t, n, r, i) {
857
857
  Bn(e, zn(e)[0]);
858
858
  });
859
859
  }
860
- }, [...Vn(e, t).nodes, v(be, {
860
+ }, [...Vn(e, t).nodes, v(ye, {
861
861
  class: "codex-composer-menu-list__chevron",
862
862
  "aria-hidden": "true"
863
863
  })]), a ? In(e.items, e.label, t, (t) => {
@@ -940,7 +940,7 @@ function Vn(e, t) {
940
940
  leadingRadioCheck: !1
941
941
  };
942
942
  let r = t.icon?.({ item: e }), i = e.type === "radio" && e.checked && !r?.length, a;
943
- return a = r?.length ? r : i ? [v(_e, {
943
+ return a = r?.length ? r : i ? [v(ge, {
944
944
  class: "codex-composer-menu-list__icon codex-composer-menu-list__radio-check",
945
945
  "aria-hidden": "true"
946
946
  })] : "leadingColor" in e && e.leadingColor ? [v("span", {
@@ -993,11 +993,11 @@ var Wn = /* @__PURE__ */ h({
993
993
  onSelect: r
994
994
  }, d({ _: 2 }, [t.$slots.icon ? {
995
995
  name: "icon",
996
- fn: W((e) => [F(t.$slots, "icon", T(_(e)))]),
996
+ fn: G((e) => [F(t.$slots, "icon", T(_(e)))]),
997
997
  key: "0"
998
998
  } : void 0, t.$slots.item ? {
999
999
  name: "item",
1000
- fn: W((e) => [F(t.$slots, "item", T(_(e)))]),
1000
+ fn: G((e) => [F(t.$slots, "item", T(_(e)))]),
1001
1001
  key: "1"
1002
1002
  } : void 0]), 1032, ["aria-label", "items"]));
1003
1003
  }
@@ -1024,7 +1024,7 @@ var Wn = /* @__PURE__ */ h({
1024
1024
  emits: ["select", "update:open"],
1025
1025
  setup(e, { expose: t, emit: n }) {
1026
1026
  let r = e, i = n, a = N(null), f = N(null), p = N(!1), m = o(() => r.open ?? p.value);
1027
- ee(() => document.addEventListener("click", y)), D(() => document.removeEventListener("click", y)), U(m, async (e) => {
1027
+ ee(() => document.addEventListener("click", y)), D(() => document.removeEventListener("click", y)), W(m, async (e) => {
1028
1028
  if (!e) return;
1029
1029
  await C();
1030
1030
  let t = a.value?.querySelector(".codex-composer-menu__list > button[role^=\"menuitem\"], .codex-composer-menu__list > div > button[role^=\"menuitem\"]");
@@ -1053,7 +1053,7 @@ var Wn = /* @__PURE__ */ h({
1053
1053
  ref_key: "root",
1054
1054
  ref: a,
1055
1055
  class: "codex-chat-theme codex-composer-menu",
1056
- onKeydown: n[0] ||= K(q((e) => v(!0), ["prevent", "stop"]), ["escape"])
1056
+ onKeydown: n[0] ||= q(J((e) => v(!0), ["prevent", "stop"]), ["escape"])
1057
1057
  }, [F(t.$slots, "trigger", {
1058
1058
  open: m.value,
1059
1059
  toggle: g
@@ -1084,11 +1084,11 @@ var Wn = /* @__PURE__ */ h({
1084
1084
  onSelect: b
1085
1085
  }, d({ _: 2 }, [t.$slots.icon ? {
1086
1086
  name: "icon",
1087
- fn: W((e) => [F(t.$slots, "icon", T(_(e)), void 0, !0)]),
1087
+ fn: G((e) => [F(t.$slots, "icon", T(_(e)), void 0, !0)]),
1088
1088
  key: "0"
1089
1089
  } : void 0, t.$slots.item ? {
1090
1090
  name: "item",
1091
- fn: W((e) => [F(t.$slots, "item", T(_(e)), void 0, !0)]),
1091
+ fn: G((e) => [F(t.$slots, "item", T(_(e)), void 0, !0)]),
1092
1092
  key: "1"
1093
1093
  } : void 0]), 1032, [
1094
1094
  "class",
@@ -1224,7 +1224,7 @@ var Wn = /* @__PURE__ */ h({
1224
1224
  items: a.value,
1225
1225
  onSelect: f
1226
1226
  }, d({
1227
- trigger: W(({ open: t, toggle: n }) => [u("button", {
1227
+ trigger: G(({ open: t, toggle: n }) => [u("button", {
1228
1228
  class: "chat-composer-action-menu__button",
1229
1229
  type: "button",
1230
1230
  "aria-label": "Composer actions",
@@ -1236,11 +1236,11 @@ var Wn = /* @__PURE__ */ h({
1236
1236
  _: 2
1237
1237
  }, [t.$slots.icon ? {
1238
1238
  name: "icon",
1239
- fn: W((e) => [F(t.$slots, "icon", T(_(e)), void 0, !0)]),
1239
+ fn: G((e) => [F(t.$slots, "icon", T(_(e)), void 0, !0)]),
1240
1240
  key: "0"
1241
1241
  } : void 0, t.$slots.item ? {
1242
1242
  name: "item",
1243
- fn: W((e) => [F(t.$slots, "item", T(_(e)), void 0, !0)]),
1243
+ fn: G((e) => [F(t.$slots, "item", T(_(e)), void 0, !0)]),
1244
1244
  key: "1"
1245
1245
  } : void 0]), 1032, ["disabled", "items"])) : c("", !0);
1246
1246
  }
@@ -1260,7 +1260,7 @@ var Wn = /* @__PURE__ */ h({
1260
1260
  emits: ["toggle"],
1261
1261
  setup(e, { emit: t }) {
1262
1262
  let n = e, r = t, i = N(!1);
1263
- return U(() => n.recording, () => {
1263
+ return W(() => n.recording, () => {
1264
1264
  i.value = !1;
1265
1265
  }), (t, n) => (k(), l("button", {
1266
1266
  class: w(["codex-chat-theme chat-composer__voice", { "chat-composer__voice--recording": e.recording }]),
@@ -1739,7 +1739,7 @@ var Ir = ["aria-label"], Lr = {
1739
1739
  "update:serviceTier"
1740
1740
  ],
1741
1741
  setup(e, { emit: t }) {
1742
- let n = e, r = t, i = o(() => n.models.find((e) => e.id === n.modelId) ?? n.models.find((e) => e.isDefault) ?? n.models[0] ?? null), a = o(() => i.value?.supportedReasoningEfforts ?? []), d = o(() => n.showReasoning && a.value.length > 0), f = o(() => n.reasoningEffort ?? i.value?.defaultReasoningEffort ?? a.value[0]?.reasoningEffort ?? null), p = o(() => i.value?.serviceTiers ?? []), h = o(() => n.showServiceTier && p.value.length > 0), g = o(() => p.value.find((e) => /^(fast|priority)$/i.test(e.id) || /\b(fast|priority)\b/i.test(e.name)) ?? null), _ = o(() => p.value.find((e) => /^ultrafast$/i.test(e.id) || /\bultra[ -]?fast\b/i.test(e.name)) ?? null), v = o(() => [g.value, _.value].filter((e) => e !== null)), y = o(() => v.value.find((e) => e.id === n.serviceTier)), b = (e) => e ? e === _.value?.id ? "Ultrafast" : "Fast mode" : "Normal speed", x = o(() => y.value && y.value === _.value ? Hr : me), S = o(() => y.value?.description ?? "Default processing for this model."), C = o(() => n.disabled), T = o(() => {
1742
+ let n = e, r = t, i = o(() => n.models.find((e) => e.id === n.modelId) ?? n.models.find((e) => e.isDefault) ?? n.models[0] ?? null), a = o(() => i.value?.supportedReasoningEfforts ?? []), d = o(() => n.showReasoning && a.value.length > 0), f = o(() => n.reasoningEffort ?? i.value?.defaultReasoningEffort ?? a.value[0]?.reasoningEffort ?? null), p = o(() => i.value?.serviceTiers ?? []), h = o(() => n.showServiceTier && p.value.length > 0), g = o(() => p.value.find((e) => /^(fast|priority)$/i.test(e.id) || /\b(fast|priority)\b/i.test(e.name)) ?? null), _ = o(() => p.value.find((e) => /^ultrafast$/i.test(e.id) || /\bultra[ -]?fast\b/i.test(e.name)) ?? null), v = o(() => [g.value, _.value].filter((e) => e !== null)), y = o(() => v.value.find((e) => e.id === n.serviceTier)), b = (e) => e ? e === _.value?.id ? "Ultrafast" : "Fast mode" : "Normal speed", x = o(() => y.value && y.value === _.value ? Hr : pe), S = o(() => y.value?.description ?? "Default processing for this model."), C = o(() => n.disabled), T = o(() => {
1743
1743
  let e = [];
1744
1744
  n.menuItems.length > 0 && (e.push(...M(n.menuItems)), e.push({
1745
1745
  id: "host-model-menu-separator",
@@ -1818,7 +1818,7 @@ var Ir = ["aria-label"], Lr = {
1818
1818
  type: "radio",
1819
1819
  label: b(e?.id),
1820
1820
  checked: e ? e.id === n.serviceTier : !y.value,
1821
- icon: e === _.value ? Hr : e ? me : void 0,
1821
+ icon: e === _.value ? Hr : e ? pe : void 0,
1822
1822
  payload: {
1823
1823
  source: "selector",
1824
1824
  kind: "serviceTier",
@@ -1829,7 +1829,7 @@ var Ir = ["aria-label"], Lr = {
1829
1829
  else {
1830
1830
  let n = g.value;
1831
1831
  e.push({
1832
- accessory: me,
1832
+ accessory: pe,
1833
1833
  checked: !!y.value,
1834
1834
  closeOnSelect: !1,
1835
1835
  ...t,
@@ -1915,12 +1915,12 @@ var Ir = ["aria-label"], Lr = {
1915
1915
  title: E.value,
1916
1916
  disabled: ""
1917
1917
  }, [
1918
- m(V(he), {
1918
+ m(V(me), {
1919
1919
  class: "chat-model-selector__compact-icon",
1920
1920
  "aria-hidden": "true"
1921
1921
  }),
1922
1922
  u("span", Wr, z(E.value), 1),
1923
- m(V(ve), {
1923
+ m(V(_e), {
1924
1924
  class: "chat-model-selector__chevron",
1925
1925
  "aria-hidden": "true"
1926
1926
  })
@@ -1933,7 +1933,7 @@ var Ir = ["aria-label"], Lr = {
1933
1933
  "menu-class": "chat-model-selector__menu",
1934
1934
  onSelect: j
1935
1935
  }, {
1936
- trigger: W(({ open: e, toggle: t }) => [u("button", {
1936
+ trigger: G(({ open: e, toggle: t }) => [u("button", {
1937
1937
  class: "chat-model-selector__button",
1938
1938
  type: "button",
1939
1939
  "aria-label": "Model and reasoning",
@@ -1943,7 +1943,7 @@ var Ir = ["aria-label"], Lr = {
1943
1943
  disabled: C.value,
1944
1944
  onClick: t
1945
1945
  }, [
1946
- m(V(he), {
1946
+ m(V(me), {
1947
1947
  class: "chat-model-selector__compact-icon",
1948
1948
  "aria-hidden": "true"
1949
1949
  }),
@@ -1953,7 +1953,7 @@ var Ir = ["aria-label"], Lr = {
1953
1953
  "aria-hidden": "true"
1954
1954
  })) : c("", !0),
1955
1955
  u("span", Kr, z(E.value), 1),
1956
- m(V(ve), {
1956
+ m(V(_e), {
1957
1957
  class: "chat-model-selector__chevron",
1958
1958
  "aria-hidden": "true"
1959
1959
  })
@@ -2003,7 +2003,7 @@ var Ir = ["aria-label"], Lr = {
2003
2003
  class: w(["chat-composer-at-menu__item", { "chat-composer-at-menu__item--active": s(r.id, t.id) === e.activeIndex }]),
2004
2004
  role: "option",
2005
2005
  type: "button",
2006
- onMousedown: q((e) => n.$emit("select-mention", t, r), ["prevent"])
2006
+ onMousedown: J((e) => n.$emit("select-mention", t, r), ["prevent"])
2007
2007
  }, [F(n.$slots, "mention", {
2008
2008
  group: r,
2009
2009
  item: t,
@@ -2017,7 +2017,7 @@ var Ir = ["aria-label"], Lr = {
2017
2017
  class: w(["chat-composer-at-menu__item", { "chat-composer-at-menu__item--active": a.value + r === e.activeIndex }]),
2018
2018
  role: "option",
2019
2019
  type: "button",
2020
- onMousedown: q((e) => n.$emit("select-plugin", t), ["prevent"])
2020
+ onMousedown: J((e) => n.$emit("select-plugin", t), ["prevent"])
2021
2021
  }, [m(V(He), {
2022
2022
  class: "chat-composer-at-menu__icon",
2023
2023
  "aria-hidden": "true"
@@ -2027,7 +2027,7 @@ var Ir = ["aria-label"], Lr = {
2027
2027
  class: w(["chat-composer-at-menu__item", { "chat-composer-at-menu__item--active": a.value + e.visiblePlugins.length + r === e.activeIndex }]),
2028
2028
  role: "option",
2029
2029
  type: "button",
2030
- onMousedown: q((e) => n.$emit("select-file", t), ["prevent"])
2030
+ onMousedown: J((e) => n.$emit("select-file", t), ["prevent"])
2031
2031
  }, [m(V(De), {
2032
2032
  class: "chat-composer-at-menu__icon",
2033
2033
  "aria-hidden": "true"
@@ -2037,7 +2037,7 @@ var Ir = ["aria-label"], Lr = {
2037
2037
  class: w(["chat-composer-at-menu__item", { "chat-composer-at-menu__item--active": s(r.id, t.id) === e.activeIndex }]),
2038
2038
  role: "option",
2039
2039
  type: "button",
2040
- onMousedown: q((e) => n.$emit("select-mention", t, r), ["prevent"])
2040
+ onMousedown: J((e) => n.$emit("select-mention", t, r), ["prevent"])
2041
2041
  }, [F(n.$slots, "mention", {
2042
2042
  group: r,
2043
2043
  item: t,
@@ -2065,7 +2065,7 @@ var Ir = ["aria-label"], Lr = {
2065
2065
  emits: ["select"],
2066
2066
  setup(e) {
2067
2067
  let n = e, r = Pr(), i = N(null);
2068
- return U(() => [n.activeIndex, n.visibleSkills], async () => {
2068
+ return W(() => [n.activeIndex, n.visibleSkills], async () => {
2069
2069
  await C();
2070
2070
  let e = i.value?.querySelectorAll(".chat-composer-skill-menu__item").item(n.activeIndex);
2071
2071
  typeof e?.scrollIntoView == "function" && e.scrollIntoView({ block: "nearest" });
@@ -2082,7 +2082,7 @@ var Ir = ["aria-label"], Lr = {
2082
2082
  class: w(["chat-composer-skill-menu__item", { "chat-composer-skill-menu__item--active": r === e.activeIndex }]),
2083
2083
  role: "option",
2084
2084
  type: "button",
2085
- onMousedown: q((e) => n.$emit("select", t), ["prevent"])
2085
+ onMousedown: J((e) => n.$emit("select", t), ["prevent"])
2086
2086
  }, [u("span", si, [m(V(Je))]), u("span", ci, [u("span", li, z(V(Zt)(t, e.plugins ?? [])), 1), u("span", ui, z(V(Qt)(t)), 1)])], 42, oi))), 128)),
2087
2087
  e.visibleSkills.length === 0 ? (k(), l("div", di, z(V(r)("chat.skills.empty")), 1)) : c("", !0)
2088
2088
  ], 512));
@@ -2132,7 +2132,7 @@ var gi = { class: "chat-composer-slash-menu__section" }, _i = ["onMousedown"], v
2132
2132
  emits: ["selectCommand", "selectSkill"],
2133
2133
  setup(e) {
2134
2134
  let n = e, r = Pr(), i = N(null);
2135
- return U(() => [
2135
+ return W(() => [
2136
2136
  n.activeIndex,
2137
2137
  n.visibleCommands,
2138
2138
  n.visibleSkills
@@ -2151,13 +2151,13 @@ var gi = { class: "chat-composer-slash-menu__section" }, _i = ["onMousedown"], v
2151
2151
  class: w(["chat-composer-slash-menu__item", { "chat-composer-slash-menu__item--active": r === e.activeIndex }]),
2152
2152
  role: "option",
2153
2153
  type: "button",
2154
- onMousedown: q((e) => n.$emit("selectCommand", t), ["prevent"])
2154
+ onMousedown: J((e) => n.$emit("selectCommand", t), ["prevent"])
2155
2155
  }, [u("span", vi, [m(V(tt))]), u("span", yi, [u("span", bi, z(t.name), 1), u("span", xi, z(V(hi)(t)), 1)])], 42, _i))), 128))], 64)) : c("", !0), e.visibleSkills.length > 0 ? (k(), l(t, { key: 1 }, [u("div", Si, z(V(r)("chat.skills.title")), 1), (k(!0), l(t, null, P(e.visibleSkills, (t, r) => (k(), l("button", {
2156
2156
  key: t.path,
2157
2157
  class: w(["chat-composer-slash-menu__item", { "chat-composer-slash-menu__item--active": e.visibleCommands.length + r === e.activeIndex }]),
2158
2158
  role: "option",
2159
2159
  type: "button",
2160
- onMousedown: q((e) => n.$emit("selectSkill", t), ["prevent"])
2160
+ onMousedown: J((e) => n.$emit("selectSkill", t), ["prevent"])
2161
2161
  }, [u("span", wi, [m(V(Je))]), u("span", Ti, [u("span", Ei, z(t.name), 1), u("span", Di, z(V(Qt)(t)), 1)])], 42, Ci))), 128))], 64)) : c("", !0)], 512));
2162
2162
  }
2163
2163
  }), [["__scopeId", "data-v-7ac08005"]]), ki = { class: "chat-mention-chip" }, Ai = ["src"], ji = { class: "chat-mention-chip__label" }, Mi = /*#__PURE__*/ $(/* @__PURE__ */ h({
@@ -2216,11 +2216,11 @@ var gi = { class: "chat-composer-slash-menu__section" }, _i = ["onMousedown"], v
2216
2216
  "update:content"
2217
2217
  ],
2218
2218
  setup(e, { expose: n, emit: r }) {
2219
- let i = e, a = re(), o = r, s = N(null), c = N(0);
2220
- U(() => i.modelValue, (e) => {
2219
+ let i = e, a = H(), o = r, s = N(null), c = N(0);
2220
+ W(() => i.modelValue, (e) => {
2221
2221
  !s.value || h() === e || F(e, Math.min(c.value, e.length));
2222
- }), U(() => i.content, (e) => {
2223
- !s.value || !e || se(e) !== i.modelValue || JSON.stringify(ae(e)) === JSON.stringify(j()) || I(e, Math.min(c.value, i.modelValue.length), { focus: !1 });
2222
+ }), W(() => i.content, (e) => {
2223
+ !s.value || !e || oe(e) !== i.modelValue || JSON.stringify(ie(e)) === JSON.stringify(j()) || I(e, Math.min(c.value, i.modelValue.length), { focus: !1 });
2224
2224
  }, { deep: !0 }), ee(() => {
2225
2225
  F(i.modelValue, i.modelValue.length, { focus: !1 }), document.addEventListener("selectionchange", u);
2226
2226
  }), D(() => {
@@ -2397,12 +2397,12 @@ var gi = { class: "chat-composer-slash-menu__section" }, _i = ["onMousedown"], v
2397
2397
  }
2398
2398
  let n = j();
2399
2399
  I([
2400
- ...le(n, 0, t.start),
2400
+ ...ce(n, 0, t.start),
2401
2401
  {
2402
2402
  type: "text",
2403
2403
  text: e
2404
2404
  },
2405
- ...le(n, t.end, h().length)
2405
+ ...ce(n, t.end, h().length)
2406
2406
  ], t.start + e.length, { focus: !0 }), d(), w(t.start + e.length);
2407
2407
  }
2408
2408
  function A() {
@@ -2410,7 +2410,7 @@ var gi = { class: "chat-composer-slash-menu__section" }, _i = ["onMousedown"], v
2410
2410
  }
2411
2411
  function j() {
2412
2412
  let e = [], t = (n) => {
2413
- if (n instanceof HTMLElement && n.dataset.promptMention) e.push(...ae([JSON.parse(n.dataset.promptMention)]));
2413
+ if (n instanceof HTMLElement && n.dataset.promptMention) e.push(...ie([JSON.parse(n.dataset.promptMention)]));
2414
2414
  else if (n.nodeType === Node.TEXT_NODE || n instanceof HTMLBRElement) {
2415
2415
  let t = g(n), r = e.at(-1);
2416
2416
  r?.type === "text" ? r.text += t : t && e.push({
@@ -2421,7 +2421,7 @@ var gi = { class: "chat-composer-slash-menu__section" }, _i = ["onMousedown"], v
2421
2421
  };
2422
2422
  return s.value?.childNodes.forEach(t), e;
2423
2423
  }
2424
- function M(e, t = se(e).length) {
2424
+ function M(e, t = oe(e).length) {
2425
2425
  I(e, t, { focus: !1 });
2426
2426
  }
2427
2427
  function P(e, t, n) {
@@ -2434,17 +2434,17 @@ var gi = { class: "chat-composer-slash-menu__section" }, _i = ["onMousedown"], v
2434
2434
  te(null, r);
2435
2435
  let a = j();
2436
2436
  I([
2437
- ...le(a, 0, t),
2437
+ ...ce(a, 0, t),
2438
2438
  e,
2439
2439
  {
2440
2440
  type: "text",
2441
2441
  text: " "
2442
2442
  },
2443
- ...le(a, n, h().length)
2443
+ ...ce(a, n, h().length)
2444
2444
  ], i), d(), w(i);
2445
2445
  }
2446
2446
  function F(e, t = c.value, n = {}) {
2447
- I(i.content && se(i.content) === e ? i.content : [{
2447
+ I(i.content && oe(i.content) === e ? i.content : [{
2448
2448
  type: "text",
2449
2449
  text: e
2450
2450
  }], t, n);
@@ -2453,8 +2453,8 @@ var gi = { class: "chat-composer-slash-menu__section" }, _i = ["onMousedown"], v
2453
2453
  let r = s.value;
2454
2454
  if (!r) return;
2455
2455
  let i = n.focus ?? document.activeElement === r, a = document.createDocumentFragment();
2456
- for (let t of ae(e)) t.type === "mention" ? a.append(R(t)) : L(a, t.text);
2457
- let o = se(e);
2456
+ for (let t of ie(e)) t.type === "mention" ? a.append(R(t)) : L(a, t.text);
2457
+ let o = oe(e);
2458
2458
  if (o.endsWith("\n")) {
2459
2459
  let e = document.createElement("br");
2460
2460
  e.dataset.trailingLineBreak = "", a.append(e);
@@ -2572,26 +2572,26 @@ function zi(e) {
2572
2572
  let t = N(null), n = N(0), r = N(0), i = N(0), a = N(0), s = N(0), c = null, l = !1, u, d = o(() => Ii(e.prompt.value, e.caretPosition.value)), f = o(() => {
2573
2573
  let t = d.value;
2574
2574
  return t?.query ? Li([...e.files()], t.query, 5) : [];
2575
- }), p = o(() => d.value !== null && !d.value.query && e.files().length > 0), m = o(() => t.value === "at" && d.value !== null && e.files().length > 0 && !q()), h = o(() => Yt(e.prompt.value, e.caretPosition.value, "$")), g = o(() => Fi(e.prompt.value, e.caretPosition.value)), _ = o(() => Xt([...e.skills()], h.value?.query ?? "", -1, e.plugins?.() ?? [])), v = o(() => t.value === "skill" && e.skillsEnabled() && h.value !== null && e.skills().length > 0 && !q()), y = o(() => nn([...e.plugins?.() ?? []], g.value?.query ?? "")), b = o(() => cn(e.mentionGroups?.() ?? [], d.value?.query ?? "")), x = o(() => b.value.filter((e) => e.placement !== "after").flatMap((e) => e.items.map((t) => ({
2575
+ }), p = o(() => d.value !== null && !d.value.query && e.files().length > 0), m = o(() => t.value === "at" && d.value !== null && e.files().length > 0 && !J()), h = o(() => Yt(e.prompt.value, e.caretPosition.value, "$")), g = o(() => Fi(e.prompt.value, e.caretPosition.value)), _ = o(() => Xt([...e.skills()], h.value?.query ?? "", -1, e.plugins?.() ?? [])), v = o(() => t.value === "skill" && e.skillsEnabled() && h.value !== null && e.skills().length > 0 && !J()), y = o(() => nn([...e.plugins?.() ?? []], g.value?.query ?? "")), b = o(() => cn(e.mentionGroups?.() ?? [], d.value?.query ?? "")), x = o(() => b.value.filter((e) => e.placement !== "after").flatMap((e) => e.items.map((t) => ({
2576
2576
  group: e,
2577
2577
  item: t
2578
2578
  })))), S = o(() => b.value.filter((e) => e.placement === "after").flatMap((e) => e.items.map((t) => ({
2579
2579
  group: e,
2580
2580
  item: t
2581
- })))), C = o(() => !1), w = o(() => x.value.length + y.value.length + f.value.length + S.value.length), T = o(() => t.value === "at" && d.value !== null && (w.value > 0 || p.value) && !q()), E = o(() => pi(e.prompt.value, e.caretPosition.value)), D = o(() => mi([...e.commands()], E.value?.query ?? "")), ee = o(() => (e.skillsEnabled(), [])), O = o(() => D.value.length + ee.value.length), k = o(() => t.value === "slash" && E.value !== null && O.value > 0 && !q());
2582
- U([_, h], () => {
2581
+ })))), C = o(() => !1), w = o(() => x.value.length + y.value.length + f.value.length + S.value.length), T = o(() => t.value === "at" && d.value !== null && (w.value > 0 || p.value) && !J()), E = o(() => pi(e.prompt.value, e.caretPosition.value)), D = o(() => mi([...e.commands()], E.value?.query ?? "")), ee = o(() => (e.skillsEnabled(), [])), O = o(() => D.value.length + ee.value.length), k = o(() => t.value === "slash" && E.value !== null && O.value > 0 && !J());
2582
+ W([_, h], () => {
2583
2583
  r.value = 0;
2584
- }), U([y, g], () => {
2584
+ }), W([y, g], () => {
2585
2585
  i.value = 0, a.value = 0;
2586
- }), U(b, () => {
2586
+ }), W(b, () => {
2587
2587
  a.value = 0;
2588
- }), U([
2588
+ }), W([
2589
2589
  D,
2590
2590
  ee,
2591
2591
  E
2592
2592
  ], () => {
2593
2593
  s.value = 0;
2594
- }), U([f, d], () => {
2594
+ }), W([f, d], () => {
2595
2595
  n.value = 0;
2596
2596
  });
2597
2597
  function A(e) {
@@ -2618,7 +2618,7 @@ function zi(e) {
2618
2618
  }) ? !0 : k.value && O.value > 0 && e.key === "Tab" && !e.shiftKey && !e.metaKey && !e.ctrlKey && !e.altKey ? (e.preventDefault(), R("complete"), !0) : !!j(e, k.value, O.value, s, () => R("execute"));
2619
2619
  }
2620
2620
  function j(e, t, n, r, i) {
2621
- return t ? e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), n > 0 && (r.value = (r.value + (e.key === "ArrowDown" ? 1 : -1) + n) % n), !0) : e.key === "Escape" ? (e.preventDefault(), c = K(), H(), !0) : e.key === "Enter" && !e.shiftKey && !e.metaKey && !e.ctrlKey && !e.altKey && n > 0 ? (e.preventDefault(), i(), !0) : !1 : !1;
2621
+ return t ? e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), n > 0 && (r.value = (r.value + (e.key === "ArrowDown" ? 1 : -1) + n) % n), !0) : e.key === "Escape" ? (e.preventDefault(), c = q(), U(), !0) : e.key === "Enter" && !e.shiftKey && !e.metaKey && !e.ctrlKey && !e.altKey && n > 0 ? (e.preventDefault(), i(), !0) : !1 : !1;
2622
2622
  }
2623
2623
  function M(t) {
2624
2624
  let n = d.value;
@@ -2682,11 +2682,11 @@ function zi(e) {
2682
2682
  if (!r || !e.editor.value) return;
2683
2683
  let i = `/${t.slashName ?? t.name}`;
2684
2684
  if (t.composerMode) {
2685
- e.prompt.value = `${e.prompt.value.slice(0, r.start)}${e.prompt.value.slice(r.end)}`, e.caretPosition.value = r.start, H(), e.onCommandActivated?.(t), e.onTextInserted(r.start);
2685
+ e.prompt.value = `${e.prompt.value.slice(0, r.start)}${e.prompt.value.slice(r.end)}`, e.caretPosition.value = r.start, U(), e.onCommandActivated?.(t), e.onTextInserted(r.start);
2686
2686
  return;
2687
2687
  }
2688
2688
  if (n === "execute" || n === "default" && t.submitOnSelect) {
2689
- e.prompt.value = "", e.caretPosition.value = 0, H(), e.onCommandSubmitted(i);
2689
+ e.prompt.value = "", e.caretPosition.value = 0, U(), e.onCommandSubmitted(i);
2690
2690
  return;
2691
2691
  }
2692
2692
  B(`${i} `, r.start, r.end);
@@ -2703,37 +2703,37 @@ function zi(e) {
2703
2703
  function z(t, n, r) {
2704
2704
  e.editor.value?.insertMention(t, n, r);
2705
2705
  let i = n + t.label.length + 1;
2706
- e.caretPosition.value = i, H(), e.onTextInserted(i);
2706
+ e.caretPosition.value = i, U(), e.onTextInserted(i);
2707
2707
  }
2708
2708
  function B(t, n, r) {
2709
2709
  e.prompt.value = `${e.prompt.value.slice(0, n)}${t}${e.prompt.value.slice(r)}`;
2710
2710
  let i = n + t.length;
2711
- e.caretPosition.value = i, H(), e.onTextInserted(i);
2711
+ e.caretPosition.value = i, U(), e.onTextInserted(i);
2712
2712
  }
2713
2713
  function V(t) {
2714
- e.caretPosition.value = t?.end ?? e.editor.value?.getSelectionRange().end ?? e.prompt.value.length, G();
2715
- }
2716
- function re() {
2717
- u !== void 0 && window.clearTimeout(u), u = window.setTimeout(H, 120);
2714
+ e.caretPosition.value = t?.end ?? e.editor.value?.getSelectionRange().end ?? e.prompt.value.length, K();
2718
2715
  }
2719
2716
  function H() {
2717
+ u !== void 0 && window.clearTimeout(u), u = window.setTimeout(U, 120);
2718
+ }
2719
+ function U() {
2720
2720
  t.value = null;
2721
2721
  }
2722
- function ie() {
2723
- l = !0, H();
2722
+ function re() {
2723
+ l = !0, U();
2724
2724
  }
2725
- function W() {
2725
+ function G() {
2726
2726
  l = !1;
2727
2727
  }
2728
- function G() {
2728
+ function K() {
2729
2729
  if (u !== void 0 && window.clearTimeout(u), l) {
2730
- H();
2730
+ U();
2731
2731
  return;
2732
2732
  }
2733
- let e = K();
2733
+ let n = q();
2734
2734
  if (c !== null) {
2735
- if (e === c) {
2736
- H();
2735
+ if (n === c) {
2736
+ U();
2737
2737
  return;
2738
2738
  }
2739
2739
  c = null;
@@ -2743,19 +2743,20 @@ function zi(e) {
2743
2743
  return;
2744
2744
  }
2745
2745
  if (h.value !== null) {
2746
- t.value = "skill";
2746
+ let n = t.value !== "skill";
2747
+ t.value = "skill", n && e.onSkillsRequested?.();
2747
2748
  return;
2748
2749
  }
2749
2750
  if (E.value !== null) {
2750
2751
  t.value = "slash";
2751
2752
  return;
2752
2753
  }
2753
- H();
2754
+ U();
2754
2755
  }
2755
- function K() {
2756
+ function q() {
2756
2757
  return `${e.prompt.value}\u0000${e.caretPosition.value}`;
2757
2758
  }
2758
- function q() {
2759
+ function J() {
2759
2760
  return e.disabled() && !e.isSending();
2760
2761
  }
2761
2762
  return {
@@ -2765,9 +2766,9 @@ function zi(e) {
2765
2766
  activePluginIndex: i,
2766
2767
  activeSlashIndex: s,
2767
2768
  atMenuVisible: T,
2768
- close: H,
2769
- closeSoon: re,
2770
- resume: W,
2769
+ close: U,
2770
+ closeSoon: H,
2771
+ resume: G,
2771
2772
  fileMenuShowsHint: p,
2772
2773
  fileMenuVisible: m,
2773
2774
  handleKeydown: A,
@@ -2780,8 +2781,8 @@ function zi(e) {
2780
2781
  skillMenuVisible: v,
2781
2782
  pluginMenuVisible: C,
2782
2783
  slashMenuVisible: k,
2783
- suspend: ie,
2784
- sync: G,
2784
+ suspend: re,
2785
+ sync: K,
2785
2786
  updateCaretPosition: V,
2786
2787
  visibleFiles: f,
2787
2788
  visibleSkills: _,
@@ -2903,10 +2904,17 @@ var Zi = Symbol("image-preview-pool"), Qi = class {
2903
2904
  originalBytes: 0,
2904
2905
  thumbnailBytes: 0,
2905
2906
  previewPixels: 0
2906
- }, this.entries.set(e, t)), t.users++, t;
2907
+ }, this.entries.set(e, t)), t.users++, t.thumbnail && !t.source.value && this.room(t.previewPixels, t, !1) && (t.bytes = t.previewPixels, t.source.value = t.thumbnail, t.state.value = "ready"), this.touch(t), t;
2907
2908
  }
2908
2909
  release(e) {
2909
- e.users = Math.max(0, e.users - 1), !e.users && (this.drop(e), this.entries.delete(e.reference));
2910
+ if (e.users = Math.max(0, e.users - 1), !e.users) {
2911
+ if (e.near = 0, e.visible = 0, this.viewport && e.thumbnail && e.ownedOriginal && e.reference.length <= 512 && /^conversation-image:[^:]+:[a-f0-9]{64}$/i.test(e.reference)) {
2912
+ let e = [...this.entries.values()].filter((e) => !e.users);
2913
+ for (let t of e.slice(0, Math.max(0, e.length - 128))) this.drop(t);
2914
+ return;
2915
+ }
2916
+ this.drop(e);
2917
+ }
2910
2918
  }
2911
2919
  clear() {
2912
2920
  for (let e of this.entries.values()) e.users = 0, this.drop(e);
@@ -2958,6 +2966,10 @@ var Zi = Symbol("image-preview-pool"), Qi = class {
2958
2966
  }
2959
2967
  room(e, t, n) {
2960
2968
  let r = [...this.entries.values()].reduce((e, t) => e + t.bytes + t.originalBytes + t.thumbnailBytes, 0), i = [...this.entries.values()].filter((e) => e !== t && !e.pending && !(this.viewport && e.visible && !n)).sort((e, t) => e.visible - t.visible || e.near - t.near);
2969
+ for (let t of i.filter((e) => !e.users)) {
2970
+ if (r + e <= this.budget) break;
2971
+ r -= t.bytes + t.originalBytes + t.thumbnailBytes, this.drop(t);
2972
+ }
2961
2973
  for (let t of i) {
2962
2974
  if (r + e <= this.budget) break;
2963
2975
  r -= t.bytes, this.viewport ? this.dropPreview(t) : (r -= t.originalBytes + t.thumbnailBytes, this.drop(t));
@@ -2972,7 +2984,7 @@ var Zi = Symbol("image-preview-pool"), Qi = class {
2972
2984
  e.source.value = void 0, e.bytes = 0, e.state.value !== "loading" && (e.state.value = "idle");
2973
2985
  }
2974
2986
  drop(e) {
2975
- this.dropPreview(e), e.ownedPreview && URL.revokeObjectURL(e.thumbnail), e.thumbnail = void 0, e.thumbnailBytes = 0, e.previewPixels = 0, e.ownedPreview = !1, e.ownedOriginal && URL.revokeObjectURL(e.original.value), e.original.value = void 0, e.originalBytes = 0, e.ownedOriginal = !1;
2987
+ this.dropPreview(e), e.ownedPreview && URL.revokeObjectURL(e.thumbnail), e.thumbnail = void 0, e.thumbnailBytes = 0, e.previewPixels = 0, e.ownedPreview = !1, e.ownedOriginal && URL.revokeObjectURL(e.original.value), e.original.value = void 0, e.originalBytes = 0, e.ownedOriginal = !1, !e.users && this.entries.get(e.reference) === e && this.entries.delete(e.reference);
2976
2988
  }
2977
2989
  pump() {
2978
2990
  for (; this.active < 2 && this.queue.length;) this.active++, this.queue.sort((e, t) => t.entry.visible - e.entry.visible || t.entry.near - e.entry.near), this.queue.shift().run().finally(() => {
@@ -3278,7 +3290,7 @@ function pa(e) {
3278
3290
  let t = e.text.length, n = Math.max(0, Math.min(e.selectionStart, t)), r = Math.max(n, Math.min(e.selectionEnd, t));
3279
3291
  return {
3280
3292
  text: e.text,
3281
- ...e.content && se(e.content) === e.text ? { content: ae(e.content) } : {},
3293
+ ...e.content && oe(e.content) === e.text ? { content: ie(e.content) } : {},
3282
3294
  selectionStart: n,
3283
3295
  selectionEnd: r,
3284
3296
  ...e.activeCommandId ? { activeCommandId: e.activeCommandId } : {}
@@ -3337,6 +3349,7 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3337
3349
  "attach",
3338
3350
  "menuSelect",
3339
3351
  "mentionSelect",
3352
+ "requestSkills",
3340
3353
  "interrupt",
3341
3354
  "update:modelId",
3342
3355
  "update:composerState",
@@ -3349,12 +3362,12 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3349
3362
  let r = e, i = n, a = na(), f = N(""), p = N([]), h = N(null), g = N(!1), v = N(null), y = N(0), b = N(0), x = N(0), E = N(0), { exit: D, recall: O, remember: A, seed: j } = wn({
3350
3363
  apply: bt,
3351
3364
  currentPrompt: () => f.value
3352
- }), M = !1, te = null, P = 0, I = o(() => r.capabilities ?? Lt), L = o(() => It(r.presentation)), ne = o(() => zt(r.commands ?? Rt, I.value.goals)), R = o(() => ne.value.find((e) => e.id === h.value) ?? null), z = o(() => ne.value.find((e) => (e.slashName ?? e.name) === "goal" && e.composerMode) ?? null), B = o(() => !!(z.value && h.value === z.value.id)), re = o(() => !!(I.value.planMode && r.planMode && !B.value)), H = o(() => R.value?.composerMode?.placeholder ?? (r.suggestedPrompt?.trim() ? r.suggestedPrompt : r.placeholder ?? "Ask Codex…")), ie = o(() => L.value.composer.voice && !!(r.transcribeAudio || a?.capabilities.transcription)), G = o(() => !!f.value.trim()), ae = o(() => r.emptySendPrompt?.trim() ?? ""), le = o(() => !!((R.value ? G.value : G.value || r.hasAttachments || r.hasExternalContent) && !r.disabled)), de = o(() => !!(r.canContinueInterruptedTurn && !r.isSending && !G.value && !r.hasAttachments && !r.hasExternalContent && !r.disabled)), fe = o(() => !!(ae.value && !r.isSending && !r.disabled && !G.value && !r.hasAttachments && !r.hasExternalContent && !R.value && !de.value)), J = null, Y = o(() => !!(r.isSending && !G.value && !r.hasAttachments && !r.hasExternalContent && !r.disabled && !xe.value && !Ce.value)), pe = o(() => Y.value), me = o(() => r.followUpBehavior === "steer" && I.value.steerPrompt), he = o(() => r.interruptArmed ? !1 : Se.value || Ce.value ? !0 : xe.value && !r.disabled ? !1 : !le.value && !Y.value && !de.value), ge = o(() => de.value ? "Continue" : fe.value ? "Send default prompt" : r.isSending ? me.value ? "Steer prompt" : "Queue prompt" : "Send prompt"), _e = o(() => {
3365
+ }), M = !1, te = null, P = 0, I = o(() => r.capabilities ?? Lt), L = o(() => It(r.presentation)), ne = o(() => zt(r.commands ?? Rt, I.value.goals)), R = o(() => ne.value.find((e) => e.id === h.value) ?? null), z = o(() => ne.value.find((e) => (e.slashName ?? e.name) === "goal" && e.composerMode) ?? null), B = o(() => !!(z.value && h.value === z.value.id)), H = o(() => !!(I.value.planMode && r.planMode && !B.value)), U = o(() => R.value?.composerMode?.placeholder ?? (r.suggestedPrompt?.trim() ? r.suggestedPrompt : r.placeholder ?? "Ask Codex…")), re = o(() => L.value.composer.voice && !!(r.transcribeAudio || a?.capabilities.transcription)), K = o(() => !!f.value.trim()), ie = o(() => r.emptySendPrompt?.trim() ?? ""), ce = o(() => !!((R.value ? K.value : K.value || r.hasAttachments || r.hasExternalContent) && !r.disabled)), ue = o(() => !!(r.canContinueInterruptedTurn && !r.isSending && !K.value && !r.hasAttachments && !r.hasExternalContent && !r.disabled)), de = o(() => !!(ie.value && !r.isSending && !r.disabled && !K.value && !r.hasAttachments && !r.hasExternalContent && !R.value && !ue.value)), Y = null, X = o(() => !!(r.isSending && !K.value && !r.hasAttachments && !r.hasExternalContent && !r.disabled && !xe.value && !Ce.value)), fe = o(() => X.value), pe = o(() => r.followUpBehavior === "steer" && I.value.steerPrompt), me = o(() => r.interruptArmed ? !1 : Se.value || Ce.value ? !0 : xe.value && !r.disabled ? !1 : !ce.value && !X.value && !ue.value), he = o(() => ue.value ? "Continue" : de.value ? "Send default prompt" : r.isSending ? pe.value ? "Steer prompt" : "Queue prompt" : "Send prompt"), ge = o(() => {
3353
3366
  if (r.interruptArmed) return "Press Escape again or click to stop generation";
3354
- if (Y.value) return "Interrupt";
3355
- let e = `${ge.value} (Enter)`;
3356
- return !r.isSending || !I.value.steerPrompt ? e : `${e}. ${me.value ? "Queue" : "Steer"} prompt (Cmd/Ctrl+Enter)`;
3357
- }), { buttonDisabled: ve, buttonLabel: ye, buttonTitle: be, error: X, isRecording: xe, isStarting: Se, isTranscribing: Ce, transcript: we, audioLevel: Te, cancel: Ee, stop: De, toggle: Oe } = ua({
3367
+ if (X.value) return "Interrupt";
3368
+ let e = `${he.value} (Enter)`;
3369
+ return !r.isSending || !I.value.steerPrompt ? e : `${e}. ${pe.value ? "Queue" : "Steer"} prompt (Cmd/Ctrl+Enter)`;
3370
+ }), { buttonDisabled: _e, buttonLabel: ve, buttonTitle: ye, error: be, isRecording: xe, isStarting: Se, isTranscribing: Ce, transcript: we, audioLevel: Te, cancel: Ee, stop: De, toggle: Oe } = ua({
3358
3371
  isDisabled: () => r.disabled,
3359
3372
  isSending: () => r.isSending,
3360
3373
  onTranscript: ct,
@@ -3366,19 +3379,19 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3366
3379
  let e = f.value.slice(E.value);
3367
3380
  return e && !/^\s/.test(e) ? ` ${e}` : e;
3368
3381
  });
3369
- U(X, (e) => i("error", e));
3382
+ W(be, (e) => i("error", e));
3370
3383
  function je(e) {
3371
3384
  !Se.value && !xe.value && !Ce.value || (e.preventDefault(), e.stopPropagation(), Ee());
3372
3385
  }
3373
- U(Ce, (e) => {
3374
- if (e || J === null) return;
3375
- let t = J;
3376
- J = null, C(() => {
3386
+ W(Ce, (e) => {
3387
+ if (e || Y === null) return;
3388
+ let t = Y;
3389
+ Y = null, C(() => {
3377
3390
  v.value?.setCaret(t);
3378
3391
  });
3379
3392
  });
3380
3393
  let Me = 0;
3381
- U(() => [r.promptHistory, r.promptHistoryLoading], ([e, t]) => {
3394
+ W(() => [r.promptHistory, r.promptHistoryLoading], ([e, t]) => {
3382
3395
  if (j(e ?? []), t || Me === 0) return;
3383
3396
  let n = Me;
3384
3397
  Me = 0;
@@ -3403,29 +3416,32 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3403
3416
  prompt: f,
3404
3417
  skills: () => r.skills ?? [],
3405
3418
  skillsEnabled: () => I.value.skills,
3419
+ onSkillsRequested: () => {
3420
+ (!r.skillCatalogStatus || r.skillCatalogStatus === "notLoaded" || r.skillCatalogStatus === "error") && i("requestSkills");
3421
+ },
3406
3422
  editor: v
3407
3423
  });
3408
- U(() => r.composerState, (e) => {
3424
+ W(() => r.composerState, (e) => {
3409
3425
  e && ht(e);
3410
3426
  }, {
3411
3427
  deep: !0,
3412
3428
  immediate: !0
3413
- }), U(() => r.draftRevision, () => {
3429
+ }), W(() => r.draftRevision, () => {
3414
3430
  r.composerState || lt(r.draft ?? "");
3415
- }, { immediate: r.draftRevision !== void 0 }), U(f, () => St()), ee(() => {
3431
+ }, { immediate: r.draftRevision !== void 0 }), W(f, () => St()), ee(() => {
3416
3432
  r.autofocus && v.value?.focusEnd();
3417
3433
  });
3418
3434
  function it() {
3419
3435
  if (!(Se.value || xe.value || Ce.value)) {
3420
- if (de.value) {
3436
+ if (ue.value) {
3421
3437
  i("continueInterruptedTurn");
3422
3438
  return;
3423
3439
  }
3424
- if (fe.value) {
3425
- i("send", ae.value);
3440
+ if (de.value) {
3441
+ i("send", ie.value);
3426
3442
  return;
3427
3443
  }
3428
- r.isSending && me.value ? ot() : st("send");
3444
+ r.isSending && pe.value ? ot() : st("send");
3429
3445
  }
3430
3446
  }
3431
3447
  async function at() {
@@ -3437,7 +3453,7 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3437
3453
  await De() && it();
3438
3454
  return;
3439
3455
  }
3440
- if (Y.value) {
3456
+ if (X.value) {
3441
3457
  i("interrupt");
3442
3458
  return;
3443
3459
  }
@@ -3458,8 +3474,8 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3458
3474
  }
3459
3475
  function st(e) {
3460
3476
  let t = f.value.trim();
3461
- if (!le.value || e === "steer" && !t && !r.hasAttachments && !r.hasExternalContent) return;
3462
- let n = R.value ? `/${R.value.slashName ?? R.value.name}` : null, a = n && t ? `${n} ${t}` : t || (r.hasAttachments ? "(no user instructions)" : ""), o = ue(v.value?.readContent() ?? [{
3477
+ if (!ce.value || e === "steer" && !t && !r.hasAttachments && !r.hasExternalContent) return;
3478
+ let n = R.value ? `/${R.value.slashName ?? R.value.name}` : null, a = n && t ? `${n} ${t}` : t || (r.hasAttachments ? "(no user instructions)" : ""), o = le(v.value?.readContent() ?? [{
3463
3479
  type: "text",
3464
3480
  text: t
3465
3481
  }]);
@@ -3471,19 +3487,19 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3471
3487
  ...g.value ? { inputMethod: "dictated" } : {},
3472
3488
  ...s ? { content: o } : {}
3473
3489
  } : void 0;
3474
- t && A(oe(o, a)), y.value += 1, p.value = [], f.value = "", h.value = null, g.value = !1, x.value = 0, E.value = 0, b.value = 0, Ie(), C(() => v.value?.focusEnd()), e === "send" ? c ? i("send", a, c) : i("send", a) : c ? i("steer", a, c) : i("steer", a);
3490
+ t && A(ae(o, a)), y.value += 1, p.value = [], f.value = "", h.value = null, g.value = !1, x.value = 0, E.value = 0, b.value = 0, Ie(), C(() => v.value?.focusEnd()), e === "send" ? c ? i("send", a, c) : i("send", a) : c ? i("steer", a, c) : i("steer", a);
3475
3491
  }
3476
3492
  async function ct(e) {
3477
3493
  let t = e.trim();
3478
3494
  if (!t) return;
3479
3495
  let n = v.value?.getSelectionRange(), r = n?.start ?? x.value, i = n?.end ?? E.value, a = f.value.slice(0, r), o = f.value.slice(i), s = `${a && !/\s$/.test(a) ? " " : ""}${t}${o && !/^\s/.test(o) ? " " : ""}`, c = a.length + s.length;
3480
- p.value = ce(se(p.value) === f.value ? p.value : [{
3496
+ p.value = se(oe(p.value) === f.value ? p.value : [{
3481
3497
  type: "text",
3482
3498
  text: f.value
3483
3499
  }], r, i, [{
3484
3500
  type: "text",
3485
3501
  text: s
3486
- }]), f.value = se(p.value), g.value = !0, b.value = c, x.value = c, E.value = c, J = c, Ie();
3502
+ }]), f.value = oe(p.value), g.value = !0, b.value = c, x.value = c, E.value = c, Y = c, Ie();
3487
3503
  }
3488
3504
  function lt(e) {
3489
3505
  D(), ht({
@@ -3559,7 +3575,7 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3559
3575
  }
3560
3576
  }
3561
3577
  if (e.key === "Tab" && e.shiftKey && !e.metaKey && !e.ctrlKey && !e.altKey) {
3562
- e.preventDefault(), I.value.planMode && mt(!re.value);
3578
+ e.preventDefault(), I.value.planMode && mt(!H.value);
3563
3579
  return;
3564
3580
  }
3565
3581
  if (e.key === "Enter") {
@@ -3568,7 +3584,7 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3568
3584
  return;
3569
3585
  }
3570
3586
  if (e.preventDefault(), e.metaKey !== e.ctrlKey && !e.altKey) {
3571
- r.isSending ? me.value ? st("send") : ot() : it();
3587
+ r.isSending ? pe.value ? st("send") : ot() : it();
3572
3588
  return;
3573
3589
  }
3574
3590
  !e.metaKey && !e.ctrlKey && !e.altKey && it();
@@ -3584,7 +3600,7 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3584
3600
  }
3585
3601
  function bt(e) {
3586
3602
  let t = pn(e, r.plugins, r.skills, r.mentionGroups);
3587
- p.value = t, f.value = se(t);
3603
+ p.value = t, f.value = oe(t);
3588
3604
  let n = f.value.length;
3589
3605
  x.value = n, E.value = n, b.value = n, Xe(), C(() => {
3590
3606
  v.value?.setContent(t, n);
@@ -3597,7 +3613,7 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3597
3613
  if (M) return;
3598
3614
  let e = pa({
3599
3615
  text: f.value,
3600
- ...se(p.value) === f.value && p.value.some((e) => e.type === "mention") ? { content: p.value } : {},
3616
+ ...oe(p.value) === f.value && p.value.some((e) => e.type === "mention") ? { content: p.value } : {},
3601
3617
  selectionStart: x.value,
3602
3618
  selectionEnd: E.value,
3603
3619
  activeCommandId: h.value
@@ -3624,8 +3640,8 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3624
3640
  return t({ focus: Et }), (t, n) => (k(), l("form", {
3625
3641
  class: w(["codex-chat-theme chat-composer", { "chat-composer--disabled": e.disabled && !e.isSending }]),
3626
3642
  "aria-label": "Prompt composer",
3627
- onSubmit: q(it, ["prevent"]),
3628
- onKeydown: K(je, ["esc"])
3643
+ onSubmit: J(it, ["prevent"]),
3644
+ onKeydown: q(je, ["esc"])
3629
3645
  }, [
3630
3646
  F(t.$slots, "before", {}, void 0, !0),
3631
3647
  V(Be) ? (k(), s(ii, {
@@ -3640,7 +3656,7 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3640
3656
  onSelectMention: V(Ge)
3641
3657
  }, d({ _: 2 }, [t.$slots["suggestion-item"] ? {
3642
3658
  name: "mention",
3643
- fn: W((e) => [F(t.$slots, "suggestion-item", S(e, { surface: "menu" }), void 0, !0)]),
3659
+ fn: G((e) => [F(t.$slots, "suggestion-item", S(e, { surface: "menu" }), void 0, !0)]),
3644
3660
  key: "0"
3645
3661
  } : void 0]), 1032, [
3646
3662
  "active-index",
@@ -3678,7 +3694,7 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3678
3694
  "onSelectCommand",
3679
3695
  "onSelectSkill"
3680
3696
  ])) : c("", !0),
3681
- u("div", ma, [ie.value && (V(Se) || V(xe) || V(Ce)) ? (k(), s(rr, {
3697
+ u("div", ma, [re.value && (V(Se) || V(xe) || V(Ce)) ? (k(), s(rr, {
3682
3698
  key: 0,
3683
3699
  class: "chat-composer__input",
3684
3700
  recording: V(xe),
@@ -3703,7 +3719,7 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3703
3719
  content: p.value,
3704
3720
  "onUpdate:content": n[1] ||= (e) => p.value = e,
3705
3721
  class: "chat-composer__input",
3706
- placeholder: H.value,
3722
+ placeholder: U.value,
3707
3723
  disabled: e.disabled && !e.isSending,
3708
3724
  files: e.files,
3709
3725
  "mention-groups": e.mentionGroups,
@@ -3718,7 +3734,7 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3718
3734
  onPaste: Ct
3719
3735
  }, d({ _: 2 }, [t.$slots.mention ? {
3720
3736
  name: "mention",
3721
- fn: W((e) => [F(t.$slots, "mention", S(e, { surface: "composer" }), void 0, !0)]),
3737
+ fn: G((e) => [F(t.$slots, "mention", S(e, { surface: "composer" }), void 0, !0)]),
3722
3738
  key: "0"
3723
3739
  } : void 0]), 1032, [
3724
3740
  "modelValue",
@@ -3743,7 +3759,7 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3743
3759
  "approval-preset": e.approvalPreset,
3744
3760
  "approval-presets": I.value.approvalPresets ?? [],
3745
3761
  "goal-mode": B.value,
3746
- "plan-mode": re.value,
3762
+ "plan-mode": H.value,
3747
3763
  "show-approval-menu": I.value.approvals && !!e.approvalPreset && (I.value.approvalPresets?.length ?? 0) > 0,
3748
3764
  "show-goal-mode": I.value.goals,
3749
3765
  "show-plan-mode": I.value.planMode,
@@ -3754,11 +3770,11 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3754
3770
  "onUpdate:planMode": mt
3755
3771
  }, d({ _: 2 }, [t.$slots["menu-icon"] ? {
3756
3772
  name: "icon",
3757
- fn: W((e) => [F(t.$slots, "menu-icon", T(_(e)), void 0, !0)]),
3773
+ fn: G((e) => [F(t.$slots, "menu-icon", T(_(e)), void 0, !0)]),
3758
3774
  key: "0"
3759
3775
  } : void 0, t.$slots["menu-item"] ? {
3760
3776
  name: "item",
3761
- fn: W((e) => [F(t.$slots, "menu-item", T(_(e)), void 0, !0)]),
3777
+ fn: G((e) => [F(t.$slots, "menu-item", T(_(e)), void 0, !0)]),
3762
3778
  key: "1"
3763
3779
  } : void 0]), 1032, [
3764
3780
  "attach-enabled",
@@ -3775,7 +3791,7 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3775
3791
  ])) : c("", !0),
3776
3792
  F(t.$slots, "before-meta", {}, void 0, !0),
3777
3793
  m(jn, {
3778
- "plan-mode": re.value,
3794
+ "plan-mode": H.value,
3779
3795
  command: R.value,
3780
3796
  onDisablePlanMode: n[5] ||= (e) => mt(!1),
3781
3797
  onRemoveCommand: ut
@@ -3811,12 +3827,12 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3811
3827
  "show-service-tier",
3812
3828
  "show-reasoning"
3813
3829
  ])) : c("", !0),
3814
- ie.value ? (k(), s(Xn, {
3830
+ re.value ? (k(), s(Xn, {
3815
3831
  key: 2,
3816
- disabled: V(ve),
3817
- label: V(ye),
3832
+ disabled: V(_e),
3833
+ label: V(ve),
3818
3834
  recording: V(xe),
3819
- title: V(be),
3835
+ title: V(ye),
3820
3836
  onToggle: V(Oe)
3821
3837
  }, null, 8, [
3822
3838
  "disabled",
@@ -3827,12 +3843,12 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3827
3843
  ])) : c("", !0),
3828
3844
  m(Dn, {
3829
3845
  class: "chat-composer__send",
3830
- disabled: he.value,
3831
- "hover-to-enable": fe.value,
3832
- busy: pe.value,
3846
+ disabled: me.value,
3847
+ "hover-to-enable": de.value,
3848
+ busy: fe.value,
3833
3849
  "interrupt-armed": e.interruptArmed,
3834
- "submit-label": ge.value,
3835
- title: _e.value,
3850
+ "submit-label": he.value,
3851
+ title: ge.value,
3836
3852
  "interrupt-label": "Codex is working",
3837
3853
  onClick: at
3838
3854
  }, null, 8, [
@@ -3847,7 +3863,7 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3847
3863
  ])])
3848
3864
  ], 34));
3849
3865
  }
3850
- }), [["__scopeId", "data-v-30de1ce7"]]), ya = { class: "codex-chat-theme codex-request-card chat-tool-confirmation" }, ba = { class: "codex-request-header chat-tool-confirmation__header" }, xa = { class: "codex-request-eyebrow chat-tool-confirmation__tag" }, Sa = { class: "codex-request-title chat-tool-confirmation__question" }, Ca = {
3866
+ }), [["__scopeId", "data-v-90841919"]]), ya = { class: "codex-chat-theme codex-request-card chat-tool-confirmation" }, ba = { class: "codex-request-header chat-tool-confirmation__header" }, xa = { class: "codex-request-eyebrow chat-tool-confirmation__tag" }, Sa = { class: "codex-request-title chat-tool-confirmation__question" }, Ca = {
3851
3867
  key: 0,
3852
3868
  class: "codex-request-description chat-tool-confirmation__description"
3853
3869
  }, wa = {
@@ -3929,7 +3945,7 @@ var ma = { class: "chat-composer__input-row" }, ha = { class: "chat-composer__me
3929
3945
  onDecide: m
3930
3946
  }, d({ _: 2 }, [e.approval.command || e.approval.cwd || e.approval.requestedPermissions?.length ? {
3931
3947
  name: "details",
3932
- fn: W(() => [u("div", ka, [
3948
+ fn: G(() => [u("div", ka, [
3933
3949
  e.approval.command ? (k(), l("code", Aa, z(e.approval.command), 1)) : c("", !0),
3934
3950
  e.approval.cwd ? (k(), l("small", ja, z(e.approval.cwd), 1)) : c("", !0),
3935
3951
  e.approval.requestedPermissions?.length ? (k(), l("ul", Ma, [(k(!0), l(t, null, P(e.approval.requestedPermissions, (e, t) => (k(), l("li", { key: t }, z(h(e)), 1))), 128))])) : c("", !0)
@@ -4051,7 +4067,7 @@ function Ua(e) {
4051
4067
  }));
4052
4068
  return Wa({
4053
4069
  content: t.join("\n\n"),
4054
- ...e.metadata?.promptContent === void 0 ? {} : { promptContent: ae(e.metadata.promptContent) },
4070
+ ...e.metadata?.promptContent === void 0 ? {} : { promptContent: ie(e.metadata.promptContent) },
4055
4071
  createdAt: e.createdAt,
4056
4072
  id: e.id,
4057
4073
  parts: n,
@@ -4571,7 +4587,7 @@ function Ro(e) {
4571
4587
  //#region src/chat/use-conversation-escape-interrupt.ts
4572
4588
  function zo(e) {
4573
4589
  let t = N(!1), n = null, r = !1;
4574
- U([e.busy, e.enabled], () => {
4590
+ W([e.busy, e.enabled], () => {
4575
4591
  c(), i();
4576
4592
  }), ee(i), D(() => {
4577
4593
  c(), a();
@@ -4631,7 +4647,7 @@ var Bo = Symbol("codex-app-sdk-question-responses"), Vo = Symbol("codex-app-sdk-
4631
4647
  key: e.place,
4632
4648
  class: "chat-animated-diff-stat__digit-column"
4633
4649
  }, [m(i, { name: "chat-animated-diff-stat__digit" }, {
4634
- default: W(() => [(k(), l("span", {
4650
+ default: G(() => [(k(), l("span", {
4635
4651
  key: `${e.place}-${e.digit}`,
4636
4652
  class: "chat-animated-diff-stat__digit"
4637
4653
  }, z(e.digit), 1))]),
@@ -4735,16 +4751,16 @@ var Bo = Symbol("codex-app-sdk-question-responses"), Vo = Symbol("codex-app-sdk-
4735
4751
  key: 1,
4736
4752
  class: "chat-tool-call__title-target chat-tool-call__title-target--link",
4737
4753
  href: e.link.href,
4738
- onClick: q((t) => r("open-link", e.link), ["stop", "prevent"]),
4739
- onKeydown: [K(q((t) => r("open-link", e.link), ["stop", "prevent"]), ["enter"]), K(q((t) => r("open-link", e.link), ["stop", "prevent"]), ["space"])]
4754
+ onClick: J((t) => r("open-link", e.link), ["stop", "prevent"]),
4755
+ onKeydown: [q(J((t) => r("open-link", e.link), ["stop", "prevent"]), ["enter"]), q(J((t) => r("open-link", e.link), ["stop", "prevent"]), ["space"])]
4740
4756
  }, z(e.label), 41, Qo)) : (k(), l("span", $o, z(e.label), 1)),
4741
4757
  e.suffix ? (k(), l("span", es, z(e.suffix), 1)) : c("", !0)
4742
4758
  ], 64))), 128)) : e.titleTargetLink ? (k(), l("a", {
4743
4759
  key: 1,
4744
4760
  class: "chat-tool-call__title-target chat-tool-call__title-target--link",
4745
4761
  href: e.titleTargetLink.href,
4746
- onClick: i[0] ||= q((t) => r("open-link", e.titleTargetLink), ["stop", "prevent"]),
4747
- onKeydown: [i[1] ||= K(q((t) => r("open-link", e.titleTargetLink), ["stop", "prevent"]), ["enter"]), i[2] ||= K(q((t) => r("open-link", e.titleTargetLink), ["stop", "prevent"]), ["space"])]
4762
+ onClick: i[0] ||= J((t) => r("open-link", e.titleTargetLink), ["stop", "prevent"]),
4763
+ onKeydown: [i[1] ||= q(J((t) => r("open-link", e.titleTargetLink), ["stop", "prevent"]), ["enter"]), i[2] ||= q(J((t) => r("open-link", e.titleTargetLink), ["stop", "prevent"]), ["space"])]
4748
4764
  }, z(e.titleTarget), 41, ts)) : (k(), l("span", ns, z(e.titleTarget), 1))])
4749
4765
  ])) : (k(), l("span", rs, z(e.title), 1))], 10, Jo), e.lineDiff ? (k(), l("span", is, [e.lineDiff.addedLines ? (k(), s(Ko, {
4750
4766
  key: 0,
@@ -4817,8 +4833,8 @@ var Bo = Symbol("codex-app-sdk-question-responses"), Vo = Symbol("codex-app-sdk-
4817
4833
  return e;
4818
4834
  }), F = o(() => !M.value && !A.value && !r.historical && !!T.value), I = o(() => T.value?.options ?? []), ne = o(() => {
4819
4835
  let e = T.value;
4820
- return !!e && (me(e) || e.isOther === !0);
4821
- }), R, { buttonDisabled: B, buttonTitle: re, error: H, isStarting: ie, isRecording: G, isTranscribing: K, transcript: q, audioLevel: ae, toggle: oe, cancel: se, stop: ce } = ua({
4836
+ return !!e && (pe(e) || e.isOther === !0);
4837
+ }), R, { buttonDisabled: B, buttonTitle: H, error: U, isStarting: re, isRecording: K, isTranscribing: q, transcript: J, audioLevel: ie, toggle: ae, cancel: oe, stop: se } = ua({
4822
4838
  isDisabled: () => !F.value || !ne.value || !!T.value?.isSecret,
4823
4839
  isSending: () => !1,
4824
4840
  onTranscript: async (e) => {
@@ -4829,20 +4845,20 @@ var Bo = Symbol("codex-app-sdk-question-responses"), Vo = Symbol("codex-app-sdk-
4829
4845
  let r = R.before.length + n.length;
4830
4846
  await C(), _.value?.focus(), _.value?.setSelectionRange(r, r);
4831
4847
  }
4832
- }), le = o(() => ie.value || G.value || K.value), ue = o(() => `${R?.before ?? ""}${q.value.finalText}${q.value.partialText}${R?.after ?? ""}`);
4833
- U([
4848
+ }), ce = o(() => re.value || K.value || q.value), le = o(() => `${R?.before ?? ""}${J.value.finalText}${J.value.partialText}${R?.after ?? ""}`);
4849
+ W([
4834
4850
  x,
4835
4851
  () => T.value?.id,
4836
4852
  F,
4837
4853
  ne,
4838
4854
  () => T.value?.isSecret
4839
4855
  ], () => {
4840
- R = void 0, H.value = null, se();
4856
+ R = void 0, U.value = null, oe();
4841
4857
  }, { flush: "sync" });
4842
- async function de() {
4858
+ async function ue() {
4843
4859
  let e = T.value;
4844
4860
  if (e) {
4845
- if (!le.value) {
4861
+ if (!ce.value) {
4846
4862
  let t = v[e.id] ?? "", n = t.slice(0, _.value?.selectionStart ?? t.length), r = t.slice(_.value?.selectionEnd ?? t.length);
4847
4863
  R = {
4848
4864
  id: e.id,
@@ -4850,44 +4866,44 @@ var Bo = Symbol("codex-app-sdk-question-responses"), Vo = Symbol("codex-app-sdk-
4850
4866
  after: r && !/^\s/.test(r) ? ` ${r}` : r
4851
4867
  };
4852
4868
  }
4853
- await oe();
4869
+ await ae();
4854
4870
  }
4855
4871
  }
4856
- let fe = o(() => {
4872
+ let de = o(() => {
4857
4873
  let e = T.value;
4858
4874
  return e && e.header.trim() !== e.question.trim() ? e.header : "Question";
4859
- }), J = o(() => {
4860
- if (ie.value) return "Starting microphone...";
4861
- if (G.value) return "Listening...";
4862
- if (K.value) return "Transcribing...";
4863
- let e = T.value;
4864
- return e?.isSecret ? "Enter private answer" : e && me(e) ? "Type your answer..." : "Or write your own answer...";
4865
4875
  }), Y = o(() => {
4876
+ if (re.value) return "Starting microphone...";
4877
+ if (K.value) return "Listening...";
4878
+ if (q.value) return "Transcribing...";
4879
+ let e = T.value;
4880
+ return e?.isSecret ? "Enter private answer" : e && pe(e) ? "Type your answer..." : "Or write your own answer...";
4881
+ }), X = o(() => {
4866
4882
  let e = T.value;
4867
- return ie.value || K.value || !e ? !1 : G.value ? !!(q.value.finalText + q.value.partialText).trim() : Se(e) ? !E.value || S.value.every((e) => Se(e)) : !1;
4883
+ return re.value || q.value || !e ? !1 : K.value ? !!(J.value.finalText + J.value.partialText).trim() : Se(e) ? !E.value || S.value.every((e) => Se(e)) : !1;
4868
4884
  });
4869
- function pe() {
4885
+ function fe() {
4870
4886
  C(() => window.setTimeout(() => {
4871
4887
  let e = T.value;
4872
- !F.value || !e || (me(e) ? _.value?.focus() : (!document.activeElement || document.activeElement === document.body) && g.value?.focus());
4888
+ !F.value || !e || (pe(e) ? _.value?.focus() : (!document.activeElement || document.activeElement === document.body) && g.value?.focus());
4873
4889
  }, 0));
4874
4890
  }
4875
- ee(pe), U(a, pe);
4876
- function me(e) {
4891
+ ee(fe), W(a, fe);
4892
+ function pe(e) {
4877
4893
  return e.options === null;
4878
4894
  }
4879
- let he = /\s*\(recommended\)\s*$/i;
4880
- function _e(e) {
4881
- return e.replace(he, "").trim() || e;
4895
+ let me = /\s*\(recommended\)\s*$/i;
4896
+ function ge(e) {
4897
+ return e.replace(me, "").trim() || e;
4882
4898
  }
4883
- function ve(e) {
4884
- return he.test(e);
4899
+ function _e(e) {
4900
+ return me.test(e);
4885
4901
  }
4886
- function ye(e, t) {
4902
+ function ve(e, t) {
4887
4903
  return h[e]?.includes(t) ?? !1;
4888
4904
  }
4889
- function be(e, t) {
4890
- if (A.value || M.value || le.value) return;
4905
+ function ye(e, t) {
4906
+ if (A.value || M.value || ce.value) return;
4891
4907
  let n = e.id;
4892
4908
  if (h[n] ??= [], e.multiSelect) {
4893
4909
  let e = h[n].indexOf(t);
@@ -4896,7 +4912,7 @@ var Bo = Symbol("codex-app-sdk-question-responses"), Vo = Symbol("codex-app-sdk-
4896
4912
  }
4897
4913
  h[n] = [t], v[n] = "", Te();
4898
4914
  }
4899
- function X(e, t) {
4915
+ function be(e, t) {
4900
4916
  A.value || M.value || xe(e, t.target.value);
4901
4917
  }
4902
4918
  function xe(e, t) {
@@ -4906,37 +4922,37 @@ var Bo = Symbol("codex-app-sdk-question-responses"), Vo = Symbol("codex-app-sdk-
4906
4922
  return (h[e.id]?.length ?? 0) > 0 || !!v[e.id]?.trim();
4907
4923
  }
4908
4924
  function Ce(e) {
4909
- if (e.key === "Escape" && le.value) {
4910
- e.preventDefault(), e.stopPropagation(), se();
4925
+ if (e.key === "Escape" && ce.value) {
4926
+ e.preventDefault(), e.stopPropagation(), oe();
4911
4927
  return;
4912
4928
  }
4913
4929
  if (e.isComposing || e.metaKey || e.ctrlKey || e.altKey || !F.value) return;
4914
4930
  let t = T.value;
4915
4931
  if (t && /^[1-9]$/.test(e.key)) {
4916
4932
  let n = t.options?.[Number(e.key) - 1];
4917
- n && (e.preventDefault(), be(t, n.label));
4933
+ n && (e.preventDefault(), ye(t, n.label));
4918
4934
  return;
4919
4935
  }
4920
- e.key === "Enter" && e.target === g.value && Y.value && (e.preventDefault(), Te());
4936
+ e.key === "Enter" && e.target === g.value && X.value && (e.preventDefault(), Te());
4921
4937
  }
4922
4938
  function we(e) {
4923
- if (e.key === "Escape" && le.value) {
4939
+ if (e.key === "Escape" && ce.value) {
4924
4940
  Ce(e);
4925
4941
  return;
4926
4942
  }
4927
- e.stopPropagation(), !(e.key !== "Enter" || e.isComposing || e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) && (e.preventDefault(), Y.value && Te());
4943
+ e.stopPropagation(), !(e.key !== "Enter" || e.isComposing || e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) && (e.preventDefault(), X.value && Te());
4928
4944
  }
4929
4945
  async function Te() {
4930
- ie.value || K.value || G.value && !await ce() || Y.value && (E.value ? Oe() : Ee());
4946
+ re.value || q.value || K.value && !await se() || X.value && (E.value ? Oe() : Ee());
4931
4947
  }
4932
4948
  function Ee() {
4933
- Y.value && (a.value += 1);
4949
+ X.value && (a.value += 1);
4934
4950
  }
4935
4951
  function De() {
4936
4952
  a.value > 0 && --a.value;
4937
4953
  }
4938
4954
  function Oe() {
4939
- if (!x.value || A.value || M.value || !Y.value) return;
4955
+ if (!x.value || A.value || M.value || !X.value) return;
4940
4956
  let e = S.value.reduce((e, t) => (e[t.id] = Ae(t), e), {});
4941
4957
  d.value = !0, i("client-response", {
4942
4958
  id: x.value,
@@ -4954,7 +4970,7 @@ var Bo = Symbol("codex-app-sdk-question-responses"), Vo = Symbol("codex-app-sdk-
4954
4970
  }
4955
4971
  function Ae(e) {
4956
4972
  let t = [...h[e.id] ?? []], n = v[e.id]?.trim();
4957
- return (me(e) || e.isOther) && n && t.push(n), { answers: t };
4973
+ return (pe(e) || e.isOther) && n && t.push(n), { answers: t };
4958
4974
  }
4959
4975
  function je(e) {
4960
4976
  return e.answers.filter(Boolean).join(", ") || "-";
@@ -4979,7 +4995,7 @@ var Bo = Symbol("codex-app-sdk-question-responses"), Vo = Symbol("codex-app-sdk-
4979
4995
  title: "Cancelled user question",
4980
4996
  icon: V(Qe)
4981
4997
  }, null, 8, ["icon"])])) : A.value ? (k(), l("div", ls, [m(as, {
4982
- title: "Answered user question",
4998
+ title: "User answered question",
4983
4999
  icon: V(Xe)
4984
5000
  }, null, 8, ["icon"]), (k(!0), l(t, null, P(S.value, (e) => (k(), l("div", {
4985
5001
  key: e.id,
@@ -4991,7 +5007,7 @@ var Bo = Symbol("codex-app-sdk-question-responses"), Vo = Symbol("codex-app-sdk-
4991
5007
  u("header", fs, [u("span", ps, [m(V(Fe), {
4992
5008
  size: 16,
4993
5009
  "aria-hidden": "true"
4994
- }), u("span", ms, z(fe.value), 1)]), u("div", hs, [S.value.length > 1 ? (k(), l("span", gs, z(a.value + 1) + " / " + z(S.value.length), 1)) : c("", !0), u("button", {
5010
+ }), u("span", ms, z(de.value), 1)]), u("div", hs, [S.value.length > 1 ? (k(), l("span", gs, z(a.value + 1) + " / " + z(S.value.length), 1)) : c("", !0), u("button", {
4995
5011
  class: "chat-tool-user-input__dismiss",
4996
5012
  type: "button",
4997
5013
  "aria-label": "Cancel question",
@@ -5009,15 +5025,15 @@ var Bo = Symbol("codex-app-sdk-question-responses"), Vo = Symbol("codex-app-sdk-
5009
5025
  key: e.label,
5010
5026
  "aria-keyshortcuts": n < 9 ? String(n + 1) : void 0,
5011
5027
  "aria-label": e.label,
5012
- "aria-pressed": ye(T.value.id, e.label),
5013
- class: w(["chat-tool-user-input__option", { "chat-tool-user-input__option--selected": ye(T.value.id, e.label) }]),
5028
+ "aria-pressed": ve(T.value.id, e.label),
5029
+ class: w(["chat-tool-user-input__option", { "chat-tool-user-input__option--selected": ve(T.value.id, e.label) }]),
5014
5030
  type: "button",
5015
- onClick: (t) => be(T.value, e.label)
5016
- }, [u("span", xs, [ye(T.value.id, e.label) ? (k(), s(V(ge), {
5031
+ onClick: (t) => ye(T.value, e.label)
5032
+ }, [u("span", xs, [ve(T.value.id, e.label) ? (k(), s(V(he), {
5017
5033
  key: 0,
5018
5034
  size: 14,
5019
5035
  "stroke-width": "3"
5020
- })) : (k(), l(t, { key: 1 }, [p(z(n + 1), 1)], 64))]), u("span", Ss, [u("span", Cs, [u("span", ws, z(_e(e.label)), 1), ve(e.label) ? (k(), l("span", Ts, "Recommended")) : c("", !0)]), e.description ? (k(), l("span", Es, z(e.description), 1)) : c("", !0)])], 10, bs))), 128))], 8, ys)) : c("", !0),
5036
+ })) : (k(), l(t, { key: 1 }, [p(z(n + 1), 1)], 64))]), u("span", Ss, [u("span", Cs, [u("span", ws, z(ge(e.label)), 1), _e(e.label) ? (k(), l("span", Ts, "Recommended")) : c("", !0)]), e.description ? (k(), l("span", Es, z(e.description), 1)) : c("", !0)])], 10, bs))), 128))], 8, ys)) : c("", !0),
5021
5037
  u("footer", { class: w(["chat-tool-user-input__footer", { "chat-tool-user-input__footer--divided": I.value.length > 0 }]) }, [
5022
5038
  ne.value ? (k(), l("div", Ds, [m(V(ze), {
5023
5039
  class: "chat-tool-user-input__write-icon",
@@ -5026,15 +5042,15 @@ var Bo = Symbol("codex-app-sdk-question-responses"), Vo = Symbol("codex-app-sdk-
5026
5042
  }), (k(), s(L(T.value.isSecret ? "input" : "textarea"), {
5027
5043
  ref_key: "answerField",
5028
5044
  ref: _,
5029
- class: w(["chat-tool-user-input__other-input", { "chat-tool-user-input__other-input--direct": me(T.value) }]),
5030
- "aria-label": me(T.value) ? T.value.question : "Other answer",
5045
+ class: w(["chat-tool-user-input__other-input", { "chat-tool-user-input__other-input--direct": pe(T.value) }]),
5046
+ "aria-label": pe(T.value) ? T.value.question : "Other answer",
5031
5047
  autocomplete: T.value.isSecret ? "off" : void 0,
5032
- placeholder: J.value,
5033
- readonly: le.value,
5048
+ placeholder: Y.value,
5049
+ readonly: ce.value,
5034
5050
  rows: T.value.isSecret ? void 0 : 1,
5035
5051
  type: T.value.isSecret ? "password" : void 0,
5036
- value: le.value ? ue.value : v[T.value.id] ?? "",
5037
- onInput: r[0] ||= (e) => X(T.value, e),
5052
+ value: ce.value ? le.value : v[T.value.id] ?? "",
5053
+ onInput: r[0] ||= (e) => be(T.value, e),
5038
5054
  onKeydown: we
5039
5055
  }, null, 40, [
5040
5056
  "class",
@@ -5046,7 +5062,7 @@ var Bo = Symbol("codex-app-sdk-question-responses"), Vo = Symbol("codex-app-sdk-
5046
5062
  "type",
5047
5063
  "value"
5048
5064
  ]))])) : c("", !0),
5049
- V(H) ? (k(), l("p", Os, z(V(H)), 1)) : c("", !0),
5065
+ V(U) ? (k(), l("p", Os, z(V(U)), 1)) : c("", !0),
5050
5066
  u("div", ks, [
5051
5067
  a.value > 0 ? (k(), l("button", {
5052
5068
  key: 0,
@@ -5057,12 +5073,12 @@ var Bo = Symbol("codex-app-sdk-question-responses"), Vo = Symbol("codex-app-sdk-
5057
5073
  ne.value && !T.value.isSecret ? (k(), s(Xn, {
5058
5074
  key: 1,
5059
5075
  disabled: V(B),
5060
- recording: V(G),
5061
- label: V(G) ? "Stop dictation" : "Dictate answer",
5062
- title: V(re) === "Record voice prompt" ? "Dictate answer" : V(re),
5063
- onToggle: de
5076
+ recording: V(K),
5077
+ label: V(K) ? "Stop dictation" : "Dictate answer",
5078
+ title: V(H) === "Record voice prompt" ? "Dictate answer" : V(H),
5079
+ onToggle: ue
5064
5080
  }, {
5065
- recording: W(() => [m(Zn, { "audio-level": V(ae) }, null, 8, ["audio-level"])]),
5081
+ recording: G(() => [m(Zn, { "audio-level": V(ie) }, null, 8, ["audio-level"])]),
5066
5082
  _: 1
5067
5083
  }, 8, [
5068
5084
  "disabled",
@@ -5072,7 +5088,7 @@ var Bo = Symbol("codex-app-sdk-question-responses"), Vo = Symbol("codex-app-sdk-
5072
5088
  ])) : c("", !0),
5073
5089
  u("button", {
5074
5090
  class: "codex-request-button codex-request-button--primary chat-tool-user-input__button chat-tool-user-input__button--primary",
5075
- disabled: !Y.value,
5091
+ disabled: !X.value,
5076
5092
  type: "button",
5077
5093
  onClick: Te
5078
5094
  }, z(E.value ? "Send" : "Next"), 9, As)
@@ -5080,7 +5096,7 @@ var Bo = Symbol("codex-app-sdk-question-responses"), Vo = Symbol("codex-app-sdk-
5080
5096
  ], 2)
5081
5097
  ], 64)) : c("", !0)], 42, ss));
5082
5098
  }
5083
- }), [["__scopeId", "data-v-19831504"]]), Ms = /* @__PURE__ */ h({
5099
+ }), [["__scopeId", "data-v-f2d1aa95"]]), Ms = /* @__PURE__ */ h({
5084
5100
  __name: "ChatQuestionRequest",
5085
5101
  props: {
5086
5102
  answeredClientRequestIds: {},
@@ -5284,11 +5300,11 @@ var Ws = /*#__PURE__*/ $(Vs, [["render", Us], ["__scopeId", "data-v-65051749"]])
5284
5300
  class: "chat-queued-prompt",
5285
5301
  "aria-label": "Queued prompt"
5286
5302
  }, {
5287
- leading: W(() => [m(V(tt), {
5303
+ leading: G(() => [m(V(tt), {
5288
5304
  class: "chat-queued-prompt__icon",
5289
5305
  "aria-hidden": "true"
5290
5306
  })]),
5291
- actions: W(() => [u("div", Zs, [
5307
+ actions: G(() => [u("div", Zs, [
5292
5308
  u("button", {
5293
5309
  class: "chat-queued-prompt__action",
5294
5310
  type: "button",
@@ -5313,7 +5329,7 @@ var Ws = /*#__PURE__*/ $(Vs, [["render", Us], ["__scopeId", "data-v-65051749"]])
5313
5329
  onClick: r[2] ||= (t) => n("delete", e.prompt.id)
5314
5330
  }, [m(V(it), { "aria-hidden": "true" })])
5315
5331
  ])]),
5316
- default: W(() => [u("span", Xs, z(e.prompt.text), 1)]),
5332
+ default: G(() => [u("span", Xs, z(e.prompt.text), 1)]),
5317
5333
  _: 1
5318
5334
  }));
5319
5335
  }
@@ -5334,7 +5350,7 @@ var Ws = /*#__PURE__*/ $(Vs, [["render", Us], ["__scopeId", "data-v-65051749"]])
5334
5350
  key: 0,
5335
5351
  class: "chat-queued-prompts"
5336
5352
  }, {
5337
- default: W(() => [(k(!0), l(t, null, P(e.prompts, (t) => (k(), s(ec, {
5353
+ default: G(() => [(k(!0), l(t, null, P(e.prompts, (t) => (k(), s(ec, {
5338
5354
  key: t.id,
5339
5355
  "edit-disabled": e.editDisabled,
5340
5356
  "steer-disabled": e.steerDisabled,
@@ -5394,7 +5410,7 @@ var Ws = /*#__PURE__*/ $(Vs, [["render", Us], ["__scopeId", "data-v-65051749"]])
5394
5410
  "steerQueuedPrompt"
5395
5411
  ],
5396
5412
  setup(n) {
5397
- let i = n, a = re(), u = o(() => i.presentation?.goal !== !1 && !!i.goal && i.goal?.status !== "complete"), d = o(() => i.presentation?.queuedPrompts !== !1 && i.queuedPrompts.length > 0), f = o(() => i.presentation?.turnGitDiff === !1 ? null : i.turnGitDiff ?? null), p = o(() => i.disabled ?? !1), m = o(() => _(a.drawers?.({ disabled: p.value }))), h = o(() => _(a.actions?.({ disabled: p.value }))), g = o(() => u.value || d.value || !!f.value || m.value || h.value);
5413
+ let i = n, a = H(), u = o(() => i.presentation?.goal !== !1 && !!i.goal && i.goal?.status !== "complete"), d = o(() => i.presentation?.queuedPrompts !== !1 && i.queuedPrompts.length > 0), f = o(() => i.presentation?.turnGitDiff === !1 ? null : i.turnGitDiff ?? null), p = o(() => i.disabled ?? !1), m = o(() => _(a.drawers?.({ disabled: p.value }))), h = o(() => _(a.actions?.({ disabled: p.value }))), g = o(() => u.value || d.value || !!f.value || m.value || h.value);
5398
5414
  function _(n) {
5399
5415
  return (Array.isArray(n) ? n : [n]).some((n) => {
5400
5416
  if (n == null || typeof n == "boolean") return !1;
@@ -5523,7 +5539,7 @@ function bc(e) {
5523
5539
  }
5524
5540
  function xc(e, t) {
5525
5541
  let n = na(), r = R();
5526
- return U(e, async (e, i, a) => {
5542
+ return W(e, async (e, i, a) => {
5527
5543
  let o = !0;
5528
5544
  if (a(() => {
5529
5545
  o = !1;
@@ -5544,18 +5560,18 @@ function Sc(e, t) {
5544
5560
  let n = b(Zi, void 0);
5545
5561
  if (!n) return;
5546
5562
  let r = R();
5547
- return U(e, (e, t, i) => {
5563
+ return W(e, (e, t, i) => {
5548
5564
  if (r.value = void 0, !e) return;
5549
5565
  let a = n.acquire(e);
5550
5566
  r.value = a, i(() => n.release(a)), n.viewport || n.load(a);
5551
- }, { immediate: !0 }), U([r, t], ([e, t], r, i) => {
5567
+ }, { immediate: !0 }), W([r, t], ([e, t], r, i) => {
5552
5568
  if (!e || !t || !n.viewport) return;
5553
5569
  let a = !1, o = !1, s = vc(t, (r) => {
5554
5570
  let i = r.near && !a || r.visible && !o;
5555
5571
  e.near += Number(r.near) - Number(a), e.visible += Number(r.visible) - Number(o), a = r.near, o = r.visible, n.visibilityChanged(e, t.clientWidth || 512), i && n.load(e);
5556
5572
  });
5557
5573
  i(() => {
5558
- s(), e.near -= Number(a), e.visible -= Number(o);
5574
+ s(), e.near = Math.max(0, e.near - Number(a)), e.visible = Math.max(0, e.visible - Number(o));
5559
5575
  });
5560
5576
  }, { flush: "post" }), {
5561
5577
  viewport: n.viewport,
@@ -5602,7 +5618,7 @@ var wc = /*#__PURE__*/ $(/* @__PURE__ */ h({
5602
5618
  "aria-label": e.label,
5603
5619
  title: e.title || e.label
5604
5620
  }, {
5605
- default: W(() => [F(t.$slots, "default", {}, void 0, !0)]),
5621
+ default: G(() => [F(t.$slots, "default", {}, void 0, !0)]),
5606
5622
  _: 3
5607
5623
  }, 8, [
5608
5624
  "class",
@@ -5655,7 +5671,7 @@ var Dc = ["data-codex-theme", "aria-label"], Oc = ["alt", "src"], kc = {
5655
5671
  mode: "light",
5656
5672
  style: {}
5657
5673
  }), u = b(pc, void 0), d = b(mc, void 0), f = N([]), p = N(-1), h = N(-1), g = N(!1), _ = N(!1), v = o(() => f.value[p.value]), y = xc(() => r.open && p.value !== h.value && v.value?.reference || "", _), x = o(() => p.value === h.value ? r.src : y.value);
5658
- U(() => r.open, (e) => {
5674
+ W(() => r.open, (e) => {
5659
5675
  if (e) {
5660
5676
  let e = d?.value.role === "assistant" && u?.value || [];
5661
5677
  p.value = e.findIndex((e) => e.messageId === d?.value.id && e.reference === r.reference && e.label === r.label), h.value = p.value, f.value = p.value < 0 ? [] : [...e], g.value = !1, a.value = Ec(r.themeSource), window.addEventListener("keydown", S);
@@ -5679,14 +5695,14 @@ var Dc = ["data-codex-theme", "aria-label"], Oc = ["alt", "src"], kc = {
5679
5695
  role: "dialog",
5680
5696
  "aria-modal": "true",
5681
5697
  "aria-label": v.value?.label || e.label,
5682
- onClick: r[4] ||= q((e) => i("close"), ["self"])
5698
+ onClick: r[4] ||= J((e) => i("close"), ["self"])
5683
5699
  }, [
5684
5700
  m(wc, {
5685
5701
  class: "chat-image-lightbox__close chat-media-block__fullscreen-close",
5686
5702
  label: e.closeLabel,
5687
5703
  onClick: r[0] ||= (e) => i("close")
5688
5704
  }, {
5689
- default: W(() => [m(V(ot))]),
5705
+ default: G(() => [m(V(ot))]),
5690
5706
  _: 1
5691
5707
  }, 8, ["label"]),
5692
5708
  f.value.length > 1 ? (k(), s(wc, {
@@ -5696,7 +5712,7 @@ var Dc = ["data-codex-theme", "aria-label"], Oc = ["alt", "src"], kc = {
5696
5712
  disabled: _.value || p.value === 0,
5697
5713
  onClick: r[1] ||= (e) => C(-1)
5698
5714
  }, {
5699
- default: W(() => [m(V(ye))]),
5715
+ default: G(() => [m(V(ve))]),
5700
5716
  _: 1
5701
5717
  }, 8, ["disabled"])) : c("", !0),
5702
5718
  x.value && !g.value ? (k(), l("img", {
@@ -5713,7 +5729,7 @@ var Dc = ["data-codex-theme", "aria-label"], Oc = ["alt", "src"], kc = {
5713
5729
  disabled: _.value || p.value === f.value.length - 1,
5714
5730
  onClick: r[3] ||= (e) => C(1)
5715
5731
  }, {
5716
- default: W(() => [m(V(be))]),
5732
+ default: G(() => [m(V(ye))]),
5717
5733
  _: 1
5718
5734
  }, 8, ["disabled"])) : c("", !0)
5719
5735
  ], 12, Dc)) : c("", !0)]));
@@ -5729,11 +5745,11 @@ var Dc = ["data-codex-theme", "aria-label"], Oc = ["alt", "src"], kc = {
5729
5745
  },
5730
5746
  setup(e) {
5731
5747
  let t = e, n = na(), r = N(null), i = Sc(() => t.attachment.kind === "image" && (t.attachment.url || t.attachment.path) || "", r), a = o(() => Cc(t.attachment) ?? Cc(i?.dimensions.value)), d = N(!1), f = N(), p = N(!1), h = o(() => i ? i.source.value : t.attachment.kind === "image" && x(t.attachment.url) ? t.attachment.url : f.value), g = o(() => i ? i.original.value : h.value), _ = o(() => C(t.attachment.path) || S(t.attachment.url));
5732
- U(h, () => {
5748
+ W(h, () => {
5733
5749
  d.value = !1;
5734
5750
  });
5735
5751
  let v = 0;
5736
- U([
5752
+ W([
5737
5753
  () => t.attachment.kind,
5738
5754
  () => t.attachment.path,
5739
5755
  () => t.attachment.url
@@ -5824,7 +5840,7 @@ var Dc = ["data-codex-theme", "aria-label"], Oc = ["alt", "src"], kc = {
5824
5840
  href: _.value,
5825
5841
  title: e.attachment.path || e.attachment.url || e.attachment.name
5826
5842
  }, {
5827
- default: W(() => [e.attachment.kind === "image" ? (k(), s(V(Be), {
5843
+ default: G(() => [e.attachment.kind === "image" ? (k(), s(V(Be), {
5828
5844
  key: 0,
5829
5845
  "aria-hidden": "true"
5830
5846
  })) : (k(), s(V(Re), {
@@ -5877,7 +5893,7 @@ var Dc = ["data-codex-theme", "aria-label"], Oc = ["alt", "src"], kc = {
5877
5893
  label: n.value ? e.copiedLabel : e.label,
5878
5894
  onClick: i
5879
5895
  }, {
5880
- default: W(() => [e.showIcon !== !1 && n.value ? (k(), s(V(_e), { key: 0 })) : e.showIcon === !1 ? c("", !0) : (k(), s(V(Ce), { key: 1 }))]),
5896
+ default: G(() => [e.showIcon !== !1 && n.value ? (k(), s(V(ge), { key: 0 })) : e.showIcon === !1 ? c("", !0) : (k(), s(V(Ce), { key: 1 }))]),
5881
5897
  _: 1
5882
5898
  }, 8, ["disabled", "label"]));
5883
5899
  }
@@ -5958,7 +5974,7 @@ var Dc = ["data-codex-theme", "aria-label"], Oc = ["alt", "src"], kc = {
5958
5974
  label: tl,
5959
5975
  onClick: o[1] ||= (e) => v("fullscreen")
5960
5976
  }, {
5961
- default: W(() => [m(V(Pe))]),
5977
+ default: G(() => [m(V(Pe))]),
5962
5978
  _: 1
5963
5979
  }),
5964
5980
  m(Vc, {
@@ -5970,9 +5986,9 @@ var Dc = ["data-codex-theme", "aria-label"], Oc = ["alt", "src"], kc = {
5970
5986
  download: _.value,
5971
5987
  href: p.value,
5972
5988
  label: Qc,
5973
- onClick: o[2] ||= q(() => {}, ["stop"])
5989
+ onClick: o[2] ||= J(() => {}, ["stop"])
5974
5990
  }, {
5975
- default: W(() => [m(V(we))]),
5991
+ default: G(() => [m(V(we))]),
5976
5992
  _: 1
5977
5993
  }, 8, ["download", "href"]),
5978
5994
  e.media.prompt ? (k(), s(wc, {
@@ -5980,7 +5996,7 @@ var Dc = ["data-codex-theme", "aria-label"], Oc = ["alt", "src"], kc = {
5980
5996
  label: il,
5981
5997
  onClick: x
5982
5998
  }, {
5983
- default: W(() => [m(V(Ae))]),
5999
+ default: G(() => [m(V(Ae))]),
5984
6000
  _: 1
5985
6001
  })) : c("", !0)
5986
6002
  ])]),
@@ -5988,7 +6004,7 @@ var Dc = ["data-codex-theme", "aria-label"], Oc = ["alt", "src"], kc = {
5988
6004
  key: 0,
5989
6005
  open: h.value
5990
6006
  }, {
5991
- default: W(() => [u("div", Xc, [u("div", { class: "chat-media-block__details-title" }, z(il)), u("p", Zc, z(e.media.prompt), 1)])]),
6007
+ default: G(() => [u("div", Xc, [u("div", { class: "chat-media-block__details-title" }, z(il)), u("p", Zc, z(e.media.prompt), 1)])]),
5992
6008
  _: 1
5993
6009
  }, 8, ["open"])) : c("", !0),
5994
6010
  m(Ac, {
@@ -6062,7 +6078,7 @@ var Dc = ["data-codex-theme", "aria-label"], Oc = ["alt", "src"], kc = {
6062
6078
  function b(e) {
6063
6079
  e.key === "Escape" && y();
6064
6080
  }
6065
- return U(r, (e) => {
6081
+ return W(r, (e) => {
6066
6082
  e ? window.addEventListener("keydown", b) : window.removeEventListener("keydown", b);
6067
6083
  }), D(() => {
6068
6084
  window.removeEventListener("keydown", b);
@@ -6076,14 +6092,14 @@ var Dc = ["data-codex-theme", "aria-label"], Oc = ["alt", "src"], kc = {
6076
6092
  label: h.value,
6077
6093
  onClick: _
6078
6094
  }, {
6079
- default: W(() => [i.value ? (k(), s(V(Ee), { key: 0 })) : (k(), s(V(Se), { key: 1 }))]),
6095
+ default: G(() => [i.value ? (k(), s(V(Ee), { key: 0 })) : (k(), s(V(Se), { key: 1 }))]),
6080
6096
  _: 1
6081
6097
  }, 8, ["label"]), m(wc, {
6082
6098
  bordered: "",
6083
6099
  label: _l,
6084
6100
  onClick: v
6085
6101
  }, {
6086
- default: W(() => [m(V(Pe))]),
6102
+ default: G(() => [m(V(Pe))]),
6087
6103
  _: 1
6088
6104
  })]),
6089
6105
  i.value ? (k(), l("pre", sl, [u("code", null, z(t.code), 1)])) : g.value.svg ? (k(), l("div", {
@@ -6099,20 +6115,20 @@ var Dc = ["data-codex-theme", "aria-label"], Oc = ["alt", "src"], kc = {
6099
6115
  role: "dialog",
6100
6116
  "aria-modal": "true",
6101
6117
  "aria-label": _l,
6102
- onClick: q(y, ["self"])
6118
+ onClick: J(y, ["self"])
6103
6119
  }, [u("div", dl, [u("div", fl, [m(wc, {
6104
6120
  bordered: "",
6105
6121
  label: h.value,
6106
6122
  onClick: _
6107
6123
  }, {
6108
- default: W(() => [i.value ? (k(), s(V(Ee), { key: 0 })) : (k(), s(V(Se), { key: 1 }))]),
6124
+ default: G(() => [i.value ? (k(), s(V(Ee), { key: 0 })) : (k(), s(V(Se), { key: 1 }))]),
6109
6125
  _: 1
6110
6126
  }, 8, ["label"]), m(wc, {
6111
6127
  bordered: "",
6112
6128
  label: gl,
6113
6129
  onClick: y
6114
6130
  }, {
6115
- default: W(() => [m(V(ot))]),
6131
+ default: G(() => [m(V(ot))]),
6116
6132
  _: 1
6117
6133
  })]), i.value ? (k(), l("pre", pl, [u("code", null, z(t.code), 1)])) : g.value.svg ? (k(), l("div", {
6118
6134
  key: 1,
@@ -6240,7 +6256,7 @@ function Ll(e) {
6240
6256
  }
6241
6257
  //#endregion
6242
6258
  //#region src/chat/message-markdown.ts
6243
- var Rl = new J();
6259
+ var Rl = new Y();
6244
6260
  Rl.html = ({ text: e }) => xl(e), Rl.code = ({ text: e, lang: t }) => Nl(e, t), Rl.link = ({ href: e, title: t, tokens: n }) => {
6245
6261
  let r = Xl(n), i = ql(e);
6246
6262
  if (!i) return `<span class="chat-message-link chat-message-link--blocked">${r}</span>`;
@@ -6252,7 +6268,7 @@ Rl.html = ({ text: e }) => xl(e), Rl.code = ({ text: e, lang: t }) => Nl(e, t),
6252
6268
  let a = t ? ` title="${Sl(t)}"` : "";
6253
6269
  return `<img class="chat-message-image" src="${Sl(r)}" alt="${i}"${a} loading="lazy" decoding="async" referrerpolicy="no-referrer">`;
6254
6270
  };
6255
- var zl = new fe({
6271
+ var zl = new de({
6256
6272
  async: !1,
6257
6273
  breaks: !0,
6258
6274
  gfm: !0,
@@ -6517,7 +6533,7 @@ var uu = "<!doctype html><html><head>\n<meta http-equiv=\"Content-Security-Polic
6517
6533
  URL.revokeObjectURL(e), g.delete(e);
6518
6534
  }, 1e3));
6519
6535
  }
6520
- return U(() => [t.source, t.complete], v), ee(() => window.addEventListener("message", y)), D(() => {
6536
+ return W(() => [t.source, t.complete], v), ee(() => window.addEventListener("message", y)), D(() => {
6521
6537
  window.removeEventListener("message", y), _();
6522
6538
  for (let [e, t] of g) clearTimeout(t), URL.revokeObjectURL(e);
6523
6539
  }), (t, r) => (k(), l("section", du, [u("header", fu, [
@@ -6528,7 +6544,7 @@ var uu = "<!doctype html><html><head>\n<meta http-equiv=\"Content-Security-Polic
6528
6544
  label: V(n)(a.value ? "chat.html.preview" : "chat.html.source"),
6529
6545
  onClick: r[0] ||= (e) => a.value = !a.value
6530
6546
  }, {
6531
- default: W(() => [a.value ? (k(), s(V(Ee), { key: 0 })) : (k(), s(V(Se), { key: 1 }))]),
6547
+ default: G(() => [a.value ? (k(), s(V(Ee), { key: 0 })) : (k(), s(V(Se), { key: 1 }))]),
6532
6548
  _: 1
6533
6549
  }, 8, ["label"]),
6534
6550
  m(Vc, {
@@ -6540,11 +6556,11 @@ var uu = "<!doctype html><html><head>\n<meta http-equiv=\"Content-Security-Polic
6540
6556
  label: V(n)("chat.html.download"),
6541
6557
  onClick: x
6542
6558
  }, {
6543
- default: W(() => [m(V(we))]),
6559
+ default: G(() => [m(V(we))]),
6544
6560
  _: 1
6545
6561
  }, 8, ["label"])
6546
6562
  ])
6547
- ]), u("div", gu, [G((k(), l("iframe", {
6563
+ ]), u("div", gu, [K((k(), l("iframe", {
6548
6564
  key: o.value,
6549
6565
  ref_key: "frame",
6550
6566
  ref: i,
@@ -6552,7 +6568,7 @@ var uu = "<!doctype html><html><head>\n<meta http-equiv=\"Content-Security-Polic
6552
6568
  title: e.title || V(n)("chat.html.title"),
6553
6569
  sandbox: "allow-scripts",
6554
6570
  referrerpolicy: "no-referrer"
6555
- }, null, 8, _u)), [[ie, !a.value]]), a.value ? (k(), l("pre", vu, [u("code", null, z(e.source), 1)])) : c("", !0)])]));
6571
+ }, null, 8, _u)), [[re, !a.value]]), a.value ? (k(), l("pre", vu, [u("code", null, z(e.source), 1)])) : c("", !0)])]));
6556
6572
  }
6557
6573
  }), [["__scopeId", "data-v-f327ab9d"]]), bu = () => void 0, xu = Symbol("codex-app-sdk-tool-presentation");
6558
6574
  function Su(e) {
@@ -6685,7 +6701,7 @@ var Du = {
6685
6701
  "title-target-parts",
6686
6702
  "tool-call",
6687
6703
  "tool-presentation"
6688
- ]), e.expandable === !1 ? c("", !0) : (k(), s(L(f.value ? V(X) : V(ve)), {
6704
+ ]), e.expandable === !1 ? c("", !0) : (k(), s(L(f.value ? V(be) : V(_e)), {
6689
6705
  key: 0,
6690
6706
  class: "chat-tool-group__chevron",
6691
6707
  size: 15
@@ -6713,7 +6729,7 @@ var Du = {
6713
6729
  "title-target-parts",
6714
6730
  "tool-call",
6715
6731
  "tool-presentation"
6716
- ]), (k(), s(L(f.value ? V(X) : V(ve)), {
6732
+ ]), (k(), s(L(f.value ? V(be) : V(_e)), {
6717
6733
  class: "chat-tool-call__chevron",
6718
6734
  size: 15
6719
6735
  }))])) : (k(), l("div", Ou, [m(as, {
@@ -6738,15 +6754,15 @@ var Du = {
6738
6754
  ])])), e.headerless && (O.value || T.value.length) ? (k(), l("div", ku, [D.value ? (k(), l("div", Au, [u("div", ju, z(T.value.length ? "Files" : "Input"), 1), T.value.length ? (k(), l("div", Mu, [(k(!0), l(t, null, P(T.value, (e) => (k(), l("a", {
6739
6755
  key: e.href,
6740
6756
  href: e.href,
6741
- onClick: q((t) => i("open-link", e), ["stop", "prevent"])
6757
+ onClick: J((t) => i("open-link", e), ["stop", "prevent"])
6742
6758
  }, z(e.path), 9, Nu))), 128))])) : (k(), l("pre", Pu, z(M(h.value)), 1))])) : c("", !0), O.value && ee.value ? (k(), l("div", Fu, [r[5] ||= u("div", { class: "chat-tool-call__section-title" }, "Result", -1), u("pre", Iu, z(M(e.toolCall.result)), 1)])) : c("", !0)])) : A.value ? (k(), s(Uc, {
6743
6759
  key: 4,
6744
6760
  open: f.value
6745
6761
  }, {
6746
- default: W(() => [u("div", Lu, [D.value ? (k(), l("div", Ru, [u("div", zu, z(T.value.length ? "Files" : "Input"), 1), T.value.length ? (k(), l("div", Bu, [(k(!0), l(t, null, P(T.value, (e) => (k(), l("a", {
6762
+ default: G(() => [u("div", Lu, [D.value ? (k(), l("div", Ru, [u("div", zu, z(T.value.length ? "Files" : "Input"), 1), T.value.length ? (k(), l("div", Bu, [(k(!0), l(t, null, P(T.value, (e) => (k(), l("a", {
6747
6763
  key: e.href,
6748
6764
  href: e.href,
6749
- onClick: q((t) => i("open-link", e), ["stop", "prevent"])
6765
+ onClick: J((t) => i("open-link", e), ["stop", "prevent"])
6750
6766
  }, z(e.path), 9, Vu))), 128))])) : (k(), l("pre", Hu, z(M(h.value)), 1))])) : c("", !0), O.value && ee.value ? (k(), l("div", Uu, [r[6] ||= u("div", { class: "chat-tool-call__section-title" }, "Result", -1), u("pre", Wu, z(M(e.toolCall.result)), 1)])) : c("", !0)])]),
6751
6767
  _: 1
6752
6768
  }, 8, ["open"])) : c("", !0)], 2));
@@ -6784,7 +6800,7 @@ var Du = {
6784
6800
  }
6785
6801
  return r.activityTitle ?? "No actions";
6786
6802
  });
6787
- U(() => r.toolCalls.map((e) => ({
6803
+ W(() => r.toolCalls.map((e) => ({
6788
6804
  id: e.id,
6789
6805
  active: F(e)
6790
6806
  })), (e) => {
@@ -6793,7 +6809,7 @@ var Du = {
6793
6809
  for (let e of n) M(e);
6794
6810
  for (let e of f.value) t.has(e) || M(e);
6795
6811
  h = n;
6796
- }, { flush: "sync" }), U([
6812
+ }, { flush: "sync" }), W([
6797
6813
  () => S.value.length,
6798
6814
  d,
6799
6815
  () => x.value?.id
@@ -6845,7 +6861,7 @@ var Du = {
6845
6861
  type: E.value ? "button" : void 0,
6846
6862
  onClick: O
6847
6863
  }, {
6848
- default: W(() => [x.value ? (k(), s(Gu, {
6864
+ default: G(() => [x.value ? (k(), s(Gu, {
6849
6865
  key: 0,
6850
6866
  class: "chat-tool-group__active",
6851
6867
  "summary-only": "",
@@ -6877,7 +6893,7 @@ var Du = {
6877
6893
  label: "Total removed lines",
6878
6894
  value: T.value.removedLines
6879
6895
  }, null, 8, ["value"])) : c("", !0)])) : c("", !0),
6880
- E.value ? (k(), s(L(d.value ? V(X) : V(ve)), {
6896
+ E.value ? (k(), s(L(d.value ? V(be) : V(_e)), {
6881
6897
  key: 1,
6882
6898
  class: "chat-tool-group__chevron",
6883
6899
  size: 15
@@ -6886,7 +6902,7 @@ var Du = {
6886
6902
  _: 1
6887
6903
  }, 8, ["class", "type"])) : c("", !0),
6888
6904
  m(Uc, { open: d.value }, {
6889
- default: W(() => [u("div", Yu, [(k(!0), l(t, null, P(b.value, (t) => (k(), s(Gu, {
6905
+ default: G(() => [u("div", Yu, [(k(!0), l(t, null, P(b.value, (t) => (k(), s(Gu, {
6890
6906
  key: t.id,
6891
6907
  "answered-client-request-ids": e.answeredClientRequestIds,
6892
6908
  headerless: v.value,
@@ -6911,7 +6927,7 @@ var Du = {
6911
6927
  "aria-live": "polite",
6912
6928
  onAfterLeave: te
6913
6929
  }, {
6914
- default: W(() => [(k(!0), l(t, null, P(S.value, (t) => (k(), l("div", {
6930
+ default: G(() => [(k(!0), l(t, null, P(S.value, (t) => (k(), l("div", {
6915
6931
  key: t.id,
6916
6932
  class: "chat-tool-group__running-item"
6917
6933
  }, [u("div", Xu, [m(Gu, {
@@ -6980,7 +6996,7 @@ var Du = {
6980
6996
  class: w(["chat-user-text__mention", `chat-user-text__mention--${n.type === "plugin-mention" ? "plugin" : "skill"}`]),
6981
6997
  title: d(n)
6982
6998
  }, {
6983
- icon: W(() => [u("span", { class: w(["chat-user-text__mention-icon-frame", {
6999
+ icon: G(() => [u("span", { class: w(["chat-user-text__mention-icon-frame", {
6984
7000
  "chat-user-text__mention-icon-frame--has-light": a(n, "light"),
6985
7001
  "chat-user-text__mention-icon-frame--has-dark": a(n, "dark")
6986
7002
  }]) }, [
@@ -7085,7 +7101,7 @@ var ud = {
7085
7101
  },
7086
7102
  setup(e) {
7087
7103
  let t = e, n = Pr(), r = b(Vo, void 0), i = b(Ho, void 0), a = o(() => r?.enabled.value === !0 && i !== void 0), d = o(() => a.value ? r.completedWithoutFinal.value : !t.active && !t.finalStarted), f = N(t.active && !t.finalStarted), m = N(!1), h = o(() => a.value ? r.active.value : t.active && !t.finalStarted), g = o(() => !a.value || h.value || r.hasDetails?.value !== !1), _ = o(() => r?.detailsLoading?.value === !0), v = o(() => h.value || d.value ? !0 : a.value ? r.expanded.value : f.value), y = o(() => !t.continuation && !d.value && (!a.value || r.headerMessageIndex.value === i.value)), x = N(Date.now()), S;
7088
- U(h, (e) => {
7104
+ W(h, (e) => {
7089
7105
  clearInterval(S), S = void 0, e && (x.value = Date.now(), S = setInterval(() => {
7090
7106
  x.value = Date.now();
7091
7107
  }, 1e3));
@@ -7102,9 +7118,9 @@ var ud = {
7102
7118
  let a = v.value ? "HideDetails" : "ViewDetails";
7103
7119
  return n(`chat.work.${i}${a}${t ? "For" : ""}`, e);
7104
7120
  });
7105
- U(() => t.finalStarted, (e, t) => {
7121
+ W(() => t.finalStarted, (e, t) => {
7106
7122
  !a.value && e && !t && (f.value = !1);
7107
- }), U(() => t.active, (e) => {
7123
+ }), W(() => t.active, (e) => {
7108
7124
  !a.value && !m.value && (f.value = e && !t.finalStarted);
7109
7125
  });
7110
7126
  function E() {
@@ -7136,14 +7152,14 @@ var ud = {
7136
7152
  size: 15,
7137
7153
  role: "status",
7138
7154
  "aria-label": V(n)("chat.work.loadingDetails")
7139
- }, null, 8, ["aria-label"])) : h.value ? c("", !0) : (k(), s(L(v.value ? V(ve) : V(be)), {
7155
+ }, null, 8, ["aria-label"])) : h.value ? c("", !0) : (k(), s(L(v.value ? V(_e) : V(ye)), {
7140
7156
  key: 1,
7141
7157
  size: 15
7142
7158
  }))], 8, fd)) : c("", !0), y.value && g.value ? (k(), s(Uc, {
7143
7159
  key: 2,
7144
7160
  open: v.value
7145
7161
  }, {
7146
- default: W(() => [u("div", md, [V(r)?.detailsError?.value ? (k(), l("div", hd, [p(z(V(r).detailsError.value) + " ", 1), u("button", {
7162
+ default: G(() => [u("div", md, [V(r)?.detailsError?.value ? (k(), l("div", hd, [p(z(V(r).detailsError.value) + " ", 1), u("button", {
7147
7163
  type: "button",
7148
7164
  onClick: t[0] ||= (e) => V(r).reloadDetails?.()
7149
7165
  }, z(V(n)("chat.actions.retry")), 1)])) : F(e.$slots, "default", {}, void 0, !0, 1)])]),
@@ -7202,7 +7218,7 @@ var ud = {
7202
7218
  skills: e.skills
7203
7219
  }, d({ _: 2 }, [n.$slots.mention ? {
7204
7220
  name: "mention",
7205
- fn: W((e) => [F(n.$slots, "mention", T(_(e)), void 0, !0)]),
7221
+ fn: G((e) => [F(n.$slots, "mention", T(_(e)), void 0, !0)]),
7206
7222
  key: "0"
7207
7223
  } : void 0]), 1032, [
7208
7224
  "content",
@@ -7303,7 +7319,7 @@ var ud = {
7303
7319
  continuation: e.block.continuation,
7304
7320
  "final-started": e.block.finalStarted
7305
7321
  }, {
7306
- default: W(() => [(k(!0), l(t, null, P(e.block.blocks, (t, o) => F(n.$slots, "block", {
7322
+ default: G(() => [(k(!0), l(t, null, P(e.block.blocks, (t, o) => F(n.$slots, "block", {
7307
7323
  block: t,
7308
7324
  blockIndex: o
7309
7325
  }, () => [m(a, {
@@ -7323,17 +7339,17 @@ var ud = {
7323
7339
  }, d({ _: 2 }, [
7324
7340
  n.$slots.block ? {
7325
7341
  name: "block",
7326
- fn: W((e) => [F(n.$slots, "block", S({ ref_for: !0 }, e), void 0, !0)]),
7342
+ fn: G((e) => [F(n.$slots, "block", S({ ref_for: !0 }, e), void 0, !0)]),
7327
7343
  key: "0"
7328
7344
  } : void 0,
7329
7345
  n.$slots.text ? {
7330
7346
  name: "text",
7331
- fn: W((e) => [F(n.$slots, "text", S({ ref_for: !0 }, e), void 0, !0)]),
7347
+ fn: G((e) => [F(n.$slots, "text", S({ ref_for: !0 }, e), void 0, !0)]),
7332
7348
  key: "1"
7333
7349
  } : void 0,
7334
7350
  n.$slots.tool ? {
7335
7351
  name: "tool",
7336
- fn: W((e) => [F(n.$slots, "tool", S({ ref_for: !0 }, e), void 0, !0)]),
7352
+ fn: G((e) => [F(n.$slots, "tool", S({ ref_for: !0 }, e), void 0, !0)]),
7337
7353
  key: "2"
7338
7354
  } : void 0
7339
7355
  ]), 1032, [
@@ -7468,7 +7484,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7468
7484
  label: V(i)("chat.actions.edit"),
7469
7485
  onClick: n[0] ||= (e) => r("edit")
7470
7486
  }, {
7471
- default: W(() => [e.iconsVisible ? (k(), s(V(ze), { key: 0 })) : c("", !0)]),
7487
+ default: G(() => [e.iconsVisible ? (k(), s(V(ze), { key: 0 })) : c("", !0)]),
7472
7488
  _: 1
7473
7489
  }, 8, ["disabled", "label"])) : c("", !0),
7474
7490
  e.message.role === "user" && p.value ? (k(), s(wc, {
@@ -7477,7 +7493,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7477
7493
  label: V(i)("chat.actions.quote"),
7478
7494
  onClick: n[1] ||= (e) => r("quote")
7479
7495
  }, {
7480
- default: W(() => [e.iconsVisible ? (k(), s(V(We), { key: 0 })) : c("", !0)]),
7496
+ default: G(() => [e.iconsVisible ? (k(), s(V(We), { key: 0 })) : c("", !0)]),
7481
7497
  _: 1
7482
7498
  }, 8, ["disabled", "label"])) : c("", !0),
7483
7499
  e.message.role === "assistant" && e.canRetry && m.value ? (k(), s(wc, {
@@ -7486,7 +7502,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7486
7502
  label: V(i)("chat.actions.retry"),
7487
7503
  onClick: n[2] ||= (e) => r("retry")
7488
7504
  }, {
7489
- default: W(() => [e.iconsVisible ? (k(), s(V(Ge), { key: 0 })) : c("", !0)]),
7505
+ default: G(() => [e.iconsVisible ? (k(), s(V(Ge), { key: 0 })) : c("", !0)]),
7490
7506
  _: 1
7491
7507
  }, 8, ["disabled", "label"])) : c("", !0),
7492
7508
  e.canFork && f.value ? (k(), s(wc, {
@@ -7495,7 +7511,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7495
7511
  label: V(i)("chat.actions.fork"),
7496
7512
  onClick: n[3] ||= (e) => r("fork")
7497
7513
  }, {
7498
- default: W(() => [e.iconsVisible ? (k(), s(V(pe), {
7514
+ default: G(() => [e.iconsVisible ? (k(), s(V(fe), {
7499
7515
  key: 0,
7500
7516
  class: "chat-message-actions__fork-icon"
7501
7517
  })) : c("", !0)]),
@@ -7508,7 +7524,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7508
7524
  label: e.deleting ? V(i)("chat.actions.deleting") : V(i)("chat.actions.delete"),
7509
7525
  onClick: n[4] ||= (e) => r("delete")
7510
7526
  }, {
7511
- default: W(() => [e.iconsVisible && e.deleting ? (k(), s(V(Ne), {
7527
+ default: G(() => [e.iconsVisible && e.deleting ? (k(), s(V(Ne), {
7512
7528
  key: 0,
7513
7529
  class: "chat-message-actions__spinner"
7514
7530
  })) : e.iconsVisible ? (k(), s(V(it), { key: 1 })) : c("", !0)]),
@@ -7547,7 +7563,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7547
7563
  emits: ["cancel", "save"],
7548
7564
  setup(e, { emit: t }) {
7549
7565
  let n = e, r = t, i = N(n.content), a = N(null), o = N(null), c = null;
7550
- U(() => n.content, (e) => {
7566
+ W(() => n.content, (e) => {
7551
7567
  i.value = e;
7552
7568
  }), ee(() => {
7553
7569
  c = requestAnimationFrame(() => {
@@ -7575,7 +7591,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7575
7591
  }
7576
7592
  function m() {
7577
7593
  let e = i.value.trim();
7578
- e && (a.value ? r("save", e, { content: ue(a.value.readContent()) }) : r("save", e));
7594
+ e && (a.value ? r("save", e, { content: le(a.value.readContent()) }) : r("save", e));
7579
7595
  }
7580
7596
  return (t, n) => (k(), l("div", Fd, [e.promptContent?.some((e) => e.type === "mention") ? (k(), s(Pi, {
7581
7597
  key: 0,
@@ -7592,7 +7608,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7592
7608
  "modelValue",
7593
7609
  "content",
7594
7610
  "aria-label"
7595
- ])) : G((k(), l("textarea", {
7611
+ ])) : K((k(), l("textarea", {
7596
7612
  key: 1,
7597
7613
  ref_key: "input",
7598
7614
  ref: o,
@@ -7600,11 +7616,11 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7600
7616
  class: "chat-message__edit-input",
7601
7617
  "aria-label": e.inputLabel,
7602
7618
  onKeydown: [
7603
- K(q(d, ["prevent"]), ["escape"]),
7604
- K(q(m, ["meta", "prevent"]), ["enter"]),
7605
- K(q(m, ["ctrl", "prevent"]), ["enter"])
7619
+ q(J(d, ["prevent"]), ["escape"]),
7620
+ q(J(m, ["meta", "prevent"]), ["enter"]),
7621
+ q(J(m, ["ctrl", "prevent"]), ["enter"])
7606
7622
  ]
7607
- }, null, 40, Id)), [[H, i.value]]), u("div", Ld, [u("button", {
7623
+ }, null, 40, Id)), [[U, i.value]]), u("div", Ld, [u("button", {
7608
7624
  type: "button",
7609
7625
  class: "chat-message__edit-button",
7610
7626
  onClick: d
@@ -7712,44 +7728,44 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7712
7728
  }))), M = o(() => C.value.map((e, t) => ({
7713
7729
  block: e,
7714
7730
  blockIndex: t
7715
- }))), te = o(() => h.value.role === "user" ? M.value.filter(({ block: e }) => e.type === "attachment") : []), I = o(() => h.value.role === "user" ? M.value.filter(({ block: e }) => e.type !== "attachment") : j.value), L = o(() => go(h.value.content)), B = N(!1), re = o(() => h.value.type !== "compaction" && h.value.type !== "steer" && !ee.value && !B.value), H = o(() => r.actionsDisabled || h.value.role === "assistant" && h.value.streaming === !0), ie = N(!1), U = N(!1), G = b(fc, void 0) ?? R(), K = o(() => h.value.id ?? r.index), q = o(() => r.deletingTurn || !H.value && !!(r.actionsAlwaysVisible || ie.value || U.value || G.value === K.value));
7731
+ }))), te = o(() => h.value.role === "user" ? M.value.filter(({ block: e }) => e.type === "attachment") : []), I = o(() => h.value.role === "user" ? M.value.filter(({ block: e }) => e.type !== "attachment") : j.value), L = o(() => go(h.value.content)), B = N(!1), H = o(() => h.value.type !== "compaction" && h.value.type !== "steer" && !ee.value && !B.value), U = o(() => r.actionsDisabled || h.value.role === "assistant" && h.value.streaming === !0), re = N(!1), W = N(!1), K = b(fc, void 0) ?? R(), q = o(() => h.value.id ?? r.index), J = o(() => r.deletingTurn || !U.value && !!(r.actionsAlwaysVisible || re.value || W.value || K.value === q.value));
7732
+ function ie(e) {
7733
+ e.pointerType === "touch" && (K.value = q.value);
7734
+ }
7716
7735
  function ae(e) {
7717
- e.pointerType === "touch" && (G.value = K.value);
7736
+ W.value = e.relatedTarget instanceof Node && e.currentTarget.contains(e.relatedTarget);
7718
7737
  }
7719
- function oe(e) {
7720
- U.value = e.relatedTarget instanceof Node && e.currentTarget.contains(e.relatedTarget);
7738
+ let oe = o(() => H.value), se = o(() => !!h.value.turnId && r.canDeleteTurn && x.value.messages.actions.delete), ce = o(() => !!h.value.turnId && r.canEditTurn && x.value.messages.actions.edit), le = o(() => !!h.value.turnId && r.canForkTurn && x.value.messages.actions.fork), ue = o(() => !!h.value.turnId && r.canRetryTurn && x.value.messages.actions.retry), de = o(() => D.value.some(Se)), Y = o(() => _.value?.latestStreamingAssistantIndex.value === void 0 || _.value.latestStreamingAssistantIndex.value === r.index), X = o(() => h.value.role === "assistant" && h.value.streaming !== !0 && _.value?.itemsView?.value !== "summary" && C.value.length === 0), fe = o(() => h.value.role === "assistant" && h.value.streaming === !0 && Y.value && !de.value), pe = o(() => h.value.role === "assistant" && h.value.streaming === !0 && Y.value && de.value);
7739
+ function me() {
7740
+ h.value.role !== "user" || !ce.value || (B.value = !0);
7721
7741
  }
7722
- let se = o(() => re.value), ce = o(() => !!h.value.turnId && r.canDeleteTurn && x.value.messages.actions.delete), le = o(() => !!h.value.turnId && r.canEditTurn && x.value.messages.actions.edit), ue = o(() => !!h.value.turnId && r.canForkTurn && x.value.messages.actions.fork), de = o(() => !!h.value.turnId && r.canRetryTurn && x.value.messages.actions.retry), fe = o(() => D.value.some(Se)), J = o(() => _.value?.latestStreamingAssistantIndex.value === void 0 || _.value.latestStreamingAssistantIndex.value === r.index), Y = o(() => h.value.role === "assistant" && h.value.streaming !== !0 && _.value?.itemsView?.value !== "summary" && C.value.length === 0), pe = o(() => h.value.role === "assistant" && h.value.streaming === !0 && J.value && !fe.value), me = o(() => h.value.role === "assistant" && h.value.streaming === !0 && J.value && fe.value);
7723
7742
  function he() {
7724
- h.value.role !== "user" || !le.value || (B.value = !0);
7725
- }
7726
- function ge() {
7727
7743
  B.value = !1;
7728
7744
  }
7729
- function _e(e, t) {
7745
+ function ge(e, t) {
7730
7746
  let n = h.value.turnId;
7731
7747
  n && (i("edit-turn", {
7732
7748
  content: e,
7733
7749
  turnId: n,
7734
7750
  ...t ? { options: t } : {}
7735
- }), ge());
7751
+ }), he());
7736
7752
  }
7737
- function ve() {
7738
- if (!ce.value || r.threadActionsDisabled) return;
7753
+ function _e() {
7754
+ if (!se.value || r.threadActionsDisabled) return;
7739
7755
  let e = h.value.turnId;
7740
7756
  e && i("delete-turn", e);
7741
7757
  }
7742
- function ye() {
7743
- if (!ue.value || r.threadActionsDisabled) return;
7758
+ function ve() {
7759
+ if (!le.value || r.threadActionsDisabled) return;
7744
7760
  let e = h.value.turnId;
7745
7761
  e && i("fork-turn", e);
7746
7762
  }
7747
- function be() {
7748
- if (!de.value || r.threadActionsDisabled) return;
7763
+ function ye() {
7764
+ if (!ue.value || r.threadActionsDisabled) return;
7749
7765
  let e = h.value.turnId;
7750
7766
  e && i("retry-turn", e);
7751
7767
  }
7752
- function X(e, t) {
7768
+ function be(e, t) {
7753
7769
  return r.openImage?.(e, {
7754
7770
  index: r.index,
7755
7771
  intent: t?.intent ?? "open",
@@ -7775,14 +7791,14 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7775
7791
  ])) : O.value ? c("", !0) : (k(), l("div", {
7776
7792
  key: 1,
7777
7793
  class: w(["codex-chat-theme chat-message", [`chat-message--${h.value.role}`, {
7778
- "chat-message--actions-visible": q.value && !H.value,
7794
+ "chat-message--actions-visible": J.value && !U.value,
7779
7795
  "chat-message--editing": B.value
7780
7796
  }]]),
7781
- onPointerenter: r[12] ||= (e) => ie.value = e.pointerType !== "touch",
7782
- onPointerleave: r[13] ||= (e) => ie.value = !1,
7783
- onPointerdown: ae,
7784
- onFocusin: r[14] ||= (e) => U.value = !0,
7785
- onFocusout: oe
7797
+ onPointerenter: r[12] ||= (e) => re.value = e.pointerType !== "touch",
7798
+ onPointerleave: r[13] ||= (e) => re.value = !1,
7799
+ onPointerdown: ie,
7800
+ onFocusin: r[14] ||= (e) => W.value = !0,
7801
+ onFocusout: ae
7786
7802
  }, [u("div", zd, [
7787
7803
  n.$slots.header ? (k(), l("div", Bd, [F(n.$slots, "header", {
7788
7804
  index: e.index,
@@ -7795,24 +7811,24 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7795
7811
  message: h.value
7796
7812
  }, () => [m(bd, {
7797
7813
  block: t,
7798
- "open-image": X
7814
+ "open-image": be
7799
7815
  }, d({ _: 2 }, [n.$slots.attachment ? {
7800
7816
  name: "attachment",
7801
- fn: W((t) => [F(n.$slots, "attachment", S({ ref_for: !0 }, t, {
7817
+ fn: G((t) => [F(n.$slots, "attachment", S({ ref_for: !0 }, t, {
7802
7818
  index: e.index,
7803
7819
  message: h.value
7804
7820
  }), void 0, !0)]),
7805
7821
  key: "0"
7806
7822
  } : void 0]), 1032, ["block"])], !0, `attachment-${r}`)), 128))])) : c("", !0),
7807
- B.value || I.value.length > 0 || Y.value || pe.value || me.value ? (k(), l("div", Hd, [B.value ? (k(), s(Rd, {
7823
+ B.value || I.value.length > 0 || X.value || fe.value || pe.value ? (k(), l("div", Hd, [B.value ? (k(), s(Rd, {
7808
7824
  key: 0,
7809
7825
  "cancel-label": V(f)("chat.actions.cancel"),
7810
7826
  content: L.value,
7811
7827
  "prompt-content": h.value.promptContent,
7812
7828
  "input-label": V(f)("chat.actions.editPrompt"),
7813
7829
  "save-label": V(f)("chat.actions.resubmit"),
7814
- onCancel: ge,
7815
- onSave: _e
7830
+ onCancel: he,
7831
+ onSave: ge
7816
7832
  }, null, 8, [
7817
7833
  "cancel-label",
7818
7834
  "content",
@@ -7827,7 +7843,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7827
7843
  "follow-ups-disabled": e.followUpsDisabled,
7828
7844
  "mention-groups": e.mentionGroups,
7829
7845
  plugins: e.plugins,
7830
- "open-image": X,
7846
+ "open-image": be,
7831
7847
  "show-tool-details": e.showToolDetails,
7832
7848
  skills: e.skills,
7833
7849
  onCancel: r[0] ||= (e) => i("cancel"),
@@ -7838,7 +7854,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7838
7854
  }, d({ _: 2 }, [
7839
7855
  n.$slots.block ? {
7840
7856
  name: "block",
7841
- fn: W((t) => [F(n.$slots, "block", S({ ref_for: !0 }, t, {
7857
+ fn: G((t) => [F(n.$slots, "block", S({ ref_for: !0 }, t, {
7842
7858
  index: e.index,
7843
7859
  message: h.value
7844
7860
  }), void 0, !0)]),
@@ -7846,7 +7862,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7846
7862
  } : void 0,
7847
7863
  n.$slots.text ? {
7848
7864
  name: "text",
7849
- fn: W((t) => [F(n.$slots, "text", S({ ref_for: !0 }, t, {
7865
+ fn: G((t) => [F(n.$slots, "text", S({ ref_for: !0 }, t, {
7850
7866
  index: e.index,
7851
7867
  message: h.value
7852
7868
  }), void 0, !0)]),
@@ -7854,7 +7870,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7854
7870
  } : void 0,
7855
7871
  n.$slots.tool ? {
7856
7872
  name: "tool",
7857
- fn: W((t) => [F(n.$slots, "tool", S({ ref_for: !0 }, t, {
7873
+ fn: G((t) => [F(n.$slots, "tool", S({ ref_for: !0 }, t, {
7858
7874
  index: e.index,
7859
7875
  message: h.value
7860
7876
  }), void 0, !0)]),
@@ -7879,7 +7895,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7879
7895
  "follow-ups-disabled": e.followUpsDisabled,
7880
7896
  "mention-groups": e.mentionGroups,
7881
7897
  plugins: e.plugins,
7882
- "open-image": X,
7898
+ "open-image": be,
7883
7899
  "show-tool-details": e.showToolDetails,
7884
7900
  skills: e.skills,
7885
7901
  onCancel: r[5] ||= (e) => i("cancel"),
@@ -7890,7 +7906,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7890
7906
  }, d({ _: 2 }, [
7891
7907
  n.$slots.attachment ? {
7892
7908
  name: "attachment",
7893
- fn: W((t) => [F(n.$slots, "attachment", S({ ref_for: !0 }, t, {
7909
+ fn: G((t) => [F(n.$slots, "attachment", S({ ref_for: !0 }, t, {
7894
7910
  index: e.index,
7895
7911
  message: h.value
7896
7912
  }), void 0, !0)]),
@@ -7898,7 +7914,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7898
7914
  } : void 0,
7899
7915
  n.$slots.text ? {
7900
7916
  name: "text",
7901
- fn: W((t) => [F(n.$slots, "text", S({ ref_for: !0 }, t, {
7917
+ fn: G((t) => [F(n.$slots, "text", S({ ref_for: !0 }, t, {
7902
7918
  index: e.index,
7903
7919
  message: h.value
7904
7920
  }), void 0, !0)]),
@@ -7906,7 +7922,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7906
7922
  } : void 0,
7907
7923
  n.$slots.mention ? {
7908
7924
  name: "mention",
7909
- fn: W((t) => [F(n.$slots, "mention", S({ ref_for: !0 }, t, {
7925
+ fn: G((t) => [F(n.$slots, "mention", S({ ref_for: !0 }, t, {
7910
7926
  index: e.index,
7911
7927
  message: h.value
7912
7928
  }), void 0, !0)]),
@@ -7914,7 +7930,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7914
7930
  } : void 0,
7915
7931
  n.$slots.tool ? {
7916
7932
  name: "tool",
7917
- fn: W((t) => [F(n.$slots, "tool", S({ ref_for: !0 }, t, {
7933
+ fn: G((t) => [F(n.$slots, "tool", S({ ref_for: !0 }, t, {
7918
7934
  index: e.index,
7919
7935
  message: h.value
7920
7936
  }), void 0, !0)]),
@@ -7929,14 +7945,14 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7929
7945
  "show-tool-details",
7930
7946
  "skills"
7931
7947
  ])], !0, 1)], 64))), 128)),
7932
- Y.value ? (k(), l("span", Ud, z(V(f)("chat.message.emptyResponse")), 1)) : c("", !0),
7933
- pe.value ? F(n.$slots, "thinking", {
7948
+ X.value ? (k(), l("span", Ud, z(V(f)("chat.message.emptyResponse")), 1)) : c("", !0),
7949
+ fe.value ? F(n.$slots, "thinking", {
7934
7950
  index: e.index,
7935
7951
  message: h.value
7936
7952
  }, () => [u("span", {
7937
7953
  class: "chat-message__thinking codex-text-shimmer",
7938
7954
  "data-label": p.value
7939
- }, z(p.value), 9, Wd)], !0, 1) : me.value ? F(n.$slots, "status", {
7955
+ }, z(p.value), 9, Wd)], !0, 1) : pe.value ? F(n.$slots, "status", {
7940
7956
  index: e.index,
7941
7957
  message: h.value,
7942
7958
  status: "streaming"
@@ -7945,30 +7961,30 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
7945
7961
  "aria-label": "Streaming"
7946
7962
  }, null, -1)], !0, 2) : c("", !0)
7947
7963
  ], 64))])) : c("", !0),
7948
- se.value ? F(n.$slots, "actions", {
7949
- disabled: H.value,
7964
+ oe.value ? F(n.$slots, "actions", {
7965
+ disabled: U.value,
7950
7966
  index: e.index,
7951
7967
  message: h.value
7952
7968
  }, () => [m(Md, {
7953
- class: w(["chat-message__actions", { "chat-message__actions--reserved": H.value }]),
7954
- "aria-hidden": H.value ? "true" : void 0,
7955
- inert: H.value ? "" : void 0,
7956
- "can-delete": ce.value,
7957
- "can-edit": le.value,
7958
- "can-fork": ue.value,
7959
- "can-retry": de.value,
7969
+ class: w(["chat-message__actions", { "chat-message__actions--reserved": U.value }]),
7970
+ "aria-hidden": U.value ? "true" : void 0,
7971
+ inert: U.value ? "" : void 0,
7972
+ "can-delete": se.value,
7973
+ "can-edit": ce.value,
7974
+ "can-fork": le.value,
7975
+ "can-retry": ue.value,
7960
7976
  "copy-action": xe,
7961
7977
  deleting: e.deletingTurn,
7962
7978
  message: h.value,
7963
- "icons-visible": q.value,
7979
+ "icons-visible": J.value,
7964
7980
  "mutation-disabled": e.threadActionsDisabled,
7965
7981
  presentation: x.value.messages.actions,
7966
7982
  onCopy: r[10] ||= (t) => i("copy-message", e.index),
7967
- onDelete: ve,
7968
- onEdit: he,
7969
- onFork: ye,
7983
+ onDelete: _e,
7984
+ onEdit: me,
7985
+ onFork: ve,
7970
7986
  onQuote: r[11] ||= (t) => i("quote-message", e.index),
7971
- onRetry: be
7987
+ onRetry: ye
7972
7988
  }, null, 8, [
7973
7989
  "class",
7974
7990
  "aria-hidden",
@@ -8008,9 +8024,9 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
8008
8024
  entry: e,
8009
8025
  message: Ba(e.message)
8010
8026
  }))), a = o(() => n.turnId), s = o(() => i.value.some(({ message: e }) => e.role === "assistant" && So(e))), c = o(() => [...i.value].reverse().find(({ message: e }) => e.role === "assistant" && e.streaming === !0)?.entry.index), u = o(() => n.active === !1 ? void 0 : [...i.value].reverse().find(({ message: e }) => e.role === "assistant" && e.streaming === !0 && (e.parts?.length ?? 0) > 0)?.entry.index), d = o(() => i.value.some(({ entry: e, message: t }) => t.role === "assistant" && (u.value === void 0 || e.index >= u.value) && (t.parts?.some((e) => e.type === "text" && e.phase === "final_answer" && e.content.trim().length > 0) ?? !1))), f = o(() => !d.value && (n.active ?? i.value.some(({ message: e }) => e.role === "assistant" && e.streaming === !0))), p = o(() => n.status), m = o(() => n.startedAt), h = o(() => n.durationMs), g = o(() => n.itemsView !== "summary" && !f.value && !d.value && (p.value === "interrupted" || p.value === "failed")), _ = o(() => n.itemsView === void 0 && s.value && !f.value && !d.value && (p.value === void 0 || p.value === "completed")), v = o(() => i.value.find(({ message: e }) => e.role === "assistant" && (n.itemsView !== void 0 || T(e)))?.entry.index), y = o(() => n.itemsView === "summary" || i.value.some(({ message: e }) => e.type === "steer" && oo(e).length > 0 || e.role === "assistant" && oo(e).some((e) => (n.showToolBlocks || e.type !== "tool" && e.type !== "tool-group") && Co(e, n.answeredClientRequestIds)))), x = o(() => !!(a.value && v.value !== void 0)), S = N(f.value && !d.value || g.value), C = N(!1), w = o(() => !f.value && S.value && (n.detailsLoading || n.itemsView === "summary" && !n.detailsError));
8011
- U(d, (e, t) => {
8027
+ W(d, (e, t) => {
8012
8028
  e && !t && !C.value && (S.value = !1);
8013
- }), U([f, g], ([e, t]) => {
8029
+ }), W([f, g], ([e, t]) => {
8014
8030
  C.value || (S.value = e && !d.value || t);
8015
8031
  }), A(Vo, {
8016
8032
  active: f,
@@ -8035,7 +8051,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
8035
8051
  toggle() {
8036
8052
  C.value = !0, S.value = !S.value;
8037
8053
  }
8038
- }), U([
8054
+ }), W([
8039
8055
  f,
8040
8056
  S,
8041
8057
  () => n.itemsView,
@@ -8062,7 +8078,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
8062
8078
  "aria-label": e.label,
8063
8079
  title: e.label,
8064
8080
  onClick: r[0] ||= (e) => n("click")
8065
- }, [m(V(Y), {
8081
+ }, [m(V(X), {
8066
8082
  "aria-hidden": "true",
8067
8083
  size: 24,
8068
8084
  "stroke-width": 1.75
@@ -8156,11 +8172,11 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
8156
8172
  status: "streaming",
8157
8173
  parts: []
8158
8174
  }, p = R();
8159
- A(fc, p), U(() => i.resetKey, () => {
8175
+ A(fc, p), W(() => i.resetKey, () => {
8160
8176
  p.value = void 0;
8161
8177
  });
8162
8178
  let m = b(Bo, void 0) ?? ne(/* @__PURE__ */ new Map());
8163
- A(Bo, m), U(() => i.messages, (e) => {
8179
+ A(Bo, m), W(() => i.messages, (e) => {
8164
8180
  let t = {}, n = /* @__PURE__ */ new Set();
8165
8181
  for (let n of e) {
8166
8182
  if (!("metadata" in n)) continue;
@@ -8204,10 +8220,10 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
8204
8220
  });
8205
8221
  }
8206
8222
  return n;
8207
- }), B = o(() => It(i.presentation)), re = o((e) => {
8223
+ }), B = o(() => It(i.presentation)), H = o((e) => {
8208
8224
  let t = Object.fromEntries(Object.entries(i).filter(([e]) => e !== "messages" && e !== "turns"));
8209
8225
  return e && Object.keys(e).length === Object.keys(t).length && Object.keys(t).every((n) => t[n] === e[n]) ? e : t;
8210
- }), H = o((e) => {
8226
+ }), U = o((e) => {
8211
8227
  let t = [];
8212
8228
  for (let e of L.value) {
8213
8229
  let n = Ba(e.message).turnId?.trim() || void 0, r = t.at(-1);
@@ -8223,7 +8239,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
8223
8239
  }
8224
8240
  let n = new Set(I.value.filter((e) => e.role === "assistant").map((e) => Ba(e).turnId?.trim()));
8225
8241
  for (let [e, r] of t.entries()) {
8226
- if (!r.turnId || r.turnId === K.value || ae.value.get(r.turnId) !== "completed" || n.has(r.turnId) || !r.entries.some((e) => e.message.role === "user")) continue;
8242
+ if (!r.turnId || r.turnId === q.value || ie.value.get(r.turnId) !== "completed" || n.has(r.turnId) || !r.entries.some((e) => e.message.role === "user")) continue;
8227
8243
  let t = `codex-empty-response:${r.turnId}`;
8228
8244
  r.entries.push({
8229
8245
  index: i.messages.length + e + 1,
@@ -8246,8 +8262,8 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
8246
8262
  }) ? t : e;
8247
8263
  });
8248
8264
  });
8249
- function ie(e) {
8250
- let t = e ? q.value.get(e) : void 0;
8265
+ function re(e) {
8266
+ let t = e ? J.value.get(e) : void 0;
8251
8267
  return [
8252
8268
  t?.status,
8253
8269
  t?.startedAt,
@@ -8258,25 +8274,25 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
8258
8274
  t?.detailsError
8259
8275
  ];
8260
8276
  }
8261
- function G(e) {
8277
+ function K(e) {
8262
8278
  if (i.busy && e.entries.some(({ index: e, message: t }) => e < i.messages.length && t.role === "assistant" && Ba(t).streaming === !0)) return !0;
8263
8279
  if (i.activeTurnId !== void 0) return e.turnId !== void 0 && e.turnId === i.activeTurnId;
8264
8280
  }
8265
- let K = o(() => i.activeTurnId !== void 0 && i.activeTurnId !== null ? i.activeTurnId : (i.busy ? [...i.messages].reverse().map(Ba).find((e) => e.role === "assistant" && e.streaming)?.turnId?.trim() : void 0) || null), q = o(() => new Map(i.turns?.map((e) => [e.id, e]) ?? [])), ae = o(() => new Map(i.turns?.map((e) => [e.id, e.status]) ?? [])), oe = o(() => new Map(i.turns?.map((e) => [e.id, {
8281
+ let q = o(() => i.activeTurnId !== void 0 && i.activeTurnId !== null ? i.activeTurnId : (i.busy ? [...i.messages].reverse().map(Ba).find((e) => e.role === "assistant" && e.streaming)?.turnId?.trim() : void 0) || null), J = o(() => new Map(i.turns?.map((e) => [e.id, e]) ?? [])), ie = o(() => new Map(i.turns?.map((e) => [e.id, e.status]) ?? [])), ae = o(() => new Map(i.turns?.map((e) => [e.id, {
8266
8282
  startedAt: e.startedAt,
8267
- durationMs: e.durationMs ?? se(e.startedAt, e.completedAt)
8283
+ durationMs: e.durationMs ?? oe(e.startedAt, e.completedAt)
8268
8284
  }]) ?? []));
8269
- function se(e, t) {
8285
+ function oe(e, t) {
8270
8286
  if (!e || !t) return null;
8271
8287
  let n = Date.parse(t) - Date.parse(e);
8272
8288
  return Number.isFinite(n) && n >= 0 ? n : null;
8273
8289
  }
8274
- function ce(e) {
8275
- return !e || e === K.value ? !1 : ae.value.get(e) !== "inProgress";
8290
+ function se(e) {
8291
+ return !e || e === q.value ? !1 : ie.value.get(e) !== "inProgress";
8276
8292
  }
8277
- function le(e, t) {
8278
- let n = t ? ae.value.get(t) : void 0;
8279
- return !n || n === "inProgress" || t === K.value ? e : "content" in e ? e.streaming ? {
8293
+ function ce(e, t) {
8294
+ let n = t ? ie.value.get(t) : void 0;
8295
+ return !n || n === "inProgress" || t === q.value ? e : "content" in e ? e.streaming ? {
8280
8296
  ...e,
8281
8297
  streaming: !1
8282
8298
  } : e : e.status === "streaming" ? {
@@ -8284,40 +8300,40 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
8284
8300
  status: "complete"
8285
8301
  } : e;
8286
8302
  }
8287
- function ue(e) {
8288
- if (!ce(e)) return !1;
8289
- let t = ae.value.get(e);
8303
+ function le(e) {
8304
+ if (!se(e)) return !1;
8305
+ let t = ie.value.get(e);
8290
8306
  return t === void 0 || t === "completed";
8291
8307
  }
8292
- let de = o(() => [...L.value].reverse().find((e) => e.message.role === "assistant")?.index);
8293
- function fe(e) {
8294
- return e === de.value;
8308
+ let ue = o(() => [...L.value].reverse().find((e) => e.message.role === "assistant")?.index);
8309
+ function de(e) {
8310
+ return e === ue.value;
8295
8311
  }
8296
- let J = N(null), Y = N(!0), pe = N(!1), me = null, he = null, ge = 0, _e = !1, ve = null;
8312
+ let Y = N(null), X = N(!0), fe = N(!1), pe = null, me = null, he = 0, ge = !1, _e = null;
8297
8313
  ee(async () => {
8298
8314
  document.addEventListener("pointerup", Se), document.addEventListener("selectionchange", Ce), await C(), We();
8299
- let e = J.value?.querySelector(".codex-message-list__content");
8300
- e && typeof ResizeObserver < "u" && (me = new ResizeObserver(() => {
8301
- Y.value ? Ge() : He();
8302
- }), me.observe(e)), Ge();
8303
- }), U(() => i.messages.length, async (e) => {
8304
- let t = T, n = J.value, r = n.scrollHeight, i = n.scrollTop;
8315
+ let e = Y.value?.querySelector(".codex-message-list__content");
8316
+ e && typeof ResizeObserver < "u" && (pe = new ResizeObserver(() => {
8317
+ X.value ? Ge() : He();
8318
+ }), pe.observe(e)), Ge();
8319
+ }), W(() => i.messages.length, async (e) => {
8320
+ let t = T, n = Y.value, r = n.scrollHeight, i = n.scrollTop;
8305
8321
  T = e;
8306
8322
  let a = h.value === "lazy" && je(e, t);
8307
8323
  Ne();
8308
- let o = !a && Y.value && Ue();
8324
+ let o = !a && X.value && Ue();
8309
8325
  await C(), a && n ? n.scrollTop = i + n.scrollHeight - r : o && We();
8310
- }), U([
8326
+ }), W([
8311
8327
  () => i.resetKey,
8312
8328
  () => i.messages.length,
8313
8329
  () => i.messages.at(-1)
8314
8330
  ], ([e, t, n], [r, i, a]) => {
8315
- e !== r || t !== i || !n || !a || n.id && a.id && n.id !== a.id || be();
8316
- }), U(() => i.messageTextSelection, (e) => {
8331
+ e !== r || t !== i || !n || !a || n.id && a.id && n.id !== a.id || ye();
8332
+ }), W(() => i.messageTextSelection, (e) => {
8317
8333
  e || Ee();
8318
- }), U(() => i.resetKey, async (e, t) => {
8334
+ }), W(() => i.resetKey, async (e, t) => {
8319
8335
  Ee();
8320
- let n = J.value;
8336
+ let n = Y.value;
8321
8337
  n && t != null && y.set(t, {
8322
8338
  renderedAnchor: w,
8323
8339
  scrollTop: n.scrollTop,
@@ -8325,35 +8341,35 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
8325
8341
  });
8326
8342
  let r = e == null ? void 0 : y.get(e), a = r ? Ie(i.messages, r.renderedAnchor) : -1;
8327
8343
  Me(a >= 0 ? a : Re(i.messages, g.value)), j.value = !1, M = !1, Ve(r?.stickToBottom ?? !0), Ne(), await C(), r && n ? (n.scrollTop = r.stickToBottom ? n.scrollHeight : r.scrollTop, He()) : We();
8328
- }), U(() => [i.loadingOlderMessages, i.hasOlderMessages], () => {
8344
+ }), W(() => [i.loadingOlderMessages, i.hasOlderMessages], () => {
8329
8345
  M = !1;
8330
- }), U(() => [
8346
+ }), W(() => [
8331
8347
  h.value,
8332
8348
  g.value,
8333
8349
  _.value
8334
8350
  ], async () => {
8335
- h.value === "lazy" && (Me(Re(i.messages, g.value)), Ne(), await C(), Y.value && We());
8351
+ h.value === "lazy" && (Me(Re(i.messages, g.value)), Ne(), await C(), X.value && We());
8336
8352
  });
8337
- function ye() {
8353
+ function ve() {
8338
8354
  Ee();
8339
- let e = J.value, t = e !== null && e.scrollTop < ge;
8340
- e && (ge = e.scrollTop), He(), pe.value ? t && Ve(!1) : Ve(!0), h.value === "lazy" && ke() && v.value <= 0 && i.hasOlderMessages && !i.loadingOlderMessages ? Oe() : h.value === "lazy" && ke() && Ae();
8355
+ let e = Y.value, t = e !== null && e.scrollTop < he;
8356
+ e && (he = e.scrollTop), He(), fe.value ? t && Ve(!1) : Ve(!0), h.value === "lazy" && ke() && v.value <= 0 && i.hasOlderMessages && !i.loadingOlderMessages ? Oe() : h.value === "lazy" && ke() && Ae();
8341
8357
  }
8342
- function be() {
8343
- Y.value ? Ge() : C(He);
8358
+ function ye() {
8359
+ X.value ? Ge() : C(He);
8344
8360
  }
8345
- function X(e) {
8361
+ function be(e) {
8346
8362
  let t = e.target;
8347
8363
  !(t instanceof Element) || !t.closest(".chat-work-group__header") || Ve(!1);
8348
8364
  }
8349
8365
  function xe() {
8350
- i.messageTextSelection && (_e = !0);
8366
+ i.messageTextSelection && (ge = !0);
8351
8367
  }
8352
8368
  function Se() {
8353
- _e && (_e = !1, we());
8369
+ ge && (ge = !1, we());
8354
8370
  }
8355
8371
  function Ce() {
8356
- !i.messageTextSelection || _e || we();
8372
+ !i.messageTextSelection || ge || we();
8357
8373
  }
8358
8374
  function we() {
8359
8375
  if (!i.messageTextSelection) {
@@ -8388,14 +8404,14 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
8388
8404
  ...u.id ? { messageId: u.id } : {},
8389
8405
  ...u.turnId ? { turnId: u.turnId } : {}
8390
8406
  };
8391
- De(ve, d) || (ve = d, a("message-text-selection-change", d));
8407
+ De(_e, d) || (_e = d, a("message-text-selection-change", d));
8392
8408
  }
8393
8409
  function Te(e) {
8394
8410
  let t = (e instanceof Element ? e : e.parentElement)?.closest("[data-codex-message-index]") ?? null;
8395
- return t && J.value?.contains(t) ? t : null;
8411
+ return t && Y.value?.contains(t) ? t : null;
8396
8412
  }
8397
8413
  function Ee() {
8398
- _e = !1, ve && (ve = null, a("message-text-selection-change", null));
8414
+ ge = !1, _e && (_e = null, a("message-text-selection-change", null));
8399
8415
  }
8400
8416
  function De(e, t) {
8401
8417
  return !!(e && e.text === t.text && e.messageIndex === t.messageIndex && e.anchor.x === t.anchor.x && e.anchor.y === t.anchor.y && e.anchor.width === t.anchor.width && e.anchor.height === t.anchor.height);
@@ -8404,12 +8420,12 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
8404
8420
  !i.hasOlderMessages || i.loadingOlderMessages || M || (M = !0, a("load-older-messages"));
8405
8421
  }
8406
8422
  function ke() {
8407
- let e = J.value;
8423
+ let e = Y.value;
8408
8424
  return e !== null && e.scrollTop <= e.clientHeight;
8409
8425
  }
8410
8426
  async function Ae() {
8411
8427
  if (j.value || v.value <= 0) return;
8412
- let e = J.value, t = e.scrollHeight, n = e.scrollTop;
8428
+ let e = Y.value, t = e.scrollHeight, n = e.scrollTop;
8413
8429
  j.value = !0, Me(Math.max(0, v.value - Le(_.value))), await C(), e.scrollTop = n + e.scrollHeight - t, j.value = !1, v.value <= 0 && Oe();
8414
8430
  }
8415
8431
  function je(e, t) {
@@ -8457,45 +8473,45 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
8457
8473
  return n;
8458
8474
  }
8459
8475
  function Ve(e) {
8460
- Y.value !== e && (Y.value = e, a("stickiness-change", e));
8476
+ X.value !== e && (X.value = e, a("stickiness-change", e));
8461
8477
  }
8462
8478
  function He() {
8463
- pe.value = !Ue();
8479
+ fe.value = !Ue();
8464
8480
  }
8465
8481
  function Ue() {
8466
- let e = J.value;
8467
- return e ? e.scrollHeight - e.scrollTop - e.clientHeight <= i.bottomThreshold : Y.value;
8482
+ let e = Y.value;
8483
+ return e ? e.scrollHeight - e.scrollTop - e.clientHeight <= i.bottomThreshold : X.value;
8468
8484
  }
8469
8485
  function We() {
8470
- J.value && (J.value.scrollTop = J.value.scrollHeight, ge = J.value.scrollTop, Ve(!0), He());
8486
+ Y.value && (Y.value.scrollTop = Y.value.scrollHeight, he = Y.value.scrollTop, Ve(!0), He());
8471
8487
  }
8472
8488
  function Ge() {
8473
- if (he !== null) return;
8489
+ if (me !== null) return;
8474
8490
  let e = () => {
8475
- he = null, Y.value && We();
8491
+ me = null, X.value && We();
8476
8492
  };
8477
- he = typeof requestAnimationFrame == "function" ? requestAnimationFrame(e) : setTimeout(e, 0);
8493
+ me = typeof requestAnimationFrame == "function" ? requestAnimationFrame(e) : setTimeout(e, 0);
8478
8494
  }
8479
8495
  return D(() => {
8480
- document.removeEventListener("pointerup", Se), document.removeEventListener("selectionchange", Ce), me?.disconnect(), me = null, he !== null && (typeof he == "number" && typeof cancelAnimationFrame == "function" ? cancelAnimationFrame(he) : clearTimeout(he));
8496
+ document.removeEventListener("pointerup", Se), document.removeEventListener("selectionchange", Ce), pe?.disconnect(), pe = null, me !== null && (typeof me == "number" && typeof cancelAnimationFrame == "function" ? cancelAnimationFrame(me) : clearTimeout(me));
8481
8497
  }), n({ scrollToBottom: We }), (n, r) => (k(), l("div", {
8482
8498
  class: "codex-chat-theme codex-message-list",
8483
8499
  "aria-label": e.ariaLabel
8484
8500
  }, [u("div", {
8485
8501
  ref_key: "scrollElement",
8486
- ref: J,
8502
+ ref: Y,
8487
8503
  class: "codex-message-list__viewport message-list",
8488
- onClickCapture: X,
8504
+ onClickCapture: be,
8489
8505
  onPointerdown: xe,
8490
- onScroll: ye
8491
- }, [u("div", Qd, [L.value.length === 0 ? F(n.$slots, "empty", {}, () => [u("p", $d, z(e.emptyLabel), 1)], !0, 0) : (k(!0), l(t, { key: 1 }, P(H.value, (i, o, c, u) => {
8506
+ onScroll: ve
8507
+ }, [u("div", Qd, [L.value.length === 0 ? F(n.$slots, "empty", {}, () => [u("p", $d, z(e.emptyLabel), 1)], !0, 0) : (k(!0), l(t, { key: 1 }, P(U.value, (i, o, c, u) => {
8492
8508
  let f = [
8493
8509
  i,
8494
- re.value,
8495
- K.value,
8496
- de.value,
8497
- ...ie(i.turnId),
8498
- G(i),
8510
+ H.value,
8511
+ q.value,
8512
+ ue.value,
8513
+ ...re(i.turnId),
8514
+ K(i),
8499
8515
  ...Object.values(n.$slots)
8500
8516
  ];
8501
8517
  if (u && u.el && u.key === i.key && x(u, f)) return u;
@@ -8503,26 +8519,26 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
8503
8519
  key: i.key,
8504
8520
  entries: i.entries,
8505
8521
  "answered-client-request-ids": e.answeredClientRequestIds,
8506
- active: G(i),
8522
+ active: K(i),
8507
8523
  "show-tool-blocks": B.value.messages.toolBlocks,
8508
- status: i.turnId ? ae.value.get(i.turnId) : void 0,
8509
- "started-at": i.turnId ? oe.value.get(i.turnId)?.startedAt : void 0,
8510
- "duration-ms": i.turnId ? oe.value.get(i.turnId)?.durationMs : void 0,
8524
+ status: i.turnId ? ie.value.get(i.turnId) : void 0,
8525
+ "started-at": i.turnId ? ae.value.get(i.turnId)?.startedAt : void 0,
8526
+ "duration-ms": i.turnId ? ae.value.get(i.turnId)?.durationMs : void 0,
8511
8527
  "turn-id": i.turnId,
8512
- "items-view": i.turnId ? q.value.get(i.turnId)?.itemsView : void 0,
8513
- "details-loading": i.turnId ? q.value.get(i.turnId)?.detailsLoading : void 0,
8514
- "details-error": i.turnId ? q.value.get(i.turnId)?.detailsError : void 0,
8528
+ "items-view": i.turnId ? J.value.get(i.turnId)?.itemsView : void 0,
8529
+ "details-loading": i.turnId ? J.value.get(i.turnId)?.detailsLoading : void 0,
8530
+ "details-error": i.turnId ? J.value.get(i.turnId)?.detailsError : void 0,
8515
8531
  onLoadTurnHistory: r[13] ||= (e) => a("load-turn-history", e)
8516
8532
  }, {
8517
- default: W(() => [(k(!0), l(t, null, P(i.entries, (t, o, c, u) => {
8533
+ default: G(() => [(k(!0), l(t, null, P(i.entries, (t, o, c, u) => {
8518
8534
  let f = [
8519
8535
  t.message,
8520
8536
  t.index,
8521
8537
  t.activityState,
8522
- re.value,
8523
- K.value,
8524
- de.value,
8525
- ...ie(i.turnId),
8538
+ H.value,
8539
+ q.value,
8540
+ ue.value,
8541
+ ...re(i.turnId),
8526
8542
  Object.keys(n.$slots).length ? {} : void 0
8527
8543
  ];
8528
8544
  if (u && u.el && u.key === t.key && x(u, f)) return u;
@@ -8531,23 +8547,23 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
8531
8547
  class: "codex-message-list__entry",
8532
8548
  "data-codex-message-index": t.index
8533
8549
  }, [n.$slots.message ? F(n.$slots, "message", {
8534
- message: V(Ba)(le(t.message, i.turnId)),
8550
+ message: V(Ba)(ce(t.message, i.turnId)),
8535
8551
  index: t.index
8536
8552
  }, void 0, !0, 0) : (k(), s(Kd, {
8537
8553
  key: 1,
8538
8554
  "activity-state": t.activityState,
8539
8555
  "actions-disabled": e.actionsDisabled,
8540
- "actions-always-visible": fe(t.index),
8556
+ "actions-always-visible": de(t.index),
8541
8557
  "answered-client-request-ids": e.answeredClientRequestIds,
8542
- "can-delete-turn": e.canDeleteTurn && ce(i.turnId),
8543
- "can-edit-turn": e.canEditTurn && ce(i.turnId),
8544
- "can-fork-turn": e.canForkTurn && ue(i.turnId),
8545
- "can-retry-turn": e.canRetryTurn && ce(i.turnId),
8558
+ "can-delete-turn": e.canDeleteTurn && se(i.turnId),
8559
+ "can-edit-turn": e.canEditTurn && se(i.turnId),
8560
+ "can-fork-turn": e.canForkTurn && le(i.turnId),
8561
+ "can-retry-turn": e.canRetryTurn && se(i.turnId),
8546
8562
  "deleting-turn": !!(e.deletingTurnId && i.turnId === e.deletingTurnId),
8547
8563
  "follow-ups-disabled": e.followUpsDisabled,
8548
8564
  "hidden-client-request-ids": e.hiddenClientRequestIds,
8549
8565
  index: t.index,
8550
- message: le(t.message, i.turnId),
8566
+ message: ce(t.message, i.turnId),
8551
8567
  "mention-groups": e.mentionGroups,
8552
8568
  "open-image": e.openImage,
8553
8569
  plugins: e.plugins,
@@ -8569,47 +8585,47 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
8569
8585
  }, d({ _: 2 }, [
8570
8586
  n.$slots.actions ? {
8571
8587
  name: "actions",
8572
- fn: W((e) => [F(n.$slots, "actions", S({ ref_for: !0 }, e), void 0, !0)]),
8588
+ fn: G((e) => [F(n.$slots, "actions", S({ ref_for: !0 }, e), void 0, !0)]),
8573
8589
  key: "0"
8574
8590
  } : void 0,
8575
8591
  n.$slots.attachment ? {
8576
8592
  name: "attachment",
8577
- fn: W((e) => [F(n.$slots, "attachment", S({ ref_for: !0 }, e), void 0, !0)]),
8593
+ fn: G((e) => [F(n.$slots, "attachment", S({ ref_for: !0 }, e), void 0, !0)]),
8578
8594
  key: "1"
8579
8595
  } : void 0,
8580
8596
  n.$slots.block ? {
8581
8597
  name: "block",
8582
- fn: W((e) => [F(n.$slots, "block", S({ ref_for: !0 }, e), void 0, !0)]),
8598
+ fn: G((e) => [F(n.$slots, "block", S({ ref_for: !0 }, e), void 0, !0)]),
8583
8599
  key: "2"
8584
8600
  } : void 0,
8585
8601
  n.$slots.header ? {
8586
8602
  name: "header",
8587
- fn: W((e) => [F(n.$slots, "header", S({ ref_for: !0 }, e), void 0, !0)]),
8603
+ fn: G((e) => [F(n.$slots, "header", S({ ref_for: !0 }, e), void 0, !0)]),
8588
8604
  key: "3"
8589
8605
  } : void 0,
8590
8606
  n.$slots.mention ? {
8591
8607
  name: "mention",
8592
- fn: W((e) => [F(n.$slots, "mention", S({ ref_for: !0 }, e), void 0, !0)]),
8608
+ fn: G((e) => [F(n.$slots, "mention", S({ ref_for: !0 }, e), void 0, !0)]),
8593
8609
  key: "4"
8594
8610
  } : void 0,
8595
8611
  n.$slots.status ? {
8596
8612
  name: "status",
8597
- fn: W((e) => [F(n.$slots, "status", S({ ref_for: !0 }, e), void 0, !0)]),
8613
+ fn: G((e) => [F(n.$slots, "status", S({ ref_for: !0 }, e), void 0, !0)]),
8598
8614
  key: "5"
8599
8615
  } : void 0,
8600
8616
  n.$slots.text ? {
8601
8617
  name: "text",
8602
- fn: W((e) => [F(n.$slots, "text", S({ ref_for: !0 }, e), void 0, !0)]),
8618
+ fn: G((e) => [F(n.$slots, "text", S({ ref_for: !0 }, e), void 0, !0)]),
8603
8619
  key: "6"
8604
8620
  } : void 0,
8605
8621
  n.$slots.thinking ? {
8606
8622
  name: "thinking",
8607
- fn: W((e) => [F(n.$slots, "thinking", S({ ref_for: !0 }, e), void 0, !0)]),
8623
+ fn: G((e) => [F(n.$slots, "thinking", S({ ref_for: !0 }, e), void 0, !0)]),
8608
8624
  key: "7"
8609
8625
  } : void 0,
8610
8626
  n.$slots.tool ? {
8611
8627
  name: "tool",
8612
- fn: W((e) => [F(n.$slots, "tool", S({ ref_for: !0 }, e), void 0, !0)]),
8628
+ fn: G((e) => [F(n.$slots, "tool", S({ ref_for: !0 }, e), void 0, !0)]),
8613
8629
  key: "8"
8614
8630
  } : void 0
8615
8631
  ]), 1032, [
@@ -8651,7 +8667,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
8651
8667
  "details-error"
8652
8668
  ]));
8653
8669
  return p.memo = f, p;
8654
- }, r, 14), 128))])], 544), pe.value ? (k(), s(Xd, {
8670
+ }, r, 14), 128))])], 544), fe.value ? (k(), s(Xd, {
8655
8671
  key: 0,
8656
8672
  class: "codex-message-list__scroll-to-bottom",
8657
8673
  label: e.scrollToBottomLabel,
@@ -8908,21 +8924,21 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
8908
8924
  text: i.modelValue,
8909
8925
  selectionStart: i.modelValue.length,
8910
8926
  selectionEnd: i.modelValue.length
8911
- })), I = N(te), L = N(te.text), R = N(null), B = N(null), re = N(null), H = 0, ie = 0, G = N(null), K = N([...M.value]), q = /* @__PURE__ */ new Map(), ae = N([]), se = N(!1), ce = 0, le = o(() => O((e) => e.identity.messages, () => i.messages ?? D.value?.messages ?? [])), ue = o(() => {
8912
- let e = le.value, t = re.value;
8927
+ })), I = N(te), L = N(te.text), R = N(null), B = N(null), H = N(null), U = 0, re = 0, K = N(null), q = N([...M.value]), J = /* @__PURE__ */ new Map(), ie = N([]), oe = N(!1), se = 0, ce = o(() => O((e) => e.identity.messages, () => i.messages ?? D.value?.messages ?? [])), le = o(() => {
8928
+ let e = ce.value, t = H.value;
8913
8929
  return !t || e.some((e) => kt(e, t)) ? e : [...e, t.message];
8914
- }), de = o(() => O((e) => e.identity.activeTurnId, () => i.activeTurnId === void 0 ? D.value?.activeTurnId : i.activeTurnId)), fe = o(() => O((e) => e.identity.turns, () => i.turns ?? D.value?.turns ?? [])), J = o(() => !ke.value && de.value == null && (fe.value ?? []).at(-1)?.status === "interrupted"), Y = o(() => ue.value.flatMap((e) => {
8930
+ }), ue = o(() => O((e) => e.identity.activeTurnId, () => i.activeTurnId === void 0 ? D.value?.activeTurnId : i.activeTurnId)), de = o(() => O((e) => e.identity.turns, () => i.turns ?? D.value?.turns ?? [])), Y = o(() => !ke.value && ue.value == null && (de.value ?? []).at(-1)?.status === "interrupted"), X = o(() => le.value.flatMap((e) => {
8915
8931
  let t = Ba(e);
8916
8932
  if (t.role !== "user") return [];
8917
- let n = go(t.promptContent ? oe(t.promptContent, t.content) : t.content);
8933
+ let n = go(t.promptContent ? ae(t.promptContent, t.content) : t.content);
8918
8934
  return n && n !== "(no user instructions)" ? [n] : [];
8919
- })), pe = o(() => O((e) => e.composer?.promptHistory, () => i.promptHistory)), me = o(() => Ct(pe.value ?? ae.value, Y.value)), he = o(() => O((e) => e.thread?.answeredClientRequestIds, () => i.answeredClientRequestIds ?? i.surface?.answeredClientRequestIds));
8920
- function ge(e, t) {
8935
+ })), fe = o(() => O((e) => e.composer?.promptHistory, () => i.promptHistory)), pe = o(() => Ct(fe.value ?? ie.value, X.value)), me = o(() => O((e) => e.thread?.answeredClientRequestIds, () => i.answeredClientRequestIds ?? i.surface?.answeredClientRequestIds));
8936
+ function he(e, t) {
8921
8937
  let n = new Set(t);
8922
8938
  return e && n.size === e.size && [...n].every((t) => e.has(t)) ? e : n;
8923
8939
  }
8924
- let _e = o((e) => ge(e, [...he.value ?? [], ...p.keys()])), ve = o(() => O((e) => e.thread?.clientRequests ?? [], () => i.clientRequests ?? D.value?.clientRequests ?? [])), ye = o(() => {
8925
- let e = /* @__PURE__ */ new Set(), t = new Map((fe.value ?? []).map((e, t) => [e.id, t])), n = le.value.map(Ba);
8940
+ let ge = o((e) => he(e, [...me.value ?? [], ...p.keys()])), _e = o(() => O((e) => e.thread?.clientRequests ?? [], () => i.clientRequests ?? D.value?.clientRequests ?? [])), ve = o(() => {
8941
+ let e = /* @__PURE__ */ new Set(), t = new Map((de.value ?? []).map((e, t) => [e.id, t])), n = ce.value.map(Ba);
8926
8942
  for (let [r, i] of n.entries()) for (let a of i.parts ?? []) {
8927
8943
  if (a.type !== "question" || a.request.payload.request.delivery !== "async") continue;
8928
8944
  let o = a.request.turnId ?? i.turnId, s = o ? t.get(o) : void 0;
@@ -8933,65 +8949,65 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
8933
8949
  }) && e.add(a.request.id);
8934
8950
  }
8935
8951
  return e;
8936
- }), be = o(() => /* @__PURE__ */ new Set([...g.value, ...ye.value])), X = o(() => {
8952
+ }), ye = o(() => /* @__PURE__ */ new Set([...g.value, ...ve.value])), be = o(() => {
8937
8953
  let e = [], t = /* @__PURE__ */ new Set();
8938
- for (let n of ve.value) n.kind !== "ask_user" || n.payload.request.delivery !== "tool" || n.payload.request.questions.length === 0 || _e.value.has(n.id) || (t.add(n.id), e.push(n));
8939
- for (let n of ue.value) for (let r of Ba(n).parts ?? []) r.type !== "question" || r.historical === !0 || r.request.payload.request.questions.length === 0 || t.has(r.request.id) || _e.value.has(r.request.id) || be.value.has(r.request.id) || (t.add(r.request.id), e.push(r.request));
8954
+ for (let n of _e.value) n.kind !== "ask_user" || n.payload.request.delivery !== "tool" || n.payload.request.questions.length === 0 || ge.value.has(n.id) || (t.add(n.id), e.push(n));
8955
+ for (let n of le.value) for (let r of Ba(n).parts ?? []) r.type !== "question" || r.historical === !0 || r.request.payload.request.questions.length === 0 || t.has(r.request.id) || ge.value.has(r.request.id) || ye.value.has(r.request.id) || (t.add(r.request.id), e.push(r.request));
8940
8956
  return e;
8941
- }), Se = o(() => X.value.find((e) => e.payload.request.delivery === "tool") ?? X.value.find((e) => e.id === h.value) ?? X.value.find((e) => {
8957
+ }), Se = o(() => be.value.find((e) => e.payload.request.delivery === "tool") ?? be.value.find((e) => e.id === h.value) ?? be.value.find((e) => {
8942
8958
  if (e.payload.request.delivery !== "async") return !0;
8943
- let t = fe.value?.find((t) => t.id === e.turnId);
8944
- return t ? t.status === "inProgress" : e.turnId === de.value;
8945
- })), Ce = o((e) => ge(e, X.value.map((e) => e.id))), we = o(() => ve.value.find((e) => e.kind === "confirm_tool" && !_e.value.has(e.id))), Te = o(() => new Set(ve.value.filter((e) => e.kind === "confirm_tool" ? !_e.value.has(e.id) : e.payload.request.delivery === "tool").map((e) => e.itemId)));
8959
+ let t = de.value?.find((t) => t.id === e.turnId);
8960
+ return t ? t.status === "inProgress" : e.turnId === ue.value;
8961
+ })), Ce = o((e) => he(e, be.value.map((e) => e.id))), we = o(() => _e.value.find((e) => e.kind === "confirm_tool" && !ge.value.has(e.id))), Te = o(() => new Set(_e.value.filter((e) => e.kind === "confirm_tool" ? !ge.value.has(e.id) : e.payload.request.delivery === "tool").map((e) => e.itemId)));
8946
8962
  function Ee(e, t) {
8947
8963
  let n = i.transformMessage?.(e, t) ?? e, r = Ba(n), a = (e) => Te.value.has(e.itemId ?? e.id);
8948
- return !r.parts?.some((e) => e.type === "question" && be.value.has(e.request.id) || e.type === "tool" && a(e.toolCall)) && !r.toolCalls?.some(a) ? n : {
8964
+ return !r.parts?.some((e) => e.type === "question" && ye.value.has(e.request.id) || e.type === "tool" && a(e.toolCall)) && !r.toolCalls?.some(a) ? n : {
8949
8965
  ...r,
8950
- parts: r.parts?.filter((e) => e.type !== "tool" || !a(e.toolCall)).map((e) => e.type === "question" && be.value.has(e.request.id) ? {
8966
+ parts: r.parts?.filter((e) => e.type !== "tool" || !a(e.toolCall)).map((e) => e.type === "question" && ye.value.has(e.request.id) ? {
8951
8967
  ...e,
8952
8968
  historical: !0
8953
8969
  } : e),
8954
8970
  toolCalls: r.toolCalls?.filter((e) => !a(e))
8955
8971
  };
8956
8972
  }
8957
- let De = o(() => O((e) => e.thread?.approvals ?? [], () => i.approvals ?? D.value?.approvals ?? [])), Oe = o(() => De.value[0]), ke = o(() => O((e) => e.identity.busy ?? !1, () => i.busy ?? D.value?.busy ?? !1)), Ae = o(() => ke.value || re.value !== null), { armed: je, clear: Me } = zo({
8973
+ let De = o(() => O((e) => e.thread?.approvals ?? [], () => i.approvals ?? D.value?.approvals ?? [])), Oe = o(() => De.value[0]), ke = o(() => O((e) => e.identity.busy ?? !1, () => i.busy ?? D.value?.busy ?? !1)), Ae = o(() => ke.value || H.value !== null), { armed: je, clear: Me } = zo({
8958
8974
  root: x,
8959
8975
  busy: () => ke.value,
8960
8976
  enabled: () => i.escapeInterrupt,
8961
- onInterrupt: gn
8962
- }), Ne = o(() => O((e) => e.identity.conversationKey, () => i.conversationKey === void 0 ? D.value?.activeConversationId : i.conversationKey)), Pe = o(() => O((e) => e.thread?.contextUsage, () => i.contextUsage === void 0 ? D.value?.contextUsage : i.contextUsage)), Ie = o(() => O((e) => e.identity.disabled ?? !1, () => i.disabled ?? (D.value ? D.value.status !== "ready" : !1))), Le = o(() => G.value ?? O((e) => e.identity.error, () => i.error ?? D.value?.error ?? null) ?? null), Re = o(() => O((e) => e.thread?.goal ?? null, () => i.goal === void 0 ? D.value?.goal ?? null : i.goal)), ze = o(() => O((e) => e.history?.loading ?? !1, () => i.historyLoading ?? D.value?.historyLoading ?? !1)), Be = o(() => i.renderStrategy ?? (i.lazyMessages === !1 ? "eager" : "lazy")), Ve = o(() => O((e) => e.history?.hasOlder ?? !1, () => i.hasOlderHistory ?? D.value?.historyState?.hasOlder ?? !1)), He = o(() => O((e) => e.history?.loadingOlder ?? !1, () => i.loadingOlderHistory ?? D.value?.historyState?.loadingOlder ?? !1)), Ue = o(() => O((e) => e.catalogs?.modelCatalogStatus, () => i.modelCatalogStatus ?? D.value?.modelCatalogStatus)), We = o(() => O((e) => e.catalogs?.models, () => i.models ?? D.value?.models)), Ge = o(() => O((e) => e.composer?.approvalPreset, () => i.approvalPreset === void 0 ? D.value?.approvalPreset : i.approvalPreset)), Ke = o(() => O((e) => e.composer?.planMode, () => i.planMode ?? D.value?.planMode)), qe = o(() => O((e) => e.catalogs?.plugins, () => i.plugins ?? D.value?.plugins)), Je = o(() => O((e) => e.catalogs?.mentionGroups, () => i.mentionGroups)), Ye = o(() => It(i.presentation)), Xe = o(() => O((e) => e.thread?.queuedPrompts ?? [], () => i.queuedPrompts ?? D.value?.queuedPrompts ?? [])), Ze = o(() => O((e) => e.composer?.selectedModelId, () => i.selectedModelId === void 0 ? D.value?.selectedModelId : i.selectedModelId)), Qe = o(() => O((e) => e.composer?.selectedReasoningEffort, () => i.selectedReasoningEffort === void 0 ? D.value?.selectedReasoningEffort : i.selectedReasoningEffort)), $e = o(() => O((e) => e.composer?.selectedServiceTier, () => i.selectedServiceTier === void 0 ? D.value?.selectedServiceTier : i.selectedServiceTier)), et = o(() => O((e) => e.catalogs?.skillCatalogStatus, () => i.skillCatalogStatus ?? D.value?.skillCatalogStatus)), tt = o(() => O((e) => e.catalogs?.skills, () => i.skills ?? D.value?.skills)), nt = o(() => O((e) => e.thread?.turnGitDiff, () => i.turnGitDiff === void 0 ? D.value?.turnGitDiff : i.turnGitDiff)), rt = o(() => O((e) => e.policy?.attachEnabled ?? !0, () => i.attachEnabled !== !1)), it = o(() => ({
8977
+ onInterrupt: _n
8978
+ }), Ne = o(() => O((e) => e.identity.conversationKey, () => i.conversationKey === void 0 ? D.value?.activeConversationId : i.conversationKey)), Pe = o(() => O((e) => e.thread?.contextUsage, () => i.contextUsage === void 0 ? D.value?.contextUsage : i.contextUsage)), Ie = o(() => O((e) => e.identity.disabled ?? !1, () => i.disabled ?? (D.value ? D.value.status !== "ready" : !1))), Le = o(() => K.value ?? O((e) => e.identity.error, () => i.error ?? D.value?.error ?? null) ?? null), Re = o(() => O((e) => e.thread?.goal ?? null, () => i.goal === void 0 ? D.value?.goal ?? null : i.goal)), ze = o(() => O((e) => e.history?.loading ?? !1, () => i.historyLoading ?? D.value?.historyLoading ?? !1)), Be = o(() => i.renderStrategy ?? (i.lazyMessages === !1 ? "eager" : "lazy")), Ve = o(() => O((e) => e.history?.hasOlder ?? !1, () => i.hasOlderHistory ?? D.value?.historyState?.hasOlder ?? !1)), He = o(() => O((e) => e.history?.loadingOlder ?? !1, () => i.loadingOlderHistory ?? D.value?.historyState?.loadingOlder ?? !1)), Ue = o(() => O((e) => e.catalogs?.modelCatalogStatus, () => i.modelCatalogStatus ?? D.value?.modelCatalogStatus)), We = o(() => O((e) => e.catalogs?.models, () => i.models ?? D.value?.models)), Ge = o(() => O((e) => e.composer?.approvalPreset, () => i.approvalPreset === void 0 ? D.value?.approvalPreset : i.approvalPreset)), Ke = o(() => O((e) => e.composer?.planMode, () => i.planMode ?? D.value?.planMode)), qe = o(() => O((e) => e.catalogs?.plugins, () => i.plugins ?? D.value?.plugins)), Je = o(() => O((e) => e.catalogs?.mentionGroups, () => i.mentionGroups)), Ye = o(() => It(i.presentation)), Xe = o(() => O((e) => e.thread?.queuedPrompts ?? [], () => i.queuedPrompts ?? D.value?.queuedPrompts ?? [])), Ze = o(() => O((e) => e.composer?.selectedModelId, () => i.selectedModelId === void 0 ? D.value?.selectedModelId : i.selectedModelId)), Qe = o(() => O((e) => e.composer?.selectedReasoningEffort, () => i.selectedReasoningEffort === void 0 ? D.value?.selectedReasoningEffort : i.selectedReasoningEffort)), $e = o(() => O((e) => e.composer?.selectedServiceTier, () => i.selectedServiceTier === void 0 ? D.value?.selectedServiceTier : i.selectedServiceTier)), et = o(() => O((e) => e.catalogs?.skillCatalogStatus, () => i.skillCatalogStatus ?? D.value?.skillCatalogStatus)), tt = o(() => O((e) => e.catalogs?.skills, () => i.skills ?? D.value?.skills)), nt = o(() => O((e) => e.thread?.turnGitDiff, () => i.turnGitDiff === void 0 ? D.value?.turnGitDiff : i.turnGitDiff)), rt = o(() => O((e) => e.policy?.attachEnabled ?? !0, () => i.attachEnabled !== !1)), it = o(() => ({
8963
8979
  ...Lt,
8964
8980
  ...w.value ? w.value.capabilities : i.capabilities,
8965
8981
  approvalPresets: w.value?.capabilities?.approvalPresets ?? (w.value ? Lt.approvalPresets : i.approvalPresets ?? D.value?.approvalPresets ?? i.capabilities?.approvalPresets) ?? Lt.approvalPresets
8966
- })), at = o(() => O((e) => e.catalogs?.commands ?? [], () => i.commands ?? Rt)), st = o(() => O((e) => e.catalogs?.files ?? [], () => i.files)), ct = o(() => O((e) => e.composer?.leadingMenuItems ?? [], () => i.leadingMenuItems)), lt = o(() => O((e) => e.composer?.menuItems ?? [], () => i.menuItems)), ut = o(() => O((e) => e.composer?.modelMenuItems ?? [], () => i.modelMenuItems)), dt = o(() => O((e) => e.composer?.placeholder, () => i.placeholder)), ft = o(() => O((e) => e.composer?.suggestedPrompt, () => i.suggestedPrompt)), pt = o(() => O((e) => e.composer?.followUpBehavior ?? "queue", () => i.followUpBehavior ?? "queue")), mt = o(() => O((e) => e.policy?.canDeleteTurn ?? !0, () => i.canDeleteTurn)), ht = o(() => O((e) => e.policy?.canEditTurn ?? !0, () => i.canEditTurn)), gt = o(() => O((e) => e.policy?.canForkTurn ?? !1, () => i.canForkTurn)), _t = o(() => O((e) => e.policy?.canRetryTurn ?? !0, () => i.canRetryTurn)), vt = o(() => O((e) => e.policy?.actionsDisabled ?? !1, () => i.actionsDisabled ?? !1)), yt = o(() => ke.value || O((e) => e.policy?.followUpsDisabled ?? !1, () => i.followUpsDisabled ?? !1)), bt = o(() => ze.value), xt = o(() => ue.value.length > 0 || ke.value || De.value.length > 0);
8967
- U(() => !!(Oe.value || we.value || Se.value), async (e, t) => {
8982
+ })), at = o(() => O((e) => e.catalogs?.commands ?? [], () => i.commands ?? Rt)), st = o(() => O((e) => e.catalogs?.files ?? [], () => i.files)), ct = o(() => O((e) => e.composer?.leadingMenuItems ?? [], () => i.leadingMenuItems)), lt = o(() => O((e) => e.composer?.menuItems ?? [], () => i.menuItems)), ut = o(() => O((e) => e.composer?.modelMenuItems ?? [], () => i.modelMenuItems)), dt = o(() => O((e) => e.composer?.placeholder, () => i.placeholder)), ft = o(() => O((e) => e.composer?.suggestedPrompt, () => i.suggestedPrompt)), pt = o(() => O((e) => e.composer?.followUpBehavior ?? "queue", () => i.followUpBehavior ?? "queue")), mt = o(() => O((e) => e.policy?.canDeleteTurn ?? !0, () => i.canDeleteTurn)), ht = o(() => O((e) => e.policy?.canEditTurn ?? !0, () => i.canEditTurn)), gt = o(() => O((e) => e.policy?.canForkTurn ?? !1, () => i.canForkTurn)), _t = o(() => O((e) => e.policy?.canRetryTurn ?? !0, () => i.canRetryTurn)), vt = o(() => O((e) => e.policy?.actionsDisabled ?? !1, () => i.actionsDisabled ?? !1)), yt = o(() => ke.value || O((e) => e.policy?.followUpsDisabled ?? !1, () => i.followUpsDisabled ?? !1)), bt = o(() => ze.value), xt = o(() => le.value.length > 0 || ke.value || De.value.length > 0);
8983
+ W(() => !!(Oe.value || we.value || Se.value), async (e, t) => {
8968
8984
  if (e || !t) return;
8969
8985
  let n = document.activeElement;
8970
8986
  if (!n || !y.value?.contains(n)) return;
8971
8987
  let r = Ne.value;
8972
8988
  await C(), Ne.value === r && (document.activeElement === n || document.activeElement === document.body) && v.value?.focus({ preserveSelection: !0 });
8973
- }), U(() => i.modelValue, () => {
8989
+ }), W(() => i.modelValue, () => {
8974
8990
  S.value || i.composerState || i.modelValue !== L.value && (L.value = i.modelValue, I.value = {
8975
8991
  text: i.modelValue,
8976
8992
  selectionStart: i.modelValue.length,
8977
8993
  selectionEnd: i.modelValue.length
8978
8994
  });
8979
- }), U(j, (e) => {
8995
+ }), W(j, (e) => {
8980
8996
  if (!e) return;
8981
8997
  let t = pa(e);
8982
8998
  I.value = t, L.value = t.text;
8983
- }, { deep: !0 }), U(M, (e) => {
8984
- K.value = [...e];
8985
- }), U(rt, (e) => {
8986
- !e && K.value.length > 0 && Qt([]);
8987
- }), U(Ne, (e, t) => {
8999
+ }, { deep: !0 }), W(M, (e) => {
9000
+ q.value = [...e];
9001
+ }), W(rt, (e) => {
9002
+ !e && q.value.length > 0 && Qt([]);
9003
+ }), W(Ne, (e, t) => {
8988
9004
  h.value = null, g.value = /* @__PURE__ */ new Set();
8989
- let n = re.value;
8990
- n && (!n.hasAdoptedConversationKey && (t ?? null) === n.originConversationKey ? re.value = {
9005
+ let n = H.value;
9006
+ n && (!n.hasAdoptedConversationKey && (t ?? null) === n.originConversationKey ? H.value = {
8991
9007
  ...n,
8992
9008
  adoptedConversationKey: e ?? null,
8993
9009
  hasAdoptedConversationKey: !0
8994
- } : (e ?? null) !== n.originConversationKey && (e ?? null) !== n.adoptedConversationKey && (re.value = null)), ie += 1, B.value = null, Me(), R.value = null, G.value = null;
9010
+ } : (e ?? null) !== n.originConversationKey && (e ?? null) !== n.adoptedConversationKey && (H.value = null)), re += 1, B.value = null, Me(), R.value = null, K.value = null;
8995
9011
  let r = pa(j.value ?? (S.value ? {
8996
9012
  text: "",
8997
9013
  selectionStart: 0,
@@ -9002,51 +9018,51 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9002
9018
  selectionEnd: i.modelValue.length
9003
9019
  }));
9004
9020
  I.value = r, L.value = r.text;
9005
- }), U(le, (e) => {
9006
- let t = re.value;
9021
+ }), W(ce, (e) => {
9022
+ let t = H.value;
9007
9023
  if (t) {
9008
9024
  if (e.some((e) => kt(e, t))) {
9009
- re.value = null;
9025
+ H.value = null;
9010
9026
  return;
9011
9027
  }
9012
- t.hasAdoptedConversationKey && e.length > 0 && (re.value = null);
9028
+ t.hasAdoptedConversationKey && e.length > 0 && (H.value = null);
9013
9029
  }
9014
- }), U([ue, fe], () => {
9030
+ }), W([le, de], () => {
9015
9031
  let e = B.value;
9016
- e && (fe.value?.some((t) => t.id === e) || ue.value.some((t) => Ba(t).turnId === e) || (ie += 1, B.value = null));
9017
- }), U(Xe, (e) => {
9032
+ e && (de.value?.some((t) => t.id === e) || le.value.some((t) => Ba(t).turnId === e) || (re += 1, B.value = null));
9033
+ }), W(Xe, (e) => {
9018
9034
  let t = R.value;
9019
9035
  t && !e.some((e) => e.id === t) && (R.value = null);
9020
- }), U([
9036
+ }), W([
9021
9037
  Ne,
9022
9038
  () => D.value?.activeConversationId,
9023
9039
  () => E.value?.readPromptHistory,
9024
- pe
9040
+ fe
9025
9041
  ], () => {
9026
9042
  St();
9027
- }, { immediate: !0 }), U(() => [D.value?.status, D.value?.error], ([e, t]) => {
9028
- e === "ready" && t == null && (G.value = null);
9043
+ }, { immediate: !0 }), W(() => [D.value?.status, D.value?.error], ([e, t]) => {
9044
+ e === "ready" && t == null && (K.value = null);
9029
9045
  }), ee(() => {
9030
9046
  i.surface && i.surface.state.status === "idle" && Q(() => i.surface.connect());
9031
9047
  });
9032
9048
  async function St() {
9033
- let e = ++ce, t = Ne.value;
9034
- if (se.value = !1, ae.value = [], t == null || pe.value !== void 0) return;
9035
- let n = q.get(t);
9049
+ let e = ++se, t = Ne.value;
9050
+ if (oe.value = !1, ie.value = [], t == null || fe.value !== void 0) return;
9051
+ let n = J.get(t);
9036
9052
  if (n) {
9037
- ae.value = n;
9053
+ ie.value = n;
9038
9054
  return;
9039
9055
  }
9040
9056
  let r = E.value?.readPromptHistory, a = i.surface, o = D.value?.activeConversationId;
9041
9057
  if (!(!r && !o)) {
9042
- se.value = !0;
9058
+ oe.value = !0;
9043
9059
  try {
9044
9060
  let n = r ? await r() : (await a.readConversationPromptHistory(o)).prompts;
9045
- if (e !== ce || Ne.value !== t) return;
9061
+ if (e !== se || Ne.value !== t) return;
9046
9062
  let i = [...n].slice(-100);
9047
- q.set(t, i), ae.value = i;
9063
+ J.set(t, i), ie.value = i;
9048
9064
  } catch {} finally {
9049
- e === ce && (se.value = !1);
9065
+ e === se && (oe.value = !1);
9050
9066
  }
9051
9067
  }
9052
9068
  }
@@ -9063,14 +9079,14 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9063
9079
  en("");
9064
9080
  let n = R.value;
9065
9081
  if (n) {
9066
- R.value = null, mn(n, e, t), Qt([]);
9082
+ R.value = null, hn(n, e, t), Qt([]);
9067
9083
  return;
9068
9084
  }
9069
- let r = $t(K.value, t), o = Tt();
9085
+ let r = $t(q.value, t), o = Tt();
9070
9086
  if (b.value?.scrollToBottom(), C(() => b.value?.scrollToBottom()), S.value) {
9071
9087
  let t = E.value?.submit;
9072
9088
  if (t) {
9073
- let n = Ot(e, K.value, r?.content);
9089
+ let n = Ot(e, q.value, r?.content);
9074
9090
  Q(() => Promise.resolve(t(e, r)), () => {
9075
9091
  At(n), g.value = o;
9076
9092
  });
@@ -9084,10 +9100,10 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9084
9100
  }
9085
9101
  function Tt() {
9086
9102
  let e = g.value;
9087
- return g.value = /* @__PURE__ */ new Set([...e, ...X.value.filter((e) => e.payload.request.delivery === "async").map((e) => e.id)]), h.value = null, e;
9103
+ return g.value = /* @__PURE__ */ new Set([...e, ...be.value.filter((e) => e.payload.request.delivery === "async").map((e) => e.id)]), h.value = null, e;
9088
9104
  }
9089
9105
  function Et(e) {
9090
- if (!X.value.some((t) => t.id === e)) return;
9106
+ if (!be.value.some((t) => t.id === e)) return;
9091
9107
  let t = {
9092
9108
  id: e,
9093
9109
  payload: {
@@ -9095,15 +9111,15 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9095
9111
  cancelled: !0
9096
9112
  }
9097
9113
  };
9098
- p.set(e, t.payload), g.value = /* @__PURE__ */ new Set([...g.value, e]), h.value = null, rn(t);
9114
+ p.set(e, t.payload), g.value = /* @__PURE__ */ new Set([...g.value, e]), h.value = null, an(t);
9099
9115
  }
9100
9116
  function Dt() {
9101
9117
  Z("continueInterruptedTurn") || S.value || (a("continueInterruptedTurn"), i.surface && Q(() => i.surface.continueInterruptedTurn()));
9102
9118
  }
9103
9119
  function Ot(e, t, n) {
9104
- if (ke.value || le.value.length > 0) return null;
9105
- let r = `codex-optimistic-user-${++H}`;
9106
- return re.value = {
9120
+ if (ke.value || ce.value.length > 0) return null;
9121
+ let r = `codex-optimistic-user-${++U}`;
9122
+ return H.value = {
9107
9123
  adoptedConversationKey: null,
9108
9124
  hasAdoptedConversationKey: !1,
9109
9125
  originConversationKey: Ne.value ?? null,
@@ -9134,7 +9150,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9134
9150
  return n.role === "user" && go(n.content) === t.prompt;
9135
9151
  }
9136
9152
  function At(e) {
9137
- e && re.value?.message.id === e && (re.value = null);
9153
+ e && H.value?.message.id === e && (H.value = null);
9138
9154
  }
9139
9155
  function jt(e) {
9140
9156
  if (!Z("loadTurnHistory", e) && !S.value) {
@@ -9155,7 +9171,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9155
9171
  }
9156
9172
  }
9157
9173
  function Nt(e) {
9158
- let t = ue.value[e];
9174
+ let t = le.value[e];
9159
9175
  if (!t) return;
9160
9176
  let n = Ba(t), r = go(n.content);
9161
9177
  n.role !== "user" || !r || (en(r), !Z("quoteMessage", e) && (S.value || a("quoteMessage", e)));
@@ -9165,7 +9181,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9165
9181
  let e = zt(at.value, it.value.goals).find((e) => (e.slashName ?? e.name) === "goal" && e.composerMode);
9166
9182
  if (!e) return;
9167
9183
  let t = Re.value.objective;
9168
- tn({
9184
+ nn({
9169
9185
  text: t,
9170
9186
  selectionStart: t.length,
9171
9187
  selectionEnd: t.length,
@@ -9184,30 +9200,30 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9184
9200
  function Bt(e) {
9185
9201
  if (!Z("openLink", e) && !S.value) {
9186
9202
  if (a("openLink", e), i.openConversationLink) {
9187
- Promise.resolve(i.openConversationLink(e)).catch(En);
9203
+ Promise.resolve(i.openConversationLink(e)).catch($);
9188
9204
  return;
9189
9205
  }
9190
- e.kind === "external" && (f ? f.openExternal(e.href).catch(En) : window.open(e.href, "_blank", "noopener,noreferrer"));
9206
+ e.kind === "external" && (f ? f.openExternal(e.href).catch($) : window.open(e.href, "_blank", "noopener,noreferrer"));
9191
9207
  }
9192
9208
  }
9193
9209
  function Ht(e) {
9194
- Z("openVisualization", e) || S.value || (a("openVisualization", e), i.openVisualization && Promise.resolve(i.openVisualization(e)).catch(En));
9210
+ Z("openVisualization", e) || S.value || (a("openVisualization", e), i.openVisualization && Promise.resolve(i.openVisualization(e)).catch($));
9195
9211
  }
9196
9212
  async function Ut(e, t) {
9197
9213
  let n = S.value ? E.value?.openImage : i.openImage;
9198
9214
  if (!n) return !1;
9199
- G.value = null;
9215
+ K.value = null;
9200
9216
  try {
9201
9217
  return await n(e, t) !== !1;
9202
9218
  } catch (e) {
9203
- return En(e), !0;
9219
+ return $(e), !0;
9204
9220
  }
9205
9221
  }
9206
9222
  async function Wt() {
9207
9223
  if (!Z("attach") && (S.value || a("attach"), rt.value)) try {
9208
9224
  Xt(await aa(i.pickAttachments, f));
9209
9225
  } catch (e) {
9210
- En(e);
9226
+ $(e);
9211
9227
  }
9212
9228
  }
9213
9229
  function Gt(e) {
@@ -9232,19 +9248,19 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9232
9248
  try {
9233
9249
  Xt(await oa(e, i.ingestAttachments, f));
9234
9250
  } catch (e) {
9235
- En(e);
9251
+ $(e);
9236
9252
  }
9237
9253
  }
9238
9254
  function Xt(e) {
9239
- let t = new Map(K.value.map((e) => [e.reference, e]));
9255
+ let t = new Map(q.value.map((e) => [e.reference, e]));
9240
9256
  for (let n of e) t.set(n.reference, n);
9241
9257
  Qt([...t.values()].slice(0, 20));
9242
9258
  }
9243
9259
  function Zt(e) {
9244
- Qt(K.value.filter((t) => t.id !== e));
9260
+ Qt(q.value.filter((t) => t.id !== e));
9245
9261
  }
9246
9262
  function Qt(e) {
9247
- K.value = e, !Z("updateAttachments", e) && (S.value || a("attachmentsChange", e));
9263
+ q.value = e, !Z("updateAttachments", e) && (S.value || a("attachmentsChange", e));
9248
9264
  }
9249
9265
  function $t(e, t) {
9250
9266
  if (e.length === 0) return t;
@@ -9261,39 +9277,44 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9261
9277
  };
9262
9278
  }
9263
9279
  function en(e) {
9264
- tn({
9280
+ nn({
9265
9281
  text: e,
9266
9282
  selectionStart: e.length,
9267
9283
  selectionEnd: e.length
9268
9284
  });
9269
9285
  }
9270
- function tn(e) {
9286
+ async function tn() {
9287
+ if (Z("requestSkills") || S.value || !i.surface?.listSkills) return;
9288
+ let e = i.surface.state, t = e.conversations.find((t) => t.id === e.activeConversationId)?.cwd;
9289
+ await Q(() => i.surface.listSkills(t ? { cwd: t } : {}));
9290
+ }
9291
+ function nn(e) {
9271
9292
  let t = pa(e);
9272
9293
  I.value = t, L.value = t.text, !Z("updateComposerState", t) && (S.value || (a("update:modelValue", t.text), a("update:composerState", t)));
9273
9294
  }
9274
- function nn() {
9295
+ function rn() {
9275
9296
  Z("cancel") || S.value || (a("cancel"), i.surface && Q(() => i.surface.interrupt()));
9276
9297
  }
9277
- function rn(e) {
9298
+ function an(e) {
9278
9299
  Z("clientResponse", e) || S.value || (a("clientResponse", e), i.surface && Q(() => i.surface.respondToClientRequest(e)));
9279
9300
  }
9280
- function an(e) {
9301
+ function on(e) {
9281
9302
  Z("onMessageCopied", e) || S.value || a("copyMessage", e);
9282
9303
  }
9283
- async function on(e) {
9304
+ async function sn(e) {
9284
9305
  if (B.value !== null) return;
9285
9306
  let t = E.value?.deleteTurn;
9286
9307
  if (S.value && !t) return;
9287
- let n = ++ie, r = !1;
9308
+ let n = ++re, r = !1;
9288
9309
  B.value = e;
9289
9310
  try {
9290
9311
  if (t) {
9291
- G.value = null;
9312
+ K.value = null;
9292
9313
  let n;
9293
9314
  try {
9294
9315
  n = t(e);
9295
9316
  } catch (e) {
9296
- En(e);
9317
+ $(e);
9297
9318
  return;
9298
9319
  }
9299
9320
  if (n === void 0) {
@@ -9305,65 +9326,65 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9305
9326
  }
9306
9327
  a("deleteTurn", e), i.surface && await Q(() => i.surface.deleteTurn(e));
9307
9328
  } finally {
9308
- !r && ie === n && (B.value = null);
9329
+ !r && re === n && (B.value = null);
9309
9330
  }
9310
9331
  }
9311
- function sn(e) {
9332
+ function cn(e) {
9312
9333
  Z("editTurn", e) || S.value || (a("editTurn", e), i.surface && Q(() => i.surface.editTurn(e.turnId, e.content, e.options)));
9313
9334
  }
9314
- function cn(e) {
9335
+ function ln(e) {
9315
9336
  Z("forkTurn", e) || S.value || (a("forkTurn", e), i.surface && Q(() => i.surface.forkTurn(e)));
9316
9337
  }
9317
- function ln(e) {
9338
+ function un(e) {
9318
9339
  Z("retryTurn", e) || S.value || (a("retryTurn", e), i.surface && Q(() => i.surface.retryTurn(e)));
9319
9340
  }
9320
- function un(e) {
9341
+ function dn(e) {
9321
9342
  Z("sendFollowUp", e) || S.value || (a("sendFollowUp", e), i.surface && Q(() => i.surface.sendMessage(e)));
9322
9343
  }
9323
- function dn() {
9344
+ function fn() {
9324
9345
  Z("clearGoal") || S.value || (a("clearGoal"), i.surface && Q(() => i.surface.clearGoal()));
9325
9346
  }
9326
- function fn(e) {
9347
+ function pn(e) {
9327
9348
  R.value === e && (R.value = null), !Z("deleteQueuedPrompt", e) && (S.value || (a("deleteQueuedPrompt", e), i.surface && Q(() => i.surface.deleteQueuedPrompt(e))));
9328
9349
  }
9329
- function pn(e) {
9350
+ function mn(e) {
9330
9351
  if (L.value.length > 0) return;
9331
9352
  let t = Xe.value.find((t) => t.id === e);
9332
- t && (R.value = e, tn({
9353
+ t && (R.value = e, nn({
9333
9354
  text: t.text,
9334
9355
  content: t.options?.content,
9335
9356
  selectionStart: t.text.length,
9336
9357
  selectionEnd: t.text.length
9337
9358
  }), v.value?.focus());
9338
9359
  }
9339
- function mn(e, t, n) {
9360
+ function hn(e, t, n) {
9340
9361
  Z("updateQueuedPrompt", ...n ? [
9341
9362
  e,
9342
9363
  t,
9343
9364
  n
9344
9365
  ] : [e, t]) || S.value || (n ? a("updateQueuedPrompt", e, t, n) : a("updateQueuedPrompt", e, t), i.surface && Q(() => n ? i.surface.updateQueuedPrompt(e, t, n) : i.surface.updateQueuedPrompt(e, t)));
9345
9366
  }
9346
- function hn(e, t, n) {
9367
+ function gn(e, t, n) {
9347
9368
  it.value.steerPrompt && (R.value === e && (R.value = null), t === void 0 ? Z("steerQueuedPrompt", e) : Z("steerQueuedPrompt", ...n ? [
9348
9369
  e,
9349
9370
  t,
9350
9371
  n
9351
9372
  ] : [e, t]), !S.value && (t === void 0 ? a("steerQueuedPrompt", e) : n ? a("steerQueuedPrompt", e, t, n) : a("steerQueuedPrompt", e, t), i.surface && Q(() => t === void 0 ? i.surface.steerQueuedPrompt(e) : n ? i.surface.steerQueuedPrompt(e, t, n) : i.surface.steerQueuedPrompt(e, t))));
9352
9373
  }
9353
- function gn() {
9374
+ function _n() {
9354
9375
  Me(), !Z("interrupt") && (S.value || (a("interrupt"), i.surface && Q(() => i.surface.interrupt())));
9355
9376
  }
9356
- function _n(e, t) {
9377
+ function vn(e, t) {
9357
9378
  if (!it.value.steerPrompt) {
9358
9379
  wt(e, t);
9359
9380
  return;
9360
9381
  }
9361
9382
  let n = R.value;
9362
9383
  if (n) {
9363
- R.value = null, hn(n, e, t), Qt([]);
9384
+ R.value = null, gn(n, e, t), Qt([]);
9364
9385
  return;
9365
9386
  }
9366
- let r = $t(K.value, t);
9387
+ let r = $t(q.value, t);
9367
9388
  if (S.value) {
9368
9389
  let t = E.value?.steer;
9369
9390
  if (t) {
@@ -9380,7 +9401,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9380
9401
  g.value = o;
9381
9402
  }), Qt([]);
9382
9403
  }
9383
- function vn(e) {
9404
+ function yn(e) {
9384
9405
  if (!Z("selectApprovalPreset", e)) {
9385
9406
  if (S.value) {
9386
9407
  Z("updateSettings", { approvalPreset: e });
@@ -9389,25 +9410,25 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9389
9410
  a("selectApprovalPreset", e), i.surface && Q(() => i.surface.updateConversationSettings({ approvalPreset: e }));
9390
9411
  }
9391
9412
  }
9392
- function yn(e, t, n) {
9413
+ function bn(e, t, n) {
9393
9414
  Z("resolveApproval", e, t, n) || S.value || (a("resolveApproval", e, t, n), i.surface && Q(() => i.surface.resolveApproval(e, t, n)));
9394
9415
  }
9395
- function bn(e) {
9416
+ function xn(e) {
9396
9417
  Z("updateSettings", { modelId: e }) || S.value || (a("update:modelId", e), i.surface && Q(() => i.surface.updateConversationSettings({ modelId: e })));
9397
9418
  }
9398
- function xn(e) {
9419
+ function Sn(e) {
9399
9420
  Z("updateSettings", { planMode: e }) || S.value || (a("update:planMode", e), i.surface && Q(() => i.surface.updateConversationSettings({ planMode: e })));
9400
9421
  }
9401
- function Sn(e) {
9422
+ function Cn(e) {
9402
9423
  Z("updateSettings", { reasoningEffort: e }) || S.value || (a("update:reasoningEffort", e), i.surface && Q(() => i.surface.updateConversationSettings({ reasoningEffort: e })));
9403
9424
  }
9404
- function Cn(e) {
9425
+ function wn(e) {
9405
9426
  Z("updateSettings", { serviceTier: e }) || S.value || (a("update:serviceTier", e), i.surface && Q(() => i.surface.updateConversationSettings({ serviceTier: e })));
9406
9427
  }
9407
- function wn(e) {
9428
+ function Tn(e) {
9408
9429
  Z("menuSelect", e) || S.value || a("menuSelect", e);
9409
9430
  }
9410
- function Tn(e, t) {
9431
+ function En(e, t) {
9411
9432
  Z("mentionSelect", e, t) || S.value || a("mentionSelect", e, t);
9412
9433
  }
9413
9434
  function Z(e, ...t) {
@@ -9415,23 +9436,23 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9415
9436
  return n ? (Q(() => Promise.resolve(n(...t))), !0) : !1;
9416
9437
  }
9417
9438
  async function Q(e, t) {
9418
- G.value = null;
9439
+ K.value = null;
9419
9440
  try {
9420
9441
  await e();
9421
9442
  } catch (e) {
9422
- t?.(), En(e);
9443
+ t?.(), $(e);
9423
9444
  }
9424
9445
  }
9425
- function En(e) {
9426
- G.value = e instanceof Error ? e.message : String(e);
9427
- }
9428
9446
  function $(e) {
9429
- G.value = e, a("error", e);
9447
+ K.value = e instanceof Error ? e.message : String(e);
9448
+ }
9449
+ function Dn(e) {
9450
+ K.value = e, a("error", e);
9430
9451
  }
9431
- function Dn() {
9452
+ function On() {
9432
9453
  v.value?.focus();
9433
9454
  }
9434
- return n({ focusComposer: Dn }), (n, r) => (k(), l("section", {
9455
+ return n({ focusComposer: On }), (n, r) => (k(), l("section", {
9435
9456
  ref_key: "paneElement",
9436
9457
  ref: x,
9437
9458
  class: "codex-chat-theme codex-conversation-pane",
@@ -9450,7 +9471,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9450
9471
  class: "codex-conversation-pane__layout",
9451
9472
  "scroll-mode": "child"
9452
9473
  }, {
9453
- footer: W(() => [u("footer", {
9474
+ footer: G(() => [u("footer", {
9454
9475
  ref_key: "footerElement",
9455
9476
  ref: y,
9456
9477
  class: "codex-conversation-pane__footer"
@@ -9458,18 +9479,18 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9458
9479
  key: Oe.value.id,
9459
9480
  approval: Oe.value,
9460
9481
  disabled: Ie.value,
9461
- onResolve: r[1] ||= (e, t) => yn(Oe.value.id, e, t)
9482
+ onResolve: r[1] ||= (e, t) => bn(Oe.value.id, e, t)
9462
9483
  }, null, 8, ["approval", "disabled"]))], !0)])) : we.value ? (k(), s(Fs, {
9463
9484
  key: we.value.id,
9464
9485
  class: "codex-conversation-pane__confirmation-composer",
9465
9486
  request: we.value,
9466
- onClientResponse: rn
9487
+ onClientResponse: an
9467
9488
  }, null, 8, ["request"])) : Se.value ? (k(), s(Ms, {
9468
9489
  key: Se.value.id,
9469
9490
  class: "codex-conversation-pane__question-composer",
9470
- "answered-client-request-ids": _e.value,
9491
+ "answered-client-request-ids": ge.value,
9471
9492
  request: Se.value,
9472
- onClientResponse: rn
9493
+ onClientResponse: an
9473
9494
  }, null, 8, ["answered-client-request-ids", "request"])) : (k(), l(t, { key: 4 }, [
9474
9495
  F(n.$slots, "before-composer", {}, void 0, !0),
9475
9496
  m(sc, {
@@ -9481,18 +9502,18 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9481
9502
  "queued-prompt-edit-disabled": L.value.length > 0,
9482
9503
  "queued-prompt-steer-disabled": !it.value.steerPrompt,
9483
9504
  "turn-git-diff": nt.value,
9484
- onClearGoal: dn,
9485
- onDeleteQueuedPrompt: fn,
9486
- onEditQueuedPrompt: pn,
9505
+ onClearGoal: fn,
9506
+ onDeleteQueuedPrompt: pn,
9507
+ onEditQueuedPrompt: mn,
9487
9508
  onEditGoal: Pt,
9488
- onSteerQueuedPrompt: hn
9509
+ onSteerQueuedPrompt: gn
9489
9510
  }, d({ _: 2 }, [n.$slots["composer-drawers"] ? {
9490
9511
  name: "drawers",
9491
- fn: W((e) => [F(n.$slots, "composer-drawers", T(_(e)), void 0, !0)]),
9512
+ fn: G((e) => [F(n.$slots, "composer-drawers", T(_(e)), void 0, !0)]),
9492
9513
  key: "0"
9493
9514
  } : void 0, n.$slots["composer-shelf-actions"] ? {
9494
9515
  name: "actions",
9495
- fn: W((e) => [F(n.$slots, "composer-shelf-actions", T(_(e)), void 0, !0)]),
9516
+ fn: G((e) => [F(n.$slots, "composer-shelf-actions", T(_(e)), void 0, !0)]),
9496
9517
  key: "1"
9497
9518
  } : void 0]), 1032, [
9498
9519
  "disabled",
@@ -9511,7 +9532,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9511
9532
  autofocus: e.autofocus,
9512
9533
  "attach-enabled": rt.value,
9513
9534
  capabilities: it.value,
9514
- "can-continue-interrupted-turn": J.value,
9535
+ "can-continue-interrupted-turn": Y.value,
9515
9536
  commands: at.value,
9516
9537
  "composer-state": I.value,
9517
9538
  "context-usage": Pe.value,
@@ -9520,12 +9541,12 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9520
9541
  "empty-send-prompt": e.emptySendPrompt,
9521
9542
  "follow-up-behavior": pt.value,
9522
9543
  files: st.value,
9523
- "has-attachments": K.value.length > 0,
9544
+ "has-attachments": q.value.length > 0,
9524
9545
  "has-external-content": e.hasComposerContext,
9525
9546
  "interrupt-armed": V(je),
9526
9547
  plugins: qe.value,
9527
- "prompt-history": me.value,
9528
- "prompt-history-loading": se.value,
9548
+ "prompt-history": pe.value,
9549
+ "prompt-history-loading": oe.value,
9529
9550
  "queued-prompt-id": Xe.value[0]?.id ?? null,
9530
9551
  "is-sending": ke.value,
9531
9552
  "leading-menu-items": ct.value,
@@ -9545,27 +9566,28 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9545
9566
  "skill-catalog-status": et.value,
9546
9567
  skills: tt.value,
9547
9568
  "transcribe-audio": e.transcribeAudio,
9548
- onError: $,
9569
+ onError: Dn,
9549
9570
  onAttach: Wt,
9550
9571
  onContinueInterruptedTurn: Dt,
9551
- onInterrupt: gn,
9552
- onMenuSelect: wn,
9553
- onMentionSelect: Tn,
9554
- onSelectApprovalPreset: vn,
9572
+ onInterrupt: _n,
9573
+ onMenuSelect: Tn,
9574
+ onMentionSelect: En,
9575
+ onRequestSkills: tn,
9576
+ onSelectApprovalPreset: yn,
9555
9577
  onSend: wt,
9556
- onSteer: _n,
9557
- onSteerQueuedPrompt: hn,
9558
- "onUpdate:modelId": bn,
9559
- "onUpdate:composerState": tn,
9560
- "onUpdate:planMode": xn,
9561
- "onUpdate:reasoningEffort": Sn,
9562
- "onUpdate:serviceTier": Cn
9578
+ onSteer: vn,
9579
+ onSteerQueuedPrompt: gn,
9580
+ "onUpdate:modelId": xn,
9581
+ "onUpdate:composerState": nn,
9582
+ "onUpdate:planMode": Sn,
9583
+ "onUpdate:reasoningEffort": Cn,
9584
+ "onUpdate:serviceTier": wn
9563
9585
  }, d({
9564
- "before-meta": W(() => [X.value.length > 0 ? (k(), l("span", mf, [u("button", {
9586
+ "before-meta": G(() => [be.value.length > 0 ? (k(), l("span", mf, [u("button", {
9565
9587
  class: "codex-conversation-pane__pending-question-cancel",
9566
9588
  type: "button",
9567
9589
  "aria-label": "Cancel pending question",
9568
- onClick: r[2] ||= (e) => Et(X.value[0].id)
9590
+ onClick: r[2] ||= (e) => Et(be.value[0].id)
9569
9591
  }, [m(V(Fe), {
9570
9592
  class: "codex-conversation-pane__pending-question-icon",
9571
9593
  "aria-hidden": "true"
@@ -9575,10 +9597,10 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9575
9597
  })]), u("button", {
9576
9598
  class: "codex-conversation-pane__pending-question-open",
9577
9599
  type: "button",
9578
- "aria-label": X.value.length === 1 ? "Pending question" : `${X.value.length} pending questions`,
9579
- onClick: r[3] ||= (e) => h.value = X.value[0].id
9580
- }, z(X.value.length === 1 ? "Pending question" : `${X.value.length} pending questions`), 9, hf)])) : c("", !0)]),
9581
- before: W(() => [K.value.length > 0 ? (k(), l("div", gf, [(k(!0), l(t, null, P(K.value, (e, t) => (k(), l("div", {
9600
+ "aria-label": be.value.length === 1 ? "Pending question" : `${be.value.length} pending questions`,
9601
+ onClick: r[3] ||= (e) => h.value = be.value[0].id
9602
+ }, z(be.value.length === 1 ? "Pending question" : `${be.value.length} pending questions`), 9, hf)])) : c("", !0)]),
9603
+ before: G(() => [q.value.length > 0 ? (k(), l("div", gf, [(k(!0), l(t, null, P(q.value, (e, t) => (k(), l("div", {
9582
9604
  key: e.id,
9583
9605
  class: "codex-conversation-pane__attachment"
9584
9606
  }, [
@@ -9593,7 +9615,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9593
9615
  title: e.name
9594
9616
  }, z(e.name), 9, yf),
9595
9617
  u("span", bf, [F(n.$slots, "composer-attachment-actions", {
9596
- attachments: K.value,
9618
+ attachments: q.value,
9597
9619
  index: t,
9598
9620
  disabled: Ie.value
9599
9621
  }, void 0, !0), u("button", {
@@ -9608,46 +9630,46 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9608
9630
  }, [
9609
9631
  n.$slots["menu-icon"] ? {
9610
9632
  name: "menu-icon",
9611
- fn: W((e) => [F(n.$slots, "menu-icon", T(_(e)), void 0, !0)]),
9633
+ fn: G((e) => [F(n.$slots, "menu-icon", T(_(e)), void 0, !0)]),
9612
9634
  key: "0"
9613
9635
  } : void 0,
9614
9636
  n.$slots["menu-item"] ? {
9615
9637
  name: "menu-item",
9616
- fn: W((e) => [F(n.$slots, "menu-item", T(_(e)), void 0, !0)]),
9638
+ fn: G((e) => [F(n.$slots, "menu-item", T(_(e)), void 0, !0)]),
9617
9639
  key: "1"
9618
9640
  } : void 0,
9619
9641
  n.$slots["suggestion-item"] ? {
9620
9642
  name: "suggestion-item",
9621
- fn: W((e) => [F(n.$slots, "suggestion-item", T(_(e)), void 0, !0)]),
9643
+ fn: G((e) => [F(n.$slots, "suggestion-item", T(_(e)), void 0, !0)]),
9622
9644
  key: "2"
9623
9645
  } : void 0,
9624
9646
  n.$slots.mention ? {
9625
9647
  name: "mention",
9626
- fn: W((e) => [F(n.$slots, "mention", T(_(e)), void 0, !0)]),
9648
+ fn: G((e) => [F(n.$slots, "mention", T(_(e)), void 0, !0)]),
9627
9649
  key: "3"
9628
9650
  } : void 0,
9629
9651
  n.$slots["composer-after-input"] ? {
9630
9652
  name: "after-input",
9631
- fn: W(() => [F(n.$slots, "composer-after-input", {}, void 0, !0)]),
9653
+ fn: G(() => [F(n.$slots, "composer-after-input", {}, void 0, !0)]),
9632
9654
  key: "4"
9633
9655
  } : void 0,
9634
9656
  n.$slots["composer-after"] ? {
9635
9657
  name: "after",
9636
- fn: W(() => [F(n.$slots, "composer-after", {}, void 0, !0)]),
9658
+ fn: G(() => [F(n.$slots, "composer-after", {}, void 0, !0)]),
9637
9659
  key: "5"
9638
9660
  } : void 0
9639
9661
  ]), 1032, /* @__PURE__ */ "autofocus.attach-enabled.capabilities.can-continue-interrupted-turn.commands.composer-state.context-usage.disabled.draft.empty-send-prompt.follow-up-behavior.files.has-attachments.has-external-content.interrupt-armed.plugins.prompt-history.prompt-history-loading.queued-prompt-id.is-sending.leading-menu-items.menu-items.model-menu-items.mention-groups.model-catalog-status.models.placeholder.suggested-prompt.approval-preset.plan-mode.presentation.selected-model-id.selected-reasoning-effort.selected-service-tier.skill-catalog-status.skills.transcribe-audio".split("."))),
9640
9662
  F(n.$slots, "after-composer", {}, void 0, !0)
9641
9663
  ], 64))], 512)]),
9642
- default: W(() => [xt.value ? (k(), s(V(nf), {
9664
+ default: G(() => [xt.value ? (k(), s(V(nf), {
9643
9665
  key: 0,
9644
9666
  "source-slots": n.$slots,
9645
9667
  ref_key: "messageList",
9646
9668
  ref: b,
9647
9669
  class: "codex-conversation-pane__messages",
9648
9670
  "actions-disabled": vt.value,
9649
- "active-turn-id": de.value,
9650
- "answered-client-request-ids": _e.value,
9671
+ "active-turn-id": ue.value,
9672
+ "answered-client-request-ids": ge.value,
9651
9673
  "aria-label": e.ariaLabel,
9652
9674
  busy: Ae.value,
9653
9675
  "can-delete-turn": mt.value,
@@ -9664,7 +9686,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9664
9686
  "initial-message-batch-size": e.initialMessageBatchSize,
9665
9687
  "message-batch-size": e.messageBatchSize,
9666
9688
  "message-text-selection": e.messageTextSelection,
9667
- messages: ue.value,
9689
+ messages: le.value,
9668
9690
  "mention-groups": Je.value,
9669
9691
  "open-image": Ut,
9670
9692
  plugins: qe.value,
@@ -9674,22 +9696,22 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9674
9696
  "show-tool-details": e.showToolDetails,
9675
9697
  skills: tt.value,
9676
9698
  "tool-visibility": e.toolVisibility,
9677
- "transform-message": be.value.size > 0 || Te.value.size > 0 ? Ee : e.transformMessage,
9678
- turns: fe.value,
9679
- onCancel: nn,
9680
- onClientResponse: rn,
9681
- onCopyMessage: an,
9682
- onDeleteTurn: on,
9683
- onEditTurn: sn,
9684
- onForkTurn: cn,
9699
+ "transform-message": ye.value.size > 0 || Te.value.size > 0 ? Ee : e.transformMessage,
9700
+ turns: de.value,
9701
+ onCancel: rn,
9702
+ onClientResponse: an,
9703
+ onCopyMessage: on,
9704
+ onDeleteTurn: sn,
9705
+ onEditTurn: cn,
9706
+ onForkTurn: ln,
9685
9707
  onLoadOlderMessages: Mt,
9686
9708
  onLoadTurnHistory: jt,
9687
9709
  onMessageTextSelectionChange: r[0] ||= (e) => a("messageTextSelectionChange", e),
9688
9710
  onOpenLink: Bt,
9689
9711
  onOpenVisualization: Ht,
9690
9712
  onQuoteMessage: Nt,
9691
- onRetryTurn: ln,
9692
- onSendFollowUp: un
9713
+ onRetryTurn: un,
9714
+ onSendFollowUp: dn
9693
9715
  }, null, 8, /* @__PURE__ */ "source-slots.actions-disabled.active-turn-id.answered-client-request-ids.aria-label.busy.can-delete-turn.can-edit-turn.can-fork-turn.can-retry-turn.deleting-turn-id.empty-label.follow-ups-disabled.has-older-messages.hidden-client-request-ids.render-strategy.loading-older-messages.initial-message-batch-size.message-batch-size.message-text-selection.messages.mention-groups.plugins.presentation.reset-key.scroll-to-bottom-label.show-tool-details.skills.tool-visibility.transform-message.turns".split("."))) : (k(), l("div", lf, [F(n.$slots, "empty", {
9694
9716
  title: e.emptyTitle,
9695
9717
  description: e.emptyDescription
@@ -9697,7 +9719,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9697
9719
  _: 3
9698
9720
  }))], 40, cf));
9699
9721
  }
9700
- }), [["__scopeId", "data-v-24cebe97"]]), Cf = {
9722
+ }), [["__scopeId", "data-v-d9f2dfde"]]), Cf = {
9701
9723
  class: "codex-conversation-sidebar",
9702
9724
  "aria-label": "Conversations"
9703
9725
  }, wf = { class: "codex-conversation-sidebar__header" }, Tf = { class: "codex-conversation-sidebar__brand" }, Ef = ["disabled"], Df = {
@@ -9787,7 +9809,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9787
9809
  emits: ["select"],
9788
9810
  setup(e) {
9789
9811
  let n = e, r = Pr(), i = N(null);
9790
- return U(() => [n.activeIndex, n.visibleFiles], async () => {
9812
+ return W(() => [n.activeIndex, n.visibleFiles], async () => {
9791
9813
  await C();
9792
9814
  let e = i.value?.querySelectorAll(".chat-composer-file-menu__item").item(n.activeIndex);
9793
9815
  typeof e?.scrollIntoView == "function" && e.scrollIntoView({ block: "nearest" });
@@ -9804,7 +9826,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9804
9826
  class: w(["chat-composer-file-menu__item", { "chat-composer-file-menu__item--active": r === e.activeIndex }]),
9805
9827
  role: "option",
9806
9828
  type: "button",
9807
- onMousedown: q((e) => n.$emit("select", t), ["prevent"])
9829
+ onMousedown: J((e) => n.$emit("select", t), ["prevent"])
9808
9830
  }, [
9809
9831
  m(V(De), {
9810
9832
  class: "chat-composer-file-menu__icon",
@@ -9828,7 +9850,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9828
9850
  emits: ["select"],
9829
9851
  setup(e) {
9830
9852
  let n = e, r = N(null);
9831
- return U(() => [n.activeIndex, n.visiblePlugins], async () => {
9853
+ return W(() => [n.activeIndex, n.visiblePlugins], async () => {
9832
9854
  await C();
9833
9855
  let e = r.value?.querySelectorAll(".chat-composer-plugin-menu__item").item(n.activeIndex);
9834
9856
  typeof e?.scrollIntoView == "function" && e.scrollIntoView({ block: "nearest" });
@@ -9845,7 +9867,7 @@ var kd = ["aria-busy", "aria-label"], Ad = ["title"], jd = ["title"], Md = /*#__
9845
9867
  class: w(["chat-composer-plugin-menu__item", { "chat-composer-plugin-menu__item--active": r === e.activeIndex }]),
9846
9868
  role: "option",
9847
9869
  type: "button",
9848
- onMousedown: q((e) => n.$emit("select", t), ["prevent"])
9870
+ onMousedown: J((e) => n.$emit("select", t), ["prevent"])
9849
9871
  }, [t.iconUrl ? (k(), l("img", {
9850
9872
  key: 0,
9851
9873
  class: "chat-composer-plugin-menu__icon chat-composer-plugin-menu__icon-image",
@@ -9933,6 +9955,7 @@ function Qf(e) {
9933
9955
  return o === t && s(n), n;
9934
9956
  }
9935
9957
  return {
9958
+ listSkills: (t) => e.listSkills ? e.listSkills(t) : Promise.reject(/* @__PURE__ */ Error("Skill discovery is unavailable")),
9936
9959
  state: M(t),
9937
9960
  lastEvent: M(i),
9938
9961
  answeredClientRequestIds: r,