@camstack/addon-model-studio 1.1.263 → 1.1.264

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.
Files changed (17) hide show
  1. package/dist/{MotionZonesSettings-DtoUJxd6.mjs → MotionZonesSettings-DXOf3xDp.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-Bd5lL0CO.mjs → PrivacyMaskSettings-DasEXHXg.mjs} +4 -4
  3. package/dist/{SceneMonitorEditor-BG0CBUrr.mjs → SceneMonitorEditor-ClVvQVl6.mjs} +3 -3
  4. package/dist/_stub.js +10 -10
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-DANjfgEB.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-CU96npOu.mjs} +3 -3
  6. package/dist/{_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DlW3IlLM.mjs → _virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-B0F3F6BP.mjs} +1 -1
  7. package/dist/{hostInit-DE_6Mq5X.mjs → hostInit-Bsv1Txh4.mjs} +2 -2
  8. package/dist/model-studio.addon.js +166 -24
  9. package/dist/model-studio.addon.mjs +166 -24
  10. package/dist/{player-overlays-DXeDukPC.mjs → player-overlays-BWxIhTSh.mjs} +1 -1
  11. package/dist/remoteEntry.js +1 -1
  12. package/dist/{responsive-D9Bo78lO.mjs → responsive-Bb8t1Rws.mjs} +1 -1
  13. package/dist/{scene-monitor-copy-CQr7egaT.mjs → scene-monitor-copy-Bps8TGiG.mjs} +1 -1
  14. package/dist/{square-d__poSpa.mjs → square-DSJt_nVw.mjs} +1 -1
  15. package/dist/{trash-2-C0XdoZQu.mjs → trash-2-CzUTU-oX.mjs} +1 -1
  16. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-CxkFEexB.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-DSJOnpOj.mjs} +1 -1
  17. package/package.json +1 -1
@@ -5756,7 +5756,7 @@ var ZodIssueCode = {
5756
5756
  var ZodFirstPartyTypeKind;
5757
5757
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5758
5758
  //#endregion
5759
- //#region ../types/dist/sleep-DRqxtc0C.mjs
5759
+ //#region ../types/dist/sleep-bwsTj221.mjs
5760
5760
  /**
5761
5761
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5762
5762
  * window to float samples (D455).
@@ -7007,7 +7007,6 @@ function createHandle(raw, opts) {
7007
7007
  const writeAddon = (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p));
7008
7008
  const readAddonStoreResult = raw.readAddonStoreResult;
7009
7009
  const readAddonStoreKeyResult = raw.readAddonStoreKeyResult;
7010
- const readDeviceStoreBatch = raw.readDeviceStoreBatch;
7011
7010
  const overrides = {
7012
7011
  readAddonStore: async () => resolveRead("addon", await raw.readAddonStore()),
7013
7012
  ...readAddonStoreResult !== void 0 ? { readAddonStoreResult: async () => {
@@ -7031,12 +7030,12 @@ function createHandle(raw, opts) {
7031
7030
  };
7032
7031
  } } : {},
7033
7032
  readDeviceStore: async (deviceId) => resolveRead(`device:${deviceId}`, await raw.readDeviceStore(deviceId)),
7034
- ...readDeviceStoreBatch !== void 0 ? { readDeviceStoreBatch: async (deviceIds) => {
7035
- const rows = await readDeviceStoreBatch.call(raw, deviceIds);
7033
+ readDeviceStoreBatch: async (deviceIds) => {
7034
+ const rows = await raw.readDeviceStoreBatch(deviceIds);
7036
7035
  const out = /* @__PURE__ */ new Map();
7037
7036
  for (const [deviceId, blob] of rows) out.set(deviceId, await resolveRead(`device:${deviceId}`, blob));
7038
7037
  return out;
7039
- } } : {},
7038
+ },
7040
7039
  writeAddonStore: async (patch) => {
7041
7040
  await writeAddon(patch);
7042
7041
  },
@@ -7863,7 +7862,7 @@ var BaseAddon = class {
7863
7862
  return this._addonSecretTree;
7864
7863
  }
7865
7864
  deviceSecretTree() {
7866
- this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
7865
+ this._deviceSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.deviceSettingsSchema()), this.secretStatePaths);
7867
7866
  return this._deviceSecretTree;
7868
7867
  }
