@camstack/server 1.2.841 → 1.2.842

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 (99) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/api/oauth2/oauth2-routes.js +50 -6
  3. package/dist/core/addon/addon-registry.service.js +4 -0
  4. package/dist/core/addon/addon-route-request.js +18 -0
  5. package/dist/main.js +8 -5
  6. package/package.json +16 -18
  7. package/system/dist/addon-routes/addon-route-registry.d.ts +27 -1
  8. package/system/dist/addon-runner.js +3 -1
  9. package/system/dist/addon-runner.mjs +3 -1
  10. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  11. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  12. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  13. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  14. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  15. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  16. package/system/dist/builtins/autotrack/index.js +1 -1
  17. package/system/dist/builtins/autotrack/index.mjs +1 -1
  18. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  19. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  20. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  21. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  22. package/system/dist/builtins/camera-grid/index.js +1 -1
  23. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  24. package/system/dist/builtins/composer/composer.addon.js +4 -4
  25. package/system/dist/builtins/composer/composer.addon.mjs +4 -4
  26. package/system/dist/builtins/console-logging/index.js +1 -1
  27. package/system/dist/builtins/console-logging/index.mjs +1 -1
  28. package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
  29. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
  30. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  31. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  32. package/system/dist/builtins/device-manager/device-manager.addon.js +2 -2
  33. package/system/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  34. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  35. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  36. package/system/dist/builtins/keychain/index.js +4 -4
  37. package/system/dist/builtins/keychain/index.mjs +4 -4
  38. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  39. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  40. package/system/dist/builtins/local-auth/local-auth.addon.js +21 -7
  41. package/system/dist/builtins/local-auth/local-auth.addon.mjs +21 -7
  42. package/system/dist/builtins/local-auth/oauth-grants.d.ts +9 -1
  43. package/system/dist/builtins/local-auth/oauth-session-manager.d.ts +8 -0
  44. package/system/dist/builtins/local-auth/record-kinds.d.ts +2 -0
  45. package/system/dist/builtins/local-network/local-network.addon.js +3 -3
  46. package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
  47. package/system/dist/builtins/loki-logging/index.js +1 -1
  48. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  49. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  50. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  51. package/system/dist/builtins/platform-probe/index.js +1 -1
  52. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  53. package/system/dist/builtins/record-entries/index.js +1 -1
  54. package/system/dist/builtins/record-entries/index.mjs +1 -1
  55. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  56. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  57. package/system/dist/builtins/snapshot/index.js +1 -1
  58. package/system/dist/builtins/snapshot/index.mjs +1 -1
  59. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  60. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  61. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  62. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  63. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  64. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  65. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  66. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  67. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  68. package/system/dist/builtins/system-config/system-config.addon.mjs +3 -3
  69. package/system/dist/builtins/winston-logging/index.js +1 -1
  70. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  71. package/system/dist/{capture-engine-CGU4rnN-.js → capture-engine-DSrJUGYs.js} +1 -1
  72. package/system/dist/{capture-engine-CLrh3FG0.mjs → capture-engine-DySELkE_.mjs} +1 -1
  73. package/system/dist/{composition-sources-bhWIz4Rp.js → composition-sources-CNfFz3Cz.js} +1 -1
  74. package/system/dist/{composition-sources-CoLbBru1.mjs → composition-sources-DZ4E9FFU.mjs} +1 -1
  75. package/system/dist/{constants-CfAS4Qm6.mjs → constants-BEXN_b1Y.mjs} +1 -1
  76. package/system/dist/{constants-DZwpZY5J.js → constants-DkgFDCQ7.js} +1 -1
  77. package/system/dist/{device-ca-CAbEBLyf.mjs → device-ca-Dk_9f4MY.mjs} +1 -1
  78. package/system/dist/{device-ca-ksS811fC.js → device-ca-sYcSz-Fv.js} +1 -1
  79. package/system/dist/{dist-ByiDJLen.mjs → dist-4jAoRtpT.mjs} +621 -38
  80. package/system/dist/{dist-DlRUArVs.js → dist-LQWK1_M4.js} +626 -37
  81. package/system/dist/file-host-worker.js +1 -1
  82. package/system/dist/file-host-worker.mjs +1 -1
  83. package/system/dist/{hub-identity-Bh28ooQx.mjs → hub-identity-BxGHDga-.mjs} +1 -1
  84. package/system/dist/{hub-identity-C-1NeWlr.js → hub-identity-haC7V8-b.js} +1 -1
  85. package/system/dist/{hub-mdns-ciao-OWO6Bw-X.mjs → hub-mdns-ciao-Birwi8W5.mjs} +2 -2
  86. package/system/dist/{hub-mdns-ciao-CL-Z9yMs.js → hub-mdns-ciao-zxNvdRQz.js} +2 -2
  87. package/system/dist/index.d.ts +1 -1
  88. package/system/dist/index.js +55 -9
  89. package/system/dist/index.mjs +54 -10
  90. package/system/dist/kernel/moleculer/child-addon-call-dispatch.d.ts +1 -0
  91. package/system/dist/{legacy-integration-rows-door-Be_QKUlY.mjs → legacy-integration-rows-door-C-hOd-lt.mjs} +1 -1
  92. package/system/dist/{legacy-integration-rows-door-CDPH26e8.js → legacy-integration-rows-door-CCtcCRjZ.js} +1 -1
  93. package/system/dist/{rename-composition-block-Bs5KT3Gn.js → rename-composition-block-BCZeI3eY.js} +1 -1
  94. package/system/dist/{rename-composition-block-CncvFIHl.mjs → rename-composition-block-YpAVqp4W.mjs} +1 -1
  95. package/system/dist/{restore-archive-DX7kK3LQ.mjs → restore-archive-BpC3y50e.mjs} +1 -1
  96. package/system/dist/{restore-archive-CHUKcl3T.js → restore-archive-D0Nyukhb.js} +1 -1
  97. package/system/dist/{wal-maintenance-Fibm7rsM.mjs → wal-maintenance-C7jLVFCw.mjs} +0 -0
  98. package/system/dist/{wal-maintenance-GNE9Oqdu.js → wal-maintenance-CRiSNk0X.js} +0 -0
  99. package/system/package.json +1 -1
@@ -1243,7 +1243,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1243
1243
  */
1244
1244
  var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
1245
1245
  //#endregion
1246
- //#region ../types/dist/sleep-Bn346wCJ.mjs
1246
+ //#region ../types/dist/sleep-D0roI_CZ.mjs
1247
1247
  /**
1248
1248
  * The audio chunk plane's byte format, and the ONE expansion from a coded
1249
1249
  * window to float samples (D455).
@@ -12508,6 +12508,10 @@ Object.freeze({
12508
12508
  "path": "lastEvent.eventType",
12509
12509
  "valueType": "string"
12510
12510
  },
12511
+ {
12512
+ "path": "lastEvent.sourceId",
12513
+ "valueType": "string"
12514
+ },
12511
12515
  {
12512
12516
  "path": "lastEvent.timestamp",
12513
12517
  "valueType": "number"
@@ -17259,6 +17263,22 @@ function describeUnmet(unmet) {
17259
17263
  }
17260
17264
  }
17261
17265
  /**
17266
+ * The integration instance of an addon, as it appears in an address or on an
17267
+ * OAuth link (planning#415, D1046).
17268
+ *
17269
+ * The DEFAULT instance has two spellings on the wire and one in the code: a
17270
+ * path with no instance segment and a link with no instance both mean it, and
17271
+ * its id is the addon id. {@link oauthLinkServesInstance} is the one
17272
+ * comparison a per-instance route is meant to call, so nobody compares
17273
+ * `undefined` with an id. Nothing calls it yet: no route declares
17274
+ * `perInstance` (the Alexa per-instance route, T3, is the first consumer).
17275
+ */
17276
+ /** An instance id as it may appear in a path or a query: no separator, no escape, bounded. */
17277
+ var ADDON_INSTANCE_ID_RE = /^[A-Za-z0-9._-]{1,64}$/;
17278
+ function isAddonInstanceId(value) {
17279
+ return ADDON_INSTANCE_ID_RE.test(value);
17280
+ }
17281
+ /**
17262
17282
  * notification-output — canonical, capability-gated notification delivery.
17263
17283
  *
17264
17284
  * Apprise-derived model (see
@@ -44149,9 +44169,12 @@ function convertLegacyWhen(half) {
44149
44169
  * every caller — automations, Actions, and the notification centre, which runs
44150
44170
  * only Actions (planning#473).
44151
44171
  */
44172
+ /** The longest one `wait` step lasts. It is cut by a restart of the run and does not survive a hub restart. */
44173
+ var WAIT_MAX_SECONDS = 3600;
44174
+ var WAIT_TOO_LONG = `a wait is at most one hour (${WAIT_MAX_SECONDS} s)`;
44152
44175
  var AutomationWaitStepSchema = z.object({
44153
44176
  kind: z.literal("wait"),
44154
- seconds: z.number().min(0).max(300)
44177
+ seconds: z.number().min(0).max(WAIT_MAX_SECONDS, WAIT_TOO_LONG)
44155
44178
  });
44156
44179
  /** The legacy `deviceId` of a cap step: still READ, never written (D983). */
44157
44180
  var LegacyStepDeviceSchema = z.union([
@@ -44281,20 +44304,210 @@ var ActionStepSchema = z.discriminatedUnion("kind", [GuardedWaitStepSchema, Guar
44281
44304
  path: ["if"]
44282
44305
  });
44283
44306
  });
