@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,62 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { Base64 } from "effect/encoding";
|
|
3
|
+
import { Media } from "../../media.js";
|
|
4
|
+
import { mergeJsonRecords } from "../../schema/index.js";
|
|
5
|
+
import { encodeJson } from "../../utils/json.js";
|
|
6
|
+
import { ProviderShared } from "../shared.js";
|
|
7
|
+
/** Owned bytes for multipart uploads; decodes `base64` sources and rejects remote sources. */
|
|
8
|
+
export const inlineBytes = (route, asset) => {
|
|
9
|
+
if (asset.source.type === "bytes")
|
|
10
|
+
return Effect.succeed(asset.source.data);
|
|
11
|
+
const inline = asset.inline();
|
|
12
|
+
if (!inline)
|
|
13
|
+
return Effect.fail(ProviderShared.inlineRequired(route, asset));
|
|
14
|
+
return Effect.fromResult(Base64.decode(inline.base64)).pipe(Effect.mapError((cause) => ProviderShared.invalidRequest(`${route} media contains invalid base64 data`, cause)));
|
|
15
|
+
};
|
|
16
|
+
/** Copied because `BlobPart` requires a plain `ArrayBuffer`. */
|
|
17
|
+
export const blob = (data, mediaType) => {
|
|
18
|
+
const buffer = new ArrayBuffer(data.byteLength);
|
|
19
|
+
new Uint8Array(buffer).set(data);
|
|
20
|
+
return new Blob([buffer], { type: mediaType });
|
|
21
|
+
};
|
|
22
|
+
const isScalar = (value) => typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
23
|
+
export const query = (route, values) => {
|
|
24
|
+
const entries = Object.entries(values).filter(([, value]) => value !== undefined);
|
|
25
|
+
const invalid = entries.find(([, value]) => !isScalar(value) && !(Array.isArray(value) && value.every(isScalar)));
|
|
26
|
+
if (invalid !== undefined)
|
|
27
|
+
return Effect.fail(ProviderShared.invalidRequest(`${route} cannot send "${invalid[0]}" as a query parameter`));
|
|
28
|
+
return Effect.succeed(Object.fromEntries(entries.map(([key, value]) => [key, Array.isArray(value) ? value.map(String) : String(value)])));
|
|
29
|
+
};
|
|
30
|
+
/** Provider file handle when the ref belongs to this provider; refs from other providers are never forwarded. */
|
|
31
|
+
export const refID = (asset, provider) => asset.source.type === "ref" && asset.source.provider === provider ? asset.source.id : undefined;
|
|
32
|
+
/** Decode a provider's base64 output once into an owned `bytes` asset, sniffing the type when it is not declared. */
|
|
33
|
+
export const decodedAsset = (invalid, label, data, mediaType, options) => Effect.fromResult(Base64.decode(data)).pipe(Effect.mapError((cause) => invalid(`${label} contains invalid base64 data`, cause)), Effect.map((bytes) => Media.bytes(bytes, mediaType, options)));
|
|
34
|
+
/**
|
|
35
|
+
* One image of an OpenAI-shaped `data` array, which carries `b64_json`, a `url`, or both. `b64_json` wins; a `data:`
|
|
36
|
+
* URL decodes inline with its own media type, and any other URL stays a URL asset for the caller to download.
|
|
37
|
+
*/
|
|
38
|
+
export const imageOutput = (invalid, label, item, mediaType, options) => {
|
|
39
|
+
if (item.b64_json)
|
|
40
|
+
return decodedAsset(invalid, label, item.b64_json, mediaType, options);
|
|
41
|
+
if (item.url?.startsWith("data:")) {
|
|
42
|
+
const asset = Media.parseDataUrl(item.url, options);
|
|
43
|
+
return asset === undefined ? Effect.fail(invalid(`${label} has an invalid data URL`)) : Effect.succeed(asset);
|
|
44
|
+
}
|
|
45
|
+
if (item.url)
|
|
46
|
+
return Effect.succeed(Media.url(item.url, { ...options, mediaType }));
|
|
47
|
+
return Effect.fail(invalid(`${label} has neither image data nor a URL`));
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Append multipart text fields: strings as-is, other values as JSON, or scalar arrays as one part per item with
|
|
51
|
+
* `repeatArrays`, named `key[]` or `key`. `overlay` keys in `reserved` are dropped so `http.body` cannot replace
|
|
52
|
+
* route-owned fields.
|
|
53
|
+
*/
|
|
54
|
+
export const appendFields = (form, fields, options) => {
|
|
55
|
+
const overlay = Object.entries(options.overlay ?? {}).filter(([key]) => !options.reserved.has(key));
|
|
56
|
+
Object.entries(mergeJsonRecords(fields, Object.fromEntries(overlay)) ?? {}).forEach(([key, value]) => {
|
|
57
|
+
if (Array.isArray(value) && value.every(isScalar) && options.repeatArrays !== undefined)
|
|
58
|
+
return value.forEach((item) => form.append(options.repeatArrays === "key[]" ? `${key}[]` : key, String(item)));
|
|
59
|
+
form.append(key, typeof value === "string" ? value : encodeJson(value));
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
export * as MediaInput from "./media-input.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LLMRequest } from "../../schema/index.js";
|
|
2
|
+
export declare const valid: RegExp;
|
|
3
|
+
export declare const hash: (value: string) => string;
|
|
4
|
+
export declare const normalizer: (request: LLMRequest) => (id: string) => string;
|
|
5
|
+
export * as MistralToolID from "./mistral-tool-id.js";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const valid = /^[A-Za-z0-9]{9}$/;
|
|
2
|
+
export const hash = (value) => {
|
|
3
|
+
const hash = (seed) => {
|
|
4
|
+
let result = seed;
|
|
5
|
+
for (const char of value)
|
|
6
|
+
result = Math.imul(result ^ char.charCodeAt(0), 16777619);
|
|
7
|
+
return (result >>> 0).toString(36);
|
|
8
|
+
};
|
|
9
|
+
return `${hash(2166136261).padStart(7, "0")}${hash(2246822519).padStart(7, "0")}`.slice(-9);
|
|
10
|
+
};
|
|
11
|
+
export const normalizer = (request) => {
|
|
12
|
+
const ids = request.messages.flatMap((message) => message.content.flatMap((part) => (part.type === "tool-call" || part.type === "tool-result" ? [part.id] : [])));
|
|
13
|
+
// Reserve valid IDs before projecting any history, including IDs encountered later.
|
|
14
|
+
const used = new Set(ids.filter((id) => valid.test(id)));
|
|
15
|
+
const normalized = new Map();
|
|
16
|
+
return (id) => {
|
|
17
|
+
if (valid.test(id))
|
|
18
|
+
return id;
|
|
19
|
+
const previous = normalized.get(id);
|
|
20
|
+
if (previous)
|
|
21
|
+
return previous;
|
|
22
|
+
let attempt = 0;
|
|
23
|
+
let candidate = hash(id);
|
|
24
|
+
while (used.has(candidate))
|
|
25
|
+
candidate = hash(`${id}:${++attempt}`);
|
|
26
|
+
used.add(candidate);
|
|
27
|
+
normalized.set(id, candidate);
|
|
28
|
+
return candidate;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export * as MistralToolID from "./mistral-tool-id.js";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { ReasoningEffort, ReasoningEfforts, type LLMRequest } from "../../schema/index.js";
|
|
3
|
+
export { ReasoningEffort, ReasoningEfforts };
|
|
4
|
+
export declare const TextVerbosities: readonly ["low", "medium", "high"];
|
|
5
|
+
export type TextVerbosity = (typeof TextVerbosities)[number] | (string & {});
|
|
6
|
+
export declare const TextVerbosity: Schema.declare<import("../../schema/options.js").OpenString<"high" | "low" | "medium">, import("../../schema/options.js").OpenString<"high" | "low" | "medium">>;
|
|
7
|
+
export declare const ResponseIncludables: readonly ["file_search_call.results", "web_search_call.results", "web_search_call.action.sources", "message.input_image.image_url", "computer_call_output.output.image_url", "code_interpreter_call.outputs", "reasoning.encrypted_content", "message.output_text.logprobs"];
|
|
8
|
+
export type ResponseIncludable = (typeof ResponseIncludables)[number] | (string & {});
|
|
9
|
+
export declare const ServiceTiers: readonly ["auto", "default", "flex", "priority"];
|
|
10
|
+
export type ServiceTier = (typeof ServiceTiers)[number] | (string & {});
|
|
11
|
+
export declare const ServiceTier: Schema.declare<import("../../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority">, import("../../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority">>;
|
|
12
|
+
export declare const Truncations: readonly ["auto", "disabled"];
|
|
13
|
+
export type Truncation = (typeof Truncations)[number];
|
|
14
|
+
export declare const TextVerbositySchema: Schema.declare<import("../../schema/options.js").OpenString<"high" | "low" | "medium">, import("../../schema/options.js").OpenString<"high" | "low" | "medium">>;
|
|
15
|
+
export declare const ResponseIncludableSchema: Schema.declare<import("../../schema/options.js").OpenString<"code_interpreter_call.outputs" | "computer_call_output.output.image_url" | "file_search_call.results" | "message.input_image.image_url" | "message.output_text.logprobs" | "reasoning.encrypted_content" | "web_search_call.action.sources" | "web_search_call.results">, import("../../schema/options.js").OpenString<"code_interpreter_call.outputs" | "computer_call_output.output.image_url" | "file_search_call.results" | "message.input_image.image_url" | "message.output_text.logprobs" | "reasoning.encrypted_content" | "web_search_call.action.sources" | "web_search_call.results">>;
|
|
16
|
+
export declare const ServiceTierSchema: Schema.declare<import("../../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority">, import("../../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority">>;
|
|
17
|
+
export declare const TruncationSchema: Schema.Literals<readonly ["auto", "disabled"]>;
|
|
18
|
+
export declare const AllowedTools: Schema.Struct<{
|
|
19
|
+
readonly toolNames: Schema.$Array<Schema.String>;
|
|
20
|
+
readonly mode: Schema.optional<Schema.Literals<readonly ["auto", "none", "required"]>>;
|
|
21
|
+
}>;
|
|
22
|
+
export type AllowedTools = typeof AllowedTools.Type;
|
|
23
|
+
export declare const StreamOptions: Schema.Struct<{
|
|
24
|
+
readonly includeObfuscation: Schema.optional<Schema.Boolean>;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const Options: Schema.Struct<{
|
|
27
|
+
readonly store: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.Boolean>, never>>;
|
|
28
|
+
readonly metadata: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.$Record<Schema.String, Schema.String>>, never>>;
|
|
29
|
+
readonly safetyIdentifier: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.String>, never>>;
|
|
30
|
+
readonly streamOptions: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.Struct<{
|
|
31
|
+
readonly includeObfuscation: Schema.optional<Schema.Boolean>;
|
|
32
|
+
}>>, never>>;
|
|
33
|
+
readonly topLogprobs: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.Int>, never>>;
|
|
34
|
+
readonly reasoningEffort: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.declare<ReasoningEffort, ReasoningEffort>>, never>>;
|
|
35
|
+
readonly reasoningSummary: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.Literals<readonly ["auto", "concise", "detailed"]>>, never>>;
|
|
36
|
+
readonly include: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.$Array<Schema.declare<import("../../schema/options.js").OpenString<"code_interpreter_call.outputs" | "computer_call_output.output.image_url" | "file_search_call.results" | "message.input_image.image_url" | "message.output_text.logprobs" | "reasoning.encrypted_content" | "web_search_call.action.sources" | "web_search_call.results">, import("../../schema/options.js").OpenString<"code_interpreter_call.outputs" | "computer_call_output.output.image_url" | "file_search_call.results" | "message.input_image.image_url" | "message.output_text.logprobs" | "reasoning.encrypted_content" | "web_search_call.action.sources" | "web_search_call.results">>>>, never>>;
|
|
37
|
+
readonly textVerbosity: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.declare<import("../../schema/options.js").OpenString<"high" | "low" | "medium">, import("../../schema/options.js").OpenString<"high" | "low" | "medium">>>, never>>;
|
|
38
|
+
readonly serviceTier: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.declare<import("../../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority">, import("../../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority">>>, never>>;
|
|
39
|
+
readonly truncation: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.Literals<readonly ["auto", "disabled"]>>, never>>;
|
|
40
|
+
readonly allowedTools: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.Struct<{
|
|
41
|
+
readonly toolNames: Schema.$Array<Schema.String>;
|
|
42
|
+
readonly mode: Schema.optional<Schema.Literals<readonly ["auto", "none", "required"]>>;
|
|
43
|
+
}>>, never>>;
|
|
44
|
+
readonly maxToolCalls: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.Int>, never>>;
|
|
45
|
+
readonly parallelToolCalls: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.Boolean>, never>>;
|
|
46
|
+
}>;
|
|
47
|
+
export type Options = typeof Options.Type;
|
|
48
|
+
export type Resolved = Omit<Options, "allowedTools"> & {
|
|
49
|
+
readonly allowedTools?: AllowedTools & {
|
|
50
|
+
readonly mode: NonNullable<AllowedTools["mode"]>;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export declare const resolve: (request: LLMRequest) => Resolved;
|
|
54
|
+
export * as OpenResponsesOptions from "./open-responses-options.js";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { ReasoningEffort, ReasoningEfforts } from "../../schema/index.js";
|
|
3
|
+
import { lenient, ProviderShared } from "../shared.js";
|
|
4
|
+
export { ReasoningEffort, ReasoningEfforts };
|
|
5
|
+
export const TextVerbosities = ["low", "medium", "high"];
|
|
6
|
+
export const TextVerbosity = ProviderShared.knownString();
|
|
7
|
+
export const ResponseIncludables = [
|
|
8
|
+
"file_search_call.results",
|
|
9
|
+
"web_search_call.results",
|
|
10
|
+
"web_search_call.action.sources",
|
|
11
|
+
"message.input_image.image_url",
|
|
12
|
+
"computer_call_output.output.image_url",
|
|
13
|
+
"code_interpreter_call.outputs",
|
|
14
|
+
"reasoning.encrypted_content",
|
|
15
|
+
"message.output_text.logprobs",
|
|
16
|
+
];
|
|
17
|
+
export const ServiceTiers = ["auto", "default", "flex", "priority"];
|
|
18
|
+
export const ServiceTier = ProviderShared.knownString();
|
|
19
|
+
export const Truncations = ["auto", "disabled"];
|
|
20
|
+
export const TextVerbositySchema = TextVerbosity;
|
|
21
|
+
export const ResponseIncludableSchema = ProviderShared.knownString();
|
|
22
|
+
export const ServiceTierSchema = ServiceTier;
|
|
23
|
+
export const TruncationSchema = Schema.Literals(Truncations);
|
|
24
|
+
export const AllowedTools = Schema.Struct({
|
|
25
|
+
toolNames: Schema.Array(Schema.String),
|
|
26
|
+
mode: Schema.optional(Schema.Literals(["auto", "none", "required"])),
|
|
27
|
+
});
|
|
28
|
+
export const StreamOptions = Schema.Struct({
|
|
29
|
+
includeObfuscation: Schema.optional(Schema.Boolean),
|
|
30
|
+
});
|
|
31
|
+
// Malformed options are dropped one at a time so a bad `topLogprobs` cannot discard `store` or `reasoningEffort`.
|
|
32
|
+
export const Options = Schema.Struct({
|
|
33
|
+
store: lenient(Schema.Boolean),
|
|
34
|
+
metadata: lenient(Schema.Record(Schema.String, Schema.String)),
|
|
35
|
+
safetyIdentifier: lenient(Schema.String),
|
|
36
|
+
streamOptions: lenient(StreamOptions),
|
|
37
|
+
topLogprobs: lenient(Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: 20 }))),
|
|
38
|
+
reasoningEffort: lenient(ReasoningEffort),
|
|
39
|
+
reasoningSummary: lenient(Schema.Literals(["auto", "concise", "detailed"])),
|
|
40
|
+
include: lenient(Schema.Array(ResponseIncludableSchema)),
|
|
41
|
+
textVerbosity: lenient(TextVerbositySchema),
|
|
42
|
+
serviceTier: lenient(ServiceTierSchema),
|
|
43
|
+
truncation: lenient(TruncationSchema),
|
|
44
|
+
allowedTools: lenient(AllowedTools),
|
|
45
|
+
maxToolCalls: lenient(Schema.Int),
|
|
46
|
+
parallelToolCalls: lenient(Schema.Boolean),
|
|
47
|
+
});
|
|
48
|
+
const decodeOptions = Schema.decodeUnknownSync(Options);
|
|
49
|
+
export const resolve = (request) => {
|
|
50
|
+
const input = decodeOptions(request.providerOptions ?? {});
|
|
51
|
+
return {
|
|
52
|
+
...input,
|
|
53
|
+
include: input.include?.length ? input.include : undefined,
|
|
54
|
+
allowedTools: input.allowedTools && input.allowedTools.toolNames.length > 0
|
|
55
|
+
? { ...input.allowedTools, mode: input.allowedTools.mode ?? "auto" }
|
|
56
|
+
: undefined,
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export * as OpenResponsesOptions from "./open-responses-options.js";
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* allow partial strings like `"hello \u12` to be parsed as `"hello `
|
|
3
|
+
*/
|
|
4
|
+
export declare const STR = 1;
|
|
5
|
+
/**
|
|
6
|
+
* allow partial numbers like `123.` to be parsed as `123`
|
|
7
|
+
*/
|
|
8
|
+
export declare const NUM = 2;
|
|
9
|
+
/**
|
|
10
|
+
* allow partial arrays like `[1, 2,` to be parsed as `[1, 2]`
|
|
11
|
+
*/
|
|
12
|
+
export declare const ARR = 4;
|
|
13
|
+
/**
|
|
14
|
+
* allow partial objects like `{"a": 1, "b":` to be parsed as `{"a": 1}`
|
|
15
|
+
*/
|
|
16
|
+
export declare const OBJ = 8;
|
|
17
|
+
/**
|
|
18
|
+
* allow `nu` to be parsed as `null`
|
|
19
|
+
*/
|
|
20
|
+
export declare const NULL = 16;
|
|
21
|
+
/**
|
|
22
|
+
* allow `tr` to be parsed as `true`, and `fa` to be parsed as `false`
|
|
23
|
+
*/
|
|
24
|
+
export declare const BOOL = 32;
|
|
25
|
+
/**
|
|
26
|
+
* allow `Na` to be parsed as `NaN`
|
|
27
|
+
*/
|
|
28
|
+
export declare const NAN = 64;
|
|
29
|
+
/**
|
|
30
|
+
* allow `Inf` to be parsed as `Infinity`
|
|
31
|
+
*/
|
|
32
|
+
export declare const INFINITY = 128;
|
|
33
|
+
/**
|
|
34
|
+
* allow `-Inf` to be parsed as `-Infinity`
|
|
35
|
+
*/
|
|
36
|
+
export declare const _INFINITY = 256;
|
|
37
|
+
export declare const INF: number;
|
|
38
|
+
export declare const SPECIAL: number;
|
|
39
|
+
export declare const ATOM: number;
|
|
40
|
+
export declare const COLLECTION: number;
|
|
41
|
+
export declare const ALL: number;
|
|
42
|
+
/**
|
|
43
|
+
* Control what types you allow to be partially parsed.
|
|
44
|
+
* The default is to allow all types to be partially parsed, which in most cases is the best option.
|
|
45
|
+
*/
|
|
46
|
+
export declare const Allow: {
|
|
47
|
+
STR: number;
|
|
48
|
+
NUM: number;
|
|
49
|
+
ARR: number;
|
|
50
|
+
OBJ: number;
|
|
51
|
+
NULL: number;
|
|
52
|
+
BOOL: number;
|
|
53
|
+
NAN: number;
|
|
54
|
+
INFINITY: number;
|
|
55
|
+
_INFINITY: number;
|
|
56
|
+
INF: number;
|
|
57
|
+
SPECIAL: number;
|
|
58
|
+
ATOM: number;
|
|
59
|
+
COLLECTION: number;
|
|
60
|
+
ALL: number;
|
|
61
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Adapted from partial-json by the Promplate Dev Team:
|
|
3
|
+
* https://github.com/promplate/partial-json-parser-js/blob/main/src/options.ts
|
|
4
|
+
* Licensed under the MIT License; see partial-json.ts for the complete notice.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* allow partial strings like `"hello \u12` to be parsed as `"hello `
|
|
8
|
+
*/
|
|
9
|
+
export const STR = 0b000000001;
|
|
10
|
+
/**
|
|
11
|
+
* allow partial numbers like `123.` to be parsed as `123`
|
|
12
|
+
*/
|
|
13
|
+
export const NUM = 0b000000010;
|
|
14
|
+
/**
|
|
15
|
+
* allow partial arrays like `[1, 2,` to be parsed as `[1, 2]`
|
|
16
|
+
*/
|
|
17
|
+
export const ARR = 0b000000100;
|
|
18
|
+
/**
|
|
19
|
+
* allow partial objects like `{"a": 1, "b":` to be parsed as `{"a": 1}`
|
|
20
|
+
*/
|
|
21
|
+
export const OBJ = 0b000001000;
|
|
22
|
+
/**
|
|
23
|
+
* allow `nu` to be parsed as `null`
|
|
24
|
+
*/
|
|
25
|
+
export const NULL = 0b000010000;
|
|
26
|
+
/**
|
|
27
|
+
* allow `tr` to be parsed as `true`, and `fa` to be parsed as `false`
|
|
28
|
+
*/
|
|
29
|
+
export const BOOL = 0b000100000;
|
|
30
|
+
/**
|
|
31
|
+
* allow `Na` to be parsed as `NaN`
|
|
32
|
+
*/
|
|
33
|
+
export const NAN = 0b001000000;
|
|
34
|
+
/**
|
|
35
|
+
* allow `Inf` to be parsed as `Infinity`
|
|
36
|
+
*/
|
|
37
|
+
export const INFINITY = 0b010000000;
|
|
38
|
+
/**
|
|
39
|
+
* allow `-Inf` to be parsed as `-Infinity`
|
|
40
|
+
*/
|
|
41
|
+
export const _INFINITY = 0b100000000;
|
|
42
|
+
export const INF = INFINITY | _INFINITY;
|
|
43
|
+
export const SPECIAL = NULL | BOOL | INF | NAN;
|
|
44
|
+
export const ATOM = STR | NUM | SPECIAL;
|
|
45
|
+
export const COLLECTION = ARR | OBJ;
|
|
46
|
+
export const ALL = ATOM | COLLECTION;
|
|
47
|
+
/**
|
|
48
|
+
* Control what types you allow to be partially parsed.
|
|
49
|
+
* The default is to allow all types to be partially parsed, which in most cases is the best option.
|
|
50
|
+
*/
|
|
51
|
+
export const Allow = { STR, NUM, ARR, OBJ, NULL, BOOL, NAN, INFINITY, _INFINITY, INF, SPECIAL, ATOM, COLLECTION, ALL };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./partial-json-options.js";
|
|
2
|
+
export declare class PartialJSON extends Error {
|
|
3
|
+
}
|
|
4
|
+
export declare class MalformedJSON extends Error {
|
|
5
|
+
}
|
|
6
|
+
/** Parse complete or incomplete JSON, restricted by the supplied partial-value flags. */
|
|
7
|
+
export declare function parseJSON(jsonString: string, allowPartial?: number): unknown;
|
|
8
|
+
export declare const parse: typeof parseJSON;
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Adapted from partial-json by the Promplate Dev Team:
|
|
3
|
+
* https://github.com/promplate/partial-json-parser-js
|
|
4
|
+
*
|
|
5
|
+
* MIT License
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2023 Promplate Dev Team
|
|
8
|
+
*
|
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
* in the Software without restriction, including without limitation the rights
|
|
12
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
* furnished to do so, subject to the following conditions:
|
|
15
|
+
*
|
|
16
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
* copies or substantial portions of the Software.
|
|
18
|
+
*
|
|
19
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
* SOFTWARE.
|
|
26
|
+
*/
|
|
27
|
+
import { Schema } from "effect";
|
|
28
|
+
import { decodeJson } from "../../utils/json.js";
|
|
29
|
+
import { Allow } from "./partial-json-options.js";
|
|
30
|
+
export * from "./partial-json-options.js";
|
|
31
|
+
export class PartialJSON extends Error {
|
|
32
|
+
}
|
|
33
|
+
export class MalformedJSON extends Error {
|
|
34
|
+
}
|
|
35
|
+
const decodeJsonString = Schema.decodeUnknownSync(Schema.fromJsonString(Schema.String));
|
|
36
|
+
/** Parse complete or incomplete JSON, restricted by the supplied partial-value flags. */
|
|
37
|
+
export function parseJSON(jsonString, allowPartial = Allow.ALL) {
|
|
38
|
+
if (typeof jsonString !== "string")
|
|
39
|
+
throw new TypeError(`expecting str, got ${typeof jsonString}`);
|
|
40
|
+
const input = jsonString.trim();
|
|
41
|
+
if (!input)
|
|
42
|
+
throw new Error(`${jsonString} is empty`);
|
|
43
|
+
try {
|
|
44
|
+
return decodeJson(input);
|
|
45
|
+
}
|
|
46
|
+
catch { }
|
|
47
|
+
const repaired = repairJSON(input);
|
|
48
|
+
if (repaired !== input) {
|
|
49
|
+
try {
|
|
50
|
+
return decodeJson(repaired);
|
|
51
|
+
}
|
|
52
|
+
catch { }
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
return _parseJSON(input, allowPartial);
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
if (repaired !== input)
|
|
59
|
+
return _parseJSON(repaired, allowPartial);
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const repairJSON = (input) => {
|
|
64
|
+
let repaired = "";
|
|
65
|
+
let quoted = false;
|
|
66
|
+
for (let index = 0; index < input.length; index++) {
|
|
67
|
+
const character = input[index];
|
|
68
|
+
if (!quoted) {
|
|
69
|
+
repaired += character;
|
|
70
|
+
if (character === '"')
|
|
71
|
+
quoted = true;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
if (character === '"') {
|
|
75
|
+
repaired += character;
|
|
76
|
+
quoted = false;
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (character === "\\") {
|
|
80
|
+
const next = input[index + 1];
|
|
81
|
+
if (next === "u" && /^[0-9a-fA-F]{4}$/.test(input.slice(index + 2, index + 6))) {
|
|
82
|
+
repaired += input.slice(index, index + 6);
|
|
83
|
+
index += 5;
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (next !== undefined && '"\\/bfnrtu'.includes(next)) {
|
|
87
|
+
repaired += `\\${next}`;
|
|
88
|
+
index++;
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
repaired += "\\\\";
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
const code = character.charCodeAt(0);
|
|
95
|
+
repaired += code <= 0x1f ? `\\u${code.toString(16).padStart(4, "0")}` : character;
|
|
96
|
+
}
|
|
97
|
+
return repaired;
|
|
98
|
+
};
|
|
99
|
+
const _parseJSON = (jsonString, allow) => {
|
|
100
|
+
const length = jsonString.length;
|
|
101
|
+
let index = 0;
|
|
102
|
+
const markPartialJSON = (message) => {
|
|
103
|
+
throw new PartialJSON(`${message} at position ${index}`);
|
|
104
|
+
};
|
|
105
|
+
const throwMalformedError = (message) => {
|
|
106
|
+
throw new MalformedJSON(`${message} at position ${index}`);
|
|
107
|
+
};
|
|
108
|
+
const parseAny = () => {
|
|
109
|
+
skipBlank();
|
|
110
|
+
if (index >= length)
|
|
111
|
+
markPartialJSON("Unexpected end of input");
|
|
112
|
+
if (jsonString[index] === '"')
|
|
113
|
+
return parseStr();
|
|
114
|
+
if (jsonString[index] === "{")
|
|
115
|
+
return parseObj();
|
|
116
|
+
if (jsonString[index] === "[")
|
|
117
|
+
return parseArr();
|
|
118
|
+
if (jsonString.substring(index, index + 4) === "null" ||
|
|
119
|
+
(Allow.NULL & allow && length - index < 4 && "null".startsWith(jsonString.substring(index)))) {
|
|
120
|
+
index += 4;
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
if (jsonString.substring(index, index + 4) === "true" ||
|
|
124
|
+
(Allow.BOOL & allow && length - index < 4 && "true".startsWith(jsonString.substring(index)))) {
|
|
125
|
+
index += 4;
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
if (jsonString.substring(index, index + 5) === "false" ||
|
|
129
|
+
(Allow.BOOL & allow && length - index < 5 && "false".startsWith(jsonString.substring(index)))) {
|
|
130
|
+
index += 5;
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
if (jsonString.substring(index, index + 8) === "Infinity" ||
|
|
134
|
+
(Allow.INFINITY & allow && length - index < 8 && "Infinity".startsWith(jsonString.substring(index)))) {
|
|
135
|
+
index += 8;
|
|
136
|
+
return Infinity;
|
|
137
|
+
}
|
|
138
|
+
if (jsonString.substring(index, index + 9) === "-Infinity" ||
|
|
139
|
+
(Allow._INFINITY & allow &&
|
|
140
|
+
1 < length - index &&
|
|
141
|
+
length - index < 9 &&
|
|
142
|
+
"-Infinity".startsWith(jsonString.substring(index)))) {
|
|
143
|
+
index += 9;
|
|
144
|
+
return -Infinity;
|
|
145
|
+
}
|
|
146
|
+
if (jsonString.substring(index, index + 3) === "NaN" ||
|
|
147
|
+
(Allow.NAN & allow && length - index < 3 && "NaN".startsWith(jsonString.substring(index)))) {
|
|
148
|
+
index += 3;
|
|
149
|
+
return NaN;
|
|
150
|
+
}
|
|
151
|
+
return parseNum();
|
|
152
|
+
};
|
|
153
|
+
const parseStr = () => {
|
|
154
|
+
const start = index;
|
|
155
|
+
let escape = false;
|
|
156
|
+
index++;
|
|
157
|
+
while (index < length && (jsonString[index] !== '"' || (escape && jsonString[index - 1] === "\\"))) {
|
|
158
|
+
escape = jsonString[index] === "\\" ? !escape : false;
|
|
159
|
+
index++;
|
|
160
|
+
}
|
|
161
|
+
if (jsonString.charAt(index) === '"') {
|
|
162
|
+
try {
|
|
163
|
+
return decodeJsonString(jsonString.substring(start, ++index - Number(escape)));
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
throwMalformedError(String(error));
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (Allow.STR & allow) {
|
|
170
|
+
try {
|
|
171
|
+
return decodeJsonString(`${jsonString.substring(start, index - Number(escape))}"`);
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
return decodeJsonString(`${jsonString.substring(start, jsonString.lastIndexOf("\\"))}"`);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return markPartialJSON("Unterminated string literal");
|
|
178
|
+
};
|
|
179
|
+
const parseObj = () => {
|
|
180
|
+
index++;
|
|
181
|
+
skipBlank();
|
|
182
|
+
const object = {};
|
|
183
|
+
try {
|
|
184
|
+
while (jsonString[index] !== "}") {
|
|
185
|
+
skipBlank();
|
|
186
|
+
if (index >= length && Allow.OBJ & allow)
|
|
187
|
+
return object;
|
|
188
|
+
const key = parseStr();
|
|
189
|
+
skipBlank();
|
|
190
|
+
index++;
|
|
191
|
+
try {
|
|
192
|
+
Object.defineProperty(object, key, {
|
|
193
|
+
value: parseAny(),
|
|
194
|
+
enumerable: true,
|
|
195
|
+
configurable: true,
|
|
196
|
+
writable: true,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
if (Allow.OBJ & allow)
|
|
201
|
+
return object;
|
|
202
|
+
throw error;
|
|
203
|
+
}
|
|
204
|
+
skipBlank();
|
|
205
|
+
if (jsonString[index] === ",")
|
|
206
|
+
index++;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
catch {
|
|
210
|
+
if (Allow.OBJ & allow)
|
|
211
|
+
return object;
|
|
212
|
+
return markPartialJSON("Expected '}' at end of object");
|
|
213
|
+
}
|
|
214
|
+
index++;
|
|
215
|
+
return object;
|
|
216
|
+
};
|
|
217
|
+
const parseArr = () => {
|
|
218
|
+
index++;
|
|
219
|
+
const array = [];
|
|
220
|
+
try {
|
|
221
|
+
while (jsonString[index] !== "]") {
|
|
222
|
+
array.push(parseAny());
|
|
223
|
+
skipBlank();
|
|
224
|
+
if (jsonString[index] === ",")
|
|
225
|
+
index++;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
catch {
|
|
229
|
+
if (Allow.ARR & allow)
|
|
230
|
+
return array;
|
|
231
|
+
return markPartialJSON("Expected ']' at end of array");
|
|
232
|
+
}
|
|
233
|
+
index++;
|
|
234
|
+
return array;
|
|
235
|
+
};
|
|
236
|
+
const parseNum = () => {
|
|
237
|
+
if (index === 0) {
|
|
238
|
+
if (jsonString === "-")
|
|
239
|
+
throwMalformedError("Not sure what '-' is");
|
|
240
|
+
try {
|
|
241
|
+
return decodeJson(jsonString);
|
|
242
|
+
}
|
|
243
|
+
catch (error) {
|
|
244
|
+
if (Allow.NUM & allow) {
|
|
245
|
+
try {
|
|
246
|
+
return decodeJson(jsonString.substring(0, jsonString.lastIndexOf("e")));
|
|
247
|
+
}
|
|
248
|
+
catch { }
|
|
249
|
+
}
|
|
250
|
+
throwMalformedError(String(error));
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
const start = index;
|
|
254
|
+
if (jsonString[index] === "-")
|
|
255
|
+
index++;
|
|
256
|
+
while (jsonString[index] && !",]}".includes(jsonString[index]))
|
|
257
|
+
index++;
|
|
258
|
+
if (index === length && !(Allow.NUM & allow))
|
|
259
|
+
markPartialJSON("Unterminated number literal");
|
|
260
|
+
try {
|
|
261
|
+
return decodeJson(jsonString.substring(start, index));
|
|
262
|
+
}
|
|
263
|
+
catch (error) {
|
|
264
|
+
if (jsonString.substring(start, index) === "-")
|
|
265
|
+
markPartialJSON("Not sure what '-' is");
|
|
266
|
+
try {
|
|
267
|
+
return decodeJson(jsonString.substring(start, jsonString.lastIndexOf("e")));
|
|
268
|
+
}
|
|
269
|
+
catch {
|
|
270
|
+
throwMalformedError(String(error));
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
const skipBlank = () => {
|
|
275
|
+
while (index < length && " \n\r\t".includes(jsonString[index]))
|
|
276
|
+
index++;
|
|
277
|
+
};
|
|
278
|
+
return parseAny();
|
|
279
|
+
};
|
|
280
|
+
export const parse = parseJSON;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type RouteBody, type TriggerCompactOperation } from "../../route/client.js";
|
|
2
|
+
/** Collect a trigger response before acknowledging transport completion. No generation output escapes. */
|
|
3
|
+
export declare const make: <Body>(body: RouteBody<Body>) => TriggerCompactOperation;
|
|
4
|
+
export * as ResponsesCheckpoint from "./responses-checkpoint.js";
|