gsd-pi 2.82.0-dev.3a3c6509d → 2.82.0-dev.57fd453e4

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 (74) hide show
  1. package/README.md +1 -1
  2. package/dist/resources/.managed-resources-content-hash +1 -1
  3. package/dist/resources/extensions/gsd/auto/loop.js +14 -1
  4. package/dist/resources/extensions/gsd/auto/session.js +4 -0
  5. package/dist/resources/extensions/gsd/auto/workflow-kernel.js +3 -0
  6. package/dist/resources/extensions/gsd/auto-post-unit.js +12 -5
  7. package/dist/resources/extensions/gsd/auto.js +14 -7
  8. package/dist/resources/extensions/gsd/markdown-renderer.js +10 -8
  9. package/dist/resources/extensions/gsd/paths.js +4 -0
  10. package/dist/resources/extensions/gsd/templates/plan.md +1 -0
  11. package/dist/resources/extensions/gsd/templates/task-plan.md +6 -0
  12. package/dist/resources/extensions/gsd/tools/plan-slice.js +3 -5
  13. package/dist/resources/extensions/ttsr/ttsr-manager.js +3 -1
  14. package/dist/tsconfig.extensions.tsbuildinfo +1 -1
  15. package/dist/web/standalone/.next/BUILD_ID +1 -1
  16. package/dist/web/standalone/.next/app-path-routes-manifest.json +9 -9
  17. package/dist/web/standalone/.next/build-manifest.json +3 -3
  18. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  19. package/dist/web/standalone/.next/react-loadable-manifest.json +3 -3
  20. package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
  21. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  22. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  23. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  24. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  25. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  26. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  27. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  28. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  29. package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
  30. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  31. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  32. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  33. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  34. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  35. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  36. package/dist/web/standalone/.next/server/app/index.html +1 -1
  37. package/dist/web/standalone/.next/server/app/index.rsc +1 -1
  38. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  39. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
  40. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  41. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
  42. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  43. package/dist/web/standalone/.next/server/app-paths-manifest.json +9 -9
  44. package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
  45. package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  46. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  47. package/dist/web/standalone/.next/server/pages/500.html +1 -1
  48. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  49. package/dist/web/standalone/.next/static/chunks/8359.65b24fac92188a6b.js +10 -0
  50. package/dist/web/standalone/.next/static/chunks/9441.ff70bb53f6835771.js +1 -0
  51. package/dist/web/standalone/.next/static/chunks/{webpack-9a4db269f9ed63ad.js → webpack-855d616060cb6e59.js} +1 -1
  52. package/package.json +1 -1
  53. package/src/resources/extensions/gsd/auto/loop.ts +14 -1
  54. package/src/resources/extensions/gsd/auto/session.ts +4 -0
  55. package/src/resources/extensions/gsd/auto/workflow-kernel.ts +5 -1
  56. package/src/resources/extensions/gsd/auto-post-unit.ts +13 -5
  57. package/src/resources/extensions/gsd/auto.ts +13 -7
  58. package/src/resources/extensions/gsd/markdown-renderer.ts +10 -8
  59. package/src/resources/extensions/gsd/paths.ts +5 -0
  60. package/src/resources/extensions/gsd/templates/plan.md +1 -0
  61. package/src/resources/extensions/gsd/templates/task-plan.md +6 -0
  62. package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +110 -0
  63. package/src/resources/extensions/gsd/tests/auto-post-unit-step-message.test.ts +6 -5
  64. package/src/resources/extensions/gsd/tests/gsdroot-worktree-detection.test.ts +5 -2
  65. package/src/resources/extensions/gsd/tests/plan-slice.test.ts +26 -1
  66. package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +84 -0
  67. package/src/resources/extensions/gsd/tests/quality-gates.test.ts +6 -0
  68. package/src/resources/extensions/gsd/tests/workflow-kernel.test.ts +7 -0
  69. package/src/resources/extensions/gsd/tools/plan-slice.ts +3 -4
  70. package/src/resources/extensions/ttsr/ttsr-manager.ts +5 -1
  71. package/dist/web/standalone/.next/static/chunks/8359.7eb3bb8f8ecf4c01.js +0 -10
  72. package/dist/web/standalone/.next/static/chunks/9441.1081da1125d1764f.js +0 -1
  73. /package/dist/web/standalone/.next/static/{O6femb9LLl3nlgsDaYwS- → ky6ieNHfZXB_oHPklwTJb}/_buildManifest.js +0 -0
  74. /package/dist/web/standalone/.next/static/{O6femb9LLl3nlgsDaYwS- → ky6ieNHfZXB_oHPklwTJb}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9441],{79441:(e,t,s)=>{s.r(t),s.d(t,{ChatMode:()=>er,ChatPane:()=>eN});var r=s(95155),a=s(5772),n=s(12115),o=s(92564),l=s(20232),i=s(53961),d=s(36201),c=s(34152),m=s(89123),u=s(37595),x=s(77314),p=s(50538),g=s(34530),h=s(37618),f=s(15282),b=s(30125),j=s(55711),y=s(97810),w=s(64479),v=s(89363),N=s(21283),k=s(41730),S=s(68459),A=s(92451),C=s(1806),T=s(6296),D=s(33e3),E=s(94514),M=s(15411),$=s(7915),P=s(66088),R=s(21362),U=s(33210),q=s(6755),L=s(60285),I=s(3926),O=s(93631),F=s(10762),_=s(91337),z=s(39658),H=s(91459),K=s(67198);function W({...e}){return(0,r.jsx)(K.bL,{"data-slot":"popover",...e})}function V({...e}){return(0,r.jsx)(K.l9,{"data-slot":"popover-trigger",...e})}function G({className:e,align:t="center",sideOffset:s=4,...a}){return(0,r.jsx)(K.ZL,{children:(0,r.jsx)(K.UC,{"data-slot":"popover-content",align:t,sideOffset:s,className:(0,_.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...a})})}var Z=s(12774),B=s(98234),Q=s(93591),J=s(64834),Y=s(41463);let X=[{label:"Discuss",command:"/gsd discuss",icon:o.A,description:"Start guided milestone/slice discussion",category:"workflow",disabledDuringAuto:!0},{label:"Next",command:"/gsd next",icon:l.A,description:"Execute next task, then pause",category:"workflow"},{label:"Auto",command:"/gsd auto",icon:i.A,description:"Run all queued units continuously",category:"workflow"},{label:"Stop",command:"/gsd stop",icon:d.A,description:"Stop auto-mode gracefully",category:"workflow"},{label:"Pause",command:"/gsd pause",icon:c.A,description:"Pause auto-mode (preserves state)",category:"workflow"},{label:"Status",command:"/gsd status",icon:m.A,description:"Show progress dashboard",category:"visibility"},{label:"Visualize",command:"/gsd visualize",icon:u.A,description:"Interactive TUI (progress, deps, metrics, timeline)",category:"visibility"},{label:"Queue",command:"/gsd queue",icon:x.A,description:"Show queued/dispatched units and execution order",category:"visibility"},{label:"History",command:"/gsd history",icon:p.A,description:"View execution history with cost/phase/model details",category:"visibility"},{label:"Steer",command:"/gsd steer",icon:g.A,description:"Apply user override to active work",category:"correction"},{label:"Capture",command:"/gsd capture",icon:h.A,description:"Quick-capture a thought to CAPTURES.md",category:"correction"},{label:"Triage",command:"/gsd triage",icon:f.A,description:"Classify and route pending captures",category:"correction",disabledDuringAuto:!0},{label:"Skip",command:"/gsd skip",icon:b.A,description:"Prevent a unit from auto-mode dispatch",category:"correction"},{label:"Undo",command:"/gsd undo",icon:j.A,description:"Revert last completed unit",category:"correction"},{label:"Knowledge",command:"/gsd knowledge",icon:y.A,description:"Add rule, pattern, or lesson to KNOWLEDGE.md",category:"knowledge"},{label:"Mode",command:"/gsd mode",icon:w.A,description:"Set workflow mode (solo/team)",category:"config"},{label:"Prefs",command:"/gsd prefs",icon:v.A,description:"Manage preferences (global/project)",category:"config"},{label:"Doctor",command:"/gsd doctor",icon:N.A,description:"Diagnose and repair .gsd/ state",category:"maintenance"},{label:"Export",command:"/gsd export",icon:k.A,description:"Export milestone/slice results (JSON or Markdown)",category:"maintenance"},{label:"Cleanup",command:"/gsd cleanup",icon:S.A,description:"Remove merged branches or snapshots",category:"maintenance"},{label:"Remote",command:"/gsd remote",icon:A.A,description:"Control remote auto-mode (Slack/Discord)",category:"maintenance"}],ee=X.slice(0,3),et=X.slice(3),es={workflow:"Workflow",visibility:"Visibility",correction:"Course Correction",knowledge:"Knowledge",config:"Configuration",maintenance:"Maintenance"};function er({className:e}){let t=(0,B.gF)(),{sendCommand:s}=(0,B._l)(),a=t.boot?.bridge??null,o=(0,n.useCallback)(e=>{s((0,B.Sf)(e,a))},[s,a]);return(0,r.jsxs)("div",{className:(0,_.cn)("flex h-full flex-col overflow-hidden bg-background",e),children:[(0,r.jsx)(ea,{onPrimaryAction:o,onSecondaryAction:o}),(0,r.jsx)(eN,{sessionId:"gsd-main",command:"gsd",className:"flex-1",onOpenAction:e=>o(e.command)})]})}function ea({onPrimaryAction:e,onSecondaryAction:t}){let s=(0,B.gF)(),a=s.boot,n=a?.workspace??null,o=a?.auto??null,i=(0,Q.L)({phase:n?.active.phase??"pre-planning",autoActive:o?.active??!1,autoPaused:o?.paused??!1,onboardingLocked:a?.onboarding.locked??!1,commandInFlight:s.commandInFlight,bootStatus:s.bootStatus,hasMilestones:(n?.milestones.length??0)>0,stepMode:o?.stepMode??!1,projectDetectionKind:a?.projectDetection?.kind??null}),d=(()=>{if("ready"!==s.bootStatus)return s.bootStatus;let e=n?.active.phase;return e?o?.active&&!o?.paused?"auto":o?.paused?"paused":e:"idle"})();return(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-border bg-card px-4 py-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(C.A,{className:"h-4 w-4 text-muted-foreground"}),(0,r.jsx)("span",{className:"font-medium",children:"Chat Mode"}),(0,r.jsx)("span",{className:"rounded-full border border-border bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground uppercase tracking-wide",children:d})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2","data-testid":"chat-mode-action-bar",children:[i.primary&&(0,r.jsxs)("button",{"data-testid":"chat-primary-action",onClick:()=>{i.primary&&e(i.primary.command)},disabled:i.disabled,className:(0,_.cn)("inline-flex items-center gap-1.5 rounded-md px-3 py-1 text-xs font-medium transition-colors","destructive"===i.primary.variant?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-primary text-primary-foreground hover:bg-primary/90",i.disabled&&"cursor-not-allowed opacity-50"),title:i.disabledReason,children:[s.commandInFlight?(0,r.jsx)(T.A,{className:"h-3 w-3 animate-spin"}):i.isNewMilestone?(0,r.jsx)(D.A,{className:"h-3 w-3"}):(0,r.jsx)(l.A,{className:"h-3 w-3"}),i.primary.label]}),i.secondaries.map(e=>(0,r.jsx)("button",{"data-testid":`chat-secondary-action-${e.command}`,onClick:()=>t(e.command),disabled:i.disabled,className:(0,_.cn)("inline-flex items-center gap-1 rounded-md border border-border bg-background px-2 py-1 text-xs font-medium transition-colors hover:bg-accent",i.disabled&&"cursor-not-allowed opacity-50"),title:i.disabledReason,children:e.label},e.command)),s.commandInFlight&&(0,r.jsx)("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:(0,r.jsx)(T.A,{className:"h-3 w-3 animate-spin"})})]})]})}let en=null;function eo({content:e}){let[t,a]=(0,n.useState)(null),[o,l]=(0,n.useState)(!1),i=em();return((0,n.useEffect)(()=>{let t=!1;return Promise.all([Promise.all([s.e(4846),s.e(8921),s.e(4417)]).then(s.bind(s,4417)),Promise.all([s.e(4846),s.e(2397)]).then(s.bind(s,32397)),(!en&&(en=Promise.all([s.e(8921),s.e(4447)]).then(s.bind(s,24447)).then(e=>e.createHighlighter({themes:["github-dark-default","github-light-default"],langs:["typescript","tsx","javascript","jsx","json","jsonc","markdown","mdx","css","scss","less","html","xml","yaml","toml","bash","python","ruby","rust","go","java","kotlin","swift","c","cpp","csharp","php","sql","graphql","dockerfile","makefile","lua","diff","ini","dotenv"]})).catch(e=>{throw en=null,e})),en)]).then(([s,n,o])=>{if(t)return;console.debug("[ChatBubble] markdown modules loaded");let d=s.default,c=n.default,m=i?"github-dark-default":"github-light-default";a((0,r.jsx)(d,{remarkPlugins:[c],components:{code({className:e,children:t,...s}){let a=/language-(\w+)/.exec(e||""),n=String(t).replace(/\n$/,"");if(a)try{let e=o.codeToHtml(n,{lang:a[1],theme:m});return(0,r.jsx)("div",{className:"chat-code-block my-3 rounded-xl overflow-x-auto text-sm shadow-sm border border-border/50",dangerouslySetInnerHTML:{__html:e}})}catch{}return e||String(t).includes("\n")?(0,r.jsx)("pre",{className:(0,_.cn)("my-3 overflow-x-auto rounded-xl p-4 text-sm border border-border/50",i?"bg-[#0d1117]":"bg-[#f6f8fa]"),children:(0,r.jsx)("code",{className:"font-mono",children:t})}):(0,r.jsx)("code",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[0.85em] font-mono text-foreground",...s,children:t})},pre:({children:e})=>(0,r.jsx)(r.Fragment,{children:e}),table:({children:e})=>(0,r.jsx)("div",{className:"my-4 overflow-x-auto rounded-lg border border-border",children:(0,r.jsx)("table",{className:"min-w-full border-collapse text-sm",children:e})}),th:({children:e})=>(0,r.jsx)("th",{className:"border-b border-border bg-muted/50 px-3 py-2 text-left text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:e}),td:({children:e})=>(0,r.jsx)("td",{className:"border-b border-border/50 px-3 py-2 text-sm last:border-0",children:e}),a:({href:e,children:t})=>(0,r.jsx)("a",{href:e,className:"text-info underline underline-offset-2 hover:text-info transition-colors",target:"_blank",rel:"noopener noreferrer",children:t}),h1:({children:e})=>(0,r.jsx)("h1",{className:"mt-4 mb-2 text-base font-semibold text-foreground first:mt-0",children:e}),h2:({children:e})=>(0,r.jsx)("h2",{className:"mt-3 mb-1.5 text-sm font-semibold text-foreground first:mt-0",children:e}),h3:({children:e})=>(0,r.jsx)("h3",{className:"mt-2 mb-1 text-sm font-medium text-foreground first:mt-0",children:e}),ul:({children:e})=>(0,r.jsx)("ul",{className:"my-2 ml-4 list-disc space-y-0.5 text-sm [&>li]:text-foreground",children:e}),ol:({children:e})=>(0,r.jsx)("ol",{className:"my-2 ml-4 list-decimal space-y-0.5 text-sm [&>li]:text-foreground",children:e}),blockquote:({children:e})=>(0,r.jsx)("blockquote",{className:"my-3 border-l-2 border-primary/40 pl-3 text-sm text-muted-foreground italic",children:e}),hr:()=>(0,r.jsx)("hr",{className:"my-4 border-border/50"}),p:({children:e})=>(0,r.jsx)("p",{className:"mb-2 text-sm leading-relaxed last:mb-0 text-foreground",children:e}),img:({alt:e,src:t})=>(0,r.jsxs)("span",{className:"my-2 block rounded-lg border border-border bg-muted/50 px-3 py-2 text-xs text-muted-foreground italic",children:["\uD83D\uDDBC ",e||t||"image"]})},children:e})),l(!0)}).catch(()=>{t||l(!0)}),()=>{t=!0}},[e,i]),o&&t)?(0,r.jsx)("div",{className:"chat-markdown min-w-0",children:t}):(0,r.jsx)("span",{className:"whitespace-pre-wrap text-sm leading-relaxed text-foreground",children:e})}function el({prompt:e,onSubmit:t}){let[s,a]=(0,n.useState)(e.selectedIndex??0),[o,l]=(0,n.useState)(!1),i=(0,n.useRef)(null);(0,n.useEffect)(()=>{console.log("[TuiSelectPrompt] mounted kind=select label=%s",e.label),i.current?.focus()},[e.label]);let d=(0,n.useCallback)(e=>{let r=e-s,n="";r>0?n="\x1b[B".repeat(r):r<0&&(n="\x1b[A".repeat(Math.abs(r))),console.log("[TuiSelectPrompt] submit delta=%d keystrokes=%j",r,n+="\r"),a(e),l(!0),t(n)},[s,t]),c=(0,n.useCallback)(t=>{o||("ArrowUp"===t.key?(t.preventDefault(),a(e=>Math.max(0,e-1))):"ArrowDown"===t.key?(t.preventDefault(),a(t=>Math.min(e.options.length-1,t+1))):"Enter"===t.key&&(t.preventDefault(),d(s)))},[o,s,e.options.length,d]);if(o){let t=e.options[s]??"";return(0,r.jsxs)("div",{"data-testid":"tui-prompt-submitted",className:"mt-2 flex items-center gap-1.5 rounded-lg bg-primary/10 px-3 py-2 text-sm text-primary",children:[(0,r.jsx)(E.A,{className:"h-3.5 w-3.5 flex-shrink-0"}),(0,r.jsx)("span",{className:"font-medium",children:t})]})}return(0,r.jsxs)("div",{ref:i,"data-testid":"tui-select-prompt",tabIndex:0,onKeyDown:c,className:"mt-2 rounded-xl border border-border bg-background p-1.5 shadow-sm outline-none focus-visible:ring-1 focus-visible:ring-border","aria-label":`Select: ${e.label}`,role:"listbox","aria-activedescendant":`tui-select-option-${s}`,children:[e.label&&(0,r.jsx)("p",{className:"mb-1.5 px-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:e.label}),e.options.map((t,a)=>{let n=a===s,o=e.descriptions?.[a];return(0,r.jsxs)("button",{id:`tui-select-option-${a}`,"data-testid":`tui-select-option-${a}`,role:"option","aria-selected":n,onClick:()=>d(a),className:(0,_.cn)("flex w-full items-start gap-2 rounded-lg px-3 py-1.5 text-left text-sm transition-colors",n?"bg-primary/15 text-primary font-medium":"text-foreground hover:bg-muted"),children:[(0,r.jsx)("span",{className:"mt-0.5 flex h-4 w-4 flex-shrink-0 items-center justify-center",children:n?(0,r.jsx)(E.A,{className:"h-3 w-3 text-primary"}):(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-muted-foreground/30"})}),(0,r.jsxs)("span",{className:"min-w-0",children:[(0,r.jsx)("span",{className:"block",children:t}),o&&(0,r.jsx)("span",{className:"mt-0.5 block text-xs font-normal text-muted-foreground",children:o})]})]},a)})]})}function ei({prompt:e,onSubmit:t}){let[s,a]=(0,n.useState)(""),[o,l]=(0,n.useState)(!1),i=(0,n.useRef)(null);(0,n.useEffect)(()=>{console.log("[TuiTextPrompt] mounted kind=text label=%s",e.label),i.current?.focus()},[e.label]);let d=(0,n.useCallback)(()=>{o||(console.log("[TuiTextPrompt] submitted label=%s",e.label),l(!0),t(s+"\r"))},[o,s,e.label,t]),c=(0,n.useCallback)(e=>{"Enter"===e.key&&(e.preventDefault(),d())},[d]);return o?(0,r.jsxs)("div",{"data-testid":"tui-prompt-submitted",className:"mt-2 flex items-center gap-1.5 rounded-lg bg-primary/10 px-3 py-2 text-sm text-primary",children:[(0,r.jsx)(E.A,{className:"h-3.5 w-3.5 flex-shrink-0"}),(0,r.jsx)("span",{className:"font-medium",children:"✓ Submitted"})]}):(0,r.jsxs)("div",{"data-testid":"tui-text-prompt",className:"mt-2 rounded-xl border border-border bg-background p-3 shadow-sm",children:[e.label&&(0,r.jsx)("p",{className:"mb-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:e.label}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(z.p,{ref:i,value:s,onChange:e=>a(e.target.value),onKeyDown:c,placeholder:"Type your answer…",className:"flex-1 h-8 text-sm","aria-label":e.label||"Text input"}),(0,r.jsx)("button",{onClick:d,disabled:!s.trim(),className:(0,_.cn)("flex h-8 items-center justify-center rounded-lg px-3 text-xs font-medium transition-all",s.trim()?"bg-primary text-primary-foreground hover:bg-primary/90 active:scale-95 shadow-sm":"bg-muted text-muted-foreground cursor-not-allowed"),children:"Submit"})]})]})}function ed({prompt:e,onSubmit:t}){let[s,a]=(0,n.useState)(""),[o,l]=(0,n.useState)(!1),[i,d]=(0,n.useState)(!1),c=(0,n.useRef)(null);(0,n.useEffect)(()=>{console.log("[TuiPasswordPrompt] mounted kind=password label=%s",e.label),c.current?.focus()},[e.label]);let m=(0,n.useCallback)(()=>{o||(console.log("[TuiPasswordPrompt] submitted label=%s",e.label),l(!0),t(s+"\r"))},[o,s,e.label,t]),u=(0,n.useCallback)(e=>{"Enter"===e.key&&(e.preventDefault(),m())},[m]);if(o){let t=e.label||"Value";return(0,r.jsxs)("div",{"data-testid":"tui-prompt-submitted",className:"mt-2 flex items-center gap-1.5 rounded-lg bg-primary/10 px-3 py-2 text-sm text-primary",children:[(0,r.jsx)(E.A,{className:"h-3.5 w-3.5 flex-shrink-0"}),(0,r.jsxs)("span",{className:"font-medium",children:[t," — entered ✓"]})]})}return(0,r.jsxs)("div",{"data-testid":"tui-password-prompt",className:"mt-2 rounded-xl border border-border bg-background p-3 shadow-sm",children:[e.label&&(0,r.jsx)("p",{className:"mb-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:e.label}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)("div",{className:"relative flex-1",children:[(0,r.jsx)(z.p,{ref:c,type:i?"text":"password",value:s,onChange:e=>a(e.target.value),onKeyDown:u,placeholder:"Enter value…",className:"h-8 pr-9 text-sm","aria-label":e.label||"Password input",autoComplete:"off"}),(0,r.jsx)("button",{type:"button",onClick:()=>d(e=>!e),tabIndex:-1,"aria-label":i?"Hide input":"Show input",className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-muted-foreground transition-colors",children:i?(0,r.jsx)(M.A,{className:"h-3.5 w-3.5"}):(0,r.jsx)($.A,{className:"h-3.5 w-3.5"})})]}),(0,r.jsx)("button",{onClick:m,disabled:!s,className:(0,_.cn)("flex h-8 items-center justify-center rounded-lg px-3 text-xs font-medium transition-all",s?"bg-primary text-primary-foreground hover:bg-primary/90 active:scale-95 shadow-sm":"bg-muted text-muted-foreground cursor-not-allowed"),children:"Submit"})]}),(0,r.jsx)("p",{className:"mt-1.5 text-[10px] text-muted-foreground",children:"Value is transmitted securely and not stored in chat history."})]})}function ec(){return(0,r.jsx)("span",{"aria-hidden":"true",className:"ml-0.5 inline-block h-3.5 w-0.5 translate-y-0.5 rounded-full bg-current opacity-70",style:{animation:"chat-cursor 1s ease-in-out infinite"}})}function em(){let[e,t]=(0,n.useState)(()=>"u">typeof document&&document.documentElement.classList.contains("dark"));return(0,n.useEffect)(()=>{if("u"<typeof document)return;let e=document.documentElement,s=new MutationObserver(()=>{t(e.classList.contains("dark"))});return s.observe(e,{attributes:!0,attributeFilter:["class"]}),()=>s.disconnect()},[]),e}function eu({className:e}){let t=em();return(0,r.jsx)(a.default,{src:t?"/logo-icon-white.svg":"/logo-icon-black.svg",alt:"",width:24,height:32,unoptimized:!0,className:(0,_.cn)("h-4 w-auto",e)})}function ex({content:e,isStreaming:t}){let[s,a]=(0,n.useState)(!1),o=(0,n.useRef)(null),l=e.split("\n").filter(e=>e.trim()),i=l.slice(-5),d=l.length>5;return(0,n.useEffect)(()=>{s&&t&&o.current&&(o.current.scrollTop=o.current.scrollHeight)},[s,t,e]),(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsxs)("button",{onClick:()=>a(e=>!e),className:(0,_.cn)("group w-full rounded-xl border px-3.5 py-2.5 text-left transition-all","border-border/50 bg-muted/50 hover:bg-muted/50"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[t?(0,r.jsxs)("span",{className:"relative flex h-2 w-2 flex-shrink-0",children:[(0,r.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-muted-foreground/30"}),(0,r.jsx)("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-muted-foreground/50"})]}):(0,r.jsx)("span",{className:"flex h-4 w-4 flex-shrink-0 items-center justify-center rounded bg-muted-foreground/10",children:(0,r.jsx)("span",{className:"text-[9px] text-muted-foreground",children:"\uD83D\uDCAD"})}),(0,r.jsx)("span",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:t?"Thinking…":"Thought process"}),d&&!s&&(0,r.jsxs)("span",{className:"ml-1 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:[l.length," lines"]}),(0,r.jsx)("span",{className:"ml-auto flex-shrink-0",children:s?(0,r.jsx)(P.A,{className:"h-3 w-3 text-muted-foreground transition-transform"}):(0,r.jsx)(R.A,{className:"h-3 w-3 text-muted-foreground transition-transform group-hover:text-muted-foreground"})})]}),!s&&(0,r.jsxs)("div",{className:"mt-2 space-y-0.5 border-l-2 border-muted-foreground/10 pl-3",children:[i.map((e,t)=>(0,r.jsx)("p",{className:"text-[12px] leading-relaxed text-muted-foreground line-clamp-1",children:e},t)),t&&(0,r.jsx)(ec,{})]}),s&&(0,r.jsxs)("div",{ref:o,className:"mt-2 max-h-[400px] overflow-y-auto overscroll-contain rounded-lg border border-border/50 bg-background/50 p-3 text-[12px] leading-[1.7] text-muted-foreground whitespace-pre-wrap scrollbar-thin scrollbar-thumb-border scrollbar-track-transparent",children:[e,t&&(0,r.jsx)(ec,{})]})]})})}function ep({message:e,onSubmitPrompt:t,isThinking:s}){if("system"===e.role)return(0,r.jsx)("div",{className:"flex items-center justify-center py-1",children:(0,r.jsx)("span",{className:"text-[11px] text-muted-foreground italic px-3",children:e.content})});if("user"===e.role)return(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsxs)("div",{className:"max-w-[72%] rounded-2xl rounded-br-md bg-primary px-4 py-2.5 text-sm text-primary-foreground shadow-sm",children:[e.images&&e.images.length>0&&(0,r.jsx)("div",{className:"flex gap-1.5 mb-2 flex-wrap",children:e.images.map((e,t)=>(0,r.jsx)(a.default,{src:`data:${e.mimeType};base64,${e.data}`,alt:`Attached image ${t+1}`,width:32,height:32,unoptimized:!0,className:"h-8 w-8 rounded object-cover border border-primary-foreground/20"},t))}),(0,r.jsx)("span",{className:"whitespace-pre-wrap leading-relaxed",children:e.content}),!e.complete&&(0,r.jsx)(ec,{})]})});let n=e.prompt?.kind==="select"&&!e.complete&&null!=t,o=e.prompt?.kind==="text"&&!e.complete&&null!=t,l=e.prompt?.kind==="password"&&!e.complete&&null!=t,i=n||o||l;return(0,r.jsxs)("div",{className:"flex justify-start gap-3",children:[(0,r.jsx)("div",{className:"mt-1 flex-shrink-0 flex h-7 w-7 items-center justify-center rounded-full bg-card border border-border",children:(0,r.jsx)(eu,{className:"h-3.5 w-auto"})}),(0,r.jsxs)("div",{className:"max-w-[82%] min-w-0 rounded-2xl rounded-tl-md border border-border bg-card px-4 py-3 shadow-sm",children:[s&&!e.content&&(0,r.jsxs)("div",{className:"flex items-center gap-2 py-1",children:[(0,r.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,r.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-muted-foreground/30"}),(0,r.jsx)("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-muted-foreground/50"})]}),(0,r.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:"Thinking…"})]}),e.content&&(0,r.jsx)(eo,{content:e.content}),!e.complete&&!i&&(0,r.jsx)(ec,{}),n&&(0,r.jsx)(el,{prompt:e.prompt,onSubmit:t}),o&&(0,r.jsx)(ei,{prompt:e.prompt,onSubmit:t}),l&&(0,r.jsx)(ed,{prompt:e.prompt,onSubmit:t})]})]})}function eg({onSendInput:e,connected:t,onOpenAction:s}){let o=(0,B.gF)().boot?.auto?.active??!1,[l,i]=(0,n.useState)(""),[d,c]=(0,n.useState)(!1),[m,u]=(0,n.useState)([]),[x,p]=(0,n.useState)(!1),[g,h]=(0,n.useState)(null),f=(0,n.useRef)(null),b=(0,n.useRef)(0);(0,n.useEffect)(()=>()=>{m.forEach(e=>URL.revokeObjectURL(e.previewUrl))},[]);let j=(0,n.useCallback)(async e=>{h(null);let t=e.filter(e=>e.type.startsWith("image/"));if(0===t.length)return;u(e=>(Z.wN-e.length<=0&&h(`Maximum ${Z.wN} images per message`),e));let s=m.length,r=t.slice(0,Z.wN-s);r.length<t.length&&h(`Maximum ${Z.wN} images per message`);let a=[];for(let e of r)try{let t=await (0,Z.zF)(e),s=URL.createObjectURL(e);a.push({id:(0,Z.Aw)(),data:t.data,mimeType:t.mimeType,previewUrl:s})}catch(e){console.warn("[chat-input] image processing failed:",e instanceof Error?e.message:e),h(e instanceof Error?e.message:"Failed to process image")}a.length>0&&u(e=>{let t=[...e,...a];return t.length>Z.wN?(t.slice(Z.wN).forEach(e=>URL.revokeObjectURL(e.previewUrl)),h(`Maximum ${Z.wN} images per message`),t.slice(0,Z.wN)):t})},[m.length]),y=(0,n.useCallback)(e=>{u(t=>{let s=t.find(t=>t.id===e);return s&&URL.revokeObjectURL(s.previewUrl),t.filter(t=>t.id!==e)}),h(null)},[]),w=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),p(!1),b.current=0,j(Array.from(e.dataTransfer.files))},[j]),v=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),N=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),b.current+=1,p(!0)},[]),k=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),b.current-=1,b.current<=0&&(b.current=0,p(!1))},[]),S=(0,n.useCallback)(e=>{let t=e.clipboardData?.files;if(t&&t.length>0){let s=Array.from(t).filter(e=>e.type.startsWith("image/"));s.length>0&&(e.preventDefault(),j(s))}},[j]),A=(0,n.useCallback)(()=>{!l.trim()&&0===m.length||t&&(e(l+"\r",m.length>0?m:void 0),i(""),u([]),h(null),f.current&&(f.current.style.height="auto"))},[l,t,e,m]),C=(0,n.useCallback)(e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),A())},[A]),T=(0,n.useCallback)(e=>{i(e.target.value);let t=e.target;t.style.height="auto",t.style.height=`${Math.min(t.scrollHeight,160)}px`},[]),D=l.trim().length>0||m.length>0,E=(0,n.useMemo)(()=>(function(e){let t=new Map;for(let s of e){let e=t.get(s.category);e||(e=[],t.set(s.category,e)),e.push(s)}return Array.from(t.entries()).map(([e,t])=>({category:e,label:es[e],items:t}))})(et),[]);return(0,r.jsx)("div",{className:"flex-shrink-0 border-t border-border bg-card px-4 py-3 backdrop-blur-sm",children:(0,r.jsxs)("div",{className:"flex items-end gap-2",onDrop:w,onDragOver:v,onDragEnter:N,onDragLeave:k,children:[(0,r.jsxs)("div",{className:(0,_.cn)("flex flex-1 flex-col rounded-xl border bg-background transition-colors",t?"border-border focus-within:ring-1 focus-within:ring-border/30":"border-border/50 opacity-80",x&&t&&"border-primary/60 ring-2 ring-primary/20 bg-primary/5"),children:[m.length>0&&(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-2.5 pb-1 flex-wrap",children:[m.map(e=>(0,r.jsxs)("div",{className:"relative group flex-shrink-0",children:[(0,r.jsx)(a.default,{src:e.previewUrl,alt:"Pending image",width:48,height:48,unoptimized:!0,className:"h-12 w-12 rounded-lg object-cover border border-border/50"}),(0,r.jsx)("button",{onClick:()=>y(e.id),"aria-label":"Remove image",className:"absolute -top-1.5 -right-1.5 flex h-4 w-4 items-center justify-center rounded-full bg-destructive text-destructive-foreground text-[10px] opacity-0 group-hover:opacity-100 transition-opacity shadow-sm",children:(0,r.jsx)(U.A,{className:"h-2.5 w-2.5"})})]},e.id)),g&&(0,r.jsx)("span",{className:"text-[10px] text-muted-foreground italic",children:g})]}),(0,r.jsxs)("div",{className:"flex items-end gap-2",children:[(0,r.jsx)("textarea",{ref:f,value:l,onChange:T,onKeyDown:C,onPaste:S,disabled:!t,rows:1,"aria-label":"Send message",placeholder:t?"Message…":"Connecting…",className:"min-h-[40px] flex-1 resize-none bg-transparent px-3 py-2.5 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:text-muted-foreground",style:{height:"40px",maxHeight:"160px",overflowY:"auto"}}),(0,r.jsxs)("div",{className:"flex flex-shrink-0 items-end pb-1.5 pr-1.5 gap-1",children:[!t&&(0,r.jsx)("span",{className:"px-2 py-1 text-[10px] font-medium text-muted-foreground uppercase tracking-wide",children:"Disconnected"}),(0,r.jsx)("button",{onClick:A,disabled:!t||!D,"aria-label":"Send",className:(0,_.cn)("flex h-7 w-7 items-center justify-center rounded-lg transition-all",D&&t?"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 active:scale-95":"bg-muted text-muted-foreground cursor-not-allowed"),children:(0,r.jsx)(q.A,{className:"h-3.5 w-3.5"})})]})]})]}),s&&(0,r.jsxs)(H.Bc,{delayDuration:300,children:[ee.map(e=>{let t=e.icon,a=e.disabledDuringAuto&&o;return(0,r.jsxs)(H.m_,{children:[(0,r.jsx)(H.k$,{asChild:!0,children:(0,r.jsxs)("button",{onClick:()=>s(e),disabled:a,"aria-label":e.description,className:(0,_.cn)("flex flex-shrink-0 items-center justify-center gap-1.5 rounded-xl border border-border bg-background px-3 py-2.5 text-xs font-medium text-foreground transition-colors hover:bg-accent",a&&"cursor-not-allowed opacity-40"),children:[(0,r.jsx)(t,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.label]})}),(0,r.jsxs)(H.ZI,{side:"top",sideOffset:6,children:[(0,r.jsx)("p",{className:"font-medium",children:e.label}),(0,r.jsx)("p",{className:"text-[10px] opacity-80",children:a?"Disabled while auto-mode is running":e.description})]})]},e.command)}),(0,r.jsxs)(W,{open:d,onOpenChange:c,children:[(0,r.jsxs)(H.m_,{children:[(0,r.jsx)(H.k$,{asChild:!0,children:(0,r.jsx)(V,{asChild:!0,children:(0,r.jsx)("button",{"aria-label":"More GSD commands",className:(0,_.cn)("flex flex-shrink-0 items-center justify-center rounded-xl border border-border bg-background p-2.5 text-foreground transition-colors hover:bg-accent",d&&"bg-accent"),children:(0,r.jsx)(L.A,{className:"h-4 w-4 text-muted-foreground"})})})}),!d&&(0,r.jsx)(H.ZI,{side:"top",sideOffset:6,children:"More commands"})]}),(0,r.jsx)(G,{side:"top",align:"end",sideOffset:8,className:"w-64 max-h-[420px] overflow-y-auto rounded-xl border border-border bg-popover p-2 shadow-lg",children:E.map((e,t)=>(0,r.jsxs)("div",{children:[t>0&&(0,r.jsx)("div",{className:"my-1.5 border-t border-border/50"}),(0,r.jsx)("p",{className:"px-2 py-1 text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:e.label}),e.items.map(e=>{let t=e.icon,a=e.disabledDuringAuto&&o;return(0,r.jsxs)(H.m_,{children:[(0,r.jsx)(H.k$,{asChild:!0,children:(0,r.jsxs)("button",{onClick:()=>{a||(c(!1),s(e))},disabled:a,className:(0,_.cn)("flex w-full items-center gap-2.5 rounded-lg px-2 py-1.5 text-left text-sm text-foreground transition-colors hover:bg-accent",a&&"cursor-not-allowed opacity-40"),children:[(0,r.jsx)(t,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,r.jsx)("span",{className:"flex-1 truncate",children:e.label})]})}),(0,r.jsxs)(H.ZI,{side:"left",sideOffset:8,children:[(0,r.jsx)("p",{className:"font-medium",children:e.label}),(0,r.jsx)("p",{className:"text-[10px] opacity-80",children:a?"Disabled while auto-mode is running":e.description})]})]},e.command)})]},e.category))})]})]})]})})}function eh({connected:e,runningLabel:t,notice:s,primaryAction:a,onPrimaryAction:n}){let o=e&&!!t;return(0,r.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center text-center py-16",children:[(0,r.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full border border-border bg-card",children:o?(0,r.jsx)(T.A,{className:"h-5 w-5 animate-spin text-muted-foreground"}):(0,r.jsx)(C.A,{className:"h-6 w-6 text-muted-foreground"})}),(0,r.jsxs)("div",{className:"mt-3 space-y-1",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Chat Mode"}),o?(0,r.jsxs)("p",{className:"max-w-xs text-xs text-muted-foreground",children:["Running ",t,"…"]}):s?(0,r.jsx)("p",{className:"max-w-xs text-xs text-muted-foreground",children:s}):e?a&&n?(0,r.jsx)("div",{className:"mt-4",children:(0,r.jsxs)("button",{onClick:n,className:"inline-flex items-center gap-2 rounded-xl border border-border bg-background px-5 py-2.5 text-sm font-medium text-foreground transition-colors hover:bg-accent active:scale-[0.98]",children:[(0,r.jsx)(a.icon,{className:"h-4 w-4 text-muted-foreground"}),a.label]})}):(0,r.jsx)("p",{className:"max-w-xs text-xs text-muted-foreground",children:"Connected — waiting for GSD output…"}):(0,r.jsx)("p",{className:"max-w-xs text-xs text-muted-foreground",children:"Connecting to GSD session…"})]})]})}function ef({request:e}){let{respondToUiRequest:t,dismissUiRequest:s}=(0,B._l)(),a="extension_ui_response"===(0,B.gF)().commandInFlight,o=(0,n.useCallback)(s=>{t(e.id,s)},[t,e.id]),l=(0,n.useCallback)(()=>{s(e.id)},[s,e.id]);return(0,r.jsxs)("div",{className:"flex justify-start gap-3","data-testid":"inline-ui-request","data-request-id":e.id,children:[(0,r.jsx)("div",{className:"mt-1 flex-shrink-0 flex h-7 w-7 items-center justify-center rounded-full bg-card border border-border",children:(0,r.jsx)(eu,{className:"h-3.5 w-auto"})}),(0,r.jsxs)("div",{className:"max-w-[82%] min-w-0 rounded-2xl rounded-tl-md border border-border bg-card px-4 py-3 shadow-sm",children:[e.title&&(0,r.jsx)("p",{className:"mb-2.5 text-sm font-medium text-foreground",children:e.title}),"select"===e.method&&(0,r.jsx)(eb,{request:e,onSubmit:o,disabled:a}),"confirm"===e.method&&(0,r.jsx)(ej,{request:e,onSubmit:o,onDismiss:l,disabled:a}),"input"===e.method&&(0,r.jsx)(ey,{request:e,onSubmit:o,disabled:a}),"editor"===e.method&&(0,r.jsx)(ew,{request:e,onSubmit:o,disabled:a})]})]})}function eb({request:e,onSubmit:t,disabled:s}){let a=!!e.allowMultiple,[o,l]=(0,n.useState)(""),[i,d]=(0,n.useState)(new Set),[c,m]=(0,n.useState)(!1),u=(0,n.useCallback)(()=>{m(!0),t({value:a?Array.from(i):o})},[a,o,i,t]);if(c)return(0,r.jsxs)("div",{className:"flex items-center gap-1.5 rounded-lg bg-primary/10 px-3 py-2 text-sm text-primary",children:[(0,r.jsx)(E.A,{className:"h-3.5 w-3.5 flex-shrink-0"}),(0,r.jsx)("span",{className:"font-medium",children:a?`${i.size} selected`:o})]});let x=a?i.size>0:""!==o;return(0,r.jsxs)("div",{className:"space-y-1.5",children:[e.options.map((e,t)=>{if(a){let a=i.has(e);return(0,r.jsxs)("button",{onClick:()=>{let t=new Set(i);a?t.delete(e):t.add(e),d(t)},disabled:s,className:(0,_.cn)("flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-left text-sm transition-colors",a?"bg-primary/15 text-primary font-medium":"text-foreground hover:bg-muted"),children:[(0,r.jsx)("span",{className:"flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border border-border",children:a&&(0,r.jsx)(E.A,{className:"h-2.5 w-2.5 text-primary"})}),(0,r.jsx)("span",{children:e})]},t)}let n=o===e;return(0,r.jsxs)("button",{onClick:()=>l(e),disabled:s,className:(0,_.cn)("flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-left text-sm transition-colors",n?"bg-primary/15 text-primary font-medium":"text-foreground hover:bg-muted"),children:[(0,r.jsx)("span",{className:"flex h-4 w-4 flex-shrink-0 items-center justify-center",children:n?(0,r.jsx)(E.A,{className:"h-3 w-3 text-primary"}):(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-muted-foreground/30"})}),(0,r.jsx)("span",{children:e})]},t)}),(0,r.jsx)("button",{onClick:u,disabled:s||!x,className:(0,_.cn)("mt-2 flex w-full items-center justify-center rounded-lg px-3 py-2 text-xs font-medium transition-all",x&&!s?"bg-primary text-primary-foreground hover:bg-primary/90 active:scale-[0.98] shadow-sm":"bg-muted text-muted-foreground cursor-not-allowed"),children:a?`Submit (${i.size})`:"Submit"})]})}function ej({request:e,onSubmit:t,onDismiss:s,disabled:a}){let[o,l]=(0,n.useState)(null);return null!==o?(0,r.jsxs)("div",{className:"flex items-center gap-1.5 rounded-lg bg-primary/10 px-3 py-2 text-sm text-primary",children:[(0,r.jsx)(E.A,{className:"h-3.5 w-3.5 flex-shrink-0"}),(0,r.jsx)("span",{className:"font-medium",children:o?"Confirmed":"Cancelled"})]}):(0,r.jsxs)("div",{className:"space-y-2.5",children:[(0,r.jsx)("p",{className:"text-sm text-foreground leading-relaxed",children:e.message}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("button",{onClick:()=>{l(!0),t({value:!0})},disabled:a,className:"flex-1 rounded-lg bg-primary px-3 py-2 text-xs font-medium text-primary-foreground hover:bg-primary/90 active:scale-[0.98] shadow-sm transition-all",children:"Confirm"}),(0,r.jsx)("button",{onClick:()=>{l(!1),s()},disabled:a,className:"flex-1 rounded-lg border border-border bg-background px-3 py-2 text-xs font-medium text-foreground hover:bg-accent transition-colors",children:"Cancel"})]})]})}function ey({request:e,onSubmit:t,disabled:s}){let[a,o]=(0,n.useState)(""),[l,i]=(0,n.useState)(!1),d=(0,n.useRef)(null);if((0,n.useEffect)(()=>{d.current?.focus()},[]),l)return(0,r.jsxs)("div",{className:"flex items-center gap-1.5 rounded-lg bg-primary/10 px-3 py-2 text-sm text-primary",children:[(0,r.jsx)(E.A,{className:"h-3.5 w-3.5 flex-shrink-0"}),(0,r.jsx)("span",{className:"font-medium",children:"Submitted"})]});let c=()=>{a.trim()&&!s&&(i(!0),t({value:a}))};return(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(z.p,{ref:d,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),c())},placeholder:e.placeholder||"Type your answer…",disabled:s,className:"flex-1 h-8 text-sm"}),(0,r.jsx)("button",{onClick:c,disabled:s||!a.trim(),className:(0,_.cn)("flex h-8 items-center justify-center rounded-lg px-3 text-xs font-medium transition-all",a.trim()&&!s?"bg-primary text-primary-foreground hover:bg-primary/90 active:scale-95 shadow-sm":"bg-muted text-muted-foreground cursor-not-allowed"),children:"Submit"})]})}function ew({request:e,onSubmit:t,disabled:s}){let[a,o]=(0,n.useState)(e.prefill||""),[l,i]=(0,n.useState)(!1);return l?(0,r.jsxs)("div",{className:"flex items-center gap-1.5 rounded-lg bg-primary/10 px-3 py-2 text-sm text-primary",children:[(0,r.jsx)(E.A,{className:"h-3.5 w-3.5 flex-shrink-0"}),(0,r.jsx)("span",{className:"font-medium",children:"Submitted"})]}):(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("textarea",{value:a,onChange:e=>o(e.target.value),disabled:s,className:"w-full min-h-[120px] rounded-lg border border-border bg-background px-3 py-2 text-sm font-mono focus:outline-none focus:ring-1 focus:ring-border/30 resize-y",autoFocus:!0}),(0,r.jsx)("button",{onClick:()=>{i(!0),t({value:a})},disabled:s,className:"flex w-full items-center justify-center rounded-lg bg-primary px-3 py-2 text-xs font-medium text-primary-foreground hover:bg-primary/90 active:scale-[0.98] shadow-sm transition-all",children:"Submit"})]})}function ev({tool:e}){let[t,s]=(0,n.useState)(!1),a=(0,n.useRef)(!1),o="string"==typeof e.name?e.name.toLowerCase():"",l="string"==typeof e.args?.path?e.args.path:"string"==typeof e.args?.file_path?e.args.file_path:null,i=l?l.startsWith(Y.env.HOME??"/Users")?"~"+l.slice((Y.env.HOME??"").length):l:null,d=e.result?.isError??!1,c=e.result?.details?.diff,m="edit"===o?(0,r.jsx)(I.A,{className:"h-3.5 w-3.5"}):"write"===o?(0,r.jsx)(O.A,{className:"h-3.5 w-3.5"}):(0,r.jsx)(F.A,{className:"h-3.5 w-3.5"}),u="edit"===o?"Edit":"write"===o?"Write":"bash"===o?"$":e.name,x="bash"===o&&"string"==typeof e.args?.command?e.args.command:null,p=e.result?.content?.filter(e=>"text"===e.type&&e.text).map(e=>e.text).join("\n")??"";return(0,n.useEffect)(()=>{a.current||(c||p.trim()||d)&&(a.current=!0,s(!0))},[c,p,d]),(0,r.jsxs)("div",{className:"flex justify-start gap-3",children:[(0,r.jsx)("div",{className:"w-7 flex-shrink-0"}),(0,r.jsx)("div",{className:"max-w-[82%] min-w-0 w-full",children:(0,r.jsxs)("button",{onClick:()=>s(e=>!e),className:(0,_.cn)("w-full rounded-lg border px-3 py-2 text-left text-xs transition-colors",d?"border-destructive/30 bg-destructive/5 hover:bg-destructive/10":"border-border/50 bg-muted/50 hover:bg-muted/50"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:(0,_.cn)("flex-shrink-0",d?"text-destructive":"text-muted-foreground"),children:m}),(0,r.jsx)("span",{className:(0,_.cn)("font-mono font-medium",d?"text-destructive":"text-muted-foreground"),children:u}),i&&(0,r.jsx)("span",{className:"truncate font-mono text-info/80",children:i}),x&&!i&&(0,r.jsx)("span",{className:"truncate font-mono text-muted-foreground",children:x.length>60?x.slice(0,60)+"…":x}),(0,r.jsx)("span",{className:"ml-auto flex-shrink-0 text-muted-foreground",children:t?(0,r.jsx)(P.A,{className:"h-3 w-3"}):(0,r.jsx)(R.A,{className:"h-3 w-3"})})]}),t&&c&&(0,r.jsx)("div",{className:"mt-2 overflow-x-auto rounded-md border border-border/50 bg-background p-2 font-mono text-[11px] leading-relaxed",children:c.split("\n").map((e,t)=>{let s=e.startsWith("+"),a=e.startsWith("-"),n=e.startsWith(" ");return(0,r.jsx)("div",{className:(0,_.cn)("whitespace-pre",s&&"bg-success/10 text-success",a&&"bg-destructive/10 text-destructive",n&&"text-muted-foreground",!s&&!a&&!n&&"text-muted-foreground"),children:e},t)})}),t&&!c&&p&&(0,r.jsx)("div",{className:"mt-2 max-h-[200px] overflow-y-auto rounded-md border border-border/50 bg-background p-2 font-mono text-[11px] leading-relaxed text-muted-foreground whitespace-pre-wrap",children:p.length>2e3?p.slice(0,2e3)+"\n…":p}),t&&d&&p&&(0,r.jsx)("div",{className:"mt-2 rounded-md border border-destructive/20 bg-destructive/5 p-2 text-[11px] text-destructive whitespace-pre-wrap",children:p})]})})]})}function eN({className:e,onOpenAction:t}){let s=(0,B.gF)(),{submitInput:a,sendCommand:o,pushChatUserMessage:c}=(0,B._l)(),[m]=(0,J.A)(),u="connected"===s.connectionState,x=s.boot?.bridge.sessionState?.isStreaming??!1,p=s.boot?.bridge??null,g=(0,Q.L)({phase:s.boot?.workspace?.active.phase??"pre-planning",autoActive:s.boot?.auto?.active??!1,autoPaused:s.boot?.auto?.paused??!1,onboardingLocked:s.boot?.onboarding.locked??!1,commandInFlight:s.commandInFlight,bootStatus:s.bootStatus,hasMilestones:(s.boot?.workspace?.milestones.length??0)>0,stepMode:s.boot?.auto?.stepMode??!1,projectDetectionKind:s.boot?.projectDetection?.kind??null}),h=(0,n.useMemo)(()=>{if(!g.primary||g.disabled)return null;let e=g.primary,t={"/gsd stop":d.A,"/gsd auto":i.A,"/gsd next":l.A};return{label:e.label,icon:t[e.command]??("New Milestone"===e.label?D.A:l.A)}},[g]),f=(0,n.useCallback)(()=>{g.primary&&o((0,B.Sf)(g.primary.command,p))},[g,o,p]),b=(0,n.useCallback)((e,t)=>{let s=e.replace(/\r$/,"").trim();(s||t&&0!==t.length)&&(c({id:"u">typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():`msg-${Date.now()}-${Math.random().toString(16).slice(2)}`,role:"user",content:s,complete:!0,timestamp:Date.now(),images:t?.map(e=>({data:e.data,mimeType:e.mimeType}))}),a(s,t))},[a,c]),j=(0,n.useMemo)(()=>{let e=[],t=s.liveTranscript,r=s.completedTurnSegments,a=s.chatUserMessages;for(let s=0;s<Math.max(a.length,t.length);s++)if(s<a.length&&e.push({kind:"message",message:a[s]}),s<r.length&&r[s].length>0)for(let t of r[s])"thinking"===t.kind?e.push({kind:"thinking",content:t.content,id:`turn-${s}-thinking-${e.length}`}):"text"===t.kind?e.push({kind:"message",message:{id:`turn-${s}-text-${e.length}`,role:"assistant",content:t.content,complete:!0,timestamp:s+1}}):"tool"===t.kind&&e.push({kind:"tool",tool:t.tool});else s<t.length&&t[s].trim()&&e.push({kind:"message",message:{id:`transcript-${s}`,role:"assistant",content:t[s],complete:!0,timestamp:s+1}});for(let t of s.currentTurnSegments)"thinking"===t.kind?e.push({kind:"thinking",content:t.content,id:`current-thinking-${e.length}`}):"text"===t.kind?e.push({kind:"message",message:{id:`current-text-${e.length}`,role:"assistant",content:t.content,complete:!0,timestamp:Date.now()}}):"tool"===t.kind&&e.push({kind:"tool",tool:t.tool});for(let t of(s.activeToolExecution&&e.push({kind:"active-tool",tool:s.activeToolExecution}),s.streamingThinkingText.length>0&&e.push({kind:"streaming-thinking",content:s.streamingThinkingText}),s.streamingAssistantText.length>0&&e.push({kind:"streaming-message",content:s.streamingAssistantText,isThinking:!1}),0===s.streamingThinkingText.length&&0===s.streamingAssistantText.length&&!s.activeToolExecution&&x&&0===s.currentTurnSegments.length&&e.push({kind:"streaming-message",content:"",isThinking:!0}),s.pendingUiRequests))e.push({kind:"ui-request",request:t});return e},[s.liveTranscript,s.completedTurnSegments,s.currentTurnSegments,s.streamingAssistantText,s.streamingThinkingText,s.activeToolExecution,s.pendingUiRequests,s.chatUserMessages,x]),y=(0,n.useCallback)(e=>{a(e.replace(/\r$/,""))},[a]),w=0===j.length&&!x,v=u&&!x&&j.length>0&&!s.activeToolExecution&&0===s.pendingUiRequests.length,N=(0,n.useRef)(null),k=(0,n.useRef)(!0),S=(0,n.useCallback)(()=>{let e=N.current;e&&(k.current=e.scrollHeight-e.scrollTop-e.clientHeight<100)},[]);return(0,n.useEffect)(()=>{let e=N.current;e&&k.current&&(e.scrollTop=e.scrollHeight)},[j]),(0,r.jsxs)("div",{"data-testid":"chat-pane-store-driven",className:(0,_.cn)("flex flex-col overflow-hidden",e),children:[(0,r.jsx)("div",{className:"flex flex-1 flex-col overflow-hidden",children:w?(0,r.jsx)(eh,{connected:u,runningLabel:x?"responding":void 0,primaryAction:h,onPrimaryAction:f}):(0,r.jsxs)("div",{ref:N,onScroll:S,className:"flex-1 overflow-y-auto px-4 py-4 space-y-4",style:13!==m?{fontSize:`${m}px`}:void 0,children:[j.map((e,t)=>{switch(e.kind){case"message":return(0,r.jsx)(ep,{message:e.message,onSubmitPrompt:y},e.message.id);case"thinking":return(0,r.jsxs)("div",{className:"flex justify-start gap-3",children:[(0,r.jsx)("div",{className:"w-7 flex-shrink-0"}),(0,r.jsx)("div",{className:"max-w-[82%] min-w-0",children:(0,r.jsx)(ex,{content:e.content,isStreaming:!1})})]},e.id);case"streaming-thinking":return(0,r.jsxs)("div",{className:"flex justify-start gap-3",children:[(0,r.jsx)("div",{className:"w-7 flex-shrink-0"}),(0,r.jsx)("div",{className:"max-w-[82%] min-w-0",children:(0,r.jsx)(ex,{content:e.content,isStreaming:!0})})]},"streaming-thinking");case"streaming-message":return(0,r.jsx)(ep,{message:{id:"streaming-current",role:"assistant",content:e.content,complete:!1,timestamp:Date.now()},isThinking:e.isThinking},"streaming-message");case"tool":return(0,r.jsx)(ev,{tool:e.tool},e.tool.id);case"active-tool":return(0,r.jsxs)("div",{className:"flex justify-start gap-3",children:[(0,r.jsx)("div",{className:"w-7 flex-shrink-0"}),(0,r.jsx)("div",{className:"max-w-[82%] min-w-0",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-border/50 bg-muted/50 px-3.5 py-2",children:[(0,r.jsx)(T.A,{className:"h-3 w-3 animate-spin text-muted-foreground"}),(0,r.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.tool.name}),!!e.tool.args?.path&&(0,r.jsx)("span",{className:"font-mono text-xs text-info/80 truncate",children:String(e.tool.args?.path)})]})})]},`active-${e.tool.id}`);case"ui-request":return(0,r.jsx)(ef,{request:e.request},e.request.id)}}),v&&(0,r.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1 text-xs text-muted-foreground animate-in fade-in duration-500",children:[(0,r.jsx)("span",{className:"inline-block h-2 w-2 rounded-full bg-emerald-500/70 animate-pulse"}),"Ready for your input"]}),(0,r.jsx)("div",{className:"h-2"})]})}),(0,r.jsx)(eg,{onSendInput:b,connected:u,onOpenAction:t})]})}}}]);
@@ -1 +1 @@
1
- (()=>{"use strict";var e,a,f,c,d,b,t,r,o,n={},i={};function l(e){var a=i[e];if(void 0!==a)return a.exports;var f=i[e]={exports:{}},c=!0;try{n[e].call(f.exports,f,f.exports,l),c=!1}finally{c&&delete i[e]}return f.exports}l.m=n,e=[],l.O=(a,f,c,d)=>{if(f){d=d||0;for(var b=e.length;b>0&&e[b-1][2]>d;b--)e[b]=e[b-1];e[b]=[f,c,d];return}for(var t=1/0,b=0;b<e.length;b++){for(var[f,c,d]=e[b],r=!0,o=0;o<f.length;o++)(!1&d||t>=d)&&Object.keys(l.O).every(e=>l.O[e](f[o]))?f.splice(o--,1):(r=!1,d<t&&(t=d));if(r){e.splice(b--,1);var n=c();void 0!==n&&(a=n)}}return a},l.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return l.d(a,{a:a}),a},f=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,l.t=function(e,c){if(1&c&&(e=this(e)),8&c||"object"==typeof e&&e&&(4&c&&e.__esModule||16&c&&"function"==typeof e.then))return e;var d=Object.create(null);l.r(d);var b={};a=a||[null,f({}),f([]),f(f)];for(var t=2&c&&e;"object"==typeof t&&!~a.indexOf(t);t=f(t))Object.getOwnPropertyNames(t).forEach(a=>b[a]=()=>e[a]);return b.default=()=>e,l.d(d,b),d},l.d=(e,a)=>{for(var f in a)l.o(a,f)&&!l.o(e,f)&&Object.defineProperty(e,f,{enumerable:!0,get:a[f]})},l.f={},l.e=e=>Promise.all(Object.keys(l.f).reduce((a,f)=>(l.f[f](e,a),a),[])),l.u=e=>4986===e?"static/chunks/4986-c2fc8845ce785303.js":"static/chunks/"+(({535:"4ca0cff5",1290:"cee15710",1630:"53c1bd3f",2577:"d1c28714",3879:"cfdf2ac7",3888:"e868780c",4763:"4402d2ac",4814:"799ebd4e",6079:"363642f4",6666:"570e4624",6814:"7d29de82",7442:"92e53eb0",8835:"ce16f5a9",9312:"1cd6e1d3"})[e]||e)+"."+({10:"6cf001c181ce1098",34:"ce581867cf95e24b",36:"b4a553bf2106f6d3",194:"76dbdc07cdc2311d",214:"f6bba63dfa159e01",252:"a9e22657cbf67b42",315:"6f68ae79b67d25cf",327:"8ecab0b86d52b597",376:"9e742ff6919b2b54",392:"3cad93691f1b7360",400:"59979e0d3ae126e4",425:"9a3434a28926566a",535:"07efe2bc8f09d72e",541:"cfa15b606745131a",579:"33fc87fb95163c6a",583:"b3efc73cb21097e2",624:"2dd909fbfce98c5e",640:"5bf1e25d0bddf875",698:"e0dda03fd303b96b",794:"06b1ae4fc9cc10a9",816:"f909c891b91aa79f",830:"e49b226c07876df4",840:"a9c535f8868cc4bd",862:"fe3b86ecfb9c0716",893:"c469257bbbbca4f5",966:"57e4cd93c2368d34",968:"237f19aca13543fe",1078:"02294b2934d5bf21",1142:"8248bfb76c695146",1161:"06b33878b495da50",1184:"e80a999422621ed9",1188:"1d4ce94ddc297119",1198:"2a5c215f01a8b74d",1215:"88ed89521e915107",1219:"e27b0bd10b029e40",1247:"64e212daa5bb3925",1248:"36af3903f037c1f5",1274:"ce6906b1fe2e04b8",1280:"1651bb5167170457",1290:"869cef5f741d40c2",1335:"716cc5924662708e",1365:"d7391145ca7f8791",1379:"03e1e0f31bdaa2cc",1410:"77acea37535dbbef",1413:"117c5958c59cc695",1453:"3c24c777a3deca2d",1456:"217c3832b3e76b7f",1501:"549af2c91a889a08",1534:"918a25b2e3daab22",1556:"96abc9ff91b0c383",1583:"03a06dbdde85ac56",1595:"ee61519fde230f60",1630:"2911e2bac119d910",1642:"8c00543baa1aef54",1656:"a9efc78185a5a85f",1664:"6d5b5e3112b66906",1898:"e07b2b1c5e789b06",1932:"b0aea9b52cabe5e8",1977:"a06c8e8d2198f765",2013:"598558c40e51e107",2031:"3877441c49bff5cd",2041:"00f4fa0ab26c6ba5",2059:"d6f49d697b624f2b",2062:"4a0ab3400fea0e34",2107:"c627112b02b9e1c8",2130:"441ae0f68863efeb",2160:"e38d781fd5c4cde0",2179:"1bf5fe315e6e132c",2215:"9d2d6fbe90ffcc80",2278:"0b14de1cb2041bfd",2349:"ca15d465c4260b4b",2374:"7560cc5c4b8ed6b0",2397:"0e4dce0a557ac7cf",2403:"3dda71b6482dce3b",2485:"3188870375e9fbee",2489:"fcc70bd67329a70e",2501:"4e65b56602faa956",2503:"bb9d3528c3c7ccae",2504:"159b28843e61aae9",2577:"f52cffdd449a2d14",2614:"8349e4b407470a30",2710:"fe0656d4ebae4d30",2728:"5fed9ac13dfcd1d1",2735:"5a3e65a580bd5af9",2747:"1d85d388314f2904",2765:"2c6d9772af50feed",2783:"e8bbf2c794ef9750",2812:"dcd8179a6b1d76c9",2824:"461404167557f2cd",2839:"c9a657d5b4031a19",2895:"0339e755e79ee794",2937:"7e724516d5e6ce42",2954:"7d8daeae6410d4a4",2957:"2dd93db1a16e96b0",2964:"1a0e15f7327680a2",2973:"33f26573894b6153",3026:"3af53b279375f082",3072:"b6da96c10080c967",3074:"911584369786c26c",3077:"bf82c0c332cc9fec",3082:"159e4ab8f0572597",3095:"8cd478c42cee505a",3111:"1cf85db2faeb20cc",3175:"538ce7aec634bddb",3186:"3665756f8aae3eb7",3194:"5a331fb5e3dc34e9",3229:"5e91f7d0b135266b",3274:"858f7f9216c8b074",3286:"196c508356bb0b66",3288:"f23c8a5183e6b910",3290:"b5ba2646ad49c9fd",3304:"16305e84f4ff6598",3313:"471138e5504646a9",3324:"85e21e3313d0901c",3392:"460f5a753531f501",3419:"78b520dab7e2f96d",3437:"0ad1ecc8c5b8a679",3476:"246c30b47bded3b7",3483:"fc2a0b1185dbaa5d",3492:"ca55498822ad7796",3497:"4bfc60a3b3dea717",3526:"24826331ab265b39",3606:"e5c833cdda239583",3633:"2526b2d018636ff0",3782:"8d7b66d0e37dbe76",3787:"78ebe68a043f50ce",3860:"be5b243bf7d6618c",3873:"72a9a21509f713f7",3879:"f50abf4e93e943ea",3888:"abc48b70a10fc2d6",3942:"085da8d58242eeab",3979:"cea8623f6e9f83ea",4053:"90d71fcbe4ffd852",4080:"08a21dae9e93c547",4163:"c6ebefdd9aa5c358",4174:"b6ff75dd91a2a32e",4223:"c10556cd92fc8018",4242:"3a66c58375424a5b",4275:"8f2e531757c2a813",4295:"6c0f4838b0c9c69d",4309:"a887a10e84c44f9e",4350:"b9d80827e8eee01a",4357:"ac4f251cdac34fbe",4358:"f89b14cf7a988731",4370:"ac13b62c811f7ede",4417:"0b5ee948c3518db3",4447:"fe6f304888d5ac71",4474:"053807fa34066566",4539:"559c223da16b0282",4540:"03df20c499bca840",4553:"ce3eab65a260353e",4567:"7dc81a6e1c7df565",4583:"2a5df6eb3a6ea30b",4593:"676ac488744e1af5",4608:"1ff246d6b4c771f8",4634:"0332a56fdb8e26c0",4650:"61aec912b756287b",4659:"0b14de1cb2041bfd",4678:"867dfae26694be02",4763:"d0d1b1777a45e0b2",4801:"17596dbc1818c262",4814:"ccb85c56e9216a38",4823:"907850963b2bcb70",4829:"402ec60139d36417",4846:"c563765de65a34c7",4900:"b723a916eafdf743",4903:"004f583a12223dac",4963:"0f6678151a159143",4969:"1cb10af9489ea295",4976:"8870319ffbd1c31f",5005:"73745d7fcae6989e",5025:"b597364f0cf8b85a",5061:"025d30c3123eeaf6",5136:"ac897c2a56ee392f",5183:"2e5c895a2be76262",5269:"2e771096652dc113",5320:"00f00028b9163a43",5326:"def6842b53fecd26",5331:"4d5d42e5253dbee2",5347:"3192e0021174aaa8",5375:"ebc026e6140b52f1",5424:"4d62f7ee887cd8b9",5482:"0907421e6bf5eeec",5491:"5cc285c4b84dac30",5498:"117ef4b6035a90c5",5516:"4a07c872b5c3a663",5518:"6c3dc9afe81a566b",5520:"eab85d7487e77510",5553:"75df19e3cc1246d6",5575:"3d90c643343a1329",5645:"0b86853ae26d9ee3",5670:"2a1b27a6fdb7aa6b",5690:"d30877807cf5c7eb",5712:"574fca2d5f06483a",5728:"8ef773d61765855e",5750:"aa57d25b74640d23",5755:"00015c284ed6fb39",5920:"9db223329ee9e11a",5922:"ce56021f8cc6ebbc",5937:"0827b5b3eb831ff0",5968:"63d5869783fad06f",5997:"226c07d9e6c496e0",6046:"00d36aea7fd5b147",6079:"c6481b47ee815ba0",6089:"2dd351186ec85cc3",6099:"43e6595fcf24fc33",6110:"5ce3f75fced27aaf",6144:"f967a8228bcdf663",6155:"19719cff570d6559",6166:"ecd82a9dcb484b97",6290:"e14cf4fc52dd4539",6293:"5914fa73a9f7e777",6311:"5b9c1f74df9a8f67",6331:"758f2f66b92cada9",6339:"bc9301cc22898be0",6360:"ff0a9063773daeeb",6402:"a0070d7688ed986b",6412:"089ee787a294d10b",6455:"12b78a2660d609eb",6563:"5d618b608750f4dc",6572:"ca2463823b9b01a0",6580:"75d53830b434451f",6588:"0fbca957af7d9e6a",6647:"584c5d5cd8dfdb5a",6666:"a82467c542429379",6686:"796c782c33ab8ca9",6701:"bff0efb979f71a17",6704:"f280f0ad0f5d8644",6729:"77a5381ac8f5c9ae",6741:"06fdaf122961074e",6814:"30ff86a90cbfd921",6846:"91283f709c40802c",6859:"bacad166ee995fe0",6887:"6c81234d73740fb9",6927:"aa3914b5fb0d14d4",6931:"3c90e9fe0f7f1e66",6938:"0ccf683bd8aa8410",6948:"2719ed8731963209",6959:"5a803faf27f88e9f",7021:"b71240b1d5f6fbe4",7040:"0b14de1cb2041bfd",7041:"174bf29bd837f06d",7082:"fc816f91214026d7",7113:"39704408fef3d26e",7130:"8d24694735826c22",7142:"dbd2cf8141eece5e",7152:"c7b7f1f5e9622f21",7227:"a6b2f01487bb3d9d",7258:"6cbe24c3bcb63d1d",7425:"8b47c8e398a12dd8",7442:"097194be4a0e7d55",7455:"71d54397710b923c",7465:"867e8ff655666413",7524:"9528295a19a5837a",7525:"f433aaf1fe40c90a",7557:"bdc743175125b3d8",7610:"b1439345dbcf285d",7625:"ab66bd50d2fb61a4",7635:"166d83de1d29e758",7636:"bf91320a9ff695af",7785:"1402a4110c300764",7799:"40b047a634f96a24",7819:"3c56f48c0dc5ad5d",7844:"2bb29faa262f313e",7846:"c9705c044ab8f87a",7884:"390ae2efbbf230c4",7889:"af3e581842f34c28",7921:"c361f794cc208e06",7977:"80e4daa080a79c39",8113:"907baefc7227cfb8",8132:"74491162f08af899",8192:"5918d83ac6a0e2dc",8243:"1450514f8390977e",8257:"dd8f651f1a43fee2",8288:"9bd1d26060cb00a1",8318:"81c7ac586fcbb728",8359:"7eb3bb8f8ecf4c01",8406:"955ccfbb4b70b8c3",8430:"b1f802dcffa41626",8432:"bd66ac287c569996",8457:"b61d96d8d30215fc",8496:"046efd6301dd804f",8545:"be0c9eea6aae5971",8555:"ab3ee6358f1d64da",8656:"2ceb4e5ff5df2fca",8670:"90ede75068758e82",8704:"a1003918da6654da",8773:"614f1f4f0f845c5e",8835:"5c7821b201f35593",8845:"c9702695e8c5a9c5",8848:"7c6e47cca9f0059a",8921:"fb24a4d4d4d3265b",8947:"31d3d834d8281fd9",8977:"01b9c429327004e9",9005:"33cf91e617920d4f",9006:"11537833945ec4b8",9015:"c4e40321a6503a1b",9136:"191be42a2fee842c",9178:"48a90097ee3f0b0c",9186:"3af6fcd13ab752fa",9189:"3e9d29bf275ec462",9220:"bc767ebb5adb9f49",9224:"401f9320ee58570b",9240:"d38ddbe94e0bf128",9267:"fbfd65ea31e7448c",9294:"a20485f3282321b3",9302:"726b065f2df0323a",9312:"8121a74b2042bff3",9377:"f9db706e76f04afe",9382:"bc0e11ecc88dd62c",9421:"a5c1dbcfbfdd8f52",9441:"1081da1125d1764f",9448:"2668b3cd408e86de",9466:"c9d8f45d14235087",9521:"e1240eb862eb32dc",9547:"7729788fff21926f",9565:"8de0671f99d12abe",9569:"2f36b2b1c2f838d7",9605:"dfac539f89cea7a2",9615:"3b62c13af671f714",9648:"8235b6fea7087b3a",9666:"a515fa6d89a71f1c",9680:"d5ceac8967e0b6a8",9690:"7773c72f0eff6dec",9841:"422321143547591a",9842:"3b71b65b30d8ef2a",9996:"18b7bca2f0ab222e"})[e]+".js",l.miniCssF=e=>"static/css/659eccb5db697b76.css",l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),c={},l.l=(e,a,f,d)=>{if(c[e])return void c[e].push(a);if(void 0!==f)for(var b,t,r=document.getElementsByTagName("script"),o=0;o<r.length;o++){var n=r[o];if(n.getAttribute("src")==e||n.getAttribute("data-webpack")=="_N_E:"+f){b=n;break}}b||(t=!0,(b=document.createElement("script")).charset="utf-8",b.timeout=120,l.nc&&b.setAttribute("nonce",l.nc),b.setAttribute("data-webpack","_N_E:"+f),b.src=l.tu(e)),c[e]=[a];var i=(a,f)=>{b.onerror=b.onload=null,clearTimeout(s);var d=c[e];if(delete c[e],b.parentNode&&b.parentNode.removeChild(b),d&&d.forEach(e=>e(f)),a)return a(f)},s=setTimeout(i.bind(null,void 0,{type:"timeout",target:b}),12e4);b.onerror=i.bind(null,b.onerror),b.onload=i.bind(null,b.onload),t&&document.head.appendChild(b)},l.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.tt=()=>(void 0===d&&(d={createScriptURL:e=>e},"u">typeof trustedTypes&&trustedTypes.createPolicy&&(d=trustedTypes.createPolicy("nextjs#bundler",d))),d),l.tu=e=>l.tt().createScriptURL(e),l.p="/_next/",b={8068:0},l.f.miniCss=(e,a)=>{if(b[e])a.push(b[e]);else 0!==b[e]&&({1838:1})[e]&&a.push(b[e]=new Promise((a,f)=>{var c=l.miniCssF(e),d=l.p+c;if(((e,a)=>{for(var f=document.getElementsByTagName("link"),c=0;c<f.length;c++){var d=f[c],b=d.getAttribute("data-href")||d.getAttribute("href");if("stylesheet"===d.rel&&(b===e||b===a))return d}for(var t=document.getElementsByTagName("style"),c=0;c<t.length;c++){var d=t[c],b=d.getAttribute("data-href");if(b===e||b===a)return d}})(c,d))return a();((e,a,f,c)=>{var d=document.createElement("link");d.rel="stylesheet",d.type="text/css",d.onerror=d.onload=b=>{if(d.onerror=d.onload=null,"load"===b.type)f();else{var t=b&&("load"===b.type?"missing":b.type),r=b&&b.target&&b.target.href||a,o=Error("Loading CSS chunk "+e+" failed.\n("+r+")");o.code="CSS_CHUNK_LOAD_FAILED",o.type=t,o.request=r,d.parentNode.removeChild(d),c(o)}},d.href=a;if("function"==typeof _N_E_STYLE_LOAD){var b=d.href,t=d.onload,r=d.onerror;_N_E_STYLE_LOAD(0===b.indexOf(window.location.origin)?new URL(b).pathname:b).then(function(){t&&t.call(d,{type:"load"})},function(){r&&r.call(d,{})})}else document.head.appendChild(d)})(e,d,a,f)}).then(()=>{b[e]=0},a=>{throw delete b[e],a}))},t={8068:0,7513:0},l.f.j=(e,a)=>{var f=l.o(t,e)?t[e]:void 0;if(0!==f)if(f)a.push(f[2]);else if(/^(1838|7513|8068)$/.test(e))t[e]=0;else{var c=new Promise((a,c)=>f=t[e]=[a,c]);a.push(f[2]=c);var d=l.p+l.u(e),b=Error();l.l(d,a=>{if(l.o(t,e)&&(0!==(f=t[e])&&(t[e]=void 0),f)){var c=a&&("load"===a.type?"missing":a.type),d=a&&a.target&&a.target.src;b.message="Loading chunk "+e+" failed.\n("+c+": "+d+")",b.name="ChunkLoadError",b.type=c,b.request=d,f[1](b)}},"chunk-"+e,e)}},l.O.j=e=>0===t[e],r=(e,a)=>{var f,c,[d,b,r]=a,o=0;if(d.some(e=>0!==t[e])){for(f in b)l.o(b,f)&&(l.m[f]=b[f]);if(r)var n=r(l)}for(e&&e(a);o<d.length;o++)c=d[o],l.o(t,c)&&t[c]&&t[c][0](),t[c]=0;return l.O(n)},(o=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o)),l.nc=void 0})();
1
+ (()=>{"use strict";var e,a,f,c,d,b,t,r,o,n={},i={};function l(e){var a=i[e];if(void 0!==a)return a.exports;var f=i[e]={exports:{}},c=!0;try{n[e].call(f.exports,f,f.exports,l),c=!1}finally{c&&delete i[e]}return f.exports}l.m=n,e=[],l.O=(a,f,c,d)=>{if(f){d=d||0;for(var b=e.length;b>0&&e[b-1][2]>d;b--)e[b]=e[b-1];e[b]=[f,c,d];return}for(var t=1/0,b=0;b<e.length;b++){for(var[f,c,d]=e[b],r=!0,o=0;o<f.length;o++)(!1&d||t>=d)&&Object.keys(l.O).every(e=>l.O[e](f[o]))?f.splice(o--,1):(r=!1,d<t&&(t=d));if(r){e.splice(b--,1);var n=c();void 0!==n&&(a=n)}}return a},l.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return l.d(a,{a:a}),a},f=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,l.t=function(e,c){if(1&c&&(e=this(e)),8&c||"object"==typeof e&&e&&(4&c&&e.__esModule||16&c&&"function"==typeof e.then))return e;var d=Object.create(null);l.r(d);var b={};a=a||[null,f({}),f([]),f(f)];for(var t=2&c&&e;"object"==typeof t&&!~a.indexOf(t);t=f(t))Object.getOwnPropertyNames(t).forEach(a=>b[a]=()=>e[a]);return b.default=()=>e,l.d(d,b),d},l.d=(e,a)=>{for(var f in a)l.o(a,f)&&!l.o(e,f)&&Object.defineProperty(e,f,{enumerable:!0,get:a[f]})},l.f={},l.e=e=>Promise.all(Object.keys(l.f).reduce((a,f)=>(l.f[f](e,a),a),[])),l.u=e=>4986===e?"static/chunks/4986-c2fc8845ce785303.js":"static/chunks/"+(({535:"4ca0cff5",1290:"cee15710",1630:"53c1bd3f",2577:"d1c28714",3879:"cfdf2ac7",3888:"e868780c",4763:"4402d2ac",4814:"799ebd4e",6079:"363642f4",6666:"570e4624",6814:"7d29de82",7442:"92e53eb0",8835:"ce16f5a9",9312:"1cd6e1d3"})[e]||e)+"."+({10:"6cf001c181ce1098",34:"ce581867cf95e24b",36:"b4a553bf2106f6d3",194:"76dbdc07cdc2311d",214:"f6bba63dfa159e01",252:"a9e22657cbf67b42",315:"6f68ae79b67d25cf",327:"8ecab0b86d52b597",376:"9e742ff6919b2b54",392:"3cad93691f1b7360",400:"59979e0d3ae126e4",425:"9a3434a28926566a",535:"07efe2bc8f09d72e",541:"cfa15b606745131a",579:"33fc87fb95163c6a",583:"b3efc73cb21097e2",624:"2dd909fbfce98c5e",640:"5bf1e25d0bddf875",698:"e0dda03fd303b96b",794:"06b1ae4fc9cc10a9",816:"f909c891b91aa79f",830:"e49b226c07876df4",840:"a9c535f8868cc4bd",862:"fe3b86ecfb9c0716",893:"c469257bbbbca4f5",966:"57e4cd93c2368d34",968:"237f19aca13543fe",1078:"02294b2934d5bf21",1142:"8248bfb76c695146",1161:"06b33878b495da50",1184:"e80a999422621ed9",1188:"1d4ce94ddc297119",1198:"2a5c215f01a8b74d",1215:"88ed89521e915107",1219:"e27b0bd10b029e40",1247:"64e212daa5bb3925",1248:"36af3903f037c1f5",1274:"ce6906b1fe2e04b8",1280:"1651bb5167170457",1290:"869cef5f741d40c2",1335:"716cc5924662708e",1365:"d7391145ca7f8791",1379:"03e1e0f31bdaa2cc",1410:"77acea37535dbbef",1413:"117c5958c59cc695",1453:"3c24c777a3deca2d",1456:"217c3832b3e76b7f",1501:"549af2c91a889a08",1534:"918a25b2e3daab22",1556:"96abc9ff91b0c383",1583:"03a06dbdde85ac56",1595:"ee61519fde230f60",1630:"2911e2bac119d910",1642:"8c00543baa1aef54",1656:"a9efc78185a5a85f",1664:"6d5b5e3112b66906",1898:"e07b2b1c5e789b06",1932:"b0aea9b52cabe5e8",1977:"a06c8e8d2198f765",2013:"598558c40e51e107",2031:"3877441c49bff5cd",2041:"00f4fa0ab26c6ba5",2059:"d6f49d697b624f2b",2062:"4a0ab3400fea0e34",2107:"c627112b02b9e1c8",2130:"441ae0f68863efeb",2160:"e38d781fd5c4cde0",2179:"1bf5fe315e6e132c",2215:"9d2d6fbe90ffcc80",2278:"0b14de1cb2041bfd",2349:"ca15d465c4260b4b",2374:"7560cc5c4b8ed6b0",2397:"0e4dce0a557ac7cf",2403:"3dda71b6482dce3b",2485:"3188870375e9fbee",2489:"fcc70bd67329a70e",2501:"4e65b56602faa956",2503:"bb9d3528c3c7ccae",2504:"159b28843e61aae9",2577:"f52cffdd449a2d14",2614:"8349e4b407470a30",2710:"fe0656d4ebae4d30",2728:"5fed9ac13dfcd1d1",2735:"5a3e65a580bd5af9",2747:"1d85d388314f2904",2765:"2c6d9772af50feed",2783:"e8bbf2c794ef9750",2812:"dcd8179a6b1d76c9",2824:"461404167557f2cd",2839:"c9a657d5b4031a19",2895:"0339e755e79ee794",2937:"7e724516d5e6ce42",2954:"7d8daeae6410d4a4",2957:"2dd93db1a16e96b0",2964:"1a0e15f7327680a2",2973:"33f26573894b6153",3026:"3af53b279375f082",3072:"b6da96c10080c967",3074:"911584369786c26c",3077:"bf82c0c332cc9fec",3082:"159e4ab8f0572597",3095:"8cd478c42cee505a",3111:"1cf85db2faeb20cc",3175:"538ce7aec634bddb",3186:"3665756f8aae3eb7",3194:"5a331fb5e3dc34e9",3229:"5e91f7d0b135266b",3274:"858f7f9216c8b074",3286:"196c508356bb0b66",3288:"f23c8a5183e6b910",3290:"b5ba2646ad49c9fd",3304:"16305e84f4ff6598",3313:"471138e5504646a9",3324:"85e21e3313d0901c",3392:"460f5a753531f501",3419:"78b520dab7e2f96d",3437:"0ad1ecc8c5b8a679",3476:"246c30b47bded3b7",3483:"fc2a0b1185dbaa5d",3492:"ca55498822ad7796",3497:"4bfc60a3b3dea717",3526:"24826331ab265b39",3606:"e5c833cdda239583",3633:"2526b2d018636ff0",3782:"8d7b66d0e37dbe76",3787:"78ebe68a043f50ce",3860:"be5b243bf7d6618c",3873:"72a9a21509f713f7",3879:"f50abf4e93e943ea",3888:"abc48b70a10fc2d6",3942:"085da8d58242eeab",3979:"cea8623f6e9f83ea",4053:"90d71fcbe4ffd852",4080:"08a21dae9e93c547",4163:"c6ebefdd9aa5c358",4174:"b6ff75dd91a2a32e",4223:"c10556cd92fc8018",4242:"3a66c58375424a5b",4275:"8f2e531757c2a813",4295:"6c0f4838b0c9c69d",4309:"a887a10e84c44f9e",4350:"b9d80827e8eee01a",4357:"ac4f251cdac34fbe",4358:"f89b14cf7a988731",4370:"ac13b62c811f7ede",4417:"0b5ee948c3518db3",4447:"fe6f304888d5ac71",4474:"053807fa34066566",4539:"559c223da16b0282",4540:"03df20c499bca840",4553:"ce3eab65a260353e",4567:"7dc81a6e1c7df565",4583:"2a5df6eb3a6ea30b",4593:"676ac488744e1af5",4608:"1ff246d6b4c771f8",4634:"0332a56fdb8e26c0",4650:"61aec912b756287b",4659:"0b14de1cb2041bfd",4678:"867dfae26694be02",4763:"d0d1b1777a45e0b2",4801:"17596dbc1818c262",4814:"ccb85c56e9216a38",4823:"907850963b2bcb70",4829:"402ec60139d36417",4846:"c563765de65a34c7",4900:"b723a916eafdf743",4903:"004f583a12223dac",4963:"0f6678151a159143",4969:"1cb10af9489ea295",4976:"8870319ffbd1c31f",5005:"73745d7fcae6989e",5025:"b597364f0cf8b85a",5061:"025d30c3123eeaf6",5136:"ac897c2a56ee392f",5183:"2e5c895a2be76262",5269:"2e771096652dc113",5320:"00f00028b9163a43",5326:"def6842b53fecd26",5331:"4d5d42e5253dbee2",5347:"3192e0021174aaa8",5375:"ebc026e6140b52f1",5424:"4d62f7ee887cd8b9",5482:"0907421e6bf5eeec",5491:"5cc285c4b84dac30",5498:"117ef4b6035a90c5",5516:"4a07c872b5c3a663",5518:"6c3dc9afe81a566b",5520:"eab85d7487e77510",5553:"75df19e3cc1246d6",5575:"3d90c643343a1329",5645:"0b86853ae26d9ee3",5670:"2a1b27a6fdb7aa6b",5690:"d30877807cf5c7eb",5712:"574fca2d5f06483a",5728:"8ef773d61765855e",5750:"aa57d25b74640d23",5755:"00015c284ed6fb39",5920:"9db223329ee9e11a",5922:"ce56021f8cc6ebbc",5937:"0827b5b3eb831ff0",5968:"63d5869783fad06f",5997:"226c07d9e6c496e0",6046:"00d36aea7fd5b147",6079:"c6481b47ee815ba0",6089:"2dd351186ec85cc3",6099:"43e6595fcf24fc33",6110:"5ce3f75fced27aaf",6144:"f967a8228bcdf663",6155:"19719cff570d6559",6166:"ecd82a9dcb484b97",6290:"e14cf4fc52dd4539",6293:"5914fa73a9f7e777",6311:"5b9c1f74df9a8f67",6331:"758f2f66b92cada9",6339:"bc9301cc22898be0",6360:"ff0a9063773daeeb",6402:"a0070d7688ed986b",6412:"089ee787a294d10b",6455:"12b78a2660d609eb",6563:"5d618b608750f4dc",6572:"ca2463823b9b01a0",6580:"75d53830b434451f",6588:"0fbca957af7d9e6a",6647:"584c5d5cd8dfdb5a",6666:"a82467c542429379",6686:"796c782c33ab8ca9",6701:"bff0efb979f71a17",6704:"f280f0ad0f5d8644",6729:"77a5381ac8f5c9ae",6741:"06fdaf122961074e",6814:"30ff86a90cbfd921",6846:"91283f709c40802c",6859:"bacad166ee995fe0",6887:"6c81234d73740fb9",6927:"aa3914b5fb0d14d4",6931:"3c90e9fe0f7f1e66",6938:"0ccf683bd8aa8410",6948:"2719ed8731963209",6959:"5a803faf27f88e9f",7021:"b71240b1d5f6fbe4",7040:"0b14de1cb2041bfd",7041:"174bf29bd837f06d",7082:"fc816f91214026d7",7113:"39704408fef3d26e",7130:"8d24694735826c22",7142:"dbd2cf8141eece5e",7152:"c7b7f1f5e9622f21",7227:"a6b2f01487bb3d9d",7258:"6cbe24c3bcb63d1d",7425:"8b47c8e398a12dd8",7442:"097194be4a0e7d55",7455:"71d54397710b923c",7465:"867e8ff655666413",7524:"9528295a19a5837a",7525:"f433aaf1fe40c90a",7557:"bdc743175125b3d8",7610:"b1439345dbcf285d",7625:"ab66bd50d2fb61a4",7635:"166d83de1d29e758",7636:"bf91320a9ff695af",7785:"1402a4110c300764",7799:"40b047a634f96a24",7819:"3c56f48c0dc5ad5d",7844:"2bb29faa262f313e",7846:"c9705c044ab8f87a",7884:"390ae2efbbf230c4",7889:"af3e581842f34c28",7921:"c361f794cc208e06",7977:"80e4daa080a79c39",8113:"907baefc7227cfb8",8132:"74491162f08af899",8192:"5918d83ac6a0e2dc",8243:"1450514f8390977e",8257:"dd8f651f1a43fee2",8288:"9bd1d26060cb00a1",8318:"81c7ac586fcbb728",8359:"65b24fac92188a6b",8406:"955ccfbb4b70b8c3",8430:"b1f802dcffa41626",8432:"bd66ac287c569996",8457:"b61d96d8d30215fc",8496:"046efd6301dd804f",8545:"be0c9eea6aae5971",8555:"ab3ee6358f1d64da",8656:"2ceb4e5ff5df2fca",8670:"90ede75068758e82",8704:"a1003918da6654da",8773:"614f1f4f0f845c5e",8835:"5c7821b201f35593",8845:"c9702695e8c5a9c5",8848:"7c6e47cca9f0059a",8921:"fb24a4d4d4d3265b",8947:"31d3d834d8281fd9",8977:"01b9c429327004e9",9005:"33cf91e617920d4f",9006:"11537833945ec4b8",9015:"c4e40321a6503a1b",9136:"191be42a2fee842c",9178:"48a90097ee3f0b0c",9186:"3af6fcd13ab752fa",9189:"3e9d29bf275ec462",9220:"bc767ebb5adb9f49",9224:"401f9320ee58570b",9240:"d38ddbe94e0bf128",9267:"fbfd65ea31e7448c",9294:"a20485f3282321b3",9302:"726b065f2df0323a",9312:"8121a74b2042bff3",9377:"f9db706e76f04afe",9382:"bc0e11ecc88dd62c",9421:"a5c1dbcfbfdd8f52",9441:"ff70bb53f6835771",9448:"2668b3cd408e86de",9466:"c9d8f45d14235087",9521:"e1240eb862eb32dc",9547:"7729788fff21926f",9565:"8de0671f99d12abe",9569:"2f36b2b1c2f838d7",9605:"dfac539f89cea7a2",9615:"3b62c13af671f714",9648:"8235b6fea7087b3a",9666:"a515fa6d89a71f1c",9680:"d5ceac8967e0b6a8",9690:"7773c72f0eff6dec",9841:"422321143547591a",9842:"3b71b65b30d8ef2a",9996:"18b7bca2f0ab222e"})[e]+".js",l.miniCssF=e=>"static/css/659eccb5db697b76.css",l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),c={},l.l=(e,a,f,d)=>{if(c[e])return void c[e].push(a);if(void 0!==f)for(var b,t,r=document.getElementsByTagName("script"),o=0;o<r.length;o++){var n=r[o];if(n.getAttribute("src")==e||n.getAttribute("data-webpack")=="_N_E:"+f){b=n;break}}b||(t=!0,(b=document.createElement("script")).charset="utf-8",b.timeout=120,l.nc&&b.setAttribute("nonce",l.nc),b.setAttribute("data-webpack","_N_E:"+f),b.src=l.tu(e)),c[e]=[a];var i=(a,f)=>{b.onerror=b.onload=null,clearTimeout(s);var d=c[e];if(delete c[e],b.parentNode&&b.parentNode.removeChild(b),d&&d.forEach(e=>e(f)),a)return a(f)},s=setTimeout(i.bind(null,void 0,{type:"timeout",target:b}),12e4);b.onerror=i.bind(null,b.onerror),b.onload=i.bind(null,b.onload),t&&document.head.appendChild(b)},l.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.tt=()=>(void 0===d&&(d={createScriptURL:e=>e},"u">typeof trustedTypes&&trustedTypes.createPolicy&&(d=trustedTypes.createPolicy("nextjs#bundler",d))),d),l.tu=e=>l.tt().createScriptURL(e),l.p="/_next/",b={8068:0},l.f.miniCss=(e,a)=>{if(b[e])a.push(b[e]);else 0!==b[e]&&({1838:1})[e]&&a.push(b[e]=new Promise((a,f)=>{var c=l.miniCssF(e),d=l.p+c;if(((e,a)=>{for(var f=document.getElementsByTagName("link"),c=0;c<f.length;c++){var d=f[c],b=d.getAttribute("data-href")||d.getAttribute("href");if("stylesheet"===d.rel&&(b===e||b===a))return d}for(var t=document.getElementsByTagName("style"),c=0;c<t.length;c++){var d=t[c],b=d.getAttribute("data-href");if(b===e||b===a)return d}})(c,d))return a();((e,a,f,c)=>{var d=document.createElement("link");d.rel="stylesheet",d.type="text/css",d.onerror=d.onload=b=>{if(d.onerror=d.onload=null,"load"===b.type)f();else{var t=b&&("load"===b.type?"missing":b.type),r=b&&b.target&&b.target.href||a,o=Error("Loading CSS chunk "+e+" failed.\n("+r+")");o.code="CSS_CHUNK_LOAD_FAILED",o.type=t,o.request=r,d.parentNode.removeChild(d),c(o)}},d.href=a;if("function"==typeof _N_E_STYLE_LOAD){var b=d.href,t=d.onload,r=d.onerror;_N_E_STYLE_LOAD(0===b.indexOf(window.location.origin)?new URL(b).pathname:b).then(function(){t&&t.call(d,{type:"load"})},function(){r&&r.call(d,{})})}else document.head.appendChild(d)})(e,d,a,f)}).then(()=>{b[e]=0},a=>{throw delete b[e],a}))},t={8068:0,7513:0},l.f.j=(e,a)=>{var f=l.o(t,e)?t[e]:void 0;if(0!==f)if(f)a.push(f[2]);else if(/^(1838|7513|8068)$/.test(e))t[e]=0;else{var c=new Promise((a,c)=>f=t[e]=[a,c]);a.push(f[2]=c);var d=l.p+l.u(e),b=Error();l.l(d,a=>{if(l.o(t,e)&&(0!==(f=t[e])&&(t[e]=void 0),f)){var c=a&&("load"===a.type?"missing":a.type),d=a&&a.target&&a.target.src;b.message="Loading chunk "+e+" failed.\n("+c+": "+d+")",b.name="ChunkLoadError",b.type=c,b.request=d,f[1](b)}},"chunk-"+e,e)}},l.O.j=e=>0===t[e],r=(e,a)=>{var f,c,[d,b,r]=a,o=0;if(d.some(e=>0!==t[e])){for(f in b)l.o(b,f)&&(l.m[f]=b[f]);if(r)var n=r(l)}for(e&&e(a);o<d.length;o++)c=d[o],l.o(t,c)&&t[c]&&t[c][0](),t[c]=0;return l.O(n)},(o=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o)),l.nc=void 0})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gsd-pi",
3
- "version": "2.82.0-dev.3a3c6509d",
3
+ "version": "2.82.0-dev.57fd453e4",
4
4
  "description": "GSD — Get Shit Done coding agent",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,3 +1,5 @@
