@camstack/types 1.2.590 → 1.2.592

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,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.592] - 2026-11-18
11
+
12
+ ### Changed
13
+
14
+ - A command's vocabulary names every field it sets (a fan speed set in a preset also leaves the preset; a thermostat's fan mode, preset and range), and a device provider can say at registration that a command is never held, or held for another time.
15
+ - Media players, pet feeders, pet fountains, pump cycles, scripts and automations declare the state each command leads to, a toggle leads to the opposite of what was shown, and a number set through a slider is confirmed within its step.
16
+ - Lock and alarm commands are held as locking/arming (not the final state); Feed and Run are held as feeding/running for 10 s so a double tap sends one command.
17
+ - A pump run or rest time set in minutes is held as the seconds the device reports, so two quick + taps make two steps.
18
+
19
+ ## [1.2.591] - 2026-11-17
20
+
21
+ ### Changed
22
+
23
+ - Exports NormalizedRectSchema, the wire shape of a normalized rectangle.
24
+ - runPipeline accepts motionRegions; the pipeline trace carries rootSource (which pixels the object-detection root ran on).
25
+ - The pipeline trace's root-source reason can now also be subject-too-large or roi-missed
26
+
10
27
  ## [1.2.590] - 2026-11-17
11
28
 
12
29
  ### Changed
package/dist/addon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-BA_SIc0O.js");
2
+ const require_sleep = require("./sleep-D2Ny6tvi.js");
3
3
  const require_event_category = require("./event-category-BKxXXxnV.js");
4
4
  const require_composed_stable_id = require("./composed-stable-id-BdeYe5dD.js");
5
5
  //#region src/generated/cap-input-defaults.ts
