@alwith/module-chat 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/approval/choice-elicitation-form.d.ts +1 -1
- package/dist/approval/permission-view.d.ts +1 -1
- package/dist/approval/schema-elicitation-form.d.ts +1 -1
- package/dist/codex/activity-group.d.ts +2 -1
- package/dist/codex/activity-group.js +6 -6
- package/dist/codex/assistant-message.js +2 -2
- package/dist/codex/edited-files-card.js +2 -2
- package/dist/codex/markdown.css +27 -4
- package/dist/codex/navigation-rail.js +1 -1
- package/dist/codex/styles.css +113 -0
- package/dist/codex/user-message.d.ts +5 -1
- package/dist/codex/user-message.js +1 -1
- package/dist/composer/completion-menu.d.ts +5 -1
- package/dist/composer/completion-menu.js +2 -2
- package/dist/composer/completion-trigger.js +2 -2
- package/dist/composer/effort-slider.d.ts +1 -1
- package/dist/composer/menu-radio.d.ts +1 -1
- package/dist/composer/permission-mode-select.d.ts +1 -1
- package/dist/composer/prompt-input-textarea.js +3 -3
- package/dist/composer/prompt-input.js +1 -1
- package/dist/image-preview-dialog.js +1 -1
- package/dist/lib/limits.js +1 -1
- package/dist/lib/markdown-rules.js +1 -1
- package/dist/lib/streaming-markdown.js +1 -1
- package/dist/locales.d.ts +10 -1
- package/dist/locales.js +1 -1
- package/dist/search/chat-search.d.ts +1 -1
- package/dist/search/chat-search.js +1 -1
- package/dist/search/find-bar.d.ts +1 -1
- package/dist/ui/card.d.ts +1 -1
- package/dist/ui/card.js +1 -1
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/dialog.d.ts +1 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/dropdown-menu.d.ts +1 -1
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/field.d.ts +1 -1
- package/dist/ui/field.js +1 -1
- package/dist/ui/hover-card.js +1 -1
- package/dist/ui/input-group.d.ts +1 -1
- package/dist/ui/input-group.js +1 -1
- package/dist/ui/input.js +1 -1
- package/dist/ui/radio-group.js +1 -1
- package/dist/ui/separator.js +1 -1
- package/dist/ui/switch.js +1 -1
- package/dist/ui/textarea.js +1 -1
- package/dist/ui/tooltip.js +1 -1
- package/package.json +4 -2
|
@@ -12,4 +12,4 @@ export interface ChoiceElicitationFormProps {
|
|
|
12
12
|
onAccept: (requestId: string, content: Record<string, string | string[]>, annotations: ChoiceAnnotations) => void | Promise<void>;
|
|
13
13
|
onDecline: (requestId: string) => void | Promise<void>;
|
|
14
14
|
}
|
|
15
|
-
export declare function ChoiceElicitationForm({ current, total, anchorRef, t, onAccept, onDecline
|
|
15
|
+
export declare function ChoiceElicitationForm({ current, total, anchorRef, t, onAccept, onDecline }: ChoiceElicitationFormProps): import("react").ReactPortal | null;
|
|
@@ -16,4 +16,4 @@ export interface PermissionViewProps {
|
|
|
16
16
|
anchorRef?: RefObject<HTMLDivElement | null>;
|
|
17
17
|
onRespond: (optionId: string | null) => void | Promise<void>;
|
|
18
18
|
}
|
|
19
|
-
export declare function PermissionView({ requestId, options, title, children, total, alwaysLabel, autoFocus, anchorRef, onRespond
|
|
19
|
+
export declare function PermissionView({ requestId, options, title, children, total, alwaysLabel, autoFocus, anchorRef, onRespond }: PermissionViewProps): import("react").JSX.Element | null;
|
|
@@ -25,5 +25,5 @@ export interface SchemaElicitationFormProps {
|
|
|
25
25
|
t: (key: "approval.needed" | "actions.decline" | "actions.submit") => string;
|
|
26
26
|
onRespond: (answer: acp.CreateElicitationResponse) => void;
|
|
27
27
|
}
|
|
28
|
-
export declare function SchemaElicitationForm({ requestId, schema, message, total, t, onRespond
|
|
28
|
+
export declare function SchemaElicitationForm({ requestId, schema, message, total, t, onRespond }: SchemaElicitationFormProps): import("react").JSX.Element;
|
|
29
29
|
export {};
|
|
@@ -2,9 +2,10 @@ import type { CodexActivityBlock } from "../lib/group-blocks.js";
|
|
|
2
2
|
interface Props {
|
|
3
3
|
blocks: CodexActivityBlock[];
|
|
4
4
|
}
|
|
5
|
-
export declare function CodexWorkSection({ stateKey, durationMs, active, startedAt, providerId, providerIcon, children }: {
|
|
5
|
+
export declare function CodexWorkSection({ stateKey, durationMs, durationKind, active, startedAt, providerId, providerIcon, children }: {
|
|
6
6
|
stateKey: string;
|
|
7
7
|
durationMs?: number;
|
|
8
|
+
durationKind?: "work" | "total";
|
|
8
9
|
active: boolean;
|
|
9
10
|
startedAt?: number;
|
|
10
11
|
providerId?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{jsx as t,jsxs as l,Fragment as S}from"react/jsx-runtime";import{useActivityHost as I,ActivityMarkdown as O}from"../activity-host.js";import{CheckIcon as J,CopyIcon as Q,GitBranchIcon as X}from"lucide-react";import{useEffect as w,useRef as N,useState as Z}from"react";import{cn as y}from"cn";import{describeToolUse as F}from"../lib/stream-style.js";import{useCodexDisclosureState as B}from"./disclosure-state.js";import{CodexPlan as Y}from"./plan.js";var W=new WeakMap,H=1;function L(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 n=W.get(e);if(n!==void 0)return`${e.type}:${n}`;let i=H;return H+=1,W.set(e,i),`${e.type}:${i}`}function _(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 V(e,n){let i=Math.max(1,Math.round(e/1000)),a=Math.floor(i/3600),r=Math.floor(i%3600/60),d=i%60;if(d>=60)r+=Math.floor(d/60),d%=60;if(r>=60)a+=Math.floor(r/60),r%=60;let c=Intl.DurationFormat;if(c)try{return new c(n,{style:"narrow"}).format({hours:a,minutes:r,seconds:a>0?0:d})}catch{}if(a>0)return r>0?`${a}h ${r}m`:`${a}h`;if(r>0)return d>0?`${r}m ${d}s`:`${r}m`;return`${d}s`}var ee="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:n}){return t("svg",{className:y("codex-activity-disclosure",e&&"codex-activity-disclosure-expanded",n),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:t("path",{d:ee})})}function te(){return t("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:t("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 ne(){return t("svg",{className:"codex-activity-icon",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:t("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 ie(){return l("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[t("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"}),t("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"}),t("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 ae(){return t("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:t("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 re(){return t("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:t("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 R({block:e}){if(e.type!=="tool_use")return null;let n=F(e).category;if(n==="read")return t(te,{});if(n==="search"||n==="fetch")return t(ne,{});if(n==="execute")return t(ie,{});if(n==="edit")return t(ae,{});return t(re,{})}function T(e,n){let i=e.rawInput[n];return typeof i==="string"&&i.length>0?i:void 0}function oe(e){return F(e).target}function D(e){return e.name.startsWith("mcp__")||e.name.startsWith("mcp_")}function P(e,n){let{category:i}=F(e),a=oe(e),r=_(e.status);if(D(e))return{leading:e.title};if(i==="execute"){let d=T(e,"command")?.split(`
|
|
2
|
-
`)[0]??
|
|
3
|
-
`).trim()}function
|
|
4
|
-
`)}function
|
|
5
|
-
`)),c(!0),setTimeout(()=>c(!1),1500)};return
|
|
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,2 +1,2 @@
|
|
|
1
|
-
import{jsx as n,jsxs as f}from"react/jsx-runtime";import{
|
|
2
|
-
`),I=!t.streaming&&
|
|
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,2 +1,2 @@
|
|
|
1
|
-
import{jsx as i,jsxs as d}from"react/jsx-runtime";import{FileDiffIcon as
|
|
2
|
-
`).length}function
|
|
1
|
+
import{jsx as i,jsxs as d}from"react/jsx-runtime";import{ChevronDownIcon as g,ChevronUpIcon as N,FileDiffIcon as C}from"lucide-react";import{useState as m}from"react";import{useActivityHost as v}from"../activity-host.js";function p(e){if(e===null||e.length===0)return 0;return e.split(`
|
|
2
|
+
`).length}function w(e){let a=new Map;for(let l of e)for(let o of l.content){if(o.type!=="diff")continue;let h=o,r=h._meta?.alwith?.hunks??[],u=r.reduce((n,s)=>n+p(s.newText),0),c=r.reduce((n,s)=>n+p(s.oldText),0);for(let n of h.changes){let s=a.get(n.path);if(s)s.additions+=u,s.deletions+=c;else a.set(n.path,{path:n.path,additions:u,deletions:c})}}return[...a.values()]}function A({blocks:e}){return i(b,{files:w(e)})}function b({files:e,onOpen:a,renderPath:l}){let{t:o,openLink:h}=v(),[r,u]=m(!0),[c,n]=m(!1);if(e.length===0)return null;let s=e.reduce((t,f)=>t+f.additions,0),x=e.reduce((t,f)=>t+f.deletions,0);return d("section",{className:"codex-edited-files-card",children:[d("div",{className:"codex-edited-files-header",children:[i("div",{className:"codex-edited-files-icon","aria-hidden":"true",children:i(C,{})}),d("div",{className:"codex-edited-files-summary",children:[i("strong",{children:o("stream.codex.editedFilesCount",{count:e.length})}),i("button",{type:"button","data-codex-disclosure":"",onClick:()=>{u((t)=>!t),n(!1)},"aria-expanded":r,children:o(r?"stream.codex.hideChanges":"stream.codex.viewChanges")})]}),d("div",{className:"codex-edited-files-total",title:o("stream.codex.changedLines"),children:[d("span",{className:"codex-diff-additions",children:["+",s]}),d("span",{className:"codex-diff-deletions",children:["-",x]})]})]}),r&&d("div",{className:"codex-edited-files-list",children:[(c?e:e.slice(0,3)).map((t)=>d("div",{className:"codex-edited-file-row",children:[i("button",{type:"button",className:"codex-edited-file-path",title:t.path,onClick:()=>a===void 0?h(t.path):a(t),children:l===void 0?t.path:l(t)}),d("span",{className:"codex-edited-file-counts",children:[d("span",{className:"codex-diff-additions",children:["+",t.additions]}),d("span",{className:"codex-diff-deletions",children:["-",t.deletions]})]})]},t.path)),e.length>3&&d("button",{type:"button",className:"codex-edited-files-more","aria-expanded":c,onClick:()=>n((t)=>!t),children:[o(c?"stream.codex.showFewerFiles":"stream.codex.showMoreFiles",{count:e.length-3}),c?i(N,{size:16,"aria-hidden":"true"}):i(g,{size:16,"aria-hidden":"true"})]})]})]})}export{A as CodexEditedFilesCard,b as EditedFilesCard,w as fileChanges};
|
package/dist/codex/markdown.css
CHANGED
|
@@ -549,12 +549,32 @@
|
|
|
549
549
|
|
|
550
550
|
.codex-markdown-math-block {
|
|
551
551
|
display: block;
|
|
552
|
-
|
|
552
|
+
max-width: 100%;
|
|
553
|
+
margin: 0 0 0.6875rem;
|
|
554
|
+
padding-block: 2px;
|
|
553
555
|
overflow-x: auto;
|
|
554
556
|
}
|
|
555
557
|
|
|
556
|
-
.codex-markdown-
|
|
557
|
-
font-size: 1.
|
|
558
|
+
.codex-markdown-content .katex {
|
|
559
|
+
font-size: 1.1em;
|
|
560
|
+
font-weight: 400;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/* Own the spacing once; KaTeX's centered display margins otherwise compound it. */
|
|
564
|
+
.codex-markdown-math-block .katex-display {
|
|
565
|
+
margin: 0;
|
|
566
|
+
text-align: left;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
.codex-markdown-math-block .katex-display > .katex {
|
|
570
|
+
text-align: left;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/* Keep formulas within the user's prose instead of opening a full-width display row. */
|
|
574
|
+
.codex-user-message-text .codex-markdown-math-block {
|
|
575
|
+
display: inline-block;
|
|
576
|
+
margin: 0;
|
|
577
|
+
vertical-align: middle;
|
|
558
578
|
}
|
|
559
579
|
|
|
560
580
|
.codex-markdown-image-trigger {
|
|
@@ -756,5 +776,8 @@
|
|
|
756
776
|
}
|
|
757
777
|
|
|
758
778
|
@media (prefers-reduced-motion: reduce) {
|
|
759
|
-
.codex-markdown-fade {
|
|
779
|
+
.codex-markdown-fade {
|
|
780
|
+
animation: none;
|
|
781
|
+
opacity: 1;
|
|
782
|
+
}
|
|
760
783
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as f,jsxs as
|
|
1
|
+
import{jsx as f,jsxs as re}from"react/jsx-runtime";import{useCallback as ie,useEffect as P,useMemo as B,useRef as g,useState as O}from"react";import{NavigationPreview as se}from"./navigation-preview.js";import"./navigation-rail.css";var ae=4,oe=10;function Z(T,h){if(T.size!==h.size)return!1;for(let u of T)if(!h.has(u))return!1;return!0}function ge({audio:T,beforeReveal:h,ensureItemMounted:u,items:i,scrollRoot:a,targetTopMarginPx:R=16}){let[_,ee]=O(()=>new Set(i.length===0?[]:[i[i.length-1].id])),[b,x]=O(null),[z,M]=O(null),[H,y]=O(!1),[E,te]=O(()=>new Set),{installUnlock:K,preload:L,playSequence:G}=T,V=g(null),v=g(null),N=g(!1),S=g(null),k=g(0),C=B(()=>i.map((e)=>e.id).join("\x00"),[i]),q=g(i);q.current=i;let D=g(E),F=g(_),J=g({itemIdsKey:C,scrollRoot:a}),W=J.current;if(W.itemIdsKey!==C||W.scrollRoot!==a)k.current+=1,J.current={itemIdsKey:C,scrollRoot:a};let m=B(()=>u===void 0?i.filter((e)=>E.has(e.id)):i,[u,i,E]),Y=B(()=>m.map((e)=>({inputTokens:e.inputTokens,outputTokens:e.outputTokens})),[m]);P(()=>K(),[K]),P(()=>()=>{k.current+=1},[]),P(()=>{x(null),y(!1),M(null),v.current=null,N.current=!1,S.current=null},[C,a]),P(()=>{L()},[L]),P(()=>{if(a===null)return;let e=new Set,t=new Map,o=new Set(q.current.map((r)=>r.id)),l=()=>{let r=new Set(t.values()),c=q.current.filter((d)=>r.has(d.id)).map((d)=>d.id),n=c.findIndex((d)=>e.has(d));if(n===-1)return;let I=n;for(let d=n+1;d<c.length;d++)if(e.has(c[d]))I=d;let j=new Set(c.slice(n,I+1));if(Z(F.current,j))return;F.current=j,ee(j)},w=new IntersectionObserver((r)=>{for(let c of r){let n=t.get(c.target);if(c.isIntersecting)e.add(n);else e.delete(n)}l()},{root:a,rootMargin:`-${R}px 0px 0px 0px`}),s=()=>{let r=new Set,c=new Set;for(let n of a.querySelectorAll("[data-content-search-unit-key]")){let I=n.dataset.contentSearchUnitKey;if(I===void 0||!o.has(I)||r.has(I))continue;if(r.add(I),c.add(n),t.has(n))continue;t.set(n,I),w.observe(n)}for(let n of t.keys()){if(c.has(n))continue;w.unobserve(n),e.delete(t.get(n)),t.delete(n)}if(Z(D.current,r))return;D.current=r,te(r)};s();let p=new MutationObserver(s);return p.observe(a,{childList:!0,subtree:!0}),()=>{p.disconnect(),w.disconnect()}},[C,a,R]);let Q=ie(async(e)=>{if(a===null)throw Error("Thread user-message navigation scroll root is missing");let t=k.current+1;if(k.current=t,h(),u!==void 0){await u(e);return}let o=a.querySelector(`[data-content-search-unit-key="${CSS.escape(e.id)}"]`);if(o===null)throw Error(`Thread user-message navigation target is missing: ${e.id}`);if(k.current!==t)return;o.scrollIntoView({behavior:"instant",block:"start"})},[h,u,a]);if(m.length<ae)return null;let A=V.current,ne=b===null||A===null||!A.contains(b.button)?0:ue(A,b.button),X=(e)=>{let t=e?.closest("[data-thread-user-message-navigation-item-id]"),o=V.current;if(t===void 0||t===null||!o.contains(t))return null;let l=t.dataset.threadUserMessageNavigationItemId,w=m.findIndex((s)=>s.id===l);return{button:t,item:m[w],index:w}},U=(e)=>{let t=v.current;if(t===null||t.pointerId!==e.pointerId)return;if(v.current=null,M(null),t.captureTarget.hasPointerCapture(e.pointerId))t.captureTarget.releasePointerCapture(e.pointerId)};return f("nav",{"aria-label":"User messages",className:"thread-user-message-navigation absolute start-4 top-1/2 z-20 -translate-y-1/2",children:f(se,{open:H,onOpenChange:y,side:"inline-end",sideOffset:0,align:"center",alignOffset:ne,trigger:f("div",{ref:V,"data-thread-user-message-navigation-rail-list":!0,"data-scrubbing":z===null?void 0:"",className:"thread-user-message-navigation-rail-list",onPointerEnter:()=>{S.current=null},onPointerDown:(e)=>{if(e.button!==0)return;let t=X(e.target instanceof Element?e.target:null);if(t===null)return;N.current=!1,v.current={pointerId:e.pointerId,itemId:t.item.id,itemIndex:t.index,captureTarget:t.button},t.button.setPointerCapture(e.pointerId),M(t.item.id),x(t),y(!0)},onPointerMove:(e)=>{let t=v.current;if(t===null){let p=X(e.target instanceof Element?e.target:null);if(p!==null){let r=S.current;if(r!==null&&r!==p.index)G(r,p.index,Y);S.current=p.index,x(p)}return}if(t.pointerId!==e.pointerId)return;let o=e.currentTarget.getBoundingClientRect(),l=Math.max(0,Math.min(m.length-1,Math.floor((e.clientY-o.top+e.currentTarget.scrollTop)/oe))),s={button:e.currentTarget.querySelectorAll("[data-thread-user-message-navigation-item-id]")[l],item:m[l],index:l};if(s.item.id===t.itemId)return;G(t.itemIndex,s.index,Y),S.current=s.index,v.current={...t,itemId:s.item.id,itemIndex:s.index},N.current=!0,M(s.item.id),x(s),Q(s.item)},onPointerUp:U,onPointerCancel:U,onLostPointerCapture:U,onPointerLeave:()=>{if(S.current=null,v.current===null&&!H)x(null)},children:f("div",{className:"flex flex-col",children:m.map((e,t)=>f("button",{type:"button","data-thread-user-message-navigation-item-id":e.id,"data-scrub-target":z===e.id?"":void 0,"aria-current":_.has(e.id)?"true":void 0,"aria-label":`Jump to user message ${t+1}`,className:"thread-user-message-navigation-row",onClick:(o)=>{if(N.current){N.current=!1;return}let l={button:o.currentTarget,item:e,index:t};x(l),y(!0),Q(e)},onFocus:(o)=>{x({button:o.currentTarget,item:e,index:t}),y(!0)},children:f("span",{className:"flex h-0.5 w-[30px] items-center",children:f("span",{className:"thread-user-message-navigation-marker"})})},e.id))})}),children:b!==null&&re("div",{className:"bg-popover/95 text-popover-foreground ring-border w-80 max-w-[calc(100vw-1rem)] overflow-hidden rounded-xl p-2 text-sm leading-5 shadow-xl ring-[0.5px] backdrop-blur-sm",children:[f("div",{className:"min-w-0 truncate font-medium",children:b.item.label}),b.item.response.length>0&&f("div",{className:"text-muted-foreground mt-1 line-clamp-3",children:b.item.response})]})})})}function ue(T,h){let u=T.getBoundingClientRect(),i=h.getBoundingClientRect();return i.top+i.height/2-(u.top+u.height/2)}export{ge as ThreadUserMessageNavigationRail};
|
package/dist/codex/styles.css
CHANGED
|
@@ -653,6 +653,18 @@
|
|
|
653
653
|
--codex-shimmer-contrast: #0009;
|
|
654
654
|
}
|
|
655
655
|
|
|
656
|
+
.codex-pending-message .codex-activity-running {
|
|
657
|
+
--codex-shimmer-contrast: var(--codex-foreground);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
@media (prefers-reduced-motion: reduce) {
|
|
661
|
+
.codex-pending-message .codex-activity-running {
|
|
662
|
+
animation: none;
|
|
663
|
+
background: none;
|
|
664
|
+
-webkit-text-fill-color: var(--codex-description-foreground);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
|
|
656
668
|
/* Codex applies `[&_.loading-shimmer-pure-text]:align-top` at the use site to fix the inline-block baseline. */
|
|
657
669
|
.codex-activity-label .codex-activity-running {
|
|
658
670
|
vertical-align: top;
|
|
@@ -892,6 +904,11 @@
|
|
|
892
904
|
overflow-wrap: anywhere;
|
|
893
905
|
}
|
|
894
906
|
|
|
907
|
+
.codex-reasoning-details:focus-visible {
|
|
908
|
+
outline: 2px solid var(--codex-ring);
|
|
909
|
+
outline-offset: -2px;
|
|
910
|
+
}
|
|
911
|
+
|
|
895
912
|
.codex-reasoning-details :is(p, h1, h2, h3, ul, ol, li) {
|
|
896
913
|
margin-top: 0;
|
|
897
914
|
margin-bottom: 0;
|
|
@@ -938,6 +955,28 @@
|
|
|
938
955
|
outline-offset: 0;
|
|
939
956
|
}
|
|
940
957
|
|
|
958
|
+
.codex-user-text-part {
|
|
959
|
+
min-width: 0;
|
|
960
|
+
max-width: 100%;
|
|
961
|
+
width: 100%;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
.codex-user-text-part + .codex-user-text-part {
|
|
965
|
+
margin-top: 8px;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
.codex-user-question-summary {
|
|
969
|
+
overflow: hidden;
|
|
970
|
+
white-space: nowrap;
|
|
971
|
+
text-overflow: ellipsis;
|
|
972
|
+
color: var(--codex-text-secondary);
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
.codex-user-question-answer {
|
|
976
|
+
white-space: pre-wrap;
|
|
977
|
+
overflow-wrap: anywhere;
|
|
978
|
+
}
|
|
979
|
+
|
|
941
980
|
.codex-user-message {
|
|
942
981
|
display: flex;
|
|
943
982
|
width: 100%;
|
|
@@ -1236,3 +1275,77 @@
|
|
|
1236
1275
|
opacity: 1;
|
|
1237
1276
|
}
|
|
1238
1277
|
}
|
|
1278
|
+
|
|
1279
|
+
.codex-edited-files-more {
|
|
1280
|
+
display: flex;
|
|
1281
|
+
align-items: center;
|
|
1282
|
+
justify-content: center;
|
|
1283
|
+
gap: 6px;
|
|
1284
|
+
width: 100%;
|
|
1285
|
+
border: 0;
|
|
1286
|
+
border-top: 1px solid var(--codex-border);
|
|
1287
|
+
background: transparent;
|
|
1288
|
+
padding: 10px 12px;
|
|
1289
|
+
color: var(--codex-text-secondary);
|
|
1290
|
+
font: inherit;
|
|
1291
|
+
font-size: 14px;
|
|
1292
|
+
cursor: pointer;
|
|
1293
|
+
}
|
|
1294
|
+
.codex-edited-files-more:hover,
|
|
1295
|
+
.codex-edited-files-more:focus-visible {
|
|
1296
|
+
background: var(--codex-hover);
|
|
1297
|
+
color: var(--codex-foreground);
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
/* Keep diff line numbers in table flow and use one bounded scroll viewport. */
|
|
1301
|
+
.codex-patch-view {
|
|
1302
|
+
position: relative;
|
|
1303
|
+
min-width: 0;
|
|
1304
|
+
min-height: 0;
|
|
1305
|
+
overflow: auto;
|
|
1306
|
+
overscroll-behavior: contain;
|
|
1307
|
+
isolation: isolate;
|
|
1308
|
+
}
|
|
1309
|
+
.codex-patch-view .d2h-file-wrapper {
|
|
1310
|
+
margin-bottom: 0;
|
|
1311
|
+
border: 0;
|
|
1312
|
+
}
|
|
1313
|
+
.codex-patch-view .d2h-file-diff {
|
|
1314
|
+
overflow: visible;
|
|
1315
|
+
}
|
|
1316
|
+
.codex-patch-view .d2h-diff-table {
|
|
1317
|
+
width: max-content;
|
|
1318
|
+
min-width: 100%;
|
|
1319
|
+
}
|
|
1320
|
+
.codex-patch-view .d2h-code-linenumber {
|
|
1321
|
+
position: static;
|
|
1322
|
+
display: table-cell;
|
|
1323
|
+
min-width: 7.5em;
|
|
1324
|
+
width: 7.5em;
|
|
1325
|
+
vertical-align: top;
|
|
1326
|
+
}
|
|
1327
|
+
.codex-patch-view .d2h-code-line {
|
|
1328
|
+
display: block;
|
|
1329
|
+
width: auto;
|
|
1330
|
+
padding: 0 12px;
|
|
1331
|
+
}
|
|
1332
|
+
.codex-patch-view .d2h-code-line-ctn {
|
|
1333
|
+
width: auto;
|
|
1334
|
+
}
|
|
1335
|
+
.codex-patch-view::-webkit-scrollbar {
|
|
1336
|
+
width: 8px;
|
|
1337
|
+
height: 8px;
|
|
1338
|
+
}
|
|
1339
|
+
.codex-patch-view::-webkit-scrollbar-track,
|
|
1340
|
+
.codex-patch-view::-webkit-scrollbar-corner {
|
|
1341
|
+
background: transparent;
|
|
1342
|
+
}
|
|
1343
|
+
.codex-patch-view::-webkit-scrollbar-thumb {
|
|
1344
|
+
border: 2px solid transparent;
|
|
1345
|
+
border-radius: 999px;
|
|
1346
|
+
background: color-mix(in oklab, var(--codex-foreground) 24%, transparent);
|
|
1347
|
+
background-clip: padding-box;
|
|
1348
|
+
}
|
|
1349
|
+
.codex-patch-view::-webkit-scrollbar-thumb:hover {
|
|
1350
|
+
background-color: color-mix(in oklab, var(--codex-foreground) 40%, transparent);
|
|
1351
|
+
}
|
|
@@ -13,6 +13,10 @@ export interface CodexUserMessageProps {
|
|
|
13
13
|
id: string;
|
|
14
14
|
};
|
|
15
15
|
text: string;
|
|
16
|
+
textParts?: Array<{
|
|
17
|
+
text: string;
|
|
18
|
+
question?: string;
|
|
19
|
+
}>;
|
|
16
20
|
mentions: MessageMention[];
|
|
17
21
|
images: Array<{
|
|
18
22
|
mimeType: string;
|
|
@@ -27,4 +31,4 @@ export declare function CopyAction({ text, label }: {
|
|
|
27
31
|
text: string;
|
|
28
32
|
label: string;
|
|
29
33
|
}): import("react").JSX.Element;
|
|
30
|
-
export declare function CodexUserMessage({ message, text, mentions, images, messageTime, host, bubbleStyle }: CodexUserMessageProps): import("react").JSX.Element;
|
|
34
|
+
export declare function CodexUserMessage({ message, text, textParts, mentions, images, messageTime, host, bubbleStyle }: CodexUserMessageProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,jsxs as h,Fragment as N}from"react/jsx-runtime";import{CheckIcon as w,ChevronDownIcon as I,CopyIcon as E,FileIcon as k}from"lucide-react";import{useEffect as A,useLayoutEffect as R,useRef as O,useState as g}from"react";import{ImageLightbox as L}from"../image-lightbox.js";var M=20,T='a[href], area[href], button, input, select, textarea, summary, audio[controls], video[controls], iframe, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';function v(n,o,s){if(n.toggleAttribute("inert",!o),!o){n.setAttribute("aria-hidden","true");return}if(s===null)n.removeAttribute("aria-hidden");else n.setAttribute("aria-hidden",s)}function _(n,o){let s=n.getBoundingClientRect(),i=o.getBoundingClientRect();return s.top>=i.top&&s.right<=i.right&&s.bottom<=i.bottom&&s.left>=i.left}function C({text:n,host:o}){let{t:s,Markdown:i}=o,a=O(null),[l,x]=g(!1),[d,b]=g(!1);return R(()=>{let r=a.current;if(!r)throw Error("Codex user message content is missing");let t=()=>{if(r.scrollHeight===0){x(!1);return}let f=Number.parseFloat(getComputedStyle(r).lineHeight);if(!Number.isFinite(f))throw Error("Codex user message line height is invalid");x(r.scrollHeight>M*f+1)};t();let u=new ResizeObserver(t);return u.observe(r),()=>u.disconnect()},[]),A(()=>{if(!l||d)return;let r=a.current;if(!r)throw Error("Codex user message content is missing");let t=new Map,u=typeof IntersectionObserver>"u"?null:new IntersectionObserver((c)=>{for(let m of c){let p=m.target;if(!t.has(p))continue;v(p,m.isIntersecting&&m.intersectionRatio>=1,t.get(p))}},{root:r,rootMargin:"0px",threshold:1}),f=()=>{for(let c of t.keys()){if(r.contains(c))continue;u?.unobserve(c),t.delete(c)}for(let c of r.querySelectorAll(T)){if(t.has(c)||c.hasAttribute("inert"))continue;let m=c.getAttribute("aria-hidden");t.set(c,m),v(c,u===null&&_(c,r),m),u?.observe(c)}};f();let y=new MutationObserver(f);return y.observe(r,{childList:!0,subtree:!0}),()=>{u?.disconnect(),y.disconnect();for(let[c,m]of t)v(c,!0,m)}},[l,d]),h("div",{className:"codex-user-message-content",children:[e("div",{ref:a,className:l&&!d?"codex-user-message-text codex-user-message-text-collapsed":"codex-user-message-text",children:e(i,{text:n,streaming:!1})}),l&&!d&&e("span",{className:"codex-user-message-ellipsis","aria-hidden":"true",children:"…"}),l&&h("button",{type:"button","aria-expanded":d,className:"codex-user-message-collapse-trigger",onClick:()=>{b((r)=>!r)},children:[e("span",{children:d?s("stream.codex.showLess"):s("stream.codex.showMore")}),e(I,{className:d?"codex-user-message-collapse-chevron codex-user-message-collapse-chevron-expanded":"codex-user-message-collapse-chevron","aria-hidden":"true"})]})]})}function q({text:n,label:o}){let[s,i]=g(!1);return e("button",{type:"button",className:"codex-message-action","aria-label":o,title:o,onClick:()=>{navigator.clipboard.writeText(n),i(!0),setTimeout(()=>i(!1),2000)},children:s?e(w,{className:"codex-message-action-confirmed"}):e(E,{})})}function F({image:n,openImage:o}){let[s,i]=g(!1),a=`data:${n.mimeType};base64,${n.data}`;return h(N,{children:[e("button",{type:"button",className:"codex-user-image",onClick:()=>o===void 0?i(!0):o(a),children:e("img",{src:a,alt:""})}),s&&e(L,{src:a,alt:"",onClose:()=>i(!1)})]})}function V({message:n,text:o,textParts:s,mentions:i,images:a,messageTime:l,host:x,bubbleStyle:d}){let{t:b,openImage:r}=x;return e("div",{"data-content-search-unit-key":n.id,"data-message-id":n.id,className:"timeline-break codex-user-message scroll-mt-4",children:h("div",{className:"group/codex-user codex-user-message-group",children:[i.length>0&&e("div",{className:"codex-user-mentions",children:i.map((t)=>h("span",{className:"codex-user-mention",title:t.title,children:[e(k,{"aria-hidden":"true"}),e("span",{className:"codex-user-mention-label",children:t.label})]},t.key))}),a.length>0&&e("div",{className:"codex-user-images",children:a.map((t)=>e(F,{image:t,openImage:r},`${t.mimeType}:${t.data}`))}),o.length>0&&e(N,{children:e("div",{"data-user-message-bubble":!0,tabIndex:0,className:"codex-user-bubble",style:d,children:s?s.map((t,u)=>e("div",{className:"codex-user-text-part",children:t.question===void 0?e(C,{text:t.text,host:x}):h(N,{children:[e("div",{className:"codex-user-question-summary",title:t.question,children:t.question}),e("div",{className:"codex-user-question-answer",children:t.text})]})},u)):e(C,{text:o,host:x})})}),h("div",{className:"codex-user-actions",children:[e(q,{text:o,label:b("actions.copy")}),l&&e("span",{className:"codex-user-time",title:l.full,children:l.short})]})]})})}export{V as CodexUserMessage,q as CopyAction};
|
|
@@ -13,9 +13,13 @@ export interface CompletionMenuProps {
|
|
|
13
13
|
forcedOpen?: boolean;
|
|
14
14
|
onForcedOpenChange?: (open: boolean) => void;
|
|
15
15
|
emptyLabel: string;
|
|
16
|
+
fileStatusLabels?: {
|
|
17
|
+
loading: string;
|
|
18
|
+
empty: string;
|
|
19
|
+
};
|
|
16
20
|
morePlugins?: {
|
|
17
21
|
label: string;
|
|
18
22
|
open: () => void;
|
|
19
23
|
};
|
|
20
24
|
}
|
|
21
|
-
export declare function CompletionMenu({ handleRef, anchorRef, commands, searchFiles, onMention, onSearchError, fileSearchDebounceMs, bashMode, forcedOpen, onForcedOpenChange, emptyLabel,
|
|
25
|
+
export declare function CompletionMenu({ handleRef, anchorRef, commands, searchFiles, onMention, onSearchError, fileSearchDebounceMs, bashMode, forcedOpen, onForcedOpenChange, emptyLabel, fileStatusLabels, morePlugins }: CompletionMenuProps): import("react").JSX.Element | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as c,jsxs as E,Fragment as ot}from"react/jsx-runtime";import{autoUpdate as st}from"@floating-ui/dom";import{BookOpenTextIcon as it,FileIcon as lt,StoreIcon as ut}from"lucide-react";import{useCallback as at,useEffect as p,useLayoutEffect as Q,useMemo as G,useRef as J,useState as v}from"react";import{createPortal as ct}from"react-dom";import{Button as X}from"../ui/button.js";import{Separator as dt}from"../ui/separator.js";import{cn as Y}from"cn";import{filterSlashCommands as Z}from"./completion-filter.js";import{detectTrigger as ft}from"./completion-trigger.js";import{usePromptInputController as mt}from"./prompt-input-context.js";function It({handleRef:d,anchorRef:u,commands:T,searchFiles:l,onMention:F,onSearchError:A,fileSearchDebounceMs:q=0,bashMode:B=!1,forcedOpen:s=!1,onForcedOpenChange:f,emptyLabel:R,fileStatusLabels:h,morePlugins:D}){let S=mt(),i=S.textInput.value,[z,_]=v(0),[x,N]=v(null),[y,L]=v(0),U=J(null);p(()=>{let t=d.current?.getTextarea();if(!t)return;let e=()=>_(t.selectionStart??0),n=()=>{if(document.activeElement===t)e()};return t.addEventListener("keyup",e),t.addEventListener("click",e),t.addEventListener("input",e),t.addEventListener("select",e),t.addEventListener("focus",e),document.addEventListener("selectionchange",n),()=>{t.removeEventListener("keyup",e),t.removeEventListener("click",e),t.removeEventListener("input",e),t.removeEventListener("select",e),t.removeEventListener("focus",e),document.removeEventListener("selectionchange",n)}});let V=G(()=>B&&i.startsWith("!")?null:ft(i,z),[i,z,B]),r=V?.kind==="at"&&!l?null:V,P=`${r?.kind??"forced"}:${r?.query??""}:${s}`,[O,tt]=v(P);if(O!==P)tt(P),L(0);let b=J(null);p(()=>{if(!s){b.current=null;return}if(b.current===null)b.current=i;else if(i!==b.current)f?.(!1)},[s,i,f]);let g=r?.kind==="at"?r.query:null;p(()=>{if(g===null||!l){N(null);return}let t=!0,e=()=>{l(g).then((o)=>{if(t)N({query:g,search:l,items:o})},(o)=>{if(t)N({query:g,search:l,items:[]}),A(o)})},n=q>0?window.setTimeout(e,q):null;if(n===null)e();return()=>{if(t=!1,n!==null)window.clearTimeout(n)}},[g,l,q,A]);let m=G(()=>{if(r?.kind==="at")return x?.query===r.query&&x.search===l?x.items:[];if(r)return Z(T,r.query);if(s)return Z(T,"");return[]},[r,s,T,x,l]),[et,j]=v(!1);p(()=>{let t=d.current?.getTextarea();if(!t)return;let e=()=>j(!0),n=()=>{if(j(!1),s)f?.(!1)};return j(document.activeElement===t),t.addEventListener("focus",e),t.addEventListener("blur",n),()=>{t.removeEventListener("focus",e),t.removeEventListener("blur",n)}},[d,s,f]),p(()=>{if(s)d.current?.getTextarea()?.focus()},[s,d]);let a=et&&(r!==null?r.kind==="slash"||m.length>0||!!h:s);p(()=>{if(!a)return;U.current?.querySelector(`[data-idx="${y}"]`)?.scrollIntoView({block:"nearest"})},[y,a]);function W(t){let e=d.current?.getTextarea();if(!e)return;let n,o;if(r){let M=r.kind==="slash"?`/${t.payload} `:`@${t.label} `;if(n=i.slice(0,r.start)+M+i.slice(r.end),r.kind==="at")F?.(t.payload);o=r.start+M.length}else if(s)n=`${i.length===0||i.endsWith(`
|
|
2
2
|
`)?i:`${i}
|
|
3
|
-
`}/${t.payload} `,o=n.length,f?.(!1);else return;
|
|
3
|
+
`}/${t.payload} `,o=n.length,f?.(!1);else return;S.textInput.setInput(n),requestAnimationFrame(()=>{e.focus(),e.setSelectionRange(o,o)})}p(()=>{let t=d.current?.getTextarea();if(!t)return;let e=(n)=>{if(!a)return;if(n.isComposing||n.keyCode===229)return;if(n.key==="ArrowDown")n.preventDefault(),n.stopPropagation(),L((o)=>m.length===0?0:Math.min(m.length-1,o+1));else if(n.key==="ArrowUp")n.preventDefault(),n.stopPropagation(),L((o)=>Math.max(0,o-1));else if(n.key==="Enter"||n.key==="Tab"){n.preventDefault(),n.stopPropagation();let o=m[y];if(o)W(o)}else if(n.key==="Escape")if(n.preventDefault(),n.stopPropagation(),r)_(Math.max(0,r.start-1)),t.setSelectionRange(r.start,r.start);else f?.(!1)};return t.addEventListener("keydown",e,!0),()=>t.removeEventListener("keydown",e,!0)});let[w,H]=v(null),[C,nt]=v(null),I=at(()=>{let t=u?.current;if(!t)return;let e=t.getBoundingClientRect();H({left:e.left,width:e.width,bottom:window.innerHeight-e.top+8})},[u]);if(Q(()=>{if(!a){H(null);return}I()},[a,I]),Q(()=>{let t=u?.current;if(!a||!t||!C)return;return st(t,C,I,{animationFrame:!0})},[a,C,u,I]),!a||u&&!w)return null;let k=r?r.kind==="slash":s,rt=k?it:lt,K=c("div",{ref:nt,className:u?"fixed z-50":"absolute inset-x-0 bottom-full z-50 mb-2",style:u&&w?{left:w.left,width:w.width,bottom:w.bottom}:void 0,children:E("div",{ref:U,role:"listbox",onMouseDown:(t)=>t.preventDefault(),className:"bg-popover text-popover-foreground ring-foreground/10 pointer-events-auto w-full overflow-hidden rounded-lg p-1 shadow-md ring-1 outline-hidden",children:[E("div",{className:"max-h-72 overflow-y-auto",children:[m.length===0&&k&&c("div",{className:"text-muted-foreground px-2 py-3 text-xs",children:R}),m.length===0&&!k&&h&&c("div",{role:"status",className:"text-muted-foreground px-2 py-3 text-xs",children:x?.query===g&&x.search===l?h.empty:h.loading}),m.map((t,e)=>E(X,{type:"button",variant:"ghost",role:"option","aria-selected":e===y,"data-idx":e,onMouseDown:(n)=>{n.preventDefault(),W(t)},onMouseEnter:()=>L(e),className:Y("flex h-auto w-full items-center justify-start gap-2.5 rounded-md px-2.5 py-2 text-start",e===y&&"bg-muted"),children:[c(rt,{className:Y("size-4 shrink-0",k?"text-blue-500":"text-muted-foreground")}),c("span",{className:"text-foreground shrink-0 text-sm font-medium",children:t.label}),t.description&&c("span",{className:"text-muted-foreground min-w-0 flex-1 truncate text-xs",children:t.description})]},t.key))]}),k&&D&&E(ot,{children:[c(dt,{}),E(X,{type:"button",variant:"ghost",onMouseDown:(t)=>{t.preventDefault(),f?.(!1),D.open()},className:"h-auto w-full justify-start px-2.5 py-2",children:[c(ut,{"data-icon":"inline-start"}),D.label]})]})]})});return u?ct(K,document.body):K}export{It as CompletionMenu};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
function
|
|
1
|
+
function u(r,e){if(e===0)return null;let n=e-1;while(n>=0){let t=r[n];if(t===" "||t==="\t"||t===`
|
|
2
2
|
`)return null;if(t==="@"||t==="/"){let i=n===0?"":r[n-1],l=n===0||i===`
|
|
3
|
-
`;if(t==="/"?l:l||i===" "||i==="\t")return{kind:t==="/"?"slash":"at",start:n,end:e,query:r.slice(n+1,e)}}n-=1}return null}export{
|
|
3
|
+
`;if(t==="/"?l&&!/[\/\\]/.test(r.slice(n+1,e)):l||i===" "||i==="\t")return{kind:t==="/"?"slash":"at",start:n,end:e,query:r.slice(n+1,e)}}n-=1}return null}export{u as detectTrigger};
|