1
+ // Project/App: GSD-2
2
+ // File Purpose: Main auto-mode execution loop.
1
3
  /**
2
4
  * auto/loop.ts — Main auto-mode execution loop.
3
5
  *
@@ -945,11 +947,18 @@ export async function autoLoop(
945
947
  unitId: iterData.unitId,
946
948
  });
947
949
  const finalizeReason = finalizeResult.action === "break" ? finalizeResult.reason : undefined;
950
+ const finalizeStatus = finalizeReason === "step-wizard"
951
+ ? "completed"
952
+ : finalizeResult.action === "next"
953
+ ? "completed"
954
+ : finalizeResult.action === "continue"
955
+ ? "retry"
956
+ : "stopped";
948
957
  journalReporter.emit("post-unit-finalize-end", {
949
958
  iteration,
950
959
  unitType: iterData.unitType,
951
960
  unitId: iterData.unitId,
952
- status: finalizeResult.action === "next" ? "completed" : finalizeResult.action === "continue" ? "retry" : "stopped",
961
+ status: finalizeStatus,
953
962
  action: finalizeResult.action,
954
963
  ...(finalizeReason ? { reason: finalizeReason } : {}),
955
964
  });
@@ -996,6 +1005,10 @@ export async function autoLoop(
996
1005
  }) || dispatchSettled;
997
1006
  completeIteration();
998
1007
  finishTurn("completed");
1008
+ if (finalizeDecision.action === "complete-and-break") {
1009
+ s.preserveStepSurfaceAfterLoopExit = true;
1010
+ break;
1011
+ }
999
1012
  } catch (loopErr) {
1000
1013
  // ── Blanket catch: absorb unexpected exceptions, apply graduated recovery ──
1001
1014
  const msg = loopErr instanceof Error ? loopErr.message : String(loopErr);
@@ -1,3 +1,5 @@
1
+ // Project/App: GSD-2
2
+ // File Purpose: Mutable auto-mode session state container.
1
3
  /**
2
4
  * AutoSession — encapsulates all mutable auto-mode state into a single instance.
3
5
  *
@@ -89,6 +91,7 @@ export class AutoSession {
89
91
  active = false;
90
92
  paused = false;
91
93
  completionStopInProgress = false;
94
+ preserveStepSurfaceAfterLoopExit = false;
92
95
  stepMode = false;
93
96
  verbose = false;
94
97
  activeEngineId: string | null = null;
@@ -289,6 +292,7 @@ export class AutoSession {
289
292
  this.active = false;
290
293
  this.paused = false;
291
294
  this.completionStopInProgress = false;
295
+ this.preserveStepSurfaceAfterLoopExit = false;
292
296
  this.stepMode = false;
293
297
  this.verbose = false;
294
298
  this.activeEngineId = null;
@@ -48,7 +48,8 @@ export type FinalizeDecision =
48
48
  action: "retry";
49
49
  ledgerErrorSummary: "finalize-retry";
50
50
  }
51
- | { action: "complete" };
51
+ | { action: "complete" }
52
+ | { action: "complete-and-break" };
52
53
 
53
54
  export type EngineReconcileInput =
54
55
  | { outcome: "milestone-complete" }
@@ -278,6 +279,9 @@ export function decideEngineDispatch(input: EngineDispatchInput): EngineDispatch
278
279
  export function decideFinalizeResult(input: FinalizeInput): FinalizeDecision {
279
280
  if (input.action === "break") {
280
281
  const reason = input.reason ?? "unknown";
282
+ if (reason === "step-wizard") {
283
+ return { action: "complete-and-break" };
284
+ }
281
285
  return {
282
286
  action: "stop",
283
287
  failureClass: reason === "git-closeout-failure" ? "git" : "closeout",
@@ -47,7 +47,7 @@ import { regenerateIfMissing } from "./workflow-projections.js";
47
47
  import { WorktreeStateProjection } from "./worktree-state-projection.js";
48
48
  import { createWorkspace, scopeMilestone } from "./workspace.js";
49
49
  import { normalizeWorktreePathForCompare } from "./worktree-root.js";
50
- import { isDbAvailable, getTask, getSlice, getMilestone, updateTaskStatus, _getAdapter, getVerificationEvidence } from "./gsd-db.js";
50
+ import { isDbAvailable, getDbPath, refreshOpenDatabaseFromDisk, getTask, getSlice, getMilestone, updateTaskStatus, _getAdapter, getVerificationEvidence } from "./gsd-db.js";
51
51
  import { renderPlanCheckboxes } from "./markdown-renderer.js";
52
52
  import { consumeSignal } from "./session-status-io.js";
53
53
  import {
@@ -371,7 +371,7 @@ export function detectRogueFileWrites(
371
371
  export const MAX_ARTIFACT_VERIFICATION_RETRIES = 3;
372
372
 
373
373
  export const STEP_COMPLETE_FALLBACK_MESSAGE =
374
- "Step complete. Run /clear, then /gsd to continue (or /gsd auto to run continuously).";
374
+ "Step complete. Run /clear if you want a clean view, then /gsd next to continue one step (or /gsd auto to run continuously).";
375
375
 
376
376
  export function buildStepCompleteMessage(nextState: import("./types.js").GSDState): string {
377
377
  if (nextState.phase === "complete") {
@@ -379,7 +379,7 @@ export function buildStepCompleteMessage(nextState: import("./types.js").GSDStat
379
379
  }
380
380
  const next = describeNextUnit(nextState);
381
381
  return `Step complete. Next: ${next.label}\n`
382
- + `Run /clear, then /gsd to continue (or /gsd auto to run continuously).`;
382
+ + `Run /clear if you want a clean view, then /gsd next to continue one step (or /gsd auto to run continuously).`;
383
383
  }
384
384
 
385
385
  /**
@@ -686,6 +686,14 @@ export async function postUnitPreVerification(pctx: PostUnitContext, opts?: PreV
686
686
  await new Promise(r => setTimeout(r, 100));
687
687
  }
688
688
 
689
+ const dbPath = getDbPath();
690
+ if (isDbAvailable() && dbPath && dbPath !== ":memory:") {
691
+ const refreshed = refreshOpenDatabaseFromDisk();
692
+ if (!refreshed) {
693
+ logWarning("db", "post-unit database refresh failed; derived state may be stale");
694
+ }
695
+ }
696
+
689
697
  // Turn-level git action (commit | snapshot | status-only)
690
698
  if (s.currentUnit) {
691
699
  const unit = s.currentUnit;
@@ -1731,8 +1739,8 @@ export async function postUnitPostVerification(pctx: PostUnitContext): Promise<"
1731
1739
  }
1732
1740
 
1733
1741
  // Step mode → show wizard instead of dispatch.
1734
- // Without this notify(), /gsd in step mode finishes a unit and silently
1735
- // exits the loop, leaving the user with no hint to /clear and /gsd again.
1742
+ // Without this notify(), /gsd next finishes a unit and silently exits the
1743
+ // loop, leaving the user with no next-step command.
1736
1744
  if (s.stepMode) {
1737
1745
  let phaseAfterUnit: string | null = null;
1738
1746
  try {
@@ -1029,6 +1029,8 @@ export async function rerootCommandSession(
1029
1029
  }
1030
1030
 
1031
1031
  export async function cleanupAfterLoopExit(ctx: ExtensionContext): Promise<void> {
1032
+ const preserveStepSurface = s.preserveStepSurfaceAfterLoopExit;
1033
+ const preservePausedSurface = s.paused;
1032
1034
  s.currentUnit = null;
1033
1035
  s.active = false;
1034
1036
  deactivateGSD();
@@ -1051,12 +1053,16 @@ export async function cleanupAfterLoopExit(ctx: ExtensionContext): Promise<void>
1051
1053
  // A transient provider-error pause intentionally leaves the paused badge
1052
1054
  // visible so the user still has a resumable auto-mode signal on screen.
1053
1055
  if (!s.paused) {
1054
- ctx.ui.setStatus("gsd-auto", undefined);
1055
- ctx.ui.setWidget("gsd-progress", undefined);
1056
- if (s.completionStopInProgress) {
1057
- s.completionStopInProgress = false;
1056
+ if (preserveStepSurface) {
1057
+ s.preserveStepSurfaceAfterLoopExit = false;
1058
+ } else {
1059
+ ctx.ui.setStatus("gsd-auto", undefined);
1060
+ ctx.ui.setWidget("gsd-progress", undefined);
1061
+ if (s.completionStopInProgress) {
1062
+ s.completionStopInProgress = false;
1063
+ }
1064
+ initHealthWidget(ctx);
1058
1065
  }
1059
- initHealthWidget(ctx);
1060
1066
  }
1061
1067
 
1062
1068
  // ADR-016 phase 3 (#5693): the stop-path basePath restore + chdir routes
@@ -1064,7 +1070,7 @@ export async function cleanupAfterLoopExit(ctx: ExtensionContext): Promise<void>
1064
1070
  // `s.basePath` mutation and the paired `process.chdir` for auto-loop
1065
1071
  // transitions. The verb assigns `s.basePath` before any throwable work, so
1066
1072
  // a thrown error still leaves basePath restored.
1067
- if (s.originalBasePath) {
1073
+ if (s.originalBasePath && !preserveStepSurface && !preservePausedSurface) {
1068
1074
  try {
1069
1075
  buildLifecycle().restoreToProjectRoot();
1070
1076
  } catch (err) {
@@ -1076,7 +1082,7 @@ export async function cleanupAfterLoopExit(ctx: ExtensionContext): Promise<void>
1076
1082
  }
1077
1083
  }
1078
1084
 
1079
- if (s.originalBasePath && s.cmdCtx) {
1085
+ if (s.originalBasePath && s.cmdCtx && !preserveStepSurface && !preservePausedSurface) {
1080
1086
  const result = await rerootCommandSession(s.cmdCtx, s.originalBasePath);
1081
1087
  if (result.status === "cancelled") {
1082
1088
  logWarning("engine", "post-loop session re-root was cancelled", { file: "auto.ts", basePath: s.originalBasePath });
@@ -32,7 +32,7 @@ import {
32
32
  resolveMilestoneFile,
33
33
  resolveSliceFile,
34
34
  resolveSlicePath,
35
- resolveTasksDir,
35
+ gsdProjectionRoot,
36
36
  gsdRoot,
37
37
  buildTaskFileName,
38
38
  buildSliceFileName,
@@ -48,7 +48,11 @@ import { clearPathCache } from "./paths.js";
48
48
  * E.g. "/project/.gsd/milestones/M001/M001-ROADMAP.md" → "milestones/M001/M001-ROADMAP.md"
49
49
  */
