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