@camstack/types 1.2.556 → 1.2.558

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 (64) hide show
  1. package/CHANGELOG.md +19 -1
  2. package/dist/addon/fake-addon-context.d.ts +3 -0
  3. package/dist/addon.js +2 -2
  4. package/dist/addon.mjs +2 -2
  5. package/dist/automation/action-target.d.ts +8 -0
  6. package/dist/automation/action.d.ts +24 -54
  7. package/dist/automation/draft/draft-json.d.ts +1 -1
  8. package/dist/automation/draft/index.d.ts +0 -1
  9. package/dist/automation/index.d.ts +3 -2
  10. package/dist/automation/normalize-units.d.ts +3 -3
  11. package/dist/automation/offered.d.ts +18 -0
  12. package/dist/automation/recipe.d.ts +1156 -2598
  13. package/dist/automation/scheduler.d.ts +48 -108
  14. package/dist/automation/step-runner.d.ts +7 -0
  15. package/dist/capabilities/action-source.cap.d.ts +12 -27
  16. package/dist/capabilities/actions.cap.d.ts +84 -189
  17. package/dist/capabilities/device-export.cap.d.ts +36 -1
  18. package/dist/capabilities/hero-layout.cap.d.ts +92 -0
  19. package/dist/capabilities/index.d.ts +2 -2
  20. package/dist/capabilities/remote.cap.d.ts +2 -2
  21. package/dist/capabilities/scene-monitor.cap.d.ts +1 -1
  22. package/dist/capabilities/schedulers.cap.d.ts +96 -216
  23. package/dist/client.d.ts +1 -1
  24. package/dist/client.js +21 -3
  25. package/dist/client.mjs +20 -4
  26. package/dist/{composed-stable-id-CDNLq7Y8.js → composed-stable-id-BmJ_5GiE.js} +5 -0
  27. package/dist/{composed-stable-id-CPp3votu.mjs → composed-stable-id-iddnCQ51.mjs} +5 -0
  28. package/dist/composition/composition.d.ts +8 -0
  29. package/dist/composition/helpers/index.d.ts +1 -1
  30. package/dist/composition/helpers/save.d.ts +2 -0
  31. package/dist/composition/helpers/source-pick.d.ts +11 -5
  32. package/dist/composition/validate-composition.d.ts +2 -0
  33. package/dist/device/cap-vocabulary/action-index.d.ts +32 -0
  34. package/dist/device/cap-vocabulary/index.d.ts +2 -2
  35. package/dist/device/device-do-actions.d.ts +3 -105
  36. package/dist/device/device-kind.d.ts +36 -0
  37. package/dist/device/device-type.d.ts +5 -0
  38. package/dist/device/export-name.d.ts +65 -0
  39. package/dist/device/hero/hero-contribution-kit.d.ts +3 -0
  40. package/dist/device/hero/hero-fragment.d.ts +3 -0
  41. package/dist/device/hero/hero-look.d.ts +6 -0
  42. package/dist/device/hero/hero-measurement.d.ts +76 -0
  43. package/dist/device/hero/hero-model.d.ts +91 -0
  44. package/dist/device/hero/hero-row.d.ts +61 -0
  45. package/dist/device/hero/hero-scene.d.ts +1 -0
  46. package/dist/device/hero/index.d.ts +1 -0
  47. package/dist/device/index.d.ts +1 -1
  48. package/dist/generated/addon-api.d.ts +7 -0
  49. package/dist/generated/method-access-map.d.ts +1 -1
  50. package/dist/generated/system-proxy.d.ts +1 -1
  51. package/dist/{implemented-methods-5YMDeE3f.mjs → implemented-methods-CSTk6zYK.mjs} +147 -2
  52. package/dist/{implemented-methods-Cj65uy2F.js → implemented-methods-CfaRR_ki.js} +212 -1
  53. package/dist/index.d.ts +9 -8
  54. package/dist/index.js +3145 -2959
  55. package/dist/index.mjs +3095 -2936
  56. package/dist/node.js +2 -2
  57. package/dist/node.mjs +2 -2
  58. package/dist/notification/alarm-steps.d.ts +18 -0
  59. package/dist/remote/remote-config.d.ts +5 -5
  60. package/dist/{sleep-Czv-4wFH.mjs → sleep-BvVGLl30.mjs} +52 -2
  61. package/dist/{sleep-BRGFFgr9.js → sleep-CyWfD1LJ.js} +69 -1
  62. package/dist/testing.js +3 -3
  63. package/dist/testing.mjs +3 -3
  64. package/package.json +1 -1
package/dist/node.js CHANGED
@@ -21,8 +21,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  enumerable: true
22
22
  }) : target, mod));
23
23
  //#endregion
24
- const require_composed_stable_id = require("./composed-stable-id-CDNLq7Y8.js");
25
- const require_implemented_methods = require("./implemented-methods-Cj65uy2F.js");
24
+ const require_composed_stable_id = require("./composed-stable-id-BmJ_5GiE.js");
25
+ const require_implemented_methods = require("./implemented-methods-CfaRR_ki.js");
26
26
  let node_crypto = require("node:crypto");
27
27
  let node_fs = require("node:fs");
28
28
  node_fs = __toESM(node_fs);
