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
|
@@ -16,8 +16,9 @@
|
|
|
16
16
|
import { mkdirSync, writeFileSync, existsSync, readdirSync, statSync } from "node:fs";
|
|
17
17
|
import { join } from "node:path";
|
|
18
18
|
import { stringify } from "yaml";
|
|
19
|
-
import { loadDefinition, substituteParams } from "./definition-loader.js";
|
|
19
|
+
import { loadDefinition, loadDefinitionFromFile, substituteParams } from "./definition-loader.js";
|
|
20
20
|
import { initializeGraph, writeGraph, readGraph } from "./graph.js";
|
|
21
|
+
import { resolvePlugin } from "./workflow-plugins.js";
|
|
21
22
|
import type { WorkflowDefinition } from "./definition-loader.js";
|
|
22
23
|
import type { WorkflowGraph } from "./graph.js";
|
|
23
24
|
|
|
@@ -67,48 +68,81 @@ function deriveStatus(graph: WorkflowGraph): "pending" | "running" | "complete"
|
|
|
67
68
|
|
|
68
69
|
// ─── Public API ──────────────────────────────────────────────────────────
|
|
69
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Create a run directory from an explicit definition file path.
|
|
73
|
+
* Preferred over `createRun` when the caller has already resolved the file
|
|
74
|
+
* (e.g. via the plugin resolver).
|
|
75
|
+
*/
|
|
76
|
+
export function createRunFromDefinition(
|
|
77
|
+
basePath: string,
|
|
78
|
+
defName: string,
|
|
79
|
+
definitionFile: string,
|
|
80
|
+
overrides?: Record<string, string>,
|
|
81
|
+
): string {
|
|
82
|
+
const rawDef = loadDefinitionFromFile(definitionFile);
|
|
83
|
+
const def: WorkflowDefinition = overrides
|
|
84
|
+
? substituteParams(rawDef, overrides)
|
|
85
|
+
: substituteParams(rawDef);
|
|
86
|
+
|
|
87
|
+
const timestamp = makeTimestamp();
|
|
88
|
+
const runDir = join(basePath, ".gsd", RUNS_DIR, defName, timestamp);
|
|
89
|
+
mkdirSync(runDir, { recursive: true });
|
|
90
|
+
|
|
91
|
+
writeFileSync(join(runDir, "DEFINITION.yaml"), stringify(def), "utf-8");
|
|
92
|
+
|
|
93
|
+
const graph = initializeGraph(def);
|
|
94
|
+
writeGraph(runDir, graph);
|
|
95
|
+
|
|
96
|
+
if (overrides && Object.keys(overrides).length > 0) {
|
|
97
|
+
writeFileSync(
|
|
98
|
+
join(runDir, "PARAMS.json"),
|
|
99
|
+
JSON.stringify(overrides, null, 2),
|
|
100
|
+
"utf-8",
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return runDir;
|
|
105
|
+
}
|
|
106
|
+
|
|
70
107
|
/**
|
|
71
108
|
* Create a new isolated run directory for a workflow definition.
|
|
72
109
|
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* 4. Writes frozen DEFINITION.yaml, initialized GRAPH.yaml, and optional PARAMS.json
|
|
110
|
+
* Resolution order:
|
|
111
|
+
* 1. Plugin resolver (project → global → bundled), YAML format only.
|
|
112
|
+
* 2. Legacy `.gsd/workflow-defs/<defName>.yaml`.
|
|
77
113
|
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
* @
|
|
82
|
-
* @throws Error if the definition file doesn't exist or is invalid
|
|
114
|
+
* Creates `<basePath>/.gsd/workflow-runs/<defName>/<timestamp>/` containing
|
|
115
|
+
* DEFINITION.yaml (frozen), GRAPH.yaml (initialized), and optional PARAMS.json.
|
|
116
|
+
*
|
|
117
|
+
* @throws Error if no matching definition is found anywhere.
|
|
83
118
|
*/
|
|
84
119
|
export function createRun(
|
|
85
120
|
basePath: string,
|
|
86
121
|
defName: string,
|
|
87
122
|
overrides?: Record<string, string>,
|
|
88
123
|
): string {
|
|
89
|
-
|
|
124
|
+
// Try the unified plugin resolver first — honors project/global overrides.
|
|
125
|
+
const plugin = resolvePlugin(basePath, defName);
|
|
126
|
+
if (plugin && plugin.format === "yaml") {
|
|
127
|
+
return createRunFromDefinition(basePath, defName, plugin.path, overrides);
|
|
128
|
+
}
|
|
90
129
|
|
|
91
|
-
//
|
|
130
|
+
// Fall back to legacy `.gsd/workflow-defs/<defName>.yaml`.
|
|
131
|
+
const defsDir = join(basePath, ".gsd", DEFS_DIR);
|
|
92
132
|
const rawDef = loadDefinition(defsDir, defName);
|
|
93
|
-
|
|
94
|
-
// Apply parameter substitution if overrides provided
|
|
95
133
|
const def: WorkflowDefinition = overrides
|
|
96
134
|
? substituteParams(rawDef, overrides)
|
|
97
|
-
: substituteParams(rawDef);
|
|
135
|
+
: substituteParams(rawDef);
|
|
98
136
|
|
|
99
|
-
// Create the run directory
|
|
100
137
|
const timestamp = makeTimestamp();
|
|
101
138
|
const runDir = join(basePath, ".gsd", RUNS_DIR, defName, timestamp);
|
|
102
139
|
mkdirSync(runDir, { recursive: true });
|
|
103
140
|
|
|
104
|
-
// Freeze the definition as DEFINITION.yaml
|
|
105
141
|
writeFileSync(join(runDir, "DEFINITION.yaml"), stringify(def), "utf-8");
|
|
106
142
|
|
|
107
|
-
// Initialize and write GRAPH.yaml
|
|
108
143
|
const graph = initializeGraph(def);
|
|
109
144
|
writeGraph(runDir, graph);
|
|
110
145
|
|
|
111
|
-
// Write PARAMS.json if overrides were provided
|
|
112
146
|
if (overrides && Object.keys(overrides).length > 0) {
|
|
113
147
|
writeFileSync(
|
|
114
148
|
join(runDir, "PARAMS.json"),
|
|
@@ -44,6 +44,8 @@ import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
|
44
44
|
import { debugCount, debugTime } from './debug-logger.js';
|
|
45
45
|
import { logWarning, logError } from './workflow-logger.js';
|
|
46
46
|
import { extractVerdict } from './verdict-parser.js';
|
|
47
|
+
import { loadEffectiveGSDPreferences } from './preferences.js';
|
|
48
|
+
import { detectPendingEscalation } from './escalation.js';
|
|
47
49
|
|
|
48
50
|
import {
|
|
49
51
|
isDbAvailable,
|
|
@@ -60,6 +62,7 @@ import {
|
|
|
60
62
|
updateSliceStatus,
|
|
61
63
|
updateTaskStatus,
|
|
62
64
|
getPendingGateCountForTurn,
|
|
65
|
+
autoHealSketchFlags,
|
|
63
66
|
type MilestoneRow,
|
|
64
67
|
type SliceRow,
|
|
65
68
|
type TaskRow,
|
|
@@ -849,7 +852,15 @@ export async function deriveStateFromDb(basePath: string): Promise<GSDState> {
|
|
|
849
852
|
return handleAllSlicesDone(basePath, activeMilestone, registry, requirements, milestoneProgress, sliceProgress);
|
|
850
853
|
}
|
|
851
854
|
|
|
852
|
-
|
|
855
|
+
// ADR-011 auto-heal: if a slice has a PLAN on disk but is still flagged is_sketch=1
|
|
856
|
+
// (e.g. a crash between plan-slice write and the sketch flip), reconcile before
|
|
857
|
+
// running phase derivation so the flag doesn't misroute state.
|
|
858
|
+
autoHealSketchFlags(activeMilestone.id, (sid) =>
|
|
859
|
+
!!resolveSliceFile(basePath, activeMilestone.id, sid, "PLAN"),
|
|
860
|
+
);
|
|
861
|
+
// Re-read slices after auto-heal so downstream reads see fresh is_sketch values.
|
|
862
|
+
const healedSlices = getMilestoneSlices(activeMilestone.id);
|
|
863
|
+
const activeSliceContext = resolveSliceDependencies(healedSlices);
|
|
853
864
|
if (!activeSliceContext.activeSlice) {
|
|
854
865
|
// If locked slice wasn't found, it returns null but logs warning, we need to return 'blocked'
|
|
855
866
|
if (process.env.GSD_SLICE_LOCK) {
|
|
@@ -869,10 +880,24 @@ export async function deriveStateFromDb(basePath: string): Promise<GSDState> {
|
|
|
869
880
|
progress: { milestones: milestoneProgress, slices: sliceProgress },
|
|
870
881
|
};
|
|
871
882
|
}
|
|
872
|
-
const { activeSlice } = activeSliceContext;
|
|
883
|
+
const { activeSlice, activeSliceRow } = activeSliceContext;
|
|
873
884
|
|
|
874
885
|
const planFile = resolveSliceFile(basePath, activeMilestone.id, activeSlice.id, "PLAN");
|
|
875
886
|
if (!planFile) {
|
|
887
|
+
// ADR-011: sketch slices with progressive_planning enabled enter the
|
|
888
|
+
// `refining` phase — a refine-slice unit expands the sketch into a full plan
|
|
889
|
+
// before execution. When the flag is off, sketches are indistinguishable
|
|
890
|
+
// from a missing plan and fall through to the normal `planning` phase.
|
|
891
|
+
const progressive = loadEffectiveGSDPreferences()?.preferences?.phases?.progressive_planning === true;
|
|
892
|
+
if (progressive && activeSliceRow?.is_sketch === 1) {
|
|
893
|
+
return {
|
|
894
|
+
activeMilestone, activeSlice, activeTask: null,
|
|
895
|
+
phase: 'refining', recentDecisions: [], blockers: [],
|
|
896
|
+
nextAction: `Refine sketch slice ${activeSlice.id} (${activeSlice.title}) using prior slice context.`,
|
|
897
|
+
registry, requirements,
|
|
898
|
+
progress: { milestones: milestoneProgress, slices: sliceProgress },
|
|
899
|
+
};
|
|
900
|
+
}
|
|
876
901
|
return {
|
|
877
902
|
activeMilestone, activeSlice, activeTask: null,
|
|
878
903
|
phase: 'planning', recentDecisions: [], blockers: [],
|
|
@@ -965,6 +990,29 @@ export async function deriveStateFromDb(basePath: string): Promise<GSDState> {
|
|
|
965
990
|
}
|
|
966
991
|
}
|
|
967
992
|
|
|
993
|
+
// ADR-011 Phase 2: pause-on-escalation takes precedence over dispatching the
|
|
994
|
+
// next task. `awaiting_review` tasks (continueWithDefault=true) are NOT
|
|
995
|
+
// surfaced here — they let the loop continue.
|
|
996
|
+
//
|
|
997
|
+
// We do NOT gate this on `phases.mid_execution_escalation` — creation of
|
|
998
|
+
// new escalations is gated at the write site (tools/complete-task.ts:315),
|
|
999
|
+
// but any escalation_pending row already persisted in the DB must be
|
|
1000
|
+
// honored even if the user later toggles the flag off. Otherwise those
|
|
1001
|
+
// rows would silently orphan, the loop would advance past the paused task,
|
|
1002
|
+
// and the user's prior resolution never lands.
|
|
1003
|
+
const escalatingTaskId = detectPendingEscalation(tasks, basePath);
|
|
1004
|
+
if (escalatingTaskId) {
|
|
1005
|
+
return {
|
|
1006
|
+
activeMilestone, activeSlice, activeTask,
|
|
1007
|
+
phase: 'escalating-task', recentDecisions: [],
|
|
1008
|
+
blockers: [`Task ${escalatingTaskId} requires a user decision before the loop can proceed`],
|
|
1009
|
+
nextAction: `Run /gsd escalate show ${escalatingTaskId} to review, then /gsd escalate resolve ${escalatingTaskId} <choice> to proceed.`,
|
|
1010
|
+
activeWorkspace: undefined,
|
|
1011
|
+
registry, requirements,
|
|
1012
|
+
progress: { milestones: milestoneProgress, slices: sliceProgress, tasks: taskProgress },
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
|
|
968
1016
|
if (!blockerTaskId) {
|
|
969
1017
|
const isTriggered = checkReplanTrigger(basePath, activeMilestone.id, activeSlice.id);
|
|
970
1018
|
if (isTriggered) {
|
|
@@ -44,19 +44,19 @@ uok:
|
|
|
44
44
|
legacy_fallback:
|
|
45
45
|
enabled: false
|
|
46
46
|
gates:
|
|
47
|
-
enabled:
|
|
47
|
+
enabled: true
|
|
48
48
|
model_policy:
|
|
49
|
-
enabled:
|
|
49
|
+
enabled: true
|
|
50
50
|
execution_graph:
|
|
51
|
-
enabled:
|
|
51
|
+
enabled: true
|
|
52
52
|
gitops:
|
|
53
|
-
enabled:
|
|
54
|
-
turn_action:
|
|
53
|
+
enabled: true
|
|
54
|
+
turn_action: commit
|
|
55
55
|
turn_push: false
|
|
56
56
|
audit_unified:
|
|
57
|
-
enabled:
|
|
57
|
+
enabled: true
|
|
58
58
|
plan_v2:
|
|
59
|
-
enabled:
|
|
59
|
+
enabled: true
|
|
60
60
|
auto_visualize:
|
|
61
61
|
auto_report:
|
|
62
62
|
parallel:
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* agent-end-retry.test.ts — Regression checks for the agent_end model.
|
|
3
3
|
*
|
|
4
4
|
* The per-unit one-shot resolve function lives at module level in auto-loop.ts
|
|
5
|
-
* (_currentResolve).
|
|
6
|
-
* resolveAgentEnd().
|
|
5
|
+
* (_currentResolve). agent_end is handled via resolveAgentEnd().
|
|
7
6
|
*/
|
|
8
7
|
|
|
9
8
|
import test from "node:test";
|
|
@@ -62,38 +61,6 @@ test("legacy pendingAgentEndRetry state is gone", () => {
|
|
|
62
61
|
);
|
|
63
62
|
});
|
|
64
63
|
|
|
65
|
-
test("handleAgentEnd is a thin compatibility wrapper", () => {
|
|
66
|
-
const source = getAutoTsSource();
|
|
67
|
-
const fnIdx = source.indexOf("export async function handleAgentEnd");
|
|
68
|
-
assert.ok(fnIdx > -1, "handleAgentEnd must exist in auto.ts");
|
|
69
|
-
const fnBlock = source.slice(fnIdx, source.indexOf("\n// ─── ", fnIdx + 100));
|
|
70
|
-
|
|
71
|
-
assert.ok(
|
|
72
|
-
fnBlock.includes("resolveAgentEnd("),
|
|
73
|
-
"handleAgentEnd must delegate to resolveAgentEnd",
|
|
74
|
-
);
|
|
75
|
-
assert.ok(
|
|
76
|
-
!fnBlock.includes("pendingAgentEndRetry"),
|
|
77
|
-
"handleAgentEnd must not use legacy retry state",
|
|
78
|
-
);
|
|
79
|
-
assert.ok(
|
|
80
|
-
!fnBlock.includes("dispatchNextUnit"),
|
|
81
|
-
"handleAgentEnd must not dispatch recursively",
|
|
82
|
-
);
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
test("handleAgentEnd early return calls resolveAgentEndCancelled", () => {
|
|
86
|
-
const source = getAutoTsSource();
|
|
87
|
-
const fnIdx = source.indexOf("export async function handleAgentEnd");
|
|
88
|
-
assert.ok(fnIdx > -1, "handleAgentEnd must exist in auto.ts");
|
|
89
|
-
const fnBlock = source.slice(fnIdx, source.indexOf("\n// ─── ", fnIdx + 100));
|
|
90
|
-
|
|
91
|
-
assert.ok(
|
|
92
|
-
fnBlock.includes("resolveAgentEndCancelled()"),
|
|
93
|
-
"handleAgentEnd must call resolveAgentEndCancelled on early return to prevent orphaned promises",
|
|
94
|
-
);
|
|
95
|
-
});
|
|
96
|
-
|
|
97
64
|
test("pauseAuto calls resolveAgentEndCancelled to unblock the loop", () => {
|
|
98
65
|
const source = getAutoTsSource();
|
|
99
66
|
const fnIdx = source.indexOf("export async function pauseAuto");
|
|
@@ -46,6 +46,8 @@ function makeSliceRow(overrides?: Partial<SliceRow>): SliceRow {
|
|
|
46
46
|
observability_impact: '',
|
|
47
47
|
sequence: 4,
|
|
48
48
|
replan_triggered_at: null,
|
|
49
|
+
is_sketch: 0,
|
|
50
|
+
sketch_scope: '',
|
|
49
51
|
...overrides,
|
|
50
52
|
};
|
|
51
53
|
}
|
|
@@ -77,6 +79,11 @@ function makeTaskRow(overrides?: Partial<TaskRow>): TaskRow {
|
|
|
77
79
|
expected_output: [],
|
|
78
80
|
observability_impact: '',
|
|
79
81
|
sequence: 0,
|
|
82
|
+
blocker_source: '',
|
|
83
|
+
escalation_pending: 0,
|
|
84
|
+
escalation_awaiting_review: 0,
|
|
85
|
+
escalation_artifact_path: null,
|
|
86
|
+
escalation_override_applied_at: null,
|
|
80
87
|
...overrides,
|
|
81
88
|
};
|
|
82
89
|
}
|
|
@@ -313,6 +313,42 @@ test("runUnit re-applies the selected unit model after newSession before dispatc
|
|
|
313
313
|
assert.equal(pi.calls.length, 1);
|
|
314
314
|
});
|
|
315
315
|
|
|
316
|
+
test("runUnit cancels before dispatch when model restore fails after newSession", async () => {
|
|
317
|
+
_resetPendingResolve();
|
|
318
|
+
|
|
319
|
+
const notifications: Array<{ message: string; level: string }> = [];
|
|
320
|
+
const ctx = makeMockCtx();
|
|
321
|
+
ctx.ui.notify = (message: string, level: string) => {
|
|
322
|
+
notifications.push({ message, level });
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
const pi = makeMockPi();
|
|
326
|
+
pi.setModel = async (...args: unknown[]) => {
|
|
327
|
+
pi.setModelCalls.push(args);
|
|
328
|
+
return false;
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
const s = makeMockSession();
|
|
332
|
+
s.currentUnitModel = { provider: "openai-codex", id: "gpt-5.4" };
|
|
333
|
+
|
|
334
|
+
const result = await runUnit(ctx, pi, s, "task", "T01", "prompt");
|
|
335
|
+
|
|
336
|
+
assert.equal(result.status, "cancelled");
|
|
337
|
+
assert.equal(result.errorContext?.category, "session-failed");
|
|
338
|
+
assert.match(
|
|
339
|
+
result.errorContext?.message ?? "",
|
|
340
|
+
/Failed to restore configured model openai-codex\/gpt-5\.4 after session creation/,
|
|
341
|
+
);
|
|
342
|
+
assert.equal(pi.setModelCalls.length, 1);
|
|
343
|
+
assert.equal(pi.calls.length, 0, "unit must not dispatch on the session default model");
|
|
344
|
+
assert.deepEqual(notifications, [
|
|
345
|
+
{
|
|
346
|
+
message: "Failed to restore configured model openai-codex/gpt-5.4 after session creation. Cancelling unit before dispatch.",
|
|
347
|
+
level: "warning",
|
|
348
|
+
},
|
|
349
|
+
]);
|
|
350
|
+
});
|
|
351
|
+
|
|
316
352
|
// ─── Structural assertions ───────────────────────────────────────────────────
|
|
317
353
|
|
|
318
354
|
test("auto-loop.ts exports autoLoop, runUnit, resolveAgentEnd", async () => {
|
|
@@ -1267,7 +1303,7 @@ test("auto-loop.ts barrel re-exports autoLoop, runUnit, and resolveAgentEnd", ()
|
|
|
1267
1303
|
);
|
|
1268
1304
|
});
|
|
1269
1305
|
|
|
1270
|
-
test("auto.ts startAuto dispatches through the UOK kernel wrapper
|
|
1306
|
+
test("auto.ts startAuto dispatches through the UOK kernel wrapper with explicit kernel and legacy paths", () => {
|
|
1271
1307
|
const src = readFileSync(
|
|
1272
1308
|
resolve(import.meta.dirname, "..", "auto.ts"),
|
|
1273
1309
|
"utf-8",
|
|
@@ -1283,8 +1319,12 @@ test("auto.ts startAuto dispatches through the UOK kernel wrapper (legacy loop a
|
|
|
1283
1319
|
"startAuto must dispatch through runAutoLoopWithUok()",
|
|
1284
1320
|
);
|
|
1285
1321
|
assert.ok(
|
|
1286
|
-
fnBlock.includes("
|
|
1287
|
-
"startAuto must
|
|
1322
|
+
fnBlock.includes("runKernelLoop: runUokKernelLoop"),
|
|
1323
|
+
"startAuto must wire the explicit UOK kernel loop path",
|
|
1324
|
+
);
|
|
1325
|
+
assert.ok(
|
|
1326
|
+
fnBlock.includes("runLegacyLoop: runLegacyAutoLoop"),
|
|
1327
|
+
"startAuto must preserve explicit legacy fallback dispatch",
|
|
1288
1328
|
);
|
|
1289
1329
|
});
|
|
1290
1330
|
|
|
@@ -1332,7 +1372,7 @@ test("startAuto guards against concurrent invocation (#2923)", () => {
|
|
|
1332
1372
|
);
|
|
1333
1373
|
});
|
|
1334
1374
|
|
|
1335
|
-
test("agent_end handler calls resolveAgentEnd (not
|
|
1375
|
+
test("agent_end handler calls resolveAgentEnd (not the legacy auto.ts path)", () => {
|
|
1336
1376
|
const hooksSrc = readFileSync(
|
|
1337
1377
|
resolve(import.meta.dirname, "..", "bootstrap", "register-hooks.ts"),
|
|
1338
1378
|
"utf-8",
|
|
@@ -1347,7 +1387,7 @@ test("agent_end handler calls resolveAgentEnd (not handleAgentEnd)", () => {
|
|
|
1347
1387
|
);
|
|
1348
1388
|
assert.ok(
|
|
1349
1389
|
recoverySrc.includes("resolveAgentEnd(event)"),
|
|
1350
|
-
"agent_end success path must call resolveAgentEnd(event) instead of
|
|
1390
|
+
"agent_end success path must call resolveAgentEnd(event) instead of legacy wrappers",
|
|
1351
1391
|
);
|
|
1352
1392
|
assert.ok(
|
|
1353
1393
|
recoverySrc.includes("isSessionSwitchInFlight()"),
|
|
@@ -1389,32 +1429,6 @@ test("auto-timeout-recovery.ts calls resolveAgentEnd instead of dispatchNextUnit
|
|
|
1389
1429
|
);
|
|
1390
1430
|
});
|
|
1391
1431
|
|
|
1392
|
-
test("handleAgentEnd in auto.ts is a thin wrapper calling resolveAgentEnd", () => {
|
|
1393
|
-
const src = readFileSync(
|
|
1394
|
-
resolve(import.meta.dirname, "..", "auto.ts"),
|
|
1395
|
-
"utf-8",
|
|
1396
|
-
);
|
|
1397
|
-
const fnIdx = src.indexOf("export async function handleAgentEnd");
|
|
1398
|
-
assert.ok(fnIdx > -1, "handleAgentEnd must exist");
|
|
1399
|
-
const fnEnd = src.indexOf("\n// ─── ", fnIdx + 100);
|
|
1400
|
-
const fnBlock =
|
|
1401
|
-
fnEnd > -1 ? src.slice(fnIdx, fnEnd) : src.slice(fnIdx, fnIdx + 1000);
|
|
1402
|
-
assert.ok(
|
|
1403
|
-
fnBlock.includes("resolveAgentEnd("),
|
|
1404
|
-
"handleAgentEnd must call resolveAgentEnd",
|
|
1405
|
-
);
|
|
1406
|
-
// The function should be short — no reentrancy guard, no verification, no dispatch
|
|
1407
|
-
assert.ok(
|
|
1408
|
-
!fnBlock.includes("dispatchNextUnit"),
|
|
1409
|
-
"handleAgentEnd must not call dispatchNextUnit (it's now a thin wrapper)",
|
|
1410
|
-
);
|
|
1411
|
-
assert.ok(
|
|
1412
|
-
!fnBlock.includes("postUnitPreVerification") &&
|
|
1413
|
-
!fnBlock.includes("postUnitPostVerification"),
|
|
1414
|
-
"handleAgentEnd must not contain verification logic (moved to autoLoop)",
|
|
1415
|
-
);
|
|
1416
|
-
});
|
|
1417
|
-
|
|
1418
1432
|
// ── Stuck counter tests ──────────────────────────────────────────────────────
|
|
1419
1433
|
|
|
1420
1434
|
test("stuck detection: stops when sliding window detects same unit 3 consecutive times", async () => {
|
|
@@ -5,7 +5,8 @@ import { join } from "node:path";
|
|
|
5
5
|
import { tmpdir } from "node:os";
|
|
6
6
|
import { randomUUID } from "node:crypto";
|
|
7
7
|
|
|
8
|
-
import { verifyExpectedArtifact, hasImplementationArtifacts, resolveExpectedArtifactPath, diagnoseExpectedArtifact, buildLoopRemediationSteps } from "../auto-recovery.ts";
|
|
8
|
+
import { verifyExpectedArtifact, hasImplementationArtifacts, resolveExpectedArtifactPath, diagnoseExpectedArtifact, buildLoopRemediationSteps, writeBlockerPlaceholder } from "../auto-recovery.ts";
|
|
9
|
+
import { resolveMilestoneFile } from "../paths.ts";
|
|
9
10
|
import { openDatabase, closeDatabase, insertMilestone, insertSlice, insertGateRow } from "../gsd-db.ts";
|
|
10
11
|
import { clearParseCache } from "../files.ts";
|
|
11
12
|
import { parseRoadmap } from "../parsers-legacy.ts";
|
|
@@ -712,3 +713,124 @@ test("verifyExpectedArtifact checks pending gate-evaluate artifacts without ESM
|
|
|
712
713
|
|
|
713
714
|
assert.equal(verified, false, "pending gates should keep gate-evaluate unverified");
|
|
714
715
|
});
|
|
716
|
+
|
|
717
|
+
// ─── #4414 regressions ────────────────────────────────────────────────────────
|
|
718
|
+
|
|
719
|
+
test("#4414: writeBlockerPlaceholder invalidates path cache so dispatch guard sees file", () => {
|
|
720
|
+
const base = makeTmpBase();
|
|
721
|
+
try {
|
|
722
|
+
// Prime the readdir cache by resolving a DIFFERENT file first — this
|
|
723
|
+
// mirrors the stuck-loop condition where the dispatch guard cached an
|
|
724
|
+
// empty directory listing before the placeholder was written.
|
|
725
|
+
invalidateAllCaches();
|
|
726
|
+
assert.equal(
|
|
727
|
+
resolveMilestoneFile(base, "M001", "RESEARCH"),
|
|
728
|
+
null,
|
|
729
|
+
"no RESEARCH file yet",
|
|
730
|
+
);
|
|
731
|
+
|
|
732
|
+
const result = writeBlockerPlaceholder(
|
|
733
|
+
"research-milestone",
|
|
734
|
+
"M001",
|
|
735
|
+
base,
|
|
736
|
+
"verification retries exhausted",
|
|
737
|
+
);
|
|
738
|
+
assert.ok(result, "placeholder path returned");
|
|
739
|
+
|
|
740
|
+
// After writeBlockerPlaceholder, the dispatch guard must see the new file
|
|
741
|
+
// immediately — otherwise the rule re-fires (#4414, 7× re-dispatch).
|
|
742
|
+
const postResolve = resolveMilestoneFile(base, "M001", "RESEARCH");
|
|
743
|
+
assert.ok(
|
|
744
|
+
postResolve,
|
|
745
|
+
"resolveMilestoneFile finds the placeholder post-write (cache invalidated)",
|
|
746
|
+
);
|
|
747
|
+
} finally {
|
|
748
|
+
cleanup(base);
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
|
|
752
|
+
test("#4414: parallel-research sentinel path does not collide with RESEARCH suffix", () => {
|
|
753
|
+
const base = makeTmpBase();
|
|
754
|
+
try {
|
|
755
|
+
// Write only the parallel-research blocker (sentinel).
|
|
756
|
+
const sentinel = resolveExpectedArtifactPath(
|
|
757
|
+
"research-slice",
|
|
758
|
+
"M001/parallel-research",
|
|
759
|
+
base,
|
|
760
|
+
);
|
|
761
|
+
assert.ok(sentinel, "sentinel path resolves for parallel-research");
|
|
762
|
+
writeFileSync(sentinel!, "# blocker\n", "utf-8");
|
|
763
|
+
|
|
764
|
+
// Critical: the sentinel filename must NOT be matched by the legacy regex
|
|
765
|
+
// used when callers look up milestone-level RESEARCH. Otherwise the
|
|
766
|
+
// dispatch guard for research-milestone would short-circuit falsely.
|
|
767
|
+
const milestoneResearch = resolveMilestoneFile(base, "M001", "RESEARCH");
|
|
768
|
+
assert.equal(
|
|
769
|
+
milestoneResearch,
|
|
770
|
+
null,
|
|
771
|
+
"sentinel must not be mistaken for M001-RESEARCH.md via legacy pattern match",
|
|
772
|
+
);
|
|
773
|
+
} finally {
|
|
774
|
+
cleanup(base);
|
|
775
|
+
}
|
|
776
|
+
});
|
|
777
|
+
|
|
778
|
+
test("#4414: verifyExpectedArtifact parallel-research succeeds when all research-ready slices have RESEARCH", () => {
|
|
779
|
+
const base = makeTmpBase();
|
|
780
|
+
try {
|
|
781
|
+
mkdirSync(join(base, ".gsd", "milestones", "M001", "slices", "S02", "tasks"), { recursive: true });
|
|
782
|
+
mkdirSync(join(base, ".gsd", "milestones", "M001", "slices", "S03", "tasks"), { recursive: true });
|
|
783
|
+
|
|
784
|
+
// Minimal roadmap with three slices
|
|
785
|
+
writeFileSync(
|
|
786
|
+
join(base, ".gsd", "milestones", "M001", "M001-ROADMAP.md"),
|
|
787
|
+
[
|
|
788
|
+
"# M001: Regression",
|
|
789
|
+
"",
|
|
790
|
+
"## Slices",
|
|
791
|
+
"",
|
|
792
|
+
"- [ ] **S01: Alpha** `risk:low` `depends:[]`",
|
|
793
|
+
"- [ ] **S02: Beta** `risk:low` `depends:[]`",
|
|
794
|
+
"- [ ] **S03: Gamma** `risk:low` `depends:[]`",
|
|
795
|
+
"",
|
|
796
|
+
].join("\n"),
|
|
797
|
+
"utf-8",
|
|
798
|
+
);
|
|
799
|
+
|
|
800
|
+
// Only 2 of 3 have RESEARCH — should fail verification
|
|
801
|
+
writeFileSync(
|
|
802
|
+
join(base, ".gsd", "milestones", "M001", "slices", "S01", "S01-RESEARCH.md"),
|
|
803
|
+
"# research",
|
|
804
|
+
"utf-8",
|
|
805
|
+
);
|
|
806
|
+
writeFileSync(
|
|
807
|
+
join(base, ".gsd", "milestones", "M001", "slices", "S02", "S02-RESEARCH.md"),
|
|
808
|
+
"# research",
|
|
809
|
+
"utf-8",
|
|
810
|
+
);
|
|
811
|
+
|
|
812
|
+
clearParseCache();
|
|
813
|
+
invalidateAllCaches();
|
|
814
|
+
assert.equal(
|
|
815
|
+
verifyExpectedArtifact("research-slice", "M001/parallel-research", base),
|
|
816
|
+
false,
|
|
817
|
+
"missing S03 RESEARCH → verification fails",
|
|
818
|
+
);
|
|
819
|
+
|
|
820
|
+
// All three RESEARCH present → verification passes
|
|
821
|
+
writeFileSync(
|
|
822
|
+
join(base, ".gsd", "milestones", "M001", "slices", "S03", "S03-RESEARCH.md"),
|
|
823
|
+
"# research",
|
|
824
|
+
"utf-8",
|
|
825
|
+
);
|
|
826
|
+
clearParseCache();
|
|
827
|
+
invalidateAllCaches();
|
|
828
|
+
assert.equal(
|
|
829
|
+
verifyExpectedArtifact("research-slice", "M001/parallel-research", base),
|
|
830
|
+
true,
|
|
831
|
+
"all slices have RESEARCH → verification passes",
|
|
832
|
+
);
|
|
833
|
+
} finally {
|
|
834
|
+
cleanup(base);
|
|
835
|
+
}
|
|
836
|
+
});
|
|
@@ -15,6 +15,9 @@ const autoSrc = readFileSync(autoPath, "utf-8");
|
|
|
15
15
|
const runUnitPath = join(import.meta.dirname, "..", "auto", "run-unit.ts");
|
|
16
16
|
const runUnitSrc = readFileSync(runUnitPath, "utf-8");
|
|
17
17
|
|
|
18
|
+
const registerHooksPath = join(import.meta.dirname, "..", "bootstrap", "register-hooks.ts");
|
|
19
|
+
const registerHooksSrc = readFileSync(registerHooksPath, "utf-8");
|
|
20
|
+
|
|
18
21
|
describe("#3512: gsd-auto-wrapup must not interrupt in-flight tool calls", () => {
|
|
19
22
|
test("soft timeout wrapup gates triggerTurn on getInFlightToolCount() === 0", () => {
|
|
20
23
|
// The soft timeout sendMessage must NOT use a hardcoded `triggerTurn: true`.
|
|
@@ -70,6 +73,42 @@ describe("#3512: gsd-auto-wrapup must not interrupt in-flight tool calls", () =>
|
|
|
70
73
|
});
|
|
71
74
|
});
|
|
72
75
|
|
|
76
|
+
describe("#4276: pending/skipped tools stay visible to auto-mode hooks", () => {
|
|
77
|
+
test("tool_call handler marks GSD tools in-flight before execution_start", () => {
|
|
78
|
+
const startMarker = 'pi.on("tool_call", async (event, ctx) => {';
|
|
79
|
+
const endMarker = 'pi.on("tool_result", async (event) => {';
|
|
80
|
+
const toolCallSection = registerHooksSrc.slice(
|
|
81
|
+
registerHooksSrc.indexOf(startMarker),
|
|
82
|
+
registerHooksSrc.indexOf(endMarker),
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
assert.ok(toolCallSection.length > 0, "Could not locate tool_call handler section");
|
|
86
|
+
assert.ok(
|
|
87
|
+
toolCallSection.includes("markToolStart(event.toolCallId, event.toolName)"),
|
|
88
|
+
"tool_call handler must mark tools pending before tool_execution_start fires",
|
|
89
|
+
);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
test("tool_result handler clears pending tools and records queued-skip errors", () => {
|
|
93
|
+
const startMarker = 'pi.on("tool_result", async (event) => {';
|
|
94
|
+
const endMarker = 'pi.on("tool_execution_start", async (event) => {';
|
|
95
|
+
const toolResultSection = registerHooksSrc.slice(
|
|
96
|
+
registerHooksSrc.indexOf(startMarker),
|
|
97
|
+
registerHooksSrc.indexOf(endMarker),
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
assert.ok(toolResultSection.length > 0, "Could not locate tool_result handler section");
|
|
101
|
+
assert.ok(
|
|
102
|
+
toolResultSection.includes("markToolEnd(event.toolCallId)"),
|
|
103
|
+
"tool_result handler must clear pending tool tracking even when execution hooks never fire",
|
|
104
|
+
);
|
|
105
|
+
assert.ok(
|
|
106
|
+
toolResultSection.includes("recordToolInvocationError(event.toolName, errorText)"),
|
|
107
|
+
"tool_result handler must surface queued-skip errors for GSD tools",
|
|
108
|
+
);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
|
|
73
112
|
describe("#3512: pauseAuto and stopAuto must flush queued follow-up messages", () => {
|
|
74
113
|
test("stopAuto calls clearQueue()", () => {
|
|
75
114
|
// stopAuto must flush queued messages to prevent late async_job_result
|
|
@@ -44,6 +44,14 @@ test("/gsd description includes discuss", () => {
|
|
|
44
44
|
);
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
+
test("/gsd description includes debug", () => {
|
|
48
|
+
const pi = createMockPi();
|
|
49
|
+
registerGSDCommand(pi as any);
|
|
50
|
+
|
|
51
|
+
const gsd = pi.commands.get("gsd");
|
|
52
|
+
assert.ok(gsd.description.includes("debug"), "description should include debug");
|
|
53
|
+
});
|
|
54
|
+
|
|
47
55
|
test("/gsd next completions include --debug", () => {
|
|
48
56
|
const pi = createMockPi();
|
|
49
57
|
registerGSDCommand(pi as any);
|
|
@@ -54,6 +62,18 @@ test("/gsd next completions include --debug", () => {
|
|
|
54
62
|
assert.ok(debug, "next --debug should appear in completions");
|
|
55
63
|
});
|
|
56
64
|
|
|
65
|
+
test("/gsd debug completions include list|status|continue|--diagnose", () => {
|
|
66
|
+
const pi = createMockPi();
|
|
67
|
+
registerGSDCommand(pi as any);
|
|
68
|
+
|
|
69
|
+
const gsd = pi.commands.get("gsd");
|
|
70
|
+
const completions = gsd.getArgumentCompletions("debug ");
|
|
71
|
+
const values = completions.map((c: any) => c.value);
|
|
72
|
+
for (const expected of ["debug list", "debug status", "debug continue", "debug --diagnose"]) {
|
|
73
|
+
assert.ok(values.includes(expected), `missing completion: ${expected}`);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
57
77
|
test("/gsd widget completions include full|small|min|off", () => {
|
|
58
78
|
const pi = createMockPi();
|
|
59
79
|
registerGSDCommand(pi as any);
|
|
@@ -66,6 +86,25 @@ test("/gsd widget completions include full|small|min|off", () => {
|
|
|
66
86
|
}
|
|
67
87
|
});
|
|
68
88
|
|
|
89
|
+
test("/gsd logs completions still include debug after adding /gsd debug", () => {
|
|
90
|
+
const pi = createMockPi();
|
|
91
|
+
registerGSDCommand(pi as any);
|
|
92
|
+
|
|
93
|
+
const gsd = pi.commands.get("gsd");
|
|
94
|
+
const completions = gsd.getArgumentCompletions("logs ");
|
|
95
|
+
const values = completions.map((c: any) => c.value);
|
|
96
|
+
assert.ok(values.includes("logs debug"), "logs debug completion should remain available");
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test("/gsd help full includes /gsd debug command", async () => {
|
|
100
|
+
const ctx = createMockCtx();
|
|
101
|
+
|
|
102
|
+
await handleGSDCommand("help full", ctx as any, {} as any);
|
|
103
|
+
|
|
104
|
+
const helpText = ctx.notifications.map((n) => n.message).join("\n");
|
|
105
|
+
assert.match(helpText, /\/gsd debug\s+Create\/list\/continue persistent debug sessions/);
|
|
106
|
+
});
|
|
107
|
+
|
|
69
108
|
test("bare /gsd skip shows usage and does not fall through to unknown-command warning", async () => {
|
|
70
109
|
const ctx = createMockCtx();
|
|
71
110
|
|