@camstack/addon-post-analysis 1.2.43 → 1.2.45

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.
@@ -15809,7 +15809,7 @@ var pipelineAnalyticsCapability = {
15809
15809
  * `minScore`, sorted descending by score.
15810
15810
  */
15811
15811
  searchObjectEvents: method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()),
15812
- wipeObjectEmbeddings: method(_void(), WipeObjectEmbeddingsResultSchema, {
15812
+ wipeObjectEmbeddings: method(object({}), WipeObjectEmbeddingsResultSchema, {
15813
15813
  kind: "mutation",
15814
15814
  auth: "admin"
15815
15815
  }),
@@ -15817,7 +15817,7 @@ var pipelineAnalyticsCapability = {
15817
15817
  kind: "mutation",
15818
15818
  auth: "admin"
15819
15819
  }),
15820
- getObjectEmbeddingRebuildStatus: method(_void(), RebuildStatusSchema)
15820
+ getObjectEmbeddingRebuildStatus: method(object({}), RebuildStatusSchema)
15821
15821
  },
15822
15822
  events: {
15823
15823
  /**
@@ -15831,7 +15831,7 @@ var pipelineAnalyticsCapability = {
15831
15831
  * `minScore`, sorted descending by score.
15832
15832
  */
15833
15833
  searchObjectEvents: method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()),
15834
- wipeObjectEmbeddings: method(_void(), WipeObjectEmbeddingsResultSchema, {
15834
+ wipeObjectEmbeddings: method(object({}), WipeObjectEmbeddingsResultSchema, {
15835
15835
  kind: "mutation",
15836
15836
  auth: "admin"
15837
15837
  }),
@@ -15839,7 +15839,7 @@ var pipelineAnalyticsCapability = {
15839
15839
  kind: "mutation",
15840
15840
  auth: "admin"
15841
15841
  }),
15842
- getObjectEmbeddingRebuildStatus: method(_void(), RebuildStatusSchema)
15842
+ getObjectEmbeddingRebuildStatus: method(object({}), RebuildStatusSchema)
15843
15843
  },
