gsd-pi 2.71.0 → 2.72.0-dev.3118184
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 +69 -19
- package/dist/cli.js +88 -6
- package/dist/headless-events.d.ts +2 -0
- package/dist/headless-events.js +7 -0
- package/dist/headless.js +16 -3
- package/dist/mcp-server.js +40 -17
- package/dist/onboarding.js +10 -0
- package/dist/provider-migrations.d.ts +10 -0
- package/dist/provider-migrations.js +12 -0
- package/dist/resource-loader.js +139 -13
- package/dist/resources/GSD-WORKFLOW.md +1 -1
- package/dist/resources/agents/debugger.md +58 -0
- package/dist/resources/agents/doc-writer.md +43 -0
- package/dist/resources/agents/git-ops.md +56 -0
- package/dist/resources/agents/javascript-pro.md +46 -271
- package/dist/resources/agents/planner.md +55 -0
- package/dist/resources/agents/refactorer.md +47 -0
- package/dist/resources/agents/reviewer.md +48 -0
- package/dist/resources/agents/security.md +59 -0
- package/dist/resources/agents/tester.md +50 -0
- package/dist/resources/agents/typescript-pro.md +41 -235
- package/dist/resources/extensions/async-jobs/await-tool.js +7 -4
- package/dist/resources/extensions/async-jobs/job-manager.js +28 -3
- package/dist/resources/extensions/claude-code-cli/partial-builder.js +40 -12
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +142 -14
- package/dist/resources/extensions/gsd/auto/infra-errors.js +34 -0
- package/dist/resources/extensions/gsd/auto/loop.js +116 -2
- package/dist/resources/extensions/gsd/auto/phases.js +5 -1
- package/dist/resources/extensions/gsd/auto/session.js +11 -0
- package/dist/resources/extensions/gsd/auto-dashboard.js +22 -16
- package/dist/resources/extensions/gsd/auto-model-selection.js +10 -2
- package/dist/resources/extensions/gsd/auto-post-unit.js +6 -0
- package/dist/resources/extensions/gsd/auto-prompts.js +88 -33
- package/dist/resources/extensions/gsd/auto-recovery.js +11 -0
- package/dist/resources/extensions/gsd/auto-start.js +34 -7
- package/dist/resources/extensions/gsd/auto-tool-tracking.js +1 -1
- package/dist/resources/extensions/gsd/auto-worktree.js +1 -1
- package/dist/resources/extensions/gsd/auto.js +81 -19
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +3 -3
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +11 -11
- package/dist/resources/extensions/gsd/bootstrap/register-shortcuts.js +63 -51
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +6 -0
- package/dist/resources/extensions/gsd/commands/context.js +15 -6
- package/dist/resources/extensions/gsd/commands/dispatcher.js +12 -2
- package/dist/resources/extensions/gsd/commands/handlers/auto.js +10 -33
- package/dist/resources/extensions/gsd/commands/handlers/core.js +56 -11
- package/dist/resources/extensions/gsd/commands/handlers/notifications-handler.js +15 -6
- package/dist/resources/extensions/gsd/commands/handlers/workflow.js +4 -10
- package/dist/resources/extensions/gsd/commands-handlers.js +4 -1
- package/dist/resources/extensions/gsd/context-injector.js +1 -1
- package/dist/resources/extensions/gsd/custom-workflow-engine.js +3 -7
- package/dist/resources/extensions/gsd/dashboard-overlay.js +8 -3
- package/dist/resources/extensions/gsd/definition-io.js +15 -0
- package/dist/resources/extensions/gsd/dispatch-guard.js +22 -1
- package/dist/resources/extensions/gsd/doctor-providers.js +23 -0
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +6 -3
- package/dist/resources/extensions/gsd/error-classifier.js +5 -2
- package/dist/resources/extensions/gsd/forensics.js +19 -6
- package/dist/resources/extensions/gsd/gate-registry.js +208 -0
- package/dist/resources/extensions/gsd/git-service.js +11 -8
- package/dist/resources/extensions/gsd/gitignore.js +12 -6
- package/dist/resources/extensions/gsd/gsd-db.js +90 -6
- package/dist/resources/extensions/gsd/guided-flow.js +5 -10
- package/dist/resources/extensions/gsd/key-manager.js +2 -0
- package/dist/resources/extensions/gsd/metrics.js +1 -0
- package/dist/resources/extensions/gsd/milestone-actions.js +10 -4
- package/dist/resources/extensions/gsd/milestone-validation-gates.js +11 -12
- package/dist/resources/extensions/gsd/notification-overlay.js +42 -13
- package/dist/resources/extensions/gsd/notification-store.js +56 -5
- package/dist/resources/extensions/gsd/notification-widget.js +5 -13
- package/dist/resources/extensions/gsd/parallel-monitor-overlay.js +8 -3
- package/dist/resources/extensions/gsd/pre-execution-checks.js +35 -2
- package/dist/resources/extensions/gsd/preferences-skills.js +2 -34
- package/dist/resources/extensions/gsd/preferences-types.js +15 -0
- package/dist/resources/extensions/gsd/preferences.js +16 -3
- package/dist/resources/extensions/gsd/prompt-loader.js +4 -1
- package/dist/resources/extensions/gsd/prompt-validation.js +126 -0
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +5 -3
- package/dist/resources/extensions/gsd/prompts/discuss.md +123 -12
- package/dist/resources/extensions/gsd/prompts/execute-task.md +22 -19
- package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
- package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +2 -0
- package/dist/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
- package/dist/resources/extensions/gsd/prompts/queue.md +3 -2
- package/dist/resources/extensions/gsd/prompts/system.md +1 -0
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +4 -1
- package/dist/resources/extensions/gsd/session-model-override.js +25 -0
- package/dist/resources/extensions/gsd/shortcut-defs.js +40 -0
- package/dist/resources/extensions/gsd/state.js +29 -2
- package/dist/resources/extensions/gsd/tools/complete-slice.js +52 -1
- package/dist/resources/extensions/gsd/tools/complete-task.js +51 -1
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +4 -1
- package/dist/resources/extensions/gsd/workflow-projections.js +7 -0
- package/dist/resources/extensions/gsd/worktree-manager.js +30 -3
- package/dist/resources/extensions/gsd/write-intercept.js +10 -1
- package/dist/resources/extensions/ollama/index.js +17 -10
- package/dist/resources/extensions/ollama/ollama-client.js +35 -6
- package/dist/resources/extensions/ollama/ollama-discovery.js +32 -6
- package/dist/resources/extensions/shared/gsd-phase-state.js +35 -0
- package/dist/resources/extensions/subagent/agents.js +8 -0
- package/dist/resources/extensions/subagent/index.js +17 -0
- package/dist/resources/skills/create-skill/SKILL.md +2 -0
- package/dist/startup-model-validation.d.ts +0 -1
- package/dist/startup-model-validation.js +6 -2
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +15 -15
- package/dist/web/standalone/.next/build-manifest.json +3 -3
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/required-server-files.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page.js +3 -3
- package/dist/web/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found/page.js +2 -2
- package/dist/web/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/boot/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/bridge-terminal/stream/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/browse-directories/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/captures/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/dev-mode/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/doctor/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/experimental/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/experimental/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/export-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/forensics/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/history/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/hooks/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/inspect/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/live-state/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/notifications/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/preferences/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/recovery/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/remote-questions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/remote-questions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/browser/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/command/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/events/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/session/events/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/session/manage/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/settings-data/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/skill-health/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/steer/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/switch-root/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/input/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/input/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/resize/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route.js +2 -2
- package/dist/web/standalone/.next/server/app/api/terminal/sessions/route_client-reference-manifest.js +1 -1
- package/dist/web/standalone/.next/server/app/api/terminal/stream/route.js +3 -3
- 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 +15 -15
- package/dist/web/standalone/.next/server/chunks/2331.js +16 -16
- package/dist/web/standalone/.next/server/chunks/4741.js +12 -12
- package/dist/web/standalone/.next/server/chunks/5822.js +2 -2
- package/dist/web/standalone/.next/server/chunks/63.js +8 -8
- package/dist/web/standalone/.next/server/chunks/6897.js +3 -3
- package/dist/web/standalone/.next/server/edge-runtime-webpack.js +2 -0
- package/dist/web/standalone/.next/server/functions-config-manifest.json +0 -9
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-manifest.json +29 -2
- package/dist/web/standalone/.next/server/middleware.js +4 -12
- 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/app/_not-found/{page-2f24283c162b6ab3.js → page-f2a7482d42a5614b.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/{layout-9ecfd95f343793f0.js → layout-a16c7a7ecdf0c2cf.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/app/page-f1e30ab6bb269149.js +1 -0
- package/dist/web/standalone/.next/static/chunks/main-app-fdab67f7802d7832.js +1 -0
- package/dist/web/standalone/.next/static/chunks/next/dist/client/components/builtin/global-error-459824ffb8c323dd.js +1 -0
- package/dist/web/standalone/node_modules/node-pty/build/Makefile +2 -2
- package/dist/web/standalone/node_modules/node-pty/build/Release/pty.node +0 -0
- package/dist/web/standalone/node_modules/node-pty/build/pty.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +14 -14
- package/dist/web/standalone/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +14 -14
- package/dist/web/standalone/server.js +1 -1
- package/package.json +1 -1
- package/packages/mcp-server/dist/server.d.ts +12 -1
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +90 -42
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +22 -12
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/src/server.ts +110 -38
- package/packages/mcp-server/src/workflow-tools.test.ts +110 -0
- package/packages/mcp-server/src/workflow-tools.ts +32 -12
- package/packages/pi-ai/dist/env-api-keys.js +1 -0
- package/packages/pi-ai/dist/env-api-keys.js.map +1 -1
- package/packages/pi-ai/dist/models.custom.d.ts +105 -0
- package/packages/pi-ai/dist/models.custom.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.custom.js +97 -0
- package/packages/pi-ai/dist/models.custom.js.map +1 -1
- package/packages/pi-ai/dist/models.generated.d.ts +648 -140
- package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.js +867 -370
- package/packages/pi-ai/dist/models.generated.js.map +1 -1
- package/packages/pi-ai/dist/models.generated.test.d.ts +2 -0
- package/packages/pi-ai/dist/models.generated.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/models.generated.test.js +334 -0
- package/packages/pi-ai/dist/models.generated.test.js.map +1 -0
- package/packages/pi-ai/dist/models.test.js +105 -0
- package/packages/pi-ai/dist/models.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.js +11 -2
- package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/anthropic-auth.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js +20 -0
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts +4 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.js +8 -3
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js +44 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts +2 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +7 -4
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.js +11 -0
- package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/packages/pi-ai/dist/types.d.ts +1 -1
- 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/oauth/github-copilot.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js +5 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.d.ts +2 -0
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js +57 -0
- package/packages/pi-ai/dist/utils/oauth/github-copilot.test.js.map +1 -0
- package/packages/pi-ai/src/env-api-keys.ts +1 -0
- package/packages/pi-ai/src/models.custom.ts +98 -0
- package/packages/pi-ai/src/models.generated.test.ts +373 -0
- package/packages/pi-ai/src/models.generated.ts +867 -370
- package/packages/pi-ai/src/models.test.ts +135 -0
- package/packages/pi-ai/src/providers/amazon-bedrock.ts +13 -1
- package/packages/pi-ai/src/providers/anthropic-auth.test.ts +32 -0
- package/packages/pi-ai/src/providers/anthropic-shared.test.ts +55 -1
- package/packages/pi-ai/src/providers/anthropic-shared.ts +14 -3
- package/packages/pi-ai/src/providers/anthropic.ts +8 -4
- package/packages/pi-ai/src/providers/openai-completions.ts +14 -0
- package/packages/pi-ai/src/types.ts +1 -0
- package/packages/pi-ai/src/utils/oauth/github-copilot.test.ts +71 -0
- package/packages/pi-ai/src/utils/oauth/github-copilot.ts +4 -1
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.test.js +61 -0
- package/packages/pi-coding-agent/dist/core/agent-session-renderable-tools.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 +2 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +10 -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 +27 -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 +85 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.js +64 -0
- package/packages/pi-coding-agent/dist/core/model-resolver-initial-model-auth.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.js +23 -18
- package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.test.d.ts +8 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.test.js +75 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts +5 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.js +55 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.test.js +57 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.d.ts +11 -0
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +47 -5
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/sdk.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/sdk.test.js +71 -0
- package/packages/pi-coding-agent/dist/core/sdk.test.js.map +1 -0
- 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 +1 -1
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.js +13 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/login-dialog.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +36 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts +4 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +24 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js +9 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +4 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +130 -12
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +7 -2
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js +6 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/model-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +4 -3
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +4 -2
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/core/agent-session-renderable-tools.test.ts +70 -0
- package/packages/pi-coding-agent/src/core/agent-session.ts +2 -1
- package/packages/pi-coding-agent/src/core/auth-storage.test.ts +108 -0
- package/packages/pi-coding-agent/src/core/auth-storage.ts +30 -0
- package/packages/pi-coding-agent/src/core/model-resolver-initial-model-auth.test.ts +78 -0
- package/packages/pi-coding-agent/src/core/model-resolver.test.ts +85 -0
- package/packages/pi-coding-agent/src/core/model-resolver.ts +23 -18
- package/packages/pi-coding-agent/src/core/retry-handler.test.ts +83 -0
- package/packages/pi-coding-agent/src/core/retry-handler.ts +60 -1
- package/packages/pi-coding-agent/src/core/sdk.test.ts +89 -0
- package/packages/pi-coding-agent/src/core/sdk.ts +55 -9
- package/packages/pi-coding-agent/src/index.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/login-dialog.test.ts +24 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +72 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/login-dialog.ts +30 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/model-selector.ts +15 -6
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +131 -12
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +7 -2
- package/packages/pi-coding-agent/src/modes/interactive/controllers/model-controller.ts +6 -1
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +4 -3
- package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +4 -2
- package/packages/pi-tui/dist/components/__tests__/editor.test.js +12 -0
- package/packages/pi-tui/dist/components/__tests__/editor.test.js.map +1 -1
- package/packages/pi-tui/dist/components/__tests__/input.test.js +12 -0
- package/packages/pi-tui/dist/components/__tests__/input.test.js.map +1 -1
- package/packages/pi-tui/dist/keys.d.ts.map +1 -1
- package/packages/pi-tui/dist/keys.js +27 -0
- package/packages/pi-tui/dist/keys.js.map +1 -1
- package/packages/pi-tui/src/components/__tests__/editor.test.ts +18 -0
- package/packages/pi-tui/src/components/__tests__/input.test.ts +18 -0
- package/packages/pi-tui/src/keys.ts +32 -0
- package/pkg/package.json +1 -1
- package/src/resources/GSD-WORKFLOW.md +1 -1
- package/src/resources/agents/debugger.md +58 -0
- package/src/resources/agents/doc-writer.md +43 -0
- package/src/resources/agents/git-ops.md +56 -0
- package/src/resources/agents/javascript-pro.md +46 -271
- package/src/resources/agents/planner.md +55 -0
- package/src/resources/agents/refactorer.md +47 -0
- package/src/resources/agents/reviewer.md +48 -0
- package/src/resources/agents/security.md +59 -0
- package/src/resources/agents/tester.md +50 -0
- package/src/resources/agents/typescript-pro.md +41 -235
- package/src/resources/extensions/async-jobs/await-tool.test.ts +40 -7
- package/src/resources/extensions/async-jobs/await-tool.ts +7 -4
- package/src/resources/extensions/async-jobs/job-manager.ts +33 -3
- package/src/resources/extensions/claude-code-cli/partial-builder.ts +45 -12
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +152 -13
- package/src/resources/extensions/claude-code-cli/tests/partial-builder.test.ts +91 -2
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +301 -6
- package/src/resources/extensions/gsd/auto/infra-errors.ts +38 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +2 -0
- package/src/resources/extensions/gsd/auto/loop.ts +134 -2
- package/src/resources/extensions/gsd/auto/phases.ts +6 -0
- package/src/resources/extensions/gsd/auto/session.ts +11 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +29 -18
- package/src/resources/extensions/gsd/auto-model-selection.ts +9 -1
- package/src/resources/extensions/gsd/auto-post-unit.ts +7 -0
- package/src/resources/extensions/gsd/auto-prompts.ts +111 -33
- package/src/resources/extensions/gsd/auto-recovery.ts +10 -0
- package/src/resources/extensions/gsd/auto-start.ts +41 -7
- package/src/resources/extensions/gsd/auto-tool-tracking.ts +1 -1
- package/src/resources/extensions/gsd/auto-worktree.ts +1 -1
- package/src/resources/extensions/gsd/auto.ts +97 -20
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +3 -3
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +10 -10
- package/src/resources/extensions/gsd/bootstrap/register-shortcuts.ts +79 -60
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +7 -0
- package/src/resources/extensions/gsd/commands/context.ts +16 -5
- package/src/resources/extensions/gsd/commands/dispatcher.ts +14 -2
- package/src/resources/extensions/gsd/commands/handlers/auto.ts +10 -36
- package/src/resources/extensions/gsd/commands/handlers/core.ts +58 -11
- package/src/resources/extensions/gsd/commands/handlers/notifications-handler.ts +17 -7
- package/src/resources/extensions/gsd/commands/handlers/workflow.ts +4 -10
- package/src/resources/extensions/gsd/commands-handlers.ts +5 -1
- package/src/resources/extensions/gsd/context-injector.ts +1 -1
- package/src/resources/extensions/gsd/custom-workflow-engine.ts +4 -8
- package/src/resources/extensions/gsd/dashboard-overlay.ts +10 -3
- package/src/resources/extensions/gsd/definition-io.ts +18 -0
- package/src/resources/extensions/gsd/dispatch-guard.ts +23 -1
- package/src/resources/extensions/gsd/doctor-providers.ts +24 -0
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +6 -3
- package/src/resources/extensions/gsd/error-classifier.ts +5 -2
- package/src/resources/extensions/gsd/forensics.ts +23 -7
- package/src/resources/extensions/gsd/gate-registry.ts +251 -0
- package/src/resources/extensions/gsd/git-service.ts +11 -8
- package/src/resources/extensions/gsd/gitignore.ts +12 -6
- package/src/resources/extensions/gsd/gsd-db.ts +105 -6
- package/src/resources/extensions/gsd/guided-flow.ts +5 -10
- package/src/resources/extensions/gsd/interrupted-session.ts +1 -0
- package/src/resources/extensions/gsd/key-manager.ts +2 -0
- package/src/resources/extensions/gsd/metrics.ts +12 -1
- package/src/resources/extensions/gsd/milestone-actions.ts +10 -3
- package/src/resources/extensions/gsd/milestone-validation-gates.ts +11 -13
- package/src/resources/extensions/gsd/notification-overlay.ts +47 -14
- package/src/resources/extensions/gsd/notification-store.ts +54 -5
- package/src/resources/extensions/gsd/notification-widget.ts +5 -14
- package/src/resources/extensions/gsd/parallel-monitor-overlay.ts +10 -3
- package/src/resources/extensions/gsd/pre-execution-checks.ts +39 -2
- package/src/resources/extensions/gsd/preferences-skills.ts +2 -36
- package/src/resources/extensions/gsd/preferences-types.ts +16 -0
- package/src/resources/extensions/gsd/preferences.ts +19 -6
- package/src/resources/extensions/gsd/prompt-loader.ts +6 -1
- package/src/resources/extensions/gsd/prompt-validation.ts +157 -0
- package/src/resources/extensions/gsd/prompts/complete-slice.md +5 -3
- package/src/resources/extensions/gsd/prompts/discuss.md +123 -12
- package/src/resources/extensions/gsd/prompts/execute-task.md +22 -19
- package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +2 -0
- package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +2 -0
- package/src/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
- package/src/resources/extensions/gsd/prompts/queue.md +3 -2
- package/src/resources/extensions/gsd/prompts/system.md +1 -0
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +4 -1
- package/src/resources/extensions/gsd/session-model-override.ts +36 -0
- package/src/resources/extensions/gsd/shortcut-defs.ts +56 -0
- package/src/resources/extensions/gsd/state.ts +33 -2
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/auto-start-model-capture.test.ts +25 -9
- package/src/resources/extensions/gsd/tests/auto-start-worktree-db-path.test.ts +28 -0
- package/src/resources/extensions/gsd/tests/block-db-writes.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/complete-slice-gate-closure.test.ts +167 -0
- package/src/resources/extensions/gsd/tests/complete-slice-prompt-task-summary-layout.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/definition-io.test.ts +57 -0
- package/src/resources/extensions/gsd/tests/dispatch-guard.test.ts +53 -0
- package/src/resources/extensions/gsd/tests/doctor-heal-fixable-warnings.test.ts +14 -0
- package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +36 -0
- package/src/resources/extensions/gsd/tests/execute-task-prompt-existing-artifact-guard.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/false-degraded-mode-warning.test.ts +104 -0
- package/src/resources/extensions/gsd/tests/forensics-stuck-loops.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/format-shortcut.test.ts +31 -0
- package/src/resources/extensions/gsd/tests/gate-dispatch.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/gate-registry.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +107 -5
- package/src/resources/extensions/gsd/tests/gsd-no-project-error.test.ts +73 -0
- package/src/resources/extensions/gsd/tests/infra-errors-cooldown.test.ts +180 -0
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +66 -1
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +8 -6
- package/src/resources/extensions/gsd/tests/key-manager.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/memory-pressure-stuck-state.test.ts +54 -0
- package/src/resources/extensions/gsd/tests/model-isolation.test.ts +36 -51
- package/src/resources/extensions/gsd/tests/notification-store.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/notification-widget.test.ts +26 -0
- package/src/resources/extensions/gsd/tests/notifications-handler.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/parallel-monitor-overlay.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/park-db-sync.test.ts +18 -0
- package/src/resources/extensions/gsd/tests/plan-milestone-artifact-verification.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/post-unit-state-rebuild.test.ts +34 -0
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +49 -0
- package/src/resources/extensions/gsd/tests/preferences-formatting.test.ts +87 -0
- package/src/resources/extensions/gsd/tests/preferences.test.ts +53 -0
- package/src/resources/extensions/gsd/tests/projection-regression.test.ts +96 -1
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/prompt-loader-working-directory.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/prompt-system-gate-coverage.test.ts +208 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +16 -0
- package/src/resources/extensions/gsd/tests/register-hooks-depth-verification.test.ts +97 -0
- package/src/resources/extensions/gsd/tests/register-shortcuts.test.ts +63 -5
- package/src/resources/extensions/gsd/tests/session-model-override.test.ts +35 -0
- package/src/resources/extensions/gsd/tests/stale-slice-rows.test.ts +41 -0
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/tool-invocation-error-loop-break.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/validate-milestone-prompt-verification-classes.test.ts +18 -0
- package/src/resources/extensions/gsd/tools/complete-slice.ts +63 -0
- package/src/resources/extensions/gsd/tools/complete-task.ts +63 -0
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +4 -1
- package/src/resources/extensions/gsd/types.ts +26 -0
- package/src/resources/extensions/gsd/workflow-projections.ts +8 -0
- package/src/resources/extensions/gsd/worktree-manager.ts +29 -3
- package/src/resources/extensions/gsd/write-intercept.ts +10 -1
- package/src/resources/extensions/ollama/index.ts +17 -8
- package/src/resources/extensions/ollama/ollama-client.ts +35 -6
- package/src/resources/extensions/ollama/ollama-discovery.ts +37 -6
- package/src/resources/extensions/ollama/ollama-status-indicator.test.ts +28 -0
- package/src/resources/extensions/ollama/tests/ollama-discovery.test.ts +54 -0
- package/src/resources/extensions/shared/gsd-phase-state.ts +42 -0
- package/src/resources/extensions/shared/tests/gsd-phase-state.test.ts +48 -0
- package/src/resources/extensions/subagent/agents.ts +10 -0
- package/src/resources/extensions/subagent/index.ts +18 -0
- package/src/resources/extensions/subagent/tests/agents-conflicts.test.ts +33 -0
- package/src/resources/skills/create-skill/SKILL.md +2 -0
- 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/{nPky_WQC28aBD77eZsRAB → NzO79SOz9jHX-VY5-0t2O}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{nPky_WQC28aBD77eZsRAB → NzO79SOz9jHX-VY5-0t2O}/_ssgManifest.js +0 -0
|
@@ -15,7 +15,7 @@ import { join } from "node:path";
|
|
|
15
15
|
import { resolveMilestonePath, resolveMilestoneFile, buildMilestoneFileName, } from "./paths.js";
|
|
16
16
|
import { invalidateAllCaches } from "./cache.js";
|
|
17
17
|
import { loadQueueOrder, saveQueueOrder } from "./queue-order.js";
|
|
18
|
-
import { isDbAvailable, updateMilestoneStatus } from "./gsd-db.js";
|
|
18
|
+
import { getMilestone, isDbAvailable, updateMilestoneStatus } from "./gsd-db.js";
|
|
19
19
|
import { logWarning } from "./workflow-logger.js";
|
|
20
20
|
// ─── Park ──────────────────────────────────────────────────────────────────
|
|
21
21
|
/**
|
|
@@ -68,9 +68,15 @@ export function unparkMilestone(basePath, milestoneId) {
|
|
|
68
68
|
if (!mDir || !existsSync(mDir))
|
|
69
69
|
return false;
|
|
70
70
|
const parkedPath = join(mDir, buildMilestoneFileName(milestoneId, "PARKED"));
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
const hadParkedFile = existsSync(parkedPath);
|
|
72
|
+
const dbThinksParked = isDbAvailable() && getMilestone(milestoneId)?.status === "parked";
|
|
73
|
+
// Recover the reverse desync too: DB can still say "parked" even when the
|
|
74
|
+
// PARKED marker was lost on disk, and /gsd unpark should repair that state.
|
|
75
|
+
if (!hadParkedFile && !dbThinksParked)
|
|
76
|
+
return false;
|
|
77
|
+
if (hadParkedFile) {
|
|
78
|
+
unlinkSync(parkedPath);
|
|
79
|
+
}
|
|
74
80
|
// Sync DB status so deriveStateFromDb picks up the unparked milestone (#2694)
|
|
75
81
|
if (isDbAvailable()) {
|
|
76
82
|
try {
|
|
@@ -6,17 +6,12 @@
|
|
|
6
6
|
* records in the DB. This module inserts milestone-level validation gates
|
|
7
7
|
* that correspond to the validation checks performed.
|
|
8
8
|
*
|
|
9
|
-
* Gate IDs for milestone validation
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* MV03 — Cross-slice integration
|
|
13
|
-
* MV04 — Requirement coverage
|
|
14
|
-
*
|
|
15
|
-
* These use the existing quality_gates table with scope "milestone".
|
|
9
|
+
* Gate IDs for milestone validation (MV01–MV04) are sourced from the
|
|
10
|
+
* gate registry so the definitions stay in lockstep with prompt builders,
|
|
11
|
+
* dispatch rules, and state derivation. See gate-registry.ts.
|
|
16
12
|
*/
|
|
17
13
|
import { _getAdapter } from "./gsd-db.js";
|
|
18
|
-
|
|
19
|
-
const MILESTONE_GATE_IDS = ["MV01", "MV02", "MV03", "MV04"];
|
|
14
|
+
import { getGatesForTurn } from "./gate-registry.js";
|
|
20
15
|
/**
|
|
21
16
|
* Insert milestone-level quality_gates records for a validation run.
|
|
22
17
|
*
|
|
@@ -24,21 +19,25 @@ const MILESTONE_GATE_IDS = ["MV01", "MV02", "MV03", "MV04"];
|
|
|
24
19
|
* from the overall milestone validation verdict. Individual gate-level
|
|
25
20
|
* verdicts are not available (the handler receives a single verdict),
|
|
26
21
|
* so all gates share the overall verdict.
|
|
22
|
+
*
|
|
23
|
+
* Gate IDs come from the registry — adding/removing an MV-scoped gate
|
|
24
|
+
* in gate-registry.ts automatically flows through here.
|
|
27
25
|
*/
|
|
28
26
|
export function insertMilestoneValidationGates(milestoneId, sliceId, verdict, evaluatedAt) {
|
|
29
27
|
const db = _getAdapter();
|
|
30
28
|
if (!db)
|
|
31
29
|
return;
|
|
32
30
|
const gateVerdict = verdict === "pass" ? "pass" : "flag";
|
|
33
|
-
|
|
31
|
+
const milestoneGates = getGatesForTurn("validate-milestone");
|
|
32
|
+
for (const def of milestoneGates) {
|
|
34
33
|
db.prepare(`INSERT OR REPLACE INTO quality_gates
|
|
35
34
|
(milestone_id, slice_id, gate_id, scope, task_id, status, verdict, rationale, findings, evaluated_at)
|
|
36
35
|
VALUES (:mid, :sid, :gid, 'milestone', '', 'complete', :verdict, :rationale, '', :evaluated_at)`).run({
|
|
37
36
|
":mid": milestoneId,
|
|
38
37
|
":sid": sliceId,
|
|
39
|
-
":gid":
|
|
38
|
+
":gid": def.id,
|
|
40
39
|
":verdict": gateVerdict,
|
|
41
|
-
":rationale":
|
|
40
|
+
":rationale": `${def.promptSection} — milestone validation verdict: ${verdict}`,
|
|
42
41
|
":evaluated_at": evaluatedAt,
|
|
43
42
|
});
|
|
44
43
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// GSD Extension — Notification History Overlay
|
|
2
2
|
// Scrollable panel showing all persisted notifications with severity filtering.
|
|
3
|
-
// Toggled with Ctrl+Alt+N (⌃⌥N on macOS)
|
|
3
|
+
// Toggled with Ctrl+Alt+N (⌃⌥N on macOS), Ctrl+Shift+N fallback, or /gsd notifications.
|
|
4
4
|
import { truncateToWidth, visibleWidth, matchesKey, Key } from "@gsd/pi-tui";
|
|
5
|
-
import { readNotifications, markAllRead, clearNotifications, } from "./notification-store.js";
|
|
5
|
+
import { readNotifications, markAllRead, clearNotifications, onNotificationStoreChange, } from "./notification-store.js";
|
|
6
|
+
import { formattedShortcutPair } from "./shortcut-defs.js";
|
|
6
7
|
import { padRight, joinColumns } from "../shared/mod.js";
|
|
7
8
|
const FILTER_CYCLE = ["all", "error", "warning", "info"];
|
|
8
9
|
function severityIcon(severity) {
|
|
@@ -55,6 +56,11 @@ function formatTimestamp(ts) {
|
|
|
55
56
|
return ts.slice(11, 19); // fallback: HH:MM:SS
|
|
56
57
|
}
|
|
57
58
|
}
|
|
59
|
+
function notificationSignature(entries) {
|
|
60
|
+
return entries
|
|
61
|
+
.map((entry) => `${entry.ts}|${entry.severity}|${entry.read ? 1 : 0}|${entry.message}`)
|
|
62
|
+
.join("\n");
|
|
63
|
+
}
|
|
58
64
|
export class GSDNotificationOverlay {
|
|
59
65
|
tui;
|
|
60
66
|
theme;
|
|
@@ -64,9 +70,11 @@ export class GSDNotificationOverlay {
|
|
|
64
70
|
scrollOffset = 0;
|
|
65
71
|
filterIndex = 0;
|
|
66
72
|
entries = [];
|
|
73
|
+
entriesSignature = "";
|
|
67
74
|
refreshTimer;
|
|
68
75
|
disposed = false;
|
|
69
76
|
resizeHandler = null;
|
|
77
|
+
unsubscribeStore = null;
|
|
70
78
|
constructor(tui, theme, onClose) {
|
|
71
79
|
this.tui = tui;
|
|
72
80
|
this.theme = theme;
|
|
@@ -74,6 +82,7 @@ export class GSDNotificationOverlay {
|
|
|
74
82
|
// Mark all as read on open
|
|
75
83
|
markAllRead();
|
|
76
84
|
this.entries = readNotifications();
|
|
85
|
+
this.entriesSignature = notificationSignature(this.entries);
|
|
77
86
|
// Resize handler
|
|
78
87
|
this.resizeHandler = () => {
|
|
79
88
|
if (this.disposed)
|
|
@@ -82,18 +91,18 @@ export class GSDNotificationOverlay {
|
|
|
82
91
|
this.tui.requestRender();
|
|
83
92
|
};
|
|
84
93
|
process.stdout.on("resize", this.resizeHandler);
|
|
85
|
-
//
|
|
94
|
+
// Subscribe to store mutations for immediate updates
|
|
95
|
+
this.unsubscribeStore = onNotificationStoreChange(() => {
|
|
96
|
+
if (this.disposed)
|
|
97
|
+
return;
|
|
98
|
+
this._refreshFromDisk();
|
|
99
|
+
});
|
|
100
|
+
// 30s safety-net for cross-process edits (web subprocess, parallel workers)
|
|
86
101
|
this.refreshTimer = setInterval(() => {
|
|
87
102
|
if (this.disposed)
|
|
88
103
|
return;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
this.entries = fresh;
|
|
92
|
-
markAllRead();
|
|
93
|
-
this.invalidate();
|
|
94
|
-
this.tui.requestRender();
|
|
95
|
-
}
|
|
96
|
-
}, 3000);
|
|
104
|
+
this._refreshFromDisk();
|
|
105
|
+
}, 30_000);
|
|
97
106
|
}
|
|
98
107
|
get filter() {
|
|
99
108
|
return FILTER_CYCLE[this.filterIndex];
|
|
@@ -104,7 +113,10 @@ export class GSDNotificationOverlay {
|
|
|
104
113
|
return this.entries.filter((e) => e.severity === this.filter);
|
|
105
114
|
}
|
|
106
115
|
handleInput(data) {
|
|
107
|
-
if (matchesKey(data, Key.escape) ||
|
|
116
|
+
if (matchesKey(data, Key.escape) ||
|
|
117
|
+
matchesKey(data, Key.ctrl("c")) ||
|
|
118
|
+
matchesKey(data, Key.ctrlAlt("n")) ||
|
|
119
|
+
matchesKey(data, Key.ctrlShift("n"))) {
|
|
108
120
|
this.dispose();
|
|
109
121
|
this.onClose();
|
|
110
122
|
return;
|
|
@@ -146,6 +158,7 @@ export class GSDNotificationOverlay {
|
|
|
146
158
|
if (data === "c") {
|
|
147
159
|
clearNotifications();
|
|
148
160
|
this.entries = [];
|
|
161
|
+
this.entriesSignature = notificationSignature(this.entries);
|
|
149
162
|
this.scrollOffset = 0;
|
|
150
163
|
this.invalidate();
|
|
151
164
|
this.tui.requestRender();
|
|
@@ -174,11 +187,26 @@ export class GSDNotificationOverlay {
|
|
|
174
187
|
dispose() {
|
|
175
188
|
this.disposed = true;
|
|
176
189
|
clearInterval(this.refreshTimer);
|
|
190
|
+
if (this.unsubscribeStore) {
|
|
191
|
+
this.unsubscribeStore();
|
|
192
|
+
this.unsubscribeStore = null;
|
|
193
|
+
}
|
|
177
194
|
if (this.resizeHandler) {
|
|
178
195
|
process.stdout.removeListener("resize", this.resizeHandler);
|
|
179
196
|
this.resizeHandler = null;
|
|
180
197
|
}
|
|
181
198
|
}
|
|
199
|
+
_refreshFromDisk() {
|
|
200
|
+
const fresh = readNotifications();
|
|
201
|
+
const signature = notificationSignature(fresh);
|
|
202
|
+
if (signature !== this.entriesSignature) {
|
|
203
|
+
markAllRead();
|
|
204
|
+
this.entries = readNotifications();
|
|
205
|
+
this.entriesSignature = notificationSignature(this.entries);
|
|
206
|
+
this.invalidate();
|
|
207
|
+
this.tui.requestRender();
|
|
208
|
+
}
|
|
209
|
+
}
|
|
182
210
|
wrapInBox(inner, width) {
|
|
183
211
|
const th = this.theme;
|
|
184
212
|
const border = (s) => th.fg("borderAccent", s);
|
|
@@ -215,7 +243,8 @@ export class GSDNotificationOverlay {
|
|
|
215
243
|
lines.push(row(joinColumns(`${title} ${th.fg("dim", "filter:")} ${filterLabel}`, th.fg("dim", count), contentWidth)));
|
|
216
244
|
lines.push(hr());
|
|
217
245
|
// Controls
|
|
218
|
-
|
|
246
|
+
const closeShortcut = formattedShortcutPair("notifications");
|
|
247
|
+
lines.push(row(th.fg("dim", `↑/↓ scroll f filter c clear Esc close (${closeShortcut})`)));
|
|
219
248
|
lines.push(blank());
|
|
220
249
|
// Entries
|
|
221
250
|
const filtered = this.filteredEntries;
|
|
@@ -9,16 +9,23 @@ import { randomUUID } from "node:crypto";
|
|
|
9
9
|
const MAX_ENTRIES = 500;
|
|
10
10
|
const FILENAME = "notifications.jsonl";
|
|
11
11
|
const LOCKFILE = "notifications.lock";
|
|
12
|
+
const DEDUP_WINDOW_MS = 30_000;
|
|
13
|
+
const DEDUP_PRUNE_THRESHOLD = 200;
|
|
12
14
|
// ─── Module State ───────────────────────────────────────────────────────
|
|
13
15
|
let _basePath = null;
|
|
14
16
|
let _lineCount = 0; // Hint for rotation — not authoritative for public API
|
|
15
17
|
let _suppressCount = 0;
|
|
18
|
+
let _recentMessageTimestamps = new Map();
|
|
19
|
+
const _changeListeners = new Set();
|
|
16
20
|
// ─── Public API ─────────────────────────────────────────────────────────
|
|
17
21
|
/**
|
|
18
22
|
* Initialize the notification store. Call once at session start with the
|
|
19
23
|
* project root. Seeds in-memory counters from the existing file on disk.
|
|
20
24
|
*/
|
|
21
25
|
export function initNotificationStore(basePath) {
|
|
26
|
+
if (_basePath !== basePath) {
|
|
27
|
+
_recentMessageTimestamps.clear();
|
|
28
|
+
}
|
|
22
29
|
_basePath = basePath;
|
|
23
30
|
// Seed line count hint for rotation — public counters read from disk
|
|
24
31
|
_lineCount = _readEntriesFromDisk(basePath).length;
|
|
@@ -32,11 +39,24 @@ export function appendNotification(message, severity, source = "notify") {
|
|
|
32
39
|
return;
|
|
33
40
|
if (_suppressCount > 0)
|
|
34
41
|
return;
|
|
42
|
+
const persistedMessage = message.length > 500 ? message.slice(0, 500) + "…" : message;
|
|
43
|
+
const dedupKey = `${_basePath}:${severity}:${source}:${persistedMessage}`;
|
|
44
|
+
const now = Date.now();
|
|
45
|
+
const lastSeen = _recentMessageTimestamps.get(dedupKey);
|
|
46
|
+
if (lastSeen !== undefined && now - lastSeen < DEDUP_WINDOW_MS)
|
|
47
|
+
return;
|
|
48
|
+
_recentMessageTimestamps.set(dedupKey, now);
|
|
49
|
+
if (_recentMessageTimestamps.size > DEDUP_PRUNE_THRESHOLD) {
|
|
50
|
+
for (const [key, ts] of _recentMessageTimestamps) {
|
|
51
|
+
if (now - ts > DEDUP_WINDOW_MS)
|
|
52
|
+
_recentMessageTimestamps.delete(key);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
35
55
|
const entry = {
|
|
36
56
|
id: randomUUID(),
|
|
37
57
|
ts: new Date().toISOString(),
|
|
38
58
|
severity,
|
|
39
|
-
message:
|
|
59
|
+
message: persistedMessage,
|
|
40
60
|
source,
|
|
41
61
|
read: false,
|
|
42
62
|
};
|
|
@@ -49,6 +69,7 @@ export function appendNotification(message, severity, source = "notify") {
|
|
|
49
69
|
if (_lineCount > MAX_ENTRIES) {
|
|
50
70
|
_rotate();
|
|
51
71
|
}
|
|
72
|
+
_emitChange();
|
|
52
73
|
}
|
|
53
74
|
catch {
|
|
54
75
|
// Non-fatal — never let persistence break the caller
|
|
@@ -77,6 +98,7 @@ export function markAllRead(basePath) {
|
|
|
77
98
|
const hasUnread = entries.some((e) => !e.read);
|
|
78
99
|
if (!hasUnread)
|
|
79
100
|
return;
|
|
101
|
+
let changed = false;
|
|
80
102
|
try {
|
|
81
103
|
_withLock(bp, () => {
|
|
82
104
|
// Re-read inside lock to get freshest state
|
|
@@ -85,11 +107,14 @@ export function markAllRead(basePath) {
|
|
|
85
107
|
return;
|
|
86
108
|
const lines = fresh.map((e) => JSON.stringify({ ...e, read: true }));
|
|
87
109
|
_atomicWrite(bp, lines.join("\n") + "\n");
|
|
110
|
+
changed = true;
|
|
88
111
|
});
|
|
89
112
|
}
|
|
90
113
|
catch {
|
|
91
114
|
// Non-fatal
|
|
92
115
|
}
|
|
116
|
+
if (changed)
|
|
117
|
+
_emitChange();
|
|
93
118
|
}
|
|
94
119
|
/**
|
|
95
120
|
* Clear all notifications. Atomic write of empty content under lock.
|
|
@@ -102,6 +127,8 @@ export function clearNotifications(basePath) {
|
|
|
102
127
|
_withLock(bp, () => {
|
|
103
128
|
_atomicWrite(bp, "");
|
|
104
129
|
});
|
|
130
|
+
_lineCount = 0;
|
|
131
|
+
_emitChange();
|
|
105
132
|
}
|
|
106
133
|
catch {
|
|
107
134
|
// Non-fatal
|
|
@@ -146,6 +173,16 @@ export function suppressPersistence() {
|
|
|
146
173
|
export function unsuppressPersistence() {
|
|
147
174
|
_suppressCount = Math.max(0, _suppressCount - 1);
|
|
148
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* Subscribe to notification-store mutations (append, mark-read, clear).
|
|
178
|
+
* Returns an unsubscribe function.
|
|
179
|
+
*/
|
|
180
|
+
export function onNotificationStoreChange(listener) {
|
|
181
|
+
_changeListeners.add(listener);
|
|
182
|
+
return () => {
|
|
183
|
+
_changeListeners.delete(listener);
|
|
184
|
+
};
|
|
185
|
+
}
|
|
149
186
|
// ─── Test Helpers ───────────────────────────────────────────────────────
|
|
150
187
|
/**
|
|
151
188
|
* Reset module state. Only for use in tests.
|
|
@@ -154,6 +191,8 @@ export function _resetNotificationStore() {
|
|
|
154
191
|
_basePath = null;
|
|
155
192
|
_lineCount = 0;
|
|
156
193
|
_suppressCount = 0;
|
|
194
|
+
_recentMessageTimestamps = new Map();
|
|
195
|
+
_changeListeners.clear();
|
|
157
196
|
}
|
|
158
197
|
// ─── Internal ───────────────────────────────────────────────────────────
|
|
159
198
|
function _readEntriesFromDisk(basePath) {
|
|
@@ -191,12 +230,23 @@ function _rotate() {
|
|
|
191
230
|
const trimmed = entries.slice(entries.length - MAX_ENTRIES);
|
|
192
231
|
const lines = trimmed.map((e) => JSON.stringify(e));
|
|
193
232
|
_atomicWrite(_basePath, lines.join("\n") + "\n");
|
|
233
|
+
_lineCount = trimmed.length;
|
|
194
234
|
});
|
|
195
235
|
}
|
|
196
236
|
catch {
|
|
197
237
|
// Non-fatal
|
|
198
238
|
}
|
|
199
239
|
}
|
|
240
|
+
function _emitChange() {
|
|
241
|
+
for (const listener of _changeListeners) {
|
|
242
|
+
try {
|
|
243
|
+
listener();
|
|
244
|
+
}
|
|
245
|
+
catch {
|
|
246
|
+
// Non-fatal
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
200
250
|
/**
|
|
201
251
|
* Atomic file rewrite via temp-file + rename. Prevents partial reads
|
|
202
252
|
* by other processes (web API subprocess, parallel workers).
|
|
@@ -251,10 +301,11 @@ function _withLock(basePath, fn) {
|
|
|
251
301
|
break;
|
|
252
302
|
}
|
|
253
303
|
}
|
|
254
|
-
//
|
|
255
|
-
|
|
304
|
+
// Best-effort: mutation runs regardless of lock status (idempotent overwrites).
|
|
305
|
+
// createdLock gates cleanup only — never skip fn() on lock failure.
|
|
306
|
+
const createdLock = fd !== null;
|
|
256
307
|
try {
|
|
257
|
-
if (
|
|
308
|
+
if (createdLock && fd !== null) {
|
|
258
309
|
// Write our PID timestamp into the lock for stale detection
|
|
259
310
|
writeFileSync(lockPath, String(Date.now()), "utf-8");
|
|
260
311
|
closeSync(fd);
|
|
@@ -263,7 +314,7 @@ function _withLock(basePath, fn) {
|
|
|
263
314
|
}
|
|
264
315
|
finally {
|
|
265
316
|
// Only delete the lock if we created it — never remove another process's lock
|
|
266
|
-
if (
|
|
317
|
+
if (createdLock) {
|
|
267
318
|
try {
|
|
268
319
|
unlinkSync(lockPath);
|
|
269
320
|
}
|
|
@@ -2,24 +2,14 @@
|
|
|
2
2
|
// Always-on ambient widget rendered belowEditor showing unread count and
|
|
3
3
|
// the most recent notification message. Refreshes every 5 seconds.
|
|
4
4
|
// Widget key: "gsd-notifications", placement: "belowEditor"
|
|
5
|
-
import { getUnreadCount,
|
|
6
|
-
import {
|
|
5
|
+
import { getUnreadCount, onNotificationStoreChange } from "./notification-store.js";
|
|
6
|
+
import { formattedShortcutPair } from "./shortcut-defs.js";
|
|
7
7
|
// ─── Pure rendering ──���────────────────────────���─────────────────────────
|
|
8
8
|
export function buildNotificationWidgetLines() {
|
|
9
9
|
const unread = getUnreadCount();
|
|
10
10
|
if (unread === 0)
|
|
11
11
|
return [];
|
|
12
|
-
|
|
13
|
-
const latest = entries[0]; // newest-first
|
|
14
|
-
if (!latest)
|
|
15
|
-
return [];
|
|
16
|
-
const icon = latest.severity === "error" ? "✗" : latest.severity === "warning" ? "⚠" : "●";
|
|
17
|
-
const badge = `${unread} unread`;
|
|
18
|
-
const msgMax = 80;
|
|
19
|
-
const truncated = latest.message.length > msgMax
|
|
20
|
-
? latest.message.slice(0, msgMax - 1) + "…"
|
|
21
|
-
: latest.message;
|
|
22
|
-
return [` ${icon} [${badge}] ${truncated} (${formatShortcut("Ctrl+Alt+N")} to view)`];
|
|
12
|
+
return [` 🔔 Notifications: ${unread} unread (${formattedShortcutPair("notifications")})`];
|
|
23
13
|
}
|
|
24
14
|
// ─── Widget init ────────────────────────────────────────────────────────
|
|
25
15
|
const REFRESH_INTERVAL_MS = 5_000;
|
|
@@ -39,6 +29,7 @@ export function initNotificationWidget(ctx) {
|
|
|
39
29
|
cachedLines = undefined;
|
|
40
30
|
_tui.requestRender();
|
|
41
31
|
};
|
|
32
|
+
const unsubscribe = onNotificationStoreChange(refresh);
|
|
42
33
|
const refreshTimer = setInterval(refresh, REFRESH_INTERVAL_MS);
|
|
43
34
|
return {
|
|
44
35
|
render(_width) {
|
|
@@ -50,6 +41,7 @@ export function initNotificationWidget(ctx) {
|
|
|
50
41
|
cachedLines = undefined;
|
|
51
42
|
},
|
|
52
43
|
dispose() {
|
|
44
|
+
unsubscribe();
|
|
53
45
|
clearInterval(refreshTimer);
|
|
54
46
|
},
|
|
55
47
|
};
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* GSD Parallel Monitor Overlay
|
|
3
3
|
*
|
|
4
4
|
* Full-screen TUI overlay showing real-time parallel worker progress.
|
|
5
|
-
* Opened via `/gsd parallel watch
|
|
5
|
+
* Opened via `/gsd parallel watch`, Ctrl+Alt+P (⌃⌥P on macOS),
|
|
6
|
+
* or Ctrl+Shift+P fallback.
|
|
6
7
|
* Reads the same data sources as `scripts/parallel-monitor.mjs` but
|
|
7
8
|
* renders as a native pi-tui overlay with theme integration.
|
|
8
9
|
*/
|
|
@@ -11,6 +12,7 @@ import { join } from "node:path";
|
|
|
11
12
|
import { spawnSync } from "node:child_process";
|
|
12
13
|
import { matchesKey, Key } from "@gsd/pi-tui";
|
|
13
14
|
import { formatDuration } from "../shared/mod.js";
|
|
15
|
+
import { formattedShortcutPair } from "./shortcut-defs.js";
|
|
14
16
|
// ─── Data Helpers ─────────────────────────────────────────────────────────
|
|
15
17
|
function readJsonSafe(filePath) {
|
|
16
18
|
try {
|
|
@@ -285,7 +287,10 @@ export class ParallelMonitorOverlay {
|
|
|
285
287
|
}
|
|
286
288
|
}
|
|
287
289
|
handleInput(data) {
|
|
288
|
-
if (matchesKey(data, Key.escape) ||
|
|
290
|
+
if (matchesKey(data, Key.escape) ||
|
|
291
|
+
matchesKey(data, Key.ctrlAlt("p")) ||
|
|
292
|
+
matchesKey(data, Key.ctrlShift("p")) ||
|
|
293
|
+
data === "q") {
|
|
289
294
|
this.dispose();
|
|
290
295
|
this.onClose();
|
|
291
296
|
return;
|
|
@@ -403,7 +408,7 @@ export class ParallelMonitorOverlay {
|
|
|
403
408
|
}
|
|
404
409
|
lines.push(` ${t.bold("Total: $" + this.workers.reduce((s, wk) => s + wk.cost, 0).toFixed(2))}`);
|
|
405
410
|
}
|
|
406
|
-
lines.push(t.fg("muted",
|
|
411
|
+
lines.push(t.fg("muted", ` ESC/q/${formattedShortcutPair("parallel")} close │ ↑↓ scroll`));
|
|
407
412
|
// Apply scroll — use terminal rows as height estimate
|
|
408
413
|
const termHeight = process.stdout.rows || 40;
|
|
409
414
|
const maxScroll = Math.max(0, lines.length - termHeight);
|
|
@@ -229,6 +229,33 @@ function extractPathFromAnnotation(raw) {
|
|
|
229
229
|
// Fall back to the original behavior for already-plain paths.
|
|
230
230
|
return trimmed.replace(/`/g, "");
|
|
231
231
|
}
|
|
232
|
+
/**
|
|
233
|
+
* Planning units sometimes use task.inputs for prose like "Current enum shape"
|
|
234
|
+
* instead of concrete file paths. Those entries should not fail path checks.
|
|
235
|
+
* Keep validation for anything that still looks like a real file reference:
|
|
236
|
+
* explicit backticks, globs, separators, dot-paths, or single-token basenames
|
|
237
|
+
* like Dockerfile.
|
|
238
|
+
*/
|
|
239
|
+
function shouldValidateInputAsPath(raw) {
|
|
240
|
+
const trimmed = raw.trim();
|
|
241
|
+
if (!trimmed)
|
|
242
|
+
return false;
|
|
243
|
+
if (/^`+[^`]+`+/.test(trimmed)) {
|
|
244
|
+
return true;
|
|
245
|
+
}
|
|
246
|
+
const candidate = extractPathFromAnnotation(trimmed);
|
|
247
|
+
if (!candidate)
|
|
248
|
+
return false;
|
|
249
|
+
if (!/\s/.test(candidate)) {
|
|
250
|
+
return true;
|
|
251
|
+
}
|
|
252
|
+
return (candidate.startsWith("/") ||
|
|
253
|
+
candidate.startsWith("./") ||
|
|
254
|
+
candidate.startsWith("../") ||
|
|
255
|
+
candidate.startsWith("~/") ||
|
|
256
|
+
/[\\/]/.test(candidate) ||
|
|
257
|
+
/[*?[\]{}]/.test(candidate));
|
|
258
|
+
}
|
|
232
259
|
/**
|
|
233
260
|
* Build a set of files that will be created by tasks up to (but not including) taskIndex.
|
|
234
261
|
* All paths are normalized for consistent comparison.
|
|
@@ -262,6 +289,8 @@ export function checkFilePathConsistency(tasks, basePath) {
|
|
|
262
289
|
// Skip empty strings
|
|
263
290
|
if (!file.trim())
|
|
264
291
|
continue;
|
|
292
|
+
if (!shouldValidateInputAsPath(file))
|
|
293
|
+
continue;
|
|
265
294
|
// Normalize path for consistent comparison
|
|
266
295
|
const normalizedFile = normalizeFilePath(file);
|
|
267
296
|
// Check if file exists on disk
|
|
@@ -289,7 +318,7 @@ export function checkFilePathConsistency(tasks, basePath) {
|
|
|
289
318
|
*
|
|
290
319
|
* All paths are normalized before comparison to ensure ./src/a.ts matches src/a.ts.
|
|
291
320
|
*/
|
|
292
|
-
export function checkTaskOrdering(tasks,
|
|
321
|
+
export function checkTaskOrdering(tasks, basePath) {
|
|
293
322
|
const results = [];
|
|
294
323
|
// Build map: normalized file → task index that creates it
|
|
295
324
|
const fileCreators = new Map();
|
|
@@ -309,9 +338,13 @@ export function checkTaskOrdering(tasks, _basePath) {
|
|
|
309
338
|
const task = tasks[i];
|
|
310
339
|
const filesToCheck = [...task.inputs];
|
|
311
340
|
for (const file of filesToCheck) {
|
|
341
|
+
if (!shouldValidateInputAsPath(file))
|
|
342
|
+
continue;
|
|
312
343
|
const normalizedFile = normalizeFilePath(file);
|
|
313
344
|
const creator = fileCreators.get(normalizedFile);
|
|
314
|
-
|
|
345
|
+
const absolutePath = resolve(basePath, normalizedFile);
|
|
346
|
+
const existsOnDisk = existsSync(absolutePath);
|
|
347
|
+
if (creator && creator.index > i && !existsOnDisk) {
|
|
315
348
|
// Task reads file that is created later — impossible ordering
|
|
316
349
|
results.push({
|
|
317
350
|
category: "file",
|
|
@@ -9,7 +9,6 @@ import { homedir } from "node:os";
|
|
|
9
9
|
import { isAbsolute, join } from "node:path";
|
|
10
10
|
import { statSync } from "node:fs";
|
|
11
11
|
import { validatePreferences } from "./preferences-validation.js";
|
|
12
|
-
import { loadEffectiveGSDPreferences } from "./preferences.js";
|
|
13
12
|
/**
|
|
14
13
|
* Known skill directories, in priority order.
|
|
15
14
|
* Searches both the skills.sh ecosystem directory (~/.agents/skills/) and
|
|
@@ -130,36 +129,5 @@ export function resolveAllSkillReferences(preferences, cwd) {
|
|
|
130
129
|
}
|
|
131
130
|
return { resolutions, warnings };
|
|
132
131
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
* If resolved, shows the path so the agent knows exactly where to read.
|
|
136
|
-
* If unresolved, marks it clearly.
|
|
137
|
-
*/
|
|
138
|
-
export function formatSkillRef(ref, resolutions) {
|
|
139
|
-
const resolution = resolutions.get(ref);
|
|
140
|
-
if (!resolution || resolution.method === "unresolved") {
|
|
141
|
-
return `${ref} (⚠ not found — check skill name or path)`;
|
|
142
|
-
}
|
|
143
|
-
// For absolute paths where SKILL.md is just appended, don't clutter the output
|
|
144
|
-
if (resolution.method === "absolute-path" || resolution.method === "absolute-dir") {
|
|
145
|
-
return ref;
|
|
146
|
-
}
|
|
147
|
-
// For bare names resolved from skill directories, show the resolved path
|
|
148
|
-
return `${ref} → \`${resolution.resolvedPath}\``;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Resolve the skill discovery mode from effective preferences.
|
|
152
|
-
* Defaults to "suggest" -- skills are identified during research but not installed automatically.
|
|
153
|
-
*/
|
|
154
|
-
export function resolveSkillDiscoveryMode() {
|
|
155
|
-
const prefs = loadEffectiveGSDPreferences();
|
|
156
|
-
return prefs?.preferences.skill_discovery ?? "suggest";
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Resolve the skill staleness threshold in days.
|
|
160
|
-
* Returns 0 if disabled, default 60 if not configured.
|
|
161
|
-
*/
|
|
162
|
-
export function resolveSkillStalenessDays() {
|
|
163
|
-
const prefs = loadEffectiveGSDPreferences();
|
|
164
|
-
return prefs?.preferences.skill_staleness_days ?? 60;
|
|
165
|
-
}
|
|
132
|
+
// resolveSkillDiscoveryMode and resolveSkillStalenessDays moved to
|
|
133
|
+
// preferences.ts to break circular dependency (they need loadEffectiveGSDPreferences).
|
|
@@ -92,3 +92,18 @@ export const KNOWN_UNIT_TYPES = [
|
|
|
92
92
|
"discuss-milestone", "discuss-slice", "worktree-merge",
|
|
93
93
|
];
|
|
94
94
|
export const SKILL_ACTIONS = new Set(["use", "prefer", "avoid"]);
|
|
95
|
+
/**
|
|
96
|
+
* Format a skill reference for the system prompt.
|
|
97
|
+
* If resolved, shows the path so the agent knows exactly where to read.
|
|
98
|
+
* If unresolved, marks it clearly.
|
|
99
|
+
*/
|
|
100
|
+
export function formatSkillRef(ref, resolutions) {
|
|
101
|
+
const resolution = resolutions.get(ref);
|
|
102
|
+
if (!resolution || resolution.method === "unresolved") {
|
|
103
|
+
return `${ref} (⚠ not found — check skill name or path)`;
|
|
104
|
+
}
|
|
105
|
+
if (resolution.method === "absolute-path" || resolution.method === "absolute-dir") {
|
|
106
|
+
return ref;
|
|
107
|
+
}
|
|
108
|
+
return `${ref} → \`${resolution.resolvedPath}\``;
|
|
109
|
+
}
|
|
@@ -17,13 +17,23 @@ import { parse as parseYaml } from "yaml";
|
|
|
17
17
|
import { normalizeStringArray } from "../shared/format-utils.js";
|
|
18
18
|
import { logWarning } from "./workflow-logger.js";
|
|
19
19
|
import { resolveProfileDefaults as _resolveProfileDefaults } from "./preferences-models.js";
|
|
20
|
-
import { KNOWN_PREFERENCE_KEYS, MODE_DEFAULTS, } from "./preferences-types.js";
|
|
20
|
+
import { KNOWN_PREFERENCE_KEYS, MODE_DEFAULTS, formatSkillRef, } from "./preferences-types.js";
|
|
21
21
|
import { validatePreferences } from "./preferences-validation.js";
|
|
22
|
-
import { formatSkillRef } from "./preferences-skills.js";
|
|
23
22
|
// ─── Re-exports: validation ─────────────────────────────────────────────────
|
|
24
23
|
export { validatePreferences } from "./preferences-validation.js";
|
|
25
24
|
// ─── Re-exports: skills ─────────────────────────────────────────────────────
|
|
26
|
-
export { resolveAllSkillReferences
|
|
25
|
+
export { resolveAllSkillReferences } from "./preferences-skills.js";
|
|
26
|
+
// These lived in preferences-skills.ts but imported loadEffectiveGSDPreferences
|
|
27
|
+
// back from this file, creating a circular dependency. Moved here since they
|
|
28
|
+
// are trivial wrappers over loadEffectiveGSDPreferences.
|
|
29
|
+
export function resolveSkillDiscoveryMode() {
|
|
30
|
+
const prefs = loadEffectiveGSDPreferences();
|
|
31
|
+
return prefs?.preferences.skill_discovery ?? "suggest";
|
|
32
|
+
}
|
|
33
|
+
export function resolveSkillStalenessDays() {
|
|
34
|
+
const prefs = loadEffectiveGSDPreferences();
|
|
35
|
+
return prefs?.preferences.skill_staleness_days ?? 60;
|
|
36
|
+
}
|
|
27
37
|
// ─── Re-exports: models ─────────────────────────────────────────────────────
|
|
28
38
|
export { resolveModelForUnit, resolveModelWithFallbacksForUnit, getNextFallbackModel, isTransientNetworkError, validateModelId, updatePreferencesModels, resolveDynamicRoutingConfig, resolveAutoSupervisorConfig, resolveProfileDefaults, resolveEffectiveProfile, resolveInlineLevel, resolveContextSelection, resolveSearchProviderFromPreferences, } from "./preferences-models.js";
|
|
29
39
|
// ─── Path Constants & Getters ───────────────────────────────────────────────
|
|
@@ -304,6 +314,9 @@ function mergePreferences(base, override) {
|
|
|
304
314
|
github: (base.github || override.github)
|
|
305
315
|
? { ...(base.github ?? {}), ...(override.github ?? {}) }
|
|
306
316
|
: undefined,
|
|
317
|
+
experimental: (base.experimental || override.experimental)
|
|
318
|
+
? { ...(base.experimental ?? {}), ...(override.experimental ?? {}) }
|
|
319
|
+
: undefined,
|
|
307
320
|
service_tier: override.service_tier ?? base.service_tier,
|
|
308
321
|
forensics_dedup: override.forensics_dedup ?? base.forensics_dedup,
|
|
309
322
|
show_token_cost: override.show_token_cost ?? base.show_token_cost,
|
|
@@ -132,10 +132,13 @@ export function loadPrompt(name, vars = {}) {
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
for (const [key, value] of Object.entries(effectiveVars)) {
|
|
135
|
+
const safeValue = key === "workingDirectory" && typeof value === "string"
|
|
136
|
+
? value.replaceAll("\\", "/")
|
|
137
|
+
: value;
|
|
135
138
|
// Use split/join instead of replaceAll to avoid JavaScript's special
|
|
136
139
|
// replacement patterns ($', $`, $&) being interpreted in the value.
|
|
137
140
|
// See: https://github.com/gsd-build/gsd-2/issues/2968
|
|
138
|
-
content = content.split(`{{${key}}}`).join(
|
|
141
|
+
content = content.split(`{{${key}}}`).join(safeValue);
|
|
139
142
|
}
|
|
140
143
|
return content.trim();
|
|
141
144
|
}
|