44307
+ /**
44308
+ * Flow control of an AUTOMATION's list (#500). A standalone list (an action, a
44309
+ * scheduler point, a preset) stays `wait` and `cap`: it has no run of its own
44310
+ * to end and no variable bag to write.
44311
+ */
44312
+ var continueOnErrorShape = {
44313
+ /** A failure of this step is traced `failed-continued` and the next step runs. */
44314
+ continueOnError: z.literal(true).optional() };
44315
+ /** An automation's cap step: the shared guarded cap step, plus `continueOnError`. */
44316
+ var AutomationGuardedCapStepSchema = AutomationCapStepBaseSchema.extend({
44317
+ ...stepGuardShape,
44318
+ ...continueOnErrorShape
44319
+ }).refine((step) => step.target !== void 0 || step.deviceId !== void 0, {
44320
+ message: "a cap step needs a target",
44321
+ path: ["target"]
44322
+ }).refine((step) => step.target?.kind !== "domain" || step.actionId !== void 0, {
44323
+ message: "a domain target needs the vocabulary action it applies to (actionId)",
44324
+ path: ["actionId"]
44325
+ }).refine((step) => step.else === void 0 || step.if !== void 0, elseNeedsIf);
44326
+ /** End the run here, on purpose. `reason` may carry `{{vars.x}}` slots. */
44327
+ var AutomationStopStepSchema = z.object({
44328
+ kind: z.literal("stop"),
44329
+ reason: z.string().min(1, "a stop needs a reason: it is what the run trace shows").max(200),
44330
+ /** `ok`: the run ends as a success. `failed`: it ends as a failure, with the reason. */
44331
+ outcome: z.enum(["ok", "failed"]),
44332
+ /** Stop only when this reads true; false or unknown does not stop. */
44333
+ if: AutomationWhenSchema.optional()
44334
+ });
44335
+ var SET_VAR_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]{0,39}$/;
44336
+ /** Names the run itself writes and reads (`leaf` is what `triggered-by` judges): a step may not overwrite them. */
44337
+ var RESERVED_RUN_VARS = [
44338
+ "kind",
44339
+ "leaf",
44340
+ "at"
44341
+ ];
44342
+ /**
44343
+ * Write variables into the run's bag, for the steps after it. SUBSTITUTION
44344
+ * only, never evaluation: a text value may carry `{{vars.x}}` slots.
44345
+ */
44346
+ var AutomationSetStepSchema = z.object({
44347
+ kind: z.literal("set"),
44348
+ vars: z.record(z.string(), z.union([
44349
+ z.string().max(500),
44350
+ z.number(),
44351
+ z.boolean()
44352
+ ])).refine((vars) => Object.keys(vars).every((name) => SET_VAR_NAME_RE.test(name)), { message: "a variable name is letters, digits and _, not starting with a digit (max 40)" }).refine((vars) => Object.keys(vars).length >= 1, { message: "set needs at least one variable" }).refine((vars) => Object.keys(vars).length <= 20, { message: `set holds at most 20 variables` }).refine((vars) => Object.keys(vars).every((name) => !RESERVED_RUN_VARS.includes(name)), { message: `the names ${RESERVED_RUN_VARS.join(", ")} belong to the run and cannot be set` }),
44353
+ /** Set only when this reads true; false or unknown leaves the bag as it is. */
44354
+ if: AutomationWhenSchema.optional()
44355
+ });
44356
+ var AutomationRunActionStepSchema = z.object({
44357
+ kind: z.literal("action"),
44358
+ /** An entry of the `actions` surface (`internal:<uuid>` or `<addonId>:<localId>`). */
44359
+ actionId: z.string().min(1),
44360
+ /** Values for the action's declared variables; the others take their default. */
44361
+ variables: z.record(z.string(), z.union([
44362
+ z.string(),
44363
+ z.number(),
44364
+ z.boolean()
44365
+ ])).optional(),
44366
+ ...continueOnErrorShape
44367
+ });
44368
+ /**
44369
+ * A step INSIDE a branch of a `choose`: a flow step with no condition of its
44370
+ * own (the branch is the condition) and no block inside it. Strict, so an `if`
44371
+ * written on such a step is refused rather than dropped.
44372
+ */
44373
+ /** The longest a `wait-until` may wait: six hours. */
44374
+ var WAIT_UNTIL_TIMEOUT_MAX_S = 21600;
44375
+ /**
44376
+ * Pause the run until a condition is true (#500). The timeout is mandatory: a
44377
+ * run never waits without an end. `onTimeout` says what a wait that ran out
44378
+ * does: `continue` goes on to the next step, `stop` ends the run as a failure.
44379
+ * A condition that cannot be read is not "true": the wait goes on (D49).
44380
+ */
44381
+ var AutomationWaitUntilStepSchema = z.object({
44382
+ kind: z.literal("wait-until"),
44383
+ when: AutomationWhenSchema,
44384
+ timeoutS: z.number().int().min(1, "a wait needs a timeout of at least one second").max(WAIT_UNTIL_TIMEOUT_MAX_S, `a wait for a condition is at most six hours (${WAIT_UNTIL_TIMEOUT_MAX_S} s)`),
44385
+ onTimeout: z.enum(["continue", "stop"])
44386
+ }).strict();
44387
+ /** The step kinds that hold steps of their own, or pause on a condition: they nest two levels at most. */
44388
+ var BLOCK_STEP_KINDS = [
44389
+ "choose",
44390
+ "repeat",
44391
+ "parallel",
44392
+ "wait-until"
44393
+ ];
44394
+ var NEST_TOO_DEEP = `steps nest two levels at most: a step inside a nested choose or repeat can be a plain step only`;
44395
+ function kindOf(input) {
44396
+ return typeof input === "object" && input !== null ? Reflect.get(input, "kind") : void 0;
44397
+ }
44398
+ /** Where the nesting ends, a block step is refused in words rather than as an unknown kind. */
44399
+ function nestTooDeep(issue) {
44400
+ const kind = kindOf(issue.input);
44401
+ return typeof kind === "string" && BLOCK_STEP_KINDS.includes(kind) ? NEST_TOO_DEEP : void 0;
44402
+ }
44403
+ var plainStepSchemas = [
44404
+ AutomationWaitStepSchema.strict(),
44405
+ AutomationCapStepBaseSchema.extend(continueOnErrorShape).strict().refine((step) => step.target !== void 0 || step.deviceId !== void 0, {
44406
+ message: "a cap step needs a target",
44407
+ path: ["target"]
44408
+ }).refine((step) => step.target?.kind !== "domain" || step.actionId !== void 0, {
44409
+ message: "a domain target needs the vocabulary action it applies to (actionId)",
44410
+ path: ["actionId"]
44411
+ }),
44412
+ AutomationStopStepSchema.omit({ if: true }).strict(),
44413
+ AutomationSetStepSchema.omit({ if: true }).strict(),
44414
+ AutomationRunActionStepSchema.strict()
44415
+ ];
44416
+ /**
44417
+ * A plain step: a flow step with no condition of its own and no step inside
44418
+ * it. The second (last) level of nesting holds these only.
44419
+ */
44420
+ var AutomationBranchStepSchema = z.discriminatedUnion("kind", plainStepSchemas, { error: nestTooDeep });
44421
+ /** A step that can run beside others: it writes no variable and does not end the run. */
44422
+ var AutomationParallelMemberSchema = AutomationBranchStepSchema.refine((step) => step.kind === "cap" || step.kind === "action" || step.kind === "wait", "a parallel holds device commands, actions and waits only: a set or a stop beside other steps has no order");
44423
+ /**
44424
+ * Several steps at once (#500): all are started together and all are awaited.
44425
+ * A failure fails the run once the others finished, as in a sequence; a member
44426
+ * marked "continue if this fails" does not.
44427
+ */
44428
+ var AutomationParallelStepSchema = z.object({
44429
+ kind: z.literal("parallel"),
44430
+ steps: z.array(AutomationParallelMemberSchema).min(2, "a parallel needs at least two steps").max(5, `a parallel takes at most 5 steps`)
44431
+ }).strict();
44432
+ var REPEAT_NEEDS_MAX = "a repeat on a condition needs a maximum number of iterations";
44433
+ /** A loop on a condition: the bound is mandatory, so a run never loops without an end. */
44434
+ var repeatConditionShape = {
44435
+ when: AutomationWhenSchema,
44436
+ maxIterations: z.number({ error: REPEAT_NEEDS_MAX }).int().min(1, REPEAT_NEEDS_MAX).max(50, `a repeat on a condition runs at most 50 times`),
44437
+ /** A pause between two iterations, never after the last. */
44438
+ waitS: z.number().int().min(1).max(WAIT_MAX_SECONDS, WAIT_TOO_LONG).optional()
44439
+ };
44440
+ /** What decides how many times a `repeat` runs. */
44441
+ var AutomationRepeatLoopSchema = z.discriminatedUnion("by", [
44442
+ z.object({
44443
+ by: z.literal("count"),
44444
+ count: z.number().int().min(1).max(20, `a repeat runs at most 20 times`)
44445
+ }).strict(),
44446
+ z.object({
44447
+ by: z.literal("while"),
44448
+ ...repeatConditionShape
44449
+ }).strict(),
44450
+ z.object({
44451
+ by: z.literal("until"),
44452
+ ...repeatConditionShape
44453
+ }).strict(),
44454
+ z.object({
44455
+ by: z.literal("forEach"),
44456
+ target: z.object({
44457
+ kind: z.literal("devices"),
44458
+ ids: z.array(z.number().int()).min(1, "a repeat over devices needs at least one device").max(50, `a repeat over devices takes at most 50 devices`)
44459
+ }).strict()
44460
+ }).strict()
44461
+ ]);
44462
+ /**
44463
+ * The same steps several times (#500). Every form is bounded at save, so a
44464
+ * run cannot loop without an end. A failure or a `stop` in the steps ends the
44465
+ * loop and the run, as in a sequence.
44466
+ */
44467
+ function repeatSchemaOf(step) {
44468
+ return z.object({
44469
+ kind: z.literal("repeat"),
44470
+ loop: AutomationRepeatLoopSchema,
44471
+ steps: z.array(step).min(1, "a repeat needs at least one step").max(10, `a repeat takes at most 10 steps`)
44472
+ }).strict();
44473
+ }
44474
+ /**
44475
+ * One step, several ways (#500): the branches are read in order and the FIRST
44476
+ * whose condition is true runs; `else` runs when every branch is false. A
44477
+ * branch that cannot be read ends the choice: nothing runs, not the branches
44478
+ * after it and not the else (D49). The #472 `if` / `else` of a wait or cap
44479
+ * step is the one-branch case and stays as it is stored.
44480
+ */
44481
+ function chooseSchemaOf(step) {
44482
+ const steps = z.array(step).max(10);
44483
+ return z.object({
44484
+ kind: z.literal("choose"),
44485
+ branches: z.array(z.object({
44486
+ if: AutomationWhenSchema,
44487
+ steps: steps.min(1, "a branch needs at least one step")
44488
+ })).min(1, "a choose needs at least one branch").max(6, `a choose takes at most 6 branches`),
44489
+ else: steps.optional()
44490
+ });
44491
+ }
44492
+ var AutomationBodyStepSchema = z.discriminatedUnion("kind", [
44493
+ ...plainStepSchemas,
44494
+ AutomationWaitUntilStepSchema,
44495
+ AutomationParallelStepSchema,
44496
+ chooseSchemaOf(AutomationBranchStepSchema),
44497
+ repeatSchemaOf(AutomationBranchStepSchema)
44498
+ ]);
44499
+ var AutomationRepeatStepSchema = repeatSchemaOf(AutomationBodyStepSchema);
44500
+ var AutomationChooseStepSchema = chooseSchemaOf(AutomationBodyStepSchema);
44284
44501
  var AutomationActionSchema = z.discriminatedUnion("kind", [
44285
44502
  GuardedWaitStepSchema,
44286
- GuardedCapStepSchema,
44287
- z.object({
44288
- kind: z.literal("action"),
44289
- /** An entry of the `actions` surface (`internal:<uuid>` or `<addonId>:<localId>`). */
44290
- actionId: z.string().min(1),
44291
- /** Values for the action's declared variables; the others take their default. */
44292
- variables: z.record(z.string(), z.union([
44293
- z.string(),
44294
- z.number(),
44295
- z.boolean()
44296
- ])).optional()
44297
- }),
44503
+ AutomationGuardedCapStepSchema,
44504
+ AutomationStopStepSchema,
44505
+ AutomationSetStepSchema,
44506
+ AutomationChooseStepSchema,
44507
+ AutomationWaitUntilStepSchema,
44508
+ AutomationParallelStepSchema,
44509
+ AutomationRepeatStepSchema,
44510
+ AutomationRunActionStepSchema,
44298
44511
  z.object({
44299
44512
  kind: z.literal("code"),
44300
44513
  /** Compiled into the automation's OWN block by esbuild — not a third
@@ -44357,11 +44570,6 @@ function convertLegacyRecipe(legacy) {
44357
44570
  ...rest
44358
44571
  };
44359
44572
  }
44360
- /**
44361
- * Where recipes are PARSED (the core-blocks cap, the MCP tool, the literal a
44362
- * saved block carries): the new shape as it is, or the old shape converted to
44363
- * it. The output type is always the new one.
44364
- */
44365
44573
  var AutomationRecipeSchema = z.union([CurrentAutomationRecipeSchema, LegacyAutomationRecipeSchema.transform(convertLegacyRecipe)]);
44366
44574
  /**
44367
44575
  * A daily window as a STATE: is this instant inside it, and when does that
@@ -45125,12 +45333,16 @@ var HoldOverrideSchema = z.discriminatedUnion("mode", [z.object({ mode: z.litera
45125
45333
  var DEFAULT_HOLD_OVERRIDE = { mode: "respect" };
45126
45334
  /** A missed edge up to this late still runs. */
45127
45335
  var DEFAULT_MAX_LATE_MS = 10 * 6e4;
45336
+ var SchedulerStepSchema = ActionStepSchema.refine((step) => step.kind !== "wait" || step.seconds <= 300, {
45337
+ message: `a scheduler point waits at most five minutes (300 s); put a longer wait in an action`,
45338
+ path: ["seconds"]
45339
+ });
45128
45340
  var SchedulerPointSchema = z.object({
45129
45341
  id: z.string().min(1).max(64),
45130
45342
  at: SchedulerTimeSpecSchema,
45131
45343
  mode: SchedulerPointModeSchema,
45132
45344
  /** The actions of an `edge` or `hold`; a `release` has none. */
45133
- steps: z.array(ActionStepSchema).max(20).default([]),
45345
+ steps: z.array(SchedulerStepSchema).max(20).default([]),
45134
45346
  /** Checked when the point runs (an edge) or is applied (a hold). */
45135
45347
  conditions: SchedulerStateTreeSchema.optional(),
45136
45348
  /** Hold only; absent means `respect`. */
@@ -45502,18 +45714,46 @@ var StepTraceBaseSchema = z.object({
45502
45714
  ]).optional(),
45503
45715
  /** Why the condition read what it read, in the evaluator's own words. */
45504
45716
  conditionReason: z.string().optional(),
45505
- /** `empty`: the target resolved to no device, so nothing was done — never silently `ok`. `skipped`: its `if` was false (or unknown) and nothing ran in its place. */
45717
+ /** `empty`: the target resolved to no device, so nothing was done — never silently `ok`. `skipped`: its `if` was false (or unknown) and nothing ran in its place. `failed-continued`: it failed and was marked to be passed over (#500). */
45506
45718
  outcome: z.enum([
45507
45719
  "ok",
45508
45720
  "error",
45509
45721
  "not-run",
45510
45722
  "empty",
45511
- "skipped"
45723
+ "skipped",
45724
+ "failed-continued",
45725
+ "timed-out"
45512
45726
  ]),
45513
45727
  message: z.string().optional()
45514
45728
  });
45729
+ /** What a block step adds to its row: which list ran, what each branch read, how many rounds. */
45730
+ var blockTraceShape = {
45731
+ /** A `choose` step (#500): the list that ran, `branches.<n>` or `else`. Absent when none did. */
45732
+ branch: z.string().optional(),
45733
+ /** A `choose` step: what each branch read, in order, up to the one that decided. */
45734
+ branchChecks: z.array(z.object({
45735
+ condition: z.enum([
45736
+ "true",
45737
+ "false",
45738
+ "unknown"
45739
+ ]),
45740
+ conditionReason: z.string().optional()
45741
+ })).optional(),
45742
+ /** A `repeat` step (#500): how many times its steps ran. */
45743
+ iterations: z.number().int().optional()
45744
+ };
45745
+ /** A step one level down: it may be a block step itself, whose own steps are plain rows (the nesting ends there). */
45746
+ var NestedStepTraceSchema = StepTraceBaseSchema.extend({
45747
+ ...blockTraceShape,
45748
+ steps: z.array(StepTraceBaseSchema).optional()
45749
+ });
45515
45750
  /** A step trace; the `else` steps that ran are one level of the same shape (the nesting is bounded at one). */
45516
- var AutomationStepTraceSchema = StepTraceBaseSchema.extend({ else: z.array(StepTraceBaseSchema).optional() });
45751
+ var AutomationStepTraceSchema = StepTraceBaseSchema.extend({
45752
+ else: z.array(StepTraceBaseSchema).optional(),
45753
+ ...blockTraceShape,
45754
+ /** A `choose` step: the steps of the list that ran. A `parallel`: its members. A `repeat`: the LAST iteration. */
45755
+ steps: z.array(NestedStepTraceSchema).optional()
45756
+ });
45517
45757
  var AutomationRunTraceSchema = z.object({
45518
45758
  runId: z.string().min(1),
45519
45759
  startedAt: z.number(),
@@ -45882,6 +46122,46 @@ async function evaluateStepCondition(when, fetchers, now = Date.now, history, si
45882
46122
  reason: first ?? "the condition does not hold"
45883
46123
  };
45884
46124
  }
46125
+ /**
46126
+ * Read the branches in order and stop at the first that decides: `true` runs
46127
+ * it, `unknown` ends the choice with nothing run (D49). All `false` runs the
46128
+ * else list, when there is one.
46129
+ */
46130
+ async function readChoose(choose) {
46131
+ const checks = [];
46132
+ for (const [index, branch] of choose.branches.entries()) {
46133
+ const verdict = await readGuard(branch.guard);
46134
+ checks.push({
46135
+ condition: verdict.result,
46136
+ conditionReason: verdict.reason
46137
+ });
46138
+ if (verdict.result === "true") return {
46139
+ checks,
46140
+ decision: {
46141
+ kind: "run",
46142
+ branch: `branches.${index}`,
46143
+ steps: branch.steps
46144
+ }
46145
+ };
46146
+ if (verdict.result === "unknown") return {
46147
+ checks,
46148
+ decision: {
46149
+ kind: "unknown",
46150
+ index,
46151
+ reason: verdict.reason
46152
+ }
46153
+ };
46154
+ }
46155
+ const otherwise = choose.otherwise ?? [];
46156
+ return {
46157
+ checks,
46158
+ decision: otherwise.length === 0 ? { kind: "none" } : {
46159
+ kind: "run",
46160
+ branch: "else",
46161
+ steps: otherwise
46162
+ }
46163
+ };
46164
+ }
45885
46165
  function errorMessage(err) {
45886
46166
  return err instanceof Error ? err.message : String(err);
45887
46167
  }
@@ -45896,17 +46176,105 @@ async function readGuard(guard) {
45896
46176
  };
45897
46177
  }
45898
46178
  }
46179
+ /** A loop condition that throws ends the loop as unreadable, never a crash of the run. */
46180
+ async function readRepeatCheck(check, iteration) {
46181
+ if (check === void 0) return { go: true };
46182
+ try {
46183
+ return await check(iteration);
46184
+ } catch (err) {
46185
+ return {
46186
+ go: false,
46187
+ reason: `the condition could not be read: ${errorMessage(err)}`,
46188
+ unknown: true
46189
+ };
46190
+ }
46191
+ }
46192
+ /** Run a loop's steps until its count, its condition, its bound, a failure, a stop or an abort ends it. */
46193
+ async function runRepeat(repeat, options, path) {
46194
+ let iterations = 0;
46195
+ let last;
46196
+ for (;;) {
46197
+ if (options.isAborted()) return {
46198
+ iterations,
46199
+ last,
46200
+ timedOut: false
46201
+ };
46202
+ const before = await readRepeatCheck(repeat.before, iterations);
46203
+ if (!before.go) return {
46204
+ iterations,
46205
+ last,
46206
+ ended: before.reason,
46207
+ timedOut: false,
46208
+ ...before.unknown === true ? { unknown: before.reason } : {}
46209
+ };
46210
+ if (iterations >= repeat.limit) return repeat.limitIsTimeout ? {
46211
+ iterations,
46212
+ last,
46213
+ ended: `stopped at ${repeat.limit} iterations`,
46214
+ timedOut: true
46215
+ } : {
46216
+ iterations,
46217
+ last,
46218
+ ended: "",
46219
+ timedOut: false
46220
+ };
46221
+ last = await runSteps(repeat.steps, {
46222
+ ...options,
46223
+ pathPrefix: `${path}.steps`,
46224
+ indexOffset: 0
46225
+ });
46226
+ iterations += 1;
46227
+ if (last.failed || last.aborted || last.stopped !== void 0) return {
46228
+ iterations,
46229
+ last,
46230
+ timedOut: false
46231
+ };
46232
+ const after = await readRepeatCheck(repeat.after, iterations - 1);
46233
+ if (!after.go) return {
46234
+ iterations,
46235
+ last,
46236
+ ended: after.reason,
46237
+ timedOut: false,
46238
+ ...after.unknown === true ? { unknown: after.reason } : {}
46239
+ };
46240
+ if (repeat.between !== void 0 && iterations < repeat.limit) await repeat.between();
46241
+ }
46242
+ }
45899
46243
  /** The else level of a trace is one level deep: a nested trace carries no `else` of its own. */
45900
46244
  function withoutElse(trace) {
45901
46245
  const { else: _else, ...rest } = trace;
45902
46246
  return rest;
45903
46247
  }
46248
+ /** A plain row: the last level of a trace carries no list of its own. */
46249
+ function plainRow(trace) {
46250
+ const { else: _else, steps: _steps, ...rest } = trace;
46251
+ return rest;
46252
+ }
46253
+ /** A row one level down: it keeps its own steps as plain rows, and no `else`. */
46254
+ function withoutNested(trace) {
46255
+ const { else: _else, steps, ...rest } = trace;
46256
+ return steps === void 0 ? rest : {
46257
+ ...rest,
46258
+ steps: steps.map(plainRow)
46259
+ };
46260
+ }
45904
46261
  async function runSteps(steps, options) {
45905
46262
  const traces = [];
45906
46263
  let failed = false;
45907
46264
  let aborted = false;
45908
- for (const [index, step] of steps.entries()) {
46265
+ let stopped;
46266
+ for (const [position, step] of steps.entries()) {
46267
+ const index = position + (options.indexOffset ?? 0);
45909
46268
  const path = `${options.pathPrefix}.${index}`;
46269
+ if (stopped !== void 0) {
46270
+ traces.push({
46271
+ ...step.meta,
46272
+ path,
46273
+ outcome: "not-run",
46274
+ message: `stopped at ${stopped.path}: ${stopped.reason}`
46275
+ });
46276
+ continue;
46277
+ }
45910
46278
  if (failed || aborted || options.isAborted()) {
45911
46279
  if (!failed) aborted = true;
45912
46280
  traces.push({
@@ -45918,6 +46286,96 @@ async function runSteps(steps, options) {
45918
46286
  continue;
45919
46287
  }
45920
46288
  const startedAt = options.now();
46289
+ if (step.parallel !== void 0) {
46290
+ const members = await Promise.all(step.parallel.map((member, at) => runSteps([member], {
46291
+ ...options,
46292
+ pathPrefix: `${path}.steps`,
46293
+ indexOffset: at
46294
+ })));
46295
+ const anyFailed = members.some((m) => m.failed);
46296
+ if (anyFailed) failed = true;
46297
+ else if (members.some((m) => m.aborted)) aborted = true;
46298
+ traces.push({
46299
+ ...step.meta,
46300
+ path,
46301
+ startedAt,
46302
+ endedAt: options.now(),
46303
+ outcome: anyFailed ? "error" : "ok",
46304
+ ...anyFailed ? { message: "a parallel step failed" } : {},
46305
+ steps: members.flatMap((m) => m.steps.map(withoutNested))
46306
+ });
46307
+ continue;
46308
+ }
46309
+ if (step.repeat !== void 0) {
46310
+ const loop = await runRepeat(step.repeat, options, path);
46311
+ const sub = loop.last;
46312
+ if (loop.unknown !== void 0) options.onGuardUnknown?.({
46313
+ index,
46314
+ path: `${path}.loop.when`,
46315
+ reason: loop.unknown,
46316
+ deviceId: step.meta.deviceId
46317
+ });
46318
+ const bodyFailed = loop.ended === void 0 && sub?.failed === true;
46319
+ if (bodyFailed) failed = true;
46320
+ else if (loop.ended === void 0 && sub?.stopped !== void 0) stopped = sub.stopped;
46321
+ else if (loop.ended === void 0) aborted = true;
46322
+ const times = `ran ${loop.iterations} times`;
46323
+ const message = bodyFailed ? `a step failed in iteration ${loop.iterations}` : loop.ended === void 0 ? times : loop.timedOut ? loop.ended : loop.ended === "" ? times : `${times}: ${loop.ended}`;
46324
+ traces.push({
46325
+ ...step.meta,
46326
+ path,
46327
+ startedAt,
46328
+ endedAt: options.now(),
46329
+ outcome: bodyFailed ? "error" : loop.timedOut ? "timed-out" : "ok",
46330
+ message,
46331
+ iterations: loop.iterations,
46332
+ ...sub === void 0 ? {} : { steps: sub.steps.map(withoutNested) }
46333
+ });
46334
+ continue;
46335
+ }
46336
+ if (step.choose !== void 0) {
46337
+ const reading = await readChoose(step.choose);
46338
+ const base = {
46339
+ ...step.meta,
46340
+ path,
46341
+ startedAt,
46342
+ branchChecks: [...reading.checks]
46343
+ };
46344
+ const { decision } = reading;
46345
+ if (decision.kind !== "run") {
46346
+ if (decision.kind === "unknown") options.onGuardUnknown?.({
46347
+ index,
46348
+ path: `${path}.branches.${decision.index}.if`,
46349
+ reason: decision.reason,
46350
+ deviceId: step.meta.deviceId
46351
+ });
46352
+ traces.push({
46353
+ ...base,
46354
+ endedAt: options.now(),
46355
+ outcome: "skipped",
46356
+ message: decision.kind === "unknown" ? `not run: branch ${decision.index + 1} could not be read (${decision.reason})` : "not run: no branch is true"
46357
+ });
46358
+ continue;
46359
+ }
46360
+ const listPath = decision.branch === "else" ? `${path}.else` : `${path}.${decision.branch}.steps`;
46361
+ const sub = await runSteps(decision.steps, {
46362
+ ...options,
46363
+ pathPrefix: listPath,
46364
+ indexOffset: 0
46365
+ });
46366
+ if (sub.failed) failed = true;
46367
+ else if (sub.aborted) aborted = true;
46368
+ if (sub.stopped !== void 0) stopped = sub.stopped;
46369
+ traces.push({
46370
+ ...base,
46371
+ endedAt: options.now(),
46372
+ outcome: sub.failed ? "error" : "ok",
46373
+ ...sub.failed ? { message: "a step of the branch failed" } : {},
46374
+ branch: decision.branch,
46375
+ steps: sub.steps.map(withoutNested)
46376
+ });
46377
+ continue;
46378
+ }
45921
46379
  let guardTrace = {};
45922
46380
  if (step.guard !== void 0) {
45923
46381
  const verdict = await readGuard(step.guard);
@@ -45947,10 +46405,12 @@ async function runSteps(steps, options) {
45947
46405
  }
45948
46406
  const sub = await runSteps(branch, {
45949
46407
  ...options,
45950
- pathPrefix: `${path}.else`
46408
+ pathPrefix: `${path}.else`,
46409
+ indexOffset: 0
45951
46410
  });
45952
46411
  if (sub.failed) failed = true;
45953
46412
  else if (sub.aborted) aborted = true;
46413
+ if (sub.stopped !== void 0) stopped = sub.stopped;
45954
46414
  traces.push({
45955
46415
  ...step.meta,
45956
46416
  ...guardTrace,
@@ -45968,6 +46428,7 @@ async function runSteps(steps, options) {
45968
46428
  let sent;
45969
46429
  const perDevice = [];
45970
46430
  let emptyReason;
46431
+ let timedOutReason;
45971
46432
  let templateNotes = [];
45972
46433
  const scope = {
45973
46434
  setDeviceId: (id) => {
@@ -45984,6 +46445,16 @@ async function runSteps(steps, options) {
45984
46445
  },
45985
46446
  setTemplateNotes: (notes) => {
45986
46447
  templateNotes = notes.slice(0, 20);
46448
+ },
46449
+ stop: (reason, outcome) => {
46450
+ stopped = {
46451
+ reason,
46452
+ outcome,
46453
+ path
46454
+ };
46455
+ },
46456
+ markTimedOut: (reason) => {
46457
+ timedOutReason = reason;
45987
46458
  }
45988
46459
  };
45989
46460
  const templatesTrace = () => templateNotes.length === 0 ? {} : { templates: [...templateNotes] };
@@ -45991,6 +46462,29 @@ async function runSteps(steps, options) {
45991
46462
  const devicesTrace = () => perDevice.length === 0 ? {} : { devices: perDevice.slice(0, 200) };
45992
46463
  try {
45993
46464
  await step.run(scope);
46465
+ const stop = (() => stopped)();
46466
+ if (stop !== void 0) {
46467
+ const message = `stopped: ${stop.reason}`;
46468
+ if (stop.outcome === "failed") {
46469
+ failed = true;
46470
+ options.onFailure({
46471
+ index,
46472
+ path,
46473
+ message,
46474
+ deviceId
46475
+ });
46476
+ }
46477
+ traces.push({
46478
+ ...step.meta,
46479
+ ...guardTrace,
46480
+ path,
46481
+ startedAt,
46482
+ endedAt: options.now(),
46483
+ outcome: stop.outcome === "failed" ? "error" : "ok",
46484
+ message
46485
+ });
46486
+ continue;
46487
+ }
45994
46488
  traces.push({
45995
46489
  ...step.meta,
45996
46490
  ...deviceId === void 0 || perDevice.length > 1 ? {} : { deviceId },
@@ -46001,18 +46495,27 @@ async function runSteps(steps, options) {
46001
46495
  path,
46002
46496
  startedAt,
46003
46497
  endedAt: options.now(),
46004
- outcome: emptyReason === void 0 ? "ok" : "empty",
46005
- ...emptyReason === void 0 ? {} : { message: emptyReason }
46498
+ outcome: timedOutReason !== void 0 ? "timed-out" : emptyReason === void 0 ? "ok" : "empty",
46499
+ ...timedOutReason !== void 0 ? { message: timedOutReason } : emptyReason === void 0 ? {} : { message: emptyReason }
46006
46500
  });
46007
46501
  } catch (err) {
46008
- failed = true;
46009
46502
  const message = errorMessage(err);
46010
- options.onFailure({
46503
+ const continued = step.continueOnError === true;
46504
+ if (continued) options.onContinuedFailure?.({
46011
46505
  index,
46012
46506
  path,
46013
46507
  message,
46014
46508
  deviceId
46015
46509
  });
46510
+ else {
46511
+ failed = true;
46512
+ options.onFailure({
46513
+ index,
46514
+ path,
46515
+ message,
46516
+ deviceId
46517
+ });
46518
+ }
46016
46519
  traces.push({
46017
46520
  ...step.meta,
46018
46521
  ...deviceId === void 0 || perDevice.length > 1 ? {} : { deviceId },
@@ -46023,7 +46526,7 @@ async function runSteps(steps, options) {
46023
46526
  path,
46024
46527
  startedAt,
46025
46528
  endedAt: options.now(),
46026
- outcome: "error",
46529
+ outcome: continued ? "failed-continued" : "error",
46027
46530
  message
46028
46531
  });
46029
46532
  }
@@ -46031,7 +46534,8 @@ async function runSteps(steps, options) {
46031
46534
  return {
46032
46535
  steps: traces,
46033
46536
  failed,
46034
- aborted: aborted && !failed
46537
+ aborted: aborted && !failed,
46538
+ ...stopped === void 0 ? {} : { stopped }
46035
46539
  };
46036
46540
  }
46037
46541
  function isVarRef(value) {
@@ -46803,7 +47307,9 @@ var AddonHttpRouteSchema = z.object({
46803
47307
  ]).optional(),
46804
47308
  description: z.string().optional(),
46805
47309
  /** The hub limits this route per client address before the handler runs. */
46806
- rateLimit: z.enum(["auth"]).optional()
47310
+ rateLimit: z.enum(["auth"]).optional(),
47311
+ /** Served once per integration instance; the handler reads `instanceId`. */
47312
+ perInstance: z.boolean().optional()
46807
47313
  });
46808
47314
  /**
46809
47315
  * Cross-process route invocation envelope. The hub captures the
@@ -46820,6 +47326,8 @@ var InvokeRequestSchema = z.object({
46820
47326
  query: z.record(z.string(), z.string()),
46821
47327
  body: z.unknown(),
46822
47328
  headers: z.record(z.string(), z.string()),
47329
+ /** The instance the hub resolved for a `perInstance` route. */
47330
+ instanceId: z.string().optional(),
46823
47331
  user: z.object({
46824
47332
  id: z.string(),
46825
47333
  username: z.string(),
@@ -63785,25 +64293,71 @@ var enumSensorCapability = {
63785
64293
  * whether persisting is worth a SQLite commit. */
63786
64294
  volatileStateFields: ["lastFetchedAt", "timestamp"]
63787
64295
  };
64296
+ var EventVocabularyKindSchema = z.enum([
64297
+ "press",
64298
+ "long-press",
64299
+ "long-press-start",
64300
+ "release",
64301
+ "repeat",
64302
+ "double-press",
64303
+ "other"
64304
+ ]);
64305
+ /** The part of the device an event comes from: a button, a channel. */
64306
+ var EventVocabularySourceSchema = z.object({
64307
+ id: z.string().min(1),
64308
+ label: z.string().min(1)
64309
+ });
64310
+ /** One scalar field of an event's `data`, by dotted path. */
64311
+ var EventVocabularyFieldSchema = z.object({
64312
+ path: z.string().min(1),
64313
+ kind: z.enum([
64314
+ "string",
64315
+ "number",
64316
+ "boolean",
64317
+ "enum"
64318
+ ]),
64319
+ enumValues: z.array(z.string()).optional(),
64320
+ label: z.string().min(1).optional()
64321
+ });
64322
+ var EventVocabularyEntrySchema = z.object({
64323
+ /** The native token, verbatim. */
64324
+ id: z.string().min(1),
64325
+ source: EventVocabularySourceSchema.optional(),
64326
+ label: z.string().min(1),
64327
+ description: z.string().optional(),
64328
+ kind: EventVocabularyKindSchema.optional(),
64329
+ payload: z.array(EventVocabularyFieldSchema).optional()
64330
+ });
63788
64331
  /**
63789
64332
  * Generic stateless event emitter. Installed on a `DeviceType.EventEmitter`
63790
64333
  * device. Carries the device's EXACT declared event vocabulary verbatim
63791
64334
  * (NO normalization). Two shapes:
63792
- * - structured source (HA `event.*` entity) → `eventTypes` is the fixed
63793
- * declared vocabulary (e.g. ['press_short','press_long',...]).
63794
- * - generic/legacy source (HA bus events, e.g. zha_event) → `eventTypes`
64335
+ * - structured source (HA `event.*` entity) → `vocabulary` is the fixed
64336
+ * declared set (e.g. press_short, press_long, …).
64337
+ * - generic/legacy source (HA bus events, e.g. zha_event) → `vocabulary`
63795
64338
  * is [] (open) and `lastEvent.data` carries the complex payload.
64339
+ * `vocabulary` (D1044) names each event for a person and types it for a
64340
+ * rule; `eventTypes` is its list of native tokens, kept for older readers.
64341
+ * A fire names the part of the device it came from in `sourceId` when the
64342
+ * vocabulary declares sources (a remote's buttons).
63796
64343
  * `seq` is monotonic so two identical events still produce distinct slice writes.
63797
64344
  */
63798
64345
  var EventFireSchema = z.object({
63799
64346
  deviceId: z.number(),
63800
64347
  eventType: z.string(),
64348
+ sourceId: z.string().optional(),
63801
64349
  data: z.record(z.string(), z.unknown()).nullable(),
63802
64350
  timestamp: z.number().meta(readingMeta("none")),
63803
64351
  seq: z.number().meta(readingMeta("count"))
63804
64352
  });
63805
64353
  var EventEmitterStatusSchema = z.object({
63806
64354
  eventTypes: z.array(z.string()),
64355
+ /**
64356
+ * Required of a provider by the type. A status written before the field
64357
+ * existed still parses, as an empty vocabulary: read it through
64358
+ * `readEventVocabulary`, which then answers with the plain tokens.
64359
+ */
64360
+ vocabulary: z.array(EventVocabularyEntrySchema).default([]),
63807
64361
  lastEvent: EventFireSchema.nullable(),
63808
64362
  eventCountSinceStart: z.number().meta(readingMeta("count"))
63809
64363
  });
@@ -82632,7 +83186,18 @@ var OauthIntegrationDescriptorSchema = z.object({
82632
83186
  * The value is baked into the authorization code at `/authorize` and travels
82633
83187
  * on the tokens, so editing this field changes FUTURE links only.
82634
83188
  */
82635
- refreshTokenTtlSec: z.union([z.number().int().positive(), z.literal("never")]).optional()
83189
+ refreshTokenTtlSec: z.union([z.number().int().positive(), z.literal("never")]).optional(),
83190
+ /**
83191
+ * The integration instances an account can be linked to (planning#415),
83192
+ * beside the default one. `/api/oauth2/authorize?instance=<id>` is accepted
83193
+ * only for an id listed here; with no `instance=` the link is made to the
83194
+ * default instance, which is never listed and always accepted — it is the
83195
+ * address third parties already hold. Omit for a single-instance integration.
83196
+ */
83197
+ instances: z.array(z.object({
83198
+ id: z.string(),
83199
+ displayName: z.string()
83200
+ })).optional()
82636
83201
  });
82637
83202
  var oauthIntegrationCapability = {
82638
83203
  name: "oauth-integration",
@@ -91358,6 +91923,13 @@ var SsoBridgeClaimsSchema = z.object({
91358
91923
  /** OAuth authorization-code binding — set only on `oauth-code` tokens. */
91359
91924
  redirectUri: z.string().optional(),
91360
91925
  integrationId: z.string().optional(),
91926
+ /**
91927
+ * The integration INSTANCE an OAuth link was made for (planning#415). Set on
91928
+ * `oauth-code`, `oauth-access` and `oauth-refresh` tokens of a link made
91929
+ * with `instance=`; absent on a link to the default instance. A cloud relay
91930
+ * reads it off the access token to route; the hub answers from the session.
91931
+ */
91932
+ instanceId: z.string().optional(),
91361
91933
  /** JWT ID — unique per issued code; consumed-set enforces single-use. */
91362
91934
  jti: z.string().optional(),
91363
91935
  /** PKCE S256 challenge — set only on `oauth-code` tokens issued to a public
@@ -94329,6 +94901,8 @@ var OauthSessionSummarySchema = z.object({
94329
94901
  userId: z.string(),
94330
94902
  username: z.string(),
94331
94903
  integrationId: z.string(),
94904
+ /** The instance the link was made for; `null` = the default instance. */
94905
+ instanceId: z.string().nullable().optional(),
94332
94906
  scopes: z.array(TokenScopeSchema),
94333
94907
  createdAt: z.number(),
94334
94908
  lastUsedAt: z.number(),
@@ -94457,6 +95031,9 @@ var userManagementCapability = {
94457
95031
  }),
94458
95032
  oauthIssueCode: method(z.object({
94459
95033
  integrationId: z.string(),
95034
+ /** The integration instance the link is for. Omit for the default
95035
+ * instance — never pass the addon id to mean it. */
95036
+ instanceId: z.string().optional(),
94460
95037
  userId: z.string(),
94461
95038
  username: z.string(),
94462
95039
  scopes: z.array(TokenScopeSchema),
@@ -94498,7 +95075,13 @@ var userManagementCapability = {
94498
95075
  oauthVerifyAccessToken: method(z.object({ token: z.string() }), z.object({
94499
95076
  userId: z.string(),
94500
95077
  username: z.string(),
94501
- scopes: z.array(TokenScopeSchema)
95078
+ scopes: z.array(TokenScopeSchema),
95079
+ /** The instance the link was made for, read from the SESSION.
95080
+ * Absent = the default instance. `oauthLinkServesInstance` is the
95081
+ * helper a per-instance route calls to compare it with the instance
95082
+ * of its path; no route declares `perInstance` yet (the Alexa
95083
+ * per-instance route, T3, is the first consumer). */
95084
+ instanceId: z.string().optional()
94502
95085
  }).nullable(), { access: "view" }),
94503
95086
  listExternalIdentities: method(z.object({ userId: z.string() }), z.array(ExternalIdentitySchema), { auth: "admin" }),
94504
95087
  /** The user an identity is linked to, or `null`. */
@@ -120155,4 +120738,4 @@ z.object({
120155
120738
  commands: z.record(z.string(), z.unknown())
120156
120739
  });
120157
120740
  //#endregion
120158
- export { DeclaredDevices as $, settingsStoreCapability as $a, readinessKey as $c, objectInputDeclaresRequiredDeviceId as $i, compareVersions as $n, compositionFeatureEnabled as $o, generateDeviceAlias as $r, TransactRefusedError as $s, STORAGE_ACCESS_FALLBACK as $t, ConsumableItemSchema as A, resolveAppConnections as Aa, historyUnitFor as Ac, lockDoorLinkOfComposition as Ai, bareAddonId as An, validateCustomAddress as Ao, deviceStatusCapability as Ar, ForeignSecretMarkerError as As, MINUTES_PER_DAY as At, DEVICE_ENROLLMENT_TTL_MS as B, resolveRemoteSource as Ba, isSecretFieldView as Bc, metricsProviderCapability as Bi, cameraGridLayoutCapability as Bn, COMPOSER_ADDON_ID as Bo, expressionContainsBuiltinCall as Br, REDACTED_SECRET as Bs, PetFountainStatusSchema as Bt, COMPOSER_RUNNER_ID as C, recordsCapability as Ca, emitDownForOwnedCaps as Cc, legacyAutoLinkIds as Ci, alertEpisodeId as Cn, timedRunMaxIn as Co, deviceCredentialsCapability as Cr, CALLER_STAMPED_CAPABILITIES as Cs, INTERNAL_ACTION_PREFIX as Ct, CalendarPreferencesSchema as D, remoteSourceSteps as Da, formatSecretScope as Dc, localNetworkCapability as Di, armRemovalReconcile as Dn, unmetRequirements as Do, deviceRemovalHookCapability as Dr, DeclarationRefusedError as Ds, LOG_LEVEL_RANK as Dt, CREDENTIAL_TOKEN_AUDIENCE as E, remoteLayoutComponentsCapability as Ea, expandCapMethods as Ec, localDateOf as Ei, appendTrace as En, toTimings as Eo, deviceManagerCapability as Er, DEVICE_STATUS_METHOD as Es, KeychainResetRecordSchema as Et, DATABASE_SNAPSHOT_TIMEOUT_MS as F, resolveHubAddressRoles as Fa, isEvent as Fc, mayWriteToLocation as Fi, buildDeviceEnrollmentLink as Fn, vectorStoreCapability as Fo, evaluateCompositionField as Fr, RECORD_BATCH_MAX as Fs, NetworkTunnelStartedDataSchema as Ft, DEVICE_SAN_USER_PREFIX as G, runSteps as Ga, mapSecretLeaves as Gc, nextOccurrence as Gi, catalogueIssues as Gn, HISTORY_SLOW_MS as Go, fanPresetsCapability as Gr, RecordIntegrationInstances as Gs, QuantityUnitError as Gt, DEVICE_ID_FIELD as H, resolveStepArgs as Ha, isSecretMarkerLike as Hc, modeForSwitch as Hi, canonicalStoredDeviceType as Hn, DAY_MS as Ho, fanAxisPath as Hr, RUNTIME_DEFAULTS as Hs, PreferenceDeviceIdSchema as Ht, DATA_STORE_DATABASES as I, resolveLocationMode as Ia, isInstanceEnabled as Ic, mediaPlayerCapability as Ii, buildDeviceSignatureMessage as In, weekdayOfLocalDate as Io, evaluateStepCondition as Ir, RECORD_BATCH_MAX_BYTES as Is, PET_FOUNTAIN_WATER_KEY as It, DEVICE_TEMPLATE_MAX_OUTPUT as J, schedulersCapability as Ja, normalizeNodeId as Jc, normalizeCapStep as Ji, checkTemplatePayload as Jn, MINUTE_MS as Jo, findChannelSource as Jr, RecordTooLargeError as Js, ROOT_BUCKET_KEY as Jt, DEVICE_TEMPLATE_FILTERS as K, runtimeFieldUnit as Ka, nodeIdOfScopedKey as Kc, nextTimeBoundaryInMs as Ki, checkDeviceAlias as Kn, HOUR_MS as Ko, featureForwards as Kr, RecordKindDeclarationSchema as Ks, RECORDING_SOURCE_CAMSTACK_ADDON as Kt, DAY_NAMES as L, resolveMethodAuth as La, isKeychainStoredField as Lc, mediaPlayerFeaturesOfRoles as Li, buildHeroModel as Ln, withDefaultRunning as Lo, evaluateWhenTree as Lr, RECORD_DELETE_BATCH as Ls, PREFERENCES_MAX_VALUE_BYTES as Lt, CredentialTokenClaimsSchema as M, resolveCoreBlockEntry as Ma, isCommand as Mc, logLevelAtMost as Mi, brightnessCapability as Mn, valveCapability as Mo, enumerateInferenceDevices as Mr, InvalidRecordError as Ms, MediaPlayerStatusSchema as Mt, DATABASE_SNAPSHOT_PARTIAL_SUFFIX as N, resolveCoreBlockFiles as Na, isDebugChannelName as Nc, looseSchema as Ni, buildActionSteps as Nn, vectorDimFromBase64 as No, enumerateItemArrayFields as Nr, NoCallerError as Ns, MigrationLedgerEntrySchema as Nt, CatalogFileSchema as O, replacedFieldKeys as Oa, getDebugInterest as Oc, locationIconKey as Oi, authProviderCapability as On, userManagementCapability as Oo, deviceRunsCapability as Or, DeviceTransitionSchema as Os, METHOD_ACCESS_MAP as Ot, DATABASE_SNAPSHOT_SUFFIX as P, resolveHeroLayout as Pa, isDeviceConfigCap as Pc, mayReadLocation as Pi, buildCapabilityLookup as Pn, vectorIndexDimConflictError as Po, enumerateSchemaFields as Pr, PlaintextSecretError as Ps, MigrationMetaSchema as Pt, DataStoreDatabaseSchema as Q, seedInstanceOnce as Qa, parseSecretRef as Qc, objectInputDeclaresAddonId as Qi, colorCapability as Qn, composedDeviceStableId as Qo, gbToBytes as Qr, StoredRecordKindDeclarationSchema as Qs, RunningStateStatusSchema as Qt, DEFAULT_HOLD_OVERRIDE as R, resolveMutate as Ra, isReadingQuantity as Rc, memoizePinnedFfmpeg as Ri, buildStreamParamsConfigSchema as Rn, withLocationMode as Ro, evictionPolicyOfLocation as Rr, RECORD_SECRET_COLLECTION_PREFIX as Rs, PROPOSAL_MIN_SPAN_MS as Rt, COMPOSED_ITEM_FIXED_FIELDS as S, recordEntriesCapability as Sa, defineRecordKinds as Sc, keychainCapability as Si, addonWidgetsCapability as Sn, timedRunLimitOf as So, describeUnmet as Sr, BatchTooLargeError as Ss, IDLE_ACTION_STATUS as St, CORE_BLOCK_ADDON_PREFIX as T, remoteCapability as Ta, entryBody as Tc, lifecycleJobSchema as Ti, alertsCapability as Tn, timedRunSeconds as To, deviceHistoryCapability as Tr, DEVICE_SETTINGS_CONTRIBUTION_METHODS as Ts, KeychainAuditEntrySchema as Tt, DEVICE_NONCE_TTL_MS as U, resolveTemplateRef as Ua, isSecretRefOwnedBy as Uc, modeMayWrite as Ui, capAppliesToDeviceKind as Un, DEFAULT_HISTORY_RETENTION as Uo, fanControlCapability as Ur, ReadinessRegistry as Us, PreferenceNamespaceSchema as Ut, DEVICE_HISTORY_ENERGY_KEY as V, resolveRunnerId as Va, isSecretMarker as Vc, migrationsCapability as Vi, canonicalIconKey as Vn, CompositionSchema as Vo, extractNestedAddonId as Vr, REMOVE_LEAF as Vs, PowerSourceInfoSchema as Vt, DEVICE_SAN_CREDENTIAL_PREFIX as W, runFanOut as Wa, makeSecretMarker as Wc, motionCapability as Wi, capUnitResolver as Wn, HISTORY_FAST_MS as Wo, fanOutTargets as Wr, ReadinessTimeoutError as Ws, PreferenceValueSchema as Wt, DEVICE_TEMPLATE_VALUES_CAP as X, scopesAllowDeviceCap as Xa, parseJsonObject as Xc, normalizeStepTargets as Xi, collectDeviceTemplates as Xn, cloneStatefulExpressionMemory as Xo, formatDeviceRevoker as Xr, RevConflictError as Xs, RemoteAssumedStateSchema as Xt, DEVICE_TEMPLATE_THIS_ALIAS as Y, scopesAllowAddon as Ya, normalizeSecretOwner as Yc, normalizeCoreBlockWrite as Yi, climateControlCapability as Yn, buildFfmpegArgs as Yo, foldSnapshotByFunction as Yr, RecordUniqueViolationError as Ys, RecordingStatusSchema as Yt, DEVICE_TOMBSTONE_RETENTION_MS as Z, scoreRuntimes as Za, parseJsonUnknown as Zc, normalizeUnit as Zi, collectWhenMirrorSources as Zn, composedDeviceRef as Zo, formatMinutes as Zr, SECRET_CLEAR as Zs, RemoteLayoutPayloadSchema as Zt, BatteryStatusSchema as _, projectDeviceRow as _a, createEvent as _c, isObjectInput as _i, DeviceRole as _l, actionWaitTotalMs as _n, supportedRuntimes as _o, declaredSeriesKind as _r, planStatisticTier as _s, HISTORY_CATALOG as _t, AGENT_MDNS_SERVICE_TYPE as a, petFountainCapability as aa, asNumber as ac, internalActionId as ai, secretTreeFromPaths as al, ServerNameSchema as an, siteFor as ao, consumablesCapability as ar, evaluateDerivative as as, EMPTY_REMOTE_ASSUMED_STATE as at, CAP_NAMES_WITH_STATUS as b, readStoredRemoteConfig as ba, defineCustomActions as bc, kebabToCamel as bi, featuresOfBoundCaps as bl, addonPagesCapability as bn, templateCapability as bo, deriveBatteryPresence as br, wattMillisecondsToKwh as bs, HUB_MDNS_TXT_KEYS as bt, ActionError as c, planComposition as ca, assertValidDeclaration as cc, isAlertEpisodeSeverity as ci, sleep as cl, StorageCleanupJobSchema as cn, splitTranslationRef as co, coreBlockIdFromAddonId as cr, historyRetentionFromSettings as cs, FAN_OSCILLATION_AXES as ct, ActionTargetResolver as d, powerSourceCapability as da, collectSecretConfigKeys as dc, isCollectionArrayMethod as di, transformSecretWrite as dl, StorageMigrationJobSchema as dn, storageCapability as do, coverCapability as dr, isForwardInputRef as ds, FanControlStatusSchema as dt, occurrenceOn as ea, UnindexedFilterError as ec, groupCommandsCapability as ei, recordSecretRef as el, STORAGE_LOCATION_MODES as en, settleDeviceFeatures as eo, compileScalarOverride as er, compositionItemFieldPath as es, DeviceRunSchema as et, ActionVariableSchema as f, powerSourceLinkOfComposition as fa, collectSecretLeaves as fc, isCredentialTokenPayload as fi, userError as fl, TemplateKindSchema as fn, storageMigrationCapability as fo, createDeviceExtensionProvider as fr, isHistoryHelper as fs, FanDirectionSchema as ft, BaseDevice as g, processTimeZoneOr as ga, commandOrigin as gc, isLocationEnabled as gi, DeviceFeature as gl, actionSourceCapability as gn, streamQualityLabel as go, declarationOwnerNodeId as gr, planResetTier as gs, GroupCommandResultSchema as gt, BUILTIN_REMOTE_COMPONENTS as h, procedureAuthKey as ha, commandEffect as hc, isKernelDerivedFeature as hi, COMPOSED_DEVICE_STABLE_ID_PREFIX as hl, UserRecordSchema as hn, streamCatalogCapability as ho, databaseSnapshotCapability as hr, openStatistic as hs, FieldClaimSchema as ht, ACTUATOR_TEMPLATE_IDS as i, parseStreamParamsFormPatch as ia, asJsonObject as ic, integrationInstancesCapability as ii, scopeKey as il, ScopedTokenSchema as in, shortHostname as io, compositionUnionReads as ir, disarmRoseMemory as is, EMPTY_AUTOMATION_STATE as it, CoreBlockSchema as j, resolveBucketMs as ja, hydrateSchema as jc, logDestinationCapability as ji, batteryCapability as jn, validateSchedulerInput as jo, deviceTransitionsCapability as jr, HISTORY_DEFAULT_MIN_INTERVAL_MS as js, MOTION_CLOSE_AFTER_MS as jt, ConditionMirror as k, resolveActionVariables as ka, historyItemFieldPath as kc, lockControlCapability as ki, backupCapability as kn, validateComposition as ko, deviceStateCapability as kr, FilterRequiredError as ks, MIGRATION_API_V1_METHODS as kt, ActionMinDelaySecSchema as l, platformProbeCapability as la, auditedFields as lc, isAppLinkBase as li, toNodeId as ll, StorageLocationModeSchema as ln, stableIdMapOf as lo, coreBlockSourceKind as lr, implementedMethodsOf as ls, FAN_OSCILLATION_AXIS_SETTABLE as lt, AutomationStateDocSchema as m, problemsBlockSave as ma, collectZodSecretPaths as mc, isInternalActionId as mi, withoutCallerStamp as ml, UNATTRIBUTED_BUCKET_KEY as mn, storageProviderCapability as mo, dataStoreProviderCapability as mr, openReset as ms, FieldClaimModeSchema as mt, ACTION_TARGET_INVALIDATION_EVENTS as n, parseAcceleratorFactsJson as na, WELL_KNOWN_TAB_MAP as nc, hasTimeLeaves as ni, resolveSecretMarkers as nl, SchedulerError as nn, sharedActuatorMethods as no, compositionFieldKey as nr, compositionSourceKey as ns, DeviceTombstoneSchema as nt, AGENT_MDNS_TXT_KEYS as o, petFountainWaterItem as oa, asString$1 as oc, interpolate as oi, secretTreeFromSchema as ol, SetOscillationAxisInputSchema as on, siteZoneKey as oo, coreBlockAddonId as or, evaluateStatistic as os, EMPTY_REMOTE_CONFIG as ot, AlertSchema as p, preconditionOf as pa, collectSecretMarkerRefs as pc, isDefaultAppConnectionEndpoint as pi, vocabActionIdFor as pl, TokenScopeSchema as pn, storageOccupancyCapability as po, customKeyOfRole as pr, nextLocalMidnight as ps, FanPresetSchema as pt, DEVICE_TEMPLATE_MAX_LENGTH as q, runtimeStatePolicyFor as qa, nodePin as qc, normalizeActionUnits as qi, checkRoleAddress as qn, HelperMemberSchema as qo, filesystemBrowseCapability as qr, RecordNotFoundError as qs, REMOTE_MEDIA_COMMANDS as qt, ACTUATOR_METHODS as r, parseColorInput as ra, actionEffect as rc, heroLayoutCapability as ri, ruleFireOfClaim as rl, SchedulerSchema as rn, sharedColorModes as ro, compositionSourceRefs as rr, createStatefulExpressionMemory as rs, DiscoveryProposalBodySchema as rt, ALL_CAPABILITY_DEFINITIONS as s, pickAppLinkHub as sa, assertTransactScope as sc, isAlertEpisodeOpen as si, secretViewsOf as sl, SsoBridgeClaimsSchema as sn, snapshotCapability as so, coreBlockComposition as sr, helperMembers as ss, FAN_CAPTURE_FIELDS as st, ACTION_RUN_MAX_MS as t, orderMigrations as ta, UnknownRecordKindError as tc, groupTemplate as ti, resolveCapMount as tl, STREAM_PROFILE_META as tn, sharedActuatorFeatures as to, composerCapability as tr, compositionSliceKey as ts, DeviceStatusSchema as tt, ActionStepSchema as u, powerSourceActuatorConflicts as ua, buildSecretRef as uc, isArrayOutputSchema as ui, toSecretFieldView as ul, StorageLocationTypeSchema as un, storageAdminCapability as uo, coreBlocksCapability as ur, integrateReading as us, FIRST_LEVEL_MACRO_CLASSES as ut, CAMERA_SWITCH_ORDER as v, proposeRunningThreshold as va, customAction as vc, isSameAddonId as vi, DeviceType as vl, actionsCapability as vn, switchCapability as vo, decodeVectorBase64 as vr, statisticCadenceMs as vs, HISTORY_ITEM_CATALOG as vt, CORE_BLOCKS_ADDON_ID as w, reducePoints as wa, emitReadiness as wc, legacyModeOf as wi, alertEpisodePayload as wn, timedRunQuickRun as wo, deviceExtensionCapability as wr, DATAPLANE_SECRET_HEADER as ws, KEYCHAIN_RESET_TRIGGER_ACTOR as wt, CATALOG_LANGS as x, reconcileReportedFeatures as xa, defineEntryKind as xc, keychainAdminCapability as xi, EventCategory as xl, addonSettingsCapability as xn, timedRunCapability as xo, describeComposableCaps as xr, BaseAddon as xs, HvacModeSchema as xt, CAMSTACK_APP_LINK_ORIGIN as y, ptzAutotrackCapability as ya, defineAddonMigrations as yc, isVoidInput as yi, errMsg as yl, addonIdOfActionId as yn, switchStateOfMode as yo, defineExtensionSlotProvider as yr, toExpressionValue as ys, HUB_MDNS_SERVICE_TYPE as yt, DERIVED_CAMERA_SILENCED_CAP_NAMES as z, resolveNotificationTapAddress as za, isSecretClear as zc, methodRefusal as zi, calendarsCapability as zn, zoneOnlySite as zo, expandContainer as zr, RECORD_SWEEP_INTERVAL_MS as zs, PackageRequiresSchema as zt };
120741
+ export { DeclaredDevices as $, seedInstanceOnce as $a, parseSecretRef as $c, objectInputDeclaresAddonId as $i, compareVersions as $n, composedDeviceStableId as $o, generateDeviceAlias as $r, StoredRecordKindDeclarationSchema as $s, STORAGE_ACCESS_FALLBACK as $t, ConsumableItemSchema as A, resolveActionVariables as Aa, historyItemFieldPath as Ac, lockControlCapability as Ai, bareAddonId as An, validateComposition as Ao, deviceStatusCapability as Ar, FilterRequiredError as As, MINUTES_PER_DAY as At, DEVICE_ENROLLMENT_TTL_MS as B, resolveNotificationTapAddress as Ba, isSecretClear as Bc, methodRefusal as Bi, cameraGridLayoutCapability as Bn, zoneOnlySite as Bo, expressionContainsBuiltinCall as Br, RECORD_SWEEP_INTERVAL_MS as Bs, PetFountainStatusSchema as Bt, COMPOSER_RUNNER_ID as C, recordEntriesCapability as Ca, defineRecordKinds as Cc, keychainCapability as Ci, alertEpisodeId as Cn, timedRunLimitOf as Co, deviceCredentialsCapability as Cr, BatchTooLargeError as Cs, INTERNAL_ACTION_PREFIX as Ct, CalendarPreferencesSchema as D, remoteLayoutComponentsCapability as Da, expandCapMethods as Dc, localDateOf as Di, armRemovalReconcile as Dn, toTimings as Do, deviceRemovalHookCapability as Dr, DEVICE_STATUS_METHOD as Ds, LOG_LEVEL_RANK as Dt, CREDENTIAL_TOKEN_AUDIENCE as E, remoteCapability as Ea, entryBody as Ec, lifecycleJobSchema as Ei, appendTrace as En, timedRunSeconds as Eo, deviceManagerCapability as Er, DEVICE_SETTINGS_CONTRIBUTION_METHODS as Es, KeychainResetRecordSchema as Et, DATABASE_SNAPSHOT_TIMEOUT_MS as F, resolveHeroLayout as Fa, isDeviceConfigCap as Fc, mayReadLocation as Fi, buildDeviceEnrollmentLink as Fn, vectorIndexDimConflictError as Fo, evaluateCompositionField as Fr, PlaintextSecretError as Fs, NetworkTunnelStartedDataSchema as Ft, DEVICE_SAN_USER_PREFIX as G, runFanOut as Ga, makeSecretMarker as Gc, motionCapability as Gi, catalogueIssues as Gn, HISTORY_FAST_MS as Go, fanPresetsCapability as Gr, ReadinessTimeoutError as Gs, QuantityUnitError as Gt, DEVICE_ID_FIELD as H, resolveRunnerId as Ha, isSecretMarker as Hc, migrationsCapability as Hi, canonicalStoredDeviceType as Hn, CompositionSchema as Ho, fanAxisPath as Hr, REMOVE_LEAF as Hs, PreferenceDeviceIdSchema as Ht, DATA_STORE_DATABASES as I, resolveHubAddressRoles as Ia, isEvent as Ic, mayWriteToLocation as Ii, buildDeviceSignatureMessage as In, vectorStoreCapability as Io, evaluateStepCondition as Ir, RECORD_BATCH_MAX as Is, PET_FOUNTAIN_WATER_KEY as It, DEVICE_TEMPLATE_MAX_OUTPUT as J, runtimeStatePolicyFor as Ja, nodePin as Jc, normalizeActionUnits as Ji, checkTemplatePayload as Jn, HelperMemberSchema as Jo, findChannelSource as Jr, RecordNotFoundError as Js, ROOT_BUCKET_KEY as Jt, DEVICE_TEMPLATE_FILTERS as K, runSteps as Ka, mapSecretLeaves as Kc, nextOccurrence as Ki, checkDeviceAlias as Kn, HISTORY_SLOW_MS as Ko, featureForwards as Kr, RecordIntegrationInstances as Ks, RECORDING_SOURCE_CAMSTACK_ADDON as Kt, DAY_NAMES as L, resolveLocationMode as La, isInstanceEnabled as Lc, mediaPlayerCapability as Li, buildHeroModel as Ln, weekdayOfLocalDate as Lo, evaluateWhenTree as Lr, RECORD_BATCH_MAX_BYTES as Ls, PREFERENCES_MAX_VALUE_BYTES as Lt, CredentialTokenClaimsSchema as M, resolveBucketMs as Ma, hydrateSchema as Mc, logDestinationCapability as Mi, brightnessCapability as Mn, validateSchedulerInput as Mo, enumerateInferenceDevices as Mr, HISTORY_DEFAULT_MIN_INTERVAL_MS as Ms, MediaPlayerStatusSchema as Mt, DATABASE_SNAPSHOT_PARTIAL_SUFFIX as N, resolveCoreBlockEntry as Na, isCommand as Nc, logLevelAtMost as Ni, buildActionSteps as Nn, valveCapability as No, enumerateItemArrayFields as Nr, InvalidRecordError as Ns, MigrationLedgerEntrySchema as Nt, CatalogFileSchema as O, remoteSourceSteps as Oa, formatSecretScope as Oc, localNetworkCapability as Oi, authProviderCapability as On, unmetRequirements as Oo, deviceRunsCapability as Or, DeclarationRefusedError as Os, METHOD_ACCESS_MAP as Ot, DATABASE_SNAPSHOT_SUFFIX as P, resolveCoreBlockFiles as Pa, isDebugChannelName as Pc, looseSchema as Pi, buildCapabilityLookup as Pn, vectorDimFromBase64 as Po, enumerateSchemaFields as Pr, NoCallerError as Ps, MigrationMetaSchema as Pt, DataStoreDatabaseSchema as Q, scoreRuntimes as Qa, parseJsonUnknown as Qc, normalizeUnit as Qi, colorCapability as Qn, composedDeviceRef as Qo, gbToBytes as Qr, SECRET_CLEAR as Qs, RunningStateStatusSchema as Qt, DEFAULT_HOLD_OVERRIDE as R, resolveMethodAuth as Ra, isKeychainStoredField as Rc, mediaPlayerFeaturesOfRoles as Ri, buildStreamParamsConfigSchema as Rn, withDefaultRunning as Ro, evictionPolicyOfLocation as Rr, RECORD_DELETE_BATCH as Rs, PROPOSAL_MIN_SPAN_MS as Rt, COMPOSED_ITEM_FIXED_FIELDS as S, reconcileReportedFeatures as Sa, defineEntryKind as Sc, keychainAdminCapability as Si, EventCategory as Sl, addonWidgetsCapability as Sn, timedRunCapability as So, describeUnmet as Sr, BaseAddon as Ss, IDLE_ACTION_STATUS as St, CORE_BLOCK_ADDON_PREFIX as T, reducePoints as Ta, emitReadiness as Tc, legacyModeOf as Ti, alertsCapability as Tn, timedRunQuickRun as To, deviceHistoryCapability as Tr, DATAPLANE_SECRET_HEADER as Ts, KeychainAuditEntrySchema as Tt, DEVICE_NONCE_TTL_MS as U, resolveStepArgs as Ua, isSecretMarkerLike as Uc, modeForSwitch as Ui, capAppliesToDeviceKind as Un, DAY_MS as Uo, fanControlCapability as Ur, RUNTIME_DEFAULTS as Us, PreferenceNamespaceSchema as Ut, DEVICE_HISTORY_ENERGY_KEY as V, resolveRemoteSource as Va, isSecretFieldView as Vc, metricsProviderCapability as Vi, canonicalIconKey as Vn, COMPOSER_ADDON_ID as Vo, extractNestedAddonId as Vr, REDACTED_SECRET as Vs, PowerSourceInfoSchema as Vt, DEVICE_SAN_CREDENTIAL_PREFIX as W, resolveTemplateRef as Wa, isSecretRefOwnedBy as Wc, modeMayWrite as Wi, capUnitResolver as Wn, DEFAULT_HISTORY_RETENTION as Wo, fanOutTargets as Wr, ReadinessRegistry as Ws, PreferenceValueSchema as Wt, DEVICE_TEMPLATE_VALUES_CAP as X, scopesAllowAddon as Xa, normalizeSecretOwner as Xc, normalizeCoreBlockWrite as Xi, collectDeviceTemplates as Xn, buildFfmpegArgs as Xo, formatDeviceRevoker as Xr, RecordUniqueViolationError as Xs, RemoteAssumedStateSchema as Xt, DEVICE_TEMPLATE_THIS_ALIAS as Y, schedulersCapability as Ya, normalizeNodeId as Yc, normalizeCapStep as Yi, climateControlCapability as Yn, MINUTE_MS as Yo, foldSnapshotByFunction as Yr, RecordTooLargeError as Ys, RecordingStatusSchema as Yt, DEVICE_TOMBSTONE_RETENTION_MS as Z, scopesAllowDeviceCap as Za, parseJsonObject as Zc, normalizeStepTargets as Zi, collectWhenMirrorSources as Zn, cloneStatefulExpressionMemory as Zo, formatMinutes as Zr, RevConflictError as Zs, RemoteLayoutPayloadSchema as Zt, BatteryStatusSchema as _, processTimeZoneOr as _a, commandOrigin as _c, isLocationEnabled as _i, DeviceFeature as _l, actionWaitTotalMs as _n, streamQualityLabel as _o, declaredSeriesKind as _r, planResetTier as _s, HISTORY_CATALOG as _t, AGENT_MDNS_SERVICE_TYPE as a, parseStreamParamsFormPatch as aa, asJsonObject as ac, internalActionId as ai, scopeKey as al, ServerNameSchema as an, shortHostname as ao, consumablesCapability as ar, disarmRoseMemory as as, EMPTY_REMOTE_ASSUMED_STATE as at, CAP_NAMES_WITH_STATUS as b, ptzAutotrackCapability as ba, defineAddonMigrations as bc, isVoidInput as bi, errMsg as bl, addonPagesCapability as bn, switchStateOfMode as bo, deriveBatteryPresence as br, toExpressionValue as bs, HUB_MDNS_TXT_KEYS as bt, ActionError as c, pickAppLinkHub as ca, assertTransactScope as cc, isAlertEpisodeOpen as ci, secretViewsOf as cl, StorageCleanupJobSchema as cn, snapshotCapability as co, coreBlockIdFromAddonId as cr, helperMembers as cs, FAN_OSCILLATION_AXES as ct, ActionTargetResolver as d, powerSourceActuatorConflicts as da, buildSecretRef as dc, isArrayOutputSchema as di, toSecretFieldView as dl, StorageMigrationJobSchema as dn, storageAdminCapability as do, coverCapability as dr, integrateReading as ds, FanControlStatusSchema as dt, objectInputDeclaresRequiredDeviceId as ea, TransactRefusedError as ec, groupCommandsCapability as ei, readinessKey as el, STORAGE_LOCATION_MODES as en, settingsStoreCapability as eo, compileScalarOverride as er, compositionFeatureEnabled as es, DeviceRunSchema as et, ActionVariableSchema as f, powerSourceCapability as fa, collectSecretConfigKeys as fc, isCollectionArrayMethod as fi, transformSecretWrite as fl, TemplateKindSchema as fn, storageCapability as fo, createDeviceExtensionProvider as fr, isForwardInputRef as fs, FanDirectionSchema as ft, BaseDevice as g, procedureAuthKey as ga, commandEffect as gc, isKernelDerivedFeature as gi, COMPOSED_DEVICE_STABLE_ID_PREFIX as gl, actionSourceCapability as gn, streamCatalogCapability as go, declarationOwnerNodeId as gr, openStatistic as gs, GroupCommandResultSchema as gt, BUILTIN_REMOTE_COMPONENTS as h, problemsBlockSave as ha, collectZodSecretPaths as hc, isInternalActionId as hi, withoutCallerStamp as hl, UserRecordSchema as hn, storageProviderCapability as ho, databaseSnapshotCapability as hr, openReset as hs, FieldClaimSchema as ht, ACTUATOR_TEMPLATE_IDS as i, parseColorInput as ia, actionEffect as ic, integrationInstancesCapability as ii, ruleFireOfClaim as il, ScopedTokenSchema as in, sharedColorModes as io, compositionUnionReads as ir, createStatefulExpressionMemory as is, EMPTY_AUTOMATION_STATE as it, CoreBlockSchema as j, resolveAppConnections as ja, historyUnitFor as jc, lockDoorLinkOfComposition as ji, batteryCapability as jn, validateCustomAddress as jo, deviceTransitionsCapability as jr, ForeignSecretMarkerError as js, MOTION_CLOSE_AFTER_MS as jt, ConditionMirror as k, replacedFieldKeys as ka, getDebugInterest as kc, locationIconKey as ki, backupCapability as kn, userManagementCapability as ko, deviceStateCapability as kr, DeviceTransitionSchema as ks, MIGRATION_API_V1_METHODS as kt, ActionMinDelaySecSchema as l, planComposition as la, assertValidDeclaration as lc, isAlertEpisodeSeverity as li, sleep as ll, StorageLocationModeSchema as ln, splitTranslationRef as lo, coreBlockSourceKind as lr, historyRetentionFromSettings as ls, FAN_OSCILLATION_AXIS_SETTABLE as lt, AutomationStateDocSchema as m, preconditionOf as ma, collectSecretMarkerRefs as mc, isDefaultAppConnectionEndpoint as mi, vocabActionIdFor as ml, UNATTRIBUTED_BUCKET_KEY as mn, storageOccupancyCapability as mo, dataStoreProviderCapability as mr, nextLocalMidnight as ms, FieldClaimModeSchema as mt, ACTION_TARGET_INVALIDATION_EVENTS as n, orderMigrations as na, UnknownRecordKindError as nc, hasTimeLeaves as ni, resolveCapMount as nl, SchedulerError as nn, sharedActuatorFeatures as no, compositionFieldKey as nr, compositionSliceKey as ns, DeviceTombstoneSchema as nt, AGENT_MDNS_TXT_KEYS as o, petFountainCapability as oa, asNumber as oc, interpolate as oi, secretTreeFromPaths as ol, SetOscillationAxisInputSchema as on, siteFor as oo, coreBlockAddonId as or, evaluateDerivative as os, EMPTY_REMOTE_CONFIG as ot, AlertSchema as p, powerSourceLinkOfComposition as pa, collectSecretLeaves as pc, isCredentialTokenPayload as pi, userError as pl, TokenScopeSchema as pn, storageMigrationCapability as po, customKeyOfRole as pr, isHistoryHelper as ps, FanPresetSchema as pt, DEVICE_TEMPLATE_MAX_LENGTH as q, runtimeFieldUnit as qa, nodeIdOfScopedKey as qc, nextTimeBoundaryInMs as qi, checkRoleAddress as qn, HOUR_MS as qo, filesystemBrowseCapability as qr, RecordKindDeclarationSchema as qs, REMOTE_MEDIA_COMMANDS as qt, ACTUATOR_METHODS as r, parseAcceleratorFactsJson as ra, WELL_KNOWN_TAB_MAP as rc, heroLayoutCapability as ri, resolveSecretMarkers as rl, SchedulerSchema as rn, sharedActuatorMethods as ro, compositionSourceRefs as rr, compositionSourceKey as rs, DiscoveryProposalBodySchema as rt, ALL_CAPABILITY_DEFINITIONS as s, petFountainWaterItem as sa, asString$1 as sc, isAddonInstanceId as si, secretTreeFromSchema as sl, SsoBridgeClaimsSchema as sn, siteZoneKey as so, coreBlockComposition as sr, evaluateStatistic as ss, FAN_CAPTURE_FIELDS as st, ACTION_RUN_MAX_MS as t, occurrenceOn as ta, UnindexedFilterError as tc, groupTemplate as ti, recordSecretRef as tl, STREAM_PROFILE_META as tn, settleDeviceFeatures as to, composerCapability as tr, compositionItemFieldPath as ts, DeviceStatusSchema as tt, ActionStepSchema as u, platformProbeCapability as ua, auditedFields as uc, isAppLinkBase as ui, toNodeId as ul, StorageLocationTypeSchema as un, stableIdMapOf as uo, coreBlocksCapability as ur, implementedMethodsOf as us, FIRST_LEVEL_MACRO_CLASSES as ut, CAMERA_SWITCH_ORDER as v, projectDeviceRow as va, createEvent as vc, isObjectInput as vi, DeviceRole as vl, actionsCapability as vn, supportedRuntimes as vo, decodeVectorBase64 as vr, planStatisticTier as vs, HISTORY_ITEM_CATALOG as vt, CORE_BLOCKS_ADDON_ID as w, recordsCapability as wa, emitDownForOwnedCaps as wc, legacyAutoLinkIds as wi, alertEpisodePayload as wn, timedRunMaxIn as wo, deviceExtensionCapability as wr, CALLER_STAMPED_CAPABILITIES as ws, KEYCHAIN_RESET_TRIGGER_ACTOR as wt, CATALOG_LANGS as x, readStoredRemoteConfig as xa, defineCustomActions as xc, kebabToCamel as xi, featuresOfBoundCaps as xl, addonSettingsCapability as xn, templateCapability as xo, describeComposableCaps as xr, wattMillisecondsToKwh as xs, HvacModeSchema as xt, CAMSTACK_APP_LINK_ORIGIN as y, proposeRunningThreshold as ya, customAction as yc, isSameAddonId as yi, DeviceType as yl, addonIdOfActionId as yn, switchCapability as yo, defineExtensionSlotProvider as yr, statisticCadenceMs as ys, HUB_MDNS_SERVICE_TYPE as yt, DERIVED_CAMERA_SILENCED_CAP_NAMES as z, resolveMutate as za, isReadingQuantity as zc, memoizePinnedFfmpeg as zi, calendarsCapability as zn, withLocationMode as zo, expandContainer as zr, RECORD_SECRET_COLLECTION_PREFIX as zs, PackageRequiresSchema as zt };