@camstack/types 1.2.561 → 1.2.563

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 (60) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/addon/instances-of-cap.d.ts +7 -2
  3. package/dist/addon.js +4 -3
  4. package/dist/addon.mjs +4 -3
  5. package/dist/automation/codegen.d.ts +6 -0
  6. package/dist/automation/recipe-literal.d.ts +35 -0
  7. package/dist/automation/recipe.d.ts +46 -0
  8. package/dist/automation/template-link.d.ts +206 -0
  9. package/dist/capabilities/cluster-update.cap.d.ts +16 -0
  10. package/dist/capabilities/device-manager.cap.d.ts +2 -1
  11. package/dist/capabilities/device-search.d.ts +4 -2
  12. package/dist/capabilities/energy-system.cap.d.ts +281 -0
  13. package/dist/capabilities/index.d.ts +4 -2
  14. package/dist/capabilities/integration-instances.cap.d.ts +9 -0
  15. package/dist/capabilities/notification-rules.cap.d.ts +4 -0
  16. package/dist/capabilities/smtp-provider.cap.d.ts +2 -0
  17. package/dist/capabilities/switch.cap.d.ts +5 -0
  18. package/dist/capabilities/template.cap.d.ts +39 -2
  19. package/dist/client.js +54 -1
  20. package/dist/client.mjs +54 -1
  21. package/dist/{composed-stable-id-iddnCQ51.mjs → composed-stable-id-B3wcvtvW.mjs} +4 -0
  22. package/dist/{composed-stable-id-BmJ_5GiE.js → composed-stable-id-Bp33yrYi.js} +4 -0
  23. package/dist/device/cap-vocabulary/index.d.ts +1 -1
  24. package/dist/device/cap-vocabulary/resolve.d.ts +6 -0
  25. package/dist/device/device-control-resolution.d.ts +1 -1
  26. package/dist/device/device-icon.d.ts +1 -0
  27. package/dist/device/device-type.d.ts +5 -1
  28. package/dist/device/hero/hero-layout.d.ts +1 -0
  29. package/dist/device/hero/hero-look.d.ts +6 -0
  30. package/dist/device/hero/hero-scene.d.ts +1 -0
  31. package/dist/generated/addon-api.d.ts +21 -0
  32. package/dist/generated/addon-cap-facts.d.ts +1 -1
  33. package/dist/generated/cap-status-types.d.ts +3 -1
  34. package/dist/generated/cap-vocabulary.d.ts +1 -1
  35. package/dist/generated/capability-router-map.d.ts +5 -2
  36. package/dist/generated/collection-array-methods.d.ts +1 -1
  37. package/dist/generated/customize-catalog.d.ts +1 -1
  38. package/dist/generated/device-local-state.d.ts +3 -0
  39. package/dist/generated/device-proxy.d.ts +3 -0
  40. package/dist/generated/device-scoped-caps.d.ts +1 -1
  41. package/dist/generated/history-catalog.d.ts +1 -1
  42. package/dist/generated/method-access-map.d.ts +1 -1
  43. package/dist/generated/method-device-selectors.d.ts +2 -2
  44. package/dist/generated/runtime-state-durability.d.ts +1 -1
  45. package/dist/{implemented-methods-CfaRR_ki.js → implemented-methods-CDYOCn9a.js} +1 -1
  46. package/dist/{implemented-methods-CSTk6zYK.mjs → implemented-methods-CgUBu6uM.mjs} +1 -1
  47. package/dist/index.d.ts +7 -1
  48. package/dist/index.js +1889 -209
  49. package/dist/index.mjs +1834 -210
  50. package/dist/node.js +2 -2
  51. package/dist/node.mjs +2 -2
  52. package/dist/notification/degrade-engine.d.ts +5 -0
  53. package/dist/notification/email-image-bytes.d.ts +26 -0
  54. package/dist/notification/email-mime.d.ts +52 -0
  55. package/dist/{sleep-C9PbO6Nb.mjs → sleep-BCWQQG52.mjs} +154 -35
  56. package/dist/{sleep-CcUFeK6k.js → sleep-RUgd-FgK.js} +154 -35
  57. package/dist/template/automation-template.d.ts +782 -0
  58. package/dist/template/builtin-automation-templates.d.ts +17 -0
  59. package/dist/template/template-kinds.d.ts +4 -3
  60. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.563] - 2026-11-13