50
50
  function toArtifactPath(absPath: string, basePath: string): string {
51
- const root = gsdRoot(basePath);
51
+ const projectionRoot = gsdProjectionRoot(basePath);
52
+ const projectionRel = relative(projectionRoot, absPath);
53
+ const root = projectionRel && !projectionRel.startsWith("..") && !projectionRel.startsWith("/")
54
+ ? projectionRoot
55
+ : gsdRoot(basePath);
52
56
  const rel = relative(root, absPath);
53
57
  // Normalize to forward slashes for consistent DB keys
54
58
  return rel.replace(/\\/g, "/");
@@ -374,10 +378,9 @@ export async function renderPlanFromDb(
374
378
  throw new Error(`no tasks found for ${milestoneId}/${sliceId}`);
375
379
  }
376
380
 
377
- const slicePath = resolveSlicePath(basePath, milestoneId, sliceId)
378
- ?? join(gsdRoot(basePath), "milestones", milestoneId, "slices", sliceId);
379
- const absPath = resolveSliceFile(basePath, milestoneId, sliceId, "PLAN")
380
- ?? join(slicePath, `${sliceId}-PLAN.md`);
381
+ const slicePath = join(gsdProjectionRoot(basePath), "milestones", milestoneId, "slices", sliceId);
382
+ mkdirSync(slicePath, { recursive: true });
383
+ const absPath = join(slicePath, `${sliceId}-PLAN.md`);
381
384
  const artifactPath = toArtifactPath(absPath, basePath);
382
385
  const sliceGates = getGateResults(milestoneId, sliceId, "slice");
383
386
  const content = renderSlicePlanMarkdown(slice, tasks, sliceGates);
@@ -408,8 +411,7 @@ export async function renderTaskPlanFromDb(
408
411
  throw new Error(`task ${milestoneId}/${sliceId}/${taskId} not found`);
409
412
  }
410
413
 
411
- const tasksDir = resolveTasksDir(basePath, milestoneId, sliceId)
412
- ?? join(gsdRoot(basePath), "milestones", milestoneId, "slices", sliceId, "tasks");
414
+ const tasksDir = join(gsdProjectionRoot(basePath), "milestones", milestoneId, "slices", sliceId, "tasks");
413
415
  mkdirSync(tasksDir, { recursive: true });
414
416
  const absPath = join(tasksDir, buildTaskFileName(taskId, "PLAN"));
415
417
  const artifactPath = toArtifactPath(absPath, basePath);
@@ -357,6 +357,11 @@ export function resolveGsdPathContract(
357
357
  };
358
358
  }
