gsd-pi 2.26.1-next.1 → 2.28.0-dev.4009980
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 +76 -12
- package/dist/cli.js +9 -14
- package/dist/extension-discovery.d.ts +16 -0
- package/dist/extension-discovery.js +66 -0
- package/dist/headless-answers.d.ts +51 -0
- package/dist/headless-answers.js +224 -0
- package/dist/headless-context.d.ts +18 -0
- package/dist/headless-context.js +44 -0
- package/dist/headless-events.d.ts +28 -0
- package/dist/headless-events.js +59 -0
- package/dist/headless-query.d.ts +40 -0
- package/dist/headless-query.js +77 -0
- package/dist/headless-ui.d.ts +23 -0
- package/dist/headless-ui.js +103 -0
- package/dist/headless.d.ts +4 -0
- package/dist/headless.js +128 -155
- package/dist/help-text.js +9 -0
- package/dist/loader.js +18 -59
- package/dist/onboarding.js +8 -7
- package/dist/remote-questions-config.js +8 -3
- package/dist/resource-loader.d.ts +1 -6
- package/dist/resource-loader.js +52 -95
- package/dist/resources/extensions/ask-user-questions.ts +3 -2
- package/dist/resources/extensions/bg-shell/bg-shell-command.ts +219 -0
- package/dist/resources/extensions/bg-shell/bg-shell-lifecycle.ts +400 -0
- package/dist/resources/extensions/bg-shell/bg-shell-tool.ts +985 -0
- package/dist/resources/extensions/bg-shell/index.ts +18 -1545
- package/dist/resources/extensions/bg-shell/overlay.ts +4 -0
- package/dist/resources/extensions/bg-shell/process-manager.ts +45 -0
- package/dist/resources/extensions/bg-shell/types.ts +21 -1
- package/dist/resources/extensions/bg-shell/utilities.ts +4 -16
- package/dist/resources/extensions/browser-tools/capture.ts +34 -2
- package/dist/resources/extensions/browser-tools/lifecycle.ts +5 -5
- package/dist/resources/extensions/browser-tools/settle.ts +1 -1
- package/dist/resources/extensions/browser-tools/state.ts +5 -5
- package/dist/resources/extensions/browser-tools/tests/browser-tools-integration.test.mjs +1 -1
- package/dist/resources/extensions/browser-tools/tests/browser-tools-unit.test.cjs +3 -3
- package/dist/resources/extensions/browser-tools/tools/assertions.ts +1 -1
- package/dist/resources/extensions/browser-tools/tools/device.ts +1 -1
- package/dist/resources/extensions/browser-tools/tools/extract.ts +1 -1
- package/dist/resources/extensions/browser-tools/tools/navigation.ts +6 -6
- package/dist/resources/extensions/browser-tools/tools/network-mock.ts +1 -1
- package/dist/resources/extensions/browser-tools/tools/pages.ts +1 -1
- package/dist/resources/extensions/browser-tools/tools/screenshot.ts +28 -10
- package/dist/resources/extensions/browser-tools/tools/state-persistence.ts +1 -1
- package/dist/resources/extensions/browser-tools/tools/visual-diff.ts +1 -1
- package/dist/resources/extensions/browser-tools/utils.ts +5 -5
- package/dist/resources/extensions/get-secrets-from-user.ts +1 -1
- package/dist/resources/extensions/google-search/index.ts +21 -8
- package/dist/resources/extensions/gsd/activity-log.ts +2 -1
- package/dist/resources/extensions/gsd/atomic-write.ts +35 -0
- package/dist/resources/extensions/gsd/auto/session.ts +236 -0
- package/dist/resources/extensions/gsd/auto-budget.ts +32 -0
- package/dist/resources/extensions/gsd/auto-dashboard.ts +147 -13
- package/dist/resources/extensions/gsd/auto-direct-dispatch.ts +229 -0
- package/dist/resources/extensions/gsd/auto-dispatch.ts +23 -10
- package/dist/resources/extensions/gsd/auto-idempotency.ts +150 -0
- package/dist/resources/extensions/gsd/auto-model-selection.ts +179 -0
- package/dist/resources/extensions/gsd/auto-observability.ts +74 -0
- package/dist/resources/extensions/gsd/auto-post-unit.ts +591 -0
- package/dist/resources/extensions/gsd/auto-prompts.ts +116 -23
- package/dist/resources/extensions/gsd/auto-recovery.ts +4 -9
- package/dist/resources/extensions/gsd/auto-start.ts +500 -0
- package/dist/resources/extensions/gsd/auto-stuck-detection.ts +220 -0
- package/dist/resources/extensions/gsd/auto-timeout-recovery.ts +262 -0
- package/dist/resources/extensions/gsd/auto-timers.ts +223 -0
- package/dist/resources/extensions/gsd/auto-tool-tracking.ts +54 -0
- package/dist/resources/extensions/gsd/auto-unit-closeout.ts +48 -0
- package/dist/resources/extensions/gsd/auto-verification.ts +195 -0
- package/dist/resources/extensions/gsd/auto-worktree-sync.ts +184 -0
- package/dist/resources/extensions/gsd/auto-worktree.ts +83 -67
- package/dist/resources/extensions/gsd/auto.ts +825 -3069
- package/dist/resources/extensions/gsd/commands-config.ts +102 -0
- package/dist/resources/extensions/gsd/commands-handlers.ts +402 -0
- package/dist/resources/extensions/gsd/commands-inspect.ts +90 -0
- package/dist/resources/extensions/gsd/commands-logs.ts +537 -0
- package/dist/resources/extensions/gsd/commands-maintenance.ts +206 -0
- package/dist/resources/extensions/gsd/commands-prefs-wizard.ts +747 -0
- package/dist/resources/extensions/gsd/commands.ts +380 -1433
- package/dist/resources/extensions/gsd/constants.ts +21 -0
- package/dist/resources/extensions/gsd/context-budget.ts +25 -2
- package/dist/resources/extensions/gsd/crash-recovery.ts +4 -2
- package/dist/resources/extensions/gsd/dashboard-overlay.ts +58 -74
- package/dist/resources/extensions/gsd/db-writer.ts +21 -2
- package/dist/resources/extensions/gsd/detection.ts +469 -0
- package/dist/resources/extensions/gsd/diff-context.ts +2 -1
- package/dist/resources/extensions/gsd/dispatch-guard.ts +4 -0
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +83 -0
- package/dist/resources/extensions/gsd/doctor-checks.ts +564 -0
- package/dist/resources/extensions/gsd/doctor-format.ts +78 -0
- package/dist/resources/extensions/gsd/doctor-proactive.ts +9 -4
- package/dist/resources/extensions/gsd/doctor-types.ts +72 -0
- package/dist/resources/extensions/gsd/doctor.ts +64 -701
- package/dist/resources/extensions/gsd/errors.ts +0 -2
- package/dist/resources/extensions/gsd/export-html.ts +1357 -0
- package/dist/resources/extensions/gsd/export.ts +115 -4
- package/dist/resources/extensions/gsd/files.ts +8 -126
- package/dist/resources/extensions/gsd/forensics.ts +2 -12
- package/dist/resources/extensions/gsd/git-constants.ts +11 -0
- package/dist/resources/extensions/gsd/git-service.ts +19 -9
- package/dist/resources/extensions/gsd/gitignore.ts +4 -1
- package/dist/resources/extensions/gsd/gsd-db.ts +26 -6
- package/dist/resources/extensions/gsd/guided-flow-queue.ts +451 -0
- package/dist/resources/extensions/gsd/guided-flow.ts +252 -516
- package/dist/resources/extensions/gsd/history.ts +2 -20
- package/dist/resources/extensions/gsd/index.ts +260 -46
- package/dist/resources/extensions/gsd/init-wizard.ts +615 -0
- package/dist/resources/extensions/gsd/jsonl-utils.ts +21 -0
- package/dist/resources/extensions/gsd/key-manager.ts +995 -0
- package/dist/resources/extensions/gsd/metrics.ts +32 -5
- package/dist/resources/extensions/gsd/migrate/command.ts +1 -1
- package/dist/resources/extensions/gsd/migrate/parsers.ts +10 -95
- package/dist/resources/extensions/gsd/milestone-actions.ts +126 -0
- package/dist/resources/extensions/gsd/milestone-ids.ts +95 -0
- package/dist/resources/extensions/gsd/native-git-bridge.ts +35 -12
- package/dist/resources/extensions/gsd/parallel-eligibility.ts +3 -3
- package/dist/resources/extensions/gsd/parallel-orchestrator.ts +231 -20
- package/dist/resources/extensions/gsd/paths.ts +1 -3
- package/dist/resources/extensions/gsd/plugin-importer.ts +3 -2
- package/dist/resources/extensions/gsd/preferences-hooks.ts +10 -0
- package/dist/resources/extensions/gsd/preferences-models.ts +323 -0
- package/dist/resources/extensions/gsd/preferences-skills.ts +169 -0
- package/dist/resources/extensions/gsd/preferences-types.ts +223 -0
- package/dist/resources/extensions/gsd/preferences-validation.ts +597 -0
- package/dist/resources/extensions/gsd/preferences.ts +219 -1286
- package/dist/resources/extensions/gsd/prompt-cache-optimizer.ts +213 -0
- package/dist/resources/extensions/gsd/prompt-compressor.ts +508 -0
- package/dist/resources/extensions/gsd/prompt-loader.ts +4 -2
- package/dist/resources/extensions/gsd/prompt-ordering.ts +200 -0
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +2 -2
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +4 -4
- package/dist/resources/extensions/gsd/prompts/discuss-headless.md +2 -4
- package/dist/resources/extensions/gsd/prompts/discuss.md +13 -5
- package/dist/resources/extensions/gsd/prompts/execute-task.md +1 -2
- package/dist/resources/extensions/gsd/prompts/guided-complete-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/guided-plan-milestone.md +0 -1
- package/dist/resources/extensions/gsd/prompts/plan-milestone.md +1 -2
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -2
- package/dist/resources/extensions/gsd/prompts/queue.md +30 -0
- package/dist/resources/extensions/gsd/prompts/quick-task.md +0 -6
- package/dist/resources/extensions/gsd/prompts/replan-slice.md +0 -1
- package/dist/resources/extensions/gsd/prompts/rewrite-docs.md +0 -1
- package/dist/resources/extensions/gsd/prompts/system.md +6 -3
- package/dist/resources/extensions/gsd/provider-error-pause.ts +59 -10
- package/dist/resources/extensions/gsd/queue-order.ts +1 -1
- package/dist/resources/extensions/gsd/queue-reorder-ui.ts +15 -2
- package/dist/resources/extensions/gsd/quick.ts +18 -15
- package/dist/resources/extensions/gsd/reports.ts +504 -0
- package/dist/resources/extensions/gsd/roadmap-slices.ts +1 -1
- package/dist/resources/extensions/gsd/safe-fs.ts +47 -0
- package/dist/resources/extensions/gsd/semantic-chunker.ts +336 -0
- package/dist/resources/extensions/gsd/session-forensics.ts +8 -23
- package/dist/resources/extensions/gsd/session-lock.ts +284 -0
- package/dist/resources/extensions/gsd/skills/gsd-headless/SKILL.md +242 -0
- package/dist/resources/extensions/gsd/skills/gsd-headless/references/answer-injection.md +83 -0
- package/dist/resources/extensions/gsd/skills/gsd-headless/references/commands.md +64 -0
- package/dist/resources/extensions/gsd/skills/gsd-headless/references/multi-session.md +176 -0
- package/dist/resources/extensions/gsd/state.ts +84 -2
- package/dist/resources/extensions/gsd/structured-data-formatter.ts +144 -0
- package/dist/resources/extensions/gsd/summary-distiller.ts +258 -0
- package/dist/resources/extensions/gsd/templates/preferences.md +34 -0
- package/dist/resources/extensions/gsd/tests/activity-log.test.ts +213 -0
- package/dist/resources/extensions/gsd/tests/agent-end-retry.test.ts +107 -0
- package/dist/resources/extensions/gsd/tests/all-milestones-complete-merge.test.ts +197 -0
- package/dist/resources/extensions/gsd/tests/auto-dashboard.test.ts +13 -0
- package/dist/resources/extensions/gsd/tests/auto-preflight.test.ts +33 -39
- package/dist/resources/extensions/gsd/tests/auto-secrets-gate.test.ts +108 -2
- package/dist/resources/extensions/gsd/tests/auto-session-encapsulation.test.ts +257 -0
- package/dist/resources/extensions/gsd/tests/auto-worktree-milestone-merge.test.ts +3 -0
- package/dist/resources/extensions/gsd/tests/commands-logs.test.ts +241 -0
- package/dist/resources/extensions/gsd/tests/context-budget.test.ts +69 -0
- package/dist/resources/extensions/gsd/tests/continue-here.test.ts +81 -0
- package/dist/resources/extensions/gsd/tests/derive-state-db.test.ts +5 -0
- package/dist/resources/extensions/gsd/tests/derive-state-deps.test.ts +1 -0
- package/dist/resources/extensions/gsd/tests/derive-state-draft.test.ts +1 -0
- package/dist/resources/extensions/gsd/tests/derive-state.test.ts +10 -1
- package/dist/resources/extensions/gsd/tests/detection.test.ts +398 -0
- package/dist/resources/extensions/gsd/tests/discuss-prompt.test.ts +12 -24
- package/dist/resources/extensions/gsd/tests/dispatch-guard.test.ts +118 -94
- package/dist/resources/extensions/gsd/tests/dispatch-missing-task-plans.test.ts +132 -0
- package/dist/resources/extensions/gsd/tests/dispatch-stall-guard.test.ts +126 -0
- package/dist/resources/extensions/gsd/tests/dist-redirect.mjs +7 -3
- package/dist/resources/extensions/gsd/tests/doctor-fixlevel.test.ts +75 -0
- package/dist/resources/extensions/gsd/tests/doctor-git.test.ts +17 -55
- package/dist/resources/extensions/gsd/tests/doctor-proactive.test.ts +14 -0
- package/dist/resources/extensions/gsd/tests/export-html-all.test.ts +105 -0
- package/dist/resources/extensions/gsd/tests/export-html-enhancements.test.ts +375 -0
- package/dist/resources/extensions/gsd/tests/extension-selector-separator.test.ts +122 -0
- package/dist/resources/extensions/gsd/tests/feature-branch-lifecycle-integration.test.ts +3 -0
- package/dist/resources/extensions/gsd/tests/headless-answers.test.ts +340 -0
- package/dist/resources/extensions/gsd/tests/headless-query.test.ts +162 -0
- package/dist/resources/extensions/gsd/tests/in-flight-tool-tracking.test.ts +24 -82
- package/dist/resources/extensions/gsd/tests/init-wizard.test.ts +197 -0
- package/dist/resources/extensions/gsd/tests/integration-mixed-milestones.test.ts +1 -0
- package/dist/resources/extensions/gsd/tests/key-manager.test.ts +414 -0
- package/dist/resources/extensions/gsd/tests/metrics.test.ts +173 -305
- package/dist/resources/extensions/gsd/tests/milestone-transition-worktree.test.ts +4 -1
- package/dist/resources/extensions/gsd/tests/model-isolation.test.ts +59 -1
- package/dist/resources/extensions/gsd/tests/native-has-changes-cache.test.ts +61 -0
- package/dist/resources/extensions/gsd/tests/next-milestone-id.test.ts +18 -61
- package/dist/resources/extensions/gsd/tests/none-mode-gates.test.ts +17 -8
- package/dist/resources/extensions/gsd/tests/parallel-budget-atomicity.test.ts +331 -0
- package/dist/resources/extensions/gsd/tests/parallel-crash-recovery.test.ts +298 -0
- package/dist/resources/extensions/gsd/tests/parallel-merge.test.ts +468 -0
- package/dist/resources/extensions/gsd/tests/parallel-orchestration.test.ts +39 -10
- package/dist/resources/extensions/gsd/tests/park-edge-cases.test.ts +276 -0
- package/dist/resources/extensions/gsd/tests/park-milestone.test.ts +401 -0
- package/dist/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +47 -0
- package/dist/resources/extensions/gsd/tests/preferences.test.ts +284 -0
- package/dist/resources/extensions/gsd/tests/prompt-cache-optimizer.test.ts +314 -0
- package/dist/resources/extensions/gsd/tests/prompt-compressor.test.ts +529 -0
- package/dist/resources/extensions/gsd/tests/prompt-ordering.test.ts +296 -0
- package/dist/resources/extensions/gsd/tests/provider-errors.test.ts +338 -0
- package/dist/resources/extensions/gsd/tests/reassess-detection.test.ts +154 -0
- package/dist/resources/extensions/gsd/tests/remote-questions.test.ts +1 -1
- package/dist/resources/extensions/gsd/tests/remote-status.test.ts +2 -2
- package/dist/resources/extensions/gsd/tests/replan-slice.test.ts +42 -0
- package/dist/resources/extensions/gsd/tests/roadmap-slices.test.ts +43 -60
- package/dist/resources/extensions/gsd/tests/semantic-chunker.test.ts +426 -0
- package/dist/resources/extensions/gsd/tests/session-lock.test.ts +315 -0
- package/dist/resources/extensions/gsd/tests/stale-worktree-cwd.test.ts +3 -0
- package/dist/resources/extensions/gsd/tests/stop-auto-remote.test.ts +8 -5
- package/dist/resources/extensions/gsd/tests/structured-data-formatter.test.ts +365 -0
- package/dist/resources/extensions/gsd/tests/summary-distiller.test.ts +323 -0
- package/dist/resources/extensions/gsd/tests/token-counter.test.ts +129 -0
- package/dist/resources/extensions/gsd/tests/token-optimization-benchmark.test.ts +1272 -0
- package/dist/resources/extensions/gsd/tests/token-optimization-prefs.test.ts +164 -0
- package/dist/resources/extensions/gsd/tests/token-profile.test.ts +8 -1
- package/dist/resources/extensions/gsd/tests/triage-dispatch.test.ts +75 -79
- package/dist/resources/extensions/gsd/tests/update-command.test.ts +67 -0
- package/dist/resources/extensions/gsd/tests/validate-directory.test.ts +222 -0
- package/dist/resources/extensions/gsd/tests/verification-gate.test.ts +115 -1
- package/dist/resources/extensions/gsd/tests/visualizer-data.test.ts +1 -1
- package/dist/resources/extensions/gsd/tests/visualizer-overlay.test.ts +44 -10
- package/dist/resources/extensions/gsd/tests/visualizer-views.test.ts +2 -1
- package/dist/resources/extensions/gsd/tests/workspace-index.test.ts +24 -61
- package/dist/resources/extensions/gsd/tests/worktree-e2e.test.ts +5 -2
- package/dist/resources/extensions/gsd/tests/worktree.test.ts +3 -1
- package/dist/resources/extensions/gsd/tests/write-gate.test.ts +132 -43
- package/dist/resources/extensions/gsd/token-counter.ts +20 -0
- package/dist/resources/extensions/gsd/triage-ui.ts +1 -1
- package/dist/resources/extensions/gsd/types.ts +4 -1
- package/dist/resources/extensions/gsd/validate-directory.ts +164 -0
- package/dist/resources/extensions/gsd/verification-evidence.ts +7 -4
- package/dist/resources/extensions/gsd/verification-gate.ts +70 -5
- package/dist/resources/extensions/gsd/visualizer-data.ts +26 -4
- package/dist/resources/extensions/gsd/visualizer-overlay.ts +35 -22
- package/dist/resources/extensions/gsd/visualizer-views.ts +14 -66
- package/dist/resources/extensions/gsd/worktree-command.ts +4 -51
- package/dist/resources/extensions/gsd/worktree-manager.ts +7 -9
- package/dist/resources/extensions/gsd/worktree.ts +41 -1
- package/dist/resources/extensions/mcporter/index.ts +27 -14
- package/dist/resources/extensions/remote-questions/manager.ts +6 -24
- package/dist/resources/extensions/remote-questions/mod.ts +16 -0
- package/dist/resources/extensions/remote-questions/notify.ts +91 -0
- package/dist/resources/extensions/remote-questions/remote-command.ts +1 -1
- package/dist/resources/extensions/remote-questions/store.ts +5 -1
- package/dist/resources/extensions/remote-questions/types.ts +26 -3
- package/dist/resources/extensions/search-the-web/native-search.ts +7 -0
- package/dist/resources/extensions/search-the-web/provider.ts +15 -3
- package/dist/resources/extensions/search-the-web/tool-llm-context.ts +1 -13
- package/dist/resources/extensions/search-the-web/tool-search.ts +27 -13
- package/dist/resources/extensions/shared/format-utils.ts +138 -0
- package/dist/resources/extensions/shared/frontmatter.ts +117 -0
- package/dist/resources/extensions/shared/mod.ts +30 -0
- package/dist/resources/extensions/shared/sanitize.ts +19 -0
- package/dist/resources/extensions/shared/tests/format-utils.test.ts +153 -0
- package/dist/resources/extensions/slash-commands/create-extension.ts +1 -1
- package/dist/resources/extensions/slash-commands/create-slash-command.ts +1 -1
- package/dist/resources/extensions/subagent/index.ts +47 -3
- package/dist/resources/extensions/subagent/isolation.ts +9 -6
- package/dist/resources/extensions/ttsr/index.ts +5 -0
- package/dist/resources/extensions/ttsr/rule-loader.ts +4 -51
- package/dist/resources/extensions/universal-config/discovery.ts +37 -15
- package/dist/resources/extensions/voice/index.ts +1 -1
- package/dist/resources/skills/accessibility/SKILL.md +522 -0
- package/dist/resources/skills/accessibility/references/WCAG.md +162 -0
- package/dist/resources/skills/agent-browser/SKILL.md +517 -0
- package/dist/resources/skills/agent-browser/references/authentication.md +202 -0
- package/dist/resources/skills/agent-browser/references/commands.md +263 -0
- package/dist/resources/skills/agent-browser/references/profiling.md +120 -0
- package/dist/resources/skills/agent-browser/references/proxy-support.md +194 -0
- package/dist/resources/skills/agent-browser/references/session-management.md +193 -0
- package/dist/resources/skills/agent-browser/references/snapshot-refs.md +194 -0
- package/dist/resources/skills/agent-browser/references/video-recording.md +173 -0
- package/dist/resources/skills/agent-browser/templates/authenticated-session.sh +105 -0
- package/dist/resources/skills/agent-browser/templates/capture-workflow.sh +69 -0
- package/dist/resources/skills/agent-browser/templates/form-automation.sh +62 -0
- package/dist/resources/skills/best-practices/SKILL.md +583 -0
- package/dist/resources/skills/code-optimizer/SKILL.md +160 -0
- package/dist/resources/skills/code-optimizer/references/algorithmic-complexity.md +66 -0
- package/dist/resources/skills/code-optimizer/references/build-compilation.md +90 -0
- package/dist/resources/skills/code-optimizer/references/bundle-dependencies.md +82 -0
- package/dist/resources/skills/code-optimizer/references/caching-memoization.md +76 -0
- package/dist/resources/skills/code-optimizer/references/concurrency-async.md +80 -0
- package/dist/resources/skills/code-optimizer/references/config-infra.md +71 -0
- package/dist/resources/skills/code-optimizer/references/data-structures.md +80 -0
- package/dist/resources/skills/code-optimizer/references/database-queries.md +76 -0
- package/dist/resources/skills/code-optimizer/references/dead-code-redundancy.md +84 -0
- package/dist/resources/skills/code-optimizer/references/error-resilience.md +80 -0
- package/dist/resources/skills/code-optimizer/references/io-network.md +89 -0
- package/dist/resources/skills/code-optimizer/references/logging-observability.md +64 -0
- package/dist/resources/skills/code-optimizer/references/memory-resources.md +66 -0
- package/dist/resources/skills/code-optimizer/references/rendering-ui.md +90 -0
- package/dist/resources/skills/code-optimizer/references/security-performance.md +68 -0
- package/dist/resources/skills/core-web-vitals/SKILL.md +441 -0
- package/dist/resources/skills/core-web-vitals/references/LCP.md +208 -0
- package/dist/resources/skills/make-interfaces-feel-better/SKILL.md +122 -0
- package/dist/resources/skills/make-interfaces-feel-better/animations.md +379 -0
- package/dist/resources/skills/make-interfaces-feel-better/performance.md +88 -0
- package/dist/resources/skills/make-interfaces-feel-better/surfaces.md +247 -0
- package/dist/resources/skills/make-interfaces-feel-better/typography.md +123 -0
- package/dist/resources/skills/react-best-practices/README.md +123 -0
- package/dist/resources/skills/react-best-practices/SKILL.md +136 -0
- package/dist/resources/skills/react-best-practices/metadata.json +15 -0
- package/dist/resources/skills/react-best-practices/rules/_sections.md +46 -0
- package/dist/resources/skills/react-best-practices/rules/_template.md +28 -0
- package/dist/resources/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/dist/resources/skills/react-best-practices/rules/advanced-init-once.md +42 -0
- package/dist/resources/skills/react-best-practices/rules/advanced-use-latest.md +39 -0
- package/dist/resources/skills/react-best-practices/rules/async-api-routes.md +38 -0
- package/dist/resources/skills/react-best-practices/rules/async-defer-await.md +80 -0
- package/dist/resources/skills/react-best-practices/rules/async-dependencies.md +51 -0
- package/dist/resources/skills/react-best-practices/rules/async-parallel.md +28 -0
- package/dist/resources/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/dist/resources/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/dist/resources/skills/react-best-practices/rules/bundle-conditional.md +31 -0
- package/dist/resources/skills/react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/dist/resources/skills/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/dist/resources/skills/react-best-practices/rules/bundle-preload.md +50 -0
- package/dist/resources/skills/react-best-practices/rules/client-event-listeners.md +74 -0
- package/dist/resources/skills/react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/dist/resources/skills/react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/dist/resources/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
- package/dist/resources/skills/react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/dist/resources/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
- package/dist/resources/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
- package/dist/resources/skills/react-best-practices/rules/js-cache-storage.md +70 -0
- package/dist/resources/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
- package/dist/resources/skills/react-best-practices/rules/js-early-exit.md +50 -0
- package/dist/resources/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/dist/resources/skills/react-best-practices/rules/js-index-maps.md +37 -0
- package/dist/resources/skills/react-best-practices/rules/js-length-check-first.md +49 -0
- package/dist/resources/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
- package/dist/resources/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/dist/resources/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/dist/resources/skills/react-best-practices/rules/rendering-activity.md +26 -0
- package/dist/resources/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/dist/resources/skills/react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/dist/resources/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/dist/resources/skills/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/dist/resources/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/dist/resources/skills/react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/dist/resources/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/dist/resources/skills/react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/dist/resources/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/dist/resources/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
- package/dist/resources/skills/react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/dist/resources/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
- package/dist/resources/skills/react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/dist/resources/skills/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/dist/resources/skills/react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/dist/resources/skills/react-best-practices/rules/rerender-memo.md +44 -0
- package/dist/resources/skills/react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/dist/resources/skills/react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/dist/resources/skills/react-best-practices/rules/rerender-transitions.md +40 -0
- package/dist/resources/skills/react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/dist/resources/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/dist/resources/skills/react-best-practices/rules/server-auth-actions.md +96 -0
- package/dist/resources/skills/react-best-practices/rules/server-cache-lru.md +41 -0
- package/dist/resources/skills/react-best-practices/rules/server-cache-react.md +76 -0
- package/dist/resources/skills/react-best-practices/rules/server-dedup-props.md +65 -0
- package/dist/resources/skills/react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/dist/resources/skills/react-best-practices/rules/server-serialization.md +38 -0
- package/dist/resources/skills/userinterface-wiki/SKILL.md +253 -0
- package/dist/resources/skills/userinterface-wiki/rules/_sections.md +66 -0
- package/dist/resources/skills/userinterface-wiki/rules/_template.md +24 -0
- package/dist/resources/skills/userinterface-wiki/rules/a11y-reduced-motion-check.md +30 -0
- package/dist/resources/skills/userinterface-wiki/rules/a11y-toggle-setting.md +30 -0
- package/dist/resources/skills/userinterface-wiki/rules/a11y-visual-equivalent.md +36 -0
- package/dist/resources/skills/userinterface-wiki/rules/a11y-volume-control.md +28 -0
- package/dist/resources/skills/userinterface-wiki/rules/appropriate-confirmations-only.md +19 -0
- package/dist/resources/skills/userinterface-wiki/rules/appropriate-errors-warnings.md +18 -0
- package/dist/resources/skills/userinterface-wiki/rules/appropriate-no-decorative.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/appropriate-no-high-frequency.md +28 -0
- package/dist/resources/skills/userinterface-wiki/rules/appropriate-no-punishing.md +27 -0
- package/dist/resources/skills/userinterface-wiki/rules/container-callback-ref.md +31 -0
- package/dist/resources/skills/userinterface-wiki/rules/container-guard-initial-zero.md +25 -0
- package/dist/resources/skills/userinterface-wiki/rules/container-no-excessive-use.md +13 -0
- package/dist/resources/skills/userinterface-wiki/rules/container-overflow-hidden.md +25 -0
- package/dist/resources/skills/userinterface-wiki/rules/container-transition-delay.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/container-two-div-pattern.md +35 -0
- package/dist/resources/skills/userinterface-wiki/rules/container-use-resize-observer.md +48 -0
- package/dist/resources/skills/userinterface-wiki/rules/context-cleanup-nodes.md +25 -0
- package/dist/resources/skills/userinterface-wiki/rules/context-resume-suspended.md +28 -0
- package/dist/resources/skills/userinterface-wiki/rules/context-reuse-single.md +30 -0
- package/dist/resources/skills/userinterface-wiki/rules/design-filter-for-character.md +25 -0
- package/dist/resources/skills/userinterface-wiki/rules/design-noise-for-percussion.md +26 -0
- package/dist/resources/skills/userinterface-wiki/rules/design-oscillator-for-tonal.md +22 -0
- package/dist/resources/skills/userinterface-wiki/rules/duration-max-300ms.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/duration-press-hover.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/duration-shorten-before-curve.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/duration-small-state.md +15 -0
- package/dist/resources/skills/userinterface-wiki/rules/easing-entrance-ease-out.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/easing-exit-ease-in.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/easing-for-state-change.md +27 -0
- package/dist/resources/skills/userinterface-wiki/rules/easing-linear-only-progress.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/easing-natural-decay.md +22 -0
- package/dist/resources/skills/userinterface-wiki/rules/easing-no-linear-motion.md +22 -0
- package/dist/resources/skills/userinterface-wiki/rules/easing-transition-ease-in-out.md +15 -0
- package/dist/resources/skills/userinterface-wiki/rules/envelope-exponential-decay.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/envelope-no-zero-target.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/envelope-set-initial-value.md +22 -0
- package/dist/resources/skills/userinterface-wiki/rules/exit-key-required.md +29 -0
- package/dist/resources/skills/userinterface-wiki/rules/exit-matches-initial.md +29 -0
- package/dist/resources/skills/userinterface-wiki/rules/exit-prop-required.md +33 -0
- package/dist/resources/skills/userinterface-wiki/rules/exit-requires-wrapper.md +27 -0
- package/dist/resources/skills/userinterface-wiki/rules/impl-default-subtle.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/impl-preload-audio.md +34 -0
- package/dist/resources/skills/userinterface-wiki/rules/impl-reset-current-time.md +26 -0
- package/dist/resources/skills/userinterface-wiki/rules/mode-pop-layout-for-lists.md +25 -0
- package/dist/resources/skills/userinterface-wiki/rules/mode-sync-layout-conflict.md +29 -0
- package/dist/resources/skills/userinterface-wiki/rules/mode-wait-doubles-duration.md +25 -0
- package/dist/resources/skills/userinterface-wiki/rules/morphing-aria-hidden.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/morphing-consistent-viewbox.md +23 -0
- package/dist/resources/skills/userinterface-wiki/rules/morphing-group-variants.md +33 -0
- package/dist/resources/skills/userinterface-wiki/rules/morphing-jump-non-grouped.md +29 -0
- package/dist/resources/skills/userinterface-wiki/rules/morphing-reduced-motion.md +28 -0
- package/dist/resources/skills/userinterface-wiki/rules/morphing-spring-rotation.md +23 -0
- package/dist/resources/skills/userinterface-wiki/rules/morphing-strokelinecap-round.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/morphing-three-lines.md +32 -0
- package/dist/resources/skills/userinterface-wiki/rules/morphing-use-collapsed.md +33 -0
- package/dist/resources/skills/userinterface-wiki/rules/native-backdrop-styling.md +27 -0
- package/dist/resources/skills/userinterface-wiki/rules/native-placeholder-styling.md +27 -0
- package/dist/resources/skills/userinterface-wiki/rules/native-selection-styling.md +18 -0
- package/dist/resources/skills/userinterface-wiki/rules/nested-consistent-timing.md +25 -0
- package/dist/resources/skills/userinterface-wiki/rules/nested-propagate-required.md +41 -0
- package/dist/resources/skills/userinterface-wiki/rules/none-context-menu-entrance.md +25 -0
- package/dist/resources/skills/userinterface-wiki/rules/none-high-frequency.md +29 -0
- package/dist/resources/skills/userinterface-wiki/rules/none-keyboard-navigation.md +32 -0
- package/dist/resources/skills/userinterface-wiki/rules/param-click-duration.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/param-filter-frequency-range.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/param-q-value-range.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/param-reasonable-gain.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/physics-active-state.md +23 -0
- package/dist/resources/skills/userinterface-wiki/rules/physics-no-excessive-stagger.md +22 -0
- package/dist/resources/skills/userinterface-wiki/rules/physics-spring-for-overshoot.md +23 -0
- package/dist/resources/skills/userinterface-wiki/rules/physics-subtle-deformation.md +22 -0
- package/dist/resources/skills/userinterface-wiki/rules/prefetch-hit-slop.md +27 -0
- package/dist/resources/skills/userinterface-wiki/rules/prefetch-keyboard-tab.md +19 -0
- package/dist/resources/skills/userinterface-wiki/rules/prefetch-not-everything.md +22 -0
- package/dist/resources/skills/userinterface-wiki/rules/prefetch-touch-fallback.md +34 -0
- package/dist/resources/skills/userinterface-wiki/rules/prefetch-trajectory-over-hover.md +32 -0
- package/dist/resources/skills/userinterface-wiki/rules/prefetch-use-selectively.md +13 -0
- package/dist/resources/skills/userinterface-wiki/rules/presence-disable-interactions.md +31 -0
- package/dist/resources/skills/userinterface-wiki/rules/presence-hook-in-child.md +31 -0
- package/dist/resources/skills/userinterface-wiki/rules/presence-safe-to-remove.md +37 -0
- package/dist/resources/skills/userinterface-wiki/rules/pseudo-content-required.md +28 -0
- package/dist/resources/skills/userinterface-wiki/rules/pseudo-first-line-styling.md +27 -0
- package/dist/resources/skills/userinterface-wiki/rules/pseudo-hit-target-expansion.md +31 -0
- package/dist/resources/skills/userinterface-wiki/rules/pseudo-marker-styling.md +28 -0
- package/dist/resources/skills/userinterface-wiki/rules/pseudo-over-dom-node.md +32 -0
- package/dist/resources/skills/userinterface-wiki/rules/pseudo-position-relative-parent.md +33 -0
- package/dist/resources/skills/userinterface-wiki/rules/pseudo-z-index-layering.md +37 -0
- package/dist/resources/skills/userinterface-wiki/rules/spring-for-gestures.md +27 -0
- package/dist/resources/skills/userinterface-wiki/rules/spring-for-interruptible.md +27 -0
- package/dist/resources/skills/userinterface-wiki/rules/spring-params-balanced.md +29 -0
- package/dist/resources/skills/userinterface-wiki/rules/spring-preserves-velocity.md +28 -0
- package/dist/resources/skills/userinterface-wiki/rules/staging-dim-background.md +22 -0
- package/dist/resources/skills/userinterface-wiki/rules/staging-one-focal-point.md +24 -0
- package/dist/resources/skills/userinterface-wiki/rules/staging-z-index-hierarchy.md +22 -0
- package/dist/resources/skills/userinterface-wiki/rules/timing-consistent.md +24 -0
- package/dist/resources/skills/userinterface-wiki/rules/timing-no-entrance-context-menu.md +22 -0
- package/dist/resources/skills/userinterface-wiki/rules/timing-under-300ms.md +22 -0
- package/dist/resources/skills/userinterface-wiki/rules/transition-name-cleanup.md +28 -0
- package/dist/resources/skills/userinterface-wiki/rules/transition-name-required.md +27 -0
- package/dist/resources/skills/userinterface-wiki/rules/transition-name-unique.md +24 -0
- package/dist/resources/skills/userinterface-wiki/rules/transition-over-js-library.md +32 -0
- package/dist/resources/skills/userinterface-wiki/rules/transition-style-pseudo-elements.md +24 -0
- package/dist/resources/skills/userinterface-wiki/rules/type-antialiased-on-retina.md +18 -0
- package/dist/resources/skills/userinterface-wiki/rules/type-disambiguation-stylistic-set.md +15 -0
- package/dist/resources/skills/userinterface-wiki/rules/type-font-display-swap.md +28 -0
- package/dist/resources/skills/userinterface-wiki/rules/type-justify-with-hyphens.md +24 -0
- package/dist/resources/skills/userinterface-wiki/rules/type-letter-spacing-uppercase.md +28 -0
- package/dist/resources/skills/userinterface-wiki/rules/type-no-font-synthesis.md +18 -0
- package/dist/resources/skills/userinterface-wiki/rules/type-oldstyle-nums-for-prose.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/type-opentype-contextual-alternates.md +15 -0
- package/dist/resources/skills/userinterface-wiki/rules/type-optical-sizing-auto.md +25 -0
- package/dist/resources/skills/userinterface-wiki/rules/type-proper-fractions.md +15 -0
- package/dist/resources/skills/userinterface-wiki/rules/type-slashed-zero.md +17 -0
- package/dist/resources/skills/userinterface-wiki/rules/type-tabular-nums-for-data.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/type-text-wrap-balance-headings.md +21 -0
- package/dist/resources/skills/userinterface-wiki/rules/type-text-wrap-pretty.md +16 -0
- package/dist/resources/skills/userinterface-wiki/rules/type-underline-offset.md +25 -0
- package/dist/resources/skills/userinterface-wiki/rules/type-variable-weight-continuous.md +23 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-aesthetic-usability.md +32 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-cognitive-load-reduce.md +49 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-common-region-boundaries.md +50 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-doherty-perceived-speed.md +29 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-doherty-under-400ms.md +30 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-fitts-hit-area.md +32 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-fitts-target-size.md +31 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-goal-gradient-progress.md +33 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-hicks-minimize-choices.md +45 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-jakobs-familiar-patterns.md +37 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-millers-chunking.md +23 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-pareto-prioritize-features.md +36 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-peak-end-finish-strong.md +35 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-postels-accept-messy-input.md +45 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-pragnanz-simplify.md +33 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-progressive-disclosure.md +41 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-proximity-grouping.md +38 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-serial-position.md +31 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-similarity-consistency.md +35 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-teslers-complexity.md +28 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-uniform-connectedness.md +43 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-von-restorff-emphasis.md +29 -0
- package/dist/resources/skills/userinterface-wiki/rules/ux-zeigarnik-show-incomplete.md +36 -0
- package/dist/resources/skills/userinterface-wiki/rules/visual-animate-shadow-pseudo.md +49 -0
- package/dist/resources/skills/userinterface-wiki/rules/visual-border-alpha-colors.md +25 -0
- package/dist/resources/skills/userinterface-wiki/rules/visual-button-shadow-anatomy.md +49 -0
- package/dist/resources/skills/userinterface-wiki/rules/visual-concentric-radius.md +40 -0
- package/dist/resources/skills/userinterface-wiki/rules/visual-consistent-spacing-scale.md +35 -0
- package/dist/resources/skills/userinterface-wiki/rules/visual-layered-shadows.md +30 -0
- package/dist/resources/skills/userinterface-wiki/rules/visual-no-pure-black-shadow.md +25 -0
- package/dist/resources/skills/userinterface-wiki/rules/visual-shadow-direction.md +25 -0
- package/dist/resources/skills/userinterface-wiki/rules/visual-shadow-matches-elevation.md +23 -0
- package/dist/resources/skills/userinterface-wiki/rules/weight-duration-matches-action.md +29 -0
- package/dist/resources/skills/userinterface-wiki/rules/weight-match-action.md +32 -0
- package/dist/resources/skills/web-design-guidelines/SKILL.md +39 -0
- package/dist/resources/skills/web-quality-audit/SKILL.md +170 -0
- package/dist/resources/skills/web-quality-audit/scripts/analyze.sh +91 -0
- package/dist/update-check.js +1 -1
- package/package.json +18 -6
- package/packages/native/package.json +28 -0
- package/packages/pi-agent-core/package.json +6 -0
- package/packages/pi-ai/dist/models.generated.d.ts +43 -11
- package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.js +34 -26
- package/packages/pi-ai/dist/models.generated.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +3 -2
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-codex-responses.js +14 -4
- package/packages/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.js +7 -4
- package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/anthropic.js +2 -0
- package/packages/pi-ai/dist/utils/oauth/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js +5 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.js +4 -0
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js +6 -0
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/index.js +2 -2
- package/packages/pi-ai/dist/utils/oauth/index.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/openai-codex.js +2 -0
- package/packages/pi-ai/dist/utils/oauth/openai-codex.js.map +1 -1
- package/packages/pi-ai/oauth.d.ts +1 -0
- package/packages/pi-ai/oauth.js +1 -0
- package/packages/pi-ai/package.json +2 -2
- package/packages/pi-ai/src/models.generated.ts +42 -34
- package/packages/pi-ai/src/providers/anthropic.ts +3 -2
- package/packages/pi-ai/src/providers/openai-codex-responses.ts +15 -4
- package/packages/pi-ai/src/providers/openai-completions.ts +7 -4
- package/packages/pi-ai/src/utils/oauth/anthropic.ts +2 -0
- package/packages/pi-ai/src/utils/oauth/github-copilot.ts +5 -1
- package/packages/pi-ai/src/utils/oauth/google-antigravity.ts +4 -0
- package/packages/pi-ai/src/utils/oauth/google-gemini-cli.ts +6 -0
- package/packages/pi-ai/src/utils/oauth/index.ts +2 -2
- package/packages/pi-ai/src/utils/oauth/openai-codex.ts +2 -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/dist/core/auth-storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.js +2 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/bash-executor.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/bash-executor.js +23 -1
- package/packages/pi-coding-agent/dist/core/bash-executor.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/blob-store.d.ts +8 -0
- package/packages/pi-coding-agent/dist/core/blob-store.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/blob-store.js +50 -1
- package/packages/pi-coding-agent/dist/core/blob-store.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.js +2 -1
- package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js +3 -2
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/utils.js +2 -2
- package/packages/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/constants.d.ts +29 -0
- package/packages/pi-coding-agent/dist/core/constants.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/constants.js +44 -0
- package/packages/pi-coding-agent/dist/core/constants.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js +32 -10
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.test.js +77 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/fs-utils.d.ts +7 -0
- package/packages/pi-coding-agent/dist/core/fs-utils.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/fs-utils.js +12 -0
- package/packages/pi-coding-agent/dist/core/fs-utils.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/fs-utils.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/fs-utils.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/fs-utils.test.js +67 -0
- package/packages/pi-coding-agent/dist/core/fs-utils.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/client.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/client.js +29 -2
- package/packages/pi-coding-agent/dist/core/lsp/client.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/config.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/config.js +9 -2
- package/packages/pi-coding-agent/dist/core/lsp/config.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/index.js +30 -4
- package/packages/pi-coding-agent/dist/core/lsp/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/lspmux.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/lspmux.js +13 -5
- package/packages/pi-coding-agent/dist/core/lsp/lspmux.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.js +14 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/resolve-config-value.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/resolve-config-value.js +12 -4
- package/packages/pi-coding-agent/dist/core/resolve-config-value.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/resolve-config-value.test.js +49 -0
- package/packages/pi-coding-agent/dist/core/resolve-config-value.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.d.ts +7 -0
- package/packages/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.js +108 -14
- package/packages/pi-coding-agent/dist/core/session-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +3 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +14 -5
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/edit-diff.js +2 -2
- package/packages/pi-coding-agent/dist/core/tools/edit-diff.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/find.js +2 -1
- package/packages/pi-coding-agent/dist/core/tools/find.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline-edit.js +4 -4
- package/packages/pi-coding-agent/dist/core/tools/hashline-edit.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline.d.ts +1 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline.js +1 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/hashline.test.js +8 -8
- package/packages/pi-coding-agent/dist/core/tools/hashline.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/core/tools/index.js +1 -1
- package/packages/pi-coding-agent/dist/core/tools/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/path-utils.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/tools/path-utils.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/path-utils.js +1 -1
- package/packages/pi-coding-agent/dist/core/tools/path-utils.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/truncate.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/tools/truncate.js +2 -1
- package/packages/pi-coding-agent/dist/core/tools/truncate.js.map +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts +2 -1
- package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/index.js +3 -1
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/main.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/main.js +6 -0
- package/packages/pi-coding-agent/dist/main.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.d.ts +9 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.js +47 -5
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/index.js +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +4 -4
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +12 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +30 -2
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.js +11 -0
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js +12 -2
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/resources/extensions/memory/pipeline.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/resources/extensions/memory/pipeline.js +25 -3
- package/packages/pi-coding-agent/dist/resources/extensions/memory/pipeline.js.map +1 -1
- package/packages/pi-coding-agent/package.json +0 -4
- package/packages/pi-coding-agent/src/core/agent-session.ts +1 -1
- package/packages/pi-coding-agent/src/core/auth-storage.ts +2 -1
- package/packages/pi-coding-agent/src/core/bash-executor.ts +23 -1
- package/packages/pi-coding-agent/src/core/blob-store.ts +46 -1
- package/packages/pi-coding-agent/src/core/compaction/branch-summarization.ts +2 -1
- package/packages/pi-coding-agent/src/core/compaction/compaction.ts +3 -2
- package/packages/pi-coding-agent/src/core/compaction/utils.ts +2 -2
- package/packages/pi-coding-agent/src/core/constants.ts +59 -0
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +1 -1
- package/packages/pi-coding-agent/src/core/extensions/runner.test.ts +84 -0
- package/packages/pi-coding-agent/src/core/extensions/runner.ts +31 -10
- package/packages/pi-coding-agent/src/core/fs-utils.test.ts +66 -0
- package/packages/pi-coding-agent/src/core/fs-utils.ts +12 -0
- package/packages/pi-coding-agent/src/core/lsp/client.ts +30 -2
- package/packages/pi-coding-agent/src/core/lsp/config.ts +9 -2
- package/packages/pi-coding-agent/src/core/lsp/index.ts +31 -5
- package/packages/pi-coding-agent/src/core/lsp/lspmux.ts +13 -5
- package/packages/pi-coding-agent/src/core/model-resolver.ts +14 -0
- package/packages/pi-coding-agent/src/core/resolve-config-value.test.ts +58 -0
- package/packages/pi-coding-agent/src/core/resolve-config-value.ts +14 -4
- package/packages/pi-coding-agent/src/core/session-manager.ts +113 -18
- package/packages/pi-coding-agent/src/core/settings-manager.ts +22 -5
- package/packages/pi-coding-agent/src/core/tools/edit-diff.ts +2 -2
- package/packages/pi-coding-agent/src/core/tools/find.ts +2 -1
- package/packages/pi-coding-agent/src/core/tools/hashline-edit.ts +4 -4
- package/packages/pi-coding-agent/src/core/tools/hashline.test.ts +8 -8
- package/packages/pi-coding-agent/src/core/tools/hashline.ts +1 -1
- package/packages/pi-coding-agent/src/core/tools/index.ts +1 -1
- package/packages/pi-coding-agent/src/core/tools/path-utils.ts +1 -1
- package/packages/pi-coding-agent/src/core/tools/truncate.ts +3 -1
- package/packages/pi-coding-agent/src/index.ts +9 -0
- package/packages/pi-coding-agent/src/main.ts +7 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/extension-selector.ts +49 -5
- package/packages/pi-coding-agent/src/modes/interactive/components/index.ts +1 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/login-dialog.ts +4 -4
- package/packages/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +15 -0
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +32 -1
- package/packages/pi-coding-agent/src/modes/rpc/rpc-client.ts +12 -0
- package/packages/pi-coding-agent/src/modes/rpc/rpc-mode.ts +11 -2
- package/packages/pi-coding-agent/src/resources/extensions/memory/pipeline.ts +23 -3
- package/packages/pi-tui/dist/__tests__/autocomplete.test.d.ts +2 -0
- package/packages/pi-tui/dist/__tests__/autocomplete.test.d.ts.map +1 -0
- package/packages/pi-tui/dist/__tests__/autocomplete.test.js +149 -0
- package/packages/pi-tui/dist/__tests__/autocomplete.test.js.map +1 -0
- package/packages/pi-tui/dist/__tests__/fuzzy.test.d.ts +2 -0
- package/packages/pi-tui/dist/__tests__/fuzzy.test.d.ts.map +1 -0
- package/packages/pi-tui/dist/__tests__/fuzzy.test.js +94 -0
- package/packages/pi-tui/dist/__tests__/fuzzy.test.js.map +1 -0
- package/packages/pi-tui/dist/autocomplete.d.ts +5 -1
- package/packages/pi-tui/dist/autocomplete.d.ts.map +1 -1
- package/packages/pi-tui/dist/autocomplete.js +6 -2
- package/packages/pi-tui/dist/autocomplete.js.map +1 -1
- package/packages/pi-tui/dist/components/editor.d.ts.map +1 -1
- package/packages/pi-tui/dist/components/editor.js +1 -1
- package/packages/pi-tui/dist/components/editor.js.map +1 -1
- package/packages/pi-tui/package.json +8 -2
- package/packages/pi-tui/src/__tests__/autocomplete.test.ts +186 -0
- package/packages/pi-tui/src/__tests__/fuzzy.test.ts +112 -0
- package/packages/pi-tui/src/autocomplete.ts +8 -1
- package/packages/pi-tui/src/components/editor.ts +3 -1
- package/src/resources/extensions/ask-user-questions.ts +3 -2
- package/src/resources/extensions/bg-shell/bg-shell-command.ts +219 -0
- package/src/resources/extensions/bg-shell/bg-shell-lifecycle.ts +400 -0
- package/src/resources/extensions/bg-shell/bg-shell-tool.ts +985 -0
- package/src/resources/extensions/bg-shell/index.ts +18 -1545
- package/src/resources/extensions/bg-shell/overlay.ts +4 -0
- package/src/resources/extensions/bg-shell/process-manager.ts +45 -0
- package/src/resources/extensions/bg-shell/types.ts +21 -1
- package/src/resources/extensions/bg-shell/utilities.ts +4 -16
- package/src/resources/extensions/browser-tools/capture.ts +34 -2
- package/src/resources/extensions/browser-tools/lifecycle.ts +5 -5
- package/src/resources/extensions/browser-tools/settle.ts +1 -1
- package/src/resources/extensions/browser-tools/state.ts +5 -5
- package/src/resources/extensions/browser-tools/tests/browser-tools-integration.test.mjs +1 -1
- package/src/resources/extensions/browser-tools/tests/browser-tools-unit.test.cjs +3 -3
- package/src/resources/extensions/browser-tools/tools/assertions.ts +1 -1
- package/src/resources/extensions/browser-tools/tools/device.ts +1 -1
- package/src/resources/extensions/browser-tools/tools/extract.ts +1 -1
- package/src/resources/extensions/browser-tools/tools/navigation.ts +6 -6
- package/src/resources/extensions/browser-tools/tools/network-mock.ts +1 -1
- package/src/resources/extensions/browser-tools/tools/pages.ts +1 -1
- package/src/resources/extensions/browser-tools/tools/screenshot.ts +28 -10
- package/src/resources/extensions/browser-tools/tools/state-persistence.ts +1 -1
- package/src/resources/extensions/browser-tools/tools/visual-diff.ts +1 -1
- package/src/resources/extensions/browser-tools/utils.ts +5 -5
- package/src/resources/extensions/get-secrets-from-user.ts +1 -1
- package/src/resources/extensions/google-search/index.ts +21 -8
- package/src/resources/extensions/gsd/activity-log.ts +2 -1
- package/src/resources/extensions/gsd/atomic-write.ts +35 -0
- package/src/resources/extensions/gsd/auto/session.ts +236 -0
- package/src/resources/extensions/gsd/auto-budget.ts +32 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +147 -13
- package/src/resources/extensions/gsd/auto-direct-dispatch.ts +229 -0
- package/src/resources/extensions/gsd/auto-dispatch.ts +23 -10
- package/src/resources/extensions/gsd/auto-idempotency.ts +150 -0
- package/src/resources/extensions/gsd/auto-model-selection.ts +179 -0
- package/src/resources/extensions/gsd/auto-observability.ts +74 -0
- package/src/resources/extensions/gsd/auto-post-unit.ts +591 -0
- package/src/resources/extensions/gsd/auto-prompts.ts +116 -23
- package/src/resources/extensions/gsd/auto-recovery.ts +4 -9
- package/src/resources/extensions/gsd/auto-start.ts +500 -0
- package/src/resources/extensions/gsd/auto-stuck-detection.ts +220 -0
- package/src/resources/extensions/gsd/auto-timeout-recovery.ts +262 -0
- package/src/resources/extensions/gsd/auto-timers.ts +223 -0
- package/src/resources/extensions/gsd/auto-tool-tracking.ts +54 -0
- package/src/resources/extensions/gsd/auto-unit-closeout.ts +48 -0
- package/src/resources/extensions/gsd/auto-verification.ts +195 -0
- package/src/resources/extensions/gsd/auto-worktree-sync.ts +184 -0
- package/src/resources/extensions/gsd/auto-worktree.ts +83 -67
- package/src/resources/extensions/gsd/auto.ts +825 -3069
- package/src/resources/extensions/gsd/commands-config.ts +102 -0
- package/src/resources/extensions/gsd/commands-handlers.ts +402 -0
- package/src/resources/extensions/gsd/commands-inspect.ts +90 -0
- package/src/resources/extensions/gsd/commands-logs.ts +537 -0
- package/src/resources/extensions/gsd/commands-maintenance.ts +206 -0
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +747 -0
- package/src/resources/extensions/gsd/commands.ts +380 -1433
- package/src/resources/extensions/gsd/constants.ts +21 -0
- package/src/resources/extensions/gsd/context-budget.ts +25 -2
- package/src/resources/extensions/gsd/crash-recovery.ts +4 -2
- package/src/resources/extensions/gsd/dashboard-overlay.ts +58 -74
- package/src/resources/extensions/gsd/db-writer.ts +21 -2
- package/src/resources/extensions/gsd/detection.ts +469 -0
- package/src/resources/extensions/gsd/diff-context.ts +2 -1
- package/src/resources/extensions/gsd/dispatch-guard.ts +4 -0
- package/src/resources/extensions/gsd/docs/preferences-reference.md +83 -0
- package/src/resources/extensions/gsd/doctor-checks.ts +564 -0
- package/src/resources/extensions/gsd/doctor-format.ts +78 -0
- package/src/resources/extensions/gsd/doctor-proactive.ts +9 -4
- package/src/resources/extensions/gsd/doctor-types.ts +72 -0
- package/src/resources/extensions/gsd/doctor.ts +64 -701
- package/src/resources/extensions/gsd/errors.ts +0 -2
- package/src/resources/extensions/gsd/export-html.ts +1357 -0
- package/src/resources/extensions/gsd/export.ts +115 -4
- package/src/resources/extensions/gsd/files.ts +8 -126
- package/src/resources/extensions/gsd/forensics.ts +2 -12
- package/src/resources/extensions/gsd/git-constants.ts +11 -0
- package/src/resources/extensions/gsd/git-service.ts +19 -9
- package/src/resources/extensions/gsd/gitignore.ts +4 -1
- package/src/resources/extensions/gsd/gsd-db.ts +26 -6
- package/src/resources/extensions/gsd/guided-flow-queue.ts +451 -0
- package/src/resources/extensions/gsd/guided-flow.ts +252 -516
- package/src/resources/extensions/gsd/history.ts +2 -20
- package/src/resources/extensions/gsd/index.ts +260 -46
- package/src/resources/extensions/gsd/init-wizard.ts +615 -0
- package/src/resources/extensions/gsd/jsonl-utils.ts +21 -0
- package/src/resources/extensions/gsd/key-manager.ts +995 -0
- package/src/resources/extensions/gsd/metrics.ts +32 -5
- package/src/resources/extensions/gsd/migrate/command.ts +1 -1
- package/src/resources/extensions/gsd/migrate/parsers.ts +10 -95
- package/src/resources/extensions/gsd/milestone-actions.ts +126 -0
- package/src/resources/extensions/gsd/milestone-ids.ts +95 -0
- package/src/resources/extensions/gsd/native-git-bridge.ts +35 -12
- package/src/resources/extensions/gsd/parallel-eligibility.ts +3 -3
- package/src/resources/extensions/gsd/parallel-orchestrator.ts +231 -20
- package/src/resources/extensions/gsd/paths.ts +1 -3
- package/src/resources/extensions/gsd/plugin-importer.ts +3 -2
- package/src/resources/extensions/gsd/preferences-hooks.ts +10 -0
- package/src/resources/extensions/gsd/preferences-models.ts +323 -0
- package/src/resources/extensions/gsd/preferences-skills.ts +169 -0
- package/src/resources/extensions/gsd/preferences-types.ts +223 -0
- package/src/resources/extensions/gsd/preferences-validation.ts +597 -0
- package/src/resources/extensions/gsd/preferences.ts +219 -1286
- package/src/resources/extensions/gsd/prompt-cache-optimizer.ts +213 -0
- package/src/resources/extensions/gsd/prompt-compressor.ts +508 -0
- package/src/resources/extensions/gsd/prompt-loader.ts +4 -2
- package/src/resources/extensions/gsd/prompt-ordering.ts +200 -0
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +2 -2
- package/src/resources/extensions/gsd/prompts/complete-slice.md +4 -4
- package/src/resources/extensions/gsd/prompts/discuss-headless.md +2 -4
- package/src/resources/extensions/gsd/prompts/discuss.md +13 -5
- package/src/resources/extensions/gsd/prompts/execute-task.md +1 -2
- package/src/resources/extensions/gsd/prompts/guided-complete-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/guided-plan-milestone.md +0 -1
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +1 -2
- package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -2
- package/src/resources/extensions/gsd/prompts/queue.md +30 -0
- package/src/resources/extensions/gsd/prompts/quick-task.md +0 -6
- package/src/resources/extensions/gsd/prompts/replan-slice.md +0 -1
- package/src/resources/extensions/gsd/prompts/rewrite-docs.md +0 -1
- package/src/resources/extensions/gsd/prompts/system.md +6 -3
- package/src/resources/extensions/gsd/provider-error-pause.ts +59 -10
- package/src/resources/extensions/gsd/queue-order.ts +1 -1
- package/src/resources/extensions/gsd/queue-reorder-ui.ts +15 -2
- package/src/resources/extensions/gsd/quick.ts +18 -15
- package/src/resources/extensions/gsd/reports.ts +504 -0
- package/src/resources/extensions/gsd/roadmap-slices.ts +1 -1
- package/src/resources/extensions/gsd/safe-fs.ts +47 -0
- package/src/resources/extensions/gsd/semantic-chunker.ts +336 -0
- package/src/resources/extensions/gsd/session-forensics.ts +8 -23
- package/src/resources/extensions/gsd/session-lock.ts +284 -0
- package/src/resources/extensions/gsd/skills/gsd-headless/SKILL.md +242 -0
- package/src/resources/extensions/gsd/skills/gsd-headless/references/answer-injection.md +83 -0
- package/src/resources/extensions/gsd/skills/gsd-headless/references/commands.md +64 -0
- package/src/resources/extensions/gsd/skills/gsd-headless/references/multi-session.md +176 -0
- package/src/resources/extensions/gsd/state.ts +84 -2
- package/src/resources/extensions/gsd/structured-data-formatter.ts +144 -0
- package/src/resources/extensions/gsd/summary-distiller.ts +258 -0
- package/src/resources/extensions/gsd/templates/preferences.md +34 -0
- package/src/resources/extensions/gsd/tests/activity-log.test.ts +213 -0
- package/src/resources/extensions/gsd/tests/agent-end-retry.test.ts +107 -0
- package/src/resources/extensions/gsd/tests/all-milestones-complete-merge.test.ts +197 -0
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +13 -0
- package/src/resources/extensions/gsd/tests/auto-preflight.test.ts +33 -39
- package/src/resources/extensions/gsd/tests/auto-secrets-gate.test.ts +108 -2
- package/src/resources/extensions/gsd/tests/auto-session-encapsulation.test.ts +257 -0
- package/src/resources/extensions/gsd/tests/auto-worktree-milestone-merge.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/commands-logs.test.ts +241 -0
- package/src/resources/extensions/gsd/tests/context-budget.test.ts +69 -0
- package/src/resources/extensions/gsd/tests/continue-here.test.ts +81 -0
- package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +5 -0
- package/src/resources/extensions/gsd/tests/derive-state-deps.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/derive-state-draft.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/derive-state.test.ts +10 -1
- package/src/resources/extensions/gsd/tests/detection.test.ts +398 -0
- package/src/resources/extensions/gsd/tests/discuss-prompt.test.ts +12 -24
- package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +118 -94
- package/src/resources/extensions/gsd/tests/dispatch-missing-task-plans.test.ts +132 -0
- package/src/resources/extensions/gsd/tests/dispatch-stall-guard.test.ts +126 -0
- package/src/resources/extensions/gsd/tests/dist-redirect.mjs +7 -3
- package/src/resources/extensions/gsd/tests/doctor-fixlevel.test.ts +75 -0
- package/src/resources/extensions/gsd/tests/doctor-git.test.ts +17 -55
- package/src/resources/extensions/gsd/tests/doctor-proactive.test.ts +14 -0
- package/src/resources/extensions/gsd/tests/export-html-all.test.ts +105 -0
- package/src/resources/extensions/gsd/tests/export-html-enhancements.test.ts +375 -0
- package/src/resources/extensions/gsd/tests/extension-selector-separator.test.ts +122 -0
- package/src/resources/extensions/gsd/tests/feature-branch-lifecycle-integration.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/headless-answers.test.ts +340 -0
- package/src/resources/extensions/gsd/tests/headless-query.test.ts +162 -0
- package/src/resources/extensions/gsd/tests/in-flight-tool-tracking.test.ts +24 -82
- package/src/resources/extensions/gsd/tests/init-wizard.test.ts +197 -0
- package/src/resources/extensions/gsd/tests/integration-mixed-milestones.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/key-manager.test.ts +414 -0
- package/src/resources/extensions/gsd/tests/metrics.test.ts +173 -305
- package/src/resources/extensions/gsd/tests/milestone-transition-worktree.test.ts +4 -1
- package/src/resources/extensions/gsd/tests/model-isolation.test.ts +59 -1
- package/src/resources/extensions/gsd/tests/native-has-changes-cache.test.ts +61 -0
- package/src/resources/extensions/gsd/tests/next-milestone-id.test.ts +18 -61
- package/src/resources/extensions/gsd/tests/none-mode-gates.test.ts +17 -8
- package/src/resources/extensions/gsd/tests/parallel-budget-atomicity.test.ts +331 -0
- package/src/resources/extensions/gsd/tests/parallel-crash-recovery.test.ts +298 -0
- package/src/resources/extensions/gsd/tests/parallel-merge.test.ts +468 -0
- package/src/resources/extensions/gsd/tests/parallel-orchestration.test.ts +39 -10
- package/src/resources/extensions/gsd/tests/park-edge-cases.test.ts +276 -0
- package/src/resources/extensions/gsd/tests/park-milestone.test.ts +401 -0
- package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/preferences.test.ts +284 -0
- package/src/resources/extensions/gsd/tests/prompt-cache-optimizer.test.ts +314 -0
- package/src/resources/extensions/gsd/tests/prompt-compressor.test.ts +529 -0
- package/src/resources/extensions/gsd/tests/prompt-ordering.test.ts +296 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +338 -0
- package/src/resources/extensions/gsd/tests/reassess-detection.test.ts +154 -0
- package/src/resources/extensions/gsd/tests/remote-questions.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/remote-status.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/replan-slice.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/roadmap-slices.test.ts +43 -60
- package/src/resources/extensions/gsd/tests/semantic-chunker.test.ts +426 -0
- package/src/resources/extensions/gsd/tests/session-lock.test.ts +315 -0
- package/src/resources/extensions/gsd/tests/stale-worktree-cwd.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/stop-auto-remote.test.ts +8 -5
- package/src/resources/extensions/gsd/tests/structured-data-formatter.test.ts +365 -0
- package/src/resources/extensions/gsd/tests/summary-distiller.test.ts +323 -0
- package/src/resources/extensions/gsd/tests/token-counter.test.ts +129 -0
- package/src/resources/extensions/gsd/tests/token-optimization-benchmark.test.ts +1272 -0
- package/src/resources/extensions/gsd/tests/token-optimization-prefs.test.ts +164 -0
- package/src/resources/extensions/gsd/tests/token-profile.test.ts +8 -1
- package/src/resources/extensions/gsd/tests/triage-dispatch.test.ts +75 -79
- package/src/resources/extensions/gsd/tests/update-command.test.ts +67 -0
- package/src/resources/extensions/gsd/tests/validate-directory.test.ts +222 -0
- package/src/resources/extensions/gsd/tests/verification-gate.test.ts +115 -1
- package/src/resources/extensions/gsd/tests/visualizer-data.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/visualizer-overlay.test.ts +44 -10
- package/src/resources/extensions/gsd/tests/visualizer-views.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/workspace-index.test.ts +24 -61
- package/src/resources/extensions/gsd/tests/worktree-e2e.test.ts +5 -2
- package/src/resources/extensions/gsd/tests/worktree.test.ts +3 -1
- package/src/resources/extensions/gsd/tests/write-gate.test.ts +132 -43
- package/src/resources/extensions/gsd/token-counter.ts +20 -0
- package/src/resources/extensions/gsd/triage-ui.ts +1 -1
- package/src/resources/extensions/gsd/types.ts +4 -1
- package/src/resources/extensions/gsd/validate-directory.ts +164 -0
- package/src/resources/extensions/gsd/verification-evidence.ts +7 -4
- package/src/resources/extensions/gsd/verification-gate.ts +70 -5
- package/src/resources/extensions/gsd/visualizer-data.ts +26 -4
- package/src/resources/extensions/gsd/visualizer-overlay.ts +35 -22
- package/src/resources/extensions/gsd/visualizer-views.ts +14 -66
- package/src/resources/extensions/gsd/worktree-command.ts +4 -51
- package/src/resources/extensions/gsd/worktree-manager.ts +7 -9
- package/src/resources/extensions/gsd/worktree.ts +41 -1
- package/src/resources/extensions/mcporter/index.ts +27 -14
- package/src/resources/extensions/remote-questions/manager.ts +6 -24
- package/src/resources/extensions/remote-questions/mod.ts +16 -0
- package/src/resources/extensions/remote-questions/notify.ts +91 -0
- package/src/resources/extensions/remote-questions/remote-command.ts +1 -1
- package/src/resources/extensions/remote-questions/store.ts +5 -1
- package/src/resources/extensions/remote-questions/types.ts +26 -3
- package/src/resources/extensions/search-the-web/native-search.ts +7 -0
- package/src/resources/extensions/search-the-web/provider.ts +15 -3
- package/src/resources/extensions/search-the-web/tool-llm-context.ts +1 -13
- package/src/resources/extensions/search-the-web/tool-search.ts +27 -13
- package/src/resources/extensions/shared/format-utils.ts +138 -0
- package/src/resources/extensions/shared/frontmatter.ts +117 -0
- package/src/resources/extensions/shared/mod.ts +30 -0
- package/src/resources/extensions/shared/sanitize.ts +19 -0
- package/src/resources/extensions/shared/tests/format-utils.test.ts +153 -0
- package/src/resources/extensions/slash-commands/create-extension.ts +1 -1
- package/src/resources/extensions/slash-commands/create-slash-command.ts +1 -1
- package/src/resources/extensions/subagent/index.ts +47 -3
- package/src/resources/extensions/subagent/isolation.ts +9 -6
- package/src/resources/extensions/ttsr/index.ts +5 -0
- package/src/resources/extensions/ttsr/rule-loader.ts +4 -51
- package/src/resources/extensions/universal-config/discovery.ts +37 -15
- package/src/resources/extensions/voice/index.ts +1 -1
- package/src/resources/skills/accessibility/SKILL.md +522 -0
- package/src/resources/skills/accessibility/references/WCAG.md +162 -0
- package/src/resources/skills/agent-browser/SKILL.md +517 -0
- package/src/resources/skills/agent-browser/references/authentication.md +202 -0
- package/src/resources/skills/agent-browser/references/commands.md +263 -0
- package/src/resources/skills/agent-browser/references/profiling.md +120 -0
- package/src/resources/skills/agent-browser/references/proxy-support.md +194 -0
- package/src/resources/skills/agent-browser/references/session-management.md +193 -0
- package/src/resources/skills/agent-browser/references/snapshot-refs.md +194 -0
- package/src/resources/skills/agent-browser/references/video-recording.md +173 -0
- package/src/resources/skills/agent-browser/templates/authenticated-session.sh +105 -0
- package/src/resources/skills/agent-browser/templates/capture-workflow.sh +69 -0
- package/src/resources/skills/agent-browser/templates/form-automation.sh +62 -0
- package/src/resources/skills/best-practices/SKILL.md +583 -0
- package/src/resources/skills/code-optimizer/SKILL.md +160 -0
- package/src/resources/skills/code-optimizer/references/algorithmic-complexity.md +66 -0
- package/src/resources/skills/code-optimizer/references/build-compilation.md +90 -0
- package/src/resources/skills/code-optimizer/references/bundle-dependencies.md +82 -0
- package/src/resources/skills/code-optimizer/references/caching-memoization.md +76 -0
- package/src/resources/skills/code-optimizer/references/concurrency-async.md +80 -0
- package/src/resources/skills/code-optimizer/references/config-infra.md +71 -0
- package/src/resources/skills/code-optimizer/references/data-structures.md +80 -0
- package/src/resources/skills/code-optimizer/references/database-queries.md +76 -0
- package/src/resources/skills/code-optimizer/references/dead-code-redundancy.md +84 -0
- package/src/resources/skills/code-optimizer/references/error-resilience.md +80 -0
- package/src/resources/skills/code-optimizer/references/io-network.md +89 -0
- package/src/resources/skills/code-optimizer/references/logging-observability.md +64 -0
- package/src/resources/skills/code-optimizer/references/memory-resources.md +66 -0
- package/src/resources/skills/code-optimizer/references/rendering-ui.md +90 -0
- package/src/resources/skills/code-optimizer/references/security-performance.md +68 -0
- package/src/resources/skills/core-web-vitals/SKILL.md +441 -0
- package/src/resources/skills/core-web-vitals/references/LCP.md +208 -0
- package/src/resources/skills/make-interfaces-feel-better/SKILL.md +122 -0
- package/src/resources/skills/make-interfaces-feel-better/animations.md +379 -0
- package/src/resources/skills/make-interfaces-feel-better/performance.md +88 -0
- package/src/resources/skills/make-interfaces-feel-better/surfaces.md +247 -0
- package/src/resources/skills/make-interfaces-feel-better/typography.md +123 -0
- package/src/resources/skills/react-best-practices/README.md +123 -0
- package/src/resources/skills/react-best-practices/SKILL.md +136 -0
- package/src/resources/skills/react-best-practices/metadata.json +15 -0
- package/src/resources/skills/react-best-practices/rules/_sections.md +46 -0
- package/src/resources/skills/react-best-practices/rules/_template.md +28 -0
- package/src/resources/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/src/resources/skills/react-best-practices/rules/advanced-init-once.md +42 -0
- package/src/resources/skills/react-best-practices/rules/advanced-use-latest.md +39 -0
- package/src/resources/skills/react-best-practices/rules/async-api-routes.md +38 -0
- package/src/resources/skills/react-best-practices/rules/async-defer-await.md +80 -0
- package/src/resources/skills/react-best-practices/rules/async-dependencies.md +51 -0
- package/src/resources/skills/react-best-practices/rules/async-parallel.md +28 -0
- package/src/resources/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/src/resources/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/src/resources/skills/react-best-practices/rules/bundle-conditional.md +31 -0
- package/src/resources/skills/react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/src/resources/skills/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/src/resources/skills/react-best-practices/rules/bundle-preload.md +50 -0
- package/src/resources/skills/react-best-practices/rules/client-event-listeners.md +74 -0
- package/src/resources/skills/react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/src/resources/skills/react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/src/resources/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
- package/src/resources/skills/react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/src/resources/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
- package/src/resources/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
- package/src/resources/skills/react-best-practices/rules/js-cache-storage.md +70 -0
- package/src/resources/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
- package/src/resources/skills/react-best-practices/rules/js-early-exit.md +50 -0
- package/src/resources/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/src/resources/skills/react-best-practices/rules/js-index-maps.md +37 -0
- package/src/resources/skills/react-best-practices/rules/js-length-check-first.md +49 -0
- package/src/resources/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
- package/src/resources/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/src/resources/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/src/resources/skills/react-best-practices/rules/rendering-activity.md +26 -0
- package/src/resources/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/src/resources/skills/react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/src/resources/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/src/resources/skills/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/src/resources/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/src/resources/skills/react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/src/resources/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/src/resources/skills/react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/src/resources/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/src/resources/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
- package/src/resources/skills/react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/src/resources/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
- package/src/resources/skills/react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/src/resources/skills/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/src/resources/skills/react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/src/resources/skills/react-best-practices/rules/rerender-memo.md +44 -0
- package/src/resources/skills/react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/src/resources/skills/react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/src/resources/skills/react-best-practices/rules/rerender-transitions.md +40 -0
- package/src/resources/skills/react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/src/resources/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/src/resources/skills/react-best-practices/rules/server-auth-actions.md +96 -0
- package/src/resources/skills/react-best-practices/rules/server-cache-lru.md +41 -0
- package/src/resources/skills/react-best-practices/rules/server-cache-react.md +76 -0
- package/src/resources/skills/react-best-practices/rules/server-dedup-props.md +65 -0
- package/src/resources/skills/react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/src/resources/skills/react-best-practices/rules/server-serialization.md +38 -0
- package/src/resources/skills/userinterface-wiki/SKILL.md +253 -0
- package/src/resources/skills/userinterface-wiki/rules/_sections.md +66 -0
- package/src/resources/skills/userinterface-wiki/rules/_template.md +24 -0
- package/src/resources/skills/userinterface-wiki/rules/a11y-reduced-motion-check.md +30 -0
- package/src/resources/skills/userinterface-wiki/rules/a11y-toggle-setting.md +30 -0
- package/src/resources/skills/userinterface-wiki/rules/a11y-visual-equivalent.md +36 -0
- package/src/resources/skills/userinterface-wiki/rules/a11y-volume-control.md +28 -0
- package/src/resources/skills/userinterface-wiki/rules/appropriate-confirmations-only.md +19 -0
- package/src/resources/skills/userinterface-wiki/rules/appropriate-errors-warnings.md +18 -0
- package/src/resources/skills/userinterface-wiki/rules/appropriate-no-decorative.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/appropriate-no-high-frequency.md +28 -0
- package/src/resources/skills/userinterface-wiki/rules/appropriate-no-punishing.md +27 -0
- package/src/resources/skills/userinterface-wiki/rules/container-callback-ref.md +31 -0
- package/src/resources/skills/userinterface-wiki/rules/container-guard-initial-zero.md +25 -0
- package/src/resources/skills/userinterface-wiki/rules/container-no-excessive-use.md +13 -0
- package/src/resources/skills/userinterface-wiki/rules/container-overflow-hidden.md +25 -0
- package/src/resources/skills/userinterface-wiki/rules/container-transition-delay.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/container-two-div-pattern.md +35 -0
- package/src/resources/skills/userinterface-wiki/rules/container-use-resize-observer.md +48 -0
- package/src/resources/skills/userinterface-wiki/rules/context-cleanup-nodes.md +25 -0
- package/src/resources/skills/userinterface-wiki/rules/context-resume-suspended.md +28 -0
- package/src/resources/skills/userinterface-wiki/rules/context-reuse-single.md +30 -0
- package/src/resources/skills/userinterface-wiki/rules/design-filter-for-character.md +25 -0
- package/src/resources/skills/userinterface-wiki/rules/design-noise-for-percussion.md +26 -0
- package/src/resources/skills/userinterface-wiki/rules/design-oscillator-for-tonal.md +22 -0
- package/src/resources/skills/userinterface-wiki/rules/duration-max-300ms.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/duration-press-hover.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/duration-shorten-before-curve.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/duration-small-state.md +15 -0
- package/src/resources/skills/userinterface-wiki/rules/easing-entrance-ease-out.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/easing-exit-ease-in.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/easing-for-state-change.md +27 -0
- package/src/resources/skills/userinterface-wiki/rules/easing-linear-only-progress.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/easing-natural-decay.md +22 -0
- package/src/resources/skills/userinterface-wiki/rules/easing-no-linear-motion.md +22 -0
- package/src/resources/skills/userinterface-wiki/rules/easing-transition-ease-in-out.md +15 -0
- package/src/resources/skills/userinterface-wiki/rules/envelope-exponential-decay.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/envelope-no-zero-target.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/envelope-set-initial-value.md +22 -0
- package/src/resources/skills/userinterface-wiki/rules/exit-key-required.md +29 -0
- package/src/resources/skills/userinterface-wiki/rules/exit-matches-initial.md +29 -0
- package/src/resources/skills/userinterface-wiki/rules/exit-prop-required.md +33 -0
- package/src/resources/skills/userinterface-wiki/rules/exit-requires-wrapper.md +27 -0
- package/src/resources/skills/userinterface-wiki/rules/impl-default-subtle.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/impl-preload-audio.md +34 -0
- package/src/resources/skills/userinterface-wiki/rules/impl-reset-current-time.md +26 -0
- package/src/resources/skills/userinterface-wiki/rules/mode-pop-layout-for-lists.md +25 -0
- package/src/resources/skills/userinterface-wiki/rules/mode-sync-layout-conflict.md +29 -0
- package/src/resources/skills/userinterface-wiki/rules/mode-wait-doubles-duration.md +25 -0
- package/src/resources/skills/userinterface-wiki/rules/morphing-aria-hidden.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/morphing-consistent-viewbox.md +23 -0
- package/src/resources/skills/userinterface-wiki/rules/morphing-group-variants.md +33 -0
- package/src/resources/skills/userinterface-wiki/rules/morphing-jump-non-grouped.md +29 -0
- package/src/resources/skills/userinterface-wiki/rules/morphing-reduced-motion.md +28 -0
- package/src/resources/skills/userinterface-wiki/rules/morphing-spring-rotation.md +23 -0
- package/src/resources/skills/userinterface-wiki/rules/morphing-strokelinecap-round.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/morphing-three-lines.md +32 -0
- package/src/resources/skills/userinterface-wiki/rules/morphing-use-collapsed.md +33 -0
- package/src/resources/skills/userinterface-wiki/rules/native-backdrop-styling.md +27 -0
- package/src/resources/skills/userinterface-wiki/rules/native-placeholder-styling.md +27 -0
- package/src/resources/skills/userinterface-wiki/rules/native-selection-styling.md +18 -0
- package/src/resources/skills/userinterface-wiki/rules/nested-consistent-timing.md +25 -0
- package/src/resources/skills/userinterface-wiki/rules/nested-propagate-required.md +41 -0
- package/src/resources/skills/userinterface-wiki/rules/none-context-menu-entrance.md +25 -0
- package/src/resources/skills/userinterface-wiki/rules/none-high-frequency.md +29 -0
- package/src/resources/skills/userinterface-wiki/rules/none-keyboard-navigation.md +32 -0
- package/src/resources/skills/userinterface-wiki/rules/param-click-duration.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/param-filter-frequency-range.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/param-q-value-range.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/param-reasonable-gain.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/physics-active-state.md +23 -0
- package/src/resources/skills/userinterface-wiki/rules/physics-no-excessive-stagger.md +22 -0
- package/src/resources/skills/userinterface-wiki/rules/physics-spring-for-overshoot.md +23 -0
- package/src/resources/skills/userinterface-wiki/rules/physics-subtle-deformation.md +22 -0
- package/src/resources/skills/userinterface-wiki/rules/prefetch-hit-slop.md +27 -0
- package/src/resources/skills/userinterface-wiki/rules/prefetch-keyboard-tab.md +19 -0
- package/src/resources/skills/userinterface-wiki/rules/prefetch-not-everything.md +22 -0
- package/src/resources/skills/userinterface-wiki/rules/prefetch-touch-fallback.md +34 -0
- package/src/resources/skills/userinterface-wiki/rules/prefetch-trajectory-over-hover.md +32 -0
- package/src/resources/skills/userinterface-wiki/rules/prefetch-use-selectively.md +13 -0
- package/src/resources/skills/userinterface-wiki/rules/presence-disable-interactions.md +31 -0
- package/src/resources/skills/userinterface-wiki/rules/presence-hook-in-child.md +31 -0
- package/src/resources/skills/userinterface-wiki/rules/presence-safe-to-remove.md +37 -0
- package/src/resources/skills/userinterface-wiki/rules/pseudo-content-required.md +28 -0
- package/src/resources/skills/userinterface-wiki/rules/pseudo-first-line-styling.md +27 -0
- package/src/resources/skills/userinterface-wiki/rules/pseudo-hit-target-expansion.md +31 -0
- package/src/resources/skills/userinterface-wiki/rules/pseudo-marker-styling.md +28 -0
- package/src/resources/skills/userinterface-wiki/rules/pseudo-over-dom-node.md +32 -0
- package/src/resources/skills/userinterface-wiki/rules/pseudo-position-relative-parent.md +33 -0
- package/src/resources/skills/userinterface-wiki/rules/pseudo-z-index-layering.md +37 -0
- package/src/resources/skills/userinterface-wiki/rules/spring-for-gestures.md +27 -0
- package/src/resources/skills/userinterface-wiki/rules/spring-for-interruptible.md +27 -0
- package/src/resources/skills/userinterface-wiki/rules/spring-params-balanced.md +29 -0
- package/src/resources/skills/userinterface-wiki/rules/spring-preserves-velocity.md +28 -0
- package/src/resources/skills/userinterface-wiki/rules/staging-dim-background.md +22 -0
- package/src/resources/skills/userinterface-wiki/rules/staging-one-focal-point.md +24 -0
- package/src/resources/skills/userinterface-wiki/rules/staging-z-index-hierarchy.md +22 -0
- package/src/resources/skills/userinterface-wiki/rules/timing-consistent.md +24 -0
- package/src/resources/skills/userinterface-wiki/rules/timing-no-entrance-context-menu.md +22 -0
- package/src/resources/skills/userinterface-wiki/rules/timing-under-300ms.md +22 -0
- package/src/resources/skills/userinterface-wiki/rules/transition-name-cleanup.md +28 -0
- package/src/resources/skills/userinterface-wiki/rules/transition-name-required.md +27 -0
- package/src/resources/skills/userinterface-wiki/rules/transition-name-unique.md +24 -0
- package/src/resources/skills/userinterface-wiki/rules/transition-over-js-library.md +32 -0
- package/src/resources/skills/userinterface-wiki/rules/transition-style-pseudo-elements.md +24 -0
- package/src/resources/skills/userinterface-wiki/rules/type-antialiased-on-retina.md +18 -0
- package/src/resources/skills/userinterface-wiki/rules/type-disambiguation-stylistic-set.md +15 -0
- package/src/resources/skills/userinterface-wiki/rules/type-font-display-swap.md +28 -0
- package/src/resources/skills/userinterface-wiki/rules/type-justify-with-hyphens.md +24 -0
- package/src/resources/skills/userinterface-wiki/rules/type-letter-spacing-uppercase.md +28 -0
- package/src/resources/skills/userinterface-wiki/rules/type-no-font-synthesis.md +18 -0
- package/src/resources/skills/userinterface-wiki/rules/type-oldstyle-nums-for-prose.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/type-opentype-contextual-alternates.md +15 -0
- package/src/resources/skills/userinterface-wiki/rules/type-optical-sizing-auto.md +25 -0
- package/src/resources/skills/userinterface-wiki/rules/type-proper-fractions.md +15 -0
- package/src/resources/skills/userinterface-wiki/rules/type-slashed-zero.md +17 -0
- package/src/resources/skills/userinterface-wiki/rules/type-tabular-nums-for-data.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/type-text-wrap-balance-headings.md +21 -0
- package/src/resources/skills/userinterface-wiki/rules/type-text-wrap-pretty.md +16 -0
- package/src/resources/skills/userinterface-wiki/rules/type-underline-offset.md +25 -0
- package/src/resources/skills/userinterface-wiki/rules/type-variable-weight-continuous.md +23 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-aesthetic-usability.md +32 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-cognitive-load-reduce.md +49 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-common-region-boundaries.md +50 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-doherty-perceived-speed.md +29 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-doherty-under-400ms.md +30 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-fitts-hit-area.md +32 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-fitts-target-size.md +31 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-goal-gradient-progress.md +33 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-hicks-minimize-choices.md +45 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-jakobs-familiar-patterns.md +37 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-millers-chunking.md +23 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-pareto-prioritize-features.md +36 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-peak-end-finish-strong.md +35 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-postels-accept-messy-input.md +45 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-pragnanz-simplify.md +33 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-progressive-disclosure.md +41 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-proximity-grouping.md +38 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-serial-position.md +31 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-similarity-consistency.md +35 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-teslers-complexity.md +28 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-uniform-connectedness.md +43 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-von-restorff-emphasis.md +29 -0
- package/src/resources/skills/userinterface-wiki/rules/ux-zeigarnik-show-incomplete.md +36 -0
- package/src/resources/skills/userinterface-wiki/rules/visual-animate-shadow-pseudo.md +49 -0
- package/src/resources/skills/userinterface-wiki/rules/visual-border-alpha-colors.md +25 -0
- package/src/resources/skills/userinterface-wiki/rules/visual-button-shadow-anatomy.md +49 -0
- package/src/resources/skills/userinterface-wiki/rules/visual-concentric-radius.md +40 -0
- package/src/resources/skills/userinterface-wiki/rules/visual-consistent-spacing-scale.md +35 -0
- package/src/resources/skills/userinterface-wiki/rules/visual-layered-shadows.md +30 -0
- package/src/resources/skills/userinterface-wiki/rules/visual-no-pure-black-shadow.md +25 -0
- package/src/resources/skills/userinterface-wiki/rules/visual-shadow-direction.md +25 -0
- package/src/resources/skills/userinterface-wiki/rules/visual-shadow-matches-elevation.md +23 -0
- package/src/resources/skills/userinterface-wiki/rules/weight-duration-matches-action.md +29 -0
- package/src/resources/skills/userinterface-wiki/rules/weight-match-action.md +32 -0
- package/src/resources/skills/web-design-guidelines/SKILL.md +39 -0
- package/src/resources/skills/web-quality-audit/SKILL.md +170 -0
- package/src/resources/skills/web-quality-audit/scripts/analyze.sh +91 -0
- package/dist/resources/extensions/gsd/complexity.ts +0 -237
- package/dist/resources/extensions/gsd/github-client.ts +0 -235
- package/dist/resources/extensions/gsd/mcp-server.ts +0 -108
- package/dist/resources/extensions/gsd/tests/activity-log-prune.test.ts +0 -297
- package/dist/resources/extensions/gsd/tests/activity-log-save.test.ts +0 -127
- package/dist/resources/extensions/gsd/tests/agent-end-provider-error.test.ts +0 -110
- package/dist/resources/extensions/gsd/tests/auto-draft-pause.test.ts +0 -115
- package/dist/resources/extensions/gsd/tests/complexity-routing.test.ts +0 -294
- package/dist/resources/extensions/gsd/tests/marketplace-discovery.test.ts +0 -202
- package/dist/resources/extensions/gsd/tests/metrics-io.test.ts +0 -176
- package/dist/resources/extensions/gsd/tests/network-error-fallback.test.ts +0 -54
- package/dist/resources/extensions/gsd/tests/preferences-git.test.ts +0 -120
- package/dist/resources/extensions/gsd/tests/preferences-hooks.test.ts +0 -226
- package/dist/resources/extensions/gsd/tests/preferences-mode.test.ts +0 -110
- package/dist/resources/extensions/gsd/tests/preferences-models.test.ts +0 -207
- package/dist/resources/extensions/gsd/tests/preferences-schema-validation.test.ts +0 -183
- package/dist/resources/extensions/gsd/tests/preferences-wizard-fields.test.ts +0 -168
- package/dist/resources/extensions/shared/bundled-extension-paths.ts +0 -11
- package/src/resources/extensions/gsd/complexity.ts +0 -237
- package/src/resources/extensions/gsd/github-client.ts +0 -235
- package/src/resources/extensions/gsd/mcp-server.ts +0 -108
- package/src/resources/extensions/gsd/tests/activity-log-prune.test.ts +0 -297
- package/src/resources/extensions/gsd/tests/activity-log-save.test.ts +0 -127
- package/src/resources/extensions/gsd/tests/agent-end-provider-error.test.ts +0 -110
- package/src/resources/extensions/gsd/tests/auto-draft-pause.test.ts +0 -115
- package/src/resources/extensions/gsd/tests/complexity-routing.test.ts +0 -294
- package/src/resources/extensions/gsd/tests/marketplace-discovery.test.ts +0 -202
- package/src/resources/extensions/gsd/tests/metrics-io.test.ts +0 -176
- package/src/resources/extensions/gsd/tests/network-error-fallback.test.ts +0 -54
- package/src/resources/extensions/gsd/tests/preferences-git.test.ts +0 -120
- package/src/resources/extensions/gsd/tests/preferences-hooks.test.ts +0 -226
- package/src/resources/extensions/gsd/tests/preferences-mode.test.ts +0 -110
- package/src/resources/extensions/gsd/tests/preferences-models.test.ts +0 -207
- package/src/resources/extensions/gsd/tests/preferences-schema-validation.test.ts +0 -183
- package/src/resources/extensions/gsd/tests/preferences-wizard-fields.test.ts +0 -168
- package/src/resources/extensions/shared/bundled-extension-paths.ts +0 -11
|
@@ -0,0 +1,1357 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GSD HTML Report Generator
|
|
3
|
+
*
|
|
4
|
+
* Produces a single self-contained HTML file with:
|
|
5
|
+
* - Branding header (project name, path, GSD version, generated timestamp)
|
|
6
|
+
* - Project summary & overall progress
|
|
7
|
+
* - Progress tree (milestones → slices → tasks, with critical path)
|
|
8
|
+
* - Execution timeline (chronological unit history)
|
|
9
|
+
* - Slice dependency graph (SVG DAG per milestone)
|
|
10
|
+
* - Cost & token metrics (bar charts, phase/slice/model/tier breakdowns)
|
|
11
|
+
* - Health & configuration overview
|
|
12
|
+
* - Changelog (completed slice summaries + file modifications)
|
|
13
|
+
* - Knowledge base (rules, patterns, lessons)
|
|
14
|
+
* - Captures log
|
|
15
|
+
* - Artifacts & milestone planning / discussion state
|
|
16
|
+
*
|
|
17
|
+
* No external dependencies — all CSS and JS is inlined.
|
|
18
|
+
* Printable to PDF from any browser.
|
|
19
|
+
*
|
|
20
|
+
* Design: Linear-inspired — restrained palette, geometric status, no emoji.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import type {
|
|
24
|
+
VisualizerData,
|
|
25
|
+
VisualizerMilestone,
|
|
26
|
+
VisualizerSlice,
|
|
27
|
+
} from './visualizer-data.js';
|
|
28
|
+
import { formatDateShort, formatDuration } from '../shared/format-utils.js';
|
|
29
|
+
import { formatCost, formatTokenCount } from './metrics.js';
|
|
30
|
+
import type { UnitMetrics } from './metrics.js';
|
|
31
|
+
|
|
32
|
+
// ─── Public API ────────────────────────────────────────────────────────────────
|
|
33
|
+
|
|
34
|
+
export interface HtmlReportOptions {
|
|
35
|
+
projectName: string;
|
|
36
|
+
projectPath: string;
|
|
37
|
+
gsdVersion: string;
|
|
38
|
+
milestoneId?: string;
|
|
39
|
+
indexRelPath?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function generateHtmlReport(
|
|
43
|
+
data: VisualizerData,
|
|
44
|
+
opts: HtmlReportOptions,
|
|
45
|
+
): string {
|
|
46
|
+
const generated = new Date().toISOString();
|
|
47
|
+
|
|
48
|
+
const sections = [
|
|
49
|
+
buildSummarySection(data, opts, generated),
|
|
50
|
+
buildBlockersSection(data),
|
|
51
|
+
buildProgressSection(data),
|
|
52
|
+
buildTimelineSection(data),
|
|
53
|
+
buildDepGraphSection(data),
|
|
54
|
+
buildMetricsSection(data),
|
|
55
|
+
buildHealthSection(data),
|
|
56
|
+
buildChangelogSection(data),
|
|
57
|
+
buildKnowledgeSection(data),
|
|
58
|
+
buildCapturesSection(data),
|
|
59
|
+
buildStatsSection(data),
|
|
60
|
+
buildDiscussionSection(data),
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
const milestoneTag = opts.milestoneId
|
|
64
|
+
? ` <span class="sep">/</span> <span class="mono accent">${esc(opts.milestoneId)}</span>`
|
|
65
|
+
: '';
|
|
66
|
+
|
|
67
|
+
const backLink = opts.indexRelPath
|
|
68
|
+
? `<a class="back-link" href="${esc(opts.indexRelPath)}">All Reports</a>`
|
|
69
|
+
: '';
|
|
70
|
+
|
|
71
|
+
return `<!DOCTYPE html>
|
|
72
|
+
<html lang="en">
|
|
73
|
+
<head>
|
|
74
|
+
<meta charset="UTF-8">
|
|
75
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
76
|
+
<title>GSD Report — ${esc(opts.projectName)}${opts.milestoneId ? ` — ${esc(opts.milestoneId)}` : ''}</title>
|
|
77
|
+
<style>${CSS}</style>
|
|
78
|
+
</head>
|
|
79
|
+
<body>
|
|
80
|
+
<header>
|
|
81
|
+
<div class="header-inner">
|
|
82
|
+
<div class="branding">
|
|
83
|
+
<span class="logo">GSD</span>
|
|
84
|
+
<span class="version">v${esc(opts.gsdVersion)}</span>
|
|
85
|
+
</div>
|
|
86
|
+
<div class="header-meta">
|
|
87
|
+
<h1>${esc(opts.projectName)}${milestoneTag}</h1>
|
|
88
|
+
<span class="header-path">${esc(opts.projectPath)}</span>
|
|
89
|
+
</div>
|
|
90
|
+
<div class="header-right">
|
|
91
|
+
${backLink}
|
|
92
|
+
<div class="generated">${formatDateLong(generated)}</div>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</header>
|
|
96
|
+
<nav class="toc" aria-label="Report sections">
|
|
97
|
+
<ul>
|
|
98
|
+
<li><a href="#summary">Summary</a></li>
|
|
99
|
+
<li><a href="#blockers">Blockers</a></li>
|
|
100
|
+
<li><a href="#progress">Progress</a></li>
|
|
101
|
+
<li><a href="#timeline">Timeline</a></li>
|
|
102
|
+
<li><a href="#depgraph">Dependencies</a></li>
|
|
103
|
+
<li><a href="#metrics">Metrics</a></li>
|
|
104
|
+
<li><a href="#health">Health</a></li>
|
|
105
|
+
<li><a href="#changelog">Changelog</a></li>
|
|
106
|
+
<li><a href="#knowledge">Knowledge</a></li>
|
|
107
|
+
<li><a href="#captures">Captures</a></li>
|
|
108
|
+
<li><a href="#stats">Artifacts</a></li>
|
|
109
|
+
<li><a href="#discussion">Planning</a></li>
|
|
110
|
+
</ul>
|
|
111
|
+
</nav>
|
|
112
|
+
<main>
|
|
113
|
+
${sections.join('\n')}
|
|
114
|
+
</main>
|
|
115
|
+
<footer>
|
|
116
|
+
<div class="footer-inner">
|
|
117
|
+
<span>GSD v${esc(opts.gsdVersion)}</span>
|
|
118
|
+
<span class="sep">/</span>
|
|
119
|
+
<span>${esc(opts.projectName)}</span>
|
|
120
|
+
${opts.milestoneId ? `<span class="sep">/</span><span class="mono">${esc(opts.milestoneId)}</span>` : ''}
|
|
121
|
+
<span class="sep">/</span>
|
|
122
|
+
<span>${formatDateLong(generated)}</span>
|
|
123
|
+
</div>
|
|
124
|
+
</footer>
|
|
125
|
+
<script>${JS}</script>
|
|
126
|
+
</body>
|
|
127
|
+
</html>`;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// ─── Section: Summary ─────────────────────────────────────────────────────────
|
|
131
|
+
|
|
132
|
+
function buildSummarySection(
|
|
133
|
+
data: VisualizerData,
|
|
134
|
+
opts: HtmlReportOptions,
|
|
135
|
+
_generated: string,
|
|
136
|
+
): string {
|
|
137
|
+
const t = data.totals;
|
|
138
|
+
const totalSlices = data.milestones.reduce((s, m) => s + m.slices.length, 0);
|
|
139
|
+
const doneSlices = data.milestones.reduce((s, m) => s + m.slices.filter(sl => sl.done).length, 0);
|
|
140
|
+
const doneMilestones = data.milestones.filter(m => m.status === 'complete').length;
|
|
141
|
+
const activeMilestone = data.milestones.find(m => m.status === 'active');
|
|
142
|
+
const pct = totalSlices > 0 ? Math.round((doneSlices / totalSlices) * 100) : 0;
|
|
143
|
+
|
|
144
|
+
const act = data.agentActivity;
|
|
145
|
+
const kv = [
|
|
146
|
+
kvi('Milestones', `${doneMilestones}/${data.milestones.length}`),
|
|
147
|
+
kvi('Slices', `${doneSlices}/${totalSlices}`),
|
|
148
|
+
kvi('Phase', data.phase),
|
|
149
|
+
t ? kvi('Cost', formatCost(t.cost)) : '',
|
|
150
|
+
t ? kvi('Tokens', formatTokenCount(t.tokens.total)) : '',
|
|
151
|
+
t ? kvi('Duration', formatDuration(t.duration)) : '',
|
|
152
|
+
t ? kvi('Tool calls', String(t.toolCalls)) : '',
|
|
153
|
+
t ? kvi('Units', String(t.units)) : '',
|
|
154
|
+
data.remainingSliceCount > 0 ? kvi('Remaining', String(data.remainingSliceCount)) : '',
|
|
155
|
+
act ? kvi('Rate', `${act.completionRate.toFixed(1)}/hr`) : '',
|
|
156
|
+
t && doneSlices > 0 ? kvi('Cost/slice', formatCost(t.cost / doneSlices)) : '',
|
|
157
|
+
t && t.toolCalls > 0 ? kvi('Tokens/tool', formatTokenCount(t.tokens.total / t.toolCalls)) : '',
|
|
158
|
+
t && (t.tokens.input + t.tokens.cacheRead) > 0
|
|
159
|
+
? kvi('Cache hit', ((t.tokens.cacheRead / (t.tokens.input + t.tokens.cacheRead)) * 100).toFixed(1) + '%')
|
|
160
|
+
: '',
|
|
161
|
+
opts.milestoneId ? kvi('Scope', opts.milestoneId) : '',
|
|
162
|
+
].filter(Boolean).join('');
|
|
163
|
+
|
|
164
|
+
const activeInfo = activeMilestone ? (() => {
|
|
165
|
+
const active = activeMilestone.slices.find(s => s.active);
|
|
166
|
+
if (!active) return '';
|
|
167
|
+
return `<div class="active-info">
|
|
168
|
+
Executing <span class="mono">${esc(activeMilestone.id)}/${esc(active.id)}</span> — ${esc(active.title)}
|
|
169
|
+
</div>`;
|
|
170
|
+
})() : '';
|
|
171
|
+
|
|
172
|
+
const activityHtml = act?.active ? `
|
|
173
|
+
<div class="activity-line">
|
|
174
|
+
<span class="dot dot-active"></span>
|
|
175
|
+
<span class="mono">${esc(act.currentUnit?.type ?? '')}</span>
|
|
176
|
+
<span class="mono muted">${esc(act.currentUnit?.id ?? '')}</span>
|
|
177
|
+
<span class="muted">${formatDuration(act.elapsed)} elapsed</span>
|
|
178
|
+
</div>` : '';
|
|
179
|
+
|
|
180
|
+
const execSummary = buildExecutiveSummary(data, opts);
|
|
181
|
+
const etaLine = buildEtaLine(data);
|
|
182
|
+
|
|
183
|
+
return section('summary', 'Summary', `
|
|
184
|
+
${execSummary}
|
|
185
|
+
<div class="kv-grid">${kv}</div>
|
|
186
|
+
<div class="progress-wrap">
|
|
187
|
+
<div class="progress-track"><div class="progress-fill" style="width:${pct}%"></div></div>
|
|
188
|
+
<span class="progress-label">${pct}%</span>
|
|
189
|
+
</div>
|
|
190
|
+
${activeInfo}
|
|
191
|
+
${activityHtml}
|
|
192
|
+
${etaLine}
|
|
193
|
+
`);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function buildExecutiveSummary(data: VisualizerData, opts: HtmlReportOptions): string {
|
|
197
|
+
const totalSlices = data.milestones.reduce((s, m) => s + m.slices.length, 0);
|
|
198
|
+
const doneSlices = data.milestones.reduce((s, m) => s + m.slices.filter(sl => sl.done).length, 0);
|
|
199
|
+
const pct = totalSlices > 0 ? Math.round((doneSlices / totalSlices) * 100) : 0;
|
|
200
|
+
const spent = data.totals?.cost ?? 0;
|
|
201
|
+
const activeMilestone = data.milestones.find(m => m.status === 'active');
|
|
202
|
+
const activeSlice = activeMilestone?.slices.find(s => s.active);
|
|
203
|
+
const currentExec = activeMilestone && activeSlice
|
|
204
|
+
? ` Currently executing ${esc(activeMilestone.id)}/${esc(activeSlice.id)}.`
|
|
205
|
+
: '';
|
|
206
|
+
const budgetCtx = data.health.budgetCeiling
|
|
207
|
+
? ` Budget: ${formatCost(spent)} of ${formatCost(data.health.budgetCeiling)} ceiling (${((spent / data.health.budgetCeiling) * 100).toFixed(0)}% used).`
|
|
208
|
+
: '';
|
|
209
|
+
return `<p class="exec-summary">${esc(opts.projectName)} is ${pct}% complete across ${data.milestones.length} milestones. ${formatCost(spent)} spent.${currentExec}${budgetCtx}</p>`;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function buildEtaLine(data: VisualizerData): string {
|
|
213
|
+
const act = data.agentActivity;
|
|
214
|
+
if (!act || act.completionRate <= 0 || data.remainingSliceCount <= 0) return '';
|
|
215
|
+
const hoursRemaining = data.remainingSliceCount / act.completionRate;
|
|
216
|
+
const formatted = formatDuration(hoursRemaining * 3_600_000);
|
|
217
|
+
return `<div class="eta-line">ETA: ~${formatted} remaining (${data.remainingSliceCount} slices at ${act.completionRate.toFixed(1)}/hr)</div>`;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// ─── Section: Blockers ────────────────────────────────────────────────────────
|
|
221
|
+
|
|
222
|
+
function buildBlockersSection(data: VisualizerData): string {
|
|
223
|
+
const blockers = data.sliceVerifications.filter(v => v.blockerDiscovered === true);
|
|
224
|
+
const highRisk: { msId: string; slId: string }[] = [];
|
|
225
|
+
for (const ms of data.milestones) {
|
|
226
|
+
for (const sl of ms.slices) {
|
|
227
|
+
if (!sl.done && sl.risk?.toLowerCase() === 'high') {
|
|
228
|
+
highRisk.push({ msId: ms.id, slId: sl.id });
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if (blockers.length === 0 && highRisk.length === 0) {
|
|
234
|
+
return section('blockers', 'Blockers', '<p class="empty">No blockers or high-risk items found.</p>');
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const blockerCards = blockers.map(v => `
|
|
238
|
+
<div class="blocker-card">
|
|
239
|
+
<div class="blocker-id">${esc(v.milestoneId)}/${esc(v.sliceId)}</div>
|
|
240
|
+
<div class="blocker-text">${esc(v.verificationResult ?? 'Blocker discovered')}</div>
|
|
241
|
+
</div>`).join('');
|
|
242
|
+
|
|
243
|
+
const riskCards = highRisk
|
|
244
|
+
.filter(hr => !blockers.some(b => b.milestoneId === hr.msId && b.sliceId === hr.slId))
|
|
245
|
+
.map(hr => `
|
|
246
|
+
<div class="blocker-card">
|
|
247
|
+
<div class="blocker-id">${esc(hr.msId)}/${esc(hr.slId)}</div>
|
|
248
|
+
<div class="blocker-text">High risk — incomplete</div>
|
|
249
|
+
</div>`).join('');
|
|
250
|
+
|
|
251
|
+
return section('blockers', 'Blockers', `${blockerCards}${riskCards}`);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// ─── Section: Health ──────────────────────────────────────────────────────────
|
|
255
|
+
|
|
256
|
+
function buildHealthSection(data: VisualizerData): string {
|
|
257
|
+
const h = data.health;
|
|
258
|
+
const t = data.totals;
|
|
259
|
+
|
|
260
|
+
const rows: string[] = [];
|
|
261
|
+
rows.push(hRow('Token profile', h.tokenProfile));
|
|
262
|
+
if (h.budgetCeiling !== undefined) {
|
|
263
|
+
const spent = t?.cost ?? 0;
|
|
264
|
+
const pct = (spent / h.budgetCeiling) * 100;
|
|
265
|
+
const status = pct > 90 ? 'warn' : pct > 75 ? 'caution' : 'ok';
|
|
266
|
+
rows.push(hRow(
|
|
267
|
+
'Budget ceiling',
|
|
268
|
+
`${formatCost(h.budgetCeiling)} (${formatCost(spent)} spent, ${pct.toFixed(0)}% used)`,
|
|
269
|
+
status,
|
|
270
|
+
));
|
|
271
|
+
}
|
|
272
|
+
rows.push(hRow(
|
|
273
|
+
'Truncation rate',
|
|
274
|
+
`${h.truncationRate.toFixed(1)}% per unit (${t?.totalTruncationSections ?? 0} total)`,
|
|
275
|
+
h.truncationRate > 20 ? 'warn' : h.truncationRate > 10 ? 'caution' : 'ok',
|
|
276
|
+
));
|
|
277
|
+
rows.push(hRow(
|
|
278
|
+
'Continue-here rate',
|
|
279
|
+
`${h.continueHereRate.toFixed(1)}% per unit (${t?.continueHereFiredCount ?? 0} total)`,
|
|
280
|
+
h.continueHereRate > 15 ? 'warn' : h.continueHereRate > 8 ? 'caution' : 'ok',
|
|
281
|
+
));
|
|
282
|
+
if (h.tierSavingsLine) rows.push(hRow('Routing savings', h.tierSavingsLine));
|
|
283
|
+
rows.push(hRow('Tool calls', String(h.toolCalls)));
|
|
284
|
+
rows.push(hRow('Messages', `${h.assistantMessages} assistant / ${h.userMessages} user`));
|
|
285
|
+
|
|
286
|
+
const tierRows = h.tierBreakdown.length > 0 ? `
|
|
287
|
+
<h3>Tier breakdown</h3>
|
|
288
|
+
<table class="tbl">
|
|
289
|
+
<thead><tr><th>Tier</th><th>Units</th><th>Cost</th><th>Tokens</th></tr></thead>
|
|
290
|
+
<tbody>
|
|
291
|
+
${h.tierBreakdown.map(tb =>
|
|
292
|
+
`<tr><td class="mono">${esc(tb.tier)}</td>
|
|
293
|
+
<td>${tb.units}</td><td>${formatCost(tb.cost)}</td>
|
|
294
|
+
<td>${formatTokenCount(tb.tokens.total)}</td></tr>`
|
|
295
|
+
).join('')}
|
|
296
|
+
</tbody>
|
|
297
|
+
</table>` : '';
|
|
298
|
+
|
|
299
|
+
return section('health', 'Health', `
|
|
300
|
+
<table class="tbl tbl-kv"><tbody>${rows.join('')}</tbody></table>
|
|
301
|
+
${tierRows}
|
|
302
|
+
`);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// ─── Section: Progress ────────────────────────────────────────────────────────
|
|
306
|
+
|
|
307
|
+
function buildProgressSection(data: VisualizerData): string {
|
|
308
|
+
if (data.milestones.length === 0) {
|
|
309
|
+
return section('progress', 'Progress', '<p class="empty">No milestones found.</p>');
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
const critMS = new Set(data.criticalPath.milestonePath);
|
|
313
|
+
const critSL = new Set(data.criticalPath.slicePath);
|
|
314
|
+
|
|
315
|
+
const msHtml = data.milestones.map(ms => {
|
|
316
|
+
const doneCount = ms.slices.filter(s => s.done).length;
|
|
317
|
+
const onCrit = critMS.has(ms.id);
|
|
318
|
+
const sliceHtml = ms.slices.length > 0
|
|
319
|
+
? ms.slices.map(sl => buildSliceRow(sl, critSL, data)).join('')
|
|
320
|
+
: '<p class="empty indent">No slices in roadmap yet.</p>';
|
|
321
|
+
|
|
322
|
+
return `
|
|
323
|
+
<details class="ms-block" ${ms.status !== 'pending' && ms.status !== 'parked' ? 'open' : ''}>
|
|
324
|
+
<summary class="ms-summary ms-${ms.status}">
|
|
325
|
+
<span class="dot dot-${ms.status}"></span>
|
|
326
|
+
<span class="mono ms-id">${esc(ms.id)}</span>
|
|
327
|
+
<span class="ms-title">${esc(ms.title)}</span>
|
|
328
|
+
<span class="muted">${doneCount}/${ms.slices.length}</span>
|
|
329
|
+
${onCrit ? '<span class="label">critical path</span>' : ''}
|
|
330
|
+
${ms.dependsOn.length > 0 ? `<span class="muted">needs ${ms.dependsOn.map(esc).join(', ')}</span>` : ''}
|
|
331
|
+
</summary>
|
|
332
|
+
<div class="ms-body">${sliceHtml}</div>
|
|
333
|
+
</details>`;
|
|
334
|
+
}).join('');
|
|
335
|
+
|
|
336
|
+
return section('progress', 'Progress', msHtml);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
function buildSliceRow(sl: VisualizerSlice, critSL: Set<string>, data: VisualizerData): string {
|
|
340
|
+
const onCrit = critSL.has(sl.id);
|
|
341
|
+
const ver = data.sliceVerifications.find(v => v.sliceId === sl.id);
|
|
342
|
+
const slack = data.criticalPath.sliceSlack.get(sl.id);
|
|
343
|
+
const status = sl.done ? 'complete' : sl.active ? 'active' : 'pending';
|
|
344
|
+
|
|
345
|
+
const taskHtml = sl.tasks.length > 0 ? `
|
|
346
|
+
<ul class="task-list">
|
|
347
|
+
${sl.tasks.map(t => `
|
|
348
|
+
<li class="task-row">
|
|
349
|
+
<span class="dot dot-${t.done ? 'complete' : t.active ? 'active' : 'pending'} dot-sm"></span>
|
|
350
|
+
<span class="mono muted">${esc(t.id)}</span>
|
|
351
|
+
<span class="${t.done ? 'muted' : ''}">${esc(t.title)}</span>
|
|
352
|
+
${t.estimate ? `<span class="muted">${esc(t.estimate)}</span>` : ''}
|
|
353
|
+
</li>`).join('')}
|
|
354
|
+
</ul>` : '';
|
|
355
|
+
|
|
356
|
+
const tags = [
|
|
357
|
+
...(ver?.provides ?? []).map(p => `<span class="tag">provides: ${esc(p)}</span>`),
|
|
358
|
+
...(ver?.requires ?? []).map(r => `<span class="tag">requires: ${esc(r.provides)}</span>`),
|
|
359
|
+
].join('');
|
|
360
|
+
|
|
361
|
+
const keyDecisions = ver?.keyDecisions?.length
|
|
362
|
+
? `<div class="detail-block"><span class="detail-label">Decisions</span><ul>${ver.keyDecisions.map(d => `<li>${esc(d)}</li>`).join('')}</ul></div>`
|
|
363
|
+
: '';
|
|
364
|
+
|
|
365
|
+
const patterns = ver?.patternsEstablished?.length
|
|
366
|
+
? `<div class="detail-block"><span class="detail-label">Patterns</span><ul>${ver.patternsEstablished.map(p => `<li>${esc(p)}</li>`).join('')}</ul></div>`
|
|
367
|
+
: '';
|
|
368
|
+
|
|
369
|
+
const verifBadge = ver?.verificationResult
|
|
370
|
+
? `<div class="verif ${ver.blockerDiscovered ? 'verif-blocker' : ''}">
|
|
371
|
+
${ver.blockerDiscovered ? 'Blocker: ' : ''}${esc(ver.verificationResult)}
|
|
372
|
+
</div>`
|
|
373
|
+
: '';
|
|
374
|
+
|
|
375
|
+
return `
|
|
376
|
+
<details class="sl-block">
|
|
377
|
+
<summary class="sl-summary ${onCrit ? 'sl-crit' : ''}">
|
|
378
|
+
<span class="dot dot-${status} dot-sm"></span>
|
|
379
|
+
<span class="mono muted">${esc(sl.id)}</span>
|
|
380
|
+
<span class="${status === 'active' ? 'accent' : sl.done ? 'muted' : ''}">${esc(sl.title)}</span>
|
|
381
|
+
<span class="risk risk-${(sl.risk || 'unknown').toLowerCase()}">${esc(sl.risk || '?')}</span>
|
|
382
|
+
${sl.depends.length > 0 ? `<span class="muted sl-deps">${sl.depends.map(esc).join(', ')}</span>` : ''}
|
|
383
|
+
${onCrit ? '<span class="label">critical</span>' : ''}
|
|
384
|
+
${slack !== undefined && slack > 0 ? `<span class="muted">+${slack} slack</span>` : ''}
|
|
385
|
+
</summary>
|
|
386
|
+
<div class="sl-detail">
|
|
387
|
+
${tags ? `<div class="tag-row">${tags}</div>` : ''}
|
|
388
|
+
${verifBadge}
|
|
389
|
+
${keyDecisions}
|
|
390
|
+
${patterns}
|
|
391
|
+
${taskHtml}
|
|
392
|
+
</div>
|
|
393
|
+
</details>`;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// ─── Section: Dependency Graph ────────────────────────────────────────────────
|
|
397
|
+
|
|
398
|
+
function buildDepGraphSection(data: VisualizerData): string {
|
|
399
|
+
const hasSlices = data.milestones.some(ms => ms.slices.length > 0);
|
|
400
|
+
if (!hasSlices) return section('depgraph', 'Dependencies', '<p class="empty">No slices to graph.</p>');
|
|
401
|
+
|
|
402
|
+
const hasDeps = data.milestones.some(ms => ms.slices.some(s => s.depends.length > 0));
|
|
403
|
+
if (!hasDeps) return section('depgraph', 'Dependencies', '<p class="empty">No dependencies defined.</p>');
|
|
404
|
+
|
|
405
|
+
const svgs = data.milestones
|
|
406
|
+
.filter(ms => ms.slices.length > 0)
|
|
407
|
+
.map(ms => buildMilestoneDepSVG(ms, data))
|
|
408
|
+
.filter(Boolean)
|
|
409
|
+
.join('');
|
|
410
|
+
|
|
411
|
+
return section('depgraph', 'Dependencies', svgs);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
function buildMilestoneDepSVG(ms: VisualizerMilestone, data: VisualizerData): string {
|
|
415
|
+
const slices = ms.slices;
|
|
416
|
+
if (slices.length === 0) return '';
|
|
417
|
+
|
|
418
|
+
const critSL = new Set(data.criticalPath.slicePath);
|
|
419
|
+
const slMap = new Map(slices.map(s => [s.id, s]));
|
|
420
|
+
|
|
421
|
+
const layerMap = new Map<string, number>();
|
|
422
|
+
const inDeg = new Map<string, number>();
|
|
423
|
+
for (const s of slices) inDeg.set(s.id, 0);
|
|
424
|
+
for (const s of slices) {
|
|
425
|
+
for (const dep of s.depends) {
|
|
426
|
+
if (slMap.has(dep)) inDeg.set(s.id, (inDeg.get(s.id) ?? 0) + 1);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
const visited = new Set<string>();
|
|
431
|
+
const q: string[] = [];
|
|
432
|
+
for (const [id, d] of inDeg) {
|
|
433
|
+
if (d === 0) { q.push(id); visited.add(id); layerMap.set(id, 0); }
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
while (q.length > 0) {
|
|
437
|
+
const node = q.shift()!;
|
|
438
|
+
for (const s of slices) {
|
|
439
|
+
if (!s.depends.includes(node)) continue;
|
|
440
|
+
const newDeg = (inDeg.get(s.id) ?? 1) - 1;
|
|
441
|
+
inDeg.set(s.id, newDeg);
|
|
442
|
+
layerMap.set(s.id, Math.max(layerMap.get(s.id) ?? 0, (layerMap.get(node) ?? 0) + 1));
|
|
443
|
+
if (newDeg === 0 && !visited.has(s.id)) { visited.add(s.id); q.push(s.id); }
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
for (const s of slices) if (!layerMap.has(s.id)) layerMap.set(s.id, 0);
|
|
447
|
+
|
|
448
|
+
const maxLayer = Math.max(...[...layerMap.values()]);
|
|
449
|
+
const byLayer = new Map<number, string[]>();
|
|
450
|
+
for (const [id, layer] of layerMap) {
|
|
451
|
+
const arr = byLayer.get(layer) ?? [];
|
|
452
|
+
arr.push(id);
|
|
453
|
+
byLayer.set(layer, arr);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
const NW = 130, NH = 40, CGAP = 56, RGAP = 14, PAD = 20;
|
|
457
|
+
let maxRows = 0;
|
|
458
|
+
for (let c = 0; c <= maxLayer; c++) maxRows = Math.max(maxRows, (byLayer.get(c) ?? []).length);
|
|
459
|
+
const totalH = PAD * 2 + maxRows * NH + Math.max(0, maxRows - 1) * RGAP;
|
|
460
|
+
const totalW = PAD * 2 + (maxLayer + 1) * NW + maxLayer * CGAP;
|
|
461
|
+
|
|
462
|
+
const pos = new Map<string, { x: number; y: number }>();
|
|
463
|
+
for (let col = 0; col <= maxLayer; col++) {
|
|
464
|
+
const ids = byLayer.get(col) ?? [];
|
|
465
|
+
const colH = ids.length * NH + Math.max(0, ids.length - 1) * RGAP;
|
|
466
|
+
const startY = (totalH - colH) / 2;
|
|
467
|
+
ids.forEach((id, i) => pos.set(id, { x: PAD + col * (NW + CGAP), y: startY + i * (NH + RGAP) }));
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
const edges = slices.flatMap(sl => sl.depends.flatMap(dep => {
|
|
471
|
+
if (!pos.has(dep) || !pos.has(sl.id)) return [];
|
|
472
|
+
const f = pos.get(dep)!, t = pos.get(sl.id)!;
|
|
473
|
+
const x1 = f.x + NW, y1 = f.y + NH / 2;
|
|
474
|
+
const x2 = t.x, y2 = t.y + NH / 2;
|
|
475
|
+
const mx = (x1 + x2) / 2;
|
|
476
|
+
const crit = critSL.has(sl.id) && critSL.has(dep);
|
|
477
|
+
return [`<path d="M${x1},${y1} C${mx},${y1} ${mx},${y2} ${x2},${y2}" class="edge${crit ? ' edge-crit' : ''}" marker-end="url(#arr${crit ? '-crit' : ''})"/>`];
|
|
478
|
+
}));
|
|
479
|
+
|
|
480
|
+
const nodes = slices.map(sl => {
|
|
481
|
+
const p = pos.get(sl.id);
|
|
482
|
+
if (!p) return '';
|
|
483
|
+
const crit = critSL.has(sl.id);
|
|
484
|
+
const sc = sl.done ? 'n-done' : sl.active ? 'n-active' : 'n-pending';
|
|
485
|
+
return `<g class="node ${sc}${crit ? ' n-crit' : ''}" transform="translate(${p.x},${p.y})">
|
|
486
|
+
<rect width="${NW}" height="${NH}" rx="4"/>
|
|
487
|
+
<text x="${NW/2}" y="16" class="n-id">${esc(truncStr(sl.id, 18))}</text>
|
|
488
|
+
<text x="${NW/2}" y="30" class="n-title">${esc(truncStr(sl.title, 18))}</text>
|
|
489
|
+
<title>${esc(sl.id)}: ${esc(sl.title)}</title>
|
|
490
|
+
</g>`;
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
const legend = `<div class="dep-legend">
|
|
494
|
+
<span><span class="dot dot-complete dot-sm"></span> done</span>
|
|
495
|
+
<span><span class="dot dot-active dot-sm"></span> active</span>
|
|
496
|
+
<span><span class="dot dot-pending dot-sm"></span> pending</span>
|
|
497
|
+
<span><span class="dot dot-parked dot-sm"></span> parked</span>
|
|
498
|
+
</div>`;
|
|
499
|
+
|
|
500
|
+
return `
|
|
501
|
+
<div class="dep-block">
|
|
502
|
+
<h3>${esc(ms.id)}: ${esc(ms.title)}</h3>
|
|
503
|
+
${legend}
|
|
504
|
+
<div class="dep-wrap">
|
|
505
|
+
<svg class="dep-svg" viewBox="0 0 ${totalW} ${totalH}" width="${totalW}" height="${totalH}">
|
|
506
|
+
<defs>
|
|
507
|
+
<marker id="arr" markerWidth="8" markerHeight="8" refX="7" refY="3" orient="auto">
|
|
508
|
+
<path d="M0,0 L0,6 L8,3 z" fill="var(--border-2)"/>
|
|
509
|
+
</marker>
|
|
510
|
+
<marker id="arr-crit" markerWidth="8" markerHeight="8" refX="7" refY="3" orient="auto">
|
|
511
|
+
<path d="M0,0 L0,6 L8,3 z" fill="var(--accent)"/>
|
|
512
|
+
</marker>
|
|
513
|
+
</defs>
|
|
514
|
+
${edges.join('')}
|
|
515
|
+
${nodes.join('')}
|
|
516
|
+
</svg>
|
|
517
|
+
</div>
|
|
518
|
+
</div>`;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
// ─── Section: Metrics ─────────────────────────────────────────────────────────
|
|
522
|
+
|
|
523
|
+
function buildMetricsSection(data: VisualizerData): string {
|
|
524
|
+
if (!data.totals) return section('metrics', 'Metrics', '<p class="empty">No metrics data yet.</p>');
|
|
525
|
+
const t = data.totals;
|
|
526
|
+
|
|
527
|
+
const grid = [
|
|
528
|
+
kvi('Total cost', formatCost(t.cost)),
|
|
529
|
+
kvi('Total tokens', formatTokenCount(t.tokens.total)),
|
|
530
|
+
kvi('Input', formatTokenCount(t.tokens.input)),
|
|
531
|
+
kvi('Output', formatTokenCount(t.tokens.output)),
|
|
532
|
+
kvi('Cache read', formatTokenCount(t.tokens.cacheRead)),
|
|
533
|
+
kvi('Cache write', formatTokenCount(t.tokens.cacheWrite)),
|
|
534
|
+
kvi('Duration', formatDuration(t.duration)),
|
|
535
|
+
kvi('Units', String(t.units)),
|
|
536
|
+
kvi('Tool calls', String(t.toolCalls)),
|
|
537
|
+
kvi('Truncations', String(t.totalTruncationSections)),
|
|
538
|
+
].join('');
|
|
539
|
+
|
|
540
|
+
const tokenBreakdown = buildTokenBreakdown(t.tokens);
|
|
541
|
+
|
|
542
|
+
const phaseRow = data.byPhase.length > 0 ? `
|
|
543
|
+
<div class="chart-row">
|
|
544
|
+
${buildBarChart('Cost by phase', data.byPhase.map(p => ({
|
|
545
|
+
label: p.phase, value: p.cost, display: formatCost(p.cost), sub: `${p.units} units`,
|
|
546
|
+
})))}
|
|
547
|
+
${buildBarChart('Tokens by phase', data.byPhase.map(p => ({
|
|
548
|
+
label: p.phase, value: p.tokens.total, display: formatTokenCount(p.tokens.total), sub: formatCost(p.cost),
|
|
549
|
+
})))}
|
|
550
|
+
</div>` : '';
|
|
551
|
+
|
|
552
|
+
const sliceModelRow = (data.bySlice.length > 0 || data.byModel.length > 0) ? `
|
|
553
|
+
<div class="chart-row">
|
|
554
|
+
${data.bySlice.length > 0 ? buildBarChart('Cost by slice', data.bySlice.map(s => ({
|
|
555
|
+
label: s.sliceId, value: s.cost, display: formatCost(s.cost),
|
|
556
|
+
sub: `${s.units} units`,
|
|
557
|
+
}))) : ''}
|
|
558
|
+
${data.byModel.length > 0 ? buildBarChart('Cost by model', data.byModel.map(m => ({
|
|
559
|
+
label: shortModel(m.model), value: m.cost, display: formatCost(m.cost),
|
|
560
|
+
sub: `${m.units} units`,
|
|
561
|
+
}))) : ''}
|
|
562
|
+
${data.bySlice.length > 0 ? buildBarChart('Duration by slice', data.bySlice.map(s => ({
|
|
563
|
+
label: s.sliceId, value: s.duration, display: formatDuration(s.duration),
|
|
564
|
+
sub: formatCost(s.cost),
|
|
565
|
+
}))) : ''}
|
|
566
|
+
</div>` : '';
|
|
567
|
+
|
|
568
|
+
const costOverTime = buildCostOverTimeChart(data.units);
|
|
569
|
+
const budgetBurndown = buildBudgetBurndown(data);
|
|
570
|
+
const gantt = buildSliceGantt(data);
|
|
571
|
+
|
|
572
|
+
return section('metrics', 'Metrics', `
|
|
573
|
+
<div class="kv-grid">${grid}</div>
|
|
574
|
+
${budgetBurndown}
|
|
575
|
+
${tokenBreakdown}
|
|
576
|
+
${costOverTime}
|
|
577
|
+
${phaseRow}
|
|
578
|
+
${sliceModelRow}
|
|
579
|
+
${gantt}
|
|
580
|
+
`);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
function buildCostOverTimeChart(units: UnitMetrics[]): string {
|
|
584
|
+
if (units.length < 2) return '';
|
|
585
|
+
const sorted = [...units].sort((a, b) => a.startedAt - b.startedAt);
|
|
586
|
+
const cumulative: number[] = [];
|
|
587
|
+
let running = 0;
|
|
588
|
+
for (const u of sorted) {
|
|
589
|
+
running += u.cost;
|
|
590
|
+
cumulative.push(running);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
const padL = 50, padR = 30, padT = 20, padB = 30;
|
|
594
|
+
const w = 600, h = 200;
|
|
595
|
+
const plotW = w - padL - padR;
|
|
596
|
+
const plotH = h - padT - padB;
|
|
597
|
+
const maxCost = cumulative[cumulative.length - 1] || 1;
|
|
598
|
+
const n = cumulative.length;
|
|
599
|
+
|
|
600
|
+
const points = cumulative.map((c, i) => {
|
|
601
|
+
const x = padL + (i / (n - 1)) * plotW;
|
|
602
|
+
const y = padT + plotH - (c / maxCost) * plotH;
|
|
603
|
+
return { x, y };
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
const linePath = points.map((p, i) => `${i === 0 ? 'M' : 'L'}${p.x.toFixed(1)},${p.y.toFixed(1)}`).join(' ');
|
|
607
|
+
const areaPath = `${linePath} L${points[points.length - 1].x.toFixed(1)},${(padT + plotH).toFixed(1)} L${points[0].x.toFixed(1)},${(padT + plotH).toFixed(1)} Z`;
|
|
608
|
+
|
|
609
|
+
const gridLines: string[] = [];
|
|
610
|
+
for (let i = 0; i <= 4; i++) {
|
|
611
|
+
const y = padT + (plotH / 4) * i;
|
|
612
|
+
const val = formatCost(maxCost * (1 - i / 4));
|
|
613
|
+
gridLines.push(`<line x1="${padL}" y1="${y}" x2="${w - padR}" y2="${y}" class="cost-grid"/>`);
|
|
614
|
+
gridLines.push(`<text x="${padL - 4}" y="${y + 3}" class="cost-axis" text-anchor="end">${val}</text>`);
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
return `
|
|
618
|
+
<div class="token-block">
|
|
619
|
+
<h3>Cost over time</h3>
|
|
620
|
+
<svg class="cost-svg" viewBox="0 0 ${w} ${h}" width="${w}" height="${h}">
|
|
621
|
+
${gridLines.join('')}
|
|
622
|
+
<path d="${areaPath}" class="cost-area"/>
|
|
623
|
+
<path d="${linePath}" class="cost-line"/>
|
|
624
|
+
<text x="${padL}" y="${h - 4}" class="cost-axis">#1</text>
|
|
625
|
+
<text x="${w - padR}" y="${h - 4}" class="cost-axis" text-anchor="end">#${n}</text>
|
|
626
|
+
</svg>
|
|
627
|
+
</div>`;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
function buildBudgetBurndown(data: VisualizerData): string {
|
|
631
|
+
if (!data.health.budgetCeiling) return '';
|
|
632
|
+
const ceiling = data.health.budgetCeiling;
|
|
633
|
+
const spent = data.totals?.cost ?? 0;
|
|
634
|
+
const totalSlices = data.milestones.reduce((s, m) => s + m.slices.length, 0);
|
|
635
|
+
const doneSlices = data.milestones.reduce((s, m) => s + m.slices.filter(sl => sl.done).length, 0);
|
|
636
|
+
const avgCostPerSlice = doneSlices > 0 ? spent / doneSlices : 0;
|
|
637
|
+
const projected = avgCostPerSlice > 0 ? avgCostPerSlice * data.remainingSliceCount + spent : spent;
|
|
638
|
+
const maxVal = Math.max(ceiling, projected, spent);
|
|
639
|
+
|
|
640
|
+
const spentPct = (spent / maxVal) * 100;
|
|
641
|
+
const projectedRemPct = Math.max(0, ((projected - spent) / maxVal) * 100);
|
|
642
|
+
const overshoot = projected > ceiling ? ((projected - ceiling) / maxVal) * 100 : 0;
|
|
643
|
+
const projectedClean = projectedRemPct - overshoot;
|
|
644
|
+
|
|
645
|
+
const legend = [
|
|
646
|
+
`<span><span class="burndown-dot" style="background:var(--accent)"></span> Spent: ${formatCost(spent)}</span>`,
|
|
647
|
+
`<span><span class="burndown-dot" style="background:var(--caution)"></span> Projected remaining: ${formatCost(Math.max(0, projected - spent))}</span>`,
|
|
648
|
+
`<span><span class="burndown-dot" style="background:var(--border-2)"></span> Ceiling: ${formatCost(ceiling)}</span>`,
|
|
649
|
+
overshoot > 0 ? `<span><span class="burndown-dot" style="background:var(--warn)"></span> Overshoot: ${formatCost(projected - ceiling)}</span>` : '',
|
|
650
|
+
].filter(Boolean).join('');
|
|
651
|
+
|
|
652
|
+
return `
|
|
653
|
+
<div class="burndown-wrap">
|
|
654
|
+
<h3>Budget burndown</h3>
|
|
655
|
+
<div class="burndown-bar">
|
|
656
|
+
<div class="burndown-spent" style="width:${spentPct.toFixed(1)}%"></div>
|
|
657
|
+
${projectedClean > 0 ? `<div class="burndown-projected" style="width:${projectedClean.toFixed(1)}%"></div>` : ''}
|
|
658
|
+
${overshoot > 0 ? `<div class="burndown-overshoot" style="width:${overshoot.toFixed(1)}%"></div>` : ''}
|
|
659
|
+
</div>
|
|
660
|
+
<div class="burndown-legend">${legend}</div>
|
|
661
|
+
</div>`;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
function buildSliceGantt(data: VisualizerData): string {
|
|
665
|
+
const sliceTimings = new Map<string, { min: number; max: number }>();
|
|
666
|
+
for (const u of data.units) {
|
|
667
|
+
const parts = u.id.split('/');
|
|
668
|
+
const sliceKey = parts.length >= 2 ? `${parts[0]}/${parts[1]}` : u.id;
|
|
669
|
+
if (u.startedAt <= 0) continue;
|
|
670
|
+
const existing = sliceTimings.get(sliceKey);
|
|
671
|
+
const end = u.finishedAt > 0 ? u.finishedAt : Date.now();
|
|
672
|
+
if (existing) {
|
|
673
|
+
existing.min = Math.min(existing.min, u.startedAt);
|
|
674
|
+
existing.max = Math.max(existing.max, end);
|
|
675
|
+
} else {
|
|
676
|
+
sliceTimings.set(sliceKey, { min: u.startedAt, max: end });
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
if (sliceTimings.size < 2) return '';
|
|
681
|
+
|
|
682
|
+
const sliceEntries = [...sliceTimings.entries()].sort((a, b) => a[1].min - b[1].min);
|
|
683
|
+
const globalMin = Math.min(...sliceEntries.map(e => e[1].min));
|
|
684
|
+
const globalMax = Math.max(...sliceEntries.map(e => e[1].max));
|
|
685
|
+
const range = globalMax - globalMin || 1;
|
|
686
|
+
|
|
687
|
+
const sliceCount = sliceEntries.length;
|
|
688
|
+
const barH = 18, rowH = 30, padL = 140, padR = 20, padT = 30, padB = 30;
|
|
689
|
+
const plotW = 700 - padL - padR;
|
|
690
|
+
const svgH = sliceCount * rowH + padT + padB;
|
|
691
|
+
|
|
692
|
+
// Build a lookup of slice status
|
|
693
|
+
const sliceStatusMap = new Map<string, string>();
|
|
694
|
+
for (const ms of data.milestones) {
|
|
695
|
+
for (const sl of ms.slices) {
|
|
696
|
+
const key = `${ms.id}/${sl.id}`;
|
|
697
|
+
sliceStatusMap.set(key, sl.done ? 'done' : sl.active ? 'active' : 'pending');
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
const bars = sliceEntries.map(([sliceId, timing], i) => {
|
|
702
|
+
const x = padL + ((timing.min - globalMin) / range) * plotW;
|
|
703
|
+
const w = Math.max(2, ((timing.max - timing.min) / range) * plotW);
|
|
704
|
+
const y = padT + i * rowH + (rowH - barH) / 2;
|
|
705
|
+
const status = sliceStatusMap.get(sliceId) ?? 'pending';
|
|
706
|
+
return `<text x="${padL - 6}" y="${y + barH / 2 + 4}" class="gantt-label" text-anchor="end">${esc(truncStr(sliceId, 18))}</text>
|
|
707
|
+
<rect x="${x.toFixed(1)}" y="${y.toFixed(1)}" width="${w.toFixed(1)}" height="${barH}" rx="2" class="gantt-bar-${status}"><title>${esc(sliceId)}: ${formatDuration(timing.max - timing.min)}</title></rect>`;
|
|
708
|
+
}).join('\n');
|
|
709
|
+
|
|
710
|
+
// Time axis labels
|
|
711
|
+
const axisLabels = [0, 0.25, 0.5, 0.75, 1].map(frac => {
|
|
712
|
+
const t = globalMin + frac * range;
|
|
713
|
+
const x = padL + frac * plotW;
|
|
714
|
+
return `<text x="${x.toFixed(1)}" y="${svgH - 8}" class="gantt-axis" text-anchor="middle">${formatDateShort(new Date(t).toISOString())}</text>`;
|
|
715
|
+
}).join('');
|
|
716
|
+
|
|
717
|
+
return `
|
|
718
|
+
<div class="gantt-wrap">
|
|
719
|
+
<h3>Slice timeline</h3>
|
|
720
|
+
<svg class="gantt-svg" viewBox="0 0 700 ${svgH}" width="700" height="${svgH}">
|
|
721
|
+
${bars}
|
|
722
|
+
${axisLabels}
|
|
723
|
+
</svg>
|
|
724
|
+
</div>`;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
function buildTokenBreakdown(tokens: { input: number; output: number; cacheRead: number; cacheWrite: number; total: number }): string {
|
|
728
|
+
if (tokens.total === 0) return '';
|
|
729
|
+
const segs = [
|
|
730
|
+
{ label: 'Input', value: tokens.input, cls: 'seg-1' },
|
|
731
|
+
{ label: 'Output', value: tokens.output, cls: 'seg-2' },
|
|
732
|
+
{ label: 'Cache read', value: tokens.cacheRead, cls: 'seg-3' },
|
|
733
|
+
{ label: 'Cache write', value: tokens.cacheWrite, cls: 'seg-4' },
|
|
734
|
+
].filter(s => s.value > 0);
|
|
735
|
+
|
|
736
|
+
const bars = segs.map(s => {
|
|
737
|
+
const pct = (s.value / tokens.total) * 100;
|
|
738
|
+
return `<div class="tseg ${s.cls}" style="width:${pct.toFixed(2)}%" title="${s.label}: ${formatTokenCount(s.value)} (${pct.toFixed(1)}%)"></div>`;
|
|
739
|
+
}).join('');
|
|
740
|
+
|
|
741
|
+
const legend = segs.map(s => {
|
|
742
|
+
const pct = ((s.value / tokens.total) * 100).toFixed(1);
|
|
743
|
+
return `<span class="leg-item"><span class="leg-dot ${s.cls}"></span>${s.label}: ${formatTokenCount(s.value)} (${pct}%)</span>`;
|
|
744
|
+
}).join('');
|
|
745
|
+
|
|
746
|
+
return `
|
|
747
|
+
<div class="token-block">
|
|
748
|
+
<h3>Token breakdown</h3>
|
|
749
|
+
<div class="token-bar">${bars}</div>
|
|
750
|
+
<div class="token-legend">${legend}</div>
|
|
751
|
+
</div>`;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
interface BarEntry { label: string; value: number; display: string; sub?: string; color?: number }
|
|
755
|
+
|
|
756
|
+
const CHART_COLORS = 6;
|
|
757
|
+
|
|
758
|
+
function buildBarChart(title: string, entries: BarEntry[]): string {
|
|
759
|
+
if (entries.length === 0) return '';
|
|
760
|
+
const max = Math.max(...entries.map(e => e.value), 1);
|
|
761
|
+
const rows = entries.map((e, i) => {
|
|
762
|
+
const pct = (e.value / max) * 100;
|
|
763
|
+
const ci = e.color ?? i;
|
|
764
|
+
return `
|
|
765
|
+
<div class="bar-row">
|
|
766
|
+
<div class="bar-lbl">${esc(truncStr(e.label, 22))}</div>
|
|
767
|
+
<div class="bar-track"><div class="bar-fill bar-c${ci % CHART_COLORS}" style="width:${pct.toFixed(1)}%"></div></div>
|
|
768
|
+
<div class="bar-val">${esc(e.display)}</div>
|
|
769
|
+
</div>
|
|
770
|
+
${e.sub ? `<div class="bar-sub">${esc(e.sub)}</div>` : ''}`;
|
|
771
|
+
}).join('');
|
|
772
|
+
return `<div class="chart-block"><h3>${esc(title)}</h3>${rows}</div>`;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
// ─── Section: Timeline ────────────────────────────────────────────────────────
|
|
776
|
+
|
|
777
|
+
function buildTimelineSection(data: VisualizerData): string {
|
|
778
|
+
if (data.units.length === 0) return section('timeline', 'Timeline', '<p class="empty">No units executed yet.</p>');
|
|
779
|
+
|
|
780
|
+
const sorted = [...data.units].sort((a, b) => a.startedAt - b.startedAt);
|
|
781
|
+
const maxCost = Math.max(...sorted.map(u => u.cost), 0.01);
|
|
782
|
+
|
|
783
|
+
const rows = sorted.map((u, i) => {
|
|
784
|
+
const dur = u.finishedAt > 0 ? formatDuration(u.finishedAt - u.startedAt) : 'running';
|
|
785
|
+
// Cost heatmap: subtle red background for expensive rows
|
|
786
|
+
const intensity = Math.min(u.cost / maxCost, 1);
|
|
787
|
+
const heatStyle = intensity > 0.15 ? ` style="background:rgba(239,68,68,${(intensity * 0.15).toFixed(3)})"` : '';
|
|
788
|
+
return `
|
|
789
|
+
<tr${heatStyle}>
|
|
790
|
+
<td class="muted">${i + 1}</td>
|
|
791
|
+
<td class="mono">${esc(u.type)}</td>
|
|
792
|
+
<td class="mono muted">${esc(u.id)}</td>
|
|
793
|
+
<td>${esc(shortModel(u.model))}</td>
|
|
794
|
+
<td class="muted">${formatDateShort(new Date(u.startedAt).toISOString())}</td>
|
|
795
|
+
<td>${dur}</td>
|
|
796
|
+
<td class="num">${formatCost(u.cost)}</td>
|
|
797
|
+
<td class="num">${formatTokenCount(u.tokens.total)}</td>
|
|
798
|
+
<td class="num">${u.toolCalls}</td>
|
|
799
|
+
<td class="mono">${u.tier ?? ''}</td>
|
|
800
|
+
<td>${u.modelDowngraded ? 'routed' : ''}</td>
|
|
801
|
+
<td class="num">${(u.truncationSections ?? 0) > 0 ? u.truncationSections : ''}</td>
|
|
802
|
+
<td>${u.continueHereFired ? 'yes' : ''}</td>
|
|
803
|
+
</tr>`;
|
|
804
|
+
}).join('');
|
|
805
|
+
|
|
806
|
+
return section('timeline', 'Timeline', `
|
|
807
|
+
<div class="table-scroll">
|
|
808
|
+
<table class="tbl">
|
|
809
|
+
<thead><tr>
|
|
810
|
+
<th>#</th><th>Type</th><th>ID</th><th>Model</th>
|
|
811
|
+
<th>Started</th><th>Duration</th><th>Cost</th>
|
|
812
|
+
<th>Tokens</th><th>Tools</th><th>Tier</th><th>Routed</th><th>Trunc</th><th>CHF</th>
|
|
813
|
+
</tr></thead>
|
|
814
|
+
<tbody>${rows}</tbody>
|
|
815
|
+
</table>
|
|
816
|
+
</div>`);
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
// ─── Section: Changelog ───────────────────────────────────────────────────────
|
|
820
|
+
|
|
821
|
+
function buildChangelogSection(data: VisualizerData): string {
|
|
822
|
+
if (data.changelog.entries.length === 0) return section('changelog', 'Changelog', '<p class="empty">No completed slices yet.</p>');
|
|
823
|
+
|
|
824
|
+
const entries = data.changelog.entries.map(e => {
|
|
825
|
+
const filesHtml = e.filesModified.length > 0 ? `
|
|
826
|
+
<details class="files-detail">
|
|
827
|
+
<summary class="muted">${e.filesModified.length} file${e.filesModified.length !== 1 ? 's' : ''} modified</summary>
|
|
828
|
+
<ul class="file-list">
|
|
829
|
+
${e.filesModified.map(f => `<li><code>${esc(f.path)}</code>${f.description ? ` — ${esc(f.description)}` : ''}</li>`).join('')}
|
|
830
|
+
</ul>
|
|
831
|
+
</details>` : '';
|
|
832
|
+
|
|
833
|
+
const ver = data.sliceVerifications.find(v => v.sliceId === e.sliceId);
|
|
834
|
+
const decisionsHtml = ver?.keyDecisions?.length ? `
|
|
835
|
+
<div class="detail-block"><span class="detail-label">Decisions</span>
|
|
836
|
+
<ul>${ver.keyDecisions.map(d => `<li>${esc(d)}</li>`).join('')}</ul>
|
|
837
|
+
</div>` : '';
|
|
838
|
+
|
|
839
|
+
return `
|
|
840
|
+
<div class="cl-entry">
|
|
841
|
+
<div class="cl-header">
|
|
842
|
+
<span class="mono muted">${esc(e.milestoneId)}/${esc(e.sliceId)}</span>
|
|
843
|
+
<span class="cl-title">${esc(e.title)}</span>
|
|
844
|
+
${e.completedAt ? `<span class="muted cl-date">${formatDateShort(e.completedAt)}</span>` : ''}
|
|
845
|
+
</div>
|
|
846
|
+
${e.oneLiner ? `<p class="cl-liner">${esc(e.oneLiner)}</p>` : ''}
|
|
847
|
+
${decisionsHtml}
|
|
848
|
+
${filesHtml}
|
|
849
|
+
</div>`;
|
|
850
|
+
}).join('');
|
|
851
|
+
|
|
852
|
+
return section('changelog', `Changelog <span class="count">${data.changelog.entries.length}</span>`, entries);
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
// ─── Section: Knowledge ───────────────────────────────────────────────────────
|
|
856
|
+
|
|
857
|
+
function buildKnowledgeSection(data: VisualizerData): string {
|
|
858
|
+
const k = data.knowledge;
|
|
859
|
+
if (!k.exists) return section('knowledge', 'Knowledge', '<p class="empty">No KNOWLEDGE.md found.</p>');
|
|
860
|
+
const total = k.rules.length + k.patterns.length + k.lessons.length;
|
|
861
|
+
if (total === 0) return section('knowledge', 'Knowledge', '<p class="empty">KNOWLEDGE.md exists but no entries parsed.</p>');
|
|
862
|
+
|
|
863
|
+
const rulesHtml = k.rules.length > 0 ? `
|
|
864
|
+
<h3>Rules <span class="count">${k.rules.length}</span></h3>
|
|
865
|
+
<table class="tbl">
|
|
866
|
+
<thead><tr><th>ID</th><th>Scope</th><th>Rule</th></tr></thead>
|
|
867
|
+
<tbody>${k.rules.map(r => `<tr><td class="mono">${esc(r.id)}</td><td>${esc(r.scope)}</td><td>${esc(r.content)}</td></tr>`).join('')}</tbody>
|
|
868
|
+
</table>` : '';
|
|
869
|
+
|
|
870
|
+
const patternsHtml = k.patterns.length > 0 ? `
|
|
871
|
+
<h3>Patterns <span class="count">${k.patterns.length}</span></h3>
|
|
872
|
+
<table class="tbl">
|
|
873
|
+
<thead><tr><th>ID</th><th>Pattern</th></tr></thead>
|
|
874
|
+
<tbody>${k.patterns.map(p => `<tr><td class="mono">${esc(p.id)}</td><td>${esc(p.content)}</td></tr>`).join('')}</tbody>
|
|
875
|
+
</table>` : '';
|
|
876
|
+
|
|
877
|
+
const lessonsHtml = k.lessons.length > 0 ? `
|
|
878
|
+
<h3>Lessons <span class="count">${k.lessons.length}</span></h3>
|
|
879
|
+
<table class="tbl">
|
|
880
|
+
<thead><tr><th>ID</th><th>Lesson</th></tr></thead>
|
|
881
|
+
<tbody>${k.lessons.map(l => `<tr><td class="mono">${esc(l.id)}</td><td>${esc(l.content)}</td></tr>`).join('')}</tbody>
|
|
882
|
+
</table>` : '';
|
|
883
|
+
|
|
884
|
+
return section('knowledge', `Knowledge <span class="count">${total}</span>`, `${rulesHtml}${patternsHtml}${lessonsHtml}`);
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
// ─── Section: Captures ────────────────────────────────────────────────────────
|
|
888
|
+
|
|
889
|
+
function buildCapturesSection(data: VisualizerData): string {
|
|
890
|
+
const c = data.captures;
|
|
891
|
+
if (c.totalCount === 0) return section('captures', 'Captures', '<p class="empty">No captures recorded.</p>');
|
|
892
|
+
|
|
893
|
+
const badge = c.pendingCount > 0
|
|
894
|
+
? `<span class="count count-warn">${c.pendingCount} pending</span>`
|
|
895
|
+
: `<span class="count">all triaged</span>`;
|
|
896
|
+
|
|
897
|
+
const rows = c.entries.map(e => `
|
|
898
|
+
<tr>
|
|
899
|
+
<td class="muted">${formatDateShort(new Date(e.timestamp).toISOString())}</td>
|
|
900
|
+
<td class="mono">${esc(e.status)}</td>
|
|
901
|
+
<td class="mono">${e.classification ?? ''}</td>
|
|
902
|
+
<td>${e.resolution ?? ''}</td>
|
|
903
|
+
<td>${esc(e.text)}</td>
|
|
904
|
+
<td class="muted">${e.rationale ?? ''}</td>
|
|
905
|
+
<td class="muted">${e.resolvedAt ? formatDateShort(e.resolvedAt) : ''}</td>
|
|
906
|
+
<td>${e.executed !== undefined ? (e.executed ? 'yes' : 'no') : ''}</td>
|
|
907
|
+
</tr>`).join('');
|
|
908
|
+
|
|
909
|
+
return section('captures', `Captures ${badge}`, `
|
|
910
|
+
<div class="table-scroll">
|
|
911
|
+
<table class="tbl">
|
|
912
|
+
<thead><tr><th>Captured</th><th>Status</th><th>Class</th><th>Resolution</th><th>Text</th><th>Rationale</th><th>Resolved</th><th>Executed</th></tr></thead>
|
|
913
|
+
<tbody>${rows}</tbody>
|
|
914
|
+
</table>
|
|
915
|
+
</div>`);
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
// ─── Section: Stats ───────────────────────────────────────────────────────────
|
|
919
|
+
|
|
920
|
+
function buildStatsSection(data: VisualizerData): string {
|
|
921
|
+
const s = data.stats;
|
|
922
|
+
|
|
923
|
+
const missingHtml = s.missingCount > 0 ? `
|
|
924
|
+
<h3>Missing changelogs <span class="count">${s.missingCount}</span></h3>
|
|
925
|
+
<table class="tbl">
|
|
926
|
+
<thead><tr><th>Milestone</th><th>Slice</th><th>Title</th></tr></thead>
|
|
927
|
+
<tbody>
|
|
928
|
+
${s.missingSlices.map(sl => `<tr><td class="mono">${esc(sl.milestoneId)}</td><td class="mono">${esc(sl.sliceId)}</td><td>${esc(sl.title)}</td></tr>`).join('')}
|
|
929
|
+
${s.missingCount > s.missingSlices.length
|
|
930
|
+
? `<tr><td colspan="3" class="muted">and ${s.missingCount - s.missingSlices.length} more</td></tr>`
|
|
931
|
+
: ''}
|
|
932
|
+
</tbody>
|
|
933
|
+
</table>` : '';
|
|
934
|
+
|
|
935
|
+
const updatedHtml = s.updatedCount > 0 ? `
|
|
936
|
+
<h3>Recently completed <span class="count">${s.updatedCount}</span></h3>
|
|
937
|
+
<table class="tbl">
|
|
938
|
+
<thead><tr><th>Milestone</th><th>Slice</th><th>Title</th><th>Completed</th></tr></thead>
|
|
939
|
+
<tbody>${s.updatedSlices.map(sl => `
|
|
940
|
+
<tr><td class="mono">${esc(sl.milestoneId)}</td><td class="mono">${esc(sl.sliceId)}</td><td>${esc(sl.title)}</td><td class="muted">${sl.completedAt ? formatDateShort(sl.completedAt) : ''}</td></tr>`).join('')}
|
|
941
|
+
</tbody>
|
|
942
|
+
</table>` : '';
|
|
943
|
+
|
|
944
|
+
if (!missingHtml && !updatedHtml) {
|
|
945
|
+
return section('stats', 'Artifacts', '<p class="empty">All artifacts accounted for.</p>');
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
return section('stats', 'Artifacts', `${missingHtml}${updatedHtml}`);
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
// ─── Section: Discussion ──────────────────────────────────────────────────────
|
|
952
|
+
|
|
953
|
+
function buildDiscussionSection(data: VisualizerData): string {
|
|
954
|
+
if (data.discussion.length === 0) return section('discussion', 'Planning', '<p class="empty">No milestones.</p>');
|
|
955
|
+
|
|
956
|
+
const rows = data.discussion.map(d => `
|
|
957
|
+
<tr>
|
|
958
|
+
<td class="mono">${esc(d.milestoneId)}</td>
|
|
959
|
+
<td>${esc(d.title)}</td>
|
|
960
|
+
<td class="mono">${d.state}</td>
|
|
961
|
+
<td>${d.hasContext ? 'yes' : ''}</td>
|
|
962
|
+
<td>${d.hasDraft ? 'draft' : ''}</td>
|
|
963
|
+
<td class="muted">${d.lastUpdated ? formatDateShort(d.lastUpdated) : ''}</td>
|
|
964
|
+
</tr>`).join('');
|
|
965
|
+
|
|
966
|
+
return section('discussion', 'Planning', `
|
|
967
|
+
<table class="tbl">
|
|
968
|
+
<thead><tr><th>ID</th><th>Milestone</th><th>State</th><th>Context</th><th>Draft</th><th>Updated</th></tr></thead>
|
|
969
|
+
<tbody>${rows}</tbody>
|
|
970
|
+
</table>`);
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
// ─── Primitives ────────────────────────────────────────────────────────────────
|
|
974
|
+
|
|
975
|
+
function section(id: string, title: string, body: string): string {
|
|
976
|
+
return `\n<section id="${id}">\n <h2>${title}</h2>\n ${body}\n</section>`;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
function kvi(label: string, value: string): string {
|
|
980
|
+
return `<div class="kv"><span class="kv-val">${esc(value)}</span><span class="kv-lbl">${esc(label)}</span></div>`;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
function hRow(label: string, value: string, status?: 'ok' | 'caution' | 'warn'): string {
|
|
984
|
+
const cls = status ? ` class="h-${status}"` : '';
|
|
985
|
+
return `<tr${cls}><td>${esc(label)}</td><td>${esc(value)}</td></tr>`;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
function shortModel(m: string) { return m.replace(/^claude-/, '').replace(/^anthropic\//, ''); }
|
|
989
|
+
function truncStr(s: string, n: number) { return s.length > n ? s.slice(0, n - 1) + '\u2026' : s; }
|
|
990
|
+
|
|
991
|
+
function formatDateLong(iso: string): string {
|
|
992
|
+
try {
|
|
993
|
+
const d = new Date(iso);
|
|
994
|
+
return d.toLocaleString('en-US', { weekday: 'short', month: 'short', day: 'numeric', year: 'numeric', hour: '2-digit', minute: '2-digit', timeZoneName: 'short' });
|
|
995
|
+
} catch { return iso; }
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
|
|
999
|
+
function esc(s: string | undefined | null): string {
|
|
1000
|
+
if (s == null) return '';
|
|
1001
|
+
return String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
// ─── CSS ───────────────────────────────────────────────────────────────────────
|
|
1005
|
+
// Linear-inspired: restrained palette, one accent, no emoji, no gradients.
|
|
1006
|
+
|
|
1007
|
+
const CSS = `
|
|
1008
|
+
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
|
|
1009
|
+
:root{
|
|
1010
|
+
--bg-0:#0f1115;--bg-1:#16181d;--bg-2:#1e2028;--bg-3:#272a33;
|
|
1011
|
+
--border-1:#2b2e38;--border-2:#3b3f4c;
|
|
1012
|
+
--text-0:#ededef;--text-1:#a1a1aa;--text-2:#71717a;
|
|
1013
|
+
--accent:#5e6ad2;--accent-subtle:rgba(94,106,210,.12);
|
|
1014
|
+
--ok:#22c55e;--ok-subtle:rgba(34,197,94,.12);--warn:#ef4444;--caution:#eab308;
|
|
1015
|
+
/* Chart palette — 6 hues for bar charts */
|
|
1016
|
+
--c0:#5e6ad2;--c1:#e5796d;--c2:#14b8a6;--c3:#a78bfa;--c4:#f59e0b;--c5:#10b981;
|
|
1017
|
+
/* Token breakdown — 4 distinct hues */
|
|
1018
|
+
--tk-input:#5e6ad2;--tk-output:#e5796d;--tk-cache-r:#2dd4bf;--tk-cache-w:#64748b;
|
|
1019
|
+
--font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
|
|
1020
|
+
--mono:'JetBrains Mono','Fira Code',ui-monospace,SFMono-Regular,monospace;
|
|
1021
|
+
}
|
|
1022
|
+
html{scroll-behavior:smooth;font-size:13px}
|
|
1023
|
+
body{background:var(--bg-0);color:var(--text-0);font-family:var(--font);line-height:1.6;-webkit-font-smoothing:antialiased}
|
|
1024
|
+
a{color:var(--accent);text-decoration:none}
|
|
1025
|
+
a:hover{text-decoration:underline}
|
|
1026
|
+
code{font-family:var(--mono);font-size:12px;background:var(--bg-3);padding:1px 5px;border-radius:3px}
|
|
1027
|
+
.mono{font-family:var(--mono);font-size:12px}
|
|
1028
|
+
.muted{color:var(--text-2)}
|
|
1029
|
+
.accent{color:var(--accent)}
|
|
1030
|
+
.sep{color:var(--border-2);margin:0 4px}
|
|
1031
|
+
.empty{color:var(--text-2);padding:8px 0;font-size:13px}
|
|
1032
|
+
.indent{padding-left:12px}
|
|
1033
|
+
.num{font-variant-numeric:tabular-nums;text-align:right}
|
|
1034
|
+
|
|
1035
|
+
/* Status dots — geometric, no emoji */
|
|
1036
|
+
.dot{display:inline-block;width:8px;height:8px;border-radius:50%;flex-shrink:0;vertical-align:middle}
|
|
1037
|
+
.dot-sm{width:6px;height:6px}
|
|
1038
|
+
.dot-complete{background:var(--ok);opacity:.6}
|
|
1039
|
+
.dot-active{background:var(--accent)}
|
|
1040
|
+
.dot-pending{background:transparent;border:1.5px solid var(--border-2)}
|
|
1041
|
+
.dot-parked{background:var(--warn);opacity:.5}
|
|
1042
|
+
|
|
1043
|
+
/* Header */
|
|
1044
|
+
header{background:var(--bg-1);border-bottom:1px solid var(--border-1);padding:12px 32px;position:sticky;top:0;z-index:200}
|
|
1045
|
+
.header-inner{display:flex;align-items:center;gap:16px;max-width:1280px;margin:0 auto}
|
|
1046
|
+
.branding{display:flex;align-items:baseline;gap:6px;flex-shrink:0}
|
|
1047
|
+
.logo{font-size:18px;font-weight:800;letter-spacing:-.5px;color:var(--text-0)}
|
|
1048
|
+
.version{font-size:10px;color:var(--text-2);font-family:var(--mono)}
|
|
1049
|
+
.header-meta{flex:1;min-width:0}
|
|
1050
|
+
.header-meta h1{font-size:15px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
1051
|
+
.header-path{font-size:11px;color:var(--text-2);font-family:var(--mono);display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
1052
|
+
.header-right{text-align:right;flex-shrink:0;display:flex;flex-direction:column;align-items:flex-end;gap:4px}
|
|
1053
|
+
.generated{font-size:11px;color:var(--text-2)}
|
|
1054
|
+
.back-link{font-size:12px;color:var(--text-1)}
|
|
1055
|
+
.back-link:hover{color:var(--accent)}
|
|
1056
|
+
|
|
1057
|
+
/* TOC nav */
|
|
1058
|
+
.toc{background:var(--bg-1);border-bottom:1px solid var(--border-1);overflow-x:auto}
|
|
1059
|
+
.toc ul{display:flex;list-style:none;max-width:1280px;margin:0 auto;padding:0 32px}
|
|
1060
|
+
.toc a{display:inline-block;padding:8px 12px;color:var(--text-2);font-size:12px;font-weight:500;border-bottom:2px solid transparent;transition:color .12s,border-color .12s;white-space:nowrap;text-decoration:none}
|
|
1061
|
+
.toc a:hover{color:var(--text-0);border-bottom-color:var(--border-2)}
|
|
1062
|
+
.toc a.active{color:var(--text-0);border-bottom-color:var(--accent)}
|
|
1063
|
+
|
|
1064
|
+
/* Layout */
|
|
1065
|
+
main{max-width:1280px;margin:0 auto;padding:32px;display:flex;flex-direction:column;gap:48px}
|
|
1066
|
+
section{scroll-margin-top:82px}
|
|
1067
|
+
section>h2{font-size:14px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--text-1);margin-bottom:16px;padding-bottom:8px;border-bottom:1px solid var(--border-1);display:flex;align-items:center;gap:8px}
|
|
1068
|
+
h3{font-size:13px;font-weight:600;color:var(--text-1);margin:20px 0 8px}
|
|
1069
|
+
.count{font-size:11px;font-weight:500;color:var(--text-2);background:var(--bg-3);border-radius:3px;padding:1px 6px}
|
|
1070
|
+
.count-warn{color:var(--caution)}
|
|
1071
|
+
|
|
1072
|
+
/* KV grid (stats/metrics) */
|
|
1073
|
+
.kv-grid{display:flex;flex-wrap:wrap;gap:1px;background:var(--border-1);border:1px solid var(--border-1);border-radius:4px;overflow:hidden;margin-bottom:16px}
|
|
1074
|
+
.kv{background:var(--bg-1);padding:10px 16px;display:flex;flex-direction:column;gap:2px;min-width:110px;flex:1}
|
|
1075
|
+
.kv-val{font-size:18px;font-weight:600;color:var(--text-0);font-variant-numeric:tabular-nums}
|
|
1076
|
+
.kv-lbl{font-size:10px;color:var(--text-2);text-transform:uppercase;letter-spacing:.4px}
|
|
1077
|
+
|
|
1078
|
+
/* Progress bar */
|
|
1079
|
+
.progress-wrap{display:flex;align-items:center;gap:10px;margin-bottom:12px}
|
|
1080
|
+
.progress-track{flex:1;height:4px;background:var(--bg-3);border-radius:2px;overflow:hidden}
|
|
1081
|
+
.progress-fill{height:100%;background:var(--accent);border-radius:2px}
|
|
1082
|
+
.progress-label{font-size:12px;font-weight:600;color:var(--text-1);min-width:40px;text-align:right}
|
|
1083
|
+
.active-info{font-size:12px;color:var(--text-1);margin-bottom:4px}
|
|
1084
|
+
.activity-line{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--text-1);padding:6px 0}
|
|
1085
|
+
|
|
1086
|
+
/* Tables */
|
|
1087
|
+
.tbl{width:100%;border-collapse:collapse;font-size:12px}
|
|
1088
|
+
.tbl th{color:var(--text-2);font-weight:500;padding:6px 12px;text-align:left;border-bottom:1px solid var(--border-1);font-size:11px;text-transform:uppercase;letter-spacing:.3px;white-space:nowrap}
|
|
1089
|
+
.tbl td{padding:6px 12px;border-bottom:1px solid var(--border-1);vertical-align:top}
|
|
1090
|
+
.tbl tr:last-child td{border-bottom:none}
|
|
1091
|
+
.tbl tbody tr:hover td{background:var(--accent-subtle)}
|
|
1092
|
+
.tbl-kv td:first-child{color:var(--text-2);width:180px}
|
|
1093
|
+
.table-scroll{overflow-x:auto;border:1px solid var(--border-1);border-radius:4px}
|
|
1094
|
+
.table-scroll .tbl{border:none}
|
|
1095
|
+
|
|
1096
|
+
/* Health */
|
|
1097
|
+
.h-ok td:first-child{color:var(--text-1)}
|
|
1098
|
+
.h-caution td{color:var(--caution)}
|
|
1099
|
+
.h-warn td{color:var(--warn)}
|
|
1100
|
+
|
|
1101
|
+
/* Labels */
|
|
1102
|
+
.label{font-size:10px;font-weight:500;color:var(--accent);text-transform:uppercase;letter-spacing:.4px}
|
|
1103
|
+
.risk{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.3px;flex-shrink:0}
|
|
1104
|
+
.risk-low{color:var(--text-2)}
|
|
1105
|
+
.risk-medium{color:var(--caution)}
|
|
1106
|
+
.risk-high{color:var(--warn)}
|
|
1107
|
+
.risk-unknown{color:var(--text-2)}
|
|
1108
|
+
|
|
1109
|
+
/* Tags */
|
|
1110
|
+
.tag-row{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:8px}
|
|
1111
|
+
.tag{font-size:11px;font-family:var(--mono);color:var(--text-2);background:var(--bg-3);border-radius:3px;padding:1px 6px}
|
|
1112
|
+
|
|
1113
|
+
/* Verification */
|
|
1114
|
+
.verif{font-size:12px;color:var(--text-1);padding:4px 0;margin-bottom:6px}
|
|
1115
|
+
.verif-blocker{color:var(--warn)}
|
|
1116
|
+
|
|
1117
|
+
/* Detail blocks */
|
|
1118
|
+
.detail-block{font-size:12px;color:var(--text-2);margin-bottom:6px}
|
|
1119
|
+
.detail-label{font-weight:600;color:var(--text-1);display:block;margin-bottom:2px}
|
|
1120
|
+
.detail-block ul{padding-left:16px;margin-top:2px}
|
|
1121
|
+
.detail-block li{margin-bottom:1px}
|
|
1122
|
+
|
|
1123
|
+
/* Progress tree */
|
|
1124
|
+
.ms-block{border:1px solid var(--border-1);border-radius:4px;overflow:hidden;margin-bottom:8px}
|
|
1125
|
+
.ms-summary{display:flex;align-items:center;gap:8px;padding:10px 14px;cursor:pointer;list-style:none;background:var(--bg-1);user-select:none;font-size:13px}
|
|
1126
|
+
.ms-summary:hover{background:var(--bg-2)}
|
|
1127
|
+
.ms-summary::-webkit-details-marker{display:none}
|
|
1128
|
+
.ms-id{font-weight:600}
|
|
1129
|
+
.ms-title{flex:1;font-weight:500;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
1130
|
+
.ms-body{padding:6px 12px 8px 24px;display:flex;flex-direction:column;gap:4px}
|
|
1131
|
+
|
|
1132
|
+
.sl-block{border:1px solid var(--border-1);border-radius:3px;overflow:hidden}
|
|
1133
|
+
.sl-summary{display:flex;align-items:center;gap:6px;padding:6px 10px;cursor:pointer;list-style:none;background:var(--bg-2);font-size:12px;user-select:none}
|
|
1134
|
+
.sl-summary:hover{background:var(--bg-3)}
|
|
1135
|
+
.sl-summary::-webkit-details-marker{display:none}
|
|
1136
|
+
.sl-crit{border-left:2px solid var(--accent)}
|
|
1137
|
+
.sl-deps::before{content:'\\2190 ';color:var(--border-2)}
|
|
1138
|
+
.sl-detail{padding:8px 12px;background:var(--bg-0);border-top:1px solid var(--border-1)}
|
|
1139
|
+
|
|
1140
|
+
.task-list{list-style:none;padding:4px 0 0;display:flex;flex-direction:column;gap:2px}
|
|
1141
|
+
.task-row{display:flex;align-items:center;gap:6px;font-size:12px;padding:3px 6px;border-radius:2px}
|
|
1142
|
+
|
|
1143
|
+
/* Dep graph */
|
|
1144
|
+
.dep-block{margin-bottom:28px}
|
|
1145
|
+
.dep-legend{display:flex;gap:14px;font-size:12px;color:var(--text-2);margin-bottom:8px;align-items:center}
|
|
1146
|
+
.dep-legend span{display:flex;align-items:center;gap:4px}
|
|
1147
|
+
.dep-wrap{overflow-x:auto;background:var(--bg-1);border:1px solid var(--border-1);border-radius:4px;padding:16px}
|
|
1148
|
+
.dep-svg{display:block}
|
|
1149
|
+
.edge{fill:none;stroke:var(--border-2);stroke-width:1.5}
|
|
1150
|
+
.edge-crit{stroke:var(--accent);stroke-width:2}
|
|
1151
|
+
.node rect{fill:var(--bg-2);stroke:var(--border-2);stroke-width:1}
|
|
1152
|
+
.n-done rect{fill:var(--ok-subtle);stroke:rgba(34,197,94,.4)}
|
|
1153
|
+
.n-active rect{fill:var(--accent-subtle);stroke:var(--accent)}
|
|
1154
|
+
.n-crit rect{stroke:var(--accent)!important;stroke-width:1.5!important}
|
|
1155
|
+
.n-id{font-family:var(--mono);font-size:10px;fill:var(--text-1);font-weight:600;text-anchor:middle}
|
|
1156
|
+
.n-title{font-size:9px;fill:var(--text-2);text-anchor:middle}
|
|
1157
|
+
.n-active .n-id{fill:var(--accent)}
|
|
1158
|
+
|
|
1159
|
+
/* Metrics */
|
|
1160
|
+
.token-block{background:var(--bg-1);border:1px solid var(--border-1);border-radius:4px;padding:14px;margin-bottom:16px}
|
|
1161
|
+
.token-bar{display:flex;height:16px;border-radius:2px;overflow:hidden;gap:1px;margin-bottom:8px}
|
|
1162
|
+
.tseg{height:100%;min-width:2px}
|
|
1163
|
+
.seg-1{background:var(--tk-input)}
|
|
1164
|
+
.seg-2{background:var(--tk-output)}
|
|
1165
|
+
.seg-3{background:var(--tk-cache-r)}
|
|
1166
|
+
.seg-4{background:var(--tk-cache-w)}
|
|
1167
|
+
.token-legend{display:flex;flex-wrap:wrap;gap:12px}
|
|
1168
|
+
.leg-item{display:flex;align-items:center;gap:5px;font-size:11px;color:var(--text-2)}
|
|
1169
|
+
.leg-dot{width:8px;height:8px;border-radius:2px;flex-shrink:0}
|
|
1170
|
+
.chart-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px;margin-bottom:16px}
|
|
1171
|
+
.chart-block{background:var(--bg-1);border:1px solid var(--border-1);border-radius:4px;padding:14px}
|
|
1172
|
+
.bar-row{display:grid;grid-template-columns:120px 1fr 68px;align-items:center;gap:6px;margin-bottom:2px}
|
|
1173
|
+
.bar-lbl{font-size:12px;color:var(--text-2);text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
1174
|
+
.bar-track{height:14px;background:var(--bg-3);border-radius:2px;overflow:hidden}
|
|
1175
|
+
.bar-fill{height:100%;border-radius:2px;background:var(--c0)}
|
|
1176
|
+
.bar-c0{background:var(--c0)}.bar-c1{background:var(--c1)}.bar-c2{background:var(--c2)}
|
|
1177
|
+
.bar-c3{background:var(--c3)}.bar-c4{background:var(--c4)}.bar-c5{background:var(--c5)}
|
|
1178
|
+
.bar-val{font-size:11px;font-variant-numeric:tabular-nums;color:var(--text-1)}
|
|
1179
|
+
.bar-sub{font-size:10px;color:var(--text-2);padding-left:128px;margin-bottom:6px}
|
|
1180
|
+
|
|
1181
|
+
/* Changelog */
|
|
1182
|
+
.cl-entry{border-bottom:1px solid var(--border-1);padding:12px 0}
|
|
1183
|
+
.cl-entry:last-child{border-bottom:none}
|
|
1184
|
+
.cl-header{display:flex;align-items:center;gap:8px;margin-bottom:4px}
|
|
1185
|
+
.cl-title{flex:1;font-weight:500}
|
|
1186
|
+
.cl-date{margin-left:auto;white-space:nowrap}
|
|
1187
|
+
.cl-liner{font-size:13px;color:var(--text-1);margin-bottom:6px}
|
|
1188
|
+
.files-detail summary{font-size:12px;cursor:pointer}
|
|
1189
|
+
.file-list{list-style:none;padding-left:10px;margin-top:4px;display:flex;flex-direction:column;gap:2px}
|
|
1190
|
+
.file-list li{font-size:12px;color:var(--text-1)}
|
|
1191
|
+
|
|
1192
|
+
/* Footer */
|
|
1193
|
+
footer{border-top:1px solid var(--border-1);padding:20px 32px;margin-top:40px}
|
|
1194
|
+
.footer-inner{display:flex;align-items:center;gap:6px;justify-content:center;font-size:11px;color:var(--text-2)}
|
|
1195
|
+
|
|
1196
|
+
/* Executive summary & ETA */
|
|
1197
|
+
.exec-summary{font-size:13px;color:var(--text-1);margin-bottom:12px;line-height:1.7}
|
|
1198
|
+
.eta-line{font-size:12px;color:var(--accent);margin-top:4px}
|
|
1199
|
+
|
|
1200
|
+
/* Cost over time chart */
|
|
1201
|
+
.cost-svg{display:block;margin:8px 0;background:var(--bg-1);border:1px solid var(--border-1);border-radius:4px}
|
|
1202
|
+
.cost-line{fill:none;stroke:var(--accent);stroke-width:2}
|
|
1203
|
+
.cost-area{fill:var(--accent-subtle);stroke:none}
|
|
1204
|
+
.cost-axis{fill:var(--text-2);font-family:var(--mono);font-size:10px}
|
|
1205
|
+
.cost-grid{stroke:var(--border-1);stroke-width:1;stroke-dasharray:4,4}
|
|
1206
|
+
|
|
1207
|
+
/* Budget burndown */
|
|
1208
|
+
.burndown-wrap{background:var(--bg-1);border:1px solid var(--border-1);border-radius:4px;padding:14px;margin-bottom:16px}
|
|
1209
|
+
.burndown-bar{display:flex;height:20px;border-radius:3px;overflow:hidden;gap:1px;margin-bottom:8px}
|
|
1210
|
+
.burndown-spent{background:var(--accent);height:100%}
|
|
1211
|
+
.burndown-projected{background:var(--caution);height:100%;opacity:.6}
|
|
1212
|
+
.burndown-overshoot{background:var(--warn);height:100%;opacity:.7}
|
|
1213
|
+
.burndown-legend{display:flex;flex-wrap:wrap;gap:12px;font-size:11px;color:var(--text-2)}
|
|
1214
|
+
.burndown-legend span{display:flex;align-items:center;gap:4px}
|
|
1215
|
+
.burndown-dot{display:inline-block;width:8px;height:8px;border-radius:2px}
|
|
1216
|
+
|
|
1217
|
+
/* Blockers */
|
|
1218
|
+
.blocker-card{border-left:3px solid var(--warn);background:var(--bg-1);border-radius:0 4px 4px 0;padding:10px 14px;margin-bottom:8px}
|
|
1219
|
+
.blocker-id{font-family:var(--mono);font-size:12px;color:var(--warn);margin-bottom:2px}
|
|
1220
|
+
.blocker-text{font-size:12px;color:var(--text-1)}
|
|
1221
|
+
.blocker-risk{font-size:11px;color:var(--caution);margin-top:2px}
|
|
1222
|
+
|
|
1223
|
+
/* Gantt */
|
|
1224
|
+
.gantt-wrap{overflow-x:auto;background:var(--bg-1);border:1px solid var(--border-1);border-radius:4px;padding:16px;margin-top:16px}
|
|
1225
|
+
.gantt-svg{display:block}
|
|
1226
|
+
.gantt-bar-done{fill:var(--ok);opacity:.7}
|
|
1227
|
+
.gantt-bar-active{fill:var(--accent)}
|
|
1228
|
+
.gantt-bar-pending{fill:var(--border-2)}
|
|
1229
|
+
.gantt-label{fill:var(--text-2);font-family:var(--mono);font-size:10px}
|
|
1230
|
+
.gantt-axis{fill:var(--text-2);font-family:var(--mono);font-size:9px}
|
|
1231
|
+
|
|
1232
|
+
/* Interactive */
|
|
1233
|
+
.tl-filter{display:block;width:100%;padding:6px 10px;margin-bottom:8px;background:var(--bg-2);border:1px solid var(--border-1);border-radius:4px;color:var(--text-0);font-size:12px;font-family:var(--font);outline:none}
|
|
1234
|
+
.tl-filter:focus{border-color:var(--accent)}
|
|
1235
|
+
.tl-filter::placeholder{color:var(--text-2)}
|
|
1236
|
+
.sec-toggle{background:none;border:1px solid var(--border-2);color:var(--text-2);width:20px;height:20px;border-radius:3px;cursor:pointer;font-size:14px;line-height:1;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
|
|
1237
|
+
.sec-toggle:hover{border-color:var(--text-1);color:var(--text-1)}
|
|
1238
|
+
.theme-toggle{background:var(--bg-3);border:1px solid var(--border-2);color:var(--text-1);padding:4px 10px;border-radius:4px;cursor:pointer;font-size:11px;font-family:var(--font)}
|
|
1239
|
+
.theme-toggle:hover{border-color:var(--accent);color:var(--accent)}
|
|
1240
|
+
|
|
1241
|
+
/* Light theme */
|
|
1242
|
+
.light-theme{--bg-0:#fff;--bg-1:#fafafa;--bg-2:#f5f5f5;--bg-3:#ebebeb;--border-1:#e5e5e5;--border-2:#d4d4d4;--text-0:#1a1a1a;--text-1:#525252;--text-2:#a3a3a3;--accent:#4f46e5;--accent-subtle:rgba(79,70,229,.08);--ok:#16a34a;--ok-subtle:rgba(22,163,74,.08);--warn:#dc2626;--caution:#ca8a04;--c0:#4f46e5;--c1:#dc2626;--c2:#0d9488;--c3:#7c3aed;--c4:#d97706;--c5:#059669;--tk-input:#4f46e5;--tk-output:#dc2626;--tk-cache-r:#0d9488;--tk-cache-w:#64748b}
|
|
1243
|
+
|
|
1244
|
+
/* Responsive */
|
|
1245
|
+
@media(max-width:768px){
|
|
1246
|
+
header{padding:10px 16px}
|
|
1247
|
+
.header-inner{flex-wrap:wrap;gap:8px}
|
|
1248
|
+
.header-meta h1{font-size:13px}
|
|
1249
|
+
main{padding:16px}
|
|
1250
|
+
.kv-grid{gap:1px}
|
|
1251
|
+
.kv{min-width:80px;padding:8px 10px}
|
|
1252
|
+
.kv-val{font-size:14px}
|
|
1253
|
+
.chart-row{grid-template-columns:1fr}
|
|
1254
|
+
.toc ul{padding:0 16px}
|
|
1255
|
+
.toc a{padding:6px 8px;font-size:11px}
|
|
1256
|
+
.bar-row{grid-template-columns:80px 1fr 56px}
|
|
1257
|
+
.ms-body{padding-left:12px}
|
|
1258
|
+
}
|
|
1259
|
+
@media(max-width:480px){
|
|
1260
|
+
.kv{min-width:60px;padding:6px 8px}
|
|
1261
|
+
.kv-val{font-size:12px}
|
|
1262
|
+
.kv-lbl{font-size:9px}
|
|
1263
|
+
.bar-row{grid-template-columns:60px 1fr 48px}
|
|
1264
|
+
.bar-lbl{font-size:10px}
|
|
1265
|
+
.toc ul{flex-wrap:wrap}
|
|
1266
|
+
.header-right{display:none}
|
|
1267
|
+
.gantt-wrap{overflow-x:auto}
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
/* Print */
|
|
1271
|
+
@media print{
|
|
1272
|
+
header,nav.toc{position:static}
|
|
1273
|
+
body{background:#fff;color:#1a1a1a}
|
|
1274
|
+
:root{--bg-0:#fff;--bg-1:#fafafa;--bg-2:#f5f5f5;--bg-3:#ebebeb;--border-1:#e5e5e5;--border-2:#d4d4d4;--text-0:#1a1a1a;--text-1:#525252;--text-2:#a3a3a3;--accent:#4f46e5;--ok:#16a34a;--ok-subtle:rgba(22,163,74,.08);--c0:#4f46e5;--c1:#dc2626;--c2:#0d9488;--c3:#7c3aed;--c4:#d97706;--c5:#059669;--tk-input:#4f46e5;--tk-output:#dc2626;--tk-cache-r:#0d9488;--tk-cache-w:#64748b}
|
|
1275
|
+
section{page-break-inside:avoid}
|
|
1276
|
+
.table-scroll{overflow:visible}
|
|
1277
|
+
}
|
|
1278
|
+
`;
|
|
1279
|
+
|
|
1280
|
+
// ─── JS ────────────────────────────────────────────────────────────────────────
|
|
1281
|
+
|
|
1282
|
+
const JS = `
|
|
1283
|
+
(function(){
|
|
1284
|
+
const sections=document.querySelectorAll('section[id]');
|
|
1285
|
+
const links=document.querySelectorAll('.toc a');
|
|
1286
|
+
if(!sections.length||!links.length)return;
|
|
1287
|
+
const obs=new IntersectionObserver(entries=>{
|
|
1288
|
+
for(const e of entries){
|
|
1289
|
+
if(!e.isIntersecting)continue;
|
|
1290
|
+
for(const l of links)l.classList.remove('active');
|
|
1291
|
+
const a=document.querySelector('.toc a[href="#'+e.target.id+'"]');
|
|
1292
|
+
if(a)a.classList.add('active');
|
|
1293
|
+
}
|
|
1294
|
+
},{rootMargin:'-10% 0px -80% 0px',threshold:0});
|
|
1295
|
+
for(const s of sections)obs.observe(s);
|
|
1296
|
+
})();
|
|
1297
|
+
(function(){
|
|
1298
|
+
var tl=document.getElementById('timeline');
|
|
1299
|
+
if(!tl)return;
|
|
1300
|
+
var table=tl.querySelector('.tbl');
|
|
1301
|
+
if(!table)return;
|
|
1302
|
+
var input=document.createElement('input');
|
|
1303
|
+
input.className='tl-filter';
|
|
1304
|
+
input.placeholder='Filter timeline\\u2026';
|
|
1305
|
+
input.type='text';
|
|
1306
|
+
table.parentNode.insertBefore(input,table);
|
|
1307
|
+
var rows=table.querySelectorAll('tbody tr');
|
|
1308
|
+
input.addEventListener('input',function(){
|
|
1309
|
+
var q=this.value.toLowerCase();
|
|
1310
|
+
for(var i=0;i<rows.length;i++){
|
|
1311
|
+
rows[i].style.display=rows[i].textContent.toLowerCase().indexOf(q)>-1?'':'none';
|
|
1312
|
+
}
|
|
1313
|
+
});
|
|
1314
|
+
})();
|
|
1315
|
+
(function(){
|
|
1316
|
+
var saved=JSON.parse(localStorage.getItem('gsd-collapsed')||'{}');
|
|
1317
|
+
document.querySelectorAll('section[id]').forEach(function(sec){
|
|
1318
|
+
var h2=sec.querySelector('h2');
|
|
1319
|
+
if(!h2)return;
|
|
1320
|
+
var btn=document.createElement('button');
|
|
1321
|
+
btn.className='sec-toggle';
|
|
1322
|
+
btn.textContent=saved[sec.id]?'+':'-';
|
|
1323
|
+
btn.setAttribute('aria-label','Toggle section');
|
|
1324
|
+
h2.prepend(btn);
|
|
1325
|
+
if(saved[sec.id])toggleSection(sec,true);
|
|
1326
|
+
btn.addEventListener('click',function(e){
|
|
1327
|
+
e.preventDefault();
|
|
1328
|
+
var collapsed=btn.textContent==='-';
|
|
1329
|
+
toggleSection(sec,collapsed);
|
|
1330
|
+
btn.textContent=collapsed?'+':'-';
|
|
1331
|
+
saved[sec.id]=collapsed;
|
|
1332
|
+
localStorage.setItem('gsd-collapsed',JSON.stringify(saved));
|
|
1333
|
+
});
|
|
1334
|
+
});
|
|
1335
|
+
function toggleSection(sec,hide){
|
|
1336
|
+
var children=sec.children;
|
|
1337
|
+
for(var i=0;i<children.length;i++){
|
|
1338
|
+
if(children[i].tagName!=='H2')children[i].style.display=hide?'none':'';
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
})();
|
|
1342
|
+
(function(){
|
|
1343
|
+
var hr=document.querySelector('.header-right');
|
|
1344
|
+
if(!hr)return;
|
|
1345
|
+
var btn=document.createElement('button');
|
|
1346
|
+
btn.className='theme-toggle';
|
|
1347
|
+
btn.textContent=localStorage.getItem('gsd-theme')==='light'?'Dark':'Light';
|
|
1348
|
+
if(localStorage.getItem('gsd-theme')==='light')document.documentElement.classList.add('light-theme');
|
|
1349
|
+
btn.addEventListener('click',function(){
|
|
1350
|
+
document.documentElement.classList.toggle('light-theme');
|
|
1351
|
+
var isLight=document.documentElement.classList.contains('light-theme');
|
|
1352
|
+
btn.textContent=isLight?'Dark':'Light';
|
|
1353
|
+
localStorage.setItem('gsd-theme',isLight?'light':'dark');
|
|
1354
|
+
});
|
|
1355
|
+
hr.prepend(btn);
|
|
1356
|
+
})();
|
|
1357
|
+
`;
|