package/dist/addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as PipelineStepInputSchema, $n as StoredRecordKindDeclarationSchema, $r as REMOVE_LEAF, A as CAP_ADVANCE_FIELDS, An as clearKnownSecrets, Ar as normalizeAddonInitResult, At as createDebugEmitter, B as describeCustomActions, Bi as RecordNotFoundError, Br as SCOPED_SETTINGS_SCOPES, Ca as makeSecretMarker, Ci as buildSecretRef, Cn as makeInMemoryRecords, Di as normalizeSecretOwner, Dn as REVALIDATE_AFTER_MS, Dr as BaseAddon, Ei as isSecretRef, En as resolveSecretViewsIn, F as isCapMethodAbsent, Fi as ForeignSecretMarkerError, Fn as shortSecretRefHash, G as nodePin, Gi as RevConflictError, Gn as defineEntryKind, Hi as RecordTooLargeError, Hn as DATAPLANE_SECRET_HEADER, Hr as resolveDeviceSettings, I as CALLER_STAMPED_CAPABILITIES, Ii as InvalidRecordError, In as PEER_BYTES_CHUNK_BYTES, Ji as UnknownRecordKindError, Jn as RecordFieldPathSchema, K as readCommandOrigin, Ki as TransactRefusedError, Kn as entryBody, L as withoutCallerStamp, Li as NoCallerError, Ln as PEER_BYTES_MAX_OUTSTANDING, Ma as AddonMigrationsBlockedError, Mi as BatchTooLargeError, Mn as knownSecretCount, N as CAP_STATE_LEAVES, Na as findMigrationsBlocked, Ni as DeclarationRefusedError, Nn as registerKnownSecret, O as HF_REPO, Oi as parseSecretRef, On as createSecretsAccess, P as CAP_METHOD_NOT_IMPLEMENTED, Pi as FilterRequiredError, Pn as scrubKnownSecrets, Q as PipelineRunResultBridge, Qn as RecordRetentionSchema, Qr as secretViewsOf, R as customAction, Ri as PlaintextSecretError, Rn as PEER_BYTES_STALL_MS, Sa as isSecretMarkerLike, Si as arrayItemFieldPath, Sn as ruleFireOfClaim, Sr as ErrorI18nPayloadSchema, St as scopeKey, T as isCommand, Ti as globalSecretScope, Tn as assertTransactScope, Tr as readErrorI18n, Ui as RecordUniqueViolationError, Ur as resolvedValues, Vi as RecordSecretUnavailableError, Vn as CALLER_USERNAME_HEADER, Vr as nodeIdOfScopedKey, W as commandOrigin, Wi as RecordsError, Wn as DisposerChain, X as SWITCH_SETTABLE_GATE, Xi as recordsErrorFromMessage, Xn as RecordKindDeclarationSchema, Y as viewerUiCapability, Yi as asRecordsError, Yn as RecordIndexSchema, Z as switchRefusesSetState, Zn as RecordKindNameSchema, _a as SECRET_CLEAR, _i as RECORD_QUERY_MAX, _t as MODEL_FORMATS, ai as recordSecretRef, ar as isZodSecret, ba as isSecretFieldView, bi as RECORD_SWEEP_INTERVAL_MS, bn as OnBehalfSourceSchema, c as asString, ci as RECORD_BATCH_MAX_BYTES, d as parseJsonUnknown, di as RECORD_DEFAULT_MAX_DATA_BYTES, ei as collectSecretLeaves, er as assertValidDeclaration, et as MIGRATION_API_VERSION, f as hfModelUrl, fi as RECORD_DELETE_BATCH, g as createDeviceProxy, gi as RECORD_MAX_INDEX_FIELDS, h as isDeviceScopedCap, hi as RECORD_MAX_INDEXES, ii as recordSecretCollection, ir as collectZodSecretPaths, it as adminUiCapability, j as CAP_METHOD_TIMEOUTS_MS, jn as forgetKnownSecret, kn as MIN_SCRUBBED_LENGTH, li as RECORD_CLASSES, m as DEVICE_SCOPED_CAPS, mi as RECORD_MAX_DATA_BYTES, ni as parseSecretPath, nr as defineRecordKinds, nt as deviceOpsCapability, o as asJsonObject, oa as createEvent, oi as secretArrayPrefixes, ot as addonPagesSourceCapability, p as BOOT_RECOVERY_BACKOFF_MS, pi as RECORD_ID_MAX_LENGTH, pr as expandCapMethods, q as readNodePin, qi as UnindexedFilterError, qn as EntryDescriptorSchema, r as maskUrlCredentials, ri as recordArrayItemPath, rt as DEVICE_CHILDREN_BATCH_MAX, sa as emitReadiness, si as RECORD_BATCH_MAX, t as sleep, ti as mapSecretLeaves, tr as declarationsOf, ui as RECORD_DATABASES, v as addonSliceHandleApi, va as classifySecretWrite, vi as RECORD_SECRET_COLLECTION_PREFIX, vn as CommandOriginClaimSchema, vt as ReadinessRegistry, wa as toSecretFieldView, wi as formatSecretScope, wn as createRecordsAccess, xa as isSecretMarker, xi as SECRET_REF_SCHEME, xn as RuleFireOriginSchema, y as createEventBusSliceSource, ya as isSecretClear, yi as RECORD_SETTINGS_MAX_ROWS, yn as OnBehalfSchema, yt as ReadinessTimeoutError, z as defineCustomActions, zi as RECORDS_ERROR_CODES, zn as PEER_BYTES_TICKET_TTL_MS } from "./sleep-BT1bLgPq.mjs";
1
+ import { $ as viewerUiCapability, $i as asRecordsError, $n as RecordIndexSchema, Ai as isSecretRef, An as resolveSecretViewsIn, B as CALLER_STAMPED_CAPABILITIES, Bi as InvalidRecordError, Bn as PEER_BYTES_CHUNK_BYTES, Ca as isSecretClear, Ci as RECORD_SETTINGS_MAX_ROWS, Cn as OnBehalfSchema, Ct as ReadinessTimeoutError, Da as makeSecretMarker, Di as buildSecretRef, Dn as makeInMemoryRecords, Ea as isSecretMarkerLike, Ei as arrayItemFieldPath, En as ruleFireOfClaim, Er as ErrorI18nPayloadSchema, Et as scopeKey, F as CAP_METHOD_TIMEOUTS_MS, Fn as forgetKnownSecret, Gi as RecordSecretUnavailableError, Gn as CALLER_USERNAME_HEADER, Gr as nodeIdOfScopedKey, H as customAction, Hi as PlaintextSecretError, Hn as PEER_BYTES_STALL_MS, Ia as AddonMigrationsBlockedError, Ii as BatchTooLargeError, In as knownSecretCount, J as commandOrigin, Ji as RecordsError, Jn as DisposerChain, Ki as RecordTooLargeError, Kn as DATAPLANE_SECRET_HEADER, Kr as resolveDeviceSettings, L as CAP_STATE_LEAVES, La as findMigrationsBlocked, Li as DeclarationRefusedError, Ln as registerKnownSecret, M as HF_REPO, Mi as parseSecretRef, Mn as createSecretsAccess, Nn as MIN_SCRUBBED_LENGTH, O as isCommand, Oa as toSecretFieldView, Oi as formatSecretScope, On as createRecordsAccess, P as CAP_ADVANCE_FIELDS, Pn as clearKnownSecrets, Pr as normalizeAddonInitResult, Pt as createDebugEmitter, Qi as UnknownRecordKindError, Qn as RecordFieldPathSchema, R as CAP_METHOD_NOT_IMPLEMENTED, Ri as FilterRequiredError, Rn as scrubKnownSecrets, Sa as classifySecretWrite, Si as RECORD_SECRET_COLLECTION_PREFIX, Sn as CommandOriginClaimSchema, St as ReadinessRegistry, Ta as isSecretMarker, Ti as SECRET_REF_SCHEME, Tn as RuleFireOriginSchema, U as defineCustomActions, Ui as RECORDS_ERROR_CODES, Un as PEER_BYTES_TICKET_TTL_MS, V as withoutCallerStamp, Vi as NoCallerError, Vn as PEER_BYTES_MAX_OUTSTANDING, W as describeCustomActions, Wi as RecordNotFoundError, Wr as SCOPED_SETTINGS_SCOPES, X as readCommandOrigin, Xi as TransactRefusedError, Xn as entryBody, Y as nodePin, Yi as RevConflictError, Yn as defineEntryKind, Z as readNodePin, Zi as UnindexedFilterError, Zn as EntryDescriptorSchema, _i as RECORD_ID_MAX_LENGTH, _r as expandCapMethods, ai as mapSecretLeaves, ar as declarationsOf, bi as RECORD_MAX_INDEX_FIELDS, c as asString, ci as recordSecretCollection, cr as collectZodSecretPaths, ct as adminUiCapability, d as parseJsonUnknown, da as emitReadiness, di as RECORD_BATCH_MAX, ea as recordsErrorFromMessage, er as RecordKindDeclarationSchema, et as SWITCH_SETTABLE_GATE, f as hfModelUrl, fi as RECORD_BATCH_MAX_BYTES, g as createDeviceProxy, gi as RECORD_DELETE_BATCH, h as isDeviceScopedCap, hi as RECORD_DEFAULT_MAX_DATA_BYTES, ii as collectSecretLeaves, ir as assertValidDeclaration, it as MIGRATION_API_VERSION, ji as normalizeSecretOwner, jn as REVALIDATE_AFTER_MS, jr as BaseAddon, ki as globalSecretScope, kn as assertTransactScope, kr as readErrorI18n, li as recordSecretRef, lr as isZodSecret, m as DEVICE_SCOPED_CAPS, mi as RECORD_DATABASES, ni as secretViewsOf, nr as RecordRetentionSchema, nt as PipelineRunResultBridge, o as asJsonObject, oi as parseSecretPath, or as defineRecordKinds, ot as deviceOpsCapability, p as BOOT_RECOVERY_BACKOFF_MS, pi as RECORD_CLASSES, qi as RecordUniqueViolationError, qr as resolvedValues, r as maskUrlCredentials, ri as REMOVE_LEAF, rr as StoredRecordKindDeclarationSchema, rt as PipelineStepInputSchema, si as recordArrayItemPath, st as DEVICE_CHILDREN_BATCH_MAX, t as sleep, tr as RecordKindNameSchema, tt as switchRefusesSetState, ua as createEvent, ui as secretArrayPrefixes, ut as addonPagesSourceCapability, v as addonSliceHandleApi, vi as RECORD_MAX_DATA_BYTES, wa as isSecretFieldView, wi as RECORD_SWEEP_INTERVAL_MS, wn as OnBehalfSourceSchema, xa as SECRET_CLEAR, xi as RECORD_QUERY_MAX, xt as MODEL_FORMATS, y as createEventBusSliceSource, yi as RECORD_MAX_INDEXES, z as isCapMethodAbsent, zi as ForeignSecretMarkerError, zn as shortSecretRefHash } from "./sleep-dgC2VKW4.mjs";
2
2
  import { t as EventCategory } from "./event-category-CY27-fF0.mjs";
