@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,559 @@
|
|
|
1
|
+
const STRING_DELIM = '<|"|>';
|
|
2
|
+
const TOOL_CALL_START = "<|tool_call>";
|
|
3
|
+
const TOOL_CALL_END = "<tool_call|>";
|
|
4
|
+
const TURN_END = "<turn|>";
|
|
5
|
+
const TOOL_RESPONSE_START = "<|tool_response>";
|
|
6
|
+
const TOOL_CALL_REGEX = /<\|tool_call>call:([\w\-.]+)\{(.*?)\}(?:<tool_call\|>|<turn\|>)/gs;
|
|
7
|
+
/**
|
|
8
|
+
* Formats a value for Gemma 4's custom serialization format.
|
|
9
|
+
* Strings are wrapped in <|"|> delimiters.
|
|
10
|
+
* Numbers, booleans, and null are rendered as bare values.
|
|
11
|
+
* Objects and arrays are recursively formatted.
|
|
12
|
+
*/
|
|
13
|
+
function formatGemma4Value(value) {
|
|
14
|
+
if (value === null) {
|
|
15
|
+
return "null";
|
|
16
|
+
}
|
|
17
|
+
if (value === undefined) {
|
|
18
|
+
return "null";
|
|
19
|
+
}
|
|
20
|
+
if (typeof value === "string") {
|
|
21
|
+
return STRING_DELIM + value + STRING_DELIM;
|
|
22
|
+
}
|
|
23
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
24
|
+
return String(value);
|
|
25
|
+
}
|
|
26
|
+
if (Array.isArray(value)) {
|
|
27
|
+
const items = value.map((item) => formatGemma4Value(item));
|
|
28
|
+
return `[${items.join(",")}]`;
|
|
29
|
+
}
|
|
30
|
+
if (typeof value === "object" && value !== null) {
|
|
31
|
+
const entries = Object.entries(value).map(([key, val]) => {
|
|
32
|
+
return `${key}:${formatGemma4Value(val)}`;
|
|
33
|
+
});
|
|
34
|
+
return `{${entries.join(",")}}`;
|
|
35
|
+
}
|
|
36
|
+
return STRING_DELIM + String(value) + STRING_DELIM;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Formats tool arguments for Gemma 4's custom format.
|
|
40
|
+
* Returns the content inside the braces: key:<|"|>value<|"|>,...
|
|
41
|
+
*/
|
|
42
|
+
function formatGemma4Args(args) {
|
|
43
|
+
const entries = Object.entries(args).map(([key, value]) => {
|
|
44
|
+
return `${key}:${formatGemma4Value(value)}`;
|
|
45
|
+
});
|
|
46
|
+
return entries.join(",");
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Formats a complete tool call in Gemma 4 format.
|
|
50
|
+
* Format: <|tool_call>call:name{key:<|"|>value<|"|>,...}<tool_call|>
|
|
51
|
+
*/
|
|
52
|
+
export function gemma4FormatToolCall(name, args) {
|
|
53
|
+
const argsStr = formatGemma4Args(args);
|
|
54
|
+
return `${TOOL_CALL_START}call:${name}{${argsStr}}${TOOL_CALL_END}`;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Formats a tool response for Gemma 4.
|
|
58
|
+
* Format: <|tool_response>content
|
|
59
|
+
*/
|
|
60
|
+
export function gemma4FormatToolResponse(_toolName, _toolCallId, content) {
|
|
61
|
+
const textParts = [];
|
|
62
|
+
for (const item of content) {
|
|
63
|
+
if (item.type === "text") {
|
|
64
|
+
textParts.push(item.text);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return TOOL_RESPONSE_START + textParts.join("\n");
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Generates a system prompt describing available tools for Gemma 4.
|
|
71
|
+
* Includes tool definitions with JSON schemas and usage instructions.
|
|
72
|
+
*/
|
|
73
|
+
export function gemma4FormatToolsSystemPrompt(tools) {
|
|
74
|
+
if (tools.length === 0) {
|
|
75
|
+
return "";
|
|
76
|
+
}
|
|
77
|
+
const toolDescriptions = tools.map((tool) => {
|
|
78
|
+
const schema = JSON.stringify(tool.parameters, null, 3);
|
|
79
|
+
return `Name: ${tool.name}
|
|
80
|
+
Description: ${tool.description}
|
|
81
|
+
Parameters Schema:
|
|
82
|
+
${schema}`;
|
|
83
|
+
});
|
|
84
|
+
return `You have access to the following tools. Use them when appropriate.
|
|
85
|
+
|
|
86
|
+
${toolDescriptions.join("\n\n")}
|
|
87
|
+
|
|
88
|
+
When you need to use a tool, format your response exactly like this:
|
|
89
|
+
|
|
90
|
+
${TOOL_CALL_START}call:name{key:${STRING_DELIM}value${STRING_DELIM}}${TOOL_CALL_END}
|
|
91
|
+
|
|
92
|
+
Important formatting rules:
|
|
93
|
+
- String values must be wrapped in ${STRING_DELIM} delimiters
|
|
94
|
+
- Numbers and booleans should be bare values (no delimiters)
|
|
95
|
+
- Multiple arguments are separated by commas
|
|
96
|
+
- Nested objects use {key:value} syntax
|
|
97
|
+
- Arrays use [value1,value2] syntax
|
|
98
|
+
|
|
99
|
+
Example:
|
|
100
|
+
${TOOL_CALL_START}call:get_weather{location:${STRING_DELIM}London${STRING_DELIM},unit:${STRING_DELIM}celsius${STRING_DELIM}}${TOOL_CALL_END}`;
|
|
101
|
+
}
|
|
102
|
+
function parseGemma4Value(valueString) {
|
|
103
|
+
const trimmedValue = valueString.trim();
|
|
104
|
+
if (!trimmedValue) {
|
|
105
|
+
return trimmedValue;
|
|
106
|
+
}
|
|
107
|
+
if (trimmedValue === "true") {
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
if (trimmedValue === "false") {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
if (trimmedValue.includes(".")) {
|
|
114
|
+
const parsedFloat = /^-?(?:\d+\.\d*|\.\d+)$/.test(trimmedValue) ? Number.parseFloat(trimmedValue) : Number.NaN;
|
|
115
|
+
return Number.isNaN(parsedFloat) ? trimmedValue : parsedFloat;
|
|
116
|
+
}
|
|
117
|
+
if (/^-?\d+$/.test(trimmedValue)) {
|
|
118
|
+
return Number.parseInt(trimmedValue, 10);
|
|
119
|
+
}
|
|
120
|
+
return trimmedValue;
|
|
121
|
+
}
|
|
122
|
+
function parseGemma4Array(arrayString, partial = false) {
|
|
123
|
+
const items = [];
|
|
124
|
+
let index = 0;
|
|
125
|
+
while (index < arrayString.length) {
|
|
126
|
+
while (index < arrayString.length && [" ", ",", "\n", "\t"].includes(arrayString[index] ?? "")) {
|
|
127
|
+
index += 1;
|
|
128
|
+
}
|
|
129
|
+
if (index >= arrayString.length) {
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
if (arrayString.startsWith(STRING_DELIM, index)) {
|
|
133
|
+
index += STRING_DELIM.length;
|
|
134
|
+
const endIndex = arrayString.indexOf(STRING_DELIM, index);
|
|
135
|
+
if (endIndex === -1) {
|
|
136
|
+
items.push(arrayString.slice(index));
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
items.push(arrayString.slice(index, endIndex));
|
|
140
|
+
index = endIndex + STRING_DELIM.length;
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
if (arrayString[index] === "{") {
|
|
144
|
+
let depth = 1;
|
|
145
|
+
const objectStart = index + 1;
|
|
146
|
+
index += 1;
|
|
147
|
+
while (index < arrayString.length && depth > 0) {
|
|
148
|
+
if (arrayString.startsWith(STRING_DELIM, index)) {
|
|
149
|
+
index += STRING_DELIM.length;
|
|
150
|
+
const nextDelimiter = arrayString.indexOf(STRING_DELIM, index);
|
|
151
|
+
index = nextDelimiter === -1 ? arrayString.length : nextDelimiter + STRING_DELIM.length;
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
if (arrayString[index] === "{") {
|
|
155
|
+
depth += 1;
|
|
156
|
+
}
|
|
157
|
+
else if (arrayString[index] === "}") {
|
|
158
|
+
depth -= 1;
|
|
159
|
+
}
|
|
160
|
+
index += 1;
|
|
161
|
+
}
|
|
162
|
+
if (depth > 0) {
|
|
163
|
+
items.push(parseGemma4Args(arrayString.slice(objectStart, index), true));
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
items.push(parseGemma4Args(arrayString.slice(objectStart, index - 1)));
|
|
167
|
+
}
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
if (arrayString[index] === "[") {
|
|
171
|
+
let depth = 1;
|
|
172
|
+
const subArrayStart = index + 1;
|
|
173
|
+
index += 1;
|
|
174
|
+
while (index < arrayString.length && depth > 0) {
|
|
175
|
+
if (arrayString[index] === "[") {
|
|
176
|
+
depth += 1;
|
|
177
|
+
}
|
|
178
|
+
else if (arrayString[index] === "]") {
|
|
179
|
+
depth -= 1;
|
|
180
|
+
}
|
|
181
|
+
index += 1;
|
|
182
|
+
}
|
|
183
|
+
if (depth > 0) {
|
|
184
|
+
items.push(parseGemma4Array(arrayString.slice(subArrayStart, index), true));
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
items.push(parseGemma4Array(arrayString.slice(subArrayStart, index - 1)));
|
|
188
|
+
}
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
const valueStart = index;
|
|
192
|
+
while (index < arrayString.length && ![",", "]"].includes(arrayString[index] ?? "")) {
|
|
193
|
+
index += 1;
|
|
194
|
+
}
|
|
195
|
+
if (partial && index >= arrayString.length) {
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
items.push(parseGemma4Value(arrayString.slice(valueStart, index)));
|
|
199
|
+
}
|
|
200
|
+
return items;
|
|
201
|
+
}
|
|
202
|
+
export function parseGemma4Args(argsString, partial = false) {
|
|
203
|
+
if (!argsString.trim()) {
|
|
204
|
+
return {};
|
|
205
|
+
}
|
|
206
|
+
const result = {};
|
|
207
|
+
let index = 0;
|
|
208
|
+
while (index < argsString.length) {
|
|
209
|
+
while (index < argsString.length && [" ", ",", "\n", "\t"].includes(argsString[index] ?? "")) {
|
|
210
|
+
index += 1;
|
|
211
|
+
}
|
|
212
|
+
if (index >= argsString.length) {
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
const keyStart = index;
|
|
216
|
+
while (index < argsString.length && argsString[index] !== ":") {
|
|
217
|
+
index += 1;
|
|
218
|
+
}
|
|
219
|
+
if (index >= argsString.length) {
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
const key = argsString.slice(keyStart, index).trim();
|
|
223
|
+
index += 1;
|
|
224
|
+
if (index >= argsString.length) {
|
|
225
|
+
if (!partial) {
|
|
226
|
+
result[key] = "";
|
|
227
|
+
}
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
while (index < argsString.length && [" ", "\n", "\t"].includes(argsString[index] ?? "")) {
|
|
231
|
+
index += 1;
|
|
232
|
+
}
|
|
233
|
+
if (index >= argsString.length) {
|
|
234
|
+
if (!partial) {
|
|
235
|
+
result[key] = "";
|
|
236
|
+
}
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
if (argsString.startsWith(STRING_DELIM, index)) {
|
|
240
|
+
index += STRING_DELIM.length;
|
|
241
|
+
const valueStart = index;
|
|
242
|
+
const endIndex = argsString.indexOf(STRING_DELIM, index);
|
|
243
|
+
if (endIndex === -1) {
|
|
244
|
+
result[key] = argsString.slice(valueStart);
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
247
|
+
result[key] = argsString.slice(valueStart, endIndex);
|
|
248
|
+
index = endIndex + STRING_DELIM.length;
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
if (argsString[index] === "{") {
|
|
252
|
+
let depth = 1;
|
|
253
|
+
const objectStart = index + 1;
|
|
254
|
+
index += 1;
|
|
255
|
+
while (index < argsString.length && depth > 0) {
|
|
256
|
+
if (argsString.startsWith(STRING_DELIM, index)) {
|
|
257
|
+
index += STRING_DELIM.length;
|
|
258
|
+
const nextDelimiter = argsString.indexOf(STRING_DELIM, index);
|
|
259
|
+
index = nextDelimiter === -1 ? argsString.length : nextDelimiter + STRING_DELIM.length;
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
if (argsString[index] === "{") {
|
|
263
|
+
depth += 1;
|
|
264
|
+
}
|
|
265
|
+
else if (argsString[index] === "}") {
|
|
266
|
+
depth -= 1;
|
|
267
|
+
}
|
|
268
|
+
index += 1;
|
|
269
|
+
}
|
|
270
|
+
if (depth > 0) {
|
|
271
|
+
result[key] = parseGemma4Args(argsString.slice(objectStart, index), true);
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
result[key] = parseGemma4Args(argsString.slice(objectStart, index - 1));
|
|
275
|
+
}
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
if (argsString[index] === "[") {
|
|
279
|
+
let depth = 1;
|
|
280
|
+
const arrayStart = index + 1;
|
|
281
|
+
index += 1;
|
|
282
|
+
while (index < argsString.length && depth > 0) {
|
|
283
|
+
if (argsString.startsWith(STRING_DELIM, index)) {
|
|
284
|
+
index += STRING_DELIM.length;
|
|
285
|
+
const nextDelimiter = argsString.indexOf(STRING_DELIM, index);
|
|
286
|
+
index = nextDelimiter === -1 ? argsString.length : nextDelimiter + STRING_DELIM.length;
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
289
|
+
if (argsString[index] === "[") {
|
|
290
|
+
depth += 1;
|
|
291
|
+
}
|
|
292
|
+
else if (argsString[index] === "]") {
|
|
293
|
+
depth -= 1;
|
|
294
|
+
}
|
|
295
|
+
index += 1;
|
|
296
|
+
}
|
|
297
|
+
if (depth > 0) {
|
|
298
|
+
result[key] = parseGemma4Array(argsString.slice(arrayStart, index), true);
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
result[key] = parseGemma4Array(argsString.slice(arrayStart, index - 1));
|
|
302
|
+
}
|
|
303
|
+
continue;
|
|
304
|
+
}
|
|
305
|
+
const valueStart = index;
|
|
306
|
+
while (index < argsString.length && ![",", "}", "]"].includes(argsString[index] ?? "")) {
|
|
307
|
+
index += 1;
|
|
308
|
+
}
|
|
309
|
+
if (partial && index >= argsString.length) {
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
result[key] = parseGemma4Value(argsString.slice(valueStart, index));
|
|
313
|
+
}
|
|
314
|
+
return result;
|
|
315
|
+
}
|
|
316
|
+
function findCommonPrefix(left, right) {
|
|
317
|
+
const maxLength = Math.min(left.length, right.length);
|
|
318
|
+
let index = 0;
|
|
319
|
+
while (index < maxLength && left[index] === right[index]) {
|
|
320
|
+
index += 1;
|
|
321
|
+
}
|
|
322
|
+
return left.slice(0, index);
|
|
323
|
+
}
|
|
324
|
+
function extractToolCalls(text) {
|
|
325
|
+
return Array.from(text.matchAll(TOOL_CALL_REGEX));
|
|
326
|
+
}
|
|
327
|
+
function extractPartialToolCall(content) {
|
|
328
|
+
if (!content.startsWith("call:")) {
|
|
329
|
+
return { name: null, rawArgs: "" };
|
|
330
|
+
}
|
|
331
|
+
const functionPart = content.slice(5);
|
|
332
|
+
const braceIndex = functionPart.indexOf("{");
|
|
333
|
+
if (braceIndex === -1) {
|
|
334
|
+
return { name: null, rawArgs: "" };
|
|
335
|
+
}
|
|
336
|
+
const name = functionPart.slice(0, braceIndex).trim();
|
|
337
|
+
let rawArgs = functionPart.slice(braceIndex + 1);
|
|
338
|
+
if (rawArgs.endsWith("}")) {
|
|
339
|
+
rawArgs = rawArgs.slice(0, -1);
|
|
340
|
+
}
|
|
341
|
+
return { name, rawArgs };
|
|
342
|
+
}
|
|
343
|
+
function stripTrailingUnsafeCharacters(argumentsJson) {
|
|
344
|
+
let safePrefix = argumentsJson;
|
|
345
|
+
while (safePrefix.length > 0) {
|
|
346
|
+
const trailingCharacter = safePrefix[safePrefix.length - 1];
|
|
347
|
+
if (!trailingCharacter || !["}", '"', "]", "<", "|", "\\", ">"].includes(trailingCharacter)) {
|
|
348
|
+
break;
|
|
349
|
+
}
|
|
350
|
+
safePrefix = safePrefix.slice(0, -1);
|
|
351
|
+
}
|
|
352
|
+
return safePrefix;
|
|
353
|
+
}
|
|
354
|
+
function getPartialTokenSuffix(text, tokens) {
|
|
355
|
+
for (const token of tokens) {
|
|
356
|
+
for (let index = token.length - 1; index > 0; index -= 1) {
|
|
357
|
+
const prefix = token.slice(0, index);
|
|
358
|
+
if (text.endsWith(prefix)) {
|
|
359
|
+
return prefix;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return "";
|
|
364
|
+
}
|
|
365
|
+
function findEarliestToken(text, tokens) {
|
|
366
|
+
let earliestMatch = null;
|
|
367
|
+
for (const token of tokens) {
|
|
368
|
+
const tokenIndex = text.indexOf(token);
|
|
369
|
+
if (tokenIndex === -1) {
|
|
370
|
+
continue;
|
|
371
|
+
}
|
|
372
|
+
if (!earliestMatch || tokenIndex < earliestMatch.index) {
|
|
373
|
+
earliestMatch = { index: tokenIndex, token };
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return earliestMatch;
|
|
377
|
+
}
|
|
378
|
+
export function gemma4ParseGeneratedText(text, _tools, _options) {
|
|
379
|
+
const parsedToolCalls = [];
|
|
380
|
+
for (const match of extractToolCalls(text)) {
|
|
381
|
+
const [, name, rawArgs] = match;
|
|
382
|
+
if (!name || rawArgs === undefined) {
|
|
383
|
+
continue;
|
|
384
|
+
}
|
|
385
|
+
parsedToolCalls.push({
|
|
386
|
+
name,
|
|
387
|
+
arguments: parseGemma4Args(rawArgs),
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
return parsedToolCalls;
|
|
391
|
+
}
|
|
392
|
+
class Gemma4StreamParser {
|
|
393
|
+
toolCallIds = [];
|
|
394
|
+
plainTextCarry = "";
|
|
395
|
+
toolCallCarry = "";
|
|
396
|
+
insideToolCall = false;
|
|
397
|
+
toolCallContent = "";
|
|
398
|
+
currentToolIndex = -1;
|
|
399
|
+
currentToolName = null;
|
|
400
|
+
currentArgumentsJson = "";
|
|
401
|
+
feed(textDelta) {
|
|
402
|
+
const events = [];
|
|
403
|
+
let remaining = textDelta;
|
|
404
|
+
while (remaining.length > 0) {
|
|
405
|
+
if (!this.insideToolCall) {
|
|
406
|
+
const combinedText = this.plainTextCarry + remaining;
|
|
407
|
+
const startIndex = combinedText.indexOf(TOOL_CALL_START);
|
|
408
|
+
if (startIndex === -1) {
|
|
409
|
+
const partialSuffix = getPartialTokenSuffix(combinedText, [TOOL_CALL_START]);
|
|
410
|
+
const flushableText = partialSuffix ? combinedText.slice(0, -partialSuffix.length) : combinedText;
|
|
411
|
+
if (flushableText) {
|
|
412
|
+
events.push({ type: "text", text: flushableText });
|
|
413
|
+
}
|
|
414
|
+
this.plainTextCarry = partialSuffix;
|
|
415
|
+
break;
|
|
416
|
+
}
|
|
417
|
+
const textBeforeToolCall = combinedText.slice(0, startIndex);
|
|
418
|
+
if (textBeforeToolCall) {
|
|
419
|
+
events.push({ type: "text", text: textBeforeToolCall });
|
|
420
|
+
}
|
|
421
|
+
const afterStart = combinedText.slice(startIndex + TOOL_CALL_START.length);
|
|
422
|
+
this.plainTextCarry = "";
|
|
423
|
+
this.insideToolCall = true;
|
|
424
|
+
this.toolCallContent = "";
|
|
425
|
+
this.toolCallCarry = "";
|
|
426
|
+
this.currentToolIndex += 1;
|
|
427
|
+
this.currentToolName = null;
|
|
428
|
+
this.currentArgumentsJson = "";
|
|
429
|
+
this.toolCallIds[this.currentToolIndex] = `gemma4-tool-${this.currentToolIndex}`;
|
|
430
|
+
remaining = afterStart;
|
|
431
|
+
continue;
|
|
432
|
+
}
|
|
433
|
+
const combinedToolCall = this.toolCallCarry + remaining;
|
|
434
|
+
const endMatch = findEarliestToken(combinedToolCall, [TOOL_CALL_END, TURN_END]);
|
|
435
|
+
if (!endMatch) {
|
|
436
|
+
const partialSuffix = getPartialTokenSuffix(combinedToolCall, [TOOL_CALL_END, TURN_END]);
|
|
437
|
+
const flushableContent = partialSuffix
|
|
438
|
+
? combinedToolCall.slice(0, -partialSuffix.length)
|
|
439
|
+
: combinedToolCall;
|
|
440
|
+
this.toolCallCarry = partialSuffix;
|
|
441
|
+
if (flushableContent) {
|
|
442
|
+
this.toolCallContent += flushableContent;
|
|
443
|
+
this.emitPartialToolCall(events);
|
|
444
|
+
}
|
|
445
|
+
break;
|
|
446
|
+
}
|
|
447
|
+
const contentBeforeEnd = combinedToolCall.slice(0, endMatch.index);
|
|
448
|
+
this.toolCallContent += contentBeforeEnd;
|
|
449
|
+
this.toolCallCarry = "";
|
|
450
|
+
this.emitPartialToolCall(events);
|
|
451
|
+
this.emitCompletedToolCall(events);
|
|
452
|
+
this.insideToolCall = false;
|
|
453
|
+
this.toolCallContent = "";
|
|
454
|
+
this.currentToolName = null;
|
|
455
|
+
this.currentArgumentsJson = "";
|
|
456
|
+
remaining = combinedToolCall.slice(endMatch.index + endMatch.token.length);
|
|
457
|
+
}
|
|
458
|
+
return events;
|
|
459
|
+
}
|
|
460
|
+
finish() {
|
|
461
|
+
const events = [];
|
|
462
|
+
if (!this.insideToolCall && this.plainTextCarry) {
|
|
463
|
+
events.push({ type: "text", text: this.plainTextCarry });
|
|
464
|
+
}
|
|
465
|
+
if (this.insideToolCall) {
|
|
466
|
+
const unfinishedToolCall = TOOL_CALL_START + this.toolCallContent + this.toolCallCarry;
|
|
467
|
+
if (unfinishedToolCall) {
|
|
468
|
+
events.push({ type: "text", text: unfinishedToolCall });
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
this.plainTextCarry = "";
|
|
472
|
+
this.toolCallCarry = "";
|
|
473
|
+
this.insideToolCall = false;
|
|
474
|
+
this.toolCallContent = "";
|
|
475
|
+
this.currentToolName = null;
|
|
476
|
+
this.currentArgumentsJson = "";
|
|
477
|
+
return events;
|
|
478
|
+
}
|
|
479
|
+
emitPartialToolCall(events) {
|
|
480
|
+
const { name, rawArgs } = extractPartialToolCall(this.toolCallContent);
|
|
481
|
+
if (!name) {
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
if (!this.currentToolName) {
|
|
485
|
+
this.currentToolName = name;
|
|
486
|
+
events.push({
|
|
487
|
+
type: "toolcall_start",
|
|
488
|
+
index: this.currentToolIndex,
|
|
489
|
+
name,
|
|
490
|
+
id: this.toolCallIds[this.currentToolIndex] ?? `gemma4-tool-${this.currentToolIndex}`,
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
if (!rawArgs) {
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
const parsedArguments = parseGemma4Args(rawArgs, true);
|
|
497
|
+
if (Object.keys(parsedArguments).length === 0) {
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
const currentArgumentsJson = JSON.stringify(parsedArguments);
|
|
501
|
+
const safeArgumentsJson = stripTrailingUnsafeCharacters(currentArgumentsJson);
|
|
502
|
+
if (!safeArgumentsJson || safeArgumentsJson === this.currentArgumentsJson) {
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
if (this.currentArgumentsJson) {
|
|
506
|
+
const commonPrefix = findCommonPrefix(this.currentArgumentsJson, safeArgumentsJson);
|
|
507
|
+
if (commonPrefix.length < this.currentArgumentsJson.length) {
|
|
508
|
+
this.currentArgumentsJson = commonPrefix;
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
const argumentsDelta = safeArgumentsJson.slice(this.currentArgumentsJson.length);
|
|
513
|
+
if (!argumentsDelta) {
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
this.currentArgumentsJson = safeArgumentsJson;
|
|
517
|
+
events.push({
|
|
518
|
+
type: "toolcall_delta",
|
|
519
|
+
index: this.currentToolIndex,
|
|
520
|
+
argumentsDelta,
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
emitCompletedToolCall(events) {
|
|
524
|
+
const { name, rawArgs } = extractPartialToolCall(this.toolCallContent);
|
|
525
|
+
if (!name) {
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
if (!this.currentToolName) {
|
|
529
|
+
this.currentToolName = name;
|
|
530
|
+
events.push({
|
|
531
|
+
type: "toolcall_start",
|
|
532
|
+
index: this.currentToolIndex,
|
|
533
|
+
name,
|
|
534
|
+
id: this.toolCallIds[this.currentToolIndex] ?? `gemma4-tool-${this.currentToolIndex}`,
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
const argumentsObject = parseGemma4Args(rawArgs);
|
|
538
|
+
const argumentsJson = JSON.stringify(argumentsObject);
|
|
539
|
+
const finalDelta = argumentsJson.slice(this.currentArgumentsJson.length);
|
|
540
|
+
if (finalDelta) {
|
|
541
|
+
events.push({
|
|
542
|
+
type: "toolcall_delta",
|
|
543
|
+
index: this.currentToolIndex,
|
|
544
|
+
argumentsDelta: finalDelta,
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
events.push({
|
|
548
|
+
type: "toolcall_end",
|
|
549
|
+
index: this.currentToolIndex,
|
|
550
|
+
name,
|
|
551
|
+
id: this.toolCallIds[this.currentToolIndex] ?? `gemma4-tool-${this.currentToolIndex}`,
|
|
552
|
+
arguments: argumentsObject,
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
export function gemma4CreateStreamParser(_tools, _options) {
|
|
557
|
+
return new Gemma4StreamParser();
|
|
558
|
+
}
|
|
559
|
+
//# sourceMappingURL=gemma4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gemma4.js","sourceRoot":"","sources":["../../../src/tool-call-middleware/protocols/gemma4.ts"],"names":[],"mappings":"AAGA,MAAM,YAAY,GAAG,OAAO,CAAC;AAC7B,MAAM,eAAe,GAAG,cAAc,CAAC;AACvC,MAAM,aAAa,GAAG,cAAc,CAAC;AACrC,MAAM,QAAQ,GAAG,SAAS,CAAC;AAC3B,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAC/C,MAAM,eAAe,GAAG,mEAAmE,CAAC;AAE5F;;;;;GAKG;AACH,SAAS,iBAAiB,CAAC,KAAc,EAAU;IAClD,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC;IACf,CAAC;IAED,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,MAAM,CAAC;IACf,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,YAAY,GAAG,KAAK,GAAG,YAAY,CAAC;IAC5C,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ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,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;YAC5B,MAAM,CAAC,IAAI,CAAC;gBACX,IAAI,EAAE,gBAAgB;gBACtB,KAAK,EAAE,IAAI,CAAC,gBAAgB;gBAC5B,IAAI;gBACJ,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,eAAe,IAAI,CAAC,gBAAgB,EAAE;aACrF,CAAC,CAAC;QACJ,CAAC;QAED,MAAM,eAAe,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;QACtD,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;QACzE,IAAI,UAAU,EAAE,CAAC;YAChB,MAAM,CAAC,IAAI,CAAC;gBACX,IAAI,EAAE,gBAAgB;gBACtB,KAAK,EAAE,IAAI,CAAC,gBAAgB;gBAC5B,cAAc,EAAE,UAAU;aAC1B,CAAC,CAAC;QACJ,CAAC;QAED,MAAM,CAAC,IAAI,CAAC;YACX,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,IAAI,CAAC,gBAAgB;YAC5B,IAAI;YACJ,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,eAAe,IAAI,CAAC,gBAAgB,EAAE;YACrF,SAAS,EAAE,eAAe;SAC1B,CAAC,CAAC;IAAA,CACH;CACD;AAED,MAAM,UAAU,wBAAwB,CAAC,MAAc,EAAE,QAAwB,EAAgB;IAChG,OAAO,IAAI,kBAAkB,EAAE,CAAC;AAAA,CAChC","sourcesContent":["import type { ImageContent, TextContent, Tool } from \"../../types.ts\";\nimport type { ParsedToolCall, ParserOptions, StreamParser, StreamParserEvent } from \"../types.ts\";\n\nconst STRING_DELIM = '<|\"|>';\nconst TOOL_CALL_START = \"<|tool_call>\";\nconst TOOL_CALL_END = \"<tool_call|>\";\nconst TURN_END = \"<turn|>\";\nconst TOOL_RESPONSE_START = \"<|tool_response>\";\nconst TOOL_CALL_REGEX = /<\\|tool_call>call:([\\w\\-.]+)\\{(.*?)\\}(?:<tool_call\\|>|<turn\\|>)/gs;\n\n/**\n * Formats a value for Gemma 4's custom serialization format.\n * Strings are wrapped in <|\"|> delimiters.\n * Numbers, booleans, and null are rendered as bare values.\n * Objects and arrays are recursively formatted.\n */\nfunction formatGemma4Value(value: unknown): string {\n\tif (value === null) {\n\t\treturn \"null\";\n\t}\n\n\tif (value === undefined) {\n\t\treturn \"null\";\n\t}\n\n\tif (typeof value === \"string\") {\n\t\treturn STRING_DELIM + value + STRING_DELIM;\n\t}\n\n\tif (typeof value === \"number\" || typeof value === \"boolean\") {\n\t\treturn String(value);\n\t}\n\n\tif (Array.isArray(value)) {\n\t\tconst items = value.map((item) => formatGemma4Value(item));\n\t\treturn `[${items.join(\",\")}]`;\n\t}\n\n\tif (typeof value === \"object\" && value !== null) {\n\t\tconst entries = Object.entries(value).map(([key, val]) => {\n\t\t\treturn `${key}:${formatGemma4Value(val)}`;\n\t\t});\n\t\treturn `{${entries.join(\",\")}}`;\n\t}\n\n\treturn STRING_DELIM + String(value) + STRING_DELIM;\n}\n\n/**\n * Formats tool arguments for Gemma 4's custom format.\n * Returns the content inside the braces: key:<|\"|>value<|\"|>,...\n */\nfunction formatGemma4Args(args: Record<string, unknown>): string {\n\tconst entries = Object.entries(args).map(([key, value]) => {\n\t\treturn `${key}:${formatGemma4Value(value)}`;\n\t});\n\treturn entries.join(\",\");\n}\n\n/**\n * Formats a complete tool call in Gemma 4 format.\n * Format: <|tool_call>call:name{key:<|\"|>value<|\"|>,...}<tool_call|>\n */\nexport function gemma4FormatToolCall(name: string, args: Record<string, unknown>): string {\n\tconst argsStr = formatGemma4Args(args);\n\treturn `${TOOL_CALL_START}call:${name}{${argsStr}}${TOOL_CALL_END}`;\n}\n\n/**\n * Formats a tool response for Gemma 4.\n * Format: <|tool_response>content\n */\nexport function gemma4FormatToolResponse(\n\t_toolName: string,\n\t_toolCallId: string,\n\tcontent: (TextContent | ImageContent)[],\n): string {\n\tconst textParts: string[] = [];\n\tfor (const item of content) {\n\t\tif (item.type === \"text\") {\n\t\t\ttextParts.push(item.text);\n\t\t}\n\t}\n\treturn TOOL_RESPONSE_START + textParts.join(\"\\n\");\n}\n\n/**\n * Generates a system prompt describing available tools for Gemma 4.\n * Includes tool definitions with JSON schemas and usage instructions.\n */\nexport function gemma4FormatToolsSystemPrompt(tools: Tool[]): string {\n\tif (tools.length === 0) {\n\t\treturn \"\";\n\t}\n\n\tconst toolDescriptions = tools.map((tool) => {\n\t\tconst schema = JSON.stringify(tool.parameters, null, 3);\n\t\treturn `Name: ${tool.name}\nDescription: ${tool.description}\nParameters Schema:\n${schema}`;\n\t});\n\n\treturn `You have access to the following tools. Use them when appropriate.\n\n${toolDescriptions.join(\"\\n\\n\")}\n\nWhen you need to use a tool, format your response exactly like this:\n\n${TOOL_CALL_START}call:name{key:${STRING_DELIM}value${STRING_DELIM}}${TOOL_CALL_END}\n\nImportant formatting rules:\n- String values must be wrapped in ${STRING_DELIM} delimiters\n- Numbers and booleans should be bare values (no delimiters)\n- Multiple arguments are separated by commas\n- Nested objects use {key:value} syntax\n- Arrays use [value1,value2] syntax\n\nExample:\n${TOOL_CALL_START}call:get_weather{location:${STRING_DELIM}London${STRING_DELIM},unit:${STRING_DELIM}celsius${STRING_DELIM}}${TOOL_CALL_END}`;\n}\n\nfunction parseGemma4Value(valueString: string): unknown {\n\tconst trimmedValue = valueString.trim();\n\tif (!trimmedValue) {\n\t\treturn trimmedValue;\n\t}\n\n\tif (trimmedValue === \"true\") {\n\t\treturn true;\n\t}\n\n\tif (trimmedValue === \"false\") {\n\t\treturn false;\n\t}\n\n\tif (trimmedValue.includes(\".\")) {\n\t\tconst parsedFloat = /^-?(?:\\d+\\.\\d*|\\.\\d+)$/.test(trimmedValue) ? Number.parseFloat(trimmedValue) : Number.NaN;\n\t\treturn Number.isNaN(parsedFloat) ? trimmedValue : parsedFloat;\n\t}\n\n\tif (/^-?\\d+$/.test(trimmedValue)) {\n\t\treturn Number.parseInt(trimmedValue, 10);\n\t}\n\n\treturn trimmedValue;\n}\n\nfunction parseGemma4Array(arrayString: string, partial = false): unknown[] {\n\tconst items: unknown[] = [];\n\tlet index = 0;\n\n\twhile (index < arrayString.length) {\n\t\twhile (index < arrayString.length && [\" \", \",\", \"\\n\", \"\\t\"].includes(arrayString[index] ?? \"\")) {\n\t\t\tindex += 1;\n\t\t}\n\n\t\tif (index >= arrayString.length) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (arrayString.startsWith(STRING_DELIM, index)) {\n\t\t\tindex += STRING_DELIM.length;\n\t\t\tconst endIndex = arrayString.indexOf(STRING_DELIM, index);\n\t\t\tif (endIndex === -1) {\n\t\t\t\titems.push(arrayString.slice(index));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\titems.push(arrayString.slice(index, endIndex));\n\t\t\tindex = endIndex + STRING_DELIM.length;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (arrayString[index] === \"{\") {\n\t\t\tlet depth = 1;\n\t\t\tconst objectStart = index + 1;\n\t\t\tindex += 1;\n\n\t\t\twhile (index < arrayString.length && depth > 0) {\n\t\t\t\tif (arrayString.startsWith(STRING_DELIM, index)) {\n\t\t\t\t\tindex += STRING_DELIM.length;\n\t\t\t\t\tconst nextDelimiter = arrayString.indexOf(STRING_DELIM, index);\n\t\t\t\t\tindex = nextDelimiter === -1 ? arrayString.length : nextDelimiter + STRING_DELIM.length;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (arrayString[index] === \"{\") {\n\t\t\t\t\tdepth += 1;\n\t\t\t\t} else if (arrayString[index] === \"}\") {\n\t\t\t\t\tdepth -= 1;\n\t\t\t\t}\n\n\t\t\t\tindex += 1;\n\t\t\t}\n\n\t\t\tif (depth > 0) {\n\t\t\t\titems.push(parseGemma4Args(arrayString.slice(objectStart, index), true));\n\t\t\t} else {\n\t\t\t\titems.push(parseGemma4Args(arrayString.slice(objectStart, index - 1)));\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (arrayString[index] === \"[\") {\n\t\t\tlet depth = 1;\n\t\t\tconst subArrayStart = index + 1;\n\t\t\tindex += 1;\n\n\t\t\twhile (index < arrayString.length && depth > 0) {\n\t\t\t\tif (arrayString[index] === \"[\") {\n\t\t\t\t\tdepth += 1;\n\t\t\t\t} else if (arrayString[index] === \"]\") {\n\t\t\t\t\tdepth -= 1;\n\t\t\t\t}\n\n\t\t\t\tindex += 1;\n\t\t\t}\n\n\t\t\tif (depth > 0) {\n\t\t\t\titems.push(parseGemma4Array(arrayString.slice(subArrayStart, index), true));\n\t\t\t} else {\n\t\t\t\titems.push(parseGemma4Array(arrayString.slice(subArrayStart, index - 1)));\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst valueStart = index;\n\t\twhile (index < arrayString.length && ![\",\", \"]\"].includes(arrayString[index] ?? \"\")) {\n\t\t\tindex += 1;\n\t\t}\n\n\t\tif (partial && index >= arrayString.length) {\n\t\t\tbreak;\n\t\t}\n\n\t\titems.push(parseGemma4Value(arrayString.slice(valueStart, index)));\n\t}\n\n\treturn items;\n}\n\nexport function parseGemma4Args(argsString: string, partial = false): Record<string, unknown> {\n\tif (!argsString.trim()) {\n\t\treturn {};\n\t}\n\n\tconst result: Record<string, unknown> = {};\n\tlet index = 0;\n\n\twhile (index < argsString.length) {\n\t\twhile (index < argsString.length && [\" \", \",\", \"\\n\", \"\\t\"].includes(argsString[index] ?? \"\")) {\n\t\t\tindex += 1;\n\t\t}\n\n\t\tif (index >= argsString.length) {\n\t\t\tbreak;\n\t\t}\n\n\t\tconst keyStart = index;\n\t\twhile (index < argsString.length && argsString[index] !== \":\") {\n\t\t\tindex += 1;\n\t\t}\n\n\t\tif (index >= argsString.length) {\n\t\t\tbreak;\n\t\t}\n\n\t\tconst key = argsString.slice(keyStart, index).trim();\n\t\tindex += 1;\n\n\t\tif (index >= argsString.length) {\n\t\t\tif (!partial) {\n\t\t\t\tresult[key] = \"\";\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\twhile (index < argsString.length && [\" \", \"\\n\", \"\\t\"].includes(argsString[index] ?? \"\")) {\n\t\t\tindex += 1;\n\t\t}\n\n\t\tif (index >= argsString.length) {\n\t\t\tif (!partial) {\n\t\t\t\tresult[key] = \"\";\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tif (argsString.startsWith(STRING_DELIM, index)) {\n\t\t\tindex += STRING_DELIM.length;\n\t\t\tconst valueStart = index;\n\t\t\tconst endIndex = argsString.indexOf(STRING_DELIM, index);\n\t\t\tif (endIndex === -1) {\n\t\t\t\tresult[key] = argsString.slice(valueStart);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tresult[key] = argsString.slice(valueStart, endIndex);\n\t\t\tindex = endIndex + STRING_DELIM.length;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (argsString[index] === \"{\") {\n\t\t\tlet depth = 1;\n\t\t\tconst objectStart = index + 1;\n\t\t\tindex += 1;\n\n\t\t\twhile (index < argsString.length && depth > 0) {\n\t\t\t\tif (argsString.startsWith(STRING_DELIM, index)) {\n\t\t\t\t\tindex += STRING_DELIM.length;\n\t\t\t\t\tconst nextDelimiter = argsString.indexOf(STRING_DELIM, index);\n\t\t\t\t\tindex = nextDelimiter === -1 ? argsString.length : nextDelimiter + STRING_DELIM.length;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (argsString[index] === \"{\") {\n\t\t\t\t\tdepth += 1;\n\t\t\t\t} else if (argsString[index] === \"}\") {\n\t\t\t\t\tdepth -= 1;\n\t\t\t\t}\n\n\t\t\t\tindex += 1;\n\t\t\t}\n\n\t\t\tif (depth > 0) {\n\t\t\t\tresult[key] = parseGemma4Args(argsString.slice(objectStart, index), true);\n\t\t\t} else {\n\t\t\t\tresult[key] = parseGemma4Args(argsString.slice(objectStart, index - 1));\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (argsString[index] === \"[\") {\n\t\t\tlet depth = 1;\n\t\t\tconst arrayStart = index + 1;\n\t\t\tindex += 1;\n\n\t\t\twhile (index < argsString.length && depth > 0) {\n\t\t\t\tif (argsString.startsWith(STRING_DELIM, index)) {\n\t\t\t\t\tindex += STRING_DELIM.length;\n\t\t\t\t\tconst nextDelimiter = argsString.indexOf(STRING_DELIM, index);\n\t\t\t\t\tindex = nextDelimiter === -1 ? argsString.length : nextDelimiter + STRING_DELIM.length;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (argsString[index] === \"[\") {\n\t\t\t\t\tdepth += 1;\n\t\t\t\t} else if (argsString[index] === \"]\") {\n\t\t\t\t\tdepth -= 1;\n\t\t\t\t}\n\n\t\t\t\tindex += 1;\n\t\t\t}\n\n\t\t\tif (depth > 0) {\n\t\t\t\tresult[key] = parseGemma4Array(argsString.slice(arrayStart, index), true);\n\t\t\t} else {\n\t\t\t\tresult[key] = parseGemma4Array(argsString.slice(arrayStart, index - 1));\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst valueStart = index;\n\t\twhile (index < argsString.length && ![\",\", \"}\", \"]\"].includes(argsString[index] ?? \"\")) {\n\t\t\tindex += 1;\n\t\t}\n\n\t\tif (partial && index >= argsString.length) {\n\t\t\tbreak;\n\t\t}\n\n\t\tresult[key] = parseGemma4Value(argsString.slice(valueStart, index));\n\t}\n\n\treturn result;\n}\n\nfunction findCommonPrefix(left: string, right: string): string {\n\tconst maxLength = Math.min(left.length, right.length);\n\tlet index = 0;\n\n\twhile (index < maxLength && left[index] === right[index]) {\n\t\tindex += 1;\n\t}\n\n\treturn left.slice(0, index);\n}\n\nfunction extractToolCalls(text: string): RegExpExecArray[] {\n\treturn Array.from(text.matchAll(TOOL_CALL_REGEX));\n}\n\nfunction extractPartialToolCall(content: string): {\n\tname: string | null;\n\trawArgs: string;\n} {\n\tif (!content.startsWith(\"call:\")) {\n\t\treturn { name: null, rawArgs: \"\" };\n\t}\n\n\tconst functionPart = content.slice(5);\n\tconst braceIndex = functionPart.indexOf(\"{\");\n\tif (braceIndex === -1) {\n\t\treturn { name: null, rawArgs: \"\" };\n\t}\n\n\tconst name = functionPart.slice(0, braceIndex).trim();\n\tlet rawArgs = functionPart.slice(braceIndex + 1);\n\tif (rawArgs.endsWith(\"}\")) {\n\t\trawArgs = rawArgs.slice(0, -1);\n\t}\n\n\treturn { name, rawArgs };\n}\n\nfunction stripTrailingUnsafeCharacters(argumentsJson: string): string {\n\tlet safePrefix = argumentsJson;\n\n\twhile (safePrefix.length > 0) {\n\t\tconst trailingCharacter = safePrefix[safePrefix.length - 1];\n\t\tif (!trailingCharacter || ![\"}\", '\"', \"]\", \"<\", \"|\", \"\\\\\", \">\"].includes(trailingCharacter)) {\n\t\t\tbreak;\n\t\t}\n\n\t\tsafePrefix = safePrefix.slice(0, -1);\n\t}\n\n\treturn safePrefix;\n}\n\nfunction getPartialTokenSuffix(text: string, tokens: string[]): string {\n\tfor (const token of tokens) {\n\t\tfor (let index = token.length - 1; index > 0; index -= 1) {\n\t\t\tconst prefix = token.slice(0, index);\n\t\t\tif (text.endsWith(prefix)) {\n\t\t\t\treturn prefix;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn \"\";\n}\n\nfunction findEarliestToken(text: string, tokens: string[]): { index: number; token: string } | null {\n\tlet earliestMatch: { index: number; token: string } | null = null;\n\n\tfor (const token of tokens) {\n\t\tconst tokenIndex = text.indexOf(token);\n\t\tif (tokenIndex === -1) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!earliestMatch || tokenIndex < earliestMatch.index) {\n\t\t\tearliestMatch = { index: tokenIndex, token };\n\t\t}\n\t}\n\n\treturn earliestMatch;\n}\n\nexport function gemma4ParseGeneratedText(text: string, _tools: Tool[], _options?: ParserOptions): ParsedToolCall[] {\n\tconst parsedToolCalls: ParsedToolCall[] = [];\n\n\tfor (const match of extractToolCalls(text)) {\n\t\tconst [, name, rawArgs] = match;\n\t\tif (!name || rawArgs === undefined) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tparsedToolCalls.push({\n\t\t\tname,\n\t\t\targuments: parseGemma4Args(rawArgs),\n\t\t});\n\t}\n\n\treturn parsedToolCalls;\n}\n\nclass Gemma4StreamParser implements StreamParser {\n\tprivate readonly toolCallIds: string[] = [];\n\n\tprivate plainTextCarry = \"\";\n\tprivate toolCallCarry = \"\";\n\tprivate insideToolCall = false;\n\tprivate toolCallContent = \"\";\n\tprivate currentToolIndex = -1;\n\tprivate currentToolName: string | null = null;\n\tprivate currentArgumentsJson = \"\";\n\n\tfeed(textDelta: string): StreamParserEvent[] {\n\t\tconst events: StreamParserEvent[] = [];\n\t\tlet remaining = textDelta;\n\n\t\twhile (remaining.length > 0) {\n\t\t\tif (!this.insideToolCall) {\n\t\t\t\tconst combinedText = this.plainTextCarry + remaining;\n\t\t\t\tconst startIndex = combinedText.indexOf(TOOL_CALL_START);\n\n\t\t\t\tif (startIndex === -1) {\n\t\t\t\t\tconst partialSuffix = getPartialTokenSuffix(combinedText, [TOOL_CALL_START]);\n\t\t\t\t\tconst flushableText = partialSuffix ? combinedText.slice(0, -partialSuffix.length) : combinedText;\n\n\t\t\t\t\tif (flushableText) {\n\t\t\t\t\t\tevents.push({ type: \"text\", text: flushableText });\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.plainTextCarry = partialSuffix;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tconst textBeforeToolCall = combinedText.slice(0, startIndex);\n\t\t\t\tif (textBeforeToolCall) {\n\t\t\t\t\tevents.push({ type: \"text\", text: textBeforeToolCall });\n\t\t\t\t}\n\n\t\t\t\tconst afterStart = combinedText.slice(startIndex + TOOL_CALL_START.length);\n\t\t\t\tthis.plainTextCarry = \"\";\n\t\t\t\tthis.insideToolCall = true;\n\t\t\t\tthis.toolCallContent = \"\";\n\t\t\t\tthis.toolCallCarry = \"\";\n\t\t\t\tthis.currentToolIndex += 1;\n\t\t\t\tthis.currentToolName = null;\n\t\t\t\tthis.currentArgumentsJson = \"\";\n\t\t\t\tthis.toolCallIds[this.currentToolIndex] = `gemma4-tool-${this.currentToolIndex}`;\n\t\t\t\tremaining = afterStart;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst combinedToolCall = this.toolCallCarry + remaining;\n\t\t\tconst endMatch = findEarliestToken(combinedToolCall, [TOOL_CALL_END, TURN_END]);\n\n\t\t\tif (!endMatch) {\n\t\t\t\tconst partialSuffix = getPartialTokenSuffix(combinedToolCall, [TOOL_CALL_END, TURN_END]);\n\t\t\t\tconst flushableContent = partialSuffix\n\t\t\t\t\t? combinedToolCall.slice(0, -partialSuffix.length)\n\t\t\t\t\t: combinedToolCall;\n\n\t\t\t\tthis.toolCallCarry = partialSuffix;\n\t\t\t\tif (flushableContent) {\n\t\t\t\t\tthis.toolCallContent += flushableContent;\n\t\t\t\t\tthis.emitPartialToolCall(events);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst contentBeforeEnd = combinedToolCall.slice(0, endMatch.index);\n\t\t\tthis.toolCallContent += contentBeforeEnd;\n\t\t\tthis.toolCallCarry = \"\";\n\t\t\tthis.emitPartialToolCall(events);\n\t\t\tthis.emitCompletedToolCall(events);\n\n\t\t\tthis.insideToolCall = false;\n\t\t\tthis.toolCallContent = \"\";\n\t\t\tthis.currentToolName = null;\n\t\t\tthis.currentArgumentsJson = \"\";\n\t\t\tremaining = combinedToolCall.slice(endMatch.index + endMatch.token.length);\n\t\t}\n\n\t\treturn events;\n\t}\n\n\tfinish(): StreamParserEvent[] {\n\t\tconst events: StreamParserEvent[] = [];\n\n\t\tif (!this.insideToolCall && this.plainTextCarry) {\n\t\t\tevents.push({ type: \"text\", text: this.plainTextCarry });\n\t\t}\n\n\t\tif (this.insideToolCall) {\n\t\t\tconst unfinishedToolCall = TOOL_CALL_START + this.toolCallContent + this.toolCallCarry;\n\t\t\tif (unfinishedToolCall) {\n\t\t\t\tevents.push({ type: \"text\", text: unfinishedToolCall });\n\t\t\t}\n\t\t}\n\n\t\tthis.plainTextCarry = \"\";\n\t\tthis.toolCallCarry = \"\";\n\t\tthis.insideToolCall = false;\n\t\tthis.toolCallContent = \"\";\n\t\tthis.currentToolName = null;\n\t\tthis.currentArgumentsJson = \"\";\n\n\t\treturn events;\n\t}\n\n\tprivate emitPartialToolCall(events: StreamParserEvent[]): void {\n\t\tconst { name, rawArgs } = extractPartialToolCall(this.toolCallContent);\n\t\tif (!name) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.currentToolName) {\n\t\t\tthis.currentToolName = name;\n\t\t\tevents.push({\n\t\t\t\ttype: \"toolcall_start\",\n\t\t\t\tindex: this.currentToolIndex,\n\t\t\t\tname,\n\t\t\t\tid: this.toolCallIds[this.currentToolIndex] ?? `gemma4-tool-${this.currentToolIndex}`,\n\t\t\t});\n\t\t}\n\n\t\tif (!rawArgs) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst parsedArguments = parseGemma4Args(rawArgs, true);\n\t\tif (Object.keys(parsedArguments).length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentArgumentsJson = JSON.stringify(parsedArguments);\n\t\tconst safeArgumentsJson = stripTrailingUnsafeCharacters(currentArgumentsJson);\n\t\tif (!safeArgumentsJson || safeArgumentsJson === this.currentArgumentsJson) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.currentArgumentsJson) {\n\t\t\tconst commonPrefix = findCommonPrefix(this.currentArgumentsJson, safeArgumentsJson);\n\t\t\tif (commonPrefix.length < this.currentArgumentsJson.length) {\n\t\t\t\tthis.currentArgumentsJson = commonPrefix;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tconst argumentsDelta = safeArgumentsJson.slice(this.currentArgumentsJson.length);\n\t\tif (!argumentsDelta) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.currentArgumentsJson = safeArgumentsJson;\n\t\tevents.push({\n\t\t\ttype: \"toolcall_delta\",\n\t\t\tindex: this.currentToolIndex,\n\t\t\targumentsDelta,\n\t\t});\n\t}\n\n\tprivate emitCompletedToolCall(events: StreamParserEvent[]): void {\n\t\tconst { name, rawArgs } = extractPartialToolCall(this.toolCallContent);\n\t\tif (!name) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.currentToolName) {\n\t\t\tthis.currentToolName = name;\n\t\t\tevents.push({\n\t\t\t\ttype: \"toolcall_start\",\n\t\t\t\tindex: this.currentToolIndex,\n\t\t\t\tname,\n\t\t\t\tid: this.toolCallIds[this.currentToolIndex] ?? `gemma4-tool-${this.currentToolIndex}`,\n\t\t\t});\n\t\t}\n\n\t\tconst argumentsObject = parseGemma4Args(rawArgs);\n\t\tconst argumentsJson = JSON.stringify(argumentsObject);\n\t\tconst finalDelta = argumentsJson.slice(this.currentArgumentsJson.length);\n\t\tif (finalDelta) {\n\t\t\tevents.push({\n\t\t\t\ttype: \"toolcall_delta\",\n\t\t\t\tindex: this.currentToolIndex,\n\t\t\t\targumentsDelta: finalDelta,\n\t\t\t});\n\t\t}\n\n\t\tevents.push({\n\t\t\ttype: \"toolcall_end\",\n\t\t\tindex: this.currentToolIndex,\n\t\t\tname,\n\t\t\tid: this.toolCallIds[this.currentToolIndex] ?? `gemma4-tool-${this.currentToolIndex}`,\n\t\t\targuments: argumentsObject,\n\t\t});\n\t}\n}\n\nexport function gemma4CreateStreamParser(_tools: Tool[], _options?: ParserOptions): StreamParser {\n\treturn new Gemma4StreamParser();\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ImageContent, TextContent, Tool } from "../../types.ts";
|
|
2
|
+
import type { ParsedToolCall, ParserOptions, StreamParser } from "../types.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Generates Hermes-style system prompt with tool definitions.
|
|
5
|
+
* Tools are rendered inside <tools></tools> XML tags.
|
|
6
|
+
* Includes pydantic model schema and tool call usage instructions.
|
|
7
|
+
*/
|
|
8
|
+
export declare function hermesFormatToolsSystemPrompt(tools: Tool[]): string;
|
|
9
|
+
/**
|
|
10
|
+
* Formats a tool response for Hermes protocol.
|
|
11
|
+
* Format: <tool_response>{"name":"toolName","content":"..."}</tool_response>
|
|
12
|
+
*/
|
|
13
|
+
export declare function hermesFormatToolResponse(toolName: string, _toolCallId: string, content: (TextContent | ImageContent)[]): string;
|
|
14
|
+
/**
|
|
15
|
+
* Formats a tool call for Hermes protocol.
|
|
16
|
+
* Format: <tool_call>\n{"name":"name","arguments":{...}}\n</tool_call>
|
|
17
|
+
*/
|
|
18
|
+
export declare function hermesFormatToolCall(name: string, args: Record<string, unknown>): string;
|
|
19
|
+
export declare function hermesParseGeneratedText(text: string, tools: Tool[], options?: ParserOptions): ParsedToolCall[];
|
|
20
|
+
export declare function hermesCreateStreamParser(tools: Tool[], options?: ParserOptions): StreamParser;
|
|
21
|
+
//# sourceMappingURL=hermes.d.ts.map
|