@camstack/addon-training 0.1.48 → 0.1.50

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 (19) hide show
  1. package/dist/{MotionZonesSettings-B1g6IUfQ.mjs → MotionZonesSettings-UIEvGQ7i.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-D4WRZZeD.mjs → PrivacyMaskSettings-8HsoAjc4.mjs} +2 -2
  3. package/dist/{SceneMonitorEditor-pYZfyXtn.mjs → SceneMonitorEditor-B-2phYr7.mjs} +1 -1
  4. package/dist/_stub.js +8 -8
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-BclY1R96.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-Cfr_CnWi.mjs} +3 -3
  6. package/dist/{_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BVsoOuTM.mjs → _virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-B91cVqvt.mjs} +1 -1
  7. package/dist/{dist-DxTjO9kC.js → dist-B1rRN1kP.js} +191 -29
  8. package/dist/{dist-GI2KEl-e.mjs → dist-BbjF3pqW.mjs} +191 -29
  9. package/dist/{hostInit-BHX8oN7K.mjs → hostInit-Dq_MT5ON.mjs} +2 -2
  10. package/dist/index.js +1 -1
  11. package/dist/orchestrator/training.addon.js +1 -1
  12. package/dist/orchestrator/training.addon.mjs +1 -1
  13. package/dist/{player-overlays-B4V_uIvb.mjs → player-overlays-C8W-hfE1.mjs} +1 -1
  14. package/dist/providers/modal/training-modal.addon.js +1 -1
  15. package/dist/providers/modal/training-modal.addon.mjs +1 -1
  16. package/dist/remoteEntry.js +1 -1
  17. package/dist/{responsive-1iwc-rj2.mjs → responsive-BkgEJLES.mjs} +1 -1
  18. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-D5OhZIRm.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-CyQdXYqA.mjs} +1 -1
  19. package/package.json +1 -1
@@ -5420,7 +5420,7 @@ var ZodIssueCode = {
5420
5420
  var ZodFirstPartyTypeKind;
5421
5421
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5422
5422
  //#endregion
5423
- //#region ../types/dist/sleep-DRqxtc0C.mjs
5423
+ //#region ../types/dist/sleep-bwsTj221.mjs
5424
5424
  /**
5425
5425
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5426
5426
  * window to float samples (D455).
@@ -6671,7 +6671,6 @@ function createHandle(raw, opts) {
6671
6671
  const writeAddon = (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p));
6672
6672
  const readAddonStoreResult = raw.readAddonStoreResult;
6673
6673
  const readAddonStoreKeyResult = raw.readAddonStoreKeyResult;
6674
- const readDeviceStoreBatch = raw.readDeviceStoreBatch;
6675
6674
  const overrides = {
6676
6675
  readAddonStore: async () => resolveRead("addon", await raw.readAddonStore()),
6677
6676
  ...readAddonStoreResult !== void 0 ? { readAddonStoreResult: async () => {
@@ -6695,12 +6694,12 @@ function createHandle(raw, opts) {
6695
6694
  };
6696
6695
  } } : {},
6697
6696
  readDeviceStore: async (deviceId) => resolveRead(`device:${deviceId}`, await raw.readDeviceStore(deviceId)),
6698
- ...readDeviceStoreBatch !== void 0 ? { readDeviceStoreBatch: async (deviceIds) => {
6699
- const rows = await readDeviceStoreBatch.call(raw, deviceIds);
6697
+ readDeviceStoreBatch: async (deviceIds) => {
6698
+ const rows = await raw.readDeviceStoreBatch(deviceIds);
6700
6699
  const out = /* @__PURE__ */ new Map();
6701
6700
  for (const [deviceId, blob] of rows) out.set(deviceId, await resolveRead(`device:${deviceId}`, blob));
6702
6701
  return out;
6703
- } } : {},
6702
+ },
6704
6703
  writeAddonStore: async (patch) => {
6705
6704
  await writeAddon(patch);
6706
6705
  },
@@ -7527,7 +7526,7 @@ var BaseAddon = class {
7527
7526
  return this._addonSecretTree;
7528
7527
  }
7529
7528
  deviceSecretTree() {
7530
- this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
7529
+ this._deviceSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.deviceSettingsSchema()), this.secretStatePaths);
7531
7530
  return this._deviceSecretTree;
7532
7531
  }
