@aexol/spectral 0.8.0 → 0.8.5
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/CHANGELOG.md +82 -55
- package/README.md +80 -82
- package/dist/agent/agents.d.ts +37 -0
- package/dist/agent/agents.d.ts.map +1 -0
- package/dist/agent/index.d.ts +29 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/cli.d.ts +17 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/commands/bind.d.ts +12 -0
- package/dist/commands/bind.d.ts.map +1 -0
- package/dist/commands/login-oauth.d.ts +15 -0
- package/dist/commands/login-oauth.d.ts.map +1 -0
- package/dist/commands/login.d.ts +37 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/logout.d.ts +8 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/serve.d.ts +112 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/unbind.d.ts +8 -0
- package/dist/commands/unbind.d.ts.map +1 -0
- package/dist/config.d.ts +49 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/designer/guidelines.d.ts +23 -0
- package/dist/designer/guidelines.d.ts.map +1 -0
- package/dist/designer/index.d.ts +26 -0
- package/dist/designer/index.d.ts.map +1 -0
- package/dist/designer/philosophies.d.ts +33 -0
- package/dist/designer/philosophies.d.ts.map +1 -0
- package/dist/designer/skills.d.ts +27 -0
- package/dist/designer/skills.d.ts.map +1 -0
- package/dist/designer/systems.d.ts +36 -0
- package/dist/designer/systems.d.ts.map +1 -0
- package/dist/extensions/aexol-mcp.d.ts +25 -0
- package/dist/extensions/aexol-mcp.d.ts.map +1 -0
- package/dist/extensions/kanban-bridge.d.ts +24 -0
- package/dist/extensions/kanban-bridge.d.ts.map +1 -0
- package/dist/extensions/kanban-bridge.js +668 -0
- package/dist/extensions/openrouter-attribution.d.ts +12 -0
- package/dist/extensions/openrouter-attribution.d.ts.map +1 -0
- package/dist/extensions/spectral-vision-fallback.d.ts +23 -0
- package/dist/extensions/spectral-vision-fallback.d.ts.map +1 -0
- package/dist/extensions/spectral-vision-fallback.js +32 -22
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/mcp/agent-dir.d.ts +3 -0
- package/dist/mcp/agent-dir.d.ts.map +1 -0
- package/dist/mcp/commands.d.ts +9 -0
- package/dist/mcp/commands.d.ts.map +1 -0
- package/dist/mcp/config.d.ts +78 -0
- package/dist/mcp/config.d.ts.map +1 -0
- package/dist/mcp/consent-manager.d.ts +14 -0
- package/dist/mcp/consent-manager.d.ts.map +1 -0
- package/dist/mcp/direct-tools.d.ts +11 -0
- package/dist/mcp/direct-tools.d.ts.map +1 -0
- package/dist/mcp/errors.d.ts +100 -0
- package/dist/mcp/errors.d.ts.map +1 -0
- package/dist/mcp/glimpse-ui.d.ts +10 -0
- package/dist/mcp/glimpse-ui.d.ts.map +1 -0
- package/dist/mcp/host-html-template.d.ts +17 -0
- package/dist/mcp/host-html-template.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/init.d.ts +10 -0
- package/dist/mcp/init.d.ts.map +1 -0
- package/dist/mcp/init.js +1 -9
- package/dist/mcp/lifecycle.d.ts +30 -0
- package/dist/mcp/lifecycle.d.ts.map +1 -0
- package/dist/mcp/logger.d.ts +52 -0
- package/dist/mcp/logger.d.ts.map +1 -0
- package/dist/mcp/mcp-auth-flow.d.ts +69 -0
- package/dist/mcp/mcp-auth-flow.d.ts.map +1 -0
- package/dist/mcp/mcp-auth.d.ts +100 -0
- package/dist/mcp/mcp-auth.d.ts.map +1 -0
- package/dist/mcp/mcp-callback-server.d.ts +40 -0
- package/dist/mcp/mcp-callback-server.d.ts.map +1 -0
- package/dist/mcp/mcp-oauth-provider.d.ts +101 -0
- package/dist/mcp/mcp-oauth-provider.d.ts.map +1 -0
- package/dist/mcp/metadata-cache.d.ts +32 -0
- package/dist/mcp/metadata-cache.d.ts.map +1 -0
- package/dist/mcp/npx-resolver.d.ts +7 -0
- package/dist/mcp/npx-resolver.d.ts.map +1 -0
- package/dist/mcp/oauth-handler.d.ts +19 -0
- package/dist/mcp/oauth-handler.d.ts.map +1 -0
- package/dist/mcp/onboarding-state.d.ts +13 -0
- package/dist/mcp/onboarding-state.d.ts.map +1 -0
- package/dist/mcp/proxy-modes.d.ts +12 -0
- package/dist/mcp/proxy-modes.d.ts.map +1 -0
- package/dist/mcp/resource-tools.d.ts +2 -0
- package/dist/mcp/resource-tools.d.ts.map +1 -0
- package/dist/mcp/sampling-handler.d.ts +16 -0
- package/dist/mcp/sampling-handler.d.ts.map +1 -0
- package/dist/mcp/server-manager.d.ts +42 -0
- package/dist/mcp/server-manager.d.ts.map +1 -0
- package/dist/mcp/state.d.ts +41 -0
- package/dist/mcp/state.d.ts.map +1 -0
- package/dist/mcp/tool-metadata.d.ts +11 -0
- package/dist/mcp/tool-metadata.d.ts.map +1 -0
- package/dist/mcp/tool-registrar.d.ts +9 -0
- package/dist/mcp/tool-registrar.d.ts.map +1 -0
- package/dist/mcp/types.d.ts +263 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/ui-resource-handler.d.ts +10 -0
- package/dist/mcp/ui-resource-handler.d.ts.map +1 -0
- package/dist/mcp/ui-server.d.ts +37 -0
- package/dist/mcp/ui-server.d.ts.map +1 -0
- package/dist/mcp/ui-session.d.ts +27 -0
- package/dist/mcp/ui-session.d.ts.map +1 -0
- package/dist/mcp/ui-stream-types.d.ts +197 -0
- package/dist/mcp/ui-stream-types.d.ts.map +1 -0
- package/dist/mcp/utils.d.ts +17 -0
- package/dist/mcp/utils.d.ts.map +1 -0
- package/dist/mcp/vitest.config.d.ts +3 -0
- package/dist/mcp/vitest.config.d.ts.map +1 -0
- package/dist/mcp-client.d.ts +58 -0
- package/dist/mcp-client.d.ts.map +1 -0
- package/dist/mcp-client.js +2 -1
- package/dist/memory/branch.d.ts +124 -0
- package/dist/memory/branch.d.ts.map +1 -0
- package/dist/memory/commands/status.d.ts +4 -0
- package/dist/memory/commands/status.d.ts.map +1 -0
- package/dist/memory/commands/view.d.ts +4 -0
- package/dist/memory/commands/view.d.ts.map +1 -0
- package/dist/memory/compaction.d.ts +113 -0
- package/dist/memory/compaction.d.ts.map +1 -0
- package/dist/memory/config.d.ts +27 -0
- package/dist/memory/config.d.ts.map +1 -0
- package/dist/memory/debug-log.d.ts +12 -0
- package/dist/memory/debug-log.d.ts.map +1 -0
- package/dist/memory/hooks/compaction-hook.d.ts +4 -0
- package/dist/memory/hooks/compaction-hook.d.ts.map +1 -0
- package/dist/memory/hooks/compaction-trigger.d.ts +4 -0
- package/dist/memory/hooks/compaction-trigger.d.ts.map +1 -0
- package/dist/memory/hooks/observer-trigger.d.ts +4 -0
- package/dist/memory/hooks/observer-trigger.d.ts.map +1 -0
- package/dist/memory/ids.d.ts +2 -0
- package/dist/memory/ids.d.ts.map +1 -0
- package/dist/memory/index.d.ts +3 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +2 -0
- package/dist/memory/model-budget.d.ts +4 -0
- package/dist/memory/model-budget.d.ts.map +1 -0
- package/dist/memory/observer.d.ts +21 -0
- package/dist/memory/observer.d.ts.map +1 -0
- package/dist/memory/project-observations-store.d.ts +24 -0
- package/dist/memory/project-observations-store.d.ts.map +1 -0
- package/dist/memory/prompts.d.ts +11 -0
- package/dist/memory/prompts.d.ts.map +1 -0
- package/dist/memory/relevance.d.ts +4 -0
- package/dist/memory/relevance.d.ts.map +1 -0
- package/dist/memory/runtime.d.ts +40 -0
- package/dist/memory/runtime.d.ts.map +1 -0
- package/dist/memory/serialize.d.ts +26 -0
- package/dist/memory/serialize.d.ts.map +1 -0
- package/dist/memory/tokens.d.ts +8 -0
- package/dist/memory/tokens.d.ts.map +1 -0
- package/dist/memory/tools/read-project-observations.d.ts +8 -0
- package/dist/memory/tools/read-project-observations.d.ts.map +1 -0
- package/dist/memory/tools/recall-observation.d.ts +63 -0
- package/dist/memory/tools/recall-observation.d.ts.map +1 -0
- package/dist/memory/tools/write-project-observation.d.ts +9 -0
- package/dist/memory/tools/write-project-observation.d.ts.map +1 -0
- package/dist/memory/tools/write-project-observation.js +60 -0
- package/dist/memory/types.d.ts +65 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/preflight.d.ts +27 -0
- package/dist/preflight.d.ts.map +1 -0
- package/dist/preflight.js +3 -1
- package/dist/relay/auto-research.d.ts +64 -0
- package/dist/relay/auto-research.d.ts.map +1 -0
- package/dist/relay/auto-research.js +208 -69
- package/dist/relay/client.d.ts +126 -0
- package/dist/relay/client.d.ts.map +1 -0
- package/dist/relay/dispatcher.d.ts +207 -0
- package/dist/relay/dispatcher.d.ts.map +1 -0
- package/dist/relay/machine-store.d.ts +68 -0
- package/dist/relay/machine-store.d.ts.map +1 -0
- package/dist/relay/models-fetch.d.ts +75 -0
- package/dist/relay/models-fetch.d.ts.map +1 -0
- package/dist/relay/registration.d.ts +81 -0
- package/dist/relay/registration.d.ts.map +1 -0
- package/dist/sdk/agent-core/agent-loop.d.ts +24 -0
- package/dist/sdk/agent-core/agent-loop.d.ts.map +1 -0
- package/dist/sdk/agent-core/agent.d.ts +125 -0
- package/dist/sdk/agent-core/agent.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/agent-harness.d.ts +92 -0
- package/dist/sdk/agent-core/harness/agent-harness.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/compaction/branch-summarization.d.ts +53 -0
- package/dist/sdk/agent-core/harness/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/compaction/compaction.d.ts +95 -0
- package/dist/sdk/agent-core/harness/compaction/compaction.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/compaction/utils.d.ts +25 -0
- package/dist/sdk/agent-core/harness/compaction/utils.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/env/nodejs.d.ts +51 -0
- package/dist/sdk/agent-core/harness/env/nodejs.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/messages.d.ts +51 -0
- package/dist/sdk/agent-core/harness/messages.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/prompt-templates.d.ts +48 -0
- package/dist/sdk/agent-core/harness/prompt-templates.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/jsonl-repo.d.ts +26 -0
- package/dist/sdk/agent-core/harness/session/jsonl-repo.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/jsonl-storage.d.ts +33 -0
- package/dist/sdk/agent-core/harness/session/jsonl-storage.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/memory-repo.d.ts +18 -0
- package/dist/sdk/agent-core/harness/session/memory-repo.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/memory-storage.d.ts +25 -0
- package/dist/sdk/agent-core/harness/session/memory-storage.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/repo-utils.d.ts +11 -0
- package/dist/sdk/agent-core/harness/session/repo-utils.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/session.d.ts +32 -0
- package/dist/sdk/agent-core/harness/session/session.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/uuid.d.ts +2 -0
- package/dist/sdk/agent-core/harness/session/uuid.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/skills.d.ts +44 -0
- package/dist/sdk/agent-core/harness/skills.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/system-prompt.d.ts +3 -0
- package/dist/sdk/agent-core/harness/system-prompt.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/types.d.ts +601 -0
- package/dist/sdk/agent-core/harness/types.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/utils/shell-output.d.ts +14 -0
- package/dist/sdk/agent-core/harness/utils/shell-output.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/utils/truncate.d.ts +70 -0
- package/dist/sdk/agent-core/harness/utils/truncate.d.ts.map +1 -0
- package/dist/sdk/agent-core/index.d.ts +20 -0
- package/dist/sdk/agent-core/index.d.ts.map +1 -0
- package/dist/sdk/agent-core/node.d.ts +3 -0
- package/dist/sdk/agent-core/node.d.ts.map +1 -0
- package/dist/sdk/agent-core/proxy.d.ts +69 -0
- package/dist/sdk/agent-core/proxy.d.ts.map +1 -0
- package/dist/sdk/agent-core/types.d.ts +393 -0
- package/dist/sdk/agent-core/types.d.ts.map +1 -0
- package/dist/sdk/ai/api-registry.d.ts +20 -0
- package/dist/sdk/ai/api-registry.d.ts.map +1 -0
- package/dist/sdk/ai/cli.d.ts +3 -0
- package/dist/sdk/ai/cli.d.ts.map +1 -0
- package/dist/sdk/ai/env-api-keys.d.ts +18 -0
- package/dist/sdk/ai/env-api-keys.d.ts.map +1 -0
- package/dist/sdk/ai/env-api-keys.js +9 -49
- package/dist/sdk/ai/image-models.d.ts +10 -0
- package/dist/sdk/ai/image-models.d.ts.map +1 -0
- package/dist/sdk/ai/image-models.generated.d.ts +440 -0
- package/dist/sdk/ai/image-models.generated.d.ts.map +1 -0
- package/dist/sdk/ai/images-api-registry.d.ts +14 -0
- package/dist/sdk/ai/images-api-registry.d.ts.map +1 -0
- package/dist/sdk/ai/images.d.ts +4 -0
- package/dist/sdk/ai/images.d.ts.map +1 -0
- package/dist/sdk/ai/index.d.ts +21 -0
- package/dist/sdk/ai/index.d.ts.map +1 -0
- package/dist/sdk/ai/models.d.ts +18 -0
- package/dist/sdk/ai/models.d.ts.map +1 -0
- package/dist/sdk/ai/models.generated.d.ts +17349 -0
- package/dist/sdk/ai/models.generated.d.ts.map +1 -0
- package/dist/sdk/ai/oauth.d.ts +2 -0
- package/dist/sdk/ai/oauth.d.ts.map +1 -0
- package/dist/sdk/ai/providers/anthropic.d.ts +54 -0
- package/dist/sdk/ai/providers/anthropic.d.ts.map +1 -0
- package/dist/sdk/ai/providers/faux.d.ts +56 -0
- package/dist/sdk/ai/providers/faux.d.ts.map +1 -0
- package/dist/sdk/ai/providers/github-copilot-headers.d.ts +8 -0
- package/dist/sdk/ai/providers/github-copilot-headers.d.ts.map +1 -0
- package/dist/sdk/ai/providers/openai-completions.d.ts +19 -0
- package/dist/sdk/ai/providers/openai-completions.d.ts.map +1 -0
- package/dist/sdk/ai/providers/openai-prompt-cache.d.ts +3 -0
- package/dist/sdk/ai/providers/openai-prompt-cache.d.ts.map +1 -0
- package/dist/sdk/ai/providers/register-builtins.d.ts +15 -0
- package/dist/sdk/ai/providers/register-builtins.d.ts.map +1 -0
- package/dist/sdk/ai/providers/simple-options.d.ts +8 -0
- package/dist/sdk/ai/providers/simple-options.d.ts.map +1 -0
- package/dist/sdk/ai/providers/transform-messages.d.ts +8 -0
- package/dist/sdk/ai/providers/transform-messages.d.ts.map +1 -0
- package/dist/sdk/ai/session-resources.d.ts +4 -0
- package/dist/sdk/ai/session-resources.d.ts.map +1 -0
- package/dist/sdk/ai/stream.d.ts +8 -0
- package/dist/sdk/ai/stream.d.ts.map +1 -0
- package/dist/sdk/ai/types.d.ts +488 -0
- package/dist/sdk/ai/types.d.ts.map +1 -0
- package/dist/sdk/ai/utils/diagnostics.d.ts +19 -0
- package/dist/sdk/ai/utils/diagnostics.d.ts.map +1 -0
- package/dist/sdk/ai/utils/event-stream.d.ts +21 -0
- package/dist/sdk/ai/utils/event-stream.d.ts.map +1 -0
- package/dist/sdk/ai/utils/hash.d.ts +3 -0
- package/dist/sdk/ai/utils/hash.d.ts.map +1 -0
- package/dist/sdk/ai/utils/headers.d.ts +2 -0
- package/dist/sdk/ai/utils/headers.d.ts.map +1 -0
- package/dist/sdk/ai/utils/json-parse.d.ts +16 -0
- package/dist/sdk/ai/utils/json-parse.d.ts.map +1 -0
- package/dist/sdk/ai/utils/node-http-proxy.d.ts +10 -0
- package/dist/sdk/ai/utils/node-http-proxy.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/anthropic.d.ts +25 -0
- package/dist/sdk/ai/utils/oauth/anthropic.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/anthropic.js +1 -1
- package/dist/sdk/ai/utils/oauth/device-code.d.ts +19 -0
- package/dist/sdk/ai/utils/oauth/device-code.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/github-copilot.d.ts +30 -0
- package/dist/sdk/ai/utils/oauth/github-copilot.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/index.d.ts +58 -0
- package/dist/sdk/ai/utils/oauth/index.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/oauth-page.d.ts +3 -0
- package/dist/sdk/ai/utils/oauth/oauth-page.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/openai-codex.d.ts +34 -0
- package/dist/sdk/ai/utils/oauth/openai-codex.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/openai-codex.js +1 -1
- package/dist/sdk/ai/utils/oauth/pkce.d.ts +13 -0
- package/dist/sdk/ai/utils/oauth/pkce.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/types.d.ts +64 -0
- package/dist/sdk/ai/utils/oauth/types.d.ts.map +1 -0
- package/dist/sdk/ai/utils/overflow.d.ts +56 -0
- package/dist/sdk/ai/utils/overflow.d.ts.map +1 -0
- package/dist/sdk/ai/utils/sanitize-unicode.d.ts +22 -0
- package/dist/sdk/ai/utils/sanitize-unicode.d.ts.map +1 -0
- package/dist/sdk/ai/utils/typebox-helpers.d.ts +17 -0
- package/dist/sdk/ai/utils/typebox-helpers.d.ts.map +1 -0
- package/dist/sdk/ai/utils/validation.d.ts +18 -0
- package/dist/sdk/ai/utils/validation.d.ts.map +1 -0
- package/dist/sdk/coding-agent/cli.d.ts +3 -0
- package/dist/sdk/coding-agent/cli.d.ts.map +1 -0
- package/dist/sdk/coding-agent/config.d.ts +71 -0
- package/dist/sdk/coding-agent/config.d.ts.map +1 -0
- package/dist/sdk/coding-agent/config.js +2 -69
- package/dist/sdk/coding-agent/core/agent-session-runtime.d.ts +117 -0
- package/dist/sdk/coding-agent/core/agent-session-runtime.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/agent-session-services.d.ts +86 -0
- package/dist/sdk/coding-agent/core/agent-session-services.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/agent-session.d.ts +626 -0
- package/dist/sdk/coding-agent/core/agent-session.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/auth-guidance.d.ts +5 -0
- package/dist/sdk/coding-agent/core/auth-guidance.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/auth-storage.d.ts +145 -0
- package/dist/sdk/coding-agent/core/auth-storage.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/bash-executor.d.ts +32 -0
- package/dist/sdk/coding-agent/core/bash-executor.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/compaction/branch-summarization.d.ts +88 -0
- package/dist/sdk/coding-agent/core/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/compaction/compaction.d.ts +142 -0
- package/dist/sdk/coding-agent/core/compaction/compaction.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/compaction/index.d.ts +7 -0
- package/dist/sdk/coding-agent/core/compaction/index.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/compaction/utils.d.ts +38 -0
- package/dist/sdk/coding-agent/core/compaction/utils.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/defaults.d.ts +3 -0
- package/dist/sdk/coding-agent/core/defaults.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/diagnostics.d.ts +15 -0
- package/dist/sdk/coding-agent/core/diagnostics.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/event-bus.d.ts +9 -0
- package/dist/sdk/coding-agent/core/event-bus.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/exec.d.ts +29 -0
- package/dist/sdk/coding-agent/core/exec.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/extensions/index.d.ts +12 -0
- package/dist/sdk/coding-agent/core/extensions/index.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/extensions/loader.d.ts +24 -0
- package/dist/sdk/coding-agent/core/extensions/loader.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/extensions/loader.js +3 -35
- package/dist/sdk/coding-agent/core/extensions/runner.d.ts +161 -0
- package/dist/sdk/coding-agent/core/extensions/runner.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/extensions/runner.js +1 -2
- package/dist/sdk/coding-agent/core/extensions/types.d.ts +1181 -0
- package/dist/sdk/coding-agent/core/extensions/types.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/extensions/wrapper.d.ts +20 -0
- package/dist/sdk/coding-agent/core/extensions/wrapper.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/http-dispatcher.d.ts +21 -0
- package/dist/sdk/coding-agent/core/http-dispatcher.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/index.d.ts +12 -0
- package/dist/sdk/coding-agent/core/index.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/keybindings.d.ts +371 -0
- package/dist/sdk/coding-agent/core/keybindings.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/messages.d.ts +77 -0
- package/dist/sdk/coding-agent/core/messages.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/model-registry.d.ts +150 -0
- package/dist/sdk/coding-agent/core/model-registry.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/model-resolver-utils.d.ts +7 -0
- package/dist/sdk/coding-agent/core/model-resolver-utils.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/model-resolver-utils.js +8 -0
- package/dist/sdk/coding-agent/core/model-resolver.d.ts +110 -0
- package/dist/sdk/coding-agent/core/model-resolver.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/model-resolver.js +1 -1
- package/dist/sdk/coding-agent/core/output-guard.d.ts +6 -0
- package/dist/sdk/coding-agent/core/output-guard.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/package-manager.d.ts +204 -0
- package/dist/sdk/coding-agent/core/package-manager.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/prompt-templates.d.ts +52 -0
- package/dist/sdk/coding-agent/core/prompt-templates.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/provider-display-names.d.ts +2 -0
- package/dist/sdk/coding-agent/core/provider-display-names.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/resolve-config-value.d.ts +23 -0
- package/dist/sdk/coding-agent/core/resolve-config-value.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/resource-loader.d.ts +194 -0
- package/dist/sdk/coding-agent/core/resource-loader.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/resource-loader.js +1 -1
- package/dist/sdk/coding-agent/core/sdk.d.ts +107 -0
- package/dist/sdk/coding-agent/core/sdk.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/session-cwd.d.ts +19 -0
- package/dist/sdk/coding-agent/core/session-cwd.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/session-manager.d.ts +333 -0
- package/dist/sdk/coding-agent/core/session-manager.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/settings-manager.d.ts +209 -0
- package/dist/sdk/coding-agent/core/settings-manager.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/settings-manager.js +1 -170
- package/dist/sdk/coding-agent/core/skills.d.ts +60 -0
- package/dist/sdk/coding-agent/core/skills.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/slash-commands.d.ts +14 -0
- package/dist/sdk/coding-agent/core/slash-commands.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/source-info.d.ts +18 -0
- package/dist/sdk/coding-agent/core/source-info.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/system-prompt.d.ts +28 -0
- package/dist/sdk/coding-agent/core/system-prompt.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/system-prompt.js +3 -1
- package/dist/sdk/coding-agent/core/telemetry.d.ts +3 -0
- package/dist/sdk/coding-agent/core/telemetry.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/theme.d.ts +28 -0
- package/dist/sdk/coding-agent/core/theme.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/theme.js +202 -0
- package/dist/sdk/coding-agent/core/timings.d.ts +8 -0
- package/dist/sdk/coding-agent/core/timings.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/bash.d.ts +63 -0
- package/dist/sdk/coding-agent/core/tools/bash.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/bash.js +17 -18
- package/dist/sdk/coding-agent/core/tools/edit-diff.d.ts +87 -0
- package/dist/sdk/coding-agent/core/tools/edit-diff.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/edit.d.ts +39 -0
- package/dist/sdk/coding-agent/core/tools/edit.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/edit.js +7 -8
- package/dist/sdk/coding-agent/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/sdk/coding-agent/core/tools/file-mutation-queue.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/find.d.ts +35 -0
- package/dist/sdk/coding-agent/core/tools/find.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/find.js +9 -13
- package/dist/sdk/coding-agent/core/tools/grep.d.ts +37 -0
- package/dist/sdk/coding-agent/core/tools/grep.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/grep.js +10 -14
- package/dist/sdk/coding-agent/core/tools/index.d.ts +40 -0
- package/dist/sdk/coding-agent/core/tools/index.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/ls.d.ts +37 -0
- package/dist/sdk/coding-agent/core/tools/ls.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/ls.js +9 -10
- package/dist/sdk/coding-agent/core/tools/output-accumulator.d.ts +52 -0
- package/dist/sdk/coding-agent/core/tools/output-accumulator.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/path-utils.d.ts +8 -0
- package/dist/sdk/coding-agent/core/tools/path-utils.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/read.d.ts +35 -0
- package/dist/sdk/coding-agent/core/tools/read.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/read.js +33 -35
- package/dist/sdk/coding-agent/core/tools/render-diff.d.ts +17 -0
- package/dist/sdk/coding-agent/core/tools/render-diff.d.ts.map +1 -0
- package/dist/sdk/coding-agent/{modes/interactive/components/diff.js → core/tools/render-diff.js} +18 -31
- package/dist/sdk/coding-agent/core/tools/render-utils.d.ts +21 -0
- package/dist/sdk/coding-agent/core/tools/render-utils.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/tool-definition-wrapper.d.ts +14 -0
- package/dist/sdk/coding-agent/core/tools/tool-definition-wrapper.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/truncate.d.ts +70 -0
- package/dist/sdk/coding-agent/core/tools/truncate.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/write.d.ts +26 -0
- package/dist/sdk/coding-agent/core/tools/write.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/write.js +10 -11
- package/dist/sdk/coding-agent/index.d.ts +29 -0
- package/dist/sdk/coding-agent/index.d.ts.map +1 -0
- package/dist/sdk/coding-agent/index.js +7 -5
- package/dist/sdk/coding-agent/main.d.ts +2 -0
- package/dist/sdk/coding-agent/main.d.ts.map +1 -0
- package/dist/sdk/coding-agent/migrations.d.ts +33 -0
- package/dist/sdk/coding-agent/migrations.d.ts.map +1 -0
- package/dist/sdk/coding-agent/modes/index.d.ts +8 -0
- package/dist/sdk/coding-agent/modes/index.d.ts.map +1 -0
- package/dist/sdk/coding-agent/modes/index.js +0 -1
- package/dist/sdk/coding-agent/modes/print-mode.d.ts +28 -0
- package/dist/sdk/coding-agent/modes/print-mode.d.ts.map +1 -0
- package/dist/sdk/coding-agent/modes/rpc/jsonl.d.ts +17 -0
- package/dist/sdk/coding-agent/modes/rpc/jsonl.d.ts.map +1 -0
- package/dist/sdk/coding-agent/modes/rpc/rpc-client.d.ts +224 -0
- package/dist/sdk/coding-agent/modes/rpc/rpc-client.d.ts.map +1 -0
- package/dist/sdk/coding-agent/modes/rpc/rpc-mode.d.ts +20 -0
- package/dist/sdk/coding-agent/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/dist/sdk/coding-agent/modes/rpc/rpc-mode.js +2 -2
- package/dist/sdk/coding-agent/modes/rpc/rpc-types.d.ts +419 -0
- package/dist/sdk/coding-agent/modes/rpc/rpc-types.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/ansi.d.ts +2 -0
- package/dist/sdk/coding-agent/utils/ansi.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/changelog.d.ts +21 -0
- package/dist/sdk/coding-agent/utils/changelog.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/child-process.d.ts +15 -0
- package/dist/sdk/coding-agent/utils/child-process.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/clipboard-image.d.ts +11 -0
- package/dist/sdk/coding-agent/utils/clipboard-image.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/clipboard-native.d.ts +8 -0
- package/dist/sdk/coding-agent/utils/clipboard-native.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/clipboard.d.ts +2 -0
- package/dist/sdk/coding-agent/utils/clipboard.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/exif-orientation.d.ts +5 -0
- package/dist/sdk/coding-agent/utils/exif-orientation.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/frontmatter.d.ts +8 -0
- package/dist/sdk/coding-agent/utils/frontmatter.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/fs-watch.d.ts +5 -0
- package/dist/sdk/coding-agent/utils/fs-watch.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/git.d.ts +26 -0
- package/dist/sdk/coding-agent/utils/git.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/html.d.ts +7 -0
- package/dist/sdk/coding-agent/utils/html.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/image-convert.d.ts +9 -0
- package/dist/sdk/coding-agent/utils/image-convert.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/image-resize.d.ts +36 -0
- package/dist/sdk/coding-agent/utils/image-resize.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/mime.d.ts +3 -0
- package/dist/sdk/coding-agent/utils/mime.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/paths.d.ts +31 -0
- package/dist/sdk/coding-agent/utils/paths.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/photon.d.ts +13 -0
- package/dist/sdk/coding-agent/utils/photon.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/photon.js +2 -10
- package/dist/sdk/coding-agent/utils/pi-user-agent.d.ts +2 -0
- package/dist/sdk/coding-agent/utils/pi-user-agent.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/pi-user-agent.js +1 -2
- package/dist/sdk/coding-agent/utils/shell.d.ts +30 -0
- package/dist/sdk/coding-agent/utils/shell.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/sleep.d.ts +5 -0
- package/dist/sdk/coding-agent/utils/sleep.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/syntax-highlight.d.ts +12 -0
- package/dist/sdk/coding-agent/utils/syntax-highlight.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/tools-manager.d.ts +3 -0
- package/dist/sdk/coding-agent/utils/tools-manager.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/version-check.d.ts +15 -0
- package/dist/sdk/coding-agent/utils/version-check.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/windows-self-update.d.ts +3 -0
- package/dist/sdk/coding-agent/utils/windows-self-update.d.ts.map +1 -0
- package/dist/server/agent-bridge.d.ts +308 -0
- package/dist/server/agent-bridge.d.ts.map +1 -0
- package/dist/server/agent-bridge.js +2 -1
- package/dist/server/handlers/errors.d.ts +26 -0
- package/dist/server/handlers/errors.d.ts.map +1 -0
- package/dist/server/handlers/paths-autocomplete.d.ts +45 -0
- package/dist/server/handlers/paths-autocomplete.d.ts.map +1 -0
- package/dist/server/handlers/projects.d.ts +58 -0
- package/dist/server/handlers/projects.d.ts.map +1 -0
- package/dist/server/handlers/queue.d.ts +27 -0
- package/dist/server/handlers/queue.d.ts.map +1 -0
- package/dist/server/handlers/sessions.d.ts +50 -0
- package/dist/server/handlers/sessions.d.ts.map +1 -0
- package/dist/server/paths.d.ts +51 -0
- package/dist/server/paths.d.ts.map +1 -0
- package/dist/server/session-stream.d.ts +379 -0
- package/dist/server/session-stream.d.ts.map +1 -0
- package/dist/server/shutdown.d.ts +102 -0
- package/dist/server/shutdown.d.ts.map +1 -0
- package/dist/server/storage.d.ts +287 -0
- package/dist/server/storage.d.ts.map +1 -0
- package/dist/server/title-generator.d.ts +25 -0
- package/dist/server/title-generator.d.ts.map +1 -0
- package/dist/server/wire.d.ts +448 -0
- package/dist/server/wire.d.ts.map +1 -0
- package/dist/studio-binding.d.ts +44 -0
- package/dist/studio-binding.d.ts.map +1 -0
- package/dist/studio-binding.js +1 -1
- package/package.json +11 -1
- package/dist/sdk/coding-agent/bun/cli.js +0 -7
- package/dist/sdk/coding-agent/bun/restore-sandbox-env.js +0 -31
- package/dist/sdk/coding-agent/cli/args.js +0 -340
- package/dist/sdk/coding-agent/cli/file-processor.js +0 -82
- package/dist/sdk/coding-agent/cli/initial-message.js +0 -21
- package/dist/sdk/coding-agent/core/footer-data-provider.js +0 -309
- package/dist/sdk/coding-agent/modes/interactive/components/keybinding-hints.js +0 -35
- package/dist/sdk/coding-agent/modes/interactive/components/visual-truncate.js +0 -26
- package/dist/sdk/coding-agent/modes/interactive/interactive-mode.js +0 -3
- package/dist/sdk/coding-agent/modes/interactive/theme/theme.js +0 -1022
|
@@ -193,9 +193,7 @@ export class SettingsManager {
|
|
|
193
193
|
settings.skills !== null &&
|
|
194
194
|
!Array.isArray(settings.skills)) {
|
|
195
195
|
const skillsSettings = settings.skills;
|
|
196
|
-
|
|
197
|
-
settings.enableSkillCommands = skillsSettings.enableSkillCommands;
|
|
198
|
-
}
|
|
196
|
+
// enableSkillCommands is deprecated — only migrate the custom directories
|
|
199
197
|
if (Array.isArray(skillsSettings.customDirectories) && skillsSettings.customDirectories.length > 0) {
|
|
200
198
|
settings.skills = skillsSettings.customDirectories;
|
|
201
199
|
}
|
|
@@ -367,14 +365,6 @@ export class SettingsManager {
|
|
|
367
365
|
this.errors = [];
|
|
368
366
|
return drained;
|
|
369
367
|
}
|
|
370
|
-
getLastChangelogVersion() {
|
|
371
|
-
return this.settings.lastChangelogVersion;
|
|
372
|
-
}
|
|
373
|
-
setLastChangelogVersion(version) {
|
|
374
|
-
this.globalSettings.lastChangelogVersion = version;
|
|
375
|
-
this.markModified("lastChangelogVersion");
|
|
376
|
-
this.save();
|
|
377
|
-
}
|
|
378
368
|
getSessionDir() {
|
|
379
369
|
const sessionDir = this.settings.sessionDir;
|
|
380
370
|
return sessionDir ? normalizePath(sessionDir) : sessionDir;
|
|
@@ -438,14 +428,6 @@ export class SettingsManager {
|
|
|
438
428
|
this.markModified("followUpMode");
|
|
439
429
|
this.save();
|
|
440
430
|
}
|
|
441
|
-
getTheme() {
|
|
442
|
-
return this.settings.theme;
|
|
443
|
-
}
|
|
444
|
-
setTheme(theme) {
|
|
445
|
-
this.globalSettings.theme = theme;
|
|
446
|
-
this.markModified("theme");
|
|
447
|
-
this.save();
|
|
448
|
-
}
|
|
449
431
|
getDefaultThinkingLevel() {
|
|
450
432
|
return this.settings.defaultThinkingLevel;
|
|
451
433
|
}
|
|
@@ -539,14 +521,6 @@ export class SettingsManager {
|
|
|
539
521
|
maxRetryDelayMs: this.settings.retry?.provider?.maxRetryDelayMs ?? 60000,
|
|
540
522
|
};
|
|
541
523
|
}
|
|
542
|
-
getHideThinkingBlock() {
|
|
543
|
-
return this.settings.hideThinkingBlock ?? false;
|
|
544
|
-
}
|
|
545
|
-
setHideThinkingBlock(hide) {
|
|
546
|
-
this.globalSettings.hideThinkingBlock = hide;
|
|
547
|
-
this.markModified("hideThinkingBlock");
|
|
548
|
-
this.save();
|
|
549
|
-
}
|
|
550
524
|
getShellPath() {
|
|
551
525
|
return this.settings.shellPath;
|
|
552
526
|
}
|
|
@@ -555,14 +529,6 @@ export class SettingsManager {
|
|
|
555
529
|
this.markModified("shellPath");
|
|
556
530
|
this.save();
|
|
557
531
|
}
|
|
558
|
-
getQuietStartup() {
|
|
559
|
-
return this.settings.quietStartup ?? false;
|
|
560
|
-
}
|
|
561
|
-
setQuietStartup(quiet) {
|
|
562
|
-
this.globalSettings.quietStartup = quiet;
|
|
563
|
-
this.markModified("quietStartup");
|
|
564
|
-
this.save();
|
|
565
|
-
}
|
|
566
532
|
getShellCommandPrefix() {
|
|
567
533
|
return this.settings.shellCommandPrefix;
|
|
568
534
|
}
|
|
@@ -579,14 +545,6 @@ export class SettingsManager {
|
|
|
579
545
|
this.markModified("npmCommand");
|
|
580
546
|
this.save();
|
|
581
547
|
}
|
|
582
|
-
getCollapseChangelog() {
|
|
583
|
-
return this.settings.collapseChangelog ?? false;
|
|
584
|
-
}
|
|
585
|
-
setCollapseChangelog(collapse) {
|
|
586
|
-
this.globalSettings.collapseChangelog = collapse;
|
|
587
|
-
this.markModified("collapseChangelog");
|
|
588
|
-
this.save();
|
|
589
|
-
}
|
|
590
548
|
getEnableInstallTelemetry() {
|
|
591
549
|
return this.settings.enableInstallTelemetry ?? true;
|
|
592
550
|
}
|
|
@@ -651,83 +609,9 @@ export class SettingsManager {
|
|
|
651
609
|
this.markProjectModified("prompts");
|
|
652
610
|
this.saveProjectSettings(projectSettings);
|
|
653
611
|
}
|
|
654
|
-
getThemePaths() {
|
|
655
|
-
return [...(this.settings.themes ?? [])];
|
|
656
|
-
}
|
|
657
|
-
setThemePaths(paths) {
|
|
658
|
-
this.globalSettings.themes = paths;
|
|
659
|
-
this.markModified("themes");
|
|
660
|
-
this.save();
|
|
661
|
-
}
|
|
662
|
-
setProjectThemePaths(paths) {
|
|
663
|
-
const projectSettings = structuredClone(this.projectSettings);
|
|
664
|
-
projectSettings.themes = paths;
|
|
665
|
-
this.markProjectModified("themes");
|
|
666
|
-
this.saveProjectSettings(projectSettings);
|
|
667
|
-
}
|
|
668
|
-
getEnableSkillCommands() {
|
|
669
|
-
return this.settings.enableSkillCommands ?? true;
|
|
670
|
-
}
|
|
671
|
-
setEnableSkillCommands(enabled) {
|
|
672
|
-
this.globalSettings.enableSkillCommands = enabled;
|
|
673
|
-
this.markModified("enableSkillCommands");
|
|
674
|
-
this.save();
|
|
675
|
-
}
|
|
676
612
|
getThinkingBudgets() {
|
|
677
613
|
return this.settings.thinkingBudgets;
|
|
678
614
|
}
|
|
679
|
-
getShowImages() {
|
|
680
|
-
return this.settings.terminal?.showImages ?? true;
|
|
681
|
-
}
|
|
682
|
-
setShowImages(show) {
|
|
683
|
-
if (!this.globalSettings.terminal) {
|
|
684
|
-
this.globalSettings.terminal = {};
|
|
685
|
-
}
|
|
686
|
-
this.globalSettings.terminal.showImages = show;
|
|
687
|
-
this.markModified("terminal", "showImages");
|
|
688
|
-
this.save();
|
|
689
|
-
}
|
|
690
|
-
getImageWidthCells() {
|
|
691
|
-
const width = this.settings.terminal?.imageWidthCells;
|
|
692
|
-
if (typeof width !== "number" || !Number.isFinite(width)) {
|
|
693
|
-
return 60;
|
|
694
|
-
}
|
|
695
|
-
return Math.max(1, Math.floor(width));
|
|
696
|
-
}
|
|
697
|
-
setImageWidthCells(width) {
|
|
698
|
-
if (!this.globalSettings.terminal) {
|
|
699
|
-
this.globalSettings.terminal = {};
|
|
700
|
-
}
|
|
701
|
-
this.globalSettings.terminal.imageWidthCells = Math.max(1, Math.floor(width));
|
|
702
|
-
this.markModified("terminal", "imageWidthCells");
|
|
703
|
-
this.save();
|
|
704
|
-
}
|
|
705
|
-
getClearOnShrink() {
|
|
706
|
-
// Settings takes precedence, then env var, then default false
|
|
707
|
-
if (this.settings.terminal?.clearOnShrink !== undefined) {
|
|
708
|
-
return this.settings.terminal.clearOnShrink;
|
|
709
|
-
}
|
|
710
|
-
return process.env.PI_CLEAR_ON_SHRINK === "1";
|
|
711
|
-
}
|
|
712
|
-
setClearOnShrink(enabled) {
|
|
713
|
-
if (!this.globalSettings.terminal) {
|
|
714
|
-
this.globalSettings.terminal = {};
|
|
715
|
-
}
|
|
716
|
-
this.globalSettings.terminal.clearOnShrink = enabled;
|
|
717
|
-
this.markModified("terminal", "clearOnShrink");
|
|
718
|
-
this.save();
|
|
719
|
-
}
|
|
720
|
-
getShowTerminalProgress() {
|
|
721
|
-
return this.settings.terminal?.showTerminalProgress ?? false;
|
|
722
|
-
}
|
|
723
|
-
setShowTerminalProgress(enabled) {
|
|
724
|
-
if (!this.globalSettings.terminal) {
|
|
725
|
-
this.globalSettings.terminal = {};
|
|
726
|
-
}
|
|
727
|
-
this.globalSettings.terminal.showTerminalProgress = enabled;
|
|
728
|
-
this.markModified("terminal", "showTerminalProgress");
|
|
729
|
-
this.save();
|
|
730
|
-
}
|
|
731
615
|
getImageAutoResize() {
|
|
732
616
|
return this.settings.images?.autoResize ?? true;
|
|
733
617
|
}
|
|
@@ -758,57 +642,4 @@ export class SettingsManager {
|
|
|
758
642
|
this.markModified("enabledModels");
|
|
759
643
|
this.save();
|
|
760
644
|
}
|
|
761
|
-
getDoubleEscapeAction() {
|
|
762
|
-
return this.settings.doubleEscapeAction ?? "tree";
|
|
763
|
-
}
|
|
764
|
-
setDoubleEscapeAction(action) {
|
|
765
|
-
this.globalSettings.doubleEscapeAction = action;
|
|
766
|
-
this.markModified("doubleEscapeAction");
|
|
767
|
-
this.save();
|
|
768
|
-
}
|
|
769
|
-
getTreeFilterMode() {
|
|
770
|
-
const mode = this.settings.treeFilterMode;
|
|
771
|
-
const valid = ["default", "no-tools", "user-only", "labeled-only", "all"];
|
|
772
|
-
return mode && valid.includes(mode) ? mode : "default";
|
|
773
|
-
}
|
|
774
|
-
setTreeFilterMode(mode) {
|
|
775
|
-
this.globalSettings.treeFilterMode = mode;
|
|
776
|
-
this.markModified("treeFilterMode");
|
|
777
|
-
this.save();
|
|
778
|
-
}
|
|
779
|
-
getShowHardwareCursor() {
|
|
780
|
-
return this.settings.showHardwareCursor ?? process.env.PI_HARDWARE_CURSOR === "1";
|
|
781
|
-
}
|
|
782
|
-
setShowHardwareCursor(enabled) {
|
|
783
|
-
this.globalSettings.showHardwareCursor = enabled;
|
|
784
|
-
this.markModified("showHardwareCursor");
|
|
785
|
-
this.save();
|
|
786
|
-
}
|
|
787
|
-
getEditorPaddingX() {
|
|
788
|
-
return this.settings.editorPaddingX ?? 0;
|
|
789
|
-
}
|
|
790
|
-
setEditorPaddingX(padding) {
|
|
791
|
-
this.globalSettings.editorPaddingX = Math.max(0, Math.min(3, Math.floor(padding)));
|
|
792
|
-
this.markModified("editorPaddingX");
|
|
793
|
-
this.save();
|
|
794
|
-
}
|
|
795
|
-
getAutocompleteMaxVisible() {
|
|
796
|
-
return this.settings.autocompleteMaxVisible ?? 5;
|
|
797
|
-
}
|
|
798
|
-
setAutocompleteMaxVisible(maxVisible) {
|
|
799
|
-
this.globalSettings.autocompleteMaxVisible = Math.max(3, Math.min(20, Math.floor(maxVisible)));
|
|
800
|
-
this.markModified("autocompleteMaxVisible");
|
|
801
|
-
this.save();
|
|
802
|
-
}
|
|
803
|
-
getCodeBlockIndent() {
|
|
804
|
-
return this.settings.markdown?.codeBlockIndent ?? " ";
|
|
805
|
-
}
|
|
806
|
-
getWarnings() {
|
|
807
|
-
return { ...(this.settings.warnings ?? {}) };
|
|
808
|
-
}
|
|
809
|
-
setWarnings(warnings) {
|
|
810
|
-
this.globalSettings.warnings = { ...warnings };
|
|
811
|
-
this.markModified("warnings");
|
|
812
|
-
this.save();
|
|
813
|
-
}
|
|
814
645
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ResourceDiagnostic } from "./diagnostics.js";
|
|
2
|
+
import { type SourceInfo } from "./source-info.js";
|
|
3
|
+
export interface SkillFrontmatter {
|
|
4
|
+
name?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
"disable-model-invocation"?: boolean;
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
export interface Skill {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
filePath: string;
|
|
13
|
+
baseDir: string;
|
|
14
|
+
sourceInfo: SourceInfo;
|
|
15
|
+
disableModelInvocation: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface LoadSkillsResult {
|
|
18
|
+
skills: Skill[];
|
|
19
|
+
diagnostics: ResourceDiagnostic[];
|
|
20
|
+
}
|
|
21
|
+
export interface LoadSkillsFromDirOptions {
|
|
22
|
+
/** Directory to scan for skills */
|
|
23
|
+
dir: string;
|
|
24
|
+
/** Source identifier for these skills */
|
|
25
|
+
source: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Load skills from a directory.
|
|
29
|
+
*
|
|
30
|
+
* Discovery rules:
|
|
31
|
+
* - if a directory contains SKILL.md, treat it as a skill root and do not recurse further
|
|
32
|
+
* - otherwise, load direct .md children in the root
|
|
33
|
+
* - recurse into subdirectories to find SKILL.md
|
|
34
|
+
*/
|
|
35
|
+
export declare function loadSkillsFromDir(options: LoadSkillsFromDirOptions): LoadSkillsResult;
|
|
36
|
+
/**
|
|
37
|
+
* Format skills for inclusion in a system prompt.
|
|
38
|
+
* Uses XML format per Agent Skills standard.
|
|
39
|
+
* See: https://agentskills.io/integrate-skills
|
|
40
|
+
*
|
|
41
|
+
* Skills with disableModelInvocation=true are excluded from the prompt
|
|
42
|
+
* (they can only be invoked explicitly via /skill:name commands).
|
|
43
|
+
*/
|
|
44
|
+
export declare function formatSkillsForPrompt(skills: Skill[]): string;
|
|
45
|
+
export interface LoadSkillsOptions {
|
|
46
|
+
/** Working directory for project-local skills. */
|
|
47
|
+
cwd: string;
|
|
48
|
+
/** Agent config directory for global skills. */
|
|
49
|
+
agentDir: string;
|
|
50
|
+
/** Explicit skill paths (files or directories) */
|
|
51
|
+
skillPaths: string[];
|
|
52
|
+
/** Include default skills directories. */
|
|
53
|
+
includeDefaults: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Load skills from all configured locations.
|
|
57
|
+
* Returns skills and any validation diagnostics.
|
|
58
|
+
*/
|
|
59
|
+
export declare function loadSkills(options: LoadSkillsOptions): LoadSkillsResult;
|
|
60
|
+
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../../../src/sdk/coding-agent/core/skills.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAA6B,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AA2D9E,MAAM,WAAW,gBAAgB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,KAAK;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;IACvB,sBAAsB,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAChC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,WAAW,EAAE,kBAAkB,EAAE,CAAC;CAClC;AA2CD,MAAM,WAAW,wBAAwB;IACxC,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;CACf;AA0BD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,gBAAgB,CAGrF;AA4JD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CA0B7D;AAWD,MAAM,WAAW,iBAAiB;IACjC,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAC;IACZ,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,0CAA0C;IAC1C,eAAe,EAAE,OAAO,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CAoGvE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SourceInfo } from "./source-info.js";
|
|
2
|
+
export type SlashCommandSource = "extension" | "prompt" | "skill";
|
|
3
|
+
export interface SlashCommandInfo {
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
source: SlashCommandSource;
|
|
7
|
+
sourceInfo: SourceInfo;
|
|
8
|
+
}
|
|
9
|
+
export interface BuiltinSlashCommand {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand>;
|
|
14
|
+
//# sourceMappingURL=slash-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../../../../src/sdk/coding-agent/core/slash-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,mBAAmB,CAsBrE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PathMetadata } from "./package-manager.js";
|
|
2
|
+
export type SourceScope = "user" | "project" | "temporary";
|
|
3
|
+
export type SourceOrigin = "package" | "top-level";
|
|
4
|
+
export interface SourceInfo {
|
|
5
|
+
path: string;
|
|
6
|
+
source: string;
|
|
7
|
+
scope: SourceScope;
|
|
8
|
+
origin: SourceOrigin;
|
|
9
|
+
baseDir?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function createSourceInfo(path: string, metadata: PathMetadata): SourceInfo;
|
|
12
|
+
export declare function createSyntheticSourceInfo(path: string, options: {
|
|
13
|
+
source: string;
|
|
14
|
+
scope?: SourceScope;
|
|
15
|
+
origin?: SourceOrigin;
|
|
16
|
+
baseDir?: string;
|
|
17
|
+
}): SourceInfo;
|
|
18
|
+
//# sourceMappingURL=source-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-info.d.ts","sourceRoot":"","sources":["../../../../src/sdk/coding-agent/core/source-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC;AAC3D,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,WAAW,CAAC;AAEnD,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,GAAG,UAAU,CAQjF;AAED,wBAAgB,yBAAyB,CACxC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;IACR,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,GACC,UAAU,CAQZ"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* System prompt construction and project context loading
|
|
3
|
+
*/
|
|
4
|
+
import { type Skill } from "./skills.js";
|
|
5
|
+
export interface BuildSystemPromptOptions {
|
|
6
|
+
/** Custom system prompt (replaces default). */
|
|
7
|
+
customPrompt?: string;
|
|
8
|
+
/** Tools to include in prompt. Default: [read, bash, edit, write] */
|
|
9
|
+
selectedTools?: string[];
|
|
10
|
+
/** Optional one-line tool snippets keyed by tool name. */
|
|
11
|
+
toolSnippets?: Record<string, string>;
|
|
12
|
+
/** Additional guideline bullets appended to the default system prompt guidelines. */
|
|
13
|
+
promptGuidelines?: string[];
|
|
14
|
+
/** Text to append to system prompt. */
|
|
15
|
+
appendSystemPrompt?: string;
|
|
16
|
+
/** Working directory. */
|
|
17
|
+
cwd: string;
|
|
18
|
+
/** Pre-loaded context files. */
|
|
19
|
+
contextFiles?: Array<{
|
|
20
|
+
path: string;
|
|
21
|
+
content: string;
|
|
22
|
+
}>;
|
|
23
|
+
/** Pre-loaded skills. */
|
|
24
|
+
skills?: Skill[];
|
|
25
|
+
}
|
|
26
|
+
/** Build the system prompt with tools, guidelines, and context */
|
|
27
|
+
export declare function buildSystemPrompt(options: BuildSystemPromptOptions): string;
|
|
28
|
+
//# sourceMappingURL=system-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../../../src/sdk/coding-agent/core/system-prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAyB,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,wBAAwB;IACxC,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,qFAAqF;IACrF,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,uCAAuC;IACvC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yBAAyB;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,gCAAgC;IAChC,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxD,yBAAyB;IACzB,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;CACjB;AAED,kEAAkE;AAClE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,MAAM,CAqJ3E"}
|
|
@@ -78,10 +78,12 @@ export function buildSystemPrompt(options) {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
// Always include these
|
|
81
|
+
addGuideline("Never assign coding or implementation work to people — you write the code. Non-coding tasks (review, design, ops, coordination) can be assigned");
|
|
82
|
+
addGuideline("When estimating effort, frame it as a feature scope (e.g. 'this is a ~20-hour coding enhancement') rather than using traditional time measures. Tie every estimate to a clearly defined feature boundary");
|
|
81
83
|
addGuideline("Be concise in your responses");
|
|
82
84
|
addGuideline("Show file paths clearly when working with files");
|
|
83
85
|
const guidelines = guidelinesList.map((g) => `- ${g}`).join("\n");
|
|
84
|
-
let prompt = `You are an expert coding
|
|
86
|
+
let prompt = `You are an expert coding agent operating inside pi, a coding agent harness. You read files, execute commands, edit code, and write new files. All coding and implementation work is yours — never delegate it. Non-coding tasks (review, design decisions, ops) may be assigned to people. When discussing effort, frame each enhancement around a ~20-hour coding scope tied to a concrete feature boundary, avoiding calendar-day or week-based estimates.
|
|
85
87
|
|
|
86
88
|
Available tools:
|
|
87
89
|
${toolsList}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../../../src/sdk/coding-agent/core/telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAO7D,wBAAgB,yBAAyB,CACxC,eAAe,EAAE,eAAe,EAChC,YAAY,GAAE,MAAM,GAAG,SAA0C,GAC/D,OAAO,CAET"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal shared theme for syntax highlighting and extension API compatibility.
|
|
3
|
+
*
|
|
4
|
+
* This replaces the interactive/mode TUI theme system with a stripped-down
|
|
5
|
+
* version that supports the core utilities used by the serve/relay path:
|
|
6
|
+
* - getLanguageFromPath(): maps file extensions to highlight.js language IDs
|
|
7
|
+
* - highlightCode(): syntax-highlights code blocks
|
|
8
|
+
* - loadThemeFromPath(): loads a theme JSON file from disk
|
|
9
|
+
* - Theme class: used by resource-loader and extension types
|
|
10
|
+
*
|
|
11
|
+
* All ANSI color formatting (theme.fg(), theme.bold(), etc.) is removed —
|
|
12
|
+
* tool output is plain text for LLM consumption in serve/relay mode.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getLanguageFromPath(filePath: string): string | undefined;
|
|
15
|
+
export interface Theme {
|
|
16
|
+
readonly name?: string;
|
|
17
|
+
readonly sourcePath?: string;
|
|
18
|
+
sourceInfo?: import("./source-info.js").SourceInfo;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Highlight code with syntax coloring based on file extension or language.
|
|
22
|
+
* In serve mode, returns plain text (no ANSI coloring for LLM consumption).
|
|
23
|
+
*/
|
|
24
|
+
export declare function highlightCode(code: string, lang?: string): string[];
|
|
25
|
+
export declare function loadThemeFromPath(themePath: string): Theme;
|
|
26
|
+
export declare function setRegisteredThemes(themes: Theme[]): void;
|
|
27
|
+
export declare function getAvailableThemes(): string[];
|
|
28
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/sdk/coding-agent/core/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAsEH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIxE;AAMD,MAAM,WAAW,KAAK;IACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,kBAAkB,EAAE,UAAU,CAAC;CACnD;AA+BD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAcnE;AAgDD,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK,CAO1D;AAQD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAOzD;AAED,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAO7C"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal shared theme for syntax highlighting and extension API compatibility.
|
|
3
|
+
*
|
|
4
|
+
* This replaces the interactive/mode TUI theme system with a stripped-down
|
|
5
|
+
* version that supports the core utilities used by the serve/relay path:
|
|
6
|
+
* - getLanguageFromPath(): maps file extensions to highlight.js language IDs
|
|
7
|
+
* - highlightCode(): syntax-highlights code blocks
|
|
8
|
+
* - loadThemeFromPath(): loads a theme JSON file from disk
|
|
9
|
+
* - Theme class: used by resource-loader and extension types
|
|
10
|
+
*
|
|
11
|
+
* All ANSI color formatting (theme.fg(), theme.bold(), etc.) is removed —
|
|
12
|
+
* tool output is plain text for LLM consumption in serve/relay mode.
|
|
13
|
+
*/
|
|
14
|
+
import * as fs from "node:fs";
|
|
15
|
+
import { highlight, supportsLanguage } from "../utils/syntax-highlight.js";
|
|
16
|
+
// ============================================================================
|
|
17
|
+
// Language detection
|
|
18
|
+
// ============================================================================
|
|
19
|
+
const extToLang = {
|
|
20
|
+
ts: "typescript",
|
|
21
|
+
tsx: "typescript",
|
|
22
|
+
js: "javascript",
|
|
23
|
+
jsx: "javascript",
|
|
24
|
+
mjs: "javascript",
|
|
25
|
+
cjs: "javascript",
|
|
26
|
+
py: "python",
|
|
27
|
+
rb: "ruby",
|
|
28
|
+
rs: "rust",
|
|
29
|
+
go: "go",
|
|
30
|
+
java: "java",
|
|
31
|
+
kt: "kotlin",
|
|
32
|
+
swift: "swift",
|
|
33
|
+
c: "c",
|
|
34
|
+
h: "c",
|
|
35
|
+
cpp: "cpp",
|
|
36
|
+
cc: "cpp",
|
|
37
|
+
cxx: "cpp",
|
|
38
|
+
hpp: "cpp",
|
|
39
|
+
cs: "csharp",
|
|
40
|
+
php: "php",
|
|
41
|
+
sh: "bash",
|
|
42
|
+
bash: "bash",
|
|
43
|
+
zsh: "bash",
|
|
44
|
+
fish: "fish",
|
|
45
|
+
ps1: "powershell",
|
|
46
|
+
sql: "sql",
|
|
47
|
+
html: "html",
|
|
48
|
+
htm: "html",
|
|
49
|
+
css: "css",
|
|
50
|
+
scss: "scss",
|
|
51
|
+
sass: "sass",
|
|
52
|
+
less: "less",
|
|
53
|
+
json: "json",
|
|
54
|
+
yaml: "yaml",
|
|
55
|
+
yml: "yaml",
|
|
56
|
+
toml: "toml",
|
|
57
|
+
xml: "xml",
|
|
58
|
+
md: "markdown",
|
|
59
|
+
markdown: "markdown",
|
|
60
|
+
dockerfile: "dockerfile",
|
|
61
|
+
makefile: "makefile",
|
|
62
|
+
cmake: "cmake",
|
|
63
|
+
lua: "lua",
|
|
64
|
+
perl: "perl",
|
|
65
|
+
r: "r",
|
|
66
|
+
scala: "scala",
|
|
67
|
+
clj: "clojure",
|
|
68
|
+
ex: "elixir",
|
|
69
|
+
exs: "elixir",
|
|
70
|
+
erl: "erlang",
|
|
71
|
+
hs: "haskell",
|
|
72
|
+
ml: "ocaml",
|
|
73
|
+
vim: "vim",
|
|
74
|
+
graphql: "graphql",
|
|
75
|
+
proto: "protobuf",
|
|
76
|
+
tf: "hcl",
|
|
77
|
+
hcl: "hcl",
|
|
78
|
+
};
|
|
79
|
+
export function getLanguageFromPath(filePath) {
|
|
80
|
+
const ext = filePath.split(".").pop()?.toLowerCase();
|
|
81
|
+
if (!ext)
|
|
82
|
+
return undefined;
|
|
83
|
+
return extToLang[ext];
|
|
84
|
+
}
|
|
85
|
+
// ============================================================================
|
|
86
|
+
// Syntax highlighting
|
|
87
|
+
// ============================================================================
|
|
88
|
+
/** Identity formatter — returns text as-is (no ANSI styling in serve mode). */
|
|
89
|
+
function identity(text) {
|
|
90
|
+
return text;
|
|
91
|
+
}
|
|
92
|
+
const neutralHighlightTheme = {
|
|
93
|
+
keyword: identity,
|
|
94
|
+
built_in: identity,
|
|
95
|
+
literal: identity,
|
|
96
|
+
number: identity,
|
|
97
|
+
string: identity,
|
|
98
|
+
comment: identity,
|
|
99
|
+
function: identity,
|
|
100
|
+
title: identity,
|
|
101
|
+
class: identity,
|
|
102
|
+
type: identity,
|
|
103
|
+
attr: identity,
|
|
104
|
+
variable: identity,
|
|
105
|
+
params: identity,
|
|
106
|
+
operator: identity,
|
|
107
|
+
punctuation: identity,
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Highlight code with syntax coloring based on file extension or language.
|
|
111
|
+
* In serve mode, returns plain text (no ANSI coloring for LLM consumption).
|
|
112
|
+
*/
|
|
113
|
+
export function highlightCode(code, lang) {
|
|
114
|
+
const validLang = lang && supportsLanguage(lang) ? lang : undefined;
|
|
115
|
+
if (!validLang) {
|
|
116
|
+
return code.split("\n");
|
|
117
|
+
}
|
|
118
|
+
try {
|
|
119
|
+
return highlight(code, {
|
|
120
|
+
language: validLang,
|
|
121
|
+
ignoreIllegals: true,
|
|
122
|
+
theme: neutralHighlightTheme,
|
|
123
|
+
}).split("\n");
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
return code.split("\n");
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// ============================================================================
|
|
130
|
+
// Theme loading (for resource-loader)
|
|
131
|
+
// ============================================================================
|
|
132
|
+
/** Resolve built-in theme directory using config path helpers. */
|
|
133
|
+
function getThemesDir() {
|
|
134
|
+
try {
|
|
135
|
+
// This function is exported from config.ts and uses the actual package directory
|
|
136
|
+
const { getThemesDir: fn } = require("../../config.js");
|
|
137
|
+
return fn();
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
// Fallback: themes were in modes/interactive/theme/, try to find them
|
|
141
|
+
try {
|
|
142
|
+
const { join } = require("node:path");
|
|
143
|
+
const { existsSync } = require("node:fs");
|
|
144
|
+
const packageDir = join(__dirname, "../../..");
|
|
145
|
+
for (const base of ["src", "dist"]) {
|
|
146
|
+
const candidates = [
|
|
147
|
+
join(packageDir, base, "modes", "interactive", "theme"),
|
|
148
|
+
];
|
|
149
|
+
for (const dir of candidates) {
|
|
150
|
+
if (existsSync(dir))
|
|
151
|
+
return dir;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
// ignore
|
|
157
|
+
}
|
|
158
|
+
return __dirname;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
function getBuiltinThemes() {
|
|
162
|
+
const themesDir = getThemesDir();
|
|
163
|
+
if (!themesDir)
|
|
164
|
+
return {};
|
|
165
|
+
try {
|
|
166
|
+
const { join } = require("node:path");
|
|
167
|
+
const { readFileSync } = require("node:fs");
|
|
168
|
+
return {
|
|
169
|
+
dark: JSON.parse(readFileSync(join(themesDir, "dark.json"), "utf-8")),
|
|
170
|
+
light: JSON.parse(readFileSync(join(themesDir, "light.json"), "utf-8")),
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
return {};
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
export function loadThemeFromPath(themePath) {
|
|
178
|
+
const content = fs.readFileSync(themePath, "utf-8");
|
|
179
|
+
const json = JSON.parse(content);
|
|
180
|
+
return {
|
|
181
|
+
name: json.name,
|
|
182
|
+
sourcePath: themePath,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
// ============================================================================
|
|
186
|
+
// Registered themes (for extension API compatibility)
|
|
187
|
+
// ============================================================================
|
|
188
|
+
const registeredThemes = new Map();
|
|
189
|
+
export function setRegisteredThemes(themes) {
|
|
190
|
+
registeredThemes.clear();
|
|
191
|
+
for (const t of themes) {
|
|
192
|
+
if (t.name) {
|
|
193
|
+
registeredThemes.set(t.name, t);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
export function getAvailableThemes() {
|
|
198
|
+
return Array.from(new Set([
|
|
199
|
+
...Object.keys(getBuiltinThemes()),
|
|
200
|
+
...registeredThemes.keys(),
|
|
201
|
+
])).sort();
|
|
202
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Central timing instrumentation for startup profiling.
|
|
3
|
+
* Enable with PI_TIMING=1 environment variable.
|
|
4
|
+
*/
|
|
5
|
+
export declare function resetTimings(): void;
|
|
6
|
+
export declare function time(label: string): void;
|
|
7
|
+
export declare function printTimings(): void;
|
|
8
|
+
//# sourceMappingURL=timings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timings.d.ts","sourceRoot":"","sources":["../../../../src/sdk/coding-agent/core/timings.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,wBAAgB,YAAY,IAAI,IAAI,CAInC;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAKxC;AAED,wBAAgB,YAAY,IAAI,IAAI,CAQnC"}
|