11
+
12
+ ### Added
13
+
14
+ - Device search can require vocabulary actions, so a command picker lists only devices that offer the command.
15
+ - A switch offers Toggle, which flips it from its current on or off state.
16
+
17
+ ### Changed
18
+
19
+ - Notification templates can use {{headline}}, the subject and the place of a detection.
20
+ - Notification templates can count how many devices or nodes went offline and came back in a summary.
21
+ - A disarm notification can name who disarmed the alarm.
22
+ - Notification history can show the title and body that were sent.
23
+ - Email images travel as peerBytes tickets on smtp-provider.sendEmail.
24
+ - A cluster update can name a server install that stalled or hit its time limit.
25
+
26
+ ## [1.2.562] - 2026-11-13
27
+
28
+ ### Added
29
+
30
+ - Automation templates: a template kind with typed inputs and bindings, an expansion that fills them in, and instance flagging when a template changes
31
+ - Built-in automation templates ship with CamStack: Buttons → devices, and Motion → light with an off delay
32
+
33
+ ### Changed
34
+
35
+ - An integration kind can declare the other function caps it serves (a Google account also sends mail) and carry its brand icon.
36
+ - New Energy system device type and its read-only energy-system capability: solar, grid, house, heat pump and home storage on one model, with history
37
+
10
38
  ## [1.2.561] - 2026-11-13
11
39
 
12
40
  ### Added
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * The instances of a function cap across every provider of `integration-instances` (D1013 rule 5).
3
3
  *
4
- * Every holder describes its kinds; the instances of a kind whose `functionCap` is the asked cap are the
5
- * answer. The hub resolver and an addon reading over `ctx.api` bind the same {@link InstanceSource}, so
4
+ * Every holder describes its kinds; the instances of a kind that serves the asked cap (its `functionCap`,
5
+ * or one it declares in `alsoServes`) are the answer. The hub resolver and an addon reading over `ctx.api` bind the same {@link InstanceSource}, so
6
6
  * there is ONE rule. A holder that cannot answer is reported in `unreadable`, never skipped silently: an
7
7
  * empty list and a failed read are different answers (D315) and a caller that would act on absence
8
8
  * (a dispatcher dropping a rule's target) must be able to tell them apart (D49).
@@ -29,6 +29,11 @@ export interface InstancesOfCapResult {
29
29
  readonly error: string;
30
30
  }[];
31
31
  }
32
+ /**
33
+ * The kind's instances answer for `cap`: it is the kind's `functionCap`, or one the kind declares in
34
+ * `alsoServes`. The one rule a link (a picker, a resolver, a delete guard) matches a target by.
35
+ */
36
+ export declare function kindServesCap(kind: IntegrationInstanceKind, cap: string): boolean;
32
37
  export declare function instancesOfCap(source: InstanceSource, cap: string, filter?: {
33
38
  readonly kind?: string;
34
39
  }): Promise<InstancesOfCapResult>;
package/dist/addon.js CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-CcUFeK6k.js");
2
+ const require_sleep = require("./sleep-RUgd-FgK.js");
3
3
  const require_event_category = require("./event-category-Ps2LC8dN.js");
4
- const require_composed_stable_id = require("./composed-stable-id-BmJ_5GiE.js");
4
+ const require_composed_stable_id = require("./composed-stable-id-Bp33yrYi.js");
5
5
  //#region src/generated/cap-input-defaults.ts
6
6
  /**
7
7
  * AUTO-GENERATED by scripts/generate-cap-input-defaults.ts — DO NOT EDIT.
@@ -453,7 +453,7 @@ function isCollectionArrayMethodName(capName, method) {
453
453
  * Per capability, the methods declared `optionalMethod` — the ones whose
454
454
  * ABSENCE on a provider is a fact about that provider, not a bug.
455
455
  *
456
- * Coverage: 10 caps, 44 methods.
456
+ * Coverage: 11 caps, 45 methods.
457
457
  */