7869
7868
  /**
@@ -7939,42 +7938,135 @@ var BaseAddon = class {
7939
7938
  this[timerOf] = timer;
7940
7939
  }
7941
7940
  /**
7942
- * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
7943
- * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
7944
- * swap, or any race where the SqliteSettingsBackend is between shutdown and
7945
- * re-initialize) doesn't propagate up into `initialize()` and leave the
7941
+ * Wrap `ctx.settings.readAddonStore()` with a retry budget so a transient
7942
+ * settings-store outage doesn't propagate up into `initialize()` and leave the
7946
7943
  * addon permanently broken.
7947
7944
  *
7948
- * Retry only the two known infra fingerprints. Anything else propagates so
7949
- * real bugs surface immediately. After the budget expires we fall back to
7950
- * `{}` (defaults) — the addon's first successful patch will rehydrate.
7945
+ * Two kinds of outage, two budgets:
7946
+ * - the store's own restart fingerprints (`SqliteSettingsBackend not
7947
+ * initialized`, `provider not available`): a short budget, then the addon
7948
+ * falls back to `{}` (defaults) - its first successful patch rehydrates;
7949
+ * - a TRANSPORT failure (the hub is restarting while this runner boots:
7950
+ * `discovery deadline exceeded`, `parent could not route`, a refused or
7951
+ * timed-out connection). Since D870 a runner's settings read THROWS instead
7952
+ * of answering `{}`, so without a budget a hub restart ends in a respawn
7953
+ * loop. A long, bounded budget; only after it the error propagates - the
7954
+ * addon never runs on defaults for a store it could not ask.
7955
+ * Anything else propagates immediately so real bugs surface.
7951
7956
  */
7952
7957
  async readAddonStoreWithRetry() {
7953
7958
  const settings = this.rawSettings();
7954
7959
  if (!settings) return {};
7955
- const delaysMs = [
7956
- 150,
7957
- 350,
7958
- 600,
7959
- 900
7960
- ];
7961
7960
  let lastErr;
7962
- for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
7961
+ for (let attempt = 0;; attempt++) try {
7963
7962
  const stored = await settings.readAddonStore() ?? {};
7964
7963
  this.settingsStoreReady = true;
7965
7964
  return stored;
7966
7965
  } catch (err) {
7967
7966
  lastErr = err;
7968
- const msg = err instanceof Error ? err.message : String(err);
7969
- if (!(msg.includes("SqliteSettingsBackend not initialized") || msg.includes("provider not available"))) throw err;
7970
- if (attempt === delaysMs.length) break;
7971
- await new Promise((r) => setTimeout(r, delaysMs[attempt]));
7967
+ const kind = classifyStoreError(err);
7968
+ if (kind === "permanent") throw err;
7969
+ const delay = (kind === "transport" ? TRANSPORT_RETRY_DELAYS_MS : RESTART_RETRY_DELAYS_MS)[attempt];
7970
+ if (delay === void 0) {
7971
+ if (kind === "transport") throw err;
7972
+ break;
7973
+ }
7974
+ await new Promise((r) => setTimeout(r, delay));
7972
7975
  }
7973
7976
  this.settingsStoreReady = false;
7974
7977
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
7975
7978
  return {};
7976
7979
  }
7977
7980
  };
