maestro-flow 0.5.2 → 0.5.3
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/.agents/skills/insight-challenge/SKILL.md +228 -0
- package/.agents/skills/insight-challenge/specs/challenge-protocol.md +154 -0
- package/.agents/skills/insight-challenge/specs/verdict-schema.md +239 -0
- package/.agents/skills/maestro/SKILL.md +6 -6
- package/.agents/skills/maestro-help/SKILL.md +1 -1
- package/.agents/skills/maestro-help/index/catalog.json +3 -2
- package/.agents/skills/maestro-ralph/SKILL.md +11 -10
- package/.agents/skills/maestro-ralph-beta/SKILL.md +11 -10
- package/.agents/skills/odyssey-debug/SKILL.md +475 -0
- package/.agents/skills/odyssey-improve/SKILL.md +507 -0
- package/.agents/skills/odyssey-planex/SKILL.md +603 -0
- package/.agents/skills/odyssey-review-test-fix/SKILL.md +429 -0
- package/.agents/skills/odyssey-ui/SKILL.md +464 -0
- package/.agy/skills/insight-challenge/SKILL.md +230 -0
- package/.agy/skills/insight-challenge/specs/challenge-protocol.md +154 -0
- package/.agy/skills/insight-challenge/specs/verdict-schema.md +239 -0
- package/.agy/skills/maestro/SKILL.md +6 -6
- package/.agy/skills/maestro-help/SKILL.md +1 -1
- package/.agy/skills/maestro-help/index/catalog.json +3 -2
- package/.agy/skills/maestro-ralph/SKILL.md +11 -10
- package/.agy/skills/maestro-ralph-beta/SKILL.md +11 -10
- package/.agy/skills/odyssey-debug/SKILL.md +475 -0
- package/.agy/skills/odyssey-improve/SKILL.md +507 -0
- package/.agy/skills/odyssey-planex/SKILL.md +603 -0
- package/.agy/skills/odyssey-review-test-fix/SKILL.md +429 -0
- package/.agy/skills/odyssey-ui/SKILL.md +464 -0
- package/.claude/commands/maestro-ralph-beta.md +11 -10
- package/.claude/commands/maestro-ralph.md +11 -10
- package/.claude/commands/maestro.md +6 -6
- package/.claude/commands/odyssey-debug.md +473 -0
- package/.claude/commands/odyssey-improve.md +505 -0
- package/.claude/commands/odyssey-planex.md +601 -0
- package/.claude/commands/odyssey-review-test-fix.md +427 -0
- package/.claude/commands/odyssey-ui.md +462 -0
- package/.claude/skills/insight-challenge/SKILL.md +226 -0
- package/.claude/skills/insight-challenge/specs/challenge-protocol.md +154 -0
- package/.claude/skills/insight-challenge/specs/verdict-schema.md +239 -0
- package/.claude/skills/maestro-help/SKILL.md +1 -1
- package/.claude/skills/maestro-help/index/catalog.json +3 -2
- package/.codex/skills/codify-to-knowhow/SKILL.md +1 -1
- package/.codex/skills/maestro-companion/SKILL.md +1 -1
- package/.codex/skills/maestro-help/SKILL.md +1 -1
- package/.codex/skills/maestro-impeccable/SKILL.md +1 -1
- package/.codex/skills/maestro-next/SKILL.md +1 -1
- package/.codex/skills/maestro-ralph-beta/SKILL.md +1 -1
- package/.codex/skills/odyssey-debug/SKILL.md +456 -0
- package/.codex/skills/odyssey-improve/SKILL.md +466 -0
- package/.codex/skills/odyssey-planex/SKILL.md +409 -0
- package/.codex/skills/odyssey-review-test-fix/SKILL.md +377 -0
- package/.codex/skills/odyssey-ui/SKILL.md +411 -0
- package/dashboard/dist/assets/{ArtifactsPage-BLvAqQlQ.js → ArtifactsPage-B6z23DfG.js} +2 -2
- package/dashboard/dist/assets/{ChatInput-DU9YGZKX.js → ChatInput-tBtGKV2i.js} +1 -1
- package/dashboard/dist/assets/{ChatPage-DYHfheXC.js → ChatPage-CcggDVs4.js} +2 -2
- package/dashboard/dist/assets/{CollabPage-CSlmvEa-.js → CollabPage-FaZeqqeS.js} +1 -1
- package/dashboard/dist/assets/{ExecutionPanel-RYWf0dYC.js → ExecutionPanel-DNRwYDXp.js} +1 -1
- package/dashboard/dist/assets/{KanbanPage-N55Iv0-X.js → KanbanPage-B2xh2s_N.js} +1 -1
- package/dashboard/dist/assets/{MaestroCoordinatePage-BxwZ6yy5.js → MaestroCoordinatePage-DCMGHDAL.js} +1 -1
- package/dashboard/dist/assets/{MarkdownRenderer-ZGtOY7Ti.js → MarkdownRenderer-C3FvTqVe.js} +1 -1
- package/dashboard/dist/assets/McpPage-HKaJ8cQP.js +16 -0
- package/dashboard/dist/assets/{MeetingRoomPage-CxHRn1xx.js → MeetingRoomPage-DGN5oUXH.js} +1 -1
- package/dashboard/dist/assets/{OutputPanel-DaL8c1i5.js → OutputPanel-BiCteH5k.js} +1 -1
- package/dashboard/dist/assets/{ProblemsPanel-BQTd5812.js → ProblemsPanel-Dk4v9tol.js} +1 -1
- package/dashboard/dist/assets/{RequirementBoardPage-22y9u1qh.js → RequirementBoardPage-D10A26gi.js} +1 -1
- package/dashboard/dist/assets/{RequirementPage-_mO743Xm.js → RequirementPage-Cs-2omLz.js} +1 -1
- package/dashboard/dist/assets/{RoomsPage-CExTbOGr.js → RoomsPage-tKQQhw1W.js} +1 -1
- package/dashboard/dist/assets/SpecsPage-LK1QCtcg.js +36 -0
- package/dashboard/dist/assets/{TeamsPage-BxEXLb5g.js → TeamsPage-C-bEwB8E.js} +1 -1
- package/dashboard/dist/assets/{TreeBrowser-CVtPF5C9.js → TreeBrowser-1YP-DfTY.js} +2 -2
- package/dashboard/dist/assets/{WorkflowPage-BoN18Lhs.js → WorkflowPage-dGHPsDDr.js} +2 -2
- package/dashboard/dist/assets/{arrow-left-C5ROg97G.js → arrow-left-BPFSEpfO.js} +1 -1
- package/dashboard/dist/assets/{check-Bs8PM0tQ.js → check-D5hOViiQ.js} +1 -1
- package/dashboard/dist/assets/{chevron-right-SmErd_1F.js → chevron-right-D9BsXrIg.js} +1 -1
- package/dashboard/dist/assets/{circle-CjpslL_D.js → circle-Cn5fNpmp.js} +1 -1
- package/dashboard/dist/assets/{circle-alert-CuzAg2fd.js → circle-alert-CZvK3B1K.js} +1 -1
- package/dashboard/dist/assets/{circle-check-BIkDU5D5.js → circle-check-DApOBP0J.js} +1 -1
- package/dashboard/dist/assets/{circle-check-big-CYctV8bK.js → circle-check-big-Cd9ztJpl.js} +1 -1
- package/dashboard/dist/assets/{code-DoB7rfxt.js → code-C3TuHjMs.js} +1 -1
- package/dashboard/dist/assets/{columns-3-Ch5KIyRa.js → columns-3-CO2SvNJb.js} +1 -1
- package/dashboard/dist/assets/{download-DadtG2Nr.js → download-BuKGI7KX.js} +1 -1
- package/dashboard/dist/assets/{en-2h6fD0j8.js → en-BmpYsIfb.js} +1 -1
- package/dashboard/dist/assets/folder-Chwj_P4A.js +11 -0
- package/dashboard/dist/assets/folder-open-S72FbKvn.js +6 -0
- package/dashboard/dist/assets/{index-BL4h1OKY.js → index-CN0YdC9M.js} +1 -1
- package/dashboard/dist/assets/{index-DQIlX2w_.js → index-Cbs79erW.js} +5 -5
- package/dashboard/dist/assets/{index-DaFwSmVJ.js → index-CdT1WNND.js} +1 -1
- package/dashboard/dist/assets/index-DEvP8cgc.css +1 -0
- package/dashboard/dist/assets/{list-CI-XIPZh.js → list-Dg_ojUpi.js} +1 -1
- package/dashboard/dist/assets/{loader-DpdMoQvh.js → loader-CMcc73C_.js} +1 -1
- package/dashboard/dist/assets/{minus-BVbfXGrC.js → minus-KxmVOIB7.js} +1 -1
- package/dashboard/dist/assets/pen-line-D1YTNDPw.js +11 -0
- package/dashboard/dist/assets/{pencil-I7GE0y29.js → pencil-BAjxSHuh.js} +1 -1
- package/dashboard/dist/assets/{proxy-CcYyZZWI.js → proxy-BewnIei6.js} +1 -1
- package/dashboard/dist/assets/{refresh-cw-BG9V_T4R.js → refresh-cw-Chc0RcRY.js} +1 -1
- package/dashboard/dist/assets/{rows-2-DP6NjQFk.js → rows-2-DWJuw8OM.js} +1 -1
- package/dashboard/dist/assets/{search-b78eLlw2.js → search-CPGb2sEw.js} +1 -1
- package/dashboard/dist/assets/{shallow-CJEesgtu.js → shallow-Dy0-7n5s.js} +1 -1
- package/dashboard/dist/assets/{table-B_lk-a1d.js → table-VI5scWpO.js} +1 -1
- package/dashboard/dist/assets/{team-types-Se7f9LfJ.js → team-types-Cu8zCPN3.js} +1 -1
- package/dashboard/dist/assets/{terminal-DXx4tvzq.js → terminal-Bqt5c6Ny.js} +1 -1
- package/dashboard/dist/assets/{trash-2-CVh9mnRj.js → trash-2-BcTVifbw.js} +1 -1
- package/dashboard/dist/assets/{users-Da9zGME5.js → users-BhFAHz4H.js} +1 -1
- package/dashboard/dist/assets/{zap-C0zaC7gJ.js → zap-BWbLhgr6.js} +1 -1
- package/dashboard/dist/assets/{zh-CN-r3AvxxOL.js → zh-CN-BIRiTdAD.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist-server/dashboard/src/server/routes/wiki.js +1 -0
- package/dashboard/dist-server/dashboard/src/server/routes/wiki.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/search.d.ts +14 -14
- package/dashboard/dist-server/dashboard/src/server/wiki/search.js +188 -56
- package/dashboard/dist-server/dashboard/src/server/wiki/search.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js +1 -0
- package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.d.ts +37 -0
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +560 -22
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-types.d.ts +6 -2
- package/dashboard/dist-server/src/types/index.d.ts +9 -0
- package/dist/src/cli.js +3 -0
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/delegate.d.ts.map +1 -1
- package/dist/src/commands/delegate.js +50 -8
- package/dist/src/commands/delegate.js.map +1 -1
- package/dist/src/commands/domain.d.ts +9 -0
- package/dist/src/commands/domain.d.ts.map +1 -0
- package/dist/src/commands/domain.js +445 -0
- package/dist/src/commands/domain.js.map +1 -0
- package/dist/src/commands/hooks.d.ts +10 -0
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +132 -22
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/install.d.ts.map +1 -1
- package/dist/src/commands/install.js +82 -204
- package/dist/src/commands/install.js.map +1 -1
- package/dist/src/commands/kg.d.ts.map +1 -1
- package/dist/src/commands/kg.js +183 -90
- package/dist/src/commands/kg.js.map +1 -1
- package/dist/src/commands/search.d.ts +15 -8
- package/dist/src/commands/search.d.ts.map +1 -1
- package/dist/src/commands/search.js +205 -59
- package/dist/src/commands/search.js.map +1 -1
- package/dist/src/commands/spec.d.ts.map +1 -1
- package/dist/src/commands/spec.js +9 -1
- package/dist/src/commands/spec.js.map +1 -1
- package/dist/src/commands/update.d.ts.map +1 -1
- package/dist/src/commands/update.js +0 -7
- package/dist/src/commands/update.js.map +1 -1
- package/dist/src/commands/wiki.d.ts.map +1 -1
- package/dist/src/commands/wiki.js +8 -1
- package/dist/src/commands/wiki.js.map +1 -1
- package/dist/src/commands/workspace.d.ts +12 -0
- package/dist/src/commands/workspace.d.ts.map +1 -0
- package/dist/src/commands/workspace.js +230 -0
- package/dist/src/commands/workspace.js.map +1 -0
- package/dist/src/config/cli-tools-config.d.ts +5 -0
- package/dist/src/config/cli-tools-config.d.ts.map +1 -1
- package/dist/src/config/cli-tools-config.js +31 -0
- package/dist/src/config/cli-tools-config.js.map +1 -1
- package/dist/src/config/index.d.ts +9 -1
- package/dist/src/config/index.d.ts.map +1 -1
- package/dist/src/config/index.js +35 -1
- package/dist/src/config/index.js.map +1 -1
- package/dist/src/core/install-executor.d.ts +31 -0
- package/dist/src/core/install-executor.d.ts.map +1 -0
- package/dist/src/core/install-executor.js +231 -0
- package/dist/src/core/install-executor.js.map +1 -0
- package/dist/src/core/install-profile.d.ts +103 -0
- package/dist/src/core/install-profile.d.ts.map +1 -0
- package/dist/src/core/install-profile.js +225 -0
- package/dist/src/core/install-profile.js.map +1 -0
- package/dist/src/graph/kg/credibility.d.ts +37 -0
- package/dist/src/graph/kg/credibility.d.ts.map +1 -0
- package/dist/src/graph/kg/credibility.js +141 -0
- package/dist/src/graph/kg/credibility.js.map +1 -0
- package/dist/src/graph/kg/db/connection.d.ts +28 -0
- package/dist/src/graph/kg/db/connection.d.ts.map +1 -0
- package/dist/src/graph/kg/db/connection.js +142 -0
- package/dist/src/graph/kg/db/connection.js.map +1 -0
- package/dist/src/graph/kg/db/index.d.ts +5 -0
- package/dist/src/graph/kg/db/index.d.ts.map +1 -0
- package/dist/src/graph/kg/db/index.js +6 -0
- package/dist/src/graph/kg/db/index.js.map +1 -0
- package/dist/src/graph/kg/db/migrations.d.ts +8 -0
- package/dist/src/graph/kg/db/migrations.d.ts.map +1 -0
- package/dist/src/graph/kg/db/migrations.js +88 -0
- package/dist/src/graph/kg/db/migrations.js.map +1 -0
- package/dist/src/graph/kg/db/queries.d.ts +84 -0
- package/dist/src/graph/kg/db/queries.d.ts.map +1 -0
- package/dist/src/graph/kg/db/queries.js +471 -0
- package/dist/src/graph/kg/db/queries.js.map +1 -0
- package/dist/src/graph/kg/db/types.d.ts +123 -0
- package/dist/src/graph/kg/db/types.d.ts.map +1 -0
- package/dist/src/graph/kg/db/types.js +75 -0
- package/dist/src/graph/kg/db/types.js.map +1 -0
- package/dist/src/graph/kg/engine.d.ts +87 -0
- package/dist/src/graph/kg/engine.d.ts.map +1 -0
- package/dist/src/graph/kg/engine.js +247 -0
- package/dist/src/graph/kg/engine.js.map +1 -0
- package/dist/src/graph/kg/extraction/code/code-extractor.d.ts +40 -0
- package/dist/src/graph/kg/extraction/code/code-extractor.d.ts.map +1 -0
- package/dist/src/graph/kg/extraction/code/code-extractor.js +296 -0
- package/dist/src/graph/kg/extraction/code/code-extractor.js.map +1 -0
- package/dist/src/graph/kg/extraction/code/dfm-extractor.d.ts +3 -0
- package/dist/src/graph/kg/extraction/code/dfm-extractor.d.ts.map +1 -0
- package/dist/src/graph/kg/extraction/code/dfm-extractor.js +122 -0
- package/dist/src/graph/kg/extraction/code/dfm-extractor.js.map +1 -0
- package/dist/src/graph/kg/extraction/code/generated-detection.d.ts +14 -0
- package/dist/src/graph/kg/extraction/code/generated-detection.d.ts.map +1 -0
- package/dist/src/graph/kg/extraction/code/generated-detection.js +65 -0
- package/dist/src/graph/kg/extraction/code/generated-detection.js.map +1 -0
- package/dist/src/graph/kg/extraction/code/languages/index.d.ts +9 -0
- package/dist/src/graph/kg/extraction/code/languages/index.d.ts.map +1 -0
- package/dist/src/graph/kg/extraction/code/languages/index.js +2119 -0
- package/dist/src/graph/kg/extraction/code/languages/index.js.map +1 -0
- package/dist/src/graph/kg/extraction/code/languages/typescript.d.ts +5 -0
- package/dist/src/graph/kg/extraction/code/languages/typescript.d.ts.map +1 -0
- package/dist/src/graph/kg/extraction/code/languages/typescript.js +191 -0
- package/dist/src/graph/kg/extraction/code/languages/typescript.js.map +1 -0
- package/dist/src/graph/kg/extraction/code/liquid-extractor.d.ts +3 -0
- package/dist/src/graph/kg/extraction/code/liquid-extractor.d.ts.map +1 -0
- package/dist/src/graph/kg/extraction/code/liquid-extractor.js +117 -0
- package/dist/src/graph/kg/extraction/code/liquid-extractor.js.map +1 -0
- package/dist/src/graph/kg/extraction/code/mybatis-extractor.d.ts +3 -0
- package/dist/src/graph/kg/extraction/code/mybatis-extractor.d.ts.map +1 -0
- package/dist/src/graph/kg/extraction/code/mybatis-extractor.js +84 -0
- package/dist/src/graph/kg/extraction/code/mybatis-extractor.js.map +1 -0
- package/dist/src/graph/kg/extraction/code/svelte-extractor.d.ts +3 -0
- package/dist/src/graph/kg/extraction/code/svelte-extractor.d.ts.map +1 -0
- package/dist/src/graph/kg/extraction/code/svelte-extractor.js +92 -0
- package/dist/src/graph/kg/extraction/code/svelte-extractor.js.map +1 -0
- package/dist/src/graph/kg/extraction/code/tree-sitter-types.d.ts +61 -0
- package/dist/src/graph/kg/extraction/code/tree-sitter-types.d.ts.map +1 -0
- package/dist/src/graph/kg/extraction/code/tree-sitter-types.js +53 -0
- package/dist/src/graph/kg/extraction/code/tree-sitter-types.js.map +1 -0
- package/dist/src/graph/kg/extraction/code/tree-sitter.d.ts +55 -0
- package/dist/src/graph/kg/extraction/code/tree-sitter.d.ts.map +1 -0
- package/dist/src/graph/kg/extraction/code/tree-sitter.js +227 -0
- package/dist/src/graph/kg/extraction/code/tree-sitter.js.map +1 -0
- package/dist/src/graph/kg/extraction/code/vue-extractor.d.ts +6 -0
- package/dist/src/graph/kg/extraction/code/vue-extractor.d.ts.map +1 -0
- package/dist/src/graph/kg/extraction/code/vue-extractor.js +109 -0
- package/dist/src/graph/kg/extraction/code/vue-extractor.js.map +1 -0
- package/dist/src/graph/kg/extraction/code/wasm-stability.d.ts +44 -0
- package/dist/src/graph/kg/extraction/code/wasm-stability.d.ts.map +1 -0
- package/dist/src/graph/kg/extraction/code/wasm-stability.js +140 -0
- package/dist/src/graph/kg/extraction/code/wasm-stability.js.map +1 -0
- package/dist/src/graph/kg/extraction/knowledge/codebase-extractor.d.ts +3 -0
- package/dist/src/graph/kg/extraction/knowledge/codebase-extractor.d.ts.map +1 -0
- package/dist/src/graph/kg/extraction/knowledge/codebase-extractor.js +149 -0
- package/dist/src/graph/kg/extraction/knowledge/codebase-extractor.js.map +1 -0
- package/dist/src/graph/kg/extraction/knowledge/domain-extractor.d.ts +4 -0
- package/dist/src/graph/kg/extraction/knowledge/domain-extractor.d.ts.map +1 -0
- package/dist/src/graph/kg/extraction/knowledge/domain-extractor.js +114 -0
- package/dist/src/graph/kg/extraction/knowledge/domain-extractor.js.map +1 -0
- package/dist/src/graph/kg/extraction/knowledge/issue-extractor.d.ts +3 -0
- package/dist/src/graph/kg/extraction/knowledge/issue-extractor.d.ts.map +1 -0
- package/dist/src/graph/kg/extraction/knowledge/issue-extractor.js +84 -0
- package/dist/src/graph/kg/extraction/knowledge/issue-extractor.js.map +1 -0
- package/dist/src/graph/kg/extraction/knowledge/spec-extractor.d.ts +3 -0
- package/dist/src/graph/kg/extraction/knowledge/spec-extractor.d.ts.map +1 -0
- package/dist/src/graph/kg/extraction/knowledge/spec-extractor.js +173 -0
- package/dist/src/graph/kg/extraction/knowledge/spec-extractor.js.map +1 -0
- package/dist/src/graph/kg/extraction/knowledge/wiki-extractor.d.ts +3 -0
- package/dist/src/graph/kg/extraction/knowledge/wiki-extractor.d.ts.map +1 -0
- package/dist/src/graph/kg/extraction/knowledge/wiki-extractor.js +165 -0
- package/dist/src/graph/kg/extraction/knowledge/wiki-extractor.js.map +1 -0
- package/dist/src/graph/kg/extraction/orchestrator.d.ts +6 -0
- package/dist/src/graph/kg/extraction/orchestrator.d.ts.map +1 -0
- package/dist/src/graph/kg/extraction/orchestrator.js +208 -0
- package/dist/src/graph/kg/extraction/orchestrator.js.map +1 -0
- package/dist/src/graph/kg/index.d.ts +29 -0
- package/dist/src/graph/kg/index.d.ts.map +1 -0
- package/dist/src/graph/kg/index.js +35 -0
- package/dist/src/graph/kg/index.js.map +1 -0
- package/dist/src/graph/kg/query/context-builder.d.ts +38 -0
- package/dist/src/graph/kg/query/context-builder.d.ts.map +1 -0
- package/dist/src/graph/kg/query/context-builder.js +184 -0
- package/dist/src/graph/kg/query/context-builder.js.map +1 -0
- package/dist/src/graph/kg/query/index.d.ts +8 -0
- package/dist/src/graph/kg/query/index.d.ts.map +1 -0
- package/dist/src/graph/kg/query/index.js +6 -0
- package/dist/src/graph/kg/query/index.js.map +1 -0
- package/dist/src/graph/kg/query/scoring.d.ts +19 -0
- package/dist/src/graph/kg/query/scoring.d.ts.map +1 -0
- package/dist/src/graph/kg/query/scoring.js +158 -0
- package/dist/src/graph/kg/query/scoring.js.map +1 -0
- package/dist/src/graph/kg/query/search.d.ts +59 -0
- package/dist/src/graph/kg/query/search.d.ts.map +1 -0
- package/dist/src/graph/kg/query/search.js +158 -0
- package/dist/src/graph/kg/query/search.js.map +1 -0
- package/dist/src/graph/kg/query/traversal.d.ts +75 -0
- package/dist/src/graph/kg/query/traversal.d.ts.map +1 -0
- package/dist/src/graph/kg/query/traversal.js +420 -0
- package/dist/src/graph/kg/query/traversal.js.map +1 -0
- package/dist/src/graph/kg/resolution/callback-synthesizer.d.ts +41 -0
- package/dist/src/graph/kg/resolution/callback-synthesizer.d.ts.map +1 -0
- package/dist/src/graph/kg/resolution/callback-synthesizer.js +450 -0
- package/dist/src/graph/kg/resolution/callback-synthesizer.js.map +1 -0
- package/dist/src/graph/kg/resolution/frameworks/index.d.ts +18 -0
- package/dist/src/graph/kg/resolution/frameworks/index.d.ts.map +1 -0
- package/dist/src/graph/kg/resolution/frameworks/index.js +632 -0
- package/dist/src/graph/kg/resolution/frameworks/index.js.map +1 -0
- package/dist/src/graph/kg/resolution/import-resolver.d.ts +73 -0
- package/dist/src/graph/kg/resolution/import-resolver.d.ts.map +1 -0
- package/dist/src/graph/kg/resolution/import-resolver.js +257 -0
- package/dist/src/graph/kg/resolution/import-resolver.js.map +1 -0
- package/dist/src/graph/kg/resolution/index.d.ts +11 -0
- package/dist/src/graph/kg/resolution/index.d.ts.map +1 -0
- package/dist/src/graph/kg/resolution/index.js +7 -0
- package/dist/src/graph/kg/resolution/index.js.map +1 -0
- package/dist/src/graph/kg/resolution/knowledge-resolver.d.ts +22 -0
- package/dist/src/graph/kg/resolution/knowledge-resolver.d.ts.map +1 -0
- package/dist/src/graph/kg/resolution/knowledge-resolver.js +288 -0
- package/dist/src/graph/kg/resolution/knowledge-resolver.js.map +1 -0
- package/dist/src/graph/kg/resolution/name-matcher.d.ts +25 -0
- package/dist/src/graph/kg/resolution/name-matcher.d.ts.map +1 -0
- package/dist/src/graph/kg/resolution/name-matcher.js +162 -0
- package/dist/src/graph/kg/resolution/name-matcher.js.map +1 -0
- package/dist/src/graph/kg/schema.sql +210 -0
- package/dist/src/graph/kg/surface/cli.d.ts +3 -0
- package/dist/src/graph/kg/surface/cli.d.ts.map +1 -0
- package/dist/src/graph/kg/surface/cli.js +500 -0
- package/dist/src/graph/kg/surface/cli.js.map +1 -0
- package/dist/src/graph/kg/surface/hook-injector.d.ts +33 -0
- package/dist/src/graph/kg/surface/hook-injector.d.ts.map +1 -0
- package/dist/src/graph/kg/surface/hook-injector.js +172 -0
- package/dist/src/graph/kg/surface/hook-injector.js.map +1 -0
- package/dist/src/graph/kg/surface/index.d.ts +6 -0
- package/dist/src/graph/kg/surface/index.d.ts.map +1 -0
- package/dist/src/graph/kg/surface/index.js +5 -0
- package/dist/src/graph/kg/surface/index.js.map +1 -0
- package/dist/src/graph/kg/surface/mcp-tools.d.ts +20 -0
- package/dist/src/graph/kg/surface/mcp-tools.d.ts.map +1 -0
- package/dist/src/graph/kg/surface/mcp-tools.js +253 -0
- package/dist/src/graph/kg/surface/mcp-tools.js.map +1 -0
- package/dist/src/graph/kg/sync/incremental-sync.d.ts +24 -0
- package/dist/src/graph/kg/sync/incremental-sync.d.ts.map +1 -0
- package/dist/src/graph/kg/sync/incremental-sync.js +71 -0
- package/dist/src/graph/kg/sync/incremental-sync.js.map +1 -0
- package/dist/src/graph/kg/sync/index.d.ts +5 -0
- package/dist/src/graph/kg/sync/index.d.ts.map +1 -0
- package/dist/src/graph/kg/sync/index.js +4 -0
- package/dist/src/graph/kg/sync/index.js.map +1 -0
- package/dist/src/graph/kg/sync/watch-policy.d.ts +33 -0
- package/dist/src/graph/kg/sync/watch-policy.d.ts.map +1 -0
- package/dist/src/graph/kg/sync/watch-policy.js +90 -0
- package/dist/src/graph/kg/sync/watch-policy.js.map +1 -0
- package/dist/src/hooks/constants.d.ts +0 -2
- package/dist/src/hooks/constants.d.ts.map +1 -1
- package/dist/src/hooks/constants.js +0 -2
- package/dist/src/hooks/constants.js.map +1 -1
- package/dist/src/hooks/keyword-spec-injector.d.ts +6 -0
- package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -1
- package/dist/src/hooks/keyword-spec-injector.js +157 -81
- package/dist/src/hooks/keyword-spec-injector.js.map +1 -1
- package/dist/src/hooks/kg-auto-init.d.ts +13 -0
- package/dist/src/hooks/kg-auto-init.d.ts.map +1 -0
- package/dist/src/hooks/kg-auto-init.js +38 -0
- package/dist/src/hooks/kg-auto-init.js.map +1 -0
- package/dist/src/hooks/kg-context-injector.d.ts +1 -3
- package/dist/src/hooks/kg-context-injector.d.ts.map +1 -1
- package/dist/src/hooks/kg-context-injector.js +12 -17
- package/dist/src/hooks/kg-context-injector.js.map +1 -1
- package/dist/src/hooks/kg-sync-hook.d.ts +1 -9
- package/dist/src/hooks/kg-sync-hook.d.ts.map +1 -1
- package/dist/src/hooks/kg-sync-hook.js +21 -90
- package/dist/src/hooks/kg-sync-hook.js.map +1 -1
- package/dist/src/hooks/spec-analytics.d.ts +1 -0
- package/dist/src/hooks/spec-analytics.d.ts.map +1 -1
- package/dist/src/hooks/spec-analytics.js +1 -3
- package/dist/src/hooks/spec-analytics.js.map +1 -1
- package/dist/src/hooks/spec-injector.d.ts.map +1 -1
- package/dist/src/hooks/spec-injector.js +65 -1
- package/dist/src/hooks/spec-injector.js.map +1 -1
- package/dist/src/i18n/locales/en.d.ts.map +1 -1
- package/dist/src/i18n/locales/en.js +52 -9
- package/dist/src/i18n/locales/en.js.map +1 -1
- package/dist/src/i18n/locales/zh.d.ts.map +1 -1
- package/dist/src/i18n/locales/zh.js +52 -9
- package/dist/src/i18n/locales/zh.js.map +1 -1
- package/dist/src/i18n/types.d.ts +40 -4
- package/dist/src/i18n/types.d.ts.map +1 -1
- package/dist/src/tools/__tests__/domain-search-debug.d.ts +2 -0
- package/dist/src/tools/__tests__/domain-search-debug.d.ts.map +1 -0
- package/dist/src/tools/__tests__/domain-search-debug.js +32 -0
- package/dist/src/tools/__tests__/domain-search-debug.js.map +1 -0
- package/dist/src/tools/domain-loader.d.ts +63 -0
- package/dist/src/tools/domain-loader.d.ts.map +1 -0
- package/dist/src/tools/domain-loader.js +295 -0
- package/dist/src/tools/domain-loader.js.map +1 -0
- package/dist/src/tools/domain-matcher.d.ts +24 -0
- package/dist/src/tools/domain-matcher.d.ts.map +1 -0
- package/dist/src/tools/domain-matcher.js +117 -0
- package/dist/src/tools/domain-matcher.js.map +1 -0
- package/dist/src/tools/domain-scanner.d.ts +32 -0
- package/dist/src/tools/domain-scanner.d.ts.map +1 -0
- package/dist/src/tools/domain-scanner.js +263 -0
- package/dist/src/tools/domain-scanner.js.map +1 -0
- package/dist/src/tools/domain-schema.d.ts +18 -0
- package/dist/src/tools/domain-schema.d.ts.map +1 -0
- package/dist/src/tools/domain-schema.js +104 -0
- package/dist/src/tools/domain-schema.js.map +1 -0
- package/dist/src/tools/spec-entry-parser.d.ts +1 -0
- package/dist/src/tools/spec-entry-parser.d.ts.map +1 -1
- package/dist/src/tools/spec-entry-parser.js +1 -0
- package/dist/src/tools/spec-entry-parser.js.map +1 -1
- package/dist/src/tools/spec-loader.d.ts +5 -0
- package/dist/src/tools/spec-loader.d.ts.map +1 -1
- package/dist/src/tools/spec-loader.js +10 -2
- package/dist/src/tools/spec-loader.js.map +1 -1
- package/dist/src/tui/install-ui/ConfigPanel.d.ts.map +1 -1
- package/dist/src/tui/install-ui/ConfigPanel.js +9 -1
- package/dist/src/tui/install-ui/ConfigPanel.js.map +1 -1
- package/dist/src/tui/install-ui/GroupedHub.d.ts +55 -0
- package/dist/src/tui/install-ui/GroupedHub.d.ts.map +1 -0
- package/dist/src/tui/install-ui/GroupedHub.js +210 -0
- package/dist/src/tui/install-ui/GroupedHub.js.map +1 -0
- package/dist/src/tui/install-ui/HooksConfig.d.ts +10 -5
- package/dist/src/tui/install-ui/HooksConfig.d.ts.map +1 -1
- package/dist/src/tui/install-ui/HooksConfig.js +83 -18
- package/dist/src/tui/install-ui/HooksConfig.js.map +1 -1
- package/dist/src/tui/install-ui/InstallConfirm.d.ts +1 -30
- package/dist/src/tui/install-ui/InstallConfirm.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallConfirm.js +72 -12
- package/dist/src/tui/install-ui/InstallConfirm.js.map +1 -1
- package/dist/src/tui/install-ui/InstallExecution.d.ts +4 -21
- package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallExecution.js +89 -260
- package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
- package/dist/src/tui/install-ui/InstallFlow.d.ts +3 -7
- package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallFlow.js +45 -267
- package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
- package/dist/src/tui/install-ui/InstallHub.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallHub.js +2 -4
- package/dist/src/tui/install-ui/InstallHub.js.map +1 -1
- package/dist/src/tui/install-ui/InstallResult.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallResult.js +1 -5
- package/dist/src/tui/install-ui/InstallResult.js.map +1 -1
- package/dist/src/tui/install-ui/index.d.ts +5 -1
- package/dist/src/tui/install-ui/index.d.ts.map +1 -1
- package/dist/src/tui/install-ui/index.js +1 -0
- package/dist/src/tui/install-ui/index.js.map +1 -1
- package/dist/src/tui/install-ui/types.d.ts +39 -0
- package/dist/src/tui/install-ui/types.d.ts.map +1 -1
- package/dist/src/tui/install-ui/types.js +1 -1
- package/dist/src/tui/install-ui/types.js.map +1 -1
- package/dist/src/tui/install-ui/useInstallFlowState.d.ts +69 -0
- package/dist/src/tui/install-ui/useInstallFlowState.d.ts.map +1 -0
- package/dist/src/tui/install-ui/useInstallFlowState.js +288 -0
- package/dist/src/tui/install-ui/useInstallFlowState.js.map +1 -0
- package/dist/src/tui/shared/components.d.ts +4 -0
- package/dist/src/tui/shared/components.d.ts.map +1 -1
- package/dist/src/tui/shared/components.js +4 -0
- package/dist/src/tui/shared/components.js.map +1 -1
- package/dist/src/tui/shared/index.d.ts +1 -1
- package/dist/src/tui/shared/index.d.ts.map +1 -1
- package/dist/src/tui/shared/index.js +1 -1
- package/dist/src/tui/shared/index.js.map +1 -1
- package/dist/src/tui/shared/tokens.d.ts +5 -5
- package/dist/src/tui/shared/tokens.js +5 -5
- package/dist/src/tui/shared/tokens.js.map +1 -1
- package/dist/src/types/index.d.ts +9 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/utils/cli-format.d.ts +2 -1
- package/dist/src/utils/cli-format.d.ts.map +1 -1
- package/dist/src/utils/cli-format.js +14 -3
- package/dist/src/utils/cli-format.js.map +1 -1
- package/dist/src/utils/cooldown-guard.d.ts +17 -0
- package/dist/src/utils/cooldown-guard.d.ts.map +1 -0
- package/dist/src/utils/cooldown-guard.js +59 -0
- package/dist/src/utils/cooldown-guard.js.map +1 -0
- package/dist/src/utils/jsonl-log.d.ts.map +1 -1
- package/dist/src/utils/jsonl-log.js +2 -1
- package/dist/src/utils/jsonl-log.js.map +1 -1
- package/dist/src/utils/update-notices.js +17 -4
- package/dist/src/utils/update-notices.js.map +1 -1
- package/package.json +4 -5
- package/workflows/claude-instructions.md +23 -0
- package/workflows/codex-instructions.md +22 -0
- package/workflows/finish-work.md +25 -0
- package/workflows/updates/update-v3-setup.md +7 -15
- package/dashboard/dist/assets/McpPage-Im6s4pGR.js +0 -21
- package/dashboard/dist/assets/SpecsPage-gr4KX51-.js +0 -36
- package/dashboard/dist/assets/folder-B8ODoZfb.js +0 -16
- package/dashboard/dist/assets/index-6-yE5Yl9.css +0 -1
- package/dashboard/dist/assets/pen-line-CR8GaHt-.js +0 -6
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: odyssey-ui
|
|
3
|
+
description: "Long-running UI optimization cycle — visual survey, multi-dimensional audit, divergent exploration, fix, verify, generalize, and design knowledge persistence"
|
|
4
|
+
argument-hint: '"<target>" [--dimensions <list>] [--skip-fix] [--skip-generalize] [--auto] [-y] [-c]'
|
|
5
|
+
allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, request_user_input
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<purpose>
|
|
9
|
+
Deep UI polish cycle: survey (design tokens + pattern inventory) -> audit (6 dimensions) ->
|
|
10
|
+
diverge (creative exploration) -> fix -> verify -> generalize -> discover -> record.
|
|
11
|
+
|
|
12
|
+
Unlike `$maestro-impeccable` (single command), this is a persistent session with evidence trails,
|
|
13
|
+
decision journal, iterative improvement, and codebase-wide generalization. `--skip-fix` for audit-only.
|
|
14
|
+
|
|
15
|
+
Core philosophy:
|
|
16
|
+
- **Every pixel tells a story** — subtle details create the experience
|
|
17
|
+
- **Diverge before converge** — explore creatively, then implement methodically
|
|
18
|
+
- **Find one, polish all** — a single improvement reveals a class of opportunities
|
|
19
|
+
- **Browser is truth** — verify in real rendering, not just code
|
|
20
|
+
|
|
21
|
+
**三句哲学约束(穷尽迭代):**
|
|
22
|
+
1. **零遗留** — 每个 finding/idea 必须是 action item(修复 / issue / 决策),不允许只报告不处理
|
|
23
|
+
2. **穷尽迭代** — 按 impact×severity 递降逐轮修复,直到 0 remaining actionable 才退出 fix loop
|
|
24
|
+
3. **改进即标准** — 每次修复后重审同区域,发现新视觉问题继续修,直到该区域无可改善
|
|
25
|
+
</purpose>
|
|
26
|
+
|
|
27
|
+
<boundary>
|
|
28
|
+
**范围内:** 目标组件/页面的视觉体验优化 — 6 维度审查 → 发散探索 → 修复 → 泛化兄弟组件
|
|
29
|
+
**范围外:** 后端逻辑 / 数据模型 / API → `$odyssey-planex` | 深度 bug → `$odyssey-debug` | 代码质量 → `$odyssey-review-test-fix`
|
|
30
|
+
**探索自由度:** 边界内最大自由 — S_DIVERGE 鼓励发散思维,不设创意上限。在约束下尽可能完善每个像素。
|
|
31
|
+
</boundary>
|
|
32
|
+
|
|
33
|
+
<execution_discipline>
|
|
34
|
+
**三条铁律(所有阶段适用):**
|
|
35
|
+
1. **Phase auto-commit** — 阶段完成后**自动** `git commit`,无需用户确认(session.json/evidence.ndjson 不纳入)
|
|
36
|
+
2. **有把握才改** — 确定性高(缺 hover state、对比度不足)→改;设计方向不确定(色彩/布局)→记录 decision
|
|
37
|
+
3. **多 CLI 辅助** — survey 用 `--role explore`,audit/diverge 用 `--role analyze`,fix 前后用 `--role review`
|
|
38
|
+
</execution_discipline>
|
|
39
|
+
|
|
40
|
+
<context>
|
|
41
|
+
$ARGUMENTS — target and optional flags.
|
|
42
|
+
|
|
43
|
+
**Target resolution:**
|
|
44
|
+
| Input | Resolution |
|
|
45
|
+
|-------|-----------|
|
|
46
|
+
| Component path | Review those component files |
|
|
47
|
+
| Page/route | Resolve route to component tree |
|
|
48
|
+
| `HEAD` / `staged` | `git diff HEAD` / `git diff --staged` (UI files only) |
|
|
49
|
+
| Feature area | Grep for feature keyword, collect UI files |
|
|
50
|
+
|
|
51
|
+
**Flags:**
|
|
52
|
+
| Flag | Effect |
|
|
53
|
+
|------|--------|
|
|
54
|
+
| `--dimensions <list>` | Comma-separated subset (default: all 6) |
|
|
55
|
+
| `--skip-fix` | Audit-only — skip S_FIX and S_VERIFY |
|
|
56
|
+
| `--skip-generalize` | Skip S_GENERALIZE and S_DISCOVER |
|
|
57
|
+
| `--auto` | CLI delegates without confirmation |
|
|
58
|
+
| `-y` | Auto-confirm at all decision points (see appendix) |
|
|
59
|
+
| `-c` | Resume most recent session |
|
|
60
|
+
|
|
61
|
+
**Dimensions (6):** visual-hierarchy, interaction-states, accessibility, responsiveness, micro-interactions, edge-cases
|
|
62
|
+
|
|
63
|
+
**Session**: `SESSION_DIR = .workflow/scratch/{YYYYMMDD}-ui-odyssey-{slug}/`
|
|
64
|
+
|
|
65
|
+
**Output — 3 files:**
|
|
66
|
+
```
|
|
67
|
+
SESSION_DIR/
|
|
68
|
+
├── session.json # state + audit_result + diverge_result + patterns + phase_goals
|
|
69
|
+
├── evidence.ndjson # ALL evidence (phase: survey|audit|diverge|fix|discovery|decision|self-iteration)
|
|
70
|
+
└── understanding.md # 8-section evolving narrative (§1-§8, one per major phase)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**session.json schema:**
|
|
74
|
+
```json
|
|
75
|
+
{ "session_id": "ui-odyssey-{YYYYMMDD-HHmmss}", "target": "", "dimensions": [],
|
|
76
|
+
"flags": { "skip_fix": false, "skip_generalize": false, "auto": false, "auto_confirm": false },
|
|
77
|
+
"current_state": "S_INTAKE",
|
|
78
|
+
"audit_result": { "dimensions_audited": [], "finding_count": 0, "severity_distribution": {} },
|
|
79
|
+
"diverge_result": { "improvements_proposed": 0, "creative_ideas": 0 },
|
|
80
|
+
"patterns": [], "generalization_stats": null,
|
|
81
|
+
"phase_goals": [], "phase_goals_all_done": false, "self_iteration_log": [],
|
|
82
|
+
"cross_phase_loops": 0, "max_loops": 3,
|
|
83
|
+
"created_at": "", "updated_at": "" }
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**evidence.ndjson:** `{"ts":"","phase":"survey|audit|diverge|fix|discovery|decision|self-iteration","type":"","dimension":"","title":"","severity":"","file":"","line":0,"description":"","suggestion":""}`
|
|
87
|
+
|
|
88
|
+
**phase_goals[] — auto-derived from flags:**
|
|
89
|
+
|
|
90
|
+
| ID | Goal | Phase | skip_when |
|
|
91
|
+
|----|------|-------|-----------|
|
|
92
|
+
| G1 | Survey completed | S_SURVEY | — |
|
|
93
|
+
| G2 | Audit completed | S_AUDIT | — |
|
|
94
|
+
| G3 | Divergent exploration done | S_DIVERGE | — |
|
|
95
|
+
| G4 | Fix applied and verified | S_VERIFY | skip_fix |
|
|
96
|
+
| G5 | Pattern generalized | S_GENERALIZE | skip_generalize |
|
|
97
|
+
| G6 | Discoveries triaged | S_DISCOVER | skip_generalize |
|
|
98
|
+
| G7 | Learnings persisted | S_RECORD | — |
|
|
99
|
+
|
|
100
|
+
Lifecycle: `pending -> done | skipped | failed` (all set `completion_confirmed`)
|
|
101
|
+
|
|
102
|
+
**understanding.md — 8 sections:** SS1 Target & Context (S_INTAKE) | SS2 Visual Survey (S_SURVEY) | SS3 Audit Findings (S_AUDIT) | SS4 Divergent Exploration (S_DIVERGE) | SS5 Fix & Verification (S_FIX+S_VERIFY) | SS6 Generalization (S_GENERALIZE) | SS7 Discoveries (S_DISCOVER) | SS8 Design Learnings (S_RECORD)
|
|
103
|
+
|
|
104
|
+
### Pre-load
|
|
105
|
+
|
|
106
|
+
| Layer | Command | Purpose |
|
|
107
|
+
|-------|---------|---------|
|
|
108
|
+
| Codebase docs | Read `.workflow/codebase/ARCHITECTURE.md` | Module boundaries |
|
|
109
|
+
| Wiki search | `maestro search "<target keywords>" --json` | Prior UI decisions (top 5) |
|
|
110
|
+
| UI specs | `maestro spec load --category ui` | Design tokens, standards |
|
|
111
|
+
| Coding specs | `maestro spec load --category coding` | Coding conventions |
|
|
112
|
+
| Role knowledge | `maestro search --category ui` -> select -> `maestro wiki load <id>` | Domain knowledge |
|
|
113
|
+
| Prior sessions | `Glob(".workflow/scratch/*-ui-odyssey-*")` | Related sessions |
|
|
114
|
+
|
|
115
|
+
### Knowledge Persistence (two-step model)
|
|
116
|
+
|
|
117
|
+
Write to understanding.md SS8 during execution (temporary). Completion summary suggests follow-up commands.
|
|
118
|
+
|
|
119
|
+
| Category | Content | Follow-up |
|
|
120
|
+
|----------|---------|-----------|
|
|
121
|
+
| Design pattern | Component pattern + scenarios | `$spec-add ui "..."` |
|
|
122
|
+
| Interaction spec | State defs + transition rules | `$spec-add ui "..."` |
|
|
123
|
+
| Accessibility rule | WCAG req + implementation | `$spec-add ui "..."` |
|
|
124
|
+
| Reusable generalization | Pattern signature + scope | `$spec-add coding "..."` |
|
|
125
|
+
</context>
|
|
126
|
+
|
|
127
|
+
<self_iteration>
|
|
128
|
+
**Quality Gate** — auto-evaluate after each analytical phase. Insufficient -> re-enter (max 2 rounds).
|
|
129
|
+
|
|
130
|
+
| Dimension | Sufficient | Insufficient |
|
|
131
|
+
|-----------|-----------|-------------|
|
|
132
|
+
| Coverage | All known related files/components analyzed | Missed targets discoverable via grep/glob |
|
|
133
|
+
| Depth | >=80% findings have file:line evidence | Most findings lack specifics |
|
|
134
|
+
| Actionability | Each conclusion has concrete next action | "Consider reviewing" without action |
|
|
135
|
+
|
|
136
|
+
**Expansion:** Round 1 = widen scope (more directories, more components, deeper token scan). Round 2 = shift perspective (different audit angle, CLI delegate second opinion).
|
|
137
|
+
|
|
138
|
+
**Applicable stages:** S_SURVEY, S_AUDIT, S_DIVERGE, S_GENERALIZE
|
|
139
|
+
|
|
140
|
+
**Exit:** All sufficient -> advance | 2-round cap -> record gap, continue. Logged to `evidence.ndjson` + `session.json.self_iteration_log[]`.
|
|
141
|
+
</self_iteration>
|
|
142
|
+
|
|
143
|
+
<csv_schema>
|
|
144
|
+
|
|
145
|
+
### Shared Output Schema (all waves)
|
|
146
|
+
```json
|
|
147
|
+
{
|
|
148
|
+
"type": "object",
|
|
149
|
+
"properties": {
|
|
150
|
+
"id": { "type": "string" },
|
|
151
|
+
"result_status": { "type": "string", "enum": ["completed", "failed"] },
|
|
152
|
+
"findings": { "type": "string", "maxLength": 500 },
|
|
153
|
+
"evidence": { "type": "string" },
|
|
154
|
+
"error": { "type": "string" }
|
|
155
|
+
},
|
|
156
|
+
"required": ["id", "result_status", "findings"]
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Termination contract:** Call `report_agent_job_result` EXACTLY ONCE. Read-only. Do NOT modify source files, tasks.csv, wave-*.csv, results.csv, or call spawn_agents_on_csv.
|
|
161
|
+
|
|
162
|
+
### tasks.csv
|
|
163
|
+
```csv
|
|
164
|
+
id,title,description,task_type,dimension,deps,wave,status,findings,evidence,error
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Waves:**
|
|
168
|
+
| Wave | Tasks | Parallelism |
|
|
169
|
+
|------|-------|-------------|
|
|
170
|
+
| 1 | Survey (design-tokens-audit, pattern-inventory) | 2 agents |
|
|
171
|
+
| 2 | Audit (visual-hierarchy, interaction-states, accessibility, responsiveness, micro-interactions, edge-cases) | 6 agents |
|
|
172
|
+
| 3 | Diverge (polish-agent, delight-agent) | 2 agents |
|
|
173
|
+
| 4 | Generalization (syntax-grep, semantic-scan, structural-match, historical-grep) | 4 agents |
|
|
174
|
+
</csv_schema>
|
|
175
|
+
|
|
176
|
+
<invariants>
|
|
177
|
+
1. **Browser is truth** — code changes must be visually verifiable
|
|
178
|
+
2. **Diverge before converge** — S_DIVERGE runs before S_FIX, never skip
|
|
179
|
+
3. **Evidence append-only** — evidence.ndjson is never overwritten
|
|
180
|
+
4. **Session is source of truth** — session.json holds all state
|
|
181
|
+
5. **Phase goal tracking** — each stage MUST mark its goal on completion
|
|
182
|
+
6. **`-y` defers, never drops** — auto-confirm records `deferred`, never silently skips
|
|
183
|
+
7. **CLI delegate is background** — all `maestro delegate` calls use run_in_background
|
|
184
|
+
8. **Goal is outcome-oriented** — odyssey outputs prompt then continues
|
|
185
|
+
9. **Invariant violation = BLOCK** — violating any invariant blocks the operation
|
|
186
|
+
</invariants>
|
|
187
|
+
|
|
188
|
+
<execution>
|
|
189
|
+
|
|
190
|
+
**States:** S_INTAKE -> S_SURVEY -> S_AUDIT -> S_DIVERGE -> S_FIX -> S_VERIFY -> S_GENERALIZE -> S_DISCOVER -> S_RECORD
|
|
191
|
+
- S_FIX/S_VERIFY skip when `--skip-fix`
|
|
192
|
+
- S_GENERALIZE/S_DISCOVER skip when `--skip-generalize`
|
|
193
|
+
|
|
194
|
+
### S_INTAKE
|
|
195
|
+
1. Parse target + flags -> resolve file list (filter to UI-relevant: `.tsx`, `.vue`, `.svelte`, `.css`, `.scss`, style files)
|
|
196
|
+
2. Generate slug, create `SESSION_DIR`
|
|
197
|
+
3. Search prior knowledge: `maestro search "<keywords>"` + Glob prior sessions + ARCHITECTURE.md + spec load (ui, coding)
|
|
198
|
+
4. Derive `phase_goals[]` from flags (apply `skip_when`)
|
|
199
|
+
5. Write `session.json` + `understanding.md` SS1
|
|
200
|
+
6. Display Goal Prompt (appendix), continue without blocking
|
|
201
|
+
|
|
202
|
+
**Resume (`-c`):** Glob latest session -> read `session.json` -> restore `current_state` -> jump.
|
|
203
|
+
|
|
204
|
+
📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-ui({slug}): S_INTAKE — 目标解析"`
|
|
205
|
+
|
|
206
|
+
### S_SURVEY
|
|
207
|
+
**spawn_agents_on_csv (Wave 1):**
|
|
208
|
+
|
|
209
|
+
Write `tasks.csv` with Wave 1 rows:
|
|
210
|
+
```csv
|
|
211
|
+
"survey-tokens","Design Token Audit","Scan {target_files} for CSS variables, design tokens, theme values. Return [{token,usage_count,consistency,file,line}].","survey","","","1","pending","","",""
|
|
212
|
+
"survey-patterns","Pattern Inventory","Catalog component patterns, layout, spacing, typography in {target_files}. Return [{pattern,files,consistency}].","survey","","","1","pending","","",""
|
|
213
|
+
```
|
|
214
|
+
`spawn_agents_on_csv({ csv_path:"tasks.csv", max_concurrency:2, max_runtime_seconds:300, output_csv_path:"wave-1-results.csv", output_schema:SHARED_OUTPUT_SCHEMA })`
|
|
215
|
+
|
|
216
|
+
Merge -> evidence.ndjson (phase: "survey"). Update SS2. Mark G1 done.
|
|
217
|
+
|
|
218
|
+
📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-ui({slug}): S_SURVEY — 调查"`
|
|
219
|
+
|
|
220
|
+
### S_AUDIT
|
|
221
|
+
**spawn_agents_on_csv (Wave 2)** — 6 agents:
|
|
222
|
+
|
|
223
|
+
Append Wave 2 rows to `tasks.csv`:
|
|
224
|
+
```csv
|
|
225
|
+
"audit-hierarchy","Visual Hierarchy","Spacing, typography scale, contrast, alignment, whitespace, visual weight","audit","visual-hierarchy","","2","pending","","",""
|
|
226
|
+
"audit-interaction","Interaction States","hover/focus/active/disabled/loading/error/empty/selected states","audit","interaction-states","","2","pending","","",""
|
|
227
|
+
"audit-a11y","Accessibility","WCAG AA contrast, focus mgmt, aria, keyboard nav, screen reader","audit","accessibility","","2","pending","","",""
|
|
228
|
+
"audit-responsive","Responsiveness","Breakpoints, overflow, touch targets >=44px, fluid typography","audit","responsiveness","","2","pending","","",""
|
|
229
|
+
"audit-motion","Micro-interactions","Transitions, animations, feedback, loading states, scroll behavior","audit","micro-interactions","","2","pending","","",""
|
|
230
|
+
"audit-edge","Edge Cases","Long text, empty data, error states, extreme values, i18n, RTL","audit","edge-cases","","2","pending","","",""
|
|
231
|
+
```
|
|
232
|
+
`spawn_agents_on_csv({ csv_path:"tasks.csv", max_concurrency:6, max_runtime_seconds:600, output_csv_path:"wave-2-results.csv", output_schema:SHARED_OUTPUT_SCHEMA })`
|
|
233
|
+
|
|
234
|
+
Merge -> evidence.ndjson (phase: "audit"). Write `audit_result` with dimensions, finding count, severity distribution. Update SS3. Mark G2 done.
|
|
235
|
+
|
|
236
|
+
📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-ui({slug}): S_AUDIT — 审查"`
|
|
237
|
+
|
|
238
|
+
### S_DIVERGE
|
|
239
|
+
**spawn_agents_on_csv (Wave 3)** — 2 agents:
|
|
240
|
+
|
|
241
|
+
Append Wave 3 rows to `tasks.csv`:
|
|
242
|
+
```csv
|
|
243
|
+
"diverge-polish","Polish Agent","Missing subtle details: shadows, borders, transitions, hover feedback, empty states, skeleton loading, scroll behavior. Return [{idea,category:'polish',impact,effort,description}].","diverge","","","3","pending","","",""
|
|
244
|
+
"diverge-delight","Delight Agent","What makes this memorable: motion design, progressive disclosure, smart defaults, celebratory feedback, personality. Return [{idea,category:'delight',impact,effort,description}].","diverge","","","3","pending","","",""
|
|
245
|
+
```
|
|
246
|
+
`spawn_agents_on_csv({ csv_path:"tasks.csv", max_concurrency:2, max_runtime_seconds:300, output_csv_path:"wave-3-results.csv", output_schema:SHARED_OUTPUT_SCHEMA })`
|
|
247
|
+
|
|
248
|
+
**Optional CLI delegate** for creative review:
|
|
249
|
+
```bash
|
|
250
|
+
maestro delegate "PURPOSE: Creative UI review for: {target}
|
|
251
|
+
TASK: Identify polish opportunities | Suggest delight moments | Evaluate visual rhythm
|
|
252
|
+
MODE: analysis CONTEXT: @{target_files} | Survey: {token_summary} | Audit: {top_findings}
|
|
253
|
+
EXPECTED: JSON [{idea, category, impact, effort, description}]
|
|
254
|
+
CONSTRAINTS: User-perceptible improvements only
|
|
255
|
+
" --role analyze --mode analysis
|
|
256
|
+
```
|
|
257
|
+
Run_in_background, STOP, wait for callback.
|
|
258
|
+
|
|
259
|
+
Consolidate: audit findings + divergent ideas -> prioritized improvement list (impact/effort matrix). Write `diverge_result`. Update SS4. Mark G3 done.
|
|
260
|
+
|
|
261
|
+
📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-ui({slug}): S_DIVERGE — 发散"`
|
|
262
|
+
|
|
263
|
+
### S_FIX
|
|
264
|
+
Skip if `--skip-fix`. **穷尽修复** ALL audit findings + divergent ideas(按 impact×severity 递降),不限于 high severity。每轮修复后 re-review,新发现追加。
|
|
265
|
+
**Normal**: `request_user_input` to confirm. **`-y`**: auto-fix, record `deferred`.
|
|
266
|
+
Implement highest impact first. Record evidence (phase: "fix").
|
|
267
|
+
|
|
268
|
+
📌 **Auto-commit**: `git add -A && git commit -m "odyssey-ui({slug}): S_FIX — 修复"`
|
|
269
|
+
|
|
270
|
+
### S_VERIFY
|
|
271
|
+
Skip if `--skip-fix`.
|
|
272
|
+
|
|
273
|
+
1. **Tests**: run covering tests on modified files
|
|
274
|
+
2. **CLI visual review**: delegate `--role review --mode analysis` for visual correctness + regression check (run_in_background, STOP)
|
|
275
|
+
3. `needs_rework` -> S_FIX (loop). `confirmed` -> mark G4 done, advance
|
|
276
|
+
4. Update SS5
|
|
277
|
+
|
|
278
|
+
📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-ui({slug}): S_VERIFY — 验证"`
|
|
279
|
+
|
|
280
|
+
### S_GENERALIZE
|
|
281
|
+
Skip if `--skip-generalize`.
|
|
282
|
+
|
|
283
|
+
**Step 1 — Multi-layer pattern extraction** from audit + diverge findings:
|
|
284
|
+
|
|
285
|
+
| Layer | Method | Example |
|
|
286
|
+
|-------|--------|---------|
|
|
287
|
+
| Syntax | Regex patterns (direct Grep) | Missing `focus-visible`, hardcoded colors, `!important` |
|
|
288
|
+
| Semantic | Agent anti-pattern scan | Missing hover state on interactive element, no empty state |
|
|
289
|
+
| Structural | File/module similarity | Same component structure missing accessibility attrs |
|
|
290
|
+
|
|
291
|
+
Write `session.json.patterns[]`: `[{id, source_finding, layer, signature, description, risk, fix_template}]`
|
|
292
|
+
|
|
293
|
+
**Step 2 — 4-agent scan (spawn_agents_on_csv, Wave 4):**
|
|
294
|
+
|
|
295
|
+
Append Wave 4 rows to `tasks.csv`:
|
|
296
|
+
```csv
|
|
297
|
+
"gen-syntax","Syntax Grep","Grep CSS/style patterns matching '${signatures}' across project","generalization","syntax","","4","pending","","",""
|
|
298
|
+
"gen-semantic","Semantic Scan","Find components with same interaction pattern but missing states","generalization","semantic","","4","pending","","",""
|
|
299
|
+
"gen-structural","Structural Match","Find structurally similar components, check for same issues","generalization","structural","","4","pending","","",""
|
|
300
|
+
"gen-historical","Historical Grep","git log -S '${signature}' for UI pattern history","generalization","historical","","4","pending","","",""
|
|
301
|
+
```
|
|
302
|
+
`spawn_agents_on_csv({ csv_path:"tasks.csv", max_concurrency:4, max_runtime_seconds:600, output_csv_path:"wave-4-results.csv", output_schema:SHARED_OUTPUT_SCHEMA })`
|
|
303
|
+
|
|
304
|
+
**Step 3 — Cross-layer dedup**: Multi-layer hit -> boost confidence. Single -> `needs_review`. Historical fix -> `regression_risk`.
|
|
305
|
+
|
|
306
|
+
**Step 4 — Iterative deepening**: module >= 3 hits -> targeted deep scan. Max 1 round.
|
|
307
|
+
|
|
308
|
+
**Step 5 — Quality Gate** (self-iteration).
|
|
309
|
+
|
|
310
|
+
**Step 6:** Write `generalization_stats`. Update SS6. Mark G5 done.
|
|
311
|
+
|
|
312
|
+
📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-ui({slug}): S_GENERALIZE — 泛化"`
|
|
313
|
+
|
|
314
|
+
### S_DISCOVER
|
|
315
|
+
Skip if no generalization hits.
|
|
316
|
+
|
|
317
|
+
1. **Triage** each hit: read +-10 lines -> classify `safe` / `risk` / `bug`
|
|
318
|
+
2. **Route**: see appendix `-y` behavior. Append evidence (phase: "discovery" + "decision")
|
|
319
|
+
3. **Cross-phase loop**: new component to audit → S_AUDIT (loops < max_loops → cross_phase_loops++); fixable sibling → S_FIX (!skip_fix, loops < max_loops); triage complete OR budget exhausted → S_RECORD
|
|
320
|
+
4. Update SS7. Mark G6 done.
|
|
321
|
+
|
|
322
|
+
📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-ui({slug}): S_DISCOVER — 发现"`
|
|
323
|
+
|
|
324
|
+
### S_RECORD
|
|
325
|
+
1. Finalize SS8: structured by Knowledge Persistence table (temporary)
|
|
326
|
+
2. Mark G7 done. Pending decisions: **Normal** -> `request_user_input`. **`-y`** -> skip, show deferred count
|
|
327
|
+
3. **Goal audit**: all confirmed -> `phase_goals_all_done = true`. Any false: **Normal** -> `request_user_input`. **`-y`** -> auto accept
|
|
328
|
+
4. **Completion**: `current_state = "COMPLETED"`, emit summary:
|
|
329
|
+
```
|
|
330
|
+
--- UI ODYSSEY COMPLETE ---
|
|
331
|
+
Target: {target} Dimensions: {audited}
|
|
332
|
+
Survey: {token_count} tokens, {pattern_count} patterns
|
|
333
|
+
Audit: {C}C {H}H {M}M {L}L Diverge: {improvements} + {ideas} creative
|
|
334
|
+
Fix: {F} applied, {S} skipped Patterns: {N} ({by_layer})
|
|
335
|
+
Scan: {total} hits ({cross_layer} cross-layer) Issues: {N}
|
|
336
|
+
Decisions: {resolved}/{pending}/{deferred} Self-iter: {R} rounds / {P} phases
|
|
337
|
+
Goals: {done}/{total} ({skipped} skipped)
|
|
338
|
+
---
|
|
339
|
+
```
|
|
340
|
+
**Next steps:** `$odyssey-review-test-fix`, `$manage-issue list --source ui-odyssey`, `$maestro-impeccable`, `$maestro-plan --gaps`
|
|
341
|
+
|
|
342
|
+
📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-ui({slug}): S_RECORD — 总结"`
|
|
343
|
+
</execution>
|
|
344
|
+
|
|
345
|
+
<appendix>
|
|
346
|
+
|
|
347
|
+
### Goal Prompt Template
|
|
348
|
+
|
|
349
|
+
**Time guard: display ONCE after S_INTAKE completes (session created, before survey). NEVER redisplay at S_RECORD completion.**
|
|
350
|
+
|
|
351
|
+
```
|
|
352
|
+
UI Odyssey session created. Copy the following /goal to set termination conditions at any time:
|
|
353
|
+
|
|
354
|
+
/goal 穷尽迭代:直到所有 audit + diverge findings 均已处理(fix/issue/decision)
|
|
355
|
+
且 phase_goals_all_done=true 才停。修复按 impact×severity 逐轮迭代。
|
|
356
|
+
每轮修复后重审修改区域,新发现追加继续。
|
|
357
|
+
phase=decision pending 必须 request_user_input。不允许遗留。
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
Odyssey outputs prompt then continues without blocking. `/goal` entered by user at any time.
|
|
361
|
+
|
|
362
|
+
### `-y` Auto-Confirm Behavior
|
|
363
|
+
|
|
364
|
+
| Decision Point | Normal | `-y` mode |
|
|
365
|
+
|----------------|--------|-----------|
|
|
366
|
+
| S_DIVERGE consolidation | request_user_input for priority | auto-rank by impact/effort |
|
|
367
|
+
| S_FIX fix candidates | request_user_input to confirm | auto-fix high-impact, `deferred` |
|
|
368
|
+
| S_DISCOVER bug routing | request_user_input per hit | auto create issue, `deferred` |
|
|
369
|
+
| S_DISCOVER ambiguous | request_user_input batch | all `deferred` |
|
|
370
|
+
| S_RECORD pending decisions | request_user_input per-item | skip, show deferred count |
|
|
371
|
+
| S_RECORD goal audit | request_user_input 3-way | auto accept current state |
|
|
372
|
+
|
|
373
|
+
`deferred` items shown in summary; recoverable via `-c`.
|
|
374
|
+
|
|
375
|
+
### Phase Goal Lifecycle
|
|
376
|
+
|
|
377
|
+
`pending -> done (confirmed=true)` normal | `pending -> skipped (confirmed=true)` flags/manual | `pending -> failed (confirmed=false)` incomplete
|
|
378
|
+
|
|
379
|
+
`phase_goals_all_done = true` only when ALL goals have `completion_confirmed == true`.
|
|
380
|
+
|
|
381
|
+
</appendix>
|
|
382
|
+
|
|
383
|
+
<error_codes>
|
|
384
|
+
| Code | Severity | Condition | Recovery |
|
|
385
|
+
|------|----------|-----------|----------|
|
|
386
|
+
| E001 | error | No target and no session to resume | Provide target or use -c |
|
|
387
|
+
| E002 | error | Target not found or no UI files | Check path, ensure UI files exist |
|
|
388
|
+
| E003 | error | Resume but no session found | Start new session |
|
|
389
|
+
| W001 | warning | No relevant git history | Proceed with limited context |
|
|
390
|
+
| W002 | warning | Audit dimension agent failed | Partial coverage, note gap |
|
|
391
|
+
| W003 | warning | Generalization scan 0 hits | Skip discovery |
|
|
392
|
+
| W004 | warning | Delegate parse failed | Use raw output |
|
|
393
|
+
</error_codes>
|
|
394
|
+
|
|
395
|
+
<success_criteria>
|
|
396
|
+
- [ ] Target resolved to UI files, session created with 3 output files
|
|
397
|
+
- [ ] Prior knowledge searched (maestro search + sessions + architecture + ui specs)
|
|
398
|
+
- [ ] Survey via spawn Wave 1, evidence phase=survey
|
|
399
|
+
- [ ] All 6 dimensions audited via spawn Wave 2, severity matrix produced
|
|
400
|
+
- [ ] Divergent exploration via spawn Wave 3, prioritized improvement list
|
|
401
|
+
- [ ] Fixes applied highest-impact-first and verified (unless --skip-fix)
|
|
402
|
+
- [ ] `--skip-fix`: no source code modifications
|
|
403
|
+
- [ ] Generalization via spawn Wave 4 + cross-layer dedup (unless --skip-generalize)
|
|
404
|
+
- [ ] Discoveries classified and routed
|
|
405
|
+
- [ ] understanding.md tracks all 8 sections progressively
|
|
406
|
+
- [ ] phase_goals G1-G7 derived from flags, each phase marks its goal
|
|
407
|
+
- [ ] Goal Prompt displayed once; `-y` auto-resolves/defers
|
|
408
|
+
- [ ] State saved at each transition (resumable via -c)
|
|
409
|
+
- [ ] Quality Gate self-iteration logged in self_iteration_log
|
|
410
|
+
- [ ] Completion summary with all stats
|
|
411
|
+
</success_criteria>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as W,r as d,A as J,j as e,F as C,o as xe,W as j,p as pe,V as ue,X as fe,n as Z,B as he}from"./index-
|
|
1
|
+
import{d as W,r as d,A as J,j as e,F as C,o as xe,W as j,p as pe,V as ue,X as fe,n as Z,B as he}from"./index-Cbs79erW.js";import{C as me}from"./code-C3TuHjMs.js";import{S as X}from"./search-CPGb2sEw.js";import{u as Q}from"./shallow-Dy0-7n5s.js";import{F as M,T as ge}from"./TreeBrowser-1YP-DfTY.js";import{M as ve}from"./MarkdownRenderer-C3FvTqVe.js";import{C as ee}from"./chevron-right-D9BsXrIg.js";import{D as te}from"./folder-Chwj_P4A.js";import{C as re}from"./circle-Cn5fNpmp.js";import{C as $}from"./circle-check-DApOBP0J.js";import{A as be}from"./index-CN0YdC9M.js";import{m as N}from"./proxy-BewnIei6.js";import"./folder-open-S72FbKvn.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -18,4 +18,4 @@ import{d as W,r as d,A as J,j as e,F as C,o as xe,W as j,p as pe,V as ue,X as fe
|
|
|
18
18
|
`);for(const s of a){const i=s.match(/^(#{1,4})\s+(.+)/);i&&r.push({level:i[1].length,text:i[2].trim()})}return r}function Oe(t){try{const r=JSON.parse(t);return typeof r!="object"||r===null||Array.isArray(r)?[]:Object.entries(r).map(([a,s])=>({key:a,type:Array.isArray(s)?"array":typeof s}))}catch{return[]}}function Ae({path:t,content:r}){if(!t)return e.jsx("div",{className:"w-[240px] bg-bg-primary border-l border-border shrink-0 flex items-center justify-center",children:e.jsx("p",{className:"text-[length:var(--font-size-xs)] text-text-tertiary",children:"No file selected"})});const a=ze(t),s=t.includes("/")?t.slice(t.lastIndexOf("/")+1):t,i=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"/";return e.jsxs("div",{className:"w-[240px] bg-bg-primary border-l border-border shrink-0 flex flex-col overflow-hidden",children:[e.jsx("div",{className:"px-[14px] py-[10px] border-b border-border-divider text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary shrink-0",children:"Properties"}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-[14px] py-[var(--spacing-3)]",children:[e.jsxs(F,{title:"File Info",defaultOpen:!0,children:[e.jsx(T,{label:"Name",value:s}),e.jsx(T,{label:"Type",value:a.replace(".","").toUpperCase()||"Unknown"}),e.jsx(T,{label:"Directory",value:i,mono:!0})]}),e.jsx(F,{title:"Tags",children:e.jsxs("div",{className:"flex flex-wrap gap-[var(--spacing-1)]",children:[e.jsx(O,{label:a.replace(".","")||"file",color:"blue"}),t.includes("phase")&&e.jsx(O,{label:"phase",color:"purple"}),t.includes("verification")&&e.jsx(O,{label:"verify",color:"green"})]})}),a===".md"&&r&&e.jsx($e,{content:r}),a===".json"&&r&&e.jsx(_e,{content:r})]})]})}function F({title:t,defaultOpen:r=!0,children:a}){const[s,i]=d.useState(r);return e.jsxs("div",{className:"mb-[var(--spacing-4)]",children:[e.jsxs("button",{type:"button",onClick:()=>i(o=>!o),className:["flex items-center gap-[var(--spacing-1)] w-full text-left mb-[var(--spacing-1-5)]","text-[9px] font-[var(--font-weight-semibold)] uppercase tracking-[0.06em] text-text-placeholder","hover:text-text-secondary transition-colors duration-[var(--duration-fast)]"].join(" "),children:[e.jsx(ee,{size:10,strokeWidth:2.5,className:["transition-transform duration-[var(--duration-fast)]",s?"rotate-90":""].join(" ")}),t]}),s&&a]})}function T({label:t,value:r,mono:a}){return e.jsxs("div",{className:"flex items-center justify-between py-[var(--spacing-1)] text-[length:var(--font-size-sm)]",children:[e.jsx("span",{className:"text-text-tertiary",children:t}),e.jsx("span",{className:`text-text-primary font-[var(--font-weight-medium)] ${a?"font-mono text-[11px]":""} truncate max-w-[140px]`,children:r})]})}function O({label:t,color:r}){const s={blue:{bg:"rgba(91,141,184,0.12)",text:"var(--color-accent-blue)"},purple:{bg:"rgba(145,120,181,0.12)",text:"var(--color-accent-purple, #9178B5)"},green:{bg:"rgba(90,158,120,0.12)",text:"var(--color-status-completed)"}}[r];return e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[2px] rounded-full",style:{background:s.bg,color:s.text},children:t})}function $e({content:t}){const r=d.useMemo(()=>Te(t),[t]);return r.length===0?null:e.jsx(F,{title:"Outline",children:e.jsx("div",{className:"flex flex-col gap-[2px]",children:r.map((a,s)=>e.jsxs("button",{type:"button",className:["flex items-center gap-[var(--spacing-1-5)] px-[var(--spacing-2)] py-[3px] rounded-[var(--radius-sm)] text-[11px] w-full text-left","hover:bg-bg-hover hover:text-text-primary transition-colors duration-[var(--duration-fast)] cursor-pointer",s===0?"text-text-primary font-[var(--font-weight-semibold)]":"text-text-tertiary"].join(" "),style:{paddingLeft:(a.level-1)*10+8},children:[e.jsx("span",{className:"w-1 h-1 rounded-full shrink-0",style:{background:s===0?"var(--color-accent-purple)":"var(--color-text-placeholder)"}}),e.jsx("span",{className:"truncate",children:a.text})]},s))})})}function _e({content:t}){const r=d.useMemo(()=>Oe(t),[t]);return r.length===0?null:e.jsx(F,{title:"Structure",children:e.jsx("div",{className:"flex flex-col gap-0",children:r.map(a=>e.jsxs("div",{className:"flex items-center justify-between py-[var(--spacing-1)] text-[length:var(--font-size-sm)]",children:[e.jsx("span",{className:"text-text-primary font-mono text-[11px] truncate max-w-[120px]",children:a.key}),e.jsx("span",{className:"text-text-placeholder text-[10px]",children:a.type})]},a.key))})})}function We(t){switch(t.slice(t.lastIndexOf(".")).toLowerCase()){case".json":return{Icon:M,bg:"rgba(184,149,64,0.10)",color:"var(--color-accent-yellow)"};case".md":return{Icon:C,bg:"rgba(91,141,184,0.10)",color:"var(--color-accent-blue)"};case".ndjson":return{Icon:te,bg:"rgba(200,134,58,0.10)",color:"var(--color-accent-orange, #C8863A)"};default:return{Icon:C,bg:"rgba(160,157,151,0.10)",color:"var(--color-text-tertiary)"}}}function ne({content:t,path:r,onNavigate:a,loading:s,error:i,title:o,subtitle:c}){const[n,l]=d.useState(!1);if(i)return e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("div",{role:"alert",className:"px-[var(--spacing-3)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] rounded-[var(--radius-default)]",style:{backgroundColor:"var(--color-status-bg-blocked)",color:"var(--color-status-blocked)",borderColor:"var(--color-status-blocked)"},children:i})});if(s)return e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("p",{className:"text-text-secondary text-[length:var(--font-size-sm)] animate-pulse",children:"Loading..."})});if(!r||t===null)return e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-secondary",children:[e.jsx("p",{className:"text-[length:var(--font-size-lg)] mb-[var(--spacing-2)]",children:"Select a file"}),e.jsx("p",{className:"text-[length:var(--font-size-sm)]",children:"Choose an artifact from the tree to view"})]});const x=r.includes("/")?r.slice(r.lastIndexOf("/")+1):r,{Icon:p,bg:u,color:f}=We(r);return e.jsxs("div",{className:"flex h-full overflow-hidden",children:[e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-3)] px-[24px] py-[10px] border-b border-border-divider shrink-0",children:[e.jsx("div",{className:"w-7 h-7 rounded-[var(--radius-default)] flex items-center justify-center shrink-0",style:{background:u,color:f},children:e.jsx(p,{size:14,strokeWidth:1.8})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[c&&e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-text-tertiary font-medium truncate",children:c}),e.jsx("div",{className:"text-[14px] font-[var(--font-weight-bold)] text-text-primary truncate",children:o??x}),e.jsx("div",{className:"text-[10px] font-mono text-text-tertiary truncate",children:r})]}),e.jsxs("div",{className:"flex gap-[var(--spacing-1)]",children:[e.jsx("button",{type:"button",onClick:()=>l(!1),className:["px-[10px] py-[var(--spacing-1)] rounded-[var(--radius-default)] border text-[10px] font-[var(--font-weight-semibold)]","transition-all duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",n?"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary":"bg-text-primary text-bg-primary border-text-primary"].join(" "),children:"Rendered"}),e.jsx("button",{type:"button",onClick:()=>l(!0),className:["px-[10px] py-[var(--spacing-1)] rounded-[var(--radius-default)] border text-[10px] font-[var(--font-weight-semibold)]","transition-all duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",n?"bg-text-primary text-bg-primary border-text-primary":"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary"].join(" "),children:"Source"})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx("div",{className:"max-w-[720px] mx-auto px-[32px] py-[24px]",children:e.jsx(ae,{content:t,path:r,rawOverride:n})})})]}),e.jsx(Ae,{path:r,content:t})]})}function Me(t){const r=t.slice(t.lastIndexOf(".")).toLowerCase();switch(r){case".json":return"json";case".md":return"md";case".ndjson":return"jsonl";default:return r.replace(".","")||"file"}}function Re(t){switch(t){case"json":return{Icon:M,tintBg:"rgba(184,149,64,0.10)",iconColor:"var(--color-accent-yellow)",badgeBg:"rgba(184,149,64,0.12)",badgeColor:"var(--color-accent-yellow)"};case"md":return{Icon:C,tintBg:"rgba(91,141,184,0.10)",iconColor:"var(--color-accent-blue)",badgeBg:"rgba(91,141,184,0.12)",badgeColor:"var(--color-accent-blue)"};case"jsonl":return{Icon:te,tintBg:"rgba(200,134,58,0.10)",iconColor:"var(--color-accent-orange, #C8863A)",badgeBg:"rgba(200,134,58,0.12)",badgeColor:"var(--color-accent-orange, #C8863A)"};default:return{Icon:C,tintBg:"rgba(160,157,151,0.10)",iconColor:"var(--color-text-tertiary)",badgeBg:"rgba(160,157,151,0.12)",badgeColor:"var(--color-text-tertiary)"}}}function Ve({name:t,path:r,isSelected:a,onClick:s}){const i=Me(t),o=Re(i),{Icon:c}=o,n=r.includes("/")?r.slice(0,r.lastIndexOf("/")):"";return e.jsxs("button",{type:"button",onClick:s,className:["bg-bg-card border rounded-[var(--radius-lg)] p-[14px_16px] cursor-pointer text-left w-full","transition-all duration-[180ms] ease-[var(--ease-spring)]","flex flex-col gap-[var(--spacing-2)]","hover:-translate-y-[2px] hover:shadow-[0_6px_20px_rgba(0,0,0,0.06)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",a?"border-accent-purple shadow-[0_0_0_2px_rgba(145,120,181,0.2)]":"border-border-divider hover:border-border"].join(" "),children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-md)] flex items-center justify-center shrink-0",style:{background:o.tintBg,color:o.iconColor},children:e.jsx(c,{size:16,strokeWidth:1.8})}),e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary flex-1 truncate",children:t}),e.jsx("span",{className:"text-[9px] font-[var(--font-weight-semibold)] px-[5px] py-[1px] rounded-[var(--radius-sm)] uppercase font-mono shrink-0",style:{background:o.badgeBg,color:o.badgeColor},children:i})]}),e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary leading-[1.5] line-clamp-3 min-h-[48px]",children:r}),n&&e.jsx("div",{className:"flex items-center gap-[var(--spacing-1-5)] pt-[var(--spacing-1)] border-t border-border-divider",children:e.jsx("span",{className:"text-[10px] text-text-placeholder font-mono truncate",children:n})})]})}function ie(t,r=""){const a=[];for(const s of t)s.type==="file"?a.push({name:s.name,path:s.path,group:r||"root"}):s.children&&a.push(...ie(s.children,s.name));return a}function Pe(t){const r=new Map;for(const a of t){const s=r.get(a.group)||[];s.push(a),r.set(a.group,s)}return r}const Be=["All","json","md","jsonl"];function Je(t){if(t==="root"||!t.match(/^\d{2}-/))return{dotColor:"var(--color-text-tertiary)"};const r=t.toLowerCase();return r.includes("setup")||r.includes("complete")||r.includes("init")?{dotColor:"var(--color-status-completed)",statusLabel:"Done",statusBg:"var(--color-status-bg-completed)",statusColor:"var(--color-status-completed)"}:{dotColor:"var(--color-accent-yellow)",statusLabel:"Active",statusBg:"var(--color-status-bg-executing)",statusColor:"var(--color-status-executing)"}}function De({tree:t,onSelectFile:r,selectedPath:a}){const[s,i]=d.useState(""),[o,c]=d.useState("All"),n=d.useMemo(()=>ie(t),[t]),l=d.useMemo(()=>{let p=n;if(s.trim()){const u=s.toLowerCase();p=p.filter(f=>f.name.toLowerCase().includes(u)||f.path.toLowerCase().includes(u))}return o!=="All"&&(p=p.filter(u=>{const f=u.name.slice(u.name.lastIndexOf(".")).toLowerCase();return o==="json"?f===".json":o==="md"?f===".md":o==="jsonl"?f===".ndjson"||f===".jsonl":!0})),p},[n,s,o]),x=d.useMemo(()=>Pe(l),[l]);return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[24px] py-[10px] border-b border-border-divider shrink-0",children:[e.jsxs("div",{className:["flex items-center gap-[var(--spacing-1-5)] px-[var(--spacing-3)] py-[5px] rounded-[var(--radius-md)]","bg-bg-card border border-border w-[200px]","focus-within:border-accent-purple transition-colors duration-[var(--duration-fast)]"].join(" "),children:[e.jsx(X,{size:13,strokeWidth:2,className:"text-text-placeholder shrink-0"}),e.jsx("input",{type:"search",value:s,onChange:p=>i(p.target.value),placeholder:"Search artifacts...","aria-label":"Search artifacts",className:"border-none bg-transparent outline-none text-[12px] text-text-primary placeholder:text-text-placeholder w-full font-[inherit]"})]}),e.jsx("div",{className:"flex-1"}),Be.map(p=>e.jsx("button",{type:"button",onClick:()=>c(p),className:["text-[11px] font-[var(--font-weight-medium)] px-[var(--spacing-3)] py-[var(--spacing-1)] rounded-full","border transition-all duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",o===p?"bg-text-primary text-bg-primary border-text-primary":"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary"].join(" "),children:p==="All"?"All":p.toUpperCase()},p))]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-[24px] py-[var(--spacing-4)]",children:l.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[length:var(--font-size-sm)]",children:"No artifacts found"}):Array.from(x.entries()).map(([p,u])=>{const f=Je(p);return e.jsxs("div",{className:"mb-[24px]",children:[e.jsxs("div",{className:"flex items-center gap-[10px] mb-[10px] pl-[var(--spacing-1)]",children:[e.jsx("span",{className:"w-[10px] h-[10px] rounded-full shrink-0",style:{background:f.dotColor}}),e.jsx("span",{className:"text-[13px] font-[var(--font-weight-bold)] text-text-primary",children:p==="root"?"Project":p}),f.statusLabel&&e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[2px] rounded-full",style:{background:f.statusBg,color:f.statusColor},children:f.statusLabel}),e.jsxs("span",{className:"text-[11px] text-text-tertiary",children:[u.length," file",u.length!==1?"s":""]}),e.jsx("div",{className:"flex-1 h-px bg-border-divider ml-[var(--spacing-2)]"})]}),e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-[10px]",children:u.map(g=>e.jsx(Ve,{name:g.name,path:g.path,type:g.name.slice(g.name.lastIndexOf(".")),isSelected:g.path===a,onClick:()=>r(g.path)},g.path))})]},p)})})]})}function Ke({content:t,path:r}){const[a,s]=d.useState(!1);if(!r||t===null)return e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-secondary",children:[e.jsx("p",{className:"text-[length:var(--font-size-lg)] mb-[var(--spacing-2)]",children:"Select a file"}),e.jsx("p",{className:"text-[length:var(--font-size-sm)]",children:"Choose a JSON artifact to view its structure"})]});const o=r.slice(r.lastIndexOf(".")).toLowerCase()===".json",c=r.includes("/")?r.slice(r.lastIndexOf("/")+1):r;return o?e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsx(H,{fileName:c,path:r,isJson:!0,rawMode:a,onToggle:()=>s(n=>!n)}),e.jsx("div",{className:"flex-1 overflow-y-auto px-[24px] py-[20px]",children:e.jsx("div",{className:"max-w-[780px] mx-auto",children:a?e.jsx(le,{content:t}):e.jsx(He,{content:t})})})]}):e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsx(H,{fileName:c,path:r,isJson:!1,rawMode:!1,onToggle:()=>{}}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(ae,{content:t,path:r})})]})}function H({fileName:t,path:r,isJson:a,rawMode:s,onToggle:i}){const o=a?M:C,c=a?"rgba(184,149,64,0.10)":"rgba(91,141,184,0.10)",n=a?"var(--color-accent-yellow)":"var(--color-accent-blue)";return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-3)] px-[24px] py-[10px] border-b border-border-divider shrink-0",children:[e.jsx("div",{className:"w-7 h-7 rounded-[var(--radius-default)] flex items-center justify-center shrink-0",style:{background:c,color:n},children:e.jsx(o,{size:14,strokeWidth:1.8})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[14px] font-[var(--font-weight-bold)] text-text-primary truncate",children:t}),e.jsx("div",{className:"text-[10px] font-mono text-text-tertiary truncate",children:r})]}),a&&e.jsxs("div",{className:"flex gap-[var(--spacing-1)]",children:[e.jsx("button",{type:"button",onClick:i,className:["px-[10px] py-[var(--spacing-1)] rounded-[var(--radius-default)] border text-[10px] font-[var(--font-weight-semibold)]","transition-all duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",s?"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary":"bg-text-primary text-bg-primary border-text-primary"].join(" "),children:"Structured"}),e.jsx("button",{type:"button",onClick:i,className:["px-[10px] py-[var(--spacing-1)] rounded-[var(--radius-default)] border text-[10px] font-[var(--font-weight-semibold)]","transition-all duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",s?"bg-text-primary text-bg-primary border-text-primary":"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary"].join(" "),children:"Raw"})]})]})}function He({content:t}){const r=d.useMemo(()=>{try{return JSON.parse(t)}catch{return null}},[t]);if(!r||typeof r!="object")return e.jsx(le,{content:t});if(Array.isArray(r))return e.jsx("div",{className:"flex flex-col gap-[var(--spacing-4)]",children:r.map((s,i)=>e.jsx(A,{title:`Item ${i+1}`,data:s},i))});const a=Object.entries(r);return e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-4)]",children:[a.map(([s,i])=>Array.isArray(i)&&i.length>0&&typeof i[0]=="object"?e.jsxs("div",{children:[e.jsx(L,{title:s,badge:`${i.length}`}),e.jsx("div",{className:"flex flex-col gap-[var(--spacing-1-5)]",children:i.map((o,c)=>qe(o)?e.jsx(Ue,{data:o},c):Ye(o)?e.jsx(Ze,{data:o},c):e.jsx(A,{title:`#${c+1}`,data:o},c))})]},s):typeof i=="object"&&i!==null&&!Array.isArray(i)?e.jsx(A,{title:s,data:i},s):null),e.jsx(Ge,{data:r})]})}function L({title:t,badge:r}){return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] mb-[var(--spacing-2)] pb-[var(--spacing-1-5)] border-b border-border-divider",children:[e.jsx("span",{className:"text-[11px] font-[var(--font-weight-bold)] uppercase tracking-[0.06em] text-text-tertiary",children:t}),r&&e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-1-5)] py-[1px] rounded-full",style:{background:"rgba(91,141,184,0.12)",color:"var(--color-accent-blue)"},children:r})]})}function A({title:t,data:r}){if(typeof r!="object"||r===null)return e.jsxs("div",{children:[e.jsx(L,{title:t}),e.jsx("div",{className:"text-[13px] text-text-primary",children:String(r)})]});const a=Object.entries(r);return e.jsxs("div",{children:[e.jsx(L,{title:t}),e.jsx("div",{className:"flex flex-col",children:a.map(([s,i])=>e.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-[var(--spacing-3)] py-[var(--spacing-1-5)] border-b border-border-divider last:border-b-0 items-start",children:[e.jsx("span",{className:"text-[11px] font-[var(--font-weight-semibold)] text-text-tertiary font-mono pt-[1px]",children:s}),e.jsx(oe,{value:i})]},s))})]})}function oe({value:t}){return t==null?e.jsx("span",{className:"text-[13px] text-text-placeholder italic",children:"null"}):typeof t=="boolean"?e.jsxs("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[2px] rounded-full inline-flex items-center gap-[var(--spacing-1)]",style:{background:t?"rgba(90,158,120,0.12)":"rgba(160,157,151,0.12)",color:t?"var(--color-status-completed)":"var(--color-text-tertiary)"},children:[t?e.jsx($,{size:10,strokeWidth:2.5}):e.jsx(re,{size:10,strokeWidth:2.5}),String(t)]}):typeof t=="number"?e.jsx("span",{className:"text-[13px] font-mono text-accent-blue",children:t}):typeof t=="string"?/^(completed|done|passed|active|success)$/i.test(t)?e.jsxs("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[2px] rounded-full inline-flex items-center gap-[var(--spacing-1)]",style:{background:"rgba(90,158,120,0.12)",color:"var(--color-status-completed)"},children:[e.jsx($,{size:10,strokeWidth:2.5}),t]}):/^(blocked|failed|error)$/i.test(t)?e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[2px] rounded-full",style:{background:"var(--color-status-bg-blocked)",color:"var(--color-status-blocked)"},children:t}):/^(in.?progress|running|executing)$/i.test(t)?e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[2px] rounded-full",style:{background:"rgba(91,141,184,0.12)",color:"var(--color-accent-blue)"},children:t}):e.jsx("span",{className:"text-[13px] text-text-primary",children:t}):Array.isArray(t)?t.length===0?e.jsx("span",{className:"text-[13px] text-text-placeholder italic",children:"[]"}):t.every(r=>typeof r=="string")?e.jsx("div",{className:"flex flex-wrap gap-[var(--spacing-1)]",children:t.map((r,a)=>e.jsx("span",{className:"text-[11px] px-[var(--spacing-2)] py-[2px] rounded-[var(--radius-default)] bg-bg-secondary text-text-secondary",children:String(r)},a))}):e.jsxs("span",{className:"text-[13px] font-mono text-text-secondary",children:["[",t.length," items]"]}):typeof t=="object"?e.jsx("span",{className:"text-[13px] font-mono text-text-secondary",children:JSON.stringify(t)}):e.jsx("span",{className:"text-[13px] text-text-primary",children:String(t)})}function Ge({data:t}){const r=Object.entries(t).filter(([,a])=>typeof a!="object"||a===null);return r.length===0?null:e.jsxs("div",{children:[e.jsx(L,{title:"Properties"}),e.jsx("div",{className:"flex flex-col",children:r.map(([a,s])=>e.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-[var(--spacing-3)] py-[var(--spacing-1-5)] border-b border-border-divider last:border-b-0 items-start",children:[e.jsx("span",{className:"text-[11px] font-[var(--font-weight-semibold)] text-text-tertiary font-mono pt-[1px]",children:a}),e.jsx(oe,{value:s})]},a))})]})}function qe(t){if(typeof t!="object"||t===null)return!1;const r=t;return"severity"in r||"gap_id"in r||"type"in r}function Ue({data:t}){const r=String(t.gap_id||t.id||""),a=String(t.severity||"medium"),s=String(t.type||""),i=String(t.description||t.claim||""),o=String(t.suggested_fix||t.fix||""),c={critical:{bg:"rgba(196,101,85,0.20)",color:"var(--color-status-blocked)"},high:{bg:"rgba(200,134,58,0.20)",color:"var(--color-accent-orange, #C8863A)"},medium:{bg:"rgba(184,149,64,0.20)",color:"var(--color-accent-yellow)"},low:{bg:"rgba(91,141,184,0.20)",color:"var(--color-accent-blue)"}},n=c[a.toLowerCase()]||c.medium;return e.jsxs("div",{className:"p-[10px_14px] rounded-[10px] border-l-[3px] mb-[var(--spacing-1-5)]",style:{borderLeftColor:"var(--color-status-blocked)",background:"var(--color-status-bg-blocked)"},children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)] mb-[var(--spacing-1)]",children:[r&&e.jsx("span",{className:"text-[10px] font-[var(--font-weight-bold)] font-mono",style:{color:"var(--color-status-blocked)"},children:r}),e.jsx("span",{className:"text-[9px] font-[var(--font-weight-bold)] px-[5px] py-[1px] rounded-[var(--radius-sm)] uppercase",style:{background:n.bg,color:n.color},children:a}),s&&e.jsx("span",{className:"text-[10px] text-text-tertiary ml-auto font-mono",children:s})]}),i&&e.jsx("p",{className:"text-[13px] text-text-primary mb-[var(--spacing-1)]",children:i}),o&&e.jsxs("p",{className:"text-[length:var(--font-size-sm)] text-text-secondary italic",children:[e.jsx("strong",{className:"font-[var(--font-weight-semibold)] not-italic text-text-tertiary text-[10px] uppercase",children:"Fix: "}),o]})]})}function Ye(t){if(typeof t!="object"||t===null)return!1;const r=t;return("claim"in r||"check"in r)&&!("severity"in r)}function Ze({data:t}){const r=String(t.claim||t.check||t.description||""),a=String(t.evidence||t.detail||""),s=t.passed===!0||t.status==="passed"||t.status==="completed";return e.jsxs("div",{className:"flex items-start gap-[var(--spacing-2)] p-[var(--spacing-2)_var(--spacing-3)] rounded-[var(--radius-md)] bg-bg-card border border-border-divider",children:[s?e.jsx($,{size:16,strokeWidth:2,className:"shrink-0 mt-[1px]",style:{color:"var(--color-status-completed)"}}):e.jsx(re,{size:16,strokeWidth:2,className:"shrink-0 mt-[1px] text-text-placeholder"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-[13px] text-text-primary font-[var(--font-weight-medium)]",children:r}),a&&e.jsx("p",{className:"text-[11px] text-text-tertiary mt-[2px] italic",children:a})]})]})}function le({content:t}){const r=d.useMemo(()=>{try{return JSON.stringify(JSON.parse(t),null,2)}catch{return t}},[t]);return e.jsx("pre",{className:["rounded-[10px] p-[16px_20px] font-mono text-[11px] leading-[1.6] overflow-x-auto","bg-[#2C2723] text-[#D9D0C4] border border-[#3D3731]"].join(" "),children:r})}const m=xe((t,r)=>({entries:[],byId:{},loading:!1,error:null,typeFilter:"all",tagFilter:"all",categoryFilter:"all",statusFilter:"all",search:"",selectedId:null,backlinksCache:{},health:null,graph:null,setTypeFilter:a=>t({typeFilter:a}),setTagFilter:a=>t({tagFilter:a}),setCategoryFilter:a=>t({categoryFilter:a}),setStatusFilter:a=>t({statusFilter:a}),setSearch:a=>t({search:a}),setSelected:a=>{t({selectedId:a}),a&&!r().backlinksCache[a]&&r().fetchBacklinks(a)},fetchEntries:async()=>{t({loading:!0,error:null});try{const{search:a}=r(),s=a?`${j.WIKI}?q=${encodeURIComponent(a)}`:j.WIKI,i=await fetch(s);if(!i.ok)throw new Error(`Failed: ${i.status}`);const c=(await i.json()).entries??[],n={};for(const l of c)n[l.id]=l;t({entries:c,byId:n,loading:!1})}catch(a){t({loading:!1,error:String(a)})}},fetchBacklinks:async a=>{try{const s=j.WIKI_BACKLINKS.replace(":id",encodeURIComponent(a)),i=await fetch(s);if(!i.ok)return;const o=await i.json();t(c=>({backlinksCache:{...c.backlinksCache,[a]:o.backlinks??[]}}))}catch{}},fetchHealth:async()=>{try{const a=await fetch(j.WIKI_HEALTH);if(!a.ok)return;const s=await a.json();t({health:s})}catch{}},fetchGraph:async()=>{try{const a=await fetch(j.WIKI_GRAPH);if(!a.ok)return;const s=await a.json();t({graph:s})}catch{}},createEntry:async a=>{const s=await fetch(j.WIKI,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(a)});if(!s.ok){const o=await s.json().catch(()=>({}));throw new Error(o.error??`create failed: ${s.status}`)}const i=await s.json();return await r().fetchEntries(),i.entry},updateEntry:async(a,s)=>{const i=j.WIKI_DETAIL.replace(":id",encodeURIComponent(a)),o=await fetch(i,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(s)});if(!o.ok){const n=await o.json().catch(()=>({}));throw new Error(n.error??`update failed: ${o.status}`)}const c=await o.json();return await r().fetchEntries(),c.entry},removeEntry:async a=>{const s=j.WIKI_DETAIL.replace(":id",encodeURIComponent(a)),i=await fetch(s,{method:"DELETE"});if(!i.ok){const o=await i.json().catch(()=>({}));throw new Error(o.error??`delete failed: ${i.status}`)}await r().fetchEntries()},filteredEntries:()=>{const{entries:a,typeFilter:s,tagFilter:i,categoryFilter:o,statusFilter:c}=r();return a.filter(n=>!(s!=="all"&&n.type!==s||i!=="all"&&!n.tags.includes(i)||o!=="all"&&n.category!==o||c!=="all"&&n.status!==c))},entriesByType:()=>{const a=r().filteredEntries(),s={project:[],roadmap:[],spec:[],issue:[],knowhow:[],note:[]};for(const i of a)s[i.type].push(i);return s},allTags:()=>{const a=new Set;for(const s of r().entries)for(const i of s.tags)a.add(i);return Array.from(a).sort()}})),Xe={project:"Project",roadmap:"Roadmap",spec:"Specs",issue:"Issues",knowhow:"KnowHow",note:"Notes"},G={project:"var(--color-accent-blue, #3b82f6)",roadmap:"var(--color-accent-purple, #8b5cf6)",spec:"var(--color-accent-green, #16a34a)",issue:"var(--color-accent-red, #dc2626)",knowhow:"var(--color-accent-cyan, #0891b2)",note:"var(--color-text-tertiary, #9ca3af)"},Qe=["project","roadmap","spec","issue","knowhow","note"];function et(t){return t.replace(/^#{1,6}\s+/,"").trim()}function tt(){const t=m(l=>l.entries),r=m(l=>l.typeFilter),a=m(l=>l.tagFilter),s=m(l=>l.categoryFilter),i=m(l=>l.statusFilter),o=m(l=>l.selectedId),c=m(l=>l.setSelected),n=d.useMemo(()=>{const l={project:[],roadmap:[],spec:[],issue:[],knowhow:[],note:[]};for(const x of t)r!=="all"&&x.type!==r||a!=="all"&&!x.tags.includes(a)||s!=="all"&&x.category!==s||i!=="all"&&x.status!==i||l[x.type].push(x);return l},[t,r,a,s,i]);return e.jsx("div",{className:"flex flex-col gap-1 py-1 overflow-y-auto h-full",children:Qe.map(l=>{const x=n[l];return!x||x.length===0?null:e.jsxs("section",{className:"px-2",children:[e.jsxs("h3",{className:"flex items-center gap-1.5 px-1 py-1.5 text-[10px] text-text-tertiary uppercase tracking-wider font-semibold",children:[e.jsx("span",{className:"inline-block w-[6px] h-[6px] rounded-full shrink-0",style:{backgroundColor:G[l]}}),Xe[l],e.jsx("span",{className:"text-text-quaternary font-normal ml-0.5",children:x.length})]}),e.jsx("ul",{className:"flex flex-col gap-px",children:x.map(p=>e.jsx(rt,{entry:p,typeColor:G[p.type],selected:p.id===o,onSelect:()=>c(p.id)},p.id))})]},l)})})}function rt({entry:t,typeColor:r,selected:a,onSelect:s}){return e.jsx("li",{children:e.jsx("button",{type:"button",onClick:s,className:`w-full text-left rounded-[var(--radius-md,6px)] px-2.5 py-2 transition-all ${a?"bg-bg-secondary shadow-[inset_0_0_0_1px_var(--color-border-strong)]":"hover:bg-bg-secondary"}`,style:a?{borderLeft:`2px solid ${r}`,paddingLeft:"8px"}:void 0,children:e.jsxs("div",{className:"flex items-start gap-1.5",children:[!a&&e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full shrink-0 mt-[5px]",style:{backgroundColor:r,opacity:.6}}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-medium text-text-primary text-[length:var(--font-size-sm)] truncate leading-snug",children:t.title}),t.summary&&e.jsx("div",{className:"text-text-tertiary text-[11px] line-clamp-1 mt-0.5 leading-snug",children:et(t.summary)}),t.tags.length>0&&e.jsxs("div",{className:"mt-1 flex flex-wrap gap-1",children:[t.tags.slice(0,3).map(i=>e.jsx("span",{className:"px-1 py-px text-[10px] rounded bg-bg-tertiary text-text-tertiary leading-snug",children:i},i)),t.tags.length>3&&e.jsxs("span",{className:"text-[10px] text-text-quaternary",children:["+",t.tags.length-3]})]})]})]})})})}function st(t){const r=t.split(`
|
|
19
19
|
`);let a=!1;const s=[];for(const i of r){if(/^```/.test(i.trim())){a=!a,s.push(i);continue}if(a){s.push(i);continue}s.push(i.replace(/\[\[([^\]]+)\]\]/g,(o,c)=>`[${c}](wiki:${c})`))}return s.join(`
|
|
20
20
|
`)}function at(t){return t.replace(/^#{1,6}\s+/,"").trim()}function nt(){const t=m(n=>n.selectedId),r=m(n=>n.byId),a=m(n=>n.backlinksCache);m(n=>n.setSelected);const s=t?r[t]:void 0,i=t?a[t]??[]:[],o=d.useMemo(()=>{if(!s)return null;const n=[];if(s.summary&&(n.push(`> ${at(s.summary)}`),n.push("")),s.tags.length>0&&(n.push(s.tags.map(l=>`\`${l}\``).join(" ")),n.push("")),s.category&&(n.push(`**Category:** ${s.category}`),n.push("")),n.push("---"),n.push(""),s.body&&s.source.kind==="file"&&(n.push(st(s.body)),n.push("")),s.source.kind==="virtual"&&s.raw!==void 0&&(n.push("## Raw"),n.push("```json"),n.push(JSON.stringify(s.raw,null,2)),n.push("```"),n.push("")),Object.keys(s.ext).length>0&&(n.push("## Metadata"),n.push("```json"),n.push(JSON.stringify(s.ext,null,2)),n.push("```"),n.push("")),i.length>0){n.push(`## Backlinks (${i.length})`);for(const l of i)n.push(`- **${l.title}** _${l.type}_`);n.push("")}return n.join(`
|
|
21
|
-
`)},[s,i]);if(!t)return e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[length:var(--font-size-sm)]",children:"Select an entry"});if(!s)return e.jsx("div",{className:"p-4 text-text-tertiary text-[length:var(--font-size-sm)]",children:"Entry not found."});const c=s.source.path+(s.source.line!==void 0?`:${s.source.line}`:"");return e.jsx(ne,{content:o,path:c,onNavigate:()=>{},loading:!1,error:null,title:s.title,subtitle:`${s.type.toUpperCase()} · ${s.status.toUpperCase()}`})}function it(){const{health:t,fetchHealth:r,setSelected:a,byId:s}=m(Q(n=>({health:n.health,fetchHealth:n.fetchHealth,setSelected:n.setSelected,byId:n.byId}))),[i,o]=d.useState(!1);if(d.useEffect(()=>{r()},[r]),!t)return e.jsx("div",{className:"px-3 py-2 text-[length:var(--font-size-xs)] text-text-tertiary border-b border-border",children:"Loading health…"});const c=t.score>=80?"var(--color-accent-green, #16a34a)":t.score>=50?"var(--color-accent-yellow, #ca8a04)":"var(--color-accent-red, #dc2626)";return e.jsxs("div",{className:"border-b border-border",children:[e.jsxs("button",{type:"button",onClick:()=>o(!i),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-bg-secondary transition-colors",children:[e.jsx(ee,{size:12,strokeWidth:2,className:"text-text-tertiary transition-transform shrink-0",style:{transform:i?"rotate(90deg)":void 0}}),e.jsx(pe,{size:12,strokeWidth:2,className:"text-text-tertiary shrink-0"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary font-medium",children:"Health"}),e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-semibold ml-auto",style:{color:c},children:t.score}),e.jsxs("div",{className:"flex gap-2 text-[length:var(--font-size-xs)] text-text-tertiary",children:[e.jsxs("span",{children:[t.totals.entries," entries"]}),t.totals.orphans>0&&e.jsxs("span",{children:["· ",t.totals.orphans," orphans"]}),t.totals.brokenLinks>0&&e.jsxs("span",{className:"text-accent-red",children:["· ",t.totals.brokenLinks," broken"]})]})]}),i&&e.jsxs("div",{className:"px-3 pb-2 flex flex-col gap-2 text-[length:var(--font-size-xs)]",children:[t.hubs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"uppercase tracking-wider text-text-tertiary mb-1 text-[10px]",children:"Top hubs"}),e.jsx("ul",{className:"flex flex-col gap-0.5",children:t.hubs.slice(0,5).map(n=>{var l;return e.jsxs("li",{className:"flex justify-between gap-2",children:[e.jsx("button",{type:"button",onClick:()=>a(n.id),className:"truncate text-accent-blue hover:underline text-left",children:((l=s[n.id])==null?void 0:l.title)??n.id}),e.jsx("span",{className:"text-text-tertiary shrink-0",children:n.inDegree})]},n.id)})})]}),t.orphans.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"uppercase tracking-wider text-text-tertiary mb-1 text-[10px]",children:["Orphans (",t.orphans.length,")"]}),e.jsx("ul",{className:"flex flex-wrap gap-1 max-h-16 overflow-y-auto",children:t.orphans.slice(0,10).map(n=>{var l;return e.jsx("li",{children:e.jsx("button",{type:"button",onClick:()=>a(n),className:"px-1.5 py-0.5 rounded bg-bg-tertiary text-text-secondary hover:text-accent-blue hover:underline transition-colors",children:((l=s[n])==null?void 0:l.title)??n})},n)})})]}),t.brokenLinks.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"uppercase tracking-wider text-text-tertiary mb-1 text-[10px]",children:["Broken (",t.brokenLinks.length,")"]}),e.jsx("ul",{className:"flex flex-col gap-0.5 max-h-16 overflow-y-auto text-text-secondary",children:t.brokenLinks.slice(0,5).map((n,l)=>e.jsxs("li",{className:"truncate",children:[e.jsx("span",{className:"text-text-tertiary",children:n.sourceId})," → ",e.jsx("span",{className:"line-through",children:n.target})]},`${n.sourceId}-${l}`))})]})]})]})}const ot={project:"var(--color-accent-blue, #3b82f6)",roadmap:"var(--color-accent-purple, #8b5cf6)",spec:"var(--color-accent-green, #16a34a)",issue:"var(--color-accent-red, #dc2626)",knowhow:"var(--color-accent-cyan, #0891b2)",note:"var(--color-text-tertiary, #9ca3af)"};function lt(t){return t.replace(/^#{1,6}\s+/,"").trim()}function ct(){const t=m(l=>l.entries),r=m(l=>l.typeFilter),a=m(l=>l.tagFilter),s=m(l=>l.categoryFilter),i=m(l=>l.statusFilter),o=m(l=>l.setSelected),c=m(l=>l.selectedId),n=d.useMemo(()=>t.filter(l=>!(r!=="all"&&l.type!==r||a!=="all"&&!l.tags.includes(a)||s!=="all"&&l.category!==s||i!=="all"&&l.status!==i)),[t,r,a,s,i]);return n.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[length:var(--font-size-sm)]",children:"No entries match the current filters"}):e.jsx("div",{className:"p-4 overflow-y-auto h-full",children:e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-3",children:n.map(l=>e.jsx(dt,{entry:l,selected:l.id===c,onSelect:()=>o(l.id)},l.id))})})}function dt({entry:t,selected:r,onSelect:a}){const s=ot[t.type];return e.jsxs("button",{type:"button",onClick:a,className:`text-left rounded-[var(--radius-md,6px)] border p-3 transition-all flex flex-col gap-1.5 ${r?"border-border-strong bg-bg-secondary shadow-sm":"border-border bg-bg-primary hover:bg-bg-secondary hover:border-border-strong"}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"inline-block w-[6px] h-[6px] rounded-full shrink-0",style:{backgroundColor:s}}),e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-text-tertiary font-medium",children:t.type}),e.jsx("span",{className:"text-[10px] text-text-quaternary ml-auto",children:t.status})]}),e.jsx("div",{className:"font-medium text-text-primary text-[length:var(--font-size-sm)] leading-snug line-clamp-2",children:t.title}),t.summary&&e.jsx("div",{className:"text-text-tertiary text-[11px] line-clamp-2 leading-snug",children:lt(t.summary)}),t.tags.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1 mt-0.5",children:[t.tags.slice(0,4).map(i=>e.jsx("span",{className:"px-1 py-px text-[10px] rounded bg-bg-tertiary text-text-tertiary",children:i},i)),t.tags.length>4&&e.jsxs("span",{className:"text-[10px] text-text-quaternary",children:["+",t.tags.length-4]})]}),e.jsx("div",{className:"text-[10px] text-text-quaternary font-mono truncate mt-auto pt-1",children:t.source.path})]})}const xt={project:"#3b82f6",roadmap:"#8b5cf6",spec:"#16a34a",issue:"#dc2626",knowhow:"#0891b2",note:"#9ca3af"};function pt(){const t=m(o=>o.fetchGraph),r=m(o=>o.graph),a=m(o=>o.byId),s=m(o=>o.setSelected);d.useEffect(()=>{t()},[t]);const i=d.useMemo(()=>{if(!r)return[];const o=new Map;for(const[c,n]of Object.entries(r.forwardLinks)){o.has(c)||o.set(c,{out:0,in:0}),o.get(c).out=n.length;for(const l of n)o.has(l)||o.set(l,{out:0,in:0}),o.get(l).in+=1}return Array.from(o.entries()).map(([c,n])=>{var l,x;return{id:c,title:((l=a[c])==null?void 0:l.title)??c,type:(x=a[c])==null?void 0:x.type,outDegree:n.out,inDegree:n.in,total:n.out+n.in}}).sort((c,n)=>n.total-c.total)},[r,a]);return r?e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-4 px-4 py-2.5 border-b border-border text-[length:var(--font-size-xs)] text-text-secondary",children:[e.jsxs("span",{children:[i.length," connected nodes"]}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[Object.values(r.forwardLinks).reduce((o,c)=>o+c.length,0)," links"]}),r.brokenLinks.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{className:"text-accent-red",children:[r.brokenLinks.length," broken"]})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e.jsxs("table",{className:"w-full text-[length:var(--font-size-sm)]",children:[e.jsx("thead",{className:"sticky top-0 bg-bg-primary z-10",children:e.jsxs("tr",{className:"border-b border-border text-[10px] uppercase tracking-wider text-text-tertiary",children:[e.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Entry"}),e.jsx("th",{className:"text-left px-3 py-2 font-medium w-16",children:"Type"}),e.jsx("th",{className:"text-center px-3 py-2 font-medium w-16",children:"Out"}),e.jsx("th",{className:"text-center px-3 py-2 font-medium w-16",children:"In"})]})}),e.jsx("tbody",{children:i.map(o=>e.jsxs("tr",{className:"border-b border-border hover:bg-bg-secondary transition-colors cursor-pointer",onClick:()=>s(o.id),children:[e.jsx("td",{className:"px-4 py-2",children:e.jsxs("div",{className:"flex items-center gap-2",children:[o.type&&e.jsx("span",{className:"inline-block w-[6px] h-[6px] rounded-full shrink-0",style:{backgroundColor:xt[o.type]??"#9ca3af"}}),e.jsx("span",{className:"text-text-primary truncate",children:o.title})]})}),e.jsx("td",{className:"px-3 py-2 text-text-tertiary text-[length:var(--font-size-xs)]",children:o.type??"—"}),e.jsx("td",{className:"px-3 py-2 text-center",children:o.outDegree>0?e.jsx("span",{className:"text-accent-blue font-medium",children:o.outDegree}):e.jsx("span",{className:"text-text-quaternary",children:"0"})}),e.jsx("td",{className:"px-3 py-2 text-center",children:o.inDegree>0?e.jsx("span",{className:"text-accent-green font-medium",children:o.inDegree}):e.jsx("span",{className:"text-text-quaternary",children:"0"})})]},o.id))})]}),r.brokenLinks.length>0&&e.jsxs("div",{className:"p-4 border-t border-border",children:[e.jsxs("h3",{className:"text-[10px] uppercase tracking-wider text-text-tertiary font-medium mb-2",children:["Broken Links (",r.brokenLinks.length,")"]}),e.jsx("ul",{className:"flex flex-col gap-1 text-[length:var(--font-size-xs)]",children:r.brokenLinks.map((o,c)=>{var n;return e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>s(o.sourceId),className:"text-accent-blue hover:underline truncate",children:((n=a[o.sourceId])==null?void 0:n.title)??o.sourceId}),e.jsx("span",{className:"text-text-quaternary",children:"→"}),e.jsx("span",{className:"text-text-tertiary line-through",children:o.target})]},`${o.sourceId}-${c}`)})})]})]})]}):e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[length:var(--font-size-sm)]",children:"Loading graph data…"})}const ut=[{label:"Reader",icon:e.jsx(C,{size:14,strokeWidth:2}),shortcut:"1"},{label:"Gallery",icon:e.jsx(Z,{size:14,strokeWidth:2}),shortcut:"2"},{label:"Structured",icon:e.jsx(me,{size:14,strokeWidth:2}),shortcut:"3"}],q=["reader","gallery","structured"],ft=[{label:"Reader",icon:e.jsx(he,{size:14,strokeWidth:2}),shortcut:"1"},{label:"Gallery",icon:e.jsx(Z,{size:14,strokeWidth:2}),shortcut:"2"},{label:"Graph",icon:e.jsx(we,{size:14,strokeWidth:2}),shortcut:"3"}],U=["reader","gallery","graph"],ht=[{value:"all",label:"All"},{value:"project",label:"Project"},{value:"roadmap",label:"Roadmap"},{value:"spec",label:"Specs"},{value:"issue",label:"Issues"},{value:"knowhow",label:"KnowHow"},{value:"note",label:"Notes"}],k={initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}};function Ft(){const[t,r]=d.useState("files"),[a,s]=d.useState("reader"),[i,o]=d.useState("reader"),{tree:c,selectedPath:n,content:l,loading:x,treeLoading:p,error:u,selectFile:f}=Se(),{fetchEntries:g,loading:b,error:y,entries:S,search:E,setSearch:R,typeFilter:ce,setTypeFilter:de}=m(Q(h=>({fetchEntries:h.fetchEntries,loading:h.loading,error:h.error,entries:h.entries,search:h.search,setSearch:h.setSearch,typeFilter:h.typeFilter,setTypeFilter:h.setTypeFilter})));d.useEffect(()=>{t==="wiki"&&g()},[t,g]),d.useEffect(()=>{if(t!=="wiki")return;const h=setTimeout(()=>void g(),200);return()=>clearTimeout(h)},[E,g,t]);const{register:V,unregister:P}=d.useContext(ue),B=d.useCallback(h=>{t==="files"?s(q[h]):o(U[h])},[t]);return d.useEffect(()=>{const h=t==="files"?ut:ft,v=t==="files"?q.indexOf(a):U.indexOf(i);V({items:h.map(z=>({label:z.label,icon:z.icon,shortcut:z.shortcut})),activeIndex:v,onSwitch:B})},[t,a,i,V,B]),d.useEffect(()=>()=>P(),[P]),d.useEffect(()=>{function h(v){v.target instanceof HTMLInputElement||v.target instanceof HTMLTextAreaElement||(t==="files"?v.key==="1"?s("reader"):v.key==="2"?s("gallery"):v.key==="3"&&s("structured"):v.key==="1"?o("reader"):v.key==="2"?o("gallery"):v.key==="3"&&o("graph"))}return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[t]),e.jsxs("div",{className:"flex h-full overflow-hidden",children:[e.jsxs("div",{className:"w-[272px] shrink-0 border-r border-border overflow-hidden flex flex-col bg-bg-primary",children:[e.jsxs("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-border shrink-0",children:[e.jsx(Y,{mode:"files",active:t==="files",icon:e.jsx(je,{size:13,strokeWidth:2}),label:"Files",onClick:()=>r("files")}),e.jsx(Y,{mode:"wiki",active:t==="wiki",icon:e.jsx(Ce,{size:13,strokeWidth:2}),label:"Wiki",onClick:()=>r("wiki")})]}),t==="files"?e.jsx(ge,{tree:c,selectedPath:n,onSelectFile:f,loading:p}):e.jsxs(e.Fragment,{children:[e.jsx(it,{}),e.jsxs("div",{className:"flex flex-col gap-2 px-3 py-2 border-b border-border",children:[e.jsxs("div",{className:"relative",children:[e.jsx(X,{size:13,strokeWidth:2,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-tertiary pointer-events-none"}),e.jsx("input",{type:"text",value:E,placeholder:"Search…",onChange:h=>R(h.target.value),className:"w-full pl-7 pr-7 py-1.5 bg-bg-secondary border border-border rounded-[var(--radius-md,6px)] text-[length:var(--font-size-sm)] text-text-primary placeholder:text-text-quaternary focus:outline-none focus:border-border-strong transition-colors"}),E&&e.jsx("button",{type:"button",onClick:()=>R(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-tertiary hover:text-text-secondary transition-colors",children:e.jsx(fe,{size:12,strokeWidth:2})})]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:ht.map(h=>e.jsx("button",{type:"button",onClick:()=>de(h.value),className:`px-2 py-0.5 rounded-[var(--radius-full,999px)] text-[10px] font-medium transition-all ${ce===h.value?"bg-text-primary text-bg-primary":"text-text-tertiary hover:text-text-secondary hover:bg-bg-secondary"}`,children:h.label},h.value))}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-text-quaternary",children:[e.jsxs("span",{children:[S.length," entr",S.length===1?"y":"ies"]}),b&&e.jsx("span",{className:"animate-pulse",children:"· loading…"}),y&&e.jsx("span",{className:"text-accent-red ml-1",children:y})]})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:e.jsx(tt,{})})]})]}),e.jsx("div",{className:"flex-1 overflow-hidden relative min-w-0",children:e.jsx(be,{mode:"wait",children:t==="files"?e.jsxs(e.Fragment,{children:[a==="reader"&&e.jsx(N.div,{className:"absolute inset-0 flex flex-col",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(ne,{content:l,path:n,onNavigate:f,loading:x,error:u})},"file-reader"),a==="gallery"&&e.jsx(N.div,{className:"absolute inset-0 flex flex-col",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(De,{tree:c,onSelectFile:f,selectedPath:n})},"file-gallery"),a==="structured"&&e.jsx(N.div,{className:"absolute inset-0 flex flex-col",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(Ke,{content:l,path:n})},"file-structured")]}):e.jsxs(e.Fragment,{children:[i==="reader"&&e.jsx(N.div,{className:"absolute inset-0",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.2},children:e.jsx(nt,{})},"wiki-reader"),i==="gallery"&&e.jsx(N.div,{className:"absolute inset-0",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.2},children:e.jsx(ct,{})},"wiki-gallery"),i==="graph"&&e.jsx(N.div,{className:"absolute inset-0",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.2},children:e.jsx(pt,{})},"wiki-graph")]})})})]})}function Y({active:t,icon:r,label:a,onClick:s}){return e.jsxs("button",{type:"button",onClick:s,className:["flex-1 flex items-center justify-center gap-1.5 px-2 py-1.5 rounded-[var(--radius-md,6px)]","text-[length:var(--font-size-sm)] font-medium transition-all duration-150",t?"bg-bg-active text-text-primary shadow-sm":"text-text-tertiary hover:text-text-secondary hover:bg-bg-hover"].join(" "),children:[r,e.jsx("span",{children:a})]})}export{Ft as ArtifactsPage};
|
|
21
|
+
`)},[s,i]);if(!t)return e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[length:var(--font-size-sm)]",children:"Select an entry"});if(!s)return e.jsx("div",{className:"p-4 text-text-tertiary text-[length:var(--font-size-sm)]",children:"Entry not found."});const c=s.source.path+(s.source.line!==void 0?`:${s.source.line}`:"");return e.jsx(ne,{content:o,path:c,onNavigate:()=>{},loading:!1,error:null,title:s.title,subtitle:`${s.type.toUpperCase()} · ${s.status.toUpperCase()}`})}function it(){const{health:t,fetchHealth:r,setSelected:a,byId:s}=m(Q(n=>({health:n.health,fetchHealth:n.fetchHealth,setSelected:n.setSelected,byId:n.byId}))),[i,o]=d.useState(!1);if(d.useEffect(()=>{r()},[r]),!t)return e.jsx("div",{className:"px-3 py-2 text-[length:var(--font-size-xs)] text-text-tertiary border-b border-border",children:"Loading health…"});const c=t.score>=80?"var(--color-accent-green, #16a34a)":t.score>=50?"var(--color-accent-yellow, #ca8a04)":"var(--color-accent-red, #dc2626)";return e.jsxs("div",{className:"border-b border-border",children:[e.jsxs("button",{type:"button",onClick:()=>o(!i),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-bg-secondary transition-colors",children:[e.jsx(ee,{size:12,strokeWidth:2,className:"text-text-tertiary transition-transform shrink-0",style:{transform:i?"rotate(90deg)":void 0}}),e.jsx(pe,{size:12,strokeWidth:2,className:"text-text-tertiary shrink-0"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary font-medium",children:"Health"}),e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-semibold ml-auto",style:{color:c},children:t.score}),e.jsxs("div",{className:"flex gap-2 text-[length:var(--font-size-xs)] text-text-tertiary",children:[e.jsxs("span",{children:[t.totals.entries," entries"]}),t.totals.orphans>0&&e.jsxs("span",{children:["· ",t.totals.orphans," orphans"]}),t.totals.brokenLinks>0&&e.jsxs("span",{className:"text-accent-red",children:["· ",t.totals.brokenLinks," broken"]})]})]}),i&&e.jsxs("div",{className:"px-3 pb-2 flex flex-col gap-2 text-[length:var(--font-size-xs)]",children:[t.hubs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"uppercase tracking-wider text-text-tertiary mb-1 text-[10px]",children:"Top hubs"}),e.jsx("ul",{className:"flex flex-col gap-0.5",children:t.hubs.slice(0,5).map(n=>{var l;return e.jsxs("li",{className:"flex justify-between gap-2",children:[e.jsx("button",{type:"button",onClick:()=>a(n.id),className:"truncate text-accent-blue hover:underline text-left",children:((l=s[n.id])==null?void 0:l.title)??n.id}),e.jsx("span",{className:"text-text-tertiary shrink-0",children:n.inDegree})]},n.id)})})]}),t.orphans.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"uppercase tracking-wider text-text-tertiary mb-1 text-[10px]",children:["Orphans (",t.orphans.length,")"]}),e.jsx("ul",{className:"flex flex-wrap gap-1 max-h-16 overflow-y-auto",children:t.orphans.slice(0,10).map(n=>{var l;return e.jsx("li",{children:e.jsx("button",{type:"button",onClick:()=>a(n),className:"px-1.5 py-0.5 rounded bg-bg-tertiary text-text-secondary hover:text-accent-blue hover:underline transition-colors",children:((l=s[n])==null?void 0:l.title)??n})},n)})})]}),t.brokenLinks.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"uppercase tracking-wider text-text-tertiary mb-1 text-[10px]",children:["Broken (",t.brokenLinks.length,")"]}),e.jsx("ul",{className:"flex flex-col gap-0.5 max-h-16 overflow-y-auto text-text-secondary",children:t.brokenLinks.slice(0,5).map((n,l)=>e.jsxs("li",{className:"truncate",children:[e.jsx("span",{className:"text-text-tertiary",children:n.sourceId})," → ",e.jsx("span",{className:"line-through",children:n.target})]},`${n.sourceId}-${l}`))})]})]})]})}const ot={project:"var(--color-accent-blue, #3b82f6)",roadmap:"var(--color-accent-purple, #8b5cf6)",spec:"var(--color-accent-green, #16a34a)",issue:"var(--color-accent-red, #dc2626)",knowhow:"var(--color-accent-cyan, #0891b2)",note:"var(--color-text-tertiary, #9ca3af)"};function lt(t){return t.replace(/^#{1,6}\s+/,"").trim()}function ct(){const t=m(l=>l.entries),r=m(l=>l.typeFilter),a=m(l=>l.tagFilter),s=m(l=>l.categoryFilter),i=m(l=>l.statusFilter),o=m(l=>l.setSelected),c=m(l=>l.selectedId),n=d.useMemo(()=>t.filter(l=>!(r!=="all"&&l.type!==r||a!=="all"&&!l.tags.includes(a)||s!=="all"&&l.category!==s||i!=="all"&&l.status!==i)),[t,r,a,s,i]);return n.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[length:var(--font-size-sm)]",children:"No entries match the current filters"}):e.jsx("div",{className:"p-4 overflow-y-auto h-full",children:e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-3",children:n.map(l=>e.jsx(dt,{entry:l,selected:l.id===c,onSelect:()=>o(l.id)},l.id))})})}function dt({entry:t,selected:r,onSelect:a}){const s=ot[t.type];return e.jsxs("button",{type:"button",onClick:a,className:`text-left rounded-[var(--radius-md,6px)] border p-3 transition-all flex flex-col gap-1.5 ${r?"border-border-strong bg-bg-secondary shadow-sm":"border-border bg-bg-primary hover:bg-bg-secondary hover:border-border-strong"}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"inline-block w-[6px] h-[6px] rounded-full shrink-0",style:{backgroundColor:s}}),e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-text-tertiary font-medium",children:t.type}),e.jsx("span",{className:"text-[10px] text-text-quaternary ml-auto",children:t.status})]}),e.jsx("div",{className:"font-medium text-text-primary text-[length:var(--font-size-sm)] leading-snug line-clamp-2",children:t.title}),t.summary&&e.jsx("div",{className:"text-text-tertiary text-[11px] line-clamp-2 leading-snug",children:lt(t.summary)}),t.tags.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1 mt-0.5",children:[t.tags.slice(0,4).map(i=>e.jsx("span",{className:"px-1 py-px text-[10px] rounded bg-bg-tertiary text-text-tertiary",children:i},i)),t.tags.length>4&&e.jsxs("span",{className:"text-[10px] text-text-quaternary",children:["+",t.tags.length-4]})]}),e.jsx("div",{className:"text-[10px] text-text-quaternary font-mono truncate mt-auto pt-1",children:t.source.path})]})}const xt={project:"#3b82f6",roadmap:"#8b5cf6",spec:"#16a34a",issue:"#dc2626",knowhow:"#0891b2",note:"#9ca3af"};function pt(){const t=m(o=>o.fetchGraph),r=m(o=>o.graph),a=m(o=>o.byId),s=m(o=>o.setSelected);d.useEffect(()=>{t()},[t]);const i=d.useMemo(()=>{if(!r)return[];const o=new Map;for(const[c,n]of Object.entries(r.forwardLinks)){o.has(c)||o.set(c,{out:0,in:0}),o.get(c).out=n.length;for(const l of n)o.has(l)||o.set(l,{out:0,in:0}),o.get(l).in+=1}return Array.from(o.entries()).map(([c,n])=>{var l,x;return{id:c,title:((l=a[c])==null?void 0:l.title)??c,type:(x=a[c])==null?void 0:x.type,outDegree:n.out,inDegree:n.in,total:n.out+n.in}}).sort((c,n)=>n.total-c.total)},[r,a]);return r?e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-4 px-4 py-2.5 border-b border-border text-[length:var(--font-size-xs)] text-text-secondary",children:[e.jsxs("span",{children:[i.length," connected nodes"]}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[Object.values(r.forwardLinks).reduce((o,c)=>o+c.length,0)," links"]}),r.brokenLinks.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{className:"text-accent-red",children:[r.brokenLinks.length," broken"]})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e.jsxs("table",{className:"w-full text-[length:var(--font-size-sm)]",children:[e.jsx("thead",{className:"sticky top-0 bg-bg-primary z-10",children:e.jsxs("tr",{className:"border-b border-border text-[10px] uppercase tracking-wider text-text-tertiary",children:[e.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Entry"}),e.jsx("th",{className:"text-left px-3 py-2 font-medium w-16",children:"Type"}),e.jsx("th",{className:"text-center px-3 py-2 font-medium w-16",children:"Out"}),e.jsx("th",{className:"text-center px-3 py-2 font-medium w-16",children:"In"})]})}),e.jsx("tbody",{children:i.map(o=>e.jsxs("tr",{className:"border-b border-border hover:bg-bg-secondary transition-colors cursor-pointer",onClick:()=>s(o.id),children:[e.jsx("td",{className:"px-4 py-2",children:e.jsxs("div",{className:"flex items-center gap-2",children:[o.type&&e.jsx("span",{className:"inline-block w-[6px] h-[6px] rounded-full shrink-0",style:{backgroundColor:xt[o.type]??"#9ca3af"}}),e.jsx("span",{className:"text-text-primary truncate",children:o.title})]})}),e.jsx("td",{className:"px-3 py-2 text-text-tertiary text-[length:var(--font-size-xs)]",children:o.type??"—"}),e.jsx("td",{className:"px-3 py-2 text-center",children:o.outDegree>0?e.jsx("span",{className:"text-accent-blue font-medium",children:o.outDegree}):e.jsx("span",{className:"text-text-quaternary",children:"0"})}),e.jsx("td",{className:"px-3 py-2 text-center",children:o.inDegree>0?e.jsx("span",{className:"text-accent-green font-medium",children:o.inDegree}):e.jsx("span",{className:"text-text-quaternary",children:"0"})})]},o.id))})]}),r.brokenLinks.length>0&&e.jsxs("div",{className:"p-4 border-t border-border",children:[e.jsxs("h3",{className:"text-[10px] uppercase tracking-wider text-text-tertiary font-medium mb-2",children:["Broken Links (",r.brokenLinks.length,")"]}),e.jsx("ul",{className:"flex flex-col gap-1 text-[length:var(--font-size-xs)]",children:r.brokenLinks.map((o,c)=>{var n;return e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>s(o.sourceId),className:"text-accent-blue hover:underline truncate",children:((n=a[o.sourceId])==null?void 0:n.title)??o.sourceId}),e.jsx("span",{className:"text-text-quaternary",children:"→"}),e.jsx("span",{className:"text-text-tertiary line-through",children:o.target})]},`${o.sourceId}-${c}`)})})]})]})]}):e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[length:var(--font-size-sm)]",children:"Loading graph data…"})}const ut=[{label:"Reader",icon:e.jsx(C,{size:14,strokeWidth:2}),shortcut:"1"},{label:"Gallery",icon:e.jsx(Z,{size:14,strokeWidth:2}),shortcut:"2"},{label:"Structured",icon:e.jsx(me,{size:14,strokeWidth:2}),shortcut:"3"}],q=["reader","gallery","structured"],ft=[{label:"Reader",icon:e.jsx(he,{size:14,strokeWidth:2}),shortcut:"1"},{label:"Gallery",icon:e.jsx(Z,{size:14,strokeWidth:2}),shortcut:"2"},{label:"Graph",icon:e.jsx(we,{size:14,strokeWidth:2}),shortcut:"3"}],U=["reader","gallery","graph"],ht=[{value:"all",label:"All"},{value:"project",label:"Project"},{value:"roadmap",label:"Roadmap"},{value:"spec",label:"Specs"},{value:"issue",label:"Issues"},{value:"knowhow",label:"KnowHow"},{value:"note",label:"Notes"}],k={initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}};function Lt(){const[t,r]=d.useState("files"),[a,s]=d.useState("reader"),[i,o]=d.useState("reader"),{tree:c,selectedPath:n,content:l,loading:x,treeLoading:p,error:u,selectFile:f}=Se(),{fetchEntries:g,loading:b,error:y,entries:S,search:E,setSearch:R,typeFilter:ce,setTypeFilter:de}=m(Q(h=>({fetchEntries:h.fetchEntries,loading:h.loading,error:h.error,entries:h.entries,search:h.search,setSearch:h.setSearch,typeFilter:h.typeFilter,setTypeFilter:h.setTypeFilter})));d.useEffect(()=>{t==="wiki"&&g()},[t,g]),d.useEffect(()=>{if(t!=="wiki")return;const h=setTimeout(()=>void g(),200);return()=>clearTimeout(h)},[E,g,t]);const{register:V,unregister:P}=d.useContext(ue),B=d.useCallback(h=>{t==="files"?s(q[h]):o(U[h])},[t]);return d.useEffect(()=>{const h=t==="files"?ut:ft,v=t==="files"?q.indexOf(a):U.indexOf(i);V({items:h.map(z=>({label:z.label,icon:z.icon,shortcut:z.shortcut})),activeIndex:v,onSwitch:B})},[t,a,i,V,B]),d.useEffect(()=>()=>P(),[P]),d.useEffect(()=>{function h(v){v.target instanceof HTMLInputElement||v.target instanceof HTMLTextAreaElement||(t==="files"?v.key==="1"?s("reader"):v.key==="2"?s("gallery"):v.key==="3"&&s("structured"):v.key==="1"?o("reader"):v.key==="2"?o("gallery"):v.key==="3"&&o("graph"))}return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[t]),e.jsxs("div",{className:"flex h-full overflow-hidden",children:[e.jsxs("div",{className:"w-[272px] shrink-0 border-r border-border overflow-hidden flex flex-col bg-bg-primary",children:[e.jsxs("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-border shrink-0",children:[e.jsx(Y,{mode:"files",active:t==="files",icon:e.jsx(je,{size:13,strokeWidth:2}),label:"Files",onClick:()=>r("files")}),e.jsx(Y,{mode:"wiki",active:t==="wiki",icon:e.jsx(Ce,{size:13,strokeWidth:2}),label:"Wiki",onClick:()=>r("wiki")})]}),t==="files"?e.jsx(ge,{tree:c,selectedPath:n,onSelectFile:f,loading:p}):e.jsxs(e.Fragment,{children:[e.jsx(it,{}),e.jsxs("div",{className:"flex flex-col gap-2 px-3 py-2 border-b border-border",children:[e.jsxs("div",{className:"relative",children:[e.jsx(X,{size:13,strokeWidth:2,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-tertiary pointer-events-none"}),e.jsx("input",{type:"text",value:E,placeholder:"Search…",onChange:h=>R(h.target.value),className:"w-full pl-7 pr-7 py-1.5 bg-bg-secondary border border-border rounded-[var(--radius-md,6px)] text-[length:var(--font-size-sm)] text-text-primary placeholder:text-text-quaternary focus:outline-none focus:border-border-strong transition-colors"}),E&&e.jsx("button",{type:"button",onClick:()=>R(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-tertiary hover:text-text-secondary transition-colors",children:e.jsx(fe,{size:12,strokeWidth:2})})]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:ht.map(h=>e.jsx("button",{type:"button",onClick:()=>de(h.value),className:`px-2 py-0.5 rounded-[var(--radius-full,999px)] text-[10px] font-medium transition-all ${ce===h.value?"bg-text-primary text-bg-primary":"text-text-tertiary hover:text-text-secondary hover:bg-bg-secondary"}`,children:h.label},h.value))}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-text-quaternary",children:[e.jsxs("span",{children:[S.length," entr",S.length===1?"y":"ies"]}),b&&e.jsx("span",{className:"animate-pulse",children:"· loading…"}),y&&e.jsx("span",{className:"text-accent-red ml-1",children:y})]})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:e.jsx(tt,{})})]})]}),e.jsx("div",{className:"flex-1 overflow-hidden relative min-w-0",children:e.jsx(be,{mode:"wait",children:t==="files"?e.jsxs(e.Fragment,{children:[a==="reader"&&e.jsx(N.div,{className:"absolute inset-0 flex flex-col",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(ne,{content:l,path:n,onNavigate:f,loading:x,error:u})},"file-reader"),a==="gallery"&&e.jsx(N.div,{className:"absolute inset-0 flex flex-col",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(De,{tree:c,onSelectFile:f,selectedPath:n})},"file-gallery"),a==="structured"&&e.jsx(N.div,{className:"absolute inset-0 flex flex-col",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(Ke,{content:l,path:n})},"file-structured")]}):e.jsxs(e.Fragment,{children:[i==="reader"&&e.jsx(N.div,{className:"absolute inset-0",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.2},children:e.jsx(nt,{})},"wiki-reader"),i==="gallery"&&e.jsx(N.div,{className:"absolute inset-0",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.2},children:e.jsx(ct,{})},"wiki-gallery"),i==="graph"&&e.jsx(N.div,{className:"absolute inset-0",variants:k,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.2},children:e.jsx(pt,{})},"wiki-graph")]})})})]})}function Y({active:t,icon:r,label:a,onClick:s}){return e.jsxs("button",{type:"button",onClick:s,className:["flex-1 flex items-center justify-center gap-1.5 px-2 py-1.5 rounded-[var(--radius-md,6px)]","text-[length:var(--font-size-sm)] font-medium transition-all duration-150",t?"bg-bg-active text-text-primary shadow-sm":"text-text-tertiary hover:text-text-secondary hover:bg-bg-hover"].join(" "),children:[r,e.jsx("span",{children:a})]})}export{Lt as ArtifactsPage};
|