3
3
  import { a as DeviceType, s as errMsg, t as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./composed-stable-id-BNTaDZEh.mjs";
4
4
  //#region src/generated/cap-input-defaults.ts
@@ -106,6 +106,7 @@ export declare const deviceStateCapability: {
106
106
  readonly getCapSlice: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
107
107
  deviceId: z.ZodNumber;
108
108
  capName: z.ZodString;
109
+ confirmed: z.ZodOptional<z.ZodBoolean>;
109
110
  }, z.core.$strip>, z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>, import("./capability-definition.js").CapabilityMethodKind>;
110
111
  /**
111
112
  * Whole-system snapshot — every device's full state in one
@@ -114,7 +115,9 @@ export declare const deviceStateCapability: {
114
115
  * `sm.getDeviceById(id).state.<cap>.value` is sync. Empty inner
115
116
  * record for devices that haven't emitted any slice yet.
116
117
  */
117
- readonly getAllSnapshots: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{}, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>, import("./capability-definition.js").CapabilityMethodKind>;
118
+ readonly getAllSnapshots: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
119
+ confirmed: z.ZodOptional<z.ZodBoolean>;
120
+ }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>, import("./capability-definition.js").CapabilityMethodKind>;
118
121
  /**
119
122
  * Canonical cross-layer WRITE for one cap-keyed slice. Used by
120
123
  * everyone who needs to publish runtime state for a device:
@@ -117,7 +117,7 @@ export { type IOauthIntegrationProvider, type OauthIntegrationDescriptor, OauthI
117
117
  export { type IIntegrationInstancesProvider, type IntegrationInstance, type IntegrationInstanceDescription, IntegrationInstanceDescriptionSchema, type IntegrationInstanceDiscovery, IntegrationInstanceDiscoverySchema, IntegrationInstanceIdSchema, type IntegrationInstanceKind, type IntegrationInstanceLink, IntegrationInstanceLinkSchema, IntegrationInstanceKindSchema, type IntegrationInstanceMode, IntegrationInstanceModeSchema, type IntegrationInstancePatch, IntegrationInstancePatchSchema, type IntegrationInstanceRole, IntegrationInstanceRoleSchema, IntegrationInstanceSchema, type IntegrationInstanceStatus, IntegrationInstanceStatusSchema, integrationInstancesCapability, } from './integration-instances.cap.js';
118
118
  export { AnalyticsLtsSeriesSchema, type AudioEvent, type AudioEventDraft, AudioEventSchema, type DetectionSource, DetectionSourceSchema, EVENT_DENSITY_BATCH_MAX, type EventDensityBucket, EventDensityBucketSchema, type EventDensityForDevice, EventDensityForDeviceSchema, type EventKind, type EventKindCategory, EventKindCategorySchema, type EventKindDescriptor, EventKindDescriptorSchema, type EventKindIcon, EventKindIconSchema, EventKindSchema, type EventKindsForDevice, EventKindsForDeviceSchema, type EventMediaKindBreakdown, type EventMediaKindFootprint, type EventPruneCounts, type EventStoreDeviceFootprint, type EventStoreFootprint, type IPipelineAnalyticsProvider, type KeyEvent, KeyEventSchema, type KeyEventsForDevice, type LabelAttribution, LabelAttributionSchema, type LabelTier, LabelTierSchema, LTS_SCOPE_CLASS_SEPARATOR, type LtsBucket, LtsBucketSchema, MAX_TRACK_DEBUG_NOTE_LEN, type MediaFile, type MediaFileBytes, type MediaFileInfo, MediaFileInfoSchema, type MediaFileKind, MediaFileKindEnum, type MediaFileRef, MediaFileRefSchema, MediaFileSchema, type MotionEvent, type MotionEventDraft, MotionEventSchema, type ObjectEvent, type ObjectEventDraft, ObjectEventSchema, occupancyScope, parseOccupancyScope, pipelineAnalyticsCapability, type RebuildObjectEmbeddingsRefusal, RebuildObjectEmbeddingsRefusalSchema, type RecentTracksPage, RecentTracksPageSchema, type RecentTracksQuery, RecentTracksQueryInput, type RetrainBoxReview, RetrainBoxReviewSchema, type RetrainDismissed, RetrainDismissedSchema, type RetrainFrameReview, RetrainFrameReviewSchema, type RetrainOrigin, RetrainOriginSchema, type RetrainReviewStatus, RetrainReviewStatusSchema, type RetrainAnnotation, type RetrainAnnotationDraft, RetrainAnnotationDraftSchema, RetrainAnnotationKindSchema, RetrainAnnotationSchema, type RetrainAnnotationSource, RetrainAnnotationSourceSchema, type RetrainArchiveResult, RetrainArchiveResultSchema, type RetrainArchiveTarget, RetrainArchiveTargetSchema, type RetrainAssistResult, RetrainAssistResultSchema, RetrainAssistSubjectSchema, RetrainCopyRefusalSchema, type RetrainExportFilter, RetrainExportFilterSchema, type RetrainExportLayout, RetrainExportLayoutSchema, type AddRetrainFrameFromRecordingResult, AddRetrainFrameFromRecordingResultSchema, type RetrainDatasetSelection, RetrainDatasetSelectionSchema, type RetrainDatasetStats, RetrainDatasetStatsSchema, type RetrainDatasetVersion, RetrainDatasetVersionSchema, type RetrainTrainingCorpusResolveResult, RetrainTrainingCorpusResolveResultSchema, type RetrainTrainingCorpusSelection, RetrainTrainingCorpusSelectionSchema, type RetrainAssistProfile, RetrainAssistProfileSchema, type RetrainLlmAssistResult, RetrainLlmAssistResultSchema, type RetrainLlmProposal, RetrainLlmProposalSchema, type RetrainLlmReview, RetrainLlmReviewSchema, type RetrainCollection, type RetrainCollectionCreateResult, RetrainCollectionCreateResultSchema, type RetrainCollectionRenameResult, RetrainCollectionRenameResultSchema, RetrainCollectionSchema, type RetrainCorpusFilter, RetrainCorpusFilterSchema, type RetrainCorpusKpi, RetrainCorpusKpiSchema, type RetrainCorpusKpiCameraRow, RetrainCorpusKpiCameraRowSchema, type RetrainCorpusPage, RetrainCorpusPageSchema, type RetrainCorpusPageFrame, RetrainCorpusPageFrameSchema, type RetrainFrame, type RetrainFrameCandidate, RetrainFrameCandidateSchema, type RetrainFrameList, RetrainFrameListSchema, type RetrainFrameOrigin, RetrainFrameOriginSchema, RetrainFrameSchema, type RetrainFrameSelection, RetrainFrameSelectionSchema, type RetrainFrameWorkState, RetrainFrameWorkStateSchema, type RetrainMacroClass, RetrainMacroClassSchema, type RetrainPipelineBox, RetrainPipelineBoxSchema, type RetrainStatus, RetrainStatusSchema, type RetrainTrack, RetrainTrackSchema, type RetrainTransitionResult, RetrainTransitionResultSchema, type RetrainVerdict, RetrainVerdictSchema, type RetrainVerdictSubject, RetrainVerdictSubjectSchema, type RetrainVerdictValue, RetrainVerdictValueSchema, type ScoredObjectEvent, ScoredObjectEventSchema, type SensorEvent, SensorEventSchema, type Track, type TrackCascadeCounts, TrackCascadeCountsSchema, type TrackEnvelope, TrackEnvelopeSchema, TrackedDetectionSchema, type TrackFlags, type TrackFlagsPatch, TrackFlagsPatchSchema, TrackFlagsSchema, type TrackPlacement, TrackPlacementSchema, type TrackProjection, TrackProjectionSchema, TrackSchema, type TrackSource, TrackSourceSchema, type TrackState, TrackStateSchema, type TrackZoneFilter, TrackZoneFilterSchema, type TrainingExportDeviceTotals, TrainingExportDeviceTotalsSchema, type TrainingExportSummary, TrainingExportSummarySchema, type ZoneCrossing, type ZoneCrossingDirection, ZoneCrossingDirectionSchema, ZoneCrossingSchema, } from './pipeline-analytics.cap.js';
119
119
  export type { EffectiveTuning, EffectiveTuningInput, NativeCropRef, PipelineStepInputOutput, PipelineValidationIssue, PipelineValidationResult, SuppliedRootOutput, } from './pipeline-executor.cap.js';
120
- export { EffectiveTuningSchema, ModelSubstitutionSchema, NativeCropRefSchema, PipelineDefaultStepSchema, PipelineEngineChoiceSchema, PipelineRunResultBridge, PipelineStepInputSchema, PipelineValidationIssueSchema, PipelineValidationResultSchema, pipelineExecutorCapability, SuppliedRootOutputSchema, } from './pipeline-executor.cap.js';
120
+ export { EffectiveTuningSchema, ModelSubstitutionSchema, NativeCropRefSchema, PipelineDefaultStepSchema, PipelineEngineChoiceSchema, PipelineRunResultBridge, PipelineStepInputSchema, PipelineValidationIssueSchema, PipelineValidationResultSchema, pipelineExecutorCapability, NormalizedRectSchema, SuppliedRootOutputSchema, } from './pipeline-executor.cap.js';
121
121
  export type { CameraAssignmentStatus, CameraAudioStatus, CameraBrokerProfile, CameraBrokerStatus, CameraDecoderStatus, CameraDetectionPhase, CameraDetectionProvisioning, CameraDetectionProvisioningState, CameraDetectionStatus, CameraMotionStatus, CameraRecordingMode, CameraRecordingStatus, CameraSourceStatus, CameraDetectionSource, CameraSourceStream, CameraStatus, CameraStatusDegradation, CameraStatusDegradationReason, CameraStatusStage, ClusterModelChoice, ClusterModelChoiceUnreadableReason, DiskReconcileJob, InferenceDeviceExclusionReason, IngestOwner, NodeInferenceDevice, NodeInferenceDevices, OccupancyLookAnswer, OccupancyLookRefusal, OccupancyLookRequest, SetCameraSensorsInput, } from './pipeline-orchestrator.cap.js';
122
122
  export { AgentLoadSummarySchema, CameraAssignmentStatusSchema, CameraAudioStatusSchema, CameraBrokerProfileSchema, CameraBrokerStatusSchema, CameraDecoderStatusSchema, CameraDetectionSourceSchema, CameraDetectionPhaseSchema, CameraDetectionProvisioningSchema, CameraDetectionProvisioningStateSchema, CameraDetectionStatusSchema, CameraMotionStatusSchema, CameraRecordingModeSchema, CameraRecordingStatusSchema, CameraSourceStatusSchema, CameraSourceStreamSchema, CameraStatusDegradationReasonSchema, CameraStatusDegradationSchema, CameraStatusSchema, CameraStatusStageSchema, CapabilityBindingsSchema, CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS, ClusterModelChoiceSchema, DiskReconcileJobSchema, GlobalMetricsSchema, INFERENCE_DEVICE_EXCLUSION_REASONS, InferenceDeviceExclusionReasonSchema, IngestOwnerSchema, OccupancyLookAnswerSchema, OccupancyLookRefusalSchema, OccupancyLookRequestSchema, PipelineAssignmentSchema, pipelineOrchestratorCapability, SetCameraSensorsInputSchema, } from './pipeline-orchestrator.cap.js';
123
123
  export type { DetailParent, DetailResult, MotionSource, MotionSources, OccupancyBurstRefusal, ParkedFrameKind, ParkedTrackFrame, ParkRefusal, ParkTrackFrameResult, ReportMotionInput, RunDetailSubtreeInput, RunDetailSubtreeResult, RunnerFrameSource, RunnerInferenceDevice, RunnerJumpStepProvisioning, RunStatelessStepInput, RunStatelessStepResult, StatelessStepRefusal, } from './pipeline-runner.cap.js';
@@ -2,10 +2,20 @@ import { z } from 'zod';
2
2
  import type { ConfigField, ConfigUISchema } from '../interfaces/config-ui.js';
3
3
  import type { InferenceCapabilities, ModelAvailability } from '../interfaces/inference-capabilities.js';
4
4
  import type { AudioResult } from '../types/detection.js';
5
- import { PipelineRunResultBridge, PipelineStepInputSchema, type PipelineStepInputOutput } from './pipeline-step-input.js';
6
- export { PipelineRunResultBridge, PipelineStepInputSchema };
5
+ import { PipelineRunResultBridge, type PipelineStepInputOutput, PipelineStepInputSchema } from './pipeline-step-input.js';
7
6
  export type { PipelineStepInputOutput };
7
+ export { PipelineRunResultBridge, PipelineStepInputSchema };
8
8
  import { type InferProvider } from './capability-definition.js';
9
+ /**
10
+ * A rectangle as a fraction of a frame, `[0, 1]` on both axes — the wire shape
11
+ * of `NormalizedRect` (which is derived from it).
12
+ */
13
+ export declare const NormalizedRectSchema: z.ZodObject<{
14
+ x: z.ZodNumber;
15
+ y: z.ZodNumber;
16
+ w: z.ZodNumber;
17
+ h: z.ZodNumber;
18
+ }, z.core.$strip>;
9
19
  /**
10
20
  * A root model's boxes standing in for one crop-kind step's own inference
11
21
  * (D730) — see `runPipeline.suppliedRoot`.
@@ -1134,6 +1144,12 @@ export declare const pipelineExecutorCapability: {
1134
1144
  }, z.core.$strip>>>;
1135
1145
  }, z.core.$strip>>;
1136
1146
  }, z.core.$strip>>;
1147
+ motionRegions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1148
+ x: z.ZodNumber;
1149
+ y: z.ZodNumber;
1150
+ w: z.ZodNumber;
1151
+ h: z.ZodNumber;
1152
+ }, z.core.$strip>>>;
1137
1153
  }, z.core.$strip>, z.ZodCustom<import("../index.js").FrameResult, import("../index.js").FrameResult>, "mutation">;
1138
1154
  /**
1139
1155
  * Batched run — N raw frames packed into one cap call. The provider
package/dist/client.js CHANGED
@@ -21904,6 +21904,14 @@ DeviceType.AlarmPanel, method(zod.z.object({ deviceId: zod.z.number().int().nonn
21904
21904
  field: "state",
21905
21905
  value: "disarmed"
21906
21906
  },
21907
+ hold: { effects: [{
21908
+ field: "state",
21909
+ value: "disarming",
21910
+ when: {
21911
+ field: "state",
21912
+ notIn: ["disarmed"]
21913
+ }
21914
+ }] },
21907
21915
  openArgs: [{
21908
21916
  key: "code",
21909
21917
  label: t("PIN code", "Codice PIN"),
@@ -21933,6 +21941,14 @@ DeviceType.AlarmPanel, method(zod.z.object({ deviceId: zod.z.number().int().nonn
21933
21941
  field: "state",
21934
21942
  value: "armed_home"
21935
21943
  },
21944
+ hold: { effects: [{
21945
+ field: "state",
21946
+ value: "arming",
21947
+ when: {
21948
+ field: "state",
21949
+ notIn: ["armed_home"]
21950
+ }
21951
+ }] },
21936
21952
  args: { mode: "home" },
21937
21953
  openArgs: [{
21938
21954
  key: "code",
@@ -21953,6 +21969,14 @@ DeviceType.AlarmPanel, method(zod.z.object({ deviceId: zod.z.number().int().nonn
21953
21969
  field: "state",
21954
21970
  value: "armed_away"
21955
21971
  },
21972
+ hold: { effects: [{
21973
+ field: "state",
21974
+ value: "arming",
21975
+ when: {
21976
+ field: "state",
21977
+ notIn: ["armed_away"]
21978
+ }
21979
+ }] },
21956
21980
  args: { mode: "away" },
21957
21981
  openArgs: [{
21958
21982
  key: "code",
@@ -21973,6 +21997,14 @@ DeviceType.AlarmPanel, method(zod.z.object({ deviceId: zod.z.number().int().nonn
21973
21997
  field: "state",
21974
21998
  value: "armed_night"
21975
21999
  },
22000
+ hold: { effects: [{
22001
+ field: "state",
22002
+ value: "arming",
22003
+ when: {
22004
+ field: "state",
22005
+ notIn: ["armed_night"]
22006
+ }
22007
+ }] },
21976
22008
  args: { mode: "night" },
21977
22009
  openArgs: [{
21978
22010
  key: "code",
@@ -21993,6 +22025,14 @@ DeviceType.AlarmPanel, method(zod.z.object({ deviceId: zod.z.number().int().nonn
21993
22025
  field: "state",
21994
22026
  value: "armed_vacation"
21995
22027
  },
22028
+ hold: { effects: [{
22029
+ field: "state",
22030
+ value: "arming",
22031
+ when: {
22032
+ field: "state",
22033
+ notIn: ["armed_vacation"]
22034
+ }
22035
+ }] },
21996
22036
  args: { mode: "vacation" },
21997
22037
  openArgs: [{
21998
22038
  key: "code",
@@ -22013,6 +22053,14 @@ DeviceType.AlarmPanel, method(zod.z.object({ deviceId: zod.z.number().int().nonn
22013
22053
  field: "state",
22014
22054
  value: "armed_custom_bypass"
22015
22055
  },
22056
+ hold: { effects: [{
22057
+ field: "state",
22058
+ value: "arming",
22059
+ when: {
22060
+ field: "state",
22061
+ notIn: ["armed_custom_bypass"]
22062
+ }
22063
+ }] },
22016
22064
  args: { mode: "custom_bypass" },
22017
22065
  openArgs: [{
22018
22066
  key: "code",
package/dist/client.mjs CHANGED
@@ -21903,6 +21903,14 @@ DeviceType.AlarmPanel, method(z.object({ deviceId: z.number().int().nonnegative(
21903
21903
  field: "state",
21904
21904
  value: "disarmed"
21905
21905
  },
21906
+ hold: { effects: [{
21907
+ field: "state",
21908
+ value: "disarming",
21909
+ when: {
21910
+ field: "state",
21911
+ notIn: ["disarmed"]
21912
+ }
21913
+ }] },
21906
21914
  openArgs: [{
21907
21915
  key: "code",
21908
21916
  label: t("PIN code", "Codice PIN"),
@@ -21932,6 +21940,14 @@ DeviceType.AlarmPanel, method(z.object({ deviceId: z.number().int().nonnegative(
21932
21940
  field: "state",
21933
21941
  value: "armed_home"
21934
21942
  },
21943
+ hold: { effects: [{
21944
+ field: "state",
21945
+ value: "arming",
21946
+ when: {
21947
+ field: "state",
21948
+ notIn: ["armed_home"]
21949
+ }
21950
+ }] },
21935
21951
  args: { mode: "home" },
21936
21952
  openArgs: [{
21937
21953
  key: "code",
@@ -21952,6 +21968,14 @@ DeviceType.AlarmPanel, method(z.object({ deviceId: z.number().int().nonnegative(
21952
21968
  field: "state",
21953
21969
  value: "armed_away"
21954
21970
  },
21971
+ hold: { effects: [{
21972
+ field: "state",
21973
+ value: "arming",
21974
+ when: {
21975
+ field: "state",
21976
+ notIn: ["armed_away"]
21977
+ }
21978
+ }] },
21955
21979
  args: { mode: "away" },
21956
21980
  openArgs: [{
21957
21981
  key: "code",
@@ -21972,6 +21996,14 @@ DeviceType.AlarmPanel, method(z.object({ deviceId: z.number().int().nonnegative(
21972
21996
  field: "state",
21973
21997
  value: "armed_night"
21974
21998
  },
21999
+ hold: { effects: [{
22000
+ field: "state",
22001
+ value: "arming",
22002
+ when: {
22003
+ field: "state",
22004
+ notIn: ["armed_night"]
22005
+ }
22006
+ }] },
21975
22007
  args: { mode: "night" },
21976
22008
  openArgs: [{
21977
22009
  key: "code",
@@ -21992,6 +22024,14 @@ DeviceType.AlarmPanel, method(z.object({ deviceId: z.number().int().nonnegative(
21992
22024
  field: "state",
21993
22025
  value: "armed_vacation"
21994
22026
  },
22027
+ hold: { effects: [{
22028
+ field: "state",
22029
+ value: "arming",
22030
+ when: {
22031
+ field: "state",
22032
+ notIn: ["armed_vacation"]
22033
+ }
22034
+ }] },
21995
22035
  args: { mode: "vacation" },
21996
22036
  openArgs: [{
21997
22037
  key: "code",
@@ -22012,6 +22052,14 @@ DeviceType.AlarmPanel, method(z.object({ deviceId: z.number().int().nonnegative(
22012
22052
  field: "state",
22013
22053
  value: "armed_custom_bypass"
22014
22054
  },
22055
+ hold: { effects: [{
22056
+ field: "state",
22057
+ value: "arming",
22058
+ when: {
22059
+ field: "state",
22060
+ notIn: ["armed_custom_bypass"]
22061
+ }
22062
+ }] },
22015
22063
  args: { mode: "custom_bypass" },
22016
22064
  openArgs: [{
22017
22065
  key: "code",
@@ -1,8 +1,14 @@
1
- import type { VocabEffectValue } from './types.js';
1
+ import type { LooseVocabOpenArg, LooseVocabSideEffect, VocabEffectCondition, VocabEffectValue } from './types.js';
2
2
  /** The state a command leads to: a cap status field and the value it should hold. */
