@camstack/addon-cloudflare 1.1.3 → 1.1.5

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.
@@ -4627,7 +4627,7 @@ function _instanceof(cls, params = {}) {
4627
4627
  return inst;
4628
4628
  }
4629
4629
  //#endregion
4630
- //#region ../types/dist/sleep-BV7rLc6Y.mjs
4630
+ //#region ../types/dist/sleep-NOH4yRwj.mjs
4631
4631
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4632
4632
  EventCategory["SystemBoot"] = "system.boot";
4633
4633
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5742,15 +5742,24 @@ var BaseAddon = class {
5742
5742
  } catch {}
5743
5743
  }
5744
5744
  /**
5745
- * Resolve the shared models directory path via the storage capability.
5746
- * Falls back to `camstack-data/models` if storage is unavailable.
5747
- * Used by inference addons (detection-pipeline, audio-classifier, embedding-encoder).
5745
+ * Resolve the shared, node-local models directory: `<nodeDataDir>/models`.
5746
+ *
5747
+ * This is the SINGLE centralized models-dir resolver for every inference addon
5748
+ * (detection-pipeline, audio-analyzer, embedding-encoder, model-studio). It is
5749
+ * anchored at the node's own writable data root (`ctx.nodeDataDir`, i.e.
5750
+ * `CAMSTACK_DATA` ?? the kernel boot dir) — never the hub-singleton `storage`
5751
+ * cap, which returns the hub's `/data/models` to every node and breaks any node
5752
+ * whose real data dir differs (e.g. the macOS electron agent).
5753
+ *
5754
+ * `node:path`/`node:fs` are imported dynamically so the `@camstack/types` root
5755
+ * barrel (re-exported into browser bundles) stays free of node builtins.
5748
5756
  */
5749
5757
  async resolveModelsDir() {
5750
- return this.ctx.api.storage.resolve.query({
5751
- location: "models",
5752
- relativePath: ""
5753
- }).catch(() => "camstack-data/models");
5758
+ const { join } = await import("node:path");
5759
+ const { promises: fsp } = await import("node:fs");
5760
+ const dir = join(this.ctx.nodeDataDir, "models");
5761
+ await fsp.mkdir(dir, { recursive: true });
5762
+ return dir;
5754
5763
  }
5755
5764
  /**
5756
5765
  * Access the runtime capability registry for in-process provider lookups.
@@ -12667,7 +12676,8 @@ method(object({
12667
12676
  sessionId: string().optional()
12668
12677
  }), ConvertResultSchema, {
12669
12678
  kind: "mutation",
12670
- auth: "admin"
12679
+ auth: "admin",
12680
+ timeoutMs: 6e5
12671
12681
  });
12672
12682
  var AddonHttpRouteSchema = object({
12673
12683
  method: _enum([
@@ -14243,7 +14253,14 @@ var NotificationRuleConditionsSchema = object({
14243
14253
  /** Match against `event.data.eventType` token (e.g. `'press_long'`). When non-empty, only events
14244
14254
  * carrying a matching `data.eventType` string pass this condition. Rules without this field are
14245
14255
  * unaffected (back-compat). Distinct from `rule.eventTypes` which holds EventCategory strings. */
14246
- eventTypeTokens: array(string()).readonly().optional()
14256
+ eventTypeTokens: array(string()).readonly().optional(),
14257
+ /** Match detections whose CLIP image embedding is semantically similar to this free-text
14258
+ * description. Requires the embedding-encoder cap to have pre-warmed the text vector.
14259
+ * `minSimilarity` is the cosine similarity threshold in [0, 1]. */
14260
+ clipDescription: object({
14261
+ text: string().min(1),
14262
+ minSimilarity: number().min(0).max(1)
14263
+ }).optional()
14247
14264
  });
