@nhtio/adk 1.20260610.0 → 1.20260610.1
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 +11 -0
- package/batteries/embeddings/openai/adapter.cjs +1 -1
- package/batteries/embeddings/openai/adapter.mjs +1 -1
- package/batteries/embeddings/webllm/adapter.cjs +1 -1
- package/batteries/embeddings/webllm/adapter.mjs +1 -1
- package/batteries/llm/ollama/adapter.cjs +5 -5
- package/batteries/llm/ollama/adapter.mjs +5 -5
- package/batteries/llm/ollama/helpers.cjs +2 -2
- package/batteries/llm/ollama/helpers.mjs +2 -2
- package/batteries/llm/ollama/validation.cjs +1 -1
- package/batteries/llm/ollama/validation.mjs +1 -1
- package/batteries/llm/openai_chat_completions/adapter.cjs +5 -5
- package/batteries/llm/openai_chat_completions/adapter.mjs +5 -5
- package/batteries/llm/openai_chat_completions/helpers.cjs +2 -2
- package/batteries/llm/openai_chat_completions/helpers.mjs +2 -2
- package/batteries/llm/openai_chat_completions/validation.cjs +1 -1
- package/batteries/llm/openai_chat_completions/validation.mjs +1 -1
- package/batteries/llm/webllm_chat_completions/adapter.cjs +5 -5
- package/batteries/llm/webllm_chat_completions/adapter.mjs +5 -5
- package/batteries/llm/webllm_chat_completions/validation.cjs +1 -1
- package/batteries/llm/webllm_chat_completions/validation.mjs +1 -1
- package/batteries/media/contracts.cjs +1 -1
- package/batteries/media/contracts.mjs +1 -1
- package/batteries/media/engines/audio_decode.cjs +1 -1
- package/batteries/media/engines/audio_decode.cjs.map +1 -1
- package/batteries/media/engines/audio_decode.d.ts +7 -3
- package/batteries/media/engines/audio_decode.mjs +1 -1
- package/batteries/media/engines/audio_decode.mjs.map +1 -1
- package/batteries/media/engines/execa_executor.cjs +1 -1
- package/batteries/media/engines/execa_executor.mjs +1 -1
- package/batteries/media/engines/fs_workspace.cjs +1 -1
- package/batteries/media/engines/fs_workspace.mjs +1 -1
- package/batteries/media/engines/jimp.cjs +1 -1
- package/batteries/media/engines/jimp.mjs +1 -1
- package/batteries/media/engines/sharp.cjs +1 -1
- package/batteries/media/engines/sharp.mjs +1 -1
- package/batteries/media/engines/tesseract_js.cjs +1 -1
- package/batteries/media/engines/tesseract_js.mjs +1 -1
- package/batteries/media/engines/transformers_asr.cjs +1 -1
- package/batteries/media/engines/transformers_asr.mjs +1 -1
- package/batteries/media/forge.cjs +6 -6
- package/batteries/media/forge.mjs +6 -6
- package/batteries/media/index.d.ts +2 -2
- package/batteries/media/lint.cjs +1 -1
- package/batteries/media/lint.cjs.map +1 -1
- package/batteries/media/lint.d.ts +1 -1
- package/batteries/media/lint.mjs +1 -1
- package/batteries/media/lint.mjs.map +1 -1
- package/batteries/media/pipe.d.ts +1 -1
- package/batteries/media.cjs +3 -3
- package/batteries/media.cjs.map +1 -1
- package/batteries/media.mjs +3 -3
- package/batteries/media.mjs.map +1 -1
- package/batteries/storage/flydrive.cjs +1 -1
- package/batteries/storage/flydrive.mjs +1 -1
- package/batteries/storage/in_memory.cjs +1 -1
- package/batteries/storage/in_memory.mjs +1 -1
- package/batteries/storage/opfs.cjs +1 -1
- package/batteries/storage/opfs.mjs +1 -1
- package/batteries/tools/_shared.cjs +2 -2
- package/batteries/tools/_shared.mjs +2 -2
- package/batteries/tools/color.cjs +2 -2
- package/batteries/tools/color.mjs +2 -2
- package/batteries/tools/comparison.cjs +3 -3
- package/batteries/tools/comparison.mjs +3 -3
- package/batteries/tools/data_structure.cjs +3 -3
- package/batteries/tools/data_structure.mjs +3 -3
- package/batteries/tools/datetime_extended.cjs +2 -2
- package/batteries/tools/datetime_extended.mjs +2 -2
- package/batteries/tools/datetime_math.cjs +2 -2
- package/batteries/tools/datetime_math.mjs +2 -2
- package/batteries/tools/encoding.cjs +3 -3
- package/batteries/tools/encoding.mjs +3 -3
- package/batteries/tools/formatting.cjs +3 -3
- package/batteries/tools/formatting.mjs +3 -3
- package/batteries/tools/geo_basics.cjs +2 -2
- package/batteries/tools/geo_basics.mjs +2 -2
- package/batteries/tools/math.cjs +3 -3
- package/batteries/tools/math.mjs +3 -3
- package/batteries/tools/memory.cjs +5 -5
- package/batteries/tools/memory.mjs +5 -5
- package/batteries/tools/parsing.cjs +4 -4
- package/batteries/tools/parsing.mjs +4 -4
- package/batteries/tools/retrievables.cjs +4 -4
- package/batteries/tools/retrievables.mjs +4 -4
- package/batteries/tools/scrapper/index.d.ts +1 -0
- 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 +4 -4
- package/batteries/tools/standing_instructions.mjs +4 -4
- package/batteries/tools/statistics.cjs +4 -4
- package/batteries/tools/statistics.mjs +4 -4
- package/batteries/tools/string_processing.cjs +3 -3
- package/batteries/tools/string_processing.mjs +3 -3
- package/batteries/tools/structured_data.cjs +3 -3
- package/batteries/tools/structured_data.mjs +3 -3
- 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 +2 -2
- package/batteries/tools/time.mjs +2 -2
- package/batteries/tools/unit_conversion.cjs +2 -2
- package/batteries/tools/unit_conversion.mjs +2 -2
- package/batteries/tools/web_retrieval/index.d.ts +4 -4
- package/batteries/tools/web_retrieval.cjs +4 -4
- package/batteries/tools/web_retrieval.cjs.map +1 -1
- package/batteries/tools/web_retrieval.mjs +4 -4
- package/batteries/tools/web_retrieval.mjs.map +1 -1
- package/batteries/tools.cjs +2 -2
- package/batteries/tools.mjs +2 -2
- package/batteries/vector/arangodb.cjs +1 -1
- package/batteries/vector/arangodb.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/filters.cjs +1 -1
- package/batteries/vector/filters.mjs +1 -1
- package/batteries/vector/hnswlib.cjs +1 -1
- package/batteries/vector/hnswlib.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/meilisearch.cjs +1 -1
- package/batteries/vector/meilisearch.mjs +1 -1
- package/batteries/vector/migrate.cjs +1 -1
- package/batteries/vector/migrate.mjs +1 -1
- package/batteries/vector/mongodb.cjs +1 -1
- package/batteries/vector/mongodb.mjs +1 -1
- package/batteries/vector/neo4j.cjs +1 -1
- package/batteries/vector/neo4j.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/pinecone.cjs +1 -1
- package/batteries/vector/pinecone.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/solr.cjs +1 -1
- package/batteries/vector/solr.mjs +1 -1
- package/batteries/vector/surrealdb.cjs +1 -1
- package/batteries/vector/surrealdb.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.cjs +2 -2
- package/batteries.mjs +2 -2
- package/{common-DYDUi99O.mjs → common-Bs4H4NOD.mjs} +8 -8
- package/{common-DYDUi99O.mjs.map → common-Bs4H4NOD.mjs.map} +1 -1
- package/{common-DZl3ADJs.js → common-CCDLEmQk.js} +8 -8
- package/{common-DZl3ADJs.js.map → common-CCDLEmQk.js.map} +1 -1
- package/common.cjs +7 -7
- package/common.mjs +7 -7
- package/{dispatch_runner--ZhdDWRZ.mjs → dispatch_runner-CKi8SWSF.mjs} +3 -3
- package/{dispatch_runner--ZhdDWRZ.mjs.map → dispatch_runner-CKi8SWSF.mjs.map} +1 -1
- package/{dispatch_runner-nHDKkxye.js → dispatch_runner-e0i6VAKX.js} +3 -3
- package/{dispatch_runner-nHDKkxye.js.map → dispatch_runner-e0i6VAKX.js.map} +1 -1
- package/dispatch_runner.cjs +1 -1
- package/dispatch_runner.mjs +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 +4 -4
- package/forge.mjs +4 -4
- package/guards.cjs +8 -8
- package/guards.mjs +8 -8
- package/index.cjs +12 -12
- package/index.mjs +12 -12
- package/mcp/adk-docs-corpus.json +1 -1
- package/package.json +154 -154
- package/{runtime-DslE1aBw.js → runtime-CRF56t7P.js} +1 -1
- package/{runtime-DslE1aBw.js.map → runtime-CRF56t7P.js.map} +1 -1
- package/{runtime-Bz5zA8wc.mjs → runtime-s8MPiRk2.mjs} +1 -1
- package/{runtime-Bz5zA8wc.mjs.map → runtime-s8MPiRk2.mjs.map} +1 -1
- package/{scrapper-hDKlNuCT.mjs → scrapper-BIEo8YFO.mjs} +4 -4
- package/{scrapper-hDKlNuCT.mjs.map → scrapper-BIEo8YFO.mjs.map} +1 -1
- package/{scrapper-BOLWYGbD.js → scrapper-CdETSAvg.js} +4 -4
- package/{scrapper-BOLWYGbD.js.map → scrapper-CdETSAvg.js.map} +1 -1
- package/{searxng-riarj_0u.mjs → searxng-COvSyS9X.mjs} +4 -4
- package/{searxng-riarj_0u.mjs.map → searxng-COvSyS9X.mjs.map} +1 -1
- package/{searxng-CJtEpa8p.js → searxng-DZexynBu.js} +4 -4
- package/{searxng-CJtEpa8p.js.map → searxng-DZexynBu.js.map} +1 -1
- package/skills/adk-assembly/SKILL.md +2 -2
- package/{spooled_artifact-DX8LLyUX.js → spooled_artifact-DmZKXhnn.js} +4 -4
- package/{spooled_artifact-DX8LLyUX.js.map → spooled_artifact-DmZKXhnn.js.map} +1 -1
- package/{spooled_artifact-7eePq7JA.mjs → spooled_artifact-PV0MTlL1.mjs} +4 -4
- package/{spooled_artifact-7eePq7JA.mjs.map → spooled_artifact-PV0MTlL1.mjs.map} +1 -1
- package/spooled_artifact.cjs +2 -2
- package/spooled_artifact.mjs +2 -2
- package/{spooled_markdown_artifact-ClX72lek.js → spooled_markdown_artifact-CyedUE_d.js} +3 -3
- package/{spooled_markdown_artifact-ClX72lek.js.map → spooled_markdown_artifact-CyedUE_d.js.map} +1 -1
- package/{spooled_markdown_artifact-wkrBF3oX.mjs → spooled_markdown_artifact-IcqG7qmv.mjs} +3 -3
- package/{spooled_markdown_artifact-wkrBF3oX.mjs.map → spooled_markdown_artifact-IcqG7qmv.mjs.map} +1 -1
- package/{thought-DLwpF7MI.js → thought-BSpZK-Q3.js} +4 -4
- package/{thought-DLwpF7MI.js.map → thought-BSpZK-Q3.js.map} +1 -1
- package/{thought-B_vxAiKU.mjs → thought-Dpvmq9yj.mjs} +4 -4
- package/{thought-B_vxAiKU.mjs.map → thought-Dpvmq9yj.mjs.map} +1 -1
- package/{tool-wMYMVl60.mjs → tool-AaLCDVjO.mjs} +3 -3
- package/{tool-wMYMVl60.mjs.map → tool-AaLCDVjO.mjs.map} +1 -1
- package/{tool-D5WGVIcI.js → tool-aEQQxXve.js} +3 -3
- package/{tool-D5WGVIcI.js.map → tool-aEQQxXve.js.map} +1 -1
- package/{tool_call-DixVlW40.js → tool_call-B1VXAAmn.js} +4 -4
- package/{tool_call-DixVlW40.js.map → tool_call-B1VXAAmn.js.map} +1 -1
- package/{tool_call-B4-_-vjG.mjs → tool_call-B2Ty8FuQ.mjs} +4 -4
- package/{tool_call-B4-_-vjG.mjs.map → tool_call-B2Ty8FuQ.mjs.map} +1 -1
- package/{tool_registry-791Vrjtf.mjs → tool_registry-D6gaqCO1.mjs} +3 -3
- package/{tool_registry-791Vrjtf.mjs.map → tool_registry-D6gaqCO1.mjs.map} +1 -1
- package/{tool_registry-CKJPze3j.js → tool_registry-qQXq9zs0.js} +3 -3
- package/{tool_registry-CKJPze3j.js.map → tool_registry-qQXq9zs0.js.map} +1 -1
- package/{turn_runner-HXImLGIn.js → turn_runner-C3DBh465.js} +5 -5
- package/{turn_runner-HXImLGIn.js.map → turn_runner-C3DBh465.js.map} +1 -1
- package/{turn_runner-ZyYO-Kti.mjs → turn_runner-CVHrXNnw.mjs} +5 -5
- package/{turn_runner-ZyYO-Kti.mjs.map → turn_runner-CVHrXNnw.mjs.map} +1 -1
- package/turn_runner.cjs +1 -1
- package/turn_runner.mjs +1 -1
- package/{validate-BFaUYHDN.js → validate-DUnMQTt1.js} +2 -2
- package/{validate-BFaUYHDN.js.map → validate-DUnMQTt1.js.map} +1 -1
- package/{validate-DSZ3wicB.mjs → validate-DokBgtG-.mjs} +2 -2
- package/{validate-DSZ3wicB.mjs.map → validate-DokBgtG-.mjs.map} +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -83,6 +83,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
83
83
|
`pdf-lib`, `pdf-parse`, `mammoth`, `exceljs`, `jszip`, `jimp`, `sharp`, `audio-decode`,
|
|
84
84
|
`@huggingface/transformers`, `tesseract.js`, `execa`.
|
|
85
85
|
|
|
86
|
+
### Fixed
|
|
87
|
+
|
|
88
|
+
- **API documentation gaps closed.** Several types referenced by public API surfaces were not
|
|
89
|
+
themselves exported, so their doc pages didn't exist and links to them dangled:
|
|
90
|
+
`EngineSummary` (referenced by the media lint plugin's `BUNDLED_SUMMARIES`), `ChainExecutor`
|
|
91
|
+
(the media chain's executor seam), and `AudioDecodeFn`/`AudioBufferLike` (the audio-decode
|
|
92
|
+
engine's override surface) are now exported and documented. The web-retrieval docs' links to
|
|
93
|
+
`RawRetrievable` now point at `@nhtio/adk/common`, where the type actually lives, and
|
|
94
|
+
`ScrapperBaseConfig` is re-exported from the scrapper barrel. Cosmetic prose fixes in the
|
|
95
|
+
media docs ride along. No runtime behavior changes.
|
|
96
|
+
|
|
86
97
|
## 2026-06-09
|
|
87
98
|
|
|
88
99
|
### Fixed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../../chunk-Ble4zEEl.js");
|
|
3
|
-
const require_tool_registry = require("../../../tool_registry-
|
|
3
|
+
const require_tool_registry = require("../../../tool_registry-qQXq9zs0.js");
|
|
4
4
|
require("../../../guards.cjs");
|
|
5
5
|
const require_lib_utils_retry = require("../../../lib/utils/retry.cjs");
|
|
6
6
|
const require_batteries_embeddings_openai_exceptions = require("./exceptions.cjs");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as isError } from "../../../tool_registry-
|
|
1
|
+
import { o as isError } from "../../../tool_registry-D6gaqCO1.mjs";
|
|
2
2
|
import "../../../guards.mjs";
|
|
3
3
|
import { computeBackoff, parseRetryAfter, sleepWithJitter } from "../../../lib/utils/retry.mjs";
|
|
4
4
|
import { E_OPENAI_EMBEDDINGS_HTTP_ERROR, E_OPENAI_EMBEDDINGS_MALFORMED_RESPONSE, E_OPENAI_EMBEDDINGS_REQUEST_TIMEOUT } from "./exceptions.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../../chunk-Ble4zEEl.js");
|
|
3
|
-
const require_tool_registry = require("../../../tool_registry-
|
|
3
|
+
const require_tool_registry = require("../../../tool_registry-qQXq9zs0.js");
|
|
4
4
|
require("../../../guards.cjs");
|
|
5
5
|
const require_batteries_embeddings_openai_helpers = require("../openai/helpers.cjs");
|
|
6
6
|
const require_batteries_embeddings_webllm_exceptions = require("./exceptions.cjs");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as isError } from "../../../tool_registry-
|
|
1
|
+
import { o as isError } from "../../../tool_registry-D6gaqCO1.mjs";
|
|
2
2
|
import "../../../guards.mjs";
|
|
3
3
|
import { applyEmbeddingPrefix } from "../openai/helpers.mjs";
|
|
4
4
|
import { E_INVALID_WEBLLM_EMBEDDINGS_OPTIONS, E_WEBLLM_EMBEDDINGS_ENGINE_ERROR } from "./exceptions.mjs";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../../chunk-Ble4zEEl.js");
|
|
3
|
-
const require_tool_registry = require("../../../tool_registry-
|
|
4
|
-
const require_thought = require("../../../thought-
|
|
5
|
-
const require_spooled_artifact = require("../../../spooled_artifact-
|
|
6
|
-
require("../../../common-
|
|
7
|
-
const require_tool_call = require("../../../tool_call-
|
|
3
|
+
const require_tool_registry = require("../../../tool_registry-qQXq9zs0.js");
|
|
4
|
+
const require_thought = require("../../../thought-BSpZK-Q3.js");
|
|
5
|
+
const require_spooled_artifact = require("../../../spooled_artifact-DmZKXhnn.js");
|
|
6
|
+
require("../../../common-CCDLEmQk.js");
|
|
7
|
+
const require_tool_call = require("../../../tool_call-B1VXAAmn.js");
|
|
8
8
|
require("../../../guards.cjs");
|
|
9
9
|
const require_lib_utils_retry = require("../../../lib/utils/retry.cjs");
|
|
10
10
|
const require_batteries_storage_in_memory = require("../../storage/in_memory.cjs");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as Tokenizable, c as isObject, n as canonicalStringify, o as isError, s as isInstanceOf, t as ToolRegistry } from "../../../tool_registry-
|
|
2
|
-
import { n as Message, t as Thought } from "../../../thought-
|
|
3
|
-
import { i as ArtifactTool, t as SpooledArtifact } from "../../../spooled_artifact-
|
|
4
|
-
import "../../../common-
|
|
5
|
-
import { n as Media, t as ToolCall } from "../../../tool_call-
|
|
1
|
+
import { a as Tokenizable, c as isObject, n as canonicalStringify, o as isError, s as isInstanceOf, t as ToolRegistry } from "../../../tool_registry-D6gaqCO1.mjs";
|
|
2
|
+
import { n as Message, t as Thought } from "../../../thought-Dpvmq9yj.mjs";
|
|
3
|
+
import { i as ArtifactTool, t as SpooledArtifact } from "../../../spooled_artifact-PV0MTlL1.mjs";
|
|
4
|
+
import "../../../common-Bs4H4NOD.mjs";
|
|
5
|
+
import { n as Media, t as ToolCall } from "../../../tool_call-B2Ty8FuQ.mjs";
|
|
6
6
|
import "../../../guards.mjs";
|
|
7
7
|
import { computeBackoff, linkAbortSignals, parseRetryAfter, sleepWithJitter } from "../../../lib/utils/retry.mjs";
|
|
8
8
|
import { InMemorySpoolStore } from "../../storage/in_memory.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../../chunk-Ble4zEEl.js");
|
|
3
|
-
require("../../../common-
|
|
4
|
-
const require_tool_call = require("../../../tool_call-
|
|
3
|
+
require("../../../common-CCDLEmQk.js");
|
|
4
|
+
const require_tool_call = require("../../../tool_call-B1VXAAmn.js");
|
|
5
5
|
require("../../../guards.cjs");
|
|
6
6
|
const require_helpers = require("../../../helpers-DSTFxTiC.js");
|
|
7
7
|
const require_batteries_llm_ollama_exceptions = require("./exceptions.cjs");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../../../common-
|
|
2
|
-
import { n as Media } from "../../../tool_call-
|
|
1
|
+
import "../../../common-Bs4H4NOD.mjs";
|
|
2
|
+
import { n as Media } from "../../../tool_call-B2Ty8FuQ.mjs";
|
|
3
3
|
import "../../../guards.mjs";
|
|
4
4
|
import { A as retrievableToAttrs, C as renderRetrievables, D as renderThought, E as renderThirdPartyPublicRetrievables, M as toolsToChatCompletionsTools, O as renderTrustedContent, S as renderRetrievableSafetyDirective, T as renderThirdPartyPrivateRetrievables, _ as filterThoughts, a as defaultRenderMemories, b as renderFirstPartyRetrievables, c as defaultRenderStandingInstructions, d as defaultRenderThought, f as defaultRenderTrustedContent, g as escapeXmlAttribute, h as descriptionToChatCompletionsJsonSchema, i as defaultRenderFirstPartyRetrievables, k as renderUntrustedContent, l as defaultRenderThirdPartyPrivateRetrievables, m as defaultToolsToChatCompletionsTools, n as defaultFilterThoughts, o as defaultRenderRetrievableSafetyDirective, p as defaultRenderUntrustedContent, r as defaultRenderChatCompletionsSystemPrompt, s as defaultRenderRetrievables, t as defaultDescriptionToChatCompletionsJsonSchema, u as defaultRenderThirdPartyPublicRetrievables, v as memoryToAttrs, w as renderStandingInstructions, x as renderMemories, y as renderChatCompletionsSystemPrompt } from "../../../helpers-xhrQbMAG.mjs";
|
|
5
5
|
import { E_OLLAMA_UNSUPPORTED_MEDIA_MODALITY } from "./exceptions.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../../chunk-Ble4zEEl.js");
|
|
3
|
-
const require_common = require("../../../common-
|
|
3
|
+
const require_common = require("../../../common-CCDLEmQk.js");
|
|
4
4
|
require("../../../guards.cjs");
|
|
5
5
|
const require_batteries_llm_ollama_exceptions = require("./exceptions.cjs");
|
|
6
6
|
let _nhtio_validation = require("@nhtio/validation");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as byteStoreSchema } from "../../../common-
|
|
1
|
+
import { i as byteStoreSchema } from "../../../common-Bs4H4NOD.mjs";
|
|
2
2
|
import "../../../guards.mjs";
|
|
3
3
|
import { E_INVALID_OLLAMA_OPTIONS } from "./exceptions.mjs";
|
|
4
4
|
import { validator } from "@nhtio/validation";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../../chunk-Ble4zEEl.js");
|
|
3
|
-
const require_tool_registry = require("../../../tool_registry-
|
|
4
|
-
const require_thought = require("../../../thought-
|
|
5
|
-
const require_spooled_artifact = require("../../../spooled_artifact-
|
|
6
|
-
require("../../../common-
|
|
7
|
-
const require_tool_call = require("../../../tool_call-
|
|
3
|
+
const require_tool_registry = require("../../../tool_registry-qQXq9zs0.js");
|
|
4
|
+
const require_thought = require("../../../thought-BSpZK-Q3.js");
|
|
5
|
+
const require_spooled_artifact = require("../../../spooled_artifact-DmZKXhnn.js");
|
|
6
|
+
require("../../../common-CCDLEmQk.js");
|
|
7
|
+
const require_tool_call = require("../../../tool_call-B1VXAAmn.js");
|
|
8
8
|
require("../../../guards.cjs");
|
|
9
9
|
const require_lib_utils_retry = require("../../../lib/utils/retry.cjs");
|
|
10
10
|
const require_batteries_llm_openai_chat_completions_exceptions = require("./exceptions.cjs");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as Tokenizable, c as isObject, n as canonicalStringify, o as isError, s as isInstanceOf, t as ToolRegistry } from "../../../tool_registry-
|
|
2
|
-
import { n as Message, t as Thought } from "../../../thought-
|
|
3
|
-
import { i as ArtifactTool, t as SpooledArtifact } from "../../../spooled_artifact-
|
|
4
|
-
import "../../../common-
|
|
5
|
-
import { n as Media, t as ToolCall } from "../../../tool_call-
|
|
1
|
+
import { a as Tokenizable, c as isObject, n as canonicalStringify, o as isError, s as isInstanceOf, t as ToolRegistry } from "../../../tool_registry-D6gaqCO1.mjs";
|
|
2
|
+
import { n as Message, t as Thought } from "../../../thought-Dpvmq9yj.mjs";
|
|
3
|
+
import { i as ArtifactTool, t as SpooledArtifact } from "../../../spooled_artifact-PV0MTlL1.mjs";
|
|
4
|
+
import "../../../common-Bs4H4NOD.mjs";
|
|
5
|
+
import { n as Media, t as ToolCall } from "../../../tool_call-B2Ty8FuQ.mjs";
|
|
6
6
|
import "../../../guards.mjs";
|
|
7
7
|
import { computeBackoff, linkAbortSignals, parseRetryAfter, sleepWithJitter } from "../../../lib/utils/retry.mjs";
|
|
8
8
|
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 "./exceptions.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../../chunk-Ble4zEEl.js");
|
|
3
|
-
require("../../../common-
|
|
4
|
-
const require_tool_call = require("../../../tool_call-
|
|
3
|
+
require("../../../common-CCDLEmQk.js");
|
|
4
|
+
const require_tool_call = require("../../../tool_call-B1VXAAmn.js");
|
|
5
5
|
require("../../../guards.cjs");
|
|
6
6
|
const require_batteries_llm_openai_chat_completions_exceptions = require("./exceptions.cjs");
|
|
7
7
|
const require_helpers = require("../../../helpers-DSTFxTiC.js");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../../../common-
|
|
2
|
-
import { n as Media } from "../../../tool_call-
|
|
1
|
+
import "../../../common-Bs4H4NOD.mjs";
|
|
2
|
+
import { n as Media } from "../../../tool_call-B2Ty8FuQ.mjs";
|
|
3
3
|
import "../../../guards.mjs";
|
|
4
4
|
import { E_UNSUPPORTED_MEDIA_MODALITY } from "./exceptions.mjs";
|
|
5
5
|
import { A as retrievableToAttrs, C as renderRetrievables, D as renderThought, E as renderThirdPartyPublicRetrievables, M as toolsToChatCompletionsTools, O as renderTrustedContent, S as renderRetrievableSafetyDirective, T as renderThirdPartyPrivateRetrievables, _ as filterThoughts, a as defaultRenderMemories, b as renderFirstPartyRetrievables, c as defaultRenderStandingInstructions, d as defaultRenderThought, f as defaultRenderTrustedContent, g as escapeXmlAttribute, h as descriptionToChatCompletionsJsonSchema, i as defaultRenderFirstPartyRetrievables, j as sanitiseNameField, k as renderUntrustedContent, l as defaultRenderThirdPartyPrivateRetrievables, m as defaultToolsToChatCompletionsTools, n as defaultFilterThoughts, o as defaultRenderRetrievableSafetyDirective, p as defaultRenderUntrustedContent, r as defaultRenderChatCompletionsSystemPrompt, s as defaultRenderRetrievables, t as defaultDescriptionToChatCompletionsJsonSchema, u as defaultRenderThirdPartyPublicRetrievables, v as memoryToAttrs, w as renderStandingInstructions, x as renderMemories, y as renderChatCompletionsSystemPrompt } from "../../../helpers-xhrQbMAG.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../../chunk-Ble4zEEl.js");
|
|
3
|
-
const require_common = require("../../../common-
|
|
3
|
+
const require_common = require("../../../common-CCDLEmQk.js");
|
|
4
4
|
require("../../../guards.cjs");
|
|
5
5
|
const require_batteries_llm_openai_chat_completions_exceptions = require("./exceptions.cjs");
|
|
6
6
|
let _nhtio_validation = require("@nhtio/validation");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as byteStoreSchema } from "../../../common-
|
|
1
|
+
import { i as byteStoreSchema } from "../../../common-Bs4H4NOD.mjs";
|
|
2
2
|
import "../../../guards.mjs";
|
|
3
3
|
import { E_INVALID_OPENAI_CHAT_COMPLETIONS_OPTIONS } from "./exceptions.mjs";
|
|
4
4
|
import { validator } from "@nhtio/validation";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../../chunk-Ble4zEEl.js");
|
|
3
|
-
const require_tool_registry = require("../../../tool_registry-
|
|
4
|
-
const require_thought = require("../../../thought-
|
|
5
|
-
const require_spooled_artifact = require("../../../spooled_artifact-
|
|
6
|
-
require("../../../common-
|
|
7
|
-
const require_tool_call = require("../../../tool_call-
|
|
3
|
+
const require_tool_registry = require("../../../tool_registry-qQXq9zs0.js");
|
|
4
|
+
const require_thought = require("../../../thought-BSpZK-Q3.js");
|
|
5
|
+
const require_spooled_artifact = require("../../../spooled_artifact-DmZKXhnn.js");
|
|
6
|
+
require("../../../common-CCDLEmQk.js");
|
|
7
|
+
const require_tool_call = require("../../../tool_call-B1VXAAmn.js");
|
|
8
8
|
require("../../../guards.cjs");
|
|
9
9
|
const require_batteries_storage_in_memory = require("../../storage/in_memory.cjs");
|
|
10
10
|
const require_helpers = require("../../../helpers-DSTFxTiC.js");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as Tokenizable, c as isObject, n as canonicalStringify, o as isError, s as isInstanceOf, t as ToolRegistry } from "../../../tool_registry-
|
|
2
|
-
import { n as Message, t as Thought } from "../../../thought-
|
|
3
|
-
import { i as ArtifactTool, t as SpooledArtifact } from "../../../spooled_artifact-
|
|
4
|
-
import "../../../common-
|
|
5
|
-
import { n as Media, t as ToolCall } from "../../../tool_call-
|
|
1
|
+
import { a as Tokenizable, c as isObject, n as canonicalStringify, o as isError, s as isInstanceOf, t as ToolRegistry } from "../../../tool_registry-D6gaqCO1.mjs";
|
|
2
|
+
import { n as Message, t as Thought } from "../../../thought-Dpvmq9yj.mjs";
|
|
3
|
+
import { i as ArtifactTool, t as SpooledArtifact } from "../../../spooled_artifact-PV0MTlL1.mjs";
|
|
4
|
+
import "../../../common-Bs4H4NOD.mjs";
|
|
5
|
+
import { n as Media, t as ToolCall } from "../../../tool_call-B2Ty8FuQ.mjs";
|
|
6
6
|
import "../../../guards.mjs";
|
|
7
7
|
import { InMemorySpoolStore } from "../../storage/in_memory.mjs";
|
|
8
8
|
import { a as defaultRenderMemories, c as defaultRenderStandingInstructions, d as defaultRenderThought, f as defaultRenderTrustedContent, i as defaultRenderFirstPartyRetrievables, l as defaultRenderThirdPartyPrivateRetrievables, m as defaultToolsToChatCompletionsTools, n as defaultFilterThoughts, o as defaultRenderRetrievableSafetyDirective, p as defaultRenderUntrustedContent, r as defaultRenderChatCompletionsSystemPrompt, s as defaultRenderRetrievables, t as defaultDescriptionToChatCompletionsJsonSchema, u as defaultRenderThirdPartyPublicRetrievables } from "../../../helpers-xhrQbMAG.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../../chunk-Ble4zEEl.js");
|
|
3
|
-
const require_common = require("../../../common-
|
|
3
|
+
const require_common = require("../../../common-CCDLEmQk.js");
|
|
4
4
|
require("../../../guards.cjs");
|
|
5
5
|
const require_batteries_llm_webllm_chat_completions_exceptions = require("./exceptions.cjs");
|
|
6
6
|
let _nhtio_validation = require("@nhtio/validation");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as byteStoreSchema } from "../../../common-
|
|
1
|
+
import { i as byteStoreSchema } from "../../../common-Bs4H4NOD.mjs";
|
|
2
2
|
import "../../../guards.mjs";
|
|
3
3
|
import { E_INVALID_WEBLLM_CHAT_COMPLETIONS_OPTIONS } from "./exceptions.mjs";
|
|
4
4
|
import { validator } from "@nhtio/validation";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../chunk-Ble4zEEl.js");
|
|
3
|
-
const require_tool_registry = require("../../tool_registry-
|
|
3
|
+
const require_tool_registry = require("../../tool_registry-qQXq9zs0.js");
|
|
4
4
|
require("../../guards.cjs");
|
|
5
5
|
//#region src/batteries/media/contracts.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../../chunk-Ble4zEEl.js");
|
|
3
|
-
const require_tool_registry = require("../../../tool_registry-
|
|
3
|
+
const require_tool_registry = require("../../../tool_registry-qQXq9zs0.js");
|
|
4
4
|
require("../../../guards.cjs");
|
|
5
5
|
const require_batteries_media_contracts = require("../contracts.cjs");
|
|
6
6
|
const require_exceptions = require("../../../exceptions-CQi_lNs1.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audio_decode.cjs","names":[],"sources":["../../../../src/batteries/media/engines/audio_decode.ts"],"sourcesContent":["/**\n * A cross-environment audio-decoding {@link @nhtio/adk/batteries/media/contracts!MediaEngine}\n * backed by the `audio-decode` package (pure JS/WASM codecs — no ffmpeg, no native bindings;\n * works in Node and browsers).\n *\n * @module @nhtio/adk/batteries/media/engines/audio_decode\n *\n * @remarks\n * Declares one convert capability: audio containers to the virtual `pcm` token (mp3 /\n * m4a-aac / ogg-vorbis / opus / flac / wav), downmixed to mono. The PCM output reports the\n * SOURCE sample rate in `meta.sampleRate` — the pipeline's transcribe step resamples to the\n * 16 kHz transcription engines expect. For exotic containers, compose an ffmpeg-backed\n * engine instead; the capability declaration is the seam.\n *\n * `audio-decode` is an optional peer dependency, lazily imported on first actual use.\n */\n\nimport { isError } from '@nhtio/adk/guards'\nimport { pcmToBytes, PCM_MIME } from '../contracts'\nimport { E_INVALID_MEDIA_PIPELINE_CONFIG } from '../exceptions'\nimport type { MediaEngine, ConvertRequest, ConvertResult } from '../contracts'\n\n/**\n * The decoded shapes audio-decode resolves to. Some codecs return an AudioBuffer-compatible\n * object (`numberOfChannels` + `getChannelData`); others (e.g. the wav path in Node) return a\n * plain `{ channelData: Float32Array[], sampleRate }` record. The engine normalizes both.\n */\
|
|
1
|
+
{"version":3,"file":"audio_decode.cjs","names":[],"sources":["../../../../src/batteries/media/engines/audio_decode.ts"],"sourcesContent":["/**\n * A cross-environment audio-decoding {@link @nhtio/adk/batteries/media/contracts!MediaEngine}\n * backed by the `audio-decode` package (pure JS/WASM codecs — no ffmpeg, no native bindings;\n * works in Node and browsers).\n *\n * @module @nhtio/adk/batteries/media/engines/audio_decode\n *\n * @remarks\n * Declares one convert capability: audio containers to the virtual `pcm` token (mp3 /\n * m4a-aac / ogg-vorbis / opus / flac / wav), downmixed to mono. The PCM output reports the\n * SOURCE sample rate in `meta.sampleRate` — the pipeline's transcribe step resamples to the\n * 16 kHz transcription engines expect. For exotic containers, compose an ffmpeg-backed\n * engine instead; the capability declaration is the seam.\n *\n * `audio-decode` is an optional peer dependency, lazily imported on first actual use.\n */\n\nimport { isError } from '@nhtio/adk/guards'\nimport { pcmToBytes, PCM_MIME } from '../contracts'\nimport { E_INVALID_MEDIA_PIPELINE_CONFIG } from '../exceptions'\nimport type { MediaEngine, ConvertRequest, ConvertResult } from '../contracts'\n\n/**\n * The decoded shapes audio-decode resolves to. Some codecs return an AudioBuffer-compatible\n * object (`numberOfChannels` + `getChannelData`); others (e.g. the wav path in Node) return a\n * plain `{ channelData: Float32Array[], sampleRate }` record. The engine normalizes both.\n */\nexport interface AudioBufferLike {\n /** Channel count when the AudioBuffer-compatible shape is returned. */\n numberOfChannels?: number\n /** Sample rate of the decoded audio, in Hz. Present on both shapes. */\n sampleRate: number\n /** Per-channel sample accessor on the AudioBuffer-compatible shape. */\n getChannelData?(channel: number): Float32Array\n /** Raw per-channel sample arrays on the plain-record shape. */\n channelData?: Float32Array[]\n}\n\n/** The decode function shape the `audio-decode` package exports. */\nexport type AudioDecodeFn = (bytes: Uint8Array | ArrayBuffer) => Promise<AudioBufferLike>\n\nconst channelsOf = (buffer: AudioBufferLike): Float32Array[] => {\n if (Array.isArray(buffer.channelData)) return buffer.channelData\n if (typeof buffer.getChannelData === 'function') {\n const count = buffer.numberOfChannels ?? 1\n return Array.from({ length: count }, (_, c) => buffer.getChannelData!(c))\n }\n throw new Error('audio-decode returned an unrecognized buffer shape')\n}\n\n/** Options for {@link audioDecodeEngine}. */\nexport interface AudioDecodeEngineOptions {\n /** Override the module resolution. Default: `import('audio-decode')`. */\n audioDecode?: () =>\n | AudioDecodeFn\n | { default: AudioDecodeFn }\n | Promise<AudioDecodeFn | { default: AudioDecodeFn }>\n}\n\n/**\n * Construct the audio-decode-backed engine.\n *\n * @param options - Optional module resolver override.\n * @returns The engine.\n */\nexport const audioDecodeEngine = (options: AudioDecodeEngineOptions = {}): MediaEngine => {\n let fnPromise: Promise<AudioDecodeFn> | undefined\n const getDecode = (): Promise<AudioDecodeFn> => {\n fnPromise ??= Promise.resolve(\n options.audioDecode ? options.audioDecode() : import('audio-decode')\n )\n .then((mod) => {\n const fn = typeof mod === 'function' ? mod : (mod as { default: AudioDecodeFn }).default\n if (typeof fn !== 'function') {\n throw new Error('audio-decode did not resolve to a decode function')\n }\n return fn\n })\n .catch((err) => {\n const detail = isError(err) ? err.message : String(err)\n throw new E_INVALID_MEDIA_PIPELINE_CONFIG([\n `the audio-decode engine could not load its peer dependency \"audio-decode\": ${detail} — install it (pnpm add audio-decode)`,\n ])\n })\n return fnPromise\n }\n\n const convert = async (request: ConvertRequest): Promise<ConvertResult> => {\n const decode = await getDecode()\n const buffer = await decode(request.bytes)\n const channels = channelsOf(buffer)\n let pcm: Float32Array\n if (channels.length <= 1) {\n pcm = channels[0]\n } else {\n // Downmix to mono by averaging channels.\n const length = channels[0].length\n const mono = new Float32Array(length)\n for (const data of channels) {\n for (let i = 0; i < length; i++) mono[i] += data[i] / channels.length\n }\n pcm = mono\n }\n return {\n outputs: [\n { bytes: pcmToBytes(pcm), mimeType: PCM_MIME, meta: { sampleRate: buffer.sampleRate } },\n ],\n }\n }\n\n return {\n id: 'audio-decode',\n converts: [\n {\n from: [\n 'audio/mpeg',\n 'audio/mp3',\n 'audio/mp4',\n 'audio/aac',\n 'audio/x-m4a',\n 'audio/ogg',\n 'audio/opus',\n 'audio/flac',\n 'audio/x-flac',\n 'audio/wav',\n 'audio/x-wav',\n 'audio/wave',\n ],\n to: ['pcm'],\n convert,\n },\n ],\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyCA,IAAM,cAAc,WAA4C;CAC9D,IAAI,MAAM,QAAQ,OAAO,WAAW,GAAG,OAAO,OAAO;CACrD,IAAI,OAAO,OAAO,mBAAmB,YAAY;EAC/C,MAAM,QAAQ,OAAO,oBAAoB;EACzC,OAAO,MAAM,KAAK,EAAE,QAAQ,MAAM,IAAI,GAAG,MAAM,OAAO,eAAgB,CAAC,CAAC;CAC1E;CACA,MAAM,IAAI,MAAM,oDAAoD;AACtE;;;;;;;AAiBA,IAAa,qBAAqB,UAAoC,CAAC,MAAmB;CACxF,IAAI;CACJ,MAAM,kBAA0C;EAC9C,cAAc,QAAQ,QACpB,QAAQ,cAAc,QAAQ,YAAY,IAAI,OAAO,eACvD,EACG,MAAM,QAAQ;GACb,MAAM,KAAK,OAAO,QAAQ,aAAa,MAAO,IAAmC;GACjF,IAAI,OAAO,OAAO,YAChB,MAAM,IAAI,MAAM,mDAAmD;GAErE,OAAO;EACT,CAAC,EACA,OAAO,QAAQ;GAEd,MAAM,IAAI,mBAAA,gCAAgC,CACxC,8EAFa,sBAAA,QAAQ,GAAG,IAAI,IAAI,UAAU,OAAO,GAAG,EAEiC,sCACvF,CAAC;EACH,CAAC;EACH,OAAO;CACT;CAEA,MAAM,UAAU,OAAO,YAAoD;EAEzE,MAAM,SAAS,OAAM,MADA,UAAU,GACH,QAAQ,KAAK;EACzC,MAAM,WAAW,WAAW,MAAM;EAClC,IAAI;EACJ,IAAI,SAAS,UAAU,GACrB,MAAM,SAAS;OACV;GAEL,MAAM,SAAS,SAAS,GAAG;GAC3B,MAAM,OAAO,IAAI,aAAa,MAAM;GACpC,KAAK,MAAM,QAAQ,UACjB,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,KAAK,KAAK,MAAM,KAAK,KAAK,SAAS;GAEjE,MAAM;EACR;EACA,OAAO,EACL,SAAS,CACP;GAAE,OAAO,kCAAA,WAAW,GAAG;GAAG,UAAU,kCAAA;GAAU,MAAM,EAAE,YAAY,OAAO,WAAW;EAAE,CACxF,EACF;CACF;CAEA,OAAO;EACL,IAAI;EACJ,UAAU,CACR;GACE,MAAM;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,IAAI,CAAC,KAAK;GACV;EACF,CACF;CACF;AACF"}
|
|
@@ -20,13 +20,18 @@ import type { MediaEngine } from "../contracts";
|
|
|
20
20
|
* object (`numberOfChannels` + `getChannelData`); others (e.g. the wav path in Node) return a
|
|
21
21
|
* plain `{ channelData: Float32Array[], sampleRate }` record. The engine normalizes both.
|
|
22
22
|
*/
|
|
23
|
-
interface AudioBufferLike {
|
|
23
|
+
export interface AudioBufferLike {
|
|
24
|
+
/** Channel count when the AudioBuffer-compatible shape is returned. */
|
|
24
25
|
numberOfChannels?: number;
|
|
26
|
+
/** Sample rate of the decoded audio, in Hz. Present on both shapes. */
|
|
25
27
|
sampleRate: number;
|
|
28
|
+
/** Per-channel sample accessor on the AudioBuffer-compatible shape. */
|
|
26
29
|
getChannelData?(channel: number): Float32Array;
|
|
30
|
+
/** Raw per-channel sample arrays on the plain-record shape. */
|
|
27
31
|
channelData?: Float32Array[];
|
|
28
32
|
}
|
|
29
|
-
|
|
33
|
+
/** The decode function shape the `audio-decode` package exports. */
|
|
34
|
+
export type AudioDecodeFn = (bytes: Uint8Array | ArrayBuffer) => Promise<AudioBufferLike>;
|
|
30
35
|
/** Options for {@link audioDecodeEngine}. */
|
|
31
36
|
export interface AudioDecodeEngineOptions {
|
|
32
37
|
/** Override the module resolution. Default: `import('audio-decode')`. */
|
|
@@ -43,4 +48,3 @@ export interface AudioDecodeEngineOptions {
|
|
|
43
48
|
* @returns The engine.
|
|
44
49
|
*/
|
|
45
50
|
export declare const audioDecodeEngine: (options?: AudioDecodeEngineOptions) => MediaEngine;
|
|
46
|
-
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as isError } from "../../../tool_registry-
|
|
1
|
+
import { o as isError } from "../../../tool_registry-D6gaqCO1.mjs";
|
|
2
2
|
import "../../../guards.mjs";
|
|
3
3
|
import { PCM_MIME, pcmToBytes } from "../contracts.mjs";
|
|
4
4
|
import { t as E_INVALID_MEDIA_PIPELINE_CONFIG } from "../../../exceptions-C7FSHEnV.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audio_decode.mjs","names":[],"sources":["../../../../src/batteries/media/engines/audio_decode.ts"],"sourcesContent":["/**\n * A cross-environment audio-decoding {@link @nhtio/adk/batteries/media/contracts!MediaEngine}\n * backed by the `audio-decode` package (pure JS/WASM codecs — no ffmpeg, no native bindings;\n * works in Node and browsers).\n *\n * @module @nhtio/adk/batteries/media/engines/audio_decode\n *\n * @remarks\n * Declares one convert capability: audio containers to the virtual `pcm` token (mp3 /\n * m4a-aac / ogg-vorbis / opus / flac / wav), downmixed to mono. The PCM output reports the\n * SOURCE sample rate in `meta.sampleRate` — the pipeline's transcribe step resamples to the\n * 16 kHz transcription engines expect. For exotic containers, compose an ffmpeg-backed\n * engine instead; the capability declaration is the seam.\n *\n * `audio-decode` is an optional peer dependency, lazily imported on first actual use.\n */\n\nimport { isError } from '@nhtio/adk/guards'\nimport { pcmToBytes, PCM_MIME } from '../contracts'\nimport { E_INVALID_MEDIA_PIPELINE_CONFIG } from '../exceptions'\nimport type { MediaEngine, ConvertRequest, ConvertResult } from '../contracts'\n\n/**\n * The decoded shapes audio-decode resolves to. Some codecs return an AudioBuffer-compatible\n * object (`numberOfChannels` + `getChannelData`); others (e.g. the wav path in Node) return a\n * plain `{ channelData: Float32Array[], sampleRate }` record. The engine normalizes both.\n */\
|
|
1
|
+
{"version":3,"file":"audio_decode.mjs","names":[],"sources":["../../../../src/batteries/media/engines/audio_decode.ts"],"sourcesContent":["/**\n * A cross-environment audio-decoding {@link @nhtio/adk/batteries/media/contracts!MediaEngine}\n * backed by the `audio-decode` package (pure JS/WASM codecs — no ffmpeg, no native bindings;\n * works in Node and browsers).\n *\n * @module @nhtio/adk/batteries/media/engines/audio_decode\n *\n * @remarks\n * Declares one convert capability: audio containers to the virtual `pcm` token (mp3 /\n * m4a-aac / ogg-vorbis / opus / flac / wav), downmixed to mono. The PCM output reports the\n * SOURCE sample rate in `meta.sampleRate` — the pipeline's transcribe step resamples to the\n * 16 kHz transcription engines expect. For exotic containers, compose an ffmpeg-backed\n * engine instead; the capability declaration is the seam.\n *\n * `audio-decode` is an optional peer dependency, lazily imported on first actual use.\n */\n\nimport { isError } from '@nhtio/adk/guards'\nimport { pcmToBytes, PCM_MIME } from '../contracts'\nimport { E_INVALID_MEDIA_PIPELINE_CONFIG } from '../exceptions'\nimport type { MediaEngine, ConvertRequest, ConvertResult } from '../contracts'\n\n/**\n * The decoded shapes audio-decode resolves to. Some codecs return an AudioBuffer-compatible\n * object (`numberOfChannels` + `getChannelData`); others (e.g. the wav path in Node) return a\n * plain `{ channelData: Float32Array[], sampleRate }` record. The engine normalizes both.\n */\nexport interface AudioBufferLike {\n /** Channel count when the AudioBuffer-compatible shape is returned. */\n numberOfChannels?: number\n /** Sample rate of the decoded audio, in Hz. Present on both shapes. */\n sampleRate: number\n /** Per-channel sample accessor on the AudioBuffer-compatible shape. */\n getChannelData?(channel: number): Float32Array\n /** Raw per-channel sample arrays on the plain-record shape. */\n channelData?: Float32Array[]\n}\n\n/** The decode function shape the `audio-decode` package exports. */\nexport type AudioDecodeFn = (bytes: Uint8Array | ArrayBuffer) => Promise<AudioBufferLike>\n\nconst channelsOf = (buffer: AudioBufferLike): Float32Array[] => {\n if (Array.isArray(buffer.channelData)) return buffer.channelData\n if (typeof buffer.getChannelData === 'function') {\n const count = buffer.numberOfChannels ?? 1\n return Array.from({ length: count }, (_, c) => buffer.getChannelData!(c))\n }\n throw new Error('audio-decode returned an unrecognized buffer shape')\n}\n\n/** Options for {@link audioDecodeEngine}. */\nexport interface AudioDecodeEngineOptions {\n /** Override the module resolution. Default: `import('audio-decode')`. */\n audioDecode?: () =>\n | AudioDecodeFn\n | { default: AudioDecodeFn }\n | Promise<AudioDecodeFn | { default: AudioDecodeFn }>\n}\n\n/**\n * Construct the audio-decode-backed engine.\n *\n * @param options - Optional module resolver override.\n * @returns The engine.\n */\nexport const audioDecodeEngine = (options: AudioDecodeEngineOptions = {}): MediaEngine => {\n let fnPromise: Promise<AudioDecodeFn> | undefined\n const getDecode = (): Promise<AudioDecodeFn> => {\n fnPromise ??= Promise.resolve(\n options.audioDecode ? options.audioDecode() : import('audio-decode')\n )\n .then((mod) => {\n const fn = typeof mod === 'function' ? mod : (mod as { default: AudioDecodeFn }).default\n if (typeof fn !== 'function') {\n throw new Error('audio-decode did not resolve to a decode function')\n }\n return fn\n })\n .catch((err) => {\n const detail = isError(err) ? err.message : String(err)\n throw new E_INVALID_MEDIA_PIPELINE_CONFIG([\n `the audio-decode engine could not load its peer dependency \"audio-decode\": ${detail} — install it (pnpm add audio-decode)`,\n ])\n })\n return fnPromise\n }\n\n const convert = async (request: ConvertRequest): Promise<ConvertResult> => {\n const decode = await getDecode()\n const buffer = await decode(request.bytes)\n const channels = channelsOf(buffer)\n let pcm: Float32Array\n if (channels.length <= 1) {\n pcm = channels[0]\n } else {\n // Downmix to mono by averaging channels.\n const length = channels[0].length\n const mono = new Float32Array(length)\n for (const data of channels) {\n for (let i = 0; i < length; i++) mono[i] += data[i] / channels.length\n }\n pcm = mono\n }\n return {\n outputs: [\n { bytes: pcmToBytes(pcm), mimeType: PCM_MIME, meta: { sampleRate: buffer.sampleRate } },\n ],\n }\n }\n\n return {\n id: 'audio-decode',\n converts: [\n {\n from: [\n 'audio/mpeg',\n 'audio/mp3',\n 'audio/mp4',\n 'audio/aac',\n 'audio/x-m4a',\n 'audio/ogg',\n 'audio/opus',\n 'audio/flac',\n 'audio/x-flac',\n 'audio/wav',\n 'audio/x-wav',\n 'audio/wave',\n ],\n to: ['pcm'],\n convert,\n },\n ],\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAyCA,IAAM,cAAc,WAA4C;CAC9D,IAAI,MAAM,QAAQ,OAAO,WAAW,GAAG,OAAO,OAAO;CACrD,IAAI,OAAO,OAAO,mBAAmB,YAAY;EAC/C,MAAM,QAAQ,OAAO,oBAAoB;EACzC,OAAO,MAAM,KAAK,EAAE,QAAQ,MAAM,IAAI,GAAG,MAAM,OAAO,eAAgB,CAAC,CAAC;CAC1E;CACA,MAAM,IAAI,MAAM,oDAAoD;AACtE;;;;;;;AAiBA,IAAa,qBAAqB,UAAoC,CAAC,MAAmB;CACxF,IAAI;CACJ,MAAM,kBAA0C;EAC9C,cAAc,QAAQ,QACpB,QAAQ,cAAc,QAAQ,YAAY,IAAI,OAAO,eACvD,EACG,MAAM,QAAQ;GACb,MAAM,KAAK,OAAO,QAAQ,aAAa,MAAO,IAAmC;GACjF,IAAI,OAAO,OAAO,YAChB,MAAM,IAAI,MAAM,mDAAmD;GAErE,OAAO;EACT,CAAC,EACA,OAAO,QAAQ;GAEd,MAAM,IAAI,gCAAgC,CACxC,8EAFa,QAAQ,GAAG,IAAI,IAAI,UAAU,OAAO,GAAG,EAEiC,sCACvF,CAAC;EACH,CAAC;EACH,OAAO;CACT;CAEA,MAAM,UAAU,OAAO,YAAoD;EAEzE,MAAM,SAAS,OAAM,MADA,UAAU,GACH,QAAQ,KAAK;EACzC,MAAM,WAAW,WAAW,MAAM;EAClC,IAAI;EACJ,IAAI,SAAS,UAAU,GACrB,MAAM,SAAS;OACV;GAEL,MAAM,SAAS,SAAS,GAAG;GAC3B,MAAM,OAAO,IAAI,aAAa,MAAM;GACpC,KAAK,MAAM,QAAQ,UACjB,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,KAAK,KAAK,MAAM,KAAK,KAAK,SAAS;GAEjE,MAAM;EACR;EACA,OAAO,EACL,SAAS,CACP;GAAE,OAAO,WAAW,GAAG;GAAG,UAAU;GAAU,MAAM,EAAE,YAAY,OAAO,WAAW;EAAE,CACxF,EACF;CACF;CAEA,OAAO;EACL,IAAI;EACJ,UAAU,CACR;GACE,MAAM;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,IAAI,CAAC,KAAK;GACV;EACF,CACF;CACF;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../../chunk-Ble4zEEl.js");
|
|
3
|
-
const require_tool_registry = require("../../../tool_registry-
|
|
3
|
+
const require_tool_registry = require("../../../tool_registry-qQXq9zs0.js");
|
|
4
4
|
require("../../../guards.cjs");
|
|
5
5
|
const require_exceptions = require("../../../exceptions-CQi_lNs1.js");
|
|
6
6
|
//#region src/batteries/media/engines/execa_executor.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as isObject, o as isError } from "../../../tool_registry-
|
|
1
|
+
import { c as isObject, o as isError } from "../../../tool_registry-D6gaqCO1.mjs";
|
|
2
2
|
import "../../../guards.mjs";
|
|
3
3
|
import { t as E_INVALID_MEDIA_PIPELINE_CONFIG } from "../../../exceptions-C7FSHEnV.mjs";
|
|
4
4
|
//#region src/batteries/media/engines/execa_executor.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../../chunk-Ble4zEEl.js");
|
|
3
|
-
const require_tool_registry = require("../../../tool_registry-
|
|
3
|
+
const require_tool_registry = require("../../../tool_registry-qQXq9zs0.js");
|
|
4
4
|
require("../../../guards.cjs");
|
|
5
5
|
const require_exceptions = require("../../../exceptions-CQi_lNs1.js");
|
|
6
6
|
//#region src/batteries/media/engines/fs_workspace.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as isError, s as isInstanceOf } from "../../../tool_registry-
|
|
1
|
+
import { o as isError, s as isInstanceOf } from "../../../tool_registry-D6gaqCO1.mjs";
|
|
2
2
|
import "../../../guards.mjs";
|
|
3
3
|
import { t as E_INVALID_MEDIA_PIPELINE_CONFIG } from "../../../exceptions-C7FSHEnV.mjs";
|
|
4
4
|
//#region src/batteries/media/engines/fs_workspace.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../../chunk-Ble4zEEl.js");
|
|
3
|
-
const require_tool_registry = require("../../../tool_registry-
|
|
3
|
+
const require_tool_registry = require("../../../tool_registry-qQXq9zs0.js");
|
|
4
4
|
require("../../../guards.cjs");
|
|
5
5
|
const require_exceptions = require("../../../exceptions-CQi_lNs1.js");
|
|
6
6
|
//#region src/batteries/media/engines/jimp.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as isError } from "../../../tool_registry-
|
|
1
|
+
import { o as isError } from "../../../tool_registry-D6gaqCO1.mjs";
|
|
2
2
|
import "../../../guards.mjs";
|
|
3
3
|
import { t as E_INVALID_MEDIA_PIPELINE_CONFIG } from "../../../exceptions-C7FSHEnV.mjs";
|
|
4
4
|
//#region src/batteries/media/engines/jimp.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../../chunk-Ble4zEEl.js");
|
|
3
|
-
const require_tool_registry = require("../../../tool_registry-
|
|
3
|
+
const require_tool_registry = require("../../../tool_registry-qQXq9zs0.js");
|
|
4
4
|
require("../../../guards.cjs");
|
|
5
5
|
const require_exceptions = require("../../../exceptions-CQi_lNs1.js");
|
|
6
6
|
//#region src/batteries/media/engines/sharp.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as isError } from "../../../tool_registry-
|
|
1
|
+
import { o as isError } from "../../../tool_registry-D6gaqCO1.mjs";
|
|
2
2
|
import "../../../guards.mjs";
|
|
3
3
|
import { t as E_INVALID_MEDIA_PIPELINE_CONFIG } from "../../../exceptions-C7FSHEnV.mjs";
|
|
4
4
|
//#region src/batteries/media/engines/sharp.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../../chunk-Ble4zEEl.js");
|
|
3
|
-
const require_tool_registry = require("../../../tool_registry-
|
|
3
|
+
const require_tool_registry = require("../../../tool_registry-qQXq9zs0.js");
|
|
4
4
|
require("../../../guards.cjs");
|
|
5
5
|
const require_exceptions = require("../../../exceptions-CQi_lNs1.js");
|
|
6
6
|
//#region src/batteries/media/engines/tesseract_js.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as isError } from "../../../tool_registry-
|
|
1
|
+
import { o as isError } from "../../../tool_registry-D6gaqCO1.mjs";
|
|
2
2
|
import "../../../guards.mjs";
|
|
3
3
|
import { t as E_INVALID_MEDIA_PIPELINE_CONFIG } from "../../../exceptions-C7FSHEnV.mjs";
|
|
4
4
|
//#region src/batteries/media/engines/tesseract_js.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../../chunk-Ble4zEEl.js");
|
|
3
|
-
const require_tool_registry = require("../../../tool_registry-
|
|
3
|
+
const require_tool_registry = require("../../../tool_registry-qQXq9zs0.js");
|
|
4
4
|
require("../../../guards.cjs");
|
|
5
5
|
const require_batteries_media_contracts = require("../contracts.cjs");
|
|
6
6
|
const require_exceptions = require("../../../exceptions-CQi_lNs1.js");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as isError } from "../../../tool_registry-
|
|
1
|
+
import { o as isError } from "../../../tool_registry-D6gaqCO1.mjs";
|
|
2
2
|
import "../../../guards.mjs";
|
|
3
3
|
import { PCM_MIME, bytesToPcm } from "../contracts.mjs";
|
|
4
4
|
import { t as E_INVALID_MEDIA_PIPELINE_CONFIG } from "../../../exceptions-C7FSHEnV.mjs";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../chunk-Ble4zEEl.js");
|
|
3
|
-
const require_tool_registry = require("../../tool_registry-
|
|
4
|
-
const require_tool = require("../../tool-
|
|
5
|
-
require("../../common-
|
|
6
|
-
const require_tool_call = require("../../tool_call-
|
|
7
|
-
const require_spooled_markdown_artifact = require("../../spooled_markdown_artifact-
|
|
3
|
+
const require_tool_registry = require("../../tool_registry-qQXq9zs0.js");
|
|
4
|
+
const require_tool = require("../../tool-aEQQxXve.js");
|
|
5
|
+
require("../../common-CCDLEmQk.js");
|
|
6
|
+
const require_tool_call = require("../../tool_call-B1VXAAmn.js");
|
|
7
|
+
const require_spooled_markdown_artifact = require("../../spooled_markdown_artifact-CyedUE_d.js");
|
|
8
8
|
require("../../guards.cjs");
|
|
9
9
|
const require_exceptions = require("../../exceptions-CQi_lNs1.js");
|
|
10
|
-
const require_validate = require("../../validate-
|
|
10
|
+
const require_validate = require("../../validate-DUnMQTt1.js");
|
|
11
11
|
let _nhtio_validation = require("@nhtio/validation");
|
|
12
12
|
//#region src/batteries/media/forge.ts
|
|
13
13
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { o as isError } from "../../tool_registry-
|
|
2
|
-
import { t as Tool } from "../../tool-
|
|
3
|
-
import "../../common-
|
|
4
|
-
import { n as Media } from "../../tool_call-
|
|
5
|
-
import { n as SpooledJsonArtifact } from "../../spooled_markdown_artifact-
|
|
1
|
+
import { o as isError } from "../../tool_registry-D6gaqCO1.mjs";
|
|
2
|
+
import { t as Tool } from "../../tool-AaLCDVjO.mjs";
|
|
3
|
+
import "../../common-Bs4H4NOD.mjs";
|
|
4
|
+
import { n as Media } from "../../tool_call-B2Ty8FuQ.mjs";
|
|
5
|
+
import { n as SpooledJsonArtifact } from "../../spooled_markdown_artifact-IcqG7qmv.mjs";
|
|
6
6
|
import "../../guards.mjs";
|
|
7
7
|
import { t as E_INVALID_MEDIA_PIPELINE_CONFIG } from "../../exceptions-C7FSHEnV.mjs";
|
|
8
|
-
import { m as toPipe, o as VERB_INDEX, s as foldVerb, t as availableVerbs } from "../../validate-
|
|
8
|
+
import { m as toPipe, o as VERB_INDEX, s as foldVerb, t as availableVerbs } from "../../validate-DokBgtG-.mjs";
|
|
9
9
|
import { validator } from "@nhtio/validation";
|
|
10
10
|
//#region src/batteries/media/forge.ts
|
|
11
11
|
/**
|
|
@@ -46,7 +46,7 @@ import type { EngineSelectionMiddlewareFn } from "./registry";
|
|
|
46
46
|
import type { MediaEngine, EngineResolver } from "./contracts";
|
|
47
47
|
import type { StepPayload, PlanResult, MediaStepMiddlewareFn } from "./runtime";
|
|
48
48
|
export { MediaChain } from "./builder";
|
|
49
|
-
export type { ChainInput, MediaChainRef, CellUpdate, ResizeOptions, SheetNamespace, SlidesNamespace, ImageNamespace, AudioNamespace, } from "./builder";
|
|
49
|
+
export type { ChainExecutor, ChainInput, MediaChainRef, CellUpdate, ResizeOptions, SheetNamespace, SlidesNamespace, ImageNamespace, AudioNamespace, } from "./builder";
|
|
50
50
|
export { toPipe, toOps, fromOps, isMediaRef, isRegExpRef } from "./plan";
|
|
51
51
|
export type { MediaPlan, MediaStep, MediaOp, MediaArgValue, MediaArgScalar, MediaArgJson, MediaRef, RegExpRef, SourceSpan, } from "./plan";
|
|
52
52
|
export { parsePipeRaw, lowerSegments } from "./pipe";
|
|
@@ -68,7 +68,7 @@ export type MediaRefResolver = (id: string) => StepPayload | Promise<StepPayload
|
|
|
68
68
|
export interface RunOptions {
|
|
69
69
|
/** Abort signal threaded into steps and engines. */
|
|
70
70
|
signal?: AbortSignal;
|
|
71
|
-
/** Per-run media-ref resolution, overriding the construction-time resolver (the agent forge uses this to resolve
|
|
71
|
+
/** Per-run media-ref resolution, overriding the construction-time resolver (the agent forge uses this to resolve `@id` refs against the current turn). */
|
|
72
72
|
resolveRef?: MediaRefResolver;
|
|
73
73
|
}
|
|
74
74
|
/** Configuration for {@link createMediaPipeline}. */
|