@x12i/ai-dispatcher 3.3.0 → 3.3.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/README.md CHANGED
@@ -4,7 +4,7 @@ One request shape for OpenRouter, AWS Bedrock, the OpenAI Responses API, and Clo
4
4
 
5
5
  **Implemented providers:** `openrouter`, `bedrock`, `openai`, `cloudflare`. Any other provider throws `PROVIDER_NOT_IMPLEMENTED`.
6
6
 
7
- The package is `@x12i/ai-dispatcher` 3.3.0. It runs on Node 22 or newer and publishes ESM and CommonJS from the same entry.
7
+ The package is `@x12i/ai-dispatcher` 3.3.1. It runs on Node 22 or newer and publishes ESM and CommonJS from the same entry.
8
8
 
9
9
  Connected MCP servers can be passed to `createAiDispatcher`. `run()` and `compile()` expose those tools to the model. `executeStreamingChat` does not. Details are in [MCP tools](#mcp-tools).
10
10
 
package/dist/index.cjs CHANGED
@@ -47,6 +47,12 @@ __export(index_exports, {
47
47
  stripReasoningHistoryFields: () => stripReasoningHistoryFields
48
48
  });
49
49
  module.exports = __toCommonJS(index_exports);
50
+
51
+ // ../node_modules/tsup/assets/cjs_shims.js
52
+ var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
53
+ var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
54
+
55
+ // src/index.ts
50
56
  var import_ai_profiles4 = require("@x12i/ai-profiles");
51
57
  var import_openrouter_runtime4 = require("@x12i/openrouter-runtime");
52
58
 
@@ -2689,7 +2695,6 @@ var import_node_module = require("module");
2689
2695
  var import_node_fs = require("fs");
2690
2696
  var import_node_path = require("path");
2691
2697
  var import_ai_profiles = require("@x12i/ai-profiles");
2692
- var import_meta = {};
2693
2698
  var index;
2694
2699
  function normalize(value) {
2695
2700
  return value.trim().toLowerCase();
@@ -2706,11 +2711,11 @@ function addKey(keys, key, row) {
2706
2711
  if (existing.modelId !== row.modelId) keys.set(normalized, "ambiguous");
2707
2712
  }
2708
2713
  function loadAssignmentAliases() {
2709
- const require2 = (0, import_node_module.createRequire)(import_meta.url);
2714
+ const require2 = (0, import_node_module.createRequire)(importMetaUrl);
2710
2715
  const entry = require2.resolve("@x12i/ai-profiles");
2711
2716
  const path = (0, import_node_path.join)((0, import_node_path.dirname)(entry), "data", "reasoning-directives.json");
2712
- const document = JSON.parse((0, import_node_fs.readFileSync)(path, "utf8"));
2713
- return document.assignments ?? [];
2717
+ const document2 = JSON.parse((0, import_node_fs.readFileSync)(path, "utf8"));
2718
+ return document2.assignments ?? [];
2714
2719
  }
2715
2720
  function effortList(entry) {
2716
2721
  const reasoning = entry.openrouter.reasoning;