7533
7532
  /**
@@ -7603,42 +7602,135 @@ var BaseAddon = class {
7603
7602
  this[timerOf] = timer;
7604
7603
  }
7605
7604
  /**
7606
- * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
7607
- * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
7608
- * swap, or any race where the SqliteSettingsBackend is between shutdown and
7609
- * re-initialize) doesn't propagate up into `initialize()` and leave the
7605
+ * Wrap `ctx.settings.readAddonStore()` with a retry budget so a transient
7606
+ * settings-store outage doesn't propagate up into `initialize()` and leave the
7610
7607
  * addon permanently broken.
7611
7608
  *
7612
- * Retry only the two known infra fingerprints. Anything else propagates so
7613
- * real bugs surface immediately. After the budget expires we fall back to
7614
- * `{}` (defaults) — the addon's first successful patch will rehydrate.
7609
+ * Two kinds of outage, two budgets:
7610
+ * - the store's own restart fingerprints (`SqliteSettingsBackend not
7611
+ * initialized`, `provider not available`): a short budget, then the addon
7612
+ * falls back to `{}` (defaults) - its first successful patch rehydrates;
7613
+ * - a TRANSPORT failure (the hub is restarting while this runner boots:
7614
+ * `discovery deadline exceeded`, `parent could not route`, a refused or
7615
+ * timed-out connection). Since D870 a runner's settings read THROWS instead
7616
+ * of answering `{}`, so without a budget a hub restart ends in a respawn
7617
+ * loop. A long, bounded budget; only after it the error propagates - the
7618
+ * addon never runs on defaults for a store it could not ask.
7619
+ * Anything else propagates immediately so real bugs surface.
7615
7620
  */
7616
7621
  async readAddonStoreWithRetry() {
7617
7622
  const settings = this.rawSettings();
7618
7623
  if (!settings) return {};
7619
- const delaysMs = [
7620
- 150,
7621
- 350,
7622
- 600,
7623
- 900
7624
- ];
7625
7624
  let lastErr;
7626
- for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
7625
+ for (let attempt = 0;; attempt++) try {
7627
7626
  const stored = await settings.readAddonStore() ?? {};
7628
7627
  this.settingsStoreReady = true;
7629
7628
  return stored;
7630
7629
  } catch (err) {
7631
7630
  lastErr = err;
7632
- const msg = err instanceof Error ? err.message : String(err);
7633
- if (!(msg.includes("SqliteSettingsBackend not initialized") || msg.includes("provider not available"))) throw err;
7634
- if (attempt === delaysMs.length) break;
7635
- await new Promise((r) => setTimeout(r, delaysMs[attempt]));
7631
+ const kind = classifyStoreError(err);
7632
+ if (kind === "permanent") throw err;
7633
+ const delay = (kind === "transport" ? TRANSPORT_RETRY_DELAYS_MS : RESTART_RETRY_DELAYS_MS)[attempt];
7634
+ if (delay === void 0) {
7635
+ if (kind === "transport") throw err;
7636
+ break;
7637
+ }
7638
+ await new Promise((r) => setTimeout(r, delay));
7636
7639
  }
7637
7640
  this.settingsStoreReady = false;
7638
7641
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
7639
7642
  return {};
7640
7643
  }
7641
7644
  };