14248
14265
  var NotificationRuleTemplateSchema = object({
14249
14266
  title: string(),
@@ -14485,6 +14502,16 @@ var TrackedDetectionSchema = object({
14485
14502
  zones: array(string()).readonly(),
14486
14503
  state: TrackStateSchema
14487
14504
  });
14505
+ var ScoredObjectEventSchema = ObjectEventSchema.extend({ score: number() });
14506
+ var SearchObjectEventsInput = object({
14507
+ text: string(),
14508
+ deviceId: number().optional(),
14509
+ since: number().optional(),
14510
+ until: number().optional(),
14511
+ classFilter: string().optional(),
14512
+ limit: number().default(50),
14513
+ minScore: number().min(0).max(1).default(.2)
14514
+ });
14488
14515
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
14489
14516
  deviceId: number(),
14490
14517
  trackId: string()
@@ -14519,7 +14546,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
14519
14546
  }), method(object({
14520
14547
  eventId: string(),
14521
14548
  kind: MediaFileKindEnum.optional()
14522
- }), array(MediaFileSchema).readonly()), method(object({ trackId: string() }), array(MediaFileSchema).readonly()), object({
14549
+ }), array(MediaFileSchema).readonly()), method(object({ trackId: string() }), array(MediaFileSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), object({
14523
14550
  deviceId: number(),
14524
14551
  timestamp: number(),
14525
14552
  frameWidth: number(),
@@ -19169,6 +19196,12 @@ Object.freeze({
19169
19196
  addonId: null,
19170
19197
  access: "create"
19171
19198
  },
19199
+ "pipelineAnalytics.searchObjectEvents": {
19200
+ capName: "pipeline-analytics",
19201
+ capScope: "device",
19202
+ addonId: null,
19203
+ access: "view"
19204
+ },
19172
19205
  "pipelineExecutor.cacheFrameInPool": {
19173
19206
  capName: "pipeline-executor",
19174
19207
  capScope: "system",
@@ -4627,7 +4627,7 @@ function _instanceof(cls, params = {}) {
4627
4627
  return inst;
4628
4628
  }
4629
4629
  //#endregion
4630
- //#region ../types/dist/sleep-BV7rLc6Y.mjs
4630
+ //#region ../types/dist/sleep-NOH4yRwj.mjs
4631
4631
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4632
4632
  EventCategory["SystemBoot"] = "system.boot";
4633
4633
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5742,15 +5742,24 @@ var BaseAddon = class {
5742
5742
  } catch {}
5743
5743
  }
5744
5744
  /**
5745
- * Resolve the shared models directory path via the storage capability.
5746
- * Falls back to `camstack-data/models` if storage is unavailable.
5747
- * Used by inference addons (detection-pipeline, audio-classifier, embedding-encoder).
5745
+ * Resolve the shared, node-local models directory: `<nodeDataDir>/models`.
5746
+ *
5747
+ * This is the SINGLE centralized models-dir resolver for every inference addon
5748
+ * (detection-pipeline, audio-analyzer, embedding-encoder, model-studio). It is
5749
+ * anchored at the node's own writable data root (`ctx.nodeDataDir`, i.e.
5750
+ * `CAMSTACK_DATA` ?? the kernel boot dir) — never the hub-singleton `storage`
5751
+ * cap, which returns the hub's `/data/models` to every node and breaks any node
5752
+ * whose real data dir differs (e.g. the macOS electron agent).
5753
+ *
5754
+ * `node:path`/`node:fs` are imported dynamically so the `@camstack/types` root
5755
+ * barrel (re-exported into browser bundles) stays free of node builtins.
5748
5756
  */
5749
5757
  async resolveModelsDir() {
5750
- return this.ctx.api.storage.resolve.query({
5751
- location: "models",
5752
- relativePath: ""
5753
- }).catch(() => "camstack-data/models");
5758
+ const { join } = await import("node:path");
5759
+ const { promises: fsp } = await import("node:fs");
5760
+ const dir = join(this.ctx.nodeDataDir, "models");
5761
+ await fsp.mkdir(dir, { recursive: true });
5762
+ return dir;
5754
5763
  }
5755
5764
  /**
5756
5765
  * Access the runtime capability registry for in-process provider lookups.
@@ -12667,7 +12676,8 @@ method(object({
12667
12676
  sessionId: string().optional()
12668
12677
  }), ConvertResultSchema, {
12669
12678
  kind: "mutation",
12670
- auth: "admin"
12679
+ auth: "admin",
12680
+ timeoutMs: 6e5
12671
12681
  });
12672
12682
  var AddonHttpRouteSchema = object({
12673
12683
  method: _enum([
@@ -14243,7 +14253,14 @@ var NotificationRuleConditionsSchema = object({
14243
14253
  /** Match against `event.data.eventType` token (e.g. `'press_long'`). When non-empty, only events
14244
14254
  * carrying a matching `data.eventType` string pass this condition. Rules without this field are
14245
14255
  * unaffected (back-compat). Distinct from `rule.eventTypes` which holds EventCategory strings. */
14246
- eventTypeTokens: array(string()).readonly().optional()
14256
+ eventTypeTokens: array(string()).readonly().optional(),
14257
+ /** Match detections whose CLIP image embedding is semantically similar to this free-text
14258
+ * description. Requires the embedding-encoder cap to have pre-warmed the text vector.
14259
+ * `minSimilarity` is the cosine similarity threshold in [0, 1]. */
14260
+ clipDescription: object({
14261
+ text: string().min(1),
14262
+ minSimilarity: number().min(0).max(1)
14263
+ }).optional()
14247
14264
  });
14248
14265
  var NotificationRuleTemplateSchema = object({
14249
14266
  title: string(),
@@ -14485,6 +14502,16 @@ var TrackedDetectionSchema = object({
14485
14502
  zones: array(string()).readonly(),
14486
14503
  state: TrackStateSchema
14487
14504
  });
14505
+ var ScoredObjectEventSchema = ObjectEventSchema.extend({ score: number() });
14506
+ var SearchObjectEventsInput = object({
14507
+ text: string(),
14508
+ deviceId: number().optional(),
14509
+ since: number().optional(),
14510
+ until: number().optional(),
14511
+ classFilter: string().optional(),
14512
+ limit: number().default(50),
14513
+ minScore: number().min(0).max(1).default(.2)
14514
+ });
14488
14515
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
14489
14516
  deviceId: number(),
14490
14517
  trackId: string()
@@ -14519,7 +14546,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
14519
14546
  }), method(object({
14520
14547
  eventId: string(),
14521
14548
  kind: MediaFileKindEnum.optional()
14522
- }), array(MediaFileSchema).readonly()), method(object({ trackId: string() }), array(MediaFileSchema).readonly()), object({
14549
+ }), array(MediaFileSchema).readonly()), method(object({ trackId: string() }), array(MediaFileSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), object({
14523
14550
  deviceId: number(),
14524
14551
  timestamp: number(),
14525
14552
  frameWidth: number(),
@@ -19169,6 +19196,12 @@ Object.freeze({
19169
19196
  addonId: null,
19170
19197
  access: "create"
19171
19198
  },
19199
+ "pipelineAnalytics.searchObjectEvents": {
19200
+ capName: "pipeline-analytics",
19201
+ capScope: "device",
19202
+ addonId: null,
19203
+ access: "view"
19204
+ },
19172
19205
  "pipelineExecutor.cacheFrameInPool": {
19173
19206
  capName: "pipeline-executor",
19174
19207
  capScope: "system",
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  enumerable: true
22
22
  }) : target, mod));
23
23
  //#endregion
24
- const require_dist = require("../dist-CTZNSZND.js");
24
+ const require_dist = require("../dist-DIuCey2a.js");
25
25
  let node_path = require("node:path");
26
26
  node_path = __toESM(node_path);
27
27
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { a as BaseAddon, c as array, d as literal, f as number, l as boolean, m as string, n as defineCustomActions, o as EventCategory, p as object, r as networkAccessCapability, s as _enum, t as customAction } from "../dist-B_-FZVQR.mjs";
1
+ import { a as BaseAddon, c as array, d as literal, f as number, l as boolean, m as string, n as defineCustomActions, o as EventCategory, p as object, r as networkAccessCapability, s as _enum, t as customAction } from "../dist-BT1qVgA6.mjs";
2
2
  import * as path from "node:path";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { spawn } from "node:child_process";
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_dist = require("../dist-CTZNSZND.js");
2
+ const require_dist = require("../dist-DIuCey2a.js");
3
3
  //#region src/turn/cloudflare-turn.ts
4
4
  /**
5
5
  * Cloudflare returns ICE servers in several flavours depending on which
@@ -1,4 +1,4 @@
1
- import { a as BaseAddon, d as literal, f as number, i as turnProviderCapability, l as boolean, m as string, n as defineCustomActions, p as object, t as customAction, u as discriminatedUnion } from "../dist-B_-FZVQR.mjs";
1
+ import { a as BaseAddon, d as literal, f as number, i as turnProviderCapability, l as boolean, m as string, n as defineCustomActions, p as object, t as customAction, u as discriminatedUnion } from "../dist-BT1qVgA6.mjs";
2
2
  //#region src/turn/cloudflare-turn.ts
3
3
  /**
4
4
  * Cloudflare returns ICE servers in several flavours depending on which
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-cloudflare",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "Cloudflare bundle — Tunnel (network-access) + TURN relay (turn-provider). Multi-entry npm package shipping 2 addons under a single bundle.",
5
5
  "keywords": [
6
6
  "camstack",