3
3
  export interface CommandEffect {
4
4
  readonly field: string;
5
5
  readonly value: VocabEffectValue;
6
+ /**
7
+ * How far a numeric reading may sit from `value` and still confirm it (D1061):
8
+ * the step of the number arg the value was copied from (brightness 1, a
9
+ * temperature target 0.5). Absent = the reading must equal the value.
10
+ */
11
+ readonly tolerance?: number;
6
12
  }
7
13
  /** Is `cap.method` a vocabulary action of a device-scope cap? */
8
14
  export declare function isCommand(cap: string, method: string): boolean;
@@ -14,3 +20,30 @@ export declare function isCommand(cap: string, method: string): boolean;
14
20
  export declare function commandEffect(cap: string, method: string, args: Readonly<Record<string, unknown>> | undefined): CommandEffect | null;
15
21
  /** The status fields of `cap` whose changes are recorded as transitions. */
16
22
  export declare function auditedFields(cap: string): ReadonlySet<string>;
23
+ /** The current slice of the command's cap, as a condition reads it. */
24
+ export type CommandSlice = Readonly<Record<string, unknown>> | undefined;
25
+ /** Does `slice` meet `when`? A field the slice lacks is in no list. */
26
+ export declare function effectConditionHolds(when: VocabEffectCondition | undefined, slice: CommandSlice): boolean;
27
+ /**
28
+ * One side effect resolved against the args and the slice the command acts
29
+ * on: `null` when the arg carrying its value is missing, or a `negate` names a
30
+ * field the slice holds no boolean in. `openArgs` lends a copied number its
31
+ * step as the tolerance.
32
+ */
33
+ export declare function resolveSideEffect(side: LooseVocabSideEffect, args: Readonly<Record<string, unknown>> | undefined, shown?: CommandSlice, openArgs?: readonly LooseVocabOpenArg[]): CommandEffect | null;
34
+ /**
35
+ * The hold limit the vocabulary declares for `cap.method(args)` (its action's
36
+ * `hold.holdMs`), or `undefined` for the default.
37
+ */
38
+ export declare function commandHoldMs(cap: string, method: string, args: Readonly<Record<string, unknown>> | undefined): number | undefined;
39
+ /**
40
+ * EVERY state the command `cap.method(args)` leads to (D1061): its `effect`
41
+ * first, then each side effect whose condition holds on `current` (the cap's
42
+ * slice the device reported when the command arrived). Empty when it leads to
43
+ * none. One field is named once — the first entry for it wins. A `negate`
44
+ * side effect flips what `shown` (the slice the person saw, held values
45
+ * included) holds, so a second toggle before the first is confirmed undoes it.
46
+ * An action that declares `hold.effects` is held as THOSE instead (a lock
47
+ * holds `locking`, not `locked`).
48
+ */
49
+ export declare function commandEffects(cap: string, method: string, args: Readonly<Record<string, unknown>> | undefined, current: CommandSlice, shown?: CommandSlice): readonly CommandEffect[];
@@ -24,7 +24,7 @@
24
24
  * every one of those names against the cap definition, and
