@nhtio/adk 1.20260913.0 → 1.20260924.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +78 -0
- package/adk-mcp.cjs +2 -2
- package/{arg_specs-iYmIM3wI.js → arg_specs-iYmIM3wI.cjs} +1 -1
- package/arg_specs-iYmIM3wI.cjs.map +1 -0
- package/artifact_methods-7KatxCSd.cjs +1 -0
- package/artifact_methods-q52ETLwI.mjs +1 -0
- package/batteries/artifacts/ecmascript.cjs +2 -2
- package/batteries/artifacts/ecmascript.mjs +1 -1
- package/batteries/artifacts/toon.cjs +2 -2
- package/batteries/artifacts/toon.mjs +1 -1
- package/batteries/artifacts/xml.cjs +2 -2
- package/batteries/artifacts/xml.mjs +1 -1
- package/batteries/artifacts/yaml.cjs +2 -2
- package/batteries/artifacts/yaml.mjs +1 -1
- package/batteries/artifacts.cjs +5 -5
- package/batteries/artifacts.mjs +4 -4
- package/batteries/context/compact/contracts.cjs +1 -1
- package/batteries/context/compact/summarizer.cjs +1 -1
- package/batteries/context/compact.cjs +1 -1
- package/batteries/context/exceptions.cjs +2 -2
- package/batteries/context/thrift/contracts.cjs +1 -1
- package/batteries/context/thrift/relevance.cjs +1 -1
- package/batteries/context/thrift/subtractive_pass.cjs +1 -1
- package/batteries/context/thrift.cjs +1 -1
- package/batteries/context.cjs +1 -1
- package/batteries/dev-tools/conformance.cjs +2 -2
- package/batteries/dev-tools/forge.cjs +5 -5
- package/batteries/dev-tools/forge.mjs +3 -3
- package/batteries/dev-tools.cjs +10 -10
- package/batteries/dev-tools.mjs +3 -3
- package/batteries/embeddings/ollama/adapter.cjs +2 -2
- package/batteries/embeddings/ollama/exceptions.cjs +2 -2
- package/batteries/embeddings/ollama/types.cjs +1 -1
- package/batteries/embeddings/ollama/validation.cjs +1 -1
- package/batteries/embeddings/ollama.cjs +1 -1
- package/batteries/embeddings/openai/adapter.cjs +2 -2
- package/batteries/embeddings/openai/exceptions.cjs +2 -2
- package/batteries/embeddings/openai/helpers.cjs +1 -1
- package/batteries/embeddings/openai/types.cjs +1 -1
- package/batteries/embeddings/openai/validation.cjs +1 -1
- package/batteries/embeddings/openai.cjs +1 -1
- package/batteries/embeddings/transformers_js/adapter.cjs +3 -3
- package/batteries/embeddings/transformers_js/exceptions.cjs +2 -2
- package/batteries/embeddings/transformers_js/pooling.cjs +1 -1
- package/batteries/embeddings/transformers_js/types.cjs +1 -1
- package/batteries/embeddings/transformers_js/validation.cjs +2 -2
- package/batteries/embeddings/transformers_js.cjs +1 -1
- package/batteries/embeddings/webllm/adapter.cjs +2 -2
- package/batteries/embeddings/webllm/exceptions.cjs +2 -2
- package/batteries/embeddings/webllm/types.cjs +1 -1
- package/batteries/embeddings/webllm/validation.cjs +1 -1
- package/batteries/embeddings/webllm.cjs +1 -1
- package/batteries/embeddings.cjs +1 -1
- package/batteries/encoding.cjs +8 -8
- package/batteries/encoding.mjs +6 -6
- package/batteries/generation/_shared.cjs +2 -2
- package/batteries/generation/gemini/adapter.cjs +3 -3
- package/batteries/generation/gemini/adapter.mjs +1 -1
- package/batteries/generation/gemini/exceptions.cjs +2 -2
- package/batteries/generation/gemini/types.cjs +1 -1
- package/batteries/generation/gemini/validation.cjs +1 -1
- package/batteries/generation/gemini.cjs +1 -1
- package/batteries/generation/local_diffusion/adapter.cjs +4 -4
- package/batteries/generation/local_diffusion/adapter.mjs +1 -1
- package/batteries/generation/local_diffusion/exceptions.cjs +2 -2
- package/batteries/generation/local_diffusion/protocol.cjs +2 -2
- package/batteries/generation/local_diffusion/types.cjs +1 -1
- package/batteries/generation/local_diffusion/validation.cjs +1 -1
- package/batteries/generation/local_diffusion.cjs +1 -1
- package/batteries/generation/openai/adapter.cjs +3 -3
- package/batteries/generation/openai/adapter.mjs +1 -1
- package/batteries/generation/openai/exceptions.cjs +2 -2
- package/batteries/generation/openai/types.cjs +1 -1
- package/batteries/generation/openai/validation.cjs +1 -1
- package/batteries/generation/openai.cjs +1 -1
- package/batteries/generation/transformers_js/adapter.cjs +3 -3
- package/batteries/generation/transformers_js/exceptions.cjs +2 -2
- package/batteries/generation/transformers_js/helpers.cjs +1 -1
- package/batteries/generation/transformers_js/types.cjs +1 -1
- package/batteries/generation/transformers_js/validation.cjs +2 -2
- package/batteries/generation/transformers_js.cjs +1 -1
- package/batteries/generation.cjs +1 -1
- package/batteries/isolation/child_process.cjs +3 -3
- package/batteries/isolation.cjs +2 -2
- package/batteries/llm/anthropic_messages/adapter.cjs +10 -10
- package/batteries/llm/anthropic_messages/adapter.mjs +6 -6
- package/batteries/llm/anthropic_messages/count_tokens.cjs +4 -4
- package/batteries/llm/anthropic_messages/count_tokens.mjs +1 -1
- package/batteries/llm/anthropic_messages/error_translation.cjs +2 -2
- package/batteries/llm/anthropic_messages/exceptions.cjs +2 -2
- package/batteries/llm/anthropic_messages/helpers.cjs +4 -4
- package/batteries/llm/anthropic_messages/helpers.mjs +3 -3
- package/batteries/llm/anthropic_messages/types.cjs +1 -1
- package/batteries/llm/anthropic_messages/validation.cjs +3 -3
- package/batteries/llm/anthropic_messages/validation.mjs +1 -1
- package/batteries/llm/anthropic_messages.cjs +4 -4
- package/batteries/llm/anthropic_messages.mjs +2 -2
- package/batteries/llm/bedrock_converse/adapter.cjs +9 -9
- package/batteries/llm/bedrock_converse/adapter.mjs +6 -6
- package/batteries/llm/bedrock_converse/exceptions.cjs +2 -2
- package/batteries/llm/bedrock_converse/helpers.cjs +3 -3
- package/batteries/llm/bedrock_converse/helpers.mjs +1 -1
- package/batteries/llm/bedrock_converse/types.cjs +1 -1
- package/batteries/llm/bedrock_converse/validation.cjs +3 -3
- package/batteries/llm/bedrock_converse/validation.mjs +1 -1
- package/batteries/llm/bedrock_converse.cjs +3 -3
- package/batteries/llm/bedrock_converse.mjs +2 -2
- package/batteries/llm/chat_common/exceptions.cjs +2 -2
- package/batteries/llm/claude_code_cli/adapter.cjs +290 -31
- package/batteries/llm/claude_code_cli/adapter.cjs.map +1 -1
- package/batteries/llm/claude_code_cli/adapter.d.ts +125 -0
- package/batteries/llm/claude_code_cli/adapter.mjs +288 -31
- package/batteries/llm/claude_code_cli/adapter.mjs.map +1 -1
- package/batteries/llm/claude_code_cli/exceptions.cjs +13 -2
- package/batteries/llm/claude_code_cli/exceptions.cjs.map +1 -1
- package/batteries/llm/claude_code_cli/exceptions.d.ts +12 -0
- package/batteries/llm/claude_code_cli/exceptions.mjs +11 -1
- package/batteries/llm/claude_code_cli/exceptions.mjs.map +1 -1
- package/batteries/llm/claude_code_cli/helpers.cjs +4 -4
- package/batteries/llm/claude_code_cli/helpers.mjs +3 -3
- package/batteries/llm/claude_code_cli/index.d.ts +3 -2
- package/batteries/llm/claude_code_cli/types.cjs +1 -1
- package/batteries/llm/claude_code_cli/types.d.ts +36 -2
- package/batteries/llm/claude_code_cli/validation.cjs +4 -3
- package/batteries/llm/claude_code_cli/validation.cjs.map +1 -1
- package/batteries/llm/claude_code_cli/validation.mjs +2 -1
- package/batteries/llm/claude_code_cli/validation.mjs.map +1 -1
- package/batteries/llm/claude_code_cli/wire.cjs +1 -1
- package/batteries/llm/claude_code_cli.cjs +5 -2
- package/batteries/llm/claude_code_cli.mjs +4 -3
- package/batteries/llm/gemini_generate_content/adapter.cjs +9 -9
- package/batteries/llm/gemini_generate_content/adapter.mjs +6 -6
- package/batteries/llm/gemini_generate_content/exceptions.cjs +2 -2
- package/batteries/llm/gemini_generate_content/helpers.cjs +3 -3
- package/batteries/llm/gemini_generate_content/helpers.mjs +1 -1
- package/batteries/llm/gemini_generate_content/types.cjs +1 -1
- package/batteries/llm/gemini_generate_content/validation.cjs +3 -3
- package/batteries/llm/gemini_generate_content/validation.mjs +1 -1
- package/batteries/llm/gemini_generate_content.cjs +2 -2
- package/batteries/llm/gemini_generate_content.mjs +1 -1
- package/batteries/llm/index.d.ts +1 -1
- package/batteries/llm/litert_lm/adapter.cjs +11 -11
- package/batteries/llm/litert_lm/adapter.mjs +6 -6
- package/batteries/llm/litert_lm/exceptions.cjs +2 -2
- package/batteries/llm/litert_lm/helpers.cjs +7 -7
- package/batteries/llm/litert_lm/helpers.mjs +3 -3
- package/batteries/llm/litert_lm/types.cjs +1 -1
- package/batteries/llm/litert_lm/validation.cjs +4 -4
- package/batteries/llm/litert_lm/validation.mjs +2 -2
- package/batteries/llm/litert_lm.cjs +5 -5
- package/batteries/llm/litert_lm.mjs +1 -1
- package/batteries/llm/ollama/adapter.cjs +9 -9
- package/batteries/llm/ollama/adapter.mjs +6 -6
- package/batteries/llm/ollama/exceptions.cjs +2 -2
- package/batteries/llm/ollama/helpers.cjs +5 -5
- package/batteries/llm/ollama/helpers.mjs +4 -4
- package/batteries/llm/ollama/types.cjs +1 -1
- package/batteries/llm/ollama/validation.cjs +3 -3
- package/batteries/llm/ollama/validation.mjs +1 -1
- package/batteries/llm/ollama.cjs +3 -3
- package/batteries/llm/ollama.mjs +2 -2
- package/batteries/llm/openai_chat_completions/adapter.cjs +9 -9
- package/batteries/llm/openai_chat_completions/adapter.mjs +6 -6
- package/batteries/llm/openai_chat_completions/exceptions.cjs +2 -2
- package/batteries/llm/openai_chat_completions/helpers.cjs +5 -5
- package/batteries/llm/openai_chat_completions/helpers.mjs +4 -4
- package/batteries/llm/openai_chat_completions/types.cjs +1 -1
- package/batteries/llm/openai_chat_completions/validation.cjs +3 -3
- package/batteries/llm/openai_chat_completions/validation.mjs +1 -1
- package/batteries/llm/openai_chat_completions.cjs +3 -3
- package/batteries/llm/openai_chat_completions.mjs +2 -2
- package/batteries/llm/openai_responses/adapter.cjs +9 -9
- package/batteries/llm/openai_responses/adapter.mjs +6 -6
- package/batteries/llm/openai_responses/exceptions.cjs +2 -2
- package/batteries/llm/openai_responses/helpers.cjs +4 -4
- package/batteries/llm/openai_responses/helpers.mjs +3 -3
- package/batteries/llm/openai_responses/types.cjs +1 -1
- package/batteries/llm/openai_responses/validation.cjs +3 -3
- package/batteries/llm/openai_responses/validation.mjs +1 -1
- package/batteries/llm/openai_responses.cjs +3 -3
- package/batteries/llm/openai_responses.mjs +2 -2
- package/batteries/llm/transformers_js/adapter.cjs +11 -11
- package/batteries/llm/transformers_js/adapter.mjs +6 -6
- package/batteries/llm/transformers_js/exceptions.cjs +2 -2
- package/batteries/llm/transformers_js/helpers.cjs +8 -8
- package/batteries/llm/transformers_js/helpers.mjs +3 -3
- package/batteries/llm/transformers_js/model_source.cjs +2 -2
- package/batteries/llm/transformers_js/types.cjs +1 -1
- package/batteries/llm/transformers_js/validation.cjs +4 -4
- package/batteries/llm/transformers_js/validation.mjs +2 -2
- package/batteries/llm/transformers_js.cjs +5 -5
- package/batteries/llm/transformers_js.mjs +1 -1
- package/batteries/llm/webllm_chat_completions/adapter.cjs +10 -10
- package/batteries/llm/webllm_chat_completions/adapter.mjs +6 -6
- package/batteries/llm/webllm_chat_completions/exceptions.cjs +2 -2
- package/batteries/llm/webllm_chat_completions/helpers.cjs +2 -2
- package/batteries/llm/webllm_chat_completions/helpers.mjs +1 -1
- package/batteries/llm/webllm_chat_completions/validation.cjs +3 -3
- package/batteries/llm/webllm_chat_completions/validation.mjs +1 -1
- package/batteries/llm/webllm_chat_completions.cjs +3 -3
- package/batteries/llm/webllm_chat_completions.mjs +2 -2
- package/batteries/llm.cjs +4 -3
- package/batteries/llm.mjs +4 -4
- package/batteries/media/contracts.cjs +2 -2
- package/batteries/media/engines/audio_decode.cjs +3 -3
- package/batteries/media/engines/data.cjs +4 -4
- package/batteries/media/engines/exceljs.cjs +4 -4
- package/batteries/media/engines/execa_executor.cjs +3 -3
- package/batteries/media/engines/fs_workspace.cjs +3 -3
- package/batteries/media/engines/jimp.cjs +3 -3
- package/batteries/media/engines/sharp.cjs +3 -3
- package/batteries/media/engines/sheetjs.cjs +6 -6
- package/batteries/media/engines/sheetjs.cjs.map +1 -1
- package/batteries/media/engines/soffice.cjs +2 -2
- package/batteries/media/engines/tesseract_js.cjs +3 -3
- package/batteries/media/engines/transformers_asr.cjs +3 -3
- package/batteries/media/forge.cjs +8 -8
- package/batteries/media/forge.mjs +4 -4
- package/batteries/media/lint.cjs +2 -2
- package/batteries/media/lint.mjs +1 -1
- package/batteries/media.cjs +6 -6
- package/batteries/orchestration/approval.cjs +2 -2
- package/batteries/orchestration/cells/jexl.cjs +3 -3
- package/batteries/orchestration/cells/lua.cjs +3 -3
- package/batteries/orchestration/cells/structured.cjs +3 -3
- package/batteries/orchestration/conformance.cjs +2 -2
- package/batteries/orchestration/dispatch_reasoner.cjs +6 -6
- package/batteries/orchestration/dispatch_reasoner.mjs +4 -4
- package/batteries/orchestration/encoding.cjs +2 -2
- package/batteries/orchestration/executor.cjs +4 -4
- package/batteries/orchestration/executor.mjs +2 -2
- package/batteries/orchestration/forge.cjs +6 -6
- package/batteries/orchestration/forge.mjs +4 -4
- package/batteries/orchestration/in_memory.cjs +1 -1
- package/batteries/orchestration/ops.cjs +1 -1
- package/batteries/orchestration/outline.cjs +2 -2
- package/batteries/orchestration/plan.cjs +1 -1
- package/batteries/orchestration/raw.cjs +2 -2
- package/batteries/orchestration/reason.cjs +1 -1
- package/batteries/orchestration/render.cjs +2 -2
- package/batteries/orchestration/runs.cjs +1 -1
- package/batteries/orchestration/templates.cjs +2 -2
- package/batteries/orchestration/types.cjs +1 -1
- package/batteries/orchestration/validation.cjs +5 -5
- package/batteries/orchestration/validation.mjs +2 -2
- package/batteries/orchestration.cjs +6 -6
- package/batteries/orchestration.mjs +4 -4
- package/batteries/sandbox/js.cjs +7 -7
- package/batteries/sandbox/js.mjs +2 -2
- package/batteries/sandbox/node.cjs +4 -4
- package/batteries/sandbox/tools.cjs +2 -2
- package/batteries/sandbox/tools.mjs +1 -1
- package/batteries/sandbox.cjs +11 -11
- package/batteries/sandbox.mjs +4 -4
- package/batteries/skills/conformance.cjs +1 -1
- package/batteries/skills/in_memory.cjs +2 -2
- package/batteries/skills.cjs +15 -15
- package/batteries/skills.mjs +10 -10
- package/batteries/specialists/_shared.cjs +2 -2
- package/batteries/specialists/caption/transformers_js/adapter.cjs +3 -3
- package/batteries/specialists/caption/transformers_js/exceptions.cjs +2 -2
- package/batteries/specialists/caption/transformers_js/types.cjs +1 -1
- package/batteries/specialists/caption/transformers_js/validation.cjs +2 -2
- package/batteries/specialists/caption/transformers_js.cjs +1 -1
- package/batteries/specialists/caption.cjs +1 -1
- package/batteries/specialists/ocr/tesseract_js/adapter.cjs +3 -3
- package/batteries/specialists/ocr/tesseract_js/exceptions.cjs +2 -2
- package/batteries/specialists/ocr/tesseract_js/types.cjs +1 -1
- package/batteries/specialists/ocr/tesseract_js/validation.cjs +2 -2
- package/batteries/specialists/ocr/tesseract_js.cjs +1 -1
- package/batteries/specialists/ocr.cjs +1 -1
- package/batteries/specialists/stt/transformers_js.cjs +2 -2
- package/batteries/specialists/stt.cjs +2 -2
- package/batteries/specialists.cjs +2 -2
- package/batteries/storage/flydrive.cjs +2 -2
- package/batteries/storage/in_memory.cjs +2 -2
- package/batteries/storage/opfs.cjs +2 -2
- package/batteries/storage.cjs +1 -1
- package/batteries/tools/_shared.cjs +3 -3
- package/batteries/tools/_shared.mjs +1 -1
- package/batteries/tools/color.cjs +3 -3
- package/batteries/tools/color.mjs +2 -2
- package/batteries/tools/comparison.cjs +4 -4
- package/batteries/tools/comparison.mjs +2 -2
- package/batteries/tools/data_structure.cjs +4 -4
- package/batteries/tools/data_structure.mjs +2 -2
- package/batteries/tools/datetime_extended.cjs +4 -4
- package/batteries/tools/datetime_extended.mjs +3 -3
- package/batteries/tools/datetime_math.cjs +4 -4
- package/batteries/tools/datetime_math.mjs +3 -3
- package/batteries/tools/encoding.cjs +4 -4
- package/batteries/tools/encoding.mjs +2 -2
- package/batteries/tools/formatting.cjs +4 -4
- package/batteries/tools/formatting.mjs +2 -2
- package/batteries/tools/geo_basics.cjs +3 -3
- package/batteries/tools/geo_basics.mjs +2 -2
- package/batteries/tools/math.cjs +4 -4
- package/batteries/tools/math.mjs +2 -2
- package/batteries/tools/memory.cjs +7 -7
- package/batteries/tools/memory.mjs +5 -5
- package/batteries/tools/parsing.cjs +5 -5
- package/batteries/tools/parsing.mjs +3 -3
- package/batteries/tools/retrievables.cjs +7 -7
- package/batteries/tools/retrievables.mjs +5 -5
- package/batteries/tools/scrapper.cjs +2 -2
- package/batteries/tools/scrapper.mjs +1 -1
- package/batteries/tools/searxng.cjs +2 -2
- package/batteries/tools/searxng.mjs +1 -1
- package/batteries/tools/standing_instructions.cjs +5 -5
- package/batteries/tools/standing_instructions.mjs +3 -3
- package/batteries/tools/statistics.cjs +5 -5
- package/batteries/tools/statistics.mjs +3 -3
- package/batteries/tools/string_processing.cjs +4 -4
- package/batteries/tools/string_processing.mjs +2 -2
- package/batteries/tools/structured_data.cjs +4 -4
- package/batteries/tools/structured_data.mjs +2 -2
- package/batteries/tools/text_analysis.cjs +4 -4
- package/batteries/tools/text_analysis.mjs +3 -3
- package/batteries/tools/text_comparison.cjs +3 -3
- package/batteries/tools/text_comparison.mjs +2 -2
- package/batteries/tools/time.cjs +4 -4
- package/batteries/tools/time.mjs +3 -3
- package/batteries/tools/unit_conversion.cjs +3 -3
- package/batteries/tools/unit_conversion.mjs +2 -2
- package/batteries/tools/web_retrieval.cjs +2 -2
- package/batteries/tools.cjs +3 -3
- package/batteries/tools.mjs +2 -2
- package/batteries/tts/_shared.cjs +1 -1
- package/batteries/tts/native/adapter.cjs +2 -2
- package/batteries/tts/native/exceptions.cjs +2 -2
- package/batteries/tts/native/helpers.cjs +1 -1
- package/batteries/tts/native/types.cjs +1 -1
- package/batteries/tts/native/validation.cjs +2 -2
- package/batteries/tts/native.cjs +1 -1
- package/batteries/tts/transformers_js/adapter.cjs +3 -3
- package/batteries/tts/transformers_js/exceptions.cjs +2 -2
- package/batteries/tts/transformers_js/types.cjs +1 -1
- package/batteries/tts/transformers_js/validation.cjs +2 -2
- package/batteries/tts/transformers_js.cjs +1 -1
- package/batteries/tts.cjs +1 -1
- package/batteries/validation/exceptions.cjs +2 -2
- package/batteries/validation/types.cjs +1 -1
- package/batteries/validation/validation.cjs +1 -1
- package/batteries/validation.cjs +7 -7
- package/batteries/validation.mjs +5 -5
- package/batteries/vector/arangodb.cjs +2 -2
- package/batteries/vector/builder.cjs +1 -1
- package/batteries/vector/chroma.cjs +1 -1
- package/batteries/vector/clickhouse.cjs +2 -2
- package/batteries/vector/cloudflare.cjs +2 -2
- package/batteries/vector/conformance.cjs +1 -1
- package/batteries/vector/contract.cjs +1 -1
- package/batteries/vector/couchbase.cjs +2 -2
- package/batteries/vector/duckdb.cjs +2 -2
- package/batteries/vector/elasticsearch.cjs +2 -2
- package/batteries/vector/exceptions.cjs +2 -2
- package/batteries/vector/factory.cjs +1 -1
- package/batteries/vector/filters.cjs +2 -2
- package/batteries/vector/helpers.cjs +1 -1
- package/batteries/vector/hnswlib.cjs +2 -2
- package/batteries/vector/in_memory.cjs +1 -1
- package/batteries/vector/lancedb.cjs +2 -2
- package/batteries/vector/mariadb.cjs +2 -2
- package/batteries/vector/meilisearch.cjs +2 -2
- package/batteries/vector/migrate.cjs +2 -2
- package/batteries/vector/milvus.cjs +1 -1
- package/batteries/vector/mongodb.cjs +2 -2
- package/batteries/vector/neo4j.cjs +2 -2
- package/batteries/vector/opensearch.cjs +2 -2
- package/batteries/vector/oracle23ai.cjs +2 -2
- package/batteries/vector/orama.cjs +1 -1
- package/batteries/vector/pgvector.cjs +1 -1
- package/batteries/vector/pinecone.cjs +2 -2
- package/batteries/vector/plan.cjs +1 -1
- package/batteries/vector/qdrant.cjs +1 -1
- package/batteries/vector/redis.cjs +2 -2
- package/batteries/vector/retrievable.cjs +2 -2
- package/batteries/vector/retrievable.mjs +1 -1
- package/batteries/vector/s3vectors.cjs +2 -2
- package/batteries/vector/schema.cjs +1 -1
- package/batteries/vector/solr.cjs +2 -2
- package/batteries/vector/sqlite_vec.cjs +1 -1
- package/batteries/vector/surrealdb.cjs +2 -2
- package/batteries/vector/types.cjs +1 -1
- package/batteries/vector/typesense.cjs +2 -2
- package/batteries/vector/validation.cjs +1 -1
- package/batteries/vector/vector_store_constructor.cjs +1 -1
- package/batteries/vector/vespa.cjs +2 -2
- package/batteries/vector/weaviate.cjs +2 -2
- package/batteries/vector.cjs +1 -1
- package/batteries.cjs +8 -7
- package/batteries.mjs +6 -6
- package/{chat_common-D7SuSLCM.js → chat_common-B7fvGTKv.cjs} +5 -5
- package/chat_common-B7fvGTKv.cjs.map +1 -0
- package/{chat_common-CJskWIdB.mjs → chat_common-CeoHwSsz.mjs} +2 -2
- package/{chat_common-CJskWIdB.mjs.map → chat_common-CeoHwSsz.mjs.map} +1 -1
- package/claude-code-cli-wrapper.cjs +2 -2
- package/{common-Cb1h54HM.js → common-7gCR3zQu.cjs} +9 -9
- package/common-7gCR3zQu.cjs.map +1 -0
- package/{common-AhsMepUS.mjs → common-B5maOoF_.mjs} +7 -7
- package/{common-AhsMepUS.mjs.map → common-B5maOoF_.mjs.map} +1 -1
- package/{common-BuVhq_3h.js → common-BuVhq_3h.cjs} +1 -1
- package/common-BuVhq_3h.cjs.map +1 -0
- package/common.cjs +8 -8
- package/common.mjs +6 -6
- package/{conformance-T1qEg8Sv.js → conformance-T1qEg8Sv.cjs} +1 -1
- package/conformance-T1qEg8Sv.cjs.map +1 -0
- package/{dispatch_runner-CUOD_SAg.mjs → dispatch_runner-DO7jo_gl.mjs} +5 -5
- package/{dispatch_runner-CUOD_SAg.mjs.map → dispatch_runner-DO7jo_gl.mjs.map} +1 -1
- package/{dispatch_runner-BOfUNRv3.js → dispatch_runner-FlriTyoq.cjs} +7 -7
- package/dispatch_runner-FlriTyoq.cjs.map +1 -0
- package/dispatch_runner.cjs +2 -2
- package/dispatch_runner.mjs +1 -1
- package/{ecmascript-C13G-sie.js → ecmascript-BydSB03Y.cjs} +5 -5
- package/ecmascript-BydSB03Y.cjs.map +1 -0
- package/{ecmascript-qssVTISd.mjs → ecmascript-bgwVyZG1.mjs} +3 -3
- package/{ecmascript-qssVTISd.mjs.map → ecmascript-bgwVyZG1.mjs.map} +1 -1
- package/{error_translation-BCa4wxUL.js → error_translation-D8Ea1_th.cjs} +2 -2
- package/error_translation-D8Ea1_th.cjs.map +1 -0
- package/{escape-COeB923i.js → escape-C12OWStb.cjs} +3 -3
- package/escape-C12OWStb.cjs.map +1 -0
- package/eslint/rules/artifact_tool_forbids_artifact_constructor.cjs +2 -2
- package/eslint/rules/no_model_in_tool_handler.cjs +2 -2
- package/eslint/rules/require_string_empty_disposition.cjs +2 -2
- package/eslint/rules/require_validator_any_required.cjs +2 -2
- package/eslint/rules/thought_payload_requires_replay_tag.cjs +2 -2
- package/eslint/rules/token_encoding_requires_context_window.cjs +2 -2
- package/eslint/rules.cjs +2 -2
- package/eslint/rules.mjs +1 -1
- package/eslint.cjs +3 -3
- package/eslint.mjs +2 -2
- package/{exceptions-Dlw1Jr6E.js → exceptions-Bc1s_ld5.cjs} +2 -2
- package/exceptions-Bc1s_ld5.cjs.map +1 -0
- package/{exceptions-BY1RQNVP.js → exceptions-BwGzlXoz.cjs} +2 -2
- package/exceptions-BwGzlXoz.cjs.map +1 -0
- package/{exceptions-DrHnAGQz.js → exceptions-DrHnAGQz.cjs} +1 -1
- package/exceptions-DrHnAGQz.cjs.map +1 -0
- package/exceptions.cjs +3 -3
- package/factories.cjs +2 -2
- package/forge.cjs +3 -3
- package/forge.mjs +2 -2
- package/{formats-DZVuqZUN.js → formats-DZVuqZUN.cjs} +1 -1
- package/formats-DZVuqZUN.cjs.map +1 -0
- package/{fs_node-WwUEiuo6.js → fs_node-XvgZtNJV.cjs} +2 -2
- package/fs_node-XvgZtNJV.cjs.map +1 -0
- package/{function_serializer-ChL2I8Kq.js → function_serializer-D1Kyicai.cjs} +3 -3
- package/function_serializer-D1Kyicai.cjs.map +1 -0
- package/{gpu_budget-BBIUyLoj.js → gpu_budget-BBIUyLoj.cjs} +1 -1
- package/gpu_budget-BBIUyLoj.cjs.map +1 -0
- package/{guards-05Uq3J4M.js → guards-5-XmJgD2.cjs} +2 -2
- package/guards-5-XmJgD2.cjs.map +1 -0
- package/guards.cjs +10 -10
- package/guards.mjs +7 -7
- package/{helpers-So6bNfJp.mjs → helpers-C1T0DV8Q.mjs} +3 -3
- package/{helpers-So6bNfJp.mjs.map → helpers-C1T0DV8Q.mjs.map} +1 -1
- package/{helpers-C_1dcP_X.js → helpers-Dcp4CrOz.cjs} +4 -4
- package/helpers-Dcp4CrOz.cjs.map +1 -0
- package/index.cjs +14 -14
- package/index.mjs +11 -11
- package/{isolation-7Jrcucgc.js → isolation-B01xCIoV.cjs} +5 -5
- package/isolation-B01xCIoV.cjs.map +1 -0
- package/lib/classes/identity.d.ts +6 -3
- package/lib/helpers/bignum.cjs +1 -1
- package/lib/utils/audio.cjs +1 -1
- package/lib/utils/retry.cjs +1 -1
- package/{lifecycle-vYQJ2rmf.js → lifecycle-vYQJ2rmf.cjs} +1 -1
- package/lifecycle-vYQJ2rmf.cjs.map +1 -0
- package/{manifest-iMAmSDay.js → manifest-IP1IOJcg.cjs} +4 -4
- package/manifest-IP1IOJcg.cjs.map +1 -0
- package/mcp/adk-docs-corpus.json +2 -2
- package/package.json +478 -478
- package/{patch-BXX9Q0FM.js → patch-BXX9Q0FM.cjs} +1 -1
- package/patch-BXX9Q0FM.cjs.map +1 -0
- package/{predicates-f3wvKYT8.js → predicates-Bzaa7gNI.cjs} +3 -3
- package/predicates-Bzaa7gNI.cjs.map +1 -0
- package/{retrievable-CksTfjbY.js → retrievable-BBwiACtw.cjs} +5 -5
- package/retrievable-BBwiACtw.cjs.map +1 -0
- package/{retrievable-HjKe5mOD.mjs → retrievable-CrGKx4sc.mjs} +3 -3
- package/{retrievable-HjKe5mOD.mjs.map → retrievable-CrGKx4sc.mjs.map} +1 -1
- package/{sandbox-utils-DLCceTeU.js → sandbox-utils-D12AZhWE.cjs} +2 -2
- package/sandbox-utils-D12AZhWE.cjs.map +1 -0
- package/{scrapper-CkooTUAD.js → scrapper-BibKj8qE.cjs} +6 -6
- package/scrapper-BibKj8qE.cjs.map +1 -0
- package/{scrapper-_dWwuDJg.mjs → scrapper-_JzgbLG5.mjs} +4 -4
- package/{scrapper-_dWwuDJg.mjs.map → scrapper-_JzgbLG5.mjs.map} +1 -1
- package/{searxng-DXzj0o8E.js → searxng-C6xrLW-v.cjs} +6 -6
- package/searxng-C6xrLW-v.cjs.map +1 -0
- package/{searxng-PnrXrrLE.mjs → searxng-D-nA2gEI.mjs} +4 -4
- package/{searxng-PnrXrrLE.mjs.map → searxng-D-nA2gEI.mjs.map} +1 -1
- package/{server-CnUZcn6e.js → server-CkVjzQaC.cjs} +2 -2
- package/server-CkVjzQaC.cjs.map +1 -0
- package/server.json +2 -2
- package/{shell-quote-CIuPmePF.js → shell-quote-BUxBTn3M.cjs} +2 -2
- package/shell-quote-BUxBTn3M.cjs.map +1 -0
- package/shims.cjs +2 -2
- package/skills/adk-assembly/SKILL.md +2 -2
- package/{spooled_artifact-DKZd7fgs.js → spooled_artifact-BLgbGT8b.cjs} +733 -733
- package/spooled_artifact-BLgbGT8b.cjs.map +1 -0
- package/{spooled_artifact-BMtuIsu6.mjs → spooled_artifact-BkOe4-j-.mjs} +731 -731
- package/spooled_artifact-BkOe4-j-.mjs.map +1 -0
- package/spooled_artifact.cjs +3 -3
- package/spooled_artifact.mjs +2 -2
- package/{spooled_markdown_artifact-BrMoR7ck.js → spooled_markdown_artifact-8zdejfcJ.cjs} +5 -5
- package/spooled_markdown_artifact-8zdejfcJ.cjs.map +1 -0
- package/{spooled_markdown_artifact-g4CPr86y.mjs → spooled_markdown_artifact-Dnl-lCGv.mjs} +3 -3
- package/{spooled_markdown_artifact-g4CPr86y.mjs.map → spooled_markdown_artifact-Dnl-lCGv.mjs.map} +1 -1
- package/{thought-BEsItcp_.mjs → thought-BrQt6HAb.mjs} +47 -6
- package/thought-BrQt6HAb.mjs.map +1 -0
- package/{thought-DTgeATDv.js → thought-COeZTQ-B.cjs} +49 -8
- package/thought-COeZTQ-B.cjs.map +1 -0
- package/{tokenizable-KwA7jyGQ.js → tokenizable-DDIdXbJN.cjs} +3 -3
- package/tokenizable-DDIdXbJN.cjs.map +1 -0
- package/{tool_call-Cahji8ZY.mjs → tool_call-8crmZsO8.mjs} +4 -4
- package/{tool_call-Cahji8ZY.mjs.map → tool_call-8crmZsO8.mjs.map} +1 -1
- package/{tool_call-kx4WQ0-j.js → tool_call-JbjeUpRK.cjs} +6 -6
- package/tool_call-JbjeUpRK.cjs.map +1 -0
- package/{tool_parsers-csSBFWob.js → tool_parsers-8_qO0a_F.cjs} +2 -2
- package/tool_parsers-8_qO0a_F.cjs.map +1 -0
- package/{tools-BepwIVtl.mjs → tools-BC4NJqZD.mjs} +6 -6
- package/{tools-BepwIVtl.mjs.map → tools-BC4NJqZD.mjs.map} +1 -1
- package/{tools-zV-_O2MB.js → tools-D4mdzi0a.cjs} +9 -9
- package/tools-D4mdzi0a.cjs.map +1 -0
- package/{toon-F-e_k2jV.mjs → toon-BA9Q7NHG.mjs} +5 -5
- package/{toon-F-e_k2jV.mjs.map → toon-BA9Q7NHG.mjs.map} +1 -1
- package/{toon-gA82H1sN.js → toon-b-0pFKZ8.cjs} +7 -7
- package/toon-b-0pFKZ8.cjs.map +1 -0
- package/{transformers_js-C050gRfd.js → transformers_js-7OzeS_Tp.cjs} +4 -4
- package/transformers_js-7OzeS_Tp.cjs.map +1 -0
- package/{turn_runner-BdeNNvo0.mjs → turn_runner-BmVXcBZ2.mjs} +5 -5
- package/{turn_runner-BdeNNvo0.mjs.map → turn_runner-BmVXcBZ2.mjs.map} +1 -1
- package/{turn_runner-CF5LExb8.js → turn_runner-DX-3s3ih.cjs} +7 -7
- package/turn_runner-DX-3s3ih.cjs.map +1 -0
- package/turn_runner.cjs +2 -2
- package/turn_runner.mjs +1 -1
- package/{type_guards-BAhiOypL-C2eOOyxU.js → type_guards-BAhiOypL-C2eOOyxU.cjs} +1 -1
- package/{type_guards-BAhiOypL-C2eOOyxU.js.map → type_guards-BAhiOypL-C2eOOyxU.cjs.map} +1 -1
- package/{type_guards-DuKwiYgg.js → type_guards-BWTKysPt.cjs} +2 -2
- package/{types-DrSosVaM.js → types-DWOiL208.cjs} +4 -4
- package/types-DWOiL208.cjs.map +1 -0
- package/types.cjs +1 -1
- package/{validate-CkQI-48O.js → validate-tUm9MY8y.cjs} +3 -3
- package/validate-tUm9MY8y.cjs.map +1 -0
- package/{xlsx-B0sTpEC2.js → xlsx-Dtql4S-9.cjs} +2 -2
- package/xlsx-Dtql4S-9.cjs.map +1 -0
- package/{xlsx.zahl-ZIcUQVv8.js → xlsx.zahl-C9pM7cyt.cjs} +2 -2
- package/xlsx.zahl-C9pM7cyt.cjs.map +1 -0
- package/{xml-CT28gSkh.mjs → xml-B1JIGLpU.mjs} +5 -5
- package/{xml-CT28gSkh.mjs.map → xml-B1JIGLpU.mjs.map} +1 -1
- package/{xml-DVjBQkhb.js → xml-fvwTsoRv.cjs} +7 -7
- package/xml-fvwTsoRv.cjs.map +1 -0
- package/{yaml-DiHPF0nY.mjs → yaml-1mP4uxdf.mjs} +5 -5
- package/{yaml-DiHPF0nY.mjs.map → yaml-1mP4uxdf.mjs.map} +1 -1
- package/{yaml-Dt82CpYv.js → yaml-DPUTumla.cjs} +7 -7
- package/yaml-DPUTumla.cjs.map +1 -0
- package/arg_specs-iYmIM3wI.js.map +0 -1
- package/artifact_methods-CIQgBCKp.mjs +0 -1
- package/artifact_methods-Cjypa7oU.js +0 -1
- package/chat_common-D7SuSLCM.js.map +0 -1
- package/common-BuVhq_3h.js.map +0 -1
- package/common-Cb1h54HM.js.map +0 -1
- package/conformance-T1qEg8Sv.js.map +0 -1
- package/dispatch_runner-BOfUNRv3.js.map +0 -1
- package/ecmascript-C13G-sie.js.map +0 -1
- package/error_translation-BCa4wxUL.js.map +0 -1
- package/escape-COeB923i.js.map +0 -1
- package/exceptions-BY1RQNVP.js.map +0 -1
- package/exceptions-Dlw1Jr6E.js.map +0 -1
- package/exceptions-DrHnAGQz.js.map +0 -1
- package/formats-DZVuqZUN.js.map +0 -1
- package/fs_node-WwUEiuo6.js.map +0 -1
- package/function_serializer-ChL2I8Kq.js.map +0 -1
- package/gpu_budget-BBIUyLoj.js.map +0 -1
- package/guards-05Uq3J4M.js.map +0 -1
- package/helpers-C_1dcP_X.js.map +0 -1
- package/isolation-7Jrcucgc.js.map +0 -1
- package/lifecycle-vYQJ2rmf.js.map +0 -1
- package/manifest-iMAmSDay.js.map +0 -1
- package/patch-BXX9Q0FM.js.map +0 -1
- package/predicates-f3wvKYT8.js.map +0 -1
- package/retrievable-CksTfjbY.js.map +0 -1
- package/sandbox-utils-DLCceTeU.js.map +0 -1
- package/scrapper-CkooTUAD.js.map +0 -1
- package/searxng-DXzj0o8E.js.map +0 -1
- package/server-CnUZcn6e.js.map +0 -1
- package/shell-quote-CIuPmePF.js.map +0 -1
- package/spooled_artifact-BMtuIsu6.mjs.map +0 -1
- package/spooled_artifact-DKZd7fgs.js.map +0 -1
- package/spooled_markdown_artifact-BrMoR7ck.js.map +0 -1
- package/thought-BEsItcp_.mjs.map +0 -1
- package/thought-DTgeATDv.js.map +0 -1
- package/tokenizable-KwA7jyGQ.js.map +0 -1
- package/tool_call-kx4WQ0-j.js.map +0 -1
- package/tool_parsers-csSBFWob.js.map +0 -1
- package/tools-zV-_O2MB.js.map +0 -1
- package/toon-gA82H1sN.js.map +0 -1
- package/transformers_js-C050gRfd.js.map +0 -1
- package/turn_runner-CF5LExb8.js.map +0 -1
- package/types-DrSosVaM.js.map +0 -1
- package/validate-CkQI-48O.js.map +0 -1
- package/xlsx-B0sTpEC2.js.map +0 -1
- package/xlsx.zahl-ZIcUQVv8.js.map +0 -1
- package/xml-DVjBQkhb.js.map +0 -1
- package/yaml-Dt82CpYv.js.map +0 -1
- /package/{chunk-Cek0wNdY.js → chunk-Cek0wNdY.cjs} +0 -0
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
* checked client-side when `tokenEncoding` and `contextWindow` are configured.
|
|
23
23
|
*/
|
|
24
24
|
export { ClaudeCodeCliAdapter, resolveDefaultWrapperPath } from "./adapter";
|
|
25
|
+
export { deCollideToolCallIds } from "../chat_common/index";
|
|
25
26
|
export { descriptionToChatCompletionsJsonSchema, defaultDescriptionToChatCompletionsJsonSchema, renderUntrustedContent, defaultRenderUntrustedContent, renderTrustedContent, defaultRenderTrustedContent, renderStandingInstructions, defaultRenderStandingInstructions, renderMemories, defaultRenderMemories, renderRetrievableSafetyDirective, defaultRenderRetrievableSafetyDirective, renderFirstPartyRetrievables, defaultRenderFirstPartyRetrievables, renderThirdPartyPublicRetrievables, defaultRenderThirdPartyPublicRetrievables, renderThirdPartyPrivateRetrievables, defaultRenderThirdPartyPrivateRetrievables, renderRetrievables, defaultRenderRetrievables, renderRetrievableHandleBody, defaultRenderRetrievableHandleBody, renderArtifactHandleBody, defaultRenderArtifactHandleBody, renderThought, defaultRenderThought, filterThoughts, defaultFilterThoughts, toolsToChatCompletionsTools, defaultToolsToChatCompletionsTools, renderChatCompletionsSystemPrompt, defaultRenderChatCompletionsSystemPrompt, renderClaudeCodeCliTimelineMessage, defaultRenderClaudeCodeCliTimelineMessage, renderClaudeCodeCliToolCallResult, defaultRenderClaudeCodeCliToolCallResult, buildClaudeCodeCliPrompt, defaultBuildClaudeCodeCliPrompt, } from "./helpers";
|
|
26
|
-
export type { DescriptionLike, JsonSchema, UntrustedContentAttrs, TrustedContentAttrs, StandingInstructionAttrs, MemoryAttrs, RetrievableAttrs, ThoughtAttrs, ChatCompletionsBucketLabel, ChatCompletionsBucketOrder, ChatCompletionsTool, UnsupportedMediaPolicy, ChatCompletionsRetryConfig, ChatHelpersCommon, ClaudeCodeCliHelpers, ClaudeCodeCliAdapterOptions, ExecaLike, ExecaResolver, ClaudeCodeCliExtraArg, WrapperBridgedTool, WrapperAuth, WrapperRunCommand, WrapperToolResultContentBlock, WrapperToolCallResponseCommand, WrapperShutdownCommand, WrapperCommand, WrapperReadyEvent, WrapperInitEvent, WrapperMessageDeltaEvent, WrapperThoughtDeltaEvent, WrapperToolCallRequestEvent, WrapperRetryEvent, WrapperResultEvent, WrapperErrorEvent, WrapperLogEvent, WrapperShutdownCompleteEvent, WrapperEvent, } from "./types";
|
|
27
|
+
export type { DescriptionLike, JsonSchema, UntrustedContentAttrs, TrustedContentAttrs, StandingInstructionAttrs, MemoryAttrs, RetrievableAttrs, ThoughtAttrs, ChatCompletionsBucketLabel, ChatCompletionsBucketOrder, ChatCompletionsTool, UnsupportedMediaPolicy, ChatCompletionsRetryConfig, ChatHelpersCommon, ToolCallIdFilterFn, ClaudeCodeCliHelpers, ClaudeCodeCliAdapterOptions, ExecaLike, ExecaResolver, ClaudeCodeCliExtraArg, WrapperBridgedTool, WrapperAuth, WrapperRunCommand, WrapperToolResultContentBlock, WrapperToolCallResponseCommand, WrapperShutdownCommand, WrapperCommand, WrapperReadyEvent, WrapperInitEvent, WrapperMessageDeltaEvent, WrapperThoughtDeltaEvent, WrapperToolCallRequestEvent, WrapperRetryEvent, WrapperResultEvent, WrapperErrorEvent, WrapperLogEvent, WrapperShutdownCompleteEvent, WrapperEvent, } from "./types";
|
|
27
28
|
export { claudeCodeCliOptionsSchema, validateOptions } from "./validation";
|
|
28
|
-
export { E_INVALID_CLAUDE_CODE_CLI_OPTIONS, E_CLAUDE_CODE_CLI_BINARY_NOT_FOUND, E_CLAUDE_CODE_CLI_WRAPPER_SPAWN_ERROR, E_CLAUDE_CODE_CLI_WRAPPER_CRASHED, E_CLAUDE_CODE_CLI_PROCESS_EXITED_NONZERO, E_CLAUDE_CODE_CLI_STREAM_ERROR, E_CLAUDE_CODE_CLI_STREAM_STALLED, E_CLAUDE_CODE_CLI_STARTUP_TIMEOUT, E_CLAUDE_CODE_CLI_MCP_BRIDGE_STARTUP_FAILED, E_CLAUDE_CODE_CLI_TURN_FAILED, E_CLAUDE_CODE_CLI_CONTEXT_OVERFLOW, E_CLAUDE_CODE_CLI_UNSUPPORTED_MEDIA_MODALITY, } from "./exceptions";
|
|
29
|
+
export { E_INVALID_CLAUDE_CODE_CLI_OPTIONS, E_CLAUDE_CODE_CLI_BINARY_NOT_FOUND, E_CLAUDE_CODE_CLI_WRAPPER_NOT_FOUND, E_CLAUDE_CODE_CLI_WRAPPER_SPAWN_ERROR, E_CLAUDE_CODE_CLI_WRAPPER_CRASHED, E_CLAUDE_CODE_CLI_PROCESS_EXITED_NONZERO, E_CLAUDE_CODE_CLI_STREAM_ERROR, E_CLAUDE_CODE_CLI_STREAM_STALLED, E_CLAUDE_CODE_CLI_STARTUP_TIMEOUT, E_CLAUDE_CODE_CLI_MCP_BRIDGE_STARTUP_FAILED, E_CLAUDE_CODE_CLI_TURN_FAILED, E_CLAUDE_CODE_CLI_CONTEXT_OVERFLOW, E_CLAUDE_CODE_CLI_UNSUPPORTED_MEDIA_MODALITY, } from "./exceptions";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../../chunk-Cek0wNdY.
|
|
2
|
+
require("../../../chunk-Cek0wNdY.cjs");
|
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
import type { ClaudeCodeCliExtraArg } from "./wire";
|
|
15
15
|
import type { SpoolStore } from "../../../common";
|
|
16
16
|
import type { TokenEncodingId } from "../../../types";
|
|
17
|
-
import type { ChatCompletionsBucketOrder, UnsupportedMediaPolicy, ChatHelpersCommon } from "../chat_common/types";
|
|
17
|
+
import type { ChatCompletionsBucketOrder, UnsupportedMediaPolicy, ChatHelpersCommon, ToolCallIdFilterFn } from "../chat_common/types";
|
|
18
18
|
import type { Tokenizable, Memory, Message, Thought, ToolCall, Retrievable, Tool, ArtifactTool, ToolRegistry, SpooledArtifact, Media } from "../../../common";
|
|
19
19
|
export type { DescriptionLike, JsonSchema, UntrustedContentAttrs, TrustedContentAttrs, StandingInstructionAttrs, MemoryAttrs, RetrievableAttrs, ThoughtAttrs, ChatCompletionsBucketLabel, ChatCompletionsBucketOrder, ChatCompletionsTool, UnsupportedMediaPolicy, ChatCompletionsRetryConfig, ChatHelpersCommon, } from "../chat_common/types";
|
|
20
|
+
export type { ToolCallIdFilterFn } from "../chat_common/types";
|
|
20
21
|
export type { ClaudeCodeCliExtraArg, WrapperBridgedTool, WrapperAuth, WrapperRunCommand, WrapperToolResultContentBlock, WrapperToolCallResponseCommand, WrapperShutdownCommand, WrapperCommand, WrapperReadyEvent, WrapperInitEvent, WrapperMessageDeltaEvent, WrapperThoughtDeltaEvent, WrapperToolCallRequestEvent, WrapperRetryEvent, WrapperResultEvent, WrapperErrorEvent, WrapperLogEvent, WrapperShutdownCompleteEvent, WrapperEvent, } from "./wire";
|
|
21
22
|
/**
|
|
22
23
|
* Full translation-helper contract for the Claude Code CLI battery. Extends the wire-shape-
|
|
@@ -140,7 +141,13 @@ export type ExecaResolver = ExecaLike | (() => ExecaLike | {
|
|
|
140
141
|
export interface ClaudeCodeCliAdapterOptions {
|
|
141
142
|
/** The `execa` function or an async resolver for it. Defaults to a lazy dynamic import of the `execa` package (optional peer). */
|
|
142
143
|
execa?: ExecaResolver;
|
|
143
|
-
/**
|
|
144
|
+
/**
|
|
145
|
+
* Overridable path to the built wrapper asset. Defaults to `resolveDefaultWrapperPath()`,
|
|
146
|
+
* falling back to a package-self-reference lookup if that path does not exist on disk (e.g.
|
|
147
|
+
* this adapter was bundled by a consumer, relocating it outside `@nhtio/adk`'s own directory
|
|
148
|
+
* tree). Set this explicitly if both of those fail — surfaced as
|
|
149
|
+
* {@link @nhtio/adk/batteries/llm/claude_code_cli!E_CLAUDE_CODE_CLI_WRAPPER_NOT_FOUND}.
|
|
150
|
+
*/
|
|
144
151
|
wrapperPath?: string;
|
|
145
152
|
/** Path to the `claude` binary. Defaults to `'claude'` (resolved via `PATH`). */
|
|
146
153
|
claudeBin?: string;
|
|
@@ -200,6 +207,33 @@ export interface ClaudeCodeCliAdapterOptions {
|
|
|
200
207
|
disableNonessentialTraffic?: boolean;
|
|
201
208
|
/** Unique identity label for the assistant instance. */
|
|
202
209
|
selfIdentity?: string;
|
|
210
|
+
/**
|
|
211
|
+
* Ingress hook for adapting the wrapper's per-spawn `requestId` into the ADK-facing tool-call
|
|
212
|
+
* id.
|
|
213
|
+
*
|
|
214
|
+
* @remarks
|
|
215
|
+
* Unlike every other Chat-family battery (where this hook is opt-in and its absence means
|
|
216
|
+
* pass-through), this battery's wrapper protocol resets its `requestId` counter to `"0"` on
|
|
217
|
+
* EVERY spawn (see `mcp_bridge.ts`), and a fresh wrapper is spawned per dispatch ITERATION —
|
|
218
|
+
* so a multi-iteration turn structurally guarantees a same-id collision the moment a second
|
|
219
|
+
* tool-calling iteration occurs, not merely as a vendor/model quirk. Concretely, a same-id
|
|
220
|
+
* collision trips one of two DIFFERENT id-tracking structures depending on the shape of the
|
|
221
|
+
* turn: `DispatchExecutorHelpers.reportToolCall`'s own internal per-dispatch bookkeeping (an
|
|
222
|
+
* id -> stream-state map local to `dispatch_runner.ts`'s `#buildHelpers`, which throws `tool
|
|
223
|
+
* call "<id>" is already complete` on a duplicate) if the earlier call with that id already
|
|
224
|
+
* completed within the SAME dispatch's helpers instance; or `ctx.turnToolCalls` (the
|
|
225
|
+
* `Set<ToolCall>` `deCollideToolCallIds` itself inspects to pick a fresh id) if the collision is
|
|
226
|
+
* against a call recorded in an EARLIER iteration of the same turn. These are two distinct
|
|
227
|
+
* pieces of state, not one — this option's default only needs to satisfy the second, since
|
|
228
|
+
* {@link @nhtio/adk!deCollideToolCallIds} renames the id BEFORE it ever reaches
|
|
229
|
+
* `reportToolCall`, which is what prevents both. Left unset, this defaults to
|
|
230
|
+
* {@link @nhtio/adk!deCollideToolCallIds} — NOT identity pass-through — so the crash this option
|
|
231
|
+
* exists to prevent cannot happen by omission; set an explicit filter (or `(id) => id` to opt
|
|
232
|
+
* back into raw pass-through) only if a different id strategy is required. The wrapper's OWN
|
|
233
|
+
* `requestId` (used to correlate the `tool_call_response` written back over the wire) is never
|
|
234
|
+
* affected by this hook — only the ADK-facing `ToolCall.id`/`callId` are renamed.
|
|
235
|
+
*/
|
|
236
|
+
toolCallIdFilter?: ToolCallIdFilterFn;
|
|
203
237
|
/** Whether the executor acks automatically on a tool-call-free terminal answer. */
|
|
204
238
|
autoAck?: boolean;
|
|
205
239
|
/** Forwarded to `--forward-subagent-text` when true. Default false — subagent text is invisible by default (documented v1 limitation). */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../../chunk-Cek0wNdY.
|
|
3
|
-
const require_tokenizable = require("../../../tokenizable-
|
|
4
|
-
const require_common = require("../../../common-
|
|
2
|
+
require("../../../chunk-Cek0wNdY.cjs");
|
|
3
|
+
const require_tokenizable = require("../../../tokenizable-DDIdXbJN.cjs");
|
|
4
|
+
const require_common = require("../../../common-7gCR3zQu.cjs");
|
|
5
5
|
require("../../../guards.cjs");
|
|
6
6
|
const require_batteries_llm_claude_code_cli_exceptions = require("./exceptions.cjs");
|
|
7
7
|
let _nhtio_validation = require("@nhtio/validation");
|
|
@@ -75,6 +75,7 @@ var claudeCodeCliOptionsSchema = _nhtio_validation.validator.object({
|
|
|
75
75
|
maxBudgetUsd: _nhtio_validation.validator.number().min(0).optional(),
|
|
76
76
|
fallbackModel: _nhtio_validation.validator.array().items(_nhtio_validation.validator.string().min(1)).optional(),
|
|
77
77
|
selfIdentity: _nhtio_validation.validator.string().min(1).default("assistant"),
|
|
78
|
+
toolCallIdFilter: _nhtio_validation.validator.function().optional(),
|
|
78
79
|
autoAck: _nhtio_validation.validator.boolean().default(false),
|
|
79
80
|
forwardSubagentText: _nhtio_validation.validator.boolean().default(false),
|
|
80
81
|
bucketOrder: bucketOrderSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.cjs","names":[],"sources":["../../../../src/batteries/llm/claude_code_cli/validation.ts"],"sourcesContent":["/**\n * Runtime validation schema and wrapper for Claude Code CLI adapter options.\n *\n * @module @nhtio/adk/batteries/llm/claude_code_cli/validation\n *\n * @remarks\n * Schema and call-site wrapper for validating `ClaudeCodeCliAdapterOptions`. Used at construction\n * time and at the start of every iteration against the merged options shape (stash > executor >\n * constructor). Throws `E_INVALID_CLAUDE_CODE_CLI_OPTIONS` on failure — same hard-fail policy as\n * every other ADK contract.\n *\n * Three invariants enforced here that have no equivalent in the other LLM batteries:\n * - `apiKey`/`authToken` are mutually exclusive AND at least one is required (`.xor`).\n * - `extraArgs` entries are validated against a strict six-flag allowlist, with per-flag value\n * arity, and every value string is rejected if it starts with `-` — the fix for the `--betas`\n * variadic-value injection hazard (a value string spelling another flag would otherwise reach\n * the CLI's own argv parser as a distinct token).\n * - `process.platform` is checked at validation time: this battery is POSIX-only in v1 (reliable\n * process-group control requires POSIX process groups), mirroring\n * `src/batteries/sandbox/node/srt_enforcer.ts`'s own platform-boundary precedent.\n */\n\nimport { isError } from '@nhtio/adk/guards'\nimport { validator, ValidationError } from '@nhtio/validation'\nimport { E_INVALID_CLAUDE_CODE_CLI_OPTIONS } from './exceptions'\nimport { byteStoreSchema, TokenEncoding } from '@nhtio/adk/common'\nimport type { ClaudeCodeCliAdapterOptions } from './types'\n\n// ─── Sub-schemas ──────────────────────────────────────────────────────────────\n\nconst bucketLabelSchema = validator\n .string()\n .valid('standingInstructions', 'memories', 'retrievables', 'timeline')\n\nconst bucketOrderSchema = validator\n .array()\n .items(bucketLabelSchema)\n .unique()\n .default(['standingInstructions', 'memories', 'retrievables', 'timeline'])\n\nconst tokenEncodingSchema = validator\n .alternatives(\n // Known values are suggestions from the canonical list, not a whitelist: consumers may provide\n // a custom or newer tokenizer name. The field accepts any non-empty string, explicit null, or\n // absent (undefined = \"no token counting\"). `.optional()` preserves the null/undefined\n // disposition required by adk/require-validator-any-required.\n validator\n .string()\n .min(1)\n .description(`Known encodings: ${TokenEncoding.join(', ')}`),\n validator.any().valid(null).optional()\n )\n .default(null)\n\nconst unsupportedMediaPolicySchema = validator\n .alternatives(\n validator.string().valid('throw', 'fallback-stash', 'synthetic-description'),\n validator\n .object({\n mode: validator.string().valid('fallback-stash').required(),\n stashKeys: validator.array().items(validator.string().min(1)).required(),\n })\n .unknown(false)\n )\n .default('throw')\n\nconst helperSchema = validator.function()\n\nconst helpersSchema = validator\n .object({\n descriptionToChatCompletionsJsonSchema: helperSchema.optional(),\n renderUntrustedContent: helperSchema.optional(),\n renderTrustedContent: helperSchema.optional(),\n renderStandingInstructions: helperSchema.optional(),\n renderMemories: helperSchema.optional(),\n renderRetrievables: helperSchema.optional(),\n renderRetrievableHandleBody: helperSchema.optional(),\n renderRetrievableSafetyDirective: helperSchema.optional(),\n renderFirstPartyRetrievables: helperSchema.optional(),\n renderThirdPartyPublicRetrievables: helperSchema.optional(),\n renderThirdPartyPrivateRetrievables: helperSchema.optional(),\n renderThought: helperSchema.optional(),\n filterThoughts: helperSchema.optional(),\n toolsToChatCompletionsTools: helperSchema.optional(),\n renderChatCompletionsSystemPrompt: helperSchema.optional(),\n renderClaudeCodeCliTimelineMessage: helperSchema.optional(),\n renderClaudeCodeCliToolCallResult: helperSchema.optional(),\n buildClaudeCodeCliPrompt: helperSchema.optional(),\n })\n .unknown(false)\n\n// `extraArgs`: a structured allowlist, not a flat string[]. Every value string, in every\n// position, is rejected if it starts with `-` — the fix for the --betas injection hazard.\nconst NOT_A_FLAG_RE = /^(?!-).+$/\n\nconst singleValueSchema = validator.string().min(1).pattern(NOT_A_FLAG_RE)\nconst multiValueSchema = validator\n .array()\n .items(validator.string().min(1).pattern(NOT_A_FLAG_RE))\n .min(1)\n\nconst extraArgSchema = validator\n .alternatives(\n // --betas is the only flag accepting a string[] value.\n validator\n .object({\n flag: validator.string().valid('--betas').required(),\n value: multiValueSchema.required(),\n })\n .unknown(false),\n // --prompt-suggestions is the only flag with an OPTIONAL value.\n validator\n .object({\n flag: validator.string().valid('--prompt-suggestions').required(),\n value: singleValueSchema.optional(),\n })\n .unknown(false),\n // Every remaining allowlisted flag requires a single non-empty, non-flag-shaped string value.\n validator\n .object({\n flag: validator.string().valid('--effort', '--agent', '--json-schema', '--name').required(),\n value: singleValueSchema.required(),\n })\n .unknown(false)\n )\n .required()\n\nconst extraArgsSchema = validator.array().items(extraArgSchema).optional()\n\n// ─── Top-level schema ─────────────────────────────────────────────────────────\n\n/**\n * Validator schema for `ClaudeCodeCliAdapterOptions`. Used by `validateOptions` at construction\n * time and again at the start of every iteration after options have been merged (stash > executor\n * > constructor). Rejects unknown top-level keys so typos fail loud.\n */\nexport const claudeCodeCliOptionsSchema = validator\n .object<ClaudeCodeCliAdapterOptions>({\n // ADK control\n execa: validator.function().optional(),\n wrapperPath: validator.string().optional(),\n claudeBin: validator.string().default('claude'),\n appendSystemPrompt: validator.string().optional(),\n apiKey: validator.string().optional(),\n authToken: validator.string().optional(),\n baseURL: validator.string().optional(),\n cwd: validator.string().optional(),\n addDir: validator.array().items(validator.string().min(1)).optional(),\n disallowedTools: validator.array().items(validator.string().min(1)).default([]),\n maxTurns: validator\n .number()\n .valid(1)\n .messages({\n 'any.only':\n 'maxTurns is deprecated and inert: single-turn dispatch is the fixed battery contract; ' +\n 'only maxTurns: 1 is accepted, and the option is ignored because argv always carries --max-turns 1.',\n })\n .optional(),\n contextWindow: validator.number().integer().min(1).optional(),\n tokenEncoding: tokenEncodingSchema,\n maxBudgetUsd: validator.number().min(0).optional(),\n fallbackModel: validator.array().items(validator.string().min(1)).optional(),\n selfIdentity: validator.string().min(1).default('assistant'),\n autoAck: validator.boolean().default(false),\n forwardSubagentText: validator.boolean().default(false),\n bucketOrder: bucketOrderSchema,\n thoughtSurfacing: validator\n .string()\n .valid('all-self', 'latest-self', 'all')\n .default('all-self'),\n replayCompatibility: validator.array().items(validator.string().min(1)).default([]),\n helpers: helpersSchema.optional(),\n spoolStore: byteStoreSchema.optional(),\n unsupportedMediaPolicy: unsupportedMediaPolicySchema,\n unsupportedResultMediaPolicy: unsupportedMediaPolicySchema,\n extraArgs: extraArgsSchema,\n\n // CLI-native safety caps / timeouts\n streamIdleTimeoutMs: validator.number().integer().min(0).default(60_000),\n startupTimeoutMs: validator.number().integer().min(0).default(45_000),\n disposeGraceMs: validator.number().integer().min(0).default(2_000),\n mcpToolIdleTimeoutMs: validator.number().integer().min(0).optional(),\n disableTelemetry: validator.boolean().optional(),\n disableErrorReporting: validator.boolean().optional(),\n disableNonessentialTraffic: validator.boolean().optional(),\n\n // Required\n model: validator.string().required(),\n })\n .unknown(false)\n // Exactly one of apiKey/authToken must be set.\n .xor('apiKey', 'authToken')\n // POSIX-only in v1: reliable process-group control requires POSIX process groups, mirroring\n // src/batteries/sandbox/node/srt_enforcer.ts's own platform-boundary precedent — refuse rather\n // than silently degrade.\n .custom((value, helpers) => {\n // POSIX-only in v1: reliable process-group control requires process.kill(-pid, signal),\n // which has no Windows equivalent — refuse rather than silently degrade, mirroring\n // src/batteries/sandbox/node/srt_enforcer.ts's own platform-boundary precedent.\n if (process.platform !== 'darwin' && process.platform !== 'linux') {\n return helpers.error('any.invalid')\n }\n return value\n })\n\nconst isValidationError = (value: unknown): value is ValidationError =>\n isError(value) && Array.isArray((value as ValidationError).details)\n\nconst formatValidationDetails = (err: ValidationError): string =>\n err.details.map((d) => d.message).join(' and ')\n\n/**\n * Validates an arbitrary input against `claudeCodeCliOptionsSchema` and returns the resolved\n * options shape. Throws `E_INVALID_CLAUDE_CODE_CLI_OPTIONS` (carrying the validator's error\n * report on `cause`) on failure.\n *\n * @param input - The raw options object to validate.\n * @returns The resolved options object with defaults filled in.\n */\nexport const validateOptions = (input: unknown): ClaudeCodeCliAdapterOptions => {\n const { value, error } = claudeCodeCliOptionsSchema.validate(input, {\n abortEarly: false,\n convert: false,\n })\n if (error) {\n throw new E_INVALID_CLAUDE_CODE_CLI_OPTIONS([formatValidationDetails(error)], { cause: error })\n }\n return value as ClaudeCodeCliAdapterOptions\n}\n\n// suppress unused import warning when the alias isn't referenced\nvoid isValidationError\n"],"mappings":";;;;;;;;AA8BA,IAAM,oBAAoB,kBAAA,UACvB,OAAO,EACP,MAAM,wBAAwB,YAAY,gBAAgB,UAAU;AAEvE,IAAM,oBAAoB,kBAAA,U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CAAC,EAAE,QAAQ,GAAK;CACjE,sBAAsB,kBAAA,UAAU,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,SAAS;CACnE,kBAAkB,kBAAA,UAAU,QAAQ,EAAE,SAAS;CAC/C,uBAAuB,kBAAA,UAAU,QAAQ,EAAE,SAAS;CACpD,4BAA4B,kBAAA,UAAU,QAAQ,EAAE,SAAS;CAGzD,OAAO,kBAAA,UAAU,OAAO,EAAE,SAAS;AACrC,CAAC,EACA,QAAQ,KAAK,EAEb,IAAI,UAAU,WAAW,EAIzB,QAAQ,OAAO,YAAY;CAI1B,IAAI,QAAQ,aAAa,YAAY,QAAQ,aAAa,SACxD,OAAO,QAAQ,MAAM,aAAa;CAEpC,OAAO;AACT,CAAC;AAKH,IAAM,2BAA2B,QAC/B,IAAI,QAAQ,KAAK,MAAM,EAAE,OAAO,EAAE,KAAK,OAAO;;;;;;;;;AAUhD,IAAa,mBAAmB,UAAgD;CAC9E,MAAM,EAAE,OAAO,UAAU,2BAA2B,SAAS,OAAO;EAClE,YAAY;EACZ,SAAS;CACX,CAAC;CACD,IAAI,OACF,MAAM,IAAI,iDAAA,kCAAkC,CAAC,wBAAwB,KAAK,CAAC,GAAG,EAAE,OAAO,MAAM,CAAC;CAEhG,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"validation.cjs","names":[],"sources":["../../../../src/batteries/llm/claude_code_cli/validation.ts"],"sourcesContent":["/**\n * Runtime validation schema and wrapper for Claude Code CLI adapter options.\n *\n * @module @nhtio/adk/batteries/llm/claude_code_cli/validation\n *\n * @remarks\n * Schema and call-site wrapper for validating `ClaudeCodeCliAdapterOptions`. Used at construction\n * time and at the start of every iteration against the merged options shape (stash > executor >\n * constructor). Throws `E_INVALID_CLAUDE_CODE_CLI_OPTIONS` on failure — same hard-fail policy as\n * every other ADK contract.\n *\n * Three invariants enforced here that have no equivalent in the other LLM batteries:\n * - `apiKey`/`authToken` are mutually exclusive AND at least one is required (`.xor`).\n * - `extraArgs` entries are validated against a strict six-flag allowlist, with per-flag value\n * arity, and every value string is rejected if it starts with `-` — the fix for the `--betas`\n * variadic-value injection hazard (a value string spelling another flag would otherwise reach\n * the CLI's own argv parser as a distinct token).\n * - `process.platform` is checked at validation time: this battery is POSIX-only in v1 (reliable\n * process-group control requires POSIX process groups), mirroring\n * `src/batteries/sandbox/node/srt_enforcer.ts`'s own platform-boundary precedent.\n */\n\nimport { isError } from '@nhtio/adk/guards'\nimport { validator, ValidationError } from '@nhtio/validation'\nimport { E_INVALID_CLAUDE_CODE_CLI_OPTIONS } from './exceptions'\nimport { byteStoreSchema, TokenEncoding } from '@nhtio/adk/common'\nimport type { ClaudeCodeCliAdapterOptions } from './types'\n\n// ─── Sub-schemas ──────────────────────────────────────────────────────────────\n\nconst bucketLabelSchema = validator\n .string()\n .valid('standingInstructions', 'memories', 'retrievables', 'timeline')\n\nconst bucketOrderSchema = validator\n .array()\n .items(bucketLabelSchema)\n .unique()\n .default(['standingInstructions', 'memories', 'retrievables', 'timeline'])\n\nconst tokenEncodingSchema = validator\n .alternatives(\n // Known values are suggestions from the canonical list, not a whitelist: consumers may provide\n // a custom or newer tokenizer name. The field accepts any non-empty string, explicit null, or\n // absent (undefined = \"no token counting\"). `.optional()` preserves the null/undefined\n // disposition required by adk/require-validator-any-required.\n validator\n .string()\n .min(1)\n .description(`Known encodings: ${TokenEncoding.join(', ')}`),\n validator.any().valid(null).optional()\n )\n .default(null)\n\nconst unsupportedMediaPolicySchema = validator\n .alternatives(\n validator.string().valid('throw', 'fallback-stash', 'synthetic-description'),\n validator\n .object({\n mode: validator.string().valid('fallback-stash').required(),\n stashKeys: validator.array().items(validator.string().min(1)).required(),\n })\n .unknown(false)\n )\n .default('throw')\n\nconst helperSchema = validator.function()\n\nconst helpersSchema = validator\n .object({\n descriptionToChatCompletionsJsonSchema: helperSchema.optional(),\n renderUntrustedContent: helperSchema.optional(),\n renderTrustedContent: helperSchema.optional(),\n renderStandingInstructions: helperSchema.optional(),\n renderMemories: helperSchema.optional(),\n renderRetrievables: helperSchema.optional(),\n renderRetrievableHandleBody: helperSchema.optional(),\n renderRetrievableSafetyDirective: helperSchema.optional(),\n renderFirstPartyRetrievables: helperSchema.optional(),\n renderThirdPartyPublicRetrievables: helperSchema.optional(),\n renderThirdPartyPrivateRetrievables: helperSchema.optional(),\n renderThought: helperSchema.optional(),\n filterThoughts: helperSchema.optional(),\n toolsToChatCompletionsTools: helperSchema.optional(),\n renderChatCompletionsSystemPrompt: helperSchema.optional(),\n renderClaudeCodeCliTimelineMessage: helperSchema.optional(),\n renderClaudeCodeCliToolCallResult: helperSchema.optional(),\n buildClaudeCodeCliPrompt: helperSchema.optional(),\n })\n .unknown(false)\n\n// `extraArgs`: a structured allowlist, not a flat string[]. Every value string, in every\n// position, is rejected if it starts with `-` — the fix for the --betas injection hazard.\nconst NOT_A_FLAG_RE = /^(?!-).+$/\n\nconst singleValueSchema = validator.string().min(1).pattern(NOT_A_FLAG_RE)\nconst multiValueSchema = validator\n .array()\n .items(validator.string().min(1).pattern(NOT_A_FLAG_RE))\n .min(1)\n\nconst extraArgSchema = validator\n .alternatives(\n // --betas is the only flag accepting a string[] value.\n validator\n .object({\n flag: validator.string().valid('--betas').required(),\n value: multiValueSchema.required(),\n })\n .unknown(false),\n // --prompt-suggestions is the only flag with an OPTIONAL value.\n validator\n .object({\n flag: validator.string().valid('--prompt-suggestions').required(),\n value: singleValueSchema.optional(),\n })\n .unknown(false),\n // Every remaining allowlisted flag requires a single non-empty, non-flag-shaped string value.\n validator\n .object({\n flag: validator.string().valid('--effort', '--agent', '--json-schema', '--name').required(),\n value: singleValueSchema.required(),\n })\n .unknown(false)\n )\n .required()\n\nconst extraArgsSchema = validator.array().items(extraArgSchema).optional()\n\n// ─── Top-level schema ─────────────────────────────────────────────────────────\n\n/**\n * Validator schema for `ClaudeCodeCliAdapterOptions`. Used by `validateOptions` at construction\n * time and again at the start of every iteration after options have been merged (stash > executor\n * > constructor). Rejects unknown top-level keys so typos fail loud.\n */\nexport const claudeCodeCliOptionsSchema = validator\n .object<ClaudeCodeCliAdapterOptions>({\n // ADK control\n execa: validator.function().optional(),\n wrapperPath: validator.string().optional(),\n claudeBin: validator.string().default('claude'),\n appendSystemPrompt: validator.string().optional(),\n apiKey: validator.string().optional(),\n authToken: validator.string().optional(),\n baseURL: validator.string().optional(),\n cwd: validator.string().optional(),\n addDir: validator.array().items(validator.string().min(1)).optional(),\n disallowedTools: validator.array().items(validator.string().min(1)).default([]),\n maxTurns: validator\n .number()\n .valid(1)\n .messages({\n 'any.only':\n 'maxTurns is deprecated and inert: single-turn dispatch is the fixed battery contract; ' +\n 'only maxTurns: 1 is accepted, and the option is ignored because argv always carries --max-turns 1.',\n })\n .optional(),\n contextWindow: validator.number().integer().min(1).optional(),\n tokenEncoding: tokenEncodingSchema,\n maxBudgetUsd: validator.number().min(0).optional(),\n fallbackModel: validator.array().items(validator.string().min(1)).optional(),\n selfIdentity: validator.string().min(1).default('assistant'),\n toolCallIdFilter: validator.function().optional(),\n autoAck: validator.boolean().default(false),\n forwardSubagentText: validator.boolean().default(false),\n bucketOrder: bucketOrderSchema,\n thoughtSurfacing: validator\n .string()\n .valid('all-self', 'latest-self', 'all')\n .default('all-self'),\n replayCompatibility: validator.array().items(validator.string().min(1)).default([]),\n helpers: helpersSchema.optional(),\n spoolStore: byteStoreSchema.optional(),\n unsupportedMediaPolicy: unsupportedMediaPolicySchema,\n unsupportedResultMediaPolicy: unsupportedMediaPolicySchema,\n extraArgs: extraArgsSchema,\n\n // CLI-native safety caps / timeouts\n streamIdleTimeoutMs: validator.number().integer().min(0).default(60_000),\n startupTimeoutMs: validator.number().integer().min(0).default(45_000),\n disposeGraceMs: validator.number().integer().min(0).default(2_000),\n mcpToolIdleTimeoutMs: validator.number().integer().min(0).optional(),\n disableTelemetry: validator.boolean().optional(),\n disableErrorReporting: validator.boolean().optional(),\n disableNonessentialTraffic: validator.boolean().optional(),\n\n // Required\n model: validator.string().required(),\n })\n .unknown(false)\n // Exactly one of apiKey/authToken must be set.\n .xor('apiKey', 'authToken')\n // POSIX-only in v1: reliable process-group control requires POSIX process groups, mirroring\n // src/batteries/sandbox/node/srt_enforcer.ts's own platform-boundary precedent — refuse rather\n // than silently degrade.\n .custom((value, helpers) => {\n // POSIX-only in v1: reliable process-group control requires process.kill(-pid, signal),\n // which has no Windows equivalent — refuse rather than silently degrade, mirroring\n // src/batteries/sandbox/node/srt_enforcer.ts's own platform-boundary precedent.\n if (process.platform !== 'darwin' && process.platform !== 'linux') {\n return helpers.error('any.invalid')\n }\n return value\n })\n\nconst isValidationError = (value: unknown): value is ValidationError =>\n isError(value) && Array.isArray((value as ValidationError).details)\n\nconst formatValidationDetails = (err: ValidationError): string =>\n err.details.map((d) => d.message).join(' and ')\n\n/**\n * Validates an arbitrary input against `claudeCodeCliOptionsSchema` and returns the resolved\n * options shape. Throws `E_INVALID_CLAUDE_CODE_CLI_OPTIONS` (carrying the validator's error\n * report on `cause`) on failure.\n *\n * @param input - The raw options object to validate.\n * @returns The resolved options object with defaults filled in.\n */\nexport const validateOptions = (input: unknown): ClaudeCodeCliAdapterOptions => {\n const { value, error } = claudeCodeCliOptionsSchema.validate(input, {\n abortEarly: false,\n convert: false,\n })\n if (error) {\n throw new E_INVALID_CLAUDE_CODE_CLI_OPTIONS([formatValidationDetails(error)], { cause: error })\n }\n return value as ClaudeCodeCliAdapterOptions\n}\n\n// suppress unused import warning when the alias isn't referenced\nvoid isValidationError\n"],"mappings":";;;;;;;;AA8BA,IAAM,oBAAoB,kBAAA,UACvB,OAAO,EACP,MAAM,wBAAwB,YAAY,gBAAgB,UAAU;AAEvE,IAAM,oBAAoB,kBAAA,UACvB,MAAM,EACN,MAAM,iBAAiB,EACvB,OAAO,EACP,QAAQ;CAAC;CAAwB;CAAY;CAAgB;AAAU,CAAC;AAE3E,IAAM,sBAAsB,kBAAA,UACzB,aAKC,kBAAA,UACG,OAAO,EACP,IAAI,CAAC,EACL,YAAY,oBAAoB,o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SAAS;CAC/C,uBAAuB,kBAAA,UAAU,QAAQ,EAAE,SAAS;CACpD,4BAA4B,kBAAA,UAAU,QAAQ,EAAE,SAAS;CAGzD,OAAO,kBAAA,UAAU,OAAO,EAAE,SAAS;AACrC,CAAC,EACA,QAAQ,KAAK,EAEb,IAAI,UAAU,WAAW,EAIzB,QAAQ,OAAO,YAAY;CAI1B,IAAI,QAAQ,aAAa,YAAY,QAAQ,aAAa,SACxD,OAAO,QAAQ,MAAM,aAAa;CAEpC,OAAO;AACT,CAAC;AAKH,IAAM,2BAA2B,QAC/B,IAAI,QAAQ,KAAK,MAAM,EAAE,OAAO,EAAE,KAAK,OAAO;;;;;;;;;AAUhD,IAAa,mBAAmB,UAAgD;CAC9E,MAAM,EAAE,OAAO,UAAU,2BAA2B,SAAS,OAAO;EAClE,YAAY;EACZ,SAAS;CACX,CAAC;CACD,IAAI,OACF,MAAM,IAAI,iDAAA,kCAAkC,CAAC,wBAAwB,KAAK,CAAC,GAAG,EAAE,OAAO,MAAM,CAAC;CAEhG,OAAO;AACT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as TokenEncoding } from "../../../tokenizable-xPXj1AQX.mjs";
|
|
2
|
-
import { o as byteStoreSchema } from "../../../common-
|
|
2
|
+
import { o as byteStoreSchema } from "../../../common-B5maOoF_.mjs";
|
|
3
3
|
import "../../../guards.mjs";
|
|
4
4
|
import { E_INVALID_CLAUDE_CODE_CLI_OPTIONS } from "./exceptions.mjs";
|
|
5
5
|
import { validator } from "@nhtio/validation";
|
|
@@ -73,6 +73,7 @@ var claudeCodeCliOptionsSchema = validator.object({
|
|
|
73
73
|
maxBudgetUsd: validator.number().min(0).optional(),
|
|
74
74
|
fallbackModel: validator.array().items(validator.string().min(1)).optional(),
|
|
75
75
|
selfIdentity: validator.string().min(1).default("assistant"),
|
|
76
|
+
toolCallIdFilter: validator.function().optional(),
|
|
76
77
|
autoAck: validator.boolean().default(false),
|
|
77
78
|
forwardSubagentText: validator.boolean().default(false),
|
|
78
79
|
bucketOrder: bucketOrderSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.mjs","names":[],"sources":["../../../../src/batteries/llm/claude_code_cli/validation.ts"],"sourcesContent":["/**\n * Runtime validation schema and wrapper for Claude Code CLI adapter options.\n *\n * @module @nhtio/adk/batteries/llm/claude_code_cli/validation\n *\n * @remarks\n * Schema and call-site wrapper for validating `ClaudeCodeCliAdapterOptions`. Used at construction\n * time and at the start of every iteration against the merged options shape (stash > executor >\n * constructor). Throws `E_INVALID_CLAUDE_CODE_CLI_OPTIONS` on failure — same hard-fail policy as\n * every other ADK contract.\n *\n * Three invariants enforced here that have no equivalent in the other LLM batteries:\n * - `apiKey`/`authToken` are mutually exclusive AND at least one is required (`.xor`).\n * - `extraArgs` entries are validated against a strict six-flag allowlist, with per-flag value\n * arity, and every value string is rejected if it starts with `-` — the fix for the `--betas`\n * variadic-value injection hazard (a value string spelling another flag would otherwise reach\n * the CLI's own argv parser as a distinct token).\n * - `process.platform` is checked at validation time: this battery is POSIX-only in v1 (reliable\n * process-group control requires POSIX process groups), mirroring\n * `src/batteries/sandbox/node/srt_enforcer.ts`'s own platform-boundary precedent.\n */\n\nimport { isError } from '@nhtio/adk/guards'\nimport { validator, ValidationError } from '@nhtio/validation'\nimport { E_INVALID_CLAUDE_CODE_CLI_OPTIONS } from './exceptions'\nimport { byteStoreSchema, TokenEncoding } from '@nhtio/adk/common'\nimport type { ClaudeCodeCliAdapterOptions } from './types'\n\n// ─── Sub-schemas ──────────────────────────────────────────────────────────────\n\nconst bucketLabelSchema = validator\n .string()\n .valid('standingInstructions', 'memories', 'retrievables', 'timeline')\n\nconst bucketOrderSchema = validator\n .array()\n .items(bucketLabelSchema)\n .unique()\n .default(['standingInstructions', 'memories', 'retrievables', 'timeline'])\n\nconst tokenEncodingSchema = validator\n .alternatives(\n // Known values are suggestions from the canonical list, not a whitelist: consumers may provide\n // a custom or newer tokenizer name. The field accepts any non-empty string, explicit null, or\n // absent (undefined = \"no token counting\"). `.optional()` preserves the null/undefined\n // disposition required by adk/require-validator-any-required.\n validator\n .string()\n .min(1)\n .description(`Known encodings: ${TokenEncoding.join(', ')}`),\n validator.any().valid(null).optional()\n )\n .default(null)\n\nconst unsupportedMediaPolicySchema = validator\n .alternatives(\n validator.string().valid('throw', 'fallback-stash', 'synthetic-description'),\n validator\n .object({\n mode: validator.string().valid('fallback-stash').required(),\n stashKeys: validator.array().items(validator.string().min(1)).required(),\n })\n .unknown(false)\n )\n .default('throw')\n\nconst helperSchema = validator.function()\n\nconst helpersSchema = validator\n .object({\n descriptionToChatCompletionsJsonSchema: helperSchema.optional(),\n renderUntrustedContent: helperSchema.optional(),\n renderTrustedContent: helperSchema.optional(),\n renderStandingInstructions: helperSchema.optional(),\n renderMemories: helperSchema.optional(),\n renderRetrievables: helperSchema.optional(),\n renderRetrievableHandleBody: helperSchema.optional(),\n renderRetrievableSafetyDirective: helperSchema.optional(),\n renderFirstPartyRetrievables: helperSchema.optional(),\n renderThirdPartyPublicRetrievables: helperSchema.optional(),\n renderThirdPartyPrivateRetrievables: helperSchema.optional(),\n renderThought: helperSchema.optional(),\n filterThoughts: helperSchema.optional(),\n toolsToChatCompletionsTools: helperSchema.optional(),\n renderChatCompletionsSystemPrompt: helperSchema.optional(),\n renderClaudeCodeCliTimelineMessage: helperSchema.optional(),\n renderClaudeCodeCliToolCallResult: helperSchema.optional(),\n buildClaudeCodeCliPrompt: helperSchema.optional(),\n })\n .unknown(false)\n\n// `extraArgs`: a structured allowlist, not a flat string[]. Every value string, in every\n// position, is rejected if it starts with `-` — the fix for the --betas injection hazard.\nconst NOT_A_FLAG_RE = /^(?!-).+$/\n\nconst singleValueSchema = validator.string().min(1).pattern(NOT_A_FLAG_RE)\nconst multiValueSchema = validator\n .array()\n .items(validator.string().min(1).pattern(NOT_A_FLAG_RE))\n .min(1)\n\nconst extraArgSchema = validator\n .alternatives(\n // --betas is the only flag accepting a string[] value.\n validator\n .object({\n flag: validator.string().valid('--betas').required(),\n value: multiValueSchema.required(),\n })\n .unknown(false),\n // --prompt-suggestions is the only flag with an OPTIONAL value.\n validator\n .object({\n flag: validator.string().valid('--prompt-suggestions').required(),\n value: singleValueSchema.optional(),\n })\n .unknown(false),\n // Every remaining allowlisted flag requires a single non-empty, non-flag-shaped string value.\n validator\n .object({\n flag: validator.string().valid('--effort', '--agent', '--json-schema', '--name').required(),\n value: singleValueSchema.required(),\n })\n .unknown(false)\n )\n .required()\n\nconst extraArgsSchema = validator.array().items(extraArgSchema).optional()\n\n// ─── Top-level schema ─────────────────────────────────────────────────────────\n\n/**\n * Validator schema for `ClaudeCodeCliAdapterOptions`. Used by `validateOptions` at construction\n * time and again at the start of every iteration after options have been merged (stash > executor\n * > constructor). Rejects unknown top-level keys so typos fail loud.\n */\nexport const claudeCodeCliOptionsSchema = validator\n .object<ClaudeCodeCliAdapterOptions>({\n // ADK control\n execa: validator.function().optional(),\n wrapperPath: validator.string().optional(),\n claudeBin: validator.string().default('claude'),\n appendSystemPrompt: validator.string().optional(),\n apiKey: validator.string().optional(),\n authToken: validator.string().optional(),\n baseURL: validator.string().optional(),\n cwd: validator.string().optional(),\n addDir: validator.array().items(validator.string().min(1)).optional(),\n disallowedTools: validator.array().items(validator.string().min(1)).default([]),\n maxTurns: validator\n .number()\n .valid(1)\n .messages({\n 'any.only':\n 'maxTurns is deprecated and inert: single-turn dispatch is the fixed battery contract; ' +\n 'only maxTurns: 1 is accepted, and the option is ignored because argv always carries --max-turns 1.',\n })\n .optional(),\n contextWindow: validator.number().integer().min(1).optional(),\n tokenEncoding: tokenEncodingSchema,\n maxBudgetUsd: validator.number().min(0).optional(),\n fallbackModel: validator.array().items(validator.string().min(1)).optional(),\n selfIdentity: validator.string().min(1).default('assistant'),\n autoAck: validator.boolean().default(false),\n forwardSubagentText: validator.boolean().default(false),\n bucketOrder: bucketOrderSchema,\n thoughtSurfacing: validator\n .string()\n .valid('all-self', 'latest-self', 'all')\n .default('all-self'),\n replayCompatibility: validator.array().items(validator.string().min(1)).default([]),\n helpers: helpersSchema.optional(),\n spoolStore: byteStoreSchema.optional(),\n unsupportedMediaPolicy: unsupportedMediaPolicySchema,\n unsupportedResultMediaPolicy: unsupportedMediaPolicySchema,\n extraArgs: extraArgsSchema,\n\n // CLI-native safety caps / timeouts\n streamIdleTimeoutMs: validator.number().integer().min(0).default(60_000),\n startupTimeoutMs: validator.number().integer().min(0).default(45_000),\n disposeGraceMs: validator.number().integer().min(0).default(2_000),\n mcpToolIdleTimeoutMs: validator.number().integer().min(0).optional(),\n disableTelemetry: validator.boolean().optional(),\n disableErrorReporting: validator.boolean().optional(),\n disableNonessentialTraffic: validator.boolean().optional(),\n\n // Required\n model: validator.string().required(),\n })\n .unknown(false)\n // Exactly one of apiKey/authToken must be set.\n .xor('apiKey', 'authToken')\n // POSIX-only in v1: reliable process-group control requires POSIX process groups, mirroring\n // src/batteries/sandbox/node/srt_enforcer.ts's own platform-boundary precedent — refuse rather\n // than silently degrade.\n .custom((value, helpers) => {\n // POSIX-only in v1: reliable process-group control requires process.kill(-pid, signal),\n // which has no Windows equivalent — refuse rather than silently degrade, mirroring\n // src/batteries/sandbox/node/srt_enforcer.ts's own platform-boundary precedent.\n if (process.platform !== 'darwin' && process.platform !== 'linux') {\n return helpers.error('any.invalid')\n }\n return value\n })\n\nconst isValidationError = (value: unknown): value is ValidationError =>\n isError(value) && Array.isArray((value as ValidationError).details)\n\nconst formatValidationDetails = (err: ValidationError): string =>\n err.details.map((d) => d.message).join(' and ')\n\n/**\n * Validates an arbitrary input against `claudeCodeCliOptionsSchema` and returns the resolved\n * options shape. Throws `E_INVALID_CLAUDE_CODE_CLI_OPTIONS` (carrying the validator's error\n * report on `cause`) on failure.\n *\n * @param input - The raw options object to validate.\n * @returns The resolved options object with defaults filled in.\n */\nexport const validateOptions = (input: unknown): ClaudeCodeCliAdapterOptions => {\n const { value, error } = claudeCodeCliOptionsSchema.validate(input, {\n abortEarly: false,\n convert: false,\n })\n if (error) {\n throw new E_INVALID_CLAUDE_CODE_CLI_OPTIONS([formatValidationDetails(error)], { cause: error })\n }\n return value as ClaudeCodeCliAdapterOptions\n}\n\n// suppress unused import warning when the alias isn't referenced\nvoid isValidationError\n"],"mappings":";;;;;;AA8BA,IAAM,oBAAoB,UACvB,OAAO,EACP,MAAM,wBAAwB,YAAY,gBAAgB,UAAU;AAEvE,IAAM,oBAAoB,UACvB,MAAM,EACN,MAAM,iBAAiB,EACvB,OAAO,EACP,QAAQ;CAAC;CAAwB;CAAY;CAAgB;AAAU,CAAC;AAE3E,IAAM,sBAAsB,UACzB,aAKC,UACG,OAAO,EACP,IAAI,CAAC,EACL,YAAY,oBAAoB,cAAc,KAAK,IAAI,GAAG,GAC7D,UAAU,IAAI,EAAE,MAAM,IAAI,EAAE,SAAS,CACvC,EACC,QAAQ,IAAI;AAEf,IAAM,+BAA+B,UAClC,aACC,UAAU,OAAO,EAAE,MAAM,SAAS,kBAAkB,uBAAuB,GAC3E,UACG,OAAO;CACN,MAAM,UAAU,OAAO,EAAE,MAAM,gBAAgB,EAAE,SAAS;CAC1D,WAAW,UAAU,MAAM,EAAE,MAAM,UAAU,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,SAAS;AACzE,CAAC,EACA,QAAQ,KAAK,CAClB,EACC,QAAQ,OAAO;AAElB,IAAM,eAAe,UAAU,SAAS;AAExC,IAAM,gBAAgB,UACnB,OAAO;CACN,wCAAwC,aAAa,SAAS;CAC9D,wBAAwB,aAAa,SAAS;CAC9C,sBAAsB,aAAa,SAAS;CAC5C,4BAA4B,aAAa,SAAS;CAClD,gBAAgB,aAAa,SAAS;CACtC,oBAAoB,aAAa,SAAS;CAC1C,6BAA6B,aAAa,SAAS;CACnD,kCAAkC,aAAa,SAAS;CACxD,8BAA8B,aAAa,SAAS;CACpD,oCAAoC,aAAa,SAAS;CAC1D,qCAAqC,aAAa,SAAS;CAC3D,eAAe,aAAa,SAAS;CACrC,gBAAgB,aAAa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,kBAAkB,UAAU,QAAQ,EAAE,SAAS;CAC/C,uBAAuB,UAAU,QAAQ,EAAE,SAAS;CACpD,4BAA4B,UAAU,QAAQ,EAAE,SAAS;CAGzD,OAAO,UAAU,OAAO,EAAE,SAAS;AACrC,CAAC,EACA,QAAQ,KAAK,EAEb,IAAI,UAAU,WAAW,EAIzB,QAAQ,OAAO,YAAY;CAI1B,IAAI,QAAQ,aAAa,YAAY,QAAQ,aAAa,SACxD,OAAO,QAAQ,MAAM,aAAa;CAEpC,OAAO;AACT,CAAC;AAKH,IAAM,2BAA2B,QAC/B,IAAI,QAAQ,KAAK,MAAM,EAAE,OAAO,EAAE,KAAK,OAAO;;;;;;;;;AAUhD,IAAa,mBAAmB,UAAgD;CAC9E,MAAM,EAAE,OAAO,UAAU,2BAA2B,SAAS,OAAO;EAClE,YAAY;EACZ,SAAS;CACX,CAAC;CACD,IAAI,OACF,MAAM,IAAI,kCAAkC,CAAC,wBAAwB,KAAK,CAAC,GAAG,EAAE,OAAO,MAAM,CAAC;CAEhG,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"validation.mjs","names":[],"sources":["../../../../src/batteries/llm/claude_code_cli/validation.ts"],"sourcesContent":["/**\n * Runtime validation schema and wrapper for Claude Code CLI adapter options.\n *\n * @module @nhtio/adk/batteries/llm/claude_code_cli/validation\n *\n * @remarks\n * Schema and call-site wrapper for validating `ClaudeCodeCliAdapterOptions`. Used at construction\n * time and at the start of every iteration against the merged options shape (stash > executor >\n * constructor). Throws `E_INVALID_CLAUDE_CODE_CLI_OPTIONS` on failure — same hard-fail policy as\n * every other ADK contract.\n *\n * Three invariants enforced here that have no equivalent in the other LLM batteries:\n * - `apiKey`/`authToken` are mutually exclusive AND at least one is required (`.xor`).\n * - `extraArgs` entries are validated against a strict six-flag allowlist, with per-flag value\n * arity, and every value string is rejected if it starts with `-` — the fix for the `--betas`\n * variadic-value injection hazard (a value string spelling another flag would otherwise reach\n * the CLI's own argv parser as a distinct token).\n * - `process.platform` is checked at validation time: this battery is POSIX-only in v1 (reliable\n * process-group control requires POSIX process groups), mirroring\n * `src/batteries/sandbox/node/srt_enforcer.ts`'s own platform-boundary precedent.\n */\n\nimport { isError } from '@nhtio/adk/guards'\nimport { validator, ValidationError } from '@nhtio/validation'\nimport { E_INVALID_CLAUDE_CODE_CLI_OPTIONS } from './exceptions'\nimport { byteStoreSchema, TokenEncoding } from '@nhtio/adk/common'\nimport type { ClaudeCodeCliAdapterOptions } from './types'\n\n// ─── Sub-schemas ──────────────────────────────────────────────────────────────\n\nconst bucketLabelSchema = validator\n .string()\n .valid('standingInstructions', 'memories', 'retrievables', 'timeline')\n\nconst bucketOrderSchema = validator\n .array()\n .items(bucketLabelSchema)\n .unique()\n .default(['standingInstructions', 'memories', 'retrievables', 'timeline'])\n\nconst tokenEncodingSchema = validator\n .alternatives(\n // Known values are suggestions from the canonical list, not a whitelist: consumers may provide\n // a custom or newer tokenizer name. The field accepts any non-empty string, explicit null, or\n // absent (undefined = \"no token counting\"). `.optional()` preserves the null/undefined\n // disposition required by adk/require-validator-any-required.\n validator\n .string()\n .min(1)\n .description(`Known encodings: ${TokenEncoding.join(', ')}`),\n validator.any().valid(null).optional()\n )\n .default(null)\n\nconst unsupportedMediaPolicySchema = validator\n .alternatives(\n validator.string().valid('throw', 'fallback-stash', 'synthetic-description'),\n validator\n .object({\n mode: validator.string().valid('fallback-stash').required(),\n stashKeys: validator.array().items(validator.string().min(1)).required(),\n })\n .unknown(false)\n )\n .default('throw')\n\nconst helperSchema = validator.function()\n\nconst helpersSchema = validator\n .object({\n descriptionToChatCompletionsJsonSchema: helperSchema.optional(),\n renderUntrustedContent: helperSchema.optional(),\n renderTrustedContent: helperSchema.optional(),\n renderStandingInstructions: helperSchema.optional(),\n renderMemories: helperSchema.optional(),\n renderRetrievables: helperSchema.optional(),\n renderRetrievableHandleBody: helperSchema.optional(),\n renderRetrievableSafetyDirective: helperSchema.optional(),\n renderFirstPartyRetrievables: helperSchema.optional(),\n renderThirdPartyPublicRetrievables: helperSchema.optional(),\n renderThirdPartyPrivateRetrievables: helperSchema.optional(),\n renderThought: helperSchema.optional(),\n filterThoughts: helperSchema.optional(),\n toolsToChatCompletionsTools: helperSchema.optional(),\n renderChatCompletionsSystemPrompt: helperSchema.optional(),\n renderClaudeCodeCliTimelineMessage: helperSchema.optional(),\n renderClaudeCodeCliToolCallResult: helperSchema.optional(),\n buildClaudeCodeCliPrompt: helperSchema.optional(),\n })\n .unknown(false)\n\n// `extraArgs`: a structured allowlist, not a flat string[]. Every value string, in every\n// position, is rejected if it starts with `-` — the fix for the --betas injection hazard.\nconst NOT_A_FLAG_RE = /^(?!-).+$/\n\nconst singleValueSchema = validator.string().min(1).pattern(NOT_A_FLAG_RE)\nconst multiValueSchema = validator\n .array()\n .items(validator.string().min(1).pattern(NOT_A_FLAG_RE))\n .min(1)\n\nconst extraArgSchema = validator\n .alternatives(\n // --betas is the only flag accepting a string[] value.\n validator\n .object({\n flag: validator.string().valid('--betas').required(),\n value: multiValueSchema.required(),\n })\n .unknown(false),\n // --prompt-suggestions is the only flag with an OPTIONAL value.\n validator\n .object({\n flag: validator.string().valid('--prompt-suggestions').required(),\n value: singleValueSchema.optional(),\n })\n .unknown(false),\n // Every remaining allowlisted flag requires a single non-empty, non-flag-shaped string value.\n validator\n .object({\n flag: validator.string().valid('--effort', '--agent', '--json-schema', '--name').required(),\n value: singleValueSchema.required(),\n })\n .unknown(false)\n )\n .required()\n\nconst extraArgsSchema = validator.array().items(extraArgSchema).optional()\n\n// ─── Top-level schema ─────────────────────────────────────────────────────────\n\n/**\n * Validator schema for `ClaudeCodeCliAdapterOptions`. Used by `validateOptions` at construction\n * time and again at the start of every iteration after options have been merged (stash > executor\n * > constructor). Rejects unknown top-level keys so typos fail loud.\n */\nexport const claudeCodeCliOptionsSchema = validator\n .object<ClaudeCodeCliAdapterOptions>({\n // ADK control\n execa: validator.function().optional(),\n wrapperPath: validator.string().optional(),\n claudeBin: validator.string().default('claude'),\n appendSystemPrompt: validator.string().optional(),\n apiKey: validator.string().optional(),\n authToken: validator.string().optional(),\n baseURL: validator.string().optional(),\n cwd: validator.string().optional(),\n addDir: validator.array().items(validator.string().min(1)).optional(),\n disallowedTools: validator.array().items(validator.string().min(1)).default([]),\n maxTurns: validator\n .number()\n .valid(1)\n .messages({\n 'any.only':\n 'maxTurns is deprecated and inert: single-turn dispatch is the fixed battery contract; ' +\n 'only maxTurns: 1 is accepted, and the option is ignored because argv always carries --max-turns 1.',\n })\n .optional(),\n contextWindow: validator.number().integer().min(1).optional(),\n tokenEncoding: tokenEncodingSchema,\n maxBudgetUsd: validator.number().min(0).optional(),\n fallbackModel: validator.array().items(validator.string().min(1)).optional(),\n selfIdentity: validator.string().min(1).default('assistant'),\n toolCallIdFilter: validator.function().optional(),\n autoAck: validator.boolean().default(false),\n forwardSubagentText: validator.boolean().default(false),\n bucketOrder: bucketOrderSchema,\n thoughtSurfacing: validator\n .string()\n .valid('all-self', 'latest-self', 'all')\n .default('all-self'),\n replayCompatibility: validator.array().items(validator.string().min(1)).default([]),\n helpers: helpersSchema.optional(),\n spoolStore: byteStoreSchema.optional(),\n unsupportedMediaPolicy: unsupportedMediaPolicySchema,\n unsupportedResultMediaPolicy: unsupportedMediaPolicySchema,\n extraArgs: extraArgsSchema,\n\n // CLI-native safety caps / timeouts\n streamIdleTimeoutMs: validator.number().integer().min(0).default(60_000),\n startupTimeoutMs: validator.number().integer().min(0).default(45_000),\n disposeGraceMs: validator.number().integer().min(0).default(2_000),\n mcpToolIdleTimeoutMs: validator.number().integer().min(0).optional(),\n disableTelemetry: validator.boolean().optional(),\n disableErrorReporting: validator.boolean().optional(),\n disableNonessentialTraffic: validator.boolean().optional(),\n\n // Required\n model: validator.string().required(),\n })\n .unknown(false)\n // Exactly one of apiKey/authToken must be set.\n .xor('apiKey', 'authToken')\n // POSIX-only in v1: reliable process-group control requires POSIX process groups, mirroring\n // src/batteries/sandbox/node/srt_enforcer.ts's own platform-boundary precedent — refuse rather\n // than silently degrade.\n .custom((value, helpers) => {\n // POSIX-only in v1: reliable process-group control requires process.kill(-pid, signal),\n // which has no Windows equivalent — refuse rather than silently degrade, mirroring\n // src/batteries/sandbox/node/srt_enforcer.ts's own platform-boundary precedent.\n if (process.platform !== 'darwin' && process.platform !== 'linux') {\n return helpers.error('any.invalid')\n }\n return value\n })\n\nconst isValidationError = (value: unknown): value is ValidationError =>\n isError(value) && Array.isArray((value as ValidationError).details)\n\nconst formatValidationDetails = (err: ValidationError): string =>\n err.details.map((d) => d.message).join(' and ')\n\n/**\n * Validates an arbitrary input against `claudeCodeCliOptionsSchema` and returns the resolved\n * options shape. Throws `E_INVALID_CLAUDE_CODE_CLI_OPTIONS` (carrying the validator's error\n * report on `cause`) on failure.\n *\n * @param input - The raw options object to validate.\n * @returns The resolved options object with defaults filled in.\n */\nexport const validateOptions = (input: unknown): ClaudeCodeCliAdapterOptions => {\n const { value, error } = claudeCodeCliOptionsSchema.validate(input, {\n abortEarly: false,\n convert: false,\n })\n if (error) {\n throw new E_INVALID_CLAUDE_CODE_CLI_OPTIONS([formatValidationDetails(error)], { cause: error })\n }\n return value as ClaudeCodeCliAdapterOptions\n}\n\n// suppress unused import warning when the alias isn't referenced\nvoid isValidationError\n"],"mappings":";;;;;;AA8BA,IAAM,oBAAoB,UACvB,OAAO,EACP,MAAM,wBAAwB,YAAY,gBAAgB,UAAU;AAEvE,IAAM,oBAAoB,UACvB,MAAM,EACN,MAAM,iBAAiB,EACvB,OAAO,EACP,QAAQ;CAAC;CAAwB;CAAY;CAAgB;AAAU,CAAC;AAE3E,IAAM,sBAAsB,UACzB,aAKC,UACG,OAAO,EACP,IAAI,CAAC,EACL,YAAY,oBAAoB,cAAc,KAAK,IAAI,GAAG,GAC7D,UAAU,IAAI,EAAE,MAAM,IAAI,EAAE,SAAS,CACvC,EACC,QAAQ,IAAI;AAEf,IAAM,+BAA+B,UAClC,aACC,UAAU,OAAO,EAAE,MAAM,SAAS,kBAAkB,uBAAuB,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,CAAC,wBAAwB,KAAK,CAAC,GAAG,EAAE,OAAO,MAAM,CAAC;CAEhG,OAAO;AACT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../../chunk-Cek0wNdY.
|
|
2
|
+
require("../../../chunk-Cek0wNdY.cjs");
|
|
3
3
|
//#region src/batteries/llm/claude_code_cli/wire.ts
|
|
4
4
|
/** Encode a `WrapperCommand` as one NDJSON line, including its terminating newline. */
|
|
5
5
|
var encodeWrapperCommand = (command) => `${JSON.stringify(command)}\n`;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../chunk-Cek0wNdY.
|
|
3
|
-
const require_helpers = require("../../helpers-
|
|
2
|
+
require("../../chunk-Cek0wNdY.cjs");
|
|
3
|
+
const require_helpers = require("../../helpers-Dcp4CrOz.cjs");
|
|
4
|
+
const require_chat_common = require("../../chat_common-B7fvGTKv.cjs");
|
|
4
5
|
const require_batteries_llm_claude_code_cli_exceptions = require("./claude_code_cli/exceptions.cjs");
|
|
5
6
|
const require_batteries_llm_claude_code_cli_validation = require("./claude_code_cli/validation.cjs");
|
|
6
7
|
const require_batteries_llm_claude_code_cli_helpers = require("./claude_code_cli/helpers.cjs");
|
|
@@ -16,10 +17,12 @@ exports.E_CLAUDE_CODE_CLI_STREAM_STALLED = require_batteries_llm_claude_code_cli
|
|
|
16
17
|
exports.E_CLAUDE_CODE_CLI_TURN_FAILED = require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_TURN_FAILED;
|
|
17
18
|
exports.E_CLAUDE_CODE_CLI_UNSUPPORTED_MEDIA_MODALITY = require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_UNSUPPORTED_MEDIA_MODALITY;
|
|
18
19
|
exports.E_CLAUDE_CODE_CLI_WRAPPER_CRASHED = require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_WRAPPER_CRASHED;
|
|
20
|
+
exports.E_CLAUDE_CODE_CLI_WRAPPER_NOT_FOUND = require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_WRAPPER_NOT_FOUND;
|
|
19
21
|
exports.E_CLAUDE_CODE_CLI_WRAPPER_SPAWN_ERROR = require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_WRAPPER_SPAWN_ERROR;
|
|
20
22
|
exports.E_INVALID_CLAUDE_CODE_CLI_OPTIONS = require_batteries_llm_claude_code_cli_exceptions.E_INVALID_CLAUDE_CODE_CLI_OPTIONS;
|
|
21
23
|
exports.buildClaudeCodeCliPrompt = require_batteries_llm_claude_code_cli_helpers.buildClaudeCodeCliPrompt;
|
|
22
24
|
exports.claudeCodeCliOptionsSchema = require_batteries_llm_claude_code_cli_validation.claudeCodeCliOptionsSchema;
|
|
25
|
+
exports.deCollideToolCallIds = require_chat_common.deCollideToolCallIds;
|
|
23
26
|
exports.defaultBuildClaudeCodeCliPrompt = require_batteries_llm_claude_code_cli_helpers.defaultBuildClaudeCodeCliPrompt;
|
|
24
27
|
exports.defaultDescriptionToChatCompletionsJsonSchema = require_helpers.defaultDescriptionToChatCompletionsJsonSchema;
|
|
25
28
|
exports.defaultFilterThoughts = require_helpers.defaultFilterThoughts;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { A as renderMemories, D as renderArtifactHandleBody, F as renderThirdPartyPrivateRetrievables, G as toolsToChatCompletionsTools, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, _ as defaultRenderUntrustedContent, a as defaultRenderArtifactHandleBody, c as defaultRenderMemories, d as defaultRenderRetrievables, f as defaultRenderStandingInstructions, g as defaultRenderTrustedContent, h as defaultRenderThought, i as defaultFilterThoughts, j as renderRetrievableHandleBody, k as renderFirstPartyRetrievables, l as defaultRenderRetrievableHandleBody, m as defaultRenderThirdPartyPublicRetrievables, o as defaultRenderChatCompletionsSystemPrompt, p as defaultRenderThirdPartyPrivateRetrievables, r as defaultDescriptionToChatCompletionsJsonSchema, s as defaultRenderFirstPartyRetrievables, u as defaultRenderRetrievableSafetyDirective, v as defaultToolsToChatCompletionsTools, x as filterThoughts, y as descriptionToChatCompletionsJsonSchema, z as renderUntrustedContent } from "../../helpers-
|
|
2
|
-
import {
|
|
1
|
+
import { A as renderMemories, D as renderArtifactHandleBody, F as renderThirdPartyPrivateRetrievables, G as toolsToChatCompletionsTools, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, _ as defaultRenderUntrustedContent, a as defaultRenderArtifactHandleBody, c as defaultRenderMemories, d as defaultRenderRetrievables, f as defaultRenderStandingInstructions, g as defaultRenderTrustedContent, h as defaultRenderThought, i as defaultFilterThoughts, j as renderRetrievableHandleBody, k as renderFirstPartyRetrievables, l as defaultRenderRetrievableHandleBody, m as defaultRenderThirdPartyPublicRetrievables, o as defaultRenderChatCompletionsSystemPrompt, p as defaultRenderThirdPartyPrivateRetrievables, r as defaultDescriptionToChatCompletionsJsonSchema, s as defaultRenderFirstPartyRetrievables, u as defaultRenderRetrievableSafetyDirective, v as defaultToolsToChatCompletionsTools, x as filterThoughts, y as descriptionToChatCompletionsJsonSchema, z as renderUntrustedContent } from "../../helpers-C1T0DV8Q.mjs";
|
|
2
|
+
import { t as deCollideToolCallIds } from "../../chat_common-CeoHwSsz.mjs";
|
|
3
|
+
import { E_CLAUDE_CODE_CLI_BINARY_NOT_FOUND, E_CLAUDE_CODE_CLI_CONTEXT_OVERFLOW, E_CLAUDE_CODE_CLI_MCP_BRIDGE_STARTUP_FAILED, E_CLAUDE_CODE_CLI_PROCESS_EXITED_NONZERO, E_CLAUDE_CODE_CLI_STARTUP_TIMEOUT, E_CLAUDE_CODE_CLI_STREAM_ERROR, E_CLAUDE_CODE_CLI_STREAM_STALLED, E_CLAUDE_CODE_CLI_TURN_FAILED, E_CLAUDE_CODE_CLI_UNSUPPORTED_MEDIA_MODALITY, E_CLAUDE_CODE_CLI_WRAPPER_CRASHED, E_CLAUDE_CODE_CLI_WRAPPER_NOT_FOUND, E_CLAUDE_CODE_CLI_WRAPPER_SPAWN_ERROR, E_INVALID_CLAUDE_CODE_CLI_OPTIONS } from "./claude_code_cli/exceptions.mjs";
|
|
3
4
|
import { claudeCodeCliOptionsSchema, validateOptions } from "./claude_code_cli/validation.mjs";
|
|
4
5
|
import { buildClaudeCodeCliPrompt, defaultBuildClaudeCodeCliPrompt, defaultRenderClaudeCodeCliTimelineMessage, defaultRenderClaudeCodeCliToolCallResult, renderClaudeCodeCliTimelineMessage, renderClaudeCodeCliToolCallResult } from "./claude_code_cli/helpers.mjs";
|
|
5
6
|
import { ClaudeCodeCliAdapter, resolveDefaultWrapperPath } from "./claude_code_cli/adapter.mjs";
|
|
6
|
-
export { ClaudeCodeCliAdapter, E_CLAUDE_CODE_CLI_BINARY_NOT_FOUND, E_CLAUDE_CODE_CLI_CONTEXT_OVERFLOW, E_CLAUDE_CODE_CLI_MCP_BRIDGE_STARTUP_FAILED, E_CLAUDE_CODE_CLI_PROCESS_EXITED_NONZERO, E_CLAUDE_CODE_CLI_STARTUP_TIMEOUT, E_CLAUDE_CODE_CLI_STREAM_ERROR, E_CLAUDE_CODE_CLI_STREAM_STALLED, E_CLAUDE_CODE_CLI_TURN_FAILED, E_CLAUDE_CODE_CLI_UNSUPPORTED_MEDIA_MODALITY, E_CLAUDE_CODE_CLI_WRAPPER_CRASHED, E_CLAUDE_CODE_CLI_WRAPPER_SPAWN_ERROR, E_INVALID_CLAUDE_CODE_CLI_OPTIONS, buildClaudeCodeCliPrompt, claudeCodeCliOptionsSchema, defaultBuildClaudeCodeCliPrompt, defaultDescriptionToChatCompletionsJsonSchema, defaultFilterThoughts, defaultRenderArtifactHandleBody, defaultRenderChatCompletionsSystemPrompt, defaultRenderClaudeCodeCliTimelineMessage, defaultRenderClaudeCodeCliToolCallResult, defaultRenderFirstPartyRetrievables, defaultRenderMemories, defaultRenderRetrievableHandleBody, defaultRenderRetrievableSafetyDirective, defaultRenderRetrievables, defaultRenderStandingInstructions, defaultRenderThirdPartyPrivateRetrievables, defaultRenderThirdPartyPublicRetrievables, defaultRenderThought, defaultRenderTrustedContent, defaultRenderUntrustedContent, defaultToolsToChatCompletionsTools, descriptionToChatCompletionsJsonSchema, filterThoughts, renderArtifactHandleBody, renderChatCompletionsSystemPrompt, renderClaudeCodeCliTimelineMessage, renderClaudeCodeCliToolCallResult, renderFirstPartyRetrievables, renderMemories, renderRetrievableHandleBody, renderRetrievableSafetyDirective, renderRetrievables, renderStandingInstructions, renderThirdPartyPrivateRetrievables, renderThirdPartyPublicRetrievables, renderThought, renderTrustedContent, renderUntrustedContent, resolveDefaultWrapperPath, toolsToChatCompletionsTools, validateOptions };
|
|
7
|
+
export { ClaudeCodeCliAdapter, E_CLAUDE_CODE_CLI_BINARY_NOT_FOUND, E_CLAUDE_CODE_CLI_CONTEXT_OVERFLOW, E_CLAUDE_CODE_CLI_MCP_BRIDGE_STARTUP_FAILED, E_CLAUDE_CODE_CLI_PROCESS_EXITED_NONZERO, E_CLAUDE_CODE_CLI_STARTUP_TIMEOUT, E_CLAUDE_CODE_CLI_STREAM_ERROR, E_CLAUDE_CODE_CLI_STREAM_STALLED, E_CLAUDE_CODE_CLI_TURN_FAILED, E_CLAUDE_CODE_CLI_UNSUPPORTED_MEDIA_MODALITY, E_CLAUDE_CODE_CLI_WRAPPER_CRASHED, E_CLAUDE_CODE_CLI_WRAPPER_NOT_FOUND, E_CLAUDE_CODE_CLI_WRAPPER_SPAWN_ERROR, E_INVALID_CLAUDE_CODE_CLI_OPTIONS, buildClaudeCodeCliPrompt, claudeCodeCliOptionsSchema, deCollideToolCallIds, defaultBuildClaudeCodeCliPrompt, defaultDescriptionToChatCompletionsJsonSchema, defaultFilterThoughts, defaultRenderArtifactHandleBody, defaultRenderChatCompletionsSystemPrompt, defaultRenderClaudeCodeCliTimelineMessage, defaultRenderClaudeCodeCliToolCallResult, defaultRenderFirstPartyRetrievables, defaultRenderMemories, defaultRenderRetrievableHandleBody, defaultRenderRetrievableSafetyDirective, defaultRenderRetrievables, defaultRenderStandingInstructions, defaultRenderThirdPartyPrivateRetrievables, defaultRenderThirdPartyPublicRetrievables, defaultRenderThought, defaultRenderTrustedContent, defaultRenderUntrustedContent, defaultToolsToChatCompletionsTools, descriptionToChatCompletionsJsonSchema, filterThoughts, renderArtifactHandleBody, renderChatCompletionsSystemPrompt, renderClaudeCodeCliTimelineMessage, renderClaudeCodeCliToolCallResult, renderFirstPartyRetrievables, renderMemories, renderRetrievableHandleBody, renderRetrievableSafetyDirective, renderRetrievables, renderStandingInstructions, renderThirdPartyPrivateRetrievables, renderThirdPartyPublicRetrievables, renderThought, renderTrustedContent, renderUntrustedContent, resolveDefaultWrapperPath, toolsToChatCompletionsTools, validateOptions };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../../chunk-Cek0wNdY.
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const require_spooled_artifact = require("../../../spooled_artifact-
|
|
6
|
-
const require_thought = require("../../../thought-
|
|
7
|
-
const require_tool_call = require("../../../tool_call-
|
|
8
|
-
require("../../../common-
|
|
2
|
+
require("../../../chunk-Cek0wNdY.cjs");
|
|
3
|
+
const require_guards = require("../../../guards-5-XmJgD2.cjs");
|
|
4
|
+
const require_tokenizable = require("../../../tokenizable-DDIdXbJN.cjs");
|
|
5
|
+
const require_spooled_artifact = require("../../../spooled_artifact-BLgbGT8b.cjs");
|
|
6
|
+
const require_thought = require("../../../thought-COeZTQ-B.cjs");
|
|
7
|
+
const require_tool_call = require("../../../tool_call-JbjeUpRK.cjs");
|
|
8
|
+
require("../../../common-7gCR3zQu.cjs");
|
|
9
9
|
require("../../../guards.cjs");
|
|
10
|
-
const require_tool_parsers = require("../../../tool_parsers-
|
|
11
|
-
const require_helpers = require("../../../helpers-
|
|
10
|
+
const require_tool_parsers = require("../../../tool_parsers-8_qO0a_F.cjs");
|
|
11
|
+
const require_helpers = require("../../../helpers-Dcp4CrOz.cjs");
|
|
12
12
|
const require_batteries_llm_gemini_generate_content_exceptions = require("./exceptions.cjs");
|
|
13
13
|
const require_batteries_llm_gemini_generate_content_validation = require("./validation.cjs");
|
|
14
14
|
const require_batteries_llm_gemini_generate_content_helpers = require("./helpers.cjs");
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { r as Tokenizable } from "../../../tokenizable-xPXj1AQX.mjs";
|
|
2
1
|
import { n as isInstanceOf, r as isObject, t as isError } from "../../../guards-BEpY7lBI.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import "../../../
|
|
2
|
+
import { r as Tokenizable } from "../../../tokenizable-xPXj1AQX.mjs";
|
|
3
|
+
import { h as canonicalStringify } from "../../../spooled_artifact-BkOe4-j-.mjs";
|
|
4
|
+
import { n as Message, t as Thought } from "../../../thought-BrQt6HAb.mjs";
|
|
5
|
+
import { t as ToolCall } from "../../../tool_call-8crmZsO8.mjs";
|
|
6
|
+
import "../../../common-B5maOoF_.mjs";
|
|
7
7
|
import "../../../guards.mjs";
|
|
8
8
|
import { O as resolveToolCallParser } from "../../../tool_parsers-DgZhgxV8.mjs";
|
|
9
|
-
import { A as renderMemories, E as normalizeToolName, F as renderThirdPartyPrivateRetrievables, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, k as renderFirstPartyRetrievables, x as filterThoughts, y as descriptionToChatCompletionsJsonSchema, z as renderUntrustedContent } from "../../../helpers-
|
|
9
|
+
import { A as renderMemories, E as normalizeToolName, F as renderThirdPartyPrivateRetrievables, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, k as renderFirstPartyRetrievables, x as filterThoughts, y as descriptionToChatCompletionsJsonSchema, z as renderUntrustedContent } from "../../../helpers-C1T0DV8Q.mjs";
|
|
10
10
|
import { E_GEMINI_GENERATE_CONTENT_CONTEXT_OVERFLOW, E_GEMINI_INVALID_TOOL_CALL_ARGS, E_GEMINI_MISSING_THOUGHT_SIGNATURE, E_GEMINI_REQUEST_FAILED, E_GEMINI_STREAM_ERROR, E_INVALID_GEMINI_GENERATE_CONTENT_OPTIONS } from "./exceptions.mjs";
|
|
11
11
|
import { validateOptions } from "./validation.mjs";
|
|
12
12
|
import { DEFAULT_GEMINI_BUCKET_ORDER, buildGeminiRequest, extractGeminiGeneration, mediaToGeminiInlineData, renderGeminiToolResult, toolsToGeminiTools } from "./helpers.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../../chunk-Cek0wNdY.
|
|
3
|
-
const require_exceptions = require("../../../exceptions-DrHnAGQz.
|
|
2
|
+
require("../../../chunk-Cek0wNdY.cjs");
|
|
3
|
+
const require_exceptions = require("../../../exceptions-DrHnAGQz.cjs");
|
|
4
4
|
require("../../../factories.cjs");
|
|
5
5
|
//#region src/batteries/llm/gemini_generate_content/exceptions.ts
|
|
6
6
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../../chunk-Cek0wNdY.
|
|
3
|
-
const require_guards = require("../../../guards-
|
|
2
|
+
require("../../../chunk-Cek0wNdY.cjs");
|
|
3
|
+
const require_guards = require("../../../guards-5-XmJgD2.cjs");
|
|
4
4
|
require("../../../guards.cjs");
|
|
5
|
-
const require_helpers = require("../../../helpers-
|
|
5
|
+
const require_helpers = require("../../../helpers-Dcp4CrOz.cjs");
|
|
6
6
|
//#region src/batteries/llm/gemini_generate_content/helpers.ts
|
|
7
7
|
/**
|
|
8
8
|
* Translation helpers for the native Gemini `generateContent` battery.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as isObject } from "../../../guards-BEpY7lBI.mjs";
|
|
2
2
|
import "../../../guards.mjs";
|
|
3
|
-
import { A as renderMemories, C as looksLikeSpooledArtifact, D as renderArtifactHandleBody, E as normalizeToolName, F as renderThirdPartyPrivateRetrievables, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, T as neutraliseDeveloperRulesTag, U as sanitizeMimeType, _ as defaultRenderUntrustedContent, a as defaultRenderArtifactHandleBody, c as defaultRenderMemories, d as defaultRenderRetrievables, f as defaultRenderStandingInstructions, g as defaultRenderTrustedContent, h as defaultRenderThought, i as defaultFilterThoughts, j as renderRetrievableHandleBody, k as renderFirstPartyRetrievables, l as defaultRenderRetrievableHandleBody, m as defaultRenderThirdPartyPublicRetrievables, o as defaultRenderChatCompletionsSystemPrompt, p as defaultRenderThirdPartyPrivateRetrievables, r as defaultDescriptionToChatCompletionsJsonSchema, s as defaultRenderFirstPartyRetrievables, u as defaultRenderRetrievableSafetyDirective, x as filterThoughts, y as descriptionToChatCompletionsJsonSchema, z as renderUntrustedContent } from "../../../helpers-
|
|
3
|
+
import { A as renderMemories, C as looksLikeSpooledArtifact, D as renderArtifactHandleBody, E as normalizeToolName, F as renderThirdPartyPrivateRetrievables, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, T as neutraliseDeveloperRulesTag, U as sanitizeMimeType, _ as defaultRenderUntrustedContent, a as defaultRenderArtifactHandleBody, c as defaultRenderMemories, d as defaultRenderRetrievables, f as defaultRenderStandingInstructions, g as defaultRenderTrustedContent, h as defaultRenderThought, i as defaultFilterThoughts, j as renderRetrievableHandleBody, k as renderFirstPartyRetrievables, l as defaultRenderRetrievableHandleBody, m as defaultRenderThirdPartyPublicRetrievables, o as defaultRenderChatCompletionsSystemPrompt, p as defaultRenderThirdPartyPrivateRetrievables, r as defaultDescriptionToChatCompletionsJsonSchema, s as defaultRenderFirstPartyRetrievables, u as defaultRenderRetrievableSafetyDirective, x as filterThoughts, y as descriptionToChatCompletionsJsonSchema, z as renderUntrustedContent } from "../../../helpers-C1T0DV8Q.mjs";
|
|
4
4
|
//#region src/batteries/llm/gemini_generate_content/helpers.ts
|
|
5
5
|
/**
|
|
6
6
|
* Translation helpers for the native Gemini `generateContent` battery.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../../chunk-Cek0wNdY.
|
|
2
|
+
require("../../../chunk-Cek0wNdY.cjs");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../../chunk-Cek0wNdY.
|
|
3
|
-
const require_tokenizable = require("../../../tokenizable-
|
|
4
|
-
require("../../../common-
|
|
2
|
+
require("../../../chunk-Cek0wNdY.cjs");
|
|
3
|
+
const require_tokenizable = require("../../../tokenizable-DDIdXbJN.cjs");
|
|
4
|
+
require("../../../common-7gCR3zQu.cjs");
|
|
5
5
|
const require_batteries_llm_gemini_generate_content_exceptions = require("./exceptions.cjs");
|
|
6
6
|
let _nhtio_validation = require("@nhtio/validation");
|
|
7
7
|
//#region src/batteries/llm/gemini_generate_content/validation.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as TokenEncoding } from "../../../tokenizable-xPXj1AQX.mjs";
|
|
2
|
-
import "../../../common-
|
|
2
|
+
import "../../../common-B5maOoF_.mjs";
|
|
3
3
|
import { E_INVALID_GEMINI_GENERATE_CONTENT_OPTIONS } from "./exceptions.mjs";
|
|
4
4
|
import { validator } from "@nhtio/validation";
|
|
5
5
|
//#region src/batteries/llm/gemini_generate_content/validation.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../chunk-Cek0wNdY.
|
|
3
|
-
const require_helpers = require("../../helpers-
|
|
2
|
+
require("../../chunk-Cek0wNdY.cjs");
|
|
3
|
+
const require_helpers = require("../../helpers-Dcp4CrOz.cjs");
|
|
4
4
|
const require_batteries_llm_gemini_generate_content_exceptions = require("./gemini_generate_content/exceptions.cjs");
|
|
5
5
|
const require_batteries_llm_gemini_generate_content_validation = require("./gemini_generate_content/validation.cjs");
|
|
6
6
|
const require_batteries_llm_gemini_generate_content_helpers = require("./gemini_generate_content/helpers.cjs");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as renderMemories, D as renderArtifactHandleBody, F as renderThirdPartyPrivateRetrievables, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, _ as defaultRenderUntrustedContent, a as defaultRenderArtifactHandleBody, c as defaultRenderMemories, d as defaultRenderRetrievables, f as defaultRenderStandingInstructions, g as defaultRenderTrustedContent, h as defaultRenderThought, i as defaultFilterThoughts, j as renderRetrievableHandleBody, k as renderFirstPartyRetrievables, l as defaultRenderRetrievableHandleBody, m as defaultRenderThirdPartyPublicRetrievables, o as defaultRenderChatCompletionsSystemPrompt, p as defaultRenderThirdPartyPrivateRetrievables, r as defaultDescriptionToChatCompletionsJsonSchema, s as defaultRenderFirstPartyRetrievables, u as defaultRenderRetrievableSafetyDirective, x as filterThoughts, y as descriptionToChatCompletionsJsonSchema, z as renderUntrustedContent } from "../../helpers-
|
|
1
|
+
import { A as renderMemories, D as renderArtifactHandleBody, F as renderThirdPartyPrivateRetrievables, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, _ as defaultRenderUntrustedContent, a as defaultRenderArtifactHandleBody, c as defaultRenderMemories, d as defaultRenderRetrievables, f as defaultRenderStandingInstructions, g as defaultRenderTrustedContent, h as defaultRenderThought, i as defaultFilterThoughts, j as renderRetrievableHandleBody, k as renderFirstPartyRetrievables, l as defaultRenderRetrievableHandleBody, m as defaultRenderThirdPartyPublicRetrievables, o as defaultRenderChatCompletionsSystemPrompt, p as defaultRenderThirdPartyPrivateRetrievables, r as defaultDescriptionToChatCompletionsJsonSchema, s as defaultRenderFirstPartyRetrievables, u as defaultRenderRetrievableSafetyDirective, x as filterThoughts, y as descriptionToChatCompletionsJsonSchema, z as renderUntrustedContent } from "../../helpers-C1T0DV8Q.mjs";
|
|
2
2
|
import { E_GEMINI_INVALID_TOOL_CALL_ARGS, E_GEMINI_MISSING_THOUGHT_SIGNATURE, E_GEMINI_REQUEST_FAILED, E_GEMINI_STREAM_ERROR, E_INVALID_GEMINI_GENERATE_CONTENT_OPTIONS } from "./gemini_generate_content/exceptions.mjs";
|
|
3
3
|
import { geminiGenerateContentOptionsSchema, validateOptions } from "./gemini_generate_content/validation.mjs";
|
|
4
4
|
import { DEFAULT_GEMINI_BUCKET_ORDER, buildGeminiRequest, defaultBuildGeminiRequest, defaultExtractGeminiGeneration, defaultMediaToGeminiInlineData, defaultRenderGeminiToolResult, defaultSanitizeGeminiSchema, defaultToolsToGeminiTools, extractGeminiGeneration, mediaToGeminiInlineData, renderGeminiToolResult, sanitizeGeminiSchema, toolsToGeminiTools } from "./gemini_generate_content/helpers.mjs";
|
package/batteries/llm/index.d.ts
CHANGED
|
@@ -37,5 +37,5 @@ export type { TransformersJsAdapterOptions, TransformersJsPipeline, Transformers
|
|
|
37
37
|
export { ClaudeCodeCliAdapter } from "./claude_code_cli/index";
|
|
38
38
|
export { claudeCodeCliOptionsSchema } from "./claude_code_cli/index";
|
|
39
39
|
export { validateOptions as validateClaudeCodeCliOptions } from "./claude_code_cli/index";
|
|
40
|
-
export { E_INVALID_CLAUDE_CODE_CLI_OPTIONS, E_CLAUDE_CODE_CLI_BINARY_NOT_FOUND, E_CLAUDE_CODE_CLI_WRAPPER_SPAWN_ERROR, E_CLAUDE_CODE_CLI_WRAPPER_CRASHED, E_CLAUDE_CODE_CLI_PROCESS_EXITED_NONZERO, E_CLAUDE_CODE_CLI_STREAM_ERROR, E_CLAUDE_CODE_CLI_STREAM_STALLED, E_CLAUDE_CODE_CLI_STARTUP_TIMEOUT, E_CLAUDE_CODE_CLI_MCP_BRIDGE_STARTUP_FAILED, E_CLAUDE_CODE_CLI_TURN_FAILED, E_CLAUDE_CODE_CLI_CONTEXT_OVERFLOW, E_CLAUDE_CODE_CLI_UNSUPPORTED_MEDIA_MODALITY, } from "./claude_code_cli/index";
|
|
40
|
+
export { E_INVALID_CLAUDE_CODE_CLI_OPTIONS, E_CLAUDE_CODE_CLI_BINARY_NOT_FOUND, E_CLAUDE_CODE_CLI_WRAPPER_NOT_FOUND, E_CLAUDE_CODE_CLI_WRAPPER_SPAWN_ERROR, E_CLAUDE_CODE_CLI_WRAPPER_CRASHED, E_CLAUDE_CODE_CLI_PROCESS_EXITED_NONZERO, E_CLAUDE_CODE_CLI_STREAM_ERROR, E_CLAUDE_CODE_CLI_STREAM_STALLED, E_CLAUDE_CODE_CLI_STARTUP_TIMEOUT, E_CLAUDE_CODE_CLI_MCP_BRIDGE_STARTUP_FAILED, E_CLAUDE_CODE_CLI_TURN_FAILED, E_CLAUDE_CODE_CLI_CONTEXT_OVERFLOW, E_CLAUDE_CODE_CLI_UNSUPPORTED_MEDIA_MODALITY, } from "./claude_code_cli/index";
|
|
41
41
|
export type { ClaudeCodeCliHelpers, ClaudeCodeCliAdapterOptions, ClaudeCodeCliExtraArg, WrapperBridgedTool, WrapperAuth, WrapperRunCommand, WrapperToolResultContentBlock, WrapperToolCallResponseCommand, WrapperShutdownCommand, WrapperCommand, WrapperReadyEvent, WrapperInitEvent, WrapperMessageDeltaEvent, WrapperThoughtDeltaEvent, WrapperToolCallRequestEvent, WrapperRetryEvent, WrapperResultEvent, WrapperErrorEvent, WrapperLogEvent, WrapperShutdownCompleteEvent, WrapperEvent, } from "./claude_code_cli/index";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../../chunk-Cek0wNdY.
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const require_spooled_artifact = require("../../../spooled_artifact-
|
|
6
|
-
const require_thought = require("../../../thought-
|
|
7
|
-
const require_tool_call = require("../../../tool_call-
|
|
8
|
-
require("../../../common-
|
|
2
|
+
require("../../../chunk-Cek0wNdY.cjs");
|
|
3
|
+
const require_guards = require("../../../guards-5-XmJgD2.cjs");
|
|
4
|
+
const require_tokenizable = require("../../../tokenizable-DDIdXbJN.cjs");
|
|
5
|
+
const require_spooled_artifact = require("../../../spooled_artifact-BLgbGT8b.cjs");
|
|
6
|
+
const require_thought = require("../../../thought-COeZTQ-B.cjs");
|
|
7
|
+
const require_tool_call = require("../../../tool_call-JbjeUpRK.cjs");
|
|
8
|
+
require("../../../common-7gCR3zQu.cjs");
|
|
9
9
|
require("../../../guards.cjs");
|
|
10
|
-
const require_tool_parsers = require("../../../tool_parsers-
|
|
10
|
+
const require_tool_parsers = require("../../../tool_parsers-8_qO0a_F.cjs");
|
|
11
11
|
const require_batteries_storage_in_memory = require("../../storage/in_memory.cjs");
|
|
12
|
-
const require_helpers = require("../../../helpers-
|
|
13
|
-
const require_gpu_budget = require("../../../gpu_budget-BBIUyLoj.
|
|
14
|
-
const require_lifecycle = require("../../../lifecycle-vYQJ2rmf.
|
|
12
|
+
const require_helpers = require("../../../helpers-Dcp4CrOz.cjs");
|
|
13
|
+
const require_gpu_budget = require("../../../gpu_budget-BBIUyLoj.cjs");
|
|
14
|
+
const require_lifecycle = require("../../../lifecycle-vYQJ2rmf.cjs");
|
|
15
15
|
const require_batteries_llm_chat_common_exceptions = require("../chat_common/exceptions.cjs");
|
|
16
16
|
const require_batteries_llm_litert_lm_exceptions = require("./exceptions.cjs");
|
|
17
17
|
const require_batteries_llm_litert_lm_validation = require("./validation.cjs");
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { r as Tokenizable } from "../../../tokenizable-xPXj1AQX.mjs";
|
|
2
1
|
import { n as isInstanceOf, r as isObject, t as isError } from "../../../guards-BEpY7lBI.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import "../../../
|
|
2
|
+
import { r as Tokenizable } from "../../../tokenizable-xPXj1AQX.mjs";
|
|
3
|
+
import { d as ArtifactTool, h as canonicalStringify, t as SpooledArtifact } from "../../../spooled_artifact-BkOe4-j-.mjs";
|
|
4
|
+
import { n as Message, t as Thought } from "../../../thought-BrQt6HAb.mjs";
|
|
5
|
+
import { n as Media, t as ToolCall } from "../../../tool_call-8crmZsO8.mjs";
|
|
6
|
+
import "../../../common-B5maOoF_.mjs";
|
|
7
7
|
import "../../../guards.mjs";
|
|
8
8
|
import { O as resolveToolCallParser } from "../../../tool_parsers-DgZhgxV8.mjs";
|
|
9
9
|
import { InMemorySpoolStore } from "../../storage/in_memory.mjs";
|
|
10
|
-
import { C as looksLikeSpooledArtifact, E as normalizeToolName, W as stripEnvelopeSpecialTokens, _ as defaultRenderUntrustedContent, a as defaultRenderArtifactHandleBody, c as defaultRenderMemories, d as defaultRenderRetrievables, f as defaultRenderStandingInstructions, g as defaultRenderTrustedContent, h as defaultRenderThought, i as defaultFilterThoughts, l as defaultRenderRetrievableHandleBody, m as defaultRenderThirdPartyPublicRetrievables, o as defaultRenderChatCompletionsSystemPrompt, p as defaultRenderThirdPartyPrivateRetrievables, r as defaultDescriptionToChatCompletionsJsonSchema, s as defaultRenderFirstPartyRetrievables, u as defaultRenderRetrievableSafetyDirective } from "../../../helpers-
|
|
10
|
+
import { C as looksLikeSpooledArtifact, E as normalizeToolName, W as stripEnvelopeSpecialTokens, _ as defaultRenderUntrustedContent, a as defaultRenderArtifactHandleBody, c as defaultRenderMemories, d as defaultRenderRetrievables, f as defaultRenderStandingInstructions, g as defaultRenderTrustedContent, h as defaultRenderThought, i as defaultFilterThoughts, l as defaultRenderRetrievableHandleBody, m as defaultRenderThirdPartyPublicRetrievables, o as defaultRenderChatCompletionsSystemPrompt, p as defaultRenderThirdPartyPrivateRetrievables, r as defaultDescriptionToChatCompletionsJsonSchema, s as defaultRenderFirstPartyRetrievables, u as defaultRenderRetrievableSafetyDirective } from "../../../helpers-C1T0DV8Q.mjs";
|
|
11
11
|
import { C as resolveReasoningParser, n as isGpuOutOfMemoryError, o as resolveGenerationOptions, r as probeGpuBudget } from "../../../gpu_budget-Bi2nUUil.mjs";
|
|
12
12
|
import { n as emitLifecycle } from "../../../lifecycle-C4kwYJ-N.mjs";
|
|
13
13
|
import { E_LLM_GPU_OUT_OF_MEMORY } from "../chat_common/exceptions.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../../chunk-Cek0wNdY.
|
|
3
|
-
const require_exceptions = require("../../../exceptions-DrHnAGQz.
|
|
2
|
+
require("../../../chunk-Cek0wNdY.cjs");
|
|
3
|
+
const require_exceptions = require("../../../exceptions-DrHnAGQz.cjs");
|
|
4
4
|
require("../../../factories.cjs");
|
|
5
5
|
//#region src/batteries/llm/litert_lm/exceptions.ts
|
|
6
6
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../../chunk-Cek0wNdY.
|
|
3
|
-
const require_spooled_artifact = require("../../../spooled_artifact-
|
|
4
|
-
const require_tool_call = require("../../../tool_call-
|
|
2
|
+
require("../../../chunk-Cek0wNdY.cjs");
|
|
3
|
+
const require_spooled_artifact = require("../../../spooled_artifact-BLgbGT8b.cjs");
|
|
4
|
+
const require_tool_call = require("../../../tool_call-JbjeUpRK.cjs");
|
|
5
5
|
require("../../../index.cjs");
|
|
6
|
-
const require_tool_parsers = require("../../../tool_parsers-
|
|
7
|
-
const require_helpers = require("../../../helpers-
|
|
6
|
+
const require_tool_parsers = require("../../../tool_parsers-8_qO0a_F.cjs");
|
|
7
|
+
const require_helpers = require("../../../helpers-Dcp4CrOz.cjs");
|
|
8
8
|
const require_batteries_llm_openai_chat_completions_helpers = require("../openai_chat_completions/helpers.cjs");
|
|
9
|
-
const require_gpu_budget = require("../../../gpu_budget-BBIUyLoj.
|
|
10
|
-
const require_lifecycle = require("../../../lifecycle-vYQJ2rmf.
|
|
9
|
+
const require_gpu_budget = require("../../../gpu_budget-BBIUyLoj.cjs");
|
|
10
|
+
const require_lifecycle = require("../../../lifecycle-vYQJ2rmf.cjs");
|
|
11
11
|
const require_batteries_llm_litert_lm_exceptions = require("./exceptions.cjs");
|
|
12
12
|
//#region src/batteries/llm/litert_lm/helpers.ts
|
|
13
13
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as SpooledArtifact } from "../../../spooled_artifact-
|
|
2
|
-
import { n as Media } from "../../../tool_call-
|
|
1
|
+
import { t as SpooledArtifact } from "../../../spooled_artifact-BkOe4-j-.mjs";
|
|
2
|
+
import { n as Media } from "../../../tool_call-8crmZsO8.mjs";
|
|
3
3
|
import "../../../index.mjs";
|
|
4
4
|
import { C as mistralToolCallParser, D as qwen3CoderToolCallParser, E as pythonicToolCallParser, O as resolveToolCallParser, S as looseKeyedToolCallParser, T as phiToolCallParser, _ as defaultResolveToolCallParser, a as defaultBarePythonicToolCallParser, b as hermesToolCallParser, c as defaultGptOssToolCallParser, d as defaultLooseKeyedToolCallParser, f as defaultMistralToolCallParser, g as defaultQwen3CoderToolCallParser, h as defaultPythonicToolCallParser, i as createAutoToolCallParser, l as defaultHermesToolCallParser, m as defaultPhiToolCallParser, n as DEFAULT_TOOL_CALL_PARSER_ORDER, o as defaultCreateAutoToolCallParser, p as defaultNoneToolCallParser, r as barePythonicToolCallParser, s as defaultGemmaToolCallParser, t as BUNDLED_TOOL_CALL_PARSERS, u as defaultLlama3JsonToolCallParser, v as gemmaToolCallParser, w as noneToolCallParser, x as llama3JsonToolCallParser, y as gptOssToolCallParser } from "../../../tool_parsers-DgZhgxV8.mjs";
|
|
5
|
-
import { A as renderMemories, C as looksLikeSpooledArtifact, D as renderArtifactHandleBody, F as renderThirdPartyPrivateRetrievables, H as sanitizeFilenameForDescription, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, T as neutraliseDeveloperRulesTag, U as sanitizeMimeType, _ as defaultRenderUntrustedContent, a as defaultRenderArtifactHandleBody, c as defaultRenderMemories, d as defaultRenderRetrievables, f as defaultRenderStandingInstructions, g as defaultRenderTrustedContent, h as defaultRenderThought, i as defaultFilterThoughts, j as renderRetrievableHandleBody, k as renderFirstPartyRetrievables, l as defaultRenderRetrievableHandleBody, m as defaultRenderThirdPartyPublicRetrievables, o as defaultRenderChatCompletionsSystemPrompt, p as defaultRenderThirdPartyPrivateRetrievables, r as defaultDescriptionToChatCompletionsJsonSchema, s as defaultRenderFirstPartyRetrievables, u as defaultRenderRetrievableSafetyDirective, x as filterThoughts, y as descriptionToChatCompletionsJsonSchema, z as renderUntrustedContent } from "../../../helpers-
|
|
5
|
+
import { A as renderMemories, C as looksLikeSpooledArtifact, D as renderArtifactHandleBody, F as renderThirdPartyPrivateRetrievables, H as sanitizeFilenameForDescription, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, T as neutraliseDeveloperRulesTag, U as sanitizeMimeType, _ as defaultRenderUntrustedContent, a as defaultRenderArtifactHandleBody, c as defaultRenderMemories, d as defaultRenderRetrievables, f as defaultRenderStandingInstructions, g as defaultRenderTrustedContent, h as defaultRenderThought, i as defaultFilterThoughts, j as renderRetrievableHandleBody, k as renderFirstPartyRetrievables, l as defaultRenderRetrievableHandleBody, m as defaultRenderThirdPartyPublicRetrievables, o as defaultRenderChatCompletionsSystemPrompt, p as defaultRenderThirdPartyPrivateRetrievables, r as defaultDescriptionToChatCompletionsJsonSchema, s as defaultRenderFirstPartyRetrievables, u as defaultRenderRetrievableSafetyDirective, x as filterThoughts, y as descriptionToChatCompletionsJsonSchema, z as renderUntrustedContent } from "../../../helpers-C1T0DV8Q.mjs";
|
|
6
6
|
import { extractReasoningFields } from "../openai_chat_completions/helpers.mjs";
|
|
7
7
|
import { C as resolveReasoningParser, S as noneReasoningParser, _ as gemmaChannelReasoningParser, a as defaultResolveGenerationOptions, b as makeHarmonyAnalysisReasoningParser, c as DEFAULT_REASONING_PARSER_ORDER, d as defaultCreateAutoReasoningParser, f as defaultGemmaChannelReasoningParser, g as defaultThinkTagReasoningParser, h as defaultResolveReasoningParser, i as GENERATION_DEFAULTS, l as buildBundledReasoningParsers, m as defaultNoneReasoningParser, n as isGpuOutOfMemoryError, o as resolveGenerationOptions, p as defaultHarmonyAnalysisReasoningParser, r as probeGpuBudget, s as BUNDLED_REASONING_PARSERS, t as instrumentGpuBuffers, u as createAutoReasoningParser, v as harmonyAnalysisReasoningParser, w as thinkTagReasoningParser, x as makeThinkTagReasoningParser, y as makeGemmaChannelReasoningParser } from "../../../gpu_budget-Bi2nUUil.mjs";
|
|
8
8
|
import { n as emitLifecycle, t as defaultEmitLifecycle } from "../../../lifecycle-C4kwYJ-N.mjs";
|