gsd-pi 2.34.0-dev.ed0bfbf → 2.35.0-dev.30eec3f
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/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 +10 -1
- 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.js +8 -1
- 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 +5 -3
- 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 +10 -1
- package/dist/resources/extensions/gsd/migrate-external.js +55 -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 +2 -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 +26 -2
- package/dist/resources/extensions/gsd/templates/plan.md +8 -0
- package/dist/resources/extensions/gsd/worktree-resolver.js +12 -0
- 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/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.map +1 -1
- package/packages/pi-agent-core/dist/proxy.js +2 -8
- 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 +2 -8
- 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/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/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/src/providers/azure-openai-responses.ts +11 -45
- 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/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-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/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 -0
- 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 -243
- 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/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/config.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/lsp/config.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/config.js +4 -1
- package/packages/pi-coding-agent/dist/core/lsp/config.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.map +1 -1
- package/packages/pi-coding-agent/dist/core/lsp/lspmux.js +2 -21
- 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/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/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 -1
- package/packages/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/session-manager.js +3 -28
- 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 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +76 -166
- 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/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/theme/theme.d.ts +65 -0
- 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 -16
- 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/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/package.json +1 -1
- 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/extensions/index.ts +1 -21
- package/packages/pi-coding-agent/src/core/extensions/runner.ts +119 -243
- package/packages/pi-coding-agent/src/core/extensions/types.ts +50 -69
- package/packages/pi-coding-agent/src/core/lock-utils.ts +113 -0
- package/packages/pi-coding-agent/src/core/lsp/config.ts +4 -1
- package/packages/pi-coding-agent/src/core/lsp/index.ts +83 -152
- package/packages/pi-coding-agent/src/core/lsp/lspmux.ts +2 -22
- package/packages/pi-coding-agent/src/core/lsp/types.ts +0 -29
- package/packages/pi-coding-agent/src/core/package-manager.ts +1 -4
- 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 +3 -30
- package/packages/pi-coding-agent/src/core/settings-manager.ts +85 -164
- 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/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/theme/theme.ts +7 -18
- 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/error.ts +6 -0
- 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/src/components/markdown.ts +25 -29
- package/packages/pi-tui/src/keys.ts +94 -173
- package/pkg/dist/modes/interactive/theme/theme.d.ts +65 -0
- package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.js +6 -16
- 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 +11 -1
- 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.ts +9 -1
- 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 +5 -3
- 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 +10 -1
- package/src/resources/extensions/gsd/migrate-external.ts +47 -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 +2 -0
- 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 +29 -2
- 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/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 +2 -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/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
|
@@ -1,478 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* General-purpose multi-page wizard UI.
|
|
3
|
-
*
|
|
4
|
-
* Supports declarative page definitions with select and text fields.
|
|
5
|
-
* Pages can conditionally route to different next pages based on answers.
|
|
6
|
-
*
|
|
7
|
-
* Navigation:
|
|
8
|
-
* ← go back one page (on page 1: triggers exit confirmation)
|
|
9
|
-
* → / Enter advance to next page (or submit on last page)
|
|
10
|
-
* Escape triggers exit confirmation overlay
|
|
11
|
-
*
|
|
12
|
-
* Exit confirmation (shown on Escape or ← from page 1):
|
|
13
|
-
* 1. Go back — dismiss and return to current page
|
|
14
|
-
* 2. Exit — cancel the wizard, returns null to caller
|
|
15
|
-
*
|
|
16
|
-
* Returns:
|
|
17
|
-
* Record<pageId, Record<fieldId, string | string[]>> on completion
|
|
18
|
-
* null on exit/cancel
|
|
19
|
-
*
|
|
20
|
-
* Example:
|
|
21
|
-
*
|
|
22
|
-
* const result = await showWizard(ctx, {
|
|
23
|
-
* title: "New Project",
|
|
24
|
-
* pages: [
|
|
25
|
-
* {
|
|
26
|
-
* id: "mode",
|
|
27
|
-
* fields: [
|
|
28
|
-
* {
|
|
29
|
-
* type: "select",
|
|
30
|
-
* id: "start_type",
|
|
31
|
-
* question: "How do you want to start?",
|
|
32
|
-
* options: [
|
|
33
|
-
* { label: "Describe it", description: "Type what you want to build." },
|
|
34
|
-
* { label: "Provide a file", description: "Point to an existing doc." },
|
|
35
|
-
* ],
|
|
36
|
-
* },
|
|
37
|
-
* ],
|
|
38
|
-
* next: (answers) =>
|
|
39
|
-
* answers["mode"]?.["start_type"] === "Provide a file" ? "file_path" : null,
|
|
40
|
-
* },
|
|
41
|
-
* {
|
|
42
|
-
* id: "file_path",
|
|
43
|
-
* fields: [
|
|
44
|
-
* { type: "text", id: "path", label: "File path", placeholder: "/path/to/doc.md" },
|
|
45
|
-
* ],
|
|
46
|
-
* next: () => null,
|
|
47
|
-
* },
|
|
48
|
-
* ],
|
|
49
|
-
* });
|
|
50
|
-
*
|
|
51
|
-
* if (!result) return; // user exited
|
|
52
|
-
* const startType = result["mode"]["start_type"]; // "Describe it" | "Provide a file"
|
|
53
|
-
* const filePath = result["file_path"]?.["path"];
|
|
54
|
-
*/
|
|
55
|
-
import { Editor, Key, matchesKey, truncateToWidth, } from "@gsd/pi-tui";
|
|
56
|
-
import { makeUI } from "./ui.js";
|
|
57
|
-
// ─── Main export ──────────────────────────────────────────────────────────────
|
|
58
|
-
/**
|
|
59
|
-
* Show a multi-page wizard and return collected answers, or null if the user exits.
|
|
60
|
-
*/
|
|
61
|
-
export async function showWizard(ctx, opts) {
|
|
62
|
-
const pageMap = new Map(opts.pages.map((p) => [p.id, p]));
|
|
63
|
-
return ctx.ui.custom((tui, theme, _kb, done) => {
|
|
64
|
-
// ── State ──────────────────────────────────────────────────────────────
|
|
65
|
-
/** Stack of page ids visited — drives back navigation */
|
|
66
|
-
const pageStack = [opts.pages[0].id];
|
|
67
|
-
const pageStates = new Map();
|
|
68
|
-
/** Collected answers across all pages */
|
|
69
|
-
const answers = {};
|
|
70
|
-
/** Whether the exit-confirmation overlay is showing */
|
|
71
|
-
let showingExitConfirm = false;
|
|
72
|
-
/** Cursor in the exit-confirm overlay: 0 = go back, 1 = exit */
|
|
73
|
-
let exitCursor = 0;
|
|
74
|
-
let cachedLines;
|
|
75
|
-
// Editors keyed by fieldId — one per text field
|
|
76
|
-
// editorTheme is derived from the design system at first render
|
|
77
|
-
const editors = new Map();
|
|
78
|
-
let resolvedEditorTheme = null;
|
|
79
|
-
function getEditor(fieldId) {
|
|
80
|
-
if (!resolvedEditorTheme)
|
|
81
|
-
resolvedEditorTheme = makeUI(theme, 80).editorTheme;
|
|
82
|
-
if (!editors.has(fieldId))
|
|
83
|
-
editors.set(fieldId, new Editor(tui, resolvedEditorTheme));
|
|
84
|
-
return editors.get(fieldId);
|
|
85
|
-
}
|
|
86
|
-
// ── Page state helpers ─────────────────────────────────────────────────
|
|
87
|
-
function getPageState(pageId) {
|
|
88
|
-
if (!pageStates.has(pageId)) {
|
|
89
|
-
pageStates.set(pageId, {
|
|
90
|
-
selectStates: new Map(),
|
|
91
|
-
textValues: new Map(),
|
|
92
|
-
focusedFieldId: null,
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
return pageStates.get(pageId);
|
|
96
|
-
}
|
|
97
|
-
function getSelectState(pageId, fieldId, _optCount) {
|
|
98
|
-
const ps = getPageState(pageId);
|
|
99
|
-
if (!ps.selectStates.has(fieldId)) {
|
|
100
|
-
ps.selectStates.set(fieldId, {
|
|
101
|
-
cursorIndex: 0,
|
|
102
|
-
committedIndex: null, // nothing pre-committed — user must explicitly confirm
|
|
103
|
-
checkedIndices: new Set(),
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
return ps.selectStates.get(fieldId);
|
|
107
|
-
}
|
|
108
|
-
// ── Current page ───────────────────────────────────────────────────────
|
|
109
|
-
function currentPageId() {
|
|
110
|
-
return pageStack[pageStack.length - 1];
|
|
111
|
-
}
|
|
112
|
-
function currentPage() {
|
|
113
|
-
return pageMap.get(currentPageId());
|
|
114
|
-
}
|
|
115
|
-
function currentPageState() {
|
|
116
|
-
return getPageState(currentPageId());
|
|
117
|
-
}
|
|
118
|
-
// ── Validation ─────────────────────────────────────────────────────────
|
|
119
|
-
function isPageComplete(page, ps) {
|
|
120
|
-
for (const field of page.fields) {
|
|
121
|
-
if (field.type === "select") {
|
|
122
|
-
const ss = ps.selectStates.get(field.id);
|
|
123
|
-
if (!ss)
|
|
124
|
-
return false;
|
|
125
|
-
if (field.allowMultiple) {
|
|
126
|
-
if (ss.checkedIndices.size === 0)
|
|
127
|
-
return false;
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
if (ss.committedIndex === null)
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
const val = ps.textValues.get(field.id) ?? "";
|
|
136
|
-
if (!val.trim())
|
|
137
|
-
return false;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return true;
|
|
141
|
-
}
|
|
142
|
-
// ── Collect answers for a page ─────────────────────────────────────────
|
|
143
|
-
function collectPageAnswers(page, ps) {
|
|
144
|
-
const result = {};
|
|
145
|
-
for (const field of page.fields) {
|
|
146
|
-
if (field.type === "select") {
|
|
147
|
-
const ss = ps.selectStates.get(field.id);
|
|
148
|
-
if (!ss)
|
|
149
|
-
continue;
|
|
150
|
-
if (field.allowMultiple) {
|
|
151
|
-
result[field.id] = Array.from(ss.checkedIndices)
|
|
152
|
-
.sort((a, b) => a - b)
|
|
153
|
-
.map((i) => field.options[i].label);
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
if (ss.committedIndex !== null && ss.committedIndex < field.options.length) {
|
|
157
|
-
result[field.id] = field.options[ss.committedIndex].label;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
result[field.id] = ps.textValues.get(field.id) ?? "";
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
return result;
|
|
166
|
-
}
|
|
167
|
-
// ── Auto-focus helper ──────────────────────────────────────────────────
|
|
168
|
-
/** If a page's first field is a text field, focus it immediately on arrival. */
|
|
169
|
-
function autoFocusPageIfText(pageId) {
|
|
170
|
-
const page = pageMap.get(pageId);
|
|
171
|
-
if (!page)
|
|
172
|
-
return;
|
|
173
|
-
const firstField = page.fields[0];
|
|
174
|
-
if (firstField?.type === "text") {
|
|
175
|
-
const ps = getPageState(pageId);
|
|
176
|
-
ps.focusedFieldId = firstField.id;
|
|
177
|
-
const editor = getEditor(firstField.id);
|
|
178
|
-
editor.setText(ps.textValues.get(firstField.id) ?? "");
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
// Auto-focus the first page if it starts with a text field
|
|
182
|
-
autoFocusPageIfText(opts.pages[0].id);
|
|
183
|
-
// ── Navigation ─────────────────────────────────────────────────────────
|
|
184
|
-
function advance() {
|
|
185
|
-
const page = currentPage();
|
|
186
|
-
const ps = currentPageState();
|
|
187
|
-
if (!isPageComplete(page, ps)) {
|
|
188
|
-
refresh();
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
// Save text field values from editors
|
|
192
|
-
for (const field of page.fields) {
|
|
193
|
-
if (field.type === "text") {
|
|
194
|
-
ps.textValues.set(field.id, getEditor(field.id).getText().trim());
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
// Collect answers for this page
|
|
198
|
-
answers[page.id] = collectPageAnswers(page, ps);
|
|
199
|
-
// Route to next page
|
|
200
|
-
const nextId = page.next ? page.next(answers) : null;
|
|
201
|
-
if (!nextId) {
|
|
202
|
-
// End of wizard
|
|
203
|
-
done(answers);
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
const nextPage = pageMap.get(nextId);
|
|
207
|
-
if (!nextPage) {
|
|
208
|
-
done(answers);
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
pageStack.push(nextId);
|
|
212
|
-
autoFocusPageIfText(nextId);
|
|
213
|
-
refresh();
|
|
214
|
-
}
|
|
215
|
-
function goBack() {
|
|
216
|
-
if (pageStack.length <= 1) {
|
|
217
|
-
// Already at first page — Esc here means exit
|
|
218
|
-
showingExitConfirm = true;
|
|
219
|
-
exitCursor = 0;
|
|
220
|
-
refresh();
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
pageStack.pop();
|
|
224
|
-
autoFocusPageIfText(currentPageId());
|
|
225
|
-
refresh();
|
|
226
|
-
}
|
|
227
|
-
function refresh() {
|
|
228
|
-
cachedLines = undefined;
|
|
229
|
-
tui.requestRender();
|
|
230
|
-
}
|
|
231
|
-
// ── Input handler ──────────────────────────────────────────────────────
|
|
232
|
-
function handleInput(data) {
|
|
233
|
-
// ── Exit confirm overlay ─────────────────────────────────────────
|
|
234
|
-
if (showingExitConfirm) {
|
|
235
|
-
if (matchesKey(data, Key.up)) {
|
|
236
|
-
exitCursor = 0;
|
|
237
|
-
refresh();
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
if (matchesKey(data, Key.down)) {
|
|
241
|
-
exitCursor = 1;
|
|
242
|
-
refresh();
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
if (data === "1") {
|
|
246
|
-
showingExitConfirm = false;
|
|
247
|
-
refresh();
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
if (data === "2") {
|
|
251
|
-
done(null);
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
if (matchesKey(data, Key.enter) || matchesKey(data, Key.space)) {
|
|
255
|
-
if (exitCursor === 0) {
|
|
256
|
-
showingExitConfirm = false;
|
|
257
|
-
refresh();
|
|
258
|
-
}
|
|
259
|
-
else {
|
|
260
|
-
done(null);
|
|
261
|
-
}
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
// Esc on the confirm screen = go back (dismiss confirm)
|
|
265
|
-
if (matchesKey(data, Key.escape)) {
|
|
266
|
-
showingExitConfirm = false;
|
|
267
|
-
refresh();
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
// ── Text field focus ─────────────────────────────────────────────
|
|
273
|
-
const ps = currentPageState();
|
|
274
|
-
if (ps.focusedFieldId) {
|
|
275
|
-
const editor = getEditor(ps.focusedFieldId);
|
|
276
|
-
if (matchesKey(data, Key.escape)) {
|
|
277
|
-
// First Esc: unfocus the text field
|
|
278
|
-
ps.textValues.set(ps.focusedFieldId, editor.getText().trim());
|
|
279
|
-
ps.focusedFieldId = null;
|
|
280
|
-
refresh();
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
283
|
-
if (matchesKey(data, Key.enter)) {
|
|
284
|
-
ps.textValues.set(ps.focusedFieldId, editor.getText().trim());
|
|
285
|
-
ps.focusedFieldId = null;
|
|
286
|
-
advance();
|
|
287
|
-
return;
|
|
288
|
-
}
|
|
289
|
-
editor.handleInput(data);
|
|
290
|
-
refresh();
|
|
291
|
-
return;
|
|
292
|
-
}
|
|
293
|
-
// ── Esc with no text field focused: go back (or exit if on page 1) ──
|
|
294
|
-
if (matchesKey(data, Key.escape)) {
|
|
295
|
-
goBack();
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
// ── Enter / → to advance ─────────────────────────────────────────
|
|
299
|
-
if (matchesKey(data, Key.enter) || matchesKey(data, Key.right)) {
|
|
300
|
-
// For single-select fields, commit cursor before advancing
|
|
301
|
-
const page = currentPage();
|
|
302
|
-
for (const field of page.fields) {
|
|
303
|
-
if (field.type === "select" && !field.allowMultiple) {
|
|
304
|
-
const ss = getSelectState(currentPageId(), field.id, field.options.length);
|
|
305
|
-
if (ss.committedIndex === null)
|
|
306
|
-
ss.committedIndex = ss.cursorIndex;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
advance();
|
|
310
|
-
return;
|
|
311
|
-
}
|
|
312
|
-
// ── Select field interactions ────────────────────────────────────
|
|
313
|
-
const page = currentPage();
|
|
314
|
-
for (const field of page.fields) {
|
|
315
|
-
if (field.type !== "select")
|
|
316
|
-
continue;
|
|
317
|
-
const ss = getSelectState(currentPageId(), field.id, field.options.length);
|
|
318
|
-
const totalOpts = field.options.length;
|
|
319
|
-
if (matchesKey(data, Key.up)) {
|
|
320
|
-
ss.cursorIndex = (ss.cursorIndex - 1 + totalOpts) % totalOpts;
|
|
321
|
-
refresh();
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
if (matchesKey(data, Key.down)) {
|
|
325
|
-
ss.cursorIndex = (ss.cursorIndex + 1) % totalOpts;
|
|
326
|
-
refresh();
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
if (field.allowMultiple) {
|
|
330
|
-
if (matchesKey(data, Key.space)) {
|
|
331
|
-
if (ss.checkedIndices.has(ss.cursorIndex))
|
|
332
|
-
ss.checkedIndices.delete(ss.cursorIndex);
|
|
333
|
-
else
|
|
334
|
-
ss.checkedIndices.add(ss.cursorIndex);
|
|
335
|
-
refresh();
|
|
336
|
-
return;
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
else {
|
|
340
|
-
// Numeric shortcut: press the number to select and immediately advance
|
|
341
|
-
if (data.length === 1 && data >= "1" && data <= "9") {
|
|
342
|
-
const idx = parseInt(data, 10) - 1;
|
|
343
|
-
if (idx < totalOpts) {
|
|
344
|
-
ss.cursorIndex = idx;
|
|
345
|
-
ss.committedIndex = idx;
|
|
346
|
-
advance();
|
|
347
|
-
return;
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
// Enter/Space commit cursor and advance (Enter handled above, Space here)
|
|
351
|
-
if (matchesKey(data, Key.space)) {
|
|
352
|
-
ss.committedIndex = ss.cursorIndex;
|
|
353
|
-
advance();
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
// Only handle the first select field for nav
|
|
358
|
-
break;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
// ── Render ─────────────────────────────────────────────────────────────
|
|
362
|
-
function renderExitConfirm(width) {
|
|
363
|
-
const ui = makeUI(theme, width);
|
|
364
|
-
const lines = [];
|
|
365
|
-
const push = (...rows) => { for (const r of rows)
|
|
366
|
-
lines.push(...r); };
|
|
367
|
-
push(ui.bar(), ui.blank(), ui.header(" Exit wizard?"), ui.blank(), ui.subtitle(" Your progress will be lost."), ui.blank());
|
|
368
|
-
if (exitCursor === 0)
|
|
369
|
-
push(ui.actionSelected(1, "Go back", "Return to where you were."));
|
|
370
|
-
else
|
|
371
|
-
push(ui.actionUnselected(1, "Go back", "Return to where you were."));
|
|
372
|
-
push(ui.blank());
|
|
373
|
-
if (exitCursor === 1)
|
|
374
|
-
push(ui.actionSelected(2, "Exit", "Cancel and discard all answers."));
|
|
375
|
-
else
|
|
376
|
-
push(ui.actionUnselected(2, "Exit", "Cancel and discard all answers."));
|
|
377
|
-
push(ui.blank(), ui.hints(["↑/↓ to choose", "1/2 to quick-select", "enter to confirm"]), ui.bar());
|
|
378
|
-
return lines;
|
|
379
|
-
}
|
|
380
|
-
function renderSelectField(ui, field, lines) {
|
|
381
|
-
const push = (...rows) => { for (const r of rows)
|
|
382
|
-
lines.push(...r); };
|
|
383
|
-
const ss = getSelectState(currentPageId(), field.id, field.options.length);
|
|
384
|
-
const multi = !!field.allowMultiple;
|
|
385
|
-
push(ui.question(` ${field.question}`));
|
|
386
|
-
if (multi)
|
|
387
|
-
push(ui.meta(" (select all that apply — space to toggle, enter to confirm)"));
|
|
388
|
-
push(ui.blank());
|
|
389
|
-
for (let i = 0; i < field.options.length; i++) {
|
|
390
|
-
const opt = field.options[i];
|
|
391
|
-
const isCursor = i === ss.cursorIndex;
|
|
392
|
-
const isCommitted = i === ss.committedIndex;
|
|
393
|
-
if (multi) {
|
|
394
|
-
const isChecked = ss.checkedIndices.has(i);
|
|
395
|
-
if (isCursor)
|
|
396
|
-
push(ui.checkboxSelected(opt.label, opt.description, isChecked));
|
|
397
|
-
else
|
|
398
|
-
push(ui.checkboxUnselected(opt.label, opt.description, isChecked));
|
|
399
|
-
}
|
|
400
|
-
else {
|
|
401
|
-
if (isCursor)
|
|
402
|
-
push(ui.optionSelected(i + 1, opt.label, opt.description, isCommitted));
|
|
403
|
-
else
|
|
404
|
-
push(ui.optionUnselected(i + 1, opt.label, opt.description, { isCommitted }));
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
function renderTextField(ui, field, ps, lines, width) {
|
|
409
|
-
const push = (...rows) => { for (const r of rows)
|
|
410
|
-
lines.push(...r); };
|
|
411
|
-
const isFocused = ps.focusedFieldId === field.id;
|
|
412
|
-
const value = isFocused ? getEditor(field.id).getText() : (ps.textValues.get(field.id) ?? "");
|
|
413
|
-
push(ui.question(` ${field.label}`), ui.blank());
|
|
414
|
-
if (isFocused) {
|
|
415
|
-
for (const line of getEditor(field.id).render(width - 2))
|
|
416
|
-
lines.push(truncateToWidth(` ${line}`, width));
|
|
417
|
-
}
|
|
418
|
-
else if (value) {
|
|
419
|
-
push(ui.answer(` ${value}`));
|
|
420
|
-
}
|
|
421
|
-
else if (field.placeholder) {
|
|
422
|
-
push(ui.meta(` ${field.placeholder}`));
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
function render(width) {
|
|
426
|
-
if (cachedLines)
|
|
427
|
-
return cachedLines;
|
|
428
|
-
if (showingExitConfirm) {
|
|
429
|
-
cachedLines = renderExitConfirm(width);
|
|
430
|
-
return cachedLines;
|
|
431
|
-
}
|
|
432
|
-
const ui = makeUI(theme, width);
|
|
433
|
-
const lines = [];
|
|
434
|
-
const push = (...rows) => { for (const r of rows)
|
|
435
|
-
lines.push(...r); };
|
|
436
|
-
push(ui.bar(), ui.header(` ${opts.title}`));
|
|
437
|
-
// ── Page indicator ────────────────────────────────────────────────
|
|
438
|
-
if (opts.pages.length > 1) {
|
|
439
|
-
push(ui.pageDots(opts.pages.length, pageStack.length - 1));
|
|
440
|
-
}
|
|
441
|
-
// ── Page content ──────────────────────────────────────────────────
|
|
442
|
-
const page = currentPage();
|
|
443
|
-
const ps = currentPageState();
|
|
444
|
-
if (page.subtitle) {
|
|
445
|
-
push(ui.blank(), ui.subtitle(` ${page.subtitle}`));
|
|
446
|
-
}
|
|
447
|
-
push(ui.blank());
|
|
448
|
-
for (const field of page.fields) {
|
|
449
|
-
if (field.type === "select")
|
|
450
|
-
renderSelectField(ui, field, lines);
|
|
451
|
-
else
|
|
452
|
-
renderTextField(ui, field, ps, lines, width);
|
|
453
|
-
push(ui.blank());
|
|
454
|
-
}
|
|
455
|
-
// ── Footer hints ──────────────────────────────────────────────────
|
|
456
|
-
const isFirst = pageStack.length === 1;
|
|
457
|
-
const ps2 = currentPageState();
|
|
458
|
-
const hints = [];
|
|
459
|
-
if (ps2.focusedFieldId) {
|
|
460
|
-
hints.push("enter to continue");
|
|
461
|
-
hints.push("esc to unfocus");
|
|
462
|
-
}
|
|
463
|
-
else {
|
|
464
|
-
hints.push("↑/↓ to move");
|
|
465
|
-
hints.push("enter to select");
|
|
466
|
-
hints.push(!isFirst ? "esc to go back" : "esc to exit");
|
|
467
|
-
}
|
|
468
|
-
push(ui.hints(hints), ui.bar());
|
|
469
|
-
cachedLines = lines;
|
|
470
|
-
return lines;
|
|
471
|
-
}
|
|
472
|
-
return {
|
|
473
|
-
render,
|
|
474
|
-
invalidate: () => { cachedLines = undefined; },
|
|
475
|
-
handleInput,
|
|
476
|
-
};
|
|
477
|
-
});
|
|
478
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
|
|
3
|
-
"name": "dark",
|
|
4
|
-
"vars": {
|
|
5
|
-
"cyan": "#00d7ff",
|
|
6
|
-
"blue": "#5f87ff",
|
|
7
|
-
"green": "#b5bd68",
|
|
8
|
-
"red": "#cc6666",
|
|
9
|
-
"yellow": "#ffff00",
|
|
10
|
-
"gray": "#808080",
|
|
11
|
-
"dimGray": "#666666",
|
|
12
|
-
"darkGray": "#505050",
|
|
13
|
-
"accent": "#8abeb7",
|
|
14
|
-
"selectedBg": "#3a3a4a",
|
|
15
|
-
"userMsgBg": "#343541",
|
|
16
|
-
"toolPendingBg": "#282832",
|
|
17
|
-
"toolSuccessBg": "#283228",
|
|
18
|
-
"toolErrorBg": "#3c2828",
|
|
19
|
-
"customMsgBg": "#2d2838"
|
|
20
|
-
},
|
|
21
|
-
"colors": {
|
|
22
|
-
"accent": "accent",
|
|
23
|
-
"border": "blue",
|
|
24
|
-
"borderAccent": "cyan",
|
|
25
|
-
"borderMuted": "darkGray",
|
|
26
|
-
"success": "green",
|
|
27
|
-
"error": "red",
|
|
28
|
-
"warning": "yellow",
|
|
29
|
-
"muted": "gray",
|
|
30
|
-
"dim": "dimGray",
|
|
31
|
-
"text": "",
|
|
32
|
-
"thinkingText": "gray",
|
|
33
|
-
|
|
34
|
-
"selectedBg": "selectedBg",
|
|
35
|
-
"userMessageBg": "userMsgBg",
|
|
36
|
-
"userMessageText": "",
|
|
37
|
-
"customMessageBg": "customMsgBg",
|
|
38
|
-
"customMessageText": "",
|
|
39
|
-
"customMessageLabel": "#9575cd",
|
|
40
|
-
"toolPendingBg": "toolPendingBg",
|
|
41
|
-
"toolSuccessBg": "toolSuccessBg",
|
|
42
|
-
"toolErrorBg": "toolErrorBg",
|
|
43
|
-
"toolTitle": "",
|
|
44
|
-
"toolOutput": "gray",
|
|
45
|
-
|
|
46
|
-
"mdHeading": "#f0c674",
|
|
47
|
-
"mdLink": "#81a2be",
|
|
48
|
-
"mdLinkUrl": "dimGray",
|
|
49
|
-
"mdCode": "accent",
|
|
50
|
-
"mdCodeBlock": "green",
|
|
51
|
-
"mdCodeBlockBorder": "gray",
|
|
52
|
-
"mdQuote": "gray",
|
|
53
|
-
"mdQuoteBorder": "gray",
|
|
54
|
-
"mdHr": "gray",
|
|
55
|
-
"mdListBullet": "accent",
|
|
56
|
-
|
|
57
|
-
"toolDiffAdded": "green",
|
|
58
|
-
"toolDiffRemoved": "red",
|
|
59
|
-
"toolDiffContext": "gray",
|
|
60
|
-
|
|
61
|
-
"syntaxComment": "#6A9955",
|
|
62
|
-
"syntaxKeyword": "#569CD6",
|
|
63
|
-
"syntaxFunction": "#DCDCAA",
|
|
64
|
-
"syntaxVariable": "#9CDCFE",
|
|
65
|
-
"syntaxString": "#CE9178",
|
|
66
|
-
"syntaxNumber": "#B5CEA8",
|
|
67
|
-
"syntaxType": "#4EC9B0",
|
|
68
|
-
"syntaxOperator": "#D4D4D4",
|
|
69
|
-
"syntaxPunctuation": "#D4D4D4",
|
|
70
|
-
|
|
71
|
-
"thinkingOff": "darkGray",
|
|
72
|
-
"thinkingMinimal": "#6e6e6e",
|
|
73
|
-
"thinkingLow": "#5f87af",
|
|
74
|
-
"thinkingMedium": "#81a2be",
|
|
75
|
-
"thinkingHigh": "#b294bb",
|
|
76
|
-
"thinkingXhigh": "#d183e8",
|
|
77
|
-
|
|
78
|
-
"bashMode": "green"
|
|
79
|
-
},
|
|
80
|
-
"export": {
|
|
81
|
-
"pageBg": "#18181e",
|
|
82
|
-
"cardBg": "#1e1e24",
|
|
83
|
-
"infoBg": "#3c3728"
|
|
84
|
-
}
|
|
85
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
|
|
3
|
-
"name": "light",
|
|
4
|
-
"vars": {
|
|
5
|
-
"teal": "#5a8080",
|
|
6
|
-
"blue": "#547da7",
|
|
7
|
-
"green": "#588458",
|
|
8
|
-
"red": "#aa5555",
|
|
9
|
-
"yellow": "#9a7326",
|
|
10
|
-
"mediumGray": "#6c6c6c",
|
|
11
|
-
"dimGray": "#767676",
|
|
12
|
-
"lightGray": "#b0b0b0",
|
|
13
|
-
"selectedBg": "#d0d0e0",
|
|
14
|
-
"userMsgBg": "#e8e8e8",
|
|
15
|
-
"toolPendingBg": "#e8e8f0",
|
|
16
|
-
"toolSuccessBg": "#e8f0e8",
|
|
17
|
-
"toolErrorBg": "#f0e8e8",
|
|
18
|
-
"customMsgBg": "#ede7f6"
|
|
19
|
-
},
|
|
20
|
-
"colors": {
|
|
21
|
-
"accent": "teal",
|
|
22
|
-
"border": "blue",
|
|
23
|
-
"borderAccent": "teal",
|
|
24
|
-
"borderMuted": "lightGray",
|
|
25
|
-
"success": "green",
|
|
26
|
-
"error": "red",
|
|
27
|
-
"warning": "yellow",
|
|
28
|
-
"muted": "mediumGray",
|
|
29
|
-
"dim": "dimGray",
|
|
30
|
-
"text": "",
|
|
31
|
-
"thinkingText": "mediumGray",
|
|
32
|
-
|
|
33
|
-
"selectedBg": "selectedBg",
|
|
34
|
-
"userMessageBg": "userMsgBg",
|
|
35
|
-
"userMessageText": "",
|
|
36
|
-
"customMessageBg": "customMsgBg",
|
|
37
|
-
"customMessageText": "",
|
|
38
|
-
"customMessageLabel": "#7e57c2",
|
|
39
|
-
"toolPendingBg": "toolPendingBg",
|
|
40
|
-
"toolSuccessBg": "toolSuccessBg",
|
|
41
|
-
"toolErrorBg": "toolErrorBg",
|
|
42
|
-
"toolTitle": "",
|
|
43
|
-
"toolOutput": "mediumGray",
|
|
44
|
-
|
|
45
|
-
"mdHeading": "yellow",
|
|
46
|
-
"mdLink": "blue",
|
|
47
|
-
"mdLinkUrl": "dimGray",
|
|
48
|
-
"mdCode": "teal",
|
|
49
|
-
"mdCodeBlock": "green",
|
|
50
|
-
"mdCodeBlockBorder": "mediumGray",
|
|
51
|
-
"mdQuote": "mediumGray",
|
|
52
|
-
"mdQuoteBorder": "mediumGray",
|
|
53
|
-
"mdHr": "mediumGray",
|
|
54
|
-
"mdListBullet": "green",
|
|
55
|
-
|
|
56
|
-
"toolDiffAdded": "green",
|
|
57
|
-
"toolDiffRemoved": "red",
|
|
58
|
-
"toolDiffContext": "mediumGray",
|
|
59
|
-
|
|
60
|
-
"syntaxComment": "#008000",
|
|
61
|
-
"syntaxKeyword": "#0000FF",
|
|
62
|
-
"syntaxFunction": "#795E26",
|
|
63
|
-
"syntaxVariable": "#001080",
|
|
64
|
-
"syntaxString": "#A31515",
|
|
65
|
-
"syntaxNumber": "#098658",
|
|
66
|
-
"syntaxType": "#267F99",
|
|
67
|
-
"syntaxOperator": "#000000",
|
|
68
|
-
"syntaxPunctuation": "#000000",
|
|
69
|
-
|
|
70
|
-
"thinkingOff": "lightGray",
|
|
71
|
-
"thinkingMinimal": "#767676",
|
|
72
|
-
"thinkingLow": "blue",
|
|
73
|
-
"thinkingMedium": "teal",
|
|
74
|
-
"thinkingHigh": "#875f87",
|
|
75
|
-
"thinkingXhigh": "#8b008b",
|
|
76
|
-
|
|
77
|
-
"bashMode": "green"
|
|
78
|
-
},
|
|
79
|
-
"export": {
|
|
80
|
-
"pageBg": "#f8f8f8",
|
|
81
|
-
"cardBg": "#ffffff",
|
|
82
|
-
"infoBg": "#fffae6"
|
|
83
|
-
}
|
|
84
|
-
}
|