7981
+ /** The settings store's own restart fingerprints. */
7982
+ var RESTART_RETRY_DELAYS_MS = [
7983
+ 150,
7984
+ 350,
7985
+ 600,
7986
+ 900
7987
+ ];
7988
+ /** A hub restarting under a booting runner: ~100 s in total. */
7989
+ var TRANSPORT_RETRY_DELAYS_MS = [
7990
+ 150,
7991
+ 350,
7992
+ 600,
7993
+ 900,
7994
+ 2e3,
7995
+ 5e3,
7996
+ 1e4,
7997
+ 2e4,
7998
+ 3e4,
7999
+ 3e4
8000
+ ];
8001
+ var RESTART_FINGERPRINTS = ["SqliteSettingsBackend not initialized", "provider not available"];
8002
+ /** Node / socket error codes of a connection that did not happen or broke. */
8003
+ var TRANSPORT_CODES = new Set([
8004
+ "ECONNREFUSED",
8005
+ "ECONNRESET",
8006
+ "ETIMEDOUT",
8007
+ "EPIPE",
8008
+ "EHOSTUNREACH",
8009
+ "ENETUNREACH"
8010
+ ]);
8011
+ /** tRPC error codes that mean "the other side is not answering now", not "your call is wrong". */
8012
+ var UNAVAILABLE_TRPC_CODES = new Set([
8013
+ "TIMEOUT",
8014
+ "SERVICE_UNAVAILABLE",
8015
+ "BAD_GATEWAY",
8016
+ "GATEWAY_TIMEOUT"
8017
+ ]);
8018
+ /** The exact phrases OUR transport raises when it cannot reach the hub. */
8019
+ var TRANSPORT_PHRASES = [
8020
+ "discovery deadline exceeded",
8021
+ "parent could not route child unowned cap call",
8022
+ "UDS request timed out after",
8023
+ "channel closed"
8024
+ ];
8025
+ /** Moleculer error `type`s of a call that could not be served right now. */
8026
+ var MOLECULER_TRANSIENT_TYPES = new Set([
8027
+ "REQUEST_TIMEOUT",
8028
+ "SERVICE_NOT_FOUND",
8029
+ "SERVICE_NOT_AVAILABLE",
8030
+ "REQUEST_REJECTED",
8031
+ "BROKER_DISCONNECTED"
8032
+ ]);
8033
+ function stringProp(value, key) {
8034
+ if (typeof value !== "object" || value === null) return void 0;
8035
+ const found = Reflect.get(value, key);
8036
+ return typeof found === "string" ? found : void 0;
8037
+ }
8038
+ /** The code an error carries: its own, its cause's, or a tRPC `data.code`. */
8039
+ function errorCode(err) {
8040
+ const out = {};
8041
+ const cause = typeof err === "object" && err !== null ? Reflect.get(err, "cause") : void 0;
8042
+ const data = typeof err === "object" && err !== null ? Reflect.get(err, "data") : void 0;
8043
+ const node = stringProp(err, "code") ?? stringProp(cause, "code");
8044
+ if (node !== void 0) out.node = node;
8045
+ const trpc = stringProp(data, "code");
8046
+ if (trpc !== void 0) out.trpc = trpc;
8047
+ return out;
8048
+ }
8049
+ /**
8050
+ * Is a settings read failure worth retrying, and with which budget? Only
8051
+ * EXPLICIT signals count: a socket error code, a tRPC "unavailable" code, or
8052
+ * one of the exact phrases our own transport raises. A message that merely
8053
+ * contains "timed out" or "unreachable" is not evidence of anything, and
8054
+ * `settings store not wired` is a wiring bug that retrying cannot fix.
8055
+ */
8056
+ function classifyStoreError(err) {
8057
+ const message = err instanceof Error ? err.message : String(err);
8058
+ if (RESTART_FINGERPRINTS.some((f) => message.includes(f))) return "restart";
8059
+ const code = errorCode(err);
8060
+ if (code.node !== void 0 && TRANSPORT_CODES.has(code.node)) return "transport";
8061
+ if (code.trpc !== void 0 && UNAVAILABLE_TRPC_CODES.has(code.trpc)) return "transport";
8062
+ if (typeof err === "object" && err !== null) {
8063
+ if (Reflect.get(err, "retryable") === true) return "transport";
8064
+ const type = stringProp(err, "type");
8065
+ if (type !== void 0 && MOLECULER_TRANSIENT_TYPES.has(type)) return "transport";
8066
+ }
8067
+ if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
8068
+ return "permanent";
8069
+ }
7978
8070
  /**
7979
8071
  * Collect the keys of every field marked `perNode: true`, recursing into
7980
8072
  * layout containers (`group` fields and `sub-tabs` tabs) the same way
@@ -16452,6 +16544,28 @@ id: union([string(), number()]) }), {
16452
16544
  kind: "mutation",
16453
16545
  auth: "admin"
16454
16546
  });
16547
+ /** One table of the settings database. */
16548
+ var StorageTableSchema = object({
16549
+ /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
16550
+ name: string(),
16551
+ /** The owner prefix of a scoped name (`recorder` for `recorder:addon-settings`), else null. */
16552
+ owner: string().nullable(),
16553
+ rows: number().int().nonnegative(),
16554
+ /** Bytes the table's pages occupy (`dbstat`); null when the engine cannot measure. */
16555
+ bytes: number().int().nonnegative().nullable(),
16556
+ /** Declared by an addon since this engine process started (a running addon claims it). */
16557
+ declaredThisBoot: boolean()
16558
+ });
16559
+ method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: array(StorageTableSchema) }), { auth: "admin" }), method(object({
16560
+ collection: string().min(1),
16561
+ expectRows: number().int().nonnegative()
16562
+ }), object({
16563
+ dropped: literal(true),
16564
+ rows: number().int().nonnegative()
16565
+ }), {
16566
+ kind: "mutation",
16567
+ auth: "admin"
16568
+ });
16455
16569
  /**
16456
16570
  * `keychain` — the hub's encrypted store of secret values (D787).
16457
16571
  *
@@ -16993,6 +17107,16 @@ method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}),
16993
17107
  kind: "mutation",
16994
17108
  auth: "admin",
16995
17109
  caller: "required"
17110
+ }), method(object({
17111
+ ref: string().min(1),
17112
+ value: string().min(1)
17113
+ }), object({
17114
+ ref: string(),
17115
+ version: number().int()
17116
+ }), {
17117
+ kind: "mutation",
17118
+ auth: "admin",
17119
+ caller: "required"
16996
17120
  }), method(object({ refs: array(string().min(1)).max(1e3) }), object({
16997
17121
  deleted: array(string()).readonly(),
16998
17122
  kept: array(object({
@@ -64449,6 +64573,12 @@ Object.freeze({
64449
64573
  addonId: null,
64450
64574
  access: "create"
64451
64575
  },
64576
+ "keychainAdmin.importSecret": {
64577
+ capName: "keychain-admin",
64578
+ capScope: "system",
64579
+ addonId: null,
64580
+ access: "create"
64581
+ },
64452
64582
  "keychainAdmin.listAudit": {
64453
64583
  capName: "keychain-admin",
64454
64584
  capScope: "system",
@@ -68235,6 +68365,18 @@ Object.freeze({
68235
68365
  addonId: null,
68236
68366
  access: "create"
68237
68367
  },
68368
+ "storageAdmin.dropCollection": {
68369
+ capName: "storage-admin",
68370
+ capScope: "system",
68371
+ addonId: null,
68372
+ access: "delete"
68373
+ },
68374
+ "storageAdmin.listTables": {
68375
+ capName: "storage-admin",
68376
+ capScope: "system",
68377
+ addonId: null,
68378
+ access: "view"
68379
+ },
68238
68380
  "storageEvictable.evict": {
68239
68381
  capName: "storage-evictable",
68240
68382
  capScope: "system",
@@ -1,6 +1,6 @@
1
1
  import { S as e, d as t, u as n, v as r } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare__react__loadShare__.js-DMBKVIH7.mjs";
2
2
  import { n as i, r as a, t as o } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-ds_Ehzaa.mjs";
3
- import { g as s, h as c } from "./responsive-D9Bo78lO.mjs";
3
+ import { g as s, h as c } from "./responsive-Bb8t1Rws.mjs";
4
4
  var l = s("chevron-down", [["path", {
5
5
  d: "m6 9 6 6 6-6",
6
6
  key: "qrunsl"
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-CxkFEexB.mjs";
1
+ import { n as e, t } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-DSJOnpOj.mjs";
2
2
  export { t as get, e as init };
@@ -1,6 +1,6 @@
1
1
  import { S as e, d as t, g as n, i as r, l as i, n as a, r as o, u as s, v as c, y as l } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare__react__loadShare__.js-DMBKVIH7.mjs";
2
2
  import "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-ds_Ehzaa.mjs";
3
- import { h as u } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DlW3IlLM.mjs";
3
+ import { h as u } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-B0F3F6BP.mjs";
4
4
  //#region ../../node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
5
5
  e();
6
6
  var d = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), f = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), p = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), m = (e) => {
@@ -1,6 +1,6 @@
1
1
  import { S as e, g as t, l as n, v as r } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare__react__loadShare__.js-DMBKVIH7.mjs";
2
2
  import { n as i } from "./ui-text-BqZa5BNK.mjs";
3
- import { g as a } from "./responsive-D9Bo78lO.mjs";
3
+ import { g as a } from "./responsive-Bb8t1Rws.mjs";
4
4
  var o = a("camera", [["path", {
5
5
  d: "M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",
6
6
  key: "18u6gg"
@@ -1,4 +1,4 @@
1
- import { g as e } from "./responsive-D9Bo78lO.mjs";
1
+ import { g as e } from "./responsive-Bb8t1Rws.mjs";
2
2
  var t = e("eye-off", [
3
3
  ["path", {
4
4
  d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",
@@ -1,4 +1,4 @@
1
- import { g as e } from "./responsive-D9Bo78lO.mjs";
1
+ import { g as e } from "./responsive-Bb8t1Rws.mjs";
2
2
  var t = e("trash-2", [
3
3
  ["path", {
4
4
  d: "M10 11v6",
@@ -2753,7 +2753,7 @@ async function rr(e) {
2753
2753
  }
2754
2754
  }
2755
2755
  async function ir() {
2756
- return tr ||= rr(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-DANjfgEB.mjs")).catch((e) => {
2756
+ return tr ||= rr(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-CU96npOu.mjs")).catch((e) => {
2757
2757
  throw tr = void 0, e;
2758
2758
  }), tr;
2759
2759
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-model-studio",
3
- "version": "1.1.263",
3
+ "version": "1.1.264",
4
4
  "description": "Custom detection model registry, conversion & distribution for CamStack",
5
5
  "keywords": [
6
6
  "camstack",