gsd-pi 2.75.0-dev.063e5a3 → 2.75.0-dev.fd2382b9f
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 +186 -149
- package/dist/claude-cli-check.d.ts +10 -0
- package/dist/claude-cli-check.js +13 -3
- package/dist/headless-events.d.ts +1 -1
- package/dist/headless-events.js +5 -2
- package/dist/headless.js +5 -6
- package/dist/loader.js +0 -0
- package/dist/onboarding.js +39 -14
- package/dist/resources/extensions/ask-user-questions.js +17 -5
- package/dist/resources/extensions/claude-code-cli/models.js +9 -0
- package/dist/resources/extensions/claude-code-cli/readiness.js +12 -2
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +76 -4
- package/dist/resources/extensions/gsd/auto/detect-stuck.js +9 -0
- package/dist/resources/extensions/gsd/auto/loop.js +67 -4
- package/dist/resources/extensions/gsd/auto/phases.js +70 -47
- package/dist/resources/extensions/gsd/auto/resolve.js +1 -1
- package/dist/resources/extensions/gsd/auto/run-unit.js +10 -1
- package/dist/resources/extensions/gsd/auto/session.js +5 -0
- package/dist/resources/extensions/gsd/auto-artifact-paths.js +20 -0
- package/dist/resources/extensions/gsd/auto-dashboard.js +15 -7
- package/dist/resources/extensions/gsd/auto-dispatch.js +112 -6
- package/dist/resources/extensions/gsd/auto-loop.js +1 -1
- package/dist/resources/extensions/gsd/auto-model-selection.js +10 -2
- package/dist/resources/extensions/gsd/auto-post-unit.js +9 -7
- package/dist/resources/extensions/gsd/auto-prompts.js +151 -37
- package/dist/resources/extensions/gsd/auto-recovery.js +57 -0
- package/dist/resources/extensions/gsd/auto-start.js +5 -3
- package/dist/resources/extensions/gsd/auto-verification.js +3 -3
- package/dist/resources/extensions/gsd/auto-worktree.js +55 -1
- package/dist/resources/extensions/gsd/auto.js +50 -25
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +8 -21
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +22 -4
- package/dist/resources/extensions/gsd/bootstrap/query-tools.js +29 -0
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +22 -0
- package/dist/resources/extensions/gsd/commands/catalog.js +67 -3
- package/dist/resources/extensions/gsd/commands/handlers/core.js +6 -0
- package/dist/resources/extensions/gsd/commands/handlers/escalate.js +171 -0
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +16 -0
- package/dist/resources/extensions/gsd/commands/handlers/workflow.js +228 -29
- package/dist/resources/extensions/gsd/commands-cmux.js +5 -2
- package/dist/resources/extensions/gsd/commands-debug.js +388 -0
- package/dist/resources/extensions/gsd/commands-do.js +1 -0
- package/dist/resources/extensions/gsd/commands-handlers.js +21 -2
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +1 -1
- package/dist/resources/extensions/gsd/commands-scan.js +94 -0
- package/dist/resources/extensions/gsd/commands-workflow-templates.js +101 -2
- package/dist/resources/extensions/gsd/custom-workflow-engine.js +74 -54
- package/dist/resources/extensions/gsd/db-writer.js +1 -0
- package/dist/resources/extensions/gsd/debug-session-store.js +238 -0
- package/dist/resources/extensions/gsd/definition-loader.js +7 -0
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +9 -9
- package/dist/resources/extensions/gsd/doctor-git-checks.js +5 -1
- package/dist/resources/extensions/gsd/doctor-proactive.js +4 -1
- package/dist/resources/extensions/gsd/doctor-providers.js +48 -20
- package/dist/resources/extensions/gsd/doctor-runtime-checks.js +22 -4
- package/dist/resources/extensions/gsd/doctor.js +7 -1
- package/dist/resources/extensions/gsd/error-classifier.js +6 -3
- package/dist/resources/extensions/gsd/escalation.js +321 -0
- package/dist/resources/extensions/gsd/forensics.js +26 -29
- package/dist/resources/extensions/gsd/git-service.js +0 -1
- package/dist/resources/extensions/gsd/graph.js +26 -2
- package/dist/resources/extensions/gsd/gsd-db.js +254 -29
- package/dist/resources/extensions/gsd/health-widget-core.js +42 -14
- package/dist/resources/extensions/gsd/health-widget.js +7 -4
- package/dist/resources/extensions/gsd/metrics.js +1 -0
- package/dist/resources/extensions/gsd/model-cost-table.js +3 -1
- package/dist/resources/extensions/gsd/model-router.js +7 -1
- package/dist/resources/extensions/gsd/native-git-bridge.js +137 -5
- package/dist/resources/extensions/gsd/notification-widget.js +24 -39
- package/dist/resources/extensions/gsd/notifications.js +4 -0
- package/dist/resources/extensions/gsd/post-execution-checks.js +27 -11
- package/dist/resources/extensions/gsd/pre-execution-checks.js +97 -4
- package/dist/resources/extensions/gsd/preferences-models.js +1 -0
- package/dist/resources/extensions/gsd/preferences-types.js +2 -1
- package/dist/resources/extensions/gsd/preferences-validation.js +42 -8
- package/dist/resources/extensions/gsd/preferences.js +10 -10
- package/dist/resources/extensions/gsd/prompts/debug-diagnose.md +25 -0
- package/dist/resources/extensions/gsd/prompts/debug-session-manager.md +80 -0
- package/dist/resources/extensions/gsd/prompts/execute-task.md +12 -0
- package/dist/resources/extensions/gsd/prompts/plan-milestone.md +12 -0
- package/dist/resources/extensions/gsd/prompts/refine-slice.md +69 -0
- package/dist/resources/extensions/gsd/prompts/scan.md +79 -0
- package/dist/resources/extensions/gsd/prompts/workflow-oneshot.md +26 -0
- package/dist/resources/extensions/gsd/run-manager.js +37 -17
- package/dist/resources/extensions/gsd/state.js +47 -3
- package/dist/resources/extensions/gsd/templates/PREFERENCES.md +7 -7
- package/dist/resources/extensions/gsd/tools/complete-task.js +80 -0
- package/dist/resources/extensions/gsd/tools/plan-milestone.js +37 -12
- package/dist/resources/extensions/gsd/tools/plan-slice.js +5 -2
- package/dist/resources/extensions/gsd/uok/flags.js +7 -7
- package/dist/resources/extensions/gsd/uok/kernel.js +8 -3
- package/dist/resources/extensions/gsd/workflow-dispatch.js +64 -0
- package/dist/resources/extensions/gsd/workflow-install.js +327 -0
- package/dist/resources/extensions/gsd/workflow-manifest.js +8 -0
- package/dist/resources/extensions/gsd/workflow-mcp.js +1 -6
- package/dist/resources/extensions/gsd/workflow-plugins.js +346 -0
- package/dist/resources/extensions/gsd/workflow-templates/accessibility-audit.md +88 -0
- package/dist/resources/extensions/gsd/workflow-templates/api-breaking-change.md +117 -0
- package/dist/resources/extensions/gsd/workflow-templates/bugfix.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/changelog-gen.md +82 -0
- package/dist/resources/extensions/gsd/workflow-templates/ci-bootstrap.md +144 -0
- package/dist/resources/extensions/gsd/workflow-templates/dead-code.md +81 -0
- package/dist/resources/extensions/gsd/workflow-templates/dep-upgrade.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/docs-sync.yaml +76 -0
- package/dist/resources/extensions/gsd/workflow-templates/env-audit.yaml +88 -0
- package/dist/resources/extensions/gsd/workflow-templates/full-project.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/hotfix.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/issue-triage.md +84 -0
- package/dist/resources/extensions/gsd/workflow-templates/observability-setup.md +133 -0
- package/dist/resources/extensions/gsd/workflow-templates/onboarding-check.md +74 -0
- package/dist/resources/extensions/gsd/workflow-templates/performance-audit.md +125 -0
- package/dist/resources/extensions/gsd/workflow-templates/pr-review.md +67 -0
- package/dist/resources/extensions/gsd/workflow-templates/pr-triage.md +83 -0
- package/dist/resources/extensions/gsd/workflow-templates/refactor.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/registry.json +184 -0
- package/dist/resources/extensions/gsd/workflow-templates/release.md +118 -0
- package/dist/resources/extensions/gsd/workflow-templates/rename-symbol.yaml +99 -0
- package/dist/resources/extensions/gsd/workflow-templates/security-audit.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/small-feature.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/spike.md +1 -0
- package/dist/resources/extensions/gsd/workflow-templates/test-backfill.yaml +73 -0
- package/dist/resources/extensions/gsd/worktree-resolver.js +42 -1
- package/dist/resources/extensions/remote-questions/commands.js +380 -0
- package/dist/resources/extensions/remote-questions/manager.js +39 -5
- package/dist/resources/extensions/remote-questions/telegram-adapter.js +79 -4
- package/dist/resources/extensions/shared/interview-ui.js +189 -1
- package/dist/resources/extensions/shared/layout-utils.js +17 -0
- package/dist/resources/extensions/shared/rtk-shared.js +47 -0
- package/dist/resources/extensions/shared/rtk.js +3 -46
- package/dist/resources/skills/create-workflow/SKILL.md +33 -6
- package/dist/rtk-shared.d.ts +10 -0
- package/dist/rtk-shared.js +47 -0
- package/dist/rtk.d.ts +2 -6
- package/dist/rtk.js +3 -48
- package/dist/shared/workspace-types.d.ts +52 -0
- package/dist/shared/workspace-types.js +1 -0
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/update-check.d.ts +10 -0
- package/dist/update-check.js +24 -3
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +6 -6
- 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/react-loadable-manifest.json +1 -1
- 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_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 +2 -2
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- 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 +2 -2
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/dist/web/standalone/.next/server/app/api/git/route.js +1 -1
- package/dist/web/standalone/.next/server/app/api/update/route.js +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +2 -2
- 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 +2 -2
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +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 +6 -6
- package/dist/web/standalone/.next/server/chunks/6897.js +2 -2
- 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/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/.next/static/chunks/2826.02df9631042cc18e.js +9 -0
- package/dist/web/standalone/.next/static/chunks/{webpack-b868033a5834586d.js → webpack-6c7cda3e318eedb6.js} +1 -1
- package/dist/web/standalone/.next/static/css/3e9cdadb4d23b8a4.css +1 -0
- package/dist/welcome-screen.js +48 -24
- package/dist/wizard.js +2 -2
- package/dist/worktree-cli.d.ts +6 -5
- package/dist/worktree-cli.js +23 -7
- package/package.json +3 -3
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-ai/dist/models/capability-patches.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/capability-patches.js +3 -2
- package/packages/pi-ai/dist/models/capability-patches.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.d.ts +68 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.js +68 -0
- package/packages/pi-ai/dist/models/generated/amazon-bedrock.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/anthropic.d.ts +17 -0
- package/packages/pi-ai/dist/models/generated/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/anthropic.js +17 -0
- package/packages/pi-ai/dist/models/generated/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/google-antigravity.d.ts +17 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/google-antigravity.js +17 -0
- package/packages/pi-ai/dist/models/generated/google-antigravity.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/groq.d.ts +0 -153
- package/packages/pi-ai/dist/models/generated/groq.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/groq.js +0 -153
- package/packages/pi-ai/dist/models/generated/groq.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/index.d.ts +136 -153
- package/packages/pi-ai/dist/models/generated/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/openai-codex.d.ts +17 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/openai-codex.js +17 -0
- package/packages/pi-ai/dist/models/generated/openai-codex.js.map +1 -1
- package/packages/pi-ai/dist/models/generated/openrouter.d.ts +17 -0
- package/packages/pi-ai/dist/models/generated/openrouter.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/generated/openrouter.js +17 -0
- package/packages/pi-ai/dist/models/generated/openrouter.js.map +1 -1
- package/packages/pi-ai/dist/models.generated.test.js +17 -0
- package/packages/pi-ai/dist/models.generated.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.d.ts +22 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.js +40 -6
- package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
- package/packages/pi-ai/dist/providers/amazon-bedrock.test.d.ts +2 -0
- package/packages/pi-ai/dist/providers/amazon-bedrock.test.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/amazon-bedrock.test.js +106 -0
- package/packages/pi-ai/dist/providers/amazon-bedrock.test.js.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js +42 -1
- package/packages/pi-ai/dist/providers/anthropic-auth.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts +20 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.js +32 -2
- package/packages/pi-ai/dist/providers/anthropic-shared.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js +12 -1
- package/packages/pi-ai/dist/providers/anthropic-shared.test.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts +11 -0
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +18 -1
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/openai-codex.js +12 -0
- package/packages/pi-ai/dist/utils/oauth/openai-codex.js.map +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-ai/scripts/generate-models.ts +50 -0
- package/packages/pi-ai/src/models/capability-patches.ts +5 -2
- package/packages/pi-ai/src/models/generated/amazon-bedrock.ts +68 -0
- package/packages/pi-ai/src/models/generated/anthropic.ts +17 -0
- package/packages/pi-ai/src/models/generated/google-antigravity.ts +17 -0
- package/packages/pi-ai/src/models/generated/groq.ts +0 -153
- package/packages/pi-ai/src/models/generated/openai-codex.ts +17 -0
- package/packages/pi-ai/src/models/generated/openrouter.ts +17 -0
- package/packages/pi-ai/src/models.generated.test.ts +17 -0
- package/packages/pi-ai/src/providers/amazon-bedrock.test.ts +164 -0
- package/packages/pi-ai/src/providers/amazon-bedrock.ts +41 -7
- package/packages/pi-ai/src/providers/anthropic-auth.test.ts +47 -1
- package/packages/pi-ai/src/providers/anthropic-shared.test.ts +15 -1
- package/packages/pi-ai/src/providers/anthropic-shared.ts +36 -3
- package/packages/pi-ai/src/providers/anthropic.ts +19 -1
- package/packages/pi-ai/src/utils/oauth/openai-codex.ts +15 -0
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js +38 -0
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +14 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.js +34 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.test.js +74 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +4 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js +32 -0
- package/packages/pi-coding-agent/dist/core/model-registry-auth-mode.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +32 -0
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js +2 -2
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js +17 -7
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +48 -34
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts +4 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +83 -33
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts +70 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js +77 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +1 -66
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +1 -75
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +192 -24
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
- package/packages/pi-coding-agent/src/core/agent-session-abort-order.test.ts +56 -0
- package/packages/pi-coding-agent/src/core/auth-storage.test.ts +83 -0
- package/packages/pi-coding-agent/src/core/auth-storage.ts +35 -0
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +4 -1
- package/packages/pi-coding-agent/src/core/model-registry-auth-mode.test.ts +37 -1
- package/packages/pi-coding-agent/src/core/sdk.ts +41 -0
- package/packages/pi-coding-agent/src/core/skill-tool.test.ts +2 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +19 -7
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +53 -31
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +88 -36
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme-schema.ts +83 -0
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +2 -83
- package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +208 -27
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/packages/rpc-client/tsconfig.tsbuildinfo +1 -1
- package/pkg/dist/modes/interactive/theme/theme-schema.d.ts +70 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.js +77 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.js.map +1 -0
- package/pkg/dist/modes/interactive/theme/theme.d.ts +1 -66
- package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.js +1 -75
- package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.d.ts +1 -1
- package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.js +192 -24
- package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
- package/src/resources/extensions/ask-user-questions.ts +24 -6
- package/src/resources/extensions/claude-code-cli/models.ts +9 -0
- package/src/resources/extensions/claude-code-cli/readiness.ts +13 -2
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +94 -4
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +84 -0
- package/src/resources/extensions/gsd/auto/detect-stuck.ts +10 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +1 -0
- package/src/resources/extensions/gsd/auto/loop.ts +109 -3
- package/src/resources/extensions/gsd/auto/phases.ts +94 -60
- package/src/resources/extensions/gsd/auto/resolve.ts +1 -1
- package/src/resources/extensions/gsd/auto/run-unit.ts +11 -1
- package/src/resources/extensions/gsd/auto/session.ts +7 -0
- package/src/resources/extensions/gsd/auto-artifact-paths.ts +20 -0
- package/src/resources/extensions/gsd/auto-dashboard.ts +21 -4
- package/src/resources/extensions/gsd/auto-dispatch.ts +123 -5
- package/src/resources/extensions/gsd/auto-loop.ts +1 -1
- package/src/resources/extensions/gsd/auto-model-selection.ts +13 -2
- package/src/resources/extensions/gsd/auto-post-unit.ts +9 -7
- package/src/resources/extensions/gsd/auto-prompts.ts +178 -38
- package/src/resources/extensions/gsd/auto-recovery.ts +63 -1
- package/src/resources/extensions/gsd/auto-start.ts +8 -6
- package/src/resources/extensions/gsd/auto-verification.ts +3 -3
- package/src/resources/extensions/gsd/auto-worktree.ts +65 -0
- package/src/resources/extensions/gsd/auto.ts +53 -28
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +8 -21
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +22 -4
- package/src/resources/extensions/gsd/bootstrap/query-tools.ts +31 -0
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +22 -0
- package/src/resources/extensions/gsd/commands/catalog.ts +60 -3
- package/src/resources/extensions/gsd/commands/handlers/core.ts +6 -0
- package/src/resources/extensions/gsd/commands/handlers/escalate.ts +216 -0
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +16 -0
- package/src/resources/extensions/gsd/commands/handlers/workflow.ts +279 -29
- package/src/resources/extensions/gsd/commands-cmux.ts +6 -2
- package/src/resources/extensions/gsd/commands-debug.ts +484 -0
- package/src/resources/extensions/gsd/commands-do.ts +1 -0
- package/src/resources/extensions/gsd/commands-handlers.ts +19 -2
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +1 -1
- package/src/resources/extensions/gsd/commands-scan.ts +125 -0
- package/src/resources/extensions/gsd/commands-workflow-templates.ts +129 -2
- package/src/resources/extensions/gsd/custom-workflow-engine.ts +85 -60
- package/src/resources/extensions/gsd/db-writer.ts +3 -0
- package/src/resources/extensions/gsd/debug-session-store.ts +377 -0
- package/src/resources/extensions/gsd/definition-loader.ts +7 -0
- package/src/resources/extensions/gsd/docs/preferences-reference.md +9 -9
- package/src/resources/extensions/gsd/doctor-git-checks.ts +5 -1
- package/src/resources/extensions/gsd/doctor-proactive.ts +4 -1
- package/src/resources/extensions/gsd/doctor-providers.ts +52 -22
- package/src/resources/extensions/gsd/doctor-runtime-checks.ts +23 -4
- package/src/resources/extensions/gsd/doctor-types.ts +1 -0
- package/src/resources/extensions/gsd/doctor.ts +7 -1
- package/src/resources/extensions/gsd/error-classifier.ts +6 -3
- package/src/resources/extensions/gsd/escalation.ts +367 -0
- package/src/resources/extensions/gsd/forensics.ts +25 -29
- package/src/resources/extensions/gsd/git-service.ts +0 -1
- package/src/resources/extensions/gsd/graph.ts +33 -3
- package/src/resources/extensions/gsd/gsd-db.ts +306 -29
- package/src/resources/extensions/gsd/health-widget-core.ts +43 -14
- package/src/resources/extensions/gsd/health-widget.ts +7 -3
- package/src/resources/extensions/gsd/metrics.ts +1 -0
- package/src/resources/extensions/gsd/model-cost-table.ts +3 -1
- package/src/resources/extensions/gsd/model-router.ts +15 -1
- package/src/resources/extensions/gsd/native-git-bridge.ts +134 -6
- package/src/resources/extensions/gsd/notification-widget.ts +25 -43
- package/src/resources/extensions/gsd/notifications.ts +6 -0
- package/src/resources/extensions/gsd/post-execution-checks.ts +37 -14
- package/src/resources/extensions/gsd/pre-execution-checks.ts +98 -8
- package/src/resources/extensions/gsd/preferences-models.ts +1 -0
- package/src/resources/extensions/gsd/preferences-types.ts +10 -2
- package/src/resources/extensions/gsd/preferences-validation.ts +33 -7
- package/src/resources/extensions/gsd/preferences.ts +10 -10
- package/src/resources/extensions/gsd/prompts/debug-diagnose.md +25 -0
- package/src/resources/extensions/gsd/prompts/debug-session-manager.md +80 -0
- package/src/resources/extensions/gsd/prompts/execute-task.md +12 -0
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +12 -0
- package/src/resources/extensions/gsd/prompts/refine-slice.md +69 -0
- package/src/resources/extensions/gsd/prompts/scan.md +79 -0
- package/src/resources/extensions/gsd/prompts/workflow-oneshot.md +26 -0
- package/src/resources/extensions/gsd/run-manager.ts +53 -19
- package/src/resources/extensions/gsd/state.ts +50 -2
- package/src/resources/extensions/gsd/templates/PREFERENCES.md +7 -7
- package/src/resources/extensions/gsd/tests/agent-end-retry.test.ts +1 -34
- package/src/resources/extensions/gsd/tests/artifact-corruption-2630.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +45 -31
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +123 -1
- package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/autocomplete-regressions-1675.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/commands-do.test.ts +48 -0
- package/src/resources/extensions/gsd/tests/commands-scan.test.ts +351 -0
- package/src/resources/extensions/gsd/tests/commands-workflow-custom.test.ts +8 -6
- package/src/resources/extensions/gsd/tests/complete-slice.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/custom-workflow-engine.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/debug-command-handler.test.ts +905 -0
- package/src/resources/extensions/gsd/tests/debug-command-lifecycle.integration.test.ts +1229 -0
- package/src/resources/extensions/gsd/tests/debug-session-store.test.ts +565 -0
- package/src/resources/extensions/gsd/tests/discuss-milestone-structured-questions.test.ts +64 -0
- package/src/resources/extensions/gsd/tests/dispatch-complete-milestone-guard.test.ts +67 -0
- package/src/resources/extensions/gsd/tests/doctor-providers.test.ts +62 -18
- package/src/resources/extensions/gsd/tests/enhanced-verification-integration.test.ts +5 -0
- package/src/resources/extensions/gsd/tests/escalation.test.ts +818 -0
- package/src/resources/extensions/gsd/tests/finalize-timeout-guard.test.ts +29 -12
- package/src/resources/extensions/gsd/tests/flat-rate-routing-guard.test.ts +106 -0
- package/src/resources/extensions/gsd/tests/forensics-hook-key-parse.test.ts +74 -0
- package/src/resources/extensions/gsd/tests/graph-operations.test.ts +0 -4
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +44 -1
- package/src/resources/extensions/gsd/tests/health-widget.test.ts +8 -2
- package/src/resources/extensions/gsd/tests/integration/doctor-git.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-proactive.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/integration/doctor-runtime.test.ts +68 -1
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +109 -11
- package/src/resources/extensions/gsd/tests/integration/idle-recovery.test.ts +51 -0
- package/src/resources/extensions/gsd/tests/integration/test-isolation.ts +53 -0
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +171 -1
- package/src/resources/extensions/gsd/tests/md-importer.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/milestone-status-tool.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/model-cost-table.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/model-router.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/model-unittype-mapping.test.ts +59 -0
- package/src/resources/extensions/gsd/tests/notification-widget.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/plan-slice.test.ts +17 -0
- package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +105 -1
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +275 -6
- package/src/resources/extensions/gsd/tests/preferences.test.ts +69 -1
- package/src/resources/extensions/gsd/tests/progressive-planning.test.ts +539 -0
- package/src/resources/extensions/gsd/tests/projection-regression.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/prompt-budget-enforcement.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +24 -0
- package/src/resources/extensions/gsd/tests/prompt-db.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/register-hooks-depth-verification.test.ts +67 -0
- package/src/resources/extensions/gsd/tests/remote-notification-from-desktop.test.ts +107 -0
- package/src/resources/extensions/gsd/tests/requirements.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +153 -0
- package/src/resources/extensions/gsd/tests/slice-context-injection.test.ts +16 -4
- package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/stuck-detection-coverage.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/summary-render-parity.test.ts +5 -0
- package/src/resources/extensions/gsd/tests/uok-contracts.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/uok-flags.test.ts +31 -1
- package/src/resources/extensions/gsd/tests/uok-kernel-path.test.ts +166 -0
- package/src/resources/extensions/gsd/tests/workflow-install.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/workflow-logger-wiring.test.ts +15 -6
- package/src/resources/extensions/gsd/tests/workflow-mcp.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/workflow-plugins.test.ts +310 -0
- package/src/resources/extensions/gsd/tests/workflow-projections.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/workflow-templates.test.ts +8 -2
- package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +77 -2
- package/src/resources/extensions/gsd/tools/complete-task.ts +87 -0
- package/src/resources/extensions/gsd/tools/plan-milestone.ts +42 -8
- package/src/resources/extensions/gsd/tools/plan-slice.ts +6 -1
- package/src/resources/extensions/gsd/types.ts +62 -0
- package/src/resources/extensions/gsd/unit-runtime.ts +1 -0
- package/src/resources/extensions/gsd/uok/contracts.ts +2 -1
- package/src/resources/extensions/gsd/uok/flags.ts +7 -7
- package/src/resources/extensions/gsd/uok/kernel.ts +16 -4
- package/src/resources/extensions/gsd/workflow-dispatch.ts +106 -0
- package/src/resources/extensions/gsd/workflow-install.ts +423 -0
- package/src/resources/extensions/gsd/workflow-manifest.ts +8 -0
- package/src/resources/extensions/gsd/workflow-mcp.ts +1 -6
- package/src/resources/extensions/gsd/workflow-plugins.ts +403 -0
- package/src/resources/extensions/gsd/workflow-templates/accessibility-audit.md +88 -0
- package/src/resources/extensions/gsd/workflow-templates/api-breaking-change.md +117 -0
- package/src/resources/extensions/gsd/workflow-templates/bugfix.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/changelog-gen.md +82 -0
- package/src/resources/extensions/gsd/workflow-templates/ci-bootstrap.md +144 -0
- package/src/resources/extensions/gsd/workflow-templates/dead-code.md +81 -0
- package/src/resources/extensions/gsd/workflow-templates/dep-upgrade.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/docs-sync.yaml +76 -0
- package/src/resources/extensions/gsd/workflow-templates/env-audit.yaml +88 -0
- package/src/resources/extensions/gsd/workflow-templates/full-project.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/hotfix.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/issue-triage.md +84 -0
- package/src/resources/extensions/gsd/workflow-templates/observability-setup.md +133 -0
- package/src/resources/extensions/gsd/workflow-templates/onboarding-check.md +74 -0
- package/src/resources/extensions/gsd/workflow-templates/performance-audit.md +125 -0
- package/src/resources/extensions/gsd/workflow-templates/pr-review.md +67 -0
- package/src/resources/extensions/gsd/workflow-templates/pr-triage.md +83 -0
- package/src/resources/extensions/gsd/workflow-templates/refactor.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/registry.json +184 -0
- package/src/resources/extensions/gsd/workflow-templates/release.md +118 -0
- package/src/resources/extensions/gsd/workflow-templates/rename-symbol.yaml +99 -0
- package/src/resources/extensions/gsd/workflow-templates/security-audit.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/small-feature.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/spike.md +1 -0
- package/src/resources/extensions/gsd/workflow-templates/test-backfill.yaml +73 -0
- package/src/resources/extensions/gsd/workflow-templates.ts +7 -0
- package/src/resources/extensions/gsd/workspace-index.ts +9 -4
- package/src/resources/extensions/gsd/worktree-resolver.ts +47 -1
- package/src/resources/extensions/remote-questions/commands.ts +480 -0
- package/src/resources/extensions/remote-questions/manager.ts +49 -4
- package/src/resources/extensions/remote-questions/telegram-adapter.ts +86 -4
- package/src/resources/extensions/remote-questions/tests/command-polling.test.ts +246 -0
- package/src/resources/extensions/remote-questions/tests/remote-answer-normalization.test.ts +92 -0
- package/src/resources/extensions/remote-questions/tests/telegram-commands.test.ts +267 -0
- package/src/resources/extensions/shared/interview-ui.ts +195 -1
- package/src/resources/extensions/shared/layout-utils.ts +26 -0
- package/src/resources/extensions/shared/rtk-shared.ts +58 -0
- package/src/resources/extensions/shared/rtk.ts +12 -52
- package/src/resources/extensions/shared/tests/interview-preview.test.ts +177 -0
- package/src/resources/extensions/shared/tests/preview-layout.test.ts +120 -0
- package/src/resources/skills/create-workflow/SKILL.md +33 -6
- package/dist/web/standalone/.next/static/chunks/2826.dd3dc8bbd3025fa5.js +0 -9
- package/dist/web/standalone/.next/static/css/f6e8833d46e738d8.css +0 -1
- package/packages/native/dist/ps/types.d.ts +0 -5
- package/packages/native/dist/ps/types.js +0 -2
- package/packages/native/src/ps/types.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/LICENSE +0 -201
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/README.md +0 -9
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-cjs/index.js +0 -762
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js +0 -19
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/constants.js +0 -1
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +0 -9
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/index.js +0 -3
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +0 -230
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +0 -87
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +0 -32
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +0 -169
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/readable.mock.js +0 -21
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/server.mock.js +0 -88
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js +0 -36
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js +0 -21
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js +0 -22
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +0 -23
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +0 -8
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js +0 -41
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/stream-collector/readable.mock.js +0 -21
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/timing.js +0 -4
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +0 -63
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/build-abort-error.d.ts +0 -10
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/constants.d.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/get-transformed-headers.d.ts +0 -4
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +0 -3
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +0 -46
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +0 -24
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +0 -63
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/readable.mock.d.ts +0 -13
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/server.mock.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +0 -2
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-request-timeout.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +0 -2
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/index.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/stream-collector/readable.mock.d.ts +0 -13
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/timing.d.ts +0 -8
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/build-abort-error.d.ts +0 -10
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/constants.d.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts +0 -4
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/index.d.ts +0 -3
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +0 -46
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +0 -24
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +0 -63
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/readable.mock.d.ts +0 -13
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/server.mock.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +0 -2
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-request-timeout.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +0 -2
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/collector.d.ts +0 -5
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/index.d.ts +0 -6
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/readable.mock.d.ts +0 -13
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/timing.d.ts +0 -8
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +0 -12
- package/packages/pi-ai/node_modules/@smithy/node-http-handler/package.json +0 -68
- package/packages/pi-ai/oauth.d.ts +0 -1
- package/packages/pi-ai/oauth.js +0 -1
- /package/dist/web/standalone/.next/static/{j7IBD35UgrL2b298GLK3V → jaWw1Jh0TYayjbfOrFe8D}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{j7IBD35UgrL2b298GLK3V → jaWw1Jh0TYayjbfOrFe8D}/_ssgManifest.js +0 -0
|
@@ -38,11 +38,52 @@ import { inlineGraphSubgraph } from "./graph-context.js";
|
|
|
38
38
|
|
|
39
39
|
// ─── Preamble Cap ─────────────────────────────────────────────────────────────
|
|
40
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Historical static ceiling for the preamble cap. Kept as an upper bound even
|
|
43
|
+
* after context-window-aware sizing so large-window users don't suddenly see
|
|
44
|
+
* 10× looser caps than before. Small-window users get a tighter cap derived
|
|
45
|
+
* from their configured executor window.
|
|
46
|
+
*/
|
|
41
47
|
const MAX_PREAMBLE_CHARS = 30_000;
|
|
42
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Resolve prompt budgets from the configured executor context window.
|
|
51
|
+
*
|
|
52
|
+
* The prompt builders here don't have access to the runtime model registry
|
|
53
|
+
* (they're called from many non-ctx sites), so `resolveExecutorContextWindow`
|
|
54
|
+
* is fed the user-configurable `context_window_override` preference as the
|
|
55
|
+
* `sessionContextWindow` fallback. That preference exists specifically to
|
|
56
|
+
* cover small-window local models (e.g. 32K lemonade/llama.cpp servers) whose
|
|
57
|
+
* n_ctx is not discoverable through the model registry. Issue #4435.
|
|
58
|
+
*/
|
|
59
|
+
function resolvePromptBudgets(): ReturnType<typeof computeBudgets> {
|
|
60
|
+
try {
|
|
61
|
+
const prefs = loadEffectiveGSDPreferences();
|
|
62
|
+
const sessionWindow = prefs?.preferences.context_window_override;
|
|
63
|
+
const windowTokens = resolveExecutorContextWindow(undefined, prefs?.preferences, sessionWindow);
|
|
64
|
+
return computeBudgets(windowTokens);
|
|
65
|
+
} catch (e) {
|
|
66
|
+
logWarning("prompt", `resolvePromptBudgets failed: ${(e as Error).message}`);
|
|
67
|
+
return computeBudgets(200_000);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Character budget for dependency/prior slice summaries injected into dispatch
|
|
73
|
+
* prompts. Scales with the executor's configured context window (issue #4435).
|
|
74
|
+
*/
|
|
75
|
+
function resolveSummaryBudgetChars(): number {
|
|
76
|
+
return resolvePromptBudgets().summaryBudgetChars;
|
|
77
|
+
}
|
|
78
|
+
|
|
43
79
|
function capPreamble(preamble: string): string {
|
|
44
|
-
|
|
45
|
-
|
|
80
|
+
// Cap inlined context at min(historical 30K ceiling, scaled inline budget).
|
|
81
|
+
// The ceiling preserves pre-fix behavior for large-window users; the scaled
|
|
82
|
+
// budget tightens the cap for small-window users whose true safe limit is
|
|
83
|
+
// below 30K. `computeBudgets` allocates 40% of total chars to inline context.
|
|
84
|
+
const budget = Math.min(MAX_PREAMBLE_CHARS, resolvePromptBudgets().inlineContextBudgetChars);
|
|
85
|
+
if (preamble.length <= budget) return preamble;
|
|
86
|
+
return truncateAtSectionBoundary(preamble, budget).content;
|
|
46
87
|
}
|
|
47
88
|
|
|
48
89
|
// ─── Executor Constraints ─────────────────────────────────────────────────────
|
|
@@ -997,14 +1038,19 @@ export async function checkNeedsRunUat(
|
|
|
997
1038
|
* as a seed when present. The discussion agent interviews the user, writes
|
|
998
1039
|
* a full CONTEXT.md, and the phase transitions to pre-planning automatically.
|
|
999
1040
|
*/
|
|
1000
|
-
export async function buildDiscussMilestonePrompt(
|
|
1041
|
+
export async function buildDiscussMilestonePrompt(
|
|
1042
|
+
mid: string,
|
|
1043
|
+
midTitle: string,
|
|
1044
|
+
base: string,
|
|
1045
|
+
structuredQuestionsAvailable = "false",
|
|
1046
|
+
): Promise<string> {
|
|
1001
1047
|
const discussTemplates = inlineTemplate("context", "Context");
|
|
1002
1048
|
|
|
1003
1049
|
const basePrompt = loadPrompt("guided-discuss-milestone", {
|
|
1004
1050
|
milestoneId: mid,
|
|
1005
1051
|
milestoneTitle: midTitle,
|
|
1006
1052
|
inlinedTemplates: discussTemplates,
|
|
1007
|
-
structuredQuestionsAvailable
|
|
1053
|
+
structuredQuestionsAvailable,
|
|
1008
1054
|
commitInstruction: "Do not commit planning artifacts — .gsd/ is managed externally.",
|
|
1009
1055
|
fastPathInstruction: "",
|
|
1010
1056
|
});
|
|
@@ -1182,7 +1228,7 @@ export async function buildResearchSlicePrompt(
|
|
|
1182
1228
|
|
|
1183
1229
|
inlined.push(inlineTemplate("research", "Research"));
|
|
1184
1230
|
|
|
1185
|
-
const depContent = await inlineDependencySummaries(mid, sid, base);
|
|
1231
|
+
const depContent = await inlineDependencySummaries(mid, sid, base, resolveSummaryBudgetChars());
|
|
1186
1232
|
const activeOverrides = await loadActiveOverrides(base);
|
|
1187
1233
|
const overridesInline = formatOverridesSection(activeOverrides);
|
|
1188
1234
|
if (overridesInline) inlined.unshift(overridesInline);
|
|
@@ -1211,10 +1257,28 @@ export async function buildResearchSlicePrompt(
|
|
|
1211
1257
|
});
|
|
1212
1258
|
}
|
|
1213
1259
|
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1260
|
+
/**
|
|
1261
|
+
* Shared assembly for plan-slice and refine-slice prompts. Both builders need
|
|
1262
|
+
* the same inlined context (roadmap excerpt, slice context, research, decisions,
|
|
1263
|
+
* requirements, knowledge, graph subgraph, templates, dependency summaries,
|
|
1264
|
+
* overrides). Extracted to prevent drift between the two sites.
|
|
1265
|
+
*
|
|
1266
|
+
* `prependBlocks` are pushed onto the start of the inlined array BEFORE any
|
|
1267
|
+
* shared content, so callers can add unit-specific headers (e.g., the refine
|
|
1268
|
+
* sketch-scope constraint).
|
|
1269
|
+
*/
|
|
1270
|
+
async function renderSlicePrompt(options: {
|
|
1271
|
+
mid: string;
|
|
1272
|
+
sid: string;
|
|
1273
|
+
sTitle: string;
|
|
1274
|
+
base: string;
|
|
1275
|
+
level: InlineLevel;
|
|
1276
|
+
promptTemplate: "plan-slice" | "refine-slice";
|
|
1277
|
+
prependBlocks?: string[];
|
|
1278
|
+
extraVars?: Record<string, string>;
|
|
1279
|
+
}): Promise<string> {
|
|
1280
|
+
const { mid, sid, sTitle, base, level, promptTemplate, prependBlocks = [], extraVars = {} } = options;
|
|
1281
|
+
|
|
1218
1282
|
const roadmapPath = resolveMilestoneFile(base, mid, "ROADMAP");
|
|
1219
1283
|
const roadmapRel = relMilestoneFile(base, mid, "ROADMAP");
|
|
1220
1284
|
const researchPath = resolveSliceFile(base, mid, sid, "RESEARCH");
|
|
@@ -1222,18 +1286,17 @@ export async function buildPlanSlicePrompt(
|
|
|
1222
1286
|
const sliceContextPath = resolveSliceFile(base, mid, sid, "CONTEXT");
|
|
1223
1287
|
const sliceContextRel = relSliceFile(base, mid, sid, "CONTEXT");
|
|
1224
1288
|
|
|
1225
|
-
const inlined: string[] = [];
|
|
1289
|
+
const inlined: string[] = [...prependBlocks];
|
|
1226
1290
|
|
|
1227
|
-
//
|
|
1291
|
+
// Phase handoff anchor from research phase (if available)
|
|
1228
1292
|
const researchSliceAnchor = readPhaseAnchor(base, mid, "research-slice");
|
|
1229
1293
|
if (researchSliceAnchor) inlined.push(formatAnchorForPrompt(researchSliceAnchor));
|
|
1230
1294
|
|
|
1231
|
-
//
|
|
1232
|
-
const
|
|
1233
|
-
if (
|
|
1234
|
-
inlined.push(
|
|
1295
|
+
// Roadmap excerpt with full-roadmap fallback
|
|
1296
|
+
const roadmapExcerpt = await inlineRoadmapExcerpt(base, mid, sid);
|
|
1297
|
+
if (roadmapExcerpt) {
|
|
1298
|
+
inlined.push(roadmapExcerpt);
|
|
1235
1299
|
} else {
|
|
1236
|
-
// Fall back to full roadmap if excerpt fails
|
|
1237
1300
|
inlined.push(await inlineFile(roadmapPath, roadmapRel, "Milestone Roadmap"));
|
|
1238
1301
|
}
|
|
1239
1302
|
|
|
@@ -1241,42 +1304,36 @@ export async function buildPlanSlicePrompt(
|
|
|
1241
1304
|
if (sliceCtxInline) inlined.push(sliceCtxInline);
|
|
1242
1305
|
const researchInline = await inlineFileOptional(researchPath, researchRel, "Slice Research");
|
|
1243
1306
|
if (researchInline) inlined.push(researchInline);
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
const
|
|
1247
|
-
const decisionsInline = await inlineDecisionsFromDb(base, mid,
|
|
1307
|
+
|
|
1308
|
+
if (level !== "minimal") {
|
|
1309
|
+
const derivedScope = deriveSliceScope(sTitle);
|
|
1310
|
+
const decisionsInline = await inlineDecisionsFromDb(base, mid, derivedScope, level);
|
|
1248
1311
|
if (decisionsInline) inlined.push(decisionsInline);
|
|
1249
|
-
const requirementsInline = await inlineRequirementsFromDb(base, mid, sid,
|
|
1312
|
+
const requirementsInline = await inlineRequirementsFromDb(base, mid, sid, level);
|
|
1250
1313
|
if (requirementsInline) inlined.push(requirementsInline);
|
|
1251
1314
|
}
|
|
1252
1315
|
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
const knowledgeInlinePS = await inlineKnowledgeScoped(base, keywordsPS);
|
|
1256
|
-
if (knowledgeInlinePS) inlined.push(knowledgeInlinePS);
|
|
1316
|
+
const knowledgeInline = await inlineKnowledgeScoped(base, extractKeywords(sTitle));
|
|
1317
|
+
if (knowledgeInline) inlined.push(knowledgeInline);
|
|
1257
1318
|
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
if (graphBlockPS) inlined.push(graphBlockPS);
|
|
1319
|
+
const graphBlock = await inlineGraphSubgraph(base, `${sid} ${sTitle}`, { budget: 3000 });
|
|
1320
|
+
if (graphBlock) inlined.push(graphBlock);
|
|
1261
1321
|
|
|
1262
1322
|
inlined.push(inlineTemplate("plan", "Slice Plan"));
|
|
1263
|
-
if (
|
|
1323
|
+
if (level === "full") {
|
|
1264
1324
|
inlined.push(inlineTemplate("task-plan", "Task Plan"));
|
|
1265
1325
|
}
|
|
1266
1326
|
|
|
1267
|
-
const depContent = await inlineDependencySummaries(mid, sid, base);
|
|
1268
|
-
const
|
|
1269
|
-
|
|
1270
|
-
if (planOverridesInline) inlined.unshift(planOverridesInline);
|
|
1327
|
+
const depContent = await inlineDependencySummaries(mid, sid, base, resolveSummaryBudgetChars());
|
|
1328
|
+
const overridesInline = formatOverridesSection(await loadActiveOverrides(base));
|
|
1329
|
+
if (overridesInline) inlined.unshift(overridesInline);
|
|
1271
1330
|
|
|
1272
1331
|
const inlinedContext = capPreamble(`## Inlined Context (preloaded — do not re-read these files)\n\n${inlined.join("\n\n---\n\n")}`);
|
|
1273
|
-
|
|
1274
|
-
// Build executor context constraints from the budget engine
|
|
1275
1332
|
const executorContextConstraints = formatExecutorConstraints();
|
|
1276
|
-
|
|
1277
1333
|
const outputRelPath = relSliceFile(base, mid, sid, "PLAN");
|
|
1278
1334
|
const commitInstruction = "Do not commit — .gsd/ planning docs are managed externally and not tracked in git.";
|
|
1279
|
-
|
|
1335
|
+
|
|
1336
|
+
return loadPrompt(promptTemplate, {
|
|
1280
1337
|
workingDirectory: base,
|
|
1281
1338
|
milestoneId: mid, sliceId: sid, sliceTitle: sTitle,
|
|
1282
1339
|
slicePath: relSlicePath(base, mid, sid),
|
|
@@ -1295,6 +1352,68 @@ export async function buildPlanSlicePrompt(
|
|
|
1295
1352
|
sliceTitle: sTitle,
|
|
1296
1353
|
extraContext: [inlinedContext, depContent],
|
|
1297
1354
|
}),
|
|
1355
|
+
...extraVars,
|
|
1356
|
+
});
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
export async function buildPlanSlicePrompt(
|
|
1360
|
+
mid: string, _midTitle: string, sid: string, sTitle: string, base: string, level?: InlineLevel,
|
|
1361
|
+
options?: { softScopeHint?: string },
|
|
1362
|
+
): Promise<string> {
|
|
1363
|
+
const prependBlocks: string[] = [];
|
|
1364
|
+
// ADR-011: when the refining-phase dispatch rule gracefully downgrades to
|
|
1365
|
+
// plan-slice (progressive_planning was toggled off mid-milestone), it
|
|
1366
|
+
// forwards the stored sketch_scope as a SOFT hint — context, not a hard
|
|
1367
|
+
// constraint. The planner is free to expand beyond it.
|
|
1368
|
+
if (options?.softScopeHint && options.softScopeHint.trim().length > 0) {
|
|
1369
|
+
prependBlocks.push(
|
|
1370
|
+
`## Prior Sketch Scope (soft hint — non-binding)\n\n${options.softScopeHint.trim()}\n\n` +
|
|
1371
|
+
`This scope was captured during an earlier progressive-planning pass that was later disabled. Treat it as context only — you may plan beyond it if the work genuinely requires more scope. Do NOT treat this as a hard boundary.`,
|
|
1372
|
+
);
|
|
1373
|
+
}
|
|
1374
|
+
return renderSlicePrompt({
|
|
1375
|
+
mid, sid, sTitle, base,
|
|
1376
|
+
level: level ?? resolveInlineLevel(),
|
|
1377
|
+
promptTemplate: "plan-slice",
|
|
1378
|
+
prependBlocks,
|
|
1379
|
+
});
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
/**
|
|
1383
|
+
* ADR-011 refine-slice: expand a sketch into a full plan using the current
|
|
1384
|
+
* codebase state and prior slice summary. Mechanically similar to plan-slice
|
|
1385
|
+
* but framed as a *transformation* (sketch → full plan) rather than a
|
|
1386
|
+
* blank-sheet planning pass. Reuses inlineDependencySummaries for prior
|
|
1387
|
+
* slice SUMMARY and inlines the stored sketch_scope as a hard constraint.
|
|
1388
|
+
*/
|
|
1389
|
+
export async function buildRefineSlicePrompt(
|
|
1390
|
+
mid: string, _midTitle: string, sid: string, sTitle: string, base: string, level?: InlineLevel,
|
|
1391
|
+
): Promise<string> {
|
|
1392
|
+
// Pull the stored sketch scope from the DB — the hard constraint we plan within.
|
|
1393
|
+
let sketchScope = "";
|
|
1394
|
+
try {
|
|
1395
|
+
const { isDbAvailable, getSlice } = await import("./gsd-db.js");
|
|
1396
|
+
if (isDbAvailable()) {
|
|
1397
|
+
sketchScope = getSlice(mid, sid)?.sketch_scope ?? "";
|
|
1398
|
+
}
|
|
1399
|
+
} catch {
|
|
1400
|
+
sketchScope = "";
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
const prependBlocks: string[] = [];
|
|
1404
|
+
if (sketchScope.trim().length > 0) {
|
|
1405
|
+
prependBlocks.push(
|
|
1406
|
+
`## Sketch Scope (hard constraint)\n\n${sketchScope.trim()}\n\n` +
|
|
1407
|
+
`Treat this as the authoritative boundary for the slice. Do not plan work outside this scope; if the scope is too narrow, surface it as a deviation rather than expanding silently.`,
|
|
1408
|
+
);
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
return renderSlicePrompt({
|
|
1412
|
+
mid, sid, sTitle, base,
|
|
1413
|
+
level: level ?? resolveInlineLevel(),
|
|
1414
|
+
promptTemplate: "refine-slice",
|
|
1415
|
+
prependBlocks,
|
|
1416
|
+
extraVars: { sketchScope },
|
|
1298
1417
|
});
|
|
1299
1418
|
}
|
|
1300
1419
|
|
|
@@ -1412,7 +1531,28 @@ export async function buildExecuteTaskPrompt(
|
|
|
1412
1531
|
? `### Runtime Context\nSource: \`.gsd/RUNTIME.md\`\n\n${runtimeContent.trim()}`
|
|
1413
1532
|
: "";
|
|
1414
1533
|
|
|
1415
|
-
|
|
1534
|
+
let phaseAnchorSection = planAnchor ? formatAnchorForPrompt(planAnchor) : "";
|
|
1535
|
+
|
|
1536
|
+
// ADR-011 Phase 2: inject any resolved-but-unapplied escalation override
|
|
1537
|
+
// into this task's prompt. Claim is atomic via DB UPDATE WHERE IS NULL, so
|
|
1538
|
+
// if a parallel build already injected it, we skip. Feature-gated by
|
|
1539
|
+
// phases.mid_execution_escalation. Prepended to phaseAnchorSection so it
|
|
1540
|
+
// appears near the top of the prompt above planning anchors.
|
|
1541
|
+
if (prefs?.preferences?.phases?.mid_execution_escalation === true) {
|
|
1542
|
+
try {
|
|
1543
|
+
const { claimOverrideForInjection } = await import("./escalation.js");
|
|
1544
|
+
const claimed = claimOverrideForInjection(base, mid, sid);
|
|
1545
|
+
if (claimed) {
|
|
1546
|
+
const block = claimed.injectionBlock + "\n\n---\n\n";
|
|
1547
|
+
phaseAnchorSection = phaseAnchorSection
|
|
1548
|
+
? `${block}${phaseAnchorSection}`
|
|
1549
|
+
: block;
|
|
1550
|
+
}
|
|
1551
|
+
} catch (escalationErr) {
|
|
1552
|
+
// Escalation module unavailable or threw — log and proceed.
|
|
1553
|
+
logWarning("prompt", `escalation override injection failed: ${(escalationErr as Error).message}`);
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1416
1556
|
|
|
1417
1557
|
// Task-scoped gates owned by execute-task (Q5/Q6/Q7). Pull only the
|
|
1418
1558
|
// gates that plan-slice actually seeded for this task — tasks with no
|
|
@@ -261,6 +261,45 @@ export function verifyExpectedArtifact(
|
|
|
261
261
|
return true;
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
+
// #4414: research-slice parallel-research sentinel. The unitId
|
|
265
|
+
// `{mid}/parallel-research` is not a real slice — it triggers a single agent
|
|
266
|
+
// that fans out research across multiple slices. Verify success by checking
|
|
267
|
+
// that every slice which was "research-ready" in the roadmap now has a
|
|
268
|
+
// RESEARCH file. Without this, resolveExpectedArtifactPath returns null and
|
|
269
|
+
// the retry/escalation machinery silently re-dispatches forever.
|
|
270
|
+
//
|
|
271
|
+
// NOTE: this predicate mirrors the dispatch rule at
|
|
272
|
+
// auto-dispatch.ts parallel-research-slices — keep the two in sync.
|
|
273
|
+
if (unitType === "research-slice" && unitId.endsWith("/parallel-research")) {
|
|
274
|
+
const { milestone: mid } = parseUnitId(unitId);
|
|
275
|
+
if (!mid) return false;
|
|
276
|
+
const roadmapFile = resolveMilestoneFile(base, mid, "ROADMAP");
|
|
277
|
+
if (!roadmapFile || !existsSync(roadmapFile)) {
|
|
278
|
+
logWarning("recovery", `verify-fail ${unitType} ${unitId}: roadmap missing`);
|
|
279
|
+
return false;
|
|
280
|
+
}
|
|
281
|
+
try {
|
|
282
|
+
const roadmap = parseLegacyRoadmap(readFileSync(roadmapFile, "utf-8"));
|
|
283
|
+
const milestoneResearchFile = resolveMilestoneFile(base, mid, "RESEARCH");
|
|
284
|
+
for (const slice of roadmap.slices) {
|
|
285
|
+
if (slice.done) continue;
|
|
286
|
+
if (milestoneResearchFile && slice.id === "S01") continue;
|
|
287
|
+
const depsComplete = (slice.depends ?? []).every((depId) =>
|
|
288
|
+
!!resolveSliceFile(base, mid, depId, "SUMMARY"),
|
|
289
|
+
);
|
|
290
|
+
if (!depsComplete) continue;
|
|
291
|
+
if (!resolveSliceFile(base, mid, slice.id, "RESEARCH")) {
|
|
292
|
+
logWarning("recovery", `verify-fail ${unitType} ${unitId}: slice ${slice.id} missing RESEARCH`);
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
return true;
|
|
297
|
+
} catch (err) {
|
|
298
|
+
logWarning("recovery", `parallel-research verification failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
299
|
+
return false;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
264
303
|
const absPath = resolveExpectedArtifactPath(unitType, unitId, base);
|
|
265
304
|
// For unit types with no verifiable artifact (null path), the parent directory
|
|
266
305
|
// is missing on disk — treat as stale completion state so the key gets evicted (#313).
|
|
@@ -455,6 +494,14 @@ export function writeBlockerPlaceholder(
|
|
|
455
494
|
].join("\n");
|
|
456
495
|
writeFileSync(absPath, content, "utf-8");
|
|
457
496
|
|
|
497
|
+
// #4414: Clear caches so subsequent dispatch guards (e.g.
|
|
498
|
+
// resolveMilestoneFile) see the placeholder file. Without this, the
|
|
499
|
+
// cached directory listing is stale and the dispatch rule re-fires,
|
|
500
|
+
// producing an infinite loop despite the placeholder being on disk.
|
|
501
|
+
// Matches the pattern used in verifyExpectedArtifact above.
|
|
502
|
+
clearPathCache();
|
|
503
|
+
clearParseCache();
|
|
504
|
+
|
|
458
505
|
// Mark the task/slice as complete in the DB so verifyExpectedArtifact passes.
|
|
459
506
|
// Without this, the DB status stays "pending" and the dispatch loop
|
|
460
507
|
// re-derives the same unit indefinitely (#2531, #2653).
|
|
@@ -462,7 +509,22 @@ export function writeBlockerPlaceholder(
|
|
|
462
509
|
const { milestone: mid, slice: sid, task: tid } = parseUnitId(unitId);
|
|
463
510
|
const ts = new Date().toISOString();
|
|
464
511
|
if (unitType === "execute-task" && mid && sid && tid) {
|
|
465
|
-
try {
|
|
512
|
+
try {
|
|
513
|
+
updateTaskStatus(mid, sid, tid, "complete", ts);
|
|
514
|
+
const planPath = resolveSliceFile(base, mid, sid, "PLAN");
|
|
515
|
+
if (planPath && existsSync(planPath)) {
|
|
516
|
+
const planContent = readFileSync(planPath, "utf-8");
|
|
517
|
+
const updatedPlan = planContent.replace(
|
|
518
|
+
new RegExp(`^(\\s*-\\s+)\\[ \\]\\s+\\*\\*${tid}:`, "m"),
|
|
519
|
+
`$1[x] **${tid}:`,
|
|
520
|
+
);
|
|
521
|
+
if (updatedPlan !== planContent) {
|
|
522
|
+
atomicWriteSync(planPath, updatedPlan);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
} catch (e) {
|
|
526
|
+
logWarning("recovery", `updateTaskStatus failed during context exhaustion: ${e instanceof Error ? e.message : String(e)}`);
|
|
527
|
+
}
|
|
466
528
|
// Append event so worktree reconciliation can replay this recovery completion
|
|
467
529
|
try { appendEvent(base, { cmd: "complete-task", params: { milestoneId: mid, sliceId: sid, taskId: tid }, ts, actor: "system", trigger_reason: "blocker-placeholder-recovery" }); } catch (e) { logWarning("recovery", `appendEvent failed for task recovery: ${e instanceof Error ? e.message : String(e)}`); }
|
|
468
530
|
}
|
|
@@ -464,11 +464,12 @@ export async function bootstrapAutoSession(
|
|
|
464
464
|
// Detect survivor milestone branches in both pre-planning and complete phases.
|
|
465
465
|
// In phase=complete, the milestone artifacts exist but finalization (merge,
|
|
466
466
|
// worktree cleanup) was never run — the survivor branch must be merged.
|
|
467
|
+
// Applies to both worktree and branch isolation modes.
|
|
467
468
|
let hasSurvivorBranch = false;
|
|
468
469
|
if (
|
|
469
470
|
state.activeMilestone &&
|
|
470
471
|
(state.phase === "pre-planning" || state.phase === "complete") &&
|
|
471
|
-
|
|
472
|
+
getIsolationMode() !== "none" &&
|
|
472
473
|
!detectWorktreeName(base) &&
|
|
473
474
|
!base.includes(`${pathSep}.gsd${pathSep}worktrees${pathSep}`)
|
|
474
475
|
) {
|
|
@@ -711,7 +712,7 @@ export async function bootstrapAutoSession(
|
|
|
711
712
|
|
|
712
713
|
if (
|
|
713
714
|
s.currentMilestoneId &&
|
|
714
|
-
|
|
715
|
+
getIsolationMode() !== "none" &&
|
|
715
716
|
!detectWorktreeName(base) &&
|
|
716
717
|
!isUnderGsdWorktrees(base)
|
|
717
718
|
) {
|
|
@@ -837,10 +838,11 @@ export async function bootstrapAutoSession(
|
|
|
837
838
|
const bannerPrefs = loadEffectiveGSDPreferences()?.preferences;
|
|
838
839
|
const effectiveProvider = s.autoModeStartModel?.provider ?? ctx.model?.provider;
|
|
839
840
|
const effectivelyEnabled = routingConfig.enabled
|
|
840
|
-
&&
|
|
841
|
-
effectiveProvider
|
|
842
|
-
|
|
843
|
-
|
|
841
|
+
&& (routingConfig.allow_flat_rate_providers
|
|
842
|
+
|| !(effectiveProvider && isFlatRateProvider(
|
|
843
|
+
effectiveProvider,
|
|
844
|
+
buildFlatRateContext(effectiveProvider, ctx, bannerPrefs),
|
|
845
|
+
)));
|
|
844
846
|
|
|
845
847
|
// The actual ceiling may come from tier_models.heavy, not the start model.
|
|
846
848
|
const effectiveCeiling = (routingConfig.enabled && routingConfig.tier_models?.heavy)
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* dependency audits, handles auto-fix retry logic, and writes
|
|
6
6
|
* verification evidence JSON.
|
|
7
7
|
*
|
|
8
|
-
* Extracted from
|
|
9
|
-
* value instead of calling return/pauseAuto directly — the
|
|
10
|
-
* checks the result and handles control flow.
|
|
8
|
+
* Extracted from the pre-loop agent_end handler in auto.ts. Returns a
|
|
9
|
+
* sentinel value instead of calling return/pauseAuto directly — the
|
|
10
|
+
* caller checks the result and handles control flow.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import type { ExtensionContext, ExtensionAPI } from "@gsd/pi-coding-agent";
|
|
@@ -60,6 +60,7 @@ import {
|
|
|
60
60
|
nativeAddPaths,
|
|
61
61
|
nativeRmForce,
|
|
62
62
|
nativeBranchDelete,
|
|
63
|
+
nativeBranchForceReset,
|
|
63
64
|
nativeBranchExists,
|
|
64
65
|
nativeDiffNumstat,
|
|
65
66
|
nativeUpdateRef,
|
|
@@ -921,10 +922,74 @@ export function runWorktreePostCreateHook(
|
|
|
921
922
|
|
|
922
923
|
// ─── Auto-Worktree Branch Naming ───────────────────────────────────────────
|
|
923
924
|
|
|
925
|
+
/** Returns the git branch name for a milestone worktree (`milestone/<MID>`). */
|
|
924
926
|
export function autoWorktreeBranch(milestoneId: string): string {
|
|
925
927
|
return `milestone/${milestoneId}`;
|
|
926
928
|
}
|
|
927
929
|
|
|
930
|
+
// ─── Branch-mode Entry ─────────────────────────────────────────────────────
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Enter branch isolation mode for a milestone.
|
|
934
|
+
*
|
|
935
|
+
* Creates `milestone/<MID>` from the integration branch (if it doesn't
|
|
936
|
+
* exist yet) and checks out to it. No worktree directory is created — the
|
|
937
|
+
* project root is the working copy; only HEAD changes.
|
|
938
|
+
*
|
|
939
|
+
* Uses the same 3-tier integration-branch fallback as createAutoWorktree:
|
|
940
|
+
* 1. META.json recorded integration branch
|
|
941
|
+
* 2. git.main_branch preference
|
|
942
|
+
* 3. nativeDetectMainBranch (origin/HEAD auto-detection)
|
|
943
|
+
*/
|
|
944
|
+
export function enterBranchModeForMilestone(
|
|
945
|
+
basePath: string,
|
|
946
|
+
milestoneId: string,
|
|
947
|
+
): void {
|
|
948
|
+
const branch = autoWorktreeBranch(milestoneId);
|
|
949
|
+
const branchExists = nativeBranchExists(basePath, branch);
|
|
950
|
+
|
|
951
|
+
if (!branchExists) {
|
|
952
|
+
// Create the milestone branch from the integration branch start-point.
|
|
953
|
+
const integrationBranch =
|
|
954
|
+
readIntegrationBranch(basePath, milestoneId) ?? undefined;
|
|
955
|
+
const gitPrefs = loadEffectiveGSDPreferences()?.preferences?.git;
|
|
956
|
+
// Validate main_branch preference exists in the repo before using it —
|
|
957
|
+
// a stale preference (e.g. "master" when repo uses "main") would cause
|
|
958
|
+
// nativeBranchForceReset to fail with a bad start-point reference.
|
|
959
|
+
const validatedPrefBranch =
|
|
960
|
+
gitPrefs?.main_branch &&
|
|
961
|
+
typeof gitPrefs.main_branch === "string" &&
|
|
962
|
+
gitPrefs.main_branch.length > 0 &&
|
|
963
|
+
nativeBranchExists(basePath, gitPrefs.main_branch)
|
|
964
|
+
? gitPrefs.main_branch
|
|
965
|
+
: undefined;
|
|
966
|
+
const startPoint =
|
|
967
|
+
integrationBranch ??
|
|
968
|
+
validatedPrefBranch ??
|
|
969
|
+
nativeDetectMainBranch(basePath);
|
|
970
|
+
|
|
971
|
+
// nativeBranchForceReset creates (or resets) branch at startPoint,
|
|
972
|
+
// then checkout switches HEAD to it.
|
|
973
|
+
nativeBranchForceReset(basePath, branch, startPoint);
|
|
974
|
+
debugLog("auto-worktree", {
|
|
975
|
+
action: "enterBranchMode",
|
|
976
|
+
milestoneId,
|
|
977
|
+
branch,
|
|
978
|
+
startPoint,
|
|
979
|
+
created: true,
|
|
980
|
+
});
|
|
981
|
+
} else {
|
|
982
|
+
debugLog("auto-worktree", {
|
|
983
|
+
action: "enterBranchMode",
|
|
984
|
+
milestoneId,
|
|
985
|
+
branch,
|
|
986
|
+
reused: true,
|
|
987
|
+
});
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
nativeCheckoutBranch(basePath, branch);
|
|
991
|
+
}
|
|
992
|
+
|
|
928
993
|
// ─── Public API ────────────────────────────────────────────────────────────
|
|
929
994
|
|
|
930
995
|
/**
|