gsd-pi 2.78.0 → 2.78.1-dev.82bcf6b71
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 +60 -23
- package/dist/bundled-resource-path.d.ts +7 -0
- package/dist/bundled-resource-path.js +34 -2
- package/dist/claude-cli-check.js +104 -33
- package/dist/cli-policy.d.ts +13 -0
- package/dist/cli-policy.js +17 -0
- package/dist/cli.js +95 -55
- package/dist/headless-query.d.ts +22 -0
- package/dist/headless-query.js +43 -8
- package/dist/headless.d.ts +10 -0
- package/dist/headless.js +16 -1
- package/dist/loader.js +9 -13
- package/dist/onboarding.d.ts +10 -0
- package/dist/onboarding.js +2 -2
- package/dist/provider-migrations.d.ts +2 -2
- package/dist/provider-migrations.js +5 -2
- package/dist/resource-loader.d.ts +5 -2
- package/dist/resource-loader.js +30 -13
- package/dist/resources/.managed-resources-content-hash +1 -0
- package/dist/resources/extensions/claude-code-cli/readiness.js +128 -32
- package/dist/resources/extensions/google-search/index.js +2 -6
- package/dist/resources/extensions/gsd/auto/loop.js +23 -0
- package/dist/resources/extensions/gsd/auto/phases.js +5 -13
- package/dist/resources/extensions/gsd/auto/run-unit.js +26 -12
- package/dist/resources/extensions/gsd/auto/session.js +5 -6
- package/dist/resources/extensions/gsd/auto-dashboard.js +3 -2
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +55 -21
- package/dist/resources/extensions/gsd/auto-dispatch.js +18 -6
- package/dist/resources/extensions/gsd/auto-prompts.js +69 -2
- package/dist/resources/extensions/gsd/auto-recovery.js +43 -4
- package/dist/resources/extensions/gsd/auto-runtime-state.js +31 -0
- package/dist/resources/extensions/gsd/auto-start.js +1 -1
- package/dist/resources/extensions/gsd/auto-tool-tracking.js +2 -2
- package/dist/resources/extensions/gsd/auto-worktree.js +75 -13
- package/dist/resources/extensions/gsd/auto.js +39 -14
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +14 -2
- package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +7 -5
- package/dist/resources/extensions/gsd/bootstrap/query-tools.js +2 -2
- package/dist/resources/extensions/gsd/bootstrap/register-extension.js +5 -4
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +112 -31
- package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +11 -6
- package/dist/resources/extensions/gsd/bootstrap/subagent-input.js +22 -0
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +45 -8
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +121 -3
- package/dist/resources/extensions/gsd/commands/catalog.js +76 -5
- package/dist/resources/extensions/gsd/commands/handlers/core.js +23 -1
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +8 -0
- package/dist/resources/extensions/gsd/commands-config.js +3 -2
- package/dist/resources/extensions/gsd/commands-extensions.js +46 -3
- package/dist/resources/extensions/gsd/commands-handlers.js +3 -2
- package/dist/resources/extensions/gsd/commands-mcp-status.js +3 -1
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +10 -1
- package/dist/resources/extensions/gsd/commands-worktree.js +309 -0
- package/dist/resources/extensions/gsd/dashboard-overlay.js +1 -1
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +10 -0
- package/dist/resources/extensions/gsd/doctor-providers.js +2 -1
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +39 -1
- package/dist/resources/extensions/gsd/error-classifier.js +1 -1
- package/dist/resources/extensions/gsd/forensics.js +10 -8
- package/dist/resources/extensions/gsd/git-service.js +12 -5
- package/dist/resources/extensions/gsd/gsd-db.js +11 -2
- package/dist/resources/extensions/gsd/guided-flow.js +25 -24
- package/dist/resources/extensions/gsd/home-dir.js +16 -0
- package/dist/resources/extensions/gsd/key-manager.js +2 -1
- package/dist/resources/extensions/gsd/memory-store.js +66 -31
- package/dist/resources/extensions/gsd/migrate/command.js +3 -2
- package/dist/resources/extensions/gsd/milestone-id-reservation.js +36 -0
- package/dist/resources/extensions/gsd/model-router.js +114 -9
- package/dist/resources/extensions/gsd/native-git-bridge.js +7 -1
- package/dist/resources/extensions/gsd/preferences-models.js +91 -15
- package/dist/resources/extensions/gsd/preferences-types.js +2 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +32 -0
- package/dist/resources/extensions/gsd/preferences.js +5 -3
- package/dist/resources/extensions/gsd/prompt-loader.js +23 -12
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +10 -0
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +10 -0
- package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
- package/dist/resources/extensions/gsd/prompts/parallel-research-slices.md +2 -0
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +10 -0
- package/dist/resources/extensions/gsd/prompts/refine-slice.md +10 -0
- package/dist/resources/extensions/gsd/prompts/rewrite-docs.md +2 -0
- package/dist/resources/extensions/gsd/slice-parallel-orchestrator.js +9 -3
- package/dist/resources/extensions/gsd/state.js +42 -0
- package/dist/resources/extensions/gsd/templates/PREFERENCES.md +1 -0
- package/dist/resources/extensions/gsd/tools/memory-tools.js +18 -1
- package/dist/resources/extensions/gsd/unit-context-manifest.js +29 -4
- package/dist/resources/extensions/gsd/visualizer-overlay.js +1 -1
- package/dist/resources/extensions/gsd/watch/header-renderer.js +3 -1
- package/dist/resources/extensions/gsd/worktree-command.js +26 -46
- package/dist/resources/extensions/gsd/worktree-manager.js +20 -1
- package/dist/resources/extensions/gsd/worktree-resolver.js +28 -13
- package/dist/resources/extensions/gsd/worktree-root.js +124 -0
- package/dist/resources/extensions/gsd/worktree-session-state.js +33 -0
- package/dist/resources/extensions/gsd/worktree.js +4 -115
- package/dist/resources/extensions/mcp-client/index.js +6 -9
- package/dist/resources/extensions/ollama/index.js +15 -2
- package/dist/resources/extensions/ollama/model-capabilities.js +31 -0
- package/dist/resources/extensions/ollama/ollama-client.js +40 -4
- package/dist/resources/extensions/slash-commands/create-extension.js +36 -22
- package/dist/resources/extensions/subagent/index.js +324 -178
- package/dist/resources/skills/create-gsd-extension/SKILL.md +9 -5
- package/dist/resources/skills/create-gsd-extension/references/custom-commands.md +1 -1
- package/dist/resources/skills/create-gsd-extension/references/custom-rendering.md +5 -5
- package/dist/resources/skills/create-gsd-extension/references/custom-tools.md +4 -4
- package/dist/resources/skills/create-gsd-extension/references/custom-ui.md +6 -6
- package/dist/resources/skills/create-gsd-extension/references/events-reference.md +3 -3
- package/dist/resources/skills/create-gsd-extension/references/packaging-distribution.md +1 -1
- package/dist/resources/skills/create-gsd-extension/references/remote-execution-overrides.md +3 -3
- package/dist/resources/skills/create-gsd-extension/workflows/create-extension.md +32 -12
- package/dist/resources/skills/lint/SKILL.md +4 -0
- package/dist/resources/skills/review/SKILL.md +4 -0
- package/dist/resources/skills/test/SKILL.md +3 -0
- package/dist/rtk-shared.d.ts +3 -0
- package/dist/rtk-shared.js +17 -0
- package/dist/rtk.d.ts +2 -5
- package/dist/rtk.js +3 -20
- package/dist/runtime-checks.d.ts +27 -0
- package/dist/runtime-checks.js +38 -0
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +19 -19
- 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 +44 -4
- package/dist/web/standalone/.next/required-server-files.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js +4 -2
- package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +4 -4
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/upload/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/undo/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/visualizer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/page.js +2 -2
- package/dist/web/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +19 -19
- package/dist/web/standalone/.next/server/chunks/63.js +3 -3
- package/dist/web/standalone/.next/server/chunks/6897.js +1 -1
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-manifest.json +5 -5
- package/dist/web/standalone/.next/server/middleware-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/server/webpack-runtime.js +1 -1
- package/dist/web/standalone/.next/static/chunks/2556.0527fea66e123b7f.js +1 -0
- package/dist/web/standalone/.next/static/chunks/2824.08296bc2f9654698.js +1 -0
- package/dist/web/standalone/.next/static/chunks/3026.3af53b279375f082.js +1 -0
- package/dist/web/standalone/.next/static/chunks/315.6f68ae79b67d25cf.js +1 -0
- package/dist/web/standalone/.next/static/chunks/3497.4bfc60a3b3dea717.js +1 -0
- package/dist/web/standalone/.next/static/chunks/5516.4a07c872b5c3a663.js +1 -0
- package/dist/web/standalone/.next/static/chunks/8336.31b019697882acfb.js +10 -0
- package/dist/web/standalone/.next/static/chunks/8845.c9702695e8c5a9c5.js +2 -0
- package/dist/web/standalone/.next/static/chunks/9058.01ef3a463bda88f1.js +20 -0
- package/dist/web/standalone/.next/static/chunks/9441.1081da1125d1764f.js +1 -0
- 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-9bf2e0c50fb2ca05.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-f9f0dc45e4f3ac10.js +1 -0
- package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
- package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
- package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
- package/dist/web/standalone/package.json +2 -1
- package/dist/web/standalone/server.js +1 -1
- package/dist/welcome-screen.js +27 -1
- package/dist/worktree-cli.d.ts +1 -0
- package/dist/worktree-cli.js +9 -3
- package/dist/worktree-status-banner.d.ts +1 -0
- package/dist/worktree-status-banner.js +132 -0
- package/package.json +1 -3
- package/packages/daemon/package.json +2 -2
- package/packages/mcp-server/dist/alias-telemetry.d.ts +8 -0
- package/packages/mcp-server/dist/alias-telemetry.d.ts.map +1 -0
- package/packages/mcp-server/dist/alias-telemetry.js +30 -0
- package/packages/mcp-server/dist/alias-telemetry.js.map +1 -0
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +74 -46
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +2 -2
- package/packages/mcp-server/src/alias-telemetry.test.ts +78 -0
- package/packages/mcp-server/src/alias-telemetry.ts +30 -0
- package/packages/mcp-server/src/workflow-tools.test.ts +78 -0
- package/packages/mcp-server/src/workflow-tools.ts +93 -58
- 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/package.json +1 -1
- package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.cache-breakpoint.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/anthropic-shared.cache-breakpoint.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-shared.cache-breakpoint.test.js +231 -0
- package/packages/pi-ai/dist/providers/anthropic-shared.cache-breakpoint.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.js +48 -19
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/types.d.ts +13 -0
- package/packages/pi-ai/dist/types.d.ts.map +1 -1
- package/packages/pi-ai/dist/types.js.map +1 -1
- package/packages/pi-ai/dist/utils/repair-tool-json.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/repair-tool-json.js +24 -3
- package/packages/pi-ai/dist/utils/repair-tool-json.js.map +1 -1
- package/packages/pi-ai/dist/utils/tests/repair-tool-json.test.js +26 -0
- package/packages/pi-ai/dist/utils/tests/repair-tool-json.test.js.map +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-ai/src/providers/anthropic-shared.cache-breakpoint.test.ts +289 -0
- package/packages/pi-ai/src/providers/anthropic-shared.ts +52 -20
- package/packages/pi-ai/src/types.ts +13 -0
- package/packages/pi-ai/src/utils/repair-tool-json.ts +24 -3
- package/packages/pi-ai/src/utils/tests/repair-tool-json.test.ts +32 -0
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +6 -0
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/messages.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/messages.js +4 -0
- package/packages/pi-coding-agent/dist/core/messages.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js +19 -2
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts +10 -0
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.js +18 -0
- package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts +13 -0
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.js +20 -16
- package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/token-telemetry.d.ts +37 -0
- package/packages/pi-coding-agent/dist/core/token-telemetry.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/token-telemetry.js +49 -0
- package/packages/pi-coding-agent/dist/core/token-telemetry.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js +133 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.js +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js +14 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/tests/system-prompt-cache-stability.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/tests/system-prompt-cache-stability.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/tests/system-prompt-cache-stability.test.js +78 -0
- package/packages/pi-coding-agent/dist/tests/system-prompt-cache-stability.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/tests/token-telemetry.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/tests/token-telemetry.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/tests/token-telemetry.test.js +181 -0
- package/packages/pi-coding-agent/dist/tests/token-telemetry.test.js.map +1 -0
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/agent-session.ts +7 -0
- package/packages/pi-coding-agent/src/core/messages.ts +4 -0
- package/packages/pi-coding-agent/src/core/model-registry-auth-mode.test.ts +32 -2
- package/packages/pi-coding-agent/src/core/model-registry.ts +21 -0
- package/packages/pi-coding-agent/src/core/system-prompt.ts +33 -15
- package/packages/pi-coding-agent/src/core/token-telemetry.ts +77 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts +212 -0
- package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.test.ts +17 -1
- package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.ts +1 -1
- package/packages/pi-coding-agent/src/tests/system-prompt-cache-stability.test.ts +102 -0
- package/packages/pi-coding-agent/src/tests/token-telemetry.test.ts +200 -0
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/__tests__/autocomplete.test.js +17 -3
- package/packages/pi-tui/dist/__tests__/autocomplete.test.js.map +1 -1
- package/packages/pi-tui/dist/components/__tests__/leak-fixes-runtime.test.d.ts +2 -0
- package/packages/pi-tui/dist/components/__tests__/leak-fixes-runtime.test.d.ts.map +1 -0
- package/packages/pi-tui/dist/components/__tests__/leak-fixes-runtime.test.js +161 -0
- package/packages/pi-tui/dist/components/__tests__/leak-fixes-runtime.test.js.map +1 -0
- package/packages/pi-tui/package.json +1 -1
- package/packages/pi-tui/src/__tests__/autocomplete.test.ts +20 -3
- package/packages/pi-tui/src/components/__tests__/leak-fixes-runtime.test.ts +219 -0
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/packages/rpc-client/package.json +1 -1
- package/pkg/package.json +1 -1
- package/src/resources/extensions/claude-code-cli/readiness.ts +130 -30
- package/src/resources/extensions/google-search/index.ts +2 -9
- package/src/resources/extensions/gsd/auto/loop.ts +24 -2
- package/src/resources/extensions/gsd/auto/phases.ts +6 -14
- package/src/resources/extensions/gsd/auto/run-unit.ts +26 -12
- package/src/resources/extensions/gsd/auto/session.ts +5 -6
- package/src/resources/extensions/gsd/auto/types.ts +1 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +3 -2
- package/src/resources/extensions/gsd/auto-direct-dispatch.ts +60 -24
- package/src/resources/extensions/gsd/auto-dispatch.ts +18 -6
- package/src/resources/extensions/gsd/auto-prompts.ts +66 -2
- package/src/resources/extensions/gsd/auto-recovery.ts +46 -8
- package/src/resources/extensions/gsd/auto-runtime-state.ts +51 -0
- package/src/resources/extensions/gsd/auto-start.ts +1 -1
- package/src/resources/extensions/gsd/auto-tool-tracking.ts +2 -4
- package/src/resources/extensions/gsd/auto-worktree.ts +97 -12
- package/src/resources/extensions/gsd/auto.ts +37 -10
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +15 -13
- package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +8 -7
- package/src/resources/extensions/gsd/bootstrap/query-tools.ts +2 -2
- package/src/resources/extensions/gsd/bootstrap/register-extension.ts +10 -9
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +121 -31
- package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +12 -6
- package/src/resources/extensions/gsd/bootstrap/subagent-input.ts +20 -0
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +50 -8
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +141 -11
- package/src/resources/extensions/gsd/commands/catalog.ts +82 -5
- package/src/resources/extensions/gsd/commands/handlers/core.ts +23 -1
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +10 -0
- package/src/resources/extensions/gsd/commands-config.ts +3 -2
- package/src/resources/extensions/gsd/commands-extensions.ts +43 -3
- package/src/resources/extensions/gsd/commands-handlers.ts +3 -2
- package/src/resources/extensions/gsd/commands-mcp-status.ts +3 -1
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +15 -1
- package/src/resources/extensions/gsd/commands-worktree.ts +383 -0
- package/src/resources/extensions/gsd/dashboard-overlay.ts +1 -1
- package/src/resources/extensions/gsd/docs/preferences-reference.md +10 -0
- package/src/resources/extensions/gsd/doctor-providers.ts +2 -1
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +39 -1
- package/src/resources/extensions/gsd/doctor-types.ts +3 -1
- package/src/resources/extensions/gsd/error-classifier.ts +1 -1
- package/src/resources/extensions/gsd/forensics.ts +12 -7
- package/src/resources/extensions/gsd/git-service.ts +13 -5
- package/src/resources/extensions/gsd/gsd-db.ts +12 -2
- package/src/resources/extensions/gsd/guided-flow.ts +27 -26
- package/src/resources/extensions/gsd/home-dir.ts +19 -0
- package/src/resources/extensions/gsd/journal.ts +4 -1
- package/src/resources/extensions/gsd/key-manager.ts +2 -1
- package/src/resources/extensions/gsd/memory-store.ts +81 -28
- package/src/resources/extensions/gsd/migrate/command.ts +3 -2
- package/src/resources/extensions/gsd/milestone-id-reservation.ts +47 -0
- package/src/resources/extensions/gsd/model-router.ts +172 -9
- package/src/resources/extensions/gsd/native-git-bridge.ts +7 -1
- package/src/resources/extensions/gsd/preferences-models.ts +101 -15
- package/src/resources/extensions/gsd/preferences-types.ts +6 -0
- package/src/resources/extensions/gsd/preferences-validation.ts +35 -0
- package/src/resources/extensions/gsd/preferences.ts +16 -2
- package/src/resources/extensions/gsd/prompt-loader.ts +26 -12
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +10 -0
- package/src/resources/extensions/gsd/prompts/complete-slice.md +10 -0
- package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
- package/src/resources/extensions/gsd/prompts/parallel-research-slices.md +2 -0
- package/src/resources/extensions/gsd/prompts/plan-slice.md +10 -0
- package/src/resources/extensions/gsd/prompts/refine-slice.md +10 -0
- package/src/resources/extensions/gsd/prompts/rewrite-docs.md +2 -0
- package/src/resources/extensions/gsd/slice-parallel-orchestrator.ts +9 -3
- package/src/resources/extensions/gsd/state.ts +42 -0
- package/src/resources/extensions/gsd/templates/PREFERENCES.md +1 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +179 -1
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +58 -0
- package/src/resources/extensions/gsd/tests/auto-session-encapsulation.test.ts +24 -5
- package/src/resources/extensions/gsd/tests/auto-supervisor.test.mjs +21 -4
- package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/budget-prediction.test.ts +138 -211
- package/src/resources/extensions/gsd/tests/bundled-skill-triggers.test.ts +50 -27
- package/src/resources/extensions/gsd/tests/commands-extensions-version-compare.test.ts +58 -0
- package/src/resources/extensions/gsd/tests/commands-worktree-clean.test.ts +48 -0
- package/src/resources/extensions/gsd/tests/complete-slice-verification-gate.test.ts +142 -59
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +7 -4
- package/src/resources/extensions/gsd/tests/completed-at-reconcile.test.ts +89 -32
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +41 -23
- package/src/resources/extensions/gsd/tests/db-path-worktree-symlink.test.ts +3 -43
- package/src/resources/extensions/gsd/tests/debug-logger.test.ts +5 -3
- package/src/resources/extensions/gsd/tests/deferred-milestone-dir-4996.test.ts +116 -0
- package/src/resources/extensions/gsd/tests/discuss-empty-db-fallback.test.ts +22 -87
- package/src/resources/extensions/gsd/tests/discuss-queued-milestones.test.ts +7 -118
- package/src/resources/extensions/gsd/tests/discuss-tool-scope-leak.test.ts +18 -60
- package/src/resources/extensions/gsd/tests/doctor-orphan-milestone-4996.test.ts +100 -0
- package/src/resources/extensions/gsd/tests/double-merge-guard.test.ts +14 -76
- package/src/resources/extensions/gsd/tests/ensure-preconditions-guard-4996.test.ts +93 -0
- package/src/resources/extensions/gsd/tests/false-degraded-mode-warning.test.ts +22 -83
- package/src/resources/extensions/gsd/tests/finalize-timeout-guard.test.ts +1 -63
- package/src/resources/extensions/gsd/tests/find-missing-summaries-closed-runtime.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/forensics-stuck-loops.test.ts +26 -1
- package/src/resources/extensions/gsd/tests/gitignore-bg-shell-runtime.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/google-search-stub.test.ts +25 -65
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +30 -0
- package/src/resources/extensions/gsd/tests/gsd-no-project-error-runtime.test.ts +81 -0
- package/src/resources/extensions/gsd/tests/headless-answers.test.ts +14 -4
- package/src/resources/extensions/gsd/tests/health-widget.test.ts +22 -12
- package/src/resources/extensions/gsd/tests/help-menu-coverage.test.ts +57 -0
- package/src/resources/extensions/gsd/tests/home-dir.test.ts +52 -0
- package/src/resources/extensions/gsd/tests/import-done-milestones-runtime.test.ts +145 -0
- package/src/resources/extensions/gsd/tests/init-prefs-routing.test.ts +64 -1
- package/src/resources/extensions/gsd/tests/integration/auto-worktree.test.ts +72 -1
- package/src/resources/extensions/gsd/tests/integration/token-savings.test.ts +0 -23
- package/src/resources/extensions/gsd/tests/memory-store.test.ts +128 -0
- package/src/resources/extensions/gsd/tests/memory-tools.test.ts +33 -1
- package/src/resources/extensions/gsd/tests/merge-self-branch-guard.test.ts +124 -0
- package/src/resources/extensions/gsd/tests/milestone-id-gap-reuse-4996.test.ts +152 -0
- package/src/resources/extensions/gsd/tests/milestone-report-path.test.ts +18 -1
- package/src/resources/extensions/gsd/tests/model-router.test.ts +169 -8
- package/src/resources/extensions/gsd/tests/native-git-infra-errors.test.ts +50 -0
- package/src/resources/extensions/gsd/tests/orphaned-worktree-audit.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/parallel-crash-recovery.test.ts +32 -43
- package/src/resources/extensions/gsd/tests/phases-merge-error-stops-auto.test.ts +4 -10
- package/src/resources/extensions/gsd/tests/preferences.test.ts +127 -0
- package/src/resources/extensions/gsd/tests/prompt-step-ordering.test.ts +16 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/quick-turn-end-cleanup.test.ts +6 -6
- package/src/resources/extensions/gsd/tests/register-hooks-compaction-checkpoint.test.ts +93 -0
- package/src/resources/extensions/gsd/tests/safety-harness-false-positives.test.ts +34 -0
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +168 -19
- package/src/resources/extensions/gsd/tests/slice-parallel-orchestrator.test.ts +7 -1
- package/src/resources/extensions/gsd/tests/smart-entry-complete.test.ts +23 -1
- package/src/resources/extensions/gsd/tests/stash-pop-gsd-conflict.test.ts +8 -2
- package/src/resources/extensions/gsd/tests/stash-queued-context-files.test.ts +12 -6
- package/src/resources/extensions/gsd/tests/steer-worktree-path.test.ts +17 -1
- package/src/resources/extensions/gsd/tests/system-context-message-routing.test.ts +101 -0
- package/src/resources/extensions/gsd/tests/token-profile.test.ts +51 -4
- package/src/resources/extensions/gsd/tests/turn-epoch.test.ts +7 -16
- package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +38 -3
- package/src/resources/extensions/gsd/tests/unstructured-continue-context-injection.test.ts +5 -7
- package/src/resources/extensions/gsd/tests/uok-gitops-turn-action.test.ts +15 -1
- package/src/resources/extensions/gsd/tests/visualizer-overlay.test.ts +6 -6
- package/src/resources/extensions/gsd/tests/worktree-path-injection.test.ts +235 -0
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +85 -0
- package/src/resources/extensions/gsd/tests/worktree-symlink-removal.test.ts +34 -33
- package/src/resources/extensions/gsd/tests/worktree.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +131 -1
- package/src/resources/extensions/gsd/tools/memory-tools.ts +17 -1
- package/src/resources/extensions/gsd/unit-context-manifest.ts +44 -12
- package/src/resources/extensions/gsd/visualizer-overlay.ts +1 -1
- package/src/resources/extensions/gsd/watch/header-renderer.ts +3 -1
- package/src/resources/extensions/gsd/workflow-logger.ts +1 -0
- package/src/resources/extensions/gsd/worktree-command.ts +31 -44
- package/src/resources/extensions/gsd/worktree-manager.ts +40 -1
- package/src/resources/extensions/gsd/worktree-resolver.ts +28 -14
- package/src/resources/extensions/gsd/worktree-root.ts +144 -0
- package/src/resources/extensions/gsd/worktree-session-state.ts +35 -0
- package/src/resources/extensions/gsd/worktree.ts +8 -119
- package/src/resources/extensions/mcp-client/index.ts +6 -10
- package/src/resources/extensions/mcp-client/tests/global-config.test.ts +91 -0
- package/src/resources/extensions/ollama/index.ts +16 -2
- package/src/resources/extensions/ollama/model-capabilities.ts +34 -0
- package/src/resources/extensions/ollama/ollama-client.ts +41 -4
- package/src/resources/extensions/ollama/tests/model-capabilities.test.ts +96 -0
- package/src/resources/extensions/ollama/tests/ollama-client-timeout-env.test.ts +147 -0
- package/src/resources/extensions/slash-commands/create-extension.ts +38 -24
- package/src/resources/extensions/subagent/index.ts +165 -7
- package/src/resources/skills/create-gsd-extension/SKILL.md +9 -5
- package/src/resources/skills/create-gsd-extension/references/custom-commands.md +1 -1
- package/src/resources/skills/create-gsd-extension/references/custom-rendering.md +5 -5
- package/src/resources/skills/create-gsd-extension/references/custom-tools.md +4 -4
- package/src/resources/skills/create-gsd-extension/references/custom-ui.md +6 -6
- package/src/resources/skills/create-gsd-extension/references/events-reference.md +3 -3
- package/src/resources/skills/create-gsd-extension/references/packaging-distribution.md +1 -1
- package/src/resources/skills/create-gsd-extension/references/remote-execution-overrides.md +3 -3
- package/src/resources/skills/create-gsd-extension/templates/extension-skeleton.ts +2 -2
- package/src/resources/skills/create-gsd-extension/templates/stateful-tool-skeleton.ts +3 -3
- package/src/resources/skills/create-gsd-extension/templates/templates.test.ts +58 -0
- package/src/resources/skills/create-gsd-extension/workflows/create-extension.md +32 -12
- package/src/resources/skills/lint/SKILL.md +4 -0
- package/src/resources/skills/review/SKILL.md +4 -0
- package/src/resources/skills/test/SKILL.md +3 -0
- package/dist/resources/extensions/browser-tools/tests/browser-tools-integration.test.mjs +0 -601
- package/dist/resources/extensions/browser-tools/tests/browser-tools-unit.test.cjs +0 -651
- package/dist/resources/extensions/browser-tools/tests/capture-sharp-optional.test.cjs +0 -91
- package/dist/resources/extensions/gsd/tests/auto-supervisor.test.mjs +0 -53
- package/dist/resources/extensions/gsd/tests/dist-redirect.mjs +0 -112
- package/dist/resources/extensions/gsd/tests/resolve-ts-hooks.mjs +0 -23
- package/dist/resources/extensions/gsd/tests/resolve-ts.mjs +0 -5
- package/dist/resources/skills/github-workflows/references/gh/tests/__init__.py +0 -0
- package/dist/resources/skills/github-workflows/references/gh/tests/test_github_project_setup.py +0 -608
- package/dist/web/standalone/.next/static/chunks/2826.e9f5195e91f9cad2.js +0 -11
- package/dist/web/standalone/.next/static/chunks/3621.fc7480022c972438.js +0 -20
- package/dist/web/standalone/.next/static/chunks/app/page-151349214571e2b6.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/chunks/webpack-2e68521d7c82f7c2.js +0 -1
- package/src/resources/extensions/gsd/tests/copy-planning-artifacts-samepath.test.ts +0 -22
- package/src/resources/extensions/gsd/tests/discuss-slice-structured-questions.test.ts +0 -47
- package/src/resources/extensions/gsd/tests/empty-content-abort-loop.test.ts +0 -75
- /package/dist/web/standalone/.next/static/{C1zT2kEfoLhDdbWPWKrXd → hcvW7f3yv1JHzlWe7tIc6}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{C1zT2kEfoLhDdbWPWKrXd → hcvW7f3yv1JHzlWe7tIc6}/_ssgManifest.js +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
2
|
import { Text } from "@gsd/pi-tui";
|
|
3
|
-
import { findMilestoneIds, nextMilestoneId, claimReservedId, getReservedMilestoneIds } from "../guided-flow.js";
|
|
4
3
|
import { loadEffectiveGSDPreferences } from "../preferences.js";
|
|
5
4
|
import { ensureDbOpen } from "./dynamic-tools.js";
|
|
6
5
|
import { StringEnum } from "@gsd/pi-ai";
|
|
7
6
|
import { logError } from "../workflow-logger.js";
|
|
8
|
-
|
|
7
|
+
async function loadWorkflowExecutors() {
|
|
8
|
+
return import("../tools/workflow-tool-executors.js");
|
|
9
|
+
}
|
|
9
10
|
/**
|
|
10
11
|
* Register an alias tool that shares the same execute function as its canonical counterpart.
|
|
11
12
|
* The alias description and promptGuidelines direct the LLM to prefer the canonical name.
|
|
@@ -280,6 +281,7 @@ export function registerDbTools(pi) {
|
|
|
280
281
|
registerAlias(pi, requirementSaveTool, "gsd_save_requirement", "gsd_requirement_save");
|
|
281
282
|
// ─── gsd_summary_save (formerly gsd_save_summary) ──────────────────────
|
|
282
283
|
const summarySaveExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
284
|
+
const { executeSummarySave } = await loadWorkflowExecutors();
|
|
283
285
|
return executeSummarySave(params, process.cwd());
|
|
284
286
|
};
|
|
285
287
|
const summarySaveTool = {
|
|
@@ -330,6 +332,7 @@ export function registerDbTools(pi) {
|
|
|
330
332
|
try {
|
|
331
333
|
// Claim a reserved ID if the guided-flow already previewed one to the user.
|
|
332
334
|
// This guarantees the ID shown in the UI matches the one materialised on disk.
|
|
335
|
+
const { claimReservedId, findMilestoneIds, getReservedMilestoneIds, nextMilestoneId } = await import("../guided-flow.js");
|
|
333
336
|
const reserved = claimReservedId();
|
|
334
337
|
if (reserved) {
|
|
335
338
|
await ensureMilestoneDbRow(reserved);
|
|
@@ -408,6 +411,7 @@ export function registerDbTools(pi) {
|
|
|
408
411
|
registerAlias(pi, milestoneGenerateIdTool, "gsd_generate_milestone_id", "gsd_milestone_generate_id");
|
|
409
412
|
// ─── gsd_plan_milestone (gsd_milestone_plan alias) ─────────────────────
|
|
410
413
|
const planMilestoneExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
414
|
+
const { executePlanMilestone } = await loadWorkflowExecutors();
|
|
411
415
|
return executePlanMilestone(params, process.cwd());
|
|
412
416
|
};
|
|
413
417
|
const planMilestoneTool = {
|
|
@@ -472,6 +476,7 @@ export function registerDbTools(pi) {
|
|
|
472
476
|
registerAlias(pi, planMilestoneTool, "gsd_milestone_plan", "gsd_plan_milestone");
|
|
473
477
|
// ─── gsd_plan_slice (gsd_slice_plan alias) ─────────────────────────────
|
|
474
478
|
const planSliceExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
479
|
+
const { executePlanSlice } = await loadWorkflowExecutors();
|
|
475
480
|
return executePlanSlice(params, process.cwd());
|
|
476
481
|
};
|
|
477
482
|
const planSliceTool = {
|
|
@@ -585,6 +590,7 @@ export function registerDbTools(pi) {
|
|
|
585
590
|
registerAlias(pi, planTaskTool, "gsd_task_plan", "gsd_plan_task");
|
|
586
591
|
// ─── gsd_task_complete (gsd_complete_task alias) ────────────────────────
|
|
587
592
|
const taskCompleteExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
593
|
+
const { executeTaskComplete } = await loadWorkflowExecutors();
|
|
588
594
|
return executeTaskComplete(params, process.cwd());
|
|
589
595
|
};
|
|
590
596
|
const taskCompleteTool = {
|
|
@@ -647,6 +653,7 @@ export function registerDbTools(pi) {
|
|
|
647
653
|
registerAlias(pi, taskCompleteTool, "gsd_complete_task", "gsd_task_complete");
|
|
648
654
|
// ─── gsd_slice_complete (gsd_complete_slice alias) ─────────────────────
|
|
649
655
|
const sliceCompleteExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
656
|
+
const { executeSliceComplete } = await loadWorkflowExecutors();
|
|
650
657
|
return executeSliceComplete(params, process.cwd());
|
|
651
658
|
};
|
|
652
659
|
const sliceCompleteTool = {
|
|
@@ -811,6 +818,7 @@ export function registerDbTools(pi) {
|
|
|
811
818
|
});
|
|
812
819
|
// ─── gsd_complete_milestone ────────────────────────────────────────────
|
|
813
820
|
const milestoneCompleteExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
821
|
+
const { executeCompleteMilestone } = await loadWorkflowExecutors();
|
|
814
822
|
return executeCompleteMilestone(params, process.cwd());
|
|
815
823
|
};
|
|
816
824
|
const milestoneCompleteTool = {
|
|
@@ -851,6 +859,7 @@ export function registerDbTools(pi) {
|
|
|
851
859
|
registerAlias(pi, milestoneCompleteTool, "gsd_milestone_complete", "gsd_complete_milestone");
|
|
852
860
|
// ─── gsd_validate_milestone (gsd_milestone_validate alias) ─────────────
|
|
853
861
|
const milestoneValidateExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
862
|
+
const { executeValidateMilestone } = await loadWorkflowExecutors();
|
|
854
863
|
return executeValidateMilestone(params, process.cwd());
|
|
855
864
|
};
|
|
856
865
|
const milestoneValidateTool = {
|
|
@@ -883,6 +892,7 @@ export function registerDbTools(pi) {
|
|
|
883
892
|
registerAlias(pi, milestoneValidateTool, "gsd_milestone_validate", "gsd_validate_milestone");
|
|
884
893
|
// ─── gsd_replan_slice (gsd_slice_replan alias) ─────────────────────────
|
|
885
894
|
const replanSliceExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
895
|
+
const { executeReplanSlice } = await loadWorkflowExecutors();
|
|
886
896
|
return executeReplanSlice(params, process.cwd());
|
|
887
897
|
};
|
|
888
898
|
const replanSliceTool = {
|
|
@@ -925,6 +935,7 @@ export function registerDbTools(pi) {
|
|
|
925
935
|
registerAlias(pi, replanSliceTool, "gsd_slice_replan", "gsd_replan_slice");
|
|
926
936
|
// ─── gsd_reassess_roadmap (gsd_roadmap_reassess alias) ─────────────────
|
|
927
937
|
const reassessRoadmapExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
938
|
+
const { executeReassessRoadmap } = await loadWorkflowExecutors();
|
|
928
939
|
return executeReassessRoadmap(params, process.cwd());
|
|
929
940
|
};
|
|
930
941
|
const reassessRoadmapTool = {
|
|
@@ -1157,6 +1168,7 @@ export function registerDbTools(pi) {
|
|
|
1157
1168
|
registerAlias(pi, reopenMilestoneTool, "gsd_reopen_milestone", "gsd_milestone_reopen");
|
|
1158
1169
|
// ─── gsd_save_gate_result ──────────────────────────────────────────────
|
|
1159
1170
|
const saveGateResultExecute = async (_toolCallId, params, _signal, _onUpdate, _ctx) => {
|
|
1171
|
+
const { executeSaveGateResult } = await loadWorkflowExecutors();
|
|
1160
1172
|
return executeSaveGateResult(params, process.cwd());
|
|
1161
1173
|
};
|
|
1162
1174
|
const saveGateResultTool = {
|
|
@@ -3,11 +3,6 @@
|
|
|
3
3
|
// Exposes the `gsd_exec` tool over MCP. Opt-in: disabled unless
|
|
4
4
|
// `context_mode.enabled: true` is set in preferences.
|
|
5
5
|
import { Type } from "@sinclair/typebox";
|
|
6
|
-
import { executeGsdExec } from "../tools/exec-tool.js";
|
|
7
|
-
import { executeExecSearch } from "../tools/exec-search-tool.js";
|
|
8
|
-
import { executeResume } from "../tools/resume-tool.js";
|
|
9
|
-
import { loadEffectiveGSDPreferences } from "../preferences.js";
|
|
10
|
-
import { logWarning } from "../workflow-logger.js";
|
|
11
6
|
export function registerExecTools(pi) {
|
|
12
7
|
pi.registerTool({
|
|
13
8
|
name: "gsd_exec",
|
|
@@ -35,6 +30,11 @@ export function registerExecTools(pi) {
|
|
|
35
30
|
})),
|
|
36
31
|
}),
|
|
37
32
|
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
33
|
+
const [{ executeGsdExec }, { loadEffectiveGSDPreferences }, { logWarning }] = await Promise.all([
|
|
34
|
+
import("../tools/exec-tool.js"),
|
|
35
|
+
import("../preferences.js"),
|
|
36
|
+
import("../workflow-logger.js"),
|
|
37
|
+
]);
|
|
38
38
|
let prefs = null;
|
|
39
39
|
try {
|
|
40
40
|
prefs = loadEffectiveGSDPreferences();
|
|
@@ -67,6 +67,7 @@ export function registerExecTools(pi) {
|
|
|
67
67
|
limit: Type.Optional(Type.Number({ description: "Max results (default 20, cap 200)", minimum: 1, maximum: 200 })),
|
|
68
68
|
}),
|
|
69
69
|
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
70
|
+
const { executeExecSearch } = await import("../tools/exec-search-tool.js");
|
|
70
71
|
return executeExecSearch(params, {
|
|
71
72
|
baseDir: process.cwd(),
|
|
72
73
|
});
|
|
@@ -85,6 +86,7 @@ export function registerExecTools(pi) {
|
|
|
85
86
|
],
|
|
86
87
|
parameters: Type.Object({}),
|
|
87
88
|
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
89
|
+
const { executeResume } = await import("../tools/resume-tool.js");
|
|
88
90
|
return executeResume(params, {
|
|
89
91
|
baseDir: process.cwd(),
|
|
90
92
|
});
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// GSD2 — Read-only query tools exposing DB state to the LLM via the WAL connection
|
|
2
2
|
import { Type } from "@sinclair/typebox";
|
|
3
3
|
import { ensureDbOpen } from "./dynamic-tools.js";
|
|
4
|
-
import { executeMilestoneStatus } from "../tools/workflow-tool-executors.js";
|
|
5
|
-
import { checkpointDatabase } from "../gsd-db.js";
|
|
6
4
|
export function registerQueryTools(pi) {
|
|
7
5
|
pi.registerTool({
|
|
8
6
|
name: "gsd_milestone_status",
|
|
@@ -25,6 +23,7 @@ export function registerQueryTools(pi) {
|
|
|
25
23
|
details: { operation: "milestone_status", error: "db_unavailable" },
|
|
26
24
|
};
|
|
27
25
|
}
|
|
26
|
+
const { executeMilestoneStatus } = await import("../tools/workflow-tool-executors.js");
|
|
28
27
|
return executeMilestoneStatus(params);
|
|
29
28
|
},
|
|
30
29
|
});
|
|
@@ -49,6 +48,7 @@ export function registerQueryTools(pi) {
|
|
|
49
48
|
details: { operation: "checkpoint_db", error: "db_unavailable" },
|
|
50
49
|
};
|
|
51
50
|
}
|
|
51
|
+
const { checkpointDatabase } = await import("../gsd-db.js");
|
|
52
52
|
checkpointDatabase();
|
|
53
53
|
return {
|
|
54
54
|
content: [{ type: "text", text: "WAL checkpoint complete. gsd.db is now up to date and safe to stage with git add." }],
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// GSD2 — Extension registration: wires all GSD tools, commands, and hooks into pi
|
|
2
2
|
import { registerExitCommand } from "../exit-command.js";
|
|
3
|
-
import {
|
|
4
|
-
import { loadEcosystemExtensions } from "../ecosystem/loader.js";
|
|
3
|
+
import { registerLazyWorktreeCommands } from "../worktree-command-bootstrap.js";
|
|
5
4
|
import { registerDbTools } from "./db-tools.js";
|
|
6
5
|
import { registerDynamicTools } from "./dynamic-tools.js";
|
|
7
6
|
import { registerExecTools } from "./exec-tools.js";
|
|
@@ -64,7 +63,7 @@ function installEpipeGuard() {
|
|
|
64
63
|
export function registerGsdExtension(pi) {
|
|
65
64
|
// Note: registerGSDCommand is called by index.ts before this function,
|
|
66
65
|
// so we intentionally skip it here to avoid double-registration.
|
|
67
|
-
|
|
66
|
+
registerLazyWorktreeCommands(pi);
|
|
68
67
|
registerExitCommand(pi);
|
|
69
68
|
// Wire the Layer 2 event emitter bridge so deeply-nested GSD code can emit
|
|
70
69
|
// extension events (git lifecycle, verify, budget, milestone, unit) without
|
|
@@ -102,7 +101,9 @@ export function registerGsdExtension(pi) {
|
|
|
102
101
|
["cmux-events", () => initCmuxEventListeners(pi.events)],
|
|
103
102
|
["hooks", () => registerHooks(pi, ecosystemHandlers)],
|
|
104
103
|
["ecosystem", () => {
|
|
105
|
-
void
|
|
104
|
+
void import("../ecosystem/loader.js")
|
|
105
|
+
.then(({ loadEcosystemExtensions }) => loadEcosystemExtensions(pi, ecosystemHandlers))
|
|
106
|
+
.catch((err) => {
|
|
106
107
|
logWarning("ecosystem", `loader failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
107
108
|
});
|
|
108
109
|
}],
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { isToolCallEventType } from "@gsd/pi-coding-agent";
|
|
3
3
|
import { updateSnapshot } from "../ecosystem/gsd-extension-api.js";
|
|
4
|
-
import { getEcosystemReadyPromise } from "../ecosystem/loader.js";
|
|
5
4
|
import { buildMilestoneFileName, resolveMilestonePath, resolveSliceFile, resolveSlicePath } from "../paths.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { clearDiscussionFlowState, isDepthConfirmationAnswer, isQueuePhaseActive, markDepthVerified, resetWriteGateState, shouldBlockContextWrite, shouldBlockQueueExecution, isGateQuestionId, setPendingGate, clearPendingGate, getPendingGate, shouldBlockPendingGate, shouldBlockPendingGateBash, extractDepthVerificationMilestoneId } from "./write-gate.js";
|
|
5
|
+
import { clearDiscussionFlowState, isDepthConfirmationAnswer, isQueuePhaseActive, markDepthVerified, resetWriteGateState, shouldBlockContextWrite, shouldBlockPlanningUnit, shouldBlockQueueExecution, isGateQuestionId, setPendingGate, clearPendingGate, getPendingGate, shouldBlockPendingGate, shouldBlockPendingGateBash, extractDepthVerificationMilestoneId } from "./write-gate.js";
|
|
6
|
+
import { resolveManifest } from "../unit-context-manifest.js";
|
|
9
7
|
import { isBlockedStateFile, isBashWriteToStateFile, BLOCKED_WRITE_ERROR } from "../write-intercept.js";
|
|
10
|
-
import { cleanupQuickBranch } from "../quick.js";
|
|
11
|
-
import { getDiscussionMilestoneId } from "../guided-flow.js";
|
|
12
|
-
import { loadToolApiKeys } from "../commands-config.js";
|
|
13
8
|
import { loadFile, saveFile, formatContinue } from "../files.js";
|
|
14
|
-
import {
|
|
15
|
-
import { getAutoDashboardData, isAutoActive, isAutoPaused, markToolEnd, markToolStart, recordToolInvocationError } from "../auto.js";
|
|
16
|
-
import { isParallelActive, shutdownParallel } from "../parallel-orchestrator.js";
|
|
9
|
+
import { getAutoRuntimeSnapshot, isAutoActive, isAutoPaused, markToolEnd, markToolStart, recordToolInvocationError } from "../auto-runtime-state.js";
|
|
17
10
|
import { checkToolCallLoop, resetToolCallLoopGuard } from "./tool-call-loop-guard.js";
|
|
18
11
|
import { saveActivityLog } from "../activity-log.js";
|
|
19
|
-
import { resetAskUserQuestionsCache } from "../../ask-user-questions.js";
|
|
20
12
|
import { recordToolCall as safetyRecordToolCall, recordToolResult as safetyRecordToolResult, saveEvidenceToDisk } from "../safety/evidence-collector.js";
|
|
21
13
|
import { parseUnitId } from "../unit-id.js";
|
|
22
14
|
import { classifyCommand } from "../safety/destructive-guard.js";
|
|
@@ -24,26 +16,53 @@ import { logWarning as safetyLogWarning } from "../workflow-logger.js";
|
|
|
24
16
|
import { installNotifyInterceptor } from "./notify-interceptor.js";
|
|
25
17
|
import { initNotificationStore } from "../notification-store.js";
|
|
26
18
|
import { initNotificationWidget } from "../notification-widget.js";
|
|
27
|
-
import {
|
|
19
|
+
import { extractSubagentAgentClasses } from "./subagent-input.js";
|
|
28
20
|
// Skip the welcome screen on the very first session_start — cli.ts already
|
|
29
21
|
// printed it before the TUI launched. Only re-print on /clear (subsequent sessions).
|
|
30
22
|
let isFirstSession = true;
|
|
23
|
+
async function deriveGsdState(basePath) {
|
|
24
|
+
const { deriveState } = await import("../state.js");
|
|
25
|
+
return deriveState(basePath);
|
|
26
|
+
}
|
|
27
|
+
async function getDiscussionMilestoneIdFor(basePath) {
|
|
28
|
+
const { getDiscussionMilestoneId } = await import("../guided-flow.js");
|
|
29
|
+
return getDiscussionMilestoneId(basePath);
|
|
30
|
+
}
|
|
31
|
+
async function loadToolApiKeysForSession() {
|
|
32
|
+
const { loadToolApiKeys } = await import("../commands-config.js");
|
|
33
|
+
loadToolApiKeys();
|
|
34
|
+
}
|
|
35
|
+
async function resetAskUserQuestionsTurnCache() {
|
|
36
|
+
const { resetAskUserQuestionsCache } = await import("../../ask-user-questions.js");
|
|
37
|
+
resetAskUserQuestionsCache();
|
|
38
|
+
}
|
|
31
39
|
async function syncServiceTierStatus(ctx) {
|
|
32
40
|
const { getEffectiveServiceTier, formatServiceTierFooterStatus } = await import("../service-tier.js");
|
|
33
41
|
ctx.ui.setStatus("gsd-fast", formatServiceTierFooterStatus(getEffectiveServiceTier(), ctx.model?.id));
|
|
34
42
|
}
|
|
43
|
+
async function applyDisabledModelProviderPolicy(ctx) {
|
|
44
|
+
try {
|
|
45
|
+
const { resolveDisabledModelProvidersFromPreferences } = await import("../preferences.js");
|
|
46
|
+
ctx.modelRegistry.setDisabledModelProviders(resolveDisabledModelProvidersFromPreferences());
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// Non-fatal: keep default provider visibility if preferences cannot be loaded.
|
|
50
|
+
}
|
|
51
|
+
}
|
|
35
52
|
export function registerHooks(pi, ecosystemHandlers) {
|
|
36
53
|
pi.on("session_start", async (_event, ctx) => {
|
|
37
54
|
initNotificationStore(process.cwd());
|
|
38
55
|
installNotifyInterceptor(ctx);
|
|
39
56
|
initNotificationWidget(ctx);
|
|
40
57
|
if (!isAutoActive()) {
|
|
58
|
+
const { initHealthWidget } = await import("../health-widget.js");
|
|
41
59
|
initHealthWidget(ctx);
|
|
42
60
|
}
|
|
43
61
|
resetWriteGateState();
|
|
44
62
|
resetToolCallLoopGuard();
|
|
45
|
-
|
|
63
|
+
await resetAskUserQuestionsTurnCache();
|
|
46
64
|
await syncServiceTierStatus(ctx);
|
|
65
|
+
await applyDisabledModelProviderPolicy(ctx);
|
|
47
66
|
// Skip MCP auto-prep when running inside an auto-worktree (see session_switch below).
|
|
48
67
|
const { isInAutoWorktree } = await import("../auto-worktree.js");
|
|
49
68
|
if (!isInAutoWorktree(process.cwd())) {
|
|
@@ -79,7 +98,7 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
79
98
|
}
|
|
80
99
|
catch { /* non-fatal */ }
|
|
81
100
|
}
|
|
82
|
-
|
|
101
|
+
await loadToolApiKeysForSession();
|
|
83
102
|
if (isAutoActive()) {
|
|
84
103
|
ctx.ui.setWidget("gsd-health", undefined);
|
|
85
104
|
}
|
|
@@ -89,9 +108,10 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
89
108
|
installNotifyInterceptor(ctx);
|
|
90
109
|
resetWriteGateState();
|
|
91
110
|
resetToolCallLoopGuard();
|
|
92
|
-
|
|
111
|
+
await resetAskUserQuestionsTurnCache();
|
|
93
112
|
clearDiscussionFlowState();
|
|
94
113
|
await syncServiceTierStatus(ctx);
|
|
114
|
+
await applyDisabledModelProviderPolicy(ctx);
|
|
95
115
|
// Skip MCP auto-prep when running inside an auto-worktree. The worktree
|
|
96
116
|
// already has .mcp.json from createAutoWorktree, and re-running the writer
|
|
97
117
|
// post-chdir rewrites the file mid-run (non-idempotent due to cwd-relative
|
|
@@ -101,20 +121,26 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
101
121
|
const { prepareWorkflowMcpForProject } = await import("../workflow-mcp-auto-prep.js");
|
|
102
122
|
prepareWorkflowMcpForProject(ctx, process.cwd());
|
|
103
123
|
}
|
|
104
|
-
|
|
105
|
-
if (isAutoActive()) {
|
|
124
|
+
await loadToolApiKeysForSession();
|
|
125
|
+
if (!isAutoActive()) {
|
|
126
|
+
const { initHealthWidget } = await import("../health-widget.js");
|
|
127
|
+
initHealthWidget(ctx);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
106
130
|
ctx.ui.setWidget("gsd-health", undefined);
|
|
107
131
|
}
|
|
108
132
|
});
|
|
109
133
|
pi.on("before_agent_start", async (event, ctx) => {
|
|
110
134
|
// Wait for ecosystem loader to finish (no-op after first turn).
|
|
135
|
+
const { getEcosystemReadyPromise } = await import("../ecosystem/loader.js");
|
|
111
136
|
await getEcosystemReadyPromise();
|
|
112
137
|
// GSD's own context injection (existing behavior — unchanged).
|
|
138
|
+
const { buildBeforeAgentStartResult } = await import("./system-context.js");
|
|
113
139
|
const gsdResult = await buildBeforeAgentStartResult(event, ctx);
|
|
114
140
|
// Refresh the snapshot used by ecosystem getPhase()/getActiveUnit().
|
|
115
141
|
// deriveState has its own ~100ms cache so this is cheap on repeat calls.
|
|
116
142
|
try {
|
|
117
|
-
const state = await
|
|
143
|
+
const state = await deriveGsdState(process.cwd());
|
|
118
144
|
updateSnapshot(state);
|
|
119
145
|
}
|
|
120
146
|
catch {
|
|
@@ -148,7 +174,8 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
148
174
|
});
|
|
149
175
|
pi.on("agent_end", async (event, ctx) => {
|
|
150
176
|
resetToolCallLoopGuard();
|
|
151
|
-
|
|
177
|
+
await resetAskUserQuestionsTurnCache();
|
|
178
|
+
const { handleAgentEnd } = await import("./agent-end-recovery.js");
|
|
152
179
|
await handleAgentEnd(pi, event, ctx);
|
|
153
180
|
});
|
|
154
181
|
// Squash-merge quick-task branch back to the original branch after the
|
|
@@ -156,6 +183,7 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
156
183
|
// quick-return state is pending, so this is safe to call on every turn.
|
|
157
184
|
pi.on("turn_end", async () => {
|
|
158
185
|
try {
|
|
186
|
+
const { cleanupQuickBranch } = await import("../quick.js");
|
|
159
187
|
cleanupQuickBranch();
|
|
160
188
|
}
|
|
161
189
|
catch {
|
|
@@ -172,8 +200,8 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
172
200
|
const basePath = process.cwd();
|
|
173
201
|
const { ensureDbOpen } = await import("./dynamic-tools.js");
|
|
174
202
|
await ensureDbOpen();
|
|
175
|
-
const state = await
|
|
176
|
-
if (!state.activeMilestone || !state.activeSlice
|
|
203
|
+
const state = await deriveGsdState(basePath);
|
|
204
|
+
if (!state.activeMilestone || !state.activeSlice)
|
|
177
205
|
return;
|
|
178
206
|
// Write checkpoint for ALL phases, not just "executing" — discuss, research,
|
|
179
207
|
// and planning also carry in-memory state (user answers, gate verification)
|
|
@@ -189,21 +217,30 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
189
217
|
if (await loadFile(legacyContinue))
|
|
190
218
|
return;
|
|
191
219
|
const continuePath = join(sliceDir, `${state.activeSlice.id}-CONTINUE.md`);
|
|
220
|
+
const taskId = state.activeTask?.id ?? "none";
|
|
221
|
+
const taskTitle = state.activeTask?.title ?? "";
|
|
222
|
+
const phaseLabel = state.phase.replace(/-/g, " ");
|
|
192
223
|
await saveFile(continuePath, formatContinue({
|
|
193
224
|
frontmatter: {
|
|
194
225
|
milestone: state.activeMilestone.id,
|
|
195
226
|
slice: state.activeSlice.id,
|
|
196
|
-
task:
|
|
227
|
+
task: taskId,
|
|
197
228
|
step: 0,
|
|
198
229
|
totalSteps: 0,
|
|
199
230
|
status: "compacted",
|
|
200
231
|
savedAt: new Date().toISOString(),
|
|
201
232
|
},
|
|
202
|
-
completedWork:
|
|
203
|
-
|
|
233
|
+
completedWork: state.activeTask
|
|
234
|
+
? `Task ${taskId} (${taskTitle}) was in progress when compaction occurred.`
|
|
235
|
+
: `Slice ${state.activeSlice.id} was in ${phaseLabel} phase when compaction occurred.`,
|
|
236
|
+
remainingWork: state.activeTask
|
|
237
|
+
? "Check the task plan for remaining steps."
|
|
238
|
+
: "Continue this slice from the latest planning/research/discussion artifacts.",
|
|
204
239
|
decisions: "Check task summary files for prior decisions.",
|
|
205
240
|
context: "Session was auto-compacted by Pi. Resume with /gsd.",
|
|
206
|
-
nextAction:
|
|
241
|
+
nextAction: state.activeTask
|
|
242
|
+
? `Resume task ${taskId}: ${taskTitle}.`
|
|
243
|
+
: `Resume ${phaseLabel} work for slice ${state.activeSlice.id}.`,
|
|
207
244
|
}));
|
|
208
245
|
});
|
|
209
246
|
// Context-mode snapshot: write .gsd/last-snapshot.md before compaction so
|
|
@@ -225,7 +262,7 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
225
262
|
const basePath = process.cwd();
|
|
226
263
|
let activeContext = null;
|
|
227
264
|
try {
|
|
228
|
-
const state = await
|
|
265
|
+
const state = await deriveGsdState(basePath);
|
|
229
266
|
if (state.activeMilestone && state.activeSlice && state.activeTask) {
|
|
230
267
|
activeContext =
|
|
231
268
|
`Active: ${state.activeMilestone.id} / ${state.activeSlice.id} / ${state.activeTask.id}` +
|
|
@@ -242,6 +279,7 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
242
279
|
}
|
|
243
280
|
});
|
|
244
281
|
pi.on("session_shutdown", async (_event, ctx) => {
|
|
282
|
+
const { isParallelActive, shutdownParallel } = await import("../parallel-orchestrator.js");
|
|
245
283
|
if (isParallelActive()) {
|
|
246
284
|
try {
|
|
247
285
|
await shutdownParallel(process.cwd());
|
|
@@ -252,7 +290,7 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
252
290
|
}
|
|
253
291
|
if (!isAutoActive() && !isAutoPaused())
|
|
254
292
|
return;
|
|
255
|
-
const dash =
|
|
293
|
+
const dash = getAutoRuntimeSnapshot();
|
|
256
294
|
if (dash.currentUnit) {
|
|
257
295
|
saveActivityLog(ctx, dash.basePath, dash.currentUnit.type, dash.currentUnit.id);
|
|
258
296
|
}
|
|
@@ -278,7 +316,7 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
278
316
|
// If ask_user_questions was called with a gate ID but hasn't been confirmed,
|
|
279
317
|
// block all non-read-only tool calls to prevent the model from skipping gates.
|
|
280
318
|
if (getPendingGate()) {
|
|
281
|
-
const milestoneId =
|
|
319
|
+
const milestoneId = await getDiscussionMilestoneIdFor(discussionBasePath);
|
|
282
320
|
if (isToolCallEventType("bash", event)) {
|
|
283
321
|
const bashGuard = shouldBlockPendingGateBash(event.input.command, milestoneId, isQueuePhaseActive());
|
|
284
322
|
if (bashGuard.block)
|
|
@@ -309,6 +347,37 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
309
347
|
if (queueGuard.block)
|
|
310
348
|
return queueGuard;
|
|
311
349
|
}
|
|
350
|
+
// ── Planning-unit tools-policy enforcement (#4934): runtime half ─────
|
|
351
|
+
// The active auto-mode unit's manifest declares a ToolsPolicy. For
|
|
352
|
+
// planning/docs/read-only modes, deny writes outside .gsd/ (or the
|
|
353
|
+
// manifest's allowedPathGlobs), bash that isn't read-only, and
|
|
354
|
+
// subagent dispatch. Closes the b23 bug class where a discuss-milestone
|
|
355
|
+
// turn used the host Edit tool to modify user source files.
|
|
356
|
+
const dash = getAutoRuntimeSnapshot();
|
|
357
|
+
const activeUnitType = dash.currentUnit?.type;
|
|
358
|
+
if (activeUnitType) {
|
|
359
|
+
const manifest = resolveManifest(activeUnitType);
|
|
360
|
+
if (manifest) {
|
|
361
|
+
let planningInput = "";
|
|
362
|
+
let agentClasses;
|
|
363
|
+
if (isToolCallEventType("write", event)) {
|
|
364
|
+
planningInput = event.input.path;
|
|
365
|
+
}
|
|
366
|
+
else if (isToolCallEventType("edit", event)) {
|
|
367
|
+
planningInput = event.input.path;
|
|
368
|
+
}
|
|
369
|
+
else if (isToolCallEventType("bash", event)) {
|
|
370
|
+
planningInput = event.input.command;
|
|
371
|
+
}
|
|
372
|
+
else if (event.toolName === "subagent" || event.toolName === "task") {
|
|
373
|
+
// Subagent inputs use { agent }, { tasks: [{ agent }] }, or { chain: [{ agent }] }.
|
|
374
|
+
agentClasses = extractSubagentAgentClasses(event.input);
|
|
375
|
+
}
|
|
376
|
+
const planningGuard = shouldBlockPlanningUnit(event.toolName, planningInput, dash.basePath || discussionBasePath, activeUnitType, manifest.tools, agentClasses);
|
|
377
|
+
if (planningGuard.block)
|
|
378
|
+
return planningGuard;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
312
381
|
// ── Single-writer engine: block direct writes to STATE.md ──────────
|
|
313
382
|
// Covers write, edit, and bash tools to prevent bypass vectors.
|
|
314
383
|
if (isToolCallEventType("write", event)) {
|
|
@@ -328,7 +397,7 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
328
397
|
}
|
|
329
398
|
if (!isToolCallEventType("write", event))
|
|
330
399
|
return;
|
|
331
|
-
const result = shouldBlockContextWrite(event.toolName, event.input.path,
|
|
400
|
+
const result = shouldBlockContextWrite(event.toolName, event.input.path, await getDiscussionMilestoneIdFor(discussionBasePath), isQueuePhaseActive());
|
|
332
401
|
if (result.block)
|
|
333
402
|
return result;
|
|
334
403
|
});
|
|
@@ -338,6 +407,18 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
338
407
|
return;
|
|
339
408
|
markToolStart(event.toolCallId, event.toolName);
|
|
340
409
|
safetyRecordToolCall(event.toolCallId, event.toolName, event.input);
|
|
410
|
+
// Persist immediately at dispatch so a mid-unit re-dispatch — which calls
|
|
411
|
+
// resetEvidence() + loadEvidenceFromDisk() in runUnitPhase — cannot wipe
|
|
412
|
+
// the entry between tool_call and tool_execution_end. Without this, the
|
|
413
|
+
// race window equals the tool's runtime, producing the "no bash calls"
|
|
414
|
+
// false positive when the LLM clearly ran a verification command.
|
|
415
|
+
const callDash = getAutoRuntimeSnapshot();
|
|
416
|
+
if (callDash.basePath && callDash.currentUnit?.type === "execute-task") {
|
|
417
|
+
const { milestone: cMid, slice: cSid, task: cTid } = parseUnitId(callDash.currentUnit.id);
|
|
418
|
+
if (cMid && cSid && cTid) {
|
|
419
|
+
saveEvidenceToDisk(callDash.basePath, cMid, cSid, cTid);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
341
422
|
// Destructive command classification (warn only, never block)
|
|
342
423
|
if (isToolCallEventType("bash", event)) {
|
|
343
424
|
const classification = classifyCommand(event.input.command);
|
|
@@ -368,7 +449,7 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
368
449
|
}
|
|
369
450
|
if (event.toolName !== "ask_user_questions")
|
|
370
451
|
return;
|
|
371
|
-
const milestoneId =
|
|
452
|
+
const milestoneId = await getDiscussionMilestoneIdFor(process.cwd());
|
|
372
453
|
const queueActive = isQueuePhaseActive();
|
|
373
454
|
const details = event.details;
|
|
374
455
|
// ── Discussion gate enforcement: handle gate question responses ──
|
|
@@ -464,7 +545,7 @@ export function registerHooks(pi, ecosystemHandlers) {
|
|
|
464
545
|
safetyRecordToolResult(event.toolCallId, event.toolName, event.result, event.isError);
|
|
465
546
|
// Persist evidence to disk after each tool result so it survives a session
|
|
466
547
|
// restart mid-unit (Bug #4385 — non-persisted evidence false positives).
|
|
467
|
-
const dash =
|
|
548
|
+
const dash = getAutoRuntimeSnapshot();
|
|
468
549
|
if (dash.basePath && dash.currentUnit?.type === "execute-task") {
|
|
469
550
|
const { milestone: pMid, slice: pSid, task: pTid } = parseUnitId(dash.currentUnit.id);
|
|
470
551
|
if (pMid && pSid && pTid) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { Key } from "@gsd/pi-tui";
|
|
4
|
-
import { GSDDashboardOverlay } from "../dashboard-overlay.js";
|
|
5
|
-
import { GSDNotificationOverlay } from "../notification-overlay.js";
|
|
6
|
-
import { ParallelMonitorOverlay } from "../parallel-monitor-overlay.js";
|
|
7
4
|
import { GSD_SHORTCUTS } from "../shortcut-defs.js";
|
|
8
|
-
import { projectRoot } from "../commands/context.js";
|
|
9
5
|
import { shortcutDesc } from "../../shared/mod.js";
|
|
6
|
+
async function getProjectRoot() {
|
|
7
|
+
const { projectRoot } = await import("../commands/context.js");
|
|
8
|
+
return projectRoot();
|
|
9
|
+
}
|
|
10
10
|
export function registerShortcuts(pi) {
|
|
11
11
|
const overlayOptions = {
|
|
12
12
|
width: "90%",
|
|
@@ -15,7 +15,10 @@ export function registerShortcuts(pi) {
|
|
|
15
15
|
anchor: "center",
|
|
16
16
|
};
|
|
17
17
|
const openDashboardOverlay = async (ctx) => {
|
|
18
|
-
const basePath =
|
|
18
|
+
const [{ GSDDashboardOverlay }, basePath] = await Promise.all([
|
|
19
|
+
import("../dashboard-overlay.js"),
|
|
20
|
+
getProjectRoot(),
|
|
21
|
+
]);
|
|
19
22
|
if (!existsSync(join(basePath, ".gsd"))) {
|
|
20
23
|
ctx.ui.notify("No .gsd/ directory found. Run /gsd to start.", "info");
|
|
21
24
|
return;
|
|
@@ -26,6 +29,7 @@ export function registerShortcuts(pi) {
|
|
|
26
29
|
});
|
|
27
30
|
};
|
|
28
31
|
const openNotificationsOverlay = async (ctx) => {
|
|
32
|
+
const { GSDNotificationOverlay } = await import("../notification-overlay.js");
|
|
29
33
|
await ctx.ui.custom((tui, theme, _kb, done) => new GSDNotificationOverlay(tui, theme, () => done(true)), {
|
|
30
34
|
overlay: true,
|
|
31
35
|
overlayOptions: {
|
|
@@ -38,12 +42,13 @@ export function registerShortcuts(pi) {
|
|
|
38
42
|
});
|
|
39
43
|
};
|
|
40
44
|
const openParallelOverlay = async (ctx) => {
|
|
41
|
-
const basePath =
|
|
45
|
+
const basePath = await getProjectRoot();
|
|
42
46
|
const parallelDir = join(basePath, ".gsd", "parallel");
|
|
43
47
|
if (!existsSync(parallelDir)) {
|
|
44
48
|
ctx.ui.notify("No parallel workers found. Run /gsd parallel start first.", "info");
|
|
45
49
|
return;
|
|
46
50
|
}
|
|
51
|
+
const { ParallelMonitorOverlay } = await import("../parallel-monitor-overlay.js");
|
|
47
52
|
await ctx.ui.custom((tui, theme, _kb, done) => new ParallelMonitorOverlay(tui, theme, () => done(true), basePath), {
|
|
48
53
|
overlay: true,
|
|
49
54
|
overlayOptions,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function extractSubagentAgentClasses(input) {
|
|
2
|
+
if (!input || typeof input !== "object")
|
|
3
|
+
return [];
|
|
4
|
+
const record = input;
|
|
5
|
+
const agentClasses = [];
|
|
6
|
+
const addAgentClass = (value) => {
|
|
7
|
+
if (typeof value === "string" && value.trim().length > 0)
|
|
8
|
+
agentClasses.push(value.trim());
|
|
9
|
+
};
|
|
10
|
+
const addFromItems = (value) => {
|
|
11
|
+
if (!Array.isArray(value))
|
|
12
|
+
return;
|
|
13
|
+
for (const item of value) {
|
|
14
|
+
if (item && typeof item === "object")
|
|
15
|
+
addAgentClass(item.agent);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
addAgentClass(record.agent);
|
|
19
|
+
addFromItems(record.tasks);
|
|
20
|
+
addFromItems(record.chain);
|
|
21
|
+
return agentClasses;
|
|
22
|
+
}
|