@camstack/types 1.2.36 → 1.2.37

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/dist/addon.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_event_category = require("./event-category-BE4PDZ_3.js");
3
- const require_sleep = require("./sleep-C6W2qcHX.js");
3
+ const require_sleep = require("./sleep-CknKIHHE.js");
4
4
  const require_err_msg = require("./err-msg-COpsHMw2.js");
5
5
  //#region src/generated/collection-array-methods.ts
6
6
  /**
package/dist/addon.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as EventCategory } from "./event-category-41fKf-q9.mjs";
2
- import { B as scopeKey, C as DeviceType, F as readNodePin, I as ReadinessRegistry, L as ReadinessTimeoutError, O as expandCapMethods, P as nodePin, a as asJsonObject, d as DEVICE_SCOPED_CAPS, f as isDeviceScopedCap, ft as DATAPLANE_SECRET_HEADER, ht as normalizeAddonInitResult, mt as BaseAddon, p as createDeviceProxy, pt as DisposerChain, s as asString, t as sleep, u as parseJsonUnknown, v as deviceOpsCapability, vt as emitReadiness, w as adminUiCapability, y as viewerUiCapability } from "./sleep-BeLSE-Rr.mjs";
2
+ import { B as scopeKey, C as DeviceType, F as readNodePin, I as ReadinessRegistry, L as ReadinessTimeoutError, O as expandCapMethods, P as nodePin, a as asJsonObject, d as DEVICE_SCOPED_CAPS, f as isDeviceScopedCap, ft as DATAPLANE_SECRET_HEADER, ht as normalizeAddonInitResult, mt as BaseAddon, p as createDeviceProxy, pt as DisposerChain, s as asString, t as sleep, u as parseJsonUnknown, v as deviceOpsCapability, vt as emitReadiness, w as adminUiCapability, y as viewerUiCapability } from "./sleep-CSXrF9oC.mjs";
3
3
  import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
4
4
  //#region src/generated/collection-array-methods.ts
5
5
  /**
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { type InferProvider } from './capability-definition.js';
3
2
  import { DeviceType } from '../device/device-type.js';
3
+ import { type InferProvider } from './capability-definition.js';
4
4
  /**
5
5
  * pipeline-analytics — device-scoped wrapper cap. Refines raw
6
6
  * per-frame detections emitted by the pipeline runner into tracked
@@ -1657,6 +1657,21 @@ export declare const pipelineAnalyticsCapability: {
1657
1657
  timestamp: z.ZodNumber;
1658
1658
  score: z.ZodNumber;
1659
1659
  }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
1660
+ readonly rebuildObjectEmbeddings: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
1661
+ deviceId: z.ZodOptional<z.ZodNumber>;
1662
+ since: z.ZodOptional<z.ZodNumber>;
1663
+ until: z.ZodOptional<z.ZodNumber>;
1664
+ cropMargin: z.ZodOptional<z.ZodNumber>;
1665
+ square: z.ZodOptional<z.ZodBoolean>;
1666
+ maxTracks: z.ZodOptional<z.ZodNumber>;
1667
+ }, z.core.$strip>, z.ZodObject<{
1668
+ scanned: z.ZodNumber;
1669
+ rebuilt: z.ZodNumber;
1670
+ missingKeyFrame: z.ZodNumber;
1671
+ missingBbox: z.ZodNumber;
1672
+ failed: z.ZodNumber;
1673
+ complete: z.ZodBoolean;
1674
+ }, z.core.$strip>, "mutation">;
1660
1675
  };
1661
1676
  readonly events: {
1662
1677
  /**
@@ -1728,6 +1743,6 @@ export declare const pipelineAnalyticsCapability: {
1728
1743
  };
1729
1744
  };
1730
1745
  export type IPipelineAnalyticsProvider = InferProvider<typeof pipelineAnalyticsCapability>;
1731
- export { TrackStateSchema, EventKindSchema, TrackSchema, TrackEnvelopeSchema, TrackProjectionSchema, RecentTracksQueryInput, RecentTracksPageSchema, TrackAudioLabelSchema, TrackCascadeCountsSchema, TrackZoneFilterSchema, EventKindDescriptorSchema, EventKindsForDeviceSchema, MediaFileInfoSchema, SensorEventSchema, KeyEventSchema, MotionEventSchema, ObjectEventSchema, AudioEventSchema, MediaFileKindEnum, MediaFileSchema,
1746
+ export { AudioEventSchema, EventKindDescriptorSchema, EventKindSchema, EventKindsForDeviceSchema, KeyEventSchema, MediaFileInfoSchema, MediaFileKindEnum, MediaFileSchema, MotionEventSchema, ObjectEventSchema, RecentTracksPageSchema, RecentTracksQueryInput, SensorEventSchema, TrackAudioLabelSchema, TrackCascadeCountsSchema, TrackEnvelopeSchema,
1732
1747
  /** No longer carried on onFrameTracked (two-plane re-injection) — kept for compat. */
