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
|
@@ -22,11 +22,51 @@ import { readPhaseAnchor, formatAnchorForPrompt } from "./phase-anchor.js";
|
|
|
22
22
|
import { logWarning } from "./workflow-logger.js";
|
|
23
23
|
import { inlineGraphSubgraph } from "./graph-context.js";
|
|
24
24
|
// ─── Preamble Cap ─────────────────────────────────────────────────────────────
|
|
25
|
+
/**
|
|
26
|
+
* Historical static ceiling for the preamble cap. Kept as an upper bound even
|
|
27
|
+
* after context-window-aware sizing so large-window users don't suddenly see
|
|
28
|
+
* 10× looser caps than before. Small-window users get a tighter cap derived
|
|
29
|
+
* from their configured executor window.
|
|
30
|
+
*/
|
|
25
31
|
const MAX_PREAMBLE_CHARS = 30_000;
|
|
32
|
+
/**
|
|
33
|
+
* Resolve prompt budgets from the configured executor context window.
|
|
34
|
+
*
|
|
35
|
+
* The prompt builders here don't have access to the runtime model registry
|
|
36
|
+
* (they're called from many non-ctx sites), so `resolveExecutorContextWindow`
|
|
37
|
+
* is fed the user-configurable `context_window_override` preference as the
|
|
38
|
+
* `sessionContextWindow` fallback. That preference exists specifically to
|
|
39
|
+
* cover small-window local models (e.g. 32K lemonade/llama.cpp servers) whose
|
|
40
|
+
* n_ctx is not discoverable through the model registry. Issue #4435.
|
|
41
|
+
*/
|
|
42
|
+
function resolvePromptBudgets() {
|
|
43
|
+
try {
|
|
44
|
+
const prefs = loadEffectiveGSDPreferences();
|
|
45
|
+
const sessionWindow = prefs?.preferences.context_window_override;
|
|
46
|
+
const windowTokens = resolveExecutorContextWindow(undefined, prefs?.preferences, sessionWindow);
|
|
47
|
+
return computeBudgets(windowTokens);
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
logWarning("prompt", `resolvePromptBudgets failed: ${e.message}`);
|
|
51
|
+
return computeBudgets(200_000);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Character budget for dependency/prior slice summaries injected into dispatch
|
|
56
|
+
* prompts. Scales with the executor's configured context window (issue #4435).
|
|
57
|
+
*/
|
|
58
|
+
function resolveSummaryBudgetChars() {
|
|
59
|
+
return resolvePromptBudgets().summaryBudgetChars;
|
|
60
|
+
}
|
|
26
61
|
function capPreamble(preamble) {
|
|
27
|
-
|
|
62
|
+
// Cap inlined context at min(historical 30K ceiling, scaled inline budget).
|
|
63
|
+
// The ceiling preserves pre-fix behavior for large-window users; the scaled
|
|
64
|
+
// budget tightens the cap for small-window users whose true safe limit is
|
|
65
|
+
// below 30K. `computeBudgets` allocates 40% of total chars to inline context.
|
|
66
|
+
const budget = Math.min(MAX_PREAMBLE_CHARS, resolvePromptBudgets().inlineContextBudgetChars);
|
|
67
|
+
if (preamble.length <= budget)
|
|
28
68
|
return preamble;
|
|
29
|
-
return truncateAtSectionBoundary(preamble,
|
|
69
|
+
return truncateAtSectionBoundary(preamble, budget).content;
|
|
30
70
|
}
|
|
31
71
|
// ─── Executor Constraints ─────────────────────────────────────────────────────
|
|
32
72
|
/**
|
|
@@ -872,13 +912,13 @@ export async function checkNeedsRunUat(base, mid, state, prefs) {
|
|
|
872
912
|
* as a seed when present. The discussion agent interviews the user, writes
|
|
873
913
|
* a full CONTEXT.md, and the phase transitions to pre-planning automatically.
|
|
874
914
|
*/
|
|
875
|
-
export async function buildDiscussMilestonePrompt(mid, midTitle, base) {
|
|
915
|
+
export async function buildDiscussMilestonePrompt(mid, midTitle, base, structuredQuestionsAvailable = "false") {
|
|
876
916
|
const discussTemplates = inlineTemplate("context", "Context");
|
|
877
917
|
const basePrompt = loadPrompt("guided-discuss-milestone", {
|
|
878
918
|
milestoneId: mid,
|
|
879
919
|
milestoneTitle: midTitle,
|
|
880
920
|
inlinedTemplates: discussTemplates,
|
|
881
|
-
structuredQuestionsAvailable
|
|
921
|
+
structuredQuestionsAvailable,
|
|
882
922
|
commitInstruction: "Do not commit planning artifacts — .gsd/ is managed externally.",
|
|
883
923
|
fastPathInstruction: "",
|
|
884
924
|
});
|
|
@@ -1046,7 +1086,7 @@ export async function buildResearchSlicePrompt(mid, _midTitle, sid, sTitle, base
|
|
|
1046
1086
|
if (graphBlockRS)
|
|
1047
1087
|
inlined.push(graphBlockRS);
|
|
1048
1088
|
inlined.push(inlineTemplate("research", "Research"));
|
|
1049
|
-
const depContent = await inlineDependencySummaries(mid, sid, base);
|
|
1089
|
+
const depContent = await inlineDependencySummaries(mid, sid, base, resolveSummaryBudgetChars());
|
|
1050
1090
|
const activeOverrides = await loadActiveOverrides(base);
|
|
1051
1091
|
const overridesInline = formatOverridesSection(activeOverrides);
|
|
1052
1092
|
if (overridesInline)
|
|
@@ -1073,26 +1113,35 @@ export async function buildResearchSlicePrompt(mid, _midTitle, sid, sTitle, base
|
|
|
1073
1113
|
...buildSkillDiscoveryVars(),
|
|
1074
1114
|
});
|
|
1075
1115
|
}
|
|
1076
|
-
|
|
1077
|
-
|
|
1116
|
+
/**
|
|
1117
|
+
* Shared assembly for plan-slice and refine-slice prompts. Both builders need
|
|
1118
|
+
* the same inlined context (roadmap excerpt, slice context, research, decisions,
|
|
1119
|
+
* requirements, knowledge, graph subgraph, templates, dependency summaries,
|
|
1120
|
+
* overrides). Extracted to prevent drift between the two sites.
|
|
1121
|
+
*
|
|
1122
|
+
* `prependBlocks` are pushed onto the start of the inlined array BEFORE any
|
|
1123
|
+
* shared content, so callers can add unit-specific headers (e.g., the refine
|
|
1124
|
+
* sketch-scope constraint).
|
|
1125
|
+
*/
|
|
1126
|
+
async function renderSlicePrompt(options) {
|
|
1127
|
+
const { mid, sid, sTitle, base, level, promptTemplate, prependBlocks = [], extraVars = {} } = options;
|
|
1078
1128
|
const roadmapPath = resolveMilestoneFile(base, mid, "ROADMAP");
|
|
1079
1129
|
const roadmapRel = relMilestoneFile(base, mid, "ROADMAP");
|
|
1080
1130
|
const researchPath = resolveSliceFile(base, mid, sid, "RESEARCH");
|
|
1081
1131
|
const researchRel = relSliceFile(base, mid, sid, "RESEARCH");
|
|
1082
1132
|
const sliceContextPath = resolveSliceFile(base, mid, sid, "CONTEXT");
|
|
1083
1133
|
const sliceContextRel = relSliceFile(base, mid, sid, "CONTEXT");
|
|
1084
|
-
const inlined = [];
|
|
1085
|
-
//
|
|
1134
|
+
const inlined = [...prependBlocks];
|
|
1135
|
+
// Phase handoff anchor from research phase (if available)
|
|
1086
1136
|
const researchSliceAnchor = readPhaseAnchor(base, mid, "research-slice");
|
|
1087
1137
|
if (researchSliceAnchor)
|
|
1088
1138
|
inlined.push(formatAnchorForPrompt(researchSliceAnchor));
|
|
1089
|
-
//
|
|
1090
|
-
const
|
|
1091
|
-
if (
|
|
1092
|
-
inlined.push(
|
|
1139
|
+
// Roadmap excerpt with full-roadmap fallback
|
|
1140
|
+
const roadmapExcerpt = await inlineRoadmapExcerpt(base, mid, sid);
|
|
1141
|
+
if (roadmapExcerpt) {
|
|
1142
|
+
inlined.push(roadmapExcerpt);
|
|
1093
1143
|
}
|
|
1094
1144
|
else {
|
|
1095
|
-
// Fall back to full roadmap if excerpt fails
|
|
1096
1145
|
inlined.push(await inlineFile(roadmapPath, roadmapRel, "Milestone Roadmap"));
|
|
1097
1146
|
}
|
|
1098
1147
|
const sliceCtxInline = await inlineFileOptional(sliceContextPath, sliceContextRel, "Slice Context (from discussion)");
|
|
@@ -1101,40 +1150,34 @@ export async function buildPlanSlicePrompt(mid, _midTitle, sid, sTitle, base, le
|
|
|
1101
1150
|
const researchInline = await inlineFileOptional(researchPath, researchRel, "Slice Research");
|
|
1102
1151
|
if (researchInline)
|
|
1103
1152
|
inlined.push(researchInline);
|
|
1104
|
-
if (
|
|
1105
|
-
|
|
1106
|
-
const
|
|
1107
|
-
const decisionsInline = await inlineDecisionsFromDb(base, mid, derivedScopePS, inlineLevel);
|
|
1153
|
+
if (level !== "minimal") {
|
|
1154
|
+
const derivedScope = deriveSliceScope(sTitle);
|
|
1155
|
+
const decisionsInline = await inlineDecisionsFromDb(base, mid, derivedScope, level);
|
|
1108
1156
|
if (decisionsInline)
|
|
1109
1157
|
inlined.push(decisionsInline);
|
|
1110
|
-
const requirementsInline = await inlineRequirementsFromDb(base, mid, sid,
|
|
1158
|
+
const requirementsInline = await inlineRequirementsFromDb(base, mid, sid, level);
|
|
1111
1159
|
if (requirementsInline)
|
|
1112
1160
|
inlined.push(requirementsInline);
|
|
1113
1161
|
}
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
const graphBlockPS = await inlineGraphSubgraph(base, `${sid} ${sTitle}`, { budget: 3000 });
|
|
1121
|
-
if (graphBlockPS)
|
|
1122
|
-
inlined.push(graphBlockPS);
|
|
1162
|
+
const knowledgeInline = await inlineKnowledgeScoped(base, extractKeywords(sTitle));
|
|
1163
|
+
if (knowledgeInline)
|
|
1164
|
+
inlined.push(knowledgeInline);
|
|
1165
|
+
const graphBlock = await inlineGraphSubgraph(base, `${sid} ${sTitle}`, { budget: 3000 });
|
|
1166
|
+
if (graphBlock)
|
|
1167
|
+
inlined.push(graphBlock);
|
|
1123
1168
|
inlined.push(inlineTemplate("plan", "Slice Plan"));
|
|
1124
|
-
if (
|
|
1169
|
+
if (level === "full") {
|
|
1125
1170
|
inlined.push(inlineTemplate("task-plan", "Task Plan"));
|
|
1126
1171
|
}
|
|
1127
|
-
const depContent = await inlineDependencySummaries(mid, sid, base);
|
|
1128
|
-
const
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
inlined.unshift(planOverridesInline);
|
|
1172
|
+
const depContent = await inlineDependencySummaries(mid, sid, base, resolveSummaryBudgetChars());
|
|
1173
|
+
const overridesInline = formatOverridesSection(await loadActiveOverrides(base));
|
|
1174
|
+
if (overridesInline)
|
|
1175
|
+
inlined.unshift(overridesInline);
|
|
1132
1176
|
const inlinedContext = capPreamble(`## Inlined Context (preloaded — do not re-read these files)\n\n${inlined.join("\n\n---\n\n")}`);
|
|
1133
|
-
// Build executor context constraints from the budget engine
|
|
1134
1177
|
const executorContextConstraints = formatExecutorConstraints();
|
|
1135
1178
|
const outputRelPath = relSliceFile(base, mid, sid, "PLAN");
|
|
1136
1179
|
const commitInstruction = "Do not commit — .gsd/ planning docs are managed externally and not tracked in git.";
|
|
1137
|
-
return loadPrompt(
|
|
1180
|
+
return loadPrompt(promptTemplate, {
|
|
1138
1181
|
workingDirectory: base,
|
|
1139
1182
|
milestoneId: mid, sliceId: sid, sliceTitle: sTitle,
|
|
1140
1183
|
slicePath: relSlicePath(base, mid, sid),
|
|
@@ -1153,6 +1196,56 @@ export async function buildPlanSlicePrompt(mid, _midTitle, sid, sTitle, base, le
|
|
|
1153
1196
|
sliceTitle: sTitle,
|
|
1154
1197
|
extraContext: [inlinedContext, depContent],
|
|
1155
1198
|
}),
|
|
1199
|
+
...extraVars,
|
|
1200
|
+
});
|
|
1201
|
+
}
|
|
1202
|
+
export async function buildPlanSlicePrompt(mid, _midTitle, sid, sTitle, base, level, options) {
|
|
1203
|
+
const prependBlocks = [];
|
|
1204
|
+
// ADR-011: when the refining-phase dispatch rule gracefully downgrades to
|
|
1205
|
+
// plan-slice (progressive_planning was toggled off mid-milestone), it
|
|
1206
|
+
// forwards the stored sketch_scope as a SOFT hint — context, not a hard
|
|
1207
|
+
// constraint. The planner is free to expand beyond it.
|
|
1208
|
+
if (options?.softScopeHint && options.softScopeHint.trim().length > 0) {
|
|
1209
|
+
prependBlocks.push(`## Prior Sketch Scope (soft hint — non-binding)\n\n${options.softScopeHint.trim()}\n\n` +
|
|
1210
|
+
`This scope was captured during an earlier progressive-planning pass that was later disabled. Treat it as context only — you may plan beyond it if the work genuinely requires more scope. Do NOT treat this as a hard boundary.`);
|
|
1211
|
+
}
|
|
1212
|
+
return renderSlicePrompt({
|
|
1213
|
+
mid, sid, sTitle, base,
|
|
1214
|
+
level: level ?? resolveInlineLevel(),
|
|
1215
|
+
promptTemplate: "plan-slice",
|
|
1216
|
+
prependBlocks,
|
|
1217
|
+
});
|
|
1218
|
+
}
|
|
1219
|
+
/**
|
|
1220
|
+
* ADR-011 refine-slice: expand a sketch into a full plan using the current
|
|
1221
|
+
* codebase state and prior slice summary. Mechanically similar to plan-slice
|
|
1222
|
+
* but framed as a *transformation* (sketch → full plan) rather than a
|
|
1223
|
+
* blank-sheet planning pass. Reuses inlineDependencySummaries for prior
|
|
1224
|
+
* slice SUMMARY and inlines the stored sketch_scope as a hard constraint.
|
|
1225
|
+
*/
|
|
1226
|
+
export async function buildRefineSlicePrompt(mid, _midTitle, sid, sTitle, base, level) {
|
|
1227
|
+
// Pull the stored sketch scope from the DB — the hard constraint we plan within.
|
|
1228
|
+
let sketchScope = "";
|
|
1229
|
+
try {
|
|
1230
|
+
const { isDbAvailable, getSlice } = await import("./gsd-db.js");
|
|
1231
|
+
if (isDbAvailable()) {
|
|
1232
|
+
sketchScope = getSlice(mid, sid)?.sketch_scope ?? "";
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
catch {
|
|
1236
|
+
sketchScope = "";
|
|
1237
|
+
}
|
|
1238
|
+
const prependBlocks = [];
|
|
1239
|
+
if (sketchScope.trim().length > 0) {
|
|
1240
|
+
prependBlocks.push(`## Sketch Scope (hard constraint)\n\n${sketchScope.trim()}\n\n` +
|
|
1241
|
+
`Treat this as the authoritative boundary for the slice. Do not plan work outside this scope; if the scope is too narrow, surface it as a deviation rather than expanding silently.`);
|
|
1242
|
+
}
|
|
1243
|
+
return renderSlicePrompt({
|
|
1244
|
+
mid, sid, sTitle, base,
|
|
1245
|
+
level: level ?? resolveInlineLevel(),
|
|
1246
|
+
promptTemplate: "refine-slice",
|
|
1247
|
+
prependBlocks,
|
|
1248
|
+
extraVars: { sketchScope },
|
|
1156
1249
|
});
|
|
1157
1250
|
}
|
|
1158
1251
|
export async function buildExecuteTaskPrompt(mid, sid, sTitle, tid, tTitle, base, level) {
|
|
@@ -1233,7 +1326,28 @@ export async function buildExecuteTaskPrompt(mid, sid, sTitle, tid, tTitle, base
|
|
|
1233
1326
|
const runtimeContext = runtimeContent
|
|
1234
1327
|
? `### Runtime Context\nSource: \`.gsd/RUNTIME.md\`\n\n${runtimeContent.trim()}`
|
|
1235
1328
|
: "";
|
|
1236
|
-
|
|
1329
|
+
let phaseAnchorSection = planAnchor ? formatAnchorForPrompt(planAnchor) : "";
|
|
1330
|
+
// ADR-011 Phase 2: inject any resolved-but-unapplied escalation override
|
|
1331
|
+
// into this task's prompt. Claim is atomic via DB UPDATE WHERE IS NULL, so
|
|
1332
|
+
// if a parallel build already injected it, we skip. Feature-gated by
|
|
1333
|
+
// phases.mid_execution_escalation. Prepended to phaseAnchorSection so it
|
|
1334
|
+
// appears near the top of the prompt above planning anchors.
|
|
1335
|
+
if (prefs?.preferences?.phases?.mid_execution_escalation === true) {
|
|
1336
|
+
try {
|
|
1337
|
+
const { claimOverrideForInjection } = await import("./escalation.js");
|
|
1338
|
+
const claimed = claimOverrideForInjection(base, mid, sid);
|
|
1339
|
+
if (claimed) {
|
|
1340
|
+
const block = claimed.injectionBlock + "\n\n---\n\n";
|
|
1341
|
+
phaseAnchorSection = phaseAnchorSection
|
|
1342
|
+
? `${block}${phaseAnchorSection}`
|
|
1343
|
+
: block;
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
catch (escalationErr) {
|
|
1347
|
+
// Escalation module unavailable or threw — log and proceed.
|
|
1348
|
+
logWarning("prompt", `escalation override injection failed: ${escalationErr.message}`);
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1237
1351
|
// Task-scoped gates owned by execute-task (Q5/Q6/Q7). Pull only the
|
|
1238
1352
|
// gates that plan-slice actually seeded for this task — tasks with no
|
|
1239
1353
|
// external dependencies legitimately skip Q5, tasks with no runtime
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { parseUnitId } from "./unit-id.js";
|
|
10
10
|
import { appendEvent } from "./workflow-events.js";
|
|
11
|
+
import { atomicWriteSync } from "./atomic-write.js";
|
|
11
12
|
import { clearParseCache } from "./files.js";
|
|
12
13
|
import { parseRoadmap as parseLegacyRoadmap, parsePlan as parseLegacyPlan } from "./parsers-legacy.js";
|
|
13
14
|
import { isDbAvailable, getTask, getSlice, getSliceTasks, getPendingGates, updateTaskStatus, updateSliceStatus } from "./gsd-db.js";
|
|
@@ -212,6 +213,47 @@ export function verifyExpectedArtifact(unitType, unitId, base) {
|
|
|
212
213
|
}
|
|
213
214
|
return true;
|
|
214
215
|
}
|
|
216
|
+
// #4414: research-slice parallel-research sentinel. The unitId
|
|
217
|
+
// `{mid}/parallel-research` is not a real slice — it triggers a single agent
|
|
218
|
+
// that fans out research across multiple slices. Verify success by checking
|
|
219
|
+
// that every slice which was "research-ready" in the roadmap now has a
|
|
220
|
+
// RESEARCH file. Without this, resolveExpectedArtifactPath returns null and
|
|
221
|
+
// the retry/escalation machinery silently re-dispatches forever.
|
|
222
|
+
//
|
|
223
|
+
// NOTE: this predicate mirrors the dispatch rule at
|
|
224
|
+
// auto-dispatch.ts parallel-research-slices — keep the two in sync.
|
|
225
|
+
if (unitType === "research-slice" && unitId.endsWith("/parallel-research")) {
|
|
226
|
+
const { milestone: mid } = parseUnitId(unitId);
|
|
227
|
+
if (!mid)
|
|
228
|
+
return false;
|
|
229
|
+
const roadmapFile = resolveMilestoneFile(base, mid, "ROADMAP");
|
|
230
|
+
if (!roadmapFile || !existsSync(roadmapFile)) {
|
|
231
|
+
logWarning("recovery", `verify-fail ${unitType} ${unitId}: roadmap missing`);
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
try {
|
|
235
|
+
const roadmap = parseLegacyRoadmap(readFileSync(roadmapFile, "utf-8"));
|
|
236
|
+
const milestoneResearchFile = resolveMilestoneFile(base, mid, "RESEARCH");
|
|
237
|
+
for (const slice of roadmap.slices) {
|
|
238
|
+
if (slice.done)
|
|
239
|
+
continue;
|
|
240
|
+
if (milestoneResearchFile && slice.id === "S01")
|
|
241
|
+
continue;
|
|
242
|
+
const depsComplete = (slice.depends ?? []).every((depId) => !!resolveSliceFile(base, mid, depId, "SUMMARY"));
|
|
243
|
+
if (!depsComplete)
|
|
244
|
+
continue;
|
|
245
|
+
if (!resolveSliceFile(base, mid, slice.id, "RESEARCH")) {
|
|
246
|
+
logWarning("recovery", `verify-fail ${unitType} ${unitId}: slice ${slice.id} missing RESEARCH`);
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return true;
|
|
251
|
+
}
|
|
252
|
+
catch (err) {
|
|
253
|
+
logWarning("recovery", `parallel-research verification failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
215
257
|
const absPath = resolveExpectedArtifactPath(unitType, unitId, base);
|
|
216
258
|
// For unit types with no verifiable artifact (null path), the parent directory
|
|
217
259
|
// is missing on disk — treat as stale completion state so the key gets evicted (#313).
|
|
@@ -405,6 +447,13 @@ export function writeBlockerPlaceholder(unitType, unitId, base, reason) {
|
|
|
405
447
|
`Review and replace this file before relying on downstream artifacts.`,
|
|
406
448
|
].join("\n");
|
|
407
449
|
writeFileSync(absPath, content, "utf-8");
|
|
450
|
+
// #4414: Clear caches so subsequent dispatch guards (e.g.
|
|
451
|
+
// resolveMilestoneFile) see the placeholder file. Without this, the
|
|
452
|
+
// cached directory listing is stale and the dispatch rule re-fires,
|
|
453
|
+
// producing an infinite loop despite the placeholder being on disk.
|
|
454
|
+
// Matches the pattern used in verifyExpectedArtifact above.
|
|
455
|
+
clearPathCache();
|
|
456
|
+
clearParseCache();
|
|
408
457
|
// Mark the task/slice as complete in the DB so verifyExpectedArtifact passes.
|
|
409
458
|
// Without this, the DB status stays "pending" and the dispatch loop
|
|
410
459
|
// re-derives the same unit indefinitely (#2531, #2653).
|
|
@@ -414,6 +463,14 @@ export function writeBlockerPlaceholder(unitType, unitId, base, reason) {
|
|
|
414
463
|
if (unitType === "execute-task" && mid && sid && tid) {
|
|
415
464
|
try {
|
|
416
465
|
updateTaskStatus(mid, sid, tid, "complete", ts);
|
|
466
|
+
const planPath = resolveSliceFile(base, mid, sid, "PLAN");
|
|
467
|
+
if (planPath && existsSync(planPath)) {
|
|
468
|
+
const planContent = readFileSync(planPath, "utf-8");
|
|
469
|
+
const updatedPlan = planContent.replace(new RegExp(`^(\\s*-\\s+)\\[ \\]\\s+\\*\\*${tid}:`, "m"), `$1[x] **${tid}:`);
|
|
470
|
+
if (updatedPlan !== planContent) {
|
|
471
|
+
atomicWriteSync(planPath, updatedPlan);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
417
474
|
}
|
|
418
475
|
catch (e) {
|
|
419
476
|
logWarning("recovery", `updateTaskStatus failed during context exhaustion: ${e instanceof Error ? e.message : String(e)}`);
|
|
@@ -348,10 +348,11 @@ export async function bootstrapAutoSession(s, ctx, pi, base, verboseMode, reques
|
|
|
348
348
|
// Detect survivor milestone branches in both pre-planning and complete phases.
|
|
349
349
|
// In phase=complete, the milestone artifacts exist but finalization (merge,
|
|
350
350
|
// worktree cleanup) was never run — the survivor branch must be merged.
|
|
351
|
+
// Applies to both worktree and branch isolation modes.
|
|
351
352
|
let hasSurvivorBranch = false;
|
|
352
353
|
if (state.activeMilestone &&
|
|
353
354
|
(state.phase === "pre-planning" || state.phase === "complete") &&
|
|
354
|
-
|
|
355
|
+
getIsolationMode() !== "none" &&
|
|
355
356
|
!detectWorktreeName(base) &&
|
|
356
357
|
!base.includes(`${pathSep}.gsd${pathSep}worktrees${pathSep}`)) {
|
|
357
358
|
const milestoneBranch = `milestone/${state.activeMilestone.id}`;
|
|
@@ -547,7 +548,7 @@ export async function bootstrapAutoSession(s, ctx, pi, base, verboseMode, reques
|
|
|
547
548
|
return symlinkRe.test(p);
|
|
548
549
|
};
|
|
549
550
|
if (s.currentMilestoneId &&
|
|
550
|
-
|
|
551
|
+
getIsolationMode() !== "none" &&
|
|
551
552
|
!detectWorktreeName(base) &&
|
|
552
553
|
!isUnderGsdWorktrees(base)) {
|
|
553
554
|
buildResolver().enterMilestone(s.currentMilestoneId, {
|
|
@@ -658,7 +659,8 @@ export async function bootstrapAutoSession(s, ctx, pi, base, verboseMode, reques
|
|
|
658
659
|
const bannerPrefs = loadEffectiveGSDPreferences()?.preferences;
|
|
659
660
|
const effectiveProvider = s.autoModeStartModel?.provider ?? ctx.model?.provider;
|
|
660
661
|
const effectivelyEnabled = routingConfig.enabled
|
|
661
|
-
&&
|
|
662
|
+
&& (routingConfig.allow_flat_rate_providers
|
|
663
|
+
|| !(effectiveProvider && isFlatRateProvider(effectiveProvider, buildFlatRateContext(effectiveProvider, ctx, bannerPrefs))));
|
|
662
664
|
// The actual ceiling may come from tier_models.heavy, not the start model.
|
|
663
665
|
const effectiveCeiling = (routingConfig.enabled && routingConfig.tier_models?.heavy)
|
|
664
666
|
? routingConfig.tier_models.heavy
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* dependency audits, handles auto-fix retry logic, and writes
|
|
6
6
|
* verification evidence JSON.
|
|
7
7
|
*
|
|
8
|
-
* Extracted from
|
|
9
|
-
* value instead of calling return/pauseAuto directly — the
|
|
10
|
-
* checks the result and handles control flow.
|
|
8
|
+
* Extracted from the pre-loop agent_end handler in auto.ts. Returns a
|
|
9
|
+
* sentinel value instead of calling return/pauseAuto directly — the
|
|
10
|
+
* caller checks the result and handles control flow.
|
|
11
11
|
*/
|
|
12
12
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
13
13
|
import { resolveSlicePath, resolveMilestoneFile } from "./paths.js";
|
|
@@ -20,7 +20,7 @@ import { MergeConflictError, readIntegrationBranch, RUNTIME_EXCLUSION_PATHS } fr
|
|
|
20
20
|
import { debugLog } from "./debug-logger.js";
|
|
21
21
|
import { logWarning, logError } from "./workflow-logger.js";
|
|
22
22
|
import { loadEffectiveGSDPreferences } from "./preferences.js";
|
|
23
|
-
import { nativeGetCurrentBranch, nativeDetectMainBranch, nativeWorkingTreeStatus, nativeAddAllWithExclusions, nativeCommit, nativeCheckoutBranch, nativeMergeSquash, nativeConflictFiles, nativeCheckoutTheirs, nativeAddPaths, nativeRmForce, nativeBranchDelete, nativeBranchExists, nativeDiffNumstat, nativeUpdateRef, nativeIsAncestor, nativeMergeAbort, } from "./native-git-bridge.js";
|
|
23
|
+
import { nativeGetCurrentBranch, nativeDetectMainBranch, nativeWorkingTreeStatus, nativeAddAllWithExclusions, nativeCommit, nativeCheckoutBranch, nativeMergeSquash, nativeConflictFiles, nativeCheckoutTheirs, nativeAddPaths, nativeRmForce, nativeBranchDelete, nativeBranchForceReset, nativeBranchExists, nativeDiffNumstat, nativeUpdateRef, nativeIsAncestor, nativeMergeAbort, } from "./native-git-bridge.js";
|
|
24
24
|
const gsdHome = process.env.GSD_HOME || join(homedir(), ".gsd");
|
|
25
25
|
const PROJECT_PREFERENCES_FILE = "PREFERENCES.md";
|
|
26
26
|
const LEGACY_PROJECT_PREFERENCES_FILE = "preferences.md";
|
|
@@ -792,9 +792,63 @@ export function runWorktreePostCreateHook(sourceDir, worktreeDir, hookPath) {
|
|
|
792
792
|
}
|
|
793
793
|
}
|
|
794
794
|
// ─── Auto-Worktree Branch Naming ───────────────────────────────────────────
|
|
795
|
+
/** Returns the git branch name for a milestone worktree (`milestone/<MID>`). */
|
|
795
796
|
export function autoWorktreeBranch(milestoneId) {
|
|
796
797
|
return `milestone/${milestoneId}`;
|
|
797
798
|
}
|
|
799
|
+
// ─── Branch-mode Entry ─────────────────────────────────────────────────────
|
|
800
|
+
/**
|
|
801
|
+
* Enter branch isolation mode for a milestone.
|
|
802
|
+
*
|
|
803
|
+
* Creates `milestone/<MID>` from the integration branch (if it doesn't
|
|
804
|
+
* exist yet) and checks out to it. No worktree directory is created — the
|
|
805
|
+
* project root is the working copy; only HEAD changes.
|
|
806
|
+
*
|
|
807
|
+
* Uses the same 3-tier integration-branch fallback as createAutoWorktree:
|
|
808
|
+
* 1. META.json recorded integration branch
|
|
809
|
+
* 2. git.main_branch preference
|
|
810
|
+
* 3. nativeDetectMainBranch (origin/HEAD auto-detection)
|
|
811
|
+
*/
|
|
812
|
+
export function enterBranchModeForMilestone(basePath, milestoneId) {
|
|
813
|
+
const branch = autoWorktreeBranch(milestoneId);
|
|
814
|
+
const branchExists = nativeBranchExists(basePath, branch);
|
|
815
|
+
if (!branchExists) {
|
|
816
|
+
// Create the milestone branch from the integration branch start-point.
|
|
817
|
+
const integrationBranch = readIntegrationBranch(basePath, milestoneId) ?? undefined;
|
|
818
|
+
const gitPrefs = loadEffectiveGSDPreferences()?.preferences?.git;
|
|
819
|
+
// Validate main_branch preference exists in the repo before using it —
|
|
820
|
+
// a stale preference (e.g. "master" when repo uses "main") would cause
|
|
821
|
+
// nativeBranchForceReset to fail with a bad start-point reference.
|
|
822
|
+
const validatedPrefBranch = gitPrefs?.main_branch &&
|
|
823
|
+
typeof gitPrefs.main_branch === "string" &&
|
|
824
|
+
gitPrefs.main_branch.length > 0 &&
|
|
825
|
+
nativeBranchExists(basePath, gitPrefs.main_branch)
|
|
826
|
+
? gitPrefs.main_branch
|
|
827
|
+
: undefined;
|
|
828
|
+
const startPoint = integrationBranch ??
|
|
829
|
+
validatedPrefBranch ??
|
|
830
|
+
nativeDetectMainBranch(basePath);
|
|
831
|
+
// nativeBranchForceReset creates (or resets) branch at startPoint,
|
|
832
|
+
// then checkout switches HEAD to it.
|
|
833
|
+
nativeBranchForceReset(basePath, branch, startPoint);
|
|
834
|
+
debugLog("auto-worktree", {
|
|
835
|
+
action: "enterBranchMode",
|
|
836
|
+
milestoneId,
|
|
837
|
+
branch,
|
|
838
|
+
startPoint,
|
|
839
|
+
created: true,
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
else {
|
|
843
|
+
debugLog("auto-worktree", {
|
|
844
|
+
action: "enterBranchMode",
|
|
845
|
+
milestoneId,
|
|
846
|
+
branch,
|
|
847
|
+
reused: true,
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
nativeCheckoutBranch(basePath, branch);
|
|
851
|
+
}
|
|
798
852
|
// ─── Public API ────────────────────────────────────────────────────────────
|
|
799
853
|
/**
|
|
800
854
|
* Create a new auto-worktree for a milestone, chdir into it, and store
|
|
@@ -45,8 +45,9 @@ import { atomicWriteSync } from "./atomic-write.js";
|
|
|
45
45
|
import { autoCommitCurrentBranch, captureIntegrationBranch, detectWorktreeName, getCurrentBranch, getMainBranch, setActiveMilestoneId, } from "./worktree.js";
|
|
46
46
|
import { GitServiceImpl } from "./git-service.js";
|
|
47
47
|
import { getPriorSliceCompletionBlocker } from "./dispatch-guard.js";
|
|
48
|
-
import { createAutoWorktree, enterAutoWorktree, teardownAutoWorktree, isInAutoWorktree, getAutoWorktreePath, mergeMilestoneToMain, autoWorktreeBranch, syncWorktreeStateBack, syncProjectRootToWorktree, checkResourcesStale, escapeStaleWorktree, } from "./auto-worktree.js";
|
|
48
|
+
import { createAutoWorktree, enterAutoWorktree, enterBranchModeForMilestone, teardownAutoWorktree, isInAutoWorktree, getAutoWorktreePath, mergeMilestoneToMain, autoWorktreeBranch, syncWorktreeStateBack, syncProjectRootToWorktree, checkResourcesStale, escapeStaleWorktree, } from "./auto-worktree.js";
|
|
49
49
|
import { pruneQueueOrder } from "./queue-order.js";
|
|
50
|
+
import { startCommandPolling as _startCommandPolling, isRemoteConfigured } from "../remote-questions/manager.js";
|
|
50
51
|
import { debugLog, isDebugEnabled, writeDebugSummary } from "./debug-logger.js";
|
|
51
52
|
import { reconcileMergeState, } from "./auto-recovery.js";
|
|
52
53
|
import { resolveDispatch, DISPATCH_RULES } from "./auto-dispatch.js";
|
|
@@ -64,7 +65,7 @@ import { runPostUnitVerification } from "./auto-verification.js";
|
|
|
64
65
|
import { autoCommitUnit, postUnitPreVerification, postUnitPostVerification, } from "./auto-post-unit.js";
|
|
65
66
|
import { bootstrapAutoSession, openProjectDbIfPresent } from "./auto-start.js";
|
|
66
67
|
import { initHealthWidget } from "./health-widget.js";
|
|
67
|
-
import {
|
|
68
|
+
import { runLegacyAutoLoop, runUokKernelLoop, resolveAgentEnd, resolveAgentEndCancelled, _resetPendingResolve, isSessionSwitchInFlight } from "./auto-loop.js";
|
|
68
69
|
import { runAutoLoopWithUok } from "./uok/kernel.js";
|
|
69
70
|
import { resolveUokFlags } from "./uok/flags.js";
|
|
70
71
|
import { WorktreeResolver, } from "./worktree-resolver.js";
|
|
@@ -142,6 +143,7 @@ export function startAutoDetached(ctx, pi, base, verboseMode, options) {
|
|
|
142
143
|
debugLog("auto-start-failed", { error: message });
|
|
143
144
|
});
|
|
144
145
|
}
|
|
146
|
+
/** Returns true if the project is configured for `isolation:worktree` mode. */
|
|
145
147
|
export function shouldUseWorktreeIsolation() {
|
|
146
148
|
const prefs = loadEffectiveGSDPreferences()?.preferences?.git;
|
|
147
149
|
if (prefs?.isolation === "worktree")
|
|
@@ -185,6 +187,26 @@ function deregisterSigtermHandler() {
|
|
|
185
187
|
_deregisterSigtermHandler(s.sigtermHandler);
|
|
186
188
|
s.sigtermHandler = null;
|
|
187
189
|
}
|
|
190
|
+
/**
|
|
191
|
+
* Wrapper: start background command polling for the configured remote channel
|
|
192
|
+
* (currently Telegram only). Stores the cleanup function on the session so
|
|
193
|
+
* every exit path can stop the interval via stopCommandPolling().
|
|
194
|
+
* No-op when no remote channel is configured.
|
|
195
|
+
*/
|
|
196
|
+
function startAutoCommandPolling(basePath) {
|
|
197
|
+
if (!isRemoteConfigured())
|
|
198
|
+
return;
|
|
199
|
+
// Clear any existing interval before starting a new one (e.g. resume path).
|
|
200
|
+
stopAutoCommandPolling();
|
|
201
|
+
s.commandPollingCleanup = _startCommandPolling(basePath);
|
|
202
|
+
}
|
|
203
|
+
/** Wrapper: stop background command polling and clear the stored cleanup. */
|
|
204
|
+
function stopAutoCommandPolling() {
|
|
205
|
+
if (s.commandPollingCleanup) {
|
|
206
|
+
s.commandPollingCleanup();
|
|
207
|
+
s.commandPollingCleanup = null;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
188
210
|
export function getAutoDashboardData() {
|
|
189
211
|
const ledger = getLedger();
|
|
190
212
|
const totals = ledger ? getProjectTotals(ledger.units) : null;
|
|
@@ -248,6 +270,14 @@ export function getActiveRunDir() {
|
|
|
248
270
|
export function getAutoModeStartModel() {
|
|
249
271
|
return s.autoModeStartModel;
|
|
250
272
|
}
|
|
273
|
+
/**
|
|
274
|
+
* Update the dashboard-facing dispatched model label.
|
|
275
|
+
* Used when runtime recovery switches models mid-unit (e.g. provider fallback)
|
|
276
|
+
* so the AUTO box reflects the active model immediately.
|
|
277
|
+
*/
|
|
278
|
+
export function setCurrentDispatchedModelId(model) {
|
|
279
|
+
s.currentDispatchedModelId = model ? `${model.provider}/${model.id}` : null;
|
|
280
|
+
}
|
|
251
281
|
// Tool tracking — delegates to auto-tool-tracking.ts
|
|
252
282
|
export function markToolStart(toolCallId, toolName) {
|
|
253
283
|
_markToolStart(toolCallId, s.active, toolName);
|
|
@@ -392,6 +422,7 @@ function handleLostSessionLock(ctx, lockStatus) {
|
|
|
392
422
|
s.paused = false;
|
|
393
423
|
deactivateGSD();
|
|
394
424
|
clearUnitTimeout();
|
|
425
|
+
stopAutoCommandPolling();
|
|
395
426
|
restoreProjectRootEnv();
|
|
396
427
|
restoreMilestoneLockEnv();
|
|
397
428
|
deregisterSigtermHandler();
|
|
@@ -427,6 +458,7 @@ function cleanupAfterLoopExit(ctx) {
|
|
|
427
458
|
s.active = false;
|
|
428
459
|
deactivateGSD();
|
|
429
460
|
clearUnitTimeout();
|
|
461
|
+
stopAutoCommandPolling();
|
|
430
462
|
restoreProjectRootEnv();
|
|
431
463
|
restoreMilestoneLockEnv();
|
|
432
464
|
// Clear crash lock and release session lock so the next `/gsd next` does
|
|
@@ -471,6 +503,7 @@ export async function stopAuto(ctx, pi, reason) {
|
|
|
471
503
|
// ── Step 1: Timers and locks ──
|
|
472
504
|
try {
|
|
473
505
|
clearUnitTimeout();
|
|
506
|
+
stopAutoCommandPolling();
|
|
474
507
|
if (lockBase())
|
|
475
508
|
clearLock(lockBase());
|
|
476
509
|
if (lockBase())
|
|
@@ -724,6 +757,7 @@ export async function pauseAuto(ctx, _pi, _errorContext) {
|
|
|
724
757
|
if (!s.active)
|
|
725
758
|
return;
|
|
726
759
|
clearUnitTimeout();
|
|
760
|
+
stopAutoCommandPolling();
|
|
727
761
|
// Flush queued follow-up messages (#3512).
|
|
728
762
|
// Late async notifications (async_job_result, gsd-auto-wrapup) can trigger
|
|
729
763
|
// extra LLM turns after pause. Flush them the same way run-unit.ts does.
|
|
@@ -814,6 +848,7 @@ function buildResolverDeps() {
|
|
|
814
848
|
teardownAutoWorktree,
|
|
815
849
|
createAutoWorktree,
|
|
816
850
|
enterAutoWorktree,
|
|
851
|
+
enterBranchModeForMilestone,
|
|
817
852
|
getAutoWorktreePath,
|
|
818
853
|
autoCommitCurrentBranch,
|
|
819
854
|
getCurrentBranch,
|
|
@@ -941,6 +976,11 @@ function buildLoopDeps() {
|
|
|
941
976
|
emitJournalEvent: (entry) => _emitJournalEvent(s.basePath, entry),
|
|
942
977
|
};
|
|
943
978
|
}
|
|
979
|
+
/**
|
|
980
|
+
* Start auto-mode. Handles both fresh-start and resume paths, sets up session
|
|
981
|
+
* state, enters the milestone worktree or branch, and dispatches the first unit.
|
|
982
|
+
* No-ops if auto-mode is already active.
|
|
983
|
+
*/
|
|
944
984
|
export async function startAuto(ctx, pi, base, verboseMode, options) {
|
|
945
985
|
if (s.active) {
|
|
946
986
|
debugLog("startAuto", { phase: "already-active", skipping: true });
|
|
@@ -1112,9 +1152,9 @@ export async function startAuto(ctx, pi, base, verboseMode, options) {
|
|
|
1112
1152
|
const level = to === "red" ? "error" : to === "yellow" ? "warning" : "info";
|
|
1113
1153
|
ctx.ui.notify(summary, level);
|
|
1114
1154
|
});
|
|
1115
|
-
// ── Auto-worktree: re-enter
|
|
1155
|
+
// ── Auto-worktree / branch-mode: re-enter on resume ──
|
|
1116
1156
|
if (s.currentMilestoneId &&
|
|
1117
|
-
|
|
1157
|
+
getIsolationMode() !== "none" &&
|
|
1118
1158
|
s.originalBasePath &&
|
|
1119
1159
|
!isInAutoWorktree(s.basePath) &&
|
|
1120
1160
|
!detectWorktreeName(s.basePath) &&
|
|
@@ -1179,12 +1219,14 @@ export async function startAuto(ctx, pi, base, verboseMode, options) {
|
|
|
1179
1219
|
writeLock(lockBase(), "resuming", s.currentMilestoneId ?? "unknown");
|
|
1180
1220
|
logCmuxEvent(loadEffectiveGSDPreferences()?.preferences, s.stepMode ? "Step-mode resumed." : "Auto-mode resumed.", "progress");
|
|
1181
1221
|
captureProjectRootEnv(s.originalBasePath || s.basePath);
|
|
1222
|
+
startAutoCommandPolling(s.basePath);
|
|
1182
1223
|
await runAutoLoopWithUok({
|
|
1183
1224
|
ctx,
|
|
1184
1225
|
pi,
|
|
1185
1226
|
s,
|
|
1186
1227
|
deps: buildLoopDeps(),
|
|
1187
|
-
|
|
1228
|
+
runKernelLoop: runUokKernelLoop,
|
|
1229
|
+
runLegacyLoop: runLegacyAutoLoop,
|
|
1188
1230
|
});
|
|
1189
1231
|
cleanupAfterLoopExit(ctx);
|
|
1190
1232
|
return;
|
|
@@ -1208,35 +1250,18 @@ export async function startAuto(ctx, pi, base, verboseMode, options) {
|
|
|
1208
1250
|
logWarning("engine", `cmux sync failed: ${err instanceof Error ? err.message : String(err)}`, { file: "auto.ts" });
|
|
1209
1251
|
}
|
|
1210
1252
|
logCmuxEvent(loadEffectiveGSDPreferences()?.preferences, requestedStepMode ? "Step-mode started." : "Auto-mode started.", "progress");
|
|
1253
|
+
startAutoCommandPolling(s.basePath);
|
|
1211
1254
|
// Dispatch the first unit
|
|
1212
1255
|
await runAutoLoopWithUok({
|
|
1213
1256
|
ctx,
|
|
1214
1257
|
pi,
|
|
1215
1258
|
s,
|
|
1216
1259
|
deps: buildLoopDeps(),
|
|
1217
|
-
|
|
1260
|
+
runKernelLoop: runUokKernelLoop,
|
|
1261
|
+
runLegacyLoop: runLegacyAutoLoop,
|
|
1218
1262
|
});
|
|
1219
1263
|
cleanupAfterLoopExit(ctx);
|
|
1220
1264
|
}
|
|
1221
|
-
// ─── Agent End Handler ────────────────────────────────────────────────────────
|
|
1222
|
-
/**
|
|
1223
|
-
* Deprecated thin wrapper — kept as export for backward compatibility.
|
|
1224
|
-
* The actual agent_end processing now happens via resolveAgentEnd() in auto-loop.ts,
|
|
1225
|
-
* which is called directly from index.ts. The autoLoop() while loop handles all
|
|
1226
|
-
* post-unit processing (verification, hooks, dispatch) that this function used to do.
|
|
1227
|
-
*
|
|
1228
|
-
* If called by straggler code, it simply resolves the pending promise so the loop
|
|
1229
|
-
* can continue.
|
|
1230
|
-
*/
|
|
1231
|
-
export async function handleAgentEnd(ctx, pi) {
|
|
1232
|
-
if (!s.active || !s.cmdCtx) {
|
|
1233
|
-
// Even when inactive, resolve any pending promise so the loop is unblocked.
|
|
1234
|
-
resolveAgentEndCancelled();
|
|
1235
|
-
return;
|
|
1236
|
-
}
|
|
1237
|
-
clearUnitTimeout();
|
|
1238
|
-
resolveAgentEnd({ messages: [] });
|
|
1239
|
-
}
|
|
1240
1265
|
// describeNextUnit is imported from auto-dashboard.ts and re-exported
|
|
1241
1266
|
export { describeNextUnit } from "./auto-dashboard.js";
|
|
1242
1267
|
/** Thin wrapper: delegates to auto-dashboard.ts, passing state accessors. */
|