@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,904 @@
|
|
|
1
|
+
import { streamSimple, } from "@earendil-works/pi-ai";
|
|
2
|
+
import { runAgentLoop } from "../agent-loop.js";
|
|
3
|
+
import { collectEntriesForBranchSummary, generateBranchSummary } from "./compaction/branch-summarization.js";
|
|
4
|
+
import { compact, DEFAULT_COMPACTION_SETTINGS, prepareCompaction } from "./compaction/compaction.js";
|
|
5
|
+
import { convertToLlm } from "./messages.js";
|
|
6
|
+
import { formatPromptTemplateInvocation } from "./prompt-templates.js";
|
|
7
|
+
import { formatSkillInvocation } from "./skills.js";
|
|
8
|
+
import { AgentHarnessError, BranchSummaryError, CompactionError, SessionError, toError } from "./types.js";
|
|
9
|
+
function createUserMessage(text, images) {
|
|
10
|
+
const content = [{ type: "text", text }];
|
|
11
|
+
if (images)
|
|
12
|
+
content.push(...images);
|
|
13
|
+
return { role: "user", content, timestamp: Date.now() };
|
|
14
|
+
}
|
|
15
|
+
function createFailureMessage(model, error, aborted) {
|
|
16
|
+
return {
|
|
17
|
+
role: "assistant",
|
|
18
|
+
content: [{ type: "text", text: "" }],
|
|
19
|
+
api: model.api,
|
|
20
|
+
provider: model.provider,
|
|
21
|
+
model: model.id,
|
|
22
|
+
stopReason: aborted ? "aborted" : "error",
|
|
23
|
+
errorMessage: error instanceof Error ? error.message : String(error),
|
|
24
|
+
timestamp: Date.now(),
|
|
25
|
+
usage: {
|
|
26
|
+
input: 0,
|
|
27
|
+
output: 0,
|
|
28
|
+
cacheRead: 0,
|
|
29
|
+
cacheWrite: 0,
|
|
30
|
+
totalTokens: 0,
|
|
31
|
+
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function cloneStreamOptions(streamOptions) {
|
|
36
|
+
return {
|
|
37
|
+
...streamOptions,
|
|
38
|
+
headers: streamOptions?.headers ? { ...streamOptions.headers } : undefined,
|
|
39
|
+
metadata: streamOptions?.metadata ? { ...streamOptions.metadata } : undefined,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function mergeHeaders(...headers) {
|
|
43
|
+
const merged = {};
|
|
44
|
+
let hasHeaders = false;
|
|
45
|
+
for (const entry of headers) {
|
|
46
|
+
if (!entry)
|
|
47
|
+
continue;
|
|
48
|
+
Object.assign(merged, entry);
|
|
49
|
+
hasHeaders = true;
|
|
50
|
+
}
|
|
51
|
+
return hasHeaders ? merged : undefined;
|
|
52
|
+
}
|
|
53
|
+
const objectHasOwnProperty = Object.prototype.hasOwnProperty;
|
|
54
|
+
function hasOwn(object, key) {
|
|
55
|
+
return objectHasOwnProperty.call(object, key);
|
|
56
|
+
}
|
|
57
|
+
function applyStreamOptionsPatch(base, patch) {
|
|
58
|
+
const result = cloneStreamOptions(base);
|
|
59
|
+
if (!patch)
|
|
60
|
+
return result;
|
|
61
|
+
if (hasOwn(patch, "transport"))
|
|
62
|
+
result.transport = patch.transport;
|
|
63
|
+
if (hasOwn(patch, "timeoutMs"))
|
|
64
|
+
result.timeoutMs = patch.timeoutMs;
|
|
65
|
+
if (hasOwn(patch, "maxRetries"))
|
|
66
|
+
result.maxRetries = patch.maxRetries;
|
|
67
|
+
if (hasOwn(patch, "maxRetryDelayMs"))
|
|
68
|
+
result.maxRetryDelayMs = patch.maxRetryDelayMs;
|
|
69
|
+
if (hasOwn(patch, "cacheRetention"))
|
|
70
|
+
result.cacheRetention = patch.cacheRetention;
|
|
71
|
+
if (hasOwn(patch, "headers")) {
|
|
72
|
+
if (patch.headers === undefined) {
|
|
73
|
+
result.headers = undefined;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
const headers = { ...(result.headers ?? {}) };
|
|
77
|
+
for (const [key, value] of Object.entries(patch.headers)) {
|
|
78
|
+
if (value === undefined)
|
|
79
|
+
delete headers[key];
|
|
80
|
+
else
|
|
81
|
+
headers[key] = value;
|
|
82
|
+
}
|
|
83
|
+
result.headers = Object.keys(headers).length > 0 ? headers : undefined;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (hasOwn(patch, "metadata")) {
|
|
87
|
+
if (patch.metadata === undefined) {
|
|
88
|
+
result.metadata = undefined;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
const metadata = { ...(result.metadata ?? {}) };
|
|
92
|
+
for (const [key, value] of Object.entries(patch.metadata)) {
|
|
93
|
+
if (value === undefined)
|
|
94
|
+
delete metadata[key];
|
|
95
|
+
else
|
|
96
|
+
metadata[key] = value;
|
|
97
|
+
}
|
|
98
|
+
result.metadata = Object.keys(metadata).length > 0 ? metadata : undefined;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
const SUBSCRIBER_EVENT_TYPE = "*";
|
|
104
|
+
function normalizeHarnessError(error, fallbackCode) {
|
|
105
|
+
if (error instanceof AgentHarnessError)
|
|
106
|
+
return error;
|
|
107
|
+
const cause = toError(error);
|
|
108
|
+
if (cause instanceof SessionError)
|
|
109
|
+
return new AgentHarnessError("session", cause.message, cause);
|
|
110
|
+
if (cause instanceof CompactionError)
|
|
111
|
+
return new AgentHarnessError("compaction", cause.message, cause);
|
|
112
|
+
if (cause instanceof BranchSummaryError)
|
|
113
|
+
return new AgentHarnessError("branch_summary", cause.message, cause);
|
|
114
|
+
return new AgentHarnessError(fallbackCode, cause.message, cause);
|
|
115
|
+
}
|
|
116
|
+
function normalizeHookError(error) {
|
|
117
|
+
return normalizeHarnessError(error, "hook");
|
|
118
|
+
}
|
|
119
|
+
export class AgentHarness {
|
|
120
|
+
env;
|
|
121
|
+
session;
|
|
122
|
+
phase = "idle";
|
|
123
|
+
runAbortController;
|
|
124
|
+
runPromise;
|
|
125
|
+
pendingSessionWrites = [];
|
|
126
|
+
model;
|
|
127
|
+
thinkingLevel;
|
|
128
|
+
systemPrompt;
|
|
129
|
+
streamOptions;
|
|
130
|
+
getApiKeyAndHeaders;
|
|
131
|
+
resources;
|
|
132
|
+
tools = new Map();
|
|
133
|
+
activeToolNames;
|
|
134
|
+
steerQueue = [];
|
|
135
|
+
steeringQueueMode;
|
|
136
|
+
followUpQueue = [];
|
|
137
|
+
followUpQueueMode;
|
|
138
|
+
nextTurnQueue = [];
|
|
139
|
+
handlers = new Map();
|
|
140
|
+
constructor(options) {
|
|
141
|
+
this.env = options.env;
|
|
142
|
+
this.session = options.session;
|
|
143
|
+
this.resources = options.resources ?? {};
|
|
144
|
+
this.streamOptions = cloneStreamOptions(options.streamOptions);
|
|
145
|
+
this.systemPrompt = options.systemPrompt;
|
|
146
|
+
this.getApiKeyAndHeaders = options.getApiKeyAndHeaders;
|
|
147
|
+
for (const tool of options.tools ?? []) {
|
|
148
|
+
this.tools.set(tool.name, tool);
|
|
149
|
+
}
|
|
150
|
+
this.model = options.model;
|
|
151
|
+
this.thinkingLevel = options.thinkingLevel ?? "off";
|
|
152
|
+
this.activeToolNames = options.activeToolNames ?? (options.tools ?? []).map((tool) => tool.name);
|
|
153
|
+
this.steeringQueueMode = options.steeringMode ?? "one-at-a-time";
|
|
154
|
+
this.followUpQueueMode = options.followUpMode ?? "one-at-a-time";
|
|
155
|
+
}
|
|
156
|
+
getHandlers(type) {
|
|
157
|
+
return this.handlers.get(type);
|
|
158
|
+
}
|
|
159
|
+
async emitOwn(event, signal) {
|
|
160
|
+
for (const listener of this.getHandlers(SUBSCRIBER_EVENT_TYPE) ?? []) {
|
|
161
|
+
try {
|
|
162
|
+
await listener(event, signal);
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
throw normalizeHookError(error);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
async emitAny(event, signal) {
|
|
170
|
+
for (const listener of this.getHandlers(SUBSCRIBER_EVENT_TYPE) ?? []) {
|
|
171
|
+
try {
|
|
172
|
+
await listener(event, signal);
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
throw normalizeHookError(error);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
async emitHook(event) {
|
|
180
|
+
const handlers = this.getHandlers(event.type);
|
|
181
|
+
if (!handlers || handlers.size === 0)
|
|
182
|
+
return undefined;
|
|
183
|
+
let lastResult;
|
|
184
|
+
for (const handler of handlers) {
|
|
185
|
+
try {
|
|
186
|
+
const result = await handler(event);
|
|
187
|
+
if (result !== undefined) {
|
|
188
|
+
lastResult = result;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
throw normalizeHookError(error);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return lastResult;
|
|
196
|
+
}
|
|
197
|
+
async emitBeforeProviderRequest(model, sessionId, streamOptions) {
|
|
198
|
+
const handlers = this.getHandlers("before_provider_request");
|
|
199
|
+
let current = cloneStreamOptions(streamOptions);
|
|
200
|
+
if (!handlers || handlers.size === 0)
|
|
201
|
+
return current;
|
|
202
|
+
for (const handler of handlers) {
|
|
203
|
+
try {
|
|
204
|
+
const result = await handler({
|
|
205
|
+
type: "before_provider_request",
|
|
206
|
+
model,
|
|
207
|
+
sessionId,
|
|
208
|
+
streamOptions: cloneStreamOptions(current),
|
|
209
|
+
});
|
|
210
|
+
if (result?.streamOptions) {
|
|
211
|
+
current = applyStreamOptionsPatch(current, result.streamOptions);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
throw normalizeHookError(error);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return current;
|
|
219
|
+
}
|
|
220
|
+
async emitBeforeProviderPayload(model, payload) {
|
|
221
|
+
const handlers = this.getHandlers("before_provider_payload");
|
|
222
|
+
let current = payload;
|
|
223
|
+
if (!handlers || handlers.size === 0)
|
|
224
|
+
return current;
|
|
225
|
+
for (const handler of handlers) {
|
|
226
|
+
try {
|
|
227
|
+
const result = await handler({ type: "before_provider_payload", model, payload: current });
|
|
228
|
+
if (result !== undefined) {
|
|
229
|
+
current = result.payload;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
throw normalizeHookError(error);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return current;
|
|
237
|
+
}
|
|
238
|
+
async emitQueueUpdate() {
|
|
239
|
+
await this.emitOwn({
|
|
240
|
+
type: "queue_update",
|
|
241
|
+
steer: [...this.steerQueue],
|
|
242
|
+
followUp: [...this.followUpQueue],
|
|
243
|
+
nextTurn: [...this.nextTurnQueue],
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
startRunPromise() {
|
|
247
|
+
let finish = () => { };
|
|
248
|
+
this.runPromise = new Promise((resolve) => {
|
|
249
|
+
finish = resolve;
|
|
250
|
+
});
|
|
251
|
+
return () => {
|
|
252
|
+
this.runPromise = undefined;
|
|
253
|
+
finish();
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
async createTurnState() {
|
|
257
|
+
const context = await this.session.buildContext();
|
|
258
|
+
const resources = this.getResources();
|
|
259
|
+
const sessionMetadata = await this.session.getMetadata();
|
|
260
|
+
const tools = [...this.tools.values()];
|
|
261
|
+
const activeTools = this.activeToolNames
|
|
262
|
+
.map((name) => this.tools.get(name))
|
|
263
|
+
.filter((tool) => tool !== undefined);
|
|
264
|
+
let systemPrompt = "You are a helpful assistant.";
|
|
265
|
+
if (typeof this.systemPrompt === "string") {
|
|
266
|
+
systemPrompt = this.systemPrompt;
|
|
267
|
+
}
|
|
268
|
+
else if (this.systemPrompt) {
|
|
269
|
+
systemPrompt = await this.systemPrompt({
|
|
270
|
+
env: this.env,
|
|
271
|
+
session: this.session,
|
|
272
|
+
model: this.model,
|
|
273
|
+
thinkingLevel: this.thinkingLevel,
|
|
274
|
+
activeTools,
|
|
275
|
+
resources,
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
return {
|
|
279
|
+
messages: context.messages,
|
|
280
|
+
resources,
|
|
281
|
+
streamOptions: cloneStreamOptions(this.streamOptions),
|
|
282
|
+
sessionId: sessionMetadata.id,
|
|
283
|
+
systemPrompt,
|
|
284
|
+
model: this.model,
|
|
285
|
+
thinkingLevel: this.thinkingLevel,
|
|
286
|
+
tools,
|
|
287
|
+
activeTools,
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
createContext(turnState, systemPrompt) {
|
|
291
|
+
return {
|
|
292
|
+
systemPrompt: systemPrompt ?? turnState.systemPrompt,
|
|
293
|
+
messages: turnState.messages.slice(),
|
|
294
|
+
tools: turnState.activeTools.slice(),
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
createStreamFn(getTurnState) {
|
|
298
|
+
return async (model, context, streamOptions) => {
|
|
299
|
+
const turnState = getTurnState();
|
|
300
|
+
const auth = await this.getApiKeyAndHeaders?.(model);
|
|
301
|
+
const snapshotOptions = {
|
|
302
|
+
...turnState.streamOptions,
|
|
303
|
+
headers: mergeHeaders(turnState.streamOptions.headers, auth?.headers),
|
|
304
|
+
};
|
|
305
|
+
const requestOptions = await this.emitBeforeProviderRequest(model, turnState.sessionId, snapshotOptions);
|
|
306
|
+
return streamSimple(model, context, {
|
|
307
|
+
cacheRetention: requestOptions.cacheRetention,
|
|
308
|
+
headers: requestOptions.headers,
|
|
309
|
+
maxRetries: requestOptions.maxRetries,
|
|
310
|
+
maxRetryDelayMs: requestOptions.maxRetryDelayMs,
|
|
311
|
+
metadata: requestOptions.metadata,
|
|
312
|
+
onPayload: async (payload) => await this.emitBeforeProviderPayload(model, payload),
|
|
313
|
+
onResponse: async (response) => {
|
|
314
|
+
const headers = { ...response.headers };
|
|
315
|
+
await this.emitOwn({ type: "after_provider_response", status: response.status, headers }, streamOptions?.signal);
|
|
316
|
+
},
|
|
317
|
+
reasoning: streamOptions?.reasoning,
|
|
318
|
+
signal: streamOptions?.signal,
|
|
319
|
+
sessionId: turnState.sessionId,
|
|
320
|
+
timeoutMs: requestOptions.timeoutMs,
|
|
321
|
+
transport: requestOptions.transport,
|
|
322
|
+
apiKey: auth?.apiKey,
|
|
323
|
+
});
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
async drainQueuedMessages(queue, mode) {
|
|
327
|
+
const messages = mode === "all" ? queue.splice(0) : queue.splice(0, 1);
|
|
328
|
+
if (messages.length === 0)
|
|
329
|
+
return messages;
|
|
330
|
+
try {
|
|
331
|
+
await this.emitQueueUpdate();
|
|
332
|
+
return messages;
|
|
333
|
+
}
|
|
334
|
+
catch (error) {
|
|
335
|
+
queue.unshift(...messages);
|
|
336
|
+
throw normalizeHookError(error);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
createLoopConfig(getTurnState, setTurnState) {
|
|
340
|
+
const turnState = getTurnState();
|
|
341
|
+
return {
|
|
342
|
+
model: turnState.model,
|
|
343
|
+
reasoning: turnState.thinkingLevel === "off" ? undefined : turnState.thinkingLevel,
|
|
344
|
+
convertToLlm,
|
|
345
|
+
transformContext: async (messages) => {
|
|
346
|
+
const result = await this.emitHook({ type: "context", messages: [...messages] });
|
|
347
|
+
return result?.messages ?? messages;
|
|
348
|
+
},
|
|
349
|
+
beforeToolCall: async ({ toolCall, args }) => {
|
|
350
|
+
const result = await this.emitHook({
|
|
351
|
+
type: "tool_call",
|
|
352
|
+
toolCallId: toolCall.id,
|
|
353
|
+
toolName: toolCall.name,
|
|
354
|
+
input: args,
|
|
355
|
+
});
|
|
356
|
+
return result ? { block: result.block, reason: result.reason } : undefined;
|
|
357
|
+
},
|
|
358
|
+
afterToolCall: async ({ toolCall, args, result, isError }) => {
|
|
359
|
+
const patch = await this.emitHook({
|
|
360
|
+
type: "tool_result",
|
|
361
|
+
toolCallId: toolCall.id,
|
|
362
|
+
toolName: toolCall.name,
|
|
363
|
+
input: args,
|
|
364
|
+
content: result.content,
|
|
365
|
+
details: result.details,
|
|
366
|
+
isError,
|
|
367
|
+
});
|
|
368
|
+
return patch
|
|
369
|
+
? { content: patch.content, details: patch.details, isError: patch.isError, terminate: patch.terminate }
|
|
370
|
+
: undefined;
|
|
371
|
+
},
|
|
372
|
+
prepareNextTurn: async () => {
|
|
373
|
+
await this.flushPendingSessionWrites();
|
|
374
|
+
const nextTurnState = await this.createTurnState();
|
|
375
|
+
setTurnState(nextTurnState);
|
|
376
|
+
return {
|
|
377
|
+
context: this.createContext(nextTurnState),
|
|
378
|
+
model: nextTurnState.model,
|
|
379
|
+
thinkingLevel: nextTurnState.thinkingLevel,
|
|
380
|
+
};
|
|
381
|
+
},
|
|
382
|
+
getSteeringMessages: async () => this.drainQueuedMessages(this.steerQueue, this.steeringQueueMode),
|
|
383
|
+
getFollowUpMessages: async () => this.drainQueuedMessages(this.followUpQueue, this.followUpQueueMode),
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
validateToolNames(toolNames, tools = this.tools) {
|
|
387
|
+
const missing = toolNames.filter((name) => !tools.has(name));
|
|
388
|
+
if (missing.length > 0)
|
|
389
|
+
throw new AgentHarnessError("invalid_argument", `Unknown tool(s): ${missing.join(", ")}`);
|
|
390
|
+
}
|
|
391
|
+
async flushPendingSessionWrites() {
|
|
392
|
+
while (this.pendingSessionWrites.length > 0) {
|
|
393
|
+
const write = this.pendingSessionWrites[0];
|
|
394
|
+
if (write.type === "message") {
|
|
395
|
+
await this.session.appendMessage(write.message);
|
|
396
|
+
}
|
|
397
|
+
else if (write.type === "model_change") {
|
|
398
|
+
await this.session.appendModelChange(write.provider, write.modelId);
|
|
399
|
+
}
|
|
400
|
+
else if (write.type === "thinking_level_change") {
|
|
401
|
+
await this.session.appendThinkingLevelChange(write.thinkingLevel);
|
|
402
|
+
}
|
|
403
|
+
else if (write.type === "custom") {
|
|
404
|
+
await this.session.appendCustomEntry(write.customType, write.data);
|
|
405
|
+
}
|
|
406
|
+
else if (write.type === "custom_message") {
|
|
407
|
+
await this.session.appendCustomMessageEntry(write.customType, write.content, write.display, write.details);
|
|
408
|
+
}
|
|
409
|
+
else if (write.type === "label") {
|
|
410
|
+
await this.session.appendLabel(write.targetId, write.label);
|
|
411
|
+
}
|
|
412
|
+
else if (write.type === "session_info") {
|
|
413
|
+
await this.session.appendSessionName(write.name ?? "");
|
|
414
|
+
}
|
|
415
|
+
else if (write.type === "leaf") {
|
|
416
|
+
await this.session.getStorage().setLeafId(write.targetId);
|
|
417
|
+
}
|
|
418
|
+
this.pendingSessionWrites.shift();
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
async handleAgentEvent(event, signal) {
|
|
422
|
+
if (event.type === "message_end") {
|
|
423
|
+
await this.session.appendMessage(event.message);
|
|
424
|
+
await this.emitAny(event, signal);
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
if (event.type === "turn_end") {
|
|
428
|
+
let eventError;
|
|
429
|
+
try {
|
|
430
|
+
await this.emitAny(event, signal);
|
|
431
|
+
}
|
|
432
|
+
catch (error) {
|
|
433
|
+
eventError = error;
|
|
434
|
+
}
|
|
435
|
+
const hadPendingMutations = this.pendingSessionWrites.length > 0;
|
|
436
|
+
await this.flushPendingSessionWrites();
|
|
437
|
+
if (eventError)
|
|
438
|
+
throw eventError;
|
|
439
|
+
await this.emitOwn({ type: "save_point", hadPendingMutations });
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
if (event.type === "agent_end") {
|
|
443
|
+
await this.flushPendingSessionWrites();
|
|
444
|
+
this.phase = "idle";
|
|
445
|
+
await this.emitAny(event, signal);
|
|
446
|
+
await this.emitOwn({ type: "settled", nextTurnCount: this.nextTurnQueue.length }, signal);
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
await this.emitAny(event, signal);
|
|
450
|
+
}
|
|
451
|
+
async emitRunFailure(model, error, aborted, signal) {
|
|
452
|
+
const failureMessage = createFailureMessage(model, error, aborted);
|
|
453
|
+
await this.handleAgentEvent({ type: "message_start", message: failureMessage }, signal);
|
|
454
|
+
await this.handleAgentEvent({ type: "message_end", message: failureMessage }, signal);
|
|
455
|
+
await this.handleAgentEvent({ type: "turn_end", message: failureMessage, toolResults: [] }, signal);
|
|
456
|
+
await this.handleAgentEvent({ type: "agent_end", messages: [failureMessage] }, signal);
|
|
457
|
+
return [failureMessage];
|
|
458
|
+
}
|
|
459
|
+
async executeTurn(turnState, text, options) {
|
|
460
|
+
let activeTurnState = turnState;
|
|
461
|
+
let messages = [createUserMessage(text, options?.images)];
|
|
462
|
+
if (this.nextTurnQueue.length > 0) {
|
|
463
|
+
const queuedMessages = this.nextTurnQueue.splice(0);
|
|
464
|
+
try {
|
|
465
|
+
await this.emitQueueUpdate();
|
|
466
|
+
}
|
|
467
|
+
catch (error) {
|
|
468
|
+
this.nextTurnQueue.unshift(...queuedMessages);
|
|
469
|
+
throw normalizeHookError(error);
|
|
470
|
+
}
|
|
471
|
+
messages = [...queuedMessages, messages[0]];
|
|
472
|
+
}
|
|
473
|
+
const beforeResult = await this.emitHook({
|
|
474
|
+
type: "before_agent_start",
|
|
475
|
+
prompt: text,
|
|
476
|
+
images: options?.images,
|
|
477
|
+
systemPrompt: turnState.systemPrompt,
|
|
478
|
+
resources: turnState.resources,
|
|
479
|
+
});
|
|
480
|
+
if (beforeResult?.messages)
|
|
481
|
+
messages = [...messages, ...beforeResult.messages];
|
|
482
|
+
const abortController = new AbortController();
|
|
483
|
+
const getTurnState = () => activeTurnState;
|
|
484
|
+
const setTurnState = (nextTurnState) => {
|
|
485
|
+
activeTurnState = nextTurnState;
|
|
486
|
+
};
|
|
487
|
+
this.runAbortController = abortController;
|
|
488
|
+
const runResultPromise = (async () => {
|
|
489
|
+
try {
|
|
490
|
+
return await runAgentLoop(messages, this.createContext(turnState, beforeResult?.systemPrompt), this.createLoopConfig(getTurnState, setTurnState), (event) => this.handleAgentEvent(event, abortController.signal), abortController.signal, this.createStreamFn(getTurnState));
|
|
491
|
+
}
|
|
492
|
+
catch (error) {
|
|
493
|
+
try {
|
|
494
|
+
return await this.emitRunFailure(activeTurnState.model, error, abortController.signal.aborted, abortController.signal);
|
|
495
|
+
}
|
|
496
|
+
catch (failureError) {
|
|
497
|
+
const cause = new AggregateError([toError(error), toError(failureError)], "Agent run failed and failure reporting failed");
|
|
498
|
+
throw new AgentHarnessError("unknown", cause.message, cause);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
})();
|
|
502
|
+
try {
|
|
503
|
+
const newMessages = await runResultPromise;
|
|
504
|
+
for (let i = newMessages.length - 1; i >= 0; i--) {
|
|
505
|
+
const message = newMessages[i];
|
|
506
|
+
if (message.role === "assistant") {
|
|
507
|
+
return message;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
throw new AgentHarnessError("invalid_state", "AgentHarness prompt completed without an assistant message");
|
|
511
|
+
}
|
|
512
|
+
finally {
|
|
513
|
+
try {
|
|
514
|
+
await this.flushPendingSessionWrites();
|
|
515
|
+
}
|
|
516
|
+
finally {
|
|
517
|
+
this.runAbortController = undefined;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
async prompt(text, options) {
|
|
522
|
+
if (this.phase !== "idle")
|
|
523
|
+
throw new AgentHarnessError("busy", "AgentHarness is busy");
|
|
524
|
+
this.phase = "turn";
|
|
525
|
+
const finishRunPromise = this.startRunPromise();
|
|
526
|
+
try {
|
|
527
|
+
const turnState = await this.createTurnState();
|
|
528
|
+
return await this.executeTurn(turnState, text, options);
|
|
529
|
+
}
|
|
530
|
+
catch (error) {
|
|
531
|
+
this.phase = "idle";
|
|
532
|
+
throw normalizeHarnessError(error, "unknown");
|
|
533
|
+
}
|
|
534
|
+
finally {
|
|
535
|
+
finishRunPromise();
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
async skill(name, additionalInstructions) {
|
|
539
|
+
if (this.phase !== "idle")
|
|
540
|
+
throw new AgentHarnessError("busy", "AgentHarness is busy");
|
|
541
|
+
this.phase = "turn";
|
|
542
|
+
const finishRunPromise = this.startRunPromise();
|
|
543
|
+
try {
|
|
544
|
+
const turnState = await this.createTurnState();
|
|
545
|
+
const skill = (turnState.resources.skills ?? []).find((candidate) => candidate.name === name);
|
|
546
|
+
if (!skill)
|
|
547
|
+
throw new AgentHarnessError("invalid_argument", `Unknown skill: ${name}`);
|
|
548
|
+
return await this.executeTurn(turnState, formatSkillInvocation(skill, additionalInstructions));
|
|
549
|
+
}
|
|
550
|
+
catch (error) {
|
|
551
|
+
this.phase = "idle";
|
|
552
|
+
throw normalizeHarnessError(error, "unknown");
|
|
553
|
+
}
|
|
554
|
+
finally {
|
|
555
|
+
finishRunPromise();
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
async promptFromTemplate(name, args = []) {
|
|
559
|
+
if (this.phase !== "idle")
|
|
560
|
+
throw new AgentHarnessError("busy", "AgentHarness is busy");
|
|
561
|
+
this.phase = "turn";
|
|
562
|
+
const finishRunPromise = this.startRunPromise();
|
|
563
|
+
try {
|
|
564
|
+
const turnState = await this.createTurnState();
|
|
565
|
+
const template = (turnState.resources.promptTemplates ?? []).find((candidate) => candidate.name === name);
|
|
566
|
+
if (!template)
|
|
567
|
+
throw new AgentHarnessError("invalid_argument", `Unknown prompt template: ${name}`);
|
|
568
|
+
return await this.executeTurn(turnState, formatPromptTemplateInvocation(template, args));
|
|
569
|
+
}
|
|
570
|
+
catch (error) {
|
|
571
|
+
this.phase = "idle";
|
|
572
|
+
throw normalizeHarnessError(error, "unknown");
|
|
573
|
+
}
|
|
574
|
+
finally {
|
|
575
|
+
finishRunPromise();
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
async steer(text, options) {
|
|
579
|
+
if (this.phase === "idle")
|
|
580
|
+
throw new AgentHarnessError("invalid_state", "Cannot steer while idle");
|
|
581
|
+
this.steerQueue.push(createUserMessage(text, options?.images));
|
|
582
|
+
await this.emitQueueUpdate();
|
|
583
|
+
}
|
|
584
|
+
async followUp(text, options) {
|
|
585
|
+
if (this.phase === "idle")
|
|
586
|
+
throw new AgentHarnessError("invalid_state", "Cannot follow up while idle");
|
|
587
|
+
this.followUpQueue.push(createUserMessage(text, options?.images));
|
|
588
|
+
await this.emitQueueUpdate();
|
|
589
|
+
}
|
|
590
|
+
async nextTurn(text, options) {
|
|
591
|
+
this.nextTurnQueue.push(createUserMessage(text, options?.images));
|
|
592
|
+
await this.emitQueueUpdate();
|
|
593
|
+
}
|
|
594
|
+
async appendMessage(message) {
|
|
595
|
+
try {
|
|
596
|
+
if (this.phase === "idle") {
|
|
597
|
+
await this.session.appendMessage(message);
|
|
598
|
+
}
|
|
599
|
+
else {
|
|
600
|
+
this.pendingSessionWrites.push({ type: "message", message });
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
catch (error) {
|
|
604
|
+
throw normalizeHarnessError(error, "session");
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
async compact(customInstructions) {
|
|
608
|
+
if (this.phase !== "idle")
|
|
609
|
+
throw new AgentHarnessError("busy", "compact() requires idle harness");
|
|
610
|
+
this.phase = "compaction";
|
|
611
|
+
try {
|
|
612
|
+
const model = this.model;
|
|
613
|
+
if (!model)
|
|
614
|
+
throw new AgentHarnessError("invalid_state", "No model set for compaction");
|
|
615
|
+
const auth = await this.getApiKeyAndHeaders?.(model);
|
|
616
|
+
if (!auth)
|
|
617
|
+
throw new AgentHarnessError("auth", "No auth available for compaction");
|
|
618
|
+
const branchEntries = await this.session.getBranch();
|
|
619
|
+
const preparationResult = prepareCompaction(branchEntries, DEFAULT_COMPACTION_SETTINGS);
|
|
620
|
+
if (!preparationResult.ok)
|
|
621
|
+
throw preparationResult.error;
|
|
622
|
+
const preparation = preparationResult.value;
|
|
623
|
+
if (!preparation)
|
|
624
|
+
throw new AgentHarnessError("compaction", "Nothing to compact");
|
|
625
|
+
const hookResult = await this.emitHook({
|
|
626
|
+
type: "session_before_compact",
|
|
627
|
+
preparation,
|
|
628
|
+
branchEntries,
|
|
629
|
+
customInstructions,
|
|
630
|
+
signal: new AbortController().signal,
|
|
631
|
+
});
|
|
632
|
+
if (hookResult?.cancel)
|
|
633
|
+
throw new AgentHarnessError("compaction", "Compaction cancelled");
|
|
634
|
+
const provided = hookResult?.compaction;
|
|
635
|
+
const compactResult = provided
|
|
636
|
+
? { ok: true, value: provided }
|
|
637
|
+
: await compact(preparation, model, auth.apiKey, auth.headers, customInstructions, undefined, this.thinkingLevel);
|
|
638
|
+
if (!compactResult.ok)
|
|
639
|
+
throw compactResult.error;
|
|
640
|
+
const result = compactResult.value;
|
|
641
|
+
const entryId = await this.session.appendCompaction(result.summary, result.firstKeptEntryId, result.tokensBefore, result.details, provided !== undefined);
|
|
642
|
+
const entry = await this.session.getEntry(entryId);
|
|
643
|
+
if (entry?.type === "compaction") {
|
|
644
|
+
await this.emitOwn({ type: "session_compact", compactionEntry: entry, fromHook: provided !== undefined });
|
|
645
|
+
}
|
|
646
|
+
return result;
|
|
647
|
+
}
|
|
648
|
+
catch (error) {
|
|
649
|
+
throw normalizeHarnessError(error, "compaction");
|
|
650
|
+
}
|
|
651
|
+
finally {
|
|
652
|
+
this.phase = "idle";
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
async navigateTree(targetId, options) {
|
|
656
|
+
if (this.phase !== "idle")
|
|
657
|
+
throw new AgentHarnessError("busy", "navigateTree() requires idle harness");
|
|
658
|
+
this.phase = "branch_summary";
|
|
659
|
+
try {
|
|
660
|
+
const oldLeafId = await this.session.getLeafId();
|
|
661
|
+
if (oldLeafId === targetId)
|
|
662
|
+
return { cancelled: false };
|
|
663
|
+
const targetEntry = await this.session.getEntry(targetId);
|
|
664
|
+
if (!targetEntry)
|
|
665
|
+
throw new AgentHarnessError("invalid_argument", `Entry ${targetId} not found`);
|
|
666
|
+
const { entries, commonAncestorId } = await collectEntriesForBranchSummary(this.session, oldLeafId, targetId);
|
|
667
|
+
const preparation = {
|
|
668
|
+
targetId,
|
|
669
|
+
oldLeafId,
|
|
670
|
+
commonAncestorId,
|
|
671
|
+
entriesToSummarize: entries,
|
|
672
|
+
userWantsSummary: options?.summarize ?? false,
|
|
673
|
+
customInstructions: options?.customInstructions,
|
|
674
|
+
replaceInstructions: options?.replaceInstructions,
|
|
675
|
+
label: options?.label,
|
|
676
|
+
};
|
|
677
|
+
const signal = new AbortController().signal;
|
|
678
|
+
const hookResult = await this.emitHook({ type: "session_before_tree", preparation, signal });
|
|
679
|
+
if (hookResult?.cancel)
|
|
680
|
+
return { cancelled: true };
|
|
681
|
+
let summaryEntry;
|
|
682
|
+
let summaryText = hookResult?.summary?.summary;
|
|
683
|
+
let summaryDetails = hookResult?.summary?.details;
|
|
684
|
+
if (!summaryText && options?.summarize && entries.length > 0) {
|
|
685
|
+
const model = this.model;
|
|
686
|
+
if (!model)
|
|
687
|
+
throw new AgentHarnessError("invalid_state", "No model set for branch summary");
|
|
688
|
+
const auth = await this.getApiKeyAndHeaders?.(model);
|
|
689
|
+
if (!auth)
|
|
690
|
+
throw new AgentHarnessError("auth", "No auth available for branch summary");
|
|
691
|
+
const branchSummary = await generateBranchSummary(entries, {
|
|
692
|
+
model,
|
|
693
|
+
apiKey: auth.apiKey,
|
|
694
|
+
headers: auth.headers,
|
|
695
|
+
signal: new AbortController().signal,
|
|
696
|
+
customInstructions: hookResult?.customInstructions ?? options?.customInstructions,
|
|
697
|
+
replaceInstructions: hookResult?.replaceInstructions ?? options?.replaceInstructions,
|
|
698
|
+
});
|
|
699
|
+
if (!branchSummary.ok) {
|
|
700
|
+
if (branchSummary.error.code === "aborted")
|
|
701
|
+
return { cancelled: true };
|
|
702
|
+
throw new AgentHarnessError("branch_summary", branchSummary.error.message, branchSummary.error);
|
|
703
|
+
}
|
|
704
|
+
summaryText = branchSummary.value.summary;
|
|
705
|
+
summaryDetails = {
|
|
706
|
+
readFiles: branchSummary.value.readFiles,
|
|
707
|
+
modifiedFiles: branchSummary.value.modifiedFiles,
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
let editorText;
|
|
711
|
+
let newLeafId;
|
|
712
|
+
if (targetEntry.type === "message" && targetEntry.message.role === "user") {
|
|
713
|
+
newLeafId = targetEntry.parentId;
|
|
714
|
+
const content = targetEntry.message.content;
|
|
715
|
+
editorText =
|
|
716
|
+
typeof content === "string"
|
|
717
|
+
? content
|
|
718
|
+
: content
|
|
719
|
+
.filter((c) => c.type === "text")
|
|
720
|
+
.map((c) => c.text)
|
|
721
|
+
.join("");
|
|
722
|
+
}
|
|
723
|
+
else if (targetEntry.type === "custom_message") {
|
|
724
|
+
newLeafId = targetEntry.parentId;
|
|
725
|
+
editorText =
|
|
726
|
+
typeof targetEntry.content === "string"
|
|
727
|
+
? targetEntry.content
|
|
728
|
+
: targetEntry.content
|
|
729
|
+
.filter((c) => c.type === "text")
|
|
730
|
+
.map((c) => c.text)
|
|
731
|
+
.join("");
|
|
732
|
+
}
|
|
733
|
+
else {
|
|
734
|
+
newLeafId = targetId;
|
|
735
|
+
}
|
|
736
|
+
const summaryId = await this.session.moveTo(newLeafId, summaryText
|
|
737
|
+
? { summary: summaryText, details: summaryDetails, fromHook: hookResult?.summary !== undefined }
|
|
738
|
+
: undefined);
|
|
739
|
+
if (summaryId) {
|
|
740
|
+
const entry = await this.session.getEntry(summaryId);
|
|
741
|
+
if (entry?.type === "branch_summary")
|
|
742
|
+
summaryEntry = entry;
|
|
743
|
+
}
|
|
744
|
+
await this.emitOwn({
|
|
745
|
+
type: "session_tree",
|
|
746
|
+
newLeafId: await this.session.getLeafId(),
|
|
747
|
+
oldLeafId,
|
|
748
|
+
summaryEntry,
|
|
749
|
+
fromHook: hookResult?.summary !== undefined,
|
|
750
|
+
});
|
|
751
|
+
return { cancelled: false, editorText, summaryEntry };
|
|
752
|
+
}
|
|
753
|
+
catch (error) {
|
|
754
|
+
throw normalizeHarnessError(error, "branch_summary");
|
|
755
|
+
}
|
|
756
|
+
finally {
|
|
757
|
+
this.phase = "idle";
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
getModel() {
|
|
761
|
+
return this.model;
|
|
762
|
+
}
|
|
763
|
+
getThinkingLevel() {
|
|
764
|
+
return this.thinkingLevel;
|
|
765
|
+
}
|
|
766
|
+
async setModel(model) {
|
|
767
|
+
try {
|
|
768
|
+
const previousModel = this.model;
|
|
769
|
+
if (this.phase === "idle") {
|
|
770
|
+
await this.session.appendModelChange(model.provider, model.id);
|
|
771
|
+
}
|
|
772
|
+
else {
|
|
773
|
+
this.pendingSessionWrites.push({ type: "model_change", provider: model.provider, modelId: model.id });
|
|
774
|
+
}
|
|
775
|
+
this.model = model;
|
|
776
|
+
await this.emitOwn({ type: "model_select", model, previousModel, source: "set" });
|
|
777
|
+
}
|
|
778
|
+
catch (error) {
|
|
779
|
+
throw normalizeHarnessError(error, "session");
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
async setThinkingLevel(level) {
|
|
783
|
+
try {
|
|
784
|
+
const previousLevel = this.thinkingLevel;
|
|
785
|
+
if (this.phase === "idle") {
|
|
786
|
+
await this.session.appendThinkingLevelChange(level);
|
|
787
|
+
}
|
|
788
|
+
else {
|
|
789
|
+
this.pendingSessionWrites.push({ type: "thinking_level_change", thinkingLevel: level });
|
|
790
|
+
}
|
|
791
|
+
this.thinkingLevel = level;
|
|
792
|
+
await this.emitOwn({ type: "thinking_level_select", level, previousLevel });
|
|
793
|
+
}
|
|
794
|
+
catch (error) {
|
|
795
|
+
throw normalizeHarnessError(error, "session");
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
async setActiveTools(toolNames) {
|
|
799
|
+
try {
|
|
800
|
+
this.validateToolNames(toolNames);
|
|
801
|
+
this.activeToolNames = [...toolNames];
|
|
802
|
+
}
|
|
803
|
+
catch (error) {
|
|
804
|
+
throw normalizeHarnessError(error, "invalid_argument");
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
getSteeringMode() {
|
|
808
|
+
return this.steeringQueueMode;
|
|
809
|
+
}
|
|
810
|
+
async setSteeringMode(mode) {
|
|
811
|
+
this.steeringQueueMode = mode;
|
|
812
|
+
}
|
|
813
|
+
getFollowUpMode() {
|
|
814
|
+
return this.followUpQueueMode;
|
|
815
|
+
}
|
|
816
|
+
async setFollowUpMode(mode) {
|
|
817
|
+
this.followUpQueueMode = mode;
|
|
818
|
+
}
|
|
819
|
+
getResources() {
|
|
820
|
+
return {
|
|
821
|
+
skills: this.resources.skills?.slice(),
|
|
822
|
+
promptTemplates: this.resources.promptTemplates?.slice(),
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
async setResources(resources) {
|
|
826
|
+
const previousResources = this.getResources();
|
|
827
|
+
this.resources = {
|
|
828
|
+
skills: resources.skills?.slice(),
|
|
829
|
+
promptTemplates: resources.promptTemplates?.slice(),
|
|
830
|
+
};
|
|
831
|
+
await this.emitOwn({ type: "resources_update", resources: this.getResources(), previousResources });
|
|
832
|
+
}
|
|
833
|
+
getStreamOptions() {
|
|
834
|
+
return cloneStreamOptions(this.streamOptions);
|
|
835
|
+
}
|
|
836
|
+
async setStreamOptions(streamOptions) {
|
|
837
|
+
this.streamOptions = cloneStreamOptions(streamOptions);
|
|
838
|
+
}
|
|
839
|
+
async setTools(tools, activeToolNames) {
|
|
840
|
+
try {
|
|
841
|
+
const nextTools = new Map(tools.map((tool) => [tool.name, tool]));
|
|
842
|
+
const nextActiveToolNames = activeToolNames ? [...activeToolNames] : this.activeToolNames;
|
|
843
|
+
this.validateToolNames(nextActiveToolNames, nextTools);
|
|
844
|
+
this.tools = nextTools;
|
|
845
|
+
this.activeToolNames = [...nextActiveToolNames];
|
|
846
|
+
}
|
|
847
|
+
catch (error) {
|
|
848
|
+
throw normalizeHarnessError(error, "invalid_argument");
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
async abort() {
|
|
852
|
+
const clearedSteer = [...this.steerQueue];
|
|
853
|
+
const clearedFollowUp = [...this.followUpQueue];
|
|
854
|
+
this.steerQueue = [];
|
|
855
|
+
this.followUpQueue = [];
|
|
856
|
+
this.runAbortController?.abort();
|
|
857
|
+
const errors = [];
|
|
858
|
+
try {
|
|
859
|
+
await this.emitQueueUpdate();
|
|
860
|
+
}
|
|
861
|
+
catch (error) {
|
|
862
|
+
errors.push(toError(error));
|
|
863
|
+
}
|
|
864
|
+
try {
|
|
865
|
+
await this.waitForIdle();
|
|
866
|
+
}
|
|
867
|
+
catch (error) {
|
|
868
|
+
errors.push(toError(error));
|
|
869
|
+
}
|
|
870
|
+
try {
|
|
871
|
+
await this.emitOwn({ type: "abort", clearedSteer, clearedFollowUp });
|
|
872
|
+
}
|
|
873
|
+
catch (error) {
|
|
874
|
+
errors.push(toError(error));
|
|
875
|
+
}
|
|
876
|
+
if (errors.length > 0) {
|
|
877
|
+
const cause = errors.length === 1 ? errors[0] : new AggregateError(errors, "Abort completed with errors");
|
|
878
|
+
throw normalizeHarnessError(cause, "hook");
|
|
879
|
+
}
|
|
880
|
+
return { clearedSteer, clearedFollowUp };
|
|
881
|
+
}
|
|
882
|
+
async waitForIdle() {
|
|
883
|
+
await this.runPromise;
|
|
884
|
+
}
|
|
885
|
+
subscribe(listener) {
|
|
886
|
+
let handlers = this.handlers.get(SUBSCRIBER_EVENT_TYPE);
|
|
887
|
+
if (!handlers) {
|
|
888
|
+
handlers = new Set();
|
|
889
|
+
this.handlers.set(SUBSCRIBER_EVENT_TYPE, handlers);
|
|
890
|
+
}
|
|
891
|
+
handlers.add(listener);
|
|
892
|
+
return () => handlers.delete(listener);
|
|
893
|
+
}
|
|
894
|
+
on(type, handler) {
|
|
895
|
+
let handlers = this.handlers.get(type);
|
|
896
|
+
if (!handlers) {
|
|
897
|
+
handlers = new Set();
|
|
898
|
+
this.handlers.set(type, handlers);
|
|
899
|
+
}
|
|
900
|
+
handlers.add(handler);
|
|
901
|
+
return () => handlers.delete(handler);
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
//# sourceMappingURL=agent-harness.js.map
|