@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
|
@@ -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_bedrock_converse_exceptions = require("./exceptions.cjs");
|
|
6
6
|
let _nhtio_validation = require("@nhtio/validation");
|
|
7
7
|
//#region src/batteries/llm/bedrock_converse/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_BEDROCK_CONVERSE_OPTIONS } from "./exceptions.mjs";
|
|
4
4
|
import { validator } from "@nhtio/validation";
|
|
5
5
|
//#region src/batteries/llm/bedrock_converse/validation.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../chunk-Cek0wNdY.
|
|
3
|
-
const require_helpers = require("../../helpers-
|
|
4
|
-
const require_chat_common = require("../../chat_common-
|
|
2
|
+
require("../../chunk-Cek0wNdY.cjs");
|
|
3
|
+
const require_helpers = require("../../helpers-Dcp4CrOz.cjs");
|
|
4
|
+
const require_chat_common = require("../../chat_common-B7fvGTKv.cjs");
|
|
5
5
|
const require_batteries_llm_bedrock_converse_exceptions = require("./bedrock_converse/exceptions.cjs");
|
|
6
6
|
const require_batteries_llm_bedrock_converse_validation = require("./bedrock_converse/validation.cjs");
|
|
7
7
|
const require_batteries_llm_bedrock_converse_helpers = require("./bedrock_converse/helpers.cjs");
|
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
2
|
-
import { t as deCollideToolCallIds } from "../../chat_common-
|
|
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
|
+
import { t as deCollideToolCallIds } from "../../chat_common-CeoHwSsz.mjs";
|
|
3
3
|
import { E_CONVERSE_ALTERNATION_VIOLATION, E_CONVERSE_INVALID_TOOL_INPUT, E_CONVERSE_MISSING_TOOL_CONFIG, E_CONVERSE_REQUEST_FAILED, E_CONVERSE_STREAM_ERROR, E_INVALID_BEDROCK_CONVERSE_OPTIONS } from "./bedrock_converse/exceptions.mjs";
|
|
4
4
|
import { bedrockConverseOptionsSchema, validateOptions } from "./bedrock_converse/validation.mjs";
|
|
5
5
|
import { DEFAULT_CONVERSE_BUCKET_ORDER, buildConverseRequest, defaultBuildConverseRequest, defaultEnforceConverseAlternation, defaultExtractConverseGeneration, defaultMediaToConverseImage, defaultRenderConverseToolResult, defaultSanitizeConverseSchema, defaultSanitizeToolUseId, defaultToolsToConverseTools, enforceConverseAlternation, extractConverseGeneration, mediaToConverseImage, renderConverseToolResult, sanitizeConverseSchema, sanitizeToolUseId, toolsToConverseTools } from "./bedrock_converse/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/chat_common/exceptions.ts
|
|
6
6
|
/**
|
|
@@ -1,14 +1,15 @@
|
|
|
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
10
|
const require_batteries_storage_in_memory = require("../../storage/in_memory.cjs");
|
|
11
|
-
const require_helpers = require("../../../helpers-
|
|
11
|
+
const require_helpers = require("../../../helpers-Dcp4CrOz.cjs");
|
|
12
|
+
const require_chat_common = require("../../../chat_common-B7fvGTKv.cjs");
|
|
12
13
|
const require_batteries_llm_claude_code_cli_exceptions = require("./exceptions.cjs");
|
|
13
14
|
const require_batteries_llm_claude_code_cli_validation = require("./validation.cjs");
|
|
14
15
|
const require_batteries_llm_claude_code_cli_wire = require("./wire.cjs");
|
|
@@ -45,6 +46,157 @@ var resolveDefaultWrapperPath = () => {
|
|
|
45
46
|
if (typeof require === "function" && typeof require.resolve === "function") return require.resolve("../../../claude-code-cli-wrapper.cjs");
|
|
46
47
|
return decodeURIComponent(new URL("../../../claude-code-cli-wrapper.mjs", "" + {}.url).pathname);
|
|
47
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* Existence-check a candidate wrapper path, lazily acquiring `node:fs`'s `existsSync` — never
|
|
51
|
+
* imported at module scope for the same reason `resolveDefaultWrapperPath` avoids `node:url`
|
|
52
|
+
* above: this file is transitively pulled into the browser test project via `src/batteries`'s
|
|
53
|
+
* barrel, and a module-scope Node-builtin import would throw at import time there. Any failure to
|
|
54
|
+
* even acquire `node:fs` (e.g. a hostile/exotic runtime) is treated as "does not exist" rather
|
|
55
|
+
* than propagating, since this is only ever used to pick between fallback candidates.
|
|
56
|
+
*/
|
|
57
|
+
var existsOnDisk = async (path) => {
|
|
58
|
+
try {
|
|
59
|
+
const fs = await import("node:fs");
|
|
60
|
+
return typeof fs.existsSync === "function" && fs.existsSync(path);
|
|
61
|
+
} catch {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Resolve the wrapper asset's sibling path relative to THIS PACKAGE's own already-published main
|
|
67
|
+
* entry, rather than relative to the (possibly relocated-by-bundling) adapter module. Node's
|
|
68
|
+
* package self-reference feature — a package resolving its own name as a bare specifier — is
|
|
69
|
+
* depth-independent within `@nhtio/adk`'s own tree, so this survives the adapter code being moved
|
|
70
|
+
* around WITHIN the package by a bundler. It only breaks once the calling code has been physically
|
|
71
|
+
* bundled OUTSIDE `@nhtio/adk`'s own directory tree (e.g. into a consumer's Electron main-process
|
|
72
|
+
* bundle) — at that point self-reference falls back to ordinary node_modules bare-specifier
|
|
73
|
+
* resolution, which succeeds exactly when `@nhtio/adk` is still installed as a resolvable
|
|
74
|
+
* dependency from the bundled code's new location. That is the same "normal case" the published
|
|
75
|
+
* `wrapperPath` override already exists for, so this fallback is a strict improvement with no new
|
|
76
|
+
* failure mode: when it can't resolve, behavior degrades to the pre-existing "throw a clear error"
|
|
77
|
+
* path below rather than a worse outcome.
|
|
78
|
+
*
|
|
79
|
+
* Deliberately resolves this package's `exports['.']` main entry (already published, no `exports`
|
|
80
|
+
* map change needed) and derives the wrapper's path as a sibling of that entry's directory — every
|
|
81
|
+
* `vite.config.mts` `build.lib.entry` key (including the un-tagged wrapper) emits to a flat
|
|
82
|
+
* `dist/` directory, so `dirname(mainEntry) === dirname(wrapperAsset)`.
|
|
83
|
+
*
|
|
84
|
+
* Two independent ways to reach a `require`-like resolver are tried, in this order, because a
|
|
85
|
+
* bundled consumer may land in either shape and each leaves the OTHER unusable:
|
|
86
|
+
*
|
|
87
|
+
* 1. A real ambient `require` — present when THIS MODULE has itself been bundled into a CJS
|
|
88
|
+
* output (e.g. `esbuild --platform=node --format=cjs`, which is common for an Electron
|
|
89
|
+
* main-process bundle, the issue's reported scenario). Reused verbatim is the exact same
|
|
90
|
+
* discriminator `resolveDefaultWrapperPath` above already documents:
|
|
91
|
+
* `typeof require === 'function' && typeof require.resolve === 'function'` — because a bundled
|
|
92
|
+
* ESM output can ALSO leave a truthy `require` behind as a dynamic-require shim/Proxy (rolldown
|
|
93
|
+
* and esbuild both do this) whose `.resolve` is not itself a function, and calling it would
|
|
94
|
+
* throw rather than genuinely resolving anything. In a genuine CJS bundle this ambient
|
|
95
|
+
* `require.resolve('@nhtio/adk')` works directly with no `createRequire` bridge needed.
|
|
96
|
+
* 2. `createRequire(import.meta.url)` — the ESM path, used only when step 1 didn't yield a usable
|
|
97
|
+
* resolver. Verified empirically that esbuild's `--format=cjs` output rewrites every
|
|
98
|
+
* `import.meta` reference in bundled source to a plain `var import_meta = {}`, so
|
|
99
|
+
* `import.meta.url` is `undefined` there — `createRequire(undefined)` throws
|
|
100
|
+
* `ERR_INVALID_ARG_VALUE` outright, so this branch is skipped by checking
|
|
101
|
+
* `typeof import.meta.url === 'string'` first rather than letting that throw surface as an
|
|
102
|
+
* opaque, unrelated-looking error. `createRequire` (rather than `import.meta.resolve`) is used
|
|
103
|
+
* here because — unlike `import.meta.resolve` — its `.resolve` performs a real filesystem
|
|
104
|
+
* existence check (verified directly: `import.meta.resolve` happily returns a URL for a target
|
|
105
|
+
* file that does not exist, since it only resolves the `exports` map syntactically;
|
|
106
|
+
* `require.resolve`, including through `createRequire`, throws `MODULE_NOT_FOUND` for a missing
|
|
107
|
+
* target), so a resolved path here is already known to exist and only the derived wrapper
|
|
108
|
+
* sibling still needs its own explicit check below.
|
|
109
|
+
*
|
|
110
|
+
* `tried` always accounts for BOTH routes once step 1 has not already produced a `mainEntry`: step
|
|
111
|
+
* 2 either resolves, records its own failure, or — when `import.meta.url` isn't even a string —
|
|
112
|
+
* records an explicit "skipped: import.meta.url unavailable" entry, so the thrown error's "Tried:"
|
|
113
|
+
* list never silently omits a route just because it was never attempted.
|
|
114
|
+
*
|
|
115
|
+
* A `process.cwd()`-anchored resolution attempt is deliberately NOT included as a further
|
|
116
|
+
* fallback: resolution should stay anchored to the bundle's own module identity, not to a mutable,
|
|
117
|
+
* launch-directory-dependent value that has no necessary relationship to where the bundle — or
|
|
118
|
+
* `@nhtio/adk` — actually live. Failing clearly and pointing at `wrapperPath` is a better outcome
|
|
119
|
+
* than a resolution that silently varies with the process's current working directory.
|
|
120
|
+
*/
|
|
121
|
+
var resolveWrapperPathViaSelfReference = async (wrapperBasename, seams = {}) => {
|
|
122
|
+
const tried = [];
|
|
123
|
+
let mainEntry;
|
|
124
|
+
if (seams.ambientRequireResolve !== void 0 || typeof require === "function" && typeof require.resolve === "function") try {
|
|
125
|
+
mainEntry = (seams.ambientRequireResolve ?? require.resolve)("@nhtio/adk");
|
|
126
|
+
} catch (err) {
|
|
127
|
+
tried.push(`self-reference via ambient require('@nhtio/adk') failed: ${require_guards.isError(err) ? err.message : String(err)}`);
|
|
128
|
+
}
|
|
129
|
+
if (mainEntry === void 0) {
|
|
130
|
+
const importMetaUrl = "importMetaUrl" in seams ? seams.importMetaUrl : {}.url;
|
|
131
|
+
if (typeof importMetaUrl === "string") try {
|
|
132
|
+
const { createRequire } = await import("node:module");
|
|
133
|
+
mainEntry = createRequire(importMetaUrl).resolve("@nhtio/adk");
|
|
134
|
+
} catch (err) {
|
|
135
|
+
tried.push(`self-reference via createRequire(import.meta.url).resolve('@nhtio/adk') failed: ${require_guards.isError(err) ? err.message : String(err)}`);
|
|
136
|
+
}
|
|
137
|
+
else tried.push("self-reference via createRequire(import.meta.url) skipped: import.meta.url unavailable in this module context");
|
|
138
|
+
}
|
|
139
|
+
if (mainEntry === void 0) return { tried };
|
|
140
|
+
const lastSlash = mainEntry.lastIndexOf("/");
|
|
141
|
+
if (lastSlash < 0) {
|
|
142
|
+
tried.push(`self-reference resolved '@nhtio/adk' to an unexpected path with no directory separator: ${mainEntry}`);
|
|
143
|
+
return { tried };
|
|
144
|
+
}
|
|
145
|
+
const candidate = `${mainEntry.slice(0, lastSlash + 1)}${wrapperBasename}`;
|
|
146
|
+
tried.push(candidate);
|
|
147
|
+
return await existsOnDisk(candidate) ? {
|
|
148
|
+
path: candidate,
|
|
149
|
+
tried
|
|
150
|
+
} : { tried };
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Internal, non-public resolver used by the executor call site (never `resolveDefaultWrapperPath`
|
|
154
|
+
* itself, which stays synchronous and unchanged for backwards compatibility with any caller that
|
|
155
|
+
* already imports it directly). Tries the existing relative-to-module resolution FIRST — zero
|
|
156
|
+
* behavior change for the common unbundled case — and only falls back to the self-reference
|
|
157
|
+
* lookup when that candidate does not exist on disk (bundling relocated the adapter). Throws
|
|
158
|
+
* {@link E_CLAUDE_CODE_CLI_WRAPPER_NOT_FOUND} naming every path tried — the relative candidate (or
|
|
159
|
+
* its resolution error) AND every self-reference candidate/reason from
|
|
160
|
+
* {@link resolveWrapperPathViaSelfReference} — when neither resolves, rather than letting a bundled
|
|
161
|
+
* consumer hit an opaque `MODULE_NOT_FOUND`/ENOENT deep inside `execa`, or a truncated error that
|
|
162
|
+
* hides what the self-reference fallback actually attempted.
|
|
163
|
+
*
|
|
164
|
+
* @remarks
|
|
165
|
+
* Electron/asar note: an app packaged into an `asar` archive can still `readFileSync`/`existsSync`
|
|
166
|
+
* transparently-unpacked paths through Electron's patched `fs`, so this existence-check strategy
|
|
167
|
+
* keeps working there without special-casing — but a wrapper asset that ships unpacked (outside
|
|
168
|
+
* `asar`) is still the consumer's responsibility to arrange, same as any other spawned-executable
|
|
169
|
+
* asset; `wrapperPath` remains the escape hatch when that layout doesn't line up.
|
|
170
|
+
*
|
|
171
|
+
* @remarks
|
|
172
|
+
* Coverage note — deployment shapes: this resolver (both branches) only ever finds the wrapper
|
|
173
|
+
* asset when `@nhtio/adk` itself (with `dist/claude-code-cli-wrapper.{cjs,mjs}` inside it) remains
|
|
174
|
+
* an ordinarily-resolvable dependency from wherever the bundle ends up running — the bundle never
|
|
175
|
+
* carries the wrapper asset itself. A bundle relocated outside its original project (so
|
|
176
|
+
* `node_modules/@nhtio/adk` is no longer reachable), or an Electron app that prunes/asar-packs
|
|
177
|
+
* `@nhtio/adk` out of its final package, is NOT covered by either branch and needs the explicit
|
|
178
|
+
* `wrapperPath` option — which is exactly what the thrown error's message directs the caller to.
|
|
179
|
+
*/
|
|
180
|
+
var resolveWrapperPathWithFallback = async (seams = {}) => {
|
|
181
|
+
const resolveRelative = seams.resolveRelative ?? resolveDefaultWrapperPath;
|
|
182
|
+
const resolveSelfRef = seams.resolveSelfRef ?? resolveWrapperPathViaSelfReference;
|
|
183
|
+
const checkExists = seams.checkExists ?? existsOnDisk;
|
|
184
|
+
const tried = [];
|
|
185
|
+
let relative;
|
|
186
|
+
try {
|
|
187
|
+
relative = resolveRelative();
|
|
188
|
+
} catch (err) {
|
|
189
|
+
tried.push(require_guards.isError(err) ? err.message : String(err));
|
|
190
|
+
}
|
|
191
|
+
if (relative !== void 0) {
|
|
192
|
+
tried.push(relative);
|
|
193
|
+
if (await checkExists(relative)) return relative;
|
|
194
|
+
}
|
|
195
|
+
const selfRef = await resolveSelfRef(relative !== void 0 && relative.endsWith(".cjs") ? "claude-code-cli-wrapper.cjs" : "claude-code-cli-wrapper.mjs");
|
|
196
|
+
tried.push(...selfRef.tried);
|
|
197
|
+
if (selfRef.path !== void 0) return selfRef.path;
|
|
198
|
+
throw new require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_WRAPPER_NOT_FOUND([tried.join(", ") || "(no candidates)"]);
|
|
199
|
+
};
|
|
48
200
|
var resolveExeca = async (supplied) => {
|
|
49
201
|
let value = supplied ?? (() => import("execa"));
|
|
50
202
|
if (typeof value === "function" && !("exec" in value)) try {
|
|
@@ -109,6 +261,36 @@ var resolveHelpers = (overrides) => {
|
|
|
109
261
|
var estimateTokensOf = async (value, encoding) => Promise.resolve(value.estimateTokens(encoding));
|
|
110
262
|
var nowIso = () => (/* @__PURE__ */ new Date()).toISOString();
|
|
111
263
|
/**
|
|
264
|
+
* Normalise a thrown/rejected value into a real `Error` suitable as an exception `.cause`. Mirrors
|
|
265
|
+
* `dispatch_runner.ts`'s internal (non-exported) `toErrorCause` convention: a genuine `Error` (per
|
|
266
|
+
* the cross-realm-safe {@link isError} guard) passes through unchanged; anything else — a string,
|
|
267
|
+
* a plain object, a cross-realm error whose `instanceof Error` is false — is wrapped in a real
|
|
268
|
+
* `Error` whose message is the value's best string form, with the original preserved on `.cause`.
|
|
269
|
+
*
|
|
270
|
+
* Never throws. It runs inside the adapter's last-line-of-defence catch handlers (the `onEvent`
|
|
271
|
+
* rejection handler, the stdout `'data'` listener, the background-shutdown rejection handler), so a
|
|
272
|
+
* throw here would recreate the exact unhandled-rejection / uncaught-exception class it exists to
|
|
273
|
+
* prevent. A hostile thrown value can defeat BOTH `JSON.stringify` and `String` (a `Proxy` with a
|
|
274
|
+
* throwing trap, or an object whose `toJSON` and `toString` both throw) and can even make the
|
|
275
|
+
* `isError` guard itself throw, so each step is guarded and the last resort is a fixed string.
|
|
276
|
+
*/
|
|
277
|
+
var toErrorCause = (value) => {
|
|
278
|
+
try {
|
|
279
|
+
if (require_guards.isError(value)) return value;
|
|
280
|
+
} catch {}
|
|
281
|
+
let text;
|
|
282
|
+
try {
|
|
283
|
+
text = typeof value === "string" ? value : value === void 0 ? "undefined" : JSON.stringify(value) ?? String(value);
|
|
284
|
+
} catch {
|
|
285
|
+
try {
|
|
286
|
+
text = String(value);
|
|
287
|
+
} catch {
|
|
288
|
+
text = "[unserialisable thrown value]";
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return new Error(`non-Error thrown while handling a wrapper event: ${text}`, { cause: value });
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
112
294
|
* Integrity checksum over `tool`/`args` — matches every other LLM battery's convention
|
|
113
295
|
* (`sha256(canonicalStringify({tool, args}))`, see `ollama/adapter.ts`'s `computeChecksum`), NOT
|
|
114
296
|
* the per-call `requestId`. Identical repeat calls must share this checksum: it feeds
|
|
@@ -264,7 +446,13 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
|
|
|
264
446
|
ctx.nack(require_guards.isError(err) ? err : new Error(String(err)));
|
|
265
447
|
return;
|
|
266
448
|
}
|
|
267
|
-
|
|
449
|
+
let wrapperPath;
|
|
450
|
+
try {
|
|
451
|
+
wrapperPath = merged.wrapperPath ?? await resolveWrapperPathWithFallback();
|
|
452
|
+
} catch (err) {
|
|
453
|
+
ctx.nack(require_guards.isError(err) ? err : new Error(String(err)));
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
268
456
|
const claudeBin = merged.claudeBin ?? "claude";
|
|
269
457
|
const renderedToolCallResults = /* @__PURE__ */ new Map();
|
|
270
458
|
for (const tc of ctx.turnToolCalls) {
|
|
@@ -401,6 +589,7 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
|
|
|
401
589
|
let currentMessageId;
|
|
402
590
|
let currentMessageBuffer = "";
|
|
403
591
|
let sealedMessage = false;
|
|
592
|
+
let inFlightToolCalls = 0;
|
|
404
593
|
const clearStartupTimer = () => {
|
|
405
594
|
if (startupTimer) clearTimeout(startupTimer);
|
|
406
595
|
startupTimer = void 0;
|
|
@@ -424,14 +613,26 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
|
|
|
424
613
|
Promise.resolve(child).finally(() => {
|
|
425
614
|
clearTimeout(timer);
|
|
426
615
|
resolve();
|
|
427
|
-
});
|
|
616
|
+
}).catch(() => {});
|
|
428
617
|
});
|
|
429
618
|
try {
|
|
430
619
|
child.kill("SIGTERM");
|
|
431
620
|
} catch {}
|
|
432
621
|
};
|
|
622
|
+
const shutdownInBackground = () => {
|
|
623
|
+
gracefulShutdown().catch((err) => {
|
|
624
|
+
const cause = toErrorCause(err);
|
|
625
|
+
try {
|
|
626
|
+
helpers.log.debug({
|
|
627
|
+
kind: "graceful-shutdown-rejected",
|
|
628
|
+
message: `Best-effort wrapper shutdown failed; ignoring (the turn has already settled or is settling independently): ${cause.message}`,
|
|
629
|
+
payload: { cause: cause.message }
|
|
630
|
+
});
|
|
631
|
+
} catch {}
|
|
632
|
+
});
|
|
633
|
+
};
|
|
433
634
|
const abortListener = () => {
|
|
434
|
-
|
|
635
|
+
shutdownInBackground();
|
|
435
636
|
};
|
|
436
637
|
ctx.abortSignal.addEventListener("abort", abortListener, { once: true });
|
|
437
638
|
const detachAbortListener = () => ctx.abortSignal.removeEventListener("abort", abortListener);
|
|
@@ -441,22 +642,50 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
|
|
|
441
642
|
clearStartupTimer();
|
|
442
643
|
clearIdleTimer();
|
|
443
644
|
detachAbortListener();
|
|
444
|
-
|
|
645
|
+
let threw = false;
|
|
646
|
+
try {
|
|
647
|
+
fn();
|
|
648
|
+
} catch (err) {
|
|
649
|
+
threw = true;
|
|
650
|
+
try {
|
|
651
|
+
const cause = toErrorCause(err);
|
|
652
|
+
try {
|
|
653
|
+
helpers.log.error({
|
|
654
|
+
kind: "settlement-handler-threw",
|
|
655
|
+
message: `A dispatch settlement handler threw while finalising the turn; nacking (if not already signalled) instead of leaving the executor hung: ${cause.message}`,
|
|
656
|
+
payload: { cause: cause.message }
|
|
657
|
+
});
|
|
658
|
+
} catch {}
|
|
659
|
+
if (!ctx.isSignalled) try {
|
|
660
|
+
ctx.nack(new require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_STREAM_ERROR([cause.message], { cause }));
|
|
661
|
+
} catch {}
|
|
662
|
+
} catch {}
|
|
663
|
+
} finally {
|
|
664
|
+
if (threw) {
|
|
665
|
+
try {
|
|
666
|
+
shutdownInBackground();
|
|
667
|
+
} catch {}
|
|
668
|
+
try {
|
|
669
|
+
resolveIteration?.();
|
|
670
|
+
} catch {}
|
|
671
|
+
}
|
|
672
|
+
}
|
|
445
673
|
};
|
|
446
674
|
startupTimer = setTimeout(() => {
|
|
447
675
|
settleOnce(() => {
|
|
448
676
|
resolveIteration?.();
|
|
449
|
-
|
|
677
|
+
shutdownInBackground();
|
|
450
678
|
ctx.nack(new require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_STARTUP_TIMEOUT([startupTimeoutMs]));
|
|
451
679
|
});
|
|
452
680
|
}, startupTimeoutMs);
|
|
453
681
|
const armIdleTimer = () => {
|
|
454
682
|
if (!sawReady || !sawInit) return;
|
|
683
|
+
if (inFlightToolCalls > 0) return;
|
|
455
684
|
clearIdleTimer();
|
|
456
685
|
idleTimer = setTimeout(() => {
|
|
457
686
|
settleOnce(() => {
|
|
458
687
|
resolveIteration?.();
|
|
459
|
-
|
|
688
|
+
shutdownInBackground();
|
|
460
689
|
ctx.nack(new require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_STREAM_STALLED([streamIdleTimeoutMs]));
|
|
461
690
|
});
|
|
462
691
|
}, streamIdleTimeoutMs);
|
|
@@ -490,7 +719,8 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
|
|
|
490
719
|
return;
|
|
491
720
|
}
|
|
492
721
|
const args = require_guards.isObject(rawArgs) ? rawArgs : {};
|
|
493
|
-
|
|
722
|
+
const callId = (merged.toolCallIdFilter ?? require_chat_common.deCollideToolCallIds)(requestId, ctx);
|
|
723
|
+
helpers.reportToolCall(callId, {
|
|
494
724
|
tool: tool.name,
|
|
495
725
|
args
|
|
496
726
|
});
|
|
@@ -506,24 +736,24 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
|
|
|
506
736
|
else if (Array.isArray(raw) && raw.length > 0 && raw.every((m) => require_tool_call.Media.isMedia(m))) results = raw;
|
|
507
737
|
else if (require_helpers.looksLikeSpooledArtifact(raw)) results = raw;
|
|
508
738
|
else if (typeof raw === "string" || require_guards.isInstanceOf(raw, "Uint8Array", Uint8Array)) {
|
|
509
|
-
const reader = await spoolStore.write(
|
|
739
|
+
const reader = await spoolStore.write(callId, raw);
|
|
510
740
|
results = new ((tool.artifactConstructor?.()) ?? require_spooled_artifact.SpooledArtifact)(reader);
|
|
511
741
|
} else {
|
|
512
|
-
const reader = await spoolStore.write(
|
|
742
|
+
const reader = await spoolStore.write(callId, String(raw));
|
|
513
743
|
results = new ((tool.artifactConstructor?.()) ?? require_spooled_artifact.SpooledArtifact)(reader);
|
|
514
744
|
}
|
|
515
745
|
} catch (err) {
|
|
516
746
|
toolHadError = true;
|
|
517
747
|
results = new require_tokenizable.Tokenizable(require_guards.isError(err) ? err.message : String(err));
|
|
518
748
|
}
|
|
519
|
-
helpers.reportToolCall(
|
|
749
|
+
helpers.reportToolCall(callId, {
|
|
520
750
|
results,
|
|
521
751
|
isError: toolHadError,
|
|
522
752
|
isComplete: true
|
|
523
753
|
});
|
|
524
754
|
const completedAt = nowIso();
|
|
525
755
|
await ctx.storeToolCall(new require_tool_call.ToolCall({
|
|
526
|
-
id:
|
|
756
|
+
id: callId,
|
|
527
757
|
tool: tool.name,
|
|
528
758
|
args,
|
|
529
759
|
checksum: computeChecksum(tool.name, args),
|
|
@@ -540,7 +770,7 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
|
|
|
540
770
|
try {
|
|
541
771
|
rendered = await renderOutboundResult({
|
|
542
772
|
raw: results,
|
|
543
|
-
callId
|
|
773
|
+
callId,
|
|
544
774
|
inline: isArtifactTool,
|
|
545
775
|
spoolStore,
|
|
546
776
|
unsupportedResultMediaPolicy: merged.unsupportedResultMediaPolicy ?? merged.unsupportedMediaPolicy ?? "throw"
|
|
@@ -595,7 +825,6 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
|
|
|
595
825
|
bridgedTools,
|
|
596
826
|
extraArgs: merged.extraArgs
|
|
597
827
|
});
|
|
598
|
-
armIdleTimer();
|
|
599
828
|
return;
|
|
600
829
|
}
|
|
601
830
|
if (event.type === "init") {
|
|
@@ -606,11 +835,15 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
|
|
|
606
835
|
message: "Claude Code CLI initialized.",
|
|
607
836
|
payload: event
|
|
608
837
|
});
|
|
609
|
-
if (event.mcpServerErrors && event.mcpServerErrors.length > 0)
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
838
|
+
if (event.mcpServerErrors && event.mcpServerErrors.length > 0) {
|
|
839
|
+
settleOnce(() => {
|
|
840
|
+
finish();
|
|
841
|
+
shutdownInBackground();
|
|
842
|
+
ctx.nack(new require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_MCP_BRIDGE_STARTUP_FAILED([event.mcpServerErrors.join(", ")]));
|
|
843
|
+
});
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
846
|
+
armIdleTimer();
|
|
614
847
|
return;
|
|
615
848
|
}
|
|
616
849
|
if (event.type === "retry") {
|
|
@@ -626,14 +859,23 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
|
|
|
626
859
|
currentMessageBuffer += event.delta;
|
|
627
860
|
helpers.reportMessage(event.id, event.delta, { isComplete: event.isComplete });
|
|
628
861
|
if (event.isComplete) await sealCurrentMessage();
|
|
862
|
+
armIdleTimer();
|
|
629
863
|
return;
|
|
630
864
|
}
|
|
631
865
|
if (event.type === "thought_delta") {
|
|
632
866
|
helpers.reportThought(event.id, event.delta, { isComplete: event.isComplete });
|
|
867
|
+
armIdleTimer();
|
|
633
868
|
return;
|
|
634
869
|
}
|
|
635
870
|
if (event.type === "tool_call_request") {
|
|
636
|
-
|
|
871
|
+
inFlightToolCalls += 1;
|
|
872
|
+
clearIdleTimer();
|
|
873
|
+
try {
|
|
874
|
+
await handleToolCallRequest(event.requestId, event.tool, event.args);
|
|
875
|
+
} finally {
|
|
876
|
+
inFlightToolCalls = Math.max(0, inFlightToolCalls - 1);
|
|
877
|
+
}
|
|
878
|
+
armIdleTimer();
|
|
637
879
|
return;
|
|
638
880
|
}
|
|
639
881
|
if (event.type === "result") {
|
|
@@ -663,7 +905,7 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
|
|
|
663
905
|
if (event.type === "error") {
|
|
664
906
|
settleOnce(() => {
|
|
665
907
|
finish();
|
|
666
|
-
|
|
908
|
+
shutdownInBackground();
|
|
667
909
|
ctx.nack(new require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_WRAPPER_CRASHED([event.message]));
|
|
668
910
|
});
|
|
669
911
|
return;
|
|
@@ -689,12 +931,27 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
|
|
|
689
931
|
});
|
|
690
932
|
return;
|
|
691
933
|
}
|
|
692
|
-
onEvent(event)
|
|
934
|
+
onEvent(event).catch((err) => {
|
|
935
|
+
const cause = toErrorCause(err);
|
|
936
|
+
settleOnce(() => {
|
|
937
|
+
resolveIteration?.();
|
|
938
|
+
shutdownInBackground();
|
|
939
|
+
ctx.nack(new require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_STREAM_ERROR([cause.message], { cause }));
|
|
940
|
+
});
|
|
941
|
+
});
|
|
693
942
|
return event;
|
|
694
943
|
});
|
|
695
944
|
child.stdout?.on("data", (chunk) => {
|
|
696
|
-
|
|
697
|
-
|
|
945
|
+
try {
|
|
946
|
+
eventReader.push(chunk);
|
|
947
|
+
} catch (err) {
|
|
948
|
+
const cause = toErrorCause(err);
|
|
949
|
+
settleOnce(() => {
|
|
950
|
+
resolveIteration?.();
|
|
951
|
+
shutdownInBackground();
|
|
952
|
+
ctx.nack(new require_batteries_llm_claude_code_cli_exceptions.E_CLAUDE_CODE_CLI_STREAM_ERROR([cause.message], { cause }));
|
|
953
|
+
});
|
|
954
|
+
}
|
|
698
955
|
});
|
|
699
956
|
child.stdout?.on("end", () => {
|
|
700
957
|
if (sawTerminalEvent) return;
|
|
@@ -729,6 +986,8 @@ var ClaudeCodeCliAdapter = class ClaudeCodeCliAdapter {
|
|
|
729
986
|
};
|
|
730
987
|
//#endregion
|
|
731
988
|
exports.ClaudeCodeCliAdapter = ClaudeCodeCliAdapter;
|
|
989
|
+
exports.__resolveWrapperPathViaSelfReference = resolveWrapperPathViaSelfReference;
|
|
990
|
+
exports.__resolveWrapperPathWithFallback = resolveWrapperPathWithFallback;
|
|
732
991
|
exports.resolveDefaultWrapperPath = resolveDefaultWrapperPath;
|
|
733
992
|
|
|
734
993
|
//# sourceMappingURL=adapter.cjs.map
|