package/dist/node.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { s as errMsg } from "./composed-stable-id-CPp3votu.mjs";
2
- import { Fn as getFfmpegArtifact, In as getFfmpegDownloadUrl, Ln as canonicalHash, Mn as chooseFfmpegBinary, Nn as ffmpegBinaryName, Pn as FFMPEG_RELEASE, R as compositionSourceKey, Rn as Fmp4BoxSplitter, Un as buildFfmpegArgs, a as CUSTOMIZATION_BLOCK_NAME_PREFIX, jn as FFMPEG_PATH_ENV, qn as isSoftwareDecode, t as implementedMethodsOf } from "./implemented-methods-5YMDeE3f.mjs";
1
+ import { s as errMsg } from "./composed-stable-id-iddnCQ51.mjs";
2
+ import { Gn as FFMPEG_RELEASE, Hn as FFMPEG_PATH_ENV, Jn as canonicalHash, Kn as getFfmpegArtifact, Un as chooseFfmpegBinary, Wn as ffmpegBinaryName, Yn as Fmp4BoxSplitter, a as CUSTOMIZATION_BLOCK_NAME_PREFIX, er as buildFfmpegArgs, ir as isSoftwareDecode, qn as getFfmpegDownloadUrl, t as implementedMethodsOf, z as compositionSourceKey } from "./implemented-methods-CSTk6zYK.mjs";
3
3
  import { createHash, createHmac, randomUUID, timingSafeEqual } from "node:crypto";
4
4
  import * as fs from "node:fs";
