@subimpact/e 0.99.12 → 0.100.1
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 +37 -0
- package/README.md +7 -1
- package/dist/bundle/chunks/anthropic-messages-BGDBSRR2.js +6 -0
- package/dist/bundle/chunks/azure-openai-responses-ZCNWFVTX.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +3 -3
- package/dist/bundle/chunks/chunk-35AZPBGE.js +11 -0
- package/dist/bundle/chunks/{chunk-C47CLQZK.js → chunk-CMZY6PM7.js} +1 -1
- package/dist/bundle/chunks/{chunk-XVIZD2L5.js → chunk-DOSAFY5Y.js} +3 -3
- package/dist/bundle/chunks/{chunk-KAXC2ESR.js → chunk-GICF34HK.js} +8 -8
- package/dist/bundle/chunks/{chunk-GYREDKZT.js → chunk-HKQXO4IQ.js} +1 -1
- package/dist/bundle/chunks/chunk-K4O5WZC5.js +11 -0
- package/dist/bundle/chunks/{chunk-SVKJCAH2.js → chunk-NBSSK56J.js} +1 -1
- package/dist/bundle/chunks/{chunk-XZYVF4BW.js → chunk-RAB4RJZ2.js} +60 -60
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-NHSAQJW5.js → cloudflare-workers-ai-system-one-6FXZDK6A.js} +1 -1
- package/dist/bundle/chunks/{easter-egg-3d-DD22MRM3.js → easter-egg-3d-JQPBRQEU.js} +1 -1
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{google-generative-ai-ON7RPJHF.js → google-generative-ai-VJA5IOK3.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-6YO5GV2H.js → google-vertex-TI6AJXT2.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-NN33SMJ6.js → mistral-conversations-XTWEX6FG.js} +1 -1
- package/dist/bundle/chunks/openai-codex-responses-WGH4GHLE.js +10 -0
- package/dist/bundle/chunks/openai-completions-GXGEEHZH.js +7 -0
- package/dist/bundle/chunks/openai-responses-NLSL5UY4.js +3 -0
- package/dist/bundle/chunks/{typesafe-system-one-PRR5K6CI.js → typesafe-system-one-3OTHQPDL.js} +1 -1
- package/dist/bundle/chunks/{virtual-modules-6MDPJKNE.js → virtual-modules-L22CHFWU.js} +1 -1
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/docs/compaction.md +2 -2
- package/docs/extensions.md +4 -10
- package/docs/message-types.md +2 -4
- package/docs/session-format.md +4 -4
- package/docs/settings.md +1 -1
- package/docs/tui.md +1 -1
- package/examples/extensions/overlay-test.ts +2 -2
- package/package.json +31 -31
- package/dist/bun/cli.d.ts +0 -5
- package/dist/bun/cli.d.ts.map +0 -1
- package/dist/bun/cli.js +0 -5
- package/dist/bun/cli.js.map +0 -1
- package/dist/bun/restore-sandbox-env.d.ts +0 -17
- package/dist/bun/restore-sandbox-env.d.ts.map +0 -1
- package/dist/bun/restore-sandbox-env.js +0 -36
- package/dist/bun/restore-sandbox-env.js.map +0 -1
- package/dist/bun/runtime-setup.d.ts +0 -2
- package/dist/bun/runtime-setup.d.ts.map +0 -1
- package/dist/bun/runtime-setup.js +0 -9
- package/dist/bun/runtime-setup.js.map +0 -1
- package/dist/bun/sandbox-env-setup.d.ts +0 -2
- package/dist/bun/sandbox-env-setup.d.ts.map +0 -1
- package/dist/bun/sandbox-env-setup.js +0 -4
- package/dist/bun/sandbox-env-setup.js.map +0 -1
- package/dist/bundle/chunks/anthropic-messages-EGJT3PY6.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-JEEXH6HK.js +0 -2
- package/dist/bundle/chunks/chunk-IOJUMBW3.js +0 -11
- package/dist/bundle/chunks/chunk-KJUDFE6Y.js +0 -11
- package/dist/bundle/chunks/openai-codex-responses-CPSVXTKM.js +0 -10
- package/dist/bundle/chunks/openai-completions-T7GN33JE.js +0 -7
- package/dist/bundle/chunks/openai-responses-GPE3ZQ46.js +0 -3
- package/dist/cli/args.d.ts +0 -61
- package/dist/cli/args.d.ts.map +0 -1
- package/dist/cli/args.js +0 -453
- package/dist/cli/args.js.map +0 -1
- package/dist/cli/auth-check.d.ts +0 -19
- package/dist/cli/auth-check.d.ts.map +0 -1
- package/dist/cli/auth-check.js +0 -50
- package/dist/cli/auth-check.js.map +0 -1
- package/dist/cli/auth-command.d.ts +0 -24
- package/dist/cli/auth-command.d.ts.map +0 -1
- package/dist/cli/auth-command.js +0 -103
- package/dist/cli/auth-command.js.map +0 -1
- package/dist/cli/config-selector.d.ts +0 -16
- package/dist/cli/config-selector.d.ts.map +0 -1
- package/dist/cli/config-selector.js +0 -32
- package/dist/cli/config-selector.js.map +0 -1
- package/dist/cli/credential-print.d.ts +0 -13
- package/dist/cli/credential-print.d.ts.map +0 -1
- package/dist/cli/credential-print.js +0 -76
- package/dist/cli/credential-print.js.map +0 -1
- package/dist/cli/file-processor.d.ts +0 -15
- package/dist/cli/file-processor.d.ts.map +0 -1
- package/dist/cli/file-processor.js +0 -71
- package/dist/cli/file-processor.js.map +0 -1
- package/dist/cli/initial-message.d.ts +0 -18
- package/dist/cli/initial-message.d.ts.map +0 -1
- package/dist/cli/initial-message.js +0 -22
- package/dist/cli/initial-message.js.map +0 -1
- package/dist/cli/list-models.d.ts +0 -9
- package/dist/cli/list-models.d.ts.map +0 -1
- package/dist/cli/list-models.js +0 -98
- package/dist/cli/list-models.js.map +0 -1
- package/dist/cli/project-trust.d.ts +0 -10
- package/dist/cli/project-trust.d.ts.map +0 -1
- package/dist/cli/project-trust.js +0 -48
- package/dist/cli/project-trust.js.map +0 -1
- package/dist/cli/session-picker.d.ts +0 -10
- package/dist/cli/session-picker.d.ts.map +0 -1
- package/dist/cli/session-picker.js +0 -36
- package/dist/cli/session-picker.js.map +0 -1
- package/dist/cli/setup.d.ts +0 -2
- package/dist/cli/setup.d.ts.map +0 -1
- package/dist/cli/setup.js +0 -12
- package/dist/cli/setup.js.map +0 -1
- package/dist/cli/startup-ui.d.ts +0 -20
- package/dist/cli/startup-ui.d.ts.map +0 -1
- package/dist/cli/startup-ui.js +0 -193
- package/dist/cli/startup-ui.js.map +0 -1
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -6
- package/dist/cli.js.map +0 -1
- package/dist/config.d.ts +0 -107
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -486
- package/dist/config.js.map +0 -1
- package/dist/core/agent-session-runtime.d.ts +0 -119
- package/dist/core/agent-session-runtime.d.ts.map +0 -1
- package/dist/core/agent-session-runtime.js +0 -317
- package/dist/core/agent-session-runtime.js.map +0 -1
- package/dist/core/agent-session-services.d.ts +0 -86
- package/dist/core/agent-session-services.d.ts.map +0 -1
- package/dist/core/agent-session-services.js +0 -147
- package/dist/core/agent-session-services.js.map +0 -1
- package/dist/core/agent-session.d.ts +0 -881
- package/dist/core/agent-session.d.ts.map +0 -1
- package/dist/core/agent-session.js +0 -3524
- package/dist/core/agent-session.js.map +0 -1
- package/dist/core/auth-guidance.d.ts +0 -5
- package/dist/core/auth-guidance.d.ts.map +0 -1
- package/dist/core/auth-guidance.js +0 -21
- package/dist/core/auth-guidance.js.map +0 -1
- package/dist/core/auth-storage.d.ts +0 -72
- package/dist/core/auth-storage.d.ts.map +0 -1
- package/dist/core/auth-storage.js +0 -426
- package/dist/core/auth-storage.js.map +0 -1
- package/dist/core/bash-executor.d.ts +0 -32
- package/dist/core/bash-executor.d.ts.map +0 -1
- package/dist/core/bash-executor.js +0 -106
- package/dist/core/bash-executor.js.map +0 -1
- package/dist/core/bug-report-upload.d.ts +0 -12
- package/dist/core/bug-report-upload.d.ts.map +0 -1
- package/dist/core/bug-report-upload.js +0 -22
- package/dist/core/bug-report-upload.js.map +0 -1
- package/dist/core/bug-report.d.ts +0 -176
- package/dist/core/bug-report.d.ts.map +0 -1
- package/dist/core/bug-report.js +0 -292
- package/dist/core/bug-report.js.map +0 -1
- package/dist/core/cache-stats.d.ts +0 -49
- package/dist/core/cache-stats.d.ts.map +0 -1
- package/dist/core/cache-stats.js +0 -112
- package/dist/core/cache-stats.js.map +0 -1
- package/dist/core/cache-warmer.d.ts +0 -103
- package/dist/core/cache-warmer.d.ts.map +0 -1
- package/dist/core/cache-warmer.js +0 -359
- package/dist/core/cache-warmer.js.map +0 -1
- package/dist/core/compaction/branch-summarization.d.ts +0 -98
- package/dist/core/compaction/branch-summarization.d.ts.map +0 -1
- package/dist/core/compaction/branch-summarization.js +0 -251
- package/dist/core/compaction/branch-summarization.js.map +0 -1
- package/dist/core/compaction/compaction.d.ts +0 -145
- package/dist/core/compaction/compaction.d.ts.map +0 -1
- package/dist/core/compaction/compaction.js +0 -744
- package/dist/core/compaction/compaction.js.map +0 -1
- package/dist/core/compaction/index.d.ts +0 -7
- package/dist/core/compaction/index.d.ts.map +0 -1
- package/dist/core/compaction/index.js +0 -7
- package/dist/core/compaction/index.js.map +0 -1
- package/dist/core/compaction/utils.d.ts +0 -39
- package/dist/core/compaction/utils.d.ts.map +0 -1
- package/dist/core/compaction/utils.js +0 -149
- package/dist/core/compaction/utils.js.map +0 -1
- package/dist/core/crash-log.d.ts +0 -27
- package/dist/core/crash-log.d.ts.map +0 -1
- package/dist/core/crash-log.js +0 -140
- package/dist/core/crash-log.js.map +0 -1
- package/dist/core/defaults.d.ts +0 -4
- package/dist/core/defaults.d.ts.map +0 -1
- package/dist/core/defaults.js +0 -11
- package/dist/core/defaults.js.map +0 -1
- package/dist/core/diagnostics.d.ts +0 -15
- package/dist/core/diagnostics.d.ts.map +0 -1
- package/dist/core/diagnostics.js +0 -2
- package/dist/core/diagnostics.js.map +0 -1
- package/dist/core/event-bus.d.ts +0 -9
- package/dist/core/event-bus.d.ts.map +0 -1
- package/dist/core/event-bus.js +0 -25
- package/dist/core/event-bus.js.map +0 -1
- package/dist/core/exec.d.ts +0 -29
- package/dist/core/exec.d.ts.map +0 -1
- package/dist/core/exec.js +0 -75
- package/dist/core/exec.js.map +0 -1
- package/dist/core/experimental.d.ts +0 -2
- package/dist/core/experimental.d.ts.map +0 -1
- package/dist/core/experimental.js +0 -6
- package/dist/core/experimental.js.map +0 -1
- package/dist/core/export-html/ansi-to-html.d.ts +0 -22
- package/dist/core/export-html/ansi-to-html.d.ts.map +0 -1
- package/dist/core/export-html/ansi-to-html.js +0 -249
- package/dist/core/export-html/ansi-to-html.js.map +0 -1
- package/dist/core/export-html/index.d.ts +0 -37
- package/dist/core/export-html/index.d.ts.map +0 -1
- package/dist/core/export-html/index.js +0 -226
- package/dist/core/export-html/index.js.map +0 -1
- package/dist/core/export-html/tool-renderer.d.ts +0 -34
- package/dist/core/export-html/tool-renderer.d.ts.map +0 -1
- package/dist/core/export-html/tool-renderer.js +0 -109
- package/dist/core/export-html/tool-renderer.js.map +0 -1
- package/dist/core/extensions/index.d.ts +0 -12
- package/dist/core/extensions/index.d.ts.map +0 -1
- package/dist/core/extensions/index.js +0 -9
- package/dist/core/extensions/index.js.map +0 -1
- package/dist/core/extensions/jiti-loader.d.ts +0 -2
- package/dist/core/extensions/jiti-loader.d.ts.map +0 -1
- package/dist/core/extensions/jiti-loader.js +0 -4
- package/dist/core/extensions/jiti-loader.js.map +0 -1
- package/dist/core/extensions/jiti-static-loader.d.ts +0 -2
- package/dist/core/extensions/jiti-static-loader.d.ts.map +0 -1
- package/dist/core/extensions/jiti-static-loader.js +0 -4
- package/dist/core/extensions/jiti-static-loader.js.map +0 -1
- package/dist/core/extensions/loader.d.ts +0 -23
- package/dist/core/extensions/loader.d.ts.map +0 -1
- package/dist/core/extensions/loader.js +0 -667
- package/dist/core/extensions/loader.js.map +0 -1
- package/dist/core/extensions/runner.d.ts +0 -204
- package/dist/core/extensions/runner.d.ts.map +0 -1
- package/dist/core/extensions/runner.js +0 -1207
- package/dist/core/extensions/runner.js.map +0 -1
- package/dist/core/extensions/types.d.ts +0 -1669
- package/dist/core/extensions/types.d.ts.map +0 -1
- package/dist/core/extensions/types.js +0 -48
- package/dist/core/extensions/types.js.map +0 -1
- package/dist/core/extensions/virtual-modules.d.ts +0 -3
- package/dist/core/extensions/virtual-modules.d.ts.map +0 -1
- package/dist/core/extensions/virtual-modules.js +0 -38
- package/dist/core/extensions/virtual-modules.js.map +0 -1
- package/dist/core/extensions/wrapper.d.ts +0 -20
- package/dist/core/extensions/wrapper.d.ts.map +0 -1
- package/dist/core/extensions/wrapper.js +0 -22
- package/dist/core/extensions/wrapper.js.map +0 -1
- package/dist/core/footer-data-provider.d.ts +0 -64
- package/dist/core/footer-data-provider.d.ts.map +0 -1
- package/dist/core/footer-data-provider.js +0 -338
- package/dist/core/footer-data-provider.js.map +0 -1
- package/dist/core/http-dispatcher.d.ts +0 -22
- package/dist/core/http-dispatcher.d.ts.map +0 -1
- package/dist/core/http-dispatcher.js +0 -98
- package/dist/core/http-dispatcher.js.map +0 -1
- package/dist/core/index.d.ts +0 -14
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -13
- package/dist/core/index.js.map +0 -1
- package/dist/core/keybindings.d.ts +0 -428
- package/dist/core/keybindings.d.ts.map +0 -1
- package/dist/core/keybindings.js +0 -321
- package/dist/core/keybindings.js.map +0 -1
- package/dist/core/messages.d.ts +0 -77
- package/dist/core/messages.d.ts.map +0 -1
- package/dist/core/messages.js +0 -124
- package/dist/core/messages.js.map +0 -1
- package/dist/core/model-config.d.ts +0 -760
- package/dist/core/model-config.d.ts.map +0 -1
- package/dist/core/model-config.js +0 -294
- package/dist/core/model-config.js.map +0 -1
- package/dist/core/model-registry.d.ts +0 -61
- package/dist/core/model-registry.d.ts.map +0 -1
- package/dist/core/model-registry.js +0 -140
- package/dist/core/model-registry.js.map +0 -1
- package/dist/core/model-resolver.d.ts +0 -124
- package/dist/core/model-resolver.d.ts.map +0 -1
- package/dist/core/model-resolver.js +0 -590
- package/dist/core/model-resolver.js.map +0 -1
- package/dist/core/model-runtime.d.ts +0 -145
- package/dist/core/model-runtime.d.ts.map +0 -1
- package/dist/core/model-runtime.js +0 -758
- package/dist/core/model-runtime.js.map +0 -1
- package/dist/core/models-store.d.ts +0 -22
- package/dist/core/models-store.d.ts.map +0 -1
- package/dist/core/models-store.js +0 -115
- package/dist/core/models-store.js.map +0 -1
- package/dist/core/nested-tool-calls.d.ts +0 -102
- package/dist/core/nested-tool-calls.d.ts.map +0 -1
- package/dist/core/nested-tool-calls.js +0 -178
- package/dist/core/nested-tool-calls.js.map +0 -1
- package/dist/core/output-guard.d.ts +0 -7
- package/dist/core/output-guard.d.ts.map +0 -1
- package/dist/core/output-guard.js +0 -89
- package/dist/core/output-guard.js.map +0 -1
- package/dist/core/package-manager.d.ts +0 -217
- package/dist/core/package-manager.d.ts.map +0 -1
- package/dist/core/package-manager.js +0 -2224
- package/dist/core/package-manager.js.map +0 -1
- package/dist/core/pi-manifest.d.ts +0 -8
- package/dist/core/pi-manifest.d.ts.map +0 -1
- package/dist/core/pi-manifest.js +0 -26
- package/dist/core/pi-manifest.js.map +0 -1
- package/dist/core/project-trust.d.ts +0 -15
- package/dist/core/project-trust.d.ts.map +0 -1
- package/dist/core/project-trust.js +0 -59
- package/dist/core/project-trust.js.map +0 -1
- package/dist/core/prompt-templates.d.ts +0 -59
- package/dist/core/prompt-templates.d.ts.map +0 -1
- package/dist/core/prompt-templates.js +0 -262
- package/dist/core/prompt-templates.js.map +0 -1
- package/dist/core/provider-attribution.d.ts +0 -4
- package/dist/core/provider-attribution.d.ts.map +0 -1
- package/dist/core/provider-attribution.js +0 -72
- package/dist/core/provider-attribution.js.map +0 -1
- package/dist/core/provider-composer.d.ts +0 -80
- package/dist/core/provider-composer.d.ts.map +0 -1
- package/dist/core/provider-composer.js +0 -488
- package/dist/core/provider-composer.js.map +0 -1
- package/dist/core/radius.d.ts +0 -5
- package/dist/core/radius.d.ts.map +0 -1
- package/dist/core/radius.js +0 -9
- package/dist/core/radius.js.map +0 -1
- package/dist/core/remote-catalog-provider.d.ts +0 -12
- package/dist/core/remote-catalog-provider.d.ts.map +0 -1
- package/dist/core/remote-catalog-provider.js +0 -132
- package/dist/core/remote-catalog-provider.js.map +0 -1
- package/dist/core/resolve-config-value.d.ts +0 -30
- package/dist/core/resolve-config-value.d.ts.map +0 -1
- package/dist/core/resolve-config-value.js +0 -247
- package/dist/core/resolve-config-value.js.map +0 -1
- package/dist/core/resource-loader.d.ts +0 -227
- package/dist/core/resource-loader.d.ts.map +0 -1
- package/dist/core/resource-loader.js +0 -1008
- package/dist/core/resource-loader.js.map +0 -1
- package/dist/core/runtime-credentials.d.ts +0 -15
- package/dist/core/runtime-credentials.d.ts.map +0 -1
- package/dist/core/runtime-credentials.js +0 -39
- package/dist/core/runtime-credentials.js.map +0 -1
- package/dist/core/sdk.d.ts +0 -108
- package/dist/core/sdk.d.ts.map +0 -1
- package/dist/core/sdk.js +0 -315
- package/dist/core/sdk.js.map +0 -1
- package/dist/core/session-cwd.d.ts +0 -19
- package/dist/core/session-cwd.d.ts.map +0 -1
- package/dist/core/session-cwd.js +0 -38
- package/dist/core/session-cwd.js.map +0 -1
- package/dist/core/session-export.d.ts +0 -8
- package/dist/core/session-export.d.ts.map +0 -1
- package/dist/core/session-export.js +0 -33
- package/dist/core/session-export.js.map +0 -1
- package/dist/core/session-manager.d.ts +0 -416
- package/dist/core/session-manager.d.ts.map +0 -1
- package/dist/core/session-manager.js +0 -1523
- package/dist/core/session-manager.js.map +0 -1
- package/dist/core/settings-diagnostics.d.ts +0 -9
- package/dist/core/settings-diagnostics.d.ts.map +0 -1
- package/dist/core/settings-diagnostics.js +0 -21
- package/dist/core/settings-diagnostics.js.map +0 -1
- package/dist/core/settings-manager.d.ts +0 -362
- package/dist/core/settings-manager.d.ts.map +0 -1
- package/dist/core/settings-manager.js +0 -1107
- package/dist/core/settings-manager.js.map +0 -1
- package/dist/core/skills.d.ts +0 -60
- package/dist/core/skills.d.ts.map +0 -1
- package/dist/core/skills.js +0 -407
- package/dist/core/skills.js.map +0 -1
- package/dist/core/slash-commands.d.ts +0 -15
- package/dist/core/slash-commands.d.ts.map +0 -1
- package/dist/core/slash-commands.js +0 -28
- package/dist/core/slash-commands.js.map +0 -1
- package/dist/core/source-info.d.ts +0 -26
- package/dist/core/source-info.d.ts.map +0 -1
- package/dist/core/source-info.js +0 -35
- package/dist/core/source-info.js.map +0 -1
- package/dist/core/system-prompt.d.ts +0 -71
- package/dist/core/system-prompt.d.ts.map +0 -1
- package/dist/core/system-prompt.js +0 -147
- package/dist/core/system-prompt.js.map +0 -1
- package/dist/core/telemetry.d.ts +0 -3
- package/dist/core/telemetry.d.ts.map +0 -1
- package/dist/core/telemetry.js +0 -10
- package/dist/core/telemetry.js.map +0 -1
- package/dist/core/timings.d.ts +0 -6
- package/dist/core/timings.d.ts.map +0 -1
- package/dist/core/timings.js +0 -42
- package/dist/core/timings.js.map +0 -1
- package/dist/core/tools/bash.d.ts +0 -101
- package/dist/core/tools/bash.d.ts.map +0 -1
- package/dist/core/tools/bash.js +0 -348
- package/dist/core/tools/bash.js.map +0 -1
- package/dist/core/tools/edit-diff.d.ts +0 -101
- package/dist/core/tools/edit-diff.d.ts.map +0 -1
- package/dist/core/tools/edit-diff.js +0 -421
- package/dist/core/tools/edit-diff.js.map +0 -1
- package/dist/core/tools/edit.d.ts +0 -44
- package/dist/core/tools/edit.d.ts.map +0 -1
- package/dist/core/tools/edit.js +0 -147
- package/dist/core/tools/edit.js.map +0 -1
- package/dist/core/tools/file-mutation-queue.d.ts +0 -6
- package/dist/core/tools/file-mutation-queue.d.ts.map +0 -1
- package/dist/core/tools/file-mutation-queue.js +0 -52
- package/dist/core/tools/file-mutation-queue.js.map +0 -1
- package/dist/core/tools/find.d.ts +0 -42
- package/dist/core/tools/find.d.ts.map +0 -1
- package/dist/core/tools/find.js +0 -251
- package/dist/core/tools/find.js.map +0 -1
- package/dist/core/tools/grep.d.ts +0 -41
- package/dist/core/tools/grep.d.ts.map +0 -1
- package/dist/core/tools/grep.js +0 -252
- package/dist/core/tools/grep.js.map +0 -1
- package/dist/core/tools/index.d.ts +0 -43
- package/dist/core/tools/index.d.ts.map +0 -1
- package/dist/core/tools/index.js +0 -129
- package/dist/core/tools/index.js.map +0 -1
- package/dist/core/tools/ls.d.ts +0 -41
- package/dist/core/tools/ls.d.ts.map +0 -1
- package/dist/core/tools/ls.js +0 -126
- package/dist/core/tools/ls.js.map +0 -1
- package/dist/core/tools/output-accumulator.d.ts +0 -63
- package/dist/core/tools/output-accumulator.d.ts.map +0 -1
- package/dist/core/tools/output-accumulator.js +0 -220
- package/dist/core/tools/output-accumulator.js.map +0 -1
- package/dist/core/tools/path-utils.d.ts +0 -10
- package/dist/core/tools/path-utils.d.ts.map +0 -1
- package/dist/core/tools/path-utils.js +0 -99
- package/dist/core/tools/path-utils.js.map +0 -1
- package/dist/core/tools/powershell.d.ts +0 -16
- package/dist/core/tools/powershell.d.ts.map +0 -1
- package/dist/core/tools/powershell.js +0 -39
- package/dist/core/tools/powershell.js.map +0 -1
- package/dist/core/tools/read.d.ts +0 -42
- package/dist/core/tools/read.d.ts.map +0 -1
- package/dist/core/tools/read.js +0 -169
- package/dist/core/tools/read.js.map +0 -1
- package/dist/core/tools/render-utils.d.ts +0 -30
- package/dist/core/tools/render-utils.d.ts.map +0 -1
- package/dist/core/tools/render-utils.js +0 -91
- package/dist/core/tools/render-utils.js.map +0 -1
- package/dist/core/tools/renderers/bash.d.ts +0 -12
- package/dist/core/tools/renderers/bash.d.ts.map +0 -1
- package/dist/core/tools/renderers/bash.js +0 -117
- package/dist/core/tools/renderers/bash.js.map +0 -1
- package/dist/core/tools/renderers/edit.d.ts +0 -23
- package/dist/core/tools/renderers/edit.d.ts.map +0 -1
- package/dist/core/tools/renderers/edit.js +0 -168
- package/dist/core/tools/renderers/edit.js.map +0 -1
- package/dist/core/tools/renderers/find.d.ts +0 -10
- package/dist/core/tools/renderers/find.d.ts.map +0 -1
- package/dist/core/tools/renderers/find.js +0 -64
- package/dist/core/tools/renderers/find.js.map +0 -1
- package/dist/core/tools/renderers/grep.d.ts +0 -10
- package/dist/core/tools/renderers/grep.d.ts.map +0 -1
- package/dist/core/tools/renderers/grep.js +0 -69
- package/dist/core/tools/renderers/grep.js.map +0 -1
- package/dist/core/tools/renderers/index.d.ts +0 -28
- package/dist/core/tools/renderers/index.d.ts.map +0 -1
- package/dist/core/tools/renderers/index.js +0 -47
- package/dist/core/tools/renderers/index.js.map +0 -1
- package/dist/core/tools/renderers/ls.d.ts +0 -10
- package/dist/core/tools/renderers/ls.d.ts.map +0 -1
- package/dist/core/tools/renderers/ls.js +0 -58
- package/dist/core/tools/renderers/ls.js.map +0 -1
- package/dist/core/tools/renderers/read.d.ts +0 -11
- package/dist/core/tools/renderers/read.d.ts.map +0 -1
- package/dist/core/tools/renderers/read.js +0 -130
- package/dist/core/tools/renderers/read.js.map +0 -1
- package/dist/core/tools/renderers/write.d.ts +0 -10
- package/dist/core/tools/renderers/write.d.ts.map +0 -1
- package/dist/core/tools/renderers/write.js +0 -153
- package/dist/core/tools/renderers/write.js.map +0 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +0 -16
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +0 -1
- package/dist/core/tools/tool-definition-wrapper.js +0 -38
- package/dist/core/tools/tool-definition-wrapper.js.map +0 -1
- package/dist/core/tools/truncate.d.ts +0 -84
- package/dist/core/tools/truncate.d.ts.map +0 -1
- package/dist/core/tools/truncate.js +0 -244
- package/dist/core/tools/truncate.js.map +0 -1
- package/dist/core/tools/write.d.ts +0 -30
- package/dist/core/tools/write.d.ts.map +0 -1
- package/dist/core/tools/write.js +0 -61
- package/dist/core/tools/write.js.map +0 -1
- package/dist/core/trust-manager.d.ts +0 -36
- package/dist/core/trust-manager.d.ts.map +0 -1
- package/dist/core/trust-manager.js +0 -203
- package/dist/core/trust-manager.js.map +0 -1
- package/dist/core/usage-totals.d.ts +0 -21
- package/dist/core/usage-totals.d.ts.map +0 -1
- package/dist/core/usage-totals.js +0 -79
- package/dist/core/usage-totals.js.map +0 -1
- package/dist/core/virtual-models.d.ts +0 -117
- package/dist/core/virtual-models.d.ts.map +0 -1
- package/dist/core/virtual-models.js +0 -124
- package/dist/core/virtual-models.js.map +0 -1
- package/dist/extensions/index.d.ts +0 -3
- package/dist/extensions/index.d.ts.map +0 -1
- package/dist/extensions/index.js +0 -3
- package/dist/extensions/index.js.map +0 -1
- package/dist/extensions/llama/client.d.ts +0 -69
- package/dist/extensions/llama/client.d.ts.map +0 -1
- package/dist/extensions/llama/client.js +0 -313
- package/dist/extensions/llama/client.js.map +0 -1
- package/dist/extensions/llama/huggingface.d.ts +0 -23
- package/dist/extensions/llama/huggingface.d.ts.map +0 -1
- package/dist/extensions/llama/huggingface.js +0 -141
- package/dist/extensions/llama/huggingface.js.map +0 -1
- package/dist/extensions/llama/index.d.ts +0 -3
- package/dist/extensions/llama/index.d.ts.map +0 -1
- package/dist/extensions/llama/index.js +0 -219
- package/dist/extensions/llama/index.js.map +0 -1
- package/dist/extensions/llama/provider.d.ts +0 -12
- package/dist/extensions/llama/provider.d.ts.map +0 -1
- package/dist/extensions/llama/provider.js +0 -213
- package/dist/extensions/llama/provider.js.map +0 -1
- package/dist/extensions/llama/ui.d.ts +0 -42
- package/dist/extensions/llama/ui.d.ts.map +0 -1
- package/dist/extensions/llama/ui.js +0 -416
- package/dist/extensions/llama/ui.js.map +0 -1
- package/dist/index.d.ts +0 -38
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -49
- package/dist/index.js.map +0 -1
- package/dist/main.d.ts +0 -16
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js +0 -819
- package/dist/main.js.map +0 -1
- package/dist/migrations.d.ts +0 -33
- package/dist/migrations.d.ts.map +0 -1
- package/dist/migrations.js +0 -282
- package/dist/migrations.js.map +0 -1
- package/dist/modes/index.d.ts +0 -10
- package/dist/modes/index.d.ts.map +0 -1
- package/dist/modes/index.js +0 -8
- package/dist/modes/index.js.map +0 -1
- package/dist/modes/interactive/bug-report.d.ts +0 -16
- package/dist/modes/interactive/bug-report.d.ts.map +0 -1
- package/dist/modes/interactive/bug-report.js +0 -210
- package/dist/modes/interactive/bug-report.js.map +0 -1
- package/dist/modes/interactive/chat-viewport.d.ts +0 -20
- package/dist/modes/interactive/chat-viewport.d.ts.map +0 -1
- package/dist/modes/interactive/chat-viewport.js +0 -28
- package/dist/modes/interactive/chat-viewport.js.map +0 -1
- package/dist/modes/interactive/components/armin.d.ts +0 -37
- package/dist/modes/interactive/components/armin.d.ts.map +0 -1
- package/dist/modes/interactive/components/armin.js +0 -335
- package/dist/modes/interactive/components/armin.js.map +0 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +0 -26
- package/dist/modes/interactive/components/assistant-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/assistant-message.js +0 -158
- package/dist/modes/interactive/components/assistant-message.js.map +0 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +0 -38
- package/dist/modes/interactive/components/bash-execution.d.ts.map +0 -1
- package/dist/modes/interactive/components/bash-execution.js +0 -178
- package/dist/modes/interactive/components/bash-execution.js.map +0 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts +0 -16
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +0 -1
- package/dist/modes/interactive/components/bordered-loader.js +0 -54
- package/dist/modes/interactive/components/bordered-loader.js.map +0 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts +0 -17
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/branch-summary-message.js +0 -54
- package/dist/modes/interactive/components/branch-summary-message.js.map +0 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +0 -17
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +0 -55
- package/dist/modes/interactive/components/compaction-summary-message.js.map +0 -1
- package/dist/modes/interactive/components/config-selector.d.ts +0 -102
- package/dist/modes/interactive/components/config-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/config-selector.js +0 -771
- package/dist/modes/interactive/components/config-selector.js.map +0 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts +0 -14
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +0 -1
- package/dist/modes/interactive/components/countdown-timer.js +0 -33
- package/dist/modes/interactive/components/countdown-timer.js.map +0 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +0 -30
- package/dist/modes/interactive/components/custom-editor.d.ts.map +0 -1
- package/dist/modes/interactive/components/custom-editor.js +0 -115
- package/dist/modes/interactive/components/custom-editor.js.map +0 -1
- package/dist/modes/interactive/components/custom-entry.d.ts +0 -21
- package/dist/modes/interactive/components/custom-entry.d.ts.map +0 -1
- package/dist/modes/interactive/components/custom-entry.js +0 -58
- package/dist/modes/interactive/components/custom-entry.js.map +0 -1
- package/dist/modes/interactive/components/custom-message.d.ts +0 -22
- package/dist/modes/interactive/components/custom-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/custom-message.js +0 -88
- package/dist/modes/interactive/components/custom-message.js.map +0 -1
- package/dist/modes/interactive/components/diff.d.ts +0 -12
- package/dist/modes/interactive/components/diff.d.ts.map +0 -1
- package/dist/modes/interactive/components/diff.js +0 -133
- package/dist/modes/interactive/components/diff.js.map +0 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts +0 -15
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +0 -1
- package/dist/modes/interactive/components/dynamic-border.js +0 -21
- package/dist/modes/interactive/components/dynamic-border.js.map +0 -1
- package/dist/modes/interactive/components/e-logo.d.ts +0 -16
- package/dist/modes/interactive/components/e-logo.d.ts.map +0 -1
- package/dist/modes/interactive/components/e-logo.js +0 -29
- package/dist/modes/interactive/components/e-logo.js.map +0 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts +0 -5
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +0 -1
- package/dist/modes/interactive/components/earendil-announcement.js +0 -40
- package/dist/modes/interactive/components/earendil-announcement.js.map +0 -1
- package/dist/modes/interactive/components/easter-egg-3d.d.ts +0 -104
- package/dist/modes/interactive/components/easter-egg-3d.d.ts.map +0 -1
- package/dist/modes/interactive/components/easter-egg-3d.js +0 -1138
- package/dist/modes/interactive/components/easter-egg-3d.js.map +0 -1
- package/dist/modes/interactive/components/easter-egg-3d.lazy.d.ts +0 -6
- package/dist/modes/interactive/components/easter-egg-3d.lazy.d.ts.map +0 -1
- package/dist/modes/interactive/components/easter-egg-3d.lazy.js +0 -23
- package/dist/modes/interactive/components/easter-egg-3d.lazy.js.map +0 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +0 -24
- package/dist/modes/interactive/components/extension-editor.d.ts.map +0 -1
- package/dist/modes/interactive/components/extension-editor.js +0 -103
- package/dist/modes/interactive/components/extension-editor.js.map +0 -1
- package/dist/modes/interactive/components/extension-input.d.ts +0 -25
- package/dist/modes/interactive/components/extension-input.d.ts.map +0 -1
- package/dist/modes/interactive/components/extension-input.js +0 -67
- package/dist/modes/interactive/components/extension-input.js.map +0 -1
- package/dist/modes/interactive/components/extension-selector.d.ts +0 -27
- package/dist/modes/interactive/components/extension-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/extension-selector.js +0 -87
- package/dist/modes/interactive/components/extension-selector.js.map +0 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +0 -25
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +0 -1
- package/dist/modes/interactive/components/first-time-setup.js +0 -109
- package/dist/modes/interactive/components/first-time-setup.js.map +0 -1
- package/dist/modes/interactive/components/footer.d.ts +0 -39
- package/dist/modes/interactive/components/footer.d.ts.map +0 -1
- package/dist/modes/interactive/components/footer.js +0 -265
- package/dist/modes/interactive/components/footer.js.map +0 -1
- package/dist/modes/interactive/components/index.d.ts +0 -33
- package/dist/modes/interactive/components/index.d.ts.map +0 -1
- package/dist/modes/interactive/components/index.js +0 -34
- package/dist/modes/interactive/components/index.js.map +0 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts +0 -13
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +0 -1
- package/dist/modes/interactive/components/keybinding-hints.js +0 -36
- package/dist/modes/interactive/components/keybinding-hints.js.map +0 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +0 -52
- package/dist/modes/interactive/components/login-dialog.d.ts.map +0 -1
- package/dist/modes/interactive/components/login-dialog.js +0 -188
- package/dist/modes/interactive/components/login-dialog.js.map +0 -1
- package/dist/modes/interactive/components/markdown-transform.d.ts +0 -3
- package/dist/modes/interactive/components/markdown-transform.d.ts.map +0 -1
- package/dist/modes/interactive/components/markdown-transform.js +0 -19
- package/dist/modes/interactive/components/markdown-transform.js.map +0 -1
- package/dist/modes/interactive/components/mermaid.d.ts +0 -11
- package/dist/modes/interactive/components/mermaid.d.ts.map +0 -1
- package/dist/modes/interactive/components/mermaid.js +0 -75
- package/dist/modes/interactive/components/mermaid.js.map +0 -1
- package/dist/modes/interactive/components/model-selector.d.ts +0 -60
- package/dist/modes/interactive/components/model-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/model-selector.js +0 -361
- package/dist/modes/interactive/components/model-selector.js.map +0 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +0 -33
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/oauth-selector.js +0 -163
- package/dist/modes/interactive/components/oauth-selector.js.map +0 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +0 -46
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +0 -326
- package/dist/modes/interactive/components/scoped-models-selector.js.map +0 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts +0 -23
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +0 -1
- package/dist/modes/interactive/components/session-selector-search.js +0 -155
- package/dist/modes/interactive/components/session-selector-search.js.map +0 -1
- package/dist/modes/interactive/components/session-selector.d.ts +0 -95
- package/dist/modes/interactive/components/session-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/session-selector.js +0 -893
- package/dist/modes/interactive/components/session-selector.js.map +0 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +0 -96
- package/dist/modes/interactive/components/settings-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/settings-selector.js +0 -742
- package/dist/modes/interactive/components/settings-selector.js.map +0 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts +0 -72
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +0 -1
- package/dist/modes/interactive/components/settings-submenu.js +0 -165
- package/dist/modes/interactive/components/settings-submenu.js.map +0 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts +0 -10
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/show-images-selector.js +0 -39
- package/dist/modes/interactive/components/show-images-selector.js.map +0 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +0 -18
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +0 -57
- package/dist/modes/interactive/components/skill-invocation-message.js.map +0 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +0 -30
- package/dist/modes/interactive/components/status-indicator.d.ts.map +0 -1
- package/dist/modes/interactive/components/status-indicator.js +0 -67
- package/dist/modes/interactive/components/status-indicator.js.map +0 -1
- package/dist/modes/interactive/components/theme-selector.d.ts +0 -11
- package/dist/modes/interactive/components/theme-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/theme-selector.js +0 -50
- package/dist/modes/interactive/components/theme-selector.js.map +0 -1
- package/dist/modes/interactive/components/themed-text.d.ts +0 -17
- package/dist/modes/interactive/components/themed-text.d.ts.map +0 -1
- package/dist/modes/interactive/components/themed-text.js +0 -29
- package/dist/modes/interactive/components/themed-text.js.map +0 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts +0 -23
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/thinking-selector.js +0 -109
- package/dist/modes/interactive/components/thinking-selector.js.map +0 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +0 -83
- package/dist/modes/interactive/components/tool-execution.d.ts.map +0 -1
- package/dist/modes/interactive/components/tool-execution.js +0 -323
- package/dist/modes/interactive/components/tool-execution.js.map +0 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +0 -94
- package/dist/modes/interactive/components/tree-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/tree-selector.js +0 -1254
- package/dist/modes/interactive/components/tree-selector.js.map +0 -1
- package/dist/modes/interactive/components/trust-selector.d.ts +0 -23
- package/dist/modes/interactive/components/trust-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/trust-selector.js +0 -91
- package/dist/modes/interactive/components/trust-selector.js.map +0 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts +0 -30
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/user-message-selector.js +0 -114
- package/dist/modes/interactive/components/user-message-selector.js.map +0 -1
- package/dist/modes/interactive/components/user-message.d.ts +0 -16
- package/dist/modes/interactive/components/user-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/user-message.js +0 -50
- package/dist/modes/interactive/components/user-message.js.map +0 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts +0 -48
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +0 -1
- package/dist/modes/interactive/components/visual-truncate.js +0 -66
- package/dist/modes/interactive/components/visual-truncate.js.map +0 -1
- package/dist/modes/interactive/external-editor.d.ts +0 -12
- package/dist/modes/interactive/external-editor.d.ts.map +0 -1
- package/dist/modes/interactive/external-editor.js +0 -38
- package/dist/modes/interactive/external-editor.js.map +0 -1
- package/dist/modes/interactive/interactive-mode.d.ts +0 -470
- package/dist/modes/interactive/interactive-mode.d.ts.map +0 -1
- package/dist/modes/interactive/interactive-mode.js +0 -5795
- package/dist/modes/interactive/interactive-mode.js.map +0 -1
- package/dist/modes/interactive/model-catalog-refresh.d.ts +0 -7
- package/dist/modes/interactive/model-catalog-refresh.d.ts.map +0 -1
- package/dist/modes/interactive/model-catalog-refresh.js +0 -34
- package/dist/modes/interactive/model-catalog-refresh.js.map +0 -1
- package/dist/modes/interactive/model-search.d.ts +0 -12
- package/dist/modes/interactive/model-search.d.ts.map +0 -1
- package/dist/modes/interactive/model-search.js +0 -15
- package/dist/modes/interactive/model-search.js.map +0 -1
- package/dist/modes/interactive/session-share.d.ts +0 -18
- package/dist/modes/interactive/session-share.d.ts.map +0 -1
- package/dist/modes/interactive/session-share.js +0 -188
- package/dist/modes/interactive/session-share.js.map +0 -1
- package/dist/modes/interactive/theme/system-theme.d.ts +0 -55
- package/dist/modes/interactive/theme/system-theme.d.ts.map +0 -1
- package/dist/modes/interactive/theme/system-theme.js +0 -546
- package/dist/modes/interactive/theme/system-theme.js.map +0 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts +0 -81
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +0 -1
- package/dist/modes/interactive/theme/theme-controller.js +0 -210
- package/dist/modes/interactive/theme/theme-controller.js.map +0 -1
- package/dist/modes/interactive/theme/theme-json.d.ts +0 -85
- package/dist/modes/interactive/theme/theme-json.d.ts.map +0 -1
- package/dist/modes/interactive/theme/theme-json.js +0 -132
- package/dist/modes/interactive/theme/theme-json.js.map +0 -1
- package/dist/modes/interactive/theme/theme.d.ts +0 -158
- package/dist/modes/interactive/theme/theme.d.ts.map +0 -1
- package/dist/modes/interactive/theme/theme.js +0 -913
- package/dist/modes/interactive/theme/theme.js.map +0 -1
- package/dist/modes/interactive/tui-renderer.d.ts +0 -22
- package/dist/modes/interactive/tui-renderer.d.ts.map +0 -1
- package/dist/modes/interactive/tui-renderer.js +0 -67
- package/dist/modes/interactive/tui-renderer.js.map +0 -1
- package/dist/modes/json-event.d.ts +0 -34
- package/dist/modes/json-event.d.ts.map +0 -1
- package/dist/modes/json-event.js +0 -29
- package/dist/modes/json-event.js.map +0 -1
- package/dist/modes/print-mode.d.ts +0 -28
- package/dist/modes/print-mode.d.ts.map +0 -1
- package/dist/modes/print-mode.js +0 -142
- package/dist/modes/print-mode.js.map +0 -1
- package/dist/modes/rpc/jsonl.d.ts +0 -17
- package/dist/modes/rpc/jsonl.d.ts.map +0 -1
- package/dist/modes/rpc/jsonl.js +0 -49
- package/dist/modes/rpc/jsonl.js.map +0 -1
- package/dist/modes/rpc/rpc-client.d.ts +0 -254
- package/dist/modes/rpc/rpc-client.d.ts.map +0 -1
- package/dist/modes/rpc/rpc-client.js +0 -499
- package/dist/modes/rpc/rpc-client.js.map +0 -1
- package/dist/modes/rpc/rpc-mode.d.ts +0 -20
- package/dist/modes/rpc/rpc-mode.d.ts.map +0 -1
- package/dist/modes/rpc/rpc-mode.js +0 -655
- package/dist/modes/rpc/rpc-mode.js.map +0 -1
- package/dist/modes/rpc/rpc-types.d.ts +0 -478
- package/dist/modes/rpc/rpc-types.d.ts.map +0 -1
- package/dist/modes/rpc/rpc-types.js +0 -8
- package/dist/modes/rpc/rpc-types.js.map +0 -1
- package/dist/package-manager-cli.d.ts +0 -9
- package/dist/package-manager-cli.d.ts.map +0 -1
- package/dist/package-manager-cli.js +0 -1000
- package/dist/package-manager-cli.js.map +0 -1
- package/dist/rpc-entry.d.ts +0 -3
- package/dist/rpc-entry.d.ts.map +0 -1
- package/dist/rpc-entry.js +0 -11
- package/dist/rpc-entry.js.map +0 -1
- package/dist/utils/abort.d.ts +0 -5
- package/dist/utils/abort.d.ts.map +0 -1
- package/dist/utils/abort.js +0 -48
- package/dist/utils/abort.js.map +0 -1
- package/dist/utils/ansi.d.ts +0 -10
- package/dist/utils/ansi.d.ts.map +0 -1
- package/dist/utils/ansi.js +0 -71
- package/dist/utils/ansi.js.map +0 -1
- package/dist/utils/changelog.d.ts +0 -22
- package/dist/utils/changelog.d.ts.map +0 -1
- package/dist/utils/changelog.js +0 -165
- package/dist/utils/changelog.js.map +0 -1
- package/dist/utils/child-process.d.ts +0 -18
- package/dist/utils/child-process.d.ts.map +0 -1
- package/dist/utils/child-process.js +0 -106
- package/dist/utils/child-process.js.map +0 -1
- package/dist/utils/clipboard-command.d.ts +0 -7
- package/dist/utils/clipboard-command.d.ts.map +0 -1
- package/dist/utils/clipboard-command.js +0 -45
- package/dist/utils/clipboard-command.js.map +0 -1
- package/dist/utils/clipboard-image.d.ts +0 -11
- package/dist/utils/clipboard-image.d.ts.map +0 -1
- package/dist/utils/clipboard-image.js +0 -214
- package/dist/utils/clipboard-image.js.map +0 -1
- package/dist/utils/clipboard.d.ts +0 -6
- package/dist/utils/clipboard.d.ts.map +0 -1
- package/dist/utils/clipboard.js +0 -157
- package/dist/utils/clipboard.js.map +0 -1
- package/dist/utils/deprecation.d.ts +0 -4
- package/dist/utils/deprecation.d.ts.map +0 -1
- package/dist/utils/deprecation.js +0 -13
- package/dist/utils/deprecation.js.map +0 -1
- package/dist/utils/exif-orientation.d.ts +0 -5
- package/dist/utils/exif-orientation.d.ts.map +0 -1
- package/dist/utils/exif-orientation.js +0 -157
- package/dist/utils/exif-orientation.js.map +0 -1
- package/dist/utils/frontmatter.d.ts +0 -8
- package/dist/utils/frontmatter.d.ts.map +0 -1
- package/dist/utils/frontmatter.js +0 -27
- package/dist/utils/frontmatter.js.map +0 -1
- package/dist/utils/fs-watch.d.ts +0 -5
- package/dist/utils/fs-watch.d.ts.map +0 -1
- package/dist/utils/fs-watch.js +0 -25
- package/dist/utils/fs-watch.js.map +0 -1
- package/dist/utils/git.d.ts +0 -26
- package/dist/utils/git.d.ts.map +0 -1
- package/dist/utils/git.js +0 -195
- package/dist/utils/git.js.map +0 -1
- package/dist/utils/html.d.ts +0 -7
- package/dist/utils/html.d.ts.map +0 -1
- package/dist/utils/html.js +0 -40
- package/dist/utils/html.js.map +0 -1
- package/dist/utils/image-convert.d.ts +0 -22
- package/dist/utils/image-convert.d.ts.map +0 -1
- package/dist/utils/image-convert.js +0 -84
- package/dist/utils/image-convert.js.map +0 -1
- package/dist/utils/image-process.d.ts +0 -18
- package/dist/utils/image-process.d.ts.map +0 -1
- package/dist/utils/image-process.js +0 -83
- package/dist/utils/image-process.js.map +0 -1
- package/dist/utils/image-resize-core.d.ts +0 -42
- package/dist/utils/image-resize-core.d.ts.map +0 -1
- package/dist/utils/image-resize-core.js +0 -129
- package/dist/utils/image-resize-core.js.map +0 -1
- package/dist/utils/image-resize-worker.d.ts +0 -2
- package/dist/utils/image-resize-worker.d.ts.map +0 -1
- package/dist/utils/image-resize-worker.js +0 -32
- package/dist/utils/image-resize-worker.js.map +0 -1
- package/dist/utils/image-resize.d.ts +0 -16
- package/dist/utils/image-resize.d.ts.map +0 -1
- package/dist/utils/image-resize.js +0 -96
- package/dist/utils/image-resize.js.map +0 -1
- package/dist/utils/json.d.ts +0 -3
- package/dist/utils/json.d.ts.map +0 -1
- package/dist/utils/json.js +0 -7
- package/dist/utils/json.js.map +0 -1
- package/dist/utils/management-http.d.ts +0 -25
- package/dist/utils/management-http.d.ts.map +0 -1
- package/dist/utils/management-http.js +0 -54
- package/dist/utils/management-http.js.map +0 -1
- package/dist/utils/mime.d.ts +0 -3
- package/dist/utils/mime.d.ts.map +0 -1
- package/dist/utils/mime.js +0 -110
- package/dist/utils/mime.js.map +0 -1
- package/dist/utils/open-browser.d.ts +0 -9
- package/dist/utils/open-browser.d.ts.map +0 -1
- package/dist/utils/open-browser.js +0 -22
- package/dist/utils/open-browser.js.map +0 -1
- package/dist/utils/paths.d.ts +0 -34
- package/dist/utils/paths.d.ts.map +0 -1
- package/dist/utils/paths.js +0 -115
- package/dist/utils/paths.js.map +0 -1
- package/dist/utils/photon.d.ts +0 -21
- package/dist/utils/photon.d.ts.map +0 -1
- package/dist/utils/photon.js +0 -121
- package/dist/utils/photon.js.map +0 -1
- package/dist/utils/pi-user-agent.d.ts +0 -2
- package/dist/utils/pi-user-agent.d.ts.map +0 -1
- package/dist/utils/pi-user-agent.js +0 -5
- package/dist/utils/pi-user-agent.js.map +0 -1
- package/dist/utils/shell.d.ts +0 -32
- package/dist/utils/shell.d.ts.map +0 -1
- package/dist/utils/shell.js +0 -189
- package/dist/utils/shell.js.map +0 -1
- package/dist/utils/sleep.d.ts +0 -5
- package/dist/utils/sleep.d.ts.map +0 -1
- package/dist/utils/sleep.js +0 -17
- package/dist/utils/sleep.js.map +0 -1
- package/dist/utils/syntax-highlight.d.ts +0 -13
- package/dist/utils/syntax-highlight.d.ts.map +0 -1
- package/dist/utils/syntax-highlight.js +0 -184
- package/dist/utils/syntax-highlight.js.map +0 -1
- package/dist/utils/text.d.ts +0 -8
- package/dist/utils/text.d.ts.map +0 -1
- package/dist/utils/text.js +0 -9
- package/dist/utils/text.js.map +0 -1
- package/dist/utils/tool-result-images.d.ts +0 -21
- package/dist/utils/tool-result-images.d.ts.map +0 -1
- package/dist/utils/tool-result-images.js +0 -48
- package/dist/utils/tool-result-images.js.map +0 -1
- package/dist/utils/tools-manager.d.ts +0 -13
- package/dist/utils/tools-manager.d.ts.map +0 -1
- package/dist/utils/tools-manager.js +0 -343
- package/dist/utils/tools-manager.js.map +0 -1
- package/dist/utils/version-check.d.ts +0 -19
- package/dist/utils/version-check.d.ts.map +0 -1
- package/dist/utils/version-check.js +0 -72
- package/dist/utils/version-check.js.map +0 -1
- package/dist/utils/windows-self-update.d.ts +0 -3
- package/dist/utils/windows-self-update.d.ts.map +0 -1
- package/dist/utils/windows-self-update.js +0 -77
- package/dist/utils/windows-self-update.js.map +0 -1
- package/dist/utils/wsl.d.ts +0 -3
- package/dist/utils/wsl.d.ts.map +0 -1
- package/dist/utils/wsl.js +0 -15
- package/dist/utils/wsl.js.map +0 -1
- package/dist/utils/zip.d.ts +0 -7
- package/dist/utils/zip.d.ts.map +0 -1
- package/dist/utils/zip.js +0 -60
- package/dist/utils/zip.js.map +0 -1
|
@@ -1,1008 +0,0 @@
|
|
|
1
|
-
import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
|
|
2
|
-
import { basename, dirname, join, resolve, sep } from "node:path";
|
|
3
|
-
import { detectCapabilities, getTerminalColorMode } from "@earendil-works/pi-tui";
|
|
4
|
-
import chalk from "chalk";
|
|
5
|
-
import { APP_NAME, CONFIG_DIR_NAME } from "../config.js";
|
|
6
|
-
import { loadThemeFromPath } from "../modes/interactive/theme/theme.js";
|
|
7
|
-
import { canonicalizePath, isLocalPath, resolvePath } from "../utils/paths.js";
|
|
8
|
-
import { stripBom } from "../utils/text.js";
|
|
9
|
-
import { createEventBus } from "./event-bus.js";
|
|
10
|
-
import { clearExtensionCache, createExtensionRuntime, loadExtensionFromFactory, loadExtensionsCached, } from "./extensions/loader.js";
|
|
11
|
-
import { findGitPaths } from "./footer-data-provider.js";
|
|
12
|
-
import { DefaultPackageManager } from "./package-manager.js";
|
|
13
|
-
import { loadPromptTemplates } from "./prompt-templates.js";
|
|
14
|
-
import { SettingsManager } from "./settings-manager.js";
|
|
15
|
-
import { loadSkills } from "./skills.js";
|
|
16
|
-
import { BUILTIN_PATH_PREFIX, createSourceInfo, getSyntheticPathSource, isSyntheticPath, } from "./source-info.js";
|
|
17
|
-
import { resetTimings } from "./timings.js";
|
|
18
|
-
const HOST_PROVIDED_EXTENSION_PACKAGES = new Set([
|
|
19
|
-
"@earendil-works/pi-agent-core",
|
|
20
|
-
"@earendil-works/pi-ai",
|
|
21
|
-
"@earendil-works/pi-coding-agent",
|
|
22
|
-
"@earendil-works/pi-tui",
|
|
23
|
-
"@mariozechner/pi-agent-core",
|
|
24
|
-
"@mariozechner/pi-ai",
|
|
25
|
-
"@mariozechner/pi-coding-agent",
|
|
26
|
-
"@mariozechner/pi-tui",
|
|
27
|
-
"@sinclair/typebox",
|
|
28
|
-
"typebox",
|
|
29
|
-
]);
|
|
30
|
-
function collectExtensionPackageWarnings(extensionPaths, metadataByPath) {
|
|
31
|
-
const warnings = [];
|
|
32
|
-
const packageRoots = new Set(extensionPaths
|
|
33
|
-
.map((extensionPath) => metadataByPath.get(extensionPath)?.packageRoot)
|
|
34
|
-
.filter((packageRoot) => packageRoot !== undefined));
|
|
35
|
-
for (const packageRoot of packageRoots) {
|
|
36
|
-
const packageJsonPath = join(packageRoot, "package.json");
|
|
37
|
-
if (!existsSync(packageJsonPath))
|
|
38
|
-
continue;
|
|
39
|
-
const manifest = JSON.parse(stripBom(readFileSync(packageJsonPath, "utf-8")));
|
|
40
|
-
if (typeof manifest.dependencies !== "object" ||
|
|
41
|
-
manifest.dependencies === null ||
|
|
42
|
-
Array.isArray(manifest.dependencies)) {
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
|
-
const hostDependencies = Object.keys(manifest.dependencies)
|
|
46
|
-
.filter((name) => HOST_PROVIDED_EXTENSION_PACKAGES.has(name))
|
|
47
|
-
.sort();
|
|
48
|
-
if (hostDependencies.length === 0)
|
|
49
|
-
continue;
|
|
50
|
-
warnings.push({
|
|
51
|
-
path: packageJsonPath,
|
|
52
|
-
warning: `Host-provided extension packages must be declared in peerDependencies with a "*" range, not dependencies: ${hostDependencies.join(", ")}. Installed copies can bypass the extension loader and create duplicate runtime modules.`,
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
return warnings;
|
|
56
|
-
}
|
|
57
|
-
function mergeExtensionWarnings(result, warnings) {
|
|
58
|
-
result.warnings = [
|
|
59
|
-
...new Map([...(result.warnings ?? []), ...warnings].map((warning) => [warning.path, warning])).values(),
|
|
60
|
-
];
|
|
61
|
-
}
|
|
62
|
-
/** Built-in extensions supply the code of `builtin:<name>` extension paths (see `InlineExtension`). */
|
|
63
|
-
export function isBuiltinExtension(input) {
|
|
64
|
-
return typeof input !== "function" && input.builtin === true;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Leave out replaceable extensions (see `InlineExtension`) that share a tool, command, or flag name
|
|
68
|
-
* with another extension, instead of reporting a conflict.
|
|
69
|
-
*/
|
|
70
|
-
function omitReplacedExtensions(extensions, warnings) {
|
|
71
|
-
const names = (extension) => [
|
|
72
|
-
...[...extension.tools.keys()].map((name) => `tool:${name}`),
|
|
73
|
-
...[...extension.commands.keys()].map((name) => `command:${name}`),
|
|
74
|
-
...[...extension.flags.keys()].map((name) => `flag:${name}`),
|
|
75
|
-
];
|
|
76
|
-
const taken = new Map(extensions
|
|
77
|
-
.filter((extension) => !extension.replaceable)
|
|
78
|
-
.flatMap((extension) => names(extension).map((name) => [name, extension])));
|
|
79
|
-
return extensions.filter((extension) => {
|
|
80
|
-
if (!extension.replaceable)
|
|
81
|
-
return true;
|
|
82
|
-
const replacement = names(extension)
|
|
83
|
-
.map((name) => ({ name, extension: taken.get(name) }))
|
|
84
|
-
.find((value) => value.extension !== undefined);
|
|
85
|
-
if (!replacement)
|
|
86
|
-
return true;
|
|
87
|
-
if (extension.path.startsWith(BUILTIN_PATH_PREFIX)) {
|
|
88
|
-
const builtinName = extension.path.slice(BUILTIN_PATH_PREFIX.length);
|
|
89
|
-
const [kind, rawName] = replacement.name.split(":", 2);
|
|
90
|
-
const registeredName = kind === "command" ? `/${rawName}` : kind === "flag" ? `--${rawName}` : rawName;
|
|
91
|
-
warnings?.push({
|
|
92
|
-
path: extension.path,
|
|
93
|
-
warning: `Extension ${replacement.extension.path} registers ${kind} \`${registeredName}\`, so built-in extension \`${builtinName}\` was not loaded. To use \`${builtinName}\`, run \`${APP_NAME} config\` and make sure it is enabled under Built-in extensions, then disable or remove the existing extension. We recommend only having one or the other loaded at a time.`,
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
return false;
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
function resolvePromptInput(input, description) {
|
|
100
|
-
if (!input) {
|
|
101
|
-
return undefined;
|
|
102
|
-
}
|
|
103
|
-
if (existsSync(input)) {
|
|
104
|
-
try {
|
|
105
|
-
return stripBom(readFileSync(input, "utf-8"));
|
|
106
|
-
}
|
|
107
|
-
catch (error) {
|
|
108
|
-
console.error(chalk.yellow(`Warning: Could not read ${description} file ${input}: ${error}`));
|
|
109
|
-
return input;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return input;
|
|
113
|
-
}
|
|
114
|
-
function loadContextFileFromDir(dir) {
|
|
115
|
-
const candidates = ["AGENTS.override.md", "AGENTS.md", "AGENTS.MD", "CLAUDE.md", "CLAUDE.MD"];
|
|
116
|
-
for (const filename of candidates) {
|
|
117
|
-
const filePath = join(dir, filename);
|
|
118
|
-
if (existsSync(filePath)) {
|
|
119
|
-
try {
|
|
120
|
-
if (!statSync(filePath).isFile()) {
|
|
121
|
-
continue;
|
|
122
|
-
}
|
|
123
|
-
return {
|
|
124
|
-
path: filePath,
|
|
125
|
-
content: stripBom(readFileSync(filePath, "utf-8")),
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
catch (error) {
|
|
129
|
-
console.error(chalk.yellow(`Warning: Could not read ${filePath}: ${error}`));
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* The main repo's context file that a nested linked worktree's own copy shadows: both
|
|
137
|
-
* occupy the same logical repository scope, so loading both applies that context twice. Returns
|
|
138
|
-
* undefined when nothing is shadowed, leaving normal ancestor inheritance alone.
|
|
139
|
-
*
|
|
140
|
-
* Returned canonicalized (realpath), because `git worktree add` writes the `.git`
|
|
141
|
-
* file's `gitdir:` target in realpath form while cwd may still be symlinked
|
|
142
|
-
* (macOS `/tmp` -> `/private/tmp`).
|
|
143
|
-
*/
|
|
144
|
-
function findShadowedContextFile(cwd) {
|
|
145
|
-
const gitPaths = findGitPaths(cwd);
|
|
146
|
-
if (!gitPaths)
|
|
147
|
-
return undefined;
|
|
148
|
-
const commonGitDir = canonicalizePath(gitPaths.commonGitDir);
|
|
149
|
-
const worktreeRoot = canonicalizePath(gitPaths.repoDir);
|
|
150
|
-
const mainRepoRoot = dirname(commonGitDir);
|
|
151
|
-
// False for an ordinary repo, where the two are the same dir, and for a sibling
|
|
152
|
-
// worktree (`git worktree add ../feat`), whose main repo is not an ancestor.
|
|
153
|
-
if (!worktreeRoot.startsWith(`${mainRepoRoot}${sep}`))
|
|
154
|
-
return undefined;
|
|
155
|
-
// dirname of the common git dir is the main worktree root only when that dir is
|
|
156
|
-
// itself checked out from the same repo. In a bare layout (`proj/.bare` +
|
|
157
|
-
// `proj/main`) it is just the directory holding `.bare`, which tracks nothing; a
|
|
158
|
-
// submodule's gitdir has no `commondir`, so it lands under `.git/modules`.
|
|
159
|
-
if (canonicalizePath(join(mainRepoRoot, ".git")) !== commonGitDir)
|
|
160
|
-
return undefined;
|
|
161
|
-
const worktreeContextFile = loadContextFileFromDir(worktreeRoot);
|
|
162
|
-
return worktreeContextFile ? join(mainRepoRoot, basename(worktreeContextFile.path)) : undefined;
|
|
163
|
-
}
|
|
164
|
-
export function loadProjectContextFiles(options) {
|
|
165
|
-
const resolvedCwd = resolvePath(options.cwd);
|
|
166
|
-
const resolvedAgentDir = resolvePath(options.agentDir);
|
|
167
|
-
const contextFiles = [];
|
|
168
|
-
const seenPaths = new Set();
|
|
169
|
-
const globalContext = loadContextFileFromDir(resolvedAgentDir);
|
|
170
|
-
if (globalContext) {
|
|
171
|
-
contextFiles.push(globalContext);
|
|
172
|
-
seenPaths.add(globalContext.path);
|
|
173
|
-
}
|
|
174
|
-
const ancestorContextFiles = [];
|
|
175
|
-
const shadowedContextFile = findShadowedContextFile(resolvedCwd);
|
|
176
|
-
let currentDir = resolvedCwd;
|
|
177
|
-
while (true) {
|
|
178
|
-
const contextFile = loadContextFileFromDir(currentDir);
|
|
179
|
-
// Compare the directory's real path, not the file's: a worktree AGENTS.md that
|
|
180
|
-
// symlinks to the main repo's file resolves to the shadowed path itself.
|
|
181
|
-
const isShadowed = shadowedContextFile !== undefined &&
|
|
182
|
-
contextFile !== null &&
|
|
183
|
-
join(canonicalizePath(currentDir), basename(contextFile.path)) === shadowedContextFile;
|
|
184
|
-
if (contextFile && !isShadowed && !seenPaths.has(contextFile.path)) {
|
|
185
|
-
ancestorContextFiles.unshift(contextFile);
|
|
186
|
-
seenPaths.add(contextFile.path);
|
|
187
|
-
}
|
|
188
|
-
const parentDir = dirname(currentDir);
|
|
189
|
-
if (parentDir === currentDir)
|
|
190
|
-
break;
|
|
191
|
-
currentDir = parentDir;
|
|
192
|
-
}
|
|
193
|
-
contextFiles.push(...ancestorContextFiles);
|
|
194
|
-
return contextFiles;
|
|
195
|
-
}
|
|
196
|
-
export class DefaultResourceLoader {
|
|
197
|
-
cwd;
|
|
198
|
-
agentDir;
|
|
199
|
-
settingsManager;
|
|
200
|
-
eventBus;
|
|
201
|
-
packageManager;
|
|
202
|
-
additionalExtensionPaths;
|
|
203
|
-
additionalSkillPaths;
|
|
204
|
-
additionalPromptTemplatePaths;
|
|
205
|
-
additionalThemePaths;
|
|
206
|
-
extensionFactories;
|
|
207
|
-
builtinExtensions;
|
|
208
|
-
noExtensions;
|
|
209
|
-
noSkills;
|
|
210
|
-
noPromptTemplates;
|
|
211
|
-
noThemes;
|
|
212
|
-
noContextFiles;
|
|
213
|
-
systemPromptSource;
|
|
214
|
-
appendSystemPromptSource;
|
|
215
|
-
extensionsOverride;
|
|
216
|
-
skillsOverride;
|
|
217
|
-
promptsOverride;
|
|
218
|
-
themesOverride;
|
|
219
|
-
agentsFilesOverride;
|
|
220
|
-
systemPromptOverride;
|
|
221
|
-
appendSystemPromptOverride;
|
|
222
|
-
extensionsResult;
|
|
223
|
-
skills;
|
|
224
|
-
skillDiagnostics;
|
|
225
|
-
prompts;
|
|
226
|
-
promptDiagnostics;
|
|
227
|
-
themes;
|
|
228
|
-
themeDiagnostics;
|
|
229
|
-
agentsFiles;
|
|
230
|
-
systemPrompt;
|
|
231
|
-
systemPromptSourcePath;
|
|
232
|
-
appendSystemPrompt;
|
|
233
|
-
appendSystemPromptSourcePaths;
|
|
234
|
-
lastSkillPaths;
|
|
235
|
-
extensionSkillSourceInfos;
|
|
236
|
-
extensionPromptSourceInfos;
|
|
237
|
-
extensionThemeSourceInfos;
|
|
238
|
-
resourceMetadataByPath;
|
|
239
|
-
lastPromptPaths;
|
|
240
|
-
lastThemePaths;
|
|
241
|
-
loaded;
|
|
242
|
-
constructor(options) {
|
|
243
|
-
this.cwd = resolvePath(options.cwd);
|
|
244
|
-
this.agentDir = resolvePath(options.agentDir);
|
|
245
|
-
this.settingsManager = options.settingsManager ?? SettingsManager.create(this.cwd, this.agentDir);
|
|
246
|
-
this.eventBus = options.eventBus ?? createEventBus();
|
|
247
|
-
const factories = options.extensionFactories ?? [];
|
|
248
|
-
this.extensionFactories = factories.filter((input) => !isBuiltinExtension(input));
|
|
249
|
-
this.builtinExtensions = new Map(factories.filter(isBuiltinExtension).map((input) => [input.name, input]));
|
|
250
|
-
this.packageManager = new DefaultPackageManager({
|
|
251
|
-
cwd: this.cwd,
|
|
252
|
-
agentDir: this.agentDir,
|
|
253
|
-
settingsManager: this.settingsManager,
|
|
254
|
-
builtinExtensions: [...this.builtinExtensions.keys()],
|
|
255
|
-
});
|
|
256
|
-
this.additionalExtensionPaths = options.additionalExtensionPaths ?? [];
|
|
257
|
-
this.additionalSkillPaths = options.additionalSkillPaths ?? [];
|
|
258
|
-
this.additionalPromptTemplatePaths = options.additionalPromptTemplatePaths ?? [];
|
|
259
|
-
this.additionalThemePaths = options.additionalThemePaths ?? [];
|
|
260
|
-
this.noExtensions = options.noExtensions ?? false;
|
|
261
|
-
this.noSkills = options.noSkills ?? false;
|
|
262
|
-
this.noPromptTemplates = options.noPromptTemplates ?? false;
|
|
263
|
-
this.noThemes = options.noThemes ?? false;
|
|
264
|
-
this.noContextFiles = options.noContextFiles ?? false;
|
|
265
|
-
this.systemPromptSource = options.systemPrompt;
|
|
266
|
-
this.appendSystemPromptSource = options.appendSystemPrompt;
|
|
267
|
-
this.extensionsOverride = options.extensionsOverride;
|
|
268
|
-
this.skillsOverride = options.skillsOverride;
|
|
269
|
-
this.promptsOverride = options.promptsOverride;
|
|
270
|
-
this.themesOverride = options.themesOverride;
|
|
271
|
-
this.agentsFilesOverride = options.agentsFilesOverride;
|
|
272
|
-
this.systemPromptOverride = options.systemPromptOverride;
|
|
273
|
-
this.appendSystemPromptOverride = options.appendSystemPromptOverride;
|
|
274
|
-
this.extensionsResult = { extensions: [], errors: [], runtime: createExtensionRuntime() };
|
|
275
|
-
this.skills = [];
|
|
276
|
-
this.skillDiagnostics = [];
|
|
277
|
-
this.prompts = [];
|
|
278
|
-
this.promptDiagnostics = [];
|
|
279
|
-
this.themes = [];
|
|
280
|
-
this.themeDiagnostics = [];
|
|
281
|
-
this.agentsFiles = [];
|
|
282
|
-
this.appendSystemPrompt = [];
|
|
283
|
-
this.appendSystemPromptSourcePaths = [];
|
|
284
|
-
this.lastSkillPaths = [];
|
|
285
|
-
this.extensionSkillSourceInfos = new Map();
|
|
286
|
-
this.extensionPromptSourceInfos = new Map();
|
|
287
|
-
this.extensionThemeSourceInfos = new Map();
|
|
288
|
-
this.resourceMetadataByPath = new Map();
|
|
289
|
-
this.lastPromptPaths = [];
|
|
290
|
-
this.lastThemePaths = [];
|
|
291
|
-
this.loaded = false;
|
|
292
|
-
}
|
|
293
|
-
getExtensions() {
|
|
294
|
-
return this.extensionsResult;
|
|
295
|
-
}
|
|
296
|
-
getSkills() {
|
|
297
|
-
return { skills: this.skills, diagnostics: this.skillDiagnostics };
|
|
298
|
-
}
|
|
299
|
-
getPrompts() {
|
|
300
|
-
return { prompts: this.prompts, diagnostics: this.promptDiagnostics };
|
|
301
|
-
}
|
|
302
|
-
getThemes() {
|
|
303
|
-
return { themes: this.themes, diagnostics: this.themeDiagnostics };
|
|
304
|
-
}
|
|
305
|
-
getAgentsFiles() {
|
|
306
|
-
return { agentsFiles: this.agentsFiles };
|
|
307
|
-
}
|
|
308
|
-
getSystemPrompt() {
|
|
309
|
-
return this.systemPrompt;
|
|
310
|
-
}
|
|
311
|
-
getSystemPromptSource() {
|
|
312
|
-
return this.systemPromptSourcePath ? { path: this.systemPromptSourcePath } : undefined;
|
|
313
|
-
}
|
|
314
|
-
getAppendSystemPrompt() {
|
|
315
|
-
return this.appendSystemPrompt;
|
|
316
|
-
}
|
|
317
|
-
getAppendSystemPromptSources() {
|
|
318
|
-
return this.appendSystemPromptSourcePaths.map((path) => ({ path }));
|
|
319
|
-
}
|
|
320
|
-
extendResources(paths) {
|
|
321
|
-
const skillPaths = this.normalizeExtensionPaths(paths.skillPaths ?? []);
|
|
322
|
-
const promptPaths = this.normalizeExtensionPaths(paths.promptPaths ?? []);
|
|
323
|
-
const themePaths = this.normalizeExtensionPaths(paths.themePaths ?? []);
|
|
324
|
-
for (const entry of skillPaths) {
|
|
325
|
-
this.extensionSkillSourceInfos.set(entry.path, createSourceInfo(entry.path, entry.metadata));
|
|
326
|
-
}
|
|
327
|
-
for (const entry of promptPaths) {
|
|
328
|
-
this.extensionPromptSourceInfos.set(entry.path, createSourceInfo(entry.path, entry.metadata));
|
|
329
|
-
}
|
|
330
|
-
for (const entry of themePaths) {
|
|
331
|
-
this.extensionThemeSourceInfos.set(entry.path, createSourceInfo(entry.path, entry.metadata));
|
|
332
|
-
}
|
|
333
|
-
if (skillPaths.length > 0) {
|
|
334
|
-
this.lastSkillPaths = this.mergePaths(this.lastSkillPaths, skillPaths.map((entry) => entry.path));
|
|
335
|
-
this.updateSkillsFromPaths(this.lastSkillPaths, this.resourceMetadataByPath);
|
|
336
|
-
}
|
|
337
|
-
if (promptPaths.length > 0) {
|
|
338
|
-
this.lastPromptPaths = this.mergePaths(this.lastPromptPaths, promptPaths.map((entry) => entry.path));
|
|
339
|
-
this.updatePromptsFromPaths(this.lastPromptPaths, this.resourceMetadataByPath);
|
|
340
|
-
}
|
|
341
|
-
if (themePaths.length > 0) {
|
|
342
|
-
this.lastThemePaths = this.mergePaths(this.lastThemePaths, themePaths.map((entry) => entry.path));
|
|
343
|
-
this.updateThemesFromPaths(this.lastThemePaths, this.resourceMetadataByPath);
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
async loadProjectTrustExtensions() {
|
|
347
|
-
// Force untrusted project settings for the bootstrap pass. This keeps project-local
|
|
348
|
-
// extensions/packages out while still loading user/global and temporary CLI extensions.
|
|
349
|
-
this.settingsManager.setProjectTrusted(false);
|
|
350
|
-
await this.settingsManager.reload();
|
|
351
|
-
return this.loadCurrentExtensionSet({ includeInlineFactories: true });
|
|
352
|
-
}
|
|
353
|
-
async reload(options) {
|
|
354
|
-
resetTimings("extensions");
|
|
355
|
-
if (this.loaded) {
|
|
356
|
-
clearExtensionCache();
|
|
357
|
-
}
|
|
358
|
-
let preTrustExtensions;
|
|
359
|
-
if (options?.resolveProjectTrust) {
|
|
360
|
-
preTrustExtensions = await this.loadProjectTrustExtensions();
|
|
361
|
-
const projectTrusted = await options.resolveProjectTrust({ extensionsResult: preTrustExtensions });
|
|
362
|
-
this.settingsManager.setProjectTrusted(projectTrusted);
|
|
363
|
-
}
|
|
364
|
-
// reload() preserves SettingsManager.projectTrusted and reloads settings for that trust state.
|
|
365
|
-
await this.settingsManager.reload();
|
|
366
|
-
const resolvedPaths = await this.packageManager.resolve();
|
|
367
|
-
const cliExtensionPaths = await this.packageManager.resolveExtensionSources(this.additionalExtensionPaths, {
|
|
368
|
-
temporary: true,
|
|
369
|
-
});
|
|
370
|
-
// Kept on the instance so post-reload passes (extendResources) can still resolve package metadata.
|
|
371
|
-
this.resourceMetadataByPath = new Map();
|
|
372
|
-
const metadataByPath = this.resourceMetadataByPath;
|
|
373
|
-
this.extensionSkillSourceInfos = new Map();
|
|
374
|
-
this.extensionPromptSourceInfos = new Map();
|
|
375
|
-
this.extensionThemeSourceInfos = new Map();
|
|
376
|
-
// Helper to extract enabled paths and store metadata
|
|
377
|
-
const getEnabledResources = (resources) => {
|
|
378
|
-
for (const r of resources) {
|
|
379
|
-
if (!metadataByPath.has(r.path)) {
|
|
380
|
-
metadataByPath.set(r.path, r.metadata);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
return resources.filter((r) => r.enabled);
|
|
384
|
-
};
|
|
385
|
-
const getEnabledPaths = (resources) => getEnabledResources(resources).map((r) => r.path);
|
|
386
|
-
const enabledExtensions = getEnabledPaths(resolvedPaths.extensions);
|
|
387
|
-
const enabledSkillResources = getEnabledResources(resolvedPaths.skills);
|
|
388
|
-
const enabledPrompts = getEnabledPaths(resolvedPaths.prompts);
|
|
389
|
-
const enabledThemes = getEnabledPaths(resolvedPaths.themes);
|
|
390
|
-
const enabledSkills = enabledSkillResources.map((resource) => this.mapSkillPath(resource, metadataByPath));
|
|
391
|
-
// Add CLI paths metadata
|
|
392
|
-
for (const r of cliExtensionPaths.extensions) {
|
|
393
|
-
if (!metadataByPath.has(r.path)) {
|
|
394
|
-
metadataByPath.set(r.path, { source: "cli", scope: "temporary", origin: "top-level" });
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
for (const r of cliExtensionPaths.skills) {
|
|
398
|
-
if (!metadataByPath.has(r.path)) {
|
|
399
|
-
metadataByPath.set(r.path, { source: "cli", scope: "temporary", origin: "top-level" });
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
const cliEnabledExtensions = getEnabledPaths(cliExtensionPaths.extensions);
|
|
403
|
-
const cliEnabledSkills = getEnabledPaths(cliExtensionPaths.skills);
|
|
404
|
-
const cliEnabledPrompts = getEnabledPaths(cliExtensionPaths.prompts);
|
|
405
|
-
const cliEnabledThemes = getEnabledPaths(cliExtensionPaths.themes);
|
|
406
|
-
const extensionPaths = this.noExtensions
|
|
407
|
-
? cliEnabledExtensions
|
|
408
|
-
: this.mergePaths(cliEnabledExtensions, enabledExtensions);
|
|
409
|
-
const packageWarnings = collectExtensionPackageWarnings(extensionPaths, metadataByPath);
|
|
410
|
-
const extensionsResult = await this.loadFinalExtensionSet(extensionPaths, preTrustExtensions);
|
|
411
|
-
mergeExtensionWarnings(extensionsResult, packageWarnings);
|
|
412
|
-
for (const p of this.additionalExtensionPaths) {
|
|
413
|
-
if (isLocalPath(p)) {
|
|
414
|
-
const resolved = this.resolveResourcePath(p);
|
|
415
|
-
if (!existsSync(resolved)) {
|
|
416
|
-
extensionsResult.errors.push({ path: resolved, error: `Extension path does not exist: ${resolved}` });
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
this.extensionsResult = this.extensionsOverride ? this.extensionsOverride(extensionsResult) : extensionsResult;
|
|
421
|
-
this.applyExtensionSourceInfo(this.extensionsResult.extensions, metadataByPath);
|
|
422
|
-
const skillPaths = this.noSkills
|
|
423
|
-
? this.mergePaths(cliEnabledSkills, this.additionalSkillPaths)
|
|
424
|
-
: this.mergePaths([...cliEnabledSkills, ...enabledSkills], this.additionalSkillPaths);
|
|
425
|
-
this.lastSkillPaths = skillPaths;
|
|
426
|
-
this.updateSkillsFromPaths(skillPaths, metadataByPath);
|
|
427
|
-
for (const p of this.additionalSkillPaths) {
|
|
428
|
-
if (isLocalPath(p)) {
|
|
429
|
-
const resolved = this.resolveResourcePath(p);
|
|
430
|
-
if (!existsSync(resolved) && !this.skillDiagnostics.some((d) => d.path === resolved)) {
|
|
431
|
-
this.skillDiagnostics.push({ type: "error", message: "Skill path does not exist", path: resolved });
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
const promptPaths = this.noPromptTemplates
|
|
436
|
-
? this.mergePaths(cliEnabledPrompts, this.additionalPromptTemplatePaths)
|
|
437
|
-
: this.mergePaths([...cliEnabledPrompts, ...enabledPrompts], this.additionalPromptTemplatePaths);
|
|
438
|
-
this.lastPromptPaths = promptPaths;
|
|
439
|
-
this.updatePromptsFromPaths(promptPaths, metadataByPath);
|
|
440
|
-
for (const p of this.additionalPromptTemplatePaths) {
|
|
441
|
-
if (isLocalPath(p)) {
|
|
442
|
-
const resolved = this.resolveResourcePath(p);
|
|
443
|
-
if (!existsSync(resolved) && !this.promptDiagnostics.some((d) => d.path === resolved)) {
|
|
444
|
-
this.promptDiagnostics.push({
|
|
445
|
-
type: "error",
|
|
446
|
-
message: "Prompt template path does not exist",
|
|
447
|
-
path: resolved,
|
|
448
|
-
});
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
const themePaths = this.noThemes
|
|
453
|
-
? this.mergePaths(cliEnabledThemes, this.additionalThemePaths)
|
|
454
|
-
: this.mergePaths([...cliEnabledThemes, ...enabledThemes], this.additionalThemePaths);
|
|
455
|
-
this.lastThemePaths = themePaths;
|
|
456
|
-
this.updateThemesFromPaths(themePaths, metadataByPath);
|
|
457
|
-
for (const p of this.additionalThemePaths) {
|
|
458
|
-
const resolved = this.resolveResourcePath(p);
|
|
459
|
-
if (!existsSync(resolved) && !this.themeDiagnostics.some((d) => d.path === resolved)) {
|
|
460
|
-
this.themeDiagnostics.push({ type: "error", message: "Theme path does not exist", path: resolved });
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
const agentsFiles = {
|
|
464
|
-
agentsFiles: this.noContextFiles
|
|
465
|
-
? []
|
|
466
|
-
: loadProjectContextFiles({
|
|
467
|
-
cwd: this.cwd,
|
|
468
|
-
agentDir: this.agentDir,
|
|
469
|
-
}),
|
|
470
|
-
};
|
|
471
|
-
const resolvedAgentsFiles = this.agentsFilesOverride ? this.agentsFilesOverride(agentsFiles) : agentsFiles;
|
|
472
|
-
this.agentsFiles = resolvedAgentsFiles.agentsFiles;
|
|
473
|
-
const systemPromptSource = this.systemPromptSource ?? this.discoverSystemPromptFile();
|
|
474
|
-
const baseSystemPrompt = resolvePromptInput(systemPromptSource, "system prompt");
|
|
475
|
-
this.systemPrompt = this.systemPromptOverride ? this.systemPromptOverride(baseSystemPrompt) : baseSystemPrompt;
|
|
476
|
-
this.systemPromptSourcePath =
|
|
477
|
-
systemPromptSource && existsSync(systemPromptSource) ? resolvePath(systemPromptSource) : undefined;
|
|
478
|
-
let appendSources = this.appendSystemPromptSource;
|
|
479
|
-
if (!appendSources) {
|
|
480
|
-
const discoveredAppendSystemPromptFile = this.discoverAppendSystemPromptFile();
|
|
481
|
-
appendSources = discoveredAppendSystemPromptFile ? [discoveredAppendSystemPromptFile] : [];
|
|
482
|
-
}
|
|
483
|
-
const baseAppend = appendSources
|
|
484
|
-
.map((s) => resolvePromptInput(s, "append system prompt"))
|
|
485
|
-
.filter((s) => s !== undefined);
|
|
486
|
-
this.appendSystemPrompt = this.appendSystemPromptOverride
|
|
487
|
-
? this.appendSystemPromptOverride(baseAppend)
|
|
488
|
-
: baseAppend;
|
|
489
|
-
this.appendSystemPromptSourcePaths = appendSources
|
|
490
|
-
.filter((source) => existsSync(source))
|
|
491
|
-
.map((source) => resolvePath(source));
|
|
492
|
-
this.loaded = true;
|
|
493
|
-
}
|
|
494
|
-
async loadCurrentExtensionSet(options) {
|
|
495
|
-
const resolvedPaths = await this.packageManager.resolve();
|
|
496
|
-
const cliExtensionPaths = await this.packageManager.resolveExtensionSources(this.additionalExtensionPaths, {
|
|
497
|
-
temporary: true,
|
|
498
|
-
});
|
|
499
|
-
const enabledExtensions = resolvedPaths.extensions.filter((r) => r.enabled).map((r) => r.path);
|
|
500
|
-
const cliEnabledExtensions = cliExtensionPaths.extensions.filter((r) => r.enabled).map((r) => r.path);
|
|
501
|
-
// Built-in extensions wait for the final pass: project settings can disable them, and a loaded
|
|
502
|
-
// extension cannot be unloaded.
|
|
503
|
-
const extensionPaths = (this.noExtensions ? cliEnabledExtensions : this.mergePaths(cliEnabledExtensions, enabledExtensions)).filter((path) => !path.startsWith(BUILTIN_PATH_PREFIX));
|
|
504
|
-
const metadataByPath = new Map([...resolvedPaths.extensions, ...cliExtensionPaths.extensions].map((resource) => [
|
|
505
|
-
resource.path,
|
|
506
|
-
resource.metadata,
|
|
507
|
-
]));
|
|
508
|
-
const packageWarnings = collectExtensionPackageWarnings(extensionPaths, metadataByPath);
|
|
509
|
-
const extensionsResult = await loadExtensionsCached(extensionPaths, this.cwd, this.eventBus);
|
|
510
|
-
mergeExtensionWarnings(extensionsResult, packageWarnings);
|
|
511
|
-
if (!options.includeInlineFactories) {
|
|
512
|
-
return extensionsResult;
|
|
513
|
-
}
|
|
514
|
-
const inlineExtensions = await this.loadExtensionFactories(extensionsResult.runtime);
|
|
515
|
-
extensionsResult.extensions.push(...inlineExtensions.extensions);
|
|
516
|
-
extensionsResult.errors.push(...inlineExtensions.errors);
|
|
517
|
-
const replacementWarnings = [];
|
|
518
|
-
extensionsResult.extensions = omitReplacedExtensions(extensionsResult.extensions, replacementWarnings);
|
|
519
|
-
mergeExtensionWarnings(extensionsResult, replacementWarnings);
|
|
520
|
-
return extensionsResult;
|
|
521
|
-
}
|
|
522
|
-
resolveExtensionLoadPath(path) {
|
|
523
|
-
return isSyntheticPath(path) ? path : resolvePath(path, this.cwd, { normalizeUnicodeSpaces: true });
|
|
524
|
-
}
|
|
525
|
-
/** Load extension paths: files from disk and `builtin:<name>` paths from the built-in extensions. */
|
|
526
|
-
async loadExtensionPaths(paths, runtime) {
|
|
527
|
-
const isBuiltinPath = (path) => path.startsWith(BUILTIN_PATH_PREFIX);
|
|
528
|
-
const result = await loadExtensionsCached(paths.filter((path) => !isBuiltinPath(path)), this.cwd, this.eventBus, runtime);
|
|
529
|
-
for (const path of paths.filter(isBuiltinPath)) {
|
|
530
|
-
const builtin = this.builtinExtensions.get(path.slice(BUILTIN_PATH_PREFIX.length));
|
|
531
|
-
if (!builtin) {
|
|
532
|
-
result.errors.push({ path, error: `Unknown built-in extension: ${path}` });
|
|
533
|
-
continue;
|
|
534
|
-
}
|
|
535
|
-
try {
|
|
536
|
-
const extension = await loadExtensionFromFactory(builtin.factory, this.cwd, this.eventBus, result.runtime, path);
|
|
537
|
-
extension.hidden = true;
|
|
538
|
-
extension.replaceable = builtin.replaceable === true;
|
|
539
|
-
result.extensions.push(extension);
|
|
540
|
-
}
|
|
541
|
-
catch (error) {
|
|
542
|
-
result.errors.push({ path, error: error instanceof Error ? error.message : "failed to load extension" });
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
return result;
|
|
546
|
-
}
|
|
547
|
-
async loadFinalExtensionSet(extensionPaths, preTrustExtensions) {
|
|
548
|
-
// Without a pre-trust pass nothing is preloaded, and inline extensions load here.
|
|
549
|
-
const preloaded = preTrustExtensions?.extensions ?? [];
|
|
550
|
-
const preloadedByPath = new Map(preloaded
|
|
551
|
-
.filter((extension) => !extension.path.startsWith("<inline:"))
|
|
552
|
-
.map((extension) => [extension.resolvedPath, extension]));
|
|
553
|
-
const failedPreloadPaths = new Set((preTrustExtensions?.errors ?? []).map((error) => this.resolveExtensionLoadPath(error.path)));
|
|
554
|
-
const remainingPaths = extensionPaths.filter((path) => {
|
|
555
|
-
const resolvedPath = this.resolveExtensionLoadPath(path);
|
|
556
|
-
return !preloadedByPath.has(resolvedPath) && !failedPreloadPaths.has(resolvedPath);
|
|
557
|
-
});
|
|
558
|
-
const remainingExtensions = await this.loadExtensionPaths(remainingPaths, preTrustExtensions?.runtime);
|
|
559
|
-
const loadedByPath = new Map(preloadedByPath);
|
|
560
|
-
for (const extension of remainingExtensions.extensions) {
|
|
561
|
-
loadedByPath.set(extension.resolvedPath, extension);
|
|
562
|
-
}
|
|
563
|
-
const inlineExtensions = preTrustExtensions
|
|
564
|
-
? { extensions: preloaded.filter((extension) => extension.path.startsWith("<inline:")), errors: [] }
|
|
565
|
-
: await this.loadExtensionFactories(remainingExtensions.runtime);
|
|
566
|
-
const orderedExtensions = extensionPaths
|
|
567
|
-
.map((path) => loadedByPath.get(this.resolveExtensionLoadPath(path)))
|
|
568
|
-
.filter((extension) => extension !== undefined);
|
|
569
|
-
orderedExtensions.push(...inlineExtensions.extensions);
|
|
570
|
-
const replacementWarnings = [];
|
|
571
|
-
const extensionsResult = {
|
|
572
|
-
extensions: omitReplacedExtensions(orderedExtensions, replacementWarnings),
|
|
573
|
-
errors: [...(preTrustExtensions?.errors ?? []), ...remainingExtensions.errors, ...inlineExtensions.errors],
|
|
574
|
-
warnings: [...(preTrustExtensions?.warnings ?? []), ...(remainingExtensions.warnings ?? [])],
|
|
575
|
-
runtime: remainingExtensions.runtime,
|
|
576
|
-
};
|
|
577
|
-
mergeExtensionWarnings(extensionsResult, replacementWarnings);
|
|
578
|
-
this.addExtensionConflictDiagnostics(extensionsResult);
|
|
579
|
-
return extensionsResult;
|
|
580
|
-
}
|
|
581
|
-
addExtensionConflictDiagnostics(extensionsResult) {
|
|
582
|
-
// Detect extension conflicts (tools, commands, flags with same names from different extensions)
|
|
583
|
-
// Keep all extensions loaded. Conflicts are reported as diagnostics, and precedence is handled by load order.
|
|
584
|
-
const conflicts = this.detectExtensionConflicts(extensionsResult.extensions);
|
|
585
|
-
for (const conflict of conflicts) {
|
|
586
|
-
extensionsResult.errors.push({ path: conflict.path, error: conflict.message });
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
mapSkillPath(resource, metadataByPath) {
|
|
590
|
-
if (resource.metadata.source !== "auto" && resource.metadata.origin !== "package") {
|
|
591
|
-
return resource.path;
|
|
592
|
-
}
|
|
593
|
-
try {
|
|
594
|
-
const stats = statSync(resource.path);
|
|
595
|
-
if (!stats.isDirectory()) {
|
|
596
|
-
return resource.path;
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
catch {
|
|
600
|
-
return resource.path;
|
|
601
|
-
}
|
|
602
|
-
const skillFile = join(resource.path, "SKILL.md");
|
|
603
|
-
if (existsSync(skillFile)) {
|
|
604
|
-
if (!metadataByPath.has(skillFile)) {
|
|
605
|
-
metadataByPath.set(skillFile, resource.metadata);
|
|
606
|
-
}
|
|
607
|
-
return skillFile;
|
|
608
|
-
}
|
|
609
|
-
return resource.path;
|
|
610
|
-
}
|
|
611
|
-
normalizeExtensionPaths(entries) {
|
|
612
|
-
return entries.map((entry) => {
|
|
613
|
-
const metadata = entry.metadata.baseDir
|
|
614
|
-
? { ...entry.metadata, baseDir: this.resolveResourcePath(entry.metadata.baseDir) }
|
|
615
|
-
: entry.metadata;
|
|
616
|
-
return {
|
|
617
|
-
path: this.resolveResourcePath(entry.path),
|
|
618
|
-
metadata,
|
|
619
|
-
};
|
|
620
|
-
});
|
|
621
|
-
}
|
|
622
|
-
updateSkillsFromPaths(skillPaths, metadataByPath) {
|
|
623
|
-
let skillsResult;
|
|
624
|
-
if (this.noSkills && skillPaths.length === 0) {
|
|
625
|
-
skillsResult = { skills: [], diagnostics: [] };
|
|
626
|
-
}
|
|
627
|
-
else {
|
|
628
|
-
skillsResult = loadSkills({
|
|
629
|
-
cwd: this.cwd,
|
|
630
|
-
agentDir: this.agentDir,
|
|
631
|
-
skillPaths,
|
|
632
|
-
includeDefaults: false,
|
|
633
|
-
});
|
|
634
|
-
}
|
|
635
|
-
const resolvedSkills = this.skillsOverride ? this.skillsOverride(skillsResult) : skillsResult;
|
|
636
|
-
this.skills = resolvedSkills.skills.map((skill) => ({
|
|
637
|
-
...skill,
|
|
638
|
-
sourceInfo: this.findSourceInfoForPath(skill.filePath, this.extensionSkillSourceInfos, metadataByPath) ??
|
|
639
|
-
skill.sourceInfo ??
|
|
640
|
-
this.getDefaultSourceInfoForPath(skill.filePath),
|
|
641
|
-
}));
|
|
642
|
-
this.skillDiagnostics = resolvedSkills.diagnostics;
|
|
643
|
-
}
|
|
644
|
-
updatePromptsFromPaths(promptPaths, metadataByPath) {
|
|
645
|
-
let promptsResult;
|
|
646
|
-
if (this.noPromptTemplates && promptPaths.length === 0) {
|
|
647
|
-
promptsResult = { prompts: [], diagnostics: [] };
|
|
648
|
-
}
|
|
649
|
-
else {
|
|
650
|
-
const loaded = loadPromptTemplates({
|
|
651
|
-
cwd: this.cwd,
|
|
652
|
-
agentDir: this.agentDir,
|
|
653
|
-
promptPaths,
|
|
654
|
-
includeDefaults: false,
|
|
655
|
-
});
|
|
656
|
-
const deduped = this.dedupePrompts(loaded.templates);
|
|
657
|
-
promptsResult = {
|
|
658
|
-
prompts: deduped.prompts,
|
|
659
|
-
diagnostics: [...loaded.diagnostics, ...deduped.diagnostics],
|
|
660
|
-
};
|
|
661
|
-
}
|
|
662
|
-
const resolvedPrompts = this.promptsOverride ? this.promptsOverride(promptsResult) : promptsResult;
|
|
663
|
-
this.prompts = resolvedPrompts.prompts.map((prompt) => ({
|
|
664
|
-
...prompt,
|
|
665
|
-
sourceInfo: this.findSourceInfoForPath(prompt.filePath, this.extensionPromptSourceInfos, metadataByPath) ??
|
|
666
|
-
prompt.sourceInfo ??
|
|
667
|
-
this.getDefaultSourceInfoForPath(prompt.filePath),
|
|
668
|
-
}));
|
|
669
|
-
this.promptDiagnostics = resolvedPrompts.diagnostics;
|
|
670
|
-
}
|
|
671
|
-
updateThemesFromPaths(themePaths, metadataByPath) {
|
|
672
|
-
let themesResult;
|
|
673
|
-
if (this.noThemes && themePaths.length === 0) {
|
|
674
|
-
themesResult = { themes: [], diagnostics: [] };
|
|
675
|
-
}
|
|
676
|
-
else {
|
|
677
|
-
// Theme construction only needs trueColor, so skip the unrelated tmux hyperlink probe.
|
|
678
|
-
const colorMode = getTerminalColorMode({
|
|
679
|
-
...detectCapabilities(() => false),
|
|
680
|
-
...this.settingsManager.getTerminalCapabilityOverrides(),
|
|
681
|
-
});
|
|
682
|
-
const loaded = this.loadThemes(themePaths, false, colorMode);
|
|
683
|
-
const deduped = this.dedupeThemes(loaded.themes);
|
|
684
|
-
themesResult = { themes: deduped.themes, diagnostics: [...loaded.diagnostics, ...deduped.diagnostics] };
|
|
685
|
-
}
|
|
686
|
-
const resolvedThemes = this.themesOverride ? this.themesOverride(themesResult) : themesResult;
|
|
687
|
-
this.themes = resolvedThemes.themes.map((theme) => {
|
|
688
|
-
const sourcePath = theme.sourcePath;
|
|
689
|
-
theme.sourceInfo = sourcePath
|
|
690
|
-
? (this.findSourceInfoForPath(sourcePath, this.extensionThemeSourceInfos, metadataByPath) ??
|
|
691
|
-
theme.sourceInfo ??
|
|
692
|
-
this.getDefaultSourceInfoForPath(sourcePath))
|
|
693
|
-
: theme.sourceInfo;
|
|
694
|
-
return theme;
|
|
695
|
-
});
|
|
696
|
-
this.themeDiagnostics = resolvedThemes.diagnostics;
|
|
697
|
-
}
|
|
698
|
-
applyExtensionSourceInfo(extensions, metadataByPath) {
|
|
699
|
-
for (const extension of extensions) {
|
|
700
|
-
extension.sourceInfo =
|
|
701
|
-
this.findSourceInfoForPath(extension.path, undefined, metadataByPath) ??
|
|
702
|
-
this.getDefaultSourceInfoForPath(extension.path);
|
|
703
|
-
for (const command of extension.commands.values()) {
|
|
704
|
-
command.sourceInfo = extension.sourceInfo;
|
|
705
|
-
}
|
|
706
|
-
for (const tool of extension.tools.values()) {
|
|
707
|
-
tool.sourceInfo = extension.sourceInfo;
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
findSourceInfoForPath(resourcePath, extraSourceInfos, metadataByPath) {
|
|
712
|
-
if (!resourcePath) {
|
|
713
|
-
return undefined;
|
|
714
|
-
}
|
|
715
|
-
if (isSyntheticPath(resourcePath)) {
|
|
716
|
-
return this.getDefaultSourceInfoForPath(resourcePath);
|
|
717
|
-
}
|
|
718
|
-
const normalizedResourcePath = resolve(resourcePath);
|
|
719
|
-
if (extraSourceInfos) {
|
|
720
|
-
for (const [sourcePath, sourceInfo] of extraSourceInfos.entries()) {
|
|
721
|
-
const normalizedSourcePath = resolve(sourcePath);
|
|
722
|
-
if (normalizedResourcePath === normalizedSourcePath ||
|
|
723
|
-
normalizedResourcePath.startsWith(`${normalizedSourcePath}${sep}`)) {
|
|
724
|
-
return { ...sourceInfo, path: resourcePath };
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
if (metadataByPath) {
|
|
729
|
-
const exact = metadataByPath.get(normalizedResourcePath) ?? metadataByPath.get(resourcePath);
|
|
730
|
-
if (exact) {
|
|
731
|
-
return createSourceInfo(resourcePath, exact);
|
|
732
|
-
}
|
|
733
|
-
for (const [sourcePath, metadata] of metadataByPath.entries()) {
|
|
734
|
-
const normalizedSourcePath = resolve(sourcePath);
|
|
735
|
-
if (normalizedResourcePath === normalizedSourcePath ||
|
|
736
|
-
normalizedResourcePath.startsWith(`${normalizedSourcePath}${sep}`)) {
|
|
737
|
-
return createSourceInfo(resourcePath, metadata);
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
return undefined;
|
|
742
|
-
}
|
|
743
|
-
getDefaultSourceInfoForPath(filePath) {
|
|
744
|
-
const syntheticSource = getSyntheticPathSource(filePath);
|
|
745
|
-
if (syntheticSource) {
|
|
746
|
-
return {
|
|
747
|
-
path: filePath,
|
|
748
|
-
source: syntheticSource,
|
|
749
|
-
scope: "temporary",
|
|
750
|
-
origin: "top-level",
|
|
751
|
-
};
|
|
752
|
-
}
|
|
753
|
-
const normalizedPath = resolve(filePath);
|
|
754
|
-
const agentRoots = [
|
|
755
|
-
join(this.agentDir, "skills"),
|
|
756
|
-
join(this.agentDir, "prompts"),
|
|
757
|
-
join(this.agentDir, "themes"),
|
|
758
|
-
join(this.agentDir, "extensions"),
|
|
759
|
-
];
|
|
760
|
-
const projectRoots = [
|
|
761
|
-
join(this.cwd, CONFIG_DIR_NAME, "skills"),
|
|
762
|
-
join(this.cwd, CONFIG_DIR_NAME, "prompts"),
|
|
763
|
-
join(this.cwd, CONFIG_DIR_NAME, "themes"),
|
|
764
|
-
join(this.cwd, CONFIG_DIR_NAME, "extensions"),
|
|
765
|
-
];
|
|
766
|
-
for (const root of agentRoots) {
|
|
767
|
-
if (this.isUnderPath(normalizedPath, root)) {
|
|
768
|
-
return { path: filePath, source: "local", scope: "user", origin: "top-level", baseDir: root };
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
for (const root of projectRoots) {
|
|
772
|
-
if (this.isUnderPath(normalizedPath, root)) {
|
|
773
|
-
return { path: filePath, source: "local", scope: "project", origin: "top-level", baseDir: root };
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
return {
|
|
777
|
-
path: filePath,
|
|
778
|
-
source: "local",
|
|
779
|
-
scope: "temporary",
|
|
780
|
-
origin: "top-level",
|
|
781
|
-
baseDir: statSync(normalizedPath).isDirectory() ? normalizedPath : resolve(normalizedPath, ".."),
|
|
782
|
-
};
|
|
783
|
-
}
|
|
784
|
-
mergePaths(primary, additional) {
|
|
785
|
-
const merged = [];
|
|
786
|
-
const seen = new Set();
|
|
787
|
-
for (const p of [...primary, ...additional]) {
|
|
788
|
-
const resolved = this.resolveResourcePath(p);
|
|
789
|
-
const canonicalPath = canonicalizePath(resolved);
|
|
790
|
-
if (seen.has(canonicalPath))
|
|
791
|
-
continue;
|
|
792
|
-
seen.add(canonicalPath);
|
|
793
|
-
merged.push(resolved);
|
|
794
|
-
}
|
|
795
|
-
return merged;
|
|
796
|
-
}
|
|
797
|
-
resolveResourcePath(p) {
|
|
798
|
-
return isSyntheticPath(p) ? p : resolvePath(p, this.cwd, { trim: true });
|
|
799
|
-
}
|
|
800
|
-
loadThemes(paths, includeDefaults, colorMode) {
|
|
801
|
-
const themes = [];
|
|
802
|
-
const diagnostics = [];
|
|
803
|
-
if (includeDefaults) {
|
|
804
|
-
const defaultDirs = [join(this.agentDir, "themes"), join(this.cwd, CONFIG_DIR_NAME, "themes")];
|
|
805
|
-
for (const dir of defaultDirs) {
|
|
806
|
-
this.loadThemesFromDir(dir, themes, diagnostics, colorMode);
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
for (const p of paths) {
|
|
810
|
-
const resolved = this.resolveResourcePath(p);
|
|
811
|
-
if (!existsSync(resolved)) {
|
|
812
|
-
diagnostics.push({ type: "warning", message: "theme path does not exist", path: resolved });
|
|
813
|
-
continue;
|
|
814
|
-
}
|
|
815
|
-
try {
|
|
816
|
-
const stats = statSync(resolved);
|
|
817
|
-
if (stats.isDirectory()) {
|
|
818
|
-
this.loadThemesFromDir(resolved, themes, diagnostics, colorMode);
|
|
819
|
-
}
|
|
820
|
-
else if (stats.isFile() && resolved.endsWith(".json")) {
|
|
821
|
-
this.loadThemeFromFile(resolved, themes, diagnostics, colorMode);
|
|
822
|
-
}
|
|
823
|
-
else {
|
|
824
|
-
diagnostics.push({ type: "warning", message: "theme path is not a json file", path: resolved });
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
catch (error) {
|
|
828
|
-
const message = error instanceof Error ? error.message : "failed to read theme path";
|
|
829
|
-
diagnostics.push({ type: "warning", message, path: resolved });
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
return { themes, diagnostics };
|
|
833
|
-
}
|
|
834
|
-
loadThemesFromDir(dir, themes, diagnostics, colorMode) {
|
|
835
|
-
if (!existsSync(dir)) {
|
|
836
|
-
return;
|
|
837
|
-
}
|
|
838
|
-
try {
|
|
839
|
-
const entries = readdirSync(dir, { withFileTypes: true });
|
|
840
|
-
for (const entry of entries) {
|
|
841
|
-
let isFile = entry.isFile();
|
|
842
|
-
if (entry.isSymbolicLink()) {
|
|
843
|
-
try {
|
|
844
|
-
isFile = statSync(join(dir, entry.name)).isFile();
|
|
845
|
-
}
|
|
846
|
-
catch {
|
|
847
|
-
continue;
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
if (!isFile) {
|
|
851
|
-
continue;
|
|
852
|
-
}
|
|
853
|
-
if (!entry.name.endsWith(".json")) {
|
|
854
|
-
continue;
|
|
855
|
-
}
|
|
856
|
-
this.loadThemeFromFile(join(dir, entry.name), themes, diagnostics, colorMode);
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
catch (error) {
|
|
860
|
-
const message = error instanceof Error ? error.message : "failed to read theme directory";
|
|
861
|
-
diagnostics.push({ type: "warning", message, path: dir });
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
loadThemeFromFile(filePath, themes, diagnostics, colorMode) {
|
|
865
|
-
try {
|
|
866
|
-
themes.push(loadThemeFromPath(filePath, colorMode));
|
|
867
|
-
}
|
|
868
|
-
catch (error) {
|
|
869
|
-
const message = error instanceof Error ? error.message : "failed to load theme";
|
|
870
|
-
diagnostics.push({ type: "warning", message, path: filePath });
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
async loadExtensionFactories(runtime) {
|
|
874
|
-
const extensions = [];
|
|
875
|
-
const errors = [];
|
|
876
|
-
for (const [index, input] of this.extensionFactories.entries()) {
|
|
877
|
-
const isNamed = typeof input !== "function";
|
|
878
|
-
const factory = isNamed ? input.factory : input;
|
|
879
|
-
const extensionPath = `<inline:${isNamed ? input.name : index + 1}>`;
|
|
880
|
-
try {
|
|
881
|
-
const extension = await loadExtensionFromFactory(factory, this.cwd, this.eventBus, runtime, extensionPath);
|
|
882
|
-
extension.hidden = isNamed && input.hidden;
|
|
883
|
-
extension.replaceable = isNamed && input.replaceable === true;
|
|
884
|
-
extensions.push(extension);
|
|
885
|
-
}
|
|
886
|
-
catch (error) {
|
|
887
|
-
const message = error instanceof Error ? error.message : "failed to load extension";
|
|
888
|
-
errors.push({ path: extensionPath, error: message });
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
return { extensions, errors };
|
|
892
|
-
}
|
|
893
|
-
dedupePrompts(prompts) {
|
|
894
|
-
const seen = new Map();
|
|
895
|
-
const diagnostics = [];
|
|
896
|
-
for (const prompt of prompts) {
|
|
897
|
-
const existing = seen.get(prompt.name);
|
|
898
|
-
if (existing) {
|
|
899
|
-
diagnostics.push({
|
|
900
|
-
type: "collision",
|
|
901
|
-
message: `name "/${prompt.name}" collision`,
|
|
902
|
-
path: prompt.filePath,
|
|
903
|
-
collision: {
|
|
904
|
-
resourceType: "prompt",
|
|
905
|
-
name: prompt.name,
|
|
906
|
-
winnerPath: existing.filePath,
|
|
907
|
-
loserPath: prompt.filePath,
|
|
908
|
-
},
|
|
909
|
-
});
|
|
910
|
-
}
|
|
911
|
-
else {
|
|
912
|
-
seen.set(prompt.name, prompt);
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
return { prompts: Array.from(seen.values()), diagnostics };
|
|
916
|
-
}
|
|
917
|
-
dedupeThemes(themes) {
|
|
918
|
-
const seen = new Map();
|
|
919
|
-
const diagnostics = [];
|
|
920
|
-
for (const t of themes) {
|
|
921
|
-
const name = t.name ?? "unnamed";
|
|
922
|
-
const existing = seen.get(name);
|
|
923
|
-
if (existing) {
|
|
924
|
-
diagnostics.push({
|
|
925
|
-
type: "collision",
|
|
926
|
-
message: `name "${name}" collision`,
|
|
927
|
-
path: t.sourcePath,
|
|
928
|
-
collision: {
|
|
929
|
-
resourceType: "theme",
|
|
930
|
-
name,
|
|
931
|
-
winnerPath: existing.sourcePath ?? "<builtin>",
|
|
932
|
-
loserPath: t.sourcePath ?? "<builtin>",
|
|
933
|
-
},
|
|
934
|
-
});
|
|
935
|
-
}
|
|
936
|
-
else {
|
|
937
|
-
seen.set(name, t);
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
return { themes: Array.from(seen.values()), diagnostics };
|
|
941
|
-
}
|
|
942
|
-
discoverSystemPromptFile() {
|
|
943
|
-
const projectPath = join(this.cwd, CONFIG_DIR_NAME, "SYSTEM.md");
|
|
944
|
-
if (this.settingsManager.isProjectTrusted() && existsSync(projectPath)) {
|
|
945
|
-
return projectPath;
|
|
946
|
-
}
|
|
947
|
-
const globalPath = join(this.agentDir, "SYSTEM.md");
|
|
948
|
-
if (existsSync(globalPath)) {
|
|
949
|
-
return globalPath;
|
|
950
|
-
}
|
|
951
|
-
return undefined;
|
|
952
|
-
}
|
|
953
|
-
discoverAppendSystemPromptFile() {
|
|
954
|
-
const projectPath = join(this.cwd, CONFIG_DIR_NAME, "APPEND_SYSTEM.md");
|
|
955
|
-
if (this.settingsManager.isProjectTrusted() && existsSync(projectPath)) {
|
|
956
|
-
return projectPath;
|
|
957
|
-
}
|
|
958
|
-
const globalPath = join(this.agentDir, "APPEND_SYSTEM.md");
|
|
959
|
-
if (existsSync(globalPath)) {
|
|
960
|
-
return globalPath;
|
|
961
|
-
}
|
|
962
|
-
return undefined;
|
|
963
|
-
}
|
|
964
|
-
isUnderPath(target, root) {
|
|
965
|
-
const normalizedRoot = resolve(root);
|
|
966
|
-
if (target === normalizedRoot) {
|
|
967
|
-
return true;
|
|
968
|
-
}
|
|
969
|
-
const prefix = normalizedRoot.endsWith(sep) ? normalizedRoot : `${normalizedRoot}${sep}`;
|
|
970
|
-
return target.startsWith(prefix);
|
|
971
|
-
}
|
|
972
|
-
detectExtensionConflicts(extensions) {
|
|
973
|
-
const conflicts = [];
|
|
974
|
-
// Track which extension registered each tool and flag
|
|
975
|
-
const toolOwners = new Map();
|
|
976
|
-
const flagOwners = new Map();
|
|
977
|
-
for (const ext of extensions) {
|
|
978
|
-
// Check tools
|
|
979
|
-
for (const toolName of ext.tools.keys()) {
|
|
980
|
-
const existingOwner = toolOwners.get(toolName);
|
|
981
|
-
if (existingOwner && existingOwner !== ext.path) {
|
|
982
|
-
conflicts.push({
|
|
983
|
-
path: ext.path,
|
|
984
|
-
message: `Tool "${toolName}" conflicts with ${existingOwner}`,
|
|
985
|
-
});
|
|
986
|
-
}
|
|
987
|
-
else {
|
|
988
|
-
toolOwners.set(toolName, ext.path);
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
// Check flags
|
|
992
|
-
for (const flagName of ext.flags.keys()) {
|
|
993
|
-
const existingOwner = flagOwners.get(flagName);
|
|
994
|
-
if (existingOwner && existingOwner !== ext.path) {
|
|
995
|
-
conflicts.push({
|
|
996
|
-
path: ext.path,
|
|
997
|
-
message: `Flag "--${flagName}" conflicts with ${existingOwner}`,
|
|
998
|
-
});
|
|
999
|
-
}
|
|
1000
|
-
else {
|
|
1001
|
-
flagOwners.set(flagName, ext.path);
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
return conflicts;
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1008
|
-
//# sourceMappingURL=resource-loader.js.map
|