458
458
  var PROVIDER_OPTIONAL_METHODS = Object.freeze({
459
459
  "climate-control": [
@@ -507,6 +507,7 @@ var PROVIDER_OPTIONAL_METHODS = Object.freeze({
507
507
  "volumeDown",
508
508
  "volumeUp"
509
509
  ],
510
+ "switch": ["toggle"],
510
511
  "valve": ["setPosition"],
511
512
  "videoclips": [
512
513
  "dialClipStream",
package/dist/addon.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { $ as DEVICE_CHILDREN_BATCH_MAX, $n as isZodSecret, $r as recordSecretRef, A as CAP_ADVANCE_FIELDS, Ai as InvalidRecordError, An as PEER_BYTES_CHUNK_BYTES, Bi as TransactRefusedError, Bn as entryBody, Cn as MIN_SCRUBBED_LENGTH, Da as findMigrationsBlocked, Di as DeclarationRefusedError, Dn as registerKnownSecret, Ea as AddonMigrationsBlockedError, Ei as BatchTooLargeError, En as knownSecretCount, Et as createDebugEmitter, F as withoutCallerStamp, Fi as RecordSecretUnavailableError, Fn as CALLER_USERNAME_HEADER, Fr as nodeIdOfScopedKey, G as readNodePin, Gn as RecordKindNameSchema, H as commandOrigin, Hi as UnknownRecordKindError, Hn as RecordFieldPathSchema, I as customAction, Ii as RecordTooLargeError, In as DATAPLANE_SECRET_HEADER, Ir as resolveDeviceSettings, J as PipelineRunResultBridge, Jn as assertValidDeclaration, Jr as collectSecretLeaves, Kn as RecordRetentionSchema, Kr as secretViewsOf, L as defineCustomActions, Li as RecordUniqueViolationError, Lr as resolvedValues, Mi as PlaintextSecretError, Mn as PEER_BYTES_STALL_MS, N as CAP_STATE_LEAVES, Ni as RECORDS_ERROR_CODES, Nn as PEER_BYTES_TICKET_TTL_MS, O as HF_REPO, Oi as FilterRequiredError, On as scrubKnownSecrets, P as CALLER_STAMPED_CAPABILITIES, Pi as RecordNotFoundError, Pr as SCOPED_SETTINGS_SCOPES, Q as deviceOpsCapability, Qn as collectZodSecretPaths, Qr as recordSecretCollection, R as describeCustomActions, Ri as RecordsError, Rn as DisposerChain, Si as parseSecretRef, Sn as createSecretsAccess, T as isCommand, Tn as forgetKnownSecret, U as nodePin, Ui as asRecordsError, Un as RecordIndexSchema, Vi as UnindexedFilterError, Vn as EntryDescriptorSchema, W as readCommandOrigin, Wi as recordsErrorFromMessage, Wn as RecordKindDeclarationSchema, X as MIGRATION_API_VERSION, Xn as defineRecordKinds, Xr as parseSecretPath, Y as PipelineStepInputSchema, Yn as declarationsOf, Yr as mapSecretLeaves, Zr as recordArrayItemPath, _a as makeSecretMarker, _i as buildSecretRef, _n as makeInMemoryRecords, ai as RECORD_DEFAULT_MAX_DATA_BYTES, bi as isSecretRef, bn as resolveSecretViewsIn, c as asString, ci as RECORD_MAX_DATA_BYTES, d as parseJsonUnknown, da as SECRET_CLEAR, di as RECORD_QUERY_MAX, ea as createEvent, ei as secretArrayPrefixes, et as adminUiCapability, f as hfModelUrl, fa as classifySecretWrite, fi as RECORD_SECRET_COLLECTION_PREFIX, g as createDeviceProxy, ga as isSecretMarkerLike, gi as arrayItemFieldPath, gn as ruleFireOfClaim, gr as ErrorI18nPayloadSchema, h as isDeviceScopedCap, ha as isSecretMarker, hi as SECRET_REF_SCHEME, hn as RuleFireOriginSchema, ht as ReadinessTimeoutError, ii as RECORD_DATABASES, j as CAP_METHOD_TIMEOUTS_MS, ji as NoCallerError, jn as PEER_BYTES_MAX_OUTSTANDING, ki as ForeignSecretMarkerError, kn as shortSecretRefHash, li as RECORD_MAX_INDEXES, m as DEVICE_SCOPED_CAPS, ma as isSecretFieldView, mi as RECORD_SWEEP_INTERVAL_MS, mn as CommandOriginClaimSchema, mt as ReadinessRegistry, ni as RECORD_BATCH_MAX_BYTES, nt as addonPagesSourceCapability, o as asJsonObject, oi as RECORD_DELETE_BATCH, p as BOOT_RECOVERY_BACKOFF_MS, pa as isSecretClear, pi as RECORD_SETTINGS_MAX_ROWS, pt as MODEL_FORMATS, q as viewerUiCapability, qn as StoredRecordKindDeclarationSchema, qr as REMOVE_LEAF, r as maskUrlCredentials, ri as RECORD_CLASSES, si as RECORD_ID_MAX_LENGTH, sr as expandCapMethods, t as sleep, ta as emitReadiness, ti as RECORD_BATCH_MAX, ui as RECORD_MAX_INDEX_FIELDS, v as addonSliceHandleApi, va as toSecretFieldView, vi as formatSecretScope, vn as createRecordsAccess, vt as scopeKey, wn as clearKnownSecrets, wr as normalizeAddonInitResult, xi as normalizeSecretOwner, xn as REVALIDATE_AFTER_MS, xr as BaseAddon, y as createEventBusSliceSource, yi as globalSecretScope, yn as assertTransactScope, yr as readErrorI18n, zi as RevConflictError, zn as defineEntryKind } from "./sleep-C9PbO6Nb.mjs";
1
+ import { $ as DEVICE_CHILDREN_BATCH_MAX, $n as isZodSecret, $r as recordSecretRef, A as CAP_ADVANCE_FIELDS, Ai as InvalidRecordError, An as PEER_BYTES_CHUNK_BYTES, Bi as TransactRefusedError, Bn as entryBody, Cn as MIN_SCRUBBED_LENGTH, Da as findMigrationsBlocked, Di as DeclarationRefusedError, Dn as registerKnownSecret, Ea as AddonMigrationsBlockedError, Ei as BatchTooLargeError, En as knownSecretCount, Et as createDebugEmitter, F as withoutCallerStamp, Fi as RecordSecretUnavailableError, Fn as CALLER_USERNAME_HEADER, Fr as nodeIdOfScopedKey, G as readNodePin, Gn as RecordKindNameSchema, H as commandOrigin, Hi as UnknownRecordKindError, Hn as RecordFieldPathSchema, I as customAction, Ii as RecordTooLargeError, In as DATAPLANE_SECRET_HEADER, Ir as resolveDeviceSettings, J as PipelineRunResultBridge, Jn as assertValidDeclaration, Jr as collectSecretLeaves, Kn as RecordRetentionSchema, Kr as secretViewsOf, L as defineCustomActions, Li as RecordUniqueViolationError, Lr as resolvedValues, Mi as PlaintextSecretError, Mn as PEER_BYTES_STALL_MS, N as CAP_STATE_LEAVES, Ni as RECORDS_ERROR_CODES, Nn as PEER_BYTES_TICKET_TTL_MS, O as HF_REPO, Oi as FilterRequiredError, On as scrubKnownSecrets, P as CALLER_STAMPED_CAPABILITIES, Pi as RecordNotFoundError, Pr as SCOPED_SETTINGS_SCOPES, Q as deviceOpsCapability, Qn as collectZodSecretPaths, Qr as recordSecretCollection, R as describeCustomActions, Ri as RecordsError, Rn as DisposerChain, Si as parseSecretRef, Sn as createSecretsAccess, T as isCommand, Tn as forgetKnownSecret, U as nodePin, Ui as asRecordsError, Un as RecordIndexSchema, Vi as UnindexedFilterError, Vn as EntryDescriptorSchema, W as readCommandOrigin, Wi as recordsErrorFromMessage, Wn as RecordKindDeclarationSchema, X as MIGRATION_API_VERSION, Xn as defineRecordKinds, Xr as parseSecretPath, Y as PipelineStepInputSchema, Yn as declarationsOf, Yr as mapSecretLeaves, Zr as recordArrayItemPath, _a as makeSecretMarker, _i as buildSecretRef, _n as makeInMemoryRecords, ai as RECORD_DEFAULT_MAX_DATA_BYTES, bi as isSecretRef, bn as resolveSecretViewsIn, c as asString, ci as RECORD_MAX_DATA_BYTES, d as parseJsonUnknown, da as SECRET_CLEAR, di as RECORD_QUERY_MAX, ea as createEvent, ei as secretArrayPrefixes, et as adminUiCapability, f as hfModelUrl, fa as classifySecretWrite, fi as RECORD_SECRET_COLLECTION_PREFIX, g as createDeviceProxy, ga as isSecretMarkerLike, gi as arrayItemFieldPath, gn as ruleFireOfClaim, gr as ErrorI18nPayloadSchema, h as isDeviceScopedCap, ha as isSecretMarker, hi as SECRET_REF_SCHEME, hn as RuleFireOriginSchema, ht as ReadinessTimeoutError, ii as RECORD_DATABASES, j as CAP_METHOD_TIMEOUTS_MS, ji as NoCallerError, jn as PEER_BYTES_MAX_OUTSTANDING, ki as ForeignSecretMarkerError, kn as shortSecretRefHash, li as RECORD_MAX_INDEXES, m as DEVICE_SCOPED_CAPS, ma as isSecretFieldView, mi as RECORD_SWEEP_INTERVAL_MS, mn as CommandOriginClaimSchema, mt as ReadinessRegistry, ni as RECORD_BATCH_MAX_BYTES, nt as addonPagesSourceCapability, o as asJsonObject, oi as RECORD_DELETE_BATCH, p as BOOT_RECOVERY_BACKOFF_MS, pa as isSecretClear, pi as RECORD_SETTINGS_MAX_ROWS, pt as MODEL_FORMATS, q as viewerUiCapability, qn as StoredRecordKindDeclarationSchema, qr as REMOVE_LEAF, r as maskUrlCredentials, ri as RECORD_CLASSES, si as RECORD_ID_MAX_LENGTH, sr as expandCapMethods, t as sleep, ta as emitReadiness, ti as RECORD_BATCH_MAX, ui as RECORD_MAX_INDEX_FIELDS, v as addonSliceHandleApi, va as toSecretFieldView, vi as formatSecretScope, vn as createRecordsAccess, vt as scopeKey, wn as clearKnownSecrets, wr as normalizeAddonInitResult, xi as normalizeSecretOwner, xn as REVALIDATE_AFTER_MS, xr as BaseAddon, y as createEventBusSliceSource, yi as globalSecretScope, yn as assertTransactScope, yr as readErrorI18n, zi as RevConflictError, zn as defineEntryKind } from "./sleep-BCWQQG52.mjs";
2
2
  import { t as EventCategory } from "./event-category-Dv-Gcv1f.mjs";
3
- import { a as DeviceType, s as errMsg, t as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./composed-stable-id-iddnCQ51.mjs";
3
+ import { a as DeviceType, s as errMsg, t as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./composed-stable-id-B3wcvtvW.mjs";
4
4
  //#region src/generated/cap-input-defaults.ts
5
5
  /**
6
6
  * AUTO-GENERATED by scripts/generate-cap-input-defaults.ts — DO NOT EDIT.
@@ -452,7 +452,7 @@ function isCollectionArrayMethodName(capName, method) {
452
452
  * Per capability, the methods declared `optionalMethod` — the ones whose
453
453
  * ABSENCE on a provider is a fact about that provider, not a bug.
454
454
  *
455
- * Coverage: 10 caps, 44 methods.
455
+ * Coverage: 11 caps, 45 methods.
456
456
  */
457
457
  var PROVIDER_OPTIONAL_METHODS = Object.freeze({
458
458
  "climate-control": [
@@ -506,6 +506,7 @@ var PROVIDER_OPTIONAL_METHODS = Object.freeze({
506
506
  "volumeDown",
507
507
  "volumeUp"
508
508
  ],
509
+ "switch": ["toggle"],
509
510
  "valve": ["setPosition"],
510
511
  "videoclips": [
511
512
  "dialClipStream",
@@ -36,4 +36,10 @@ export interface GenerateAutomationBlockInput {
36
36
  * discover that, but it is the last place it can still be caught before code
37
37
  * that the operator did not author starts running.
38
38
  */
39
+ /**
40
+ * An instance of an automation template (#527) also carries the fingerprint of
41
+ * the code it was generated as (`template.codeHash`), so the hub can tell a
42
+ * block edited by hand from one it may regenerate. The fingerprint blanks the
43
+ * literal, so stamping it does not change it.
44
+ */
39
45
  export declare function generateAutomationBlock(input: GenerateAutomationBlockInput): string;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Reads the `AUTOMATION_RECIPE` literal `generateAutomationBlock` embeds in a
3
+ * block's code — parsed as JSON, never evaluated — for code that runs where the
4
+ * admin UI's reader does not (the hub re-expanding template instances, #527).
5
+ *
6
+ * A brace scan, not a regex: the recipe nests. Strings are tracked so a `}`
7
+ * inside a device name cannot close the object early; the value is
8
+ * `JSON.stringify` output, so `"` is the only quote that can open one.
9
+ */
10
+ import { type AutomationRecipe } from './recipe.js';
11
+ /** The declaration the generator emits, matched whole. */
12
+ export declare const AUTOMATION_RECIPE_DECLARATION = "const AUTOMATION_RECIPE =";
13
+ export type RecipeLiteralRead = {
14
+ readonly status: 'recipe';
15
+ readonly recipe: AutomationRecipe;
16
+ }
17
+ /** The code carries no recipe: a hand-written script. */
18
+ | {
19
+ readonly status: 'none';
20
+ }
21
+ /** It carries one that is not JSON or not a recipe. */
22
+ | {
23
+ readonly status: 'invalid';
24
+ readonly detail: string;
25
+ };
26
+ /** The JSON text of the literal, or null when the code declares none. */
27
+ export declare function findRecipeLiteralJson(code: string): string | null;
28
+ export declare function readRecipeLiteral(code: string): RecipeLiteralRead;
29
+ /**
30
+ * The fingerprint of a block's code with its recipe literal blanked, so the
31
+ * hash a literal carries does not change the hash. Null when there is no literal.
32
+ */
33
+ export declare function instanceCodeHash(code: string): string | null;
34
+ /** The same code with only its recipe literal replaced; everything else is kept byte for byte. */
35
+ export declare function replaceRecipeLiteral(code: string, recipe: AutomationRecipe): string | null;
@@ -8431,6 +8431,52 @@ export declare const CurrentAutomationRecipeSchema: z.ZodObject<{
8431
8431
  minutes: z.ZodNumber;
8432
8432
  }, z.core.$strip>], "mode">>;
8433
8433
  keepTraces: z.ZodOptional<z.ZodNumber>;
8434
+ template: z.ZodOptional<z.ZodObject<{
8435
+ templateId: z.ZodString;
8436
+ values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodObject<{
8437
+ eventIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
8438
+ sourceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
8439
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
8440
+ "double-press": "double-press";
8441
+ "long-press": "long-press";
8442
+ "long-press-start": "long-press-start";
8443
+ other: "other";
8444
+ press: "press";
8445
+ release: "release";
8446
+ repeat: "repeat";
8447
+ }>>>;
8448
+ }, z.core.$strip>, z.ZodObject<{
8449
+ actionId: z.ZodString;
8450
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
8451
+ }, z.core.$strip>]>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodObject<{
8452
+ eventIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
8453
+ sourceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
8454
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
8455
+ "double-press": "double-press";
8456
+ "long-press": "long-press";
8457
+ "long-press-start": "long-press-start";
8458
+ other: "other";
8459
+ press: "press";
8460
+ release: "release";
8461
+ repeat: "repeat";
8462
+ }>>>;
8463
+ }, z.core.$strip>, z.ZodObject<{
8464
+ actionId: z.ZodString;
8465
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
8466
+ }, z.core.$strip>]>>>]>>;
8467
+ codeHash: z.ZodOptional<z.ZodString>;
8468
+ problems: z.ZodOptional<z.ZodArray<z.ZodObject<{
8469
+ code: z.ZodEnum<{
8470
+ "edited-by-hand": "edited-by-hand";
8471
+ "invalid-input": "invalid-input";
8472
+ "invalid-recipe": "invalid-recipe";
8473
+ "missing-input": "missing-input";
8474
+ "missing-template": "missing-template";
8475
+ }>;
8476
+ input: z.ZodOptional<z.ZodString>;
8477
+ detail: z.ZodString;
8478
+ }, z.core.$strip>>>;
8479
+ }, z.core.$strip>>;
8434
8480
  }, z.core.$strip>;
8435
8481
  /**
8436
8482
  * Declared as an interface so it is printed by NAME: a capability that embeds
@@ -0,0 +1,206 @@
1
+ /**
2
+ * The link an automation made FROM a template carries (#527): which template,
3
+ * the values the operator filled in, and — when the template has since changed
4
+ * so that those values no longer fit — the problems that say why.
5
+ *
6
+ * It lives inside the recipe (`AutomationRecipe.template`), so the one row in
7
+ * `core_blocks` stays the one artefact: there is no second store of instances
8
+ * to drift from the blocks, and deleting the automation deletes the link.
9
+ * "Convert to a free automation" is dropping this field.
10
+ *
11
+ * This file depends on nothing in `recipe.ts`, so the recipe can embed it and
12
+ * the template engine (`template/automation-template.ts`) can import both.
13
+ */
14
+ import { z } from 'zod';
15
+ /** An `event` input's value: the same three narrowing lists a `device-fired` row takes. */
16
+ export declare const TemplateEventValueSchema: z.ZodObject<{
17
+ eventIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
18
+ sourceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
20
+ "double-press": "double-press";
21
+ "long-press": "long-press";
22
+ "long-press-start": "long-press-start";
23
+ other: "other";
24
+ press: "press";
25
+ release: "release";
26
+ repeat: "repeat";
27
+ }>>>;
28
+ }, z.core.$strip>;
29
+ export type TemplateEventValue = z.infer<typeof TemplateEventValueSchema>;
30
+ /** An `action` input's value: a vocabulary action and its open args. */
31
+ export declare const TemplateActionValueSchema: z.ZodObject<{
32
+ actionId: z.ZodString;
33
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
34
+ }, z.core.$strip>;
35
+ export type TemplateActionValue = z.infer<typeof TemplateActionValueSchema>;
36
+ /** The value of one non-group input. Which member is right is the input kind's to judge. */
37
+ export declare const TemplateScalarValueSchema: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodObject<{
38
+ eventIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
39
+ sourceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
40
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
41
+ "double-press": "double-press";
42
+ "long-press": "long-press";
43
+ "long-press-start": "long-press-start";
44
+ other: "other";
45
+ press: "press";
46
+ release: "release";
47
+ repeat: "repeat";
48
+ }>>>;
49
+ }, z.core.$strip>, z.ZodObject<{
50
+ actionId: z.ZodString;
51
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
52
+ }, z.core.$strip>]>;
53
+ export type TemplateScalarValue = z.infer<typeof TemplateScalarValueSchema>;
54
+ /** One row of a repeatable group: row-input key → value. */
55
+ export declare const TemplateGroupRowSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodObject<{
56
+ eventIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
57
+ sourceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
58
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
59
+ "double-press": "double-press";
60
+ "long-press": "long-press";
61
+ "long-press-start": "long-press-start";
62
+ other: "other";
63
+ press: "press";
64
+ release: "release";
65
+ repeat: "repeat";
66
+ }>>>;
67
+ }, z.core.$strip>, z.ZodObject<{
68
+ actionId: z.ZodString;
69
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
70
+ }, z.core.$strip>]>>;
71
+ export type TemplateGroupRow = z.infer<typeof TemplateGroupRowSchema>;
72
+ export declare const TemplateInputValueSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodObject<{
73
+ eventIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
74
+ sourceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
75
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
76
+ "double-press": "double-press";
77
+ "long-press": "long-press";
78
+ "long-press-start": "long-press-start";
79
+ other: "other";
80
+ press: "press";
81
+ release: "release";
82
+ repeat: "repeat";
83
+ }>>>;
84
+ }, z.core.$strip>, z.ZodObject<{
85
+ actionId: z.ZodString;
86
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
87
+ }, z.core.$strip>]>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodObject<{
88
+ eventIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
89
+ sourceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
90
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
91
+ "double-press": "double-press";
92
+ "long-press": "long-press";
93
+ "long-press-start": "long-press-start";
94
+ other: "other";
95
+ press: "press";
96
+ release: "release";
97
+ repeat: "repeat";
98
+ }>>>;
99
+ }, z.core.$strip>, z.ZodObject<{
100
+ actionId: z.ZodString;
101
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
102
+ }, z.core.$strip>]>>>]>;
103
+ export type TemplateInputValue = z.infer<typeof TemplateInputValueSchema>;
104
+ /** Input key → value. */
105
+ export declare const TemplateInputValuesSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodObject<{
106
+ eventIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
107
+ sourceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
108
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
109
+ "double-press": "double-press";
110
+ "long-press": "long-press";
111
+ "long-press-start": "long-press-start";
112
+ other: "other";
113
+ press: "press";
114
+ release: "release";
115
+ repeat: "repeat";
116
+ }>>>;
117
+ }, z.core.$strip>, z.ZodObject<{
118
+ actionId: z.ZodString;
119
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
120
+ }, z.core.$strip>]>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodObject<{
121
+ eventIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
122
+ sourceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
123
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
124
+ "double-press": "double-press";
125
+ "long-press": "long-press";
126
+ "long-press-start": "long-press-start";
127
+ other: "other";
128
+ press: "press";
129
+ release: "release";
130
+ repeat: "repeat";
131
+ }>>>;
132
+ }, z.core.$strip>, z.ZodObject<{
133
+ actionId: z.ZodString;
134
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
135
+ }, z.core.$strip>]>>>]>>;
136
+ export type TemplateInputValues = z.infer<typeof TemplateInputValuesSchema>;
137
+ export declare const TEMPLATE_INSTANCE_PROBLEM_CODES: readonly [
138
+ /** A required input has no value. */
139
+ 'missing-input',
140
+ /** A value the input's kind or bounds refuse. */
141
+ 'invalid-input',
142
+ /** The expansion is not a valid automation. */
143
+ 'invalid-recipe',
144
+ /** The template the instance points at is gone. */
145
+ 'missing-template',
146
+ /** The code was changed outside the generator: it is no longer re-expanded. */
147
+ 'edited-by-hand'];
148
+ export declare const TemplateInstanceProblemSchema: z.ZodObject<{
149
+ code: z.ZodEnum<{
150
+ "edited-by-hand": "edited-by-hand";
151
+ "invalid-input": "invalid-input";
152
+ "invalid-recipe": "invalid-recipe";
153
+ "missing-input": "missing-input";
154
+ "missing-template": "missing-template";
155
+ }>;
156
+ input: z.ZodOptional<z.ZodString>;
157
+ detail: z.ZodString;
158
+ }, z.core.$strip>;
159
+ export type TemplateInstanceProblem = z.infer<typeof TemplateInstanceProblemSchema>;
160
+ export declare const AutomationTemplateLinkSchema: z.ZodObject<{
161
+ templateId: z.ZodString;
162
+ values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodObject<{
163
+ eventIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
164
+ sourceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
165
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
166
+ "double-press": "double-press";
167
+ "long-press": "long-press";
168
+ "long-press-start": "long-press-start";
169
+ other: "other";
170
+ press: "press";
171
+ release: "release";
172
+ repeat: "repeat";
173
+ }>>>;
174
+ }, z.core.$strip>, z.ZodObject<{
175
+ actionId: z.ZodString;
176
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
177
+ }, z.core.$strip>]>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodNumber>, z.ZodObject<{
178
+ eventIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
179
+ sourceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
180
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
181
+ "double-press": "double-press";
182
+ "long-press": "long-press";
183
+ "long-press-start": "long-press-start";
184
+ other: "other";
185
+ press: "press";
186
+ release: "release";
187
+ repeat: "repeat";
188
+ }>>>;
189
+ }, z.core.$strip>, z.ZodObject<{
190
+ actionId: z.ZodString;
191
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
192
+ }, z.core.$strip>]>>>]>>;
193
+ codeHash: z.ZodOptional<z.ZodString>;
194
+ problems: z.ZodOptional<z.ZodArray<z.ZodObject<{
195
+ code: z.ZodEnum<{
196
+ "edited-by-hand": "edited-by-hand";
197
+ "invalid-input": "invalid-input";
198
+ "invalid-recipe": "invalid-recipe";
199
+ "missing-input": "missing-input";
200
+ "missing-template": "missing-template";
201
+ }>;
202
+ input: z.ZodOptional<z.ZodString>;
203
+ detail: z.ZodString;
204
+ }, z.core.$strip>>>;
205
+ }, z.core.$strip>;
206
+ export type AutomationTemplateLink = z.infer<typeof AutomationTemplateLinkSchema>;
@@ -55,6 +55,8 @@ declare const ClusterUpdateFailureReasonSchema: z.ZodEnum<{
55
55
  "server-not-on-target": "server-not-on-target";
56
56
  "server-refused": "server-refused";
57
57
  "status-unreadable": "status-unreadable";
58
+ "timeout-ceiling": "timeout-ceiling";
59
+ "timeout-stall": "timeout-stall";
58
60
  }>;