25
25
  * `check-cap-vocabulary` checks values against the Zod schemas.
26
26
  */
27
- import type { LooseVocabActionGate, L10n, LooseVocabEffect, LooseVocabOffer, LooseVocabOverrides, LooseVocabStateTrigger, VocabEffectValue, VocabEventTrigger, VocabIcon } from './types.js';
27
+ import type { LooseVocabActionGate, L10n, LooseVocabEffect, LooseVocabOffer, LooseVocabActionHold, LooseVocabSideEffect, LooseVocabOverrides, LooseVocabStateTrigger, VocabEffectCondition, VocabEffectValue, VocabEventTrigger, VocabIcon } from './types.js';
28
28
  /** The operator-supplied keys of a method input (`deviceId` is the target). */
29
29
  export type MethodActionArgs<TInput> = TInput extends object ? Omit<TInput, 'deviceId'> : Record<never, never>;
30
30
  /** An open arg of a method action, keyed by the method's own input. */
@@ -42,6 +42,7 @@ export type MethodActionEffect<TKey extends string = string> = {
42
42
  } | {
43
43
  readonly field: string;
44
44
  readonly fromArg: TKey;
45
+ readonly scale?: number;
45
46
  };
46
47
  /**
47
48
  * When a device is offered an action: a read method of the same cap, and the
@@ -70,6 +71,23 @@ export interface MethodActionDecl<TInput = Readonly<Record<string, unknown>>> {
70
71
  readonly openArgs?: readonly MethodActionOpenArg<keyof MethodActionArgs<TInput> & string>[];
71
72
  /** The state this action leads to, when it is one. */
