@alwith/module-chat 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -10
- package/dist/activity-host.d.ts +1 -0
- package/dist/activity-host.js +1 -1
- package/dist/approval/choice-elicitation-form.js +1 -1
- package/dist/approval/choice-schema.js +1 -1
- package/dist/approval/permission-options.js +1 -1
- package/dist/approval/permission-view.js +1 -1
- package/dist/approval/schema-elicitation-form.js +1 -1
- package/dist/approval/url-elicitation-card.js +1 -1
- package/dist/chunk-15nwm04a.js +2 -0
- package/dist/chunk-16y5rmm5.js +2 -0
- package/dist/chunk-1d4c9j8w.js +2 -0
- package/dist/chunk-20zcgxa5.js +4 -0
- package/dist/chunk-2epnn4sq.js +1 -0
- package/dist/chunk-2f19pcpn.js +2 -0
- package/dist/chunk-3vt71emt.js +2 -0
- package/dist/{chunk-6ynartgd.js → chunk-42zr8zpv.js} +2 -2
- package/dist/{chunk-7ex6r8ja.js → chunk-4svwa5p8.js} +3 -3
- package/dist/chunk-4tkxmh52.js +2 -0
- package/dist/chunk-5grywgpq.js +4 -0
- package/dist/chunk-5h13saah.js +2 -0
- package/dist/chunk-5j3wnans.js +2 -0
- package/dist/{chunk-wnq8g0kp.js → chunk-6p5hgnpq.js} +1 -1
- package/dist/{chunk-2sgxwycp.js → chunk-6qa5dt1k.js} +1 -1
- package/dist/{chunk-6q8b8aww.js → chunk-6qn5srgg.js} +1 -1
- package/dist/{chunk-8md0gr7j.js → chunk-6vky4fcv.js} +2 -2
- package/dist/chunk-7kcdf82d.js +2 -0
- package/dist/{chunk-wmsdg5fb.js → chunk-7q7c0mds.js} +1 -1
- package/dist/{chunk-vk39871j.js → chunk-801v0awm.js} +1 -1
- package/dist/{chunk-fmxt5ysw.js → chunk-8e7xf2tb.js} +1 -1
- package/dist/chunk-8k7wzkna.js +2 -0
- package/dist/chunk-8vvn71rf.js +2 -0
- package/dist/{chunk-3z0y9amd.js → chunk-9ab18v07.js} +2 -2
- package/dist/{chunk-r125b0z5.js → chunk-9dsa5vm7.js} +2 -2
- package/dist/chunk-9pdj44jr.js +2 -0
- package/dist/{chunk-s2n85pks.js → chunk-9s1cgt7s.js} +1 -1
- package/dist/chunk-aqj0v5a9.js +7 -0
- package/dist/chunk-azmqtycn.js +2 -0
- package/dist/{chunk-3t2c4zky.js → chunk-b5mkvr4d.js} +2 -2
- package/dist/chunk-bfe7xk9m.js +3 -0
- package/dist/{chunk-ahcmeqvb.js → chunk-bkbemt8g.js} +2 -2
- package/dist/{chunk-d0ptk8x8.js → chunk-c4621n0b.js} +1 -1
- package/dist/{chunk-9f42d428.js → chunk-cw9tg2sz.js} +1 -1
- package/dist/{chunk-dp4g5y18.js → chunk-d675nr2b.js} +2 -2
- package/dist/{chunk-2v9kbth7.js → chunk-d8gwsw6j.js} +3 -3
- package/dist/{chunk-38skakaz.js → chunk-dgp9q950.js} +1 -1
- package/dist/{chunk-kk9q6wtq.js → chunk-dm31xvh3.js} +2 -2
- package/dist/chunk-dr6z453e.js +2 -0
- package/dist/{chunk-1vxrdkew.js → chunk-ea7zsd2s.js} +2 -2
- package/dist/chunk-fgsd4fsd.js +2 -0
- package/dist/chunk-fvnb8ds4.js +2 -0
- package/dist/{chunk-tcqf45rf.js → chunk-h0dq9ztv.js} +2 -2
- package/dist/{chunk-gnthx1zg.js → chunk-h38yw8y3.js} +1 -1
- package/dist/chunk-h6df4xfd.js +2 -0
- package/dist/chunk-h87xp1gv.js +2 -0
- package/dist/{chunk-bwzjm3g8.js → chunk-hx6wfscz.js} +1 -1
- package/dist/chunk-j2mcvb68.js +7 -0
- package/dist/chunk-jeyvacx6.js +5 -0
- package/dist/chunk-jh8jske0.js +2 -0
- package/dist/chunk-jn2pj92h.js +2 -0
- package/dist/{chunk-dj8v2w6n.js → chunk-jrrvpnf3.js} +1 -1
- package/dist/chunk-jsb0zged.js +2 -0
- package/dist/chunk-k2y4cpra.js +2 -0
- package/dist/{chunk-nfd274y3.js → chunk-k7zzrns3.js} +1 -1
- package/dist/chunk-m2myfd89.js +2 -0
- package/dist/chunk-m2wxz0sj.js +2 -0
- package/dist/chunk-nxarfyj2.js +2 -0
- package/dist/chunk-p1pd1twf.js +2 -0
- package/dist/chunk-p6558tbk.js +2 -0
- package/dist/{chunk-fk5nvz2s.js → chunk-phe3an96.js} +2 -2
- package/dist/{chunk-en6qem8e.js → chunk-q7e2bdav.js} +2 -2
- package/dist/chunk-qh5fhcrh.js +3 -0
- package/dist/{chunk-3abwky4a.js → chunk-sky795ex.js} +1 -1
- package/dist/chunk-t3vgbc9s.js +2 -0
- package/dist/{chunk-g13txkf0.js → chunk-t5nstx0k.js} +2 -2
- package/dist/chunk-trgq8rq1.js +2 -0
- package/dist/{chunk-h96s3j1e.js → chunk-v0zn87k5.js} +2 -2
- package/dist/chunk-v72t4sf9.js +2 -0
- package/dist/chunk-vhat5rbz.js +2 -0
- package/dist/chunk-vw2hv2sq.js +2 -0
- package/dist/{chunk-jaf9msp7.js → chunk-w3yddw6n.js} +2 -2
- package/dist/chunk-x9pramem.js +2 -0
- package/dist/chunk-xjen1yt6.js +2 -0
- package/dist/chunk-ypvjzkfb.js +2 -0
- package/dist/codex/activity-group.js +1 -1
- package/dist/codex/assistant-message.js +1 -2
- package/dist/codex/async-question-card.js +1 -3
- package/dist/codex/disclosure-state.js +1 -1
- package/dist/codex/edited-files-card.js +1 -1
- package/dist/codex/image-view-activity.js +1 -1
- package/dist/codex/markdown-renderer.js +1 -6
- package/dist/codex/navigation-audio.js +1 -1
- package/dist/codex/navigation-preview.js +1 -1
- package/dist/codex/navigation-rail.js +1 -1
- package/dist/codex/plan.js +1 -1
- package/dist/codex/styles.css +176 -0
- package/dist/codex/timeline-virtualizer.js +1 -1
- package/dist/codex/user-message.js +1 -1
- package/dist/codex/virtualized-turn-list.js +1 -1
- package/dist/composer/completion-filter.js +1 -1
- package/dist/composer/completion-menu.js +2 -2
- package/dist/composer/completion-trigger.js +1 -1
- package/dist/composer/effort-slider.js +1 -1
- package/dist/composer/menu-radio.js +1 -1
- package/dist/composer/model-select.js +1 -1
- package/dist/composer/permission-mode-select.js +1 -1
- package/dist/composer/prompt-input-attachments.js +1 -1
- package/dist/composer/prompt-input-clipboard.js +1 -1
- package/dist/composer/prompt-input-context.js +1 -1
- package/dist/composer/prompt-input-textarea.js +3 -3
- package/dist/composer/prompt-input.js +1 -1
- package/dist/image-lightbox.js +1 -1
- package/dist/image-preview-dialog.js +1 -1
- package/dist/lib/code-highlighter.js +1 -1
- package/dist/lib/fuzzy.js +1 -1
- package/dist/lib/group-blocks.js +1 -1
- package/dist/lib/image-encode.js +1 -1
- package/dist/lib/limits.js +1 -1
- package/dist/lib/markdown-parser.js +1 -1
- package/dist/lib/markdown-rules.js +1 -1
- package/dist/lib/model-name.js +1 -1
- package/dist/lib/pointer-centered-zoom.js +1 -1
- package/dist/lib/prepare-prompt-files.js +1 -1
- package/dist/lib/stream-style.js +1 -1
- package/dist/lib/streaming-markdown.js +1 -1
- package/dist/locales.d.ts +312 -0
- package/dist/locales.js +1 -1
- package/dist/search/chat-search.js +1 -1
- package/dist/search/dom-matches.js +1 -1
- package/dist/search/find-bar.js +1 -1
- package/dist/search/literal-matches.js +1 -1
- package/dist/session-timeline/activity-group.d.ts +7 -0
- package/dist/session-timeline/activity-group.js +1 -0
- package/dist/session-timeline/activity-projection.d.ts +3 -0
- package/dist/session-timeline/activity-projection.js +1 -0
- package/dist/session-timeline/assistant-content.d.ts +7 -0
- package/dist/session-timeline/assistant-content.js +1 -0
- package/dist/session-timeline/assistant-turn.d.ts +28 -0
- package/dist/session-timeline/assistant-turn.js +1 -0
- package/dist/session-timeline/async-questions.d.ts +5 -0
- package/dist/session-timeline/async-questions.js +1 -0
- package/dist/session-timeline/edited-files-card.d.ts +18 -0
- package/dist/session-timeline/edited-files-card.js +1 -0
- package/dist/session-timeline/history-timeline.d.ts +12 -0
- package/dist/session-timeline/history-timeline.js +1 -0
- package/dist/session-timeline/host.d.ts +14 -0
- package/dist/session-timeline/host.js +1 -0
- package/dist/session-timeline/navigation-rail.d.ts +10 -0
- package/dist/session-timeline/navigation-rail.js +1 -0
- package/dist/session-timeline/plan.d.ts +4 -0
- package/dist/session-timeline/plan.js +1 -0
- package/dist/session-timeline/question-reply.d.ts +8 -0
- package/dist/session-timeline/question-reply.js +1 -0
- package/dist/session-timeline/resource-content.d.ts +7 -0
- package/dist/session-timeline/resource-content.js +1 -0
- package/dist/session-timeline/session-timeline.d.ts +40 -0
- package/dist/session-timeline/session-timeline.js +1 -0
- package/dist/session-timeline/timeline-registry.d.ts +12 -0
- package/dist/session-timeline/timeline-registry.js +1 -0
- package/dist/session-timeline/turn-error.d.ts +14 -0
- package/dist/session-timeline/turn-error.js +1 -0
- package/dist/session-timeline/turn-retry.d.ts +2 -0
- package/dist/session-timeline/turn-retry.js +1 -0
- package/dist/session-timeline/turn-time.d.ts +5 -0
- package/dist/session-timeline/turn-time.js +1 -0
- package/dist/session-timeline/turns.d.ts +51 -0
- package/dist/session-timeline/turns.js +1 -0
- package/dist/session-timeline/types.d.ts +31 -0
- package/dist/session-timeline/types.js +0 -0
- package/dist/session-timeline/use-timeline-scroll.d.ts +12 -0
- package/dist/session-timeline/use-timeline-scroll.js +1 -0
- package/dist/session-timeline/user-message.d.ts +8 -0
- package/dist/session-timeline/user-message.js +1 -0
- package/dist/ui/badge.js +1 -1
- package/dist/ui/button.js +1 -1
- package/dist/ui/card.js +1 -1
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/field.js +1 -1
- package/dist/ui/hover-card.js +1 -1
- package/dist/ui/input-group-textarea.js +1 -1
- package/dist/ui/input-group.js +1 -1
- package/dist/ui/input.js +1 -1
- package/dist/ui/label.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 +32 -4
- package/dist/chunk-35j3t609.js +0 -2
- package/dist/chunk-6mhdcz0h.js +0 -2
- package/dist/chunk-6pmsbx1j.js +0 -2
- package/dist/chunk-7ar540cc.js +0 -2
- package/dist/chunk-7xdvwjxh.js +0 -2
- package/dist/chunk-98g6kwj5.js +0 -2
- package/dist/chunk-bbw2zg1a.js +0 -2
- package/dist/chunk-c4ps9628.js +0 -2
- package/dist/chunk-c8dr4btd.js +0 -2
- package/dist/chunk-d4e74rv1.js +0 -2
- package/dist/chunk-fk1z4bmr.js +0 -2
- package/dist/chunk-j3my6gn8.js +0 -1
- package/dist/chunk-k0mayxgs.js +0 -2
- package/dist/chunk-k4w61adv.js +0 -2
- package/dist/chunk-p141s624.js +0 -2
- package/dist/chunk-rgy601b7.js +0 -2
- package/dist/chunk-sdv6vdhr.js +0 -7
- package/dist/chunk-sptvg9xh.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createStore as l}from"@alwith/api/client";var Ee=l({sessionId:null,turns:[],api:null,beforeReveal:null});function tn(e){Ee.setState(e)}function nn(e){if(Ee.getState().sessionId===e)Ee.setState({sessionId:null,turns:[],api:null,beforeReveal:null})}async function tr(e,t,n){let i=Ee.getState();if(n.aborted||e===null||i.sessionId!==e||i.api===null)return;if(i.beforeReveal===null)throw Error("Mounted timeline has no navigation lifecycle");i.beforeReveal(),await i.api.scrollToKey(t,void 0,{align:"top"})}
|
|
2
|
+
export{Ee,tn,nn,tr};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{pe,lt}from"./chunk-h6df4xfd.js";function c(t){return{key:t.name,label:t.name,description:t.description??void 0,payload:t.name}}function X(t,s,o=50){let i=new Set,r=t.filter((n)=>{if(i.has(n.name))return!1;return i.add(n.name),!0});if(!s)return r.slice(0,o).map(c);let l=s.toLowerCase(),e=[];for(let n of r){let a=pe(n.name,s);if(a)e.push({c:n,score:a.score});else if(n.description?.toLowerCase().includes(l))e.push({c:n,score:-1})}return e.sort((n,a)=>a.score-n.score),e.slice(0,o).map((n)=>c(n.c))}function In(t,s,o,i=50){let r=o?`${o.replace(/\/$/,"")}/`:"",l=t.map((e)=>({abs:e,rel:r&&e.startsWith(r)?e.slice(r.length):e}));return lt(l,s,(e)=>e.rel,i).map(({item:e})=>({key:e.abs,label:e.rel,payload:e.abs}))}
|
|
2
|
+
export{X,In};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var t=new Map;var a=0;function Ce(e,n){let r=n?void 0:t.get(e);if(r===void 0)return null;return t.delete(e),t.set(e,r),{...r,tokens:structuredClone(r.tokens)}}function c(e){if(e.isStreaming||e.text.length>1048576)return;if(t.delete(e.text))a-=e.text.length;t.set(e.text,{...e,tokens:structuredClone(e.tokens)}),a+=e.text.length;while(a>2097152||t.size>200){let n=t.keys().next().value;a-=n.length,t.delete(n)}}class l{worker=new Worker(new URL("@alwith/module-chat/markdown-parser.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(e)=>{let n=e.data,r=this.active;if(n.clientId!==r?.clientId||n.revision!==r.revision){this.fail(Error("Markdown worker returned an unexpected request"));return}if(this.active=null,!n.ok){this.fail(Error(n.error));return}let i={...r.input,tokens:n.tokens};c(i);let s=this.clients.get(r.clientId),o=this.pending.get(r.clientId),u=o!==void 0&&r.input.isStreaming&&o.input.isStreaming&&o.input.text.startsWith(r.input.text);if(s!==void 0&&(s.revision===r.revision||u))s.onResult(i);this.dispatch()},this.worker.onerror=(e)=>this.fail(Error(e.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize Markdown parsing result"))}fail(e){this.failure=e,this.worker.terminate(),this.pending.clear(),this.active=null;for(let n of this.clients.values())n.onError(e)}send(e){try{this.worker.postMessage(e)}catch(n){this.fail(n instanceof Error?n:Error(String(n)))}}dispatch(){if(this.active!==null||this.pending.size===0)return;let e=this.pending.values().next().value;this.pending.delete(e.clientId),this.active=e,this.send({type:"parse",clientId:e.clientId,revision:e.revision,source:e.input.source})}connect(e,n){if(this.failure!==null)throw this.failure;let r=++this.nextClientId,i={revision:0,onResult:e,onError:n};return this.clients.set(r,i),{update:(s)=>{if(this.failure!==null)throw this.failure;i.revision+=1;let o=Ce(s.text,s.isStreaming);if(o!==null){this.pending.delete(r),i.onResult(o);return}this.pending.set(r,{clientId:r,revision:i.revision,input:s}),this.dispatch()},dispose:()=>{if(!this.clients.delete(r))return;if(this.pending.delete(r),this.clients.size===0)this.worker.terminate(),d=void 0;else if(this.failure===null)this.send({type:"dispose",clientId:r})}}}}var d;function qt(e,n){return d??=new l,d.connect(e,n)}
|
|
2
|
+
export{Ce,qt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Pt,O}from"../chunk-aqj0v5a9.js";import"../chunk-m2wxz0sj.js";import"../chunk-trgq8rq1.js";import"../chunk-d8gwsw6j.js";import"../chunk-7kcdf82d.js";import"../chunk-v0zn87k5.js";import"../chunk-azmqtycn.js";export{O as CodexActivityGroup,Pt as CodexWorkSection};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`),w=!e.streaming&&h.trim().length>0?n(U,{text:h,isMostRecentTurn:s,beforeCopy:a,afterCopy:x,time:r}):null,d=Ee(e.content,"compact"),f=d.reduce((o,c,p)=>c.kind==="codexActivityGroup"?p:o,-1),v=d.findIndex((o,c)=>c>f&&o.kind==="block"&&o.block.type==="text"),P=[...e.content].toReversed().find((o)=>o.type==="text"),m=e.content.filter((o)=>o.type==="tool_use"&&l(o).category==="edit"),R=(o)=>{if(o.kind==="codexActivityGroup"){let c=o.blocks.filter((p)=>p.type!=="tool_use"||!i.has(p.name));return c.length===0?null:n(ce,{blocks:c},`activity:${A(c[0])}`)}if(o.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${o.kind}`);return n(S,{block:o.block,streaming:Boolean(e.streaming),actions:o.block===P?w:void 0,renderText:b},A(o.block))},g=f===-1?0:v===-1?d.length:v;return n(W,{stateKey:e.id,active:Boolean(e.streaming),startedAt:e.startedAt,durationMs:e.durationMs,providerId:e.providerId,providerIcon:M,work:d.slice(0,g).map(R),answer:d.length>g?d.slice(g).map(R):null,footer:f!==-1&&m.length>0&&(C===void 0?n(le,{blocks:m}):C(m))})}function U({text:e,isMostRecentTurn:s=!1,beforeCopy:i,afterCopy:r,time:a}){let{t:x}=t();return y("div",{className:I("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",s?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[i,n(B,{text:e,label:x("actions.copy")}),r,a&&n("span",{className:"codex-user-time ms-1",title:a.full,children:a.short})]})}function T(){let{t:e}=t();return n("div",{className:"codex-pending-message py-2",role:"status",children:n("span",{className:"codex-activity-running",children:e("message.thinking")})})}function W({work:e,answer:s,footer:i,loading:r=!1,...a}){if(r)return n(T,{});return y("div",{className:"group/am codex-assistant-turn",children:[e.length>0&&n(de,{...a,children:e}),s!==null&&(e.length===0?s:n("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:s})),i]})}export{z as CodexAssistantMessage,W as CodexAssistantTurn,U as CodexMessageActions};
|
|
1
|
+
import{Wn,fe,he}from"../chunk-bfe7xk9m.js";import"../chunk-t5nstx0k.js";import"../chunk-4svwa5p8.js";import"../chunk-w3yddw6n.js";import"../chunk-q7e2bdav.js";import"../chunk-aqj0v5a9.js";import"../chunk-m2wxz0sj.js";import"../chunk-trgq8rq1.js";import"../chunk-d8gwsw6j.js";import"../chunk-7kcdf82d.js";import"../chunk-v0zn87k5.js";import"../chunk-azmqtycn.js";export{Wn as CodexAssistantMessage,he as CodexAssistantTurn,fe as CodexMessageActions};
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
${JSON.stringify([n])}
|
|
3
|
-
</send_user_message_question_reply>`}function G(n){if(!p(n)||!p(n.codex))return[];let i=n.codex;return(Array.isArray(i.questionReplyParts)?i.questionReplyParts.map((t)=>p(t)?{...t,answer:t.text}:t):[i.questionReply]).filter((t)=>p(t)&&typeof t.questionItemId==="string"&&typeof t.question==="string"&&typeof t.answer==="string").map(({questionItemId:t,question:d,answer:m})=>({questionItemId:t,question:d,answer:m}))}function L({question:n,draft:i,status:a,answer:t,error:d,onChange:m,onSubmit:w,onSkip:Q,t:u}){let f=h(),x=a==="pending",k=a==="answered"||a==="skipped";return g("section",{"aria-labelledby":`${f}-title`,className:"border-border bg-card text-card-foreground flex min-w-0 flex-col gap-3 rounded-xl border p-4",children:[l("h3",{id:`${f}-title`,className:"text-sm font-medium whitespace-pre-wrap",children:n.title}),k?l("p",{className:"text-sm whitespace-pre-wrap",children:a==="answered"?t:u("asyncQuestion.skipped")}):g(A,{children:[(n.options?.length??0)>0&&g(c,{"aria-labelledby":`${f}-title`,disabled:!x,value:i.selected===null?"other":String(i.selected),onValueChange:(y)=>m({...i,selected:y==="other"?null:Number(y)}),children:[n.options?.map((y,b)=>g(r,{className:"flex items-start gap-2 text-sm",children:[l(s,{value:String(b)}),l("span",{className:"whitespace-pre-wrap",children:y})]},b)),g(r,{className:"flex items-center gap-2 text-sm",children:[l(s,{value:"other"}),u("asyncQuestion.other")]})]}),l(o,{"aria-label":u("asyncQuestion.answer"),placeholder:u("asyncQuestion.answer"),value:i.text,readOnly:!x,onChange:(y)=>m({selected:null,text:y.target.value})}),d&&l("p",{role:"alert",className:"text-destructive text-sm",children:d}),g("div",{className:"flex flex-wrap items-center gap-2",children:[l(e,{size:"sm",disabled:!x||v(n,i).trim().length===0,onClick:w,children:u(a==="submitting"?"asyncQuestion.submitting":"asyncQuestion.submit")}),l(e,{size:"sm",variant:"ghost",disabled:!x,onClick:Q,children:u("asyncQuestion.skip")}),(a==="closed"||a==="unavailable")&&l("span",{role:"status",className:"text-muted-foreground text-xs",children:u(`asyncQuestion.${a}`)})]})]})]})}export{L as AsyncQuestionCard,S as asyncQuestionId,D as asyncQuestions,C as initialQuestionDraft,v as questionAnswer,G as questionReplies,B as questionReplyEnvelope};
|
|
1
|
+
import{a,Ie,Yt,Pe,Zt,Ne,Jt}from"../chunk-5grywgpq.js";import"../chunk-k7zzrns3.js";import"../chunk-hx6wfscz.js";import"../chunk-c4621n0b.js";import"../chunk-801v0awm.js";export{Jt as AsyncQuestionCard,Ie as asyncQuestionId,a as asyncQuestions,Yt as initialQuestionDraft,Pe as questionAnswer,Ne as questionReplies,Zt as questionReplyEnvelope};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d}from"../chunk-trgq8rq1.js";export{d as useCodexDisclosureState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{xn,yt,ve}from"../chunk-4svwa5p8.js";import"../chunk-azmqtycn.js";export{yt as CodexEditedFilesCard,ve as EditedFilesCard,xn as fileChanges};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{M,Nt}from"../chunk-m2wxz0sj.js";import"../chunk-trgq8rq1.js";import"../chunk-azmqtycn.js";export{Nt as ImageViewActivity,M as isImageView};
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)?`${e}\`\`\``:`${e}
|
|
3
|
-
\`\`\``}function H(e,n){if(!e.includes(n)||Ce(e,n)%2===0)return e;let t=ye(e,n);if(t<0)return e;let r=e.slice(t+n.length);if(r.length===0||/^\s/.test(r)||r.includes(`
|
|
4
|
-
`)||Y(r))return e;return`${e}${n}`}function Ie(e){return e.startsWith("/")&&!e.startsWith("//")||/^[A-Za-z]:[\\/]/.test(e)||/^\\\\[^\\]+\\[^\\]+/.test(e)||/^\/\/[^/]+\/[^/]+/.test(e)}function Q(e){let n=e.replaceAll("`","").trim(),t=n.match(/^(.*?):(\d+)(?::(\d+))?(?:[-–](\d+)(?::(\d+))?)?$/);if(t!==null){let[,o,s,i,c,d]=t;if(o===void 0||s===void 0)throw Error("Codex file location is incomplete");return{path:o,line:Number.parseInt(s,10),column:i===void 0?void 0:Number.parseInt(i,10),endLine:c===void 0?void 0:Number.parseInt(c,10),endColumn:d===void 0?void 0:Number.parseInt(d,10)}}let r=n.match(/^(.*?)#L(\d+)(?:C(\d+))?(?:-L(\d+)(?:C(\d+))?)?$/);if(r!==null){let[,o,s,i,c,d]=r;if(o===void 0||s===void 0)throw Error("Codex hash file location is incomplete");return{path:o,line:Number.parseInt(s,10),column:i===void 0?void 0:Number.parseInt(i,10),endLine:c===void 0?void 0:Number.parseInt(c,10),endColumn:d===void 0?void 0:Number.parseInt(d,10)}}return{path:n}}function $e(e){let{path:n,line:t,column:r,endLine:o,endColumn:s}=Q(e);if(/^[a-z][a-z0-9+.-]*:\/\//i.test(n)||/^www\./i.test(n)||/^(mailto|tel):/i.test(n))return!1;if(t!==void 0||r!==void 0||o!==void 0||s!==void 0)return!0;if(!/(?:^|[\\/])[^\\/]+\.(?!\d+$)[^\\/.]+$/i.test(n))return!1;let i=/[\\/]/.test(n),c=n.split(/[\\/]/).at(-1);if(c===void 0)throw Error("Codex streaming link target has no file name");let d=c.split(".").at(-1);if(d===void 0||d.length===0)return!1;if(!i&&/[a-z]/.test(d)&&/[A-Z]/.test(d.slice(1)))return!1;if(!i){let u=d.toLowerCase();if(u.length>Te&&!ve.has(u))return!1}return!0}function Re(e){let{path:n}=Q(e);if(Ie(n))return!0;try{return new URL(n).protocol==="file:"}catch{return!1}}function Pe(e){let n=e.match(A);if(n===null)return e;let t=n[2];if(t===void 0)throw Error("Codex streaming link target is missing");return $e(t)||Re(t)?e.replace(A,"$1"):`${e})`}function Se(e){let n=e.replace(xe,"");if(n.length===0||n.includes("`")&&Y(n))return{isCodeFenceOpen:!1,markdown:n};if(n.includes("```")&&Le(n))return{isCodeFenceOpen:!0,markdown:Ee(n)};if(n.includes(")n=Pe(n);return n=H(n,"**"),n=H(n,"*"),{isCodeFenceOpen:!1,markdown:n}}function Fe(e){return e?.type==="paragraph"&&"tokens"in e&&Array.isArray(e.tokens)}function _(e){return Fe(e)&&e.tokens.length===1&&e.tokens[0]?.type==="image"}function ee(e){for(let n=0;n<e.length;n+=1){let t=e[n];if(t===void 0)throw Error(`Codex Markdown token is missing at index ${n}`);if("tokens"in t&&Array.isArray(t.tokens))ee(t.tokens);if(!_(t))continue;let r=[...t.tokens],o=n+1,s=o;for(;;){while(e[o]?.type==="space")o+=1;let i=e[o];if(!_(i))break;r.push(...i.tokens),o+=1,s=o}if(s===n+1)continue;t.tokens=r,t.text=r.map((i)=>i.raw).join(`
|
|
5
|
-
`),t.raw=e.slice(n,s).map((i)=>i.raw).join(""),e.splice(n+1,s-n-1)}}function O(e){return{type:"text",raw:e,text:e}}function Ae(e){return{type:"paragraph",raw:e.raw,text:e.text,tokens:e.tokens??[e]}}function E(e){for(let n of e){if(n.type==="list")for(let t of n.items){let r=t.tokens[0];if(r?.type==="heading"){let o=r,s=o.raw.trimEnd(),i=s.match(/^#{1,6}\s+/)?.[0];if(i!==void 0)t.tokens[0]={type:"paragraph",raw:o.raw,text:s,tokens:o.tokens===void 0?[O(s)]:[O(i),...o.tokens]}}if(t.loose)t.tokens=t.tokens.map((o)=>o.type==="text"?Ae(o):o);E(t.tokens)}if("tokens"in n&&Array.isArray(n.tokens))E(n.tokens)}}function He(e,n,t){e.preventDefault(),e.stopPropagation(),t.openLink(n)}function Oe(e){try{let n=new URL(e);return n.protocol!=="http:"&&n.protocol!=="https:"?null:`${n.origin}/favicon.ico`}catch{return null}}function je(e){let n=Oe(e);return n===null?[]:[n,`https://www.google.com/s2/favicons?domain=${new URL(e).origin}&sz=32`]}function We({href:e}){let n=G(()=>je(e),[e]),[t,r]=h(),o=n.length===0&&!/^[a-z][a-z0-9+.-]*:/i.test(e),s=e.toLowerCase().startsWith("mailto:")?ge:o?ue:me;return g("span",{className:"codex-markdown-favicon",children:[t===void 0?a("span",{className:"codex-markdown-favicon-fallback",children:a(s,{"aria-hidden":!0})}):null,n.map((i)=>a("img",{alt:"",className:t===i?"codex-markdown-favicon-image-loaded":void 0,decoding:"async",draggable:!1,referrerPolicy:"no-referrer",src:i,onLoad:()=>r((c)=>c!==void 0&&n.includes(c)?c:i)},i))]})}function qe({children:e,href:n,title:t}){let r=C();if(r.preview)return a("span",{children:e});return a("a",{className:"codex-markdown-link","data-inline-mention-interactive":"",href:n,title:t,onClick:(o)=>He(o,n,r),children:g("span",{className:"codex-markdown-link-mention","data-layout":"inline-flow","data-interactive":"","data-underline-on-hover":"",children:[a("span",{className:"codex-markdown-link-icon-container","data-markdown-copy":"exclude",children:a(We,{href:n})}),a("span",{className:"codex-markdown-link-label",children:e})]})})}function Ke({code:e,language:n}){let{theme:t,copyLabel:r}=C(),o=k(null),[s,i]=h(null),[c,d]=h(null),[u,w]=h(!1);if(p(()=>{let f=Me(i,d);return o.current=f,()=>{f.dispose(),o.current=null}},[]),p(()=>{let f=o.current;if(f===null)throw Error("Code highlighter is not mounted");f.update(e,n)},[e,n]),c!==null)throw c;let x=s!==null&&s.code===e&&s.language===n?s.html:null;return g("div",{className:"codex-markdown-code-block","data-markdown-copy":"code-block","data-markdown-copy-text":e,"data-theme":t==="dark"?"dark":"light",children:[g("div",{className:"codex-markdown-code-header","data-markdown-copy":"exclude",children:[a("div",{className:"codex-markdown-code-title",children:n}),a("div",{className:"codex-markdown-code-actions",children:a("button",{type:"button",className:"codex-markdown-code-copy",title:r,onClick:()=>{navigator.clipboard.writeText(e),w(!0),window.setTimeout(()=>w(!1),2000)},children:u?a(z,{}):a(de,{})})})]}),a("div",{className:"codex-markdown-code-container",dir:"ltr",children:a("code",{className:"codex-markdown-code-content hljs",...x===null?{children:e}:{dangerouslySetInnerHTML:{__html:x}}})})]})}function ze({code:e,language:n}){return C().preview?a("span",{children:e}):a(Ue,{code:e,language:n})}function Ue({code:e,language:n}){let t=k(null),[r,o]=h(!1);if(p(()=>{if(r)return;let s=t.current;if(s===null)throw Error("Codex code block placeholder is not mounted");if(typeof IntersectionObserver>"u"){let c=window.setTimeout(()=>o(!0),0);return()=>window.clearTimeout(c)}let i=new IntersectionObserver((c)=>{if(!c.some((d)=>d.isIntersecting))return;o(!0),i.disconnect()},{rootMargin:"600px 0px"});return i.observe(s),()=>i.disconnect()},[r]),r)return a(Ke,{code:e,language:n});return a("div",{ref:t,className:"codex-markdown-code-block",children:a("pre",{className:"codex-markdown-code-placeholder",children:a("code",{children:e})})})}function Be(e){let n=[...document.body.querySelectorAll('[data-markdown-image-preview-trigger="true"]')],t=n.map((o)=>{let s=o.querySelector("img");if(s===null)throw Error("Codex image preview trigger has no image");return{src:s.currentSrc||s.src,alt:s.alt}}),r=n.indexOf(e);if(r===-1)throw Error("Codex image preview trigger is outside the document");return{images:t,index:r}}function De({preview:e,setPreview:n}){let t=e.images[e.index];if(t===void 0)throw Error(`Codex image preview index is out of range: ${e.index}`);return g("div",{className:"codex-markdown-image-preview",children:[a("img",{src:t.src,alt:t.alt}),g("div",{className:"codex-markdown-image-preview-actions",children:[a("button",{type:"button","aria-label":"Previous image",disabled:e.index===0,onClick:()=>n({...e,index:e.index-1}),children:a(ie,{})}),a("a",{href:t.src,download:!0,"aria-label":"Download image",children:a(le,{})}),a("button",{type:"button","aria-label":"Next image",disabled:e.index===e.images.length-1,onClick:()=>n({...e,index:e.index+1}),children:a(ce,{})}),a("button",{type:"button","aria-label":"Close image preview",onClick:()=>n(void 0),children:a(fe,{})})]})]})}function Xe(e){return C().preview?a(oe,{children:e.alt}):a(Ge,{...e})}function Ge({src:e,alt:n,title:t,allowWide:r}){let o=k(null),[s,i]=h();p(()=>{let d=o.current;if(d===null)throw Error("Codex image preview dialog is not mounted");if(s===void 0){if(d.open)d.close();return}if(!d.open)d.showModal()},[s]);let c=n.length===0?"Open image preview":n;return g(oe,{children:[a("button",{type:"button",className:`codex-markdown-image-trigger${r?"codex-markdown-image-trigger-wide":""}`,"aria-label":c,"data-markdown-image-preview-trigger":"true",onClick:(d)=>i(Be(d.currentTarget)),children:a("img",{className:`codex-markdown-image${r?"codex-markdown-image-wide":""}`,src:e,alt:n,title:t,loading:"lazy"})}),a("dialog",{ref:o,className:"codex-markdown-image-dialog","aria-label":c,onClose:()=>i(void 0),children:s===void 0?null:a(De,{preview:s,setPreview:i})})]})}function Je({value:e,display:n}){let t=k(null);return D(()=>{if(t.current===null)throw Error("Codex math root is not mounted");se.render(e,t.current,{displayMode:n,throwOnError:!1})},[n,e]),a("span",{ref:t,className:n?"codex-markdown-math-block":"codex-markdown-inline-math"})}var Ve=150,T=null;function j(e,n){let t=T;if(t===null)return e;let r=t.cursor,o=r+e.length;t.cursor=o;let s=[],i=r;for(let c of t.runs){if(c.end<=r)continue;if(c.start>=o)break;let d=Math.max(r,c.start),u=Math.min(o,c.end);if(i<d)s.push(e.slice(i-r,d-r));s.push(a("span",{className:"codex-markdown-fade",children:e.slice(d-r,u-r)},`${n}:${t.generation}:${c.start}`)),i=u}if(i<o)s.push(e.slice(i-r));return s}function ne(e){let n=5381;for(let t=0;t<e.length;t+=1)n=(n*33+e.charCodeAt(t))%4294967296;return n.toString(36)}function W(e){let n=e.trim();if(n.length===0)return"";let t=n.split(`
|
|
6
|
-
`,1)[0];if(t===void 0)throw Error("Codex Markdown token has no first line");return(t.match(/\S+/)?.[0]??t).slice(0,we)}function Ze(e){switch(e.type){case"code":return e.raw.trimStart().match(/^(```|~~~)/)?.[1]??"";case"link":return e.href;case"image":{let n=e;return`${n.href}:${W(n.text)}`}case"html":case"space":case"br":case"hr":case"def":return e.raw;case"math":return W(e.text);default:return""}}function te(e){return`${e.type==="math"?`math-${e.display?"block":"inline"}`:e.type}-${ne(Ze(e))}`}function m(e,n){let t=new Map;return e.map((r)=>{let o=te(r),s=t.get(o)??0;return t.set(o,s+1),re(r,`${n}-${o}-${s}`)})}function Ye(e,n){let t=e.task?e.tokens.filter((r)=>r.type!=="checkbox"):e.tokens;return g("li",{className:`codex-markdown-list-item${e.task?"codex-markdown-task-list-item":""}`,children:[e.task?g("div",{className:"codex-markdown-task-checkbox",children:[a("input",{type:"checkbox",className:"codex-markdown-checkbox",checked:e.checked,"data-state":e.checked?"checked":"unchecked",readOnly:!0,disabled:!0}),e.checked?a(z,{}):null]}):null,m(t,n)]},n)}function Qe(e,n){let r=`codex-markdown-list ${e.items.some((s)=>s.task)?"codex-markdown-task-list":e.ordered?"codex-markdown-ordered-list":"codex-markdown-unordered-list"}`,o=m(e.items,n);return e.ordered?a("ol",{className:r,start:e.start===""?void 0:e.start,children:o},n):a("ul",{className:r,children:o},n)}function q(e,n,t){let r=t?"th":"td",o=/^\d+$/.test(e.text);return U(r,{key:n,className:`${t?"codex-markdown-table-header":"codex-markdown-table-cell"}${o?" codex-markdown-numeric-table-cell":""}`,align:e.align??void 0},...m(e.tokens,n))}function en(e,n){let t=new Map;return a("div",{className:"codex-markdown-table-container","data-markdown-table":!0,tabIndex:-1,children:a("div",{className:"codex-markdown-table-scroller",children:a("div",{className:"codex-markdown-table-wrapper",children:g("table",{className:"codex-markdown-table",children:[a("thead",{children:a("tr",{className:"codex-markdown-table-row",children:e.header.map((r,o)=>q(r,`${n}-header-${o}`,!0))})}),a("tbody",{className:"codex-markdown-table-body",children:e.rows.map((r)=>{let o=ne(r.map((c)=>c.text).join("\x00")),s=t.get(o)??0;t.set(o,s+1);let i=`${n}-row-${o}-${s}`;return a("tr",{className:"codex-markdown-table-row",children:r.map((c,d)=>q(c,`${i}-cell-${d}`,!1))},i)})})]})})})},n)}function K(e,n,t){let r=v(e.href);if(!X(r))return null;return a(Xe,{src:r,alt:I(e.text),title:e.title==null?void 0:v(e.title),allowWide:t},n)}function re(e,n){switch(e.type){case"space":case"def":case"internalMessage":return null;case"hr":return a("hr",{className:"codex-markdown-horizontal-rule"},n);case"heading":{let t=e,o={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"}[t.depth];if(o===void 0)throw Error(`Unsupported Codex Markdown heading depth: ${t.depth}`);return U(o,{key:n,className:`codex-markdown-heading codex-markdown-heading-${t.depth}`},...m(t.tokens,n))}case"paragraph":{let t=e,r=t.tokens.filter((i)=>i.type!=="space"&&i.type!=="br"),o=r.length>0&&r.every((i)=>i.type==="image"),s=o&&r.length>1;return a("p",{className:`codex-markdown-paragraph${o?"codex-markdown-media-paragraph codex-markdown-media-wide-block":""}${s?"codex-markdown-media-grid-paragraph":""}`,"data-markdown-image-grid":s?"true":void 0,"data-wide-markdown-block":o?"true":void 0,"data-wide-markdown-block-kind":o?"image":void 0,children:o?r.map((i,c)=>K(i,`${n}-image-${c}`,!0)):m(t.tokens,n)},n)}case"text":{let t=e;return t.tokens===void 0?j(I(t.text),n):m(t.tokens,n)}case"escape":return j(e.text,n);case"strong":return a("strong",{className:"codex-markdown-strong",children:m(e.tokens,n)},n);case"em":return a("em",{children:m(e.tokens,n)},n);case"del":return a("del",{children:m(e.tokens,n)},n);case"codespan":return a("span",{className:"codex-markdown-inline-code",dir:"ltr","data-markdown-copy":"inline-code",children:e.text},n);case"br":return a("br",{},n);case"link":{let t=e,r=m(t.tokens,n),o=v(t.href);return X(o)?a(qe,{href:o,title:t.title==null?void 0:v(t.title),children:r},n):a("span",{children:r},n)}case"image":return K(e,n,!1);case"code":{let t=e;return a(ze,{code:t.text,language:t.lang},n)}case"blockquote":return a("blockquote",{className:"codex-markdown-blockquote",children:m(e.tokens,n)},n);case"list":return Qe(e,n);case"list_item":return Ye(e,n);case"table":return en(e,n);case"html":{let t=e;return/^<br\s*\/?>$/i.test(t.raw.trim())?a("br",{},n):t.raw}case"math":{let t=e;return a(Je,{value:t.text,display:t.display},n)}default:throw Error(`Unsupported Codex Markdown token: ${JSON.stringify(e)}`)}}function b(e){switch(e.type){case"text":{let n=e;return n.tokens===void 0?I(n.text):n.tokens.map(b).join("")}case"escape":return e.text;case"paragraph":case"heading":case"strong":case"em":case"del":case"link":case"blockquote":case"list_item":return e.tokens.map(b).join("");case"list":return e.items.map(b).join("");case"table":{let n=e;return[n.header,...n.rows].map((t)=>t.map((r)=>r.tokens.map(b).join("")).join("")).join("")}default:return""}}function nn({token:e,tokenKey:n,offset:t,runs:r,generation:o}){let s=T;try{return T={cursor:t,runs:r,generation:o},re(e,n)}finally{T=s}}var tn=B(function({result:n}){let{text:t,isStreaming:r}=n,o=G(()=>{let l=n.tokens;if(n.source.includes("!["))ee(l);E(l);let R=new Map,P=0;return l.map((M)=>{let L=te(M),S=R.get(L)??0;R.set(L,S+1);let F=b(M),ae={token:M,tokenKey:`root-${L}-${S}`,offset:P,visibleText:F};return P+=F.length,ae})},[n]),s=o.map((l)=>l.visibleText).join(""),i=k({text:"",visibleText:"",runs:[],generation:0}),c=i.current,d=t.startsWith(c.text)||s.startsWith(c.visibleText),u=d?c.visibleText.length:0,w=performance.now(),x=r&&d?c.runs.filter((l)=>w-l.firstSeenAtMs<Ve):[],N=c.generation+(d?0:1),f={text:t,visibleText:s,runs:x.filter((l)=>l.start<s.length).map((l)=>({...l,end:Math.min(l.end,s.length)})),generation:N};if(r&&s.length>u)f.runs.push({start:u,end:s.length,firstSeenAtMs:w});return D(()=>{i.current=f}),a("div",{dir:"auto",className:"codex-markdown-content codex-markdown-root","data-streaming":r?"true":void 0,children:o.map((l)=>a(nn,{token:l.token,tokenKey:l.tokenKey,offset:l.offset,runs:f.runs,generation:N},l.tokenKey))})}),rn=B(function({text:n,isStreaming:t}){let r=k(null),[o,s]=h(()=>Z(n,t)),[i,c]=h(null);if(p(()=>{let d=_e((u)=>{pe(()=>s(u))},c);return r.current=d,()=>{d.dispose(),r.current=null}},[]),p(()=>{let d=r.current;if(d===null)throw Error("Markdown parser is not mounted");let u=t?Se(n).markdown:n;d.update({source:u,text:n,isStreaming:t})},[t,n]),i!==null)throw i;return o===null?a("div",{"data-markdown-pending":!0}):a(tn,{result:o})});function gn({text:e,streaming:n,host:t}){let r=n===!0,[o,s]=h(e);return p(()=>{if(o===e)return;if(!r){s(e);return}let i=requestAnimationFrame(()=>s(e));return()=>cancelAnimationFrame(i)},[o,r,e]),a(J.Provider,{value:t,children:a(rn,{text:r?o:e,isStreaming:r})})}export{gn as CodexMarkdownRenderer};
|
|
1
|
+
import{Ot}from"../chunk-j2mcvb68.js";import"../chunk-d675nr2b.js";import"../chunk-bkbemt8g.js";import"../chunk-ypvjzkfb.js";export{Ot as CodexMarkdownRenderer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ft,Xn,Dt,Bt,Yn,ln,yn,dn,Zn,wn,kn,Jn,er}from"../chunk-2f19pcpn.js";export{Xn as armTimelineUserMessageNavigationAudio,yn as automaticNavigationMidiNote,Jn as getNavigationAudioContextState,er as getNavigationInstrumentReady,Dt as installTimelineUserMessageNavigationAudioUnlock,wn as itemPianoKeyIndex,ln as navigationMidiNote,kn as navigationPianoKeyIndexes,Zn as pianoKeyFrequency,dn as pianoKeyMidiNote,Yn as playTimelineUserMessageNavigationNote,Bt as playTimelineUserMessageNavigationSequence,Ft as preloadTimelineUserMessageNavigationInstrument};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{$t}from"../chunk-9dsa5vm7.js";export{$t as NavigationPreview};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{zt}from"../chunk-jn2pj92h.js";import"../chunk-9dsa5vm7.js";export{zt as TimelineUserMessageNavigationRail};
|
package/dist/codex/plan.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{f}from"../chunk-v0zn87k5.js";export{f as CodexPlan};
|
package/dist/codex/styles.css
CHANGED
|
@@ -1501,3 +1501,179 @@
|
|
|
1501
1501
|
.codex-image-chevron-open {
|
|
1502
1502
|
transform: rotate(90deg);
|
|
1503
1503
|
}
|
|
1504
|
+
|
|
1505
|
+
/* Session timeline (session-timeline entry). */
|
|
1506
|
+
.codex-timeline-content {
|
|
1507
|
+
padding-inline: var(--codex-timeline-inline-padding, 20px);
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
.codex-turn-errors {
|
|
1511
|
+
display: flex;
|
|
1512
|
+
flex-direction: column;
|
|
1513
|
+
gap: 16px;
|
|
1514
|
+
margin-block: 16px;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
/* Keep the fade in viewport coordinates so compositor scrolling cannot outrun it. */
|
|
1518
|
+
.codex-timeline-bottom-fade {
|
|
1519
|
+
position: absolute;
|
|
1520
|
+
inset-inline: 0 calc(var(--app-scrollbar-size, 0px) + var(--app-scrollbar-edge-gap, 0px));
|
|
1521
|
+
bottom: 0;
|
|
1522
|
+
height: 24px;
|
|
1523
|
+
pointer-events: none;
|
|
1524
|
+
background: linear-gradient(to bottom, transparent, var(--background));
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
/* Scrollers inside a turn show their bar on hover only; the viewport has its own. */
|
|
1528
|
+
.codex-assistant-turn
|
|
1529
|
+
:is(
|
|
1530
|
+
.codex-markdown-table-scroller,
|
|
1531
|
+
.codex-markdown-code-placeholder,
|
|
1532
|
+
.codex-markdown-code-container,
|
|
1533
|
+
.codex-markdown-math-block,
|
|
1534
|
+
.codex-activity-group-body,
|
|
1535
|
+
.codex-activity-details,
|
|
1536
|
+
.codex-command-output,
|
|
1537
|
+
.codex-reasoning-details
|
|
1538
|
+
) {
|
|
1539
|
+
&::-webkit-scrollbar {
|
|
1540
|
+
width: 0;
|
|
1541
|
+
height: 0;
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
&:hover::-webkit-scrollbar {
|
|
1545
|
+
width: var(--codex-hover-scrollbar-size, 6px);
|
|
1546
|
+
height: var(--codex-hover-scrollbar-size, 6px);
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
&::-webkit-scrollbar-track {
|
|
1550
|
+
background: transparent;
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
&::-webkit-scrollbar-thumb {
|
|
1554
|
+
border-radius: 999px;
|
|
1555
|
+
background-color: color-mix(in oklab, var(--foreground) 18%, transparent);
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
.codex-edited-file-path {
|
|
1560
|
+
display: inline-flex;
|
|
1561
|
+
align-items: center;
|
|
1562
|
+
gap: 6px;
|
|
1563
|
+
min-width: 0;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
.codex-edited-file-icon {
|
|
1567
|
+
flex: 0 0 auto;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
.codex-edited-file-name {
|
|
1571
|
+
min-width: 0;
|
|
1572
|
+
overflow: hidden;
|
|
1573
|
+
text-overflow: ellipsis;
|
|
1574
|
+
white-space: nowrap;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
.codex-user-image {
|
|
1578
|
+
padding: 0;
|
|
1579
|
+
border: 0;
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
/* Image generation: a placeholder while the tool runs, then the result as a preview card. */
|
|
1583
|
+
.codex-image-generation {
|
|
1584
|
+
position: relative;
|
|
1585
|
+
width: min(20rem, 100%);
|
|
1586
|
+
aspect-ratio: 1;
|
|
1587
|
+
overflow: hidden;
|
|
1588
|
+
border-radius: 1.75rem;
|
|
1589
|
+
background: var(--muted);
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
.codex-image-generation-texture {
|
|
1593
|
+
position: absolute;
|
|
1594
|
+
inset: 0;
|
|
1595
|
+
background-image: radial-gradient(
|
|
1596
|
+
circle,
|
|
1597
|
+
color-mix(in srgb, var(--muted-foreground) 25%, transparent) 1px,
|
|
1598
|
+
transparent 1px
|
|
1599
|
+
);
|
|
1600
|
+
background-size: 12px 12px;
|
|
1601
|
+
mask-image: radial-gradient(ellipse at 35% 20%, black, transparent 75%);
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
.codex-image-generation[aria-busy="true"] .codex-image-generation-texture {
|
|
1605
|
+
animation: codex-image-breathe 2.5s ease-in-out infinite alternate;
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
.codex-image-generation-status {
|
|
1609
|
+
position: absolute;
|
|
1610
|
+
inset-inline-end: 1rem;
|
|
1611
|
+
bottom: 1rem;
|
|
1612
|
+
display: flex;
|
|
1613
|
+
align-items: center;
|
|
1614
|
+
gap: 0.5rem;
|
|
1615
|
+
padding: 0.65rem 1rem;
|
|
1616
|
+
border: 1px solid var(--border);
|
|
1617
|
+
border-radius: 999px;
|
|
1618
|
+
background: var(--background);
|
|
1619
|
+
color: var(--foreground);
|
|
1620
|
+
font-size: 0.875rem;
|
|
1621
|
+
font-weight: 500;
|
|
1622
|
+
box-shadow: 0 2px 5px color-mix(in srgb, var(--foreground) 6%, transparent);
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
.codex-generated-image {
|
|
1626
|
+
position: relative;
|
|
1627
|
+
width: fit-content;
|
|
1628
|
+
max-width: min(40rem, 100%);
|
|
1629
|
+
overflow: hidden;
|
|
1630
|
+
border-radius: 1.5rem;
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
.codex-generated-image-preview {
|
|
1634
|
+
display: block;
|
|
1635
|
+
overflow: hidden;
|
|
1636
|
+
border-radius: inherit;
|
|
1637
|
+
cursor: zoom-in;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
.codex-generated-image-download {
|
|
1641
|
+
position: absolute;
|
|
1642
|
+
inset-inline-start: 0.75rem;
|
|
1643
|
+
bottom: 0.75rem;
|
|
1644
|
+
border-radius: 999px;
|
|
1645
|
+
background: var(--background);
|
|
1646
|
+
color: var(--foreground);
|
|
1647
|
+
border: 1px solid var(--border);
|
|
1648
|
+
box-shadow: 0 2px 6px color-mix(in srgb, var(--foreground) 10%, transparent);
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
@media (hover: hover) and (pointer: fine) {
|
|
1652
|
+
.codex-generated-image-download {
|
|
1653
|
+
opacity: 0;
|
|
1654
|
+
transition: opacity 150ms ease;
|
|
1655
|
+
}
|
|
1656
|
+
.codex-generated-image:hover .codex-generated-image-download,
|
|
1657
|
+
.codex-generated-image:focus-within .codex-generated-image-download,
|
|
1658
|
+
.codex-generated-image-download:disabled {
|
|
1659
|
+
opacity: 1;
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
@keyframes codex-image-breathe {
|
|
1664
|
+
from {
|
|
1665
|
+
opacity: 0.35;
|
|
1666
|
+
}
|
|
1667
|
+
to {
|
|
1668
|
+
opacity: 1;
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1673
|
+
.codex-image-generation[aria-busy="true"] .codex-image-generation-texture {
|
|
1674
|
+
animation: none;
|
|
1675
|
+
}
|
|
1676
|
+
.codex-generated-image-download {
|
|
1677
|
+
transition: none;
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Gn,ut,N,ge,mt,pt,gt}from"../chunk-nxarfyj2.js";export{Gn as CODEX_UNKNOWN_TURN_HEIGHT,N as calculateCodexThreadVirtualRange,pt as calculateCodexTurnCenterDistanceFromBottom,gt as calculateCodexTurnTargetDistanceFromBottom,ut as createCodexThreadVirtualLayout,mt as preserveCodexThreadDistanceFromBottom,ge as preserveCodexThreadRenderedWindow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{xe,kt}from"../chunk-w3yddw6n.js";import"../chunk-q7e2bdav.js";export{kt as CodexUserMessage,xe as CopyAction};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ct}from"../chunk-jsb0zged.js";import"../chunk-nxarfyj2.js";export{ct as VirtualizedTurnList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{X,In}from"../chunk-xjen1yt6.js";import"../chunk-h6df4xfd.js";export{In as filterFiles,X as filterSlashCommands};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{e}from"../chunk-
|
|
1
|
+
import{e}from"../chunk-801v0awm.js";import{B}from"../chunk-h38yw8y3.js";import"../chunk-h6df4xfd.js";import{X}from"../chunk-xjen1yt6.js";import{Re}from"../chunk-6vky4fcv.js";import{_e}from"../chunk-t3vgbc9s.js";import{autoUpdate as st}from"@floating-ui/dom";import{cn as Y}from"cn";import{BookOpenTextIcon as it,FileIcon as lt,StoreIcon as ut}from"lucide-react";import{useCallback as at,useEffect as v,useLayoutEffect as Z,useMemo as _,useRef as R,useState as g}from"react";import{createPortal as ct}from"react-dom";import{jsx as p,jsxs as E,Fragment as mt}from"react/jsx-runtime";function Et({handleRef:a,anchorRef:c,commands:C,searchFiles:u,onMention:F,onSearchError:A,fileSearchDebounceMs:M=0,bashMode:j=!1,forcedOpen:i=!1,onForcedOpenChange:f,emptyLabel:O,fileStatusLabels:h,morePlugins:D}){let z=_e(),l=z.textInput.value,[K,U]=g(0),[y,P]=g(null),[b,L]=g(0),V=R(null);v(()=>{let t=a.current?.getTextarea();if(!t)return;let n=()=>U(t.selectionStart??0),o=()=>{if(document.activeElement===t)n()};return t.addEventListener("keyup",n),t.addEventListener("click",n),t.addEventListener("input",n),t.addEventListener("select",n),t.addEventListener("focus",n),document.addEventListener("selectionchange",o),()=>{t.removeEventListener("keyup",n),t.removeEventListener("click",n),t.removeEventListener("input",n),t.removeEventListener("select",n),t.removeEventListener("focus",n),document.removeEventListener("selectionchange",o)}});let W=_(()=>j&&l.startsWith("!")?null:Re(l,K),[l,K,j]),r=W?.kind==="at"&&!u?null:W,q=`${r?.kind??"forced"}:${r?.query??""}:${i}`,[tt,et]=g(q);if(tt!==q)et(q),L(0);let I=R(null);v(()=>{if(!i){I.current=null;return}if(I.current===null)I.current=l;else if(l!==I.current)f?.(!1)},[i,l,f]);let x=r?.kind==="at"?r.query:null;v(()=>{if(x===null||!u){P(null);return}let t=!0,n=()=>{u(x).then((s)=>{if(t)P({query:x,search:u,items:s})},(s)=>{if(t)P({query:x,search:u,items:[]}),A(s)})},o=M>0?window.setTimeout(n,M):null;if(o===null)n();return()=>{if(t=!1,o!==null)window.clearTimeout(o)}},[x,u,M,A]);let d=_(()=>{if(r?.kind==="at")return y?.query===r.query&&y.search===u?y.items:[];if(r)return X(C,r.query);if(i)return X(C,"");return[]},[r,i,C,y,u]),[nt,N]=g(!1);v(()=>{let t=a.current?.getTextarea();if(!t)return;let n=()=>N(!0),o=()=>{if(N(!1),i)f?.(!1)};return N(document.activeElement===t),t.addEventListener("focus",n),t.addEventListener("blur",o),()=>{t.removeEventListener("focus",n),t.removeEventListener("blur",o)}},[a,i,f]),v(()=>{if(i)a.current?.getTextarea()?.focus()},[i,a]);let m=nt&&(r!==null?r.kind==="slash"||d.length>0||!!h:i);v(()=>{if(!m)return;V.current?.querySelector(`[data-idx="${b}"]`)?.scrollIntoView({block:"nearest"})},[b,m]);function Q(t){let n=a.current?.getTextarea();if(!n)return;let o,s;if(r){let H=r.kind==="slash"?`/${t.payload} `:`@${t.label} `;if(o=l.slice(0,r.start)+H+l.slice(r.end),r.kind==="at")F?.(t.payload);s=r.start+H.length}else if(i)o=`${l.length===0||l.endsWith(`
|
|
2
2
|
`)?l:`${l}
|
|
3
|
-
`}/${t.payload} `,s=o.length,f?.(!1);else return;z.textInput.setInput(o),requestAnimationFrame(()=>{n.focus(),n.setSelectionRange(s,s)})}v(()=>{let t=a.current?.getTextarea();if(!t)return;let n=(o)=>{if(!m)return;if(a.current?.isComposing()||o.isComposing||o.keyCode===229)return;if(o.key==="ArrowDown")o.preventDefault(),o.stopPropagation(),L((s)=>d.length===0?0:Math.min(d.length-1,s+1));else if(o.key==="ArrowUp")o.preventDefault(),o.stopPropagation(),L((s)=>Math.max(0,s-1));else if(o.key==="Enter"||o.key==="Tab"){o.preventDefault(),o.stopPropagation();let s=d[b];if(s)
|
|
3
|
+
`}/${t.payload} `,s=o.length,f?.(!1);else return;z.textInput.setInput(o),requestAnimationFrame(()=>{n.focus(),n.setSelectionRange(s,s)})}v(()=>{let t=a.current?.getTextarea();if(!t)return;let n=(o)=>{if(!m)return;if(a.current?.isComposing()||o.isComposing||o.keyCode===229)return;if(o.key==="ArrowDown")o.preventDefault(),o.stopPropagation(),L((s)=>d.length===0?0:Math.min(d.length-1,s+1));else if(o.key==="ArrowUp")o.preventDefault(),o.stopPropagation(),L((s)=>Math.max(0,s-1));else if(o.key==="Enter"||o.key==="Tab"){o.preventDefault(),o.stopPropagation();let s=d[b];if(s)Q(s)}else if(o.key==="Escape")if(o.preventDefault(),o.stopPropagation(),r)U(Math.max(0,r.start-1)),t.setSelectionRange(r.start,r.start);else f?.(!1)};return t.addEventListener("keydown",n,!0),()=>t.removeEventListener("keydown",n,!0)});let[k,G]=g(null),[S,ot]=g(null),T=at(()=>{let t=c?.current;if(!t)return;let n=t.getBoundingClientRect();G({left:n.left,width:n.width,bottom:window.innerHeight-n.top+8})},[c]);if(Z(()=>{if(!m){G(null);return}T()},[m,T]),Z(()=>{let t=c?.current;if(!m||!t||!S)return;return st(t,S,T,{animationFrame:!0})},[m,S,c,T]),!m||c&&!k)return null;let w=r?r.kind==="slash":i,rt=w?it:lt,J=p("div",{ref:ot,className:c?"fixed z-50":"absolute inset-x-0 bottom-full z-50 mb-2",style:c&&k?{left:k.left,width:k.width,bottom:k.bottom}:void 0,children:E("div",{ref:V,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:[d.length===0&&w&&p("div",{className:"text-muted-foreground px-2 py-3 text-xs",children:O}),d.length===0&&!w&&h&&p("div",{role:"status",className:"text-muted-foreground px-2 py-3 text-xs",children:y?.query===x&&y.search===u?h.empty:h.loading}),d.map((t,n)=>E(e,{type:"button",variant:"ghost",role:"option","aria-selected":n===b,"data-idx":n,onMouseDown:(o)=>{o.preventDefault(),Q(t)},onMouseEnter:()=>L(n),className:Y("flex h-auto w-full items-center justify-start gap-2.5 rounded-md px-2.5 py-2 text-start",n===b&&"bg-muted"),children:[p(rt,{className:Y("size-4 shrink-0",w?"text-blue-500":"text-muted-foreground")}),p("span",{className:"text-foreground shrink-0 text-sm font-medium",children:t.label}),t.description&&p("span",{className:"text-muted-foreground min-w-0 flex-1 truncate text-xs",children:t.description})]},t.key))]}),w&&D&&E(mt,{children:[p(B,{}),E(e,{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:[p(ut,{"data-icon":"inline-start"}),D.label]})]})]})});return c?ct(J,document.body):J}export{Et as CompletionMenu};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Re}from"../chunk-6vky4fcv.js";export{Re as detectTrigger};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Y}from"../chunk-phe3an96.js";export{Y as EffortSlider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{r}from"../chunk-42zr8zpv.js";import"../chunk-2epnn4sq.js";export{r as MenuRadioSelect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e}from"../chunk-
|
|
1
|
+
import{e}from"../chunk-801v0awm.js";import{k,C,x,T,j,I,H,F,D,ue,l}from"../chunk-2epnn4sq.js";import{R}from"../chunk-9s1cgt7s.js";import{oe,ie,ae}from"../chunk-cw9tg2sz.js";import{Y}from"../chunk-phe3an96.js";import{r}from"../chunk-42zr8zpv.js";import{cn as p}from"cn";import{ArrowUpRight as ce,ChevronUp as J,Loader2Icon as K,Zap as Q}from"lucide-react";import{Fragment as he,useState as X}from"react";import{jsx as n,jsxs as s,Fragment as h}from"react/jsx-runtime";function ke({value:w,onChange:E,models:M,modelGroups:z,compactCatalog:d,effortPresentation:G="slider",unavailableEffort:y,providerMenu:g,header:b,className:P,condensed:_,stripLabelPrefix:A,showDescription:ee,showModelList:ne=!0,loading:se,switching:U,isLoading:te,effortConfig:i,booleanOptions:O,onBooleanChange:L,selectOptions:le=[],t:c,...u}){let[de,re]=X(!1),[me,pe]=X(!1),m=O?.find((a)=>a.id==="fast_mode"),B=d?O?.filter((a)=>a!==m):O,W=(a)=>A&&a.startsWith(A)?a.slice(A.length):a;if(se)return n("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:s(e,{variant:"ghost",disabled:!0,className:p("h-7 min-w-0 shrink gap-1.5 rounded-md px-2 text-xs font-normal",P),children:[n(K,{className:"size-3 animate-spin"}),n("span",{className:"text-muted-foreground truncate",children:c("model.loadingModels")})]})});return s("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:[g&&s(k,{open:de,onOpenChange:re,children:[s(oe,{children:[n(ie,{render:n(C,{render:s(e,{"data-testid":"provider-trigger",variant:"ghost",disabled:u.disabled,className:p("h-7 shrink-0 gap-1 rounded-md px-1.5","hover:bg-accent"),children:[g.icon,n(J,{className:"size-2.5 shrink-0 opacity-60"})]})})}),n(ae,{children:c("model.switchProvider")})]}),s(x,{side:"top",align:"end",sideOffset:4,className:"z-100 min-w-[10rem]",children:[g.groups.map((a,t)=>s(he,{children:[t>0&&a.length>0&&n(l,{}),n(r,{value:g.value,onValueChange:g.onChange,options:a})]},t)),g.moreAction&&s(h,{children:[n(l,{}),s(I,{onClick:g.moreAction,className:"whitespace-nowrap",children:[n("span",{className:"min-w-0 flex-1 truncate",children:c("model.moreModels")}),n(ce,{className:"size-4"})]})]})]})]}),s(k,{open:me,onOpenChange:pe,children:[s(oe,{children:[n(ie,{render:n(C,{render:s(e,{"data-testid":"model-trigger","aria-busy":U,variant:"ghost",className:p("h-7 gap-1.5 rounded-md px-2 text-xs font-normal","hover:bg-accent","max-w-full min-w-0 shrink",_&&"h-7 gap-1 px-1.5 text-[11px]",P),...u,children:[w.icon,O?.some((a)=>a.id==="fast_mode"&&a.currentValue&&!a.disabled)&&n(Q,{"aria-hidden":"true",className:"size-3 shrink-0"}),n("span",{className:p("min-w-0 flex-1 truncate text-start",_&&"text-[11px]"),children:W(w.label)||c("model.selectModel")}),i&&s("span",{className:"text-muted-foreground grid shrink-0 justify-items-center",children:[n("span",{className:"invisible col-start-1 row-start-1",children:i.sizer??i.levels.reduce((a,t)=>t.name.length>a.length?t.name:a,"")}),n("span",{className:"col-start-1 row-start-1",children:i.levels.find((a)=>a.value===i.value)?.name??i.value})]}),U?n(K,{"data-testid":"model-switch-loading",className:"size-3 shrink-0 animate-spin"}):n(J,{className:p("size-3 shrink-0",_&&"size-2.5")})]})})}),n(ae,{children:c("model.switchModel")})]}),s(x,{side:"top",align:"end",sideOffset:4,className:p("z-100 w-auto max-w-[min(24rem,calc(100vw-1rem))] min-w-[14rem]",d&&"flex h-[350px] w-80 min-w-0 flex-col overflow-hidden rounded-xl p-1.5"),children:[d&&s(h,{children:[s(T,{"data-model-menu-header":!0,className:"flex shrink-0 items-center justify-between gap-2 px-1 py-1",children:[i?G==="slider"?n("div",{role:"menuitem","aria-label":i.name,className:"min-w-0 [&>div]:justify-start [&>div]:gap-3 [&>div]:px-2 [&>div]:py-1.5",children:n(Y,{...i,disabled:u.disabled})}):s(H,{children:[s(F,{disabled:u.disabled,className:"h-8 min-w-0 flex-1 gap-2 rounded-md",children:[n("span",{children:i.name}),n("span",{className:"text-muted-foreground min-w-0 truncate text-xs",children:i.levels.find((a)=>a.value===i.value)?.name??i.value})]}),n(D,{children:n(r,{value:i.value,onValueChange:i.onChange,options:i.levels.map((a)=>({value:a.value,label:a.name}))})})]}):y?s(I,{disabled:!0,className:"h-8 min-w-0 flex-1 gap-2",children:[n("span",{children:y.name}),n("span",{className:"text-muted-foreground truncate text-xs",children:y.label})]}):n(j,{className:"min-w-0 flex-1 truncate",children:b?.name}),m&&n(ue,{"aria-label":m.name,title:m.title??m.name,disabled:u.disabled||m.disabled,checked:m.currentValue,closeOnClick:!1,onCheckedChange:(a)=>L?.(m.id,a),className:p("hover:bg-accent focus:hover:bg-accent focus-visible:bg-accent ml-auto size-8 shrink-0 justify-center rounded-md p-0 focus:bg-transparent [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",m.currentValue&&!m.disabled?"text-foreground [&_svg]:fill-current":"text-muted-foreground"),children:m.icon??n(Q,{className:"size-4","aria-hidden":"true"})})]}),n(l,{className:"shrink-0"})]}),b&&!d&&s(h,{children:[s("div",{className:"flex items-center gap-2 px-2 py-2",children:[b.icon,n("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:b.name}),b.action]}),n(l,{})]}),s(T,{"data-model-menu-list":d?"":void 0,className:d?"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain":void 0,children:[ne&&(te?n(I,{disabled:!0,className:"text-muted-foreground",children:c("model.loadingModels")}):M.length===0?n(I,{disabled:!0,className:"text-muted-foreground",children:c("model.noModelsAvailable")}):(()=>{let a=M.filter((o)=>!o.more),t=M.filter((o)=>o.more),Z=a.length>0&&t.length>0,S=(o,v)=>({disabled:u.disabled,icon:o.icon,value:o.api_id,label:W(o.label),description:v?.noDescription?void 0:ee?o.description:void 0}),f=(o)=>{let v=M.find((V)=>V.api_id===o);if(v)E(v)};if(d)return n(r,{value:w.api_id,onValueChange:f,itemClassName:"min-w-0 max-w-full font-normal whitespace-nowrap",options:M.map((o)=>S(o))});return s(h,{children:[z?z.map((o)=>{let v=o.models.filter((N)=>!N.more),V=o.models.filter((N)=>N.more),q=v.length>0&&V.length>0;return s(T,{children:[n(j,{className:"text-muted-foreground text-xs font-normal",children:o.name}),n(r,{value:w.api_id,onValueChange:f,itemClassName:"font-medium whitespace-nowrap",options:(q?v:o.models).map((N)=>S(N))}),q&&s(H,{children:[n(F,{className:"font-medium whitespace-nowrap",children:c("model.moreModels")}),n(D,{children:n(r,{value:w.api_id,onValueChange:f,itemClassName:"font-medium whitespace-nowrap",options:V.map((N)=>S(N,{noDescription:!0}))})})]})]},o.id)}):n(r,{value:w.api_id,onValueChange:f,itemClassName:"font-medium whitespace-nowrap",options:(Z?a:M).map((o)=>S(o))}),!z&&Z&&s(H,{children:[n(F,{className:"font-medium whitespace-nowrap",children:c("model.moreModels")}),n(D,{children:n(r,{value:w.api_id,onValueChange:f,itemClassName:"font-medium whitespace-nowrap",options:t.map((o)=>S(o,{noDescription:!0}))})})]})]})})()),!d&&i&&s(h,{children:[n(l,{}),G==="menu"?s(H,{children:[s(F,{disabled:u.disabled,children:[n("span",{className:"flex-1",children:i.name}),n("span",{className:"text-muted-foreground",children:i.levels.find((a)=>a.value===i.value)?.name??i.value})]}),n(D,{children:n(r,{value:i.value,onValueChange:i.onChange,options:i.levels.map((a)=>({value:a.value,label:a.name}))})})]}):n(Y,{...i,disabled:u.disabled})]}),!d&&!i&&y&&s(h,{children:[n(l,{}),s(I,{disabled:!0,children:[n("span",{className:"flex-1",children:y.name}),n("span",{children:y.label})]})]}),le.map((a)=>s(T,{children:[n(l,{}),n(j,{children:a.name}),n(r,{value:a.value,onValueChange:a.onChange,options:a.options,itemClassName:"whitespace-nowrap"})]},a.id)),B&&B.length>0&&s(h,{children:[!i&&n(l,{}),B.map((a)=>d?s(ue,{"aria-label":a.name,title:a.title,disabled:u.disabled||a.disabled,checked:a.currentValue,closeOnClick:!1,onCheckedChange:(t)=>L?.(a.id,t),className:"justify-between gap-3 py-2.5 pr-2 [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",children:[s("span",{className:"flex items-center gap-2",children:[a.icon,a.name]}),n("span",{"aria-hidden":"true",className:p("flex h-[18px] w-8 shrink-0 items-center rounded-full p-0.5",a.currentValue?"bg-primary":"bg-input"),children:n("span",{className:p("bg-background size-3.5 rounded-full shadow-xs transition-transform",a.currentValue&&"translate-x-3.5")})})]},a.id):s("div",{title:a.title,className:p("flex items-center justify-between gap-3 px-2 py-2.5",a.disabled&&"opacity-50"),children:[s("span",{className:"flex items-center gap-2 text-sm font-medium",children:[a.icon,a.name]}),n(R,{"aria-label":a.name,disabled:u.disabled||a.disabled,checked:a.currentValue,onCheckedChange:(t)=>L?.(a.id,t)})]},a.id))]})]}),d&&b?.action&&s(h,{children:[n(l,{className:"shrink-0"}),n(T,{"data-model-menu-footer":!0,className:"shrink-0",children:b.action})]})]})]})]})}export{ke as ModelSelect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e}from"../chunk-
|
|
1
|
+
import{e}from"../chunk-801v0awm.js";import{k,C,x}from"../chunk-2epnn4sq.js";import{r}from"../chunk-42zr8zpv.js";import{useState as f}from"react";import{jsx as o,jsxs as t}from"react/jsx-runtime";function v({value:p,currentName:n,icon:s,options:i,label:d,header:a,onValueChange:l,showLabel:u=!1,disabled:m=!1}){let[c,g]=f(!1);return t(k,{open:c,onOpenChange:g,children:[o(C,{render:t(e,{disabled:m,variant:"ghost","aria-label":`${d}: ${n}`,title:n,className:"text-muted-foreground data-popup-open:hover:bg-muted h-7 gap-1.5 rounded-full bg-transparent px-2 text-xs font-normal whitespace-nowrap data-popup-open:bg-transparent",children:[s,o("span",{className:u?"max-w-40 truncate":"hidden max-w-40 truncate @[40rem]/input-footer:inline-block",children:n})]})}),t(x,{align:"start",sideOffset:4,className:"permission-mode-menu z-100 w-auto max-w-[calc(100vw-2rem)] min-w-72 rounded-xl p-1.5",children:[a&&o("div",{className:"text-muted-foreground flex items-center px-1.5 pt-0.5 pb-1 text-[11px] leading-4",children:o("span",{children:a})}),o(r,{value:p,onValueChange:l,itemClassName:"items-center gap-2 py-1 pr-6 pl-2 whitespace-nowrap",options:i})]})]})}export{v as PermissionModeSelect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import"../chunk-h0dq9ztv.js";import{e}from"../chunk-801v0awm.js";import"../chunk-6p5hgnpq.js";import{Je}from"../chunk-dm31xvh3.js";import{je,Qe,Xe}from"../chunk-dgp9q950.js";import{y}from"../chunk-t3vgbc9s.js";import{cn as f}from"cn";import{PaperclipIcon as k,XIcon as T}from"lucide-react";import{Fragment as M,useEffect as L,useRef as z,useState as N}from"react";import{jsx as t,jsxs as o,Fragment as R}from"react/jsx-runtime";function E(n){return t(Xe,{align:"start",...n})}function X({data:n,t:r,className:u,...c}){let p=y(),[d,h]=N(!1),[I,v]=N(1),C=z(null),s=n.filename||"",i=(n.mediaType?.startsWith("image/")&&n.url?"image":"file")==="image",A=s||(i?r("input.image"):r("input.attachment"));return L(()=>{if(!d)return;let l=0.1,g=(a)=>Math.min(10,Math.max(0.1,a)),x=(a)=>{if(!(a.ctrlKey||a.metaKey))return;let m=a.key,w=m==="+"||m==="=",H=m==="-"||m==="_",b=m==="0";if(!w&&!H&&!b)return;a.preventDefault(),v((P)=>{if(b)return 1;if(w)return g(P+l);return g(P-l)})};return window.addEventListener("keydown",x,{passive:!1}),()=>window.removeEventListener("keydown",x)},[d]),o(R,{children:[o(je,{children:[t(Qe,{render:o("div",{className:f("group border-border hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent relative flex h-8 cursor-pointer items-center gap-1.5 rounded-md border px-1.5 text-sm font-medium transition-all select-none",u),...c,children:[o("div",{className:"relative size-5 shrink-0",children:[i?t(e,{type:"button",variant:"ghost",size:"icon-xs","aria-label":r("input.image"),className:"bg-background absolute inset-0 size-5 overflow-hidden rounded p-0 transition-opacity group-hover:opacity-0",onClick:()=>{v(1),h(!0)},children:t("img",{alt:s||"attachment",className:"size-5 object-cover",height:20,src:n.url,width:20})}):t("div",{className:"bg-background text-muted-foreground absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded transition-opacity group-hover:opacity-0",children:t(k,{className:"size-3"})}),o(e,{"aria-label":r("input.removeAttachment"),className:f("absolute -top-1 -right-1 size-4 rounded-full p-0 opacity-0 transition-opacity [&>svg]:size-3","pointer-events-none group-hover:pointer-events-auto group-hover:opacity-100"),onClick:(l)=>{l.stopPropagation(),p.remove(n.id)},type:"button",variant:"ghost",children:[t(T,{}),t("span",{className:"sr-only",children:r("input.removeAttachment")})]})]}),!i&&t("span",{className:"max-w-40 flex-1 truncate text-xs",children:A})]})}),t(E,{className:"w-auto p-2",children:o("div",{className:"w-auto space-y-3",children:[i&&t("div",{className:"flex max-h-96 w-96 items-center justify-center overflow-hidden rounded-md border",children:t("img",{alt:s||"attachment preview",className:"max-h-full max-w-full object-contain",height:384,src:n.url,width:448})}),t("div",{className:"flex items-center gap-2.5",children:o("div",{className:"min-w-0 flex-1 space-y-1 px-0.5",children:[t("h4",{className:"truncate text-sm leading-none font-semibold",children:s||(i?"Image":"Attachment")}),n.mediaType&&t("p",{className:"text-muted-foreground truncate font-mono text-xs",children:n.mediaType})]})})]})})]}),i&&n.url&&t(Je,{containerRef:C,filename:s||r("input.image"),onOpenChange:h,onScaleChange:v,open:d,scale:I,url:n.url})]})}function _({children:n,className:r,...u}){let c=y();if(!c.files.length)return null;return t("div",{className:f("flex w-full flex-wrap items-center gap-1",r),...u,children:c.files.map((p)=>t(M,{children:n(p)},p.id))})}export{X as PromptInputAttachment,_ as PromptInputAttachments};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{cn,Le,Ae,un,rn,q}from"../chunk-m2myfd89.js";export{Ae as clipboardHasStringItem,rn as countControlCharsBeforeIndex,cn as normalizePastedImageFile,q as sanitizeTextareaTargetValue,un as sanitizeTextareaValue,Le as scanClipboardForImageFiles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Z,Pn,J,Nn,S,_e,E,Mn,Sn,ee,y}from"../chunk-t3vgbc9s.js";export{ee as LocalAttachmentsContext,Sn as PromptInputProvider,J as PromptInputSubmissionContext,Z as PromptInputSubmitContext,S as ProviderAttachmentsContext,E as useOptionalPromptInputController,y as usePromptInputAttachments,_e as usePromptInputController,Nn as usePromptInputSubmission,Pn as usePromptInputSubmit,Mn as useProviderAttachments};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import"../chunk-
|
|
2
|
-
`&&e.key!=="\r"&&e.key!=="\t"){e.preventDefault();return}if(c&&n){let t=e.currentTarget.selectionStart===0&&e.currentTarget.selectionEnd===0;if(e.key==="Escape"||(e.key==="Backspace"||e.key==="Delete")&&t){e.preventDefault(),n.textInput.setInput(n.textInput.value.slice(1));return}}if(e.key==="Enter"){if(C(e.nativeEvent)){e.preventDefault();let t=e.currentTarget,{selectionStart:a,selectionEnd:m,value:p}=t,
|
|
3
|
-
${p.slice(m)}`;if(n)n.textInput.setInput(
|
|
1
|
+
import"../chunk-c4621n0b.js";import{ce}from"../chunk-16y5rmm5.js";import{Le,Ae,q}from"../chunk-m2myfd89.js";import{E,y}from"../chunk-t3vgbc9s.js";import{cn as A}from"cn";import{forwardRef as D,useCallback as M,useEffect as K,useImperativeHandle as L,useRef as f}from"react";import{jsx as z}from"react/jsx-runtime";var R=(i)=>!i.shiftKey,F=()=>!1,N=D(({onChange:i,onCompositionStart:g,onCompositionEnd:v,className:x,placeholder:T,bashMode:b=!1,isSendShortcut:I=R,isNewlineShortcut:C=F,...H},P)=>{let n=E(),l=y(),o=f(!1),u=f(!1),r=f(null),s=M(()=>{let e=r.current;if(!e||o.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`},[]);K(()=>{let e=r.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame(s)});return t.observe(e),()=>t.disconnect()},[s]);let c=b&&(n?.textInput.value??"").startsWith("!"),S=(e)=>{if(o.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||u.current)return;if(e.key.length===1&&e.key.charCodeAt(0)<32&&e.key!==`
|
|
2
|
+
`&&e.key!=="\r"&&e.key!=="\t"){e.preventDefault();return}if(c&&n){let t=e.currentTarget.selectionStart===0&&e.currentTarget.selectionEnd===0;if(e.key==="Escape"||(e.key==="Backspace"||e.key==="Delete")&&t){e.preventDefault(),n.textInput.setInput(n.textInput.value.slice(1));return}}if(e.key==="Enter"){if(C(e.nativeEvent)){e.preventDefault();let t=e.currentTarget,{selectionStart:a,selectionEnd:m,value:p}=t,d=`${p.slice(0,a)}
|
|
3
|
+
${p.slice(m)}`;if(n)n.textInput.setInput(d);else t.value=d;let h=a+1;t.setSelectionRange(h,h),s();return}if(I(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let a=t.querySelector('button[type="submit"]');if(!a||a.disabled)return;t.requestSubmit(a)}}if(e.key==="Backspace"&&e.currentTarget.value===""&&l.files.length>0){e.preventDefault();let t=l.files.at(-1);if(t)l.remove(t.id)}},k=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:a,sawNonImageFile:m}=Le(t),p=Ae(t);if(a.length>0)e.preventDefault(),l.add(a);else if(m&&!p)e.preventDefault()},w=n?{value:o.current&&r.current?r.current.value:c?n.textInput.value.slice(1):n.textInput.value,onChange:(e)=>{let t=o.current?e.currentTarget.value:q(e.currentTarget);n.textInput.setInput(c?`!${t}`:t),s(),i?.(e)}}:{onChange:(e)=>{if(!o.current)q(e.currentTarget);s(),i?.(e)}};return L(P,()=>({resetHeight:()=>{if(r.current)r.current.style.height="auto"},focus:()=>{r.current?.focus()},isComposing:()=>o.current||u.current,getTextarea:()=>r.current}),[]),z(ce,{"data-chat-input":!0,ref:r,rows:3,className:A("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",x),name:"message",onCompositionEnd:(e)=>{o.current=!1;let t=q(e.currentTarget);n?.textInput.setInput(c?`!${t}`:t),s(),v?.(e),u.current=!0,requestAnimationFrame(()=>{u.current=!1})},onCompositionStart:(e)=>{u.current=!1,o.current=!0,g?.(e)},onKeyDown:S,onPaste:k,placeholder:T,...H,...w})});N.displayName="PromptInputTextarea";export{N as PromptInputTextarea};
|