@code-yeongyu/senpi 2026.5.20-4 → 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 +12 -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,405 @@
|
|
|
1
|
+
import { streamSimple, } from "@earendil-works/pi-ai";
|
|
2
|
+
import { runAgentLoop, runAgentLoopContinue } from "./agent-loop.js";
|
|
3
|
+
function defaultConvertToLlm(messages) {
|
|
4
|
+
return messages.filter((message) => message.role === "user" || message.role === "assistant" || message.role === "toolResult");
|
|
5
|
+
}
|
|
6
|
+
const EMPTY_USAGE = {
|
|
7
|
+
input: 0,
|
|
8
|
+
output: 0,
|
|
9
|
+
cacheRead: 0,
|
|
10
|
+
cacheWrite: 0,
|
|
11
|
+
totalTokens: 0,
|
|
12
|
+
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
|
|
13
|
+
};
|
|
14
|
+
const DEFAULT_MODEL = {
|
|
15
|
+
id: "unknown",
|
|
16
|
+
name: "unknown",
|
|
17
|
+
api: "unknown",
|
|
18
|
+
provider: "unknown",
|
|
19
|
+
baseUrl: "",
|
|
20
|
+
reasoning: false,
|
|
21
|
+
input: [],
|
|
22
|
+
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
23
|
+
contextWindow: 0,
|
|
24
|
+
maxTokens: 0,
|
|
25
|
+
};
|
|
26
|
+
function createMutableAgentState(initialState) {
|
|
27
|
+
let tools = initialState?.tools?.slice() ?? [];
|
|
28
|
+
let messages = initialState?.messages?.slice() ?? [];
|
|
29
|
+
return {
|
|
30
|
+
systemPrompt: initialState?.systemPrompt ?? "",
|
|
31
|
+
model: initialState?.model ?? DEFAULT_MODEL,
|
|
32
|
+
thinkingLevel: initialState?.thinkingLevel ?? "off",
|
|
33
|
+
get tools() {
|
|
34
|
+
return tools;
|
|
35
|
+
},
|
|
36
|
+
set tools(nextTools) {
|
|
37
|
+
tools = nextTools.slice();
|
|
38
|
+
},
|
|
39
|
+
get messages() {
|
|
40
|
+
return messages;
|
|
41
|
+
},
|
|
42
|
+
set messages(nextMessages) {
|
|
43
|
+
messages = nextMessages.slice();
|
|
44
|
+
},
|
|
45
|
+
isStreaming: false,
|
|
46
|
+
streamingMessage: undefined,
|
|
47
|
+
pendingToolCalls: new Set(),
|
|
48
|
+
errorMessage: undefined,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
class PendingMessageQueue {
|
|
52
|
+
messages = [];
|
|
53
|
+
mode;
|
|
54
|
+
constructor(mode) {
|
|
55
|
+
this.mode = mode;
|
|
56
|
+
}
|
|
57
|
+
enqueue(message) {
|
|
58
|
+
this.messages.push(message);
|
|
59
|
+
}
|
|
60
|
+
hasItems() {
|
|
61
|
+
return this.messages.length > 0;
|
|
62
|
+
}
|
|
63
|
+
drain() {
|
|
64
|
+
if (this.mode === "all") {
|
|
65
|
+
const drained = this.messages.slice();
|
|
66
|
+
this.messages = [];
|
|
67
|
+
return drained;
|
|
68
|
+
}
|
|
69
|
+
const first = this.messages[0];
|
|
70
|
+
if (!first) {
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
73
|
+
this.messages = this.messages.slice(1);
|
|
74
|
+
return [first];
|
|
75
|
+
}
|
|
76
|
+
clear() {
|
|
77
|
+
this.messages = [];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Stateful wrapper around the low-level agent loop.
|
|
82
|
+
*
|
|
83
|
+
* `Agent` owns the current transcript, emits lifecycle events, executes tools,
|
|
84
|
+
* and exposes queueing APIs for steering and follow-up messages.
|
|
85
|
+
*/
|
|
86
|
+
export class Agent {
|
|
87
|
+
_state;
|
|
88
|
+
listeners = new Set();
|
|
89
|
+
steeringQueue;
|
|
90
|
+
followUpQueue;
|
|
91
|
+
convertToLlm;
|
|
92
|
+
transformContext;
|
|
93
|
+
streamFn;
|
|
94
|
+
getApiKey;
|
|
95
|
+
onPayload;
|
|
96
|
+
onResponse;
|
|
97
|
+
beforeToolCall;
|
|
98
|
+
afterToolCall;
|
|
99
|
+
prepareNextTurn;
|
|
100
|
+
activeRun;
|
|
101
|
+
/** Session identifier forwarded to providers for cache-aware backends. */
|
|
102
|
+
sessionId;
|
|
103
|
+
/** Optional per-level thinking token budgets forwarded to the stream function. */
|
|
104
|
+
thinkingBudgets;
|
|
105
|
+
/** Preferred transport forwarded to the stream function. */
|
|
106
|
+
transport;
|
|
107
|
+
timeoutMs;
|
|
108
|
+
/** Optional cap for provider-requested retry delays. */
|
|
109
|
+
maxRetryDelayMs;
|
|
110
|
+
/** Tool execution strategy for assistant messages that contain multiple tool calls. */
|
|
111
|
+
toolExecution;
|
|
112
|
+
constructor(options = {}) {
|
|
113
|
+
this._state = createMutableAgentState(options.initialState);
|
|
114
|
+
this.convertToLlm = options.convertToLlm ?? defaultConvertToLlm;
|
|
115
|
+
this.transformContext = options.transformContext;
|
|
116
|
+
this.streamFn = options.streamFn ?? streamSimple;
|
|
117
|
+
this.getApiKey = options.getApiKey;
|
|
118
|
+
this.onPayload = options.onPayload;
|
|
119
|
+
this.onResponse = options.onResponse;
|
|
120
|
+
this.beforeToolCall = options.beforeToolCall;
|
|
121
|
+
this.afterToolCall = options.afterToolCall;
|
|
122
|
+
this.prepareNextTurn = options.prepareNextTurn;
|
|
123
|
+
this.steeringQueue = new PendingMessageQueue(options.steeringMode ?? "one-at-a-time");
|
|
124
|
+
this.followUpQueue = new PendingMessageQueue(options.followUpMode ?? "one-at-a-time");
|
|
125
|
+
this.sessionId = options.sessionId;
|
|
126
|
+
this.thinkingBudgets = options.thinkingBudgets;
|
|
127
|
+
this.transport = options.transport ?? "auto";
|
|
128
|
+
this.timeoutMs = options.timeoutMs;
|
|
129
|
+
this.maxRetryDelayMs = options.maxRetryDelayMs;
|
|
130
|
+
this.toolExecution = options.toolExecution ?? "parallel";
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Subscribe to agent lifecycle events.
|
|
134
|
+
*
|
|
135
|
+
* Listener promises are awaited in subscription order and are included in
|
|
136
|
+
* the current run's settlement. Listeners also receive the active abort
|
|
137
|
+
* signal for the current run.
|
|
138
|
+
*
|
|
139
|
+
* `agent_end` is the final emitted event for a run, but the agent does not
|
|
140
|
+
* become idle until all awaited listeners for that event have settled.
|
|
141
|
+
*/
|
|
142
|
+
subscribe(listener) {
|
|
143
|
+
this.listeners.add(listener);
|
|
144
|
+
return () => this.listeners.delete(listener);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Current agent state.
|
|
148
|
+
*
|
|
149
|
+
* Assigning `state.tools` or `state.messages` copies the provided top-level array.
|
|
150
|
+
*/
|
|
151
|
+
get state() {
|
|
152
|
+
return this._state;
|
|
153
|
+
}
|
|
154
|
+
/** Controls how queued steering messages are drained. */
|
|
155
|
+
set steeringMode(mode) {
|
|
156
|
+
this.steeringQueue.mode = mode;
|
|
157
|
+
}
|
|
158
|
+
get steeringMode() {
|
|
159
|
+
return this.steeringQueue.mode;
|
|
160
|
+
}
|
|
161
|
+
/** Controls how queued follow-up messages are drained. */
|
|
162
|
+
set followUpMode(mode) {
|
|
163
|
+
this.followUpQueue.mode = mode;
|
|
164
|
+
}
|
|
165
|
+
get followUpMode() {
|
|
166
|
+
return this.followUpQueue.mode;
|
|
167
|
+
}
|
|
168
|
+
/** Queue a message to be injected after the current assistant turn finishes. */
|
|
169
|
+
steer(message) {
|
|
170
|
+
this.steeringQueue.enqueue(message);
|
|
171
|
+
}
|
|
172
|
+
/** Queue a message to run only after the agent would otherwise stop. */
|
|
173
|
+
followUp(message) {
|
|
174
|
+
this.followUpQueue.enqueue(message);
|
|
175
|
+
}
|
|
176
|
+
/** Remove all queued steering messages. */
|
|
177
|
+
clearSteeringQueue() {
|
|
178
|
+
this.steeringQueue.clear();
|
|
179
|
+
}
|
|
180
|
+
/** Remove all queued follow-up messages. */
|
|
181
|
+
clearFollowUpQueue() {
|
|
182
|
+
this.followUpQueue.clear();
|
|
183
|
+
}
|
|
184
|
+
/** Remove all queued steering and follow-up messages. */
|
|
185
|
+
clearAllQueues() {
|
|
186
|
+
this.clearSteeringQueue();
|
|
187
|
+
this.clearFollowUpQueue();
|
|
188
|
+
}
|
|
189
|
+
/** Returns true when either queue still contains pending messages. */
|
|
190
|
+
hasQueuedMessages() {
|
|
191
|
+
return this.steeringQueue.hasItems() || this.followUpQueue.hasItems();
|
|
192
|
+
}
|
|
193
|
+
/** Active abort signal for the current run, if any. */
|
|
194
|
+
get signal() {
|
|
195
|
+
return this.activeRun?.abortController.signal;
|
|
196
|
+
}
|
|
197
|
+
/** Abort the current run, if one is active. */
|
|
198
|
+
abort() {
|
|
199
|
+
this.activeRun?.abortController.abort();
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Resolve when the current run and all awaited event listeners have finished.
|
|
203
|
+
*
|
|
204
|
+
* This resolves after `agent_end` listeners settle.
|
|
205
|
+
*/
|
|
206
|
+
waitForIdle() {
|
|
207
|
+
return this.activeRun?.promise ?? Promise.resolve();
|
|
208
|
+
}
|
|
209
|
+
/** Clear transcript state, runtime state, and queued messages. */
|
|
210
|
+
reset() {
|
|
211
|
+
this._state.messages = [];
|
|
212
|
+
this._state.isStreaming = false;
|
|
213
|
+
this._state.streamingMessage = undefined;
|
|
214
|
+
this._state.pendingToolCalls = new Set();
|
|
215
|
+
this._state.errorMessage = undefined;
|
|
216
|
+
this.clearFollowUpQueue();
|
|
217
|
+
this.clearSteeringQueue();
|
|
218
|
+
}
|
|
219
|
+
async prompt(input, images) {
|
|
220
|
+
if (this.activeRun) {
|
|
221
|
+
throw new Error("Agent is already processing a prompt. Use steer() or followUp() to queue messages, or wait for completion.");
|
|
222
|
+
}
|
|
223
|
+
const messages = this.normalizePromptInput(input, images);
|
|
224
|
+
await this.runPromptMessages(messages);
|
|
225
|
+
}
|
|
226
|
+
/** Continue from the current transcript. The last message must be a user or tool-result message. */
|
|
227
|
+
async continue() {
|
|
228
|
+
if (this.activeRun) {
|
|
229
|
+
throw new Error("Agent is already processing. Wait for completion before continuing.");
|
|
230
|
+
}
|
|
231
|
+
const lastMessage = this._state.messages[this._state.messages.length - 1];
|
|
232
|
+
if (!lastMessage) {
|
|
233
|
+
throw new Error("No messages to continue from");
|
|
234
|
+
}
|
|
235
|
+
if (lastMessage.role === "assistant") {
|
|
236
|
+
const queuedSteering = this.steeringQueue.drain();
|
|
237
|
+
if (queuedSteering.length > 0) {
|
|
238
|
+
await this.runPromptMessages(queuedSteering, { skipInitialSteeringPoll: true });
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
const queuedFollowUps = this.followUpQueue.drain();
|
|
242
|
+
if (queuedFollowUps.length > 0) {
|
|
243
|
+
await this.runPromptMessages(queuedFollowUps);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
throw new Error("Cannot continue from message role: assistant");
|
|
247
|
+
}
|
|
248
|
+
await this.runContinuation();
|
|
249
|
+
}
|
|
250
|
+
normalizePromptInput(input, images) {
|
|
251
|
+
if (Array.isArray(input)) {
|
|
252
|
+
return input;
|
|
253
|
+
}
|
|
254
|
+
if (typeof input !== "string") {
|
|
255
|
+
return [input];
|
|
256
|
+
}
|
|
257
|
+
const content = [{ type: "text", text: input }];
|
|
258
|
+
if (images && images.length > 0) {
|
|
259
|
+
content.push(...images);
|
|
260
|
+
}
|
|
261
|
+
return [{ role: "user", content, timestamp: Date.now() }];
|
|
262
|
+
}
|
|
263
|
+
async runPromptMessages(messages, options = {}) {
|
|
264
|
+
await this.runWithLifecycle(async (signal) => {
|
|
265
|
+
await runAgentLoop(messages, this.createContextSnapshot(), this.createLoopConfig(options), (event) => this.processEvents(event), signal, this.streamFn);
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
async runContinuation() {
|
|
269
|
+
await this.runWithLifecycle(async (signal) => {
|
|
270
|
+
await runAgentLoopContinue(this.createContextSnapshot(), this.createLoopConfig(), (event) => this.processEvents(event), signal, this.streamFn);
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
createContextSnapshot() {
|
|
274
|
+
return {
|
|
275
|
+
systemPrompt: this._state.systemPrompt,
|
|
276
|
+
messages: this._state.messages.slice(),
|
|
277
|
+
tools: this._state.tools.slice(),
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
createLoopConfig(options = {}) {
|
|
281
|
+
let skipInitialSteeringPoll = options.skipInitialSteeringPoll === true;
|
|
282
|
+
return {
|
|
283
|
+
model: this._state.model,
|
|
284
|
+
reasoning: this._state.thinkingLevel === "off" ? undefined : this._state.thinkingLevel,
|
|
285
|
+
sessionId: this.sessionId,
|
|
286
|
+
onPayload: this.onPayload,
|
|
287
|
+
onResponse: this.onResponse,
|
|
288
|
+
transport: this.transport,
|
|
289
|
+
thinkingBudgets: this.thinkingBudgets,
|
|
290
|
+
timeoutMs: this.timeoutMs,
|
|
291
|
+
maxRetryDelayMs: this.maxRetryDelayMs,
|
|
292
|
+
toolExecution: this.toolExecution,
|
|
293
|
+
beforeToolCall: this.beforeToolCall,
|
|
294
|
+
afterToolCall: this.afterToolCall,
|
|
295
|
+
prepareNextTurn: this.prepareNextTurn ? async () => await this.prepareNextTurn?.(this.signal) : undefined,
|
|
296
|
+
convertToLlm: this.convertToLlm,
|
|
297
|
+
transformContext: this.transformContext,
|
|
298
|
+
getApiKey: this.getApiKey,
|
|
299
|
+
getSteeringMessages: async () => {
|
|
300
|
+
if (skipInitialSteeringPoll) {
|
|
301
|
+
skipInitialSteeringPoll = false;
|
|
302
|
+
return [];
|
|
303
|
+
}
|
|
304
|
+
return this.steeringQueue.drain();
|
|
305
|
+
},
|
|
306
|
+
getFollowUpMessages: async () => this.followUpQueue.drain(),
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
async runWithLifecycle(executor) {
|
|
310
|
+
if (this.activeRun) {
|
|
311
|
+
throw new Error("Agent is already processing.");
|
|
312
|
+
}
|
|
313
|
+
const abortController = new AbortController();
|
|
314
|
+
let resolvePromise = () => { };
|
|
315
|
+
const promise = new Promise((resolve) => {
|
|
316
|
+
resolvePromise = resolve;
|
|
317
|
+
});
|
|
318
|
+
this.activeRun = { promise, resolve: resolvePromise, abortController };
|
|
319
|
+
this._state.isStreaming = true;
|
|
320
|
+
this._state.streamingMessage = undefined;
|
|
321
|
+
this._state.errorMessage = undefined;
|
|
322
|
+
try {
|
|
323
|
+
await executor(abortController.signal);
|
|
324
|
+
}
|
|
325
|
+
catch (error) {
|
|
326
|
+
await this.handleRunFailure(error, abortController.signal.aborted);
|
|
327
|
+
}
|
|
328
|
+
finally {
|
|
329
|
+
this.finishRun();
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
async handleRunFailure(error, aborted) {
|
|
333
|
+
const failureMessage = {
|
|
334
|
+
role: "assistant",
|
|
335
|
+
content: [{ type: "text", text: "" }],
|
|
336
|
+
api: this._state.model.api,
|
|
337
|
+
provider: this._state.model.provider,
|
|
338
|
+
model: this._state.model.id,
|
|
339
|
+
usage: EMPTY_USAGE,
|
|
340
|
+
stopReason: aborted ? "aborted" : "error",
|
|
341
|
+
errorMessage: error instanceof Error ? error.message : String(error),
|
|
342
|
+
timestamp: Date.now(),
|
|
343
|
+
};
|
|
344
|
+
await this.processEvents({ type: "message_start", message: failureMessage });
|
|
345
|
+
await this.processEvents({ type: "message_end", message: failureMessage });
|
|
346
|
+
await this.processEvents({ type: "turn_end", message: failureMessage, toolResults: [] });
|
|
347
|
+
await this.processEvents({ type: "agent_end", messages: [failureMessage] });
|
|
348
|
+
}
|
|
349
|
+
finishRun() {
|
|
350
|
+
this._state.isStreaming = false;
|
|
351
|
+
this._state.streamingMessage = undefined;
|
|
352
|
+
this._state.pendingToolCalls = new Set();
|
|
353
|
+
this.activeRun?.resolve();
|
|
354
|
+
this.activeRun = undefined;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Reduce internal state for a loop event, then await listeners.
|
|
358
|
+
*
|
|
359
|
+
* `agent_end` only means no further loop events will be emitted. The run is
|
|
360
|
+
* considered idle later, after all awaited listeners for `agent_end` finish
|
|
361
|
+
* and `finishRun()` clears runtime-owned state.
|
|
362
|
+
*/
|
|
363
|
+
async processEvents(event) {
|
|
364
|
+
switch (event.type) {
|
|
365
|
+
case "message_start":
|
|
366
|
+
this._state.streamingMessage = event.message;
|
|
367
|
+
break;
|
|
368
|
+
case "message_update":
|
|
369
|
+
this._state.streamingMessage = event.message;
|
|
370
|
+
break;
|
|
371
|
+
case "message_end":
|
|
372
|
+
this._state.streamingMessage = undefined;
|
|
373
|
+
this._state.messages.push(event.message);
|
|
374
|
+
break;
|
|
375
|
+
case "tool_execution_start": {
|
|
376
|
+
const pendingToolCalls = new Set(this._state.pendingToolCalls);
|
|
377
|
+
pendingToolCalls.add(event.toolCallId);
|
|
378
|
+
this._state.pendingToolCalls = pendingToolCalls;
|
|
379
|
+
break;
|
|
380
|
+
}
|
|
381
|
+
case "tool_execution_end": {
|
|
382
|
+
const pendingToolCalls = new Set(this._state.pendingToolCalls);
|
|
383
|
+
pendingToolCalls.delete(event.toolCallId);
|
|
384
|
+
this._state.pendingToolCalls = pendingToolCalls;
|
|
385
|
+
break;
|
|
386
|
+
}
|
|
387
|
+
case "turn_end":
|
|
388
|
+
if (event.message.role === "assistant" && event.message.errorMessage) {
|
|
389
|
+
this._state.errorMessage = event.message.errorMessage;
|
|
390
|
+
}
|
|
391
|
+
break;
|
|
392
|
+
case "agent_end":
|
|
393
|
+
this._state.streamingMessage = undefined;
|
|
394
|
+
break;
|
|
395
|
+
}
|
|
396
|
+
const signal = this.activeRun?.abortController.signal;
|
|
397
|
+
if (!signal) {
|
|
398
|
+
throw new Error("Agent listener invoked outside active run");
|
|
399
|
+
}
|
|
400
|
+
for (const listener of this.listeners) {
|
|
401
|
+
await listener(event, signal);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
//# sourceMappingURL=agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAKN,YAAY,GAIZ,MAAM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,\n\ttype Model,\n\ttype SimpleStreamOptions,\n\tstreamSimple,\n\ttype TextContent,\n\ttype ThinkingBudgets,\n\ttype Transport,\n} from \"@earendil-works/pi-ai\";\nimport { runAgentLoop, runAgentLoopContinue } from \"./agent-loop.ts\";\nimport type {\n\tAfterToolCallContext,\n\tAfterToolCallResult,\n\tAgentContext,\n\tAgentEvent,\n\tAgentLoopConfig,\n\tAgentLoopTurnUpdate,\n\tAgentMessage,\n\tAgentState,\n\tAgentTool,\n\tBeforeToolCallContext,\n\tBeforeToolCallResult,\n\tQueueMode,\n\tStreamFn,\n\tToolExecutionMode,\n} from \"./types.ts\";\n\nexport type { QueueMode } from \"./types.ts\";\n\nfunction defaultConvertToLlm(messages: AgentMessage[]): Message[] {\n\treturn messages.filter(\n\t\t(message) => message.role === \"user\" || message.role === \"assistant\" || message.role === \"toolResult\",\n\t);\n}\n\nconst EMPTY_USAGE = {\n\tinput: 0,\n\toutput: 0,\n\tcacheRead: 0,\n\tcacheWrite: 0,\n\ttotalTokens: 0,\n\tcost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },\n};\n\nconst DEFAULT_MODEL = {\n\tid: \"unknown\",\n\tname: \"unknown\",\n\tapi: \"unknown\",\n\tprovider: \"unknown\",\n\tbaseUrl: \"\",\n\treasoning: false,\n\tinput: [],\n\tcost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },\n\tcontextWindow: 0,\n\tmaxTokens: 0,\n} satisfies Model<any>;\n\ntype MutableAgentState = Omit<AgentState, \"isStreaming\" | \"streamingMessage\" | \"pendingToolCalls\" | \"errorMessage\"> & {\n\tisStreaming: boolean;\n\tstreamingMessage?: AgentMessage;\n\tpendingToolCalls: Set<string>;\n\terrorMessage?: string;\n};\n\nfunction createMutableAgentState(\n\tinitialState?: Partial<Omit<AgentState, \"pendingToolCalls\" | \"isStreaming\" | \"streamingMessage\" | \"errorMessage\">>,\n): MutableAgentState {\n\tlet tools = initialState?.tools?.slice() ?? [];\n\tlet messages = initialState?.messages?.slice() ?? [];\n\n\treturn {\n\t\tsystemPrompt: initialState?.systemPrompt ?? \"\",\n\t\tmodel: initialState?.model ?? DEFAULT_MODEL,\n\t\tthinkingLevel: initialState?.thinkingLevel ?? \"off\",\n\t\tget tools() {\n\t\t\treturn tools;\n\t\t},\n\t\tset tools(nextTools: AgentTool<any>[]) {\n\t\t\ttools = nextTools.slice();\n\t\t},\n\t\tget messages() {\n\t\t\treturn messages;\n\t\t},\n\t\tset messages(nextMessages: AgentMessage[]) {\n\t\t\tmessages = nextMessages.slice();\n\t\t},\n\t\tisStreaming: false,\n\t\tstreamingMessage: undefined,\n\t\tpendingToolCalls: new Set<string>(),\n\t\terrorMessage: undefined,\n\t};\n}\n\n/** Options for constructing an {@link Agent}. */\nexport interface AgentOptions {\n\tinitialState?: Partial<Omit<AgentState, \"pendingToolCalls\" | \"isStreaming\" | \"streamingMessage\" | \"errorMessage\">>;\n\tconvertToLlm?: (messages: AgentMessage[]) => Message[] | Promise<Message[]>;\n\ttransformContext?: (messages: AgentMessage[], signal?: AbortSignal) => Promise<AgentMessage[]>;\n\tstreamFn?: StreamFn;\n\tgetApiKey?: (provider: string) => Promise<string | undefined> | string | undefined;\n\tonPayload?: SimpleStreamOptions[\"onPayload\"];\n\tonResponse?: SimpleStreamOptions[\"onResponse\"];\n\tbeforeToolCall?: (context: BeforeToolCallContext, signal?: AbortSignal) => Promise<BeforeToolCallResult | undefined>;\n\tafterToolCall?: (context: AfterToolCallContext, signal?: AbortSignal) => Promise<AfterToolCallResult | undefined>;\n\tprepareNextTurn?: (\n\t\tsignal?: AbortSignal,\n\t) => Promise<AgentLoopTurnUpdate | undefined> | AgentLoopTurnUpdate | undefined;\n\tsteeringMode?: QueueMode;\n\tfollowUpMode?: QueueMode;\n\tsessionId?: string;\n\tthinkingBudgets?: ThinkingBudgets;\n\ttransport?: Transport;\n\ttimeoutMs?: number;\n\tmaxRetryDelayMs?: number;\n\ttoolExecution?: ToolExecutionMode;\n}\n\nclass PendingMessageQueue {\n\tprivate messages: AgentMessage[] = [];\n\tpublic mode: QueueMode;\n\n\tconstructor(mode: QueueMode) {\n\t\tthis.mode = mode;\n\t}\n\n\tenqueue(message: AgentMessage): void {\n\t\tthis.messages.push(message);\n\t}\n\n\thasItems(): boolean {\n\t\treturn this.messages.length > 0;\n\t}\n\n\tdrain(): AgentMessage[] {\n\t\tif (this.mode === \"all\") {\n\t\t\tconst drained = this.messages.slice();\n\t\t\tthis.messages = [];\n\t\t\treturn drained;\n\t\t}\n\n\t\tconst first = this.messages[0];\n\t\tif (!first) {\n\t\t\treturn [];\n\t\t}\n\t\tthis.messages = this.messages.slice(1);\n\t\treturn [first];\n\t}\n\n\tclear(): void {\n\t\tthis.messages = [];\n\t}\n}\n\ntype ActiveRun = {\n\tpromise: Promise<void>;\n\tresolve: () => void;\n\tabortController: AbortController;\n};\n\n/**\n * Stateful wrapper around the low-level agent loop.\n *\n * `Agent` owns the current transcript, emits lifecycle events, executes tools,\n * and exposes queueing APIs for steering and follow-up messages.\n */\nexport class Agent {\n\tprivate _state: MutableAgentState;\n\tprivate readonly listeners = new Set<(event: AgentEvent, signal: AbortSignal) => Promise<void> | void>();\n\tprivate readonly steeringQueue: PendingMessageQueue;\n\tprivate readonly followUpQueue: PendingMessageQueue;\n\n\tpublic convertToLlm: (messages: AgentMessage[]) => Message[] | Promise<Message[]>;\n\tpublic transformContext?: (messages: AgentMessage[], signal?: AbortSignal) => Promise<AgentMessage[]>;\n\tpublic streamFn: StreamFn;\n\tpublic getApiKey?: (provider: string) => Promise<string | undefined> | string | undefined;\n\tpublic onPayload?: SimpleStreamOptions[\"onPayload\"];\n\tpublic onResponse?: SimpleStreamOptions[\"onResponse\"];\n\tpublic beforeToolCall?: (\n\t\tcontext: BeforeToolCallContext,\n\t\tsignal?: AbortSignal,\n\t) => Promise<BeforeToolCallResult | undefined>;\n\tpublic afterToolCall?: (\n\t\tcontext: AfterToolCallContext,\n\t\tsignal?: AbortSignal,\n\t) => Promise<AfterToolCallResult | undefined>;\n\tpublic prepareNextTurn?: (\n\t\tsignal?: AbortSignal,\n\t) => Promise<AgentLoopTurnUpdate | undefined> | AgentLoopTurnUpdate | undefined;\n\tprivate activeRun?: ActiveRun;\n\t/** Session identifier forwarded to providers for cache-aware backends. */\n\tpublic sessionId?: string;\n\t/** Optional per-level thinking token budgets forwarded to the stream function. */\n\tpublic thinkingBudgets?: ThinkingBudgets;\n\t/** Preferred transport forwarded to the stream function. */\n\tpublic transport: Transport;\n\tpublic timeoutMs?: number;\n\t/** Optional cap for provider-requested retry delays. */\n\tpublic maxRetryDelayMs?: number;\n\t/** Tool execution strategy for assistant messages that contain multiple tool calls. */\n\tpublic toolExecution: ToolExecutionMode;\n\n\tconstructor(options: AgentOptions = {}) {\n\t\tthis._state = createMutableAgentState(options.initialState);\n\t\tthis.convertToLlm = options.convertToLlm ?? defaultConvertToLlm;\n\t\tthis.transformContext = options.transformContext;\n\t\tthis.streamFn = options.streamFn ?? streamSimple;\n\t\tthis.getApiKey = options.getApiKey;\n\t\tthis.onPayload = options.onPayload;\n\t\tthis.onResponse = options.onResponse;\n\t\tthis.beforeToolCall = options.beforeToolCall;\n\t\tthis.afterToolCall = options.afterToolCall;\n\t\tthis.prepareNextTurn = options.prepareNextTurn;\n\t\tthis.steeringQueue = new PendingMessageQueue(options.steeringMode ?? \"one-at-a-time\");\n\t\tthis.followUpQueue = new PendingMessageQueue(options.followUpMode ?? \"one-at-a-time\");\n\t\tthis.sessionId = options.sessionId;\n\t\tthis.thinkingBudgets = options.thinkingBudgets;\n\t\tthis.transport = options.transport ?? \"auto\";\n\t\tthis.timeoutMs = options.timeoutMs;\n\t\tthis.maxRetryDelayMs = options.maxRetryDelayMs;\n\t\tthis.toolExecution = options.toolExecution ?? \"parallel\";\n\t}\n\n\t/**\n\t * Subscribe to agent lifecycle events.\n\t *\n\t * Listener promises are awaited in subscription order and are included in\n\t * the current run's settlement. Listeners also receive the active abort\n\t * signal for the current run.\n\t *\n\t * `agent_end` is the final emitted event for a run, but the agent does not\n\t * become idle until all awaited listeners for that event have settled.\n\t */\n\tsubscribe(listener: (event: AgentEvent, signal: AbortSignal) => Promise<void> | void): () => void {\n\t\tthis.listeners.add(listener);\n\t\treturn () => this.listeners.delete(listener);\n\t}\n\n\t/**\n\t * Current agent state.\n\t *\n\t * Assigning `state.tools` or `state.messages` copies the provided top-level array.\n\t */\n\tget state(): AgentState {\n\t\treturn this._state;\n\t}\n\n\t/** Controls how queued steering messages are drained. */\n\tset steeringMode(mode: QueueMode) {\n\t\tthis.steeringQueue.mode = mode;\n\t}\n\n\tget steeringMode(): QueueMode {\n\t\treturn this.steeringQueue.mode;\n\t}\n\n\t/** Controls how queued follow-up messages are drained. */\n\tset followUpMode(mode: QueueMode) {\n\t\tthis.followUpQueue.mode = mode;\n\t}\n\n\tget followUpMode(): QueueMode {\n\t\treturn this.followUpQueue.mode;\n\t}\n\n\t/** Queue a message to be injected after the current assistant turn finishes. */\n\tsteer(message: AgentMessage): void {\n\t\tthis.steeringQueue.enqueue(message);\n\t}\n\n\t/** Queue a message to run only after the agent would otherwise stop. */\n\tfollowUp(message: AgentMessage): void {\n\t\tthis.followUpQueue.enqueue(message);\n\t}\n\n\t/** Remove all queued steering messages. */\n\tclearSteeringQueue(): void {\n\t\tthis.steeringQueue.clear();\n\t}\n\n\t/** Remove all queued follow-up messages. */\n\tclearFollowUpQueue(): void {\n\t\tthis.followUpQueue.clear();\n\t}\n\n\t/** Remove all queued steering and follow-up messages. */\n\tclearAllQueues(): void {\n\t\tthis.clearSteeringQueue();\n\t\tthis.clearFollowUpQueue();\n\t}\n\n\t/** Returns true when either queue still contains pending messages. */\n\thasQueuedMessages(): boolean {\n\t\treturn this.steeringQueue.hasItems() || this.followUpQueue.hasItems();\n\t}\n\n\t/** Active abort signal for the current run, if any. */\n\tget signal(): AbortSignal | undefined {\n\t\treturn this.activeRun?.abortController.signal;\n\t}\n\n\t/** Abort the current run, if one is active. */\n\tabort(): void {\n\t\tthis.activeRun?.abortController.abort();\n\t}\n\n\t/**\n\t * Resolve when the current run and all awaited event listeners have finished.\n\t *\n\t * This resolves after `agent_end` listeners settle.\n\t */\n\twaitForIdle(): Promise<void> {\n\t\treturn this.activeRun?.promise ?? Promise.resolve();\n\t}\n\n\t/** Clear transcript state, runtime state, and queued messages. */\n\treset(): void {\n\t\tthis._state.messages = [];\n\t\tthis._state.isStreaming = false;\n\t\tthis._state.streamingMessage = undefined;\n\t\tthis._state.pendingToolCalls = new Set<string>();\n\t\tthis._state.errorMessage = undefined;\n\t\tthis.clearFollowUpQueue();\n\t\tthis.clearSteeringQueue();\n\t}\n\n\t/** Start a new prompt from text, a single message, or a batch of messages. */\n\tasync prompt(message: AgentMessage | AgentMessage[]): Promise<void>;\n\tasync prompt(input: string, images?: ImageContent[]): Promise<void>;\n\tasync prompt(input: string | AgentMessage | AgentMessage[], images?: ImageContent[]): Promise<void> {\n\t\tif (this.activeRun) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Agent is already processing a prompt. Use steer() or followUp() to queue messages, or wait for completion.\",\n\t\t\t);\n\t\t}\n\t\tconst messages = this.normalizePromptInput(input, images);\n\t\tawait this.runPromptMessages(messages);\n\t}\n\n\t/** Continue from the current transcript. The last message must be a user or tool-result message. */\n\tasync continue(): Promise<void> {\n\t\tif (this.activeRun) {\n\t\t\tthrow new Error(\"Agent is already processing. Wait for completion before continuing.\");\n\t\t}\n\n\t\tconst lastMessage = this._state.messages[this._state.messages.length - 1];\n\t\tif (!lastMessage) {\n\t\t\tthrow new Error(\"No messages to continue from\");\n\t\t}\n\n\t\tif (lastMessage.role === \"assistant\") {\n\t\t\tconst queuedSteering = this.steeringQueue.drain();\n\t\t\tif (queuedSteering.length > 0) {\n\t\t\t\tawait this.runPromptMessages(queuedSteering, { skipInitialSteeringPoll: true });\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst queuedFollowUps = this.followUpQueue.drain();\n\t\t\tif (queuedFollowUps.length > 0) {\n\t\t\t\tawait this.runPromptMessages(queuedFollowUps);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthrow new Error(\"Cannot continue from message role: assistant\");\n\t\t}\n\n\t\tawait this.runContinuation();\n\t}\n\n\tprivate normalizePromptInput(\n\t\tinput: string | AgentMessage | AgentMessage[],\n\t\timages?: ImageContent[],\n\t): AgentMessage[] {\n\t\tif (Array.isArray(input)) {\n\t\t\treturn input;\n\t\t}\n\n\t\tif (typeof input !== \"string\") {\n\t\t\treturn [input];\n\t\t}\n\n\t\tconst content: Array<TextContent | ImageContent> = [{ type: \"text\", text: input }];\n\t\tif (images && images.length > 0) {\n\t\t\tcontent.push(...images);\n\t\t}\n\t\treturn [{ role: \"user\", content, timestamp: Date.now() }];\n\t}\n\n\tprivate async runPromptMessages(\n\t\tmessages: AgentMessage[],\n\t\toptions: { skipInitialSteeringPoll?: boolean } = {},\n\t): Promise<void> {\n\t\tawait this.runWithLifecycle(async (signal) => {\n\t\t\tawait runAgentLoop(\n\t\t\t\tmessages,\n\t\t\t\tthis.createContextSnapshot(),\n\t\t\t\tthis.createLoopConfig(options),\n\t\t\t\t(event) => this.processEvents(event),\n\t\t\t\tsignal,\n\t\t\t\tthis.streamFn,\n\t\t\t);\n\t\t});\n\t}\n\n\tprivate async runContinuation(): Promise<void> {\n\t\tawait this.runWithLifecycle(async (signal) => {\n\t\t\tawait runAgentLoopContinue(\n\t\t\t\tthis.createContextSnapshot(),\n\t\t\t\tthis.createLoopConfig(),\n\t\t\t\t(event) => this.processEvents(event),\n\t\t\t\tsignal,\n\t\t\t\tthis.streamFn,\n\t\t\t);\n\t\t});\n\t}\n\n\tprivate createContextSnapshot(): AgentContext {\n\t\treturn {\n\t\t\tsystemPrompt: this._state.systemPrompt,\n\t\t\tmessages: this._state.messages.slice(),\n\t\t\ttools: this._state.tools.slice(),\n\t\t};\n\t}\n\n\tprivate createLoopConfig(options: { skipInitialSteeringPoll?: boolean } = {}): AgentLoopConfig {\n\t\tlet skipInitialSteeringPoll = options.skipInitialSteeringPoll === true;\n\t\treturn {\n\t\t\tmodel: this._state.model,\n\t\t\treasoning: this._state.thinkingLevel === \"off\" ? undefined : this._state.thinkingLevel,\n\t\t\tsessionId: this.sessionId,\n\t\t\tonPayload: this.onPayload,\n\t\t\tonResponse: this.onResponse,\n\t\t\ttransport: this.transport,\n\t\t\tthinkingBudgets: this.thinkingBudgets,\n\t\t\ttimeoutMs: this.timeoutMs,\n\t\t\tmaxRetryDelayMs: this.maxRetryDelayMs,\n\t\t\ttoolExecution: this.toolExecution,\n\t\t\tbeforeToolCall: this.beforeToolCall,\n\t\t\tafterToolCall: this.afterToolCall,\n\t\t\tprepareNextTurn: this.prepareNextTurn ? async () => await this.prepareNextTurn?.(this.signal) : undefined,\n\t\t\tconvertToLlm: this.convertToLlm,\n\t\t\ttransformContext: this.transformContext,\n\t\t\tgetApiKey: this.getApiKey,\n\t\t\tgetSteeringMessages: async () => {\n\t\t\t\tif (skipInitialSteeringPoll) {\n\t\t\t\t\tskipInitialSteeringPoll = false;\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\treturn this.steeringQueue.drain();\n\t\t\t},\n\t\t\tgetFollowUpMessages: async () => this.followUpQueue.drain(),\n\t\t};\n\t}\n\n\tprivate async runWithLifecycle(executor: (signal: AbortSignal) => Promise<void>): Promise<void> {\n\t\tif (this.activeRun) {\n\t\t\tthrow new Error(\"Agent is already processing.\");\n\t\t}\n\n\t\tconst abortController = new AbortController();\n\t\tlet resolvePromise = () => {};\n\t\tconst promise = new Promise<void>((resolve) => {\n\t\t\tresolvePromise = resolve;\n\t\t});\n\t\tthis.activeRun = { promise, resolve: resolvePromise, abortController };\n\n\t\tthis._state.isStreaming = true;\n\t\tthis._state.streamingMessage = undefined;\n\t\tthis._state.errorMessage = undefined;\n\n\t\ttry {\n\t\t\tawait executor(abortController.signal);\n\t\t} catch (error) {\n\t\t\tawait this.handleRunFailure(error, abortController.signal.aborted);\n\t\t} finally {\n\t\t\tthis.finishRun();\n\t\t}\n\t}\n\n\tprivate async handleRunFailure(error: unknown, aborted: boolean): Promise<void> {\n\t\tconst failureMessage = {\n\t\t\trole: \"assistant\",\n\t\t\tcontent: [{ type: \"text\", text: \"\" }],\n\t\t\tapi: this._state.model.api,\n\t\t\tprovider: this._state.model.provider,\n\t\t\tmodel: this._state.model.id,\n\t\t\tusage: EMPTY_USAGE,\n\t\t\tstopReason: aborted ? \"aborted\" : \"error\",\n\t\t\terrorMessage: error instanceof Error ? error.message : String(error),\n\t\t\ttimestamp: Date.now(),\n\t\t} satisfies AgentMessage;\n\t\tawait this.processEvents({ type: \"message_start\", message: failureMessage });\n\t\tawait this.processEvents({ type: \"message_end\", message: failureMessage });\n\t\tawait this.processEvents({ type: \"turn_end\", message: failureMessage, toolResults: [] });\n\t\tawait this.processEvents({ type: \"agent_end\", messages: [failureMessage] });\n\t}\n\n\tprivate finishRun(): void {\n\t\tthis._state.isStreaming = false;\n\t\tthis._state.streamingMessage = undefined;\n\t\tthis._state.pendingToolCalls = new Set<string>();\n\t\tthis.activeRun?.resolve();\n\t\tthis.activeRun = undefined;\n\t}\n\n\t/**\n\t * Reduce internal state for a loop event, then await listeners.\n\t *\n\t * `agent_end` only means no further loop events will be emitted. The run is\n\t * considered idle later, after all awaited listeners for `agent_end` finish\n\t * and `finishRun()` clears runtime-owned state.\n\t */\n\tprivate async processEvents(event: AgentEvent): Promise<void> {\n\t\tswitch (event.type) {\n\t\t\tcase \"message_start\":\n\t\t\t\tthis._state.streamingMessage = event.message;\n\t\t\t\tbreak;\n\n\t\t\tcase \"message_update\":\n\t\t\t\tthis._state.streamingMessage = event.message;\n\t\t\t\tbreak;\n\n\t\t\tcase \"message_end\":\n\t\t\t\tthis._state.streamingMessage = undefined;\n\t\t\t\tthis._state.messages.push(event.message);\n\t\t\t\tbreak;\n\n\t\t\tcase \"tool_execution_start\": {\n\t\t\t\tconst pendingToolCalls = new Set(this._state.pendingToolCalls);\n\t\t\t\tpendingToolCalls.add(event.toolCallId);\n\t\t\t\tthis._state.pendingToolCalls = pendingToolCalls;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase \"tool_execution_end\": {\n\t\t\t\tconst pendingToolCalls = new Set(this._state.pendingToolCalls);\n\t\t\t\tpendingToolCalls.delete(event.toolCallId);\n\t\t\t\tthis._state.pendingToolCalls = pendingToolCalls;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase \"turn_end\":\n\t\t\t\tif (event.message.role === \"assistant\" && event.message.errorMessage) {\n\t\t\t\t\tthis._state.errorMessage = event.message.errorMessage;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"agent_end\":\n\t\t\t\tthis._state.streamingMessage = undefined;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tconst signal = this.activeRun?.abortController.signal;\n\t\tif (!signal) {\n\t\t\tthrow new Error(\"Agent listener invoked outside active run\");\n\t\t}\n\t\tfor (const listener of this.listeners) {\n\t\t\tawait listener(event, signal);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { type AssistantMessage, type ImageContent, type Model } from "@earendil-works/pi-ai";
|
|
2
|
+
import type { AgentMessage, AgentTool, QueueMode, ThinkingLevel } from "../types.ts";
|
|
3
|
+
import type { AbortResult, AgentHarnessEvent, AgentHarnessEventResultMap, AgentHarnessOptions, AgentHarnessOwnEvent, AgentHarnessResources, AgentHarnessStreamOptions, ExecutionEnv, NavigateTreeResult, PromptTemplate, Skill } from "./types.ts";
|
|
4
|
+
export declare class AgentHarness<TSkill extends Skill = Skill, TPromptTemplate extends PromptTemplate = PromptTemplate, TTool extends AgentTool = AgentTool> {
|
|
5
|
+
readonly env: ExecutionEnv;
|
|
6
|
+
private session;
|
|
7
|
+
private phase;
|
|
8
|
+
private runAbortController?;
|
|
9
|
+
private runPromise?;
|
|
10
|
+
private pendingSessionWrites;
|
|
11
|
+
private model;
|
|
12
|
+
private thinkingLevel;
|
|
13
|
+
private systemPrompt;
|
|
14
|
+
private streamOptions;
|
|
15
|
+
private getApiKeyAndHeaders?;
|
|
16
|
+
private resources;
|
|
17
|
+
private tools;
|
|
18
|
+
private activeToolNames;
|
|
19
|
+
private steerQueue;
|
|
20
|
+
private steeringQueueMode;
|
|
21
|
+
private followUpQueue;
|
|
22
|
+
private followUpQueueMode;
|
|
23
|
+
private nextTurnQueue;
|
|
24
|
+
private handlers;
|
|
25
|
+
constructor(options: AgentHarnessOptions<TSkill, TPromptTemplate, TTool>);
|
|
26
|
+
private getHandlers;
|
|
27
|
+
private emitOwn;
|
|
28
|
+
private emitAny;
|
|
29
|
+
private emitHook;
|
|
30
|
+
private emitBeforeProviderRequest;
|
|
31
|
+
private emitBeforeProviderPayload;
|
|
32
|
+
private emitQueueUpdate;
|
|
33
|
+
private startRunPromise;
|
|
34
|
+
private createTurnState;
|
|
35
|
+
private createContext;
|
|
36
|
+
private createStreamFn;
|
|
37
|
+
private drainQueuedMessages;
|
|
38
|
+
private createLoopConfig;
|
|
39
|
+
private validateToolNames;
|
|
40
|
+
private flushPendingSessionWrites;
|
|
41
|
+
private handleAgentEvent;
|
|
42
|
+
private emitRunFailure;
|
|
43
|
+
private executeTurn;
|
|
44
|
+
prompt(text: string, options?: {
|
|
45
|
+
images?: ImageContent[];
|
|
46
|
+
}): Promise<AssistantMessage>;
|
|
47
|
+
skill(name: string, additionalInstructions?: string): Promise<AssistantMessage>;
|
|
48
|
+
promptFromTemplate(name: string, args?: string[]): Promise<AssistantMessage>;
|
|
49
|
+
steer(text: string, options?: {
|
|
50
|
+
images?: ImageContent[];
|
|
51
|
+
}): Promise<void>;
|
|
52
|
+
followUp(text: string, options?: {
|
|
53
|
+
images?: ImageContent[];
|
|
54
|
+
}): Promise<void>;
|
|
55
|
+
nextTurn(text: string, options?: {
|
|
56
|
+
images?: ImageContent[];
|
|
57
|
+
}): Promise<void>;
|
|
58
|
+
appendMessage(message: AgentMessage): Promise<void>;
|
|
59
|
+
compact(customInstructions?: string): Promise<{
|
|
60
|
+
summary: string;
|
|
61
|
+
firstKeptEntryId: string;
|
|
62
|
+
tokensBefore: number;
|
|
63
|
+
details?: unknown;
|
|
64
|
+
}>;
|
|
65
|
+
navigateTree(targetId: string, options?: {
|
|
66
|
+
summarize?: boolean;
|
|
67
|
+
customInstructions?: string;
|
|
68
|
+
replaceInstructions?: boolean;
|
|
69
|
+
label?: string;
|
|
70
|
+
}): Promise<NavigateTreeResult>;
|
|
71
|
+
getModel(): Model<any>;
|
|
72
|
+
getThinkingLevel(): ThinkingLevel;
|
|
73
|
+
setModel(model: Model<any>): Promise<void>;
|
|
74
|
+
setThinkingLevel(level: ThinkingLevel): Promise<void>;
|
|
75
|
+
setActiveTools(toolNames: string[]): Promise<void>;
|
|
76
|
+
getSteeringMode(): QueueMode;
|
|
77
|
+
setSteeringMode(mode: QueueMode): Promise<void>;
|
|
78
|
+
getFollowUpMode(): QueueMode;
|
|
79
|
+
setFollowUpMode(mode: QueueMode): Promise<void>;
|
|
80
|
+
getResources(): AgentHarnessResources<TSkill, TPromptTemplate>;
|
|
81
|
+
setResources(resources: AgentHarnessResources<TSkill, TPromptTemplate>): Promise<void>;
|
|
82
|
+
getStreamOptions(): AgentHarnessStreamOptions;
|
|
83
|
+
setStreamOptions(streamOptions: AgentHarnessStreamOptions): Promise<void>;
|
|
84
|
+
setTools(tools: TTool[], activeToolNames?: string[]): Promise<void>;
|
|
85
|
+
abort(): Promise<AbortResult>;
|
|
86
|
+
waitForIdle(): Promise<void>;
|
|
87
|
+
subscribe(listener: (event: AgentHarnessEvent<TSkill, TPromptTemplate>, signal?: AbortSignal) => Promise<void> | void): () => void;
|
|
88
|
+
on<TType extends keyof AgentHarnessEventResultMap>(type: TType, handler: (event: Extract<AgentHarnessOwnEvent, {
|
|
89
|
+
type: TType;
|
|
90
|
+
}>) => Promise<AgentHarnessEventResultMap[TType]> | AgentHarnessEventResultMap[TType]): () => void;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=agent-harness.d.ts.map
|