@qredence/fleet 0.6.4 → 0.6.5

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/web/client/assets/{chat-command-palette-DdPlRVuL.js → chat-command-palette-AjGusIEp.js} +1 -1
  3. package/dist/web/client/assets/{create-project-dialog-CaXurRpm.js → create-project-dialog-zTSeGUup.js} +1 -1
  4. package/dist/web/client/assets/globals-BiAbxPQ2.css +2 -0
  5. package/dist/web/client/assets/{index-BJIGh8ag.js → index-NhnAdIsR.js} +2 -2
  6. package/dist/web/client/assets/{message-queue-CPYj2iaw.js → message-queue-BoNn57Po.js} +1 -1
  7. package/dist/web/client/assets/prompt-input-BhVQxoyh.js +1 -0
  8. package/dist/web/client/assets/{prompt-suggestions-ULqmPijZ.js → prompt-suggestions-BRFWFm5y.js} +1 -1
  9. package/dist/web/client/assets/right-panel-registry-gwgnEeUz.js +2 -0
  10. package/dist/web/client/assets/routes-umGEy_Ak.js +16 -0
  11. package/dist/web/client/assets/{settings-dialog-BRWheaBZ.js → settings-dialog-C8YN5D1V.js} +1 -1
  12. package/dist/web/client/assets/{subagent-chat-panel-B6d4Z3bV.js → subagent-chat-panel-BIsmzS45.js} +1 -1
  13. package/dist/web/client/assets/{subagent-transcript-CQuPs6N4.js → subagent-transcript-CEUBL9sF.js} +1 -1
  14. package/dist/web/client/assets/{subagents-panel-ajf--C_-.js → subagents-panel-CFxWpUT0.js} +1 -1
  15. package/dist/web/client/assets/{tokens-BcUIpW6Y.js → tokens-CtP2s1Y3.js} +1 -1
  16. package/dist/web/client/assets/types-D5hZ8IyV.js +1 -0
  17. package/dist/web/client/assets/virtualized-turn-list-DkJIWXFJ.js +6 -0
  18. package/dist/web/client/bundle-budget.json +6 -6
  19. package/dist/web/server/{_tanstack-start-manifest_v-BZR0i182-OLTGGEDQ.js → _tanstack-start-manifest_v-B3Gb4p5p-DO2GL5VM.js} +9 -10
  20. package/dist/web/server/{artifacts-panel-BySfu7im-AKBWHYJS.js → artifacts-panel-CGgpyc85-V3KXDVAX.js} +2 -2
  21. package/dist/web/server/{chat-command-palette-BLGKnp-w-OKFIKD3T.js → chat-command-palette-BMR7RsuI-U5S4X44U.js} +2 -2
  22. package/dist/web/server/{chunk-4B2PJSK5.js → chunk-5TXDGMCK.js} +14 -4
  23. package/dist/web/server/{chunk-ONWT54IL.js → chunk-BS4D5LRR.js} +5 -1
  24. package/dist/web/server/{chunk-JLGBOCFM.js → chunk-ELRLMFHT.js} +49 -33
  25. package/dist/web/server/{chunk-JZ2WBCIH.js → chunk-G6NMFFZX.js} +624 -624
  26. package/dist/web/server/{chunk-47TH5VUT.js → chunk-LBUHLBKK.js} +2 -2
  27. package/dist/web/server/{chunk-2GQATGF4.js → chunk-N47UN47Y.js} +3 -3
  28. package/dist/web/server/{chunk-CIE2PLNB.js → chunk-PX7B5BTI.js} +2 -2
  29. package/dist/web/server/{chunk-NHZRY22Z.js → chunk-SOZKLVNI.js} +59 -19
  30. package/dist/web/server/{create-project-dialog-CigfFgAj-QS27NAJH.js → create-project-dialog-xhTWmcx1-UQQU3MAT.js} +2 -2
  31. package/dist/web/server/{message-queue-BsrLcNPX-CUCBSF6U.js → message-queue-Dg2okv2L-SJTUUJS7.js} +4 -4
  32. package/dist/web/server/{openui-renderer-TbIFXEW2-BET2OXM2.js → openui-renderer-CiWvcD3p-N6I66FOC.js} +1 -1
  33. package/dist/web/server/{prompt-suggestions-D6RXFQF4-7WHYRNMN.js → prompt-suggestions-h17Gu7u1-BS5SU2FY.js} +2 -2
  34. package/dist/web/server/{router-RPObiwZR-AFMFSYSZ.js → router-DOPFvRSC-G7G75P7U.js} +84 -28
  35. package/dist/web/server/{routes-Dn-deuPY-MDXEQXRU.js → routes-i2Ai-ZwX-SMSFONDQ.js} +469 -352
  36. package/dist/web/server/server.js +2 -2
  37. package/dist/web/server/{settings-dialog-CzeangBl-YKL7CLPF.js → settings-dialog-C-xwPYy8-TFICZWEM.js} +7 -7
  38. package/dist/web/server/{subagent-chat-panel-Fa31QewE-YDPOKN74.js → subagent-chat-panel-VEVu0QXU-DPWJFCYR.js} +5 -4
  39. package/dist/web/server/{subagents-panel-DjOcQxp4-GZYOZOYC.js → subagents-panel-Cs3cBcsy-HTQBIYAS.js} +4 -3
  40. package/package.json +1 -1
  41. package/dist/web/client/assets/globals-B-fD_O7k.css +0 -2
  42. package/dist/web/client/assets/prompt-input-a7UP_MAw.js +0 -1
  43. package/dist/web/client/assets/right-panel-registry-BqtgZw7Z.js +0 -2
  44. package/dist/web/client/assets/routes-C37r2W1K.js +0 -16
  45. package/dist/web/client/assets/types-Cr5Z97oW.js +0 -1
  46. package/dist/web/client/assets/virtualized-turn-list-Bcq088gZ.js +0 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 7cad8f4: Make the composer's inline suggestion adaptive and session-aware. How much of a suggestion is offered now follows how far the matching prompts agree with each other: below 0.5 confidence nothing is shown, between 0.5 and 0.8 only the part every candidate agrees on, and at 0.8 or above the whole continuation — for prompts from the session you are typing in. Cross-session history never extends past the agreed prefix. Since a longer draft narrows the candidate set, a session-tier suggestion lengthens on its own as you type, and shortens when the field is contested instead of committing to a guess.
