gsd-pi 2.74.0 → 2.75.0-dev.063e5a3
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.js +85 -0
- package/dist/headless-query.js +4 -1
- package/dist/help-text.js +23 -0
- package/dist/resources/extensions/gsd/activity-log.js +16 -0
- package/dist/resources/extensions/gsd/auto/detect-stuck.js +11 -4
- package/dist/resources/extensions/gsd/auto/loop.js +147 -10
- package/dist/resources/extensions/gsd/auto/phases.js +209 -10
- package/dist/resources/extensions/gsd/auto/session.js +10 -0
- package/dist/resources/extensions/gsd/auto-dispatch.js +11 -1
- package/dist/resources/extensions/gsd/auto-model-selection.js +54 -8
- package/dist/resources/extensions/gsd/auto-post-unit.js +220 -17
- package/dist/resources/extensions/gsd/auto-prompts.js +12 -0
- package/dist/resources/extensions/gsd/auto-recovery.js +24 -10
- package/dist/resources/extensions/gsd/auto-unit-closeout.js +18 -0
- package/dist/resources/extensions/gsd/auto-verification.js +100 -2
- package/dist/resources/extensions/gsd/auto-worktree.js +2 -0
- package/dist/resources/extensions/gsd/auto.js +36 -4
- package/dist/resources/extensions/gsd/bootstrap/provider-error-resume.js +5 -3
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +30 -8
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +61 -9
- package/dist/resources/extensions/gsd/cache.js +16 -5
- package/dist/resources/extensions/gsd/commands/catalog.js +31 -1
- package/dist/resources/extensions/gsd/commands/handlers/core.js +5 -1
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +25 -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-extract-learnings.js +225 -0
- 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-prefs-wizard.js +51 -4
- 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 +16 -1
- package/dist/resources/extensions/gsd/ecosystem/gsd-extension-api.js +144 -0
- package/dist/resources/extensions/gsd/ecosystem/loader.js +145 -0
- package/dist/resources/extensions/gsd/git-service.js +49 -1
- package/dist/resources/extensions/gsd/graph-context.js +157 -0
- package/dist/resources/extensions/gsd/gsd-db.js +581 -2
- package/dist/resources/extensions/gsd/guided-flow.js +31 -6
- package/dist/resources/extensions/gsd/index.js +15 -2
- package/dist/resources/extensions/gsd/init-wizard.js +1 -0
- package/dist/resources/extensions/gsd/journal.js +27 -0
- 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/metrics.js +19 -0
- 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/parallel-orchestrator.js +33 -1
- package/dist/resources/extensions/gsd/preferences-models.js +20 -3
- package/dist/resources/extensions/gsd/preferences-types.js +2 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +118 -2
- package/dist/resources/extensions/gsd/preferences.js +31 -0
- package/dist/resources/extensions/gsd/prompts/add-tests.md +35 -0
- package/dist/resources/extensions/gsd/safety/evidence-collector.js +15 -30
- package/dist/resources/extensions/gsd/slice-parallel-orchestrator.js +12 -2
- package/dist/resources/extensions/gsd/state.js +5 -1
- package/dist/resources/extensions/gsd/templates/PREFERENCES.md +19 -0
- package/dist/resources/extensions/gsd/tools/complete-slice.js +20 -0
- package/dist/resources/extensions/gsd/tools/validate-milestone.js +39 -4
- 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/unit-ownership.js +1 -1
- package/dist/resources/extensions/gsd/uok/audit-toggle.js +7 -0
- package/dist/resources/extensions/gsd/uok/audit.js +40 -0
- package/dist/resources/extensions/gsd/uok/contracts.js +1 -0
- package/dist/resources/extensions/gsd/uok/execution-graph.js +179 -0
- package/dist/resources/extensions/gsd/uok/flags.js +29 -0
- package/dist/resources/extensions/gsd/uok/gate-runner.js +109 -0
- package/dist/resources/extensions/gsd/uok/gitops.js +53 -0
- package/dist/resources/extensions/gsd/uok/kernel.js +80 -0
- package/dist/resources/extensions/gsd/uok/loop-adapter.js +133 -0
- package/dist/resources/extensions/gsd/uok/model-policy.js +66 -0
- package/dist/resources/extensions/gsd/uok/plan-v2.js +132 -0
- package/dist/resources/extensions/gsd/workflow-logger.js +22 -0
- 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/resources/extensions/ttsr/ttsr-manager.js +3 -1
- package/dist/tsconfig.extensions.tsbuildinfo +1 -0
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +13 -13
- 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 +13 -13
- package/dist/web/standalone/.next/server/chunks/63.js +3 -3
- package/dist/web/standalone/.next/server/chunks/6897.js +3 -3
- 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 -2
- 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 +655 -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/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +88 -6
- package/packages/mcp-server/dist/workflow-tools.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 +604 -0
- package/packages/mcp-server/src/readers/graph.ts +855 -0
- package/packages/mcp-server/src/readers/index.ts +12 -0
- package/packages/mcp-server/src/server.ts +83 -0
- package/packages/mcp-server/src/workflow-tools.ts +95 -10
- 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 -9
- package/packages/pi-ai/dist/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/index.js +1 -9
- package/packages/pi-ai/dist/index.js.map +1 -1
- package/packages/pi-ai/dist/models/capability-patches.d.ts +19 -0
- package/packages/pi-ai/dist/models/capability-patches.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/capability-patches.js +36 -0
- package/packages/pi-ai/dist/models/capability-patches.js.map +1 -0
- package/packages/pi-ai/dist/{models.custom.d.ts → models/custom.d.ts} +1 -1
- package/packages/pi-ai/dist/models/custom.d.ts.map +1 -0
- package/packages/pi-ai/dist/{models.custom.js → models/custom.js} +4 -4
- package/packages/pi-ai/dist/models/custom.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.d.ts +1482 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.js +1484 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/anthropic.d.ts +377 -0
- package/packages/pi-ai/dist/models/generated/anthropic.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/anthropic.js +379 -0
- package/packages/pi-ai/dist/models/generated/anthropic.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/azure-openai-responses.d.ts +700 -0
- package/packages/pi-ai/dist/models/generated/azure-openai-responses.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/azure-openai-responses.js +702 -0
- package/packages/pi-ai/dist/models/generated/azure-openai-responses.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/cerebras.d.ts +71 -0
- package/packages/pi-ai/dist/models/generated/cerebras.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/cerebras.js +73 -0
- package/packages/pi-ai/dist/models/generated/cerebras.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/github-copilot.d.ts +590 -0
- package/packages/pi-ai/dist/models/generated/github-copilot.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/github-copilot.js +444 -0
- package/packages/pi-ai/dist/models/generated/github-copilot.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.d.ts +156 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.js +158 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/google-gemini-cli.d.ts +105 -0
- package/packages/pi-ai/dist/models/generated/google-gemini-cli.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/google-gemini-cli.js +107 -0
- package/packages/pi-ai/dist/models/generated/google-gemini-cli.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/google-vertex.d.ts +207 -0
- package/packages/pi-ai/dist/models/generated/google-vertex.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/google-vertex.js +209 -0
- package/packages/pi-ai/dist/models/generated/google-vertex.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/google.d.ts +462 -0
- package/packages/pi-ai/dist/models/generated/google.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/google.js +464 -0
- package/packages/pi-ai/dist/models/generated/google.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/groq.d.ts +309 -0
- package/packages/pi-ai/dist/models/generated/groq.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/groq.js +311 -0
- package/packages/pi-ai/dist/models/generated/groq.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/huggingface.d.ts +383 -0
- package/packages/pi-ai/dist/models/generated/huggingface.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/huggingface.js +347 -0
- package/packages/pi-ai/dist/models/generated/huggingface.js.map +1 -0
- package/packages/pi-ai/dist/{models.generated.d.ts → models/generated/index.d.ts} +1 -1
- package/packages/pi-ai/dist/{models.generated.d.ts.map → models/generated/index.d.ts.map} +1 -1
- package/packages/pi-ai/dist/models/generated/index.js +51 -0
- package/packages/pi-ai/dist/models/generated/index.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/kimi-coding.d.ts +37 -0
- package/packages/pi-ai/dist/models/generated/kimi-coding.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/kimi-coding.js +39 -0
- package/packages/pi-ai/dist/models/generated/kimi-coding.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/minimax-cn.d.ts +105 -0
- package/packages/pi-ai/dist/models/generated/minimax-cn.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/minimax-cn.js +107 -0
- package/packages/pi-ai/dist/models/generated/minimax-cn.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/minimax.d.ts +105 -0
- package/packages/pi-ai/dist/models/generated/minimax.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/minimax.js +107 -0
- package/packages/pi-ai/dist/models/generated/minimax.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/mistral.d.ts +445 -0
- package/packages/pi-ai/dist/models/generated/mistral.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/mistral.js +447 -0
- package/packages/pi-ai/dist/models/generated/mistral.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.d.ts +139 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.js +141 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/openai.d.ts +700 -0
- package/packages/pi-ai/dist/models/generated/openai.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/openai.js +702 -0
- package/packages/pi-ai/dist/models/generated/openai.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/opencode-go.d.ts +122 -0
- package/packages/pi-ai/dist/models/generated/opencode-go.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/opencode-go.js +124 -0
- package/packages/pi-ai/dist/models/generated/opencode-go.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/opencode.d.ts +530 -0
- package/packages/pi-ai/dist/models/generated/opencode.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/opencode.js +532 -0
- package/packages/pi-ai/dist/models/generated/opencode.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/openrouter.d.ts +4270 -0
- package/packages/pi-ai/dist/models/generated/openrouter.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/openrouter.js +4272 -0
- package/packages/pi-ai/dist/models/generated/openrouter.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/vercel-ai-gateway.d.ts +2604 -0
- package/packages/pi-ai/dist/models/generated/vercel-ai-gateway.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/vercel-ai-gateway.js +2606 -0
- package/packages/pi-ai/dist/models/generated/vercel-ai-gateway.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/xai.d.ts +411 -0
- package/packages/pi-ai/dist/models/generated/xai.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/xai.js +413 -0
- package/packages/pi-ai/dist/models/generated/xai.js.map +1 -0
- package/packages/pi-ai/dist/models/generated/zai.d.ts +276 -0
- package/packages/pi-ai/dist/models/generated/zai.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/generated/zai.js +239 -0
- package/packages/pi-ai/dist/models/generated/zai.js.map +1 -0
- package/packages/pi-ai/dist/models/index.d.ts +27 -0
- package/packages/pi-ai/dist/models/index.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/index.js +80 -0
- package/packages/pi-ai/dist/models/index.js.map +1 -0
- package/packages/pi-ai/dist/models.d.ts +1 -36
- package/packages/pi-ai/dist/models.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.test.js +1 -2
- package/packages/pi-ai/dist/models.generated.test.js.map +1 -1
- package/packages/pi-ai/dist/models.js +3 -112
- package/packages/pi-ai/dist/models.js.map +1 -1
- package/packages/pi-ai/dist/models.test.js +6 -5
- package/packages/pi-ai/dist/models.test.js.map +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-ai/scripts/generate-models.ts +74 -40
- package/packages/pi-ai/src/index.ts +1 -9
- package/packages/pi-ai/src/models/capability-patches.ts +40 -0
- package/packages/pi-ai/src/{models.custom.ts → models/custom.ts} +4 -4
- package/packages/pi-ai/src/models/generated/amazon-bedrock.ts +1486 -0
- package/packages/pi-ai/src/models/generated/anthropic.ts +381 -0
- package/packages/pi-ai/src/models/generated/azure-openai-responses.ts +704 -0
- package/packages/pi-ai/src/models/generated/cerebras.ts +75 -0
- package/packages/pi-ai/src/models/generated/github-copilot.ts +446 -0
- package/packages/pi-ai/src/models/generated/google-antigravity.ts +160 -0
- package/packages/pi-ai/src/models/generated/google-gemini-cli.ts +109 -0
- package/packages/pi-ai/src/models/generated/google-vertex.ts +211 -0
- package/packages/pi-ai/src/models/generated/google.ts +466 -0
- package/packages/pi-ai/src/models/generated/groq.ts +313 -0
- package/packages/pi-ai/src/models/generated/huggingface.ts +349 -0
- package/packages/pi-ai/src/models/generated/index.ts +52 -0
- package/packages/pi-ai/src/models/generated/kimi-coding.ts +41 -0
- package/packages/pi-ai/src/models/generated/minimax-cn.ts +109 -0
- package/packages/pi-ai/src/models/generated/minimax.ts +109 -0
- package/packages/pi-ai/src/models/generated/mistral.ts +449 -0
- package/packages/pi-ai/src/models/generated/openai-codex.ts +143 -0
- package/packages/pi-ai/src/models/generated/openai.ts +704 -0
- package/packages/pi-ai/src/models/generated/opencode-go.ts +126 -0
- package/packages/pi-ai/src/models/generated/opencode.ts +534 -0
- package/packages/pi-ai/src/models/generated/openrouter.ts +4274 -0
- package/packages/pi-ai/src/models/generated/vercel-ai-gateway.ts +2608 -0
- package/packages/pi-ai/src/models/generated/xai.ts +415 -0
- package/packages/pi-ai/src/models/generated/zai.ts +241 -0
- package/packages/pi-ai/src/models/index.ts +106 -0
- package/packages/pi-ai/src/models.generated.test.ts +1 -2
- package/packages/pi-ai/src/models.test.ts +6 -5
- package/packages/pi-ai/src/models.ts +3 -153
- package/packages/pi-ai/tsconfig.json +1 -0
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +8 -2
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +472 -0
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry-env-fallback.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/model-registry-env-fallback.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry-env-fallback.test.js +52 -0
- package/packages/pi-coding-agent/dist/core/model-registry-env-fallback.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.js +2 -2
- package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.js +61 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +11 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts +1 -0
- 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 +23 -9
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts +11 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js +53 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts +8 -5
- package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js +27 -13
- package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +8 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +68 -8
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js +22 -22
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js.map +1 -1
- 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 +232 -18
- 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-ordering.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-ordering.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-ordering.test.js +38 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-ordering.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +14 -0
- 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 +70 -6
- 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/agent-session.ts +12 -6
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +612 -0
- package/packages/pi-coding-agent/src/core/model-registry-env-fallback.test.ts +59 -0
- package/packages/pi-coding-agent/src/core/model-registry.ts +2 -1
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.ts +92 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +19 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +25 -10
- package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +75 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/compaction-summary-message.ts +36 -15
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +83 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/user-message.ts +23 -26
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +298 -41
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode-ordering.test.ts +44 -0
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +92 -6
- package/packages/pi-coding-agent/src/types/ambient-modules.d.ts +69 -0
- package/packages/pi-coding-agent/tsconfig.json +3 -2
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -0
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +9 -2
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/package.json +1 -1
- package/packages/pi-tui/src/tui.ts +9 -1
- 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/gsd/activity-log.ts +21 -0
- package/src/resources/extensions/gsd/auto/detect-stuck.ts +12 -4
- package/src/resources/extensions/gsd/auto/loop-deps.ts +10 -0
- package/src/resources/extensions/gsd/auto/loop.ts +159 -10
- package/src/resources/extensions/gsd/auto/phases.ts +261 -10
- package/src/resources/extensions/gsd/auto/session.ts +10 -0
- package/src/resources/extensions/gsd/auto-dispatch.ts +16 -6
- package/src/resources/extensions/gsd/auto-model-selection.ts +69 -8
- package/src/resources/extensions/gsd/auto-post-unit.ts +238 -18
- package/src/resources/extensions/gsd/auto-prompts.ts +13 -0
- package/src/resources/extensions/gsd/auto-recovery.ts +29 -9
- package/src/resources/extensions/gsd/auto-unit-closeout.ts +25 -1
- package/src/resources/extensions/gsd/auto-verification.ts +129 -2
- package/src/resources/extensions/gsd/auto-worktree.ts +1 -0
- package/src/resources/extensions/gsd/auto.ts +41 -2
- package/src/resources/extensions/gsd/bootstrap/provider-error-resume.ts +5 -3
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +38 -8
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +72 -8
- package/src/resources/extensions/gsd/cache.ts +16 -5
- package/src/resources/extensions/gsd/commands/catalog.ts +31 -1
- package/src/resources/extensions/gsd/commands/handlers/core.ts +5 -1
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +25 -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-extract-learnings.ts +304 -0
- 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-prefs-wizard.ts +58 -4
- 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 +16 -1
- package/src/resources/extensions/gsd/ecosystem/gsd-extension-api.ts +228 -0
- package/src/resources/extensions/gsd/ecosystem/loader.ts +201 -0
- package/src/resources/extensions/gsd/git-service.ts +68 -0
- package/src/resources/extensions/gsd/graph-context.ts +212 -0
- package/src/resources/extensions/gsd/gsd-db.ts +788 -3
- package/src/resources/extensions/gsd/guided-flow.ts +36 -2
- package/src/resources/extensions/gsd/index.ts +18 -2
- package/src/resources/extensions/gsd/init-wizard.ts +3 -2
- package/src/resources/extensions/gsd/journal.ts +30 -0
- 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/metrics.ts +26 -0
- 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/parallel-orchestrator.ts +40 -1
- package/src/resources/extensions/gsd/preferences-models.ts +20 -3
- package/src/resources/extensions/gsd/preferences-types.ts +38 -0
- package/src/resources/extensions/gsd/preferences-validation.ts +117 -2
- package/src/resources/extensions/gsd/preferences.ts +34 -0
- package/src/resources/extensions/gsd/prompts/add-tests.md +35 -0
- package/src/resources/extensions/gsd/safety/evidence-collector.ts +15 -31
- package/src/resources/extensions/gsd/session-lock.ts +14 -2
- package/src/resources/extensions/gsd/slice-parallel-orchestrator.ts +20 -1
- package/src/resources/extensions/gsd/state.ts +9 -2
- package/src/resources/extensions/gsd/templates/PREFERENCES.md +19 -0
- package/src/resources/extensions/gsd/tests/artifacts-table-preserved-on-cache-invalidate.test.ts +177 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +7 -3
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +20 -0
- package/src/resources/extensions/gsd/tests/auto-project-root-env.test.ts +7 -3
- package/src/resources/extensions/gsd/tests/auto-retry-mcp-churn-fixes.test.ts +272 -0
- package/src/resources/extensions/gsd/tests/auto-warning-noise-regression.test.ts +117 -0
- package/src/resources/extensions/gsd/tests/cold-resume-db-reopen.test.ts +6 -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-extract-learnings.test.ts +340 -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-slice.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/extension-bootstrap-isolation.test.ts +154 -0
- package/src/resources/extensions/gsd/tests/finalize-timeout-guard.test.ts +10 -7
- package/src/resources/extensions/gsd/tests/graph-context.test.ts +337 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/health-widget.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +71 -4
- package/src/resources/extensions/gsd/tests/md-importer.test.ts +1 -2
- package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -3
- package/src/resources/extensions/gsd/tests/native-git-bridge-exec-fallback.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/post-exec-retry-bypass.test.ts +79 -1
- package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/pre-execution-pause-wiring.test.ts +40 -1
- package/src/resources/extensions/gsd/tests/preferences.test.ts +145 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +57 -2
- package/src/resources/extensions/gsd/tests/register-hooks-depth-verification.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/single-writer-invariant.test.ts +180 -0
- package/src/resources/extensions/gsd/tests/token-profile.test.ts +8 -5
- package/src/resources/extensions/gsd/tests/uok-audit-unified.test.ts +101 -0
- package/src/resources/extensions/gsd/tests/uok-contracts.test.ts +85 -0
- package/src/resources/extensions/gsd/tests/uok-execution-graph.test.ts +69 -0
- package/src/resources/extensions/gsd/tests/uok-flags.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/uok-gate-runner.test.ts +70 -0
- package/src/resources/extensions/gsd/tests/uok-gitops-turn-action.test.ts +85 -0
- package/src/resources/extensions/gsd/tests/uok-gitops-wiring.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/uok-model-policy.test.ts +89 -0
- package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +167 -0
- package/src/resources/extensions/gsd/tests/uok-preferences.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/validate-milestone-write-order.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/workflow-logger-wiring.test.ts +223 -0
- package/src/resources/extensions/gsd/tools/complete-slice.ts +26 -0
- package/src/resources/extensions/gsd/tools/validate-milestone.ts +48 -3
- 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/types.ts +14 -1
- package/src/resources/extensions/gsd/unit-ownership.ts +2 -2
- package/src/resources/extensions/gsd/uok/audit-toggle.ts +9 -0
- package/src/resources/extensions/gsd/uok/audit.ts +51 -0
- package/src/resources/extensions/gsd/uok/contracts.ts +135 -0
- package/src/resources/extensions/gsd/uok/execution-graph.ts +241 -0
- package/src/resources/extensions/gsd/uok/flags.ts +45 -0
- package/src/resources/extensions/gsd/uok/gate-runner.ts +146 -0
- package/src/resources/extensions/gsd/uok/gitops.ts +75 -0
- package/src/resources/extensions/gsd/uok/kernel.ts +105 -0
- package/src/resources/extensions/gsd/uok/loop-adapter.ts +162 -0
- package/src/resources/extensions/gsd/uok/model-policy.ts +112 -0
- package/src/resources/extensions/gsd/uok/plan-v2.ts +156 -0
- package/src/resources/extensions/gsd/workflow-logger.ts +27 -1
- 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/src/resources/extensions/ttsr/ttsr-manager.ts +10 -5
- 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/packages/pi-ai/dist/models.custom.d.ts.map +0 -1
- package/packages/pi-ai/dist/models.custom.js.map +0 -1
- package/packages/pi-ai/dist/models.generated.js +0 -14343
- package/packages/pi-ai/dist/models.generated.js.map +0 -1
- package/packages/pi-ai/src/models.generated.ts +0 -14345
- /package/dist/web/standalone/.next/static/{JpjdI2QtmIkQr4xz6gbhM → j7IBD35UgrL2b298GLK3V}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{JpjdI2QtmIkQr4xz6gbhM → j7IBD35UgrL2b298GLK3V}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,140 @@
|
|
|
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
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
|
|
9
|
+
import { join, dirname } from "node:path";
|
|
10
|
+
import { gsdRoot } from "./paths.js";
|
|
11
|
+
function backlogPath(basePath) {
|
|
12
|
+
return join(gsdRoot(basePath), "BACKLOG.md");
|
|
13
|
+
}
|
|
14
|
+
function parseBacklog(basePath) {
|
|
15
|
+
const filePath = backlogPath(basePath);
|
|
16
|
+
if (!existsSync(filePath))
|
|
17
|
+
return [];
|
|
18
|
+
const content = readFileSync(filePath, "utf-8");
|
|
19
|
+
const items = [];
|
|
20
|
+
for (const line of content.split("\n")) {
|
|
21
|
+
const match = line.match(/^- \[([ x])\] (999\.\d+) — (.+?)(?:\s*\((.+)\))?$/);
|
|
22
|
+
if (match) {
|
|
23
|
+
items.push({
|
|
24
|
+
id: match[2],
|
|
25
|
+
title: match[3].trim(),
|
|
26
|
+
done: match[1] === "x",
|
|
27
|
+
note: match[4] ?? "",
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return items;
|
|
32
|
+
}
|
|
33
|
+
function writeBacklog(basePath, items) {
|
|
34
|
+
const filePath = backlogPath(basePath);
|
|
35
|
+
mkdirSync(dirname(filePath), { recursive: true });
|
|
36
|
+
const lines = ["# Backlog\n"];
|
|
37
|
+
for (const item of items) {
|
|
38
|
+
const check = item.done ? "x" : " ";
|
|
39
|
+
const note = item.note ? ` (${item.note})` : "";
|
|
40
|
+
lines.push(`- [${check}] ${item.id} — ${item.title}${note}`);
|
|
41
|
+
}
|
|
42
|
+
lines.push(""); // trailing newline
|
|
43
|
+
writeFileSync(filePath, lines.join("\n"), "utf-8");
|
|
44
|
+
}
|
|
45
|
+
function nextBacklogId(items) {
|
|
46
|
+
let maxNum = 0;
|
|
47
|
+
for (const item of items) {
|
|
48
|
+
const match = item.id.match(/^999\.(\d+)$/);
|
|
49
|
+
if (match) {
|
|
50
|
+
const num = parseInt(match[1], 10);
|
|
51
|
+
if (num > maxNum)
|
|
52
|
+
maxNum = num;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return `999.${maxNum + 1}`;
|
|
56
|
+
}
|
|
57
|
+
async function listBacklog(basePath, ctx) {
|
|
58
|
+
const items = parseBacklog(basePath);
|
|
59
|
+
if (items.length === 0) {
|
|
60
|
+
ctx.ui.notify("Backlog is empty. Add items with /gsd backlog add <title>", "info");
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const lines = ["Backlog:\n"];
|
|
64
|
+
for (const item of items) {
|
|
65
|
+
const status = item.done ? "✓" : "○";
|
|
66
|
+
const note = item.note ? ` (${item.note})` : "";
|
|
67
|
+
lines.push(` ${status} ${item.id} — ${item.title}${note}`);
|
|
68
|
+
}
|
|
69
|
+
const pending = items.filter((i) => !i.done).length;
|
|
70
|
+
lines.push(`\n${pending} pending, ${items.length - pending} promoted/done`);
|
|
71
|
+
ctx.ui.notify(lines.join("\n"), "info");
|
|
72
|
+
}
|
|
73
|
+
async function addBacklogItem(basePath, title, ctx) {
|
|
74
|
+
if (!title) {
|
|
75
|
+
ctx.ui.notify("Usage: /gsd backlog add <title>", "warning");
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const items = parseBacklog(basePath);
|
|
79
|
+
const id = nextBacklogId(items);
|
|
80
|
+
const date = new Date().toISOString().slice(0, 10);
|
|
81
|
+
items.push({ id, title: title.replace(/^['"]|['"]$/g, ""), done: false, note: `added ${date}` });
|
|
82
|
+
writeBacklog(basePath, items);
|
|
83
|
+
ctx.ui.notify(`Added ${id}: "${title}"`, "success");
|
|
84
|
+
}
|
|
85
|
+
async function promoteBacklogItem(basePath, itemId, ctx, pi) {
|
|
86
|
+
if (!itemId) {
|
|
87
|
+
ctx.ui.notify("Usage: /gsd backlog promote <id>\nExample: /gsd backlog promote 999.1", "warning");
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const items = parseBacklog(basePath);
|
|
91
|
+
const item = items.find((i) => i.id === itemId);
|
|
92
|
+
if (!item) {
|
|
93
|
+
ctx.ui.notify(`Backlog item ${itemId} not found.`, "warning");
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (item.done) {
|
|
97
|
+
ctx.ui.notify(`${itemId} is already promoted/done.`, "info");
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
// Promote — currently requires single-writer engine (not yet available)
|
|
101
|
+
// Mark as promoted in backlog for now; slice creation will be available with the engine.
|
|
102
|
+
item.done = true;
|
|
103
|
+
item.note = `promoted ${new Date().toISOString().slice(0, 10)}`;
|
|
104
|
+
writeBacklog(basePath, items);
|
|
105
|
+
ctx.ui.notify(`Promoted ${itemId}: "${item.title}" — add it to the roadmap manually or wait for engine slice commands.`, "info");
|
|
106
|
+
}
|
|
107
|
+
async function removeBacklogItem(basePath, itemId, ctx) {
|
|
108
|
+
if (!itemId) {
|
|
109
|
+
ctx.ui.notify("Usage: /gsd backlog remove <id>", "warning");
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const items = parseBacklog(basePath);
|
|
113
|
+
const idx = items.findIndex((i) => i.id === itemId);
|
|
114
|
+
if (idx === -1) {
|
|
115
|
+
ctx.ui.notify(`Backlog item ${itemId} not found.`, "warning");
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const removed = items.splice(idx, 1)[0];
|
|
119
|
+
writeBacklog(basePath, items);
|
|
120
|
+
ctx.ui.notify(`Removed ${removed.id}: "${removed.title}"`, "success");
|
|
121
|
+
}
|
|
122
|
+
export async function handleBacklog(args, ctx, pi) {
|
|
123
|
+
const basePath = process.cwd();
|
|
124
|
+
const parts = args.trim().split(/\s+/);
|
|
125
|
+
const sub = parts[0] ?? "";
|
|
126
|
+
const rest = parts.slice(1).join(" ");
|
|
127
|
+
switch (sub) {
|
|
128
|
+
case "":
|
|
129
|
+
return listBacklog(basePath, ctx);
|
|
130
|
+
case "add":
|
|
131
|
+
return addBacklogItem(basePath, rest, ctx);
|
|
132
|
+
case "promote":
|
|
133
|
+
return promoteBacklogItem(basePath, rest.trim(), ctx, pi);
|
|
134
|
+
case "remove":
|
|
135
|
+
return removeBacklogItem(basePath, rest.trim(), ctx);
|
|
136
|
+
default:
|
|
137
|
+
// Treat as implicit add
|
|
138
|
+
return addBacklogItem(basePath, args, ctx);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
const ROUTES = [
|
|
8
|
+
{ keywords: ["progress", "status", "dashboard", "how far", "where are we"], command: "status" },
|
|
9
|
+
{ keywords: ["auto", "autonomous", "run all", "keep going", "start auto"], command: "auto" },
|
|
10
|
+
{ keywords: ["stop", "halt", "abort"], command: "stop" },
|
|
11
|
+
{ keywords: ["pause", "break", "take a break"], command: "pause" },
|
|
12
|
+
{ keywords: ["history", "past", "what happened", "previous"], command: "history" },
|
|
13
|
+
{ keywords: ["doctor", "health", "diagnose", "check health"], command: "doctor" },
|
|
14
|
+
{ keywords: ["clean up", "cleanup", "remove old", "prune", "tidy"], command: "cleanup" },
|
|
15
|
+
{ keywords: ["export", "report", "share results"], command: "export" },
|
|
16
|
+
{ keywords: ["ship", "pull request", "create pr", "open pr", "merge"], command: "ship" },
|
|
17
|
+
{ keywords: ["discuss", "talk about", "architecture", "design"], command: "discuss" },
|
|
18
|
+
{ keywords: ["undo", "revert", "rollback", "take back"], command: "undo" },
|
|
19
|
+
{ keywords: ["skip", "skip task", "skip this"], command: "skip" },
|
|
20
|
+
{ keywords: ["queue", "reorder", "milestone order", "order milestones"], command: "queue" },
|
|
21
|
+
{ keywords: ["visualize", "viz", "graph", "chart", "show graph"], command: "visualize" },
|
|
22
|
+
{ keywords: ["capture", "note", "idea", "thought", "remember"], command: "capture" },
|
|
23
|
+
{ keywords: ["inspect", "database", "sqlite", "db state"], command: "inspect" },
|
|
24
|
+
{ keywords: ["knowledge", "rule", "pattern", "lesson"], command: "knowledge" },
|
|
25
|
+
{ keywords: ["session report", "session summary", "cost summary", "how much"], command: "session-report" },
|
|
26
|
+
{ keywords: ["backlog", "parking lot", "later", "someday"], command: "backlog" },
|
|
27
|
+
{ keywords: ["pr branch", "clean branch", "filter commits"], command: "pr-branch" },
|
|
28
|
+
{ keywords: ["add tests", "write tests", "generate tests", "test coverage"], command: "add-tests" },
|
|
29
|
+
{ keywords: ["next", "step", "next step", "what's next"], command: "next" },
|
|
30
|
+
{ keywords: ["migrate", "migration", "convert", "upgrade"], command: "migrate" },
|
|
31
|
+
{ keywords: ["steer", "change direction", "pivot", "redirect"], command: "steer" },
|
|
32
|
+
{ keywords: ["park", "shelve", "set aside"], command: "park" },
|
|
33
|
+
{ keywords: ["widget", "toggle widget"], command: "widget" },
|
|
34
|
+
{ keywords: ["logs", "debug logs", "log files"], command: "logs" },
|
|
35
|
+
];
|
|
36
|
+
function matchRoute(input) {
|
|
37
|
+
const lower = input.toLowerCase();
|
|
38
|
+
let bestMatch = null;
|
|
39
|
+
for (const route of ROUTES) {
|
|
40
|
+
for (const keyword of route.keywords) {
|
|
41
|
+
if (lower.includes(keyword)) {
|
|
42
|
+
const score = keyword.length; // Longer match = higher confidence
|
|
43
|
+
if (!bestMatch || score > bestMatch.score) {
|
|
44
|
+
// Strip the matched keyword from input to get remaining args
|
|
45
|
+
const idx = lower.indexOf(keyword);
|
|
46
|
+
const remaining = (input.slice(0, idx) + input.slice(idx + keyword.length)).trim();
|
|
47
|
+
bestMatch = { command: route.command, remainingArgs: remaining, score };
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return bestMatch;
|
|
53
|
+
}
|
|
54
|
+
export async function handleDo(args, ctx, pi) {
|
|
55
|
+
if (!args.trim()) {
|
|
56
|
+
ctx.ui.notify("Usage: /gsd do <what you want to do>\n\n" +
|
|
57
|
+
"Examples:\n" +
|
|
58
|
+
" /gsd do show me progress\n" +
|
|
59
|
+
" /gsd do run autonomously\n" +
|
|
60
|
+
" /gsd do clean up old branches\n" +
|
|
61
|
+
" /gsd do fix the login bug", "warning");
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const match = matchRoute(args);
|
|
65
|
+
if (match) {
|
|
66
|
+
const fullCommand = match.remainingArgs
|
|
67
|
+
? `${match.command} ${match.remainingArgs}`
|
|
68
|
+
: match.command;
|
|
69
|
+
ctx.ui.notify(`→ /gsd ${fullCommand}`, "info");
|
|
70
|
+
// Re-dispatch through the main dispatcher
|
|
71
|
+
const { handleGSDCommand } = await import("./commands/dispatcher.js");
|
|
72
|
+
await handleGSDCommand(fullCommand, ctx, pi);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
// No keyword match → treat as quick task
|
|
76
|
+
ctx.ui.notify(`→ /gsd quick ${args}`, "info");
|
|
77
|
+
const { handleQuick } = await import("./quick.js");
|
|
78
|
+
await handleQuick(args, ctx, pi);
|
|
79
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GSD Command — /gsd extract-learnings
|
|
3
|
+
*
|
|
4
|
+
* Analyses completed milestone artefacts and dispatches an LLM turn that
|
|
5
|
+
* extracts structured knowledge into 4 categories:
|
|
6
|
+
* Decisions · Lessons · Patterns · Surprises
|
|
7
|
+
*/
|
|
8
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
9
|
+
import { join, basename } from "node:path";
|
|
10
|
+
import { gsdRoot, resolveMilestonePath } from "./paths.js";
|
|
11
|
+
import { projectRoot } from "./commands/context.js";
|
|
12
|
+
// ─── Pure functions ───────────────────────────────────────────────────────────
|
|
13
|
+
export function parseExtractLearningsArgs(args) {
|
|
14
|
+
const trimmed = args.trim();
|
|
15
|
+
return { milestoneId: trimmed || null };
|
|
16
|
+
}
|
|
17
|
+
export function buildLearningsOutputPath(milestoneDir, milestoneId) {
|
|
18
|
+
return join(milestoneDir, `${milestoneId}-LEARNINGS.md`);
|
|
19
|
+
}
|
|
20
|
+
export function resolvePhaseArtifacts(milestoneDir, milestoneId) {
|
|
21
|
+
const missingRequired = [];
|
|
22
|
+
const planFile = `${milestoneId}-PLAN.md`;
|
|
23
|
+
const summaryFile = `${milestoneId}-SUMMARY.md`;
|
|
24
|
+
const verificationFile = `${milestoneId}-VERIFICATION.md`;
|
|
25
|
+
const uatFile = `${milestoneId}-UAT.md`;
|
|
26
|
+
const planPath = join(milestoneDir, planFile);
|
|
27
|
+
const summaryPath = join(milestoneDir, summaryFile);
|
|
28
|
+
const verificationPath = join(milestoneDir, verificationFile);
|
|
29
|
+
const uatPath = join(milestoneDir, uatFile);
|
|
30
|
+
const plan = existsSync(planPath) ? planPath : null;
|
|
31
|
+
const summary = existsSync(summaryPath) ? summaryPath : null;
|
|
32
|
+
const verification = existsSync(verificationPath) ? verificationPath : null;
|
|
33
|
+
const uat = existsSync(uatPath) ? uatPath : null;
|
|
34
|
+
if (!plan)
|
|
35
|
+
missingRequired.push(planFile);
|
|
36
|
+
if (!summary)
|
|
37
|
+
missingRequired.push(summaryFile);
|
|
38
|
+
return { plan, summary, verification, uat, missingRequired };
|
|
39
|
+
}
|
|
40
|
+
export function buildExtractLearningsPrompt(ctx) {
|
|
41
|
+
const optionalSections = [];
|
|
42
|
+
if (ctx.verificationContent) {
|
|
43
|
+
optionalSections.push(`## Verification Report\n\n${ctx.verificationContent}`);
|
|
44
|
+
}
|
|
45
|
+
if (ctx.uatContent) {
|
|
46
|
+
optionalSections.push(`## UAT Report\n\n${ctx.uatContent}`);
|
|
47
|
+
}
|
|
48
|
+
const missingNote = ctx.missingArtifacts.length > 0
|
|
49
|
+
? `\nNote: The following optional artefacts were not available: ${ctx.missingArtifacts.join(", ")}\n`
|
|
50
|
+
: "";
|
|
51
|
+
return `# Extract Learnings — ${ctx.milestoneId}: ${ctx.milestoneName}
|
|
52
|
+
|
|
53
|
+
**Project:** ${ctx.projectName}
|
|
54
|
+
**Output file:** ${ctx.outputPath}
|
|
55
|
+
|
|
56
|
+
## Your Task
|
|
57
|
+
|
|
58
|
+
Analyse the artefacts below and extract structured knowledge from milestone **${ctx.milestoneId}**.
|
|
59
|
+
|
|
60
|
+
Write a LEARNINGS document to \`${ctx.outputPath}\` with the following 4 sections:
|
|
61
|
+
|
|
62
|
+
### Decisions
|
|
63
|
+
Key architectural and design decisions made during this milestone, including the rationale and alternatives considered.
|
|
64
|
+
|
|
65
|
+
### Lessons
|
|
66
|
+
What the team learned — technical discoveries, process insights, and knowledge gaps that were filled.
|
|
67
|
+
|
|
68
|
+
### Patterns
|
|
69
|
+
Reusable patterns, approaches, or solutions that emerged and should be applied in future work.
|
|
70
|
+
|
|
71
|
+
### Surprises
|
|
72
|
+
Unexpected challenges, discoveries, or outcomes — things that deviated from assumptions.
|
|
73
|
+
|
|
74
|
+
### Source Attribution (REQUIRED)
|
|
75
|
+
|
|
76
|
+
Every extracted item MUST include a \`Source:\` line immediately after the item text.
|
|
77
|
+
Format: \`Source: {artifact-filename}/{section}\`
|
|
78
|
+
Example: \`Source: M001-PLAN.md/Architecture Decisions\`
|
|
79
|
+
|
|
80
|
+
Items without a Source attribution are invalid and must not be included in the output.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Artefacts
|
|
85
|
+
|
|
86
|
+
### Plan
|
|
87
|
+
|
|
88
|
+
${ctx.planContent}
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
### Summary
|
|
93
|
+
|
|
94
|
+
${ctx.summaryContent}
|
|
95
|
+
|
|
96
|
+
${optionalSections.join("\n\n---\n\n")}
|
|
97
|
+
${missingNote}
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Output Format
|
|
101
|
+
|
|
102
|
+
Write the LEARNINGS file to \`${ctx.relativeOutputPath}\` with YAML frontmatter followed by the 4 sections above.
|
|
103
|
+
Each section should contain concise, actionable bullet points.
|
|
104
|
+
Every bullet point MUST be followed by a source line, for example:
|
|
105
|
+
|
|
106
|
+
\`\`\`
|
|
107
|
+
### Decisions
|
|
108
|
+
- Chose PostgreSQL over SQLite for concurrent write support.
|
|
109
|
+
Source: M001-PLAN.md/Architecture Decisions
|
|
110
|
+
\`\`\`
|
|
111
|
+
|
|
112
|
+
Items without a \`Source:\` line are invalid.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Optional: Capture Individual Learnings
|
|
117
|
+
|
|
118
|
+
If the \`capture_thought\` tool is available, call it once for each extracted item with:
|
|
119
|
+
- category: "decision" | "lesson" | "pattern" | "surprise"
|
|
120
|
+
- phase: "${ctx.milestoneId}"
|
|
121
|
+
- content: {the learning text}
|
|
122
|
+
- source: {artifact filename}
|
|
123
|
+
|
|
124
|
+
If \`capture_thought\` is not available, skip this step silently — do not report an error.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Rebuild Knowledge Graph
|
|
129
|
+
|
|
130
|
+
After writing LEARNINGS.md, call the \`gsd_graph\` tool with \`{ "mode": "build" }\` to rebuild the knowledge graph so the new learnings are immediately queryable by future milestone prompts.
|
|
131
|
+
|
|
132
|
+
If the \`gsd_graph\` tool is not available, skip this step silently.
|
|
133
|
+
`;
|
|
134
|
+
}
|
|
135
|
+
export function buildFrontmatter(ctx) {
|
|
136
|
+
const missingList = ctx.missingArtifacts.length > 0
|
|
137
|
+
? ctx.missingArtifacts.map((a) => ` - ${a}`).join("\n")
|
|
138
|
+
: " []";
|
|
139
|
+
const missingValue = ctx.missingArtifacts.length > 0
|
|
140
|
+
? `\n${missingList}`
|
|
141
|
+
: " []";
|
|
142
|
+
return `---
|
|
143
|
+
phase: ${ctx.milestoneId}
|
|
144
|
+
phase_name: ${ctx.milestoneName}
|
|
145
|
+
project: ${ctx.projectName}
|
|
146
|
+
generated: ${ctx.generatedAt}
|
|
147
|
+
counts:
|
|
148
|
+
decisions: ${ctx.counts.decisions}
|
|
149
|
+
lessons: ${ctx.counts.lessons}
|
|
150
|
+
patterns: ${ctx.counts.patterns}
|
|
151
|
+
surprises: ${ctx.counts.surprises}
|
|
152
|
+
missing_artifacts:${missingValue}
|
|
153
|
+
---`;
|
|
154
|
+
}
|
|
155
|
+
export function extractProjectName(basePath) {
|
|
156
|
+
const projectMdPath = join(gsdRoot(basePath), "PROJECT.md");
|
|
157
|
+
if (existsSync(projectMdPath)) {
|
|
158
|
+
try {
|
|
159
|
+
const content = readFileSync(projectMdPath, "utf-8");
|
|
160
|
+
const match = content.match(/^name:\s*(.+)$/m);
|
|
161
|
+
if (match)
|
|
162
|
+
return match[1].trim();
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
// non-fatal
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return basename(basePath);
|
|
169
|
+
}
|
|
170
|
+
// ─── Handler ──────────────────────────────────────────────────────────────────
|
|
171
|
+
export async function handleExtractLearnings(args, ctx, pi) {
|
|
172
|
+
const { milestoneId } = parseExtractLearningsArgs(args);
|
|
173
|
+
if (!milestoneId) {
|
|
174
|
+
ctx.ui.notify("Usage: /gsd extract-learnings <milestoneId> (e.g. M001)", "warning");
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
// projectRoot() throws GSDNoProjectError if no project found — intentional, handled by dispatcher
|
|
178
|
+
const basePath = projectRoot();
|
|
179
|
+
const milestoneDir = resolveMilestonePath(basePath, milestoneId);
|
|
180
|
+
if (!milestoneDir) {
|
|
181
|
+
ctx.ui.notify(`Milestone not found: ${milestoneId}`, "error");
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const artifacts = resolvePhaseArtifacts(milestoneDir, milestoneId);
|
|
185
|
+
if (artifacts.missingRequired.length > 0) {
|
|
186
|
+
ctx.ui.notify(`Cannot extract learnings — required artefacts missing: ${artifacts.missingRequired.join(", ")}`, "error");
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
// Read required artefacts
|
|
190
|
+
const planContent = readFileSync(artifacts.plan, "utf-8");
|
|
191
|
+
const summaryContent = readFileSync(artifacts.summary, "utf-8");
|
|
192
|
+
// Read optional artefacts
|
|
193
|
+
const verificationContent = artifacts.verification
|
|
194
|
+
? readFileSync(artifacts.verification, "utf-8")
|
|
195
|
+
: null;
|
|
196
|
+
const uatContent = artifacts.uat
|
|
197
|
+
? readFileSync(artifacts.uat, "utf-8")
|
|
198
|
+
: null;
|
|
199
|
+
// Determine missing optional artefacts for context
|
|
200
|
+
const missingArtifacts = [];
|
|
201
|
+
if (!artifacts.verification)
|
|
202
|
+
missingArtifacts.push(`${milestoneId}-VERIFICATION.md`);
|
|
203
|
+
if (!artifacts.uat)
|
|
204
|
+
missingArtifacts.push(`${milestoneId}-UAT.md`);
|
|
205
|
+
// Extract milestone name from Plan H1 or fall back to milestoneId
|
|
206
|
+
const h1Match = planContent.match(/^#\s+(.+)$/m);
|
|
207
|
+
const milestoneName = h1Match?.[1]?.trim() ?? milestoneId;
|
|
208
|
+
const projectName = extractProjectName(basePath);
|
|
209
|
+
const outputPath = buildLearningsOutputPath(milestoneDir, milestoneId);
|
|
210
|
+
const relativeOutputPath = outputPath.replace(basePath + "/", "");
|
|
211
|
+
const prompt = buildExtractLearningsPrompt({
|
|
212
|
+
milestoneId,
|
|
213
|
+
milestoneName,
|
|
214
|
+
outputPath,
|
|
215
|
+
relativeOutputPath,
|
|
216
|
+
planContent,
|
|
217
|
+
summaryContent,
|
|
218
|
+
verificationContent,
|
|
219
|
+
uatContent,
|
|
220
|
+
missingArtifacts,
|
|
221
|
+
projectName,
|
|
222
|
+
});
|
|
223
|
+
ctx.ui.notify(`Extracting learnings for ${milestoneId}: "${milestoneName}"...`, "info");
|
|
224
|
+
pi.sendMessage({ customType: "gsd-extract-learnings", content: prompt, display: false }, { triggerTurn: true });
|
|
225
|
+
}
|
|
@@ -449,7 +449,7 @@ export async function handleCleanupProjects(args, ctx) {
|
|
|
449
449
|
* Prints counts of recovered items and the resulting project phase.
|
|
450
450
|
*/
|
|
451
451
|
export async function handleRecover(ctx, basePath) {
|
|
452
|
-
const { isDbAvailable: dbAvailable,
|
|
452
|
+
const { isDbAvailable: dbAvailable, clearEngineHierarchy, transaction: dbTransaction } = await import("./gsd-db.js");
|
|
453
453
|
const { migrateHierarchyToDb } = await import("./md-importer.js");
|
|
454
454
|
const { invalidateStateCache } = await import("./state.js");
|
|
455
455
|
if (!dbAvailable()) {
|
|
@@ -457,12 +457,12 @@ export async function handleRecover(ctx, basePath) {
|
|
|
457
457
|
return;
|
|
458
458
|
}
|
|
459
459
|
try {
|
|
460
|
-
// 1. Delete + re-populate inside a single transaction for atomicity
|
|
461
|
-
|
|
460
|
+
// 1. Delete + re-populate inside a single transaction for atomicity.
|
|
461
|
+
// clearEngineHierarchy() uses transaction() internally but transaction()
|
|
462
|
+
// is re-entrant, so wrapping in dbTransaction() keeps the whole
|
|
463
|
+
// clear+repopulate atomic.
|
|
462
464
|
const counts = dbTransaction(() => {
|
|
463
|
-
|
|
464
|
-
db.exec("DELETE FROM slices");
|
|
465
|
-
db.exec("DELETE FROM milestones");
|
|
465
|
+
clearEngineHierarchy();
|
|
466
466
|
return migrateHierarchyToDb(basePath);
|
|
467
467
|
});
|
|
468
468
|
// 3. Invalidate state cache so deriveState() picks up fresh DB data
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GSD Command — /gsd pr-branch
|
|
3
|
+
*
|
|
4
|
+
* Creates a clean PR branch by cherry-picking commits while stripping
|
|
5
|
+
* any changes to .gsd/, .planning/, and PLAN.md paths. Useful for
|
|
6
|
+
* upstream PRs where planning artifacts should not be included.
|
|
7
|
+
*/
|
|
8
|
+
import { execFileSync } from "node:child_process";
|
|
9
|
+
import { nativeGetCurrentBranch, nativeDetectMainBranch, nativeBranchExists, } from "./native-git-bridge.js";
|
|
10
|
+
const EXCLUDED_PATHS = [".gsd", ".planning", "PLAN.md"];
|
|
11
|
+
function git(basePath, args) {
|
|
12
|
+
return execFileSync("git", args, { cwd: basePath, encoding: "utf-8" }).trim();
|
|
13
|
+
}
|
|
14
|
+
function gitAllowFail(basePath, args) {
|
|
15
|
+
try {
|
|
16
|
+
execFileSync("git", args, { cwd: basePath, encoding: "utf-8", stdio: "pipe" });
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
// ignored — caller opts into non-fatal behavior
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function hasStagedChanges(basePath) {
|
|
23
|
+
try {
|
|
24
|
+
execFileSync("git", ["diff", "--cached", "--quiet"], {
|
|
25
|
+
cwd: basePath,
|
|
26
|
+
stdio: "pipe",
|
|
27
|
+
});
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function isValidBranchName(name) {
|
|
35
|
+
try {
|
|
36
|
+
execFileSync("git", ["check-ref-format", "--branch", name], { stdio: "pipe" });
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function getCodeOnlyCommits(basePath, base, head) {
|
|
44
|
+
try {
|
|
45
|
+
const allCommits = git(basePath, ["log", "--format=%H", `${base}..${head}`])
|
|
46
|
+
.split("\n")
|
|
47
|
+
.filter(Boolean);
|
|
48
|
+
const codeCommits = [];
|
|
49
|
+
for (const sha of allCommits) {
|
|
50
|
+
const files = git(basePath, ["diff-tree", "--no-commit-id", "--name-only", "-r", sha])
|
|
51
|
+
.split("\n")
|
|
52
|
+
.filter(Boolean);
|
|
53
|
+
const hasCodeChanges = files.some((f) => !f.startsWith(".gsd/") && !f.startsWith(".planning/") && f !== "PLAN.md");
|
|
54
|
+
if (hasCodeChanges) {
|
|
55
|
+
codeCommits.push(sha);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return codeCommits.reverse(); // chronological for cherry-picking
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Cherry-pick a commit while stripping excluded paths from the resulting
|
|
66
|
+
* commit. Returns true if a commit was produced, false if nothing remained
|
|
67
|
+
* after filtering.
|
|
68
|
+
*/
|
|
69
|
+
function cherryPickFiltered(basePath, sha) {
|
|
70
|
+
git(basePath, ["cherry-pick", "--no-commit", "--allow-empty", sha]);
|
|
71
|
+
// Unstage any excluded paths introduced by the cherry-pick.
|
|
72
|
+
gitAllowFail(basePath, ["reset", "HEAD", "--", ...EXCLUDED_PATHS]);
|
|
73
|
+
// Restore worktree state for excluded paths from HEAD (if tracked),
|
|
74
|
+
// then remove any newly introduced untracked files under those paths.
|
|
75
|
+
gitAllowFail(basePath, ["checkout", "HEAD", "--", ...EXCLUDED_PATHS]);
|
|
76
|
+
gitAllowFail(basePath, ["clean", "-fdq", "--", ...EXCLUDED_PATHS]);
|
|
77
|
+
if (!hasStagedChanges(basePath)) {
|
|
78
|
+
// Nothing remained after filtering — discard worktree residue and skip.
|
|
79
|
+
git(basePath, ["reset", "--hard", "HEAD"]);
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
git(basePath, ["commit", "-C", sha]);
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
function assertNoExcludedPaths(basePath, base) {
|
|
86
|
+
const files = git(basePath, [
|
|
87
|
+
"diff",
|
|
88
|
+
"--name-only",
|
|
89
|
+
`${base}..HEAD`,
|
|
90
|
+
])
|
|
91
|
+
.split("\n")
|
|
92
|
+
.filter(Boolean);
|
|
93
|
+
const leaked = files.filter((f) => f.startsWith(".gsd/") || f.startsWith(".planning/") || f === "PLAN.md");
|
|
94
|
+
if (leaked.length > 0) {
|
|
95
|
+
throw new Error(`PR branch still contains excluded paths: ${leaked.slice(0, 5).join(", ")}${leaked.length > 5 ? ` (+${leaked.length - 5} more)` : ""}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
export async function handlePrBranch(args, ctx) {
|
|
99
|
+
const basePath = process.cwd();
|
|
100
|
+
const dryRun = args.includes("--dry-run");
|
|
101
|
+
const nameMatch = args.match(/--name\s+(\S+)/);
|
|
102
|
+
const currentBranch = nativeGetCurrentBranch(basePath);
|
|
103
|
+
const mainBranch = nativeDetectMainBranch(basePath);
|
|
104
|
+
// Determine base ref (prefer upstream/main if available)
|
|
105
|
+
let baseRef;
|
|
106
|
+
try {
|
|
107
|
+
git(basePath, ["rev-parse", "--verify", "upstream/main"]);
|
|
108
|
+
baseRef = "upstream/main";
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
baseRef = mainBranch;
|
|
112
|
+
}
|
|
113
|
+
// Find commits with code changes
|
|
114
|
+
const commits = getCodeOnlyCommits(basePath, baseRef, "HEAD");
|
|
115
|
+
if (commits.length === 0) {
|
|
116
|
+
ctx.ui.notify("No code-only commits found (all commits only touch .gsd/ files).", "info");
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (dryRun) {
|
|
120
|
+
const lines = [`Would create PR branch with ${commits.length} commits (filtering .gsd/ paths):\n`];
|
|
121
|
+
for (const sha of commits) {
|
|
122
|
+
const msg = git(basePath, ["log", "--format=%s", "-1", sha]);
|
|
123
|
+
lines.push(` ${sha.slice(0, 8)} ${msg}`);
|
|
124
|
+
}
|
|
125
|
+
ctx.ui.notify(lines.join("\n"), "info");
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const requestedName = nameMatch?.[1];
|
|
129
|
+
if (requestedName && !isValidBranchName(requestedName)) {
|
|
130
|
+
ctx.ui.notify(`Invalid branch name: ${requestedName}. Must satisfy git check-ref-format.`, "error");
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
const defaultName = `pr/${currentBranch}`;
|
|
134
|
+
const prBranch = requestedName ?? defaultName;
|
|
135
|
+
if (!isValidBranchName(prBranch)) {
|
|
136
|
+
ctx.ui.notify(`Derived branch name is invalid: ${prBranch}. Use --name to override.`, "error");
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (nativeBranchExists(basePath, prBranch)) {
|
|
140
|
+
ctx.ui.notify(`Branch ${prBranch} already exists. Use --name to specify a different name, or delete it first.`, "warning");
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
try {
|
|
144
|
+
// Create clean branch from base
|
|
145
|
+
git(basePath, ["checkout", "-b", prBranch, baseRef]);
|
|
146
|
+
// Cherry-pick with path filter
|
|
147
|
+
let picked = 0;
|
|
148
|
+
let skipped = 0;
|
|
149
|
+
for (const sha of commits) {
|
|
150
|
+
try {
|
|
151
|
+
if (cherryPickFiltered(basePath, sha)) {
|
|
152
|
+
picked++;
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
skipped++;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
catch (pickErr) {
|
|
159
|
+
gitAllowFail(basePath, ["cherry-pick", "--abort"]);
|
|
160
|
+
gitAllowFail(basePath, ["reset", "--hard", "HEAD"]);
|
|
161
|
+
const detail = pickErr instanceof Error ? pickErr.message : String(pickErr);
|
|
162
|
+
ctx.ui.notify(`Cherry-pick conflict at ${sha.slice(0, 8)}. Picked ${picked}/${commits.length} commits. Resolve manually.\n${detail}`, "warning");
|
|
163
|
+
git(basePath, ["checkout", currentBranch]);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
// Post-condition: no excluded paths should appear in the PR branch diff.
|
|
168
|
+
assertNoExcludedPaths(basePath, baseRef);
|
|
169
|
+
const skippedMsg = skipped > 0 ? ` (${skipped} skipped — contained only planning artifacts)` : "";
|
|
170
|
+
ctx.ui.notify(`Created ${prBranch} with ${picked} commits${skippedMsg} (no .gsd/ artifacts).\nSwitch back: git checkout ${currentBranch}`, "success");
|
|
171
|
+
}
|
|
172
|
+
catch (err) {
|
|
173
|
+
// Restore original branch on failure
|
|
174
|
+
gitAllowFail(basePath, ["cherry-pick", "--abort"]);
|
|
175
|
+
gitAllowFail(basePath, ["reset", "--hard", "HEAD"]);
|
|
176
|
+
gitAllowFail(basePath, ["checkout", currentBranch]);
|
|
177
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
178
|
+
ctx.ui.notify(`Failed to create PR branch: ${msg}`, "error");
|
|
179
|
+
}
|
|
180
|
+
}
|