@nhtio/adk 0.1.0-master-e5947c71 → 0.1.0-master-74266e68
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 +124 -1
- package/artifact_methods-BvoDGBnH.cjs +1 -0
- package/artifact_methods-q52ETLwI.mjs +1 -0
- package/batteries/artifacts/ecmascript.cjs +1 -1
- package/batteries/artifacts/ecmascript.mjs +1 -1
- package/batteries/artifacts/toon.cjs +1 -1
- package/batteries/artifacts/toon.mjs +1 -1
- package/batteries/artifacts/xml.cjs +1 -1
- package/batteries/artifacts/xml.mjs +1 -1
- package/batteries/artifacts/yaml.cjs +1 -1
- package/batteries/artifacts/yaml.mjs +1 -1
- package/batteries/artifacts.cjs +4 -4
- package/batteries/artifacts.mjs +4 -4
- package/batteries/dev-tools/forge.cjs +3 -3
- package/batteries/dev-tools/forge.mjs +3 -3
- package/batteries/dev-tools.cjs +2 -2
- package/batteries/dev-tools.mjs +2 -2
- package/batteries/encoding.cjs +7 -7
- package/batteries/encoding.mjs +7 -7
- package/batteries/generation/gemini/adapter.cjs +1 -1
- package/batteries/generation/gemini/adapter.mjs +1 -1
- package/batteries/generation/local_diffusion/adapter.cjs +1 -1
- package/batteries/generation/local_diffusion/adapter.mjs +1 -1
- package/batteries/generation/openai/adapter.cjs +1 -1
- package/batteries/generation/openai/adapter.mjs +1 -1
- package/batteries/llm/anthropic_messages/adapter.cjs +6 -6
- package/batteries/llm/anthropic_messages/adapter.mjs +6 -6
- package/batteries/llm/anthropic_messages/count_tokens.cjs +2 -2
- package/batteries/llm/anthropic_messages/count_tokens.mjs +1 -1
- package/batteries/llm/anthropic_messages/helpers.cjs +3 -3
- package/batteries/llm/anthropic_messages/helpers.mjs +3 -3
- package/batteries/llm/anthropic_messages/validation.cjs +2 -2
- package/batteries/llm/anthropic_messages/validation.mjs +2 -2
- package/batteries/llm/anthropic_messages.cjs +2 -2
- package/batteries/llm/anthropic_messages.mjs +2 -2
- package/batteries/llm/bedrock_converse/adapter.cjs +6 -6
- package/batteries/llm/bedrock_converse/adapter.mjs +6 -6
- package/batteries/llm/bedrock_converse/helpers.cjs +1 -1
- package/batteries/llm/bedrock_converse/helpers.mjs +1 -1
- package/batteries/llm/bedrock_converse/validation.cjs +2 -2
- package/batteries/llm/bedrock_converse/validation.mjs +2 -2
- package/batteries/llm/bedrock_converse.cjs +2 -2
- package/batteries/llm/bedrock_converse.mjs +2 -2
- package/batteries/llm/claude_code_cli/adapter.cjs +7 -7
- package/batteries/llm/claude_code_cli/adapter.mjs +7 -7
- package/batteries/llm/claude_code_cli/helpers.cjs +3 -3
- package/batteries/llm/claude_code_cli/helpers.mjs +3 -3
- package/batteries/llm/claude_code_cli/validation.cjs +2 -2
- package/batteries/llm/claude_code_cli/validation.mjs +2 -2
- package/batteries/llm/claude_code_cli.cjs +2 -2
- package/batteries/llm/claude_code_cli.mjs +2 -2
- package/batteries/llm/gemini_generate_content/adapter.cjs +7 -7
- package/batteries/llm/gemini_generate_content/adapter.mjs +7 -7
- package/batteries/llm/gemini_generate_content/helpers.cjs +1 -1
- package/batteries/llm/gemini_generate_content/helpers.mjs +1 -1
- package/batteries/llm/gemini_generate_content/validation.cjs +2 -2
- package/batteries/llm/gemini_generate_content/validation.mjs +2 -2
- package/batteries/llm/gemini_generate_content.cjs +2 -2
- package/batteries/llm/gemini_generate_content.mjs +2 -2
- package/batteries/llm/litert_lm/adapter.cjs +6 -6
- package/batteries/llm/litert_lm/adapter.mjs +6 -6
- package/batteries/llm/litert_lm/helpers.cjs +3 -3
- package/batteries/llm/litert_lm/helpers.mjs +3 -3
- package/batteries/llm/litert_lm/validation.cjs +2 -2
- package/batteries/llm/litert_lm/validation.mjs +2 -2
- package/batteries/llm/litert_lm.cjs +1 -1
- package/batteries/llm/litert_lm.mjs +1 -1
- package/batteries/llm/ollama/adapter.cjs +6 -6
- package/batteries/llm/ollama/adapter.mjs +6 -6
- package/batteries/llm/ollama/helpers.cjs +4 -4
- package/batteries/llm/ollama/helpers.mjs +4 -4
- package/batteries/llm/ollama/validation.cjs +2 -2
- package/batteries/llm/ollama/validation.mjs +2 -2
- package/batteries/llm/ollama.cjs +2 -2
- package/batteries/llm/ollama.mjs +2 -2
- package/batteries/llm/openai_chat_completions/adapter.cjs +6 -6
- package/batteries/llm/openai_chat_completions/adapter.mjs +6 -6
- package/batteries/llm/openai_chat_completions/helpers.cjs +4 -4
- package/batteries/llm/openai_chat_completions/helpers.mjs +4 -4
- package/batteries/llm/openai_chat_completions/validation.cjs +2 -2
- package/batteries/llm/openai_chat_completions/validation.mjs +2 -2
- package/batteries/llm/openai_chat_completions.cjs +2 -2
- package/batteries/llm/openai_chat_completions.mjs +2 -2
- package/batteries/llm/openai_responses/adapter.cjs +6 -6
- package/batteries/llm/openai_responses/adapter.mjs +6 -6
- package/batteries/llm/openai_responses/helpers.cjs +3 -3
- package/batteries/llm/openai_responses/helpers.mjs +3 -3
- package/batteries/llm/openai_responses/validation.cjs +2 -2
- package/batteries/llm/openai_responses/validation.mjs +2 -2
- package/batteries/llm/openai_responses.cjs +2 -2
- package/batteries/llm/openai_responses.mjs +2 -2
- package/batteries/llm/transformers_js/adapter.cjs +6 -6
- package/batteries/llm/transformers_js/adapter.mjs +6 -6
- package/batteries/llm/transformers_js/helpers.cjs +3 -3
- package/batteries/llm/transformers_js/helpers.mjs +3 -3
- package/batteries/llm/transformers_js/validation.cjs +2 -2
- package/batteries/llm/transformers_js/validation.mjs +2 -2
- package/batteries/llm/transformers_js.cjs +1 -1
- package/batteries/llm/transformers_js.mjs +1 -1
- package/batteries/llm/webllm_chat_completions/adapter.cjs +6 -6
- package/batteries/llm/webllm_chat_completions/adapter.mjs +6 -6
- package/batteries/llm/webllm_chat_completions/helpers.cjs +1 -1
- package/batteries/llm/webllm_chat_completions/helpers.mjs +1 -1
- package/batteries/llm/webllm_chat_completions/validation.cjs +2 -2
- package/batteries/llm/webllm_chat_completions/validation.mjs +2 -2
- package/batteries/llm/webllm_chat_completions.cjs +2 -2
- package/batteries/llm/webllm_chat_completions.mjs +2 -2
- package/batteries/llm.cjs +2 -2
- package/batteries/llm.mjs +2 -2
- package/batteries/media/contracts.cjs.map +1 -1
- package/batteries/media/contracts.d.ts +93 -2
- package/batteries/media/contracts.mjs.map +1 -1
- package/batteries/media/engines/execa_executor.cjs +285 -13
- package/batteries/media/engines/execa_executor.cjs.map +1 -1
- package/batteries/media/engines/execa_executor.d.ts +113 -8
- package/batteries/media/engines/execa_executor.mjs +285 -13
- package/batteries/media/engines/execa_executor.mjs.map +1 -1
- package/batteries/media/forge.cjs +4 -4
- package/batteries/media/forge.mjs +4 -4
- package/batteries/media/lint.cjs +1 -1
- package/batteries/media/lint.mjs +1 -1
- package/batteries/media.cjs +1 -1
- package/batteries/orchestration/dispatch_reasoner.cjs +4 -4
- package/batteries/orchestration/dispatch_reasoner.mjs +4 -4
- package/batteries/orchestration/executor.cjs +2 -2
- package/batteries/orchestration/executor.mjs +2 -2
- package/batteries/orchestration/forge.cjs +3 -3
- package/batteries/orchestration/forge.mjs +3 -3
- package/batteries/orchestration/validation.cjs +2 -2
- package/batteries/orchestration/validation.mjs +2 -2
- package/batteries/orchestration.cjs +3 -3
- package/batteries/orchestration.mjs +3 -3
- package/batteries/sandbox/contracts/policy_enforcer.d.ts +12 -6
- package/batteries/sandbox/executor.d.ts +28 -10
- package/batteries/sandbox/js.cjs +1 -1
- package/batteries/sandbox/js.mjs +1 -1
- package/batteries/sandbox/node/index.d.ts +1 -1
- package/batteries/sandbox/node/srt_enforcer.d.ts +74 -0
- package/batteries/sandbox/node.cjs +98 -5
- package/batteries/sandbox/node.cjs.map +1 -1
- package/batteries/sandbox/node.mjs +98 -6
- package/batteries/sandbox/node.mjs.map +1 -1
- package/batteries/sandbox/tools.cjs +1 -1
- package/batteries/sandbox/tools.mjs +1 -1
- package/batteries/sandbox.cjs +13 -13
- package/batteries/sandbox.cjs.map +1 -1
- package/batteries/sandbox.mjs +13 -13
- package/batteries/sandbox.mjs.map +1 -1
- package/batteries/skills/in_memory.cjs +1 -1
- package/batteries/skills.cjs +10 -10
- package/batteries/skills.mjs +9 -9
- package/batteries/tools/_shared.cjs +1 -1
- package/batteries/tools/_shared.mjs +1 -1
- package/batteries/tools/color.cjs +2 -2
- package/batteries/tools/color.mjs +2 -2
- package/batteries/tools/comparison.cjs +2 -2
- package/batteries/tools/comparison.mjs +2 -2
- package/batteries/tools/data_structure.cjs +2 -2
- package/batteries/tools/data_structure.mjs +2 -2
- package/batteries/tools/datetime_extended.cjs +3 -3
- package/batteries/tools/datetime_extended.mjs +3 -3
- package/batteries/tools/datetime_math.cjs +3 -3
- package/batteries/tools/datetime_math.mjs +3 -3
- package/batteries/tools/encoding.cjs +2 -2
- package/batteries/tools/encoding.mjs +2 -2
- package/batteries/tools/formatting.cjs +2 -2
- package/batteries/tools/formatting.mjs +2 -2
- package/batteries/tools/geo_basics.cjs +2 -2
- package/batteries/tools/geo_basics.mjs +2 -2
- package/batteries/tools/math.cjs +2 -2
- package/batteries/tools/math.mjs +2 -2
- package/batteries/tools/memory.cjs +5 -5
- package/batteries/tools/memory.mjs +5 -5
- package/batteries/tools/parsing.cjs +3 -3
- package/batteries/tools/parsing.mjs +3 -3
- package/batteries/tools/retrievables.cjs +5 -5
- package/batteries/tools/retrievables.mjs +5 -5
- package/batteries/tools/scrapper.cjs +1 -1
- package/batteries/tools/scrapper.mjs +1 -1
- package/batteries/tools/searxng.cjs +1 -1
- package/batteries/tools/searxng.mjs +1 -1
- package/batteries/tools/standing_instructions.cjs +3 -3
- package/batteries/tools/standing_instructions.mjs +3 -3
- package/batteries/tools/statistics.cjs +3 -3
- package/batteries/tools/statistics.mjs +3 -3
- package/batteries/tools/string_processing.cjs +2 -2
- package/batteries/tools/string_processing.mjs +2 -2
- package/batteries/tools/structured_data.cjs +2 -2
- package/batteries/tools/structured_data.mjs +2 -2
- package/batteries/tools/text_analysis.cjs +3 -3
- package/batteries/tools/text_analysis.mjs +3 -3
- package/batteries/tools/text_comparison.cjs +2 -2
- package/batteries/tools/text_comparison.mjs +2 -2
- package/batteries/tools/time.cjs +3 -3
- package/batteries/tools/time.mjs +3 -3
- package/batteries/tools/unit_conversion.cjs +2 -2
- package/batteries/tools/unit_conversion.mjs +2 -2
- package/batteries/tools.cjs +2 -2
- package/batteries/tools.mjs +2 -2
- package/batteries/validation.cjs +4 -4
- package/batteries/validation.mjs +4 -4
- package/batteries/vector/chroma.cjs +1 -1
- package/batteries/vector/chroma.mjs +1 -1
- package/batteries/vector/clickhouse.cjs +1 -1
- package/batteries/vector/clickhouse.mjs +1 -1
- package/batteries/vector/cloudflare.cjs +1 -1
- package/batteries/vector/cloudflare.mjs +1 -1
- package/batteries/vector/couchbase.cjs +1 -1
- package/batteries/vector/couchbase.mjs +1 -1
- package/batteries/vector/duckdb.cjs +1 -1
- package/batteries/vector/duckdb.mjs +1 -1
- package/batteries/vector/elasticsearch.cjs +1 -1
- package/batteries/vector/elasticsearch.mjs +1 -1
- package/batteries/vector/hnswlib.cjs +1 -1
- package/batteries/vector/hnswlib.mjs +1 -1
- package/batteries/vector/in_memory.cjs +1 -1
- package/batteries/vector/in_memory.mjs +1 -1
- package/batteries/vector/lancedb.cjs +1 -1
- package/batteries/vector/lancedb.mjs +1 -1
- package/batteries/vector/mariadb.cjs +1 -1
- package/batteries/vector/mariadb.mjs +1 -1
- package/batteries/vector/milvus.cjs +1 -1
- package/batteries/vector/milvus.mjs +1 -1
- package/batteries/vector/opensearch.cjs +1 -1
- package/batteries/vector/opensearch.mjs +1 -1
- package/batteries/vector/oracle23ai.cjs +1 -1
- package/batteries/vector/oracle23ai.mjs +1 -1
- package/batteries/vector/orama.cjs +1 -1
- package/batteries/vector/orama.mjs +1 -1
- package/batteries/vector/pgvector.cjs +1 -1
- package/batteries/vector/pgvector.mjs +1 -1
- package/batteries/vector/pinecone.cjs +1 -1
- package/batteries/vector/pinecone.mjs +1 -1
- package/batteries/vector/qdrant.cjs +1 -1
- package/batteries/vector/qdrant.mjs +1 -1
- package/batteries/vector/redis.cjs +1 -1
- package/batteries/vector/redis.mjs +1 -1
- package/batteries/vector/retrievable.cjs +1 -1
- package/batteries/vector/retrievable.mjs +1 -1
- package/batteries/vector/s3vectors.cjs +1 -1
- package/batteries/vector/s3vectors.mjs +1 -1
- package/batteries/vector/sqlite_vec.cjs +1 -1
- package/batteries/vector/sqlite_vec.mjs +1 -1
- package/batteries/vector/typesense.cjs +1 -1
- package/batteries/vector/typesense.mjs +1 -1
- package/batteries/vector/vespa.cjs +1 -1
- package/batteries/vector/vespa.mjs +1 -1
- package/batteries/vector/weaviate.cjs +1 -1
- package/batteries/vector/weaviate.mjs +1 -1
- package/batteries/vector.cjs +2 -2
- package/batteries/vector.mjs +2 -2
- package/batteries.cjs +9 -9
- package/batteries.mjs +9 -9
- package/{chat_common-DKw8FDol.mjs → chat_common-CeoHwSsz.mjs} +2 -2
- package/{chat_common-DKw8FDol.mjs.map → chat_common-CeoHwSsz.mjs.map} +1 -1
- package/{chat_common-vSxDBGgr.cjs → chat_common-DlIK1IAn.cjs} +2 -2
- package/{chat_common-vSxDBGgr.cjs.map → chat_common-DlIK1IAn.cjs.map} +1 -1
- package/{common-oI1niK9Z.mjs → common-B5maOoF_.mjs} +7 -7
- package/{common-oI1niK9Z.mjs.map → common-B5maOoF_.mjs.map} +1 -1
- package/{common-BcB05Isq.cjs → common-joo6vLu-.cjs} +7 -7
- package/{common-BcB05Isq.cjs.map → common-joo6vLu-.cjs.map} +1 -1
- package/common.cjs +7 -7
- package/common.mjs +7 -7
- package/{dispatch_runner-CTAI0RSs.cjs → dispatch_runner-BTaUtdtO.cjs} +5 -5
- package/{dispatch_runner-CTAI0RSs.cjs.map → dispatch_runner-BTaUtdtO.cjs.map} +1 -1
- package/{dispatch_runner-BZDXUe0G.mjs → dispatch_runner-DO7jo_gl.mjs} +5 -5
- package/{dispatch_runner-BZDXUe0G.mjs.map → dispatch_runner-DO7jo_gl.mjs.map} +1 -1
- package/dispatch_runner.cjs +1 -1
- package/dispatch_runner.mjs +1 -1
- package/{ecmascript-DOv8gVQ5.cjs → ecmascript-ChvxTCXz.cjs} +3 -3
- package/{ecmascript-DOv8gVQ5.cjs.map → ecmascript-ChvxTCXz.cjs.map} +1 -1
- package/{ecmascript-B9Z2C24U.mjs → ecmascript-bgwVyZG1.mjs} +3 -3
- package/{ecmascript-B9Z2C24U.mjs.map → ecmascript-bgwVyZG1.mjs.map} +1 -1
- package/eslint/rules.cjs +1 -1
- package/eslint/rules.mjs +1 -1
- package/eslint.cjs +2 -2
- package/eslint.mjs +2 -2
- package/exceptions.cjs +1 -1
- package/exceptions.mjs +1 -1
- package/forge.cjs +2 -2
- package/forge.mjs +2 -2
- package/guards.cjs +7 -7
- package/guards.mjs +7 -7
- package/{helpers-mbn_EsDV.mjs → helpers-C1T0DV8Q.mjs} +3 -3
- package/{helpers-mbn_EsDV.mjs.map → helpers-C1T0DV8Q.mjs.map} +1 -1
- package/{helpers-CiZnHmxC.cjs → helpers-D6ebO8Vc.cjs} +3 -3
- package/{helpers-CiZnHmxC.cjs.map → helpers-D6ebO8Vc.cjs.map} +1 -1
- package/index.cjs +10 -10
- package/index.mjs +10 -10
- package/{manifest-BPcrFRN4.cjs → manifest-DPYWN15l.cjs} +2 -2
- package/{manifest-BPcrFRN4.cjs.map → manifest-DPYWN15l.cjs.map} +1 -1
- package/mcp/adk-docs-corpus.json +2 -2
- package/package.json +407 -407
- package/{retrievable-CXTAUuuv.mjs → retrievable-CrGKx4sc.mjs} +3 -3
- package/{retrievable-CXTAUuuv.mjs.map → retrievable-CrGKx4sc.mjs.map} +1 -1
- package/{retrievable-BOuQSDHF.cjs → retrievable-DVkAglIv.cjs} +3 -3
- package/{retrievable-BOuQSDHF.cjs.map → retrievable-DVkAglIv.cjs.map} +1 -1
- package/{scrapper-lXnFGDi0.cjs → scrapper-Boc6kq2v.cjs} +4 -4
- package/{scrapper-lXnFGDi0.cjs.map → scrapper-Boc6kq2v.cjs.map} +1 -1
- package/{scrapper-BCdUm8c8.mjs → scrapper-D2Gy9Jhv.mjs} +4 -4
- package/{scrapper-BCdUm8c8.mjs.map → scrapper-D2Gy9Jhv.mjs.map} +1 -1
- package/{searxng-N7qu6dA-.cjs → searxng-DOy3eBDH.cjs} +4 -4
- package/{searxng-N7qu6dA-.cjs.map → searxng-DOy3eBDH.cjs.map} +1 -1
- package/{searxng-B-LdaVUP.mjs → searxng-cCb0lAcN.mjs} +4 -4
- package/{searxng-B-LdaVUP.mjs.map → searxng-cCb0lAcN.mjs.map} +1 -1
- package/server.json +2 -2
- package/skills/adk-assembly/SKILL.md +2 -2
- package/{spooled_artifact-Bw_7swIp.mjs → spooled_artifact-BkOe4-j-.mjs} +731 -731
- package/spooled_artifact-BkOe4-j-.mjs.map +1 -0
- package/{spooled_artifact-DZXsP4s1.cjs → spooled_artifact-BoYsldvO.cjs} +730 -730
- package/spooled_artifact-BoYsldvO.cjs.map +1 -0
- package/spooled_artifact.cjs +2 -2
- package/spooled_artifact.mjs +2 -2
- package/{spooled_markdown_artifact-vd6eNtIP.mjs → spooled_markdown_artifact-Dnl-lCGv.mjs} +3 -3
- package/{spooled_markdown_artifact-vd6eNtIP.mjs.map → spooled_markdown_artifact-Dnl-lCGv.mjs.map} +1 -1
- package/{spooled_markdown_artifact-Bo0u8cRS.cjs → spooled_markdown_artifact-DzbydBel.cjs} +3 -3
- package/{spooled_markdown_artifact-Bo0u8cRS.cjs.map → spooled_markdown_artifact-DzbydBel.cjs.map} +1 -1
- package/{thought-CxSaF6Xf.mjs → thought-BrQt6HAb.mjs} +3 -3
- package/{thought-CxSaF6Xf.mjs.map → thought-BrQt6HAb.mjs.map} +1 -1
- package/{thought-C12mqaKQ.cjs → thought-CXsVh5hS.cjs} +3 -3
- package/{thought-C12mqaKQ.cjs.map → thought-CXsVh5hS.cjs.map} +1 -1
- package/{tokenizable-BcodRtoW.cjs → tokenizable-DDIdXbJN.cjs} +29 -29
- package/{tokenizable-BcodRtoW.cjs.map → tokenizable-DDIdXbJN.cjs.map} +1 -1
- package/{tokenizable-VB4Av8GF.mjs → tokenizable-xPXj1AQX.mjs} +30 -30
- package/{tokenizable-VB4Av8GF.mjs.map → tokenizable-xPXj1AQX.mjs.map} +1 -1
- package/{tool_call-Cfaj-6zK.mjs → tool_call-8crmZsO8.mjs} +4 -4
- package/{tool_call-Cfaj-6zK.mjs.map → tool_call-8crmZsO8.mjs.map} +1 -1
- package/{tool_call-CsBOpKsg.cjs → tool_call-NvQcPf5d.cjs} +4 -4
- package/{tool_call-CsBOpKsg.cjs.map → tool_call-NvQcPf5d.cjs.map} +1 -1
- package/{tools-BjHXlDlV.cjs → tools-BHc8qB5I.cjs} +6 -6
- package/{tools-BjHXlDlV.cjs.map → tools-BHc8qB5I.cjs.map} +1 -1
- package/{tools-Vkfht7mU.mjs → tools-geIlta3C.mjs} +6 -6
- package/{tools-Vkfht7mU.mjs.map → tools-geIlta3C.mjs.map} +1 -1
- package/{toon-BSTQnHed.mjs → toon-BA9Q7NHG.mjs} +5 -5
- package/{toon-BSTQnHed.mjs.map → toon-BA9Q7NHG.mjs.map} +1 -1
- package/{toon-5c9ceKiU.cjs → toon-C8IFssRi.cjs} +5 -5
- package/{toon-5c9ceKiU.cjs.map → toon-C8IFssRi.cjs.map} +1 -1
- package/{turn_runner--tsMLLx4.cjs → turn_runner-A-vpLUvj.cjs} +5 -5
- package/{turn_runner--tsMLLx4.cjs.map → turn_runner-A-vpLUvj.cjs.map} +1 -1
- package/{turn_runner-BHHD6h77.mjs → turn_runner-BmVXcBZ2.mjs} +5 -5
- package/{turn_runner-BHHD6h77.mjs.map → turn_runner-BmVXcBZ2.mjs.map} +1 -1
- package/turn_runner.cjs +1 -1
- package/turn_runner.mjs +1 -1
- package/{xml-CYseDztH.mjs → xml-B1JIGLpU.mjs} +5 -5
- package/{xml-CYseDztH.mjs.map → xml-B1JIGLpU.mjs.map} +1 -1
- package/{xml-DTOnPN52.cjs → xml-Cu7ZvgBQ.cjs} +5 -5
- package/{xml-DTOnPN52.cjs.map → xml-Cu7ZvgBQ.cjs.map} +1 -1
- package/{yaml-BPBoiOjx.mjs → yaml-1mP4uxdf.mjs} +5 -5
- package/{yaml-BPBoiOjx.mjs.map → yaml-1mP4uxdf.mjs.map} +1 -1
- package/{yaml-CMrbNWLc.cjs → yaml-BlB29N68.cjs} +5 -5
- package/{yaml-CMrbNWLc.cjs.map → yaml-BlB29N68.cjs.map} +1 -1
- package/artifact_methods-Cg0go7Q4.mjs +0 -1
- package/artifact_methods-Dtf4-3C-.cjs +0 -1
- package/spooled_artifact-Bw_7swIp.mjs.map +0 -1
- package/spooled_artifact-DZXsP4s1.cjs.map +0 -1
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { n as isInstanceOf, r as isObject, t as isError } from "../guards-BEpY7lBI.mjs";
|
|
2
|
-
import { i as effectiveToolMethods } from "../spooled_artifact-
|
|
2
|
+
import { i as effectiveToolMethods } from "../spooled_artifact-BkOe4-j-.mjs";
|
|
3
3
|
import { NodeRef, ParamRef, planDigest, registerOrchestrationEncodables } from "./orchestration/encoding.mjs";
|
|
4
4
|
import { branchKey, foldOps } from "./orchestration/ops.mjs";
|
|
5
5
|
import { entryNodes, findCycle, handleAppliesTo, immediateDominator, incoming, isPlanEdge, isPlanNode, isValidEdgeId, isValidNodeId, nodeById, outgoing, reachableFrom, readPath, routesBetween } from "./orchestration/plan.mjs";
|
|
6
6
|
import { approvePlan, computeAuthoritySet } from "./orchestration/approval.mjs";
|
|
7
7
|
import { decodeOutputSchema, joinPromptParts, stripInstructionTags, validateReasonerOutput, wrapInstruction } from "./orchestration/reason.mjs";
|
|
8
8
|
import { createDispatchReasoner } from "./orchestration/dispatch_reasoner.mjs";
|
|
9
|
-
import { InMemoryPlanStore } from "./orchestration/in_memory.mjs";
|
|
10
9
|
import { foldRun } from "./orchestration/runs.mjs";
|
|
11
|
-
import "../artifact_methods-
|
|
10
|
+
import "../artifact_methods-q52ETLwI.mjs";
|
|
12
11
|
import { executePlan } from "./orchestration/executor.mjs";
|
|
13
12
|
import { renderPlan } from "./orchestration/render.mjs";
|
|
14
13
|
import { rawDiff, rawOps, rawPlan } from "./orchestration/raw.mjs";
|
|
@@ -17,6 +16,7 @@ import { freezePlan } from "./orchestration/validation.mjs";
|
|
|
17
16
|
import { instantiateTemplate, validateTemplate } from "./orchestration/templates.mjs";
|
|
18
17
|
import { forgeOrchestrationTools } from "./orchestration/forge.mjs";
|
|
19
18
|
import { a as isStructuredPredicate, c as E_ORCH_CELL_UNAVAILABLE, i as isPredicateLeaf, l as E_ORCH_ENCODER_REQUIRED, n as isAnyPredicate, o as loadOnce, r as isNotPredicate, s as parseStructuredPredicate, t as isAllPredicate } from "../predicates-CM27Z3TF.mjs";
|
|
19
|
+
import { InMemoryPlanStore } from "./orchestration/in_memory.mjs";
|
|
20
20
|
import { createStructuredCell } from "./orchestration/cells/structured.mjs";
|
|
21
21
|
import { createJexlCell } from "./orchestration/cells/jexl.mjs";
|
|
22
22
|
//#region src/batteries/orchestration/index.ts
|
|
@@ -25,14 +25,20 @@ export interface SandboxPolicyEnforcer {
|
|
|
25
25
|
correlationId: string;
|
|
26
26
|
cwd: string;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* The caller's own EXPLICIT environment values, applied LAST.
|
|
29
29
|
*
|
|
30
30
|
* @remarks
|
|
31
|
-
* NOT the host-inheritance control. What a child inherits from the host is the ADAPTER's
|
|
32
|
-
* (the Node/SRT one denies by default and
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
31
|
+
* NOT the host-inheritance control. What a child inherits from the host is the ADAPTER's
|
|
32
|
+
* decision, expressed as an allow-list the adapter owns (the Node/SRT one denies by default and
|
|
33
|
+
* takes that allow-list at construction). This field is the other half of the picture: the
|
|
34
|
+
* values the caller names itself. They may add names, or override inherited ones, and because
|
|
35
|
+
* they are applied last they also win a collision with an allow-listed name.
|
|
36
|
+
*
|
|
37
|
+
* An adapter MUST NOT let `env` — or anything else — cause host variables BEYOND its allow-list
|
|
38
|
+
* to reach the child. Concretely, it must not merge the rest of `process.env` back in on top,
|
|
39
|
+
* and it must not treat the presence of `env` as a trigger to inherit more widely. Leaving these
|
|
40
|
+
* semantics unstated is how the Node adapter came to spread the entire `process.env` into every
|
|
41
|
+
* child while this field sat unused.
|
|
36
42
|
*/
|
|
37
43
|
env?: Record<string, string>;
|
|
38
44
|
/**
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import { type SandboxEventSink } from "./observability";
|
|
2
2
|
import type { BinaryExecutor, BinaryInvocation } from "../media/contracts";
|
|
3
3
|
/**
|
|
4
|
-
* A
|
|
5
|
-
*
|
|
4
|
+
* A command wrapper that REWRITES an invocation into the one the inner executor should run.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* The wrapper's job is to own quoting: it returns the argv that actually gets spawned, which for a
|
|
8
|
+
* sandbox is the wrapper binary (bwrap, sandbox-exec, …) followed by everything that binary needs.
|
|
9
|
+
* That is why {@link sandboxedExecutor} does NOT quote for it — quoting is a property of the
|
|
10
|
+
* wrapper being used (a shell `-c` string, an argv vector, a container `exec` line), so an adapter
|
|
11
|
+
* that quoted first would hand every implementor the wrong representation.
|
|
12
|
+
*
|
|
13
|
+
* A `wrap` implementation must NOT execute anything: it only computes and returns the invocation.
|
|
6
14
|
*/
|
|
7
|
-
/** Command wrapping contract used by the executor adapter. */
|
|
8
15
|
export interface BinarySandbox {
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Return the invocation the inner executor should run instead. Its `cmd` and `args` ARE the
|
|
18
|
+
* wrapped argv, so the caller's original `args` are never appended.
|
|
19
|
+
*
|
|
20
|
+
* @param invocation - The command, args, working directory, environment, and limits to wrap.
|
|
21
|
+
* @returns The replacement invocation, carrying through whatever the caller asked for that the
|
|
22
|
+
* wrapper does not itself decide (`cwd`, `timeoutMs`, `signal`, the kill controls).
|
|
23
|
+
*/
|
|
24
|
+
wrap(invocation: BinaryInvocation): Promise<BinaryInvocation>;
|
|
15
25
|
}
|
|
16
26
|
/** Configuration for the sandboxed binary executor. */
|
|
17
27
|
export interface SandboxedExecutorOptions {
|
|
@@ -31,11 +41,19 @@ export interface SandboxedExecutorOptions {
|
|
|
31
41
|
* adapter does not raise that bound (and never sets `maxBuffer: Infinity`). The streaming path is
|
|
32
42
|
* {@link createRunShellCommandTool}, which uses the policy-enforcer stream contract instead.
|
|
33
43
|
*
|
|
44
|
+
* The adapter hands the invocation to {@link BinarySandbox.wrap} verbatim and runs what comes
|
|
45
|
+
* back: `inner.exec(await sandbox.wrap(invocation))`. The returned `cmd`/`args` are the complete
|
|
46
|
+
* wrapped argv, so the original `args` are not re-appended — a wrapper that wants them in the
|
|
47
|
+
* wrapped command puts them there itself. Quoting is therefore the wrapper's job, not this
|
|
48
|
+
* adapter's.
|
|
49
|
+
*
|
|
34
50
|
* Bypass is an audit-only opt-out. Its predicate receives `cmd` only, never argv: callers must
|
|
35
51
|
* allow only binaries safe with hostile arguments and must never allow an interpreter. Non-zero
|
|
36
52
|
* exits remain data and are never thrown. Removing this wrapper call restores the inner executor.
|
|
53
|
+
*
|
|
54
|
+
* @param options - The wrapper, the inner executor, and the optional audit hooks.
|
|
55
|
+
* @returns A `BinaryExecutor` whose non-bypassed invocations go through `options.sandbox.wrap`.
|
|
37
56
|
*/
|
|
38
|
-
/** Create a BinaryExecutor that wraps invocations unless an explicitly audited bypass applies. */
|
|
39
57
|
export declare const sandboxedExecutor: (options: SandboxedExecutorOptions) => BinaryExecutor;
|
|
40
58
|
/** Emit a bypass through the canonical sink for consumers that do not retain the adapter. */
|
|
41
59
|
export declare const reportSandboxBypass: (sink: SandboxEventSink, command: string) => void;
|
package/batteries/sandbox/js.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_spooled_artifact = require("../../spooled_artifact-
|
|
2
|
+
const require_spooled_artifact = require("../../spooled_artifact-BoYsldvO.cjs");
|
|
3
3
|
const require_exceptions = require("../../exceptions-DrHnAGQz.cjs");
|
|
4
4
|
const require_guards = require("../../guards-5-XmJgD2.cjs");
|
|
5
5
|
require("../../forge.cjs");
|
package/batteries/sandbox/js.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as createException } from "../../exceptions-DRYLe-J4.mjs";
|
|
2
2
|
import { n as isInstanceOf, t as isError } from "../../guards-BEpY7lBI.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { f as Tool } from "../../spooled_artifact-BkOe4-j-.mjs";
|
|
4
4
|
import "../../forge.mjs";
|
|
5
5
|
import "../../guards.mjs";
|
|
6
6
|
import { runToolGate } from "../tools/_shared.mjs";
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
* an optional peer.
|
|
28
28
|
*/
|
|
29
29
|
export * from "./fs_node";
|
|
30
|
-
export { srtEnforcer, mapPolicy, type SrtEnforcerOptions } from "./srt_enforcer";
|
|
30
|
+
export { srtEnforcer, srtBinarySandbox, mapPolicy, type SrtEnforcerOptions, type SrtBinarySandboxOptions, } from "./srt_enforcer";
|
|
31
31
|
export * from "./search_ripgrep";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BinarySandbox } from "../executor";
|
|
1
2
|
import type { SandboxPolicy } from "../types";
|
|
2
3
|
import type { SandboxPolicyEnforcer } from "../contracts/policy_enforcer";
|
|
3
4
|
type SrtConfig = {
|
|
@@ -143,4 +144,77 @@ export type SrtEnforcerOptions = {
|
|
|
143
144
|
* @returns An enforcer whose derived baseline is already captured.
|
|
144
145
|
*/
|
|
145
146
|
export declare const srtEnforcer: (options: SrtEnforcerOptions) => Promise<SandboxPolicyEnforcer>;
|
|
147
|
+
/**
|
|
148
|
+
* Options for {@link srtBinarySandbox}.
|
|
149
|
+
*/
|
|
150
|
+
export type SrtBinarySandboxOptions = {
|
|
151
|
+
/**
|
|
152
|
+
* The per-invocation policy this wrapper applies. Defaults to the enforcer's own session policy.
|
|
153
|
+
*
|
|
154
|
+
* @remarks
|
|
155
|
+
* This is the SAME per-call policy contract {@link SandboxPolicyEnforcer.run} takes, so it is
|
|
156
|
+
* admitted identically: the FILESYSTEM section is baked into this child's profile (and replaces
|
|
157
|
+
* the session baseline for it, exactly as `run()` does), while a NETWORK section that differs
|
|
158
|
+
* from the live session is refused with `E_SANDBOX_NETWORK_GRANT_UNSUPPORTED`. Omitted means the
|
|
159
|
+
* enforcer's established session policy, which is the only policy that can never diverge from
|
|
160
|
+
* the session's network state.
|
|
161
|
+
*/
|
|
162
|
+
policy?: SandboxPolicy;
|
|
163
|
+
/**
|
|
164
|
+
* The DEFAULT working directory, used when the invocation carries none — the invocation's own
|
|
165
|
+
* `cwd` wins. Falls back to the current process directory when neither names one.
|
|
166
|
+
*
|
|
167
|
+
* @remarks
|
|
168
|
+
* ONE effective directory is computed from those layers and used for BOTH the SRT profile and the
|
|
169
|
+
* returned invocation's `cwd`, so the profile and the spawn can never disagree. That matters
|
|
170
|
+
* because SRT derives its git `safe.directory` injection and (on Linux) its mandatory-deny scan
|
|
171
|
+
* from this directory: a profile generated for one directory while the executor spawns in
|
|
172
|
+
* another is a sandbox that does not describe the process it is supposedly enforcing.
|
|
173
|
+
*/
|
|
174
|
+
cwd?: string;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Expose an existing {@link SandboxPolicyEnforcer} as a {@link BinarySandbox} for the media
|
|
178
|
+
* pipeline — the bridge between the sandbox battery and {@link sandboxedExecutor}.
|
|
179
|
+
*
|
|
180
|
+
* @remarks
|
|
181
|
+
* DELIBERATELY DERIVED FROM {@link srtEnforcer}, NOT A SECOND SRT ADAPTER. It holds no state of its
|
|
182
|
+
* own: the wrapper closes over the enforcer's single live `SandboxManager` session, its validated
|
|
183
|
+
* `binShell`, its `mapPolicy` translation, its network-divergence admission gate and its host-env
|
|
184
|
+
* allow-list. One process-global session, one translation point, one admission policy — the two
|
|
185
|
+
* execution routes (`run()` for streaming tools, this for settled media invocations) share the
|
|
186
|
+
* internal admission+wrapping step so they cannot drift.
|
|
187
|
+
*
|
|
188
|
+
* The wrapped invocation is what the inner executor spawns: `cmd` is the wrapper binary
|
|
189
|
+
* (`bwrap`/`sandbox-exec`), `args` are the rest of the generated argv, and the caller's own argv is
|
|
190
|
+
* already inside that generated command. The adapter therefore must not re-append the original args.
|
|
191
|
+
*
|
|
192
|
+
* THE ENVIRONMENT SPLITS IN TWO, AND ONLY ONE HALF INHERITS FROM THE HOST. The host-env allow-list is
|
|
193
|
+
* what decides which HOST variables a child may inherit from `process.env`; it is the adapter's
|
|
194
|
+
* decision, taken at construction. The caller's `env` is its own EXPLICIT values, applied last, and
|
|
195
|
+
* may add names or override allow-listed ones. The wrap composes the two into
|
|
196
|
+
* `{ ...hostEnv, ...(invocation.env ?? {}) }` and sets `extendEnv: false`, so the executor hands the
|
|
197
|
+
* child EXACTLY those variables. This is load-bearing: execa's default `extendEnv: true` would merge
|
|
198
|
+
* the full `process.env` back in, which would silently hand the model every host secret whenever it
|
|
199
|
+
* ran `env` — the exact leak the allow-list exists to prevent. So the invariant this adapter
|
|
200
|
+
* enforces is the contract's: `env` may add or override, but NOTHING from the host beyond the
|
|
201
|
+
* allow-list reaches the child, and `env` is never a reason to inherit more from the host.
|
|
202
|
+
*
|
|
203
|
+
* REFUSES rather than degrades in the same places `run()` does: the network gate throws
|
|
204
|
+
* `E_SANDBOX_NETWORK_GRANT_UNSUPPORTED` before anything runs, and an unavailable platform throws
|
|
205
|
+
* `E_SANDBOX_UNSUPPORTED_ENV` (surfaced by `srtEnforcer`'s construction). After the enforcer is
|
|
206
|
+
* disposed the process-global session is gone, so a wrap still generates argv but the child is
|
|
207
|
+
* refused by the OS — the same honest failure mode `run()` presents. Prefer disposing the
|
|
208
|
+
* executor alongside the enforcer.
|
|
209
|
+
*
|
|
210
|
+
* POSIX-only, like the session it wraps: there is no `process.kill(-pid, signal)` equivalent on
|
|
211
|
+
* Windows, which is why `srtEnforcer` never constructs there.
|
|
212
|
+
*
|
|
213
|
+
* @param enforcer - The live enforcer whose session, shell, policy mapping and env allow-list this
|
|
214
|
+
* wrapper reuses. Construct it with {@link srtEnforcer} and dispose it when the executor goes away.
|
|
215
|
+
* @param opts - The per-invocation policy and the DEFAULT working directory (the invocation's own
|
|
216
|
+
* `cwd` wins); the same directory is used for the SRT profile and for the returned invocation.
|
|
217
|
+
* @returns A {@link BinarySandbox} whose `wrap` returns the sandboxed argv the inner executor runs.
|
|
218
|
+
*/
|
|
219
|
+
export declare const srtBinarySandbox: (enforcer: SandboxPolicyEnforcer, opts?: SrtBinarySandboxOptions) => BinarySandbox;
|
|
146
220
|
export { mapPolicy };
|
|
@@ -282,16 +282,43 @@ var srtEnforcer = async (options) => {
|
|
|
282
282
|
...derived.write.denyWithinAllow,
|
|
283
283
|
...derived.mandatoryDeny.entries
|
|
284
284
|
]);
|
|
285
|
+
/**
|
|
286
|
+
* PER-CALL ADMISSION plus the SRT argv wrap — the one path BOTH execution routes take.
|
|
287
|
+
*
|
|
288
|
+
* @remarks
|
|
289
|
+
* `run()` spawns the result itself; {@link srtBinarySandbox} hands it to a `BinaryExecutor`
|
|
290
|
+
* instead. Factoring it out is what keeps those two routes from drifting apart: the network
|
|
291
|
+
* admission gate, the single `mapPolicy` translation, the single shell quoting step and the
|
|
292
|
+
* `wrapWithSandboxArgv` call are shared, so a change to any of them lands on both.
|
|
293
|
+
*
|
|
294
|
+
* The network axis is refused rather than degraded: SRT's mux proxy is started once at
|
|
295
|
+
* `initialize()` and filters every request against the SESSION config, so a per-call section that
|
|
296
|
+
* differs from the session one — whether WIDER (a new domain) or NARROWER (a shorter allow-list,
|
|
297
|
+
* an added deny) — is silently ignored at enforcement time. Both directions are refused: a
|
|
298
|
+
* narrowing would also be a lie (the child runs under the session list, not the narrower one the
|
|
299
|
+
* caller asked for). The per-call FILESYSTEM axis needs no such gate — its policy is baked into
|
|
300
|
+
* that child's profile/argv, a real per-child grant.
|
|
301
|
+
*
|
|
302
|
+
* The comparison reads the LIVE session state (re-derived per call, never the cached `derived`):
|
|
303
|
+
* an adopted session can be widened by a foreign `updateConfig()`, and reading the stale snapshot
|
|
304
|
+
* would reject sections the session already matches.
|
|
305
|
+
*/
|
|
306
|
+
const admitAndWrap = async (argv, policy, signal, workingDir, correlationId) => {
|
|
307
|
+
const divergence = networkDivergence(derive(), policy, reasonMap(manager.getConfig()?.network?.deniedDomainReasons));
|
|
308
|
+
if (divergence.length > 0) throw new require_exceptions.E_SANDBOX_NETWORK_GRANT_UNSUPPORTED([`the per-call policy's network section differs from the sandbox session's, which SRT cannot enforce for a single child (its proxy filters every request against the SESSION config, not the per-call one), so the child would run under the session policy while you believed it ran under yours. Differences: ${divergence.join("; ")}. A network policy is per SESSION under SRT: repeat the session's network section for per-call filesystem policies, or establish a new srtEnforcer + createSandbox pair with the network policy you need.`]);
|
|
309
|
+
const mapped = mapPolicy(policy);
|
|
310
|
+
const command = await require_escape.quoteShellArgs(argv);
|
|
311
|
+
return {
|
|
312
|
+
argv: (await manager.wrapWithSandboxArgv(command, binShell, mapped, signal, workingDir, { commandId: correlationId })).argv,
|
|
313
|
+
env: hostEnv
|
|
314
|
+
};
|
|
315
|
+
};
|
|
285
316
|
return {
|
|
286
317
|
isSupported: () => manager.isSupportedPlatform(),
|
|
287
318
|
adopted,
|
|
288
319
|
checkDependencies: async () => manager.checkDependenciesAsync(),
|
|
289
320
|
run: async (op) => {
|
|
290
|
-
const
|
|
291
|
-
if (divergence.length > 0) throw new require_exceptions.E_SANDBOX_NETWORK_GRANT_UNSUPPORTED([`the per-call policy's network section differs from the sandbox session's, which SRT cannot enforce for a single child (its proxy filters every request against the SESSION config, not the per-call one), so the child would run under the session policy while you believed it ran under yours. Differences: ${divergence.join("; ")}. A network policy is per SESSION under SRT: repeat the session's network section for per-call filesystem policies, or establish a new srtEnforcer + createSandbox pair with the network policy you need.`]);
|
|
292
|
-
const mapped = mapPolicy(op.policy);
|
|
293
|
-
const command = await require_escape.quoteShellArgs(op.argv);
|
|
294
|
-
const wrapped = await manager.wrapWithSandboxArgv(command, binShell, mapped, op.signal, op.cwd, { commandId: op.correlationId });
|
|
321
|
+
const wrapped = await admitAndWrap(op.argv, op.policy, op.signal, op.cwd, op.correlationId);
|
|
295
322
|
const child = (0, node_child_process.spawn)(wrapped.argv[0], wrapped.argv.slice(1), {
|
|
296
323
|
cwd: op.cwd,
|
|
297
324
|
env: {
|
|
@@ -346,6 +373,9 @@ var srtEnforcer = async (options) => {
|
|
|
346
373
|
completed
|
|
347
374
|
};
|
|
348
375
|
},
|
|
376
|
+
wrapInvocation: admitAndWrap,
|
|
377
|
+
sessionPolicy: options.policy,
|
|
378
|
+
hostEnv,
|
|
349
379
|
effectivePolicy: () => adopted ? derive() : derived,
|
|
350
380
|
diagnosticsFor: (id) => manager.getSandboxViolationStore().getViolationsForCommand(id).map(String),
|
|
351
381
|
dispose: async () => {
|
|
@@ -356,6 +386,68 @@ var srtEnforcer = async (options) => {
|
|
|
356
386
|
}
|
|
357
387
|
};
|
|
358
388
|
};
|
|
389
|
+
/**
|
|
390
|
+
* Expose an existing {@link SandboxPolicyEnforcer} as a {@link BinarySandbox} for the media
|
|
391
|
+
* pipeline — the bridge between the sandbox battery and {@link sandboxedExecutor}.
|
|
392
|
+
*
|
|
393
|
+
* @remarks
|
|
394
|
+
* DELIBERATELY DERIVED FROM {@link srtEnforcer}, NOT A SECOND SRT ADAPTER. It holds no state of its
|
|
395
|
+
* own: the wrapper closes over the enforcer's single live `SandboxManager` session, its validated
|
|
396
|
+
* `binShell`, its `mapPolicy` translation, its network-divergence admission gate and its host-env
|
|
397
|
+
* allow-list. One process-global session, one translation point, one admission policy — the two
|
|
398
|
+
* execution routes (`run()` for streaming tools, this for settled media invocations) share the
|
|
399
|
+
* internal admission+wrapping step so they cannot drift.
|
|
400
|
+
*
|
|
401
|
+
* The wrapped invocation is what the inner executor spawns: `cmd` is the wrapper binary
|
|
402
|
+
* (`bwrap`/`sandbox-exec`), `args` are the rest of the generated argv, and the caller's own argv is
|
|
403
|
+
* already inside that generated command. The adapter therefore must not re-append the original args.
|
|
404
|
+
*
|
|
405
|
+
* THE ENVIRONMENT SPLITS IN TWO, AND ONLY ONE HALF INHERITS FROM THE HOST. The host-env allow-list is
|
|
406
|
+
* what decides which HOST variables a child may inherit from `process.env`; it is the adapter's
|
|
407
|
+
* decision, taken at construction. The caller's `env` is its own EXPLICIT values, applied last, and
|
|
408
|
+
* may add names or override allow-listed ones. The wrap composes the two into
|
|
409
|
+
* `{ ...hostEnv, ...(invocation.env ?? {}) }` and sets `extendEnv: false`, so the executor hands the
|
|
410
|
+
* child EXACTLY those variables. This is load-bearing: execa's default `extendEnv: true` would merge
|
|
411
|
+
* the full `process.env` back in, which would silently hand the model every host secret whenever it
|
|
412
|
+
* ran `env` — the exact leak the allow-list exists to prevent. So the invariant this adapter
|
|
413
|
+
* enforces is the contract's: `env` may add or override, but NOTHING from the host beyond the
|
|
414
|
+
* allow-list reaches the child, and `env` is never a reason to inherit more from the host.
|
|
415
|
+
*
|
|
416
|
+
* REFUSES rather than degrades in the same places `run()` does: the network gate throws
|
|
417
|
+
* `E_SANDBOX_NETWORK_GRANT_UNSUPPORTED` before anything runs, and an unavailable platform throws
|
|
418
|
+
* `E_SANDBOX_UNSUPPORTED_ENV` (surfaced by `srtEnforcer`'s construction). After the enforcer is
|
|
419
|
+
* disposed the process-global session is gone, so a wrap still generates argv but the child is
|
|
420
|
+
* refused by the OS — the same honest failure mode `run()` presents. Prefer disposing the
|
|
421
|
+
* executor alongside the enforcer.
|
|
422
|
+
*
|
|
423
|
+
* POSIX-only, like the session it wraps: there is no `process.kill(-pid, signal)` equivalent on
|
|
424
|
+
* Windows, which is why `srtEnforcer` never constructs there.
|
|
425
|
+
*
|
|
426
|
+
* @param enforcer - The live enforcer whose session, shell, policy mapping and env allow-list this
|
|
427
|
+
* wrapper reuses. Construct it with {@link srtEnforcer} and dispose it when the executor goes away.
|
|
428
|
+
* @param opts - The per-invocation policy and the DEFAULT working directory (the invocation's own
|
|
429
|
+
* `cwd` wins); the same directory is used for the SRT profile and for the returned invocation.
|
|
430
|
+
* @returns A {@link BinarySandbox} whose `wrap` returns the sandboxed argv the inner executor runs.
|
|
431
|
+
*/
|
|
432
|
+
var srtBinarySandbox = (enforcer, opts = {}) => ({ async wrap(invocation) {
|
|
433
|
+
const carrier = enforcer;
|
|
434
|
+
if (typeof carrier.wrapInvocation !== "function") throw new require_exceptions.E_INVALID_SANDBOX_CONFIG(["srtBinarySandbox requires an enforcer constructed by srtEnforcer: this adapter only forwards to the enforcer's own SRT session, and the supplied enforcer exposes none"]);
|
|
435
|
+
const policyForCall = opts.policy ?? carrier.sessionPolicy;
|
|
436
|
+
if (!policyForCall) throw new require_exceptions.E_INVALID_SANDBOX_CONFIG(["srtBinarySandbox requires a policy: the supplied enforcer was adopted (it holds no ADK policy of its own), so name the session policy explicitly in the wrap options"]);
|
|
437
|
+
const cwd = invocation.cwd ?? opts.cwd ?? process.cwd();
|
|
438
|
+
const wrapped = await carrier.wrapInvocation([invocation.cmd, ...invocation.args], policyForCall, invocation.signal, cwd, void 0);
|
|
439
|
+
return {
|
|
440
|
+
...invocation,
|
|
441
|
+
cmd: wrapped.argv[0],
|
|
442
|
+
args: wrapped.argv.slice(1),
|
|
443
|
+
cwd,
|
|
444
|
+
env: {
|
|
445
|
+
...wrapped.env,
|
|
446
|
+
...invocation.env ?? {}
|
|
447
|
+
},
|
|
448
|
+
extendEnv: false
|
|
449
|
+
};
|
|
450
|
+
} });
|
|
359
451
|
//#endregion
|
|
360
452
|
//#region src/batteries/sandbox/node/search_ripgrep.ts
|
|
361
453
|
/**
|
|
@@ -633,6 +725,7 @@ exports.primeGlobMatcher = require_fs_node.primeGlobMatcher;
|
|
|
633
725
|
exports.reproduceMandatoryDeny = require_fs_node.reproduceMandatoryDeny;
|
|
634
726
|
exports.resolveMaxDepthArgv = resolveMaxDepthArgv;
|
|
635
727
|
exports.resolveSearchLimit = resolveSearchLimit;
|
|
728
|
+
exports.srtBinarySandbox = srtBinarySandbox;
|
|
636
729
|
exports.srtEnforcer = srtEnforcer;
|
|
637
730
|
|
|
638
731
|
//# sourceMappingURL=node.cjs.map
|