7645
+ /** The settings store's own restart fingerprints. */
7646
+ var RESTART_RETRY_DELAYS_MS = [
7647
+ 150,
7648
+ 350,
7649
+ 600,
7650
+ 900
7651
+ ];
7652
+ /** A hub restarting under a booting runner: ~100 s in total. */
7653
+ var TRANSPORT_RETRY_DELAYS_MS = [
7654
+ 150,
7655
+ 350,
7656
+ 600,
7657
+ 900,
7658
+ 2e3,
7659
+ 5e3,
7660
+ 1e4,
7661
+ 2e4,
7662
+ 3e4,
7663
+ 3e4
7664
+ ];
7665
+ var RESTART_FINGERPRINTS = ["SqliteSettingsBackend not initialized", "provider not available"];
7666
+ /** Node / socket error codes of a connection that did not happen or broke. */
7667
+ var TRANSPORT_CODES = new Set([
7668
+ "ECONNREFUSED",
7669
+ "ECONNRESET",
7670
+ "ETIMEDOUT",
7671
+ "EPIPE",
7672
+ "EHOSTUNREACH",
7673
+ "ENETUNREACH"
7674
+ ]);
7675
+ /** tRPC error codes that mean "the other side is not answering now", not "your call is wrong". */
7676
+ var UNAVAILABLE_TRPC_CODES = new Set([
7677
+ "TIMEOUT",
7678
+ "SERVICE_UNAVAILABLE",
7679
+ "BAD_GATEWAY",
7680
+ "GATEWAY_TIMEOUT"
7681
+ ]);
7682
+ /** The exact phrases OUR transport raises when it cannot reach the hub. */
7683
+ var TRANSPORT_PHRASES = [
7684
+ "discovery deadline exceeded",
7685
+ "parent could not route child unowned cap call",
7686
+ "UDS request timed out after",
7687
+ "channel closed"
7688
+ ];
7689
+ /** Moleculer error `type`s of a call that could not be served right now. */
7690
+ var MOLECULER_TRANSIENT_TYPES = new Set([
7691
+ "REQUEST_TIMEOUT",
7692
+ "SERVICE_NOT_FOUND",
7693
+ "SERVICE_NOT_AVAILABLE",
7694
+ "REQUEST_REJECTED",
7695
+ "BROKER_DISCONNECTED"
7696
+ ]);
7697
+ function stringProp(value, key) {
7698
+ if (typeof value !== "object" || value === null) return void 0;
7699
+ const found = Reflect.get(value, key);
7700
+ return typeof found === "string" ? found : void 0;
7701
+ }
7702
+ /** The code an error carries: its own, its cause's, or a tRPC `data.code`. */
7703
+ function errorCode(err) {
7704
+ const out = {};
7705
+ const cause = typeof err === "object" && err !== null ? Reflect.get(err, "cause") : void 0;
7706
+ const data = typeof err === "object" && err !== null ? Reflect.get(err, "data") : void 0;
7707
+ const node = stringProp(err, "code") ?? stringProp(cause, "code");
7708
+ if (node !== void 0) out.node = node;
7709
+ const trpc = stringProp(data, "code");
7710
+ if (trpc !== void 0) out.trpc = trpc;
7711
+ return out;
7712
+ }
7713
+ /**
7714
+ * Is a settings read failure worth retrying, and with which budget? Only
7715
+ * EXPLICIT signals count: a socket error code, a tRPC "unavailable" code, or
7716
+ * one of the exact phrases our own transport raises. A message that merely
7717
+ * contains "timed out" or "unreachable" is not evidence of anything, and
7718
+ * `settings store not wired` is a wiring bug that retrying cannot fix.
7719
+ */
7720
+ function classifyStoreError(err) {
7721
+ const message = err instanceof Error ? err.message : String(err);
7722
+ if (RESTART_FINGERPRINTS.some((f) => message.includes(f))) return "restart";
7723
+ const code = errorCode(err);
7724
+ if (code.node !== void 0 && TRANSPORT_CODES.has(code.node)) return "transport";
7725
+ if (code.trpc !== void 0 && UNAVAILABLE_TRPC_CODES.has(code.trpc)) return "transport";
7726
+ if (typeof err === "object" && err !== null) {
7727
+ if (Reflect.get(err, "retryable") === true) return "transport";
7728
+ const type = stringProp(err, "type");
7729
+ if (type !== void 0 && MOLECULER_TRANSIENT_TYPES.has(type)) return "transport";
7730
+ }
7731
+ if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
7732
+ return "permanent";
7733
+ }
7642
7734
  /**
7643
7735
  * Collect the keys of every field marked `perNode: true`, recursing into
7644
7736
  * layout containers (`group` fields and `sub-tabs` tabs) the same way
@@ -11751,11 +11843,10 @@ var ClipModelMetaSchema = object({
11751
11843
  /**
11752
11844
  * The `vector-store` index this model's vectors live in. ONE feature space
11753
11845
  * per index: two models share an index only when their vectors are ranked
11754
- * against each other, which for CLIP means never across families. MobileCLIP
11755
- * S1 and S2 share `object-clip` for history (separated by the row's
11756
- * `modelId`); any other model gets its own.
11846
+ * against each other, which for CLIP means never across families. Every
11847
+ * model gets its own.
11757
11848
  */