5
5
  import { chmodSync, copyFileSync, createWriteStream, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Which Action steps touch the alarm panel: the one rule the hub's alarm
3
+ * membership, the admin rule editor and the viewer read (a step is stored by
4
+ * vocabulary action id, D983).
5
+ *
6
+ * The ids are a literal on purpose: a client bundle (`@camstack/types/client`)
7
+ * reaches this module without the whole vocabulary. `alarm-steps.spec.ts`
8
+ * keeps the list equal to the vocabulary's `alarm-panel` actions.
9
+ */
10
+ import type { ActionStep } from '../automation/recipe.js';
11
+ /** Every vocabulary action on the `alarm-panel` cap. */
12
+ export declare const NC_ALARM_PANEL_ACTION_IDS: readonly ['alarm.trigger', 'alarm.disarm', 'alarm.arm.home', 'alarm.arm.away', 'alarm.arm.night', 'alarm.arm.vacation', 'alarm.arm.custom_bypass'];
13
+ /** The action that pulls the panel's trigger (`alarm-panel.trigger`). */
14
+ export declare const NC_ALARM_TRIGGER_ACTION_ID = "alarm.trigger";
15
+ /** A command step on the alarm panel (arm, disarm or trigger). */
16
+ export declare function stepActuatesAlarmPanel(step: ActionStep): boolean;
17
+ /** A command step that pulls the alarm panel's trigger. */
18
+ export declare function stepPullsAlarmTrigger(step: ActionStep): boolean;
@@ -3,16 +3,16 @@
3
3
  * the layout payload of the `remote` template kind. Pure data: no runtime, no
4
4
  * node dependency, so the admin UI imports the same schemas the server checks.
5
5
  *
6
- * A binding is the SAME shape an Action step has (`AutomationCapStepBaseSchema`: a
7
- * cap method called on a device with arguments), narrowed to ONE device: an IR
6
+ * A binding is a raw cap call (a cap method called on ONE device with
7
+ * arguments), not a vocabulary step: an IR
8
8
  * code is `ir-transmitter.send` on the transmitter, a smart TV is a `switch` or a
9
9
  * vendor cap — the remote does not know which. How many times a command is sent
10
10
  * is the CALLER's (`sendCommand({ repeat })`), never stored here.
11
11
  */
12
12
  import { z } from 'zod';
13
13
  export declare const RemoteBindingActionSchema: z.ZodObject<{
14
- deviceId: z.ZodNumber;
15
14
  kind: z.ZodLiteral<"cap">;
15
+ deviceId: z.ZodNumber;
16
16
  cap: z.ZodString;
17
17
  method: z.ZodString;
18
18
  args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -21,8 +21,8 @@ export declare const RemoteBindingActionSchema: z.ZodObject<{
21
21
  export type RemoteBindingAction = z.infer<typeof RemoteBindingActionSchema>;
22
22
  export declare const RemoteBindingSchema: z.ZodObject<{
23
23
  action: z.ZodObject<{
24
- deviceId: z.ZodNumber;
25
24
  kind: z.ZodLiteral<"cap">;
25
+ deviceId: z.ZodNumber;
26
26
  cap: z.ZodString;
27
27
  method: z.ZodString;
28
28
  args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -50,8 +50,8 @@ export declare const RemoteConfigSchema: z.ZodObject<{
50
50
  defaultTransmitterId: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
51
51
  bindings: z.ZodRecord<z.ZodString, z.ZodObject<{
52
52
  action: z.ZodObject<{
53
- deviceId: z.ZodNumber;
54
53
  kind: z.ZodLiteral<"cap">;
54
+ deviceId: z.ZodNumber;
55
55
  cap: z.ZodString;
56
56
  method: z.ZodString;
57
57
  args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1,5 +1,5 @@
1
1
  import { t as EventCategory } from "./event-category-Dv-Gcv1f.mjs";
2
- import { a as DeviceType, i as DeviceRole, s as errMsg } from "./composed-stable-id-CPp3votu.mjs";
2
+ import { a as DeviceType, i as DeviceRole, s as errMsg } from "./composed-stable-id-iddnCQ51.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/audio/audio-chunk-format.ts
5
5
  /**
@@ -8051,6 +8051,13 @@ var ACTUATOR_CAP_VOCABULARY = {
8051
8051
  },
8052
8052
  state: { on: { icon: "lightbulb" } }
8053
8053
  },
8054
+ [DeviceRole.SwitchLight]: {
8055
+ actions: {
8056
+ "switch.on": { icon: "lightbulb" },
8057
+ "switch.off": { icon: "lightbulb-off" }
8058
+ },
8059
+ state: { on: { icon: "lightbulb" } }
8060
+ },
8054
8061
  [DeviceRole.Chime]: { actions: {
8055
8062
  "switch.on": {
8056
8063
  label: t("Enable chime", "Attiva il campanello"),
@@ -12552,6 +12559,49 @@ function actionEffect(actionId, args) {
12552
12559
  };
12553
12560
  return null;
12554
12561
  }
12562
+ /**
12563
+ * A command step names an action that does not exist, or a device that does
12564
+ * not offer it. Typed so a save boundary names the reason, not a string.
12565
+ */
12566
+ var VocabActionError = class extends Error {
12567
+ reason;
12568
+ actionId;
12569
+ deviceId;
12570
+ constructor(reason, actionId, message, deviceId) {
12571
+ super(message);
12572
+ this.reason = reason;
12573
+ this.actionId = actionId;
12574
+ this.deviceId = deviceId;
12575
+ this.name = "VocabActionError";
12576
+ }
12577
+ };
12578
+ /**
12579
+ * The cap + method + args `actionId` calls with the step's (open) `args`.
12580
+ * THE one place a command step's action id becomes a cap method: the step
12581
+ * runner and a generated automation block call it when the step runs.
12582
+ * Throws {@link VocabActionError} (`unknown-action`).
12583
+ */
12584
+ function vocabCall(actionId, args) {
12585
+ const found = findVocabAction(actionId);
12586
+ if (found === void 0) throw new VocabActionError("unknown-action", actionId, `"${actionId}" is not a vocabulary action id`);
12587
+ return {
12588
+ cap: found.cap,
12589
+ method: found.action.method,
12590
+ args: {
12591
+ ...args,
12592
+ ...found.action.args
12593
+ }
12594
+ };
12595
+ }
12596
+ /**
12597
+ * Refuse a device that does not offer `actionId`: its bound caps (the
12598
+ * per-binding walk, D12) do not include the action's cap. Throws
12599
+ * {@link VocabActionError} (`unknown-action` or `not-offered`).
12600
+ */
12601
+ function assertDeviceOffers(actionId, deviceId, deviceCaps) {
12602
+ const { cap } = vocabCall(actionId, void 0);
12603
+ if (!deviceCaps.includes(cap)) throw new VocabActionError("not-offered", actionId, `device ${deviceId} does not offer ${actionId} (needs cap "${cap}")`, deviceId);
12604
+ }
12555
12605
  //#endregion
12556
12606
  //#region src/capabilities/addon-pages-source.cap.ts
12557
12607
  /**
@@ -16958,4 +17008,4 @@ function sleepCancellable(ms, signal) {
16958
17008
  });
16959
17009
  }
16960
17010
  //#endregion
16961
- export { DEVICE_CHILDREN_BATCH_MAX as $, WELL_KNOWN_TABS as $i, HISTORY_DEFAULT_MIN_INTERVAL_MS as $n, RECORD_CLASSES as $r, displayUnitFor as $t, CAP_ADVANCE_FIELDS as A, RecordNotFoundError as Ai, PeerBytesTicketSchema as An, SCOPED_SETTINGS_SCOPES as Ar, CAM_PROFILE_ORDER as At, CAP_COMMAND_ORIGIN_CONTEXT_KEY as B, recordsErrorFromMessage as Bi, RecordKindDeclarationSchema as Bn, RecordIntegrationInstances as Br, StreamSourceEntrySchema$1 as Bt, auditedFields as C, findMigrationsBlocked as Ca, DeclarationRefusedError as Ci, registerKnownSecret as Cn, secretTreeFromPaths as Cr, createDebugEmitter as Ct, HF_BASE_URL as D, isAudioChunkFormat as Da, NoCallerError as Di, PEER_BYTES_MAX_OUTSTANDING as Dn, isSecretRefOwnedBy as Dr, AudioStreamPickSchema as Dt, DEFAULT_TOKEN_EXPIRY as E, expandAudioChunkToF32le as Ea, InvalidRecordError as Ei, PEER_BYTES_CHUNK_BYTES as En, collectSecretMarkerRefs as Er, AudioChunkFormatSchema as Et, withoutCallerStamp as F, RevConflictError as Fi, defineEntryKind as Fn, createDurableState as Fr, DecodedAudioChunkSchema as Ft, readNodePin as G, secretsOverMigrationApi as Gi, declarationsOf as Gn, mapSecretLeaves as Gr, makeSourceBrokerId as Gt, commandOrigin as H, integrationRowsApiOver as Hi, RecordRetentionSchema as Hn, secretViewsOf as Hr, SubscribeAudioChunksInputSchema as Ht, customAction as I, TransactRefusedError as Ii, entryBody as In, moveRegistrySwitchToBody as Ir, FrameHandleSchema as It, PipelineRunResultBridge as J, defineAddonMigrations as Ji, collectZodSecretPaths as Jn, recordSecretCollection as Jr, DEFAULT_DISPLAY_PREFERENCE as Jt, toNodeId as K, switchRecordsOverMigrationApi as Ki, defineRecordKinds as Kn, parseSecretPath as Kr, parseProfileBrokerId as Kt, defineCustomActions as L, UnindexedFilterError as Li, EntryDescriptorSchema as Ln, registrySwitchPortsOver as Lr, ProfileRtspEntrySchema as Lt, CAP_NAMES as M, RecordTooLargeError as Mi, DATAPLANE_SECRET_HEADER as Mn, resolveDeviceSettings as Mr, CamStreamKindSchema as Mt, CAP_STATE_LEAVES as N, RecordUniqueViolationError as Ni, SHARE_VIEW_KINDS as Nn, resolvedValues as Nr, CamStreamResolutionSchema as Nt, HF_REPO as O, PlaintextSecretError as Oi, PEER_BYTES_STALL_MS as On, resolveSecretMarkers as Or, BrokerStatsSchema as Ot, CALLER_STAMPED_CAPABILITIES as P, RecordsError as Pi, DisposerChain as Pn, normalizeNodeId as Pr, CameraStreamSchema as Pt, deviceOpsCapability as Q, isEvent as Qi, DEVICE_STATUS_METHOD as Qn, RECORD_BATCH_MAX_BYTES as Qr, baseUnitOf as Qt, describeCustomActions as R, UnknownRecordKindError as Ri, RecordFieldPathSchema as Rn, registrySwitchToBodyId as Rr, ProfileSlotSchema as Rt, createSliceHandle as S, AddonMigrationsBlockedError as Sa, BatchTooLargeError as Si, knownSecretCount as Sn, parseSecretStatePath as Sr, __resetDebugInterestForTests as St, isCommand as T, audioChunkBytesPerSample as Ta, ForeignSecretMarkerError as Ti, shortSecretRefHash as Tn, KeychainWriteRefusedError as Tr, isDebugChannelName as Tt, nodePin as U, recordsOverMigrationApi as Ui, StoredRecordKindDeclarationSchema as Un, REMOVE_LEAF as Ur, SubscribeAudioChunksResultSchema as Ut, CAP_NODE_PIN_CONTEXT_KEY as V, defaultIntegrationDepsOver as Vi, RecordKindNameSchema as Vn, isInstanceEnabled as Vr, StreamSourceSchema as Vt, readCommandOrigin as W, rowsDepsOver as Wi, assertValidDeclaration as Wn, collectSecretLeaves as Wr, makeProfileBrokerId as Wt, MIGRATION_API_VERSION as X, createEvent as Xi, DEFAULT_RUNTIME_STATE_DURABILITY as Xn, secretArrayPrefixes as Xr, QUANTITY_BASE as Xt, PipelineStepInputSchema as Y, runAddonMigrations as Yi, isZodSecret as Yn, recordSecretRef as Yr, DISPLAY_PREFERENCES as Yt, RawStateResultSchema as Z, emitReadiness as Zi, DEVICE_SETTINGS_CONTRIBUTION_METHODS as Zn, RECORD_BATCH_MAX as Zr, ReadingQuantitySchema as Zt, invokeTrpcLeaf as _, collectSecretConfigKeys as _a, normalizeSecretOwner as _i, REVALIDATE_AFTER_MS as _n, BaseAddon as _r, DEBUG_WATCH_HARD_CAP_MS as _t, asJsonArray as a, hydrateSchema as aa, RECORD_MAX_INDEXES as ai, TransitionActorKindSchema as an, isDeviceConfigCap as ar, findVocabAction as at, createLazyTrpcSource as b, omitTransientConfig as ba, linksOfKind as bi, clearKnownSecrets as bn, normalizeAddonInitResult as br, DebugInterest as bt, asString as c, classifySecretWrite as ca, RECORD_SECRET_COLLECTION_PREFIX as ci, TransitionOutcomeSchema as cn, resolveCapMount as cr, CAP_VOCABULARY_BY_NAME as ct, parseJsonUnknown as d, isSecretMarker as da, SECRET_REF_SCHEME as di, RuleFireOriginSchema as dn, ErrorCodeSchema as dr, ReadinessRegistry as dt, WELL_KNOWN_TAB_MAP as ea, RECORD_DATABASES as ei, historyUnitFor as en, HISTORY_UNIT_LABELS as er, adminUiCapability as et, hfModelUrl as f, isSecretMarkerLike as fa, arrayItemFieldPath as fi, ruleFireOfClaim as fn, ErrorI18nPayloadSchema as fr, ReadinessTimeoutError as ft, createDeviceProxy as g, collectKeychainStoredKeys as ga, isSecretRef as gi, resolveSecretViewsIn as gn, userError as gr, DEBUG_CHANNEL_PREFIX as gt, isDeviceScopedCap as h, REDACTED_SECRET as ha, globalSecretScope as hi, assertTransactScope as hn, readErrorI18n as hr, scopeKey as ht, asBoolean as i, dehydrateSchema as ia, RECORD_MAX_DATA_BYTES as ii, DeviceTransitionSchema as in, historyItemFieldPath as ir, allVocabActions as it, CAP_METHOD_TIMEOUTS_MS as j, RecordSecretUnavailableError as ji, CALLER_USERNAME_HEADER as jn, nodeIdOfScopedKey as jr, CamProfileSchema as jt, RUNTIME_DEFAULTS as k, RECORDS_ERROR_CODES as ki, PEER_BYTES_TICKET_TTL_MS as kn, transformSecretWrite as kr, BrokerStatusSchema as kt, parseJsonArray as l, isSecretClear as la, RECORD_SETTINGS_MAX_ROWS as li, TransitionValueSchema as ln, systemMethod as lr, t as lt, DEVICE_SCOPED_CAPS as m, toSecretFieldView as ma, formatSecretScope as mi, createRecordsAccess as mn, forbiddenError as mr, readinessKey as mt, sleepCancellable as n, collectHydratedFieldValues as na, RECORD_DELETE_BATCH as ni, readingMeta as nn, event as nr, addonPagesSourceCapability as nt, asJsonObject as o, resolveHydratedFieldValue as oa, RECORD_MAX_INDEX_FIELDS as oi, TransitionActorSchema as on, method as or, vocabActionIdFor as ot, BOOT_RECOVERY_BACKOFF_MS as p, makeSecretMarker as pa, buildSecretRef as pi, makeInMemoryRecords as pn, FORBIDDEN_MESSAGE_PREFIX as pr, emitDownForOwnedCaps as pt, viewerUiCapability as q, AddonMigrationDefinitionError as qi, SECRET_META as qn, recordArrayItemPath as qr, selectAssignedProfileSlots as qt, maskUrlCredentials as r, dehydrateConfigField as ra, RECORD_ID_MAX_LENGTH as ri, DeviceCommandSettledEventSchema as rn, expandCapMethods as rr, actionEffect as rt, asNumber as s, SECRET_CLEAR as sa, RECORD_QUERY_MAX as si, TransitionCommandSchema as sn, optionalMethod as sr, CAP_VOCABULARY as st, sleep as t, collectHydratedFieldEntries as ta, RECORD_DEFAULT_MAX_DATA_BYTES as ti, isReadingQuantity as tn, PROVIDER_PIN_FIELD as tr, AddonPageDeclarationSchema as tt, parseJsonObject as u, isSecretFieldView as ua, RECORD_SWEEP_INTERVAL_MS as ui, CommandOriginClaimSchema as un, CamstackError as ur, MODEL_FORMATS as ut, addonSliceHandleApi as v, isKeychainStoredField as va, parseSecretRef as vi, createSecretsAccess as vn, classifyStoreError as vr, DEBUG_WATCH_REARM_EVERY_MS as vt, commandEffect as w, AUDIO_CHUNK_FORMATS as wa, FilterRequiredError as wi, scrubKnownSecrets as wn, secretTreeFromSchema as wr, getDebugInterest as wt, createMirrorSource as x, schemaDeclaresAnyField as xa, optionalLinkField as xi, forgetKnownSecret as xn, mergeSecretStatePaths as xr, DebugWatchTable as xt, createEventBusSliceSource as y, isSecretConfigField as ya, linkField as yi, MIN_SCRUBBED_LENGTH as yn, migrationSet as yr, DEBUG_WATCH_WINDOW_MS as yt, deviceCustomAction as z, asRecordsError as zi, RecordIndexSchema as zn, registrySwitchToBodyMigration as zr, ProfileSlotStatusSchema as zt };
17011
+ export { DEVICE_CHILDREN_BATCH_MAX as $, createEvent as $i, DEFAULT_RUNTIME_STATE_DURABILITY as $n, secretArrayPrefixes as $r, QUANTITY_BASE as $t, CAP_ADVANCE_FIELDS as A, isAudioChunkFormat as Aa, NoCallerError as Ai, PEER_BYTES_MAX_OUTSTANDING as An, isSecretRefOwnedBy as Ar, AudioStreamPickSchema as At, CAP_COMMAND_ORIGIN_CONTEXT_KEY as B, UnindexedFilterError as Bi, EntryDescriptorSchema as Bn, registrySwitchPortsOver as Br, ProfileRtspEntrySchema as Bt, auditedFields as C, omitTransientConfig as Ca, linksOfKind as Ci, clearKnownSecrets as Cn, normalizeAddonInitResult as Cr, DebugInterest as Ct, HF_BASE_URL as D, AUDIO_CHUNK_FORMATS as Da, FilterRequiredError as Di, scrubKnownSecrets as Dn, secretTreeFromSchema as Dr, getDebugInterest as Dt, DEFAULT_TOKEN_EXPIRY as E, findMigrationsBlocked as Ea, DeclarationRefusedError as Ei, registerKnownSecret as En, secretTreeFromPaths as Er, createDebugEmitter as Et, withoutCallerStamp as F, RecordTooLargeError as Fi, DATAPLANE_SECRET_HEADER as Fn, resolveDeviceSettings as Fr, CamStreamKindSchema as Ft, readNodePin as G, integrationRowsApiOver as Gi, RecordRetentionSchema as Gn, secretViewsOf as Gr, SubscribeAudioChunksInputSchema as Gt, commandOrigin as H, asRecordsError as Hi, RecordIndexSchema as Hn, registrySwitchToBodyMigration as Hr, ProfileSlotStatusSchema as Ht, customAction as I, RecordUniqueViolationError as Ii, SHARE_VIEW_KINDS as In, resolvedValues as Ir, CamStreamResolutionSchema as It, PipelineRunResultBridge as J, secretsOverMigrationApi as Ji, declarationsOf as Jn, mapSecretLeaves as Jr, makeSourceBrokerId as Jt, toNodeId as K, recordsOverMigrationApi as Ki, StoredRecordKindDeclarationSchema as Kn, REMOVE_LEAF as Kr, SubscribeAudioChunksResultSchema as Kt, defineCustomActions as L, RecordsError as Li, DisposerChain as Ln, normalizeNodeId as Lr, CameraStreamSchema as Lt, CAP_NAMES as M, RECORDS_ERROR_CODES as Mi, PEER_BYTES_TICKET_TTL_MS as Mn, transformSecretWrite as Mr, BrokerStatusSchema as Mt, CAP_STATE_LEAVES as N, RecordNotFoundError as Ni, PeerBytesTicketSchema as Nn, SCOPED_SETTINGS_SCOPES as Nr, CAM_PROFILE_ORDER as Nt, HF_REPO as O, audioChunkBytesPerSample as Oa, ForeignSecretMarkerError as Oi, shortSecretRefHash as On, KeychainWriteRefusedError as Or, isDebugChannelName as Ot, CALLER_STAMPED_CAPABILITIES as P, RecordSecretUnavailableError as Pi, CALLER_USERNAME_HEADER as Pn, nodeIdOfScopedKey as Pr, CamProfileSchema as Pt, deviceOpsCapability as Q, runAddonMigrations as Qi, isZodSecret as Qn, recordSecretRef as Qr, DISPLAY_PREFERENCES as Qt, describeCustomActions as R, RevConflictError as Ri, defineEntryKind as Rn, createDurableState as Rr, DecodedAudioChunkSchema as Rt, createSliceHandle as S, isSecretConfigField as Sa, linkField as Si, MIN_SCRUBBED_LENGTH as Sn, migrationSet as Sr, DEBUG_WATCH_WINDOW_MS as St, isCommand as T, AddonMigrationsBlockedError as Ta, BatchTooLargeError as Ti, knownSecretCount as Tn, parseSecretStatePath as Tr, __resetDebugInterestForTests as Tt, nodePin as U, recordsErrorFromMessage as Ui, RecordKindDeclarationSchema as Un, RecordIntegrationInstances as Ur, StreamSourceEntrySchema$1 as Ut, CAP_NODE_PIN_CONTEXT_KEY as V, UnknownRecordKindError as Vi, RecordFieldPathSchema as Vn, registrySwitchToBodyId as Vr, ProfileSlotSchema as Vt, readCommandOrigin as W, defaultIntegrationDepsOver as Wi, RecordKindNameSchema as Wn, isInstanceEnabled as Wr, StreamSourceSchema as Wt, MIGRATION_API_VERSION as X, AddonMigrationDefinitionError as Xi, SECRET_META as Xn, recordArrayItemPath as Xr, selectAssignedProfileSlots as Xt, PipelineStepInputSchema as Y, switchRecordsOverMigrationApi as Yi, defineRecordKinds as Yn, parseSecretPath as Yr, parseProfileBrokerId as Yt, RawStateResultSchema as Z, defineAddonMigrations as Zi, collectZodSecretPaths as Zn, recordSecretCollection as Zr, DEFAULT_DISPLAY_PREFERENCE as Zt, invokeTrpcLeaf as _, toSecretFieldView as _a, formatSecretScope as _i, createRecordsAccess as _n, forbiddenError as _r, readinessKey as _t, asJsonArray as a, collectHydratedFieldValues as aa, RECORD_DELETE_BATCH as ai, readingMeta as an, event as ar, allVocabActions as at, createLazyTrpcSource as b, collectSecretConfigKeys as ba, normalizeSecretOwner as bi, REVALIDATE_AFTER_MS as bn, BaseAddon as br, DEBUG_WATCH_HARD_CAP_MS as bt, asString as c, hydrateSchema as ca, RECORD_MAX_INDEXES as ci, TransitionActorKindSchema as cn, isDeviceConfigCap as cr, vocabActionIdFor as ct, parseJsonUnknown as d, classifySecretWrite as da, RECORD_SECRET_COLLECTION_PREFIX as di, TransitionOutcomeSchema as dn, resolveCapMount as dr, CAP_VOCABULARY_BY_NAME as dt, emitReadiness as ea, RECORD_BATCH_MAX as ei, ReadingQuantitySchema as en, DEVICE_SETTINGS_CONTRIBUTION_METHODS as er, adminUiCapability as et, hfModelUrl as f, isSecretClear as fa, RECORD_SETTINGS_MAX_ROWS as fi, TransitionValueSchema as fn, systemMethod as fr, t as ft, createDeviceProxy as g, makeSecretMarker as ga, buildSecretRef as gi, makeInMemoryRecords as gn, FORBIDDEN_MESSAGE_PREFIX as gr, emitDownForOwnedCaps as gt, isDeviceScopedCap as h, isSecretMarkerLike as ha, arrayItemFieldPath as hi, ruleFireOfClaim as hn, ErrorI18nPayloadSchema as hr, ReadinessTimeoutError as ht, asBoolean as i, collectHydratedFieldEntries as ia, RECORD_DEFAULT_MAX_DATA_BYTES as ii, isReadingQuantity as in, PROVIDER_PIN_FIELD as ir, actionEffect as it, CAP_METHOD_TIMEOUTS_MS as j, PlaintextSecretError as ji, PEER_BYTES_STALL_MS as jn, resolveSecretMarkers as jr, BrokerStatsSchema as jt, RUNTIME_DEFAULTS as k, expandAudioChunkToF32le as ka, InvalidRecordError as ki, PEER_BYTES_CHUNK_BYTES as kn, collectSecretMarkerRefs as kr, AudioChunkFormatSchema as kt, parseJsonArray as l, resolveHydratedFieldValue as la, RECORD_MAX_INDEX_FIELDS as li, TransitionActorSchema as ln, method as lr, vocabCall as lt, DEVICE_SCOPED_CAPS as m, isSecretMarker as ma, SECRET_REF_SCHEME as mi, RuleFireOriginSchema as mn, ErrorCodeSchema as mr, ReadinessRegistry as mt, sleepCancellable as n, WELL_KNOWN_TABS as na, RECORD_CLASSES as ni, displayUnitFor as nn, HISTORY_DEFAULT_MIN_INTERVAL_MS as nr, addonPagesSourceCapability as nt, asJsonObject as o, dehydrateConfigField as oa, RECORD_ID_MAX_LENGTH as oi, DeviceCommandSettledEventSchema as on, expandCapMethods as or, assertDeviceOffers as ot, BOOT_RECOVERY_BACKOFF_MS as p, isSecretFieldView as pa, RECORD_SWEEP_INTERVAL_MS as pi, CommandOriginClaimSchema as pn, CamstackError as pr, MODEL_FORMATS as pt, viewerUiCapability as q, rowsDepsOver as qi, assertValidDeclaration as qn, collectSecretLeaves as qr, makeProfileBrokerId as qt, maskUrlCredentials as r, WELL_KNOWN_TAB_MAP as ra, RECORD_DATABASES as ri, historyUnitFor as rn, HISTORY_UNIT_LABELS as rr, VocabActionError as rt, asNumber as s, dehydrateSchema as sa, RECORD_MAX_DATA_BYTES as si, DeviceTransitionSchema as sn, historyItemFieldPath as sr, findVocabAction as st, sleep as t, isEvent as ta, RECORD_BATCH_MAX_BYTES as ti, baseUnitOf as tn, DEVICE_STATUS_METHOD as tr, AddonPageDeclarationSchema as tt, parseJsonObject as u, SECRET_CLEAR as ua, RECORD_QUERY_MAX as ui, TransitionCommandSchema as un, optionalMethod as ur, CAP_VOCABULARY as ut, addonSliceHandleApi as v, REDACTED_SECRET as va, globalSecretScope as vi, assertTransactScope as vn, readErrorI18n as vr, scopeKey as vt, commandEffect as w, schemaDeclaresAnyField as wa, optionalLinkField as wi, forgetKnownSecret as wn, mergeSecretStatePaths as wr, DebugWatchTable as wt, createMirrorSource as x, isKeychainStoredField as xa, parseSecretRef as xi, createSecretsAccess as xn, classifyStoreError as xr, DEBUG_WATCH_REARM_EVERY_MS as xt, createEventBusSliceSource as y, collectKeychainStoredKeys as ya, isSecretRef as yi, resolveSecretViewsIn as yn, userError as yr, DEBUG_CHANNEL_PREFIX as yt, deviceCustomAction as z, TransactRefusedError as zi, entryBody as zn, moveRegistrySwitchToBody as zr, FrameHandleSchema as zt };
@@ -1,5 +1,5 @@
1
1
  const require_event_category = require("./event-category-Ps2LC8dN.js");
2
- const require_composed_stable_id = require("./composed-stable-id-CDNLq7Y8.js");
2
+ const require_composed_stable_id = require("./composed-stable-id-BmJ_5GiE.js");
3
3
  let zod = require("zod");
4
4
  //#region src/audio/audio-chunk-format.ts
5
5
  /**
@@ -8051,6 +8051,13 @@ var ACTUATOR_CAP_VOCABULARY = {
8051
8051
  },
8052
8052
  state: { on: { icon: "lightbulb" } }
8053
8053
  },
8054
+ [require_composed_stable_id.DeviceRole.SwitchLight]: {
8055
+ actions: {
8056
+ "switch.on": { icon: "lightbulb" },
8057
+ "switch.off": { icon: "lightbulb-off" }
8058
+ },
8059
+ state: { on: { icon: "lightbulb" } }
8060
+ },
8054
8061
  [require_composed_stable_id.DeviceRole.Chime]: { actions: {
8055
8062
  "switch.on": {
8056
8063
  label: t("Enable chime", "Attiva il campanello"),
@@ -12552,6 +12559,49 @@ function actionEffect(actionId, args) {
12552
12559
  };
12553
12560
  return null;
12554
12561
  }
12562
+ /**
12563
+ * A command step names an action that does not exist, or a device that does
12564
+ * not offer it. Typed so a save boundary names the reason, not a string.
12565
+ */
12566
+ var VocabActionError = class extends Error {
12567
+ reason;
12568
+ actionId;
12569
+ deviceId;
12570
+ constructor(reason, actionId, message, deviceId) {
12571
+ super(message);
12572
+ this.reason = reason;
12573
+ this.actionId = actionId;
12574
+ this.deviceId = deviceId;
12575
+ this.name = "VocabActionError";
12576
+ }
12577
+ };
12578
+ /**
12579
+ * The cap + method + args `actionId` calls with the step's (open) `args`.
12580
+ * THE one place a command step's action id becomes a cap method: the step
12581
+ * runner and a generated automation block call it when the step runs.
12582
+ * Throws {@link VocabActionError} (`unknown-action`).
12583
+ */
12584
+ function vocabCall(actionId, args) {
12585
+ const found = findVocabAction(actionId);
12586
+ if (found === void 0) throw new VocabActionError("unknown-action", actionId, `"${actionId}" is not a vocabulary action id`);
12587
+ return {
12588
+ cap: found.cap,
12589
+ method: found.action.method,
12590
+ args: {
12591
+ ...args,
12592
+ ...found.action.args
12593
+ }
12594
+ };
12595
+ }
12596
+ /**
12597
+ * Refuse a device that does not offer `actionId`: its bound caps (the
12598
+ * per-binding walk, D12) do not include the action's cap. Throws
12599
+ * {@link VocabActionError} (`unknown-action` or `not-offered`).
12600
+ */
12601
+ function assertDeviceOffers(actionId, deviceId, deviceCaps) {
12602
+ const { cap } = vocabCall(actionId, void 0);
12603
+ if (!deviceCaps.includes(cap)) throw new VocabActionError("not-offered", actionId, `device ${deviceId} does not offer ${actionId} (needs cap "${cap}")`, deviceId);
12604
+ }
12555
12605
  //#endregion
12556
12606
  //#region src/capabilities/addon-pages-source.cap.ts
12557
12607
  /**
@@ -17750,6 +17800,12 @@ Object.defineProperty(exports, "UnknownRecordKindError", {
17750
17800
  return UnknownRecordKindError;
17751
17801
  }
17752
17802
  });
17803
+ Object.defineProperty(exports, "VocabActionError", {
17804
+ enumerable: true,
17805
+ get: function() {
17806
+ return VocabActionError;
17807
+ }
17808
+ });
17753
17809
  Object.defineProperty(exports, "WELL_KNOWN_TABS", {
17754
17810
  enumerable: true,
17755
17811
  get: function() {
@@ -17840,6 +17896,12 @@ Object.defineProperty(exports, "asString", {
17840
17896
  return asString;
17841
17897
  }
17842
17898
  });
17899
+ Object.defineProperty(exports, "assertDeviceOffers", {
17900
+ enumerable: true,
17901
+ get: function() {
17902
+ return assertDeviceOffers;
17903
+ }
17904
+ });
17843
17905
  Object.defineProperty(exports, "assertTransactScope", {
17844
17906
  enumerable: true,
17845
17907
  get: function() {
@@ -18734,6 +18796,12 @@ Object.defineProperty(exports, "vocabActionIdFor", {
18734
18796
  return vocabActionIdFor;
18735
18797
  }
18736
18798
  });
18799
+ Object.defineProperty(exports, "vocabCall", {
18800
+ enumerable: true,
18801
+ get: function() {
18802
+ return vocabCall;
18803
+ }
18804
+ });
18737
18805
  Object.defineProperty(exports, "withoutCallerStamp", {
18738
18806
  enumerable: true,
18739
18807
  get: function() {
package/dist/testing.js CHANGED
@@ -53,10 +53,10 @@ function fakeSettings(overrides) {
53
53
  readAddonStore: overrides.readAddonStore ?? (async () => ({})),
54
54
  ...readAddonStoreResult !== void 0 ? { readAddonStoreResult } : {},
55
55
  writeAddonStore: overrides.writeAddonStore ?? unused("settings.writeAddonStore"),
56
- readDeviceStoreBatch: unused("settings.readDeviceStoreBatch"),
56
+ readDeviceStoreBatch: overrides.readDeviceStoreBatch ?? unused("settings.readDeviceStoreBatch"),
57
57
  listDeviceStoreIds: overrides.listDeviceStoreIds ?? unused("settings.listDeviceStoreIds"),
58
- readDeviceStore: unused("settings.readDeviceStore"),
59
- writeDeviceStore: unused("settings.writeDeviceStore"),
58
+ readDeviceStore: overrides.readDeviceStore ?? unused("settings.readDeviceStore"),
59
+ writeDeviceStore: overrides.writeDeviceStore ?? unused("settings.writeDeviceStore"),
60
60
  clearDeviceStore: unused("settings.clearDeviceStore"),
61
61
  getSection: unused("settings.getSection"),
62
62
  setSection: unused("settings.setSection"),
package/dist/testing.mjs CHANGED
@@ -52,10 +52,10 @@ function fakeSettings(overrides) {
52
52
  readAddonStore: overrides.readAddonStore ?? (async () => ({})),
53
53
  ...readAddonStoreResult !== void 0 ? { readAddonStoreResult } : {},
54
54
  writeAddonStore: overrides.writeAddonStore ?? unused("settings.writeAddonStore"),
55
- readDeviceStoreBatch: unused("settings.readDeviceStoreBatch"),
55
+ readDeviceStoreBatch: overrides.readDeviceStoreBatch ?? unused("settings.readDeviceStoreBatch"),
56
56
  listDeviceStoreIds: overrides.listDeviceStoreIds ?? unused("settings.listDeviceStoreIds"),
57
- readDeviceStore: unused("settings.readDeviceStore"),
58
- writeDeviceStore: unused("settings.writeDeviceStore"),
57
+ readDeviceStore: overrides.readDeviceStore ?? unused("settings.readDeviceStore"),
58
+ writeDeviceStore: overrides.writeDeviceStore ?? unused("settings.writeDeviceStore"),
59
59
  clearDeviceStore: unused("settings.clearDeviceStore"),
60
60
  getSection: unused("settings.getSection"),
61
61
  setSection: unused("settings.setSection"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.556",
3
+ "version": "1.2.558",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",