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
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { readFileSync } from "node:fs";
|
|
15
15
|
import { join } from "node:path";
|
|
16
|
-
import { readGraph, writeGraph, getNextPendingStep, markStepComplete, expandIteration, } from "./graph.js";
|
|
16
|
+
import { readGraph, writeGraph, getNextPendingStep, markStepActive, markStepComplete, expandIteration, } from "./graph.js";
|
|
17
17
|
import { injectContext } from "./context-injector.js";
|
|
18
18
|
import { readFrozenDefinition } from "./definition-io.js";
|
|
19
19
|
import { parseUnitId } from "./unit-id.js";
|
|
@@ -62,66 +62,86 @@ export class CustomWorkflowEngine {
|
|
|
62
62
|
* - Expanded GRAPH.yaml is written to disk before dispatch — inspectable on disk.
|
|
63
63
|
*/
|
|
64
64
|
async resolveDispatch(state, _context) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const iterate = stepDef.iterate;
|
|
79
|
-
// Read source artifact
|
|
80
|
-
const sourcePath = join(this.runDir, iterate.source);
|
|
81
|
-
let sourceContent;
|
|
82
|
-
try {
|
|
83
|
-
sourceContent = readFileSync(sourcePath, "utf-8");
|
|
84
|
-
}
|
|
85
|
-
catch {
|
|
86
|
-
throw new Error(`Iterate source artifact not found: ${sourcePath} (step "${next.id}", source: "${iterate.source}")`);
|
|
87
|
-
}
|
|
88
|
-
// Extract items via regex with global+multiline flags.
|
|
89
|
-
// Guard against ReDoS: if matching takes too long on large inputs, bail.
|
|
90
|
-
const regex = new RegExp(iterate.pattern, "gm");
|
|
91
|
-
const items = [];
|
|
92
|
-
const matchStart = Date.now();
|
|
93
|
-
let match;
|
|
94
|
-
while ((match = regex.exec(sourceContent)) !== null) {
|
|
95
|
-
if (match[1] !== undefined)
|
|
96
|
-
items.push(match[1]);
|
|
97
|
-
if (Date.now() - matchStart > 5_000) {
|
|
98
|
-
throw new Error(`Iterate pattern "${iterate.pattern}" exceeded 5s timeout on step "${next.id}" — possible ReDoS`);
|
|
99
|
-
}
|
|
65
|
+
const graphPath = join(this.runDir, "GRAPH.yaml");
|
|
66
|
+
return await withFileLock(graphPath, () => {
|
|
67
|
+
let graph = readGraph(this.runDir);
|
|
68
|
+
const active = graph.steps.find((step) => step.status === "active");
|
|
69
|
+
if (active) {
|
|
70
|
+
return {
|
|
71
|
+
action: "dispatch",
|
|
72
|
+
step: {
|
|
73
|
+
unitType: "custom-step",
|
|
74
|
+
unitId: `${graph.metadata.name}/${active.id}`,
|
|
75
|
+
prompt: injectContext(this.runDir, active.id, active.prompt),
|
|
76
|
+
},
|
|
77
|
+
};
|
|
100
78
|
}
|
|
101
|
-
|
|
102
|
-
const expandedGraph = expandIteration(graph, next.id, items, next.prompt);
|
|
103
|
-
writeGraph(this.runDir, expandedGraph);
|
|
104
|
-
graph = expandedGraph;
|
|
105
|
-
// Re-query for first instance step
|
|
106
|
-
next = getNextPendingStep(expandedGraph);
|
|
79
|
+
let next = getNextPendingStep(graph);
|
|
107
80
|
if (!next) {
|
|
108
81
|
return {
|
|
109
82
|
action: "stop",
|
|
110
|
-
reason: "
|
|
83
|
+
reason: "All steps complete",
|
|
111
84
|
level: "info",
|
|
112
85
|
};
|
|
113
86
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
87
|
+
// Check frozen DEFINITION.yaml for iterate config on this step
|
|
88
|
+
const def = readFrozenDefinition(this.runDir);
|
|
89
|
+
const stepDef = def.steps.find((s) => s.id === next.id);
|
|
90
|
+
if (stepDef?.iterate) {
|
|
91
|
+
const iterate = stepDef.iterate;
|
|
92
|
+
// Read source artifact
|
|
93
|
+
const sourcePath = join(this.runDir, iterate.source);
|
|
94
|
+
let sourceContent;
|
|
95
|
+
try {
|
|
96
|
+
sourceContent = readFileSync(sourcePath, "utf-8");
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
throw new Error(`Iterate source artifact not found: ${sourcePath} (step "${next.id}", source: "${iterate.source}")`);
|
|
100
|
+
}
|
|
101
|
+
// Extract items via regex with global+multiline flags.
|
|
102
|
+
// Guard against ReDoS: if matching takes too long on large inputs, bail.
|
|
103
|
+
const regex = new RegExp(iterate.pattern, "gm");
|
|
104
|
+
const items = [];
|
|
105
|
+
const matchStart = Date.now();
|
|
106
|
+
let match;
|
|
107
|
+
while ((match = regex.exec(sourceContent)) !== null) {
|
|
108
|
+
if (match[1] !== undefined)
|
|
109
|
+
items.push(match[1]);
|
|
110
|
+
if (Date.now() - matchStart > 5_000) {
|
|
111
|
+
throw new Error(`Iterate pattern "${iterate.pattern}" exceeded 5s timeout on step "${next.id}" — possible ReDoS`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// Expand the graph
|
|
115
|
+
const expandedGraph = expandIteration(graph, next.id, items, next.prompt);
|
|
116
|
+
writeGraph(this.runDir, expandedGraph);
|
|
117
|
+
graph = expandedGraph;
|
|
118
|
+
// Re-query for first instance step
|
|
119
|
+
next = getNextPendingStep(expandedGraph);
|
|
120
|
+
if (!next) {
|
|
121
|
+
return {
|
|
122
|
+
action: "stop",
|
|
123
|
+
reason: "Iterate expansion produced no instances",
|
|
124
|
+
level: "info",
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const activeGraph = markStepActive(graph, next.id);
|
|
129
|
+
writeGraph(this.runDir, activeGraph);
|
|
130
|
+
const activeStep = activeGraph.steps.find((s) => s.id === next.id);
|
|
131
|
+
if (!activeStep) {
|
|
132
|
+
throw new Error(`Active step not found after GRAPH.yaml update: ${next.id}`);
|
|
133
|
+
}
|
|
134
|
+
// Enrich prompt with context from prior step artifacts
|
|
135
|
+
const enrichedPrompt = injectContext(this.runDir, activeStep.id, activeStep.prompt);
|
|
136
|
+
return {
|
|
137
|
+
action: "dispatch",
|
|
138
|
+
step: {
|
|
139
|
+
unitType: "custom-step",
|
|
140
|
+
unitId: `${activeGraph.metadata.name}/${activeStep.id}`,
|
|
141
|
+
prompt: enrichedPrompt,
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
});
|
|
125
145
|
}
|
|
126
146
|
/**
|
|
127
147
|
* Reconcile state after a step completes.
|
|
@@ -353,6 +353,7 @@ export async function saveDecisionToDb(fields, basePath) {
|
|
|
353
353
|
rationale: fields.rationale,
|
|
354
354
|
revisable: fields.revisable ?? 'Yes',
|
|
355
355
|
made_by: fields.made_by ?? 'agent',
|
|
356
|
+
source: fields.source ?? 'discussion',
|
|
356
357
|
superseded_by: null,
|
|
357
358
|
});
|
|
358
359
|
return nextId;
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { atomicWriteSync } from "./atomic-write.js";
|
|
4
|
+
import { gsdRoot } from "./paths.js";
|
|
5
|
+
const DEFAULT_PHASE = "queued";
|
|
6
|
+
const DEFAULT_STATUS = "active";
|
|
7
|
+
const SESSION_FILE_SUFFIX = ".json";
|
|
8
|
+
const MAX_SLUG_LENGTH = 64;
|
|
9
|
+
const MAX_COLLISION_ATTEMPTS = 10_000;
|
|
10
|
+
function debugRoot(basePath) {
|
|
11
|
+
return join(gsdRoot(basePath), "debug");
|
|
12
|
+
}
|
|
13
|
+
export function debugSessionsDir(basePath) {
|
|
14
|
+
return join(debugRoot(basePath), "sessions");
|
|
15
|
+
}
|
|
16
|
+
export function debugSessionArtifactPath(basePath, slug) {
|
|
17
|
+
assertValidDebugSessionSlug(slug);
|
|
18
|
+
return join(debugSessionsDir(basePath), `${slug}${SESSION_FILE_SUFFIX}`);
|
|
19
|
+
}
|
|
20
|
+
export function debugSessionLogPath(basePath, slug) {
|
|
21
|
+
assertValidDebugSessionSlug(slug);
|
|
22
|
+
return join(debugRoot(basePath), `${slug}.log`);
|
|
23
|
+
}
|
|
24
|
+
function ensureSessionsDir(basePath) {
|
|
25
|
+
const dir = debugSessionsDir(basePath);
|
|
26
|
+
if (!existsSync(dir))
|
|
27
|
+
mkdirSync(dir, { recursive: true });
|
|
28
|
+
return dir;
|
|
29
|
+
}
|
|
30
|
+
export function slugifyDebugSessionIssue(issue) {
|
|
31
|
+
const normalized = issue
|
|
32
|
+
.trim()
|
|
33
|
+
.toLowerCase()
|
|
34
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
35
|
+
.replace(/^-+|-+$/g, "")
|
|
36
|
+
.replace(/-{2,}/g, "-")
|
|
37
|
+
.slice(0, MAX_SLUG_LENGTH)
|
|
38
|
+
.replace(/-+$/g, "");
|
|
39
|
+
if (!normalized) {
|
|
40
|
+
throw new Error("Issue text must contain at least one alphanumeric character.");
|
|
41
|
+
}
|
|
42
|
+
return normalized;
|
|
43
|
+
}
|
|
44
|
+
export function assertValidDebugSessionSlug(slug) {
|
|
45
|
+
if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(slug)) {
|
|
46
|
+
throw new Error(`Invalid debug session slug: ${slug}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function isDebugSessionStatus(value) {
|
|
50
|
+
return value === "active" || value === "paused" || value === "resolved" || value === "failed";
|
|
51
|
+
}
|
|
52
|
+
function isDebugCheckpointShape(value) {
|
|
53
|
+
if (!value || typeof value !== "object")
|
|
54
|
+
return false;
|
|
55
|
+
const o = value;
|
|
56
|
+
const validTypes = ["human-verify", "human-action", "decision", "root-cause-found", "inconclusive"];
|
|
57
|
+
return (validTypes.includes(o.type)
|
|
58
|
+
&& typeof o.summary === "string"
|
|
59
|
+
&& typeof o.awaitingResponse === "boolean"
|
|
60
|
+
&& (o.userResponse === undefined || typeof o.userResponse === "string"));
|
|
61
|
+
}
|
|
62
|
+
function isDebugTddGateShape(value) {
|
|
63
|
+
if (!value || typeof value !== "object")
|
|
64
|
+
return false;
|
|
65
|
+
const o = value;
|
|
66
|
+
const validPhases = ["pending", "red", "green"];
|
|
67
|
+
return (typeof o.enabled === "boolean"
|
|
68
|
+
&& validPhases.includes(o.phase)
|
|
69
|
+
&& (o.testFile === undefined || typeof o.testFile === "string")
|
|
70
|
+
&& (o.testName === undefined || typeof o.testName === "string")
|
|
71
|
+
&& (o.failureOutput === undefined || typeof o.failureOutput === "string"));
|
|
72
|
+
}
|
|
73
|
+
function isDebugSpecialistReviewShape(value) {
|
|
74
|
+
if (!value || typeof value !== "object")
|
|
75
|
+
return false;
|
|
76
|
+
const o = value;
|
|
77
|
+
return (typeof o.hint === "string"
|
|
78
|
+
&& (typeof o.skill === "string" || o.skill === null)
|
|
79
|
+
&& typeof o.verdict === "string"
|
|
80
|
+
&& typeof o.detail === "string"
|
|
81
|
+
&& typeof o.reviewedAt === "number");
|
|
82
|
+
}
|
|
83
|
+
function isDebugSessionArtifact(value) {
|
|
84
|
+
if (!value || typeof value !== "object")
|
|
85
|
+
return false;
|
|
86
|
+
const o = value;
|
|
87
|
+
return (o.version === 1
|
|
88
|
+
&& (o.mode === "debug" || o.mode === "diagnose")
|
|
89
|
+
&& typeof o.slug === "string"
|
|
90
|
+
&& typeof o.issue === "string"
|
|
91
|
+
&& isDebugSessionStatus(o.status)
|
|
92
|
+
&& typeof o.phase === "string"
|
|
93
|
+
&& typeof o.createdAt === "number"
|
|
94
|
+
&& typeof o.updatedAt === "number"
|
|
95
|
+
&& typeof o.logPath === "string"
|
|
96
|
+
&& (typeof o.lastError === "string" || o.lastError === null)
|
|
97
|
+
&& (o.checkpoint === undefined || o.checkpoint === null || isDebugCheckpointShape(o.checkpoint))
|
|
98
|
+
&& (o.tddGate === undefined || o.tddGate === null || isDebugTddGateShape(o.tddGate))
|
|
99
|
+
&& (o.specialistReview === undefined || o.specialistReview === null || isDebugSpecialistReviewShape(o.specialistReview)));
|
|
100
|
+
}
|
|
101
|
+
function parseDebugSessionArtifact(filePath, raw) {
|
|
102
|
+
let parsed;
|
|
103
|
+
try {
|
|
104
|
+
parsed = JSON.parse(raw);
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
108
|
+
throw new Error(`Failed to parse debug session artifact ${filePath}: ${message}`);
|
|
109
|
+
}
|
|
110
|
+
if (!isDebugSessionArtifact(parsed)) {
|
|
111
|
+
throw new Error(`Malformed debug session artifact ${filePath}: schema validation failed`);
|
|
112
|
+
}
|
|
113
|
+
return parsed;
|
|
114
|
+
}
|
|
115
|
+
function defaultDeps(deps) {
|
|
116
|
+
return {
|
|
117
|
+
atomicWrite: deps.atomicWrite ?? atomicWriteSync,
|
|
118
|
+
readFile: deps.readFile ?? ((filePath, encoding) => readFileSync(filePath, encoding)),
|
|
119
|
+
listDir: deps.listDir ?? ((dirPath) => readdirSync(dirPath)),
|
|
120
|
+
exists: deps.exists ?? ((filePath) => existsSync(filePath)),
|
|
121
|
+
now: deps.now ?? (() => Date.now()),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function nextSlug(basePath, baseSlug, deps) {
|
|
125
|
+
const baseArtifactPath = debugSessionArtifactPath(basePath, baseSlug);
|
|
126
|
+
if (!deps.exists(baseArtifactPath))
|
|
127
|
+
return baseSlug;
|
|
128
|
+
for (let n = 2; n < MAX_COLLISION_ATTEMPTS; n++) {
|
|
129
|
+
const candidate = `${baseSlug}-${n}`;
|
|
130
|
+
const candidatePath = debugSessionArtifactPath(basePath, candidate);
|
|
131
|
+
if (!deps.exists(candidatePath))
|
|
132
|
+
return candidate;
|
|
133
|
+
}
|
|
134
|
+
throw new Error(`Unable to allocate unique debug session slug for '${baseSlug}'`);
|
|
135
|
+
}
|
|
136
|
+
function serializeArtifact(session) {
|
|
137
|
+
return JSON.stringify(session, null, 2) + "\n";
|
|
138
|
+
}
|
|
139
|
+
export function createDebugSession(basePath, input, deps = {}) {
|
|
140
|
+
const d = defaultDeps(deps);
|
|
141
|
+
const issue = input.issue?.trim() ?? "";
|
|
142
|
+
if (!issue) {
|
|
143
|
+
throw new Error("Issue text is required to create a debug session.");
|
|
144
|
+
}
|
|
145
|
+
ensureSessionsDir(basePath);
|
|
146
|
+
const baseSlug = slugifyDebugSessionIssue(issue);
|
|
147
|
+
const slug = nextSlug(basePath, baseSlug, d);
|
|
148
|
+
const now = input.createdAt ?? d.now();
|
|
149
|
+
const session = {
|
|
150
|
+
version: 1,
|
|
151
|
+
mode: input.mode ?? "debug",
|
|
152
|
+
slug,
|
|
153
|
+
issue,
|
|
154
|
+
status: input.status ?? DEFAULT_STATUS,
|
|
155
|
+
phase: input.phase ?? DEFAULT_PHASE,
|
|
156
|
+
createdAt: now,
|
|
157
|
+
updatedAt: now,
|
|
158
|
+
logPath: debugSessionLogPath(basePath, slug),
|
|
159
|
+
lastError: null,
|
|
160
|
+
};
|
|
161
|
+
const artifactPath = debugSessionArtifactPath(basePath, slug);
|
|
162
|
+
d.atomicWrite(artifactPath, serializeArtifact(session), "utf-8");
|
|
163
|
+
return { artifactPath, session };
|
|
164
|
+
}
|
|
165
|
+
export function loadDebugSession(basePath, slug, deps = {}) {
|
|
166
|
+
assertValidDebugSessionSlug(slug);
|
|
167
|
+
const d = defaultDeps(deps);
|
|
168
|
+
const artifactPath = debugSessionArtifactPath(basePath, slug);
|
|
169
|
+
if (!d.exists(artifactPath))
|
|
170
|
+
return null;
|
|
171
|
+
const raw = d.readFile(artifactPath, "utf-8");
|
|
172
|
+
const session = parseDebugSessionArtifact(artifactPath, raw);
|
|
173
|
+
return { artifactPath, session };
|
|
174
|
+
}
|
|
175
|
+
export function listDebugSessions(basePath, deps = {}) {
|
|
176
|
+
const d = defaultDeps(deps);
|
|
177
|
+
const dir = debugSessionsDir(basePath);
|
|
178
|
+
if (!d.exists(dir))
|
|
179
|
+
return { sessions: [], malformed: [] };
|
|
180
|
+
const entries = d.listDir(dir)
|
|
181
|
+
.filter(entry => entry.endsWith(SESSION_FILE_SUFFIX))
|
|
182
|
+
.sort((a, b) => a.localeCompare(b));
|
|
183
|
+
const sessions = [];
|
|
184
|
+
const malformed = [];
|
|
185
|
+
for (const entry of entries) {
|
|
186
|
+
const artifactPath = join(dir, entry);
|
|
187
|
+
try {
|
|
188
|
+
const raw = d.readFile(artifactPath, "utf-8");
|
|
189
|
+
const session = parseDebugSessionArtifact(artifactPath, raw);
|
|
190
|
+
sessions.push({ artifactPath, session });
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
malformed.push({
|
|
194
|
+
artifactPath,
|
|
195
|
+
message: error instanceof Error ? error.message : String(error),
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
sessions.sort((a, b) => {
|
|
200
|
+
if (a.session.updatedAt !== b.session.updatedAt) {
|
|
201
|
+
return b.session.updatedAt - a.session.updatedAt;
|
|
202
|
+
}
|
|
203
|
+
if (a.session.createdAt !== b.session.createdAt) {
|
|
204
|
+
return b.session.createdAt - a.session.createdAt;
|
|
205
|
+
}
|
|
206
|
+
return a.session.slug.localeCompare(b.session.slug);
|
|
207
|
+
});
|
|
208
|
+
return { sessions, malformed };
|
|
209
|
+
}
|
|
210
|
+
export function updateDebugSession(basePath, slug, update, deps = {}) {
|
|
211
|
+
const d = defaultDeps(deps);
|
|
212
|
+
const loaded = loadDebugSession(basePath, slug, d);
|
|
213
|
+
if (!loaded) {
|
|
214
|
+
throw new Error(`Debug session not found for slug: ${slug}`);
|
|
215
|
+
}
|
|
216
|
+
const nextIssue = update.issue?.trim() ?? loaded.session.issue;
|
|
217
|
+
if (!nextIssue) {
|
|
218
|
+
throw new Error("Issue text cannot be empty.");
|
|
219
|
+
}
|
|
220
|
+
const nextStatus = update.status ?? loaded.session.status;
|
|
221
|
+
if (!isDebugSessionStatus(nextStatus)) {
|
|
222
|
+
throw new Error(`Invalid debug session status: ${String(update.status)}`);
|
|
223
|
+
}
|
|
224
|
+
const nextUpdatedAt = update.updatedAt ?? d.now();
|
|
225
|
+
const session = {
|
|
226
|
+
...loaded.session,
|
|
227
|
+
issue: nextIssue,
|
|
228
|
+
status: nextStatus,
|
|
229
|
+
phase: update.phase ?? loaded.session.phase,
|
|
230
|
+
lastError: update.lastError === undefined ? loaded.session.lastError : update.lastError,
|
|
231
|
+
checkpoint: update.checkpoint === undefined ? loaded.session.checkpoint : update.checkpoint,
|
|
232
|
+
tddGate: update.tddGate === undefined ? loaded.session.tddGate : update.tddGate,
|
|
233
|
+
specialistReview: update.specialistReview === undefined ? loaded.session.specialistReview : update.specialistReview,
|
|
234
|
+
updatedAt: nextUpdatedAt,
|
|
235
|
+
};
|
|
236
|
+
d.atomicWrite(loaded.artifactPath, serializeArtifact(session), "utf-8");
|
|
237
|
+
return { artifactPath: loaded.artifactPath, session };
|
|
238
|
+
}
|
|
@@ -246,6 +246,13 @@ export function validateDefinition(parsed) {
|
|
|
246
246
|
*/
|
|
247
247
|
export function loadDefinition(defsDir, name) {
|
|
248
248
|
const filePath = join(defsDir, `${name}.yaml`);
|
|
249
|
+
return loadDefinitionFromFile(filePath);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Load and validate a YAML workflow definition from an absolute file path.
|
|
253
|
+
* Accepts both `.yaml` and `.yml` extensions.
|
|
254
|
+
*/
|
|
255
|
+
export function loadDefinitionFromFile(filePath) {
|
|
249
256
|
if (!existsSync(filePath)) {
|
|
250
257
|
throw new Error(`Definition file not found: ${filePath}`);
|
|
251
258
|
}
|
|
@@ -130,7 +130,7 @@ Setting `prefer_skills: []` does **not** disable skill discovery — it just mea
|
|
|
130
130
|
- `auto_push`: boolean — automatically push commits to the remote after committing. Default: `false`.
|
|
131
131
|
- `push_branches`: boolean — push the milestone branch to the remote after commits. Default: `false`.
|
|
132
132
|
- `remote`: string — git remote name to push to. Default: `"origin"`.
|
|
133
|
-
- `snapshots`: boolean — create snapshot commits (
|
|
133
|
+
- `snapshots`: boolean — create WIP snapshot commits (e.g. pre-dispatch and stale-uncommitted-changes safety commits emitted by the doctor). Set to `false` to suppress all doctor-initiated `gsd snapshot:` commits. Default: `true`.
|
|
134
134
|
- `pre_merge_check`: boolean or `"auto"` — run pre-merge checks before merging a worktree back to the integration branch. `true` always runs, `false` never runs, `"auto"` runs when CI is detected. Default: `"auto"`.
|
|
135
135
|
- `commit_type`: string — override the conventional commit type prefix. Must be one of: `feat`, `fix`, `refactor`, `docs`, `test`, `chore`, `perf`, `ci`, `build`, `style`. Default: inferred from diff content.
|
|
136
136
|
- `main_branch`: string — the primary branch name for new git repos (e.g., `"main"`, `"master"`, `"trunk"`). Also used by `getMainBranch()` as the preferred branch when auto-detection is ambiguous. Default: `"main"`.
|
|
@@ -197,14 +197,14 @@ Setting `prefer_skills: []` does **not** disable skill discovery — it just mea
|
|
|
197
197
|
- `enabled`: boolean — enable kernel wrappers and contract observers. Default: `true`.
|
|
198
198
|
- `legacy_fallback.enabled`: boolean — emergency release fallback that forces legacy orchestration behavior even when `uok.enabled` is `true`. Default: `false`.
|
|
199
199
|
- Runtime override: set `GSD_UOK_FORCE_LEGACY=1` (or `GSD_UOK_LEGACY_FALLBACK=1`) to force legacy behavior for the current process.
|
|
200
|
-
- `gates.enabled`: boolean — route checks through the unified gate runner and persist `gate_runs`.
|
|
201
|
-
- `model_policy.enabled`: boolean — enforce policy filtering before model capability scoring.
|
|
202
|
-
- `execution_graph.enabled`: boolean — enable DAG scheduler facade/adapters for execution.
|
|
203
|
-
- `gitops.enabled`: boolean — persist turn-level git transaction records.
|
|
204
|
-
- `gitops.turn_action`: `"commit"` | `"snapshot"` | `"status-only"` — turn transaction mode.
|
|
205
|
-
- `gitops.turn_push`: boolean — whether turn transactions should include push intent metadata.
|
|
206
|
-
- `audit_unified.enabled`: boolean — dual-write unified audit envelope events.
|
|
207
|
-
- `plan_v2.enabled`: boolean — enable bounded clarify/research/draft/compile planning flow.
|
|
200
|
+
- `gates.enabled`: boolean — route checks through the unified gate runner and persist `gate_runs`. Default: `true`.
|
|
201
|
+
- `model_policy.enabled`: boolean — enforce policy filtering before model capability scoring. Default: `true`.
|
|
202
|
+
- `execution_graph.enabled`: boolean — enable DAG scheduler facade/adapters for execution. Default: `true`.
|
|
203
|
+
- `gitops.enabled`: boolean — persist turn-level git transaction records. Default: `true`.
|
|
204
|
+
- `gitops.turn_action`: `"commit"` | `"snapshot"` | `"status-only"` — turn transaction mode. Default: `"commit"` (per-task atomic commits).
|
|
205
|
+
- `gitops.turn_push`: boolean — whether turn transactions should include push intent metadata. Default: `false`.
|
|
206
|
+
- `audit_unified.enabled`: boolean — dual-write unified audit envelope events. Default: `true`.
|
|
207
|
+
- `plan_v2.enabled`: boolean — enable bounded clarify/research/draft/compile planning flow. Default: `true`.
|
|
208
208
|
|
|
209
209
|
- `context_management`: configures context hygiene for auto-mode sessions. Keys:
|
|
210
210
|
- `observation_masking`: boolean — mask old tool results to reduce context bloat. Default: `true`.
|
|
@@ -365,8 +365,12 @@ export async function checkGitHealth(basePath, issues, fixesApplied, shouldFix,
|
|
|
365
365
|
// auto-commit a safety snapshot so work isn't lost.
|
|
366
366
|
try {
|
|
367
367
|
const prefs = loadEffectiveGSDPreferences()?.preferences ?? {};
|
|
368
|
+
// `git.snapshots: false` is the canonical toggle that disables WIP
|
|
369
|
+
// snapshot commits — honour it here as well so both the proactive gate
|
|
370
|
+
// and the doctor-run path stay consistent (#4420).
|
|
371
|
+
const snapshotsEnabled = prefs.git?.snapshots !== false;
|
|
368
372
|
const thresholdMinutes = prefs.stale_commit_threshold_minutes ?? 30;
|
|
369
|
-
if (thresholdMinutes > 0) {
|
|
373
|
+
if (snapshotsEnabled && thresholdMinutes > 0) {
|
|
370
374
|
const dirty = nativeHasChanges(basePath);
|
|
371
375
|
if (dirty) {
|
|
372
376
|
const branch = nativeGetCurrentBranch(basePath);
|
|
@@ -238,8 +238,11 @@ export async function preDispatchHealthGate(basePath) {
|
|
|
238
238
|
try {
|
|
239
239
|
if (nativeIsRepo(basePath)) {
|
|
240
240
|
const prefs = loadEffectiveGSDPreferences()?.preferences ?? {};
|
|
241
|
+
// `git.snapshots: false` is the canonical toggle that disables WIP
|
|
242
|
+
// snapshot commits — honour it before touching the threshold path (#4420).
|
|
243
|
+
const snapshotsEnabled = prefs.git?.snapshots !== false;
|
|
241
244
|
const thresholdMinutes = prefs.stale_commit_threshold_minutes ?? 30;
|
|
242
|
-
if (thresholdMinutes > 0 && nativeHasChanges(basePath)) {
|
|
245
|
+
if (snapshotsEnabled && thresholdMinutes > 0 && nativeHasChanges(basePath)) {
|
|
243
246
|
const branch = nativeGetCurrentBranch(basePath);
|
|
244
247
|
const lastEpoch = nativeLastCommitEpoch(basePath, branch || "HEAD");
|
|
245
248
|
const nowEpoch = Math.floor(Date.now() / 1000);
|
|
@@ -11,10 +11,32 @@
|
|
|
11
11
|
* - Optional search/tool integrations (Brave, Tavily, Jina, Context7)
|
|
12
12
|
*/
|
|
13
13
|
import { existsSync } from "node:fs";
|
|
14
|
+
import { join } from "node:path";
|
|
14
15
|
import { AuthStorage } from "@gsd/pi-coding-agent";
|
|
15
16
|
import { getEnvApiKey } from "@gsd/pi-ai";
|
|
16
17
|
import { loadEffectiveGSDPreferences } from "./preferences.js";
|
|
17
18
|
import { getAuthPath, PROVIDER_REGISTRY } from "./key-manager.js";
|
|
19
|
+
// ── Provider routing constants ────────────────────────────────────────────────
|
|
20
|
+
/**
|
|
21
|
+
* Providers that use external CLI authentication (not API keys).
|
|
22
|
+
* These are always considered "found" — the host CLI handles auth.
|
|
23
|
+
*/
|
|
24
|
+
const CLI_AUTH_PROVIDERS = new Set([
|
|
25
|
+
"claude-code",
|
|
26
|
+
"openai-codex",
|
|
27
|
+
"google-gemini-cli",
|
|
28
|
+
"google-antigravity",
|
|
29
|
+
]);
|
|
30
|
+
/**
|
|
31
|
+
* Providers that can serve models normally associated with another provider.
|
|
32
|
+
* Key = the provider whose models can be served, Value = alternative providers to check.
|
|
33
|
+
* e.g. GitHub Copilot subscriptions can access Claude and GPT models.
|
|
34
|
+
*/
|
|
35
|
+
const PROVIDER_ROUTES = {
|
|
36
|
+
anthropic: ["github-copilot", "claude-code"],
|
|
37
|
+
openai: ["github-copilot", "openai-codex"],
|
|
38
|
+
google: ["google-gemini-cli"],
|
|
39
|
+
};
|
|
18
40
|
// ── Model → Provider ID mapping ───────────────────────────────────────────────
|
|
19
41
|
/**
|
|
20
42
|
* Infer the auth provider ID from a model string.
|
|
@@ -96,8 +118,34 @@ function collectConfiguredModelProviders() {
|
|
|
96
118
|
providers.add("anthropic");
|
|
97
119
|
return providers;
|
|
98
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Map of CLI provider IDs to their binary names on disk.
|
|
123
|
+
* Used for lightweight binary-presence checks (PATH scan, no subprocess).
|
|
124
|
+
*/
|
|
125
|
+
const CLI_BINARY_MAP = {
|
|
126
|
+
"claude-code": "claude",
|
|
127
|
+
"openai-codex": "codex",
|
|
128
|
+
"google-gemini-cli": "gemini",
|
|
129
|
+
"google-antigravity": "antigravity",
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Check if a CLI provider's binary exists anywhere in PATH.
|
|
133
|
+
* Fast filesystem scan — no subprocess, no network, sub-1ms.
|
|
134
|
+
*/
|
|
135
|
+
function isCliBinaryInPath(providerId) {
|
|
136
|
+
const binary = CLI_BINARY_MAP[providerId];
|
|
137
|
+
if (!binary)
|
|
138
|
+
return false;
|
|
139
|
+
const pathDirs = (process.env.PATH ?? "").split(":");
|
|
140
|
+
return pathDirs.some(dir => dir && existsSync(join(dir, binary)));
|
|
141
|
+
}
|
|
99
142
|
function resolveKey(providerId) {
|
|
100
143
|
const info = PROVIDER_REGISTRY.find(p => p.id === providerId);
|
|
144
|
+
// claude-code never stores credentials in auth.json — GSD delegates entirely to
|
|
145
|
+
// the local CLI binary. Presence of the binary in PATH is the only signal.
|
|
146
|
+
if (providerId === "claude-code") {
|
|
147
|
+
return { found: isCliBinaryInPath("claude-code"), source: "env", backedOff: false };
|
|
148
|
+
}
|
|
101
149
|
if (providerId === "anthropic-vertex" && process.env.ANTHROPIC_VERTEX_PROJECT_ID) {
|
|
102
150
|
return { found: true, source: "env", backedOff: false };
|
|
103
151
|
}
|
|
@@ -137,26 +185,6 @@ function resolveKey(providerId) {
|
|
|
137
185
|
return { found: false, source: "none", backedOff: false };
|
|
138
186
|
}
|
|
139
187
|
// ── Individual check groups ────────────────────────────────────────────────────
|
|
140
|
-
/**
|
|
141
|
-
* Providers that can serve models normally associated with another provider.
|
|
142
|
-
* Key = the provider whose models can be served, Value = alternative providers to check.
|
|
143
|
-
* e.g. GitHub Copilot subscriptions can access Claude and GPT models.
|
|
144
|
-
*/
|
|
145
|
-
const PROVIDER_ROUTES = {
|
|
146
|
-
anthropic: ["github-copilot"],
|
|
147
|
-
openai: ["github-copilot", "openai-codex"],
|
|
148
|
-
google: ["google-gemini-cli"],
|
|
149
|
-
};
|
|
150
|
-
/**
|
|
151
|
-
* Providers that use external CLI authentication (not API keys).
|
|
152
|
-
* These are always considered "ok" — the host CLI handles auth.
|
|
153
|
-
*/
|
|
154
|
-
const CLI_AUTH_PROVIDERS = new Set([
|
|
155
|
-
"claude-code",
|
|
156
|
-
"openai-codex",
|
|
157
|
-
"google-gemini-cli",
|
|
158
|
-
"google-antigravity",
|
|
159
|
-
]);
|
|
160
188
|
function checkLlmProviders() {
|
|
161
189
|
const required = collectConfiguredModelProviders();
|
|
162
190
|
const results = [];
|
|
@@ -6,9 +6,10 @@ import { deriveState } from "./state.js";
|
|
|
6
6
|
import { saveFile } from "./files.js";
|
|
7
7
|
import { nativeIsRepo, nativeForEachRef, nativeUpdateRef } from "./native-git-bridge.js";
|
|
8
8
|
import { readCrashLock, isLockProcessAlive, clearLock } from "./crash-recovery.js";
|
|
9
|
-
import { ensureGitignore } from "./gitignore.js";
|
|
9
|
+
import { ensureGitignore, isGsdGitignored } from "./gitignore.js";
|
|
10
10
|
import { readAllSessionStatuses, isSessionStale, removeSessionStatus } from "./session-status-io.js";
|
|
11
11
|
import { recoverFailedMigration } from "./migrate-external.js";
|
|
12
|
+
import { splitCompletedKey } from "./forensics.js";
|
|
12
13
|
export async function checkRuntimeHealth(basePath, issues, fixesApplied, shouldFix) {
|
|
13
14
|
const root = gsdRoot(basePath);
|
|
14
15
|
// ── Stale crash lock ──────────────────────────────────────────────────
|
|
@@ -107,9 +108,6 @@ export async function checkRuntimeHealth(basePath, issues, fixesApplied, shouldF
|
|
|
107
108
|
const keys = JSON.parse(raw);
|
|
108
109
|
const orphaned = [];
|
|
109
110
|
for (const key of keys) {
|
|
110
|
-
// Key format: "unitType/unitId" e.g. "execute-task/M001/S01/T01"
|
|
111
|
-
// Hook units have compound types: "hook/<hookName>/unitId"
|
|
112
|
-
const { splitCompletedKey } = await import("./forensics.js");
|
|
113
111
|
const parsed = splitCompletedKey(key);
|
|
114
112
|
if (!parsed)
|
|
115
113
|
continue;
|
|
@@ -352,6 +350,26 @@ export async function checkRuntimeHealth(basePath, issues, fixesApplied, shouldF
|
|
|
352
350
|
fixable: false,
|
|
353
351
|
});
|
|
354
352
|
}
|
|
353
|
+
// ── Symlinked .gsd without .gitignore entry (#4423) ──
|
|
354
|
+
// When `.gsd` is a symlink AND not gitignored, `git add -A -- :!.gsd/...`
|
|
355
|
+
// pathspecs fail with "beyond a symbolic link". Without self-heal this
|
|
356
|
+
// silently drops new user files during auto-commit.
|
|
357
|
+
if (nativeIsRepo(basePath) && !isGsdGitignored(basePath)) {
|
|
358
|
+
issues.push({
|
|
359
|
+
severity: "warning",
|
|
360
|
+
code: "symlinked_gsd_unignored",
|
|
361
|
+
scope: "project",
|
|
362
|
+
unitId: "project",
|
|
363
|
+
message: ".gsd is a symlink to external state but is not listed in .gitignore. This causes git pathspec exclusions to fail and can lead to silently dropped new files during auto-commit. Add `.gsd` to .gitignore.",
|
|
364
|
+
file: ".gitignore",
|
|
365
|
+
fixable: true,
|
|
366
|
+
});
|
|
367
|
+
if (shouldFix("symlinked_gsd_unignored")) {
|
|
368
|
+
const modified = ensureGitignore(basePath);
|
|
369
|
+
if (modified)
|
|
370
|
+
fixesApplied.push("added .gsd to .gitignore (symlinked external state)");
|
|
371
|
+
}
|
|
372
|
+
}
|
|
355
373
|
}
|
|
356
374
|
}
|
|
357
375
|
}
|
|
@@ -154,8 +154,14 @@ function auditRequirements(content) {
|
|
|
154
154
|
const owner = block.match(/^-\s+Primary owning slice:\s+(.+)$/m)?.[1]?.trim().toLowerCase() ?? "";
|
|
155
155
|
const notes = block.match(/^-\s+Notes:\s+(.+)$/m)?.[1]?.trim().toLowerCase() ?? "";
|
|
156
156
|
if (status === "active" && (!owner || owner === "none" || owner === "none yet")) {
|
|
157
|
+
// #4414: Downgrade to warning. A newly-created requirement has
|
|
158
|
+
// primary_owner='' by default until the planning agent wires it to
|
|
159
|
+
// a slice via gsd_requirement_update. Flagging this as an error
|
|
160
|
+
// during normal planning is noisy — the real failure mode is when
|
|
161
|
+
// it persists past milestone completion, which is covered by other
|
|
162
|
+
// audits. Keep the signal but don't treat it as a blocker.
|
|
157
163
|
issues.push({
|
|
158
|
-
severity: "
|
|
164
|
+
severity: "warning",
|
|
159
165
|
code: "active_requirement_missing_owner",
|
|
160
166
|
scope: "project",
|
|
161
167
|
unitId: requirementId,
|