11758
- vectorIndex: string().regex(/^object-clip(-[a-z0-9][a-z0-9-]*)?$/),
11849
+ vectorIndex: string().regex(/^object-clip-[a-z0-9][a-z0-9-]*$/),
11759
11850
  /**
11760
11851
  * The text encoder's tokenizer, a declared SIBLING file of its onnx. The name
11761
11852
  * must be unique per tokenizer: every model's siblings land in ONE flat
@@ -15887,6 +15978,28 @@ id: union([string(), number()]) }), {
15887
15978
  kind: "mutation",
15888
15979
  auth: "admin"
15889
15980
  });
15981
+ /** One table of the settings database. */
15982
+ var StorageTableSchema = object({
15983
+ /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
15984
+ name: string(),
15985
+ /** The owner prefix of a scoped name (`recorder` for `recorder:addon-settings`), else null. */
15986
+ owner: string().nullable(),
15987
+ rows: number().int().nonnegative(),
15988
+ /** Bytes the table's pages occupy (`dbstat`); null when the engine cannot measure. */
15989
+ bytes: number().int().nonnegative().nullable(),
15990
+ /** Declared by an addon since this engine process started (a running addon claims it). */
15991
+ declaredThisBoot: boolean()
15992
+ });
15993
+ method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: array(StorageTableSchema) }), { auth: "admin" }), method(object({
15994
+ collection: string().min(1),
15995
+ expectRows: number().int().nonnegative()
15996
+ }), object({
15997
+ dropped: literal(true),
15998
+ rows: number().int().nonnegative()
15999
+ }), {
16000
+ kind: "mutation",
16001
+ auth: "admin"
16002
+ });
15890
16003
  /**
15891
16004
  * `keychain` — the hub's encrypted store of secret values (D787).
15892
16005
  *
@@ -16428,6 +16541,16 @@ method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}),
16428
16541
  kind: "mutation",
16429
16542
  auth: "admin",
16430
16543
  caller: "required"
16544
+ }), method(object({
16545
+ ref: string().min(1),
16546
+ value: string().min(1)
16547
+ }), object({
16548
+ ref: string(),
16549
+ version: number().int()
16550
+ }), {
16551
+ kind: "mutation",
16552
+ auth: "admin",
16553
+ caller: "required"
16431
16554
  }), method(object({ refs: array(string().min(1)).max(1e3) }), object({
16432
16555
  deleted: array(string()).readonly(),
16433
16556
  kept: array(object({
@@ -54693,7 +54816,19 @@ var TlsStatusSchema = object({
54693
54816
  sans: array(string()),
54694
54817
  caCertPem: string().nullable(),
54695
54818
  reissueError: string().nullable(),
54696
- restartRequired: boolean()
54819
+ restartRequired: boolean(),
54820
+ /** An uploaded certificate is served but no CA is kept for it and it is not publicly signed (D873). */
54821
+ caMissing: boolean(),
54822
+ /** Does the hub's own generated CA carry a critical name constraint? `null` while it has none. */
54823
+ localCaConstrained: boolean().nullable(),
54824
+ /** ISO time the generated CA was replaced by a constrained one; devices must re-download it. */
54825
+ caReplacedAt: string().nullable(),
54826
+ /** The uploaded certificate kept on disk, selectable again after "Revert to generated". */
54827
+ storedUpload: object({
54828
+ leafFingerprintSha256: string(),
54829
+ validTo: string(),
54830
+ hasCa: boolean()
54831
+ }).nullable()
54697
54832
  });