359
359
 
360
+ export function gsdProjectionRoot(basePath: string): string {
361
+ const contract = resolveGsdPathContract(basePath);
362
+ return normalizeRealPath(contract.worktreeGsd ?? contract.projectGsd);
363
+ }
364
+
360
365
  /**
361
366
  * Invalidate the gsdRoot cache.
362
367
  * Use ONLY at session-reset boundaries: workspace switch, process exit, or
@@ -132,6 +132,7 @@
132
132
  Verify field rules:
133
133
  - MUST be a mechanically executable command: `npm test`, `grep -q "pattern" file`, `test -f path`
134
134
  - MUST NOT use shell pipes, redirects, semicolons, backticks, command substitution, or output trimming
135
+ - MUST NOT use inline `node -e` assertions for verification; put assertions in a real test file and run it with `node --test` or a package test script
135
136
  - For content/document tasks: verify file existence, section count, YAML validity, or word count
136
137
  NOT exact phrasing, specific formulas, or "zero TBD" aspirational criteria
137
138
  - If no command can verify the output, write: "Manual review — file exists and is non-empty"
@@ -57,6 +57,12 @@ skills_used:
57
57
  - {{howToVerifyThisTaskIsActuallyDone}}
58
58
  - {{commandToRun_OR_behaviorToCheck}}
59
59
 
60
+ ## Verify Rules
61
+
62
+ - Use a real executable check, not prose.
63
+ - If the check needs file-content assertions, write a `node:test` file and run it with `node --test` or a package test script.
64
+ - Do not use inline `node -e` assertions for verification.
65
+
60
66
  ## Observability Impact
61
67
 
62
68
  <!-- OMIT THIS SECTION ENTIRELY for simple tasks that don't touch runtime boundaries,
@@ -43,6 +43,52 @@ test("cleanupAfterLoopExit preserves paused auto badge after provider pause", as
43
43
  }
44
44
  });
45
45
 
46
+ test("cleanupAfterLoopExit preserves paused worktree session and visible failure output", async (t) => {
47
+ const base = mkdtempSync(join(tmpdir(), "gsd-paused-session-preserve-"));
48
+ const worktree = join(base, ".gsd", "worktrees", "M001");
49
+ const previousCwd = process.cwd();
50
+ const newSessionWorkspaces: string[] = [];
51
+ let restoreCalls = 0;
52
+
53
+ t.mock.method(WorktreeLifecycle.prototype, "restoreToProjectRoot", function () {
54
+ restoreCalls += 1;
55
+ });
56
+
57
+ mkdirSync(worktree, { recursive: true });
58
+ process.chdir(worktree);
59
+ autoSession.reset();
60
+ autoSession.active = true;
61
+ autoSession.paused = true;
62
+ autoSession.basePath = worktree;
63
+ autoSession.originalBasePath = base;
64
+ autoSession.cmdCtx = {
65
+ newSession: async ({ workspaceRoot }: { workspaceRoot: string }) => {
66
+ newSessionWorkspaces.push(workspaceRoot);
67
+ return { cancelled: false };
68
+ },
69
+ } as any;
70
+
71
+ try {
72
+ await cleanupAfterLoopExit({
73
+ ui: {
74
+ setStatus: () => {},
75
+ setWidget: () => {},
76
+ notify: () => {},
77
+ },
78
+ } as any);
79
+
80
+ assert.equal(restoreCalls, 0, "paused cleanup must not restore out of the active worktree");
81
+ assert.deepEqual(newSessionWorkspaces, [], "paused cleanup must not start a blank rerooted session");
82
+ assert.equal(autoSession.basePath, worktree);
83
+ assert.equal(realpathSync(process.cwd()), realpathSync(worktree));
84
+ assert.equal(autoSession.paused, true);
85
+ } finally {
86
+ autoSession.reset();
87
+ process.chdir(previousCwd);
88
+ rmSync(base, { recursive: true, force: true });
89
+ }
90
+ });
91
+
46
92
  test("cleanupAfterLoopExit clears status and progress widget without replacing outcome surface", async () => {
47
93
  const statusCalls: unknown[] = [];
48
94
  const widgetCalls: unknown[] = [];
@@ -145,6 +191,70 @@ test("pauseAuto preserves artifact retry counts across pause/resume", async () =
145
191
  }
146
192
  });
147
193
 
194
+ test("cleanupAfterLoopExit preserves step-mode surface and worktree session after completed step", async (t) => {
195
+ const base = mkdtempSync(join(tmpdir(), "gsd-step-surface-"));
196
+ const worktree = join(base, ".gsd", "worktrees", "M001");
197
+ const previousCwd = process.cwd();
198
+ const statusCalls: unknown[] = [];
199
+ const widgetCalls: unknown[] = [];
200
+ const newSessionWorkspaces: string[] = [];
201
+ let restoreCalls = 0;
202
+
203
+ t.mock.method(WorktreeLifecycle.prototype, "restoreToProjectRoot", function () {
204
+ restoreCalls += 1;
205
+ });
206
+
207
+ mkdirSync(worktree, { recursive: true });
208
+ process.chdir(worktree);
209
+ autoSession.reset();
210
+ autoSession.active = true;
211
+ autoSession.paused = false;
212
+ autoSession.stepMode = true;
213
+ autoSession.preserveStepSurfaceAfterLoopExit = true;
214
+ autoSession.basePath = worktree;
215
+ autoSession.originalBasePath = base;
216
+ autoSession.cmdCtx = {
217
+ newSession: async ({ workspaceRoot }: { workspaceRoot: string }) => {
218
+ newSessionWorkspaces.push(workspaceRoot);
219
+ return { cancelled: false };
220
+ },
221
+ } as any;
222
+
223
+ try {
224
+ await cleanupAfterLoopExit({
225
+ hasUI: true,
226
+ ui: {
227
+ setStatus: (...args: unknown[]) => statusCalls.push(args),
228
+ setWidget: (...args: unknown[]) => widgetCalls.push(args),
229
+ setHeader: () => {},
230
+ notify: () => {},
231
+ },
232
+ } as any);
233
+
234
+ assert.deepEqual(statusCalls, [], "step-mode cleanup must leave the NEXT badge visible");
235
+ assert.equal(
236
+ widgetCalls.some((args) => Array.isArray(args) && args[0] === "gsd-progress" && args[1] === undefined),
237
+ false,
238
+ "step-mode cleanup must not clear the completed step progress surface",
239
+ );
240
+ assert.equal(
241
+ widgetCalls.some((args) => Array.isArray(args) && args[0] === "gsd-health"),
242
+ false,
243
+ "step-mode cleanup must not replace the progress surface with idle health",
244
+ );
245
+ assert.deepEqual(newSessionWorkspaces, [], "step-mode cleanup must not re-root the visible command session");
246
+ assert.equal(restoreCalls, 0, "step-mode cleanup must not restore out of the active worktree");
247
+ assert.equal(autoSession.active, false);
248
+ assert.equal(autoSession.preserveStepSurfaceAfterLoopExit, false);
249
+ assert.equal(autoSession.basePath, worktree);
250
+ assert.equal(realpathSync(process.cwd()), realpathSync(worktree));
251
+ } finally {
252
+ autoSession.reset();
253
+ process.chdir(previousCwd);
254
+ rmSync(base, { recursive: true, force: true });
255
+ }
256
+ });
257
+
148
258
  test("cleanupAfterLoopExit restores project root through lifecycle and preserves chdir", async (t) => {
149
259
  const base = mkdtempSync(join(tmpdir(), "gsd-cleanup-lifecycle-"));
150
260
  const worktree = join(base, ".gsd", "worktrees", "M001");