8
+
9
+ Prompts from the session you are typing in win outright over the cross-session history, so a session's own vocabulary is preferred and a new session still behaves exactly as before, from the history.
10
+
11
+ The suggestion corpus now covers your whole history. It used to be read from each session's *model context* — the branch leading to the current leaf, with everything before a compaction boundary replaced by its summary — and to skip sessions over 2 000 messages and anything past the 400 most recently touched. That read saw 522 prompts where the store holds 682: prompts you had written were missing from the very corpus meant to remember them, which is why a follow-up typed mid-conversation so often found nothing. Reading the session's entries instead recovers them. Rebuilds still skip marathon sessions (over 10 000 entries) so a pathological transcript cannot dominate the background build.
12
+
13
+ The command chip is gone. A recognised command is now offered in the same inline suggestion as a **replacement** — Tab sets the composer to the command rather than running it, so nothing executes without a second, explicit Enter. Escape dismisses the ghost and, for execute-band matches, suppresses auto-run for that draft until you edit it. Tab still belongs to the slash-command and `@mention` menus first.
14
+
3
15
  ## 0.6.4
4
16
 
5
17
  ### Patch Changes
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./createLucideIcon-CQY2ECfR.js";import{t as i}from"./right-panel-registry-BqtgZw7Z.js";import{i as a,n as o,r as s,t as c}from"./sun-C7zg8Oas.js";import{a as l}from"./right-panel-context-DHKWoetk.js";import{t as u}from"./square-BbTF3gLc.js";import{a as d,c as f,i as p,n as m,o as h,r as g,s as _}from"./command-DSxdh_1v.js";var v={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};v.node;var y=r(v),b=e(t(),1),x=n();function S({open:e,onOpenChange:t,onNewSession:n,onStop:r,onResumeSession:v,onSetRightPanel:S,onThemeChange:C,sessions:w,isStreaming:T,themePreference:E}){let[D,O]=(0,b.useState)(``),[k,A]=(0,b.useState)(e);e!==k&&(A(e),e&&O(``));let j=e=>{e(),t(!1)};return(0,x.jsxs)(m,{open:e,onOpenChange:t,children:[(0,x.jsx)(d,{placeholder:`Type a command or search…`,value:D,onValueChange:O}),(0,x.jsxs)(_,{children:[(0,x.jsx)(g,{children:`No commands found.`}),(0,x.jsxs)(p,{heading:`Actions`,children:[(0,x.jsxs)(h,{onSelect:()=>j(n),keywords:[`new`,`session`,`chat`],children:[(0,x.jsx)(l,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`New session`})]}),T&&(0,x.jsxs)(h,{onSelect:()=>j(r),keywords:[`stop`,`abort`,`cancel`],children:[(0,x.jsx)(u,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`Stop generation`})]})]}),(0,x.jsx)(f,{}),(0,x.jsx)(p,{heading:`Panels`,children:i.map(e=>{let t=e.icon;return(0,x.jsxs)(h,{onSelect:()=>j(()=>S(e.id)),keywords:e.commandKeywords,children:[(0,x.jsx)(t,{}),(0,x.jsx)(`span`,{children:e.commandLabel})]},e.id)})}),w.length>0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(f,{}),(0,x.jsx)(p,{heading:`Sessions`,children:w.map(e=>{let t=e.title;return(0,x.jsxs)(h,{onSelect:()=>j(()=>v(e)),keywords:[`session`,t],children:[(0,x.jsx)(y,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{className:`truncate`,children:t})]},e.sessionId)})})]}),(0,x.jsx)(f,{}),(0,x.jsxs)(p,{heading:`Theme`,children:[(0,x.jsxs)(h,{onSelect:()=>j(()=>C(`light`)),keywords:[`theme`,`light`],children:[(0,x.jsx)(c,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`Light`}),E===`light`&&(0,x.jsx)(a,{className:`ml-auto size-3 opacity-50`})]}),(0,x.jsxs)(h,{onSelect:()=>j(()=>C(`dark`)),keywords:[`theme`,`dark`],children:[(0,x.jsx)(o,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`Dark`}),E===`dark`&&(0,x.jsx)(a,{className:`ml-auto size-3 opacity-50`})]}),(0,x.jsxs)(h,{onSelect:()=>j(()=>C(`system`)),keywords:[`theme`,`system`],children:[(0,x.jsx)(s,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`System`}),E===`system`&&(0,x.jsx)(a,{className:`ml-auto size-3 opacity-50`})]})]})]})]})}export{S as ChatCommandPalette};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./createLucideIcon-CQY2ECfR.js";import{t as i}from"./right-panel-registry-gwgnEeUz.js";import{i as a,n as o,r as s,t as c}from"./sun-C7zg8Oas.js";import{a as l}from"./right-panel-context-DHKWoetk.js";import{t as u}from"./square-BbTF3gLc.js";import{a as d,c as f,i as p,n as m,o as h,r as g,s as _}from"./command-DSxdh_1v.js";var v={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};v.node;var y=r(v),b=e(t(),1),x=n();function S({open:e,onOpenChange:t,onNewSession:n,onStop:r,onResumeSession:v,onSetRightPanel:S,onThemeChange:C,sessions:w,isStreaming:T,themePreference:E}){let[D,O]=(0,b.useState)(``),[k,A]=(0,b.useState)(e);e!==k&&(A(e),e&&O(``));let j=e=>{e(),t(!1)};return(0,x.jsxs)(m,{open:e,onOpenChange:t,children:[(0,x.jsx)(d,{placeholder:`Type a command or search…`,value:D,onValueChange:O}),(0,x.jsxs)(_,{children:[(0,x.jsx)(g,{children:`No commands found.`}),(0,x.jsxs)(p,{heading:`Actions`,children:[(0,x.jsxs)(h,{onSelect:()=>j(n),keywords:[`new`,`session`,`chat`],children:[(0,x.jsx)(l,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`New session`})]}),T&&(0,x.jsxs)(h,{onSelect:()=>j(r),keywords:[`stop`,`abort`,`cancel`],children:[(0,x.jsx)(u,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`Stop generation`})]})]}),(0,x.jsx)(f,{}),(0,x.jsx)(p,{heading:`Panels`,children:i.map(e=>{let t=e.icon;return(0,x.jsxs)(h,{onSelect:()=>j(()=>S(e.id)),keywords:e.commandKeywords,children:[(0,x.jsx)(t,{}),(0,x.jsx)(`span`,{children:e.commandLabel})]},e.id)})}),w.length>0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(f,{}),(0,x.jsx)(p,{heading:`Sessions`,children:w.map(e=>{let t=e.title;return(0,x.jsxs)(h,{onSelect:()=>j(()=>v(e)),keywords:[`session`,t],children:[(0,x.jsx)(y,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{className:`truncate`,children:t})]},e.sessionId)})})]}),(0,x.jsx)(f,{}),(0,x.jsxs)(p,{heading:`Theme`,children:[(0,x.jsxs)(h,{onSelect:()=>j(()=>C(`light`)),keywords:[`theme`,`light`],children:[(0,x.jsx)(c,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`Light`}),E===`light`&&(0,x.jsx)(a,{className:`ml-auto size-3 opacity-50`})]}),(0,x.jsxs)(h,{onSelect:()=>j(()=>C(`dark`)),keywords:[`theme`,`dark`],children:[(0,x.jsx)(o,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`Dark`}),E===`dark`&&(0,x.jsx)(a,{className:`ml-auto size-3 opacity-50`})]}),(0,x.jsxs)(h,{onSelect:()=>j(()=>C(`system`)),keywords:[`theme`,`system`],children:[(0,x.jsx)(s,{className:`mr-2 size-4`}),(0,x.jsx)(`span`,{children:`System`}),E===`system`&&(0,x.jsx)(a,{className:`ml-auto size-3 opacity-50`})]})]})]})]})}export{S as ChatCommandPalette};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./button-BrwYi6QP.js";import{t as i}from"./arrow-up-DCwrqIrK.js";import{f as a}from"./chat-helpers-Bj7_hES7.js";import{_ as o,u as s,v as c}from"./types-Cr5Z97oW.js";import{t as l}from"./triangle-alert-BuzmrrqI.js";import{t as u}from"./input-BceH49B1.js";import{a as d,i as f,n as p,o as m,r as h,t as g}from"./dialog-B9nXTto4.js";import{a as _,i as v,o as y,r as b,s as x,t as S}from"./command-DSxdh_1v.js";import{t as C}from"./spinner-C3sPnLdu.js";var w=e(t(),1),T=n();function E({createOpen:e,setCreateOpen:t,directoryBrowser:n,setDirectoryBrowser:E,directoryBrowseLoading:D,directoryBrowseError:O,setDirectoryBrowseError:k,onBrowseDirectories:A,directoryToken:j,setDirectoryToken:M,createName:N,setCreateName:P,createPath:F,setCreatePath:I,loadDirectories:L,createSubmitting:R,createSubmitError:z,setCreateSubmitError:B,submitCreate:V}){let H=(0,w.useId)(),U=(0,w.useId)(),W=(0,w.useId)(),G=n?.pathLabel??F,K=!!(j||F.trim().startsWith(`/`)),q=()=>{E(null),M(void 0),I(``),k(null)},J=()=>{R||(q(),P(``),B(null),t(!1))};return(0,T.jsx)(g,{open:e,onOpenChange:e=>{e?t(!0):J()},children:(0,T.jsxs)(p,{className:`sm:max-w-xl`,children:[(0,T.jsxs)(d,{children:[(0,T.jsx)(m,{children:`Add project`}),(0,T.jsx)(h,{children:`Choose the local directory that owns this project's sessions. Browse the server filesystem or paste an absolute path.`})]}),(0,T.jsxs)(`div`,{className:`space-y-4`,children:[(0,T.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,T.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:H,children:`Project name`}),(0,T.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Optional`})]}),(0,T.jsx)(u,{id:H,value:N,onChange:e=>P(e.target.value),placeholder:`e.g. Fleet Prime`,"aria-label":`Project name`})]}),(0,T.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,T.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:U,children:`Local directory`}),(0,T.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Required`})]}),(0,T.jsx)(u,{id:U,value:F,onChange:e=>{I(e.target.value),M(void 0),E(null),k(null),B(null)},placeholder:`/absolute/path/to/project`,"aria-label":`Project directory`,"aria-describedby":W,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,className:`h-10 font-mono text-xs`}),(0,T.jsx)(`p`,{id:W,className:`text-xs text-muted-foreground`,children:`Browse to select a directory, or paste an absolute path. The server validates the final choice before registering it.`})]}),D&&!n?(0,T.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl border border-dashed px-3 py-4 text-sm text-muted-foreground`,role:`status`,"aria-live":`polite`,children:[(0,T.jsx)(C,{className:`size-4`}),`Loading directories…`]}):null,n?(0,T.jsxs)(`div`,{className:`overflow-hidden rounded-xl border bg-muted/20`,"data-testid":`project-directory-browser`,children:[(0,T.jsxs)(`div`,{className:`flex items-start gap-3 p-3`,children:[(0,T.jsx)(`div`,{className:`grid size-9 shrink-0 place-items-center rounded-lg bg-primary/10 text-primary`,children:(0,T.jsx)(a,{className:`size-4`})}),(0,T.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,T.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground`,children:`Selected directory`}),(0,T.jsx)(`p`,{className:`mt-1 break-all font-mono text-xs text-foreground`,title:G,children:G})]}),(0,T.jsx)(`span`,{className:`shrink-0 rounded-full bg-primary/10 px-2 py-1 text-caption font-medium text-primary`,children:`Selected`})]}),(0,T.jsxs)(`div`,{className:`space-y-2 border-t p-3`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`text-sm font-medium`,children:`Browse child directories`}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Open a folder to make it the selected directory.`})]}),n.parentToken?(0,T.jsxs)(r,{type:`button`,size:`sm`,variant:`outline`,disabled:D,onClick:()=>void L({token:n.parentToken??void 0}),"aria-label":`Go up one directory`,title:`Go up one directory`,children:[(0,T.jsx)(i,{className:`size-3.5`}),`Up`]}):null]}),D?(0,T.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-dashed px-3 py-4 text-sm text-muted-foreground`,role:`status`,"aria-live":`polite`,children:[(0,T.jsx)(C,{className:`size-4`}),`Loading directories…`]}):n.entries.length===0?(0,T.jsx)(`p`,{className:`rounded-lg border border-dashed px-3 py-4 text-center text-sm text-muted-foreground`,children:`No child directories here.`}):(0,T.jsxs)(S,{className:`overflow-hidden rounded-lg border bg-background`,shouldFilter:!0,children:[(0,T.jsx)(_,{"aria-label":`Search child directories`,placeholder:`Choose a child directory…`,className:`text-xs`}),(0,T.jsxs)(x,{className:`max-h-56`,"aria-label":`Child directories`,children:[(0,T.jsx)(b,{children:`No matching directories.`}),(0,T.jsx)(v,{heading:`Child directories`,children:n.entries.map(e=>(0,T.jsxs)(y,{value:`${e.name} ${e.pathLabel}`,onSelect:()=>{L({token:e.directoryToken})},className:`items-start gap-2`,children:[(0,T.jsx)(o,{className:`mt-0.5 size-4 shrink-0`}),(0,T.jsxs)(`span`,{className:`min-w-0`,children:[(0,T.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:s(e)}),(0,T.jsx)(`span`,{className:`block truncate text-caption text-muted-foreground`,title:e.pathLabel,children:e.pathLabel})]})]},e.directoryToken))})]})]})]})]}):A?(0,T.jsxs)(r,{type:`button`,variant:`outline`,disabled:D,onClick:()=>void L({}),className:`w-full justify-start`,children:[(0,T.jsx)(a,{className:`size-4`}),`Browse directories`]}):null,O?(0,T.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive`,role:`alert`,children:[(0,T.jsx)(l,{className:`mt-0.5 size-4 shrink-0`}),(0,T.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,T.jsx)(`p`,{children:O}),(0,T.jsx)(r,{type:`button`,variant:`link`,size:`xs`,className:`mt-1 h-auto p-0 text-destructive`,onClick:()=>void L(n?{token:n.directoryToken}:{}),children:`Try again`})]})]}):null,z?(0,T.jsx)(`p`,{className:`text-sm text-destructive`,role:`alert`,children:z}):null]}),(0,T.jsxs)(f,{children:[(0,T.jsx)(r,{type:`button`,variant:`outline`,disabled:R,onClick:J,children:`Cancel`}),(0,T.jsx)(r,{type:`button`,disabled:!K||R,onClick:()=>void V(),children:R?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(C,{className:`size-3.5`}),`Adding project…`]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(c,{className:`size-3.5`}),`Add project`]})})]})]})})}export{E as SessionSidebarCreateDialog};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./button-BrwYi6QP.js";import{t as i}from"./arrow-up-DCwrqIrK.js";import{f as a}from"./chat-helpers-Bj7_hES7.js";import{b as o,f as s,y as c}from"./types-D5hZ8IyV.js";import{t as l}from"./triangle-alert-BuzmrrqI.js";import{t as u}from"./input-BceH49B1.js";import{a as d,i as f,n as p,o as m,r as h,t as g}from"./dialog-B9nXTto4.js";import{a as _,i as v,o as y,r as b,s as x,t as S}from"./command-DSxdh_1v.js";import{t as C}from"./spinner-C3sPnLdu.js";var w=e(t(),1),T=n();function E({createOpen:e,setCreateOpen:t,directoryBrowser:n,setDirectoryBrowser:E,directoryBrowseLoading:D,directoryBrowseError:O,setDirectoryBrowseError:k,onBrowseDirectories:A,directoryToken:j,setDirectoryToken:M,createName:N,setCreateName:P,createPath:F,setCreatePath:I,loadDirectories:L,createSubmitting:R,createSubmitError:z,setCreateSubmitError:B,submitCreate:V}){let H=(0,w.useId)(),U=(0,w.useId)(),W=(0,w.useId)(),G=n?.pathLabel??F,K=!!(j||F.trim().startsWith(`/`)),q=()=>{E(null),M(void 0),I(``),k(null)},J=()=>{R||(q(),P(``),B(null),t(!1))};return(0,T.jsx)(g,{open:e,onOpenChange:e=>{e?t(!0):J()},children:(0,T.jsxs)(p,{className:`sm:max-w-xl`,children:[(0,T.jsxs)(d,{children:[(0,T.jsx)(m,{children:`Add project`}),(0,T.jsx)(h,{children:`Choose the local directory that owns this project's sessions. Browse the server filesystem or paste an absolute path.`})]}),(0,T.jsxs)(`div`,{className:`space-y-4`,children:[(0,T.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,T.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:H,children:`Project name`}),(0,T.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Optional`})]}),(0,T.jsx)(u,{id:H,value:N,onChange:e=>P(e.target.value),placeholder:`e.g. Fleet Prime`,"aria-label":`Project name`})]}),(0,T.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,T.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:U,children:`Local directory`}),(0,T.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Required`})]}),(0,T.jsx)(u,{id:U,value:F,onChange:e=>{I(e.target.value),M(void 0),E(null),k(null),B(null)},placeholder:`/absolute/path/to/project`,"aria-label":`Project directory`,"aria-describedby":W,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,className:`h-10 font-mono text-xs`}),(0,T.jsx)(`p`,{id:W,className:`text-xs text-muted-foreground`,children:`Browse to select a directory, or paste an absolute path. The server validates the final choice before registering it.`})]}),D&&!n?(0,T.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl border border-dashed px-3 py-4 text-sm text-muted-foreground`,role:`status`,"aria-live":`polite`,children:[(0,T.jsx)(C,{className:`size-4`}),`Loading directories…`]}):null,n?(0,T.jsxs)(`div`,{className:`overflow-hidden rounded-xl border bg-muted/20`,"data-testid":`project-directory-browser`,children:[(0,T.jsxs)(`div`,{className:`flex items-start gap-3 p-3`,children:[(0,T.jsx)(`div`,{className:`grid size-9 shrink-0 place-items-center rounded-lg bg-primary/10 text-primary`,children:(0,T.jsx)(a,{className:`size-4`})}),(0,T.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,T.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground`,children:`Selected directory`}),(0,T.jsx)(`p`,{className:`mt-1 break-all font-mono text-xs text-foreground`,title:G,children:G})]}),(0,T.jsx)(`span`,{className:`shrink-0 rounded-full bg-primary/10 px-2 py-1 text-caption font-medium text-primary`,children:`Selected`})]}),(0,T.jsxs)(`div`,{className:`space-y-2 border-t p-3`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`text-sm font-medium`,children:`Browse child directories`}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Open a folder to make it the selected directory.`})]}),n.parentToken?(0,T.jsxs)(r,{type:`button`,size:`sm`,variant:`outline`,disabled:D,onClick:()=>void L({token:n.parentToken??void 0}),"aria-label":`Go up one directory`,title:`Go up one directory`,children:[(0,T.jsx)(i,{className:`size-3.5`}),`Up`]}):null]}),D?(0,T.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-dashed px-3 py-4 text-sm text-muted-foreground`,role:`status`,"aria-live":`polite`,children:[(0,T.jsx)(C,{className:`size-4`}),`Loading directories…`]}):n.entries.length===0?(0,T.jsx)(`p`,{className:`rounded-lg border border-dashed px-3 py-4 text-center text-sm text-muted-foreground`,children:`No child directories here.`}):(0,T.jsxs)(S,{className:`overflow-hidden rounded-lg border bg-background`,shouldFilter:!0,children:[(0,T.jsx)(_,{"aria-label":`Search child directories`,placeholder:`Choose a child directory…`,className:`text-xs`}),(0,T.jsxs)(x,{className:`max-h-56`,"aria-label":`Child directories`,children:[(0,T.jsx)(b,{children:`No matching directories.`}),(0,T.jsx)(v,{heading:`Child directories`,children:n.entries.map(e=>(0,T.jsxs)(y,{value:`${e.name} ${e.pathLabel}`,onSelect:()=>{L({token:e.directoryToken})},className:`items-start gap-2`,children:[(0,T.jsx)(c,{className:`mt-0.5 size-4 shrink-0`}),(0,T.jsxs)(`span`,{className:`min-w-0`,children:[(0,T.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:s(e)}),(0,T.jsx)(`span`,{className:`block truncate text-caption text-muted-foreground`,title:e.pathLabel,children:e.pathLabel})]})]},e.directoryToken))})]})]})]})]}):A?(0,T.jsxs)(r,{type:`button`,variant:`outline`,disabled:D,onClick:()=>void L({}),className:`w-full justify-start`,children:[(0,T.jsx)(a,{className:`size-4`}),`Browse directories`]}):null,O?(0,T.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive`,role:`alert`,children:[(0,T.jsx)(l,{className:`mt-0.5 size-4 shrink-0`}),(0,T.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,T.jsx)(`p`,{children:O}),(0,T.jsx)(r,{type:`button`,variant:`link`,size:`xs`,className:`mt-1 h-auto p-0 text-destructive`,onClick:()=>void L(n?{token:n.directoryToken}:{}),children:`Try again`})]})]}):null,z?(0,T.jsx)(`p`,{className:`text-sm text-destructive`,role:`alert`,children:z}):null]}),(0,T.jsxs)(f,{children:[(0,T.jsx)(r,{type:`button`,variant:`outline`,disabled:R,onClick:J,children:`Cancel`}),(0,T.jsx)(r,{type:`button`,disabled:!K||R,onClick:()=>void V(),children:R?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(C,{className:`size-3.5`}),`Adding project…`]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(o,{className:`size-3.5`}),`Add project`]})})]})]})})}export{E as SessionSidebarCreateDialog};