54698
54833
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
54699
54834
  /**
@@ -54749,6 +54884,9 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
54749
54884
  }), method(_void(), object({ pem: string() })), method(_void(), TlsStatusSchema, {
54750
54885
  kind: "mutation",
54751
54886
  auth: "admin"
54887
+ }), method(_void(), TlsStatusSchema, {
54888
+ kind: "mutation",
54889
+ auth: "admin"
54752
54890
  });
54753
54891
  object({
54754
54892
  /** Lifecycle state of the lock. `jammed` means the motor reported
@@ -63865,6 +64003,12 @@ Object.freeze({
63865
64003
  addonId: null,
63866
64004
  access: "create"
63867
64005
  },
64006
+ "keychainAdmin.importSecret": {
64007
+ capName: "keychain-admin",
64008
+ capScope: "system",
64009
+ addonId: null,
64010
+ access: "create"
64011
+ },
63868
64012
  "keychainAdmin.listAudit": {
63869
64013
  capName: "keychain-admin",
63870
64014
  capScope: "system",
@@ -64261,6 +64405,12 @@ Object.freeze({
64261
64405
  addonId: null,
64262
64406
  access: "create"
64263
64407
  },
64408
+ "localNetwork.useStoredUploadedCertificate": {
64409
+ capName: "local-network",
64410
+ capScope: "system",
64411
+ addonId: null,
64412
+ access: "create"
64413
+ },
64264
64414
  "lockControl.getStatus": {
64265
64415
  capName: "lock-control",
64266
64416
  capScope: "device",
@@ -67645,6 +67795,18 @@ Object.freeze({
67645
67795
  addonId: null,
67646
67796
  access: "create"
67647
67797
  },
67798
+ "storageAdmin.dropCollection": {
67799
+ capName: "storage-admin",
67800
+ capScope: "system",
67801
+ addonId: null,
67802
+ access: "delete"
67803
+ },
67804
+ "storageAdmin.listTables": {
67805
+ capName: "storage-admin",
67806
+ capScope: "system",
67807
+ addonId: null,
67808
+ access: "view"
67809
+ },
67648
67810
  "storageEvictable.evict": {
67649
67811
  capName: "storage-evictable",
67650
67812
  capScope: "system",
@@ -5387,7 +5387,7 @@ var ZodIssueCode = {
5387
5387
  var ZodFirstPartyTypeKind;
5388
5388
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5389
5389
  //#endregion
5390
- //#region ../types/dist/sleep-DRqxtc0C.mjs
5390
+ //#region ../types/dist/sleep-bwsTj221.mjs
5391
5391
  /**
5392
5392
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5393
5393
  * window to float samples (D455).
@@ -6638,7 +6638,6 @@ function createHandle(raw, opts) {
6638
6638
  const writeAddon = (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p));
6639
6639
  const readAddonStoreResult = raw.readAddonStoreResult;
6640
6640
  const readAddonStoreKeyResult = raw.readAddonStoreKeyResult;
6641
- const readDeviceStoreBatch = raw.readDeviceStoreBatch;
6642
6641
  const overrides = {
6643
6642
  readAddonStore: async () => resolveRead("addon", await raw.readAddonStore()),
6644
6643
  ...readAddonStoreResult !== void 0 ? { readAddonStoreResult: async () => {
@@ -6662,12 +6661,12 @@ function createHandle(raw, opts) {
6662
6661
  };
6663
6662
  } } : {},
6664
6663
  readDeviceStore: async (deviceId) => resolveRead(`device:${deviceId}`, await raw.readDeviceStore(deviceId)),
6665
- ...readDeviceStoreBatch !== void 0 ? { readDeviceStoreBatch: async (deviceIds) => {
6666
- const rows = await readDeviceStoreBatch.call(raw, deviceIds);
6664
+ readDeviceStoreBatch: async (deviceIds) => {
6665
+ const rows = await raw.readDeviceStoreBatch(deviceIds);
6667
6666
  const out = /* @__PURE__ */ new Map();
6668
6667
  for (const [deviceId, blob] of rows) out.set(deviceId, await resolveRead(`device:${deviceId}`, blob));
6669
6668
  return out;
6670
- } } : {},
6669
+ },
6671
6670
  writeAddonStore: async (patch) => {
6672
6671
  await writeAddon(patch);
6673
6672
  },
@@ -7494,7 +7493,7 @@ var BaseAddon = class {
7494
7493
  return this._addonSecretTree;
7495
7494
  }
7496
7495
  deviceSecretTree() {
7497
- this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
7496
+ this._deviceSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.deviceSettingsSchema()), this.secretStatePaths);
7498
7497
  return this._deviceSecretTree;
7499
7498
  }
7500
7499
  /**
@@ -7570,42 +7569,135 @@ var BaseAddon = class {
7570
7569
  this[timerOf] = timer;
7571
7570
  }
7572
7571
  /**
7573
- * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
7574
- * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
7575
- * swap, or any race where the SqliteSettingsBackend is between shutdown and
7576
- * re-initialize) doesn't propagate up into `initialize()` and leave the
7572
+ * Wrap `ctx.settings.readAddonStore()` with a retry budget so a transient
7573
+ * settings-store outage doesn't propagate up into `initialize()` and leave the
7577
7574
  * addon permanently broken.
7578
7575
  *
7579
- * Retry only the two known infra fingerprints. Anything else propagates so
7580
- * real bugs surface immediately. After the budget expires we fall back to
7581
- * `{}` (defaults) — the addon's first successful patch will rehydrate.
7576
+ * Two kinds of outage, two budgets:
7577
+ * - the store's own restart fingerprints (`SqliteSettingsBackend not
7578
+ * initialized`, `provider not available`): a short budget, then the addon
7579
+ * falls back to `{}` (defaults) - its first successful patch rehydrates;
7580
+ * - a TRANSPORT failure (the hub is restarting while this runner boots:
7581
+ * `discovery deadline exceeded`, `parent could not route`, a refused or
7582
+ * timed-out connection). Since D870 a runner's settings read THROWS instead
7583
+ * of answering `{}`, so without a budget a hub restart ends in a respawn
7584
+ * loop. A long, bounded budget; only after it the error propagates - the
7585
+ * addon never runs on defaults for a store it could not ask.
7586
+ * Anything else propagates immediately so real bugs surface.
7582
7587
  */
