gsd-pi 2.75.0 → 2.76.0-dev.4100bd590
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +208 -151
- package/dist/claude-cli-check.d.ts +10 -0
- package/dist/claude-cli-check.js +13 -3
- package/dist/headless-events.d.ts +1 -1
- package/dist/headless-events.js +5 -2
- package/dist/headless.js +5 -6
- package/dist/loader.js +0 -0
- package/dist/onboarding.d.ts +20 -1
- package/dist/onboarding.js +99 -39
- package/dist/resources/agents/researcher.md +1 -1
- package/dist/resources/extensions/ask-user-questions.js +17 -5
- package/dist/resources/extensions/claude-code-cli/models.js +9 -0
- package/dist/resources/extensions/claude-code-cli/readiness.js +34 -2
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +76 -4
- package/dist/resources/extensions/gsd/auto/detect-stuck.js +9 -0
- package/dist/resources/extensions/gsd/auto/loop.js +67 -4
- package/dist/resources/extensions/gsd/auto/phases.js +118 -53
- package/dist/resources/extensions/gsd/auto/resolve.js +1 -1
- package/dist/resources/extensions/gsd/auto/run-unit.js +10 -1
- package/dist/resources/extensions/gsd/auto/session.js +5 -0
- package/dist/resources/extensions/gsd/auto-artifact-paths.js +20 -0
- package/dist/resources/extensions/gsd/auto-dashboard.js +37 -8
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +8 -2
- package/dist/resources/extensions/gsd/auto-dispatch.js +120 -14
- package/dist/resources/extensions/gsd/auto-loop.js +1 -1
- package/dist/resources/extensions/gsd/auto-model-selection.js +54 -18
- package/dist/resources/extensions/gsd/auto-post-unit.js +10 -8
- package/dist/resources/extensions/gsd/auto-prompts.js +190 -46
- package/dist/resources/extensions/gsd/auto-recovery.js +57 -0
- package/dist/resources/extensions/gsd/auto-start.js +5 -3
- package/dist/resources/extensions/gsd/auto-verification.js +36 -3
- package/dist/resources/extensions/gsd/auto-worktree.js +71 -2
- package/dist/resources/extensions/gsd/auto.js +57 -25
- package/dist/resources/extensions/gsd/blocked-models.js +68 -0
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +84 -21
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +45 -23
- package/dist/resources/extensions/gsd/bootstrap/memory-tools.js +131 -0
- package/dist/resources/extensions/gsd/bootstrap/query-tools.js +29 -0
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +12 -0
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +22 -0
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +84 -10
- package/dist/resources/extensions/gsd/commands/catalog.js +81 -9
- package/dist/resources/extensions/gsd/commands/handlers/core.js +64 -24
- package/dist/resources/extensions/gsd/commands/handlers/escalate.js +171 -0
- package/dist/resources/extensions/gsd/commands/handlers/onboarding.js +159 -0
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +21 -0
- package/dist/resources/extensions/gsd/commands/handlers/workflow.js +228 -29
- package/dist/resources/extensions/gsd/commands-cmux.js +5 -2
- package/dist/resources/extensions/gsd/commands-config.js +5 -0
- package/dist/resources/extensions/gsd/commands-debug.js +388 -0
- package/dist/resources/extensions/gsd/commands-do.js +1 -0
- package/dist/resources/extensions/gsd/commands-extract-learnings.js +200 -77
- package/dist/resources/extensions/gsd/commands-handlers.js +21 -2
- package/dist/resources/extensions/gsd/commands-memory.js +462 -0
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +40 -12
- package/dist/resources/extensions/gsd/commands-scan.js +94 -0
- package/dist/resources/extensions/gsd/commands-workflow-templates.js +101 -2
- package/dist/resources/extensions/gsd/custom-workflow-engine.js +74 -54
- package/dist/resources/extensions/gsd/db-writer.js +89 -16
- package/dist/resources/extensions/gsd/debug-session-store.js +238 -0
- package/dist/resources/extensions/gsd/definition-loader.js +7 -0
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +9 -9
- package/dist/resources/extensions/gsd/doctor-environment.js +2 -1
- package/dist/resources/extensions/gsd/doctor-git-checks.js +50 -32
- package/dist/resources/extensions/gsd/doctor-proactive.js +4 -1
- package/dist/resources/extensions/gsd/doctor-providers.js +96 -22
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +22 -4
- package/dist/resources/extensions/gsd/doctor.js +7 -1
- package/dist/resources/extensions/gsd/ecosystem/gsd-extension-api.js +1 -0
- package/dist/resources/extensions/gsd/error-classifier.js +27 -3
- package/dist/resources/extensions/gsd/escalation.js +321 -0
- package/dist/resources/extensions/gsd/forensics.js +26 -29
- package/dist/resources/extensions/gsd/git-service.js +0 -1
- package/dist/resources/extensions/gsd/graph.js +26 -2
- package/dist/resources/extensions/gsd/gsd-db.js +517 -32
- package/dist/resources/extensions/gsd/health-widget-core.js +42 -14
- package/dist/resources/extensions/gsd/health-widget.js +7 -4
- package/dist/resources/extensions/gsd/hook-emitter.js +108 -0
- package/dist/resources/extensions/gsd/init-wizard.js +86 -45
- package/dist/resources/extensions/gsd/markdown-renderer.js +5 -5
- package/dist/resources/extensions/gsd/memory-backfill.js +126 -0
- package/dist/resources/extensions/gsd/memory-embeddings.js +219 -0
- package/dist/resources/extensions/gsd/memory-extractor.js +78 -27
- package/dist/resources/extensions/gsd/memory-ingest.js +218 -0
- package/dist/resources/extensions/gsd/memory-relations.js +189 -0
- package/dist/resources/extensions/gsd/memory-source-store.js +113 -0
- package/dist/resources/extensions/gsd/memory-store.js +318 -6
- package/dist/resources/extensions/gsd/metrics.js +1 -0
- package/dist/resources/extensions/gsd/model-cost-table.js +3 -1
- package/dist/resources/extensions/gsd/model-router.js +16 -6
- package/dist/resources/extensions/gsd/native-git-bridge.js +137 -5
- package/dist/resources/extensions/gsd/notification-overlay.js +7 -22
- package/dist/resources/extensions/gsd/notification-widget.js +24 -39
- package/dist/resources/extensions/gsd/notifications.js +4 -0
- package/dist/resources/extensions/gsd/onboarding-state.js +133 -0
- package/dist/resources/extensions/gsd/post-execution-checks.js +27 -11
- package/dist/resources/extensions/gsd/pre-execution-checks.js +105 -8
- package/dist/resources/extensions/gsd/preferences-models.js +1 -0
- package/dist/resources/extensions/gsd/preferences-types.js +2 -1
- package/dist/resources/extensions/gsd/preferences-validation.js +42 -8
- package/dist/resources/extensions/gsd/preferences.js +10 -10
- package/dist/resources/extensions/gsd/prompts/add-tests.md +1 -0
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +4 -1
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +2 -2
- package/dist/resources/extensions/gsd/prompts/debug-diagnose.md +27 -0
- package/dist/resources/extensions/gsd/prompts/debug-session-manager.md +80 -0
- package/dist/resources/extensions/gsd/prompts/execute-task.md +16 -3
- package/dist/resources/extensions/gsd/prompts/plan-milestone.md +12 -0
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +2 -0
- package/dist/resources/extensions/gsd/prompts/refine-slice.md +69 -0
- package/dist/resources/extensions/gsd/prompts/research-slice.md +1 -0
- package/dist/resources/extensions/gsd/prompts/scan.md +79 -0
- package/dist/resources/extensions/gsd/prompts/workflow-oneshot.md +26 -0
- package/dist/resources/extensions/gsd/python-resolver.js +70 -0
- package/dist/resources/extensions/gsd/run-manager.js +37 -17
- package/dist/resources/extensions/gsd/setup-catalog.js +75 -0
- package/dist/resources/extensions/gsd/state.js +90 -7
- package/dist/resources/extensions/gsd/templates/PREFERENCES.md +7 -7
- package/dist/resources/extensions/gsd/tools/complete-task.js +80 -0
- package/dist/resources/extensions/gsd/tools/memory-tools.js +331 -0
- package/dist/resources/extensions/gsd/tools/plan-milestone.js +37 -12
- package/dist/resources/extensions/gsd/tools/plan-slice.js +5 -2
- package/dist/resources/extensions/gsd/tools/skip-slice.js +78 -0
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +14 -0
- package/dist/resources/extensions/gsd/uok/flags.js +7 -7
- package/dist/resources/extensions/gsd/uok/kernel.js +8 -3
- package/dist/resources/extensions/gsd/verification-gate.js +2 -1
- package/dist/resources/extensions/gsd/workflow-dispatch.js +64 -0
- package/dist/resources/extensions/gsd/workflow-install.js +327 -0
- package/dist/resources/extensions/gsd/workflow-manifest.js +8 -0
- package/dist/resources/extensions/gsd/workflow-mcp.js +1 -6
- package/dist/resources/extensions/gsd/workflow-plugins.js +346 -0
- package/dist/resources/extensions/gsd/workflow-projections.js +17 -15
- package/dist/resources/extensions/gsd/workflow-templates/accessibility-audit.md +88 -0
- package/dist/resources/extensions/gsd/workflow-templates/api-breaking-change.md +117 -0
- package/dist/resources/extensions/gsd/workflow-templates/bugfix.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/changelog-gen.md +82 -0
- package/dist/resources/extensions/gsd/workflow-templates/ci-bootstrap.md +144 -0
- package/dist/resources/extensions/gsd/workflow-templates/dead-code.md +81 -0
- package/dist/resources/extensions/gsd/workflow-templates/dep-upgrade.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/docs-sync.yaml +76 -0
- package/dist/resources/extensions/gsd/workflow-templates/env-audit.yaml +88 -0
- package/dist/resources/extensions/gsd/workflow-templates/full-project.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/hotfix.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/issue-triage.md +84 -0
- package/dist/resources/extensions/gsd/workflow-templates/observability-setup.md +133 -0
- package/dist/resources/extensions/gsd/workflow-templates/onboarding-check.md +74 -0
- package/dist/resources/extensions/gsd/workflow-templates/performance-audit.md +125 -0
- package/dist/resources/extensions/gsd/workflow-templates/pr-review.md +67 -0
- package/dist/resources/extensions/gsd/workflow-templates/pr-triage.md +83 -0
- package/dist/resources/extensions/gsd/workflow-templates/refactor.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/registry.json +184 -0
- package/dist/resources/extensions/gsd/workflow-templates/release.md +118 -0
- package/dist/resources/extensions/gsd/workflow-templates/rename-symbol.yaml +99 -0
- package/dist/resources/extensions/gsd/workflow-templates/security-audit.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/small-feature.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/spike.md +7 -0
- package/dist/resources/extensions/gsd/workflow-templates/test-backfill.yaml +73 -0
- package/dist/resources/extensions/gsd/worktree-resolver.js +42 -1
- package/dist/resources/extensions/remote-questions/commands.js +380 -0
- package/dist/resources/extensions/remote-questions/manager.js +39 -5
- package/dist/resources/extensions/remote-questions/telegram-adapter.js +79 -4
- package/dist/resources/extensions/search-the-web/command-search-provider.js +5 -1
- package/dist/resources/extensions/search-the-web/native-search.js +46 -3
- package/dist/resources/extensions/shared/interview-ui.js +189 -1
- package/dist/resources/extensions/shared/layout-utils.js +17 -0
- package/dist/resources/extensions/shared/rtk-shared.js +47 -0
- package/dist/resources/extensions/shared/rtk.js +3 -46
- package/dist/resources/skills/api-design/SKILL.md +190 -0
- package/dist/resources/skills/create-mcp-server/SKILL.md +121 -0
- package/dist/resources/skills/create-workflow/SKILL.md +33 -6
- package/dist/resources/skills/decompose-into-slices/SKILL.md +139 -0
- package/dist/resources/skills/dependency-upgrade/SKILL.md +158 -0
- package/dist/resources/skills/design-an-interface/SKILL.md +102 -0
- package/dist/resources/skills/forensics/SKILL.md +153 -0
- package/dist/resources/skills/grill-me/SKILL.md +93 -0
- package/dist/resources/skills/handoff/SKILL.md +121 -0
- package/dist/resources/skills/observability/SKILL.md +174 -0
- package/dist/resources/skills/security-review/SKILL.md +181 -0
- package/dist/resources/skills/spike-wrap-up/SKILL.md +138 -0
- package/dist/resources/skills/tdd/SKILL.md +112 -0
- package/dist/resources/skills/verify-before-complete/SKILL.md +97 -0
- package/dist/resources/skills/write-docs/SKILL.md +81 -0
- package/dist/resources/skills/write-milestone-brief/SKILL.md +135 -0
- package/dist/rtk-shared.d.ts +10 -0
- package/dist/rtk-shared.js +47 -0
- package/dist/rtk.d.ts +2 -6
- package/dist/rtk.js +3 -48
- package/dist/shared/workspace-types.d.ts +52 -0
- package/dist/shared/workspace-types.js +1 -0
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/update-check.d.ts +10 -0
- package/dist/update-check.js +24 -3
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +16 -16
- package/dist/web/standalone/.next/build-manifest.json +4 -4
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/react-loadable-manifest.json +2 -2
- package/dist/web/standalone/.next/required-server-files.json +4 -4
- 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 +4 -4
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +1 -1
- 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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +1 -1
- 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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +1 -1
- 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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +1 -1
- 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.js.nft.json +1 -1
- 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.js.nft.json +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.js.nft.json +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 +5 -5
- 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 +5 -5
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- 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 +16 -16
- 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/chunks/7461.js +1 -0
- 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-react-loadable-manifest.js +1 -1
- 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/2826.e59e8578e2e28639.js +9 -0
- package/dist/web/standalone/.next/static/chunks/{2008.71ee9230ad78df21.js → 3621.fc7480022c972438.js} +2 -2
- 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-5b113fd32bc2a1c3.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/.next/static/chunks/{webpack-b868033a5834586d.js → webpack-5fc74f13a25fa1bb.js} +1 -1
- package/dist/web/standalone/.next/static/css/632cd626b1731d88.css +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/dist/welcome-screen.js +48 -24
- package/dist/wizard.js +2 -2
- package/dist/worktree-cli.d.ts +6 -5
- package/dist/worktree-cli.js +23 -7
- package/package.json +3 -3
- package/packages/daemon/package.json +2 -2
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +12 -10
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/dist/session-manager.d.ts.map +1 -1
- package/packages/mcp-server/dist/session-manager.js +8 -1
- package/packages/mcp-server/dist/session-manager.js.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts +2 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +306 -71
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +2 -2
- package/packages/mcp-server/src/mcp-server.test.ts +40 -4
- package/packages/mcp-server/src/server.ts +12 -10
- package/packages/mcp-server/src/session-manager.ts +10 -3
- package/packages/mcp-server/src/workflow-tools.test.ts +346 -1
- package/packages/mcp-server/src/workflow-tools.ts +359 -75
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/package.json +1 -1
- package/packages/native/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-agent-core/dist/agent-loop.js +12 -0
- package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/packages/pi-agent-core/dist/types.d.ts +30 -0
- package/packages/pi-agent-core/dist/types.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/types.js.map +1 -1
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-agent-core/src/agent-loop.ts +14 -0
- package/packages/pi-agent-core/src/types.ts +34 -0
- package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
- 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/models/capability-patches.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/capability-patches.js +3 -2
- package/packages/pi-ai/dist/models/capability-patches.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.d.ts +68 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.js +68 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/anthropic.d.ts +17 -0
- package/packages/pi-ai/dist/models/generated/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/anthropic.js +17 -0
- package/packages/pi-ai/dist/models/generated/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/google-antigravity.d.ts +17 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/google-antigravity.js +17 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/groq.d.ts +0 -153
- package/packages/pi-ai/dist/models/generated/groq.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/groq.js +0 -153
- package/packages/pi-ai/dist/models/generated/groq.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/index.d.ts +136 -153
- package/packages/pi-ai/dist/models/generated/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/openai-codex.d.ts +17 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/openai-codex.js +17 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/openrouter.d.ts +17 -0
- package/packages/pi-ai/dist/models/generated/openrouter.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/openrouter.js +17 -0
- package/packages/pi-ai/dist/models/generated/openrouter.js.map +1 -1
- package/packages/pi-ai/dist/models.generated.test.js +17 -0
- package/packages/pi-ai/dist/models.generated.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.d.ts +22 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.js +40 -6
- package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/amazon-bedrock.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/amazon-bedrock.test.js +106 -0
- package/packages/pi-ai/dist/providers/amazon-bedrock.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js +42 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js +13 -0
- package/packages/pi-ai/dist/providers/anthropic-bearer-auth.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts +20 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.js +32 -2
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js +12 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts +11 -0
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +23 -2
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/api-family.d.ts +27 -0
- package/packages/pi-ai/dist/providers/api-family.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/api-family.js +47 -0
- package/packages/pi-ai/dist/providers/api-family.js.map +1 -0
- package/packages/pi-ai/dist/providers/api-family.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/api-family.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/api-family.test.js +101 -0
- package/packages/pi-ai/dist/providers/api-family.test.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js +12 -2
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js +164 -14
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.js +15 -3
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.d.ts +2 -0
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js +67 -0
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.test.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js +16 -3
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.d.ts +2 -0
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js +67 -0
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.test.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.d.ts +2 -0
- package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.js +289 -0
- package/packages/pi-ai/dist/utils/oauth/oauth-providers.test.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/openai-codex.js +12 -0
- package/packages/pi-ai/dist/utils/oauth/openai-codex.js.map +1 -1
- package/packages/pi-ai/package.json +2 -2
- package/packages/pi-ai/scripts/generate-models.ts +50 -0
- package/packages/pi-ai/src/index.ts +1 -0
- package/packages/pi-ai/src/models/capability-patches.ts +5 -2
- package/packages/pi-ai/src/models/generated/amazon-bedrock.ts +68 -0
- package/packages/pi-ai/src/models/generated/anthropic.ts +17 -0
- package/packages/pi-ai/src/models/generated/google-antigravity.ts +17 -0
- package/packages/pi-ai/src/models/generated/groq.ts +0 -153
- package/packages/pi-ai/src/models/generated/openai-codex.ts +17 -0
- package/packages/pi-ai/src/models/generated/openrouter.ts +17 -0
- package/packages/pi-ai/src/models.generated.test.ts +17 -0
- package/packages/pi-ai/src/providers/amazon-bedrock.test.ts +164 -0
- package/packages/pi-ai/src/providers/amazon-bedrock.ts +41 -7
- package/packages/pi-ai/src/providers/anthropic-auth.test.ts +47 -1
- package/packages/pi-ai/src/providers/anthropic-bearer-auth.test.ts +26 -0
- package/packages/pi-ai/src/providers/anthropic-shared.test.ts +15 -1
- package/packages/pi-ai/src/providers/anthropic-shared.ts +36 -3
- package/packages/pi-ai/src/providers/anthropic.ts +25 -2
- package/packages/pi-ai/src/providers/api-family.test.ts +129 -0
- package/packages/pi-ai/src/providers/api-family.ts +57 -0
- package/packages/pi-ai/src/utils/oauth/github-copilot.test.ts +200 -23
- package/packages/pi-ai/src/utils/oauth/github-copilot.ts +12 -2
- package/packages/pi-ai/src/utils/oauth/google-antigravity.test.ts +84 -0
- package/packages/pi-ai/src/utils/oauth/google-antigravity.ts +15 -5
- package/packages/pi-ai/src/utils/oauth/google-gemini-cli.test.ts +84 -0
- package/packages/pi-ai/src/utils/oauth/google-gemini-cli.ts +16 -5
- package/packages/pi-ai/src/utils/oauth/oauth-providers.test.ts +363 -0
- package/packages/pi-ai/src/utils/oauth/openai-codex.ts +15 -0
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/cli/args.d.ts +6 -0
- package/packages/pi-coding-agent/dist/cli/args.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/cli/args.js +14 -4
- package/packages/pi-coding-agent/dist/cli/args.js.map +1 -1
- package/packages/pi-coding-agent/dist/cli/args.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/cli/args.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/cli/args.test.js +38 -0
- package/packages/pi-coding-agent/dist/cli/args.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js +38 -0
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js.map +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 +25 -2
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +14 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.js +34 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.test.js +74 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +4 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +4 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +34 -2
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js +233 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +200 -3
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/hooks-runner.d.ts +53 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.js +337 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.js +234 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/index.d.ts +1 -0
- package/packages/pi-coding-agent/dist/core/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/index.js +1 -0
- package/packages/pi-coding-agent/dist/core/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry-auth-header.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/model-registry-auth-header.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry-auth-header.test.js +40 -0
- package/packages/pi-coding-agent/dist/core/model-registry-auth-header.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js +32 -0
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.js +4 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.d.ts +10 -0
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +39 -1
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +55 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js +2 -2
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/main.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/main.js +3 -0
- package/packages/pi-coding-agent/dist/main.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js +17 -7
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +48 -34
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts +4 -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 +83 -33
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts +70 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js +77 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +1 -66
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +1 -75
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +192 -24
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/cli/args.test.ts +44 -0
- package/packages/pi-coding-agent/src/cli/args.ts +21 -6
- package/packages/pi-coding-agent/src/core/agent-session-abort-order.test.ts +56 -0
- package/packages/pi-coding-agent/src/core/agent-session.ts +27 -2
- package/packages/pi-coding-agent/src/core/auth-storage.test.ts +83 -0
- package/packages/pi-coding-agent/src/core/auth-storage.ts +35 -0
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +4 -1
- package/packages/pi-coding-agent/src/core/extensions/index.ts +16 -0
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +5 -0
- package/packages/pi-coding-agent/src/core/extensions/runner.ts +353 -1
- package/packages/pi-coding-agent/src/core/extensions/types.ts +253 -2
- package/packages/pi-coding-agent/src/core/hooks-runner.test.ts +269 -0
- package/packages/pi-coding-agent/src/core/hooks-runner.ts +460 -0
- package/packages/pi-coding-agent/src/core/index.ts +10 -0
- package/packages/pi-coding-agent/src/core/model-registry-auth-header.test.ts +44 -0
- package/packages/pi-coding-agent/src/core/model-registry-auth-mode.test.ts +37 -1
- package/packages/pi-coding-agent/src/core/retry-handler.ts +4 -1
- package/packages/pi-coding-agent/src/core/sdk.ts +58 -1
- package/packages/pi-coding-agent/src/core/settings-manager.ts +57 -0
- package/packages/pi-coding-agent/src/core/skill-tool.test.ts +2 -2
- package/packages/pi-coding-agent/src/index.ts +16 -0
- package/packages/pi-coding-agent/src/main.ts +4 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +19 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +53 -31
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +88 -36
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme-schema.ts +83 -0
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +2 -83
- package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +208 -27
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/package.json +1 -1
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/packages/rpc-client/package.json +1 -1
- package/packages/rpc-client/tsconfig.tsbuildinfo +1 -1
- package/pkg/dist/modes/interactive/theme/theme-schema.d.ts +70 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.js +77 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.js.map +1 -0
- package/pkg/dist/modes/interactive/theme/theme.d.ts +1 -66
- package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.js +1 -75
- package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.d.ts +1 -1
- package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.js +192 -24
- package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
- package/pkg/package.json +1 -1
- package/src/resources/agents/researcher.md +1 -1
- package/src/resources/extensions/ask-user-questions.ts +24 -6
- package/src/resources/extensions/claude-code-cli/models.ts +9 -0
- package/src/resources/extensions/claude-code-cli/readiness.ts +36 -2
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +94 -4
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +84 -0
- package/src/resources/extensions/gsd/auto/detect-stuck.ts +10 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +2 -9
- package/src/resources/extensions/gsd/auto/loop.ts +109 -3
- package/src/resources/extensions/gsd/auto/phases.ts +146 -66
- package/src/resources/extensions/gsd/auto/resolve.ts +1 -1
- package/src/resources/extensions/gsd/auto/run-unit.ts +11 -1
- package/src/resources/extensions/gsd/auto/session.ts +7 -0
- package/src/resources/extensions/gsd/auto-artifact-paths.ts +20 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +46 -5
- package/src/resources/extensions/gsd/auto-direct-dispatch.ts +15 -2
- package/src/resources/extensions/gsd/auto-dispatch.ts +141 -9
- package/src/resources/extensions/gsd/auto-loop.ts +1 -1
- package/src/resources/extensions/gsd/auto-model-selection.ts +72 -18
- package/src/resources/extensions/gsd/auto-post-unit.ts +10 -8
- package/src/resources/extensions/gsd/auto-prompts.ts +232 -47
- package/src/resources/extensions/gsd/auto-recovery.ts +63 -1
- package/src/resources/extensions/gsd/auto-start.ts +8 -6
- package/src/resources/extensions/gsd/auto-verification.ts +36 -3
- package/src/resources/extensions/gsd/auto-worktree.ts +81 -1
- package/src/resources/extensions/gsd/auto.ts +61 -28
- package/src/resources/extensions/gsd/blocked-models.ts +98 -0
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +105 -21
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +46 -24
- package/src/resources/extensions/gsd/bootstrap/memory-tools.ts +163 -0
- package/src/resources/extensions/gsd/bootstrap/query-tools.ts +31 -0
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +15 -0
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +22 -0
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +89 -10
- package/src/resources/extensions/gsd/commands/catalog.ts +74 -9
- package/src/resources/extensions/gsd/commands/handlers/core.ts +69 -27
- package/src/resources/extensions/gsd/commands/handlers/escalate.ts +216 -0
- package/src/resources/extensions/gsd/commands/handlers/onboarding.ts +196 -0
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +21 -0
- package/src/resources/extensions/gsd/commands/handlers/workflow.ts +279 -29
- package/src/resources/extensions/gsd/commands-cmux.ts +6 -2
- package/src/resources/extensions/gsd/commands-config.ts +10 -0
- package/src/resources/extensions/gsd/commands-debug.ts +484 -0
- package/src/resources/extensions/gsd/commands-do.ts +1 -0
- package/src/resources/extensions/gsd/commands-extract-learnings.ts +262 -78
- package/src/resources/extensions/gsd/commands-handlers.ts +19 -2
- package/src/resources/extensions/gsd/commands-memory.ts +551 -0
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +49 -12
- package/src/resources/extensions/gsd/commands-scan.ts +125 -0
- package/src/resources/extensions/gsd/commands-workflow-templates.ts +129 -2
- package/src/resources/extensions/gsd/custom-workflow-engine.ts +85 -60
- package/src/resources/extensions/gsd/db-writer.ts +91 -17
- package/src/resources/extensions/gsd/debug-session-store.ts +377 -0
- package/src/resources/extensions/gsd/definition-loader.ts +7 -0
- package/src/resources/extensions/gsd/docs/preferences-reference.md +9 -9
- package/src/resources/extensions/gsd/doctor-environment.ts +2 -1
- package/src/resources/extensions/gsd/doctor-git-checks.ts +51 -30
- package/src/resources/extensions/gsd/doctor-proactive.ts +4 -1
- package/src/resources/extensions/gsd/doctor-providers.ts +109 -26
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +23 -4
- package/src/resources/extensions/gsd/doctor-types.ts +1 -0
- package/src/resources/extensions/gsd/doctor.ts +7 -1
- package/src/resources/extensions/gsd/ecosystem/gsd-extension-api.ts +2 -0
- package/src/resources/extensions/gsd/error-classifier.ts +32 -3
- package/src/resources/extensions/gsd/escalation.ts +367 -0
- package/src/resources/extensions/gsd/forensics.ts +25 -29
- package/src/resources/extensions/gsd/git-service.ts +0 -1
- package/src/resources/extensions/gsd/graph.ts +33 -3
- package/src/resources/extensions/gsd/gsd-db.ts +617 -32
- package/src/resources/extensions/gsd/health-widget-core.ts +43 -14
- package/src/resources/extensions/gsd/health-widget.ts +7 -3
- package/src/resources/extensions/gsd/hook-emitter.ts +188 -0
- package/src/resources/extensions/gsd/init-wizard.ts +87 -54
- package/src/resources/extensions/gsd/markdown-renderer.ts +5 -5
- package/src/resources/extensions/gsd/memory-backfill.ts +140 -0
- package/src/resources/extensions/gsd/memory-embeddings.ts +235 -0
- package/src/resources/extensions/gsd/memory-extractor.ts +100 -34
- package/src/resources/extensions/gsd/memory-ingest.ts +286 -0
- package/src/resources/extensions/gsd/memory-relations.ts +240 -0
- package/src/resources/extensions/gsd/memory-source-store.ts +138 -0
- package/src/resources/extensions/gsd/memory-store.ts +377 -7
- package/src/resources/extensions/gsd/metrics.ts +1 -0
- package/src/resources/extensions/gsd/model-cost-table.ts +3 -1
- package/src/resources/extensions/gsd/model-router.ts +25 -6
- package/src/resources/extensions/gsd/native-git-bridge.ts +134 -6
- package/src/resources/extensions/gsd/notification-overlay.ts +9 -19
- package/src/resources/extensions/gsd/notification-widget.ts +25 -43
- package/src/resources/extensions/gsd/notifications.ts +6 -0
- package/src/resources/extensions/gsd/onboarding-state.ts +146 -0
- package/src/resources/extensions/gsd/post-execution-checks.ts +37 -14
- package/src/resources/extensions/gsd/pre-execution-checks.ts +106 -12
- package/src/resources/extensions/gsd/preferences-models.ts +1 -0
- package/src/resources/extensions/gsd/preferences-types.ts +10 -2
- package/src/resources/extensions/gsd/preferences-validation.ts +33 -7
- package/src/resources/extensions/gsd/preferences.ts +10 -10
- package/src/resources/extensions/gsd/prompts/add-tests.md +1 -0
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +4 -1
- package/src/resources/extensions/gsd/prompts/complete-slice.md +2 -2
- package/src/resources/extensions/gsd/prompts/debug-diagnose.md +27 -0
- package/src/resources/extensions/gsd/prompts/debug-session-manager.md +80 -0
- package/src/resources/extensions/gsd/prompts/execute-task.md +16 -3
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +12 -0
- package/src/resources/extensions/gsd/prompts/plan-slice.md +2 -0
- package/src/resources/extensions/gsd/prompts/refine-slice.md +69 -0
- package/src/resources/extensions/gsd/prompts/research-slice.md +1 -0
- package/src/resources/extensions/gsd/prompts/scan.md +79 -0
- package/src/resources/extensions/gsd/prompts/workflow-oneshot.md +26 -0
- package/src/resources/extensions/gsd/python-resolver.ts +76 -0
- package/src/resources/extensions/gsd/run-manager.ts +53 -19
- package/src/resources/extensions/gsd/setup-catalog.ts +105 -0
- package/src/resources/extensions/gsd/state.ts +95 -6
- package/src/resources/extensions/gsd/templates/PREFERENCES.md +7 -7
- package/src/resources/extensions/gsd/tests/agent-end-retry.test.ts +1 -34
- package/src/resources/extensions/gsd/tests/artifact-corruption-2630.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +49 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +45 -31
- package/src/resources/extensions/gsd/tests/auto-migrating-recovery.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +95 -1
- package/src/resources/extensions/gsd/tests/auto-prompts-fallback.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +123 -1
- package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/autocomplete-regressions-1675.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/blocked-models.test.ts +98 -0
- package/src/resources/extensions/gsd/tests/bundled-skill-triggers.test.ts +54 -0
- package/src/resources/extensions/gsd/tests/commands-do.test.ts +48 -0
- package/src/resources/extensions/gsd/tests/commands-extract-learnings.test.ts +335 -21
- package/src/resources/extensions/gsd/tests/commands-scan.test.ts +351 -0
- package/src/resources/extensions/gsd/tests/commands-workflow-custom.test.ts +8 -6
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +6 -8
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/custom-workflow-engine.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/debug-command-handler.test.ts +905 -0
- package/src/resources/extensions/gsd/tests/debug-command-lifecycle.integration.test.ts +1229 -0
- package/src/resources/extensions/gsd/tests/debug-session-store.test.ts +565 -0
- package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/derive-state-helpers.test.ts +8 -4
- package/src/resources/extensions/gsd/tests/discuss-milestone-structured-questions.test.ts +64 -0
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +67 -0
- package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +175 -17
- package/src/resources/extensions/gsd/tests/enhanced-verification-integration.test.ts +5 -0
- package/src/resources/extensions/gsd/tests/ensure-db-open.test.ts +306 -1
- package/src/resources/extensions/gsd/tests/escalation.test.ts +818 -0
- package/src/resources/extensions/gsd/tests/finalize-timeout-guard.test.ts +29 -12
- package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +145 -8
- package/src/resources/extensions/gsd/tests/forensics-hook-key-parse.test.ts +74 -0
- package/src/resources/extensions/gsd/tests/freeform-decisions.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/graph-operations.test.ts +0 -4
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +44 -1
- package/src/resources/extensions/gsd/tests/health-widget.test.ts +8 -2
- package/src/resources/extensions/gsd/tests/init-prefs-routing.test.ts +190 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-git-symlink-cwd.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-git.test.ts +117 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-proactive.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-runtime.test.ts +68 -1
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +109 -11
- package/src/resources/extensions/gsd/tests/integration/idle-recovery.test.ts +51 -0
- package/src/resources/extensions/gsd/tests/integration/integration-proof.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/integration/test-isolation.ts +53 -0
- package/src/resources/extensions/gsd/tests/interactive-routing-bypass.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +206 -1
- package/src/resources/extensions/gsd/tests/load-memory-block.test.ts +36 -0
- package/src/resources/extensions/gsd/tests/md-importer.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/memory-embeddings.test.ts +213 -0
- package/src/resources/extensions/gsd/tests/memory-ingest.test.ts +153 -0
- package/src/resources/extensions/gsd/tests/memory-maintenance.test.ts +107 -0
- package/src/resources/extensions/gsd/tests/memory-relations.test.ts +175 -0
- package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/memory-tools.test.ts +295 -0
- package/src/resources/extensions/gsd/tests/milestone-status-tool.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/model-cost-table.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/model-router.test.ts +51 -1
- package/src/resources/extensions/gsd/tests/model-unittype-mapping.test.ts +59 -0
- package/src/resources/extensions/gsd/tests/notification-overlay.test.ts +56 -37
- package/src/resources/extensions/gsd/tests/notification-widget.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/onboarding-state.test.ts +105 -0
- package/src/resources/extensions/gsd/tests/plan-milestone-boundary-map-preservation.test.ts +114 -0
- package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +4 -5
- package/src/resources/extensions/gsd/tests/plan-slice.test.ts +17 -0
- package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +105 -1
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +341 -6
- package/src/resources/extensions/gsd/tests/preferences.test.ts +69 -1
- package/src/resources/extensions/gsd/tests/progressive-planning.test.ts +539 -0
- package/src/resources/extensions/gsd/tests/projection-no-plan-overwrite.test.ts +11 -2
- package/src/resources/extensions/gsd/tests/projection-regression.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/prompt-budget-enforcement.test.ts +159 -8
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +24 -0
- package/src/resources/extensions/gsd/tests/prompt-db.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/prompts-no-gitignored-test-refs.test.ts +56 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +88 -4
- package/src/resources/extensions/gsd/tests/python-resolver.test.ts +131 -0
- package/src/resources/extensions/gsd/tests/register-hooks-depth-verification.test.ts +67 -0
- package/src/resources/extensions/gsd/tests/remote-notification-from-desktop.test.ts +107 -0
- package/src/resources/extensions/gsd/tests/requirements.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +153 -0
- package/src/resources/extensions/gsd/tests/skip-slice-cascades-tasks.test.ts +125 -0
- package/src/resources/extensions/gsd/tests/slice-context-injection.test.ts +16 -4
- package/src/resources/extensions/gsd/tests/stash-queued-context-files.test.ts +54 -0
- package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/stuck-detection-coverage.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/summary-render-parity.test.ts +5 -0
- package/src/resources/extensions/gsd/tests/uok-contracts.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/uok-flags.test.ts +31 -1
- package/src/resources/extensions/gsd/tests/uok-kernel-path.test.ts +166 -0
- package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +9 -3
- package/src/resources/extensions/gsd/tests/verification-gate.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/workflow-install.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/workflow-logger-wiring.test.ts +15 -6
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/workflow-plugins.test.ts +310 -0
- package/src/resources/extensions/gsd/tests/workflow-projections.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/workflow-templates.test.ts +8 -2
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +97 -0
- package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +77 -2
- package/src/resources/extensions/gsd/tools/complete-task.ts +87 -0
- package/src/resources/extensions/gsd/tools/memory-tools.ts +410 -0
- package/src/resources/extensions/gsd/tools/plan-milestone.ts +42 -8
- package/src/resources/extensions/gsd/tools/plan-slice.ts +6 -1
- package/src/resources/extensions/gsd/tools/skip-slice.ts +133 -0
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +14 -0
- package/src/resources/extensions/gsd/types.ts +62 -0
- package/src/resources/extensions/gsd/unit-runtime.ts +1 -0
- package/src/resources/extensions/gsd/uok/contracts.ts +2 -1
- package/src/resources/extensions/gsd/uok/flags.ts +7 -7
- package/src/resources/extensions/gsd/uok/kernel.ts +16 -4
- package/src/resources/extensions/gsd/verification-gate.ts +2 -1
- package/src/resources/extensions/gsd/workflow-dispatch.ts +106 -0
- package/src/resources/extensions/gsd/workflow-install.ts +423 -0
- package/src/resources/extensions/gsd/workflow-logger.ts +4 -1
- package/src/resources/extensions/gsd/workflow-manifest.ts +8 -0
- package/src/resources/extensions/gsd/workflow-mcp.ts +1 -6
- package/src/resources/extensions/gsd/workflow-plugins.ts +403 -0
- package/src/resources/extensions/gsd/workflow-projections.ts +18 -16
- package/src/resources/extensions/gsd/workflow-templates/accessibility-audit.md +88 -0
- package/src/resources/extensions/gsd/workflow-templates/api-breaking-change.md +117 -0
- package/src/resources/extensions/gsd/workflow-templates/bugfix.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/changelog-gen.md +82 -0
- package/src/resources/extensions/gsd/workflow-templates/ci-bootstrap.md +144 -0
- package/src/resources/extensions/gsd/workflow-templates/dead-code.md +81 -0
- package/src/resources/extensions/gsd/workflow-templates/dep-upgrade.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/docs-sync.yaml +76 -0
- package/src/resources/extensions/gsd/workflow-templates/env-audit.yaml +88 -0
- package/src/resources/extensions/gsd/workflow-templates/full-project.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/hotfix.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/issue-triage.md +84 -0
- package/src/resources/extensions/gsd/workflow-templates/observability-setup.md +133 -0
- package/src/resources/extensions/gsd/workflow-templates/onboarding-check.md +74 -0
- package/src/resources/extensions/gsd/workflow-templates/performance-audit.md +125 -0
- package/src/resources/extensions/gsd/workflow-templates/pr-review.md +67 -0
- package/src/resources/extensions/gsd/workflow-templates/pr-triage.md +83 -0
- package/src/resources/extensions/gsd/workflow-templates/refactor.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/registry.json +184 -0
- package/src/resources/extensions/gsd/workflow-templates/release.md +118 -0
- package/src/resources/extensions/gsd/workflow-templates/rename-symbol.yaml +99 -0
- package/src/resources/extensions/gsd/workflow-templates/security-audit.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/small-feature.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/spike.md +7 -0
- package/src/resources/extensions/gsd/workflow-templates/test-backfill.yaml +73 -0
- package/src/resources/extensions/gsd/workflow-templates.ts +7 -0
- package/src/resources/extensions/gsd/workspace-index.ts +9 -4
- package/src/resources/extensions/gsd/worktree-resolver.ts +47 -1
- package/src/resources/extensions/remote-questions/commands.ts +480 -0
- package/src/resources/extensions/remote-questions/manager.ts +49 -4
- package/src/resources/extensions/remote-questions/telegram-adapter.ts +86 -4
- package/src/resources/extensions/remote-questions/tests/command-polling.test.ts +246 -0
- package/src/resources/extensions/remote-questions/tests/remote-answer-normalization.test.ts +92 -0
- package/src/resources/extensions/remote-questions/tests/telegram-commands.test.ts +267 -0
- package/src/resources/extensions/search-the-web/command-search-provider.ts +5 -1
- package/src/resources/extensions/search-the-web/native-search.ts +50 -4
- package/src/resources/extensions/shared/interview-ui.ts +195 -1
- package/src/resources/extensions/shared/layout-utils.ts +26 -0
- package/src/resources/extensions/shared/rtk-shared.ts +58 -0
- package/src/resources/extensions/shared/rtk.ts +12 -52
- package/src/resources/extensions/shared/tests/interview-preview.test.ts +177 -0
- package/src/resources/extensions/shared/tests/preview-layout.test.ts +120 -0
- package/src/resources/skills/api-design/SKILL.md +190 -0
- package/src/resources/skills/create-mcp-server/SKILL.md +121 -0
- package/src/resources/skills/create-workflow/SKILL.md +33 -6
- package/src/resources/skills/decompose-into-slices/SKILL.md +139 -0
- package/src/resources/skills/dependency-upgrade/SKILL.md +158 -0
- package/src/resources/skills/design-an-interface/SKILL.md +102 -0
- package/src/resources/skills/forensics/SKILL.md +153 -0
- package/src/resources/skills/grill-me/SKILL.md +93 -0
- package/src/resources/skills/handoff/SKILL.md +121 -0
- package/src/resources/skills/observability/SKILL.md +174 -0
- package/src/resources/skills/security-review/SKILL.md +181 -0
- package/src/resources/skills/spike-wrap-up/SKILL.md +138 -0
- package/src/resources/skills/tdd/SKILL.md +112 -0
- package/src/resources/skills/verify-before-complete/SKILL.md +97 -0
- package/src/resources/skills/write-docs/SKILL.md +81 -0
- package/src/resources/skills/write-milestone-brief/SKILL.md +135 -0
- package/dist/web/standalone/.next/static/chunks/2826.dd3dc8bbd3025fa5.js +0 -9
- 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/css/f6e8833d46e738d8.css +0 -1
- package/packages/native/dist/ps/types.d.ts +0 -5
- package/packages/native/dist/ps/types.js +0 -2
- package/packages/native/src/ps/types.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/LICENSE +0 -201
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/README.md +0 -9
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-cjs/index.js +0 -762
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js +0 -19
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/constants.js +0 -1
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +0 -9
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/index.js +0 -3
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +0 -230
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +0 -87
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +0 -32
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +0 -169
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/readable.mock.js +0 -21
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/server.mock.js +0 -88
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js +0 -36
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js +0 -21
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js +0 -22
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +0 -23
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +0 -8
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js +0 -41
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/readable.mock.js +0 -21
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/timing.js +0 -4
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +0 -63
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/build-abort-error.d.ts +0 -10
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/constants.d.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/get-transformed-headers.d.ts +0 -4
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +0 -3
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +0 -46
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +0 -24
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +0 -63
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/readable.mock.d.ts +0 -13
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/server.mock.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +0 -2
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-request-timeout.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +0 -2
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/index.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/readable.mock.d.ts +0 -13
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/timing.d.ts +0 -8
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/build-abort-error.d.ts +0 -10
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/constants.d.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts +0 -4
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/index.d.ts +0 -3
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +0 -46
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +0 -24
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +0 -63
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/readable.mock.d.ts +0 -13
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/server.mock.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +0 -2
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-request-timeout.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +0 -2
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/collector.d.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/index.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/readable.mock.d.ts +0 -13
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/timing.d.ts +0 -8
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/package.json +0 -68
- package/packages/pi-ai/oauth.d.ts +0 -1
- package/packages/pi-ai/oauth.js +0 -1
- /package/dist/web/standalone/.next/static/{prkokVQFxWtUVIku57_0z → YnUwu2WWaT0_hyTLUF4nq}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{prkokVQFxWtUVIku57_0z → YnUwu2WWaT0_hyTLUF4nq}/_ssgManifest.js +0 -0
|
@@ -22,10 +22,12 @@ type WorkflowToolExecutors = {
|
|
|
22
22
|
depends: string[];
|
|
23
23
|
demo: string;
|
|
24
24
|
goal: string;
|
|
25
|
-
successCriteria
|
|
26
|
-
proofLevel
|
|
27
|
-
integrationClosure
|
|
28
|
-
observabilityImpact
|
|
25
|
+
successCriteria?: string;
|
|
26
|
+
proofLevel?: string;
|
|
27
|
+
integrationClosure?: string;
|
|
28
|
+
observabilityImpact?: string;
|
|
29
|
+
isSketch?: boolean;
|
|
30
|
+
sketchScope?: string;
|
|
29
31
|
}>;
|
|
30
32
|
status?: string;
|
|
31
33
|
dependsOn?: string[];
|
|
@@ -209,6 +211,13 @@ type WorkflowToolExecutors = {
|
|
|
209
211
|
keyFiles?: string[];
|
|
210
212
|
keyDecisions?: string[];
|
|
211
213
|
blockerDiscovered?: boolean;
|
|
214
|
+
escalation?: {
|
|
215
|
+
question: string;
|
|
216
|
+
options: Array<{ id: string; label: string; tradeoffs: string }>;
|
|
217
|
+
recommendation: string;
|
|
218
|
+
recommendationRationale: string;
|
|
219
|
+
continueWithDefault: boolean;
|
|
220
|
+
};
|
|
212
221
|
verificationEvidence?: Array<
|
|
213
222
|
{ command: string; exitCode: number; verdict: string; durationMs: number } | string
|
|
214
223
|
>;
|
|
@@ -279,32 +288,53 @@ function resolveExternalStateRoot(allowedRoot: string): string | null {
|
|
|
279
288
|
}
|
|
280
289
|
}
|
|
281
290
|
|
|
282
|
-
function validateProjectDir(projectDir: string, env: NodeJS.ProcessEnv = process.env): string {
|
|
291
|
+
export function validateProjectDir(projectDir: string, env: NodeJS.ProcessEnv = process.env): string {
|
|
283
292
|
if (!isAbsolute(projectDir)) {
|
|
284
293
|
throw new Error(`projectDir must be an absolute path. Received: ${projectDir}`);
|
|
285
294
|
}
|
|
286
295
|
|
|
287
|
-
const
|
|
296
|
+
const lexicallyResolved = resolve(projectDir);
|
|
297
|
+
// Resolve symlinks on the candidate before the containment check so that a
|
|
298
|
+
// symlink inside the allowed root pointing outside of it cannot bypass the
|
|
299
|
+
// guard. Falls back to the lexical path if the candidate does not exist yet
|
|
300
|
+
// (legitimate for a brand-new worktree dir about to be created).
|
|
301
|
+
const resolvedProjectDir = safeRealpath(lexicallyResolved);
|
|
302
|
+
|
|
288
303
|
const allowedRoot = getAllowedProjectRoot(env);
|
|
289
304
|
if (!allowedRoot) return resolvedProjectDir;
|
|
290
305
|
|
|
291
|
-
|
|
306
|
+
const resolvedAllowedRoot = safeRealpath(allowedRoot);
|
|
307
|
+
if (isWithinRoot(resolvedProjectDir, resolvedAllowedRoot)) return resolvedProjectDir;
|
|
292
308
|
|
|
293
309
|
// External state layout: `<allowedRoot>/.gsd` may be a symlink into
|
|
294
310
|
// `~/.gsd/projects/<hash>/`, and auto-worktrees live under
|
|
295
311
|
// `~/.gsd/projects/<hash>/worktrees/<MID>/`. Accept candidates that are
|
|
296
312
|
// under the realpath of `<allowedRoot>/.gsd` — they belong to this project
|
|
297
313
|
// even though their absolute path is outside allowedRoot (#issue-a44).
|
|
298
|
-
const externalRoot = resolveExternalStateRoot(
|
|
314
|
+
const externalRoot = resolveExternalStateRoot(resolvedAllowedRoot);
|
|
299
315
|
if (externalRoot && isWithinRoot(resolvedProjectDir, externalRoot)) {
|
|
300
316
|
return resolvedProjectDir;
|
|
301
317
|
}
|
|
302
318
|
|
|
303
319
|
throw new Error(
|
|
304
|
-
`projectDir must stay within the configured workflow project root. Received: ${resolvedProjectDir}; allowed root: ${
|
|
320
|
+
`projectDir must stay within the configured workflow project root. Received: ${resolvedProjectDir}; allowed root: ${resolvedAllowedRoot}`,
|
|
305
321
|
);
|
|
306
322
|
}
|
|
307
323
|
|
|
324
|
+
function safeRealpath(path: string): string {
|
|
325
|
+
try {
|
|
326
|
+
return realpathSync(path);
|
|
327
|
+
} catch (err) {
|
|
328
|
+
// Only fall back for non-existent paths — a legitimate case when a worktree
|
|
329
|
+
// directory hasn't been created yet. Permission errors (EACCES), not-a-
|
|
330
|
+
// directory (ENOTDIR), etc. must propagate so we do not silently degrade
|
|
331
|
+
// to a lexical-only containment check that a restricted symlink could
|
|
332
|
+
// bypass.
|
|
333
|
+
if ((err as NodeJS.ErrnoException)?.code === "ENOENT") return path;
|
|
334
|
+
throw err;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
308
338
|
function parseToolArgs<T>(schema: z.ZodType<T>, args: Record<string, unknown>): T {
|
|
309
339
|
return schema.parse(args);
|
|
310
340
|
}
|
|
@@ -569,11 +599,39 @@ export const WORKFLOW_TOOL_NAMES = [
|
|
|
569
599
|
"gsd_complete_task",
|
|
570
600
|
"gsd_milestone_status",
|
|
571
601
|
"gsd_journal_query",
|
|
602
|
+
// ADR-013 step 3: memory-store tools exposed to external MCP clients.
|
|
603
|
+
// gsd_memory_graph is namespaced to avoid collision with the existing
|
|
604
|
+
// gsd_graph tool (project knowledge graph from .gsd/ artifacts).
|
|
605
|
+
"gsd_capture_thought",
|
|
606
|
+
"gsd_memory_query",
|
|
607
|
+
"gsd_memory_graph",
|
|
572
608
|
] as const;
|
|
573
609
|
|
|
610
|
+
const DEFAULT_WORKFLOW_OP_TIMEOUT_MS = 5 * 60 * 1000;
|
|
611
|
+
|
|
612
|
+
function getWorkflowOpTimeoutMs(env: NodeJS.ProcessEnv = process.env): number {
|
|
613
|
+
const raw = env.GSD_MCP_WORKFLOW_TIMEOUT_MS?.trim();
|
|
614
|
+
if (!raw) return DEFAULT_WORKFLOW_OP_TIMEOUT_MS;
|
|
615
|
+
const parsed = Number.parseInt(raw, 10);
|
|
616
|
+
if (!Number.isFinite(parsed) || parsed < 0) return DEFAULT_WORKFLOW_OP_TIMEOUT_MS;
|
|
617
|
+
return parsed; // 0 disables the timeout
|
|
618
|
+
}
|
|
619
|
+
|
|
574
620
|
async function runSerializedWorkflowOperation<T>(fn: () => Promise<T>): Promise<T> {
|
|
575
621
|
// The shared DB adapter and workflow log base path are process-global, so
|
|
576
622
|
// workflow MCP mutations must not overlap within a single server process.
|
|
623
|
+
// A per-operation deadline prevents a single stuck call from wedging every
|
|
624
|
+
// subsequent write for the lifetime of the process.
|
|
625
|
+
//
|
|
626
|
+
// Known limitation: on timeout we surface an error and release the queue,
|
|
627
|
+
// but Promise.race cannot cancel the underlying `fn()` — it may continue
|
|
628
|
+
// running in the background and overlap with the next admitted operation.
|
|
629
|
+
// Proper cancellation requires threading an AbortSignal through every
|
|
630
|
+
// workflow executor (`workflow-tool-executors.ts` and friends), which is
|
|
631
|
+
// a larger change. The current trade-off: risk a theoretical overlap after
|
|
632
|
+
// a 5-minute wall-clock timeout vs permanently wedging the server. The
|
|
633
|
+
// overlap window is bounded by how long the zombie `fn()` keeps running;
|
|
634
|
+
// in practice DB writes complete quickly even when the caller gave up.
|
|
577
635
|
const prior = workflowExecutionQueue;
|
|
578
636
|
let release!: () => void;
|
|
579
637
|
workflowExecutionQueue = new Promise<void>((resolve) => {
|
|
@@ -581,8 +639,22 @@ async function runSerializedWorkflowOperation<T>(fn: () => Promise<T>): Promise<
|
|
|
581
639
|
});
|
|
582
640
|
|
|
583
641
|
await prior;
|
|
642
|
+
const timeoutMs = getWorkflowOpTimeoutMs();
|
|
584
643
|
try {
|
|
585
|
-
|
|
644
|
+
if (timeoutMs === 0) {
|
|
645
|
+
return await fn();
|
|
646
|
+
}
|
|
647
|
+
let timer: NodeJS.Timeout | undefined;
|
|
648
|
+
const timeoutPromise = new Promise<never>((_, reject) => {
|
|
649
|
+
timer = setTimeout(() => {
|
|
650
|
+
reject(new Error(`Workflow operation exceeded ${timeoutMs}ms deadline (GSD_MCP_WORKFLOW_TIMEOUT_MS)`));
|
|
651
|
+
}, timeoutMs);
|
|
652
|
+
});
|
|
653
|
+
try {
|
|
654
|
+
return await Promise.race([fn(), timeoutPromise]);
|
|
655
|
+
} finally {
|
|
656
|
+
if (timer) clearTimeout(timer);
|
|
657
|
+
}
|
|
586
658
|
} finally {
|
|
587
659
|
release();
|
|
588
660
|
}
|
|
@@ -751,34 +823,81 @@ const projectDirParam = z
|
|
|
751
823
|
.optional()
|
|
752
824
|
.describe("Optional. Omit this field — the server defaults to its current working directory, which is already the correct project or worktree root.");
|
|
753
825
|
|
|
826
|
+
const nonEmptyString = (field: string) =>
|
|
827
|
+
z.string().trim().min(1, `${field} must be a non-empty string`);
|
|
828
|
+
|
|
829
|
+
// Optional non-empty string: accepts omitted/undefined but rejects "" or
|
|
830
|
+
// whitespace. Mirrors executor guards of the form
|
|
831
|
+
// `value !== undefined && !isNonEmptyString(value)` — e.g. plan-task's
|
|
832
|
+
// observabilityImpact. Do not preprocess "" to undefined; the executor
|
|
833
|
+
// treats them differently.
|
|
834
|
+
const optionalNonEmptyString = (field: string) => nonEmptyString(field).optional();
|
|
835
|
+
|
|
836
|
+
// Array of non-empty strings. Mirrors executor guards that call
|
|
837
|
+
// `validateStringArray` or `arr.some((item) => !isNonEmptyString(item))`.
|
|
838
|
+
const nonEmptyStringArray = (field: string) =>
|
|
839
|
+
z.array(nonEmptyString(`${field}[]`));
|
|
840
|
+
|
|
841
|
+
// Matches the executor's `isNonEmptyString` (trim + length>0) so Zod rejects
|
|
842
|
+
// empty/whitespace fields at parse time. Without this, MCP callers pass "" for
|
|
843
|
+
// the heavy planning fields, Zod accepts it, and the executor rejects one
|
|
844
|
+
// field per call — forcing the agent into a retry loop to discover every gap.
|
|
845
|
+
const planMilestoneSliceSchema = z.object({
|
|
846
|
+
sliceId: nonEmptyString("sliceId"),
|
|
847
|
+
title: nonEmptyString("title"),
|
|
848
|
+
risk: nonEmptyString("risk"),
|
|
849
|
+
depends: z.array(z.string()),
|
|
850
|
+
demo: nonEmptyString("demo"),
|
|
851
|
+
goal: nonEmptyString("goal"),
|
|
852
|
+
// ADR-011: heavy planning fields are optional for sketch slices; required for full slices.
|
|
853
|
+
successCriteria: z.string().optional(),
|
|
854
|
+
proofLevel: z.string().optional(),
|
|
855
|
+
integrationClosure: z.string().optional(),
|
|
856
|
+
observabilityImpact: z.string().optional(),
|
|
857
|
+
// ADR-011 sketch-then-refine fields.
|
|
858
|
+
isSketch: z.boolean().optional().describe("ADR-011: true marks this slice as a sketch awaiting refine-slice expansion"),
|
|
859
|
+
sketchScope: z.string().optional().describe("ADR-011: 2-3 sentence scope boundary, required when isSketch=true"),
|
|
860
|
+
}).superRefine((slice, ctx) => {
|
|
861
|
+
if (slice.isSketch === true) {
|
|
862
|
+
if (typeof slice.sketchScope !== "string" || slice.sketchScope.trim().length === 0) {
|
|
863
|
+
ctx.addIssue({
|
|
864
|
+
code: z.ZodIssueCode.custom,
|
|
865
|
+
path: ["sketchScope"],
|
|
866
|
+
message: "sketchScope must be a non-empty string when isSketch is true",
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
return;
|
|
870
|
+
}
|
|
871
|
+
const required = ["successCriteria", "proofLevel", "integrationClosure", "observabilityImpact"] as const;
|
|
872
|
+
for (const field of required) {
|
|
873
|
+
const value = slice[field];
|
|
874
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
875
|
+
ctx.addIssue({
|
|
876
|
+
code: z.ZodIssueCode.custom,
|
|
877
|
+
path: [field],
|
|
878
|
+
message: `${field} must be a non-empty string`,
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
});
|
|
883
|
+
|
|
754
884
|
const planMilestoneParams = {
|
|
755
885
|
projectDir: projectDirParam,
|
|
756
|
-
milestoneId:
|
|
757
|
-
title:
|
|
758
|
-
vision:
|
|
759
|
-
slices: z.array(
|
|
760
|
-
sliceId: z.string(),
|
|
761
|
-
title: z.string(),
|
|
762
|
-
risk: z.string(),
|
|
763
|
-
depends: z.array(z.string()),
|
|
764
|
-
demo: z.string(),
|
|
765
|
-
goal: z.string(),
|
|
766
|
-
successCriteria: z.string(),
|
|
767
|
-
proofLevel: z.string(),
|
|
768
|
-
integrationClosure: z.string(),
|
|
769
|
-
observabilityImpact: z.string(),
|
|
770
|
-
})).describe("Planned slices for the milestone"),
|
|
886
|
+
milestoneId: nonEmptyString("milestoneId").describe("Milestone ID (e.g. M001)"),
|
|
887
|
+
title: nonEmptyString("title").describe("Milestone title"),
|
|
888
|
+
vision: nonEmptyString("vision").describe("Milestone vision"),
|
|
889
|
+
slices: z.array(planMilestoneSliceSchema).describe("Planned slices for the milestone"),
|
|
771
890
|
status: z.string().optional().describe("Milestone status"),
|
|
772
891
|
dependsOn: z.array(z.string()).optional().describe("Milestone dependencies"),
|
|
773
892
|
successCriteria: z.array(z.string()).optional().describe("Top-level success criteria bullets"),
|
|
774
893
|
keyRisks: z.array(z.object({
|
|
775
|
-
risk:
|
|
776
|
-
whyItMatters:
|
|
894
|
+
risk: nonEmptyString("risk"),
|
|
895
|
+
whyItMatters: nonEmptyString("whyItMatters"),
|
|
777
896
|
})).optional().describe("Structured risk entries"),
|
|
778
897
|
proofStrategy: z.array(z.object({
|
|
779
|
-
riskOrUnknown:
|
|
780
|
-
retireIn:
|
|
781
|
-
whatWillBeProven:
|
|
898
|
+
riskOrUnknown: nonEmptyString("riskOrUnknown"),
|
|
899
|
+
retireIn: nonEmptyString("retireIn"),
|
|
900
|
+
whatWillBeProven: nonEmptyString("whatWillBeProven"),
|
|
782
901
|
})).optional().describe("Structured proof strategy entries"),
|
|
783
902
|
verificationContract: z.string().optional(),
|
|
784
903
|
verificationIntegration: z.string().optional(),
|
|
@@ -792,19 +911,19 @@ const planMilestoneSchema = z.object(planMilestoneParams);
|
|
|
792
911
|
|
|
793
912
|
const planSliceParams = {
|
|
794
913
|
projectDir: projectDirParam,
|
|
795
|
-
milestoneId:
|
|
796
|
-
sliceId:
|
|
797
|
-
goal:
|
|
914
|
+
milestoneId: nonEmptyString("milestoneId").describe("Milestone ID (e.g. M001)"),
|
|
915
|
+
sliceId: nonEmptyString("sliceId").describe("Slice ID (e.g. S01)"),
|
|
916
|
+
goal: nonEmptyString("goal").describe("Slice goal"),
|
|
798
917
|
tasks: z.array(z.object({
|
|
799
|
-
taskId:
|
|
800
|
-
title:
|
|
801
|
-
description:
|
|
802
|
-
estimate:
|
|
803
|
-
files:
|
|
804
|
-
verify:
|
|
805
|
-
inputs:
|
|
806
|
-
expectedOutput:
|
|
807
|
-
observabilityImpact:
|
|
918
|
+
taskId: nonEmptyString("taskId"),
|
|
919
|
+
title: nonEmptyString("title"),
|
|
920
|
+
description: nonEmptyString("description"),
|
|
921
|
+
estimate: nonEmptyString("estimate"),
|
|
922
|
+
files: nonEmptyStringArray("files"),
|
|
923
|
+
verify: nonEmptyString("verify"),
|
|
924
|
+
inputs: nonEmptyStringArray("inputs"),
|
|
925
|
+
expectedOutput: nonEmptyStringArray("expectedOutput"),
|
|
926
|
+
observabilityImpact: optionalNonEmptyString("observabilityImpact"),
|
|
808
927
|
})).describe("Planned tasks for the slice"),
|
|
809
928
|
successCriteria: z.string().optional(),
|
|
810
929
|
proofLevel: z.string().optional(),
|
|
@@ -815,8 +934,8 @@ const planSliceSchema = z.object(planSliceParams);
|
|
|
815
934
|
|
|
816
935
|
const completeMilestoneParams = {
|
|
817
936
|
projectDir: projectDirParam,
|
|
818
|
-
milestoneId:
|
|
819
|
-
title:
|
|
937
|
+
milestoneId: nonEmptyString("milestoneId").describe("Milestone ID (e.g. M001)"),
|
|
938
|
+
title: nonEmptyString("title").describe("Milestone title"),
|
|
820
939
|
oneLiner: z.string().describe("One-sentence summary of what the milestone achieved"),
|
|
821
940
|
narrative: z.string().describe("Detailed narrative of what happened during the milestone"),
|
|
822
941
|
verificationPassed: z.boolean().describe("Must be true after milestone verification succeeds"),
|
|
@@ -833,7 +952,7 @@ const completeMilestoneSchema = z.object(completeMilestoneParams);
|
|
|
833
952
|
|
|
834
953
|
const validateMilestoneParams = {
|
|
835
954
|
projectDir: projectDirParam,
|
|
836
|
-
milestoneId:
|
|
955
|
+
milestoneId: nonEmptyString("milestoneId").describe("Milestone ID (e.g. M001)"),
|
|
837
956
|
verdict: z.enum(["pass", "needs-attention", "needs-remediation"]).describe("Validation verdict"),
|
|
838
957
|
remediationRound: z.number().describe("Remediation round (0 for first validation)"),
|
|
839
958
|
successCriteriaChecklist: z.string().describe("Markdown checklist of success criteria with evidence"),
|
|
@@ -847,8 +966,8 @@ const validateMilestoneParams = {
|
|
|
847
966
|
const validateMilestoneSchema = z.object(validateMilestoneParams);
|
|
848
967
|
|
|
849
968
|
const roadmapSliceChangeSchema = z.object({
|
|
850
|
-
sliceId:
|
|
851
|
-
title:
|
|
969
|
+
sliceId: nonEmptyString("sliceId"),
|
|
970
|
+
title: nonEmptyString("title"),
|
|
852
971
|
risk: z.string().optional(),
|
|
853
972
|
depends: z.array(z.string()).optional(),
|
|
854
973
|
demo: z.string().optional(),
|
|
@@ -856,10 +975,10 @@ const roadmapSliceChangeSchema = z.object({
|
|
|
856
975
|
|
|
857
976
|
const reassessRoadmapParams = {
|
|
858
977
|
projectDir: projectDirParam,
|
|
859
|
-
milestoneId:
|
|
860
|
-
completedSliceId:
|
|
861
|
-
verdict:
|
|
862
|
-
assessment:
|
|
978
|
+
milestoneId: nonEmptyString("milestoneId").describe("Milestone ID (e.g. M001)"),
|
|
979
|
+
completedSliceId: nonEmptyString("completedSliceId").describe("Slice ID that just completed"),
|
|
980
|
+
verdict: nonEmptyString("verdict").describe("Assessment verdict such as roadmap-confirmed or roadmap-adjusted"),
|
|
981
|
+
assessment: nonEmptyString("assessment").describe("Assessment text explaining the roadmap decision"),
|
|
863
982
|
sliceChanges: z.object({
|
|
864
983
|
modified: z.array(roadmapSliceChangeSchema),
|
|
865
984
|
added: z.array(roadmapSliceChangeSchema),
|
|
@@ -872,7 +991,7 @@ const saveGateResultParams = {
|
|
|
872
991
|
projectDir: projectDirParam,
|
|
873
992
|
milestoneId: z.string().describe("Milestone ID (e.g. M001)"),
|
|
874
993
|
sliceId: z.string().describe("Slice ID (e.g. S01)"),
|
|
875
|
-
gateId: z.
|
|
994
|
+
gateId: z.string().describe("Gate ID (e.g. Q3, Q4, Q5, Q6, Q7, Q8, MV01, MV02, MV03, MV04). Accepts any string for forward-compatibility with new gates."),
|
|
876
995
|
taskId: z.string().optional().describe("Task ID for task-scoped gates"),
|
|
877
996
|
verdict: z.enum(["pass", "flag", "omitted"]).describe("Gate verdict"),
|
|
878
997
|
rationale: z.string().describe("One-sentence justification"),
|
|
@@ -882,14 +1001,14 @@ const saveGateResultSchema = z.object(saveGateResultParams);
|
|
|
882
1001
|
|
|
883
1002
|
const replanSliceParams = {
|
|
884
1003
|
projectDir: projectDirParam,
|
|
885
|
-
milestoneId:
|
|
886
|
-
sliceId:
|
|
887
|
-
blockerTaskId:
|
|
888
|
-
blockerDescription:
|
|
889
|
-
whatChanged:
|
|
1004
|
+
milestoneId: nonEmptyString("milestoneId").describe("Milestone ID (e.g. M001)"),
|
|
1005
|
+
sliceId: nonEmptyString("sliceId").describe("Slice ID (e.g. S01)"),
|
|
1006
|
+
blockerTaskId: nonEmptyString("blockerTaskId").describe("Task ID that discovered the blocker"),
|
|
1007
|
+
blockerDescription: nonEmptyString("blockerDescription").describe("Description of the blocker"),
|
|
1008
|
+
whatChanged: nonEmptyString("whatChanged").describe("Summary of what changed in the plan"),
|
|
890
1009
|
updatedTasks: z.array(z.object({
|
|
891
|
-
taskId:
|
|
892
|
-
title:
|
|
1010
|
+
taskId: nonEmptyString("taskId"),
|
|
1011
|
+
title: nonEmptyString("title"),
|
|
893
1012
|
description: z.string(),
|
|
894
1013
|
estimate: z.string(),
|
|
895
1014
|
files: z.array(z.string()),
|
|
@@ -904,8 +1023,8 @@ const replanSliceSchema = z.object(replanSliceParams);
|
|
|
904
1023
|
|
|
905
1024
|
const sliceCompleteParams = {
|
|
906
1025
|
projectDir: projectDirParam,
|
|
907
|
-
sliceId:
|
|
908
|
-
milestoneId:
|
|
1026
|
+
sliceId: nonEmptyString("sliceId").describe("Slice ID (e.g. S01)"),
|
|
1027
|
+
milestoneId: nonEmptyString("milestoneId").describe("Milestone ID (e.g. M001)"),
|
|
909
1028
|
sliceTitle: z.string().describe("Title of the slice"),
|
|
910
1029
|
oneLiner: z.string().describe("One-line summary of what the slice accomplished"),
|
|
911
1030
|
narrative: z.string().describe("Detailed narrative of what happened across all tasks"),
|
|
@@ -1000,17 +1119,17 @@ const milestoneGenerateIdSchema = z.object(milestoneGenerateIdParams);
|
|
|
1000
1119
|
|
|
1001
1120
|
const planTaskParams = {
|
|
1002
1121
|
projectDir: projectDirParam,
|
|
1003
|
-
milestoneId:
|
|
1004
|
-
sliceId:
|
|
1005
|
-
taskId:
|
|
1006
|
-
title:
|
|
1007
|
-
description:
|
|
1008
|
-
estimate:
|
|
1122
|
+
milestoneId: nonEmptyString("milestoneId").describe("Milestone ID (e.g. M001)"),
|
|
1123
|
+
sliceId: nonEmptyString("sliceId").describe("Slice ID (e.g. S01)"),
|
|
1124
|
+
taskId: nonEmptyString("taskId").describe("Task ID (e.g. T01)"),
|
|
1125
|
+
title: nonEmptyString("title").describe("Task title"),
|
|
1126
|
+
description: nonEmptyString("description").describe("Task description / steps block"),
|
|
1127
|
+
estimate: nonEmptyString("estimate").describe("Task estimate"),
|
|
1009
1128
|
files: z.array(z.string()).describe("Files likely touched"),
|
|
1010
|
-
verify:
|
|
1129
|
+
verify: nonEmptyString("verify").describe("Verification command or block"),
|
|
1011
1130
|
inputs: z.array(z.string()).describe("Input files or references"),
|
|
1012
1131
|
expectedOutput: z.array(z.string()).describe("Expected output files or artifacts"),
|
|
1013
|
-
observabilityImpact:
|
|
1132
|
+
observabilityImpact: optionalNonEmptyString("observabilityImpact").describe("Task observability impact"),
|
|
1014
1133
|
};
|
|
1015
1134
|
const planTaskSchema = z.object(planTaskParams);
|
|
1016
1135
|
|
|
@@ -1024,9 +1143,9 @@ const skipSliceSchema = z.object(skipSliceParams);
|
|
|
1024
1143
|
|
|
1025
1144
|
const taskCompleteParams = {
|
|
1026
1145
|
projectDir: projectDirParam,
|
|
1027
|
-
taskId:
|
|
1028
|
-
sliceId:
|
|
1029
|
-
milestoneId:
|
|
1146
|
+
taskId: nonEmptyString("taskId").describe("Task ID (e.g. T01)"),
|
|
1147
|
+
sliceId: nonEmptyString("sliceId").describe("Slice ID (e.g. S01)"),
|
|
1148
|
+
milestoneId: nonEmptyString("milestoneId").describe("Milestone ID (e.g. M001)"),
|
|
1030
1149
|
oneLiner: z.string().describe("One-line summary of what was accomplished"),
|
|
1031
1150
|
narrative: z.string().describe("Detailed narrative of what happened during the task"),
|
|
1032
1151
|
verification: z.string().describe("What was verified and how"),
|
|
@@ -1035,6 +1154,20 @@ const taskCompleteParams = {
|
|
|
1035
1154
|
keyFiles: z.array(z.string()).optional().describe("List of key files created or modified"),
|
|
1036
1155
|
keyDecisions: z.array(z.string()).optional().describe("List of key decisions made during this task"),
|
|
1037
1156
|
blockerDiscovered: z.boolean().optional().describe("Whether a plan-invalidating blocker was discovered"),
|
|
1157
|
+
// ADR-011 Phase 2: mid-execution escalation — agent asks the user to resolve an ambiguity.
|
|
1158
|
+
escalation: z.object({
|
|
1159
|
+
question: z.string().describe("The question the user needs to answer — one clear sentence."),
|
|
1160
|
+
options: z.array(z.object({
|
|
1161
|
+
id: z.string().describe("Short id (e.g. 'A', 'B') used by /gsd escalate resolve."),
|
|
1162
|
+
label: z.string().describe("One-line label."),
|
|
1163
|
+
tradeoffs: z.string().describe("1-2 sentences on the tradeoffs of this option."),
|
|
1164
|
+
})).min(2).max(4).describe("2-4 options the user can choose between."),
|
|
1165
|
+
recommendation: z.string().describe("Option id the executor recommends."),
|
|
1166
|
+
recommendationRationale: z.string().describe("Why the recommendation — 1-2 sentences."),
|
|
1167
|
+
continueWithDefault: z.boolean().describe(
|
|
1168
|
+
"When true, loop continues (artifact logged for later review). When false, auto-mode pauses until the user resolves via /gsd escalate resolve.",
|
|
1169
|
+
),
|
|
1170
|
+
}).optional().describe("ADR-011 Phase 2: optional escalation payload. Only honored when phases.mid_execution_escalation is true."),
|
|
1038
1171
|
verificationEvidence: z.array(z.union([
|
|
1039
1172
|
z.object({
|
|
1040
1173
|
command: z.string(),
|
|
@@ -1182,7 +1315,19 @@ export function registerWorkflowTools(server: McpToolServer): void {
|
|
|
1182
1315
|
return reserved;
|
|
1183
1316
|
}
|
|
1184
1317
|
const allIds = [...new Set([...findMilestoneIds(projectDir), ...getReservedMilestoneIds()])];
|
|
1185
|
-
const
|
|
1318
|
+
const prefsMod = await importLocalModule<any>(
|
|
1319
|
+
"../../../src/resources/extensions/gsd/preferences.js",
|
|
1320
|
+
).catch(() => null);
|
|
1321
|
+
// Graceful degradation: a corrupt preferences file should not crash
|
|
1322
|
+
// milestone-id generation. Fall back to non-unique IDs if anything
|
|
1323
|
+
// throws here — matches the pre-fix behavior for missing prefs.
|
|
1324
|
+
let uniqueEnabled = false;
|
|
1325
|
+
try {
|
|
1326
|
+
uniqueEnabled = !!prefsMod?.loadEffectiveGSDPreferences?.()?.preferences?.unique_milestone_ids;
|
|
1327
|
+
} catch {
|
|
1328
|
+
uniqueEnabled = false;
|
|
1329
|
+
}
|
|
1330
|
+
const nextId = nextMilestoneId(allIds, uniqueEnabled);
|
|
1186
1331
|
await ensureMilestoneDbRow(nextId);
|
|
1187
1332
|
return nextId;
|
|
1188
1333
|
});
|
|
@@ -1210,7 +1355,19 @@ export function registerWorkflowTools(server: McpToolServer): void {
|
|
|
1210
1355
|
return reserved;
|
|
1211
1356
|
}
|
|
1212
1357
|
const allIds = [...new Set([...findMilestoneIds(projectDir), ...getReservedMilestoneIds()])];
|
|
1213
|
-
const
|
|
1358
|
+
const prefsMod = await importLocalModule<any>(
|
|
1359
|
+
"../../../src/resources/extensions/gsd/preferences.js",
|
|
1360
|
+
).catch(() => null);
|
|
1361
|
+
// Graceful degradation: a corrupt preferences file should not crash
|
|
1362
|
+
// milestone-id generation. Fall back to non-unique IDs if anything
|
|
1363
|
+
// throws here — matches the pre-fix behavior for missing prefs.
|
|
1364
|
+
let uniqueEnabled = false;
|
|
1365
|
+
try {
|
|
1366
|
+
uniqueEnabled = !!prefsMod?.loadEffectiveGSDPreferences?.()?.preferences?.unique_milestone_ids;
|
|
1367
|
+
} catch {
|
|
1368
|
+
uniqueEnabled = false;
|
|
1369
|
+
}
|
|
1370
|
+
const nextId = nextMilestoneId(allIds, uniqueEnabled);
|
|
1214
1371
|
await ensureMilestoneDbRow(nextId);
|
|
1215
1372
|
return nextId;
|
|
1216
1373
|
});
|
|
@@ -1474,8 +1631,10 @@ export function registerWorkflowTools(server: McpToolServer): void {
|
|
|
1474
1631
|
"Read the current status of a milestone and all its slices from the GSD database.",
|
|
1475
1632
|
milestoneStatusParams,
|
|
1476
1633
|
async (args: Record<string, unknown>) => {
|
|
1634
|
+
// gsd_milestone_status is a read-only query. In-process (query-tools.ts)
|
|
1635
|
+
// does not apply the write-gate; MCP must match to avoid blocking reads
|
|
1636
|
+
// during pending-gate or queue-mode states.
|
|
1477
1637
|
const { projectDir, milestoneId } = parseWorkflowArgs(milestoneStatusSchema, args);
|
|
1478
|
-
await enforceWorkflowWriteGate("gsd_milestone_status", projectDir, milestoneId);
|
|
1479
1638
|
const { executeMilestoneStatus } = await getWorkflowToolExecutors();
|
|
1480
1639
|
return runSerializedWorkflowOperation(() => executeMilestoneStatus({ milestoneId }, projectDir));
|
|
1481
1640
|
},
|
|
@@ -1495,4 +1654,129 @@ export function registerWorkflowTools(server: McpToolServer): void {
|
|
|
1495
1654
|
return { content: [{ type: "text" as const, text: JSON.stringify(entries, null, 2) }] };
|
|
1496
1655
|
},
|
|
1497
1656
|
);
|
|
1657
|
+
|
|
1658
|
+
// ─── ADR-013 step 3 — memory-store tools for external MCP clients ────────
|
|
1659
|
+
//
|
|
1660
|
+
// The same three tools the LLM sees in-process as `capture_thought`,
|
|
1661
|
+
// `memory_query`, and `gsd_graph` (the memory variant). MCP exposes them
|
|
1662
|
+
// under the gsd_* prefix and renames the memory graph to gsd_memory_graph
|
|
1663
|
+
// to avoid collision with the project knowledge graph tool registered as
|
|
1664
|
+
// `gsd_graph` in server.ts.
|
|
1665
|
+
|
|
1666
|
+
const MEMORY_CATEGORY = z.enum([
|
|
1667
|
+
"architecture",
|
|
1668
|
+
"convention",
|
|
1669
|
+
"gotcha",
|
|
1670
|
+
"preference",
|
|
1671
|
+
"environment",
|
|
1672
|
+
"pattern",
|
|
1673
|
+
]);
|
|
1674
|
+
|
|
1675
|
+
const captureThoughtSchema = z.object({
|
|
1676
|
+
projectDir: z.string().optional(),
|
|
1677
|
+
category: MEMORY_CATEGORY,
|
|
1678
|
+
// Reject empty / whitespace-only content at the schema layer so the LLM
|
|
1679
|
+
// never produces a memory row with no searchable text.
|
|
1680
|
+
content: z.string().trim().min(1, "content must be a non-empty trimmed string"),
|
|
1681
|
+
confidence: z.number().min(0.1).max(0.99).optional(),
|
|
1682
|
+
tags: z.array(z.string()).optional(),
|
|
1683
|
+
scope: z.string().optional(),
|
|
1684
|
+
structuredFields: z.record(z.string(), z.unknown()).optional(),
|
|
1685
|
+
});
|
|
1686
|
+
const captureThoughtParams = {
|
|
1687
|
+
projectDir: z.string().optional().describe("Absolute path to the project directory (defaults to MCP server cwd)"),
|
|
1688
|
+
category: MEMORY_CATEGORY.describe("Memory category"),
|
|
1689
|
+
content: z.string().describe("Memory text (1-3 sentences, no secrets)"),
|
|
1690
|
+
confidence: z.number().min(0.1).max(0.99).optional().describe("0.1-0.99, default 0.8"),
|
|
1691
|
+
tags: z.array(z.string()).optional().describe("Free-form tags"),
|
|
1692
|
+
scope: z.string().optional().describe("Scope name; defaults to 'project'"),
|
|
1693
|
+
structuredFields: z.record(z.string(), z.unknown()).optional().describe("ADR-013 structured payload (e.g. decision fields)"),
|
|
1694
|
+
};
|
|
1695
|
+
|
|
1696
|
+
server.tool(
|
|
1697
|
+
"gsd_capture_thought",
|
|
1698
|
+
"Record a durable project insight into the GSD memory store. Categories: architecture, convention, gotcha, preference, environment, pattern. Mirrors the in-process capture_thought tool for external MCP clients.",
|
|
1699
|
+
captureThoughtParams,
|
|
1700
|
+
async (args: Record<string, unknown>) => {
|
|
1701
|
+
const { projectDir, ...params } = parseWorkflowArgs(captureThoughtSchema, args);
|
|
1702
|
+
await enforceWorkflowWriteGate("gsd_capture_thought", projectDir);
|
|
1703
|
+
return runSerializedWorkflowDbOperation(projectDir, async () => {
|
|
1704
|
+
const { executeMemoryCapture } = await importLocalModule<any>(
|
|
1705
|
+
"../../../src/resources/extensions/gsd/tools/memory-tools.js",
|
|
1706
|
+
);
|
|
1707
|
+
return executeMemoryCapture(params);
|
|
1708
|
+
});
|
|
1709
|
+
},
|
|
1710
|
+
);
|
|
1711
|
+
|
|
1712
|
+
const memoryQuerySchema = z.object({
|
|
1713
|
+
projectDir: z.string().optional(),
|
|
1714
|
+
// Match the documented "2+ char terms" contract in the in-process
|
|
1715
|
+
// memory_query tool — reject sub-2-char queries at the schema layer.
|
|
1716
|
+
query: z.string().trim().min(2, "query must be at least 2 characters"),
|
|
1717
|
+
k: z.number().int().min(1).max(50).optional(),
|
|
1718
|
+
category: MEMORY_CATEGORY.optional(),
|
|
1719
|
+
scope: z.string().optional(),
|
|
1720
|
+
tag: z.string().optional(),
|
|
1721
|
+
include_superseded: z.boolean().optional(),
|
|
1722
|
+
reinforce_hits: z.boolean().optional(),
|
|
1723
|
+
});
|
|
1724
|
+
const memoryQueryParams = {
|
|
1725
|
+
projectDir: z.string().optional().describe("Absolute path to the project directory (defaults to MCP server cwd)"),
|
|
1726
|
+
query: z.string().describe("Keyword query (2+ char terms)"),
|
|
1727
|
+
k: z.number().int().min(1).max(50).optional().describe("Max results (default 10, max 50)"),
|
|
1728
|
+
category: MEMORY_CATEGORY.optional().describe("Restrict to a single category"),
|
|
1729
|
+
scope: z.string().optional().describe("Only include memories with this scope"),
|
|
1730
|
+
tag: z.string().optional().describe("Only include memories tagged with this value"),
|
|
1731
|
+
include_superseded: z.boolean().optional().describe("Include superseded memories (default false)"),
|
|
1732
|
+
reinforce_hits: z.boolean().optional().describe("Increment hit_count on returned memories (default false)"),
|
|
1733
|
+
};
|
|
1734
|
+
|
|
1735
|
+
server.tool(
|
|
1736
|
+
"gsd_memory_query",
|
|
1737
|
+
"Search the GSD memory store by keyword. Returns ranked memories with id, category, content, confidence, scope, and tags. Mirrors the in-process memory_query tool for external MCP clients.",
|
|
1738
|
+
memoryQueryParams,
|
|
1739
|
+
async (args: Record<string, unknown>) => {
|
|
1740
|
+
const { projectDir, ...params } = parseWorkflowArgs(memoryQuerySchema, args);
|
|
1741
|
+
return runSerializedWorkflowDbOperation(projectDir, async () => {
|
|
1742
|
+
const { executeMemoryQuery } = await importLocalModule<any>(
|
|
1743
|
+
"../../../src/resources/extensions/gsd/tools/memory-tools.js",
|
|
1744
|
+
);
|
|
1745
|
+
return executeMemoryQuery(params);
|
|
1746
|
+
});
|
|
1747
|
+
},
|
|
1748
|
+
);
|
|
1749
|
+
|
|
1750
|
+
const memoryGraphSchema = z.object({
|
|
1751
|
+
projectDir: z.string().optional(),
|
|
1752
|
+
mode: z.enum(["build", "query"]),
|
|
1753
|
+
memoryId: z.string().optional(),
|
|
1754
|
+
depth: z.number().int().min(0).max(5).optional(),
|
|
1755
|
+
rel: z.enum(["related_to", "depends_on", "contradicts", "elaborates", "supersedes"]).optional(),
|
|
1756
|
+
}).refine(
|
|
1757
|
+
(val) => val.mode !== "query" || (typeof val.memoryId === "string" && val.memoryId.trim().length > 0),
|
|
1758
|
+
{ message: "memoryId is required and must be non-empty when mode=query", path: ["memoryId"] },
|
|
1759
|
+
);
|
|
1760
|
+
const memoryGraphParams = {
|
|
1761
|
+
projectDir: z.string().optional().describe("Absolute path to the project directory (defaults to MCP server cwd)"),
|
|
1762
|
+
mode: z.enum(["build", "query"]).describe("build = recompute graph (placeholder), query = inspect edges"),
|
|
1763
|
+
memoryId: z.string().optional().describe("Memory ID (required when mode=query)"),
|
|
1764
|
+
depth: z.number().int().min(0).max(5).optional().describe("Hops to traverse (0-5, default 1)"),
|
|
1765
|
+
rel: z.enum(["related_to", "depends_on", "contradicts", "elaborates", "supersedes"]).optional().describe("Only include edges with this relation type"),
|
|
1766
|
+
};
|
|
1767
|
+
|
|
1768
|
+
server.tool(
|
|
1769
|
+
"gsd_memory_graph",
|
|
1770
|
+
"Inspect the relationship graph between memories. mode=query walks edges from a given memoryId. mode=build is a placeholder reserved for future graph rebuilds. Distinct from gsd_graph (project knowledge graph) — see ADR-013.",
|
|
1771
|
+
memoryGraphParams,
|
|
1772
|
+
async (args: Record<string, unknown>) => {
|
|
1773
|
+
const { projectDir, ...params } = parseWorkflowArgs(memoryGraphSchema, args);
|
|
1774
|
+
return runSerializedWorkflowDbOperation(projectDir, async () => {
|
|
1775
|
+
const { executeGsdGraph } = await importLocalModule<any>(
|
|
1776
|
+
"../../../src/resources/extensions/gsd/tools/memory-tools.js",
|
|
1777
|
+
);
|
|
1778
|
+
return executeGsdGraph(params);
|
|
1779
|
+
});
|
|
1780
|
+
},
|
|
1781
|
+
);
|
|
1498
1782
|
}
|