@camstack/types 1.2.549 → 1.2.550

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.550] - 2026-11-12
11
+
12
+ ### Added
13
+
14
+ - Automations gain a stop step, a set-variables step and "continue if this step fails"; a wait in an automation or an action may last up to one hour, a wait in a scheduler point still at most five minutes
15
+ - Automations: a `choose` step runs the first branch whose condition is true (up to 6 branches, optional otherwise list); a branch that cannot be read runs nothing
16
+ - Automations: a `wait-until` step pauses a run until a condition is true, under a mandatory timeout of at most six hours; on timeout the run goes on (step traced `timed-out`) or stops as a failure
17
+ - Automations: a parallel step starts two to five device commands, actions or waits together and waits for all of them
18
+ - Automations: a repeat step runs its steps a number of times, while or until a condition (with a mandatory maximum), or once per device
19
+ - Automations: a choose or repeat step may hold one more level of choose, repeat, parallel and wait-until steps; a third level is refused at save
20
+ - An event device declares its events as a vocabulary: a label, a shared kind (press, long press, release…) and, on a multi-button device, the button each event comes from
21
+ - Event names that many integrations share for a button are recognised by convention
22
+ - Automations: a 'device fired' trigger row runs on one button and one kind of press of a remote, once per press, and hands the button and the press to the steps
23
+ - An addon route can be declared per instance: the hub serves it at /addon/<addonId>/instances/<instanceId>/<path>, and the address without an instance stays the default one
24
+ - An account can be linked to one instance of an integration: /api/oauth2/authorize takes instance= beside integration=, and the link, its tokens and oauthVerifyAccessToken name the instance
25
+
26
+ ### Changed
27
+
28
+ - A schema device-select filter's clauses must all hold, and suggestLocation is gone (the picker suggests the host's room)
29
+ - A template with a dotted name in saved step text, such as {{vars.a.b}}, now resolves to the variable of that name (or to nothing when it is not set) instead of staying as literal text
30
+
10
31
  ## [1.2.549] - 2026-11-11
11
32
 
