@code-yeongyu/senpi 2026.5.20-3 → 2026.5.21
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 +26 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +4 -10
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +10 -4
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +2 -3
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts +21 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -0
- package/dist/core/http-dispatcher.js +48 -0
- package/dist/core/http-dispatcher.js.map +1 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +2 -1
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +3 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +20 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +2 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +15 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +10 -1
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/senpi +4 -10
- package/dist/utils/paths.d.ts +1 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +16 -0
- package/dist/utils/paths.js.map +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +2 -2
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +2 -2
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +3 -3
- package/node_modules/@earendil-works/pi-agent-core/README.md +488 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts +24 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +610 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +120 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +405 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts +92 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +904 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts +53 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js +174 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts +95 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +533 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.d.ts +25 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.js +131 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts +51 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +486 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts +52 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js +102 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.d.ts +48 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js +230 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.d.ts +26 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js +101 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.d.ts +33 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js +231 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.d.ts +18 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js +42 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.d.ts +25 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js +114 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.d.ts +11 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js +39 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts +32 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +197 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/uuid.d.ts +2 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/uuid.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/uuid.js +50 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/uuid.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts +44 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js +311 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/system-prompt.d.ts +3 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/system-prompt.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/system-prompt.js +30 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/system-prompt.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts +604 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js +103 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.d.ts +14 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js +126 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.d.ts +70 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js +290 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +20 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js +25 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/node.d.ts +3 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/node.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/node.js +3 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/node.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts +69 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +278 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +394 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/types.js +2 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/package.json +61 -0
- package/node_modules/@earendil-works/pi-ai/README.md +1386 -0
- package/node_modules/@earendil-works/pi-ai/dist/api-registry.d.ts +20 -0
- package/node_modules/@earendil-works/pi-ai/dist/api-registry.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api-registry.js +44 -0
- package/node_modules/@earendil-works/pi-ai/dist/api-registry.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/bedrock-provider.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/bedrock-provider.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/bedrock-provider.js +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/bedrock-provider.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/cli.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/cli.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/cli.js +116 -0
- package/node_modules/@earendil-works/pi-ai/dist/cli.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.d.ts +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +178 -0
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.d.ts +10 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts +440 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +442 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.js +23 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/images-api-registry.d.ts +14 -0
- package/node_modules/@earendil-works/pi-ai/dist/images-api-registry.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/images-api-registry.js +22 -0
- package/node_modules/@earendil-works/pi-ai/dist/images-api-registry.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/images.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/images.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/images.js +14 -0
- package/node_modules/@earendil-works/pi-ai/dist/images.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +33 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.js +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +37 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +17658 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +16510 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.js +114 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/oauth.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/oauth.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/oauth.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/oauth.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts +38 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +787 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts +52 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +1127 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +229 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare.d.ts +13 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare.js +26 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts +66 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +401 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot-headers.d.ts +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot-headers.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot-headers.js +29 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot-headers.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.d.ts +73 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.js +359 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.d.ts +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js +465 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.d.ts +13 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.js +431 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.js +129 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/register-builtins.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/register-builtins.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/register-builtins.js +34 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/register-builtins.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.d.ts +25 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.js +542 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.d.ts +30 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +1112 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.d.ts +22 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +977 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-prompt-cache.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-prompt-cache.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-prompt-cache.js +10 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-prompt-cache.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.d.ts +19 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js +579 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.d.ts +13 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +651 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/register-builtins.d.ts +35 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/register-builtins.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/register-builtins.js +254 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/register-builtins.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.d.ts +38 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js +174 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/transform-messages.d.ts +16 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/transform-messages.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/transform-messages.js +186 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/transform-messages.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/session-resources.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/session-resources.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/session-resources.js +22 -0
- package/node_modules/@earendil-works/pi-ai/dist/session-resources.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/stream.d.ts +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/stream.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/stream.js +42 -0
- package/node_modules/@earendil-works/pi-ai/dist/stream.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.d.ts +22 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.js +161 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.d.ts +13 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.js +23 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.d.ts +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.js +559 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/hermes.d.ts +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/hermes.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/hermes.js +69 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/hermes.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/json-mix.d.ts +12 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/json-mix.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/json-mix.js +570 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/json-mix.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/morph-xml.d.ts +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/morph-xml.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/morph-xml.js +935 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/morph-xml.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/xml-tool-tag-scanner.d.ts +14 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/xml-tool-tag-scanner.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/xml-tool-tag-scanner.js +54 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/xml-tool-tag-scanner.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/yaml-xml.d.ts +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/yaml-xml.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/yaml-xml.js +295 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/yaml-xml.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.js +336 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/types.d.ts +103 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/types.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/types.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +543 -0
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/types.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.d.ts +19 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.js +25 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +81 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/hash.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/hash.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/hash.js +14 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/hash.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/headers.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/headers.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/headers.js +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/headers.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/json-parse.d.ts +16 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/json-parse.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/json-parse.js +113 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/json-parse.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.d.ts +10 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.js +97 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.d.ts +25 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.js +335 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.d.ts +30 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +292 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.d.ts +57 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js +121 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/oauth-page.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/oauth-page.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/oauth-page.js +105 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/oauth-page.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.d.ts +34 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js +385 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/pkce.d.ts +13 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/pkce.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/pkce.js +31 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/pkce.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/types.d.ts +57 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/types.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/types.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts +56 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +151 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.d.ts +22 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.js +26 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-pair-repair.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-pair-repair.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-pair-repair.js +49 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/tool-pair-repair.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/typebox-helpers.d.ts +17 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/typebox-helpers.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/typebox-helpers.js +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/typebox-helpers.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/validation.d.ts +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/validation.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/validation.js +281 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/validation.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/package.json +113 -0
- package/node_modules/@earendil-works/pi-tui/README.md +779 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +54 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +632 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +22 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js +104 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts +22 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js +35 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +249 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +1916 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts +28 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/image.js +89 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts +37 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js +426 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts +40 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +95 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +90 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +634 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts +50 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +159 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +50 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +185 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts +12 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js +23 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts +19 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.js +89 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts +13 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js +51 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts +39 -0
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.js +2 -0
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts +16 -0
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js +110 -0
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +23 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.js +32 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +193 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +174 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts +184 -0
- package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/keys.js +1173 -0
- package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts +28 -0
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js +44 -0
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +50 -0
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +361 -0
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +90 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +336 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +88 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +329 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +231 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +1230 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts +17 -0
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js +25 -0
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +79 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +1031 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/package.json +48 -0
- package/node_modules/@smithy/node-http-handler/LICENSE +201 -0
- package/node_modules/@smithy/node-http-handler/README.md +9 -0
- package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +724 -0
- package/node_modules/@smithy/node-http-handler/dist-es/constants.js +1 -0
- package/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +9 -0
- package/node_modules/@smithy/node-http-handler/dist-es/index.js +3 -0
- package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +216 -0
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +87 -0
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +32 -0
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +170 -0
- package/node_modules/@smithy/node-http-handler/dist-es/readable.mock.js +21 -0
- package/node_modules/@smithy/node-http-handler/dist-es/server.mock.js +88 -0
- package/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js +36 -0
- package/node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js +21 -0
- package/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js +22 -0
- package/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +23 -0
- package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +8 -0
- package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js +41 -0
- package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/readable.mock.js +21 -0
- package/node_modules/@smithy/node-http-handler/dist-es/timing.js +4 -0
- package/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +56 -0
- package/node_modules/@smithy/node-http-handler/dist-types/constants.d.ts +5 -0
- package/node_modules/@smithy/node-http-handler/dist-types/get-transformed-headers.d.ts +4 -0
- package/node_modules/@smithy/node-http-handler/dist-types/index.d.ts +3 -0
- package/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +46 -0
- package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +24 -0
- package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +12 -0
- package/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +63 -0
- package/node_modules/@smithy/node-http-handler/dist-types/readable.mock.d.ts +13 -0
- package/node_modules/@smithy/node-http-handler/dist-types/server.mock.d.ts +12 -0
- package/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +2 -0
- package/node_modules/@smithy/node-http-handler/dist-types/set-request-timeout.d.ts +6 -0
- package/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +6 -0
- package/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +2 -0
- package/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +5 -0
- package/node_modules/@smithy/node-http-handler/dist-types/stream-collector/index.d.ts +6 -0
- package/node_modules/@smithy/node-http-handler/dist-types/stream-collector/readable.mock.d.ts +13 -0
- package/node_modules/@smithy/node-http-handler/dist-types/timing.d.ts +8 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/constants.d.ts +5 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts +4 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/index.d.ts +3 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +46 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +24 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +12 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +63 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/readable.mock.d.ts +13 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/server.mock.d.ts +12 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +2 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-request-timeout.d.ts +6 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +6 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +2 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/collector.d.ts +5 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/index.d.ts +6 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/readable.mock.d.ts +13 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/timing.d.ts +8 -0
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +11 -0
- package/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +11 -0
- package/node_modules/@smithy/node-http-handler/package.json +68 -0
- package/node_modules/@smithy/types/LICENSE +201 -0
- package/node_modules/@smithy/types/README.md +115 -0
- package/node_modules/@smithy/types/dist-cjs/index.js +91 -0
- package/node_modules/@smithy/types/dist-es/abort-handler.js +1 -0
- package/node_modules/@smithy/types/dist-es/abort.js +1 -0
- package/node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js +5 -0
- package/node_modules/@smithy/types/dist-es/auth/HttpAuthScheme.js +1 -0
- package/node_modules/@smithy/types/dist-es/auth/HttpAuthSchemeProvider.js +1 -0
- package/node_modules/@smithy/types/dist-es/auth/HttpSigner.js +1 -0
- package/node_modules/@smithy/types/dist-es/auth/IdentityProviderConfig.js +1 -0
- package/node_modules/@smithy/types/dist-es/auth/auth.js +5 -0
- package/node_modules/@smithy/types/dist-es/auth/index.js +6 -0
- package/node_modules/@smithy/types/dist-es/blob/blob-payload-input-types.js +1 -0
- package/node_modules/@smithy/types/dist-es/checksum.js +1 -0
- package/node_modules/@smithy/types/dist-es/client.js +1 -0
- package/node_modules/@smithy/types/dist-es/command.js +1 -0
- package/node_modules/@smithy/types/dist-es/connection/config.js +1 -0
- package/node_modules/@smithy/types/dist-es/connection/index.js +3 -0
- package/node_modules/@smithy/types/dist-es/connection/manager.js +1 -0
- package/node_modules/@smithy/types/dist-es/connection/pool.js +1 -0
- package/node_modules/@smithy/types/dist-es/crypto.js +1 -0
- package/node_modules/@smithy/types/dist-es/downlevel-ts3.4/transform/type-transform.js +1 -0
- package/node_modules/@smithy/types/dist-es/encode.js +1 -0
- package/node_modules/@smithy/types/dist-es/endpoint.js +5 -0
- package/node_modules/@smithy/types/dist-es/endpoints/EndpointRuleObject.js +1 -0
- package/node_modules/@smithy/types/dist-es/endpoints/ErrorRuleObject.js +1 -0
- package/node_modules/@smithy/types/dist-es/endpoints/RuleSetObject.js +1 -0
- package/node_modules/@smithy/types/dist-es/endpoints/TreeRuleObject.js +1 -0
- package/node_modules/@smithy/types/dist-es/endpoints/index.js +5 -0
- package/node_modules/@smithy/types/dist-es/endpoints/shared.js +1 -0
- package/node_modules/@smithy/types/dist-es/eventStream.js +1 -0
- package/node_modules/@smithy/types/dist-es/extensions/checksum.js +38 -0
- package/node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js +7 -0
- package/node_modules/@smithy/types/dist-es/extensions/defaultExtensionConfiguration.js +1 -0
- package/node_modules/@smithy/types/dist-es/extensions/index.js +3 -0
- package/node_modules/@smithy/types/dist-es/extensions/retry.js +1 -0
- package/node_modules/@smithy/types/dist-es/externals-check/browser-externals-check.js +1 -0
- package/node_modules/@smithy/types/dist-es/feature-ids.js +1 -0
- package/node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js +1 -0
- package/node_modules/@smithy/types/dist-es/http.js +5 -0
- package/node_modules/@smithy/types/dist-es/identity/apiKeyIdentity.js +1 -0
- package/node_modules/@smithy/types/dist-es/identity/awsCredentialIdentity.js +1 -0
- package/node_modules/@smithy/types/dist-es/identity/identity.js +1 -0
- package/node_modules/@smithy/types/dist-es/identity/index.js +4 -0
- package/node_modules/@smithy/types/dist-es/identity/tokenIdentity.js +1 -0
- package/node_modules/@smithy/types/dist-es/index.js +42 -0
- package/node_modules/@smithy/types/dist-es/logger.js +1 -0
- package/node_modules/@smithy/types/dist-es/middleware.js +1 -0
- package/node_modules/@smithy/types/dist-es/pagination.js +1 -0
- package/node_modules/@smithy/types/dist-es/profile.js +6 -0
- package/node_modules/@smithy/types/dist-es/response.js +1 -0
- package/node_modules/@smithy/types/dist-es/retry.js +1 -0
- package/node_modules/@smithy/types/dist-es/schema/schema-deprecated.js +1 -0
- package/node_modules/@smithy/types/dist-es/schema/schema.js +1 -0
- package/node_modules/@smithy/types/dist-es/schema/sentinels.js +1 -0
- package/node_modules/@smithy/types/dist-es/schema/static-schemas.js +1 -0
- package/node_modules/@smithy/types/dist-es/schema/traits.js +1 -0
- package/node_modules/@smithy/types/dist-es/serde.js +1 -0
- package/node_modules/@smithy/types/dist-es/shapes.js +1 -0
- package/node_modules/@smithy/types/dist-es/signature.js +1 -0
- package/node_modules/@smithy/types/dist-es/stream.js +1 -0
- package/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-common-types.js +1 -0
- package/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-input-types.js +1 -0
- package/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-output-types.js +1 -0
- package/node_modules/@smithy/types/dist-es/transfer.js +6 -0
- package/node_modules/@smithy/types/dist-es/transform/client-method-transforms.js +1 -0
- package/node_modules/@smithy/types/dist-es/transform/client-payload-blob-type-narrow.js +1 -0
- package/node_modules/@smithy/types/dist-es/transform/exact.js +1 -0
- package/node_modules/@smithy/types/dist-es/transform/mutable.js +1 -0
- package/node_modules/@smithy/types/dist-es/transform/no-undefined.js +1 -0
- package/node_modules/@smithy/types/dist-es/transform/type-transform.js +1 -0
- package/node_modules/@smithy/types/dist-es/uri.js +1 -0
- package/node_modules/@smithy/types/dist-es/util.js +1 -0
- package/node_modules/@smithy/types/dist-es/waiter.js +1 -0
- package/node_modules/@smithy/types/dist-types/abort-handler.d.ts +7 -0
- package/node_modules/@smithy/types/dist-types/abort.d.ts +50 -0
- package/node_modules/@smithy/types/dist-types/auth/HttpApiKeyAuth.d.ts +7 -0
- package/node_modules/@smithy/types/dist-types/auth/HttpAuthScheme.d.ts +49 -0
- package/node_modules/@smithy/types/dist-types/auth/HttpAuthSchemeProvider.d.ts +20 -0
- package/node_modules/@smithy/types/dist-types/auth/HttpSigner.d.ts +41 -0
- package/node_modules/@smithy/types/dist-types/auth/IdentityProviderConfig.d.ts +14 -0
- package/node_modules/@smithy/types/dist-types/auth/auth.d.ts +57 -0
- package/node_modules/@smithy/types/dist-types/auth/index.d.ts +6 -0
- package/node_modules/@smithy/types/dist-types/blob/blob-payload-input-types.d.ts +40 -0
- package/node_modules/@smithy/types/dist-types/checksum.d.ts +63 -0
- package/node_modules/@smithy/types/dist-types/client.d.ts +57 -0
- package/node_modules/@smithy/types/dist-types/command.d.ts +28 -0
- package/node_modules/@smithy/types/dist-types/connection/config.d.ts +10 -0
- package/node_modules/@smithy/types/dist-types/connection/index.d.ts +3 -0
- package/node_modules/@smithy/types/dist-types/connection/manager.d.ts +34 -0
- package/node_modules/@smithy/types/dist-types/connection/pool.d.ts +32 -0
- package/node_modules/@smithy/types/dist-types/crypto.d.ts +60 -0
- package/node_modules/@smithy/types/dist-types/downlevel-ts3.4/transform/type-transform.d.ts +25 -0
- package/node_modules/@smithy/types/dist-types/encode.d.ts +31 -0
- package/node_modules/@smithy/types/dist-types/endpoint.d.ts +77 -0
- package/node_modules/@smithy/types/dist-types/endpoints/EndpointRuleObject.d.ts +27 -0
- package/node_modules/@smithy/types/dist-types/endpoints/ErrorRuleObject.d.ts +10 -0
- package/node_modules/@smithy/types/dist-types/endpoints/RuleSetObject.d.ts +28 -0
- package/node_modules/@smithy/types/dist-types/endpoints/TreeRuleObject.d.ts +16 -0
- package/node_modules/@smithy/types/dist-types/endpoints/index.d.ts +5 -0
- package/node_modules/@smithy/types/dist-types/endpoints/shared.d.ts +55 -0
- package/node_modules/@smithy/types/dist-types/eventStream.d.ts +137 -0
- package/node_modules/@smithy/types/dist-types/extensions/checksum.d.ts +58 -0
- package/node_modules/@smithy/types/dist-types/extensions/defaultClientConfiguration.d.ts +33 -0
- package/node_modules/@smithy/types/dist-types/extensions/defaultExtensionConfiguration.d.ts +9 -0
- package/node_modules/@smithy/types/dist-types/extensions/index.d.ts +4 -0
- package/node_modules/@smithy/types/dist-types/extensions/retry.d.ts +18 -0
- package/node_modules/@smithy/types/dist-types/externals-check/browser-externals-check.d.ts +35 -0
- package/node_modules/@smithy/types/dist-types/feature-ids.d.ts +16 -0
- package/node_modules/@smithy/types/dist-types/http/httpHandlerInitialization.d.ts +128 -0
- package/node_modules/@smithy/types/dist-types/http.d.ts +112 -0
- package/node_modules/@smithy/types/dist-types/identity/apiKeyIdentity.d.ts +14 -0
- package/node_modules/@smithy/types/dist-types/identity/awsCredentialIdentity.d.ts +31 -0
- package/node_modules/@smithy/types/dist-types/identity/identity.d.ts +15 -0
- package/node_modules/@smithy/types/dist-types/identity/index.d.ts +4 -0
- package/node_modules/@smithy/types/dist-types/identity/tokenIdentity.d.ts +14 -0
- package/node_modules/@smithy/types/dist-types/index.d.ts +42 -0
- package/node_modules/@smithy/types/dist-types/logger.d.ts +13 -0
- package/node_modules/@smithy/types/dist-types/middleware.d.ts +534 -0
- package/node_modules/@smithy/types/dist-types/pagination.d.ts +33 -0
- package/node_modules/@smithy/types/dist-types/profile.d.ts +30 -0
- package/node_modules/@smithy/types/dist-types/response.d.ts +40 -0
- package/node_modules/@smithy/types/dist-types/retry.d.ts +133 -0
- package/node_modules/@smithy/types/dist-types/schema/schema-deprecated.d.ts +136 -0
- package/node_modules/@smithy/types/dist-types/schema/schema.d.ts +230 -0
- package/node_modules/@smithy/types/dist-types/schema/sentinels.d.ts +65 -0
- package/node_modules/@smithy/types/dist-types/schema/static-schemas.d.ts +82 -0
- package/node_modules/@smithy/types/dist-types/schema/traits.d.ts +46 -0
- package/node_modules/@smithy/types/dist-types/serde.d.ts +114 -0
- package/node_modules/@smithy/types/dist-types/shapes.d.ts +82 -0
- package/node_modules/@smithy/types/dist-types/signature.d.ts +155 -0
- package/node_modules/@smithy/types/dist-types/stream.d.ts +22 -0
- package/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-common-types.d.ts +32 -0
- package/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-input-types.d.ts +60 -0
- package/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-output-types.d.ts +51 -0
- package/node_modules/@smithy/types/dist-types/transfer.d.ts +41 -0
- package/node_modules/@smithy/types/dist-types/transform/client-method-transforms.d.ts +26 -0
- package/node_modules/@smithy/types/dist-types/transform/client-payload-blob-type-narrow.d.ts +77 -0
- package/node_modules/@smithy/types/dist-types/transform/exact.d.ts +6 -0
- package/node_modules/@smithy/types/dist-types/transform/mutable.d.ts +6 -0
- package/node_modules/@smithy/types/dist-types/transform/no-undefined.d.ts +68 -0
- package/node_modules/@smithy/types/dist-types/transform/type-transform.d.ts +34 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/abort-handler.d.ts +7 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/abort.d.ts +50 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpApiKeyAuth.d.ts +7 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpAuthScheme.d.ts +49 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpAuthSchemeProvider.d.ts +20 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpSigner.d.ts +41 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/auth/IdentityProviderConfig.d.ts +14 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/auth/auth.d.ts +57 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/auth/index.d.ts +6 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/blob/blob-payload-input-types.d.ts +40 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/checksum.d.ts +63 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/client.d.ts +57 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/command.d.ts +28 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/connection/config.d.ts +10 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/connection/index.d.ts +3 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/connection/manager.d.ts +34 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/connection/pool.d.ts +32 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/crypto.d.ts +60 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/downlevel-ts3.4/transform/type-transform.d.ts +41 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/encode.d.ts +31 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/endpoint.d.ts +77 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/endpoints/EndpointRuleObject.d.ts +27 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/endpoints/ErrorRuleObject.d.ts +10 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/endpoints/RuleSetObject.d.ts +28 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/endpoints/TreeRuleObject.d.ts +16 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/endpoints/index.d.ts +5 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/endpoints/shared.d.ts +55 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/eventStream.d.ts +137 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/extensions/checksum.d.ts +58 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/extensions/defaultClientConfiguration.d.ts +33 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/extensions/defaultExtensionConfiguration.d.ts +9 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/extensions/index.d.ts +4 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/extensions/retry.d.ts +18 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/externals-check/browser-externals-check.d.ts +35 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/feature-ids.d.ts +16 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/http/httpHandlerInitialization.d.ts +128 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/http.d.ts +112 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/identity/apiKeyIdentity.d.ts +14 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/identity/awsCredentialIdentity.d.ts +31 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/identity/identity.d.ts +15 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/identity/index.d.ts +4 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/identity/tokenIdentity.d.ts +14 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/index.d.ts +42 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/logger.d.ts +13 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/middleware.d.ts +534 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/pagination.d.ts +33 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/profile.d.ts +30 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/response.d.ts +40 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/retry.d.ts +133 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/schema/schema-deprecated.d.ts +142 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/schema/schema.d.ts +245 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/schema/sentinels.d.ts +65 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/schema/static-schemas.d.ts +101 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/schema/traits.d.ts +46 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/serde.d.ts +114 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/shapes.d.ts +82 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/signature.d.ts +155 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/stream.d.ts +22 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-common-types.d.ts +32 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-payload-input-types.d.ts +60 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-payload-output-types.d.ts +51 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/transfer.d.ts +41 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/transform/client-method-transforms.d.ts +26 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/transform/client-payload-blob-type-narrow.d.ts +81 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/transform/exact.d.ts +14 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/transform/mutable.d.ts +6 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/transform/no-undefined.d.ts +88 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/transform/type-transform.d.ts +41 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/uri.d.ts +17 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/util.d.ts +192 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/waiter.d.ts +35 -0
- package/node_modules/@smithy/types/dist-types/uri.d.ts +17 -0
- package/node_modules/@smithy/types/dist-types/util.d.ts +176 -0
- package/node_modules/@smithy/types/dist-types/waiter.d.ts +35 -0
- package/node_modules/@smithy/types/package.json +61 -0
- package/node_modules/marked/LICENSE.md +44 -0
- package/node_modules/marked/README.md +106 -0
- package/node_modules/marked/bin/main.js +282 -0
- package/node_modules/marked/bin/marked.js +15 -0
- package/node_modules/marked/lib/marked.cjs +2211 -0
- package/node_modules/marked/lib/marked.cjs.map +7 -0
- package/node_modules/marked/lib/marked.d.cts +728 -0
- package/node_modules/marked/lib/marked.d.ts +728 -0
- package/node_modules/marked/lib/marked.esm.js +2189 -0
- package/node_modules/marked/lib/marked.esm.js.map +7 -0
- package/node_modules/marked/lib/marked.umd.js +2213 -0
- package/node_modules/marked/lib/marked.umd.js.map +7 -0
- package/node_modules/marked/man/marked.1 +111 -0
- package/node_modules/marked/man/marked.1.md +92 -0
- package/node_modules/marked/marked.min.js +69 -0
- package/node_modules/marked/package.json +111 -0
- package/npm-shrinkwrap.json +1841 -0
- package/package.json +49 -31
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
import { constants, createReadStream } from "node:fs";
|
|
4
|
+
import { access, appendFile, lstat, mkdir, mkdtemp, readdir, readFile, realpath, rm, writeFile, } from "node:fs/promises";
|
|
5
|
+
import { tmpdir } from "node:os";
|
|
6
|
+
import { isAbsolute, join, resolve } from "node:path";
|
|
7
|
+
import { createInterface } from "node:readline";
|
|
8
|
+
import { ExecutionError, err, FileError, ok, toError, } from "../types.js";
|
|
9
|
+
function resolvePath(cwd, path) {
|
|
10
|
+
return isAbsolute(path) ? path : resolve(cwd, path);
|
|
11
|
+
}
|
|
12
|
+
function fileKindFromStats(stats) {
|
|
13
|
+
if (stats.isFile())
|
|
14
|
+
return "file";
|
|
15
|
+
if (stats.isDirectory())
|
|
16
|
+
return "directory";
|
|
17
|
+
if (stats.isSymbolicLink())
|
|
18
|
+
return "symlink";
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
function fileInfoFromStats(path, stats) {
|
|
22
|
+
const kind = fileKindFromStats(stats);
|
|
23
|
+
if (!kind)
|
|
24
|
+
return err(new FileError("invalid", "Unsupported file type", path));
|
|
25
|
+
return ok({
|
|
26
|
+
name: path.replace(/\/+$/, "").split("/").pop() ?? path,
|
|
27
|
+
path,
|
|
28
|
+
kind,
|
|
29
|
+
size: stats.size,
|
|
30
|
+
mtimeMs: stats.mtimeMs,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function isNodeError(error) {
|
|
34
|
+
return error instanceof Error && "code" in error;
|
|
35
|
+
}
|
|
36
|
+
function toFileError(error, path) {
|
|
37
|
+
if (error instanceof FileError)
|
|
38
|
+
return error;
|
|
39
|
+
const cause = toError(error);
|
|
40
|
+
if (isNodeError(error)) {
|
|
41
|
+
const message = error.message;
|
|
42
|
+
switch (error.code) {
|
|
43
|
+
case "ABORT_ERR":
|
|
44
|
+
return new FileError("aborted", message, path, cause);
|
|
45
|
+
case "ENOENT":
|
|
46
|
+
return new FileError("not_found", message, path, cause);
|
|
47
|
+
case "EACCES":
|
|
48
|
+
case "EPERM":
|
|
49
|
+
return new FileError("permission_denied", message, path, cause);
|
|
50
|
+
case "ENOTDIR":
|
|
51
|
+
return new FileError("not_directory", message, path, cause);
|
|
52
|
+
case "EISDIR":
|
|
53
|
+
return new FileError("is_directory", message, path, cause);
|
|
54
|
+
case "EINVAL":
|
|
55
|
+
return new FileError("invalid", message, path, cause);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return new FileError("unknown", cause.message, path, cause);
|
|
59
|
+
}
|
|
60
|
+
function abortResult(signal, path) {
|
|
61
|
+
return signal?.aborted ? err(new FileError("aborted", "aborted", path)) : undefined;
|
|
62
|
+
}
|
|
63
|
+
async function pathExists(path) {
|
|
64
|
+
try {
|
|
65
|
+
await access(path, constants.F_OK);
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async function runCommand(command, args, timeoutMs) {
|
|
73
|
+
return await new Promise((resolve) => {
|
|
74
|
+
let stdout = "";
|
|
75
|
+
let child;
|
|
76
|
+
try {
|
|
77
|
+
child = spawn(command, args, {
|
|
78
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
79
|
+
windowsHide: true,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
resolve({ stdout: "", status: null });
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const timeout = setTimeout(() => {
|
|
87
|
+
if (child.pid)
|
|
88
|
+
killProcessTree(child.pid);
|
|
89
|
+
}, timeoutMs);
|
|
90
|
+
child.stdout?.setEncoding("utf8");
|
|
91
|
+
child.stdout?.on("data", (chunk) => {
|
|
92
|
+
stdout += chunk;
|
|
93
|
+
});
|
|
94
|
+
child.on("error", () => {
|
|
95
|
+
clearTimeout(timeout);
|
|
96
|
+
resolve({ stdout: "", status: null });
|
|
97
|
+
});
|
|
98
|
+
child.on("close", (status) => {
|
|
99
|
+
clearTimeout(timeout);
|
|
100
|
+
resolve({ stdout, status });
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
async function findBashOnPath() {
|
|
105
|
+
const result = process.platform === "win32"
|
|
106
|
+
? await runCommand("where", ["bash.exe"], 5000)
|
|
107
|
+
: await runCommand("which", ["bash"], 5000);
|
|
108
|
+
if (result.status !== 0 || !result.stdout)
|
|
109
|
+
return null;
|
|
110
|
+
const firstMatch = result.stdout.trim().split(/\r?\n/)[0];
|
|
111
|
+
return firstMatch && (await pathExists(firstMatch)) ? firstMatch : null;
|
|
112
|
+
}
|
|
113
|
+
async function getShellConfig(customShellPath) {
|
|
114
|
+
if (customShellPath) {
|
|
115
|
+
if (await pathExists(customShellPath)) {
|
|
116
|
+
return ok({ shell: customShellPath, args: ["-c"] });
|
|
117
|
+
}
|
|
118
|
+
return err(new ExecutionError("shell_unavailable", `Custom shell path not found: ${customShellPath}`));
|
|
119
|
+
}
|
|
120
|
+
if (process.platform === "win32") {
|
|
121
|
+
const candidates = [];
|
|
122
|
+
const programFiles = process.env.ProgramFiles;
|
|
123
|
+
if (programFiles)
|
|
124
|
+
candidates.push(`${programFiles}\\Git\\bin\\bash.exe`);
|
|
125
|
+
const programFilesX86 = process.env["ProgramFiles(x86)"];
|
|
126
|
+
if (programFilesX86)
|
|
127
|
+
candidates.push(`${programFilesX86}\\Git\\bin\\bash.exe`);
|
|
128
|
+
for (const candidate of candidates) {
|
|
129
|
+
if (await pathExists(candidate)) {
|
|
130
|
+
return ok({ shell: candidate, args: ["-c"] });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
const bashOnPath = await findBashOnPath();
|
|
134
|
+
if (bashOnPath) {
|
|
135
|
+
return ok({ shell: bashOnPath, args: ["-c"] });
|
|
136
|
+
}
|
|
137
|
+
return err(new ExecutionError("shell_unavailable", "No bash shell found"));
|
|
138
|
+
}
|
|
139
|
+
if (await pathExists("/bin/bash")) {
|
|
140
|
+
return ok({ shell: "/bin/bash", args: ["-c"] });
|
|
141
|
+
}
|
|
142
|
+
const bashOnPath = await findBashOnPath();
|
|
143
|
+
if (bashOnPath) {
|
|
144
|
+
return ok({ shell: bashOnPath, args: ["-c"] });
|
|
145
|
+
}
|
|
146
|
+
return ok({ shell: "sh", args: ["-c"] });
|
|
147
|
+
}
|
|
148
|
+
function getShellEnv(baseEnv, extraEnv) {
|
|
149
|
+
return {
|
|
150
|
+
...process.env,
|
|
151
|
+
...baseEnv,
|
|
152
|
+
...extraEnv,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function killProcessTree(pid) {
|
|
156
|
+
if (process.platform === "win32") {
|
|
157
|
+
try {
|
|
158
|
+
spawn("taskkill", ["/F", "/T", "/PID", String(pid)], {
|
|
159
|
+
stdio: "ignore",
|
|
160
|
+
detached: true,
|
|
161
|
+
windowsHide: true,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
// Ignore errors.
|
|
166
|
+
}
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
try {
|
|
170
|
+
process.kill(-pid, "SIGKILL");
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
try {
|
|
174
|
+
process.kill(pid, "SIGKILL");
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
// Process already dead.
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
export class NodeExecutionEnv {
|
|
182
|
+
cwd;
|
|
183
|
+
shellPath;
|
|
184
|
+
shellEnv;
|
|
185
|
+
constructor(options) {
|
|
186
|
+
this.cwd = options.cwd;
|
|
187
|
+
this.shellPath = options.shellPath;
|
|
188
|
+
this.shellEnv = options.shellEnv;
|
|
189
|
+
}
|
|
190
|
+
async absolutePath(path) {
|
|
191
|
+
return ok(resolvePath(this.cwd, path));
|
|
192
|
+
}
|
|
193
|
+
async joinPath(parts) {
|
|
194
|
+
return ok(join(...parts));
|
|
195
|
+
}
|
|
196
|
+
async exec(command, options) {
|
|
197
|
+
if (options?.abortSignal?.aborted)
|
|
198
|
+
return err(new ExecutionError("aborted", "aborted"));
|
|
199
|
+
const cwd = options?.cwd ? resolvePath(this.cwd, options.cwd) : this.cwd;
|
|
200
|
+
const shellConfig = await getShellConfig(this.shellPath);
|
|
201
|
+
if (!shellConfig.ok)
|
|
202
|
+
return shellConfig;
|
|
203
|
+
return await new Promise((resolvePromise) => {
|
|
204
|
+
let stdout = "";
|
|
205
|
+
let stderr = "";
|
|
206
|
+
let settled = false;
|
|
207
|
+
let timedOut = false;
|
|
208
|
+
let callbackError;
|
|
209
|
+
let child;
|
|
210
|
+
let timeoutId;
|
|
211
|
+
const onAbort = () => {
|
|
212
|
+
if (child?.pid) {
|
|
213
|
+
killProcessTree(child.pid);
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
const settle = (result) => {
|
|
217
|
+
if (timeoutId)
|
|
218
|
+
clearTimeout(timeoutId);
|
|
219
|
+
if (options?.abortSignal)
|
|
220
|
+
options.abortSignal.removeEventListener("abort", onAbort);
|
|
221
|
+
if (settled)
|
|
222
|
+
return;
|
|
223
|
+
settled = true;
|
|
224
|
+
resolvePromise(result);
|
|
225
|
+
};
|
|
226
|
+
try {
|
|
227
|
+
child = spawn(shellConfig.value.shell, [...shellConfig.value.args, command], {
|
|
228
|
+
cwd,
|
|
229
|
+
detached: process.platform !== "win32",
|
|
230
|
+
env: getShellEnv(this.shellEnv, options?.env),
|
|
231
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
232
|
+
windowsHide: true,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
catch (error) {
|
|
236
|
+
const cause = toError(error);
|
|
237
|
+
settle(err(new ExecutionError("spawn_error", cause.message, cause)));
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
timeoutId =
|
|
241
|
+
typeof options?.timeout === "number"
|
|
242
|
+
? setTimeout(() => {
|
|
243
|
+
timedOut = true;
|
|
244
|
+
if (child?.pid) {
|
|
245
|
+
killProcessTree(child.pid);
|
|
246
|
+
}
|
|
247
|
+
}, options.timeout * 1000)
|
|
248
|
+
: undefined;
|
|
249
|
+
if (options?.abortSignal) {
|
|
250
|
+
if (options.abortSignal.aborted) {
|
|
251
|
+
onAbort();
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
options.abortSignal.addEventListener("abort", onAbort, { once: true });
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
child.stdout?.setEncoding("utf8");
|
|
258
|
+
child.stderr?.setEncoding("utf8");
|
|
259
|
+
child.stdout?.on("data", (chunk) => {
|
|
260
|
+
stdout += chunk;
|
|
261
|
+
try {
|
|
262
|
+
options?.onStdout?.(chunk);
|
|
263
|
+
}
|
|
264
|
+
catch (error) {
|
|
265
|
+
const cause = toError(error);
|
|
266
|
+
callbackError = new ExecutionError("callback_error", cause.message, cause);
|
|
267
|
+
onAbort();
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
child.stderr?.on("data", (chunk) => {
|
|
271
|
+
stderr += chunk;
|
|
272
|
+
try {
|
|
273
|
+
options?.onStderr?.(chunk);
|
|
274
|
+
}
|
|
275
|
+
catch (error) {
|
|
276
|
+
const cause = toError(error);
|
|
277
|
+
callbackError = new ExecutionError("callback_error", cause.message, cause);
|
|
278
|
+
onAbort();
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
child.on("error", (error) => {
|
|
282
|
+
settle(err(new ExecutionError("spawn_error", error.message, error)));
|
|
283
|
+
});
|
|
284
|
+
child.on("close", (code) => {
|
|
285
|
+
if (callbackError) {
|
|
286
|
+
settle(err(callbackError));
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
if (timedOut) {
|
|
290
|
+
settle(err(new ExecutionError("timeout", `timeout:${options?.timeout}`)));
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
if (options?.abortSignal?.aborted) {
|
|
294
|
+
settle(err(new ExecutionError("aborted", "aborted")));
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
settle(ok({ stdout, stderr, exitCode: code ?? 0 }));
|
|
298
|
+
});
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
async readTextFile(path, abortSignal) {
|
|
302
|
+
const resolved = resolvePath(this.cwd, path);
|
|
303
|
+
const aborted = abortResult(abortSignal, resolved);
|
|
304
|
+
if (aborted)
|
|
305
|
+
return aborted;
|
|
306
|
+
try {
|
|
307
|
+
return ok(await readFile(resolved, { encoding: "utf8", signal: abortSignal }));
|
|
308
|
+
}
|
|
309
|
+
catch (error) {
|
|
310
|
+
return err(toFileError(error, resolved));
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
async readTextLines(path, options) {
|
|
314
|
+
const resolved = resolvePath(this.cwd, path);
|
|
315
|
+
const aborted = abortResult(options?.abortSignal, resolved);
|
|
316
|
+
if (aborted)
|
|
317
|
+
return aborted;
|
|
318
|
+
if (options?.maxLines !== undefined && options.maxLines <= 0)
|
|
319
|
+
return ok([]);
|
|
320
|
+
let stream;
|
|
321
|
+
let lineReader;
|
|
322
|
+
try {
|
|
323
|
+
stream = createReadStream(resolved, { encoding: "utf8", signal: options?.abortSignal });
|
|
324
|
+
lineReader = createInterface({ input: stream, crlfDelay: Infinity });
|
|
325
|
+
const lines = [];
|
|
326
|
+
for await (const line of lineReader) {
|
|
327
|
+
const loopAbort = abortResult(options?.abortSignal, resolved);
|
|
328
|
+
if (loopAbort)
|
|
329
|
+
return loopAbort;
|
|
330
|
+
lines.push(line);
|
|
331
|
+
if (options?.maxLines !== undefined && lines.length >= options.maxLines)
|
|
332
|
+
break;
|
|
333
|
+
}
|
|
334
|
+
const afterReadAbort = abortResult(options?.abortSignal, resolved);
|
|
335
|
+
if (afterReadAbort)
|
|
336
|
+
return afterReadAbort;
|
|
337
|
+
return ok(lines);
|
|
338
|
+
}
|
|
339
|
+
catch (error) {
|
|
340
|
+
return err(toFileError(error, resolved));
|
|
341
|
+
}
|
|
342
|
+
finally {
|
|
343
|
+
lineReader?.close();
|
|
344
|
+
stream?.destroy();
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
async readBinaryFile(path, abortSignal) {
|
|
348
|
+
const resolved = resolvePath(this.cwd, path);
|
|
349
|
+
const aborted = abortResult(abortSignal, resolved);
|
|
350
|
+
if (aborted)
|
|
351
|
+
return aborted;
|
|
352
|
+
try {
|
|
353
|
+
return ok(await readFile(resolved, { signal: abortSignal }));
|
|
354
|
+
}
|
|
355
|
+
catch (error) {
|
|
356
|
+
return err(toFileError(error, resolved));
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
async writeFile(path, content, abortSignal) {
|
|
360
|
+
const resolved = resolvePath(this.cwd, path);
|
|
361
|
+
const aborted = abortResult(abortSignal, resolved);
|
|
362
|
+
if (aborted)
|
|
363
|
+
return aborted;
|
|
364
|
+
try {
|
|
365
|
+
await mkdir(resolve(resolved, ".."), { recursive: true });
|
|
366
|
+
const afterMkdirAbort = abortResult(abortSignal, resolved);
|
|
367
|
+
if (afterMkdirAbort)
|
|
368
|
+
return afterMkdirAbort;
|
|
369
|
+
await writeFile(resolved, content, { signal: abortSignal });
|
|
370
|
+
return ok(undefined);
|
|
371
|
+
}
|
|
372
|
+
catch (error) {
|
|
373
|
+
return err(toFileError(error, resolved));
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
async appendFile(path, content) {
|
|
377
|
+
const resolved = resolvePath(this.cwd, path);
|
|
378
|
+
try {
|
|
379
|
+
await mkdir(resolve(resolved, ".."), { recursive: true });
|
|
380
|
+
await appendFile(resolved, content);
|
|
381
|
+
return ok(undefined);
|
|
382
|
+
}
|
|
383
|
+
catch (error) {
|
|
384
|
+
return err(toFileError(error, resolved));
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
async fileInfo(path) {
|
|
388
|
+
const resolved = resolvePath(this.cwd, path);
|
|
389
|
+
try {
|
|
390
|
+
return fileInfoFromStats(resolved, await lstat(resolved));
|
|
391
|
+
}
|
|
392
|
+
catch (error) {
|
|
393
|
+
return err(toFileError(error, resolved));
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
async listDir(path, abortSignal) {
|
|
397
|
+
const resolved = resolvePath(this.cwd, path);
|
|
398
|
+
const aborted = abortResult(abortSignal, resolved);
|
|
399
|
+
if (aborted)
|
|
400
|
+
return aborted;
|
|
401
|
+
try {
|
|
402
|
+
const entries = await readdir(resolved, { withFileTypes: true });
|
|
403
|
+
const infos = [];
|
|
404
|
+
for (const entry of entries) {
|
|
405
|
+
const loopAbort = abortResult(abortSignal, resolved);
|
|
406
|
+
if (loopAbort)
|
|
407
|
+
return loopAbort;
|
|
408
|
+
const entryPath = resolve(resolved, entry.name);
|
|
409
|
+
try {
|
|
410
|
+
const info = fileInfoFromStats(entryPath, await lstat(entryPath));
|
|
411
|
+
if (info.ok)
|
|
412
|
+
infos.push(info.value);
|
|
413
|
+
}
|
|
414
|
+
catch (error) {
|
|
415
|
+
return err(toFileError(error, entryPath));
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
return ok(infos);
|
|
419
|
+
}
|
|
420
|
+
catch (error) {
|
|
421
|
+
return err(toFileError(error, resolved));
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
async canonicalPath(path) {
|
|
425
|
+
const resolved = resolvePath(this.cwd, path);
|
|
426
|
+
try {
|
|
427
|
+
return ok(await realpath(resolved));
|
|
428
|
+
}
|
|
429
|
+
catch (error) {
|
|
430
|
+
return err(toFileError(error, resolved));
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
async exists(path) {
|
|
434
|
+
const result = await this.fileInfo(path);
|
|
435
|
+
if (result.ok)
|
|
436
|
+
return ok(true);
|
|
437
|
+
if (result.error.code === "not_found")
|
|
438
|
+
return ok(false);
|
|
439
|
+
return err(result.error);
|
|
440
|
+
}
|
|
441
|
+
async createDir(path, options) {
|
|
442
|
+
const resolved = resolvePath(this.cwd, path);
|
|
443
|
+
try {
|
|
444
|
+
await mkdir(resolved, { recursive: options?.recursive ?? true });
|
|
445
|
+
return ok(undefined);
|
|
446
|
+
}
|
|
447
|
+
catch (error) {
|
|
448
|
+
return err(toFileError(error, resolved));
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
async remove(path, options) {
|
|
452
|
+
const resolved = resolvePath(this.cwd, path);
|
|
453
|
+
try {
|
|
454
|
+
await rm(resolved, { recursive: options?.recursive ?? false, force: options?.force ?? false });
|
|
455
|
+
return ok(undefined);
|
|
456
|
+
}
|
|
457
|
+
catch (error) {
|
|
458
|
+
return err(toFileError(error, resolved));
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
async createTempDir(prefix = "tmp-") {
|
|
462
|
+
try {
|
|
463
|
+
return ok(await mkdtemp(join(tmpdir(), prefix)));
|
|
464
|
+
}
|
|
465
|
+
catch (error) {
|
|
466
|
+
return err(toFileError(error));
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
async createTempFile(options) {
|
|
470
|
+
const dir = await this.createTempDir("tmp-");
|
|
471
|
+
if (!dir.ok)
|
|
472
|
+
return dir;
|
|
473
|
+
const filePath = join(dir.value, `${options?.prefix ?? ""}${randomUUID()}${options?.suffix ?? ""}`);
|
|
474
|
+
try {
|
|
475
|
+
await writeFile(filePath, "");
|
|
476
|
+
return ok(filePath);
|
|
477
|
+
}
|
|
478
|
+
catch (error) {
|
|
479
|
+
return err(toFileError(error, filePath));
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
async cleanup() {
|
|
483
|
+
// nothing to clean up for the local node implementation
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
//# sourceMappingURL=nodejs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QAClD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;QAChC,CAAC;IAAA,CACD;IAED,KAAK,CAAC,cAAc,CAAC,OAA8C,EAAsC;QACxG,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC7C,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,GAAG,CAAC;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,OAAO,EAAE,MAAM,IAAI,EAAE,GAAG,UAAU,EAAE,GAAG,OAAO,EAAE,MAAM,IAAI,EAAE,EAAE,CAAC,CAAC;QACpG,IAAI,CAAC;YACJ,MAAM,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YAC9B,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAC;QACrB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,GAAG,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC1C,CAAC;IAAA,CACD;IAED,KAAK,CAAC,OAAO,GAAkB;QAC9B,wDAAwD;IADzB,CAE/B;CACD","sourcesContent":["import { spawn } from \"node:child_process\";\nimport { randomUUID } from \"node:crypto\";\nimport { constants, createReadStream } from \"node:fs\";\nimport {\n\taccess,\n\tappendFile,\n\tlstat,\n\tmkdir,\n\tmkdtemp,\n\treaddir,\n\treadFile,\n\trealpath,\n\trm,\n\twriteFile,\n} from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { isAbsolute, join, resolve } from \"node:path\";\nimport { createInterface } from \"node:readline\";\nimport {\n\ttype ExecutionEnv,\n\tExecutionError,\n\terr,\n\tFileError,\n\ttype FileInfo,\n\ttype FileKind,\n\tok,\n\ttype Result,\n\ttoError,\n} from \"../types.ts\";\n\nfunction resolvePath(cwd: string, path: string): string {\n\treturn isAbsolute(path) ? path : resolve(cwd, path);\n}\n\nfunction fileKindFromStats(stats: {\n\tisFile(): boolean;\n\tisDirectory(): boolean;\n\tisSymbolicLink(): boolean;\n}): FileKind | undefined {\n\tif (stats.isFile()) return \"file\";\n\tif (stats.isDirectory()) return \"directory\";\n\tif (stats.isSymbolicLink()) return \"symlink\";\n\treturn undefined;\n}\n\nfunction fileInfoFromStats(\n\tpath: string,\n\tstats: { isFile(): boolean; isDirectory(): boolean; isSymbolicLink(): boolean; size: number; mtimeMs: number },\n): Result<FileInfo, FileError> {\n\tconst kind = fileKindFromStats(stats);\n\tif (!kind) return err(new FileError(\"invalid\", \"Unsupported file type\", path));\n\treturn ok({\n\t\tname: path.replace(/\\/+$/, \"\").split(\"/\").pop() ?? path,\n\t\tpath,\n\t\tkind,\n\t\tsize: stats.size,\n\t\tmtimeMs: stats.mtimeMs,\n\t});\n}\n\nfunction isNodeError(error: unknown): error is NodeJS.ErrnoException {\n\treturn error instanceof Error && \"code\" in error;\n}\n\nfunction toFileError(error: unknown, path?: string): FileError {\n\tif (error instanceof FileError) return error;\n\tconst cause = toError(error);\n\tif (isNodeError(error)) {\n\t\tconst message = error.message;\n\t\tswitch (error.code) {\n\t\t\tcase \"ABORT_ERR\":\n\t\t\t\treturn new FileError(\"aborted\", message, path, cause);\n\t\t\tcase \"ENOENT\":\n\t\t\t\treturn new FileError(\"not_found\", message, path, cause);\n\t\t\tcase \"EACCES\":\n\t\t\tcase \"EPERM\":\n\t\t\t\treturn new FileError(\"permission_denied\", message, path, cause);\n\t\t\tcase \"ENOTDIR\":\n\t\t\t\treturn new FileError(\"not_directory\", message, path, cause);\n\t\t\tcase \"EISDIR\":\n\t\t\t\treturn new FileError(\"is_directory\", message, path, cause);\n\t\t\tcase \"EINVAL\":\n\t\t\t\treturn new FileError(\"invalid\", message, path, cause);\n\t\t}\n\t}\n\treturn new FileError(\"unknown\", cause.message, path, cause);\n}\n\nfunction abortResult<TValue>(signal: AbortSignal | undefined, path?: string): Result<TValue, FileError> | undefined {\n\treturn signal?.aborted ? err(new FileError(\"aborted\", \"aborted\", path)) : undefined;\n}\n\nasync function pathExists(path: string): Promise<boolean> {\n\ttry {\n\t\tawait access(path, constants.F_OK);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nasync function runCommand(\n\tcommand: string,\n\targs: string[],\n\ttimeoutMs: number,\n): Promise<{ stdout: string; status: number | null }> {\n\treturn await new Promise((resolve) => {\n\t\tlet stdout = \"\";\n\t\tlet child: ReturnType<typeof spawn>;\n\t\ttry {\n\t\t\tchild = spawn(command, args, {\n\t\t\t\tstdio: [\"ignore\", \"pipe\", \"ignore\"],\n\t\t\t\twindowsHide: true,\n\t\t\t});\n\t\t} catch {\n\t\t\tresolve({ stdout: \"\", status: null });\n\t\t\treturn;\n\t\t}\n\t\tconst timeout = setTimeout(() => {\n\t\t\tif (child.pid) killProcessTree(child.pid);\n\t\t}, timeoutMs);\n\t\tchild.stdout?.setEncoding(\"utf8\");\n\t\tchild.stdout?.on(\"data\", (chunk: string) => {\n\t\t\tstdout += chunk;\n\t\t});\n\t\tchild.on(\"error\", () => {\n\t\t\tclearTimeout(timeout);\n\t\t\tresolve({ stdout: \"\", status: null });\n\t\t});\n\t\tchild.on(\"close\", (status) => {\n\t\t\tclearTimeout(timeout);\n\t\t\tresolve({ stdout, status });\n\t\t});\n\t});\n}\n\nasync function findBashOnPath(): Promise<string | null> {\n\tconst result =\n\t\tprocess.platform === \"win32\"\n\t\t\t? await runCommand(\"where\", [\"bash.exe\"], 5000)\n\t\t\t: await runCommand(\"which\", [\"bash\"], 5000);\n\tif (result.status !== 0 || !result.stdout) return null;\n\tconst firstMatch = result.stdout.trim().split(/\\r?\\n/)[0];\n\treturn firstMatch && (await pathExists(firstMatch)) ? firstMatch : null;\n}\n\nasync function getShellConfig(\n\tcustomShellPath?: string,\n): Promise<Result<{ shell: string; args: string[] }, ExecutionError>> {\n\tif (customShellPath) {\n\t\tif (await pathExists(customShellPath)) {\n\t\t\treturn ok({ shell: customShellPath, args: [\"-c\"] });\n\t\t}\n\t\treturn err(new ExecutionError(\"shell_unavailable\", `Custom shell path not found: ${customShellPath}`));\n\t}\n\tif (process.platform === \"win32\") {\n\t\tconst candidates: string[] = [];\n\t\tconst programFiles = process.env.ProgramFiles;\n\t\tif (programFiles) candidates.push(`${programFiles}\\\\Git\\\\bin\\\\bash.exe`);\n\t\tconst programFilesX86 = process.env[\"ProgramFiles(x86)\"];\n\t\tif (programFilesX86) candidates.push(`${programFilesX86}\\\\Git\\\\bin\\\\bash.exe`);\n\t\tfor (const candidate of candidates) {\n\t\t\tif (await pathExists(candidate)) {\n\t\t\t\treturn ok({ shell: candidate, args: [\"-c\"] });\n\t\t\t}\n\t\t}\n\t\tconst bashOnPath = await findBashOnPath();\n\t\tif (bashOnPath) {\n\t\t\treturn ok({ shell: bashOnPath, args: [\"-c\"] });\n\t\t}\n\t\treturn err(new ExecutionError(\"shell_unavailable\", \"No bash shell found\"));\n\t}\n\n\tif (await pathExists(\"/bin/bash\")) {\n\t\treturn ok({ shell: \"/bin/bash\", args: [\"-c\"] });\n\t}\n\tconst bashOnPath = await findBashOnPath();\n\tif (bashOnPath) {\n\t\treturn ok({ shell: bashOnPath, args: [\"-c\"] });\n\t}\n\treturn ok({ shell: \"sh\", args: [\"-c\"] });\n}\n\nfunction getShellEnv(baseEnv?: NodeJS.ProcessEnv, extraEnv?: Record<string, string>): NodeJS.ProcessEnv {\n\treturn {\n\t\t...process.env,\n\t\t...baseEnv,\n\t\t...extraEnv,\n\t};\n}\n\nfunction killProcessTree(pid: number): void {\n\tif (process.platform === \"win32\") {\n\t\ttry {\n\t\t\tspawn(\"taskkill\", [\"/F\", \"/T\", \"/PID\", String(pid)], {\n\t\t\t\tstdio: \"ignore\",\n\t\t\t\tdetached: true,\n\t\t\t\twindowsHide: true,\n\t\t\t});\n\t\t} catch {\n\t\t\t// Ignore errors.\n\t\t}\n\t\treturn;\n\t}\n\n\ttry {\n\t\tprocess.kill(-pid, \"SIGKILL\");\n\t} catch {\n\t\ttry {\n\t\t\tprocess.kill(pid, \"SIGKILL\");\n\t\t} catch {\n\t\t\t// Process already dead.\n\t\t}\n\t}\n}\n\nexport class NodeExecutionEnv implements ExecutionEnv {\n\tcwd: string;\n\tprivate shellPath?: string;\n\tprivate shellEnv?: NodeJS.ProcessEnv;\n\n\tconstructor(options: { cwd: string; shellPath?: string; shellEnv?: NodeJS.ProcessEnv }) {\n\t\tthis.cwd = options.cwd;\n\t\tthis.shellPath = options.shellPath;\n\t\tthis.shellEnv = options.shellEnv;\n\t}\n\n\tasync absolutePath(path: string): Promise<Result<string, FileError>> {\n\t\treturn ok(resolvePath(this.cwd, path));\n\t}\n\n\tasync joinPath(parts: string[]): Promise<Result<string, FileError>> {\n\t\treturn ok(join(...parts));\n\t}\n\n\tasync exec(\n\t\tcommand: string,\n\t\toptions?: {\n\t\t\tcwd?: string;\n\t\t\tenv?: Record<string, string>;\n\t\t\ttimeout?: number;\n\t\t\tabortSignal?: AbortSignal;\n\t\t\tonStdout?: (chunk: string) => void;\n\t\t\tonStderr?: (chunk: string) => void;\n\t\t},\n\t): Promise<Result<{ stdout: string; stderr: string; exitCode: number }, ExecutionError>> {\n\t\tif (options?.abortSignal?.aborted) return err(new ExecutionError(\"aborted\", \"aborted\"));\n\n\t\tconst cwd = options?.cwd ? resolvePath(this.cwd, options.cwd) : this.cwd;\n\t\tconst shellConfig = await getShellConfig(this.shellPath);\n\t\tif (!shellConfig.ok) return shellConfig;\n\n\t\treturn await new Promise((resolvePromise) => {\n\t\t\tlet stdout = \"\";\n\t\t\tlet stderr = \"\";\n\t\t\tlet settled = false;\n\t\t\tlet timedOut = false;\n\t\t\tlet callbackError: ExecutionError | undefined;\n\t\t\tlet child: ReturnType<typeof spawn> | undefined;\n\t\t\tlet timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n\t\t\tconst onAbort = () => {\n\t\t\t\tif (child?.pid) {\n\t\t\t\t\tkillProcessTree(child.pid);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst settle = (result: Result<{ stdout: string; stderr: string; exitCode: number }, ExecutionError>) => {\n\t\t\t\tif (timeoutId) clearTimeout(timeoutId);\n\t\t\t\tif (options?.abortSignal) options.abortSignal.removeEventListener(\"abort\", onAbort);\n\t\t\t\tif (settled) return;\n\t\t\t\tsettled = true;\n\t\t\t\tresolvePromise(result);\n\t\t\t};\n\n\t\t\ttry {\n\t\t\t\tchild = spawn(shellConfig.value.shell, [...shellConfig.value.args, command], {\n\t\t\t\t\tcwd,\n\t\t\t\t\tdetached: process.platform !== \"win32\",\n\t\t\t\t\tenv: getShellEnv(this.shellEnv, options?.env),\n\t\t\t\t\tstdio: [\"ignore\", \"pipe\", \"pipe\"],\n\t\t\t\t\twindowsHide: true,\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tconst cause = toError(error);\n\t\t\t\tsettle(err(new ExecutionError(\"spawn_error\", cause.message, cause)));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttimeoutId =\n\t\t\t\ttypeof options?.timeout === \"number\"\n\t\t\t\t\t? setTimeout(() => {\n\t\t\t\t\t\t\ttimedOut = true;\n\t\t\t\t\t\t\tif (child?.pid) {\n\t\t\t\t\t\t\t\tkillProcessTree(child.pid);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, options.timeout * 1000)\n\t\t\t\t\t: undefined;\n\n\t\t\tif (options?.abortSignal) {\n\t\t\t\tif (options.abortSignal.aborted) {\n\t\t\t\t\tonAbort();\n\t\t\t\t} else {\n\t\t\t\t\toptions.abortSignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tchild.stdout?.setEncoding(\"utf8\");\n\t\t\tchild.stderr?.setEncoding(\"utf8\");\n\t\t\tchild.stdout?.on(\"data\", (chunk: string) => {\n\t\t\t\tstdout += chunk;\n\t\t\t\ttry {\n\t\t\t\t\toptions?.onStdout?.(chunk);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst cause = toError(error);\n\t\t\t\t\tcallbackError = new ExecutionError(\"callback_error\", cause.message, cause);\n\t\t\t\t\tonAbort();\n\t\t\t\t}\n\t\t\t});\n\t\t\tchild.stderr?.on(\"data\", (chunk: string) => {\n\t\t\t\tstderr += chunk;\n\t\t\t\ttry {\n\t\t\t\t\toptions?.onStderr?.(chunk);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst cause = toError(error);\n\t\t\t\t\tcallbackError = new ExecutionError(\"callback_error\", cause.message, cause);\n\t\t\t\t\tonAbort();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tchild.on(\"error\", (error) => {\n\t\t\t\tsettle(err(new ExecutionError(\"spawn_error\", error.message, error)));\n\t\t\t});\n\n\t\t\tchild.on(\"close\", (code) => {\n\t\t\t\tif (callbackError) {\n\t\t\t\t\tsettle(err(callbackError));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (timedOut) {\n\t\t\t\t\tsettle(err(new ExecutionError(\"timeout\", `timeout:${options?.timeout}`)));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (options?.abortSignal?.aborted) {\n\t\t\t\t\tsettle(err(new ExecutionError(\"aborted\", \"aborted\")));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tsettle(ok({ stdout, stderr, exitCode: code ?? 0 }));\n\t\t\t});\n\t\t});\n\t}\n\n\tasync readTextFile(path: string, abortSignal?: AbortSignal): Promise<Result<string, FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\tconst aborted = abortResult<string>(abortSignal, resolved);\n\t\tif (aborted) return aborted;\n\t\ttry {\n\t\t\treturn ok(await readFile(resolved, { encoding: \"utf8\", signal: abortSignal }));\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t}\n\t}\n\n\tasync readTextLines(\n\t\tpath: string,\n\t\toptions?: { maxLines?: number; abortSignal?: AbortSignal },\n\t): Promise<Result<string[], FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\tconst aborted = abortResult<string[]>(options?.abortSignal, resolved);\n\t\tif (aborted) return aborted;\n\t\tif (options?.maxLines !== undefined && options.maxLines <= 0) return ok([]);\n\t\tlet stream: ReturnType<typeof createReadStream> | undefined;\n\t\tlet lineReader: ReturnType<typeof createInterface> | undefined;\n\t\ttry {\n\t\t\tstream = createReadStream(resolved, { encoding: \"utf8\", signal: options?.abortSignal });\n\t\t\tlineReader = createInterface({ input: stream, crlfDelay: Infinity });\n\t\t\tconst lines: string[] = [];\n\t\t\tfor await (const line of lineReader) {\n\t\t\t\tconst loopAbort = abortResult<string[]>(options?.abortSignal, resolved);\n\t\t\t\tif (loopAbort) return loopAbort;\n\t\t\t\tlines.push(line);\n\t\t\t\tif (options?.maxLines !== undefined && lines.length >= options.maxLines) break;\n\t\t\t}\n\t\t\tconst afterReadAbort = abortResult<string[]>(options?.abortSignal, resolved);\n\t\t\tif (afterReadAbort) return afterReadAbort;\n\t\t\treturn ok(lines);\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t} finally {\n\t\t\tlineReader?.close();\n\t\t\tstream?.destroy();\n\t\t}\n\t}\n\n\tasync readBinaryFile(path: string, abortSignal?: AbortSignal): Promise<Result<Uint8Array, FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\tconst aborted = abortResult<Uint8Array>(abortSignal, resolved);\n\t\tif (aborted) return aborted;\n\t\ttry {\n\t\t\treturn ok(await readFile(resolved, { signal: abortSignal }));\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t}\n\t}\n\n\tasync writeFile(\n\t\tpath: string,\n\t\tcontent: string | Uint8Array,\n\t\tabortSignal?: AbortSignal,\n\t): Promise<Result<void, FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\tconst aborted = abortResult<void>(abortSignal, resolved);\n\t\tif (aborted) return aborted;\n\t\ttry {\n\t\t\tawait mkdir(resolve(resolved, \"..\"), { recursive: true });\n\t\t\tconst afterMkdirAbort = abortResult<void>(abortSignal, resolved);\n\t\t\tif (afterMkdirAbort) return afterMkdirAbort;\n\t\t\tawait writeFile(resolved, content, { signal: abortSignal });\n\t\t\treturn ok(undefined);\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t}\n\t}\n\n\tasync appendFile(path: string, content: string | Uint8Array): Promise<Result<void, FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\ttry {\n\t\t\tawait mkdir(resolve(resolved, \"..\"), { recursive: true });\n\t\t\tawait appendFile(resolved, content);\n\t\t\treturn ok(undefined);\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t}\n\t}\n\n\tasync fileInfo(path: string): Promise<Result<FileInfo, FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\ttry {\n\t\t\treturn fileInfoFromStats(resolved, await lstat(resolved));\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t}\n\t}\n\n\tasync listDir(path: string, abortSignal?: AbortSignal): Promise<Result<FileInfo[], FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\tconst aborted = abortResult<FileInfo[]>(abortSignal, resolved);\n\t\tif (aborted) return aborted;\n\t\ttry {\n\t\t\tconst entries = await readdir(resolved, { withFileTypes: true });\n\t\t\tconst infos: FileInfo[] = [];\n\t\t\tfor (const entry of entries) {\n\t\t\t\tconst loopAbort = abortResult<FileInfo[]>(abortSignal, resolved);\n\t\t\t\tif (loopAbort) return loopAbort;\n\t\t\t\tconst entryPath = resolve(resolved, entry.name);\n\t\t\t\ttry {\n\t\t\t\t\tconst info = fileInfoFromStats(entryPath, await lstat(entryPath));\n\t\t\t\t\tif (info.ok) infos.push(info.value);\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn err(toFileError(error, entryPath));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ok(infos);\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t}\n\t}\n\n\tasync canonicalPath(path: string): Promise<Result<string, FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\ttry {\n\t\t\treturn ok(await realpath(resolved));\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t}\n\t}\n\n\tasync exists(path: string): Promise<Result<boolean, FileError>> {\n\t\tconst result = await this.fileInfo(path);\n\t\tif (result.ok) return ok(true);\n\t\tif (result.error.code === \"not_found\") return ok(false);\n\t\treturn err(result.error);\n\t}\n\n\tasync createDir(path: string, options?: { recursive?: boolean }): Promise<Result<void, FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\ttry {\n\t\t\tawait mkdir(resolved, { recursive: options?.recursive ?? true });\n\t\t\treturn ok(undefined);\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t}\n\t}\n\n\tasync remove(path: string, options?: { recursive?: boolean; force?: boolean }): Promise<Result<void, FileError>> {\n\t\tconst resolved = resolvePath(this.cwd, path);\n\t\ttry {\n\t\t\tawait rm(resolved, { recursive: options?.recursive ?? false, force: options?.force ?? false });\n\t\t\treturn ok(undefined);\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, resolved));\n\t\t}\n\t}\n\n\tasync createTempDir(prefix: string = \"tmp-\"): Promise<Result<string, FileError>> {\n\t\ttry {\n\t\t\treturn ok(await mkdtemp(join(tmpdir(), prefix)));\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error));\n\t\t}\n\t}\n\n\tasync createTempFile(options?: { prefix?: string; suffix?: string }): Promise<Result<string, FileError>> {\n\t\tconst dir = await this.createTempDir(\"tmp-\");\n\t\tif (!dir.ok) return dir;\n\t\tconst filePath = join(dir.value, `${options?.prefix ?? \"\"}${randomUUID()}${options?.suffix ?? \"\"}`);\n\t\ttry {\n\t\t\tawait writeFile(filePath, \"\");\n\t\t\treturn ok(filePath);\n\t\t} catch (error) {\n\t\t\treturn err(toFileError(error, filePath));\n\t\t}\n\t}\n\n\tasync cleanup(): Promise<void> {\n\t\t// nothing to clean up for the local node implementation\n\t}\n}\n"]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ImageContent, Message, TextContent } from "@earendil-works/pi-ai";
|
|
2
|
+
import type { AgentMessage } from "../types.ts";
|
|
3
|
+
export declare const COMPACTION_SUMMARY_PREFIX = "The conversation history before this point was compacted into the following summary:\n\n<summary>\n";
|
|
4
|
+
export declare const COMPACTION_SUMMARY_SUFFIX = "\n</summary>";
|
|
5
|
+
export declare const BRANCH_SUMMARY_PREFIX = "The following is a summary of a branch that this conversation came back from:\n\n<summary>\n";
|
|
6
|
+
export declare const BRANCH_SUMMARY_SUFFIX = "</summary>";
|
|
7
|
+
export interface BashExecutionMessage {
|
|
8
|
+
role: "bashExecution";
|
|
9
|
+
command: string;
|
|
10
|
+
output: string;
|
|
11
|
+
exitCode: number | undefined;
|
|
12
|
+
cancelled: boolean;
|
|
13
|
+
truncated: boolean;
|
|
14
|
+
fullOutputPath?: string;
|
|
15
|
+
timestamp: number;
|
|
16
|
+
excludeFromContext?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface CustomMessage<T = unknown> {
|
|
19
|
+
role: "custom";
|
|
20
|
+
customType: string;
|
|
21
|
+
content: string | (TextContent | ImageContent)[];
|
|
22
|
+
display: boolean;
|
|
23
|
+
details?: T;
|
|
24
|
+
timestamp: number;
|
|
25
|
+
}
|
|
26
|
+
export interface BranchSummaryMessage {
|
|
27
|
+
role: "branchSummary";
|
|
28
|
+
summary: string;
|
|
29
|
+
fromId: string;
|
|
30
|
+
timestamp: number;
|
|
31
|
+
}
|
|
32
|
+
export interface CompactionSummaryMessage {
|
|
33
|
+
role: "compactionSummary";
|
|
34
|
+
summary: string;
|
|
35
|
+
tokensBefore: number;
|
|
36
|
+
details?: unknown;
|
|
37
|
+
timestamp: number;
|
|
38
|
+
}
|
|
39
|
+
declare module "../types.ts" {
|
|
40
|
+
interface CustomAgentMessages {
|
|
41
|
+
bashExecution: BashExecutionMessage;
|
|
42
|
+
custom: CustomMessage;
|
|
43
|
+
branchSummary: BranchSummaryMessage;
|
|
44
|
+
compactionSummary: CompactionSummaryMessage;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export declare function bashExecutionToText(msg: BashExecutionMessage): string;
|
|
48
|
+
export declare function createBranchSummaryMessage(summary: string, fromId: string, timestamp: string): BranchSummaryMessage;
|
|
49
|
+
export declare function createCompactionSummaryMessage(summary: string, tokensBefore: number, timestamp: string): CompactionSummaryMessage;
|
|
50
|
+
export declare function createCustomMessage(customType: string, content: string | (TextContent | ImageContent)[], display: boolean, details: unknown | undefined, timestamp: string): CustomMessage;
|
|
51
|
+
export declare function convertToLlm(messages: AgentMessage[]): Message[];
|
|
52
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/harness/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,yBAAyB,wGAGrC,CAAC;AAEF,eAAO,MAAM,yBAAyB,iBAC3B,CAAC;AAEZ,eAAO,MAAM,qBAAqB,iGAGjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAElD,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OA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AwB,CAO1B;AAED,wBAAgB,mBAAmB,CAClC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GAAG,CAAC,WAAW,GAAG,YAAY,CAAC,EAAE,EAChD,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,SAAS,EAAE,MAAM,GACf,aAAa,CASf;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,OAAO,EAAE,CA4ChE","sourcesContent":["import type { ImageContent, Message, TextContent } from \"@earendil-works/pi-ai\";\nimport type { AgentMessage } from \"../types.ts\";\n\nexport const COMPACTION_SUMMARY_PREFIX = `The conversation history before this point was compacted into the following summary:\n\n<summary>\n`;\n\nexport const COMPACTION_SUMMARY_SUFFIX = `\n</summary>`;\n\nexport const BRANCH_SUMMARY_PREFIX = `The following is a summary of a branch that this conversation came back from:\n\n<summary>\n`;\n\nexport const BRANCH_SUMMARY_SUFFIX = `</summary>`;\n\nexport interface BashExecutionMessage {\n\trole: \"bashExecution\";\n\tcommand: string;\n\toutput: string;\n\texitCode: number | undefined;\n\tcancelled: boolean;\n\ttruncated: boolean;\n\tfullOutputPath?: string;\n\ttimestamp: number;\n\texcludeFromContext?: boolean;\n}\n\nexport interface CustomMessage<T = unknown> {\n\trole: \"custom\";\n\tcustomType: string;\n\tcontent: string | (TextContent | ImageContent)[];\n\tdisplay: boolean;\n\tdetails?: T;\n\ttimestamp: number;\n}\n\nexport interface BranchSummaryMessage {\n\trole: \"branchSummary\";\n\tsummary: string;\n\tfromId: string;\n\ttimestamp: number;\n}\n\nexport interface CompactionSummaryMessage {\n\trole: \"compactionSummary\";\n\tsummary: string;\n\ttokensBefore: number;\n\tdetails?: unknown;\n\ttimestamp: number;\n}\n\ndeclare module \"../types.ts\" {\n\tinterface CustomAgentMessages {\n\t\tbashExecution: BashExecutionMessage;\n\t\tcustom: CustomMessage;\n\t\tbranchSummary: BranchSummaryMessage;\n\t\tcompactionSummary: CompactionSummaryMessage;\n\t}\n}\n\nexport function bashExecutionToText(msg: BashExecutionMessage): string {\n\tlet text = `Ran \\`${msg.command}\\`\\n`;\n\tif (msg.output) {\n\t\ttext += `\\`\\`\\`\\n${msg.output}\\n\\`\\`\\``;\n\t} else {\n\t\ttext += \"(no output)\";\n\t}\n\tif (msg.cancelled) {\n\t\ttext += \"\\n\\n(command cancelled)\";\n\t} else if (msg.exitCode !== null && msg.exitCode !== undefined && msg.exitCode !== 0) {\n\t\ttext += `\\n\\nCommand exited with code ${msg.exitCode}`;\n\t}\n\tif (msg.truncated && msg.fullOutputPath) {\n\t\ttext += `\\n\\n[Output truncated. Full output: ${msg.fullOutputPath}]`;\n\t}\n\treturn text;\n}\n\nexport function createBranchSummaryMessage(summary: string, fromId: string, timestamp: string): BranchSummaryMessage {\n\treturn {\n\t\trole: \"branchSummary\",\n\t\tsummary,\n\t\tfromId,\n\t\ttimestamp: new Date(timestamp).getTime(),\n\t};\n}\n\nexport function createCompactionSummaryMessage(\n\tsummary: string,\n\ttokensBefore: number,\n\ttimestamp: string,\n): CompactionSummaryMessage {\n\treturn {\n\t\trole: \"compactionSummary\",\n\t\tsummary,\n\t\ttokensBefore,\n\t\ttimestamp: new Date(timestamp).getTime(),\n\t};\n}\n\nexport function createCustomMessage(\n\tcustomType: string,\n\tcontent: string | (TextContent | ImageContent)[],\n\tdisplay: boolean,\n\tdetails: unknown | undefined,\n\ttimestamp: string,\n): CustomMessage {\n\treturn {\n\t\trole: \"custom\",\n\t\tcustomType,\n\t\tcontent,\n\t\tdisplay,\n\t\tdetails,\n\t\ttimestamp: new Date(timestamp).getTime(),\n\t};\n}\n\nexport function convertToLlm(messages: AgentMessage[]): Message[] {\n\treturn messages\n\t\t.map((m): Message | undefined => {\n\t\t\tswitch (m.role) {\n\t\t\t\tcase \"bashExecution\":\n\t\t\t\t\tif (m.excludeFromContext) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\trole: \"user\",\n\t\t\t\t\t\tcontent: [{ type: \"text\", text: bashExecutionToText(m) }],\n\t\t\t\t\t\ttimestamp: m.timestamp,\n\t\t\t\t\t};\n\t\t\t\tcase \"custom\": {\n\t\t\t\t\tconst content = typeof m.content === \"string\" ? [{ type: \"text\" as const, text: m.content }] : m.content;\n\t\t\t\t\treturn {\n\t\t\t\t\t\trole: \"user\",\n\t\t\t\t\t\tcontent,\n\t\t\t\t\t\ttimestamp: m.timestamp,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tcase \"branchSummary\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\trole: \"user\",\n\t\t\t\t\t\tcontent: [{ type: \"text\" as const, text: BRANCH_SUMMARY_PREFIX + m.summary + BRANCH_SUMMARY_SUFFIX }],\n\t\t\t\t\t\ttimestamp: m.timestamp,\n\t\t\t\t\t};\n\t\t\t\tcase \"compactionSummary\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\trole: \"user\",\n\t\t\t\t\t\tcontent: [\n\t\t\t\t\t\t\t{ type: \"text\" as const, text: COMPACTION_SUMMARY_PREFIX + m.summary + COMPACTION_SUMMARY_SUFFIX },\n\t\t\t\t\t\t],\n\t\t\t\t\t\ttimestamp: m.timestamp,\n\t\t\t\t\t};\n\t\t\t\tcase \"user\":\n\t\t\t\tcase \"assistant\":\n\t\t\t\tcase \"toolResult\":\n\t\t\t\t\treturn m;\n\t\t\t\tdefault:\n\t\t\t\t\treturn undefined;\n\t\t\t}\n\t\t})\n\t\t.filter((m): m is Message => m !== undefined);\n}\n"]}
|