auto-model-router 0.4.10 → 0.4.11

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.
@@ -7,14 +7,14 @@
7
7
  },
8
8
  "metadata": {
9
9
  "description": "auto-model-router: a local cost/complexity-aware model router for Oh My Pi, backed by OpenRouter",
10
- "version": "0.4.10",
10
+ "version": "0.4.11",
11
11
  "pluginRoot": "."
12
12
  },
13
13
  "plugins": [
14
14
  {
15
15
  "name": "auto-model-router",
16
16
  "description": "Local cost/complexity-aware model router for Oh My Pi, backed by OpenRouter. Runs in-process, routes per turn by price and task complexity, with budget caps, mid-stream escalation, and cache-aware hysteresis.",
17
- "version": "0.4.10",
17
+ "version": "0.4.11",
18
18
  "author": {
19
19
  "name": "drewappling",
20
20
  "email": "drewappling@gmail.com"
package/package.json CHANGED
@@ -1,9 +1,15 @@
1
1
  {
2
2
  "name": "auto-model-router",
3
- "version": "0.4.10",
3
+ "version": "0.4.11",
4
4
  "private": false,
5
5
  "description": "Local cost/complexity-aware model router for Oh My Pi, backed by OpenRouter",
6
6
  "type": "module",
7
+ "main": "./src/lib.ts",
8
+ "types": "./src/lib.ts",
9
+ "exports": {
10
+ ".": "./src/lib.ts",
11
+ "./package.json": "./package.json"
12
+ },
7
13
  "bin": {
8
14
  "auto-model-router": "./src/index.ts"
9
15
  },
package/src/lib.ts ADDED
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Public programmatic API of auto-model-router, for projects that embed the
3
+ * router rather than run the binary (the team edition does). Everything else
4
+ * under src/ is internal and may change between patch releases; this file is
5
+ * the contract.
6
+ *
7
+ * import { startServer, loadConfig } from "auto-model-router";
8
+ *
9
+ * const cfg = loadConfig({ overrides: { server: { host: "127.0.0.1", port: 0, apiKey: "internal" } } });
10
+ * const router = startServer(cfg);
11
+ * router.server.port; // the bound port; talk HTTP to it, or embed further
12
+ * await router.stop();
13
+ */
14
+
15
+ export { startServer, type StartedServer } from "./server/http.ts";
16
+ export { loadConfig, apiKeySource } from "./config/load.ts";
17
+ export { DEFAULT_CONFIG } from "./config/defaults.ts";
18
+ export type { RouterConfig } from "./config/types.ts";
19
+ export { buildUsageReport, renderUsageReport, type UsageReport, type ReportTotals } from "./cost/report.ts";
20
+ export { buildDailySummary, renderDailySummary, type DailySummary } from "./cost/summary.ts";
21
+ export { openDb } from "./util/sqlite.ts";
22
+ export { createLedger } from "./cost/ledger.ts";
23
+ export type { Ledger, LedgerEntry } from "./cost/types.ts";