@danypops/jittor 0.20.0 → 0.21.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danypops/jittor",
3
- "version": "0.20.0",
3
+ "version": "0.21.2",
4
4
  "description": "Just-in-Time Token Optimization Router for Pi -- token and context observability with optimization policies",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -8,10 +8,16 @@
8
8
  "types": "./src/index.ts",
9
9
  "exports": {
10
10
  ".": "./src/index.ts",
11
+ "./usage": "./src/observability/usage.ts",
11
12
  "./package.json": "./package.json"
12
13
  },
13
14
  "sideEffects": false,
14
15
  "keywords": ["llm-router", "token-budget"],
16
+ "zodiac": {
17
+ "integrations": [
18
+ { "kind": "vehicle-surface", "vehicleName": "jittor", "title": "Jittor" }
19
+ ]
20
+ },
15
21
  "bin": {
16
22
  "jittor": "src/cli.ts"
17
23
  },
package/src/daemon.ts CHANGED
@@ -137,6 +137,22 @@ export async function startDaemon(
137
137
  handlePath: paths.handle,
138
138
  logger,
139
139
  buildApp: () => createApp({ service, token }),
140
+ // Publishes into the shared, cross-package Vehicle Handle Directory
141
+ // (see @danypops/vehicle-server/paths's resolveSharedVehicleHandlePath)
142
+ // -- without this, a discovering caller with no prior knowledge of
143
+ // jittor's own private handlePath (e.g. Zodiac's VehicleSurfaceGateway,
144
+ // resolving purely by vehicleName) can never find a real, running
145
+ // jittor daemon. Papyrus's own hand-rolled daemon.ts already does this
146
+ // explicitly; jittor uses this shared startDaemonKit but was never
147
+ // passing the option that turns the exact same behavior on.
148
+ vehicleName: "jittor",
149
+ tokenPath: paths.token,
150
+ // startDaemon()'s own `env` param was already used for telemetry/
151
+ // benchmark/catalog source detection above, but never forwarded to
152
+ // startDaemonKit itself -- meaning the shared-handle write above would
153
+ // silently always resolve against real process.env regardless of what
154
+ // env a caller (e.g. a test, or a future multi-instance setup) supplied.
155
+ env,
140
156
  maintenanceTasks: [
141
157
  {
142
158
  name: "checkpoint",
@@ -1,3 +1,15 @@
1
+ /**
2
+ * Exposed as its own package.json subpath export ("@danypops/jittor/usage")
3
+ * alongside the main barrel: this module and its own single dependency
4
+ * (constants.ts) are the only fully browser/Node-tsc-safe slice of jittor's
5
+ * source tree (pure functions and types, no bun:sqlite, no Bun-only
6
+ * globals) -- importing the whole barrel instead drags in every other
7
+ * module's own raw `.ts` import specifiers, which a consumer's tsc rejects
8
+ * outright (TS5097) unless it enables allowImportingTsExtensions project-
9
+ * wide. A consumer that only needs buildUsageGraph/buildCostGraph/
10
+ * resolveUsageWindow (e.g. Zodiac's own React usage meter) should import
11
+ * this subpath directly, not the main entry.
12
+ */
1
13
  import { MAX_USAGE_BUCKETS, MILLISECONDS_PER_DAY, MILLISECONDS_PER_HOUR } from "../constants.ts";
2
14
 
3
15
  export const USAGE_PERIODS = [