1733
- TrackedDetectionSchema, };
1748
+ TrackedDetectionSchema, TrackProjectionSchema, TrackSchema, TrackStateSchema, TrackZoneFilterSchema, };
@@ -4812,6 +4812,13 @@ export type AppRouter = TrpcCoreRouter<{
4812
4812
  output: z.infer<typeof pipelineAnalyticsCapability.methods.searchObjectEvents.output>;
4813
4813
  meta: object;
4814
4814
  }>;
4815
+ rebuildObjectEmbeddings: TRPCMutationProcedure<{
4816
+ input: {
4817
+ [x: string]: unknown;
4818
+ } & z.input<typeof pipelineAnalyticsCapability.methods.rebuildObjectEmbeddings.input>;
4819
+ output: z.infer<typeof pipelineAnalyticsCapability.methods.rebuildObjectEmbeddings.output>;
4820
+ meta: object;
4821
+ }>;
4815
4822
  }>>;
4816
4823
  pipelineExecutor: TRPCBuiltRouter<{
4817
4824
  ctx: TrpcContext;
@@ -6,7 +6,7 @@
6
6
  * scope+access check inside `protectedProcedure` (see
7
7
  * `server/backend/src/api/trpc/trpc.middleware.ts`).
8
8
  *
9
- * Coverage: 863 method paths across 120 capabilities.
9
+ * Coverage: 864 method paths across 120 capabilities.
10
10
  */
11
11
  import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
12
12
  export interface MethodAccessRecord {
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_event_category = require("./event-category-BE4PDZ_3.js");
3
- const require_sleep = require("./sleep-C6W2qcHX.js");
3
+ const require_sleep = require("./sleep-CknKIHHE.js");
4
4
  const require_enums = require("./enums.js");
5
5
  const require_err_msg = require("./err-msg-COpsHMw2.js");
6
6
  let zod = require("zod");
@@ -11707,6 +11707,42 @@ var EventPruneCountsSchema = zod.z.object({
11707
11707
  object: zod.z.number().int(),
11708
11708
  audio: zod.z.number().int()
11709
11709
  });
11710
+ /**
11711
+ * Re-embed stored tracks from their key frames.
11712
+ *
11713
+ * The reason this is an operator-callable method and not a migration script:
11714
+ * every knob that decides what a vector MEANS — encoder model, crop margin,
11715
+ * squaring — is only changeable if the existing vectors can be regenerated.
11716
+ * Mixing feature spaces in one index makes cosine scores incomparable, and the
11717
+ * symptom is a quality regression with no visible cause.
11718
+ */
11719
+ var RebuildObjectEmbeddingsInput = zod.z.object({
11720
+ /** Restrict to one camera. Omit for the whole fleet. */
11721
+ deviceId: zod.z.number().optional(),
11722
+ since: zod.z.number().optional(),
11723
+ until: zod.z.number().optional(),
11724
+ /**
11725
+ * Fraction added on EACH side of the detection box before cropping.
11726
+ * ~0.2 (a 1.4x window) gives CLIP the surroundings it is trained on; 0 is
11727
+ * the pixel-tight crop the first implementation used.
11728
+ */
11729
+ cropMargin: zod.z.number().min(0).max(4).optional(),
11730
+ /** Square the window before extracting, so a tall subject is not squashed. */
11731
+ square: zod.z.boolean().optional(),
11732
+ /** Stop after this many tracks; the result reports whether more remain. */
11733
+ maxTracks: zod.z.number().int().positive().optional()
11734
+ });
11735
+ var RebuildObjectEmbeddingsResultSchema = zod.z.object({
11736
+ scanned: zod.z.number(),
11737
+ rebuilt: zod.z.number(),
11738
+ /** Tracks whose key frame is gone — nothing to re-embed from. */
11739
+ missingKeyFrame: zod.z.number(),
11740
+ /** Tracks with no usable detection box. */
11741
+ missingBbox: zod.z.number(),
11742
+ failed: zod.z.number(),
11743
+ /** False when the pass stopped at `maxTracks` with tracks left. */
11744
+ complete: zod.z.boolean()
11745
+ });
11710
11746
  var pipelineAnalyticsCapability = {
11711
11747
  name: "pipeline-analytics",
11712
11748
  scope: "device",
@@ -11979,7 +12015,12 @@ var pipelineAnalyticsCapability = {
11979
12015
  * ObjectEvents by trackId. Returns up to `limit` events scored ≥
11980
12016
  * `minScore`, sorted descending by score.
11981
12017
  */
11982
- searchObjectEvents: require_sleep.method(SearchObjectEventsInput, zod.z.array(ScoredObjectEventSchema).readonly())
12018
+ searchObjectEvents: require_sleep.method(SearchObjectEventsInput, zod.z.array(ScoredObjectEventSchema).readonly()),
12019
+ rebuildObjectEmbeddings: require_sleep.method(RebuildObjectEmbeddingsInput, RebuildObjectEmbeddingsResultSchema, {
12020
+ kind: "mutation",
12021
+ auth: "admin",
12022
+ timeoutMs: 30 * 6e4
12023
+ })
11983
12024
  },
11984
12025
  events: {
11985
12026
  /**
@@ -30321,6 +30362,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
30321
30362
  addonId: null,
30322
30363
  access: "create"
30323
30364
  },
30365
+ "pipelineAnalytics.rebuildObjectEmbeddings": {
30366
+ capName: "pipeline-analytics",
30367
+ capScope: "device",
30368
+ addonId: null,
30369
+ access: "create"
30370
+ },
30324
30371
  "pipelineAnalytics.relocateMedia": {
30325
30372
  capName: "pipeline-analytics",
30326
30373
  capScope: "device",
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as EventCategory } from "./event-category-41fKf-q9.mjs";
2
- import { $ as ProfileRtspEntrySchema, A as method, B as scopeKey, C as DeviceType, Ct as collectHydratedFieldValues, D as event, E as DEVICE_STATUS_METHOD, F as readNodePin, G as CamStreamKindSchema, H as BrokerStatusSchema, I as ReadinessRegistry, J as DecodedAudioChunkSchema, K as CamStreamResolutionSchema, L as ReadinessTimeoutError, M as systemMethod, N as CAP_NODE_PIN_CONTEXT_KEY, O as expandCapMethods, P as nodePin, Q as FrameHandleSchema, R as emitDownForOwnedCaps, S as DeviceRole, St as collectHydratedFieldEntries, T as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Tt as resolveHydratedFieldValue, U as CAM_PROFILE_ORDER, V as BrokerStatsSchema, W as CamProfileSchema, X as EncodedPacketSchema, Y as DecodedFrameSchema, Z as FrameHandleFormatSchema, _ as RawStateResultSchema, _t as createEvent, a as asJsonObject, at as SubscribeAudioChunksResultSchema, b as ChargingStatus, bt as WELL_KNOWN_TABS, c as parseJsonArray, ct as makeProfileBrokerId, d as DEVICE_SCOPED_CAPS, dt as selectAssignedProfileSlots, et as ProfileSlotSchema, f as isDeviceScopedCap, ft as DATAPLANE_SECRET_HEADER, g as createSliceHandle, gt as createDurableState, h as createMirrorSource, ht as normalizeAddonInitResult, i as asJsonArray, it as SubscribeAudioChunksInputSchema, j as resolveCapMount, k as isDeviceConfigCap, l as parseJsonObject, lt as makeSourceBrokerId, m as createLazyTrpcSource, mt as BaseAddon, n as sleepCancellable, nt as StreamSourceEntrySchema, o as asNumber, ot as SubscribeFramesInputSchema, p as createDeviceProxy, pt as DisposerChain, q as CameraStreamSchema, r as asBoolean, rt as StreamSourceSchema, s as asString, st as SubscribeFramesResultSchema, t as sleep, tt as ProfileSlotStatusSchema, u as parseJsonUnknown, ut as parseProfileBrokerId, v as deviceOpsCapability, vt as emitReadiness, w as adminUiCapability, wt as hydrateSchema, x as DeviceFeature, xt as WELL_KNOWN_TAB_MAP, y as viewerUiCapability, yt as isEvent, z as readinessKey } from "./sleep-BeLSE-Rr.mjs";
2
+ import { $ as ProfileRtspEntrySchema, A as method, B as scopeKey, C as DeviceType, Ct as collectHydratedFieldValues, D as event, E as DEVICE_STATUS_METHOD, F as readNodePin, G as CamStreamKindSchema, H as BrokerStatusSchema, I as ReadinessRegistry, J as DecodedAudioChunkSchema, K as CamStreamResolutionSchema, L as ReadinessTimeoutError, M as systemMethod, N as CAP_NODE_PIN_CONTEXT_KEY, O as expandCapMethods, P as nodePin, Q as FrameHandleSchema, R as emitDownForOwnedCaps, S as DeviceRole, St as collectHydratedFieldEntries, T as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Tt as resolveHydratedFieldValue, U as CAM_PROFILE_ORDER, V as BrokerStatsSchema, W as CamProfileSchema, X as EncodedPacketSchema, Y as DecodedFrameSchema, Z as FrameHandleFormatSchema, _ as RawStateResultSchema, _t as createEvent, a as asJsonObject, at as SubscribeAudioChunksResultSchema, b as ChargingStatus, bt as WELL_KNOWN_TABS, c as parseJsonArray, ct as makeProfileBrokerId, d as DEVICE_SCOPED_CAPS, dt as selectAssignedProfileSlots, et as ProfileSlotSchema, f as isDeviceScopedCap, ft as DATAPLANE_SECRET_HEADER, g as createSliceHandle, gt as createDurableState, h as createMirrorSource, ht as normalizeAddonInitResult, i as asJsonArray, it as SubscribeAudioChunksInputSchema, j as resolveCapMount, k as isDeviceConfigCap, l as parseJsonObject, lt as makeSourceBrokerId, m as createLazyTrpcSource, mt as BaseAddon, n as sleepCancellable, nt as StreamSourceEntrySchema, o as asNumber, ot as SubscribeFramesInputSchema, p as createDeviceProxy, pt as DisposerChain, q as CameraStreamSchema, r as asBoolean, rt as StreamSourceSchema, s as asString, st as SubscribeFramesResultSchema, t as sleep, tt as ProfileSlotStatusSchema, u as parseJsonUnknown, ut as parseProfileBrokerId, v as deviceOpsCapability, vt as emitReadiness, w as adminUiCapability, wt as hydrateSchema, x as DeviceFeature, xt as WELL_KNOWN_TAB_MAP, y as viewerUiCapability, yt as isEvent, z as readinessKey } from "./sleep-CSXrF9oC.mjs";
3
3
  import { EventSourceType } from "./enums.mjs";
4
4
  import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
5
5
  import { z } from "zod";
@@ -11706,6 +11706,42 @@ var EventPruneCountsSchema = z.object({
11706
11706
  object: z.number().int(),
11707
11707
  audio: z.number().int()
11708
11708
  });
11709
+ /**
11710
+ * Re-embed stored tracks from their key frames.
11711
+ *
11712
+ * The reason this is an operator-callable method and not a migration script:
11713
+ * every knob that decides what a vector MEANS — encoder model, crop margin,
11714
+ * squaring — is only changeable if the existing vectors can be regenerated.
11715
+ * Mixing feature spaces in one index makes cosine scores incomparable, and the
11716
+ * symptom is a quality regression with no visible cause.
11717
+ */
11718
+ var RebuildObjectEmbeddingsInput = z.object({
11719
+ /** Restrict to one camera. Omit for the whole fleet. */
11720
+ deviceId: z.number().optional(),
11721
+ since: z.number().optional(),
11722
+ until: z.number().optional(),
11723
+ /**
11724
+ * Fraction added on EACH side of the detection box before cropping.
11725
+ * ~0.2 (a 1.4x window) gives CLIP the surroundings it is trained on; 0 is
11726
+ * the pixel-tight crop the first implementation used.
11727
+ */
11728
+ cropMargin: z.number().min(0).max(4).optional(),
11729
+ /** Square the window before extracting, so a tall subject is not squashed. */
11730
+ square: z.boolean().optional(),
11731
+ /** Stop after this many tracks; the result reports whether more remain. */
11732
+ maxTracks: z.number().int().positive().optional()
11733
+ });
11734
+ var RebuildObjectEmbeddingsResultSchema = z.object({
11735
+ scanned: z.number(),
11736
+ rebuilt: z.number(),
11737
+ /** Tracks whose key frame is gone — nothing to re-embed from. */
11738
+ missingKeyFrame: z.number(),
11739
+ /** Tracks with no usable detection box. */
11740
+ missingBbox: z.number(),
11741
+ failed: z.number(),
11742
+ /** False when the pass stopped at `maxTracks` with tracks left. */
11743
+ complete: z.boolean()
11744
+ });
11709
11745
  var pipelineAnalyticsCapability = {
11710
11746
  name: "pipeline-analytics",
11711
11747
  scope: "device",
@@ -11978,7 +12014,12 @@ var pipelineAnalyticsCapability = {
11978
12014
  * ObjectEvents by trackId. Returns up to `limit` events scored ≥
11979
12015
  * `minScore`, sorted descending by score.
11980
12016
  */
11981
- searchObjectEvents: method(SearchObjectEventsInput, z.array(ScoredObjectEventSchema).readonly())
12017
+ searchObjectEvents: method(SearchObjectEventsInput, z.array(ScoredObjectEventSchema).readonly()),
12018
+ rebuildObjectEmbeddings: method(RebuildObjectEmbeddingsInput, RebuildObjectEmbeddingsResultSchema, {
12019
+ kind: "mutation",
12020
+ auth: "admin",
12021
+ timeoutMs: 30 * 6e4
12022
+ })
11982
12023
  },
11983
12024
  events: {
11984
12025
  /**
@@ -30320,6 +30361,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
30320
30361
  addonId: null,
30321
30362
  access: "create"
30322
30363
  },
30364
+ "pipelineAnalytics.rebuildObjectEmbeddings": {
30365
+ capName: "pipeline-analytics",
30366
+ capScope: "device",
30367
+ addonId: null,
30368
+ access: "create"
30369
+ },
30323
30370
  "pipelineAnalytics.relocateMedia": {
30324
30371
  capName: "pipeline-analytics",
30325
30372
  capScope: "device",
@@ -3164,6 +3164,7 @@ function createDeviceProxy(api, binding, opts) {
3164
3164
  getTrackMedia: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getTrackMedia", "query", input),
3165
3165
  listTrackMedia: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "listTrackMedia", "query", input),
3166
3166
  searchObjectEvents: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "searchObjectEvents", "query", input),
3167
+ rebuildObjectEmbeddings: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "rebuildObjectEmbeddings", "mutation", input),
3167
3168
  getDeviceSettingsContribution: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getDeviceSettingsContribution", "query", input),
3168
3169
  getDeviceLiveContribution: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getDeviceLiveContribution", "query", input),
3169
3170
  applyDeviceSettingsPatch: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "applyDeviceSettingsPatch", "mutation", input)
@@ -3164,6 +3164,7 @@ function createDeviceProxy(api, binding, opts) {
3164
3164
  getTrackMedia: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getTrackMedia", "query", input),
3165
3165
  listTrackMedia: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "listTrackMedia", "query", input),
3166
3166
  searchObjectEvents: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "searchObjectEvents", "query", input),
3167
+ rebuildObjectEmbeddings: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "rebuildObjectEmbeddings", "mutation", input),
3167
3168
  getDeviceSettingsContribution: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getDeviceSettingsContribution", "query", input),
3168
3169
  getDeviceLiveContribution: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getDeviceLiveContribution", "query", input),
3169
3170
  applyDeviceSettingsPatch: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "applyDeviceSettingsPatch", "mutation", input)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.36",
3
+ "version": "1.2.37",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",