@alwith/module-chat 0.1.21 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,6 +6,12 @@ Desktop and U share turn virtualization, Desktop's Markdown renderer, activity g
6
6
 
7
7
  ## Ownership
8
8
 
9
+ `async-question-card` renders controlled, nonmodal Codex questions with choices,
10
+ free text, submission and skip actions. Hosts retain unsent drafts by session and
11
+ question ID, send the reply through the original session, and derive accepted
12
+ answers from Codex messages. History and completed turns remain read-only; the
13
+ component does not own a conversation store or create permission requests.
14
+
9
15
  | Package owns | Application supplies |
10
16
  | --- | --- |
11
17
  | Message layout, Markdown, activity and tool presentation | Message projection, theme, translations, file/artifact opening and business-specific cards |
@@ -1,6 +1,6 @@
1
- import{jsx as n,jsxs as m,Fragment as W}from"react/jsx-runtime";import{cn as g}from"cn";import{BotIcon as le,CheckIcon as ue,CopyIcon as me}from"lucide-react";import{Fragment as pe,useEffect as b,useRef as T,useState as V}from"react";import{ActivityMarkdown as K,useActivityHost as L}from"../activity-host.js";import{formatModelName as z}from"../lib/model-name.js";import{describeToolUse as O}from"../lib/stream-style.js";import{useCodexDisclosureState as E}from"./disclosure-state.js";import{ImageViewActivity as fe,isImageView as D}from"./image-view-activity.js";import{CodexPlan as xe}from"./plan.js";function R(e,t){let[a,i]=V(()=>({key:e,mounted:t})),r=t||a.key===e&&a.mounted;if(a.key!==e||a.mounted!==r)i({key:e,mounted:r});return r}var U=new WeakMap,J=1;function v(e){if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return`${e.type}:${e.id}`;if(e.type==="thinking"&&e.id!==void 0)return`thinking:${e.id}`;let t=U.get(e);if(t!==void 0)return`${e.type}:${t}`;let a=J;return J+=1,U.set(e,a),`${e.type}:${a}`}function w(e){switch(e){case"pending":case"in_progress":return!0;case"completed":case"failed":case"cancelled":case"interrupted":return!1;default:throw Error(`Unknown ACP tool status: ${e}`)}}function H(e,t){let a=Math.max(0,Math.round(e/1000)),i=Math.floor(a/3600),r=Math.floor(a%3600/60),o=a%60;if(o>=60)r+=Math.floor(o/60),o%=60;if(r>=60)i+=Math.floor(r/60),r%=60;let d=Intl.DurationFormat;if(d)try{return new d(t,{style:"narrow"}).format({hours:i,minutes:r,seconds:i>0?0:o})}catch{}if(i>0)return r>0?`${i}h ${r}m`:`${i}h`;if(r>0)return o>0?`${r}m ${o}s`:`${r}m`;return`${o}s`}var he="M7.52925 3.7793C7.75652 3.55203 8.10803 3.52383 8.36616 3.69434L8.47065 3.7793L14.2207 9.5293C14.4804 9.789 14.4804 10.211 14.2207 10.4707L8.47065 16.2207C8.21095 16.4804 7.78895 16.4804 7.52925 16.2207C7.26955 15.961 7.26955 15.539 7.52925 15.2793L12.8085 10L7.52925 4.7207L7.44429 4.61621C7.27378 4.35808 7.30198 4.00657 7.52925 3.7793Z";function _({expanded:e,className:t}){return n("svg",{className:g("codex-activity-disclosure",e&&"codex-activity-disclosure-expanded",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:he})})}function ge(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.3965 5.01128C16.3963 4.93399 16.3489 4.87691 16.293 4.85406L16.2354 4.84332C13.9306 4.91764 12.5622 5.32101 10.665 6.34722V16.3716C11.3851 15.9994 12.0688 15.7115 12.7861 15.5015C13.8286 15.1965 14.9113 15.0633 16.2402 15.0435L16.2979 15.0308C16.353 15.0063 16.3965 14.9483 16.3965 14.8755V5.01128ZM3.54492 14.8765C3.54492 14.9725 3.62159 15.0422 3.70117 15.0435L4.19629 15.0562C5.94062 15.1247 7.26036 15.4201 8.65918 16.0484C8.05544 15.1706 7.14706 14.436 6.17871 14.1109V14.1099C5.56757 13.9045 5.16816 13.3314 5.16797 12.6988V4.98882C4.86679 4.93786 4.60268 4.8999 4.28223 4.87457L3.72754 4.84429C3.62093 4.84079 3.54505 4.92417 3.54492 5.01226V14.8765ZM17.7266 14.8755C17.7266 15.6314 17.1607 16.2751 16.4121 16.3628L16.2598 16.3736C15.0122 16.3922 14.0555 16.5159 13.1602 16.7779C12.2629 17.0404 11.3966 17.4508 10.3369 18.0738C10.129 18.1959 9.87099 18.1958 9.66309 18.0738C7.71455 16.9283 6.31974 16.4689 4.12988 16.3853L3.68164 16.3736C2.85966 16.3614 2.21484 15.6838 2.21484 14.8765V5.01226C2.21497 4.15391 2.93263 3.4871 3.77246 3.51519L4.39844 3.54937C4.67996 3.57191 4.92258 3.60421 5.16797 3.64214V2.51031C5.16797 1.44939 6.29018 0.645615 7.31055 1.15679L7.31152 1.15582C8.78675 1.89511 10.0656 3.33006 10.5352 4.91461C12.3595 3.98907 13.8688 3.58817 16.1924 3.51324L16.3506 3.51714C17.1285 3.5741 17.7264 4.23496 17.7266 5.01128V14.8755ZM6.49805 12.6988C6.49824 12.7723 6.5442 12.8296 6.60254 12.8492L6.96289 12.9859C7.85245 13.3586 8.68125 13.9846 9.33496 14.7496V5.5816C9.08794 4.37762 8.13648 3.1566 6.95801 2.47613L6.71582 2.34527C6.67779 2.32617 6.6337 2.32502 6.58301 2.35796C6.52946 2.39279 6.49805 2.44863 6.49805 2.51031V12.6988Z"})})}function Ce(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M7.33057 1.98535C10.2484 1.98535 12.6136 4.3508 12.6138 7.26855C12.6138 8.58031 12.1346 9.77942 11.3433 10.7031L13.9897 13.3496C14.1655 13.5253 14.1655 13.8106 13.9897 13.9863C13.814 14.1621 13.5288 14.1621 13.353 13.9863L10.7017 11.335C9.78678 12.0942 8.61243 12.5518 7.33057 12.5518C4.41281 12.5516 2.04736 10.1864 2.04736 7.26855C2.04754 4.35091 4.41292 1.98553 7.33057 1.98535ZM7.33057 2.88574C4.90998 2.88592 2.94793 4.84796 2.94775 7.26855C2.94775 9.68929 4.90987 11.6522 7.33057 11.6523C9.75141 11.6523 11.7144 9.6894 11.7144 7.26855C11.7142 4.84786 9.75131 2.88574 7.33057 2.88574Z"})})}function ye(){return m("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[n("path",{d:"M6.19629 7.86231C6.42357 7.63534 6.7752 7.60692 7.0332 7.77734L7.1377 7.86231L8.80371 9.5293C9.06329 9.78889 9.06307 10.21 8.80371 10.4697L7.1377 12.1367C6.878 12.3964 6.45599 12.3964 6.19629 12.1367C5.93686 11.8771 5.93697 11.456 6.19629 11.1963L7.39258 9.99902L6.19629 8.80371L6.11133 8.69922C5.94087 8.4411 5.96904 8.08955 6.19629 7.86231Z"}),n("path",{d:"M13.4668 11.0156C13.7699 11.0776 13.998 11.3456 13.998 11.667C13.9979 11.9883 13.7698 12.2564 13.4668 12.3184L13.333 12.332H10.833C10.466 12.3319 10.1682 12.034 10.168 11.667C10.168 11.2998 10.4659 11.0021 10.833 11.002H13.333L13.4668 11.0156Z"}),n("path",{d:"M12.6602 2.66504C13.3492 2.66504 13.9062 2.66439 14.3564 2.70117C14.8142 2.73859 15.2201 2.81796 15.5967 3.00977C16.1922 3.31321 16.677 3.79805 16.9805 4.39356C17.1722 4.77014 17.2517 5.17604 17.2891 5.63379C17.3258 6.08402 17.3252 6.64102 17.3252 7.33008V12.6602C17.3252 13.3492 17.3258 13.9062 17.2891 14.3564C17.2516 14.8142 17.1723 15.2201 16.9805 15.5967C16.677 16.1922 16.1922 16.677 15.5967 16.9805C15.2201 17.1723 14.8142 17.2516 14.3564 17.2891C13.9062 17.3258 13.3492 17.3252 12.6602 17.3252H7.33008C6.64102 17.3252 6.08402 17.3258 5.63379 17.2891C5.17604 17.2517 4.77014 17.1722 4.39356 16.9805C3.79805 16.677 3.31321 16.1922 3.00977 15.5967C2.81796 15.2201 2.73859 14.8142 2.70117 14.3564C2.66439 13.9062 2.66504 13.3492 2.66504 12.6602V7.33008C2.66504 6.64101 2.66439 6.08402 2.70117 5.63379C2.73858 5.17601 2.81797 4.77016 3.00977 4.39356C3.31321 3.79802 3.79802 3.31321 4.39356 3.00977C4.77016 2.81797 5.17601 2.73858 5.63379 2.70117C6.08402 2.66439 6.64101 2.66504 7.33008 2.66504H12.6602ZM7.33008 3.99512C6.61907 3.99512 6.1257 3.99601 5.74219 4.02734C5.3665 4.05804 5.15508 4.11481 4.99707 4.19531C4.65183 4.37124 4.37124 4.65183 4.19531 4.99707C4.11481 5.15508 4.05805 5.3665 4.02734 5.74219C3.99601 6.1257 3.99512 6.61908 3.99512 7.33008V12.6602C3.99512 13.3711 3.99601 13.8646 4.02734 14.248C4.05805 14.6237 4.11481 14.8352 4.19531 14.9932C4.37124 15.3384 4.65186 15.619 4.99707 15.7949C5.15507 15.8754 5.36654 15.9322 5.74219 15.9629C6.1257 15.9942 6.61908 15.9951 7.33008 15.9951H12.6602C13.3711 15.9951 13.8646 15.9942 14.248 15.9629C14.6237 15.9322 14.8352 15.8754 14.9932 15.7949C15.3384 15.619 15.619 15.3384 15.7949 14.9932C15.8754 14.8352 15.9322 14.6237 15.9629 14.248C15.9942 13.8646 15.9951 13.3711 15.9951 12.6602V7.33008C15.9951 6.61908 15.9942 6.1257 15.9629 5.74219C15.9322 5.36654 15.8754 5.15507 15.7949 4.99707C15.619 4.65186 15.3384 4.37124 14.9932 4.19531C14.8352 4.11481 14.6237 4.05805 14.248 4.02734C13.8646 3.99601 13.3711 3.99512 12.6602 3.99512H7.33008Z"})]})}function ve(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M11.3312 4.20472C12.7488 2.92391 14.9377 2.96644 16.3039 4.33265L16.4318 4.46742C17.6713 5.8393 17.6713 7.93343 16.4318 9.30531L16.3039 9.44007L10.0119 15.7311C9.68839 16.0546 9.45384 16.2917 9.22185 16.4821L8.98748 16.6588C8.78233 16.799 8.56429 16.9196 8.33709 17.0192L8.10759 17.1119C7.92582 17.1785 7.73843 17.2266 7.52166 17.2711L6.75701 17.4069L4.36345 17.8053C4.22059 17.8291 4.06914 17.8552 3.9406 17.8649C3.84183 17.8723 3.70833 17.875 3.56267 17.8395L3.41423 17.7907C3.19121 17.695 3.00747 17.5271 2.89177 17.316L2.84588 17.2223C2.75958 17.0209 2.76174 16.8276 2.77166 16.6959C2.78136 16.5674 2.80742 16.4159 2.83123 16.2731L3.22966 13.8795L3.36443 13.1149C3.40899 12.898 3.45795 12.7108 3.52459 12.5289L3.61736 12.2985C3.71691 12.0715 3.83772 11.854 3.97771 11.6491L4.15349 11.4147C4.34392 11.1825 4.58171 10.9484 4.90545 10.6246L11.1965 4.33265L11.3312 4.20472ZM5.84588 11.5651C5.49671 11.9142 5.31258 12.0998 5.1867 12.2526L5.07537 12.3991C4.98194 12.5358 4.90157 12.6812 4.83513 12.8327L4.77361 12.9869C4.73328 13.0971 4.70248 13.2125 4.66814 13.3815L4.54119 14.0983L4.14275 16.4918L4.14177 16.4938H4.1447L6.53826 16.0944L7.25505 15.9684C7.42406 15.9341 7.53946 15.9033 7.64959 15.8629L7.80291 15.8014C7.95461 15.7349 8.09953 15.6538 8.2365 15.5602L8.38396 15.4498C8.53674 15.3239 8.72231 15.1398 9.07146 14.7907L14.0588 9.80238L10.8332 6.57679L5.84588 11.5651ZM15.3635 5.27308C14.5281 4.43776 13.2058 4.38573 12.3097 5.11683L12.1369 5.27308L11.7736 5.63636L15.0002 8.86195L15.3635 8.49964L15.5197 8.32581C16.2015 7.48961 16.2015 6.28311 15.5197 5.44691L15.3635 5.27308Z"})})}function we(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.8347 7.91699C16.8347 7.76279 16.8266 7.61021 16.8123 7.45996L15.4705 8.80371C14.2903 9.98388 12.3762 9.98388 11.1961 8.80371C10.016 7.62352 10.0159 5.70942 11.1961 4.5293L12.5378 3.18652C12.3885 3.17238 12.237 3.16505 12.0837 3.16504C9.45947 3.16504 7.33179 5.29272 7.33179 7.91699C7.33184 8.56608 7.46162 9.18329 7.69605 9.74512C7.79981 9.9939 7.74311 10.2811 7.5525 10.4717L3.59547 14.4287C3.0498 14.9744 3.04991 15.8586 3.59547 16.4043L3.70191 16.501C4.25076 16.9483 5.05957 16.9158 5.57105 16.4043L9.52906 12.4473L9.60426 12.3828C9.79018 12.2455 10.0369 12.2131 10.2546 12.3037C10.8166 12.5382 11.4345 12.668 12.0837 12.668C14.7078 12.6678 16.8345 10.541 16.8347 7.91699ZM18.1648 7.91699C18.1646 11.2755 15.4423 13.9979 12.0837 13.998C11.4151 13.998 10.7708 13.8886 10.1677 13.6885L6.51246 17.3457C5.51389 18.3443 3.93332 18.406 2.86207 17.5322L2.65504 17.3457C1.58992 16.2806 1.58992 14.5534 2.65504 13.4883L6.31031 9.83203C6.1104 9.22921 6.00175 8.58526 6.00172 7.91699C6.00172 4.55818 8.72494 1.83496 12.0837 1.83496C12.7838 1.835 13.458 1.95316 14.0857 2.17188L14.1638 2.20508C14.3404 2.29325 14.4697 2.45713 14.5144 2.65234C14.5653 2.87533 14.4984 3.10876 14.3367 3.27051L12.1375 5.4707C11.4767 6.13148 11.4767 7.20251 12.1375 7.86328C12.7983 8.52373 13.8694 8.52395 14.53 7.86328L16.7293 5.66309L16.7937 5.60742C16.9499 5.48687 17.1532 5.44067 17.3484 5.48535C17.5714 5.53648 17.7526 5.69898 17.8279 5.91504C18.0466 6.54272 18.1648 7.21689 18.1648 7.91699Z"})})}function k({block:e}){if(e.type!=="tool_use")return null;let t=O(e).category;if(t==="read")return n(ge,{});if(t==="search"||t==="fetch")return n(Ce,{});if(t==="execute")return n(ye,{});if(t==="edit")return n(ve,{});return n(we,{})}function I(e,t){let a=e.rawInput[t];return typeof a==="string"&&a.length>0?a:void 0}function Le(e){return O(e).target}function G(e){return e.name.startsWith("mcp__")||e.name.startsWith("mcp_")}function ee(e,t){let{category:a}=O(e),i=Le(e),r=w(e.status);if(G(e))return{leading:e.title};if(a==="execute"){let o=I(e,"command")?.split(`
2
- `)[0]??i;return o?{leading:t(r?"stream.codex.running":"stream.codex.ran"),trailing:o}:{leading:t(r?"stream.codex.runningCommand":"stream.codex.ranCommandGeneric")}}if(a==="search"){let o=I(e,"pattern")??I(e,"query")??i;return o?{leading:t(r?"stream.codex.searching":"stream.codex.searched"),trailing:t("stream.codex.forDetail",{detail:o})}:{leading:t(r?"stream.codex.searchingFiles":"stream.codex.searchedFiles")}}if(a==="fetch"){let o=I(e,"query")??I(e,"url")??i;return o?{leading:t(r?"stream.codex.searchingWeb":"stream.codex.searchedWeb"),trailing:t("stream.codex.forDetail",{detail:o})}:{leading:t(r?"stream.codex.searchingWeb":"stream.codex.searchedWeb")}}if(a==="read")return i?{leading:t("stream.codex.readLabel"),trailing:i}:{leading:t("stream.codex.readFiles")};if(a==="edit")return i?{leading:t(r?"stream.codex.editingLabel":"stream.codex.editedLabel"),trailing:i}:{leading:t(r?"stream.codex.editingFiles":"stream.codex.editedFiles")};if(a==="delete")return i?{leading:t(r?"stream.codex.deletingLabel":"stream.codex.deletedLabel"),trailing:i}:{leading:t(r?"stream.codex.deletingFiles":"stream.codex.deletedFiles")};if(a==="move")return i?{leading:t(r?"stream.codex.movingLabel":"stream.codex.movedLabel"),trailing:i}:{leading:t(r?"stream.codex.movingFiles":"stream.codex.movedFiles")};return{leading:e.title}}function Ne(e,t){let a=ee(e,t);return a.trailing===void 0?a.leading:`${a.leading} ${a.trailing}`}function $e(e){return e.map((t)=>{if(t.type!=="content")return"";let a=t.content;return a.type==="text"?a.text:""}).filter(Boolean).join(`
3
- `).trim()}function Ae(e){return e.flatMap((t)=>{if(t.type!=="content")return[];let a=t.content;return a.type==="image"?[{data:a.data,mimeType:a.mimeType}]:[]})}function Me(e){return e.flatMap((t)=>{if(t.type!=="content")return[];let a=t.content;return a.type==="audio"?[{data:a.data,mimeType:a.mimeType}]:[]})}function Ie(e){if(typeof e==="string"&&e.length>0)return e;return}function be(e){return e.type==="diff"}function Te(e){let t=e.content.find(be);if(t===void 0)return;return t.changes.map((a)=>`${a.operation} ${a.path}`).join(`
4
- `)}function te(e){let t=Ie(e.rawOutput);if(t!==void 0)return t;let a=$e(e.content);if(a.length>0)return a;return Te(e)}function Ee({block:e,command:t}){let{t:a,Output:i,commandStatus:r}=L(),[o,d]=V(!1),[c,l]=V(!1),u=te(e),s=r===void 0?e.exitCode===void 0?void 0:a("stream.codex.exitCode",{code:e.exitCode}):r(e),f=()=>{navigator.clipboard.writeText([`$ ${t}`,u].filter((p)=>p!==void 0).join(`
5
- `)),d(!0),setTimeout(()=>d(!1),1500)};return n("div",{className:"codex-command-details",children:m("div",{className:"codex-command-card",children:[m("div",{className:"codex-command-line-row",children:[n("span",{className:"codex-command-prompt","aria-hidden":"true",children:"$"}),n("button",{type:"button",className:g("codex-command-line",!c&&"codex-command-line-clamped"),"data-codex-disclosure":"","aria-expanded":c,onClick:()=>l((p)=>!p),children:t}),n("button",{type:"button",className:"codex-command-copy","aria-label":a("actions.copy"),onClick:f,children:o?n(ue,{}):n(me,{})})]}),u!==void 0&&(i===void 0?n("pre",{className:"codex-command-output",children:u}):n(i,{text:u})),s!==void 0&&n("div",{className:"codex-command-footer",children:n("span",{className:"codex-command-status",children:s})})]})})}function ne({block:e}){let{t,openLink:a,Patch:i,openImage:r,commandStatus:o,expandToolOutput:d=!1}=L(),c=te(e),l=i===void 0?void 0:e.content.flatMap((x)=>{if(x.type!=="diff")return[];let M=x;return M.patch?.text?[M.patch.text]:[]}).join(`
6
- `),u=Ae(e.content),s=Me(e.content),[f,p]=E(`tool:${e.id}`,!1),N=R(`tool:${e.id}`,f),C=O(e),y=C.category,h=ee(e,t),S=y==="execute"?I(e,"command"):void 0,A=S!==void 0||G(e)||u.length>0||s.length>0||Boolean(l)||d&&c!==void 0,F=!A&&!w(e.status)?C.filePath:void 0;if(y==="execute"&&!w(e.status)&&e.status!=="completed"){let x=o?.(e);if(x)h={...h,leading:x}}if(y==="read"&&w(e.status))return null;let B=m("span",{className:"codex-activity-label",children:[n(k,{block:e}),n("span",{className:"min-w-0 flex-1 truncate",children:w(e.status)?n("span",{className:"codex-activity-running",children:h.trailing===void 0?h.leading:`${h.leading} ${h.trailing}`}):m(W,{children:[n("span",{className:"codex-activity-leading",children:h.leading}),h.trailing!==void 0&&(F!==void 0?m(W,{children:[" ",n("button",{type:"button",className:"codex-activity-trailing codex-activity-file-link",title:F,onClick:()=>a(F),children:h.trailing})]}):m("span",{className:"codex-activity-trailing",children:[" ",h.trailing]}))]})})]});return m("div",{className:"codex-activity-item",children:[A?m("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-label":h.trailing===void 0?h.leading:`${h.leading} ${h.trailing}`,"aria-expanded":f,onClick:()=>p((x)=>!x),children:[B,n(_,{expanded:f})]}):n("div",{className:"codex-activity-header codex-activity-header-static",children:B}),n("div",{className:g("codex-activity-details-grid",f&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:N&&m(W,{children:[S!==void 0?n(Ee,{block:e,command:S}):i!==void 0&&l?n(i,{patch:l}):c!==void 0&&n("pre",{className:"codex-activity-details",children:c}),u.length>0&&n("div",{className:"codex-activity-media",children:u.map((x)=>{let M=`data:${x.mimeType};base64,${x.data}`,q=n("img",{src:M,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},`${x.mimeType}:${x.data.slice(0,32)}`);return r===void 0?q:n("button",{type:"button",className:"cursor-pointer",onClick:()=>r(M),children:q},M)})}),s.map((x)=>n("audio",{className:"mt-1 w-full","aria-label":t("stream.codex.audioOutput"),controls:!0,src:`data:${x.mimeType};base64,${x.data}`},`${x.mimeType}:${x.data.slice(0,32)}`))]})})})]})}function ae({block:e}){if(e.type==="tool_use")return n(ne,{block:e});if(e.type==="thinking")return n(ce,{block:e});if(e.type==="collab")return n(de,{block:e});return n(ie,{block:e})}function ie({block:e}){let{t,openSession:a}=L(),i=w(e.status),[r,o]=E(`subagent:${e.id}`,i),d=T(i);b(()=>{if(i)o(!0);if(d.current&&!i)o(!1);d.current=i},[i,o]);let c=`${Be(e.activity,i,e.name,t)}${re(e.model,e.reasoningEffort,t)}`,l=e.threadId??"",u=e.blocks.length>0;return m("div",{className:"codex-activity-item",children:[m("button",{type:"button",className:g("codex-activity-header",!u&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":u?r:void 0,disabled:!u,onClick:()=>o((s)=>!s),children:[m("span",{className:"codex-activity-label",children:[n(Fe,{seed:e.threadId??e.id}),n("span",{className:"min-w-0 flex-1 truncate",children:a===void 0||e.threadId===null?i?n("span",{className:"codex-activity-running",children:c}):c:n("span",{role:"link",tabIndex:0,className:g("codex-agent-link",i&&"codex-activity-running"),"aria-label":t("stream.codex.subagentOpen",{name:e.name}),onClick:(s)=>{s.stopPropagation(),a(l,e.name)},onKeyDown:(s)=>{if(s.key!=="Enter"&&s.key!==" ")return;s.preventDefault(),s.stopPropagation(),a(l,e.name)},children:c})})]}),u&&n(_,{expanded:r})]}),n("div",{className:g("codex-activity-details-grid",r&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:e.blocks.map((s)=>{if(s.type==="tool_use")return n(ne,{block:s},s.id);if(s.type==="thinking")return n(ce,{block:s},v(s));if(s.type==="subagent")return n(ie,{block:s},s.id);if(s.type==="collab")return n(de,{block:s},s.id);if(s.type==="text")return n("div",{className:"codex-reasoning-details",children:n(K,{text:s.text,streaming:!1})},v(s));if(s.type==="plan")return n(xe,{entries:s.entries},v(s));if(s.type==="image")return n("img",{src:`data:${s.source.media_type};base64,${s.source.data}`,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},v(s));return null})})})})]})}var _e=8;function Se(e){let t=0;for(let a=0;a<e.length;a+=1)t=(t*31+e.charCodeAt(a))%2147483647;return t%_e}function Fe({seed:e}){return n("span",{className:"codex-agent-avatar","data-hue":Se(e),"aria-hidden":"true"})}function Be(e,t,a,i){switch(e){case"started":return i(t?"stream.codex.subagentWorking":"stream.codex.subagentFinished",{name:a});case"interacted":return i("stream.codex.subagentMessaged",{name:a});case"interrupted":return i("stream.codex.subagentInterrupted",{name:a});case"completed":return i("stream.codex.subagentFinished",{name:a})}}var De=new Set(["none","minimal","low","medium","high","xhigh","max","ultra","persistent"]);function re(e,t,a){if(e===null)return"";if(t===null)return` · ${z(e)}`;let i=De.has(t)?a(`stream.codex.reasoningEffort.${t}`):t;return` · ${z(e)} · ${i}`}var Ve={spawnAgent:"spawn",sendInput:"message",sendMessage:"message",followupTask:"message",interruptAgent:"interrupt",listAgents:"list",resumeAgent:"resume",closeAgent:"close"};function oe(e){switch(e){case"pending":case"in_progress":return"inProgress";case"completed":return"completed";case"failed":return"failed";case"cancelled":case"interrupted":return"interrupted";default:throw Error(`Unknown ACP tool status: ${e}`)}}function P(e,t,a){if(e.tool==="wait")throw Error("Codex does not present wait calls");let i=oe(e.status);if(i==="interrupted")return a("stream.codex.collab.interrupted");return a(`stream.codex.collab.${t}.${Ve[e.tool]}.${i}`)}function Oe(e){return e.agents.filter((t)=>t.nickname!==null)}function se(e,t){let a=e.agents.length>0?e.agents.length:1;return`${P(e,"header",t)}${t("stream.codex.collab.agentCount",{count:a})}`}var Z="\x01";function j(e,t,a,i){let r=Object.fromEntries(Object.keys(i).map((o)=>[o,`${Z}${o}${Z}`]));return e(t,{...a,...r}).split(new RegExp(`${Z}(\\w+)${Z}`,"u")).map((o,d)=>n(pe,{children:d%2===1?i[o]:o},`${d}:${o}`))}function Ze({agent:e,showModel:t}){let{t:a,openSession:i}=L(),r=e.nickname??"",o=i===void 0?n("span",{className:"font-medium",children:r}):n("button",{type:"button",className:"codex-agent-link font-medium","aria-label":a("stream.codex.subagentOpen",{name:r}),onClick:()=>i(e.threadId,r),children:r});return m("span",{children:[o,e.role!==null&&` (${e.role})`,t&&re(e.model,e.reasoningEffort,a)]})}function Q({prompt:e}){return n("span",{className:"codex-collab-prompt",title:e,children:e})}function je(e,t){let a=e.prompt?.trim()?e.prompt:null,i=oe(e.status),r=e.tool==="spawnAgent"&&i==="completed"&&a!==null,o=(e.tool==="sendInput"||e.tool==="sendMessage"||e.tool==="followupTask")&&a!==null,d=Oe(e),c=[];if(d.length===0)c.push({key:"generic",node:P(e,"row",t)});for(let l of d){let u=n(Ze,{agent:l,showModel:e.tool==="spawnAgent"});if(r)c.push({key:l.threadId,node:n("span",{className:"codex-collab-line",children:j(t,"stream.codex.collab.createdWithInstructions",{},{agent:u,instructions:n(Q,{prompt:a})})})});else if(o)c.push({key:l.threadId,node:n("span",{className:"codex-collab-line",children:j(t,"stream.codex.collab.messagedWithPrompt",{action:i==="interrupted"?t("stream.codex.collab.interrupted"):t(`stream.codex.collab.messaged.${i}`)},{agent:u,prompt:n(Q,{prompt:a})})})});else{let f=e.tool!=="closeAgent"&&e.tool!=="resumeAgent"&&l.state!==null&&l.state!==null?l.state.message?.trim()?t("stream.codex.collab.stateWithMessage",{state:t(`stream.codex.collab.state.${l.state.status}`),message:l.state.message}):t("stream.codex.collab.stateOnly",{state:t(`stream.codex.collab.state.${l.state.status}`)}):"";c.push({key:l.threadId,node:j(t,"stream.codex.collab.agentRow",{action:P(e,"row",t),state:f},{agent:u})})}}if(!r&&!o&&a!==null)c.push({key:"input",node:j(t,"stream.codex.collab.input",{},{prompt:n("span",{className:"codex-collab-input",children:a})})});return c}function de({block:e}){let{t}=L(),[a,i]=E(`collab:${e.id}`,!1);if(e.tool==="wait")return null;let r=w(e.status),o=se(e,t);return m("div",{className:"codex-activity-item",children:[m("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":a,onClick:()=>i((d)=>!d),children:[m("span",{className:"codex-activity-label",children:[n(le,{className:"size-4 shrink-0","aria-hidden":"true"}),n("span",{className:"min-w-0 flex-1 truncate",children:r?n("span",{className:"codex-activity-running",children:o}):o})]}),n(_,{expanded:a})]}),n("div",{className:g("codex-activity-details-grid",a&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:je(e,t).map((d)=>n("div",{className:"codex-collab-row",children:d.node},d.key))})})})]})}function ce({block:e}){let{t,i18n:a}=L(),i=Boolean(e.isComplete),[r,o]=E(`thinking:${v(e)}`,!1),d=T(null),c=e.thinking.trim().length>0;b(()=>{if(i||!c)return;let s=d.current;if(s===null)throw Error("Thinking details are not mounted");let f=new ResizeObserver(()=>{s.scrollTop=s.scrollHeight}),p=null,N=()=>{let y=s.firstElementChild;if(y===p)return;if(p!==null)f.unobserve(p);if(p=y,p!==null)f.observe(p)},C=new MutationObserver(N);return C.observe(s,{childList:!0}),N(),()=>{C.disconnect(),f.disconnect()}},[c,i]);let l=i?e.durationMs!==void 0?t("stream.codex.thoughtFor",{duration:H(e.durationMs,a.language)}):t("stream.codex.thought"):t("message.thinking"),u=e.thinking.trimStart().replace(/^\*\*[^\n]*?\*\*\s*/,"");return m("div",{className:"codex-activity-item",children:[m("button",{type:"button",className:g("codex-activity-header",!c&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":c?r:void 0,disabled:!c,onClick:()=>o((s)=>!s),children:[n("span",{className:"codex-activity-label",children:n("span",{className:"codex-reasoning-label min-w-0 flex-1 truncate",children:i?l:n("span",{className:"codex-activity-running",children:l})})}),c&&n(_,{expanded:r})]}),n("div",{className:g("codex-activity-details-grid",r&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:c&&n("div",{ref:d,className:"codex-reasoning-details",role:"region","aria-label":l,"aria-hidden":!r,tabIndex:0,inert:!r,children:n(K,{text:u,streaming:!i})})})})]})}function We(e){if(G(e))return"mcp";let t=O(e).category;return t==="think"||t==="switch_mode"?"other":t}function He(e,t,a,i){return i(`stream.codex.summary.${e}.${a?"leading":"following"}`,{count:t})}function Pe(e,t,a){let i=new Map;for(let o of e){let d=We(o);i.set(d,(i.get(d)??0)+1)}let r=Array.from(i,([o,d],c)=>He(o,d,c===0,t));if(a.startsWith("zh"))return r.join("");return new Intl.ListFormat(a,{style:"long",type:"conjunction"}).format(r)}function nt({stateKey:e,durationMs:t,durationKind:a="work",active:i,startedAt:r,providerId:o,providerIcon:d,children:c}){let{t:l,i18n:u}=L(),[s,f]=E(`work:${e}`,i),p=R(`work:${e}`,s||i),N=T(i),C=T(null),[y,h]=V(0);b(()=>{if(i)f(!0);if(N.current&&!i)f(!1);N.current=i},[i,f]),b(()=>{if(!i||t!==void 0){C.current=null;return}C.current=r??Date.now();let A=()=>{let B=C.current;if(B===null)throw Error("Codex work section is ticking without a start time");h(Date.now()-B)};A();let F=window.setInterval(A,1000);return()=>window.clearInterval(F)},[i,r,t]);let S=t!==void 0?l(a==="total"?"stream.codex.totalDuration":"stream.codex.workedFor",{duration:H(t,u.language)}):i&&y>=1000?l("stream.codex.workedFor",{duration:H(y,u.language)}):l("stream.codex.worked");return m("section",{className:"codex-work-section",children:[m("button",{type:"button",className:"codex-work-trigger","data-codex-disclosure":"","aria-expanded":s,onClick:()=>f((A)=>!A),children:[o!==void 0&&n("span",{className:"codex-work-provider-icon","data-testid":"codex-work-provider-icon","data-provider-id":o,"aria-hidden":"true",children:d}),n("span",{children:S}),n(_,{expanded:s,className:"codex-work-chevron"})]}),n("div",{className:"codex-work-separator","aria-hidden":"true"}),n("div",{className:g("codex-work-grid",s&&"codex-work-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-work-body",children:p&&c})})})]})}function Re(e,t){if(e.type==="tool_use")return Ne(e,t);if(e.type==="thinking")return t("message.thinking");if(e.type==="collab")return se(e,t);return t("stream.codex.subagentWorking",{name:e.name})}function X(e){if(e.type==="thinking")return!e.isComplete;if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return w(e.status);return!1}function Ge(e,t,a=1000){let[i,r]=V({text:e,live:t}),o=T(Date.now());return b(()=>{if(e===i.text&&t===i.live)return;let d=Date.now(),c=Math.max(0,o.current+a-d);if(c===0||t!==i.live){o.current=d,r({text:e,live:t});return}let l=window.setTimeout(()=>{o.current=Date.now(),r({text:e,live:t})},c);return()=>window.clearTimeout(l)},[i,t,a,e]),t===i.live?i.text:e}function qe({blocks:e}){let{t,i18n:a}=L(),i=e.some(X),r=e.map(v).join(":"),[o,d]=E(`group:${r}`,i),c=R(`group:${r}`,o||i),l=T(i);b(()=>{if(i)d(!0);if(l.current&&!i)d(!1);l.current=i},[i,d]);let u=e.findLast(X)??e.at(-1);if(u===void 0)throw Error("CodexActivityGroup requires at least one activity block");let s=e.filter((p)=>p.type==="tool_use"),f=Ge(i?Re(u,t):Pe(s,t,a.language),i);return m("div",{className:"codex-activity-group",children:[m("button",{type:"button",className:"codex-activity-group-trigger","aria-expanded":o,onClick:()=>d((p)=>!p),children:[m("span",{className:"codex-activity-label",children:[n(k,{block:e[0]}),n("span",{className:"truncate",children:i?n("span",{className:"codex-activity-running",children:f}):f})]}),n(_,{expanded:o})]}),n("div",{className:g("codex-activity-group-grid",o&&"codex-activity-group-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-activity-group-body",children:c&&e.map((p)=>n(ae,{block:p},v(p)))})})})]})}function Y({blocks:e}){if(e.length===0)throw Error("CodexActivityGroup requires at least one activity block");if(e.length===1)return n(ae,{block:e[0]});return n(qe,{blocks:e})}function at({blocks:e}){if(!e.some(D))return n(Y,{blocks:e});let t=[];for(let a of e){let i=t.at(-1);if(i&&D(i[0])===D(a))i.push(a);else t.push([a])}return n(W,{children:t.map((a)=>D(a[0])?n(fe,{blocks:a.filter(D)},v(a[0])):n(Y,{blocks:a},v(a[0])))})}export{at as CodexActivityGroup,nt as CodexWorkSection};
1
+ import{jsx as n,jsxs as m,Fragment as O}from"react/jsx-runtime";import{cn as g}from"cn";import{BotIcon as le,CheckIcon as ue,CopyIcon as me}from"lucide-react";import{Fragment as pe,useEffect as Z,useRef as W,useState as S}from"react";import{ActivityMarkdown as K,useActivityHost as M}from"../activity-host.js";import{formatModelName as z}from"../lib/model-name.js";import{describeToolUse as F}from"../lib/stream-style.js";import{useCodexDisclosureState as T}from"./disclosure-state.js";import{ImageViewActivity as fe,isImageView as _}from"./image-view-activity.js";import{CodexPlan as xe}from"./plan.js";function P(e,t){let[a,i]=S(()=>({key:e,mounted:t})),r=t||a.key===e&&a.mounted;if(a.key!==e||a.mounted!==r)i({key:e,mounted:r});return r}var U=new WeakMap,J=1;function C(e){if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return`${e.type}:${e.id}`;if(e.type==="thinking"&&e.id!==void 0)return`thinking:${e.id}`;let t=U.get(e);if(t!==void 0)return`${e.type}:${t}`;let a=J;return J+=1,U.set(e,a),`${e.type}:${a}`}function N(e){switch(e){case"pending":case"in_progress":return!0;case"completed":case"failed":case"cancelled":case"interrupted":return!1;default:throw Error(`Unknown ACP tool status: ${e}`)}}function j(e,t){let a=Math.max(0,Math.round(e/1000)),i=Math.floor(a/3600),r=Math.floor(a%3600/60),o=a%60;if(o>=60)r+=Math.floor(o/60),o%=60;if(r>=60)i+=Math.floor(r/60),r%=60;let d=Intl.DurationFormat;if(d)try{return new d(t,{style:"narrow"}).format({hours:i,minutes:r,seconds:i>0?0:o})}catch{}if(i>0)return r>0?`${i}h ${r}m`:`${i}h`;if(r>0)return o>0?`${r}m ${o}s`:`${r}m`;return`${o}s`}var he="M7.52925 3.7793C7.75652 3.55203 8.10803 3.52383 8.36616 3.69434L8.47065 3.7793L14.2207 9.5293C14.4804 9.789 14.4804 10.211 14.2207 10.4707L8.47065 16.2207C8.21095 16.4804 7.78895 16.4804 7.52925 16.2207C7.26955 15.961 7.26955 15.539 7.52925 15.2793L12.8085 10L7.52925 4.7207L7.44429 4.61621C7.27378 4.35808 7.30198 4.00657 7.52925 3.7793Z";function E({expanded:e,className:t}){return n("svg",{className:g("codex-activity-disclosure",e&&"codex-activity-disclosure-expanded",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:he})})}function ge(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.3965 5.01128C16.3963 4.93399 16.3489 4.87691 16.293 4.85406L16.2354 4.84332C13.9306 4.91764 12.5622 5.32101 10.665 6.34722V16.3716C11.3851 15.9994 12.0688 15.7115 12.7861 15.5015C13.8286 15.1965 14.9113 15.0633 16.2402 15.0435L16.2979 15.0308C16.353 15.0063 16.3965 14.9483 16.3965 14.8755V5.01128ZM3.54492 14.8765C3.54492 14.9725 3.62159 15.0422 3.70117 15.0435L4.19629 15.0562C5.94062 15.1247 7.26036 15.4201 8.65918 16.0484C8.05544 15.1706 7.14706 14.436 6.17871 14.1109V14.1099C5.56757 13.9045 5.16816 13.3314 5.16797 12.6988V4.98882C4.86679 4.93786 4.60268 4.8999 4.28223 4.87457L3.72754 4.84429C3.62093 4.84079 3.54505 4.92417 3.54492 5.01226V14.8765ZM17.7266 14.8755C17.7266 15.6314 17.1607 16.2751 16.4121 16.3628L16.2598 16.3736C15.0122 16.3922 14.0555 16.5159 13.1602 16.7779C12.2629 17.0404 11.3966 17.4508 10.3369 18.0738C10.129 18.1959 9.87099 18.1958 9.66309 18.0738C7.71455 16.9283 6.31974 16.4689 4.12988 16.3853L3.68164 16.3736C2.85966 16.3614 2.21484 15.6838 2.21484 14.8765V5.01226C2.21497 4.15391 2.93263 3.4871 3.77246 3.51519L4.39844 3.54937C4.67996 3.57191 4.92258 3.60421 5.16797 3.64214V2.51031C5.16797 1.44939 6.29018 0.645615 7.31055 1.15679L7.31152 1.15582C8.78675 1.89511 10.0656 3.33006 10.5352 4.91461C12.3595 3.98907 13.8688 3.58817 16.1924 3.51324L16.3506 3.51714C17.1285 3.5741 17.7264 4.23496 17.7266 5.01128V14.8755ZM6.49805 12.6988C6.49824 12.7723 6.5442 12.8296 6.60254 12.8492L6.96289 12.9859C7.85245 13.3586 8.68125 13.9846 9.33496 14.7496V5.5816C9.08794 4.37762 8.13648 3.1566 6.95801 2.47613L6.71582 2.34527C6.67779 2.32617 6.6337 2.32502 6.58301 2.35796C6.52946 2.39279 6.49805 2.44863 6.49805 2.51031V12.6988Z"})})}function Ce(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M7.33057 1.98535C10.2484 1.98535 12.6136 4.3508 12.6138 7.26855C12.6138 8.58031 12.1346 9.77942 11.3433 10.7031L13.9897 13.3496C14.1655 13.5253 14.1655 13.8106 13.9897 13.9863C13.814 14.1621 13.5288 14.1621 13.353 13.9863L10.7017 11.335C9.78678 12.0942 8.61243 12.5518 7.33057 12.5518C4.41281 12.5516 2.04736 10.1864 2.04736 7.26855C2.04754 4.35091 4.41292 1.98553 7.33057 1.98535ZM7.33057 2.88574C4.90998 2.88592 2.94793 4.84796 2.94775 7.26855C2.94775 9.68929 4.90987 11.6522 7.33057 11.6523C9.75141 11.6523 11.7144 9.6894 11.7144 7.26855C11.7142 4.84786 9.75131 2.88574 7.33057 2.88574Z"})})}function ye(){return m("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[n("path",{d:"M6.19629 7.86231C6.42357 7.63534 6.7752 7.60692 7.0332 7.77734L7.1377 7.86231L8.80371 9.5293C9.06329 9.78889 9.06307 10.21 8.80371 10.4697L7.1377 12.1367C6.878 12.3964 6.45599 12.3964 6.19629 12.1367C5.93686 11.8771 5.93697 11.456 6.19629 11.1963L7.39258 9.99902L6.19629 8.80371L6.11133 8.69922C5.94087 8.4411 5.96904 8.08955 6.19629 7.86231Z"}),n("path",{d:"M13.4668 11.0156C13.7699 11.0776 13.998 11.3456 13.998 11.667C13.9979 11.9883 13.7698 12.2564 13.4668 12.3184L13.333 12.332H10.833C10.466 12.3319 10.1682 12.034 10.168 11.667C10.168 11.2998 10.4659 11.0021 10.833 11.002H13.333L13.4668 11.0156Z"}),n("path",{d:"M12.6602 2.66504C13.3492 2.66504 13.9062 2.66439 14.3564 2.70117C14.8142 2.73859 15.2201 2.81796 15.5967 3.00977C16.1922 3.31321 16.677 3.79805 16.9805 4.39356C17.1722 4.77014 17.2517 5.17604 17.2891 5.63379C17.3258 6.08402 17.3252 6.64102 17.3252 7.33008V12.6602C17.3252 13.3492 17.3258 13.9062 17.2891 14.3564C17.2516 14.8142 17.1723 15.2201 16.9805 15.5967C16.677 16.1922 16.1922 16.677 15.5967 16.9805C15.2201 17.1723 14.8142 17.2516 14.3564 17.2891C13.9062 17.3258 13.3492 17.3252 12.6602 17.3252H7.33008C6.64102 17.3252 6.08402 17.3258 5.63379 17.2891C5.17604 17.2517 4.77014 17.1722 4.39356 16.9805C3.79805 16.677 3.31321 16.1922 3.00977 15.5967C2.81796 15.2201 2.73859 14.8142 2.70117 14.3564C2.66439 13.9062 2.66504 13.3492 2.66504 12.6602V7.33008C2.66504 6.64101 2.66439 6.08402 2.70117 5.63379C2.73858 5.17601 2.81797 4.77016 3.00977 4.39356C3.31321 3.79802 3.79802 3.31321 4.39356 3.00977C4.77016 2.81797 5.17601 2.73858 5.63379 2.70117C6.08402 2.66439 6.64101 2.66504 7.33008 2.66504H12.6602ZM7.33008 3.99512C6.61907 3.99512 6.1257 3.99601 5.74219 4.02734C5.3665 4.05804 5.15508 4.11481 4.99707 4.19531C4.65183 4.37124 4.37124 4.65183 4.19531 4.99707C4.11481 5.15508 4.05805 5.3665 4.02734 5.74219C3.99601 6.1257 3.99512 6.61908 3.99512 7.33008V12.6602C3.99512 13.3711 3.99601 13.8646 4.02734 14.248C4.05805 14.6237 4.11481 14.8352 4.19531 14.9932C4.37124 15.3384 4.65186 15.619 4.99707 15.7949C5.15507 15.8754 5.36654 15.9322 5.74219 15.9629C6.1257 15.9942 6.61908 15.9951 7.33008 15.9951H12.6602C13.3711 15.9951 13.8646 15.9942 14.248 15.9629C14.6237 15.9322 14.8352 15.8754 14.9932 15.7949C15.3384 15.619 15.619 15.3384 15.7949 14.9932C15.8754 14.8352 15.9322 14.6237 15.9629 14.248C15.9942 13.8646 15.9951 13.3711 15.9951 12.6602V7.33008C15.9951 6.61908 15.9942 6.1257 15.9629 5.74219C15.9322 5.36654 15.8754 5.15507 15.7949 4.99707C15.619 4.65186 15.3384 4.37124 14.9932 4.19531C14.8352 4.11481 14.6237 4.05805 14.248 4.02734C13.8646 3.99601 13.3711 3.99512 12.6602 3.99512H7.33008Z"})]})}function ve(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M11.3312 4.20472C12.7488 2.92391 14.9377 2.96644 16.3039 4.33265L16.4318 4.46742C17.6713 5.8393 17.6713 7.93343 16.4318 9.30531L16.3039 9.44007L10.0119 15.7311C9.68839 16.0546 9.45384 16.2917 9.22185 16.4821L8.98748 16.6588C8.78233 16.799 8.56429 16.9196 8.33709 17.0192L8.10759 17.1119C7.92582 17.1785 7.73843 17.2266 7.52166 17.2711L6.75701 17.4069L4.36345 17.8053C4.22059 17.8291 4.06914 17.8552 3.9406 17.8649C3.84183 17.8723 3.70833 17.875 3.56267 17.8395L3.41423 17.7907C3.19121 17.695 3.00747 17.5271 2.89177 17.316L2.84588 17.2223C2.75958 17.0209 2.76174 16.8276 2.77166 16.6959C2.78136 16.5674 2.80742 16.4159 2.83123 16.2731L3.22966 13.8795L3.36443 13.1149C3.40899 12.898 3.45795 12.7108 3.52459 12.5289L3.61736 12.2985C3.71691 12.0715 3.83772 11.854 3.97771 11.6491L4.15349 11.4147C4.34392 11.1825 4.58171 10.9484 4.90545 10.6246L11.1965 4.33265L11.3312 4.20472ZM5.84588 11.5651C5.49671 11.9142 5.31258 12.0998 5.1867 12.2526L5.07537 12.3991C4.98194 12.5358 4.90157 12.6812 4.83513 12.8327L4.77361 12.9869C4.73328 13.0971 4.70248 13.2125 4.66814 13.3815L4.54119 14.0983L4.14275 16.4918L4.14177 16.4938H4.1447L6.53826 16.0944L7.25505 15.9684C7.42406 15.9341 7.53946 15.9033 7.64959 15.8629L7.80291 15.8014C7.95461 15.7349 8.09953 15.6538 8.2365 15.5602L8.38396 15.4498C8.53674 15.3239 8.72231 15.1398 9.07146 14.7907L14.0588 9.80238L10.8332 6.57679L5.84588 11.5651ZM15.3635 5.27308C14.5281 4.43776 13.2058 4.38573 12.3097 5.11683L12.1369 5.27308L11.7736 5.63636L15.0002 8.86195L15.3635 8.49964L15.5197 8.32581C16.2015 7.48961 16.2015 6.28311 15.5197 5.44691L15.3635 5.27308Z"})})}function we(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.8347 7.91699C16.8347 7.76279 16.8266 7.61021 16.8123 7.45996L15.4705 8.80371C14.2903 9.98388 12.3762 9.98388 11.1961 8.80371C10.016 7.62352 10.0159 5.70942 11.1961 4.5293L12.5378 3.18652C12.3885 3.17238 12.237 3.16505 12.0837 3.16504C9.45947 3.16504 7.33179 5.29272 7.33179 7.91699C7.33184 8.56608 7.46162 9.18329 7.69605 9.74512C7.79981 9.9939 7.74311 10.2811 7.5525 10.4717L3.59547 14.4287C3.0498 14.9744 3.04991 15.8586 3.59547 16.4043L3.70191 16.501C4.25076 16.9483 5.05957 16.9158 5.57105 16.4043L9.52906 12.4473L9.60426 12.3828C9.79018 12.2455 10.0369 12.2131 10.2546 12.3037C10.8166 12.5382 11.4345 12.668 12.0837 12.668C14.7078 12.6678 16.8345 10.541 16.8347 7.91699ZM18.1648 7.91699C18.1646 11.2755 15.4423 13.9979 12.0837 13.998C11.4151 13.998 10.7708 13.8886 10.1677 13.6885L6.51246 17.3457C5.51389 18.3443 3.93332 18.406 2.86207 17.5322L2.65504 17.3457C1.58992 16.2806 1.58992 14.5534 2.65504 13.4883L6.31031 9.83203C6.1104 9.22921 6.00175 8.58526 6.00172 7.91699C6.00172 4.55818 8.72494 1.83496 12.0837 1.83496C12.7838 1.835 13.458 1.95316 14.0857 2.17188L14.1638 2.20508C14.3404 2.29325 14.4697 2.45713 14.5144 2.65234C14.5653 2.87533 14.4984 3.10876 14.3367 3.27051L12.1375 5.4707C11.4767 6.13148 11.4767 7.20251 12.1375 7.86328C12.7983 8.52373 13.8694 8.52395 14.53 7.86328L16.7293 5.66309L16.7937 5.60742C16.9499 5.48687 17.1532 5.44067 17.3484 5.48535C17.5714 5.53648 17.7526 5.69898 17.8279 5.91504C18.0466 6.54272 18.1648 7.21689 18.1648 7.91699Z"})})}function k({block:e}){if(e.type!=="tool_use")return null;let t=F(e).category;if(t==="read")return n(ge,{});if(t==="search"||t==="fetch")return n(Ce,{});if(t==="execute")return n(ye,{});if(t==="edit")return n(ve,{});return n(we,{})}function b(e,t){let a=e.rawInput[t];return typeof a==="string"&&a.length>0?a:void 0}function Le(e){return F(e).target}function R(e){return e.name.startsWith("mcp__")||e.name.startsWith("mcp_")}function ee(e,t){let{category:a}=F(e),i=Le(e),r=N(e.status);if(R(e))return{leading:e.title};if(a==="execute"){let o=b(e,"command")?.split(`
2
+ `)[0]??i;return o?{leading:t(r?"stream.codex.running":"stream.codex.ran"),trailing:o}:{leading:t(r?"stream.codex.runningCommand":"stream.codex.ranCommandGeneric")}}if(a==="search"){let o=b(e,"pattern")??b(e,"query")??i;return o?{leading:t(r?"stream.codex.searching":"stream.codex.searched"),trailing:t("stream.codex.forDetail",{detail:o})}:{leading:t(r?"stream.codex.searchingFiles":"stream.codex.searchedFiles")}}if(a==="fetch"){let o=b(e,"query")??b(e,"url")??i;return o?{leading:t(r?"stream.codex.searchingWeb":"stream.codex.searchedWeb"),trailing:t("stream.codex.forDetail",{detail:o})}:{leading:t(r?"stream.codex.searchingWeb":"stream.codex.searchedWeb")}}if(a==="read")return i?{leading:t("stream.codex.readLabel"),trailing:i}:{leading:t("stream.codex.readFiles")};if(a==="edit")return i?{leading:t(r?"stream.codex.editingLabel":"stream.codex.editedLabel"),trailing:i}:{leading:t(r?"stream.codex.editingFiles":"stream.codex.editedFiles")};if(a==="delete")return i?{leading:t(r?"stream.codex.deletingLabel":"stream.codex.deletedLabel"),trailing:i}:{leading:t(r?"stream.codex.deletingFiles":"stream.codex.deletedFiles")};if(a==="move")return i?{leading:t(r?"stream.codex.movingLabel":"stream.codex.movedLabel"),trailing:i}:{leading:t(r?"stream.codex.movingFiles":"stream.codex.movedFiles")};return{leading:e.title}}function Ne(e,t){let a=ee(e,t);return a.trailing===void 0?a.leading:`${a.leading} ${a.trailing}`}function $e(e){return e.map((t)=>{if(t.type!=="content")return"";let a=t.content;return a.type==="text"?a.text:""}).filter(Boolean).join(`
3
+ `).trim()}function Me(e){return e.flatMap((t)=>{if(t.type!=="content")return[];let a=t.content;return a.type==="image"?[{data:a.data,mimeType:a.mimeType}]:[]})}function Ae(e){return e.flatMap((t)=>{if(t.type!=="content")return[];let a=t.content;return a.type==="audio"?[{data:a.data,mimeType:a.mimeType}]:[]})}function Ie(e){if(typeof e==="string"&&e.length>0)return e;return}function be(e){return e.type==="diff"}function Te(e){let t=e.content.find(be);if(t===void 0)return;return t.changes.map((a)=>`${a.operation} ${a.path}`).join(`
4
+ `)}function te(e){let t=Ie(e.rawOutput);if(t!==void 0)return t;let a=$e(e.content);if(a.length>0)return a;return Te(e)}function Ee({block:e,command:t}){let{t:a,Output:i,commandStatus:r}=M(),[o,d]=S(!1),[c,l]=S(!1),u=te(e),s=r===void 0?e.exitCode===void 0?void 0:a("stream.codex.exitCode",{code:e.exitCode}):r(e),p=()=>{navigator.clipboard.writeText([`$ ${t}`,u].filter((h)=>h!==void 0).join(`
5
+ `)),d(!0),setTimeout(()=>d(!1),1500)};return n("div",{className:"codex-command-details",children:m("div",{className:"codex-command-card",children:[m("div",{className:"codex-command-line-row",children:[n("span",{className:"codex-command-prompt","aria-hidden":"true",children:"$"}),n("button",{type:"button",className:g("codex-command-line",!c&&"codex-command-line-clamped"),"data-codex-disclosure":"","aria-expanded":c,onClick:()=>l((h)=>!h),children:t}),n("button",{type:"button",className:"codex-command-copy","aria-label":a("actions.copy"),onClick:p,children:o?n(ue,{}):n(me,{})})]}),u!==void 0&&(i===void 0?n("pre",{className:"codex-command-output",children:u}):n(i,{text:u})),s!==void 0&&n("div",{className:"codex-command-footer",children:n("span",{className:"codex-command-status",children:s})})]})})}function ne({block:e}){let{t,openLink:a,Patch:i,openImage:r,commandStatus:o,expandToolOutput:d=!1}=M(),c=te(e),l=i===void 0?void 0:e.content.flatMap((f)=>{if(f.type!=="diff")return[];let I=f;return I.patch?.text?[I.patch.text]:[]}).join(`
6
+ `),u=Me(e.content),s=Ae(e.content),[p,h]=T(`tool:${e.id}`,!1),y=P(`tool:${e.id}`,p),v=F(e),w=v.category,x=ee(e,t),L=w==="execute"?b(e,"command"):void 0,B=L!==void 0||R(e)||u.length>0||s.length>0||Boolean(l)||d&&c!==void 0,A=!B&&!N(e.status)?v.filePath:void 0;if(w==="execute"&&!N(e.status)&&e.status!=="completed"){let f=o?.(e);if(f)x={...x,leading:f}}if(w==="read"&&N(e.status))return null;let G=m("span",{className:"codex-activity-label",children:[n(k,{block:e}),n("span",{className:"min-w-0 flex-1 truncate",children:N(e.status)?n("span",{className:"codex-activity-running",children:x.trailing===void 0?x.leading:`${x.leading} ${x.trailing}`}):m(O,{children:[n("span",{className:"codex-activity-leading",children:x.leading}),x.trailing!==void 0&&(A!==void 0?m(O,{children:[" ",n("button",{type:"button",className:"codex-activity-trailing codex-activity-file-link",title:A,onClick:()=>a(A),children:x.trailing})]}):m("span",{className:"codex-activity-trailing",children:[" ",x.trailing]}))]})})]});return m("div",{className:"codex-activity-item",children:[B?m("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-label":x.trailing===void 0?x.leading:`${x.leading} ${x.trailing}`,"aria-expanded":p,onClick:()=>h((f)=>!f),children:[G,n(E,{expanded:p})]}):n("div",{className:"codex-activity-header codex-activity-header-static",children:G}),n("div",{className:g("codex-activity-details-grid",p&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:y&&m(O,{children:[L!==void 0?n(Ee,{block:e,command:L}):i!==void 0&&l?n(i,{patch:l}):c!==void 0&&n("pre",{className:"codex-activity-details",children:c}),u.length>0&&n("div",{className:"codex-activity-media",children:u.map((f)=>{let I=`data:${f.mimeType};base64,${f.data}`,q=n("img",{src:I,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},`${f.mimeType}:${f.data.slice(0,32)}`);return r===void 0?q:n("button",{type:"button",className:"cursor-pointer",onClick:()=>r(I),children:q},I)})}),s.map((f)=>n("audio",{className:"mt-1 w-full","aria-label":t("stream.codex.audioOutput"),controls:!0,src:`data:${f.mimeType};base64,${f.data}`},`${f.mimeType}:${f.data.slice(0,32)}`))]})})})]})}function ae({block:e}){if(e.type==="tool_use")return n(ne,{block:e});if(e.type==="thinking")return n(ce,{block:e});if(e.type==="collab")return n(de,{block:e});return n(ie,{block:e})}function ie({block:e}){let{t,openSession:a}=M(),i=N(e.status),[r,o]=T(`subagent:${e.id}`,i),d=W(i);Z(()=>{if(i)o(!0);if(d.current&&!i)o(!1);d.current=i},[i,o]);let c=`${Be(e.activity,i,e.name,t)}${re(e.model,e.reasoningEffort,t)}`,l=e.threadId??"",u=e.blocks.length>0;return m("div",{className:"codex-activity-item",children:[m("button",{type:"button",className:g("codex-activity-header",!u&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":u?r:void 0,disabled:!u,onClick:()=>o((s)=>!s),children:[m("span",{className:"codex-activity-label",children:[n(Fe,{seed:e.threadId??e.id}),n("span",{className:"min-w-0 flex-1 truncate",children:a===void 0||e.threadId===null?i?n("span",{className:"codex-activity-running",children:c}):c:n("span",{role:"link",tabIndex:0,className:g("codex-agent-link",i&&"codex-activity-running"),"aria-label":t("stream.codex.subagentOpen",{name:e.name}),onClick:(s)=>{s.stopPropagation(),a(l,e.name)},onKeyDown:(s)=>{if(s.key!=="Enter"&&s.key!==" ")return;s.preventDefault(),s.stopPropagation(),a(l,e.name)},children:c})})]}),u&&n(E,{expanded:r})]}),n("div",{className:g("codex-activity-details-grid",r&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:e.blocks.map((s)=>{if(s.type==="tool_use")return n(ne,{block:s},s.id);if(s.type==="thinking")return n(ce,{block:s},C(s));if(s.type==="subagent")return n(ie,{block:s},s.id);if(s.type==="collab")return n(de,{block:s},s.id);if(s.type==="text")return n("div",{className:"codex-reasoning-details",children:n(K,{text:s.text,streaming:!1})},C(s));if(s.type==="plan")return n(xe,{entries:s.entries},C(s));if(s.type==="image")return n("img",{src:`data:${s.source.media_type};base64,${s.source.data}`,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},C(s));return null})})})})]})}var _e=8;function Se(e){let t=0;for(let a=0;a<e.length;a+=1)t=(t*31+e.charCodeAt(a))%2147483647;return t%_e}function Fe({seed:e}){return n("span",{className:"codex-agent-avatar","data-hue":Se(e),"aria-hidden":"true"})}function Be(e,t,a,i){switch(e){case"started":return i(t?"stream.codex.subagentWorking":"stream.codex.subagentFinished",{name:a});case"interacted":return i("stream.codex.subagentMessaged",{name:a});case"interrupted":return i("stream.codex.subagentInterrupted",{name:a});case"completed":return i("stream.codex.subagentFinished",{name:a})}}var De=new Set(["none","minimal","low","medium","high","xhigh","max","ultra","persistent"]);function re(e,t,a){if(e===null)return"";if(t===null)return` · ${z(e)}`;let i=De.has(t)?a(`stream.codex.reasoningEffort.${t}`):t;return` · ${z(e)} · ${i}`}var Ve={spawnAgent:"spawn",sendInput:"message",sendMessage:"message",followupTask:"message",interruptAgent:"interrupt",listAgents:"list",resumeAgent:"resume",closeAgent:"close"};function oe(e){switch(e){case"pending":case"in_progress":return"inProgress";case"completed":return"completed";case"failed":return"failed";case"cancelled":case"interrupted":return"interrupted";default:throw Error(`Unknown ACP tool status: ${e}`)}}function H(e,t,a){if(e.tool==="wait")throw Error("Codex does not present wait calls");let i=oe(e.status);if(i==="interrupted")return a("stream.codex.collab.interrupted");return a(`stream.codex.collab.${t}.${Ve[e.tool]}.${i}`)}function Oe(e){return e.agents.filter((t)=>t.nickname!==null)}function se(e,t){let a=e.agents.length>0?e.agents.length:1;return`${H(e,"header",t)}${t("stream.codex.collab.agentCount",{count:a})}`}var D="\x01";function V(e,t,a,i){let r=Object.fromEntries(Object.keys(i).map((o)=>[o,`${D}${o}${D}`]));return e(t,{...a,...r}).split(new RegExp(`${D}(\\w+)${D}`,"u")).map((o,d)=>n(pe,{children:d%2===1?i[o]:o},`${d}:${o}`))}function Ze({agent:e,showModel:t}){let{t:a,openSession:i}=M(),r=e.nickname??"",o=i===void 0?n("span",{className:"font-medium",children:r}):n("button",{type:"button",className:"codex-agent-link font-medium","aria-label":a("stream.codex.subagentOpen",{name:r}),onClick:()=>i(e.threadId,r),children:r});return m("span",{children:[o,e.role!==null&&` (${e.role})`,t&&re(e.model,e.reasoningEffort,a)]})}function Q({prompt:e}){return n("span",{className:"codex-collab-prompt",title:e,children:e})}function We(e,t){let a=e.prompt?.trim()?e.prompt:null,i=oe(e.status),r=e.tool==="spawnAgent"&&i==="completed"&&a!==null,o=(e.tool==="sendInput"||e.tool==="sendMessage"||e.tool==="followupTask")&&a!==null,d=Oe(e),c=[];if(d.length===0)c.push({key:"generic",node:H(e,"row",t)});for(let l of d){let u=n(Ze,{agent:l,showModel:e.tool==="spawnAgent"});if(r)c.push({key:l.threadId,node:n("span",{className:"codex-collab-line",children:V(t,"stream.codex.collab.createdWithInstructions",{},{agent:u,instructions:n(Q,{prompt:a})})})});else if(o)c.push({key:l.threadId,node:n("span",{className:"codex-collab-line",children:V(t,"stream.codex.collab.messagedWithPrompt",{action:i==="interrupted"?t("stream.codex.collab.interrupted"):t(`stream.codex.collab.messaged.${i}`)},{agent:u,prompt:n(Q,{prompt:a})})})});else{let p=e.tool!=="closeAgent"&&e.tool!=="resumeAgent"&&l.state!==null&&l.state!==null?l.state.message?.trim()?t("stream.codex.collab.stateWithMessage",{state:t(`stream.codex.collab.state.${l.state.status}`),message:l.state.message}):t("stream.codex.collab.stateOnly",{state:t(`stream.codex.collab.state.${l.state.status}`)}):"";c.push({key:l.threadId,node:V(t,"stream.codex.collab.agentRow",{action:H(e,"row",t),state:p},{agent:u})})}}if(!r&&!o&&a!==null)c.push({key:"input",node:V(t,"stream.codex.collab.input",{},{prompt:n("span",{className:"codex-collab-input",children:a})})});return c}function de({block:e}){let{t}=M(),[a,i]=T(`collab:${e.id}`,!1);if(e.tool==="wait")return null;let r=N(e.status),o=se(e,t);return m("div",{className:"codex-activity-item",children:[m("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":a,onClick:()=>i((d)=>!d),children:[m("span",{className:"codex-activity-label",children:[n(le,{className:"size-4 shrink-0","aria-hidden":"true"}),n("span",{className:"min-w-0 flex-1 truncate",children:r?n("span",{className:"codex-activity-running",children:o}):o})]}),n(E,{expanded:a})]}),n("div",{className:g("codex-activity-details-grid",a&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:We(e,t).map((d)=>n("div",{className:"codex-collab-row",children:d.node},d.key))})})})]})}function ce({block:e}){let{t,i18n:a}=M(),i=Boolean(e.isComplete),[r,o]=T(`thinking:${C(e)}`,!1),d=W(null),c=e.thinking.trim().length>0;Z(()=>{if(i||!c)return;let s=d.current;if(s===null)throw Error("Thinking details are not mounted");let p=new ResizeObserver(()=>{s.scrollTop=s.scrollHeight}),h=null,y=()=>{let w=s.firstElementChild;if(w===h)return;if(h!==null)p.unobserve(h);if(h=w,h!==null)p.observe(h)},v=new MutationObserver(y);return v.observe(s,{childList:!0}),y(),()=>{v.disconnect(),p.disconnect()}},[c,i]);let l=i?e.durationMs!==void 0?t("stream.codex.thoughtFor",{duration:j(e.durationMs,a.language)}):t("stream.codex.thought"):t("message.thinking"),u=e.thinking.trimStart().replace(/^\*\*[^\n]*?\*\*\s*/,"");return m("div",{className:"codex-activity-item",children:[m("button",{type:"button",className:g("codex-activity-header",!c&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":c?r:void 0,disabled:!c,onClick:()=>o((s)=>!s),children:[n("span",{className:"codex-activity-label",children:n("span",{className:"codex-reasoning-label min-w-0 flex-1 truncate",children:i?l:n("span",{className:"codex-activity-running",children:l})})}),c&&n(E,{expanded:r})]}),n("div",{className:g("codex-activity-details-grid",r&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:c&&n("div",{ref:d,className:"codex-reasoning-details",role:"region","aria-label":l,"aria-hidden":!r,tabIndex:0,inert:!r,children:n(K,{text:u,streaming:!i})})})})]})}function je(e){if(R(e))return"mcp";let t=F(e).category;return t==="think"||t==="switch_mode"?"other":t}function He(e,t,a,i){return i(`stream.codex.summary.${e}.${a?"leading":"following"}`,{count:t})}function Pe(e,t,a){let i=new Map;for(let o of e){let d=je(o);i.set(d,(i.get(d)??0)+1)}let r=Array.from(i,([o,d],c)=>He(o,d,c===0,t));if(a.startsWith("zh"))return r.join("");return new Intl.ListFormat(a,{style:"long",type:"conjunction"}).format(r)}function nt({stateKey:e,durationMs:t,durationKind:a="work",active:i,startedAt:r,providerId:o,providerIcon:d,children:c}){let{t:l,i18n:u}=M(),[s,p]=T(`work:${e}`,!1),h=P(`work:${e}`,s||i),y=W(null),[v,w]=S(0);Z(()=>{if(!i||t!==void 0){y.current=null;return}y.current=r??Date.now();let L=()=>{let A=y.current;if(A===null)throw Error("Codex work section is ticking without a start time");w(Date.now()-A)};L();let B=window.setInterval(L,1000);return()=>window.clearInterval(B)},[i,r,t]);let x=t!==void 0?l(a==="total"?"stream.codex.totalDuration":"stream.codex.workedFor",{duration:j(t,u.language)}):i&&v>=1000?l("stream.codex.workedFor",{duration:j(v,u.language)}):l("stream.codex.worked");return m("section",{className:"codex-work-section",children:[m("button",{type:"button",className:"codex-work-trigger","data-codex-disclosure":"","aria-expanded":s,onClick:()=>p((L)=>!L),children:[o!==void 0&&n("span",{className:"codex-work-provider-icon","data-testid":"codex-work-provider-icon","data-provider-id":o,"aria-hidden":"true",children:d}),n("span",{children:x}),n(E,{expanded:s,className:"codex-work-chevron"})]}),n("div",{className:"codex-work-separator","aria-hidden":"true"}),n("div",{className:g("codex-work-grid",s&&"codex-work-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-work-body",children:h&&c})})})]})}function Re(e,t){if(e.type==="tool_use")return Ne(e,t);if(e.type==="thinking")return t("message.thinking");if(e.type==="collab")return se(e,t);return t("stream.codex.subagentWorking",{name:e.name})}function X(e){if(e.type==="thinking")return!e.isComplete;if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return N(e.status);return!1}function Ge(e,t,a=1000){let[i,r]=S({text:e,live:t}),o=W(Date.now());return Z(()=>{if(e===i.text&&t===i.live)return;let d=Date.now(),c=Math.max(0,o.current+a-d);if(c===0||t!==i.live){o.current=d,r({text:e,live:t});return}let l=window.setTimeout(()=>{o.current=Date.now(),r({text:e,live:t})},c);return()=>window.clearTimeout(l)},[i,t,a,e]),t===i.live?i.text:e}function qe({blocks:e}){let{t,i18n:a}=M(),i=e.some(X),r=C(e[0]),[o,d]=T(`group:${r}`,!1),c=P(`group:${r}`,o||i),l=e.findLast(X)??e.at(-1);if(l===void 0)throw Error("CodexActivityGroup requires at least one activity block");let u=e.filter((p)=>p.type==="tool_use"),s=Ge(i?Re(l,t):Pe(u,t,a.language),i);return m("div",{className:"codex-activity-group",children:[m("button",{type:"button",className:"codex-activity-group-trigger","aria-expanded":o,onClick:()=>d((p)=>!p),children:[m("span",{className:"codex-activity-label",children:[n(k,{block:e[0]}),n("span",{className:"truncate",children:i?n("span",{className:"codex-activity-running",children:s}):s})]}),n(E,{expanded:o})]}),n("div",{className:g("codex-activity-group-grid",o&&"codex-activity-group-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-activity-group-body",children:c&&e.map((p)=>n(ae,{block:p},C(p)))})})})]})}function Y({blocks:e}){if(e.length===0)throw Error("CodexActivityGroup requires at least one activity block");if(e.length===1)return n(ae,{block:e[0]});return n(qe,{blocks:e})}function at({blocks:e}){if(!e.some(_))return n(Y,{blocks:e});let t=[];for(let a of e){let i=t.at(-1);if(i&&_(i[0])===_(a))i.push(a);else t.push([a])}return n(O,{children:t.map((a)=>_(a[0])?n(fe,{blocks:a.filter(_)},C(a[0])):n(Y,{blocks:a},C(a[0])))})}export{at as CodexActivityGroup,nt as CodexWorkSection};
@@ -0,0 +1,30 @@
1
+ export type AsyncQuestion = {
2
+ title: string;
3
+ options: string[] | null;
4
+ };
5
+ export type QuestionDraft = {
6
+ selected: number | null;
7
+ text: string;
8
+ };
9
+ export type QuestionReply = {
10
+ questionItemId: string;
11
+ question: string;
12
+ answer: string;
13
+ };
14
+ export declare function asyncQuestions(meta: unknown): AsyncQuestion[];
15
+ export declare function asyncQuestionId(messageId: string, index: number): string;
16
+ export declare function initialQuestionDraft(question: AsyncQuestion): QuestionDraft;
17
+ export declare function questionAnswer(question: AsyncQuestion, draft: QuestionDraft): string;
18
+ export declare function questionReplyEnvelope(reply: QuestionReply): string;
19
+ export declare function questionReplies(meta: unknown): QuestionReply[];
20
+ export declare function AsyncQuestionCard({ question, draft, status, answer, error, onChange, onSubmit, onSkip, t }: {
21
+ question: AsyncQuestion;
22
+ draft: QuestionDraft;
23
+ status: "pending" | "submitting" | "answered" | "closed" | "unavailable" | "skipped";
24
+ answer?: string;
25
+ error?: string;
26
+ onChange: (draft: QuestionDraft) => void;
27
+ onSubmit: () => void;
28
+ onSkip: () => void;
29
+ t: (key: string) => string;
30
+ }): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import{jsx as s,jsxs as c,Fragment as w}from"react/jsx-runtime";import{useId as _}from"react";import{Button as x}from"../ui/button.js";import{Label as y}from"../ui/label.js";import{RadioGroup as N,RadioGroupItem as f}from"../ui/radio-group.js";import{Textarea as Q}from"../ui/textarea.js";function o(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function C(e){if(!o(e)||!o(e.codex))return[];let n=e.codex,r=n.questions;if(n.delivery!=="async"||!Array.isArray(r))return[];if(!r.every((t)=>o(t)&&typeof t.title==="string"&&t.title.trim().length>0&&(t.options===null||Array.isArray(t.options)&&t.options.every((l)=>typeof l==="string"))))return[];return r}function S(e,n){return JSON.stringify(["request_user_input_async",e,n])}function O(e){return{selected:e.options?.length?0:null,text:""}}function v(e,n){return n.selected===null?n.text:e.options?.[n.selected]??""}function z(e){return`<send_user_message_question_reply>
2
+ ${JSON.stringify([e])}
3
+ </send_user_message_question_reply>`}function F(e){if(!o(e)||!o(e.codex))return[];let n=e.codex;return(Array.isArray(n.questionReplyParts)?n.questionReplyParts.map((t)=>o(t)?{...t,answer:t.text}:t):[n.questionReply]).filter((t)=>o(t)&&typeof t.questionItemId==="string"&&typeof t.question==="string"&&typeof t.answer==="string").map(({questionItemId:t,question:l,answer:d})=>({questionItemId:t,question:l,answer:d}))}function G({question:e,draft:n,status:r,answer:t,error:l,onChange:d,onSubmit:g,onSkip:h,t:i}){let u=_(),p=r==="pending",b=r==="answered"||r==="skipped";return c("section",{"aria-labelledby":`${u}-title`,className:"border-border bg-card text-card-foreground flex min-w-0 flex-col gap-3 rounded-xl border p-4",children:[s("h3",{id:`${u}-title`,className:"text-sm font-medium whitespace-pre-wrap",children:e.title}),b?s("p",{className:"text-sm whitespace-pre-wrap",children:r==="answered"?t:i("asyncQuestion.skipped")}):c(w,{children:[(e.options?.length??0)>0&&c(N,{"aria-labelledby":`${u}-title`,disabled:!p,value:n.selected===null?"other":String(n.selected),onValueChange:(a)=>d({...n,selected:a==="other"?null:Number(a)}),children:[e.options?.map((a,m)=>c(y,{className:"flex items-start gap-2 text-sm",children:[s(f,{value:String(m)}),s("span",{className:"whitespace-pre-wrap",children:a})]},m)),c(y,{className:"flex items-center gap-2 text-sm",children:[s(f,{value:"other"}),i("asyncQuestion.other")]})]}),s(Q,{"aria-label":i("asyncQuestion.answer"),placeholder:i("asyncQuestion.answer"),value:n.text,readOnly:!p,onChange:(a)=>d({selected:null,text:a.target.value})}),l&&s("p",{role:"alert",className:"text-destructive text-sm",children:l}),c("div",{className:"flex flex-wrap items-center gap-2",children:[s(x,{size:"sm",disabled:!p||v(e,n).trim().length===0,onClick:g,children:i(r==="submitting"?"asyncQuestion.submitting":"asyncQuestion.submit")}),s(x,{size:"sm",variant:"ghost",disabled:!p,onClick:h,children:i("asyncQuestion.skip")}),(r==="closed"||r==="unavailable")&&s("span",{role:"status",className:"text-muted-foreground text-xs",children:i(`asyncQuestion.${r}`)})]})]})]})}export{G as AsyncQuestionCard,S as asyncQuestionId,C as asyncQuestions,O as initialQuestionDraft,v as questionAnswer,F as questionReplies,z as questionReplyEnvelope};
@@ -1,3 +1,3 @@
1
- import{jsx as c,jsxs as E,Fragment as ot}from"react/jsx-runtime";import{autoUpdate as st}from"@floating-ui/dom";import{cn as Q}from"cn";import{BookOpenTextIcon as it,FileIcon as lt,StoreIcon as ut}from"lucide-react";import{useCallback as at,useEffect as p,useLayoutEffect as G,useMemo as J,useRef as X,useState as v}from"react";import{createPortal as ct}from"react-dom";import{Button as Y}from"../ui/button.js";import{Separator as dt}from"../ui/separator.js";import{filterSlashCommands as Z}from"./completion-filter.js";import{detectTrigger as ft}from"./completion-trigger.js";import{usePromptInputController as mt}from"./prompt-input-context.js";function It({handleRef:d,anchorRef:u,commands:T,searchFiles:l,onMention:F,onSearchError:A,fileSearchDebounceMs:q=0,bashMode:B=!1,forcedOpen:s=!1,onForcedOpenChange:f,emptyLabel:R,fileStatusLabels:h,morePlugins:D}){let S=mt(),i=S.textInput.value,[z,_]=v(0),[x,N]=v(null),[y,L]=v(0),U=X(null);p(()=>{let t=d.current?.getTextarea();if(!t)return;let e=()=>_(t.selectionStart??0),n=()=>{if(document.activeElement===t)e()};return t.addEventListener("keyup",e),t.addEventListener("click",e),t.addEventListener("input",e),t.addEventListener("select",e),t.addEventListener("focus",e),document.addEventListener("selectionchange",n),()=>{t.removeEventListener("keyup",e),t.removeEventListener("click",e),t.removeEventListener("input",e),t.removeEventListener("select",e),t.removeEventListener("focus",e),document.removeEventListener("selectionchange",n)}});let V=J(()=>B&&i.startsWith("!")?null:ft(i,z),[i,z,B]),r=V?.kind==="at"&&!l?null:V,P=`${r?.kind??"forced"}:${r?.query??""}:${s}`,[O,tt]=v(P);if(O!==P)tt(P),L(0);let b=X(null);p(()=>{if(!s){b.current=null;return}if(b.current===null)b.current=i;else if(i!==b.current)f?.(!1)},[s,i,f]);let g=r?.kind==="at"?r.query:null;p(()=>{if(g===null||!l){N(null);return}let t=!0,e=()=>{l(g).then((o)=>{if(t)N({query:g,search:l,items:o})},(o)=>{if(t)N({query:g,search:l,items:[]}),A(o)})},n=q>0?window.setTimeout(e,q):null;if(n===null)e();return()=>{if(t=!1,n!==null)window.clearTimeout(n)}},[g,l,q,A]);let m=J(()=>{if(r?.kind==="at")return x?.query===r.query&&x.search===l?x.items:[];if(r)return Z(T,r.query);if(s)return Z(T,"");return[]},[r,s,T,x,l]),[et,j]=v(!1);p(()=>{let t=d.current?.getTextarea();if(!t)return;let e=()=>j(!0),n=()=>{if(j(!1),s)f?.(!1)};return j(document.activeElement===t),t.addEventListener("focus",e),t.addEventListener("blur",n),()=>{t.removeEventListener("focus",e),t.removeEventListener("blur",n)}},[d,s,f]),p(()=>{if(s)d.current?.getTextarea()?.focus()},[s,d]);let a=et&&(r!==null?r.kind==="slash"||m.length>0||!!h:s);p(()=>{if(!a)return;U.current?.querySelector(`[data-idx="${y}"]`)?.scrollIntoView({block:"nearest"})},[y,a]);function W(t){let e=d.current?.getTextarea();if(!e)return;let n,o;if(r){let M=r.kind==="slash"?`/${t.payload} `:`@${t.label} `;if(n=i.slice(0,r.start)+M+i.slice(r.end),r.kind==="at")F?.(t.payload);o=r.start+M.length}else if(s)n=`${i.length===0||i.endsWith(`
1
+ import{jsx as d,jsxs as E,Fragment as ot}from"react/jsx-runtime";import{autoUpdate as st}from"@floating-ui/dom";import{cn as Q}from"cn";import{BookOpenTextIcon as it,FileIcon as ut,StoreIcon as lt}from"lucide-react";import{useCallback as at,useEffect as p,useLayoutEffect as G,useMemo as J,useRef as X,useState as v}from"react";import{createPortal as ct}from"react-dom";import{Button as Y}from"../ui/button.js";import{Separator as dt}from"../ui/separator.js";import{filterSlashCommands as Z}from"./completion-filter.js";import{detectTrigger as ft}from"./completion-trigger.js";import{usePromptInputController as mt}from"./prompt-input-context.js";function It({handleRef:l,anchorRef:a,commands:T,searchFiles:u,onMention:F,onSearchError:A,fileSearchDebounceMs:q=0,bashMode:B=!1,forcedOpen:s=!1,onForcedOpenChange:f,emptyLabel:R,fileStatusLabels:h,morePlugins:D}){let S=mt(),i=S.textInput.value,[z,_]=v(0),[x,N]=v(null),[y,L]=v(0),U=X(null);p(()=>{let t=l.current?.getTextarea();if(!t)return;let e=()=>_(t.selectionStart??0),n=()=>{if(document.activeElement===t)e()};return t.addEventListener("keyup",e),t.addEventListener("click",e),t.addEventListener("input",e),t.addEventListener("select",e),t.addEventListener("focus",e),document.addEventListener("selectionchange",n),()=>{t.removeEventListener("keyup",e),t.removeEventListener("click",e),t.removeEventListener("input",e),t.removeEventListener("select",e),t.removeEventListener("focus",e),document.removeEventListener("selectionchange",n)}});let V=J(()=>B&&i.startsWith("!")?null:ft(i,z),[i,z,B]),r=V?.kind==="at"&&!u?null:V,C=`${r?.kind??"forced"}:${r?.query??""}:${s}`,[O,tt]=v(C);if(O!==C)tt(C),L(0);let b=X(null);p(()=>{if(!s){b.current=null;return}if(b.current===null)b.current=i;else if(i!==b.current)f?.(!1)},[s,i,f]);let g=r?.kind==="at"?r.query:null;p(()=>{if(g===null||!u){N(null);return}let t=!0,e=()=>{u(g).then((o)=>{if(t)N({query:g,search:u,items:o})},(o)=>{if(t)N({query:g,search:u,items:[]}),A(o)})},n=q>0?window.setTimeout(e,q):null;if(n===null)e();return()=>{if(t=!1,n!==null)window.clearTimeout(n)}},[g,u,q,A]);let m=J(()=>{if(r?.kind==="at")return x?.query===r.query&&x.search===u?x.items:[];if(r)return Z(T,r.query);if(s)return Z(T,"");return[]},[r,s,T,x,u]),[et,P]=v(!1);p(()=>{let t=l.current?.getTextarea();if(!t)return;let e=()=>P(!0),n=()=>{if(P(!1),s)f?.(!1)};return P(document.activeElement===t),t.addEventListener("focus",e),t.addEventListener("blur",n),()=>{t.removeEventListener("focus",e),t.removeEventListener("blur",n)}},[l,s,f]),p(()=>{if(s)l.current?.getTextarea()?.focus()},[s,l]);let c=et&&(r!==null?r.kind==="slash"||m.length>0||!!h:s);p(()=>{if(!c)return;U.current?.querySelector(`[data-idx="${y}"]`)?.scrollIntoView({block:"nearest"})},[y,c]);function W(t){let e=l.current?.getTextarea();if(!e)return;let n,o;if(r){let M=r.kind==="slash"?`/${t.payload} `:`@${t.label} `;if(n=i.slice(0,r.start)+M+i.slice(r.end),r.kind==="at")F?.(t.payload);o=r.start+M.length}else if(s)n=`${i.length===0||i.endsWith(`
2
2
  `)?i:`${i}
3
- `}/${t.payload} `,o=n.length,f?.(!1);else return;S.textInput.setInput(n),requestAnimationFrame(()=>{e.focus(),e.setSelectionRange(o,o)})}p(()=>{let t=d.current?.getTextarea();if(!t)return;let e=(n)=>{if(!a)return;if(n.isComposing||n.keyCode===229)return;if(n.key==="ArrowDown")n.preventDefault(),n.stopPropagation(),L((o)=>m.length===0?0:Math.min(m.length-1,o+1));else if(n.key==="ArrowUp")n.preventDefault(),n.stopPropagation(),L((o)=>Math.max(0,o-1));else if(n.key==="Enter"||n.key==="Tab"){n.preventDefault(),n.stopPropagation();let o=m[y];if(o)W(o)}else if(n.key==="Escape")if(n.preventDefault(),n.stopPropagation(),r)_(Math.max(0,r.start-1)),t.setSelectionRange(r.start,r.start);else f?.(!1)};return t.addEventListener("keydown",e,!0),()=>t.removeEventListener("keydown",e,!0)});let[w,H]=v(null),[C,nt]=v(null),I=at(()=>{let t=u?.current;if(!t)return;let e=t.getBoundingClientRect();H({left:e.left,width:e.width,bottom:window.innerHeight-e.top+8})},[u]);if(G(()=>{if(!a){H(null);return}I()},[a,I]),G(()=>{let t=u?.current;if(!a||!t||!C)return;return st(t,C,I,{animationFrame:!0})},[a,C,u,I]),!a||u&&!w)return null;let k=r?r.kind==="slash":s,rt=k?it:lt,K=c("div",{ref:nt,className:u?"fixed z-50":"absolute inset-x-0 bottom-full z-50 mb-2",style:u&&w?{left:w.left,width:w.width,bottom:w.bottom}:void 0,children:E("div",{ref:U,role:"listbox",onMouseDown:(t)=>t.preventDefault(),className:"bg-popover text-popover-foreground ring-foreground/10 pointer-events-auto w-full overflow-hidden rounded-lg p-1 shadow-md ring-1 outline-hidden",children:[E("div",{className:"max-h-72 overflow-y-auto",children:[m.length===0&&k&&c("div",{className:"text-muted-foreground px-2 py-3 text-xs",children:R}),m.length===0&&!k&&h&&c("div",{role:"status",className:"text-muted-foreground px-2 py-3 text-xs",children:x?.query===g&&x.search===l?h.empty:h.loading}),m.map((t,e)=>E(Y,{type:"button",variant:"ghost",role:"option","aria-selected":e===y,"data-idx":e,onMouseDown:(n)=>{n.preventDefault(),W(t)},onMouseEnter:()=>L(e),className:Q("flex h-auto w-full items-center justify-start gap-2.5 rounded-md px-2.5 py-2 text-start",e===y&&"bg-muted"),children:[c(rt,{className:Q("size-4 shrink-0",k?"text-blue-500":"text-muted-foreground")}),c("span",{className:"text-foreground shrink-0 text-sm font-medium",children:t.label}),t.description&&c("span",{className:"text-muted-foreground min-w-0 flex-1 truncate text-xs",children:t.description})]},t.key))]}),k&&D&&E(ot,{children:[c(dt,{}),E(Y,{type:"button",variant:"ghost",onMouseDown:(t)=>{t.preventDefault(),f?.(!1),D.open()},className:"h-auto w-full justify-start px-2.5 py-2",children:[c(ut,{"data-icon":"inline-start"}),D.label]})]})]})});return u?ct(K,document.body):K}export{It as CompletionMenu};
3
+ `}/${t.payload} `,o=n.length,f?.(!1);else return;S.textInput.setInput(n),requestAnimationFrame(()=>{e.focus(),e.setSelectionRange(o,o)})}p(()=>{let t=l.current?.getTextarea();if(!t)return;let e=(n)=>{if(!c)return;if(l.current?.isComposing()||n.isComposing||n.keyCode===229)return;if(n.key==="ArrowDown")n.preventDefault(),n.stopPropagation(),L((o)=>m.length===0?0:Math.min(m.length-1,o+1));else if(n.key==="ArrowUp")n.preventDefault(),n.stopPropagation(),L((o)=>Math.max(0,o-1));else if(n.key==="Enter"||n.key==="Tab"){n.preventDefault(),n.stopPropagation();let o=m[y];if(o)W(o)}else if(n.key==="Escape")if(n.preventDefault(),n.stopPropagation(),r)_(Math.max(0,r.start-1)),t.setSelectionRange(r.start,r.start);else f?.(!1)};return t.addEventListener("keydown",e,!0),()=>t.removeEventListener("keydown",e,!0)});let[w,H]=v(null),[j,nt]=v(null),I=at(()=>{let t=a?.current;if(!t)return;let e=t.getBoundingClientRect();H({left:e.left,width:e.width,bottom:window.innerHeight-e.top+8})},[a]);if(G(()=>{if(!c){H(null);return}I()},[c,I]),G(()=>{let t=a?.current;if(!c||!t||!j)return;return st(t,j,I,{animationFrame:!0})},[c,j,a,I]),!c||a&&!w)return null;let k=r?r.kind==="slash":s,rt=k?it:ut,K=d("div",{ref:nt,className:a?"fixed z-50":"absolute inset-x-0 bottom-full z-50 mb-2",style:a&&w?{left:w.left,width:w.width,bottom:w.bottom}:void 0,children:E("div",{ref:U,role:"listbox",onMouseDown:(t)=>t.preventDefault(),className:"bg-popover text-popover-foreground ring-foreground/10 pointer-events-auto w-full overflow-hidden rounded-lg p-1 shadow-md ring-1 outline-hidden",children:[E("div",{className:"max-h-72 overflow-y-auto",children:[m.length===0&&k&&d("div",{className:"text-muted-foreground px-2 py-3 text-xs",children:R}),m.length===0&&!k&&h&&d("div",{role:"status",className:"text-muted-foreground px-2 py-3 text-xs",children:x?.query===g&&x.search===u?h.empty:h.loading}),m.map((t,e)=>E(Y,{type:"button",variant:"ghost",role:"option","aria-selected":e===y,"data-idx":e,onMouseDown:(n)=>{n.preventDefault(),W(t)},onMouseEnter:()=>L(e),className:Q("flex h-auto w-full items-center justify-start gap-2.5 rounded-md px-2.5 py-2 text-start",e===y&&"bg-muted"),children:[d(rt,{className:Q("size-4 shrink-0",k?"text-blue-500":"text-muted-foreground")}),d("span",{className:"text-foreground shrink-0 text-sm font-medium",children:t.label}),t.description&&d("span",{className:"text-muted-foreground min-w-0 flex-1 truncate text-xs",children:t.description})]},t.key))]}),k&&D&&E(ot,{children:[d(dt,{}),E(Y,{type:"button",variant:"ghost",onMouseDown:(t)=>{t.preventDefault(),f?.(!1),D.open()},className:"h-auto w-full justify-start px-2.5 py-2",children:[d(lt,{"data-icon":"inline-start"}),D.label]})]})]})});return a?ct(K,document.body):K}export{It as CompletionMenu};
@@ -5,6 +5,7 @@ import { type MenuRadioOption } from "./menu-radio.js";
5
5
  export interface ChatModelOption {
6
6
  api_id: string;
7
7
  label: string;
8
+ icon?: ReactNode;
8
9
  more?: boolean;
9
10
  description?: string;
10
11
  }
@@ -17,6 +18,12 @@ export interface ModelSelectProps<T extends ChatModelOption> extends Omit<Compon
17
18
  name: string;
18
19
  models: T[];
19
20
  }>;
21
+ compactCatalog?: boolean;
22
+ effortPresentation?: "slider" | "menu";
23
+ unavailableEffort?: {
24
+ name: string;
25
+ label: string;
26
+ };
20
27
  providerMenu?: {
21
28
  value: string;
22
29
  icon: ReactNode;
@@ -43,6 +50,9 @@ export interface ModelSelectProps<T extends ChatModelOption> extends Omit<Compon
43
50
  id: string;
44
51
  name: string;
45
52
  currentValue: boolean;
53
+ disabled?: boolean;
54
+ title?: string;
55
+ icon?: ReactNode;
46
56
  }>;
47
57
  onBooleanChange?: (id: string, value: boolean) => void;
48
58
  selectOptions?: Array<{
@@ -54,4 +64,4 @@ export interface ModelSelectProps<T extends ChatModelOption> extends Omit<Compon
54
64
  }>;
55
65
  t: (key: "model.loadingModels" | "model.switchProvider" | "model.moreModels" | "model.selectModel" | "model.switchModel" | "model.noModelsAvailable") => string;
56
66
  }
57
- export declare function ModelSelect<T extends ChatModelOption>({ value: selectedModel, onChange: setSelectedModel, models: currentProviderModels, modelGroups, providerMenu, header, className, condensed, stripLabelPrefix, showDescription, showModelList, loading, switching, isLoading, effortConfig, booleanOptions, onBooleanChange, selectOptions, t, ...props }: ModelSelectProps<T>): import("react").JSX.Element;
67
+ export declare function ModelSelect<T extends ChatModelOption>({ value: selectedModel, onChange: setSelectedModel, models: currentProviderModels, modelGroups, compactCatalog, effortPresentation, unavailableEffort, providerMenu, header, className, condensed, stripLabelPrefix, showDescription, showModelList, loading, switching, isLoading, effortConfig, booleanOptions, onBooleanChange, selectOptions, t, ...props }: ModelSelectProps<T>): import("react").JSX.Element;
@@ -1 +1 @@
1
- import{jsx as e,jsxs as a,Fragment as u}from"react/jsx-runtime";import{cn as g}from"cn";import{ArrowUpRight as se,ChevronUp as T,Loader2Icon as A}from"lucide-react";import{Fragment as te,useState as F}from"react";import{Button as S}from"../ui/button.js";import{DropdownMenu as I,DropdownMenuContent as R,DropdownMenuGroup as y,DropdownMenuItem as z,DropdownMenuLabel as U,DropdownMenuSeparator as d,DropdownMenuSub as B,DropdownMenuSubContent as E,DropdownMenuSubTrigger as L,DropdownMenuTrigger as W}from"../ui/dropdown-menu.js";import{Switch as le}from"../ui/switch.js";import{Tooltip as q,TooltipContent as H,TooltipTrigger as J}from"../ui/tooltip.js";import{EffortSlider as re}from"./effort-slider.js";import{MenuRadioSelect as c}from"./menu-radio.js";function Ne({value:h,onChange:K,models:p,modelGroups:b,providerMenu:r,header:w,className:_,condensed:C,stripLabelPrefix:D,showDescription:Q,showModelList:X=!0,loading:Y,switching:M,isLoading:Z,effortConfig:t,booleanOptions:k,onBooleanChange:G,selectOptions:P=[],t:l,...x}){let[ee,ne]=F(!1),[ae,ie]=F(!1),V=(n)=>D&&n.startsWith(D)?n.slice(D.length):n;if(Y)return e("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:a(S,{variant:"ghost",disabled:!0,className:g("h-7 min-w-0 shrink gap-1.5 rounded-md px-2 text-xs font-normal",_),children:[e(A,{className:"size-3 animate-spin"}),e("span",{className:"text-muted-foreground truncate",children:l("model.loadingModels")})]})});return a("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:[r&&a(I,{open:ee,onOpenChange:ne,children:[a(q,{children:[e(J,{render:e(W,{render:a(S,{"data-testid":"provider-trigger",variant:"ghost",disabled:x.disabled,className:g("h-7 shrink-0 gap-1 rounded-md px-1.5","hover:bg-accent"),children:[r.icon,e(T,{className:"size-2.5 shrink-0 opacity-60"})]})})}),e(H,{children:l("model.switchProvider")})]}),a(R,{side:"top",align:"end",sideOffset:4,className:"z-100 min-w-[10rem]",children:[r.groups.map((n,s)=>a(te,{children:[s>0&&n.length>0&&e(d,{}),e(c,{value:r.value,onValueChange:r.onChange,options:n})]},s)),r.moreAction&&a(u,{children:[e(d,{}),a(z,{onClick:r.moreAction,className:"whitespace-nowrap",children:[e("span",{className:"min-w-0 flex-1 truncate",children:l("model.moreModels")}),e(se,{className:"size-4"})]})]})]})]}),a(I,{open:ae,onOpenChange:ie,children:[a(q,{children:[e(J,{render:e(W,{render:a(S,{"data-testid":"model-trigger","aria-busy":M,variant:"ghost",className:g("h-7 gap-1.5 rounded-md px-2 text-xs font-normal","hover:bg-accent","max-w-full min-w-0 shrink",C&&"h-7 gap-1 px-1.5 text-[11px]",_),...x,children:[e("span",{className:g("min-w-0 flex-1 truncate text-start",C&&"text-[11px]"),children:V(h.label)||l("model.selectModel")}),t&&a("span",{className:"text-muted-foreground grid shrink-0 justify-items-center",children:[e("span",{className:"invisible col-start-1 row-start-1",children:t.sizer??t.levels.reduce((n,s)=>s.name.length>n.length?s.name:n,"")}),e("span",{className:"col-start-1 row-start-1",children:t.levels.find((n)=>n.value===t.value)?.name??t.value})]}),M?e(A,{"data-testid":"model-switch-loading",className:"size-3 shrink-0 animate-spin"}):e(T,{className:g("size-3 shrink-0",C&&"size-2.5")})]})})}),e(H,{children:l("model.switchModel")})]}),a(R,{side:"top",align:"end",sideOffset:4,className:"z-100 w-auto max-w-[min(24rem,calc(100vw-1rem))] min-w-[14rem]",children:[w&&a(u,{children:[a("div",{className:"flex items-center gap-2 px-2 py-2",children:[w.icon,e("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:w.name}),w.action]}),e(d,{})]}),a(y,{children:[X&&(Z?e(z,{disabled:!0,className:"text-muted-foreground",children:l("model.loadingModels")}):p.length===0?e(z,{disabled:!0,className:"text-muted-foreground",children:l("model.noModelsAvailable")}):(()=>{let n=p.filter((i)=>!i.more),s=p.filter((i)=>i.more),O=n.length>0&&s.length>0,N=(i,m)=>({value:i.api_id,label:V(i.label),description:m?.noDescription?void 0:Q?i.description:void 0}),f=(i)=>{let m=p.find((v)=>v.api_id===i);if(m)K(m)};return a(u,{children:[b?b.map((i)=>{let m=i.models.filter((o)=>!o.more),v=i.models.filter((o)=>o.more),j=m.length>0&&v.length>0;return a(y,{children:[e(U,{className:"text-muted-foreground text-xs font-normal",children:i.name}),e(c,{value:h.api_id,onValueChange:f,itemClassName:"font-medium whitespace-nowrap",options:(j?m:i.models).map((o)=>N(o))}),j&&a(B,{children:[e(L,{className:"font-medium whitespace-nowrap",children:l("model.moreModels")}),e(E,{children:e(c,{value:h.api_id,onValueChange:f,itemClassName:"font-medium whitespace-nowrap",options:v.map((o)=>N(o,{noDescription:!0}))})})]})]},i.id)}):e(c,{value:h.api_id,onValueChange:f,itemClassName:"font-medium whitespace-nowrap",options:(O?n:p).map((i)=>N(i))}),!b&&O&&a(B,{children:[e(L,{className:"font-medium whitespace-nowrap",children:l("model.moreModels")}),e(E,{children:e(c,{value:h.api_id,onValueChange:f,itemClassName:"font-medium whitespace-nowrap",options:s.map((i)=>N(i,{noDescription:!0}))})})]})]})})()),t&&a(u,{children:[e(d,{}),e(re,{...t,disabled:x.disabled})]}),P.map((n)=>a(y,{children:[e(d,{}),e(U,{children:n.name}),e(c,{value:n.value,onValueChange:n.onChange,options:n.options,itemClassName:"whitespace-nowrap"})]},n.id)),k&&k.length>0&&a(u,{children:[!t&&e(d,{}),k.map((n)=>a("div",{className:"flex items-center justify-between gap-3 px-2 py-2.5",children:[e("span",{className:"text-sm font-medium",children:n.name}),e(le,{"aria-label":n.name,disabled:x.disabled,checked:n.currentValue,onCheckedChange:(s)=>G?.(n.id,s)})]},n.id))]})]})]})]})]})}export{Ne as ModelSelect};
1
+ import{jsx as e,jsxs as a,Fragment as o}from"react/jsx-runtime";import{cn as t}from"cn";import{ArrowUpRight as ue,ChevronUp as H,Loader2Icon as J,Zap as K}from"lucide-react";import{Fragment as oe,useState as Q}from"react";import{Button as I}from"../ui/button.js";import{DropdownMenu as X,DropdownMenuContent as Y,DropdownMenuCheckboxItem as C,DropdownMenuGroup as V,DropdownMenuItem as _,DropdownMenuLabel as R,DropdownMenuSeparator as h,DropdownMenuSub as j,DropdownMenuSubContent as O,DropdownMenuSubTrigger as S,DropdownMenuTrigger as G}from"../ui/dropdown-menu.js";import{Switch as pe}from"../ui/switch.js";import{Tooltip as E,TooltipContent as P,TooltipTrigger as ee}from"../ui/tooltip.js";import{EffortSlider as ne}from"./effort-slider.js";import{MenuRadioSelect as u}from"./menu-radio.js";function De({value:p,onChange:ae,models:g,modelGroups:f,compactCatalog:d,effortPresentation:U="slider",unavailableEffort:v,providerMenu:x,header:w,className:L,condensed:M,stripLabelPrefix:T,showDescription:ie,showModelList:le=!0,loading:se,switching:W,isLoading:de,effortConfig:i,booleanOptions:D,onBooleanChange:A,selectOptions:re=[],t:c,...m}){let[me,te]=Q(!1),[ce,he]=Q(!1),r=D?.find((n)=>n.id==="fast_mode"),F=d?D?.filter((n)=>n!==r):D,Z=(n)=>T&&n.startsWith(T)?n.slice(T.length):n;if(se)return e("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:a(I,{variant:"ghost",disabled:!0,className:t("h-7 min-w-0 shrink gap-1.5 rounded-md px-2 text-xs font-normal",L),children:[e(J,{className:"size-3 animate-spin"}),e("span",{className:"text-muted-foreground truncate",children:c("model.loadingModels")})]})});return a("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:[x&&a(X,{open:me,onOpenChange:te,children:[a(E,{children:[e(ee,{render:e(G,{render:a(I,{"data-testid":"provider-trigger",variant:"ghost",disabled:m.disabled,className:t("h-7 shrink-0 gap-1 rounded-md px-1.5","hover:bg-accent"),children:[x.icon,e(H,{className:"size-2.5 shrink-0 opacity-60"})]})})}),e(P,{children:c("model.switchProvider")})]}),a(Y,{side:"top",align:"end",sideOffset:4,className:"z-100 min-w-[10rem]",children:[x.groups.map((n,s)=>a(oe,{children:[s>0&&n.length>0&&e(h,{}),e(u,{value:x.value,onValueChange:x.onChange,options:n})]},s)),x.moreAction&&a(o,{children:[e(h,{}),a(_,{onClick:x.moreAction,className:"whitespace-nowrap",children:[e("span",{className:"min-w-0 flex-1 truncate",children:c("model.moreModels")}),e(ue,{className:"size-4"})]})]})]})]}),a(X,{open:ce,onOpenChange:he,children:[a(E,{children:[e(ee,{render:e(G,{render:a(I,{"data-testid":"model-trigger","aria-busy":W,variant:"ghost",className:t("h-7 gap-1.5 rounded-md px-2 text-xs font-normal","hover:bg-accent","max-w-full min-w-0 shrink",M&&"h-7 gap-1 px-1.5 text-[11px]",L),...m,children:[p.icon,D?.some((n)=>n.id==="fast_mode"&&n.currentValue&&!n.disabled)&&e(K,{"aria-hidden":"true",className:"size-3 shrink-0"}),e("span",{className:t("min-w-0 flex-1 truncate text-start",M&&"text-[11px]"),children:Z(p.label)||c("model.selectModel")}),i&&a("span",{className:"text-muted-foreground grid shrink-0 justify-items-center",children:[e("span",{className:"invisible col-start-1 row-start-1",children:i.sizer??i.levels.reduce((n,s)=>s.name.length>n.length?s.name:n,"")}),e("span",{className:"col-start-1 row-start-1",children:i.levels.find((n)=>n.value===i.value)?.name??i.value})]}),W?e(J,{"data-testid":"model-switch-loading",className:"size-3 shrink-0 animate-spin"}):e(H,{className:t("size-3 shrink-0",M&&"size-2.5")})]})})}),e(P,{children:c("model.switchModel")})]}),a(Y,{side:"top",align:"end",sideOffset:4,className:t("z-100 w-auto max-w-[min(24rem,calc(100vw-1rem))] min-w-[14rem]",d&&"flex h-[350px] w-80 min-w-0 flex-col overflow-hidden rounded-xl p-1.5"),children:[d&&a(o,{children:[a(V,{"data-model-menu-header":!0,className:"flex shrink-0 items-center justify-between gap-2 px-1 py-1",children:[i?U==="slider"?e("div",{role:"menuitem","aria-label":i.name,className:"min-w-0 [&>div]:justify-start [&>div]:gap-3 [&>div]:px-2 [&>div]:py-1.5",children:e(ne,{...i,disabled:m.disabled})}):a(j,{children:[a(S,{disabled:m.disabled,className:"h-8 min-w-0 flex-1 gap-2 rounded-md",children:[e("span",{children:i.name}),e("span",{className:"text-muted-foreground min-w-0 truncate text-xs",children:i.levels.find((n)=>n.value===i.value)?.name??i.value})]}),e(O,{children:e(u,{value:i.value,onValueChange:i.onChange,options:i.levels.map((n)=>({value:n.value,label:n.name}))})})]}):v?a(_,{disabled:!0,className:"h-8 min-w-0 flex-1 gap-2",children:[e("span",{children:v.name}),e("span",{className:"text-muted-foreground truncate text-xs",children:v.label})]}):e(R,{className:"min-w-0 flex-1 truncate",children:w?.name}),r&&e(C,{"aria-label":r.name,title:r.title??r.name,disabled:m.disabled||r.disabled,checked:r.currentValue,closeOnClick:!1,onCheckedChange:(n)=>A?.(r.id,n),className:t("ml-auto size-8 shrink-0 justify-center rounded-md p-0 focus:bg-transparent hover:bg-accent focus:hover:bg-accent focus-visible:bg-accent [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",r.currentValue&&!r.disabled?"text-foreground [&_svg]:fill-current":"text-muted-foreground"),children:r.icon??e(K,{className:"size-4","aria-hidden":"true"})})]}),e(h,{className:"shrink-0"})]}),w&&!d&&a(o,{children:[a("div",{className:"flex items-center gap-2 px-2 py-2",children:[w.icon,e("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:w.name}),w.action]}),e(h,{})]}),a(V,{"data-model-menu-list":d?"":void 0,className:d?"min-h-0 flex-1 overflow-y-auto overscroll-contain":void 0,children:[le&&(de?e(_,{disabled:!0,className:"text-muted-foreground",children:c("model.loadingModels")}):g.length===0?e(_,{disabled:!0,className:"text-muted-foreground",children:c("model.noModelsAvailable")}):(()=>{let n=g.filter((l)=>!l.more),s=g.filter((l)=>l.more),q=n.length>0&&s.length>0,k=(l,b)=>({disabled:m.disabled,icon:l.icon,value:l.api_id,label:Z(l.label),description:b?.noDescription?void 0:ie?l.description:void 0}),y=(l)=>{let b=g.find((z)=>z.api_id===l);if(b)ae(b)};if(d)return e(u,{value:p.api_id,onValueChange:y,itemClassName:"font-normal whitespace-nowrap",options:g.map((l)=>k(l))});return a(o,{children:[f?f.map((l)=>{let b=l.models.filter((N)=>!N.more),z=l.models.filter((N)=>N.more),B=b.length>0&&z.length>0;return a(V,{children:[e(R,{className:"text-muted-foreground text-xs font-normal",children:l.name}),e(u,{value:p.api_id,onValueChange:y,itemClassName:"font-medium whitespace-nowrap",options:(B?b:l.models).map((N)=>k(N))}),B&&a(j,{children:[e(S,{className:"font-medium whitespace-nowrap",children:c("model.moreModels")}),e(O,{children:e(u,{value:p.api_id,onValueChange:y,itemClassName:"font-medium whitespace-nowrap",options:z.map((N)=>k(N,{noDescription:!0}))})})]})]},l.id)}):e(u,{value:p.api_id,onValueChange:y,itemClassName:"font-medium whitespace-nowrap",options:(q?n:g).map((l)=>k(l))}),!f&&q&&a(j,{children:[e(S,{className:"font-medium whitespace-nowrap",children:c("model.moreModels")}),e(O,{children:e(u,{value:p.api_id,onValueChange:y,itemClassName:"font-medium whitespace-nowrap",options:s.map((l)=>k(l,{noDescription:!0}))})})]})]})})()),!d&&i&&a(o,{children:[e(h,{}),U==="menu"?a(j,{children:[a(S,{disabled:m.disabled,children:[e("span",{className:"flex-1",children:i.name}),e("span",{className:"text-muted-foreground",children:i.levels.find((n)=>n.value===i.value)?.name??i.value})]}),e(O,{children:e(u,{value:i.value,onValueChange:i.onChange,options:i.levels.map((n)=>({value:n.value,label:n.name}))})})]}):e(ne,{...i,disabled:m.disabled})]}),!d&&!i&&v&&a(o,{children:[e(h,{}),a(_,{disabled:!0,children:[e("span",{className:"flex-1",children:v.name}),e("span",{children:v.label})]})]}),re.map((n)=>a(V,{children:[e(h,{}),e(R,{children:n.name}),e(u,{value:n.value,onValueChange:n.onChange,options:n.options,itemClassName:"whitespace-nowrap"})]},n.id)),F&&F.length>0&&a(o,{children:[!i&&e(h,{}),F.map((n)=>d?a(C,{"aria-label":n.name,title:n.title,disabled:m.disabled||n.disabled,checked:n.currentValue,closeOnClick:!1,onCheckedChange:(s)=>A?.(n.id,s),className:"justify-between gap-3 py-2.5 pr-2 [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",children:[a("span",{className:"flex items-center gap-2",children:[n.icon,n.name]}),e("span",{"aria-hidden":"true",className:t("flex h-[18px] w-8 shrink-0 items-center rounded-full p-0.5",n.currentValue?"bg-primary":"bg-input"),children:e("span",{className:t("size-3.5 rounded-full bg-background shadow-xs transition-transform",n.currentValue&&"translate-x-3.5")})})]},n.id):a("div",{title:n.title,className:t("flex items-center justify-between gap-3 px-2 py-2.5",n.disabled&&"opacity-50"),children:[a("span",{className:"flex items-center gap-2 text-sm font-medium",children:[n.icon,n.name]}),e(pe,{"aria-label":n.name,disabled:m.disabled||n.disabled,checked:n.currentValue,onCheckedChange:(s)=>A?.(n.id,s)})]},n.id))]})]}),d&&w?.action&&a(o,{children:[e(h,{className:"shrink-0"}),e(V,{"data-model-menu-footer":!0,className:"shrink-0",children:w.action})]})]})]})]})}export{De as ModelSelect};
@@ -6,8 +6,9 @@ export interface PermissionModeSelectProps {
6
6
  icon: ReactNode;
7
7
  options: MenuRadioOption[];
8
8
  label: string;
9
+ header?: ReactNode;
9
10
  onValueChange: (value: string) => void;
10
11
  showLabel?: boolean;
11
12
  disabled?: boolean;
12
13
  }
13
- export declare function PermissionModeSelect({ value, currentName, icon, options, label, onValueChange, showLabel, disabled }: PermissionModeSelectProps): import("react").JSX.Element;
14
+ export declare function PermissionModeSelect({ value, currentName, icon, options, label, header, onValueChange, showLabel, disabled }: PermissionModeSelectProps): import("react").JSX.Element;
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import{ChevronUp as d}from"lucide-react";import{useState as f}from"react";import{Button as h}from"../ui/button.js";import{DropdownMenu as u,DropdownMenuContent as w,DropdownMenuTrigger as x}from"../ui/dropdown-menu.js";import{MenuRadioSelect as g}from"./menu-radio.js";function N({value:a,currentName:n,icon:s,options:t,label:r,onValueChange:i,showLabel:p=!1,disabled:l=!1}){let[m,c]=f(!1);return o(u,{open:m,onOpenChange:c,children:[e(x,{render:o(h,{disabled:l,variant:"ghost","aria-label":`${r}: ${n}`,title:n,className:"h-7 gap-1.5 px-2 text-xs font-normal whitespace-nowrap",children:[s,e("span",{className:p?"max-w-40 truncate":"hidden max-w-40 truncate @[40rem]/input-footer:inline-block",children:n}),e(d,{className:"size-3 shrink-0"})]})}),e(w,{align:"start",sideOffset:4,className:"z-100 w-auto min-w-[20rem]",children:e(g,{value:a,onValueChange:i,itemClassName:"px-3 py-2.5 whitespace-nowrap",options:t})})]})}export{N as PermissionModeSelect};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as c}from"react";import{Button as x}from"../ui/button.js";import{DropdownMenu as f,DropdownMenuContent as g,DropdownMenuTrigger as h}from"../ui/dropdown-menu.js";import{MenuRadioSelect as w}from"./menu-radio.js";function D({value:a,currentName:n,icon:r,options:p,label:s,header:o,onValueChange:i,showLabel:l=!1,disabled:d=!1}){let[m,u]=c(!1);return t(f,{open:m,onOpenChange:u,children:[e(h,{render:t(x,{disabled:d,variant:"ghost","aria-label":`${s}: ${n}`,title:n,className:"h-7 gap-1.5 rounded-full bg-transparent px-2 text-xs font-normal whitespace-nowrap text-muted-foreground data-popup-open:bg-transparent data-popup-open:hover:bg-muted",children:[r,e("span",{className:l?"max-w-40 truncate":"hidden max-w-40 truncate @[40rem]/input-footer:inline-block",children:n})]})}),t(g,{align:"start",sideOffset:4,className:"permission-mode-menu z-100 w-auto min-w-72 max-w-[calc(100vw-2rem)] rounded-xl p-1.5",children:[o&&e("div",{className:"flex items-center px-1.5 pt-0.5 pb-1 text-[11px] leading-4 text-muted-foreground",children:e("span",{children:o})}),e(w,{value:a,onValueChange:i,itemClassName:"items-center gap-2 py-1 pr-6 pl-2 whitespace-nowrap",options:p})]})]})}export{D as PermissionModeSelect};
@@ -9,5 +9,6 @@ export type PromptInputTextareaHandle = {
9
9
  resetHeight: () => void;
10
10
  focus: () => void;
11
11
  getTextarea: () => HTMLTextAreaElement | null;
12
+ isComposing: () => boolean;
12
13
  };
13
14
  export declare const PromptInputTextarea: import("react").ForwardRefExoticComponent<Omit<PromptInputTextareaProps, "ref"> & import("react").RefAttributes<PromptInputTextareaHandle>>;
@@ -1,3 +1,3 @@
1
- import{jsx as D}from"react/jsx-runtime";import{cn as E}from"cn";import{forwardRef as P,useCallback as R,useEffect as F,useImperativeHandle as A,useRef as m}from"react";import{InputGroupTextarea as H}from"../ui/input-group-textarea.js";import{clipboardHasStringItem as j,sanitizeTextareaTargetValue as g,scanClipboardForImageFiles as q}from"./prompt-input-clipboard.js";import{useOptionalPromptInputController as z,usePromptInputAttachments as N}from"./prompt-input-context.js";var B=(o)=>!o.shiftKey,K=()=>!1,V=P(({onChange:o,className:v,placeholder:x,bashMode:y=!1,isSendShortcut:I=B,isNewlineShortcut:b=K,...k},T)=>{let n=z(),i=N(),l=m(!1),u=m(!1),a=m(null),s=R(()=>{let t=a.current;if(!t)return;t.style.height="auto",t.style.height=`${t.scrollHeight}px`},[]);F(()=>{let t=a.current;if(!t)return;let e=new ResizeObserver(()=>{requestAnimationFrame(s)});return e.observe(t),()=>e.disconnect()},[s]);let p=y&&(n?.textInput.value??"").startsWith("!"),C=(t)=>{if(l.current||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||u.current)return;if(t.key.length===1&&t.key.charCodeAt(0)<32&&t.key!==`
2
- `&&t.key!=="\r"&&t.key!=="\t"){t.preventDefault();return}if(p&&n){let e=t.currentTarget.selectionStart===0&&t.currentTarget.selectionEnd===0;if(t.key==="Escape"||(t.key==="Backspace"||t.key==="Delete")&&e){t.preventDefault(),n.textInput.setInput(n.textInput.value.slice(1));return}}if(t.key==="Enter"){if(b(t.nativeEvent)){t.preventDefault();let e=t.currentTarget,{selectionStart:r,selectionEnd:f,value:c}=e,h=`${c.slice(0,r)}
3
- ${c.slice(f)}`;if(n)n.textInput.setInput(h);else e.value=h;let d=r+1;e.setSelectionRange(d,d),s();return}if(I(t.nativeEvent)){t.preventDefault();let e=t.currentTarget.form;if(!e)return;let r=e.querySelector('button[type="submit"]');if(!r||r.disabled)return;e.requestSubmit(r)}}if(t.key==="Backspace"&&t.currentTarget.value===""&&i.files.length>0){t.preventDefault();let e=i.files.at(-1);if(e)i.remove(e.id)}},S=(t)=>{let e=t.clipboardData?.items;if(!e)return;let{imageFiles:r,sawNonImageFile:f}=q(e),c=j(e);if(r.length>0)t.preventDefault(),i.add(r);else if(f&&!c)t.preventDefault()},w=n?{value:p?n.textInput.value.slice(1):n.textInput.value,onChange:(t)=>{let e=g(t.currentTarget);n.textInput.setInput(p?`!${e}`:e),s(),o?.(t)}}:{onChange:(t)=>{g(t.currentTarget),s(),o?.(t)}};return A(T,()=>({resetHeight:()=>{if(a.current)a.current.style.height="auto"},focus:()=>{a.current?.focus()},getTextarea:()=>a.current}),[]),D(H,{"data-chat-input":!0,ref:a,rows:3,className:E("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",v),name:"message",onCompositionEnd:()=>{l.current=!1,u.current=!0,requestAnimationFrame(()=>{u.current=!1})},onCompositionStart:()=>{u.current=!1,l.current=!0},onKeyDown:C,onPaste:S,placeholder:x,...k,...w})});V.displayName="PromptInputTextarea";export{V as PromptInputTextarea};
1
+ import{jsx as P}from"react/jsx-runtime";import{cn as R}from"cn";import{forwardRef as F,useCallback as A,useEffect as H,useImperativeHandle as j,useRef as m}from"react";import{InputGroupTextarea as q}from"../ui/input-group-textarea.js";import{clipboardHasStringItem as z,sanitizeTextareaTargetValue as h,scanClipboardForImageFiles as N}from"./prompt-input-clipboard.js";import{useOptionalPromptInputController as B,usePromptInputAttachments as K}from"./prompt-input-context.js";var V=(i)=>!i.shiftKey,O=()=>!1,G=F(({onChange:i,onCompositionStart:v,onCompositionEnd:x,className:I,placeholder:y,bashMode:b=!1,isSendShortcut:T=V,isNewlineShortcut:k=O,...C},S)=>{let n=B(),c=K(),s=m(!1),u=m(!1),r=m(null),o=A(()=>{let t=r.current;if(!t||s.current)return;t.style.height="auto",t.style.height=`${t.scrollHeight}px`},[]);H(()=>{let t=r.current;if(!t)return;let e=new ResizeObserver(()=>{requestAnimationFrame(o)});return e.observe(t),()=>e.disconnect()},[o]);let l=b&&(n?.textInput.value??"").startsWith("!"),w=(t)=>{if(s.current||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||u.current)return;if(t.key.length===1&&t.key.charCodeAt(0)<32&&t.key!==`
2
+ `&&t.key!=="\r"&&t.key!=="\t"){t.preventDefault();return}if(l&&n){let e=t.currentTarget.selectionStart===0&&t.currentTarget.selectionEnd===0;if(t.key==="Escape"||(t.key==="Backspace"||t.key==="Delete")&&e){t.preventDefault(),n.textInput.setInput(n.textInput.value.slice(1));return}}if(t.key==="Enter"){if(k(t.nativeEvent)){t.preventDefault();let e=t.currentTarget,{selectionStart:a,selectionEnd:f,value:p}=e,g=`${p.slice(0,a)}
3
+ ${p.slice(f)}`;if(n)n.textInput.setInput(g);else e.value=g;let d=a+1;e.setSelectionRange(d,d),o();return}if(T(t.nativeEvent)){t.preventDefault();let e=t.currentTarget.form;if(!e)return;let a=e.querySelector('button[type="submit"]');if(!a||a.disabled)return;e.requestSubmit(a)}}if(t.key==="Backspace"&&t.currentTarget.value===""&&c.files.length>0){t.preventDefault();let e=c.files.at(-1);if(e)c.remove(e.id)}},D=(t)=>{let e=t.clipboardData?.items;if(!e)return;let{imageFiles:a,sawNonImageFile:f}=N(e),p=z(e);if(a.length>0)t.preventDefault(),c.add(a);else if(f&&!p)t.preventDefault()},E=n?{value:s.current&&r.current?r.current.value:l?n.textInput.value.slice(1):n.textInput.value,onChange:(t)=>{let e=s.current?t.currentTarget.value:h(t.currentTarget);n.textInput.setInput(l?`!${e}`:e),o(),i?.(t)}}:{onChange:(t)=>{if(!s.current)h(t.currentTarget);o(),i?.(t)}};return j(S,()=>({resetHeight:()=>{if(r.current)r.current.style.height="auto"},focus:()=>{r.current?.focus()},isComposing:()=>s.current||u.current,getTextarea:()=>r.current}),[]),P(q,{"data-chat-input":!0,ref:r,rows:3,className:R("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",I),name:"message",onCompositionEnd:(t)=>{s.current=!1;let e=h(t.currentTarget);n?.textInput.setInput(l?`!${e}`:e),o(),x?.(t),u.current=!0,requestAnimationFrame(()=>{u.current=!1})},onCompositionStart:(t)=>{u.current=!1,s.current=!0,v?.(t)},onKeyDown:w,onPaste:D,placeholder:y,...C,...E})});G.displayName="PromptInputTextarea";export{G as PromptInputTextarea};
package/dist/locales.d.ts CHANGED
@@ -1,5 +1,15 @@
1
1
  export declare const chatLocales: {
2
2
  readonly ar: {
3
+ readonly asyncQuestion: {
4
+ readonly other: "أخرى";
5
+ readonly answer: "اكتب إجابتك";
6
+ readonly submit: "إرسال الإجابة";
7
+ readonly submitting: "جارٍ الإرسال…";
8
+ readonly skip: "تخطي";
9
+ readonly skipped: "تم التخطي";
10
+ readonly closed: "انتهت هذه الجولة";
11
+ readonly unavailable: "أعد الاتصال للإجابة";
12
+ };
3
13
  readonly stream: {
4
14
  readonly codex: {
5
15
  readonly worked: "تمت المعالجة";
@@ -108,6 +118,16 @@ export declare const chatLocales: {
108
118
  };
109
119
  };
110
120
  readonly de: {
121
+ readonly asyncQuestion: {
122
+ readonly other: "Andere";
123
+ readonly answer: "Antwort eingeben";
124
+ readonly submit: "Antwort senden";
125
+ readonly submitting: "Wird gesendet…";
126
+ readonly skip: "Überspringen";
127
+ readonly skipped: "Übersprungen";
128
+ readonly closed: "Dieser Schritt ist beendet";
129
+ readonly unavailable: "Zum Antworten erneut verbinden";
130
+ };
111
131
  readonly stream: {};
112
132
  readonly message: {
113
133
  readonly thinking: "Denkt nach";
@@ -125,6 +145,16 @@ export declare const chatLocales: {
125
145
  };
126
146
  };
127
147
  readonly en: {
148
+ readonly asyncQuestion: {
149
+ readonly other: "Other";
150
+ readonly answer: "Type your answer";
151
+ readonly submit: "Submit answer";
152
+ readonly submitting: "Submitting…";
153
+ readonly skip: "Skip";
154
+ readonly skipped: "Skipped";
155
+ readonly closed: "This turn has ended";
156
+ readonly unavailable: "Reconnect to answer";
157
+ };
128
158
  readonly stream: {
129
159
  readonly codex: {
130
160
  readonly viewedImages_one: "Viewed {{count}} image";
@@ -341,6 +371,16 @@ export declare const chatLocales: {
341
371
  };
342
372
  };
343
373
  readonly es: {
374
+ readonly asyncQuestion: {
375
+ readonly other: "Otra";
376
+ readonly answer: "Escribe tu respuesta";
377
+ readonly submit: "Enviar respuesta";
378
+ readonly submitting: "Enviando…";
379
+ readonly skip: "Omitir";
380
+ readonly skipped: "Omitida";
381
+ readonly closed: "Este turno ha terminado";
382
+ readonly unavailable: "Vuelve a conectarte para responder";
383
+ };
344
384
  readonly stream: {};
345
385
  readonly message: {
346
386
  readonly thinking: "Pensando";
@@ -358,6 +398,16 @@ export declare const chatLocales: {
358
398
  };
359
399
  };
360
400
  readonly fr: {
401
+ readonly asyncQuestion: {
402
+ readonly other: "Autre";
403
+ readonly answer: "Saisissez votre réponse";
404
+ readonly submit: "Envoyer la réponse";
405
+ readonly submitting: "Envoi…";
406
+ readonly skip: "Ignorer";
407
+ readonly skipped: "Ignorée";
408
+ readonly closed: "Ce tour est terminé";
409
+ readonly unavailable: "Reconnectez-vous pour répondre";
410
+ };
361
411
  readonly stream: {};
362
412
  readonly message: {
363
413
  readonly thinking: "Réflexion";
@@ -375,6 +425,16 @@ export declare const chatLocales: {
375
425
  };
376
426
  };
377
427
  readonly hi: {
428
+ readonly asyncQuestion: {
429
+ readonly other: "अन्य";
430
+ readonly answer: "अपना उत्तर लिखें";
431
+ readonly submit: "उत्तर भेजें";
432
+ readonly submitting: "भेजा जा रहा है…";
433
+ readonly skip: "छोड़ें";
434
+ readonly skipped: "छोड़ दिया गया";
435
+ readonly closed: "यह चरण समाप्त हो गया";
436
+ readonly unavailable: "उत्तर देने के लिए फिर जुड़ें";
437
+ };
378
438
  readonly stream: {};
379
439
  readonly message: {
380
440
  readonly thinking: "सोच रहा है";
@@ -392,6 +452,16 @@ export declare const chatLocales: {
392
452
  };
393
453
  };
394
454
  readonly id: {
455
+ readonly asyncQuestion: {
456
+ readonly other: "Lainnya";
457
+ readonly answer: "Ketik jawaban Anda";
458
+ readonly submit: "Kirim jawaban";
459
+ readonly submitting: "Mengirim…";
460
+ readonly skip: "Lewati";
461
+ readonly skipped: "Dilewati";
462
+ readonly closed: "Giliran ini telah berakhir";
463
+ readonly unavailable: "Hubungkan kembali untuk menjawab";
464
+ };
395
465
  readonly stream: {};
396
466
  readonly message: {
397
467
  readonly thinking: "Berpikir";
@@ -409,6 +479,16 @@ export declare const chatLocales: {
409
479
  };
410
480
  };
411
481
  readonly it: {
482
+ readonly asyncQuestion: {
483
+ readonly other: "Altro";
484
+ readonly answer: "Scrivi la risposta";
485
+ readonly submit: "Invia risposta";
486
+ readonly submitting: "Invio…";
487
+ readonly skip: "Salta";
488
+ readonly skipped: "Saltata";
489
+ readonly closed: "Questo turno è terminato";
490
+ readonly unavailable: "Riconnettiti per rispondere";
491
+ };
412
492
  readonly stream: {};
413
493
  readonly message: {
414
494
  readonly thinking: "Sto pensando";
@@ -426,6 +506,16 @@ export declare const chatLocales: {
426
506
  };
427
507
  };
428
508
  readonly ja: {
509
+ readonly asyncQuestion: {
510
+ readonly other: "その他";
511
+ readonly answer: "回答を入力";
512
+ readonly submit: "回答を送信";
513
+ readonly submitting: "送信中…";
514
+ readonly skip: "スキップ";
515
+ readonly skipped: "スキップ済み";
516
+ readonly closed: "このターンは終了しました";
517
+ readonly unavailable: "再接続して回答";
518
+ };
429
519
  readonly stream: {};
430
520
  readonly message: {
431
521
  readonly thinking: "考え中";
@@ -443,6 +533,16 @@ export declare const chatLocales: {
443
533
  };
444
534
  };
445
535
  readonly ko: {
536
+ readonly asyncQuestion: {
537
+ readonly other: "기타";
538
+ readonly answer: "답변 입력";
539
+ readonly submit: "답변 제출";
540
+ readonly submitting: "제출 중…";
541
+ readonly skip: "건너뛰기";
542
+ readonly skipped: "건너뜀";
543
+ readonly closed: "이 턴이 종료되었습니다";
544
+ readonly unavailable: "다시 연결하여 답변";
545
+ };
446
546
  readonly stream: {};
447
547
  readonly message: {
448
548
  readonly thinking: "생각 중";
@@ -460,6 +560,16 @@ export declare const chatLocales: {
460
560
  };
461
561
  };
462
562
  readonly "pt-BR": {
563
+ readonly asyncQuestion: {
564
+ readonly other: "Outra";
565
+ readonly answer: "Digite sua resposta";
566
+ readonly submit: "Enviar resposta";
567
+ readonly submitting: "Enviando…";
568
+ readonly skip: "Pular";
569
+ readonly skipped: "Ignorada";
570
+ readonly closed: "Este turno terminou";
571
+ readonly unavailable: "Reconecte para responder";
572
+ };
463
573
  readonly stream: {};
464
574
  readonly message: {
465
575
  readonly thinking: "Pensando";
@@ -477,6 +587,16 @@ export declare const chatLocales: {
477
587
  };
478
588
  };
479
589
  readonly ru: {
590
+ readonly asyncQuestion: {
591
+ readonly other: "Другое";
592
+ readonly answer: "Введите ответ";
593
+ readonly submit: "Отправить ответ";
594
+ readonly submitting: "Отправка…";
595
+ readonly skip: "Пропустить";
596
+ readonly skipped: "Пропущено";
597
+ readonly closed: "Этот ход завершён";
598
+ readonly unavailable: "Подключитесь снова для ответа";
599
+ };
480
600
  readonly stream: {};
481
601
  readonly message: {
482
602
  readonly thinking: "Думаю";
@@ -494,6 +614,16 @@ export declare const chatLocales: {
494
614
  };
495
615
  };
496
616
  readonly "zh-CN": {
617
+ readonly asyncQuestion: {
618
+ readonly other: "其他";
619
+ readonly answer: "输入你的回答";
620
+ readonly submit: "提交回答";
621
+ readonly submitting: "正在提交…";
622
+ readonly skip: "跳过";
623
+ readonly skipped: "已跳过";
624
+ readonly closed: "本轮对话已结束";
625
+ readonly unavailable: "重新连接后可回答";
626
+ };
497
627
  readonly stream: {
498
628
  readonly codex: {
499
629
  readonly viewedImages_one: "已查看 {{count}} 张图像";
package/dist/locales.js CHANGED
@@ -1 +1 @@
1
- var n={ar:{stream:{codex:{worked:"تمت المعالجة",workedFor:"تمت المعالجة لمدة {{duration}}",totalDuration:"المدة الإجمالية {{duration}}",editedFilesCount_one:"تم تعديل {{count}} ملف",editedFilesCount_other:"تم تعديل {{count}} ملفات",viewChanges:"عرض التغييرات",hideChanges:"إخفاء التغييرات",showMoreFiles:"عرض {{count}} ملفات أخرى",showFewerFiles:"عرض ملفات أقل",changedLines:"الأسطر المتغيرة",showMore:"عرض المزيد",showLess:"عرض أقل",thought:"تم التفكير",thoughtFor:"تم التفكير لمدة {{duration}}",running:"جارٍ التشغيل",ran:"تم التشغيل",runningCommand:"جارٍ تشغيل الأمر",ranCommandGeneric:"تم تشغيل الأمر",searching:"جارٍ البحث",searched:"تم البحث",forDetail:"عن {{detail}}",searchingFiles:"جارٍ البحث في الملفات",searchedFiles:"تم البحث في الملفات",searchingWeb:"جارٍ البحث في الويب",searchedWeb:"تم البحث في الويب",readLabel:"تمت قراءة",readFiles:"تمت قراءة الملفات",editingLabel:"جارٍ تعديل",editedLabel:"تم تعديل",editingFiles:"جارٍ تعديل الملفات",editedFiles:"تم تعديل الملفات",deletingLabel:"جارٍ حذف",deletedLabel:"تم حذف",deletingFiles:"جارٍ حذف الملفات",deletedFiles:"تم حذف الملفات",movingLabel:"جارٍ نقل",movedLabel:"تم نقل",movingFiles:"جارٍ نقل الملفات",movedFiles:"تم نقل الملفات",subagentWorking:"بدأ {{name}} العمل",subagentFinished:"أنهى {{name}} العمل",contextCompacted:"تم ضغط السياق",audioOutput:"مخرج صوتي",exitCode:"رمز الخروج {{code}}",summary:{read:{leading:"تمت قراءة الملفات",following:"وقراءة الملفات"},edit:{leading:"تم تعديل الملفات",following:"وتعديل الملفات"},delete:{leading:"تم حذف الملفات",following:"وحذف الملفات"},move:{leading:"تم نقل الملفات",following:"ونقل الملفات"},search:{leading:"تم البحث في الملفات",following:"والبحث في الملفات"},execute:{leading_one:"تم تشغيل أمر",leading_other:"تم تشغيل أوامر",following_one:"وتشغيل أمر",following_other:"وتشغيل أوامر"},fetch:{leading:"تم البحث في الويب",following:"والبحث في الويب"},mcp:{leading_one:"تم استدعاء أداة",leading_other:"تم استدعاء أدوات",following_one:"واستدعاء أداة",following_other:"واستدعاء أدوات"},other:{leading_one:"تم استدعاء أداة",leading_other:"تم استدعاء أدوات",following_one:"واستدعاء أداة",following_other:"واستدعاء أدوات"}}}},message:{thinking:"التفكير"},actions:{copy:"ينسخ"},model:{loadingModels:"جارٍ تحميل النماذج...",switchProvider:"مزود التبديل",moreModels:"المزيد من النماذج",selectModel:"حدد النموذج",switchModel:"نموذج التبديل",noModelsAvailable:"لا توجد نماذج متاحة"}},de:{stream:{},message:{thinking:"Denkt nach"},actions:{copy:"Kopieren"},model:{loadingModels:"Lädt Modelle...",switchProvider:"Provider wechseln",moreModels:"Mehr Modelle",selectModel:"Modell auswählen",switchModel:"Modell wechseln",noModelsAvailable:"Keine Modelle verfügbar"}},en:{stream:{codex:{viewedImages_one:"Viewed {{count}} image",viewedImages_other:"Viewed {{count}} images",imageLoading:"Loading image",imageFailed:"Unable to load image. Retry",worked:"Worked",workedFor:"Worked for {{duration}}",totalDuration:"Total time {{duration}}",editedFilesCount_one:"Edited {{count}} file",editedFilesCount_other:"Edited {{count}} files",viewChanges:"View changes",hideChanges:"Hide changes",showMoreFiles:"Show {{count}} more files",showFewerFiles:"Show fewer files",changedLines:"Changed lines",showMore:"Show more",showLess:"Show less",thought:"Thought",thoughtFor:"Thought for {{duration}}",running:"Running",ran:"Ran",runningCommand:"Running command",ranCommandGeneric:"Ran command",searching:"Searching",searched:"Searched",forDetail:"for {{detail}}",searchingFiles:"Searching for files",searchedFiles:"Searched for files",searchingWeb:"Searching the web",searchedWeb:"Searched the web",readLabel:"Read",readFiles:"Read files",editingLabel:"Editing",editedLabel:"Edited",editingFiles:"Editing files",editedFiles:"Edited files",deletingLabel:"Deleting",deletedLabel:"Deleted",deletingFiles:"Deleting files",deletedFiles:"Deleted files",movingLabel:"Moving",movedLabel:"Moved",movingFiles:"Moving files",movedFiles:"Moved files",subagentWorking:"{{name}} started working",subagentFinished:"{{name}} finished",subagentInterrupted:"{{name}} interrupted",subagentUpdated:"{{name}} updated",subagentMessaged:"Sent message to {{name}}",subagentOpen:"Open {{name}} subagent",reasoningEffort:{none:"None",minimal:"Minimal",low:"Light",medium:"Medium",high:"High",xhigh:"Extra high",max:"Max",ultra:"Ultra",persistent:"Persistent"},collab:{interrupted:"Interrupted",agentCount_one:" an agent",agentCount_other:" {{count}} agents",header:{spawn:{inProgress:"Creating",completed:"Created",failed:"Failed to create"},message:{inProgress:"Messaging",completed:"Messaged",failed:"Failed to message"},interrupt:{inProgress:"Interrupting",completed:"Interrupted",failed:"Failed to interrupt"},list:{inProgress:"Listing",completed:"Listed",failed:"Failed to list"},resume:{inProgress:"Resuming",completed:"Resumed",failed:"Failed to resume"},close:{inProgress:"Closing",completed:"Closed",failed:"Failed to close"}},row:{spawn:{inProgress:"Creating",completed:"Created",failed:"Failed creating"},message:{inProgress:"Messaging",completed:"Messaged",failed:"Failed messaging"},interrupt:{inProgress:"Interrupting",completed:"Interrupted",failed:"Failed to interrupt"},list:{inProgress:"Listing",completed:"Listed",failed:"Failed to list"},resume:{inProgress:"Resuming",completed:"Resumed",failed:"Failed resuming"},close:{inProgress:"Closing",completed:"Closed",failed:"Failed closing"}},messaged:{inProgress:"Messaging",completed:"Messaged",failed:"Failed to message"},createdWithInstructions:"Created {{agent}} with the instructions: {{instructions}}",messagedWithPrompt:"{{action}} {{agent}}: {{prompt}}",agentRow:"{{action}} {{agent}}{{state}}",input:"Input: {{prompt}}",stateOnly:" ({{state}})",stateWithMessage:" ({{state}}: {{message}})",state:{pendingInit:"pending init",running:"running",interrupted:"interrupted",shutdown:"shutdown",completed:"completed",errored:"errored",notFound:"not found"}},contextCompacted:"Context compacted",audioOutput:"Audio output",exitCode:"Exit code {{code}}",summary:{read:{leading:"Read files",following:"read files"},edit:{leading:"Edited files",following:"edited files"},delete:{leading:"Deleted files",following:"deleted files"},move:{leading:"Moved files",following:"moved files"},search:{leading:"Searched files",following:"searched files"},execute:{leading_one:"Ran a command",leading_other:"Ran commands",following_one:"ran a command",following_other:"ran commands"},fetch:{leading:"Searched the web",following:"searched the web"},mcp:{leading_one:"Called a tool",leading_other:"Called tools",following_one:"called a tool",following_other:"called tools"},other:{leading_one:"Called a tool",leading_other:"Called tools",following_one:"called a tool",following_other:"called tools"}}}},message:{thinking:"Thinking"},actions:{copy:"Copy"},model:{loadingModels:"Loading models...",switchProvider:"Switch provider",moreModels:"More models",selectModel:"Select model",switchModel:"Switch model",noModelsAvailable:"No models available"}},es:{stream:{},message:{thinking:"Pensando"},actions:{copy:"Copiar"},model:{loadingModels:"Cargando modelos...",switchProvider:"Cambiar provider",moreModels:"Más modelos",selectModel:"Seleccionar modelo",switchModel:"Cambiar modelo",noModelsAvailable:"No hay modelos disponibles"}},fr:{stream:{},message:{thinking:"Réflexion"},actions:{copy:"Copier"},model:{loadingModels:"Chargement des modèles...",switchProvider:"Changer de provider",moreModels:"Plus de modèles",selectModel:"Sélectionner un modèle",switchModel:"Changer de modèle",noModelsAvailable:"Aucun modèle disponible"}},hi:{stream:{},message:{thinking:"सोच रहा है"},actions:{copy:"कॉपी करें"},model:{loadingModels:"मॉडल लोड हो रहे हैं...",switchProvider:"Provider बदलें",moreModels:"और मॉडल",selectModel:"मॉडल चुनें",switchModel:"मॉडल बदलें",noModelsAvailable:"कोई मॉडल उपलब्ध नहीं"}},id:{stream:{},message:{thinking:"Berpikir"},actions:{copy:"Salin"},model:{loadingModels:"Memuat model...",switchProvider:"Ganti provider",moreModels:"Model lainnya",selectModel:"Pilih model",switchModel:"Ganti model",noModelsAvailable:"Tidak ada model tersedia"}},it:{stream:{},message:{thinking:"Sto pensando"},actions:{copy:"Copia"},model:{loadingModels:"Caricamento modelli...",switchProvider:"Cambia provider",moreModels:"Altri modelli",selectModel:"Seleziona modello",switchModel:"Cambia modello",noModelsAvailable:"Nessun modello disponibile"}},ja:{stream:{},message:{thinking:"考え中"},actions:{copy:"コピー"},model:{loadingModels:"モデルを読み込み中...",switchProvider:"プロバイダーを切り替え",moreModels:"その他のモデル",selectModel:"モデルを選択",switchModel:"モデルを切り替え",noModelsAvailable:"利用可能なモデルがありません"}},ko:{stream:{},message:{thinking:"생각 중"},actions:{copy:"복사"},model:{loadingModels:"모델 로드 중...",switchProvider:"프로바이더 전환",moreModels:"더 많은 모델",selectModel:"모델 선택",switchModel:"모델 전환",noModelsAvailable:"사용 가능한 모델이 없습니다"}},"pt-BR":{stream:{},message:{thinking:"Pensando"},actions:{copy:"Copiar"},model:{loadingModels:"Carregando modelos...",switchProvider:"Mudar provider",moreModels:"Mais modelos",selectModel:"Selecionar modelo",switchModel:"Mudar modelo",noModelsAvailable:"Nenhum modelo disponível"}},ru:{stream:{},message:{thinking:"Думаю"},actions:{copy:"Копировать"},model:{loadingModels:"Загрузка моделей...",switchProvider:"Переключить provider",moreModels:"Больше моделей",selectModel:"Выбрать модель",switchModel:"Переключить модель",noModelsAvailable:"Нет доступных моделей"}},"zh-CN":{stream:{codex:{viewedImages_one:"已查看 {{count}} 张图像",viewedImages_other:"已查看 {{count}} 张图像",imageLoading:"正在加载图像",imageFailed:"无法加载图像,点击重试",worked:"已处理",workedFor:"已处理 {{duration}}",totalDuration:"用时 {{duration}}",editedFilesCount_one:"已编辑 {{count}} 个文件",editedFilesCount_other:"已编辑 {{count}} 个文件",viewChanges:"查看更改",hideChanges:"收起更改",showMoreFiles:"显示其余 {{count}} 个文件",showFewerFiles:"收起文件",changedLines:"更改行数",showMore:"展开显示",showLess:"收起显示",thought:"已思考",thoughtFor:"思考了 {{duration}}",running:"正在运行",ran:"已运行",runningCommand:"正在运行命令",ranCommandGeneric:"已运行命令",searching:"正在搜索",searched:"已搜索",forDetail:"{{detail}}",searchingFiles:"正在搜索文件",searchedFiles:"已搜索文件",searchingWeb:"正在搜索网页",searchedWeb:"已搜索网页",readLabel:"已读取",readFiles:"已读取文件",editingLabel:"正在编辑",editedLabel:"已编辑",editingFiles:"正在编辑文件",editedFiles:"已编辑文件",deletingLabel:"正在删除",deletedLabel:"已删除",deletingFiles:"正在删除文件",deletedFiles:"已删除文件",movingLabel:"正在移动",movedLabel:"已移动",movingFiles:"正在移动文件",movedFiles:"已移动文件",subagentWorking:"{{name}} 开始工作",subagentFinished:"{{name}} 已完成",subagentInterrupted:"{{name}} 已中断",subagentUpdated:"{{name}} 已更新",subagentMessaged:"已向 {{name}} 发送消息",subagentOpen:"打开子智能体 {{name}}",reasoningEffort:{none:"无",minimal:"最低",low:"轻度",medium:"中",high:"高",xhigh:"极高",max:"最大",ultra:"Ultra",persistent:"持续"},collab:{interrupted:"已中断",agentCount_one:" {{count}} 个智能体",agentCount_other:" {{count}} 个智能体",header:{spawn:{inProgress:"创建中",completed:"已创建",failed:"创建失败"},message:{inProgress:"正在发送消息",completed:"已发送消息",failed:"无法发送消息"},interrupt:{inProgress:"正在中断",completed:"已中断",failed:"中断未成功"},list:{inProgress:"正在列出",completed:"已列出",failed:"列出未成功"},resume:{inProgress:"正在恢复",completed:"已恢复",failed:"无法恢复"},close:{inProgress:"正在关闭",completed:"已关闭",failed:"无法关闭"}},row:{spawn:{inProgress:"创建中",completed:"已创建",failed:"创建失败"},message:{inProgress:"正在发送消息",completed:"已发送消息",failed:"无法发送消息"},interrupt:{inProgress:"正在中断",completed:"已中断",failed:"中断未成功"},list:{inProgress:"正在列出",completed:"已列出",failed:"列出未成功"},resume:{inProgress:"正在恢复",completed:"已恢复",failed:"无法恢复"},close:{inProgress:"正在关闭",completed:"已关闭",failed:"无法关闭"}},messaged:{inProgress:"正在发送消息",completed:"已发送消息",failed:"无法发送消息"},createdWithInstructions:"已使用以下指令创建 {{agent}}:{{instructions}}",messagedWithPrompt:"{{action}} {{agent}}:{{prompt}}",agentRow:"{{action}} {{agent}}{{state}}",input:"输入:{{prompt}}",stateOnly:"({{state}})",stateWithMessage:"({{state}}:{{message}})",state:{pendingInit:"待定初始化",running:"正在运行",interrupted:"已中断",shutdown:"关闭",completed:"已完成",errored:"出错",notFound:"找不到"}},contextCompacted:"上下文已压缩",audioOutput:"音频输出",exitCode:"退出码 {{code}}",summary:{read:{leading:"已读取文件",following:"读取了文件"},edit:{leading:"已编辑文件",following:"编辑了文件"},delete:{leading:"已删除文件",following:"删除了文件"},move:{leading:"已移动文件",following:"移动了文件"},search:{leading:"已搜索文件",following:"搜索了文件"},execute:{leading_one:"已运行命令",leading_other:"已运行命令",following_one:"运行了命令",following_other:"运行了命令"},fetch:{leading:"已搜索网页",following:"搜索了网页"},mcp:{leading_one:"已调用工具",leading_other:"已调用工具",following_one:"调用了工具",following_other:"调用了工具"},other:{leading_one:"已调用工具",leading_other:"已调用工具",following_one:"调用了工具",following_other:"调用了工具"}}}},message:{thinking:"正在思考"},actions:{copy:"复制"},model:{loadingModels:"加载模型中...",switchProvider:"切换服务商",moreModels:"更多模型",selectModel:"选择模型",switchModel:"切换模型",noModelsAvailable:"暂无可用模型"}}};function d(e){let o={...e};for(let[i,l]of Object.entries(n))o[i]={...e[i],alwithChat:l};return o}export{n as chatLocales,d as withChatResources};
1
+ var t={ar:{asyncQuestion:{other:"أخرى",answer:"اكتب إجابتك",submit:"إرسال الإجابة",submitting:"جارٍ الإرسال…",skip:"تخطي",skipped:"تم التخطي",closed:"انتهت هذه الجولة",unavailable:"أعد الاتصال للإجابة"},stream:{codex:{worked:"تمت المعالجة",workedFor:"تمت المعالجة لمدة {{duration}}",totalDuration:"المدة الإجمالية {{duration}}",editedFilesCount_one:"تم تعديل {{count}} ملف",editedFilesCount_other:"تم تعديل {{count}} ملفات",viewChanges:"عرض التغييرات",hideChanges:"إخفاء التغييرات",showMoreFiles:"عرض {{count}} ملفات أخرى",showFewerFiles:"عرض ملفات أقل",changedLines:"الأسطر المتغيرة",showMore:"عرض المزيد",showLess:"عرض أقل",thought:"تم التفكير",thoughtFor:"تم التفكير لمدة {{duration}}",running:"جارٍ التشغيل",ran:"تم التشغيل",runningCommand:"جارٍ تشغيل الأمر",ranCommandGeneric:"تم تشغيل الأمر",searching:"جارٍ البحث",searched:"تم البحث",forDetail:"عن {{detail}}",searchingFiles:"جارٍ البحث في الملفات",searchedFiles:"تم البحث في الملفات",searchingWeb:"جارٍ البحث في الويب",searchedWeb:"تم البحث في الويب",readLabel:"تمت قراءة",readFiles:"تمت قراءة الملفات",editingLabel:"جارٍ تعديل",editedLabel:"تم تعديل",editingFiles:"جارٍ تعديل الملفات",editedFiles:"تم تعديل الملفات",deletingLabel:"جارٍ حذف",deletedLabel:"تم حذف",deletingFiles:"جارٍ حذف الملفات",deletedFiles:"تم حذف الملفات",movingLabel:"جارٍ نقل",movedLabel:"تم نقل",movingFiles:"جارٍ نقل الملفات",movedFiles:"تم نقل الملفات",subagentWorking:"بدأ {{name}} العمل",subagentFinished:"أنهى {{name}} العمل",contextCompacted:"تم ضغط السياق",audioOutput:"مخرج صوتي",exitCode:"رمز الخروج {{code}}",summary:{read:{leading:"تمت قراءة الملفات",following:"وقراءة الملفات"},edit:{leading:"تم تعديل الملفات",following:"وتعديل الملفات"},delete:{leading:"تم حذف الملفات",following:"وحذف الملفات"},move:{leading:"تم نقل الملفات",following:"ونقل الملفات"},search:{leading:"تم البحث في الملفات",following:"والبحث في الملفات"},execute:{leading_one:"تم تشغيل أمر",leading_other:"تم تشغيل أوامر",following_one:"وتشغيل أمر",following_other:"وتشغيل أوامر"},fetch:{leading:"تم البحث في الويب",following:"والبحث في الويب"},mcp:{leading_one:"تم استدعاء أداة",leading_other:"تم استدعاء أدوات",following_one:"واستدعاء أداة",following_other:"واستدعاء أدوات"},other:{leading_one:"تم استدعاء أداة",leading_other:"تم استدعاء أدوات",following_one:"واستدعاء أداة",following_other:"واستدعاء أدوات"}}}},message:{thinking:"التفكير"},actions:{copy:"ينسخ"},model:{loadingModels:"جارٍ تحميل النماذج...",switchProvider:"مزود التبديل",moreModels:"المزيد من النماذج",selectModel:"حدد النموذج",switchModel:"نموذج التبديل",noModelsAvailable:"لا توجد نماذج متاحة"}},de:{asyncQuestion:{other:"Andere",answer:"Antwort eingeben",submit:"Antwort senden",submitting:"Wird gesendet…",skip:"Überspringen",skipped:"Übersprungen",closed:"Dieser Schritt ist beendet",unavailable:"Zum Antworten erneut verbinden"},stream:{},message:{thinking:"Denkt nach"},actions:{copy:"Kopieren"},model:{loadingModels:"Lädt Modelle...",switchProvider:"Provider wechseln",moreModels:"Mehr Modelle",selectModel:"Modell auswählen",switchModel:"Modell wechseln",noModelsAvailable:"Keine Modelle verfügbar"}},en:{asyncQuestion:{other:"Other",answer:"Type your answer",submit:"Submit answer",submitting:"Submitting…",skip:"Skip",skipped:"Skipped",closed:"This turn has ended",unavailable:"Reconnect to answer"},stream:{codex:{viewedImages_one:"Viewed {{count}} image",viewedImages_other:"Viewed {{count}} images",imageLoading:"Loading image",imageFailed:"Unable to load image. Retry",worked:"Worked",workedFor:"Worked for {{duration}}",totalDuration:"Total time {{duration}}",editedFilesCount_one:"Edited {{count}} file",editedFilesCount_other:"Edited {{count}} files",viewChanges:"View changes",hideChanges:"Hide changes",showMoreFiles:"Show {{count}} more files",showFewerFiles:"Show fewer files",changedLines:"Changed lines",showMore:"Show more",showLess:"Show less",thought:"Thought",thoughtFor:"Thought for {{duration}}",running:"Running",ran:"Ran",runningCommand:"Running command",ranCommandGeneric:"Ran command",searching:"Searching",searched:"Searched",forDetail:"for {{detail}}",searchingFiles:"Searching for files",searchedFiles:"Searched for files",searchingWeb:"Searching the web",searchedWeb:"Searched the web",readLabel:"Read",readFiles:"Read files",editingLabel:"Editing",editedLabel:"Edited",editingFiles:"Editing files",editedFiles:"Edited files",deletingLabel:"Deleting",deletedLabel:"Deleted",deletingFiles:"Deleting files",deletedFiles:"Deleted files",movingLabel:"Moving",movedLabel:"Moved",movingFiles:"Moving files",movedFiles:"Moved files",subagentWorking:"{{name}} started working",subagentFinished:"{{name}} finished",subagentInterrupted:"{{name}} interrupted",subagentUpdated:"{{name}} updated",subagentMessaged:"Sent message to {{name}}",subagentOpen:"Open {{name}} subagent",reasoningEffort:{none:"None",minimal:"Minimal",low:"Light",medium:"Medium",high:"High",xhigh:"Extra high",max:"Max",ultra:"Ultra",persistent:"Persistent"},collab:{interrupted:"Interrupted",agentCount_one:" an agent",agentCount_other:" {{count}} agents",header:{spawn:{inProgress:"Creating",completed:"Created",failed:"Failed to create"},message:{inProgress:"Messaging",completed:"Messaged",failed:"Failed to message"},interrupt:{inProgress:"Interrupting",completed:"Interrupted",failed:"Failed to interrupt"},list:{inProgress:"Listing",completed:"Listed",failed:"Failed to list"},resume:{inProgress:"Resuming",completed:"Resumed",failed:"Failed to resume"},close:{inProgress:"Closing",completed:"Closed",failed:"Failed to close"}},row:{spawn:{inProgress:"Creating",completed:"Created",failed:"Failed creating"},message:{inProgress:"Messaging",completed:"Messaged",failed:"Failed messaging"},interrupt:{inProgress:"Interrupting",completed:"Interrupted",failed:"Failed to interrupt"},list:{inProgress:"Listing",completed:"Listed",failed:"Failed to list"},resume:{inProgress:"Resuming",completed:"Resumed",failed:"Failed resuming"},close:{inProgress:"Closing",completed:"Closed",failed:"Failed closing"}},messaged:{inProgress:"Messaging",completed:"Messaged",failed:"Failed to message"},createdWithInstructions:"Created {{agent}} with the instructions: {{instructions}}",messagedWithPrompt:"{{action}} {{agent}}: {{prompt}}",agentRow:"{{action}} {{agent}}{{state}}",input:"Input: {{prompt}}",stateOnly:" ({{state}})",stateWithMessage:" ({{state}}: {{message}})",state:{pendingInit:"pending init",running:"running",interrupted:"interrupted",shutdown:"shutdown",completed:"completed",errored:"errored",notFound:"not found"}},contextCompacted:"Context compacted",audioOutput:"Audio output",exitCode:"Exit code {{code}}",summary:{read:{leading:"Read files",following:"read files"},edit:{leading:"Edited files",following:"edited files"},delete:{leading:"Deleted files",following:"deleted files"},move:{leading:"Moved files",following:"moved files"},search:{leading:"Searched files",following:"searched files"},execute:{leading_one:"Ran a command",leading_other:"Ran commands",following_one:"ran a command",following_other:"ran commands"},fetch:{leading:"Searched the web",following:"searched the web"},mcp:{leading_one:"Called a tool",leading_other:"Called tools",following_one:"called a tool",following_other:"called tools"},other:{leading_one:"Called a tool",leading_other:"Called tools",following_one:"called a tool",following_other:"called tools"}}}},message:{thinking:"Thinking"},actions:{copy:"Copy"},model:{loadingModels:"Loading models...",switchProvider:"Switch provider",moreModels:"More models",selectModel:"Select model",switchModel:"Switch model",noModelsAvailable:"No models available"}},es:{asyncQuestion:{other:"Otra",answer:"Escribe tu respuesta",submit:"Enviar respuesta",submitting:"Enviando…",skip:"Omitir",skipped:"Omitida",closed:"Este turno ha terminado",unavailable:"Vuelve a conectarte para responder"},stream:{},message:{thinking:"Pensando"},actions:{copy:"Copiar"},model:{loadingModels:"Cargando modelos...",switchProvider:"Cambiar provider",moreModels:"Más modelos",selectModel:"Seleccionar modelo",switchModel:"Cambiar modelo",noModelsAvailable:"No hay modelos disponibles"}},fr:{asyncQuestion:{other:"Autre",answer:"Saisissez votre réponse",submit:"Envoyer la réponse",submitting:"Envoi…",skip:"Ignorer",skipped:"Ignorée",closed:"Ce tour est terminé",unavailable:"Reconnectez-vous pour répondre"},stream:{},message:{thinking:"Réflexion"},actions:{copy:"Copier"},model:{loadingModels:"Chargement des modèles...",switchProvider:"Changer de provider",moreModels:"Plus de modèles",selectModel:"Sélectionner un modèle",switchModel:"Changer de modèle",noModelsAvailable:"Aucun modèle disponible"}},hi:{asyncQuestion:{other:"अन्य",answer:"अपना उत्तर लिखें",submit:"उत्तर भेजें",submitting:"भेजा जा रहा है…",skip:"छोड़ें",skipped:"छोड़ दिया गया",closed:"यह चरण समाप्त हो गया",unavailable:"उत्तर देने के लिए फिर जुड़ें"},stream:{},message:{thinking:"सोच रहा है"},actions:{copy:"कॉपी करें"},model:{loadingModels:"मॉडल लोड हो रहे हैं...",switchProvider:"Provider बदलें",moreModels:"और मॉडल",selectModel:"मॉडल चुनें",switchModel:"मॉडल बदलें",noModelsAvailable:"कोई मॉडल उपलब्ध नहीं"}},id:{asyncQuestion:{other:"Lainnya",answer:"Ketik jawaban Anda",submit:"Kirim jawaban",submitting:"Mengirim…",skip:"Lewati",skipped:"Dilewati",closed:"Giliran ini telah berakhir",unavailable:"Hubungkan kembali untuk menjawab"},stream:{},message:{thinking:"Berpikir"},actions:{copy:"Salin"},model:{loadingModels:"Memuat model...",switchProvider:"Ganti provider",moreModels:"Model lainnya",selectModel:"Pilih model",switchModel:"Ganti model",noModelsAvailable:"Tidak ada model tersedia"}},it:{asyncQuestion:{other:"Altro",answer:"Scrivi la risposta",submit:"Invia risposta",submitting:"Invio…",skip:"Salta",skipped:"Saltata",closed:"Questo turno è terminato",unavailable:"Riconnettiti per rispondere"},stream:{},message:{thinking:"Sto pensando"},actions:{copy:"Copia"},model:{loadingModels:"Caricamento modelli...",switchProvider:"Cambia provider",moreModels:"Altri modelli",selectModel:"Seleziona modello",switchModel:"Cambia modello",noModelsAvailable:"Nessun modello disponibile"}},ja:{asyncQuestion:{other:"その他",answer:"回答を入力",submit:"回答を送信",submitting:"送信中…",skip:"スキップ",skipped:"スキップ済み",closed:"このターンは終了しました",unavailable:"再接続して回答"},stream:{},message:{thinking:"考え中"},actions:{copy:"コピー"},model:{loadingModels:"モデルを読み込み中...",switchProvider:"プロバイダーを切り替え",moreModels:"その他のモデル",selectModel:"モデルを選択",switchModel:"モデルを切り替え",noModelsAvailable:"利用可能なモデルがありません"}},ko:{asyncQuestion:{other:"기타",answer:"답변 입력",submit:"답변 제출",submitting:"제출 중…",skip:"건너뛰기",skipped:"건너뜀",closed:"이 턴이 종료되었습니다",unavailable:"다시 연결하여 답변"},stream:{},message:{thinking:"생각 중"},actions:{copy:"복사"},model:{loadingModels:"모델 로드 중...",switchProvider:"프로바이더 전환",moreModels:"더 많은 모델",selectModel:"모델 선택",switchModel:"모델 전환",noModelsAvailable:"사용 가능한 모델이 없습니다"}},"pt-BR":{asyncQuestion:{other:"Outra",answer:"Digite sua resposta",submit:"Enviar resposta",submitting:"Enviando…",skip:"Pular",skipped:"Ignorada",closed:"Este turno terminou",unavailable:"Reconecte para responder"},stream:{},message:{thinking:"Pensando"},actions:{copy:"Copiar"},model:{loadingModels:"Carregando modelos...",switchProvider:"Mudar provider",moreModels:"Mais modelos",selectModel:"Selecionar modelo",switchModel:"Mudar modelo",noModelsAvailable:"Nenhum modelo disponível"}},ru:{asyncQuestion:{other:"Другое",answer:"Введите ответ",submit:"Отправить ответ",submitting:"Отправка…",skip:"Пропустить",skipped:"Пропущено",closed:"Этот ход завершён",unavailable:"Подключитесь снова для ответа"},stream:{},message:{thinking:"Думаю"},actions:{copy:"Копировать"},model:{loadingModels:"Загрузка моделей...",switchProvider:"Переключить provider",moreModels:"Больше моделей",selectModel:"Выбрать модель",switchModel:"Переключить модель",noModelsAvailable:"Нет доступных моделей"}},"zh-CN":{asyncQuestion:{other:"其他",answer:"输入你的回答",submit:"提交回答",submitting:"正在提交…",skip:"跳过",skipped:"已跳过",closed:"本轮对话已结束",unavailable:"重新连接后可回答"},stream:{codex:{viewedImages_one:"已查看 {{count}} 张图像",viewedImages_other:"已查看 {{count}} 张图像",imageLoading:"正在加载图像",imageFailed:"无法加载图像,点击重试",worked:"已处理",workedFor:"已处理 {{duration}}",totalDuration:"用时 {{duration}}",editedFilesCount_one:"已编辑 {{count}} 个文件",editedFilesCount_other:"已编辑 {{count}} 个文件",viewChanges:"查看更改",hideChanges:"收起更改",showMoreFiles:"显示其余 {{count}} 个文件",showFewerFiles:"收起文件",changedLines:"更改行数",showMore:"展开显示",showLess:"收起显示",thought:"已思考",thoughtFor:"思考了 {{duration}}",running:"正在运行",ran:"已运行",runningCommand:"正在运行命令",ranCommandGeneric:"已运行命令",searching:"正在搜索",searched:"已搜索",forDetail:"{{detail}}",searchingFiles:"正在搜索文件",searchedFiles:"已搜索文件",searchingWeb:"正在搜索网页",searchedWeb:"已搜索网页",readLabel:"已读取",readFiles:"已读取文件",editingLabel:"正在编辑",editedLabel:"已编辑",editingFiles:"正在编辑文件",editedFiles:"已编辑文件",deletingLabel:"正在删除",deletedLabel:"已删除",deletingFiles:"正在删除文件",deletedFiles:"已删除文件",movingLabel:"正在移动",movedLabel:"已移动",movingFiles:"正在移动文件",movedFiles:"已移动文件",subagentWorking:"{{name}} 开始工作",subagentFinished:"{{name}} 已完成",subagentInterrupted:"{{name}} 已中断",subagentUpdated:"{{name}} 已更新",subagentMessaged:"已向 {{name}} 发送消息",subagentOpen:"打开子智能体 {{name}}",reasoningEffort:{none:"无",minimal:"最低",low:"轻度",medium:"中",high:"高",xhigh:"极高",max:"最大",ultra:"Ultra",persistent:"持续"},collab:{interrupted:"已中断",agentCount_one:" {{count}} 个智能体",agentCount_other:" {{count}} 个智能体",header:{spawn:{inProgress:"创建中",completed:"已创建",failed:"创建失败"},message:{inProgress:"正在发送消息",completed:"已发送消息",failed:"无法发送消息"},interrupt:{inProgress:"正在中断",completed:"已中断",failed:"中断未成功"},list:{inProgress:"正在列出",completed:"已列出",failed:"列出未成功"},resume:{inProgress:"正在恢复",completed:"已恢复",failed:"无法恢复"},close:{inProgress:"正在关闭",completed:"已关闭",failed:"无法关闭"}},row:{spawn:{inProgress:"创建中",completed:"已创建",failed:"创建失败"},message:{inProgress:"正在发送消息",completed:"已发送消息",failed:"无法发送消息"},interrupt:{inProgress:"正在中断",completed:"已中断",failed:"中断未成功"},list:{inProgress:"正在列出",completed:"已列出",failed:"列出未成功"},resume:{inProgress:"正在恢复",completed:"已恢复",failed:"无法恢复"},close:{inProgress:"正在关闭",completed:"已关闭",failed:"无法关闭"}},messaged:{inProgress:"正在发送消息",completed:"已发送消息",failed:"无法发送消息"},createdWithInstructions:"已使用以下指令创建 {{agent}}:{{instructions}}",messagedWithPrompt:"{{action}} {{agent}}:{{prompt}}",agentRow:"{{action}} {{agent}}{{state}}",input:"输入:{{prompt}}",stateOnly:"({{state}})",stateWithMessage:"({{state}}:{{message}})",state:{pendingInit:"待定初始化",running:"正在运行",interrupted:"已中断",shutdown:"关闭",completed:"已完成",errored:"出错",notFound:"找不到"}},contextCompacted:"上下文已压缩",audioOutput:"音频输出",exitCode:"退出码 {{code}}",summary:{read:{leading:"已读取文件",following:"读取了文件"},edit:{leading:"已编辑文件",following:"编辑了文件"},delete:{leading:"已删除文件",following:"删除了文件"},move:{leading:"已移动文件",following:"移动了文件"},search:{leading:"已搜索文件",following:"搜索了文件"},execute:{leading_one:"已运行命令",leading_other:"已运行命令",following_one:"运行了命令",following_other:"运行了命令"},fetch:{leading:"已搜索网页",following:"搜索了网页"},mcp:{leading_one:"已调用工具",leading_other:"已调用工具",following_one:"调用了工具",following_other:"调用了工具"},other:{leading_one:"已调用工具",leading_other:"已调用工具",following_one:"调用了工具",following_other:"调用了工具"}}}},message:{thinking:"正在思考"},actions:{copy:"复制"},model:{loadingModels:"加载模型中...",switchProvider:"切换服务商",moreModels:"更多模型",selectModel:"选择模型",switchModel:"切换模型",noModelsAvailable:"暂无可用模型"}}};function s(e){let i={...e};for(let[o,n]of Object.entries(t))i[o]={...e[o],alwithChat:n};return i}export{t as chatLocales,s as withChatResources};
package/package.json CHANGED
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "name": "@alwith/module-chat",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
7
+ "./async-question-card": {
8
+ "types": "./dist/codex/async-question-card.d.ts",
9
+ "import": "./dist/codex/async-question-card.js",
10
+ "default": "./dist/codex/async-question-card.js"
11
+ },
7
12
  "./update-scheduler": {
8
13
  "types": "./dist/lib/update-scheduler.d.ts",
9
14
  "import": "./dist/lib/update-scheduler.js",