@camstack/addon-pipeline-orchestrator 1.2.652 → 1.2.653

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/index.js CHANGED
@@ -816,7 +816,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
816
816
  return EventCategory;
817
817
  }({});
818
818
  //#endregion
819
- //#region ../types/dist/device-type-BOWLtoOt.mjs
819
+ //#region ../types/dist/device-type-CfHw_quR.mjs
820
820
  /**
821
821
  import { errMsg } from '@camstack/types'
822
822
  * Extract a human-readable message from an unknown error value.
@@ -1005,6 +1005,9 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1005
1005
  DeviceFeature["CoverPositionable"] = "cover-positionable";
1006
1006
  /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
1007
1007
  DeviceFeature["CoverTilt"] = "cover-tilt";
1008
+ /** Cover has a real stop: `stop` halts the travel in place. Gates the stop
1009
+ * control in exporters; a provider whose `stop` is a no-op never declares it. */
1010
+ DeviceFeature["CoverStoppable"] = "cover-stoppable";
1008
1011
  /** Valve exposes intermediate position control (0..100). Gates the
1009
1012
  * position slider / drag surface UI. */
1010
1013
  DeviceFeature["ValvePositionable"] = "valve-positionable";
@@ -6003,7 +6006,7 @@ var ZodIssueCode = {
6003
6006
  var ZodFirstPartyTypeKind;
6004
6007
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6005
6008
  //#endregion
6006
- //#region ../types/dist/sleep-B-vp7x15.mjs
6009
+ //#region ../types/dist/sleep-hmSP-eJt.mjs
6007
6010
  /**
6008
6011
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6009
6012
  * window to float samples (D455).
@@ -6120,7 +6123,7 @@ function isKeychainStoredField(field) {
6120
6123
  var SECRET_CLEAR = { $secretClear: true };
6121
6124
  /** The `'***'` token D634 redaction writes for non-admins. */
6122
6125
  var LEGACY_DEVICE_REDACTION = "***";
6123
- function isRecord$6(value) {
6126
+ function isRecord$7(value) {
6124
6127
  return typeof value === "object" && value !== null && !Array.isArray(value);
6125
6128
  }
6126
6129
  function makeSecretMarker(ref) {
@@ -6131,12 +6134,12 @@ function makeSecretMarker(ref) {
6131
6134
  }
6132
6135
  /** A stored marker: an object whose `$secret` is a non-empty string. */
6133
6136
  function isSecretMarker(value) {
6134
- if (!isRecord$6(value)) return false;
6137
+ if (!isRecord$7(value)) return false;
6135
6138
  const ref = value["$secret"];
6136
6139
  return typeof ref === "string" && ref.length > 0;
6137
6140
  }
6138
6141
  function isSecretClear(value) {
6139
- return isRecord$6(value) && value["$secretClear"] === true;
6142
+ return isRecord$7(value) && value["$secretClear"] === true;
6140
6143
  }
6141
6144
  /**
6142
6145
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -6858,7 +6861,7 @@ var KeychainWriteRefusedError = class extends Error {
6858
6861
  }
6859
6862
  };
6860
6863
  var KEEP = { kind: "keep" };
6861
- function isRecord$5(value) {
6864
+ function isRecord$6(value) {
6862
6865
  return typeof value === "object" && value !== null && !Array.isArray(value);
6863
6866
  }
6864
6867
  function defaultMintId() {
@@ -6871,7 +6874,7 @@ function collectSecretMarkerRefs(value, out = []) {
6871
6874
  return out;
6872
6875
  }
6873
6876
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6874
- else if (isRecord$5(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6877
+ else if (isRecord$6(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6875
6878
  return out;
6876
6879
  }
6877
6880
  async function storedValueEquals(secrets, marker, candidate) {
@@ -6926,7 +6929,7 @@ function rowId(row, idKey) {
6926
6929
  return null;
6927
6930
  }
6928
6931
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
6929
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord$5) : [];
6932
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$6) : [];
6930
6933
  if (!Array.isArray(incoming)) {
6931
6934
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6932
6935
  return {
@@ -6942,7 +6945,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6942
6945
  const kept = /* @__PURE__ */ new Set();
6943
6946
  const rows = [];
6944
6947
  for (const row of incoming) {
6945
- if (!isRecord$5(row)) {
6948
+ if (!isRecord$6(row)) {
6946
6949
  rows.push(row);
6947
6950
  continue;
6948
6951
  }
@@ -6967,7 +6970,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6967
6970
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6968
6971
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6969
6972
  case "object": {
6970
- if (!isRecord$5(incoming)) {
6973
+ if (!isRecord$6(incoming)) {
6971
6974
  if (incoming === void 0) return KEEP;
6972
6975
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
6973
6976
  return {
@@ -6975,7 +6978,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6975
6978
  value: incoming
6976
6979
  };
6977
6980
  }
6978
- const storedObj = isRecord$5(stored) ? stored : {};
6981
+ const storedObj = isRecord$6(stored) ? stored : {};
6979
6982
  return {
6980
6983
  kind: "value",
6981
6984
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -7098,7 +7101,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
7098
7101
  value: items
7099
7102
  };
7100
7103
  }
7101
- if (isRecord$5(v)) {
7104
+ if (isRecord$6(v)) {
7102
7105
  const out = {};
7103
7106
  for (const [k, child] of Object.entries(v)) {
7104
7107
  const s = substitute(child);
@@ -7130,7 +7133,7 @@ var SecretOverwriteRefusedError = class extends Error {
7130
7133
  this.name = "SecretOverwriteRefusedError";
7131
7134
  }
7132
7135
  };
7133
- function isRecord$4(value) {
7136
+ function isRecord$5(value) {
7134
7137
  return typeof value === "object" && value !== null && !Array.isArray(value);
7135
7138
  }
7136
7139
  function resolvedValue(pass, marker) {
@@ -7159,7 +7162,7 @@ function inArray(pass, incoming, stored) {
7159
7162
  return incoming.map((item, index) => {
7160
7163
  const twin = stored[index];
7161
7164
  if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
7162
- if (isRecord$4(item) && isRecord$4(twin)) return inArrayRow(pass, item, twin);
7165
+ if (isRecord$5(item) && isRecord$5(twin)) return inArrayRow(pass, item, twin);
7163
7166
  if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
7164
7167
  return item;
7165
7168
  });
@@ -7170,7 +7173,7 @@ function inArrayRow(pass, incoming, stored) {
7170
7173
  const twin = stored[key];
7171
7174
  if (isSecretMarker(twin)) {
7172
7175
  if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
7173
- } else if (isRecord$4(value) && isRecord$4(twin)) out[key] = inArrayRow(pass, value, twin);
7176
+ } else if (isRecord$5(value) && isRecord$5(twin)) out[key] = inArrayRow(pass, value, twin);
7174
7177
  else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
7175
7178
  }
7176
7179
  return out;
@@ -7178,7 +7181,7 @@ function inArrayRow(pass, incoming, stored) {
7178
7181
  async function walk(pass, incoming, stored) {
7179
7182
  if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
7180
7183
  if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
7181
- if (!isRecord$4(incoming) || !isRecord$4(stored)) return incoming;
7184
+ if (!isRecord$5(incoming) || !isRecord$5(stored)) return incoming;
7182
7185
  const out = { ...incoming };
7183
7186
  for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
7184
7187
  return out;
@@ -7209,7 +7212,7 @@ async function restoreUnchangedSecrets(input) {
7209
7212
  function isJsonEqual(a, b) {
7210
7213
  if (Object.is(a, b)) return true;
7211
7214
  if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
7212
- if (isRecord$4(a) && isRecord$4(b)) {
7215
+ if (isRecord$5(a) && isRecord$5(b)) {
7213
7216
  const keys = Object.keys(a);
7214
7217
  if (keys.length !== Object.keys(b).length) return false;
7215
7218
  return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
@@ -7233,7 +7236,7 @@ function markerKeysOf(blob, owner) {
7233
7236
  }
7234
7237
  function nodeFromStored(value, owner) {
7235
7238
  if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
7236
- if (!isRecord$4(value)) return null;
7239
+ if (!isRecord$5(value)) return null;
7237
7240
  const children = /* @__PURE__ */ new Map();
7238
7241
  for (const [key, child] of Object.entries(value)) {
7239
7242
  const node = nodeFromStored(child, owner);
@@ -7852,6 +7855,44 @@ var BaseAddon = class {
7852
7855
  return null;
7853
7856
  }
7854
7857
  /**
7858
+ * D986 scoped settings: the form shape of the CLUSTER-wide settings one capability this addon
7859
+ * provides owns, or `null` when it has none. `cap` is a capability name the addon's manifest
7860
+ * declares. Stored as `addon-settings` rows `<addonId>.<field>`. The keys of this schema, of
7861
+ * {@link nodeSettingsSchema} and of {@link deviceDefaultsSchema} are disjoint, and a key never
7862
+ * contains `@` (guard `check-scoped-settings-declared`). SHAPE only: values are read by scope.
7863
+ */
7864
+ async clusterSettingsSchema(_cap) {
7865
+ return null;
7866
+ }
7867
+ /**
7868
+ * D986: the form shape of the settings one capability owns PER NODE, or `null`. Stored as
7869
+ * `addon-settings` rows `<addonId>.<field>@<nodeId>` carrying `nodeId` in the row data, so a
7870
+ * forgotten node's rows go in one central delete.
7871
+ */
7872
+ async nodeSettingsSchema(_cap) {
7873
+ return null;
7874
+ }
7875
+ /**
7876
+ * D986: the form shape of the FLEET DEFAULTS of the per-device settings one capability owns,
7877
+ * or `null`. Stored as `addon-settings` rows `<addonId>.<field>`; a device resolves its value
7878
+ * as device row, then this default, then the schema default (`resolveDeviceSettings`).
7879
+ */
7880
+ async deviceDefaultsSchema(_cap) {
7881
+ return null;
7882
+ }
7883
+ /**
7884
+ * The host's read of the scoped declarations: the schema one capability declares for `scope`,
7885
+ * or `null`. Beside {@link getIntegrationFormSchema}, the same shape: the hook is protected, the
7886
+ * host asks this method.
7887
+ */
7888
+ async getScopedSettingsSchema(scope, cap) {
7889
+ switch (scope) {
7890
+ case "cluster": return this.clusterSettingsSchema(cap);
7891
+ case "node": return this.nodeSettingsSchema(cap);
7892
+ case "device-defaults": return this.deviceDefaultsSchema(cap);
7893
+ }
7894
+ }
7895
+ /**
7855
7896
  * What the create wizard and the integration edit page render for one instance: the addon's
7856
7897
  * per-instance schema when it declares one, else its global schema (what they always showed).
7857
7898
  */
@@ -8645,47 +8686,6 @@ function normalizeAddonInitResult(result) {
8645
8686
  if (Array.isArray(result)) return { providers: result };
8646
8687
  return result;
8647
8688
  }
8648
- /**
8649
- * The share-view scope kinds a share-link token can carry. The hub mints
8650
- * and validates them (`ShareViewGrantSchema` builds its
8651
- * enum from this list); a data plane names the kinds it ACCEPTS in `share`.
8652
- */
8653
- var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
8654
- /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
8655
- var PeerBytesTicketSchema = object({
8656
- /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
8657
- url: string().min(1),
8658
- /**
8659
- * The HOST node this URL means something on — the hub or a named agent,
8660
- * never a runner. {@link AddonPeerBytes.open} compares it to its own and
8661
- * refuses `cross-node` by name when they differ, without dialling.
8662
- */
8663
- hostNodeId: string().min(1),
8664
- expiresAtMs: number().int().nonnegative(),
8665
- /**
8666
- * What the producer DECLARED the body to be, when it knows — `null` when it
8667
- * does not. Never `0` for unknown (D393): a consumer sizing a bound off this
8668
- * must be able to tell "the producer did not say" from "the body is empty".
8669
- */
8670
- declaredBytes: number().int().nonnegative().nullable()
8671
- });
8672
- /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
8673
- /** The files a kind may live in. `history` is device-history's (D850), never records. */
8674
- var RECORD_DATABASES = ["settings", "events"];
8675
- /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
8676
- var RECORD_CLASSES = [
8677
- "config",
8678
- "ledger",
8679
- "audit",
8680
- "mirror",
8681
- "ephemeral"
8682
- ];
8683
- var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
8684
- var RECORD_MAX_DATA_BYTES = 1024 * 1024;
8685
- var RECORD_BATCH_MAX = 1e3;
8686
- var RECORD_QUERY_MAX = 1e3;
8687
- /** A kind in the `settings` file may not bound itself above this (D447: high volume is `events`). */
8688
- var RECORD_SETTINGS_MAX_ROWS = 5e4;
8689
8689
  var PREFIX = "records/";
8690
8690
  /** The base of every records failure. `detail` is the human part of the message. */
8691
8691
  var RecordsError = class extends Error {
@@ -8711,6 +8711,83 @@ var DeclarationRefusedError = class extends RecordsError {
8711
8711
  this.name = "DeclarationRefusedError";
8712
8712
  }
8713
8713
  };
8714
+ /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
8715
+ /** The files a kind may live in. `history` is device-history's (D850), never records. */
8716
+ var RECORD_DATABASES = ["settings", "events"];
8717
+ /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
8718
+ var RECORD_CLASSES = [
8719
+ "config",
8720
+ "ledger",
8721
+ "audit",
8722
+ "mirror",
8723
+ "ephemeral"
8724
+ ];
8725
+ var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
8726
+ var RECORD_MAX_DATA_BYTES = 1024 * 1024;
8727
+ var RECORD_BATCH_MAX = 1e3;
8728
+ var RECORD_QUERY_MAX = 1e3;
8729
+ /** A kind in the `settings` file may not bound itself above this (D447: high volume is `events`). */
8730
+ var RECORD_SETTINGS_MAX_ROWS = 5e4;
8731
+ /**
8732
+ * Secret fields of a record, addressed the way a Zod schema declares them
8733
+ * (`collectZodSecretPaths`): dotted keys, `[]` for "each element of this array"
8734
+ * (`auth.accessToken`, `headers[].value`).
8735
+ *
8736
+ * Array elements are matched by a DECLARED id key (`secretArrayKeys`:
8737
+ * `{ headers: 'name' }`), never by index, so reordering a list keeps every
8738
+ * keychain ref (the same rule as `arrayItemFieldPath`). The concrete path of a
8739
+ * leaf names its element: `headers[X-Api].value`.
8740
+ *
8741
+ * Pure and browser-safe. Nothing here mutates: every transform returns a new value.
8742
+ */
8743
+ /** The array prefixes (declared form, e.g. `headers` or `a.headers`) of a path. */
8744
+ function parseSecretPath(path) {
8745
+ if (path.length === 0) throw new InvalidRecordError("an empty secret path");
8746
+ return path.split(".").map((raw) => {
8747
+ const each = raw.endsWith("[]");
8748
+ const key = each ? raw.slice(0, -2) : raw;
8749
+ if (key.length === 0) throw new InvalidRecordError(`secret path "${path}" has an empty segment`);
8750
+ return {
8751
+ key,
8752
+ each
8753
+ };
8754
+ });
8755
+ }
8756
+ /** The declared array prefixes of `path` that need an id key (`headers`, `a.rows`). */
8757
+ function secretArrayPrefixes(path) {
8758
+ const segments = parseSecretPath(path);
8759
+ const prefixes = [];
8760
+ const walked = [];
8761
+ for (const segment of segments) {
8762
+ walked.push(segment.key);
8763
+ if (segment.each) prefixes.push(walked.join("."));
8764
+ }
8765
+ return prefixes;
8766
+ }
8767
+ /**
8768
+ * The share-view scope kinds a share-link token can carry. The hub mints
8769
+ * and validates them (`ShareViewGrantSchema` builds its
8770
+ * enum from this list); a data plane names the kinds it ACCEPTS in `share`.
8771
+ */
8772
+ var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
8773
+ /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
8774
+ var PeerBytesTicketSchema = object({
8775
+ /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
8776
+ url: string().min(1),
8777
+ /**
8778
+ * The HOST node this URL means something on — the hub or a named agent,
8779
+ * never a runner. {@link AddonPeerBytes.open} compares it to its own and
8780
+ * refuses `cross-node` by name when they differ, without dialling.
8781
+ */
8782
+ hostNodeId: string().min(1),
8783
+ expiresAtMs: number().int().nonnegative(),
8784
+ /**
8785
+ * What the producer DECLARED the body to be, when it knows — `null` when it
8786
+ * does not. Never `0` for unknown (D393): a consumer sizing a bound off this
8787
+ * must be able to tell "the producer did not say" from "the body is empty".
8788
+ */
8789
+ declaredBytes: number().int().nonnegative().nullable()
8790
+ });
8714
8791
  function defOf(schema) {
8715
8792
  const zodBag = Reflect.get(schema, "_zod");
8716
8793
  if (typeof zodBag !== "object" || zodBag === null) return {};
@@ -8779,42 +8856,6 @@ function collectZodSecretPaths(schema, prefix = "") {
8779
8856
  return [...new Set(paths)];
8780
8857
  }
8781
8858
  /**
8782
- * Secret fields of a record, addressed the way a Zod schema declares them
8783
- * (`collectZodSecretPaths`): dotted keys, `[]` for "each element of this array"
8784
- * (`auth.accessToken`, `headers[].value`).
8785
- *
8786
- * Array elements are matched by a DECLARED id key (`secretArrayKeys`:
8787
- * `{ headers: 'name' }`), never by index, so reordering a list keeps every
8788
- * keychain ref (the same rule as `arrayItemFieldPath`). The concrete path of a
8789
- * leaf names its element: `headers[X-Api].value`.
8790
- *
8791
- * Pure and browser-safe. Nothing here mutates: every transform returns a new value.
8792
- */
8793
- /** The array prefixes (declared form, e.g. `headers` or `a.headers`) of a path. */
8794
- function parseSecretPath(path) {
8795
- if (path.length === 0) throw new InvalidRecordError("an empty secret path");
8796
- return path.split(".").map((raw) => {
8797
- const each = raw.endsWith("[]");
8798
- const key = each ? raw.slice(0, -2) : raw;
8799
- if (key.length === 0) throw new InvalidRecordError(`secret path "${path}" has an empty segment`);
8800
- return {
8801
- key,
8802
- each
8803
- };
8804
- });
8805
- }
8806
- /** The declared array prefixes of `path` that need an id key (`headers`, `a.rows`). */
8807
- function secretArrayPrefixes(path) {
8808
- const segments = parseSecretPath(path);
8809
- const prefixes = [];
8810
- const walked = [];
8811
- for (const segment of segments) {
8812
- walked.push(segment.key);
8813
- if (segment.each) prefixes.push(walked.join("."));
8814
- }
8815
- return prefixes;
8816
- }
8817
- /**
8818
8859
  * Record kinds (D881): the declaration an addon makes of one kind of fact, the
8819
8860
  * Zod row schema that describes it, and the helper that turns the two into the
8820
8861
  * JSON the engine stores.
@@ -10171,6 +10212,7 @@ var CAP_NAMES = Object.freeze([
10171
10212
  "backup",
10172
10213
  "battery",
10173
10214
  "binary",
10215
+ "board-key-source",
10174
10216
  "brightness",
10175
10217
  "broker",
10176
10218
  "button",
@@ -10234,6 +10276,7 @@ var CAP_NAMES = Object.freeze([
10234
10276
  "humidity-sensor",
10235
10277
  "image",
10236
10278
  "image-settings",
10279
+ "integration-instances",
10237
10280
  "integrations",
10238
10281
  "intercom",
10239
10282
  "ir-transmitter",
@@ -10291,6 +10334,7 @@ var CAP_NAMES = Object.freeze([
10291
10334
  "privacy-mask",
10292
10335
  "ptz",
10293
10336
  "ptz-autotrack",
10337
+ "pump-cycle",
10294
10338
  "reboot",
10295
10339
  "record-entries",
10296
10340
  "recording",
@@ -11583,18 +11627,6 @@ Object.freeze({
11583
11627
  "path": "pumpRunning",
11584
11628
  "valueType": "boolean"
11585
11629
  },
11586
- {
11587
- "path": "pumpIntervalEnabled",
11588
- "valueType": "boolean"
11589
- },
11590
- {
11591
- "path": "pumpOnTime",
11592
- "valueType": "number"
11593
- },
11594
- {
11595
- "path": "pumpOffTime",
11596
- "valueType": "number"
11597
- },
11598
11630
  {
11599
11631
  "path": "lastDrink",
11600
11632
  "valueType": "number"
@@ -11718,6 +11750,20 @@ Object.freeze({
11718
11750
  "valueType": "number"
11719
11751
  }
11720
11752
  ],
11753
+ "pump-cycle": [
11754
+ {
11755
+ "path": "enabled",
11756
+ "valueType": "boolean"
11757
+ },
11758
+ {
11759
+ "path": "onTime",
11760
+ "valueType": "number"
11761
+ },
11762
+ {
11763
+ "path": "offTime",
11764
+ "valueType": "number"
11765
+ }
11766
+ ],
11721
11767
  "recording-archive": [
11722
11768
  {
11723
11769
  "path": "deviceId",
@@ -12191,7 +12237,7 @@ function sleep(ms) {
12191
12237
  return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
12192
12238
  }
12193
12239
  //#endregion
12194
- //#region ../types/dist/composition-kKKOdFIG.mjs
12240
+ //#region ../types/dist/composition-Dh3RfMx5.mjs
12195
12241
  /**
12196
12242
  * The ffmpeg build every CamStack node downloads, per platform and arch.
12197
12243
  *
@@ -13573,6 +13619,73 @@ function assignNodeColorId(nodeId) {
13573
13619
  if (id !== void 0) return id;
13574
13620
  return "node-a";
13575
13621
  }
13622
+ //#endregion
13623
+ //#region ../types/dist/index.mjs
13624
+ var SMTP_INBOUND_DEFAULT_PORT = 2525;
13625
+ var SMTP_INBOUND_DEFAULT_DOMAIN = "camstack.local";
13626
+ var SMTP_INBOUND_DEFAULT_MAX_MESSAGE_BYTES = 25 * 1024 * 1024;
13627
+ /** The text excerpt a message carries on the bus. */
13628
+ var SMTP_INBOUND_TEXT_MAX_CHARS = 4096;
13629
+ var PortSchema = number().int().min(1).max(65535);
13630
+ /** A recipient local-part: what stands before the `@`. */
13631
+ var SmtpRecipientSchema = string().min(1).max(64).regex(/^[A-Za-z0-9._+-]+$/);
13632
+ object({
13633
+ port: PortSchema.default(SMTP_INBOUND_DEFAULT_PORT),
13634
+ bindHost: string().min(1).default("0.0.0.0"),
13635
+ domain: string().min(1).default(SMTP_INBOUND_DEFAULT_DOMAIN),
13636
+ requireAuth: boolean().default(true),
13637
+ username: string().default(""),
13638
+ password: string().default("").meta({ secret: true }),
13639
+ starttls: boolean().default(false),
13640
+ maxMessageBytes: number().int().positive().default(SMTP_INBOUND_DEFAULT_MAX_MESSAGE_BYTES)
13641
+ });
13642
+ object({
13643
+ host: string().min(1).nullable(),
13644
+ hostReason: string().nullable(),
13645
+ port: PortSchema,
13646
+ domain: string().min(1),
13647
+ requireAuth: boolean(),
13648
+ username: string(),
13649
+ password: string(),
13650
+ starttls: boolean()
13651
+ });
13652
+ object({
13653
+ recipients: array(SmtpRecipientSchema).min(1),
13654
+ /**
13655
+ * Who is subscribing. A second `subscribe` with the same id REPLACES that subscriber's
13656
+ * recipients (the way a consumer that restarted, or lost a device, declares its set again);
13657
+ * a recipient held by another subscriber is refused with `smtp-inbound/recipient-claimed`.
13658
+ * Absent, the subscriber is anonymous and unique.
13659
+ */
13660
+ subscriberId: string().min(1).max(64).optional()
13661
+ });
13662
+ var SmtpInboundAttachmentSchema = object({
13663
+ filename: string(),
13664
+ contentType: string(),
13665
+ bytes: number().int().nonnegative()
13666
+ });
13667
+ /** The payload of one `broker.message` (the key is the recipient local-part). */
13668
+ var SmtpInboundMessageSchema = object({
13669
+ /** Monotonic per mailbox; a gap tells a consumer it missed an event. */
13670
+ seq: number().int().positive(),
13671
+ messageId: string(),
13672
+ receivedAt: number().int().nonnegative(),
13673
+ from: string(),
13674
+ to: string(),
13675
+ subject: string(),
13676
+ text: string().max(SMTP_INBOUND_TEXT_MAX_CHARS),
13677
+ attachments: array(SmtpInboundAttachmentSchema)
13678
+ });
13679
+ object({
13680
+ /** The newest seq issued so far (0 before any mail). */
13681
+ lastSeq: number().int().nonnegative(),
13682
+ /** The oldest seq still retained; messages below it are gone. */
13683
+ oldestSeq: number().int().nonnegative(),
13684
+ messages: array(object({
13685
+ key: string(),
13686
+ message: SmtpInboundMessageSchema
13687
+ }))
13688
+ });
13576
13689
  new Set([
13577
13690
  "track",
13578
13691
  "face",
@@ -20157,24 +20270,52 @@ var APPLIANCE_CAP_VOCABULARY = {
20157
20270
  args: { on: false }
20158
20271
  },
20159
20272
  {
20160
- id: "petFountain.intervalOn",
20161
- method: "setPumpInterval",
20273
+ id: "petFountain.resetDailyConsumption",
20274
+ method: "resetDailyConsumption",
20275
+ label: t("Clear daily consumption", "Azzera il consumo giornaliero"),
20276
+ phrase: t("Clear the daily water consumption of {device}", "Azzera il consumo giornaliero di acqua di {device}"),
20277
+ icon: "rotate-ccw"
20278
+ }
20279
+ ],
20280
+ state: [{
20281
+ kind: "boolean",
20282
+ field: "empty",
20283
+ label: t("Tank empty", "Serbatoio vuoto"),
20284
+ whenTrue: t("When the tank of {device} is empty", "Quando il serbatoio di {device} è vuoto"),
20285
+ whenFalse: t("When the tank of {device} is refilled", "Quando il serbatoio di {device} viene riempito"),
20286
+ icon: "droplet"
20287
+ }, {
20288
+ kind: "numeric",
20289
+ field: "waterLevel",
20290
+ quantity: t("the water level", "il livello dell’acqua"),
20291
+ label: t("Water level", "Livello dell’acqua"),
20292
+ unit: "%",
20293
+ icon: "droplets"
20294
+ }]
20295
+ },
20296
+ "pump-cycle": {
20297
+ scope: "device",
20298
+ noun: t("Pump cycle", "Ciclo della pompa"),
20299
+ actions: [
20300
+ {
20301
+ id: "pumpCycle.on",
20302
+ method: "setEnabled",
20162
20303
  label: t("Pump cycle on", "Ciclo pompa attivo"),
20163
20304
  phrase: t("Run the pump of {device} on its on/off cycle", "Fai lavorare la pompa di {device} a ciclo acceso/spento"),
20164
20305
  icon: "timer",
20165
20306
  args: { on: true }
20166
20307
  },
20167
20308
  {
20168
- id: "petFountain.intervalOff",
20169
- method: "setPumpInterval",
20309
+ id: "pumpCycle.off",
20310
+ method: "setEnabled",
20170
20311
  label: t("Pump cycle off", "Ciclo pompa spento"),
20171
20312
  phrase: t("Run the pump of {device} continuously", "Fai lavorare la pompa di {device} in continuo"),
20172
20313
  icon: "timer-off",
20173
20314
  args: { on: false }
20174
20315
  },
20175
20316
  {
20176
- id: "petFountain.pumpOnMinutes",
20177
- method: "setPumpOnMinutes",
20317
+ id: "pumpCycle.onMinutes",
20318
+ method: "setOnMinutes",
20178
20319
  label: t("Set pump run time", "Imposta il tempo di lavoro della pompa"),
20179
20320
  phrase: t("Set the pump of {device} to run {minutes} minutes per cycle", "Imposta la pompa di {device} a lavorare {minutes} minuti per ciclo"),
20180
20321
  icon: "timer",
@@ -20190,8 +20331,8 @@ var APPLIANCE_CAP_VOCABULARY = {
20190
20331
  }]
20191
20332
  },
20192
20333
  {
20193
- id: "petFountain.pumpOffMinutes",
20194
- method: "setPumpOffMinutes",
20334
+ id: "pumpCycle.offMinutes",
20335
+ method: "setOffMinutes",
20195
20336
  label: t("Set pump rest time", "Imposta il tempo di riposo della pompa"),
20196
20337
  phrase: t("Set the pump of {device} to rest {minutes} minutes per cycle", "Imposta la pompa di {device} a riposare {minutes} minuti per ciclo"),
20197
20338
  icon: "timer-off",
@@ -20205,29 +20346,15 @@ var APPLIANCE_CAP_VOCABULARY = {
20205
20346
  unit: "min"
20206
20347
  }
20207
20348
  }]
20208
- },
20209
- {
20210
- id: "petFountain.resetDailyConsumption",
20211
- method: "resetDailyConsumption",
20212
- label: t("Clear daily consumption", "Azzera il consumo giornaliero"),
20213
- phrase: t("Clear the daily water consumption of {device}", "Azzera il consumo giornaliero di acqua di {device}"),
20214
- icon: "rotate-ccw"
20215
20349
  }
20216
20350
  ],
20217
20351
  state: [{
20218
20352
  kind: "boolean",
20219
- field: "empty",
20220
- label: t("Tank empty", "Serbatoio vuoto"),
20221
- whenTrue: t("When the tank of {device} is empty", "Quando il serbatoio di {device} è vuoto"),
20222
- whenFalse: t("When the tank of {device} is refilled", "Quando il serbatoio di {device} viene riempito"),
20223
- icon: "droplet"
20224
- }, {
20225
- kind: "numeric",
20226
- field: "waterLevel",
20227
- quantity: t("the water level", "il livello dell’acqua"),
20228
- label: t("Water level", "Livello dell’acqua"),
20229
- unit: "%",
20230
- icon: "droplets"
20353
+ field: "enabled",
20354
+ label: t("Pump cycle", "Ciclo pompa"),
20355
+ whenTrue: t("When {device} starts running its pump on a cycle", "Quando {device} inizia a far lavorare la pompa a ciclo"),
20356
+ whenFalse: t("When {device} runs its pump continuously", "Quando {device} fa lavorare la pompa in continuo"),
20357
+ icon: "timer"
20231
20358
  }]
20232
20359
  },
20233
20360
  "media-player": {
@@ -22120,6 +22247,7 @@ var SYSTEM_CAP_VOCABULARY = {
22120
22247
  "audio-analyzer": system(PIPELINE),
22121
22248
  "audio-codec": system(INTERNAL),
22122
22249
  "auth-provider": system(IDENTITY),
22250
+ "board-key-source": system(INTERNAL),
22123
22251
  backup: system("system backups — run and restored from the Backups page"),
22124
22252
  broker: system("message-broker connections — configured, not actuated"),
22125
22253
  "calendar-source": system(INTERNAL),
@@ -22154,6 +22282,7 @@ var SYSTEM_CAP_VOCABULARY = {
22154
22282
  "load-contribution": system(INTERNAL),
22155
22283
  "local-network": system(NETWORK),
22156
22284
  "log-channels": system(INTERNAL),
22285
+ "integration-instances": system(INTERNAL),
22157
22286
  "log-destination": system(INTERNAL),
22158
22287
  "login-method": system(IDENTITY),
22159
22288
  "mesh-network": system(NETWORK),
@@ -44300,7 +44429,7 @@ var TargetKindCapsSchema = object({
44300
44429
  * the union is large and not meant for runtime validation here; the exported
44301
44430
  * `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
44302
44431
  */
44303
- var ConfigSchemaPassthrough$3 = unknown();
44432
+ var ConfigSchemaPassthrough$4 = unknown();
44304
44433
  var TargetKindSchema = object({
44305
44434
  kind: string(),
44306
44435
  label: string(),
@@ -44337,7 +44466,7 @@ var TargetKindSchema = object({
44337
44466
  * its raster path, which is the safe default for an unknown image.
44338
44467
  */
44339
44468
  iconMediaType: string().optional(),
44340
- configSchema: ConfigSchemaPassthrough$3,
44469
+ configSchema: ConfigSchemaPassthrough$4,
44341
44470
  /**
44342
44471
  * The config keys that decide WHERE this kind's secrets are sent (server,
44343
44472
  * base URL, instance, chat, recipient). A save that changes any of them
@@ -46581,6 +46710,49 @@ object({
46581
46710
  lastChangedAt: number()
46582
46711
  });
46583
46712
  DeviceType.Sensor;
46713
+ /**
46714
+ * Why a board key could not be read. Typed so a caller reports the cause and
46715
+ * never treats "could not read" as "has no key" (D49).
46716
+ */
46717
+ var BoardKeyFailureReasonSchema = _enum([
46718
+ "unknown-source",
46719
+ "not-admin",
46720
+ "no-builder",
46721
+ "no-ingress-url",
46722
+ "unreachable",
46723
+ "unknown-board",
46724
+ "no-encryption-key",
46725
+ "unreadable-config"
46726
+ ]);
46727
+ var BoardKeySourceSchema = object({
46728
+ sourceId: string(),
46729
+ name: string()
46730
+ });
46731
+ var BoardKeyBoardSchema = object({
46732
+ /** The builder's file name, e.g. `kitchen.yaml`: the handle `getBoardKey` takes. */
46733
+ configuration: string(),
46734
+ /** The node name the builder gives the board. */
46735
+ name: string(),
46736
+ /** The address the builder knows the board by, when it has one. */
46737
+ address: string().nullable()
46738
+ });
46739
+ var BoardKeyFailureSchema = object({
46740
+ ok: literal(false),
46741
+ reason: BoardKeyFailureReasonSchema,
46742
+ detail: string().optional()
46743
+ });
46744
+ var ListBoardsResultSchema = discriminatedUnion("ok", [object({
46745
+ ok: literal(true),
46746
+ boards: array(BoardKeyBoardSchema).readonly()
46747
+ }), BoardKeyFailureSchema]);
46748
+ var GetBoardKeyResultSchema = discriminatedUnion("ok", [object({
46749
+ ok: literal(true),
46750
+ key: string()
46751
+ }), BoardKeyFailureSchema]);
46752
+ method(_void(), array(BoardKeySourceSchema).readonly(), { auth: "admin" }), method(object({ sourceId: string().min(1) }), ListBoardsResultSchema, { auth: "admin" }), method(object({
46753
+ sourceId: string().min(1),
46754
+ configuration: string().min(1)
46755
+ }), GetBoardKeyResultSchema, { auth: "admin" });
46584
46756
  object({
46585
46757
  /** Current level as 0..100 inclusive. Firmware-reported. */
46586
46758
  level: number().min(0).max(100).meta(readingMeta("percentage")),
@@ -52281,7 +52453,7 @@ object({
52281
52453
  /** Ms epoch of the last value received from the appliance; 0 = never. */
52282
52454
  lastFetchedAt: number()
52283
52455
  });
52284
- var DeviceIdSchema$1 = number().int().nonnegative();
52456
+ var DeviceIdSchema$2 = number().int().nonnegative();
52285
52457
  /** A value a program option or setting can take. */
52286
52458
  var DishwasherValueSchema = union([
52287
52459
  boolean(),
@@ -52345,77 +52517,77 @@ var DishwasherOptionsSchema = object({
52345
52517
  options: array(DishwasherOptionDescriptorSchema)
52346
52518
  });
52347
52519
  DeviceType.Dishwasher, method(object({
52348
- deviceId: DeviceIdSchema$1,
52520
+ deviceId: DeviceIdSchema$2,
52349
52521
  program: string().min(1).optional(),
52350
52522
  options: record(string(), DishwasherValueSchema).optional()
52351
52523
  }), _void(), {
52352
52524
  kind: "mutation",
52353
52525
  auth: "protected"
52354
- }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
52526
+ }), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
52355
52527
  kind: "mutation",
52356
52528
  auth: "protected"
52357
- }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
52529
+ }), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
52358
52530
  kind: "mutation",
52359
52531
  auth: "protected"
52360
- }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
52532
+ }), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
52361
52533
  kind: "mutation",
52362
52534
  auth: "protected"
52363
52535
  }), method(object({
52364
- deviceId: DeviceIdSchema$1,
52536
+ deviceId: DeviceIdSchema$2,
52365
52537
  program: string().min(1)
52366
52538
  }), _void(), {
52367
52539
  kind: "mutation",
52368
52540
  auth: "protected"
52369
52541
  }), method(object({
52370
- deviceId: DeviceIdSchema$1,
52542
+ deviceId: DeviceIdSchema$2,
52371
52543
  on: boolean()
52372
52544
  }), _void(), {
52373
52545
  kind: "mutation",
52374
52546
  auth: "protected"
52375
52547
  }), method(object({
52376
- deviceId: DeviceIdSchema$1,
52548
+ deviceId: DeviceIdSchema$2,
52377
52549
  on: boolean()
52378
52550
  }), _void(), {
52379
52551
  kind: "mutation",
52380
52552
  auth: "protected"
52381
52553
  }), method(object({
52382
- deviceId: DeviceIdSchema$1,
52554
+ deviceId: DeviceIdSchema$2,
52383
52555
  on: boolean()
52384
52556
  }), _void(), {
52385
52557
  kind: "mutation",
52386
52558
  auth: "protected"
52387
52559
  }), method(object({
52388
- deviceId: DeviceIdSchema$1,
52560
+ deviceId: DeviceIdSchema$2,
52389
52561
  on: boolean()
52390
52562
  }), _void(), {
52391
52563
  kind: "mutation",
52392
52564
  auth: "protected"
52393
52565
  }), method(object({
52394
- deviceId: DeviceIdSchema$1,
52566
+ deviceId: DeviceIdSchema$2,
52395
52567
  on: boolean()
52396
52568
  }), _void(), {
52397
52569
  kind: "mutation",
52398
52570
  auth: "protected"
52399
52571
  }), method(object({
52400
- deviceId: DeviceIdSchema$1,
52572
+ deviceId: DeviceIdSchema$2,
52401
52573
  on: boolean()
52402
52574
  }), _void(), {
52403
52575
  kind: "mutation",
52404
52576
  auth: "protected"
52405
52577
  }), method(object({
52406
- deviceId: DeviceIdSchema$1,
52578
+ deviceId: DeviceIdSchema$2,
52407
52579
  on: boolean()
52408
52580
  }), _void(), {
52409
52581
  kind: "mutation",
52410
52582
  auth: "protected"
52411
52583
  }), method(object({
52412
- deviceId: DeviceIdSchema$1,
52584
+ deviceId: DeviceIdSchema$2,
52413
52585
  key: string().min(1),
52414
52586
  value: DishwasherValueSchema
52415
52587
  }), _void(), {
52416
52588
  kind: "mutation",
52417
52589
  auth: "protected"
52418
- }), method(object({ deviceId: DeviceIdSchema$1 }), DishwasherOptionsSchema, { auth: "protected" });
52590
+ }), method(object({ deviceId: DeviceIdSchema$2 }), DishwasherOptionsSchema, { auth: "protected" });
52419
52591
  /**
52420
52592
  * Palette entry ids (D939). Audio is the one gradient; `audio-*` leaves are
52421
52593
  * not entries. `heatmapScrub` is a mark, not an event kind.
@@ -54391,6 +54563,89 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
54391
54563
  auth: "admin"
54392
54564
  });
54393
54565
  /**
54566
+ * `integration-instances` - the connection of an addon that holds ONE or SEVERAL
54567
+ * (an account, a relay, a destination) as typed records (D985, D986). The addon's
54568
+ * own function page reads and writes them (Logging for Loki); the Integrations
54569
+ * page lists only the integrations that bring devices (D996).
54570
+ *
54571
+ * A collection of providers: each addon that holds connections registers one and a
54572
+ * caller reaches a provider with the pinned `addonId`.
54573
+ *
54574
+ * Identity: the instance id is immutable and opaque to the caller. A record the
54575
+ * Loki migration made keeps the `integrations` registry id it was created under
54576
+ * (`int_NNNN`); a single instance made by its function page takes the addon id.
54577
+ * `name` is the editable label.
54578
+ *
54579
+ * Secrets: every field the instance kind marks `.meta({ secret: true })` reaches
54580
+ * the form as a `SecretFieldView`, never text (D789). A patch value omitted, `''`
54581
+ * or the redaction token KEEPS the stored secret; `{ $secretClear: true }`
54582
+ * clears it.
54583
+ */
54584
+ var ConfigSchemaPassthrough$3 = custom();
54585
+ var IntegrationInstanceIdSchema = string().min(1);
54586
+ var IntegrationInstanceDescriptionSchema = object({
54587
+ /** `single`: at most one instance can exist (Loki). `multiple`: an account each. */
54588
+ instanceMode: _enum(["single", "multiple"]),
54589
+ /** What the instance is, for the UI (`destination`, `relay`, `account`). */
54590
+ kind: string(),
54591
+ /** True when `testInstance` really probes the remote. */
54592
+ canTest: boolean()
54593
+ });
54594
+ var IntegrationInstanceStatusSchema = object({
54595
+ state: _enum([
54596
+ "ok",
54597
+ "off",
54598
+ "error",
54599
+ "unknown"
54600
+ ]),
54601
+ detail: string().optional()
54602
+ });
54603
+ var IntegrationInstanceSchema = object({
54604
+ id: IntegrationInstanceIdSchema,
54605
+ name: string(),
54606
+ /** The addon's own rule (an URL is present, a client id is present...). */
54607
+ configured: boolean(),
54608
+ /**
54609
+ * The instance's own on/off switch (D996): always present, derived from the record body
54610
+ * (`enabled !== false`, so a row written before the field existed is on).
54611
+ */
54612
+ enabled: boolean(),
54613
+ /** Values for the instance form; a secret is a `SecretFieldView`, never text. */
54614
+ formValues: record(string(), unknown()),
54615
+ status: IntegrationInstanceStatusSchema.optional()
54616
+ });
54617
+ var IntegrationInstancePatchSchema = object({
54618
+ id: IntegrationInstanceIdSchema,
54619
+ name: string().min(1).optional(),
54620
+ /** Omitted / '' / redaction token keeps a secret; `{ $secretClear: true }` clears it. */
54621
+ values: record(string(), unknown())
54622
+ });
54623
+ method(_void(), IntegrationInstanceDescriptionSchema, { auth: "admin" }), method(object({ id: IntegrationInstanceIdSchema.nullable() }), ConfigSchemaPassthrough$3, { auth: "admin" }), method(_void(), array(IntegrationInstanceSchema).readonly(), { auth: "admin" }), method(object({ id: IntegrationInstanceIdSchema }), IntegrationInstanceSchema.nullable(), { auth: "admin" }), method(object({
54624
+ id: IntegrationInstanceIdSchema,
54625
+ name: string().min(1)
54626
+ }), object({ id: string() }), {
54627
+ kind: "mutation",
54628
+ auth: "admin"
54629
+ }), method(IntegrationInstancePatchSchema, object({ ok: literal(true) }), {
54630
+ kind: "mutation",
54631
+ auth: "admin"
54632
+ }), method(object({
54633
+ id: IntegrationInstanceIdSchema,
54634
+ enabled: boolean()
54635
+ }), object({ ok: literal(true) }), {
54636
+ kind: "mutation",
54637
+ auth: "admin"
54638
+ }), method(object({ id: IntegrationInstanceIdSchema }), object({ ok: literal(true) }), {
54639
+ kind: "mutation",
54640
+ auth: "admin"
54641
+ }), optionalMethod(object({
54642
+ id: IntegrationInstanceIdSchema.nullable(),
54643
+ values: record(string(), unknown())
54644
+ }), TestConnectionResultSchema$1, {
54645
+ kind: "mutation",
54646
+ auth: "admin"
54647
+ });
54648
+ /**
54394
54649
  * Two-way audio / talk-back cap. Clients open a WebRTC audio-only
54395
54650
  * session (server-initiated offer pattern, identical to the main
54396
54651
  * video WebRTC flow) and the browser captures the mic; the server
@@ -64901,7 +65156,14 @@ var NcMediaPolicySchema = object({
64901
65156
  */
64902
65157
  profile: CamProfileSchema.optional(),
64903
65158
  /** See {@link NcLinkedCameraModeSchema}. */
64904
- linkedCameras: NcLinkedCameraModeSchema.optional()
65159
+ linkedCameras: NcLinkedCameraModeSchema.optional(),
65160
+ /**
65161
+ * Sensor rules only: may this rule wake a SLEEPING battery camera to take
65162
+ * the linked still it attaches (D998)? Absent means yes, an explicit `false`
65163
+ * opts out. Deliberately not a Zod default: a rule that never chose keeps
65164
+ * following the hub's. One bounded wake per event; nothing is attached later.
65165
+ */
65166
+ wakeSleepingCamera: boolean().optional()
64905
65167
  });
64906
65168
  /**
64907
65169
  * Cooldown GRANULARITY over the subject's class — how much a fired
@@ -65293,6 +65555,21 @@ var NcTemplateVarKindSchema = _enum([
65293
65555
  "sound",
65294
65556
  "system"
65295
65557
  ]);
65558
+ /**
65559
+ * The default title/body a rule of one SITUATION is delivered with when the
65560
+ * operator wrote no template — served so an editor can pre-fill it (and the
65561
+ * operator can rebuild it from placeholders) instead of starting from a blank
65562
+ * box that, once saved, silently replaces it. `id` names the situation inside
65563
+ * a rule `kind`: `appliance-cycle` is a `sensor` rule whose device is an
65564
+ * appliance finishing a cycle. Texts are raw templates (`{{var}}` intact), in
65565
+ * the hub's current language and with its overrides applied.
65566
+ */
65567
+ var NcTemplateDefaultSchema = object({
65568
+ id: _enum(["appliance-cycle"]),
65569
+ kind: NcRuleKindSchema,
65570
+ title: string(),
65571
+ body: string()
65572
+ });
65296
65573
  /** Which producer renders a template: an ordinary rule, a timelapse, a digest. */
65297
65574
  var NcTemplateFamilySchema = _enum([
65298
65575
  "rule",
@@ -66148,7 +66425,11 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
66148
66425
  }), method(object({}), object({
66149
66426
  catalog: array(NcConditionDescriptorSchema),
66150
66427
  taxonomy: NcTaxonomySchema.optional()
66151
- })), method(object({}), object({ vars: array(NcTemplateVarDescriptorSchema) })), method(NcTemplatePreviewInputSchema, NcTemplatePreviewSchema, {
66428
+ })), method(object({}), object({
66429
+ vars: array(NcTemplateVarDescriptorSchema),
66430
+ /** Per-situation default texts; absent on a hub that predates them. */
66431
+ defaults: array(NcTemplateDefaultSchema)
66432
+ })), method(NcTemplatePreviewInputSchema, NcTemplatePreviewSchema, {
66152
66433
  kind: "mutation",
66153
66434
  access: "view"
66154
66435
  }), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" }), method(object({}), NcRuleLastRunsSchema, { auth: "admin" }), method(object({ artifactId: string().min(1) }), object({ url: string().nullable() }), { auth: "admin" }), method(object({}), object({ snoozes: array(NcSnoozeSchema) }), { caller: "required" }), method(object({ snooze: NcSnoozeInputSchema }), object({ snooze: NcSnoozeSchema }), {
@@ -66896,52 +67177,27 @@ object({
66896
67177
  empty: boolean().nullable(),
66897
67178
  /** True while the pump is running. Null while unknown. */
66898
67179
  pumpRunning: boolean().nullable(),
66899
- /** True when the pump works on an on/off duty cycle rather than continuously. */
66900
- pumpIntervalEnabled: boolean().nullable(),
66901
- /** How long the pump runs per cycle, in seconds. */
66902
- pumpOnTime: number().min(0).nullable().meta(readingMeta("duration")),
66903
- /** How long the pump rests per cycle, in seconds. */
66904
- pumpOffTime: number().min(0).nullable().meta(readingMeta("duration")),
66905
67180
  /** Water drunk in the last drink, in litres. */
66906
67181
  lastDrink: number().min(0).nullable().meta(readingMeta("volume")),
66907
67182
  /** Water drunk in the current hour, in litres. */
66908
67183
  currentHourDrink: number().min(0).nullable().meta(readingMeta("volume")),
66909
67184
  /** Water drunk over the last 24 hours (rolling), in litres. */
66910
67185
  last24hDrink: number().min(0).nullable().meta(readingMeta("volume")),
66911
- /** Water drunk since local midnight, in litres. */
67186
+ /** Water drunk since local midnight, in litres. Null when the fountain has no such sensor. */
66912
67187
  todayDrink: number().min(0).nullable().meta(readingMeta("volume")),
66913
67188
  /** Decoded fault message. Null means healthy; a non-null string is an active fault. */
66914
67189
  error: string().nullable(),
66915
67190
  /** Ms epoch when the slice was last refreshed. */
66916
67191
  lastFetchedAt: number()
66917
67192
  });
66918
- var DeviceIdSchema = number().int().nonnegative();
66919
- var MinutesSchema = number().int().min(0);
67193
+ var DeviceIdSchema$1 = number().int().nonnegative();
66920
67194
  DeviceType.PetFountain, method(object({
66921
- deviceId: DeviceIdSchema,
66922
- on: boolean()
66923
- }), _void(), {
66924
- kind: "mutation",
66925
- auth: "protected"
66926
- }), method(object({
66927
- deviceId: DeviceIdSchema,
67195
+ deviceId: DeviceIdSchema$1,
66928
67196
  on: boolean()
66929
67197
  }), _void(), {
66930
67198
  kind: "mutation",
66931
67199
  auth: "protected"
66932
- }), method(object({
66933
- deviceId: DeviceIdSchema,
66934
- minutes: MinutesSchema
66935
- }), _void(), {
66936
- kind: "mutation",
66937
- auth: "protected"
66938
- }), method(object({
66939
- deviceId: DeviceIdSchema,
66940
- minutes: MinutesSchema
66941
- }), _void(), {
66942
- kind: "mutation",
66943
- auth: "protected"
66944
- }), method(object({ deviceId: DeviceIdSchema }), _void(), {
67200
+ }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
66945
67201
  kind: "mutation",
66946
67202
  auth: "protected"
66947
67203
  });
@@ -70096,6 +70352,37 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
70096
70352
  deviceId: number(),
70097
70353
  status: PtzAutotrackStatusSchema
70098
70354
  });
70355
+ object({
70356
+ /** True when the pump works on the on/off cycle, false when it runs continuously. Null while unknown. */
70357
+ enabled: boolean().nullable(),
70358
+ /** How long the pump runs per cycle, in seconds. Null while unknown. */
70359
+ onTime: number().min(0).nullable().meta(readingMeta("duration")),
70360
+ /** How long the pump rests per cycle, in seconds. Null while unknown. */
70361
+ offTime: number().min(0).nullable().meta(readingMeta("duration")),
70362
+ /** Ms epoch when the slice was last refreshed. */
70363
+ lastFetchedAt: number()
70364
+ });
70365
+ var DeviceIdSchema = number().int().nonnegative();
70366
+ var MinutesSchema = number().int().min(0);
70367
+ DeviceType.PetFountain, method(object({
70368
+ deviceId: DeviceIdSchema,
70369
+ on: boolean()
70370
+ }), _void(), {
70371
+ kind: "mutation",
70372
+ auth: "protected"
70373
+ }), method(object({
70374
+ deviceId: DeviceIdSchema,
70375
+ minutes: MinutesSchema
70376
+ }), _void(), {
70377
+ kind: "mutation",
70378
+ auth: "protected"
70379
+ }), method(object({
70380
+ deviceId: DeviceIdSchema,
70381
+ minutes: MinutesSchema
70382
+ }), _void(), {
70383
+ kind: "mutation",
70384
+ auth: "protected"
70385
+ });
70099
70386
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, DeviceType.Gateway, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
70100
70387
  kind: "mutation",
70101
70388
  auth: "admin"
@@ -73798,7 +74085,16 @@ DeviceType.Sensor;
73798
74085
  * future fields without breaking the existing call sites.
73799
74086
  */
73800
74087
  var EmailAddressSchema = email();
74088
+ /**
74089
+ * Which relay of a multi-relay provider answers (D996). Absent = the provider's first / default
74090
+ * relay, so a caller written before relays existed keeps working unchanged. A provider with one
74091
+ * fixed relay ignores it. This is the integration instance id (`int_NNNN`), NOT the addon id: the
74092
+ * collection pin `addonId` still picks the provider, `instanceId` picks the relay inside it.
74093
+ */
74094
+ var InstanceIdSchema = string().min(1).optional();
74095
+ var RelayPinSchema = object({ instanceId: InstanceIdSchema });
73801
74096
  var SendEmailInputSchema = object({
74097
+ instanceId: InstanceIdSchema,
73802
74098
  to: union([EmailAddressSchema, array(EmailAddressSchema).min(1)]),
73803
74099
  cc: array(EmailAddressSchema).optional(),
73804
74100
  bcc: array(EmailAddressSchema).optional(),
@@ -73834,11 +74130,11 @@ method(SendEmailInputSchema, SendEmailResultSchema, {
73834
74130
  kind: "mutation",
73835
74131
  auth: "admin",
73836
74132
  access: "create"
73837
- }), method(_void(), SmtpStatusSchema, {
74133
+ }), method(RelayPinSchema, SmtpStatusSchema, {
73838
74134
  kind: "mutation",
73839
74135
  auth: "admin",
73840
74136
  access: "view"
73841
- }), method(_void(), SmtpStatusSchema, { auth: "admin" });
74137
+ }), method(RelayPinSchema, SmtpStatusSchema, { auth: "admin" });
73842
74138
  /**
73843
74139
  * A single device snapshot returned as base64 JPEG/PNG.
73844
74140
  *
@@ -73870,10 +74166,12 @@ DeviceType.Camera, method(object({
73870
74166
  * even when the cache is well within the device's
73871
74167
  * `snapshotMaxAgeS` window.
73872
74168
  *
73873
- * **`force` is an OPERATOR signal, not a freshness preference.** On a
74169
+ * **`force` is a demand with a named principal, not a freshness
74170
+ * preference** — an operator button, the scheduled refresh (D847), or a
74171
+ * notification rule that left the camera's wake allowed (D998). On a
73874
74172
  * battery camera it is the one thing that walks past the wrapper's
73875
- * sleep gate and wakes the camera, so a background caller — a poller,
73876
- * an event handler, a thumbnail — must NEVER set it. Every such caller
74173
+ * sleep gate and wakes the camera, so a poller, a thumbnail or a
74174
+ * prestream must NEVER set it. Every such caller
73877
74175
  * gets the cached frame, which on a sleeping battery camera is the
73878
74176
  * correct answer: stale but honest beats woken.
73879
74177
  */
@@ -77891,7 +78189,7 @@ discriminatedUnion("kind", [object({
77891
78189
  kind: literal("pronto"),
77892
78190
  code: string()
77893
78191
  })]);
77894
- DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
78192
+ DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverStoppable, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
77895
78193
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
77896
78194
  String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
77897
78195
  DeviceRole.BinarySensor, DeviceRole.MotionSensor;
@@ -78872,6 +79170,27 @@ Object.freeze({
78872
79170
  access: "view",
78873
79171
  role: "viewer"
78874
79172
  },
79173
+ "boardKeySource.getBoardKey": {
79174
+ capName: "board-key-source",
79175
+ capScope: "system",
79176
+ addonId: null,
79177
+ access: "view",
79178
+ role: "admin"
79179
+ },
79180
+ "boardKeySource.listBoards": {
79181
+ capName: "board-key-source",
79182
+ capScope: "system",
79183
+ addonId: null,
79184
+ access: "view",
79185
+ role: "admin"
79186
+ },
79187
+ "boardKeySource.listSources": {
79188
+ capName: "board-key-source",
79189
+ capScope: "system",
79190
+ addonId: null,
79191
+ access: "view",
79192
+ role: "admin"
79193
+ },
78875
79194
  "brightness.getStatus": {
78876
79195
  capName: "brightness",
78877
79196
  capScope: "device",
@@ -81511,6 +81830,69 @@ Object.freeze({
81511
81830
  access: "create",
81512
81831
  role: "admin"
81513
81832
  },
81833
+ "integrationInstances.createInstance": {
81834
+ capName: "integration-instances",
81835
+ capScope: "system",
81836
+ addonId: null,
81837
+ access: "create",
81838
+ role: "admin"
81839
+ },
81840
+ "integrationInstances.deleteInstance": {
81841
+ capName: "integration-instances",
81842
+ capScope: "system",
81843
+ addonId: null,
81844
+ access: "delete",
81845
+ role: "admin"
81846
+ },
81847
+ "integrationInstances.describe": {
81848
+ capName: "integration-instances",
81849
+ capScope: "system",
81850
+ addonId: null,
81851
+ access: "view",
81852
+ role: "admin"
81853
+ },
81854
+ "integrationInstances.getInstance": {
81855
+ capName: "integration-instances",
81856
+ capScope: "system",
81857
+ addonId: null,
81858
+ access: "view",
81859
+ role: "admin"
81860
+ },
81861
+ "integrationInstances.instanceFormSchema": {
81862
+ capName: "integration-instances",
81863
+ capScope: "system",
81864
+ addonId: null,
81865
+ access: "view",
81866
+ role: "admin"
81867
+ },
81868
+ "integrationInstances.listInstances": {
81869
+ capName: "integration-instances",
81870
+ capScope: "system",
81871
+ addonId: null,
81872
+ access: "view",
81873
+ role: "admin"
81874
+ },
81875
+ "integrationInstances.setInstanceEnabled": {
81876
+ capName: "integration-instances",
81877
+ capScope: "system",
81878
+ addonId: null,
81879
+ access: "create",
81880
+ role: "admin"
81881
+ },
81882
+ "integrationInstances.testInstance": {
81883
+ capName: "integration-instances",
81884
+ capScope: "system",
81885
+ addonId: null,
81886
+ access: "create",
81887
+ role: "admin"
81888
+ },
81889
+ "integrationInstances.updateInstance": {
81890
+ capName: "integration-instances",
81891
+ capScope: "system",
81892
+ addonId: null,
81893
+ access: "create",
81894
+ role: "admin"
81895
+ },
81514
81896
  "integrations.create": {
81515
81897
  capName: "integrations",
81516
81898
  capScope: "system",
@@ -83632,27 +84014,6 @@ Object.freeze({
83632
84014
  access: "create",
83633
84015
  role: "viewer"
83634
84016
  },
83635
- "petFountain.setPumpInterval": {
83636
- capName: "pet-fountain",
83637
- capScope: "device",
83638
- addonId: null,
83639
- access: "create",
83640
- role: "viewer"
83641
- },
83642
- "petFountain.setPumpOffMinutes": {
83643
- capName: "pet-fountain",
83644
- capScope: "device",
83645
- addonId: null,
83646
- access: "create",
83647
- role: "viewer"
83648
- },
83649
- "petFountain.setPumpOnMinutes": {
83650
- capName: "pet-fountain",
83651
- capScope: "device",
83652
- addonId: null,
83653
- access: "create",
83654
- role: "viewer"
83655
- },
83656
84017
  "pipelineAnalytics.addRetrainFrameFromRecording": {
83657
84018
  capName: "pipeline-analytics",
83658
84019
  capScope: "device",
@@ -85431,6 +85792,34 @@ Object.freeze({
85431
85792
  access: "create",
85432
85793
  role: "admin"
85433
85794
  },
85795
+ "pumpCycle.getStatus": {
85796
+ capName: "pump-cycle",
85797
+ capScope: "device",
85798
+ addonId: null,
85799
+ access: "view",
85800
+ role: "viewer"
85801
+ },
85802
+ "pumpCycle.setEnabled": {
85803
+ capName: "pump-cycle",
85804
+ capScope: "device",
85805
+ addonId: null,
85806
+ access: "create",
85807
+ role: "viewer"
85808
+ },
85809
+ "pumpCycle.setOffMinutes": {
85810
+ capName: "pump-cycle",
85811
+ capScope: "device",
85812
+ addonId: null,
85813
+ access: "create",
85814
+ role: "viewer"
85815
+ },
85816
+ "pumpCycle.setOnMinutes": {
85817
+ capName: "pump-cycle",
85818
+ capScope: "device",
85819
+ addonId: null,
85820
+ access: "create",
85821
+ role: "viewer"
85822
+ },
85434
85823
  "reboot.reboot": {
85435
85824
  capName: "reboot",
85436
85825
  capScope: "device",
@@ -90003,21 +90392,6 @@ Object.freeze({
90003
90392
  form: "single",
90004
90393
  optional: false
90005
90394
  }],
90006
- "petFountain.setPumpInterval": [{
90007
- name: "deviceId",
90008
- form: "single",
90009
- optional: false
90010
- }],
90011
- "petFountain.setPumpOffMinutes": [{
90012
- name: "deviceId",
90013
- form: "single",
90014
- optional: false
90015
- }],
90016
- "petFountain.setPumpOnMinutes": [{
90017
- name: "deviceId",
90018
- form: "single",
90019
- optional: false
90020
- }],
90021
90395
  "pipelineAnalytics.addRetrainFrameFromRecording": [{
90022
90396
  name: "deviceId",
90023
90397
  form: "single",
@@ -90653,6 +91027,26 @@ Object.freeze({
90653
91027
  form: "single",
90654
91028
  optional: false
90655
91029
  }],
91030
+ "pumpCycle.getStatus": [{
91031
+ name: "deviceId",
91032
+ form: "single",
91033
+ optional: false
91034
+ }],
91035
+ "pumpCycle.setEnabled": [{
91036
+ name: "deviceId",
91037
+ form: "single",
91038
+ optional: false
91039
+ }],
91040
+ "pumpCycle.setOffMinutes": [{
91041
+ name: "deviceId",
91042
+ form: "single",
91043
+ optional: false
91044
+ }],
91045
+ "pumpCycle.setOnMinutes": [{
91046
+ name: "deviceId",
91047
+ form: "single",
91048
+ optional: false
91049
+ }],
90656
91050
  "reboot.reboot": [{
90657
91051
  name: "deviceId",
90658
91052
  form: "single",
@@ -108534,12 +108928,21 @@ var EARLY_LOOK_REASON = "occupancy-sustain-look";
108534
108928
  /** Past the sustain's end: the burst's frames must reach the watcher AFTER
108535
108929
  * the window, and a dial takes a moment. */
108536
108930
  var EARLY_LOOK_MARGIN_MS = 2e3;
108537
- /** A found burst resets the streak; two consecutive empty ones disarm. */
108538
- function foldBurstOutcome(streak, found) {
108539
- if (found) return {
108931
+ function burstVerdict(burst) {
108932
+ if (burst.found) return "found";
108933
+ return burst.results > 0 ? "empty" : "no-verdict";
108934
+ }
108935
+ /** A found burst resets the streak; two consecutive empty ones disarm; a
108936
+ * burst without a verdict changes nothing. */
108937
+ function foldBurstOutcome(streak, verdict) {
108938
+ if (verdict === "found") return {
108540
108939
  emptyStreak: 0,
108541
108940
  armed: true
108542
108941
  };
108942
+ if (verdict === "no-verdict") return {
108943
+ emptyStreak: streak.emptyStreak,
108944
+ armed: true
108945
+ };
108543
108946
  const emptyStreak = streak.emptyStreak + 1;
108544
108947
  return {
108545
108948
  emptyStreak,
@@ -108614,10 +109017,12 @@ var OccupancyRecheckController = class {
108614
109017
  }
108615
109018
  /** Every inference result the orchestrator sees; a burst result with
108616
109019
  * detections is what makes a burst "found". */
108617
- noteInferenceResult(deviceId, occasion, detectionCount) {
109020
+ noteInferenceResult(deviceId, occasion, detectionCount, shed = false) {
108618
109021
  const state = this.devices.get(deviceId);
108619
109022
  if (state === void 0 || state.burst === null) return;
108620
- if (occasion === "burst" && detectionCount > 0) state.burst.found = true;
109023
+ if (occasion !== "burst" || shed) return;
109024
+ state.burst.results += 1;
109025
+ if (detectionCount > 0) state.burst.found = true;
108621
109026
  }
108622
109027
  /**
108623
109028
  * An occupancy flip is pending on this camera and can commit `afterMs` from
@@ -108827,7 +109232,8 @@ var OccupancyRecheckController = class {
108827
109232
  const burst = {
108828
109233
  nodeId,
108829
109234
  superseded: false,
108830
- found: false
109235
+ found: false,
109236
+ results: 0
108831
109237
  };
108832
109238
  state.burst = burst;
108833
109239
  try {
@@ -108907,10 +109313,12 @@ var OccupancyRecheckController = class {
108907
109313
  }
108908
109314
  async settle(deviceId, state, burst) {
108909
109315
  await this.release(deviceId, state, burst);
108910
- const fold = foldBurstOutcome({ emptyStreak: state.emptyStreak }, burst.found);
109316
+ const verdict = burstVerdict(burst);
109317
+ const fold = foldBurstOutcome({ emptyStreak: state.emptyStreak }, verdict);
108911
109318
  state.emptyStreak = fold.emptyStreak;
108912
109319
  state.armed = fold.armed;
108913
- this.deps.logger.info("occupancy recheck: burst complete", {
109320
+ const message = verdict === "no-verdict" ? "occupancy recheck: burst complete — no verdict, streak unchanged" : "occupancy recheck: burst complete";
109321
+ this.deps.logger.info(message, {
108914
109322
  tags: {
108915
109323
  deviceId,
108916
109324
  nodeId: burst.nodeId
@@ -108919,6 +109327,8 @@ var OccupancyRecheckController = class {
108919
109327
  deviceId,
108920
109328
  nodeId: burst.nodeId,
108921
109329
  found: burst.found,
109330
+ verdict,
109331
+ results: burst.results,
108922
109332
  emptyStreak: fold.emptyStreak,
108923
109333
  armed: fold.armed,
108924
109334
  superseded: burst.superseded
@@ -109568,8 +109978,8 @@ var SessionDispatchController = class {
109568
109978
  * Every inference result the orchestrator sees, for the recheck's
109569
109979
  * found/empty verdict: a `'burst'` result with detections is a found burst.
109570
109980
  */
109571
- noteInferenceResult(deviceId, occasion, detectionCount) {
109572
- this.recheck?.noteInferenceResult(deviceId, occasion, detectionCount);
109981
+ noteInferenceResult(deviceId, occasion, detectionCount, shed = false) {
109982
+ this.recheck?.noteInferenceResult(deviceId, occasion, detectionCount, shed);
109573
109983
  }
109574
109984
  /**
109575
109985
  * Placement changed — this controller just attached or detached something, so
@@ -111933,7 +112343,7 @@ async function buildOrchestratorControllers(deps) {
111933
112343
  handleSettingsChanged: (deviceId) => deps.handleSettingsChanged(deviceId),
111934
112344
  handlePipelineCameraUpdated: (deviceId, config) => deps.handlePipelineCameraUpdated(deviceId, config),
111935
112345
  handleInferenceResult: (payload) => {
111936
- session.noteInferenceResult(payload.deviceId, payload.occasion, payload.frame.detections?.length ?? 0);
112346
+ session.noteInferenceResult(payload.deviceId, payload.occasion, payload.frame.detections?.length ?? 0, payload.frame.shed === true);
111937
112347
  return deps.handleInferenceResult(payload);
111938
112348
  },
111939
112349
  noteMetrics: (deviceId, nodeId, metrics) => {