72
73
  readonly effect?: MethodActionEffect<keyof MethodActionArgs<TInput> & string>;
74
+ /** Further states the command leads to, each under an optional condition on the current slice (D1061). */
75
+ readonly sideEffects?: readonly ((MethodActionEffect<keyof MethodActionArgs<TInput> & string> | {
76
+ readonly field: string;
77
+ readonly negate: true;
78
+ }) & {
79
+ readonly when?: VocabEffectCondition;
80
+ })[];
81
+ /** How the hub holds the command before the device answers (D1061, {@link LooseVocabActionHold}). */
82
+ readonly hold?: {
83
+ readonly effects?: readonly ((MethodActionEffect<keyof MethodActionArgs<TInput> & string> | {
84
+ readonly field: string;
85
+ readonly negate: true;
86
+ }) & {
87
+ readonly when?: VocabEffectCondition;
88
+ })[];
89
+ readonly holdMs?: number;
90
+ };
73
91
  /** When the device is offered it at all — absent = always ({@link MethodActionGate}). */
74
92
  readonly offeredWhen?: MethodActionGate;
75
93
  }
@@ -82,6 +100,8 @@ export interface LooseMethodActionDecl {
82
100
  readonly args?: Readonly<Record<string, unknown>>;
83
101
  readonly openArgs?: readonly MethodActionOpenArg[];
84
102
  readonly effect?: LooseVocabEffect;
103
+ readonly sideEffects?: readonly LooseVocabSideEffect[];
104
+ readonly hold?: LooseVocabActionHold;
85
105
  readonly offeredWhen?: MethodActionGate;
86
106
  }
