gsd-pi 2.82.0-dev.725028083 → 2.82.0-dev.98ea09b1e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/GSD-WORKFLOW.md +10 -1
- package/dist/resources/extensions/claude-code-cli/partial-builder.js +2 -1
- package/dist/resources/extensions/cmux/index.js +5 -0
- package/dist/resources/extensions/gsd/auto/infra-errors.js +9 -3
- package/dist/resources/extensions/gsd/auto/loop.js +5 -5
- package/dist/resources/extensions/gsd/auto/orchestrator.js +124 -6
- package/dist/resources/extensions/gsd/auto/phases.js +8 -1
- package/dist/resources/extensions/gsd/auto/workflow-memory-pressure.js +12 -0
- package/dist/resources/extensions/gsd/auto-dispatch.js +13 -6
- package/dist/resources/extensions/gsd/auto-model-selection.js +2 -0
- package/dist/resources/extensions/gsd/auto-post-unit.js +233 -127
- package/dist/resources/extensions/gsd/auto-prompts.js +2 -2
- package/dist/resources/extensions/gsd/auto-recovery.js +31 -1
- package/dist/resources/extensions/gsd/auto-start.js +85 -12
- package/dist/resources/extensions/gsd/auto-verification.js +28 -22
- package/dist/resources/extensions/gsd/auto-worktree.js +111 -1
- package/dist/resources/extensions/gsd/auto.js +158 -55
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +4 -1
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +9 -8
- package/dist/resources/extensions/gsd/bootstrap/subagent-input.js +21 -9
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +16 -2
- package/dist/resources/extensions/gsd/clean-root-preflight.js +170 -8
- package/dist/resources/extensions/gsd/commands/catalog.js +4 -1
- package/dist/resources/extensions/gsd/commands/handlers/core.js +37 -0
- package/dist/resources/extensions/gsd/commands-bootstrap.js +5 -0
- package/dist/resources/extensions/gsd/crash-recovery.js +31 -5
- package/dist/resources/extensions/gsd/db/unit-dispatches.js +3 -2
- package/dist/resources/extensions/gsd/dispatch-guard.js +2 -2
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +28 -11
- package/dist/resources/extensions/gsd/doctor.js +2 -28
- package/dist/resources/extensions/gsd/export-html.js +27 -425
- package/dist/resources/extensions/gsd/git-service.js +39 -1
- package/dist/resources/extensions/gsd/gsd-db.js +1 -0
- package/dist/resources/extensions/gsd/guided-flow.js +13 -6
- package/dist/resources/extensions/gsd/md-importer.js +1 -1
- package/dist/resources/extensions/gsd/migrate/command.js +5 -0
- package/dist/resources/extensions/gsd/migrate/parsers.js +10 -0
- package/dist/resources/extensions/gsd/migrate/preview.js +9 -0
- package/dist/resources/extensions/gsd/migrate/transformer.js +51 -4
- package/dist/resources/extensions/gsd/migrate/writer.js +11 -1
- package/dist/resources/extensions/gsd/migration-auto-check.js +12 -17
- package/dist/resources/extensions/gsd/milestone-actions.js +11 -4
- package/dist/resources/extensions/gsd/native-git-bridge.js +48 -12
- package/dist/resources/extensions/gsd/post-execution-checks.js +73 -2
- package/dist/resources/extensions/gsd/pre-execution-checks.js +28 -1
- package/dist/resources/extensions/gsd/prompt-loader.js +1 -1
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/discuss-headless.md +8 -8
- package/dist/resources/extensions/gsd/prompts/discuss.md +9 -9
- package/dist/resources/extensions/gsd/prompts/guided-discuss-project.md +4 -4
- package/dist/resources/extensions/gsd/prompts/guided-discuss-requirements.md +3 -3
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +4 -4
- package/dist/resources/extensions/gsd/prompts/queue.md +4 -4
- package/dist/resources/extensions/gsd/prompts/refine-slice.md +2 -2
- package/dist/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
- package/dist/resources/extensions/gsd/state-reconciliation/drift/merge-state.js +6 -1
- package/dist/resources/extensions/gsd/state-reconciliation/drift/project-md.js +9 -14
- package/dist/resources/extensions/gsd/state-reconciliation/drift/roadmap.js +19 -24
- package/dist/resources/extensions/gsd/status-guards.js +4 -0
- package/dist/resources/extensions/gsd/templates/plan.md +8 -5
- package/dist/resources/extensions/gsd/templates/task-plan.md +4 -2
- package/dist/resources/extensions/gsd/tools/complete-milestone.js +6 -8
- package/dist/resources/extensions/gsd/tools/complete-slice.js +6 -8
- package/dist/resources/extensions/gsd/tools/plan-milestone.js +7 -1
- package/dist/resources/extensions/gsd/tools/plan-slice.js +89 -14
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +119 -0
- package/dist/resources/extensions/gsd/unit-context-manifest.js +32 -10
- package/dist/resources/extensions/gsd/validation.js +23 -1
- package/dist/resources/extensions/gsd/verification-gate.js +68 -7
- package/dist/resources/extensions/gsd/verification-verdict.js +26 -0
- package/dist/resources/extensions/gsd/workflow-projections.js +6 -8
- package/dist/resources/extensions/gsd/worktree-lifecycle.js +54 -10
- package/dist/resources/extensions/shared/html-shell.js +388 -0
- package/dist/resources/extensions/subagent/index.js +448 -78
- package/dist/resources/extensions/subagent/launch.js +77 -0
- package/dist/resources/extensions/subagent/run-store.js +148 -0
- package/dist/resources/extensions/visual-brief/artifact-policy.js +29 -0
- package/dist/resources/extensions/visual-brief/extension-manifest.json +8 -0
- package/dist/resources/extensions/visual-brief/index.js +5 -0
- package/dist/resources/extensions/visual-brief/page-contract.js +124 -0
- package/dist/resources/extensions/visual-brief/prompts.js +140 -0
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +14 -14
- package/dist/web/standalone/.next/build-manifest.json +3 -3
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/react-loadable-manifest.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
- package/dist/web/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +4 -7
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -7
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +4 -5
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -5
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +4 -7
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -7
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +4 -5
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -5
- package/dist/web/standalone/.next/server/app/page.js +2 -2
- package/dist/web/standalone/.next/server/app/page.js.nft.json +1 -1
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +14 -14
- package/dist/web/standalone/.next/server/chunks/4266.js +2 -0
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
- package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/2973.33f26573894b6153.js +2 -0
- package/dist/web/standalone/.next/static/chunks/{8359.e059d86b255fce1c.js → 8359.7eb3bb8f8ecf4c01.js} +2 -2
- package/dist/web/standalone/.next/static/chunks/app/layout-8c10ec293ae0f1d5.js +1 -0
- package/dist/web/standalone/.next/static/chunks/{webpack-de742b64187e13fe.js → webpack-9a4db269f9ed63ad.js} +1 -1
- package/dist/web/standalone/.next/static/css/746ee28c929d1880.css +1 -0
- package/package.json +4 -4
- package/packages/contracts/dist/rpc.test.js +7 -0
- package/packages/contracts/dist/rpc.test.js.map +1 -1
- package/packages/contracts/dist/workflow.d.ts +21 -0
- package/packages/contracts/dist/workflow.d.ts.map +1 -1
- package/packages/contracts/dist/workflow.js +24 -0
- package/packages/contracts/dist/workflow.js.map +1 -1
- package/packages/contracts/src/rpc.test.ts +8 -0
- package/packages/contracts/src/workflow.ts +24 -0
- package/packages/mcp-server/README.md +13 -4
- package/packages/mcp-server/dist/workflow-tools.d.ts +0 -3
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +80 -0
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/src/workflow-tools.test.ts +23 -1
- package/packages/mcp-server/src/workflow-tools.ts +168 -0
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/tsconfig.json +2 -1
- package/packages/native/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-codex-responses.js +82 -1
- package/packages/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-codex-responses.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/openai-codex-responses.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/openai-codex-responses.test.js +52 -0
- package/packages/pi-ai/dist/providers/openai-codex-responses.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/simple-options.d.ts +2 -4
- package/packages/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/simple-options.js +5 -6
- package/packages/pi-ai/dist/providers/simple-options.js.map +1 -1
- package/packages/pi-ai/dist/providers/simple-options.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/simple-options.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/simple-options.test.js +50 -0
- package/packages/pi-ai/dist/providers/simple-options.test.js.map +1 -0
- package/packages/pi-ai/src/providers/openai-codex-responses.test.ts +63 -0
- package/packages/pi-ai/src/providers/openai-codex-responses.ts +91 -1
- package/packages/pi-ai/src/providers/simple-options.test.ts +60 -0
- package/packages/pi-ai/src/providers/simple-options.ts +5 -6
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.js +66 -0
- package/packages/pi-coding-agent/dist/core/agent-session-thinking-level.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session.js +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/src/core/agent-session-thinking-level.test.ts +79 -0
- package/packages/pi-coding-agent/src/core/agent-session.ts +1 -1
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +5 -0
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/src/tui.ts +6 -0
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/packages/rpc-client/tsconfig.tsbuildinfo +1 -1
- package/src/resources/GSD-WORKFLOW.md +10 -1
- package/src/resources/extensions/claude-code-cli/partial-builder.ts +2 -1
- package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +19 -2
- package/src/resources/extensions/cmux/index.ts +6 -0
- package/src/resources/extensions/gsd/auto/contracts.ts +59 -16
- package/src/resources/extensions/gsd/auto/infra-errors.ts +9 -3
- package/src/resources/extensions/gsd/auto/loop.ts +8 -5
- package/src/resources/extensions/gsd/auto/orchestrator.ts +129 -6
- package/src/resources/extensions/gsd/auto/phases.ts +7 -1
- package/src/resources/extensions/gsd/auto/workflow-memory-pressure.ts +13 -0
- package/src/resources/extensions/gsd/auto-dispatch.ts +14 -6
- package/src/resources/extensions/gsd/auto-model-selection.ts +2 -1
- package/src/resources/extensions/gsd/auto-post-unit.ts +266 -139
- package/src/resources/extensions/gsd/auto-prompts.ts +2 -2
- package/src/resources/extensions/gsd/auto-recovery.ts +29 -0
- package/src/resources/extensions/gsd/auto-start.ts +92 -9
- package/src/resources/extensions/gsd/auto-verification.ts +36 -34
- package/src/resources/extensions/gsd/auto-worktree.ts +119 -1
- package/src/resources/extensions/gsd/auto.ts +167 -53
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +6 -1
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +9 -8
- package/src/resources/extensions/gsd/bootstrap/subagent-input.ts +19 -7
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +19 -3
- package/src/resources/extensions/gsd/clean-root-preflight.ts +174 -8
- package/src/resources/extensions/gsd/commands/catalog.ts +4 -1
- package/src/resources/extensions/gsd/commands/handlers/core.ts +40 -0
- package/src/resources/extensions/gsd/commands-bootstrap.ts +10 -0
- package/src/resources/extensions/gsd/crash-recovery.ts +30 -4
- package/src/resources/extensions/gsd/db/unit-dispatches.ts +4 -3
- package/src/resources/extensions/gsd/dispatch-guard.ts +2 -2
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +25 -13
- package/src/resources/extensions/gsd/doctor.ts +2 -27
- package/src/resources/extensions/gsd/export-html.ts +27 -427
- package/src/resources/extensions/gsd/git-service.ts +45 -1
- package/src/resources/extensions/gsd/gsd-db.ts +3 -0
- package/src/resources/extensions/gsd/guided-flow.ts +14 -7
- package/src/resources/extensions/gsd/md-importer.ts +1 -1
- package/src/resources/extensions/gsd/migrate/command.ts +5 -0
- package/src/resources/extensions/gsd/migrate/parsers.ts +11 -0
- package/src/resources/extensions/gsd/migrate/preview.ts +10 -0
- package/src/resources/extensions/gsd/migrate/transformer.ts +58 -4
- package/src/resources/extensions/gsd/migrate/writer.ts +14 -1
- package/src/resources/extensions/gsd/migration-auto-check.ts +15 -23
- package/src/resources/extensions/gsd/milestone-actions.ts +10 -4
- package/src/resources/extensions/gsd/native-git-bridge.ts +54 -12
- package/src/resources/extensions/gsd/post-execution-checks.ts +87 -2
- package/src/resources/extensions/gsd/pre-execution-checks.ts +32 -1
- package/src/resources/extensions/gsd/prompt-loader.ts +1 -1
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
- package/src/resources/extensions/gsd/prompts/complete-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/discuss-headless.md +8 -8
- package/src/resources/extensions/gsd/prompts/discuss.md +9 -9
- package/src/resources/extensions/gsd/prompts/guided-discuss-project.md +4 -4
- package/src/resources/extensions/gsd/prompts/guided-discuss-requirements.md +3 -3
- package/src/resources/extensions/gsd/prompts/plan-slice.md +4 -4
- package/src/resources/extensions/gsd/prompts/queue.md +4 -4
- package/src/resources/extensions/gsd/prompts/refine-slice.md +2 -2
- package/src/resources/extensions/gsd/prompts/rewrite-docs.md +1 -1
- package/src/resources/extensions/gsd/state-reconciliation/drift/merge-state.ts +8 -1
- package/src/resources/extensions/gsd/state-reconciliation/drift/project-md.ts +12 -15
- package/src/resources/extensions/gsd/state-reconciliation/drift/roadmap.ts +17 -25
- package/src/resources/extensions/gsd/status-guards.ts +5 -0
- package/src/resources/extensions/gsd/templates/plan.md +8 -5
- package/src/resources/extensions/gsd/templates/task-plan.md +4 -2
- package/src/resources/extensions/gsd/tests/auto-deterministic-error-classification-4973.test.ts +116 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +54 -0
- package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +487 -4
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +12 -11
- package/src/resources/extensions/gsd/tests/auto-post-unit-step-message.test.ts +12 -1
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +15 -1
- package/src/resources/extensions/gsd/tests/auto-runtime-state.test.ts +4 -4
- package/src/resources/extensions/gsd/tests/auto-start-orphan-bootstrap.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/auto-worktree-registry.test.ts +69 -1
- package/src/resources/extensions/gsd/tests/brief-command.test.ts +89 -0
- package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +107 -2
- package/src/resources/extensions/gsd/tests/closeout-git-deferral.test.ts +16 -0
- package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +4 -1
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +5 -9
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +3 -1
- package/src/resources/extensions/gsd/tests/crash-recovery-via-db.test.ts +43 -2
- package/src/resources/extensions/gsd/tests/db-authority-regression.test.ts +208 -0
- package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +59 -2
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/evidence-cross-ref.test.ts +38 -0
- package/src/resources/extensions/gsd/tests/export-html-enhancements.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/guided-discuss-project-prompt-rendering.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/guided-flow.test.ts +21 -0
- package/src/resources/extensions/gsd/tests/headless-milestone-parity.test.ts +6 -6
- package/src/resources/extensions/gsd/tests/hook-model-resolution.test.ts +5 -0
- package/src/resources/extensions/gsd/tests/infra-error.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/infra-errors-cooldown.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-runtime.test.ts +20 -0
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +103 -1
- package/src/resources/extensions/gsd/tests/integration/migrate-command.test.ts +48 -3
- package/src/resources/extensions/gsd/tests/integration/state-machine-runtime-failures.test.ts +6 -1
- package/src/resources/extensions/gsd/tests/migrate-transformer.test.ts +5 -1
- package/src/resources/extensions/gsd/tests/migrate-validator-parsers.test.ts +24 -1
- package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +6 -1
- package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +26 -18
- package/src/resources/extensions/gsd/tests/native-git-bridge-exec-fallback.test.ts +63 -2
- package/src/resources/extensions/gsd/tests/orphaned-worktree-audit.test.ts +121 -1
- package/src/resources/extensions/gsd/tests/park-db-sync.test.ts +55 -1
- package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +26 -0
- package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/plan-slice.test.ts +225 -1
- package/src/resources/extensions/gsd/tests/plan-task.test.ts +17 -0
- package/src/resources/extensions/gsd/tests/post-exec-retry-bypass.test.ts +79 -1
- package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +86 -0
- package/src/resources/extensions/gsd/tests/post-unit-git-failure.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +53 -0
- package/src/resources/extensions/gsd/tests/prompt-loader.test.ts +23 -0
- package/src/resources/extensions/gsd/tests/remediation-completion-guard.test.ts +46 -2
- package/src/resources/extensions/gsd/tests/session-switch-abort-misclassification.test.ts +10 -0
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +31 -1
- package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +6 -0
- package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +119 -23
- package/src/resources/extensions/gsd/tests/stuck-state-via-db.test.ts +64 -1
- package/src/resources/extensions/gsd/tests/summary-render-parity.test.ts +7 -3
- package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +86 -7
- package/src/resources/extensions/gsd/tests/verification-gate.test.ts +110 -1
- package/src/resources/extensions/gsd/tests/verification-verdict.test.ts +78 -0
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/workflow-memory-pressure.test.ts +21 -1
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/worktree-git-pathspec.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +64 -12
- package/src/resources/extensions/gsd/tests/worktree-lifecycle.test.ts +25 -0
- package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +54 -0
- package/src/resources/extensions/gsd/tools/complete-milestone.ts +8 -10
- package/src/resources/extensions/gsd/tools/complete-slice.ts +6 -8
- package/src/resources/extensions/gsd/tools/plan-milestone.ts +5 -1
- package/src/resources/extensions/gsd/tools/plan-slice.ts +98 -12
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +135 -0
- package/src/resources/extensions/gsd/types.ts +1 -1
- package/src/resources/extensions/gsd/unit-context-manifest.ts +47 -11
- package/src/resources/extensions/gsd/validation.ts +23 -1
- package/src/resources/extensions/gsd/verification-gate.ts +78 -6
- package/src/resources/extensions/gsd/verification-verdict.ts +47 -0
- package/src/resources/extensions/gsd/workflow-projections.ts +6 -8
- package/src/resources/extensions/gsd/worktree-lifecycle.ts +61 -10
- package/src/resources/extensions/shared/html-shell.ts +412 -0
- package/src/resources/extensions/subagent/index.ts +567 -103
- package/src/resources/extensions/subagent/launch.ts +131 -0
- package/src/resources/extensions/subagent/run-store.ts +218 -0
- package/src/resources/extensions/subagent/tests/launch.test.ts +115 -0
- package/src/resources/extensions/subagent/tests/run-store.test.ts +111 -0
- package/src/resources/extensions/visual-brief/artifact-policy.ts +41 -0
- package/src/resources/extensions/visual-brief/extension-manifest.json +8 -0
- package/src/resources/extensions/visual-brief/index.ts +8 -0
- package/src/resources/extensions/visual-brief/page-contract.ts +136 -0
- package/src/resources/extensions/visual-brief/prompts.ts +183 -0
- package/src/resources/extensions/visual-brief/tests/visual-brief.test.ts +212 -0
- package/dist/web/standalone/.next/server/chunks/5822.js +0 -2
- package/dist/web/standalone/.next/static/chunks/2556.0527fea66e123b7f.js +0 -1
- package/dist/web/standalone/.next/static/chunks/app/layout-a16c7a7ecdf0c2cf.js +0 -1
- package/dist/web/standalone/.next/static/css/54ec2745c1da488b.css +0 -1
- package/dist/web/standalone/.next/static/css/de70bee13400563f.css +0 -1
- package/dist/web/standalone/.next/static/media/4cf2300e9c8272f7-s.p.woff2 +0 -0
- package/dist/web/standalone/.next/static/media/747892c23ea88013-s.woff2 +0 -0
- package/dist/web/standalone/.next/static/media/8d697b304b401681-s.woff2 +0 -0
- package/dist/web/standalone/.next/static/media/93f479601ee12b01-s.p.woff2 +0 -0
- package/dist/web/standalone/.next/static/media/9610d9e46709d722-s.woff2 +0 -0
- package/dist/web/standalone/.next/static/media/ba015fad6dcf6784-s.woff2 +0 -0
- /package/dist/web/standalone/.next/static/{KDRTXR-22LPCsa80X9dey → euQ0CLP_v8V4e76Tu3odJ}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{KDRTXR-22LPCsa80X9dey → euQ0CLP_v8V4e76Tu3odJ}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2973],{2973:(e,s,t)=>{t.r(s),t.d(s,{VisualizerView:()=>eo});var r=t(95155),n=t(12115),a=t(57518),l=t(33024),d=t(84980),i=t(31025),o=t(89123),c=t(90425);let m=(0,c.A)("heart-pulse",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}],["path",{d:"M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"auskq0"}]]);var x=t(49619),u=t(93219),h=t(97810),p=t(15282),g=t(6962),f=t(12651),b=t(20232),j=t(16950),v=t(30125),N=t(13545),y=t(96035),w=t(21628),k=t(21362),$=t(41585),C=t(62791),S=t(48368);let A=(0,c.A)("file-braces",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);var D=t(6296),I=t(9199),M=t(91337),P=t(98234),R=t(44004),T=t(35082);let L=[{value:"progress",label:"Progress",Icon:l.A},{value:"timeline",label:"Timeline",Icon:d.A},{value:"deps",label:"Dependencies",Icon:i.A},{value:"metrics",label:"Metrics",Icon:o.A},{value:"health",label:"Health",Icon:m},{value:"agent",label:"Agent",Icon:x.A},{value:"changes",label:"Changes",Icon:u.A},{value:"knowledge",label:"Knowledge",Icon:h.A},{value:"captures",label:"Captures",Icon:p.A},{value:"export",label:"Export",Icon:g.A}];function B(e){switch(e){case"complete":case"done":return(0,r.jsx)(f.A,{className:"h-4 w-4 shrink-0 text-success"});case"active":return(0,r.jsx)(b.A,{className:"h-4 w-4 shrink-0 text-info"});case"pending":return(0,r.jsx)(j.A,{className:"h-4 w-4 shrink-0 text-muted-foreground/50"});case"parked":return(0,r.jsx)(v.A,{className:"h-4 w-4 shrink-0 text-muted-foreground"})}}function E({risk:e}){return(0,r.jsx)("span",{className:(0,M.cn)("inline-flex items-center rounded border px-2 py-0.5 text-[11px] font-semibold uppercase tracking-widest","high"===e?"bg-destructive/15 text-destructive border-destructive/25 ring-destructive/10":"medium"===e?"bg-warning/15 text-warning border-warning/25 ring-warning/10":"bg-success/15 text-success border-success/25 ring-success/10"),children:e})}function U(e){let s=new Date(e);return`${String(s.getHours()).padStart(2,"0")}:${String(s.getMinutes()).padStart(2,"0")}`}function F(e){if(!e)return"unknown";let s=new Date(e);return Number.isNaN(s.getTime())?e:s.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function H(e,s,t){return e.sliceVerifications.find(e=>e.milestoneId===s&&e.sliceId===t)}function V(e,s){return null!=e&&("string"==typeof e||"number"==typeof e||"boolean"==typeof e?String(e).toLowerCase().includes(s):Array.isArray(e)?e.some(e=>V(e,s)):"object"==typeof e&&Object.values(e).some(e=>V(e,s)))}function _(e,s){return e.filter(e=>V(e,s))}function O({children:e}){return(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)("div",{className:"h-3.5 w-0.5 rounded-full bg-foreground/25"}),(0,r.jsx)("h3",{className:"text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:e})]})}function z({message:e,icon:s=N.A}){return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center gap-4 rounded-xl border border-dashed border-border py-16 text-center",children:[(0,r.jsx)("div",{className:"rounded-full border border-border bg-muted/50 p-4",children:(0,r.jsx)(s,{className:"h-6 w-6 text-muted-foreground"})}),(0,r.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:e})]})}function q({label:e,value:s,sub:t,accent:n}){return(0,r.jsxs)("div",{className:(0,M.cn)("relative overflow-hidden rounded-xl border bg-gradient-to-br to-transparent p-5",{sky:"from-info/8 border-info/20",emerald:"from-success/8 border-success/20",amber:"from-warning/8 border-warning/20",default:"from-transparent border-border"}[n??"default"]),children:[(0,r.jsx)("p",{className:"text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:e}),(0,r.jsx)("p",{className:"mt-2 text-2xl font-bold tabular-nums leading-none tracking-tight",children:s}),t&&(0,r.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:t})]})}function K({value:e,max:s,color:t="sky",animated:n=!1}){let a=s>0?Math.max(1,e/s*100):0;return(0,r.jsx)("div",{className:"h-2 w-full overflow-hidden rounded-full bg-muted",children:(0,r.jsx)("div",{className:(0,M.cn)("h-full rounded-full transition-all duration-700",{sky:"bg-info",emerald:"bg-success",amber:"bg-warning"}[t],n&&"animate-pulse"),style:{width:`${a}%`}})})}function G({data:e}){let s=e.stats,t=s.missingSlices.length>0||s.updatedSlices.length>0||s.recentEntries.length>0;return(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Feature Snapshot"}),(0,r.jsxs)("div",{className:"mt-5 grid gap-4 sm:grid-cols-3",children:[(0,r.jsx)(q,{label:"Missing Slices",value:String(s.missingCount),accent:s.missingCount>0?"amber":"emerald"}),(0,r.jsx)(q,{label:"Updated This Week",value:String(s.updatedCount),accent:"sky"}),(0,r.jsx)(q,{label:"Recent Completions",value:String(s.recentEntries.length),accent:"emerald"})]}),t&&(0,r.jsxs)("div",{className:"mt-6 grid gap-5 lg:grid-cols-3",children:[s.missingSlices.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-3 text-xs font-semibold text-muted-foreground",children:"Missing"}),(0,r.jsx)("div",{className:"space-y-2",children:s.missingSlices.map(e=>(0,r.jsxs)("div",{className:"rounded-lg bg-muted/50 px-3 py-2",children:[(0,r.jsxs)("p",{className:"font-mono text-xs font-semibold",children:[e.milestoneId,"/",e.sliceId]}),(0,r.jsx)("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:e.title})]},`${e.milestoneId}-${e.sliceId}`))})]}),s.updatedSlices.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-3 text-xs font-semibold text-muted-foreground",children:"Updated"}),(0,r.jsx)("div",{className:"space-y-2",children:s.updatedSlices.map(e=>(0,r.jsxs)("div",{className:"rounded-lg bg-muted/50 px-3 py-2",children:[(0,r.jsxs)("p",{className:"font-mono text-xs font-semibold",children:[e.milestoneId,"/",e.sliceId]}),(0,r.jsxs)("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[F(e.completedAt)," \xb7 ",e.title]})]},`${e.milestoneId}-${e.sliceId}`))})]}),s.recentEntries.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-3 text-xs font-semibold text-muted-foreground",children:"Recent"}),(0,r.jsx)("div",{className:"space-y-2",children:s.recentEntries.map(e=>(0,r.jsxs)("div",{className:"rounded-lg bg-muted/50 px-3 py-2",children:[(0,r.jsxs)("p",{className:"font-mono text-xs font-semibold",children:[e.milestoneId,"/",e.sliceId]}),(0,r.jsx)("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:e.oneLiner||e.title})]},`${e.milestoneId}-${e.sliceId}`))})]})]})]})}function J({data:e}){if(0===e.discussion.length)return null;let s=e.discussion.reduce((e,s)=>(e[s.state]+=1,e),{discussed:0,draft:0,undiscussed:0});return(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[(0,r.jsx)(O,{children:"Discussion Status"}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs font-medium",children:[(0,r.jsxs)("span",{className:"rounded-md bg-success/10 px-2 py-1 text-success",children:["Discussed ",s.discussed]}),(0,r.jsxs)("span",{className:"rounded-md bg-warning/10 px-2 py-1 text-warning",children:["Draft ",s.draft]}),(0,r.jsxs)("span",{className:"rounded-md bg-muted px-2 py-1 text-muted-foreground",children:["Pending ",s.undiscussed]})]})]}),(0,r.jsx)("div",{className:"mt-5 grid gap-2 md:grid-cols-2",children:e.discussion.map(e=>{let s="discussed"===e.state?"text-success bg-success/10":"draft"===e.state?"text-warning bg-warning/10":"text-muted-foreground bg-muted";return(0,r.jsxs)("div",{className:"flex items-center gap-3 rounded-lg bg-muted/40 px-3 py-2.5",children:[(0,r.jsx)(y.A,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,r.jsx)("span",{className:"font-mono text-xs font-semibold",children:e.milestoneId}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm",children:e.title}),(0,r.jsx)("span",{className:(0,M.cn)("rounded-md px-2 py-0.5 text-[11px] font-semibold",s),children:e.state})]},e.milestoneId)})})]})}function W({data:e}){if(0===e.milestones.length)return(0,r.jsx)(z,{message:"No milestones defined yet.",icon:l.A});let s=e.milestones.flatMap(e=>e.slices),t={low:0,medium:0,high:0};for(let e of s)"high"===e.risk?t.high++:"medium"===e.risk?t.medium++:t.low++;return(0,r.jsxs)("div",{className:"space-y-6",children:[s.length>0&&(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Risk Heatmap"}),(0,r.jsx)("div",{className:"mt-5 space-y-3",children:e.milestones.filter(e=>e.slices.length>0).map(e=>(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("span",{className:"w-16 shrink-0 font-mono text-xs font-medium text-muted-foreground",children:e.id}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.slices.map(e=>(0,r.jsx)("div",{title:`${e.id}: ${e.title} (${e.risk})`,className:(0,M.cn)("h-6 w-6 rounded cursor-default transition-transform hover:scale-125","high"===e.risk?"bg-destructive":"medium"===e.risk?"bg-warning":"bg-success")},e.id))})]},e.id))}),(0,r.jsxs)("div",{className:"mt-5 flex items-center gap-5 text-xs text-muted-foreground",children:[(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"h-3 w-3 rounded-sm bg-success"}),"Low (",t.low,")"]}),(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"h-3 w-3 rounded-sm bg-warning"}),"Medium (",t.medium,")"]}),(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"h-3 w-3 rounded-sm bg-destructive"}),"High (",t.high,")"]})]})]}),(0,r.jsx)(G,{data:e}),(0,r.jsx)(J,{data:e}),(0,r.jsx)("div",{className:"space-y-4",children:e.milestones.map(s=>(0,r.jsxs)("div",{className:"overflow-hidden rounded-xl border border-border bg-card",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-border bg-muted/50 px-5 py-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[B(s.status),(0,r.jsx)("span",{className:"font-mono text-xs font-semibold text-muted-foreground",children:s.id}),(0,r.jsx)("span",{className:"text-sm font-semibold",children:s.title})]}),(0,r.jsx)("span",{className:(0,M.cn)("rounded-md px-2.5 py-1 text-xs font-semibold uppercase tracking-wider","complete"===s.status?"bg-success/15 text-success":"active"===s.status?"bg-info/15 text-info":"parked"===s.status?"bg-warning/15 text-warning":"bg-muted text-muted-foreground"),children:s.status})]}),("pending"===s.status||"parked"===s.status)&&s.dependsOn.length>0&&(0,r.jsxs)("div",{className:"px-5 py-2.5 text-xs text-muted-foreground border-b border-border/50",children:["Depends on ",s.dependsOn.join(", ")]}),s.slices.length>0&&(0,r.jsx)("div",{className:"divide-y divide-border/50",children:s.slices.map(t=>{var n;let a=t.tasks.filter(e=>e.done).length,l=t.done?"done":t.active?"active":"pending",d=H(e,s.id,t.id);return(0,r.jsxs)("div",{className:"px-5 py-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[B(l),(0,r.jsx)("span",{className:"font-mono text-xs font-medium text-muted-foreground",children:t.id}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:t.title}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-2.5",children:[d&&(0,r.jsxs)("span",{className:(0,M.cn)("rounded-md border px-2 py-0.5 text-[11px] font-semibold","passed"===(n=d.verificationResult)?"text-success border-success/25 bg-success/10":"failed"===n?"text-destructive border-destructive/25 bg-destructive/10":"text-muted-foreground border-border bg-muted/50"),children:[d.verificationResult||"untested",d.blockerDiscovered?" \xb7 blocker":""]}),t.depends.length>0&&(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:["deps: ",t.depends.join(", ")]}),t.tasks.length>0&&(0,r.jsxs)("span",{className:"font-mono text-xs font-medium text-muted-foreground",children:[a,"/",t.tasks.length]}),(0,r.jsx)(E,{risk:t.risk})]})]}),(t.active||t.tasks.some(e=>e.active))&&t.tasks.length>0&&(0,r.jsx)("div",{className:"ml-7 mt-3 space-y-1",children:t.tasks.map(e=>(0,r.jsxs)("div",{className:(0,M.cn)("flex items-center gap-2.5 rounded-lg px-3 py-2 transition-colors",e.active?"bg-info/8 border border-info/20":"hover:bg-muted/50"),children:[e.done?B("done"):e.active?B("active"):B("pending"),(0,r.jsx)("span",{className:"font-mono text-xs font-medium text-muted-foreground",children:e.id}),(0,r.jsx)("span",{className:(0,M.cn)("text-sm",e.done&&"text-muted-foreground line-through",e.active&&"font-semibold text-info",!e.done&&!e.active&&"text-muted-foreground"),children:e.title}),e.estimate&&(0,r.jsx)("span",{className:"ml-auto font-mono text-xs text-muted-foreground",children:e.estimate}),e.active&&(0,r.jsx)("span",{className:"rounded-md bg-info/15 px-2 py-0.5 text-[11px] font-bold uppercase tracking-wider text-info",children:"running"})]},e.id))})]},t.id)})})]},s.id))})]})}function X({data:e}){let s=e.sliceVerifications.filter(e=>e.provides.length>0),t=e.sliceVerifications.filter(e=>e.requires.length>0);return 0===s.length&&0===t.length?null:(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Data Flow"}),(0,r.jsxs)("div",{className:"mt-5 grid gap-5 lg:grid-cols-2",children:[s.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-3 text-xs font-semibold text-muted-foreground",children:"Provides"}),(0,r.jsx)("div",{className:"space-y-2",children:s.flatMap(e=>e.provides.map(s=>(0,r.jsxs)("div",{className:"flex items-center gap-3 rounded-lg bg-muted/50 px-3 py-2.5",children:[(0,r.jsx)("span",{className:"font-mono text-xs font-semibold",children:e.sliceId}),(0,r.jsx)(w.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,r.jsx)("span",{className:"truncate text-sm text-muted-foreground",children:s})]},`${e.milestoneId}-${e.sliceId}-${s}`)))})]}),t.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-3 text-xs font-semibold text-muted-foreground",children:"Requires"}),(0,r.jsx)("div",{className:"space-y-2",children:t.flatMap(e=>e.requires.map(s=>(0,r.jsxs)("div",{className:"flex items-center gap-3 rounded-lg bg-muted/50 px-3 py-2.5",children:[(0,r.jsx)("span",{className:"truncate text-sm text-muted-foreground",children:s.provides}),(0,r.jsx)(w.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,r.jsx)("span",{className:"font-mono text-xs font-semibold",children:s.slice})]},`${e.milestoneId}-${e.sliceId}-${s.slice}-${s.provides}`)))})]})]})]})}function Q({data:e}){let s,t=e.criticalPath,n=e.milestones.find(e=>"active"===e.status),a=e.milestones.filter(e=>e.dependsOn.length>0);return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Milestone Dependencies"}),(0,r.jsx)("div",{className:"mt-5",children:0===a.length?(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"No milestone dependencies configured."}):(0,r.jsx)("div",{className:"flex flex-col gap-3",children:a.flatMap(e=>e.dependsOn.map(s=>(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("span",{className:"rounded-lg border border-info/25 bg-info/10 px-3 py-1.5 font-mono text-sm font-semibold text-info",children:s}),(0,r.jsx)(w.A,{className:"h-4 w-4 text-muted-foreground"}),(0,r.jsx)("span",{className:"rounded-lg border border-border bg-muted/50 px-3 py-1.5 font-mono text-sm font-medium",children:e.id}),(0,r.jsx)("span",{className:"text-sm text-muted-foreground",children:e.title})]},`${s}-${e.id}`)))})})]}),(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Slice Dependencies — Active Milestone"}),(0,r.jsx)("div",{className:"mt-5",children:n?0===(s=n.slices.filter(e=>e.depends.length>0)).length?(0,r.jsxs)("p",{className:"text-sm text-muted-foreground",children:["No slice dependencies in ",n.id,"."]}):(0,r.jsx)("div",{className:"flex flex-col gap-3",children:s.flatMap(e=>e.depends.map(s=>(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("span",{className:"rounded-lg border border-info/25 bg-info/10 px-3 py-1.5 font-mono text-sm font-semibold text-info",children:s}),(0,r.jsx)(w.A,{className:"h-4 w-4 text-muted-foreground"}),(0,r.jsx)("span",{className:"rounded-lg border border-border bg-muted/50 px-3 py-1.5 font-mono text-sm font-medium",children:e.id}),(0,r.jsx)("span",{className:"text-sm text-muted-foreground",children:e.title})]},`${s}-${e.id}`)))}):(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"No active milestone."})})]}),(0,r.jsx)(X,{data:e}),(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Critical Path"}),(0,r.jsx)("div",{className:"mt-5",children:0===t.milestonePath.length?(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"No critical path data."}):(0,r.jsxs)("div",{className:"space-y-7",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-3 text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:"Milestone Chain"}),(0,r.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:t.milestonePath.map((e,s)=>(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-1.5 font-mono text-sm font-bold text-destructive",children:e}),s<t.milestonePath.length-1&&(0,r.jsx)(k.A,{className:"h-4 w-4 text-muted-foreground"})]},e))})]}),Object.keys(t.milestoneSlack).length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-3 text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:"Milestone Slack"}),(0,r.jsx)("div",{className:"flex flex-col gap-2",children:e.milestones.filter(e=>!t.milestonePath.includes(e.id)).map(e=>(0,r.jsxs)("div",{className:"flex items-center gap-4 rounded-lg bg-muted/50 px-4 py-2.5",children:[(0,r.jsx)("span",{className:"w-16 font-mono text-sm font-semibold",children:e.id}),(0,r.jsx)("span",{className:"text-sm text-muted-foreground",children:e.title}),(0,r.jsxs)("span",{className:"ml-auto font-mono text-xs text-muted-foreground",children:["slack: ",t.milestoneSlack[e.id]??0]})]},e.id))})]}),t.slicePath.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-3 text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:"Slice Critical Path"}),(0,r.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:t.slicePath.map((e,s)=>(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"rounded-lg border border-warning/30 bg-warning/10 px-3 py-1.5 font-mono text-sm font-semibold text-warning",children:e}),s<t.slicePath.length-1&&(0,r.jsx)(k.A,{className:"h-4 w-4 text-muted-foreground"})]},e))}),n&&(0,r.jsx)("div",{className:"mt-3 space-y-2",children:t.slicePath.map(e=>n.slices.find(s=>s.id===e)).filter(e=>null!=e&&!e.done&&!e.active).map(e=>(0,r.jsxs)("div",{className:"flex items-center gap-2.5 rounded-lg border border-warning/20 bg-warning/8 px-4 py-2.5 text-sm text-warning",children:[(0,r.jsx)($.A,{className:"h-4 w-4 shrink-0"}),(0,r.jsx)("span",{className:"font-mono font-semibold",children:e.id}),(0,r.jsx)("span",{children:"is on the critical path but not yet started"})]},e.id))})]}),Object.keys(t.sliceSlack).length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-3 text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:"Slice Slack"}),(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(t.sliceSlack).map(([e,s])=>(0,r.jsxs)("span",{className:"rounded-lg border border-border bg-muted/50 px-3 py-1.5 font-mono text-xs text-muted-foreground",children:[e,": ",s]},e))})]})]})})]})]})}function Y({data:e}){if(!e.totals)return(0,r.jsx)(z,{message:"No metrics data available.",icon:o.A});let s=e.totals;return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[(0,r.jsx)(q,{label:"Execution Units",value:String(s.units),accent:"default"}),(0,r.jsx)(q,{label:"Total Cost",value:(0,R.BD)(s.cost),accent:"emerald"}),(0,r.jsx)(q,{label:"Duration",value:(0,R.a3)(s.duration),accent:"sky"}),(0,r.jsx)(q,{label:"Total Tokens",value:(0,R.ap)(s.tokens.total),sub:`${(0,R.ap)(s.tokens.input)} in \xb7 ${(0,R.ap)(s.tokens.output)} out`,accent:"amber"})]}),e.byPhase.length>0&&(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Cost by Phase"}),(0,r.jsx)("div",{className:"mt-5 space-y-5",children:e.byPhase.map(e=>{let t=s.cost>0?e.cost/s.cost*100:0;return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-sm font-semibold",children:e.phase}),(0,r.jsxs)("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[(0,r.jsx)("span",{className:"font-mono font-medium text-foreground",children:(0,R.BD)(e.cost)}),(0,r.jsxs)("span",{children:[t.toFixed(1),"%"]}),(0,r.jsxs)("span",{children:[(0,R.ap)(e.tokens.total)," tok"]}),(0,r.jsxs)("span",{children:[e.units," units"]})]})]}),(0,r.jsx)(K,{value:t,max:100,color:"sky"})]},e.phase)})})]}),e.byModel.length>0&&(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Cost by Model"}),(0,r.jsx)("div",{className:"mt-5 space-y-5",children:e.byModel.map(e=>{let t=s.cost>0?e.cost/s.cost*100:0;return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,r.jsx)("span",{className:"font-mono text-sm font-medium",children:e.model}),(0,r.jsxs)("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[(0,r.jsx)("span",{className:"font-mono font-medium text-foreground",children:(0,R.BD)(e.cost)}),(0,r.jsxs)("span",{children:[t.toFixed(1),"%"]}),(0,r.jsxs)("span",{children:[(0,R.ap)(e.tokens.total)," tok"]}),(0,r.jsxs)("span",{children:[e.units," units"]})]})]}),(0,r.jsx)(K,{value:t,max:100,color:"emerald"})]},e.model)})})]}),e.byTier.length>0&&(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Cost by Routing Tier"}),(0,r.jsx)("div",{className:"mt-5 space-y-5",children:e.byTier.map(e=>{let t=s.cost>0?e.cost/s.cost*100:0;return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,r.jsx)("span",{className:"font-mono text-sm font-medium",children:e.tier}),(0,r.jsxs)("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[(0,r.jsx)("span",{className:"font-mono font-medium text-foreground",children:(0,R.BD)(e.cost)}),(0,r.jsxs)("span",{children:[t.toFixed(1),"%"]}),(0,r.jsxs)("span",{children:[e.units," units"]}),e.downgraded>0&&(0,r.jsxs)("span",{children:[e.downgraded," downgraded"]})]})]}),(0,r.jsx)(K,{value:t,max:100,color:"amber"})]},e.tier)})}),e.tierSavingsLine&&(0,r.jsx)("div",{className:"mt-5 rounded-lg border border-success/20 bg-success/8 px-4 py-3 text-sm text-success",children:e.tierSavingsLine})]}),e.bySlice.length>0&&(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Cost by Slice"}),(0,r.jsx)("div",{className:"mt-5 overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"border-b border-border text-left text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:[(0,r.jsx)("th",{className:"pb-3 pr-5",children:"Slice"}),(0,r.jsx)("th",{className:"pb-3 pr-5 text-right",children:"Units"}),(0,r.jsx)("th",{className:"pb-3 pr-5 text-right",children:"Cost"}),(0,r.jsx)("th",{className:"pb-3 pr-5 text-right",children:"Duration"}),(0,r.jsx)("th",{className:"pb-3 text-right",children:"Tokens"})]})}),(0,r.jsx)("tbody",{className:"divide-y divide-border/50",children:e.bySlice.map(e=>(0,r.jsxs)("tr",{className:"transition-colors hover:bg-muted/50",children:[(0,r.jsx)("td",{className:"py-3 pr-5 font-mono text-xs font-semibold",children:e.sliceId}),(0,r.jsx)("td",{className:"py-3 pr-5 text-right tabular-nums text-muted-foreground",children:e.units}),(0,r.jsx)("td",{className:"py-3 pr-5 text-right tabular-nums font-medium",children:(0,R.BD)(e.cost)}),(0,r.jsx)("td",{className:"py-3 pr-5 text-right tabular-nums text-muted-foreground",children:(0,R.a3)(e.duration)}),(0,r.jsx)("td",{className:"py-3 text-right tabular-nums text-muted-foreground",children:(0,R.ap)(e.tokens.total)})]},e.sliceId))})]})})]}),e.bySlice.length>=2&&(0,r.jsx)(Z,{data:e,totals:s})]})}function Z({data:e,totals:s}){let t=e.bySlice.filter(e=>e.sliceId.includes("/"));if(t.length<2)return null;let n=t.reduce((e,s)=>e+s.cost,0)/t.length,a=n*e.remainingSliceCount,l=s.cost+a,d=s.duration>0?s.cost/(s.duration/36e5):0;return(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Projections"}),(0,r.jsxs)("div",{className:"mt-5 grid grid-cols-2 gap-4 sm:grid-cols-4",children:[(0,r.jsx)(q,{label:"Avg / Slice",value:(0,R.BD)(n)}),(0,r.jsx)(q,{label:"Projected Remaining",value:(0,R.BD)(a),sub:`${e.remainingSliceCount} slices left`}),(0,r.jsx)(q,{label:"Projected Total",value:(0,R.BD)(l)}),d>0&&(0,r.jsx)(q,{label:"Burn Rate",value:`${(0,R.BD)(d)}/hr`})]}),l>2*s.cost&&e.remainingSliceCount>0&&(0,r.jsxs)("div",{className:"mt-4 flex items-center gap-2.5 rounded-lg border border-warning/20 bg-warning/8 px-4 py-3 text-sm text-warning",children:[(0,r.jsx)($.A,{className:"h-4 w-4 shrink-0"}),"Projected total ",(0,R.BD)(l)," exceeds 2\xd7 current spend"]})]})}function ee({data:e}){let s=e.health,t=e.totals?.cost??0,n=s.budgetCeiling&&s.budgetCeiling>0?Math.min(100,t/s.budgetCeiling*100):0,a=s.providers.filter(e=>!e.ok),l=s.doctorHistory??[];return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[(0,r.jsx)(q,{label:"Budget",value:void 0!==s.budgetCeiling?(0,R.BD)(s.budgetCeiling):"unset",sub:(0,R.BD)(t),accent:n>=90?"amber":"emerald"}),(0,r.jsx)(q,{label:"Token Profile",value:s.tokenProfile,accent:"sky"}),(0,r.jsx)(q,{label:"Tool Calls",value:String(s.toolCalls)}),(0,r.jsx)(q,{label:"Pending Captures",value:String(e.captures.pendingCount),accent:e.captures.pendingCount>0?"amber":"default"})]}),(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Budget Pressure"}),(0,r.jsxs)("div",{className:"mt-5 space-y-5",children:[void 0!==s.budgetCeiling?(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"mb-2 flex items-center justify-between text-sm",children:[(0,r.jsx)("span",{className:"font-medium",children:"Spend"}),(0,r.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:[(0,R.BD)(t)," / ",(0,R.BD)(s.budgetCeiling)]})]}),(0,r.jsx)(K,{value:n,max:100,color:n>=90?"amber":"emerald"})]}):(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"No budget ceiling set."}),(0,r.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"mb-2 flex items-center justify-between text-sm",children:[(0,r.jsx)("span",{className:"font-medium",children:"Truncation"}),(0,r.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:[s.truncationRate.toFixed(1),"%"]})]}),(0,r.jsx)(K,{value:Math.min(s.truncationRate,100),max:100,color:s.truncationRate>=30?"amber":"sky"})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"mb-2 flex items-center justify-between text-sm",children:[(0,r.jsx)("span",{className:"font-medium",children:"Continue-here"}),(0,r.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:[s.continueHereRate.toFixed(1),"%"]})]}),(0,r.jsx)(K,{value:Math.min(s.continueHereRate,100),max:100,color:s.continueHereRate>=30?"amber":"sky"})]})]})]})]}),s.tierBreakdown.length>0&&(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Routing"}),(0,r.jsx)("div",{className:"mt-5 space-y-3",children:s.tierBreakdown.map(e=>(0,r.jsxs)("div",{className:"flex items-center gap-4 rounded-lg bg-muted/50 px-4 py-3",children:[(0,r.jsx)("span",{className:"w-24 font-mono text-xs font-semibold",children:e.tier}),(0,r.jsxs)("span",{className:"text-sm text-muted-foreground",children:[e.units," units"]}),(0,r.jsx)("span",{className:"ml-auto font-mono text-sm font-medium",children:(0,R.BD)(e.cost)}),e.downgraded>0&&(0,r.jsxs)("span",{className:"rounded-md bg-warning/10 px-2 py-0.5 text-xs text-warning",children:[e.downgraded," downgraded"]})]},e.tier))}),s.tierSavingsLine&&(0,r.jsx)("p",{className:"mt-4 text-sm text-success",children:s.tierSavingsLine})]}),(s.environmentIssues.length>0||a.length>0||s.skillSummary.total>0)&&(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Readiness"}),(0,r.jsxs)("div",{className:"mt-5 grid gap-5 lg:grid-cols-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-3 text-xs font-semibold text-muted-foreground",children:"Environment"}),0===s.environmentIssues.length?(0,r.jsx)("p",{className:"text-sm text-success",children:"No environment issues."}):(0,r.jsx)("div",{className:"space-y-2",children:s.environmentIssues.map(e=>(0,r.jsxs)("div",{className:"rounded-lg bg-muted/50 px-3 py-2",children:[(0,r.jsx)("p",{className:(0,M.cn)("text-sm font-medium","error"===e.status?"text-destructive":"text-warning"),children:e.message}),e.detail&&(0,r.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e.detail})]},`${e.name}-${e.message}`))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-3 text-xs font-semibold text-muted-foreground",children:"Providers"}),0===s.providers.length?(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"No provider checks available."}):(0,r.jsx)("div",{className:"space-y-2",children:s.providers.map(e=>(0,r.jsxs)("div",{className:"flex items-start gap-2 rounded-lg bg-muted/50 px-3 py-2",children:[e.ok?(0,r.jsx)(f.A,{className:"mt-0.5 h-4 w-4 shrink-0 text-success"}):(0,r.jsx)(C.A,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"truncate text-sm font-medium",children:e.label}),(0,r.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:e.message})]})]},e.name))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-3 text-xs font-semibold text-muted-foreground",children:"Skills"}),0===s.skillSummary.total?(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"No skill report available."}):(0,r.jsxs)("div",{className:"rounded-lg bg-muted/50 px-3 py-3",children:[(0,r.jsxs)("p",{className:"text-sm font-medium",children:[s.skillSummary.total," skills tracked"]}),(0,r.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[s.skillSummary.criticalCount," critical \xb7 ",s.skillSummary.warningCount," warning"]}),s.skillSummary.topIssue&&(0,r.jsx)("p",{className:"mt-3 text-xs text-warning",children:s.skillSummary.topIssue})]})]})]})]}),s.progressScore&&(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Progress Score"}),(0,r.jsxs)("div",{className:"mt-5 flex items-start gap-4",children:[(0,r.jsx)("div",{className:(0,M.cn)("mt-1 h-3 w-3 rounded-full","green"===s.progressScore.level?"bg-success":"yellow"===s.progressScore.level?"bg-warning":"bg-destructive")}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-semibold",children:s.progressScore.summary}),(0,r.jsx)("div",{className:"mt-3 space-y-1.5",children:s.progressScore.signals.map((e,s)=>(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:e.label},`${e.kind}-${s}`))})]})]})]}),l.length>0&&(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Doctor History"}),(0,r.jsx)("div",{className:"mt-5 space-y-3",children:l.slice(0,10).map(e=>(0,r.jsxs)("div",{className:"rounded-lg bg-muted/50 px-4 py-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[e.ok?(0,r.jsx)(f.A,{className:"h-4 w-4 shrink-0 text-success"}):(0,r.jsx)($.A,{className:"h-4 w-4 shrink-0 text-warning"}),(0,r.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.ts.replace("T"," ").slice(0,19)}),e.scope&&(0,r.jsx)("span",{className:"rounded-md bg-info/10 px-2 py-0.5 text-xs text-info",children:e.scope}),(0,r.jsx)("span",{className:"min-w-0 truncate text-sm",children:e.summary||`${e.errors} errors, ${e.warnings} warnings, ${e.fixes} fixes`})]}),e.issues&&e.issues.length>0&&(0,r.jsx)("div",{className:"mt-3 space-y-1",children:e.issues.slice(0,3).map(e=>(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:e.message},`${e.code}-${e.unitId}-${e.message}`))})]},`${e.ts}-${e.codes.join("-")}`))})]})]})}function es({data:e}){let s=[...e.units].sort((e,s)=>e.startedAt-s.startedAt).slice(-30),t=s.some(e=>!e.finishedAt||0===e.finishedAt),[a,l]=(0,n.useState)(()=>Date.now());(0,n.useEffect)(()=>{if(!t)return;let e=window.setInterval(()=>{l(Date.now())},1e3);return()=>window.clearInterval(e)},[t]);let i=t?a:0,o=(0,n.useCallback)(e=>(e.finishedAt||i)-e.startedAt,[i]);if(0===e.units.length)return(0,r.jsx)(z,{message:"No execution history yet.",icon:d.A});let c=Math.max(...s.map(o),1);return(0,r.jsx)("div",{className:"space-y-4",children:(0,r.jsxs)("div",{className:"overflow-hidden rounded-xl border border-border bg-card",children:[(0,r.jsxs)("div",{className:"border-b border-border bg-muted/50 px-6 py-4",children:[(0,r.jsx)(O,{children:"Execution Timeline"}),(0,r.jsxs)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:["Showing ",s.length," of ",e.units.length," units — most recent first"]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-[3.5rem_1.5rem_5rem_8rem_1fr_4.5rem_5rem] items-center gap-3 border-b border-border/50 px-6 py-2.5 text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:[(0,r.jsx)("span",{children:"Time"}),(0,r.jsx)("span",{}),(0,r.jsx)("span",{children:"Type"}),(0,r.jsx)("span",{children:"ID"}),(0,r.jsx)("span",{children:"Duration"}),(0,r.jsx)("span",{className:"text-right",children:"Time"}),(0,r.jsx)("span",{className:"text-right",children:"Cost"})]}),(0,r.jsx)("div",{className:"divide-y divide-border/40",children:[...s].reverse().map((e,s)=>{let t=o(e),n=!e.finishedAt||0===e.finishedAt;return(0,r.jsxs)("div",{className:"grid grid-cols-[3.5rem_1.5rem_5rem_8rem_1fr_4.5rem_5rem] items-center gap-3 px-6 py-3.5 transition-colors hover:bg-muted/50",children:[(0,r.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:U(e.startedAt)}),n?(0,r.jsx)(b.A,{className:"h-3.5 w-3.5 shrink-0 text-info"}):(0,r.jsx)(f.A,{className:"h-3.5 w-3.5 shrink-0 text-success"}),(0,r.jsx)("span",{className:"truncate text-xs font-medium",children:e.type}),(0,r.jsx)("span",{className:"truncate font-mono text-xs text-muted-foreground",children:e.id}),(0,r.jsx)("div",{className:"hidden sm:block",children:(0,r.jsx)(K,{value:t/c*100,max:100,color:"sky",animated:n})}),(0,r.jsx)("span",{className:"text-right font-mono text-xs tabular-nums text-muted-foreground",children:(0,R.a3)(t)}),(0,r.jsx)("span",{className:"text-right font-mono text-xs tabular-nums font-medium",children:(0,R.BD)(e.cost)})]},`${e.id}-${e.startedAt}-${s}`)})})]})})}function et({data:e}){let s=e.agentActivity;if(!s)return(0,r.jsx)(z,{message:"No agent activity data available.",icon:x.A});let t=s.completedUnits,n=Math.max(t,s.totalSlices),a=n>0?Math.min(100,Math.round(t/n*100)):0;return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsxs)("div",{className:(0,M.cn)("relative flex h-10 w-10 items-center justify-center rounded-full",s.active?"bg-success/15":"bg-muted"),children:[s.active&&(0,r.jsx)("div",{className:"absolute inset-0 animate-ping rounded-full bg-success/20"}),(0,r.jsx)("div",{className:(0,M.cn)("h-3 w-3 rounded-full",s.active?"bg-success":"bg-muted-foreground/30")})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-xl font-bold",children:s.active?"Active":"Idle"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:s.active?"Agent is running":"Waiting for next task"})]})]}),s.active&&(0,r.jsxs)("div",{className:"text-right",children:[(0,r.jsx)("p",{className:"font-mono text-lg font-bold",children:(0,R.a3)(s.elapsed)}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"elapsed"})]})]}),s.currentUnit&&(0,r.jsxs)("div",{className:"mt-5 flex items-center gap-3 rounded-xl border border-info/20 bg-info/8 px-5 py-3.5",children:[(0,r.jsx)(b.A,{className:"h-4 w-4 shrink-0 text-info"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Currently executing"}),(0,r.jsxs)("p",{className:"mt-0.5 font-mono text-sm font-semibold text-info",children:[s.currentUnit.type," — ",s.currentUnit.id]})]})]})]}),(0,r.jsxs)("div",{className:"grid gap-4 sm:grid-cols-3",children:[(0,r.jsx)(q,{label:"Truncation",value:`${e.health.truncationRate.toFixed(1)}%`,accent:e.health.truncationRate>=30?"amber":"default"}),(0,r.jsx)(q,{label:"Continue-here",value:`${e.health.continueHereRate.toFixed(1)}%`,accent:e.health.continueHereRate>=30?"amber":"default"}),(0,r.jsx)(q,{label:"Pending Captures",value:String(e.captures.pendingCount),accent:e.captures.pendingCount>0?"amber":"default"})]}),n>0&&(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,r.jsx)(O,{children:"Completion Progress"}),(0,r.jsxs)("span",{className:"font-mono text-sm text-muted-foreground",children:[t," / ",n," slices"]})]}),(0,r.jsx)(K,{value:t,max:n,color:"emerald"}),(0,r.jsxs)("div",{className:"mt-3 flex items-center justify-between text-xs text-muted-foreground",children:[(0,r.jsxs)("span",{children:[a,"% complete"]}),(0,r.jsxs)("span",{children:[n-t," remaining"]})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[(0,r.jsx)(q,{label:"Completion Rate",value:s.completionRate>0?`${s.completionRate.toFixed(1)}/hr`:"—",accent:"sky"}),(0,r.jsx)(q,{label:"Session Cost",value:(0,R.BD)(s.sessionCost),accent:"emerald"}),(0,r.jsx)(q,{label:"Session Tokens",value:(0,R.ap)(s.sessionTokens),accent:"amber"}),(0,r.jsx)(q,{label:"Completed",value:String(s.completedUnits)})]}),e.units.filter(e=>e.finishedAt>0).length>0&&(0,r.jsxs)("div",{className:"overflow-hidden rounded-xl border border-border bg-card",children:[(0,r.jsx)("div",{className:"border-b border-border bg-muted/50 px-6 py-4",children:(0,r.jsx)(O,{children:"Recent Completed Units"})}),(0,r.jsx)("div",{className:"divide-y divide-border/40",children:e.units.filter(e=>e.finishedAt>0).slice(-5).reverse().map((e,s)=>(0,r.jsxs)("div",{className:"flex items-center gap-4 px-6 py-4 transition-colors hover:bg-muted/50",children:[(0,r.jsx)("span",{className:"w-12 font-mono text-xs text-muted-foreground",children:U(e.startedAt)}),(0,r.jsx)(f.A,{className:"h-4 w-4 shrink-0 text-success"}),(0,r.jsx)("span",{className:"flex-1 truncate text-sm font-medium",children:e.type}),(0,r.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.id}),(0,r.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:(0,R.a3)(e.finishedAt-e.startedAt)}),(0,r.jsx)("span",{className:"font-mono text-xs tabular-nums font-semibold",children:(0,R.BD)(e.cost)})]},`${e.id}-${s}`))})]})]})}function er({data:e}){let s=e.changelog.entries;if(0===s.length)return(0,r.jsx)(z,{message:"No completed slices yet.",icon:u.A});let t=[...s].reverse();return(0,r.jsx)("div",{className:"space-y-4",children:t.map((s,t)=>{let n=H(e,s.milestoneId,s.sliceId);return(0,r.jsxs)("div",{className:"overflow-hidden rounded-xl border border-border bg-card",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-border bg-muted/50 px-6 py-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(f.A,{className:"h-4 w-4 shrink-0 text-success"}),(0,r.jsxs)("span",{className:"font-mono text-xs font-bold text-success",children:[s.milestoneId,"/",s.sliceId]}),(0,r.jsx)("span",{className:"text-sm font-semibold",children:s.title})]}),s.completedAt&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:function(e){let s=Date.now()-new Date(e).getTime();if(s<6e4)return"just now";let t=Math.floor(s/6e4);if(t<60)return`${t}m ago`;let r=Math.floor(t/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}(s.completedAt)})]}),(0,r.jsxs)("div",{className:"px-6 py-5 space-y-5",children:[s.oneLiner&&(0,r.jsxs)("p",{className:"text-sm text-muted-foreground italic leading-relaxed border-l-2 border-muted pl-4",children:["“",s.oneLiner,"”"]}),s.filesModified.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-3 text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:"Files Modified"}),(0,r.jsx)("div",{className:"space-y-2",children:s.filesModified.map((e,s)=>(0,r.jsxs)("div",{className:"flex items-start gap-3 rounded-lg bg-muted/50 px-4 py-2.5",children:[(0,r.jsx)(f.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-success/70"}),(0,r.jsx)("span",{className:"font-mono text-xs font-medium text-muted-foreground",children:e.path}),e.description&&(0,r.jsxs)("span",{className:"ml-1 text-xs text-muted-foreground",children:["— ",e.description]})]},s))})]}),n&&(n.keyDecisions.length>0||n.patternsEstablished.length>0)&&(0,r.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[n.keyDecisions.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-3 text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:"Decisions"}),(0,r.jsx)("div",{className:"space-y-2",children:n.keyDecisions.map((e,s)=>(0,r.jsx)("p",{className:"rounded-lg bg-muted/50 px-4 py-2.5 text-xs text-muted-foreground",children:e},s))})]}),n.patternsEstablished.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-3 text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:"Patterns"}),(0,r.jsx)("div",{className:"space-y-2",children:n.patternsEstablished.map((e,s)=>(0,r.jsx)("p",{className:"rounded-lg bg-muted/50 px-4 py-2.5 text-xs text-muted-foreground",children:e},s))})]})]})]})]},`${s.milestoneId}-${s.sliceId}-${t}`)})})}function en({data:e}){let s=e.knowledge;return s.exists?0===s.rules.length&&0===s.patterns.length&&0===s.lessons.length?(0,r.jsx)(z,{message:"Project knowledge exists but has no entries yet.",icon:h.A}):(0,r.jsxs)("div",{className:"space-y-6",children:[s.rules.length>0&&(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Rules"}),(0,r.jsx)("div",{className:"mt-5 space-y-3",children:s.rules.map(e=>(0,r.jsxs)("div",{className:"rounded-lg bg-muted/50 px-4 py-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("span",{className:"font-mono text-xs font-semibold text-info",children:e.id}),(0,r.jsx)("span",{className:"rounded-md bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:e.scope})]}),(0,r.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:e.content})]},e.id))})]}),s.patterns.length>0&&(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Patterns"}),(0,r.jsx)("div",{className:"mt-5 space-y-3",children:s.patterns.map(e=>(0,r.jsxs)("div",{className:"rounded-lg bg-muted/50 px-4 py-3",children:[(0,r.jsx)("p",{className:"font-mono text-xs font-semibold text-info",children:e.id}),(0,r.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:e.content})]},e.id))})]}),s.lessons.length>0&&(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Lessons Learned"}),(0,r.jsx)("div",{className:"mt-5 space-y-3",children:s.lessons.map(e=>(0,r.jsxs)("div",{className:"rounded-lg bg-muted/50 px-4 py-3",children:[(0,r.jsx)("p",{className:"font-mono text-xs font-semibold text-info",children:e.id}),(0,r.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:e.content})]},e.id))})]})]}):(0,r.jsx)(z,{message:"No project knowledge file found.",icon:h.A})}function ea({data:e}){let s=e.captures,t=(0,R.vX)(s),n=[...s.entries].sort((e,s)=>{let t={pending:0,triaged:1,resolved:2};return t[e.status]-t[s.status]});return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[(0,r.jsx)(q,{label:"Total",value:String(s.totalCount)}),(0,r.jsx)(q,{label:"Pending",value:String(t.pending),accent:t.pending>0?"amber":"default"}),(0,r.jsx)(q,{label:"Triaged",value:String(t.triaged),accent:"sky"}),(0,r.jsx)(q,{label:"Resolved",value:String(t.resolved),accent:"emerald"})]}),0===n.length?(0,r.jsx)(z,{message:"No captures recorded yet.",icon:p.A}):(0,r.jsxs)("div",{className:"overflow-hidden rounded-xl border border-border bg-card",children:[(0,r.jsx)("div",{className:"border-b border-border bg-muted/50 px-6 py-4",children:(0,r.jsx)(O,{children:"Captured Notes"})}),(0,r.jsx)("div",{className:"divide-y divide-border/40",children:n.map(e=>{var s;let t="pending"===e.status?"text-warning bg-warning/10":"triaged"===e.status?"text-info bg-info/10":"text-success bg-success/10";return(0,r.jsxs)("div",{className:"px-6 py-4",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,r.jsx)("span",{className:"font-mono text-xs font-bold text-info",children:e.id}),(0,r.jsx)("span",{className:(0,M.cn)("rounded-md px-2 py-0.5 text-[11px] font-semibold",t),children:e.status}),e.classification&&(0,r.jsx)("span",{className:(0,M.cn)("rounded-md px-2 py-0.5 text-[11px] font-semibold","inject"===(s=e.classification)||"stop"===s?"text-warning bg-warning/10":"replan"===s||"backtrack"===s?"text-destructive bg-destructive/10":"quick-task"===s?"text-info bg-info/10":"text-muted-foreground bg-muted"),children:e.classification}),(0,r.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:F(e.timestamp)})]}),(0,r.jsx)("p",{className:"mt-3 text-sm leading-relaxed text-muted-foreground",children:e.text}),(e.rationale||e.resolution)&&(0,r.jsxs)("div",{className:"mt-3 rounded-lg bg-muted/50 px-4 py-3 text-xs text-muted-foreground",children:[e.rationale&&(0,r.jsxs)("p",{children:["Rationale: ",e.rationale]}),e.resolution&&(0,r.jsxs)("p",{className:"mt-1",children:["Resolution: ",e.resolution]})]})]},e.id)})})]})]})}function el({data:e}){let s=(0,n.useCallback)((e,s,t)=>{let r=new Blob([e],{type:t}),n=URL.createObjectURL(r),a=document.createElement("a");a.href=n,a.download=s,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(n)},[]),t=(0,n.useCallback)(()=>{let s=[];for(let t of(s.push("# GSD Workflow Report"),s.push(""),s.push(`Generated: ${new Date().toISOString()}`),s.push(`Phase: ${e.phase}`),s.push(""),s.push("## Milestones"),s.push(""),e.milestones)){let e="complete"===t.status?"✓":"active"===t.status?"▸":"○";for(let r of(s.push(`### ${e} ${t.id}: ${t.title} (${t.status})`),t.dependsOn.length>0&&s.push(`Depends on: ${t.dependsOn.join(", ")}`),s.push(""),t.slices)){let e=r.done?"✓":r.active?"▸":"○";for(let t of(s.push(`- ${e} **${r.id}**: ${r.title} [risk: ${r.risk}]`),r.tasks)){let e=t.done?"✓":t.active?"▸":"○";s.push(` - ${e} ${t.id}: ${t.title}`)}}s.push("")}if(e.totals&&(s.push("## Metrics Summary"),s.push(""),s.push("| Metric | Value |"),s.push("|--------|-------|"),s.push(`| Units | ${e.totals.units} |`),s.push(`| Total Cost | ${(0,R.BD)(e.totals.cost)} |`),s.push(`| Duration | ${(0,R.a3)(e.totals.duration)} |`),s.push(`| Tokens | ${(0,R.ap)(e.totals.tokens.total)} |`),s.push("")),e.byTier.length>0){for(let t of(s.push("## Routing Tiers"),s.push(""),s.push("| Tier | Units | Cost | Downgraded |"),s.push("|------|-------|------|------------|"),e.byTier))s.push(`| ${t.tier} | ${t.units} | ${(0,R.BD)(t.cost)} | ${t.downgraded} |`);e.tierSavingsLine&&s.push(`
|
|
2
|
+
${e.tierSavingsLine}`),s.push("")}if(s.push("## Health"),s.push(""),s.push("| Signal | Value |"),s.push("|--------|-------|"),s.push(`| Token profile | ${e.health.tokenProfile} |`),s.push(`| Truncation | ${e.health.truncationRate.toFixed(1)}% |`),s.push(`| Continue-here | ${e.health.continueHereRate.toFixed(1)}% |`),s.push(`| Pending captures | ${e.captures.pendingCount} |`),e.health.progressScore&&s.push(`| Progress score | ${e.health.progressScore.level}: ${e.health.progressScore.summary} |`),s.push(""),e.criticalPath.milestonePath.length>0&&(s.push("## Critical Path"),s.push(""),s.push(`Milestone: ${e.criticalPath.milestonePath.join(" → ")}`),e.criticalPath.slicePath.length>0&&s.push(`Slice: ${e.criticalPath.slicePath.join(" → ")}`),s.push("")),e.knowledge.exists){for(let t of(s.push("## Knowledge"),s.push(""),e.knowledge.rules))s.push(`- Rule ${t.id} [${t.scope}]: ${t.content}`);for(let t of e.knowledge.patterns)s.push(`- Pattern ${t.id}: ${t.content}`);for(let t of e.knowledge.lessons)s.push(`- Lesson ${t.id}: ${t.content}`);s.push("")}if(e.captures.entries.length>0){for(let t of(s.push("## Captures"),s.push(""),e.captures.entries)){let e=t.classification?`, ${t.classification}`:"";s.push(`- **${t.id}** (${t.status}${e}): ${t.text}`)}s.push("")}if(e.changelog.entries.length>0)for(let t of(s.push("## Changelog"),s.push(""),e.changelog.entries)){if(s.push(`### ${t.milestoneId}/${t.sliceId}: ${t.title}`),t.oneLiner&&s.push(`> ${t.oneLiner}`),t.filesModified.length>0)for(let e of(s.push("Files:"),t.filesModified))s.push(`- \`${e.path}\` — ${e.description}`);t.completedAt&&s.push(`Completed: ${t.completedAt}`);let r=H(e,t.milestoneId,t.sliceId);if(r?.keyDecisions.length)for(let e of(s.push("Decisions:"),r.keyDecisions))s.push(`- ${e}`);if(r?.patternsEstablished.length)for(let e of(s.push("Patterns:"),r.patternsEstablished))s.push(`- ${e}`);s.push("")}return s.join("\n")},[e]);return(0,r.jsx)("div",{className:"space-y-6",children:(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6",children:[(0,r.jsx)(O,{children:"Export Project Data"}),(0,r.jsx)("p",{className:"mt-3 text-sm leading-relaxed text-muted-foreground",children:"Download the current visualizer data as a structured report. Markdown includes milestones, health, knowledge, captures, metrics, critical path, and changelog in a readable format. JSON contains the full raw data payload."}),(0,r.jsxs)("div",{className:"mt-7 grid gap-4 sm:grid-cols-2",children:[(0,r.jsxs)("button",{onClick:()=>s(t(),"gsd-report.md","text/markdown"),className:"group flex items-center gap-5 rounded-xl border border-border bg-muted/50 p-5 text-left transition-all hover:border-info/40 hover:bg-info/5",children:[(0,r.jsx)("div",{className:"rounded-xl border border-info/20 bg-info/10 p-4 transition-colors group-hover:bg-info/15",children:(0,r.jsx)(S.A,{className:"h-6 w-6 text-info"})}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("p",{className:"text-sm font-semibold transition-colors group-hover:text-info",children:"Download Markdown"}),(0,r.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Human-readable report with tables and structure"})]}),(0,r.jsx)(g.A,{className:"h-4 w-4 shrink-0 text-muted-foreground/0 transition-all group-hover:text-info/70"})]}),(0,r.jsxs)("button",{onClick:()=>s(JSON.stringify(e,null,2),"gsd-report.json","application/json"),className:"group flex items-center gap-5 rounded-xl border border-border bg-muted/50 p-5 text-left transition-all hover:border-success/40 hover:bg-success/5",children:[(0,r.jsx)("div",{className:"rounded-xl border border-success/20 bg-success/10 p-4 transition-colors group-hover:bg-success/15",children:(0,r.jsx)(A,{className:"h-6 w-6 text-success"})}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("p",{className:"text-sm font-semibold transition-colors group-hover:text-success",children:"Download JSON"}),(0,r.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Full raw data payload for tooling"})]}),(0,r.jsx)(g.A,{className:"h-4 w-4 shrink-0 text-muted-foreground/0 transition-all group-hover:text-success/70"})]})]})]})})}function ed({value:e,onValueChange:s,children:t}){return(0,r.jsx)(a.bL,{value:e,onValueChange:e=>s(e),className:"flex h-full flex-col overflow-hidden",children:t})}function ei(){return(0,r.jsx)(a.B8,{className:"flex shrink-0 overflow-x-auto border-b border-border bg-background px-6",children:L.map(({value:e,label:s,Icon:t})=>(0,r.jsxs)(a.l9,{value:e,className:(0,M.cn)("group relative flex shrink-0 items-center gap-2 px-3.5 py-3.5 text-sm font-medium outline-none","text-muted-foreground transition-colors duration-150","hover:text-foreground","data-[state=active]:text-foreground","focus-visible:text-foreground","disabled:pointer-events-none disabled:opacity-40"),children:[(0,r.jsx)("span",{className:(0,M.cn)("pointer-events-none absolute bottom-0 left-0 right-0 h-0.5 rounded-t-full","bg-foreground opacity-0 transition-opacity duration-150","group-data-[state=active]:opacity-100")}),(0,r.jsx)("span",{className:"absolute inset-x-0 inset-y-1.5 rounded-lg bg-muted/0 transition-colors duration-150 group-hover:bg-muted group-data-[state=active]:bg-transparent"}),(0,r.jsx)(t,{className:"relative h-4 w-4 shrink-0 transition-colors duration-150 text-muted-foreground group-hover:text-muted-foreground group-data-[state=active]:text-foreground"}),(0,r.jsx)("span",{className:"relative",children:s})]},e))})}function eo(){let e=(0,P.gF)(),s=e.boot?.project.cwd,[t,l]=(0,n.useState)(null),[d,i]=(0,n.useState)(!0),[o,c]=(0,n.useState)(null),[m,x]=(0,n.useState)("progress"),[u,h]=(0,n.useState)(""),[p,g]=(0,n.useState)(!1),f=(0,n.useRef)(null),b=(0,n.useMemo)(()=>t?function(e,s){let t=s.trim().toLowerCase();if(!t)return e;let r=e.milestones.map(e=>{if(V({...e,slices:[]},t))return e;let s=e.slices.map(e=>{if(V({...e,tasks:[]},t))return e;let s=_(e.tasks,t);return s.length>0?{...e,tasks:s}:null}).filter(e=>null!=e);return s.length>0?{...e,slices:s}:null}).filter(e=>null!=e),n=_(e.stats.missingSlices,t),a=_(e.stats.updatedSlices,t),l=_(e.stats.recentEntries,t),d=_(e.captures.entries,t);return{...e,milestones:r,byPhase:_(e.byPhase,t),bySlice:_(e.bySlice,t),byModel:_(e.byModel,t),byTier:_(e.byTier,t),units:_(e.units,t),changelog:{...e.changelog,entries:_(e.changelog.entries,t)},sliceVerifications:_(e.sliceVerifications,t),knowledge:{...e.knowledge,rules:_(e.knowledge.rules,t),patterns:_(e.knowledge.patterns,t),lessons:_(e.knowledge.lessons,t)},captures:{...e.captures,entries:d,pendingCount:d.filter(e=>"pending"===e.status).length,totalCount:d.length},health:{...e.health,tierBreakdown:_(e.health.tierBreakdown,t),providers:_(e.health.providers,t),environmentIssues:_(e.health.environmentIssues,t),doctorHistory:e.health.doctorHistory?_(e.health.doctorHistory,t):e.health.doctorHistory},discussion:_(e.discussion,t),stats:{...e.stats,missingCount:n.length,missingSlices:n,updatedCount:a.length,updatedSlices:a,recentEntries:l}}}(t,u):null,[t,u]),j=(0,n.useCallback)(async()=>{try{let e=await (0,T.tm)((0,P.fL)("/api/visualizer",s));if(!e.ok){let s=await e.json().catch(()=>({error:"Unknown error"}));throw Error(s.error||`HTTP ${e.status}`)}let t=await e.json();l(t),c(null)}catch(e){c(e instanceof Error?e.message:"Failed to fetch visualizer data")}finally{i(!1)}},[s]);if((0,n.useEffect)(()=>{j();let e=setInterval(j,1e4);return()=>clearInterval(e)},[j]),(0,n.useEffect)(()=>{let e=e=>{if(p&&("Escape"===e.key||"q"===e.key.toLowerCase())){e.preventDefault(),g(!1);return}if(!(()=>{let e=document.activeElement;if(!e)return!1;let s=e.tagName.toLowerCase();return"input"===s||"textarea"===s||"select"===s||"true"===e.getAttribute("contenteditable")})()){if(e.key>="1"&&e.key<="9"){let s=L[Number(e.key)-1];s&&(e.preventDefault(),x(s.value));return}if("0"===e.key){e.preventDefault(),x(L[L.length-1].value);return}if("/"===e.key){e.preventDefault(),f.current?.focus();return}"?"===e.key&&(e.preventDefault(),g(!0))}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[p]),d&&!t)return(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,r.jsx)(D.A,{className:"h-7 w-7 animate-spin text-muted-foreground"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading visualizer data…"})]})});if(o&&!t)return(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-4 text-center",children:[(0,r.jsx)("div",{className:"rounded-full border border-warning/20 bg-warning/10 p-4",children:(0,r.jsx)($.A,{className:"h-6 w-6 text-warning"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-semibold",children:"Failed to load visualizer"}),(0,r.jsx)("p",{className:"mt-1.5 max-w-sm text-xs text-muted-foreground",children:o})]}),(0,r.jsxs)("button",{onClick:j,className:"mt-1 inline-flex items-center gap-2 rounded-lg border border-border bg-card px-4 py-2 text-sm font-medium transition-colors hover:bg-accent",children:[(0,r.jsx)(I.A,{className:"h-3.5 w-3.5"}),"Retry"]})]})});if(!t)return null;let v=b??t;return(0,r.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-5 border-b border-border px-7 py-5",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-xl font-bold tracking-tight",children:"Workflow Visualizer"}),(0,r.jsxs)("div",{className:"mt-1.5 flex items-center gap-3 text-sm text-muted-foreground",children:[(0,r.jsxs)("span",{children:["Phase:"," ",(0,r.jsx)("span",{className:(0,M.cn)("inline-flex items-center rounded-md px-2 py-0.5 text-xs font-semibold uppercase tracking-wider","complete"===t.phase?"bg-success/15 text-success":"active"===t.phase||"running"===t.phase?"bg-info/15 text-info":"bg-muted text-muted-foreground"),children:t.phase})]}),t.remainingSliceCount>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"text-border",children:"\xb7"}),(0,r.jsxs)("span",{children:[t.remainingSliceCount," slice",1!==t.remainingSliceCount?"s":""," remaining"]})]}),o&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"text-border",children:"\xb7"}),(0,r.jsxs)("span",{className:"flex items-center gap-1 text-warning",children:[(0,r.jsx)($.A,{className:"h-3 w-3"}),"Stale — ",o]})]})]})]}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,r.jsx)("input",{ref:f,type:"search",value:u,onChange:e=>h(e.target.value),placeholder:"Search","aria-label":"Search visualizer",className:"h-9 w-48 rounded-lg border border-border bg-background px-3 text-sm outline-none transition-colors placeholder:text-muted-foreground focus:border-foreground/40"}),(0,r.jsx)("button",{type:"button",onClick:()=>g(!0),"aria-label":"Show keyboard shortcuts",className:"inline-flex h-9 w-9 items-center justify-center rounded-lg border border-border bg-card text-sm font-semibold transition-colors hover:bg-accent",children:"?"})]})]}),(0,r.jsxs)(ed,{value:m,onValueChange:x,children:[(0,r.jsx)(ei,{}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,r.jsxs)("div",{className:"mx-auto max-w-5xl px-7 py-7",children:[(0,r.jsx)(a.UC,{value:"progress",className:"outline-none",children:(0,r.jsx)(W,{data:v})}),(0,r.jsx)(a.UC,{value:"deps",className:"outline-none",children:(0,r.jsx)(Q,{data:v})}),(0,r.jsx)(a.UC,{value:"metrics",className:"outline-none",children:(0,r.jsx)(Y,{data:v})}),(0,r.jsx)(a.UC,{value:"health",className:"outline-none",children:(0,r.jsx)(ee,{data:v})}),(0,r.jsx)(a.UC,{value:"timeline",className:"outline-none",children:(0,r.jsx)(es,{data:v})}),(0,r.jsx)(a.UC,{value:"agent",className:"outline-none",children:(0,r.jsx)(et,{data:v})}),(0,r.jsx)(a.UC,{value:"changes",className:"outline-none",children:(0,r.jsx)(er,{data:v})}),(0,r.jsx)(a.UC,{value:"knowledge",className:"outline-none",children:(0,r.jsx)(en,{data:v})}),(0,r.jsx)(a.UC,{value:"captures",className:"outline-none",children:(0,r.jsx)(ea,{data:v})}),(0,r.jsx)(a.UC,{value:"export",className:"outline-none",children:(0,r.jsx)(el,{data:v})})]})})]}),p&&(0,r.jsx)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"visualizer-shortcuts-title",className:"fixed inset-0 z-50 flex items-center justify-center bg-background/70 p-6 backdrop-blur-sm",onClick:()=>g(!1),children:(0,r.jsxs)("div",{className:"w-full max-w-sm rounded-xl border border-border bg-card p-5 shadow-lg",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,r.jsx)("h2",{id:"visualizer-shortcuts-title",className:"text-sm font-semibold",children:"Keyboard Shortcuts"}),(0,r.jsx)("button",{type:"button",onClick:()=>g(!1),"aria-label":"Close keyboard shortcuts",className:"inline-flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:(0,r.jsx)(C.A,{className:"h-4 w-4"})})]}),(0,r.jsxs)("dl",{className:"mt-4 grid grid-cols-[auto_1fr] gap-x-4 gap-y-3 text-sm",children:[(0,r.jsx)("dt",{className:"font-mono text-xs text-muted-foreground",children:"1-9, 0"}),(0,r.jsx)("dd",{children:"Jump to tab"}),(0,r.jsx)("dt",{className:"font-mono text-xs text-muted-foreground",children:"/"}),(0,r.jsx)("dd",{children:"Focus search"}),(0,r.jsx)("dt",{className:"font-mono text-xs text-muted-foreground",children:"?"}),(0,r.jsx)("dd",{children:"Show this help"})]})]})})]})}},49619:(e,s,t)=>{t.d(s,{A:()=>r});let r=(0,t(90425).A)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]])},57518:(e,s,t)=>{t.d(s,{B8:()=>D,UC:()=>M,bL:()=>A,l9:()=>I});var r=t(12115),n=t(70379),a=t(68599),l=t(78538),d=t(83935),i=t(99354),o=t(1933),c=t(98979),m=t(89971),x=t(95155),u="Tabs",[h,p]=(0,a.A)(u,[l.RG]),g=(0,l.RG)(),[f,b]=h(u),j=r.forwardRef((e,s)=>{let{__scopeTabs:t,value:r,onValueChange:n,defaultValue:a,orientation:l="horizontal",dir:d,activationMode:h="automatic",...p}=e,g=(0,o.jH)(d),[b,j]=(0,c.i)({prop:r,onChange:n,defaultProp:a??"",caller:u});return(0,x.jsx)(f,{scope:t,baseId:(0,m.B)(),value:b,onValueChange:j,orientation:l,dir:g,activationMode:h,children:(0,x.jsx)(i.sG.div,{dir:g,"data-orientation":l,...p,ref:s})})});j.displayName=u;var v="TabsList",N=r.forwardRef((e,s)=>{let{__scopeTabs:t,loop:r=!0,...n}=e,a=b(v,t),d=g(t);return(0,x.jsx)(l.bL,{asChild:!0,...d,orientation:a.orientation,dir:a.dir,loop:r,children:(0,x.jsx)(i.sG.div,{role:"tablist","aria-orientation":a.orientation,...n,ref:s})})});N.displayName=v;var y="TabsTrigger",w=r.forwardRef((e,s)=>{let{__scopeTabs:t,value:r,disabled:a=!1,...d}=e,o=b(y,t),c=g(t),m=C(o.baseId,r),u=S(o.baseId,r),h=r===o.value;return(0,x.jsx)(l.q7,{asChild:!0,...c,focusable:!a,active:h,children:(0,x.jsx)(i.sG.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":u,"data-state":h?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:m,...d,ref:s,onMouseDown:(0,n.mK)(e.onMouseDown,e=>{a||0!==e.button||!1!==e.ctrlKey?e.preventDefault():o.onValueChange(r)}),onKeyDown:(0,n.mK)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&o.onValueChange(r)}),onFocus:(0,n.mK)(e.onFocus,()=>{let e="manual"!==o.activationMode;h||a||!e||o.onValueChange(r)})})})});w.displayName=y;var k="TabsContent",$=r.forwardRef((e,s)=>{let{__scopeTabs:t,value:n,forceMount:a,children:l,...o}=e,c=b(k,t),m=C(c.baseId,n),u=S(c.baseId,n),h=n===c.value,p=r.useRef(h);return r.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,x.jsx)(d.C,{present:a||h,children:({present:t})=>(0,x.jsx)(i.sG.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":m,hidden:!t,id:u,tabIndex:0,...o,ref:s,style:{...e.style,animationDuration:p.current?"0s":void 0},children:t&&l})})});function C(e,s){return`${e}-trigger-${s}`}function S(e,s){return`${e}-content-${s}`}$.displayName=k;var A=j,D=N,I=w,M=$}}]);
|