@tuan_son.dinh/gsd 2.6.2 → 2.7.0
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 +1 -0
- package/dist/cli.js +24 -10
- package/dist/loader.js +21 -3
- package/dist/logo.d.ts +3 -3
- package/dist/logo.js +2 -2
- package/dist/onboarding.d.ts +3 -3
- package/dist/onboarding.js +3 -4
- package/dist/pi-migration.d.ts +5 -1
- package/dist/pi-migration.js +19 -2
- package/dist/resource-loader.d.ts +2 -1
- package/dist/resource-loader.js +60 -4
- package/dist/wizard.d.ts +1 -1
- package/package.json +12 -6
- package/packages/pi-agent-core/dist/agent-loop.d.ts +21 -0
- package/packages/pi-agent-core/dist/agent-loop.d.ts.map +1 -0
- package/packages/pi-agent-core/dist/agent-loop.js +308 -0
- package/packages/pi-agent-core/dist/agent-loop.js.map +1 -0
- package/packages/pi-agent-core/dist/agent.d.ts +162 -0
- package/packages/pi-agent-core/dist/agent.d.ts.map +1 -0
- package/packages/pi-agent-core/dist/agent.js +399 -0
- package/packages/pi-agent-core/dist/agent.js.map +1 -0
- package/packages/pi-agent-core/dist/index.d.ts +5 -0
- package/packages/pi-agent-core/dist/index.d.ts.map +1 -0
- package/packages/pi-agent-core/dist/index.js +9 -0
- package/packages/pi-agent-core/dist/index.js.map +1 -0
- package/packages/pi-agent-core/dist/proxy.d.ts +85 -0
- package/packages/pi-agent-core/dist/proxy.d.ts.map +1 -0
- package/packages/pi-agent-core/dist/proxy.js +268 -0
- package/packages/pi-agent-core/dist/proxy.js.map +1 -0
- package/packages/pi-agent-core/dist/types.d.ts +178 -0
- package/packages/pi-agent-core/dist/types.d.ts.map +1 -0
- package/packages/pi-agent-core/dist/types.js +2 -0
- package/packages/pi-agent-core/dist/types.js.map +1 -0
- package/packages/pi-agent-core/package.json +14 -0
- package/packages/pi-agent-core/src/agent-loop.ts +417 -0
- package/packages/pi-agent-core/src/agent.ts +568 -0
- package/packages/pi-agent-core/src/index.ts +8 -0
- package/packages/pi-agent-core/src/proxy.ts +340 -0
- package/packages/pi-agent-core/src/types.ts +194 -0
- package/packages/pi-agent-core/tsconfig.json +27 -0
- package/packages/pi-ai/bedrock-provider.d.ts +1 -0
- package/packages/pi-ai/bedrock-provider.js +1 -0
- package/packages/pi-ai/dist/api-registry.d.ts +20 -0
- package/packages/pi-ai/dist/api-registry.d.ts.map +1 -0
- package/packages/pi-ai/dist/api-registry.js +44 -0
- package/packages/pi-ai/dist/api-registry.js.map +1 -0
- package/packages/pi-ai/dist/bedrock-provider.d.ts +5 -0
- package/packages/pi-ai/dist/bedrock-provider.d.ts.map +1 -0
- package/packages/pi-ai/dist/bedrock-provider.js +6 -0
- package/packages/pi-ai/dist/bedrock-provider.js.map +1 -0
- package/packages/pi-ai/dist/cli.d.ts +3 -0
- package/packages/pi-ai/dist/cli.d.ts.map +1 -0
- package/packages/pi-ai/dist/cli.js +116 -0
- package/packages/pi-ai/dist/cli.js.map +1 -0
- package/packages/pi-ai/dist/env-api-keys.d.ts +9 -0
- package/packages/pi-ai/dist/env-api-keys.d.ts.map +1 -0
- package/packages/pi-ai/dist/env-api-keys.js +104 -0
- package/packages/pi-ai/dist/env-api-keys.js.map +1 -0
- package/packages/pi-ai/dist/index.d.ts +23 -0
- package/packages/pi-ai/dist/index.d.ts.map +1 -0
- package/packages/pi-ai/dist/index.js +21 -0
- package/packages/pi-ai/dist/index.js.map +1 -0
- package/packages/pi-ai/dist/models.d.ts +24 -0
- package/packages/pi-ai/dist/models.d.ts.map +1 -0
- package/packages/pi-ai/dist/models.generated.d.ts +13572 -0
- package/packages/pi-ai/dist/models.generated.d.ts.map +1 -0
- package/packages/pi-ai/dist/models.generated.js +13368 -0
- package/packages/pi-ai/dist/models.generated.js.map +1 -0
- package/packages/pi-ai/dist/models.js +55 -0
- package/packages/pi-ai/dist/models.js.map +1 -0
- package/packages/pi-ai/dist/oauth.d.ts +2 -0
- package/packages/pi-ai/dist/oauth.d.ts.map +1 -0
- package/packages/pi-ai/dist/oauth.js +2 -0
- package/packages/pi-ai/dist/oauth.js.map +1 -0
- package/packages/pi-ai/dist/providers/amazon-bedrock.d.ts +15 -0
- package/packages/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/amazon-bedrock.js +600 -0
- package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic.d.ts +33 -0
- package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/anthropic.js +732 -0
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -0
- package/packages/pi-ai/dist/providers/azure-openai-responses.d.ts +15 -0
- package/packages/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/azure-openai-responses.js +187 -0
- package/packages/pi-ai/dist/providers/azure-openai-responses.js.map +1 -0
- package/packages/pi-ai/dist/providers/github-copilot-headers.d.ts +8 -0
- package/packages/pi-ai/dist/providers/github-copilot-headers.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/github-copilot-headers.js +29 -0
- package/packages/pi-ai/dist/providers/github-copilot-headers.js.map +1 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.d.ts +74 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.js +757 -0
- package/packages/pi-ai/dist/providers/google-gemini-cli.js.map +1 -0
- package/packages/pi-ai/dist/providers/google-shared.d.ts +65 -0
- package/packages/pi-ai/dist/providers/google-shared.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/google-shared.js +300 -0
- package/packages/pi-ai/dist/providers/google-shared.js.map +1 -0
- package/packages/pi-ai/dist/providers/google-vertex.d.ts +15 -0
- package/packages/pi-ai/dist/providers/google-vertex.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/google-vertex.js +374 -0
- package/packages/pi-ai/dist/providers/google-vertex.js.map +1 -0
- package/packages/pi-ai/dist/providers/google.d.ts +13 -0
- package/packages/pi-ai/dist/providers/google.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/google.js +355 -0
- package/packages/pi-ai/dist/providers/google.js.map +1 -0
- package/packages/pi-ai/dist/providers/mistral.d.ts +22 -0
- package/packages/pi-ai/dist/providers/mistral.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/mistral.js +498 -0
- package/packages/pi-ai/dist/providers/mistral.js.map +1 -0
- package/packages/pi-ai/dist/providers/openai-codex-responses.d.ts +9 -0
- package/packages/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/openai-codex-responses.js +704 -0
- package/packages/pi-ai/dist/providers/openai-codex-responses.js.map +1 -0
- package/packages/pi-ai/dist/providers/openai-completions.d.ts +15 -0
- package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/openai-completions.js +705 -0
- package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -0
- package/packages/pi-ai/dist/providers/openai-responses-shared.d.ts +17 -0
- package/packages/pi-ai/dist/providers/openai-responses-shared.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/openai-responses-shared.js +442 -0
- package/packages/pi-ai/dist/providers/openai-responses-shared.js.map +1 -0
- package/packages/pi-ai/dist/providers/openai-responses.d.ts +13 -0
- package/packages/pi-ai/dist/providers/openai-responses.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/openai-responses.js +201 -0
- package/packages/pi-ai/dist/providers/openai-responses.js.map +1 -0
- package/packages/pi-ai/dist/providers/register-builtins.d.ts +11 -0
- package/packages/pi-ai/dist/providers/register-builtins.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/register-builtins.js +138 -0
- package/packages/pi-ai/dist/providers/register-builtins.js.map +1 -0
- package/packages/pi-ai/dist/providers/simple-options.d.ts +8 -0
- package/packages/pi-ai/dist/providers/simple-options.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/simple-options.js +35 -0
- package/packages/pi-ai/dist/providers/simple-options.js.map +1 -0
- package/packages/pi-ai/dist/providers/transform-messages.d.ts +8 -0
- package/packages/pi-ai/dist/providers/transform-messages.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/transform-messages.js +155 -0
- package/packages/pi-ai/dist/providers/transform-messages.js.map +1 -0
- package/packages/pi-ai/dist/stream.d.ts +8 -0
- package/packages/pi-ai/dist/stream.d.ts.map +1 -0
- package/packages/pi-ai/dist/stream.js +27 -0
- package/packages/pi-ai/dist/stream.js.map +1 -0
- package/packages/pi-ai/dist/types.d.ts +285 -0
- package/packages/pi-ai/dist/types.d.ts.map +1 -0
- package/packages/pi-ai/dist/types.js +2 -0
- package/packages/pi-ai/dist/types.js.map +1 -0
- package/packages/pi-ai/dist/utils/event-stream.d.ts +21 -0
- package/packages/pi-ai/dist/utils/event-stream.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/event-stream.js +77 -0
- package/packages/pi-ai/dist/utils/event-stream.js.map +1 -0
- package/packages/pi-ai/dist/utils/hash.d.ts +3 -0
- package/packages/pi-ai/dist/utils/hash.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/hash.js +14 -0
- package/packages/pi-ai/dist/utils/hash.js.map +1 -0
- package/packages/pi-ai/dist/utils/json-parse.d.ts +9 -0
- package/packages/pi-ai/dist/utils/json-parse.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/json-parse.js +29 -0
- package/packages/pi-ai/dist/utils/json-parse.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/anthropic.d.ts +17 -0
- package/packages/pi-ai/dist/utils/oauth/anthropic.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/anthropic.js +104 -0
- package/packages/pi-ai/dist/utils/oauth/anthropic.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/github-copilot.d.ts +30 -0
- package/packages/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js +281 -0
- package/packages/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.d.ts +26 -0
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.js +373 -0
- package/packages/pi-ai/dist/utils/oauth/google-antigravity.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.d.ts +26 -0
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js +478 -0
- package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/index.d.ts +61 -0
- package/packages/pi-ai/dist/utils/oauth/index.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/index.js +131 -0
- package/packages/pi-ai/dist/utils/oauth/index.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/openai-codex.d.ts +34 -0
- package/packages/pi-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/openai-codex.js +380 -0
- package/packages/pi-ai/dist/utils/oauth/openai-codex.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/pkce.d.ts +13 -0
- package/packages/pi-ai/dist/utils/oauth/pkce.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/pkce.js +31 -0
- package/packages/pi-ai/dist/utils/oauth/pkce.js.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/types.d.ts +47 -0
- package/packages/pi-ai/dist/utils/oauth/types.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/oauth/types.js +2 -0
- package/packages/pi-ai/dist/utils/oauth/types.js.map +1 -0
- package/packages/pi-ai/dist/utils/overflow.d.ts +52 -0
- package/packages/pi-ai/dist/utils/overflow.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/overflow.js +117 -0
- package/packages/pi-ai/dist/utils/overflow.js.map +1 -0
- package/packages/pi-ai/dist/utils/sanitize-unicode.d.ts +22 -0
- package/packages/pi-ai/dist/utils/sanitize-unicode.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/sanitize-unicode.js +26 -0
- package/packages/pi-ai/dist/utils/sanitize-unicode.js.map +1 -0
- package/packages/pi-ai/dist/utils/typebox-helpers.d.ts +17 -0
- package/packages/pi-ai/dist/utils/typebox-helpers.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/typebox-helpers.js +21 -0
- package/packages/pi-ai/dist/utils/typebox-helpers.js.map +1 -0
- package/packages/pi-ai/dist/utils/validation.d.ts +18 -0
- package/packages/pi-ai/dist/utils/validation.d.ts.map +1 -0
- package/packages/pi-ai/dist/utils/validation.js +72 -0
- package/packages/pi-ai/dist/utils/validation.js.map +1 -0
- package/packages/pi-ai/package.json +40 -0
- package/packages/pi-ai/src/api-registry.ts +98 -0
- package/packages/pi-ai/src/bedrock-provider.ts +6 -0
- package/packages/pi-ai/src/cli.ts +133 -0
- package/packages/pi-ai/src/env-api-keys.ts +129 -0
- package/packages/pi-ai/src/index.ts +32 -0
- package/packages/pi-ai/src/models.generated.ts +13370 -0
- package/packages/pi-ai/src/models.ts +77 -0
- package/packages/pi-ai/src/oauth.ts +1 -0
- package/packages/pi-ai/src/providers/amazon-bedrock.ts +751 -0
- package/packages/pi-ai/src/providers/anthropic.ts +883 -0
- package/packages/pi-ai/src/providers/azure-openai-responses.ts +259 -0
- package/packages/pi-ai/src/providers/github-copilot-headers.ts +37 -0
- package/packages/pi-ai/src/providers/google-gemini-cli.ts +967 -0
- package/packages/pi-ai/src/providers/google-shared.ts +313 -0
- package/packages/pi-ai/src/providers/google-vertex.ts +485 -0
- package/packages/pi-ai/src/providers/google.ts +455 -0
- package/packages/pi-ai/src/providers/mistral.ts +582 -0
- package/packages/pi-ai/src/providers/openai-codex-responses.ts +875 -0
- package/packages/pi-ai/src/providers/openai-completions.ts +820 -0
- package/packages/pi-ai/src/providers/openai-responses-shared.ts +496 -0
- package/packages/pi-ai/src/providers/openai-responses.ts +262 -0
- package/packages/pi-ai/src/providers/register-builtins.ts +186 -0
- package/packages/pi-ai/src/providers/simple-options.ts +46 -0
- package/packages/pi-ai/src/providers/transform-messages.ts +172 -0
- package/packages/pi-ai/src/stream.ts +59 -0
- package/packages/pi-ai/src/types.ts +321 -0
- package/packages/pi-ai/src/utils/event-stream.ts +87 -0
- package/packages/pi-ai/src/utils/hash.ts +13 -0
- package/packages/pi-ai/src/utils/json-parse.ts +28 -0
- package/packages/pi-ai/src/utils/oauth/anthropic.ts +138 -0
- package/packages/pi-ai/src/utils/oauth/github-copilot.ts +381 -0
- package/packages/pi-ai/src/utils/oauth/google-antigravity.ts +457 -0
- package/packages/pi-ai/src/utils/oauth/google-gemini-cli.ts +599 -0
- package/packages/pi-ai/src/utils/oauth/index.ts +162 -0
- package/packages/pi-ai/src/utils/oauth/openai-codex.ts +455 -0
- package/packages/pi-ai/src/utils/oauth/pkce.ts +34 -0
- package/packages/pi-ai/src/utils/oauth/types.ts +59 -0
- package/packages/pi-ai/src/utils/overflow.ts +123 -0
- package/packages/pi-ai/src/utils/sanitize-unicode.ts +25 -0
- package/packages/pi-ai/src/utils/typebox-helpers.ts +24 -0
- package/packages/pi-ai/src/utils/validation.ts +84 -0
- package/packages/pi-ai/tsconfig.json +27 -0
- package/packages/pi-coding-agent/dist/cli/args.d.ts +48 -0
- package/packages/pi-coding-agent/dist/cli/args.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/cli/args.js +299 -0
- package/packages/pi-coding-agent/dist/cli/args.js.map +1 -0
- package/packages/pi-coding-agent/dist/cli/config-selector.d.ts +14 -0
- package/packages/pi-coding-agent/dist/cli/config-selector.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/cli/config-selector.js +31 -0
- package/packages/pi-coding-agent/dist/cli/config-selector.js.map +1 -0
- package/packages/pi-coding-agent/dist/cli/file-processor.d.ts +15 -0
- package/packages/pi-coding-agent/dist/cli/file-processor.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/cli/file-processor.js +79 -0
- package/packages/pi-coding-agent/dist/cli/file-processor.js.map +1 -0
- package/packages/pi-coding-agent/dist/cli/list-models.d.ts +9 -0
- package/packages/pi-coding-agent/dist/cli/list-models.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/cli/list-models.js +92 -0
- package/packages/pi-coding-agent/dist/cli/list-models.js.map +1 -0
- package/packages/pi-coding-agent/dist/cli/session-picker.d.ts +9 -0
- package/packages/pi-coding-agent/dist/cli/session-picker.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/cli/session-picker.js +34 -0
- package/packages/pi-coding-agent/dist/cli/session-picker.js.map +1 -0
- package/packages/pi-coding-agent/dist/cli.d.ts +3 -0
- package/packages/pi-coding-agent/dist/cli.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/cli.js +16 -0
- package/packages/pi-coding-agent/dist/cli.js.map +1 -0
- package/packages/pi-coding-agent/dist/config.d.ts +68 -0
- package/packages/pi-coding-agent/dist/config.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/config.js +203 -0
- package/packages/pi-coding-agent/dist/config.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +618 -0
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/agent-session.js +2481 -0
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +134 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.js +415 -0
- package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/bash-executor.d.ts +47 -0
- package/packages/pi-coding-agent/dist/core/bash-executor.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/bash-executor.js +212 -0
- package/packages/pi-coding-agent/dist/core/bash-executor.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts +86 -0
- package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.js +242 -0
- package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +121 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js +610 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction/index.d.ts +7 -0
- package/packages/pi-coding-agent/dist/core/compaction/index.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction/index.js +7 -0
- package/packages/pi-coding-agent/dist/core/compaction/index.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts +38 -0
- package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction/utils.js +153 -0
- package/packages/pi-coding-agent/dist/core/compaction/utils.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/defaults.d.ts +3 -0
- package/packages/pi-coding-agent/dist/core/defaults.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/defaults.js +2 -0
- package/packages/pi-coding-agent/dist/core/defaults.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/diagnostics.d.ts +15 -0
- package/packages/pi-coding-agent/dist/core/diagnostics.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/diagnostics.js +2 -0
- package/packages/pi-coding-agent/dist/core/diagnostics.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/event-bus.d.ts +9 -0
- package/packages/pi-coding-agent/dist/core/event-bus.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/event-bus.js +25 -0
- package/packages/pi-coding-agent/dist/core/event-bus.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/exec.d.ts +29 -0
- package/packages/pi-coding-agent/dist/core/exec.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/exec.js +71 -0
- package/packages/pi-coding-agent/dist/core/exec.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.js +249 -0
- package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/export-html/index.d.ts +37 -0
- package/packages/pi-coding-agent/dist/core/export-html/index.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/export-html/index.js +223 -0
- package/packages/pi-coding-agent/dist/core/export-html/index.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/export-html/template.css +971 -0
- package/packages/pi-coding-agent/dist/core/export-html/template.html +54 -0
- package/packages/pi-coding-agent/dist/core/export-html/template.js +1583 -0
- package/packages/pi-coding-agent/dist/core/export-html/tool-renderer.d.ts +38 -0
- package/packages/pi-coding-agent/dist/core/export-html/tool-renderer.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/export-html/tool-renderer.js +70 -0
- package/packages/pi-coding-agent/dist/core/export-html/tool-renderer.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/export-html/vendor/.gitkeep +0 -0
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +11 -0
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/index.js +9 -0
- package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts +25 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +426 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +147 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.js +672 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +1040 -0
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/types.js +35 -0
- package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/wrapper.d.ts +27 -0
- package/packages/pi-coding-agent/dist/core/extensions/wrapper.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/wrapper.js +102 -0
- package/packages/pi-coding-agent/dist/core/extensions/wrapper.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/footer-data-provider.d.ts +32 -0
- package/packages/pi-coding-agent/dist/core/footer-data-provider.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/footer-data-provider.js +134 -0
- package/packages/pi-coding-agent/dist/core/footer-data-provider.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/index.d.ts +9 -0
- package/packages/pi-coding-agent/dist/core/index.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/index.js +9 -0
- package/packages/pi-coding-agent/dist/core/index.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/keybindings.d.ts +55 -0
- package/packages/pi-coding-agent/dist/core/keybindings.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/keybindings.js +151 -0
- package/packages/pi-coding-agent/dist/core/keybindings.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/messages.d.ts +77 -0
- package/packages/pi-coding-agent/dist/core/messages.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/messages.js +123 -0
- package/packages/pi-coding-agent/dist/core/messages.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts +113 -0
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-registry.js +537 -0
- package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.d.ts +104 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.js +462 -0
- package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/package-manager.d.ts +156 -0
- package/packages/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/package-manager.js +1442 -0
- package/packages/pi-coding-agent/dist/core/package-manager.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/prompt-templates.d.ts +50 -0
- package/packages/pi-coding-agent/dist/core/prompt-templates.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/prompt-templates.js +251 -0
- package/packages/pi-coding-agent/dist/core/prompt-templates.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/resolve-config-value.d.ts +17 -0
- package/packages/pi-coding-agent/dist/core/resolve-config-value.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/resolve-config-value.js +59 -0
- package/packages/pi-coding-agent/dist/core/resolve-config-value.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/resource-loader.d.ts +184 -0
- package/packages/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/resource-loader.js +633 -0
- package/packages/pi-coding-agent/dist/core/resource-loader.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/sdk.d.ts +90 -0
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/sdk.js +242 -0
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/session-manager.d.ts +323 -0
- package/packages/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/session-manager.js +1094 -0
- package/packages/pi-coding-agent/dist/core/session-manager.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +232 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.js +682 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/skills.d.ts +58 -0
- package/packages/pi-coding-agent/dist/core/skills.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/skills.js +364 -0
- package/packages/pi-coding-agent/dist/core/skills.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/slash-commands.d.ts +15 -0
- package/packages/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/slash-commands.js +22 -0
- package/packages/pi-coding-agent/dist/core/slash-commands.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts +28 -0
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/system-prompt.js +159 -0
- package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/timings.d.ts +7 -0
- package/packages/pi-coding-agent/dist/core/timings.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/timings.js +25 -0
- package/packages/pi-coding-agent/dist/core/timings.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/bash.d.ts +55 -0
- package/packages/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/bash.js +269 -0
- package/packages/pi-coding-agent/dist/core/tools/bash.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/edit-diff.d.ts +63 -0
- package/packages/pi-coding-agent/dist/core/tools/edit-diff.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/edit-diff.js +243 -0
- package/packages/pi-coding-agent/dist/core/tools/edit-diff.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/edit.d.ts +39 -0
- package/packages/pi-coding-agent/dist/core/tools/edit.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/edit.js +146 -0
- package/packages/pi-coding-agent/dist/core/tools/edit.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/find.d.ts +39 -0
- package/packages/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/find.js +206 -0
- package/packages/pi-coding-agent/dist/core/tools/find.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/grep.d.ts +45 -0
- package/packages/pi-coding-agent/dist/core/tools/grep.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/grep.js +239 -0
- package/packages/pi-coding-agent/dist/core/tools/grep.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/index.d.ts +73 -0
- package/packages/pi-coding-agent/dist/core/tools/index.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/index.js +61 -0
- package/packages/pi-coding-agent/dist/core/tools/index.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/ls.d.ts +40 -0
- package/packages/pi-coding-agent/dist/core/tools/ls.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/ls.js +118 -0
- package/packages/pi-coding-agent/dist/core/tools/ls.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/path-utils.d.ts +8 -0
- package/packages/pi-coding-agent/dist/core/tools/path-utils.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/path-utils.js +81 -0
- package/packages/pi-coding-agent/dist/core/tools/path-utils.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/read.d.ts +39 -0
- package/packages/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/read.js +166 -0
- package/packages/pi-coding-agent/dist/core/tools/read.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/truncate.d.ts +70 -0
- package/packages/pi-coding-agent/dist/core/tools/truncate.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/truncate.js +205 -0
- package/packages/pi-coding-agent/dist/core/tools/truncate.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/write.d.ts +29 -0
- package/packages/pi-coding-agent/dist/core/tools/write.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/tools/write.js +78 -0
- package/packages/pi-coding-agent/dist/core/tools/write.js.map +1 -0
- package/packages/pi-coding-agent/dist/index.d.ts +27 -0
- package/packages/pi-coding-agent/dist/index.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/index.js +42 -0
- package/packages/pi-coding-agent/dist/index.js.map +1 -0
- package/packages/pi-coding-agent/dist/main.d.ts +8 -0
- package/packages/pi-coding-agent/dist/main.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/main.js +691 -0
- package/packages/pi-coding-agent/dist/main.js.map +1 -0
- package/packages/pi-coding-agent/dist/migrations.d.ts +33 -0
- package/packages/pi-coding-agent/dist/migrations.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/migrations.js +261 -0
- package/packages/pi-coding-agent/dist/migrations.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/index.d.ts +9 -0
- package/packages/pi-coding-agent/dist/modes/index.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/index.js +8 -0
- package/packages/pi-coding-agent/dist/modes/index.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/armin.d.ts +34 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/armin.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/armin.js +329 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/armin.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts +16 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +92 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts +35 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +156 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/bordered-loader.js +48 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/bordered-loader.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js +42 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js +43 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.d.ts +71 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.js +470 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/countdown-timer.js +28 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/countdown-timer.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/custom-editor.d.ts +21 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/custom-editor.js +63 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/custom-editor.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/custom-message.d.ts +20 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/custom-message.js +74 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/custom-message.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/daxnuts.d.ts +23 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/daxnuts.js +138 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/daxnuts.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts +12 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js +133 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js +20 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-editor.d.ts +20 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-editor.js +106 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-editor.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.d.ts +23 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.js +55 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.d.ts +24 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.js +71 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts +26 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +196 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/index.d.ts +32 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/index.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/index.js +33 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/index.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/keybinding-hints.d.ts +41 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/keybinding-hints.js +61 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts +42 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +139 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts +47 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js +259 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/oauth-selector.d.ts +19 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/oauth-selector.js +92 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/oauth-selector.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts +49 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.js +271 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.js +155 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.d.ts +95 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.js +825 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +58 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +295 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/show-images-selector.js +34 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/show-images-selector.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js +45 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/theme-selector.js +44 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/theme-selector.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/thinking-selector.js +46 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/thinking-selector.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +77 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +773 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.d.ts +87 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.js +1026 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message-selector.js +110 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message-selector.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts +9 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js +27 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/visual-truncate.js +33 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/visual-truncate.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +330 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +3755 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/dark.json +86 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/light.json +85 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.json +335 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +78 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +944 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/print-mode.d.ts +28 -0
- package/packages/pi-coding-agent/dist/modes/print-mode.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/print-mode.js +101 -0
- package/packages/pi-coding-agent/dist/modes/print-mode.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/rpc/jsonl.d.ts +17 -0
- package/packages/pi-coding-agent/dist/modes/rpc/jsonl.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/rpc/jsonl.js +49 -0
- package/packages/pi-coding-agent/dist/modes/rpc/jsonl.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts +217 -0
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.js +400 -0
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts +20 -0
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js +509 -0
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts +409 -0
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.js +8 -0
- package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.js.map +1 -0
- package/packages/pi-coding-agent/dist/utils/changelog.d.ts +21 -0
- package/packages/pi-coding-agent/dist/utils/changelog.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/utils/changelog.js +87 -0
- package/packages/pi-coding-agent/dist/utils/changelog.js.map +1 -0
- package/packages/pi-coding-agent/dist/utils/clipboard-image.d.ts +11 -0
- package/packages/pi-coding-agent/dist/utils/clipboard-image.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/utils/clipboard-image.js +162 -0
- package/packages/pi-coding-agent/dist/utils/clipboard-image.js.map +1 -0
- package/packages/pi-coding-agent/dist/utils/clipboard-native.d.ts +7 -0
- package/packages/pi-coding-agent/dist/utils/clipboard-native.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/utils/clipboard-native.js +14 -0
- package/packages/pi-coding-agent/dist/utils/clipboard-native.js.map +1 -0
- package/packages/pi-coding-agent/dist/utils/clipboard.d.ts +2 -0
- package/packages/pi-coding-agent/dist/utils/clipboard.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/utils/clipboard.js +67 -0
- package/packages/pi-coding-agent/dist/utils/clipboard.js.map +1 -0
- package/packages/pi-coding-agent/dist/utils/frontmatter.d.ts +8 -0
- package/packages/pi-coding-agent/dist/utils/frontmatter.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/utils/frontmatter.js +26 -0
- package/packages/pi-coding-agent/dist/utils/frontmatter.js.map +1 -0
- package/packages/pi-coding-agent/dist/utils/git.d.ts +26 -0
- package/packages/pi-coding-agent/dist/utils/git.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/utils/git.js +163 -0
- package/packages/pi-coding-agent/dist/utils/git.js.map +1 -0
- package/packages/pi-coding-agent/dist/utils/image-convert.d.ts +9 -0
- package/packages/pi-coding-agent/dist/utils/image-convert.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/utils/image-convert.js +35 -0
- package/packages/pi-coding-agent/dist/utils/image-convert.js.map +1 -0
- package/packages/pi-coding-agent/dist/utils/image-resize.d.ts +36 -0
- package/packages/pi-coding-agent/dist/utils/image-resize.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/utils/image-resize.js +181 -0
- package/packages/pi-coding-agent/dist/utils/image-resize.js.map +1 -0
- package/packages/pi-coding-agent/dist/utils/mime.d.ts +2 -0
- package/packages/pi-coding-agent/dist/utils/mime.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/utils/mime.js +26 -0
- package/packages/pi-coding-agent/dist/utils/mime.js.map +1 -0
- package/packages/pi-coding-agent/dist/utils/photon.d.ts +21 -0
- package/packages/pi-coding-agent/dist/utils/photon.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/utils/photon.js +121 -0
- package/packages/pi-coding-agent/dist/utils/photon.js.map +1 -0
- package/packages/pi-coding-agent/dist/utils/shell.d.ts +26 -0
- package/packages/pi-coding-agent/dist/utils/shell.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/utils/shell.js +186 -0
- package/packages/pi-coding-agent/dist/utils/shell.js.map +1 -0
- package/packages/pi-coding-agent/dist/utils/sleep.d.ts +5 -0
- package/packages/pi-coding-agent/dist/utils/sleep.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/utils/sleep.js +17 -0
- package/packages/pi-coding-agent/dist/utils/sleep.js.map +1 -0
- package/packages/pi-coding-agent/dist/utils/tools-manager.d.ts +3 -0
- package/packages/pi-coding-agent/dist/utils/tools-manager.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/utils/tools-manager.js +251 -0
- package/packages/pi-coding-agent/dist/utils/tools-manager.js.map +1 -0
- package/packages/pi-coding-agent/package.json +55 -0
- package/packages/pi-coding-agent/src/cli/args.ts +316 -0
- package/packages/pi-coding-agent/src/cli/config-selector.ts +52 -0
- package/packages/pi-coding-agent/src/cli/file-processor.ts +96 -0
- package/packages/pi-coding-agent/src/cli/list-models.ts +104 -0
- package/packages/pi-coding-agent/src/cli/session-picker.ts +51 -0
- package/packages/pi-coding-agent/src/cli.ts +18 -0
- package/packages/pi-coding-agent/src/config.ts +241 -0
- package/packages/pi-coding-agent/src/core/agent-session.ts +3050 -0
- package/packages/pi-coding-agent/src/core/auth-storage.ts +489 -0
- package/packages/pi-coding-agent/src/core/bash-executor.ts +278 -0
- package/packages/pi-coding-agent/src/core/compaction/branch-summarization.ts +352 -0
- package/packages/pi-coding-agent/src/core/compaction/compaction.ts +813 -0
- package/packages/pi-coding-agent/src/core/compaction/index.ts +7 -0
- package/packages/pi-coding-agent/src/core/compaction/utils.ts +170 -0
- package/packages/pi-coding-agent/src/core/defaults.ts +3 -0
- package/packages/pi-coding-agent/src/core/diagnostics.ts +15 -0
- package/packages/pi-coding-agent/src/core/event-bus.ts +33 -0
- package/packages/pi-coding-agent/src/core/exec.ts +104 -0
- package/packages/pi-coding-agent/src/core/export-html/ansi-to-html.ts +258 -0
- package/packages/pi-coding-agent/src/core/export-html/index.ts +306 -0
- package/packages/pi-coding-agent/src/core/export-html/template.css +971 -0
- package/packages/pi-coding-agent/src/core/export-html/template.html +54 -0
- package/packages/pi-coding-agent/src/core/export-html/template.js +1583 -0
- package/packages/pi-coding-agent/src/core/export-html/tool-renderer.ts +114 -0
- package/packages/pi-coding-agent/src/core/export-html/vendor/.gitkeep +0 -0
- package/packages/pi-coding-agent/src/core/extensions/index.ts +171 -0
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +545 -0
- package/packages/pi-coding-agent/src/core/extensions/runner.ts +884 -0
- package/packages/pi-coding-agent/src/core/extensions/types.ts +1411 -0
- package/packages/pi-coding-agent/src/core/extensions/wrapper.ts +118 -0
- package/packages/pi-coding-agent/src/core/footer-data-provider.ts +144 -0
- package/packages/pi-coding-agent/src/core/index.ts +61 -0
- package/packages/pi-coding-agent/src/core/keybindings.ts +211 -0
- package/packages/pi-coding-agent/src/core/messages.ts +195 -0
- package/packages/pi-coding-agent/src/core/model-registry.ts +694 -0
- package/packages/pi-coding-agent/src/core/model-resolver.ts +594 -0
- package/packages/pi-coding-agent/src/core/package-manager.ts +1794 -0
- package/packages/pi-coding-agent/src/core/prompt-templates.ts +299 -0
- package/packages/pi-coding-agent/src/core/resolve-config-value.ts +64 -0
- package/packages/pi-coding-agent/src/core/resource-loader.ts +868 -0
- package/packages/pi-coding-agent/src/core/sdk.ts +373 -0
- package/packages/pi-coding-agent/src/core/session-manager.ts +1410 -0
- package/packages/pi-coding-agent/src/core/settings-manager.ts +942 -0
- package/packages/pi-coding-agent/src/core/skills.ts +459 -0
- package/packages/pi-coding-agent/src/core/slash-commands.ts +38 -0
- package/packages/pi-coding-agent/src/core/system-prompt.ts +218 -0
- package/packages/pi-coding-agent/src/core/timings.ts +25 -0
- package/packages/pi-coding-agent/src/core/tools/bash.ts +347 -0
- package/packages/pi-coding-agent/src/core/tools/edit-diff.ts +308 -0
- package/packages/pi-coding-agent/src/core/tools/edit.ts +227 -0
- package/packages/pi-coding-agent/src/core/tools/find.ts +273 -0
- package/packages/pi-coding-agent/src/core/tools/grep.ts +346 -0
- package/packages/pi-coding-agent/src/core/tools/index.ts +139 -0
- package/packages/pi-coding-agent/src/core/tools/ls.ts +170 -0
- package/packages/pi-coding-agent/src/core/tools/path-utils.ts +94 -0
- package/packages/pi-coding-agent/src/core/tools/read.ts +222 -0
- package/packages/pi-coding-agent/src/core/tools/truncate.ts +265 -0
- package/packages/pi-coding-agent/src/core/tools/write.ts +118 -0
- package/packages/pi-coding-agent/src/index.ts +333 -0
- package/packages/pi-coding-agent/src/main.ts +821 -0
- package/packages/pi-coding-agent/src/migrations.ts +295 -0
- package/packages/pi-coding-agent/src/modes/index.ts +9 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/armin.ts +382 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +115 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/bash-execution.ts +210 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/bordered-loader.ts +66 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/branch-summary-message.ts +58 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/compaction-summary-message.ts +59 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/config-selector.ts +592 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/countdown-timer.ts +38 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/custom-editor.ts +80 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/custom-message.ts +99 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/daxnuts.ts +164 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/diff.ts +147 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/dynamic-border.ts +25 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/extension-editor.ts +147 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/extension-input.ts +85 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/extension-selector.ts +107 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +216 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/index.ts +32 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/keybinding-hints.ts +66 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/login-dialog.ts +174 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/model-selector.ts +329 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/oauth-selector.ts +121 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/scoped-models-selector.ts +346 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/session-selector-search.ts +194 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/session-selector.ts +1019 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +421 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/show-images-selector.ts +45 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/skill-invocation-message.ts +55 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/theme-selector.ts +62 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/thinking-selector.ts +64 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +916 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/tree-selector.ts +1184 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/user-message-selector.ts +143 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/user-message.ts +32 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/visual-truncate.ts +50 -0
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +4464 -0
- package/packages/pi-coding-agent/src/modes/interactive/theme/dark.json +86 -0
- package/packages/pi-coding-agent/src/modes/interactive/theme/light.json +85 -0
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme-schema.json +335 -0
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +1105 -0
- package/packages/pi-coding-agent/src/modes/print-mode.ts +124 -0
- package/packages/pi-coding-agent/src/modes/rpc/jsonl.ts +58 -0
- package/packages/pi-coding-agent/src/modes/rpc/rpc-client.ts +505 -0
- package/packages/pi-coding-agent/src/modes/rpc/rpc-mode.ts +638 -0
- package/packages/pi-coding-agent/src/modes/rpc/rpc-types.ts +263 -0
- package/packages/pi-coding-agent/src/utils/changelog.ts +99 -0
- package/packages/pi-coding-agent/src/utils/clipboard-image.ts +207 -0
- package/packages/pi-coding-agent/src/utils/clipboard-native.ts +21 -0
- package/packages/pi-coding-agent/src/utils/clipboard.ts +62 -0
- package/packages/pi-coding-agent/src/utils/frontmatter.ts +39 -0
- package/packages/pi-coding-agent/src/utils/git.ts +192 -0
- package/packages/pi-coding-agent/src/utils/image-convert.ts +38 -0
- package/packages/pi-coding-agent/src/utils/image-resize.ts +231 -0
- package/packages/pi-coding-agent/src/utils/mime.ts +30 -0
- package/packages/pi-coding-agent/src/utils/photon.ts +139 -0
- package/packages/pi-coding-agent/src/utils/shell.ts +202 -0
- package/packages/pi-coding-agent/src/utils/sleep.ts +18 -0
- package/packages/pi-coding-agent/src/utils/tools-manager.ts +286 -0
- package/packages/pi-coding-agent/tsconfig.json +27 -0
- package/packages/pi-tui/dist/autocomplete.d.ts +50 -0
- package/packages/pi-tui/dist/autocomplete.d.ts.map +1 -0
- package/packages/pi-tui/dist/autocomplete.js +593 -0
- package/packages/pi-tui/dist/autocomplete.js.map +1 -0
- package/packages/pi-tui/dist/components/box.d.ts +22 -0
- package/packages/pi-tui/dist/components/box.d.ts.map +1 -0
- package/packages/pi-tui/dist/components/box.js +99 -0
- package/packages/pi-tui/dist/components/box.js.map +1 -0
- package/packages/pi-tui/dist/components/cancellable-loader.d.ts +22 -0
- package/packages/pi-tui/dist/components/cancellable-loader.d.ts.map +1 -0
- package/packages/pi-tui/dist/components/cancellable-loader.js +36 -0
- package/packages/pi-tui/dist/components/cancellable-loader.js.map +1 -0
- package/packages/pi-tui/dist/components/editor.d.ts +219 -0
- package/packages/pi-tui/dist/components/editor.d.ts.map +1 -0
- package/packages/pi-tui/dist/components/editor.js +1693 -0
- package/packages/pi-tui/dist/components/editor.js.map +1 -0
- package/packages/pi-tui/dist/components/image.d.ts +28 -0
- package/packages/pi-tui/dist/components/image.d.ts.map +1 -0
- package/packages/pi-tui/dist/components/image.js +61 -0
- package/packages/pi-tui/dist/components/image.js.map +1 -0
- package/packages/pi-tui/dist/components/input.d.ts +37 -0
- package/packages/pi-tui/dist/components/input.d.ts.map +1 -0
- package/packages/pi-tui/dist/components/input.js +443 -0
- package/packages/pi-tui/dist/components/input.js.map +1 -0
- package/packages/pi-tui/dist/components/loader.d.ts +21 -0
- package/packages/pi-tui/dist/components/loader.d.ts.map +1 -0
- package/packages/pi-tui/dist/components/loader.js +46 -0
- package/packages/pi-tui/dist/components/loader.js.map +1 -0
- package/packages/pi-tui/dist/components/markdown.d.ts +95 -0
- package/packages/pi-tui/dist/components/markdown.d.ts.map +1 -0
- package/packages/pi-tui/dist/components/markdown.js +641 -0
- package/packages/pi-tui/dist/components/markdown.js.map +1 -0
- package/packages/pi-tui/dist/components/select-list.d.ts +32 -0
- package/packages/pi-tui/dist/components/select-list.d.ts.map +1 -0
- package/packages/pi-tui/dist/components/select-list.js +148 -0
- package/packages/pi-tui/dist/components/select-list.js.map +1 -0
- package/packages/pi-tui/dist/components/settings-list.d.ts +50 -0
- package/packages/pi-tui/dist/components/settings-list.d.ts.map +1 -0
- package/packages/pi-tui/dist/components/settings-list.js +177 -0
- package/packages/pi-tui/dist/components/settings-list.js.map +1 -0
- package/packages/pi-tui/dist/components/spacer.d.ts +12 -0
- package/packages/pi-tui/dist/components/spacer.d.ts.map +1 -0
- package/packages/pi-tui/dist/components/spacer.js +22 -0
- package/packages/pi-tui/dist/components/spacer.js.map +1 -0
- package/packages/pi-tui/dist/components/text.d.ts +19 -0
- package/packages/pi-tui/dist/components/text.d.ts.map +1 -0
- package/packages/pi-tui/dist/components/text.js +81 -0
- package/packages/pi-tui/dist/components/text.js.map +1 -0
- package/packages/pi-tui/dist/components/truncated-text.d.ts +13 -0
- package/packages/pi-tui/dist/components/truncated-text.d.ts.map +1 -0
- package/packages/pi-tui/dist/components/truncated-text.js +48 -0
- package/packages/pi-tui/dist/components/truncated-text.js.map +1 -0
- package/packages/pi-tui/dist/editor-component.d.ts +39 -0
- package/packages/pi-tui/dist/editor-component.d.ts.map +1 -0
- package/packages/pi-tui/dist/editor-component.js +2 -0
- package/packages/pi-tui/dist/editor-component.js.map +1 -0
- package/packages/pi-tui/dist/fuzzy.d.ts +16 -0
- package/packages/pi-tui/dist/fuzzy.d.ts.map +1 -0
- package/packages/pi-tui/dist/fuzzy.js +107 -0
- package/packages/pi-tui/dist/fuzzy.js.map +1 -0
- package/packages/pi-tui/dist/index.d.ts +23 -0
- package/packages/pi-tui/dist/index.d.ts.map +1 -0
- package/packages/pi-tui/dist/index.js +32 -0
- package/packages/pi-tui/dist/index.js.map +1 -0
- package/packages/pi-tui/dist/keybindings.d.ts +39 -0
- package/packages/pi-tui/dist/keybindings.d.ts.map +1 -0
- package/packages/pi-tui/dist/keybindings.js +116 -0
- package/packages/pi-tui/dist/keybindings.js.map +1 -0
- package/packages/pi-tui/dist/keys.d.ts +170 -0
- package/packages/pi-tui/dist/keys.d.ts.map +1 -0
- package/packages/pi-tui/dist/keys.js +1046 -0
- package/packages/pi-tui/dist/keys.js.map +1 -0
- package/packages/pi-tui/dist/kill-ring.d.ts +28 -0
- package/packages/pi-tui/dist/kill-ring.d.ts.map +1 -0
- package/packages/pi-tui/dist/kill-ring.js +46 -0
- package/packages/pi-tui/dist/kill-ring.js.map +1 -0
- package/packages/pi-tui/dist/stdin-buffer.d.ts +48 -0
- package/packages/pi-tui/dist/stdin-buffer.d.ts.map +1 -0
- package/packages/pi-tui/dist/stdin-buffer.js +316 -0
- package/packages/pi-tui/dist/stdin-buffer.js.map +1 -0
- package/packages/pi-tui/dist/terminal-image.d.ts +68 -0
- package/packages/pi-tui/dist/terminal-image.d.ts.map +1 -0
- package/packages/pi-tui/dist/terminal-image.js +288 -0
- package/packages/pi-tui/dist/terminal-image.js.map +1 -0
- package/packages/pi-tui/dist/terminal.d.ts +85 -0
- package/packages/pi-tui/dist/terminal.d.ts.map +1 -0
- package/packages/pi-tui/dist/terminal.js +271 -0
- package/packages/pi-tui/dist/terminal.js.map +1 -0
- package/packages/pi-tui/dist/tui.d.ts +220 -0
- package/packages/pi-tui/dist/tui.d.ts.map +1 -0
- package/packages/pi-tui/dist/tui.js +976 -0
- package/packages/pi-tui/dist/tui.js.map +1 -0
- package/packages/pi-tui/dist/undo-stack.d.ts +17 -0
- package/packages/pi-tui/dist/undo-stack.d.ts.map +1 -0
- package/packages/pi-tui/dist/undo-stack.js +27 -0
- package/packages/pi-tui/dist/undo-stack.js.map +1 -0
- package/packages/pi-tui/dist/utils.d.ts +78 -0
- package/packages/pi-tui/dist/utils.d.ts.map +1 -0
- package/packages/pi-tui/dist/utils.js +817 -0
- package/packages/pi-tui/dist/utils.js.map +1 -0
- package/packages/pi-tui/package.json +21 -0
- package/packages/pi-tui/src/autocomplete.ts +736 -0
- package/packages/pi-tui/src/components/box.ts +137 -0
- package/packages/pi-tui/src/components/cancellable-loader.ts +40 -0
- package/packages/pi-tui/src/components/editor.ts +2035 -0
- package/packages/pi-tui/src/components/image.ts +104 -0
- package/packages/pi-tui/src/components/input.ts +521 -0
- package/packages/pi-tui/src/components/loader.ts +55 -0
- package/packages/pi-tui/src/components/markdown.ts +806 -0
- package/packages/pi-tui/src/components/select-list.ts +188 -0
- package/packages/pi-tui/src/components/settings-list.ts +250 -0
- package/packages/pi-tui/src/components/spacer.ts +28 -0
- package/packages/pi-tui/src/components/text.ts +106 -0
- package/packages/pi-tui/src/components/truncated-text.ts +65 -0
- package/packages/pi-tui/src/editor-component.ts +74 -0
- package/packages/pi-tui/src/fuzzy.ts +133 -0
- package/packages/pi-tui/src/index.ts +93 -0
- package/packages/pi-tui/src/keybindings.ts +189 -0
- package/packages/pi-tui/src/keys.ts +1255 -0
- package/packages/pi-tui/src/kill-ring.ts +46 -0
- package/packages/pi-tui/src/stdin-buffer.ts +386 -0
- package/packages/pi-tui/src/terminal-image.ts +381 -0
- package/packages/pi-tui/src/terminal.ts +349 -0
- package/packages/pi-tui/src/tui.ts +1212 -0
- package/packages/pi-tui/src/undo-stack.ts +28 -0
- package/packages/pi-tui/src/utils.ts +905 -0
- package/packages/pi-tui/tsconfig.json +27 -0
- package/pkg/dist/modes/interactive/theme/dark.json +6 -6
- package/pkg/dist/modes/interactive/theme/light.json +6 -5
- package/pkg/dist/modes/interactive/theme/theme.d.ts +2 -2
- package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.js +1 -6
- package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
- package/scripts/postinstall.js +2 -17
- package/src/resources/extensions/ask-user-questions.ts +2 -2
- package/src/resources/extensions/bg-shell/index.ts +4 -4
- package/src/resources/extensions/browser-tools/index.ts +3 -3
- package/src/resources/extensions/context7/index.ts +3 -3
- package/src/resources/extensions/get-secrets-from-user.ts +331 -59
- package/src/resources/extensions/google-search/index.ts +20 -7
- package/src/resources/extensions/gsd/activity-log.ts +1 -1
- package/src/resources/extensions/gsd/auto.ts +106 -21
- package/src/resources/extensions/gsd/commands.ts +2 -2
- package/src/resources/extensions/gsd/dashboard-overlay.ts +2 -2
- package/src/resources/extensions/gsd/docs/preferences-reference.md +45 -1
- package/src/resources/extensions/gsd/doctor.ts +23 -4
- package/src/resources/extensions/gsd/files.ts +115 -1
- package/src/resources/extensions/gsd/git-service.ts +64 -111
- package/src/resources/extensions/gsd/guided-flow.ts +3 -2
- package/src/resources/extensions/gsd/index.ts +18 -7
- package/src/resources/extensions/gsd/metrics.ts +1 -1
- package/src/resources/extensions/gsd/migrate/command.ts +1 -1
- package/src/resources/extensions/gsd/preferences.ts +72 -10
- package/src/resources/extensions/gsd/prompts/guided-plan-milestone.md +4 -0
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +17 -0
- package/src/resources/extensions/gsd/session-forensics.ts +19 -6
- package/src/resources/extensions/gsd/skill-discovery.ts +1 -1
- package/src/resources/extensions/gsd/templates/secrets-manifest.md +22 -0
- package/src/resources/extensions/gsd/tests/auto-secrets-gate.test.ts +196 -0
- package/src/resources/extensions/gsd/tests/collect-from-manifest.test.ts +469 -0
- package/src/resources/extensions/gsd/tests/doctor-fixlevel.test.ts +170 -0
- package/src/resources/extensions/gsd/tests/git-service.test.ts +43 -0
- package/src/resources/extensions/gsd/tests/manifest-status.test.ts +283 -0
- package/src/resources/extensions/gsd/tests/parsers.test.ts +401 -65
- package/src/resources/extensions/gsd/tests/resolve-ts-hooks.mjs +2 -1
- package/src/resources/extensions/gsd/tests/secure-env-collect.test.ts +185 -0
- package/src/resources/extensions/gsd/types.ts +27 -0
- package/src/resources/extensions/gsd/worktree-command.ts +2 -2
- package/src/resources/extensions/mac-tools/index.ts +2 -2
- package/src/resources/extensions/mcporter/index.ts +3 -3
- package/src/resources/extensions/remote-questions/remote-command.ts +3 -3
- package/src/resources/extensions/search-the-web/command-search-provider.ts +2 -2
- package/src/resources/extensions/search-the-web/index.ts +1 -1
- package/src/resources/extensions/search-the-web/provider.ts +1 -1
- package/src/resources/extensions/search-the-web/tool-fetch-page.ts +3 -3
- package/src/resources/extensions/search-the-web/tool-llm-context.ts +4 -4
- package/src/resources/extensions/search-the-web/tool-search.ts +4 -4
- package/src/resources/extensions/shared/confirm-ui.ts +3 -3
- package/src/resources/extensions/shared/interview-ui.ts +3 -3
- package/src/resources/extensions/shared/next-action-ui.ts +3 -3
- package/src/resources/extensions/shared/progress-widget.ts +2 -2
- package/src/resources/extensions/shared/thinking-widget.ts +3 -3
- package/src/resources/extensions/shared/ui.ts +4 -4
- package/src/resources/extensions/shared/wizard-ui.ts +4 -4
- package/src/resources/extensions/slash-commands/audit.ts +1 -1
- package/src/resources/extensions/slash-commands/clear.ts +1 -1
- package/src/resources/extensions/slash-commands/create-extension.ts +2 -2
- package/src/resources/extensions/slash-commands/create-slash-command.ts +2 -2
- package/src/resources/extensions/slash-commands/index.ts +1 -1
- package/src/resources/extensions/subagent/agents.ts +1 -1
- package/src/resources/extensions/subagent/index.ts +5 -5
- package/src/resources/extensions/voice/index.ts +3 -3
- package/patches/@mariozechner+pi-coding-agent+0.57.1.patch +0 -78
- package/patches/@mariozechner+pi-tui+0.57.1.patch +0 -47
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-line editor component for extensions.
|
|
3
|
+
* Supports Ctrl+G for external editor.
|
|
4
|
+
*/
|
|
5
|
+
import { Container, type EditorOptions, type Focusable, type TUI } from "@gsd/pi-tui";
|
|
6
|
+
import type { KeybindingsManager } from "../../../core/keybindings.js";
|
|
7
|
+
export declare class ExtensionEditorComponent extends Container implements Focusable {
|
|
8
|
+
private editor;
|
|
9
|
+
private onSubmitCallback;
|
|
10
|
+
private onCancelCallback;
|
|
11
|
+
private tui;
|
|
12
|
+
private keybindings;
|
|
13
|
+
private _focused;
|
|
14
|
+
get focused(): boolean;
|
|
15
|
+
set focused(value: boolean);
|
|
16
|
+
constructor(tui: TUI, keybindings: KeybindingsManager, title: string, prefill: string | undefined, onSubmit: (value: string) => void, onCancel: () => void, options?: EditorOptions);
|
|
17
|
+
handleInput(keyData: string): void;
|
|
18
|
+
private openExternalEditor;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=extension-editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-editor.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/extension-editor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EACN,SAAS,EAET,KAAK,aAAa,EAClB,KAAK,SAAS,EAId,KAAK,GAAG,EACR,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAKvE,qBAAa,wBAAyB,SAAQ,SAAU,YAAW,SAAS;IAC3E,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,gBAAgB,CAA0B;IAClD,OAAO,CAAC,gBAAgB,CAAa;IACrC,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,WAAW,CAAqB;IAExC,OAAO,CAAC,QAAQ,CAAS;IACzB,IAAI,OAAO,IAAI,OAAO,CAErB;IACD,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAGzB;gBAGA,GAAG,EAAE,GAAG,EACR,WAAW,EAAE,kBAAkB,EAC/B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,EACjC,QAAQ,EAAE,MAAM,IAAI,EACpB,OAAO,CAAC,EAAE,aAAa;IA+CxB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAkBlC,OAAO,CAAC,kBAAkB;CAkC1B"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-line editor component for extensions.
|
|
3
|
+
* Supports Ctrl+G for external editor.
|
|
4
|
+
*/
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
import * as fs from "node:fs";
|
|
7
|
+
import * as os from "node:os";
|
|
8
|
+
import * as path from "node:path";
|
|
9
|
+
import { Container, Editor, getEditorKeybindings, Spacer, Text, } from "@gsd/pi-tui";
|
|
10
|
+
import { getEditorTheme, theme } from "../theme/theme.js";
|
|
11
|
+
import { DynamicBorder } from "./dynamic-border.js";
|
|
12
|
+
import { appKeyHint, keyHint } from "./keybinding-hints.js";
|
|
13
|
+
export class ExtensionEditorComponent extends Container {
|
|
14
|
+
get focused() {
|
|
15
|
+
return this._focused;
|
|
16
|
+
}
|
|
17
|
+
set focused(value) {
|
|
18
|
+
this._focused = value;
|
|
19
|
+
this.editor.focused = value;
|
|
20
|
+
}
|
|
21
|
+
constructor(tui, keybindings, title, prefill, onSubmit, onCancel, options) {
|
|
22
|
+
super();
|
|
23
|
+
this._focused = false;
|
|
24
|
+
this.tui = tui;
|
|
25
|
+
this.keybindings = keybindings;
|
|
26
|
+
this.onSubmitCallback = onSubmit;
|
|
27
|
+
this.onCancelCallback = onCancel;
|
|
28
|
+
// Add top border
|
|
29
|
+
this.addChild(new DynamicBorder());
|
|
30
|
+
this.addChild(new Spacer(1));
|
|
31
|
+
// Add title
|
|
32
|
+
this.addChild(new Text(theme.fg("accent", title), 1, 0));
|
|
33
|
+
this.addChild(new Spacer(1));
|
|
34
|
+
// Create editor
|
|
35
|
+
this.editor = new Editor(tui, getEditorTheme(), options);
|
|
36
|
+
if (prefill) {
|
|
37
|
+
this.editor.setText(prefill);
|
|
38
|
+
}
|
|
39
|
+
// Wire up Enter to submit (Shift+Enter for newlines, like the main editor)
|
|
40
|
+
this.editor.onSubmit = (text) => {
|
|
41
|
+
this.onSubmitCallback(text);
|
|
42
|
+
};
|
|
43
|
+
this.addChild(this.editor);
|
|
44
|
+
this.addChild(new Spacer(1));
|
|
45
|
+
// Add hint
|
|
46
|
+
const hasExternalEditor = !!(process.env.VISUAL || process.env.EDITOR);
|
|
47
|
+
const hint = keyHint("selectConfirm", "submit") +
|
|
48
|
+
" " +
|
|
49
|
+
keyHint("newLine", "newline") +
|
|
50
|
+
" " +
|
|
51
|
+
keyHint("selectCancel", "cancel") +
|
|
52
|
+
(hasExternalEditor ? ` ${appKeyHint(this.keybindings, "externalEditor", "external editor")}` : "");
|
|
53
|
+
this.addChild(new Text(hint, 1, 0));
|
|
54
|
+
this.addChild(new Spacer(1));
|
|
55
|
+
// Add bottom border
|
|
56
|
+
this.addChild(new DynamicBorder());
|
|
57
|
+
}
|
|
58
|
+
handleInput(keyData) {
|
|
59
|
+
const kb = getEditorKeybindings();
|
|
60
|
+
// Escape or Ctrl+C to cancel
|
|
61
|
+
if (kb.matches(keyData, "selectCancel")) {
|
|
62
|
+
this.onCancelCallback();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// External editor (app keybinding)
|
|
66
|
+
if (this.keybindings.matches(keyData, "externalEditor")) {
|
|
67
|
+
this.openExternalEditor();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
// Forward to editor
|
|
71
|
+
this.editor.handleInput(keyData);
|
|
72
|
+
}
|
|
73
|
+
openExternalEditor() {
|
|
74
|
+
const editorCmd = process.env.VISUAL || process.env.EDITOR;
|
|
75
|
+
if (!editorCmd) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const currentText = this.editor.getText();
|
|
79
|
+
const tmpFile = path.join(os.tmpdir(), `pi-extension-editor-${Date.now()}.md`);
|
|
80
|
+
try {
|
|
81
|
+
fs.writeFileSync(tmpFile, currentText, "utf-8");
|
|
82
|
+
this.tui.stop();
|
|
83
|
+
const [editor, ...editorArgs] = editorCmd.split(" ");
|
|
84
|
+
const result = spawnSync(editor, [...editorArgs, tmpFile], {
|
|
85
|
+
stdio: "inherit",
|
|
86
|
+
shell: process.platform === "win32",
|
|
87
|
+
});
|
|
88
|
+
if (result.status === 0) {
|
|
89
|
+
const newContent = fs.readFileSync(tmpFile, "utf-8").replace(/\n$/, "");
|
|
90
|
+
this.editor.setText(newContent);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
finally {
|
|
94
|
+
try {
|
|
95
|
+
fs.unlinkSync(tmpFile);
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
// Ignore cleanup errors
|
|
99
|
+
}
|
|
100
|
+
this.tui.start();
|
|
101
|
+
// Force full re-render since external editor uses alternate screen
|
|
102
|
+
this.tui.requestRender(true);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=extension-editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-editor.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/extension-editor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EACN,SAAS,EACT,MAAM,EAGN,oBAAoB,EACpB,MAAM,EACN,IAAI,GAEJ,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,OAAO,wBAAyB,SAAQ,SAAS;IAQtD,IAAI,OAAO;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IACD,IAAI,OAAO,CAAC,KAAc;QACzB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC;IAC7B,CAAC;IAED,YACC,GAAQ,EACR,WAA+B,EAC/B,KAAa,EACb,OAA2B,EAC3B,QAAiC,EACjC,QAAoB,EACpB,OAAuB;QAEvB,KAAK,EAAE,CAAC;QAlBD,aAAQ,GAAG,KAAK,CAAC;QAoBxB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC;QACjC,IAAI,CAAC,gBAAgB,GAAG,QAAQ,C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CAAC,aAAa,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;YAChD,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;YAEhB,MAAM,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACrD,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,UAAU,EAAE,OAAO,CAAC,EAAE;gBAC1D,KAAK,EAAE,SAAS;gBAChB,KAAK,EAAE,OAAO,CAAC,QAAQ,KAAK,OAAO;aACnC,CAAC,CAAC;YAEH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACzB,MAAM,UAAU,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBACxE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YACjC,CAAC;QACF,CAAC;gBAAS,CAAC;YACV,IAAI,CAAC;gBACJ,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YACxB,CAAC;YAAC,MAAM,CAAC;gBACR,wBAAwB;YACzB,CAAC;YACD,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;YACjB,mEAAmE;YACnE,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC;CACD","sourcesContent":["/**\n * Multi-line editor component for extensions.\n * Supports Ctrl+G for external editor.\n */\n\nimport { spawnSync } from \"node:child_process\";\nimport * as fs from \"node:fs\";\nimport * as os from \"node:os\";\nimport * as path from \"node:path\";\nimport {\n\tContainer,\n\tEditor,\n\ttype EditorOptions,\n\ttype Focusable,\n\tgetEditorKeybindings,\n\tSpacer,\n\tText,\n\ttype TUI,\n} from \"@gsd/pi-tui\";\nimport type { KeybindingsManager } from \"../../../core/keybindings.js\";\nimport { getEditorTheme, theme } from \"../theme/theme.js\";\nimport { DynamicBorder } from \"./dynamic-border.js\";\nimport { appKeyHint, keyHint } from \"./keybinding-hints.js\";\n\nexport class ExtensionEditorComponent extends Container implements Focusable {\n\tprivate editor: Editor;\n\tprivate onSubmitCallback: (value: string) => void;\n\tprivate onCancelCallback: () => void;\n\tprivate tui: TUI;\n\tprivate keybindings: KeybindingsManager;\n\n\tprivate _focused = false;\n\tget focused(): boolean {\n\t\treturn this._focused;\n\t}\n\tset focused(value: boolean) {\n\t\tthis._focused = value;\n\t\tthis.editor.focused = value;\n\t}\n\n\tconstructor(\n\t\ttui: TUI,\n\t\tkeybindings: KeybindingsManager,\n\t\ttitle: string,\n\t\tprefill: string | undefined,\n\t\tonSubmit: (value: string) => void,\n\t\tonCancel: () => void,\n\t\toptions?: EditorOptions,\n\t) {\n\t\tsuper();\n\n\t\tthis.tui = tui;\n\t\tthis.keybindings = keybindings;\n\t\tthis.onSubmitCallback = onSubmit;\n\t\tthis.onCancelCallback = onCancel;\n\n\t\t// Add top border\n\t\tthis.addChild(new DynamicBorder());\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Add title\n\t\tthis.addChild(new Text(theme.fg(\"accent\", title), 1, 0));\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Create editor\n\t\tthis.editor = new Editor(tui, getEditorTheme(), options);\n\t\tif (prefill) {\n\t\t\tthis.editor.setText(prefill);\n\t\t}\n\t\t// Wire up Enter to submit (Shift+Enter for newlines, like the main editor)\n\t\tthis.editor.onSubmit = (text: string) => {\n\t\t\tthis.onSubmitCallback(text);\n\t\t};\n\t\tthis.addChild(this.editor);\n\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Add hint\n\t\tconst hasExternalEditor = !!(process.env.VISUAL || process.env.EDITOR);\n\t\tconst hint =\n\t\t\tkeyHint(\"selectConfirm\", \"submit\") +\n\t\t\t\" \" +\n\t\t\tkeyHint(\"newLine\", \"newline\") +\n\t\t\t\" \" +\n\t\t\tkeyHint(\"selectCancel\", \"cancel\") +\n\t\t\t(hasExternalEditor ? ` ${appKeyHint(this.keybindings, \"externalEditor\", \"external editor\")}` : \"\");\n\t\tthis.addChild(new Text(hint, 1, 0));\n\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Add bottom border\n\t\tthis.addChild(new DynamicBorder());\n\t}\n\n\thandleInput(keyData: string): void {\n\t\tconst kb = getEditorKeybindings();\n\t\t// Escape or Ctrl+C to cancel\n\t\tif (kb.matches(keyData, \"selectCancel\")) {\n\t\t\tthis.onCancelCallback();\n\t\t\treturn;\n\t\t}\n\n\t\t// External editor (app keybinding)\n\t\tif (this.keybindings.matches(keyData, \"externalEditor\")) {\n\t\t\tthis.openExternalEditor();\n\t\t\treturn;\n\t\t}\n\n\t\t// Forward to editor\n\t\tthis.editor.handleInput(keyData);\n\t}\n\n\tprivate openExternalEditor(): void {\n\t\tconst editorCmd = process.env.VISUAL || process.env.EDITOR;\n\t\tif (!editorCmd) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentText = this.editor.getText();\n\t\tconst tmpFile = path.join(os.tmpdir(), `pi-extension-editor-${Date.now()}.md`);\n\n\t\ttry {\n\t\t\tfs.writeFileSync(tmpFile, currentText, \"utf-8\");\n\t\t\tthis.tui.stop();\n\n\t\t\tconst [editor, ...editorArgs] = editorCmd.split(\" \");\n\t\t\tconst result = spawnSync(editor, [...editorArgs, tmpFile], {\n\t\t\t\tstdio: \"inherit\",\n\t\t\t\tshell: process.platform === \"win32\",\n\t\t\t});\n\n\t\t\tif (result.status === 0) {\n\t\t\t\tconst newContent = fs.readFileSync(tmpFile, \"utf-8\").replace(/\\n$/, \"\");\n\t\t\t\tthis.editor.setText(newContent);\n\t\t\t}\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tfs.unlinkSync(tmpFile);\n\t\t\t} catch {\n\t\t\t\t// Ignore cleanup errors\n\t\t\t}\n\t\t\tthis.tui.start();\n\t\t\t// Force full re-render since external editor uses alternate screen\n\t\t\tthis.tui.requestRender(true);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple text input component for extensions.
|
|
3
|
+
*/
|
|
4
|
+
import { Container, type Focusable, type TUI } from "@gsd/pi-tui";
|
|
5
|
+
export interface ExtensionInputOptions {
|
|
6
|
+
tui?: TUI;
|
|
7
|
+
timeout?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class ExtensionInputComponent extends Container implements Focusable {
|
|
10
|
+
private input;
|
|
11
|
+
private onSubmitCallback;
|
|
12
|
+
private onCancelCallback;
|
|
13
|
+
private titleText;
|
|
14
|
+
private baseTitle;
|
|
15
|
+
private countdown;
|
|
16
|
+
private _focused;
|
|
17
|
+
get focused(): boolean;
|
|
18
|
+
set focused(value: boolean);
|
|
19
|
+
constructor(title: string, _placeholder: string | undefined, onSubmit: (value: string) => void, onCancel: () => void, opts?: ExtensionInputOptions);
|
|
20
|
+
handleInput(keyData: string): void;
|
|
21
|
+
dispose(): void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=extension-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-input.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/extension-input.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAA6C,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAM7G,MAAM,WAAW,qBAAqB;IACrC,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,uBAAwB,SAAQ,SAAU,YAAW,SAAS;IAC1E,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,gBAAgB,CAA0B;IAClD,OAAO,CAAC,gBAAgB,CAAa;IACrC,OAAO,CAAC,SAAS,CAAO;IACxB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,SAAS,CAA6B;IAG9C,OAAO,CAAC,QAAQ,CAAS;IACzB,IAAI,OAAO,IAAI,OAAO,CAErB;IACD,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAGzB;gBAGA,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,EACjC,QAAQ,EAAE,MAAM,IAAI,EACpB,IAAI,CAAC,EAAE,qBAAqB;IAgC7B,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAWlC,OAAO,IAAI,IAAI;CAGf"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple text input component for extensions.
|
|
3
|
+
*/
|
|
4
|
+
import { Container, getEditorKeybindings, Input, Spacer, Text } from "@gsd/pi-tui";
|
|
5
|
+
import { theme } from "../theme/theme.js";
|
|
6
|
+
import { CountdownTimer } from "./countdown-timer.js";
|
|
7
|
+
import { DynamicBorder } from "./dynamic-border.js";
|
|
8
|
+
import { keyHint } from "./keybinding-hints.js";
|
|
9
|
+
export class ExtensionInputComponent extends Container {
|
|
10
|
+
get focused() {
|
|
11
|
+
return this._focused;
|
|
12
|
+
}
|
|
13
|
+
set focused(value) {
|
|
14
|
+
this._focused = value;
|
|
15
|
+
this.input.focused = value;
|
|
16
|
+
}
|
|
17
|
+
constructor(title, _placeholder, onSubmit, onCancel, opts) {
|
|
18
|
+
super();
|
|
19
|
+
// Focusable implementation - propagate to input for IME cursor positioning
|
|
20
|
+
this._focused = false;
|
|
21
|
+
this.onSubmitCallback = onSubmit;
|
|
22
|
+
this.onCancelCallback = onCancel;
|
|
23
|
+
this.baseTitle = title;
|
|
24
|
+
this.addChild(new DynamicBorder());
|
|
25
|
+
this.addChild(new Spacer(1));
|
|
26
|
+
this.titleText = new Text(theme.fg("accent", title), 1, 0);
|
|
27
|
+
this.addChild(this.titleText);
|
|
28
|
+
this.addChild(new Spacer(1));
|
|
29
|
+
if (opts?.timeout && opts.timeout > 0 && opts.tui) {
|
|
30
|
+
this.countdown = new CountdownTimer(opts.timeout, opts.tui, (s) => this.titleText.setText(theme.fg("accent", `${this.baseTitle} (${s}s)`)), () => this.onCancelCallback());
|
|
31
|
+
}
|
|
32
|
+
this.input = new Input();
|
|
33
|
+
this.addChild(this.input);
|
|
34
|
+
this.addChild(new Spacer(1));
|
|
35
|
+
this.addChild(new Text(`${keyHint("selectConfirm", "submit")} ${keyHint("selectCancel", "cancel")}`, 1, 0));
|
|
36
|
+
this.addChild(new Spacer(1));
|
|
37
|
+
this.addChild(new DynamicBorder());
|
|
38
|
+
}
|
|
39
|
+
handleInput(keyData) {
|
|
40
|
+
const kb = getEditorKeybindings();
|
|
41
|
+
if (kb.matches(keyData, "selectConfirm") || keyData === "\n") {
|
|
42
|
+
this.onSubmitCallback(this.input.getValue());
|
|
43
|
+
}
|
|
44
|
+
else if (kb.matches(keyData, "selectCancel")) {
|
|
45
|
+
this.onCancelCallback();
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
this.input.handleInput(keyData);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
dispose() {
|
|
52
|
+
this.countdown?.dispose();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=extension-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-input.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/extension-input.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAkB,oBAAoB,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAY,MAAM,aAAa,CAAC;AAC7G,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD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AC;IAC3B,CAAC;CACD","sourcesContent":["/**\n * Simple text input component for extensions.\n */\n\nimport { Container, type Focusable, getEditorKeybindings, Input, Spacer, Text, type TUI } from \"@gsd/pi-tui\";\nimport { theme } from \"../theme/theme.js\";\nimport { CountdownTimer } from \"./countdown-timer.js\";\nimport { DynamicBorder } from \"./dynamic-border.js\";\nimport { keyHint } from \"./keybinding-hints.js\";\n\nexport interface ExtensionInputOptions {\n\ttui?: TUI;\n\ttimeout?: number;\n}\n\nexport class ExtensionInputComponent extends Container implements Focusable {\n\tprivate input: Input;\n\tprivate onSubmitCallback: (value: string) => void;\n\tprivate onCancelCallback: () => void;\n\tprivate titleText: Text;\n\tprivate baseTitle: string;\n\tprivate countdown: CountdownTimer | undefined;\n\n\t// Focusable implementation - propagate to input for IME cursor positioning\n\tprivate _focused = false;\n\tget focused(): boolean {\n\t\treturn this._focused;\n\t}\n\tset focused(value: boolean) {\n\t\tthis._focused = value;\n\t\tthis.input.focused = value;\n\t}\n\n\tconstructor(\n\t\ttitle: string,\n\t\t_placeholder: string | undefined,\n\t\tonSubmit: (value: string) => void,\n\t\tonCancel: () => void,\n\t\topts?: ExtensionInputOptions,\n\t) {\n\t\tsuper();\n\n\t\tthis.onSubmitCallback = onSubmit;\n\t\tthis.onCancelCallback = onCancel;\n\t\tthis.baseTitle = title;\n\n\t\tthis.addChild(new DynamicBorder());\n\t\tthis.addChild(new Spacer(1));\n\n\t\tthis.titleText = new Text(theme.fg(\"accent\", title), 1, 0);\n\t\tthis.addChild(this.titleText);\n\t\tthis.addChild(new Spacer(1));\n\n\t\tif (opts?.timeout && opts.timeout > 0 && opts.tui) {\n\t\t\tthis.countdown = new CountdownTimer(\n\t\t\t\topts.timeout,\n\t\t\t\topts.tui,\n\t\t\t\t(s) => this.titleText.setText(theme.fg(\"accent\", `${this.baseTitle} (${s}s)`)),\n\t\t\t\t() => this.onCancelCallback(),\n\t\t\t);\n\t\t}\n\n\t\tthis.input = new Input();\n\t\tthis.addChild(this.input);\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(new Text(`${keyHint(\"selectConfirm\", \"submit\")} ${keyHint(\"selectCancel\", \"cancel\")}`, 1, 0));\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(new DynamicBorder());\n\t}\n\n\thandleInput(keyData: string): void {\n\t\tconst kb = getEditorKeybindings();\n\t\tif (kb.matches(keyData, \"selectConfirm\") || keyData === \"\\n\") {\n\t\t\tthis.onSubmitCallback(this.input.getValue());\n\t\t} else if (kb.matches(keyData, \"selectCancel\")) {\n\t\t\tthis.onCancelCallback();\n\t\t} else {\n\t\t\tthis.input.handleInput(keyData);\n\t\t}\n\t}\n\n\tdispose(): void {\n\t\tthis.countdown?.dispose();\n\t}\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic selector component for extensions.
|
|
3
|
+
* Displays a list of string options with keyboard navigation.
|
|
4
|
+
*/
|
|
5
|
+
import { Container, type TUI } from "@gsd/pi-tui";
|
|
6
|
+
export interface ExtensionSelectorOptions {
|
|
7
|
+
tui?: TUI;
|
|
8
|
+
timeout?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare class ExtensionSelectorComponent extends Container {
|
|
11
|
+
private options;
|
|
12
|
+
private selectedIndex;
|
|
13
|
+
private listContainer;
|
|
14
|
+
private onSelectCallback;
|
|
15
|
+
private onCancelCallback;
|
|
16
|
+
private titleText;
|
|
17
|
+
private baseTitle;
|
|
18
|
+
private countdown;
|
|
19
|
+
constructor(title: string, options: string[], onSelect: (option: string) => void, onCancel: () => void, opts?: ExtensionSelectorOptions);
|
|
20
|
+
private updateList;
|
|
21
|
+
handleInput(keyData: string): void;
|
|
22
|
+
dispose(): void;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=extension-selector.d.ts.map
|
package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-selector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/extension-selector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAsC,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAMtF,MAAM,WAAW,wBAAwB;IACxC,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,0BAA2B,SAAQ,SAAS;IACxD,OAAO,CAAC,OAAO,CAAW;IAC1B,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,aAAa,CAAY;IACjC,OAAO,CAAC,gBAAgB,CAA2B;IACnD,OAAO,CAAC,gBAAgB,CAAa;IACrC,OAAO,CAAC,SAAS,CAAO;IACxB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,SAAS,CAA6B;gBAG7C,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EAAE,EACjB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,EAClC,QAAQ,EAAE,MAAM,IAAI,EACpB,IAAI,CAAC,EAAE,wBAAwB;IA6ChC,OAAO,CAAC,UAAU;IAWlB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAgBlC,OAAO,IAAI,IAAI;CAGf"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic selector component for extensions.
|
|
3
|
+
* Displays a list of string options with keyboard navigation.
|
|
4
|
+
*/
|
|
5
|
+
import { Container, getEditorKeybindings, Spacer, Text } from "@gsd/pi-tui";
|
|
6
|
+
import { theme } from "../theme/theme.js";
|
|
7
|
+
import { CountdownTimer } from "./countdown-timer.js";
|
|
8
|
+
import { DynamicBorder } from "./dynamic-border.js";
|
|
9
|
+
import { keyHint, rawKeyHint } from "./keybinding-hints.js";
|
|
10
|
+
export class ExtensionSelectorComponent extends Container {
|
|
11
|
+
constructor(title, options, onSelect, onCancel, opts) {
|
|
12
|
+
super();
|
|
13
|
+
this.selectedIndex = 0;
|
|
14
|
+
this.options = options;
|
|
15
|
+
this.onSelectCallback = onSelect;
|
|
16
|
+
this.onCancelCallback = onCancel;
|
|
17
|
+
this.baseTitle = title;
|
|
18
|
+
this.addChild(new DynamicBorder());
|
|
19
|
+
this.addChild(new Spacer(1));
|
|
20
|
+
this.titleText = new Text(theme.fg("accent", title), 1, 0);
|
|
21
|
+
this.addChild(this.titleText);
|
|
22
|
+
this.addChild(new Spacer(1));
|
|
23
|
+
if (opts?.timeout && opts.timeout > 0 && opts.tui) {
|
|
24
|
+
this.countdown = new CountdownTimer(opts.timeout, opts.tui, (s) => this.titleText.setText(theme.fg("accent", `${this.baseTitle} (${s}s)`)), () => this.onCancelCallback());
|
|
25
|
+
}
|
|
26
|
+
this.listContainer = new Container();
|
|
27
|
+
this.addChild(this.listContainer);
|
|
28
|
+
this.addChild(new Spacer(1));
|
|
29
|
+
this.addChild(new Text(rawKeyHint("↑↓", "navigate") +
|
|
30
|
+
" " +
|
|
31
|
+
keyHint("selectConfirm", "select") +
|
|
32
|
+
" " +
|
|
33
|
+
keyHint("selectCancel", "cancel"), 1, 0));
|
|
34
|
+
this.addChild(new Spacer(1));
|
|
35
|
+
this.addChild(new DynamicBorder());
|
|
36
|
+
this.updateList();
|
|
37
|
+
}
|
|
38
|
+
updateList() {
|
|
39
|
+
this.listContainer.clear();
|
|
40
|
+
for (let i = 0; i < this.options.length; i++) {
|
|
41
|
+
const isSelected = i === this.selectedIndex;
|
|
42
|
+
const text = isSelected
|
|
43
|
+
? theme.fg("accent", "→ ") + theme.fg("accent", this.options[i])
|
|
44
|
+
: ` ${theme.fg("text", this.options[i])}`;
|
|
45
|
+
this.listContainer.addChild(new Text(text, 1, 0));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
handleInput(keyData) {
|
|
49
|
+
const kb = getEditorKeybindings();
|
|
50
|
+
if (kb.matches(keyData, "selectUp") || keyData === "k") {
|
|
51
|
+
this.selectedIndex = Math.max(0, this.selectedIndex - 1);
|
|
52
|
+
this.updateList();
|
|
53
|
+
}
|
|
54
|
+
else if (kb.matches(keyData, "selectDown") || keyData === "j") {
|
|
55
|
+
this.selectedIndex = Math.min(this.options.length - 1, this.selectedIndex + 1);
|
|
56
|
+
this.updateList();
|
|
57
|
+
}
|
|
58
|
+
else if (kb.matches(keyData, "selectConfirm") || keyData === "\n") {
|
|
59
|
+
const selected = this.options[this.selectedIndex];
|
|
60
|
+
if (selected)
|
|
61
|
+
this.onSelectCallback(selected);
|
|
62
|
+
}
|
|
63
|
+
else if (kb.matches(keyData, "selectCancel")) {
|
|
64
|
+
this.onCancelCallback();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
dispose() {
|
|
68
|
+
this.countdown?.dispose();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=extension-selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-selector.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/extension-selector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,EAAE,IAAI,EAAY,MAAM,aAAa,CAAC;AACtF,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAO5D,MAAM,OAAO,0BAA2B,SAAQ,SAAS;IAUxD,YACC,KAAa,EACb,OAAiB,EACjB,QAAkC,EAClC,QAAoB,EACpB,IAA+B;QAE/B,KAAK,EAAE,CAAC;QAfD,kBAAa,GAAG,CAAC,CAAC;QAiBzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC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E,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;YACzD,IAAI,CAAC,UAAU,EAAE,CAAC;QACnB,CAAC;aAAM,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,IAAI,OAAO,KAAK,GAAG,EAAE,CAAC;YACjE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;YAC/E,IAAI,CAAC,UAAU,EAAE,CAAC;QACnB,CAAC;aAAM,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,eAAe,CAAC,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrE,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAClD,IAAI,QAAQ;gBAAE,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAC/C,CAAC;aAAM,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,cAAc,CAAC,EAAE,CAAC;YAChD,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACzB,CAAC;IACF,CAAC;IAED,OAAO;QACN,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,CAAC;IAC3B,CAAC;CACD","sourcesContent":["/**\n * Generic selector component for extensions.\n * Displays a list of string options with keyboard navigation.\n */\n\nimport { Container, getEditorKeybindings, Spacer, Text, type TUI } from \"@gsd/pi-tui\";\nimport { theme } from \"../theme/theme.js\";\nimport { CountdownTimer } from \"./countdown-timer.js\";\nimport { DynamicBorder } from \"./dynamic-border.js\";\nimport { keyHint, rawKeyHint } from \"./keybinding-hints.js\";\n\nexport interface ExtensionSelectorOptions {\n\ttui?: TUI;\n\ttimeout?: number;\n}\n\nexport class ExtensionSelectorComponent extends Container {\n\tprivate options: string[];\n\tprivate selectedIndex = 0;\n\tprivate listContainer: Container;\n\tprivate onSelectCallback: (option: string) => void;\n\tprivate onCancelCallback: () => void;\n\tprivate titleText: Text;\n\tprivate baseTitle: string;\n\tprivate countdown: CountdownTimer | undefined;\n\n\tconstructor(\n\t\ttitle: string,\n\t\toptions: string[],\n\t\tonSelect: (option: string) => void,\n\t\tonCancel: () => void,\n\t\topts?: ExtensionSelectorOptions,\n\t) {\n\t\tsuper();\n\n\t\tthis.options = options;\n\t\tthis.onSelectCallback = onSelect;\n\t\tthis.onCancelCallback = onCancel;\n\t\tthis.baseTitle = title;\n\n\t\tthis.addChild(new DynamicBorder());\n\t\tthis.addChild(new Spacer(1));\n\n\t\tthis.titleText = new Text(theme.fg(\"accent\", title), 1, 0);\n\t\tthis.addChild(this.titleText);\n\t\tthis.addChild(new Spacer(1));\n\n\t\tif (opts?.timeout && opts.timeout > 0 && opts.tui) {\n\t\t\tthis.countdown = new CountdownTimer(\n\t\t\t\topts.timeout,\n\t\t\t\topts.tui,\n\t\t\t\t(s) => this.titleText.setText(theme.fg(\"accent\", `${this.baseTitle} (${s}s)`)),\n\t\t\t\t() => this.onCancelCallback(),\n\t\t\t);\n\t\t}\n\n\t\tthis.listContainer = new Container();\n\t\tthis.addChild(this.listContainer);\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(\n\t\t\tnew Text(\n\t\t\t\trawKeyHint(\"↑↓\", \"navigate\") +\n\t\t\t\t\t\" \" +\n\t\t\t\t\tkeyHint(\"selectConfirm\", \"select\") +\n\t\t\t\t\t\" \" +\n\t\t\t\t\tkeyHint(\"selectCancel\", \"cancel\"),\n\t\t\t\t1,\n\t\t\t\t0,\n\t\t\t),\n\t\t);\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(new DynamicBorder());\n\n\t\tthis.updateList();\n\t}\n\n\tprivate updateList(): void {\n\t\tthis.listContainer.clear();\n\t\tfor (let i = 0; i < this.options.length; i++) {\n\t\t\tconst isSelected = i === this.selectedIndex;\n\t\t\tconst text = isSelected\n\t\t\t\t? theme.fg(\"accent\", \"→ \") + theme.fg(\"accent\", this.options[i])\n\t\t\t\t: ` ${theme.fg(\"text\", this.options[i])}`;\n\t\t\tthis.listContainer.addChild(new Text(text, 1, 0));\n\t\t}\n\t}\n\n\thandleInput(keyData: string): void {\n\t\tconst kb = getEditorKeybindings();\n\t\tif (kb.matches(keyData, \"selectUp\") || keyData === \"k\") {\n\t\t\tthis.selectedIndex = Math.max(0, this.selectedIndex - 1);\n\t\t\tthis.updateList();\n\t\t} else if (kb.matches(keyData, \"selectDown\") || keyData === \"j\") {\n\t\t\tthis.selectedIndex = Math.min(this.options.length - 1, this.selectedIndex + 1);\n\t\t\tthis.updateList();\n\t\t} else if (kb.matches(keyData, \"selectConfirm\") || keyData === \"\\n\") {\n\t\t\tconst selected = this.options[this.selectedIndex];\n\t\t\tif (selected) this.onSelectCallback(selected);\n\t\t} else if (kb.matches(keyData, \"selectCancel\")) {\n\t\t\tthis.onCancelCallback();\n\t\t}\n\t}\n\n\tdispose(): void {\n\t\tthis.countdown?.dispose();\n\t}\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Component } from "@gsd/pi-tui";
|
|
2
|
+
import type { AgentSession } from "../../../core/agent-session.js";
|
|
3
|
+
import type { ReadonlyFooterDataProvider } from "../../../core/footer-data-provider.js";
|
|
4
|
+
/**
|
|
5
|
+
* Footer component that shows pwd, token stats, and context usage.
|
|
6
|
+
* Computes token/context stats from session, gets git branch and extension statuses from provider.
|
|
7
|
+
*/
|
|
8
|
+
export declare class FooterComponent implements Component {
|
|
9
|
+
private session;
|
|
10
|
+
private footerData;
|
|
11
|
+
private autoCompactEnabled;
|
|
12
|
+
constructor(session: AgentSession, footerData: ReadonlyFooterDataProvider);
|
|
13
|
+
setAutoCompactEnabled(enabled: boolean): void;
|
|
14
|
+
/**
|
|
15
|
+
* No-op: git branch caching now handled by provider.
|
|
16
|
+
* Kept for compatibility with existing call sites in interactive-mode.
|
|
17
|
+
*/
|
|
18
|
+
invalidate(): void;
|
|
19
|
+
/**
|
|
20
|
+
* Clean up resources.
|
|
21
|
+
* Git watcher cleanup now handled by provider.
|
|
22
|
+
*/
|
|
23
|
+
dispose(): void;
|
|
24
|
+
render(width: number): string[];
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=footer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/footer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAiC,MAAM,aAAa,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AA0BxF;;;GAGG;AACH,qBAAa,eAAgB,YAAW,SAAS;IAI/C,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,UAAU;IAJnB,OAAO,CAAC,kBAAkB,CAAQ;gBAGzB,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,0BAA0B;IAG/C,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAI7C;;;OAGG;IACH,UAAU,IAAI,IAAI;IAIlB;;;OAGG;IACH,OAAO,IAAI,IAAI;IAIf,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;CA2J/B"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { truncateToWidth, visibleWidth } from "@gsd/pi-tui";
|
|
2
|
+
import { theme } from "../theme/theme.js";
|
|
3
|
+
/**
|
|
4
|
+
* Sanitize text for display in a single-line status.
|
|
5
|
+
* Removes newlines, tabs, carriage returns, and other control characters.
|
|
6
|
+
*/
|
|
7
|
+
function sanitizeStatusText(text) {
|
|
8
|
+
// Replace newlines, tabs, carriage returns with space, then collapse multiple spaces
|
|
9
|
+
return text
|
|
10
|
+
.replace(/[\r\n\t]/g, " ")
|
|
11
|
+
.replace(/ +/g, " ")
|
|
12
|
+
.trim();
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Format token counts (similar to web-ui)
|
|
16
|
+
*/
|
|
17
|
+
function formatTokens(count) {
|
|
18
|
+
if (count < 1000)
|
|
19
|
+
return count.toString();
|
|
20
|
+
if (count < 10000)
|
|
21
|
+
return `${(count / 1000).toFixed(1)}k`;
|
|
22
|
+
if (count < 1000000)
|
|
23
|
+
return `${Math.round(count / 1000)}k`;
|
|
24
|
+
if (count < 10000000)
|
|
25
|
+
return `${(count / 1000000).toFixed(1)}M`;
|
|
26
|
+
return `${Math.round(count / 1000000)}M`;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Footer component that shows pwd, token stats, and context usage.
|
|
30
|
+
* Computes token/context stats from session, gets git branch and extension statuses from provider.
|
|
31
|
+
*/
|
|
32
|
+
export class FooterComponent {
|
|
33
|
+
constructor(session, footerData) {
|
|
34
|
+
this.session = session;
|
|
35
|
+
this.footerData = footerData;
|
|
36
|
+
this.autoCompactEnabled = true;
|
|
37
|
+
}
|
|
38
|
+
setAutoCompactEnabled(enabled) {
|
|
39
|
+
this.autoCompactEnabled = enabled;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* No-op: git branch caching now handled by provider.
|
|
43
|
+
* Kept for compatibility with existing call sites in interactive-mode.
|
|
44
|
+
*/
|
|
45
|
+
invalidate() {
|
|
46
|
+
// No-op: git branch is cached/invalidated by provider
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Clean up resources.
|
|
50
|
+
* Git watcher cleanup now handled by provider.
|
|
51
|
+
*/
|
|
52
|
+
dispose() {
|
|
53
|
+
// Git watcher cleanup handled by provider
|
|
54
|
+
}
|
|
55
|
+
render(width) {
|
|
56
|
+
const state = this.session.state;
|
|
57
|
+
// Calculate cumulative usage from ALL session entries (not just post-compaction messages)
|
|
58
|
+
let totalInput = 0;
|
|
59
|
+
let totalOutput = 0;
|
|
60
|
+
let totalCacheRead = 0;
|
|
61
|
+
let totalCacheWrite = 0;
|
|
62
|
+
let totalCost = 0;
|
|
63
|
+
for (const entry of this.session.sessionManager.getEntries()) {
|
|
64
|
+
if (entry.type === "message" && entry.message.role === "assistant") {
|
|
65
|
+
totalInput += entry.message.usage.input;
|
|
66
|
+
totalOutput += entry.message.usage.output;
|
|
67
|
+
totalCacheRead += entry.message.usage.cacheRead;
|
|
68
|
+
totalCacheWrite += entry.message.usage.cacheWrite;
|
|
69
|
+
totalCost += entry.message.usage.cost.total;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// Calculate context usage from session (handles compaction correctly).
|
|
73
|
+
// After compaction, tokens are unknown until the next LLM response.
|
|
74
|
+
const contextUsage = this.session.getContextUsage();
|
|
75
|
+
const contextWindow = contextUsage?.contextWindow ?? state.model?.contextWindow ?? 0;
|
|
76
|
+
const contextPercentValue = contextUsage?.percent ?? 0;
|
|
77
|
+
const contextPercent = contextUsage?.percent !== null ? contextPercentValue.toFixed(1) : "?";
|
|
78
|
+
// Replace home directory with ~
|
|
79
|
+
let pwd = process.cwd();
|
|
80
|
+
const home = process.env.HOME || process.env.USERPROFILE;
|
|
81
|
+
if (home && pwd.startsWith(home)) {
|
|
82
|
+
pwd = `~${pwd.slice(home.length)}`;
|
|
83
|
+
}
|
|
84
|
+
// Add git branch if available
|
|
85
|
+
const branch = this.footerData.getGitBranch();
|
|
86
|
+
if (branch) {
|
|
87
|
+
pwd = `${pwd} (${branch})`;
|
|
88
|
+
}
|
|
89
|
+
// Add session name if set
|
|
90
|
+
const sessionName = this.session.sessionManager.getSessionName();
|
|
91
|
+
if (sessionName) {
|
|
92
|
+
pwd = `${pwd} • ${sessionName}`;
|
|
93
|
+
}
|
|
94
|
+
// Build stats line
|
|
95
|
+
const statsParts = [];
|
|
96
|
+
if (totalInput)
|
|
97
|
+
statsParts.push(`↑${formatTokens(totalInput)}`);
|
|
98
|
+
if (totalOutput)
|
|
99
|
+
statsParts.push(`↓${formatTokens(totalOutput)}`);
|
|
100
|
+
if (totalCacheRead)
|
|
101
|
+
statsParts.push(`R${formatTokens(totalCacheRead)}`);
|
|
102
|
+
if (totalCacheWrite)
|
|
103
|
+
statsParts.push(`W${formatTokens(totalCacheWrite)}`);
|
|
104
|
+
// Show cost with "(sub)" indicator if using OAuth subscription
|
|
105
|
+
const usingSubscription = state.model ? this.session.modelRegistry.isUsingOAuth(state.model) : false;
|
|
106
|
+
if (totalCost || usingSubscription) {
|
|
107
|
+
const costStr = `$${totalCost.toFixed(3)}${usingSubscription ? " (sub)" : ""}`;
|
|
108
|
+
statsParts.push(costStr);
|
|
109
|
+
}
|
|
110
|
+
// Colorize context percentage based on usage
|
|
111
|
+
let contextPercentStr;
|
|
112
|
+
const autoIndicator = this.autoCompactEnabled ? " (auto)" : "";
|
|
113
|
+
const contextPercentDisplay = contextPercent === "?"
|
|
114
|
+
? `?/${formatTokens(contextWindow)}${autoIndicator}`
|
|
115
|
+
: `${contextPercent}%/${formatTokens(contextWindow)}${autoIndicator}`;
|
|
116
|
+
if (contextPercentValue > 90) {
|
|
117
|
+
contextPercentStr = theme.fg("error", contextPercentDisplay);
|
|
118
|
+
}
|
|
119
|
+
else if (contextPercentValue > 70) {
|
|
120
|
+
contextPercentStr = theme.fg("warning", contextPercentDisplay);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
contextPercentStr = contextPercentDisplay;
|
|
124
|
+
}
|
|
125
|
+
statsParts.push(contextPercentStr);
|
|
126
|
+
let statsLeft = statsParts.join(" ");
|
|
127
|
+
// Add model name on the right side, plus thinking level if model supports it
|
|
128
|
+
const modelName = state.model?.id || "no-model";
|
|
129
|
+
let statsLeftWidth = visibleWidth(statsLeft);
|
|
130
|
+
// If statsLeft is too wide, truncate it
|
|
131
|
+
if (statsLeftWidth > width) {
|
|
132
|
+
statsLeft = truncateToWidth(statsLeft, width, "...");
|
|
133
|
+
statsLeftWidth = visibleWidth(statsLeft);
|
|
134
|
+
}
|
|
135
|
+
// Calculate available space for padding (minimum 2 spaces between stats and model)
|
|
136
|
+
const minPadding = 2;
|
|
137
|
+
// Add thinking level indicator if model supports reasoning
|
|
138
|
+
let rightSideWithoutProvider = modelName;
|
|
139
|
+
if (state.model?.reasoning) {
|
|
140
|
+
const thinkingLevel = state.thinkingLevel || "off";
|
|
141
|
+
rightSideWithoutProvider =
|
|
142
|
+
thinkingLevel === "off" ? `${modelName} • thinking off` : `${modelName} • ${thinkingLevel}`;
|
|
143
|
+
}
|
|
144
|
+
// Prepend the provider in parentheses if there are multiple providers and there's enough room
|
|
145
|
+
let rightSide = rightSideWithoutProvider;
|
|
146
|
+
if (this.footerData.getAvailableProviderCount() > 1 && state.model) {
|
|
147
|
+
rightSide = `(${state.model.provider}) ${rightSideWithoutProvider}`;
|
|
148
|
+
if (statsLeftWidth + minPadding + visibleWidth(rightSide) > width) {
|
|
149
|
+
// Too wide, fall back
|
|
150
|
+
rightSide = rightSideWithoutProvider;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const rightSideWidth = visibleWidth(rightSide);
|
|
154
|
+
const totalNeeded = statsLeftWidth + minPadding + rightSideWidth;
|
|
155
|
+
let statsLine;
|
|
156
|
+
if (totalNeeded <= width) {
|
|
157
|
+
// Both fit - add padding to right-align model
|
|
158
|
+
const padding = " ".repeat(width - statsLeftWidth - rightSideWidth);
|
|
159
|
+
statsLine = statsLeft + padding + rightSide;
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
// Need to truncate right side
|
|
163
|
+
const availableForRight = width - statsLeftWidth - minPadding;
|
|
164
|
+
if (availableForRight > 0) {
|
|
165
|
+
const truncatedRight = truncateToWidth(rightSide, availableForRight, "");
|
|
166
|
+
const truncatedRightWidth = visibleWidth(truncatedRight);
|
|
167
|
+
const padding = " ".repeat(Math.max(0, width - statsLeftWidth - truncatedRightWidth));
|
|
168
|
+
statsLine = statsLeft + padding + truncatedRight;
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
// Not enough space for right side at all
|
|
172
|
+
statsLine = statsLeft;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
// Apply dim to each part separately. statsLeft may contain color codes (for context %)
|
|
176
|
+
// that end with a reset, which would clear an outer dim wrapper. So we dim the parts
|
|
177
|
+
// before and after the colored section independently.
|
|
178
|
+
const dimStatsLeft = theme.fg("dim", statsLeft);
|
|
179
|
+
const remainder = statsLine.slice(statsLeft.length); // padding + rightSide
|
|
180
|
+
const dimRemainder = theme.fg("dim", remainder);
|
|
181
|
+
const pwdLine = truncateToWidth(theme.fg("dim", pwd), width, theme.fg("dim", "..."));
|
|
182
|
+
const lines = [pwdLine, dimStatsLeft + dimRemainder];
|
|
183
|
+
// Add extension statuses on a single line, sorted by key alphabetically
|
|
184
|
+
const extensionStatuses = this.footerData.getExtensionStatuses();
|
|
185
|
+
if (extensionStatuses.size > 0) {
|
|
186
|
+
const sortedStatuses = Array.from(extensionStatuses.entries())
|
|
187
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
188
|
+
.map(([, text]) => sanitizeStatusText(text));
|
|
189
|
+
const statusLine = sortedStatuses.join(" ");
|
|
190
|
+
// Truncate to terminal width with dim ellipsis for consistency with footer style
|
|
191
|
+
lines.push(truncateToWidth(statusLine, width, theme.fg("dim", "...")));
|
|
192
|
+
}
|
|
193
|
+
return lines;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/footer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG5E,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C;;;GAGG;AACH,SAAS,kBAAkB,CAAC,IAAY;IACvC,qFAAqF;IACrF,OAAO,IAAI;SACT,OAAO,CAAC,WAAW,EAAE,GAAG,C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,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;iBACtC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;YAC9C,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC5C,iFAAiF;YACjF,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;QACxE,CAAC;QAED,OAAO,KAAK,CAAC;IACd,CAAC;CACD","sourcesContent":["import { type Component, truncateToWidth, visibleWidth } from \"@gsd/pi-tui\";\nimport type { AgentSession } from \"../../../core/agent-session.js\";\nimport type { ReadonlyFooterDataProvider } from \"../../../core/footer-data-provider.js\";\nimport { theme } from \"../theme/theme.js\";\n\n/**\n * Sanitize text for display in a single-line status.\n * Removes newlines, tabs, carriage returns, and other control characters.\n */\nfunction sanitizeStatusText(text: string): string {\n\t// Replace newlines, tabs, carriage returns with space, then collapse multiple spaces\n\treturn text\n\t\t.replace(/[\\r\\n\\t]/g, \" \")\n\t\t.replace(/ +/g, \" \")\n\t\t.trim();\n}\n\n/**\n * Format token counts (similar to web-ui)\n */\nfunction formatTokens(count: number): string {\n\tif (count < 1000) return count.toString();\n\tif (count < 10000) return `${(count / 1000).toFixed(1)}k`;\n\tif (count < 1000000) return `${Math.round(count / 1000)}k`;\n\tif (count < 10000000) return `${(count / 1000000).toFixed(1)}M`;\n\treturn `${Math.round(count / 1000000)}M`;\n}\n\n/**\n * Footer component that shows pwd, token stats, and context usage.\n * Computes token/context stats from session, gets git branch and extension statuses from provider.\n */\nexport class FooterComponent implements Component {\n\tprivate autoCompactEnabled = true;\n\n\tconstructor(\n\t\tprivate session: AgentSession,\n\t\tprivate footerData: ReadonlyFooterDataProvider,\n\t) {}\n\n\tsetAutoCompactEnabled(enabled: boolean): void {\n\t\tthis.autoCompactEnabled = enabled;\n\t}\n\n\t/**\n\t * No-op: git branch caching now handled by provider.\n\t * Kept for compatibility with existing call sites in interactive-mode.\n\t */\n\tinvalidate(): void {\n\t\t// No-op: git branch is cached/invalidated by provider\n\t}\n\n\t/**\n\t * Clean up resources.\n\t * Git watcher cleanup now handled by provider.\n\t */\n\tdispose(): void {\n\t\t// Git watcher cleanup handled by provider\n\t}\n\n\trender(width: number): string[] {\n\t\tconst state = this.session.state;\n\n\t\t// Calculate cumulative usage from ALL session entries (not just post-compaction messages)\n\t\tlet totalInput = 0;\n\t\tlet totalOutput = 0;\n\t\tlet totalCacheRead = 0;\n\t\tlet totalCacheWrite = 0;\n\t\tlet totalCost = 0;\n\n\t\tfor (const entry of this.session.sessionManager.getEntries()) {\n\t\t\tif (entry.type === \"message\" && entry.message.role === \"assistant\") {\n\t\t\t\ttotalInput += entry.message.usage.input;\n\t\t\t\ttotalOutput += entry.message.usage.output;\n\t\t\t\ttotalCacheRead += entry.message.usage.cacheRead;\n\t\t\t\ttotalCacheWrite += entry.message.usage.cacheWrite;\n\t\t\t\ttotalCost += entry.message.usage.cost.total;\n\t\t\t}\n\t\t}\n\n\t\t// Calculate context usage from session (handles compaction correctly).\n\t\t// After compaction, tokens are unknown until the next LLM response.\n\t\tconst contextUsage = this.session.getContextUsage();\n\t\tconst contextWindow = contextUsage?.contextWindow ?? state.model?.contextWindow ?? 0;\n\t\tconst contextPercentValue = contextUsage?.percent ?? 0;\n\t\tconst contextPercent = contextUsage?.percent !== null ? contextPercentValue.toFixed(1) : \"?\";\n\n\t\t// Replace home directory with ~\n\t\tlet pwd = process.cwd();\n\t\tconst home = process.env.HOME || process.env.USERPROFILE;\n\t\tif (home && pwd.startsWith(home)) {\n\t\t\tpwd = `~${pwd.slice(home.length)}`;\n\t\t}\n\n\t\t// Add git branch if available\n\t\tconst branch = this.footerData.getGitBranch();\n\t\tif (branch) {\n\t\t\tpwd = `${pwd} (${branch})`;\n\t\t}\n\n\t\t// Add session name if set\n\t\tconst sessionName = this.session.sessionManager.getSessionName();\n\t\tif (sessionName) {\n\t\t\tpwd = `${pwd} • ${sessionName}`;\n\t\t}\n\n\t\t// Build stats line\n\t\tconst statsParts = [];\n\t\tif (totalInput) statsParts.push(`↑${formatTokens(totalInput)}`);\n\t\tif (totalOutput) statsParts.push(`↓${formatTokens(totalOutput)}`);\n\t\tif (totalCacheRead) statsParts.push(`R${formatTokens(totalCacheRead)}`);\n\t\tif (totalCacheWrite) statsParts.push(`W${formatTokens(totalCacheWrite)}`);\n\n\t\t// Show cost with \"(sub)\" indicator if using OAuth subscription\n\t\tconst usingSubscription = state.model ? this.session.modelRegistry.isUsingOAuth(state.model) : false;\n\t\tif (totalCost || usingSubscription) {\n\t\t\tconst costStr = `$${totalCost.toFixed(3)}${usingSubscription ? \" (sub)\" : \"\"}`;\n\t\t\tstatsParts.push(costStr);\n\t\t}\n\n\t\t// Colorize context percentage based on usage\n\t\tlet contextPercentStr: string;\n\t\tconst autoIndicator = this.autoCompactEnabled ? \" (auto)\" : \"\";\n\t\tconst contextPercentDisplay =\n\t\t\tcontextPercent === \"?\"\n\t\t\t\t? `?/${formatTokens(contextWindow)}${autoIndicator}`\n\t\t\t\t: `${contextPercent}%/${formatTokens(contextWindow)}${autoIndicator}`;\n\t\tif (contextPercentValue > 90) {\n\t\t\tcontextPercentStr = theme.fg(\"error\", contextPercentDisplay);\n\t\t} else if (contextPercentValue > 70) {\n\t\t\tcontextPercentStr = theme.fg(\"warning\", contextPercentDisplay);\n\t\t} else {\n\t\t\tcontextPercentStr = contextPercentDisplay;\n\t\t}\n\t\tstatsParts.push(contextPercentStr);\n\n\t\tlet statsLeft = statsParts.join(\" \");\n\n\t\t// Add model name on the right side, plus thinking level if model supports it\n\t\tconst modelName = state.model?.id || \"no-model\";\n\n\t\tlet statsLeftWidth = visibleWidth(statsLeft);\n\n\t\t// If statsLeft is too wide, truncate it\n\t\tif (statsLeftWidth > width) {\n\t\t\tstatsLeft = truncateToWidth(statsLeft, width, \"...\");\n\t\t\tstatsLeftWidth = visibleWidth(statsLeft);\n\t\t}\n\n\t\t// Calculate available space for padding (minimum 2 spaces between stats and model)\n\t\tconst minPadding = 2;\n\n\t\t// Add thinking level indicator if model supports reasoning\n\t\tlet rightSideWithoutProvider = modelName;\n\t\tif (state.model?.reasoning) {\n\t\t\tconst thinkingLevel = state.thinkingLevel || \"off\";\n\t\t\trightSideWithoutProvider =\n\t\t\t\tthinkingLevel === \"off\" ? `${modelName} • thinking off` : `${modelName} • ${thinkingLevel}`;\n\t\t}\n\n\t\t// Prepend the provider in parentheses if there are multiple providers and there's enough room\n\t\tlet rightSide = rightSideWithoutProvider;\n\t\tif (this.footerData.getAvailableProviderCount() > 1 && state.model) {\n\t\t\trightSide = `(${state.model!.provider}) ${rightSideWithoutProvider}`;\n\t\t\tif (statsLeftWidth + minPadding + visibleWidth(rightSide) > width) {\n\t\t\t\t// Too wide, fall back\n\t\t\t\trightSide = rightSideWithoutProvider;\n\t\t\t}\n\t\t}\n\n\t\tconst rightSideWidth = visibleWidth(rightSide);\n\t\tconst totalNeeded = statsLeftWidth + minPadding + rightSideWidth;\n\n\t\tlet statsLine: string;\n\t\tif (totalNeeded <= width) {\n\t\t\t// Both fit - add padding to right-align model\n\t\t\tconst padding = \" \".repeat(width - statsLeftWidth - rightSideWidth);\n\t\t\tstatsLine = statsLeft + padding + rightSide;\n\t\t} else {\n\t\t\t// Need to truncate right side\n\t\t\tconst availableForRight = width - statsLeftWidth - minPadding;\n\t\t\tif (availableForRight > 0) {\n\t\t\t\tconst truncatedRight = truncateToWidth(rightSide, availableForRight, \"\");\n\t\t\t\tconst truncatedRightWidth = visibleWidth(truncatedRight);\n\t\t\t\tconst padding = \" \".repeat(Math.max(0, width - statsLeftWidth - truncatedRightWidth));\n\t\t\t\tstatsLine = statsLeft + padding + truncatedRight;\n\t\t\t} else {\n\t\t\t\t// Not enough space for right side at all\n\t\t\t\tstatsLine = statsLeft;\n\t\t\t}\n\t\t}\n\n\t\t// Apply dim to each part separately. statsLeft may contain color codes (for context %)\n\t\t// that end with a reset, which would clear an outer dim wrapper. So we dim the parts\n\t\t// before and after the colored section independently.\n\t\tconst dimStatsLeft = theme.fg(\"dim\", statsLeft);\n\t\tconst remainder = statsLine.slice(statsLeft.length); // padding + rightSide\n\t\tconst dimRemainder = theme.fg(\"dim\", remainder);\n\n\t\tconst pwdLine = truncateToWidth(theme.fg(\"dim\", pwd), width, theme.fg(\"dim\", \"...\"));\n\t\tconst lines = [pwdLine, dimStatsLeft + dimRemainder];\n\n\t\t// Add extension statuses on a single line, sorted by key alphabetically\n\t\tconst extensionStatuses = this.footerData.getExtensionStatuses();\n\t\tif (extensionStatuses.size > 0) {\n\t\t\tconst sortedStatuses = Array.from(extensionStatuses.entries())\n\t\t\t\t.sort(([a], [b]) => a.localeCompare(b))\n\t\t\t\t.map(([, text]) => sanitizeStatusText(text));\n\t\t\tconst statusLine = sortedStatuses.join(\" \");\n\t\t\t// Truncate to terminal width with dim ellipsis for consistency with footer style\n\t\t\tlines.push(truncateToWidth(statusLine, width, theme.fg(\"dim\", \"...\")));\n\t\t}\n\n\t\treturn lines;\n\t}\n}\n"]}
|