87
107
  /** What a declared cap event is to an automation: a trigger, or an excuse. */
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Hold limits a cap's vocabulary may declare on an action (D1061).
3
+ *
4
+ * A one-shot command (feed, run a script) has no lasting state to confirm; it
5
+ * holds its in-progress flag just long enough that a second tap, before the
6
+ * device reports, is seen as "already running" and refused.
7
+ */
8
+ export declare const ONE_SHOT_HOLD_MS = 10000;
@@ -7,9 +7,10 @@ export { actionGateAnswerFrom, actionOfferedWith, actionsForDevice, deviceOffers
7
7
  export type { ActionEffect, IndexedVocabAction, VocabActionRefusal, VocabCall, } from './action-index.js';
8
8
  export { actionEffect, allVocabActions, assertDeviceOffers, findVocabAction, VocabActionError, vocabActionIdFor, vocabCall, } from './action-index.js';
9
9
  export type { CommandEffect } from './command-catalog.js';
10
- export { auditedFields, commandEffect, isCommand } from './command-catalog.js';
10
+ export { auditedFields, commandEffect, commandEffects, commandHoldMs, effectConditionHolds, isCommand, resolveSideEffect, } from './command-catalog.js';
11
+ export type { CommandSlice } from './command-catalog.js';
11
12
  export { VOCAB_TEMPLATES } from './templates.js';
12
- export type { ActionArgKey, ActionArgs, BooleanOffer, CapEventName, CapMethodName, CapNestedNumericPath, CapStatusField, CapVocabularyEntry, CapVocabularyMap, DeviceCapVocabulary, DeviceVocabCapName, DynamicOffer, EnumOffer, EnumStateValue, L10n, LooseCapVocabularyEntry, LooseDynamicOffer, LooseVocabAction, LooseVocabActionGate, LooseVocabEffect, LooseVocabOffer, LooseVocabOpenArg, LooseVocabStateTrigger, NumberOffer, SystemCapVocabulary, SystemVocabCapName, TextOffer, VocabAction, VocabCapName, VocabChoice, VocabEffectFor, VocabEffectValue, VocabEventTrigger, VocabIcon, VocabLocale, VocabOffer, VocabOpenArg, VocabStateTrigger, } from './types.js';
13
+ export type { ActionArgKey, ActionArgs, BooleanOffer, CapEventName, CapMethodName, CapNestedNumericPath, CapStatusField, CapVocabularyEntry, CapVocabularyMap, DeviceCapVocabulary, DeviceVocabCapName, DynamicOffer, EnumOffer, EnumStateValue, L10n, LooseCapVocabularyEntry, LooseDynamicOffer, LooseVocabAction, LooseVocabActionGate, LooseVocabEffect, LooseVocabActionHold, LooseVocabSideEffect, VocabEffectCondition, LooseVocabOffer, LooseVocabOpenArg, LooseVocabStateTrigger, NumberOffer, SystemCapVocabulary, SystemVocabCapName, TextOffer, VocabAction, VocabCapName, VocabChoice, VocabEffectFor, VocabEffectValue, VocabEventTrigger, VocabIcon, VocabLocale, VocabOffer, VocabOpenArg, VocabStateTrigger, } from './types.js';
13
14
  export { CAP_VOCABULARY, CAP_VOCABULARY_BY_NAME } from './vocabulary.js';
14
15
  export type { CapVocabularyDecl, DeviceCapVocabularyDecl, EventVocabularyDecl, LooseMethodActionDecl, MethodActionArgs, MethodActionDecl, MethodActionEffect, MethodActionGate, MethodActionOpenArg, SystemCapVocabularyDecl, } from './declaration.js';
15
16
  export { NOT_A_DEVICE } from './system-reasons.js';
@@ -196,7 +196,56 @@ export type VocabEffectFor<C extends VocabCapName, M extends CapMethodName<C>> =
196
196
  } | {
197
197
  readonly field: CapStatusField<C>;
198
198
  readonly fromArg: ActionArgKey<C, M>;
199
+ /**
200
+ * A number arg in another unit than the field (minutes → seconds): the
201
+ * field holds `arg × scale`. Only on a number arg.
202
+ */
203
+ readonly scale?: number;
199
204
  };
205
+ /**
206
+ * A condition on the CURRENT slice of the action's cap (D1061): the side effect
207
+ * applies only when `field` holds one of `in`, or none of `notIn`. A field the
208
+ * slice lacks matches `notIn` and never matches `in`.
209
+ */
210
+ export type VocabEffectCondition = {
211
+ readonly field: string;
212
+ readonly in: readonly VocabEffectValue[];
213
+ } | {
214
+ readonly field: string;
215
+ readonly notIn: readonly VocabEffectValue[];
216
+ };
217
+ /**
218
+ * A further state a command leads to (D1061), beside its `effect`: setting a
219
+ * fan's speed while a preset runs also clears the preset. `negate` flips the
220
+ * boolean the person saw (`switch.toggle` → `on = !on`). Read by the core's
221
+ * command hold; never by a scheduler, which holds only `effect`.
222
+ */
223
+ export type VocabSideEffectFor<C extends VocabCapName, M extends CapMethodName<C>> = (VocabEffectFor<C, M> | {
224
+ readonly field: CapStatusField<C>;
225
+ readonly negate: true;
226
+ }) & {
227
+ readonly when?: {
228
+ readonly field: CapStatusField<C>;
229
+ readonly in: readonly VocabEffectValue[];
230
+ } | {
231
+ readonly field: CapStatusField<C>;
232
+ readonly notIn: readonly VocabEffectValue[];
233
+ };
234
+ };
235
+ /**
236
+ * How the hub holds an action's command (D1061) when its `effect` is not what
237
+ * to show before the device answers.
238
+ */
239
+ export interface VocabActionHoldFor<C extends VocabCapName, M extends CapMethodName<C>> {
240
+ /**
241
+ * Held INSTEAD of `effect` and `sideEffects`. A lock holds `locking`, never
242
+ * `locked`: a bolt that did not throw must never read as locked. A one-shot
243
+ * (feed, run) holds its in-progress flag, so a second tap is refused.
244
+ */
245
+ readonly effects?: readonly VocabSideEffectFor<C, M>[];
246
+ /** The hold's limit in ms (default 30 s). A one-shot is held only long enough to refuse a double tap. */
247
+ readonly holdMs?: number;
248
+ }
200
249
  /** One operator-facing action: a cap method call with a phrase. */