12
33
  ### Changed
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The integration instance of an addon, as it appears in an address or on an
3
+ * OAuth link (planning#415, D1046).
4
+ *
5
+ * The DEFAULT instance has two spellings on the wire and one in the code: a
6
+ * path with no instance segment and a link with no instance both mean it, and
7
+ * its id is the addon id. {@link oauthLinkServesInstance} is the one
8
+ * comparison a per-instance route is meant to call, so nobody compares
9
+ * `undefined` with an id. Nothing calls it yet: no route declares
10
+ * `perInstance` (the Alexa per-instance route, T3, is the first consumer).
11
+ */
12
+ export declare function isAddonInstanceId(value: string): boolean;
13
+ /** What a verified OAuth link says about its instance: the id, or nothing for the default one. */
14
+ export interface OauthLinkInstance {
15
+ readonly instanceId?: string | null;
16
+ }
17
+ /** The instance a link was made for, with the default one spelled as the addon id. */
18
+ export declare function oauthLinkInstanceId(link: OauthLinkInstance, addonId: string): string;
19
+ /**
20
+ * True when a verified link may be used on a request addressed to
21
+ * `requestInstanceId` (`AddonHttpRequest.instanceId`, absent on a route that
22
+ * is not per-instance, which is the default instance).
23
+ */
24
+ export declare function oauthLinkServesInstance(link: OauthLinkInstance, requestInstanceId: string | undefined, addonId: string): boolean;
@@ -11,6 +11,8 @@ export interface AddonRouteInvokeRequest {
11
11
  readonly query: Record<string, string>;
12
12
  readonly body: unknown;
13
13
  readonly headers: Record<string, string>;
14
+ /** The instance the hub resolved for a `perInstance` route. */
15
+ readonly instanceId?: string;
14
16
  readonly user?: {
15
17
  readonly id: string;
16
18
  readonly username: string;
package/dist/addon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-LFKpQ2_f.js");
2
+ const require_sleep = require("./sleep-dcR4vBFG.js");
3
3
  const require_event_category = require("./event-category-BC4RRerT.js");
4
4
  const require_composed_stable_id = require("./composed-stable-id-CDNLq7Y8.js");
5
5
  //#region src/generated/cap-input-defaults.ts
package/dist/addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as DEVICE_CHILDREN_BATCH_MAX, $r as RECORD_DATABASES, A as CAP_ADVANCE_FIELDS, Ai as RecordSecretUnavailableError, An as CALLER_USERNAME_HEADER, Ar as nodeIdOfScopedKey, Bn as RecordKindNameSchema, Ci as FilterRequiredError, Cn as scrubKnownSecrets, Ct as createDebugEmitter, Di as PlaintextSecretError, Dn as PEER_BYTES_STALL_MS, Ei as NoCallerError, En as PEER_BYTES_MAX_OUTSTANDING, F as withoutCallerStamp, Fi as TransactRefusedError, Fn as entryBody, G as readNodePin, Gn as defineRecordKinds, Gr as parseSecretPath, H as commandOrigin, Hn as StoredRecordKindDeclarationSchema, Hr as REMOVE_LEAF, I as customAction, Ii as UnindexedFilterError, In as EntryDescriptorSchema, J as PipelineRunResultBridge, Jn as isZodSecret, Jr as recordSecretRef, Kr as recordArrayItemPath, L as defineCustomActions, Li as UnknownRecordKindError, Ln as RecordFieldPathSchema, Mi as RecordUniqueViolationError, Mr as resolvedValues, N as CAP_STATE_LEAVES, Ni as RecordsError, Nn as DisposerChain, O as HF_REPO, Oi as RECORDS_ERROR_CODES, On as PEER_BYTES_TICKET_TTL_MS, P as CALLER_STAMPED_CAPABILITIES, Pi as RevConflictError, Pn as defineEntryKind, Q as deviceOpsCapability, Qr as RECORD_CLASSES, R as describeCustomActions, Ri as asRecordsError, Rn as RecordIndexSchema, Sa as findMigrationsBlocked, Si as DeclarationRefusedError, Sn as registerKnownSecret, T as isCommand, Ti as InvalidRecordError, Tn as PEER_BYTES_CHUNK_BYTES, U as nodePin, Un as assertValidDeclaration, Ur as collectSecretLeaves, Vn as RecordRetentionSchema, Vr as secretViewsOf, W as readCommandOrigin, Wn as declarationsOf, Wr as mapSecretLeaves, X as MIGRATION_API_VERSION, Xi as emitReadiness, Xr as RECORD_BATCH_MAX, Y as PipelineStepInputSchema, Yi as createEvent, Yr as secretArrayPrefixes, Zr as RECORD_BATCH_MAX_BYTES, _i as parseSecretRef, _n as createSecretsAccess, ai as RECORD_MAX_INDEX_FIELDS, bn as forgetKnownSecret, c as asString, ca as isSecretClear, ci as RECORD_SETTINGS_MAX_ROWS, d as parseJsonUnknown, da as isSecretMarkerLike, di as arrayItemFieldPath, dn as ruleFireOfClaim, dr as ErrorI18nPayloadSchema, dt as ReadinessRegistry, ei as RECORD_DEFAULT_MAX_DATA_BYTES, et as adminUiCapability, f as hfModelUrl, fa as makeSecretMarker, fi as buildSecretRef, fn as makeInMemoryRecords, ft as ReadinessTimeoutError, g as createDeviceProxy, gi as normalizeSecretOwner, gn as REVALIDATE_AFTER_MS, gr as BaseAddon, h as isDeviceScopedCap, hi as isSecretRef, hn as resolveSecretViewsIn, ht as scopeKey, ii as RECORD_MAX_INDEXES, j as CAP_METHOD_TIMEOUTS_MS, ji as RecordTooLargeError, jn as DATAPLANE_SECRET_HEADER, jr as resolveDeviceSettings, ki as RecordNotFoundError, kr as SCOPED_SETTINGS_SCOPES, la as isSecretFieldView, li as RECORD_SWEEP_INTERVAL_MS, ln as CommandOriginClaimSchema, m as DEVICE_SCOPED_CAPS, mi as globalSecretScope, mn as assertTransactScope, mr as readErrorI18n, ni as RECORD_ID_MAX_LENGTH, nr as expandCapMethods, nt as addonPagesSourceCapability, o as asJsonObject, oa as SECRET_CLEAR, oi as RECORD_QUERY_MAX, p as BOOT_RECOVERY_BACKOFF_MS, pa as toSecretFieldView, pi as formatSecretScope, pn as createRecordsAccess, q as viewerUiCapability, qn as collectZodSecretPaths, qr as recordSecretCollection, r as maskUrlCredentials, ri as RECORD_MAX_DATA_BYTES, sa as classifySecretWrite, si as RECORD_SECRET_COLLECTION_PREFIX, t as sleep, ti as RECORD_DELETE_BATCH, ua as isSecretMarker, ui as SECRET_REF_SCHEME, un as RuleFireOriginSchema, ut as MODEL_FORMATS, v as addonSliceHandleApi, vn as MIN_SCRUBBED_LENGTH, wi as ForeignSecretMarkerError, wn as shortSecretRefHash, xa as AddonMigrationsBlockedError, xi as BatchTooLargeError, xn as knownSecretCount, y as createEventBusSliceSource, yn as clearKnownSecrets, yr as normalizeAddonInitResult, zi as recordsErrorFromMessage, zn as RecordKindDeclarationSchema } from "./sleep-Bn346wCJ.mjs";
1
+ import { $ as DEVICE_CHILDREN_BATCH_MAX, $r as RECORD_DATABASES, A as CAP_ADVANCE_FIELDS, Ai as RecordSecretUnavailableError, An as CALLER_USERNAME_HEADER, Ar as nodeIdOfScopedKey, Bn as RecordKindNameSchema, Ci as FilterRequiredError, Cn as scrubKnownSecrets, Ct as createDebugEmitter, Di as PlaintextSecretError, Dn as PEER_BYTES_STALL_MS, Ei as NoCallerError, En as PEER_BYTES_MAX_OUTSTANDING, F as withoutCallerStamp, Fi as TransactRefusedError, Fn as entryBody, G as readNodePin, Gn as defineRecordKinds, Gr as parseSecretPath, H as commandOrigin, Hn as StoredRecordKindDeclarationSchema, Hr as REMOVE_LEAF, I as customAction, Ii as UnindexedFilterError, In as EntryDescriptorSchema, J as PipelineRunResultBridge, Jn as isZodSecret, Jr as recordSecretRef, Kr as recordArrayItemPath, L as defineCustomActions, Li as UnknownRecordKindError, Ln as RecordFieldPathSchema, Mi as RecordUniqueViolationError, Mr as resolvedValues, N as CAP_STATE_LEAVES, Ni as RecordsError, Nn as DisposerChain, O as HF_REPO, Oi as RECORDS_ERROR_CODES, On as PEER_BYTES_TICKET_TTL_MS, P as CALLER_STAMPED_CAPABILITIES, Pi as RevConflictError, Pn as defineEntryKind, Q as deviceOpsCapability, Qr as RECORD_CLASSES, R as describeCustomActions, Ri as asRecordsError, Rn as RecordIndexSchema, Sa as findMigrationsBlocked, Si as DeclarationRefusedError, Sn as registerKnownSecret, T as isCommand, Ti as InvalidRecordError, Tn as PEER_BYTES_CHUNK_BYTES, U as nodePin, Un as assertValidDeclaration, Ur as collectSecretLeaves, Vn as RecordRetentionSchema, Vr as secretViewsOf, W as readCommandOrigin, Wn as declarationsOf, Wr as mapSecretLeaves, X as MIGRATION_API_VERSION, Xi as emitReadiness, Xr as RECORD_BATCH_MAX, Y as PipelineStepInputSchema, Yi as createEvent, Yr as secretArrayPrefixes, Zr as RECORD_BATCH_MAX_BYTES, _i as parseSecretRef, _n as createSecretsAccess, ai as RECORD_MAX_INDEX_FIELDS, bn as forgetKnownSecret, c as asString, ca as isSecretClear, ci as RECORD_SETTINGS_MAX_ROWS, d as parseJsonUnknown, da as isSecretMarkerLike, di as arrayItemFieldPath, dn as ruleFireOfClaim, dr as ErrorI18nPayloadSchema, dt as ReadinessRegistry, ei as RECORD_DEFAULT_MAX_DATA_BYTES, et as adminUiCapability, f as hfModelUrl, fa as makeSecretMarker, fi as buildSecretRef, fn as makeInMemoryRecords, ft as ReadinessTimeoutError, g as createDeviceProxy, gi as normalizeSecretOwner, gn as REVALIDATE_AFTER_MS, gr as BaseAddon, h as isDeviceScopedCap, hi as isSecretRef, hn as resolveSecretViewsIn, ht as scopeKey, ii as RECORD_MAX_INDEXES, j as CAP_METHOD_TIMEOUTS_MS, ji as RecordTooLargeError, jn as DATAPLANE_SECRET_HEADER, jr as resolveDeviceSettings, ki as RecordNotFoundError, kr as SCOPED_SETTINGS_SCOPES, la as isSecretFieldView, li as RECORD_SWEEP_INTERVAL_MS, ln as CommandOriginClaimSchema, m as DEVICE_SCOPED_CAPS, mi as globalSecretScope, mn as assertTransactScope, mr as readErrorI18n, ni as RECORD_ID_MAX_LENGTH, nr as expandCapMethods, nt as addonPagesSourceCapability, o as asJsonObject, oa as SECRET_CLEAR, oi as RECORD_QUERY_MAX, p as BOOT_RECOVERY_BACKOFF_MS, pa as toSecretFieldView, pi as formatSecretScope, pn as createRecordsAccess, q as viewerUiCapability, qn as collectZodSecretPaths, qr as recordSecretCollection, r as maskUrlCredentials, ri as RECORD_MAX_DATA_BYTES, sa as classifySecretWrite, si as RECORD_SECRET_COLLECTION_PREFIX, t as sleep, ti as RECORD_DELETE_BATCH, ua as isSecretMarker, ui as SECRET_REF_SCHEME, un as RuleFireOriginSchema, ut as MODEL_FORMATS, v as addonSliceHandleApi, vn as MIN_SCRUBBED_LENGTH, wi as ForeignSecretMarkerError, wn as shortSecretRefHash, xa as AddonMigrationsBlockedError, xi as BatchTooLargeError, xn as knownSecretCount, y as createEventBusSliceSource, yn as clearKnownSecrets, yr as normalizeAddonInitResult, zi as recordsErrorFromMessage, zn as RecordKindDeclarationSchema } from "./sleep-D0roI_CZ.mjs";
2
2
  import { t as EventCategory } from "./event-category-78tcBemo.mjs";
3
3
  import { a as DeviceType, s as errMsg, t as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./composed-stable-id-CPp3votu.mjs";
4
4
  //#region src/generated/cap-input-defaults.ts
@@ -22,10 +22,10 @@ export type { TriggerVariable } from './trigger-variables.js';
22
22
  export { triggerLeafVariables, triggerVariablesOf } from './trigger-variables.js';
23
23
  export type { CooldownInput, CooldownVerdict, RunGateAdmission } from './run-gate.js';
24
24
  export { RunGate } from './run-gate.js';
25
- export type { AutomationConditionTraceNode, AutomationRunOutcome, AutomationRunTrace, AutomationRunVerdict, AutomationStateDoc, AutomationStepTrace, AutomationTriggerTrace, StepDeviceTrace, TraceNodeOutcome, TraceValue, } from './trace.js';
25
+ export type { AutomationConditionTraceNode, AutomationRunOutcome, AutomationRunTrace, AutomationRunVerdict, AutomationStateDoc, AutomationStepTrace, NestedStepTrace, AutomationTriggerTrace, StepDeviceTrace, TraceNodeOutcome, TraceValue, } from './trace.js';
26
26
  export { AutomationConditionTraceNodeSchema, EMPTY_AUTOMATION_STATE, mergeSkipTraces, AutomationRunOutcomeSchema, AutomationRunTraceSchema, AutomationRunVerdictSchema, AutomationStateDocSchema, AutomationStepTraceSchema, AutomationTriggerTraceSchema, appendTrace, buildStepArgsTrace, buildTriggerTrace, isSkippedTrace, MAX_TRACE_ARG_LENGTH, MAX_STEP_DEVICE_OUTCOMES, MAX_TRACE_ARGS, REDACTED_ARG, skipSignature, StepDeviceTraceSchema, TraceNodeOutcomeSchema, TraceValueSchema, } from './trace.js';
27
- export type { ActionStep, AutomationAction, AutomationCapStep, AutomationRecipe, AutomationRunMode, LegacyAutomationRecipe, NormalizedCapStep, } from './recipe.js';
28
- export { ActionStepSchema, AutomationActionSchema, AutomationCapStepSchema, AutomationWaitStepSchema, AutomationRecipeSchema, AutomationRunModeSchema, CurrentAutomationRecipeSchema, convertLegacyRecipe, DEFAULT_TRACE_KEEP, LegacyAutomationRecipeSchema, MAX_TRACE_KEEP, MAX_CONDITION_DEPTH, MAX_CONDITION_LEAVES, normalizeCapStep, normalizeStepTargets, validateRecipeBounds, } from './recipe.js';
27
+ export type { ActionStep, AutomationAction, AutomationCapStep, AutomationRecipe, AutomationRunMode, LegacyAutomationRecipe, AutomationBodyStep, AutomationBranchStep, AutomationRecipeInput, AutomationChooseStep, AutomationWaitUntilStep, AutomationParallelStep, AutomationRepeatLoop, AutomationRepeatStep, AutomationSetStep, StepConditionRef, AutomationStopStep, NormalizedCapStep, } from './recipe.js';
28
+ export { ActionStepSchema, AutomationActionSchema, AutomationCapStepSchema, AutomationWaitStepSchema, AutomationChooseStepSchema, AutomationWaitUntilStepSchema, AutomationParallelStepSchema, AutomationRepeatLoopSchema, AutomationRepeatStepSchema, AutomationSetStepSchema, CHOOSE_BRANCHES_MAX, WAIT_UNTIL_TIMEOUT_MAX_S, PARALLEL_STEPS_MAX, REPEAT_COUNT_MAX, REPEAT_DEVICES_MAX, REPEAT_ITEM_VAR, REPEAT_ITERATIONS_MAX, REPEAT_STEPS_MAX, STEP_NEST_MAX, PARALLEL_STEPS_MIN, nestedStepsOf, stepConditionsOf, AutomationStopStepSchema, RESERVED_RUN_VARS, SET_VAR_NAME_RE, SET_VAR_VALUE_MAX, SET_VARS_MAX, STOP_REASON_MAX, stepGuardOf, WAIT_MAX_SECONDS, AutomationRecipeSchema, AutomationRunModeSchema, CurrentAutomationRecipeSchema, convertLegacyRecipe, DEFAULT_TRACE_KEEP, LegacyAutomationRecipeSchema, MAX_TRACE_KEEP, MAX_CONDITION_DEPTH, MAX_CONDITION_LEAVES, normalizeCapStep, normalizeStepTargets, validateRecipeBounds, } from './recipe.js';
29
29
  export type { AutomationAll, AutomationAny, AutomationConditionOperator, AutomationEventLeaf, AutomationLeaf, AutomationNot, AutomationStateLeaf, AutomationWhen, DetectionLeaf, DeviceBecomesLeaf, DeviceIsLeaf, ExpressionLeaf, TimeIsLeaf, TriggeredByLeaf, IdentifiedEventLeaf, StationaryLeaf, StationaryPresentLeaf, } from './when.js';
30
30
  export { AutomationConditionOperatorSchema, AutomationWhenSchema, countWhenLeaves, eventLeafIdAt, identifiedEventLeaves, hasTriggeredByLeaves, triggeredByIssue, EVENT_LEAF_ID_RE, TRIGGERED_BY_MAX_IDS, forEachLeaf, hasEventLeaves, isEventLeaf, isLeaf, MAX_WHEN_DEPTH, MAX_WHEN_LEAVES, validateWhenTree, whenDepth, } from './when.js';
31
31
  export type { LegacyCondition, LegacyTrigger, } from './legacy-recipe.js';
@@ -36,6 +36,7 @@ export * from './action.js';
36
36
  export * from './action-target.js';
37
37
  export * from './step-condition.js';
38
38
  export * from './step-runner.js';
39
+ export * from './wait-until.js';
39
40
  export { UnitWarningSchema, capUnitResolver, normalizeActionUnits, normalizeConditionUnits, normalizeRecipeUnits, } from './normalize-units.js';
40
41
  export type { UnitResolver, UnitWarning, UnitsNormalized } from './normalize-units.js';
41
42
  export { prepareRecipeUnits } from './prepare-units.js';