gsd-pi 2.34.0 → 2.35.0-dev.34ce717
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 +3 -1
- package/dist/cli.js +7 -2
- package/dist/resource-loader.d.ts +1 -1
- package/dist/resource-loader.js +13 -1
- package/dist/resources/extensions/async-jobs/await-tool.js +0 -2
- package/dist/resources/extensions/async-jobs/job-manager.js +0 -6
- package/dist/resources/extensions/bg-shell/output-formatter.js +1 -19
- package/dist/resources/extensions/bg-shell/process-manager.js +0 -4
- package/dist/resources/extensions/bg-shell/types.js +0 -2
- package/dist/resources/extensions/context7/index.js +5 -0
- package/dist/resources/extensions/get-secrets-from-user.js +2 -30
- package/dist/resources/extensions/google-search/index.js +5 -0
- package/dist/resources/extensions/gsd/auto-dispatch.js +43 -1
- package/dist/resources/extensions/gsd/auto-loop.js +17 -3
- package/dist/resources/extensions/gsd/auto-model-selection.js +15 -3
- package/dist/resources/extensions/gsd/auto-recovery.js +35 -0
- package/dist/resources/extensions/gsd/auto-start.js +35 -2
- package/dist/resources/extensions/gsd/auto.js +59 -4
- package/dist/resources/extensions/gsd/changelog.js +162 -0
- package/dist/resources/extensions/gsd/commands-bootstrap.js +1 -0
- package/dist/resources/extensions/gsd/commands-handlers.js +2 -2
- package/dist/resources/extensions/gsd/commands-inspect.js +10 -3
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +5 -1
- package/dist/resources/extensions/gsd/commands-rate.js +31 -0
- package/dist/resources/extensions/gsd/commands.js +51 -2
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +10 -0
- package/dist/resources/extensions/gsd/doctor-checks.js +113 -5
- package/dist/resources/extensions/gsd/doctor-environment.js +26 -17
- package/dist/resources/extensions/gsd/doctor-proactive.js +22 -0
- package/dist/resources/extensions/gsd/doctor.js +36 -0
- package/dist/resources/extensions/gsd/files.js +11 -2
- package/dist/resources/extensions/gsd/gitignore.js +54 -7
- package/dist/resources/extensions/gsd/guided-flow.js +12 -4
- package/dist/resources/extensions/gsd/health-widget-core.js +96 -0
- package/dist/resources/extensions/gsd/health-widget.js +97 -46
- package/dist/resources/extensions/gsd/index.js +26 -33
- package/dist/resources/extensions/gsd/migrate-external.js +55 -2
- package/dist/resources/extensions/gsd/milestone-ids.js +3 -2
- package/dist/resources/extensions/gsd/paths.js +74 -7
- package/dist/resources/extensions/gsd/post-unit-hooks.js +4 -1
- package/dist/resources/extensions/gsd/preferences-validation.js +54 -1
- package/dist/resources/extensions/gsd/preferences.js +14 -0
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +2 -0
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +2 -0
- package/dist/resources/extensions/gsd/roadmap-mutations.js +55 -0
- package/dist/resources/extensions/gsd/session-lock.js +53 -2
- package/dist/resources/extensions/gsd/state.js +2 -1
- package/dist/resources/extensions/gsd/templates/plan.md +8 -0
- package/dist/resources/extensions/gsd/worktree-resolver.js +12 -0
- package/dist/resources/extensions/mcp-client/index.js +2 -1
- package/dist/resources/extensions/remote-questions/remote-command.js +2 -22
- package/dist/resources/extensions/shared/mod.js +1 -1
- package/dist/resources/extensions/shared/sanitize.js +30 -0
- package/dist/resources/extensions/subagent/index.js +6 -14
- package/dist/resources/skills/create-gsd-extension/references/events-reference.md +4 -4
- package/package.json +2 -1
- package/packages/native/dist/native.d.ts +0 -2
- package/packages/native/dist/native.js +0 -2
- package/packages/native/src/native.ts +0 -3
- package/packages/pi-agent-core/dist/agent-loop.d.ts +14 -0
- package/packages/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent-loop.js +24 -27
- package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/packages/pi-agent-core/dist/agent.d.ts +1 -0
- package/packages/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent.js +11 -22
- package/packages/pi-agent-core/dist/agent.js.map +1 -1
- package/packages/pi-agent-core/dist/proxy.d.ts +1 -25
- package/packages/pi-agent-core/dist/proxy.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/proxy.js +3 -9
- package/packages/pi-agent-core/dist/proxy.js.map +1 -1
- package/packages/pi-agent-core/src/agent-loop.ts +30 -27
- package/packages/pi-agent-core/src/agent.ts +12 -23
- package/packages/pi-agent-core/src/proxy.ts +3 -9
- package/packages/pi-ai/dist/api-registry.d.ts +0 -2
- package/packages/pi-ai/dist/api-registry.d.ts.map +1 -1
- package/packages/pi-ai/dist/api-registry.js +0 -10
- package/packages/pi-ai/dist/api-registry.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.d.ts +0 -8
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/azure-openai-responses.js +5 -41
- package/packages/pi-ai/dist/providers/azure-openai-responses.js.map +1 -1
- package/packages/pi-ai/dist/providers/github-copilot-headers.d.ts +0 -1
- package/packages/pi-ai/dist/providers/github-copilot-headers.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/github-copilot-headers.js +1 -1
- package/packages/pi-ai/dist/providers/github-copilot-headers.js.map +1 -1
- package/packages/pi-ai/dist/providers/google-gemini-cli.d.ts +1 -43
- package/packages/pi-ai/dist/providers/google-gemini-cli.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/google-gemini-cli.js +2 -2
- package/packages/pi-ai/dist/providers/google-gemini-cli.js.map +1 -1
- package/packages/pi-ai/dist/providers/google-shared.d.ts +0 -4
- package/packages/pi-ai/dist/providers/google-shared.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/google-shared.js +1 -1
- package/packages/pi-ai/dist/providers/google-shared.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.js +10 -73
- package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-responses.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-responses.js +9 -80
- package/packages/pi-ai/dist/providers/openai-responses.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-shared.d.ts +65 -0
- package/packages/pi-ai/dist/providers/openai-shared.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/openai-shared.js +146 -0
- package/packages/pi-ai/dist/providers/openai-shared.js.map +1 -0
- package/packages/pi-ai/dist/providers/register-builtins.d.ts +0 -1
- package/packages/pi-ai/dist/providers/register-builtins.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/register-builtins.js +1 -1
- package/packages/pi-ai/dist/providers/register-builtins.js.map +1 -1
- package/packages/pi-ai/dist/utils/event-stream.d.ts +0 -2
- package/packages/pi-ai/dist/utils/event-stream.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/event-stream.js +0 -4
- package/packages/pi-ai/dist/utils/event-stream.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.js +7 -135
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js +7 -135
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js.map +1 -1
- package/packages/pi-ai/dist/utils/oauth/google-oauth-utils.d.ts +46 -0
- package/packages/pi-ai/dist/utils/oauth/google-oauth-utils.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/google-oauth-utils.js +160 -0
- package/packages/pi-ai/dist/utils/oauth/google-oauth-utils.js.map +1 -0
- package/packages/pi-ai/dist/utils/overflow.d.ts +0 -4
- package/packages/pi-ai/dist/utils/overflow.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/overflow.js +0 -6
- package/packages/pi-ai/dist/utils/overflow.js.map +1 -1
- package/packages/pi-ai/dist/utils/validation.d.ts +0 -8
- package/packages/pi-ai/dist/utils/validation.d.ts.map +1 -1
- package/packages/pi-ai/dist/utils/validation.js +0 -14
- package/packages/pi-ai/dist/utils/validation.js.map +1 -1
- package/packages/pi-ai/src/api-registry.ts +0 -12
- package/packages/pi-ai/src/providers/anthropic.ts +1 -1
- package/packages/pi-ai/src/providers/azure-openai-responses.ts +11 -45
- package/packages/pi-ai/src/providers/github-copilot-headers.ts +1 -1
- package/packages/pi-ai/src/providers/google-gemini-cli.ts +2 -2
- package/packages/pi-ai/src/providers/google-shared.ts +1 -1
- package/packages/pi-ai/src/providers/openai-completions.ts +16 -86
- package/packages/pi-ai/src/providers/openai-responses.ts +16 -96
- package/packages/pi-ai/src/providers/openai-shared.ts +193 -0
- package/packages/pi-ai/src/providers/register-builtins.ts +1 -1
- package/packages/pi-ai/src/utils/event-stream.ts +0 -5
- package/packages/pi-ai/src/utils/oauth/google-antigravity.ts +14 -162
- package/packages/pi-ai/src/utils/oauth/google-gemini-cli.ts +13 -161
- package/packages/pi-ai/src/utils/oauth/google-oauth-utils.ts +201 -0
- package/packages/pi-ai/src/utils/overflow.ts +1 -8
- package/packages/pi-ai/src/utils/validation.ts +0 -15
- package/packages/pi-coding-agent/dist/config.d.ts +0 -9
- package/packages/pi-coding-agent/dist/config.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/config.js +4 -8
- package/packages/pi-coding-agent/dist/config.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +16 -63
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +104 -641
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +0 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/auth-storage.js +4 -35
- package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.js +5 -43
- package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js +11 -69
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts +40 -0
- package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/utils.js +78 -0
- package/packages/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.d.ts +77 -0
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js +331 -0
- package/packages/pi-coding-agent/dist/core/compaction-orchestrator.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.d.ts +0 -4
- package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.js +1 -1
- package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +2 -2
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.js +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +15 -5
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js +129 -256
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +49 -42
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.js +2 -21
- package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/keybindings.d.ts +0 -8
- package/packages/pi-coding-agent/dist/core/keybindings.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/keybindings.js +2 -2
- package/packages/pi-coding-agent/dist/core/keybindings.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lock-utils.d.ts +39 -0
- package/packages/pi-coding-agent/dist/core/lock-utils.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/lock-utils.js +89 -0
- package/packages/pi-coding-agent/dist/core/lock-utils.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/lsp/client.d.ts +0 -17
- package/packages/pi-coding-agent/dist/core/lsp/client.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/client.js +3 -62
- package/packages/pi-coding-agent/dist/core/lsp/client.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/config.d.ts +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/config.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/config.js +2 -6
- package/packages/pi-coding-agent/dist/core/lsp/config.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/edits.d.ts +0 -5
- package/packages/pi-coding-agent/dist/core/lsp/edits.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/edits.js +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/edits.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/index.js +52 -107
- package/packages/pi-coding-agent/dist/core/lsp/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/lspmux.d.ts +0 -1
- package/packages/pi-coding-agent/dist/core/lsp/lspmux.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/lspmux.js +3 -22
- package/packages/pi-coding-agent/dist/core/lsp/lspmux.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/types.d.ts +0 -1
- package/packages/pi-coding-agent/dist/core/lsp/types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/types.js +0 -28
- package/packages/pi-coding-agent/dist/core/lsp/types.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/utils.d.ts +1 -6
- package/packages/pi-coding-agent/dist/core/lsp/utils.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/utils.js +1 -28
- package/packages/pi-coding-agent/dist/core/lsp/utils.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/messages.d.ts +0 -8
- package/packages/pi-coding-agent/dist/core/messages.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/messages.js +5 -5
- package/packages/pi-coding-agent/dist/core/messages.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts +0 -3
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.js +1 -3
- package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.d.ts +1 -26
- package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.js +3 -59
- package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/package-manager.js +2 -4
- package/packages/pi-coding-agent/dist/core/package-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/prompt-templates.d.ts +0 -17
- package/packages/pi-coding-agent/dist/core/prompt-templates.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/prompt-templates.js +2 -2
- package/packages/pi-coding-agent/dist/core/prompt-templates.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/resource-loader.d.ts +2 -4
- package/packages/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/resource-loader.js +46 -60
- package/packages/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts +87 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.js +295 -0
- package/packages/pi-coding-agent/dist/core/retry-handler.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/session-manager.d.ts +0 -5
- package/packages/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.js +5 -32
- package/packages/pi-coding-agent/dist/core/session-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +8 -12
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +78 -168
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/skills.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/skills.js +1 -3
- package/packages/pi-coding-agent/dist/core/skills.js.map +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/index.js +1 -1
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/migrations.d.ts +0 -16
- package/packages/pi-coding-agent/dist/migrations.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/migrations.js +2 -2
- package/packages/pi-coding-agent/dist/migrations.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.d.ts +0 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.js +2 -2
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.d.ts +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.js +9 -26
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +1 -13
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tree-render-utils.d.ts +44 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tree-render-utils.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tree-render-utils.js +61 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tree-render-utils.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.js +6 -9
- package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +1 -24
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +50 -512
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.d.ts +71 -0
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +514 -0
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +65 -4
- 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 +6 -23
- 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 +12 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +175 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/utils/shorten-path.d.ts +6 -0
- package/packages/pi-coding-agent/dist/modes/interactive/utils/shorten-path.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/utils/shorten-path.js +15 -0
- package/packages/pi-coding-agent/dist/modes/interactive/utils/shorten-path.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/print-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/print-mode.js +2 -30
- package/packages/pi-coding-agent/dist/modes/print-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js +2 -28
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/shared/command-context-actions.d.ts +19 -0
- package/packages/pi-coding-agent/dist/modes/shared/command-context-actions.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/shared/command-context-actions.js +45 -0
- package/packages/pi-coding-agent/dist/modes/shared/command-context-actions.js.map +1 -0
- package/packages/pi-coding-agent/dist/utils/changelog.d.ts +0 -4
- package/packages/pi-coding-agent/dist/utils/changelog.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/utils/changelog.js +1 -1
- package/packages/pi-coding-agent/dist/utils/changelog.js.map +1 -1
- package/packages/pi-coding-agent/dist/utils/clipboard-image.d.ts +0 -1
- package/packages/pi-coding-agent/dist/utils/clipboard-image.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/utils/clipboard-image.js +1 -1
- package/packages/pi-coding-agent/dist/utils/clipboard-image.js.map +1 -1
- package/packages/pi-coding-agent/dist/utils/error.d.ts +5 -0
- package/packages/pi-coding-agent/dist/utils/error.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/utils/error.js +7 -0
- package/packages/pi-coding-agent/dist/utils/error.js.map +1 -0
- package/packages/pi-coding-agent/dist/utils/photon.d.ts +0 -19
- package/packages/pi-coding-agent/dist/utils/photon.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/utils/photon.js +1 -120
- package/packages/pi-coding-agent/dist/utils/photon.js.map +1 -1
- package/packages/pi-coding-agent/dist/utils/tools-manager.d.ts +0 -1
- package/packages/pi-coding-agent/dist/utils/tools-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/utils/tools-manager.js +1 -1
- package/packages/pi-coding-agent/dist/utils/tools-manager.js.map +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-coding-agent/src/config.ts +5 -10
- package/packages/pi-coding-agent/src/core/agent-session.ts +117 -745
- package/packages/pi-coding-agent/src/core/auth-storage.ts +4 -38
- package/packages/pi-coding-agent/src/core/compaction/branch-summarization.ts +7 -53
- package/packages/pi-coding-agent/src/core/compaction/compaction.ts +14 -74
- package/packages/pi-coding-agent/src/core/compaction/utils.ts +100 -0
- package/packages/pi-coding-agent/src/core/compaction-orchestrator.ts +424 -0
- package/packages/pi-coding-agent/src/core/export-html/ansi-to-html.ts +1 -1
- package/packages/pi-coding-agent/src/core/extensions/index.ts +1 -21
- package/packages/pi-coding-agent/src/core/extensions/runner.ts +119 -256
- package/packages/pi-coding-agent/src/core/extensions/types.ts +50 -69
- package/packages/pi-coding-agent/src/core/keybindings.ts +2 -2
- package/packages/pi-coding-agent/src/core/lock-utils.ts +113 -0
- package/packages/pi-coding-agent/src/core/lsp/client.ts +3 -73
- package/packages/pi-coding-agent/src/core/lsp/config.ts +2 -10
- package/packages/pi-coding-agent/src/core/lsp/edits.ts +1 -1
- package/packages/pi-coding-agent/src/core/lsp/index.ts +83 -152
- package/packages/pi-coding-agent/src/core/lsp/lspmux.ts +3 -23
- package/packages/pi-coding-agent/src/core/lsp/types.ts +0 -29
- package/packages/pi-coding-agent/src/core/lsp/utils.ts +1 -33
- package/packages/pi-coding-agent/src/core/messages.ts +5 -5
- package/packages/pi-coding-agent/src/core/model-registry.ts +0 -2
- package/packages/pi-coding-agent/src/core/model-resolver.ts +3 -77
- package/packages/pi-coding-agent/src/core/package-manager.ts +1 -4
- package/packages/pi-coding-agent/src/core/prompt-templates.ts +2 -2
- package/packages/pi-coding-agent/src/core/resource-loader.ts +56 -69
- package/packages/pi-coding-agent/src/core/retry-handler.ts +359 -0
- package/packages/pi-coding-agent/src/core/session-manager.ts +5 -34
- package/packages/pi-coding-agent/src/core/settings-manager.ts +87 -166
- package/packages/pi-coding-agent/src/core/skills.ts +1 -4
- package/packages/pi-coding-agent/src/index.ts +1 -7
- package/packages/pi-coding-agent/src/migrations.ts +2 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/session-selector-search.ts +2 -2
- package/packages/pi-coding-agent/src/modes/interactive/components/session-selector.ts +17 -29
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +1 -13
- package/packages/pi-coding-agent/src/modes/interactive/components/tree-render-utils.ts +81 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/tree-selector.ts +14 -19
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +50 -561
- package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +653 -0
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +7 -26
- package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +196 -0
- package/packages/pi-coding-agent/src/modes/interactive/utils/shorten-path.ts +14 -0
- package/packages/pi-coding-agent/src/modes/print-mode.ts +2 -30
- package/packages/pi-coding-agent/src/modes/rpc/rpc-mode.ts +2 -28
- package/packages/pi-coding-agent/src/modes/shared/command-context-actions.ts +53 -0
- package/packages/pi-coding-agent/src/utils/changelog.ts +1 -1
- package/packages/pi-coding-agent/src/utils/clipboard-image.ts +1 -1
- package/packages/pi-coding-agent/src/utils/error.ts +6 -0
- package/packages/pi-coding-agent/src/utils/photon.ts +0 -137
- package/packages/pi-coding-agent/src/utils/tools-manager.ts +1 -1
- package/packages/pi-tui/dist/components/editor.d.ts +0 -10
- package/packages/pi-tui/dist/components/editor.d.ts.map +1 -1
- package/packages/pi-tui/dist/components/editor.js +1 -1
- package/packages/pi-tui/dist/components/editor.js.map +1 -1
- package/packages/pi-tui/dist/components/markdown.d.ts +5 -0
- package/packages/pi-tui/dist/components/markdown.d.ts.map +1 -1
- package/packages/pi-tui/dist/components/markdown.js +25 -31
- package/packages/pi-tui/dist/components/markdown.js.map +1 -1
- package/packages/pi-tui/dist/keys.d.ts +0 -4
- package/packages/pi-tui/dist/keys.d.ts.map +1 -1
- package/packages/pi-tui/dist/keys.js +94 -162
- package/packages/pi-tui/dist/keys.js.map +1 -1
- package/packages/pi-tui/dist/overlay-layout.d.ts +55 -0
- package/packages/pi-tui/dist/overlay-layout.d.ts.map +1 -0
- package/packages/pi-tui/dist/overlay-layout.js +288 -0
- package/packages/pi-tui/dist/overlay-layout.js.map +1 -0
- package/packages/pi-tui/dist/tui.d.ts +0 -22
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +6 -272
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/dist/utils.d.ts +0 -7
- package/packages/pi-tui/dist/utils.d.ts.map +1 -1
- package/packages/pi-tui/dist/utils.js +0 -44
- package/packages/pi-tui/dist/utils.js.map +1 -1
- package/packages/pi-tui/src/components/editor.ts +1 -1
- package/packages/pi-tui/src/components/markdown.ts +25 -29
- package/packages/pi-tui/src/keys.ts +94 -173
- package/packages/pi-tui/src/overlay-layout.ts +372 -0
- package/packages/pi-tui/src/tui.ts +11 -312
- package/packages/pi-tui/src/utils.ts +0 -43
- package/pkg/dist/core/export-html/ansi-to-html.d.ts +0 -4
- package/pkg/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/pkg/dist/core/export-html/ansi-to-html.js +1 -1
- package/pkg/dist/core/export-html/ansi-to-html.js.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.d.ts +65 -4
- package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.js +6 -23
- package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.d.ts +12 -0
- package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -0
- package/pkg/dist/modes/interactive/theme/themes.js +175 -0
- package/pkg/dist/modes/interactive/theme/themes.js.map +1 -0
- package/pkg/package.json +1 -1
- package/src/resources/extensions/async-jobs/await-tool.ts +0 -2
- package/src/resources/extensions/async-jobs/job-manager.ts +0 -7
- package/src/resources/extensions/bg-shell/output-formatter.ts +0 -17
- package/src/resources/extensions/bg-shell/process-manager.ts +0 -4
- package/src/resources/extensions/bg-shell/types.ts +0 -12
- package/src/resources/extensions/context7/index.ts +7 -0
- package/src/resources/extensions/get-secrets-from-user.ts +2 -35
- package/src/resources/extensions/google-search/index.ts +7 -0
- package/src/resources/extensions/gsd/auto-dispatch.ts +49 -1
- package/src/resources/extensions/gsd/auto-loop.ts +22 -2
- package/src/resources/extensions/gsd/auto-model-selection.ts +23 -2
- package/src/resources/extensions/gsd/auto-recovery.ts +39 -0
- package/src/resources/extensions/gsd/auto-start.ts +42 -2
- package/src/resources/extensions/gsd/auto.ts +61 -3
- package/src/resources/extensions/gsd/changelog.ts +213 -0
- package/src/resources/extensions/gsd/commands-bootstrap.ts +1 -0
- package/src/resources/extensions/gsd/commands-handlers.ts +2 -2
- package/src/resources/extensions/gsd/commands-inspect.ts +10 -3
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +5 -1
- package/src/resources/extensions/gsd/commands-rate.ts +55 -0
- package/src/resources/extensions/gsd/commands.ts +52 -2
- package/src/resources/extensions/gsd/docs/preferences-reference.md +10 -0
- package/src/resources/extensions/gsd/doctor-checks.ts +107 -5
- package/src/resources/extensions/gsd/doctor-environment.ts +26 -16
- package/src/resources/extensions/gsd/doctor-proactive.ts +24 -0
- package/src/resources/extensions/gsd/doctor-types.ts +9 -1
- package/src/resources/extensions/gsd/doctor.ts +35 -0
- package/src/resources/extensions/gsd/files.ts +12 -2
- package/src/resources/extensions/gsd/gitignore.ts +54 -7
- package/src/resources/extensions/gsd/guided-flow.ts +12 -4
- package/src/resources/extensions/gsd/health-widget-core.ts +129 -0
- package/src/resources/extensions/gsd/health-widget.ts +103 -59
- package/src/resources/extensions/gsd/index.ts +30 -33
- package/src/resources/extensions/gsd/migrate-external.ts +47 -2
- package/src/resources/extensions/gsd/milestone-ids.ts +3 -2
- package/src/resources/extensions/gsd/paths.ts +73 -7
- package/src/resources/extensions/gsd/post-unit-hooks.ts +5 -1
- package/src/resources/extensions/gsd/preferences-validation.ts +54 -1
- package/src/resources/extensions/gsd/preferences.ts +16 -1
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +2 -0
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +2 -0
- package/src/resources/extensions/gsd/roadmap-mutations.ts +66 -0
- package/src/resources/extensions/gsd/session-lock.ts +59 -2
- package/src/resources/extensions/gsd/state.ts +2 -1
- package/src/resources/extensions/gsd/templates/plan.md +8 -0
- package/src/resources/extensions/gsd/tests/commands-inspect-open-db.test.ts +46 -0
- package/src/resources/extensions/gsd/tests/doctor-git.test.ts +98 -2
- package/src/resources/extensions/gsd/tests/doctor-runtime.test.ts +59 -3
- package/src/resources/extensions/gsd/tests/files-loadfile-eisdir.test.ts +20 -0
- package/src/resources/extensions/gsd/tests/gitignore-tracked-gsd.test.ts +214 -0
- package/src/resources/extensions/gsd/tests/health-widget.test.ts +158 -0
- package/src/resources/extensions/gsd/tests/paths.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/preferences.test.ts +40 -2
- package/src/resources/extensions/gsd/tests/queue-reorder-e2e.test.ts +26 -0
- package/src/resources/extensions/gsd/tests/test-utils.ts +165 -0
- package/src/resources/extensions/gsd/tests/validate-directory.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/validate-milestone.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/worktree-sync-milestones.test.ts +32 -0
- package/src/resources/extensions/gsd/worktree-resolver.ts +11 -0
- package/src/resources/extensions/mcp-client/index.ts +2 -1
- package/src/resources/extensions/remote-questions/remote-command.ts +2 -23
- package/src/resources/extensions/shared/mod.ts +1 -1
- package/src/resources/extensions/shared/sanitize.ts +36 -0
- package/src/resources/extensions/subagent/index.ts +6 -12
- package/src/resources/skills/create-gsd-extension/references/events-reference.md +4 -4
- package/dist/resources/extensions/shared/wizard-ui.js +0 -478
- package/packages/pi-coding-agent/dist/modes/interactive/theme/dark.json +0 -85
- package/packages/pi-coding-agent/dist/modes/interactive/theme/light.json +0 -84
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.json +0 -335
- package/packages/pi-coding-agent/src/modes/interactive/theme/dark.json +0 -85
- package/packages/pi-coding-agent/src/modes/interactive/theme/light.json +0 -84
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme-schema.json +0 -335
- package/pkg/dist/modes/interactive/theme/dark.json +0 -85
- package/pkg/dist/modes/interactive/theme/light.json +0 -84
- package/pkg/dist/modes/interactive/theme/theme-schema.json +0 -335
- package/src/resources/extensions/shared/wizard-ui.ts +0 -551
|
@@ -9,41 +9,37 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type { ExtensionContext } from "@gsd/pi-coding-agent";
|
|
12
|
+
import type { GSDState } from "./types.js";
|
|
12
13
|
import { runProviderChecks, summariseProviderIssues } from "./doctor-providers.js";
|
|
13
14
|
import { runEnvironmentChecks } from "./doctor-environment.js";
|
|
14
15
|
import { loadEffectiveGSDPreferences } from "./preferences.js";
|
|
15
16
|
import { loadLedgerFromDisk, getProjectTotals } from "./metrics.js";
|
|
17
|
+
import { describeNextUnit, estimateTimeRemaining, updateSliceProgressCache } from "./auto-dashboard.js";
|
|
16
18
|
import { projectRoot } from "./commands.js";
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
budgetSpent: number;
|
|
24
|
-
providerIssue: string | null; // compact summary from summariseProviderIssues()
|
|
25
|
-
environmentErrorCount: number;
|
|
26
|
-
environmentWarningCount: number;
|
|
27
|
-
lastRefreshed: number;
|
|
28
|
-
}
|
|
19
|
+
import { deriveState, invalidateStateCache } from "./state.js";
|
|
20
|
+
import {
|
|
21
|
+
buildHealthLines,
|
|
22
|
+
detectHealthWidgetProjectState,
|
|
23
|
+
type HealthWidgetData,
|
|
24
|
+
} from "./health-widget-core.js";
|
|
29
25
|
|
|
30
26
|
// ── Data loader ────────────────────────────────────────────────────────────────
|
|
31
27
|
|
|
32
|
-
function
|
|
33
|
-
let hasProject = false;
|
|
28
|
+
function loadBaseHealthWidgetData(basePath: string): HealthWidgetData {
|
|
34
29
|
let budgetCeiling: number | undefined;
|
|
35
30
|
let budgetSpent = 0;
|
|
36
31
|
let providerIssue: string | null = null;
|
|
37
32
|
let environmentErrorCount = 0;
|
|
38
33
|
let environmentWarningCount = 0;
|
|
39
34
|
|
|
35
|
+
const projectState = detectHealthWidgetProjectState(basePath);
|
|
36
|
+
|
|
40
37
|
try {
|
|
41
38
|
const prefs = loadEffectiveGSDPreferences();
|
|
42
39
|
budgetCeiling = prefs?.preferences?.budget_ceiling;
|
|
43
40
|
|
|
44
41
|
const ledger = loadLedgerFromDisk(basePath);
|
|
45
42
|
if (ledger) {
|
|
46
|
-
hasProject = true;
|
|
47
43
|
const totals = getProjectTotals(ledger.units ?? []);
|
|
48
44
|
budgetSpent = totals.cost;
|
|
49
45
|
}
|
|
@@ -63,7 +59,7 @@ function loadHealthWidgetData(basePath: string): HealthWidgetData {
|
|
|
63
59
|
} catch { /* non-fatal */ }
|
|
64
60
|
|
|
65
61
|
return {
|
|
66
|
-
|
|
62
|
+
projectState,
|
|
67
63
|
budgetCeiling,
|
|
68
64
|
budgetSpent,
|
|
69
65
|
providerIssue,
|
|
@@ -73,54 +69,88 @@ function loadHealthWidgetData(basePath: string): HealthWidgetData {
|
|
|
73
69
|
};
|
|
74
70
|
}
|
|
75
71
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return
|
|
72
|
+
function compactText(text: string, max = 64): string {
|
|
73
|
+
const trimmed = text.replace(/\s+/g, " ").trim();
|
|
74
|
+
if (trimmed.length <= max) return trimmed;
|
|
75
|
+
return `${trimmed.slice(0, max - 1).trimEnd()}…`;
|
|
80
76
|
}
|
|
81
77
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
78
|
+
function summarizeExecutionStatus(state: GSDState): string {
|
|
79
|
+
switch (state.phase) {
|
|
80
|
+
case "blocked": return "Blocked";
|
|
81
|
+
case "paused": return "Paused";
|
|
82
|
+
case "complete": return "Complete";
|
|
83
|
+
case "executing": return "Executing";
|
|
84
|
+
case "planning": return "Planning";
|
|
85
|
+
case "pre-planning": return "Pre-planning";
|
|
86
|
+
case "summarizing": return "Summarizing";
|
|
87
|
+
case "validating-milestone": return "Validating";
|
|
88
|
+
case "completing-milestone": return "Completing";
|
|
89
|
+
case "needs-discussion": return "Needs discussion";
|
|
90
|
+
case "replanning-slice": return "Replanning";
|
|
91
|
+
default: return "Active";
|
|
89
92
|
}
|
|
93
|
+
}
|
|
90
94
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
function summarizeExecutionTarget(state: GSDState): string {
|
|
96
|
+
switch (state.phase) {
|
|
97
|
+
case "needs-discussion":
|
|
98
|
+
return state.activeMilestone ? `Discuss ${state.activeMilestone.id}` : "Discuss milestone draft";
|
|
99
|
+
case "pre-planning":
|
|
100
|
+
return state.activeMilestone ? `Plan ${state.activeMilestone.id}` : "Research & plan milestone";
|
|
101
|
+
case "planning":
|
|
102
|
+
return state.activeSlice ? `Plan ${state.activeSlice.id}` : "Plan next slice";
|
|
103
|
+
case "executing":
|
|
104
|
+
return state.activeTask ? `Execute ${state.activeTask.id}` : "Execute next task";
|
|
105
|
+
case "summarizing":
|
|
106
|
+
return state.activeSlice ? `Complete ${state.activeSlice.id}` : "Complete current slice";
|
|
107
|
+
case "validating-milestone":
|
|
108
|
+
return state.activeMilestone ? `Validate ${state.activeMilestone.id}` : "Validate milestone";
|
|
109
|
+
case "completing-milestone":
|
|
110
|
+
return state.activeMilestone ? `Complete ${state.activeMilestone.id}` : "Complete milestone";
|
|
111
|
+
case "replanning-slice":
|
|
112
|
+
return state.activeSlice ? `Replan ${state.activeSlice.id}` : "Replan current slice";
|
|
113
|
+
case "blocked":
|
|
114
|
+
return `waiting on ${compactText(state.blockers[0] ?? state.nextAction, 56)}`;
|
|
115
|
+
case "paused":
|
|
116
|
+
return compactText(state.nextAction || "waiting to resume", 56);
|
|
117
|
+
case "complete":
|
|
118
|
+
return "All milestones complete";
|
|
119
|
+
default:
|
|
120
|
+
return compactText(describeNextUnit(state).label, 56);
|
|
101
121
|
}
|
|
122
|
+
}
|
|
102
123
|
|
|
103
|
-
|
|
104
|
-
if (
|
|
105
|
-
const pct = Math.min(100, (data.budgetSpent / data.budgetCeiling) * 100);
|
|
106
|
-
parts.push(`Budget: ${formatCost(data.budgetSpent)}/${formatCost(data.budgetCeiling)} (${pct.toFixed(0)}%)`);
|
|
107
|
-
} else if (data.budgetSpent > 0) {
|
|
108
|
-
parts.push(`Spent: ${formatCost(data.budgetSpent)}`);
|
|
109
|
-
}
|
|
124
|
+
async function enrichHealthWidgetData(basePath: string, baseData: HealthWidgetData): Promise<HealthWidgetData> {
|
|
125
|
+
if (baseData.projectState !== "active") return baseData;
|
|
110
126
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
127
|
+
try {
|
|
128
|
+
invalidateStateCache();
|
|
129
|
+
const state = await deriveState(basePath);
|
|
115
130
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
parts.push(`Env: ${data.environmentWarningCount} warning${data.environmentWarningCount > 1 ? "s" : ""}`);
|
|
121
|
-
}
|
|
131
|
+
if (state.activeMilestone) {
|
|
132
|
+
// Warm the slice-progress cache so estimateTimeRemaining() has data
|
|
133
|
+
updateSliceProgressCache(basePath, state.activeMilestone.id, state.activeSlice?.id);
|
|
134
|
+
}
|
|
122
135
|
|
|
123
|
-
|
|
136
|
+
return {
|
|
137
|
+
...baseData,
|
|
138
|
+
executionPhase: state.phase,
|
|
139
|
+
executionStatus: summarizeExecutionStatus(state),
|
|
140
|
+
executionTarget: summarizeExecutionTarget(state),
|
|
141
|
+
nextAction: state.nextAction,
|
|
142
|
+
blocker: state.blockers[0] ?? null,
|
|
143
|
+
activeMilestoneId: state.activeMilestone?.id,
|
|
144
|
+
activeSliceId: state.activeSlice?.id,
|
|
145
|
+
activeTaskId: state.activeTask?.id,
|
|
146
|
+
progress: state.progress,
|
|
147
|
+
eta: state.phase === "blocked" || state.phase === "paused" || state.phase === "complete"
|
|
148
|
+
? null
|
|
149
|
+
: estimateTimeRemaining(),
|
|
150
|
+
};
|
|
151
|
+
} catch {
|
|
152
|
+
return baseData;
|
|
153
|
+
}
|
|
124
154
|
}
|
|
125
155
|
|
|
126
156
|
// ── Widget init ────────────────────────────────────────────────────────────────
|
|
@@ -137,20 +167,34 @@ export function initHealthWidget(ctx: ExtensionContext): void {
|
|
|
137
167
|
const basePath = projectRoot();
|
|
138
168
|
|
|
139
169
|
// String-array fallback — used in RPC mode (factory is a no-op there)
|
|
140
|
-
const initialData =
|
|
170
|
+
const initialData = loadBaseHealthWidgetData(basePath);
|
|
141
171
|
ctx.ui.setWidget("gsd-health", buildHealthLines(initialData), { placement: "belowEditor" });
|
|
142
172
|
|
|
143
173
|
// Factory-based widget for TUI mode — replaces the string-array above
|
|
144
174
|
ctx.ui.setWidget("gsd-health", (_tui, _theme) => {
|
|
145
175
|
let data = initialData;
|
|
146
176
|
let cachedLines: string[] | undefined;
|
|
177
|
+
let refreshInFlight = false;
|
|
147
178
|
|
|
148
|
-
const
|
|
179
|
+
const refresh = async () => {
|
|
180
|
+
if (refreshInFlight) return;
|
|
181
|
+
refreshInFlight = true;
|
|
149
182
|
try {
|
|
150
|
-
|
|
183
|
+
const baseData = loadBaseHealthWidgetData(basePath);
|
|
184
|
+
data = await enrichHealthWidgetData(basePath, baseData);
|
|
151
185
|
cachedLines = undefined;
|
|
152
186
|
_tui.requestRender();
|
|
153
|
-
} catch { /* non-fatal */ }
|
|
187
|
+
} catch { /* non-fatal */ } finally {
|
|
188
|
+
refreshInFlight = false;
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
// Fire first enrichment immediately. requestRender() inside is a no-op
|
|
193
|
+
// if the widget has not yet rendered, so this is safe before factory return.
|
|
194
|
+
void refresh();
|
|
195
|
+
|
|
196
|
+
const refreshTimer = setInterval(() => {
|
|
197
|
+
void refresh();
|
|
154
198
|
}, REFRESH_INTERVAL_MS);
|
|
155
199
|
|
|
156
200
|
return {
|
|
@@ -66,32 +66,24 @@ import { toPosixPath } from "../shared/mod.js";
|
|
|
66
66
|
import { isParallelActive, shutdownParallel } from "./parallel-orchestrator.js";
|
|
67
67
|
import { DEFAULT_BASH_TIMEOUT_SECS } from "./constants.js";
|
|
68
68
|
|
|
69
|
-
// ── Agent Instructions
|
|
70
|
-
//
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (existsSync(projectPath)) {
|
|
87
|
-
try {
|
|
88
|
-
const content = readFileSync(projectPath, "utf-8").trim();
|
|
89
|
-
if (content) parts.push(content);
|
|
90
|
-
} catch { /* non-fatal — skip unreadable file */ }
|
|
69
|
+
// ── Agent Instructions (DEPRECATED) ──────────────────────────────────────
|
|
70
|
+
// agent-instructions.md is deprecated. Use AGENTS.md or CLAUDE.md instead.
|
|
71
|
+
// Pi core natively supports AGENTS.md (with CLAUDE.md fallback) per directory.
|
|
72
|
+
|
|
73
|
+
function warnDeprecatedAgentInstructions(): void {
|
|
74
|
+
const paths = [
|
|
75
|
+
join(homedir(), ".gsd", "agent-instructions.md"),
|
|
76
|
+
join(process.cwd(), ".gsd", "agent-instructions.md"),
|
|
77
|
+
];
|
|
78
|
+
for (const p of paths) {
|
|
79
|
+
if (existsSync(p)) {
|
|
80
|
+
console.warn(
|
|
81
|
+
`[GSD] DEPRECATED: ${p} is no longer loaded. ` +
|
|
82
|
+
`Migrate your instructions to AGENTS.md (or CLAUDE.md) in the same directory. ` +
|
|
83
|
+
`See https://github.com/gsd-build/GSD-2/issues/1492`,
|
|
84
|
+
);
|
|
85
|
+
}
|
|
91
86
|
}
|
|
92
|
-
|
|
93
|
-
if (parts.length === 0) return null;
|
|
94
|
-
return parts.join("\n\n");
|
|
95
87
|
}
|
|
96
88
|
|
|
97
89
|
// ── Depth verification state ──────────────────────────────────────────────
|
|
@@ -175,7 +167,16 @@ export default function (pi: ExtensionAPI) {
|
|
|
175
167
|
// Pipe closed — nothing we can write; just exit cleanly
|
|
176
168
|
process.exit(0);
|
|
177
169
|
}
|
|
178
|
-
|
|
170
|
+
if ((err as NodeJS.ErrnoException).code === "ENOENT" &&
|
|
171
|
+
(err as any).syscall?.startsWith("spawn")) {
|
|
172
|
+
// spawn ENOENT — command not found (e.g., npx on Windows).
|
|
173
|
+
// This surfaces as an uncaught exception from child_process but
|
|
174
|
+
// is not a fatal process error. Log and continue instead of
|
|
175
|
+
// crashing auto-mode (#1384).
|
|
176
|
+
process.stderr.write(`[gsd] spawn ENOENT: ${(err as any).path ?? "unknown"} — command not found\n`);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
// Re-throw anything that isn't EPIPE/ENOENT so real crashes still surface
|
|
179
180
|
throw err;
|
|
180
181
|
};
|
|
181
182
|
process.on("uncaughtException", _gsdEpipeGuard);
|
|
@@ -673,12 +674,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
673
674
|
}
|
|
674
675
|
}
|
|
675
676
|
|
|
676
|
-
//
|
|
677
|
-
|
|
678
|
-
const agentInstructions = loadAgentInstructions();
|
|
679
|
-
if (agentInstructions) {
|
|
680
|
-
agentInstructionsBlock = `\n\n## Agent Instructions\n\nThe following instructions were provided by the user and must be followed in every session:\n\n${agentInstructions}`;
|
|
681
|
-
}
|
|
677
|
+
// Warn if deprecated agent-instructions.md files are still present
|
|
678
|
+
warnDeprecatedAgentInstructions();
|
|
682
679
|
|
|
683
680
|
const injection = await buildGuidedExecuteContextInjection(event.prompt, process.cwd());
|
|
684
681
|
|
|
@@ -723,7 +720,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
723
720
|
].join("\n");
|
|
724
721
|
}
|
|
725
722
|
|
|
726
|
-
const fullSystem = `${event.systemPrompt}\n\n[SYSTEM CONTEXT — GSD]\n\n${systemContent}${preferenceBlock}${
|
|
723
|
+
const fullSystem = `${event.systemPrompt}\n\n[SYSTEM CONTEXT — GSD]\n\n${systemContent}${preferenceBlock}${knowledgeBlock}${memoryBlock}${newSkillsBlock}${worktreeBlock}`;
|
|
727
724
|
stopContextTimer({
|
|
728
725
|
systemPromptSize: fullSystem.length,
|
|
729
726
|
injectionSize: injection?.length ?? 0,
|
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
* symlink replaces the original directory so all paths remain valid.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { existsSync, lstatSync, mkdirSync, readdirSync, renameSync, cpSync, rmSync, symlinkSync } from "node:fs";
|
|
9
|
+
import { existsSync, lstatSync, mkdirSync, readdirSync, realpathSync, renameSync, cpSync, rmSync, symlinkSync } from "node:fs";
|
|
10
10
|
import { join } from "node:path";
|
|
11
11
|
import { externalGsdRoot } from "./repo-identity.js";
|
|
12
12
|
import { getErrorMessage } from "./error-utils.js";
|
|
13
|
+
import { hasGitTrackedGsdFiles } from "./gitignore.js";
|
|
13
14
|
|
|
14
15
|
export interface MigrationResult {
|
|
15
16
|
migrated: boolean;
|
|
@@ -51,6 +52,28 @@ export function migrateToExternalState(basePath: string): MigrationResult {
|
|
|
51
52
|
return { migrated: false, error: `Cannot stat .gsd: ${getErrorMessage(err)}` };
|
|
52
53
|
}
|
|
53
54
|
|
|
55
|
+
// Skip if .gsd/ contains git-tracked files — the project intentionally
|
|
56
|
+
// keeps .gsd/ in version control and migration would destroy that.
|
|
57
|
+
if (hasGitTrackedGsdFiles(basePath)) {
|
|
58
|
+
return { migrated: false };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Skip if .gsd/worktrees/ has active worktree directories (#1337).
|
|
62
|
+
// On Windows, active git worktrees hold OS-level directory handles that
|
|
63
|
+
// prevent rename/delete. Attempting migration causes EBUSY and data loss.
|
|
64
|
+
const worktreesDir = join(localGsd, "worktrees");
|
|
65
|
+
if (existsSync(worktreesDir)) {
|
|
66
|
+
try {
|
|
67
|
+
const entries = readdirSync(worktreesDir, { withFileTypes: true });
|
|
68
|
+
if (entries.some(e => e.isDirectory())) {
|
|
69
|
+
return { migrated: false };
|
|
70
|
+
}
|
|
71
|
+
} catch {
|
|
72
|
+
// Can't read worktrees dir — skip migration to be safe
|
|
73
|
+
return { migrated: false };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
54
77
|
const externalPath = externalGsdRoot(basePath);
|
|
55
78
|
const migratingPath = join(basePath, ".gsd.migrating");
|
|
56
79
|
|
|
@@ -99,7 +122,29 @@ export function migrateToExternalState(basePath: string): MigrationResult {
|
|
|
99
122
|
// Create symlink .gsd -> external path
|
|
100
123
|
symlinkSync(externalPath, localGsd, "junction");
|
|
101
124
|
|
|
102
|
-
//
|
|
125
|
+
// Verify the symlink resolves correctly before removing the backup (#1377).
|
|
126
|
+
// On Windows, junction creation can silently succeed but resolve to the wrong
|
|
127
|
+
// target, or the external dir may not be accessible. If verification fails,
|
|
128
|
+
// restore from the backup.
|
|
129
|
+
try {
|
|
130
|
+
const resolved = realpathSync(localGsd);
|
|
131
|
+
const resolvedExternal = realpathSync(externalPath);
|
|
132
|
+
if (resolved !== resolvedExternal) {
|
|
133
|
+
// Symlink points to wrong target — restore backup
|
|
134
|
+
try { rmSync(localGsd, { force: true }); } catch { /* may not exist */ }
|
|
135
|
+
renameSync(migratingPath, localGsd);
|
|
136
|
+
return { migrated: false, error: `Migration verification failed: symlink resolves to ${resolved}, expected ${resolvedExternal}` };
|
|
137
|
+
}
|
|
138
|
+
// Verify we can read through the symlink
|
|
139
|
+
readdirSync(localGsd);
|
|
140
|
+
} catch (verifyErr) {
|
|
141
|
+
// Symlink broken or unreadable — restore backup
|
|
142
|
+
try { rmSync(localGsd, { force: true }); } catch { /* may not exist */ }
|
|
143
|
+
try { renameSync(migratingPath, localGsd); } catch { /* best-effort restore */ }
|
|
144
|
+
return { migrated: false, error: `Migration verification failed: ${getErrorMessage(verifyErr)}` };
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Remove .gsd.migrating only after symlink is verified
|
|
103
148
|
rmSync(migratingPath, { recursive: true, force: true });
|
|
104
149
|
|
|
105
150
|
return { migrated: true };
|
|
@@ -80,8 +80,9 @@ export function findMilestoneIds(basePath: string): string[] {
|
|
|
80
80
|
.filter((d) => d.isDirectory())
|
|
81
81
|
.map((d) => {
|
|
82
82
|
const match = d.name.match(/^(M\d+(?:-[a-z0-9]{6})?)/);
|
|
83
|
-
return match ? match[1] :
|
|
84
|
-
})
|
|
83
|
+
return match ? match[1] : null;
|
|
84
|
+
})
|
|
85
|
+
.filter((id): id is string => id !== null);
|
|
85
86
|
|
|
86
87
|
// Apply custom queue order if available, else fall back to numeric sort
|
|
87
88
|
const customOrder = loadQueueOrder(basePath);
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import { readdirSync, existsSync, realpathSync, Dirent } from "node:fs";
|
|
13
|
-
import { join } from "node:path";
|
|
13
|
+
import { join, dirname, normalize } from "node:path";
|
|
14
|
+
import { spawnSync } from "node:child_process";
|
|
14
15
|
import { nativeScanGsdTree, type GsdTreeEntry } from "./native-parser-bridge.js";
|
|
15
16
|
import { DIR_CACHE_MAX } from "./constants.js";
|
|
16
17
|
|
|
@@ -277,15 +278,80 @@ const LEGACY_GSD_ROOT_FILES: Record<GSDRootFileKey, string> = {
|
|
|
277
278
|
KNOWLEDGE: "knowledge.md",
|
|
278
279
|
};
|
|
279
280
|
|
|
281
|
+
// ─── GSD Root Discovery ───────────────────────────────────────────────────────
|
|
282
|
+
|
|
283
|
+
const gsdRootCache = new Map<string, string>();
|
|
284
|
+
|
|
285
|
+
/** Exported for tests only — do not call in production code. */
|
|
286
|
+
export function _clearGsdRootCache(): void {
|
|
287
|
+
gsdRootCache.clear();
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Resolve the `.gsd` directory for a given project base path.
|
|
292
|
+
*
|
|
293
|
+
* Probe order:
|
|
294
|
+
* 1. basePath/.gsd — fast path (common case)
|
|
295
|
+
* 2. git rev-parse root — handles cwd-is-a-subdirectory
|
|
296
|
+
* 3. Walk up from basePath — handles moved .gsd in an ancestor (bounded by git root)
|
|
297
|
+
* 4. basePath/.gsd — creation fallback (init scenario)
|
|
298
|
+
*
|
|
299
|
+
* Result is cached per basePath for the process lifetime.
|
|
300
|
+
*/
|
|
280
301
|
export function gsdRoot(basePath: string): string {
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
return
|
|
302
|
+
const cached = gsdRootCache.get(basePath);
|
|
303
|
+
if (cached) return cached;
|
|
304
|
+
|
|
305
|
+
const result = probeGsdRoot(basePath);
|
|
306
|
+
gsdRootCache.set(basePath, result);
|
|
307
|
+
return result;
|
|
287
308
|
}
|
|
288
309
|
|
|
310
|
+
function probeGsdRoot(rawBasePath: string): string {
|
|
311
|
+
// 1. Fast path — check the input path directly
|
|
312
|
+
const local = join(rawBasePath, ".gsd");
|
|
313
|
+
if (existsSync(local)) return local;
|
|
314
|
+
|
|
315
|
+
// Resolve symlinks so path comparisons work correctly across platforms
|
|
316
|
+
// (e.g. macOS /var → /private/var). Use rawBasePath as fallback if not resolvable.
|
|
317
|
+
let basePath: string;
|
|
318
|
+
try { basePath = realpathSync.native(rawBasePath); } catch { basePath = rawBasePath; }
|
|
319
|
+
|
|
320
|
+
// 2. Git root anchor — used as both probe target and walk-up boundary
|
|
321
|
+
// Only walk if we're inside a git project — prevents escaping into
|
|
322
|
+
// unrelated filesystem territory when running outside any repo.
|
|
323
|
+
let gitRoot: string | null = null;
|
|
324
|
+
try {
|
|
325
|
+
const out = spawnSync("git", ["rev-parse", "--show-toplevel"], {
|
|
326
|
+
cwd: basePath,
|
|
327
|
+
encoding: "utf-8",
|
|
328
|
+
});
|
|
329
|
+
if (out.status === 0) {
|
|
330
|
+
const r = out.stdout.trim();
|
|
331
|
+
if (r) gitRoot = normalize(r);
|
|
332
|
+
}
|
|
333
|
+
} catch { /* git not available */ }
|
|
334
|
+
|
|
335
|
+
if (gitRoot) {
|
|
336
|
+
const candidate = join(gitRoot, ".gsd");
|
|
337
|
+
if (existsSync(candidate)) return candidate;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// 3. Walk up from basePath to the git root (only if we are in a subdirectory)
|
|
341
|
+
if (gitRoot && basePath !== gitRoot) {
|
|
342
|
+
let cur = dirname(basePath);
|
|
343
|
+
while (cur !== basePath) {
|
|
344
|
+
const candidate = join(cur, ".gsd");
|
|
345
|
+
if (existsSync(candidate)) return candidate;
|
|
346
|
+
if (cur === gitRoot) break;
|
|
347
|
+
basePath = cur;
|
|
348
|
+
cur = dirname(cur);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// 4. Fallback for init/creation
|
|
353
|
+
return local;
|
|
354
|
+
}
|
|
289
355
|
export function milestonesDir(basePath: string): string {
|
|
290
356
|
return join(gsdRoot(basePath), "milestones");
|
|
291
357
|
}
|
|
@@ -149,11 +149,15 @@ function dequeueNextHook(basePath: string): HookDispatchResult | null {
|
|
|
149
149
|
|
|
150
150
|
// Build the prompt with variable substitution
|
|
151
151
|
const [mid, sid, tid] = triggerUnitId.split("/");
|
|
152
|
-
|
|
152
|
+
let prompt = config.prompt
|
|
153
153
|
.replace(/\{milestoneId\}/g, mid ?? "")
|
|
154
154
|
.replace(/\{sliceId\}/g, sid ?? "")
|
|
155
155
|
.replace(/\{taskId\}/g, tid ?? "");
|
|
156
156
|
|
|
157
|
+
// Inject browser safety instruction for hooks that may use browser tools (#1345).
|
|
158
|
+
// Vite HMR and other persistent connections prevent networkidle from resolving.
|
|
159
|
+
prompt += "\n\n**Browser tool safety:** Do NOT use `browser_wait_for` with `condition: \"network_idle\"` — it hangs indefinitely when dev servers keep persistent connections (Vite HMR, WebSocket). Use `selector_visible`, `text_visible`, or `delay` instead.";
|
|
160
|
+
|
|
157
161
|
return {
|
|
158
162
|
hookName: config.name,
|
|
159
163
|
prompt,
|
|
@@ -33,9 +33,24 @@ export function validatePreferences(preferences: GSDPreferences): {
|
|
|
33
33
|
const validated: GSDPreferences = {};
|
|
34
34
|
|
|
35
35
|
// ─── Unknown Key Detection ──────────────────────────────────────────
|
|
36
|
+
// Common key migration hints for pi-level settings that don't map to GSD prefs
|
|
37
|
+
const KEY_MIGRATION_HINTS: Record<string, string> = {
|
|
38
|
+
taskIsolation: 'use "git.isolation" instead (values: worktree, branch, none)',
|
|
39
|
+
task_isolation: 'use "git.isolation" instead (values: worktree, branch, none)',
|
|
40
|
+
isolation: 'use "git.isolation" instead (values: worktree, branch, none)',
|
|
41
|
+
manage_gitignore: 'use "git.manage_gitignore" instead',
|
|
42
|
+
auto_push: 'use "git.auto_push" instead',
|
|
43
|
+
main_branch: 'use "git.main_branch" instead',
|
|
44
|
+
};
|
|
45
|
+
|
|
36
46
|
for (const key of Object.keys(preferences)) {
|
|
37
47
|
if (!KNOWN_PREFERENCE_KEYS.has(key)) {
|
|
38
|
-
|
|
48
|
+
const hint = KEY_MIGRATION_HINTS[key];
|
|
49
|
+
if (hint) {
|
|
50
|
+
warnings.push(`unknown preference key "${key}" — ${hint}`);
|
|
51
|
+
} else {
|
|
52
|
+
warnings.push(`unknown preference key "${key}" — ignored`);
|
|
53
|
+
}
|
|
39
54
|
}
|
|
40
55
|
}
|
|
41
56
|
|
|
@@ -586,5 +601,43 @@ export function validatePreferences(preferences: GSDPreferences): {
|
|
|
586
601
|
}
|
|
587
602
|
}
|
|
588
603
|
|
|
604
|
+
// ─── Auto Visualize ─────────────────────────────────────────────────
|
|
605
|
+
if (preferences.auto_visualize !== undefined) {
|
|
606
|
+
if (typeof preferences.auto_visualize === "boolean") {
|
|
607
|
+
validated.auto_visualize = preferences.auto_visualize;
|
|
608
|
+
} else {
|
|
609
|
+
errors.push("auto_visualize must be a boolean");
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
// ─── Auto Report ────────────────────────────────────────────────────
|
|
614
|
+
if (preferences.auto_report !== undefined) {
|
|
615
|
+
if (typeof preferences.auto_report === "boolean") {
|
|
616
|
+
validated.auto_report = preferences.auto_report;
|
|
617
|
+
} else {
|
|
618
|
+
errors.push("auto_report must be a boolean");
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
// ─── Compression Strategy ───────────────────────────────────────────
|
|
623
|
+
if (preferences.compression_strategy !== undefined) {
|
|
624
|
+
const validStrategies = new Set(["truncate", "compress"]);
|
|
625
|
+
if (typeof preferences.compression_strategy === "string" && validStrategies.has(preferences.compression_strategy)) {
|
|
626
|
+
validated.compression_strategy = preferences.compression_strategy as GSDPreferences["compression_strategy"];
|
|
627
|
+
} else {
|
|
628
|
+
errors.push(`compression_strategy must be one of: truncate, compress`);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
// ─── Context Selection ──────────────────────────────────────────────
|
|
633
|
+
if (preferences.context_selection !== undefined) {
|
|
634
|
+
const validModes = new Set(["full", "smart"]);
|
|
635
|
+
if (typeof preferences.context_selection === "string" && validModes.has(preferences.context_selection)) {
|
|
636
|
+
validated.context_selection = preferences.context_selection as GSDPreferences["context_selection"];
|
|
637
|
+
} else {
|
|
638
|
+
errors.push(`context_selection must be one of: full, smart`);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
589
642
|
return { preferences: validated, errors, warnings };
|
|
590
643
|
}
|
|
@@ -15,9 +15,10 @@ import { homedir } from "node:os";
|
|
|
15
15
|
import { join } from "node:path";
|
|
16
16
|
import { gsdRoot } from "./paths.js";
|
|
17
17
|
import { parse as parseYaml } from "yaml";
|
|
18
|
-
import type { PostUnitHookConfig, PreDispatchHookConfig } from "./types.js";
|
|
18
|
+
import type { PostUnitHookConfig, PreDispatchHookConfig, TokenProfile } from "./types.js";
|
|
19
19
|
import type { DynamicRoutingConfig } from "./model-router.js";
|
|
20
20
|
import { normalizeStringArray } from "../shared/mod.js";
|
|
21
|
+
import { resolveProfileDefaults as _resolveProfileDefaults } from "./preferences-models.js";
|
|
21
22
|
|
|
22
23
|
import {
|
|
23
24
|
MODE_DEFAULTS,
|
|
@@ -141,6 +142,18 @@ export function loadEffectiveGSDPreferences(): LoadedGSDPreferences | null {
|
|
|
141
142
|
};
|
|
142
143
|
}
|
|
143
144
|
|
|
145
|
+
// Apply token-profile defaults as the lowest-priority layer so that
|
|
146
|
+
// `token_profile: budget` sets models and phase-skips automatically.
|
|
147
|
+
// Explicit user preferences always override profile defaults.
|
|
148
|
+
const profile = result.preferences.token_profile as TokenProfile | undefined;
|
|
149
|
+
if (profile) {
|
|
150
|
+
const profileDefaults = _resolveProfileDefaults(profile);
|
|
151
|
+
result = {
|
|
152
|
+
...result,
|
|
153
|
+
preferences: mergePreferences(profileDefaults as GSDPreferences, result.preferences),
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
144
157
|
// Apply mode defaults as the lowest-priority layer
|
|
145
158
|
if (result.preferences.mode) {
|
|
146
159
|
result = {
|
|
@@ -252,6 +265,8 @@ function mergePreferences(base: GSDPreferences, override: GSDPreferences): GSDPr
|
|
|
252
265
|
search_provider: override.search_provider ?? base.search_provider,
|
|
253
266
|
compression_strategy: override.compression_strategy ?? base.compression_strategy,
|
|
254
267
|
context_selection: override.context_selection ?? base.context_selection,
|
|
268
|
+
auto_visualize: override.auto_visualize ?? base.auto_visualize,
|
|
269
|
+
auto_report: override.auto_report ?? base.auto_report,
|
|
255
270
|
};
|
|
256
271
|
}
|
|
257
272
|
|
|
@@ -28,6 +28,8 @@ Then:
|
|
|
28
28
|
|
|
29
29
|
**Important:** Do NOT skip the success criteria and definition of done verification (steps 3-4). The milestone summary must reflect actual verified outcomes, not assumed success. If any criterion was not met, document it clearly in the summary and do not mark the milestone as passing verification.
|
|
30
30
|
|
|
31
|
+
**File system safety:** When scanning milestone directories for evidence, use `ls` or `find` to list directory contents first — never pass a directory path (e.g. `tasks/`, `slices/`) directly to the `read` tool. The `read` tool only accepts file paths, not directories.
|
|
32
|
+
|
|
31
33
|
**You MUST write `{{milestoneSummaryPath}}` AND update PROJECT.md before finishing.**
|
|
32
34
|
|
|
33
35
|
When done, say: "Milestone {{milestoneId}} complete."
|
|
@@ -67,4 +67,6 @@ If verdict is `needs-remediation`:
|
|
|
67
67
|
|
|
68
68
|
**You MUST write `{{validationPath}}` before finishing.**
|
|
69
69
|
|
|
70
|
+
**File system safety:** When scanning milestone directories for evidence, use `ls` or `find` to list directory contents first — never pass a directory path (e.g. `tasks/`, `slices/`) directly to the `read` tool. The `read` tool only accepts file paths, not directories.
|
|
71
|
+
|
|
70
72
|
When done, say: "Milestone {{milestoneId}} validation complete — verdict: <verdict>."
|