@alwith/module-chat 0.1.10 → 0.1.11

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.
@@ -1,6 +1,6 @@
1
- import{jsx as n,jsxs as u,Fragment as j}from"react/jsx-runtime";import{useActivityHost as A,ActivityMarkdown as P}from"../activity-host.js";import{CheckIcon as Y,CopyIcon as K,GitBranchIcon as ee}from"lucide-react";import{useEffect as M,useRef as T,useState as E}from"react";import{cn as v}from"cn";import{describeToolUse as D}from"../lib/stream-style.js";import{useCodexDisclosureState as Z}from"./disclosure-state.js";import{CodexPlan as te}from"./plan.js";function W(e,t){let[a,i]=E(()=>({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 R=new WeakMap,k=1;function w(e){if(e.type==="tool_use"||e.type==="subagent")return`${e.type}:${e.id}`;if(e.type==="thinking"&&e.id!==void 0)return`thinking:${e.id}`;let t=R.get(e);if(t!==void 0)return`${e.type}:${t}`;let a=k;return k+=1,R.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 S(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 c=Intl.DurationFormat;if(c)try{return new c(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 ne="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 V({expanded:e,className:t}){return n("svg",{className:v("codex-activity-disclosure",e&&"codex-activity-disclosure-expanded",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:ne})})}function ie(){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 ae(){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 re(){return u("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 oe(){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 de(){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 q({block:e}){if(e.type!=="tool_use")return null;let t=D(e).category;if(t==="read")return n(ie,{});if(t==="search"||t==="fetch")return n(ae,{});if(t==="execute")return n(re,{});if(t==="edit")return n(oe,{});return n(de,{})}function I(e,t){let a=e.rawInput[t];return typeof a==="string"&&a.length>0?a:void 0}function ce(e){return D(e).target}function H(e){return e.name.startsWith("mcp__")||e.name.startsWith("mcp_")}function G(e,t){let{category:a}=D(e),i=ce(e),r=N(e.status);if(H(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 se(e,t){let a=G(e,t);return a.trailing===void 0?a.leading:`${a.leading} ${a.trailing}`}function le(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 ue(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 fe(e){if(typeof e==="string"&&e.length>0)return e;return}function xe(e){return e.type==="diff"}function pe(e){let t=e.content.find(xe);if(t===void 0)return;return t.changes.map((a)=>`${a.operation} ${a.path}`).join(`
4
- `)}function z(e){let t=fe(e.rawOutput);if(t!==void 0)return t;let a=le(e.content);if(a.length>0)return a;return pe(e)}function Ce({block:e,command:t}){let{t:a,Output:i,commandStatus:r}=A(),[o,c]=E(!1),[d,l]=E(!1),f=z(e),C=r===void 0?e.exitCode===void 0?void 0:a("stream.codex.exitCode",{code:e.exitCode}):r(e),s=()=>{navigator.clipboard.writeText([`$ ${t}`,f].filter((x)=>x!==void 0).join(`
5
- `)),c(!0),setTimeout(()=>c(!1),1500)};return n("div",{className:"codex-command-details",children:u("div",{className:"codex-command-card",children:[u("div",{className:"codex-command-line-row",children:[n("span",{className:"codex-command-prompt","aria-hidden":"true",children:"$"}),n("button",{type:"button",className:v("codex-command-line",!d&&"codex-command-line-clamped"),"data-codex-disclosure":"","aria-expanded":d,onClick:()=>l((x)=>!x),children:t}),n("button",{type:"button",className:"codex-command-copy","aria-label":a("actions.copy"),onClick:s,children:o?n(Y,{}):n(K,{})})]}),f!==void 0&&(i===void 0?n("pre",{className:"codex-command-output",children:f}):n(i,{text:f})),C!==void 0&&n("div",{className:"codex-command-footer",children:n("span",{className:"codex-command-status",children:C})})]})})}function U({block:e}){let{t,openLink:a,Patch:i,openImage:r,commandStatus:o,expandToolOutput:c=!1}=A(),d=z(e),l=i===void 0?void 0:e.content.flatMap((p)=>{if(p.type!=="diff")return[];let _=p;return _.patch?.text?[_.patch.text]:[]}).join(`
6
- `),f=ue(e.content),C=me(e.content),[s,x]=Z(`tool:${e.id}`,!1),g=W(`tool:${e.id}`,s),h=D(e),y=h.category,m=G(e,t),b=y==="execute"?I(e,"command"):void 0,L=b!==void 0||H(e)||f.length>0||C.length>0||Boolean(l)||c&&d!==void 0,F=!L&&!N(e.status)?h.filePath:void 0;if(y==="execute"&&!N(e.status)&&e.status!=="completed"){let p=o?.(e);if(p)m={...m,leading:p}}if(y==="read"&&N(e.status))return null;let B=u("span",{className:"codex-activity-label",children:[n(q,{block:e}),n("span",{className:"min-w-0 flex-1 truncate",children:N(e.status)?n("span",{className:"codex-activity-running",children:m.trailing===void 0?m.leading:`${m.leading} ${m.trailing}`}):u(j,{children:[n("span",{className:"codex-activity-leading",children:m.leading}),m.trailing!==void 0&&(F!==void 0?u(j,{children:[" ",n("button",{type:"button",className:"codex-activity-trailing codex-activity-file-link",title:F,onClick:()=>a(F),children:m.trailing})]}):u("span",{className:"codex-activity-trailing",children:[" ",m.trailing]}))]})})]});return u("div",{className:"codex-activity-item",children:[L?u("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-label":m.trailing===void 0?m.leading:`${m.leading} ${m.trailing}`,"aria-expanded":s,onClick:()=>x((p)=>!p),children:[B,n(V,{expanded:s})]}):n("div",{className:"codex-activity-header codex-activity-header-static",children:B}),n("div",{className:v("codex-activity-details-grid",s&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:g&&u(j,{children:[b!==void 0?n(Ce,{block:e,command:b}):i!==void 0&&l?n(i,{patch:l}):d!==void 0&&n("pre",{className:"codex-activity-details",children:d}),f.length>0&&n("div",{className:"codex-activity-media",children:f.map((p)=>{let _=`data:${p.mimeType};base64,${p.data}`,O=n("img",{src:_,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},`${p.mimeType}:${p.data.slice(0,32)}`);return r===void 0?O:n("button",{type:"button",className:"cursor-pointer",onClick:()=>r(_),children:O},_)})}),C.map((p)=>n("audio",{className:"mt-1 w-full","aria-label":t("stream.codex.audioOutput"),controls:!0,src:`data:${p.mimeType};base64,${p.data}`},`${p.mimeType}:${p.data.slice(0,32)}`))]})})})]})}function J({block:e}){if(e.type==="tool_use")return n(U,{block:e});if(e.type==="thinking")return n(X,{block:e});return n(Q,{block:e})}function Q({block:e}){let{t}=A(),a=N(e.status),[i,r]=Z(`subagent:${e.id}`,a),o=T(a);M(()=>{if(a)r(!0);if(o.current&&!a)r(!1);o.current=a},[a,r]);let c=e.blocks.length>0;return u("div",{className:"codex-activity-item",children:[u("button",{type:"button",className:v("codex-activity-header",!c&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":c?i:void 0,disabled:!c,onClick:()=>r((d)=>!d),children:[u("span",{className:"codex-activity-label",children:[n(ee,{className:"size-4 shrink-0","aria-hidden":"true"}),n("span",{className:"min-w-0 flex-1 truncate",children:a?n("span",{className:"codex-activity-running",children:t("stream.codex.subagentWorking",{name:e.name})}):t("stream.codex.subagentFinished",{name:e.name})})]}),c&&n(V,{expanded:i})]}),n("div",{className:v("codex-activity-details-grid",i&&"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((d)=>{if(d.type==="tool_use")return n(U,{block:d},d.id);if(d.type==="thinking")return n(X,{block:d},w(d));if(d.type==="subagent")return n(Q,{block:d},d.id);if(d.type==="text")return n("div",{className:"codex-reasoning-details",children:n(P,{text:d.text,streaming:!1})},w(d));if(d.type==="plan")return n(te,{entries:d.entries},w(d));if(d.type==="image")return n("img",{src:`data:${d.source.media_type};base64,${d.source.data}`,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},w(d));return null})})})})]})}function X({block:e}){let{t,i18n:a}=A(),i=Boolean(e.isComplete),[r,o]=Z(`thinking:${w(e)}:${i?"complete":"streaming"}`,!i),c=T(i),d=T(null);M(()=>{if(!i)o(!0);if(!c.current&&i)o(!1);c.current=i},[i,o]);let l=e.thinking.trim().length>0;M(()=>{if(i||!l)return;let s=d.current;if(s===null)throw Error("Thinking details are not mounted");let x=new ResizeObserver(()=>{s.scrollTop=s.scrollHeight}),g=null,h=()=>{let m=s.firstElementChild;if(m===g)return;if(g!==null)x.unobserve(g);if(g=m,g!==null)x.observe(g)},y=new MutationObserver(h);return y.observe(s,{childList:!0}),h(),()=>{y.disconnect(),x.disconnect()}},[l,i]);let f=i?e.durationMs!==void 0?t("stream.codex.thoughtFor",{duration:S(e.durationMs,a.language)}):t("stream.codex.thought"):t("message.thinking"),C=e.thinking.trimStart().replace(/^\*\*[^\n]*?\*\*\s*/,"");return u("div",{className:"codex-activity-item",children:[u("button",{type:"button",className:v("codex-activity-header",!l&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":l?r:void 0,disabled:!l,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?f:n("span",{className:"codex-activity-running",children:f})})}),l&&n(V,{expanded:r})]}),n("div",{className:v("codex-activity-details-grid",r&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:l&&n("div",{ref:d,className:"codex-reasoning-details",role:"region","aria-label":f,"aria-hidden":!r,tabIndex:0,inert:!r,children:n(P,{text:C,streaming:!i})})})})]})}function ge(e){if(H(e))return"mcp";let t=D(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 ye(e,t,a){let i=new Map;for(let o of e){let c=ge(o);i.set(c,(i.get(c)??0)+1)}let r=Array.from(i,([o,c],d)=>he(o,c,d===0,t));if(a.startsWith("zh"))return r.join("");return new Intl.ListFormat(a,{style:"long",type:"conjunction"}).format(r)}function Be({stateKey:e,durationMs:t,durationKind:a="work",active:i,startedAt:r,providerId:o,providerIcon:c,children:d}){let{t:l,i18n:f}=A(),[C,s]=Z(`work:${e}`,i),x=W(`work:${e}`,C||i),g=T(i),h=T(null),[y,m]=E(0);M(()=>{if(i)s(!0);if(g.current&&!i)s(!1);g.current=i},[i,s]),M(()=>{if(!i||t!==void 0){h.current=null;return}h.current=r??Date.now();let L=()=>{let B=h.current;if(B===null)throw Error("Codex work section is ticking without a start time");m(Date.now()-B)};L();let F=window.setInterval(L,1000);return()=>window.clearInterval(F)},[i,r,t]);let b=t!==void 0?l(a==="total"?"stream.codex.totalDuration":"stream.codex.workedFor",{duration:S(t,f.language)}):i&&y>=1000?l("stream.codex.workedFor",{duration:S(y,f.language)}):l("stream.codex.worked");return u("section",{className:"codex-work-section",children:[u("button",{type:"button",className:"codex-work-trigger","data-codex-disclosure":"","aria-expanded":C,onClick:()=>s((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:c}),n("span",{children:b}),n(V,{expanded:C,className:"codex-work-chevron"})]}),n("div",{className:"codex-work-separator","aria-hidden":"true"}),n("div",{className:v("codex-work-grid",C&&"codex-work-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-work-body",children:x&&d})})})]})}function ve(e,t){if(e.type==="tool_use")return se(e,t);if(e.type==="thinking")return t("message.thinking");return t("stream.codex.subagentWorking",{name:e.name})}function Le(e){if(e.type==="thinking")return!e.isComplete;if(e.type==="tool_use"||e.type==="subagent")return N(e.status);return!1}function we(e,t=1000){let[a,i]=E(e),r=T(Date.now());return M(()=>{if(e===a)return;let o=Date.now(),c=Math.max(0,r.current+t-o);if(c===0){r.current=o,i(e);return}let d=window.setTimeout(()=>{r.current=Date.now(),i(e)},c);return()=>window.clearTimeout(d)},[a,t,e]),a}function Ne({blocks:e}){let{t,i18n:a}=A(),i=e.some(Le),r=e.map(w).join(":"),[o,c]=Z(`group:${r}`,i),d=W(`group:${r}`,o||i),l=T(i);M(()=>{if(i)c(!0);if(l.current&&!i)c(!1);l.current=i},[i,c]);let f=e.at(-1);if(f===void 0)throw Error("CodexActivityGroup requires at least one activity block");let C=e.filter((x)=>x.type==="tool_use"),s=we(i?ve(f,t):ye(C,t,a.language));return u("div",{className:"codex-activity-group",children:[u("button",{type:"button",className:"codex-activity-group-trigger","aria-expanded":o,onClick:()=>c((x)=>!x),children:[u("span",{className:"codex-activity-label",children:[n(q,{block:e[0]}),n("span",{className:"truncate",children:i?n("span",{className:"codex-activity-running",children:s}):s})]}),n(V,{expanded:o})]}),n("div",{className:v("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:d&&e.map((x)=>n(J,{block:x},w(x)))})})})]})}function Ee({blocks:e}){if(e.length===0)throw Error("CodexActivityGroup requires at least one activity block");if(e.length===1)return n(J,{block:e[0]});return n(Ne,{blocks:e})}export{Ee as CodexActivityGroup,Be as CodexWorkSection};
1
+ import{jsx as n,jsxs as l,Fragment as O}from"react/jsx-runtime";import{useActivityHost as L,ActivityMarkdown as Q}from"../activity-host.js";import{CheckIcon as de,CopyIcon as ce,GitBranchIcon as X}from"lucide-react";import{Fragment as le,useEffect as A,useRef as b,useState as D}from"react";import{cn as C}from"cn";import{formatModelName as q}from"../lib/model-name.js";import{describeToolUse as V}from"../lib/stream-style.js";import{useCodexDisclosureState as _}from"./disclosure-state.js";import{CodexPlan as ue}from"./plan.js";function H(e,t){let[a,i]=D(()=>({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 z=new WeakMap,U=1;function M(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=z.get(e);if(t!==void 0)return`${e.type}:${t}`;let a=U;return U+=1,z.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 W(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 me="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:C("codex-activity-disclosure",e&&"codex-activity-disclosure-expanded",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:me})})}function pe(){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 fe(){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 xe(){return l("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 ge(){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 he(){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 Y({block:e}){if(e.type!=="tool_use")return null;let t=V(e).category;if(t==="read")return n(pe,{});if(t==="search"||t==="fetch")return n(fe,{});if(t==="execute")return n(xe,{});if(t==="edit")return n(ge,{});return n(he,{})}function I(e,t){let a=e.rawInput[t];return typeof a==="string"&&a.length>0?a:void 0}function Ce(e){return V(e).target}function P(e){return e.name.startsWith("mcp__")||e.name.startsWith("mcp_")}function K(e,t){let{category:a}=V(e),i=Ce(e),r=w(e.status);if(P(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 ye(e,t){let a=K(e,t);return a.trailing===void 0?a.leading:`${a.leading} ${a.trailing}`}function ve(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 we(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 Le(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 Ne(e){if(typeof e==="string"&&e.length>0)return e;return}function $e(e){return e.type==="diff"}function Me(e){let t=e.content.find($e);if(t===void 0)return;return t.changes.map((a)=>`${a.operation} ${a.path}`).join(`
4
+ `)}function k(e){let t=Ne(e.rawOutput);if(t!==void 0)return t;let a=ve(e.content);if(a.length>0)return a;return Me(e)}function Ae({block:e,command:t}){let{t:a,Output:i,commandStatus:r}=L(),[o,d]=D(!1),[s,c]=D(!1),m=k(e),g=r===void 0?e.exitCode===void 0?void 0:a("stream.codex.exitCode",{code:e.exitCode}):r(e),u=()=>{navigator.clipboard.writeText([`$ ${t}`,m].filter((f)=>f!==void 0).join(`
5
+ `)),d(!0),setTimeout(()=>d(!1),1500)};return n("div",{className:"codex-command-details",children:l("div",{className:"codex-command-card",children:[l("div",{className:"codex-command-line-row",children:[n("span",{className:"codex-command-prompt","aria-hidden":"true",children:"$"}),n("button",{type:"button",className:C("codex-command-line",!s&&"codex-command-line-clamped"),"data-codex-disclosure":"","aria-expanded":s,onClick:()=>c((f)=>!f),children:t}),n("button",{type:"button",className:"codex-command-copy","aria-label":a("actions.copy"),onClick:u,children:o?n(de,{}):n(ce,{})})]}),m!==void 0&&(i===void 0?n("pre",{className:"codex-command-output",children:m}):n(i,{text:m})),g!==void 0&&n("div",{className:"codex-command-footer",children:n("span",{className:"codex-command-status",children:g})})]})})}function ee({block:e}){let{t,openLink:a,Patch:i,openImage:r,commandStatus:o,expandToolOutput:d=!1}=L(),s=k(e),c=i===void 0?void 0:e.content.flatMap((x)=>{if(x.type!=="diff")return[];let T=x;return T.patch?.text?[T.patch.text]:[]}).join(`
6
+ `),m=we(e.content),g=Le(e.content),[u,f]=_(`tool:${e.id}`,!1),h=H(`tool:${e.id}`,u),y=V(e),v=y.category,p=K(e,t),F=v==="execute"?I(e,"command"):void 0,N=F!==void 0||P(e)||m.length>0||g.length>0||Boolean(c)||d&&s!==void 0,S=!N&&!w(e.status)?y.filePath:void 0;if(v==="execute"&&!w(e.status)&&e.status!=="completed"){let x=o?.(e);if(x)p={...p,leading:x}}if(v==="read"&&w(e.status))return null;let B=l("span",{className:"codex-activity-label",children:[n(Y,{block:e}),n("span",{className:"min-w-0 flex-1 truncate",children:w(e.status)?n("span",{className:"codex-activity-running",children:p.trailing===void 0?p.leading:`${p.leading} ${p.trailing}`}):l(O,{children:[n("span",{className:"codex-activity-leading",children:p.leading}),p.trailing!==void 0&&(S!==void 0?l(O,{children:[" ",n("button",{type:"button",className:"codex-activity-trailing codex-activity-file-link",title:S,onClick:()=>a(S),children:p.trailing})]}):l("span",{className:"codex-activity-trailing",children:[" ",p.trailing]}))]})})]});return l("div",{className:"codex-activity-item",children:[N?l("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-label":p.trailing===void 0?p.leading:`${p.leading} ${p.trailing}`,"aria-expanded":u,onClick:()=>f((x)=>!x),children:[B,n(E,{expanded:u})]}):n("div",{className:"codex-activity-header codex-activity-header-static",children:B}),n("div",{className:C("codex-activity-details-grid",u&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:h&&l(O,{children:[F!==void 0?n(Ae,{block:e,command:F}):i!==void 0&&c?n(i,{patch:c}):s!==void 0&&n("pre",{className:"codex-activity-details",children:s}),m.length>0&&n("div",{className:"codex-activity-media",children:m.map((x)=>{let T=`data:${x.mimeType};base64,${x.data}`,G=n("img",{src:T,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},`${x.mimeType}:${x.data.slice(0,32)}`);return r===void 0?G:n("button",{type:"button",className:"cursor-pointer",onClick:()=>r(T),children:G},T)})}),g.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 te({block:e}){if(e.type==="tool_use")return n(ee,{block:e});if(e.type==="thinking")return n(se,{block:e});if(e.type==="collab")return n(oe,{block:e});return n(ne,{block:e})}function ne({block:e}){let{t}=L(),a=w(e.status),[i,r]=_(`subagent:${e.id}`,a),o=b(a);A(()=>{if(a)r(!0);if(o.current&&!a)r(!1);o.current=a},[a,r]);let d=e.blocks.length>0;return l("div",{className:"codex-activity-item",children:[l("button",{type:"button",className:C("codex-activity-header",!d&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":d?i:void 0,disabled:!d,onClick:()=>r((s)=>!s),children:[l("span",{className:"codex-activity-label",children:[n(X,{className:"size-4 shrink-0","aria-hidden":"true"}),l("span",{className:"min-w-0 flex-1 truncate",children:[a?n("span",{className:"codex-activity-running",children:t("stream.codex.subagentWorking",{name:e.name})}):t("stream.codex.subagentFinished",{name:e.name}),ae(e.model,e.reasoningEffort,t)]})]}),d&&n(E,{expanded:i})]}),n("div",{className:C("codex-activity-details-grid",i&&"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(ee,{block:s},s.id);if(s.type==="thinking")return n(se,{block:s},M(s));if(s.type==="subagent")return n(ne,{block:s},s.id);if(s.type==="collab")return n(oe,{block:s},s.id);if(s.type==="text")return n("div",{className:"codex-reasoning-details",children:n(Q,{text:s.text,streaming:!1})},M(s));if(s.type==="plan")return n(ue,{entries:s.entries},M(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:""},M(s));return null})})})})]})}var be=new Set(["none","minimal","low","medium","high","xhigh","max","ultra","persistent"]);function ae(e,t,a){if(e===null)return"";if(t===null)return` · ${q(e)}`;let i=be.has(t)?a(`stream.codex.reasoningEffort.${t}`):t;return` · ${q(e)} · ${i}`}var Te={spawnAgent:"spawn",sendInput:"message",sendMessage:"message",followupTask:"message",interruptAgent:"interrupt",listAgents:"list",resumeAgent:"resume",closeAgent:"close"};function ie(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 R(e,t,a){if(e.tool==="wait")throw Error("Codex does not present wait calls");let i=ie(e.status);if(i==="interrupted")return a("stream.codex.collab.interrupted");return a(`stream.codex.collab.${t}.${Te[e.tool]}.${i}`)}function Ie(e){return e.agents.filter((t)=>t.nickname!==null)}function re(e,t){let a=e.agents.length>0?e.agents.length:1;return`${R(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(le,{children:d%2===1?i[o]:o},`${d}:${o}`))}function _e({agent:e,showModel:t}){let{t:a}=L();return l("span",{children:[n("span",{className:"font-medium",children:e.nickname}),e.role!==null&&` (${e.role})`,t&&ae(e.model,e.reasoningEffort,a)]})}function J({prompt:e}){return n("span",{className:"codex-collab-prompt",title:e,children:e})}function Ee(e,t){let a=e.prompt?.trim()?e.prompt:null,i=ie(e.status),r=e.tool==="spawnAgent"&&i==="completed"&&a!==null,o=(e.tool==="sendInput"||e.tool==="sendMessage"||e.tool==="followupTask")&&a!==null,d=Ie(e),s=[];if(d.length===0)s.push({key:"generic",node:R(e,"row",t)});for(let c of d){let m=n(_e,{agent:c,showModel:e.tool==="spawnAgent"});if(r)s.push({key:c.threadId,node:n("span",{className:"codex-collab-line",children:j(t,"stream.codex.collab.createdWithInstructions",{},{agent:m,instructions:n(J,{prompt:a})})})});else if(o)s.push({key:c.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:m,prompt:n(J,{prompt:a})})})});else{let u=e.tool!=="closeAgent"&&e.tool!=="resumeAgent"&&c.state!==null&&c.state!==null?c.state.message?.trim()?t("stream.codex.collab.stateWithMessage",{state:t(`stream.codex.collab.state.${c.state.status}`),message:c.state.message}):t("stream.codex.collab.stateOnly",{state:t(`stream.codex.collab.state.${c.state.status}`)}):"";s.push({key:c.threadId,node:j(t,"stream.codex.collab.agentRow",{action:R(e,"row",t),state:u},{agent:m})})}}if(!r&&!o&&a!==null)s.push({key:"input",node:j(t,"stream.codex.collab.input",{},{prompt:n("span",{className:"codex-collab-input",children:a})})});return s}function oe({block:e}){let{t}=L(),[a,i]=_(`collab:${e.id}`,!1);if(e.tool==="wait")return null;let r=w(e.status),o=re(e,t);return l("div",{className:"codex-activity-item",children:[l("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":a,onClick:()=>i((d)=>!d),children:[l("span",{className:"codex-activity-label",children:[n(X,{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:C("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:Ee(e,t).map((d)=>n("div",{className:"codex-collab-row",children:d.node},d.key))})})})]})}function se({block:e}){let{t,i18n:a}=L(),i=Boolean(e.isComplete),[r,o]=_(`thinking:${M(e)}:${i?"complete":"streaming"}`,!i),d=b(i),s=b(null);A(()=>{if(!i)o(!0);if(!d.current&&i)o(!1);d.current=i},[i,o]);let c=e.thinking.trim().length>0;A(()=>{if(i||!c)return;let u=s.current;if(u===null)throw Error("Thinking details are not mounted");let f=new ResizeObserver(()=>{u.scrollTop=u.scrollHeight}),h=null,y=()=>{let p=u.firstElementChild;if(p===h)return;if(h!==null)f.unobserve(h);if(h=p,h!==null)f.observe(h)},v=new MutationObserver(y);return v.observe(u,{childList:!0}),y(),()=>{v.disconnect(),f.disconnect()}},[c,i]);let m=i?e.durationMs!==void 0?t("stream.codex.thoughtFor",{duration:W(e.durationMs,a.language)}):t("stream.codex.thought"):t("message.thinking"),g=e.thinking.trimStart().replace(/^\*\*[^\n]*?\*\*\s*/,"");return l("div",{className:"codex-activity-item",children:[l("button",{type:"button",className:C("codex-activity-header",!c&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":c?r:void 0,disabled:!c,onClick:()=>o((u)=>!u),children:[n("span",{className:"codex-activity-label",children:n("span",{className:"codex-reasoning-label min-w-0 flex-1 truncate",children:i?m:n("span",{className:"codex-activity-running",children:m})})}),c&&n(E,{expanded:r})]}),n("div",{className:C("codex-activity-details-grid",r&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:c&&n("div",{ref:s,className:"codex-reasoning-details",role:"region","aria-label":m,"aria-hidden":!r,tabIndex:0,inert:!r,children:n(Q,{text:g,streaming:!i})})})})]})}function Fe(e){if(P(e))return"mcp";let t=V(e).category;return t==="think"||t==="switch_mode"?"other":t}function Se(e,t,a,i){return i(`stream.codex.summary.${e}.${a?"leading":"following"}`,{count:t})}function Be(e,t,a){let i=new Map;for(let o of e){let d=Fe(o);i.set(d,(i.get(d)??0)+1)}let r=Array.from(i,([o,d],s)=>Se(o,d,s===0,t));if(a.startsWith("zh"))return r.join("");return new Intl.ListFormat(a,{style:"long",type:"conjunction"}).format(r)}function Je({stateKey:e,durationMs:t,durationKind:a="work",active:i,startedAt:r,providerId:o,providerIcon:d,children:s}){let{t:c,i18n:m}=L(),[g,u]=_(`work:${e}`,i),f=H(`work:${e}`,g||i),h=b(i),y=b(null),[v,p]=D(0);A(()=>{if(i)u(!0);if(h.current&&!i)u(!1);h.current=i},[i,u]),A(()=>{if(!i||t!==void 0){y.current=null;return}y.current=r??Date.now();let N=()=>{let B=y.current;if(B===null)throw Error("Codex work section is ticking without a start time");p(Date.now()-B)};N();let S=window.setInterval(N,1000);return()=>window.clearInterval(S)},[i,r,t]);let F=t!==void 0?c(a==="total"?"stream.codex.totalDuration":"stream.codex.workedFor",{duration:W(t,m.language)}):i&&v>=1000?c("stream.codex.workedFor",{duration:W(v,m.language)}):c("stream.codex.worked");return l("section",{className:"codex-work-section",children:[l("button",{type:"button",className:"codex-work-trigger","data-codex-disclosure":"","aria-expanded":g,onClick:()=>u((N)=>!N),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:F}),n(E,{expanded:g,className:"codex-work-chevron"})]}),n("div",{className:"codex-work-separator","aria-hidden":"true"}),n("div",{className:C("codex-work-grid",g&&"codex-work-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-work-body",children:f&&s})})})]})}function De(e,t){if(e.type==="tool_use")return ye(e,t);if(e.type==="thinking")return t("message.thinking");if(e.type==="collab")return re(e,t);return t("stream.codex.subagentWorking",{name:e.name})}function Ve(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 Ze(e,t=1000){let[a,i]=D(e),r=b(Date.now());return A(()=>{if(e===a)return;let o=Date.now(),d=Math.max(0,r.current+t-o);if(d===0){r.current=o,i(e);return}let s=window.setTimeout(()=>{r.current=Date.now(),i(e)},d);return()=>window.clearTimeout(s)},[a,t,e]),a}function je({blocks:e}){let{t,i18n:a}=L(),i=e.some(Ve),r=e.map(M).join(":"),[o,d]=_(`group:${r}`,i),s=H(`group:${r}`,o||i),c=b(i);A(()=>{if(i)d(!0);if(c.current&&!i)d(!1);c.current=i},[i,d]);let m=e.at(-1);if(m===void 0)throw Error("CodexActivityGroup requires at least one activity block");let g=e.filter((f)=>f.type==="tool_use"),u=Ze(i?De(m,t):Be(g,t,a.language));return l("div",{className:"codex-activity-group",children:[l("button",{type:"button",className:"codex-activity-group-trigger","aria-expanded":o,onClick:()=>d((f)=>!f),children:[l("span",{className:"codex-activity-label",children:[n(Y,{block:e[0]}),n("span",{className:"truncate",children:i?n("span",{className:"codex-activity-running",children:u}):u})]}),n(E,{expanded:o})]}),n("div",{className:C("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:s&&e.map((f)=>n(te,{block:f},M(f)))})})})]})}function Qe({blocks:e}){if(e.length===0)throw Error("CodexActivityGroup requires at least one activity block");if(e.length===1)return n(te,{block:e[0]});return n(je,{blocks:e})}export{Qe as CodexActivityGroup,Je as CodexWorkSection};
@@ -1,2 +1,2 @@
1
- import{jsx as n,jsxs as f}from"react/jsx-runtime";import{cn as B}from"cn";import{useActivityHost as C,ActivityMarkdown as k}from"../activity-host.js";import{groupBlocksForStyle as T}from"../lib/group-blocks.js";import{describeToolUse as j}from"../lib/stream-style.js";import{CodexActivityGroup as E,CodexWorkSection as S}from"./activity-group.js";import{CodexPlan as G}from"./plan.js";import{CodexEditedFilesCard as O}from"./edited-files-card.js";import{CopyAction as D}from"./user-message.js";var v=new WeakMap,H=1;function A(t){if(t.type==="tool_use"||t.type==="subagent")return`${t.type}:${t.id}`;let i=v.get(t);if(i!==void 0)return`${t.type}:${i}`;let r=H++;return v.set(t,r),`${t.type}:${r}`}function K({block:t,streaming:i,actions:r}){if(t.isApiError)return n("div",{className:"codex-stream-error",children:t.text});return f("div",{className:"codex-assistant-message",children:[n(k,{text:t.text,streaming:i}),r]})}function P({block:t,streaming:i,actions:r,renderText:o}){switch(t.type){case"text":return o===void 0?n(K,{block:t,streaming:i,actions:r}):o({block:t,streaming:i,actions:r});case"thinking":return t.thinking.length>0?n(k,{text:t.thinking,streaming:!t.isComplete}):null;case"plan":return n(G,{entries:t.entries});case"image":return n("img",{src:`data:${t.source.media_type};base64,${t.source.data}`,className:"max-h-64 rounded",alt:""});case"tool_use":case"subagent":return null}}var R=new Set;function Z({message:t,isMostRecentTurn:i,hiddenTools:r=R,time:o,beforeCopy:s,afterCopy:l,providerIcon:w,renderText:_,renderEditedFiles:m}){if(t.streaming===!0&&t.content.every((e)=>e.type==="text"?e.text.length===0:e.type==="thinking"?e.thinking.length===0:!1))return n(N,{});let g=t.content.filter((e)=>e.type==="text").map((e)=>e.text).join(`
2
- `),I=!t.streaming&&g.trim().length>0?n(W,{text:g,isMostRecentTurn:i,beforeCopy:s,afterCopy:l,time:o}):null,c=T(t.content,"compact"),u=c.reduce((e,a,d)=>a.kind==="codexActivityGroup"?d:e,-1),h=c.findIndex((e,a)=>a>u&&e.kind==="block"&&e.block.type==="text"),M=[...t.content].reverse().find((e)=>e.type==="text"),p=t.content.filter((e)=>e.type==="tool_use"&&j(e).category==="edit"),y=(e)=>{if(e.kind==="codexActivityGroup"){let a=e.blocks.filter((d)=>d.type!=="tool_use"||!r.has(d.name));return a.length===0?null:n(E,{blocks:a},`activity:${A(a[0])}`)}if(e.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${e.kind}`);return n(P,{block:e.block,streaming:Boolean(t.streaming),actions:e.block===M?I:void 0,renderText:_},A(e.block))},x=u===-1?0:h===-1?c.length:h;return n(F,{stateKey:t.id,active:Boolean(t.streaming),startedAt:t.startedAt,durationMs:t.durationMs,providerId:t.providerId,providerIcon:w,work:c.slice(0,x).map(y),answer:c.length>x?c.slice(x).map(y):null,footer:u!==-1&&p.length>0&&(m===void 0?n(O,{blocks:p}):m(p))})}function W({text:t,isMostRecentTurn:i=!1,beforeCopy:r,afterCopy:o,time:s}){let{t:l}=C();return f("div",{className:B("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",i?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[r,n(D,{text:t,label:l("actions.copy")}),o,s&&n("span",{className:"codex-user-time ms-1",title:s.full,children:s.short})]})}function N(){let{t}=C();return n("div",{className:"codex-pending-message py-2",role:"status",children:n("span",{className:"codex-activity-running",children:t("message.thinking")})})}function F({work:t,answer:i,footer:r,loading:o=!1,...s}){if(o)return n(N,{});return f("div",{className:"group/am codex-assistant-turn",children:[t.length>0&&n(S,{...s,children:t}),i!==null&&(t.length===0?i:n("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:i})),r]})}export{Z as CodexAssistantMessage,F as CodexAssistantTurn,W as CodexMessageActions};
1
+ import{jsx as n,jsxs as f}from"react/jsx-runtime";import{cn as B}from"cn";import{useActivityHost as C,ActivityMarkdown as k}from"../activity-host.js";import{groupBlocksForStyle as T}from"../lib/group-blocks.js";import{describeToolUse as j}from"../lib/stream-style.js";import{CodexActivityGroup as E,CodexWorkSection as S}from"./activity-group.js";import{CodexPlan as G}from"./plan.js";import{CodexEditedFilesCard as O}from"./edited-files-card.js";import{CopyAction as D}from"./user-message.js";var v=new WeakMap,H=1;function A(t){if(t.type==="tool_use"||t.type==="subagent"||t.type==="collab")return`${t.type}:${t.id}`;let i=v.get(t);if(i!==void 0)return`${t.type}:${i}`;let r=H++;return v.set(t,r),`${t.type}:${r}`}function K({block:t,streaming:i,actions:r}){if(t.isApiError)return n("div",{className:"codex-stream-error",children:t.text});return f("div",{className:"codex-assistant-message",children:[n(k,{text:t.text,streaming:i}),r]})}function P({block:t,streaming:i,actions:r,renderText:o}){switch(t.type){case"text":return o===void 0?n(K,{block:t,streaming:i,actions:r}):o({block:t,streaming:i,actions:r});case"thinking":return t.thinking.length>0?n(k,{text:t.thinking,streaming:!t.isComplete}):null;case"plan":return n(G,{entries:t.entries});case"image":return n("img",{src:`data:${t.source.media_type};base64,${t.source.data}`,className:"max-h-64 rounded",alt:""});case"tool_use":case"subagent":case"collab":return null}}var R=new Set;function Y({message:t,isMostRecentTurn:i,hiddenTools:r=R,time:o,beforeCopy:s,afterCopy:l,providerIcon:w,renderText:_,renderEditedFiles:m}){if(t.streaming===!0&&t.content.every((e)=>e.type==="text"?e.text.length===0:e.type==="thinking"?e.thinking.length===0:!1))return n(N,{});let g=t.content.filter((e)=>e.type==="text").map((e)=>e.text).join(`
2
+ `),I=!t.streaming&&g.trim().length>0?n(W,{text:g,isMostRecentTurn:i,beforeCopy:s,afterCopy:l,time:o}):null,c=T(t.content,"compact"),u=c.reduce((e,a,d)=>a.kind==="codexActivityGroup"?d:e,-1),h=c.findIndex((e,a)=>a>u&&e.kind==="block"&&e.block.type==="text"),M=[...t.content].reverse().find((e)=>e.type==="text"),p=t.content.filter((e)=>e.type==="tool_use"&&j(e).category==="edit"),y=(e)=>{if(e.kind==="codexActivityGroup"){let a=e.blocks.filter((d)=>d.type!=="tool_use"||!r.has(d.name));return a.length===0?null:n(E,{blocks:a},`activity:${A(a[0])}`)}if(e.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${e.kind}`);return n(P,{block:e.block,streaming:Boolean(t.streaming),actions:e.block===M?I:void 0,renderText:_},A(e.block))},x=u===-1?0:h===-1?c.length:h;return n(F,{stateKey:t.id,active:Boolean(t.streaming),startedAt:t.startedAt,durationMs:t.durationMs,providerId:t.providerId,providerIcon:w,work:c.slice(0,x).map(y),answer:c.length>x?c.slice(x).map(y):null,footer:u!==-1&&p.length>0&&(m===void 0?n(O,{blocks:p}):m(p))})}function W({text:t,isMostRecentTurn:i=!1,beforeCopy:r,afterCopy:o,time:s}){let{t:l}=C();return f("div",{className:B("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",i?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[r,n(D,{text:t,label:l("actions.copy")}),o,s&&n("span",{className:"codex-user-time ms-1",title:s.full,children:s.short})]})}function N(){let{t}=C();return n("div",{className:"codex-pending-message py-2",role:"status",children:n("span",{className:"codex-activity-running",children:t("message.thinking")})})}function F({work:t,answer:i,footer:r,loading:o=!1,...s}){if(o)return n(N,{});return f("div",{className:"group/am codex-assistant-turn",children:[t.length>0&&n(S,{...s,children:t}),i!==null&&(t.length===0?i:n("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:i})),r]})}export{Y as CodexAssistantMessage,F as CodexAssistantTurn,W as CodexMessageActions};
@@ -932,6 +932,36 @@
932
932
  padding-inline-start: 20px;
933
933
  }
934
934
 
935
+ /* Codex multi-agent action rows at text/60; instruction and message rows stay on one line. */
936
+ .codex-collab-row {
937
+ min-width: 0;
938
+ color: var(--codex-conversation-body);
939
+ font-size: var(--codex-chat-font-size);
940
+ line-height: var(--codex-chat-line-height);
941
+ }
942
+
943
+ .codex-collab-line {
944
+ display: flex;
945
+ min-width: 0;
946
+ align-items: baseline;
947
+ gap: 0.25em;
948
+ overflow: hidden;
949
+ white-space: nowrap;
950
+ }
951
+
952
+ .codex-collab-prompt {
953
+ min-width: 0;
954
+ flex: 1;
955
+ overflow: hidden;
956
+ text-overflow: ellipsis;
957
+ color: var(--codex-summary-trailing);
958
+ }
959
+
960
+ .codex-collab-input {
961
+ overflow-wrap: anywhere;
962
+ white-space: pre-wrap;
963
+ }
964
+
935
965
  .codex-user-bubble {
936
966
  display: flex;
937
967
  width: fit-content;
@@ -1 +1 @@
1
- import{isCodexLook as r}from"./stream-style.js";function f(t,o){if(r(o))return s(t);return t.map((i)=>({kind:"block",block:i}))}function u(t){return t.type==="thinking"||t.type==="tool_use"||t.type==="subagent"}function c(t){return t.type==="tool_use"&&t.kind!=="think"}function s(t){let o=[],i=[],e=()=>{if(i.length===0)return;o.push({kind:"codexActivityGroup",blocks:i}),i=[]};for(let n of t){if(u(n)&&c(n)){i.push(n);continue}if(e(),u(n)){o.push({kind:"codexActivityGroup",blocks:[n]});continue}o.push({kind:"block",block:n})}return e(),o}export{f as groupBlocksForStyle};
1
+ import{isCodexLook as r}from"./stream-style.js";function f(t,o){if(r(o))return p(t);return t.map((i)=>({kind:"block",block:i}))}function u(t){return t.type==="thinking"||t.type==="tool_use"||t.type==="subagent"||t.type==="collab"}function c(t){return t.type==="tool_use"&&t.kind!=="think"}function p(t){let o=[],i=[],e=()=>{if(i.length===0)return;o.push({kind:"codexActivityGroup",blocks:i}),i=[]};for(let n of t){if(u(n)&&c(n)){i.push(n);continue}if(e(),u(n)){o.push({kind:"codexActivityGroup",blocks:[n]});continue}o.push({kind:"block",block:n})}return e(),o}export{f as groupBlocksForStyle};
@@ -0,0 +1 @@
1
+ export declare function formatModelName(model: string): string;
@@ -0,0 +1 @@
1
+ function e(r){if(!r.trimStart().toLowerCase().startsWith("gpt"))return r;let a=/^gpt-\d/iu.test(r.trimStart())?" ":"-";return r.split(/(\s+)/).map((i)=>i.trim().length===0?i:i.split("-").map((t,o)=>{if(t.toLowerCase()==="gpt")return"GPT";if(t.toLowerCase()==="oai")return"OAI";return o>0&&t.length>0?`${t[0]?.toUpperCase()}${t.slice(1)}`:t}).join(a).replace(/^GPT (?=\d)/u,"GPT-")).join("")}export{e as formatModelName};
@@ -11,7 +11,7 @@ export interface ToolGroupEntry {
11
11
  blocks: ToolUseBlock[];
12
12
  }
13
13
  export type CodexActivityBlock = Extract<ContentBlock, {
14
- type: "thinking" | "tool_use" | "subagent";
14
+ type: "thinking" | "tool_use" | "subagent" | "collab";
15
15
  }>;
16
16
  export interface CodexActivityGroupEntry {
17
17
  kind: "codexActivityGroup";
package/dist/locales.d.ts CHANGED
@@ -168,6 +168,106 @@ export declare const chatLocales: {
168
168
  readonly movedFiles: "Moved files";
169
169
  readonly subagentWorking: "{{name}} started working";
170
170
  readonly subagentFinished: "{{name}} finished";
171
+ readonly reasoningEffort: {
172
+ readonly none: "None";
173
+ readonly minimal: "Minimal";
174
+ readonly low: "Light";
175
+ readonly medium: "Medium";
176
+ readonly high: "High";
177
+ readonly xhigh: "Extra high";
178
+ readonly max: "Max";
179
+ readonly ultra: "Ultra";
180
+ readonly persistent: "Persistent";
181
+ };
182
+ readonly collab: {
183
+ readonly interrupted: "Interrupted";
184
+ readonly agentCount_one: " an agent";
185
+ readonly agentCount_other: " {{count}} agents";
186
+ readonly header: {
187
+ readonly spawn: {
188
+ readonly inProgress: "Creating";
189
+ readonly completed: "Created";
190
+ readonly failed: "Failed to create";
191
+ };
192
+ readonly message: {
193
+ readonly inProgress: "Messaging";
194
+ readonly completed: "Messaged";
195
+ readonly failed: "Failed to message";
196
+ };
197
+ readonly interrupt: {
198
+ readonly inProgress: "Interrupting";
199
+ readonly completed: "Interrupted";
200
+ readonly failed: "Failed to interrupt";
201
+ };
202
+ readonly list: {
203
+ readonly inProgress: "Listing";
204
+ readonly completed: "Listed";
205
+ readonly failed: "Failed to list";
206
+ };
207
+ readonly resume: {
208
+ readonly inProgress: "Resuming";
209
+ readonly completed: "Resumed";
210
+ readonly failed: "Failed to resume";
211
+ };
212
+ readonly close: {
213
+ readonly inProgress: "Closing";
214
+ readonly completed: "Closed";
215
+ readonly failed: "Failed to close";
216
+ };
217
+ };
218
+ readonly row: {
219
+ readonly spawn: {
220
+ readonly inProgress: "Creating";
221
+ readonly completed: "Created";
222
+ readonly failed: "Failed creating";
223
+ };
224
+ readonly message: {
225
+ readonly inProgress: "Messaging";
226
+ readonly completed: "Messaged";
227
+ readonly failed: "Failed messaging";
228
+ };
229
+ readonly interrupt: {
230
+ readonly inProgress: "Interrupting";
231
+ readonly completed: "Interrupted";
232
+ readonly failed: "Failed to interrupt";
233
+ };
234
+ readonly list: {
235
+ readonly inProgress: "Listing";
236
+ readonly completed: "Listed";
237
+ readonly failed: "Failed to list";
238
+ };
239
+ readonly resume: {
240
+ readonly inProgress: "Resuming";
241
+ readonly completed: "Resumed";
242
+ readonly failed: "Failed resuming";
243
+ };
244
+ readonly close: {
245
+ readonly inProgress: "Closing";
246
+ readonly completed: "Closed";
247
+ readonly failed: "Failed closing";
248
+ };
249
+ };
250
+ readonly messaged: {
251
+ readonly inProgress: "Messaging";
252
+ readonly completed: "Messaged";
253
+ readonly failed: "Failed to message";
254
+ };
255
+ readonly createdWithInstructions: "Created {{agent}} with the instructions: {{instructions}}";
256
+ readonly messagedWithPrompt: "{{action}} {{agent}}: {{prompt}}";
257
+ readonly agentRow: "{{action}} {{agent}}{{state}}";
258
+ readonly input: "Input: {{prompt}}";
259
+ readonly stateOnly: " ({{state}})";
260
+ readonly stateWithMessage: " ({{state}}: {{message}})";
261
+ readonly state: {
262
+ readonly pendingInit: "pending init";
263
+ readonly running: "running";
264
+ readonly interrupted: "interrupted";
265
+ readonly shutdown: "shutdown";
266
+ readonly completed: "completed";
267
+ readonly errored: "errored";
268
+ readonly notFound: "not found";
269
+ };
270
+ };
171
271
  readonly contextCompacted: "Context compacted";
172
272
  readonly audioOutput: "Audio output";
173
273
  readonly exitCode: "Exit code {{code}}";
@@ -429,6 +529,106 @@ export declare const chatLocales: {
429
529
  readonly movedFiles: "已移动文件";
430
530
  readonly subagentWorking: "{{name}} 已开始工作";
431
531
  readonly subagentFinished: "{{name}} 已完成";
532
+ readonly reasoningEffort: {
533
+ readonly none: "无";
534
+ readonly minimal: "最低";
535
+ readonly low: "轻度";
536
+ readonly medium: "中";
537
+ readonly high: "高";
538
+ readonly xhigh: "超高";
539
+ readonly max: "最大";
540
+ readonly ultra: "Ultra";
541
+ readonly persistent: "持续";
542
+ };
543
+ readonly collab: {
544
+ readonly interrupted: "已中断";
545
+ readonly agentCount_one: " {{count}} 个代理";
546
+ readonly agentCount_other: " {{count}} 个代理";
547
+ readonly header: {
548
+ readonly spawn: {
549
+ readonly inProgress: "正在创建";
550
+ readonly completed: "已创建";
551
+ readonly failed: "创建失败";
552
+ };
553
+ readonly message: {
554
+ readonly inProgress: "正在发送消息";
555
+ readonly completed: "已发送消息";
556
+ readonly failed: "发送消息失败";
557
+ };
558
+ readonly interrupt: {
559
+ readonly inProgress: "正在中断";
560
+ readonly completed: "已中断";
561
+ readonly failed: "中断失败";
562
+ };
563
+ readonly list: {
564
+ readonly inProgress: "正在列出";
565
+ readonly completed: "已列出";
566
+ readonly failed: "列出失败";
567
+ };
568
+ readonly resume: {
569
+ readonly inProgress: "正在恢复";
570
+ readonly completed: "已恢复";
571
+ readonly failed: "恢复失败";
572
+ };
573
+ readonly close: {
574
+ readonly inProgress: "正在关闭";
575
+ readonly completed: "已关闭";
576
+ readonly failed: "关闭失败";
577
+ };
578
+ };
579
+ readonly row: {
580
+ readonly spawn: {
581
+ readonly inProgress: "正在创建";
582
+ readonly completed: "已创建";
583
+ readonly failed: "创建失败";
584
+ };
585
+ readonly message: {
586
+ readonly inProgress: "正在发送消息";
587
+ readonly completed: "已发送消息";
588
+ readonly failed: "发送消息失败";
589
+ };
590
+ readonly interrupt: {
591
+ readonly inProgress: "正在中断";
592
+ readonly completed: "已中断";
593
+ readonly failed: "中断失败";
594
+ };
595
+ readonly list: {
596
+ readonly inProgress: "正在列出";
597
+ readonly completed: "已列出";
598
+ readonly failed: "列出失败";
599
+ };
600
+ readonly resume: {
601
+ readonly inProgress: "正在恢复";
602
+ readonly completed: "已恢复";
603
+ readonly failed: "恢复失败";
604
+ };
605
+ readonly close: {
606
+ readonly inProgress: "正在关闭";
607
+ readonly completed: "已关闭";
608
+ readonly failed: "关闭失败";
609
+ };
610
+ };
611
+ readonly messaged: {
612
+ readonly inProgress: "正在发送消息";
613
+ readonly completed: "已发送消息";
614
+ readonly failed: "发送消息失败";
615
+ };
616
+ readonly createdWithInstructions: "已创建 {{agent}},指令:{{instructions}}";
617
+ readonly messagedWithPrompt: "{{action}} {{agent}}:{{prompt}}";
618
+ readonly agentRow: "{{action}} {{agent}}{{state}}";
619
+ readonly input: "输入:{{prompt}}";
620
+ readonly stateOnly: "({{state}})";
621
+ readonly stateWithMessage: "({{state}}:{{message}})";
622
+ readonly state: {
623
+ readonly pendingInit: "初始化中";
624
+ readonly running: "运行中";
625
+ readonly interrupted: "已中断";
626
+ readonly shutdown: "已关闭";
627
+ readonly completed: "已完成";
628
+ readonly errored: "出错";
629
+ readonly notFound: "未找到";
630
+ };
631
+ };
432
632
  readonly contextCompacted: "上下文已压缩";
433
633
  readonly audioOutput: "音频输出";
434
634
  readonly exitCode: "退出码 {{code}}";
package/dist/locales.js CHANGED
@@ -1 +1 @@
1
- var d={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:{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",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:{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:"暂无可用模型"}}};function n(e){let o={...e};for(let[l,i]of Object.entries(d))o[l]={...e[l],alwithChat:i};return o}export{d as chatLocales,n as withChatResources};
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:{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",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:{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}} 已完成",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};
package/dist/types.d.ts CHANGED
@@ -23,6 +23,19 @@ export interface TerminalDisplayMeta {
23
23
  readFilePath?: string;
24
24
  };
25
25
  }
26
+ export type CollabTool = "spawnAgent" | "sendInput" | "resumeAgent" | "wait" | "closeAgent" | "sendMessage" | "followupTask" | "interruptAgent" | "listAgents";
27
+ export type CollabAgentStatus = "pendingInit" | "running" | "interrupted" | "completed" | "errored" | "shutdown" | "notFound";
28
+ export interface CollabAgent {
29
+ threadId: string;
30
+ nickname: string | null;
31
+ role: string | null;
32
+ model: string | null;
33
+ reasoningEffort: string | null;
34
+ state: {
35
+ status: CollabAgentStatus;
36
+ message: string | null;
37
+ } | null;
38
+ }
26
39
  export type ContentBlock = {
27
40
  type: "text";
28
41
  text: string;
@@ -54,11 +67,20 @@ export type ContentBlock = {
54
67
  type: "subagent";
55
68
  id: string;
56
69
  name: string;
70
+ model: string | null;
71
+ reasoningEffort: string | null;
57
72
  blocks: ContentBlock[];
58
73
  status: ToolCallStatus;
59
74
  isBackground?: boolean;
60
75
  startedAt?: number;
61
76
  durationMs?: number;
77
+ } | {
78
+ type: "collab";
79
+ id: string;
80
+ tool: CollabTool;
81
+ status: ToolCallStatus;
82
+ prompt: string | null;
83
+ agents: CollabAgent[];
62
84
  } | {
63
85
  type: "plan";
64
86
  entries: PlanEntry[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwith/module-chat",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {