@nhtio/adk 0.1.0-master-e5947c71 → 0.1.0-master-9557685c
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 +1 -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/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 +5 -5
- package/batteries/orchestration.mjs +5 -5
- package/batteries/sandbox/js.cjs +2 -2
- package/batteries/sandbox/js.mjs +2 -2
- package/batteries/sandbox/tools.cjs +1 -1
- package/batteries/sandbox/tools.mjs +1 -1
- package/batteries/sandbox.cjs +4 -4
- package/batteries/sandbox.mjs +4 -4
- 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.cjs +1 -1
- package/eslint.mjs +1 -1
- 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 +391 -391
- 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-CwkQjQBS.cjs} +4 -4
- package/{scrapper-lXnFGDi0.cjs.map → scrapper-CwkQjQBS.cjs.map} +1 -1
- package/{scrapper-BCdUm8c8.mjs → scrapper-_40wh9LI.mjs} +4 -4
- package/{scrapper-BCdUm8c8.mjs.map → scrapper-_40wh9LI.mjs.map} +1 -1
- package/{searxng-B-LdaVUP.mjs → searxng-D0NEAks7.mjs} +4 -4
- package/{searxng-B-LdaVUP.mjs.map → searxng-D0NEAks7.mjs.map} +1 -1
- package/{searxng-N7qu6dA-.cjs → searxng-DVvFdVow.cjs} +4 -4
- package/{searxng-N7qu6dA-.cjs.map → searxng-DVvFdVow.cjs.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
|
@@ -2,9 +2,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_guards = require("../../guards-5-XmJgD2.cjs");
|
|
3
3
|
require("../../guards.cjs");
|
|
4
4
|
const require_batteries_vector_filters = require("./filters.cjs");
|
|
5
|
+
const require_batteries_vector_helpers = require("./helpers.cjs");
|
|
5
6
|
const require_batteries_vector_exceptions = require("./exceptions.cjs");
|
|
6
7
|
const require_batteries_vector_contract = require("./contract.cjs");
|
|
7
|
-
const require_batteries_vector_helpers = require("./helpers.cjs");
|
|
8
8
|
const require_batteries_vector_validation = require("./validation.cjs");
|
|
9
9
|
//#region src/batteries/vector/pinecone/index.ts
|
|
10
10
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as isInstanceOf } from "../../guards-BEpY7lBI.mjs";
|
|
2
2
|
import "../../guards.mjs";
|
|
3
3
|
import { evaluateFilter, isFilterCondition, isFilterGroup, isRawFilter } from "./filters.mjs";
|
|
4
|
+
import { normalizeScore, sanitizeMetadata } from "./helpers.mjs";
|
|
4
5
|
import { E_VECTOR_STORE_COLLECTION_FAILED, E_VECTOR_STORE_CONNECTION_FAILED, E_VECTOR_STORE_CONSISTENCY_TIMEOUT, E_VECTOR_STORE_DELETE_FAILED, E_VECTOR_STORE_DIMENSION_MISMATCH, E_VECTOR_STORE_DRIVER_UNAVAILABLE, E_VECTOR_STORE_SEARCH_FAILED, E_VECTOR_STORE_UNSUPPORTED_FILTER_OPERATOR, E_VECTOR_STORE_UNSUPPORTED_OPERATION, E_VECTOR_STORE_UPSERT_FAILED } from "./exceptions.mjs";
|
|
5
6
|
import { BaseVectorStore } from "./contract.mjs";
|
|
6
|
-
import { normalizeScore, sanitizeMetadata } from "./helpers.mjs";
|
|
7
7
|
import { validateRecords } from "./validation.mjs";
|
|
8
8
|
//#region src/batteries/vector/pinecone/index.ts
|
|
9
9
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_batteries_vector_filters = require("./filters.cjs");
|
|
3
|
+
const require_batteries_vector_helpers = require("./helpers.cjs");
|
|
3
4
|
const require_batteries_vector_exceptions = require("./exceptions.cjs");
|
|
4
5
|
const require_batteries_vector_contract = require("./contract.cjs");
|
|
5
|
-
const require_batteries_vector_helpers = require("./helpers.cjs");
|
|
6
6
|
const require_batteries_vector_validation = require("./validation.cjs");
|
|
7
7
|
let js_sha256 = require("js-sha256");
|
|
8
8
|
//#region src/batteries/vector/qdrant/index.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isFilterCondition, isFilterGroup, isRawFilter } from "./filters.mjs";
|
|
2
|
+
import { normalizeScore, sanitizeMetadata } from "./helpers.mjs";
|
|
2
3
|
import { E_VECTOR_STORE_COLLECTION_FAILED, E_VECTOR_STORE_DELETE_FAILED, E_VECTOR_STORE_DIMENSION_MISMATCH, E_VECTOR_STORE_DRIVER_UNAVAILABLE, E_VECTOR_STORE_SEARCH_FAILED, E_VECTOR_STORE_UNSUPPORTED_FILTER_OPERATOR, E_VECTOR_STORE_UNSUPPORTED_OPERATION, E_VECTOR_STORE_UPSERT_FAILED } from "./exceptions.mjs";
|
|
3
4
|
import { BaseVectorStore } from "./contract.mjs";
|
|
4
|
-
import { normalizeScore, sanitizeMetadata } from "./helpers.mjs";
|
|
5
5
|
import { validateRecords } from "./validation.mjs";
|
|
6
6
|
import { sha256 } from "js-sha256";
|
|
7
7
|
//#region src/batteries/vector/qdrant/index.ts
|
|
@@ -2,9 +2,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_guards = require("../../guards-5-XmJgD2.cjs");
|
|
3
3
|
require("../../guards.cjs");
|
|
4
4
|
const require_batteries_vector_filters = require("./filters.cjs");
|
|
5
|
+
const require_batteries_vector_helpers = require("./helpers.cjs");
|
|
5
6
|
const require_batteries_vector_exceptions = require("./exceptions.cjs");
|
|
6
7
|
const require_batteries_vector_contract = require("./contract.cjs");
|
|
7
|
-
const require_batteries_vector_helpers = require("./helpers.cjs");
|
|
8
8
|
const require_batteries_vector_validation = require("./validation.cjs");
|
|
9
9
|
//#region src/batteries/vector/redis/index.ts
|
|
10
10
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as isInstanceOf } from "../../guards-BEpY7lBI.mjs";
|
|
2
2
|
import "../../guards.mjs";
|
|
3
3
|
import { isFilterCondition, isFilterGroup, isRawFilter } from "./filters.mjs";
|
|
4
|
+
import { normalizeScore, sanitizeMetadata } from "./helpers.mjs";
|
|
4
5
|
import { E_VECTOR_STORE_COLLECTION_FAILED, E_VECTOR_STORE_CONNECTION_FAILED, E_VECTOR_STORE_DELETE_FAILED, E_VECTOR_STORE_DIMENSION_MISMATCH, E_VECTOR_STORE_DRIVER_UNAVAILABLE, E_VECTOR_STORE_SEARCH_FAILED, E_VECTOR_STORE_UNSUPPORTED_FILTER_OPERATOR, E_VECTOR_STORE_UNSUPPORTED_OPERATION, E_VECTOR_STORE_UPSERT_FAILED } from "./exceptions.mjs";
|
|
5
6
|
import { BaseVectorStore } from "./contract.mjs";
|
|
6
|
-
import { normalizeScore, sanitizeMetadata } from "./helpers.mjs";
|
|
7
7
|
import { validateRecords } from "./validation.mjs";
|
|
8
8
|
//#region src/batteries/vector/redis/index.ts
|
|
9
9
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_retrievable = require("../../retrievable-
|
|
2
|
+
const require_retrievable = require("../../retrievable-DVkAglIv.cjs");
|
|
3
3
|
require("../../index.cjs");
|
|
4
4
|
//#region src/batteries/vector/retrievable_glue.ts
|
|
5
5
|
/**
|
|
@@ -2,9 +2,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_guards = require("../../guards-5-XmJgD2.cjs");
|
|
3
3
|
require("../../guards.cjs");
|
|
4
4
|
const require_batteries_vector_filters = require("./filters.cjs");
|
|
5
|
+
const require_batteries_vector_helpers = require("./helpers.cjs");
|
|
5
6
|
const require_batteries_vector_exceptions = require("./exceptions.cjs");
|
|
6
7
|
const require_batteries_vector_contract = require("./contract.cjs");
|
|
7
|
-
const require_batteries_vector_helpers = require("./helpers.cjs");
|
|
8
8
|
const require_batteries_vector_validation = require("./validation.cjs");
|
|
9
9
|
//#region src/batteries/vector/s3vectors/index.ts
|
|
10
10
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as isInstanceOf } from "../../guards-BEpY7lBI.mjs";
|
|
2
2
|
import "../../guards.mjs";
|
|
3
3
|
import { evaluateFilter } from "./filters.mjs";
|
|
4
|
+
import { normalizeScore, sanitizeMetadata } from "./helpers.mjs";
|
|
4
5
|
import { E_VECTOR_STORE_COLLECTION_FAILED, E_VECTOR_STORE_CONNECTION_FAILED, E_VECTOR_STORE_DELETE_FAILED, E_VECTOR_STORE_DIMENSION_MISMATCH, E_VECTOR_STORE_DRIVER_UNAVAILABLE, E_VECTOR_STORE_SEARCH_FAILED, E_VECTOR_STORE_UNSUPPORTED_OPERATION, E_VECTOR_STORE_UPSERT_FAILED } from "./exceptions.mjs";
|
|
5
6
|
import { BaseVectorStore } from "./contract.mjs";
|
|
6
|
-
import { normalizeScore, sanitizeMetadata } from "./helpers.mjs";
|
|
7
7
|
import { validateRecords } from "./validation.mjs";
|
|
8
8
|
//#region src/batteries/vector/s3vectors/index.ts
|
|
9
9
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_batteries_vector_filters = require("./filters.cjs");
|
|
3
|
+
const require_batteries_vector_helpers = require("./helpers.cjs");
|
|
3
4
|
const require_batteries_vector_exceptions = require("./exceptions.cjs");
|
|
4
5
|
const require_batteries_vector_contract = require("./contract.cjs");
|
|
5
|
-
const require_batteries_vector_helpers = require("./helpers.cjs");
|
|
6
6
|
const require_batteries_vector_validation = require("./validation.cjs");
|
|
7
7
|
//#region src/batteries/vector/sqlite_vec/index.ts
|
|
8
8
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { evaluateFilter } from "./filters.mjs";
|
|
2
|
+
import { normalizeScore } from "./helpers.mjs";
|
|
2
3
|
import { E_VECTOR_STORE_COLLECTION_FAILED, E_VECTOR_STORE_CONNECTION_FAILED, E_VECTOR_STORE_DELETE_FAILED, E_VECTOR_STORE_DIMENSION_MISMATCH, E_VECTOR_STORE_DRIVER_UNAVAILABLE, E_VECTOR_STORE_SEARCH_FAILED, E_VECTOR_STORE_UNSUPPORTED_OPERATION, E_VECTOR_STORE_UPSERT_FAILED } from "./exceptions.mjs";
|
|
3
4
|
import { BaseVectorStore } from "./contract.mjs";
|
|
4
|
-
import { normalizeScore } from "./helpers.mjs";
|
|
5
5
|
import { validateRecords } from "./validation.mjs";
|
|
6
6
|
//#region src/batteries/vector/sqlite_vec/index.ts
|
|
7
7
|
/**
|
|
@@ -2,9 +2,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_guards = require("../../guards-5-XmJgD2.cjs");
|
|
3
3
|
require("../../guards.cjs");
|
|
4
4
|
const require_batteries_vector_filters = require("./filters.cjs");
|
|
5
|
+
const require_batteries_vector_helpers = require("./helpers.cjs");
|
|
5
6
|
const require_batteries_vector_exceptions = require("./exceptions.cjs");
|
|
6
7
|
const require_batteries_vector_contract = require("./contract.cjs");
|
|
7
|
-
const require_batteries_vector_helpers = require("./helpers.cjs");
|
|
8
8
|
const require_batteries_vector_validation = require("./validation.cjs");
|
|
9
9
|
//#region src/batteries/vector/typesense/index.ts
|
|
10
10
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as isInstanceOf } from "../../guards-BEpY7lBI.mjs";
|
|
2
2
|
import "../../guards.mjs";
|
|
3
3
|
import { evaluateFilter } from "./filters.mjs";
|
|
4
|
+
import { normalizeScore } from "./helpers.mjs";
|
|
4
5
|
import { E_VECTOR_STORE_COLLECTION_FAILED, E_VECTOR_STORE_CONNECTION_FAILED, E_VECTOR_STORE_DELETE_FAILED, E_VECTOR_STORE_DIMENSION_MISMATCH, E_VECTOR_STORE_DRIVER_UNAVAILABLE, E_VECTOR_STORE_SEARCH_FAILED, E_VECTOR_STORE_UNSUPPORTED_OPERATION, E_VECTOR_STORE_UPSERT_FAILED } from "./exceptions.mjs";
|
|
5
6
|
import { BaseVectorStore } from "./contract.mjs";
|
|
6
|
-
import { normalizeScore } from "./helpers.mjs";
|
|
7
7
|
import { validateRecords } from "./validation.mjs";
|
|
8
8
|
//#region src/batteries/vector/typesense/index.ts
|
|
9
9
|
/**
|
|
@@ -2,9 +2,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_guards = require("../../guards-5-XmJgD2.cjs");
|
|
3
3
|
require("../../guards.cjs");
|
|
4
4
|
const require_batteries_vector_filters = require("./filters.cjs");
|
|
5
|
+
const require_batteries_vector_helpers = require("./helpers.cjs");
|
|
5
6
|
const require_batteries_vector_exceptions = require("./exceptions.cjs");
|
|
6
7
|
const require_batteries_vector_contract = require("./contract.cjs");
|
|
7
|
-
const require_batteries_vector_helpers = require("./helpers.cjs");
|
|
8
8
|
const require_batteries_vector_validation = require("./validation.cjs");
|
|
9
9
|
//#region src/batteries/vector/vespa/index.ts
|
|
10
10
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as isInstanceOf } from "../../guards-BEpY7lBI.mjs";
|
|
2
2
|
import "../../guards.mjs";
|
|
3
3
|
import { evaluateFilter } from "./filters.mjs";
|
|
4
|
+
import { normalizeScore } from "./helpers.mjs";
|
|
4
5
|
import { E_VECTOR_STORE_COLLECTION_FAILED, E_VECTOR_STORE_CONNECTION_FAILED, E_VECTOR_STORE_DELETE_FAILED, E_VECTOR_STORE_DIMENSION_MISMATCH, E_VECTOR_STORE_SEARCH_FAILED, E_VECTOR_STORE_UNSUPPORTED_OPERATION, E_VECTOR_STORE_UPSERT_FAILED } from "./exceptions.mjs";
|
|
5
6
|
import { BaseVectorStore } from "./contract.mjs";
|
|
6
|
-
import { normalizeScore } from "./helpers.mjs";
|
|
7
7
|
import { validateRecords } from "./validation.mjs";
|
|
8
8
|
//#region src/batteries/vector/vespa/index.ts
|
|
9
9
|
/**
|
|
@@ -2,9 +2,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_guards = require("../../guards-5-XmJgD2.cjs");
|
|
3
3
|
require("../../guards.cjs");
|
|
4
4
|
const require_batteries_vector_filters = require("./filters.cjs");
|
|
5
|
+
const require_batteries_vector_helpers = require("./helpers.cjs");
|
|
5
6
|
const require_batteries_vector_exceptions = require("./exceptions.cjs");
|
|
6
7
|
const require_batteries_vector_contract = require("./contract.cjs");
|
|
7
|
-
const require_batteries_vector_helpers = require("./helpers.cjs");
|
|
8
8
|
const require_batteries_vector_validation = require("./validation.cjs");
|
|
9
9
|
let js_sha256 = require("js-sha256");
|
|
10
10
|
//#region src/batteries/vector/weaviate/index.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as isInstanceOf } from "../../guards-BEpY7lBI.mjs";
|
|
2
2
|
import "../../guards.mjs";
|
|
3
3
|
import { evaluateFilter, isFilterCondition, isFilterGroup, isRawFilter } from "./filters.mjs";
|
|
4
|
+
import { normalizeScore } from "./helpers.mjs";
|
|
4
5
|
import { E_VECTOR_STORE_COLLECTION_FAILED, E_VECTOR_STORE_CONNECTION_FAILED, E_VECTOR_STORE_DELETE_FAILED, E_VECTOR_STORE_DIMENSION_MISMATCH, E_VECTOR_STORE_DRIVER_UNAVAILABLE, E_VECTOR_STORE_SEARCH_FAILED, E_VECTOR_STORE_UNSUPPORTED_FILTER_OPERATOR, E_VECTOR_STORE_UNSUPPORTED_OPERATION, E_VECTOR_STORE_UPSERT_FAILED } from "./exceptions.mjs";
|
|
5
6
|
import { BaseVectorStore } from "./contract.mjs";
|
|
6
|
-
import { normalizeScore } from "./helpers.mjs";
|
|
7
7
|
import { validateRecords } from "./validation.mjs";
|
|
8
8
|
import { sha256 } from "js-sha256";
|
|
9
9
|
//#region src/batteries/vector/weaviate/index.ts
|
package/batteries/vector.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_batteries_vector_filters = require("./vector/filters.cjs");
|
|
3
|
+
const require_batteries_vector_helpers = require("./vector/helpers.cjs");
|
|
3
4
|
const require_batteries_vector_exceptions = require("./vector/exceptions.cjs");
|
|
4
5
|
const require_batteries_vector_builder = require("./vector/builder.cjs");
|
|
5
6
|
const require_batteries_vector_schema = require("./vector/schema.cjs");
|
|
6
|
-
const require_batteries_vector_contract = require("./vector/contract.cjs");
|
|
7
|
-
const require_batteries_vector_helpers = require("./vector/helpers.cjs");
|
|
8
7
|
const require_batteries_vector_migrate = require("./vector/migrate.cjs");
|
|
8
|
+
const require_batteries_vector_contract = require("./vector/contract.cjs");
|
|
9
9
|
const require_batteries_vector_vector_store_constructor = require("./vector/vector_store_constructor.cjs");
|
|
10
10
|
const require_batteries_vector_validation = require("./vector/validation.cjs");
|
|
11
11
|
const require_batteries_vector_factory = require("./vector/factory.cjs");
|
package/batteries/vector.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { evaluateFilter, isFilterCondition, isFilterGroup, isRawExpr, isRawFilter, raw, vectorFilterSchema } from "./vector/filters.mjs";
|
|
2
|
+
import { clamp01, dimensionsMatch, isFiniteVector, mapMetric, normalizeScore, sanitizeMetadata } from "./vector/helpers.mjs";
|
|
2
3
|
import { E_INVALID_VECTOR_RECORD, E_INVALID_VECTOR_STORE_CONFIG, E_VECTOR_STORE_COLLECTION_FAILED, E_VECTOR_STORE_CONNECTION_FAILED, E_VECTOR_STORE_CONSISTENCY_TIMEOUT, E_VECTOR_STORE_DELETE_FAILED, E_VECTOR_STORE_DIMENSION_MISMATCH, E_VECTOR_STORE_DRIVER_UNAVAILABLE, E_VECTOR_STORE_ENCODER_REQUIRED, E_VECTOR_STORE_MIGRATION_FAILED, E_VECTOR_STORE_PROJECTION_REQUIRED, E_VECTOR_STORE_QUERY_CONFLICT, E_VECTOR_STORE_RAW_BINDING_MISMATCH, E_VECTOR_STORE_SEARCH_FAILED, E_VECTOR_STORE_TRANSACTIONS_UNSUPPORTED, E_VECTOR_STORE_UNSUPPORTED_FILTER_OPERATOR, E_VECTOR_STORE_UNSUPPORTED_OPERATION, E_VECTOR_STORE_UPSERT_FAILED } from "./vector/exceptions.mjs";
|
|
3
4
|
import { FilterBuilder, VectorQueryBuilder } from "./vector/builder.mjs";
|
|
4
5
|
import { CollectionBuilder, VectorSchemaBuilder } from "./vector/schema.mjs";
|
|
5
|
-
import { BaseVectorStore } from "./vector/contract.mjs";
|
|
6
|
-
import { clamp01, dimensionsMatch, isFiniteVector, mapMetric, normalizeScore, sanitizeMetadata } from "./vector/helpers.mjs";
|
|
7
6
|
import { VectorMigrator } from "./vector/migrate.mjs";
|
|
7
|
+
import { BaseVectorStore } from "./vector/contract.mjs";
|
|
8
8
|
import { implementsVectorStoreConstructor, vectorStoreConstructorSchema } from "./vector/vector_store_constructor.mjs";
|
|
9
9
|
import { baseVectorStoreOptionsSchema, resolveClientCtor, validateCreateConfig, validateRecords, vectorRecordSchema } from "./vector/validation.mjs";
|
|
10
10
|
import { createVectorStore, encoderFromEmbeddings } from "./vector/factory.mjs";
|
package/batteries.cjs
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_batteries_context_exceptions = require("./batteries/context/exceptions.cjs");
|
|
3
|
-
const require_batteries_vector_filters = require("./batteries/vector/filters.cjs");
|
|
4
|
-
const require_batteries_vector_exceptions = require("./batteries/vector/exceptions.cjs");
|
|
5
|
-
const require_batteries_vector_builder = require("./batteries/vector/builder.cjs");
|
|
6
|
-
const require_batteries_vector_schema = require("./batteries/vector/schema.cjs");
|
|
7
|
-
const require_batteries_vector_contract = require("./batteries/vector/contract.cjs");
|
|
8
3
|
const require_batteries_llm_openai_chat_completions_exceptions = require("./batteries/llm/openai_chat_completions/exceptions.cjs");
|
|
9
4
|
const require_batteries_llm_openai_chat_completions_validation = require("./batteries/llm/openai_chat_completions/validation.cjs");
|
|
10
|
-
const require_helpers = require("./helpers-
|
|
5
|
+
const require_helpers = require("./helpers-D6ebO8Vc.cjs");
|
|
11
6
|
const require_batteries_llm_openai_chat_completions_helpers = require("./batteries/llm/openai_chat_completions/helpers.cjs");
|
|
12
7
|
const require_batteries_llm_openai_chat_completions_adapter = require("./batteries/llm/openai_chat_completions/adapter.cjs");
|
|
13
|
-
const require_chat_common = require("./chat_common-
|
|
8
|
+
const require_chat_common = require("./chat_common-DlIK1IAn.cjs");
|
|
14
9
|
const require_batteries_llm_webllm_chat_completions_exceptions = require("./batteries/llm/webllm_chat_completions/exceptions.cjs");
|
|
15
10
|
const require_batteries_llm_webllm_chat_completions_validation = require("./batteries/llm/webllm_chat_completions/validation.cjs");
|
|
16
11
|
const require_batteries_llm_webllm_chat_completions_adapter = require("./batteries/llm/webllm_chat_completions/adapter.cjs");
|
|
@@ -45,8 +40,8 @@ const require_batteries_tools_math = require("./batteries/tools/math.cjs");
|
|
|
45
40
|
const require_batteries_tools_memory = require("./batteries/tools/memory.cjs");
|
|
46
41
|
const require_batteries_tools_parsing = require("./batteries/tools/parsing.cjs");
|
|
47
42
|
const require_batteries_tools_retrievables = require("./batteries/tools/retrievables.cjs");
|
|
48
|
-
const require_scrapper = require("./scrapper-
|
|
49
|
-
const require_searxng = require("./searxng-
|
|
43
|
+
const require_scrapper = require("./scrapper-CwkQjQBS.cjs");
|
|
44
|
+
const require_searxng = require("./searxng-DVvFdVow.cjs");
|
|
50
45
|
const require_batteries_tools_standing_instructions = require("./batteries/tools/standing_instructions.cjs");
|
|
51
46
|
const require_batteries_tools_statistics = require("./batteries/tools/statistics.cjs");
|
|
52
47
|
const require_batteries_tools_string_processing = require("./batteries/tools/string_processing.cjs");
|
|
@@ -92,8 +87,13 @@ const require_batteries_tts_transformers_js_exceptions = require("./batteries/tt
|
|
|
92
87
|
const require_batteries_tts_transformers_js_validation = require("./batteries/tts/transformers_js/validation.cjs");
|
|
93
88
|
const require_batteries_tts_transformers_js_adapter = require("./batteries/tts/transformers_js/adapter.cjs");
|
|
94
89
|
require("./batteries/tts.cjs");
|
|
90
|
+
const require_batteries_vector_filters = require("./batteries/vector/filters.cjs");
|
|
95
91
|
const require_batteries_vector_helpers = require("./batteries/vector/helpers.cjs");
|
|
92
|
+
const require_batteries_vector_exceptions = require("./batteries/vector/exceptions.cjs");
|
|
93
|
+
const require_batteries_vector_builder = require("./batteries/vector/builder.cjs");
|
|
94
|
+
const require_batteries_vector_schema = require("./batteries/vector/schema.cjs");
|
|
96
95
|
const require_batteries_vector_migrate = require("./batteries/vector/migrate.cjs");
|
|
96
|
+
const require_batteries_vector_contract = require("./batteries/vector/contract.cjs");
|
|
97
97
|
const require_batteries_vector_vector_store_constructor = require("./batteries/vector/vector_store_constructor.cjs");
|
|
98
98
|
const require_batteries_vector_validation = require("./batteries/vector/validation.cjs");
|
|
99
99
|
const require_batteries_vector_factory = require("./batteries/vector/factory.cjs");
|
package/batteries.mjs
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { E_CONTEXT_RESOLVER_MISSING } from "./batteries/context/exceptions.mjs";
|
|
2
|
-
import { evaluateFilter, isFilterCondition, isFilterGroup, isRawExpr, isRawFilter, raw, vectorFilterSchema } from "./batteries/vector/filters.mjs";
|
|
3
|
-
import { E_INVALID_VECTOR_RECORD, E_INVALID_VECTOR_STORE_CONFIG, E_VECTOR_STORE_COLLECTION_FAILED, E_VECTOR_STORE_CONNECTION_FAILED, E_VECTOR_STORE_CONSISTENCY_TIMEOUT, E_VECTOR_STORE_DELETE_FAILED, E_VECTOR_STORE_DIMENSION_MISMATCH, E_VECTOR_STORE_DRIVER_UNAVAILABLE, E_VECTOR_STORE_ENCODER_REQUIRED, E_VECTOR_STORE_MIGRATION_FAILED, E_VECTOR_STORE_PROJECTION_REQUIRED, E_VECTOR_STORE_QUERY_CONFLICT, E_VECTOR_STORE_RAW_BINDING_MISMATCH, E_VECTOR_STORE_SEARCH_FAILED, E_VECTOR_STORE_TRANSACTIONS_UNSUPPORTED, E_VECTOR_STORE_UNSUPPORTED_FILTER_OPERATOR, E_VECTOR_STORE_UNSUPPORTED_OPERATION, E_VECTOR_STORE_UPSERT_FAILED } from "./batteries/vector/exceptions.mjs";
|
|
4
|
-
import { FilterBuilder, VectorQueryBuilder } from "./batteries/vector/builder.mjs";
|
|
5
|
-
import { CollectionBuilder, VectorSchemaBuilder } from "./batteries/vector/schema.mjs";
|
|
6
|
-
import { BaseVectorStore } from "./batteries/vector/contract.mjs";
|
|
7
2
|
import { E_INVALID_OPENAI_CHAT_COMPLETIONS_OPTIONS, E_OPENAI_CHAT_COMPLETIONS_CONTEXT_OVERFLOW, E_OPENAI_CHAT_COMPLETIONS_HTTP_ERROR, E_OPENAI_CHAT_COMPLETIONS_INVALID_TOOL_CALL_ARGS, E_OPENAI_CHAT_COMPLETIONS_REQUEST_TIMEOUT, E_OPENAI_CHAT_COMPLETIONS_STREAM_ERROR, E_OPENAI_CHAT_COMPLETIONS_STREAM_STALLED } from "./batteries/llm/openai_chat_completions/exceptions.mjs";
|
|
8
3
|
import { openAIChatCompletionsOptionsSchema, validateOptions as validateOptions$9 } from "./batteries/llm/openai_chat_completions/validation.mjs";
|
|
9
|
-
import { A as renderMemories, F as renderThirdPartyPrivateRetrievables, G as toolsToChatCompletionsTools, H as sanitizeFilenameForDescription, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, S as floorTrustTier, T as neutraliseDeveloperRulesTag, U as sanitizeMimeType, W as stripEnvelopeSpecialTokens, _ as defaultRenderUntrustedContent, c as defaultRenderMemories, d as defaultRenderRetrievables, f as defaultRenderStandingInstructions, g as defaultRenderTrustedContent, h as defaultRenderThought, i as defaultFilterThoughts, k as renderFirstPartyRetrievables, m as defaultRenderThirdPartyPublicRetrievables, o as defaultRenderChatCompletionsSystemPrompt, p as defaultRenderThirdPartyPrivateRetrievables, r as defaultDescriptionToChatCompletionsJsonSchema, s as defaultRenderFirstPartyRetrievables, u as defaultRenderRetrievableSafetyDirective, v as defaultToolsToChatCompletionsTools, x as filterThoughts, y as descriptionToChatCompletionsJsonSchema, z as renderUntrustedContent } from "./helpers-
|
|
4
|
+
import { A as renderMemories, F as renderThirdPartyPrivateRetrievables, G as toolsToChatCompletionsTools, H as sanitizeFilenameForDescription, I as renderThirdPartyPublicRetrievables, L as renderThought, M as renderRetrievableSafetyDirective, N as renderRetrievables, O as renderChatCompletionsSystemPrompt, P as renderStandingInstructions, R as renderTrustedContent, S as floorTrustTier, T as neutraliseDeveloperRulesTag, U as sanitizeMimeType, W as stripEnvelopeSpecialTokens, _ as defaultRenderUntrustedContent, c as defaultRenderMemories, d as defaultRenderRetrievables, f as defaultRenderStandingInstructions, g as defaultRenderTrustedContent, h as defaultRenderThought, i as defaultFilterThoughts, k as renderFirstPartyRetrievables, m as defaultRenderThirdPartyPublicRetrievables, o as defaultRenderChatCompletionsSystemPrompt, p as defaultRenderThirdPartyPrivateRetrievables, r as defaultDescriptionToChatCompletionsJsonSchema, s as defaultRenderFirstPartyRetrievables, u as defaultRenderRetrievableSafetyDirective, v as defaultToolsToChatCompletionsTools, x as filterThoughts, y as descriptionToChatCompletionsJsonSchema, z as renderUntrustedContent } from "./helpers-C1T0DV8Q.mjs";
|
|
10
5
|
import { buildChatCompletionsHistory, createChatCompletionsToolCallDeltaAccumulator, defaultBuildChatCompletionsHistory, defaultCreateChatCompletionsToolCallDeltaAccumulator, defaultRenderChatCompletionsToolCallResult, defaultRenderTimelineMessage, extractReasoningFields, renderChatCompletionsToolCallResult, renderTimelineMessage } from "./batteries/llm/openai_chat_completions/helpers.mjs";
|
|
11
6
|
import { OpenAIChatCompletionsAdapter } from "./batteries/llm/openai_chat_completions/adapter.mjs";
|
|
12
|
-
import { t as deCollideToolCallIds } from "./chat_common-
|
|
7
|
+
import { t as deCollideToolCallIds } from "./chat_common-CeoHwSsz.mjs";
|
|
13
8
|
import { E_INVALID_WEBLLM_CHAT_COMPLETIONS_OPTIONS, E_WEBLLM_CHAT_COMPLETIONS_CONTEXT_OVERFLOW, E_WEBLLM_CHAT_COMPLETIONS_INVALID_TOOL_CALL_ARGS, E_WEBLLM_CHAT_COMPLETIONS_STREAM_ERROR } from "./batteries/llm/webllm_chat_completions/exceptions.mjs";
|
|
14
9
|
import { validateOptions as validateOptions$17, webLLMChatCompletionsOptionsSchema } from "./batteries/llm/webllm_chat_completions/validation.mjs";
|
|
15
10
|
import { WebLLMChatCompletionsAdapter } from "./batteries/llm/webllm_chat_completions/adapter.mjs";
|
|
@@ -44,8 +39,8 @@ import { calculateTool, evaluateKatexTool } from "./batteries/tools/math.mjs";
|
|
|
44
39
|
import { deleteMemoryTool, listMemoriesTool, memoryTools, storeMemoryTool, updateMemoryTool } from "./batteries/tools/memory.mjs";
|
|
45
40
|
import { detectDelimiterTool, parseCsvTool, parseKvTool, parseYamlTool } from "./batteries/tools/parsing.mjs";
|
|
46
41
|
import { deleteRetrievableTool, listRetrievablesTool, retrievableTools, storeRetrievableTool, updateRetrievableTool } from "./batteries/tools/retrievables.mjs";
|
|
47
|
-
import { a as E_INVALID_SCRAPPER_CONFIG, i as createScrapperLinksToolSync, n as createScrapperArticleToolSync, r as createScrapperLinksTool, t as createScrapperArticleTool } from "./scrapper-
|
|
48
|
-
import { n as createSearxngSearchToolSync, r as E_INVALID_SEARXNG_CONFIG, t as createSearxngSearchTool } from "./searxng-
|
|
42
|
+
import { a as E_INVALID_SCRAPPER_CONFIG, i as createScrapperLinksToolSync, n as createScrapperArticleToolSync, r as createScrapperLinksTool, t as createScrapperArticleTool } from "./scrapper-_40wh9LI.mjs";
|
|
43
|
+
import { n as createSearxngSearchToolSync, r as E_INVALID_SEARXNG_CONFIG, t as createSearxngSearchTool } from "./searxng-D0NEAks7.mjs";
|
|
49
44
|
import { addStandingInstructionTool, listStandingInstructionsTool, removeStandingInstructionTool, standingInstructionTools } from "./batteries/tools/standing_instructions.mjs";
|
|
50
45
|
import { statsCorrelateTool, statsDescribeTool, statsHistogramTool, statsTransformTool } from "./batteries/tools/statistics.mjs";
|
|
51
46
|
import { stringExtractTool, stringTransformTool } from "./batteries/tools/string_processing.mjs";
|
|
@@ -91,8 +86,13 @@ import { E_INVALID_TRANSFORMERS_JS_TTS_OPTIONS, E_TRANSFORMERS_JS_TTS_ENGINE_ERR
|
|
|
91
86
|
import { transformersJsTtsOptionsSchema, validateOptions as validateOptions$16 } from "./batteries/tts/transformers_js/validation.mjs";
|
|
92
87
|
import { TransformersJsTtsAdapter } from "./batteries/tts/transformers_js/adapter.mjs";
|
|
93
88
|
import "./batteries/tts.mjs";
|
|
89
|
+
import { evaluateFilter, isFilterCondition, isFilterGroup, isRawExpr, isRawFilter, raw, vectorFilterSchema } from "./batteries/vector/filters.mjs";
|
|
94
90
|
import { clamp01, dimensionsMatch, isFiniteVector, mapMetric, normalizeScore, sanitizeMetadata } from "./batteries/vector/helpers.mjs";
|
|
91
|
+
import { E_INVALID_VECTOR_RECORD, E_INVALID_VECTOR_STORE_CONFIG, E_VECTOR_STORE_COLLECTION_FAILED, E_VECTOR_STORE_CONNECTION_FAILED, E_VECTOR_STORE_CONSISTENCY_TIMEOUT, E_VECTOR_STORE_DELETE_FAILED, E_VECTOR_STORE_DIMENSION_MISMATCH, E_VECTOR_STORE_DRIVER_UNAVAILABLE, E_VECTOR_STORE_ENCODER_REQUIRED, E_VECTOR_STORE_MIGRATION_FAILED, E_VECTOR_STORE_PROJECTION_REQUIRED, E_VECTOR_STORE_QUERY_CONFLICT, E_VECTOR_STORE_RAW_BINDING_MISMATCH, E_VECTOR_STORE_SEARCH_FAILED, E_VECTOR_STORE_TRANSACTIONS_UNSUPPORTED, E_VECTOR_STORE_UNSUPPORTED_FILTER_OPERATOR, E_VECTOR_STORE_UNSUPPORTED_OPERATION, E_VECTOR_STORE_UPSERT_FAILED } from "./batteries/vector/exceptions.mjs";
|
|
92
|
+
import { FilterBuilder, VectorQueryBuilder } from "./batteries/vector/builder.mjs";
|
|
93
|
+
import { CollectionBuilder, VectorSchemaBuilder } from "./batteries/vector/schema.mjs";
|
|
95
94
|
import { VectorMigrator } from "./batteries/vector/migrate.mjs";
|
|
95
|
+
import { BaseVectorStore } from "./batteries/vector/contract.mjs";
|
|
96
96
|
import { implementsVectorStoreConstructor, vectorStoreConstructorSchema } from "./batteries/vector/vector_store_constructor.mjs";
|
|
97
97
|
import { baseVectorStoreOptionsSchema, resolveClientCtor, validateCreateConfig, validateRecords, vectorRecordSchema } from "./batteries/vector/validation.mjs";
|
|
98
98
|
import { createVectorStore, encoderFromEmbeddings } from "./batteries/vector/factory.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./tool_parsers-DgZhgxV8.mjs";
|
|
2
|
-
import "./helpers-
|
|
2
|
+
import "./helpers-C1T0DV8Q.mjs";
|
|
3
3
|
import "./gpu_budget-Bi2nUUil.mjs";
|
|
4
4
|
import "./lifecycle-C4kwYJ-N.mjs";
|
|
5
5
|
import "./batteries/llm/chat_common/exceptions.mjs";
|
|
@@ -37,4 +37,4 @@ var deCollideToolCallIds = (id, ctx) => [...ctx.turnToolCalls].some((tc) => tc.i
|
|
|
37
37
|
//#endregion
|
|
38
38
|
export { deCollideToolCallIds as t };
|
|
39
39
|
|
|
40
|
-
//# sourceMappingURL=chat_common-
|
|
40
|
+
//# sourceMappingURL=chat_common-CeoHwSsz.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat_common-DKw8FDol.mjs","names":[],"sources":["../src/batteries/llm/chat_common/types.ts"],"sourcesContent":["/**\n * Wire-shape-agnostic TypeScript types shared across the Chat-family LLM batteries.\n *\n * @remarks\n * This module is INTERNAL to the bundled LLM batteries and is intentionally **not** tagged with\n * an `@module` JSDoc directive — `bin/utils/index.ts` `getEntries` only mints a public package\n * subpath for files that carry such a tag, so a tagless file stays private and is inlined into\n * each consumer by the bundler (the same way `src/lib/utils/retry.ts` is shared, minus the public\n * subpath). It holds the type aliases that the OpenAI Chat Completions battery and the native\n * Ollama battery both need: the validator-description envelope, the JSON Schema subset, the\n * trust-/memory-/retrievable-/thought-attribute envelopes, the system-prompt bucket ordering, the\n * function-tool wire shape, the unsupported-media policy, the retry config, and the\n * {@link ChatHelpersCommon} contract for the wire-shape-agnostic translation helpers.\n *\n * Battery-specific wire shapes (OpenAI Chat Completions message/chunk/response objects, the Ollama\n * native message/chunk objects) live in each battery's own `types.ts`, not here.\n */\n\nimport { v6 as uuidv6 } from 'uuid'\nimport type { ParsedToolCall } from './tool_parsers'\nimport type { DispatchContext } from '@nhtio/adk/types'\nimport type {\n Tokenizable,\n Memory,\n Thought,\n Retrievable,\n Tool,\n ArtifactTool,\n MediaKind,\n} from '@nhtio/adk/common'\n\n// ─── DescriptionLike (validator description envelope) ─────────────────────────\n\n/**\n * Structural shape of a validator/Joi `describe()` output, as consumed by the JSON-Schema\n * renderer. A loose superset — only the fields the renderer reads are typed; the index signature\n * carries everything else through untouched.\n */\nexport interface DescriptionLike {\n /** Validator type name (e.g. `'string'`, `'object'`, `'array'`). */\n type?: string\n /** Human-readable description of the field. */\n description?: string\n /** Presence flag (`'optional'`, `'required'`, or `'forbidden'`) at the top level. */\n presence?: string\n /** Default value supplied when the field is absent. */\n default?: unknown\n /** Permitted values declared via an enum/valid set. */\n enum?: unknown[]\n /** Permitted values declared via the validator's `valid()` rule. */\n valids?: unknown[]\n /** Example values for the field. */\n examples?: unknown[]\n /** Nested property descriptions, keyed by property name (for object types). */\n properties?: Record<string, DescriptionLike>\n /** Element description(s) for array types. */\n items?: DescriptionLike | DescriptionLike[]\n /** Names of required properties (for object types). */\n required?: string[]\n /** Validator flags bag carrying presence, description, and default. */\n flags?: { presence?: string; description?: string; default?: unknown }\n /** Pass-through for any other validator metadata the renderer does not read. */\n [key: string]: unknown\n}\n\n// ─── JSON Schema (Chat-Completions-compatible subset) ─────────────────────────\n\n/**\n * The subset of JSON Schema that Chat-family tool/function `parameters` accept, as emitted by\n * {@link ChatHelpersCommon.descriptionToChatCompletionsJsonSchema}. The index signature allows\n * extra keywords to pass through to the wire.\n */\nexport interface JsonSchema {\n /** JSON Schema primitive/compound type. */\n type?: 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null'\n /** Human-readable description of the schema node. */\n description?: string\n /** Permitted values for the node. */\n enum?: unknown[]\n /** Default value for the node. */\n default?: unknown\n /** Example values for the node. */\n examples?: unknown[]\n /** Property schemas keyed by property name (for `object` types). */\n properties?: Record<string, JsonSchema>\n /** Names of required properties (for `object` types). */\n required?: string[]\n /** Element schema(s) for `array` types. */\n items?: JsonSchema | JsonSchema[]\n /** Whether (or what schema) additional, undeclared properties are permitted. */\n additionalProperties?: boolean | JsonSchema\n /** Pass-through for any other JSON Schema keyword. */\n [key: string]: unknown\n}\n\n// ─── Helper-attribute envelopes ───────────────────────────────────────────────\n\n/**\n * Attribute bag rendered onto the trust envelope that wraps untrusted (third-party) content.\n */\nexport interface UntrustedContentAttrs {\n /**\n * Nonce binding the envelope's open and close markers together — it becomes part of the tag NAME\n * (`<..._<nonce>>`) so a model mirroring the fence cannot forge a sibling's closer.\n *\n * FOOTGUN: this nonce MUST be unguessable AND non-path-shaped. It is typically the source record's id; a\n * path-shaped id (e.g. `chunk-assembly-events-9`) is copied by small models as a CITATION\n * (`/assembly/events-9`), which a doc-path validator then rejects → re-cite loop. Mint record ids with\n * `crypto.randomUUID()`; carry page/human provenance in `source=` (rendered before `nonce=`), never in the id.\n */\n nonce: string\n /** Content classifier rendered on the envelope. */\n kind: string\n /** Name of the tool that produced the content, when applicable. */\n tool?: string\n /**\n * When wrapping a {@link @nhtio/adk!Media}-derived text marker, the modality hazard axis derived from\n * `media.modalityHazard`: `'inert'`, `'extractable'` (from `'extractable-instructions'`), or\n * `'opaque'` (from `'opaque-perceptual'`). Omitted for non-media envelopes.\n */\n modality?: 'inert' | 'extractable' | 'opaque'\n}\n\n/**\n * Attribute bag rendered onto the trust envelope that wraps trusted (first-party) content.\n */\nexport interface TrustedContentAttrs {\n /**\n * Nonce binding the envelope's open and close markers together — it becomes part of the tag NAME\n * (`<..._<nonce>>`) so a model mirroring the fence cannot forge a sibling's closer.\n *\n * FOOTGUN: this nonce MUST be unguessable AND non-path-shaped. It is typically the source record's id; a\n * path-shaped id (e.g. `chunk-assembly-events-9`) is copied by small models as a CITATION\n * (`/assembly/events-9`), which a doc-path validator then rejects → re-cite loop. Mint record ids with\n * `crypto.randomUUID()`; carry page/human provenance in `source=` (rendered before `nonce=`), never in the id.\n */\n nonce: string\n /** Content classifier rendered on the envelope. */\n kind: string\n /** Name of the tool that produced the content, when applicable. */\n tool?: string\n /**\n * Same semantics as {@link UntrustedContentAttrs.modality}.\n */\n modality?: 'inert' | 'extractable' | 'opaque'\n}\n\n/**\n * Attribute bag rendered onto a standing-instruction block.\n */\nexport interface StandingInstructionAttrs {\n /** Optional version label for the standing instruction. */\n version?: string\n}\n\n/**\n * Attribute bag rendered onto a memory block.\n */\nexport interface MemoryAttrs {\n /**\n * Nonce binding the block's open and close markers together — it becomes part of the tag NAME\n * (`<..._<nonce>>`) so a model mirroring the block cannot forge a sibling's closer.\n *\n * FOOTGUN: this nonce MUST be unguessable AND non-path-shaped. It is typically the source record's id; a\n * path-shaped id (e.g. `chunk-assembly-events-9`) is copied by small models as a CITATION\n * (`/assembly/events-9`), which a doc-path validator then rejects → re-cite loop. Mint record ids with\n * `crypto.randomUUID()`; carry page/human provenance in `source=` (rendered before `nonce=`), never in the id.\n */\n nonce: string\n /** Origin of the memory (e.g. the producing subsystem). */\n source?: string\n /** ISO-8601 creation timestamp of the memory. */\n createdAt?: string\n /** Memory classifier. */\n kind?: string\n /** Relevance/recall score, when the memory was retrieved by similarity. */\n score?: number\n}\n\n/**\n * Attribute bag rendered onto a retrievable block.\n */\nexport interface RetrievableAttrs {\n /**\n * Nonce binding the block's open and close markers together — it becomes part of the tag NAME\n * (`<..._<nonce>>`) so a model mirroring the block cannot forge a sibling's closer.\n *\n * FOOTGUN: this nonce MUST be unguessable AND non-path-shaped. It is typically the source record's id; a\n * path-shaped id (e.g. `chunk-assembly-events-9`) is copied by small models as a CITATION\n * (`/assembly/events-9`), which a doc-path validator then rejects → re-cite loop. Mint record ids with\n * `crypto.randomUUID()`; carry page/human provenance in `source=` (rendered before `nonce=`), never in the id.\n */\n nonce: string\n /** Origin of the retrievable (e.g. the source document or system). */\n source?: string\n /** ISO-8601 creation timestamp of the retrievable. */\n createdAt?: string\n /** Retrievable classifier. */\n kind?: string\n /** Relevance score from the retrieval query. */\n score?: number\n}\n\n/**\n * Attribute bag rendered onto a thought block.\n */\nexport interface ThoughtAttrs {\n /**\n * Nonce binding the block's open and close markers together — it becomes part of the tag NAME\n * (`<..._<nonce>>`) so a model mirroring the block cannot forge a sibling's closer.\n *\n * FOOTGUN: this nonce MUST be unguessable AND non-path-shaped. It is typically the source record's id; a\n * path-shaped id (e.g. `chunk-assembly-events-9`) is copied by small models as a CITATION\n * (`/assembly/events-9`), which a doc-path validator then rejects → re-cite loop. Mint record ids with\n * `crypto.randomUUID()`; carry page/human provenance in `source=` (rendered before `nonce=`), never in the id.\n */\n nonce: string\n /** Whether the thought is the model's own, a peer's, or opaque vendor reasoning. */\n kind: 'self-reasoning' | 'peer-reasoning' | 'opaque-reasoning'\n /** Identity of the agent the thought originated from. */\n from: string\n /** ISO-8601 creation timestamp of the thought. */\n createdAt?: string\n /** Replay-compatibility label gating whether the thought is surfaced on replay. */\n replayCompatibility?: string\n}\n\n// ─── Bucket order ─────────────────────────────────────────────────────────────\n\n/**\n * Name of a system-prompt content bucket whose render order is configurable.\n */\nexport type ChatCompletionsBucketLabel =\n | 'standingInstructions'\n | 'memories'\n | 'retrievables'\n | 'timeline'\n\n/**\n * Ordered list of {@link ChatCompletionsBucketLabel}s controlling the sequence in which content\n * buckets are assembled into the prompt.\n */\nexport type ChatCompletionsBucketOrder = ReadonlyArray<ChatCompletionsBucketLabel>\n\n// ─── Function-tool wire shape (identical for OpenAI Chat Completions and Ollama) ──\n\n/**\n * Wire shape of a single function tool advertised to the model — identical for OpenAI Chat\n * Completions and Ollama.\n */\nexport interface ChatCompletionsTool {\n /** Tool kind; always `'function'` for the bundled batteries. */\n type: 'function'\n /** The function declaration: its name, description, and JSON-Schema parameters. */\n function: {\n name: string\n description?: string\n parameters?: JsonSchema\n }\n}\n\n// ─── Unsupported-media policy ─────────────────────────────────────────────────\n\n/**\n * Policy for how a Chat-family battery handles a {@link @nhtio/adk!Media} instance whose modality the\n * wire protocol cannot natively represent.\n *\n * @remarks\n * The option SHAPE is shared; each battery decides which modalities count as \"unsupported\"\n * (OpenAI Chat Completions: video; Ollama native `/api/chat`: everything except image). Three\n * modes:\n *\n * - `'throw'` — raise the battery's unsupported-media exception and fail the dispatch. Loud\n * failure; the default, so a misconfigured pipeline surfaces immediately.\n * - `'fallback-stash'` — look for a model-readable text entry in `media.stash`. If present, render\n * that text inside the appropriate trust envelope in lieu of a media block. If no entry is found,\n * fall through to `'synthetic-description'` behaviour. The shorthand string form uses the\n * battery's default key list (`['text:transcript', 'text:caption', 'text:description']`, walked\n * in order). The object form `{ mode: 'fallback-stash'; stashKeys }` overrides the key list.\n * - `'synthetic-description'` — always render a synthetic text description constructed from\n * `filename`, `byteLength`, and `mimeType` regardless of `stash` presence.\n */\nexport type UnsupportedMediaPolicy =\n | 'throw'\n | 'fallback-stash'\n | 'synthetic-description'\n | { mode: 'fallback-stash'; stashKeys: ReadonlyArray<string> }\n\n// ─── Media OUTPUT (generated media surfaced as assistant attachments) ─────────\n\n/**\n * One piece of media a model GENERATED as turn output — the descriptor a\n * {@link MediaOutputExtractorFn} returns for the adapter to persist + attach to the assistant\n * {@link @nhtio/adk!Message}.\n *\n * @remarks\n * The LLM batteries are multimodal-IN, text-OUT by default: the tested open-weight chat checkpoints\n * emit only text, so no media output is produced unless a consumer wraps a media-emitting model AND\n * supplies an extractor. The framework contract already supports the output direction —\n * `Message.attachments` is symmetric across roles and `ctx.storeMediaBytes` persists generated bytes —\n * so this descriptor is all the adapter needs: it calls `storeMediaBytes` with `bytes`, builds a\n * `Media.toolGenerated({ kind, mimeType, filename, reader })` from the returned reader, and attaches it.\n */\nexport interface GeneratedMediaOutput {\n /** Media modality (`'image'`/`'audio'`/`'video'`/`'document'`). */\n kind: MediaKind\n /** Concrete MIME type of the generated bytes (e.g. `'audio/wav'`, `'image/png'`). */\n mimeType: string\n /** The generated media bytes. */\n bytes: Uint8Array\n /** Optional filename for the attachment; the adapter supplies a default when omitted. */\n filename?: string\n}\n\n/**\n * Extracts generated media from a battery's raw generation result so the adapter can surface it as\n * assistant `Message.attachments`. Injectable + defaulted to absent (no media output) on every LLM\n * battery, mirroring the `toolCallParser` / `reasoningParser` / `decodeMedia` injection seams.\n *\n * @remarks\n * `result` is the battery-native generation object (transformers.js `model.generate` / pipeline output;\n * the LiteRT-LM final `Message` + raw content items) — deliberately typed `unknown` because its shape is\n * battery-specific and the extractor is supplied by whoever wraps a media-emitting model. Returning an\n * empty array (or not supplying the hook) yields today's text-only behavior, byte-for-byte unchanged.\n */\nexport type MediaOutputExtractorFn = (\n result: unknown\n) => GeneratedMediaOutput[] | Promise<GeneratedMediaOutput[]>\n\n// ─── Raw generation observability (the model's text BEFORE parsing) ───────────\n\n/**\n * One observation of a battery's raw model output for a single completed generation, fired the instant\n * the full text is in hand — AFTER envelope-token stripping + reasoning/tool-call parsing, but BEFORE\n * the parsed result is persisted. The whole point is to expose the gap between what the model literally\n * emitted (`rawText`) and what the battery managed to extract (`cleanedText` / `toolCalls` /\n * `reasoning`): when a small on-device model emits a tool call in a shape no parser matches, the call\n * silently leaks into `cleanedText` as prose, and this is the ONLY seam where that is visible.\n *\n * @remarks\n * This is a pure observability tap — it returns `void`, never mutates the result, and never throws into\n * the generation path (the adapter swallows callback errors). It fires once per terminal generation\n * (one per non-streamed turn; one per stream at stream end), for BOTH the transformers.js and LiteRT-LM\n * on-device batteries, at the identical point in each. Use it for parser bring-up against a new model,\n * live debugging (\"why did the agent abstain?\"), or capturing ground-truth fixtures — exactly the job\n * that previously required patching a temporary hook into the adapter.\n */\nexport interface RawGenerationObservation {\n /**\n * The model's complete decoded output for this generation, with non-semantic envelope/turn-boundary\n * special tokens already stripped (the same text handed to the parsers) — i.e. what the parsers\n * actually saw. This is the field to inspect when a tool call did not parse.\n */\n rawText: string\n /**\n * The residual prose after reasoning + tool-call extraction — what becomes the assistant message\n * `content`. If a tool call failed to parse, its source text is still here (the leak).\n */\n cleanedText: string\n /** The reasoning/thinking traces the reasoning parser extracted (empty when none / not applicable). */\n reasoning: ReadonlyArray<string>\n /** The tool calls the tool-call parser extracted (empty when the model emitted none, or none parsed). */\n toolCalls: ReadonlyArray<ParsedToolCall>\n /** Whether this generation streamed its prose to the consumer (vs. a single batch decode). */\n streamed: boolean\n /** The adapter's stream/message id for this generation, for correlating with other telemetry. */\n streamId: string\n}\n\n/**\n * Observe a battery's raw model output for one completed generation. Injectable + defaulted to absent\n * on the on-device LLM batteries (transformers.js, LiteRT-LM), mirroring the `toolCallParser` /\n * `reasoningParser` / `extractMediaOutputs` injection seams. Fired once per terminal generation, after\n * parsing and before persistence; purely observational (return value ignored, errors swallowed).\n */\nexport type RawGenerationObserverFn = (observation: RawGenerationObservation) => void\n\n// ─── Prompt observability (the exact request BEFORE it is dispatched) ──────────\n\n/**\n * One observation of the fully-assembled request a battery is about to send TO the model, fired the\n * instant assembly completes and BEFORE the engine/HTTP dispatch. It is the mirror of\n * {@link RawGenerationObservation}: that seam exposes the raw text coming back FROM the model; this one\n * exposes the raw request going TO it. Together they let you read ground truth at both ends of the wire —\n * e.g. to settle whether a \"smart quote\" in a rendered answer came from the model itself or from a\n * downstream markdown renderer, you inspect the bytes here, not the DOM.\n *\n * @remarks\n * This is a pure observability tap — it returns `void`, never mutates the request, and never throws into\n * the generation path (the adapter swallows callback errors). It fires once per terminal generation\n * (one per non-streamed turn; one per stream, at dispatch), across ALL five LLM batteries.\n *\n * **Handed back AS-IS — no redaction.** The observation carries the request exactly as assembled. The ADK\n * does not scrub credentials, headers, or any other field for you: what you put on the request is what you\n * see here, and if you route this to a persistent sink (a log, `localStorage`, a file) you may persist\n * secrets that rode the request (an `apiKey`, `Authorization` header, etc.). That is your responsibility to\n * handle, not the battery's — the ADK surfaces the truth and lets you decide what to do with it. (In\n * practice the API batteries strip ADK-control keys like `apiKey` out of the wire body before this fires,\n * but that is incidental to how the body is built, not a guarantee.)\n */\nexport interface PromptAssembledObservation {\n /** Which battery assembled this request (e.g. `'litert_lm'`, `'openai_chat_completions'`). */\n battery: string\n /**\n * The shape of the assembled request. `'rendered-prompt'` for the on-device batteries (transformers.js,\n * LiteRT-LM), which render a preface string + a messages array for the engine; `'request-body'` for the\n * API batteries (OpenAI-compatible, Ollama, WebLLM), which POST a JSON body.\n */\n kind: 'rendered-prompt' | 'request-body'\n /**\n * On-device leading/system content rendered ahead of the timeline (e.g. the LiteRT `preface` object,\n * which carries the assembled system message text and — for native tool delivery — the tool list), when\n * applicable. Its concrete shape is battery-specific; captured verbatim. Absent for the API batteries.\n */\n preface?: unknown\n /**\n * The per-turn messages exactly as handed to the engine (on-device) or placed on the wire (API): the\n * engine's message array, or the request body's `messages`.\n */\n messages: unknown\n /**\n * The tool declarations exactly as dispatched: the rendered `<tool_definitions>` prompt text (on-device\n * prompt-delivery) or the wire `tools` array (API / native tool delivery). Absent when no tools are sent.\n */\n tools?: unknown\n /**\n * API batteries only: the complete assembled request body, exactly as it will be sent (see the AS-IS /\n * no-redaction note above). Absent for the on-device batteries.\n */\n requestBody?: unknown\n /** Whether this generation streams its response (vs. a single batch call). */\n streamed: boolean\n /** The adapter's stream/message id for this generation, for correlating with other telemetry. */\n streamId: string\n}\n\n/**\n * Observe the fully-assembled request a battery is about to dispatch. Injectable + defaulted to absent on\n * every LLM battery, mirroring {@link RawGenerationObserverFn}. Fired once per terminal generation, after\n * assembly and before dispatch; purely observational (return value ignored, errors swallowed). The request\n * is handed back AS-IS — see {@link PromptAssembledObservation} for the no-redaction contract.\n */\nexport type PromptAssembledObserverFn = (observation: PromptAssembledObservation) => void\n\n// ─── Tool-call id ingress ─────────────────────────────────────────────────────\n\n/**\n * Shapes a provider-supplied tool-call id at adapter ingress, before the call is stored or used for\n * spool/result correlation. This hook exists to prevent the concrete failure seen with grok-4.3 on\n * Bedrock Mantle, which repeats `call_0` across tool-calling turns. Default absent = identity, so\n * adapters retain today's behaviour unless a consumer opts in.\n *\n * @remarks\n * `#doStoreToolCall` adds to `turnToolCalls` synchronously before its await, and adoption is a\n * sequential loop, so each call sees every prior call — including same-response siblings. A correctly\n * numbered parallel batch (`call_0`..`call_3`) is therefore safe because those ids are already\n * DISTINCT, not because the siblings are unstored. A genuine same-response duplicate IS de-collided,\n * which is intentional.\n */\nexport type ToolCallIdFilterFn = (id: string, ctx: DispatchContext) => string\n\n/**\n * De-collides a provider-supplied tool-call id against calls already adopted in this dispatch. It\n * prevents the concrete `call_0`-repeated-across-turns failure seen with grok-4.3 on Bedrock Mantle.\n * Default absent = identity; this implementation returns the original id when no collision exists.\n *\n * @remarks\n * `#doStoreToolCall` adds to `turnToolCalls` synchronously before its await, and adoption is a\n * sequential loop, so each call sees every prior call — including same-response siblings. A correctly\n * numbered parallel batch (`call_0`..`call_3`) passes through because those ids are already DISTINCT,\n * not because the siblings are unstored. A genuine same-response duplicate is de-collided, as intended.\n */\nexport const deCollideToolCallIds: ToolCallIdFilterFn = (id, ctx) =>\n [...ctx.turnToolCalls].some((tc) => tc.id === id) ? uuidv6() : id\n\n// ─── Retry config ─────────────────────────────────────────────────────────────\n\n/**\n * Retry/backoff configuration for a Chat-family battery's HTTP requests.\n */\nexport interface ChatCompletionsRetryConfig {\n /** Maximum number of attempts (including the first) before giving up. */\n maxAttempts?: number\n /** Base delay in milliseconds for the first retry; doubles each attempt. */\n baseDelayMs?: number\n /** Upper bound in milliseconds on any single backoff delay. */\n maxDelayMs?: number\n /** HTTP status codes that trigger a retry. */\n retriableStatuses?: number[]\n /** Whether to honour a server `Retry-After` header in place of computed backoff. */\n honorRetryAfter?: boolean\n}\n\n// ─── Shared helper contract (wire-shape-agnostic members) ─────────────────────\n\n/**\n * The wire-shape-agnostic subset of a Chat-family battery's translation helpers — every helper\n * that produces a plain `string` (or JSON Schema / tool-definition wire, which is identical across\n * the family) rather than a battery-specific message object.\n *\n * @remarks\n * Both `ChatCompletionsHelpers` (OpenAI battery) and `OllamaHelpers` (Ollama battery) extend this\n * contract and add their own wire-specific members (timeline-message rendering, tool-call-result\n * rendering, history assembly, and — for OpenAI — streaming tool-call delta accumulation). Helpers\n * that compose other helpers receive their dependents via explicit `deps` arguments typed against\n * THIS contract (never against a battery-specific bag), so the shared implementations carry no\n * import edge back to any individual battery.\n */\nexport interface ChatHelpersCommon {\n /** Converts a validator `describe()` envelope into the Chat-Completions JSON-Schema subset. */\n descriptionToChatCompletionsJsonSchema: (d: DescriptionLike) => JsonSchema\n /** Wraps untrusted (third-party) text in the untrusted-content trust envelope. */\n renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string\n /** Wraps trusted (first-party) text in the trusted-content trust envelope. */\n renderTrustedContent: (content: string, attrs: TrustedContentAttrs) => string\n /** Renders standing instructions into a single prompt block. */\n renderStandingInstructions: (\n items: Iterable<Tokenizable>,\n attrs?: StandingInstructionAttrs\n ) => string\n /** Renders memories (each with its attribute bag) into a single prompt block. */\n renderMemories: (items: Iterable<{ memory: Memory; attrs: MemoryAttrs }>) => string\n /** Renders the safety directive that precedes any retrievable content. */\n renderRetrievableSafetyDirective: () => string\n /** Renders first-party (trusted) retrievables into a single prompt block. */\n renderFirstPartyRetrievables: (\n items: Iterable<{ retrievable: Retrievable; attrs: RetrievableAttrs }>,\n renderRetrievableHandleBody?: ChatHelpersCommon['renderRetrievableHandleBody']\n ) => Promise<string>\n /** Renders third-party public retrievables, wrapping each in the untrusted-content envelope. */\n renderThirdPartyPublicRetrievables: (\n items: Iterable<{ retrievable: Retrievable; attrs: RetrievableAttrs }>,\n deps: {\n renderUntrustedContent: ChatHelpersCommon['renderUntrustedContent']\n renderRetrievableHandleBody?: ChatHelpersCommon['renderRetrievableHandleBody']\n }\n ) => Promise<string>\n /** Renders third-party private retrievables, wrapping each in the untrusted-content envelope. */\n renderThirdPartyPrivateRetrievables: (\n items: Iterable<{ retrievable: Retrievable; attrs: RetrievableAttrs }>,\n deps: {\n renderUntrustedContent: ChatHelpersCommon['renderUntrustedContent']\n renderRetrievableHandleBody?: ChatHelpersCommon['renderRetrievableHandleBody']\n }\n ) => Promise<string>\n /** Assembles the full retrievables block: safety directive plus the trust-tiered sub-renderers. */\n renderRetrievables: (\n items: Iterable<{ retrievable: Retrievable; attrs: RetrievableAttrs }>,\n deps: {\n renderRetrievableSafetyDirective: ChatHelpersCommon['renderRetrievableSafetyDirective']\n renderFirstPartyRetrievables: ChatHelpersCommon['renderFirstPartyRetrievables']\n renderThirdPartyPublicRetrievables: ChatHelpersCommon['renderThirdPartyPublicRetrievables']\n renderThirdPartyPrivateRetrievables: ChatHelpersCommon['renderThirdPartyPrivateRetrievables']\n renderUntrustedContent: ChatHelpersCommon['renderUntrustedContent']\n renderRetrievableHandleBody?: ChatHelpersCommon['renderRetrievableHandleBody']\n }\n ) => Promise<string>\n /**\n * Renders the directions-bearing \"handle\" body for a non-inlined {@link @nhtio/adk!SpooledArtifact}\n * tool result: metadata (callId/kind/byteLength/lineCount) plus the forged `artifact_*` tools the\n * model should call to read it incrementally.\n *\n * @remarks\n * Optional override seam. When omitted the battery uses the shared\n * {@link defaultRenderArtifactHandleBody}. A consumer overrides it to change WHICH reader the model\n * is steered toward first — e.g. promoting the JSON content-readers (`artifact_json_get` /\n * `artifact_json_keys`) ahead of the metadata-only `artifact_json_type` for a small model that grabs\n * the first listed tool. The tool list itself comes from the artifact's `constructor.toolMethods`;\n * an override typically reorders or re-annotates that list before delegating to the default renderer.\n */\n renderArtifactHandleBody?: (input: {\n callId: string\n artifact: unknown\n byteLength: number\n lineCount: number\n estimatedTokens?: number\n encoding?: string\n }) => string\n /**\n * Renders the directions-bearing \"handle\" body for a non-inlined {@link @nhtio/adk!Retrievable}\n * whose content is a {@link @nhtio/adk!SpooledArtifact}: metadata (callId/kind/byteLength/lineCount)\n * plus the forged `artifact_*` tools the model should call to read it incrementally.\n *\n * @remarks\n * Optional override seam, the retrievable-side counterpart to {@link renderArtifactHandleBody}.\n * When omitted the battery uses the shared {@link defaultRenderRetrievableHandleBody}.\n */\n renderRetrievableHandleBody?: (input: {\n callId: string\n artifact: unknown\n byteLength: number\n lineCount: number\n estimatedTokens?: number\n encoding?: string\n }) => string\n /** Renders a single thought into its prompt block, optionally carrying an opaque replay payload. */\n renderThought: (content: string, attrs: ThoughtAttrs, payload?: unknown) => string\n /** Selects which thoughts to surface, by surfacing mode, self identity, and replay compatibility. */\n filterThoughts: (\n thoughts: Iterable<Thought>,\n mode: 'all-self' | 'latest-self' | 'all',\n selfIdentity: string,\n replayCompatibility: ReadonlyArray<string>\n ) => Thought[]\n /** Translates the tool registry into the function-tool wire array advertised to the model. */\n toolsToChatCompletionsTools: (\n tools: ReadonlyArray<Tool | ArtifactTool>,\n deps: { descriptionToChatCompletionsJsonSchema: (d: DescriptionLike) => JsonSchema }\n ) => ChatCompletionsTool[]\n /** Assembles the system-prompt message from its constituent buckets in {@link ChatCompletionsBucketOrder}. */\n renderChatCompletionsSystemPrompt: (input: {\n systemPrompt: Tokenizable\n /**\n * Live dispatch context for resolving a DYNAMIC {@link Tokenizable} `systemPrompt` via\n * `.render(ctx)`. Optional; a static `systemPrompt` ignores it. The real implementation\n * (`chat_common/helpers.ts`) already accepts and forwards this — declared here so the type\n * matches what the function actually does.\n */\n renderCtx?: unknown\n standingInstructions: Iterable<Tokenizable>\n memories: Iterable<Memory>\n retrievables: Iterable<Retrievable>\n bucketOrder: ChatCompletionsBucketOrder\n renderStandingInstructions: ChatHelpersCommon['renderStandingInstructions']\n renderMemories: ChatHelpersCommon['renderMemories']\n renderRetrievables: ChatHelpersCommon['renderRetrievables']\n renderRetrievableHandleBody?: ChatHelpersCommon['renderRetrievableHandleBody']\n renderRetrievableSafetyDirective: ChatHelpersCommon['renderRetrievableSafetyDirective']\n renderFirstPartyRetrievables: ChatHelpersCommon['renderFirstPartyRetrievables']\n renderThirdPartyPublicRetrievables: ChatHelpersCommon['renderThirdPartyPublicRetrievables']\n renderThirdPartyPrivateRetrievables: ChatHelpersCommon['renderThirdPartyPrivateRetrievables']\n renderUntrustedContent: ChatHelpersCommon['renderUntrustedContent']\n }) => Promise<string>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwdA,IAAa,wBAA4C,IAAI,QAC3D,CAAC,GAAG,IAAI,aAAa,EAAE,MAAM,OAAO,GAAG,OAAO,EAAE,IAAI,GAAO,IAAI"}
|
|
1
|
+
{"version":3,"file":"chat_common-CeoHwSsz.mjs","names":[],"sources":["../src/batteries/llm/chat_common/types.ts"],"sourcesContent":["/**\n * Wire-shape-agnostic TypeScript types shared across the Chat-family LLM batteries.\n *\n * @remarks\n * This module is INTERNAL to the bundled LLM batteries and is intentionally **not** tagged with\n * an `@module` JSDoc directive — `bin/utils/index.ts` `getEntries` only mints a public package\n * subpath for files that carry such a tag, so a tagless file stays private and is inlined into\n * each consumer by the bundler (the same way `src/lib/utils/retry.ts` is shared, minus the public\n * subpath). It holds the type aliases that the OpenAI Chat Completions battery and the native\n * Ollama battery both need: the validator-description envelope, the JSON Schema subset, the\n * trust-/memory-/retrievable-/thought-attribute envelopes, the system-prompt bucket ordering, the\n * function-tool wire shape, the unsupported-media policy, the retry config, and the\n * {@link ChatHelpersCommon} contract for the wire-shape-agnostic translation helpers.\n *\n * Battery-specific wire shapes (OpenAI Chat Completions message/chunk/response objects, the Ollama\n * native message/chunk objects) live in each battery's own `types.ts`, not here.\n */\n\nimport { v6 as uuidv6 } from 'uuid'\nimport type { ParsedToolCall } from './tool_parsers'\nimport type { DispatchContext } from '@nhtio/adk/types'\nimport type {\n Tokenizable,\n Memory,\n Thought,\n Retrievable,\n Tool,\n ArtifactTool,\n MediaKind,\n} from '@nhtio/adk/common'\n\n// ─── DescriptionLike (validator description envelope) ─────────────────────────\n\n/**\n * Structural shape of a validator/Joi `describe()` output, as consumed by the JSON-Schema\n * renderer. A loose superset — only the fields the renderer reads are typed; the index signature\n * carries everything else through untouched.\n */\nexport interface DescriptionLike {\n /** Validator type name (e.g. `'string'`, `'object'`, `'array'`). */\n type?: string\n /** Human-readable description of the field. */\n description?: string\n /** Presence flag (`'optional'`, `'required'`, or `'forbidden'`) at the top level. */\n presence?: string\n /** Default value supplied when the field is absent. */\n default?: unknown\n /** Permitted values declared via an enum/valid set. */\n enum?: unknown[]\n /** Permitted values declared via the validator's `valid()` rule. */\n valids?: unknown[]\n /** Example values for the field. */\n examples?: unknown[]\n /** Nested property descriptions, keyed by property name (for object types). */\n properties?: Record<string, DescriptionLike>\n /** Element description(s) for array types. */\n items?: DescriptionLike | DescriptionLike[]\n /** Names of required properties (for object types). */\n required?: string[]\n /** Validator flags bag carrying presence, description, and default. */\n flags?: { presence?: string; description?: string; default?: unknown }\n /** Pass-through for any other validator metadata the renderer does not read. */\n [key: string]: unknown\n}\n\n// ─── JSON Schema (Chat-Completions-compatible subset) ─────────────────────────\n\n/**\n * The subset of JSON Schema that Chat-family tool/function `parameters` accept, as emitted by\n * {@link ChatHelpersCommon.descriptionToChatCompletionsJsonSchema}. The index signature allows\n * extra keywords to pass through to the wire.\n */\nexport interface JsonSchema {\n /** JSON Schema primitive/compound type. */\n type?: 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null'\n /** Human-readable description of the schema node. */\n description?: string\n /** Permitted values for the node. */\n enum?: unknown[]\n /** Default value for the node. */\n default?: unknown\n /** Example values for the node. */\n examples?: unknown[]\n /** Property schemas keyed by property name (for `object` types). */\n properties?: Record<string, JsonSchema>\n /** Names of required properties (for `object` types). */\n required?: string[]\n /** Element schema(s) for `array` types. */\n items?: JsonSchema | JsonSchema[]\n /** Whether (or what schema) additional, undeclared properties are permitted. */\n additionalProperties?: boolean | JsonSchema\n /** Pass-through for any other JSON Schema keyword. */\n [key: string]: unknown\n}\n\n// ─── Helper-attribute envelopes ───────────────────────────────────────────────\n\n/**\n * Attribute bag rendered onto the trust envelope that wraps untrusted (third-party) content.\n */\nexport interface UntrustedContentAttrs {\n /**\n * Nonce binding the envelope's open and close markers together — it becomes part of the tag NAME\n * (`<..._<nonce>>`) so a model mirroring the fence cannot forge a sibling's closer.\n *\n * FOOTGUN: this nonce MUST be unguessable AND non-path-shaped. It is typically the source record's id; a\n * path-shaped id (e.g. `chunk-assembly-events-9`) is copied by small models as a CITATION\n * (`/assembly/events-9`), which a doc-path validator then rejects → re-cite loop. Mint record ids with\n * `crypto.randomUUID()`; carry page/human provenance in `source=` (rendered before `nonce=`), never in the id.\n */\n nonce: string\n /** Content classifier rendered on the envelope. */\n kind: string\n /** Name of the tool that produced the content, when applicable. */\n tool?: string\n /**\n * When wrapping a {@link @nhtio/adk!Media}-derived text marker, the modality hazard axis derived from\n * `media.modalityHazard`: `'inert'`, `'extractable'` (from `'extractable-instructions'`), or\n * `'opaque'` (from `'opaque-perceptual'`). Omitted for non-media envelopes.\n */\n modality?: 'inert' | 'extractable' | 'opaque'\n}\n\n/**\n * Attribute bag rendered onto the trust envelope that wraps trusted (first-party) content.\n */\nexport interface TrustedContentAttrs {\n /**\n * Nonce binding the envelope's open and close markers together — it becomes part of the tag NAME\n * (`<..._<nonce>>`) so a model mirroring the fence cannot forge a sibling's closer.\n *\n * FOOTGUN: this nonce MUST be unguessable AND non-path-shaped. It is typically the source record's id; a\n * path-shaped id (e.g. `chunk-assembly-events-9`) is copied by small models as a CITATION\n * (`/assembly/events-9`), which a doc-path validator then rejects → re-cite loop. Mint record ids with\n * `crypto.randomUUID()`; carry page/human provenance in `source=` (rendered before `nonce=`), never in the id.\n */\n nonce: string\n /** Content classifier rendered on the envelope. */\n kind: string\n /** Name of the tool that produced the content, when applicable. */\n tool?: string\n /**\n * Same semantics as {@link UntrustedContentAttrs.modality}.\n */\n modality?: 'inert' | 'extractable' | 'opaque'\n}\n\n/**\n * Attribute bag rendered onto a standing-instruction block.\n */\nexport interface StandingInstructionAttrs {\n /** Optional version label for the standing instruction. */\n version?: string\n}\n\n/**\n * Attribute bag rendered onto a memory block.\n */\nexport interface MemoryAttrs {\n /**\n * Nonce binding the block's open and close markers together — it becomes part of the tag NAME\n * (`<..._<nonce>>`) so a model mirroring the block cannot forge a sibling's closer.\n *\n * FOOTGUN: this nonce MUST be unguessable AND non-path-shaped. It is typically the source record's id; a\n * path-shaped id (e.g. `chunk-assembly-events-9`) is copied by small models as a CITATION\n * (`/assembly/events-9`), which a doc-path validator then rejects → re-cite loop. Mint record ids with\n * `crypto.randomUUID()`; carry page/human provenance in `source=` (rendered before `nonce=`), never in the id.\n */\n nonce: string\n /** Origin of the memory (e.g. the producing subsystem). */\n source?: string\n /** ISO-8601 creation timestamp of the memory. */\n createdAt?: string\n /** Memory classifier. */\n kind?: string\n /** Relevance/recall score, when the memory was retrieved by similarity. */\n score?: number\n}\n\n/**\n * Attribute bag rendered onto a retrievable block.\n */\nexport interface RetrievableAttrs {\n /**\n * Nonce binding the block's open and close markers together — it becomes part of the tag NAME\n * (`<..._<nonce>>`) so a model mirroring the block cannot forge a sibling's closer.\n *\n * FOOTGUN: this nonce MUST be unguessable AND non-path-shaped. It is typically the source record's id; a\n * path-shaped id (e.g. `chunk-assembly-events-9`) is copied by small models as a CITATION\n * (`/assembly/events-9`), which a doc-path validator then rejects → re-cite loop. Mint record ids with\n * `crypto.randomUUID()`; carry page/human provenance in `source=` (rendered before `nonce=`), never in the id.\n */\n nonce: string\n /** Origin of the retrievable (e.g. the source document or system). */\n source?: string\n /** ISO-8601 creation timestamp of the retrievable. */\n createdAt?: string\n /** Retrievable classifier. */\n kind?: string\n /** Relevance score from the retrieval query. */\n score?: number\n}\n\n/**\n * Attribute bag rendered onto a thought block.\n */\nexport interface ThoughtAttrs {\n /**\n * Nonce binding the block's open and close markers together — it becomes part of the tag NAME\n * (`<..._<nonce>>`) so a model mirroring the block cannot forge a sibling's closer.\n *\n * FOOTGUN: this nonce MUST be unguessable AND non-path-shaped. It is typically the source record's id; a\n * path-shaped id (e.g. `chunk-assembly-events-9`) is copied by small models as a CITATION\n * (`/assembly/events-9`), which a doc-path validator then rejects → re-cite loop. Mint record ids with\n * `crypto.randomUUID()`; carry page/human provenance in `source=` (rendered before `nonce=`), never in the id.\n */\n nonce: string\n /** Whether the thought is the model's own, a peer's, or opaque vendor reasoning. */\n kind: 'self-reasoning' | 'peer-reasoning' | 'opaque-reasoning'\n /** Identity of the agent the thought originated from. */\n from: string\n /** ISO-8601 creation timestamp of the thought. */\n createdAt?: string\n /** Replay-compatibility label gating whether the thought is surfaced on replay. */\n replayCompatibility?: string\n}\n\n// ─── Bucket order ─────────────────────────────────────────────────────────────\n\n/**\n * Name of a system-prompt content bucket whose render order is configurable.\n */\nexport type ChatCompletionsBucketLabel =\n | 'standingInstructions'\n | 'memories'\n | 'retrievables'\n | 'timeline'\n\n/**\n * Ordered list of {@link ChatCompletionsBucketLabel}s controlling the sequence in which content\n * buckets are assembled into the prompt.\n */\nexport type ChatCompletionsBucketOrder = ReadonlyArray<ChatCompletionsBucketLabel>\n\n// ─── Function-tool wire shape (identical for OpenAI Chat Completions and Ollama) ──\n\n/**\n * Wire shape of a single function tool advertised to the model — identical for OpenAI Chat\n * Completions and Ollama.\n */\nexport interface ChatCompletionsTool {\n /** Tool kind; always `'function'` for the bundled batteries. */\n type: 'function'\n /** The function declaration: its name, description, and JSON-Schema parameters. */\n function: {\n name: string\n description?: string\n parameters?: JsonSchema\n }\n}\n\n// ─── Unsupported-media policy ─────────────────────────────────────────────────\n\n/**\n * Policy for how a Chat-family battery handles a {@link @nhtio/adk!Media} instance whose modality the\n * wire protocol cannot natively represent.\n *\n * @remarks\n * The option SHAPE is shared; each battery decides which modalities count as \"unsupported\"\n * (OpenAI Chat Completions: video; Ollama native `/api/chat`: everything except image). Three\n * modes:\n *\n * - `'throw'` — raise the battery's unsupported-media exception and fail the dispatch. Loud\n * failure; the default, so a misconfigured pipeline surfaces immediately.\n * - `'fallback-stash'` — look for a model-readable text entry in `media.stash`. If present, render\n * that text inside the appropriate trust envelope in lieu of a media block. If no entry is found,\n * fall through to `'synthetic-description'` behaviour. The shorthand string form uses the\n * battery's default key list (`['text:transcript', 'text:caption', 'text:description']`, walked\n * in order). The object form `{ mode: 'fallback-stash'; stashKeys }` overrides the key list.\n * - `'synthetic-description'` — always render a synthetic text description constructed from\n * `filename`, `byteLength`, and `mimeType` regardless of `stash` presence.\n */\nexport type UnsupportedMediaPolicy =\n | 'throw'\n | 'fallback-stash'\n | 'synthetic-description'\n | { mode: 'fallback-stash'; stashKeys: ReadonlyArray<string> }\n\n// ─── Media OUTPUT (generated media surfaced as assistant attachments) ─────────\n\n/**\n * One piece of media a model GENERATED as turn output — the descriptor a\n * {@link MediaOutputExtractorFn} returns for the adapter to persist + attach to the assistant\n * {@link @nhtio/adk!Message}.\n *\n * @remarks\n * The LLM batteries are multimodal-IN, text-OUT by default: the tested open-weight chat checkpoints\n * emit only text, so no media output is produced unless a consumer wraps a media-emitting model AND\n * supplies an extractor. The framework contract already supports the output direction —\n * `Message.attachments` is symmetric across roles and `ctx.storeMediaBytes` persists generated bytes —\n * so this descriptor is all the adapter needs: it calls `storeMediaBytes` with `bytes`, builds a\n * `Media.toolGenerated({ kind, mimeType, filename, reader })` from the returned reader, and attaches it.\n */\nexport interface GeneratedMediaOutput {\n /** Media modality (`'image'`/`'audio'`/`'video'`/`'document'`). */\n kind: MediaKind\n /** Concrete MIME type of the generated bytes (e.g. `'audio/wav'`, `'image/png'`). */\n mimeType: string\n /** The generated media bytes. */\n bytes: Uint8Array\n /** Optional filename for the attachment; the adapter supplies a default when omitted. */\n filename?: string\n}\n\n/**\n * Extracts generated media from a battery's raw generation result so the adapter can surface it as\n * assistant `Message.attachments`. Injectable + defaulted to absent (no media output) on every LLM\n * battery, mirroring the `toolCallParser` / `reasoningParser` / `decodeMedia` injection seams.\n *\n * @remarks\n * `result` is the battery-native generation object (transformers.js `model.generate` / pipeline output;\n * the LiteRT-LM final `Message` + raw content items) — deliberately typed `unknown` because its shape is\n * battery-specific and the extractor is supplied by whoever wraps a media-emitting model. Returning an\n * empty array (or not supplying the hook) yields today's text-only behavior, byte-for-byte unchanged.\n */\nexport type MediaOutputExtractorFn = (\n result: unknown\n) => GeneratedMediaOutput[] | Promise<GeneratedMediaOutput[]>\n\n// ─── Raw generation observability (the model's text BEFORE parsing) ───────────\n\n/**\n * One observation of a battery's raw model output for a single completed generation, fired the instant\n * the full text is in hand — AFTER envelope-token stripping + reasoning/tool-call parsing, but BEFORE\n * the parsed result is persisted. The whole point is to expose the gap between what the model literally\n * emitted (`rawText`) and what the battery managed to extract (`cleanedText` / `toolCalls` /\n * `reasoning`): when a small on-device model emits a tool call in a shape no parser matches, the call\n * silently leaks into `cleanedText` as prose, and this is the ONLY seam where that is visible.\n *\n * @remarks\n * This is a pure observability tap — it returns `void`, never mutates the result, and never throws into\n * the generation path (the adapter swallows callback errors). It fires once per terminal generation\n * (one per non-streamed turn; one per stream at stream end), for BOTH the transformers.js and LiteRT-LM\n * on-device batteries, at the identical point in each. Use it for parser bring-up against a new model,\n * live debugging (\"why did the agent abstain?\"), or capturing ground-truth fixtures — exactly the job\n * that previously required patching a temporary hook into the adapter.\n */\nexport interface RawGenerationObservation {\n /**\n * The model's complete decoded output for this generation, with non-semantic envelope/turn-boundary\n * special tokens already stripped (the same text handed to the parsers) — i.e. what the parsers\n * actually saw. This is the field to inspect when a tool call did not parse.\n */\n rawText: string\n /**\n * The residual prose after reasoning + tool-call extraction — what becomes the assistant message\n * `content`. If a tool call failed to parse, its source text is still here (the leak).\n */\n cleanedText: string\n /** The reasoning/thinking traces the reasoning parser extracted (empty when none / not applicable). */\n reasoning: ReadonlyArray<string>\n /** The tool calls the tool-call parser extracted (empty when the model emitted none, or none parsed). */\n toolCalls: ReadonlyArray<ParsedToolCall>\n /** Whether this generation streamed its prose to the consumer (vs. a single batch decode). */\n streamed: boolean\n /** The adapter's stream/message id for this generation, for correlating with other telemetry. */\n streamId: string\n}\n\n/**\n * Observe a battery's raw model output for one completed generation. Injectable + defaulted to absent\n * on the on-device LLM batteries (transformers.js, LiteRT-LM), mirroring the `toolCallParser` /\n * `reasoningParser` / `extractMediaOutputs` injection seams. Fired once per terminal generation, after\n * parsing and before persistence; purely observational (return value ignored, errors swallowed).\n */\nexport type RawGenerationObserverFn = (observation: RawGenerationObservation) => void\n\n// ─── Prompt observability (the exact request BEFORE it is dispatched) ──────────\n\n/**\n * One observation of the fully-assembled request a battery is about to send TO the model, fired the\n * instant assembly completes and BEFORE the engine/HTTP dispatch. It is the mirror of\n * {@link RawGenerationObservation}: that seam exposes the raw text coming back FROM the model; this one\n * exposes the raw request going TO it. Together they let you read ground truth at both ends of the wire —\n * e.g. to settle whether a \"smart quote\" in a rendered answer came from the model itself or from a\n * downstream markdown renderer, you inspect the bytes here, not the DOM.\n *\n * @remarks\n * This is a pure observability tap — it returns `void`, never mutates the request, and never throws into\n * the generation path (the adapter swallows callback errors). It fires once per terminal generation\n * (one per non-streamed turn; one per stream, at dispatch), across ALL five LLM batteries.\n *\n * **Handed back AS-IS — no redaction.** The observation carries the request exactly as assembled. The ADK\n * does not scrub credentials, headers, or any other field for you: what you put on the request is what you\n * see here, and if you route this to a persistent sink (a log, `localStorage`, a file) you may persist\n * secrets that rode the request (an `apiKey`, `Authorization` header, etc.). That is your responsibility to\n * handle, not the battery's — the ADK surfaces the truth and lets you decide what to do with it. (In\n * practice the API batteries strip ADK-control keys like `apiKey` out of the wire body before this fires,\n * but that is incidental to how the body is built, not a guarantee.)\n */\nexport interface PromptAssembledObservation {\n /** Which battery assembled this request (e.g. `'litert_lm'`, `'openai_chat_completions'`). */\n battery: string\n /**\n * The shape of the assembled request. `'rendered-prompt'` for the on-device batteries (transformers.js,\n * LiteRT-LM), which render a preface string + a messages array for the engine; `'request-body'` for the\n * API batteries (OpenAI-compatible, Ollama, WebLLM), which POST a JSON body.\n */\n kind: 'rendered-prompt' | 'request-body'\n /**\n * On-device leading/system content rendered ahead of the timeline (e.g. the LiteRT `preface` object,\n * which carries the assembled system message text and — for native tool delivery — the tool list), when\n * applicable. Its concrete shape is battery-specific; captured verbatim. Absent for the API batteries.\n */\n preface?: unknown\n /**\n * The per-turn messages exactly as handed to the engine (on-device) or placed on the wire (API): the\n * engine's message array, or the request body's `messages`.\n */\n messages: unknown\n /**\n * The tool declarations exactly as dispatched: the rendered `<tool_definitions>` prompt text (on-device\n * prompt-delivery) or the wire `tools` array (API / native tool delivery). Absent when no tools are sent.\n */\n tools?: unknown\n /**\n * API batteries only: the complete assembled request body, exactly as it will be sent (see the AS-IS /\n * no-redaction note above). Absent for the on-device batteries.\n */\n requestBody?: unknown\n /** Whether this generation streams its response (vs. a single batch call). */\n streamed: boolean\n /** The adapter's stream/message id for this generation, for correlating with other telemetry. */\n streamId: string\n}\n\n/**\n * Observe the fully-assembled request a battery is about to dispatch. Injectable + defaulted to absent on\n * every LLM battery, mirroring {@link RawGenerationObserverFn}. Fired once per terminal generation, after\n * assembly and before dispatch; purely observational (return value ignored, errors swallowed). The request\n * is handed back AS-IS — see {@link PromptAssembledObservation} for the no-redaction contract.\n */\nexport type PromptAssembledObserverFn = (observation: PromptAssembledObservation) => void\n\n// ─── Tool-call id ingress ─────────────────────────────────────────────────────\n\n/**\n * Shapes a provider-supplied tool-call id at adapter ingress, before the call is stored or used for\n * spool/result correlation. This hook exists to prevent the concrete failure seen with grok-4.3 on\n * Bedrock Mantle, which repeats `call_0` across tool-calling turns. Default absent = identity, so\n * adapters retain today's behaviour unless a consumer opts in.\n *\n * @remarks\n * `#doStoreToolCall` adds to `turnToolCalls` synchronously before its await, and adoption is a\n * sequential loop, so each call sees every prior call — including same-response siblings. A correctly\n * numbered parallel batch (`call_0`..`call_3`) is therefore safe because those ids are already\n * DISTINCT, not because the siblings are unstored. A genuine same-response duplicate IS de-collided,\n * which is intentional.\n */\nexport type ToolCallIdFilterFn = (id: string, ctx: DispatchContext) => string\n\n/**\n * De-collides a provider-supplied tool-call id against calls already adopted in this dispatch. It\n * prevents the concrete `call_0`-repeated-across-turns failure seen with grok-4.3 on Bedrock Mantle.\n * Default absent = identity; this implementation returns the original id when no collision exists.\n *\n * @remarks\n * `#doStoreToolCall` adds to `turnToolCalls` synchronously before its await, and adoption is a\n * sequential loop, so each call sees every prior call — including same-response siblings. A correctly\n * numbered parallel batch (`call_0`..`call_3`) passes through because those ids are already DISTINCT,\n * not because the siblings are unstored. A genuine same-response duplicate is de-collided, as intended.\n */\nexport const deCollideToolCallIds: ToolCallIdFilterFn = (id, ctx) =>\n [...ctx.turnToolCalls].some((tc) => tc.id === id) ? uuidv6() : id\n\n// ─── Retry config ─────────────────────────────────────────────────────────────\n\n/**\n * Retry/backoff configuration for a Chat-family battery's HTTP requests.\n */\nexport interface ChatCompletionsRetryConfig {\n /** Maximum number of attempts (including the first) before giving up. */\n maxAttempts?: number\n /** Base delay in milliseconds for the first retry; doubles each attempt. */\n baseDelayMs?: number\n /** Upper bound in milliseconds on any single backoff delay. */\n maxDelayMs?: number\n /** HTTP status codes that trigger a retry. */\n retriableStatuses?: number[]\n /** Whether to honour a server `Retry-After` header in place of computed backoff. */\n honorRetryAfter?: boolean\n}\n\n// ─── Shared helper contract (wire-shape-agnostic members) ─────────────────────\n\n/**\n * The wire-shape-agnostic subset of a Chat-family battery's translation helpers — every helper\n * that produces a plain `string` (or JSON Schema / tool-definition wire, which is identical across\n * the family) rather than a battery-specific message object.\n *\n * @remarks\n * Both `ChatCompletionsHelpers` (OpenAI battery) and `OllamaHelpers` (Ollama battery) extend this\n * contract and add their own wire-specific members (timeline-message rendering, tool-call-result\n * rendering, history assembly, and — for OpenAI — streaming tool-call delta accumulation). Helpers\n * that compose other helpers receive their dependents via explicit `deps` arguments typed against\n * THIS contract (never against a battery-specific bag), so the shared implementations carry no\n * import edge back to any individual battery.\n */\nexport interface ChatHelpersCommon {\n /** Converts a validator `describe()` envelope into the Chat-Completions JSON-Schema subset. */\n descriptionToChatCompletionsJsonSchema: (d: DescriptionLike) => JsonSchema\n /** Wraps untrusted (third-party) text in the untrusted-content trust envelope. */\n renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string\n /** Wraps trusted (first-party) text in the trusted-content trust envelope. */\n renderTrustedContent: (content: string, attrs: TrustedContentAttrs) => string\n /** Renders standing instructions into a single prompt block. */\n renderStandingInstructions: (\n items: Iterable<Tokenizable>,\n attrs?: StandingInstructionAttrs\n ) => string\n /** Renders memories (each with its attribute bag) into a single prompt block. */\n renderMemories: (items: Iterable<{ memory: Memory; attrs: MemoryAttrs }>) => string\n /** Renders the safety directive that precedes any retrievable content. */\n renderRetrievableSafetyDirective: () => string\n /** Renders first-party (trusted) retrievables into a single prompt block. */\n renderFirstPartyRetrievables: (\n items: Iterable<{ retrievable: Retrievable; attrs: RetrievableAttrs }>,\n renderRetrievableHandleBody?: ChatHelpersCommon['renderRetrievableHandleBody']\n ) => Promise<string>\n /** Renders third-party public retrievables, wrapping each in the untrusted-content envelope. */\n renderThirdPartyPublicRetrievables: (\n items: Iterable<{ retrievable: Retrievable; attrs: RetrievableAttrs }>,\n deps: {\n renderUntrustedContent: ChatHelpersCommon['renderUntrustedContent']\n renderRetrievableHandleBody?: ChatHelpersCommon['renderRetrievableHandleBody']\n }\n ) => Promise<string>\n /** Renders third-party private retrievables, wrapping each in the untrusted-content envelope. */\n renderThirdPartyPrivateRetrievables: (\n items: Iterable<{ retrievable: Retrievable; attrs: RetrievableAttrs }>,\n deps: {\n renderUntrustedContent: ChatHelpersCommon['renderUntrustedContent']\n renderRetrievableHandleBody?: ChatHelpersCommon['renderRetrievableHandleBody']\n }\n ) => Promise<string>\n /** Assembles the full retrievables block: safety directive plus the trust-tiered sub-renderers. */\n renderRetrievables: (\n items: Iterable<{ retrievable: Retrievable; attrs: RetrievableAttrs }>,\n deps: {\n renderRetrievableSafetyDirective: ChatHelpersCommon['renderRetrievableSafetyDirective']\n renderFirstPartyRetrievables: ChatHelpersCommon['renderFirstPartyRetrievables']\n renderThirdPartyPublicRetrievables: ChatHelpersCommon['renderThirdPartyPublicRetrievables']\n renderThirdPartyPrivateRetrievables: ChatHelpersCommon['renderThirdPartyPrivateRetrievables']\n renderUntrustedContent: ChatHelpersCommon['renderUntrustedContent']\n renderRetrievableHandleBody?: ChatHelpersCommon['renderRetrievableHandleBody']\n }\n ) => Promise<string>\n /**\n * Renders the directions-bearing \"handle\" body for a non-inlined {@link @nhtio/adk!SpooledArtifact}\n * tool result: metadata (callId/kind/byteLength/lineCount) plus the forged `artifact_*` tools the\n * model should call to read it incrementally.\n *\n * @remarks\n * Optional override seam. When omitted the battery uses the shared\n * {@link defaultRenderArtifactHandleBody}. A consumer overrides it to change WHICH reader the model\n * is steered toward first — e.g. promoting the JSON content-readers (`artifact_json_get` /\n * `artifact_json_keys`) ahead of the metadata-only `artifact_json_type` for a small model that grabs\n * the first listed tool. The tool list itself comes from the artifact's `constructor.toolMethods`;\n * an override typically reorders or re-annotates that list before delegating to the default renderer.\n */\n renderArtifactHandleBody?: (input: {\n callId: string\n artifact: unknown\n byteLength: number\n lineCount: number\n estimatedTokens?: number\n encoding?: string\n }) => string\n /**\n * Renders the directions-bearing \"handle\" body for a non-inlined {@link @nhtio/adk!Retrievable}\n * whose content is a {@link @nhtio/adk!SpooledArtifact}: metadata (callId/kind/byteLength/lineCount)\n * plus the forged `artifact_*` tools the model should call to read it incrementally.\n *\n * @remarks\n * Optional override seam, the retrievable-side counterpart to {@link renderArtifactHandleBody}.\n * When omitted the battery uses the shared {@link defaultRenderRetrievableHandleBody}.\n */\n renderRetrievableHandleBody?: (input: {\n callId: string\n artifact: unknown\n byteLength: number\n lineCount: number\n estimatedTokens?: number\n encoding?: string\n }) => string\n /** Renders a single thought into its prompt block, optionally carrying an opaque replay payload. */\n renderThought: (content: string, attrs: ThoughtAttrs, payload?: unknown) => string\n /** Selects which thoughts to surface, by surfacing mode, self identity, and replay compatibility. */\n filterThoughts: (\n thoughts: Iterable<Thought>,\n mode: 'all-self' | 'latest-self' | 'all',\n selfIdentity: string,\n replayCompatibility: ReadonlyArray<string>\n ) => Thought[]\n /** Translates the tool registry into the function-tool wire array advertised to the model. */\n toolsToChatCompletionsTools: (\n tools: ReadonlyArray<Tool | ArtifactTool>,\n deps: { descriptionToChatCompletionsJsonSchema: (d: DescriptionLike) => JsonSchema }\n ) => ChatCompletionsTool[]\n /** Assembles the system-prompt message from its constituent buckets in {@link ChatCompletionsBucketOrder}. */\n renderChatCompletionsSystemPrompt: (input: {\n systemPrompt: Tokenizable\n /**\n * Live dispatch context for resolving a DYNAMIC {@link Tokenizable} `systemPrompt` via\n * `.render(ctx)`. Optional; a static `systemPrompt` ignores it. The real implementation\n * (`chat_common/helpers.ts`) already accepts and forwards this — declared here so the type\n * matches what the function actually does.\n */\n renderCtx?: unknown\n standingInstructions: Iterable<Tokenizable>\n memories: Iterable<Memory>\n retrievables: Iterable<Retrievable>\n bucketOrder: ChatCompletionsBucketOrder\n renderStandingInstructions: ChatHelpersCommon['renderStandingInstructions']\n renderMemories: ChatHelpersCommon['renderMemories']\n renderRetrievables: ChatHelpersCommon['renderRetrievables']\n renderRetrievableHandleBody?: ChatHelpersCommon['renderRetrievableHandleBody']\n renderRetrievableSafetyDirective: ChatHelpersCommon['renderRetrievableSafetyDirective']\n renderFirstPartyRetrievables: ChatHelpersCommon['renderFirstPartyRetrievables']\n renderThirdPartyPublicRetrievables: ChatHelpersCommon['renderThirdPartyPublicRetrievables']\n renderThirdPartyPrivateRetrievables: ChatHelpersCommon['renderThirdPartyPrivateRetrievables']\n renderUntrustedContent: ChatHelpersCommon['renderUntrustedContent']\n }) => Promise<string>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwdA,IAAa,wBAA4C,IAAI,QAC3D,CAAC,GAAG,IAAI,aAAa,EAAE,MAAM,OAAO,GAAG,OAAO,EAAE,IAAI,GAAO,IAAI"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("./tool_parsers-8_qO0a_F.cjs");
|
|
2
|
-
require("./helpers-
|
|
2
|
+
require("./helpers-D6ebO8Vc.cjs");
|
|
3
3
|
require("./gpu_budget-BBIUyLoj.cjs");
|
|
4
4
|
require("./lifecycle-vYQJ2rmf.cjs");
|
|
5
5
|
require("./batteries/llm/chat_common/exceptions.cjs");
|
|
@@ -42,4 +42,4 @@ Object.defineProperty(exports, "deCollideToolCallIds", {
|
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
//# sourceMappingURL=chat_common-
|
|
45
|
+
//# sourceMappingURL=chat_common-DlIK1IAn.cjs.map
|