7583
7588
  async readAddonStoreWithRetry() {
7584
7589
  const settings = this.rawSettings();
7585
7590
  if (!settings) return {};
7586
- const delaysMs = [
7587
- 150,
7588
- 350,
7589
- 600,
7590
- 900
7591
- ];
7592
7591
  let lastErr;
7593
- for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
7592
+ for (let attempt = 0;; attempt++) try {
7594
7593
  const stored = await settings.readAddonStore() ?? {};
7595
7594
  this.settingsStoreReady = true;
7596
7595
  return stored;
7597
7596
  } catch (err) {
7598
7597
  lastErr = err;
7599
- const msg = err instanceof Error ? err.message : String(err);
7600
- if (!(msg.includes("SqliteSettingsBackend not initialized") || msg.includes("provider not available"))) throw err;
7601
- if (attempt === delaysMs.length) break;
7602
- await new Promise((r) => setTimeout(r, delaysMs[attempt]));
7598
+ const kind = classifyStoreError(err);
7599
+ if (kind === "permanent") throw err;
7600
+ const delay = (kind === "transport" ? TRANSPORT_RETRY_DELAYS_MS : RESTART_RETRY_DELAYS_MS)[attempt];
7601
+ if (delay === void 0) {
7602
+ if (kind === "transport") throw err;
7603
+ break;
7604
+ }
7605
+ await new Promise((r) => setTimeout(r, delay));
7603
7606
  }
7604
7607
  this.settingsStoreReady = false;
7605
7608
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
7606
7609
  return {};
7607
7610
  }
7608
7611
  };
7612
+ /** The settings store's own restart fingerprints. */
7613
+ var RESTART_RETRY_DELAYS_MS = [
7614
+ 150,
7615
+ 350,
7616
+ 600,
7617
+ 900
7618
+ ];
7619
+ /** A hub restarting under a booting runner: ~100 s in total. */
7620
+ var TRANSPORT_RETRY_DELAYS_MS = [
7621
+ 150,
7622
+ 350,
7623
+ 600,
7624
+ 900,
7625
+ 2e3,
7626
+ 5e3,
7627
+ 1e4,
7628
+ 2e4,
7629
+ 3e4,
7630
+ 3e4
7631
+ ];
7632
+ var RESTART_FINGERPRINTS = ["SqliteSettingsBackend not initialized", "provider not available"];
7633
+ /** Node / socket error codes of a connection that did not happen or broke. */
7634
+ var TRANSPORT_CODES = new Set([
7635
+ "ECONNREFUSED",
7636
+ "ECONNRESET",
7637
+ "ETIMEDOUT",
7638
+ "EPIPE",
7639
+ "EHOSTUNREACH",
7640
+ "ENETUNREACH"
7641
+ ]);
7642
+ /** tRPC error codes that mean "the other side is not answering now", not "your call is wrong". */
7643
+ var UNAVAILABLE_TRPC_CODES = new Set([
7644
+ "TIMEOUT",
7645
+ "SERVICE_UNAVAILABLE",
7646
+ "BAD_GATEWAY",
7647
+ "GATEWAY_TIMEOUT"
7648
+ ]);
7649
+ /** The exact phrases OUR transport raises when it cannot reach the hub. */
7650
+ var TRANSPORT_PHRASES = [
7651
+ "discovery deadline exceeded",
7652
+ "parent could not route child unowned cap call",
7653
+ "UDS request timed out after",
7654
+ "channel closed"
7655
+ ];
7656
+ /** Moleculer error `type`s of a call that could not be served right now. */
7657
+ var MOLECULER_TRANSIENT_TYPES = new Set([
7658
+ "REQUEST_TIMEOUT",
7659
+ "SERVICE_NOT_FOUND",
7660
+ "SERVICE_NOT_AVAILABLE",
7661
+ "REQUEST_REJECTED",
7662
+ "BROKER_DISCONNECTED"
7663
+ ]);
7664
+ function stringProp(value, key) {
7665
+ if (typeof value !== "object" || value === null) return void 0;
7666
+ const found = Reflect.get(value, key);
7667
+ return typeof found === "string" ? found : void 0;
7668
+ }
7669
+ /** The code an error carries: its own, its cause's, or a tRPC `data.code`. */
7670
+ function errorCode(err) {
7671
+ const out = {};
7672
+ const cause = typeof err === "object" && err !== null ? Reflect.get(err, "cause") : void 0;
7673
+ const data = typeof err === "object" && err !== null ? Reflect.get(err, "data") : void 0;
7674
+ const node = stringProp(err, "code") ?? stringProp(cause, "code");
7675
+ if (node !== void 0) out.node = node;
7676
+ const trpc = stringProp(data, "code");
7677
+ if (trpc !== void 0) out.trpc = trpc;
7678
+ return out;
7679
+ }
7680
+ /**
7681
+ * Is a settings read failure worth retrying, and with which budget? Only
7682
+ * EXPLICIT signals count: a socket error code, a tRPC "unavailable" code, or
7683
+ * one of the exact phrases our own transport raises. A message that merely
7684
+ * contains "timed out" or "unreachable" is not evidence of anything, and
7685
+ * `settings store not wired` is a wiring bug that retrying cannot fix.
7686
+ */
7687
+ function classifyStoreError(err) {
7688
+ const message = err instanceof Error ? err.message : String(err);
7689
+ if (RESTART_FINGERPRINTS.some((f) => message.includes(f))) return "restart";
7690
+ const code = errorCode(err);
7691
+ if (code.node !== void 0 && TRANSPORT_CODES.has(code.node)) return "transport";
7692
+ if (code.trpc !== void 0 && UNAVAILABLE_TRPC_CODES.has(code.trpc)) return "transport";
7693
+ if (typeof err === "object" && err !== null) {
7694
+ if (Reflect.get(err, "retryable") === true) return "transport";
7695
+ const type = stringProp(err, "type");
7696
+ if (type !== void 0 && MOLECULER_TRANSIENT_TYPES.has(type)) return "transport";
7697
+ }
7698
+ if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
7699
+ return "permanent";
7700
+ }
7609
7701
  /**
7610
7702
  * Collect the keys of every field marked `perNode: true`, recursing into
7611
7703
  * layout containers (`group` fields and `sub-tabs` tabs) the same way
@@ -11718,11 +11810,10 @@ var ClipModelMetaSchema = object({
11718
11810
  /**
11719
11811
  * The `vector-store` index this model's vectors live in. ONE feature space
11720
11812
  * per index: two models share an index only when their vectors are ranked
11721
- * against each other, which for CLIP means never across families. MobileCLIP
11722
- * S1 and S2 share `object-clip` for history (separated by the row's
11723
- * `modelId`); any other model gets its own.
11813
+ * against each other, which for CLIP means never across families. Every
11814
+ * model gets its own.
11724
11815
  */
