maxsimcli 4.2.0 → 4.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -75,7 +75,7 @@ That's the loop. Discuss → Plan → Execute → Verify. Each phase is isolated
|
|
|
75
75
|
|
|
76
76
|
## How It Works
|
|
77
77
|
|
|
78
|
-
MAXSIM installs
|
|
78
|
+
MAXSIM installs 35 slash commands, 11 skills, and an MCP server into Claude Code. Each command is a structured workflow that spawns specialized subagents with fresh context.
|
|
79
79
|
|
|
80
80
|
### The Core Loop
|
|
81
81
|
|
|
@@ -158,7 +158,9 @@ Real-time web dashboard — bundled inside the CLI, no separate setup needed.
|
|
|
158
158
|
- **Phase drill-down** — expand phases to see individual tasks with checkboxes
|
|
159
159
|
- **Inline Markdown editor** — edit plan files directly in the browser (CodeMirror, Ctrl+S)
|
|
160
160
|
- **Todos & Blockers** — manage todos and resolve blockers from STATE.md
|
|
161
|
-
- **
|
|
161
|
+
- **Q&A panel** — answer discussion questions from Claude Code directly in the browser
|
|
162
|
+
- **Embedded terminal** — xterm.js terminal with full Claude Code interaction
|
|
163
|
+
- **Multi-project** — switch between running dashboard instances via project switcher
|
|
162
164
|
- **LAN sharing** — share with teammates on the same network
|
|
163
165
|
|
|
164
166
|
```bash
|
|
@@ -178,6 +180,7 @@ npx maxsimcli dashboard --network # LAN sharing + QR code
|
|
|
178
180
|
| Command | Description |
|
|
179
181
|
|---------|-------------|
|
|
180
182
|
| `/maxsim:new-project` | Initialize: questions → research → requirements → roadmap |
|
|
183
|
+
| `/maxsim:init-existing` | Onboard an existing codebase — scan, verify, capture vision |
|
|
181
184
|
| `/maxsim:discuss-phase [N]` | Capture implementation decisions before planning |
|
|
182
185
|
| `/maxsim:plan-phase [N]` | Research + plan + verify for a phase |
|
|
183
186
|
| `/maxsim:execute-phase <N>` | Execute plans in parallel waves |
|
|
@@ -192,6 +195,8 @@ npx maxsimcli dashboard --network # LAN sharing + QR code
|
|
|
192
195
|
| `/maxsim:progress` | Where am I? What's next? |
|
|
193
196
|
| `/maxsim:help` | Show all commands |
|
|
194
197
|
| `/maxsim:quick` | Ad-hoc task with atomic commits (skips optional agents) |
|
|
198
|
+
| `/maxsim:batch` | Decompose large tasks into parallel worktree agents |
|
|
199
|
+
| `/maxsim:sdd` | Spec-driven development — fresh agent per task with 2-stage review |
|
|
195
200
|
| `/maxsim:debug [desc]` | Systematic debugging with persistent state |
|
|
196
201
|
| `/maxsim:map-codebase` | Analyze existing codebase with parallel mapper agents |
|
|
197
202
|
| `/maxsim:pause-work` | Create handoff when stopping mid-phase |
|
|
@@ -209,6 +214,7 @@ npx maxsimcli dashboard --network # LAN sharing + QR code
|
|
|
209
214
|
| `/maxsim:remove-phase [N]` | Remove future phase, renumber |
|
|
210
215
|
| `/maxsim:list-phase-assumptions [N]` | Surface Claude's assumptions before planning |
|
|
211
216
|
| `/maxsim:research-phase [N]` | Standalone phase research |
|
|
217
|
+
| `/maxsim:artefakte` | Manage decisions, acceptance criteria, and no-gos |
|
|
212
218
|
|
|
213
219
|
### Milestone & Quality
|
|
214
220
|
|
|
@@ -259,8 +265,8 @@ Verify with: `/maxsim:help`
|
|
|
259
265
|
<summary><strong>Non-interactive Install (Docker, CI, Scripts)</strong></summary>
|
|
260
266
|
|
|
261
267
|
```bash
|
|
262
|
-
npx maxsimcli --
|
|
263
|
-
npx maxsimcli --
|
|
268
|
+
npx maxsimcli --global # Global install → ~/.claude/
|
|
269
|
+
npx maxsimcli --local # Project-scoped install → ./.claude/
|
|
264
270
|
```
|
|
265
271
|
|
|
266
272
|
</details>
|
|
@@ -276,6 +282,7 @@ Project settings live in `.planning/config.json`, created during `/maxsim:new-pr
|
|
|
276
282
|
"model_profile": "balanced",
|
|
277
283
|
"branching_strategy": "none",
|
|
278
284
|
"commit_docs": true,
|
|
285
|
+
"search_gitignored": false,
|
|
279
286
|
"research": true,
|
|
280
287
|
"plan_checker": true,
|
|
281
288
|
"verifier": true,
|
|
@@ -289,6 +296,7 @@ Project settings live in `.planning/config.json`, created during `/maxsim:new-pr
|
|
|
289
296
|
| `model_profile` | `quality` \| `balanced` \| `budget` \| `tokenburner` | `balanced` | Which models agents use |
|
|
290
297
|
| `branching_strategy` | `none` \| `phase` \| `milestone` | `none` | Git branch creation per phase or milestone |
|
|
291
298
|
| `commit_docs` | boolean | `true` | Commit documentation changes separately |
|
|
299
|
+
| `search_gitignored` | boolean | `false` | Include gitignored files in codebase searches |
|
|
292
300
|
| `research` | boolean | `true` | Enable research agent before planning |
|
|
293
301
|
| `plan_checker` | boolean | `true` | Enable plan-checker agent before execution |
|
|
294
302
|
| `verifier` | boolean | `true` | Enable verifier agent after execution |
|
|
@@ -297,14 +305,23 @@ Project settings live in `.planning/config.json`, created during `/maxsim:new-pr
|
|
|
297
305
|
|
|
298
306
|
### Model Profiles
|
|
299
307
|
|
|
300
|
-
MAXSIM has **4 model profiles** that control which Claude model each of the
|
|
308
|
+
MAXSIM has **4 model profiles** that control which Claude model each of the 11 profiled agents uses:
|
|
301
309
|
|
|
302
|
-
|
|
|
303
|
-
|
|
304
|
-
|
|
|
305
|
-
|
|
|
306
|
-
|
|
|
307
|
-
|
|
|
310
|
+
| Agent | `quality` | `balanced` | `budget` | `tokenburner` |
|
|
311
|
+
|-------|-----------|------------|----------|---------------|
|
|
312
|
+
| Planner | Opus | Opus | Sonnet | Opus |
|
|
313
|
+
| Roadmapper | Opus | Sonnet | Sonnet | Opus |
|
|
314
|
+
| Executor | Opus | Sonnet | Sonnet | Opus |
|
|
315
|
+
| Debugger | Opus | Sonnet | Sonnet | Opus |
|
|
316
|
+
| Phase Researcher | Opus | Sonnet | Haiku | Opus |
|
|
317
|
+
| Project Researcher | Opus | Sonnet | Haiku | Opus |
|
|
318
|
+
| Research Synthesizer | Sonnet | Sonnet | Haiku | Opus |
|
|
319
|
+
| Codebase Mapper | Sonnet | Haiku | Haiku | Opus |
|
|
320
|
+
| Verifier | Sonnet | Sonnet | Haiku | Opus |
|
|
321
|
+
| Plan Checker | Sonnet | Sonnet | Haiku | Opus |
|
|
322
|
+
| Integration Checker | Sonnet | Sonnet | Haiku | Opus |
|
|
323
|
+
|
|
324
|
+
The remaining 2 agents (Spec Reviewer and Code Reviewer) are spawned by the Executor and inherit its model.
|
|
308
325
|
|
|
309
326
|
> `tokenburner` assigns Opus to every single agent. Use it when cost is no concern and you want maximum quality end-to-end.
|
|
310
327
|
|
|
@@ -392,9 +409,12 @@ MAXSIM includes 11 built-in skills that enforce workflow constraints and best pr
|
|
|
392
409
|
MAXSIM installs an MCP (Model Context Protocol) server that exposes project tools directly to Claude Code. The server is auto-configured during installation via `.mcp.json`.
|
|
393
410
|
|
|
394
411
|
**Exposed tools:**
|
|
395
|
-
- **Phase operations** — list, add, complete, and remove phases
|
|
412
|
+
- **Phase operations** — list, add, complete, insert, and remove phases
|
|
396
413
|
- **State management** — read/update STATE.md (decisions, blockers, metrics)
|
|
397
414
|
- **Todo operations** — create, list, and complete todos
|
|
415
|
+
- **Roadmap analysis** — phase status, progress calculation, missing details
|
|
416
|
+
- **Context loading** — intelligent file selection based on task topic
|
|
417
|
+
- **Config management** — read/write `.planning/config.json` settings
|
|
398
418
|
|
|
399
419
|
The MCP server runs as a stdio process managed by Claude Code — no manual startup needed.
|
|
400
420
|
|
package/dist/assets/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
## [4.2.1](https://github.com/maystudios/maxsimcli/compare/v4.2.0...v4.2.1) (2026-03-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **dashboard:** execute commands on button click instead of just copying ([ab10ff9](https://github.com/maystudios/maxsimcli/commit/ab10ff9bcb6d74695d52cb1430e5f99485484652))
|
|
7
|
+
|
|
8
|
+
# [4.2.0](https://github.com/maystudios/maxsimcli/compare/v4.1.0...v4.2.0) (2026-03-02)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **core:** resolve merge conflicts from parallel async migration PRs ([b8630ba](https://github.com/maystudios/maxsimcli/commit/b8630bae6c79e433abd0eafe7f91b6b5e48fa847))
|
|
14
|
+
* **execute-plan:** replace single-executor simplify stage with 3 parallel code reviewers ([d932fc7](https://github.com/maystudios/maxsimcli/commit/d932fc77143e74700aa88d7f776354cac2dde01a))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* add /maxsim:artefakte command for viewing and managing project artefakte ([b92b09e](https://github.com/maystudios/maxsimcli/commit/b92b09ecf35b6bf4fd489b3b55d873afa62719ab))
|
|
20
|
+
* add /maxsim:batch command and workflow for worktree-based parallel execution ([a5f38e8](https://github.com/maystudios/maxsimcli/commit/a5f38e84091a09ef9387db3c99995fbb8740104e))
|
|
21
|
+
* add /maxsim:sdd command and workflow for Spec-Driven Dispatch ([038a496](https://github.com/maystudios/maxsimcli/commit/038a496d61fc96bf34e698754881a6137ddacdc3))
|
|
22
|
+
* add batch and sdd commands to help reference, complete Phase 6 requirements ([4310461](https://github.com/maystudios/maxsimcli/commit/431046199d7695ee2c42d640921cef71a00645e2))
|
|
23
|
+
* **core:** add async versions of internal helpers for Phase 10 performance ([5833d44](https://github.com/maystudios/maxsimcli/commit/5833d44a2e1644fce10a52be535e6c70070d2d64))
|
|
24
|
+
* **dashboard:** add in-tab project switching to ProjectSwitcher ([6e037e5](https://github.com/maystudios/maxsimcli/commit/6e037e536969c0171fca1c18bfc141bed60bfcbb))
|
|
25
|
+
* **dashboard:** add project switcher for multi-dashboard navigation (DASH-07) ([47d2d00](https://github.com/maystudios/maxsimcli/commit/47d2d002ef4d32f82e56c07890ca7fd4b35fd7f7))
|
|
26
|
+
* **dashboard:** add terminal Q&A overlay for answering questions inline (DISC-07) ([07b4040](https://github.com/maystudios/maxsimcli/commit/07b4040525c5c62a04819c7c5ea67cc9d7b7dcdb))
|
|
27
|
+
* **discuss:** add phase-scoped artefakte to discuss-phase workflow ([8ce2e4b](https://github.com/maystudios/maxsimcli/commit/8ce2e4bf06bc7aec29df1c4bcb4349b403baacdd))
|
|
28
|
+
* expand check-todos brainstorm into thinking-partner discussion ([ebe603d](https://github.com/maystudios/maxsimcli/commit/ebe603d63587f8340cf072f03015c63d648328ed))
|
|
29
|
+
* expand thinking-partner reference with context modes and escalation patterns ([f5e7b8e](https://github.com/maystudios/maxsimcli/commit/f5e7b8ee158db4e74b21f50c470851f6c59e5d67))
|
|
30
|
+
* implement task-based context loading for planning agents (PS-03) ([457d72b](https://github.com/maystudios/maxsimcli/commit/457d72b002b12df3e482a9b12574bd43fa971865))
|
|
31
|
+
|
|
1
32
|
# [4.1.0](https://github.com/maystudios/maxsimcli/compare/v4.0.2...v4.1.0) (2026-03-02)
|
|
2
33
|
|
|
3
34
|
|
|
@@ -228,4 +228,6 @@ void main() {
|
|
|
228
228
|
`}),i.push(t[n]);return e&&t.length>0&&i.push({type:"text",value:`
|
|
229
229
|
`}),i}function jQ(t){let e=0,i=t.charCodeAt(e);for(;i===9||i===32;)e++,i=t.charCodeAt(e);return t.slice(e)}function IQ(t,e){const i=Due(t,e),n=i.one(t,void 0),s=wue(i),r=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return s&&r.children.push({type:"text",value:`
|
|
230
230
|
`},s),r}function jue(t,e){return t&&"run"in t?async function(i,n){const s=IQ(i,{file:n,...e});await t.run(s,n)}:function(i,n){return IQ(i,{file:n,...t||e})}}function VQ(t){if(t)throw t}var c1,XQ;function Iue(){if(XQ)return c1;XQ=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=function(u){return typeof Array.isArray=="function"?Array.isArray(u):e.call(u)==="[object Array]"},r=function(u){if(!u||e.call(u)!=="[object Object]")return!1;var d=t.call(u,"constructor"),p=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!d&&!p)return!1;var g;for(g in u);return typeof g>"u"||t.call(u,g)},o=function(u,d){i&&d.name==="__proto__"?i(u,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):u[d.name]=d.newValue},l=function(u,d){if(d==="__proto__")if(t.call(u,d)){if(n)return n(u,d).value}else return;return u[d]};return c1=function c(){var u,d,p,g,O,_,b=arguments[0],S=1,w=arguments.length,T=!1;for(typeof b=="boolean"&&(T=b,b=arguments[1]||{},S=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});S<w;++S)if(u=arguments[S],u!=null)for(d in u)p=l(b,d),g=l(u,d),b!==g&&(T&&g&&(r(g)||(O=s(g)))?(O?(O=!1,_=p&&s(p)?p:[]):_=p&&r(p)?p:{},o(b,{name:d,newValue:c(T,_,g)})):typeof g<"u"&&o(b,{name:d,newValue:g}));return b},c1}var Vue=Iue();const h1=qx(Vue);function Xx(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Xue(){const t=[],e={run:i,use:n};return e;function i(...s){let r=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...s);function l(c,...u){const d=t[++r];let p=-1;if(c){o(c);return}for(;++p<s.length;)(u[p]===null||u[p]===void 0)&&(u[p]=s[p]);s=u,d?Zue(d,l)(...u):o(null,...u)}}function n(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return t.push(s),e}}function Zue(t,e){let i;return n;function n(...o){const l=t.length>o.length;let c;l&&o.push(s);try{c=t.apply(this,o)}catch(u){const d=u;if(l&&i)throw d;return s(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(r,s):c instanceof Error?s(c):r(c))}function s(o,...l){i||(i=!0,e(o,...l))}function r(o){s(null,o)}}const pr={basename:que,dirname:Wue,extname:Uue,join:Yue,sep:"/"};function que(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');kd(t);let i=0,n=-1,s=t.length,r;if(e===void 0||e.length===0||e.length>t.length){for(;s--;)if(t.codePointAt(s)===47){if(r){i=s+1;break}}else n<0&&(r=!0,n=s+1);return n<0?"":t.slice(i,n)}if(e===t)return"";let o=-1,l=e.length-1;for(;s--;)if(t.codePointAt(s)===47){if(r){i=s+1;break}}else o<0&&(r=!0,o=s+1),l>-1&&(t.codePointAt(s)===e.codePointAt(l--)?l<0&&(n=s):(l=-1,n=o));return i===n?n=o:n<0&&(n=t.length),t.slice(i,n)}function Wue(t){if(kd(t),t.length===0)return".";let e=-1,i=t.length,n;for(;--i;)if(t.codePointAt(i)===47){if(n){e=i;break}}else n||(n=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function Uue(t){kd(t);let e=t.length,i=-1,n=0,s=-1,r=0,o;for(;e--;){const l=t.codePointAt(e);if(l===47){if(o){n=e+1;break}continue}i<0&&(o=!0,i=e+1),l===46?s<0?s=e:r!==1&&(r=1):s>-1&&(r=-1)}return s<0||i<0||r===0||r===1&&s===i-1&&s===n+1?"":t.slice(s,i)}function Yue(...t){let e=-1,i;for(;++e<t.length;)kd(t[e]),t[e]&&(i=i===void 0?t[e]:i+"/"+t[e]);return i===void 0?".":Hue(i)}function Hue(t){kd(t);const e=t.codePointAt(0)===47;let i=Fue(t,!e);return i.length===0&&!e&&(i="."),i.length>0&&t.codePointAt(t.length-1)===47&&(i+="/"),e?"/"+i:i}function Fue(t,e){let i="",n=0,s=-1,r=0,o=-1,l,c;for(;++o<=t.length;){if(o<t.length)l=t.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(s===o-1||r===1))if(s!==o-1&&r===2){if(i.length<2||n!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(c=i.lastIndexOf("/"),c!==i.length-1){c<0?(i="",n=0):(i=i.slice(0,c),n=i.length-1-i.lastIndexOf("/")),s=o,r=0;continue}}else if(i.length>0){i="",n=0,s=o,r=0;continue}}e&&(i=i.length>0?i+"/..":"..",n=2)}else i.length>0?i+="/"+t.slice(s+1,o):i=t.slice(s+1,o),n=o-s-1;s=o,r=0}else l===46&&r>-1?r++:r=-1}return i}function kd(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Gue={cwd:Kue};function Kue(){return"/"}function Zx(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Jue(t){if(typeof t=="string")t=new URL(t);else if(!Zx(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return efe(t)}function efe(t){if(t.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const e=t.pathname;let i=-1;for(;++i<e.length;)if(e.codePointAt(i)===37&&e.codePointAt(i+1)===50){const n=e.codePointAt(i+2);if(n===70||n===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(e)}const u1=["history","path","basename","stem","extname","dirname"];class xz{constructor(e){let i;e?Zx(e)?i={path:e}:typeof e=="string"||tfe(e)?i={value:e}:i=e:i={},this.cwd="cwd"in i?"":Gue.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<u1.length;){const r=u1[n];r in i&&i[r]!==void 0&&i[r]!==null&&(this[r]=r==="history"?[...i[r]]:i[r])}let s;for(s in i)u1.includes(s)||(this[s]=i[s])}get basename(){return typeof this.path=="string"?pr.basename(this.path):void 0}set basename(e){d1(e,"basename"),f1(e,"basename"),this.path=pr.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?pr.dirname(this.path):void 0}set dirname(e){ZQ(this.basename,"dirname"),this.path=pr.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?pr.extname(this.path):void 0}set extname(e){if(f1(e,"extname"),ZQ(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=pr.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Zx(e)&&(e=Jue(e)),d1(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?pr.basename(this.path,this.extname):void 0}set stem(e){d1(e,"stem"),f1(e,"stem"),this.path=pr.join(this.dirname||"",e+(this.extname||""))}fail(e,i,n){const s=this.message(e,i,n);throw s.fatal=!0,s}info(e,i,n){const s=this.message(e,i,n);return s.fatal=void 0,s}message(e,i,n){const s=new ln(e,i,n);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function f1(t,e){if(t&&t.includes(pr.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+pr.sep+"`")}function d1(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function ZQ(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function tfe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const ife=(function(t){const n=this.constructor.prototype,s=n[t],r=function(){return s.apply(r,arguments)};return Object.setPrototypeOf(r,n),r}),nfe={}.hasOwnProperty;class tC extends ife{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Xue()}copy(){const e=new tC;let i=-1;for(;++i<this.attachers.length;){const n=this.attachers[i];e.use(...n)}return e.data(h1(!0,{},this.namespace)),e}data(e,i){return typeof e=="string"?arguments.length===2?(g1("data",this.frozen),this.namespace[e]=i,this):nfe.call(this.namespace,e)&&this.namespace[e]||void 0:e?(g1("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const s=i.call(e,...n);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const i=Qm(e),n=this.parser||this.Parser;return p1("parse",n),n(String(i),i)}process(e,i){const n=this;return this.freeze(),p1("process",this.parser||this.Parser),m1("process",this.compiler||this.Compiler),i?s(void 0,i):new Promise(s);function s(r,o){const l=Qm(e),c=n.parse(l);n.run(c,l,function(d,p,g){if(d||!p||!g)return u(d);const O=p,_=n.stringify(O,g);ofe(_)?g.value=_:g.result=_,u(d,g)});function u(d,p){d||!p?o(d):r?r(p):i(void 0,p)}}}processSync(e){let i=!1,n;return this.freeze(),p1("processSync",this.parser||this.Parser),m1("processSync",this.compiler||this.Compiler),this.process(e,s),WQ("processSync","process",i),n;function s(r,o){i=!0,VQ(r),n=o}}run(e,i,n){qQ(e),this.freeze();const s=this.transformers;return!n&&typeof i=="function"&&(n=i,i=void 0),n?r(void 0,n):new Promise(r);function r(o,l){const c=Qm(i);s.run(e,c,u);function u(d,p,g){const O=p||e;d?l(d):o?o(O):n(void 0,O,g)}}}runSync(e,i){let n=!1,s;return this.run(e,i,r),WQ("runSync","run",n),s;function r(o,l){VQ(o),s=l,n=!0}}stringify(e,i){this.freeze();const n=Qm(i),s=this.compiler||this.Compiler;return m1("stringify",s),qQ(e),s(e,n)}use(e,...i){const n=this.attachers,s=this.namespace;if(g1("use",this.frozen),e!=null)if(typeof e=="function")c(e,i);else if(typeof e=="object")Array.isArray(e)?l(e):o(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function r(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...p]=u;c(d,p)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(u.plugins),u.settings&&(s.settings=h1(!0,s.settings,u.settings))}function l(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const p=u[d];r(p)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let p=-1,g=-1;for(;++p<n.length;)if(n[p][0]===u){g=p;break}if(g===-1)n.push([u,...d]);else if(d.length>0){let[O,..._]=d;const b=n[g][1];Xx(b)&&Xx(O)&&(O=h1(!0,b,O)),n[g]=[u,O,..._]}}}}const sfe=new tC().freeze();function p1(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function m1(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function g1(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function qQ(t){if(!Xx(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function WQ(t,e,i){if(!i)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Qm(t){return rfe(t)?t:new xz(t)}function rfe(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function ofe(t){return typeof t=="string"||afe(t)}function afe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const lfe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",UQ=[],YQ={allowDangerousHtml:!0},cfe=/^(https?|ircs?|mailto|xmpp)$/i,hfe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Sz(t){const e=ufe(t),i=ffe(t);return dfe(e.runSync(e.parse(i),i),t)}function ufe(t){const e=t.rehypePlugins||UQ,i=t.remarkPlugins||UQ,n=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...YQ}:YQ;return sfe().use(qhe).use(i).use(jue,n).use(e)}function ffe(t){const e=t.children||"",i=new xz;return typeof e=="string"&&(i.value=e),i}function dfe(t,e){const i=e.allowedElements,n=e.allowElement,s=e.components,r=e.disallowedElements,o=e.skipHtml,l=e.unwrapDisallowed,c=e.urlTransform||pfe;for(const d of hfe)Object.hasOwn(e,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+lfe+d.id,void 0);return bz(t,u),wle(t,{Fragment:x.Fragment,components:s,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function u(d,p,g){if(d.type==="raw"&&g&&typeof p=="number")return o?g.children.splice(p,1):g.children[p]={type:"text",value:d.value},p;if(d.type==="element"){let O;for(O in o1)if(Object.hasOwn(o1,O)&&Object.hasOwn(d.properties,O)){const _=d.properties[O],b=o1[O];(b===null||b.includes(d.tagName))&&(d.properties[O]=c(String(_||""),O,d))}}if(d.type==="element"){let O=i?!i.includes(d.tagName):r?r.includes(d.tagName):!1;if(!O&&n&&typeof p=="number"&&(O=!n(d,p,g)),O&&g&&typeof p=="number")return l&&d.children?g.children.splice(p,1,...d.children):g.children.splice(p,1),p}}}function pfe(t){const e=t.indexOf(":"),i=t.indexOf("?"),n=t.indexOf("#"),s=t.indexOf("/");return e===-1||s!==-1&&e>s||i!==-1&&e>i||n!==-1&&e>n||cfe.test(t.slice(0,e))?t:""}function mfe({option:t,selected:e,variant:i,onSelect:n,onFocus:s,onBlur:r}){var p;const[o,l]=I.useState(!1),c=t.description.split(`
|
|
231
|
-
`),u=c.length>1||t.description.length>120,d=o?t.description:((p=c[0])==null?void 0:p.slice(0,120))??"";return x.jsxs("button",{type:"button",onClick:n,onMouseEnter:s,onMouseLeave:r,onFocus:s,onBlur:r,className:Ne("flex items-start gap-3 border p-3 text-left transition-colors w-full",e?"border-simple-accent bg-simple-accent/10":"border-border bg-card hover:border-muted-foreground/40"),children:[x.jsx("span",{className:"mt-0.5 shrink-0",children:i==="radio"?x.jsx("span",{className:Ne("flex h-4 w-4 items-center justify-center border",e?"border-simple-accent":"border-muted-foreground"),style:{borderRadius:"50%"},children:e&&x.jsx("span",{className:"h-2 w-2 bg-simple-accent",style:{borderRadius:"50%"}})}):x.jsx("span",{className:Ne("flex h-4 w-4 items-center justify-center border",e?"border-simple-accent bg-simple-accent/20":"border-muted-foreground"),children:e&&x.jsx("svg",{className:"h-3 w-3 text-simple-accent",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:x.jsx("path",{d:"M2 6l3 3 5-5",strokeLinecap:"round",strokeLinejoin:"round"})})})}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("p",{className:"text-sm font-medium text-foreground leading-tight",children:t.label}),x.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 leading-snug",children:[d,!o&&u&&"..."]}),u&&x.jsx("span",{role:"button",tabIndex:0,onClick:g=>{g.stopPropagation(),l(O=>!O)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.stopPropagation(),g.preventDefault(),l(O=>!O))},className:"text-[10px] text-simple-accent mt-1 inline-block cursor-pointer hover:underline",children:o?"Show less":"Show more"})]})]})}function gfe({markdown:t,visible:e}){return e?x.jsx("div",{className:"border border-border bg-card p-4 text-xs font-mono text-foreground/80 leading-relaxed overflow-auto max-h-64 lg:absolute lg:right-0 lg:top-0 lg:w-80 lg:translate-x-[calc(100%+0.75rem)] lg:z-10 lg:shadow-lg mt-2 lg:mt-0",children:x.jsx(Sz,{children:t})}):null}function Ofe({question:t,onSubmit:e}){const[i,n]=I.useState(null),[s,r]=I.useState(new Set),[o,l]=I.useState(""),[c,u]=I.useState(null),d=I.useRef(null);I.useEffect(()=>{const T=d.current;T&&(T.style.height="auto",T.style.height=`${T.scrollHeight}px`)},[o]),I.useEffect(()=>{n(null),r(new Set),l(""),u(null)},[t.id]);function p(T){t.multiSelect?r(k=>{const A=new Set(k);return A.has(T)?A.delete(T):A.add(T),A}):n(T)}function g(T){l(T),!t.multiSelect&&T.length>0&&n(null)}function O(T){T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),_())}function _(){if(b)if(t.multiSelect){const T=t.options.filter(k=>s.has(k.id)).map(k=>k.label);e({questionId:t.id,header:t.header,selectedOptionIds:Array.from(s),selectedLabels:T,freeText:o.trim()})}else if(i){const T=t.options.find(k=>k.id===i);e({questionId:t.id,header:t.header,selectedOptionIds:[i],selectedLabels:T?[T.label]:[],freeText:""})}else e({questionId:t.id,header:t.header,selectedOptionIds:[],selectedLabels:[],freeText:o.trim()})}const b=t.multiSelect?s.size>0||o.trim().length>0:i!==null||o.trim().length>0,S=c?t.options.find(T=>T.id===c):null,w=(S==null?void 0:S.markdown)??"";return x.jsxs("div",{className:"border border-border bg-card p-4 relative",children:[x.jsx("span",{className:"inline-block bg-simple-accent/20 border border-simple-accent/40 px-2 py-0.5 text-[10px] font-mono uppercase tracking-wider text-simple-accent mb-2",children:t.header}),x.jsx("div",{className:"text-sm text-foreground leading-relaxed mb-4 prose prose-invert prose-sm max-w-none [&_a]:text-simple-accent [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-xs",children:x.jsx(Sz,{children:t.question})}),t.options.length>0&&x.jsxs("div",{className:"relative",children:[x.jsx("div",{className:"grid gap-2 mb-3",children:t.options.map(T=>{const k=t.multiSelect?s.has(T.id):i===T.id;return x.jsx(mfe,{option:T,selected:k,variant:t.multiSelect?"checkbox":"radio",onSelect:()=>p(T.id),onFocus:()=>u(T.id),onBlur:()=>u(null)},T.id)})}),x.jsx(gfe,{markdown:w,visible:!!w})]}),x.jsx("div",{className:"border border-border bg-muted/10 px-3 py-2 mb-3",children:x.jsx("textarea",{ref:d,value:o,onChange:T=>g(T.target.value),onKeyDown:O,rows:1,className:"w-full resize-none overflow-hidden bg-transparent font-mono text-xs text-foreground outline-none leading-relaxed"})}),x.jsx("button",{type:"button",onClick:_,disabled:!b,className:Ne("flex items-center gap-1.5 border px-3 py-1.5 text-xs font-mono uppercase tracking-widest transition-colors",b?"border-simple-accent bg-simple-accent/10 text-simple-accent hover:bg-simple-accent hover:text-background":"border-border text-muted-foreground cursor-not-allowed"),children:"Submit"})]})}function vfe({answer:t}){const e=t.selectedLabels.length>0?t.selectedLabels.join(", "):t.freeText.slice(0,80)+(t.freeText.length>80?"...":"");return x.jsx(_o.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:x.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/40 text-xs text-muted-foreground",children:[x.jsx("svg",{className:"h-3.5 w-3.5 text-success shrink-0",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:x.jsx("path",{d:"M6.5 12.5l-4-4 1.4-1.4L6.5 9.7l5.6-5.6 1.4 1.4z"})}),x.jsx("span",{className:"font-mono text-simple-accent shrink-0",children:t.header}),x.jsx("span",{className:"text-foreground/70 truncate",children:e})]})})}function _fe(){return x.jsxs("div",{className:"border border-border bg-card p-4 animate-pulse",children:[x.jsx("div",{className:"h-3 w-16 bg-muted mb-3"}),x.jsx("div",{className:"h-4 w-3/4 bg-muted mb-2"}),x.jsx("div",{className:"h-4 w-1/2 bg-muted mb-4"}),x.jsxs("div",{className:"flex gap-2",children:[x.jsx("div",{className:"h-10 flex-1 bg-muted"}),x.jsx("div",{className:"h-10 flex-1 bg-muted"})]}),x.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[x.jsx("svg",{className:"h-3.5 w-3.5 text-simple-accent animate-spin",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:x.jsx("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"28",strokeDashoffset:"8"})}),x.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Loading question..."})]})]})}function yfe({onAskMore:t,onDoneExecute:e,disabled:i}){return x.jsxs("div",{className:"sticky bottom-0 z-10 flex items-center justify-end gap-3 border-t border-border bg-background/95 backdrop-blur px-4 py-3",children:[x.jsx("button",{type:"button",onClick:t,disabled:i,className:"border border-simple-accent/50 px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent/10 disabled:opacity-50",children:"Ask me more"}),x.jsx("button",{type:"button",onClick:e,disabled:i,className:"bg-simple-accent/15 border border-simple-accent px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background disabled:opacity-50",children:"Done, execute"})]})}function bfe({open:t,onConfirm:e,onCancel:i}){return x.jsx(SS,{children:t&&x.jsx(_o.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:i,children:x.jsxs(_o.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"mx-4 w-full max-w-sm border border-border bg-card p-6",onClick:n=>n.stopPropagation(),children:[x.jsx("p",{className:"text-sm text-foreground leading-relaxed mb-6",children:"This will end discussion and start execution. Continue?"}),x.jsxs("div",{className:"flex items-center justify-end gap-3",children:[x.jsx("button",{type:"button",onClick:i,className:"border border-border px-4 py-2 text-xs font-mono uppercase tracking-widest text-muted-foreground transition-colors hover:border-muted-foreground hover:text-foreground",children:"Cancel"}),x.jsx("button",{type:"button",onClick:e,className:"bg-simple-accent/15 border border-simple-accent px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background",children:"Confirm"})]})]})})})}function xfe({answerCount:t}){return x.jsxs(_o.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.25,ease:"easeOut"},className:"border border-border bg-card p-6 text-center",children:[x.jsx("div",{className:"flex justify-center mb-3",children:x.jsxs("svg",{className:"h-8 w-8 text-success",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[x.jsx("circle",{cx:"12",cy:"12",r:"10"}),x.jsx("path",{d:"M8 12l3 3 5-5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),x.jsx("h3",{className:"text-sm font-medium text-foreground mb-1",children:"Discussion Complete"}),x.jsxs("p",{className:"text-xs text-muted-foreground mb-4",children:[t," ",t===1?"question":"questions"," answered"]}),x.jsxs("div",{className:"flex items-center justify-center gap-2",children:[x.jsx("svg",{className:"h-3.5 w-3.5 text-simple-accent animate-spin",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:x.jsx("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"28",strokeDashoffset:"8"})}),x.jsx("span",{className:"text-[10px] font-mono text-muted-foreground uppercase tracking-wider",children:"Execution queued..."})]})]})}function Sfe(){const{phase:t,currentQuestion:e,answeredQuestions:i,answerCount:n,submitAnswer:s,askMore:r,doneExecute:o,receiveQuestions:l}=Ux(),{onQuestionReceivedRef:c}=Rr();I.useEffect(()=>(c.current=S=>{l(S)},()=>{c.current=null}),[l,c]);const[u,d]=I.useState(!1),p=I.useRef(null);I.useEffect(()=>{t==="active"&&p.current&&p.current.scrollIntoView({behavior:"smooth",block:"start"})},[t,e==null?void 0:e.id]);function g(){d(!0)}function O(){d(!1),o()}function _(){d(!1)}const b=t==="submitting"||t==="complete";return x.jsxs("div",{className:"flex flex-col h-full",children:[x.jsx("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:x.jsxs("span",{className:"text-xs font-mono uppercase tracking-wider text-muted-foreground",children:["Discussion (",n,"/?)"]})}),x.jsx("div",{className:"flex-1 overflow-y-auto pb-20",children:x.jsxs("div",{className:"mx-auto max-w-3xl p-4 flex flex-col gap-2",children:[i.map(S=>x.jsx(vfe,{answer:S},S.questionId)),t==="active"&&e&&x.jsx("div",{ref:p,children:x.jsx(Ofe,{question:e,onSubmit:s})}),t==="loading"&&x.jsx(_fe,{}),t==="complete"&&x.jsx(xfe,{answerCount:n})]})}),t!=="complete"&&x.jsx(yfe,{onAskMore:r,onDoneExecute:g,disabled:b}),x.jsx(bfe,{open:u,onConfirm:O,onCancel:_})]})}function HQ(){var i;const{lifecycleEvent:t,pendingQuestionCount:e}=Rr();return!t&&e===0?null:x.jsxs("div",{className:"flex items-center justify-between px-4 py-1.5 bg-muted/50 border-b border-border text-xs font-mono text-muted-foreground",children:[t&&x.jsxs("span",{children:["Phase ",t.phase_number,": ",t.phase_name," — ",(i=t.event_type)==null?void 0:i.replace(/-/g," "),t.step&&t.total_steps?` (Step ${t.step}/${t.total_steps})`:""]}),e>0&&x.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-teal-500/20 text-teal-400 text-[10px] font-semibold",children:[e," pending"]})]})}function wfe({onExecute:t}){const{phase:e,startDiscussion:i,resetDiscussion:n}=Ux(),{pendingQuestionCount:s}=Rr(),r=e!=="idle";function o(l){if(l.startsWith("/maxsim:discuss-phase")){i();return}t(l)}return r?x.jsxs("div",{className:"flex flex-col gap-0 h-full",children:[x.jsx(HQ,{}),x.jsxs("div",{className:"px-4 pt-3 sm:px-6 flex items-center gap-2",children:[x.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 text-xs font-mono text-muted-foreground hover:text-foreground transition-colors",children:[x.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:x.jsx("path",{d:"M8 1L3 6l5 5",strokeLinecap:"round",strokeLinejoin:"round"})}),"Back to actions"]}),s>0&&x.jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-teal-500/20 text-teal-400 text-[10px] font-semibold",children:s})]}),x.jsx("div",{className:"flex-1 min-h-0",children:x.jsx(Sfe,{})})]}):x.jsxs("div",{className:"flex flex-col gap-0 h-full",children:[x.jsx(HQ,{}),x.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:x.jsxs("div",{className:"mx-auto max-w-3xl flex flex-col gap-4",children:[x.jsx(Wae,{}),x.jsx(Vae,{}),x.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[x.jsx(Uae,{}),x.jsx(Hae,{})]}),x.jsx(qae,{onExecute:o})]})})]})}function Cfe(){const{connected:t}=Rr(),[e,i]=I.useState(!0),[n,s]=I.useState(!1),[r,o]=I.useState(!1);I.useEffect(()=>{if(t){o(!1),i(!0);return}const c=setTimeout(()=>o(!0),3e3);return()=>clearTimeout(c)},[t]);const l=I.useCallback(async()=>{s(!0);try{const c=await fetch("/api/health",{signal:AbortSignal.timeout(5e3)});i(c.ok),c.ok&&window.location.reload()}catch{i(!1)}finally{s(!1)}},[]);return r?x.jsxs("div",{className:"shrink-0 flex items-center justify-between gap-3 border-b border-danger/30 bg-danger/5 px-4 py-2",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-danger animate-pulse"}),x.jsx("span",{className:"font-mono text-xs text-danger",children:e?"WebSocket disconnected. Reconnecting...":"Dashboard server unreachable"})]}),x.jsx("button",{type:"button",disabled:n,onClick:l,className:"shrink-0 border border-danger/40 px-3 py-1 font-mono text-[10px] uppercase tracking-widest text-danger transition-colors hover:bg-danger/10 disabled:opacity-50",children:n?"Checking...":"Retry"})]}):null}function kfe(){return x.jsxs("div",{className:"flex flex-col gap-6",children:[x.jsxs("div",{className:"flex flex-col gap-4 border-b border-border pb-6",children:[x.jsx("div",{className:"h-2 w-32 animate-pulse bg-muted"}),x.jsx("div",{className:"h-px w-full animate-pulse bg-muted"}),x.jsxs("div",{className:"flex gap-10",children:[x.jsx("div",{className:"h-8 w-16 animate-pulse bg-muted"}),x.jsx("div",{className:"h-8 w-40 animate-pulse bg-muted"}),x.jsxs("div",{className:"ml-auto flex gap-8",children:[x.jsx("div",{className:"h-6 w-12 animate-pulse bg-muted"}),x.jsx("div",{className:"h-6 w-12 animate-pulse bg-muted"})]})]})]}),x.jsxs("div",{className:"flex flex-col",children:[x.jsxs("div",{className:"flex justify-between px-4 pb-3",children:[x.jsx("div",{className:"h-2 w-12 animate-pulse bg-muted"}),x.jsx("div",{className:"h-2 w-4 animate-pulse bg-muted"})]}),Array.from({length:6}).map((t,e)=>x.jsxs("div",{className:"border-b border-border",children:[x.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[x.jsx("div",{className:"h-1.5 w-1.5 animate-pulse bg-muted"}),x.jsx("div",{className:"h-3 w-6 animate-pulse bg-muted"}),x.jsx("div",{className:"h-3 w-36 animate-pulse bg-muted"})]}),x.jsx("div",{className:"h-px w-full animate-pulse bg-muted"})]},e))]})]})}function Tfe({message:t,onRetry:e}){return x.jsxs("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-4",children:[x.jsx("p",{className:"font-mono text-sm text-danger",children:t}),x.jsx("button",{type:"button",onClick:e,className:"border border-accent bg-accent/10 px-4 py-2 font-mono text-xs uppercase tracking-widest text-accent transition-colors hover:bg-accent hover:text-foreground",children:"Retry"})]})}function Afe(){const{roadmap:t,state:e,todos:i,loading:n,error:s}=So(),[r,o]=I.useState("discussion"),[l,c]=I.useState(null),[u,d]=I.useState(!1),[p,g]=I.useState(!1),{splitMode:O,toggleSplit:_}=jae(),b=I.useRef(null),S=I.useCallback((G,U)=>{o(G),G==="phase"&&U&&c(U),d(!1)},[]),w=I.useRef(null),T=I.useCallback(G=>{b.current?b.current(G+"\r"):w.current=G,g(!0)},[]);I.useEffect(()=>{const G=setInterval(()=>{w.current&&b.current&&(b.current(w.current+"\r"),w.current=null,clearInterval(G))},100);return()=>clearInterval(G)},[]);const k=I.useCallback(G=>{o("phase"),c(G)},[]),A=I.useCallback(()=>{o("overview"),c(null)},[]),R=I.useCallback(async(G,U)=>{try{const Q=await fetch("/api/roadmap",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({phaseNumber:G,checked:U})});Q.ok||console.error("[toggle-phase]",await Q.text())}catch(Q){console.error("[toggle-phase]",Q)}},[]),E=((t==null?void 0:t.phases)??[]).map(G=>({number:G.number,name:G.name,goal:G.goal??"",dependsOn:G.depends_on?[G.depends_on]:[],planCount:G.plan_count,summaryCount:G.summary_count,diskStatus:G.disk_status,roadmapComplete:G.roadmap_complete,hasContext:G.has_context,hasResearch:G.has_research})),$=(t==null?void 0:t.current_phase)??null;function N(){if(n)return x.jsx(kfe,{});if(s)return x.jsx(Tfe,{message:s,onRetry:()=>window.location.reload()});switch(r){case"overview":return x.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-6",children:[x.jsx(F9,{roadmap:t,state:e,todos:i}),x.jsx(eZ,{phases:E,currentPhase:$,onPhaseClick:k,onToggleComplete:R})]});case"phase":return l?x.jsx("div",{className:"mx-auto max-w-4xl",children:x.jsx(qte,{phaseId:l,onBack:A})}):null;case"todos":return x.jsx("div",{className:"mx-auto max-w-3xl",children:x.jsx(Wte,{})});case"blockers":return x.jsx("div",{className:"mx-auto max-w-3xl",children:x.jsx(Hte,{})});case"discussion":return x.jsx("div",{className:"flex flex-col flex-1 min-h-0",children:x.jsx(wfe,{onExecute:T})});default:return null}}const q=I.useCallback(()=>{g(G=>!G)},[]);return x.jsxs(Fte,{mobileMenuOpen:u,onMobileMenuToggle:()=>d(G=>!G),onMobileMenuClose:()=>d(!1),sidebar:x.jsx(Tie,{activeView:r,activePhaseId:l,onNavigate:S,terminalOpen:p,onTerminalToggle:q}),children:[x.jsx(Cfe,{}),x.jsx("div",{className:p&&O?"h-1/2 min-h-0 overflow-auto p-4 sm:p-6":p?"hidden":"flex-1 overflow-y-auto p-4 sm:p-6",children:N()}),p&&x.jsxs("div",{className:`relative min-h-0 flex flex-col overflow-hidden border-t border-border ${O?"h-1/2":"flex-1"}`,children:[x.jsxs("div",{className:"flex items-center justify-between px-3 py-1 bg-card border-b border-border",children:[x.jsx("span",{className:"text-xs font-mono text-muted-foreground",children:"Terminal"}),x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx(Iae,{splitMode:O,onToggle:_}),x.jsx("button",{type:"button",onClick:q,title:"Close terminal",className:"flex h-6 w-6 items-center justify-center text-muted-foreground hover:text-foreground transition-colors",children:x.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:x.jsx("path",{d:"M2 2l8 8M10 2L2 10",strokeLinecap:"round"})})})]})]}),x.jsx(zae,{writeInputRef:b})]})]})}function Efe(){return x.jsx(Gj,{children:x.jsx(e7,{children:x.jsx(i7,{children:x.jsx(Afe,{})})})})}const wz=document.getElementById("root");if(!wz)throw new Error("Root element not found");Yj.createRoot(wz).render(x.jsx(I.StrictMode,{children:x.jsx(Efe,{})}));
|
|
231
|
+
`),u=c.length>1||t.description.length>120,d=o?t.description:((p=c[0])==null?void 0:p.slice(0,120))??"";return x.jsxs("button",{type:"button",onClick:n,onMouseEnter:s,onMouseLeave:r,onFocus:s,onBlur:r,className:Ne("flex items-start gap-3 border p-3 text-left transition-colors w-full",e?"border-simple-accent bg-simple-accent/10":"border-border bg-card hover:border-muted-foreground/40"),children:[x.jsx("span",{className:"mt-0.5 shrink-0",children:i==="radio"?x.jsx("span",{className:Ne("flex h-4 w-4 items-center justify-center border",e?"border-simple-accent":"border-muted-foreground"),style:{borderRadius:"50%"},children:e&&x.jsx("span",{className:"h-2 w-2 bg-simple-accent",style:{borderRadius:"50%"}})}):x.jsx("span",{className:Ne("flex h-4 w-4 items-center justify-center border",e?"border-simple-accent bg-simple-accent/20":"border-muted-foreground"),children:e&&x.jsx("svg",{className:"h-3 w-3 text-simple-accent",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:x.jsx("path",{d:"M2 6l3 3 5-5",strokeLinecap:"round",strokeLinejoin:"round"})})})}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("p",{className:"text-sm font-medium text-foreground leading-tight",children:t.label}),x.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 leading-snug",children:[d,!o&&u&&"..."]}),u&&x.jsx("span",{role:"button",tabIndex:0,onClick:g=>{g.stopPropagation(),l(O=>!O)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.stopPropagation(),g.preventDefault(),l(O=>!O))},className:"text-[10px] text-simple-accent mt-1 inline-block cursor-pointer hover:underline",children:o?"Show less":"Show more"})]})]})}function gfe({markdown:t,visible:e}){return e?x.jsx("div",{className:"border border-border bg-card p-4 text-xs font-mono text-foreground/80 leading-relaxed overflow-auto max-h-64 lg:absolute lg:right-0 lg:top-0 lg:w-80 lg:translate-x-[calc(100%+0.75rem)] lg:z-10 lg:shadow-lg mt-2 lg:mt-0",children:x.jsx(Sz,{children:t})}):null}function Ofe({question:t,onSubmit:e}){const[i,n]=I.useState(null),[s,r]=I.useState(new Set),[o,l]=I.useState(""),[c,u]=I.useState(null),d=I.useRef(null);I.useEffect(()=>{const T=d.current;T&&(T.style.height="auto",T.style.height=`${T.scrollHeight}px`)},[o]),I.useEffect(()=>{n(null),r(new Set),l(""),u(null)},[t.id]);function p(T){t.multiSelect?r(k=>{const A=new Set(k);return A.has(T)?A.delete(T):A.add(T),A}):n(T)}function g(T){l(T),!t.multiSelect&&T.length>0&&n(null)}function O(T){T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),_())}function _(){if(b)if(t.multiSelect){const T=t.options.filter(k=>s.has(k.id)).map(k=>k.label);e({questionId:t.id,header:t.header,selectedOptionIds:Array.from(s),selectedLabels:T,freeText:o.trim()})}else if(i){const T=t.options.find(k=>k.id===i);e({questionId:t.id,header:t.header,selectedOptionIds:[i],selectedLabels:T?[T.label]:[],freeText:""})}else e({questionId:t.id,header:t.header,selectedOptionIds:[],selectedLabels:[],freeText:o.trim()})}const b=t.multiSelect?s.size>0||o.trim().length>0:i!==null||o.trim().length>0,S=c?t.options.find(T=>T.id===c):null,w=(S==null?void 0:S.markdown)??"";return x.jsxs("div",{className:"border border-border bg-card p-4 relative",children:[x.jsx("span",{className:"inline-block bg-simple-accent/20 border border-simple-accent/40 px-2 py-0.5 text-[10px] font-mono uppercase tracking-wider text-simple-accent mb-2",children:t.header}),x.jsx("div",{className:"text-sm text-foreground leading-relaxed mb-4 prose prose-invert prose-sm max-w-none [&_a]:text-simple-accent [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-xs",children:x.jsx(Sz,{children:t.question})}),t.options.length>0&&x.jsxs("div",{className:"relative",children:[x.jsx("div",{className:"grid gap-2 mb-3",children:t.options.map(T=>{const k=t.multiSelect?s.has(T.id):i===T.id;return x.jsx(mfe,{option:T,selected:k,variant:t.multiSelect?"checkbox":"radio",onSelect:()=>p(T.id),onFocus:()=>u(T.id),onBlur:()=>u(null)},T.id)})}),x.jsx(gfe,{markdown:w,visible:!!w})]}),x.jsx("div",{className:"border border-border bg-muted/10 px-3 py-2 mb-3",children:x.jsx("textarea",{ref:d,value:o,onChange:T=>g(T.target.value),onKeyDown:O,rows:1,className:"w-full resize-none overflow-hidden bg-transparent font-mono text-xs text-foreground outline-none leading-relaxed"})}),x.jsx("button",{type:"button",onClick:_,disabled:!b,className:Ne("flex items-center gap-1.5 border px-3 py-1.5 text-xs font-mono uppercase tracking-widest transition-colors",b?"border-simple-accent bg-simple-accent/10 text-simple-accent hover:bg-simple-accent hover:text-background":"border-border text-muted-foreground cursor-not-allowed"),children:"Submit"})]})}function vfe({answer:t}){const e=t.selectedLabels.length>0?t.selectedLabels.join(", "):t.freeText.slice(0,80)+(t.freeText.length>80?"...":"");return x.jsx(_o.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:x.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/40 text-xs text-muted-foreground",children:[x.jsx("svg",{className:"h-3.5 w-3.5 text-success shrink-0",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:x.jsx("path",{d:"M6.5 12.5l-4-4 1.4-1.4L6.5 9.7l5.6-5.6 1.4 1.4z"})}),x.jsx("span",{className:"font-mono text-simple-accent shrink-0",children:t.header}),x.jsx("span",{className:"text-foreground/70 truncate",children:e})]})})}function _fe(){return x.jsxs("div",{className:"border border-border bg-card p-4 animate-pulse",children:[x.jsx("div",{className:"h-3 w-16 bg-muted mb-3"}),x.jsx("div",{className:"h-4 w-3/4 bg-muted mb-2"}),x.jsx("div",{className:"h-4 w-1/2 bg-muted mb-4"}),x.jsxs("div",{className:"flex gap-2",children:[x.jsx("div",{className:"h-10 flex-1 bg-muted"}),x.jsx("div",{className:"h-10 flex-1 bg-muted"})]}),x.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[x.jsx("svg",{className:"h-3.5 w-3.5 text-simple-accent animate-spin",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:x.jsx("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"28",strokeDashoffset:"8"})}),x.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Loading question..."})]})]})}function yfe({onAskMore:t,onDoneExecute:e,disabled:i}){return x.jsxs("div",{className:"sticky bottom-0 z-10 flex items-center justify-end gap-3 border-t border-border bg-background/95 backdrop-blur px-4 py-3",children:[x.jsx("button",{type:"button",onClick:t,disabled:i,className:"border border-simple-accent/50 px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent/10 disabled:opacity-50",children:"Ask me more"}),x.jsx("button",{type:"button",onClick:e,disabled:i,className:"bg-simple-accent/15 border border-simple-accent px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background disabled:opacity-50",children:"Done, execute"})]})}function bfe({open:t,onConfirm:e,onCancel:i}){return x.jsx(SS,{children:t&&x.jsx(_o.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:i,children:x.jsxs(_o.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"mx-4 w-full max-w-sm border border-border bg-card p-6",onClick:n=>n.stopPropagation(),children:[x.jsx("p",{className:"text-sm text-foreground leading-relaxed mb-6",children:"This will end discussion and start execution. Continue?"}),x.jsxs("div",{className:"flex items-center justify-end gap-3",children:[x.jsx("button",{type:"button",onClick:i,className:"border border-border px-4 py-2 text-xs font-mono uppercase tracking-widest text-muted-foreground transition-colors hover:border-muted-foreground hover:text-foreground",children:"Cancel"}),x.jsx("button",{type:"button",onClick:e,className:"bg-simple-accent/15 border border-simple-accent px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background",children:"Confirm"})]})]})})})}function xfe({answerCount:t}){return x.jsxs(_o.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.25,ease:"easeOut"},className:"border border-border bg-card p-6 text-center",children:[x.jsx("div",{className:"flex justify-center mb-3",children:x.jsxs("svg",{className:"h-8 w-8 text-success",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[x.jsx("circle",{cx:"12",cy:"12",r:"10"}),x.jsx("path",{d:"M8 12l3 3 5-5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),x.jsx("h3",{className:"text-sm font-medium text-foreground mb-1",children:"Discussion Complete"}),x.jsxs("p",{className:"text-xs text-muted-foreground mb-4",children:[t," ",t===1?"question":"questions"," answered"]}),x.jsxs("div",{className:"flex items-center justify-center gap-2",children:[x.jsx("svg",{className:"h-3.5 w-3.5 text-simple-accent animate-spin",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:x.jsx("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"28",strokeDashoffset:"8"})}),x.jsx("span",{className:"text-[10px] font-mono text-muted-foreground uppercase tracking-wider",children:"Execution queued..."})]})]})}function Sfe(){const{phase:t,currentQuestion:e,answeredQuestions:i,answerCount:n,submitAnswer:s,askMore:r,doneExecute:o,receiveQuestions:l}=Ux(),{onQuestionReceivedRef:c}=Rr();I.useEffect(()=>(c.current=S=>{l(S)},()=>{c.current=null}),[l,c]);const[u,d]=I.useState(!1),p=I.useRef(null);I.useEffect(()=>{t==="active"&&p.current&&p.current.scrollIntoView({behavior:"smooth",block:"start"})},[t,e==null?void 0:e.id]);function g(){d(!0)}function O(){d(!1),o()}function _(){d(!1)}const b=t==="submitting"||t==="complete";return x.jsxs("div",{className:"flex flex-col h-full",children:[x.jsx("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:x.jsxs("span",{className:"text-xs font-mono uppercase tracking-wider text-muted-foreground",children:["Discussion (",n,"/?)"]})}),x.jsx("div",{className:"flex-1 overflow-y-auto pb-20",children:x.jsxs("div",{className:"mx-auto max-w-3xl p-4 flex flex-col gap-2",children:[i.map(S=>x.jsx(vfe,{answer:S},S.questionId)),t==="active"&&e&&x.jsx("div",{ref:p,children:x.jsx(Ofe,{question:e,onSubmit:s})}),t==="loading"&&x.jsx(_fe,{}),t==="complete"&&x.jsx(xfe,{answerCount:n})]})}),t!=="complete"&&x.jsx(yfe,{onAskMore:r,onDoneExecute:g,disabled:b}),x.jsx(bfe,{open:u,onConfirm:O,onCancel:_})]})}function HQ(){var i;const{lifecycleEvent:t,pendingQuestionCount:e}=Rr();return!t&&e===0?null:x.jsxs("div",{className:"flex items-center justify-between px-4 py-1.5 bg-muted/50 border-b border-border text-xs font-mono text-muted-foreground",children:[t&&x.jsxs("span",{children:["Phase ",t.phase_number,": ",t.phase_name," — ",(i=t.event_type)==null?void 0:i.replace(/-/g," "),t.step&&t.total_steps?` (Step ${t.step}/${t.total_steps})`:""]}),e>0&&x.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-teal-500/20 text-teal-400 text-[10px] font-semibold",children:[e," pending"]})]})}function wfe({onExecute:t}){const{phase:e,startDiscussion:i,resetDiscussion:n}=Ux(),{pendingQuestionCount:s}=Rr(),r=e!=="idle";function o(l){if(l.startsWith("/maxsim:discuss-phase")){i();return}t(l)}return r?x.jsxs("div",{className:"flex flex-col gap-0 h-full",children:[x.jsx(HQ,{}),x.jsxs("div",{className:"px-4 pt-3 sm:px-6 flex items-center gap-2",children:[x.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 text-xs font-mono text-muted-foreground hover:text-foreground transition-colors",children:[x.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:x.jsx("path",{d:"M8 1L3 6l5 5",strokeLinecap:"round",strokeLinejoin:"round"})}),"Back to actions"]}),s>0&&x.jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-teal-500/20 text-teal-400 text-[10px] font-semibold",children:s})]}),x.jsx("div",{className:"flex-1 min-h-0",children:x.jsx(Sfe,{})})]}):x.jsxs("div",{className:"flex flex-col gap-0 h-full",children:[x.jsx(HQ,{}),x.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:x.jsxs("div",{className:"mx-auto max-w-3xl flex flex-col gap-4",children:[x.jsx(Wae,{}),x.jsx(Vae,{}),x.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[x.jsx(Uae,{}),x.jsx(Hae,{})]}),x.jsx(qae,{onExecute:o})]})})]})}function Cfe(){const{connected:t}=Rr(),[e,i]=I.useState(!0),[n,s]=I.useState(!1),[r,o]=I.useState(!1);I.useEffect(()=>{if(t){o(!1),i(!0);return}const c=setTimeout(()=>o(!0),3e3);return()=>clearTimeout(c)},[t]);const l=I.useCallback(async()=>{s(!0);try{const c=await fetch("/api/health",{signal:AbortSignal.timeout(5e3)});i(c.ok),c.ok&&window.location.reload()}catch{i(!1)}finally{s(!1)}},[]);return r?x.jsxs("div",{className:"shrink-0 flex items-center justify-between gap-3 border-b border-danger/30 bg-danger/5 px-4 py-2",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-danger animate-pulse"}),x.jsx("span",{className:"font-mono text-xs text-danger",children:e?"WebSocket disconnected. Reconnecting...":"Dashboard server unreachable"})]}),x.jsx("button",{type:"button",disabled:n,onClick:l,className:"shrink-0 border border-danger/40 px-3 py-1 font-mono text-[10px] uppercase tracking-widest text-danger transition-colors hover:bg-danger/10 disabled:opacity-50",children:n?"Checking...":"Retry"})]}):null}function kfe(){return x.jsxs("div",{className:"flex flex-col gap-6",children:[x.jsxs("div",{className:"flex flex-col gap-4 border-b border-border pb-6",children:[x.jsx("div",{className:"h-2 w-32 animate-pulse bg-muted"}),x.jsx("div",{className:"h-px w-full animate-pulse bg-muted"}),x.jsxs("div",{className:"flex gap-10",children:[x.jsx("div",{className:"h-8 w-16 animate-pulse bg-muted"}),x.jsx("div",{className:"h-8 w-40 animate-pulse bg-muted"}),x.jsxs("div",{className:"ml-auto flex gap-8",children:[x.jsx("div",{className:"h-6 w-12 animate-pulse bg-muted"}),x.jsx("div",{className:"h-6 w-12 animate-pulse bg-muted"})]})]})]}),x.jsxs("div",{className:"flex flex-col",children:[x.jsxs("div",{className:"flex justify-between px-4 pb-3",children:[x.jsx("div",{className:"h-2 w-12 animate-pulse bg-muted"}),x.jsx("div",{className:"h-2 w-4 animate-pulse bg-muted"})]}),Array.from({length:6}).map((t,e)=>x.jsxs("div",{className:"border-b border-border",children:[x.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[x.jsx("div",{className:"h-1.5 w-1.5 animate-pulse bg-muted"}),x.jsx("div",{className:"h-3 w-6 animate-pulse bg-muted"}),x.jsx("div",{className:"h-3 w-36 animate-pulse bg-muted"})]}),x.jsx("div",{className:"h-px w-full animate-pulse bg-muted"})]},e))]})]})}function Tfe({message:t,onRetry:e}){return x.jsxs("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-4",children:[x.jsx("p",{className:"font-mono text-sm text-danger",children:t}),x.jsx("button",{type:"button",onClick:e,className:"border border-accent bg-accent/10 px-4 py-2 font-mono text-xs uppercase tracking-widest text-accent transition-colors hover:bg-accent hover:text-foreground",children:"Retry"})]})}function Afe(){const{roadmap:t,state:e,todos:i,loading:n,error:s}=So(),[r,o]=I.useState("discussion"),[l,c]=I.useState(null),[u,d]=I.useState(!1),[p,g]=I.useState(!1),{splitMode:O,toggleSplit:_}=jae(),b=I.useRef(null),S=I.useCallback((G,U)=>{o(G),G==="phase"&&U&&c(U),d(!1)},[]),w=I.useRef(null),T=I.useCallback(G=>{b.current?b.current(G+`\r
|
|
232
|
+
`):w.current=G,g(!0)},[]);I.useEffect(()=>{const G=setInterval(()=>{w.current&&b.current&&(b.current(w.current+`\r
|
|
233
|
+
`),w.current=null,clearInterval(G))},100);return()=>clearInterval(G)},[]);const k=I.useCallback(G=>{o("phase"),c(G)},[]),A=I.useCallback(()=>{o("overview"),c(null)},[]),R=I.useCallback(async(G,U)=>{try{const Q=await fetch("/api/roadmap",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({phaseNumber:G,checked:U})});Q.ok||console.error("[toggle-phase]",await Q.text())}catch(Q){console.error("[toggle-phase]",Q)}},[]),E=((t==null?void 0:t.phases)??[]).map(G=>({number:G.number,name:G.name,goal:G.goal??"",dependsOn:G.depends_on?[G.depends_on]:[],planCount:G.plan_count,summaryCount:G.summary_count,diskStatus:G.disk_status,roadmapComplete:G.roadmap_complete,hasContext:G.has_context,hasResearch:G.has_research})),$=(t==null?void 0:t.current_phase)??null;function N(){if(n)return x.jsx(kfe,{});if(s)return x.jsx(Tfe,{message:s,onRetry:()=>window.location.reload()});switch(r){case"overview":return x.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-6",children:[x.jsx(F9,{roadmap:t,state:e,todos:i}),x.jsx(eZ,{phases:E,currentPhase:$,onPhaseClick:k,onToggleComplete:R})]});case"phase":return l?x.jsx("div",{className:"mx-auto max-w-4xl",children:x.jsx(qte,{phaseId:l,onBack:A})}):null;case"todos":return x.jsx("div",{className:"mx-auto max-w-3xl",children:x.jsx(Wte,{})});case"blockers":return x.jsx("div",{className:"mx-auto max-w-3xl",children:x.jsx(Hte,{})});case"discussion":return x.jsx("div",{className:"flex flex-col flex-1 min-h-0",children:x.jsx(wfe,{onExecute:T})});default:return null}}const q=I.useCallback(()=>{g(G=>!G)},[]);return x.jsxs(Fte,{mobileMenuOpen:u,onMobileMenuToggle:()=>d(G=>!G),onMobileMenuClose:()=>d(!1),sidebar:x.jsx(Tie,{activeView:r,activePhaseId:l,onNavigate:S,terminalOpen:p,onTerminalToggle:q}),children:[x.jsx(Cfe,{}),x.jsx("div",{className:p&&O?"h-1/2 min-h-0 overflow-auto p-4 sm:p-6":p?"hidden":"flex-1 overflow-y-auto p-4 sm:p-6",children:N()}),p&&x.jsxs("div",{className:`relative min-h-0 flex flex-col overflow-hidden border-t border-border ${O?"h-1/2":"flex-1"}`,children:[x.jsxs("div",{className:"flex items-center justify-between px-3 py-1 bg-card border-b border-border",children:[x.jsx("span",{className:"text-xs font-mono text-muted-foreground",children:"Terminal"}),x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx(Iae,{splitMode:O,onToggle:_}),x.jsx("button",{type:"button",onClick:q,title:"Close terminal",className:"flex h-6 w-6 items-center justify-center text-muted-foreground hover:text-foreground transition-colors",children:x.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:x.jsx("path",{d:"M2 2l8 8M10 2L2 10",strokeLinecap:"round"})})})]})]}),x.jsx(zae,{writeInputRef:b})]})]})}function Efe(){return x.jsx(Gj,{children:x.jsx(e7,{children:x.jsx(i7,{children:x.jsx(Afe,{})})})})}const wz=document.getElementById("root");if(!wz)throw new Error("Root element not found");Yj.createRoot(wz).render(x.jsx(I.StrictMode,{children:x.jsx(Efe,{})}));
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800;900&family=Geist+Mono:wght@400;500;600;700&display=swap"
|
|
11
11
|
rel="stylesheet"
|
|
12
12
|
/>
|
|
13
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/assets/index-nAXJLp0_.js"></script>
|
|
14
14
|
<link rel="stylesheet" crossorigin href="/assets/index-C199D4Eb.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
package/package.json
CHANGED