@radheim/ai 0.0.0-stage → 2.4.3
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/README.md +1890 -3
- package/dist/ai.d.ts +36 -0
- package/dist/ai.js +46 -0
- package/dist/cache-policy.d.ts +6 -0
- package/dist/cache-policy.js +205 -0
- package/dist/decision-client.d.ts +10 -0
- package/dist/decision-client.js +42 -0
- package/dist/decision.d.ts +378 -0
- package/dist/decision.js +171 -0
- package/dist/effect.d.ts +59 -0
- package/dist/effect.js +33 -0
- package/dist/effort-updates.d.ts +12 -0
- package/dist/effort-updates.js +23 -0
- package/dist/embedding-client.d.ts +10 -0
- package/dist/embedding-client.js +17 -0
- package/dist/embedding.d.ts +113 -0
- package/dist/embedding.js +76 -0
- package/dist/experimental/cloudflare-run-extraction.d.ts +17 -0
- package/dist/experimental/cloudflare-run-extraction.js +85 -0
- package/dist/experimental/extraction.d.ts +153 -0
- package/dist/experimental/extraction.js +103 -0
- package/dist/experimental/realtime.d.ts +80 -0
- package/dist/experimental/realtime.js +96 -0
- package/dist/experimental.d.ts +10 -0
- package/dist/experimental.js +6 -0
- package/dist/fetch-middleware.d.ts +7 -0
- package/dist/fetch-middleware.js +41 -0
- package/dist/generation.d.ts +77 -0
- package/dist/generation.js +109 -0
- package/dist/image-client.d.ts +14 -0
- package/dist/image-client.js +39 -0
- package/dist/image.d.ts +323 -0
- package/dist/image.js +103 -0
- package/dist/index.d.ts +300 -0
- package/dist/index.js +179 -0
- package/dist/llm.d.ts +109 -0
- package/dist/llm.js +177 -0
- package/dist/loop.d.ts +38 -0
- package/dist/loop.js +139 -0
- package/dist/media-client.d.ts +30 -0
- package/dist/media-client.js +44 -0
- package/dist/media-model.d.ts +49 -0
- package/dist/media-model.js +55 -0
- package/dist/media.d.ts +237 -0
- package/dist/media.js +285 -0
- package/dist/promise-media.d.ts +20 -0
- package/dist/promise-media.js +16 -0
- package/dist/protocols/alibaba-chat.d.ts +315 -0
- package/dist/protocols/alibaba-chat.js +78 -0
- package/dist/protocols/alibaba-images.d.ts +22 -0
- package/dist/protocols/alibaba-images.js +77 -0
- package/dist/protocols/alibaba-messages.d.ts +413 -0
- package/dist/protocols/alibaba-messages.js +44 -0
- package/dist/protocols/alibaba-responses.d.ts +298 -0
- package/dist/protocols/alibaba-responses.js +67 -0
- package/dist/protocols/anthropic-messages.d.ts +1213 -0
- package/dist/protocols/anthropic-messages.js +1412 -0
- package/dist/protocols/assemblyai-transcription.d.ts +41 -0
- package/dist/protocols/assemblyai-transcription.js +137 -0
- package/dist/protocols/bedrock-converse.d.ts +548 -0
- package/dist/protocols/bedrock-converse.js +801 -0
- package/dist/protocols/bedrock-event-stream.d.ts +14 -0
- package/dist/protocols/bedrock-event-stream.js +100 -0
- package/dist/protocols/cartesia-speech.d.ts +117 -0
- package/dist/protocols/cartesia-speech.js +120 -0
- package/dist/protocols/cloudflare-run-decisions.d.ts +9 -0
- package/dist/protocols/cloudflare-run-decisions.js +36 -0
- package/dist/protocols/cloudflare-workers-ai-images.d.ts +23 -0
- package/dist/protocols/cloudflare-workers-ai-images.js +80 -0
- package/dist/protocols/cohere-chat.d.ts +184 -0
- package/dist/protocols/cohere-chat.js +317 -0
- package/dist/protocols/deepgram-speech.d.ts +109 -0
- package/dist/protocols/deepgram-speech.js +93 -0
- package/dist/protocols/deepgram-transcription.d.ts +26 -0
- package/dist/protocols/deepgram-transcription.js +119 -0
- package/dist/protocols/elevenlabs-speech.d.ts +112 -0
- package/dist/protocols/elevenlabs-speech.js +111 -0
- package/dist/protocols/elevenlabs-transcription.d.ts +28 -0
- package/dist/protocols/elevenlabs-transcription.js +137 -0
- package/dist/protocols/gemini.d.ts +388 -0
- package/dist/protocols/gemini.js +741 -0
- package/dist/protocols/google-decisions.d.ts +13 -0
- package/dist/protocols/google-decisions.js +133 -0
- package/dist/protocols/google-embed-content.d.ts +34 -0
- package/dist/protocols/google-embed-content.js +110 -0
- package/dist/protocols/google-images.d.ts +18 -0
- package/dist/protocols/google-images.js +169 -0
- package/dist/protocols/google-interactions-video.d.ts +38 -0
- package/dist/protocols/google-interactions-video.js +185 -0
- package/dist/protocols/google-interactions.d.ts +554 -0
- package/dist/protocols/google-interactions.js +756 -0
- package/dist/protocols/google-speech.d.ts +120 -0
- package/dist/protocols/google-speech.js +94 -0
- package/dist/protocols/google-transcription.d.ts +148 -0
- package/dist/protocols/google-transcription.js +129 -0
- package/dist/protocols/google-vertex-predict-embeddings.d.ts +18 -0
- package/dist/protocols/google-vertex-predict-embeddings.js +74 -0
- package/dist/protocols/index.d.ts +21 -0
- package/dist/protocols/index.js +21 -0
- package/dist/protocols/meta-images.d.ts +26 -0
- package/dist/protocols/meta-images.js +101 -0
- package/dist/protocols/meta-messages.d.ts +423 -0
- package/dist/protocols/meta-messages.js +63 -0
- package/dist/protocols/meta-responses.d.ts +533 -0
- package/dist/protocols/meta-responses.js +189 -0
- package/dist/protocols/minimax-images.d.ts +25 -0
- package/dist/protocols/minimax-images.js +150 -0
- package/dist/protocols/minimax-video.d.ts +45 -0
- package/dist/protocols/minimax-video.js +296 -0
- package/dist/protocols/mistral-chat.d.ts +565 -0
- package/dist/protocols/mistral-chat.js +606 -0
- package/dist/protocols/open-responses-channel.d.ts +25 -0
- package/dist/protocols/open-responses-channel.js +137 -0
- package/dist/protocols/open-responses-continuation.d.ts +18 -0
- package/dist/protocols/open-responses-continuation.js +172 -0
- package/dist/protocols/open-responses.d.ts +2509 -0
- package/dist/protocols/open-responses.js +1335 -0
- package/dist/protocols/openai-chat.d.ts +2571 -0
- package/dist/protocols/openai-chat.js +1140 -0
- package/dist/protocols/openai-compatible-chat.d.ts +184 -0
- package/dist/protocols/openai-compatible-chat.js +19 -0
- package/dist/protocols/openai-compatible-responses.d.ts +231 -0
- package/dist/protocols/openai-compatible-responses.js +18 -0
- package/dist/protocols/openai-decisions.d.ts +22 -0
- package/dist/protocols/openai-decisions.js +141 -0
- package/dist/protocols/openai-embeddings.d.ts +16 -0
- package/dist/protocols/openai-embeddings.js +76 -0
- package/dist/protocols/openai-freeform.d.ts +78 -0
- package/dist/protocols/openai-freeform.js +222 -0
- package/dist/protocols/openai-images.d.ts +148 -0
- package/dist/protocols/openai-images.js +303 -0
- package/dist/protocols/openai-responses.d.ts +1600 -0
- package/dist/protocols/openai-responses.js +360 -0
- package/dist/protocols/openai-speech.d.ts +110 -0
- package/dist/protocols/openai-speech.js +112 -0
- package/dist/protocols/openai-transcription.d.ts +185 -0
- package/dist/protocols/openai-transcription.js +206 -0
- package/dist/protocols/openrouter-video.d.ts +36 -0
- package/dist/protocols/openrouter-video.js +139 -0
- package/dist/protocols/seedance-video.d.ts +45 -0
- package/dist/protocols/seedance-video.js +217 -0
- package/dist/protocols/shared.d.ts +249 -0
- package/dist/protocols/shared.js +446 -0
- package/dist/protocols/system-one.d.ts +145 -0
- package/dist/protocols/system-one.js +272 -0
- package/dist/protocols/utils/bedrock-auth.d.ts +60 -0
- package/dist/protocols/utils/bedrock-auth.js +86 -0
- package/dist/protocols/utils/bedrock-cache.d.ts +19 -0
- package/dist/protocols/utils/bedrock-cache.js +49 -0
- package/dist/protocols/utils/bedrock-media.d.ts +53 -0
- package/dist/protocols/utils/bedrock-media.js +98 -0
- package/dist/protocols/utils/cache.d.ts +25 -0
- package/dist/protocols/utils/cache.js +33 -0
- package/dist/protocols/utils/claude-model.d.ts +8 -0
- package/dist/protocols/utils/claude-model.js +15 -0
- package/dist/protocols/utils/gateway-protocol.d.ts +17 -0
- package/dist/protocols/utils/gateway-protocol.js +59 -0
- package/dist/protocols/utils/gemini-generate-content.d.ts +75 -0
- package/dist/protocols/utils/gemini-generate-content.js +96 -0
- package/dist/protocols/utils/gemini-json-schema.d.ts +8 -0
- package/dist/protocols/utils/gemini-json-schema.js +76 -0
- package/dist/protocols/utils/image-sizing.d.ts +31 -0
- package/dist/protocols/utils/image-sizing.js +73 -0
- package/dist/protocols/utils/lifecycle.d.ts +24 -0
- package/dist/protocols/utils/lifecycle.js +62 -0
- package/dist/protocols/utils/media-input.d.ts +32 -0
- package/dist/protocols/utils/media-input.js +62 -0
- package/dist/protocols/utils/mistral-tool-id.d.ts +5 -0
- package/dist/protocols/utils/mistral-tool-id.js +31 -0
- package/dist/protocols/utils/open-responses-options.d.ts +54 -0
- package/dist/protocols/utils/open-responses-options.js +59 -0
- package/dist/protocols/utils/partial-json-options.d.ts +61 -0
- package/dist/protocols/utils/partial-json-options.js +51 -0
- package/dist/protocols/utils/partial-json.d.ts +8 -0
- package/dist/protocols/utils/partial-json.js +280 -0
- package/dist/protocols/utils/responses-checkpoint.d.ts +4 -0
- package/dist/protocols/utils/responses-checkpoint.js +103 -0
- package/dist/protocols/utils/responses-compaction.d.ts +6 -0
- package/dist/protocols/utils/responses-compaction.js +162 -0
- package/dist/protocols/utils/responses-hosted-tools.d.ts +122 -0
- package/dist/protocols/utils/responses-hosted-tools.js +63 -0
- package/dist/protocols/utils/speaker-turns.d.ts +3 -0
- package/dist/protocols/utils/speaker-turns.js +9 -0
- package/dist/protocols/utils/speech-stream.d.ts +49 -0
- package/dist/protocols/utils/speech-stream.js +64 -0
- package/dist/protocols/utils/tool-schema.d.ts +10 -0
- package/dist/protocols/utils/tool-schema.js +109 -0
- package/dist/protocols/utils/tool-stream.d.ts +478 -0
- package/dist/protocols/utils/tool-stream.js +153 -0
- package/dist/protocols/venice-chat.d.ts +340 -0
- package/dist/protocols/venice-chat.js +283 -0
- package/dist/protocols/xai-images.d.ts +25 -0
- package/dist/protocols/xai-images.js +87 -0
- package/dist/protocols/xai-responses.d.ts +294 -0
- package/dist/protocols/xai-responses.js +86 -0
- package/dist/protocols/xai-video.d.ts +35 -0
- package/dist/protocols/xai-video.js +159 -0
- package/dist/protocols/zai-chat.d.ts +296 -0
- package/dist/protocols/zai-chat.js +56 -0
- package/dist/protocols/zai-images.d.ts +20 -0
- package/dist/protocols/zai-images.js +79 -0
- package/dist/protocols/zai-messages.d.ts +409 -0
- package/dist/protocols/zai-messages.js +30 -0
- package/dist/protocols.d.ts +1 -0
- package/dist/protocols.js +1 -0
- package/dist/provider-error.d.ts +22 -0
- package/dist/provider-error.js +228 -0
- package/dist/provider-package.d.ts +17 -0
- package/dist/provider-package.js +1 -0
- package/dist/providers/alibaba/chat.d.ts +1 -0
- package/dist/providers/alibaba/chat.js +1 -0
- package/dist/providers/alibaba/embeddings.d.ts +2 -0
- package/dist/providers/alibaba/embeddings.js +1 -0
- package/dist/providers/alibaba/images.d.ts +2 -0
- package/dist/providers/alibaba/images.js +1 -0
- package/dist/providers/alibaba/messages.d.ts +3 -0
- package/dist/providers/alibaba/messages.js +1 -0
- package/dist/providers/alibaba/responses.d.ts +3 -0
- package/dist/providers/alibaba/responses.js +1 -0
- package/dist/providers/alibaba.d.ts +905 -0
- package/dist/providers/alibaba.js +119 -0
- package/dist/providers/amazon-bedrock/mantle/chat.d.ts +2 -0
- package/dist/providers/amazon-bedrock/mantle/chat.js +1 -0
- package/dist/providers/amazon-bedrock/mantle/messages.d.ts +2 -0
- package/dist/providers/amazon-bedrock/mantle/messages.js +1 -0
- package/dist/providers/amazon-bedrock/mantle/responses.d.ts +2 -0
- package/dist/providers/amazon-bedrock/mantle/responses.js +1 -0
- package/dist/providers/amazon-bedrock/mantle.d.ts +2 -0
- package/dist/providers/amazon-bedrock/mantle.js +1 -0
- package/dist/providers/amazon-bedrock-mantle.d.ts +789 -0
- package/dist/providers/amazon-bedrock-mantle.js +107 -0
- package/dist/providers/amazon-bedrock.d.ts +190 -0
- package/dist/providers/amazon-bedrock.js +44 -0
- package/dist/providers/anthropic-compatible.d.ts +364 -0
- package/dist/providers/anthropic-compatible.js +47 -0
- package/dist/providers/anthropic.d.ts +362 -0
- package/dist/providers/anthropic.js +36 -0
- package/dist/providers/assemblyai.d.ts +19 -0
- package/dist/providers/assemblyai.js +19 -0
- package/dist/providers/azure/chat.d.ts +2 -0
- package/dist/providers/azure/chat.js +1 -0
- package/dist/providers/azure/embeddings.d.ts +2 -0
- package/dist/providers/azure/embeddings.js +1 -0
- package/dist/providers/azure/images.d.ts +2 -0
- package/dist/providers/azure/images.js +1 -0
- package/dist/providers/azure/messages.d.ts +2 -0
- package/dist/providers/azure/messages.js +1 -0
- package/dist/providers/azure/responses.d.ts +2 -0
- package/dist/providers/azure/responses.js +1 -0
- package/dist/providers/azure.d.ts +1074 -0
- package/dist/providers/azure.js +150 -0
- package/dist/providers/baseten/decisions.d.ts +2 -0
- package/dist/providers/baseten/decisions.js +1 -0
- package/dist/providers/baseten.d.ts +384 -0
- package/dist/providers/baseten.js +56 -0
- package/dist/providers/byteplus/videos.d.ts +2 -0
- package/dist/providers/byteplus/videos.js +1 -0
- package/dist/providers/byteplus.d.ts +24 -0
- package/dist/providers/byteplus.js +21 -0
- package/dist/providers/cartesia.d.ts +18 -0
- package/dist/providers/cartesia.js +17 -0
- package/dist/providers/cerebras.d.ts +375 -0
- package/dist/providers/cerebras.js +33 -0
- package/dist/providers/cloudflare-ai-gateway/decisions.d.ts +2 -0
- package/dist/providers/cloudflare-ai-gateway/decisions.js +1 -0
- package/dist/providers/cloudflare-ai-gateway.d.ts +1581 -0
- package/dist/providers/cloudflare-ai-gateway.js +120 -0
- package/dist/providers/cloudflare-shared.d.ts +9 -0
- package/dist/providers/cloudflare-shared.js +25 -0
- package/dist/providers/cloudflare-workers-ai/decisions.d.ts +2 -0
- package/dist/providers/cloudflare-workers-ai/decisions.js +1 -0
- package/dist/providers/cloudflare-workers-ai/images.d.ts +2 -0
- package/dist/providers/cloudflare-workers-ai/images.js +1 -0
- package/dist/providers/cloudflare-workers-ai.d.ts +391 -0
- package/dist/providers/cloudflare-workers-ai.js +69 -0
- package/dist/providers/cohere/chat.d.ts +4 -0
- package/dist/providers/cohere/chat.js +3 -0
- package/dist/providers/cohere/embeddings.d.ts +2 -0
- package/dist/providers/cohere/embeddings.js +1 -0
- package/dist/providers/cohere.d.ts +502 -0
- package/dist/providers/cohere.js +55 -0
- package/dist/providers/deepgram.d.ts +22 -0
- package/dist/providers/deepgram.js +20 -0
- package/dist/providers/deepinfra/embeddings.d.ts +2 -0
- package/dist/providers/deepinfra/embeddings.js +1 -0
- package/dist/providers/deepinfra.d.ts +378 -0
- package/dist/providers/deepinfra.js +52 -0
- package/dist/providers/deepseek.d.ts +376 -0
- package/dist/providers/deepseek.js +30 -0
- package/dist/providers/digitalocean/decisions.d.ts +2 -0
- package/dist/providers/digitalocean/decisions.js +1 -0
- package/dist/providers/digitalocean/embeddings.d.ts +2 -0
- package/dist/providers/digitalocean/embeddings.js +1 -0
- package/dist/providers/digitalocean/images.d.ts +2 -0
- package/dist/providers/digitalocean/images.js +1 -0
- package/dist/providers/digitalocean/responses.d.ts +4 -0
- package/dist/providers/digitalocean/responses.js +1 -0
- package/dist/providers/digitalocean.d.ts +874 -0
- package/dist/providers/digitalocean.js +106 -0
- package/dist/providers/elevenlabs.d.ts +22 -0
- package/dist/providers/elevenlabs.js +22 -0
- package/dist/providers/fireworks/embeddings.d.ts +2 -0
- package/dist/providers/fireworks/embeddings.js +1 -0
- package/dist/providers/fireworks.d.ts +379 -0
- package/dist/providers/fireworks.js +40 -0
- package/dist/providers/google/decisions.d.ts +2 -0
- package/dist/providers/google/decisions.js +1 -0
- package/dist/providers/google/embeddings.d.ts +2 -0
- package/dist/providers/google/embeddings.js +1 -0
- package/dist/providers/google/images.d.ts +2 -0
- package/dist/providers/google/images.js +1 -0
- package/dist/providers/google/interactions.d.ts +7 -0
- package/dist/providers/google/interactions.js +3 -0
- package/dist/providers/google/videos.d.ts +2 -0
- package/dist/providers/google/videos.js +1 -0
- package/dist/providers/google-vertex/chat.d.ts +2 -0
- package/dist/providers/google-vertex/chat.js +1 -0
- package/dist/providers/google-vertex/embeddings.d.ts +2 -0
- package/dist/providers/google-vertex/embeddings.js +1 -0
- package/dist/providers/google-vertex/gemini.d.ts +2 -0
- package/dist/providers/google-vertex/gemini.js +1 -0
- package/dist/providers/google-vertex/images.d.ts +2 -0
- package/dist/providers/google-vertex/images.js +1 -0
- package/dist/providers/google-vertex/interactions.d.ts +2 -0
- package/dist/providers/google-vertex/interactions.js +1 -0
- package/dist/providers/google-vertex/messages.d.ts +2 -0
- package/dist/providers/google-vertex/messages.js +1 -0
- package/dist/providers/google-vertex/mistral.d.ts +2 -0
- package/dist/providers/google-vertex/mistral.js +1 -0
- package/dist/providers/google-vertex/responses.d.ts +2 -0
- package/dist/providers/google-vertex/responses.js +1 -0
- package/dist/providers/google-vertex-chat.d.ts +204 -0
- package/dist/providers/google-vertex-chat.js +29 -0
- package/dist/providers/google-vertex-interactions.d.ts +111 -0
- package/dist/providers/google-vertex-interactions.js +62 -0
- package/dist/providers/google-vertex-messages.d.ts +362 -0
- package/dist/providers/google-vertex-messages.js +51 -0
- package/dist/providers/google-vertex-mistral.d.ts +120 -0
- package/dist/providers/google-vertex-mistral.js +43 -0
- package/dist/providers/google-vertex-responses.d.ts +253 -0
- package/dist/providers/google-vertex-responses.js +30 -0
- package/dist/providers/google-vertex-shared.d.ts +58 -0
- package/dist/providers/google-vertex-shared.js +128 -0
- package/dist/providers/google-vertex.d.ts +132 -0
- package/dist/providers/google-vertex.js +161 -0
- package/dist/providers/google.d.ts +246 -0
- package/dist/providers/google.js +80 -0
- package/dist/providers/groq.d.ts +470 -0
- package/dist/providers/groq.js +63 -0
- package/dist/providers/index.d.ts +45 -0
- package/dist/providers/index.js +45 -0
- package/dist/providers/meta/chat.d.ts +2 -0
- package/dist/providers/meta/chat.js +1 -0
- package/dist/providers/meta/images.d.ts +2 -0
- package/dist/providers/meta/images.js +1 -0
- package/dist/providers/meta/messages.d.ts +2 -0
- package/dist/providers/meta/messages.js +1 -0
- package/dist/providers/meta/responses.d.ts +2 -0
- package/dist/providers/meta/responses.js +1 -0
- package/dist/providers/meta.d.ts +804 -0
- package/dist/providers/meta.js +96 -0
- package/dist/providers/minimax/chat.d.ts +4 -0
- package/dist/providers/minimax/chat.js +3 -0
- package/dist/providers/minimax/images.d.ts +3 -0
- package/dist/providers/minimax/images.js +1 -0
- package/dist/providers/minimax/messages.d.ts +1 -0
- package/dist/providers/minimax/messages.js +1 -0
- package/dist/providers/minimax/responses.d.ts +4 -0
- package/dist/providers/minimax/responses.js +3 -0
- package/dist/providers/minimax/videos.d.ts +3 -0
- package/dist/providers/minimax/videos.js +1 -0
- package/dist/providers/minimax.d.ts +798 -0
- package/dist/providers/minimax.js +99 -0
- package/dist/providers/mistral.d.ts +208 -0
- package/dist/providers/mistral.js +17 -0
- package/dist/providers/moonshot/chat.d.ts +1 -0
- package/dist/providers/moonshot/chat.js +1 -0
- package/dist/providers/moonshot/messages.d.ts +4 -0
- package/dist/providers/moonshot/messages.js +3 -0
- package/dist/providers/moonshot/responses.d.ts +4 -0
- package/dist/providers/moonshot/responses.js +3 -0
- package/dist/providers/moonshot.d.ts +785 -0
- package/dist/providers/moonshot.js +78 -0
- package/dist/providers/open-responses-options.d.ts +5 -0
- package/dist/providers/open-responses-options.js +1 -0
- package/dist/providers/openai/chat.d.ts +2 -0
- package/dist/providers/openai/chat.js +1 -0
- package/dist/providers/openai/embeddings.d.ts +2 -0
- package/dist/providers/openai/embeddings.js +1 -0
- package/dist/providers/openai/images.d.ts +2 -0
- package/dist/providers/openai/images.js +1 -0
- package/dist/providers/openai/responses.d.ts +2 -0
- package/dist/providers/openai/responses.js +1 -0
- package/dist/providers/openai-compatible/decisions.d.ts +2 -0
- package/dist/providers/openai-compatible/decisions.js +1 -0
- package/dist/providers/openai-compatible/embeddings.d.ts +2 -0
- package/dist/providers/openai-compatible/embeddings.js +1 -0
- package/dist/providers/openai-compatible/images.d.ts +2 -0
- package/dist/providers/openai-compatible/images.js +1 -0
- package/dist/providers/openai-compatible/responses.d.ts +1 -0
- package/dist/providers/openai-compatible/responses.js +1 -0
- package/dist/providers/openai-compatible-responses.d.ts +250 -0
- package/dist/providers/openai-compatible-responses.js +26 -0
- package/dist/providers/openai-compatible.d.ts +208 -0
- package/dist/providers/openai-compatible.js +71 -0
- package/dist/providers/openai-options.d.ts +21 -0
- package/dist/providers/openai-options.js +37 -0
- package/dist/providers/openai.d.ts +522 -0
- package/dist/providers/openai.js +118 -0
- package/dist/providers/opencode/decisions.d.ts +2 -0
- package/dist/providers/opencode/decisions.js +1 -0
- package/dist/providers/opencode.d.ts +23 -0
- package/dist/providers/opencode.js +25 -0
- package/dist/providers/openrouter/decisions.d.ts +2 -0
- package/dist/providers/openrouter/decisions.js +1 -0
- package/dist/providers/openrouter/embeddings.d.ts +2 -0
- package/dist/providers/openrouter/embeddings.js +1 -0
- package/dist/providers/openrouter/images.d.ts +2 -0
- package/dist/providers/openrouter/images.js +1 -0
- package/dist/providers/openrouter/responses.d.ts +3 -0
- package/dist/providers/openrouter/responses.js +1 -0
- package/dist/providers/openrouter/videos.d.ts +2 -0
- package/dist/providers/openrouter/videos.js +1 -0
- package/dist/providers/openrouter.d.ts +1204 -0
- package/dist/providers/openrouter.js +210 -0
- package/dist/providers/settings.d.ts +40 -0
- package/dist/providers/settings.js +18 -0
- package/dist/providers/togetherai.d.ts +375 -0
- package/dist/providers/togetherai.js +30 -0
- package/dist/providers/typesafe-ai/decisions.d.ts +2 -0
- package/dist/providers/typesafe-ai/decisions.js +1 -0
- package/dist/providers/typesafe-ai.d.ts +23 -0
- package/dist/providers/typesafe-ai.js +25 -0
- package/dist/providers/venice/responses.d.ts +4 -0
- package/dist/providers/venice/responses.js +1 -0
- package/dist/providers/venice.d.ts +632 -0
- package/dist/providers/venice.js +57 -0
- package/dist/providers/vercel-ai-gateway/chat.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/chat.js +1 -0
- package/dist/providers/vercel-ai-gateway/decisions.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/decisions.js +1 -0
- package/dist/providers/vercel-ai-gateway/embeddings.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/embeddings.js +1 -0
- package/dist/providers/vercel-ai-gateway/images.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/images.js +1 -0
- package/dist/providers/vercel-ai-gateway/messages.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/messages.js +1 -0
- package/dist/providers/vercel-ai-gateway/responses.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/responses.js +1 -0
- package/dist/providers/vercel-ai-gateway.d.ts +111 -0
- package/dist/providers/vercel-ai-gateway.js +181 -0
- package/dist/providers/volcengine/videos.d.ts +2 -0
- package/dist/providers/volcengine/videos.js +1 -0
- package/dist/providers/volcengine.d.ts +24 -0
- package/dist/providers/volcengine.js +21 -0
- package/dist/providers/xai/images.d.ts +2 -0
- package/dist/providers/xai/images.js +1 -0
- package/dist/providers/xai/videos.d.ts +2 -0
- package/dist/providers/xai/videos.js +1 -0
- package/dist/providers/xai.d.ts +235 -0
- package/dist/providers/xai.js +89 -0
- package/dist/providers/zai/chat.d.ts +1 -0
- package/dist/providers/zai/chat.js +1 -0
- package/dist/providers/zai/images.d.ts +2 -0
- package/dist/providers/zai/images.js +1 -0
- package/dist/providers/zai-coding-plan/chat.d.ts +1 -0
- package/dist/providers/zai-coding-plan/chat.js +1 -0
- package/dist/providers/zai-coding-plan/messages.d.ts +4 -0
- package/dist/providers/zai-coding-plan/messages.js +3 -0
- package/dist/providers/zai-coding-plan/responses.d.ts +4 -0
- package/dist/providers/zai-coding-plan/responses.js +3 -0
- package/dist/providers/zai-coding-plan.d.ts +846 -0
- package/dist/providers/zai-coding-plan.js +56 -0
- package/dist/providers/zai.d.ts +285 -0
- package/dist/providers/zai.js +44 -0
- package/dist/providers.d.ts +1 -0
- package/dist/providers.js +1 -0
- package/dist/public.d.ts +18 -0
- package/dist/public.js +7 -0
- package/dist/route/auth-options.d.ts +35 -0
- package/dist/route/auth-options.js +17 -0
- package/dist/route/auth.d.ts +52 -0
- package/dist/route/auth.js +92 -0
- package/dist/route/client.d.ts +229 -0
- package/dist/route/client.js +293 -0
- package/dist/route/decision.d.ts +55 -0
- package/dist/route/decision.js +73 -0
- package/dist/route/embedding.d.ts +58 -0
- package/dist/route/embedding.js +85 -0
- package/dist/route/endpoint.d.ts +29 -0
- package/dist/route/endpoint.js +21 -0
- package/dist/route/executor-service.d.ts +54 -0
- package/dist/route/executor-service.js +115 -0
- package/dist/route/executor.d.ts +37 -0
- package/dist/route/executor.js +225 -0
- package/dist/route/framing.d.ts +44 -0
- package/dist/route/framing.js +63 -0
- package/dist/route/index.d.ts +21 -0
- package/dist/route/index.js +18 -0
- package/dist/route/media-protocol.d.ts +187 -0
- package/dist/route/media-protocol.js +117 -0
- package/dist/route/media.d.ts +91 -0
- package/dist/route/media.js +251 -0
- package/dist/route/protocol.d.ts +85 -0
- package/dist/route/protocol.js +19 -0
- package/dist/route/transport/http.d.ts +34 -0
- package/dist/route/transport/http.js +67 -0
- package/dist/route/transport/index.d.ts +42 -0
- package/dist/route/transport/index.js +4 -0
- package/dist/route/transport/websocket-channel.d.ts +56 -0
- package/dist/route/transport/websocket-channel.js +1 -0
- package/dist/route/transport/websocket.d.ts +32 -0
- package/dist/route/transport/websocket.js +315 -0
- package/dist/route.d.ts +1 -0
- package/dist/route.js +1 -0
- package/dist/schema/errors.d.ts +194 -0
- package/dist/schema/errors.js +217 -0
- package/dist/schema/events.d.ts +11001 -0
- package/dist/schema/events.js +542 -0
- package/dist/schema/ids.d.ts +17 -0
- package/dist/schema/ids.js +10 -0
- package/dist/schema/index.d.ts +5 -0
- package/dist/schema/index.js +5 -0
- package/dist/schema/messages.d.ts +2706 -0
- package/dist/schema/messages.js +344 -0
- package/dist/schema/options.d.ts +270 -0
- package/dist/schema/options.js +198 -0
- package/dist/speech.d.ts +266 -0
- package/dist/speech.js +114 -0
- package/dist/test-ai.d.ts +15 -0
- package/dist/test-ai.js +49 -0
- package/dist/testing.d.ts +1585 -0
- package/dist/testing.js +108 -0
- package/dist/tool-history.d.ts +2 -0
- package/dist/tool-history.js +91 -0
- package/dist/tool-runtime.d.ts +22 -0
- package/dist/tool-runtime.js +55 -0
- package/dist/tool-updates.d.ts +34 -0
- package/dist/tool-updates.js +93 -0
- package/dist/tool.d.ts +150 -0
- package/dist/tool.js +159 -0
- package/dist/transcription.d.ts +254 -0
- package/dist/transcription.js +119 -0
- package/dist/utils/bytes.d.ts +1 -0
- package/dist/utils/bytes.js +10 -0
- package/dist/utils/json.d.ts +4 -0
- package/dist/utils/json.js +4 -0
- package/dist/utils/media-type.d.ts +8 -0
- package/dist/utils/media-type.js +93 -0
- package/dist/utils/provider-codes.d.ts +3 -0
- package/dist/utils/provider-codes.js +41 -0
- package/dist/utils/record.d.ts +2 -0
- package/dist/utils/record.js +2 -0
- package/dist/utils/sanitize.d.ts +5 -0
- package/dist/utils/sanitize.js +31 -0
- package/dist/video-client.d.ts +12 -0
- package/dist/video-client.js +24 -0
- package/dist/video.d.ts +178 -0
- package/dist/video.js +79 -0
- package/package.json +648 -4
|
@@ -0,0 +1,1585 @@
|
|
|
1
|
+
export * as TestLLM from "./testing.js";
|
|
2
|
+
export { TestAI } from "./test-ai.js";
|
|
3
|
+
export { compileRequest } from "./route/client.js";
|
|
4
|
+
import { AI } from "./ai.js";
|
|
5
|
+
import { type TextOperations } from "./route/client.js";
|
|
6
|
+
import { StreamEvent, CompactionResponse, CompactionCheckpointResponse, type FinishDetails, type AIError, type LLMRequest, type ProviderMetadata, type UsageInput } from "./schema/index.js";
|
|
7
|
+
import { Context, Effect, Layer, Scope, Stream } from "effect";
|
|
8
|
+
export type Response = readonly StreamEvent[] | Stream.Stream<StreamEvent, AIError> | CompactionResponse | CompactionCheckpointResponse;
|
|
9
|
+
export type Gate = Readonly<{
|
|
10
|
+
started: Effect.Effect<void>;
|
|
11
|
+
release: Effect.Effect<void>;
|
|
12
|
+
}>;
|
|
13
|
+
type ClientInterface = TextOperations;
|
|
14
|
+
export type Responder = (request: LLMRequest) => Response;
|
|
15
|
+
interface Controls {
|
|
16
|
+
/** Returns a snapshot of requests observed at execution time. */
|
|
17
|
+
readonly requests: () => Effect.Effect<readonly LLMRequest[]>;
|
|
18
|
+
readonly push: (...responses: readonly Response[]) => Effect.Effect<void>;
|
|
19
|
+
/** Replaces the fallback without changing queued responses. */
|
|
20
|
+
readonly always: (response: Response) => Effect.Effect<void>;
|
|
21
|
+
/** Answers requests after the one-shot queue is exhausted; receives the original request. */
|
|
22
|
+
readonly serve: (responder: Responder) => Effect.Effect<void>;
|
|
23
|
+
/** Waits for request arrivals, not output or completion. */
|
|
24
|
+
readonly wait: (count: number) => Effect.Effect<void>;
|
|
25
|
+
readonly gate: () => Effect.Effect<Gate, never, Scope.Scope>;
|
|
26
|
+
}
|
|
27
|
+
export interface TestInterface extends ClientInterface, Controls {
|
|
28
|
+
}
|
|
29
|
+
declare const Test_base: Context.ServiceClass<Test, "@radheim/ai/TestLLM/Test", TestInterface>;
|
|
30
|
+
export declare class Test extends Test_base {
|
|
31
|
+
}
|
|
32
|
+
export interface LayerOptions {
|
|
33
|
+
readonly transformRequest?: (request: LLMRequest) => LLMRequest;
|
|
34
|
+
/** Used after the one-shot response queue is exhausted. Omit to defect on unexpected requests. */
|
|
35
|
+
readonly fallback?: Response;
|
|
36
|
+
}
|
|
37
|
+
export declare const complete: (options: FinishDetails & {
|
|
38
|
+
readonly usage?: UsageInput;
|
|
39
|
+
readonly providerMetadata?: ProviderMetadata;
|
|
40
|
+
}, ...events: readonly StreamEvent[]) => ({
|
|
41
|
+
readonly type: "step-start";
|
|
42
|
+
readonly index: number;
|
|
43
|
+
} | {
|
|
44
|
+
readonly type: "raw";
|
|
45
|
+
readonly data: unknown;
|
|
46
|
+
} | {
|
|
47
|
+
readonly type: "text-start";
|
|
48
|
+
readonly id: string;
|
|
49
|
+
readonly providerMetadata?: {
|
|
50
|
+
readonly [x: string]: {
|
|
51
|
+
readonly [x: string]: unknown;
|
|
52
|
+
};
|
|
53
|
+
} | undefined;
|
|
54
|
+
} | {
|
|
55
|
+
readonly type: "text-delta";
|
|
56
|
+
readonly id: string;
|
|
57
|
+
readonly text: string;
|
|
58
|
+
readonly providerMetadata?: {
|
|
59
|
+
readonly [x: string]: {
|
|
60
|
+
readonly [x: string]: unknown;
|
|
61
|
+
};
|
|
62
|
+
} | undefined;
|
|
63
|
+
} | {
|
|
64
|
+
readonly type: "text-end";
|
|
65
|
+
readonly id: string;
|
|
66
|
+
readonly text?: string | undefined;
|
|
67
|
+
readonly providerMetadata?: {
|
|
68
|
+
readonly [x: string]: {
|
|
69
|
+
readonly [x: string]: unknown;
|
|
70
|
+
};
|
|
71
|
+
} | undefined;
|
|
72
|
+
} | {
|
|
73
|
+
readonly type: "reasoning-start";
|
|
74
|
+
readonly id: string;
|
|
75
|
+
readonly providerMetadata?: {
|
|
76
|
+
readonly [x: string]: {
|
|
77
|
+
readonly [x: string]: unknown;
|
|
78
|
+
};
|
|
79
|
+
} | undefined;
|
|
80
|
+
} | {
|
|
81
|
+
readonly type: "reasoning-delta";
|
|
82
|
+
readonly id: string;
|
|
83
|
+
readonly text: string;
|
|
84
|
+
readonly providerMetadata?: {
|
|
85
|
+
readonly [x: string]: {
|
|
86
|
+
readonly [x: string]: unknown;
|
|
87
|
+
};
|
|
88
|
+
} | undefined;
|
|
89
|
+
} | {
|
|
90
|
+
readonly type: "reasoning-end";
|
|
91
|
+
readonly id: string;
|
|
92
|
+
readonly text?: string | undefined;
|
|
93
|
+
readonly providerMetadata?: {
|
|
94
|
+
readonly [x: string]: {
|
|
95
|
+
readonly [x: string]: unknown;
|
|
96
|
+
};
|
|
97
|
+
} | undefined;
|
|
98
|
+
} | {
|
|
99
|
+
readonly type: "tool-input-start";
|
|
100
|
+
readonly id: string;
|
|
101
|
+
readonly name: string;
|
|
102
|
+
readonly namespace?: string | undefined;
|
|
103
|
+
readonly providerExecuted?: boolean | undefined;
|
|
104
|
+
readonly providerMetadata?: {
|
|
105
|
+
readonly [x: string]: {
|
|
106
|
+
readonly [x: string]: unknown;
|
|
107
|
+
};
|
|
108
|
+
} | undefined;
|
|
109
|
+
} | {
|
|
110
|
+
readonly type: "tool-input-delta";
|
|
111
|
+
readonly id: string;
|
|
112
|
+
readonly name: string;
|
|
113
|
+
readonly namespace?: string | undefined;
|
|
114
|
+
readonly text: string;
|
|
115
|
+
readonly input?: unknown;
|
|
116
|
+
} | {
|
|
117
|
+
readonly type: "tool-input-end";
|
|
118
|
+
readonly id: string;
|
|
119
|
+
readonly name: string;
|
|
120
|
+
readonly namespace?: string | undefined;
|
|
121
|
+
readonly providerMetadata?: {
|
|
122
|
+
readonly [x: string]: {
|
|
123
|
+
readonly [x: string]: unknown;
|
|
124
|
+
};
|
|
125
|
+
} | undefined;
|
|
126
|
+
} | {
|
|
127
|
+
readonly type: "tool-input-error";
|
|
128
|
+
readonly id: string;
|
|
129
|
+
readonly name: string;
|
|
130
|
+
readonly namespace?: string | undefined;
|
|
131
|
+
readonly raw: string;
|
|
132
|
+
} | {
|
|
133
|
+
readonly type: "tool-call";
|
|
134
|
+
readonly id: string;
|
|
135
|
+
readonly name: string;
|
|
136
|
+
readonly namespace?: string | undefined;
|
|
137
|
+
readonly input: unknown;
|
|
138
|
+
readonly providerExecuted?: boolean | undefined;
|
|
139
|
+
readonly providerMetadata?: {
|
|
140
|
+
readonly [x: string]: {
|
|
141
|
+
readonly [x: string]: unknown;
|
|
142
|
+
};
|
|
143
|
+
} | undefined;
|
|
144
|
+
} | {
|
|
145
|
+
readonly type: "tool-result";
|
|
146
|
+
readonly id: string;
|
|
147
|
+
readonly name: string;
|
|
148
|
+
readonly namespace?: string | undefined;
|
|
149
|
+
readonly result: {
|
|
150
|
+
readonly type: "json";
|
|
151
|
+
readonly value: unknown;
|
|
152
|
+
} | {
|
|
153
|
+
readonly type: "text";
|
|
154
|
+
readonly value: unknown;
|
|
155
|
+
} | {
|
|
156
|
+
readonly type: "error";
|
|
157
|
+
readonly value: unknown;
|
|
158
|
+
} | {
|
|
159
|
+
readonly type: "content";
|
|
160
|
+
readonly value: readonly ({
|
|
161
|
+
readonly type: "text";
|
|
162
|
+
readonly text: string;
|
|
163
|
+
} | {
|
|
164
|
+
readonly type: "file";
|
|
165
|
+
readonly uri: string;
|
|
166
|
+
readonly mime: string;
|
|
167
|
+
readonly name?: string | undefined;
|
|
168
|
+
})[];
|
|
169
|
+
};
|
|
170
|
+
readonly output?: {
|
|
171
|
+
readonly structured: unknown;
|
|
172
|
+
readonly content: readonly ({
|
|
173
|
+
readonly type: "text";
|
|
174
|
+
readonly text: string;
|
|
175
|
+
} | {
|
|
176
|
+
readonly type: "file";
|
|
177
|
+
readonly uri: string;
|
|
178
|
+
readonly mime: string;
|
|
179
|
+
readonly name?: string | undefined;
|
|
180
|
+
})[];
|
|
181
|
+
} | undefined;
|
|
182
|
+
readonly providerExecuted?: boolean | undefined;
|
|
183
|
+
readonly providerMetadata?: {
|
|
184
|
+
readonly [x: string]: {
|
|
185
|
+
readonly [x: string]: unknown;
|
|
186
|
+
};
|
|
187
|
+
} | undefined;
|
|
188
|
+
} | {
|
|
189
|
+
readonly reason: "content-filter" | "error" | "length" | "stop" | "tool-calls" | "unknown";
|
|
190
|
+
readonly detail?: string | undefined;
|
|
191
|
+
readonly raw?: string | undefined;
|
|
192
|
+
readonly type: "step-finish";
|
|
193
|
+
readonly index: number;
|
|
194
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
195
|
+
readonly providerMetadata?: {
|
|
196
|
+
readonly [x: string]: {
|
|
197
|
+
readonly [x: string]: unknown;
|
|
198
|
+
};
|
|
199
|
+
} | undefined;
|
|
200
|
+
} | {
|
|
201
|
+
readonly reason: "content-filter" | "error" | "length" | "stop" | "tool-calls" | "unknown";
|
|
202
|
+
readonly detail?: string | undefined;
|
|
203
|
+
readonly raw?: string | undefined;
|
|
204
|
+
readonly type: "finish";
|
|
205
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
206
|
+
readonly message?: import("./schema/messages.js").AssistantMessage | undefined;
|
|
207
|
+
readonly providerMetadata?: {
|
|
208
|
+
readonly [x: string]: {
|
|
209
|
+
readonly [x: string]: unknown;
|
|
210
|
+
};
|
|
211
|
+
} | undefined;
|
|
212
|
+
} | {
|
|
213
|
+
readonly type: "media";
|
|
214
|
+
readonly media: import("./media.js").Asset;
|
|
215
|
+
readonly providerMetadata?: {
|
|
216
|
+
readonly [x: string]: {
|
|
217
|
+
readonly [x: string]: unknown;
|
|
218
|
+
};
|
|
219
|
+
} | undefined;
|
|
220
|
+
} | ({
|
|
221
|
+
readonly type: "compaction";
|
|
222
|
+
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
223
|
+
readonly id?: string | undefined;
|
|
224
|
+
readonly encrypted?: string | undefined;
|
|
225
|
+
readonly text?: string | null | undefined;
|
|
226
|
+
} & ({
|
|
227
|
+
readonly encrypted: string;
|
|
228
|
+
readonly text?: never;
|
|
229
|
+
} | {
|
|
230
|
+
readonly text: string | null;
|
|
231
|
+
readonly encrypted?: never;
|
|
232
|
+
})))[];
|
|
233
|
+
export declare const stop: (...events: readonly StreamEvent[]) => ({
|
|
234
|
+
readonly type: "step-start";
|
|
235
|
+
readonly index: number;
|
|
236
|
+
} | {
|
|
237
|
+
readonly type: "raw";
|
|
238
|
+
readonly data: unknown;
|
|
239
|
+
} | {
|
|
240
|
+
readonly type: "text-start";
|
|
241
|
+
readonly id: string;
|
|
242
|
+
readonly providerMetadata?: {
|
|
243
|
+
readonly [x: string]: {
|
|
244
|
+
readonly [x: string]: unknown;
|
|
245
|
+
};
|
|
246
|
+
} | undefined;
|
|
247
|
+
} | {
|
|
248
|
+
readonly type: "text-delta";
|
|
249
|
+
readonly id: string;
|
|
250
|
+
readonly text: string;
|
|
251
|
+
readonly providerMetadata?: {
|
|
252
|
+
readonly [x: string]: {
|
|
253
|
+
readonly [x: string]: unknown;
|
|
254
|
+
};
|
|
255
|
+
} | undefined;
|
|
256
|
+
} | {
|
|
257
|
+
readonly type: "text-end";
|
|
258
|
+
readonly id: string;
|
|
259
|
+
readonly text?: string | undefined;
|
|
260
|
+
readonly providerMetadata?: {
|
|
261
|
+
readonly [x: string]: {
|
|
262
|
+
readonly [x: string]: unknown;
|
|
263
|
+
};
|
|
264
|
+
} | undefined;
|
|
265
|
+
} | {
|
|
266
|
+
readonly type: "reasoning-start";
|
|
267
|
+
readonly id: string;
|
|
268
|
+
readonly providerMetadata?: {
|
|
269
|
+
readonly [x: string]: {
|
|
270
|
+
readonly [x: string]: unknown;
|
|
271
|
+
};
|
|
272
|
+
} | undefined;
|
|
273
|
+
} | {
|
|
274
|
+
readonly type: "reasoning-delta";
|
|
275
|
+
readonly id: string;
|
|
276
|
+
readonly text: string;
|
|
277
|
+
readonly providerMetadata?: {
|
|
278
|
+
readonly [x: string]: {
|
|
279
|
+
readonly [x: string]: unknown;
|
|
280
|
+
};
|
|
281
|
+
} | undefined;
|
|
282
|
+
} | {
|
|
283
|
+
readonly type: "reasoning-end";
|
|
284
|
+
readonly id: string;
|
|
285
|
+
readonly text?: string | undefined;
|
|
286
|
+
readonly providerMetadata?: {
|
|
287
|
+
readonly [x: string]: {
|
|
288
|
+
readonly [x: string]: unknown;
|
|
289
|
+
};
|
|
290
|
+
} | undefined;
|
|
291
|
+
} | {
|
|
292
|
+
readonly type: "tool-input-start";
|
|
293
|
+
readonly id: string;
|
|
294
|
+
readonly name: string;
|
|
295
|
+
readonly namespace?: string | undefined;
|
|
296
|
+
readonly providerExecuted?: boolean | undefined;
|
|
297
|
+
readonly providerMetadata?: {
|
|
298
|
+
readonly [x: string]: {
|
|
299
|
+
readonly [x: string]: unknown;
|
|
300
|
+
};
|
|
301
|
+
} | undefined;
|
|
302
|
+
} | {
|
|
303
|
+
readonly type: "tool-input-delta";
|
|
304
|
+
readonly id: string;
|
|
305
|
+
readonly name: string;
|
|
306
|
+
readonly namespace?: string | undefined;
|
|
307
|
+
readonly text: string;
|
|
308
|
+
readonly input?: unknown;
|
|
309
|
+
} | {
|
|
310
|
+
readonly type: "tool-input-end";
|
|
311
|
+
readonly id: string;
|
|
312
|
+
readonly name: string;
|
|
313
|
+
readonly namespace?: string | undefined;
|
|
314
|
+
readonly providerMetadata?: {
|
|
315
|
+
readonly [x: string]: {
|
|
316
|
+
readonly [x: string]: unknown;
|
|
317
|
+
};
|
|
318
|
+
} | undefined;
|
|
319
|
+
} | {
|
|
320
|
+
readonly type: "tool-input-error";
|
|
321
|
+
readonly id: string;
|
|
322
|
+
readonly name: string;
|
|
323
|
+
readonly namespace?: string | undefined;
|
|
324
|
+
readonly raw: string;
|
|
325
|
+
} | {
|
|
326
|
+
readonly type: "tool-call";
|
|
327
|
+
readonly id: string;
|
|
328
|
+
readonly name: string;
|
|
329
|
+
readonly namespace?: string | undefined;
|
|
330
|
+
readonly input: unknown;
|
|
331
|
+
readonly providerExecuted?: boolean | undefined;
|
|
332
|
+
readonly providerMetadata?: {
|
|
333
|
+
readonly [x: string]: {
|
|
334
|
+
readonly [x: string]: unknown;
|
|
335
|
+
};
|
|
336
|
+
} | undefined;
|
|
337
|
+
} | {
|
|
338
|
+
readonly type: "tool-result";
|
|
339
|
+
readonly id: string;
|
|
340
|
+
readonly name: string;
|
|
341
|
+
readonly namespace?: string | undefined;
|
|
342
|
+
readonly result: {
|
|
343
|
+
readonly type: "json";
|
|
344
|
+
readonly value: unknown;
|
|
345
|
+
} | {
|
|
346
|
+
readonly type: "text";
|
|
347
|
+
readonly value: unknown;
|
|
348
|
+
} | {
|
|
349
|
+
readonly type: "error";
|
|
350
|
+
readonly value: unknown;
|
|
351
|
+
} | {
|
|
352
|
+
readonly type: "content";
|
|
353
|
+
readonly value: readonly ({
|
|
354
|
+
readonly type: "text";
|
|
355
|
+
readonly text: string;
|
|
356
|
+
} | {
|
|
357
|
+
readonly type: "file";
|
|
358
|
+
readonly uri: string;
|
|
359
|
+
readonly mime: string;
|
|
360
|
+
readonly name?: string | undefined;
|
|
361
|
+
})[];
|
|
362
|
+
};
|
|
363
|
+
readonly output?: {
|
|
364
|
+
readonly structured: unknown;
|
|
365
|
+
readonly content: readonly ({
|
|
366
|
+
readonly type: "text";
|
|
367
|
+
readonly text: string;
|
|
368
|
+
} | {
|
|
369
|
+
readonly type: "file";
|
|
370
|
+
readonly uri: string;
|
|
371
|
+
readonly mime: string;
|
|
372
|
+
readonly name?: string | undefined;
|
|
373
|
+
})[];
|
|
374
|
+
} | undefined;
|
|
375
|
+
readonly providerExecuted?: boolean | undefined;
|
|
376
|
+
readonly providerMetadata?: {
|
|
377
|
+
readonly [x: string]: {
|
|
378
|
+
readonly [x: string]: unknown;
|
|
379
|
+
};
|
|
380
|
+
} | undefined;
|
|
381
|
+
} | {
|
|
382
|
+
readonly reason: "content-filter" | "error" | "length" | "stop" | "tool-calls" | "unknown";
|
|
383
|
+
readonly detail?: string | undefined;
|
|
384
|
+
readonly raw?: string | undefined;
|
|
385
|
+
readonly type: "step-finish";
|
|
386
|
+
readonly index: number;
|
|
387
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
388
|
+
readonly providerMetadata?: {
|
|
389
|
+
readonly [x: string]: {
|
|
390
|
+
readonly [x: string]: unknown;
|
|
391
|
+
};
|
|
392
|
+
} | undefined;
|
|
393
|
+
} | {
|
|
394
|
+
readonly reason: "content-filter" | "error" | "length" | "stop" | "tool-calls" | "unknown";
|
|
395
|
+
readonly detail?: string | undefined;
|
|
396
|
+
readonly raw?: string | undefined;
|
|
397
|
+
readonly type: "finish";
|
|
398
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
399
|
+
readonly message?: import("./schema/messages.js").AssistantMessage | undefined;
|
|
400
|
+
readonly providerMetadata?: {
|
|
401
|
+
readonly [x: string]: {
|
|
402
|
+
readonly [x: string]: unknown;
|
|
403
|
+
};
|
|
404
|
+
} | undefined;
|
|
405
|
+
} | {
|
|
406
|
+
readonly type: "media";
|
|
407
|
+
readonly media: import("./media.js").Asset;
|
|
408
|
+
readonly providerMetadata?: {
|
|
409
|
+
readonly [x: string]: {
|
|
410
|
+
readonly [x: string]: unknown;
|
|
411
|
+
};
|
|
412
|
+
} | undefined;
|
|
413
|
+
} | ({
|
|
414
|
+
readonly type: "compaction";
|
|
415
|
+
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
416
|
+
readonly id?: string | undefined;
|
|
417
|
+
readonly encrypted?: string | undefined;
|
|
418
|
+
readonly text?: string | null | undefined;
|
|
419
|
+
} & ({
|
|
420
|
+
readonly encrypted: string;
|
|
421
|
+
readonly text?: never;
|
|
422
|
+
} | {
|
|
423
|
+
readonly text: string | null;
|
|
424
|
+
readonly encrypted?: never;
|
|
425
|
+
})))[];
|
|
426
|
+
export declare const toolCalls: (...events: readonly StreamEvent[]) => ({
|
|
427
|
+
readonly type: "step-start";
|
|
428
|
+
readonly index: number;
|
|
429
|
+
} | {
|
|
430
|
+
readonly type: "raw";
|
|
431
|
+
readonly data: unknown;
|
|
432
|
+
} | {
|
|
433
|
+
readonly type: "text-start";
|
|
434
|
+
readonly id: string;
|
|
435
|
+
readonly providerMetadata?: {
|
|
436
|
+
readonly [x: string]: {
|
|
437
|
+
readonly [x: string]: unknown;
|
|
438
|
+
};
|
|
439
|
+
} | undefined;
|
|
440
|
+
} | {
|
|
441
|
+
readonly type: "text-delta";
|
|
442
|
+
readonly id: string;
|
|
443
|
+
readonly text: string;
|
|
444
|
+
readonly providerMetadata?: {
|
|
445
|
+
readonly [x: string]: {
|
|
446
|
+
readonly [x: string]: unknown;
|
|
447
|
+
};
|
|
448
|
+
} | undefined;
|
|
449
|
+
} | {
|
|
450
|
+
readonly type: "text-end";
|
|
451
|
+
readonly id: string;
|
|
452
|
+
readonly text?: string | undefined;
|
|
453
|
+
readonly providerMetadata?: {
|
|
454
|
+
readonly [x: string]: {
|
|
455
|
+
readonly [x: string]: unknown;
|
|
456
|
+
};
|
|
457
|
+
} | undefined;
|
|
458
|
+
} | {
|
|
459
|
+
readonly type: "reasoning-start";
|
|
460
|
+
readonly id: string;
|
|
461
|
+
readonly providerMetadata?: {
|
|
462
|
+
readonly [x: string]: {
|
|
463
|
+
readonly [x: string]: unknown;
|
|
464
|
+
};
|
|
465
|
+
} | undefined;
|
|
466
|
+
} | {
|
|
467
|
+
readonly type: "reasoning-delta";
|
|
468
|
+
readonly id: string;
|
|
469
|
+
readonly text: string;
|
|
470
|
+
readonly providerMetadata?: {
|
|
471
|
+
readonly [x: string]: {
|
|
472
|
+
readonly [x: string]: unknown;
|
|
473
|
+
};
|
|
474
|
+
} | undefined;
|
|
475
|
+
} | {
|
|
476
|
+
readonly type: "reasoning-end";
|
|
477
|
+
readonly id: string;
|
|
478
|
+
readonly text?: string | undefined;
|
|
479
|
+
readonly providerMetadata?: {
|
|
480
|
+
readonly [x: string]: {
|
|
481
|
+
readonly [x: string]: unknown;
|
|
482
|
+
};
|
|
483
|
+
} | undefined;
|
|
484
|
+
} | {
|
|
485
|
+
readonly type: "tool-input-start";
|
|
486
|
+
readonly id: string;
|
|
487
|
+
readonly name: string;
|
|
488
|
+
readonly namespace?: string | undefined;
|
|
489
|
+
readonly providerExecuted?: boolean | undefined;
|
|
490
|
+
readonly providerMetadata?: {
|
|
491
|
+
readonly [x: string]: {
|
|
492
|
+
readonly [x: string]: unknown;
|
|
493
|
+
};
|
|
494
|
+
} | undefined;
|
|
495
|
+
} | {
|
|
496
|
+
readonly type: "tool-input-delta";
|
|
497
|
+
readonly id: string;
|
|
498
|
+
readonly name: string;
|
|
499
|
+
readonly namespace?: string | undefined;
|
|
500
|
+
readonly text: string;
|
|
501
|
+
readonly input?: unknown;
|
|
502
|
+
} | {
|
|
503
|
+
readonly type: "tool-input-end";
|
|
504
|
+
readonly id: string;
|
|
505
|
+
readonly name: string;
|
|
506
|
+
readonly namespace?: string | undefined;
|
|
507
|
+
readonly providerMetadata?: {
|
|
508
|
+
readonly [x: string]: {
|
|
509
|
+
readonly [x: string]: unknown;
|
|
510
|
+
};
|
|
511
|
+
} | undefined;
|
|
512
|
+
} | {
|
|
513
|
+
readonly type: "tool-input-error";
|
|
514
|
+
readonly id: string;
|
|
515
|
+
readonly name: string;
|
|
516
|
+
readonly namespace?: string | undefined;
|
|
517
|
+
readonly raw: string;
|
|
518
|
+
} | {
|
|
519
|
+
readonly type: "tool-call";
|
|
520
|
+
readonly id: string;
|
|
521
|
+
readonly name: string;
|
|
522
|
+
readonly namespace?: string | undefined;
|
|
523
|
+
readonly input: unknown;
|
|
524
|
+
readonly providerExecuted?: boolean | undefined;
|
|
525
|
+
readonly providerMetadata?: {
|
|
526
|
+
readonly [x: string]: {
|
|
527
|
+
readonly [x: string]: unknown;
|
|
528
|
+
};
|
|
529
|
+
} | undefined;
|
|
530
|
+
} | {
|
|
531
|
+
readonly type: "tool-result";
|
|
532
|
+
readonly id: string;
|
|
533
|
+
readonly name: string;
|
|
534
|
+
readonly namespace?: string | undefined;
|
|
535
|
+
readonly result: {
|
|
536
|
+
readonly type: "json";
|
|
537
|
+
readonly value: unknown;
|
|
538
|
+
} | {
|
|
539
|
+
readonly type: "text";
|
|
540
|
+
readonly value: unknown;
|
|
541
|
+
} | {
|
|
542
|
+
readonly type: "error";
|
|
543
|
+
readonly value: unknown;
|
|
544
|
+
} | {
|
|
545
|
+
readonly type: "content";
|
|
546
|
+
readonly value: readonly ({
|
|
547
|
+
readonly type: "text";
|
|
548
|
+
readonly text: string;
|
|
549
|
+
} | {
|
|
550
|
+
readonly type: "file";
|
|
551
|
+
readonly uri: string;
|
|
552
|
+
readonly mime: string;
|
|
553
|
+
readonly name?: string | undefined;
|
|
554
|
+
})[];
|
|
555
|
+
};
|
|
556
|
+
readonly output?: {
|
|
557
|
+
readonly structured: unknown;
|
|
558
|
+
readonly content: readonly ({
|
|
559
|
+
readonly type: "text";
|
|
560
|
+
readonly text: string;
|
|
561
|
+
} | {
|
|
562
|
+
readonly type: "file";
|
|
563
|
+
readonly uri: string;
|
|
564
|
+
readonly mime: string;
|
|
565
|
+
readonly name?: string | undefined;
|
|
566
|
+
})[];
|
|
567
|
+
} | undefined;
|
|
568
|
+
readonly providerExecuted?: boolean | undefined;
|
|
569
|
+
readonly providerMetadata?: {
|
|
570
|
+
readonly [x: string]: {
|
|
571
|
+
readonly [x: string]: unknown;
|
|
572
|
+
};
|
|
573
|
+
} | undefined;
|
|
574
|
+
} | {
|
|
575
|
+
readonly reason: "content-filter" | "error" | "length" | "stop" | "tool-calls" | "unknown";
|
|
576
|
+
readonly detail?: string | undefined;
|
|
577
|
+
readonly raw?: string | undefined;
|
|
578
|
+
readonly type: "step-finish";
|
|
579
|
+
readonly index: number;
|
|
580
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
581
|
+
readonly providerMetadata?: {
|
|
582
|
+
readonly [x: string]: {
|
|
583
|
+
readonly [x: string]: unknown;
|
|
584
|
+
};
|
|
585
|
+
} | undefined;
|
|
586
|
+
} | {
|
|
587
|
+
readonly reason: "content-filter" | "error" | "length" | "stop" | "tool-calls" | "unknown";
|
|
588
|
+
readonly detail?: string | undefined;
|
|
589
|
+
readonly raw?: string | undefined;
|
|
590
|
+
readonly type: "finish";
|
|
591
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
592
|
+
readonly message?: import("./schema/messages.js").AssistantMessage | undefined;
|
|
593
|
+
readonly providerMetadata?: {
|
|
594
|
+
readonly [x: string]: {
|
|
595
|
+
readonly [x: string]: unknown;
|
|
596
|
+
};
|
|
597
|
+
} | undefined;
|
|
598
|
+
} | {
|
|
599
|
+
readonly type: "media";
|
|
600
|
+
readonly media: import("./media.js").Asset;
|
|
601
|
+
readonly providerMetadata?: {
|
|
602
|
+
readonly [x: string]: {
|
|
603
|
+
readonly [x: string]: unknown;
|
|
604
|
+
};
|
|
605
|
+
} | undefined;
|
|
606
|
+
} | ({
|
|
607
|
+
readonly type: "compaction";
|
|
608
|
+
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
609
|
+
readonly id?: string | undefined;
|
|
610
|
+
readonly encrypted?: string | undefined;
|
|
611
|
+
readonly text?: string | null | undefined;
|
|
612
|
+
} & ({
|
|
613
|
+
readonly encrypted: string;
|
|
614
|
+
readonly text?: never;
|
|
615
|
+
} | {
|
|
616
|
+
readonly text: string | null;
|
|
617
|
+
readonly encrypted?: never;
|
|
618
|
+
})))[];
|
|
619
|
+
export declare const text: (value: string, id: string) => ({
|
|
620
|
+
readonly type: "step-start";
|
|
621
|
+
readonly index: number;
|
|
622
|
+
} | {
|
|
623
|
+
readonly type: "raw";
|
|
624
|
+
readonly data: unknown;
|
|
625
|
+
} | {
|
|
626
|
+
readonly type: "text-start";
|
|
627
|
+
readonly id: string;
|
|
628
|
+
readonly providerMetadata?: {
|
|
629
|
+
readonly [x: string]: {
|
|
630
|
+
readonly [x: string]: unknown;
|
|
631
|
+
};
|
|
632
|
+
} | undefined;
|
|
633
|
+
} | {
|
|
634
|
+
readonly type: "text-delta";
|
|
635
|
+
readonly id: string;
|
|
636
|
+
readonly text: string;
|
|
637
|
+
readonly providerMetadata?: {
|
|
638
|
+
readonly [x: string]: {
|
|
639
|
+
readonly [x: string]: unknown;
|
|
640
|
+
};
|
|
641
|
+
} | undefined;
|
|
642
|
+
} | {
|
|
643
|
+
readonly type: "text-end";
|
|
644
|
+
readonly id: string;
|
|
645
|
+
readonly text?: string | undefined;
|
|
646
|
+
readonly providerMetadata?: {
|
|
647
|
+
readonly [x: string]: {
|
|
648
|
+
readonly [x: string]: unknown;
|
|
649
|
+
};
|
|
650
|
+
} | undefined;
|
|
651
|
+
} | {
|
|
652
|
+
readonly type: "reasoning-start";
|
|
653
|
+
readonly id: string;
|
|
654
|
+
readonly providerMetadata?: {
|
|
655
|
+
readonly [x: string]: {
|
|
656
|
+
readonly [x: string]: unknown;
|
|
657
|
+
};
|
|
658
|
+
} | undefined;
|
|
659
|
+
} | {
|
|
660
|
+
readonly type: "reasoning-delta";
|
|
661
|
+
readonly id: string;
|
|
662
|
+
readonly text: string;
|
|
663
|
+
readonly providerMetadata?: {
|
|
664
|
+
readonly [x: string]: {
|
|
665
|
+
readonly [x: string]: unknown;
|
|
666
|
+
};
|
|
667
|
+
} | undefined;
|
|
668
|
+
} | {
|
|
669
|
+
readonly type: "reasoning-end";
|
|
670
|
+
readonly id: string;
|
|
671
|
+
readonly text?: string | undefined;
|
|
672
|
+
readonly providerMetadata?: {
|
|
673
|
+
readonly [x: string]: {
|
|
674
|
+
readonly [x: string]: unknown;
|
|
675
|
+
};
|
|
676
|
+
} | undefined;
|
|
677
|
+
} | {
|
|
678
|
+
readonly type: "tool-input-start";
|
|
679
|
+
readonly id: string;
|
|
680
|
+
readonly name: string;
|
|
681
|
+
readonly namespace?: string | undefined;
|
|
682
|
+
readonly providerExecuted?: boolean | undefined;
|
|
683
|
+
readonly providerMetadata?: {
|
|
684
|
+
readonly [x: string]: {
|
|
685
|
+
readonly [x: string]: unknown;
|
|
686
|
+
};
|
|
687
|
+
} | undefined;
|
|
688
|
+
} | {
|
|
689
|
+
readonly type: "tool-input-delta";
|
|
690
|
+
readonly id: string;
|
|
691
|
+
readonly name: string;
|
|
692
|
+
readonly namespace?: string | undefined;
|
|
693
|
+
readonly text: string;
|
|
694
|
+
readonly input?: unknown;
|
|
695
|
+
} | {
|
|
696
|
+
readonly type: "tool-input-end";
|
|
697
|
+
readonly id: string;
|
|
698
|
+
readonly name: string;
|
|
699
|
+
readonly namespace?: string | undefined;
|
|
700
|
+
readonly providerMetadata?: {
|
|
701
|
+
readonly [x: string]: {
|
|
702
|
+
readonly [x: string]: unknown;
|
|
703
|
+
};
|
|
704
|
+
} | undefined;
|
|
705
|
+
} | {
|
|
706
|
+
readonly type: "tool-input-error";
|
|
707
|
+
readonly id: string;
|
|
708
|
+
readonly name: string;
|
|
709
|
+
readonly namespace?: string | undefined;
|
|
710
|
+
readonly raw: string;
|
|
711
|
+
} | {
|
|
712
|
+
readonly type: "tool-call";
|
|
713
|
+
readonly id: string;
|
|
714
|
+
readonly name: string;
|
|
715
|
+
readonly namespace?: string | undefined;
|
|
716
|
+
readonly input: unknown;
|
|
717
|
+
readonly providerExecuted?: boolean | undefined;
|
|
718
|
+
readonly providerMetadata?: {
|
|
719
|
+
readonly [x: string]: {
|
|
720
|
+
readonly [x: string]: unknown;
|
|
721
|
+
};
|
|
722
|
+
} | undefined;
|
|
723
|
+
} | {
|
|
724
|
+
readonly type: "tool-result";
|
|
725
|
+
readonly id: string;
|
|
726
|
+
readonly name: string;
|
|
727
|
+
readonly namespace?: string | undefined;
|
|
728
|
+
readonly result: {
|
|
729
|
+
readonly type: "json";
|
|
730
|
+
readonly value: unknown;
|
|
731
|
+
} | {
|
|
732
|
+
readonly type: "text";
|
|
733
|
+
readonly value: unknown;
|
|
734
|
+
} | {
|
|
735
|
+
readonly type: "error";
|
|
736
|
+
readonly value: unknown;
|
|
737
|
+
} | {
|
|
738
|
+
readonly type: "content";
|
|
739
|
+
readonly value: readonly ({
|
|
740
|
+
readonly type: "text";
|
|
741
|
+
readonly text: string;
|
|
742
|
+
} | {
|
|
743
|
+
readonly type: "file";
|
|
744
|
+
readonly uri: string;
|
|
745
|
+
readonly mime: string;
|
|
746
|
+
readonly name?: string | undefined;
|
|
747
|
+
})[];
|
|
748
|
+
};
|
|
749
|
+
readonly output?: {
|
|
750
|
+
readonly structured: unknown;
|
|
751
|
+
readonly content: readonly ({
|
|
752
|
+
readonly type: "text";
|
|
753
|
+
readonly text: string;
|
|
754
|
+
} | {
|
|
755
|
+
readonly type: "file";
|
|
756
|
+
readonly uri: string;
|
|
757
|
+
readonly mime: string;
|
|
758
|
+
readonly name?: string | undefined;
|
|
759
|
+
})[];
|
|
760
|
+
} | undefined;
|
|
761
|
+
readonly providerExecuted?: boolean | undefined;
|
|
762
|
+
readonly providerMetadata?: {
|
|
763
|
+
readonly [x: string]: {
|
|
764
|
+
readonly [x: string]: unknown;
|
|
765
|
+
};
|
|
766
|
+
} | undefined;
|
|
767
|
+
} | {
|
|
768
|
+
readonly reason: "content-filter" | "error" | "length" | "stop" | "tool-calls" | "unknown";
|
|
769
|
+
readonly detail?: string | undefined;
|
|
770
|
+
readonly raw?: string | undefined;
|
|
771
|
+
readonly type: "step-finish";
|
|
772
|
+
readonly index: number;
|
|
773
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
774
|
+
readonly providerMetadata?: {
|
|
775
|
+
readonly [x: string]: {
|
|
776
|
+
readonly [x: string]: unknown;
|
|
777
|
+
};
|
|
778
|
+
} | undefined;
|
|
779
|
+
} | {
|
|
780
|
+
readonly reason: "content-filter" | "error" | "length" | "stop" | "tool-calls" | "unknown";
|
|
781
|
+
readonly detail?: string | undefined;
|
|
782
|
+
readonly raw?: string | undefined;
|
|
783
|
+
readonly type: "finish";
|
|
784
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
785
|
+
readonly message?: import("./schema/messages.js").AssistantMessage | undefined;
|
|
786
|
+
readonly providerMetadata?: {
|
|
787
|
+
readonly [x: string]: {
|
|
788
|
+
readonly [x: string]: unknown;
|
|
789
|
+
};
|
|
790
|
+
} | undefined;
|
|
791
|
+
} | {
|
|
792
|
+
readonly type: "media";
|
|
793
|
+
readonly media: import("./media.js").Asset;
|
|
794
|
+
readonly providerMetadata?: {
|
|
795
|
+
readonly [x: string]: {
|
|
796
|
+
readonly [x: string]: unknown;
|
|
797
|
+
};
|
|
798
|
+
} | undefined;
|
|
799
|
+
} | ({
|
|
800
|
+
readonly type: "compaction";
|
|
801
|
+
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
802
|
+
readonly id?: string | undefined;
|
|
803
|
+
readonly encrypted?: string | undefined;
|
|
804
|
+
readonly text?: string | null | undefined;
|
|
805
|
+
} & ({
|
|
806
|
+
readonly encrypted: string;
|
|
807
|
+
readonly text?: never;
|
|
808
|
+
} | {
|
|
809
|
+
readonly text: string | null;
|
|
810
|
+
readonly encrypted?: never;
|
|
811
|
+
})))[];
|
|
812
|
+
export declare const textWithUsage: (value: string, id: string, inputTokens: number) => ({
|
|
813
|
+
readonly type: "step-start";
|
|
814
|
+
readonly index: number;
|
|
815
|
+
} | {
|
|
816
|
+
readonly type: "raw";
|
|
817
|
+
readonly data: unknown;
|
|
818
|
+
} | {
|
|
819
|
+
readonly type: "text-start";
|
|
820
|
+
readonly id: string;
|
|
821
|
+
readonly providerMetadata?: {
|
|
822
|
+
readonly [x: string]: {
|
|
823
|
+
readonly [x: string]: unknown;
|
|
824
|
+
};
|
|
825
|
+
} | undefined;
|
|
826
|
+
} | {
|
|
827
|
+
readonly type: "text-delta";
|
|
828
|
+
readonly id: string;
|
|
829
|
+
readonly text: string;
|
|
830
|
+
readonly providerMetadata?: {
|
|
831
|
+
readonly [x: string]: {
|
|
832
|
+
readonly [x: string]: unknown;
|
|
833
|
+
};
|
|
834
|
+
} | undefined;
|
|
835
|
+
} | {
|
|
836
|
+
readonly type: "text-end";
|
|
837
|
+
readonly id: string;
|
|
838
|
+
readonly text?: string | undefined;
|
|
839
|
+
readonly providerMetadata?: {
|
|
840
|
+
readonly [x: string]: {
|
|
841
|
+
readonly [x: string]: unknown;
|
|
842
|
+
};
|
|
843
|
+
} | undefined;
|
|
844
|
+
} | {
|
|
845
|
+
readonly type: "reasoning-start";
|
|
846
|
+
readonly id: string;
|
|
847
|
+
readonly providerMetadata?: {
|
|
848
|
+
readonly [x: string]: {
|
|
849
|
+
readonly [x: string]: unknown;
|
|
850
|
+
};
|
|
851
|
+
} | undefined;
|
|
852
|
+
} | {
|
|
853
|
+
readonly type: "reasoning-delta";
|
|
854
|
+
readonly id: string;
|
|
855
|
+
readonly text: string;
|
|
856
|
+
readonly providerMetadata?: {
|
|
857
|
+
readonly [x: string]: {
|
|
858
|
+
readonly [x: string]: unknown;
|
|
859
|
+
};
|
|
860
|
+
} | undefined;
|
|
861
|
+
} | {
|
|
862
|
+
readonly type: "reasoning-end";
|
|
863
|
+
readonly id: string;
|
|
864
|
+
readonly text?: string | undefined;
|
|
865
|
+
readonly providerMetadata?: {
|
|
866
|
+
readonly [x: string]: {
|
|
867
|
+
readonly [x: string]: unknown;
|
|
868
|
+
};
|
|
869
|
+
} | undefined;
|
|
870
|
+
} | {
|
|
871
|
+
readonly type: "tool-input-start";
|
|
872
|
+
readonly id: string;
|
|
873
|
+
readonly name: string;
|
|
874
|
+
readonly namespace?: string | undefined;
|
|
875
|
+
readonly providerExecuted?: boolean | undefined;
|
|
876
|
+
readonly providerMetadata?: {
|
|
877
|
+
readonly [x: string]: {
|
|
878
|
+
readonly [x: string]: unknown;
|
|
879
|
+
};
|
|
880
|
+
} | undefined;
|
|
881
|
+
} | {
|
|
882
|
+
readonly type: "tool-input-delta";
|
|
883
|
+
readonly id: string;
|
|
884
|
+
readonly name: string;
|
|
885
|
+
readonly namespace?: string | undefined;
|
|
886
|
+
readonly text: string;
|
|
887
|
+
readonly input?: unknown;
|
|
888
|
+
} | {
|
|
889
|
+
readonly type: "tool-input-end";
|
|
890
|
+
readonly id: string;
|
|
891
|
+
readonly name: string;
|
|
892
|
+
readonly namespace?: string | undefined;
|
|
893
|
+
readonly providerMetadata?: {
|
|
894
|
+
readonly [x: string]: {
|
|
895
|
+
readonly [x: string]: unknown;
|
|
896
|
+
};
|
|
897
|
+
} | undefined;
|
|
898
|
+
} | {
|
|
899
|
+
readonly type: "tool-input-error";
|
|
900
|
+
readonly id: string;
|
|
901
|
+
readonly name: string;
|
|
902
|
+
readonly namespace?: string | undefined;
|
|
903
|
+
readonly raw: string;
|
|
904
|
+
} | {
|
|
905
|
+
readonly type: "tool-call";
|
|
906
|
+
readonly id: string;
|
|
907
|
+
readonly name: string;
|
|
908
|
+
readonly namespace?: string | undefined;
|
|
909
|
+
readonly input: unknown;
|
|
910
|
+
readonly providerExecuted?: boolean | undefined;
|
|
911
|
+
readonly providerMetadata?: {
|
|
912
|
+
readonly [x: string]: {
|
|
913
|
+
readonly [x: string]: unknown;
|
|
914
|
+
};
|
|
915
|
+
} | undefined;
|
|
916
|
+
} | {
|
|
917
|
+
readonly type: "tool-result";
|
|
918
|
+
readonly id: string;
|
|
919
|
+
readonly name: string;
|
|
920
|
+
readonly namespace?: string | undefined;
|
|
921
|
+
readonly result: {
|
|
922
|
+
readonly type: "json";
|
|
923
|
+
readonly value: unknown;
|
|
924
|
+
} | {
|
|
925
|
+
readonly type: "text";
|
|
926
|
+
readonly value: unknown;
|
|
927
|
+
} | {
|
|
928
|
+
readonly type: "error";
|
|
929
|
+
readonly value: unknown;
|
|
930
|
+
} | {
|
|
931
|
+
readonly type: "content";
|
|
932
|
+
readonly value: readonly ({
|
|
933
|
+
readonly type: "text";
|
|
934
|
+
readonly text: string;
|
|
935
|
+
} | {
|
|
936
|
+
readonly type: "file";
|
|
937
|
+
readonly uri: string;
|
|
938
|
+
readonly mime: string;
|
|
939
|
+
readonly name?: string | undefined;
|
|
940
|
+
})[];
|
|
941
|
+
};
|
|
942
|
+
readonly output?: {
|
|
943
|
+
readonly structured: unknown;
|
|
944
|
+
readonly content: readonly ({
|
|
945
|
+
readonly type: "text";
|
|
946
|
+
readonly text: string;
|
|
947
|
+
} | {
|
|
948
|
+
readonly type: "file";
|
|
949
|
+
readonly uri: string;
|
|
950
|
+
readonly mime: string;
|
|
951
|
+
readonly name?: string | undefined;
|
|
952
|
+
})[];
|
|
953
|
+
} | undefined;
|
|
954
|
+
readonly providerExecuted?: boolean | undefined;
|
|
955
|
+
readonly providerMetadata?: {
|
|
956
|
+
readonly [x: string]: {
|
|
957
|
+
readonly [x: string]: unknown;
|
|
958
|
+
};
|
|
959
|
+
} | undefined;
|
|
960
|
+
} | {
|
|
961
|
+
readonly reason: "content-filter" | "error" | "length" | "stop" | "tool-calls" | "unknown";
|
|
962
|
+
readonly detail?: string | undefined;
|
|
963
|
+
readonly raw?: string | undefined;
|
|
964
|
+
readonly type: "step-finish";
|
|
965
|
+
readonly index: number;
|
|
966
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
967
|
+
readonly providerMetadata?: {
|
|
968
|
+
readonly [x: string]: {
|
|
969
|
+
readonly [x: string]: unknown;
|
|
970
|
+
};
|
|
971
|
+
} | undefined;
|
|
972
|
+
} | {
|
|
973
|
+
readonly reason: "content-filter" | "error" | "length" | "stop" | "tool-calls" | "unknown";
|
|
974
|
+
readonly detail?: string | undefined;
|
|
975
|
+
readonly raw?: string | undefined;
|
|
976
|
+
readonly type: "finish";
|
|
977
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
978
|
+
readonly message?: import("./schema/messages.js").AssistantMessage | undefined;
|
|
979
|
+
readonly providerMetadata?: {
|
|
980
|
+
readonly [x: string]: {
|
|
981
|
+
readonly [x: string]: unknown;
|
|
982
|
+
};
|
|
983
|
+
} | undefined;
|
|
984
|
+
} | {
|
|
985
|
+
readonly type: "media";
|
|
986
|
+
readonly media: import("./media.js").Asset;
|
|
987
|
+
readonly providerMetadata?: {
|
|
988
|
+
readonly [x: string]: {
|
|
989
|
+
readonly [x: string]: unknown;
|
|
990
|
+
};
|
|
991
|
+
} | undefined;
|
|
992
|
+
} | ({
|
|
993
|
+
readonly type: "compaction";
|
|
994
|
+
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
995
|
+
readonly id?: string | undefined;
|
|
996
|
+
readonly encrypted?: string | undefined;
|
|
997
|
+
readonly text?: string | null | undefined;
|
|
998
|
+
} & ({
|
|
999
|
+
readonly encrypted: string;
|
|
1000
|
+
readonly text?: never;
|
|
1001
|
+
} | {
|
|
1002
|
+
readonly text: string | null;
|
|
1003
|
+
readonly encrypted?: never;
|
|
1004
|
+
})))[];
|
|
1005
|
+
export declare const toolCall: (id: string, name: string, input: unknown) => ({
|
|
1006
|
+
readonly type: "step-start";
|
|
1007
|
+
readonly index: number;
|
|
1008
|
+
} | {
|
|
1009
|
+
readonly type: "raw";
|
|
1010
|
+
readonly data: unknown;
|
|
1011
|
+
} | {
|
|
1012
|
+
readonly type: "text-start";
|
|
1013
|
+
readonly id: string;
|
|
1014
|
+
readonly providerMetadata?: {
|
|
1015
|
+
readonly [x: string]: {
|
|
1016
|
+
readonly [x: string]: unknown;
|
|
1017
|
+
};
|
|
1018
|
+
} | undefined;
|
|
1019
|
+
} | {
|
|
1020
|
+
readonly type: "text-delta";
|
|
1021
|
+
readonly id: string;
|
|
1022
|
+
readonly text: string;
|
|
1023
|
+
readonly providerMetadata?: {
|
|
1024
|
+
readonly [x: string]: {
|
|
1025
|
+
readonly [x: string]: unknown;
|
|
1026
|
+
};
|
|
1027
|
+
} | undefined;
|
|
1028
|
+
} | {
|
|
1029
|
+
readonly type: "text-end";
|
|
1030
|
+
readonly id: string;
|
|
1031
|
+
readonly text?: string | undefined;
|
|
1032
|
+
readonly providerMetadata?: {
|
|
1033
|
+
readonly [x: string]: {
|
|
1034
|
+
readonly [x: string]: unknown;
|
|
1035
|
+
};
|
|
1036
|
+
} | undefined;
|
|
1037
|
+
} | {
|
|
1038
|
+
readonly type: "reasoning-start";
|
|
1039
|
+
readonly id: string;
|
|
1040
|
+
readonly providerMetadata?: {
|
|
1041
|
+
readonly [x: string]: {
|
|
1042
|
+
readonly [x: string]: unknown;
|
|
1043
|
+
};
|
|
1044
|
+
} | undefined;
|
|
1045
|
+
} | {
|
|
1046
|
+
readonly type: "reasoning-delta";
|
|
1047
|
+
readonly id: string;
|
|
1048
|
+
readonly text: string;
|
|
1049
|
+
readonly providerMetadata?: {
|
|
1050
|
+
readonly [x: string]: {
|
|
1051
|
+
readonly [x: string]: unknown;
|
|
1052
|
+
};
|
|
1053
|
+
} | undefined;
|
|
1054
|
+
} | {
|
|
1055
|
+
readonly type: "reasoning-end";
|
|
1056
|
+
readonly id: string;
|
|
1057
|
+
readonly text?: string | undefined;
|
|
1058
|
+
readonly providerMetadata?: {
|
|
1059
|
+
readonly [x: string]: {
|
|
1060
|
+
readonly [x: string]: unknown;
|
|
1061
|
+
};
|
|
1062
|
+
} | undefined;
|
|
1063
|
+
} | {
|
|
1064
|
+
readonly type: "tool-input-start";
|
|
1065
|
+
readonly id: string;
|
|
1066
|
+
readonly name: string;
|
|
1067
|
+
readonly namespace?: string | undefined;
|
|
1068
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1069
|
+
readonly providerMetadata?: {
|
|
1070
|
+
readonly [x: string]: {
|
|
1071
|
+
readonly [x: string]: unknown;
|
|
1072
|
+
};
|
|
1073
|
+
} | undefined;
|
|
1074
|
+
} | {
|
|
1075
|
+
readonly type: "tool-input-delta";
|
|
1076
|
+
readonly id: string;
|
|
1077
|
+
readonly name: string;
|
|
1078
|
+
readonly namespace?: string | undefined;
|
|
1079
|
+
readonly text: string;
|
|
1080
|
+
readonly input?: unknown;
|
|
1081
|
+
} | {
|
|
1082
|
+
readonly type: "tool-input-end";
|
|
1083
|
+
readonly id: string;
|
|
1084
|
+
readonly name: string;
|
|
1085
|
+
readonly namespace?: string | undefined;
|
|
1086
|
+
readonly providerMetadata?: {
|
|
1087
|
+
readonly [x: string]: {
|
|
1088
|
+
readonly [x: string]: unknown;
|
|
1089
|
+
};
|
|
1090
|
+
} | undefined;
|
|
1091
|
+
} | {
|
|
1092
|
+
readonly type: "tool-input-error";
|
|
1093
|
+
readonly id: string;
|
|
1094
|
+
readonly name: string;
|
|
1095
|
+
readonly namespace?: string | undefined;
|
|
1096
|
+
readonly raw: string;
|
|
1097
|
+
} | {
|
|
1098
|
+
readonly type: "tool-call";
|
|
1099
|
+
readonly id: string;
|
|
1100
|
+
readonly name: string;
|
|
1101
|
+
readonly namespace?: string | undefined;
|
|
1102
|
+
readonly input: unknown;
|
|
1103
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1104
|
+
readonly providerMetadata?: {
|
|
1105
|
+
readonly [x: string]: {
|
|
1106
|
+
readonly [x: string]: unknown;
|
|
1107
|
+
};
|
|
1108
|
+
} | undefined;
|
|
1109
|
+
} | {
|
|
1110
|
+
readonly type: "tool-result";
|
|
1111
|
+
readonly id: string;
|
|
1112
|
+
readonly name: string;
|
|
1113
|
+
readonly namespace?: string | undefined;
|
|
1114
|
+
readonly result: {
|
|
1115
|
+
readonly type: "json";
|
|
1116
|
+
readonly value: unknown;
|
|
1117
|
+
} | {
|
|
1118
|
+
readonly type: "text";
|
|
1119
|
+
readonly value: unknown;
|
|
1120
|
+
} | {
|
|
1121
|
+
readonly type: "error";
|
|
1122
|
+
readonly value: unknown;
|
|
1123
|
+
} | {
|
|
1124
|
+
readonly type: "content";
|
|
1125
|
+
readonly value: readonly ({
|
|
1126
|
+
readonly type: "text";
|
|
1127
|
+
readonly text: string;
|
|
1128
|
+
} | {
|
|
1129
|
+
readonly type: "file";
|
|
1130
|
+
readonly uri: string;
|
|
1131
|
+
readonly mime: string;
|
|
1132
|
+
readonly name?: string | undefined;
|
|
1133
|
+
})[];
|
|
1134
|
+
};
|
|
1135
|
+
readonly output?: {
|
|
1136
|
+
readonly structured: unknown;
|
|
1137
|
+
readonly content: readonly ({
|
|
1138
|
+
readonly type: "text";
|
|
1139
|
+
readonly text: string;
|
|
1140
|
+
} | {
|
|
1141
|
+
readonly type: "file";
|
|
1142
|
+
readonly uri: string;
|
|
1143
|
+
readonly mime: string;
|
|
1144
|
+
readonly name?: string | undefined;
|
|
1145
|
+
})[];
|
|
1146
|
+
} | undefined;
|
|
1147
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1148
|
+
readonly providerMetadata?: {
|
|
1149
|
+
readonly [x: string]: {
|
|
1150
|
+
readonly [x: string]: unknown;
|
|
1151
|
+
};
|
|
1152
|
+
} | undefined;
|
|
1153
|
+
} | {
|
|
1154
|
+
readonly reason: "content-filter" | "error" | "length" | "stop" | "tool-calls" | "unknown";
|
|
1155
|
+
readonly detail?: string | undefined;
|
|
1156
|
+
readonly raw?: string | undefined;
|
|
1157
|
+
readonly type: "step-finish";
|
|
1158
|
+
readonly index: number;
|
|
1159
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
1160
|
+
readonly providerMetadata?: {
|
|
1161
|
+
readonly [x: string]: {
|
|
1162
|
+
readonly [x: string]: unknown;
|
|
1163
|
+
};
|
|
1164
|
+
} | undefined;
|
|
1165
|
+
} | {
|
|
1166
|
+
readonly reason: "content-filter" | "error" | "length" | "stop" | "tool-calls" | "unknown";
|
|
1167
|
+
readonly detail?: string | undefined;
|
|
1168
|
+
readonly raw?: string | undefined;
|
|
1169
|
+
readonly type: "finish";
|
|
1170
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
1171
|
+
readonly message?: import("./schema/messages.js").AssistantMessage | undefined;
|
|
1172
|
+
readonly providerMetadata?: {
|
|
1173
|
+
readonly [x: string]: {
|
|
1174
|
+
readonly [x: string]: unknown;
|
|
1175
|
+
};
|
|
1176
|
+
} | undefined;
|
|
1177
|
+
} | {
|
|
1178
|
+
readonly type: "media";
|
|
1179
|
+
readonly media: import("./media.js").Asset;
|
|
1180
|
+
readonly providerMetadata?: {
|
|
1181
|
+
readonly [x: string]: {
|
|
1182
|
+
readonly [x: string]: unknown;
|
|
1183
|
+
};
|
|
1184
|
+
} | undefined;
|
|
1185
|
+
} | ({
|
|
1186
|
+
readonly type: "compaction";
|
|
1187
|
+
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
1188
|
+
readonly id?: string | undefined;
|
|
1189
|
+
readonly encrypted?: string | undefined;
|
|
1190
|
+
readonly text?: string | null | undefined;
|
|
1191
|
+
} & ({
|
|
1192
|
+
readonly encrypted: string;
|
|
1193
|
+
readonly text?: never;
|
|
1194
|
+
} | {
|
|
1195
|
+
readonly text: string | null;
|
|
1196
|
+
readonly encrypted?: never;
|
|
1197
|
+
})))[];
|
|
1198
|
+
export declare const failAfter: (error: AIError, ...events: readonly StreamEvent[]) => Stream.Stream<{
|
|
1199
|
+
readonly type: "step-start";
|
|
1200
|
+
readonly index: number;
|
|
1201
|
+
} | {
|
|
1202
|
+
readonly type: "raw";
|
|
1203
|
+
readonly data: unknown;
|
|
1204
|
+
} | {
|
|
1205
|
+
readonly type: "text-start";
|
|
1206
|
+
readonly id: string;
|
|
1207
|
+
readonly providerMetadata?: {
|
|
1208
|
+
readonly [x: string]: {
|
|
1209
|
+
readonly [x: string]: unknown;
|
|
1210
|
+
};
|
|
1211
|
+
} | undefined;
|
|
1212
|
+
} | {
|
|
1213
|
+
readonly type: "text-delta";
|
|
1214
|
+
readonly id: string;
|
|
1215
|
+
readonly text: string;
|
|
1216
|
+
readonly providerMetadata?: {
|
|
1217
|
+
readonly [x: string]: {
|
|
1218
|
+
readonly [x: string]: unknown;
|
|
1219
|
+
};
|
|
1220
|
+
} | undefined;
|
|
1221
|
+
} | {
|
|
1222
|
+
readonly type: "text-end";
|
|
1223
|
+
readonly id: string;
|
|
1224
|
+
readonly text?: string | undefined;
|
|
1225
|
+
readonly providerMetadata?: {
|
|
1226
|
+
readonly [x: string]: {
|
|
1227
|
+
readonly [x: string]: unknown;
|
|
1228
|
+
};
|
|
1229
|
+
} | undefined;
|
|
1230
|
+
} | {
|
|
1231
|
+
readonly type: "reasoning-start";
|
|
1232
|
+
readonly id: string;
|
|
1233
|
+
readonly providerMetadata?: {
|
|
1234
|
+
readonly [x: string]: {
|
|
1235
|
+
readonly [x: string]: unknown;
|
|
1236
|
+
};
|
|
1237
|
+
} | undefined;
|
|
1238
|
+
} | {
|
|
1239
|
+
readonly type: "reasoning-delta";
|
|
1240
|
+
readonly id: string;
|
|
1241
|
+
readonly text: string;
|
|
1242
|
+
readonly providerMetadata?: {
|
|
1243
|
+
readonly [x: string]: {
|
|
1244
|
+
readonly [x: string]: unknown;
|
|
1245
|
+
};
|
|
1246
|
+
} | undefined;
|
|
1247
|
+
} | {
|
|
1248
|
+
readonly type: "reasoning-end";
|
|
1249
|
+
readonly id: string;
|
|
1250
|
+
readonly text?: string | undefined;
|
|
1251
|
+
readonly providerMetadata?: {
|
|
1252
|
+
readonly [x: string]: {
|
|
1253
|
+
readonly [x: string]: unknown;
|
|
1254
|
+
};
|
|
1255
|
+
} | undefined;
|
|
1256
|
+
} | {
|
|
1257
|
+
readonly type: "tool-input-start";
|
|
1258
|
+
readonly id: string;
|
|
1259
|
+
readonly name: string;
|
|
1260
|
+
readonly namespace?: string | undefined;
|
|
1261
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1262
|
+
readonly providerMetadata?: {
|
|
1263
|
+
readonly [x: string]: {
|
|
1264
|
+
readonly [x: string]: unknown;
|
|
1265
|
+
};
|
|
1266
|
+
} | undefined;
|
|
1267
|
+
} | {
|
|
1268
|
+
readonly type: "tool-input-delta";
|
|
1269
|
+
readonly id: string;
|
|
1270
|
+
readonly name: string;
|
|
1271
|
+
readonly namespace?: string | undefined;
|
|
1272
|
+
readonly text: string;
|
|
1273
|
+
readonly input?: unknown;
|
|
1274
|
+
} | {
|
|
1275
|
+
readonly type: "tool-input-end";
|
|
1276
|
+
readonly id: string;
|
|
1277
|
+
readonly name: string;
|
|
1278
|
+
readonly namespace?: string | undefined;
|
|
1279
|
+
readonly providerMetadata?: {
|
|
1280
|
+
readonly [x: string]: {
|
|
1281
|
+
readonly [x: string]: unknown;
|
|
1282
|
+
};
|
|
1283
|
+
} | undefined;
|
|
1284
|
+
} | {
|
|
1285
|
+
readonly type: "tool-input-error";
|
|
1286
|
+
readonly id: string;
|
|
1287
|
+
readonly name: string;
|
|
1288
|
+
readonly namespace?: string | undefined;
|
|
1289
|
+
readonly raw: string;
|
|
1290
|
+
} | {
|
|
1291
|
+
readonly type: "tool-call";
|
|
1292
|
+
readonly id: string;
|
|
1293
|
+
readonly name: string;
|
|
1294
|
+
readonly namespace?: string | undefined;
|
|
1295
|
+
readonly input: unknown;
|
|
1296
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1297
|
+
readonly providerMetadata?: {
|
|
1298
|
+
readonly [x: string]: {
|
|
1299
|
+
readonly [x: string]: unknown;
|
|
1300
|
+
};
|
|
1301
|
+
} | undefined;
|
|
1302
|
+
} | {
|
|
1303
|
+
readonly type: "tool-result";
|
|
1304
|
+
readonly id: string;
|
|
1305
|
+
readonly name: string;
|
|
1306
|
+
readonly namespace?: string | undefined;
|
|
1307
|
+
readonly result: {
|
|
1308
|
+
readonly type: "json";
|
|
1309
|
+
readonly value: unknown;
|
|
1310
|
+
} | {
|
|
1311
|
+
readonly type: "text";
|
|
1312
|
+
readonly value: unknown;
|
|
1313
|
+
} | {
|
|
1314
|
+
readonly type: "error";
|
|
1315
|
+
readonly value: unknown;
|
|
1316
|
+
} | {
|
|
1317
|
+
readonly type: "content";
|
|
1318
|
+
readonly value: readonly ({
|
|
1319
|
+
readonly type: "text";
|
|
1320
|
+
readonly text: string;
|
|
1321
|
+
} | {
|
|
1322
|
+
readonly type: "file";
|
|
1323
|
+
readonly uri: string;
|
|
1324
|
+
readonly mime: string;
|
|
1325
|
+
readonly name?: string | undefined;
|
|
1326
|
+
})[];
|
|
1327
|
+
};
|
|
1328
|
+
readonly output?: {
|
|
1329
|
+
readonly structured: unknown;
|
|
1330
|
+
readonly content: readonly ({
|
|
1331
|
+
readonly type: "text";
|
|
1332
|
+
readonly text: string;
|
|
1333
|
+
} | {
|
|
1334
|
+
readonly type: "file";
|
|
1335
|
+
readonly uri: string;
|
|
1336
|
+
readonly mime: string;
|
|
1337
|
+
readonly name?: string | undefined;
|
|
1338
|
+
})[];
|
|
1339
|
+
} | undefined;
|
|
1340
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1341
|
+
readonly providerMetadata?: {
|
|
1342
|
+
readonly [x: string]: {
|
|
1343
|
+
readonly [x: string]: unknown;
|
|
1344
|
+
};
|
|
1345
|
+
} | undefined;
|
|
1346
|
+
} | {
|
|
1347
|
+
readonly reason: "content-filter" | "error" | "length" | "stop" | "tool-calls" | "unknown";
|
|
1348
|
+
readonly detail?: string | undefined;
|
|
1349
|
+
readonly raw?: string | undefined;
|
|
1350
|
+
readonly type: "step-finish";
|
|
1351
|
+
readonly index: number;
|
|
1352
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
1353
|
+
readonly providerMetadata?: {
|
|
1354
|
+
readonly [x: string]: {
|
|
1355
|
+
readonly [x: string]: unknown;
|
|
1356
|
+
};
|
|
1357
|
+
} | undefined;
|
|
1358
|
+
} | {
|
|
1359
|
+
readonly reason: "content-filter" | "error" | "length" | "stop" | "tool-calls" | "unknown";
|
|
1360
|
+
readonly detail?: string | undefined;
|
|
1361
|
+
readonly raw?: string | undefined;
|
|
1362
|
+
readonly type: "finish";
|
|
1363
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
1364
|
+
readonly message?: import("./schema/messages.js").AssistantMessage | undefined;
|
|
1365
|
+
readonly providerMetadata?: {
|
|
1366
|
+
readonly [x: string]: {
|
|
1367
|
+
readonly [x: string]: unknown;
|
|
1368
|
+
};
|
|
1369
|
+
} | undefined;
|
|
1370
|
+
} | {
|
|
1371
|
+
readonly type: "media";
|
|
1372
|
+
readonly media: import("./media.js").Asset;
|
|
1373
|
+
readonly providerMetadata?: {
|
|
1374
|
+
readonly [x: string]: {
|
|
1375
|
+
readonly [x: string]: unknown;
|
|
1376
|
+
};
|
|
1377
|
+
} | undefined;
|
|
1378
|
+
} | ({
|
|
1379
|
+
readonly type: "compaction";
|
|
1380
|
+
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
1381
|
+
readonly id?: string | undefined;
|
|
1382
|
+
readonly encrypted?: string | undefined;
|
|
1383
|
+
readonly text?: string | null | undefined;
|
|
1384
|
+
} & ({
|
|
1385
|
+
readonly encrypted: string;
|
|
1386
|
+
readonly text?: never;
|
|
1387
|
+
} | {
|
|
1388
|
+
readonly text: string | null;
|
|
1389
|
+
readonly encrypted?: never;
|
|
1390
|
+
})), AIError, never>;
|
|
1391
|
+
export declare const hangAfter: (...events: readonly StreamEvent[]) => Stream.Stream<{
|
|
1392
|
+
readonly type: "step-start";
|
|
1393
|
+
readonly index: number;
|
|
1394
|
+
} | {
|
|
1395
|
+
readonly type: "raw";
|
|
1396
|
+
readonly data: unknown;
|
|
1397
|
+
} | {
|
|
1398
|
+
readonly type: "text-start";
|
|
1399
|
+
readonly id: string;
|
|
1400
|
+
readonly providerMetadata?: {
|
|
1401
|
+
readonly [x: string]: {
|
|
1402
|
+
readonly [x: string]: unknown;
|
|
1403
|
+
};
|
|
1404
|
+
} | undefined;
|
|
1405
|
+
} | {
|
|
1406
|
+
readonly type: "text-delta";
|
|
1407
|
+
readonly id: string;
|
|
1408
|
+
readonly text: string;
|
|
1409
|
+
readonly providerMetadata?: {
|
|
1410
|
+
readonly [x: string]: {
|
|
1411
|
+
readonly [x: string]: unknown;
|
|
1412
|
+
};
|
|
1413
|
+
} | undefined;
|
|
1414
|
+
} | {
|
|
1415
|
+
readonly type: "text-end";
|
|
1416
|
+
readonly id: string;
|
|
1417
|
+
readonly text?: string | undefined;
|
|
1418
|
+
readonly providerMetadata?: {
|
|
1419
|
+
readonly [x: string]: {
|
|
1420
|
+
readonly [x: string]: unknown;
|
|
1421
|
+
};
|
|
1422
|
+
} | undefined;
|
|
1423
|
+
} | {
|
|
1424
|
+
readonly type: "reasoning-start";
|
|
1425
|
+
readonly id: string;
|
|
1426
|
+
readonly providerMetadata?: {
|
|
1427
|
+
readonly [x: string]: {
|
|
1428
|
+
readonly [x: string]: unknown;
|
|
1429
|
+
};
|
|
1430
|
+
} | undefined;
|
|
1431
|
+
} | {
|
|
1432
|
+
readonly type: "reasoning-delta";
|
|
1433
|
+
readonly id: string;
|
|
1434
|
+
readonly text: string;
|
|
1435
|
+
readonly providerMetadata?: {
|
|
1436
|
+
readonly [x: string]: {
|
|
1437
|
+
readonly [x: string]: unknown;
|
|
1438
|
+
};
|
|
1439
|
+
} | undefined;
|
|
1440
|
+
} | {
|
|
1441
|
+
readonly type: "reasoning-end";
|
|
1442
|
+
readonly id: string;
|
|
1443
|
+
readonly text?: string | undefined;
|
|
1444
|
+
readonly providerMetadata?: {
|
|
1445
|
+
readonly [x: string]: {
|
|
1446
|
+
readonly [x: string]: unknown;
|
|
1447
|
+
};
|
|
1448
|
+
} | undefined;
|
|
1449
|
+
} | {
|
|
1450
|
+
readonly type: "tool-input-start";
|
|
1451
|
+
readonly id: string;
|
|
1452
|
+
readonly name: string;
|
|
1453
|
+
readonly namespace?: string | undefined;
|
|
1454
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1455
|
+
readonly providerMetadata?: {
|
|
1456
|
+
readonly [x: string]: {
|
|
1457
|
+
readonly [x: string]: unknown;
|
|
1458
|
+
};
|
|
1459
|
+
} | undefined;
|
|
1460
|
+
} | {
|
|
1461
|
+
readonly type: "tool-input-delta";
|
|
1462
|
+
readonly id: string;
|
|
1463
|
+
readonly name: string;
|
|
1464
|
+
readonly namespace?: string | undefined;
|
|
1465
|
+
readonly text: string;
|
|
1466
|
+
readonly input?: unknown;
|
|
1467
|
+
} | {
|
|
1468
|
+
readonly type: "tool-input-end";
|
|
1469
|
+
readonly id: string;
|
|
1470
|
+
readonly name: string;
|
|
1471
|
+
readonly namespace?: string | undefined;
|
|
1472
|
+
readonly providerMetadata?: {
|
|
1473
|
+
readonly [x: string]: {
|
|
1474
|
+
readonly [x: string]: unknown;
|
|
1475
|
+
};
|
|
1476
|
+
} | undefined;
|
|
1477
|
+
} | {
|
|
1478
|
+
readonly type: "tool-input-error";
|
|
1479
|
+
readonly id: string;
|
|
1480
|
+
readonly name: string;
|
|
1481
|
+
readonly namespace?: string | undefined;
|
|
1482
|
+
readonly raw: string;
|
|
1483
|
+
} | {
|
|
1484
|
+
readonly type: "tool-call";
|
|
1485
|
+
readonly id: string;
|
|
1486
|
+
readonly name: string;
|
|
1487
|
+
readonly namespace?: string | undefined;
|
|
1488
|
+
readonly input: unknown;
|
|
1489
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1490
|
+
readonly providerMetadata?: {
|
|
1491
|
+
readonly [x: string]: {
|
|
1492
|
+
readonly [x: string]: unknown;
|
|
1493
|
+
};
|
|
1494
|
+
} | undefined;
|
|
1495
|
+
} | {
|
|
1496
|
+
readonly type: "tool-result";
|
|
1497
|
+
readonly id: string;
|
|
1498
|
+
readonly name: string;
|
|
1499
|
+
readonly namespace?: string | undefined;
|
|
1500
|
+
readonly result: {
|
|
1501
|
+
readonly type: "json";
|
|
1502
|
+
readonly value: unknown;
|
|
1503
|
+
} | {
|
|
1504
|
+
readonly type: "text";
|
|
1505
|
+
readonly value: unknown;
|
|
1506
|
+
} | {
|
|
1507
|
+
readonly type: "error";
|
|
1508
|
+
readonly value: unknown;
|
|
1509
|
+
} | {
|
|
1510
|
+
readonly type: "content";
|
|
1511
|
+
readonly value: readonly ({
|
|
1512
|
+
readonly type: "text";
|
|
1513
|
+
readonly text: string;
|
|
1514
|
+
} | {
|
|
1515
|
+
readonly type: "file";
|
|
1516
|
+
readonly uri: string;
|
|
1517
|
+
readonly mime: string;
|
|
1518
|
+
readonly name?: string | undefined;
|
|
1519
|
+
})[];
|
|
1520
|
+
};
|
|
1521
|
+
readonly output?: {
|
|
1522
|
+
readonly structured: unknown;
|
|
1523
|
+
readonly content: readonly ({
|
|
1524
|
+
readonly type: "text";
|
|
1525
|
+
readonly text: string;
|
|
1526
|
+
} | {
|
|
1527
|
+
readonly type: "file";
|
|
1528
|
+
readonly uri: string;
|
|
1529
|
+
readonly mime: string;
|
|
1530
|
+
readonly name?: string | undefined;
|
|
1531
|
+
})[];
|
|
1532
|
+
} | undefined;
|
|
1533
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1534
|
+
readonly providerMetadata?: {
|
|
1535
|
+
readonly [x: string]: {
|
|
1536
|
+
readonly [x: string]: unknown;
|
|
1537
|
+
};
|
|
1538
|
+
} | undefined;
|
|
1539
|
+
} | {
|
|
1540
|
+
readonly reason: "content-filter" | "error" | "length" | "stop" | "tool-calls" | "unknown";
|
|
1541
|
+
readonly detail?: string | undefined;
|
|
1542
|
+
readonly raw?: string | undefined;
|
|
1543
|
+
readonly type: "step-finish";
|
|
1544
|
+
readonly index: number;
|
|
1545
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
1546
|
+
readonly providerMetadata?: {
|
|
1547
|
+
readonly [x: string]: {
|
|
1548
|
+
readonly [x: string]: unknown;
|
|
1549
|
+
};
|
|
1550
|
+
} | undefined;
|
|
1551
|
+
} | {
|
|
1552
|
+
readonly reason: "content-filter" | "error" | "length" | "stop" | "tool-calls" | "unknown";
|
|
1553
|
+
readonly detail?: string | undefined;
|
|
1554
|
+
readonly raw?: string | undefined;
|
|
1555
|
+
readonly type: "finish";
|
|
1556
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
1557
|
+
readonly message?: import("./schema/messages.js").AssistantMessage | undefined;
|
|
1558
|
+
readonly providerMetadata?: {
|
|
1559
|
+
readonly [x: string]: {
|
|
1560
|
+
readonly [x: string]: unknown;
|
|
1561
|
+
};
|
|
1562
|
+
} | undefined;
|
|
1563
|
+
} | {
|
|
1564
|
+
readonly type: "media";
|
|
1565
|
+
readonly media: import("./media.js").Asset;
|
|
1566
|
+
readonly providerMetadata?: {
|
|
1567
|
+
readonly [x: string]: {
|
|
1568
|
+
readonly [x: string]: unknown;
|
|
1569
|
+
};
|
|
1570
|
+
} | undefined;
|
|
1571
|
+
} | ({
|
|
1572
|
+
readonly type: "compaction";
|
|
1573
|
+
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
1574
|
+
readonly id?: string | undefined;
|
|
1575
|
+
readonly encrypted?: string | undefined;
|
|
1576
|
+
readonly text?: string | null | undefined;
|
|
1577
|
+
} & ({
|
|
1578
|
+
readonly encrypted: string;
|
|
1579
|
+
readonly text?: never;
|
|
1580
|
+
} | {
|
|
1581
|
+
readonly text: string | null;
|
|
1582
|
+
readonly encrypted?: never;
|
|
1583
|
+
})), never, never>;
|
|
1584
|
+
/** Provides one shared implementation under `AI` (text only; media groups are not implemented) and the test-control tag. */
|
|
1585
|
+
export declare const testLayer: (options?: LayerOptions) => Layer.Layer<AI.AIService | Test, never, never>;
|