11725
- vectorIndex: string().regex(/^object-clip(-[a-z0-9][a-z0-9-]*)?$/),
11816
+ vectorIndex: string().regex(/^object-clip-[a-z0-9][a-z0-9-]*$/),
11726
11817
  /**
11727
11818
  * The text encoder's tokenizer, a declared SIBLING file of its onnx. The name
11728
11819
  * must be unique per tokenizer: every model's siblings land in ONE flat
@@ -15854,6 +15945,28 @@ id: union([string(), number()]) }), {
15854
15945
  kind: "mutation",
15855
15946
  auth: "admin"
15856
15947
  });
15948
+ /** One table of the settings database. */
15949
+ var StorageTableSchema = object({
15950
+ /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
15951
+ name: string(),
15952
+ /** The owner prefix of a scoped name (`recorder` for `recorder:addon-settings`), else null. */
15953
+ owner: string().nullable(),
15954
+ rows: number().int().nonnegative(),
15955
+ /** Bytes the table's pages occupy (`dbstat`); null when the engine cannot measure. */
15956
+ bytes: number().int().nonnegative().nullable(),
15957
+ /** Declared by an addon since this engine process started (a running addon claims it). */
15958
+ declaredThisBoot: boolean()
15959
+ });
15960
+ method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: array(StorageTableSchema) }), { auth: "admin" }), method(object({
15961
+ collection: string().min(1),
15962
+ expectRows: number().int().nonnegative()
15963
+ }), object({
15964
+ dropped: literal(true),
15965
+ rows: number().int().nonnegative()
15966
+ }), {
15967
+ kind: "mutation",
15968
+ auth: "admin"
15969
+ });
15857
15970
  /**
15858
15971
  * `keychain` — the hub's encrypted store of secret values (D787).
15859
15972
  *
@@ -16395,6 +16508,16 @@ method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}),
16395
16508
  kind: "mutation",
16396
16509
  auth: "admin",
16397
16510
  caller: "required"
16511
+ }), method(object({
16512
+ ref: string().min(1),
16513
+ value: string().min(1)
16514
+ }), object({
16515
+ ref: string(),
16516
+ version: number().int()
16517
+ }), {
16518
+ kind: "mutation",
16519
+ auth: "admin",
16520
+ caller: "required"
16398
16521
  }), method(object({ refs: array(string().min(1)).max(1e3) }), object({
16399
16522
  deleted: array(string()).readonly(),
16400
16523
  kept: array(object({
@@ -54660,7 +54783,19 @@ var TlsStatusSchema = object({
54660
54783
  sans: array(string()),
54661
54784
  caCertPem: string().nullable(),
54662
54785
  reissueError: string().nullable(),
54663
- restartRequired: boolean()
54786
+ restartRequired: boolean(),
54787
+ /** An uploaded certificate is served but no CA is kept for it and it is not publicly signed (D873). */
54788
+ caMissing: boolean(),
54789
+ /** Does the hub's own generated CA carry a critical name constraint? `null` while it has none. */
54790
+ localCaConstrained: boolean().nullable(),
54791
+ /** ISO time the generated CA was replaced by a constrained one; devices must re-download it. */
54792
+ caReplacedAt: string().nullable(),
54793
+ /** The uploaded certificate kept on disk, selectable again after "Revert to generated". */
54794
+ storedUpload: object({
54795
+ leafFingerprintSha256: string(),
54796
+ validTo: string(),
54797
+ hasCa: boolean()
54798
+ }).nullable()
54664
54799
  });
