gsd-pi 2.73.1 → 2.74.0-dev.b741afb
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/dist/cli-web-branch.d.ts +4 -3
- package/dist/cli-web-branch.js +10 -7
- package/dist/cli.js +184 -206
- package/dist/headless-query.js +4 -1
- package/dist/help-text.js +23 -0
- package/dist/logo.d.ts +1 -1
- package/dist/logo.js +1 -1
- package/dist/onboarding.js +59 -53
- package/dist/resource-loader.js +2 -2
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +68 -4
- package/dist/resources/extensions/gsd/auto/detect-stuck.js +11 -4
- package/dist/resources/extensions/gsd/auto/phases.js +60 -10
- package/dist/resources/extensions/gsd/auto-dispatch.js +11 -3
- package/dist/resources/extensions/gsd/auto-model-selection.js +54 -11
- package/dist/resources/extensions/gsd/auto-post-unit.js +93 -57
- package/dist/resources/extensions/gsd/auto-prompts.js +12 -0
- package/dist/resources/extensions/gsd/auto-start.js +23 -6
- package/dist/resources/extensions/gsd/auto-timeout-recovery.js +13 -0
- package/dist/resources/extensions/gsd/auto-verification.js +88 -3
- package/dist/resources/extensions/gsd/auto.js +37 -10
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +21 -8
- package/dist/resources/extensions/gsd/commands/catalog.js +26 -1
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +20 -0
- package/dist/resources/extensions/gsd/commands/handlers/workflow.js +68 -9
- package/dist/resources/extensions/gsd/commands-add-tests.js +111 -0
- package/dist/resources/extensions/gsd/commands-backlog.js +140 -0
- package/dist/resources/extensions/gsd/commands-do.js +79 -0
- package/dist/resources/extensions/gsd/commands-handlers.js +8 -2
- package/dist/resources/extensions/gsd/commands-maintenance.js +6 -6
- package/dist/resources/extensions/gsd/commands-pr-branch.js +180 -0
- package/dist/resources/extensions/gsd/commands-session-report.js +82 -0
- package/dist/resources/extensions/gsd/commands-ship.js +187 -0
- package/dist/resources/extensions/gsd/db-writer.js +3 -5
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +1 -1
- package/dist/resources/extensions/gsd/graph-context.js +66 -0
- package/dist/resources/extensions/gsd/gsd-db.js +321 -0
- package/dist/resources/extensions/gsd/index.js +15 -2
- package/dist/resources/extensions/gsd/md-importer.js +3 -4
- package/dist/resources/extensions/gsd/memory-store.js +19 -51
- package/dist/resources/extensions/gsd/milestone-validation-gates.js +13 -12
- package/dist/resources/extensions/gsd/native-git-bridge.js +7 -4
- package/dist/resources/extensions/gsd/notification-widget.js +2 -2
- package/dist/resources/extensions/gsd/preferences-models.js +43 -0
- package/dist/resources/extensions/gsd/preferences-types.js +1 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +22 -0
- package/dist/resources/extensions/gsd/prompts/add-tests.md +35 -0
- package/dist/resources/extensions/gsd/state.js +66 -15
- package/dist/resources/extensions/gsd/tools/complete-slice.js +15 -0
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +3 -14
- package/dist/resources/extensions/gsd/triage-resolution.js +2 -5
- package/dist/resources/extensions/gsd/workflow-manifest.js +8 -69
- package/dist/resources/extensions/gsd/workflow-migration.js +21 -22
- package/dist/resources/extensions/gsd/workflow-projections.js +4 -1
- package/dist/resources/extensions/gsd/workflow-reconcile.js +14 -11
- package/dist/tsconfig.extensions.tsbuildinfo +1 -0
- package/dist/update-check.d.ts +1 -0
- package/dist/update-check.js +13 -5
- package/dist/update-cmd.js +4 -3
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +9 -9
- package/dist/web/standalone/.next/build-manifest.json +3 -3
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/required-server-files.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +4 -4
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/page.js +2 -2
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +9 -9
- package/dist/web/standalone/.next/server/chunks/63.js +3 -3
- package/dist/web/standalone/.next/server/chunks/6897.js +1 -1
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-manifest.json +5 -5
- package/dist/web/standalone/.next/server/middleware.js +2 -2
- package/dist/web/standalone/.next/server/next-font-manifest.js +1 -1
- package/dist/web/standalone/.next/server/next-font-manifest.json +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/page-f1e30ab6bb269149.js +1 -0
- package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
- package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
- package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
- package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
- package/dist/web/standalone/server.js +1 -1
- package/package.json +3 -3
- package/packages/daemon/package.json +2 -2
- package/packages/mcp-server/dist/index.d.ts +3 -0
- package/packages/mcp-server/dist/index.d.ts.map +1 -1
- package/packages/mcp-server/dist/index.js +3 -0
- package/packages/mcp-server/dist/index.js.map +1 -1
- package/packages/mcp-server/dist/readers/graph.d.ts +87 -0
- package/packages/mcp-server/dist/readers/graph.d.ts.map +1 -0
- package/packages/mcp-server/dist/readers/graph.js +548 -0
- package/packages/mcp-server/dist/readers/graph.js.map +1 -0
- package/packages/mcp-server/dist/readers/index.d.ts +2 -0
- package/packages/mcp-server/dist/readers/index.d.ts.map +1 -1
- package/packages/mcp-server/dist/readers/index.js +1 -0
- package/packages/mcp-server/dist/readers/index.js.map +1 -1
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +65 -0
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/package.json +2 -2
- package/packages/mcp-server/src/index.ts +15 -0
- package/packages/mcp-server/src/readers/graph.test.ts +426 -0
- package/packages/mcp-server/src/readers/graph.ts +708 -0
- package/packages/mcp-server/src/readers/index.ts +12 -0
- package/packages/mcp-server/src/server.ts +83 -0
- package/packages/mcp-server/tsconfig.json +1 -0
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -0
- package/packages/native/package.json +2 -2
- package/packages/native/tsconfig.tsbuildinfo +1 -0
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-agent-core/tsconfig.json +1 -0
- package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -0
- package/packages/pi-ai/dist/index.d.ts +1 -0
- package/packages/pi-ai/dist/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/index.js +1 -0
- package/packages/pi-ai/dist/index.js.map +1 -1
- package/packages/pi-ai/dist/utils/overflow.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/overflow.js +12 -0
- package/packages/pi-ai/dist/utils/overflow.js.map +1 -1
- package/packages/pi-ai/dist/utils/tests/overflow.test.d.ts +2 -0
- package/packages/pi-ai/dist/utils/tests/overflow.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/tests/overflow.test.js +50 -0
- package/packages/pi-ai/dist/utils/tests/overflow.test.js.map +1 -0
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-ai/src/index.ts +4 -0
- package/packages/pi-ai/src/utils/overflow.ts +14 -1
- package/packages/pi-ai/src/utils/tests/overflow.test.ts +58 -0
- package/packages/pi-ai/tsconfig.json +1 -0
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -0
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +313 -8
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/utils.js +5 -5
- package/packages/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-utils.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/compaction-utils.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-utils.test.js +45 -0
- package/packages/pi-coding-agent/dist/core/compaction-utils.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts +12 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +61 -28
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.d.ts +2 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js +9 -3
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.test.js +52 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +94 -16
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.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 +11 -3
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +355 -8
- package/packages/pi-coding-agent/src/core/compaction/utils.ts +5 -5
- package/packages/pi-coding-agent/src/core/compaction-utils.test.ts +50 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +74 -32
- package/packages/pi-coding-agent/src/modes/interactive/components/dynamic-border.test.ts +73 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/dynamic-border.ts +9 -3
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +113 -21
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +11 -3
- package/packages/pi-coding-agent/tsconfig.json +1 -0
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -0
- package/packages/pi-tui/dist/__tests__/tui.test.js +60 -1
- package/packages/pi-tui/dist/__tests__/tui.test.js.map +1 -1
- package/packages/pi-tui/dist/tui.d.ts +8 -0
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +32 -3
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/package.json +1 -1
- package/packages/pi-tui/src/__tests__/tui.test.ts +76 -1
- package/packages/pi-tui/src/tui.ts +31 -3
- package/packages/pi-tui/tsconfig.json +1 -0
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -0
- package/packages/rpc-client/package.json +1 -1
- package/packages/rpc-client/tsconfig.json +1 -0
- package/packages/rpc-client/tsconfig.tsbuildinfo +1 -0
- package/pkg/package.json +1 -1
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +107 -5
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +111 -2
- package/src/resources/extensions/gsd/auto/detect-stuck.ts +12 -4
- package/src/resources/extensions/gsd/auto/loop-deps.ts +6 -0
- package/src/resources/extensions/gsd/auto/phases.ts +90 -10
- package/src/resources/extensions/gsd/auto-dispatch.ts +10 -4
- package/src/resources/extensions/gsd/auto-model-selection.ts +85 -11
- package/src/resources/extensions/gsd/auto-post-unit.ts +107 -58
- package/src/resources/extensions/gsd/auto-prompts.ts +13 -0
- package/src/resources/extensions/gsd/auto-start.ts +30 -6
- package/src/resources/extensions/gsd/auto-timeout-recovery.ts +17 -0
- package/src/resources/extensions/gsd/auto-verification.ts +98 -3
- package/src/resources/extensions/gsd/auto.ts +38 -14
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +24 -8
- package/src/resources/extensions/gsd/commands/catalog.ts +26 -1
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +20 -0
- package/src/resources/extensions/gsd/commands/handlers/workflow.ts +74 -9
- package/src/resources/extensions/gsd/commands-add-tests.ts +137 -0
- package/src/resources/extensions/gsd/commands-backlog.ts +182 -0
- package/src/resources/extensions/gsd/commands-do.ts +109 -0
- package/src/resources/extensions/gsd/commands-handlers.ts +8 -2
- package/src/resources/extensions/gsd/commands-maintenance.ts +6 -6
- package/src/resources/extensions/gsd/commands-pr-branch.ts +234 -0
- package/src/resources/extensions/gsd/commands-session-report.ts +101 -0
- package/src/resources/extensions/gsd/commands-ship.ts +219 -0
- package/src/resources/extensions/gsd/db-writer.ts +3 -5
- package/src/resources/extensions/gsd/docs/preferences-reference.md +1 -1
- package/src/resources/extensions/gsd/graph-context.ts +85 -0
- package/src/resources/extensions/gsd/gsd-db.ts +467 -0
- package/src/resources/extensions/gsd/index.ts +18 -2
- package/src/resources/extensions/gsd/md-importer.ts +3 -5
- package/src/resources/extensions/gsd/memory-store.ts +31 -62
- package/src/resources/extensions/gsd/milestone-validation-gates.ts +13 -14
- package/src/resources/extensions/gsd/native-git-bridge.ts +11 -12
- package/src/resources/extensions/gsd/notification-widget.ts +2 -2
- package/src/resources/extensions/gsd/preferences-models.ts +41 -0
- package/src/resources/extensions/gsd/preferences-types.ts +12 -0
- package/src/resources/extensions/gsd/preferences-validation.ts +23 -0
- package/src/resources/extensions/gsd/prompts/add-tests.md +35 -0
- package/src/resources/extensions/gsd/state.ts +80 -17
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/auto-post-unit-step-message.test.ts +53 -0
- package/src/resources/extensions/gsd/tests/auto-start-model-capture.test.ts +51 -2
- package/src/resources/extensions/gsd/tests/commands-backlog.test.ts +158 -0
- package/src/resources/extensions/gsd/tests/commands-do.test.ts +127 -0
- package/src/resources/extensions/gsd/tests/commands-pr-branch.test.ts +68 -0
- package/src/resources/extensions/gsd/tests/commands-session-report.test.ts +82 -0
- package/src/resources/extensions/gsd/tests/commands-ship.test.ts +71 -0
- package/src/resources/extensions/gsd/tests/commands-workflow-custom.test.ts +14 -0
- package/src/resources/extensions/gsd/tests/complete-milestone-false-merge.test.ts +142 -0
- package/src/resources/extensions/gsd/tests/completed-at-reconcile.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/derive-state-crossval.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/derive-state-helpers.test.ts +68 -8
- package/src/resources/extensions/gsd/tests/derive-state.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/extension-bootstrap-isolation.test.ts +154 -0
- package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +137 -1
- package/src/resources/extensions/gsd/tests/graph-context.test.ts +337 -0
- package/src/resources/extensions/gsd/tests/integration/state-machine-edge-cases.test.ts +4 -2
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +68 -1
- package/src/resources/extensions/gsd/tests/model-isolation.test.ts +91 -2
- package/src/resources/extensions/gsd/tests/native-git-bridge-exec-fallback.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/preferences.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/single-writer-invariant.test.ts +180 -0
- package/src/resources/extensions/gsd/tests/state-machine-full-walkthrough.test.ts +5 -7
- package/src/resources/extensions/gsd/tests/token-profile.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/validate-milestone-stuck-guard.test.ts +179 -0
- package/src/resources/extensions/gsd/tests/workflow-logger-wiring.test.ts +223 -0
- package/src/resources/extensions/gsd/tools/complete-slice.ts +19 -0
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +3 -11
- package/src/resources/extensions/gsd/triage-resolution.ts +2 -7
- package/src/resources/extensions/gsd/workflow-manifest.ts +9 -104
- package/src/resources/extensions/gsd/workflow-migration.ts +21 -29
- package/src/resources/extensions/gsd/workflow-projections.ts +8 -1
- package/src/resources/extensions/gsd/workflow-reconcile.ts +15 -15
- package/dist/web/standalone/.next/static/chunks/app/page-7115e62689b5fd84.js +0 -1
- package/dist/web/standalone/.next/static/chunks/main-app-d3d4c336195465f9.js +0 -1
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-ab5a8926e07ec673.js +0 -1
- /package/dist/web/standalone/.next/static/{Qr27MOHx0lxRGnJvlhxxu → XnHY5eXUsTCFmNodWHetD}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{Qr27MOHx0lxRGnJvlhxxu → XnHY5eXUsTCFmNodWHetD}/_ssgManifest.js +0 -0
|
@@ -15,7 +15,7 @@ export interface GsdCommandDefinition {
|
|
|
15
15
|
type CompletionMap = Record<string, readonly GsdCommandDefinition[]>;
|
|
16
16
|
|
|
17
17
|
export const GSD_COMMAND_DESCRIPTION =
|
|
18
|
-
"GSD — Get Shit Done: /gsd help|start|templates|next|auto|stop|pause|status|widget|visualize|queue|quick|discuss|capture|triage|dispatch|history|undo|undo-task|reset-slice|rate|skip|export|cleanup|model|mode|prefs|config|keys|hooks|run-hook|skill-health|doctor|logs|forensics|changelog|migrate|remote|steer|knowledge|new-milestone|parallel|cmux|park|unpark|init|setup|inspect|extensions|update|fast|mcp|rethink|codebase|notifications";
|
|
18
|
+
"GSD — Get Shit Done: /gsd help|start|templates|next|auto|stop|pause|status|widget|visualize|queue|quick|discuss|capture|triage|dispatch|history|undo|undo-task|reset-slice|rate|skip|export|cleanup|model|mode|prefs|config|keys|hooks|run-hook|skill-health|doctor|logs|forensics|changelog|migrate|remote|steer|knowledge|new-milestone|parallel|cmux|park|unpark|init|setup|inspect|extensions|update|fast|mcp|rethink|codebase|notifications|ship|do|session-report|backlog|pr-branch|add-tests";
|
|
19
19
|
|
|
20
20
|
export const TOP_LEVEL_SUBCOMMANDS: readonly GsdCommandDefinition[] = [
|
|
21
21
|
{ cmd: "help", desc: "Categorized command reference with descriptions" },
|
|
@@ -74,6 +74,12 @@ export const TOP_LEVEL_SUBCOMMANDS: readonly GsdCommandDefinition[] = [
|
|
|
74
74
|
{ cmd: "rethink", desc: "Conversational project reorganization — reorder, park, discard, add milestones" },
|
|
75
75
|
{ cmd: "workflow", desc: "Custom workflow lifecycle (new, run, list, validate, pause, resume)" },
|
|
76
76
|
{ cmd: "codebase", desc: "Generate, refresh, and inspect the codebase map cache (.gsd/CODEBASE.md)" },
|
|
77
|
+
{ cmd: "ship", desc: "Create PR from milestone artifacts and open for review" },
|
|
78
|
+
{ cmd: "do", desc: "Route freeform text to the right GSD command" },
|
|
79
|
+
{ cmd: "session-report", desc: "Session cost, tokens, and work summary" },
|
|
80
|
+
{ cmd: "backlog", desc: "Manage backlog items (add, promote, remove, list)" },
|
|
81
|
+
{ cmd: "pr-branch", desc: "Create clean PR branch filtering .gsd/ commits" },
|
|
82
|
+
{ cmd: "add-tests", desc: "Generate tests for completed slices" },
|
|
77
83
|
];
|
|
78
84
|
|
|
79
85
|
const NESTED_COMPLETIONS: CompletionMap = {
|
|
@@ -244,6 +250,25 @@ const NESTED_COMPLETIONS: CompletionMap = {
|
|
|
244
250
|
{ cmd: "stats", desc: "Show file count, description coverage, and generation time" },
|
|
245
251
|
{ cmd: "help", desc: "Show usage and available subcommands" },
|
|
246
252
|
],
|
|
253
|
+
ship: [
|
|
254
|
+
{ cmd: "--dry-run", desc: "Preview PR without creating" },
|
|
255
|
+
{ cmd: "--draft", desc: "Open as draft PR" },
|
|
256
|
+
{ cmd: "--base", desc: "Override target branch (default: main)" },
|
|
257
|
+
{ cmd: "--force", desc: "Ship even with pending tasks" },
|
|
258
|
+
],
|
|
259
|
+
"session-report": [
|
|
260
|
+
{ cmd: "--json", desc: "Machine-readable JSON output" },
|
|
261
|
+
{ cmd: "--save", desc: "Save report to .gsd/reports/" },
|
|
262
|
+
],
|
|
263
|
+
backlog: [
|
|
264
|
+
{ cmd: "add", desc: "Add item to backlog" },
|
|
265
|
+
{ cmd: "promote", desc: "Promote backlog item to active slice" },
|
|
266
|
+
{ cmd: "remove", desc: "Remove backlog item" },
|
|
267
|
+
],
|
|
268
|
+
"pr-branch": [
|
|
269
|
+
{ cmd: "--dry-run", desc: "Preview what would be filtered" },
|
|
270
|
+
{ cmd: "--name", desc: "Custom branch name" },
|
|
271
|
+
],
|
|
247
272
|
};
|
|
248
273
|
|
|
249
274
|
function filterOptions(
|
|
@@ -11,6 +11,9 @@ import { handleExport } from "../../export.js";
|
|
|
11
11
|
import { handleHistory } from "../../history.js";
|
|
12
12
|
import { handleUndo } from "../../undo.js";
|
|
13
13
|
import { handleRemote } from "../../../remote-questions/mod.js";
|
|
14
|
+
import { handleShip } from "../../commands-ship.js";
|
|
15
|
+
import { handleSessionReport } from "../../commands-session-report.js";
|
|
16
|
+
import { handlePrBranch } from "../../commands-pr-branch.js";
|
|
14
17
|
import { projectRoot } from "../context.js";
|
|
15
18
|
|
|
16
19
|
export async function handleOpsCommand(trimmed: string, ctx: ExtensionCommandContext, pi: ExtensionAPI): Promise<boolean> {
|
|
@@ -216,5 +219,22 @@ Examples:
|
|
|
216
219
|
await handleCodebase(trimmed.replace(/^codebase\s*/, "").trim(), ctx, pi);
|
|
217
220
|
return true;
|
|
218
221
|
}
|
|
222
|
+
if (trimmed === "ship" || trimmed.startsWith("ship ")) {
|
|
223
|
+
await handleShip(trimmed.replace(/^ship\s*/, "").trim(), ctx, pi);
|
|
224
|
+
return true;
|
|
225
|
+
}
|
|
226
|
+
if (trimmed === "session-report" || trimmed.startsWith("session-report ")) {
|
|
227
|
+
await handleSessionReport(trimmed.replace(/^session-report\s*/, "").trim(), ctx);
|
|
228
|
+
return true;
|
|
229
|
+
}
|
|
230
|
+
if (trimmed === "pr-branch" || trimmed.startsWith("pr-branch ")) {
|
|
231
|
+
await handlePrBranch(trimmed.replace(/^pr-branch\s*/, "").trim(), ctx);
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
if (trimmed === "add-tests" || trimmed.startsWith("add-tests ")) {
|
|
235
|
+
const { handleAddTests } = await import("../../commands-add-tests.js");
|
|
236
|
+
await handleAddTests(trimmed.replace(/^add-tests\s*/, "").trim(), ctx, pi);
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
219
239
|
return false;
|
|
220
240
|
}
|
|
@@ -38,6 +38,67 @@ const WORKFLOW_USAGE = [
|
|
|
38
38
|
" resume — Resume paused custom workflow auto-mode",
|
|
39
39
|
].join("\n");
|
|
40
40
|
|
|
41
|
+
function splitWorkflowRunArgs(input: string): string[] {
|
|
42
|
+
const tokens: string[] = [];
|
|
43
|
+
let current = "";
|
|
44
|
+
let quote: '"' | "'" | null = null;
|
|
45
|
+
let escapeNext = false;
|
|
46
|
+
|
|
47
|
+
for (const ch of input) {
|
|
48
|
+
if (escapeNext) {
|
|
49
|
+
current += ch;
|
|
50
|
+
escapeNext = false;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (ch === "\\") {
|
|
55
|
+
escapeNext = true;
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (quote) {
|
|
60
|
+
if (ch === quote) {
|
|
61
|
+
quote = null;
|
|
62
|
+
} else {
|
|
63
|
+
current += ch;
|
|
64
|
+
}
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (ch === '"' || ch === "'") {
|
|
69
|
+
quote = ch;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (/\s/.test(ch)) {
|
|
74
|
+
if (current) {
|
|
75
|
+
tokens.push(current);
|
|
76
|
+
current = "";
|
|
77
|
+
}
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
current += ch;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (escapeNext) current += "\\";
|
|
85
|
+
if (current) tokens.push(current);
|
|
86
|
+
return tokens;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function parseWorkflowRunArgs(args: string): { defName: string; overrides: Record<string, string> } {
|
|
90
|
+
const parts = splitWorkflowRunArgs(args);
|
|
91
|
+
const defName = parts[0] ?? "";
|
|
92
|
+
const overrides: Record<string, string> = {};
|
|
93
|
+
for (let i = 1; i < parts.length; i++) {
|
|
94
|
+
const eqIdx = parts[i].indexOf("=");
|
|
95
|
+
if (eqIdx > 0) {
|
|
96
|
+
overrides[parts[i].slice(0, eqIdx)] = parts[i].slice(eqIdx + 1);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return { defName, overrides };
|
|
100
|
+
}
|
|
101
|
+
|
|
41
102
|
async function handleCustomWorkflow(
|
|
42
103
|
sub: string,
|
|
43
104
|
ctx: ExtensionCommandContext,
|
|
@@ -62,15 +123,7 @@ async function handleCustomWorkflow(
|
|
|
62
123
|
ctx.ui.notify("Usage: /gsd workflow run <name> [param=value ...]", "warning");
|
|
63
124
|
return true;
|
|
64
125
|
}
|
|
65
|
-
const
|
|
66
|
-
const defName = parts[0];
|
|
67
|
-
const overrides: Record<string, string> = {};
|
|
68
|
-
for (let i = 1; i < parts.length; i++) {
|
|
69
|
-
const eqIdx = parts[i].indexOf("=");
|
|
70
|
-
if (eqIdx > 0) {
|
|
71
|
-
overrides[parts[i].slice(0, eqIdx)] = parts[i].slice(eqIdx + 1);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
126
|
+
const { defName, overrides } = parseWorkflowRunArgs(args);
|
|
74
127
|
try {
|
|
75
128
|
const base = projectRoot();
|
|
76
129
|
const runDir = createRun(base, defName, Object.keys(overrides).length > 0 ? overrides : undefined);
|
|
@@ -168,6 +221,18 @@ async function handleCustomWorkflow(
|
|
|
168
221
|
}
|
|
169
222
|
|
|
170
223
|
export async function handleWorkflowCommand(trimmed: string, ctx: ExtensionCommandContext, pi: ExtensionAPI): Promise<boolean> {
|
|
224
|
+
// ── /gsd do — natural language routing (must be early to route to other commands) ──
|
|
225
|
+
if (trimmed === "do" || trimmed.startsWith("do ")) {
|
|
226
|
+
const { handleDo } = await import("../../commands-do.js");
|
|
227
|
+
await handleDo(trimmed.replace(/^do\s*/, "").trim(), ctx, pi);
|
|
228
|
+
return true;
|
|
229
|
+
}
|
|
230
|
+
// ── Backlog management ──
|
|
231
|
+
if (trimmed === "backlog" || trimmed.startsWith("backlog ")) {
|
|
232
|
+
const { handleBacklog } = await import("../../commands-backlog.js");
|
|
233
|
+
await handleBacklog(trimmed.replace(/^backlog\s*/, "").trim(), ctx, pi);
|
|
234
|
+
return true;
|
|
235
|
+
}
|
|
171
236
|
// ── Custom workflow commands (`/gsd workflow ...`) ──
|
|
172
237
|
if (trimmed === "workflow" || trimmed.startsWith("workflow ")) {
|
|
173
238
|
const sub = trimmed.slice("workflow".length).trim();
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GSD Command — /gsd add-tests
|
|
3
|
+
*
|
|
4
|
+
* Generates tests for a completed slice by dispatching an LLM prompt
|
|
5
|
+
* with implementation context (summaries, changed files, test patterns).
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { ExtensionAPI, ExtensionCommandContext } from "@gsd/pi-coding-agent";
|
|
9
|
+
|
|
10
|
+
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
11
|
+
import { join } from "node:path";
|
|
12
|
+
|
|
13
|
+
import { deriveState } from "./state.js";
|
|
14
|
+
import { gsdRoot, resolveSliceFile } from "./paths.js";
|
|
15
|
+
import { loadPrompt } from "./prompt-loader.js";
|
|
16
|
+
|
|
17
|
+
function findLastCompletedSlice(basePath: string, milestoneId: string): string | null {
|
|
18
|
+
// Scan disk for slices that have a SUMMARY.md (indicating completion)
|
|
19
|
+
const slicesDir = join(gsdRoot(basePath), "milestones", milestoneId, "slices");
|
|
20
|
+
if (!existsSync(slicesDir)) return null;
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
const entries = readdirSync(slicesDir, { withFileTypes: true })
|
|
24
|
+
.filter((e) => e.isDirectory() && /^S\d+$/.test(e.name))
|
|
25
|
+
.sort((a, b) => b.name.localeCompare(a.name)); // reverse order — latest first
|
|
26
|
+
|
|
27
|
+
for (const entry of entries) {
|
|
28
|
+
const summaryPath = join(slicesDir, entry.name, `${entry.name}-SUMMARY.md`);
|
|
29
|
+
if (existsSync(summaryPath)) return entry.name;
|
|
30
|
+
}
|
|
31
|
+
} catch {
|
|
32
|
+
// non-fatal
|
|
33
|
+
}
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function readSliceSummary(basePath: string, milestoneId: string, sliceId: string): { title: string; content: string } {
|
|
38
|
+
const summaryPath = resolveSliceFile(basePath, milestoneId, sliceId, "SUMMARY");
|
|
39
|
+
if (summaryPath && existsSync(summaryPath)) {
|
|
40
|
+
const content = readFileSync(summaryPath, "utf-8");
|
|
41
|
+
const titleMatch = content.match(/^#\s+(.+)/m);
|
|
42
|
+
return { title: titleMatch?.[1] ?? sliceId, content };
|
|
43
|
+
}
|
|
44
|
+
return { title: sliceId, content: "(no summary available)" };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function detectTestPatterns(basePath: string): string {
|
|
48
|
+
const patterns: string[] = [];
|
|
49
|
+
|
|
50
|
+
// Check for common test configs
|
|
51
|
+
const checks = [
|
|
52
|
+
{ file: "jest.config.ts", name: "Jest" },
|
|
53
|
+
{ file: "jest.config.js", name: "Jest" },
|
|
54
|
+
{ file: "vitest.config.ts", name: "Vitest" },
|
|
55
|
+
{ file: "vitest.config.js", name: "Vitest" },
|
|
56
|
+
{ file: ".mocharc.yml", name: "Mocha" },
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
for (const check of checks) {
|
|
60
|
+
if (existsSync(join(basePath, check.file))) {
|
|
61
|
+
patterns.push(`Framework: ${check.name} (${check.file})`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Look for existing test files to infer patterns
|
|
66
|
+
const testDirs = ["tests", "test", "src/__tests__", "__tests__"];
|
|
67
|
+
for (const dir of testDirs) {
|
|
68
|
+
const fullDir = join(basePath, dir);
|
|
69
|
+
if (existsSync(fullDir)) {
|
|
70
|
+
try {
|
|
71
|
+
const files = readdirSync(fullDir).filter((f) => f.endsWith(".test.ts") || f.endsWith(".spec.ts") || f.endsWith(".test.js"));
|
|
72
|
+
if (files.length > 0) {
|
|
73
|
+
patterns.push(`Test directory: ${dir}/ (${files.length} test files)`);
|
|
74
|
+
// Read first test file for patterns
|
|
75
|
+
const samplePath = join(fullDir, files[0]);
|
|
76
|
+
const sample = readFileSync(samplePath, "utf-8").slice(0, 500);
|
|
77
|
+
patterns.push(`Sample pattern from ${files[0]}:\n${sample}`);
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
} catch {
|
|
81
|
+
// non-fatal
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return patterns.length > 0 ? patterns.join("\n") : "No test framework detected. Use Node.js built-in test runner.";
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export async function handleAddTests(
|
|
90
|
+
args: string,
|
|
91
|
+
ctx: ExtensionCommandContext,
|
|
92
|
+
pi: ExtensionAPI,
|
|
93
|
+
): Promise<void> {
|
|
94
|
+
const basePath = process.cwd();
|
|
95
|
+
const state = await deriveState(basePath);
|
|
96
|
+
|
|
97
|
+
if (!state.activeMilestone) {
|
|
98
|
+
ctx.ui.notify("No active milestone.", "warning");
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const milestoneId = state.activeMilestone.id;
|
|
103
|
+
|
|
104
|
+
// Determine target
|
|
105
|
+
const targetId = args.trim() || findLastCompletedSlice(basePath, milestoneId);
|
|
106
|
+
if (!targetId) {
|
|
107
|
+
ctx.ui.notify(
|
|
108
|
+
"No completed slices found. Specify a slice ID: /gsd add-tests S03",
|
|
109
|
+
"warning",
|
|
110
|
+
);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Gather context
|
|
115
|
+
const summary = readSliceSummary(basePath, milestoneId, targetId);
|
|
116
|
+
const testPatterns = detectTestPatterns(basePath);
|
|
117
|
+
|
|
118
|
+
ctx.ui.notify(`Generating tests for ${targetId}: "${summary.title}"...`, "info");
|
|
119
|
+
|
|
120
|
+
try {
|
|
121
|
+
const prompt = loadPrompt("add-tests", {
|
|
122
|
+
sliceId: targetId,
|
|
123
|
+
sliceTitle: summary.title,
|
|
124
|
+
sliceSummary: summary.content,
|
|
125
|
+
existingTestPatterns: testPatterns,
|
|
126
|
+
workingDirectory: basePath,
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
pi.sendMessage(
|
|
130
|
+
{ customType: "gsd-add-tests", content: prompt, display: false },
|
|
131
|
+
{ triggerTurn: true },
|
|
132
|
+
);
|
|
133
|
+
} catch (err) {
|
|
134
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
135
|
+
ctx.ui.notify(`Failed to dispatch test generation: ${msg}`, "error");
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GSD Command — /gsd backlog
|
|
3
|
+
*
|
|
4
|
+
* Structured backlog management with 999.x numbering.
|
|
5
|
+
* Items stored in .gsd/BACKLOG.md as markdown checklist.
|
|
6
|
+
* Items can be promoted to active slices via add-slice.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { ExtensionAPI, ExtensionCommandContext } from "@gsd/pi-coding-agent";
|
|
10
|
+
|
|
11
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
|
|
12
|
+
import { join, dirname } from "node:path";
|
|
13
|
+
|
|
14
|
+
import { gsdRoot } from "./paths.js";
|
|
15
|
+
|
|
16
|
+
interface BacklogItem {
|
|
17
|
+
id: string;
|
|
18
|
+
title: string;
|
|
19
|
+
done: boolean;
|
|
20
|
+
note: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function backlogPath(basePath: string): string {
|
|
24
|
+
return join(gsdRoot(basePath), "BACKLOG.md");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function parseBacklog(basePath: string): BacklogItem[] {
|
|
28
|
+
const filePath = backlogPath(basePath);
|
|
29
|
+
if (!existsSync(filePath)) return [];
|
|
30
|
+
|
|
31
|
+
const content = readFileSync(filePath, "utf-8");
|
|
32
|
+
const items: BacklogItem[] = [];
|
|
33
|
+
|
|
34
|
+
for (const line of content.split("\n")) {
|
|
35
|
+
const match = line.match(/^- \[([ x])\] (999\.\d+) — (.+?)(?:\s*\((.+)\))?$/);
|
|
36
|
+
if (match) {
|
|
37
|
+
items.push({
|
|
38
|
+
id: match[2],
|
|
39
|
+
title: match[3].trim(),
|
|
40
|
+
done: match[1] === "x",
|
|
41
|
+
note: match[4] ?? "",
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return items;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function writeBacklog(basePath: string, items: BacklogItem[]): void {
|
|
50
|
+
const filePath = backlogPath(basePath);
|
|
51
|
+
mkdirSync(dirname(filePath), { recursive: true });
|
|
52
|
+
const lines = ["# Backlog\n"];
|
|
53
|
+
for (const item of items) {
|
|
54
|
+
const check = item.done ? "x" : " ";
|
|
55
|
+
const note = item.note ? ` (${item.note})` : "";
|
|
56
|
+
lines.push(`- [${check}] ${item.id} — ${item.title}${note}`);
|
|
57
|
+
}
|
|
58
|
+
lines.push(""); // trailing newline
|
|
59
|
+
writeFileSync(filePath, lines.join("\n"), "utf-8");
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function nextBacklogId(items: BacklogItem[]): string {
|
|
63
|
+
let maxNum = 0;
|
|
64
|
+
for (const item of items) {
|
|
65
|
+
const match = item.id.match(/^999\.(\d+)$/);
|
|
66
|
+
if (match) {
|
|
67
|
+
const num = parseInt(match[1], 10);
|
|
68
|
+
if (num > maxNum) maxNum = num;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return `999.${maxNum + 1}`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async function listBacklog(basePath: string, ctx: ExtensionCommandContext): Promise<void> {
|
|
75
|
+
const items = parseBacklog(basePath);
|
|
76
|
+
if (items.length === 0) {
|
|
77
|
+
ctx.ui.notify("Backlog is empty. Add items with /gsd backlog add <title>", "info");
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const lines = ["Backlog:\n"];
|
|
82
|
+
for (const item of items) {
|
|
83
|
+
const status = item.done ? "✓" : "○";
|
|
84
|
+
const note = item.note ? ` (${item.note})` : "";
|
|
85
|
+
lines.push(` ${status} ${item.id} — ${item.title}${note}`);
|
|
86
|
+
}
|
|
87
|
+
const pending = items.filter((i) => !i.done).length;
|
|
88
|
+
lines.push(`\n${pending} pending, ${items.length - pending} promoted/done`);
|
|
89
|
+
ctx.ui.notify(lines.join("\n"), "info");
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
async function addBacklogItem(basePath: string, title: string, ctx: ExtensionCommandContext): Promise<void> {
|
|
93
|
+
if (!title) {
|
|
94
|
+
ctx.ui.notify("Usage: /gsd backlog add <title>", "warning");
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const items = parseBacklog(basePath);
|
|
99
|
+
const id = nextBacklogId(items);
|
|
100
|
+
const date = new Date().toISOString().slice(0, 10);
|
|
101
|
+
|
|
102
|
+
items.push({ id, title: title.replace(/^['"]|['"]$/g, ""), done: false, note: `added ${date}` });
|
|
103
|
+
writeBacklog(basePath, items);
|
|
104
|
+
|
|
105
|
+
ctx.ui.notify(`Added ${id}: "${title}"`, "success");
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
async function promoteBacklogItem(
|
|
109
|
+
basePath: string,
|
|
110
|
+
itemId: string,
|
|
111
|
+
ctx: ExtensionCommandContext,
|
|
112
|
+
pi: ExtensionAPI,
|
|
113
|
+
): Promise<void> {
|
|
114
|
+
if (!itemId) {
|
|
115
|
+
ctx.ui.notify("Usage: /gsd backlog promote <id>\nExample: /gsd backlog promote 999.1", "warning");
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const items = parseBacklog(basePath);
|
|
120
|
+
const item = items.find((i) => i.id === itemId);
|
|
121
|
+
|
|
122
|
+
if (!item) {
|
|
123
|
+
ctx.ui.notify(`Backlog item ${itemId} not found.`, "warning");
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (item.done) {
|
|
128
|
+
ctx.ui.notify(`${itemId} is already promoted/done.`, "info");
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Promote — currently requires single-writer engine (not yet available)
|
|
133
|
+
// Mark as promoted in backlog for now; slice creation will be available with the engine.
|
|
134
|
+
item.done = true;
|
|
135
|
+
item.note = `promoted ${new Date().toISOString().slice(0, 10)}`;
|
|
136
|
+
writeBacklog(basePath, items);
|
|
137
|
+
ctx.ui.notify(`Promoted ${itemId}: "${item.title}" — add it to the roadmap manually or wait for engine slice commands.`, "info");
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
async function removeBacklogItem(basePath: string, itemId: string, ctx: ExtensionCommandContext): Promise<void> {
|
|
141
|
+
if (!itemId) {
|
|
142
|
+
ctx.ui.notify("Usage: /gsd backlog remove <id>", "warning");
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const items = parseBacklog(basePath);
|
|
147
|
+
const idx = items.findIndex((i) => i.id === itemId);
|
|
148
|
+
|
|
149
|
+
if (idx === -1) {
|
|
150
|
+
ctx.ui.notify(`Backlog item ${itemId} not found.`, "warning");
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const removed = items.splice(idx, 1)[0];
|
|
155
|
+
writeBacklog(basePath, items);
|
|
156
|
+
ctx.ui.notify(`Removed ${removed.id}: "${removed.title}"`, "success");
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export async function handleBacklog(
|
|
160
|
+
args: string,
|
|
161
|
+
ctx: ExtensionCommandContext,
|
|
162
|
+
pi: ExtensionAPI,
|
|
163
|
+
): Promise<void> {
|
|
164
|
+
const basePath = process.cwd();
|
|
165
|
+
const parts = args.trim().split(/\s+/);
|
|
166
|
+
const sub = parts[0] ?? "";
|
|
167
|
+
const rest = parts.slice(1).join(" ");
|
|
168
|
+
|
|
169
|
+
switch (sub) {
|
|
170
|
+
case "":
|
|
171
|
+
return listBacklog(basePath, ctx);
|
|
172
|
+
case "add":
|
|
173
|
+
return addBacklogItem(basePath, rest, ctx);
|
|
174
|
+
case "promote":
|
|
175
|
+
return promoteBacklogItem(basePath, rest.trim(), ctx, pi);
|
|
176
|
+
case "remove":
|
|
177
|
+
return removeBacklogItem(basePath, rest.trim(), ctx);
|
|
178
|
+
default:
|
|
179
|
+
// Treat as implicit add
|
|
180
|
+
return addBacklogItem(basePath, args, ctx);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GSD Command — /gsd do
|
|
3
|
+
*
|
|
4
|
+
* Routes freeform natural language to the correct /gsd subcommand
|
|
5
|
+
* using keyword matching. Falls back to /gsd quick for task-like input.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { ExtensionAPI, ExtensionCommandContext } from "@gsd/pi-coding-agent";
|
|
9
|
+
|
|
10
|
+
interface Route {
|
|
11
|
+
keywords: string[];
|
|
12
|
+
command: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const ROUTES: Route[] = [
|
|
16
|
+
{ keywords: ["progress", "status", "dashboard", "how far", "where are we"], command: "status" },
|
|
17
|
+
{ keywords: ["auto", "autonomous", "run all", "keep going", "start auto"], command: "auto" },
|
|
18
|
+
{ keywords: ["stop", "halt", "abort"], command: "stop" },
|
|
19
|
+
{ keywords: ["pause", "break", "take a break"], command: "pause" },
|
|
20
|
+
{ keywords: ["history", "past", "what happened", "previous"], command: "history" },
|
|
21
|
+
{ keywords: ["doctor", "health", "diagnose", "check health"], command: "doctor" },
|
|
22
|
+
{ keywords: ["clean up", "cleanup", "remove old", "prune", "tidy"], command: "cleanup" },
|
|
23
|
+
{ keywords: ["export", "report", "share results"], command: "export" },
|
|
24
|
+
{ keywords: ["ship", "pull request", "create pr", "open pr", "merge"], command: "ship" },
|
|
25
|
+
{ keywords: ["discuss", "talk about", "architecture", "design"], command: "discuss" },
|
|
26
|
+
{ keywords: ["undo", "revert", "rollback", "take back"], command: "undo" },
|
|
27
|
+
{ keywords: ["skip", "skip task", "skip this"], command: "skip" },
|
|
28
|
+
{ keywords: ["queue", "reorder", "milestone order", "order milestones"], command: "queue" },
|
|
29
|
+
{ keywords: ["visualize", "viz", "graph", "chart", "show graph"], command: "visualize" },
|
|
30
|
+
{ keywords: ["capture", "note", "idea", "thought", "remember"], command: "capture" },
|
|
31
|
+
{ keywords: ["inspect", "database", "sqlite", "db state"], command: "inspect" },
|
|
32
|
+
{ keywords: ["knowledge", "rule", "pattern", "lesson"], command: "knowledge" },
|
|
33
|
+
{ keywords: ["session report", "session summary", "cost summary", "how much"], command: "session-report" },
|
|
34
|
+
{ keywords: ["backlog", "parking lot", "later", "someday"], command: "backlog" },
|
|
35
|
+
{ keywords: ["pr branch", "clean branch", "filter commits"], command: "pr-branch" },
|
|
36
|
+
{ keywords: ["add tests", "write tests", "generate tests", "test coverage"], command: "add-tests" },
|
|
37
|
+
{ keywords: ["next", "step", "next step", "what's next"], command: "next" },
|
|
38
|
+
{ keywords: ["migrate", "migration", "convert", "upgrade"], command: "migrate" },
|
|
39
|
+
{ keywords: ["steer", "change direction", "pivot", "redirect"], command: "steer" },
|
|
40
|
+
{ keywords: ["park", "shelve", "set aside"], command: "park" },
|
|
41
|
+
{ keywords: ["widget", "toggle widget"], command: "widget" },
|
|
42
|
+
{ keywords: ["logs", "debug logs", "log files"], command: "logs" },
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
interface MatchResult {
|
|
46
|
+
command: string;
|
|
47
|
+
remainingArgs: string;
|
|
48
|
+
score: number;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function matchRoute(input: string): MatchResult | null {
|
|
52
|
+
const lower = input.toLowerCase();
|
|
53
|
+
let bestMatch: MatchResult | null = null;
|
|
54
|
+
|
|
55
|
+
for (const route of ROUTES) {
|
|
56
|
+
for (const keyword of route.keywords) {
|
|
57
|
+
if (lower.includes(keyword)) {
|
|
58
|
+
const score = keyword.length; // Longer match = higher confidence
|
|
59
|
+
if (!bestMatch || score > bestMatch.score) {
|
|
60
|
+
// Strip the matched keyword from input to get remaining args
|
|
61
|
+
const idx = lower.indexOf(keyword);
|
|
62
|
+
const remaining = (input.slice(0, idx) + input.slice(idx + keyword.length)).trim();
|
|
63
|
+
bestMatch = { command: route.command, remainingArgs: remaining, score };
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return bestMatch;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export async function handleDo(
|
|
73
|
+
args: string,
|
|
74
|
+
ctx: ExtensionCommandContext,
|
|
75
|
+
pi: ExtensionAPI,
|
|
76
|
+
): Promise<void> {
|
|
77
|
+
if (!args.trim()) {
|
|
78
|
+
ctx.ui.notify(
|
|
79
|
+
"Usage: /gsd do <what you want to do>\n\n" +
|
|
80
|
+
"Examples:\n" +
|
|
81
|
+
" /gsd do show me progress\n" +
|
|
82
|
+
" /gsd do run autonomously\n" +
|
|
83
|
+
" /gsd do clean up old branches\n" +
|
|
84
|
+
" /gsd do fix the login bug",
|
|
85
|
+
"warning",
|
|
86
|
+
);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const match = matchRoute(args);
|
|
91
|
+
|
|
92
|
+
if (match) {
|
|
93
|
+
const fullCommand = match.remainingArgs
|
|
94
|
+
? `${match.command} ${match.remainingArgs}`
|
|
95
|
+
: match.command;
|
|
96
|
+
|
|
97
|
+
ctx.ui.notify(`→ /gsd ${fullCommand}`, "info");
|
|
98
|
+
|
|
99
|
+
// Re-dispatch through the main dispatcher
|
|
100
|
+
const { handleGSDCommand } = await import("./commands/dispatcher.js");
|
|
101
|
+
await handleGSDCommand(fullCommand, ctx, pi);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// No keyword match → treat as quick task
|
|
106
|
+
ctx.ui.notify(`→ /gsd quick ${args}`, "info");
|
|
107
|
+
const { handleQuick } = await import("./quick.js");
|
|
108
|
+
await handleQuick(args, ctx, pi);
|
|
109
|
+
}
|
|
@@ -28,6 +28,11 @@ import { loadPrompt } from "./prompt-loader.js";
|
|
|
28
28
|
const UPDATE_REGISTRY_URL = "https://registry.npmjs.org/gsd-pi/latest";
|
|
29
29
|
const UPDATE_FETCH_TIMEOUT_MS = 5000;
|
|
30
30
|
|
|
31
|
+
function resolveInstallCommand(pkg: string): string {
|
|
32
|
+
if ('bun' in process.versions) return `bun add -g ${pkg}`;
|
|
33
|
+
return `npm install -g ${pkg}`;
|
|
34
|
+
}
|
|
35
|
+
|
|
31
36
|
async function fetchLatestVersionForCommand(): Promise<string | null> {
|
|
32
37
|
const controller = new AbortController();
|
|
33
38
|
const timeout = setTimeout(() => controller.abort(), UPDATE_FETCH_TIMEOUT_MS);
|
|
@@ -431,8 +436,9 @@ export async function handleUpdate(ctx: ExtensionCommandContext): Promise<void>
|
|
|
431
436
|
|
|
432
437
|
ctx.ui.notify(`Updating: v${current} → v${latest}...`, "info");
|
|
433
438
|
|
|
439
|
+
const installCmd = resolveInstallCommand(`${NPM_PACKAGE}@latest`);
|
|
434
440
|
try {
|
|
435
|
-
execSync(
|
|
441
|
+
execSync(installCmd, {
|
|
436
442
|
stdio: ["ignore", "pipe", "ignore"],
|
|
437
443
|
});
|
|
438
444
|
ctx.ui.notify(
|
|
@@ -441,7 +447,7 @@ export async function handleUpdate(ctx: ExtensionCommandContext): Promise<void>
|
|
|
441
447
|
);
|
|
442
448
|
} catch {
|
|
443
449
|
ctx.ui.notify(
|
|
444
|
-
`Update failed. Try manually:
|
|
450
|
+
`Update failed. Try manually: ${installCmd}`,
|
|
445
451
|
"error",
|
|
446
452
|
);
|
|
447
453
|
}
|
|
@@ -488,7 +488,7 @@ export async function handleCleanupProjects(args: string, ctx: ExtensionCommandC
|
|
|
488
488
|
* Prints counts of recovered items and the resulting project phase.
|
|
489
489
|
*/
|
|
490
490
|
export async function handleRecover(ctx: ExtensionCommandContext, basePath: string): Promise<void> {
|
|
491
|
-
const { isDbAvailable: dbAvailable,
|
|
491
|
+
const { isDbAvailable: dbAvailable, clearEngineHierarchy, transaction: dbTransaction } = await import("./gsd-db.js");
|
|
492
492
|
const { migrateHierarchyToDb } = await import("./md-importer.js");
|
|
493
493
|
const { invalidateStateCache } = await import("./state.js");
|
|
494
494
|
|
|
@@ -498,12 +498,12 @@ export async function handleRecover(ctx: ExtensionCommandContext, basePath: stri
|
|
|
498
498
|
}
|
|
499
499
|
|
|
500
500
|
try {
|
|
501
|
-
// 1. Delete + re-populate inside a single transaction for atomicity
|
|
502
|
-
|
|
501
|
+
// 1. Delete + re-populate inside a single transaction for atomicity.
|
|
502
|
+
// clearEngineHierarchy() uses transaction() internally but transaction()
|
|
503
|
+
// is re-entrant, so wrapping in dbTransaction() keeps the whole
|
|
504
|
+
// clear+repopulate atomic.
|
|
503
505
|
const counts = dbTransaction(() => {
|
|
504
|
-
|
|
505
|
-
db.exec("DELETE FROM slices");
|
|
506
|
-
db.exec("DELETE FROM milestones");
|
|
506
|
+
clearEngineHierarchy();
|
|
507
507
|
return migrateHierarchyToDb(basePath);
|
|
508
508
|
});
|
|
509
509
|
|