@roackb2/heddle 0.0.30 → 0.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -60,7 +60,7 @@ The local control plane gives you a browser-based view of the current workspace,
60
60
 
61
61
  Saved session review in the control plane, with conversation history in the center and current change review on the right. Review starts from the current Git working tree, then separates historical turn diffs and command/approval evidence so you can focus on the change you need to inspect now:
62
62
 
63
- ![Heddle control plane current diff review](docs/images/control-plane-session-current-diff.png)
63
+ ![Heddle control plane expanded diff review](docs/images/control-plane-expanded-diff-review.png)
64
64
 
65
65
  ### Workspace and task management
66
66
 
@@ -112,7 +112,7 @@ async function acquireMemoryMaintenanceLock(options) {
112
112
  continue;
113
113
  }
114
114
  if (Date.now() - startedAt >= timeoutMs) {
115
- throw new Error(`Memory maintenance lock is busy: ${lockPath}`);
115
+ throw new Error(`Memory maintenance lock is busy: ${lockPath}`, { cause: error });
116
116
  }
117
117
  await sleep(DEFAULT_LOCK_POLL_MS);
118
118
  }
@@ -1 +1 @@
1
- {"version":3,"file":"maintenance-integration.js","sourceRoot":"","sources":["../../../../src/core/memory/maintenance-integration.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"maintenance-integration.js","sourceRoot":"","sources":["../../../../src/core/memory/maintenance-integration.ts"],"names":[],"mappings":"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"}
@@ -46,7 +46,7 @@ export async function searchWorkspaceFiles(args) {
46
46
  export async function browseWorkspaceDirectories(args) {
47
47
  const root = resolve(args.path?.trim() || defaultBrowseRoot());
48
48
  const limit = Math.max(1, Math.min(args.limit ?? 100, 300));
49
- let entries = [];
49
+ let entries;
50
50
  try {
51
51
  entries = await readdir(root, { withFileTypes: true });
52
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-files.js","sourceRoot":"","sources":["../../../../../../src/server/features/control-plane/services/workspace-files.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"workspace-files.js","sourceRoot":"","sources":["../../../../../../src/server/features/control-plane/services/workspace-files.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ /*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
2
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-300:oklch(80.8% .114 19.571);--color-red-950:oklch(25.8% .092 26.042);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-950:oklch(26.2% .051 172.552);--color-cyan-400:oklch(78.9% .154 211.53);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-950:oklch(12.9% .042 264.695);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-4xl:56rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-medium:500;--font-weight-semibold:600;--tracking-normal:0em;--radius-md:8px;--radius-lg:10px;--radius-xl:12px;--radius-2xl:1rem;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-background:#090c11;--color-foreground:#e4ebf1;--color-card:#0e1420;--color-popover:#0e1420;--color-popover-foreground:#e4ebf1;--color-primary:#72d7f8;--color-primary-foreground:#03131c;--color-secondary:#212936;--color-secondary-foreground:#e4ebf1;--color-muted:#29313d;--color-muted-foreground:#97a3b4;--color-accent:#8adbf0;--color-accent-foreground:#03131c;--color-destructive:#fca1af;--color-destructive-foreground:#21080c;--color-border:#313a49;--color-input:#313a49;--color-ring:#72d7f8}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-2{top:calc(var(--spacing) * 2)}.top-11{top:calc(var(--spacing) * 11)}.top-\[max\(0\.75rem\,env\(safe-area-inset-top\)\)\]{top:max(.75rem, env(safe-area-inset-top))}.right-0{right:calc(var(--spacing) * 0)}.right-2{right:calc(var(--spacing) * 2)}.bottom-0{bottom:calc(var(--spacing) * 0)}.z-10{z-index:10}.z-50{z-index:50}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing) * 0)}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-dvh{height:100dvh}.h-full{height:100%}.max-h-24{max-height:calc(var(--spacing) * 24)}.max-h-36{max-height:calc(var(--spacing) * 36)}.max-h-\[34dvh\]{max-height:34dvh}.max-h-\[44rem\]{max-height:44rem}.max-h-\[52dvh\]{max-height:52dvh}.max-h-\[82dvh\]{max-height:82dvh}.max-h-\[min\(820px\,92vh\)\]{max-height:min(820px,92vh)}.max-h-screen{max-height:100vh}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-10{min-height:calc(var(--spacing) * 10)}.min-h-\[60px\]{min-height:60px}.min-h-full{min-height:100%}.w-6{width:calc(var(--spacing) * 6)}.w-9{width:calc(var(--spacing) * 9)}.w-14{width:calc(var(--spacing) * 14)}.w-72{width:calc(var(--spacing) * 72)}.w-80{width:calc(var(--spacing) * 80)}.w-\[76px\]{width:76px}.w-\[min\(280px\,calc\(100vw-32px\)\)\]{width:min(280px,100vw - 32px)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-4xl{max-width:var(--container-4xl)}.max-w-44{max-width:calc(var(--spacing) * 44)}.max-w-64{max-width:calc(var(--spacing) * 64)}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-44{min-width:calc(var(--spacing) * 44)}.min-w-\[min\(100\%\,260px\)\]{min-width:min(100%,260px)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.origin-\[--radix-popover-content-transform-origin\]{transform-origin:--radix-popover-content-transform-origin}.origin-\[--radix-tooltip-content-transform-origin\]{transform-origin:--radix-tooltip-content-transform-origin}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.list-none{list-style-type:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-\[92px_minmax\(0\,1fr\)\]{grid-template-columns:92px minmax(0,1fr)}.grid-cols-\[auto_minmax\(0\,1fr\)_auto\]{grid-template-columns:auto minmax(0,1fr) auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing) * 1)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t-2xl{border-top-left-radius:var(--radius-2xl);border-top-right-radius:var(--radius-2xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-border{border-color:var(--color-border)}.border-cyan-400\/40{border-color:#00d2ef66}@supports (color:color-mix(in lab, red, red)){.border-cyan-400\/40{border-color:color-mix(in oklab, var(--color-cyan-400) 40%, transparent)}}.border-destructive\/40{border-color:#fca1af66}@supports (color:color-mix(in lab, red, red)){.border-destructive\/40{border-color:color-mix(in oklab, var(--color-destructive) 40%, transparent)}}.border-emerald-400\/45{border-color:#00d29473}@supports (color:color-mix(in lab, red, red)){.border-emerald-400\/45{border-color:color-mix(in oklab, var(--color-emerald-400) 45%, transparent)}}.border-input{border-color:var(--color-input)}.border-primary{border-color:var(--color-primary)}.border-red-300\/45{border-color:#ffa3a373}@supports (color:color-mix(in lab, red, red)){.border-red-300\/45{border-color:color-mix(in oklab, var(--color-red-300) 45%, transparent)}}.border-transparent{border-color:#0000}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab, red, red)){.border-white\/20{border-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.bg-background{background-color:var(--color-background)}.bg-background\/40{background-color:#090c1166}@supports (color:color-mix(in lab, red, red)){.bg-background\/40{background-color:color-mix(in oklab, var(--color-background) 40%, transparent)}}.bg-background\/50{background-color:#090c1180}@supports (color:color-mix(in lab, red, red)){.bg-background\/50{background-color:color-mix(in oklab, var(--color-background) 50%, transparent)}}.bg-background\/60{background-color:#090c1199}@supports (color:color-mix(in lab, red, red)){.bg-background\/60{background-color:color-mix(in oklab, var(--color-background) 60%, transparent)}}.bg-black\/25{background-color:#00000040}@supports (color:color-mix(in lab, red, red)){.bg-black\/25{background-color:color-mix(in oklab, var(--color-black) 25%, transparent)}}.bg-black\/45{background-color:#00000073}@supports (color:color-mix(in lab, red, red)){.bg-black\/45{background-color:color-mix(in oklab, var(--color-black) 45%, transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab, red, red)){.bg-black\/70{background-color:color-mix(in oklab, var(--color-black) 70%, transparent)}}.bg-card{background-color:var(--color-card)}.bg-card\/95{background-color:#0e1420f2}@supports (color:color-mix(in lab, red, red)){.bg-card\/95{background-color:color-mix(in oklab, var(--color-card) 95%, transparent)}}.bg-destructive{background-color:var(--color-destructive)}.bg-destructive\/10{background-color:#fca1af1a}@supports (color:color-mix(in lab, red, red)){.bg-destructive\/10{background-color:color-mix(in oklab, var(--color-destructive) 10%, transparent)}}.bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab, red, red)){.bg-emerald-500\/10{background-color:color-mix(in oklab, var(--color-emerald-500) 10%, transparent)}}.bg-emerald-950\/90{background-color:#002c22e6}@supports (color:color-mix(in lab, red, red)){.bg-emerald-950\/90{background-color:color-mix(in oklab, var(--color-emerald-950) 90%, transparent)}}.bg-muted{background-color:var(--color-muted)}.bg-muted\/30{background-color:#29313d4d}@supports (color:color-mix(in lab, red, red)){.bg-muted\/30{background-color:color-mix(in oklab, var(--color-muted) 30%, transparent)}}.bg-muted\/40{background-color:#29313d66}@supports (color:color-mix(in lab, red, red)){.bg-muted\/40{background-color:color-mix(in oklab, var(--color-muted) 40%, transparent)}}.bg-popover{background-color:var(--color-popover)}.bg-primary{background-color:var(--color-primary)}.bg-primary\/5{background-color:#72d7f80d}@supports (color:color-mix(in lab, red, red)){.bg-primary\/5{background-color:color-mix(in oklab, var(--color-primary) 5%, transparent)}}.bg-red-950\/92{background-color:#460809eb}@supports (color:color-mix(in lab, red, red)){.bg-red-950\/92{background-color:color-mix(in oklab, var(--color-red-950) 92%, transparent)}}.bg-rose-500\/10{background-color:#ff23571a}@supports (color:color-mix(in lab, red, red)){.bg-rose-500\/10{background-color:color-mix(in oklab, var(--color-rose-500) 10%, transparent)}}.bg-secondary{background-color:var(--color-secondary)}.bg-slate-950\/96{background-color:#020618f5}@supports (color:color-mix(in lab, red, red)){.bg-slate-950\/96{background-color:color-mix(in oklab, var(--color-slate-950) 96%, transparent)}}.bg-transparent{background-color:#0000}.p-1{padding:calc(var(--spacing) * 1)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-\[env\(safe-area-inset-top\)\]{padding-top:env(safe-area-inset-top)}.pr-6{padding-right:calc(var(--spacing) * 6)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-\[calc\(env\(safe-area-inset-bottom\)\+0\.5rem\)\]{padding-bottom:calc(env(safe-area-inset-bottom) + .5rem)}.pb-\[calc\(env\(safe-area-inset-bottom\)\+0\.75rem\)\]{padding-bottom:calc(env(safe-area-inset-bottom) + .75rem)}.pb-\[calc\(env\(safe-area-inset-bottom\)\+5\.5rem\)\]{padding-bottom:calc(env(safe-area-inset-bottom) + 5.5rem)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[11px\]{font-size:11px}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-6{--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.leading-none{--tw-leading:1;line-height:1}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.08em\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent{color:var(--color-accent)}.text-destructive{color:var(--color-destructive)}.text-destructive-foreground{color:var(--color-destructive-foreground)}.text-emerald-50{color:var(--color-emerald-50)}.text-foreground{color:var(--color-foreground)}.text-muted-foreground{color:var(--color-muted-foreground)}.text-muted-foreground\/70{color:#97a3b4b3}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\/70{color:color-mix(in oklab, var(--color-muted-foreground) 70%, transparent)}}.text-popover-foreground{color:var(--color-popover-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-red-50{color:var(--color-red-50)}.text-secondary-foreground{color:var(--color-secondary-foreground)}.text-slate-100{color:var(--color-slate-100)}.text-slate-200{color:var(--color-slate-200)}.text-slate-200\/90{color:#e2e8f0e6}@supports (color:color-mix(in lab, red, red)){.text-slate-200\/90{color:color-mix(in oklab, var(--color-slate-200) 90%, transparent)}}.uppercase{text-transform:uppercase}.underline-offset-4{text-underline-offset:4px}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-black\/20{--tw-ring-color:#0003}@supports (color:color-mix(in lab, red, red)){.ring-black\/20{--tw-ring-color:color-mix(in oklab, var(--color-black) 20%, transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.marker\:hidden ::marker{display:none}.marker\:hidden::marker{display:none}.marker\:hidden ::-webkit-details-marker{display:none}.marker\:hidden::-webkit-details-marker{display:none}.placeholder\:text-muted-foreground::placeholder{color:var(--color-muted-foreground)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media (hover:hover){.hover\:border-primary:hover{border-color:var(--color-primary)}.hover\:bg-accent:hover{background-color:var(--color-accent)}.hover\:bg-black\/45:hover{background-color:#00000073}@supports (color:color-mix(in lab, red, red)){.hover\:bg-black\/45:hover{background-color:color-mix(in oklab, var(--color-black) 45%, transparent)}}.hover\:bg-destructive\/80:hover{background-color:#fca1afcc}@supports (color:color-mix(in lab, red, red)){.hover\:bg-destructive\/80:hover{background-color:color-mix(in oklab, var(--color-destructive) 80%, transparent)}}.hover\:bg-destructive\/90:hover{background-color:#fca1afe6}@supports (color:color-mix(in lab, red, red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab, var(--color-destructive) 90%, transparent)}}.hover\:bg-primary\/80:hover{background-color:#72d7f8cc}@supports (color:color-mix(in lab, red, red)){.hover\:bg-primary\/80:hover{background-color:color-mix(in oklab, var(--color-primary) 80%, transparent)}}.hover\:bg-primary\/90:hover{background-color:#72d7f8e6}@supports (color:color-mix(in lab, red, red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab, var(--color-primary) 90%, transparent)}}.hover\:bg-secondary\/80:hover{background-color:#212936cc}@supports (color:color-mix(in lab, red, red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab, var(--color-secondary) 80%, transparent)}}.hover\:text-accent-foreground:hover{color:var(--color-accent-foreground)}.hover\:text-white:hover{color:var(--color-white)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--color-ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:var(--color-ring)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=40rem){.sm\:top-\[max\(1rem\,env\(safe-area-inset-top\)\)\]{top:max(1rem, env(safe-area-inset-top))}.sm\:mx-5{margin-inline:calc(var(--spacing) * 5)}.sm\:max-w-\[48\%\]{max-width:48%}.sm\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-between{justify-content:space-between}.sm\:justify-end{justify-content:flex-end}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:px-4{padding-inline:calc(var(--spacing) * 4)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}.sm\:pt-4{padding-top:calc(var(--spacing) * 4)}.sm\:pb-4{padding-bottom:calc(var(--spacing) * 4)}.sm\:text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}}@media (width>=48rem){.md\:top-4{top:calc(var(--spacing) * 4)}.md\:right-4{right:calc(var(--spacing) * 4)}.md\:w-\[420px\]{width:420px}.md\:max-w-\[420px\]{max-width:420px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-col{flex-direction:column}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.md\:leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}}@media (width>=64rem){.lg\:col-span-1{grid-column:span 1/span 1}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-start{align-items:flex-start}.lg\:justify-between{justify-content:space-between}}@media (width>=80rem){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-\[minmax\(0\,1\.4fr\)_minmax\(320px\,0\.8fr\)\]{grid-template-columns:minmax(0,1.4fr) minmax(320px,.8fr)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--bg:#0b0f14;--panel:#111827;--panel-alt:#0f172a;--panel-muted:#0b1220;--text:#e5e7eb;--muted:#94a3b8;--line:#94a3b829;--line-strong:#94a3b847;--accent:#7dd3fc;--good:#86efac;--warn:#fcd34d;--bad:#fda4af}*{box-sizing:border-box}html,body,#root{height:100vh}body{background:var(--bg);color:var(--text);margin:0;font:14px/1.5 ui-sans-serif,-apple-system,BlinkMacSystemFont,SF Pro Text,Segoe UI,sans-serif;overflow:hidden}button,textarea{font:inherit;color:inherit}button{cursor:pointer}h1,h2,h3,p{margin-top:0}h1{letter-spacing:-.03em;margin-bottom:8px;font-size:28px;line-height:1.1}h2{letter-spacing:-.02em;margin-bottom:4px;font-size:18px}h3{letter-spacing:-.01em;margin-bottom:10px;font-size:14px}.app-shell{flex-direction:column;gap:14px;height:100vh;padding:16px;display:flex;overflow:hidden}.topbar{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.toolbar{justify-content:space-between;align-items:center;gap:16px;display:flex}.toolbar-tabs{min-width:0}.toolbar-status{flex-direction:row;justify-content:flex-end;align-items:center;gap:12px;min-width:0;display:flex}.toolbar-actions{flex:none;display:block}.debug-snapshot-menu{position:relative}.debug-button{color:var(--muted);cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap;background:#94a3b814;border:1px solid #94a3b833;border-radius:8px;padding:6px 8px;font-size:11px;font-weight:700;list-style:none}.debug-button::-webkit-details-marker{display:none}.debug-button:hover{color:var(--text);border-color:#7dd3fc4d}.debug-snapshot-options{z-index:30;border:1px solid var(--line-strong);background:#0b1220fa;border-radius:8px;gap:4px;min-width:180px;padding:6px;display:grid;position:absolute;top:calc(100% + 6px);right:0;box-shadow:0 16px 36px #00000057}.debug-snapshot-options button{width:100%;color:var(--text);text-align:left;background:0 0;border:0;border-radius:6px;padding:8px 9px}.debug-snapshot-options button:hover{background:#7dd3fc1f}.topbar-title-row{justify-content:flex-end;align-items:center;gap:12px;max-width:100%;display:flex}.runtime-host-info-button{width:20px;height:20px;color:var(--muted);cursor:pointer;-webkit-user-select:none;user-select:none;background:#94a3b814;border:1px solid #94a3b83d;border-radius:999px;justify-content:center;align-items:center;font-size:11px;font-weight:700;line-height:1;display:inline-flex}.runtime-host-info-button:hover,.runtime-host-info-button:focus-visible{color:var(--text);border-color:#7dd3fc52;outline:none}.runtime-host-info-copy{gap:6px;display:grid}.runtime-host-info-copy strong{font-size:12px}.runtime-host-info-copy p{color:var(--muted);margin:0;font-size:12px;line-height:1.45}.topbar-eyebrow{color:var(--accent);letter-spacing:.12em;text-transform:uppercase;margin:0;font-size:11px;font-weight:700;line-height:1}.workspace-path-label{max-width:220px;color:var(--muted);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:1;overflow:hidden}.workspace-switcher{align-items:center;gap:8px;display:flex}.workspace-switcher select{border:1px solid var(--line);min-width:140px;color:var(--text);background:#111827eb;border-radius:8px;padding:6px 10px}.topbar-copy,.muted,.button-copy.muted-copy,.list-button span,.kv-key,.event-line{color:var(--muted)}.topbar-copy{max-width:760px;margin:0}.status-badge{border:1px solid var(--line);max-width:min(260px,100%);color:var(--muted);text-overflow:ellipsis;white-space:nowrap;background:#111827eb;border-radius:999px;align-items:center;padding:7px 12px;font-size:12px;line-height:1;display:inline-flex;overflow:hidden}.status-badge.bad{color:var(--bad);border-color:#fda4af4d}.tabs{flex-wrap:wrap;gap:8px;display:flex}.tab-button{border:1px solid var(--line);background:var(--panel);color:var(--muted);cursor:pointer;border-radius:10px;align-items:center;padding:8px 12px;text-decoration:none;display:inline-flex}.tab-button.active,.side-tabs button.active{color:var(--text);background:#7dd3fc1f;border-color:#7dd3fc57}.overview-grid{flex:auto;grid-template-columns:repeat(12,minmax(0,1fr));grid-auto-rows:min-content;align-content:start;align-items:start;gap:14px;min-height:0;display:grid;overflow:auto}.panel{border:1px solid var(--line);background:var(--panel);border-radius:16px;grid-column:span 4;align-self:start;min-width:0;padding:18px}.panel.wide{grid-column:span 6}.overview-hero{grid-column:span 7;min-height:0}.overview-hero-copy{flex-direction:column;gap:14px;display:flex}.overview-identity{grid-column:span 5}.overview-runtime,.overview-create,.overview-metrics{grid-column:span 4}.overview-list-panel{min-height:0}.overview-more{margin-top:10px}.overview-metric-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;display:grid}.overview-metric-item{flex-direction:column;gap:6px;display:flex}.overview-metric-item .metric{margin:0;font-size:28px}.workspace-form{flex-direction:column;gap:10px;display:flex}.workspace-form-field{flex-direction:column;gap:6px;display:flex}.workspace-form-field input{border:1px solid var(--line);width:100%;color:var(--text);background:#0f172ab3;border-radius:10px;padding:10px 12px}.workspace-form-field input::placeholder{color:var(--muted)}.workspace-form-field input:disabled{opacity:.6;cursor:not-allowed}.workspace-form-checkbox{align-items:center;gap:8px;display:flex}.metric{letter-spacing:-.04em;margin-bottom:6px;font-size:40px;font-weight:800;line-height:1}.workspace-shell{grid-template-columns:minmax(260px, var(--session-sidebar-width,288px)) 6px minmax(560px, 1fr) 6px minmax(320px, var(--session-side-width,344px));border:1px solid var(--line);background:linear-gradient(#111827fa,#0f172af5);border-radius:18px;flex:auto;min-height:0;display:grid;overflow:hidden;box-shadow:0 20px 48px #0000003d}.workspace-sidebar,.workspace-main,.workspace-side{flex-direction:column;min-height:0;display:flex}.workspace-sidebar,.workspace-side{background:var(--panel-muted)}.workspace-sidebar{border-right:0}.workspace-side{border-left:0}.workspace-main{background:var(--panel-alt);grid-template-rows:auto minmax(0,1fr) auto;min-height:0;display:grid;overflow:hidden}.workspace-resizer{cursor:col-resize;touch-action:none;background:#080c1457;border:0;border-left:1px solid #94a3b81f;border-right:1px solid #94a3b81f;border-radius:0;width:6px;min-width:6px}.workspace-resizer:hover,.workspace-resizer:focus-visible{background:#7dd3fc29;border-color:#7dd3fc4d;outline:none}.workspace-header{border-bottom:1px solid #94a3b81f;justify-content:space-between;align-items:flex-start;gap:12px;padding:14px 16px;display:flex}.workspace-header h2{margin-bottom:2px}.workspace-header .muted{font-size:12px;line-height:1.45}.session-controls{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;display:flex}.select-control{color:var(--muted);align-items:center;gap:6px;font-size:12px;display:flex}.select-control select{border:1px solid var(--line);max-width:190px;color:var(--text);background:#0f172acc;border-radius:8px;padding:5px 8px}.drift-button{color:var(--muted);background:0 0;border:1px solid #94a3b838;border-radius:999px;padding:3px 9px;font-size:12px}.drift-button.active{color:var(--good);border-color:#86efac47}.drift-button:disabled,.select-control select:disabled{opacity:.65;cursor:not-allowed}.sidebar-scroll,.conversation-scroll,.side-scroll,.task-detail-scroll{flex:auto;min-height:0;overflow:auto}.sidebar-scroll,.side-scroll,.task-detail-scroll{padding:12px}.split-scroll{flex-direction:column;gap:16px;display:flex}.stack-list{flex-direction:column;gap:10px;display:flex}.stack-list.compact{gap:8px}.list-button{text-align:left;background:#0f172a8a;border:1px solid #94a3b814;border-radius:12px;width:100%;padding:11px;transition:border-color .12s,background .12s,transform .12s}.list-button:hover{background:#1e293bc7;border-color:#7dd3fc2e}.list-button.active{background:linear-gradient(#7dd3fc1f,#7dd3fc0f);border-color:#7dd3fc57;box-shadow:inset 0 0 0 1px #7dd3fc14}.list-button-header{justify-content:space-between;gap:8px;margin-bottom:6px;display:flex}.list-button-header strong{font-size:13px}.compact-button{padding:10px}.changed-file-review-card{background:#0f172a8a;border:1px solid #94a3b814;border-radius:12px;transition:border-color .12s,background .12s,box-shadow .12s;overflow:hidden}.changed-file-review-card.active{background:linear-gradient(#7dd3fc1f,#0f172a9e);border-color:#7dd3fc57;box-shadow:inset 0 0 0 1px #7dd3fc14}.changed-file-review-header{text-align:left;width:100%;padding:10px}.changed-file-review-header:hover{background:#1e293b85}.changed-file-review-body{padding:0 10px 10px}.button-copy{color:var(--text);white-space:pre-wrap;overflow-wrap:anywhere;margin:6px 0 0;font-size:13px}.pills{flex-wrap:wrap;gap:6px;margin:8px 0;display:flex}.compact-pills{margin:0}.pill{color:var(--muted);border:1px solid #94a3b838;border-radius:999px;align-items:center;padding:2px 8px;font-size:12px;display:inline-flex}.pill.good{color:var(--good);border-color:#86efac47}.pill.warn{color:var(--warn);border-color:#fcd34d47}.pill.bad{color:var(--bad);border-color:#fda4af47}.conversation-scroll{flex-direction:column;min-height:0;padding:14px 18px 28px;display:flex;overflow:auto}.conversation-stack{flex-direction:column;gap:16px;min-height:100%;display:flex}.conversation-spacer{flex:1 0 32px}.message{overflow-wrap:anywhere;background:#111827e0;border:1px solid #94a3b81f;border-radius:14px;min-width:0;max-width:min(760px,84%);padding:12px 13px;box-shadow:0 8px 18px #00000029}.message.user{background:linear-gradient(#38bdf829,#38bdf81a);border-color:#7dd3fc3d;align-self:flex-end}.message.assistant{align-self:flex-start}.message.tool-result{background:#0f172ab8;border-color:#94a3b82e;max-width:min(820px,88%)}.message.working{border-color:#fcd34d47;box-shadow:inset 0 0 0 1px #fcd34d14}.message-header{color:var(--muted);justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px;font-size:12px;display:flex}.message-body,.summary,.kv-value{white-space:pre-wrap;overflow-wrap:anywhere}.markdown-body{white-space:normal;line-height:1.65}.markdown-body>:last-child{margin-bottom:0}.markdown-body p,.markdown-body ul,.markdown-body ol,.markdown-body pre,.markdown-body blockquote,.markdown-body table{margin:0 0 12px}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4{margin:0 0 10px;line-height:1.25}.markdown-body ul,.markdown-body ol{padding-left:20px}.markdown-body li+li{margin-top:4px}.markdown-body blockquote{color:var(--muted);border-left:3px solid #7dd3fc47;padding-left:12px}.markdown-body table{border-collapse:collapse;width:100%;font-size:13px}.markdown-body th,.markdown-body td{border:1px solid var(--line);text-align:left;vertical-align:top;padding:8px 10px}.markdown-body th{background:#94a3b814}.tool-result-body{flex-direction:column;gap:8px;display:flex}.tool-result-meta{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.tool-command{color:var(--muted);overflow-wrap:anywhere;font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace}.tool-error{color:var(--bad);margin:0}.tool-output{color:#dbe4f3;white-space:pre-wrap;background:#070b10d1;border:1px solid #94a3b81a;border-radius:8px;max-height:280px;margin:0;padding:10px;font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;overflow:auto}.inline-code{background:#94a3b81f;border-radius:6px;padding:1px 5px;font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace}.composer-shell{background:#080c1457;border-top:1px solid #94a3b81f;padding:14px 16px 16px;position:relative}.composer-shell textarea{resize:none;background:#0b1220e6;border:1px solid #94a3b824;border-radius:12px;width:100%;min-height:96px;padding:12px 13px;transition:border-color .12s,box-shadow .12s}.composer-shell textarea:focus{border-color:#7dd3fc57;outline:none;box-shadow:0 0 0 3px #7dd3fc14}.composer-shell textarea::placeholder{color:var(--muted)}.mention-menu{z-index:12;border:1px solid var(--line-strong);background:#0b1220fa;border-radius:8px;max-height:260px;padding:8px;position:absolute;bottom:calc(100% - 8px);left:16px;right:16px;overflow:auto;box-shadow:0 16px 36px #00000057}.mention-menu-header{color:var(--muted);justify-content:space-between;gap:12px;padding:4px 6px 8px;font-size:12px;display:flex}.mention-option{width:100%;color:var(--text);text-align:left;background:0 0;border:1px solid #0000;border-radius:8px;padding:8px 9px}.mention-option.active,.mention-option:hover{background:#7dd3fc1f;border-color:#7dd3fc47}.mention-option span{overflow-wrap:anywhere;font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace}.mention-empty{color:var(--muted);margin:0;padding:10px 8px}.composer-footer{justify-content:space-between;align-items:flex-end;gap:12px;margin-top:8px;display:flex}.composer-status{flex-flow:wrap;flex:auto;align-items:center;gap:6px;min-width:0;display:flex}.composer-status p{max-width:560px;margin:0;font-size:12px;line-height:1.35}.composer-actions{flex-shrink:0;justify-content:flex-end}.primary-button{color:#03131c;background:linear-gradient(#8ee3ff,#67c7ef);border:0;border-radius:10px;padding:9px 14px;font-weight:700;box-shadow:0 8px 18px #67c7ef33}.sidebar-action-button{color:var(--text);white-space:nowrap;background:#7dd3fc1a;border:1px solid #7dd3fc38;border-radius:10px;padding:7px 11px;font-size:12px;font-weight:600;transition:border-color .12s,background .12s,transform .12s}.sidebar-action-button:hover{background:#7dd3fc29;border-color:#7dd3fc57}.sidebar-action-button:disabled{opacity:.65;cursor:not-allowed}.primary-button:disabled,.composer-shell textarea:disabled{opacity:.6;cursor:not-allowed}.side-tabs{border-bottom:1px solid var(--line);gap:8px;padding:14px;display:flex}.side-tabs button{border:1px solid var(--line);color:var(--muted);background:0 0;border-radius:10px;padding:8px 12px}.review-mode-tabs{z-index:2;background:var(--panel-alt);margin:-12px -12px 18px;padding:12px;position:sticky;top:0}.review-mode-tabs+.side-section{padding-top:2px}.review-section-actions{align-items:center;gap:8px;display:flex}.stale-diff-button{color:#fde68a;background:#facc1514;border:1px solid #facc1566;border-radius:999px;justify-content:center;align-items:center;width:26px;height:26px;font-size:12px;font-weight:700;line-height:1;display:inline-flex}.review-turn-picker{max-height:210px;padding-right:2px;overflow:auto}.diff-dialog-backdrop{z-index:80;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:#020617c7;justify-content:center;align-items:center;padding:24px;display:flex;position:fixed;inset:0}.diff-dialog{background:#07101d;border:1px solid #7dd3fc42;border-radius:18px;flex-direction:column;width:min(1180px,96vw);min-height:min(620px,82vh);max-height:min(860px,92vh);display:flex;overflow:hidden;box-shadow:0 28px 90px #0000008c}.diff-dialog-header{border-bottom:1px solid var(--line);background:#0f172ad1;justify-content:space-between;align-items:flex-start;gap:18px;padding:18px 20px;display:flex}.diff-dialog-header h2{overflow-wrap:anywhere;margin:0;font-size:18px}.diff-dialog-body{flex:auto;min-height:0;padding:18px 20px 20px;overflow:auto}.diff-dialog-body .diff-viewer{min-width:min(900px,100%)}.side-section{flex-direction:column;gap:10px;display:flex}.detail-stack{flex-direction:column;gap:14px;display:flex}.compact-stack{gap:10px}.detail-card,.empty-state{background:#0f172a8f;border:1px solid #94a3b81a;border-radius:12px;padding:12px}.error-card{border-color:#fda4af3d}.approval-card{flex-direction:column;gap:8px;max-height:min(520px,58vh);display:flex;overflow:hidden}.approval-card .muted{overflow-wrap:anywhere}.approval-card .code-block{overscroll-behavior:contain;-webkit-overflow-scrolling:touch;border-radius:8px;flex:auto;min-height:84px;max-height:min(360px,36vh);overflow:auto}.approval-actions{flex:none;margin-bottom:0}.card-title,.section-label{margin-bottom:6px;font-size:13px;font-weight:700}.kv-list{gap:8px;display:grid}.kv-list>div{gap:2px;display:grid}.kv-key{text-transform:uppercase;letter-spacing:.08em;font-size:11px}.path{word-break:break-all}.event-list{flex-direction:column;gap:8px;display:flex}.event-line{border-left:2px solid #94a3b83d;margin:0;padding-left:10px;font-size:13px}.code-block{color:#dbe4f3;white-space:pre-wrap;background:#070b10;border-radius:12px;margin:0;padding:12px;font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;overflow:auto}.empty-state{flex-direction:column;gap:6px;display:flex}.sidebar-empty-state{padding-top:8px}@media (width<=1180px){.workspace-shell{grid-template-columns:minmax(232px, var(--session-sidebar-width,252px)) 6px minmax(420px, 1fr) 6px minmax(280px, var(--session-side-width,312px))}}@media (width<=980px){html,body,#root{height:100dvh;min-height:100dvh}body{overflow:hidden}.app-shell{gap:10px;height:100dvh;min-height:100dvh;padding:10px;overflow:hidden}.topbar{flex-direction:column}.toolbar{flex-direction:row;align-items:center;gap:8px}.toolbar-status{flex:auto;justify-content:flex-end;gap:8px;width:auto}.toolbar-tabs{flex:none}.toolbar-actions{margin-left:auto;display:block}.tab-button{padding:7px 10px}.topbar-title-row{gap:8px}.workspace-path-label{max-width:150px}.status-badge{max-width:180px;padding:6px 10px}.composer-footer{flex-direction:column;align-items:stretch}.composer-actions{justify-content:flex-start}.overview-grid{grid-template-columns:1fr;align-content:start;padding:12px}.panel,.panel.wide,.overview-hero,.overview-identity,.overview-runtime,.overview-create,.overview-metrics{grid-column:auto}.overview-metric-grid{grid-template-columns:1fr}}.mobile-nav-button,.mobile-side-header,.mobile-task-shell,.mobile-task-screen,.mobile-task-header,.mobile-task-segmented,.mobile-task-meta{display:none}@media (width<=760px){.workspace-shell{display:none}.mobile-session-screen,.mobile-task-screen{flex:auto;height:100%;min-height:0;display:flex;overflow:hidden}.mobile-pane{border:1px solid var(--line);border-radius:12px;width:100%;min-height:0;overflow:hidden}.mobile-session-list .mobile-pane,.mobile-session-review .mobile-pane,.mobile-task-screen .mobile-pane{background:var(--panel-muted);flex-direction:column;display:flex}.mobile-session-chat,.mobile-task-screen{min-height:0}.mobile-chat-pane{background:var(--panel-alt);flex-direction:column;min-height:0;display:flex}.workspace-resizer{display:none}.mobile-nav-button{color:var(--text);background:#7dd3fc14;border:1px solid #7dd3fc38;border-radius:10px;align-items:center;padding:7px 10px;font-size:12px;font-weight:600;display:inline-flex}.mobile-side-header,.mobile-task-header{background:var(--panel-muted);padding:12px 12px 0;display:block}.workspace-header,.mobile-task-segmented,.mobile-task-meta{padding:12px}.workspace-sidebar .workspace-header .muted{display:none}.workspace-header h2{font-size:17px}.workspace-header>div{min-width:0}.workspace-header .muted{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.session-controls{justify-content:flex-start;width:100%}.select-control{flex:180px}.select-control select{width:100%;max-width:none}.conversation-scroll{overscroll-behavior:contain;-webkit-overflow-scrolling:touch;flex:auto;min-height:0;padding:12px 12px 20px;overflow:auto}.conversation-stack{gap:12px}.conversation-spacer{flex-basis:10px}.message,.message.tool-result{border-radius:10px;max-width:100%}.composer-shell{z-index:1;overscroll-behavior:contain;max-height:58dvh;padding:10px 12px env(safe-area-inset-bottom,0px);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);-webkit-overflow-scrolling:touch;background:#080c14f5;flex-direction:column;flex:none;display:flex;position:relative;overflow:auto}.approval-card{flex:0 auto;max-height:min(330px,38dvh)}.approval-card .code-block{max-height:min(190px,22dvh)}.composer-shell textarea{border-radius:8px;flex:none;min-height:78px}.composer-actions{justify-content:flex-end;width:100%}.composer-actions .primary-button{margin-left:auto}.diff-dialog-backdrop{align-items:stretch;padding:10px}.diff-dialog{border-radius:14px;width:100%;min-height:calc(100dvh - 20px);max-height:calc(100dvh - 20px)}.diff-dialog-header{padding:14px}.diff-dialog-body{padding:12px}}@media (width<=620px){.toolbar{align-items:flex-start}.workspace-header{flex-direction:column;align-items:stretch}.toolbar-status{flex-wrap:wrap}.topbar-eyebrow{font-size:10px}.workspace-path-label{max-width:120px}.status-badge{max-width:150px}}.mobile-task-segmented{border-bottom:1px solid var(--line);background:var(--panel-muted);gap:8px;display:flex}.mobile-task-segmented button{border:1px solid var(--line);color:var(--muted);background:0 0;border-radius:10px;flex:1 1 0;padding:8px 12px}.mobile-task-segmented button.active{color:var(--text);background:#7dd3fc1f;border-color:#7dd3fc57}.mobile-task-meta{border-bottom:1px solid var(--line);background:var(--panel-muted);flex-direction:column;gap:8px;display:flex}@media (width<=500px){.toolbar{flex-wrap:wrap}.toolbar-tabs,.toolbar-status,.topbar-title-row,.topbar-eyebrow,.workspace-path-label,.status-badge,.workspace-header .muted,.composer-status,.pills.compact-pills,.mobile-inspector-button,.select-control,.drift-button,.session-controls .pill{display:none}.toolbar-actions{margin-left:auto;display:block}.workspace-main{height:auto;min-height:0}.workspace-header{gap:8px}.workspace-header,.side-tabs,.sidebar-scroll,.side-scroll,.task-detail-scroll,.mobile-task-segmented,.mobile-task-meta{padding:10px}.workspace-header h2{font-size:15px;line-height:1.2}.session-controls{gap:6px}.conversation-scroll{padding:8px 10px 12px}.message,.message.tool-result{max-width:100%;padding:10px 11px}.message.user{max-width:92%}.message-header{margin-bottom:6px}.composer-shell{max-height:62dvh;padding:8px 10px env(safe-area-inset-bottom,0px)}.approval-card{max-height:min(300px,40dvh)}.approval-card .code-block{max-height:min(170px,23dvh)}.composer-footer{gap:8px;margin-top:8px}.composer-actions{justify-content:space-between}.composer-actions .tab-button:not(:last-child){display:none}.composer-actions .primary-button{width:100%;margin-left:0}}
@@ -48,8 +48,8 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
48
48
  `},gp=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},_p=function(){x.useEffect(function(){return document.body.setAttribute(mp,(gp()+1).toString()),function(){var e=gp()-1;e<=0?document.body.removeAttribute(mp):document.body.setAttribute(mp,e.toString())}},[])},vp=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;_p();var a=x.useMemo(function(){return fp(i)},[i]);return x.createElement(pp,{styles:hp(a,!t,i,n?``:`!important`)})},yp=!1;if(typeof window<`u`)try{var bp=Object.defineProperty({},`passive`,{get:function(){return yp=!0,!0}});window.addEventListener(`test`,bp,bp),window.removeEventListener(`test`,bp,bp)}catch{yp=!1}var xp=yp?{passive:!1}:!1,Sp=function(e){return e.tagName===`TEXTAREA`},Cp=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Sp(e)&&n[t]===`visible`)},wp=function(e){return Cp(e,`overflowY`)},Tp=function(e){return Cp(e,`overflowX`)},Ep=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),kp(e,r)){var i=Ap(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Dp=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Op=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},kp=function(e,t){return e===`v`?wp(t):Tp(t)},Ap=function(e,t){return e===`v`?Dp(t):Op(t)},jp=function(e,t){return e===`h`&&t===`rtl`?-1:1},Mp=function(e,t,n,r,i){var a=jp(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Ap(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&kp(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Np=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Pp=function(e){return[e.deltaX,e.deltaY]},Fp=function(e){return e&&`current`in e?e.current:e},Ip=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Lp=function(e){return`
49
49
  .block-interactivity-${e} {pointer-events: none;}
50
50
  .allow-interactivity-${e} {pointer-events: all;}
51
- `},Rp=0,zp=[];function Bp(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(Rp++)[0],a=x.useState(cp)[0],o=x.useRef(e);x.useEffect(function(){o.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Lf([e.lockRef.current],(e.shards||[]).map(Fp),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=x.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Np(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Ep(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Ep(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Mp(h,t,e,h===`h`?s:c,!0)},[]),c=x.useCallback(function(e){var n=e;if(!(!zp.length||zp[zp.length-1]!==a)){var r=`deltaY`in n?Pp(n):Np(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ip(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Fp).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=x.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Vp(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=x.useCallback(function(e){n.current=Np(e),r.current=void 0},[]),d=x.useCallback(function(t){l(t.type,Pp(t),t.target,s(t,e.lockRef.current))},[]),f=x.useCallback(function(t){l(t.type,Np(t),t.target,s(t,e.lockRef.current))},[]);x.useEffect(function(){return zp.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,xp),document.addEventListener(`touchmove`,c,xp),document.addEventListener(`touchstart`,u,xp),function(){zp=zp.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,xp),document.removeEventListener(`touchmove`,c,xp),document.removeEventListener(`touchstart`,u,xp)}},[]);var p=e.removeScrollBar,m=e.inert;return x.createElement(x.Fragment,null,m?x.createElement(a,{styles:Lp(i)}):null,p?x.createElement(vp,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Vp(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Hp=Zf(Qf,Bp),Up=x.forwardRef(function(e,t){return x.createElement(ep,Ff({},e,{ref:t,sideCar:Hp}))});Up.classNames=ep.classNames;var Wp=`Popover`,[Gp,Kp]=Ls(Wp,[ku]),qp=ku(),[Jp,Yp]=Gp(Wp),Xp=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=qp(t),c=x.useRef(null),[l,u]=x.useState(!1),[d,f]=ad({prop:r,defaultProp:i??!1,onChange:a,caller:Wp});return(0,G.jsx)(Gu,{...s,children:(0,G.jsx)(Jp,{scope:t,contentId:mc(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:x.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:x.useCallback(()=>u(!0),[]),onCustomAnchorRemove:x.useCallback(()=>u(!1),[]),modal:o,children:n})})};Xp.displayName=Wp;var Zp=`PopoverAnchor`,Qp=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Yp(Zp,n),a=qp(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return x.useEffect(()=>(o(),()=>s()),[o,s]),(0,G.jsx)(Ku,{...a,...r,ref:t})});Qp.displayName=Zp;var $p=`PopoverTrigger`,em=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Yp($p,n),a=qp(n),o=Cs(t,i.triggerRef),s=(0,G.jsx)(Ks.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":hm(i.open),...r,ref:o,onClick:Is(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,G.jsx)(Ku,{asChild:!0,...a,children:s})});em.displayName=$p;var tm=`PopoverPortal`,[nm,rm]=Gp(tm,{forceMount:void 0}),im=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Yp(tm,t);return(0,G.jsx)(nm,{scope:t,forceMount:n,children:(0,G.jsx)(Qu,{present:n||a.open,children:(0,G.jsx)(Xu,{asChild:!0,container:i,children:r})})})};im.displayName=tm;var am=`PopoverContent`,om=x.forwardRef((e,t)=>{let n=rm(am,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Yp(am,e.__scopePopover);return(0,G.jsx)(Qu,{present:r||a.open,children:a.modal?(0,G.jsx)(cm,{...i,ref:t}):(0,G.jsx)(lm,{...i,ref:t})})});om.displayName=am;var sm=bf(`PopoverContent.RemoveScroll`),cm=x.forwardRef((e,t)=>{let n=Yp(am,e.__scopePopover),r=x.useRef(null),i=Cs(t,r),a=x.useRef(!1);return x.useEffect(()=>{let e=r.current;if(e)return Pf(e)},[]),(0,G.jsx)(Up,{as:sm,allowPinchZoom:!0,children:(0,G.jsx)(um,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Is(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Is(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:Is(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),lm=x.forwardRef((e,t)=>{let n=Yp(am,e.__scopePopover),r=x.useRef(!1),i=x.useRef(!1);return(0,G.jsx)(um,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),um=x.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=Yp(am,n),p=qp(n);return tf(),(0,G.jsx)(cf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,G.jsx)(nc,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,G.jsx)(qu,{"data-state":hm(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),dm=`PopoverClose`,fm=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Yp(dm,n);return(0,G.jsx)(Ks.button,{type:`button`,...r,ref:t,onClick:Is(e.onClick,()=>i.onOpenChange(!1))})});fm.displayName=dm;var pm=`PopoverArrow`,mm=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=qp(n);return(0,G.jsx)(Ju,{...i,...r,ref:t})});mm.displayName=pm;function hm(e){return e?`open`:`closed`}var gm=im,_m=om,vm=x.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,G.jsx)(gm,{children:(0,G.jsx)(_m,{ref:i,align:t,sideOffset:n,className:vs(`z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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 origin-[--radix-popover-content-transform-origin]`,e),...r})}));vm.displayName=_m.displayName;var ym=45e3;function bm(e){if(!e?.runtimeHost)return{state:`local`,label:`Local control plane`,badgeLabel:`Local`,detail:`No daemon ownership metadata is loaded in this control-plane session.`,tone:`outline`};let t=e.runtimeHost.workspaceOwner?.lastSeenAt,n=xm(t),r=`${e.runtimeHost.endpoint.host}:${e.runtimeHost.endpoint.port}`;return n?{state:`stale`,label:`Daemon unreachable`,badgeLabel:`Stale daemon`,detail:t?`The last daemon heartbeat is stale for ${e.workspace.name}. Refresh state or restart the daemon before trusting live runtime status.`:`The daemon owner for ${e.workspace.name} is not reporting a recent heartbeat.`,tone:`destructive`,endpoint:r,ownerId:e.runtimeHost.ownerId,lastSeenAt:t}:{state:`attached`,label:`Attached to daemon`,badgeLabel:`Daemon`,detail:`Sessions and tasks are reading daemon-owned runtime state for ${e.workspace.name}.`,tone:`secondary`,endpoint:r,ownerId:e.runtimeHost.ownerId,lastSeenAt:t}}function xm(e){if(!e)return!1;let t=Date.parse(e);return Number.isFinite(t)?Date.now()-t>ym:!1}function Sm({title:e,children:t,wide:n=!1,panelClassName:r}){return(0,G.jsxs)(`section`,{className:Na(`panel`,n&&`wide`,r),children:[(0,G.jsx)(`h2`,{children:e}),t]})}function Cm({title:e,body:t}){return(0,G.jsxs)(`div`,{className:`empty-state`,children:[(0,G.jsx)(`strong`,{children:e}),(0,G.jsx)(`p`,{className:`muted`,children:t})]})}function wm({error:e,state:t}){return e?(0,G.jsxs)(`aside`,{className:`status-badge bad`,children:[`Error: `,e]}):t?(0,G.jsxs)(`aside`,{className:`status-badge`,children:[t.sessions.length,` sessions · `,t.heartbeat.tasks.length,` tasks`]}):(0,G.jsx)(`aside`,{className:`status-badge`,children:`Connecting...`})}function Tm({state:e,onRefresh:t}){let n=bm(e);return(0,G.jsxs)(`section`,{className:`mx-4 mt-4 flex min-w-0 flex-col gap-3 rounded-xl border border-border bg-card/95 px-4 py-3 shadow-sm sm:mx-5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`p`,{className:`truncate text-sm font-semibold text-foreground`,children:n.label}),(0,G.jsx)(K,{variant:n.tone,className:`w-fit shrink-0`,children:e?.workspace.name??`workspace`})]}),(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n.detail})]}),t?(0,G.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:t,children:`Refresh state`}):null]}),n.endpoint||n.ownerId||n.lastSeenAt?(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[n.endpoint?(0,G.jsxs)(`span`,{children:[`endpoint=`,n.endpoint]}):null,n.ownerId?(0,G.jsxs)(`span`,{children:[`owner=`,n.ownerId]}):null,n.lastSeenAt?(0,G.jsxs)(`span`,{children:[`last seen=`,new Date(n.lastSeenAt).toLocaleTimeString()]}):null]}):null]})}function Em({state:e}){return e?(0,G.jsxs)(`span`,{className:`workspace-path-label`,children:[e.workspace.name,(0,G.jsxs)(`span`,{className:`muted`,children:[` · `,Ra(e.workspace.anchorRoot)]})]}):null}function Dm({state:e,disabled:t,onSelect:n}){return!e||e.workspaces.length<=1?null:(0,G.jsxs)(`label`,{className:`workspace-switcher`,children:[(0,G.jsx)(`span`,{className:`muted`,children:`Workspace`}),(0,G.jsx)(`select`,{value:e.activeWorkspaceId,disabled:t,onChange:e=>n(e.target.value),children:e.workspaces.map(e=>(0,G.jsx)(`option`,{value:e.id,children:e.name},e.id))})]})}function $({children:e,tone:t}){return(0,G.jsx)(`span`,{className:Na(`pill`,t),children:e})}function Om({children:e}){return(0,G.jsx)(`pre`,{className:`code-block`,children:e})}function km({title:e,subtitle:t,actions:n}){return(0,G.jsxs)(`header`,{className:`workspace-header`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{children:e}),(0,G.jsx)(`p`,{className:`muted`,children:t})]}),n]})}function Am({title:e,actions:t,children:n}){return(0,G.jsxs)(`section`,{className:`side-section`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`h3`,{children:e}),t]}),n]})}function jm({state:e,error:t,activeSection:n,sessionPath:r,children:i,onRefresh:a,onSetActiveWorkspace:o,onCaptureDebugSnapshot:s}){let c=bm(e);return(0,G.jsxs)(`main`,{className:`app-shell`,children:[(0,G.jsxs)(`header`,{className:`toolbar`,children:[(0,G.jsxs)(`nav`,{className:`tabs toolbar-tabs`,"aria-label":`Control plane sections`,children:[(0,G.jsx)(Mm,{active:n===`overview`,to:`/overview`,children:`Overview`}),(0,G.jsx)(Mm,{active:n===`sessions`,to:r,children:`Sessions`}),(0,G.jsx)(Mm,{active:n===`tasks`,to:`/tasks`,children:`Tasks`}),(0,G.jsx)(Mm,{active:n===`workspaces`,to:`/workspaces`,children:`Workspaces`})]}),(0,G.jsxs)(`div`,{className:`toolbar-status`,children:[(0,G.jsx)(`div`,{className:`toolbar-actions`,children:(0,G.jsx)(Nm,{onCapture:s})}),(0,G.jsxs)(`div`,{className:`topbar-title-row`,children:[(0,G.jsx)(`p`,{className:`topbar-eyebrow`,children:`Heddle Control Plane`}),(0,G.jsx)(Dm,{state:e,onSelect:o}),(0,G.jsx)(Em,{state:e})]}),(0,G.jsx)(wm,{error:t,state:e})]})]}),t||c.state===`stale`?(0,G.jsx)(Tm,{state:e,onRefresh:a}):null,i]})}function Mm({active:e,to:t,children:n}){return(0,G.jsx)(Sn,{className:`tab-button ${e?`active`:``}`,to:t,"aria-current":e?`page`:void 0,children:n})}function Nm({onCapture:e}){return(0,G.jsxs)(`details`,{className:`debug-snapshot-menu`,children:[(0,G.jsx)(`summary`,{className:`debug-button`,children:`Snapshot`}),(0,G.jsxs)(`div`,{className:`debug-snapshot-options`,role:`menu`,"aria-label":`Debug layout snapshot options`,children:[(0,G.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>e(`none`),children:`DOM + layout only`}),(0,G.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>e(`auto`),children:`Include screenshot`})]})]})}var Pm=[{value:`overview`,label:`Overview`},{value:`sessions`,label:`Sessions`},{value:`tasks`,label:`Tasks`},{value:`workspaces`,label:`Workspaces`}];function Fm({section:e,onSectionChange:t,state:n,error:r,children:i,onCaptureDebugSnapshot:a,onSetActiveWorkspace:o,onRefresh:s}){let c=r?{state:`stale`,label:`Error`,badgeLabel:`Error`,detail:r,tone:`destructive`,endpoint:void 0}:bm(n);return(0,G.jsxs)(`main`,{className:`flex h-dvh flex-col overflow-hidden bg-background pt-[env(safe-area-inset-top)] text-foreground`,children:[(0,G.jsxs)(`header`,{className:`shrink-0 border-b border-border bg-card/95 px-4 py-3`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-2`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,G.jsx)(`span`,{className:`text-xs font-semibold tracking-normal text-foreground`,children:`Heddle`})}),(0,G.jsx)(`p`,{className:`m-0 truncate text-xs leading-5 text-muted-foreground`,children:n?`${n.workspace.name} · ${Ra(n.workspace.anchorRoot)}`:`Reading workspace state`}),n&&n.workspaces.length>1&&o?(0,G.jsxs)(`label`,{className:`mt-1 flex items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{children:`Workspace`}),(0,G.jsx)(`select`,{className:`h-7 min-w-0 rounded-md border border-border bg-background px-2 text-[11px] text-foreground`,value:n.activeWorkspaceId,onChange:e=>o(e.target.value),children:n.workspaces.map(e=>(0,G.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}):null]}),(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:a?(0,G.jsx)(Im,{onCapture:a}):null})]}),r||c.state===`stale`?(0,G.jsxs)(`div`,{className:`mt-2 flex min-w-0 flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`truncate`,children:c.detail}),c.endpoint?(0,G.jsxs)(`span`,{className:`shrink-0`,children:[`endpoint=`,c.endpoint]}):null,s?(0,G.jsx)(`button`,{type:`button`,className:`text-[11px] text-accent`,onClick:s,children:`Refresh`}):null]}):null]}),(0,G.jsx)(`section`,{className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto bg-background`,children:i}),(0,G.jsx)(`nav`,{className:`grid shrink-0 grid-cols-4 gap-1 border-t border-border bg-card/95 px-3 py-2 pb-[calc(env(safe-area-inset-bottom)+0.5rem)]`,"aria-label":`Control plane sections`,children:Pm.map(n=>(0,G.jsx)(q,{type:`button`,variant:e===n.value?`secondary`:`ghost`,size:`sm`,className:`h-9 rounded-md px-2 text-xs`,onClick:()=>t(n.value),"aria-current":e===n.value?`page`:void 0,children:n.label},n.value))})]})}function Im({onCapture:e}){return(0,G.jsxs)(`details`,{className:`relative`,children:[(0,G.jsx)(`summary`,{className:`flex h-10 cursor-pointer list-none items-center rounded-md border border-border bg-secondary px-3 text-xs font-medium text-secondary-foreground marker:hidden`,children:`Snapshot`}),(0,G.jsxs)(`div`,{className:`absolute right-0 top-11 z-50 grid min-w-44 gap-1 rounded-md border border-border bg-popover p-1 shadow-lg`,children:[(0,G.jsx)(`button`,{type:`button`,className:`rounded-md px-3 py-2 text-left text-xs text-popover-foreground hover:bg-accent hover:text-accent-foreground`,onClick:()=>e(`none`),children:`DOM only`}),(0,G.jsx)(`button`,{type:`button`,className:`rounded-md px-3 py-2 text-left text-xs text-popover-foreground hover:bg-accent hover:text-accent-foreground`,onClick:()=>e(`auto`),children:`With screenshot`})]})]})}function Lm({state:e}){let t=(0,x.useMemo)(()=>e.sessions.slice(0,3),[e.sessions]),n=(0,x.useMemo)(()=>e.heartbeat.runs.slice(0,3),[e.heartbeat.runs]),r=(0,x.useMemo)(()=>e.memory.runs.latest.slice(0,3),[e.memory.runs.latest]),i=bm(e);return(0,G.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-x-hidden overflow-y-auto px-3 pt-3 pb-[calc(env(safe-area-inset-bottom)+5.5rem)] sm:px-4 sm:pt-4 sm:pb-4`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 grid gap-4 lg:grid-cols-2`,children:[(0,G.jsxs)(Rm,{className:`lg:col-span-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Active workspace`}),(0,G.jsx)(`h2`,{className:`text-xl font-semibold text-foreground`,children:e.workspace.name}),(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:Ra(e.workspace.anchorRoot)})]}),(0,G.jsx)(K,{variant:`secondary`,className:`w-fit max-w-full truncate`,children:e.workspace.id})]}),(0,G.jsxs)(`div`,{className:`mt-4 grid grid-cols-3 gap-3`,children:[(0,G.jsx)(zm,{label:`Repos`,value:za(e.workspace.repoRoots.length)}),(0,G.jsx)(zm,{label:`Sessions`,value:za(e.sessions.length)}),(0,G.jsx)(zm,{label:`Tasks`,value:za(e.heartbeat.tasks.length)})]}),(0,G.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-sm`,children:[(0,G.jsx)(Bm,{label:`Workspace path`,children:e.workspace.anchorRoot}),(0,G.jsx)(Bm,{label:`State path`,children:e.workspace.stateRoot})]})]}),(0,G.jsxs)(Rm,{className:`lg:col-span-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Runtime host`}),(0,G.jsx)(`h2`,{className:`text-xl font-semibold text-foreground`,children:i.label}),(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i.detail})]}),(0,G.jsx)(K,{variant:i.tone,className:`w-fit max-w-full truncate`,children:i.state})]}),e.runtimeHost?(0,G.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-sm`,children:[(0,G.jsxs)(Bm,{label:`Endpoint`,children:[e.runtimeHost.endpoint.host,`:`,e.runtimeHost.endpoint.port]}),(0,G.jsx)(Bm,{label:`Owner`,children:e.runtimeHost.ownerId}),(0,G.jsx)(Bm,{label:`Last seen`,children:e.runtimeHost.workspaceOwner?.lastSeenAt??`unknown`}),(0,G.jsx)(Bm,{label:`Registry`,children:e.runtimeHost.registryPath})]}):(0,G.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:`Daemon metadata is not loaded in this control-plane session.`})]})]}),(0,G.jsxs)(`div`,{className:`min-w-0 grid gap-4 xl:grid-cols-3`,children:[(0,G.jsxs)(Rm,{className:`min-h-0`,children:[(0,G.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Recent sessions`}),(0,G.jsx)(`h2`,{className:`text-xl font-semibold text-foreground`,children:`Latest conversations`})]}),(0,G.jsxs)(K,{variant:`outline`,children:[za(e.sessions.length),` total`]})]}),t.length?(0,G.jsx)(`div`,{className:`space-y-3`,children:t.map(e=>(0,G.jsx)(Vm,{session:e},e.id))}):(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No saved sessions yet.`}),e.sessions.length>t.length?(0,G.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:`Open Sessions to browse the full conversation catalog.`}):null]}),(0,G.jsxs)(Rm,{className:`min-h-0`,children:[(0,G.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Recent task runs`}),(0,G.jsx)(`h2`,{className:`text-xl font-semibold text-foreground`,children:`Heartbeat activity`})]}),(0,G.jsxs)(K,{variant:`outline`,children:[za(e.heartbeat.tasks.length),` tasks`]})]}),n.length?(0,G.jsx)(`div`,{className:`space-y-3`,children:n.map(e=>(0,G.jsx)(Hm,{run:e},e.id))}):(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No heartbeat runs recorded yet.`}),e.heartbeat.runs.length>n.length?(0,G.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:`Open Tasks to inspect the full run history.`}):null]}),(0,G.jsxs)(Rm,{className:`min-h-0`,children:[(0,G.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Workspace memory`}),(0,G.jsx)(`h2`,{className:`text-xl font-semibold text-foreground`,children:`Catalog health`})]}),(0,G.jsx)(K,{variant:e.memory.catalog.ok?`secondary`:`destructive`,children:e.memory.catalog.ok?`ok`:`attention`})]}),(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,G.jsx)(zm,{label:`Notes`,value:za(e.memory.notes.count)}),(0,G.jsx)(zm,{label:`Pending`,value:za(e.memory.candidates.pending)})]}),e.memory.catalog.missing.length?(0,G.jsxs)(`div`,{className:`mt-4 rounded-xl border border-border bg-background/60 p-3`,children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Missing catalogs`}),(0,G.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e.memory.catalog.missing.slice(0,4).join(`, `)})]}):null,r.length?(0,G.jsx)(`div`,{className:`mt-4 space-y-3`,children:r.map(e=>(0,G.jsx)(Um,{run:e},e.id))}):(0,G.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:`No memory maintenance runs recorded yet.`})]})]})]})}function Rm({children:e,className:t=``}){return(0,G.jsx)(`section`,{className:`min-w-0 rounded-2xl border border-border bg-card/95 p-4 shadow-sm sm:p-5 ${t}`,children:e})}function zm({label:e,value:t}){return(0,G.jsxs)(`div`,{className:`min-w-0 rounded-xl border border-border bg-background/60 p-3`,children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:e}),(0,G.jsx)(`p`,{className:`mt-2 text-3xl font-semibold leading-none text-foreground sm:text-4xl`,children:t})]})}function Bm({label:e,children:t}){return(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`dt`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:e}),(0,G.jsx)(`dd`,{className:`break-all text-sm text-foreground`,children:t})]})}function Vm({session:e}){return(0,G.jsxs)(`article`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`h3`,{className:`truncate text-base font-semibold text-foreground`,children:e.name}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:Ia(e.updatedAt)})]}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-2 sm:max-w-[48%] sm:justify-end`,children:[(0,G.jsx)(K,{variant:`outline`,className:`max-w-full truncate`,children:e.model??`unset model`}),(0,G.jsxs)(K,{variant:`secondary`,className:`w-fit`,children:[e.turnCount,` turns`]})]})]}),e.lastSummary?(0,G.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:La(e.lastSummary,120)}):null]})}function Hm({run:e}){return(0,G.jsxs)(`article`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`h3`,{className:`truncate text-base font-semibold text-foreground`,children:e.id}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:Ia(e.createdAt)})]}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-2 sm:max-w-[48%] sm:justify-end`,children:[(0,G.jsx)(Wm,{value:e.status}),(0,G.jsx)(Wm,{value:e.decision})]})]}),(0,G.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:La(e.summary,132)})]})}function Um({run:e}){return(0,G.jsxs)(`article`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`h3`,{className:`truncate text-base font-semibold text-foreground`,children:e.id}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:Ia(e.finishedAt)})]}),(0,G.jsx)(Wm,{value:e.outcome})]}),(0,G.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:La(e.summary,132)})]})}function Wm({value:e}){let t=Pa(e);return t===`good`?(0,G.jsx)(K,{className:`max-w-full truncate border-emerald-400/45 bg-emerald-950/90 text-emerald-50`,children:e}):t===`warn`?(0,G.jsx)(K,{className:`max-w-full truncate border-cyan-400/40 bg-primary/5 text-foreground`,children:e}):t===`bad`?(0,G.jsx)(K,{className:`max-w-full truncate border-red-300/45 bg-red-950/92 text-red-50`,children:e}):(0,G.jsx)(K,{variant:`outline`,className:`max-w-full truncate`,children:e})}function Gm({diff:e,patch:t,fallbackTitle:n=`Raw patch`}){return e?.binary?(0,G.jsx)(Cm,{title:`Binary file`,body:`Git reports this as a binary diff, so Heddle cannot render line-level changes.`}):e?.hunks.length?(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-background font-mono text-xs`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 border-b border-border bg-muted/30 px-3 py-2 font-sans`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`truncate text-sm font-semibold text-foreground`,children:e.path}),e.oldPath?(0,G.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[`from `,e.oldPath]}):null]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,G.jsx)($,{children:e.status}),(0,G.jsxs)($,{tone:`good`,children:[`+`,e.additions,` / -`,e.deletions]})]})]}),(0,G.jsx)(`div`,{className:`max-h-[44rem] overflow-auto`,children:e.hunks.map((e,t)=>(0,G.jsx)(`table`,{className:`w-full border-collapse`,children:(0,G.jsxs)(`tbody`,{children:[(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:3,className:`border-y border-border bg-muted/40 px-3 py-1 font-mono text-[11px] text-muted-foreground`,children:e.header})}),e.lines.map((t,n)=>(0,G.jsxs)(`tr`,{className:Na(t.type===`added`&&`bg-emerald-500/10`,t.type===`deleted`&&`bg-rose-500/10`),children:[(0,G.jsx)(`td`,{className:`w-12 select-none border-r border-border px-2 py-0.5 text-right text-muted-foreground/70`,children:t.oldLineNumber??``}),(0,G.jsx)(`td`,{className:`w-12 select-none border-r border-border px-2 py-0.5 text-right text-muted-foreground/70`,children:t.newLineNumber??``}),(0,G.jsx)(`td`,{className:`whitespace-pre px-3 py-0.5 text-foreground`,children:t.content})]},`${e.header}-${t.oldLineNumber??``}-${t.newLineNumber??``}-${n}`))]})},`${e.header}-${t}`))})]}):t?(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,G.jsx)($,{tone:`warn`,children:n}),(0,G.jsx)(`span`,{className:`min-w-0 text-xs text-muted-foreground`,children:`Structured hunks are unavailable for this patch.`})]}),(0,G.jsx)(Om,{children:t})]}):(0,G.jsx)(Cm,{title:`No patch available`,body:`Git reports this file as changed, but no patch text is available for it.`})}var Km=(0,x.memo)(function({session:e,active:t,onClick:n}){return(0,G.jsxs)(`button`,{className:Na(`list-button`,t&&`active`),type:`button`,onClick:n,children:[(0,G.jsxs)(`div`,{className:`list-button-header`,children:[(0,G.jsx)(`strong`,{children:e.name}),(0,G.jsx)(`span`,{children:Ia(e.updatedAt)})]}),(0,G.jsxs)(`div`,{className:`pills compact-pills`,children:[(0,G.jsx)($,{children:e.model??`unset model`}),(0,G.jsxs)($,{children:[`turns `,e.turnCount]})]}),e.lastPrompt?(0,G.jsxs)(`p`,{className:`button-copy`,children:[(0,G.jsx)(`strong`,{children:`Prompt:`}),` `,La(e.lastPrompt,88)]}):null,e.lastSummary?(0,G.jsx)(`p`,{className:`button-copy muted-copy`,children:La(e.lastSummary,120)}):null]})}),qm=(0,x.memo)(function({task:e,active:t,onClick:n}){let r=Ha(e);return(0,G.jsxs)(`button`,{className:Na(`list-button`,t&&`active`),type:`button`,onClick:n,children:[(0,G.jsxs)(`div`,{className:`list-button-header`,children:[(0,G.jsx)(`strong`,{children:e.name||e.taskId}),(0,G.jsx)(`span`,{children:Ia(e.nextRunAt)})]}),(0,G.jsxs)(`div`,{className:`pills compact-pills`,children:[(0,G.jsx)($,{tone:e.enabled?`good`:void 0,children:e.enabled?`enabled`:`disabled`}),(0,G.jsx)($,{tone:r.tone,children:r.label})]}),(0,G.jsx)(`p`,{className:`button-copy`,children:La(e.task,112)})]})}),Jm=(0,x.memo)(function({run:e,active:t,onClick:n}){return(0,G.jsxs)(`button`,{className:Na(`list-button compact-button`,t&&`active`),type:`button`,onClick:n,children:[(0,G.jsxs)(`div`,{className:`list-button-header`,children:[(0,G.jsx)(`strong`,{children:e.id}),(0,G.jsx)(`span`,{children:Ia(e.createdAt)})]}),(0,G.jsxs)(`div`,{className:`pills compact-pills`,children:[(0,G.jsx)($,{tone:Pa(e.status),children:e.status}),(0,G.jsx)($,{tone:Pa(e.decision),children:e.decision})]}),(0,G.jsx)(`p`,{className:`button-copy muted-copy`,children:La(e.summary,96)})]})}),Ym=(0,x.memo)(function({turn:e,active:t,onClick:n}){return(0,G.jsxs)(`button`,{className:Na(`list-button compact-button`,t&&`active`),type:`button`,onClick:n,children:[(0,G.jsxs)(`div`,{className:`list-button-header`,children:[(0,G.jsx)(`strong`,{children:e.prompt}),(0,G.jsxs)(`span`,{children:[e.steps,` steps`]})]}),(0,G.jsx)(`div`,{className:`pills compact-pills`,children:(0,G.jsx)($,{tone:Pa(e.outcome),children:e.outcome})}),(0,G.jsx)(`p`,{className:`button-copy muted-copy`,children:La(e.summary,110)})]})}),Xm=(0,x.memo)(function({commands:e,empty:t}){return e.length?(0,G.jsx)(`div`,{className:`stack-list compact`,children:e.map(e=>(0,G.jsxs)(`div`,{className:`detail-card`,children:[(0,G.jsx)(`p`,{className:`card-title`,children:e.command}),(0,G.jsxs)(`div`,{className:`pills compact-pills`,children:[(0,G.jsx)($,{children:e.tool}),(0,G.jsxs)($,{tone:e.exitCode===0?`good`:e.exitCode===void 0?void 0:`bad`,children:[`exit `,e.exitCode??`n/a`]})]}),e.stdout?(0,G.jsx)(Om,{children:e.stdout}):null,e.stderr?(0,G.jsx)(Om,{children:e.stderr}):null]},`${e.tool}-${e.command}`))}):(0,G.jsx)(Cm,{title:`No evidence`,body:t})}),Zm=(0,x.memo)(function({message:e}){let t=e.role===`assistant`&&(e.isPending||e.isStreaming),n=e.role===`assistant`?$m(e.text):void 0;return(0,G.jsxs)(`article`,{className:Na(`message`,e.role===`user`?`user`:`assistant`,n&&`tool-result`,t&&`working`),children:[(0,G.jsxs)(`div`,{className:`message-header`,children:[(0,G.jsx)(`span`,{children:e.role===`user`?`You`:n?`Tool result`:`Heddle`}),(0,G.jsxs)(`div`,{className:`pills compact-pills`,children:[n?(0,G.jsx)($,{tone:n.ok===!1?`bad`:`good`,children:n.tool}):null,e.isPending?(0,G.jsx)($,{tone:`warn`,children:`working`}):null,e.isStreaming?(0,G.jsx)($,{children:`live`}):null]})]}),(0,G.jsx)(`div`,{className:Na(`message-body`,e.role===`assistant`&&`markdown-body`),children:n?(0,G.jsx)(Qm,{result:n}):e.role===`assistant`?rh(e.text):e.text})]})});function Qm({result:e}){let t=th(e.output);return(0,G.jsxs)(`div`,{className:`tool-result-body`,children:[(0,G.jsxs)(`div`,{className:`tool-result-meta`,children:[(0,G.jsx)($,{tone:e.ok===!1?`bad`:`good`,children:e.ok===!1?`failed`:`completed`}),e.command?(0,G.jsx)(`span`,{className:`tool-command`,children:e.command}):null]}),e.error?(0,G.jsx)(`p`,{className:`tool-error`,children:e.error}):null,t?(0,G.jsx)(`pre`,{className:`tool-output`,children:t}):(0,G.jsx)(`p`,{className:`muted`,children:`No visible output.`})]})}function $m(e){let t=e.match(/^([a-z][a-z0-9_]*):\s*([\s\S]*)$/);if(!t)return;let[,n,r]=t;if(!nh(n))return;let i=eh(r.trim());if(!i||typeof i!=`object`||Array.isArray(i))return{tool:n,output:r.trim()};let a=i,o=a.output,s=o&&typeof o==`object`&&!Array.isArray(o)?o:void 0;return{tool:n,ok:typeof a.ok==`boolean`?a.ok:void 0,command:typeof s?.command==`string`?s.command:void 0,output:s?.stdout??s?.output??o,error:typeof a.error==`string`?a.error:typeof s?.stderr==`string`&&!s.stdout?s.stderr:void 0}}function eh(e){try{return JSON.parse(e)}catch{return}}function th(e){if(e!=null)return typeof e==`string`?e.trim()||void 0:JSON.stringify(e,null,2)}function nh(e){return[`edit_file`,`edit_memory_note`,`list_files`,`read_file`,`report_state`,`run_shell_inspect`,`run_shell_mutate`,`search_files`,`search_memory_notes`,`update_plan`,`view_image`,`web_search`].includes(e)}function rh(e){let t=e.replace(/\r\n/g,`
51
+ `},Rp=0,zp=[];function Bp(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(Rp++)[0],a=x.useState(cp)[0],o=x.useRef(e);x.useEffect(function(){o.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Lf([e.lockRef.current],(e.shards||[]).map(Fp),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=x.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Np(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Ep(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Ep(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Mp(h,t,e,h===`h`?s:c,!0)},[]),c=x.useCallback(function(e){var n=e;if(!(!zp.length||zp[zp.length-1]!==a)){var r=`deltaY`in n?Pp(n):Np(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ip(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Fp).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=x.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Vp(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=x.useCallback(function(e){n.current=Np(e),r.current=void 0},[]),d=x.useCallback(function(t){l(t.type,Pp(t),t.target,s(t,e.lockRef.current))},[]),f=x.useCallback(function(t){l(t.type,Np(t),t.target,s(t,e.lockRef.current))},[]);x.useEffect(function(){return zp.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,xp),document.addEventListener(`touchmove`,c,xp),document.addEventListener(`touchstart`,u,xp),function(){zp=zp.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,xp),document.removeEventListener(`touchmove`,c,xp),document.removeEventListener(`touchstart`,u,xp)}},[]);var p=e.removeScrollBar,m=e.inert;return x.createElement(x.Fragment,null,m?x.createElement(a,{styles:Lp(i)}):null,p?x.createElement(vp,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Vp(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Hp=Zf(Qf,Bp),Up=x.forwardRef(function(e,t){return x.createElement(ep,Ff({},e,{ref:t,sideCar:Hp}))});Up.classNames=ep.classNames;var Wp=`Popover`,[Gp,Kp]=Ls(Wp,[ku]),qp=ku(),[Jp,Yp]=Gp(Wp),Xp=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=qp(t),c=x.useRef(null),[l,u]=x.useState(!1),[d,f]=ad({prop:r,defaultProp:i??!1,onChange:a,caller:Wp});return(0,G.jsx)(Gu,{...s,children:(0,G.jsx)(Jp,{scope:t,contentId:mc(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:x.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:x.useCallback(()=>u(!0),[]),onCustomAnchorRemove:x.useCallback(()=>u(!1),[]),modal:o,children:n})})};Xp.displayName=Wp;var Zp=`PopoverAnchor`,Qp=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Yp(Zp,n),a=qp(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return x.useEffect(()=>(o(),()=>s()),[o,s]),(0,G.jsx)(Ku,{...a,...r,ref:t})});Qp.displayName=Zp;var $p=`PopoverTrigger`,em=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Yp($p,n),a=qp(n),o=Cs(t,i.triggerRef),s=(0,G.jsx)(Ks.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":hm(i.open),...r,ref:o,onClick:Is(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,G.jsx)(Ku,{asChild:!0,...a,children:s})});em.displayName=$p;var tm=`PopoverPortal`,[nm,rm]=Gp(tm,{forceMount:void 0}),im=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Yp(tm,t);return(0,G.jsx)(nm,{scope:t,forceMount:n,children:(0,G.jsx)(Qu,{present:n||a.open,children:(0,G.jsx)(Xu,{asChild:!0,container:i,children:r})})})};im.displayName=tm;var am=`PopoverContent`,om=x.forwardRef((e,t)=>{let n=rm(am,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Yp(am,e.__scopePopover);return(0,G.jsx)(Qu,{present:r||a.open,children:a.modal?(0,G.jsx)(cm,{...i,ref:t}):(0,G.jsx)(lm,{...i,ref:t})})});om.displayName=am;var sm=bf(`PopoverContent.RemoveScroll`),cm=x.forwardRef((e,t)=>{let n=Yp(am,e.__scopePopover),r=x.useRef(null),i=Cs(t,r),a=x.useRef(!1);return x.useEffect(()=>{let e=r.current;if(e)return Pf(e)},[]),(0,G.jsx)(Up,{as:sm,allowPinchZoom:!0,children:(0,G.jsx)(um,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Is(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Is(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:Is(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),lm=x.forwardRef((e,t)=>{let n=Yp(am,e.__scopePopover),r=x.useRef(!1),i=x.useRef(!1);return(0,G.jsx)(um,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),um=x.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=Yp(am,n),p=qp(n);return tf(),(0,G.jsx)(cf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,G.jsx)(nc,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,G.jsx)(qu,{"data-state":hm(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),dm=`PopoverClose`,fm=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Yp(dm,n);return(0,G.jsx)(Ks.button,{type:`button`,...r,ref:t,onClick:Is(e.onClick,()=>i.onOpenChange(!1))})});fm.displayName=dm;var pm=`PopoverArrow`,mm=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=qp(n);return(0,G.jsx)(Ju,{...i,...r,ref:t})});mm.displayName=pm;function hm(e){return e?`open`:`closed`}var gm=im,_m=om,vm=x.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,G.jsx)(gm,{children:(0,G.jsx)(_m,{ref:i,align:t,sideOffset:n,className:vs(`z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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 origin-[--radix-popover-content-transform-origin]`,e),...r})}));vm.displayName=_m.displayName;var ym=45e3;function bm(e){if(!e?.runtimeHost)return{state:`local`,label:`Local control plane`,badgeLabel:`Local`,detail:`No daemon ownership metadata is loaded in this control-plane session.`,tone:`outline`};let t=e.runtimeHost.workspaceOwner?.lastSeenAt,n=xm(t),r=`${e.runtimeHost.endpoint.host}:${e.runtimeHost.endpoint.port}`;return n?{state:`stale`,label:`Daemon unreachable`,badgeLabel:`Stale daemon`,detail:t?`The last daemon heartbeat is stale for ${e.workspace.name}. Refresh state or restart the daemon before trusting live runtime status.`:`The daemon owner for ${e.workspace.name} is not reporting a recent heartbeat.`,tone:`destructive`,endpoint:r,ownerId:e.runtimeHost.ownerId,lastSeenAt:t}:{state:`attached`,label:`Attached to daemon`,badgeLabel:`Daemon`,detail:`Sessions and tasks are reading daemon-owned runtime state for ${e.workspace.name}.`,tone:`secondary`,endpoint:r,ownerId:e.runtimeHost.ownerId,lastSeenAt:t}}function xm(e){if(!e)return!1;let t=Date.parse(e);return Number.isFinite(t)?Date.now()-t>ym:!1}function Sm({title:e,children:t,wide:n=!1,panelClassName:r}){return(0,G.jsxs)(`section`,{className:Na(`panel`,n&&`wide`,r),children:[(0,G.jsx)(`h2`,{children:e}),t]})}function Cm({title:e,body:t}){return(0,G.jsxs)(`div`,{className:`empty-state`,children:[(0,G.jsx)(`strong`,{children:e}),(0,G.jsx)(`p`,{className:`muted`,children:t})]})}function wm({error:e,state:t}){return e?(0,G.jsxs)(`aside`,{className:`status-badge bad`,children:[`Error: `,e]}):t?(0,G.jsxs)(`aside`,{className:`status-badge`,children:[t.sessions.length,` sessions · `,t.heartbeat.tasks.length,` tasks`]}):(0,G.jsx)(`aside`,{className:`status-badge`,children:`Connecting...`})}function Tm({state:e,onRefresh:t}){let n=bm(e);return(0,G.jsxs)(`section`,{className:`mx-4 mt-4 flex min-w-0 flex-col gap-3 rounded-xl border border-border bg-card/95 px-4 py-3 shadow-sm sm:mx-5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`p`,{className:`truncate text-sm font-semibold text-foreground`,children:n.label}),(0,G.jsx)(K,{variant:n.tone,className:`w-fit shrink-0`,children:e?.workspace.name??`workspace`})]}),(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n.detail})]}),t?(0,G.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:t,children:`Refresh state`}):null]}),n.endpoint||n.ownerId||n.lastSeenAt?(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[n.endpoint?(0,G.jsxs)(`span`,{children:[`endpoint=`,n.endpoint]}):null,n.ownerId?(0,G.jsxs)(`span`,{children:[`owner=`,n.ownerId]}):null,n.lastSeenAt?(0,G.jsxs)(`span`,{children:[`last seen=`,new Date(n.lastSeenAt).toLocaleTimeString()]}):null]}):null]})}function Em({state:e}){return e?(0,G.jsxs)(`span`,{className:`workspace-path-label`,children:[e.workspace.name,(0,G.jsxs)(`span`,{className:`muted`,children:[` · `,Ra(e.workspace.anchorRoot)]})]}):null}function Dm({state:e,disabled:t,onSelect:n}){return!e||e.workspaces.length<=1?null:(0,G.jsxs)(`label`,{className:`workspace-switcher`,children:[(0,G.jsx)(`span`,{className:`muted`,children:`Workspace`}),(0,G.jsx)(`select`,{value:e.activeWorkspaceId,disabled:t,onChange:e=>n(e.target.value),"data-testid":`workspace-switcher`,children:e.workspaces.map(e=>(0,G.jsx)(`option`,{value:e.id,children:e.name},e.id))})]})}function $({children:e,tone:t}){return(0,G.jsx)(`span`,{className:Na(`pill`,t),children:e})}function Om({children:e}){return(0,G.jsx)(`pre`,{className:`code-block`,children:e})}function km({title:e,subtitle:t,actions:n}){return(0,G.jsxs)(`header`,{className:`workspace-header`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{children:e}),(0,G.jsx)(`p`,{className:`muted`,children:t})]}),n]})}function Am({title:e,actions:t,children:n,testId:r}){return(0,G.jsxs)(`section`,{className:`side-section`,"data-testid":r,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`h3`,{children:e}),t]}),n]})}function jm({state:e,error:t,activeSection:n,sessionPath:r,children:i,onRefresh:a,onSetActiveWorkspace:o,onCaptureDebugSnapshot:s}){let c=bm(e);return(0,G.jsxs)(`main`,{className:`app-shell`,children:[(0,G.jsxs)(`header`,{className:`toolbar`,children:[(0,G.jsxs)(`nav`,{className:`tabs toolbar-tabs`,"aria-label":`Control plane sections`,children:[(0,G.jsx)(Mm,{active:n===`overview`,to:`/overview`,children:`Overview`}),(0,G.jsx)(Mm,{active:n===`sessions`,to:r,children:`Sessions`}),(0,G.jsx)(Mm,{active:n===`tasks`,to:`/tasks`,children:`Tasks`}),(0,G.jsx)(Mm,{active:n===`workspaces`,to:`/workspaces`,children:`Workspaces`})]}),(0,G.jsxs)(`div`,{className:`toolbar-status`,children:[(0,G.jsx)(`div`,{className:`toolbar-actions`,children:(0,G.jsx)(Nm,{onCapture:s})}),(0,G.jsxs)(`div`,{className:`topbar-title-row`,children:[(0,G.jsx)(`p`,{className:`topbar-eyebrow`,children:`Heddle Control Plane`}),(0,G.jsx)(Dm,{state:e,onSelect:o}),(0,G.jsx)(Em,{state:e})]}),(0,G.jsx)(wm,{error:t,state:e})]})]}),t||c.state===`stale`?(0,G.jsx)(Tm,{state:e,onRefresh:a}):null,i]})}function Mm({active:e,to:t,children:n}){return(0,G.jsx)(Sn,{className:`tab-button ${e?`active`:``}`,to:t,"aria-current":e?`page`:void 0,"data-testid":`nav-${n.toLowerCase()}`,children:n})}function Nm({onCapture:e}){return(0,G.jsxs)(`details`,{className:`debug-snapshot-menu`,children:[(0,G.jsx)(`summary`,{className:`debug-button`,children:`Snapshot`}),(0,G.jsxs)(`div`,{className:`debug-snapshot-options`,role:`menu`,"aria-label":`Debug layout snapshot options`,children:[(0,G.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>e(`none`),children:`DOM + layout only`}),(0,G.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>e(`auto`),children:`Include screenshot`})]})]})}var Pm=[{value:`overview`,label:`Overview`},{value:`sessions`,label:`Sessions`},{value:`tasks`,label:`Tasks`},{value:`workspaces`,label:`Workspaces`}];function Fm({section:e,onSectionChange:t,state:n,error:r,children:i,onCaptureDebugSnapshot:a,onSetActiveWorkspace:o,onRefresh:s}){let c=r?{state:`stale`,label:`Error`,badgeLabel:`Error`,detail:r,tone:`destructive`,endpoint:void 0}:bm(n);return(0,G.jsxs)(`main`,{className:`flex h-dvh flex-col overflow-hidden bg-background pt-[env(safe-area-inset-top)] text-foreground`,children:[(0,G.jsxs)(`header`,{className:`shrink-0 border-b border-border bg-card/95 px-4 py-3`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-2`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,G.jsx)(`span`,{className:`text-xs font-semibold tracking-normal text-foreground`,children:`Heddle`})}),(0,G.jsx)(`p`,{className:`m-0 truncate text-xs leading-5 text-muted-foreground`,children:n?`${n.workspace.name} · ${Ra(n.workspace.anchorRoot)}`:`Reading workspace state`}),n&&n.workspaces.length>1&&o?(0,G.jsxs)(`label`,{className:`mt-1 flex items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{children:`Workspace`}),(0,G.jsx)(`select`,{className:`h-7 min-w-0 rounded-md border border-border bg-background px-2 text-[11px] text-foreground`,value:n.activeWorkspaceId,onChange:e=>o(e.target.value),children:n.workspaces.map(e=>(0,G.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}):null]}),(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:a?(0,G.jsx)(Im,{onCapture:a}):null})]}),r||c.state===`stale`?(0,G.jsxs)(`div`,{className:`mt-2 flex min-w-0 flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`truncate`,children:c.detail}),c.endpoint?(0,G.jsxs)(`span`,{className:`shrink-0`,children:[`endpoint=`,c.endpoint]}):null,s?(0,G.jsx)(`button`,{type:`button`,className:`text-[11px] text-accent`,onClick:s,children:`Refresh`}):null]}):null]}),(0,G.jsx)(`section`,{className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto bg-background`,children:i}),(0,G.jsx)(`nav`,{className:`grid shrink-0 grid-cols-4 gap-1 border-t border-border bg-card/95 px-3 py-2 pb-[calc(env(safe-area-inset-bottom)+0.5rem)]`,"aria-label":`Control plane sections`,children:Pm.map(n=>(0,G.jsx)(q,{type:`button`,variant:e===n.value?`secondary`:`ghost`,size:`sm`,className:`h-9 rounded-md px-2 text-xs`,onClick:()=>t(n.value),"aria-current":e===n.value?`page`:void 0,"data-testid":`mobile-nav-${n.value}`,children:n.label},n.value))})]})}function Im({onCapture:e}){return(0,G.jsxs)(`details`,{className:`relative`,children:[(0,G.jsx)(`summary`,{className:`flex h-10 cursor-pointer list-none items-center rounded-md border border-border bg-secondary px-3 text-xs font-medium text-secondary-foreground marker:hidden`,children:`Snapshot`}),(0,G.jsxs)(`div`,{className:`absolute right-0 top-11 z-50 grid min-w-44 gap-1 rounded-md border border-border bg-popover p-1 shadow-lg`,children:[(0,G.jsx)(`button`,{type:`button`,className:`rounded-md px-3 py-2 text-left text-xs text-popover-foreground hover:bg-accent hover:text-accent-foreground`,onClick:()=>e(`none`),children:`DOM only`}),(0,G.jsx)(`button`,{type:`button`,className:`rounded-md px-3 py-2 text-left text-xs text-popover-foreground hover:bg-accent hover:text-accent-foreground`,onClick:()=>e(`auto`),children:`With screenshot`})]})]})}function Lm({state:e}){let t=(0,x.useMemo)(()=>e.sessions.slice(0,3),[e.sessions]),n=(0,x.useMemo)(()=>e.heartbeat.runs.slice(0,3),[e.heartbeat.runs]),r=(0,x.useMemo)(()=>e.memory.runs.latest.slice(0,3),[e.memory.runs.latest]),i=bm(e);return(0,G.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-x-hidden overflow-y-auto px-3 pt-3 pb-[calc(env(safe-area-inset-bottom)+5.5rem)] sm:px-4 sm:pt-4 sm:pb-4`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 grid gap-4 lg:grid-cols-2`,children:[(0,G.jsxs)(Rm,{className:`lg:col-span-1`,"data-testid":`overview-active-workspace`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Active workspace`}),(0,G.jsx)(`h2`,{className:`text-xl font-semibold text-foreground`,children:e.workspace.name}),(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:Ra(e.workspace.anchorRoot)})]}),(0,G.jsx)(K,{variant:`secondary`,className:`w-fit max-w-full truncate`,children:e.workspace.id})]}),(0,G.jsxs)(`div`,{className:`mt-4 grid grid-cols-3 gap-3`,children:[(0,G.jsx)(zm,{label:`Repos`,value:za(e.workspace.repoRoots.length)}),(0,G.jsx)(zm,{label:`Sessions`,value:za(e.sessions.length)}),(0,G.jsx)(zm,{label:`Tasks`,value:za(e.heartbeat.tasks.length)})]}),(0,G.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-sm`,children:[(0,G.jsx)(Bm,{label:`Workspace path`,children:e.workspace.anchorRoot}),(0,G.jsx)(Bm,{label:`State path`,children:e.workspace.stateRoot})]})]}),(0,G.jsxs)(Rm,{className:`lg:col-span-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Runtime host`}),(0,G.jsx)(`h2`,{className:`text-xl font-semibold text-foreground`,children:i.label}),(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i.detail})]}),(0,G.jsx)(K,{variant:i.tone,className:`w-fit max-w-full truncate`,children:i.state})]}),e.runtimeHost?(0,G.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-sm`,children:[(0,G.jsxs)(Bm,{label:`Endpoint`,children:[e.runtimeHost.endpoint.host,`:`,e.runtimeHost.endpoint.port]}),(0,G.jsx)(Bm,{label:`Owner`,children:e.runtimeHost.ownerId}),(0,G.jsx)(Bm,{label:`Last seen`,children:e.runtimeHost.workspaceOwner?.lastSeenAt??`unknown`}),(0,G.jsx)(Bm,{label:`Registry`,children:e.runtimeHost.registryPath})]}):(0,G.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:`Daemon metadata is not loaded in this control-plane session.`})]})]}),(0,G.jsxs)(`div`,{className:`min-w-0 grid gap-4 xl:grid-cols-3`,children:[(0,G.jsxs)(Rm,{className:`min-h-0`,"data-testid":`overview-memory-health`,children:[(0,G.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Recent sessions`}),(0,G.jsx)(`h2`,{className:`text-xl font-semibold text-foreground`,children:`Latest conversations`})]}),(0,G.jsxs)(K,{variant:`outline`,children:[za(e.sessions.length),` total`]})]}),t.length?(0,G.jsx)(`div`,{className:`space-y-3`,children:t.map(e=>(0,G.jsx)(Vm,{session:e},e.id))}):(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No saved sessions yet.`}),e.sessions.length>t.length?(0,G.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:`Open Sessions to browse the full conversation catalog.`}):null]}),(0,G.jsxs)(Rm,{className:`min-h-0`,children:[(0,G.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Recent task runs`}),(0,G.jsx)(`h2`,{className:`text-xl font-semibold text-foreground`,children:`Heartbeat activity`})]}),(0,G.jsxs)(K,{variant:`outline`,children:[za(e.heartbeat.tasks.length),` tasks`]})]}),n.length?(0,G.jsx)(`div`,{className:`space-y-3`,children:n.map(e=>(0,G.jsx)(Hm,{run:e},e.id))}):(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No heartbeat runs recorded yet.`}),e.heartbeat.runs.length>n.length?(0,G.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:`Open Tasks to inspect the full run history.`}):null]}),(0,G.jsxs)(Rm,{className:`min-h-0`,children:[(0,G.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Workspace memory`}),(0,G.jsx)(`h2`,{className:`text-xl font-semibold text-foreground`,children:`Catalog health`})]}),(0,G.jsx)(K,{variant:e.memory.catalog.ok?`secondary`:`destructive`,children:e.memory.catalog.ok?`ok`:`attention`})]}),(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,G.jsx)(zm,{label:`Notes`,value:za(e.memory.notes.count)}),(0,G.jsx)(zm,{label:`Pending`,value:za(e.memory.candidates.pending)})]}),e.memory.catalog.missing.length?(0,G.jsxs)(`div`,{className:`mt-4 rounded-xl border border-border bg-background/60 p-3`,children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Missing catalogs`}),(0,G.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e.memory.catalog.missing.slice(0,4).join(`, `)})]}):null,r.length?(0,G.jsx)(`div`,{className:`mt-4 space-y-3`,children:r.map(e=>(0,G.jsx)(Um,{run:e},e.id))}):(0,G.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:`No memory maintenance runs recorded yet.`})]})]})]})}function Rm({children:e,className:t=``,...n}){return(0,G.jsx)(`section`,{className:`min-w-0 rounded-2xl border border-border bg-card/95 p-4 shadow-sm sm:p-5 ${t}`,...n,children:e})}function zm({label:e,value:t}){return(0,G.jsxs)(`div`,{className:`min-w-0 rounded-xl border border-border bg-background/60 p-3`,children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:e}),(0,G.jsx)(`p`,{className:`mt-2 text-3xl font-semibold leading-none text-foreground sm:text-4xl`,children:t})]})}function Bm({label:e,children:t}){return(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`dt`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:e}),(0,G.jsx)(`dd`,{className:`break-all text-sm text-foreground`,children:t})]})}function Vm({session:e}){return(0,G.jsxs)(`article`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`h3`,{className:`truncate text-base font-semibold text-foreground`,children:e.name}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:Ia(e.updatedAt)})]}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-2 sm:max-w-[48%] sm:justify-end`,children:[(0,G.jsx)(K,{variant:`outline`,className:`max-w-full truncate`,children:e.model??`unset model`}),(0,G.jsxs)(K,{variant:`secondary`,className:`w-fit`,children:[e.turnCount,` turns`]})]})]}),e.lastSummary?(0,G.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:La(e.lastSummary,120)}):null]})}function Hm({run:e}){return(0,G.jsxs)(`article`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`h3`,{className:`truncate text-base font-semibold text-foreground`,children:e.id}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:Ia(e.createdAt)})]}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-2 sm:max-w-[48%] sm:justify-end`,children:[(0,G.jsx)(Wm,{value:e.status}),(0,G.jsx)(Wm,{value:e.decision})]})]}),(0,G.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:La(e.summary,132)})]})}function Um({run:e}){return(0,G.jsxs)(`article`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`h3`,{className:`truncate text-base font-semibold text-foreground`,children:e.id}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:Ia(e.finishedAt)})]}),(0,G.jsx)(Wm,{value:e.outcome})]}),(0,G.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:La(e.summary,132)})]})}function Wm({value:e}){let t=Pa(e);return t===`good`?(0,G.jsx)(K,{className:`max-w-full truncate border-emerald-400/45 bg-emerald-950/90 text-emerald-50`,children:e}):t===`warn`?(0,G.jsx)(K,{className:`max-w-full truncate border-cyan-400/40 bg-primary/5 text-foreground`,children:e}):t===`bad`?(0,G.jsx)(K,{className:`max-w-full truncate border-red-300/45 bg-red-950/92 text-red-50`,children:e}):(0,G.jsx)(K,{variant:`outline`,className:`max-w-full truncate`,children:e})}var Gm=(0,x.memo)(function({session:e,active:t,onClick:n}){return(0,G.jsxs)(`button`,{className:Na(`list-button`,t&&`active`),type:`button`,onClick:n,children:[(0,G.jsxs)(`div`,{className:`list-button-header`,children:[(0,G.jsx)(`strong`,{children:e.name}),(0,G.jsx)(`span`,{children:Ia(e.updatedAt)})]}),(0,G.jsxs)(`div`,{className:`pills compact-pills`,children:[(0,G.jsx)($,{children:e.model??`unset model`}),(0,G.jsxs)($,{children:[`turns `,e.turnCount]})]}),e.lastPrompt?(0,G.jsxs)(`p`,{className:`button-copy`,children:[(0,G.jsx)(`strong`,{children:`Prompt:`}),` `,La(e.lastPrompt,88)]}):null,e.lastSummary?(0,G.jsx)(`p`,{className:`button-copy muted-copy`,children:La(e.lastSummary,120)}):null]})}),Km=(0,x.memo)(function({task:e,active:t,onClick:n}){let r=Ha(e);return(0,G.jsxs)(`button`,{className:Na(`list-button`,t&&`active`),type:`button`,onClick:n,children:[(0,G.jsxs)(`div`,{className:`list-button-header`,children:[(0,G.jsx)(`strong`,{children:e.name||e.taskId}),(0,G.jsx)(`span`,{children:Ia(e.nextRunAt)})]}),(0,G.jsxs)(`div`,{className:`pills compact-pills`,children:[(0,G.jsx)($,{tone:e.enabled?`good`:void 0,children:e.enabled?`enabled`:`disabled`}),(0,G.jsx)($,{tone:r.tone,children:r.label})]}),(0,G.jsx)(`p`,{className:`button-copy`,children:La(e.task,112)})]})}),qm=(0,x.memo)(function({run:e,active:t,onClick:n}){return(0,G.jsxs)(`button`,{className:Na(`list-button compact-button`,t&&`active`),type:`button`,onClick:n,children:[(0,G.jsxs)(`div`,{className:`list-button-header`,children:[(0,G.jsx)(`strong`,{children:e.id}),(0,G.jsx)(`span`,{children:Ia(e.createdAt)})]}),(0,G.jsxs)(`div`,{className:`pills compact-pills`,children:[(0,G.jsx)($,{tone:Pa(e.status),children:e.status}),(0,G.jsx)($,{tone:Pa(e.decision),children:e.decision})]}),(0,G.jsx)(`p`,{className:`button-copy muted-copy`,children:La(e.summary,96)})]})}),Jm=(0,x.memo)(function({turn:e,active:t,onClick:n}){return(0,G.jsxs)(`button`,{className:Na(`list-button compact-button`,t&&`active`),type:`button`,onClick:n,children:[(0,G.jsxs)(`div`,{className:`list-button-header`,children:[(0,G.jsx)(`strong`,{children:e.prompt}),(0,G.jsxs)(`span`,{children:[e.steps,` steps`]})]}),(0,G.jsx)(`div`,{className:`pills compact-pills`,children:(0,G.jsx)($,{tone:Pa(e.outcome),children:e.outcome})}),(0,G.jsx)(`p`,{className:`button-copy muted-copy`,children:La(e.summary,110)})]})}),Ym=(0,x.memo)(function({commands:e,empty:t}){return e.length?(0,G.jsx)(`div`,{className:`stack-list compact`,children:e.map(e=>(0,G.jsxs)(`div`,{className:`detail-card`,children:[(0,G.jsx)(`p`,{className:`card-title`,children:e.command}),(0,G.jsxs)(`div`,{className:`pills compact-pills`,children:[(0,G.jsx)($,{children:e.tool}),(0,G.jsxs)($,{tone:e.exitCode===0?`good`:e.exitCode===void 0?void 0:`bad`,children:[`exit `,e.exitCode??`n/a`]})]}),e.stdout?(0,G.jsx)(Om,{children:e.stdout}):null,e.stderr?(0,G.jsx)(Om,{children:e.stderr}):null]},`${e.tool}-${e.command}`))}):(0,G.jsx)(Cm,{title:`No evidence`,body:t})}),Xm=(0,x.memo)(function({message:e}){let t=e.role===`assistant`&&(e.isPending||e.isStreaming),n=e.role===`assistant`?Qm(e.text):void 0;return(0,G.jsxs)(`article`,{className:Na(`message`,e.role===`user`?`user`:`assistant`,n&&`tool-result`,t&&`working`),children:[(0,G.jsxs)(`div`,{className:`message-header`,children:[(0,G.jsx)(`span`,{children:e.role===`user`?`You`:n?`Tool result`:`Heddle`}),(0,G.jsxs)(`div`,{className:`pills compact-pills`,children:[n?(0,G.jsx)($,{tone:n.ok===!1?`bad`:`good`,children:n.tool}):null,e.isPending?(0,G.jsx)($,{tone:`warn`,children:`working`}):null,e.isStreaming?(0,G.jsx)($,{children:`live`}):null]})]}),(0,G.jsx)(`div`,{className:Na(`message-body`,e.role===`assistant`&&`markdown-body`),children:n?(0,G.jsx)(Zm,{result:n}):e.role===`assistant`?nh(e.text):e.text})]})});function Zm({result:e}){let t=eh(e.output);return(0,G.jsxs)(`div`,{className:`tool-result-body`,children:[(0,G.jsxs)(`div`,{className:`tool-result-meta`,children:[(0,G.jsx)($,{tone:e.ok===!1?`bad`:`good`,children:e.ok===!1?`failed`:`completed`}),e.command?(0,G.jsx)(`span`,{className:`tool-command`,children:e.command}):null]}),e.error?(0,G.jsx)(`p`,{className:`tool-error`,children:e.error}):null,t?(0,G.jsx)(`pre`,{className:`tool-output`,children:t}):(0,G.jsx)(`p`,{className:`muted`,children:`No visible output.`})]})}function Qm(e){let t=e.match(/^([a-z][a-z0-9_]*):\s*([\s\S]*)$/);if(!t)return;let[,n,r]=t;if(!th(n))return;let i=$m(r.trim());if(!i||typeof i!=`object`||Array.isArray(i))return{tool:n,output:r.trim()};let a=i,o=a.output,s=o&&typeof o==`object`&&!Array.isArray(o)?o:void 0;return{tool:n,ok:typeof a.ok==`boolean`?a.ok:void 0,command:typeof s?.command==`string`?s.command:void 0,output:s?.stdout??s?.output??o,error:typeof a.error==`string`?a.error:typeof s?.stderr==`string`&&!s.stdout?s.stderr:void 0}}function $m(e){try{return JSON.parse(e)}catch{return}}function eh(e){if(e!=null)return typeof e==`string`?e.trim()||void 0:JSON.stringify(e,null,2)}function th(e){return[`edit_file`,`edit_memory_note`,`list_files`,`read_file`,`report_state`,`run_shell_inspect`,`run_shell_mutate`,`search_files`,`search_memory_notes`,`update_plan`,`view_image`,`web_search`].includes(e)}function nh(e){let t=e.replace(/\r\n/g,`
52
52
  `).split(`
53
- `),n=[],r=[],i=[],a=[],o=null,s=()=>{r.length&&(n.push((0,G.jsx)(`p`,{children:ih(r.join(` `))},`p-${n.length}`)),r=[])},c=()=>{i.length&&(n.push((0,G.jsx)(`ul`,{children:i.map((e,t)=>(0,G.jsxs)(`li`,{children:[typeof e.checked==`boolean`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:e.checked,readOnly:!0,disabled:!0}),` `]}):null,ih(e.content)]},t))},`ul-${n.length}`)),i=[])},l=()=>{a.length&&(n.push((0,G.jsx)(`ol`,{children:a.map((e,t)=>(0,G.jsx)(`li`,{children:ih(e)},t))},`ol-${n.length}`)),a=[])},u=()=>{o&&=(n.push((0,G.jsx)(`pre`,{className:`code-block`,children:(0,G.jsx)(`code`,{children:o.join(`
54
- `)})},`code-${n.length}`)),null)};for(let e of t){if(e.trim().startsWith("```")){s(),c(),l(),o?u():o=[];continue}if(o){o.push(e);continue}let t=e.match(/^(#{1,4})\s+(.*)$/);if(t){s(),c(),l();let e=t[1].length,r=ih(t[2]??``);e===1?n.push((0,G.jsx)(`h1`,{children:r},`h1-${n.length}`)):e===2?n.push((0,G.jsx)(`h2`,{children:r},`h2-${n.length}`)):e===3?n.push((0,G.jsx)(`h3`,{children:r},`h3-${n.length}`)):n.push((0,G.jsx)(`h4`,{children:r},`h4-${n.length}`));continue}let d=e.match(/^[-*]\s+\[( |x|X)\]\s+(.*)$/);if(d){s(),l(),i.push({checked:d[1].toLowerCase()===`x`,content:d[2]??``});continue}let f=e.match(/^[-*]\s+(.*)$/);if(f){s(),l(),i.push({content:f[1]??``});continue}let p=e.match(/^\d+\.\s+(.*)$/);if(p){s(),c(),a.push(p[1]??``);continue}if(!e.trim()){s(),c(),l();continue}r.push(e.trim())}return s(),c(),l(),u(),n.length?n:e}function ih(e){let t=[],n=/`([^`]+)`/g,r=0,i;for(;(i=n.exec(e))!==null;)i.index>r&&t.push(e.slice(r,i.index)),t.push((0,G.jsx)(`code`,{className:`inline-code`,children:i[1]},`code-${i.index}`)),r=i.index+i[0].length;return r<e.length&&t.push(e.slice(r)),t.map((e,t)=>(0,G.jsx)(x.Fragment,{children:e},t))}var ah=x.forwardRef(({className:e,...t},n)=>(0,G.jsx)(`textarea`,{className:vs(`flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:n,...t}));ah.displayName=`Textarea`;function oh({activeView:e,title:t,subtitle:n,onBackToSessions:r,onOpenChat:i,onOpenReview:a}){return(0,G.jsxs)(`header`,{className:`shrink-0 border-b border-border bg-card px-3 py-2`,children:[(0,G.jsxs)(`div`,{className:`grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2`,children:[(0,G.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs`,onClick:r,children:`‹ Sessions`}),(0,G.jsxs)(`div`,{className:`min-w-0 text-center`,children:[(0,G.jsx)(`h2`,{className:`m-0 truncate text-sm font-semibold leading-5 tracking-normal`,children:t}),n?(0,G.jsx)(`p`,{className:`m-0 truncate text-xs leading-4 text-muted-foreground`,children:n}):null]}),(0,G.jsx)(`div`,{className:`w-[76px]`,"aria-hidden":`true`})]}),(0,G.jsxs)(`nav`,{className:`mt-2 grid grid-cols-2 rounded-md bg-muted p-1`,"aria-label":`Session views`,children:[(0,G.jsx)(sh,{active:e===`chat`,onClick:i,children:`Chat`}),(0,G.jsx)(sh,{active:e===`review`,onClick:a,children:`Review`})]})]})}function sh({active:e,onClick:t,children:n}){return(0,G.jsx)(`button`,{type:`button`,className:vs(`h-8 rounded-md text-xs font-medium text-muted-foreground transition-colors`,e&&`bg-background text-foreground shadow-sm`),"aria-current":e?`page`:void 0,onClick:t,children:n})}var ch=new Set([`run_shell_mutate`,`edit_file`,`write_to_file`,`delete_file`,`apply_patch`]);function lh({approval:e,open:t,onOpenChange:n,onResolve:r}){if(!e||!t)return null;let i=ch.has(e.tool)?`high`:`medium`,a=uh(e.input),o=dh(e.input),s=ph(e.input);return(0,G.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-end`,role:`dialog`,"aria-modal":`true`,"aria-label":`Pending approval details`,children:[(0,G.jsx)(`button`,{type:`button`,className:`absolute inset-0 bg-black/45`,"aria-label":`Close approval details`,onClick:()=>n(!1)}),(0,G.jsxs)(`section`,{className:`relative z-10 flex max-h-[82dvh] w-full flex-col rounded-t-2xl border border-border bg-card`,children:[(0,G.jsx)(`header`,{className:`shrink-0 border-b border-border px-3 py-3`,children:(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`p`,{className:`m-0 text-sm font-semibold`,children:[`Approval required: `,e.tool]}),(0,G.jsxs)(`p`,{className:`m-0 mt-1 truncate text-xs text-muted-foreground`,children:[`Call ID: `,e.callId]}),(0,G.jsxs)(`p`,{className:`m-0 mt-1 truncate text-xs text-muted-foreground`,children:[`Requested: `,new Date(e.requestedAt).toLocaleString()]})]}),(0,G.jsxs)(K,{variant:i===`high`?`destructive`:`secondary`,children:[i,` risk`]})]})}),(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-3`,children:[(0,G.jsxs)(`dl`,{className:`grid gap-2 text-xs`,children:[(0,G.jsxs)(`div`,{className:`rounded-md border border-border bg-background px-2 py-2`,children:[(0,G.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Path target`}),(0,G.jsx)(`dd`,{className:`m-0 mt-1 break-all text-muted-foreground`,children:a??`No explicit path in payload`})]}),(0,G.jsxs)(`div`,{className:`rounded-md border border-border bg-background px-2 py-2`,children:[(0,G.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Command target`}),(0,G.jsx)(`dd`,{className:`m-0 mt-1 break-all text-muted-foreground`,children:o??`No explicit command in payload`})]})]}),(0,G.jsxs)(`div`,{className:`mt-3 rounded-md border border-border bg-background`,children:[(0,G.jsx)(`div`,{className:`border-b border-border px-2 py-2 text-xs font-medium`,children:`Raw payload`}),(0,G.jsx)(`pre`,{className:`m-0 max-h-[34dvh] overflow-auto whitespace-pre-wrap break-words px-2 py-2 text-[11px] leading-4 text-muted-foreground`,children:s})]})]}),(0,G.jsx)(`footer`,{className:`sticky bottom-0 z-10 shrink-0 border-t border-border bg-card px-3 py-3 pb-[calc(env(safe-area-inset-bottom)+0.75rem)]`,children:(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,G.jsx)(q,{type:`button`,className:`h-11`,onClick:()=>r(!0),children:`Approve`}),(0,G.jsx)(q,{type:`button`,variant:`outline`,className:`h-11`,onClick:()=>r(!1),children:`Deny`})]})})]})]})}function uh(e){let t=fh(e,[`targetFile`,`file_path`,`filePath`,`path`,`paths`,`absolute_path`]);if(t)return t}function dh(e){return fh(e,[`command`,`CommandLine`,`cmd`])}function fh(e,t){if(!(!e||typeof e!=`object`))for(let n of t){let t=e[n];if(typeof t==`string`&&t.trim())return t;if(Array.isArray(t)){let e=t.filter(e=>typeof e==`string`&&!!e.trim());if(e.length>0)return e.slice(0,3).join(`, `)}}}function ph(e){if(e===void 0)return`No payload provided.`;try{return JSON.stringify(e,null,2)??String(e)}catch{return String(e)}}function mh({activeSession:e,sessionDetail:t,sessionDetailLoading:n,sessionDetailError:r,selectedSessionId:i,runActive:a,runInFlight:o,memoryUpdating:s,sendPromptError:c,sessionNotice:l,draft:u,pendingApproval:d,conversationScrollRef:f,textareaRef:p,mentionMenu:m,renderMessage:h,onDraftChange:g,onComposerKeyDown:_,onBackToSessions:v,onOpenReview:y,onSubmitPrompt:b,onContinueSession:S,onCancelSessionRun:C,onResolveApproval:w}){let T=!!(i&&!a&&u.trim()),E=!!(i&&!a&&t?.lastContinuePrompt),D=t?.name??e?.name??`Chat session`,O=(t?.context?.compactionStatus??e?.context?.compactionStatus)===`running`,[ee,k]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{d||k(!1)},[d]),(0,G.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col bg-background`,children:[(0,G.jsx)(oh,{activeView:`chat`,title:D,subtitle:e?`updated ${Fa(e.updatedAt)}`:`Pick a session`,onBackToSessions:v,onOpenChat:()=>void 0,onOpenReview:y}),(0,G.jsx)(`div`,{ref:f,className:`min-h-0 flex-1 overflow-y-auto px-3 py-3`,children:(0,G.jsx)(`div`,{className:`flex min-h-full flex-col justify-end gap-3`,children:n?(0,G.jsx)(vh,{title:`Loading session`,body:`Fetching conversation state.`}):r?(0,G.jsx)(vh,{title:`Session load failed`,body:r}):t&&t.messages.length?t.messages.map(e=>h(e)):(0,G.jsx)(vh,{title:`No conversation`,body:`Start with a prompt from the composer.`})})}),(0,G.jsx)(hh,{draft:u,disabled:!i||a,runActive:a,runInFlight:o,memoryUpdating:s,canSend:T,canContinue:E,pendingApproval:d,compacting:O,onOpenApprovalSheet:()=>k(!0),sendPromptError:c,sessionNotice:l,textareaRef:p,mentionMenu:m,onDraftChange:g,onComposerKeyDown:_,onSubmitPrompt:b,onContinueSession:S,onCancelSessionRun:C}),(0,G.jsx)(lh,{approval:d,open:ee,onOpenChange:k,onResolve:e=>{w(e),k(!1)}})]})}function hh({draft:e,disabled:t,runActive:n,runInFlight:r,memoryUpdating:i,canSend:a,canContinue:o,pendingApproval:s,compacting:c,onOpenApprovalSheet:l,sendPromptError:u,sessionNotice:d,textareaRef:f,mentionMenu:p,onDraftChange:m,onComposerKeyDown:h,onSubmitPrompt:g,onContinueSession:_,onCancelSessionRun:v}){let y=c?`Compacting earlier conversation history into an archive summary.`:u??d??(i?`Memory updating in the background.`:void 0);return(0,G.jsxs)(`footer`,{className:`relative shrink-0 border-t border-border bg-card px-2 py-2`,children:[s?(0,G.jsx)(gh,{approval:s,onOpen:l}):null,p,(0,G.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,G.jsx)(ah,{ref:f,rows:1,value:e,className:`max-h-24 min-h-10 resize-none rounded-md bg-background px-3 py-2 text-base leading-6 md:text-sm md:leading-5`,disabled:t,placeholder:n?`Heddle is working...`:`Message Heddle`,onChange:e=>m(e.target.value,e.target.selectionStart),onClick:t=>m(e,t.currentTarget.selectionStart),onSelect:t=>m(e,t.currentTarget.selectionStart),onKeyDown:h}),(0,G.jsx)(q,{type:`button`,size:`sm`,className:`h-10 shrink-0 px-3`,disabled:!a,onClick:g,children:`Send`})]}),(0,G.jsxs)(`div`,{className:`mt-1 flex items-center justify-between gap-2`,children:[(0,G.jsx)(`div`,{className:`min-w-0`,children:y?(0,G.jsx)(`p`,{className:`m-0 truncate text-xs text-muted-foreground`,children:y}):(0,G.jsx)(_h,{runActive:n})}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,G.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs`,disabled:!o,onClick:_,children:`Continue`}),(0,G.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs`,disabled:!r,onClick:v,children:`Cancel`})]})]})]})}function gh({approval:e,onOpen:t}){return(0,G.jsxs)(`button`,{type:`button`,className:`mb-2 flex w-full items-center justify-between gap-2 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-left`,onClick:t,"aria-label":`Open pending approval for ${e.tool}`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`p`,{className:`m-0 truncate text-xs font-semibold text-foreground`,children:[`Approval required: `,e.tool]}),(0,G.jsx)(`p`,{className:`m-0 truncate text-[11px] text-muted-foreground`,children:`Tap for details and actions`})]}),(0,G.jsx)(K,{variant:`destructive`,className:`shrink-0`,children:`Pending`})]})}function _h({runActive:e}){return(0,G.jsx)(K,{variant:e?`outline`:`secondary`,children:e?`working`:`idle`})}function vh({title:e,body:t}){return(0,G.jsxs)(`div`,{className:`rounded-md border border-border bg-card px-3 py-3`,children:[(0,G.jsx)(`p`,{className:`m-0 text-sm font-semibold text-foreground`,children:e}),(0,G.jsx)(`p`,{className:`m-0 mt-1 text-xs text-muted-foreground`,children:t})]})}function yh({activeSession:e,sessionDetail:t,selectedTurnId:n,selectedTurn:r,turnReview:i,turnReviewLoading:a,turnReviewError:o,workspaceChanges:s,workspaceChangesLoading:c,workspaceChangesError:l,selectedWorkspaceFile:u,workspaceFileDiff:d,workspaceFileDiffLoading:f,workspaceFileDiffError:p,onSelectWorkspaceFile:m,onRefreshWorkspaceReview:h,selectedTurnPatchIsStale:g,onOpenDiff:_,onBackToSessions:v,onOpenChat:y,onSelectTurn:b}){let[S,C]=(0,x.useState)(`current`),[w,T]=(0,x.useState)(),E=t?.name??e?.name??`Session`,D=`Review evidence`,O=i?.files.find(e=>e.path===w)??i?.files[0];(0,x.useEffect)(()=>{T(i?.files[0]?.path)},[n,i?.traceFile]);let ee=(0,x.useMemo)(()=>i?[{label:`Review`,commands:i.reviewCommands},{label:`Verification`,commands:i.verificationCommands},{label:`Mutation`,commands:i.mutationCommands}]:[],[i]);return(0,G.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col bg-background`,children:[(0,G.jsx)(oh,{activeView:`review`,title:E,subtitle:e?`${D} · updated ${Fa(e.updatedAt)}`:D,onBackToSessions:v,onOpenChat:y,onOpenReview:()=>void 0}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-3`,children:(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsxs)(`nav`,{className:`grid grid-cols-3 rounded-md bg-muted p-1`,"aria-label":`Review evidence tabs`,children:[(0,G.jsx)(Ch,{active:S===`current`,onClick:()=>C(`current`),children:`Current`}),(0,G.jsx)(Ch,{active:S===`turn`,onClick:()=>C(`turn`),children:`Turn`}),(0,G.jsx)(Ch,{active:S===`evidence`,onClick:()=>C(`evidence`),children:`Evidence`})]}),S===`current`?(0,G.jsx)(bh,{title:`Current workspace changes`,actions:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[g?(0,G.jsx)(K,{variant:`outline`,children:`live diff differs`}):null,(0,G.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:h,disabled:c||f,children:`Refresh`})]}),children:c?(0,G.jsx)(wh,{title:`Loading workspace diff`,body:`Reading current Git changes from the active workspace.`}):l?(0,G.jsx)(wh,{title:`Workspace diff failed`,body:l}):s?.vcs===`none`?(0,G.jsx)(wh,{title:`Not a git workspace`,body:s.error??`Current workspace changes require a Git-backed project.`}):s?.files.length?(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(`div`,{className:`flex gap-2 overflow-x-auto pb-1`,children:s.files.map(e=>(0,G.jsxs)(`button`,{type:`button`,className:`shrink-0 rounded-md border px-2 py-1 text-left text-[11px] ${u?.path===e.path?`border-primary bg-primary/5 text-foreground`:`border-border bg-background text-muted-foreground`}`,onClick:()=>m(e.path),children:[(0,G.jsx)(`span`,{className:`block max-w-44 truncate font-medium`,children:e.path}),(0,G.jsxs)(`span`,{className:`block`,children:[e.status,e.additions!==void 0||e.deletions!==void 0?` · +${e.additions??0} / -${e.deletions??0}`:``]})]},`workspace-${e.path}`))}),f?(0,G.jsx)(wh,{title:`Loading file diff`,body:`Reading the selected file patch.`}):p?(0,G.jsx)(wh,{title:`File diff failed`,body:p}):d?.error?(0,G.jsx)(wh,{title:`File diff unavailable`,body:d.error}):d?.patch?(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>_({title:u?.path??d.path,subtitle:`Current workspace diff`,diff:d.diff,patch:d.patch,fallbackTitle:`Raw workspace patch`}),children:`Open full diff`}),(0,G.jsx)(Gm,{diff:d.diff,patch:d.patch,fallbackTitle:`Raw workspace patch`})]}):(0,G.jsx)(wh,{title:`No patch available`,body:`Git reports this file as changed, but no patch text is available for it.`})]}):(0,G.jsx)(wh,{title:`Clean workspace`,body:`Git does not report current project file changes.`})}):S===`evidence`?(0,G.jsx)(`div`,{className:`space-y-3`,children:a?(0,G.jsx)(wh,{title:`Loading review`,body:`Reading trace-backed review evidence for the selected turn.`}):o?(0,G.jsx)(wh,{title:`Review load failed`,body:o}):(0,G.jsxs)(G.Fragment,{children:[ee.map(e=>(0,G.jsx)(xh,{label:e.label,commands:e.commands},e.label)),(0,G.jsx)(Sh,{turnReview:i,selectedTurn:r})]})}):(0,G.jsxs)(bh,{title:`Captured turn diff`,children:[t?.turns.length?(0,G.jsx)(`div`,{className:`mb-2 flex gap-2 overflow-x-auto pb-1`,children:[...t.turns].reverse().map(e=>(0,G.jsxs)(`button`,{type:`button`,className:`shrink-0 rounded-md border px-2 py-1 text-left text-[11px] ${e.id===n?`border-primary bg-primary/5 text-foreground`:`border-border bg-background text-muted-foreground`}`,onClick:()=>b(e.id),children:[(0,G.jsx)(`span`,{className:`block max-w-44 truncate font-medium`,children:e.prompt}),(0,G.jsxs)(`span`,{className:`block`,children:[e.outcome,` · `,e.steps,` steps`]})]},e.id))}):null,a?(0,G.jsx)(wh,{title:`Loading review`,body:`Reading trace-backed review evidence for the selected turn.`}):o?(0,G.jsx)(wh,{title:`Review load failed`,body:o}):i?.files.length?(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(`div`,{className:`flex gap-2 overflow-x-auto pb-1`,children:i.files.map(e=>(0,G.jsxs)(`button`,{type:`button`,className:`shrink-0 rounded-md border px-2 py-1 text-left text-[11px] ${O?.path===e.path?`border-primary bg-primary/5 text-foreground`:`border-border bg-background text-muted-foreground`}`,onClick:()=>T(e.path),children:[(0,G.jsx)(`span`,{className:`block max-w-44 truncate font-medium`,children:e.path}),(0,G.jsxs)(`span`,{className:`block`,children:[e.status,` · `,e.source,e.truncated?` · truncated`:``]})]},`${e.source}-${e.path}`))}),O?.patch?(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>_({title:O.path,subtitle:`Captured turn diff`,diff:O.diff,patch:O.patch,fallbackTitle:`Raw turn patch`}),children:`Open full diff`}),(0,G.jsx)(Gm,{diff:O.diff,patch:O.patch,fallbackTitle:`Raw turn patch`})]}):(0,G.jsx)(wh,{title:`No patch captured`,body:`This file was changed, but the turn did not capture patch text for it.`})]}):i?.diffExcerpt?(0,G.jsx)(`pre`,{className:`max-h-[52dvh] overflow-auto rounded-md border border-border bg-background p-2 text-[11px] leading-4 text-muted-foreground`,children:i.diffExcerpt}):(0,G.jsx)(wh,{title:`No changed files`,body:`This turn did not capture structured file review data.`})]})]})})]})}function bh({title:e,actions:t,children:n}){return(0,G.jsxs)(`section`,{className:`rounded-md border border-border bg-card px-3 py-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(`p`,{className:`m-0 text-sm font-semibold text-foreground`,children:e}),t]}),(0,G.jsx)(`div`,{className:`mt-2`,children:n})]})}function xh({label:e,commands:t}){return(0,G.jsx)(bh,{title:`${e} commands`,children:t.length?(0,G.jsx)(`div`,{className:`space-y-2`,children:t.map(t=>(0,G.jsxs)(`div`,{className:`rounded-md border border-border bg-background px-2 py-2`,children:[(0,G.jsx)(`p`,{className:`m-0 break-words text-xs font-medium text-foreground`,children:t.command}),(0,G.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:[(0,G.jsx)(K,{variant:`outline`,children:t.tool}),(0,G.jsxs)(K,{variant:t.exitCode===0?`secondary`:`outline`,children:[`exit `,t.exitCode??`n/a`]})]}),t.stdout?(0,G.jsx)(`pre`,{className:`mt-2 max-h-36 overflow-auto rounded border border-border bg-card p-2 text-[11px] leading-4 text-muted-foreground`,children:t.stdout}):null,t.stderr?(0,G.jsx)(`pre`,{className:`mt-2 max-h-36 overflow-auto rounded border border-border bg-card p-2 text-[11px] leading-4 text-destructive`,children:t.stderr}):null]},`${e}-${t.tool}-${t.command}`))}):(0,G.jsx)(wh,{title:`No commands`,body:`No ${e.toLowerCase()} commands captured for this turn.`})})}function Sh({turnReview:e,selectedTurn:t}){return(0,G.jsx)(bh,{title:`Approvals and events`,children:e?.approvals.length?(0,G.jsx)(`div`,{className:`space-y-2`,children:e.approvals.map((e,t)=>(0,G.jsxs)(`div`,{className:`rounded-md border border-border bg-background px-2 py-2`,children:[(0,G.jsx)(`p`,{className:`m-0 text-xs font-medium text-foreground`,children:e.tool}),(0,G.jsx)(`p`,{className:`m-0 mt-1 break-words text-[11px] text-muted-foreground`,children:e.command??`no command details`}),(0,G.jsx)(`div`,{className:`mt-1`,children:(0,G.jsx)(K,{variant:e.approved?`secondary`:`destructive`,children:e.approved?`approved`:`rejected`})}),e.reason?(0,G.jsx)(`p`,{className:`m-0 mt-1 text-[11px] text-muted-foreground`,children:e.reason}):null]},`${e.tool}-${e.timestamp??t}`))}):t?.events.length?(0,G.jsx)(`div`,{className:`space-y-1`,children:t.events.map((e,n)=>(0,G.jsx)(`p`,{className:`m-0 rounded-md border border-border bg-background px-2 py-2 text-[11px] text-muted-foreground`,children:e},`${t.id}-${n}`))}):(0,G.jsx)(wh,{title:`No approvals or events`,body:`Turn-level approvals and events will appear here.`})})}function Ch({active:e,onClick:t,children:n}){return(0,G.jsx)(`button`,{type:`button`,className:`h-8 rounded-md text-[11px] font-medium ${e?`bg-background text-foreground shadow-sm`:`text-muted-foreground`}`,"aria-current":e?`page`:void 0,onClick:t,children:n})}function wh({title:e,body:t}){return(0,G.jsxs)(`div`,{className:`rounded-md border border-border bg-background px-3 py-3`,children:[(0,G.jsx)(`p`,{className:`m-0 text-sm font-semibold text-foreground`,children:e}),(0,G.jsx)(`p`,{className:`m-0 mt-1 text-xs text-muted-foreground`,children:t})]})}var Th=`heddle.controlPlane.sessionPanelWidths`,Eh=12,Dh=420,Oh=220,kh=520,Ah=280,jh=620;function Mh({sessions:e,activeSession:t,sessionDetail:n,sessionDetailLoading:r,sessionDetailError:i,selectedSessionId:a,onSelectSession:o,selectedTurnId:s,onSelectTurn:c,selectedTurn:l,turnReview:u,turnReviewLoading:d,turnReviewError:f,sendingPrompt:p,runInFlight:m,memoryUpdating:h,sendPromptError:g,onSendPrompt:_,creatingSession:v,sessionNotice:y,onCreateSession:b,onContinueSession:S,onCancelSessionRun:C,onUpdateSessionSettings:w,pendingApproval:T,onResolveApproval:E}){let D=(0,x.useRef)(null),O=(0,x.useRef)(null),ee=(0,x.useRef)(null),[k,te]=(0,x.useState)(()=>Bh()),[A,j]=(0,x.useState)(``),[M,N]=(0,x.useState)(null),[P,F]=(0,x.useState)([]),[ne,re]=(0,x.useState)(!1),[ie,I]=(0,x.useState)(),[L,R]=(0,x.useState)(null),[ae,oe]=(0,x.useState)(),[se,ce]=(0,x.useState)(0),[le,ue]=(0,x.useState)(`list`),[de,fe]=(0,x.useState)(),[pe,me]=(0,x.useState)(null),[he,ge]=(0,x.useState)(!1),[_e,ve]=(0,x.useState)(),[ye,be]=(0,x.useState)(),[xe,Se]=(0,x.useState)(null),[Ce,we]=(0,x.useState)(!1),[Te,Ee]=(0,x.useState)(),[De,Oe]=(0,x.useState)(0),[ke,Ae]=(0,x.useState)(`current`),[je,Me]=(0,x.useState)(null),Ne=p||m,Pe=n?.context?.compactionStatus??t?.context?.compactionStatus,Fe=u?.files.find(e=>e.path===de)??u?.files[0],Ie=pe?.files.find(e=>e.path===ye)??pe?.files[0],Le=!!(Fe?.path&&Ie?.path===Fe.path&&Fe.patch&&xe?.patch&&Nh(Fe.patch)!==Nh(xe.patch)),Re={"--session-sidebar-width":`${k.left}px`,"--session-side-width":`${k.right}px`};(0,x.useEffect)(()=>{window.localStorage.setItem(Th,JSON.stringify(k))},[k]),(0,x.useEffect)(()=>{let e=O.current;if(!e)return;let t,n=window.requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight,t=window.setTimeout(()=>{e.scrollTop=e.scrollHeight},0)});return()=>{window.cancelAnimationFrame(n),t!==void 0&&window.clearTimeout(t)}},[le,a,n?.messages.length,r,i]),(0,x.useEffect)(()=>{let e=!1;return Ei().then(t=>{e||(R(t),oe(void 0))}).catch(t=>{e||(R(null),oe(t instanceof Error?t.message:String(t)))}),()=>{e=!0}},[]),(0,x.useEffect)(()=>{fe(u?.files[0]?.path)},[s,u?.traceFile]),(0,x.useEffect)(()=>{let e=!1;ge(!0);async function t(){try{let t=await Li();e||(me(t),ve(void 0),be(e=>e&&t.files.some(t=>t.path===e)?e:t.files[0]?.path))}catch(t){e||ve(t instanceof Error?t.message:String(t))}finally{e||ge(!1)}}return t(),()=>{e=!0}},[Ne,n?.updatedAt,De]),(0,x.useEffect)(()=>{if(!Ie?.path){Se(null),Ee(void 0);return}let e=Ie.path,t=!1;we(!0);async function n(){try{let n=await Ri(e);t||(Se(n),Ee(void 0))}catch(e){t||Ee(e instanceof Error?e.message:String(e))}finally{t||we(!1)}}return n(),()=>{t=!0}},[Ie?.path,De]),(0,x.useEffect)(()=>{if(!M){F([]),re(!1),I(void 0),ce(0);return}let e=!1;re(!0);let t=window.setTimeout(()=>{Fi(M.query).then(t=>{e||(F(t),I(void 0),ce(0))}).catch(t=>{e||(F([]),I(t instanceof Error?t.message:String(t)))}).finally(()=>{e||re(!1)})},220);return()=>{e=!0,window.clearTimeout(t)}},[M]);let ze=(e,t)=>{j(e),N(Wh(e,t??e.length))},Be=e=>{if(!M)return;let t=`${A.slice(0,M.start)}@${e.path} ${A.slice(M.end)}`,n=M.start+e.path.length+2;j(t),N(null),F([]),window.requestAnimationFrame(()=>{ee.current?.focus(),ee.current?.setSelectionRange(n,n)})},Ve=(e,t)=>{t.preventDefault();let n=D.current?.getBoundingClientRect().width;if(!n)return;let r=t.clientX,i=k,a=Math.min(kh,n-i.right-Dh-Eh),o=Math.min(jh,n-i.left-Dh-Eh),s=t=>{let n=t.clientX-r;te({left:e===`left`?Vh(i.left+n,Oh,a):i.left,right:e===`right`?Vh(i.right-n,Ah,o):i.right})},c=()=>{window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,c)};window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,c,{once:!0})};(0,x.useEffect)(()=>{if(!a){ue(`list`);return}ue(e=>e===`list`?`chat`:e)},[a]);let He=(0,x.useMemo)(()=>Na(`workspace-shell`,`mobile-view-${le}`),[le]),Ue=e=>{o(e),ue(`chat`)},We=e=>{c(e),ue(`review`)},Ge=()=>{ue(`list`)},Ke=()=>{ue(`chat`)},qe=()=>{ue(`review`)},Je=()=>{let e=A.trim();e&&(j(``),_(e))},Ye=e=>{if(M&&(P.length||ne)){if(e.key===`ArrowDown`){e.preventDefault(),ce(e=>Math.min(e+1,Math.max(P.length-1,0)));return}if(e.key===`ArrowUp`){e.preventDefault(),ce(e=>Math.max(e-1,0));return}if(e.key===`Escape`){e.preventDefault(),N(null),F([]);return}if((e.key===`Enter`||e.key===`Tab`)&&P[se]){e.preventDefault(),Be(P[se]);return}}if(!(e.key!==`Enter`||e.nativeEvent.isComposing)){if(typeof window<`u`&&window.innerWidth<=760){(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey&&(e.preventDefault(),Je());return}!e.shiftKey&&!e.altKey&&(e.preventDefault(),Je())}},Xe=M?(0,G.jsx)(Uh,{loading:ne,suggestions:P,activeIndex:se,error:ie,query:M.query,onPick:Be}):null,Ze=typeof window<`u`&&window.innerWidth<=760;return Ze&&le===`list`?(0,G.jsx)(`section`,{className:`mobile-session-screen mobile-session-list`,children:(0,G.jsxs)(`aside`,{className:`workspace-sidebar mobile-pane`,children:[(0,G.jsx)(km,{title:`Sessions`,subtitle:`${e.length} saved conversation${e.length===1?``:`s`}`,actions:(0,G.jsx)(`button`,{className:`sidebar-action-button`,type:`button`,disabled:v,onClick:()=>void b(),children:v?`Creating…`:`+ New session`})}),(0,G.jsx)(`div`,{className:`sidebar-scroll`,children:e.length?(0,G.jsx)(`div`,{className:`stack-list compact`,children:e.map(e=>(0,G.jsx)(Km,{session:e,active:e.id===a,onClick:()=>Ue(e.id)},e.id))}):(0,G.jsx)(`div`,{className:`sidebar-empty-state`,children:(0,G.jsx)(Cm,{title:`No sessions`,body:`Create a new web session to start a fresh conversation in the browser.`})})})]})}):Ze&&le===`chat`?(0,G.jsx)(mh,{activeSession:t,sessionDetail:n,sessionDetailLoading:r,sessionDetailError:i,selectedSessionId:a,runActive:Ne,runInFlight:m,memoryUpdating:h,sendPromptError:g,sessionNotice:y,draft:A,pendingApproval:T,conversationScrollRef:O,textareaRef:ee,mentionMenu:Xe,renderMessage:e=>(0,G.jsx)(Zm,{message:e},e.id),onDraftChange:ze,onComposerKeyDown:Ye,onBackToSessions:Ge,onOpenReview:qe,onSubmitPrompt:Je,onContinueSession:()=>void S(),onCancelSessionRun:()=>void C(),onResolveApproval:e=>void E(e)}):Ze&&le===`review`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(yh,{activeSession:t,sessionDetail:n,selectedTurnId:s,selectedTurn:l,turnReview:u,turnReviewLoading:d,turnReviewError:f,workspaceChanges:pe,workspaceChangesLoading:he,workspaceChangesError:_e,selectedWorkspaceFile:Ie,workspaceFileDiff:xe,workspaceFileDiffLoading:Ce,workspaceFileDiffError:Te,onSelectWorkspaceFile:be,onRefreshWorkspaceReview:()=>Oe(e=>e+1),selectedTurnPatchIsStale:Le,onOpenDiff:Me,onBackToSessions:Ge,onOpenChat:Ke,onSelectTurn:We}),(0,G.jsx)(Lh,{diff:je,onClose:()=>Me(null)})]}):(0,G.jsxs)(`section`,{className:He,ref:D,style:Re,"data-mobile-view":le,children:[(0,G.jsxs)(`aside`,{className:`workspace-sidebar`,children:[(0,G.jsx)(km,{title:`Sessions`,subtitle:`${e.length} saved conversation${e.length===1?``:`s`}`,actions:(0,G.jsx)(`button`,{className:`sidebar-action-button`,type:`button`,disabled:v,onClick:()=>void b(),children:v?`Creating…`:`+ New session`})}),(0,G.jsx)(`div`,{className:`sidebar-scroll`,children:e.length?(0,G.jsx)(`div`,{className:`stack-list compact`,children:e.map(e=>(0,G.jsx)(Km,{session:e,active:e.id===a,onClick:()=>Ue(e.id)},e.id))}):(0,G.jsx)(`div`,{className:`sidebar-empty-state`,children:(0,G.jsx)(Cm,{title:`No sessions`,body:`Create a new web session to start a fresh conversation in the browser.`})})})]}),(0,G.jsx)(`button`,{className:`workspace-resizer`,type:`button`,"aria-label":`Resize sessions sidebar`,onPointerDown:e=>Ve(`left`,e)}),(0,G.jsxs)(`section`,{className:`workspace-main`,children:[(0,G.jsx)(km,{title:n?.name??t?.name??`Chat session`,subtitle:t?`${t.id} · updated ${Fa(t.updatedAt)}`:`Pick a session to inspect its conversation.`,actions:t?(0,G.jsxs)(`div`,{className:`session-controls`,children:[(0,G.jsx)(`button`,{className:`mobile-nav-button`,type:`button`,onClick:Ge,children:`← Sessions`}),(0,G.jsx)(`button`,{className:`mobile-nav-button mobile-inspector-button`,type:`button`,onClick:qe,children:`Review`}),(0,G.jsxs)(`label`,{className:`select-control`,children:[(0,G.jsx)(`span`,{children:`model`}),(0,G.jsxs)(`select`,{value:n?.model??t.model??``,disabled:Ne||!L,onChange:e=>void w({model:e.target.value}),title:ae?`Model options unavailable. Restart the Heddle daemon if this route was just added.`:void 0,children:[L?.groups.map(e=>(0,G.jsx)(`optgroup`,{label:e.label,children:e.models.map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))},e.label)),L?null:(0,G.jsx)(`option`,{value:n?.model??t.model??``,children:ae?`models unavailable`:n?.model??t.model??`loading models`})]})]}),(0,G.jsxs)($,{children:[`turns `,t.turnCount]}),Pe===`running`?(0,G.jsx)($,{tone:`warn`,children:`compacting`}):null,(0,G.jsx)(`button`,{className:Na(`drift-button`,(n?.driftEnabled??t.driftEnabled)&&`active`),type:`button`,disabled:Ne,onClick:()=>void w({driftEnabled:!(n?.driftEnabled??t.driftEnabled??!0)}),children:Hh(n?.driftEnabled??t.driftEnabled,n?.driftLevel??t.driftLevel)}),Ne?(0,G.jsx)($,{tone:`warn`,children:`working`}):null]}):void 0}),(0,G.jsx)(`div`,{className:`conversation-scroll`,ref:O,children:(0,G.jsxs)(`div`,{className:`conversation-stack`,children:[(0,G.jsx)(`div`,{className:`conversation-spacer`}),r?(0,G.jsx)(Cm,{title:`Loading session`,body:`Fetching full conversation state from saved Heddle session storage.`}):i?(0,G.jsx)(Cm,{title:`Session load failed`,body:i}):n&&n.messages.length?n.messages.map(e=>(0,G.jsx)(Zm,{message:e},e.id)):(0,G.jsx)(Cm,{title:`No conversation available`,body:`This session does not have any saved chat messages yet.`})]})}),(0,G.jsxs)(`div`,{className:`composer-shell`,children:[T?(0,G.jsxs)(`div`,{className:`detail-card error-card approval-card`,children:[(0,G.jsxs)(`p`,{className:`card-title`,children:[`Approval required: `,T.tool]}),(0,G.jsxs)(`p`,{className:`muted`,children:[`Call ID: `,T.callId]}),(0,G.jsx)(Om,{children:JSON.stringify(T.input,null,2)}),(0,G.jsxs)(`div`,{className:`pills approval-actions`,children:[(0,G.jsx)(`button`,{className:`primary-button`,type:`button`,onClick:()=>void E(!0),children:`Approve`}),(0,G.jsx)(`button`,{className:`tab-button`,type:`button`,onClick:()=>void E(!1),children:`Deny`})]})]}):null,(0,G.jsx)(`textarea`,{ref:ee,value:A,onChange:e=>ze(e.target.value,e.target.selectionStart),onClick:e=>ze(A,e.currentTarget.selectionStart),onSelect:e=>ze(A,e.currentTarget.selectionStart),disabled:!a||Ne,placeholder:Ne?`Heddle is working…`:`Ask Heddle about this workspace`,onKeyDown:e=>{if(M&&(P.length||ne)){if(e.key===`ArrowDown`){e.preventDefault(),ce(e=>Math.min(e+1,Math.max(P.length-1,0)));return}if(e.key===`ArrowUp`){e.preventDefault(),ce(e=>Math.max(e-1,0));return}if(e.key===`Escape`){e.preventDefault(),N(null),F([]);return}if((e.key===`Enter`||e.key===`Tab`)&&P[se]){e.preventDefault(),Be(P[se]);return}}if(e.key===`Enter`&&!e.shiftKey&&!e.altKey&&!e.nativeEvent.isComposing){e.preventDefault();let t=A.trim();if(!t)return;j(``),_(t)}}}),M?(0,G.jsx)(Uh,{loading:ne,suggestions:P,activeIndex:se,error:ie,query:M.query,onPick:Be}):null,(0,G.jsxs)(`div`,{className:`composer-footer`,children:[(0,G.jsxs)(`div`,{className:`composer-status`,children:[(0,G.jsx)(`p`,{className:`muted`,children:Pe===`running`?`Compacting earlier conversation history into an archive summary.`:g||y||(Ne?`Run in progress. Continue is disabled until this run settles; Cancel interrupts the active run.`:h?`Memory maintenance is updating the workspace catalog in the background.`:(n?.lastContinuePrompt,`Enter sends. Option+Enter or Shift+Enter adds a new line.`))}),(0,G.jsxs)(`div`,{className:`pills compact-pills`,children:[(0,G.jsx)($,{tone:v||Ne?`warn`:`good`,children:v?`creating session`:Ne?`run active`:`idle`}),h?(0,G.jsx)($,{tone:`warn`,children:`memory updating`}):null,n?.lastContinuePrompt?(0,G.jsx)($,{children:`continue available`}):(0,G.jsx)($,{children:`no continue state yet`})]})]}),(0,G.jsxs)(`div`,{className:`pills composer-actions`,children:[(0,G.jsx)(`button`,{className:`tab-button`,type:`button`,disabled:!a||Ne||!n?.lastContinuePrompt,onClick:()=>void S(),title:n?.lastContinuePrompt?`Resume the current transcript from the last saved continue point`:`Continue is available after a prior runnable turn exists`,children:`Continue`}),(0,G.jsx)(`button`,{className:`tab-button`,type:`button`,disabled:!m,onClick:()=>void C(),title:`Interrupt the currently running session`,children:`Cancel`}),(0,G.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:!a||Ne||!A.trim(),onClick:()=>{let e=A.trim();e&&(j(``),_(e))},children:`Send`})]})]})]})]}),(0,G.jsx)(`button`,{className:`workspace-resizer`,type:`button`,"aria-label":`Resize session inspector`,onPointerDown:e=>Ve(`right`,e)}),(0,G.jsxs)(`aside`,{className:`workspace-side`,children:[(0,G.jsx)(`div`,{className:`mobile-side-header`,children:(0,G.jsx)(`button`,{className:`mobile-nav-button`,type:`button`,onClick:Ke,children:`← Chat`})}),(0,G.jsxs)(`div`,{className:`side-scroll`,children:[(0,G.jsxs)(`nav`,{className:`side-tabs review-mode-tabs`,role:`tablist`,"aria-label":`Review mode`,children:[(0,G.jsx)(`button`,{className:Na(ke===`current`&&`active`),type:`button`,onClick:()=>Ae(`current`),children:`Current`}),(0,G.jsx)(`button`,{className:Na(ke===`turn`&&`active`),type:`button`,onClick:()=>Ae(`turn`),children:`Turn history`}),(0,G.jsx)(`button`,{className:Na(ke===`evidence`&&`active`),type:`button`,onClick:()=>Ae(`evidence`),children:`Evidence`})]}),ke===`current`?(0,G.jsx)(Ph,{workspaceChanges:pe,workspaceChangesLoading:he,workspaceChangesError:_e,selectedWorkspaceFile:Ie,workspaceFileDiff:xe,workspaceFileDiffLoading:Ce,workspaceFileDiffError:Te,selectedTurnPatchIsStale:Le,onSelectWorkspaceFile:be,onRefresh:()=>Oe(e=>e+1),onOpenDiff:Me}):ke===`turn`?(0,G.jsx)(Fh,{sessionDetail:n,selectedTurnId:s,onSelectTurn:We,turnReview:u,turnReviewLoading:d,turnReviewError:f,selectedReviewFile:Fe,onSelectReviewFile:fe,onOpenDiff:Me}):(0,G.jsx)(Rh,{turnReview:u,selectedTurn:l})]})]}),(0,G.jsx)(Lh,{diff:je,onClose:()=>Me(null)})]})}function Nh(e){return e.trim().replace(/\r\n/g,`
55
- `)}function Ph({workspaceChanges:e,workspaceChangesLoading:t,workspaceChangesError:n,selectedWorkspaceFile:r,workspaceFileDiff:i,workspaceFileDiffLoading:a,workspaceFileDiffError:o,selectedTurnPatchIsStale:s,onSelectWorkspaceFile:c,onRefresh:l,onOpenDiff:u}){let d=r?.path??i?.path??`Workspace diff`;return(0,G.jsx)(Am,{title:`Current workspace changes`,actions:(0,G.jsxs)(`div`,{className:`review-section-actions`,children:[s?(0,G.jsx)(Ih,{}):null,(0,G.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:l,disabled:t||a,children:`Refresh`})]}),children:t?(0,G.jsx)(Cm,{title:`Loading workspace diff`,body:`Reading current Git changes from the active workspace.`}):n?(0,G.jsx)(Cm,{title:`Workspace diff failed`,body:n}):e?.vcs===`none`?(0,G.jsx)(Cm,{title:`Not a git workspace`,body:e.error??`Current workspace changes require a Git-backed project.`}):e?.files.length?(0,G.jsxs)(`div`,{className:`detail-stack compact-stack`,children:[(0,G.jsx)(zh,{files:e.files,selectedPath:r?.path,sourceLabel:`current git`,onSelect:c}),a?(0,G.jsx)(Cm,{title:`Loading file diff`,body:`Reading the selected file patch.`}):o?(0,G.jsx)(Cm,{title:`File diff failed`,body:o}):i?.error?(0,G.jsx)(Cm,{title:`File diff unavailable`,body:i.error}):i?.patch?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,className:`self-start`,onClick:()=>u({title:d,subtitle:`Current workspace diff`,diff:i.diff,patch:i.patch,fallbackTitle:`Raw workspace patch`}),children:`Open full diff`}),(0,G.jsx)(Gm,{diff:i.diff,patch:i.patch,fallbackTitle:`Raw workspace patch`})]}):(0,G.jsx)(Cm,{title:`No patch available`,body:`Git reports this file as changed, but no patch text is available for it.`})]}):(0,G.jsx)(Cm,{title:`Clean workspace`,body:`Git does not report current project file changes.`})})}function Fh({sessionDetail:e,selectedTurnId:t,onSelectTurn:n,turnReview:r,turnReviewLoading:i,turnReviewError:a,selectedReviewFile:o,onSelectReviewFile:s,onOpenDiff:c}){return(0,G.jsxs)(Am,{title:`Captured turn diff`,children:[e?.turns.length?(0,G.jsx)(`div`,{className:`stack-list compact review-turn-picker`,children:[...e.turns].reverse().map(e=>(0,G.jsx)(Ym,{turn:e,active:e.id===t,onClick:()=>n(e.id)},e.id))}):null,i?(0,G.jsx)(Cm,{title:`Loading review`,body:`Reading trace-backed review evidence for the selected turn.`}):a?(0,G.jsx)(Cm,{title:`Review load failed`,body:a}):r?.files.length?(0,G.jsxs)(`div`,{className:`detail-stack compact-stack`,children:[(0,G.jsx)(zh,{files:r.files,selectedPath:o?.path,onSelect:s}),o?.patch?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,className:`self-start`,onClick:()=>c({title:o.path,subtitle:`Captured turn diff`,diff:o.diff,patch:o.patch,fallbackTitle:`Raw turn patch`}),children:`Open full diff`}),(0,G.jsx)(Gm,{diff:o.diff,patch:o.patch,fallbackTitle:`Raw turn patch`})]}):(0,G.jsx)(Cm,{title:`No patch captured`,body:`This file was changed, but the turn did not capture patch text for it.`})]}):r?.diffExcerpt?(0,G.jsx)(Om,{children:r.diffExcerpt}):(0,G.jsx)(Cm,{title:`No captured diff`,body:`This selected turn did not save file-level diff evidence. Check Evidence for commands and approvals.`})]})}function Ih(){return(0,G.jsx)(Xd,{delayDuration:120,children:(0,G.jsxs)(Zd,{children:[(0,G.jsx)(Qd,{asChild:!0,children:(0,G.jsx)(`button`,{className:`stale-diff-button`,type:`button`,"aria-label":`Current workspace differs from captured turn`,children:`i`})}),(0,G.jsx)($d,{side:`left`,className:`max-w-64`,children:`The selected file also has trace-backed turn evidence, but the current Git patch is different. Treat Current as live workspace state.`})]})})}function Lh({diff:e,onClose:t}){return e?(0,G.jsx)(`div`,{className:`diff-dialog-backdrop`,role:`presentation`,onMouseDown:t,children:(0,G.jsxs)(`section`,{className:`diff-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`${e.subtitle}: ${e.title}`,onMouseDown:e=>e.stopPropagation(),children:[(0,G.jsxs)(`header`,{className:`diff-dialog-header`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`topbar-eyebrow`,children:`Diff review`}),(0,G.jsx)(`h2`,{children:e.title}),(0,G.jsx)(`p`,{className:`muted`,children:e.subtitle})]}),(0,G.jsx)(q,{type:`button`,variant:`outline`,onClick:t,children:`Close`})]}),(0,G.jsx)(`div`,{className:`diff-dialog-body`,children:(0,G.jsx)(Gm,{diff:e.diff,patch:e.patch,fallbackTitle:e.fallbackTitle})})]})}):null}function Rh({turnReview:e,selectedTurn:t}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Am,{title:`Review commands`,children:(0,G.jsx)(Xm,{commands:e?.reviewCommands??[],empty:`No git review commands captured for this turn.`})}),(0,G.jsx)(Am,{title:`Verification commands`,children:(0,G.jsx)(Xm,{commands:e?.verificationCommands??[],empty:`No verification commands captured for this turn.`})}),(0,G.jsx)(Am,{title:`Approvals and events`,children:e?.approvals.length?(0,G.jsx)(`div`,{className:`stack-list compact`,children:e.approvals.map((e,t)=>(0,G.jsxs)(`div`,{className:`detail-card`,children:[(0,G.jsx)(`p`,{className:`card-title`,children:e.tool}),(0,G.jsx)(`p`,{className:`muted`,children:e.command??`no command details`}),(0,G.jsx)(`div`,{className:`pills`,children:(0,G.jsx)($,{tone:e.approved?`good`:`warn`,children:e.approved?`approved`:`rejected`})}),e.reason?(0,G.jsx)(`p`,{className:`summary`,children:e.reason}):null]},`${e.tool}-${e.timestamp??t}`))}):t?.events.length?(0,G.jsx)(`div`,{className:`event-list`,children:t.events.map((e,n)=>(0,G.jsx)(`p`,{className:`event-line`,children:e},`${t.id}-${n}`))}):(0,G.jsx)(Cm,{title:`No approvals or events`,body:`Turn-level approvals, tool review, or summarized events will appear here.`})})]})}function zh({files:e,selectedPath:t,sourceLabel:n,onSelect:r}){return(0,G.jsx)(`div`,{className:`stack-list compact`,children:e.map(e=>(0,G.jsxs)(`button`,{type:`button`,className:Na(`list-button compact-button`,t===e.path&&`active`),onClick:()=>r(e.path),children:[(0,G.jsxs)(`div`,{className:`list-button-header`,children:[(0,G.jsx)(`strong`,{children:e.path}),(0,G.jsx)(`span`,{children:e.status})]}),(0,G.jsxs)(`div`,{className:`pills compact-pills`,children:[`source`in e?(0,G.jsx)($,{children:e.source}):(0,G.jsx)($,{children:n??`current git`}),`additions`in e&&(e.additions!==void 0||e.deletions!==void 0)?(0,G.jsxs)($,{tone:`good`,children:[`+`,e.additions??0,` / -`,e.deletions??0]}):null,`binary`in e&&e.binary?(0,G.jsx)($,{tone:`warn`,children:`binary`}):null,`truncated`in e&&e.truncated?(0,G.jsx)($,{tone:`warn`,children:`truncated`}):null]})]},`${`source`in e?e.source:`workspace`}-${e.path}`))})}function Bh(){try{let e=window.localStorage.getItem(Th);if(!e)return{left:288,right:344};let t=JSON.parse(e);return{left:Vh(typeof t.left==`number`?t.left:288,Oh,kh),right:Vh(typeof t.right==`number`?t.right:344,Ah,jh)}}catch{return{left:288,right:344}}}function Vh(e,t,n){return Math.min(Math.max(e,t),Math.max(t,n))}function Hh(e,t){return e?`drift ${t??`unknown`}`:`drift off`}function Uh({loading:e,suggestions:t,activeIndex:n,error:r,query:i,onPick:a}){return(0,G.jsxs)(`div`,{className:`mention-menu`,role:`listbox`,"aria-label":`File suggestions`,children:[(0,G.jsxs)(`div`,{className:`mention-menu-header`,children:[(0,G.jsx)(`span`,{children:`@ file`}),(0,G.jsx)(`span`,{children:e?`Searching...`:`${t.length} match${t.length===1?``:`es`}`})]}),r?(0,G.jsx)(`p`,{className:`mention-empty`,children:`File search unavailable. Restart the Heddle daemon if this route was just added.`}):t.length?t.map((e,t)=>(0,G.jsx)(`button`,{className:Na(`mention-option`,t===n&&`active`),type:`button`,role:`option`,"aria-selected":t===n,onMouseDown:t=>{t.preventDefault(),a(e)},children:(0,G.jsxs)(`span`,{children:[`@`,e.path]})},e.path)):(0,G.jsx)(`p`,{className:`mention-empty`,children:e?`Searching workspace files...`:`No files found for "${i}".`})]})}function Wh(e,t){let n=e.slice(0,t).match(/(^|\s)@([^\s@]*)$/);if(!n||n.index===void 0)return null;let r=n[1]??``;return{query:n[2]??``,start:n.index+r.length,end:t}}function Gh({tasks:e,selectedTask:t,selectedTaskId:n,onSelectTask:r,selectedRun:i,selectedRunId:a,onSelectRun:o,selectedTaskRuns:s,pendingTaskAction:c,onEnableTask:l,onDisableTask:u,onTriggerTask:d}){let[f,p]=(0,x.useState)(n?`detail`:`list`),m=!!(t&&c&&c.taskId===t.taskId),h=t?Ha(t):void 0;return(0,x.useEffect)(()=>{if(!n){p(`list`);return}p(e=>e===`list`?`detail`:e)},[n]),f===`list`?(0,G.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col bg-background`,children:[(0,G.jsxs)(`header`,{className:`shrink-0 border-b border-border bg-card px-3 py-2`,children:[(0,G.jsx)(`p`,{className:`m-0 text-sm font-semibold text-foreground`,children:`Tasks`}),(0,G.jsxs)(`p`,{className:`m-0 text-xs text-muted-foreground`,children:[e.length,` durable task`,e.length===1?``:`s`]})]}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-3`,children:e.length?(0,G.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>{let t=Ha(e);return(0,G.jsxs)(`button`,{type:`button`,className:`w-full rounded-md border px-3 py-3 text-left ${e.taskId===n?`border-primary bg-primary/5`:`border-border bg-card`}`,onClick:()=>{r(e.taskId),p(`detail`)},children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,G.jsx)(`p`,{className:`m-0 line-clamp-2 text-sm font-semibold text-foreground`,children:e.name||e.taskId}),(0,G.jsx)(`p`,{className:`m-0 shrink-0 text-[11px] text-muted-foreground`,children:Fa(e.nextRunAt)})]}),(0,G.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[(0,G.jsx)(K,{variant:e.enabled?`secondary`:`outline`,children:e.enabled?`enabled`:`disabled`}),(0,G.jsx)(K,{variant:`outline`,children:t.label}),e.decision?(0,G.jsx)(K,{variant:`outline`,children:e.decision}):null]}),(0,G.jsx)(`p`,{className:`m-0 mt-2 text-xs text-muted-foreground`,children:e.task})]},e.taskId)})}):(0,G.jsx)(Yh,{title:`No tasks`,body:`Add a heartbeat task in the CLI, then manage it from here.`})})]}):f===`runs`?(0,G.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col bg-background`,children:[(0,G.jsx)(`header`,{className:`shrink-0 border-b border-border bg-card px-3 py-2`,children:(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs`,onClick:()=>p(`detail`),children:`← Task`}),(0,G.jsx)(`p`,{className:`m-0 text-xs text-muted-foreground`,children:`Runs`})]})}),(0,G.jsx)(`nav`,{className:`shrink-0 border-b border-border bg-card px-3 py-2`,children:(0,G.jsxs)(`div`,{className:`grid grid-cols-2 rounded-md bg-muted p-1`,children:[(0,G.jsx)(Jh,{active:!1,onClick:()=>p(`detail`),children:`Summary`}),(0,G.jsx)(Jh,{active:!0,children:`Runs`})]})}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-3`,children:(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsx)(Kh,{title:`History`,children:s.length?(0,G.jsx)(`div`,{className:`space-y-2`,children:s.map(e=>(0,G.jsxs)(`button`,{type:`button`,className:`w-full rounded-md border px-2 py-2 text-left ${e.id===a?`border-primary bg-primary/5`:`border-border bg-background`}`,onClick:()=>o(e.id),children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,G.jsx)(`p`,{className:`m-0 truncate text-xs font-medium text-foreground`,children:e.id}),(0,G.jsx)(`p`,{className:`m-0 shrink-0 text-[11px] text-muted-foreground`,children:Fa(e.createdAt)})]}),(0,G.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:[(0,G.jsx)(K,{variant:`outline`,children:e.status}),(0,G.jsx)(K,{variant:`outline`,children:e.decision}),(0,G.jsx)(K,{variant:`outline`,children:e.outcome})]})]},e.id))}):(0,G.jsx)(Yh,{title:`No runs`,body:`Run-once and scheduled executions appear here.`})}),(0,G.jsx)(Kh,{title:`Run detail`,children:i?(0,G.jsxs)(`div`,{className:`space-y-2 text-xs`,children:[(0,G.jsx)(`p`,{className:`m-0 text-sm font-semibold text-foreground`,children:i.id}),(0,G.jsx)(`p`,{className:`m-0 text-muted-foreground`,children:i.summary}),(0,G.jsx)(qh,{label:`created`,value:Fa(i.createdAt)}),(0,G.jsx)(qh,{label:`task`,value:i.taskId}),(0,G.jsx)(qh,{label:`usage`,value:Va(i.usage)??`none`}),(0,G.jsx)(qh,{label:`checkpoint`,value:i.loadedCheckpoint?`loaded`:`fresh`}),i.progress?(0,G.jsx)(qh,{label:`progress`,value:i.progress}):null]}):(0,G.jsx)(Yh,{title:`No run selected`,body:`Select a run to inspect the latest heartbeat result.`})})]})})]}):(0,G.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col bg-background`,children:[(0,G.jsx)(`header`,{className:`shrink-0 border-b border-border bg-card px-3 py-2`,children:(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs`,onClick:()=>p(`list`),children:`← Tasks`}),(0,G.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs`,onClick:()=>p(`runs`),disabled:!s.length,children:`Runs`})]})}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-3`,children:t?(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsxs)(Kh,{title:t.name||t.taskId,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,G.jsx)(K,{variant:t.enabled?`secondary`:`outline`,children:t.enabled?`enabled`:`disabled`}),(0,G.jsx)(K,{variant:h?.tone===`good`?`secondary`:`outline`,children:h?.label??t.status}),t.decision?(0,G.jsx)(K,{variant:`outline`,children:t.decision}):null]}),(0,G.jsx)(`p`,{className:`m-0 mt-2 text-xs text-muted-foreground`,children:t.taskId}),(0,G.jsx)(`p`,{className:`m-0 mt-2 text-sm text-foreground`,children:t.task}),(0,G.jsx)(`p`,{className:`m-0 mt-2 text-xs text-muted-foreground`,children:h?.detail}),(0,G.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,G.jsx)(q,{type:`button`,size:`sm`,variant:`outline`,disabled:m||!t.enabled,onClick:()=>{d(t.taskId)},children:m&&c?.action===`trigger`?`Triggering…`:`Run now`}),t.enabled?(0,G.jsx)(q,{type:`button`,size:`sm`,variant:`outline`,disabled:m,onClick:()=>{u(t.taskId)},children:m&&c?.action===`disable`?`Pausing…`:`Pause task`}):(0,G.jsx)(q,{type:`button`,size:`sm`,variant:`outline`,disabled:m,onClick:()=>{l(t.taskId)},children:m&&c?.action===`enable`?`Resuming…`:`Resume task`})]})]}),(0,G.jsxs)(Kh,{title:`Runtime status`,children:[(0,G.jsx)(qh,{label:`execution`,value:h?.label??t.status}),(0,G.jsx)(qh,{label:`model`,value:t.model??`unset`}),(0,G.jsx)(qh,{label:`interval`,value:Ba(t.intervalMs)}),(0,G.jsx)(qh,{label:`last run`,value:Fa(t.lastRunAt)}),(0,G.jsx)(qh,{label:`next run`,value:Fa(t.nextRunAt)}),(0,G.jsx)(qh,{label:`checkpoint`,value:t.loadedCheckpoint?`loaded`:t.resumable?`resumable`:`none`}),(0,G.jsx)(qh,{label:`usage`,value:Va(t.usage)??`none`})]}),t.summary?(0,G.jsx)(Kh,{title:`Latest summary`,children:(0,G.jsx)(`p`,{className:`m-0 text-sm text-foreground`,children:t.summary})}):null,t.progress?(0,G.jsx)(Kh,{title:`Progress`,children:(0,G.jsx)(`p`,{className:`m-0 text-sm text-foreground`,children:t.progress})}):null,t.error?(0,G.jsx)(Kh,{title:`Error`,children:(0,G.jsx)(`p`,{className:`m-0 text-sm text-destructive`,children:t.error})}):null]}):(0,G.jsx)(Yh,{title:`No task selected`,body:`Choose a task to inspect its durable prompt and latest run state.`})})]})}function Kh({title:e,children:t}){return(0,G.jsxs)(`section`,{className:`rounded-md border border-border bg-card px-3 py-3`,children:[(0,G.jsx)(`p`,{className:`m-0 text-sm font-semibold text-foreground`,children:e}),(0,G.jsx)(`div`,{className:`mt-2`,children:t})]})}function qh({label:e,value:t}){return(0,G.jsxs)(`div`,{className:`grid grid-cols-[92px_minmax(0,1fr)] gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e}),(0,G.jsx)(`span`,{className:`break-words text-foreground`,children:t})]})}function Jh({active:e,onClick:t,children:n}){return(0,G.jsx)(`button`,{type:`button`,className:`h-8 rounded-md text-xs font-medium ${e?`bg-background text-foreground shadow-sm`:`text-muted-foreground`}`,onClick:t,"aria-current":e?`page`:void 0,children:n})}function Yh({title:e,body:t}){return(0,G.jsxs)(`div`,{className:`rounded-md border border-border bg-card px-3 py-3`,children:[(0,G.jsx)(`p`,{className:`m-0 text-sm font-semibold text-foreground`,children:e}),(0,G.jsx)(`p`,{className:`m-0 mt-1 text-xs text-muted-foreground`,children:t})]})}function Xh({tasks:e,runs:t,selectedTask:n,selectedTaskId:r,onSelectTask:i,selectedRun:a,selectedRunId:o,onSelectRun:s,selectedTaskRuns:c,pendingTaskAction:l,onEnableTask:u,onDisableTask:d,onTriggerTask:f}){if(Da())return(0,G.jsx)(Gh,{tasks:e,selectedTask:n,selectedTaskId:r,onSelectTask:i,selectedRun:a,selectedRunId:o,onSelectRun:s,selectedTaskRuns:c,pendingTaskAction:l,onEnableTask:u,onDisableTask:d,onTriggerTask:f});let p=!!(n&&l&&l.taskId===n.taskId),m=n?Ha(n):void 0;return(0,G.jsxs)(`section`,{className:`workspace-shell tasks-shell`,children:[(0,G.jsxs)(`aside`,{className:`workspace-sidebar`,children:[(0,G.jsx)(km,{title:`Tasks`,subtitle:`${e.length} durable task${e.length===1?``:`s`}`}),(0,G.jsx)(`div`,{className:`sidebar-scroll`,children:e.length?e.map(e=>(0,G.jsx)(qm,{task:e,active:e.taskId===r,onClick:()=>i(e.taskId)},e.taskId)):(0,G.jsx)(Cm,{title:`No tasks`,body:`Add a heartbeat task in the CLI, then manage it from this view.`})})]}),(0,G.jsxs)(`section`,{className:`workspace-main`,children:[(0,G.jsx)(km,{title:n?.name||n?.taskId||`Task detail`,subtitle:n?`${n.taskId} · next ${Fa(n.nextRunAt)}`:`Pick a task to inspect prompt, schedule, and recent outcome.`,actions:n?(0,G.jsxs)(`div`,{className:`pills`,children:[(0,G.jsx)($,{tone:n.enabled?`good`:void 0,children:n.enabled?`enabled`:`disabled`}),(0,G.jsx)($,{tone:m?.tone,children:m?.label??n.status}),n.decision?(0,G.jsx)($,{tone:Pa(n.decision),children:n.decision}):null]}):void 0}),(0,G.jsx)(`div`,{className:`task-detail-scroll`,children:n?(0,G.jsxs)(`div`,{className:`detail-stack`,children:[(0,G.jsxs)(`div`,{className:`detail-card`,children:[(0,G.jsx)(`p`,{className:`section-label`,children:`Task prompt`}),(0,G.jsx)(`p`,{className:`summary`,children:n.task}),(0,G.jsxs)(`div`,{className:`pills approval-actions`,children:[(0,G.jsx)(`button`,{type:`button`,className:`sidebar-action-button`,disabled:p||!n.enabled,onClick:()=>{f(n.taskId)},children:p&&l?.action===`trigger`?`Triggering…`:`Run now`}),n.enabled?(0,G.jsx)(`button`,{type:`button`,className:`sidebar-action-button`,disabled:p,onClick:()=>{d(n.taskId)},children:p&&l?.action===`disable`?`Pausing…`:`Pause task`}):(0,G.jsx)(`button`,{type:`button`,className:`sidebar-action-button`,disabled:p,onClick:()=>{u(n.taskId)},children:p&&l?.action===`enable`?`Resuming…`:`Resume task`})]}),(0,G.jsx)(`p`,{className:`summary`,children:m?.detail})]}),(0,G.jsxs)(`div`,{className:`detail-card`,children:[(0,G.jsx)(`p`,{className:`section-label`,children:`Runtime status`}),(0,G.jsxs)(`div`,{className:`kv-list`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`execution`}),(0,G.jsx)(`span`,{className:`kv-value`,children:m?.label??n.status})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`model`}),(0,G.jsx)(`span`,{className:`kv-value`,children:n.model??`unset`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`interval`}),(0,G.jsx)(`span`,{className:`kv-value`,children:Ba(n.intervalMs)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`last run`}),(0,G.jsx)(`span`,{className:`kv-value`,children:Fa(n.lastRunAt)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`next run`}),(0,G.jsx)(`span`,{className:`kv-value`,children:Fa(n.nextRunAt)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`checkpoint`}),(0,G.jsx)(`span`,{className:`kv-value`,children:n.loadedCheckpoint?`loaded`:n.resumable?`resumable`:`none`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`usage`}),(0,G.jsx)(`span`,{className:`kv-value`,children:Va(n.usage)??`none`})]})]})]}),n.summary?(0,G.jsxs)(`div`,{className:`detail-card`,children:[(0,G.jsx)(`p`,{className:`section-label`,children:`Latest summary`}),(0,G.jsx)(`p`,{className:`summary`,children:n.summary})]}):null,n.progress?(0,G.jsxs)(`div`,{className:`detail-card`,children:[(0,G.jsx)(`p`,{className:`section-label`,children:`Progress`}),(0,G.jsx)(`p`,{className:`summary`,children:n.progress})]}):null,n.error?(0,G.jsxs)(`div`,{className:`detail-card error-card`,children:[(0,G.jsx)(`p`,{className:`section-label`,children:`Error`}),(0,G.jsx)(`p`,{className:`summary`,children:n.error})]}):null]}):(0,G.jsx)(Cm,{title:`No task selected`,body:`Choose a task from the left to inspect its durable prompt and latest run state.`})})]}),(0,G.jsxs)(`aside`,{className:`workspace-side`,children:[(0,G.jsx)(km,{title:`Runs`,subtitle:n?`${c.length} run${c.length===1?``:`s`} for this task`:`${t.length} recent run${t.length===1?``:`s`}`}),(0,G.jsxs)(`div`,{className:`side-scroll split-scroll`,children:[(0,G.jsx)(Am,{title:`History`,children:c.length?(0,G.jsx)(`div`,{className:`stack-list compact`,children:c.map(e=>(0,G.jsx)(Jm,{run:e,active:e.id===o,onClick:()=>s(e.id)},e.id))}):(0,G.jsx)(Cm,{title:`No runs for this task`,body:`Run-once and scheduled executions will appear here.`})}),(0,G.jsx)(Am,{title:`Run detail`,children:a?(0,G.jsxs)(`div`,{className:`detail-stack compact-stack`,children:[(0,G.jsxs)(`div`,{className:`detail-card`,children:[(0,G.jsx)(`p`,{className:`card-title`,children:a.id}),(0,G.jsxs)(`div`,{className:`pills`,children:[(0,G.jsx)($,{tone:Pa(a.status),children:a.status}),(0,G.jsx)($,{tone:Pa(a.decision),children:a.decision}),(0,G.jsx)($,{tone:Pa(a.outcome),children:a.outcome})]}),(0,G.jsx)(`p`,{className:`summary`,children:a.summary})]}),(0,G.jsx)(`div`,{className:`detail-card`,children:(0,G.jsxs)(`div`,{className:`kv-list`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`created`}),(0,G.jsx)(`span`,{className:`kv-value`,children:Fa(a.createdAt)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`task`}),(0,G.jsx)(`span`,{className:`kv-value`,children:a.taskId})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`usage`}),(0,G.jsx)(`span`,{className:`kv-value`,children:Va(a.usage)??`none`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`checkpoint`}),(0,G.jsx)(`span`,{className:`kv-value`,children:a.loadedCheckpoint?`loaded`:`fresh`})]})]})}),a.progress?(0,G.jsxs)(`div`,{className:`detail-card`,children:[(0,G.jsx)(`p`,{className:`section-label`,children:`Progress`}),(0,G.jsx)(`p`,{className:`summary`,children:a.progress})]}):null]}):(0,G.jsx)(Cm,{title:`No run selected`,body:`Select a run to inspect the latest durable heartbeat result.`})})]})]})]})}function Zh({state:e,creatingWorkspace:t=!1,renamingWorkspaceId:n,onCreateWorkspace:r,onRenameWorkspace:i,onSetActiveWorkspace:a}){let o=ag(e);return(0,G.jsx)(`section`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-x-hidden overflow-y-auto px-3 pt-3 pb-[calc(env(safe-area-inset-bottom)+5.5rem)] sm:px-4 sm:pt-4 sm:pb-4`,children:(0,G.jsxs)(`div`,{className:`grid min-w-0 gap-4 xl:grid-cols-[minmax(0,1.4fr)_minmax(320px,0.8fr)]`,children:[(0,G.jsxs)(ig,{children:[(0,G.jsxs)(`div`,{className:`mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Workspace management`}),(0,G.jsx)(`h2`,{className:`text-xl font-semibold text-foreground`,children:`Attached workspaces`}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Switch, rename, and inspect workspaces attached to this control-plane catalog.`})]}),(0,G.jsxs)(K,{variant:`outline`,children:[za(e.workspaces.length),` local`]})]}),(0,G.jsx)(`div`,{className:`space-y-3`,children:e.workspaces.map(t=>(0,G.jsx)(`article`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`h3`,{className:`truncate text-base font-semibold text-foreground`,children:t.name}),t.id===e.activeWorkspaceId?(0,G.jsx)(K,{variant:`secondary`,children:`active`}):null,(0,G.jsx)(K,{variant:`outline`,children:t.id})]}),(0,G.jsxs)(`dl`,{className:`mt-3 grid gap-2 text-sm`,children:[(0,G.jsx)(rg,{label:`Workspace path`,children:t.anchorRoot}),(0,G.jsx)(rg,{label:`State path`,children:t.stateRoot}),(0,G.jsx)(rg,{label:`Repo roots`,children:t.repoRoots.join(`, `)})]})]}),(0,G.jsxs)(`div`,{className:`flex min-w-[min(100%,260px)] flex-col gap-3`,children:[(0,G.jsx)(Qh,{workspaceId:t.id,initialName:t.name,disabled:!i||n===t.id,pending:n===t.id,onRename:i}),(0,G.jsx)(q,{type:`button`,variant:t.id===e.activeWorkspaceId?`secondary`:`outline`,disabled:t.id===e.activeWorkspaceId||!a,onClick:()=>a?.(t.id),children:t.id===e.activeWorkspaceId?`Current workspace`:`Switch to workspace`})]})]})},t.id))})]}),(0,G.jsxs)(`div`,{className:`grid min-w-0 gap-4`,children:[(0,G.jsx)($h,{creatingWorkspace:t,recentWorkspaces:o,onCreateWorkspace:r}),(0,G.jsx)(eg,{state:e,recentWorkspaces:o,creatingWorkspace:t,onCreateWorkspace:r,onSetActiveWorkspace:a})]})]})})}function Qh({workspaceId:e,initialName:t,disabled:n,pending:r,onRename:i}){let[a,o]=(0,x.useState)(t);(0,x.useEffect)(()=>{o(t)},[t]);let s=a.trim()&&a.trim()!==t;return(0,G.jsxs)(`form`,{className:`flex gap-2`,onSubmit:t=>{t.preventDefault(),!(!i||!s)&&i(e,a.trim())},children:[(0,G.jsx)(`input`,{className:`h-10 min-w-0 flex-1 rounded-md border border-border bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground`,value:a,onChange:e=>o(e.target.value),disabled:n,"aria-label":`Workspace name`}),(0,G.jsx)(q,{type:`submit`,variant:`outline`,size:`sm`,disabled:n||!s,children:r?`Saving…`:`Rename`})]})}function $h({creatingWorkspace:e,onCreateWorkspace:t,recentWorkspaces:n=[]}){let[r,i]=(0,x.useState)(``),[a,o]=(0,x.useState)(``),[s,c]=(0,x.useState)(!0),[l,u]=(0,x.useState)(!1);return(0,G.jsxs)(ig,{children:[(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Add workspace`}),(0,G.jsx)(`h2`,{className:`text-xl font-semibold text-foreground`,children:`Choose a project`}),(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Register another workspace path and optionally switch the control plane to it.`})]}),(0,G.jsxs)(`form`,{className:`mt-4 space-y-4`,onSubmit:e=>{e.preventDefault(),!(!t||!r.trim()||!a.trim())&&t({name:r.trim(),anchorRoot:a.trim(),setActive:s}).then(()=>{i(``),o(``),c(!0)})},children:[(0,G.jsxs)(`label`,{className:`block space-y-2`,children:[(0,G.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Name`}),(0,G.jsx)(`input`,{className:`h-11 w-full rounded-md border border-border bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground`,value:r,onChange:e=>i(e.target.value),placeholder:`Workspace name`,disabled:e})]}),(0,G.jsxs)(`label`,{className:`block space-y-2`,children:[(0,G.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Workspace path`}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(`input`,{className:`h-11 min-w-0 flex-1 rounded-md border border-border bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground`,value:a,onChange:e=>o(e.target.value),placeholder:`/absolute/path/to/workspace`,disabled:e}),(0,G.jsx)(q,{type:`button`,variant:`outline`,className:`h-11 shrink-0`,disabled:e,onClick:()=>u(!0),children:`Choose…`})]})]}),(0,G.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>c(e.target.checked),disabled:e}),(0,G.jsx)(`span`,{children:`Switch to this workspace after creating it`})]}),(0,G.jsx)(q,{type:`submit`,variant:`secondary`,className:`w-full`,disabled:e||!r.trim()||!a.trim(),children:e?`Creating…`:`Create workspace`})]}),(0,G.jsx)(tg,{open:l,selectedPath:a,recentWorkspaces:n,onOpenChange:u,onSelectPath:e=>{o(e),r.trim()||i(og(e))}})]})}function eg({state:e,recentWorkspaces:t,creatingWorkspace:n,onCreateWorkspace:r,onSetActiveWorkspace:i}){return(0,G.jsxs)(ig,{children:[(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Recent workspaces`}),(0,G.jsx)(`h2`,{className:`text-xl font-semibold text-foreground`,children:`Open workspace`}),(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Workspaces Heddle has seen on this machine, including the current catalog.`})]}),t.length?(0,G.jsx)(`div`,{className:`mt-4 space-y-2`,children:t.slice(0,8).map(t=>{let a=t.id===e.activeWorkspaceId,o=t.relation===`attached`;return(0,G.jsxs)(`button`,{type:`button`,className:`w-full rounded-xl border border-border bg-background/60 p-3 text-left hover:border-primary disabled:cursor-not-allowed disabled:opacity-50`,disabled:n||a||(o?!i:!r),onClick:()=>{o?i?.(t.id):r?.({name:t.name,anchorRoot:t.anchorRoot,setActive:!0})},children:[(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:t.name}),a?(0,G.jsx)(K,{variant:`secondary`,children:`active`}):null,(0,G.jsx)(K,{variant:`outline`,children:o?`attached`:`known`})]}),(0,G.jsx)(`span`,{className:`mt-1 block truncate text-xs text-muted-foreground`,children:t.anchorRoot}),(0,G.jsx)(`span`,{className:`mt-2 block text-[11px] text-muted-foreground`,children:Ra(t.stateRoot)})]},t.stateRoot)})}):(0,G.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:`No Heddle workspaces are known yet. Run Heddle in a project once, then refresh.`})]})}function tg({open:e,selectedPath:t,recentWorkspaces:n,onOpenChange:r,onSelectPath:i}){let[a,o]=(0,x.useState)(t.trim()||void 0),[s,c]=(0,x.useState)(t.trim()),[l,u]=(0,x.useState)(),[d,f]=(0,x.useState)(),[p,m]=(0,x.useState)(!1),[h,g]=(0,x.useState)(!1);if((0,x.useEffect)(()=>{if(!e)return;let n=t.trim()||void 0;o(n),c(n??``)},[e,t]),(0,x.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&r(!1)};return window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`keydown`,t)}},[e,r]),(0,x.useEffect)(()=>{if(!e)return;let t=!1;return m(!0),Ii(a,h).then(e=>{t||(u(e),o(e.path),c(e.path),f(void 0))}).catch(e=>{t||f(e instanceof Error?e.message:String(e))}).finally(()=>{t||m(!1)}),()=>{t=!0}},[e,a,h]),!e)return null;let _=l?.path??a??t.trim(),v=()=>{_&&(i(_),r(!1))};return(0,G.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-3 backdrop-blur-sm sm:p-6`,role:`presentation`,onMouseDown:e=>{e.target===e.currentTarget&&r(!1)},children:(0,G.jsxs)(`div`,{className:`flex max-h-[min(820px,92vh)] w-full max-w-4xl flex-col overflow-hidden rounded-2xl border border-border bg-card shadow-2xl`,role:`dialog`,"aria-modal":`true`,"aria-label":`Choose workspace folder`,children:[(0,G.jsxs)(`div`,{className:`border-b border-border px-4 py-4 sm:px-6`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Workspace folder`}),(0,G.jsx)(`h2`,{className:`mt-1 text-xl font-semibold text-foreground`,children:`Choose a project root`}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Navigate folders, pick a repo or existing Heddle workspace, then switch the control plane to it.`})]}),(0,G.jsx)(q,{type:`button`,variant:`outline`,onClick:()=>r(!1),children:`Close`})]}),(0,G.jsxs)(`form`,{className:`mt-4 flex flex-col gap-2 sm:flex-row`,onSubmit:e=>{e.preventDefault(),o(s.trim()||void 0)},children:[(0,G.jsx)(`input`,{className:`h-11 min-w-0 flex-1 rounded-md border border-border bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground`,value:s,onChange:e=>c(e.target.value),placeholder:`/absolute/path/to/workspace`}),(0,G.jsx)(q,{type:`submit`,variant:`outline`,className:`h-11`,children:`Go`}),(0,G.jsx)(q,{type:`button`,variant:`secondary`,className:`h-11`,disabled:!_,onClick:v,children:`Use this folder`})]})]}),(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-6`,children:[n.length?(0,G.jsxs)(`div`,{className:`mb-4 rounded-xl border border-border bg-background/50 p-3`,children:[(0,G.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Recent workspaces`}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Choose from Heddle workspaces seen on this machine.`})]}),(0,G.jsx)(K,{variant:`outline`,children:n.length})]}),(0,G.jsx)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:n.slice(0,6).map(e=>(0,G.jsxs)(`button`,{type:`button`,className:`rounded-lg border border-border bg-card px-3 py-2 text-left hover:border-primary`,onClick:()=>{i(e.anchorRoot),r(!1)},children:[(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:e.name}),(0,G.jsx)(K,{variant:`outline`,children:e.relation})]}),(0,G.jsx)(`span`,{className:`mt-1 block truncate text-xs text-muted-foreground`,children:e.anchorRoot})]},e.stateRoot))})]}):null,(0,G.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(K,{variant:`outline`,className:`max-w-full truncate`,children:_||`Home`}),l?.parentPath?(0,G.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>o(l.parentPath),children:`Up one level`}):null,(0,G.jsxs)(`label`,{className:`ml-auto flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:h,onChange:e=>g(e.target.checked)}),(0,G.jsx)(`span`,{children:`Show hidden folders`})]}),p?(0,G.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Loading...`}):null]}),d?(0,G.jsx)(`div`,{className:`mb-3 rounded-xl border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive`,children:d}):null,(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-background/40`,children:[l?.parentPath?(0,G.jsx)(ng,{label:`..`,detail:l.parentPath,onOpen:()=>o(l.parentPath)}):null,l?.entries.map(e=>(0,G.jsx)(ng,{label:e.name,detail:e.path,entry:e,onOpen:()=>o(e.path),onSelect:()=>{i(e.path),r(!1)}},e.path)),l&&!p&&l.entries.length===0?(0,G.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:`No readable child folders found here. You can still use the current folder.`}):null]})]})]})})}function ng({label:e,detail:t,entry:n,onOpen:r,onSelect:i}){return(0,G.jsxs)(`div`,{className:`grid gap-3 border-b border-border p-3 last:border-b-0 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`min-w-0 text-left`,onClick:r,children:[(0,G.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:e}),(0,G.jsx)(`span`,{className:`mt-1 block truncate text-xs text-muted-foreground`,children:t}),n?(0,G.jsxs)(`span`,{className:`mt-2 flex flex-wrap gap-1`,children:[n.hasHeddleState?(0,G.jsx)(K,{variant:`secondary`,children:`Heddle workspace`}):null,n.hasGit?(0,G.jsx)(K,{variant:`outline`,children:`git repo`}):null,n.hasPackageJson?(0,G.jsx)(K,{variant:`outline`,children:`package.json`}):null]}):null]}),(0,G.jsxs)(`div`,{className:`flex gap-2 sm:justify-end`,children:[(0,G.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,onClick:r,children:`Open`}),i?(0,G.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:i,children:`Select`}):null]})]})}function rg({label:e,children:t}){return(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`dt`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:e}),(0,G.jsx)(`dd`,{className:`break-all text-sm text-foreground`,children:t})]})}function ig({children:e}){return(0,G.jsx)(`section`,{className:`min-w-0 rounded-2xl border border-border bg-card/95 p-4 shadow-sm sm:p-5`,children:e})}function ag(e){let t=new Map;for(let n of e.workspaces)t.set(n.stateRoot,{...n,relation:`attached`});for(let n of e.knownWorkspaces??[])t.has(n.stateRoot)||t.set(n.stateRoot,{...n,relation:`known`});return Array.from(t.values()).sort((t,n)=>{let r=Number(n.id===e.activeWorkspaceId)-Number(t.id===e.activeWorkspaceId);return r===0?(n.updatedAt??``).localeCompare(t.updatedAt??``):r})}function og(e){let t=e.trim().replace(/\/+$/,``);return t.split(`/`).filter(Boolean).at(-1)??t}function sg(e){let t=cg(e),n=x.forwardRef((e,n)=>{let{children:r,...i}=e,a=x.Children.toArray(r),o=a.find(ug);if(o){let e=o.props.children,r=a.map(t=>t===o?x.Children.count(e)>1?x.Children.only(null):x.isValidElement(e)?e.props.children:null:t);return(0,G.jsx)(t,{...i,ref:n,children:x.isValidElement(e)?x.cloneElement(e,void 0,r):null})}return(0,G.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function cg(e){let t=x.forwardRef((e,t)=>{let{children:n,...r}=e;if(x.isValidElement(n)){let e=fg(n),i=dg(r,n.props);return n.type!==x.Fragment&&(i.ref=t?Ss(t,e):e),x.cloneElement(n,i)}return x.Children.count(n)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lg=Symbol(`radix.slottable`);function ug(e){return x.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===lg}function dg(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function fg(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function pg(e){let t=e+`CollectionProvider`,[n,r]=Ls(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=x.useRef(null),a=x.useRef(new Map).current;return(0,G.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=sg(s),l=x.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,G.jsx)(c,{ref:Cs(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=sg(u),p=x.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=x.useRef(null),s=Cs(t,o),c=a(u,n);return x.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,G.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return x.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var mg=`ToastProvider`,[hg,gg,_g]=pg(`Toast`),[vg,yg]=Ls(`Toast`,[_g]),[bg,xg]=vg(mg),Sg=e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,children:o}=e,[s,c]=x.useState(null),[l,u]=x.useState(0),d=x.useRef(!1),f=x.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${mg}\`. Expected non-empty \`string\`.`),(0,G.jsx)(hg.Provider,{scope:t,children:(0,G.jsx)(bg,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:l,viewport:s,onViewportChange:c,onToastAdd:x.useCallback(()=>u(e=>e+1),[]),onToastRemove:x.useCallback(()=>u(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};Sg.displayName=mg;var Cg=`ToastViewport`,wg=[`F8`],Tg=`toast.viewportPause`,Eg=`toast.viewportResume`,Dg=x.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:r=wg,label:i=`Notifications ({hotkey})`,...a}=e,o=xg(Cg,n),s=gg(n),c=x.useRef(null),l=x.useRef(null),u=x.useRef(null),d=x.useRef(null),f=Cs(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;x.useEffect(()=>{let e=e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),x.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(Tg);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},r=()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(Eg);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},i=t=>{e.contains(t.relatedTarget)||r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=x.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...e_(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return x.useEffect(()=>{let e=d.current;if(e){let t=t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);t_(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,G.jsxs)(uc,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,G.jsx)(kg,{ref:l,onFocusFromOutsideViewport:()=>{t_(h({tabbingDirection:`forwards`}))}}),(0,G.jsx)(hg.Slot,{scope:n,children:(0,G.jsx)(Ks.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,G.jsx)(kg,{ref:u,onFocusFromOutsideViewport:()=>{t_(h({tabbingDirection:`backwards`}))}})]})});Dg.displayName=Cg;var Og=`ToastFocusProxy`,kg=x.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=xg(Og,n);return(0,G.jsx)(ud,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})});kg.displayName=Og;var Ag=`Toast`,jg=`toast.swipeStart`,Mg=`toast.swipeMove`,Ng=`toast.swipeCancel`,Pg=`toast.swipeEnd`,Fg=x.forwardRef((e,t)=>{let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=ad({prop:r,defaultProp:i??!0,onChange:a,caller:Ag});return(0,G.jsx)(Qu,{present:n||s,children:(0,G.jsx)(Rg,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:Js(e.onPause),onResume:Js(e.onResume),onSwipeStart:Is(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:Is(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:Is(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:Is(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})});Fg.displayName=Ag;var[Ig,Lg]=vg(Ag,{onClose(){}}),Rg=x.forwardRef((e,t)=>{let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=xg(Ag,n),[g,_]=x.useState(null),v=Cs(t,e=>_(e)),y=x.useRef(null),b=x.useRef(null),S=i||h.duration,C=x.useRef(0),w=x.useRef(S),T=x.useRef(0),{onToastAdd:E,onToastRemove:D}=h,O=Js(()=>{g?.contains(document.activeElement)&&h.viewport?.focus(),o()}),ee=x.useCallback(e=>{!e||e===1/0||(window.clearTimeout(T.current),C.current=new Date().getTime(),T.current=window.setTimeout(O,e))},[O]);x.useEffect(()=>{let e=h.viewport;if(e){let t=()=>{ee(w.current),l?.()},n=()=>{let e=new Date().getTime()-C.current;w.current-=e,window.clearTimeout(T.current),c?.()};return e.addEventListener(Tg,n),e.addEventListener(Eg,t),()=>{e.removeEventListener(Tg,n),e.removeEventListener(Eg,t)}}},[h.viewport,S,c,l,ee]),x.useEffect(()=>{a&&!h.isClosePausedRef.current&&ee(S)},[a,S,h.isClosePausedRef,ee]),x.useEffect(()=>(E(),()=>D()),[E,D]);let k=x.useMemo(()=>g?Yg(g):null,[g]);return h.viewport?(0,G.jsxs)(G.Fragment,{children:[k&&(0,G.jsx)(zg,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:k}),(0,G.jsx)(Ig,{scope:n,onClose:O,children:zs.createPortal((0,G.jsx)(hg.ItemSlot,{scope:n,children:(0,G.jsx)(lc,{asChild:!0,onEscapeKeyDown:Is(s,()=>{h.isFocusedToastEscapeKeyDownRef.current||O(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,G.jsx)(Ks.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:v,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:Is(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:Is(e.onPointerDown,e=>{e.button===0&&(y.current={x:e.clientX,y:e.clientY})}),onPointerMove:Is(e.onPointerMove,e=>{if(!y.current)return;let t=e.clientX-y.current.x,n=e.clientY-y.current.y,r=!!b.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(b.current=l,Xg(Mg,d,f,{discrete:!1})):Zg(l,h.swipeDirection,c)?(b.current=l,Xg(jg,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(y.current=null)}),onPointerUp:Is(e.onPointerUp,e=>{let t=b.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),b.current=null,y.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};Zg(t,h.swipeDirection,h.swipeThreshold)?Xg(Pg,p,r,{discrete:!0}):Xg(Ng,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),zg=e=>{let{__scopeToast:t,children:n,...r}=e,i=xg(Ag,t),[a,o]=x.useState(!1),[s,c]=x.useState(!1);return Qg(()=>o(!0)),x.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,G.jsx)(Xu,{asChild:!0,children:(0,G.jsx)(ud,{...r,children:a&&(0,G.jsxs)(G.Fragment,{children:[i.label,` `,n]})})})},Bg=`ToastTitle`,Vg=x.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,G.jsx)(Ks.div,{...r,ref:t})});Vg.displayName=Bg;var Hg=`ToastDescription`,Ug=x.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,G.jsx)(Ks.div,{...r,ref:t})});Ug.displayName=Hg;var Wg=`ToastAction`,Gg=x.forwardRef((e,t)=>{let{altText:n,...r}=e;return n.trim()?(0,G.jsx)(Jg,{altText:n,asChild:!0,children:(0,G.jsx)(qg,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Wg}\`. Expected non-empty \`string\`.`),null)});Gg.displayName=Wg;var Kg=`ToastClose`,qg=x.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e,i=Lg(Kg,n);return(0,G.jsx)(Jg,{asChild:!0,children:(0,G.jsx)(Ks.button,{type:`button`,...r,ref:t,onClick:Is(e.onClick,i.onClose)})})});qg.displayName=Kg;var Jg=x.forwardRef((e,t)=>{let{__scopeToast:n,altText:r,...i}=e;return(0,G.jsx)(Ks.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function Yg(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),$g(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n)if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Yg(e))}}),t}function Xg(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?qs(i,a):i.dispatchEvent(a)}var Zg=(e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n};function Qg(e=()=>{}){let t=Js(e);dc(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}function $g(e){return e.nodeType===e.ELEMENT_NODE}function e_(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function t_(e){let t=document.activeElement;return e.some(e=>e===t?!0:(e.focus(),document.activeElement!==t))}var n_=Sg,r_=Dg,i_=Fg,a_=Vg,o_=Ug,s_=qg,c_=n_,l_=x.forwardRef(({className:e,...t},n)=>(0,G.jsx)(r_,{ref:n,className:vs(`fixed top-[max(0.75rem,env(safe-area-inset-top))] z-50 flex max-h-screen w-full flex-col-reverse gap-2 p-3 sm:top-[max(1rem,env(safe-area-inset-top))] md:right-4 md:top-4 md:w-[420px] md:max-w-[420px] md:flex-col`,e),...t}));l_.displayName=r_.displayName;var u_=Ja(`group pointer-events-auto relative flex w-full items-start justify-between gap-3 overflow-hidden rounded-md border p-3 pr-6 shadow-2xl ring-1 ring-black/20 transition-all`,{variants:{variant:{info:`border-cyan-400/40 bg-slate-950/96 text-slate-100`,success:`border-emerald-400/45 bg-emerald-950/90 text-emerald-50`,error:`border-red-300/45 bg-red-950/92 text-red-50`}},defaultVariants:{variant:`info`}}),d_=x.forwardRef(({className:e,variant:t,...n},r)=>(0,G.jsx)(i_,{ref:r,className:vs(u_({variant:t}),e),...n}));d_.displayName=i_.displayName;var f_=x.forwardRef(({className:e,...t},n)=>(0,G.jsx)(a_,{ref:n,className:vs(`text-sm font-semibold`,e),...t}));f_.displayName=a_.displayName;var p_=x.forwardRef(({className:e,...t},n)=>(0,G.jsx)(o_,{ref:n,className:vs(`mt-1 text-xs text-slate-200/90`,e),...t}));p_.displayName=o_.displayName;var m_=x.forwardRef(({className:e,...t},n)=>(0,G.jsx)(s_,{ref:n,className:vs(`absolute right-2 top-2 inline-flex h-6 w-6 items-center justify-center rounded-md border border-white/20 bg-black/25 text-slate-200 transition-colors hover:bg-black/45 hover:text-white`,e),"toast-close":``,...t,children:`×`}));m_.displayName=s_.displayName;var h_=3,g_=7e3,__=new Map,v_=e=>{if(__.has(e))return;let t=setTimeout(()=>{__.delete(e),S_({type:`REMOVE_TOAST`,toastId:e})},g_);__.set(e,t)};function y_(e,t){switch(t.type){case`ADD_TOAST`:return{...e,toasts:[t.toast,...e.toasts].slice(0,h_)};case`UPDATE_TOAST`:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case`DISMISS_TOAST`:{let{toastId:n}=t;return n?v_(n):e.toasts.forEach(e=>v_(e.id)),{...e,toasts:e.toasts.map(e=>e.id===n||n===void 0?{...e,open:!1}:e)}}case`REMOVE_TOAST`:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}}var b_=[],x_={toasts:[]};function S_(e){x_=y_(x_,e),b_.forEach(e=>{e(x_)})}function C_(){return`${Date.now()}-${Math.floor(Math.random()*1e3)}`}function w_(e){let t=C_(),n=()=>S_({type:`DISMISS_TOAST`,toastId:t}),r=e=>S_({type:`UPDATE_TOAST`,toast:{...e,id:t}});S_({type:`ADD_TOAST`,toast:{id:t,title:e.title,body:e.body,tone:e.tone,open:!0}});let i=e.tone===`error`?g_:4200;return setTimeout(n,i),{id:t,dismiss:n,update:r}}function T_(){let[e,t]=x.useState(x_);return x.useEffect(()=>(b_.push(t),()=>{let e=b_.indexOf(t);e>-1&&b_.splice(e,1)}),[]),{...e,toast:w_,dismiss:e=>S_({type:`DISMISS_TOAST`,toastId:e})}}function E_(){let{toasts:e,dismiss:t}=T_();return(0,G.jsxs)(c_,{children:[e.map(e=>(0,G.jsxs)(d_,{open:e.open,onOpenChange:n=>{n||t(e.id)},variant:e.tone??`info`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(f_,{children:e.title}),e.body?(0,G.jsx)(p_,{children:e.body}):null]}),(0,G.jsx)(m_,{"aria-label":`Dismiss notification`})]},e.id)),(0,G.jsx)(l_,{})]})}function D_(){let e=$i(),{state:t,error:n,refresh:r,setActiveWorkspace:i,createWorkspace:a,renameWorkspace:o}=qi(),{toasts:s,toast:c}=T_(),l=Da(),u=(0,x.useCallback)(()=>{r()},[r]),d=ka(t?.sessions,c,u,{selectedSessionId:e.routeSessionId,onSelectedSessionIdChange:e.setRouteSessionId,autoSelectSession:e.section===`sessions`}),f=ja(t?.heartbeat.tasks,t?.heartbeat.runs,c,u),p=Ma({state:t,setActiveWorkspace:i,createWorkspace:a,renameWorkspace:o,notify:c}),m=xa({section:e.section,sessionsState:d,error:n,toasts:s,notify:c});(0,x.useEffect)(()=>{e.normalizeRoute()},[e]),(0,x.useEffect)(()=>{window.__HEDDLE_CAPTURE_LAYOUT_SNAPSHOT=async e=>{await m(e?.screenshot??`none`)};let e=e=>{if(!(e.metaKey||e.ctrlKey)||!e.shiftKey||e.key.toLowerCase()!==`d`)return;let t=e.target;t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement||(e.preventDefault(),m(`none`))};return window.addEventListener(`keydown`,e),()=>{window.__HEDDLE_CAPTURE_LAYOUT_SNAPSHOT&&delete window.__HEDDLE_CAPTURE_LAYOUT_SNAPSHOT,window.removeEventListener(`keydown`,e)}},[m]);let h=t?O_(t,d,f,p):(0,G.jsx)(Sm,{title:`Loading state`,children:(0,G.jsx)(`p`,{className:`muted`,children:n??`Reading local Heddle state...`})});return l?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Fm,{section:e.section,onSectionChange:e.setSection,state:t,error:n,onSetActiveWorkspace:e=>void p.switchWorkspace(e),onCaptureDebugSnapshot:e=>void m(e),onRefresh:()=>void r(),children:h}),(0,G.jsx)(E_,{})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(jm,{activeSection:e.section,sessionPath:e.routeSessionId?`/sessions/${encodeURIComponent(e.routeSessionId)}`:`/sessions`,state:t,error:n,onSetActiveWorkspace:e=>void p.switchWorkspace(e),onCaptureDebugSnapshot:e=>void m(e),onRefresh:()=>void r(),children:h}),(0,G.jsx)(E_,{})]})}function O_(e,t,n,r){return(0,G.jsxs)(At,{children:[(0,G.jsx)(Ot,{path:`/overview`,element:(0,G.jsx)(Lm,{state:e})}),(0,G.jsx)(Ot,{path:`/sessions`,element:(0,G.jsx)(k_,{state:e,sessionsState:t})}),(0,G.jsx)(Ot,{path:`/sessions/:sessionId/*`,element:(0,G.jsx)(k_,{state:e,sessionsState:t})}),(0,G.jsx)(Ot,{path:`/tasks`,element:(0,G.jsx)(Xh,{tasks:e.heartbeat.tasks,runs:e.heartbeat.runs,selectedTask:n.selectedTask,selectedTaskId:n.selectedTaskId,onSelectTask:n.setSelectedTaskId,selectedRun:n.selectedRun,selectedRunId:n.selectedRunId,onSelectRun:n.setSelectedRunId,selectedTaskRuns:n.selectedTaskRuns,pendingTaskAction:n.pendingTaskAction,onEnableTask:n.enableTask,onDisableTask:n.disableTask,onTriggerTask:n.triggerTask})}),(0,G.jsx)(Ot,{path:`/workspaces`,element:(0,G.jsx)(Zh,{state:e,creatingWorkspace:r.creatingWorkspace,renamingWorkspaceId:r.renamingWorkspaceId,onCreateWorkspace:r.createWorkspace,onRenameWorkspace:r.renameWorkspace,onSetActiveWorkspace:e=>void r.switchWorkspace(e)})}),(0,G.jsx)(Ot,{path:`*`,element:(0,G.jsx)(Dt,{to:`/overview`,replace:!0})})]})}function k_({state:e,sessionsState:t}){return(0,G.jsx)(Mh,{sessions:e.sessions,activeSession:t.activeSession,sessionDetail:t.sessionDetail,sessionDetailLoading:t.sessionDetailLoading,sessionDetailError:t.sessionDetailError,selectedSessionId:t.selectedSessionId,onSelectSession:t.setSelectedSessionId,selectedTurnId:t.selectedTurnId,onSelectTurn:t.setSelectedTurnId,selectedTurn:t.selectedTurn,turnReview:t.turnReview,turnReviewLoading:t.turnReviewLoading,turnReviewError:t.turnReviewError,sendingPrompt:t.sendingPrompt,runInFlight:t.runInFlight,memoryUpdating:t.memoryUpdating,sendPromptError:t.sendPromptError,onSendPrompt:t.sendPrompt,creatingSession:t.creatingSession,sessionNotice:t.sessionNotice,onCreateSession:t.createSession,onContinueSession:t.continueSession,onCancelSessionRun:t.cancelSessionRun,onUpdateSessionSettings:t.updateSessionSettings,pendingApproval:t.pendingApproval,onResolveApproval:t.resolveApproval})}(0,zn.createRoot)(document.getElementById(`root`)).render((0,G.jsx)(x.StrictMode,{children:(0,G.jsx)(vn,{children:(0,G.jsx)(D_,{})})}));
53
+ `),n=[],r=[],i=[],a=[],o=null,s=()=>{r.length&&(n.push((0,G.jsx)(`p`,{children:rh(r.join(` `))},`p-${n.length}`)),r=[])},c=()=>{i.length&&(n.push((0,G.jsx)(`ul`,{children:i.map((e,t)=>(0,G.jsxs)(`li`,{children:[typeof e.checked==`boolean`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:e.checked,readOnly:!0,disabled:!0}),` `]}):null,rh(e.content)]},t))},`ul-${n.length}`)),i=[])},l=()=>{a.length&&(n.push((0,G.jsx)(`ol`,{children:a.map((e,t)=>(0,G.jsx)(`li`,{children:rh(e)},t))},`ol-${n.length}`)),a=[])},u=()=>{o&&=(n.push((0,G.jsx)(`pre`,{className:`code-block`,children:(0,G.jsx)(`code`,{children:o.join(`
54
+ `)})},`code-${n.length}`)),null)};for(let e of t){if(e.trim().startsWith("```")){s(),c(),l(),o?u():o=[];continue}if(o){o.push(e);continue}let t=e.match(/^(#{1,4})\s+(.*)$/);if(t){s(),c(),l();let e=t[1].length,r=rh(t[2]??``);e===1?n.push((0,G.jsx)(`h1`,{children:r},`h1-${n.length}`)):e===2?n.push((0,G.jsx)(`h2`,{children:r},`h2-${n.length}`)):e===3?n.push((0,G.jsx)(`h3`,{children:r},`h3-${n.length}`)):n.push((0,G.jsx)(`h4`,{children:r},`h4-${n.length}`));continue}let d=e.match(/^[-*]\s+\[( |x|X)\]\s+(.*)$/);if(d){s(),l(),i.push({checked:d[1].toLowerCase()===`x`,content:d[2]??``});continue}let f=e.match(/^[-*]\s+(.*)$/);if(f){s(),l(),i.push({content:f[1]??``});continue}let p=e.match(/^\d+\.\s+(.*)$/);if(p){s(),c(),a.push(p[1]??``);continue}if(!e.trim()){s(),c(),l();continue}r.push(e.trim())}return s(),c(),l(),u(),n.length?n:e}function rh(e){let t=[],n=/`([^`]+)`/g,r=0,i;for(;(i=n.exec(e))!==null;)i.index>r&&t.push(e.slice(r,i.index)),t.push((0,G.jsx)(`code`,{className:`inline-code`,children:i[1]},`code-${i.index}`)),r=i.index+i[0].length;return r<e.length&&t.push(e.slice(r)),t.map((e,t)=>(0,G.jsx)(x.Fragment,{children:e},t))}var ih=x.forwardRef(({className:e,...t},n)=>(0,G.jsx)(`textarea`,{className:vs(`flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:n,...t}));ih.displayName=`Textarea`;function ah({activeView:e,title:t,subtitle:n,onBackToSessions:r,onOpenChat:i,onOpenReview:a}){return(0,G.jsxs)(`header`,{className:`shrink-0 border-b border-border bg-card px-3 py-2`,children:[(0,G.jsxs)(`div`,{className:`grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2`,children:[(0,G.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs`,onClick:r,children:`‹ Sessions`}),(0,G.jsxs)(`div`,{className:`min-w-0 text-center`,children:[(0,G.jsx)(`h2`,{className:`m-0 truncate text-sm font-semibold leading-5 tracking-normal`,children:t}),n?(0,G.jsx)(`p`,{className:`m-0 truncate text-xs leading-4 text-muted-foreground`,children:n}):null]}),(0,G.jsx)(`div`,{className:`w-[76px]`,"aria-hidden":`true`})]}),(0,G.jsxs)(`nav`,{className:`mt-2 grid grid-cols-2 rounded-md bg-muted p-1`,"aria-label":`Session views`,children:[(0,G.jsx)(oh,{active:e===`chat`,onClick:i,children:`Chat`}),(0,G.jsx)(oh,{active:e===`review`,onClick:a,children:`Review`})]})]})}function oh({active:e,onClick:t,children:n}){return(0,G.jsx)(`button`,{type:`button`,className:vs(`h-8 rounded-md text-xs font-medium text-muted-foreground transition-colors`,e&&`bg-background text-foreground shadow-sm`),"aria-current":e?`page`:void 0,onClick:t,children:n})}var sh=new Set([`run_shell_mutate`,`edit_file`,`write_to_file`,`delete_file`,`apply_patch`]);function ch({approval:e,open:t,onOpenChange:n,onResolve:r}){if(!e||!t)return null;let i=sh.has(e.tool)?`high`:`medium`,a=lh(e.input),o=uh(e.input),s=fh(e.input);return(0,G.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-end`,role:`dialog`,"aria-modal":`true`,"aria-label":`Pending approval details`,children:[(0,G.jsx)(`button`,{type:`button`,className:`absolute inset-0 bg-black/45`,"aria-label":`Close approval details`,onClick:()=>n(!1)}),(0,G.jsxs)(`section`,{className:`relative z-10 flex max-h-[82dvh] w-full flex-col rounded-t-2xl border border-border bg-card`,children:[(0,G.jsx)(`header`,{className:`shrink-0 border-b border-border px-3 py-3`,children:(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`p`,{className:`m-0 text-sm font-semibold`,children:[`Approval required: `,e.tool]}),(0,G.jsxs)(`p`,{className:`m-0 mt-1 truncate text-xs text-muted-foreground`,children:[`Call ID: `,e.callId]}),(0,G.jsxs)(`p`,{className:`m-0 mt-1 truncate text-xs text-muted-foreground`,children:[`Requested: `,new Date(e.requestedAt).toLocaleString()]})]}),(0,G.jsxs)(K,{variant:i===`high`?`destructive`:`secondary`,children:[i,` risk`]})]})}),(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-3`,children:[(0,G.jsxs)(`dl`,{className:`grid gap-2 text-xs`,children:[(0,G.jsxs)(`div`,{className:`rounded-md border border-border bg-background px-2 py-2`,children:[(0,G.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Path target`}),(0,G.jsx)(`dd`,{className:`m-0 mt-1 break-all text-muted-foreground`,children:a??`No explicit path in payload`})]}),(0,G.jsxs)(`div`,{className:`rounded-md border border-border bg-background px-2 py-2`,children:[(0,G.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Command target`}),(0,G.jsx)(`dd`,{className:`m-0 mt-1 break-all text-muted-foreground`,children:o??`No explicit command in payload`})]})]}),(0,G.jsxs)(`div`,{className:`mt-3 rounded-md border border-border bg-background`,children:[(0,G.jsx)(`div`,{className:`border-b border-border px-2 py-2 text-xs font-medium`,children:`Raw payload`}),(0,G.jsx)(`pre`,{className:`m-0 max-h-[34dvh] overflow-auto whitespace-pre-wrap break-words px-2 py-2 text-[11px] leading-4 text-muted-foreground`,children:s})]})]}),(0,G.jsx)(`footer`,{className:`sticky bottom-0 z-10 shrink-0 border-t border-border bg-card px-3 py-3 pb-[calc(env(safe-area-inset-bottom)+0.75rem)]`,children:(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,G.jsx)(q,{type:`button`,className:`h-11`,onClick:()=>r(!0),children:`Approve`}),(0,G.jsx)(q,{type:`button`,variant:`outline`,className:`h-11`,onClick:()=>r(!1),children:`Deny`})]})})]})]})}function lh(e){let t=dh(e,[`targetFile`,`file_path`,`filePath`,`path`,`paths`,`absolute_path`]);if(t)return t}function uh(e){return dh(e,[`command`,`CommandLine`,`cmd`])}function dh(e,t){if(!(!e||typeof e!=`object`))for(let n of t){let t=e[n];if(typeof t==`string`&&t.trim())return t;if(Array.isArray(t)){let e=t.filter(e=>typeof e==`string`&&!!e.trim());if(e.length>0)return e.slice(0,3).join(`, `)}}}function fh(e){if(e===void 0)return`No payload provided.`;try{return JSON.stringify(e,null,2)??String(e)}catch{return String(e)}}function ph({activeSession:e,sessionDetail:t,sessionDetailLoading:n,sessionDetailError:r,selectedSessionId:i,runActive:a,runInFlight:o,memoryUpdating:s,sendPromptError:c,sessionNotice:l,draft:u,pendingApproval:d,conversationScrollRef:f,textareaRef:p,mentionMenu:m,renderMessage:h,onDraftChange:g,onComposerKeyDown:_,onBackToSessions:v,onOpenReview:y,onSubmitPrompt:b,onContinueSession:S,onCancelSessionRun:C,onResolveApproval:w}){let T=!!(i&&!a&&u.trim()),E=!!(i&&!a&&t?.lastContinuePrompt),D=t?.name??e?.name??`Chat session`,O=(t?.context?.compactionStatus??e?.context?.compactionStatus)===`running`,[ee,k]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{d||k(!1)},[d]),(0,G.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col bg-background`,children:[(0,G.jsx)(ah,{activeView:`chat`,title:D,subtitle:e?`updated ${Fa(e.updatedAt)}`:`Pick a session`,onBackToSessions:v,onOpenChat:()=>void 0,onOpenReview:y}),(0,G.jsx)(`div`,{ref:f,className:`min-h-0 flex-1 overflow-y-auto px-3 py-3`,children:(0,G.jsx)(`div`,{className:`flex min-h-full flex-col justify-end gap-3`,children:n?(0,G.jsx)(_h,{title:`Loading session`,body:`Fetching conversation state.`}):r?(0,G.jsx)(_h,{title:`Session load failed`,body:r}):t&&t.messages.length?t.messages.map(e=>h(e)):(0,G.jsx)(_h,{title:`No conversation`,body:`Start with a prompt from the composer.`})})}),(0,G.jsx)(mh,{draft:u,disabled:!i||a,runActive:a,runInFlight:o,memoryUpdating:s,canSend:T,canContinue:E,pendingApproval:d,compacting:O,onOpenApprovalSheet:()=>k(!0),sendPromptError:c,sessionNotice:l,textareaRef:p,mentionMenu:m,onDraftChange:g,onComposerKeyDown:_,onSubmitPrompt:b,onContinueSession:S,onCancelSessionRun:C}),(0,G.jsx)(ch,{approval:d,open:ee,onOpenChange:k,onResolve:e=>{w(e),k(!1)}})]})}function mh({draft:e,disabled:t,runActive:n,runInFlight:r,memoryUpdating:i,canSend:a,canContinue:o,pendingApproval:s,compacting:c,onOpenApprovalSheet:l,sendPromptError:u,sessionNotice:d,textareaRef:f,mentionMenu:p,onDraftChange:m,onComposerKeyDown:h,onSubmitPrompt:g,onContinueSession:_,onCancelSessionRun:v}){let y=c?`Compacting earlier conversation history into an archive summary.`:u??d??(i?`Memory updating in the background.`:void 0);return(0,G.jsxs)(`footer`,{className:`relative shrink-0 border-t border-border bg-card px-2 py-2`,children:[s?(0,G.jsx)(hh,{approval:s,onOpen:l}):null,p,(0,G.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,G.jsx)(ih,{ref:f,rows:1,value:e,className:`max-h-24 min-h-10 resize-none rounded-md bg-background px-3 py-2 text-base leading-6 md:text-sm md:leading-5`,disabled:t,placeholder:n?`Heddle is working...`:`Message Heddle`,onChange:e=>m(e.target.value,e.target.selectionStart),onClick:t=>m(e,t.currentTarget.selectionStart),onSelect:t=>m(e,t.currentTarget.selectionStart),onKeyDown:h}),(0,G.jsx)(q,{type:`button`,size:`sm`,className:`h-10 shrink-0 px-3`,disabled:!a,onClick:g,children:`Send`})]}),(0,G.jsxs)(`div`,{className:`mt-1 flex items-center justify-between gap-2`,children:[(0,G.jsx)(`div`,{className:`min-w-0`,children:y?(0,G.jsx)(`p`,{className:`m-0 truncate text-xs text-muted-foreground`,children:y}):(0,G.jsx)(gh,{runActive:n})}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,G.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs`,disabled:!o,onClick:_,children:`Continue`}),(0,G.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs`,disabled:!r,onClick:v,children:`Cancel`})]})]})]})}function hh({approval:e,onOpen:t}){return(0,G.jsxs)(`button`,{type:`button`,className:`mb-2 flex w-full items-center justify-between gap-2 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-left`,onClick:t,"aria-label":`Open pending approval for ${e.tool}`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`p`,{className:`m-0 truncate text-xs font-semibold text-foreground`,children:[`Approval required: `,e.tool]}),(0,G.jsx)(`p`,{className:`m-0 truncate text-[11px] text-muted-foreground`,children:`Tap for details and actions`})]}),(0,G.jsx)(K,{variant:`destructive`,className:`shrink-0`,children:`Pending`})]})}function gh({runActive:e}){return(0,G.jsx)(K,{variant:e?`outline`:`secondary`,children:e?`working`:`idle`})}function _h({title:e,body:t}){return(0,G.jsxs)(`div`,{className:`rounded-md border border-border bg-card px-3 py-3`,children:[(0,G.jsx)(`p`,{className:`m-0 text-sm font-semibold text-foreground`,children:e}),(0,G.jsx)(`p`,{className:`m-0 mt-1 text-xs text-muted-foreground`,children:t})]})}function vh({diff:e,patch:t,fallbackTitle:n=`Raw patch`}){return e?.binary?(0,G.jsx)(Cm,{title:`Binary file`,body:`Git reports this as a binary diff, so Heddle cannot render line-level changes.`}):e?.hunks.length?(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-background font-mono text-xs`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 border-b border-border bg-muted/30 px-3 py-2 font-sans`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`truncate text-sm font-semibold text-foreground`,children:e.path}),e.oldPath?(0,G.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[`from `,e.oldPath]}):null]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,G.jsx)($,{children:e.status}),(0,G.jsxs)($,{tone:`good`,children:[`+`,e.additions,` / -`,e.deletions]})]})]}),(0,G.jsx)(`div`,{className:`max-h-[44rem] overflow-auto`,children:e.hunks.map((e,t)=>(0,G.jsx)(`table`,{className:`w-full border-collapse`,children:(0,G.jsxs)(`tbody`,{children:[(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:2,className:`border-y border-border bg-muted/40 px-3 py-1 font-mono text-[11px] text-muted-foreground`,children:e.header})}),e.lines.map((t,n)=>(0,G.jsxs)(`tr`,{className:Na(t.type===`added`&&`bg-emerald-500/10`,t.type===`deleted`&&`bg-rose-500/10`),children:[(0,G.jsx)(`td`,{className:`w-14 select-none border-r border-border px-2 py-0.5 text-right text-muted-foreground/70`,children:t.type===`added`?t.newLineNumber:t.oldLineNumber??t.newLineNumber??``}),(0,G.jsx)(`td`,{className:`whitespace-pre px-3 py-0.5 text-foreground`,children:t.content})]},`${e.header}-${t.oldLineNumber??``}-${t.newLineNumber??``}-${n}`))]})},`${e.header}-${t}`))})]}):t?(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,G.jsx)($,{tone:`warn`,children:n}),(0,G.jsx)(`span`,{className:`min-w-0 text-xs text-muted-foreground`,children:`Structured hunks are unavailable for this patch.`})]}),(0,G.jsx)(Om,{children:t})]}):(0,G.jsx)(Cm,{title:`No patch available`,body:`Git reports this file as changed, but no patch text is available for it.`})}function yh({activeSession:e,sessionDetail:t,selectedTurnId:n,selectedTurn:r,turnReview:i,turnReviewLoading:a,turnReviewError:o,workspaceChanges:s,workspaceChangesLoading:c,workspaceChangesError:l,selectedWorkspaceFile:u,workspaceFileDiff:d,workspaceFileDiffLoading:f,workspaceFileDiffError:p,onSelectWorkspaceFile:m,onRefreshWorkspaceReview:h,selectedTurnPatchIsStale:g,onOpenDiff:_,onBackToSessions:v,onOpenChat:y,onSelectTurn:b}){let[S,C]=(0,x.useState)(`current`),[w,T]=(0,x.useState)(),E=t?.name??e?.name??`Session`,D=`Review evidence`,O=i?.files.find(e=>e.path===w)??i?.files[0],ee=i?.files[0]?.path;(0,x.useEffect)(()=>{T(ee)},[ee,n,i?.traceFile]);let k=(0,x.useMemo)(()=>i?[{label:`Review`,commands:i.reviewCommands},{label:`Verification`,commands:i.verificationCommands},{label:`Mutation`,commands:i.mutationCommands}]:[],[i]);return(0,G.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col bg-background`,children:[(0,G.jsx)(ah,{activeView:`review`,title:E,subtitle:e?`${D} · updated ${Fa(e.updatedAt)}`:D,onBackToSessions:v,onOpenChat:y,onOpenReview:()=>void 0}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-3`,children:(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsxs)(`nav`,{className:`grid grid-cols-3 rounded-md bg-muted p-1`,"aria-label":`Review evidence tabs`,children:[(0,G.jsx)(Ch,{active:S===`current`,onClick:()=>C(`current`),children:`Current`}),(0,G.jsx)(Ch,{active:S===`turn`,onClick:()=>C(`turn`),children:`Turn`}),(0,G.jsx)(Ch,{active:S===`evidence`,onClick:()=>C(`evidence`),children:`Evidence`})]}),S===`current`?(0,G.jsx)(bh,{title:`Current workspace changes`,actions:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[g?(0,G.jsx)(K,{variant:`outline`,children:`live diff differs`}):null,(0,G.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:h,disabled:c||f,children:`Refresh`})]}),children:c?(0,G.jsx)(wh,{title:`Loading workspace diff`,body:`Reading current Git changes from the active workspace.`}):l?(0,G.jsx)(wh,{title:`Workspace diff failed`,body:l}):s?.vcs===`none`?(0,G.jsx)(wh,{title:`Not a git workspace`,body:s.error??`Current workspace changes require a Git-backed project.`}):s?.files.length?(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(`div`,{className:`flex gap-2 overflow-x-auto pb-1`,children:s.files.map(e=>(0,G.jsxs)(`button`,{type:`button`,className:`shrink-0 rounded-md border px-2 py-1 text-left text-[11px] ${u?.path===e.path?`border-primary bg-primary/5 text-foreground`:`border-border bg-background text-muted-foreground`}`,onClick:()=>m(e.path),children:[(0,G.jsx)(`span`,{className:`block max-w-44 truncate font-medium`,children:e.path}),(0,G.jsxs)(`span`,{className:`block`,children:[e.status,e.additions!==void 0||e.deletions!==void 0?` · +${e.additions??0} / -${e.deletions??0}`:``]})]},`workspace-${e.path}`))}),f?(0,G.jsx)(wh,{title:`Loading file diff`,body:`Reading the selected file patch.`}):p?(0,G.jsx)(wh,{title:`File diff failed`,body:p}):d?.error?(0,G.jsx)(wh,{title:`File diff unavailable`,body:d.error}):d?.patch?(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>_({title:u?.path??d.path,subtitle:`Current workspace diff`,diff:d.diff,patch:d.patch,fallbackTitle:`Raw workspace patch`}),children:`Open full diff`}),(0,G.jsx)(vh,{diff:d.diff,patch:d.patch,fallbackTitle:`Raw workspace patch`})]}):(0,G.jsx)(wh,{title:`No patch available`,body:`Git reports this file as changed, but no patch text is available for it.`})]}):(0,G.jsx)(wh,{title:`Clean workspace`,body:`Git does not report current project file changes.`})}):S===`evidence`?(0,G.jsx)(`div`,{className:`space-y-3`,children:a?(0,G.jsx)(wh,{title:`Loading review`,body:`Reading trace-backed review evidence for the selected turn.`}):o?(0,G.jsx)(wh,{title:`Review load failed`,body:o}):(0,G.jsxs)(G.Fragment,{children:[k.map(e=>(0,G.jsx)(xh,{label:e.label,commands:e.commands},e.label)),(0,G.jsx)(Sh,{turnReview:i,selectedTurn:r})]})}):(0,G.jsxs)(bh,{title:`Captured turn diff`,children:[t?.turns.length?(0,G.jsx)(`div`,{className:`mb-2 flex gap-2 overflow-x-auto pb-1`,children:[...t.turns].reverse().map(e=>(0,G.jsxs)(`button`,{type:`button`,className:`shrink-0 rounded-md border px-2 py-1 text-left text-[11px] ${e.id===n?`border-primary bg-primary/5 text-foreground`:`border-border bg-background text-muted-foreground`}`,onClick:()=>b(e.id),children:[(0,G.jsx)(`span`,{className:`block max-w-44 truncate font-medium`,children:e.prompt}),(0,G.jsxs)(`span`,{className:`block`,children:[e.outcome,` · `,e.steps,` steps`]})]},e.id))}):null,a?(0,G.jsx)(wh,{title:`Loading review`,body:`Reading trace-backed review evidence for the selected turn.`}):o?(0,G.jsx)(wh,{title:`Review load failed`,body:o}):i?.files.length?(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(`div`,{className:`flex gap-2 overflow-x-auto pb-1`,children:i.files.map(e=>(0,G.jsxs)(`button`,{type:`button`,className:`shrink-0 rounded-md border px-2 py-1 text-left text-[11px] ${O?.path===e.path?`border-primary bg-primary/5 text-foreground`:`border-border bg-background text-muted-foreground`}`,onClick:()=>T(e.path),children:[(0,G.jsx)(`span`,{className:`block max-w-44 truncate font-medium`,children:e.path}),(0,G.jsxs)(`span`,{className:`block`,children:[e.status,` · `,e.source,e.truncated?` · truncated`:``]})]},`${e.source}-${e.path}`))}),O?.patch?(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>_({title:O.path,subtitle:`Captured turn diff`,diff:O.diff,patch:O.patch,fallbackTitle:`Raw turn patch`}),children:`Open full diff`}),(0,G.jsx)(vh,{diff:O.diff,patch:O.patch,fallbackTitle:`Raw turn patch`})]}):(0,G.jsx)(wh,{title:`No patch captured`,body:`This file was changed, but the turn did not capture patch text for it.`})]}):i?.diffExcerpt?(0,G.jsx)(`pre`,{className:`max-h-[52dvh] overflow-auto rounded-md border border-border bg-background p-2 text-[11px] leading-4 text-muted-foreground`,children:i.diffExcerpt}):(0,G.jsx)(wh,{title:`No changed files`,body:`This turn did not capture structured file review data.`})]})]})})]})}function bh({title:e,actions:t,children:n}){return(0,G.jsxs)(`section`,{className:`rounded-md border border-border bg-card px-3 py-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(`p`,{className:`m-0 text-sm font-semibold text-foreground`,children:e}),t]}),(0,G.jsx)(`div`,{className:`mt-2`,children:n})]})}function xh({label:e,commands:t}){return(0,G.jsx)(bh,{title:`${e} commands`,children:t.length?(0,G.jsx)(`div`,{className:`space-y-2`,children:t.map(t=>(0,G.jsxs)(`div`,{className:`rounded-md border border-border bg-background px-2 py-2`,children:[(0,G.jsx)(`p`,{className:`m-0 break-words text-xs font-medium text-foreground`,children:t.command}),(0,G.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:[(0,G.jsx)(K,{variant:`outline`,children:t.tool}),(0,G.jsxs)(K,{variant:t.exitCode===0?`secondary`:`outline`,children:[`exit `,t.exitCode??`n/a`]})]}),t.stdout?(0,G.jsx)(`pre`,{className:`mt-2 max-h-36 overflow-auto rounded border border-border bg-card p-2 text-[11px] leading-4 text-muted-foreground`,children:t.stdout}):null,t.stderr?(0,G.jsx)(`pre`,{className:`mt-2 max-h-36 overflow-auto rounded border border-border bg-card p-2 text-[11px] leading-4 text-destructive`,children:t.stderr}):null]},`${e}-${t.tool}-${t.command}`))}):(0,G.jsx)(wh,{title:`No commands`,body:`No ${e.toLowerCase()} commands captured for this turn.`})})}function Sh({turnReview:e,selectedTurn:t}){return(0,G.jsx)(bh,{title:`Approvals and events`,children:e?.approvals.length?(0,G.jsx)(`div`,{className:`space-y-2`,children:e.approvals.map((e,t)=>(0,G.jsxs)(`div`,{className:`rounded-md border border-border bg-background px-2 py-2`,children:[(0,G.jsx)(`p`,{className:`m-0 text-xs font-medium text-foreground`,children:e.tool}),(0,G.jsx)(`p`,{className:`m-0 mt-1 break-words text-[11px] text-muted-foreground`,children:e.command??`no command details`}),(0,G.jsx)(`div`,{className:`mt-1`,children:(0,G.jsx)(K,{variant:e.approved?`secondary`:`destructive`,children:e.approved?`approved`:`rejected`})}),e.reason?(0,G.jsx)(`p`,{className:`m-0 mt-1 text-[11px] text-muted-foreground`,children:e.reason}):null]},`${e.tool}-${e.timestamp??t}`))}):t?.events.length?(0,G.jsx)(`div`,{className:`space-y-1`,children:t.events.map((e,n)=>(0,G.jsx)(`p`,{className:`m-0 rounded-md border border-border bg-background px-2 py-2 text-[11px] text-muted-foreground`,children:e},`${t.id}-${n}`))}):(0,G.jsx)(wh,{title:`No approvals or events`,body:`Turn-level approvals and events will appear here.`})})}function Ch({active:e,onClick:t,children:n}){return(0,G.jsx)(`button`,{type:`button`,className:`h-8 rounded-md text-[11px] font-medium ${e?`bg-background text-foreground shadow-sm`:`text-muted-foreground`}`,"aria-current":e?`page`:void 0,onClick:t,children:n})}function wh({title:e,body:t}){return(0,G.jsxs)(`div`,{className:`rounded-md border border-border bg-background px-3 py-3`,children:[(0,G.jsx)(`p`,{className:`m-0 text-sm font-semibold text-foreground`,children:e}),(0,G.jsx)(`p`,{className:`m-0 mt-1 text-xs text-muted-foreground`,children:t})]})}function Th({reviewMode:e,onReviewModeChange:t,onShowChatView:n,workspaceChanges:r,workspaceChangesLoading:i,workspaceChangesError:a,workspaceFileDiffsByPath:o,workspaceFileDiffLoading:s,workspaceFileDiffError:c,selectedTurnPatchIsStale:l,onSelectWorkspaceFile:u,onRefreshWorkspaceReview:d,sessionDetail:f,selectedTurnId:p,onSelectTurn:m,turnReview:h,turnReviewLoading:g,turnReviewError:_,onSelectReviewFile:v,selectedTurn:y,onOpenDiff:b}){return(0,G.jsxs)(`aside`,{className:`workspace-side`,children:[(0,G.jsx)(`div`,{className:`mobile-side-header`,children:(0,G.jsx)(`button`,{className:`mobile-nav-button`,type:`button`,onClick:n,children:`← Chat`})}),(0,G.jsxs)(`div`,{className:`side-scroll`,children:[(0,G.jsxs)(`nav`,{className:`side-tabs review-mode-tabs`,role:`tablist`,"aria-label":`Review mode`,children:[(0,G.jsx)(`button`,{className:Na(e===`current`&&`active`),type:`button`,onClick:()=>t(`current`),children:`Current`}),(0,G.jsx)(`button`,{className:Na(e===`turn`&&`active`),type:`button`,onClick:()=>t(`turn`),children:`Turn history`}),(0,G.jsx)(`button`,{className:Na(e===`evidence`&&`active`),type:`button`,onClick:()=>t(`evidence`),children:`Evidence`})]}),e===`current`?(0,G.jsx)(Eh,{workspaceChanges:r,workspaceChangesLoading:i,workspaceChangesError:a,workspaceFileDiffsByPath:o,workspaceFileDiffLoading:s,workspaceFileDiffError:c,selectedTurnPatchIsStale:l,onSelectWorkspaceFile:u,onRefresh:d,onOpenDiff:b}):e===`turn`?(0,G.jsx)(Dh,{sessionDetail:f,selectedTurnId:p,onSelectTurn:m,turnReview:h,turnReviewLoading:g,turnReviewError:_,onSelectReviewFile:v,onOpenDiff:b}):(0,G.jsx)(Ah,{turnReview:h,selectedTurn:y})]})]})}function Eh({workspaceChanges:e,workspaceChangesLoading:t,workspaceChangesError:n,workspaceFileDiffsByPath:r,workspaceFileDiffLoading:i,workspaceFileDiffError:a,selectedTurnPatchIsStale:o,onSelectWorkspaceFile:s,onRefresh:c,onOpenDiff:l}){let u=Nh(e?.files??[],r);return(0,G.jsx)(Am,{title:`Current workspace changes`,testId:`review-current-workspace`,actions:(0,G.jsxs)(`div`,{className:`review-section-actions`,children:[o?(0,G.jsx)(Oh,{}):null,u.files?.length?(0,G.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,disabled:i,onClick:()=>l(u),children:`Open full diff`}):null,(0,G.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:c,disabled:t||i,children:`Refresh`})]}),children:t?(0,G.jsx)(Cm,{title:`Loading workspace diff`,body:`Reading current Git changes from the active workspace.`}):n?(0,G.jsx)(Cm,{title:`Workspace diff failed`,body:n}):e?.vcs===`none`?(0,G.jsx)(Cm,{title:`Not a git workspace`,body:e.error??`Current workspace changes require a Git-backed project.`}):e?.files.length?(0,G.jsx)(`div`,{className:`detail-stack compact-stack`,children:(0,G.jsx)(jh,{files:e.files,sourceLabel:`current git`,testId:`review-current-file-list`,onSelect:s,renderContent:e=>{let t=r[e.path];return(0,G.jsx)(Mh,{loading:i,error:a,diffError:t?.error,patch:t?.patch,diff:t?.diff,unavailableTitle:`No patch available`,unavailableBody:`Git reports this file as changed, but no patch text is available for it.`,loadingTitle:`Loading file diff`,loadingBody:`Reading the selected file patch.`,fallbackTitle:`Raw workspace patch`})}})}):(0,G.jsx)(Cm,{title:`Clean workspace`,body:`Git does not report current project file changes.`})})}function Dh({sessionDetail:e,selectedTurnId:t,onSelectTurn:n,turnReview:r,turnReviewLoading:i,turnReviewError:a,onSelectReviewFile:o,onOpenDiff:s}){let c=Ph(r?.files??[]);return(0,G.jsxs)(Am,{title:`Captured turn diff`,actions:c.files?.length?(0,G.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>s(c),children:`Open full diff`}):void 0,children:[e?.turns.length?(0,G.jsx)(`div`,{className:`stack-list compact review-turn-picker`,children:[...e.turns].reverse().map(e=>(0,G.jsx)(Jm,{turn:e,active:e.id===t,onClick:()=>n(e.id)},e.id))}):null,i?(0,G.jsx)(Cm,{title:`Loading review`,body:`Reading trace-backed review evidence for the selected turn.`}):a?(0,G.jsx)(Cm,{title:`Review load failed`,body:a}):r?.files.length?(0,G.jsx)(`div`,{className:`detail-stack compact-stack`,children:(0,G.jsx)(jh,{files:r.files,testId:`review-turn-file-list`,onSelect:o,renderContent:e=>(0,G.jsx)(Mh,{patch:`patch`in e?e.patch:void 0,diff:`diff`in e?e.diff:void 0,unavailableTitle:`No patch captured`,unavailableBody:`This file was changed, but the turn did not capture patch text for it.`,fallbackTitle:`Raw turn patch`})})}):r?.diffExcerpt?(0,G.jsx)(Om,{children:r.diffExcerpt}):(0,G.jsx)(Cm,{title:`No captured diff`,body:`This selected turn did not save file-level diff evidence. Check Evidence for commands and approvals.`})]})}function Oh(){return(0,G.jsx)(Xd,{delayDuration:120,children:(0,G.jsxs)(Zd,{children:[(0,G.jsx)(Qd,{asChild:!0,children:(0,G.jsx)(`button`,{className:`stale-diff-button`,type:`button`,"aria-label":`Current workspace differs from captured turn`,children:`i`})}),(0,G.jsx)($d,{side:`left`,className:`max-w-64`,children:`The selected file also has trace-backed turn evidence, but the current Git patch is different. Treat Current as live workspace state.`})]})})}function kh({diff:e,onClose:t}){return e?(0,G.jsx)(`div`,{className:`diff-dialog-backdrop`,role:`presentation`,onMouseDown:t,children:(0,G.jsxs)(`section`,{className:`diff-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`${e.subtitle}: ${e.title}`,onMouseDown:e=>e.stopPropagation(),children:[(0,G.jsxs)(`header`,{className:`diff-dialog-header`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`topbar-eyebrow`,children:`Diff review`}),(0,G.jsx)(`h2`,{children:e.title}),(0,G.jsx)(`p`,{className:`muted`,children:e.subtitle})]}),(0,G.jsx)(q,{type:`button`,variant:`outline`,onClick:t,children:`Close`})]}),(0,G.jsx)(`div`,{className:`diff-dialog-body`,children:e.files?.length?(0,G.jsx)(`div`,{className:`detail-stack`,children:e.files.map(e=>(0,G.jsx)(vh,{diff:e.diff,patch:e.patch,fallbackTitle:e.fallbackTitle},e.title))}):(0,G.jsx)(vh,{diff:e.diff,patch:e.patch,fallbackTitle:e.fallbackTitle})})]})}):null}function Ah({turnReview:e,selectedTurn:t}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Am,{title:`Review commands`,children:(0,G.jsx)(Ym,{commands:e?.reviewCommands??[],empty:`No git review commands captured for this turn.`})}),(0,G.jsx)(Am,{title:`Verification commands`,children:(0,G.jsx)(Ym,{commands:e?.verificationCommands??[],empty:`No verification commands captured for this turn.`})}),(0,G.jsx)(Am,{title:`Approvals and events`,children:e?.approvals.length?(0,G.jsx)(`div`,{className:`stack-list compact`,children:e.approvals.map((e,t)=>(0,G.jsxs)(`div`,{className:`detail-card`,children:[(0,G.jsx)(`p`,{className:`card-title`,children:e.tool}),(0,G.jsx)(`p`,{className:`muted`,children:e.command??`no command details`}),(0,G.jsx)(`div`,{className:`pills`,children:(0,G.jsx)($,{tone:e.approved?`good`:`warn`,children:e.approved?`approved`:`rejected`})}),e.reason?(0,G.jsx)(`p`,{className:`summary`,children:e.reason}):null]},`${e.tool}-${e.timestamp??t}`))}):t?.events.length?(0,G.jsx)(`div`,{className:`event-list`,children:t.events.map((e,n)=>(0,G.jsx)(`p`,{className:`event-line`,children:e},`${t.id}-${n}`))}):(0,G.jsx)(Cm,{title:`No approvals or events`,body:`Turn-level approvals, tool review, or summarized events will appear here.`})})]})}function jh({files:e,sourceLabel:t,testId:n,onSelect:r,renderContent:i}){let[a,o]=(0,x.useState)([]);return(0,x.useEffect)(()=>{let t=new Set(e.map(e=>e.path));o(e=>e.filter(e=>t.has(e)))},[e]),(0,G.jsx)(`div`,{className:`stack-list compact`,"data-testid":n,children:e.map(e=>{let n=!a.includes(e.path);return(0,G.jsxs)(`article`,{className:Na(`changed-file-review-card`,n&&`active`),children:[(0,G.jsxs)(`button`,{"data-testid":`changed-file-${e.path}`,type:`button`,className:`changed-file-review-header`,"aria-expanded":n,onClick:()=>{r(e.path),o(t=>t.includes(e.path)?t.filter(t=>t!==e.path):[...t,e.path])},children:[(0,G.jsxs)(`span`,{className:`list-button-header`,children:[(0,G.jsx)(`strong`,{children:e.path}),(0,G.jsx)(`span`,{children:e.status})]}),(0,G.jsxs)(`span`,{className:`pills compact-pills`,children:[`source`in e?(0,G.jsx)($,{children:e.source}):(0,G.jsx)($,{children:t??`current git`}),`additions`in e&&(e.additions!==void 0||e.deletions!==void 0)?(0,G.jsxs)($,{tone:`good`,children:[`+`,e.additions??0,` / -`,e.deletions??0]}):null,`binary`in e&&e.binary?(0,G.jsx)($,{tone:`warn`,children:`binary`}):null,`truncated`in e&&e.truncated?(0,G.jsx)($,{tone:`warn`,children:`truncated`}):null]})]}),n&&i?(0,G.jsx)(`div`,{className:`changed-file-review-body`,children:i(e)}):null]},`${`source`in e?e.source:`workspace`}-${e.path}`)})})}function Mh({loading:e,error:t,diffError:n,patch:r,diff:i,unavailableTitle:a,unavailableBody:o,loadingTitle:s=`Loading diff`,loadingBody:c=`Reading the selected file patch.`,fallbackTitle:l}){return e?(0,G.jsx)(Cm,{title:s,body:c}):t?(0,G.jsx)(Cm,{title:`File diff failed`,body:t}):n?(0,G.jsx)(Cm,{title:`File diff unavailable`,body:n}):r?(0,G.jsx)(`div`,{className:`detail-stack compact-stack`,children:(0,G.jsx)(vh,{diff:i,patch:r,fallbackTitle:l})}):(0,G.jsx)(Cm,{title:a,body:o})}function Nh(e,t){return{title:`Current workspace changes`,subtitle:`Current workspace diff`,fallbackTitle:`Raw workspace patch`,files:e.flatMap(e=>{let n=t[e.path];return n?.patch?[{title:e.path,diff:n.diff,patch:n.patch,fallbackTitle:`Raw workspace patch`}]:[]})}}function Ph(e){return{title:`Captured turn changes`,subtitle:`Captured turn diff`,fallbackTitle:`Raw turn patch`,files:e.flatMap(e=>e.patch?[{title:e.path,diff:e.diff,patch:e.patch,fallbackTitle:`Raw turn patch`}]:[])}}var Fh=`heddle.controlPlane.sessionPanelWidths`,Ih=12,Lh=420,Rh=220,zh=520,Bh=280,Vh=620;function Hh({sessions:e,activeSession:t,sessionDetail:n,sessionDetailLoading:r,sessionDetailError:i,selectedSessionId:a,onSelectSession:o,selectedTurnId:s,onSelectTurn:c,selectedTurn:l,turnReview:u,turnReviewLoading:d,turnReviewError:f,sendingPrompt:p,runInFlight:m,memoryUpdating:h,sendPromptError:g,onSendPrompt:_,creatingSession:v,sessionNotice:y,onCreateSession:b,onContinueSession:S,onCancelSessionRun:C,onUpdateSessionSettings:w,pendingApproval:T,onResolveApproval:E}){let D=(0,x.useRef)(null),O=(0,x.useRef)(null),ee=(0,x.useRef)(null),[k,te]=(0,x.useState)(()=>Wh()),[A,j]=(0,x.useState)(``),[M,N]=(0,x.useState)(null),[P,F]=(0,x.useState)([]),[ne,re]=(0,x.useState)(!1),[ie,I]=(0,x.useState)(),[L,R]=(0,x.useState)(null),[ae,oe]=(0,x.useState)(),[se,ce]=(0,x.useState)(0),[le,ue]=(0,x.useState)(`list`),[de,fe]=(0,x.useState)(),[pe,me]=(0,x.useState)(null),[he,ge]=(0,x.useState)(!1),[_e,ve]=(0,x.useState)(),[ye,be]=(0,x.useState)(),[xe,Se]=(0,x.useState)({}),[Ce,we]=(0,x.useState)(!1),[Te,Ee]=(0,x.useState)(),[De,Oe]=(0,x.useState)(0),[ke,Ae]=(0,x.useState)(`current`),[je,Me]=(0,x.useState)(null),Ne=p||m,Pe=n?.context?.compactionStatus??t?.context?.compactionStatus,Fe=u?.files.find(e=>e.path===de)??u?.files[0],Ie=pe?.files.find(e=>e.path===ye)??pe?.files[0],Le=Ie?xe[Ie.path]??null:null,Re=!!(Fe?.path&&Ie?.path===Fe.path&&Fe.patch&&Le?.patch&&Uh(Fe.patch)!==Uh(Le.patch)),ze={"--session-sidebar-width":`${k.left}px`,"--session-side-width":`${k.right}px`},Be=u?.files[0]?.path;(0,x.useEffect)(()=>{window.localStorage.setItem(Fh,JSON.stringify(k))},[k]),(0,x.useEffect)(()=>{let e=O.current;if(!e)return;let t,n=window.requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight,t=window.setTimeout(()=>{e.scrollTop=e.scrollHeight},0)});return()=>{window.cancelAnimationFrame(n),t!==void 0&&window.clearTimeout(t)}},[le,a,n?.messages.length,r,i]),(0,x.useEffect)(()=>{let e=!1;return Ei().then(t=>{e||(R(t),oe(void 0))}).catch(t=>{e||(R(null),oe(t instanceof Error?t.message:String(t)))}),()=>{e=!0}},[]),(0,x.useEffect)(()=>{fe(Be)},[Be,s,u?.traceFile]),(0,x.useEffect)(()=>{let e=!1;ge(!0);async function t(){try{let t=await Li();e||(me(t),ve(void 0),be(e=>e&&t.files.some(t=>t.path===e)?e:t.files[0]?.path))}catch(t){e||ve(t instanceof Error?t.message:String(t))}finally{e||ge(!1)}}return t(),()=>{e=!0}},[Ne,n?.updatedAt,De]),(0,x.useEffect)(()=>{let e=pe?.files.map(e=>e.path)??[];if(!e.length){Se({}),Ee(void 0),we(!1);return}let t=!1;we(!0);async function n(){try{let n=await Promise.all(e.map(async e=>[e,await Ri(e)]));t||(Se(Object.fromEntries(n)),Ee(void 0))}catch(e){t||(Se({}),Ee(e instanceof Error?e.message:String(e)))}finally{t||we(!1)}}return n(),()=>{t=!0}},[pe,De]),(0,x.useEffect)(()=>{if(!M){F([]),re(!1),I(void 0),ce(0);return}let e=!1;re(!0);let t=window.setTimeout(()=>{Fi(M.query).then(t=>{e||(F(t),I(void 0),ce(0))}).catch(t=>{e||(F([]),I(t instanceof Error?t.message:String(t)))}).finally(()=>{e||re(!1)})},220);return()=>{e=!0,window.clearTimeout(t)}},[M]);let Ve=(e,t)=>{j(e),N(Jh(e,t??e.length))},He=e=>{if(!M)return;let t=`${A.slice(0,M.start)}@${e.path} ${A.slice(M.end)}`,n=M.start+e.path.length+2;j(t),N(null),F([]),window.requestAnimationFrame(()=>{ee.current?.focus(),ee.current?.setSelectionRange(n,n)})},Ue=(e,t)=>{t.preventDefault();let n=D.current?.getBoundingClientRect().width;if(!n)return;let r=t.clientX,i=k,a=Math.min(zh,n-i.right-Lh-Ih),o=Math.min(Vh,n-i.left-Lh-Ih),s=t=>{let n=t.clientX-r;te({left:e===`left`?Gh(i.left+n,Rh,a):i.left,right:e===`right`?Gh(i.right-n,Bh,o):i.right})},c=()=>{window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,c)};window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,c,{once:!0})};(0,x.useEffect)(()=>{if(!a){ue(`list`);return}ue(e=>e===`list`?`chat`:e)},[a]);let We=(0,x.useMemo)(()=>Na(`workspace-shell`,`mobile-view-${le}`),[le]),Ge=e=>{o(e),ue(`chat`)},Ke=e=>{c(e),ue(`review`)},qe=()=>{ue(`list`)},Je=()=>{ue(`chat`)},Ye=()=>{ue(`review`)},Xe=()=>{let e=A.trim();e&&(j(``),_(e))},Ze=e=>{if(M&&(P.length||ne)){if(e.key===`ArrowDown`){e.preventDefault(),ce(e=>Math.min(e+1,Math.max(P.length-1,0)));return}if(e.key===`ArrowUp`){e.preventDefault(),ce(e=>Math.max(e-1,0));return}if(e.key===`Escape`){e.preventDefault(),N(null),F([]);return}if((e.key===`Enter`||e.key===`Tab`)&&P[se]){e.preventDefault(),He(P[se]);return}}if(!(e.key!==`Enter`||e.nativeEvent.isComposing)){if(typeof window<`u`&&window.innerWidth<=760){(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey&&(e.preventDefault(),Xe());return}!e.shiftKey&&!e.altKey&&(e.preventDefault(),Xe())}},Qe=M?(0,G.jsx)(qh,{loading:ne,suggestions:P,activeIndex:se,error:ie,query:M.query,onPick:He}):null,$e=typeof window<`u`&&window.innerWidth<=760;return $e&&le===`list`?(0,G.jsx)(`section`,{className:`mobile-session-screen mobile-session-list`,children:(0,G.jsxs)(`aside`,{className:`workspace-sidebar mobile-pane`,children:[(0,G.jsx)(km,{title:`Sessions`,subtitle:`${e.length} saved conversation${e.length===1?``:`s`}`,actions:(0,G.jsx)(`button`,{className:`sidebar-action-button`,type:`button`,"data-testid":`new-session-button`,disabled:v,onClick:()=>void b(),children:v?`Creating…`:`+ New session`})}),(0,G.jsx)(`div`,{className:`sidebar-scroll`,children:e.length?(0,G.jsx)(`div`,{className:`stack-list compact`,children:e.map(e=>(0,G.jsx)(Gm,{session:e,active:e.id===a,onClick:()=>Ge(e.id)},e.id))}):(0,G.jsx)(`div`,{className:`sidebar-empty-state`,children:(0,G.jsx)(Cm,{title:`No sessions`,body:`Create a new web session to start a fresh conversation in the browser.`})})})]})}):$e&&le===`chat`?(0,G.jsx)(ph,{activeSession:t,sessionDetail:n,sessionDetailLoading:r,sessionDetailError:i,selectedSessionId:a,runActive:Ne,runInFlight:m,memoryUpdating:h,sendPromptError:g,sessionNotice:y,draft:A,pendingApproval:T,conversationScrollRef:O,textareaRef:ee,mentionMenu:Qe,renderMessage:e=>(0,G.jsx)(Xm,{message:e},e.id),onDraftChange:Ve,onComposerKeyDown:Ze,onBackToSessions:qe,onOpenReview:Ye,onSubmitPrompt:Xe,onContinueSession:()=>void S(),onCancelSessionRun:()=>void C(),onResolveApproval:e=>void E(e)}):$e&&le===`review`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(yh,{activeSession:t,sessionDetail:n,selectedTurnId:s,selectedTurn:l,turnReview:u,turnReviewLoading:d,turnReviewError:f,workspaceChanges:pe,workspaceChangesLoading:he,workspaceChangesError:_e,workspaceFileDiff:Le,workspaceFileDiffsByPath:xe,workspaceFileDiffLoading:Ce,workspaceFileDiffError:Te,onSelectWorkspaceFile:be,onRefreshWorkspaceReview:()=>Oe(e=>e+1),selectedTurnPatchIsStale:Re,onOpenDiff:Me,onBackToSessions:qe,onOpenChat:Je,onSelectTurn:Ke}),(0,G.jsx)(kh,{diff:je,onClose:()=>Me(null)})]}):(0,G.jsxs)(`section`,{className:We,ref:D,style:ze,"data-mobile-view":le,children:[(0,G.jsxs)(`aside`,{className:`workspace-sidebar`,children:[(0,G.jsx)(km,{title:`Sessions`,subtitle:`${e.length} saved conversation${e.length===1?``:`s`}`,actions:(0,G.jsx)(`button`,{className:`sidebar-action-button`,type:`button`,"data-testid":`new-session-button`,disabled:v,onClick:()=>void b(),children:v?`Creating…`:`+ New session`})}),(0,G.jsx)(`div`,{className:`sidebar-scroll`,children:e.length?(0,G.jsx)(`div`,{className:`stack-list compact`,children:e.map(e=>(0,G.jsx)(Gm,{session:e,active:e.id===a,onClick:()=>Ge(e.id)},e.id))}):(0,G.jsx)(`div`,{className:`sidebar-empty-state`,children:(0,G.jsx)(Cm,{title:`No sessions`,body:`Create a new web session to start a fresh conversation in the browser.`})})})]}),(0,G.jsx)(`button`,{className:`workspace-resizer`,type:`button`,"aria-label":`Resize sessions sidebar`,onPointerDown:e=>Ue(`left`,e)}),(0,G.jsxs)(`section`,{className:`workspace-main`,children:[(0,G.jsx)(km,{title:n?.name??t?.name??`Chat session`,subtitle:t?`${t.id} · updated ${Fa(t.updatedAt)}`:`Pick a session to inspect its conversation.`,actions:t?(0,G.jsxs)(`div`,{className:`session-controls`,children:[(0,G.jsx)(`button`,{className:`mobile-nav-button`,type:`button`,onClick:qe,children:`← Sessions`}),(0,G.jsx)(`button`,{className:`mobile-nav-button mobile-inspector-button`,type:`button`,onClick:Ye,children:`Review`}),(0,G.jsxs)(`label`,{className:`select-control`,children:[(0,G.jsx)(`span`,{children:`model`}),(0,G.jsxs)(`select`,{value:n?.model??t.model??``,disabled:Ne||!L,onChange:e=>void w({model:e.target.value}),title:ae?`Model options unavailable. Restart the Heddle daemon if this route was just added.`:void 0,children:[L?.groups.map(e=>(0,G.jsx)(`optgroup`,{label:e.label,children:e.models.map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))},e.label)),L?null:(0,G.jsx)(`option`,{value:n?.model??t.model??``,children:ae?`models unavailable`:n?.model??t.model??`loading models`})]})]}),(0,G.jsxs)($,{children:[`turns `,t.turnCount]}),Pe===`running`?(0,G.jsx)($,{tone:`warn`,children:`compacting`}):null,(0,G.jsx)(`button`,{className:Na(`drift-button`,(n?.driftEnabled??t.driftEnabled)&&`active`),type:`button`,disabled:Ne,onClick:()=>void w({driftEnabled:!(n?.driftEnabled??t.driftEnabled??!0)}),children:Kh(n?.driftEnabled??t.driftEnabled,n?.driftLevel??t.driftLevel)}),Ne?(0,G.jsx)($,{tone:`warn`,children:`working`}):null]}):void 0}),(0,G.jsx)(`div`,{className:`conversation-scroll`,ref:O,children:(0,G.jsxs)(`div`,{className:`conversation-stack`,children:[(0,G.jsx)(`div`,{className:`conversation-spacer`}),r?(0,G.jsx)(Cm,{title:`Loading session`,body:`Fetching full conversation state from saved Heddle session storage.`}):i?(0,G.jsx)(Cm,{title:`Session load failed`,body:i}):n&&n.messages.length?n.messages.map(e=>(0,G.jsx)(Xm,{message:e},e.id)):(0,G.jsx)(Cm,{title:`No conversation available`,body:`This session does not have any saved chat messages yet.`})]})}),(0,G.jsxs)(`div`,{className:`composer-shell`,children:[T?(0,G.jsxs)(`div`,{className:`detail-card error-card approval-card`,children:[(0,G.jsxs)(`p`,{className:`card-title`,children:[`Approval required: `,T.tool]}),(0,G.jsxs)(`p`,{className:`muted`,children:[`Call ID: `,T.callId]}),(0,G.jsx)(Om,{children:JSON.stringify(T.input,null,2)}),(0,G.jsxs)(`div`,{className:`pills approval-actions`,children:[(0,G.jsx)(`button`,{className:`primary-button`,type:`button`,onClick:()=>void E(!0),children:`Approve`}),(0,G.jsx)(`button`,{className:`tab-button`,type:`button`,onClick:()=>void E(!1),children:`Deny`})]})]}):null,(0,G.jsx)(`textarea`,{ref:ee,value:A,onChange:e=>Ve(e.target.value,e.target.selectionStart),onClick:e=>Ve(A,e.currentTarget.selectionStart),onSelect:e=>Ve(A,e.currentTarget.selectionStart),disabled:!a||Ne,placeholder:Ne?`Heddle is working…`:`Ask Heddle about this workspace`,onKeyDown:e=>{if(M&&(P.length||ne)){if(e.key===`ArrowDown`){e.preventDefault(),ce(e=>Math.min(e+1,Math.max(P.length-1,0)));return}if(e.key===`ArrowUp`){e.preventDefault(),ce(e=>Math.max(e-1,0));return}if(e.key===`Escape`){e.preventDefault(),N(null),F([]);return}if((e.key===`Enter`||e.key===`Tab`)&&P[se]){e.preventDefault(),He(P[se]);return}}if(e.key===`Enter`&&!e.shiftKey&&!e.altKey&&!e.nativeEvent.isComposing){e.preventDefault();let t=A.trim();if(!t)return;j(``),_(t)}}}),M?(0,G.jsx)(qh,{loading:ne,suggestions:P,activeIndex:se,error:ie,query:M.query,onPick:He}):null,(0,G.jsxs)(`div`,{className:`composer-footer`,children:[(0,G.jsxs)(`div`,{className:`composer-status`,children:[(0,G.jsx)(`p`,{className:`muted`,children:Pe===`running`?`Compacting earlier conversation history into an archive summary.`:g||y||(Ne?`Run in progress. Continue is disabled until this run settles; Cancel interrupts the active run.`:h?`Memory maintenance is updating the workspace catalog in the background.`:(n?.lastContinuePrompt,`Enter sends. Option+Enter or Shift+Enter adds a new line.`))}),(0,G.jsxs)(`div`,{className:`pills compact-pills`,children:[(0,G.jsx)($,{tone:v||Ne?`warn`:`good`,children:v?`creating session`:Ne?`run active`:`idle`}),h?(0,G.jsx)($,{tone:`warn`,children:`memory updating`}):null,n?.lastContinuePrompt?(0,G.jsx)($,{children:`continue available`}):(0,G.jsx)($,{children:`no continue state yet`})]})]}),(0,G.jsxs)(`div`,{className:`pills composer-actions`,children:[(0,G.jsx)(`button`,{className:`tab-button`,type:`button`,disabled:!a||Ne||!n?.lastContinuePrompt,onClick:()=>void S(),title:n?.lastContinuePrompt?`Resume the current transcript from the last saved continue point`:`Continue is available after a prior runnable turn exists`,children:`Continue`}),(0,G.jsx)(`button`,{className:`tab-button`,type:`button`,disabled:!m,onClick:()=>void C(),title:`Interrupt the currently running session`,children:`Cancel`}),(0,G.jsx)(`button`,{className:`primary-button`,type:`button`,disabled:!a||Ne||!A.trim(),onClick:()=>{let e=A.trim();e&&(j(``),_(e))},children:`Send`})]})]})]})]}),(0,G.jsx)(`button`,{className:`workspace-resizer`,type:`button`,"aria-label":`Resize session inspector`,onPointerDown:e=>Ue(`right`,e)}),(0,G.jsx)(Th,{reviewMode:ke,onReviewModeChange:Ae,onShowChatView:Je,workspaceChanges:pe,workspaceChangesLoading:he,workspaceChangesError:_e,workspaceFileDiffsByPath:xe,workspaceFileDiffLoading:Ce,workspaceFileDiffError:Te,selectedTurnPatchIsStale:Re,onSelectWorkspaceFile:be,onRefreshWorkspaceReview:()=>Oe(e=>e+1),sessionDetail:n,selectedTurnId:s,onSelectTurn:Ke,turnReview:u,turnReviewLoading:d,turnReviewError:f,onSelectReviewFile:fe,selectedTurn:l,onOpenDiff:Me}),(0,G.jsx)(kh,{diff:je,onClose:()=>Me(null)})]})}function Uh(e){return e.trim().replace(/\r\n/g,`
55
+ `)}function Wh(){try{let e=window.localStorage.getItem(Fh);if(!e)return{left:288,right:344};let t=JSON.parse(e);return{left:Gh(typeof t.left==`number`?t.left:288,Rh,zh),right:Gh(typeof t.right==`number`?t.right:344,Bh,Vh)}}catch{return{left:288,right:344}}}function Gh(e,t,n){return Math.min(Math.max(e,t),Math.max(t,n))}function Kh(e,t){return e?`drift ${t??`unknown`}`:`drift off`}function qh({loading:e,suggestions:t,activeIndex:n,error:r,query:i,onPick:a}){return(0,G.jsxs)(`div`,{className:`mention-menu`,role:`listbox`,"aria-label":`File suggestions`,children:[(0,G.jsxs)(`div`,{className:`mention-menu-header`,children:[(0,G.jsx)(`span`,{children:`@ file`}),(0,G.jsx)(`span`,{children:e?`Searching...`:`${t.length} match${t.length===1?``:`es`}`})]}),r?(0,G.jsx)(`p`,{className:`mention-empty`,children:`File search unavailable. Restart the Heddle daemon if this route was just added.`}):t.length?t.map((e,t)=>(0,G.jsx)(`button`,{className:Na(`mention-option`,t===n&&`active`),type:`button`,role:`option`,"aria-selected":t===n,onMouseDown:t=>{t.preventDefault(),a(e)},children:(0,G.jsxs)(`span`,{children:[`@`,e.path]})},e.path)):(0,G.jsx)(`p`,{className:`mention-empty`,children:e?`Searching workspace files...`:`No files found for "${i}".`})]})}function Jh(e,t){let n=e.slice(0,t).match(/(^|\s)@([^\s@]*)$/);if(!n||n.index===void 0)return null;let r=n[1]??``;return{query:n[2]??``,start:n.index+r.length,end:t}}function Yh({tasks:e,selectedTask:t,selectedTaskId:n,onSelectTask:r,selectedRun:i,selectedRunId:a,onSelectRun:o,selectedTaskRuns:s,pendingTaskAction:c,onEnableTask:l,onDisableTask:u,onTriggerTask:d}){let[f,p]=(0,x.useState)(n?`detail`:`list`),m=!!(t&&c&&c.taskId===t.taskId),h=t?Ha(t):void 0;return(0,x.useEffect)(()=>{if(!n){p(`list`);return}p(e=>e===`list`?`detail`:e)},[n]),f===`list`?(0,G.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col bg-background`,children:[(0,G.jsxs)(`header`,{className:`shrink-0 border-b border-border bg-card px-3 py-2`,children:[(0,G.jsx)(`p`,{className:`m-0 text-sm font-semibold text-foreground`,children:`Tasks`}),(0,G.jsxs)(`p`,{className:`m-0 text-xs text-muted-foreground`,children:[e.length,` durable task`,e.length===1?``:`s`]})]}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-3`,children:e.length?(0,G.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>{let t=Ha(e);return(0,G.jsxs)(`button`,{type:`button`,className:`w-full rounded-md border px-3 py-3 text-left ${e.taskId===n?`border-primary bg-primary/5`:`border-border bg-card`}`,onClick:()=>{r(e.taskId),p(`detail`)},children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,G.jsx)(`p`,{className:`m-0 line-clamp-2 text-sm font-semibold text-foreground`,children:e.name||e.taskId}),(0,G.jsx)(`p`,{className:`m-0 shrink-0 text-[11px] text-muted-foreground`,children:Fa(e.nextRunAt)})]}),(0,G.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[(0,G.jsx)(K,{variant:e.enabled?`secondary`:`outline`,children:e.enabled?`enabled`:`disabled`}),(0,G.jsx)(K,{variant:`outline`,children:t.label}),e.decision?(0,G.jsx)(K,{variant:`outline`,children:e.decision}):null]}),(0,G.jsx)(`p`,{className:`m-0 mt-2 text-xs text-muted-foreground`,children:e.task})]},e.taskId)})}):(0,G.jsx)($h,{title:`No tasks`,body:`Add a heartbeat task in the CLI, then manage it from here.`})})]}):f===`runs`?(0,G.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col bg-background`,children:[(0,G.jsx)(`header`,{className:`shrink-0 border-b border-border bg-card px-3 py-2`,children:(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs`,onClick:()=>p(`detail`),children:`← Task`}),(0,G.jsx)(`p`,{className:`m-0 text-xs text-muted-foreground`,children:`Runs`})]})}),(0,G.jsx)(`nav`,{className:`shrink-0 border-b border-border bg-card px-3 py-2`,children:(0,G.jsxs)(`div`,{className:`grid grid-cols-2 rounded-md bg-muted p-1`,children:[(0,G.jsx)(Qh,{active:!1,onClick:()=>p(`detail`),children:`Summary`}),(0,G.jsx)(Qh,{active:!0,children:`Runs`})]})}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-3`,children:(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsx)(Xh,{title:`History`,children:s.length?(0,G.jsx)(`div`,{className:`space-y-2`,children:s.map(e=>(0,G.jsxs)(`button`,{type:`button`,className:`w-full rounded-md border px-2 py-2 text-left ${e.id===a?`border-primary bg-primary/5`:`border-border bg-background`}`,onClick:()=>o(e.id),children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,G.jsx)(`p`,{className:`m-0 truncate text-xs font-medium text-foreground`,children:e.id}),(0,G.jsx)(`p`,{className:`m-0 shrink-0 text-[11px] text-muted-foreground`,children:Fa(e.createdAt)})]}),(0,G.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:[(0,G.jsx)(K,{variant:`outline`,children:e.status}),(0,G.jsx)(K,{variant:`outline`,children:e.decision}),(0,G.jsx)(K,{variant:`outline`,children:e.outcome})]})]},e.id))}):(0,G.jsx)($h,{title:`No runs`,body:`Run-once and scheduled executions appear here.`})}),(0,G.jsx)(Xh,{title:`Run detail`,children:i?(0,G.jsxs)(`div`,{className:`space-y-2 text-xs`,children:[(0,G.jsx)(`p`,{className:`m-0 text-sm font-semibold text-foreground`,children:i.id}),(0,G.jsx)(`p`,{className:`m-0 text-muted-foreground`,children:i.summary}),(0,G.jsx)(Zh,{label:`created`,value:Fa(i.createdAt)}),(0,G.jsx)(Zh,{label:`task`,value:i.taskId}),(0,G.jsx)(Zh,{label:`usage`,value:Va(i.usage)??`none`}),(0,G.jsx)(Zh,{label:`checkpoint`,value:i.loadedCheckpoint?`loaded`:`fresh`}),i.progress?(0,G.jsx)(Zh,{label:`progress`,value:i.progress}):null]}):(0,G.jsx)($h,{title:`No run selected`,body:`Select a run to inspect the latest heartbeat result.`})})]})})]}):(0,G.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col bg-background`,children:[(0,G.jsx)(`header`,{className:`shrink-0 border-b border-border bg-card px-3 py-2`,children:(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs`,onClick:()=>p(`list`),children:`← Tasks`}),(0,G.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs`,onClick:()=>p(`runs`),disabled:!s.length,children:`Runs`})]})}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-3`,children:t?(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsxs)(Xh,{title:t.name||t.taskId,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,G.jsx)(K,{variant:t.enabled?`secondary`:`outline`,children:t.enabled?`enabled`:`disabled`}),(0,G.jsx)(K,{variant:h?.tone===`good`?`secondary`:`outline`,children:h?.label??t.status}),t.decision?(0,G.jsx)(K,{variant:`outline`,children:t.decision}):null]}),(0,G.jsx)(`p`,{className:`m-0 mt-2 text-xs text-muted-foreground`,children:t.taskId}),(0,G.jsx)(`p`,{className:`m-0 mt-2 text-sm text-foreground`,children:t.task}),(0,G.jsx)(`p`,{className:`m-0 mt-2 text-xs text-muted-foreground`,children:h?.detail}),(0,G.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,G.jsx)(q,{type:`button`,size:`sm`,variant:`outline`,disabled:m||!t.enabled,onClick:()=>{d(t.taskId)},children:m&&c?.action===`trigger`?`Triggering…`:`Run now`}),t.enabled?(0,G.jsx)(q,{type:`button`,size:`sm`,variant:`outline`,disabled:m,onClick:()=>{u(t.taskId)},children:m&&c?.action===`disable`?`Pausing…`:`Pause task`}):(0,G.jsx)(q,{type:`button`,size:`sm`,variant:`outline`,disabled:m,onClick:()=>{l(t.taskId)},children:m&&c?.action===`enable`?`Resuming…`:`Resume task`})]})]}),(0,G.jsxs)(Xh,{title:`Runtime status`,children:[(0,G.jsx)(Zh,{label:`execution`,value:h?.label??t.status}),(0,G.jsx)(Zh,{label:`model`,value:t.model??`unset`}),(0,G.jsx)(Zh,{label:`interval`,value:Ba(t.intervalMs)}),(0,G.jsx)(Zh,{label:`last run`,value:Fa(t.lastRunAt)}),(0,G.jsx)(Zh,{label:`next run`,value:Fa(t.nextRunAt)}),(0,G.jsx)(Zh,{label:`checkpoint`,value:t.loadedCheckpoint?`loaded`:t.resumable?`resumable`:`none`}),(0,G.jsx)(Zh,{label:`usage`,value:Va(t.usage)??`none`})]}),t.summary?(0,G.jsx)(Xh,{title:`Latest summary`,children:(0,G.jsx)(`p`,{className:`m-0 text-sm text-foreground`,children:t.summary})}):null,t.progress?(0,G.jsx)(Xh,{title:`Progress`,children:(0,G.jsx)(`p`,{className:`m-0 text-sm text-foreground`,children:t.progress})}):null,t.error?(0,G.jsx)(Xh,{title:`Error`,children:(0,G.jsx)(`p`,{className:`m-0 text-sm text-destructive`,children:t.error})}):null]}):(0,G.jsx)($h,{title:`No task selected`,body:`Choose a task to inspect its durable prompt and latest run state.`})})]})}function Xh({title:e,children:t}){return(0,G.jsxs)(`section`,{className:`rounded-md border border-border bg-card px-3 py-3`,children:[(0,G.jsx)(`p`,{className:`m-0 text-sm font-semibold text-foreground`,children:e}),(0,G.jsx)(`div`,{className:`mt-2`,children:t})]})}function Zh({label:e,value:t}){return(0,G.jsxs)(`div`,{className:`grid grid-cols-[92px_minmax(0,1fr)] gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e}),(0,G.jsx)(`span`,{className:`break-words text-foreground`,children:t})]})}function Qh({active:e,onClick:t,children:n}){return(0,G.jsx)(`button`,{type:`button`,className:`h-8 rounded-md text-xs font-medium ${e?`bg-background text-foreground shadow-sm`:`text-muted-foreground`}`,onClick:t,"aria-current":e?`page`:void 0,children:n})}function $h({title:e,body:t}){return(0,G.jsxs)(`div`,{className:`rounded-md border border-border bg-card px-3 py-3`,children:[(0,G.jsx)(`p`,{className:`m-0 text-sm font-semibold text-foreground`,children:e}),(0,G.jsx)(`p`,{className:`m-0 mt-1 text-xs text-muted-foreground`,children:t})]})}function eg({tasks:e,runs:t,selectedTask:n,selectedTaskId:r,onSelectTask:i,selectedRun:a,selectedRunId:o,onSelectRun:s,selectedTaskRuns:c,pendingTaskAction:l,onEnableTask:u,onDisableTask:d,onTriggerTask:f}){if(Da())return(0,G.jsx)(Yh,{tasks:e,selectedTask:n,selectedTaskId:r,onSelectTask:i,selectedRun:a,selectedRunId:o,onSelectRun:s,selectedTaskRuns:c,pendingTaskAction:l,onEnableTask:u,onDisableTask:d,onTriggerTask:f});let p=!!(n&&l&&l.taskId===n.taskId),m=n?Ha(n):void 0;return(0,G.jsxs)(`section`,{className:`workspace-shell tasks-shell`,children:[(0,G.jsxs)(`aside`,{className:`workspace-sidebar`,children:[(0,G.jsx)(km,{title:`Tasks`,subtitle:`${e.length} durable task${e.length===1?``:`s`}`}),(0,G.jsx)(`div`,{className:`sidebar-scroll`,children:e.length?e.map(e=>(0,G.jsx)(Km,{task:e,active:e.taskId===r,onClick:()=>i(e.taskId)},e.taskId)):(0,G.jsx)(Cm,{title:`No tasks`,body:`Add a heartbeat task in the CLI, then manage it from this view.`})})]}),(0,G.jsxs)(`section`,{className:`workspace-main`,children:[(0,G.jsx)(km,{title:n?.name||n?.taskId||`Task detail`,subtitle:n?`${n.taskId} · next ${Fa(n.nextRunAt)}`:`Pick a task to inspect prompt, schedule, and recent outcome.`,actions:n?(0,G.jsxs)(`div`,{className:`pills`,children:[(0,G.jsx)($,{tone:n.enabled?`good`:void 0,children:n.enabled?`enabled`:`disabled`}),(0,G.jsx)($,{tone:m?.tone,children:m?.label??n.status}),n.decision?(0,G.jsx)($,{tone:Pa(n.decision),children:n.decision}):null]}):void 0}),(0,G.jsx)(`div`,{className:`task-detail-scroll`,children:n?(0,G.jsxs)(`div`,{className:`detail-stack`,children:[(0,G.jsxs)(`div`,{className:`detail-card`,children:[(0,G.jsx)(`p`,{className:`section-label`,children:`Task prompt`}),(0,G.jsx)(`p`,{className:`summary`,children:n.task}),(0,G.jsxs)(`div`,{className:`pills approval-actions`,children:[(0,G.jsx)(`button`,{type:`button`,className:`sidebar-action-button`,disabled:p||!n.enabled,onClick:()=>{f(n.taskId)},children:p&&l?.action===`trigger`?`Triggering…`:`Run now`}),n.enabled?(0,G.jsx)(`button`,{type:`button`,className:`sidebar-action-button`,disabled:p,onClick:()=>{d(n.taskId)},children:p&&l?.action===`disable`?`Pausing…`:`Pause task`}):(0,G.jsx)(`button`,{type:`button`,className:`sidebar-action-button`,disabled:p,onClick:()=>{u(n.taskId)},children:p&&l?.action===`enable`?`Resuming…`:`Resume task`})]}),(0,G.jsx)(`p`,{className:`summary`,children:m?.detail})]}),(0,G.jsxs)(`div`,{className:`detail-card`,children:[(0,G.jsx)(`p`,{className:`section-label`,children:`Runtime status`}),(0,G.jsxs)(`div`,{className:`kv-list`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`execution`}),(0,G.jsx)(`span`,{className:`kv-value`,children:m?.label??n.status})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`model`}),(0,G.jsx)(`span`,{className:`kv-value`,children:n.model??`unset`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`interval`}),(0,G.jsx)(`span`,{className:`kv-value`,children:Ba(n.intervalMs)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`last run`}),(0,G.jsx)(`span`,{className:`kv-value`,children:Fa(n.lastRunAt)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`next run`}),(0,G.jsx)(`span`,{className:`kv-value`,children:Fa(n.nextRunAt)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`checkpoint`}),(0,G.jsx)(`span`,{className:`kv-value`,children:n.loadedCheckpoint?`loaded`:n.resumable?`resumable`:`none`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`usage`}),(0,G.jsx)(`span`,{className:`kv-value`,children:Va(n.usage)??`none`})]})]})]}),n.summary?(0,G.jsxs)(`div`,{className:`detail-card`,children:[(0,G.jsx)(`p`,{className:`section-label`,children:`Latest summary`}),(0,G.jsx)(`p`,{className:`summary`,children:n.summary})]}):null,n.progress?(0,G.jsxs)(`div`,{className:`detail-card`,children:[(0,G.jsx)(`p`,{className:`section-label`,children:`Progress`}),(0,G.jsx)(`p`,{className:`summary`,children:n.progress})]}):null,n.error?(0,G.jsxs)(`div`,{className:`detail-card error-card`,children:[(0,G.jsx)(`p`,{className:`section-label`,children:`Error`}),(0,G.jsx)(`p`,{className:`summary`,children:n.error})]}):null]}):(0,G.jsx)(Cm,{title:`No task selected`,body:`Choose a task from the left to inspect its durable prompt and latest run state.`})})]}),(0,G.jsxs)(`aside`,{className:`workspace-side`,children:[(0,G.jsx)(km,{title:`Runs`,subtitle:n?`${c.length} run${c.length===1?``:`s`} for this task`:`${t.length} recent run${t.length===1?``:`s`}`}),(0,G.jsxs)(`div`,{className:`side-scroll split-scroll`,children:[(0,G.jsx)(Am,{title:`History`,children:c.length?(0,G.jsx)(`div`,{className:`stack-list compact`,children:c.map(e=>(0,G.jsx)(qm,{run:e,active:e.id===o,onClick:()=>s(e.id)},e.id))}):(0,G.jsx)(Cm,{title:`No runs for this task`,body:`Run-once and scheduled executions will appear here.`})}),(0,G.jsx)(Am,{title:`Run detail`,children:a?(0,G.jsxs)(`div`,{className:`detail-stack compact-stack`,children:[(0,G.jsxs)(`div`,{className:`detail-card`,children:[(0,G.jsx)(`p`,{className:`card-title`,children:a.id}),(0,G.jsxs)(`div`,{className:`pills`,children:[(0,G.jsx)($,{tone:Pa(a.status),children:a.status}),(0,G.jsx)($,{tone:Pa(a.decision),children:a.decision}),(0,G.jsx)($,{tone:Pa(a.outcome),children:a.outcome})]}),(0,G.jsx)(`p`,{className:`summary`,children:a.summary})]}),(0,G.jsx)(`div`,{className:`detail-card`,children:(0,G.jsxs)(`div`,{className:`kv-list`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`created`}),(0,G.jsx)(`span`,{className:`kv-value`,children:Fa(a.createdAt)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`task`}),(0,G.jsx)(`span`,{className:`kv-value`,children:a.taskId})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`usage`}),(0,G.jsx)(`span`,{className:`kv-value`,children:Va(a.usage)??`none`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`kv-key`,children:`checkpoint`}),(0,G.jsx)(`span`,{className:`kv-value`,children:a.loadedCheckpoint?`loaded`:`fresh`})]})]})}),a.progress?(0,G.jsxs)(`div`,{className:`detail-card`,children:[(0,G.jsx)(`p`,{className:`section-label`,children:`Progress`}),(0,G.jsx)(`p`,{className:`summary`,children:a.progress})]}):null]}):(0,G.jsx)(Cm,{title:`No run selected`,body:`Select a run to inspect the latest durable heartbeat result.`})})]})]})]})}function tg({state:e,creatingWorkspace:t=!1,renamingWorkspaceId:n,onCreateWorkspace:r,onRenameWorkspace:i,onSetActiveWorkspace:a}){let o=lg(e);return(0,G.jsx)(`section`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-x-hidden overflow-y-auto px-3 pt-3 pb-[calc(env(safe-area-inset-bottom)+5.5rem)] sm:px-4 sm:pt-4 sm:pb-4`,children:(0,G.jsxs)(`div`,{className:`grid min-w-0 gap-4 xl:grid-cols-[minmax(0,1.4fr)_minmax(320px,0.8fr)]`,children:[(0,G.jsxs)(cg,{children:[(0,G.jsxs)(`div`,{className:`mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Workspace management`}),(0,G.jsx)(`h2`,{className:`text-xl font-semibold text-foreground`,children:`Attached workspaces`}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Switch, rename, and inspect workspaces attached to this control-plane catalog.`})]}),(0,G.jsxs)(K,{variant:`outline`,children:[za(e.workspaces.length),` local`]})]}),(0,G.jsx)(`div`,{className:`space-y-3`,"data-testid":`workspace-list`,children:e.workspaces.map(t=>(0,G.jsx)(`article`,{"data-testid":`workspace-card-${t.id}`,className:`rounded-xl border border-border bg-background/60 p-4`,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`h3`,{className:`truncate text-base font-semibold text-foreground`,children:t.name}),t.id===e.activeWorkspaceId?(0,G.jsx)(K,{variant:`secondary`,children:`active`}):null,(0,G.jsx)(K,{variant:`outline`,children:t.id})]}),(0,G.jsxs)(`dl`,{className:`mt-3 grid gap-2 text-sm`,children:[(0,G.jsx)(sg,{label:`Workspace path`,children:t.anchorRoot}),(0,G.jsx)(sg,{label:`State path`,children:t.stateRoot}),(0,G.jsx)(sg,{label:`Repo roots`,children:t.repoRoots.join(`, `)})]})]}),(0,G.jsxs)(`div`,{className:`flex min-w-[min(100%,260px)] flex-col gap-3`,children:[(0,G.jsx)(ng,{workspaceId:t.id,initialName:t.name,disabled:!i||n===t.id,pending:n===t.id,onRename:i}),(0,G.jsx)(q,{type:`button`,variant:t.id===e.activeWorkspaceId?`secondary`:`outline`,disabled:t.id===e.activeWorkspaceId||!a,onClick:()=>a?.(t.id),children:t.id===e.activeWorkspaceId?`Current workspace`:`Switch to workspace`})]})]})},t.id))})]}),(0,G.jsxs)(`div`,{className:`grid min-w-0 gap-4`,children:[(0,G.jsx)(rg,{creatingWorkspace:t,recentWorkspaces:o,onCreateWorkspace:r}),(0,G.jsx)(ig,{state:e,recentWorkspaces:o,creatingWorkspace:t,onCreateWorkspace:r,onSetActiveWorkspace:a})]})]})})}function ng({workspaceId:e,initialName:t,disabled:n,pending:r,onRename:i}){let[a,o]=(0,x.useState)(t);(0,x.useEffect)(()=>{o(t)},[t]);let s=a.trim()&&a.trim()!==t;return(0,G.jsxs)(`form`,{className:`flex gap-2`,onSubmit:t=>{t.preventDefault(),!(!i||!s)&&i(e,a.trim())},children:[(0,G.jsx)(`input`,{className:`h-10 min-w-0 flex-1 rounded-md border border-border bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground`,value:a,onChange:e=>o(e.target.value),disabled:n,"aria-label":`Workspace name`}),(0,G.jsx)(q,{type:`submit`,variant:`outline`,size:`sm`,disabled:n||!s,children:r?`Saving…`:`Rename`})]})}function rg({creatingWorkspace:e,onCreateWorkspace:t,recentWorkspaces:n=[]}){let[r,i]=(0,x.useState)(``),[a,o]=(0,x.useState)(``),[s,c]=(0,x.useState)(!0),[l,u]=(0,x.useState)(!1);return(0,G.jsxs)(cg,{children:[(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Add workspace`}),(0,G.jsx)(`h2`,{className:`text-xl font-semibold text-foreground`,children:`Choose a project`}),(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Register another workspace path and optionally switch the control plane to it.`})]}),(0,G.jsxs)(`form`,{"data-testid":`workspace-create-form`,className:`mt-4 space-y-4`,onSubmit:e=>{e.preventDefault(),!(!t||!r.trim()||!a.trim())&&t({name:r.trim(),anchorRoot:a.trim(),setActive:s}).then(()=>{i(``),o(``),c(!0)})},children:[(0,G.jsxs)(`label`,{className:`block space-y-2`,children:[(0,G.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Name`}),(0,G.jsx)(`input`,{className:`h-11 w-full rounded-md border border-border bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground`,value:r,onChange:e=>i(e.target.value),placeholder:`Workspace name`,disabled:e,"data-testid":`workspace-create-name`})]}),(0,G.jsxs)(`label`,{className:`block space-y-2`,children:[(0,G.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Workspace path`}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(`input`,{className:`h-11 min-w-0 flex-1 rounded-md border border-border bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground`,value:a,onChange:e=>o(e.target.value),placeholder:`/absolute/path/to/workspace`,disabled:e,"data-testid":`workspace-create-path`}),(0,G.jsx)(q,{type:`button`,variant:`outline`,className:`h-11 shrink-0`,disabled:e,onClick:()=>u(!0),children:`Choose…`})]})]}),(0,G.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>c(e.target.checked),disabled:e}),(0,G.jsx)(`span`,{children:`Switch to this workspace after creating it`})]}),(0,G.jsx)(q,{type:`submit`,variant:`secondary`,className:`w-full`,disabled:e||!r.trim()||!a.trim(),"data-testid":`workspace-create-submit`,children:e?`Creating…`:`Create workspace`})]}),(0,G.jsx)(ag,{open:l,selectedPath:a,recentWorkspaces:n,onOpenChange:u,onSelectPath:e=>{o(e),r.trim()||i(ug(e))}})]})}function ig({state:e,recentWorkspaces:t,creatingWorkspace:n,onCreateWorkspace:r,onSetActiveWorkspace:i}){return(0,G.jsxs)(cg,{children:[(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Recent workspaces`}),(0,G.jsx)(`h2`,{className:`text-xl font-semibold text-foreground`,children:`Open workspace`}),(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Workspaces Heddle has seen on this machine, including the current catalog.`})]}),t.length?(0,G.jsx)(`div`,{className:`mt-4 space-y-2`,"data-testid":`recent-workspace-list`,children:t.slice(0,8).map(t=>{let a=t.id===e.activeWorkspaceId,o=t.relation===`attached`;return(0,G.jsxs)(`button`,{type:`button`,className:`w-full rounded-xl border border-border bg-background/60 p-3 text-left hover:border-primary disabled:cursor-not-allowed disabled:opacity-50`,disabled:n||a||(o?!i:!r),onClick:()=>{o?i?.(t.id):r?.({name:t.name,anchorRoot:t.anchorRoot,setActive:!0})},children:[(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:t.name}),a?(0,G.jsx)(K,{variant:`secondary`,children:`active`}):null,(0,G.jsx)(K,{variant:`outline`,children:o?`attached`:`known`})]}),(0,G.jsx)(`span`,{className:`mt-1 block truncate text-xs text-muted-foreground`,children:t.anchorRoot}),(0,G.jsx)(`span`,{className:`mt-2 block text-[11px] text-muted-foreground`,children:Ra(t.stateRoot)})]},t.stateRoot)})}):(0,G.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:`No Heddle workspaces are known yet. Run Heddle in a project once, then refresh.`})]})}function ag({open:e,selectedPath:t,recentWorkspaces:n,onOpenChange:r,onSelectPath:i}){let[a,o]=(0,x.useState)(t.trim()||void 0),[s,c]=(0,x.useState)(t.trim()),[l,u]=(0,x.useState)(),[d,f]=(0,x.useState)(),[p,m]=(0,x.useState)(!1),[h,g]=(0,x.useState)(!1);if((0,x.useEffect)(()=>{if(!e)return;let n=t.trim()||void 0;o(n),c(n??``)},[e,t]),(0,x.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&r(!1)};return window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`keydown`,t)}},[e,r]),(0,x.useEffect)(()=>{if(!e)return;let t=!1;return m(!0),Ii(a,h).then(e=>{t||(u(e),o(e.path),c(e.path),f(void 0))}).catch(e=>{t||f(e instanceof Error?e.message:String(e))}).finally(()=>{t||m(!1)}),()=>{t=!0}},[e,a,h]),!e)return null;let _=l?.path??a??t.trim(),v=()=>{_&&(i(_),r(!1))};return(0,G.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-3 backdrop-blur-sm sm:p-6`,role:`presentation`,onMouseDown:e=>{e.target===e.currentTarget&&r(!1)},children:(0,G.jsxs)(`div`,{className:`flex max-h-[min(820px,92vh)] w-full max-w-4xl flex-col overflow-hidden rounded-2xl border border-border bg-card shadow-2xl`,role:`dialog`,"aria-modal":`true`,"aria-label":`Choose workspace folder`,children:[(0,G.jsxs)(`div`,{className:`border-b border-border px-4 py-4 sm:px-6`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Workspace folder`}),(0,G.jsx)(`h2`,{className:`mt-1 text-xl font-semibold text-foreground`,children:`Choose a project root`}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Navigate folders, pick a repo or existing Heddle workspace, then switch the control plane to it.`})]}),(0,G.jsx)(q,{type:`button`,variant:`outline`,onClick:()=>r(!1),children:`Close`})]}),(0,G.jsxs)(`form`,{className:`mt-4 flex flex-col gap-2 sm:flex-row`,onSubmit:e=>{e.preventDefault(),o(s.trim()||void 0)},children:[(0,G.jsx)(`input`,{className:`h-11 min-w-0 flex-1 rounded-md border border-border bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground`,value:s,onChange:e=>c(e.target.value),placeholder:`/absolute/path/to/workspace`}),(0,G.jsx)(q,{type:`submit`,variant:`outline`,className:`h-11`,children:`Go`}),(0,G.jsx)(q,{type:`button`,variant:`secondary`,className:`h-11`,disabled:!_,onClick:v,children:`Use this folder`})]})]}),(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-6`,children:[n.length?(0,G.jsxs)(`div`,{className:`mb-4 rounded-xl border border-border bg-background/50 p-3`,children:[(0,G.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Recent workspaces`}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Choose from Heddle workspaces seen on this machine.`})]}),(0,G.jsx)(K,{variant:`outline`,children:n.length})]}),(0,G.jsx)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:n.slice(0,6).map(e=>(0,G.jsxs)(`button`,{type:`button`,className:`rounded-lg border border-border bg-card px-3 py-2 text-left hover:border-primary`,onClick:()=>{i(e.anchorRoot),r(!1)},children:[(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:e.name}),(0,G.jsx)(K,{variant:`outline`,children:e.relation})]}),(0,G.jsx)(`span`,{className:`mt-1 block truncate text-xs text-muted-foreground`,children:e.anchorRoot})]},e.stateRoot))})]}):null,(0,G.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(K,{variant:`outline`,className:`max-w-full truncate`,children:_||`Home`}),l?.parentPath?(0,G.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>o(l.parentPath),children:`Up one level`}):null,(0,G.jsxs)(`label`,{className:`ml-auto flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:h,onChange:e=>g(e.target.checked)}),(0,G.jsx)(`span`,{children:`Show hidden folders`})]}),p?(0,G.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Loading...`}):null]}),d?(0,G.jsx)(`div`,{className:`mb-3 rounded-xl border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive`,children:d}):null,(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-background/40`,children:[l?.parentPath?(0,G.jsx)(og,{label:`..`,detail:l.parentPath,onOpen:()=>o(l.parentPath)}):null,l?.entries.map(e=>(0,G.jsx)(og,{label:e.name,detail:e.path,entry:e,onOpen:()=>o(e.path),onSelect:()=>{i(e.path),r(!1)}},e.path)),l&&!p&&l.entries.length===0?(0,G.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:`No readable child folders found here. You can still use the current folder.`}):null]})]})]})})}function og({label:e,detail:t,entry:n,onOpen:r,onSelect:i}){return(0,G.jsxs)(`div`,{className:`grid gap-3 border-b border-border p-3 last:border-b-0 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`min-w-0 text-left`,onClick:r,children:[(0,G.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:e}),(0,G.jsx)(`span`,{className:`mt-1 block truncate text-xs text-muted-foreground`,children:t}),n?(0,G.jsxs)(`span`,{className:`mt-2 flex flex-wrap gap-1`,children:[n.hasHeddleState?(0,G.jsx)(K,{variant:`secondary`,children:`Heddle workspace`}):null,n.hasGit?(0,G.jsx)(K,{variant:`outline`,children:`git repo`}):null,n.hasPackageJson?(0,G.jsx)(K,{variant:`outline`,children:`package.json`}):null]}):null]}),(0,G.jsxs)(`div`,{className:`flex gap-2 sm:justify-end`,children:[(0,G.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,onClick:r,children:`Open`}),i?(0,G.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:i,children:`Select`}):null]})]})}function sg({label:e,children:t}){return(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`dt`,{className:`text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:e}),(0,G.jsx)(`dd`,{className:`break-all text-sm text-foreground`,children:t})]})}function cg({children:e}){return(0,G.jsx)(`section`,{className:`min-w-0 rounded-2xl border border-border bg-card/95 p-4 shadow-sm sm:p-5`,children:e})}function lg(e){let t=new Map;for(let n of e.workspaces)t.set(n.stateRoot,{...n,relation:`attached`});for(let n of e.knownWorkspaces??[])t.has(n.stateRoot)||t.set(n.stateRoot,{...n,relation:`known`});return Array.from(t.values()).sort((t,n)=>{let r=Number(n.id===e.activeWorkspaceId)-Number(t.id===e.activeWorkspaceId);return r===0?(n.updatedAt??``).localeCompare(t.updatedAt??``):r})}function ug(e){let t=e.trim().replace(/\/+$/,``);return t.split(`/`).filter(Boolean).at(-1)??t}function dg(e){let t=fg(e),n=x.forwardRef((e,n)=>{let{children:r,...i}=e,a=x.Children.toArray(r),o=a.find(mg);if(o){let e=o.props.children,r=a.map(t=>t===o?x.Children.count(e)>1?x.Children.only(null):x.isValidElement(e)?e.props.children:null:t);return(0,G.jsx)(t,{...i,ref:n,children:x.isValidElement(e)?x.cloneElement(e,void 0,r):null})}return(0,G.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function fg(e){let t=x.forwardRef((e,t)=>{let{children:n,...r}=e;if(x.isValidElement(n)){let e=gg(n),i=hg(r,n.props);return n.type!==x.Fragment&&(i.ref=t?Ss(t,e):e),x.cloneElement(n,i)}return x.Children.count(n)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pg=Symbol(`radix.slottable`);function mg(e){return x.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===pg}function hg(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function gg(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function _g(e){let t=e+`CollectionProvider`,[n,r]=Ls(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=x.useRef(null),a=x.useRef(new Map).current;return(0,G.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=dg(s),l=x.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,G.jsx)(c,{ref:Cs(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=dg(u),p=x.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=x.useRef(null),s=Cs(t,o),c=a(u,n);return x.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,G.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return x.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var vg=`ToastProvider`,[yg,bg,xg]=_g(`Toast`),[Sg,Cg]=Ls(`Toast`,[xg]),[wg,Tg]=Sg(vg),Eg=e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,children:o}=e,[s,c]=x.useState(null),[l,u]=x.useState(0),d=x.useRef(!1),f=x.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${vg}\`. Expected non-empty \`string\`.`),(0,G.jsx)(yg.Provider,{scope:t,children:(0,G.jsx)(wg,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:l,viewport:s,onViewportChange:c,onToastAdd:x.useCallback(()=>u(e=>e+1),[]),onToastRemove:x.useCallback(()=>u(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};Eg.displayName=vg;var Dg=`ToastViewport`,Og=[`F8`],kg=`toast.viewportPause`,Ag=`toast.viewportResume`,jg=x.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:r=Og,label:i=`Notifications ({hotkey})`,...a}=e,o=Tg(Dg,n),s=bg(n),c=x.useRef(null),l=x.useRef(null),u=x.useRef(null),d=x.useRef(null),f=Cs(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;x.useEffect(()=>{let e=e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),x.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(kg);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},r=()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(Ag);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},i=t=>{e.contains(t.relatedTarget)||r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=x.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...i_(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return x.useEffect(()=>{let e=d.current;if(e){let t=t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);a_(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,G.jsxs)(uc,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,G.jsx)(Ng,{ref:l,onFocusFromOutsideViewport:()=>{a_(h({tabbingDirection:`forwards`}))}}),(0,G.jsx)(yg.Slot,{scope:n,children:(0,G.jsx)(Ks.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,G.jsx)(Ng,{ref:u,onFocusFromOutsideViewport:()=>{a_(h({tabbingDirection:`backwards`}))}})]})});jg.displayName=Dg;var Mg=`ToastFocusProxy`,Ng=x.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=Tg(Mg,n);return(0,G.jsx)(ud,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})});Ng.displayName=Mg;var Pg=`Toast`,Fg=`toast.swipeStart`,Ig=`toast.swipeMove`,Lg=`toast.swipeCancel`,Rg=`toast.swipeEnd`,zg=x.forwardRef((e,t)=>{let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=ad({prop:r,defaultProp:i??!0,onChange:a,caller:Pg});return(0,G.jsx)(Qu,{present:n||s,children:(0,G.jsx)(Hg,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:Js(e.onPause),onResume:Js(e.onResume),onSwipeStart:Is(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:Is(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:Is(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:Is(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})});zg.displayName=Pg;var[Bg,Vg]=Sg(Pg,{onClose(){}}),Hg=x.forwardRef((e,t)=>{let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=Tg(Pg,n),[g,_]=x.useState(null),v=Cs(t,e=>_(e)),y=x.useRef(null),b=x.useRef(null),S=i||h.duration,C=x.useRef(0),w=x.useRef(S),T=x.useRef(0),{onToastAdd:E,onToastRemove:D}=h,O=Js(()=>{g?.contains(document.activeElement)&&h.viewport?.focus(),o()}),ee=x.useCallback(e=>{!e||e===1/0||(window.clearTimeout(T.current),C.current=new Date().getTime(),T.current=window.setTimeout(O,e))},[O]);x.useEffect(()=>{let e=h.viewport;if(e){let t=()=>{ee(w.current),l?.()},n=()=>{let e=new Date().getTime()-C.current;w.current-=e,window.clearTimeout(T.current),c?.()};return e.addEventListener(kg,n),e.addEventListener(Ag,t),()=>{e.removeEventListener(kg,n),e.removeEventListener(Ag,t)}}},[h.viewport,S,c,l,ee]),x.useEffect(()=>{a&&!h.isClosePausedRef.current&&ee(S)},[a,S,h.isClosePausedRef,ee]),x.useEffect(()=>(E(),()=>D()),[E,D]);let k=x.useMemo(()=>g?$g(g):null,[g]);return h.viewport?(0,G.jsxs)(G.Fragment,{children:[k&&(0,G.jsx)(Ug,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:k}),(0,G.jsx)(Bg,{scope:n,onClose:O,children:zs.createPortal((0,G.jsx)(yg.ItemSlot,{scope:n,children:(0,G.jsx)(lc,{asChild:!0,onEscapeKeyDown:Is(s,()=>{h.isFocusedToastEscapeKeyDownRef.current||O(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,G.jsx)(Ks.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:v,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:Is(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:Is(e.onPointerDown,e=>{e.button===0&&(y.current={x:e.clientX,y:e.clientY})}),onPointerMove:Is(e.onPointerMove,e=>{if(!y.current)return;let t=e.clientX-y.current.x,n=e.clientY-y.current.y,r=!!b.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(b.current=l,e_(Ig,d,f,{discrete:!1})):t_(l,h.swipeDirection,c)?(b.current=l,e_(Fg,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(y.current=null)}),onPointerUp:Is(e.onPointerUp,e=>{let t=b.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),b.current=null,y.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};t_(t,h.swipeDirection,h.swipeThreshold)?e_(Rg,p,r,{discrete:!0}):e_(Lg,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),Ug=e=>{let{__scopeToast:t,children:n,...r}=e,i=Tg(Pg,t),[a,o]=x.useState(!1),[s,c]=x.useState(!1);return n_(()=>o(!0)),x.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,G.jsx)(Xu,{asChild:!0,children:(0,G.jsx)(ud,{...r,children:a&&(0,G.jsxs)(G.Fragment,{children:[i.label,` `,n]})})})},Wg=`ToastTitle`,Gg=x.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,G.jsx)(Ks.div,{...r,ref:t})});Gg.displayName=Wg;var Kg=`ToastDescription`,qg=x.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,G.jsx)(Ks.div,{...r,ref:t})});qg.displayName=Kg;var Jg=`ToastAction`,Yg=x.forwardRef((e,t)=>{let{altText:n,...r}=e;return n.trim()?(0,G.jsx)(Qg,{altText:n,asChild:!0,children:(0,G.jsx)(Zg,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Jg}\`. Expected non-empty \`string\`.`),null)});Yg.displayName=Jg;var Xg=`ToastClose`,Zg=x.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e,i=Vg(Xg,n);return(0,G.jsx)(Qg,{asChild:!0,children:(0,G.jsx)(Ks.button,{type:`button`,...r,ref:t,onClick:Is(e.onClick,i.onClose)})})});Zg.displayName=Xg;var Qg=x.forwardRef((e,t)=>{let{__scopeToast:n,altText:r,...i}=e;return(0,G.jsx)(Ks.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function $g(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),r_(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n)if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...$g(e))}}),t}function e_(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?qs(i,a):i.dispatchEvent(a)}var t_=(e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n};function n_(e=()=>{}){let t=Js(e);dc(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}function r_(e){return e.nodeType===e.ELEMENT_NODE}function i_(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function a_(e){let t=document.activeElement;return e.some(e=>e===t?!0:(e.focus(),document.activeElement!==t))}var o_=Eg,s_=jg,c_=zg,l_=Gg,u_=qg,d_=Zg,f_=o_,p_=x.forwardRef(({className:e,...t},n)=>(0,G.jsx)(s_,{ref:n,className:vs(`fixed top-[max(0.75rem,env(safe-area-inset-top))] z-50 flex max-h-screen w-full flex-col-reverse gap-2 p-3 sm:top-[max(1rem,env(safe-area-inset-top))] md:right-4 md:top-4 md:w-[420px] md:max-w-[420px] md:flex-col`,e),...t}));p_.displayName=s_.displayName;var m_=Ja(`group pointer-events-auto relative flex w-full items-start justify-between gap-3 overflow-hidden rounded-md border p-3 pr-6 shadow-2xl ring-1 ring-black/20 transition-all`,{variants:{variant:{info:`border-cyan-400/40 bg-slate-950/96 text-slate-100`,success:`border-emerald-400/45 bg-emerald-950/90 text-emerald-50`,error:`border-red-300/45 bg-red-950/92 text-red-50`}},defaultVariants:{variant:`info`}}),h_=x.forwardRef(({className:e,variant:t,...n},r)=>(0,G.jsx)(c_,{ref:r,className:vs(m_({variant:t}),e),...n}));h_.displayName=c_.displayName;var g_=x.forwardRef(({className:e,...t},n)=>(0,G.jsx)(l_,{ref:n,className:vs(`text-sm font-semibold`,e),...t}));g_.displayName=l_.displayName;var __=x.forwardRef(({className:e,...t},n)=>(0,G.jsx)(u_,{ref:n,className:vs(`mt-1 text-xs text-slate-200/90`,e),...t}));__.displayName=u_.displayName;var v_=x.forwardRef(({className:e,...t},n)=>(0,G.jsx)(d_,{ref:n,className:vs(`absolute right-2 top-2 inline-flex h-6 w-6 items-center justify-center rounded-md border border-white/20 bg-black/25 text-slate-200 transition-colors hover:bg-black/45 hover:text-white`,e),"toast-close":``,...t,children:`×`}));v_.displayName=d_.displayName;var y_=3,b_=7e3,x_=new Map,S_=e=>{if(x_.has(e))return;let t=setTimeout(()=>{x_.delete(e),E_({type:`REMOVE_TOAST`,toastId:e})},b_);x_.set(e,t)};function C_(e,t){switch(t.type){case`ADD_TOAST`:return{...e,toasts:[t.toast,...e.toasts].slice(0,y_)};case`UPDATE_TOAST`:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case`DISMISS_TOAST`:{let{toastId:n}=t;return n?S_(n):e.toasts.forEach(e=>S_(e.id)),{...e,toasts:e.toasts.map(e=>e.id===n||n===void 0?{...e,open:!1}:e)}}case`REMOVE_TOAST`:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}}var w_=[],T_={toasts:[]};function E_(e){T_=C_(T_,e),w_.forEach(e=>{e(T_)})}function D_(){return`${Date.now()}-${Math.floor(Math.random()*1e3)}`}function O_(e){let t=D_(),n=()=>E_({type:`DISMISS_TOAST`,toastId:t}),r=e=>E_({type:`UPDATE_TOAST`,toast:{...e,id:t}});E_({type:`ADD_TOAST`,toast:{id:t,title:e.title,body:e.body,tone:e.tone,open:!0}});let i=e.tone===`error`?b_:4200;return setTimeout(n,i),{id:t,dismiss:n,update:r}}function k_(){let[e,t]=x.useState(T_);return x.useEffect(()=>(w_.push(t),()=>{let e=w_.indexOf(t);e>-1&&w_.splice(e,1)}),[]),{...e,toast:O_,dismiss:e=>E_({type:`DISMISS_TOAST`,toastId:e})}}function A_(){let{toasts:e,dismiss:t}=k_();return(0,G.jsxs)(f_,{children:[e.map(e=>(0,G.jsxs)(h_,{open:e.open,onOpenChange:n=>{n||t(e.id)},variant:e.tone??`info`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(g_,{children:e.title}),e.body?(0,G.jsx)(__,{children:e.body}):null]}),(0,G.jsx)(v_,{"aria-label":`Dismiss notification`})]},e.id)),(0,G.jsx)(p_,{})]})}function j_(){let e=$i(),{state:t,error:n,refresh:r,setActiveWorkspace:i,createWorkspace:a,renameWorkspace:o}=qi(),{toasts:s,toast:c}=k_(),l=Da(),u=(0,x.useCallback)(()=>{r()},[r]),d=ka(t?.sessions,c,u,{selectedSessionId:e.routeSessionId,onSelectedSessionIdChange:e.setRouteSessionId,autoSelectSession:e.section===`sessions`}),f=ja(t?.heartbeat.tasks,t?.heartbeat.runs,c,u),p=Ma({state:t,setActiveWorkspace:i,createWorkspace:a,renameWorkspace:o,notify:c}),m=xa({section:e.section,sessionsState:d,error:n,toasts:s,notify:c});(0,x.useEffect)(()=>{e.normalizeRoute()},[e]),(0,x.useEffect)(()=>{window.__HEDDLE_CAPTURE_LAYOUT_SNAPSHOT=async e=>{await m(e?.screenshot??`none`)};let e=e=>{if(!(e.metaKey||e.ctrlKey)||!e.shiftKey||e.key.toLowerCase()!==`d`)return;let t=e.target;t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement||(e.preventDefault(),m(`none`))};return window.addEventListener(`keydown`,e),()=>{window.__HEDDLE_CAPTURE_LAYOUT_SNAPSHOT&&delete window.__HEDDLE_CAPTURE_LAYOUT_SNAPSHOT,window.removeEventListener(`keydown`,e)}},[m]);let h=t?M_(t,d,f,p):(0,G.jsx)(Sm,{title:`Loading state`,children:(0,G.jsx)(`p`,{className:`muted`,children:n??`Reading local Heddle state...`})});return l?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Fm,{section:e.section,onSectionChange:e.setSection,state:t,error:n,onSetActiveWorkspace:e=>void p.switchWorkspace(e),onCaptureDebugSnapshot:e=>void m(e),onRefresh:()=>void r(),children:h}),(0,G.jsx)(A_,{})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(jm,{activeSection:e.section,sessionPath:e.routeSessionId?`/sessions/${encodeURIComponent(e.routeSessionId)}`:`/sessions`,state:t,error:n,onSetActiveWorkspace:e=>void p.switchWorkspace(e),onCaptureDebugSnapshot:e=>void m(e),onRefresh:()=>void r(),children:h}),(0,G.jsx)(A_,{})]})}function M_(e,t,n,r){return(0,G.jsxs)(At,{children:[(0,G.jsx)(Ot,{path:`/overview`,element:(0,G.jsx)(Lm,{state:e})}),(0,G.jsx)(Ot,{path:`/sessions`,element:(0,G.jsx)(N_,{state:e,sessionsState:t})}),(0,G.jsx)(Ot,{path:`/sessions/:sessionId/*`,element:(0,G.jsx)(N_,{state:e,sessionsState:t})}),(0,G.jsx)(Ot,{path:`/tasks`,element:(0,G.jsx)(eg,{tasks:e.heartbeat.tasks,runs:e.heartbeat.runs,selectedTask:n.selectedTask,selectedTaskId:n.selectedTaskId,onSelectTask:n.setSelectedTaskId,selectedRun:n.selectedRun,selectedRunId:n.selectedRunId,onSelectRun:n.setSelectedRunId,selectedTaskRuns:n.selectedTaskRuns,pendingTaskAction:n.pendingTaskAction,onEnableTask:n.enableTask,onDisableTask:n.disableTask,onTriggerTask:n.triggerTask})}),(0,G.jsx)(Ot,{path:`/workspaces`,element:(0,G.jsx)(tg,{state:e,creatingWorkspace:r.creatingWorkspace,renamingWorkspaceId:r.renamingWorkspaceId,onCreateWorkspace:r.createWorkspace,onRenameWorkspace:r.renameWorkspace,onSetActiveWorkspace:e=>void r.switchWorkspace(e)})}),(0,G.jsx)(Ot,{path:`*`,element:(0,G.jsx)(Dt,{to:`/overview`,replace:!0})})]})}function N_({state:e,sessionsState:t}){return(0,G.jsx)(Hh,{sessions:e.sessions,activeSession:t.activeSession,sessionDetail:t.sessionDetail,sessionDetailLoading:t.sessionDetailLoading,sessionDetailError:t.sessionDetailError,selectedSessionId:t.selectedSessionId,onSelectSession:t.setSelectedSessionId,selectedTurnId:t.selectedTurnId,onSelectTurn:t.setSelectedTurnId,selectedTurn:t.selectedTurn,turnReview:t.turnReview,turnReviewLoading:t.turnReviewLoading,turnReviewError:t.turnReviewError,sendingPrompt:t.sendingPrompt,runInFlight:t.runInFlight,memoryUpdating:t.memoryUpdating,sendPromptError:t.sendPromptError,onSendPrompt:t.sendPrompt,creatingSession:t.creatingSession,sessionNotice:t.sessionNotice,onCreateSession:t.createSession,onContinueSession:t.continueSession,onCancelSessionRun:t.cancelSessionRun,onUpdateSessionSettings:t.updateSessionSettings,pendingApproval:t.pendingApproval,onResolveApproval:t.resolveApproval})}(0,zn.createRoot)(document.getElementById(`root`)).render((0,G.jsx)(x.StrictMode,{children:(0,G.jsx)(vn,{children:(0,G.jsx)(j_,{})})}));
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
6
6
  <link rel="icon" type="image/jpeg" href="/assets/favicon-CT3fFV8g.jpeg" />
7
7
  <title>Heddle Control Plane</title>
8
- <script type="module" crossorigin src="/assets/index-BKSxomk7.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-Bl3oDytR.css">
8
+ <script type="module" crossorigin src="/assets/index-D35_IzEn.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-CAWhKnGd.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roackb2/heddle",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "description": "An open-source AI coding agent runtime and terminal CLI for real repositories, with persistent memory, sessions, approvals, heartbeat, and a browser control plane",
5
5
  "author": "Jay / Fienna Liang <roackb2@gmail.com>",
6
6
  "license": "MIT",
@@ -41,6 +41,10 @@
41
41
  "client:dev": "vite --config src/web/vite.config.ts",
42
42
  "server:dev": "tsx --no-cache src/server/dev.ts",
43
43
  "daemon:dev": "tsx --no-cache src/cli/main.ts daemon --assets-dir dist/src/web",
44
+ "e2e": "playwright test",
45
+ "e2e:ui": "playwright test --ui",
46
+ "e2e:headed": "playwright test --headed",
47
+ "e2e:install": "playwright install chromium",
44
48
  "cli:dev": "tsx --no-cache src/cli/main.ts",
45
49
  "chat:dev": "tsx --no-cache src/cli/main.ts chat",
46
50
  "chat:dev:openai": "OPENAI_API_KEY=\"$PERSONAL_OPENAI_API_KEY\" tsx --no-cache src/cli/main.ts chat",
@@ -136,6 +140,7 @@
136
140
  },
137
141
  "devDependencies": {
138
142
  "@eslint/js": "^10.0.1",
143
+ "@playwright/test": "^1.59.1",
139
144
  "@testing-library/dom": "^10.4.1",
140
145
  "@testing-library/react": "^16.3.2",
141
146
  "@types/express": "^5.0.6",
@@ -1,2 +0,0 @@
1
- /*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
2
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-300:oklch(80.8% .114 19.571);--color-red-950:oklch(25.8% .092 26.042);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-950:oklch(26.2% .051 172.552);--color-cyan-400:oklch(78.9% .154 211.53);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-950:oklch(12.9% .042 264.695);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-4xl:56rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-medium:500;--font-weight-semibold:600;--tracking-normal:0em;--radius-md:8px;--radius-lg:10px;--radius-xl:12px;--radius-2xl:1rem;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-background:#090c11;--color-foreground:#e4ebf1;--color-card:#0e1420;--color-popover:#0e1420;--color-popover-foreground:#e4ebf1;--color-primary:#72d7f8;--color-primary-foreground:#03131c;--color-secondary:#212936;--color-secondary-foreground:#e4ebf1;--color-muted:#29313d;--color-muted-foreground:#97a3b4;--color-accent:#8adbf0;--color-accent-foreground:#03131c;--color-destructive:#fca1af;--color-destructive-foreground:#21080c;--color-border:#313a49;--color-input:#313a49;--color-ring:#72d7f8}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-2{top:calc(var(--spacing) * 2)}.top-11{top:calc(var(--spacing) * 11)}.top-\[max\(0\.75rem\,env\(safe-area-inset-top\)\)\]{top:max(.75rem, env(safe-area-inset-top))}.right-0{right:calc(var(--spacing) * 0)}.right-2{right:calc(var(--spacing) * 2)}.bottom-0{bottom:calc(var(--spacing) * 0)}.z-10{z-index:10}.z-50{z-index:50}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing) * 0)}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-dvh{height:100dvh}.h-full{height:100%}.max-h-24{max-height:calc(var(--spacing) * 24)}.max-h-36{max-height:calc(var(--spacing) * 36)}.max-h-\[34dvh\]{max-height:34dvh}.max-h-\[44rem\]{max-height:44rem}.max-h-\[52dvh\]{max-height:52dvh}.max-h-\[82dvh\]{max-height:82dvh}.max-h-\[min\(820px\,92vh\)\]{max-height:min(820px,92vh)}.max-h-screen{max-height:100vh}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-10{min-height:calc(var(--spacing) * 10)}.min-h-\[60px\]{min-height:60px}.min-h-full{min-height:100%}.w-6{width:calc(var(--spacing) * 6)}.w-9{width:calc(var(--spacing) * 9)}.w-12{width:calc(var(--spacing) * 12)}.w-72{width:calc(var(--spacing) * 72)}.w-80{width:calc(var(--spacing) * 80)}.w-\[76px\]{width:76px}.w-\[min\(280px\,calc\(100vw-32px\)\)\]{width:min(280px,100vw - 32px)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-4xl{max-width:var(--container-4xl)}.max-w-44{max-width:calc(var(--spacing) * 44)}.max-w-64{max-width:calc(var(--spacing) * 64)}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-44{min-width:calc(var(--spacing) * 44)}.min-w-\[min\(100\%\,260px\)\]{min-width:min(100%,260px)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.origin-\[--radix-popover-content-transform-origin\]{transform-origin:--radix-popover-content-transform-origin}.origin-\[--radix-tooltip-content-transform-origin\]{transform-origin:--radix-tooltip-content-transform-origin}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.list-none{list-style-type:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-\[92px_minmax\(0\,1fr\)\]{grid-template-columns:92px minmax(0,1fr)}.grid-cols-\[auto_minmax\(0\,1fr\)_auto\]{grid-template-columns:auto minmax(0,1fr) auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing) * 1)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t-2xl{border-top-left-radius:var(--radius-2xl);border-top-right-radius:var(--radius-2xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-border{border-color:var(--color-border)}.border-cyan-400\/40{border-color:#00d2ef66}@supports (color:color-mix(in lab, red, red)){.border-cyan-400\/40{border-color:color-mix(in oklab, var(--color-cyan-400) 40%, transparent)}}.border-destructive\/40{border-color:#fca1af66}@supports (color:color-mix(in lab, red, red)){.border-destructive\/40{border-color:color-mix(in oklab, var(--color-destructive) 40%, transparent)}}.border-emerald-400\/45{border-color:#00d29473}@supports (color:color-mix(in lab, red, red)){.border-emerald-400\/45{border-color:color-mix(in oklab, var(--color-emerald-400) 45%, transparent)}}.border-input{border-color:var(--color-input)}.border-primary{border-color:var(--color-primary)}.border-red-300\/45{border-color:#ffa3a373}@supports (color:color-mix(in lab, red, red)){.border-red-300\/45{border-color:color-mix(in oklab, var(--color-red-300) 45%, transparent)}}.border-transparent{border-color:#0000}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab, red, red)){.border-white\/20{border-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.bg-background{background-color:var(--color-background)}.bg-background\/40{background-color:#090c1166}@supports (color:color-mix(in lab, red, red)){.bg-background\/40{background-color:color-mix(in oklab, var(--color-background) 40%, transparent)}}.bg-background\/50{background-color:#090c1180}@supports (color:color-mix(in lab, red, red)){.bg-background\/50{background-color:color-mix(in oklab, var(--color-background) 50%, transparent)}}.bg-background\/60{background-color:#090c1199}@supports (color:color-mix(in lab, red, red)){.bg-background\/60{background-color:color-mix(in oklab, var(--color-background) 60%, transparent)}}.bg-black\/25{background-color:#00000040}@supports (color:color-mix(in lab, red, red)){.bg-black\/25{background-color:color-mix(in oklab, var(--color-black) 25%, transparent)}}.bg-black\/45{background-color:#00000073}@supports (color:color-mix(in lab, red, red)){.bg-black\/45{background-color:color-mix(in oklab, var(--color-black) 45%, transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab, red, red)){.bg-black\/70{background-color:color-mix(in oklab, var(--color-black) 70%, transparent)}}.bg-card{background-color:var(--color-card)}.bg-card\/95{background-color:#0e1420f2}@supports (color:color-mix(in lab, red, red)){.bg-card\/95{background-color:color-mix(in oklab, var(--color-card) 95%, transparent)}}.bg-destructive{background-color:var(--color-destructive)}.bg-destructive\/10{background-color:#fca1af1a}@supports (color:color-mix(in lab, red, red)){.bg-destructive\/10{background-color:color-mix(in oklab, var(--color-destructive) 10%, transparent)}}.bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab, red, red)){.bg-emerald-500\/10{background-color:color-mix(in oklab, var(--color-emerald-500) 10%, transparent)}}.bg-emerald-950\/90{background-color:#002c22e6}@supports (color:color-mix(in lab, red, red)){.bg-emerald-950\/90{background-color:color-mix(in oklab, var(--color-emerald-950) 90%, transparent)}}.bg-muted{background-color:var(--color-muted)}.bg-muted\/30{background-color:#29313d4d}@supports (color:color-mix(in lab, red, red)){.bg-muted\/30{background-color:color-mix(in oklab, var(--color-muted) 30%, transparent)}}.bg-muted\/40{background-color:#29313d66}@supports (color:color-mix(in lab, red, red)){.bg-muted\/40{background-color:color-mix(in oklab, var(--color-muted) 40%, transparent)}}.bg-popover{background-color:var(--color-popover)}.bg-primary{background-color:var(--color-primary)}.bg-primary\/5{background-color:#72d7f80d}@supports (color:color-mix(in lab, red, red)){.bg-primary\/5{background-color:color-mix(in oklab, var(--color-primary) 5%, transparent)}}.bg-red-950\/92{background-color:#460809eb}@supports (color:color-mix(in lab, red, red)){.bg-red-950\/92{background-color:color-mix(in oklab, var(--color-red-950) 92%, transparent)}}.bg-rose-500\/10{background-color:#ff23571a}@supports (color:color-mix(in lab, red, red)){.bg-rose-500\/10{background-color:color-mix(in oklab, var(--color-rose-500) 10%, transparent)}}.bg-secondary{background-color:var(--color-secondary)}.bg-slate-950\/96{background-color:#020618f5}@supports (color:color-mix(in lab, red, red)){.bg-slate-950\/96{background-color:color-mix(in oklab, var(--color-slate-950) 96%, transparent)}}.bg-transparent{background-color:#0000}.p-1{padding:calc(var(--spacing) * 1)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-\[env\(safe-area-inset-top\)\]{padding-top:env(safe-area-inset-top)}.pr-6{padding-right:calc(var(--spacing) * 6)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-\[calc\(env\(safe-area-inset-bottom\)\+0\.5rem\)\]{padding-bottom:calc(env(safe-area-inset-bottom) + .5rem)}.pb-\[calc\(env\(safe-area-inset-bottom\)\+0\.75rem\)\]{padding-bottom:calc(env(safe-area-inset-bottom) + .75rem)}.pb-\[calc\(env\(safe-area-inset-bottom\)\+5\.5rem\)\]{padding-bottom:calc(env(safe-area-inset-bottom) + 5.5rem)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[11px\]{font-size:11px}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-6{--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.leading-none{--tw-leading:1;line-height:1}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.08em\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent{color:var(--color-accent)}.text-destructive{color:var(--color-destructive)}.text-destructive-foreground{color:var(--color-destructive-foreground)}.text-emerald-50{color:var(--color-emerald-50)}.text-foreground{color:var(--color-foreground)}.text-muted-foreground{color:var(--color-muted-foreground)}.text-muted-foreground\/70{color:#97a3b4b3}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\/70{color:color-mix(in oklab, var(--color-muted-foreground) 70%, transparent)}}.text-popover-foreground{color:var(--color-popover-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-red-50{color:var(--color-red-50)}.text-secondary-foreground{color:var(--color-secondary-foreground)}.text-slate-100{color:var(--color-slate-100)}.text-slate-200{color:var(--color-slate-200)}.text-slate-200\/90{color:#e2e8f0e6}@supports (color:color-mix(in lab, red, red)){.text-slate-200\/90{color:color-mix(in oklab, var(--color-slate-200) 90%, transparent)}}.uppercase{text-transform:uppercase}.underline-offset-4{text-underline-offset:4px}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-black\/20{--tw-ring-color:#0003}@supports (color:color-mix(in lab, red, red)){.ring-black\/20{--tw-ring-color:color-mix(in oklab, var(--color-black) 20%, transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.marker\:hidden ::marker{display:none}.marker\:hidden::marker{display:none}.marker\:hidden ::-webkit-details-marker{display:none}.marker\:hidden::-webkit-details-marker{display:none}.placeholder\:text-muted-foreground::placeholder{color:var(--color-muted-foreground)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media (hover:hover){.hover\:border-primary:hover{border-color:var(--color-primary)}.hover\:bg-accent:hover{background-color:var(--color-accent)}.hover\:bg-black\/45:hover{background-color:#00000073}@supports (color:color-mix(in lab, red, red)){.hover\:bg-black\/45:hover{background-color:color-mix(in oklab, var(--color-black) 45%, transparent)}}.hover\:bg-destructive\/80:hover{background-color:#fca1afcc}@supports (color:color-mix(in lab, red, red)){.hover\:bg-destructive\/80:hover{background-color:color-mix(in oklab, var(--color-destructive) 80%, transparent)}}.hover\:bg-destructive\/90:hover{background-color:#fca1afe6}@supports (color:color-mix(in lab, red, red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab, var(--color-destructive) 90%, transparent)}}.hover\:bg-primary\/80:hover{background-color:#72d7f8cc}@supports (color:color-mix(in lab, red, red)){.hover\:bg-primary\/80:hover{background-color:color-mix(in oklab, var(--color-primary) 80%, transparent)}}.hover\:bg-primary\/90:hover{background-color:#72d7f8e6}@supports (color:color-mix(in lab, red, red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab, var(--color-primary) 90%, transparent)}}.hover\:bg-secondary\/80:hover{background-color:#212936cc}@supports (color:color-mix(in lab, red, red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab, var(--color-secondary) 80%, transparent)}}.hover\:text-accent-foreground:hover{color:var(--color-accent-foreground)}.hover\:text-white:hover{color:var(--color-white)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--color-ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:var(--color-ring)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=40rem){.sm\:top-\[max\(1rem\,env\(safe-area-inset-top\)\)\]{top:max(1rem, env(safe-area-inset-top))}.sm\:mx-5{margin-inline:calc(var(--spacing) * 5)}.sm\:max-w-\[48\%\]{max-width:48%}.sm\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-between{justify-content:space-between}.sm\:justify-end{justify-content:flex-end}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:px-4{padding-inline:calc(var(--spacing) * 4)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}.sm\:pt-4{padding-top:calc(var(--spacing) * 4)}.sm\:pb-4{padding-bottom:calc(var(--spacing) * 4)}.sm\:text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}}@media (width>=48rem){.md\:top-4{top:calc(var(--spacing) * 4)}.md\:right-4{right:calc(var(--spacing) * 4)}.md\:w-\[420px\]{width:420px}.md\:max-w-\[420px\]{max-width:420px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-col{flex-direction:column}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.md\:leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}}@media (width>=64rem){.lg\:col-span-1{grid-column:span 1/span 1}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-start{align-items:flex-start}.lg\:justify-between{justify-content:space-between}}@media (width>=80rem){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-\[minmax\(0\,1\.4fr\)_minmax\(320px\,0\.8fr\)\]{grid-template-columns:minmax(0,1.4fr) minmax(320px,.8fr)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--bg:#0b0f14;--panel:#111827;--panel-alt:#0f172a;--panel-muted:#0b1220;--text:#e5e7eb;--muted:#94a3b8;--line:#94a3b829;--line-strong:#94a3b847;--accent:#7dd3fc;--good:#86efac;--warn:#fcd34d;--bad:#fda4af}*{box-sizing:border-box}html,body,#root{height:100vh}body{background:var(--bg);color:var(--text);margin:0;font:14px/1.5 ui-sans-serif,-apple-system,BlinkMacSystemFont,SF Pro Text,Segoe UI,sans-serif;overflow:hidden}button,textarea{font:inherit;color:inherit}button{cursor:pointer}h1,h2,h3,p{margin-top:0}h1{letter-spacing:-.03em;margin-bottom:8px;font-size:28px;line-height:1.1}h2{letter-spacing:-.02em;margin-bottom:4px;font-size:18px}h3{letter-spacing:-.01em;margin-bottom:10px;font-size:14px}.app-shell{flex-direction:column;gap:14px;height:100vh;padding:16px;display:flex;overflow:hidden}.topbar{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.toolbar{justify-content:space-between;align-items:center;gap:16px;display:flex}.toolbar-tabs{min-width:0}.toolbar-status{flex-direction:row;justify-content:flex-end;align-items:center;gap:12px;min-width:0;display:flex}.toolbar-actions{flex:none;display:block}.debug-snapshot-menu{position:relative}.debug-button{color:var(--muted);cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap;background:#94a3b814;border:1px solid #94a3b833;border-radius:8px;padding:6px 8px;font-size:11px;font-weight:700;list-style:none}.debug-button::-webkit-details-marker{display:none}.debug-button:hover{color:var(--text);border-color:#7dd3fc4d}.debug-snapshot-options{z-index:30;border:1px solid var(--line-strong);background:#0b1220fa;border-radius:8px;gap:4px;min-width:180px;padding:6px;display:grid;position:absolute;top:calc(100% + 6px);right:0;box-shadow:0 16px 36px #00000057}.debug-snapshot-options button{width:100%;color:var(--text);text-align:left;background:0 0;border:0;border-radius:6px;padding:8px 9px}.debug-snapshot-options button:hover{background:#7dd3fc1f}.topbar-title-row{justify-content:flex-end;align-items:center;gap:12px;max-width:100%;display:flex}.runtime-host-info-button{width:20px;height:20px;color:var(--muted);cursor:pointer;-webkit-user-select:none;user-select:none;background:#94a3b814;border:1px solid #94a3b83d;border-radius:999px;justify-content:center;align-items:center;font-size:11px;font-weight:700;line-height:1;display:inline-flex}.runtime-host-info-button:hover,.runtime-host-info-button:focus-visible{color:var(--text);border-color:#7dd3fc52;outline:none}.runtime-host-info-copy{gap:6px;display:grid}.runtime-host-info-copy strong{font-size:12px}.runtime-host-info-copy p{color:var(--muted);margin:0;font-size:12px;line-height:1.45}.topbar-eyebrow{color:var(--accent);letter-spacing:.12em;text-transform:uppercase;margin:0;font-size:11px;font-weight:700;line-height:1}.workspace-path-label{max-width:220px;color:var(--muted);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:1;overflow:hidden}.workspace-switcher{align-items:center;gap:8px;display:flex}.workspace-switcher select{border:1px solid var(--line);min-width:140px;color:var(--text);background:#111827eb;border-radius:8px;padding:6px 10px}.topbar-copy,.muted,.button-copy.muted-copy,.list-button span,.kv-key,.event-line{color:var(--muted)}.topbar-copy{max-width:760px;margin:0}.status-badge{border:1px solid var(--line);max-width:min(260px,100%);color:var(--muted);text-overflow:ellipsis;white-space:nowrap;background:#111827eb;border-radius:999px;align-items:center;padding:7px 12px;font-size:12px;line-height:1;display:inline-flex;overflow:hidden}.status-badge.bad{color:var(--bad);border-color:#fda4af4d}.tabs{flex-wrap:wrap;gap:8px;display:flex}.tab-button{border:1px solid var(--line);background:var(--panel);color:var(--muted);cursor:pointer;border-radius:10px;align-items:center;padding:8px 12px;text-decoration:none;display:inline-flex}.tab-button.active,.side-tabs button.active{color:var(--text);background:#7dd3fc1f;border-color:#7dd3fc57}.overview-grid{flex:auto;grid-template-columns:repeat(12,minmax(0,1fr));grid-auto-rows:min-content;align-content:start;align-items:start;gap:14px;min-height:0;display:grid;overflow:auto}.panel{border:1px solid var(--line);background:var(--panel);border-radius:16px;grid-column:span 4;align-self:start;min-width:0;padding:18px}.panel.wide{grid-column:span 6}.overview-hero{grid-column:span 7;min-height:0}.overview-hero-copy{flex-direction:column;gap:14px;display:flex}.overview-identity{grid-column:span 5}.overview-runtime,.overview-create,.overview-metrics{grid-column:span 4}.overview-list-panel{min-height:0}.overview-more{margin-top:10px}.overview-metric-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;display:grid}.overview-metric-item{flex-direction:column;gap:6px;display:flex}.overview-metric-item .metric{margin:0;font-size:28px}.workspace-form{flex-direction:column;gap:10px;display:flex}.workspace-form-field{flex-direction:column;gap:6px;display:flex}.workspace-form-field input{border:1px solid var(--line);width:100%;color:var(--text);background:#0f172ab3;border-radius:10px;padding:10px 12px}.workspace-form-field input::placeholder{color:var(--muted)}.workspace-form-field input:disabled{opacity:.6;cursor:not-allowed}.workspace-form-checkbox{align-items:center;gap:8px;display:flex}.metric{letter-spacing:-.04em;margin-bottom:6px;font-size:40px;font-weight:800;line-height:1}.workspace-shell{grid-template-columns:minmax(260px, var(--session-sidebar-width,288px)) 6px minmax(560px, 1fr) 6px minmax(320px, var(--session-side-width,344px));border:1px solid var(--line);background:linear-gradient(#111827fa,#0f172af5);border-radius:18px;flex:auto;min-height:0;display:grid;overflow:hidden;box-shadow:0 20px 48px #0000003d}.workspace-sidebar,.workspace-main,.workspace-side{flex-direction:column;min-height:0;display:flex}.workspace-sidebar,.workspace-side{background:var(--panel-muted)}.workspace-sidebar{border-right:0}.workspace-side{border-left:0}.workspace-main{background:var(--panel-alt);grid-template-rows:auto minmax(0,1fr) auto;min-height:0;display:grid;overflow:hidden}.workspace-resizer{cursor:col-resize;touch-action:none;background:#080c1457;border:0;border-left:1px solid #94a3b81f;border-right:1px solid #94a3b81f;border-radius:0;width:6px;min-width:6px}.workspace-resizer:hover,.workspace-resizer:focus-visible{background:#7dd3fc29;border-color:#7dd3fc4d;outline:none}.workspace-header{border-bottom:1px solid #94a3b81f;justify-content:space-between;align-items:flex-start;gap:12px;padding:14px 16px;display:flex}.workspace-header h2{margin-bottom:2px}.workspace-header .muted{font-size:12px;line-height:1.45}.session-controls{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;display:flex}.select-control{color:var(--muted);align-items:center;gap:6px;font-size:12px;display:flex}.select-control select{border:1px solid var(--line);max-width:190px;color:var(--text);background:#0f172acc;border-radius:8px;padding:5px 8px}.drift-button{color:var(--muted);background:0 0;border:1px solid #94a3b838;border-radius:999px;padding:3px 9px;font-size:12px}.drift-button.active{color:var(--good);border-color:#86efac47}.drift-button:disabled,.select-control select:disabled{opacity:.65;cursor:not-allowed}.sidebar-scroll,.conversation-scroll,.side-scroll,.task-detail-scroll{flex:auto;min-height:0;overflow:auto}.sidebar-scroll,.side-scroll,.task-detail-scroll{padding:12px}.split-scroll{flex-direction:column;gap:16px;display:flex}.stack-list{flex-direction:column;gap:10px;display:flex}.stack-list.compact{gap:8px}.list-button{text-align:left;background:#0f172a8a;border:1px solid #94a3b814;border-radius:12px;width:100%;padding:11px;transition:border-color .12s,background .12s,transform .12s}.list-button:hover{background:#1e293bc7;border-color:#7dd3fc2e}.list-button.active{background:linear-gradient(#7dd3fc1f,#7dd3fc0f);border-color:#7dd3fc57;box-shadow:inset 0 0 0 1px #7dd3fc14}.list-button-header{justify-content:space-between;gap:8px;margin-bottom:6px;display:flex}.list-button-header strong{font-size:13px}.compact-button{padding:10px}.button-copy{color:var(--text);white-space:pre-wrap;overflow-wrap:anywhere;margin:6px 0 0;font-size:13px}.pills{flex-wrap:wrap;gap:6px;margin:8px 0;display:flex}.compact-pills{margin:0}.pill{color:var(--muted);border:1px solid #94a3b838;border-radius:999px;align-items:center;padding:2px 8px;font-size:12px;display:inline-flex}.pill.good{color:var(--good);border-color:#86efac47}.pill.warn{color:var(--warn);border-color:#fcd34d47}.pill.bad{color:var(--bad);border-color:#fda4af47}.conversation-scroll{flex-direction:column;min-height:0;padding:14px 18px 28px;display:flex;overflow:auto}.conversation-stack{flex-direction:column;gap:16px;min-height:100%;display:flex}.conversation-spacer{flex:1 0 32px}.message{overflow-wrap:anywhere;background:#111827e0;border:1px solid #94a3b81f;border-radius:14px;min-width:0;max-width:min(760px,84%);padding:12px 13px;box-shadow:0 8px 18px #00000029}.message.user{background:linear-gradient(#38bdf829,#38bdf81a);border-color:#7dd3fc3d;align-self:flex-end}.message.assistant{align-self:flex-start}.message.tool-result{background:#0f172ab8;border-color:#94a3b82e;max-width:min(820px,88%)}.message.working{border-color:#fcd34d47;box-shadow:inset 0 0 0 1px #fcd34d14}.message-header{color:var(--muted);justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px;font-size:12px;display:flex}.message-body,.summary,.kv-value{white-space:pre-wrap;overflow-wrap:anywhere}.markdown-body{white-space:normal;line-height:1.65}.markdown-body>:last-child{margin-bottom:0}.markdown-body p,.markdown-body ul,.markdown-body ol,.markdown-body pre,.markdown-body blockquote,.markdown-body table{margin:0 0 12px}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4{margin:0 0 10px;line-height:1.25}.markdown-body ul,.markdown-body ol{padding-left:20px}.markdown-body li+li{margin-top:4px}.markdown-body blockquote{color:var(--muted);border-left:3px solid #7dd3fc47;padding-left:12px}.markdown-body table{border-collapse:collapse;width:100%;font-size:13px}.markdown-body th,.markdown-body td{border:1px solid var(--line);text-align:left;vertical-align:top;padding:8px 10px}.markdown-body th{background:#94a3b814}.tool-result-body{flex-direction:column;gap:8px;display:flex}.tool-result-meta{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.tool-command{color:var(--muted);overflow-wrap:anywhere;font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace}.tool-error{color:var(--bad);margin:0}.tool-output{color:#dbe4f3;white-space:pre-wrap;background:#070b10d1;border:1px solid #94a3b81a;border-radius:8px;max-height:280px;margin:0;padding:10px;font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;overflow:auto}.inline-code{background:#94a3b81f;border-radius:6px;padding:1px 5px;font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace}.composer-shell{background:#080c1457;border-top:1px solid #94a3b81f;padding:14px 16px 16px;position:relative}.composer-shell textarea{resize:none;background:#0b1220e6;border:1px solid #94a3b824;border-radius:12px;width:100%;min-height:96px;padding:12px 13px;transition:border-color .12s,box-shadow .12s}.composer-shell textarea:focus{border-color:#7dd3fc57;outline:none;box-shadow:0 0 0 3px #7dd3fc14}.composer-shell textarea::placeholder{color:var(--muted)}.mention-menu{z-index:12;border:1px solid var(--line-strong);background:#0b1220fa;border-radius:8px;max-height:260px;padding:8px;position:absolute;bottom:calc(100% - 8px);left:16px;right:16px;overflow:auto;box-shadow:0 16px 36px #00000057}.mention-menu-header{color:var(--muted);justify-content:space-between;gap:12px;padding:4px 6px 8px;font-size:12px;display:flex}.mention-option{width:100%;color:var(--text);text-align:left;background:0 0;border:1px solid #0000;border-radius:8px;padding:8px 9px}.mention-option.active,.mention-option:hover{background:#7dd3fc1f;border-color:#7dd3fc47}.mention-option span{overflow-wrap:anywhere;font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace}.mention-empty{color:var(--muted);margin:0;padding:10px 8px}.composer-footer{justify-content:space-between;align-items:flex-end;gap:12px;margin-top:8px;display:flex}.composer-status{flex-flow:wrap;flex:auto;align-items:center;gap:6px;min-width:0;display:flex}.composer-status p{max-width:560px;margin:0;font-size:12px;line-height:1.35}.composer-actions{flex-shrink:0;justify-content:flex-end}.primary-button{color:#03131c;background:linear-gradient(#8ee3ff,#67c7ef);border:0;border-radius:10px;padding:9px 14px;font-weight:700;box-shadow:0 8px 18px #67c7ef33}.sidebar-action-button{color:var(--text);white-space:nowrap;background:#7dd3fc1a;border:1px solid #7dd3fc38;border-radius:10px;padding:7px 11px;font-size:12px;font-weight:600;transition:border-color .12s,background .12s,transform .12s}.sidebar-action-button:hover{background:#7dd3fc29;border-color:#7dd3fc57}.sidebar-action-button:disabled{opacity:.65;cursor:not-allowed}.primary-button:disabled,.composer-shell textarea:disabled{opacity:.6;cursor:not-allowed}.side-tabs{border-bottom:1px solid var(--line);gap:8px;padding:14px;display:flex}.side-tabs button{border:1px solid var(--line);color:var(--muted);background:0 0;border-radius:10px;padding:8px 12px}.review-mode-tabs{z-index:2;background:var(--panel-alt);margin:-12px -12px 12px;padding:12px;position:sticky;top:0}.review-section-actions{align-items:center;gap:8px;display:flex}.stale-diff-button{color:#fde68a;background:#facc1514;border:1px solid #facc1566;border-radius:999px;justify-content:center;align-items:center;width:26px;height:26px;font-size:12px;font-weight:700;line-height:1;display:inline-flex}.review-turn-picker{max-height:210px;padding-right:2px;overflow:auto}.diff-dialog-backdrop{z-index:80;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:#020617c7;justify-content:center;align-items:center;padding:24px;display:flex;position:fixed;inset:0}.diff-dialog{background:#07101d;border:1px solid #7dd3fc42;border-radius:18px;flex-direction:column;width:min(1180px,96vw);min-height:min(620px,82vh);max-height:min(860px,92vh);display:flex;overflow:hidden;box-shadow:0 28px 90px #0000008c}.diff-dialog-header{border-bottom:1px solid var(--line);background:#0f172ad1;justify-content:space-between;align-items:flex-start;gap:18px;padding:18px 20px;display:flex}.diff-dialog-header h2{overflow-wrap:anywhere;margin:0;font-size:18px}.diff-dialog-body{flex:auto;min-height:0;padding:18px 20px 20px;overflow:auto}.diff-dialog-body .diff-viewer{min-width:min(900px,100%)}.side-section{flex-direction:column;gap:10px;display:flex}.detail-stack{flex-direction:column;gap:14px;display:flex}.compact-stack{gap:10px}.detail-card,.empty-state{background:#0f172a8f;border:1px solid #94a3b81a;border-radius:12px;padding:12px}.error-card{border-color:#fda4af3d}.approval-card{flex-direction:column;gap:8px;max-height:min(520px,58vh);display:flex;overflow:hidden}.approval-card .muted{overflow-wrap:anywhere}.approval-card .code-block{overscroll-behavior:contain;-webkit-overflow-scrolling:touch;border-radius:8px;flex:auto;min-height:84px;max-height:min(360px,36vh);overflow:auto}.approval-actions{flex:none;margin-bottom:0}.card-title,.section-label{margin-bottom:6px;font-size:13px;font-weight:700}.kv-list{gap:8px;display:grid}.kv-list>div{gap:2px;display:grid}.kv-key{text-transform:uppercase;letter-spacing:.08em;font-size:11px}.path{word-break:break-all}.event-list{flex-direction:column;gap:8px;display:flex}.event-line{border-left:2px solid #94a3b83d;margin:0;padding-left:10px;font-size:13px}.code-block{color:#dbe4f3;white-space:pre-wrap;background:#070b10;border-radius:12px;margin:0;padding:12px;font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;overflow:auto}.empty-state{flex-direction:column;gap:6px;display:flex}.sidebar-empty-state{padding-top:8px}@media (width<=1180px){.workspace-shell{grid-template-columns:minmax(232px, var(--session-sidebar-width,252px)) 6px minmax(420px, 1fr) 6px minmax(280px, var(--session-side-width,312px))}}@media (width<=980px){html,body,#root{height:100dvh;min-height:100dvh}body{overflow:hidden}.app-shell{gap:10px;height:100dvh;min-height:100dvh;padding:10px;overflow:hidden}.topbar{flex-direction:column}.toolbar{flex-direction:row;align-items:center;gap:8px}.toolbar-status{flex:auto;justify-content:flex-end;gap:8px;width:auto}.toolbar-tabs{flex:none}.toolbar-actions{margin-left:auto;display:block}.tab-button{padding:7px 10px}.topbar-title-row{gap:8px}.workspace-path-label{max-width:150px}.status-badge{max-width:180px;padding:6px 10px}.composer-footer{flex-direction:column;align-items:stretch}.composer-actions{justify-content:flex-start}.overview-grid{grid-template-columns:1fr;align-content:start;padding:12px}.panel,.panel.wide,.overview-hero,.overview-identity,.overview-runtime,.overview-create,.overview-metrics{grid-column:auto}.overview-metric-grid{grid-template-columns:1fr}}.mobile-nav-button,.mobile-side-header,.mobile-task-shell,.mobile-task-screen,.mobile-task-header,.mobile-task-segmented,.mobile-task-meta{display:none}@media (width<=760px){.workspace-shell{display:none}.mobile-session-screen,.mobile-task-screen{flex:auto;height:100%;min-height:0;display:flex;overflow:hidden}.mobile-pane{border:1px solid var(--line);border-radius:12px;width:100%;min-height:0;overflow:hidden}.mobile-session-list .mobile-pane,.mobile-session-review .mobile-pane,.mobile-task-screen .mobile-pane{background:var(--panel-muted);flex-direction:column;display:flex}.mobile-session-chat,.mobile-task-screen{min-height:0}.mobile-chat-pane{background:var(--panel-alt);flex-direction:column;min-height:0;display:flex}.workspace-resizer{display:none}.mobile-nav-button{color:var(--text);background:#7dd3fc14;border:1px solid #7dd3fc38;border-radius:10px;align-items:center;padding:7px 10px;font-size:12px;font-weight:600;display:inline-flex}.mobile-side-header,.mobile-task-header{background:var(--panel-muted);padding:12px 12px 0;display:block}.workspace-header,.mobile-task-segmented,.mobile-task-meta{padding:12px}.workspace-sidebar .workspace-header .muted{display:none}.workspace-header h2{font-size:17px}.workspace-header>div{min-width:0}.workspace-header .muted{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.session-controls{justify-content:flex-start;width:100%}.select-control{flex:180px}.select-control select{width:100%;max-width:none}.conversation-scroll{overscroll-behavior:contain;-webkit-overflow-scrolling:touch;flex:auto;min-height:0;padding:12px 12px 20px;overflow:auto}.conversation-stack{gap:12px}.conversation-spacer{flex-basis:10px}.message,.message.tool-result{border-radius:10px;max-width:100%}.composer-shell{z-index:1;overscroll-behavior:contain;max-height:58dvh;padding:10px 12px env(safe-area-inset-bottom,0px);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);-webkit-overflow-scrolling:touch;background:#080c14f5;flex-direction:column;flex:none;display:flex;position:relative;overflow:auto}.approval-card{flex:0 auto;max-height:min(330px,38dvh)}.approval-card .code-block{max-height:min(190px,22dvh)}.composer-shell textarea{border-radius:8px;flex:none;min-height:78px}.composer-actions{justify-content:flex-end;width:100%}.composer-actions .primary-button{margin-left:auto}.diff-dialog-backdrop{align-items:stretch;padding:10px}.diff-dialog{border-radius:14px;width:100%;min-height:calc(100dvh - 20px);max-height:calc(100dvh - 20px)}.diff-dialog-header{padding:14px}.diff-dialog-body{padding:12px}}@media (width<=620px){.toolbar{align-items:flex-start}.workspace-header{flex-direction:column;align-items:stretch}.toolbar-status{flex-wrap:wrap}.topbar-eyebrow{font-size:10px}.workspace-path-label{max-width:120px}.status-badge{max-width:150px}}.mobile-task-segmented{border-bottom:1px solid var(--line);background:var(--panel-muted);gap:8px;display:flex}.mobile-task-segmented button{border:1px solid var(--line);color:var(--muted);background:0 0;border-radius:10px;flex:1 1 0;padding:8px 12px}.mobile-task-segmented button.active{color:var(--text);background:#7dd3fc1f;border-color:#7dd3fc57}.mobile-task-meta{border-bottom:1px solid var(--line);background:var(--panel-muted);flex-direction:column;gap:8px;display:flex}@media (width<=500px){.toolbar{flex-wrap:wrap}.toolbar-tabs,.toolbar-status,.topbar-title-row,.topbar-eyebrow,.workspace-path-label,.status-badge,.workspace-header .muted,.composer-status,.pills.compact-pills,.mobile-inspector-button,.select-control,.drift-button,.session-controls .pill{display:none}.toolbar-actions{margin-left:auto;display:block}.workspace-main{height:auto;min-height:0}.workspace-header{gap:8px}.workspace-header,.side-tabs,.sidebar-scroll,.side-scroll,.task-detail-scroll,.mobile-task-segmented,.mobile-task-meta{padding:10px}.workspace-header h2{font-size:15px;line-height:1.2}.session-controls{gap:6px}.conversation-scroll{padding:8px 10px 12px}.message,.message.tool-result{max-width:100%;padding:10px 11px}.message.user{max-width:92%}.message-header{margin-bottom:6px}.composer-shell{max-height:62dvh;padding:8px 10px env(safe-area-inset-bottom,0px)}.approval-card{max-height:min(300px,40dvh)}.approval-card .code-block{max-height:min(170px,23dvh)}.composer-footer{gap:8px;margin-top:8px}.composer-actions{justify-content:space-between}.composer-actions .tab-button:not(:last-child){display:none}.composer-actions .primary-button{width:100%;margin-left:0}}