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
|
@@ -180,26 +180,36 @@ function checkPortConflicts(basePath: string): EnvironmentCheckResult[] {
|
|
|
180
180
|
const portsToCheck = new Set<number>();
|
|
181
181
|
const pkgPath = join(basePath, "package.json");
|
|
182
182
|
|
|
183
|
-
if (existsSync(pkgPath)) {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
183
|
+
if (!existsSync(pkgPath)) {
|
|
184
|
+
// No package.json — this isn't a Node.js project. Skip port checks
|
|
185
|
+
// entirely to avoid false positives from system services (e.g., macOS
|
|
186
|
+
// AirPlay Receiver on port 5000). (#1381)
|
|
187
|
+
return [];
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
try {
|
|
191
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
192
|
+
const scripts = pkg.scripts ?? {};
|
|
193
|
+
const scriptText = Object.values(scripts).join(" ");
|
|
194
|
+
|
|
195
|
+
// Look for --port NNNN, -p NNNN, PORT=NNNN, :NNNN patterns
|
|
196
|
+
const portMatches = scriptText.matchAll(/(?:--port\s+|(?:^|[^a-z])PORT[=:]\s*|-p\s+|:)(\d{4,5})\b/gi);
|
|
197
|
+
for (const m of portMatches) {
|
|
198
|
+
const port = parseInt(m[1], 10);
|
|
199
|
+
if (port >= 1024 && port <= 65535) portsToCheck.add(port);
|
|
197
200
|
}
|
|
201
|
+
} catch {
|
|
202
|
+
// parse failed — skip port checks rather than using defaults
|
|
203
|
+
return [];
|
|
198
204
|
}
|
|
199
205
|
|
|
200
|
-
// If no ports found in scripts, check common defaults
|
|
206
|
+
// If no ports found in scripts, check common defaults.
|
|
207
|
+
// Filter out port 5000 on macOS — AirPlay Receiver uses it by default (#1381).
|
|
201
208
|
if (portsToCheck.size === 0) {
|
|
202
|
-
for (const p of DEFAULT_DEV_PORTS)
|
|
209
|
+
for (const p of DEFAULT_DEV_PORTS) {
|
|
210
|
+
if (p === 5000 && process.platform === "darwin") continue;
|
|
211
|
+
portsToCheck.add(p);
|
|
212
|
+
}
|
|
203
213
|
}
|
|
204
214
|
|
|
205
215
|
for (const port of portsToCheck) {
|
|
@@ -20,6 +20,9 @@ import { gsdRoot, resolveGsdRootFile } from "./paths.js";
|
|
|
20
20
|
import { readCrashLock, isLockProcessAlive, clearLock } from "./crash-recovery.js";
|
|
21
21
|
import { abortAndReset } from "./git-self-heal.js";
|
|
22
22
|
import { rebuildState } from "./doctor.js";
|
|
23
|
+
import { deriveState } from "./state.js";
|
|
24
|
+
import { readIntegrationBranch } from "./git-service.js";
|
|
25
|
+
import { nativeBranchExists, nativeIsRepo } from "./native-git-bridge.js";
|
|
23
26
|
|
|
24
27
|
// ── Health Score Tracking ──────────────────────────────────────────────────
|
|
25
28
|
|
|
@@ -191,6 +194,27 @@ export async function preDispatchHealthGate(basePath: string): Promise<PreDispat
|
|
|
191
194
|
// Non-fatal — dispatch continues without STATE.md if rebuild fails
|
|
192
195
|
}
|
|
193
196
|
|
|
197
|
+
// ── Integration branch existence check ──
|
|
198
|
+
// If the active milestone's recorded integration branch no longer exists in
|
|
199
|
+
// git, the merge-back at the end of the milestone will fail. Block dispatch
|
|
200
|
+
// now to surface this before work is lost.
|
|
201
|
+
try {
|
|
202
|
+
if (nativeIsRepo(basePath)) {
|
|
203
|
+
const state = await deriveState(basePath);
|
|
204
|
+
if (state.activeMilestone) {
|
|
205
|
+
const integrationBranch = readIntegrationBranch(basePath, state.activeMilestone.id);
|
|
206
|
+
if (integrationBranch && !nativeBranchExists(basePath, integrationBranch)) {
|
|
207
|
+
issues.push(
|
|
208
|
+
`Integration branch "${integrationBranch}" for milestone ${state.activeMilestone.id} no longer exists in git. ` +
|
|
209
|
+
`Restore the branch or update the integration branch before dispatching. Run /gsd doctor for details.`,
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
} catch {
|
|
215
|
+
// Non-fatal — dispatch continues if state/branch check fails
|
|
216
|
+
}
|
|
217
|
+
|
|
194
218
|
// If we had critical issues that couldn't be auto-healed, block dispatch
|
|
195
219
|
if (issues.length > 0) {
|
|
196
220
|
return {
|
|
@@ -45,7 +45,15 @@ export type DoctorIssueCode =
|
|
|
45
45
|
| "env_python"
|
|
46
46
|
| "env_cargo"
|
|
47
47
|
| "env_go"
|
|
48
|
-
| "env_git_remote"
|
|
48
|
+
| "env_git_remote"
|
|
49
|
+
// Provider / auth checks
|
|
50
|
+
| "provider_key_missing"
|
|
51
|
+
| "provider_key_backedoff"
|
|
52
|
+
// Lock infrastructure checks
|
|
53
|
+
| "stranded_lock_directory"
|
|
54
|
+
// Git / worktree integrity checks
|
|
55
|
+
| "integration_branch_missing"
|
|
56
|
+
| "worktree_directory_orphaned";
|
|
49
57
|
|
|
50
58
|
/**
|
|
51
59
|
* Issue codes that represent expected completion-transition states.
|
|
@@ -11,6 +11,7 @@ import type { DoctorIssue, DoctorIssueCode } from "./doctor-types.js";
|
|
|
11
11
|
import { COMPLETION_TRANSITION_CODES } from "./doctor-types.js";
|
|
12
12
|
import { checkGitHealth, checkRuntimeHealth } from "./doctor-checks.js";
|
|
13
13
|
import { checkEnvironmentHealth } from "./doctor-environment.js";
|
|
14
|
+
import { runProviderChecks } from "./doctor-providers.js";
|
|
14
15
|
|
|
15
16
|
// ── Re-exports ─────────────────────────────────────────────────────────────
|
|
16
17
|
// All public types and functions from extracted modules are re-exported here
|
|
@@ -406,6 +407,40 @@ export async function runGSDDoctor(basePath: string, options?: { fix?: boolean;
|
|
|
406
407
|
issues.push(...auditRequirements(requirementsContent));
|
|
407
408
|
|
|
408
409
|
const state = await deriveState(basePath);
|
|
410
|
+
|
|
411
|
+
// Provider / auth health checks — only relevant when there is active work to dispatch.
|
|
412
|
+
// Skipped for idle projects (no active milestone) to avoid noise in environments
|
|
413
|
+
// where CI/test runners have no API key configured.
|
|
414
|
+
if (state.activeMilestone) {
|
|
415
|
+
try {
|
|
416
|
+
const providerResults = runProviderChecks();
|
|
417
|
+
for (const result of providerResults) {
|
|
418
|
+
if (!result.required) continue;
|
|
419
|
+
if (result.status === "error") {
|
|
420
|
+
issues.push({
|
|
421
|
+
severity: "warning",
|
|
422
|
+
code: "provider_key_missing",
|
|
423
|
+
scope: "project",
|
|
424
|
+
unitId: "project",
|
|
425
|
+
message: result.message + (result.detail ? ` — ${result.detail}` : ""),
|
|
426
|
+
fixable: false,
|
|
427
|
+
});
|
|
428
|
+
} else if (result.status === "warning") {
|
|
429
|
+
issues.push({
|
|
430
|
+
severity: "warning",
|
|
431
|
+
code: "provider_key_backedoff",
|
|
432
|
+
scope: "project",
|
|
433
|
+
unitId: "project",
|
|
434
|
+
message: result.message + (result.detail ? ` — ${result.detail}` : ""),
|
|
435
|
+
fixable: false,
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
} catch {
|
|
440
|
+
// Non-fatal — provider check failure should not block other checks
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
409
444
|
for (const milestone of state.registry) {
|
|
410
445
|
const milestoneId = milestone.id;
|
|
411
446
|
const milestonePath = resolveMilestonePath(basePath, milestoneId);
|
|
@@ -590,7 +590,8 @@ export async function loadFile(path: string): Promise<string | null> {
|
|
|
590
590
|
try {
|
|
591
591
|
return await fs.readFile(path, 'utf-8');
|
|
592
592
|
} catch (err: unknown) {
|
|
593
|
-
|
|
593
|
+
const code = (err as NodeJS.ErrnoException).code;
|
|
594
|
+
if (code === 'ENOENT' || code === 'EISDIR') return null;
|
|
594
595
|
throw err;
|
|
595
596
|
}
|
|
596
597
|
}
|
|
@@ -804,7 +805,7 @@ export async function inlinePriorMilestoneSummary(mid: string, base: string): Pr
|
|
|
804
805
|
* file not on disk) - callers can distinguish "no manifest" from "empty manifest".
|
|
805
806
|
*/
|
|
806
807
|
export async function getManifestStatus(
|
|
807
|
-
base: string, milestoneId: string,
|
|
808
|
+
base: string, milestoneId: string, projectRoot?: string,
|
|
808
809
|
): Promise<ManifestStatus | null> {
|
|
809
810
|
const resolvedPath = resolveMilestoneFile(base, milestoneId, 'SECRETS');
|
|
810
811
|
if (!resolvedPath) return null;
|
|
@@ -814,9 +815,18 @@ export async function getManifestStatus(
|
|
|
814
815
|
|
|
815
816
|
const manifest = parseSecretsManifest(content);
|
|
816
817
|
const keys = manifest.entries.map(e => e.key);
|
|
818
|
+
|
|
819
|
+
// Check both the base path .env AND the project root .env (#1387).
|
|
820
|
+
// In worktree mode, base is the worktree path which may not have .env.
|
|
821
|
+
// The project root's .env is where the user actually defined their keys.
|
|
817
822
|
const existingKeys = await checkExistingEnvKeys(keys, resolve(base, '.env'));
|
|
818
823
|
const existingSet = new Set(existingKeys);
|
|
819
824
|
|
|
825
|
+
if (projectRoot && projectRoot !== base) {
|
|
826
|
+
const rootKeys = await checkExistingEnvKeys(keys, resolve(projectRoot, '.env'));
|
|
827
|
+
for (const k of rootKeys) existingSet.add(k);
|
|
828
|
+
}
|
|
829
|
+
|
|
820
830
|
const result: ManifestStatus = {
|
|
821
831
|
pending: [],
|
|
822
832
|
collected: [],
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { join } from "node:path";
|
|
10
|
-
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
11
|
-
import { nativeRmCached } from "./native-git-bridge.js";
|
|
10
|
+
import { existsSync, lstatSync, readFileSync, writeFileSync } from "node:fs";
|
|
11
|
+
import { nativeRmCached, nativeLsFiles } from "./native-git-bridge.js";
|
|
12
12
|
import { gsdRoot } from "./paths.js";
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -79,12 +79,47 @@ const BASELINE_PATTERNS = [
|
|
|
79
79
|
];
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
82
|
+
* Check whether `.gsd/` contains files tracked by git.
|
|
83
|
+
* If so, the project intentionally keeps `.gsd/` in version control
|
|
84
|
+
* and we must NOT add `.gsd` to `.gitignore` or attempt migration.
|
|
85
|
+
*
|
|
86
|
+
* Returns true if git tracks at least one file under `.gsd/`.
|
|
87
|
+
* Returns false (safe to ignore) if:
|
|
88
|
+
* - Not a git repo
|
|
89
|
+
* - `.gsd/` is a symlink (external state, should be ignored)
|
|
90
|
+
* - `.gsd/` doesn't exist
|
|
91
|
+
* - No tracked files found under `.gsd/`
|
|
92
|
+
*/
|
|
93
|
+
export function hasGitTrackedGsdFiles(basePath: string): boolean {
|
|
94
|
+
const localGsd = join(basePath, ".gsd");
|
|
95
|
+
|
|
96
|
+
// If .gsd doesn't exist or is already a symlink, no tracked files concern
|
|
97
|
+
if (!existsSync(localGsd)) return false;
|
|
98
|
+
try {
|
|
99
|
+
if (lstatSync(localGsd).isSymbolicLink()) return false;
|
|
100
|
+
} catch {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Check if git tracks any files under .gsd/
|
|
105
|
+
try {
|
|
106
|
+
const tracked = nativeLsFiles(basePath, ".gsd");
|
|
107
|
+
return tracked.length > 0;
|
|
108
|
+
} catch {
|
|
109
|
+
// Not a git repo or git not available — safe to proceed
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Ensure basePath/.gitignore contains baseline ignore patterns.
|
|
116
|
+
* Creates the file if missing; appends missing patterns.
|
|
84
117
|
* Returns true if the file was created or modified, false if already complete.
|
|
85
118
|
*
|
|
86
|
-
* `.gsd/`
|
|
87
|
-
*
|
|
119
|
+
* **Safety check:** If `.gsd/` contains git-tracked files (i.e., the project
|
|
120
|
+
* intentionally keeps `.gsd/` in version control), the `.gsd` ignore pattern
|
|
121
|
+
* is excluded to prevent data loss. Only the `.gsd` pattern is affected —
|
|
122
|
+
* all other baseline patterns are still applied normally.
|
|
88
123
|
*/
|
|
89
124
|
export function ensureGitignore(
|
|
90
125
|
basePath: string,
|
|
@@ -108,8 +143,15 @@ export function ensureGitignore(
|
|
|
108
143
|
.filter((l) => l && !l.startsWith("#")),
|
|
109
144
|
);
|
|
110
145
|
|
|
146
|
+
// Determine which patterns to apply. If .gsd/ has tracked files,
|
|
147
|
+
// exclude the ".gsd" pattern to prevent deleting tracked state.
|
|
148
|
+
const gsdIsTracked = hasGitTrackedGsdFiles(basePath);
|
|
149
|
+
const patternsToApply = gsdIsTracked
|
|
150
|
+
? BASELINE_PATTERNS.filter((p) => p !== ".gsd")
|
|
151
|
+
: BASELINE_PATTERNS;
|
|
152
|
+
|
|
111
153
|
// Find patterns not yet present
|
|
112
|
-
const missing =
|
|
154
|
+
const missing = patternsToApply.filter((p) => !existingLines.has(p));
|
|
113
155
|
|
|
114
156
|
if (missing.length === 0) return false;
|
|
115
157
|
|
|
@@ -135,6 +177,11 @@ export function ensureGitignore(
|
|
|
135
177
|
* already in the index even after .gitignore is updated.
|
|
136
178
|
*
|
|
137
179
|
* Only removes from the index (`--cached`), never from disk. Idempotent.
|
|
180
|
+
*
|
|
181
|
+
* Note: These are strictly runtime/ephemeral paths (activity logs, lock files,
|
|
182
|
+
* metrics, STATE.md). They are always safe to untrack, even when the project
|
|
183
|
+
* intentionally keeps other `.gsd/` files (like PROJECT.md, milestones/) in
|
|
184
|
+
* version control.
|
|
138
185
|
*/
|
|
139
186
|
export function untrackRuntimeFiles(basePath: string): void {
|
|
140
187
|
const runtimePaths = GSD_RUNTIME_PATTERNS;
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
} from "./paths.js";
|
|
24
24
|
import { join } from "node:path";
|
|
25
25
|
import { readFileSync, existsSync, mkdirSync, readdirSync, rmSync, unlinkSync } from "node:fs";
|
|
26
|
+
import { readSessionLockData, isSessionLockProcessAlive } from "./session-lock.js";
|
|
26
27
|
import { nativeIsRepo, nativeInit } from "./native-git-bridge.js";
|
|
27
28
|
import { ensureGitignore, ensurePreferences, untrackRuntimeFiles } from "./gitignore.js";
|
|
28
29
|
import { loadEffectiveGSDPreferences } from "./preferences.js";
|
|
@@ -191,7 +192,7 @@ type UIContext = ExtensionContext;
|
|
|
191
192
|
* This is the only way the wizard triggers work — everything else is the LLM's job.
|
|
192
193
|
*/
|
|
193
194
|
function dispatchWorkflow(pi: ExtensionAPI, note: string, customType = "gsd-run"): void {
|
|
194
|
-
const workflowPath = process.env.GSD_WORKFLOW_PATH ?? join(process.env.HOME ?? "~", ".
|
|
195
|
+
const workflowPath = process.env.GSD_WORKFLOW_PATH ?? join(process.env.HOME ?? "~", ".gsd", "agent", "GSD-WORKFLOW.md");
|
|
195
196
|
const workflow = readFileSync(workflowPath, "utf-8");
|
|
196
197
|
|
|
197
198
|
pi.sendMessage(
|
|
@@ -516,8 +517,13 @@ export async function showDiscuss(
|
|
|
516
517
|
// If all pending slices are discussed, notify and exit instead of looping
|
|
517
518
|
const allDiscussed = pendingSlices.every(s => discussedMap.get(s.id));
|
|
518
519
|
if (allDiscussed) {
|
|
520
|
+
const lockData = readSessionLockData(basePath);
|
|
521
|
+
const remoteAutoRunning = lockData && lockData.pid !== process.pid && isSessionLockProcessAlive(lockData);
|
|
522
|
+
const nextStep = remoteAutoRunning
|
|
523
|
+
? "Auto-mode is already running — use /gsd status to check progress."
|
|
524
|
+
: "Run /gsd to start planning.";
|
|
519
525
|
ctx.ui.notify(
|
|
520
|
-
`All ${pendingSlices.length} slices discussed.
|
|
526
|
+
`All ${pendingSlices.length} slices discussed. ${nextStep}`,
|
|
521
527
|
"info",
|
|
522
528
|
);
|
|
523
529
|
return;
|
|
@@ -788,9 +794,11 @@ export async function showSmartEntry(
|
|
|
788
794
|
// ── Self-heal stale runtime records from crashed auto-mode sessions ──
|
|
789
795
|
selfHealRuntimeRecords(basePath, ctx);
|
|
790
796
|
|
|
791
|
-
// Check for crash from previous auto-mode session
|
|
797
|
+
// Check for crash from previous auto-mode session.
|
|
798
|
+
// Skip if the lock was written by the current process — acquireSessionLock()
|
|
799
|
+
// writes to the same file, so we'd always false-positive (#1398).
|
|
792
800
|
const crashLock = readCrashLock(basePath);
|
|
793
|
-
if (crashLock) {
|
|
801
|
+
if (crashLock && crashLock.pid !== process.pid) {
|
|
794
802
|
clearLock(basePath);
|
|
795
803
|
|
|
796
804
|
// Bootstrap crash with zero completed units = no work was lost.
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure GSD health widget logic.
|
|
3
|
+
*
|
|
4
|
+
* Separates project-state detection and line rendering from the widget's
|
|
5
|
+
* runtime integrations so the regressions can be tested directly.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
9
|
+
import { gsdRoot } from "./paths.js";
|
|
10
|
+
import { join } from "node:path";
|
|
11
|
+
import type { GSDState, Phase } from "./types.js";
|
|
12
|
+
|
|
13
|
+
export type HealthWidgetProjectState = "none" | "initialized" | "active";
|
|
14
|
+
|
|
15
|
+
export interface HealthWidgetData {
|
|
16
|
+
projectState: HealthWidgetProjectState;
|
|
17
|
+
budgetCeiling: number | undefined;
|
|
18
|
+
budgetSpent: number;
|
|
19
|
+
providerIssue: string | null;
|
|
20
|
+
environmentErrorCount: number;
|
|
21
|
+
environmentWarningCount: number;
|
|
22
|
+
lastRefreshed: number;
|
|
23
|
+
executionPhase?: Phase;
|
|
24
|
+
executionStatus?: string;
|
|
25
|
+
executionTarget?: string;
|
|
26
|
+
nextAction?: string;
|
|
27
|
+
blocker?: string | null;
|
|
28
|
+
activeMilestoneId?: string;
|
|
29
|
+
activeSliceId?: string;
|
|
30
|
+
activeTaskId?: string;
|
|
31
|
+
progress?: GSDState["progress"];
|
|
32
|
+
eta?: string | null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function detectHealthWidgetProjectState(basePath: string): HealthWidgetProjectState {
|
|
36
|
+
const root = gsdRoot(basePath);
|
|
37
|
+
if (!existsSync(root)) return "none";
|
|
38
|
+
|
|
39
|
+
// Lightweight milestone count — avoids the full detectProjectState() scan
|
|
40
|
+
// (CI markers, Makefile targets, etc.) that is unnecessary on the 60s refresh.
|
|
41
|
+
try {
|
|
42
|
+
const milestonesDir = join(root, "milestones");
|
|
43
|
+
if (existsSync(milestonesDir)) {
|
|
44
|
+
const entries = readdirSync(milestonesDir, { withFileTypes: true });
|
|
45
|
+
if (entries.some(e => e.isDirectory())) return "active";
|
|
46
|
+
}
|
|
47
|
+
} catch { /* non-fatal */ }
|
|
48
|
+
|
|
49
|
+
return "initialized";
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function formatCost(n: number): string {
|
|
53
|
+
return n >= 1 ? `$${n.toFixed(2)}` : `${(n * 100).toFixed(1)}¢`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function formatProgress(progress?: GSDState["progress"]): string | null {
|
|
57
|
+
if (!progress) return null;
|
|
58
|
+
|
|
59
|
+
const parts: string[] = [];
|
|
60
|
+
parts.push(`M ${progress.milestones.done}/${progress.milestones.total}`);
|
|
61
|
+
if (progress.slices) parts.push(`S ${progress.slices.done}/${progress.slices.total}`);
|
|
62
|
+
if (progress.tasks) parts.push(`T ${progress.tasks.done}/${progress.tasks.total}`);
|
|
63
|
+
return parts.length > 0 ? `Progress: ${parts.join(" · ")}` : null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function formatEnvironmentSummary(errorCount: number, warningCount: number): string | null {
|
|
67
|
+
if (errorCount <= 0 && warningCount <= 0) return null;
|
|
68
|
+
|
|
69
|
+
const parts: string[] = [];
|
|
70
|
+
if (errorCount > 0) parts.push(`${errorCount} error${errorCount > 1 ? "s" : ""}`);
|
|
71
|
+
if (warningCount > 0) parts.push(`${warningCount} warning${warningCount > 1 ? "s" : ""}`);
|
|
72
|
+
return `Env: ${parts.join(", ")}`;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function formatBudgetSummary(data: HealthWidgetData): string | null {
|
|
76
|
+
if (data.budgetCeiling !== undefined && data.budgetCeiling > 0) {
|
|
77
|
+
const pct = Math.min(100, (data.budgetSpent / data.budgetCeiling) * 100);
|
|
78
|
+
return `Budget: ${formatCost(data.budgetSpent)}/${formatCost(data.budgetCeiling)} (${pct.toFixed(0)}%)`;
|
|
79
|
+
}
|
|
80
|
+
if (data.budgetSpent > 0) {
|
|
81
|
+
return `Spent: ${formatCost(data.budgetSpent)}`;
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function buildExecutionHeadline(data: HealthWidgetData): string {
|
|
87
|
+
const status = data.executionStatus ?? "Active project";
|
|
88
|
+
const target = data.executionTarget ?? data.blocker ?? "loading status…";
|
|
89
|
+
return ` GSD ${status}${target ? ` - ${target}` : ""}`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Build compact health lines for the widget.
|
|
94
|
+
* Returns a string array suitable for setWidget().
|
|
95
|
+
*/
|
|
96
|
+
export function buildHealthLines(data: HealthWidgetData): string[] {
|
|
97
|
+
if (data.projectState === "none") {
|
|
98
|
+
return [" GSD No project loaded — run /gsd to start"];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (data.projectState === "initialized") {
|
|
102
|
+
return [" GSD Project initialized — run /gsd to continue setup"];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const lines = [buildExecutionHeadline(data)];
|
|
106
|
+
const details: string[] = [];
|
|
107
|
+
|
|
108
|
+
const progress = formatProgress(data.progress);
|
|
109
|
+
if (progress) details.push(progress);
|
|
110
|
+
|
|
111
|
+
if (data.providerIssue) details.push(data.providerIssue);
|
|
112
|
+
|
|
113
|
+
const environment = formatEnvironmentSummary(
|
|
114
|
+
data.environmentErrorCount,
|
|
115
|
+
data.environmentWarningCount,
|
|
116
|
+
);
|
|
117
|
+
if (environment) details.push(environment);
|
|
118
|
+
|
|
119
|
+
const budget = formatBudgetSummary(data);
|
|
120
|
+
if (budget) details.push(budget);
|
|
121
|
+
|
|
122
|
+
if (data.eta) details.push(data.eta);
|
|
123
|
+
|
|
124
|
+
if (details.length > 0) {
|
|
125
|
+
lines.push(` ${details.join(" │ ")}`);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return lines;
|
|
129
|
+
}
|