@camstack/types 1.2.561 → 1.2.562

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 (48) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/addon/instances-of-cap.d.ts +7 -2
  3. package/dist/addon.js +2 -2
  4. package/dist/addon.mjs +2 -2
  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/energy-system.cap.d.ts +281 -0
  10. package/dist/capabilities/index.d.ts +4 -2
  11. package/dist/capabilities/integration-instances.cap.d.ts +9 -0
  12. package/dist/capabilities/template.cap.d.ts +39 -2
  13. package/dist/client.js +8 -0
  14. package/dist/client.mjs +8 -0
  15. package/dist/{composed-stable-id-iddnCQ51.mjs → composed-stable-id-B3wcvtvW.mjs} +4 -0
  16. package/dist/{composed-stable-id-BmJ_5GiE.js → composed-stable-id-Bp33yrYi.js} +4 -0
  17. package/dist/device/device-control-resolution.d.ts +1 -1
  18. package/dist/device/device-icon.d.ts +1 -0
  19. package/dist/device/device-type.d.ts +5 -1
  20. package/dist/device/hero/hero-layout.d.ts +1 -0
  21. package/dist/device/hero/hero-look.d.ts +6 -0
  22. package/dist/device/hero/hero-scene.d.ts +1 -0
  23. package/dist/generated/addon-api.d.ts +14 -0
  24. package/dist/generated/addon-cap-facts.d.ts +1 -1
  25. package/dist/generated/cap-status-types.d.ts +3 -1
  26. package/dist/generated/cap-vocabulary.d.ts +1 -1
  27. package/dist/generated/capability-router-map.d.ts +5 -2
  28. package/dist/generated/customize-catalog.d.ts +1 -1
  29. package/dist/generated/device-local-state.d.ts +3 -0
  30. package/dist/generated/device-proxy.d.ts +3 -0
  31. package/dist/generated/device-scoped-caps.d.ts +1 -1
  32. package/dist/generated/history-catalog.d.ts +1 -1
  33. package/dist/generated/method-access-map.d.ts +1 -1
  34. package/dist/generated/method-device-selectors.d.ts +1 -1
  35. package/dist/generated/runtime-state-durability.d.ts +1 -1
  36. package/dist/{implemented-methods-CfaRR_ki.js → implemented-methods-CDYOCn9a.js} +1 -1
  37. package/dist/{implemented-methods-CSTk6zYK.mjs → implemented-methods-CgUBu6uM.mjs} +1 -1
  38. package/dist/index.d.ts +4 -0
  39. package/dist/index.js +1505 -171
  40. package/dist/index.mjs +1458 -172
  41. package/dist/node.js +2 -2
  42. package/dist/node.mjs +2 -2
  43. package/dist/{sleep-CcUFeK6k.js → sleep-Cb2px0Nb.js} +105 -3
  44. package/dist/{sleep-C9PbO6Nb.mjs → sleep-Cykc2bzi.mjs} +105 -3
  45. package/dist/template/automation-template.d.ts +782 -0
  46. package/dist/template/builtin-automation-templates.d.ts +17 -0
  47. package/dist/template/template-kinds.d.ts +4 -3
  48. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.562] - 2026-11-13
11
+
12
+ ### Added
13
+
14
+ - Automation templates: a template kind with typed inputs and bindings, an expansion that fills them in, and instance flagging when a template changes
15
+ - Built-in automation templates ship with CamStack: Buttons → devices, and Motion → light with an off delay
16
+
17
+ ### Changed
18
+
19
+ - An integration kind can declare the other function caps it serves (a Google account also sends mail) and carry its brand icon.
20
+ - 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
21
+
10
22
  ## [1.2.561] - 2026-11-13
11
23
 
12
24
  ### 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-Cb2px0Nb.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.
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-Cykc2bzi.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.
@@ -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>;