201
250
  export interface VocabActionFor<C extends VocabCapName, M extends CapMethodName<C>> {
202
251
  /** Stable id — persisted by pickers as a select value (`switch.on`). */
@@ -216,6 +265,10 @@ export interface VocabActionFor<C extends VocabCapName, M extends CapMethodName<
216
265
  readonly openArgs?: readonly VocabOpenArg<C, ActionArgKey<C, M>>[];
217
266
  /** The state this action leads to, when it is one (see {@link VocabEffectFor}). */
218
267
  readonly effect?: VocabEffectFor<C, M>;
268
+ /** Further states the command leads to, each under an optional condition (see {@link VocabSideEffectFor}). */
269
+ readonly sideEffects?: readonly VocabSideEffectFor<C, M>[];
270
+ /** How the hub holds this command while the device has not answered (see {@link VocabActionHoldFor}). */
271
+ readonly hold?: VocabActionHoldFor<C, M>;
219
272
  /** When a device is offered it at all: a read of this cap answering `false` at `field` withdraws it. */
220
273
  readonly offeredWhen?: {
221
274
  readonly method: CapMethodName<C>;
@@ -405,6 +458,14 @@ export type LooseVocabEffect = {
405
458
  } | {
406
459
  readonly field: string;
407
460
  readonly fromArg: string;
461
+ readonly scale?: number;
462
+ };
463
+ /** A side effect as a consumer reads it (see {@link VocabSideEffectFor}). */
464
+ export type LooseVocabSideEffect = (LooseVocabEffect | {
465
+ readonly field: string;
466
+ readonly negate: true;
467
+ }) & {
468
+ readonly when?: VocabEffectCondition;
408
469
  };
409
470
  /** An action as a consumer reads it. */
410
471
  export interface LooseVocabAction {
@@ -416,8 +477,15 @@ export interface LooseVocabAction {
416
477
  readonly args?: Readonly<Record<string, unknown>>;
417
478
  readonly openArgs?: readonly LooseVocabOpenArg[];
418
479
  readonly effect?: LooseVocabEffect;
480
+ readonly sideEffects?: readonly LooseVocabSideEffect[];
481
+ readonly hold?: LooseVocabActionHold;
419
482
  readonly offeredWhen?: LooseVocabActionGate;
420
483
  }
484
+ /** An action's hold as a consumer reads it (see {@link VocabActionHoldFor}). */
485
+ export interface LooseVocabActionHold {
486
+ readonly effects?: readonly LooseVocabSideEffect[];
487
+ readonly holdMs?: number;
488
+ }
421
489
  /** When a device is offered an action, string-keyed (`MethodActionGate`). */
422
490
  export interface LooseVocabActionGate {
423
491
  readonly method: string;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The command hold (D1061): the core shows a commanded value at once, by
3
+ * default, until the device confirms it, the call is refused, or the limit
4
+ * elapses. The vocabulary says WHAT a command leads to (`effect`,
5
+ * `sideEffects`); a provider may say, at its registration, that a method is
6
+ * never held, held longer or shorter, or leads to other fields. Never in a
7
+ * `*.cap.ts` or a manifest (D4).
8
+ *
9
+ * Pure: the resolution below reads the vocabulary and the option only, so the
10
+ * hub mirror and a spec ask the same question.
11
+ */
12
+ import type { CapabilityDefinition } from '../capabilities/capability-definition.js';
13
+ import { type CommandEffect, type CommandSlice } from './cap-vocabulary/command-catalog.js';
14
+ import type { LooseVocabSideEffect } from './cap-vocabulary/types.js';
15
+ /**
16
+ * How long a command is held when nothing says otherwise. Equal to the
17
+ * transition correlator's match window (D1022), so a hold that reverts and a
18
+ * command recorded `unconfirmed` are the same event.
19
+ */
20
+ export declare const DEFAULT_COMMAND_HOLD_MS = 30000;
21
+ /** The longest hold a provider may ask for: a value the device never confirms is not shown for long. */
22
+ export declare const MAX_COMMAND_HOLD_MS = 120000;
23
+ /** A provider's word on one command method. */
24
+ export type CommandHoldOption =
25
+ /** Never held: the slice moves only when the device reports. */
26
+ {
27
+ readonly hold: 'never';
28
+ } | {
29
+ readonly hold?: undefined;
30
+ /** The limit, in ms (clamped to 1 … {@link MAX_COMMAND_HOLD_MS}); absent = {@link DEFAULT_COMMAND_HOLD_MS}. */
31
+ readonly holdMs?: number;
32
+ /** REPLACES the vocabulary's effects for this method. */
33
+ readonly effects?: readonly LooseVocabSideEffect[];
34
+ /** Held IN ADDITION to the vocabulary's effects (a field already named keeps the first). */
35
+ readonly extraEffects?: readonly LooseVocabSideEffect[];
36
+ };
37
+ /** A provider's options, keyed by cap method name. Wire-safe (plain data). */
38
+ export type CommandHoldOptions = Readonly<Record<string, CommandHoldOption>>;
39
+ /** The options `registerNativeCap` takes, method names checked against the cap. */
40
+ export interface NativeCapOptions<TCap extends CapabilityDefinition = CapabilityDefinition> {
41
+ readonly commands?: Partial<Readonly<Record<keyof TCap['methods'] & string, CommandHoldOption>>>;
42
+ }
43
+ /** What the core holds for one command: the fields and the limit. */
44
+ export interface ResolvedCommandHold {
45
+ readonly effects: readonly CommandEffect[];
46
+ readonly holdMs: number;
47
+ }
48
+ /**
49
+ * What to hold for `cap.method(args)` given the cap's slice when it arrived
50
+ * (`current`, as the device reported it; `shown`, with the held values over
51
+ * it — what a `negate` flips) and the provider's option for the method.
52
+ * `null` = hold nothing (`never`, or a command that leads to no state).
53
+ */
54
+ export declare function resolveCommandHold(cap: string, method: string, args: Readonly<Record<string, unknown>> | undefined, current: CommandSlice, option: CommandHoldOption | undefined, shown?: CommandSlice): ResolvedCommandHold | null;
@@ -7,6 +7,7 @@ import type { AddonApi } from '../generated/addon-api.js';
7
7
  import type { DeviceProxy } from '../generated/device-proxy.js';
8
8
  import type { DeviceMeta, InitialDeviceMeta } from './device-management.js';
9
9
  import type { DeviceType } from './device-type.js';
10
+ import type { NativeCapOptions } from './command-hold.js';
10
11
  /** What a device states about the config it persists. */
11
12
  export interface DevicePersistConfigOptions {
12
13
  /** Dotted paths its schema declares secret (`collectZodSecretPaths`). */
@@ -105,8 +106,10 @@ export interface DeviceContext {
105
106
  */
106
107
  readonly streamProbe?: IKernelStreamProbe;
107
108
  /** Register a native provider for `cap` on the device this context belongs to.
108
- * Multiple calls for the same cap throw. */
109
- registerNativeCap<TCap extends CapabilityDefinition>(cap: TCap, provider: InferNativeProvider<TCap>): void;
109
+ * Multiple calls for the same cap throw. `options.commands` overrides the
110
+ * core's command hold per method (D1061): `{ hold: 'never' }`, another
111
+ * `holdMs`, or other effects — absent = the core default. */
112
+ registerNativeCap<TCap extends CapabilityDefinition>(cap: TCap, provider: InferNativeProvider<TCap>, options?: NativeCapOptions<TCap>): void;
110
113
  /**
111
114
  * Remove the native provider THIS context registered for `capName` (D663: the composer ungrafts an added cap when a
112
115
  * foreign native appears or the target is gone). OPTIONAL on the published interface: every `DeviceContext` fake in the