@nhtio/adk 0.1.0-master-e6c58205 → 0.1.0-master-89b47bec
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 +94 -0
- package/__vite-browser-external-CU7uua8b.mjs +9 -0
- package/__vite-browser-external-CU7uua8b.mjs.map +1 -0
- package/__vite-browser-external-DAHxjh-D.js +13 -0
- package/__vite-browser-external-DAHxjh-D.js.map +1 -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 +38 -8
- package/batteries/media/contracts.cjs.map +1 -1
- package/batteries/media/contracts.d.ts +86 -6
- package/batteries/media/contracts.mjs +37 -9
- package/batteries/media/contracts.mjs.map +1 -1
- package/batteries/media/engines/audio_decode.cjs +46 -6
- package/batteries/media/engines/audio_decode.cjs.map +1 -1
- package/batteries/media/engines/audio_decode.d.ts +9 -5
- package/batteries/media/engines/audio_decode.mjs +47 -7
- package/batteries/media/engines/audio_decode.mjs.map +1 -1
- package/batteries/media/engines/data.cjs +159 -0
- package/batteries/media/engines/data.cjs.map +1 -0
- package/batteries/media/engines/data.d.ts +36 -0
- package/batteries/media/engines/data.mjs +157 -0
- package/batteries/media/engines/data.mjs.map +1 -0
- package/batteries/media/engines/exceljs.cjs +290 -0
- package/batteries/media/engines/exceljs.cjs.map +1 -0
- package/batteries/media/engines/exceljs.d.ts +41 -0
- package/batteries/media/engines/exceljs.mjs +288 -0
- package/batteries/media/engines/exceljs.mjs.map +1 -0
- 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 +24 -2
- package/batteries/media/engines/jimp.cjs.map +1 -1
- package/batteries/media/engines/jimp.d.ts +3 -1
- package/batteries/media/engines/jimp.mjs +24 -2
- package/batteries/media/engines/jimp.mjs.map +1 -1
- package/batteries/media/engines/sharp.cjs +37 -4
- package/batteries/media/engines/sharp.cjs.map +1 -1
- package/batteries/media/engines/sharp.d.ts +5 -3
- package/batteries/media/engines/sharp.mjs +37 -4
- package/batteries/media/engines/sharp.mjs.map +1 -1
- package/batteries/media/engines/sheetjs.cjs +438 -0
- package/batteries/media/engines/sheetjs.cjs.map +1 -0
- package/batteries/media/engines/sheetjs.d.ts +51 -0
- package/batteries/media/engines/sheetjs.mjs +436 -0
- package/batteries/media/engines/sheetjs.mjs.map +1 -0
- package/batteries/media/engines/soffice.cjs +37 -3
- package/batteries/media/engines/soffice.cjs.map +1 -1
- package/batteries/media/engines/soffice.mjs +38 -4
- package/batteries/media/engines/soffice.mjs.map +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 +89 -20
- package/batteries/media/forge.cjs.map +1 -1
- package/batteries/media/forge.mjs +89 -20
- package/batteries/media/forge.mjs.map +1 -1
- package/batteries/media/formats.d.ts +9 -0
- package/batteries/media/index.d.ts +8 -6
- package/batteries/media/lint.cjs +270 -58
- package/batteries/media/lint.cjs.map +1 -1
- package/batteries/media/lint.d.ts +45 -0
- package/batteries/media/lint.mjs +267 -58
- package/batteries/media/lint.mjs.map +1 -1
- package/batteries/media/registry.d.ts +11 -2
- package/batteries/media/steps/data.d.ts +26 -0
- package/batteries/media/steps/doc.d.ts +17 -7
- package/batteries/media/steps/patch.d.ts +90 -0
- package/batteries/media/steps/sheet.d.ts +10 -6
- package/batteries/media/steps/text.d.ts +4 -1
- package/batteries/media/validate.d.ts +5 -0
- package/batteries/media/verbs.d.ts +12 -1
- package/batteries/media.cjs +869 -448
- package/batteries/media.cjs.map +1 -1
- package/batteries/media.mjs +829 -409
- package/batteries/media.mjs.map +1 -1
- package/batteries/storage/flydrive.cjs +3 -6
- package/batteries/storage/flydrive.cjs.map +1 -1
- package/batteries/storage/flydrive.mjs +3 -6
- package/batteries/storage/flydrive.mjs.map +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 +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 +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 +6 -6
- package/batteries/tools/memory.mjs +6 -6
- package/batteries/tools/parsing.cjs +4 -4
- package/batteries/tools/parsing.mjs +4 -4
- 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 +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 +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/web_retrieval.cjs +1 -1
- package/batteries/tools/web_retrieval.mjs +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/bundled_xlsx.d.ts +1075 -0
- package/{common-BxoznqbX.mjs → common-BQoFv108.mjs} +7 -7
- package/{common-BxoznqbX.mjs.map → common-BQoFv108.mjs.map} +1 -1
- package/{common-BBK2e5ro.js → common-DmDn4Gfl.js} +7 -7
- package/{common-BBK2e5ro.js.map → common-DmDn4Gfl.js.map} +1 -1
- package/common.cjs +7 -7
- package/common.mjs +7 -7
- package/{dispatch_runner-Hn5idJYx.js → dispatch_runner-BwplbCPr.js} +3 -3
- package/{dispatch_runner-Hn5idJYx.js.map → dispatch_runner-BwplbCPr.js.map} +1 -1
- package/{dispatch_runner-DUrpj0xR.mjs → dispatch_runner-C1ar_D7W.mjs} +3 -3
- package/{dispatch_runner-DUrpj0xR.mjs.map → dispatch_runner-C1ar_D7W.mjs.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/forge.cjs +4 -4
- package/forge.mjs +4 -4
- package/formats-CCylUHZw.mjs +161 -0
- package/formats-CCylUHZw.mjs.map +1 -0
- package/formats-DZVuqZUN.js +196 -0
- package/formats-DZVuqZUN.js.map +1 -0
- package/guards.cjs +8 -8
- package/guards.mjs +8 -8
- package/index.cjs +11 -11
- package/index.mjs +11 -11
- package/mcp/adk-docs-corpus.json +1 -1
- package/package.json +198 -182
- package/{scrapper-DLj_KkxK.mjs → scrapper-Dn2wXu0Y.mjs} +5 -5
- package/{scrapper-DLj_KkxK.mjs.map → scrapper-Dn2wXu0Y.mjs.map} +1 -1
- package/{scrapper-Cmf1CSA-.js → scrapper-mBZ0Odq7.js} +5 -5
- package/{scrapper-Cmf1CSA-.js.map → scrapper-mBZ0Odq7.js.map} +1 -1
- package/{searxng-BKs5s8Su.js → searxng-Dj-iP_Vz.js} +5 -5
- package/{searxng-BKs5s8Su.js.map → searxng-Dj-iP_Vz.js.map} +1 -1
- package/{searxng-BJ-aZcMz.mjs → searxng-DjFxtFf6.mjs} +5 -5
- package/{searxng-BJ-aZcMz.mjs.map → searxng-DjFxtFf6.mjs.map} +1 -1
- package/server.json +21 -0
- package/skills/adk-assembly/SKILL.md +2 -2
- package/{spooled_artifact-BR0IhU9y.js → spooled_artifact-BCmPrxZS.js} +3 -3
- package/{spooled_artifact-BR0IhU9y.js.map → spooled_artifact-BCmPrxZS.js.map} +1 -1
- package/{spooled_artifact-nTE6ujM8.mjs → spooled_artifact-DL36jnqA.mjs} +3 -3
- package/{spooled_artifact-nTE6ujM8.mjs.map → spooled_artifact-DL36jnqA.mjs.map} +1 -1
- package/spooled_artifact.cjs +2 -2
- package/spooled_artifact.mjs +2 -2
- package/{spooled_markdown_artifact-Dj3fNowz.js → spooled_markdown_artifact-CD4PrrpV.js} +3 -3
- package/{spooled_markdown_artifact-Dj3fNowz.js.map → spooled_markdown_artifact-CD4PrrpV.js.map} +1 -1
- package/{spooled_markdown_artifact-DIYzbQv8.mjs → spooled_markdown_artifact-Da-Xnebh.mjs} +3 -3
- package/{spooled_markdown_artifact-DIYzbQv8.mjs.map → spooled_markdown_artifact-Da-Xnebh.mjs.map} +1 -1
- package/{thought-Cde2Y_GK.mjs → thought-CtOoZUSE.mjs} +3 -3
- package/{thought-Cde2Y_GK.mjs.map → thought-CtOoZUSE.mjs.map} +1 -1
- package/{thought-BFtsnUTU.js → thought-eka4iUHa.js} +3 -3
- package/{thought-BFtsnUTU.js.map → thought-eka4iUHa.js.map} +1 -1
- package/{tool-CcxYxA5X.mjs → tool-CITF20yJ.mjs} +3 -3
- package/{tool-CcxYxA5X.mjs.map → tool-CITF20yJ.mjs.map} +1 -1
- package/{tool-B2nnkwNU.js → tool-Dhjca7rC.js} +3 -3
- package/{tool-B2nnkwNU.js.map → tool-Dhjca7rC.js.map} +1 -1
- package/{tool_call-BxL3eU1k.js → tool_call-Cyi0hUUc.js} +4 -4
- package/{tool_call-BxL3eU1k.js.map → tool_call-Cyi0hUUc.js.map} +1 -1
- package/{tool_call-B3MOog2R.mjs → tool_call-D_k36aI4.mjs} +4 -4
- package/{tool_call-B3MOog2R.mjs.map → tool_call-D_k36aI4.mjs.map} +1 -1
- package/{tool_registry-BaLUIzWz.mjs → tool_registry-CZ55mIti.mjs} +152 -143
- package/tool_registry-CZ55mIti.mjs.map +1 -0
- package/{tool_registry-BdKlPuHS.js → tool_registry-DwZ6pzN4.js} +151 -142
- package/tool_registry-DwZ6pzN4.js.map +1 -0
- package/{turn_runner-M2I8G2ok.js → turn_runner-CCZcsoDU.js} +5 -5
- package/{turn_runner-M2I8G2ok.js.map → turn_runner-CCZcsoDU.js.map} +1 -1
- package/{turn_runner-BV4BaZK9.mjs → turn_runner-DRPpVvsd.mjs} +5 -5
- package/{turn_runner-BV4BaZK9.mjs.map → turn_runner-DRPpVvsd.mjs.map} +1 -1
- package/turn_runner.cjs +1 -1
- package/turn_runner.mjs +1 -1
- package/{validate-JOHfh-BB.mjs → validate-C_hTnDBE.mjs} +95 -8
- package/validate-C_hTnDBE.mjs.map +1 -0
- package/{validate-DgDZkUKs.js → validate-gaSa9bsk.js} +95 -8
- package/validate-gaSa9bsk.js.map +1 -0
- package/xlsx-B0sTpEC2.js +30615 -0
- package/xlsx-B0sTpEC2.js.map +1 -0
- package/xlsx-DiMpn_Xv.mjs +30596 -0
- package/xlsx-DiMpn_Xv.mjs.map +1 -0
- package/xlsx.zahl-D2_Q-Xs4.mjs +6 -0
- package/xlsx.zahl-D2_Q-Xs4.mjs.map +1 -0
- package/xlsx.zahl-ZIcUQVv8.js +7 -0
- package/xlsx.zahl-ZIcUQVv8.js.map +1 -0
- package/tool_registry-BaLUIzWz.mjs.map +0 -1
- package/tool_registry-BdKlPuHS.js.map +0 -1
- package/validate-DgDZkUKs.js.map +0 -1
- package/validate-JOHfh-BB.mjs.map +0 -1
package/dispatch_runner.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dispatch_runner = require("./dispatch_runner-
|
|
3
|
+
const require_dispatch_runner = require("./dispatch_runner-BwplbCPr.js");
|
|
4
4
|
exports.DispatchRunner = require_dispatch_runner.DispatchRunner;
|
package/dispatch_runner.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as DispatchRunner } from "./dispatch_runner-
|
|
1
|
+
import { t as DispatchRunner } from "./dispatch_runner-C1ar_D7W.mjs";
|
|
2
2
|
export { DispatchRunner };
|
package/eslint.cjs
CHANGED
package/eslint.mjs
CHANGED
package/forge.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./chunk-Cek0wNdY.js");
|
|
3
|
-
const require_tool_registry = require("./tool_registry-
|
|
4
|
-
const require_tool = require("./tool-
|
|
5
|
-
const require_spooled_artifact = require("./spooled_artifact-
|
|
6
|
-
const require_tool_call = require("./tool_call-
|
|
3
|
+
const require_tool_registry = require("./tool_registry-DwZ6pzN4.js");
|
|
4
|
+
const require_tool = require("./tool-Dhjca7rC.js");
|
|
5
|
+
const require_spooled_artifact = require("./spooled_artifact-BCmPrxZS.js");
|
|
6
|
+
const require_tool_call = require("./tool_call-Cyi0hUUc.js");
|
|
7
7
|
exports.ArtifactTool = require_spooled_artifact.ArtifactTool;
|
|
8
8
|
exports.Tool = require_tool.Tool;
|
|
9
9
|
exports.ToolCall = require_tool_call.ToolCall;
|
package/forge.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as ToolRegistry } from "./tool_registry-
|
|
2
|
-
import { t as Tool } from "./tool-
|
|
3
|
-
import { i as ArtifactTool } from "./spooled_artifact-
|
|
4
|
-
import { t as ToolCall } from "./tool_call-
|
|
1
|
+
import { t as ToolRegistry } from "./tool_registry-CZ55mIti.mjs";
|
|
2
|
+
import { t as Tool } from "./tool-CITF20yJ.mjs";
|
|
3
|
+
import { i as ArtifactTool } from "./spooled_artifact-DL36jnqA.mjs";
|
|
4
|
+
import { t as ToolCall } from "./tool_call-D_k36aI4.mjs";
|
|
5
5
|
export { ArtifactTool, Tool, ToolCall, ToolRegistry };
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
//#region src/batteries/media/formats.ts
|
|
2
|
+
/** Well-known MIME constants used across the battery. */
|
|
3
|
+
var MIME = {
|
|
4
|
+
DOCX: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
5
|
+
XLSX: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
6
|
+
PPTX: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
7
|
+
ODT: "application/vnd.oasis.opendocument.text",
|
|
8
|
+
ODS: "application/vnd.oasis.opendocument.spreadsheet",
|
|
9
|
+
ODP: "application/vnd.oasis.opendocument.presentation",
|
|
10
|
+
PDF: "application/pdf",
|
|
11
|
+
DOC: "application/msword",
|
|
12
|
+
XLS: "application/vnd.ms-excel",
|
|
13
|
+
PPT: "application/vnd.ms-powerpoint",
|
|
14
|
+
PAGES: "application/x-iwork-pages-sffpages",
|
|
15
|
+
NUMBERS: "application/x-iwork-numbers-sffnumbers",
|
|
16
|
+
KEYNOTE: "application/x-iwork-keynote-sffkey",
|
|
17
|
+
XLSM: "application/vnd.ms-excel.sheet.macroEnabled.12",
|
|
18
|
+
XLSB: "application/vnd.ms-excel.sheet.binary.macroEnabled.12",
|
|
19
|
+
FODS: "application/vnd.oasis.opendocument.spreadsheet-flat-xml",
|
|
20
|
+
SYLK: "application/x-sylk",
|
|
21
|
+
DIF: "application/x-dif",
|
|
22
|
+
DBF: "application/x-dbf",
|
|
23
|
+
TXT: "text/plain",
|
|
24
|
+
MD: "text/markdown",
|
|
25
|
+
CSV: "text/csv",
|
|
26
|
+
HTML: "text/html",
|
|
27
|
+
JSON: "application/json",
|
|
28
|
+
YAML: "application/yaml",
|
|
29
|
+
PNG: "image/png",
|
|
30
|
+
JPEG: "image/jpeg",
|
|
31
|
+
WEBP: "image/webp",
|
|
32
|
+
TIFF: "image/tiff",
|
|
33
|
+
AVIF: "image/avif",
|
|
34
|
+
WAV: "audio/wav",
|
|
35
|
+
MP3: "audio/mpeg"
|
|
36
|
+
};
|
|
37
|
+
/** Legacy Office MIME types (extraction only — mutation is rejected). */
|
|
38
|
+
var LEGACY_OFFICE_MIMES = new Set([
|
|
39
|
+
MIME.DOC,
|
|
40
|
+
MIME.XLS,
|
|
41
|
+
MIME.PPT
|
|
42
|
+
]);
|
|
43
|
+
/** Apple iWork MIME types (extraction only — mutation is rejected). */
|
|
44
|
+
var IWORK_MIMES = new Set([
|
|
45
|
+
MIME.PAGES,
|
|
46
|
+
MIME.NUMBERS,
|
|
47
|
+
MIME.KEYNOTE
|
|
48
|
+
]);
|
|
49
|
+
/** Every MIME the battery classifies as a spreadsheet (drives verb applicability + normalize). */
|
|
50
|
+
var SPREADSHEET_MIMES = new Set([
|
|
51
|
+
MIME.XLSX,
|
|
52
|
+
MIME.XLSM,
|
|
53
|
+
MIME.XLSB,
|
|
54
|
+
MIME.ODS,
|
|
55
|
+
MIME.FODS,
|
|
56
|
+
MIME.XLS,
|
|
57
|
+
MIME.CSV,
|
|
58
|
+
MIME.NUMBERS,
|
|
59
|
+
MIME.SYLK,
|
|
60
|
+
MIME.DIF,
|
|
61
|
+
MIME.DBF
|
|
62
|
+
]);
|
|
63
|
+
var PRESENTATION_MIMES = new Set([
|
|
64
|
+
MIME.PPTX,
|
|
65
|
+
MIME.ODP,
|
|
66
|
+
MIME.PPT,
|
|
67
|
+
MIME.KEYNOTE
|
|
68
|
+
]);
|
|
69
|
+
var DOCUMENT_MIMES = new Set([
|
|
70
|
+
MIME.PDF,
|
|
71
|
+
MIME.DOCX,
|
|
72
|
+
MIME.ODT,
|
|
73
|
+
MIME.DOC,
|
|
74
|
+
MIME.PAGES,
|
|
75
|
+
MIME.TXT,
|
|
76
|
+
MIME.MD,
|
|
77
|
+
MIME.HTML,
|
|
78
|
+
MIME.JSON,
|
|
79
|
+
MIME.YAML,
|
|
80
|
+
"application/rtf",
|
|
81
|
+
"text/rtf"
|
|
82
|
+
]);
|
|
83
|
+
/**
|
|
84
|
+
* Classify a MIME type into the verb table's broad format family.
|
|
85
|
+
*
|
|
86
|
+
* @param mimeType - The media MIME type.
|
|
87
|
+
* @returns The family used by verb-applicability checks.
|
|
88
|
+
*/
|
|
89
|
+
var familyOf = (mimeType) => {
|
|
90
|
+
const mime = mimeType.toLowerCase().split(";")[0].trim();
|
|
91
|
+
if (SPREADSHEET_MIMES.has(mime)) return "spreadsheet";
|
|
92
|
+
if (PRESENTATION_MIMES.has(mime)) return "presentation";
|
|
93
|
+
if (DOCUMENT_MIMES.has(mime)) return "document";
|
|
94
|
+
if (mime.startsWith("image/")) return "image";
|
|
95
|
+
if (mime.startsWith("audio/")) return "audio";
|
|
96
|
+
if (mime.startsWith("text/")) return "document";
|
|
97
|
+
return "document";
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Reason a mutation verb cannot run against this MIME type, or `undefined` when mutation is
|
|
101
|
+
* allowed. Returns a reason string (not a throw) so callers compose model-actionable failures.
|
|
102
|
+
*
|
|
103
|
+
* @param mimeType - The media MIME type.
|
|
104
|
+
* @returns A human-readable reason, or `undefined` when mutation is supported.
|
|
105
|
+
*/
|
|
106
|
+
var unsupportedForMutationReason = (mimeType) => {
|
|
107
|
+
const mime = mimeType.toLowerCase().split(";")[0].trim();
|
|
108
|
+
if (LEGACY_OFFICE_MIMES.has(mime)) return `legacy Office format (${mime}) cannot be mutated in place and no configured engine converts it — convert it first (e.g. convert to=docx)`;
|
|
109
|
+
if (IWORK_MIMES.has(mime)) return `Apple iWork format (${mime}) cannot be mutated in place and no configured engine converts it`;
|
|
110
|
+
};
|
|
111
|
+
/** A small extension → MIME lookup for filenames produced by transforms. */
|
|
112
|
+
var EXT_TO_MIME = {
|
|
113
|
+
pdf: MIME.PDF,
|
|
114
|
+
docx: MIME.DOCX,
|
|
115
|
+
xlsx: MIME.XLSX,
|
|
116
|
+
pptx: MIME.PPTX,
|
|
117
|
+
odt: MIME.ODT,
|
|
118
|
+
ods: MIME.ODS,
|
|
119
|
+
odp: MIME.ODP,
|
|
120
|
+
doc: MIME.DOC,
|
|
121
|
+
xls: MIME.XLS,
|
|
122
|
+
ppt: MIME.PPT,
|
|
123
|
+
xlsm: MIME.XLSM,
|
|
124
|
+
xlsb: MIME.XLSB,
|
|
125
|
+
fods: MIME.FODS,
|
|
126
|
+
sylk: MIME.SYLK,
|
|
127
|
+
dif: MIME.DIF,
|
|
128
|
+
dbf: MIME.DBF,
|
|
129
|
+
numbers: MIME.NUMBERS,
|
|
130
|
+
txt: MIME.TXT,
|
|
131
|
+
md: MIME.MD,
|
|
132
|
+
csv: MIME.CSV,
|
|
133
|
+
html: MIME.HTML,
|
|
134
|
+
json: MIME.JSON,
|
|
135
|
+
yaml: MIME.YAML,
|
|
136
|
+
yml: MIME.YAML,
|
|
137
|
+
rtf: "application/rtf",
|
|
138
|
+
png: MIME.PNG,
|
|
139
|
+
jpg: MIME.JPEG,
|
|
140
|
+
jpeg: MIME.JPEG,
|
|
141
|
+
webp: MIME.WEBP,
|
|
142
|
+
tiff: MIME.TIFF,
|
|
143
|
+
avif: MIME.AVIF,
|
|
144
|
+
wav: MIME.WAV,
|
|
145
|
+
mp3: MIME.MP3
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Replace (or add) a filename's extension.
|
|
149
|
+
*
|
|
150
|
+
* @param filename - The original filename.
|
|
151
|
+
* @param ext - The new extension, without the dot.
|
|
152
|
+
* @returns The filename with the new extension.
|
|
153
|
+
*/
|
|
154
|
+
var replaceExtension = (filename, ext) => {
|
|
155
|
+
const dot = filename.lastIndexOf(".");
|
|
156
|
+
return `${dot > 0 ? filename.slice(0, dot) : filename}.${ext}`;
|
|
157
|
+
};
|
|
158
|
+
//#endregion
|
|
159
|
+
export { replaceExtension as a, familyOf as i, MIME as n, unsupportedForMutationReason as o, SPREADSHEET_MIMES as r, EXT_TO_MIME as t };
|
|
160
|
+
|
|
161
|
+
//# sourceMappingURL=formats-CCylUHZw.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formats-CCylUHZw.mjs","names":[],"sources":["../src/batteries/media/formats.ts"],"sourcesContent":["/**\n * MIME tables and format-family classification for the media pipeline.\n *\n * @remarks\n * Internal sibling of the `@nhtio/adk/batteries/media` entry. Ported from the source server's\n * `format_families.ts` support tiers, reshaped for the DSL's verb-applicability checks:\n *\n * - Tier 1 (full read + mutate): OOXML (docx/xlsx/pptx) and ODF (odt/ods/odp, via a normalize\n * engine), plus PDF for page-level operations.\n * - Tier 2 (extraction only): legacy Office (doc/xls/ppt) and Apple iWork — mutation verbs\n * reject these with a reason string rather than a throw, so callers can surface\n * model-actionable failures.\n * - Everything else classifies by top-level MIME family (image/audio/text).\n */\n\nimport type { FormatFamily } from './verbs'\n\n/** Well-known MIME constants used across the battery. */\nexport const MIME = {\n DOCX: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n XLSX: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n PPTX: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n ODT: 'application/vnd.oasis.opendocument.text',\n ODS: 'application/vnd.oasis.opendocument.spreadsheet',\n ODP: 'application/vnd.oasis.opendocument.presentation',\n PDF: 'application/pdf',\n DOC: 'application/msword',\n XLS: 'application/vnd.ms-excel',\n PPT: 'application/vnd.ms-powerpoint',\n PAGES: 'application/x-iwork-pages-sffpages',\n NUMBERS: 'application/x-iwork-numbers-sffnumbers',\n KEYNOTE: 'application/x-iwork-keynote-sffkey',\n XLSM: 'application/vnd.ms-excel.sheet.macroEnabled.12',\n XLSB: 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',\n FODS: 'application/vnd.oasis.opendocument.spreadsheet-flat-xml',\n SYLK: 'application/x-sylk',\n DIF: 'application/x-dif',\n DBF: 'application/x-dbf',\n TXT: 'text/plain',\n MD: 'text/markdown',\n CSV: 'text/csv',\n HTML: 'text/html',\n JSON: 'application/json',\n YAML: 'application/yaml',\n PNG: 'image/png',\n JPEG: 'image/jpeg',\n WEBP: 'image/webp',\n TIFF: 'image/tiff',\n AVIF: 'image/avif',\n WAV: 'audio/wav',\n MP3: 'audio/mpeg',\n} as const\n\n/** Legacy Office MIME types (extraction only — mutation is rejected). */\nexport const LEGACY_OFFICE_MIMES: ReadonlySet<string> = new Set([MIME.DOC, MIME.XLS, MIME.PPT])\n\n/** Apple iWork MIME types (extraction only — mutation is rejected). */\nexport const IWORK_MIMES: ReadonlySet<string> = new Set([MIME.PAGES, MIME.NUMBERS, MIME.KEYNOTE])\n\n/** Every MIME the battery classifies as a spreadsheet (drives verb applicability + normalize). */\nexport const SPREADSHEET_MIMES: ReadonlySet<string> = new Set([\n MIME.XLSX,\n MIME.XLSM,\n MIME.XLSB,\n MIME.ODS,\n MIME.FODS,\n MIME.XLS,\n MIME.CSV,\n MIME.NUMBERS,\n MIME.SYLK,\n MIME.DIF,\n MIME.DBF,\n])\nconst PRESENTATION_MIMES: ReadonlySet<string> = new Set([\n MIME.PPTX,\n MIME.ODP,\n MIME.PPT,\n MIME.KEYNOTE,\n])\nconst DOCUMENT_MIMES: ReadonlySet<string> = new Set([\n MIME.PDF,\n MIME.DOCX,\n MIME.ODT,\n MIME.DOC,\n MIME.PAGES,\n MIME.TXT,\n MIME.MD,\n MIME.HTML,\n MIME.JSON,\n MIME.YAML,\n 'application/rtf',\n 'text/rtf',\n])\n\n/**\n * Classify a MIME type into the verb table's broad format family.\n *\n * @param mimeType - The media MIME type.\n * @returns The family used by verb-applicability checks.\n */\nexport const familyOf = (mimeType: string): FormatFamily => {\n const mime = mimeType.toLowerCase().split(';')[0].trim()\n if (SPREADSHEET_MIMES.has(mime)) return 'spreadsheet'\n if (PRESENTATION_MIMES.has(mime)) return 'presentation'\n if (DOCUMENT_MIMES.has(mime)) return 'document'\n if (mime.startsWith('image/')) return 'image'\n if (mime.startsWith('audio/')) return 'audio'\n if (mime.startsWith('text/')) return 'document'\n return 'document'\n}\n\n/**\n * Reason a mutation verb cannot run against this MIME type, or `undefined` when mutation is\n * allowed. Returns a reason string (not a throw) so callers compose model-actionable failures.\n *\n * @param mimeType - The media MIME type.\n * @returns A human-readable reason, or `undefined` when mutation is supported.\n */\nexport const unsupportedForMutationReason = (mimeType: string): string | undefined => {\n const mime = mimeType.toLowerCase().split(';')[0].trim()\n if (LEGACY_OFFICE_MIMES.has(mime)) {\n return `legacy Office format (${mime}) cannot be mutated in place and no configured engine converts it — convert it first (e.g. convert to=docx)`\n }\n if (IWORK_MIMES.has(mime)) {\n return `Apple iWork format (${mime}) cannot be mutated in place and no configured engine converts it`\n }\n return undefined\n}\n\n/** A small extension → MIME lookup for filenames produced by transforms. */\nexport const EXT_TO_MIME: Readonly<Record<string, string>> = {\n pdf: MIME.PDF,\n docx: MIME.DOCX,\n xlsx: MIME.XLSX,\n pptx: MIME.PPTX,\n odt: MIME.ODT,\n ods: MIME.ODS,\n odp: MIME.ODP,\n doc: MIME.DOC,\n xls: MIME.XLS,\n ppt: MIME.PPT,\n xlsm: MIME.XLSM,\n xlsb: MIME.XLSB,\n fods: MIME.FODS,\n sylk: MIME.SYLK,\n dif: MIME.DIF,\n dbf: MIME.DBF,\n numbers: MIME.NUMBERS,\n txt: MIME.TXT,\n md: MIME.MD,\n csv: MIME.CSV,\n html: MIME.HTML,\n json: MIME.JSON,\n yaml: MIME.YAML,\n yml: MIME.YAML,\n rtf: 'application/rtf',\n png: MIME.PNG,\n jpg: MIME.JPEG,\n jpeg: MIME.JPEG,\n webp: MIME.WEBP,\n tiff: MIME.TIFF,\n avif: MIME.AVIF,\n wav: MIME.WAV,\n mp3: MIME.MP3,\n}\n\n/**\n * Replace (or add) a filename's extension.\n *\n * @param filename - The original filename.\n * @param ext - The new extension, without the dot.\n * @returns The filename with the new extension.\n */\nexport const replaceExtension = (filename: string, ext: string): string => {\n const dot = filename.lastIndexOf('.')\n const base = dot > 0 ? filename.slice(0, dot) : filename\n return `${base}.${ext}`\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
//#region src/batteries/media/formats.ts
|
|
2
|
+
/** Well-known MIME constants used across the battery. */
|
|
3
|
+
var MIME = {
|
|
4
|
+
DOCX: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
5
|
+
XLSX: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
6
|
+
PPTX: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
7
|
+
ODT: "application/vnd.oasis.opendocument.text",
|
|
8
|
+
ODS: "application/vnd.oasis.opendocument.spreadsheet",
|
|
9
|
+
ODP: "application/vnd.oasis.opendocument.presentation",
|
|
10
|
+
PDF: "application/pdf",
|
|
11
|
+
DOC: "application/msword",
|
|
12
|
+
XLS: "application/vnd.ms-excel",
|
|
13
|
+
PPT: "application/vnd.ms-powerpoint",
|
|
14
|
+
PAGES: "application/x-iwork-pages-sffpages",
|
|
15
|
+
NUMBERS: "application/x-iwork-numbers-sffnumbers",
|
|
16
|
+
KEYNOTE: "application/x-iwork-keynote-sffkey",
|
|
17
|
+
XLSM: "application/vnd.ms-excel.sheet.macroEnabled.12",
|
|
18
|
+
XLSB: "application/vnd.ms-excel.sheet.binary.macroEnabled.12",
|
|
19
|
+
FODS: "application/vnd.oasis.opendocument.spreadsheet-flat-xml",
|
|
20
|
+
SYLK: "application/x-sylk",
|
|
21
|
+
DIF: "application/x-dif",
|
|
22
|
+
DBF: "application/x-dbf",
|
|
23
|
+
TXT: "text/plain",
|
|
24
|
+
MD: "text/markdown",
|
|
25
|
+
CSV: "text/csv",
|
|
26
|
+
HTML: "text/html",
|
|
27
|
+
JSON: "application/json",
|
|
28
|
+
YAML: "application/yaml",
|
|
29
|
+
PNG: "image/png",
|
|
30
|
+
JPEG: "image/jpeg",
|
|
31
|
+
WEBP: "image/webp",
|
|
32
|
+
TIFF: "image/tiff",
|
|
33
|
+
AVIF: "image/avif",
|
|
34
|
+
WAV: "audio/wav",
|
|
35
|
+
MP3: "audio/mpeg"
|
|
36
|
+
};
|
|
37
|
+
/** Legacy Office MIME types (extraction only — mutation is rejected). */
|
|
38
|
+
var LEGACY_OFFICE_MIMES = new Set([
|
|
39
|
+
MIME.DOC,
|
|
40
|
+
MIME.XLS,
|
|
41
|
+
MIME.PPT
|
|
42
|
+
]);
|
|
43
|
+
/** Apple iWork MIME types (extraction only — mutation is rejected). */
|
|
44
|
+
var IWORK_MIMES = new Set([
|
|
45
|
+
MIME.PAGES,
|
|
46
|
+
MIME.NUMBERS,
|
|
47
|
+
MIME.KEYNOTE
|
|
48
|
+
]);
|
|
49
|
+
/** Every MIME the battery classifies as a spreadsheet (drives verb applicability + normalize). */
|
|
50
|
+
var SPREADSHEET_MIMES = new Set([
|
|
51
|
+
MIME.XLSX,
|
|
52
|
+
MIME.XLSM,
|
|
53
|
+
MIME.XLSB,
|
|
54
|
+
MIME.ODS,
|
|
55
|
+
MIME.FODS,
|
|
56
|
+
MIME.XLS,
|
|
57
|
+
MIME.CSV,
|
|
58
|
+
MIME.NUMBERS,
|
|
59
|
+
MIME.SYLK,
|
|
60
|
+
MIME.DIF,
|
|
61
|
+
MIME.DBF
|
|
62
|
+
]);
|
|
63
|
+
var PRESENTATION_MIMES = new Set([
|
|
64
|
+
MIME.PPTX,
|
|
65
|
+
MIME.ODP,
|
|
66
|
+
MIME.PPT,
|
|
67
|
+
MIME.KEYNOTE
|
|
68
|
+
]);
|
|
69
|
+
var DOCUMENT_MIMES = new Set([
|
|
70
|
+
MIME.PDF,
|
|
71
|
+
MIME.DOCX,
|
|
72
|
+
MIME.ODT,
|
|
73
|
+
MIME.DOC,
|
|
74
|
+
MIME.PAGES,
|
|
75
|
+
MIME.TXT,
|
|
76
|
+
MIME.MD,
|
|
77
|
+
MIME.HTML,
|
|
78
|
+
MIME.JSON,
|
|
79
|
+
MIME.YAML,
|
|
80
|
+
"application/rtf",
|
|
81
|
+
"text/rtf"
|
|
82
|
+
]);
|
|
83
|
+
/**
|
|
84
|
+
* Classify a MIME type into the verb table's broad format family.
|
|
85
|
+
*
|
|
86
|
+
* @param mimeType - The media MIME type.
|
|
87
|
+
* @returns The family used by verb-applicability checks.
|
|
88
|
+
*/
|
|
89
|
+
var familyOf = (mimeType) => {
|
|
90
|
+
const mime = mimeType.toLowerCase().split(";")[0].trim();
|
|
91
|
+
if (SPREADSHEET_MIMES.has(mime)) return "spreadsheet";
|
|
92
|
+
if (PRESENTATION_MIMES.has(mime)) return "presentation";
|
|
93
|
+
if (DOCUMENT_MIMES.has(mime)) return "document";
|
|
94
|
+
if (mime.startsWith("image/")) return "image";
|
|
95
|
+
if (mime.startsWith("audio/")) return "audio";
|
|
96
|
+
if (mime.startsWith("text/")) return "document";
|
|
97
|
+
return "document";
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Reason a mutation verb cannot run against this MIME type, or `undefined` when mutation is
|
|
101
|
+
* allowed. Returns a reason string (not a throw) so callers compose model-actionable failures.
|
|
102
|
+
*
|
|
103
|
+
* @param mimeType - The media MIME type.
|
|
104
|
+
* @returns A human-readable reason, or `undefined` when mutation is supported.
|
|
105
|
+
*/
|
|
106
|
+
var unsupportedForMutationReason = (mimeType) => {
|
|
107
|
+
const mime = mimeType.toLowerCase().split(";")[0].trim();
|
|
108
|
+
if (LEGACY_OFFICE_MIMES.has(mime)) return `legacy Office format (${mime}) cannot be mutated in place and no configured engine converts it — convert it first (e.g. convert to=docx)`;
|
|
109
|
+
if (IWORK_MIMES.has(mime)) return `Apple iWork format (${mime}) cannot be mutated in place and no configured engine converts it`;
|
|
110
|
+
};
|
|
111
|
+
/** A small extension → MIME lookup for filenames produced by transforms. */
|
|
112
|
+
var EXT_TO_MIME = {
|
|
113
|
+
pdf: MIME.PDF,
|
|
114
|
+
docx: MIME.DOCX,
|
|
115
|
+
xlsx: MIME.XLSX,
|
|
116
|
+
pptx: MIME.PPTX,
|
|
117
|
+
odt: MIME.ODT,
|
|
118
|
+
ods: MIME.ODS,
|
|
119
|
+
odp: MIME.ODP,
|
|
120
|
+
doc: MIME.DOC,
|
|
121
|
+
xls: MIME.XLS,
|
|
122
|
+
ppt: MIME.PPT,
|
|
123
|
+
xlsm: MIME.XLSM,
|
|
124
|
+
xlsb: MIME.XLSB,
|
|
125
|
+
fods: MIME.FODS,
|
|
126
|
+
sylk: MIME.SYLK,
|
|
127
|
+
dif: MIME.DIF,
|
|
128
|
+
dbf: MIME.DBF,
|
|
129
|
+
numbers: MIME.NUMBERS,
|
|
130
|
+
txt: MIME.TXT,
|
|
131
|
+
md: MIME.MD,
|
|
132
|
+
csv: MIME.CSV,
|
|
133
|
+
html: MIME.HTML,
|
|
134
|
+
json: MIME.JSON,
|
|
135
|
+
yaml: MIME.YAML,
|
|
136
|
+
yml: MIME.YAML,
|
|
137
|
+
rtf: "application/rtf",
|
|
138
|
+
png: MIME.PNG,
|
|
139
|
+
jpg: MIME.JPEG,
|
|
140
|
+
jpeg: MIME.JPEG,
|
|
141
|
+
webp: MIME.WEBP,
|
|
142
|
+
tiff: MIME.TIFF,
|
|
143
|
+
avif: MIME.AVIF,
|
|
144
|
+
wav: MIME.WAV,
|
|
145
|
+
mp3: MIME.MP3
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Replace (or add) a filename's extension.
|
|
149
|
+
*
|
|
150
|
+
* @param filename - The original filename.
|
|
151
|
+
* @param ext - The new extension, without the dot.
|
|
152
|
+
* @returns The filename with the new extension.
|
|
153
|
+
*/
|
|
154
|
+
var replaceExtension = (filename, ext) => {
|
|
155
|
+
const dot = filename.lastIndexOf(".");
|
|
156
|
+
return `${dot > 0 ? filename.slice(0, dot) : filename}.${ext}`;
|
|
157
|
+
};
|
|
158
|
+
//#endregion
|
|
159
|
+
Object.defineProperty(exports, "EXT_TO_MIME", {
|
|
160
|
+
enumerable: true,
|
|
161
|
+
get: function() {
|
|
162
|
+
return EXT_TO_MIME;
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
Object.defineProperty(exports, "MIME", {
|
|
166
|
+
enumerable: true,
|
|
167
|
+
get: function() {
|
|
168
|
+
return MIME;
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
Object.defineProperty(exports, "SPREADSHEET_MIMES", {
|
|
172
|
+
enumerable: true,
|
|
173
|
+
get: function() {
|
|
174
|
+
return SPREADSHEET_MIMES;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
Object.defineProperty(exports, "familyOf", {
|
|
178
|
+
enumerable: true,
|
|
179
|
+
get: function() {
|
|
180
|
+
return familyOf;
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
Object.defineProperty(exports, "replaceExtension", {
|
|
184
|
+
enumerable: true,
|
|
185
|
+
get: function() {
|
|
186
|
+
return replaceExtension;
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
Object.defineProperty(exports, "unsupportedForMutationReason", {
|
|
190
|
+
enumerable: true,
|
|
191
|
+
get: function() {
|
|
192
|
+
return unsupportedForMutationReason;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
//# sourceMappingURL=formats-DZVuqZUN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formats-DZVuqZUN.js","names":[],"sources":["../src/batteries/media/formats.ts"],"sourcesContent":["/**\n * MIME tables and format-family classification for the media pipeline.\n *\n * @remarks\n * Internal sibling of the `@nhtio/adk/batteries/media` entry. Ported from the source server's\n * `format_families.ts` support tiers, reshaped for the DSL's verb-applicability checks:\n *\n * - Tier 1 (full read + mutate): OOXML (docx/xlsx/pptx) and ODF (odt/ods/odp, via a normalize\n * engine), plus PDF for page-level operations.\n * - Tier 2 (extraction only): legacy Office (doc/xls/ppt) and Apple iWork — mutation verbs\n * reject these with a reason string rather than a throw, so callers can surface\n * model-actionable failures.\n * - Everything else classifies by top-level MIME family (image/audio/text).\n */\n\nimport type { FormatFamily } from './verbs'\n\n/** Well-known MIME constants used across the battery. */\nexport const MIME = {\n DOCX: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n XLSX: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n PPTX: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n ODT: 'application/vnd.oasis.opendocument.text',\n ODS: 'application/vnd.oasis.opendocument.spreadsheet',\n ODP: 'application/vnd.oasis.opendocument.presentation',\n PDF: 'application/pdf',\n DOC: 'application/msword',\n XLS: 'application/vnd.ms-excel',\n PPT: 'application/vnd.ms-powerpoint',\n PAGES: 'application/x-iwork-pages-sffpages',\n NUMBERS: 'application/x-iwork-numbers-sffnumbers',\n KEYNOTE: 'application/x-iwork-keynote-sffkey',\n XLSM: 'application/vnd.ms-excel.sheet.macroEnabled.12',\n XLSB: 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',\n FODS: 'application/vnd.oasis.opendocument.spreadsheet-flat-xml',\n SYLK: 'application/x-sylk',\n DIF: 'application/x-dif',\n DBF: 'application/x-dbf',\n TXT: 'text/plain',\n MD: 'text/markdown',\n CSV: 'text/csv',\n HTML: 'text/html',\n JSON: 'application/json',\n YAML: 'application/yaml',\n PNG: 'image/png',\n JPEG: 'image/jpeg',\n WEBP: 'image/webp',\n TIFF: 'image/tiff',\n AVIF: 'image/avif',\n WAV: 'audio/wav',\n MP3: 'audio/mpeg',\n} as const\n\n/** Legacy Office MIME types (extraction only — mutation is rejected). */\nexport const LEGACY_OFFICE_MIMES: ReadonlySet<string> = new Set([MIME.DOC, MIME.XLS, MIME.PPT])\n\n/** Apple iWork MIME types (extraction only — mutation is rejected). */\nexport const IWORK_MIMES: ReadonlySet<string> = new Set([MIME.PAGES, MIME.NUMBERS, MIME.KEYNOTE])\n\n/** Every MIME the battery classifies as a spreadsheet (drives verb applicability + normalize). */\nexport const SPREADSHEET_MIMES: ReadonlySet<string> = new Set([\n MIME.XLSX,\n MIME.XLSM,\n MIME.XLSB,\n MIME.ODS,\n MIME.FODS,\n MIME.XLS,\n MIME.CSV,\n MIME.NUMBERS,\n MIME.SYLK,\n MIME.DIF,\n MIME.DBF,\n])\nconst PRESENTATION_MIMES: ReadonlySet<string> = new Set([\n MIME.PPTX,\n MIME.ODP,\n MIME.PPT,\n MIME.KEYNOTE,\n])\nconst DOCUMENT_MIMES: ReadonlySet<string> = new Set([\n MIME.PDF,\n MIME.DOCX,\n MIME.ODT,\n MIME.DOC,\n MIME.PAGES,\n MIME.TXT,\n MIME.MD,\n MIME.HTML,\n MIME.JSON,\n MIME.YAML,\n 'application/rtf',\n 'text/rtf',\n])\n\n/**\n * Classify a MIME type into the verb table's broad format family.\n *\n * @param mimeType - The media MIME type.\n * @returns The family used by verb-applicability checks.\n */\nexport const familyOf = (mimeType: string): FormatFamily => {\n const mime = mimeType.toLowerCase().split(';')[0].trim()\n if (SPREADSHEET_MIMES.has(mime)) return 'spreadsheet'\n if (PRESENTATION_MIMES.has(mime)) return 'presentation'\n if (DOCUMENT_MIMES.has(mime)) return 'document'\n if (mime.startsWith('image/')) return 'image'\n if (mime.startsWith('audio/')) return 'audio'\n if (mime.startsWith('text/')) return 'document'\n return 'document'\n}\n\n/**\n * Reason a mutation verb cannot run against this MIME type, or `undefined` when mutation is\n * allowed. Returns a reason string (not a throw) so callers compose model-actionable failures.\n *\n * @param mimeType - The media MIME type.\n * @returns A human-readable reason, or `undefined` when mutation is supported.\n */\nexport const unsupportedForMutationReason = (mimeType: string): string | undefined => {\n const mime = mimeType.toLowerCase().split(';')[0].trim()\n if (LEGACY_OFFICE_MIMES.has(mime)) {\n return `legacy Office format (${mime}) cannot be mutated in place and no configured engine converts it — convert it first (e.g. convert to=docx)`\n }\n if (IWORK_MIMES.has(mime)) {\n return `Apple iWork format (${mime}) cannot be mutated in place and no configured engine converts it`\n }\n return undefined\n}\n\n/** A small extension → MIME lookup for filenames produced by transforms. */\nexport const EXT_TO_MIME: Readonly<Record<string, string>> = {\n pdf: MIME.PDF,\n docx: MIME.DOCX,\n xlsx: MIME.XLSX,\n pptx: MIME.PPTX,\n odt: MIME.ODT,\n ods: MIME.ODS,\n odp: MIME.ODP,\n doc: MIME.DOC,\n xls: MIME.XLS,\n ppt: MIME.PPT,\n xlsm: MIME.XLSM,\n xlsb: MIME.XLSB,\n fods: MIME.FODS,\n sylk: MIME.SYLK,\n dif: MIME.DIF,\n dbf: MIME.DBF,\n numbers: MIME.NUMBERS,\n txt: MIME.TXT,\n md: MIME.MD,\n csv: MIME.CSV,\n html: MIME.HTML,\n json: MIME.JSON,\n yaml: MIME.YAML,\n yml: MIME.YAML,\n rtf: 'application/rtf',\n png: MIME.PNG,\n jpg: MIME.JPEG,\n jpeg: MIME.JPEG,\n webp: MIME.WEBP,\n tiff: MIME.TIFF,\n avif: MIME.AVIF,\n wav: MIME.WAV,\n mp3: MIME.MP3,\n}\n\n/**\n * Replace (or add) a filename's extension.\n *\n * @param filename - The original filename.\n * @param ext - The new extension, without the dot.\n * @returns The filename with the new extension.\n */\nexport const replaceExtension = (filename: string, ext: string): string => {\n const dot = filename.lastIndexOf('.')\n const base = dot > 0 ? filename.slice(0, dot) : filename\n return `${base}.${ext}`\n}\n"],"mappings":"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"}
|
package/guards.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./chunk-Cek0wNdY.js");
|
|
3
3
|
const require_exceptions = require("./exceptions-BfOYct3J.js");
|
|
4
|
-
const require_tool_registry = require("./tool_registry-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const require_turn_runner = require("./turn_runner-
|
|
4
|
+
const require_tool_registry = require("./tool_registry-DwZ6pzN4.js");
|
|
5
|
+
const require_thought = require("./thought-eka4iUHa.js");
|
|
6
|
+
const require_tool = require("./tool-Dhjca7rC.js");
|
|
7
|
+
const require_spooled_artifact = require("./spooled_artifact-BCmPrxZS.js");
|
|
8
|
+
const require_tool_call = require("./tool_call-Cyi0hUUc.js");
|
|
9
|
+
const require_spooled_markdown_artifact = require("./spooled_markdown_artifact-CD4PrrpV.js");
|
|
10
|
+
const require_dispatch_runner = require("./dispatch_runner-BwplbCPr.js");
|
|
11
|
+
const require_turn_runner = require("./turn_runner-CCZcsoDU.js");
|
|
12
12
|
//#region src/guards.ts
|
|
13
13
|
/**
|
|
14
14
|
* Runtime type guards for ADK primitives, contexts, runners, tools, and artifacts.
|
package/guards.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { o as BaseException } from "./exceptions-DgmgW0MU.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
8
|
-
import { n as
|
|
9
|
-
import { n as TurnGate, t as TurnRunner } from "./turn_runner-
|
|
2
|
+
import { a as Tokenizable, c as isObject, o as isError, r as Registry, s as isInstanceOf, t as ToolRegistry } from "./tool_registry-CZ55mIti.mjs";
|
|
3
|
+
import { i as Identity, n as Message, r as Memory, t as Thought } from "./thought-CtOoZUSE.mjs";
|
|
4
|
+
import { t as Tool } from "./tool-CITF20yJ.mjs";
|
|
5
|
+
import { i as ArtifactTool, r as implementsSpoolReader, t as SpooledArtifact } from "./spooled_artifact-DL36jnqA.mjs";
|
|
6
|
+
import { t as ToolCall } from "./tool_call-D_k36aI4.mjs";
|
|
7
|
+
import { n as SpooledJsonArtifact, t as SpooledMarkdownArtifact } from "./spooled_markdown_artifact-Da-Xnebh.mjs";
|
|
8
|
+
import { n as DispatchContext, r as TurnContext, t as DispatchRunner } from "./dispatch_runner-C1ar_D7W.mjs";
|
|
9
|
+
import { n as TurnGate, t as TurnRunner } from "./turn_runner-DRPpVvsd.mjs";
|
|
10
10
|
//#region src/guards.ts
|
|
11
11
|
/**
|
|
12
12
|
* Runtime type guards for ADK primitives, contexts, runners, tools, and artifacts.
|
package/index.cjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./chunk-Cek0wNdY.js");
|
|
3
3
|
const require_exceptions = require("./exceptions-BfOYct3J.js");
|
|
4
|
-
const require_tool_registry = require("./tool_registry-
|
|
4
|
+
const require_tool_registry = require("./tool_registry-DwZ6pzN4.js");
|
|
5
5
|
const require_runtime = require("./runtime-BiLlk2Ul.js");
|
|
6
|
-
const
|
|
6
|
+
const require_thought = require("./thought-eka4iUHa.js");
|
|
7
|
+
const require_tool = require("./tool-Dhjca7rC.js");
|
|
8
|
+
const require_spooled_artifact = require("./spooled_artifact-BCmPrxZS.js");
|
|
9
|
+
const require_common = require("./common-DmDn4Gfl.js");
|
|
10
|
+
const require_tool_call = require("./tool_call-Cyi0hUUc.js");
|
|
11
|
+
const require_spooled_markdown_artifact = require("./spooled_markdown_artifact-CD4PrrpV.js");
|
|
12
|
+
const require_dispatch_runner = require("./dispatch_runner-BwplbCPr.js");
|
|
7
13
|
require("./dispatch_runner.cjs");
|
|
8
|
-
const require_thought = require("./thought-BFtsnUTU.js");
|
|
9
|
-
const require_tool = require("./tool-B2nnkwNU.js");
|
|
10
|
-
const require_spooled_artifact = require("./spooled_artifact-BR0IhU9y.js");
|
|
11
|
-
const require_common = require("./common-BBK2e5ro.js");
|
|
12
|
-
const require_tool_call = require("./tool_call-BxL3eU1k.js");
|
|
13
|
-
const require_spooled_markdown_artifact = require("./spooled_markdown_artifact-Dj3fNowz.js");
|
|
14
14
|
require("./exceptions.cjs");
|
|
15
|
-
const require_turn_runner = require("./turn_runner-
|
|
16
|
-
const require_guards = require("./guards.cjs");
|
|
15
|
+
const require_turn_runner = require("./turn_runner-CCZcsoDU.js");
|
|
17
16
|
require("./turn_runner.cjs");
|
|
17
|
+
const require_guards = require("./guards.cjs");
|
|
18
18
|
//#region src/index.ts
|
|
19
19
|
/**
|
|
20
20
|
* Root convenience barrel for the ADK's core runtime values and public TypeScript contracts.
|
|
@@ -26,7 +26,7 @@ require("./turn_runner.cjs");
|
|
|
26
26
|
*
|
|
27
27
|
* @tip This is a constant that is replaced during the build process with the actual version of the package.
|
|
28
28
|
*/
|
|
29
|
-
var version = "0.1.0-master-
|
|
29
|
+
var version = "0.1.0-master-89b47bec";
|
|
30
30
|
//#endregion
|
|
31
31
|
exports.ArtifactTool = require_spooled_artifact.ArtifactTool;
|
|
32
32
|
exports.DispatchRunner = require_dispatch_runner.DispatchRunner;
|
package/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { n as ValidationException } from "./exceptions-DgmgW0MU.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { a as Tokenizable, c as isObject, i as TokenEncoding, o as isError, r as Registry, s as isInstanceOf, t as ToolRegistry } from "./tool_registry-CZ55mIti.mjs";
|
|
3
3
|
import { C as E_NOT_A_SPOOL_READER, D as E_TOOL_DOWNSTREAM_ERROR, E as E_TOOL_ALREADY_REGISTERED, O as E_TURN_GATE_ABORTED, T as E_PIPELINE_SHORT_CIRCUITED, _ as E_INVALID_TURN_GATE_RESOLUTION, a as E_INVALID_INITIAL_MEMORY_VALUE, b as E_LLM_EXECUTION_EXECUTOR_ERROR, d as E_INVALID_INITIAL_TOOL_VALUE, f as E_INVALID_INITIAL_TURN_GATE_VALUE, g as E_INVALID_TURN_CONTEXT, h as E_INVALID_TOOL_ARGS, k as E_TURN_GATE_TIMEOUT, l as E_INVALID_INITIAL_THOUGHT_VALUE, m as E_INVALID_LLM_EXECUTION_CONTEXT, n as E_INPUT_PIPELINE_ERROR, o as E_INVALID_INITIAL_MESSAGE_VALUE, p as E_INVALID_LLM_DISPATCH_INPUT, r as E_INVALID_INITIAL_IDENTITY_VALUE, s as E_INVALID_INITIAL_REGISTRY_VALUE, t as E_DISPATCH_PIPELINE_ERROR, u as E_INVALID_INITIAL_TOOL_CALL_VALUE, v as E_INVALID_TURN_RUNNER_CONFIG, w as E_OUTPUT_PIPELINE_ERROR, x as E_LLM_EXECUTION_GATE_NOT_SUPPORTED, y as E_LLM_EXECUTION_ALREADY_SIGNALLED } from "./runtime-CyagS1pm.mjs";
|
|
4
|
-
import { t as
|
|
4
|
+
import { i as Identity, n as Message, r as Memory, t as Thought } from "./thought-CtOoZUSE.mjs";
|
|
5
|
+
import { t as Tool } from "./tool-CITF20yJ.mjs";
|
|
6
|
+
import { i as ArtifactTool, r as implementsSpoolReader, t as SpooledArtifact } from "./spooled_artifact-DL36jnqA.mjs";
|
|
7
|
+
import { n as fromWebFile, o as Retrievable, r as inMemoryMediaReader, t as fromFetch } from "./common-BQoFv108.mjs";
|
|
8
|
+
import { a as mediaReaderSchema, i as implementsMediaReader, n as Media, r as isMedia, t as ToolCall } from "./tool_call-D_k36aI4.mjs";
|
|
9
|
+
import { n as SpooledJsonArtifact, t as SpooledMarkdownArtifact } from "./spooled_markdown_artifact-Da-Xnebh.mjs";
|
|
10
|
+
import { t as DispatchRunner } from "./dispatch_runner-C1ar_D7W.mjs";
|
|
5
11
|
import "./dispatch_runner.mjs";
|
|
6
|
-
import { i as Identity, n as Message, r as Memory, t as Thought } from "./thought-Cde2Y_GK.mjs";
|
|
7
|
-
import { t as Tool } from "./tool-CcxYxA5X.mjs";
|
|
8
|
-
import { i as ArtifactTool, r as implementsSpoolReader, t as SpooledArtifact } from "./spooled_artifact-nTE6ujM8.mjs";
|
|
9
|
-
import { n as fromWebFile, o as Retrievable, r as inMemoryMediaReader, t as fromFetch } from "./common-BxoznqbX.mjs";
|
|
10
|
-
import { a as mediaReaderSchema, i as implementsMediaReader, n as Media, r as isMedia, t as ToolCall } from "./tool_call-B3MOog2R.mjs";
|
|
11
|
-
import { n as SpooledJsonArtifact, t as SpooledMarkdownArtifact } from "./spooled_markdown_artifact-DIYzbQv8.mjs";
|
|
12
12
|
import "./exceptions.mjs";
|
|
13
|
-
import { t as TurnRunner } from "./turn_runner-
|
|
14
|
-
import { isArtifactTool, isBaseException, isDispatchContext, isDispatchRunner, isIdentity, isMemory, isMessage, isRegistry, isSpooledArtifact, isSpooledArtifactConstructor, isSpooledJsonArtifact, isSpooledMarkdownArtifact, isThought, isTokenizable, isTool, isToolCall, isToolRegistry, isTurnContext, isTurnGate, isTurnRunner } from "./guards.mjs";
|
|
13
|
+
import { t as TurnRunner } from "./turn_runner-DRPpVvsd.mjs";
|
|
15
14
|
import "./turn_runner.mjs";
|
|
15
|
+
import { isArtifactTool, isBaseException, isDispatchContext, isDispatchRunner, isIdentity, isMemory, isMessage, isRegistry, isSpooledArtifact, isSpooledArtifactConstructor, isSpooledJsonArtifact, isSpooledMarkdownArtifact, isThought, isTokenizable, isTool, isToolCall, isToolRegistry, isTurnContext, isTurnGate, isTurnRunner } from "./guards.mjs";
|
|
16
16
|
//#region src/index.ts
|
|
17
17
|
/**
|
|
18
18
|
* Root convenience barrel for the ADK's core runtime values and public TypeScript contracts.
|
|
@@ -24,7 +24,7 @@ import "./turn_runner.mjs";
|
|
|
24
24
|
*
|
|
25
25
|
* @tip This is a constant that is replaced during the build process with the actual version of the package.
|
|
26
26
|
*/
|
|
27
|
-
var version = "0.1.0-master-
|
|
27
|
+
var version = "0.1.0-master-89b47bec";
|
|
28
28
|
//#endregion
|
|
29
29
|
export { ArtifactTool, DispatchRunner, E_DISPATCH_PIPELINE_ERROR, E_INPUT_PIPELINE_ERROR, E_INVALID_INITIAL_IDENTITY_VALUE, E_INVALID_INITIAL_MEMORY_VALUE, E_INVALID_INITIAL_MESSAGE_VALUE, E_INVALID_INITIAL_REGISTRY_VALUE, E_INVALID_INITIAL_THOUGHT_VALUE, E_INVALID_INITIAL_TOOL_CALL_VALUE, E_INVALID_INITIAL_TOOL_VALUE, E_INVALID_INITIAL_TURN_GATE_VALUE, E_INVALID_LLM_DISPATCH_INPUT, E_INVALID_LLM_EXECUTION_CONTEXT, E_INVALID_TOOL_ARGS, E_INVALID_TURN_CONTEXT, E_INVALID_TURN_GATE_RESOLUTION, E_INVALID_TURN_RUNNER_CONFIG, E_LLM_EXECUTION_ALREADY_SIGNALLED, E_LLM_EXECUTION_EXECUTOR_ERROR, E_LLM_EXECUTION_GATE_NOT_SUPPORTED, E_NOT_A_SPOOL_READER, E_OUTPUT_PIPELINE_ERROR, E_PIPELINE_SHORT_CIRCUITED, E_TOOL_ALREADY_REGISTERED, E_TOOL_DOWNSTREAM_ERROR, E_TURN_GATE_ABORTED, E_TURN_GATE_TIMEOUT, Identity, Media, Memory, Message, Registry, Retrievable, SpooledArtifact, SpooledJsonArtifact, SpooledMarkdownArtifact, Thought, TokenEncoding, Tokenizable, Tool, ToolCall, ToolRegistry, TurnRunner, ValidationException, fromFetch, fromWebFile, implementsMediaReader, implementsSpoolReader, inMemoryMediaReader, isArtifactTool, isBaseException, isDispatchContext, isDispatchRunner, isError, isIdentity, isInstanceOf, isMedia, isMemory, isMessage, isObject, isRegistry, isSpooledArtifact, isSpooledArtifactConstructor, isSpooledJsonArtifact, isSpooledMarkdownArtifact, isThought, isTokenizable, isTool, isToolCall, isToolRegistry, isTurnContext, isTurnGate, isTurnRunner, mediaReaderSchema, version };
|
|
30
30
|
|