@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,935 @@
|
|
|
1
|
+
import { validateToolArguments } from "../../utils/validation.js";
|
|
2
|
+
import { findEarliestXmlToolTag, findSelfClosingToolTag, getSafeXmlTextLength } from "./xml-tool-tag-scanner.js";
|
|
3
|
+
const INDENT = " ";
|
|
4
|
+
/**
|
|
5
|
+
* Formats tools as an XML-style system prompt for MorphXml protocol.
|
|
6
|
+
* Ported from ai-sdk-tool-call-middleware morph-xml-prompt.ts
|
|
7
|
+
*/
|
|
8
|
+
export function morphXmlFormatToolsSystemPrompt(tools) {
|
|
9
|
+
const toolsText = renderToolsForXmlPrompt(tools);
|
|
10
|
+
const header = `# Tools
|
|
11
|
+
You may call one or more functions to assist with the user query.`;
|
|
12
|
+
const definitions = ["You have access to the following functions:", "<tools>", toolsText, "</tools>"].join("\n");
|
|
13
|
+
const rules = `<rules>
|
|
14
|
+
- Use exactly one XML element whose tag name is the function name.
|
|
15
|
+
- Put each parameter as a child element.
|
|
16
|
+
- Values must follow the schema exactly (numbers, arrays, objects, enums -> copy as-is).
|
|
17
|
+
- For array parameters, wrap each element in an <item> tag inside the parameter tag.
|
|
18
|
+
- For array<object> parameters, every <item> must contain the object's fields as child tags.
|
|
19
|
+
- Never repeat the array parameter tag to represent multiple entries.
|
|
20
|
+
- Do not add or remove functions or parameters.
|
|
21
|
+
- Each required parameter must appear once.
|
|
22
|
+
- Output nothing before or after the function call.
|
|
23
|
+
- It is also possible to call multiple types of functions in one turn or to call a single function multiple times.
|
|
24
|
+
</rules>`;
|
|
25
|
+
const examples = `For each function call, output the function name and parameter in the following format:
|
|
26
|
+
<example_function_name>
|
|
27
|
+
<example_parameter_1>value_1</example_parameter_1>
|
|
28
|
+
<example_parameter_2>This is the value for the second parameter
|
|
29
|
+
that can span
|
|
30
|
+
multiple lines</example_parameter_2>
|
|
31
|
+
</example_function_name>`;
|
|
32
|
+
const arrayExample = `Array example:
|
|
33
|
+
<example_array_tool>
|
|
34
|
+
<items>
|
|
35
|
+
<item>first</item>
|
|
36
|
+
<item>second</item>
|
|
37
|
+
</items>
|
|
38
|
+
</example_array_tool>
|
|
39
|
+
|
|
40
|
+
Array<object> example:
|
|
41
|
+
<example_todo_tool>
|
|
42
|
+
<todos>
|
|
43
|
+
<item>
|
|
44
|
+
<content>Inspect parser edge cases</content>
|
|
45
|
+
<status>in_progress</status>
|
|
46
|
+
<priority>high</priority>
|
|
47
|
+
</item>
|
|
48
|
+
<item>
|
|
49
|
+
<content>Add regression tests</content>
|
|
50
|
+
<status>pending</status>
|
|
51
|
+
<priority>medium</priority>
|
|
52
|
+
</item>
|
|
53
|
+
</todos>
|
|
54
|
+
</example_todo_tool>`;
|
|
55
|
+
return [header, definitions, rules, examples, arrayExample]
|
|
56
|
+
.filter((section) => section.trim().length > 0)
|
|
57
|
+
.join("\n\n");
|
|
58
|
+
}
|
|
59
|
+
function renderToolsForXmlPrompt(tools) {
|
|
60
|
+
if (!tools.length) {
|
|
61
|
+
return "none";
|
|
62
|
+
}
|
|
63
|
+
return tools.map(renderToolForXmlPrompt).join("\n\n");
|
|
64
|
+
}
|
|
65
|
+
function renderToolForXmlPrompt(tool) {
|
|
66
|
+
const lines = [`name: ${tool.name}`];
|
|
67
|
+
if (tool.description) {
|
|
68
|
+
lines.push(`description: ${tool.description}`);
|
|
69
|
+
}
|
|
70
|
+
lines.push("parameters:");
|
|
71
|
+
const normalizedSchema = normalizeSchema(tool.parameters);
|
|
72
|
+
lines.push(...renderParametersSummary(normalizedSchema, 1));
|
|
73
|
+
lines.push(`schema: ${stringifySchema(normalizedSchema)}`);
|
|
74
|
+
return lines.join("\n");
|
|
75
|
+
}
|
|
76
|
+
function normalizeSchema(schema) {
|
|
77
|
+
if (typeof schema === "string") {
|
|
78
|
+
try {
|
|
79
|
+
return JSON.parse(schema);
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return { type: "string", const: schema };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return schema;
|
|
86
|
+
}
|
|
87
|
+
function renderParametersSummary(schema, indentLevel) {
|
|
88
|
+
const indent = INDENT.repeat(indentLevel);
|
|
89
|
+
if (schema === undefined || schema === null) {
|
|
90
|
+
return [`${indent}(none)`];
|
|
91
|
+
}
|
|
92
|
+
if (schema === true) {
|
|
93
|
+
return [`${indent}(any)`];
|
|
94
|
+
}
|
|
95
|
+
if (schema === false) {
|
|
96
|
+
return [`${indent}(no valid parameters)`];
|
|
97
|
+
}
|
|
98
|
+
if (typeof schema !== "object") {
|
|
99
|
+
return [`${indent}- value (${String(schema)})`];
|
|
100
|
+
}
|
|
101
|
+
const schemaObj = schema;
|
|
102
|
+
const schemaType = schemaObj.type;
|
|
103
|
+
const schemaTypeArray = [];
|
|
104
|
+
if (Array.isArray(schemaType)) {
|
|
105
|
+
schemaTypeArray.push(...schemaType);
|
|
106
|
+
}
|
|
107
|
+
else if (typeof schemaType === "string") {
|
|
108
|
+
schemaTypeArray.push(schemaType);
|
|
109
|
+
}
|
|
110
|
+
const isObjectLike = schemaTypeArray.includes("object") || !!schemaObj.properties;
|
|
111
|
+
if (isObjectLike) {
|
|
112
|
+
const properties = (schemaObj.properties ?? {});
|
|
113
|
+
const requiredSet = new Set(Array.isArray(schemaObj.required) ? schemaObj.required : []);
|
|
114
|
+
const propertyNames = Object.keys(properties).sort();
|
|
115
|
+
if (propertyNames.length === 0) {
|
|
116
|
+
return [`${indent}(no named parameters)`];
|
|
117
|
+
}
|
|
118
|
+
const lines = [];
|
|
119
|
+
for (const propName of propertyNames) {
|
|
120
|
+
const propSchema = properties[propName];
|
|
121
|
+
lines.push(renderPropertySummaryLine({
|
|
122
|
+
indent,
|
|
123
|
+
propName,
|
|
124
|
+
propSchema,
|
|
125
|
+
required: requiredSet.has(propName),
|
|
126
|
+
}));
|
|
127
|
+
}
|
|
128
|
+
return lines.length ? lines : [`${indent}(no parameters)`];
|
|
129
|
+
}
|
|
130
|
+
return [`${indent}- value (${summarizeType(schemaObj)})`];
|
|
131
|
+
}
|
|
132
|
+
function renderPropertySummaryLine({ indent, propName, propSchema, required, }) {
|
|
133
|
+
const typeLabel = summarizeType(propSchema);
|
|
134
|
+
const requiredLabel = required ? "required" : "optional";
|
|
135
|
+
const extras = collectPropertyExtras(propSchema);
|
|
136
|
+
const extraText = extras.length ? ` - ${extras.join("; ")}` : "";
|
|
137
|
+
return `${indent}- ${propName} (${typeLabel}, ${requiredLabel})${extraText}`;
|
|
138
|
+
}
|
|
139
|
+
function collectPropertyExtras(propSchema) {
|
|
140
|
+
if (!propSchema || typeof propSchema !== "object") {
|
|
141
|
+
return [];
|
|
142
|
+
}
|
|
143
|
+
const extras = [];
|
|
144
|
+
const schema = propSchema;
|
|
145
|
+
if (schema.enum && Array.isArray(schema.enum)) {
|
|
146
|
+
extras.push(`enum: ${formatValue(schema.enum)}`);
|
|
147
|
+
}
|
|
148
|
+
if (schema.default !== undefined) {
|
|
149
|
+
extras.push(`default: ${formatValue(schema.default)}`);
|
|
150
|
+
}
|
|
151
|
+
if (typeof schema.description === "string") {
|
|
152
|
+
extras.push(schema.description);
|
|
153
|
+
}
|
|
154
|
+
return extras;
|
|
155
|
+
}
|
|
156
|
+
function summarizeType(schema) {
|
|
157
|
+
if (schema === undefined || schema === null) {
|
|
158
|
+
return "unknown";
|
|
159
|
+
}
|
|
160
|
+
if (schema === true) {
|
|
161
|
+
return "any";
|
|
162
|
+
}
|
|
163
|
+
if (schema === false) {
|
|
164
|
+
return "never";
|
|
165
|
+
}
|
|
166
|
+
if (typeof schema !== "object") {
|
|
167
|
+
return String(schema);
|
|
168
|
+
}
|
|
169
|
+
const schemaType = schema.type;
|
|
170
|
+
let baseType = "";
|
|
171
|
+
if (Array.isArray(schemaType) && schemaType.length) {
|
|
172
|
+
baseType = schemaType.join(" | ");
|
|
173
|
+
}
|
|
174
|
+
else if (typeof schemaType === "string") {
|
|
175
|
+
baseType = schemaType;
|
|
176
|
+
}
|
|
177
|
+
else if (schema.enum && Array.isArray(schema.enum)) {
|
|
178
|
+
const inferred = Array.from(new Set(schema.enum.map((value) => typeof value)));
|
|
179
|
+
if (inferred.length === 1 && inferred[0]) {
|
|
180
|
+
baseType = inferred[0];
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
else if (schema.const !== undefined) {
|
|
184
|
+
baseType = typeof schema.const;
|
|
185
|
+
}
|
|
186
|
+
if (!baseType) {
|
|
187
|
+
baseType = "any";
|
|
188
|
+
}
|
|
189
|
+
if (baseType === "array" && schema.items) {
|
|
190
|
+
const itemType = Array.isArray(schema.items)
|
|
191
|
+
? schema.items.map((item) => summarizeType(item)).join(" | ")
|
|
192
|
+
: summarizeType(schema.items);
|
|
193
|
+
return `array<${itemType}>`;
|
|
194
|
+
}
|
|
195
|
+
if (baseType === "string" && typeof schema.format === "string") {
|
|
196
|
+
return `string (${schema.format})`;
|
|
197
|
+
}
|
|
198
|
+
return baseType;
|
|
199
|
+
}
|
|
200
|
+
function formatValue(value) {
|
|
201
|
+
if (typeof value === "string") {
|
|
202
|
+
return JSON.stringify(value);
|
|
203
|
+
}
|
|
204
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
205
|
+
return String(value);
|
|
206
|
+
}
|
|
207
|
+
if (value === null) {
|
|
208
|
+
return "null";
|
|
209
|
+
}
|
|
210
|
+
if (Array.isArray(value)) {
|
|
211
|
+
return `[${value.map(formatValue).join(", ")}]`;
|
|
212
|
+
}
|
|
213
|
+
return JSON.stringify(value);
|
|
214
|
+
}
|
|
215
|
+
function stringifySchema(schema) {
|
|
216
|
+
if (schema === undefined) {
|
|
217
|
+
return "null";
|
|
218
|
+
}
|
|
219
|
+
return JSON.stringify(stripSchemaKeys(schema));
|
|
220
|
+
}
|
|
221
|
+
function stripSchemaKeys(value) {
|
|
222
|
+
if (Array.isArray(value)) {
|
|
223
|
+
return value.map((entry) => stripSchemaKeys(entry));
|
|
224
|
+
}
|
|
225
|
+
if (value && typeof value === "object") {
|
|
226
|
+
const record = value;
|
|
227
|
+
const cleaned = {};
|
|
228
|
+
for (const [key, entry] of Object.entries(record)) {
|
|
229
|
+
if (key === "$schema") {
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
cleaned[key] = stripSchemaKeys(entry);
|
|
233
|
+
}
|
|
234
|
+
return cleaned;
|
|
235
|
+
}
|
|
236
|
+
return value;
|
|
237
|
+
}
|
|
238
|
+
export function morphXmlFormatToolResponse(toolName, _toolCallId, content) {
|
|
239
|
+
const combinedText = content
|
|
240
|
+
.filter((c) => c.type === "text")
|
|
241
|
+
.map((c) => c.text)
|
|
242
|
+
.join("\n");
|
|
243
|
+
let resultValue = combinedText;
|
|
244
|
+
try {
|
|
245
|
+
resultValue = JSON.parse(combinedText);
|
|
246
|
+
}
|
|
247
|
+
catch { }
|
|
248
|
+
const resultLines = formatXmlNode("result", resultValue, 1);
|
|
249
|
+
return [
|
|
250
|
+
"<tool_response>",
|
|
251
|
+
` <tool_name>${escapeXml(toolName)}</tool_name>`,
|
|
252
|
+
...resultLines,
|
|
253
|
+
"</tool_response>",
|
|
254
|
+
].join("\n");
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Formats a tool call as XML for MorphXml protocol.
|
|
258
|
+
*/
|
|
259
|
+
export function morphXmlFormatToolCall(name, args) {
|
|
260
|
+
const lines = formatXmlNode(name, args, 0);
|
|
261
|
+
return lines.join("\n");
|
|
262
|
+
}
|
|
263
|
+
function shouldEmitRawToolCallTextOnError(options) {
|
|
264
|
+
return options?.emitRawToolCallTextOnError === true;
|
|
265
|
+
}
|
|
266
|
+
function getSchemaTypesFromValue(schema) {
|
|
267
|
+
if (!schema || typeof schema !== "object" || Array.isArray(schema)) {
|
|
268
|
+
return [];
|
|
269
|
+
}
|
|
270
|
+
const typeValue = schema.type;
|
|
271
|
+
if (typeof typeValue === "string") {
|
|
272
|
+
return [typeValue];
|
|
273
|
+
}
|
|
274
|
+
if (Array.isArray(typeValue)) {
|
|
275
|
+
return typeValue.filter((entry) => typeof entry === "string");
|
|
276
|
+
}
|
|
277
|
+
return [];
|
|
278
|
+
}
|
|
279
|
+
function isStructurallyCompatibleWithSchema(value, schema) {
|
|
280
|
+
if (schema === undefined || schema === true) {
|
|
281
|
+
return true;
|
|
282
|
+
}
|
|
283
|
+
if (schema === false) {
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
if (typeof schema !== "object" || Array.isArray(schema) || schema === null) {
|
|
287
|
+
return true;
|
|
288
|
+
}
|
|
289
|
+
const schemaTypes = getSchemaTypesFromValue(schema);
|
|
290
|
+
if (value === null) {
|
|
291
|
+
return schemaTypes.length === 0 || schemaTypes.includes("null");
|
|
292
|
+
}
|
|
293
|
+
if (Array.isArray(value)) {
|
|
294
|
+
if (schemaTypes.length > 0 && !schemaTypes.includes("array")) {
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
297
|
+
const itemSchema = getArrayItemSchema(schema);
|
|
298
|
+
return value.every((item) => isStructurallyCompatibleWithSchema(item, itemSchema));
|
|
299
|
+
}
|
|
300
|
+
if (typeof value === "object") {
|
|
301
|
+
if (schemaTypes.length > 0 && !schemaTypes.includes("object")) {
|
|
302
|
+
return false;
|
|
303
|
+
}
|
|
304
|
+
const record = value;
|
|
305
|
+
return Object.entries(record).every(([key, entryValue]) => isStructurallyCompatibleWithSchema(entryValue, getPropertySchema(schema, key)));
|
|
306
|
+
}
|
|
307
|
+
if (typeof value === "string") {
|
|
308
|
+
return schemaTypes.length === 0 || schemaTypes.includes("string");
|
|
309
|
+
}
|
|
310
|
+
if (typeof value === "number") {
|
|
311
|
+
return schemaTypes.length === 0 || schemaTypes.includes("number") || schemaTypes.includes("integer");
|
|
312
|
+
}
|
|
313
|
+
if (typeof value === "boolean") {
|
|
314
|
+
return schemaTypes.length === 0 || schemaTypes.includes("boolean");
|
|
315
|
+
}
|
|
316
|
+
return true;
|
|
317
|
+
}
|
|
318
|
+
function validateMorphXmlArguments(tool, argumentsRecord) {
|
|
319
|
+
if (!tool) {
|
|
320
|
+
return true;
|
|
321
|
+
}
|
|
322
|
+
try {
|
|
323
|
+
validateToolArguments(tool, {
|
|
324
|
+
type: "toolCall",
|
|
325
|
+
id: "morph-xml-validation",
|
|
326
|
+
name: tool.name,
|
|
327
|
+
arguments: argumentsRecord,
|
|
328
|
+
});
|
|
329
|
+
return true;
|
|
330
|
+
}
|
|
331
|
+
catch {
|
|
332
|
+
return false;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
function parseAndValidateMorphXmlArguments(tool, toolBody, schema) {
|
|
336
|
+
let parsedArguments;
|
|
337
|
+
try {
|
|
338
|
+
parsedArguments = parseMorphXmlArguments(toolBody, schema);
|
|
339
|
+
}
|
|
340
|
+
catch {
|
|
341
|
+
return null;
|
|
342
|
+
}
|
|
343
|
+
if (!isStructurallyCompatibleWithSchema(parsedArguments, schema)) {
|
|
344
|
+
return null;
|
|
345
|
+
}
|
|
346
|
+
if (!validateMorphXmlArguments(tool, parsedArguments)) {
|
|
347
|
+
return null;
|
|
348
|
+
}
|
|
349
|
+
return parsedArguments;
|
|
350
|
+
}
|
|
351
|
+
function parseMorphXmlPartialArgumentsSafely(toolBody, schema) {
|
|
352
|
+
try {
|
|
353
|
+
return parseMorphXmlPartialArguments(toolBody, schema);
|
|
354
|
+
}
|
|
355
|
+
catch {
|
|
356
|
+
return null;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
export function parseMorphXmlGeneratedText(text, tools, options) {
|
|
360
|
+
if (tools.length === 0 || text.length === 0) {
|
|
361
|
+
return [];
|
|
362
|
+
}
|
|
363
|
+
const toolSchemaMap = createToolSchemaMap(tools);
|
|
364
|
+
const toolMap = new Map(tools.map((tool) => [tool.name, tool]));
|
|
365
|
+
const parsedToolCalls = [];
|
|
366
|
+
for (const tool of tools) {
|
|
367
|
+
let selfClosingMatch = findSelfClosingToolTag(text, tool.name, 0);
|
|
368
|
+
while (selfClosingMatch) {
|
|
369
|
+
const parsedArguments = parseAndValidateMorphXmlArguments(tool, "", toolSchemaMap.get(tool.name));
|
|
370
|
+
if (!parsedArguments) {
|
|
371
|
+
options?.onError?.("Could not process XML tool call.", {
|
|
372
|
+
toolCall: selfClosingMatch.tag,
|
|
373
|
+
});
|
|
374
|
+
selfClosingMatch = findSelfClosingToolTag(text, tool.name, selfClosingMatch.index + selfClosingMatch.length);
|
|
375
|
+
continue;
|
|
376
|
+
}
|
|
377
|
+
parsedToolCalls.push({
|
|
378
|
+
name: tool.name,
|
|
379
|
+
arguments: parsedArguments,
|
|
380
|
+
});
|
|
381
|
+
selfClosingMatch = findSelfClosingToolTag(text, tool.name, selfClosingMatch.index + selfClosingMatch.length);
|
|
382
|
+
}
|
|
383
|
+
const toolCallPattern = new RegExp(`<\\s*${escapeRegExp(tool.name)}\\s*>([\\s\\S]*?)<\\/\\s*${escapeRegExp(tool.name)}\\s*>`, "g");
|
|
384
|
+
for (const match of text.matchAll(toolCallPattern)) {
|
|
385
|
+
const toolBody = match[1] ?? "";
|
|
386
|
+
const parsedArguments = parseAndValidateMorphXmlArguments(toolMap.get(tool.name), toolBody, toolSchemaMap.get(tool.name));
|
|
387
|
+
if (!parsedArguments) {
|
|
388
|
+
options?.onError?.("Could not process XML tool call.", {
|
|
389
|
+
toolCall: match[0],
|
|
390
|
+
});
|
|
391
|
+
continue;
|
|
392
|
+
}
|
|
393
|
+
parsedToolCalls.push({
|
|
394
|
+
name: tool.name,
|
|
395
|
+
arguments: parsedArguments,
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return parsedToolCalls;
|
|
400
|
+
}
|
|
401
|
+
export function createMorphXmlStreamParser(tools, options) {
|
|
402
|
+
const toolSchemaMap = createToolSchemaMap(tools);
|
|
403
|
+
const toolNames = tools.map((tool) => tool.name);
|
|
404
|
+
const toolMap = new Map(tools.map((tool) => [tool.name, tool]));
|
|
405
|
+
let buffer = "";
|
|
406
|
+
let nextToolCallIndex = 0;
|
|
407
|
+
let currentToolState = null;
|
|
408
|
+
function emitArgumentsSnapshot(events, toolState, argumentsRecord) {
|
|
409
|
+
if (!isStructurallyCompatibleWithSchema(argumentsRecord, toolState.schema)) {
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
const argumentsSnapshot = JSON.stringify(argumentsRecord);
|
|
413
|
+
if (argumentsSnapshot === toolState.lastArgumentsSnapshot || argumentsSnapshot === "{}") {
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
if (!toolState.started) {
|
|
417
|
+
events.push({
|
|
418
|
+
type: "toolcall_start",
|
|
419
|
+
index: toolState.index,
|
|
420
|
+
name: toolState.name,
|
|
421
|
+
id: toolState.id,
|
|
422
|
+
});
|
|
423
|
+
toolState.started = true;
|
|
424
|
+
}
|
|
425
|
+
toolState.lastArgumentsSnapshot = argumentsSnapshot;
|
|
426
|
+
events.push({
|
|
427
|
+
type: "toolcall_delta",
|
|
428
|
+
index: toolState.index,
|
|
429
|
+
argumentsDelta: argumentsSnapshot,
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
function processBuffer() {
|
|
433
|
+
const events = [];
|
|
434
|
+
while (buffer.length > 0) {
|
|
435
|
+
if (currentToolState) {
|
|
436
|
+
const closingTagPattern = new RegExp(`</\\s*${escapeRegExp(currentToolState.name)}\\s*>`);
|
|
437
|
+
const closingTagMatch = closingTagPattern.exec(buffer);
|
|
438
|
+
if (!closingTagMatch || closingTagMatch.index === undefined) {
|
|
439
|
+
const partialArguments = parseMorphXmlPartialArgumentsSafely(buffer, currentToolState.schema);
|
|
440
|
+
if (partialArguments) {
|
|
441
|
+
emitArgumentsSnapshot(events, currentToolState, partialArguments);
|
|
442
|
+
}
|
|
443
|
+
break;
|
|
444
|
+
}
|
|
445
|
+
const toolBody = buffer.slice(0, closingTagMatch.index);
|
|
446
|
+
const partialArguments = parseMorphXmlPartialArgumentsSafely(toolBody, currentToolState.schema);
|
|
447
|
+
if (partialArguments) {
|
|
448
|
+
emitArgumentsSnapshot(events, currentToolState, partialArguments);
|
|
449
|
+
}
|
|
450
|
+
const parsedArguments = parseAndValidateMorphXmlArguments(currentToolState.tool, toolBody, currentToolState.schema);
|
|
451
|
+
const originalCallText = `<${currentToolState.name}>${toolBody}${closingTagMatch[0]}`;
|
|
452
|
+
buffer = buffer.slice(closingTagMatch.index + closingTagMatch[0].length);
|
|
453
|
+
if (!parsedArguments) {
|
|
454
|
+
options?.onError?.("Could not process streaming XML tool call.", {
|
|
455
|
+
toolCall: originalCallText,
|
|
456
|
+
});
|
|
457
|
+
if (!currentToolState.started && shouldEmitRawToolCallTextOnError(options)) {
|
|
458
|
+
events.push({ type: "text", text: originalCallText });
|
|
459
|
+
}
|
|
460
|
+
currentToolState = null;
|
|
461
|
+
continue;
|
|
462
|
+
}
|
|
463
|
+
if (!currentToolState.started) {
|
|
464
|
+
events.push({
|
|
465
|
+
type: "toolcall_start",
|
|
466
|
+
index: currentToolState.index,
|
|
467
|
+
name: currentToolState.name,
|
|
468
|
+
id: currentToolState.id,
|
|
469
|
+
});
|
|
470
|
+
currentToolState.started = true;
|
|
471
|
+
emitArgumentsSnapshot(events, currentToolState, parsedArguments);
|
|
472
|
+
}
|
|
473
|
+
events.push({
|
|
474
|
+
type: "toolcall_end",
|
|
475
|
+
index: currentToolState.index,
|
|
476
|
+
name: currentToolState.name,
|
|
477
|
+
id: currentToolState.id,
|
|
478
|
+
arguments: parsedArguments,
|
|
479
|
+
});
|
|
480
|
+
currentToolState = null;
|
|
481
|
+
continue;
|
|
482
|
+
}
|
|
483
|
+
const openingTag = findEarliestXmlToolTag(buffer, toolNames);
|
|
484
|
+
if (!openingTag) {
|
|
485
|
+
const textLength = getSafeXmlTextLength(buffer, toolNames);
|
|
486
|
+
if (textLength === 0) {
|
|
487
|
+
break;
|
|
488
|
+
}
|
|
489
|
+
events.push({ type: "text", text: buffer.slice(0, textLength) });
|
|
490
|
+
buffer = buffer.slice(textLength);
|
|
491
|
+
continue;
|
|
492
|
+
}
|
|
493
|
+
if (openingTag.index > 0) {
|
|
494
|
+
events.push({ type: "text", text: buffer.slice(0, openingTag.index) });
|
|
495
|
+
}
|
|
496
|
+
buffer = buffer.slice(openingTag.index + openingTag.tag.length);
|
|
497
|
+
if (openingTag.selfClosing) {
|
|
498
|
+
const tool = toolMap.get(openingTag.name);
|
|
499
|
+
const schema = toolSchemaMap.get(openingTag.name);
|
|
500
|
+
const parsedArguments = parseAndValidateMorphXmlArguments(tool, "", schema);
|
|
501
|
+
if (!parsedArguments) {
|
|
502
|
+
options?.onError?.("Could not process XML tool call.", {
|
|
503
|
+
toolCall: openingTag.tag,
|
|
504
|
+
});
|
|
505
|
+
if (shouldEmitRawToolCallTextOnError(options)) {
|
|
506
|
+
events.push({ type: "text", text: openingTag.tag });
|
|
507
|
+
}
|
|
508
|
+
continue;
|
|
509
|
+
}
|
|
510
|
+
const id = globalThis.crypto.randomUUID();
|
|
511
|
+
const index = nextToolCallIndex;
|
|
512
|
+
nextToolCallIndex += 1;
|
|
513
|
+
events.push({
|
|
514
|
+
type: "toolcall_start",
|
|
515
|
+
index,
|
|
516
|
+
name: openingTag.name,
|
|
517
|
+
id,
|
|
518
|
+
});
|
|
519
|
+
events.push({
|
|
520
|
+
type: "toolcall_end",
|
|
521
|
+
index,
|
|
522
|
+
name: openingTag.name,
|
|
523
|
+
id,
|
|
524
|
+
arguments: parsedArguments,
|
|
525
|
+
});
|
|
526
|
+
continue;
|
|
527
|
+
}
|
|
528
|
+
currentToolState = {
|
|
529
|
+
id: globalThis.crypto.randomUUID(),
|
|
530
|
+
index: nextToolCallIndex,
|
|
531
|
+
lastArgumentsSnapshot: null,
|
|
532
|
+
name: openingTag.name,
|
|
533
|
+
schema: toolSchemaMap.get(openingTag.name),
|
|
534
|
+
started: false,
|
|
535
|
+
tool: toolMap.get(openingTag.name),
|
|
536
|
+
};
|
|
537
|
+
nextToolCallIndex += 1;
|
|
538
|
+
}
|
|
539
|
+
return events;
|
|
540
|
+
}
|
|
541
|
+
return {
|
|
542
|
+
feed(textDelta) {
|
|
543
|
+
if (textDelta.length === 0) {
|
|
544
|
+
return [];
|
|
545
|
+
}
|
|
546
|
+
buffer += textDelta;
|
|
547
|
+
return processBuffer();
|
|
548
|
+
},
|
|
549
|
+
finish() {
|
|
550
|
+
const events = processBuffer();
|
|
551
|
+
if (!currentToolState && buffer.length > 0) {
|
|
552
|
+
events.push({ type: "text", text: buffer });
|
|
553
|
+
buffer = "";
|
|
554
|
+
}
|
|
555
|
+
if (currentToolState) {
|
|
556
|
+
const parsedArguments = parseAndValidateMorphXmlArguments(currentToolState.tool, buffer, currentToolState.schema);
|
|
557
|
+
if (parsedArguments) {
|
|
558
|
+
if (!currentToolState.started) {
|
|
559
|
+
events.push({
|
|
560
|
+
type: "toolcall_start",
|
|
561
|
+
index: currentToolState.index,
|
|
562
|
+
name: currentToolState.name,
|
|
563
|
+
id: currentToolState.id,
|
|
564
|
+
});
|
|
565
|
+
currentToolState.started = true;
|
|
566
|
+
}
|
|
567
|
+
if (currentToolState.lastArgumentsSnapshot !== JSON.stringify(parsedArguments)) {
|
|
568
|
+
emitArgumentsSnapshot(events, currentToolState, parsedArguments);
|
|
569
|
+
}
|
|
570
|
+
events.push({
|
|
571
|
+
type: "toolcall_end",
|
|
572
|
+
index: currentToolState.index,
|
|
573
|
+
name: currentToolState.name,
|
|
574
|
+
id: currentToolState.id,
|
|
575
|
+
arguments: parsedArguments,
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
else if (currentToolState.lastArgumentsSnapshot) {
|
|
579
|
+
const recoveredArguments = JSON.parse(currentToolState.lastArgumentsSnapshot);
|
|
580
|
+
if (!currentToolState.started) {
|
|
581
|
+
events.push({
|
|
582
|
+
type: "toolcall_start",
|
|
583
|
+
index: currentToolState.index,
|
|
584
|
+
name: currentToolState.name,
|
|
585
|
+
id: currentToolState.id,
|
|
586
|
+
});
|
|
587
|
+
currentToolState.started = true;
|
|
588
|
+
}
|
|
589
|
+
events.push({
|
|
590
|
+
type: "toolcall_end",
|
|
591
|
+
index: currentToolState.index,
|
|
592
|
+
name: currentToolState.name,
|
|
593
|
+
id: currentToolState.id,
|
|
594
|
+
arguments: recoveredArguments,
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
else {
|
|
598
|
+
const rawToolCall = `<${currentToolState.name}>${buffer}`;
|
|
599
|
+
options?.onError?.("Could not complete streaming XML tool call at finish.", {
|
|
600
|
+
toolCall: rawToolCall,
|
|
601
|
+
});
|
|
602
|
+
if (shouldEmitRawToolCallTextOnError(options)) {
|
|
603
|
+
events.push({ type: "text", text: rawToolCall });
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
buffer = "";
|
|
607
|
+
currentToolState = null;
|
|
608
|
+
}
|
|
609
|
+
return events;
|
|
610
|
+
},
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
function formatXmlNode(tagName, value, depth) {
|
|
614
|
+
const indent = INDENT.repeat(depth);
|
|
615
|
+
if (value === null || value === undefined) {
|
|
616
|
+
return [`${indent}<${tagName}></${tagName}>`];
|
|
617
|
+
}
|
|
618
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
619
|
+
const escapedValue = typeof value === "string" ? escapeXml(value) : String(value);
|
|
620
|
+
return [`${indent}<${tagName}>${escapedValue}</${tagName}>`];
|
|
621
|
+
}
|
|
622
|
+
if (Array.isArray(value)) {
|
|
623
|
+
if (value.length === 0) {
|
|
624
|
+
return [`${indent}<${tagName}></${tagName}>`];
|
|
625
|
+
}
|
|
626
|
+
const lines = [`${indent}<${tagName}>`];
|
|
627
|
+
for (const item of value) {
|
|
628
|
+
lines.push(...formatXmlNode("item", item, depth + 1));
|
|
629
|
+
}
|
|
630
|
+
lines.push(`${indent}</${tagName}>`);
|
|
631
|
+
return lines;
|
|
632
|
+
}
|
|
633
|
+
const entries = Object.entries(value);
|
|
634
|
+
if (entries.length === 0) {
|
|
635
|
+
return [`${indent}<${tagName}></${tagName}>`];
|
|
636
|
+
}
|
|
637
|
+
const lines = [`${indent}<${tagName}>`];
|
|
638
|
+
for (const [key, entryValue] of entries) {
|
|
639
|
+
lines.push(...formatXmlNode(key, entryValue, depth + 1));
|
|
640
|
+
}
|
|
641
|
+
lines.push(`${indent}</${tagName}>`);
|
|
642
|
+
return lines;
|
|
643
|
+
}
|
|
644
|
+
function createToolSchemaMap(tools) {
|
|
645
|
+
return new Map(tools.map((tool) => [tool.name, normalizeSchema(tool.parameters)]));
|
|
646
|
+
}
|
|
647
|
+
function parseMorphXmlArguments(toolBody, schema) {
|
|
648
|
+
const parsedRoot = parseXmlRoot(`<root>${toolBody}</root>`);
|
|
649
|
+
if (!parsedRoot) {
|
|
650
|
+
return {};
|
|
651
|
+
}
|
|
652
|
+
return convertChildrenToObject(parsedRoot.children, schema);
|
|
653
|
+
}
|
|
654
|
+
function parseMorphXmlPartialArguments(toolBody, schema) {
|
|
655
|
+
const partialArguments = {};
|
|
656
|
+
const normalizedSchema = normalizeSchema(schema);
|
|
657
|
+
let position = 0;
|
|
658
|
+
while (position < toolBody.length) {
|
|
659
|
+
const nextTagIndex = toolBody.indexOf("<", position);
|
|
660
|
+
if (nextTagIndex === -1) {
|
|
661
|
+
break;
|
|
662
|
+
}
|
|
663
|
+
if (toolBody.slice(position, nextTagIndex).trim().length > 0) {
|
|
664
|
+
break;
|
|
665
|
+
}
|
|
666
|
+
const openingTag = parseOpeningTag(toolBody, nextTagIndex);
|
|
667
|
+
if (!openingTag) {
|
|
668
|
+
break;
|
|
669
|
+
}
|
|
670
|
+
const propertySchema = getPropertySchema(normalizedSchema, openingTag.name);
|
|
671
|
+
const closingTag = `</${openingTag.name}>`;
|
|
672
|
+
const closingTagIndex = toolBody.indexOf(closingTag, openingTag.endIndex);
|
|
673
|
+
if (closingTagIndex === -1) {
|
|
674
|
+
const partialValueText = toolBody.slice(openingTag.endIndex);
|
|
675
|
+
if (partialValueText.includes("<")) {
|
|
676
|
+
break;
|
|
677
|
+
}
|
|
678
|
+
partialArguments[openingTag.name] = coercePartialXmlValue(partialValueText, propertySchema);
|
|
679
|
+
break;
|
|
680
|
+
}
|
|
681
|
+
const completeNode = parseXmlRoot(toolBody.slice(nextTagIndex, closingTagIndex + closingTag.length));
|
|
682
|
+
if (!completeNode) {
|
|
683
|
+
break;
|
|
684
|
+
}
|
|
685
|
+
partialArguments[openingTag.name] = convertXmlNodeValue(completeNode, propertySchema);
|
|
686
|
+
position = closingTagIndex + closingTag.length;
|
|
687
|
+
}
|
|
688
|
+
return partialArguments;
|
|
689
|
+
}
|
|
690
|
+
function parseXmlRoot(xml) {
|
|
691
|
+
const tagPattern = /<\s*(\/)?\s*([A-Za-z_][\w.-]*)\s*(\/)?\s*>/g;
|
|
692
|
+
const stack = [];
|
|
693
|
+
let rootNode = null;
|
|
694
|
+
let lastIndex = 0;
|
|
695
|
+
for (const match of xml.matchAll(tagPattern)) {
|
|
696
|
+
const fullMatch = match[0];
|
|
697
|
+
const matchIndex = match.index;
|
|
698
|
+
const isClosingTag = match[1] === "/";
|
|
699
|
+
const tagName = match[2];
|
|
700
|
+
const isSelfClosing = match[3] === "/";
|
|
701
|
+
if (matchIndex === undefined || !fullMatch || !tagName) {
|
|
702
|
+
continue;
|
|
703
|
+
}
|
|
704
|
+
const textContent = xml.slice(lastIndex, matchIndex);
|
|
705
|
+
if (stack.length > 0 && textContent.length > 0) {
|
|
706
|
+
stack[stack.length - 1]?.textSegments.push(textContent);
|
|
707
|
+
stack[stack.length - 1]?.parts.push({ type: "text", value: textContent });
|
|
708
|
+
}
|
|
709
|
+
else if (stack.length === 0 && textContent.trim().length > 0) {
|
|
710
|
+
return null;
|
|
711
|
+
}
|
|
712
|
+
if (isClosingTag) {
|
|
713
|
+
const completedNode = stack.pop();
|
|
714
|
+
if (!completedNode || completedNode.name !== tagName) {
|
|
715
|
+
return null;
|
|
716
|
+
}
|
|
717
|
+
if (stack.length > 0) {
|
|
718
|
+
stack[stack.length - 1]?.children.push(completedNode);
|
|
719
|
+
stack[stack.length - 1]?.parts.push({ type: "child", value: completedNode });
|
|
720
|
+
}
|
|
721
|
+
else if (!rootNode) {
|
|
722
|
+
rootNode = completedNode;
|
|
723
|
+
}
|
|
724
|
+
else {
|
|
725
|
+
return null;
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
else {
|
|
729
|
+
const node = {
|
|
730
|
+
name: tagName,
|
|
731
|
+
children: [],
|
|
732
|
+
parts: [],
|
|
733
|
+
textSegments: [],
|
|
734
|
+
};
|
|
735
|
+
if (isSelfClosing) {
|
|
736
|
+
if (stack.length > 0) {
|
|
737
|
+
stack[stack.length - 1]?.children.push(node);
|
|
738
|
+
stack[stack.length - 1]?.parts.push({ type: "child", value: node });
|
|
739
|
+
}
|
|
740
|
+
else if (!rootNode) {
|
|
741
|
+
rootNode = node;
|
|
742
|
+
}
|
|
743
|
+
else {
|
|
744
|
+
return null;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
else {
|
|
748
|
+
stack.push(node);
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
lastIndex = matchIndex + fullMatch.length;
|
|
752
|
+
}
|
|
753
|
+
if (stack.length > 0) {
|
|
754
|
+
return null;
|
|
755
|
+
}
|
|
756
|
+
if (lastIndex < xml.length && xml.slice(lastIndex).trim().length > 0) {
|
|
757
|
+
return null;
|
|
758
|
+
}
|
|
759
|
+
return rootNode;
|
|
760
|
+
}
|
|
761
|
+
function serializeXmlNode(node) {
|
|
762
|
+
const innerContent = node.parts
|
|
763
|
+
.map((part) => (part.type === "text" ? part.value : serializeXmlNode(part.value)))
|
|
764
|
+
.join("");
|
|
765
|
+
return `<${node.name}>${innerContent}</${node.name}>`;
|
|
766
|
+
}
|
|
767
|
+
function convertChildrenToObject(children, schema) {
|
|
768
|
+
const objectValue = {};
|
|
769
|
+
for (const child of children) {
|
|
770
|
+
const propertySchema = getPropertySchema(schema, child.name);
|
|
771
|
+
const propertyValue = convertXmlNodeValue(child, propertySchema);
|
|
772
|
+
const existingValue = objectValue[child.name];
|
|
773
|
+
if (existingValue === undefined) {
|
|
774
|
+
objectValue[child.name] = propertyValue;
|
|
775
|
+
continue;
|
|
776
|
+
}
|
|
777
|
+
if (Array.isArray(existingValue)) {
|
|
778
|
+
existingValue.push(propertyValue);
|
|
779
|
+
continue;
|
|
780
|
+
}
|
|
781
|
+
objectValue[child.name] = [existingValue, propertyValue];
|
|
782
|
+
}
|
|
783
|
+
return objectValue;
|
|
784
|
+
}
|
|
785
|
+
function convertXmlNodeValue(node, schema) {
|
|
786
|
+
const normalizedSchema = normalizeSchema(schema);
|
|
787
|
+
const schemaTypes = getSchemaTypes(normalizedSchema);
|
|
788
|
+
if (node.children.length === 0) {
|
|
789
|
+
return coerceXmlValue(node.textSegments.join(""), normalizedSchema);
|
|
790
|
+
}
|
|
791
|
+
if (schemaTypes.includes("string")) {
|
|
792
|
+
return node.parts
|
|
793
|
+
.map((part) => (part.type === "text" ? unescapeXml(part.value) : serializeXmlNode(part.value)))
|
|
794
|
+
.join("");
|
|
795
|
+
}
|
|
796
|
+
if (shouldTreatAsArray(node, normalizedSchema)) {
|
|
797
|
+
if (node.children.some((child) => child.name !== "item")) {
|
|
798
|
+
throw new Error("Array-valued XML nodes must wrap entries in <item> tags");
|
|
799
|
+
}
|
|
800
|
+
const itemSchema = getArrayItemSchema(normalizedSchema);
|
|
801
|
+
const itemNodes = node.children.filter((child) => child.name === "item");
|
|
802
|
+
return itemNodes.map((child) => convertXmlNodeValue(child, itemSchema));
|
|
803
|
+
}
|
|
804
|
+
return convertChildrenToObject(node.children, normalizedSchema);
|
|
805
|
+
}
|
|
806
|
+
function shouldTreatAsArray(node, schema) {
|
|
807
|
+
const types = getSchemaTypes(schema);
|
|
808
|
+
if (types.includes("array")) {
|
|
809
|
+
return true;
|
|
810
|
+
}
|
|
811
|
+
return node.children.every((child) => child.name === "item");
|
|
812
|
+
}
|
|
813
|
+
function getArrayItemSchema(schema) {
|
|
814
|
+
if (!schema || typeof schema !== "object") {
|
|
815
|
+
return undefined;
|
|
816
|
+
}
|
|
817
|
+
const items = schema.items;
|
|
818
|
+
if (items && !Array.isArray(items) && typeof items === "object") {
|
|
819
|
+
return items;
|
|
820
|
+
}
|
|
821
|
+
return undefined;
|
|
822
|
+
}
|
|
823
|
+
function getPropertySchema(schema, propertyName) {
|
|
824
|
+
if (!schema || typeof schema !== "object") {
|
|
825
|
+
return undefined;
|
|
826
|
+
}
|
|
827
|
+
const properties = schema.properties;
|
|
828
|
+
if (properties && typeof properties === "object" && !Array.isArray(properties)) {
|
|
829
|
+
const propertySchema = properties[propertyName];
|
|
830
|
+
if (propertySchema === undefined || typeof propertySchema === "boolean" || typeof propertySchema === "object") {
|
|
831
|
+
return propertySchema;
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
for (const unionKey of ["anyOf", "oneOf", "allOf"]) {
|
|
835
|
+
const unionSchemas = schema[unionKey];
|
|
836
|
+
if (!Array.isArray(unionSchemas)) {
|
|
837
|
+
continue;
|
|
838
|
+
}
|
|
839
|
+
for (const unionSchema of unionSchemas) {
|
|
840
|
+
if (typeof unionSchema !== "object" || unionSchema === null) {
|
|
841
|
+
continue;
|
|
842
|
+
}
|
|
843
|
+
const nestedPropertySchema = getPropertySchema(unionSchema, propertyName);
|
|
844
|
+
if (nestedPropertySchema !== undefined) {
|
|
845
|
+
return nestedPropertySchema;
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
return undefined;
|
|
850
|
+
}
|
|
851
|
+
function getSchemaTypes(schema) {
|
|
852
|
+
if (!schema || typeof schema !== "object") {
|
|
853
|
+
return [];
|
|
854
|
+
}
|
|
855
|
+
const schemaType = schema.type;
|
|
856
|
+
if (typeof schemaType === "string") {
|
|
857
|
+
return [schemaType];
|
|
858
|
+
}
|
|
859
|
+
if (Array.isArray(schemaType)) {
|
|
860
|
+
return schemaType.filter((value) => typeof value === "string");
|
|
861
|
+
}
|
|
862
|
+
return [];
|
|
863
|
+
}
|
|
864
|
+
function coerceXmlValue(rawValue, schema) {
|
|
865
|
+
const decodedValue = unescapeXml(rawValue);
|
|
866
|
+
const trimmedValue = decodedValue.trim();
|
|
867
|
+
const types = getSchemaTypes(schema);
|
|
868
|
+
if (types.includes("integer") && /^-?\d+$/.test(trimmedValue)) {
|
|
869
|
+
return Number.parseInt(trimmedValue, 10);
|
|
870
|
+
}
|
|
871
|
+
if (types.includes("number") && /^-?(?:\d+|\d*\.\d+)$/.test(trimmedValue)) {
|
|
872
|
+
return Number(trimmedValue);
|
|
873
|
+
}
|
|
874
|
+
if (types.includes("boolean")) {
|
|
875
|
+
if (trimmedValue === "true") {
|
|
876
|
+
return true;
|
|
877
|
+
}
|
|
878
|
+
if (trimmedValue === "false") {
|
|
879
|
+
return false;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
if (types.includes("null") && trimmedValue === "null") {
|
|
883
|
+
return null;
|
|
884
|
+
}
|
|
885
|
+
if ((types.includes("array") || types.includes("object")) && trimmedValue.length > 0) {
|
|
886
|
+
try {
|
|
887
|
+
return JSON.parse(trimmedValue);
|
|
888
|
+
}
|
|
889
|
+
catch { }
|
|
890
|
+
}
|
|
891
|
+
return decodedValue;
|
|
892
|
+
}
|
|
893
|
+
function coercePartialXmlValue(rawValue, schema) {
|
|
894
|
+
const types = getSchemaTypes(schema);
|
|
895
|
+
if (types.includes("integer") || types.includes("number")) {
|
|
896
|
+
const trimmedValue = unescapeXml(rawValue).trim();
|
|
897
|
+
if (trimmedValue.length > 0 && /^-?(?:\d+|\d*\.\d+)$/.test(trimmedValue)) {
|
|
898
|
+
return types.includes("integer") ? Number.parseInt(trimmedValue, 10) : Number(trimmedValue);
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
return unescapeXml(rawValue);
|
|
902
|
+
}
|
|
903
|
+
function parseOpeningTag(text, startIndex) {
|
|
904
|
+
const tagPattern = /<\s*([A-Za-z_][\w.-]*)\s*>/y;
|
|
905
|
+
tagPattern.lastIndex = startIndex;
|
|
906
|
+
const match = tagPattern.exec(text);
|
|
907
|
+
const tagName = match?.[1];
|
|
908
|
+
if (!match || !tagName) {
|
|
909
|
+
return null;
|
|
910
|
+
}
|
|
911
|
+
return {
|
|
912
|
+
endIndex: match.index + match[0].length,
|
|
913
|
+
name: tagName,
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
function escapeXml(text) {
|
|
917
|
+
return text
|
|
918
|
+
.replace(/&/g, "&")
|
|
919
|
+
.replace(/</g, "<")
|
|
920
|
+
.replace(/>/g, ">")
|
|
921
|
+
.replace(/"/g, """)
|
|
922
|
+
.replace(/'/g, "'");
|
|
923
|
+
}
|
|
924
|
+
function unescapeXml(text) {
|
|
925
|
+
return text
|
|
926
|
+
.replace(/</g, "<")
|
|
927
|
+
.replace(/>/g, ">")
|
|
928
|
+
.replace(/"/g, '"')
|
|
929
|
+
.replace(/'/g, "'")
|
|
930
|
+
.replace(/&/g, "&");
|
|
931
|
+
}
|
|
932
|
+
function escapeRegExp(text) {
|
|
933
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
934
|
+
}
|
|
935
|
+
//# sourceMappingURL=morph-xml.js.map
|