59
61
  declare const ClusterUpdateStepSchema: z.ZodObject<{
60
62
  kind: z.ZodEnum<{
@@ -82,6 +84,8 @@ declare const ClusterUpdateStepSchema: z.ZodObject<{
82
84
  "server-not-on-target": "server-not-on-target";
83
85
  "server-refused": "server-refused";
84
86
  "status-unreadable": "status-unreadable";
87
+ "timeout-ceiling": "timeout-ceiling";
88
+ "timeout-stall": "timeout-stall";
85
89
  }>>;
86
90
  fromVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
87
91
  packages: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
@@ -130,6 +134,8 @@ declare const ClusterUpdateJobSchema: z.ZodObject<{
130
134
  "server-not-on-target": "server-not-on-target";
131
135
  "server-refused": "server-refused";
132
136
  "status-unreadable": "status-unreadable";
137
+ "timeout-ceiling": "timeout-ceiling";
138
+ "timeout-stall": "timeout-stall";
133
139
  }>>;
134
140
  fromVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
135
141
  packages: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
@@ -147,6 +153,8 @@ declare const ClusterUpdateJobSchema: z.ZodObject<{
147
153
  "server-not-on-target": "server-not-on-target";
148
154
  "server-refused": "server-refused";
149
155
  "status-unreadable": "status-unreadable";
156
+ "timeout-ceiling": "timeout-ceiling";
157
+ "timeout-stall": "timeout-stall";
150
158
  }>>;
151
159
  skippedOffline: z.ZodReadonly<z.ZodArray<z.ZodString>>;
152
160
  }, z.core.$strip>;
@@ -191,6 +199,8 @@ declare const ClusterUpdatePlanSchema: z.ZodObject<{
191
199
  "server-not-on-target": "server-not-on-target";
192
200
  "server-refused": "server-refused";
193
201
  "status-unreadable": "status-unreadable";
202
+ "timeout-ceiling": "timeout-ceiling";
203
+ "timeout-stall": "timeout-stall";
194
204
  }>>;
195
205
  fromVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
196
206
  packages: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
@@ -257,6 +267,8 @@ export declare const clusterUpdateCapability: {
257
267
  "server-not-on-target": "server-not-on-target";
258
268
  "server-refused": "server-refused";
259
269
  "status-unreadable": "status-unreadable";
270
+ "timeout-ceiling": "timeout-ceiling";
271
+ "timeout-stall": "timeout-stall";
260
272
  }>>;
261
273
  fromVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
262
274
  packages: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
@@ -337,6 +349,8 @@ export declare const clusterUpdateCapability: {
337
349
  "server-not-on-target": "server-not-on-target";
338
350
  "server-refused": "server-refused";
339
351
  "status-unreadable": "status-unreadable";
352
+ "timeout-ceiling": "timeout-ceiling";
353
+ "timeout-stall": "timeout-stall";
340
354
  }>>;
341
355
  fromVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
342
356
  packages: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
@@ -354,6 +368,8 @@ export declare const clusterUpdateCapability: {
354
368
  "server-not-on-target": "server-not-on-target";
355
369
  "server-refused": "server-refused";
356
370
  "status-unreadable": "status-unreadable";
371
+ "timeout-ceiling": "timeout-ceiling";
372
+ "timeout-stall": "timeout-stall";
357
373
  }>>;
358
374
  skippedOffline: z.ZodReadonly<z.ZodArray<z.ZodString>>;
359
375
  }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
