@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,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Presentation for the edit tool.
|
|
3
|
-
*
|
|
4
|
-
* Renderers live apart from the implementation so a process that only displays tool output does not
|
|
5
|
-
* load the execution path or its typebox parameter schema. `edit.ts` spreads these into its
|
|
6
|
-
* definition, so the tool's public shape is unchanged.
|
|
7
|
-
*/
|
|
8
|
-
import { Box } from "@earendil-works/pi-tui";
|
|
9
|
-
import type { ToolDefinition } from "../../extensions/types.ts";
|
|
10
|
-
import { type EditDiffError, type EditDiffResult } from "../edit-diff.ts";
|
|
11
|
-
type EditPreview = EditDiffResult | EditDiffError;
|
|
12
|
-
export type EditRenderState = {
|
|
13
|
-
callComponent?: EditCallRenderComponent;
|
|
14
|
-
};
|
|
15
|
-
type EditCallRenderComponent = Box & {
|
|
16
|
-
preview?: EditPreview;
|
|
17
|
-
previewArgsKey?: string;
|
|
18
|
-
previewPending?: boolean;
|
|
19
|
-
settledError?: boolean;
|
|
20
|
-
};
|
|
21
|
-
export declare const editRenderers: Pick<ToolDefinition<any, any>, "renderCall" | "renderResult">;
|
|
22
|
-
export {};
|
|
23
|
-
//# sourceMappingURL=edit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/renderers/edit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,GAAG,EAA2B,MAAM,wBAAwB,CAAC;AAGtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAA+B,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGvG,KAAK,WAAW,GAAG,cAAc,GAAG,aAAa,CAAC;AAClD,MAAM,MAAM,eAAe,GAAG;IAC7B,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACxC,CAAC;AAYF,KAAK,uBAAuB,GAAG,GAAG,GAAG;IACpC,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAwIF,eAAO,MAAM,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,YAAY,GAAG,cAAc,CA+EvF,CAAC"}
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Presentation for the edit tool.
|
|
3
|
-
*
|
|
4
|
-
* Renderers live apart from the implementation so a process that only displays tool output does not
|
|
5
|
-
* load the execution path or its typebox parameter schema. `edit.ts` spreads these into its
|
|
6
|
-
* definition, so the tool's public shape is unchanged.
|
|
7
|
-
*/
|
|
8
|
-
import { Box, Container, Spacer, Text } from "@earendil-works/pi-tui";
|
|
9
|
-
import { renderDiff } from "../../../modes/interactive/components/diff.js";
|
|
10
|
-
import { computeEditsDiff } from "../edit-diff.js";
|
|
11
|
-
import { renderToolPath, str } from "../render-utils.js";
|
|
12
|
-
function createEditCallRenderComponent() {
|
|
13
|
-
return Object.assign(new Box(1, 1, (text) => text), {
|
|
14
|
-
preview: undefined,
|
|
15
|
-
previewArgsKey: undefined,
|
|
16
|
-
previewPending: false,
|
|
17
|
-
settledError: false,
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
function getEditCallRenderComponent(state, lastComponent) {
|
|
21
|
-
if (lastComponent instanceof Box) {
|
|
22
|
-
const component = lastComponent;
|
|
23
|
-
state.callComponent = component;
|
|
24
|
-
return component;
|
|
25
|
-
}
|
|
26
|
-
if (state.callComponent) {
|
|
27
|
-
return state.callComponent;
|
|
28
|
-
}
|
|
29
|
-
const component = createEditCallRenderComponent();
|
|
30
|
-
state.callComponent = component;
|
|
31
|
-
return component;
|
|
32
|
-
}
|
|
33
|
-
function getRenderablePreviewInput(args) {
|
|
34
|
-
if (!args) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
const path = typeof args.path === "string" ? args.path : typeof args.file_path === "string" ? args.file_path : null;
|
|
38
|
-
if (!path) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
if (Array.isArray(args.edits) &&
|
|
42
|
-
args.edits.length > 0 &&
|
|
43
|
-
args.edits.every((edit) => typeof edit?.oldText === "string" && typeof edit?.newText === "string")) {
|
|
44
|
-
return { path, edits: args.edits };
|
|
45
|
-
}
|
|
46
|
-
if (typeof args.oldText === "string" && typeof args.newText === "string") {
|
|
47
|
-
return { path, edits: [{ oldText: args.oldText, newText: args.newText }] };
|
|
48
|
-
}
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
function formatEditCall(args, theme, cwd) {
|
|
52
|
-
const pathDisplay = renderToolPath(str(args?.file_path ?? args?.path), theme, cwd);
|
|
53
|
-
return `${theme.fg("toolTitle", theme.bold("edit"))} ${pathDisplay}`;
|
|
54
|
-
}
|
|
55
|
-
function formatEditResult(args, preview, result, theme, isError) {
|
|
56
|
-
const rawPath = str(args?.file_path ?? args?.path);
|
|
57
|
-
const previewDiff = preview && !("error" in preview) ? preview.diff : undefined;
|
|
58
|
-
const previewError = preview && "error" in preview ? preview.error : undefined;
|
|
59
|
-
if (isError) {
|
|
60
|
-
const errorText = result.content
|
|
61
|
-
.filter((c) => c.type === "text")
|
|
62
|
-
.map((c) => c.text || "")
|
|
63
|
-
.join("\n");
|
|
64
|
-
if (!errorText || errorText === previewError) {
|
|
65
|
-
return undefined;
|
|
66
|
-
}
|
|
67
|
-
return theme.fg("error", errorText);
|
|
68
|
-
}
|
|
69
|
-
const resultDiff = result.details?.diff;
|
|
70
|
-
if (resultDiff && resultDiff !== previewDiff) {
|
|
71
|
-
return renderDiff(resultDiff, { filePath: rawPath ?? undefined });
|
|
72
|
-
}
|
|
73
|
-
return undefined;
|
|
74
|
-
}
|
|
75
|
-
function getEditHeaderBg(preview, settledError, theme) {
|
|
76
|
-
if (preview) {
|
|
77
|
-
if ("error" in preview) {
|
|
78
|
-
return (text) => theme.bg("toolErrorBg", text);
|
|
79
|
-
}
|
|
80
|
-
return (text) => theme.bg("toolSuccessBg", text);
|
|
81
|
-
}
|
|
82
|
-
if (settledError) {
|
|
83
|
-
return (text) => theme.bg("toolErrorBg", text);
|
|
84
|
-
}
|
|
85
|
-
return (text) => theme.bg("toolPendingBg", text);
|
|
86
|
-
}
|
|
87
|
-
function buildEditCallComponent(component, args, theme, cwd, outputPad) {
|
|
88
|
-
component.setBgFn(getEditHeaderBg(component.preview, component.settledError, theme));
|
|
89
|
-
component.setPaddingX(outputPad);
|
|
90
|
-
component.clear();
|
|
91
|
-
component.addChild(new Text(formatEditCall(args, theme, cwd), 0, 0));
|
|
92
|
-
if (!component.preview) {
|
|
93
|
-
return component;
|
|
94
|
-
}
|
|
95
|
-
const body = "error" in component.preview ? theme.fg("error", component.preview.error) : renderDiff(component.preview.diff);
|
|
96
|
-
component.addChild(new Spacer(1));
|
|
97
|
-
component.addChild(new Text(body, 0, 0));
|
|
98
|
-
return component;
|
|
99
|
-
}
|
|
100
|
-
function setEditPreview(component, preview, argsKey) {
|
|
101
|
-
const current = component.preview;
|
|
102
|
-
const changed = current === undefined ||
|
|
103
|
-
("error" in current && "error" in preview
|
|
104
|
-
? current.error !== preview.error
|
|
105
|
-
: "error" in current !== "error" in preview) ||
|
|
106
|
-
(!("error" in current) &&
|
|
107
|
-
!("error" in preview) &&
|
|
108
|
-
(current.diff !== preview.diff || current.firstChangedLine !== preview.firstChangedLine));
|
|
109
|
-
component.preview = preview;
|
|
110
|
-
component.previewArgsKey = argsKey;
|
|
111
|
-
component.previewPending = false;
|
|
112
|
-
return changed;
|
|
113
|
-
}
|
|
114
|
-
export const editRenderers = {
|
|
115
|
-
renderCall(args, theme, context) {
|
|
116
|
-
const component = getEditCallRenderComponent(context.state, context.lastComponent);
|
|
117
|
-
const previewInput = getRenderablePreviewInput(args);
|
|
118
|
-
const argsKey = previewInput ? JSON.stringify({ path: previewInput.path, edits: previewInput.edits }) : undefined;
|
|
119
|
-
if (component.previewArgsKey !== argsKey) {
|
|
120
|
-
component.preview = undefined;
|
|
121
|
-
component.previewArgsKey = argsKey;
|
|
122
|
-
component.previewPending = false;
|
|
123
|
-
component.settledError = false;
|
|
124
|
-
}
|
|
125
|
-
if (context.argsComplete && previewInput && !component.preview && !component.previewPending) {
|
|
126
|
-
component.previewPending = true;
|
|
127
|
-
const requestKey = argsKey;
|
|
128
|
-
void computeEditsDiff(previewInput.path, previewInput.edits, context.cwd).then((preview) => {
|
|
129
|
-
if (component.previewArgsKey === requestKey) {
|
|
130
|
-
setEditPreview(component, preview, requestKey);
|
|
131
|
-
context.invalidate();
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
return buildEditCallComponent(component, args, theme, context.cwd, context.outputPad);
|
|
136
|
-
},
|
|
137
|
-
renderResult(result, _options, theme, context) {
|
|
138
|
-
const callComponent = context.state.callComponent;
|
|
139
|
-
const previewInput = getRenderablePreviewInput(context.args);
|
|
140
|
-
const argsKey = previewInput ? JSON.stringify({ path: previewInput.path, edits: previewInput.edits }) : undefined;
|
|
141
|
-
const typedResult = result;
|
|
142
|
-
const resultDiff = !context.isError ? typedResult.details?.diff : undefined;
|
|
143
|
-
let changed = false;
|
|
144
|
-
if (callComponent) {
|
|
145
|
-
if (typeof resultDiff === "string") {
|
|
146
|
-
changed =
|
|
147
|
-
setEditPreview(callComponent, { diff: resultDiff, firstChangedLine: typedResult.details?.firstChangedLine }, argsKey) || changed;
|
|
148
|
-
}
|
|
149
|
-
if (callComponent.settledError !== context.isError) {
|
|
150
|
-
callComponent.settledError = context.isError;
|
|
151
|
-
changed = true;
|
|
152
|
-
}
|
|
153
|
-
if (changed) {
|
|
154
|
-
buildEditCallComponent(callComponent, context.args, theme, context.cwd, context.outputPad);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
const output = formatEditResult(context.args, callComponent?.preview, typedResult, theme, context.isError);
|
|
158
|
-
const component = context.lastComponent ?? new Container();
|
|
159
|
-
component.clear();
|
|
160
|
-
if (!output) {
|
|
161
|
-
return component;
|
|
162
|
-
}
|
|
163
|
-
component.addChild(new Spacer(1));
|
|
164
|
-
component.addChild(new Text(output, context.outputPad, 0));
|
|
165
|
-
return component;
|
|
166
|
-
},
|
|
167
|
-
};
|
|
168
|
-
//# sourceMappingURL=edit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../../src/core/tools/renderers/edit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAI3E,OAAO,EAAE,gBAAgB,EAAsD,MAAM,iBAAiB,CAAC;AACvG,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAuBzD,SAAS,6BAA6B;IACrC,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE;QAC3D,OAAO,EAAE,SAAoC;QAC7C,cAAc,EAAE,SAA+B;QAC/C,cAAc,EAAE,KAAK;QACrB,YAAY,EAAE,KAAK;KACnB,CAAC,CAAC;AACJ,CAAC;AACD,SAAS,0BAA0B,CAAC,KAAsB,EAAE,aAAsB;IACjF,IAAI,aAAa,YAAY,GAAG,EAAE,CAAC;QAClC,MAAM,SAAS,GAAG,aAAwC,CAAC;QAC3D,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC;QAChC,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,aAAa,CAAC;IAC5B,CAAC;IACD,MAAM,SAAS,GAAG,6BAA6B,EAAE,CAAC;IAClD,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC;IAChC,OAAO,SAAS,CAAC;AAClB,CAAC;AACD,SAAS,yBAAyB,CAAC,IAAoC;IACtE,IAAI,CAAC,IAAI,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACb,CAAC;IAED,M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,CAAC;YACb,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,SAAS,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAClC,SAAS,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3D,OAAO,SAAS,CAAC;IAClB,CAAC;CACD,CAAC","sourcesContent":["/**\n * Presentation for the edit tool.\n *\n * Renderers live apart from the implementation so a process that only displays tool output does not\n * load the execution path or its typebox parameter schema. `edit.ts` spreads these into its\n * definition, so the tool's public shape is unchanged.\n */\n\nimport { Box, Container, Spacer, Text } from \"@earendil-works/pi-tui\";\nimport { renderDiff } from \"../../../modes/interactive/components/diff.ts\";\nimport type { Theme } from \"../../../modes/interactive/theme/theme.ts\";\nimport type { ToolDefinition } from \"../../extensions/types.ts\";\nimport type { EditToolDetails } from \"../edit.ts\";\nimport { computeEditsDiff, type Edit, type EditDiffError, type EditDiffResult } from \"../edit-diff.ts\";\nimport { renderToolPath, str } from \"../render-utils.ts\";\n\ntype EditPreview = EditDiffResult | EditDiffError;\nexport type EditRenderState = {\n\tcallComponent?: EditCallRenderComponent;\n};\ntype RenderableEditArgs = {\n\tpath?: string;\n\tfile_path?: string;\n\tedits?: Edit[];\n\toldText?: string;\n\tnewText?: string;\n};\ntype EditToolResultLike = {\n\tcontent: Array<{ type: string; text?: string; data?: string; mimeType?: string }>;\n\tdetails?: EditToolDetails;\n};\ntype EditCallRenderComponent = Box & {\n\tpreview?: EditPreview;\n\tpreviewArgsKey?: string;\n\tpreviewPending?: boolean;\n\tsettledError?: boolean;\n};\nfunction createEditCallRenderComponent(): EditCallRenderComponent {\n\treturn Object.assign(new Box(1, 1, (text: string) => text), {\n\t\tpreview: undefined as EditPreview | undefined,\n\t\tpreviewArgsKey: undefined as string | undefined,\n\t\tpreviewPending: false,\n\t\tsettledError: false,\n\t});\n}\nfunction getEditCallRenderComponent(state: EditRenderState, lastComponent: unknown): EditCallRenderComponent {\n\tif (lastComponent instanceof Box) {\n\t\tconst component = lastComponent as EditCallRenderComponent;\n\t\tstate.callComponent = component;\n\t\treturn component;\n\t}\n\tif (state.callComponent) {\n\t\treturn state.callComponent;\n\t}\n\tconst component = createEditCallRenderComponent();\n\tstate.callComponent = component;\n\treturn component;\n}\nfunction getRenderablePreviewInput(args: RenderableEditArgs | undefined): { path: string; edits: Edit[] } | null {\n\tif (!args) {\n\t\treturn null;\n\t}\n\n\tconst path = typeof args.path === \"string\" ? args.path : typeof args.file_path === \"string\" ? args.file_path : null;\n\tif (!path) {\n\t\treturn null;\n\t}\n\n\tif (\n\t\tArray.isArray(args.edits) &&\n\t\targs.edits.length > 0 &&\n\t\targs.edits.every((edit) => typeof edit?.oldText === \"string\" && typeof edit?.newText === \"string\")\n\t) {\n\t\treturn { path, edits: args.edits };\n\t}\n\n\tif (typeof args.oldText === \"string\" && typeof args.newText === \"string\") {\n\t\treturn { path, edits: [{ oldText: args.oldText, newText: args.newText }] };\n\t}\n\n\treturn null;\n}\nfunction formatEditCall(args: RenderableEditArgs | undefined, theme: Theme, cwd: string): string {\n\tconst pathDisplay = renderToolPath(str(args?.file_path ?? args?.path), theme, cwd);\n\treturn `${theme.fg(\"toolTitle\", theme.bold(\"edit\"))} ${pathDisplay}`;\n}\nfunction formatEditResult(\n\targs: RenderableEditArgs | undefined,\n\tpreview: EditPreview | undefined,\n\tresult: EditToolResultLike,\n\ttheme: Theme,\n\tisError: boolean,\n): string | undefined {\n\tconst rawPath = str(args?.file_path ?? args?.path);\n\tconst previewDiff = preview && !(\"error\" in preview) ? preview.diff : undefined;\n\tconst previewError = preview && \"error\" in preview ? preview.error : undefined;\n\tif (isError) {\n\t\tconst errorText = result.content\n\t\t\t.filter((c) => c.type === \"text\")\n\t\t\t.map((c) => c.text || \"\")\n\t\t\t.join(\"\\n\");\n\t\tif (!errorText || errorText === previewError) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn theme.fg(\"error\", errorText);\n\t}\n\n\tconst resultDiff = result.details?.diff;\n\tif (resultDiff && resultDiff !== previewDiff) {\n\t\treturn renderDiff(resultDiff, { filePath: rawPath ?? undefined });\n\t}\n\n\treturn undefined;\n}\nfunction getEditHeaderBg(\n\tpreview: EditPreview | undefined,\n\tsettledError: boolean | undefined,\n\ttheme: Theme,\n): (text: string) => string {\n\tif (preview) {\n\t\tif (\"error\" in preview) {\n\t\t\treturn (text: string) => theme.bg(\"toolErrorBg\", text);\n\t\t}\n\t\treturn (text: string) => theme.bg(\"toolSuccessBg\", text);\n\t}\n\tif (settledError) {\n\t\treturn (text: string) => theme.bg(\"toolErrorBg\", text);\n\t}\n\treturn (text: string) => theme.bg(\"toolPendingBg\", text);\n}\nfunction buildEditCallComponent(\n\tcomponent: EditCallRenderComponent,\n\targs: RenderableEditArgs | undefined,\n\ttheme: Theme,\n\tcwd: string,\n\toutputPad: number,\n): EditCallRenderComponent {\n\tcomponent.setBgFn(getEditHeaderBg(component.preview, component.settledError, theme));\n\tcomponent.setPaddingX(outputPad);\n\tcomponent.clear();\n\tcomponent.addChild(new Text(formatEditCall(args, theme, cwd), 0, 0));\n\n\tif (!component.preview) {\n\t\treturn component;\n\t}\n\n\tconst body =\n\t\t\"error\" in component.preview ? theme.fg(\"error\", component.preview.error) : renderDiff(component.preview.diff);\n\tcomponent.addChild(new Spacer(1));\n\tcomponent.addChild(new Text(body, 0, 0));\n\treturn component;\n}\nfunction setEditPreview(\n\tcomponent: EditCallRenderComponent,\n\tpreview: EditPreview,\n\targsKey: string | undefined,\n): boolean {\n\tconst current = component.preview;\n\tconst changed =\n\t\tcurrent === undefined ||\n\t\t(\"error\" in current && \"error\" in preview\n\t\t\t? current.error !== preview.error\n\t\t\t: \"error\" in current !== \"error\" in preview) ||\n\t\t(!(\"error\" in current) &&\n\t\t\t!(\"error\" in preview) &&\n\t\t\t(current.diff !== preview.diff || current.firstChangedLine !== preview.firstChangedLine));\n\tcomponent.preview = preview;\n\tcomponent.previewArgsKey = argsKey;\n\tcomponent.previewPending = false;\n\treturn changed;\n}\n\nexport const editRenderers: Pick<ToolDefinition<any, any>, \"renderCall\" | \"renderResult\"> = {\n\trenderCall(args, theme, context) {\n\t\tconst component = getEditCallRenderComponent(context.state, context.lastComponent);\n\t\tconst previewInput = getRenderablePreviewInput(args as RenderableEditArgs | undefined);\n\t\tconst argsKey = previewInput ? JSON.stringify({ path: previewInput.path, edits: previewInput.edits }) : undefined;\n\n\t\tif (component.previewArgsKey !== argsKey) {\n\t\t\tcomponent.preview = undefined;\n\t\t\tcomponent.previewArgsKey = argsKey;\n\t\t\tcomponent.previewPending = false;\n\t\t\tcomponent.settledError = false;\n\t\t}\n\n\t\tif (context.argsComplete && previewInput && !component.preview && !component.previewPending) {\n\t\t\tcomponent.previewPending = true;\n\t\t\tconst requestKey = argsKey;\n\t\t\tvoid computeEditsDiff(previewInput.path, previewInput.edits, context.cwd).then((preview) => {\n\t\t\t\tif (component.previewArgsKey === requestKey) {\n\t\t\t\t\tsetEditPreview(component, preview, requestKey);\n\t\t\t\t\tcontext.invalidate();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn buildEditCallComponent(\n\t\t\tcomponent,\n\t\t\targs as RenderableEditArgs | undefined,\n\t\t\ttheme,\n\t\t\tcontext.cwd,\n\t\t\tcontext.outputPad,\n\t\t);\n\t},\n\trenderResult(result, _options, theme, context) {\n\t\tconst callComponent = context.state.callComponent;\n\t\tconst previewInput = getRenderablePreviewInput(context.args as RenderableEditArgs | undefined);\n\t\tconst argsKey = previewInput ? JSON.stringify({ path: previewInput.path, edits: previewInput.edits }) : undefined;\n\t\tconst typedResult = result as EditToolResultLike;\n\t\tconst resultDiff = !context.isError ? typedResult.details?.diff : undefined;\n\t\tlet changed = false;\n\t\tif (callComponent) {\n\t\t\tif (typeof resultDiff === \"string\") {\n\t\t\t\tchanged =\n\t\t\t\t\tsetEditPreview(\n\t\t\t\t\t\tcallComponent,\n\t\t\t\t\t\t{ diff: resultDiff, firstChangedLine: typedResult.details?.firstChangedLine },\n\t\t\t\t\t\targsKey,\n\t\t\t\t\t) || changed;\n\t\t\t}\n\t\t\tif (callComponent.settledError !== context.isError) {\n\t\t\t\tcallComponent.settledError = context.isError;\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t\tif (changed) {\n\t\t\t\tbuildEditCallComponent(\n\t\t\t\t\tcallComponent,\n\t\t\t\t\tcontext.args as RenderableEditArgs | undefined,\n\t\t\t\t\ttheme,\n\t\t\t\t\tcontext.cwd,\n\t\t\t\t\tcontext.outputPad,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst output = formatEditResult(\n\t\t\tcontext.args as RenderableEditArgs | undefined,\n\t\t\tcallComponent?.preview,\n\t\t\ttypedResult,\n\t\t\ttheme,\n\t\t\tcontext.isError,\n\t\t);\n\t\tconst component = (context.lastComponent as Container | undefined) ?? new Container();\n\t\tcomponent.clear();\n\t\tif (!output) {\n\t\t\treturn component;\n\t\t}\n\t\tcomponent.addChild(new Spacer(1));\n\t\tcomponent.addChild(new Text(output, context.outputPad, 0));\n\t\treturn component;\n\t},\n};\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Presentation for the find tool.
|
|
3
|
-
*
|
|
4
|
-
* Renderers live apart from the implementation so a process that only displays tool output does not
|
|
5
|
-
* load the execution path or its typebox parameter schema. `find.ts` spreads these into its
|
|
6
|
-
* definition, so the tool's public shape is unchanged.
|
|
7
|
-
*/
|
|
8
|
-
import type { ToolDefinition } from "../../extensions/types.ts";
|
|
9
|
-
export declare const findRenderers: Pick<ToolDefinition<any, any>, "renderCall" | "renderResult">;
|
|
10
|
-
//# sourceMappingURL=find.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/renderers/find.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,cAAc,EAA2B,MAAM,2BAA2B,CAAC;AAsDzF,eAAO,MAAM,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,YAAY,GAAG,cAAc,CAWvF,CAAC"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Presentation for the find tool.
|
|
3
|
-
*
|
|
4
|
-
* Renderers live apart from the implementation so a process that only displays tool output does not
|
|
5
|
-
* load the execution path or its typebox parameter schema. `find.ts` spreads these into its
|
|
6
|
-
* definition, so the tool's public shape is unchanged.
|
|
7
|
-
*/
|
|
8
|
-
import { Text } from "@earendil-works/pi-tui";
|
|
9
|
-
import { keyHint } from "../../../modes/interactive/components/keybinding-hints.js";
|
|
10
|
-
import { getTextOutput, invalidArgText, shortenPath, str } from "../render-utils.js";
|
|
11
|
-
import { DEFAULT_MAX_BYTES, formatSize } from "../truncate.js";
|
|
12
|
-
function formatFindCall(args, theme) {
|
|
13
|
-
const pattern = str(args?.pattern);
|
|
14
|
-
const rawPath = str(args?.path);
|
|
15
|
-
const path = rawPath !== null ? shortenPath(rawPath || ".") : null;
|
|
16
|
-
const limit = args?.limit;
|
|
17
|
-
const invalidArg = invalidArgText(theme);
|
|
18
|
-
let text = theme.fg("toolTitle", theme.bold("find")) +
|
|
19
|
-
" " +
|
|
20
|
-
(pattern === null ? invalidArg : theme.fg("accent", pattern || "")) +
|
|
21
|
-
theme.fg("toolOutput", ` in ${path === null ? invalidArg : path}`);
|
|
22
|
-
if (limit !== undefined) {
|
|
23
|
-
text += theme.fg("toolOutput", ` (limit ${limit})`);
|
|
24
|
-
}
|
|
25
|
-
return text;
|
|
26
|
-
}
|
|
27
|
-
function formatFindResult(result, options, theme, showImages) {
|
|
28
|
-
const output = getTextOutput(result, showImages).trim();
|
|
29
|
-
let text = "";
|
|
30
|
-
if (output) {
|
|
31
|
-
const lines = output.split("\n");
|
|
32
|
-
const maxLines = options.expanded ? lines.length : 20;
|
|
33
|
-
const displayLines = lines.slice(0, maxLines);
|
|
34
|
-
const remaining = lines.length - maxLines;
|
|
35
|
-
text += `\n${displayLines.map((line) => theme.fg("toolOutput", line)).join("\n")}`;
|
|
36
|
-
if (remaining > 0) {
|
|
37
|
-
text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("app.tools.expand", "to expand")}${theme.fg("muted", ")")}`;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
const resultLimit = result.details?.resultLimitReached;
|
|
41
|
-
const truncation = result.details?.truncation;
|
|
42
|
-
if (resultLimit || truncation?.truncated) {
|
|
43
|
-
const warnings = [];
|
|
44
|
-
if (resultLimit)
|
|
45
|
-
warnings.push(`${resultLimit} results limit`);
|
|
46
|
-
if (truncation?.truncated)
|
|
47
|
-
warnings.push(`${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit`);
|
|
48
|
-
text += `\n${theme.fg("warning", `[Truncated: ${warnings.join(", ")}]`)}`;
|
|
49
|
-
}
|
|
50
|
-
return text;
|
|
51
|
-
}
|
|
52
|
-
export const findRenderers = {
|
|
53
|
-
renderCall(args, theme, context) {
|
|
54
|
-
const text = context.lastComponent ?? new Text("", 0, 0);
|
|
55
|
-
text.setText(formatFindCall(args, theme));
|
|
56
|
-
return text;
|
|
57
|
-
},
|
|
58
|
-
renderResult(result, options, theme, context) {
|
|
59
|
-
const text = context.lastComponent ?? new Text("", 0, 0);
|
|
60
|
-
text.setText(formatFindResult(result, options, theme, context.showImages));
|
|
61
|
-
return text;
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
//# sourceMappingURL=find.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../../src/core/tools/renderers/find.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM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,GAAG,UAAU,CAAC,UAAU,CAAC,QAAQ,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAAC;QAC1G,IAAI,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,eAAe,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IAC3E,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAkE;IAC3F,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO;QAC9B,MAAM,IAAI,GAAI,OAAO,CAAC,aAAkC,IAAI,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC/E,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAW,EAAE,KAAK,CAAC,CAAC,CAAC;QACjD,OAAO,IAAI,CAAC;IACb,CAAC;IACD,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO;QAC3C,MAAM,IAAI,GAAI,OAAO,CAAC,aAAkC,IAAI,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC/E,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,MAAa,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;QAClF,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC","sourcesContent":["/**\n * Presentation for the find tool.\n *\n * Renderers live apart from the implementation so a process that only displays tool output does not\n * load the execution path or its typebox parameter schema. `find.ts` spreads these into its\n * definition, so the tool's public shape is unchanged.\n */\n\nimport { Text } from \"@earendil-works/pi-tui\";\nimport { keyHint } from \"../../../modes/interactive/components/keybinding-hints.ts\";\nimport type { Theme } from \"../../../modes/interactive/theme/theme.ts\";\nimport type { ToolDefinition, ToolRenderResultOptions } from \"../../extensions/types.ts\";\nimport type { FindToolDetails } from \"../find.ts\";\nimport { getTextOutput, invalidArgText, shortenPath, str } from \"../render-utils.ts\";\nimport { DEFAULT_MAX_BYTES, formatSize } from \"../truncate.ts\";\n\nfunction formatFindCall(args: { pattern: string; path?: string; limit?: number } | undefined, theme: Theme): string {\n\tconst pattern = str(args?.pattern);\n\tconst rawPath = str(args?.path);\n\tconst path = rawPath !== null ? shortenPath(rawPath || \".\") : null;\n\tconst limit = args?.limit;\n\tconst invalidArg = invalidArgText(theme);\n\tlet text =\n\t\ttheme.fg(\"toolTitle\", theme.bold(\"find\")) +\n\t\t\" \" +\n\t\t(pattern === null ? invalidArg : theme.fg(\"accent\", pattern || \"\")) +\n\t\ttheme.fg(\"toolOutput\", ` in ${path === null ? invalidArg : path}`);\n\tif (limit !== undefined) {\n\t\ttext += theme.fg(\"toolOutput\", ` (limit ${limit})`);\n\t}\n\treturn text;\n}\nfunction formatFindResult(\n\tresult: {\n\t\tcontent: Array<{ type: string; text?: string; data?: string; mimeType?: string }>;\n\t\tdetails?: FindToolDetails;\n\t},\n\toptions: ToolRenderResultOptions,\n\ttheme: Theme,\n\tshowImages: boolean,\n): string {\n\tconst output = getTextOutput(result, showImages).trim();\n\tlet text = \"\";\n\tif (output) {\n\t\tconst lines = output.split(\"\\n\");\n\t\tconst maxLines = options.expanded ? lines.length : 20;\n\t\tconst displayLines = lines.slice(0, maxLines);\n\t\tconst remaining = lines.length - maxLines;\n\t\ttext += `\\n${displayLines.map((line) => theme.fg(\"toolOutput\", line)).join(\"\\n\")}`;\n\t\tif (remaining > 0) {\n\t\t\ttext += `${theme.fg(\"muted\", `\\n... (${remaining} more lines,`)} ${keyHint(\"app.tools.expand\", \"to expand\")}${theme.fg(\"muted\", \")\")}`;\n\t\t}\n\t}\n\n\tconst resultLimit = result.details?.resultLimitReached;\n\tconst truncation = result.details?.truncation;\n\tif (resultLimit || truncation?.truncated) {\n\t\tconst warnings: string[] = [];\n\t\tif (resultLimit) warnings.push(`${resultLimit} results limit`);\n\t\tif (truncation?.truncated) warnings.push(`${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit`);\n\t\ttext += `\\n${theme.fg(\"warning\", `[Truncated: ${warnings.join(\", \")}]`)}`;\n\t}\n\treturn text;\n}\n\nexport const findRenderers: Pick<ToolDefinition<any, any>, \"renderCall\" | \"renderResult\"> = {\n\trenderCall(args, theme, context) {\n\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\ttext.setText(formatFindCall(args as any, theme));\n\t\treturn text;\n\t},\n\trenderResult(result, options, theme, context) {\n\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\ttext.setText(formatFindResult(result as any, options, theme, context.showImages));\n\t\treturn text;\n\t},\n};\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Presentation for the grep tool.
|
|
3
|
-
*
|
|
4
|
-
* Renderers live apart from the implementation so a process that only displays tool output does not
|
|
5
|
-
* load the execution path or its typebox parameter schema. `grep.ts` spreads these into its
|
|
6
|
-
* definition, so the tool's public shape is unchanged.
|
|
7
|
-
*/
|
|
8
|
-
import type { ToolDefinition } from "../../extensions/types.ts";
|
|
9
|
-
export declare const grepRenderers: Pick<ToolDefinition<any, any>, "renderCall" | "renderResult">;
|
|
10
|
-
//# sourceMappingURL=grep.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grep.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/renderers/grep.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,cAAc,EAA2B,MAAM,2BAA2B,CAAC;AA2DzF,eAAO,MAAM,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,YAAY,GAAG,cAAc,CAWvF,CAAC"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Presentation for the grep tool.
|
|
3
|
-
*
|
|
4
|
-
* Renderers live apart from the implementation so a process that only displays tool output does not
|
|
5
|
-
* load the execution path or its typebox parameter schema. `grep.ts` spreads these into its
|
|
6
|
-
* definition, so the tool's public shape is unchanged.
|
|
7
|
-
*/
|
|
8
|
-
import { Text } from "@earendil-works/pi-tui";
|
|
9
|
-
import { keyHint } from "../../../modes/interactive/components/keybinding-hints.js";
|
|
10
|
-
import { getTextOutput, invalidArgText, shortenPath, str } from "../render-utils.js";
|
|
11
|
-
import { DEFAULT_MAX_BYTES, formatSize } from "../truncate.js";
|
|
12
|
-
function formatGrepCall(args, theme) {
|
|
13
|
-
const pattern = str(args?.pattern);
|
|
14
|
-
const rawPath = str(args?.path);
|
|
15
|
-
const path = rawPath !== null ? shortenPath(rawPath || ".") : null;
|
|
16
|
-
const glob = str(args?.glob);
|
|
17
|
-
const limit = args?.limit;
|
|
18
|
-
const invalidArg = invalidArgText(theme);
|
|
19
|
-
let text = theme.fg("toolTitle", theme.bold("grep")) +
|
|
20
|
-
" " +
|
|
21
|
-
(pattern === null ? invalidArg : theme.fg("accent", `/${pattern || ""}/`)) +
|
|
22
|
-
theme.fg("toolOutput", ` in ${path === null ? invalidArg : path}`);
|
|
23
|
-
if (glob)
|
|
24
|
-
text += theme.fg("toolOutput", ` (${glob})`);
|
|
25
|
-
if (limit !== undefined)
|
|
26
|
-
text += theme.fg("toolOutput", ` limit ${limit}`);
|
|
27
|
-
return text;
|
|
28
|
-
}
|
|
29
|
-
function formatGrepResult(result, options, theme, showImages) {
|
|
30
|
-
const output = getTextOutput(result, showImages).trim();
|
|
31
|
-
let text = "";
|
|
32
|
-
if (output) {
|
|
33
|
-
const lines = output.split("\n");
|
|
34
|
-
const maxLines = options.expanded ? lines.length : 15;
|
|
35
|
-
const displayLines = lines.slice(0, maxLines);
|
|
36
|
-
const remaining = lines.length - maxLines;
|
|
37
|
-
text += `\n${displayLines.map((line) => theme.fg("toolOutput", line)).join("\n")}`;
|
|
38
|
-
if (remaining > 0) {
|
|
39
|
-
text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("app.tools.expand", "to expand")}${theme.fg("muted", ")")}`;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
const matchLimit = result.details?.matchLimitReached;
|
|
43
|
-
const truncation = result.details?.truncation;
|
|
44
|
-
const linesTruncated = result.details?.linesTruncated;
|
|
45
|
-
if (matchLimit || truncation?.truncated || linesTruncated) {
|
|
46
|
-
const warnings = [];
|
|
47
|
-
if (matchLimit)
|
|
48
|
-
warnings.push(`${matchLimit} matches limit`);
|
|
49
|
-
if (truncation?.truncated)
|
|
50
|
-
warnings.push(`${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit`);
|
|
51
|
-
if (linesTruncated)
|
|
52
|
-
warnings.push("some lines truncated");
|
|
53
|
-
text += `\n${theme.fg("warning", `[Truncated: ${warnings.join(", ")}]`)}`;
|
|
54
|
-
}
|
|
55
|
-
return text;
|
|
56
|
-
}
|
|
57
|
-
export const grepRenderers = {
|
|
58
|
-
renderCall(args, theme, context) {
|
|
59
|
-
const text = context.lastComponent ?? new Text("", 0, 0);
|
|
60
|
-
text.setText(formatGrepCall(args, theme));
|
|
61
|
-
return text;
|
|
62
|
-
},
|
|
63
|
-
renderResult(result, options, theme, context) {
|
|
64
|
-
const text = context.lastComponent ?? new Text("", 0, 0);
|
|
65
|
-
text.setText(formatGrepResult(result, options, theme, context.showImages));
|
|
66
|
-
return text;
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
//# sourceMappingURL=grep.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grep.js","sourceRoot":"","sources":["../../../../src/core/tools/renderers/grep.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,2DAA2D,CAAC;AAIpF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG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a,EAAE,CAAC;QAC9B,IAAI,UAAU;YAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,UAAU,gBAAgB,CAAC,CAAC;QAC7D,IAAI,UAAU,EAAE,SAAS;YAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,UAAU,CAAC,QAAQ,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAAC;QAC1G,IAAI,cAAc;YAAE,QAAQ,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAC1D,IAAI,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,eAAe,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IAC3E,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAkE;IAC3F,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO;QAC9B,MAAM,IAAI,GAAI,OAAO,CAAC,aAAkC,IAAI,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC/E,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAW,EAAE,KAAK,CAAC,CAAC,CAAC;QACjD,OAAO,IAAI,CAAC;IACb,CAAC;IACD,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO;QAC3C,MAAM,IAAI,GAAI,OAAO,CAAC,aAAkC,IAAI,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC/E,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,MAAa,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;QAClF,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC","sourcesContent":["/**\n * Presentation for the grep tool.\n *\n * Renderers live apart from the implementation so a process that only displays tool output does not\n * load the execution path or its typebox parameter schema. `grep.ts` spreads these into its\n * definition, so the tool's public shape is unchanged.\n */\n\nimport { Text } from \"@earendil-works/pi-tui\";\nimport { keyHint } from \"../../../modes/interactive/components/keybinding-hints.ts\";\nimport type { Theme } from \"../../../modes/interactive/theme/theme.ts\";\nimport type { ToolDefinition, ToolRenderResultOptions } from \"../../extensions/types.ts\";\nimport type { GrepToolDetails } from \"../grep.ts\";\nimport { getTextOutput, invalidArgText, shortenPath, str } from \"../render-utils.ts\";\nimport { DEFAULT_MAX_BYTES, formatSize } from \"../truncate.ts\";\n\nfunction formatGrepCall(\n\targs: { pattern: string; path?: string; glob?: string; limit?: number } | undefined,\n\ttheme: Theme,\n): string {\n\tconst pattern = str(args?.pattern);\n\tconst rawPath = str(args?.path);\n\tconst path = rawPath !== null ? shortenPath(rawPath || \".\") : null;\n\tconst glob = str(args?.glob);\n\tconst limit = args?.limit;\n\tconst invalidArg = invalidArgText(theme);\n\tlet text =\n\t\ttheme.fg(\"toolTitle\", theme.bold(\"grep\")) +\n\t\t\" \" +\n\t\t(pattern === null ? invalidArg : theme.fg(\"accent\", `/${pattern || \"\"}/`)) +\n\t\ttheme.fg(\"toolOutput\", ` in ${path === null ? invalidArg : path}`);\n\tif (glob) text += theme.fg(\"toolOutput\", ` (${glob})`);\n\tif (limit !== undefined) text += theme.fg(\"toolOutput\", ` limit ${limit}`);\n\treturn text;\n}\nfunction formatGrepResult(\n\tresult: {\n\t\tcontent: Array<{ type: string; text?: string; data?: string; mimeType?: string }>;\n\t\tdetails?: GrepToolDetails;\n\t},\n\toptions: ToolRenderResultOptions,\n\ttheme: Theme,\n\tshowImages: boolean,\n): string {\n\tconst output = getTextOutput(result, showImages).trim();\n\tlet text = \"\";\n\tif (output) {\n\t\tconst lines = output.split(\"\\n\");\n\t\tconst maxLines = options.expanded ? lines.length : 15;\n\t\tconst displayLines = lines.slice(0, maxLines);\n\t\tconst remaining = lines.length - maxLines;\n\t\ttext += `\\n${displayLines.map((line) => theme.fg(\"toolOutput\", line)).join(\"\\n\")}`;\n\t\tif (remaining > 0) {\n\t\t\ttext += `${theme.fg(\"muted\", `\\n... (${remaining} more lines,`)} ${keyHint(\"app.tools.expand\", \"to expand\")}${theme.fg(\"muted\", \")\")}`;\n\t\t}\n\t}\n\n\tconst matchLimit = result.details?.matchLimitReached;\n\tconst truncation = result.details?.truncation;\n\tconst linesTruncated = result.details?.linesTruncated;\n\tif (matchLimit || truncation?.truncated || linesTruncated) {\n\t\tconst warnings: string[] = [];\n\t\tif (matchLimit) warnings.push(`${matchLimit} matches limit`);\n\t\tif (truncation?.truncated) warnings.push(`${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit`);\n\t\tif (linesTruncated) warnings.push(\"some lines truncated\");\n\t\ttext += `\\n${theme.fg(\"warning\", `[Truncated: ${warnings.join(\", \")}]`)}`;\n\t}\n\treturn text;\n}\n\nexport const grepRenderers: Pick<ToolDefinition<any, any>, \"renderCall\" | \"renderResult\"> = {\n\trenderCall(args, theme, context) {\n\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\ttext.setText(formatGrepCall(args as any, theme));\n\t\treturn text;\n\t},\n\trenderResult(result, options, theme, context) {\n\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\ttext.setText(formatGrepResult(result as any, options, theme, context.showImages));\n\t\treturn text;\n\t},\n};\n"]}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Built-in tool renderers, without the tools themselves.
|
|
3
|
-
*
|
|
4
|
-
* A presentation displays tool calls and results; it does not execute them and does not need their
|
|
5
|
-
* typebox parameter schemas. Importing this instead of `core/tools/index.ts` keeps ~17 MB of module
|
|
6
|
-
* graph out of a process that only renders.
|
|
7
|
-
*/
|
|
8
|
-
import type { ToolDefinition } from "../../extensions/types.ts";
|
|
9
|
-
import type { ToolName } from "../index.ts";
|
|
10
|
-
import { createShellRenderers } from "./bash.ts";
|
|
11
|
-
import { editRenderers } from "./edit.ts";
|
|
12
|
-
import { findRenderers } from "./find.ts";
|
|
13
|
-
import { grepRenderers } from "./grep.ts";
|
|
14
|
-
import { lsRenderers } from "./ls.ts";
|
|
15
|
-
import { readRenderers } from "./read.ts";
|
|
16
|
-
import { writeRenderers } from "./write.ts";
|
|
17
|
-
export type ToolRenderers = Pick<ToolDefinition<any, any>, "renderCall" | "renderResult">;
|
|
18
|
-
export { createShellRenderers, editRenderers, findRenderers, grepRenderers, lsRenderers, readRenderers, writeRenderers, };
|
|
19
|
-
/** Renderers for every built-in tool, keyed by tool name. */
|
|
20
|
-
export declare function createAllToolRenderers(): Record<ToolName, ToolRenderers>;
|
|
21
|
-
/**
|
|
22
|
-
* Merge built-in renderers into a tool definition that does not supply its own.
|
|
23
|
-
*
|
|
24
|
-
* `ToolExecutionComponent` used to do this lookup itself, which forced every presentation to import
|
|
25
|
-
* the tool implementations. Callers do it now, so a process that renders can import renderers alone.
|
|
26
|
-
*/
|
|
27
|
-
export declare function withBuiltInRenderers<TDefinition extends ToolRenderers>(toolName: string, definition: TDefinition | undefined): TDefinition | ToolRenderers | undefined;
|
|
28
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/renderers/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,YAAY,GAAG,cAAc,CAAC,CAAC;AAE1F,OAAO,EACN,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,aAAa,EACb,WAAW,EACX,aAAa,EACb,cAAc,GACd,CAAC;AAEF,6DAA6D;AAC7D,wBAAgB,sBAAsB,IAAI,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC,CAWxE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,SAAS,aAAa,EACrE,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,WAAW,GAAG,SAAS,GACjC,WAAW,GAAG,aAAa,GAAG,SAAS,CASzC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Built-in tool renderers, without the tools themselves.
|
|
3
|
-
*
|
|
4
|
-
* A presentation displays tool calls and results; it does not execute them and does not need their
|
|
5
|
-
* typebox parameter schemas. Importing this instead of `core/tools/index.ts` keeps ~17 MB of module
|
|
6
|
-
* graph out of a process that only renders.
|
|
7
|
-
*/
|
|
8
|
-
import { createShellRenderers } from "./bash.js";
|
|
9
|
-
import { editRenderers } from "./edit.js";
|
|
10
|
-
import { findRenderers } from "./find.js";
|
|
11
|
-
import { grepRenderers } from "./grep.js";
|
|
12
|
-
import { lsRenderers } from "./ls.js";
|
|
13
|
-
import { readRenderers } from "./read.js";
|
|
14
|
-
import { writeRenderers } from "./write.js";
|
|
15
|
-
export { createShellRenderers, editRenderers, findRenderers, grepRenderers, lsRenderers, readRenderers, writeRenderers, };
|
|
16
|
-
/** Renderers for every built-in tool, keyed by tool name. */
|
|
17
|
-
export function createAllToolRenderers() {
|
|
18
|
-
return {
|
|
19
|
-
read: readRenderers,
|
|
20
|
-
bash: createShellRenderers("$"),
|
|
21
|
-
powershell: createShellRenderers("PS>"),
|
|
22
|
-
edit: editRenderers,
|
|
23
|
-
write: writeRenderers,
|
|
24
|
-
grep: grepRenderers,
|
|
25
|
-
find: findRenderers,
|
|
26
|
-
ls: lsRenderers,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Merge built-in renderers into a tool definition that does not supply its own.
|
|
31
|
-
*
|
|
32
|
-
* `ToolExecutionComponent` used to do this lookup itself, which forced every presentation to import
|
|
33
|
-
* the tool implementations. Callers do it now, so a process that renders can import renderers alone.
|
|
34
|
-
*/
|
|
35
|
-
export function withBuiltInRenderers(toolName, definition) {
|
|
36
|
-
const builtIn = createAllToolRenderers()[toolName];
|
|
37
|
-
if (!definition)
|
|
38
|
-
return builtIn;
|
|
39
|
-
if (!builtIn)
|
|
40
|
-
return definition;
|
|
41
|
-
return {
|
|
42
|
-
...definition,
|
|
43
|
-
renderCall: definition.renderCall ?? builtIn.renderCall,
|
|
44
|
-
renderResult: definition.renderResult ?? builtIn.renderResult,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/tools/renderers/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAI5C,OAAO,EACN,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,aAAa,EACb,WAAW,EACX,aAAa,EACb,cAAc,GACd,CAAC;AAEF,6DAA6D;AAC7D,MAAM,UAAU,sBAAsB;IACrC,OAAO;QACN,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,oBAAoB,CAAC,GAAG,CAAC;QAC/B,UAAU,EAAE,oBAAoB,CAAC,KAAK,CAAC;QACvC,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,aAAa;QACnB,EAAE,EAAE,WAAW;KACf,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CACnC,QAAgB,EAChB,UAAmC;IAEnC,MAAM,OAAO,GAAG,sBAAsB,EAAE,CAAC,QAAoB,CAAC,CAAC;IAC/D,IAAI,CAAC,UAAU;QAAE,OAAO,OAAO,CAAC;IAChC,IAAI,CAAC,OAAO;QAAE,OAAO,UAAU,CAAC;IAChC,OAAO;QACN,GAAG,UAAU;QACb,UAAU,EAAE,UAAU,CAAC,UAAU,IAAI,OAAO,CAAC,UAAU;QACvD,YAAY,EAAE,UAAU,CAAC,YAAY,IAAI,OAAO,CAAC,YAAY;KAC7D,CAAC;AACH,CAAC","sourcesContent":["/**\n * Built-in tool renderers, without the tools themselves.\n *\n * A presentation displays tool calls and results; it does not execute them and does not need their\n * typebox parameter schemas. Importing this instead of `core/tools/index.ts` keeps ~17 MB of module\n * graph out of a process that only renders.\n */\n\nimport type { ToolDefinition } from \"../../extensions/types.ts\";\nimport type { ToolName } from \"../index.ts\";\nimport { createShellRenderers } from \"./bash.ts\";\nimport { editRenderers } from \"./edit.ts\";\nimport { findRenderers } from \"./find.ts\";\nimport { grepRenderers } from \"./grep.ts\";\nimport { lsRenderers } from \"./ls.ts\";\nimport { readRenderers } from \"./read.ts\";\nimport { writeRenderers } from \"./write.ts\";\n\nexport type ToolRenderers = Pick<ToolDefinition<any, any>, \"renderCall\" | \"renderResult\">;\n\nexport {\n\tcreateShellRenderers,\n\teditRenderers,\n\tfindRenderers,\n\tgrepRenderers,\n\tlsRenderers,\n\treadRenderers,\n\twriteRenderers,\n};\n\n/** Renderers for every built-in tool, keyed by tool name. */\nexport function createAllToolRenderers(): Record<ToolName, ToolRenderers> {\n\treturn {\n\t\tread: readRenderers,\n\t\tbash: createShellRenderers(\"$\"),\n\t\tpowershell: createShellRenderers(\"PS>\"),\n\t\tedit: editRenderers,\n\t\twrite: writeRenderers,\n\t\tgrep: grepRenderers,\n\t\tfind: findRenderers,\n\t\tls: lsRenderers,\n\t};\n}\n\n/**\n * Merge built-in renderers into a tool definition that does not supply its own.\n *\n * `ToolExecutionComponent` used to do this lookup itself, which forced every presentation to import\n * the tool implementations. Callers do it now, so a process that renders can import renderers alone.\n */\nexport function withBuiltInRenderers<TDefinition extends ToolRenderers>(\n\ttoolName: string,\n\tdefinition: TDefinition | undefined,\n): TDefinition | ToolRenderers | undefined {\n\tconst builtIn = createAllToolRenderers()[toolName as ToolName];\n\tif (!definition) return builtIn;\n\tif (!builtIn) return definition;\n\treturn {\n\t\t...definition,\n\t\trenderCall: definition.renderCall ?? builtIn.renderCall,\n\t\trenderResult: definition.renderResult ?? builtIn.renderResult,\n\t};\n}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Presentation for the ls tool.
|
|
3
|
-
*
|
|
4
|
-
* Renderers live apart from the implementation so a process that only displays tool output does not
|
|
5
|
-
* load the execution path or its typebox parameter schema. `ls.ts` spreads these into its
|
|
6
|
-
* definition, so the tool's public shape is unchanged.
|
|
7
|
-
*/
|
|
8
|
-
import type { ToolDefinition } from "../../extensions/types.ts";
|
|
9
|
-
export declare const lsRenderers: Pick<ToolDefinition<any, any>, "renderCall" | "renderResult">;
|
|
10
|
-
//# sourceMappingURL=ls.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ls.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/renderers/ls.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,cAAc,EAA2B,MAAM,2BAA2B,CAAC;AA+CzF,eAAO,MAAM,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,YAAY,GAAG,cAAc,CAWrF,CAAC"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Presentation for the ls tool.
|
|
3
|
-
*
|
|
4
|
-
* Renderers live apart from the implementation so a process that only displays tool output does not
|
|
5
|
-
* load the execution path or its typebox parameter schema. `ls.ts` spreads these into its
|
|
6
|
-
* definition, so the tool's public shape is unchanged.
|
|
7
|
-
*/
|
|
8
|
-
import { Text } from "@earendil-works/pi-tui";
|
|
9
|
-
import { keyHint } from "../../../modes/interactive/components/keybinding-hints.js";
|
|
10
|
-
import { getTextOutput, renderToolPath, str } from "../render-utils.js";
|
|
11
|
-
import { DEFAULT_MAX_BYTES, formatSize } from "../truncate.js";
|
|
12
|
-
function formatLsCall(args, theme, cwd) {
|
|
13
|
-
const limit = args?.limit;
|
|
14
|
-
const pathDisplay = renderToolPath(str(args?.path), theme, cwd, { emptyFallback: "." });
|
|
15
|
-
let text = `${theme.fg("toolTitle", theme.bold("ls"))} ${pathDisplay}`;
|
|
16
|
-
if (limit !== undefined) {
|
|
17
|
-
text += theme.fg("toolOutput", ` (limit ${limit})`);
|
|
18
|
-
}
|
|
19
|
-
return text;
|
|
20
|
-
}
|
|
21
|
-
function formatLsResult(result, options, theme, showImages) {
|
|
22
|
-
const output = getTextOutput(result, showImages).trim();
|
|
23
|
-
let text = "";
|
|
24
|
-
if (output) {
|
|
25
|
-
const lines = output.split("\n");
|
|
26
|
-
const maxLines = options.expanded ? lines.length : 20;
|
|
27
|
-
const displayLines = lines.slice(0, maxLines);
|
|
28
|
-
const remaining = lines.length - maxLines;
|
|
29
|
-
text += `\n${displayLines.map((line) => theme.fg("toolOutput", line)).join("\n")}`;
|
|
30
|
-
if (remaining > 0) {
|
|
31
|
-
text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("app.tools.expand", "to expand")}${theme.fg("muted", ")")}`;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
const entryLimit = result.details?.entryLimitReached;
|
|
35
|
-
const truncation = result.details?.truncation;
|
|
36
|
-
if (entryLimit || truncation?.truncated) {
|
|
37
|
-
const warnings = [];
|
|
38
|
-
if (entryLimit)
|
|
39
|
-
warnings.push(`${entryLimit} entries limit`);
|
|
40
|
-
if (truncation?.truncated)
|
|
41
|
-
warnings.push(`${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit`);
|
|
42
|
-
text += `\n${theme.fg("warning", `[Truncated: ${warnings.join(", ")}]`)}`;
|
|
43
|
-
}
|
|
44
|
-
return text;
|
|
45
|
-
}
|
|
46
|
-
export const lsRenderers = {
|
|
47
|
-
renderCall(args, theme, context) {
|
|
48
|
-
const text = context.lastComponent ?? new Text("", 0, 0);
|
|
49
|
-
text.setText(formatLsCall(args, theme, context.cwd));
|
|
50
|
-
return text;
|
|
51
|
-
},
|
|
52
|
-
renderResult(result, options, theme, context) {
|
|
53
|
-
const text = context.lastComponent ?? new Text("", 0, 0);
|
|
54
|
-
text.setText(formatLsResult(result, options, theme, context.showImages));
|
|
55
|
-
return text;
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
//# sourceMappingURL=ls.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ls.js","sourceRoot":"","sources":["../../../../src/core/tools/renderers/ls.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,2DAA2D,CAAC;AAIpF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,UA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C;QAC5D,OAAO,IAAI,CAAC;IACb,CAAC;IACD,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO;QAC3C,MAAM,IAAI,GAAI,OAAO,CAAC,aAAkC,IAAI,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC/E,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,MAAa,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;QAChF,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC","sourcesContent":["/**\n * Presentation for the ls tool.\n *\n * Renderers live apart from the implementation so a process that only displays tool output does not\n * load the execution path or its typebox parameter schema. `ls.ts` spreads these into its\n * definition, so the tool's public shape is unchanged.\n */\n\nimport { Text } from \"@earendil-works/pi-tui\";\nimport { keyHint } from \"../../../modes/interactive/components/keybinding-hints.ts\";\nimport type { Theme } from \"../../../modes/interactive/theme/theme.ts\";\nimport type { ToolDefinition, ToolRenderResultOptions } from \"../../extensions/types.ts\";\nimport type { LsToolDetails } from \"../ls.ts\";\nimport { getTextOutput, renderToolPath, str } from \"../render-utils.ts\";\nimport { DEFAULT_MAX_BYTES, formatSize } from \"../truncate.ts\";\n\nfunction formatLsCall(args: { path?: string; limit?: number } | undefined, theme: Theme, cwd: string): string {\n\tconst limit = args?.limit;\n\tconst pathDisplay = renderToolPath(str(args?.path), theme, cwd, { emptyFallback: \".\" });\n\tlet text = `${theme.fg(\"toolTitle\", theme.bold(\"ls\"))} ${pathDisplay}`;\n\tif (limit !== undefined) {\n\t\ttext += theme.fg(\"toolOutput\", ` (limit ${limit})`);\n\t}\n\treturn text;\n}\nfunction formatLsResult(\n\tresult: {\n\t\tcontent: Array<{ type: string; text?: string; data?: string; mimeType?: string }>;\n\t\tdetails?: LsToolDetails;\n\t},\n\toptions: ToolRenderResultOptions,\n\ttheme: Theme,\n\tshowImages: boolean,\n): string {\n\tconst output = getTextOutput(result, showImages).trim();\n\tlet text = \"\";\n\tif (output) {\n\t\tconst lines = output.split(\"\\n\");\n\t\tconst maxLines = options.expanded ? lines.length : 20;\n\t\tconst displayLines = lines.slice(0, maxLines);\n\t\tconst remaining = lines.length - maxLines;\n\t\ttext += `\\n${displayLines.map((line) => theme.fg(\"toolOutput\", line)).join(\"\\n\")}`;\n\t\tif (remaining > 0) {\n\t\t\ttext += `${theme.fg(\"muted\", `\\n... (${remaining} more lines,`)} ${keyHint(\"app.tools.expand\", \"to expand\")}${theme.fg(\"muted\", \")\")}`;\n\t\t}\n\t}\n\n\tconst entryLimit = result.details?.entryLimitReached;\n\tconst truncation = result.details?.truncation;\n\tif (entryLimit || truncation?.truncated) {\n\t\tconst warnings: string[] = [];\n\t\tif (entryLimit) warnings.push(`${entryLimit} entries limit`);\n\t\tif (truncation?.truncated) warnings.push(`${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit`);\n\t\ttext += `\\n${theme.fg(\"warning\", `[Truncated: ${warnings.join(\", \")}]`)}`;\n\t}\n\treturn text;\n}\n\nexport const lsRenderers: Pick<ToolDefinition<any, any>, \"renderCall\" | \"renderResult\"> = {\n\trenderCall(args, theme, context) {\n\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\ttext.setText(formatLsCall(args as any, theme, context.cwd));\n\t\treturn text;\n\t},\n\trenderResult(result, options, theme, context) {\n\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\ttext.setText(formatLsResult(result as any, options, theme, context.showImages));\n\t\treturn text;\n\t},\n};\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Presentation for the read tool.
|
|
3
|
-
*
|
|
4
|
-
* Renderers live apart from the implementation so a process that only displays tool output does not
|
|
5
|
-
* load the execution path or its typebox parameter schema. `read.ts` spreads these into its
|
|
6
|
-
* definition, so the tool's public shape is unchanged.
|
|
7
|
-
*/
|
|
8
|
-
import type { ToolDefinition } from "../../extensions/types.ts";
|
|
9
|
-
import type { ReadToolDetails } from "../read.ts";
|
|
10
|
-
export declare const readRenderers: Pick<ToolDefinition<any, ReadToolDetails | undefined>, "renderCall" | "renderResult">;
|
|
11
|
-
//# sourceMappingURL=read.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/renderers/read.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,OAAO,KAAK,EAAE,cAAc,EAA2B,MAAM,2BAA2B,CAAC;AAEzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAqIlD,eAAO,MAAM,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,eAAe,GAAG,SAAS,CAAC,EAAE,YAAY,GAAG,cAAc,CAyB/G,CAAC"}
|