15844
15844
  events: {
15845
15845
  /**
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-BIBeAcEY.js");
5
+ const require_dist = require("../dist-QzgUDrwU.js");
6
6
  let node_fs = require("node:fs");
7
7
  let node_fs$1 = require_dist.__toESM(node_fs, 1);
8
8
  node_fs = require_dist.__toESM(node_fs);
@@ -1,4 +1,4 @@
1
- import { E as embeddingEncoderCapability, k as hfModelUrl, z as BaseAddon } from "../dist-D4eie2px.mjs";
1
+ import { E as embeddingEncoderCapability, k as hfModelUrl, z as BaseAddon } from "../dist-BoV5RsRC.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import * as fs from "node:fs";
4
4
  import "node:fs";
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-BIBeAcEY.js");
1
+ const require_dist = require("./dist-QzgUDrwU.js");
2
2
  let node_fs = require("node:fs");
3
3
  node_fs = require_dist.__toESM(node_fs, 1);
4
4
  let node_path = require("node:path");
@@ -18,7 +18,7 @@ var e = {
18
18
  },
19
19
  "@camstack/types": {
20
20
  name: "@camstack/types",
21
- version: "1.2.39",
21
+ version: "1.2.40",
22
22
  scope: ["default"],
23
23
  loaded: !1,
24
24
  from: "addon_pipeline_analytics_widgets",
@@ -36,7 +36,7 @@ async function r() {
36
36
  }
37
37
  },
38
38
  "@camstack/types": {
39
- version: "1.2.39",
39
+ version: "1.2.40",
40
40
  scope: "default",
41
41
  shareConfig: {
42
42
  singleton: !0,
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-BIBeAcEY.js");
5
+ const require_dist = require("../dist-QzgUDrwU.js");
6
6
  let node_fs = require("node:fs");
7
7
  let node_path = require("node:path");
8
8
  node_path = require_dist.__toESM(node_path);
@@ -20621,16 +20621,25 @@ var ObjectEmbeddingStore = class {
20621
20621
  * Upsert the best-confidence embedding for a track. At most ONE row per
20622
20622
  * track: a write only replaces the stored row when its confidence is
20623
20623
  * strictly higher, keeping the track's best crop over its lifetime.
20624
+ *
20625
+ * `force` BYPASSES that gate — it does not try to out-score it. A rebuild
20626
+ * first attempted to win by writing `confidence: Infinity`, which worked
20627
+ * exactly once: the stored row then held Infinity, `Infinity <= Infinity`
20628
+ * short-circuited, and every later pass silently wrote nothing while
20629
+ * reporting hundreds rebuilt. Observed live — 214 "rebuilt" moved the index
20630
+ * by 4 rows.
20624
20631
  */
20625
20632
  async upsertIfBetter(input) {
20626
20633
  if (input.embedding.length === 0) return;
20627
20634
  if (!await this.ensureIndex(input.embedding.length)) return;
20628
20635
  try {
20629
- const stored = (await this.vectorStore.getByIds.query({
20630
- index: OBJECT_CLIP_INDEX,
20631
- ids: [input.trackId]
20632
- })).items[0]?.metadata["confidence"];
20633
- if (typeof stored === "number" && input.confidence <= stored) return;
20636
+ if (input.force !== true) {
20637
+ const stored = (await this.vectorStore.getByIds.query({
20638
+ index: OBJECT_CLIP_INDEX,
20639
+ ids: [input.trackId]
20640
+ })).items[0]?.metadata["confidence"];
20641
+ if (typeof stored === "number" && input.confidence <= stored) return;
20642
+ }
20634
20643
  if ((await this.vectorStore.upsert.mutate({
20635
20644
  index: "object-clip",
20636
20645
  items: [{
@@ -23938,7 +23947,7 @@ var PipelineAnalyticsAddon = class extends require_dist.BaseAddon {
23938
23947
  let storage = this.ctx.kernel.storage;
23939
23948
  const mediaRoot = process.env.CAMSTACK_MEDIA_ROOT?.trim();
23940
23949
  if (mediaRoot) {
23941
- const { FilesystemStorageProvider } = await Promise.resolve().then(() => require("../node-INtH-sDE.js"));
23950
+ const { FilesystemStorageProvider } = await Promise.resolve().then(() => require("../node-HrEN5lB7.js"));
23942
23951
  storage = new FilesystemStorageProvider(mediaRoot, { eventMedia: mediaRoot });
23943
23952
  logger.info("pipeline-analytics: event media rooted at CAMSTACK_MEDIA_ROOT", { meta: { mediaRoot } });
23944
23953
  }
@@ -27112,7 +27121,8 @@ var PipelineAnalyticsAddon = class extends require_dist.BaseAddon {
27112
27121
  className: source.className,
27113
27122
  embedding,
27114
27123
  modelId,
27115
- confidence: Number.POSITIVE_INFINITY,
27124
+ confidence: source.confidence,
27125
+ force: true,
27116
27126
  ...source.mediaKey !== void 0 ? { mediaKey: source.mediaKey } : {},
27117
27127
  ...source.keyFrameMediaKey !== void 0 ? { keyFrameMediaKey: source.keyFrameMediaKey } : {}
27118
27128
  });
@@ -1,4 +1,4 @@
1
- import { $ as unknown, A as kebabToCamel, B as DeviceType, C as cosineSimilarity, D as encodeVectorBase64, F as subKindsOf, G as _enum, H as hydrateSchema, I as videoclipsCapability, J as literal, K as array, L as zoneAnalyticsCapability, M as pipelineAnalyticsCapability, N as plateGalleryCapability, O as faceGalleryCapability, P as readDeviceStateFrom, Q as string, R as errMsg, S as buildEventKindDescriptor, T as defineCustomActions, U as isDeviceScopedCap, V as createEvent, W as nodePin, X as object, Y as number, Z as record, _ as TimelapseRuleInputSchema, a as MACRO_LABELS, b as alarmPanelCapability, c as NcConditionDescriptorSchema, d as NcRuleSchema, et as EventCategory, f as NcSnoozeInputSchema, g as OpsLogEntrySchema, h as NcTaxonomySchema, i as EVENT_PAD_MS, j as notificationRulesCapability, l as NcRuleInputSchema, m as NcSnoozeSuppressedSchema, n as DEFAULT_EVENT_COLOR, o as NC_CONDITION_CATALOG, p as NcSnoozeSchema, q as boolean, r as EVENT_KIND_BY_CAP, s as NC_TAXONOMY, t as BaseDevice, u as NcRulePatchSchema, v as TimelapseRuleSchema, w as customAction, x as audioMetricsCapability, y as addonWidgetsSourceCapability, z as BaseAddon } from "../dist-D4eie2px.mjs";
1
+ import { $ as unknown, A as kebabToCamel, B as DeviceType, C as cosineSimilarity, D as encodeVectorBase64, F as subKindsOf, G as _enum, H as hydrateSchema, I as videoclipsCapability, J as literal, K as array, L as zoneAnalyticsCapability, M as pipelineAnalyticsCapability, N as plateGalleryCapability, O as faceGalleryCapability, P as readDeviceStateFrom, Q as string, R as errMsg, S as buildEventKindDescriptor, T as defineCustomActions, U as isDeviceScopedCap, V as createEvent, W as nodePin, X as object, Y as number, Z as record, _ as TimelapseRuleInputSchema, a as MACRO_LABELS, b as alarmPanelCapability, c as NcConditionDescriptorSchema, d as NcRuleSchema, et as EventCategory, f as NcSnoozeInputSchema, g as OpsLogEntrySchema, h as NcTaxonomySchema, i as EVENT_PAD_MS, j as notificationRulesCapability, l as NcRuleInputSchema, m as NcSnoozeSuppressedSchema, n as DEFAULT_EVENT_COLOR, o as NC_CONDITION_CATALOG, p as NcSnoozeSchema, q as boolean, r as EVENT_KIND_BY_CAP, s as NC_TAXONOMY, t as BaseDevice, u as NcRulePatchSchema, v as TimelapseRuleSchema, w as customAction, x as audioMetricsCapability, y as addonWidgetsSourceCapability, z as BaseAddon } from "../dist-BoV5RsRC.mjs";
2
2
  import { promises } from "node:fs";
3
3
  import path from "node:path";
4
4
  import { createHmac, randomUUID, timingSafeEqual } from "node:crypto";
@@ -20615,16 +20615,25 @@ var ObjectEmbeddingStore = class {
20615
20615
  * Upsert the best-confidence embedding for a track. At most ONE row per
20616
20616
  * track: a write only replaces the stored row when its confidence is
20617
20617
  * strictly higher, keeping the track's best crop over its lifetime.
20618
+ *
20619
+ * `force` BYPASSES that gate — it does not try to out-score it. A rebuild
20620
+ * first attempted to win by writing `confidence: Infinity`, which worked
20621
+ * exactly once: the stored row then held Infinity, `Infinity <= Infinity`
20622
+ * short-circuited, and every later pass silently wrote nothing while
20623
+ * reporting hundreds rebuilt. Observed live — 214 "rebuilt" moved the index
20624
+ * by 4 rows.
20618
20625
  */
20619
20626
  async upsertIfBetter(input) {
20620
20627
  if (input.embedding.length === 0) return;
20621
20628
  if (!await this.ensureIndex(input.embedding.length)) return;
20622
20629
  try {
20623
- const stored = (await this.vectorStore.getByIds.query({
20624
- index: OBJECT_CLIP_INDEX,
20625
- ids: [input.trackId]
20626
- })).items[0]?.metadata["confidence"];
20627
- if (typeof stored === "number" && input.confidence <= stored) return;
20630
+ if (input.force !== true) {
20631
+ const stored = (await this.vectorStore.getByIds.query({
20632
+ index: OBJECT_CLIP_INDEX,
20633
+ ids: [input.trackId]
20634
+ })).items[0]?.metadata["confidence"];
20635
+ if (typeof stored === "number" && input.confidence <= stored) return;
20636
+ }
20628
20637
  if ((await this.vectorStore.upsert.mutate({
20629
20638
  index: "object-clip",
20630
20639
  items: [{
@@ -27106,7 +27115,8 @@ var PipelineAnalyticsAddon = class extends BaseAddon {
27106
27115
  className: source.className,
27107
27116
  embedding,
27108
27117
  modelId,
27109
- confidence: Number.POSITIVE_INFINITY,
27118
+ confidence: source.confidence,
27119
+ force: true,
27110
27120
  ...source.mediaKey !== void 0 ? { mediaKey: source.mediaKey } : {},
27111
27121
  ...source.keyFrameMediaKey !== void 0 ? { keyFrameMediaKey: source.keyFrameMediaKey } : {}
27112
27122
  });
@@ -30,7 +30,7 @@ async function d(e) {
30
30
  }
31
31
  }
32
32
  async function f() {
33
- return l ||= d(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-DX4bQCYL.mjs")).catch((e) => {
33
+ return l ||= d(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-DvfzPjZx.mjs")).catch((e) => {
34
34
  throw l = void 0, e;
35
35
  }), l;
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-post-analysis",
3
- "version": "1.2.43",
3
+ "version": "1.2.45",
4
4
  "description": "Post-Analysis bundle — enrichment, embedding-encoder, pipeline-analytics. Multi-entry npm package shipping addons that consume pipeline output.",
5
5
  "keywords": [
6
6
  "camstack",