@@ -1180,7 +1180,8 @@ export declare const deviceManagerCapability: {
1180
1180
  readonly search: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
1181
1181
  text: z.ZodOptional<z.ZodString>;
1182
1182
  requires: z.ZodOptional<z.ZodObject<{
1183
- caps: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1183
+ caps: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1184
+ actions: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1184
1185
  mode: z.ZodOptional<z.ZodEnum<{
1185
1186
  all: "all";
1186
1187
  any: "any";
@@ -14,7 +14,8 @@ import { DeviceType } from '../device/device-type.js';
14
14
  export declare const DEVICE_SEARCH_DEFAULT_LIMIT = 50;
15
15
  export declare const DEVICE_SEARCH_MAX_LIMIT = 200;
16
16
  export declare const DeviceSearchRequiresSchema: z.ZodObject<{
17
- caps: z.ZodReadonly<z.ZodArray<z.ZodString>>;
17
+ caps: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
18
+ actions: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
18
19
  mode: z.ZodOptional<z.ZodEnum<{
19
20
  all: "all";
20
21
  any: "any";
@@ -30,7 +31,8 @@ export type DeviceSearchFilters = z.infer<typeof DeviceSearchFiltersSchema>;
30
31
  export declare const DeviceSearchInputSchema: z.ZodObject<{
31
32
  text: z.ZodOptional<z.ZodString>;
32
33
  requires: z.ZodOptional<z.ZodObject<{
33
- caps: z.ZodReadonly<z.ZodArray<z.ZodString>>;
34
+ caps: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
35
+ actions: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
34
36
  mode: z.ZodOptional<z.ZodEnum<{
35
37
  all: "all";
36
38
  any: "any";