54665
54800
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
54666
54801
  /**
@@ -54716,6 +54851,9 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
54716
54851
  }), method(_void(), object({ pem: string() })), method(_void(), TlsStatusSchema, {
54717
54852
  kind: "mutation",
54718
54853
  auth: "admin"
54854
+ }), method(_void(), TlsStatusSchema, {
54855
+ kind: "mutation",
54856
+ auth: "admin"
54719
54857
  });
54720
54858
  object({
54721
54859
  /** Lifecycle state of the lock. `jammed` means the motor reported
@@ -63832,6 +63970,12 @@ Object.freeze({
63832
63970
  addonId: null,
63833
63971
  access: "create"
63834
63972
  },
63973
+ "keychainAdmin.importSecret": {
63974
+ capName: "keychain-admin",
63975
+ capScope: "system",
63976
+ addonId: null,
63977
+ access: "create"
63978
+ },
63835
63979
  "keychainAdmin.listAudit": {
63836
63980
  capName: "keychain-admin",
63837
63981
  capScope: "system",
@@ -64228,6 +64372,12 @@ Object.freeze({
64228
64372
  addonId: null,
64229
64373
  access: "create"
64230
64374
  },
64375
+ "localNetwork.useStoredUploadedCertificate": {
64376
+ capName: "local-network",
64377
+ capScope: "system",
64378
+ addonId: null,
64379
+ access: "create"
64380
+ },
64231
64381
  "lockControl.getStatus": {
64232
64382
  capName: "lock-control",
64233
64383
  capScope: "device",
@@ -67612,6 +67762,18 @@ Object.freeze({
67612
67762
  addonId: null,
67613
67763
  access: "create"
67614
67764
  },
67765
+ "storageAdmin.dropCollection": {
67766
+ capName: "storage-admin",
67767
+ capScope: "system",
67768
+ addonId: null,
67769
+ access: "delete"
67770
+ },
67771
+ "storageAdmin.listTables": {
67772
+ capName: "storage-admin",
67773
+ capScope: "system",
67774
+ addonId: null,
67775
+ access: "view"
67776
+ },
67615
67777
  "storageEvictable.evict": {
67616
67778
  capName: "storage-evictable",
67617
67779
  capScope: "system",
@@ -36,7 +36,7 @@ async function r() {
36
36
  }
37
37
  },
38
38
  "@camstack/types": {
39
- version: "1.2.374",
39
+ version: "1.2.376",
40
40
  scope: "default",
41
41
  shareConfig: {
42
42
  singleton: !0,
@@ -81,7 +81,7 @@ async function r() {
81
81
  }
82
82
  },
83
83
  "@camstack/ui-library": {
84
- version: "1.2.292",
84
+ version: "1.2.294",
85
85
  scope: "default",
86
86
  shareConfig: {
87
87
  singleton: !0,
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- require("./dist-DxTjO9kC.js");
2
+ require("./dist-B1rRN1kP.js");
3
3
  const require_orchestrator_training_addon = require("./orchestrator/training.addon.js");
4
4
  const require_providers_modal_training_modal_addon = require("./providers/modal/training-modal.addon.js");
5
5
  //#region src/providers/fake/fake-provider.ts