maestro-flow 0.5.1 → 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/learn-decompose/SKILL.md +144 -144
- package/.codex/skills/learn-follow/SKILL.md +83 -83
- package/.codex/skills/learn-investigate/SKILL.md +84 -84
- package/.codex/skills/learn-retro/SKILL.md +113 -113
- package/.codex/skills/learn-second-opinion/SKILL.md +116 -116
- package/.codex/skills/maestro/SKILL.md +11 -8
- package/.codex/skills/maestro-amend/SKILL.md +4 -4
- package/.codex/skills/maestro-analyze/SKILL.md +2 -2
- package/.codex/skills/maestro-blueprint/SKILL.md +4 -4
- package/.codex/skills/maestro-companion/SKILL.md +5 -5
- package/.codex/skills/maestro-composer/SKILL.md +217 -217
- package/.codex/skills/maestro-grill/SKILL.md +1 -1
- package/.codex/skills/maestro-help/SKILL.md +31 -31
- package/.codex/skills/maestro-impeccable/SKILL.md +1 -1
- package/.codex/skills/maestro-init/SKILL.md +1 -1
- package/.codex/skills/maestro-learn/SKILL.md +80 -80
- package/.codex/skills/maestro-merge/SKILL.md +76 -76
- package/.codex/skills/maestro-milestone-release/SKILL.md +74 -74
- package/.codex/skills/maestro-next/SKILL.md +1 -1
- package/.codex/skills/maestro-player/SKILL.md +3 -3
- package/.codex/skills/maestro-quick/SKILL.md +129 -129
- package/.codex/skills/maestro-ralph/SKILL.md +9 -9
- package/.codex/skills/maestro-ralph-beta/SKILL.md +35 -35
- package/.codex/skills/maestro-ralph-execute/SKILL.md +5 -5
- package/.codex/skills/maestro-tools-execute/SKILL.md +3 -3
- package/.codex/skills/maestro-tools-register/SKILL.md +3 -3
- package/.codex/skills/manage-codebase-rebuild/SKILL.md +412 -412
- package/.codex/skills/manage-codebase-refresh/SKILL.md +1 -1
- package/.codex/skills/manage-harvest/SKILL.md +99 -99
- package/.codex/skills/manage-issue-discover/SKILL.md +1 -1
- package/.codex/skills/manage-knowhow/SKILL.md +95 -95
- package/.codex/skills/manage-knowhow-capture/SKILL.md +137 -137
- package/.codex/skills/manage-status/SKILL.md +7 -7
- package/.codex/skills/manage-wiki/SKILL.md +55 -55
- 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/.codex/skills/quality-auto-test/SKILL.md +1 -1
- package/.codex/skills/quality-debug/SKILL.md +8 -8
- package/.codex/skills/quality-refactor/SKILL.md +3 -3
- package/.codex/skills/quality-review/SKILL.md +1 -1
- package/.codex/skills/quality-sync/SKILL.md +111 -111
- package/.codex/skills/quality-test/SKILL.md +1 -1
- package/.codex/skills/spec-add/SKILL.md +2 -2
- package/.codex/skills/spec-load/SKILL.md +1 -1
- package/.codex/skills/spec-map/SKILL.md +204 -204
- package/.codex/skills/spec-remove/SKILL.md +75 -75
- package/.codex/skills/spec-setup/SKILL.md +2 -2
- package/.codex/skills/wiki-connect/SKILL.md +73 -73
- package/.codex/skills/wiki-digest/SKILL.md +87 -87
- 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/ralph/skill-scanner.d.ts.map +1 -1
- package/dist/src/ralph/skill-scanner.js +9 -3
- package/dist/src/ralph/skill-scanner.js.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
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: wiki-connect
|
|
3
|
-
description: Find and link hidden connections in wiki graph
|
|
4
|
-
argument-hint: "[--scope <type>] [--min-similarity N] [--fix] [--max N]"
|
|
5
|
-
allowed-tools: Read, Write, Edit, Bash, Glob, Grep,
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<purpose>
|
|
9
|
-
Knowledge graph link discovery. Analyzes wiki index to find orphaned entries, missing
|
|
10
|
-
bidirectional links, and transitive closure gaps. Scores connection candidates and
|
|
11
|
-
optionally auto-applies new `related` links to improve graph connectivity.
|
|
12
|
-
</purpose>
|
|
13
|
-
|
|
14
|
-
<context>
|
|
15
|
-
$ARGUMENTS — optional flags.
|
|
16
|
-
|
|
17
|
-
**Flags:**
|
|
18
|
-
- `--scope <type>` — Limit to wiki type (spec, knowhow, note, issue). Default: all.
|
|
19
|
-
- `--min-similarity N` — Threshold 0.0-1.0 (default: 0.3)
|
|
20
|
-
- `--fix` — Auto-apply top suggestions
|
|
21
|
-
- `--max N` — Max suggestions (default: 20)
|
|
22
|
-
|
|
23
|
-
**Output**: `.workflow/knowhow/KNW-wiki-connections-{date}.md`
|
|
24
|
-
</context>
|
|
25
|
-
|
|
26
|
-
<execution>
|
|
27
|
-
|
|
28
|
-
### Stage 1: Load Wiki State
|
|
29
|
-
Parallel `maestro wiki` commands: `list --json`, `health`, `orphans`, `hubs --top 10`.
|
|
30
|
-
|
|
31
|
-
### Stage 2: Identify Connection Candidates
|
|
32
|
-
- **Orphan rescue**: BM25 search by title, tag overlap, same category/parent
|
|
33
|
-
- **Missing bidirectional**: A→B exists but B→A missing
|
|
34
|
-
- **Transitive closure**: A→B and B→C but no A→C (with shared tags/category)
|
|
35
|
-
- **Type bridge**: Different types referencing same concept but unlinked
|
|
36
|
-
- **Parent cluster**: Entries sharing the same parent but not linked to each other
|
|
37
|
-
|
|
38
|
-
### Stage 3: Score Candidates
|
|
39
|
-
Score = 0.4 x tag_overlap + 0.3 x title_bm25 + 0.2 x same_category + 0.1 x type_bridge. Filter by `--min-similarity`, rank desc, limit by `--max`.
|
|
40
|
-
|
|
41
|
-
### Stage 4: Present Suggestions
|
|
42
|
-
Display ranked suggestions with scores, reasons, projected health delta.
|
|
43
|
-
If not `--fix`: display and exit.
|
|
44
|
-
|
|
45
|
-
### Stage 5: Apply (--fix only)
|
|
46
|
-
For each suggestion: get entry → append target to `related` → update via `maestro wiki update`.
|
|
47
|
-
Re-run `maestro wiki health` for delta.
|
|
48
|
-
|
|
49
|
-
### Stage 6: Persist
|
|
50
|
-
Write `KNW-wiki-connections-{date}.md`. Append graph insights to `specs/learnings.md` (source: "wiki-connect").
|
|
51
|
-
|
|
52
|
-
**Next steps:**
|
|
53
|
-
</execution>
|
|
54
|
-
|
|
55
|
-
<error_codes>
|
|
56
|
-
| Code | Severity | Condition | Recovery |
|
|
57
|
-
|------|----------|-----------|----------|
|
|
58
|
-
| E001 | error | No wiki entries found | Initialize wiki content |
|
|
59
|
-
| W001 | warning | No candidates above threshold | Lower --min-similarity |
|
|
60
|
-
| W002 | warning | Some wiki updates failed during --fix | Retry manually |
|
|
61
|
-
| W003 | warning | Health score unchanged after fix | Connections may not affect specific metrics |
|
|
62
|
-
</error_codes>
|
|
63
|
-
|
|
64
|
-
<success_criteria>
|
|
65
|
-
- [ ] Wiki index loaded with type distribution
|
|
66
|
-
- [ ] Baseline health score recorded
|
|
67
|
-
- [ ] Orphans identified and rescue candidates generated
|
|
68
|
-
- [ ] Candidates scored and ranked
|
|
69
|
-
- [ ] Suggestions displayed with scores and reasons
|
|
70
|
-
- [ ] If --fix: entries updated, new health score reported
|
|
71
|
-
- [ ] Report written to `KNW-wiki-connections-{date}.md`
|
|
72
|
-
- [ ] Graph insights appended to `specs/learnings.md`
|
|
73
|
-
</success_criteria>
|
|
1
|
+
---
|
|
2
|
+
name: wiki-connect
|
|
3
|
+
description: Find and link hidden connections in wiki graph
|
|
4
|
+
argument-hint: "[--scope <type>] [--min-similarity N] [--fix] [--max N]"
|
|
5
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, request_user_input
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<purpose>
|
|
9
|
+
Knowledge graph link discovery. Analyzes wiki index to find orphaned entries, missing
|
|
10
|
+
bidirectional links, and transitive closure gaps. Scores connection candidates and
|
|
11
|
+
optionally auto-applies new `related` links to improve graph connectivity.
|
|
12
|
+
</purpose>
|
|
13
|
+
|
|
14
|
+
<context>
|
|
15
|
+
$ARGUMENTS — optional flags.
|
|
16
|
+
|
|
17
|
+
**Flags:**
|
|
18
|
+
- `--scope <type>` — Limit to wiki type (spec, knowhow, note, issue). Default: all.
|
|
19
|
+
- `--min-similarity N` — Threshold 0.0-1.0 (default: 0.3)
|
|
20
|
+
- `--fix` — Auto-apply top suggestions
|
|
21
|
+
- `--max N` — Max suggestions (default: 20)
|
|
22
|
+
|
|
23
|
+
**Output**: `.workflow/knowhow/KNW-wiki-connections-{date}.md`
|
|
24
|
+
</context>
|
|
25
|
+
|
|
26
|
+
<execution>
|
|
27
|
+
|
|
28
|
+
### Stage 1: Load Wiki State
|
|
29
|
+
Parallel `maestro wiki` commands: `list --json`, `health`, `orphans`, `hubs --top 10`.
|
|
30
|
+
|
|
31
|
+
### Stage 2: Identify Connection Candidates
|
|
32
|
+
- **Orphan rescue**: BM25 search by title, tag overlap, same category/parent
|
|
33
|
+
- **Missing bidirectional**: A→B exists but B→A missing
|
|
34
|
+
- **Transitive closure**: A→B and B→C but no A→C (with shared tags/category)
|
|
35
|
+
- **Type bridge**: Different types referencing same concept but unlinked
|
|
36
|
+
- **Parent cluster**: Entries sharing the same parent but not linked to each other
|
|
37
|
+
|
|
38
|
+
### Stage 3: Score Candidates
|
|
39
|
+
Score = 0.4 x tag_overlap + 0.3 x title_bm25 + 0.2 x same_category + 0.1 x type_bridge. Filter by `--min-similarity`, rank desc, limit by `--max`.
|
|
40
|
+
|
|
41
|
+
### Stage 4: Present Suggestions
|
|
42
|
+
Display ranked suggestions with scores, reasons, projected health delta.
|
|
43
|
+
If not `--fix`: display and exit.
|
|
44
|
+
|
|
45
|
+
### Stage 5: Apply (--fix only)
|
|
46
|
+
For each suggestion: get entry → append target to `related` → update via `maestro wiki update`.
|
|
47
|
+
Re-run `maestro wiki health` for delta.
|
|
48
|
+
|
|
49
|
+
### Stage 6: Persist
|
|
50
|
+
Write `KNW-wiki-connections-{date}.md`. Append graph insights to `specs/learnings.md` (source: "wiki-connect").
|
|
51
|
+
|
|
52
|
+
**Next steps:** `$wiki-digest <topic>`, `$manage-wiki health`, `$learn-follow <wiki-id>`, `maestro wiki graph`
|
|
53
|
+
</execution>
|
|
54
|
+
|
|
55
|
+
<error_codes>
|
|
56
|
+
| Code | Severity | Condition | Recovery |
|
|
57
|
+
|------|----------|-----------|----------|
|
|
58
|
+
| E001 | error | No wiki entries found | Initialize wiki content |
|
|
59
|
+
| W001 | warning | No candidates above threshold | Lower --min-similarity |
|
|
60
|
+
| W002 | warning | Some wiki updates failed during --fix | Retry manually |
|
|
61
|
+
| W003 | warning | Health score unchanged after fix | Connections may not affect specific metrics |
|
|
62
|
+
</error_codes>
|
|
63
|
+
|
|
64
|
+
<success_criteria>
|
|
65
|
+
- [ ] Wiki index loaded with type distribution
|
|
66
|
+
- [ ] Baseline health score recorded
|
|
67
|
+
- [ ] Orphans identified and rescue candidates generated
|
|
68
|
+
- [ ] Candidates scored and ranked
|
|
69
|
+
- [ ] Suggestions displayed with scores and reasons
|
|
70
|
+
- [ ] If --fix: entries updated, new health score reported
|
|
71
|
+
- [ ] Report written to `KNW-wiki-connections-{date}.md`
|
|
72
|
+
- [ ] Graph insights appended to `specs/learnings.md`
|
|
73
|
+
</success_criteria>
|
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: wiki-digest
|
|
3
|
-
description: Generate wiki digest with theme clustering and gap analysis
|
|
4
|
-
argument-hint: "[<topic>|--recent N] [--type <type>] [--format brief|full] [--create-issues]"
|
|
5
|
-
allowed-tools: Read, Write, Edit, Bash, Glob, Grep,
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<purpose>
|
|
9
|
-
Knowledge synthesis that generates actionable digests from the wiki knowledge graph.
|
|
10
|
-
Clusters entries by semantic theme, identifies knowledge gaps, and produces a coverage
|
|
11
|
-
heatmap. Unlike `maestro search` (raw entries), this synthesizes and interprets
|
|
12
|
-
the knowledge base with gap analysis and recommended actions.
|
|
13
|
-
</purpose>
|
|
14
|
-
|
|
15
|
-
<context>
|
|
16
|
-
$ARGUMENTS — scope and optional flags.
|
|
17
|
-
|
|
18
|
-
**Scope resolution:**
|
|
19
|
-
- `<topic>` — Search wiki for matching entries
|
|
20
|
-
- `--recent N` — Entries updated in last N days
|
|
21
|
-
- `--type <type>` — Filter by wiki type
|
|
22
|
-
- No args — entire wiki
|
|
23
|
-
|
|
24
|
-
**Flags:**
|
|
25
|
-
- `--format brief` — Compact summary (default)
|
|
26
|
-
- `--format full` — Detailed with per-entry summaries
|
|
27
|
-
- `--create-issues` — Auto-create knowledge-gap issues in issues.jsonl
|
|
28
|
-
|
|
29
|
-
**Output**: `.workflow/knowhow/KNW-digest-{slug}-{date}.md`
|
|
30
|
-
</context>
|
|
31
|
-
|
|
32
|
-
<execution>
|
|
33
|
-
|
|
34
|
-
### Stage 1: Scope & Load
|
|
35
|
-
Load entries via `maestro search`. Run `maestro wiki health` for baseline.
|
|
36
|
-
|
|
37
|
-
### Stage 2: Theme Clustering
|
|
38
|
-
Group entries into 3-5 themes via: tag co-occurrence, title BM25 similarity, relationship proximity, type grouping.
|
|
39
|
-
|
|
40
|
-
### Stage 3: Per-Theme Analysis
|
|
41
|
-
Per theme: summary paragraph, key entries (by hub score), gap detection (broken links, orphans, TODO markers, missing perspectives), health score.
|
|
42
|
-
|
|
43
|
-
### Stage 4: Cross-Reference with Lessons
|
|
44
|
-
Search `specs/learnings.md` for related insights. Flag unlinked insights (knowhow entries matching theme but not referenced by wiki entries).
|
|
45
|
-
|
|
46
|
-
### Stage 5: Coverage Heatmap
|
|
47
|
-
Type × theme matrix showing knowledge density:
|
|
48
|
-
```
|
|
49
|
-
Theme 1 Theme 2 Theme 3
|
|
50
|
-
spec ███░░ ░░░░░ █████
|
|
51
|
-
memory ████░ ███░░ ░░░░░
|
|
52
|
-
knowhow █░░░░ ██░░░ ████░
|
|
53
|
-
```
|
|
54
|
-
Empty cells = knowledge gaps.
|
|
55
|
-
|
|
56
|
-
### Stage 6: Write Digest
|
|
57
|
-
Produce `digest-{slug}-{date}.md` with themes, heatmap, gaps, unlinked insights, recommended actions.
|
|
58
|
-
|
|
59
|
-
### Stage 7: Gap → Issue (if --create-issues)
|
|
60
|
-
For each gap: dedup against issues.jsonl, append with `type: "knowledge-gap"`, `source: "wiki-digest"`.
|
|
61
|
-
|
|
62
|
-
### Stage 8: Persist
|
|
63
|
-
Append meta-insights to `specs/learnings.md` (source: "wiki-digest"). Display summary.
|
|
64
|
-
|
|
65
|
-
**Next steps:**
|
|
66
|
-
</execution>
|
|
67
|
-
|
|
68
|
-
<error_codes>
|
|
69
|
-
| Code | Severity | Condition | Recovery |
|
|
70
|
-
|------|----------|-----------|----------|
|
|
71
|
-
| E001 | error | No wiki entries found | Initialize wiki content |
|
|
72
|
-
| E002 | error | Topic search returned 0 | Broaden topic |
|
|
73
|
-
| W001 | warning | Too few entries (<5) | Themes may be trivial |
|
|
74
|
-
| W002 | warning | learnings.md not found | Skip cross-reference |
|
|
75
|
-
| W003 | warning | Some entry bodies failed to load | Partial summaries |
|
|
76
|
-
</error_codes>
|
|
77
|
-
|
|
78
|
-
<success_criteria>
|
|
79
|
-
- [ ] Scope parsed and entries loaded
|
|
80
|
-
- [ ] Entries clustered into 3-5 semantic themes
|
|
81
|
-
- [ ] Per-theme analysis with gaps identified
|
|
82
|
-
- [ ] Cross-reference with specs/learnings.md completed
|
|
83
|
-
- [ ] Coverage heatmap generated
|
|
84
|
-
- [ ] If --create-issues: gap issues created (deduped)
|
|
85
|
-
- [ ] Digest written to `KNW-digest-{slug}-{date}.md`
|
|
86
|
-
- [ ] Meta-insights appended to specs/learnings.md
|
|
87
|
-
</success_criteria>
|
|
1
|
+
---
|
|
2
|
+
name: wiki-digest
|
|
3
|
+
description: Generate wiki digest with theme clustering and gap analysis
|
|
4
|
+
argument-hint: "[<topic>|--recent N] [--type <type>] [--format brief|full] [--create-issues]"
|
|
5
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, request_user_input
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<purpose>
|
|
9
|
+
Knowledge synthesis that generates actionable digests from the wiki knowledge graph.
|
|
10
|
+
Clusters entries by semantic theme, identifies knowledge gaps, and produces a coverage
|
|
11
|
+
heatmap. Unlike `maestro search` (raw entries), this synthesizes and interprets
|
|
12
|
+
the knowledge base with gap analysis and recommended actions.
|
|
13
|
+
</purpose>
|
|
14
|
+
|
|
15
|
+
<context>
|
|
16
|
+
$ARGUMENTS — scope and optional flags.
|
|
17
|
+
|
|
18
|
+
**Scope resolution:**
|
|
19
|
+
- `<topic>` — Search wiki for matching entries
|
|
20
|
+
- `--recent N` — Entries updated in last N days
|
|
21
|
+
- `--type <type>` — Filter by wiki type
|
|
22
|
+
- No args — entire wiki
|
|
23
|
+
|
|
24
|
+
**Flags:**
|
|
25
|
+
- `--format brief` — Compact summary (default)
|
|
26
|
+
- `--format full` — Detailed with per-entry summaries
|
|
27
|
+
- `--create-issues` — Auto-create knowledge-gap issues in issues.jsonl
|
|
28
|
+
|
|
29
|
+
**Output**: `.workflow/knowhow/KNW-digest-{slug}-{date}.md`
|
|
30
|
+
</context>
|
|
31
|
+
|
|
32
|
+
<execution>
|
|
33
|
+
|
|
34
|
+
### Stage 1: Scope & Load
|
|
35
|
+
Load entries via `maestro search`. Run `maestro wiki health` for baseline.
|
|
36
|
+
|
|
37
|
+
### Stage 2: Theme Clustering
|
|
38
|
+
Group entries into 3-5 themes via: tag co-occurrence, title BM25 similarity, relationship proximity, type grouping.
|
|
39
|
+
|
|
40
|
+
### Stage 3: Per-Theme Analysis
|
|
41
|
+
Per theme: summary paragraph, key entries (by hub score), gap detection (broken links, orphans, TODO markers, missing perspectives), health score.
|
|
42
|
+
|
|
43
|
+
### Stage 4: Cross-Reference with Lessons
|
|
44
|
+
Search `specs/learnings.md` for related insights. Flag unlinked insights (knowhow entries matching theme but not referenced by wiki entries).
|
|
45
|
+
|
|
46
|
+
### Stage 5: Coverage Heatmap
|
|
47
|
+
Type × theme matrix showing knowledge density:
|
|
48
|
+
```
|
|
49
|
+
Theme 1 Theme 2 Theme 3
|
|
50
|
+
spec ███░░ ░░░░░ █████
|
|
51
|
+
memory ████░ ███░░ ░░░░░
|
|
52
|
+
knowhow █░░░░ ██░░░ ████░
|
|
53
|
+
```
|
|
54
|
+
Empty cells = knowledge gaps.
|
|
55
|
+
|
|
56
|
+
### Stage 6: Write Digest
|
|
57
|
+
Produce `digest-{slug}-{date}.md` with themes, heatmap, gaps, unlinked insights, recommended actions.
|
|
58
|
+
|
|
59
|
+
### Stage 7: Gap → Issue (if --create-issues)
|
|
60
|
+
For each gap: dedup against issues.jsonl, append with `type: "knowledge-gap"`, `source: "wiki-digest"`.
|
|
61
|
+
|
|
62
|
+
### Stage 8: Persist
|
|
63
|
+
Append meta-insights to `specs/learnings.md` (source: "wiki-digest"). Display summary.
|
|
64
|
+
|
|
65
|
+
**Next steps:** `$learn-follow <wiki-id>`, `$wiki-connect --fix`, `$manage-wiki cleanup`, `$learn-decompose <path>`
|
|
66
|
+
</execution>
|
|
67
|
+
|
|
68
|
+
<error_codes>
|
|
69
|
+
| Code | Severity | Condition | Recovery |
|
|
70
|
+
|------|----------|-----------|----------|
|
|
71
|
+
| E001 | error | No wiki entries found | Initialize wiki content |
|
|
72
|
+
| E002 | error | Topic search returned 0 | Broaden topic |
|
|
73
|
+
| W001 | warning | Too few entries (<5) | Themes may be trivial |
|
|
74
|
+
| W002 | warning | learnings.md not found | Skip cross-reference |
|
|
75
|
+
| W003 | warning | Some entry bodies failed to load | Partial summaries |
|
|
76
|
+
</error_codes>
|
|
77
|
+
|
|
78
|
+
<success_criteria>
|
|
79
|
+
- [ ] Scope parsed and entries loaded
|
|
80
|
+
- [ ] Entries clustered into 3-5 semantic themes
|
|
81
|
+
- [ ] Per-theme analysis with gaps identified
|
|
82
|
+
- [ ] Cross-reference with specs/learnings.md completed
|
|
83
|
+
- [ ] Coverage heatmap generated
|
|
84
|
+
- [ ] If --create-issues: gap issues created (deduped)
|
|
85
|
+
- [ ] Digest written to `KNW-digest-{slug}-{date}.md`
|
|
86
|
+
- [ ] Meta-insights appended to specs/learnings.md
|
|
87
|
+
</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};
|