@camstack/types 1.2.587 → 1.2.589

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 (31) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/addon.js +2 -2
  3. package/dist/addon.mjs +2 -2
  4. package/dist/capabilities/alarm-panel.cap.d.ts +15 -7
  5. package/dist/capabilities/capability-definition.d.ts +12 -0
  6. package/dist/capabilities/device-manager.cap.d.ts +42 -0
  7. package/dist/capabilities/lock-control.cap.d.ts +5 -2
  8. package/dist/client.js +11 -7
  9. package/dist/client.mjs +11 -7
  10. package/dist/{composed-stable-id-CVbyajE5.js → composed-stable-id-DDv-Og0u.js} +0 -5
  11. package/dist/{composed-stable-id-BBL71oUQ.mjs → composed-stable-id-Kt5VKzGZ.mjs} +0 -5
  12. package/dist/device/device-feature-requirements.d.ts +0 -2
  13. package/dist/device/device-identity-candidates.d.ts +124 -0
  14. package/dist/device/device-type.d.ts +0 -5
  15. package/dist/device/index.d.ts +2 -0
  16. package/dist/generated/addon-api.d.ts +83 -0
  17. package/dist/generated/addon-cap-facts.d.ts +1 -1
  18. package/dist/generated/method-access-map.d.ts +1 -1
  19. package/dist/generated/runtime-state-durability.d.ts +5 -0
  20. package/dist/generated/system-proxy.d.ts +1 -1
  21. package/dist/{implemented-methods-u7ddjc-_.mjs → implemented-methods-BiV3Y-40.mjs} +1 -1
  22. package/dist/{implemented-methods-ChtdIofW.js → implemented-methods-CbdShcW1.js} +1 -1
  23. package/dist/index.d.ts +3 -0
  24. package/dist/index.js +198 -19
  25. package/dist/index.mjs +185 -20
  26. package/dist/node.js +2 -2
  27. package/dist/node.mjs +2 -2
  28. package/dist/schemas/api-catalog.d.ts +170 -0
  29. package/dist/{sleep-D6Pih0Qt.mjs → sleep-CFN40XWx.mjs} +5 -2
  30. package/dist/{sleep-CsZJsb8n.js → sleep-CICYFVJf.js} +5 -2
  31. package/package.json +1 -1
@@ -13,6 +13,11 @@ export interface RuntimeStatePolicy {
13
13
  * back at boot (D1024); the rest stay session values. Absent = the whole slice.
14
14
  */
15
15
  readonly restoredFields?: readonly string[];
16
+ /**
17
+ * `{ old: new }` field renames of a `restored` slice: a row persisted
18
+ * before the rename is read once into the new name at boot (`restoredPart`).
19
+ */
20
+ readonly renamedFields?: Readonly<Record<string, string>>;
16
21
  }
17
22
  /**
18
23
  * Per-cap runtime-state policy, projected from every `*.cap.ts` that declares
@@ -94,7 +94,7 @@ export interface SystemProxy {
94
94
  readonly deviceCredentials: Pick<InferProvider<typeof deviceCredentialsCapability>, 'listDeviceCredentials' | 'startEnrollment' | 'revokeDeviceCredential' | 'getDeviceCertificateSettings' | 'setDeviceCertificateSettings' | 'deleteDeviceCredential' | 'getDeviceCaStatus' | 'renameDeviceCredential'>;
95
95
  readonly deviceExport: Pick<InferProvider<typeof deviceExportCapability>, 'getStatus' | 'listInstances' | 'listSupportedDeviceKinds' | 'listExposedDevices' | 'exposeDevice' | 'unexposeDevice' | 'setExposedName' | 'listSupportedEntityKinds' | 'listExposedEntities' | 'exposeEntity' | 'unexposeEntity'>;
96
96
  readonly deviceHistory: Pick<InferProvider<typeof deviceHistoryCapability>, 'listNodeSeries' | 'queryNode' | 'queryMany' | 'declareSeries' | 'record' | 'recordBuckets' | 'getStatus' | 'listOrphanSeries' | 'deleteOrphanSeries'>;
97
- readonly deviceManager: Pick<InferProvider<typeof deviceManagerCapability>, 'allocateDeviceId' | 'migrateDevice' | 'registerDevice' | 'removeDevice' | 'persistConfig' | 'renderDeviceTemplates' | 'checkDeviceTemplates' | 'getRoleDisplayDefaults' | 'setRoleDisplayDefaults' | 'listLocations' | 'addLocation' | 'removeLocation' | 'renameLocation' | 'listLocationIcons' | 'setLocationIcon' | 'listLocationDescriptions' | 'setLocationDescription' | 'listSiteZones' | 'setSiteZone' | 'removeSiteZone' | 'renameSiteZone' | 'setLocationZone' | 'listPersistedByAddon' | 'listAll' | 'search' | 'getChildren' | 'getChildrenBatch' | 'getLinkedDevicesBatch' | 'listDeletedSince' | 'cleanupDeletedDevicesData' | 'removeByIntegration' | 'getBindingsBatch' | 'getAllBindings' | 'listDeviceIdsByCaps' | 'listWrappersForCap' | 'listBindableCapsForDeviceType' | 'discoverDevices' | 'adoptDevice' | 'getCreationSchema' | 'createDevice' | 'testCreationField' | 'adoptionListCandidateFilters' | 'adoptionListCandidates' | 'adoptionRefresh' | 'adoptionAdopt' | 'adoptionRelease' | 'adoptionStartJob' | 'adoptionListJobs' | 'adoptionCancelJob' | 'adoptionResync' | 'discoveryProviders' | 'discoverAllProviders' | 'discoverProvider' | 'listDiscoveryProposals' | 'dismissDiscoveryProposal' | 'reportDiscoveryObservations' | 'runDiscoverySweep' | 'providerCreationType' | 'providerDiscoveryParamsSchema' | 'getDeviceStatusAggregateBatch'>;
97
+ readonly deviceManager: Pick<InferProvider<typeof deviceManagerCapability>, 'allocateDeviceId' | 'migrateDevice' | 'registerDevice' | 'removeDevice' | 'persistConfig' | 'renderDeviceTemplates' | 'checkDeviceTemplates' | 'getRoleDisplayDefaults' | 'setRoleDisplayDefaults' | 'listIdentityCandidates' | 'listLocations' | 'addLocation' | 'removeLocation' | 'renameLocation' | 'listLocationIcons' | 'setLocationIcon' | 'listLocationDescriptions' | 'setLocationDescription' | 'listSiteZones' | 'setSiteZone' | 'removeSiteZone' | 'renameSiteZone' | 'setLocationZone' | 'listPersistedByAddon' | 'listAll' | 'search' | 'getChildren' | 'getChildrenBatch' | 'getLinkedDevicesBatch' | 'listDeletedSince' | 'cleanupDeletedDevicesData' | 'removeByIntegration' | 'getBindingsBatch' | 'getAllBindings' | 'listDeviceIdsByCaps' | 'listWrappersForCap' | 'listBindableCapsForDeviceType' | 'discoverDevices' | 'adoptDevice' | 'getCreationSchema' | 'createDevice' | 'testCreationField' | 'adoptionListCandidateFilters' | 'adoptionListCandidates' | 'adoptionRefresh' | 'adoptionAdopt' | 'adoptionRelease' | 'adoptionStartJob' | 'adoptionListJobs' | 'adoptionCancelJob' | 'adoptionResync' | 'discoveryProviders' | 'discoverAllProviders' | 'discoverProvider' | 'listDiscoveryProposals' | 'dismissDiscoveryProposal' | 'reportDiscoveryObservations' | 'runDiscoverySweep' | 'providerCreationType' | 'providerDiscoveryParamsSchema' | 'getDeviceStatusAggregateBatch'>;
98
98
  readonly deviceProvider: Pick<InferProvider<typeof deviceProviderCapability>, 'start' | 'stop' | 'getStatus' | 'getDevices' | 'reloadDevice' | 'supportsDiscovery' | 'discoverDevices' | 'getDiscoveryModes' | 'classifyDiscoveryHits' | 'getDiscoveryParamsSchema' | 'getManualCreationType' | 'adoptDiscoveredDevice' | 'supportsManualCreation' | 'getChildCreationSchema' | 'createDevice' | 'testCreationField'>;
99
99
  readonly deviceState: Pick<InferProvider<typeof deviceStateCapability>, 'getAllSnapshots' | 'listClaims'>;
100
100
  readonly displayPalette: Pick<InferProvider<typeof displayPaletteCapability>, 'getPalette' | 'listPresets' | 'setPalette'>;
@@ -1,4 +1,4 @@
1
- import { a as DeviceType, i as DeviceRole, t as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./composed-stable-id-BBL71oUQ.mjs";
1
+ import { a as DeviceType, i as DeviceRole, t as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./composed-stable-id-Kt5VKzGZ.mjs";
2
2
  import { z } from "zod";
3
3
  import { createHash } from "node:crypto";
4
4
  //#region src/ffmpeg/invocation.ts
@@ -1,4 +1,4 @@
1
- const require_composed_stable_id = require("./composed-stable-id-CVbyajE5.js");
1
+ const require_composed_stable_id = require("./composed-stable-id-DDv-Og0u.js");
2
2
  let zod = require("zod");
3
3
  let node_crypto = require("node:crypto");
4
4
  //#region src/ffmpeg/invocation.ts
package/dist/index.d.ts CHANGED
@@ -190,6 +190,7 @@ export { type BearerPayloadShape, type BearerPrincipal, classifyBearerPrincipal,
190
190
  export { ADMIN_SCOPE, ALL_METHOD_ACCESS, type AddonRoutesScope, AddonRoutesScopeSchema, capabilityScopesOf, CREDENTIAL_TOKEN_AUDIENCE, CREDENTIAL_TOKEN_KIND, isCredentialTokenPayload, type CredentialScope, CredentialScopeSchema, type CredentialTokenClaims, CredentialTokenClaimsSchema, parseCredentialScopes, PREFERENCES_SELF_SCOPE, type PreferencesSelfScope, PreferencesSelfScopeSchema, SHARE_VIEW_MAX_DEVICES, scopesAllowAddonRoutes, scopesAllowOwnPreferences, scopesGrantAdmin, type ShareViewGrant, ShareViewGrantSchema, type ShareViewScope, ShareViewScopeSchema, shareViewGrantOf, } from './auth/credential-scope.js';
191
191
  export { DEFAULT_VIEWER_SCOPE, featureOfRole, type MethodRole, type MethodRoleDecl, type MethodRoleSource, methodRoleOf, resolveMethodRole, type ViewerAncestorLookup, viewerAdmitsDevice, type ViewerDeviceAllow, ViewerDeviceAllowSchema, VIEWER_FEATURE_IDS, VIEWER_FEATURES, type ViewerFeatureId, ViewerFeatureIdSchema, type ViewerFeatureSpec, viewerHoldsRole, type ViewerTokenScope, ViewerTokenScopeSchema, } from './auth/viewer-access.js';
192
192
  export { type PreferenceNamespace, PreferenceNamespaceSchema, type PreferenceRow, PreferenceRowSchema, type PreferenceValue, PreferenceValueSchema, PreferenceDeviceIdSchema, type PreferencesChangedSinceInput, PreferencesChangedSinceInputSchema, type PreferencesChangedSinceOutput, PreferencesChangedSinceOutputSchema, type PreferencesDeleteInput, PreferencesDeleteInputSchema, type PreferencesDeleteOutput, PreferencesDeleteOutputSchema, type PreferencesGetInput, PreferencesGetInputSchema, type PreferencesGetOutput, PreferencesGetOutputSchema, type PreferencesPutInput, PreferencesPutInputSchema, type PreferencesPutOutput, PreferencesPutOutputSchema, PREFERENCES_MAX_DEVICE_ID_LENGTH, PREFERENCES_MAX_NAMESPACES, PREFERENCES_MAX_VALUE_BYTES, PREFERENCES_NAMESPACE_PATTERN, } from './schemas/user-preferences.js';
193
+ export { type ApiCallable, ApiCallableSchema, type ApiCatalogEntry, ApiCatalogEntrySchema, type ApiCatalogInputSchemaOutput, ApiCatalogInputSchemaOutputSchema, type ApiCatalogListOutput, ApiCatalogListOutputSchema, type ApiCatalogMethod, ApiCatalogMethodSchema, type ApiCatalogScope, ApiCatalogScopeSchema, type ApiProcedureKind, ApiProcedureKindSchema, type ApiProcedureTier, ApiProcedureTierSchema, type JsonSchemaDocument, JsonSchemaDocumentSchema, } from './schemas/api-catalog.js';
193
194
  export { APP_AUTH_CALLBACK_MAX_LENGTH, APP_AUTH_CALLBACK_URLS, canonicalizeAppCallback, hasUrlScheme, parseAppAuthCallback, } from './auth/app-callback.js';
194
195
  export { APP_FLOW_DEFAULT_REDIRECT, APP_FLOW_REFUSAL_MESSAGES, APP_FLOW_STATE_PREFIX, APP_REFUSED_PATH, APP_START_REFUSAL_MESSAGES, type AppFlowParse, type AppFlowPurpose, AppFlowPurposeSchema, type AppFlowRefusal, type AppFlowRequest, type AppPageLang, AppPageLangSchema, type AppLoginPath, AppLoginPathSchema, type AppStartRefusal, appFlowLocation, isAppStartRefusal, parseAppFlowRequest, parseAppPageLang, } from './auth/app-flow.js';
195
196
  export { SSO_STATE_COOKIE, SSO_STATE_COOKIE_MAX_AGE_SEC } from './auth/sso-state.js';
@@ -275,6 +276,8 @@ export { DEVICE_IDENTIFIER_KEYS, DeviceIdentifierEntrySchema, DeviceIdentifierKe
275
276
  export type { AcceptedValue, DeviceIdentifierEntry, DeviceIdentifierKey, DeviceIdentifierOrigin, DeviceIdentifiers, DeviceIdentifierStrength, NormaliseIdentifiersOptions, NormalisedIdentifiers, NormaliseResult, RawDeviceIdentifiers, RawSerialIdentifier, RawVendorUidIdentifier, RejectedIdentifier, RejectedReason, } from './device/device-identifiers.js';
276
277
  export { declareDeviceIdentifiers } from './device/declare-identifiers.js';
277
278
  export type { DeclareIdentifiersDeps, DeclareIdentifiersOptions, DeclareIdentifiersOutcome, DeclareIdentifiersResult, IdentifiersWriter, SetIdentifiersInput, } from './device/declare-identifiers.js';
279
+ export { IdentityCandidateDeviceSchema, IdentityCandidatePairSchema, IdentityCandidatesSchema, IdentityConfidenceSchema, IdentityMatchedKeySchema, } from './device/device-identity-candidates.js';
280
+ export type { IdentityCandidateDevice, IdentityCandidatePair, IdentityCandidates, IdentityConfidence, IdentityMatchedKey, } from './device/device-identity-candidates.js';
278
281
  export type { ChildLayout, ChildLayoutEntry, CreateDeviceSpec, DeviceCapDisplayOverride, DeviceDiscovery, DeviceDisplayOverride, DeviceManualCreation, DeviceMeta, DiscoveredDevice, InitialDeviceMeta, RoleDisplayDefault, SavedDevice, } from './device/device-management.js';
279
282
  export type { DeviceProfile, DeviceProfileDefaults, DeviceProfileMatch, PipelinePhaseMode, } from './device/device-profile.js';
280
283
  export { BATTERY_DEVICE_PROFILE, DEVICE_PROFILES, deviceMatchesProfile, resolveDeviceProfile, } from './device/device-profile.js';
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-CsZJsb8n.js");
2
+ const require_sleep = require("./sleep-CICYFVJf.js");
3
3
  const require_event_category = require("./event-category-CE_VCE2G.js");
4
- const require_composed_stable_id = require("./composed-stable-id-CVbyajE5.js");
5
- const require_implemented_methods = require("./implemented-methods-ChtdIofW.js");
4
+ const require_composed_stable_id = require("./composed-stable-id-DDv-Og0u.js");
5
+ const require_implemented_methods = require("./implemented-methods-CbdShcW1.js");
6
6
  const require_node_color = require("./node-color.js");
7
7
  const require_convert = require("./convert-BI8iTXn6.js");
8
8
  const require_device_template_catalogue = require("./device-template-catalogue.js");
@@ -30566,6 +30566,70 @@ var PreferencesChangedSinceOutputSchema = zod.z.object({
30566
30566
  deleted: zod.z.array(PreferenceNamespaceSchema)
30567
30567
  });
30568
30568
  //#endregion
30569
+ //#region src/schemas/api-catalog.ts
30570
+ /**
30571
+ * The wire shapes of `apiCatalog.*` — the API explorer's data (planning#595).
30572
+ *
30573
+ * One entry per tRPC method the hub serves, capability and core routes alike,
30574
+ * read off the live router by the hub (never a hand-written list).
30575
+ */
30576
+ var ApiProcedureKindSchema = zod.z.enum([
30577
+ "query",
30578
+ "mutation",
30579
+ "subscription"
30580
+ ]);
30581
+ /** The gate a method runs behind. */
30582
+ var ApiProcedureTierSchema = zod.z.enum([
30583
+ "public",
30584
+ "protected",
30585
+ "admin"
30586
+ ]);
30587
+ /** The token scope a capability route is matched against (its `METHOD_ACCESS_MAP` row). */
30588
+ var ApiCatalogScopeSchema = zod.z.object({
30589
+ capName: zod.z.string(),
30590
+ capScope: zod.z.enum(["device", "system"]),
30591
+ access: zod.z.enum([
30592
+ "view",
30593
+ "create",
30594
+ "delete"
30595
+ ]),
30596
+ role: zod.z.string()
30597
+ });
30598
+ var ApiCatalogEntrySchema = zod.z.object({
30599
+ /** `<router>.<method>` — the tRPC path. */
30600
+ path: zod.z.string(),
30601
+ router: zod.z.string(),
30602
+ method: zod.z.string(),
30603
+ kind: ApiProcedureKindSchema,
30604
+ tier: ApiProcedureTierSchema,
30605
+ source: zod.z.enum(["capability", "core"]),
30606
+ /** `null` on a core route: it needs authentication only (plus admin where its tier says so). */
30607
+ scope: ApiCatalogScopeSchema.nullable(),
30608
+ hasInput: zod.z.boolean()
30609
+ });
30610
+ /**
30611
+ * May the CALLER call a method. The list has no input, so a method reached
30612
+ * only through a device grant is `per-device`: the real call is allowed or
30613
+ * refused on the device its input names.
30614
+ */
30615
+ var ApiCallableSchema = zod.z.enum([
30616
+ "yes",
30617
+ "no",
30618
+ "per-device"
30619
+ ]);
30620
+ var ApiCatalogMethodSchema = ApiCatalogEntrySchema.extend({ callable: ApiCallableSchema });
30621
+ var ApiCatalogListOutputSchema = zod.z.object({ methods: zod.z.array(ApiCatalogMethodSchema) });
30622
+ /** A JSON Schema document, as the explorer receives it. */
30623
+ var JsonSchemaDocumentSchema = zod.z.record(zod.z.string(), zod.z.unknown());
30624
+ var ApiCatalogInputSchemaOutputSchema = zod.z.object({
30625
+ path: zod.z.string(),
30626
+ hasInput: zod.z.boolean(),
30627
+ /** The INPUT JSON schema (what the caller sends); `null` without input or when it could not be produced. */
30628
+ schema: JsonSchemaDocumentSchema.nullable(),
30629
+ /** Why no schema could be produced (a non-Zod parser, an unrepresentable type). */
30630
+ error: zod.z.string().nullable()
30631
+ });
30632
+ //#endregion
30569
30633
  //#region src/auth/app-callback.ts
30570
30634
  /**
30571
30635
  * The viewer app's custom-scheme callback — the ONE list of URLs a hub flow
@@ -41536,9 +41600,8 @@ var airQualitySensorCapability = {
41536
41600
  * Many panels require a PIN code on arm / disarm — the optional
41537
41601
  * `code` field on the methods passes it through to the upstream
41538
41602
  * service; it's NEVER persisted in the runtime slice or any event
41539
- * payload. The presence of a required code is signalled by
41540
- * `DeviceFeature.AlarmPinRequired` so the UI gates a code-entry
41541
- * field without a slice fetch.
41603
+ * payload. Whether a code is required is the slice's `codeRequired`
41604
+ * (#459): `null` when the provider cannot tell (D393).
41542
41605
  *
41543
41606
  * `availableModes` mirrors HA's `supported_features`-derived arm
41544
41607
  * mode list — the UI renders only the buttons the panel accepts.
@@ -41577,9 +41640,13 @@ var AlarmPanelStatusSchema = zod.z.object({
41577
41640
  /** Subset of arm modes the panel accepts. UI renders one button per
41578
41641
  * mode in this list. */
41579
41642
  availableModes: zod.z.array(AlarmArmModeSchema),
41580
- /** Whether the panel requires a PIN on arm / disarm. Mirrors
41581
- * `DeviceFeature.AlarmPinRequired` for slice consumers. */
41582
- requiresCode: zod.z.boolean(),
41643
+ /**
41644
+ * Whether the panel requires a PIN on arm / disarm (#459; the field was
41645
+ * `requiresCode`, and the `alarm-pin-required` device feature is gone).
41646
+ * `null` = the provider cannot tell (D393), never `false`. A slice restored
41647
+ * from before the rename is upgraded at boot by `restoredFieldRenames`.
41648
+ */
41649
+ codeRequired: zod.z.boolean().nullable(),
41583
41650
  /** Ms epoch when the slice was last updated. */
41584
41651
  lastChangedAt: zod.z.number()
41585
41652
  });
@@ -41636,7 +41703,7 @@ var alarmPanelCapability = {
41636
41703
  arm: require_sleep.method(zod.z.object({
41637
41704
  deviceId: zod.z.number().int().nonnegative(),
41638
41705
  mode: AlarmArmModeSchema,
41639
- /** Optional PIN code. Required when `requiresCode === true`.
41706
+ /** Optional PIN code. Required when `codeRequired === true`.
41640
41707
  * Passed through to the upstream service; never persisted. */
41641
41708
  code: zod.z.string().min(1).optional()
41642
41709
  }), zod.z.void(), {
@@ -41753,7 +41820,7 @@ var alarmPanelCapability = {
41753
41820
  /**
41754
41821
  * Runtime-state slice — mirrored by the kernel. UI panel reads the
41755
41822
  * full slice; renders an arm button per `availableModes` entry and
41756
- * a PIN field iff `requiresCode === true`.
41823
+ * a PIN field iff `codeRequired === true`.
41757
41824
  */
41758
41825
  runtimeState: AlarmPanelStatusSchema,
41759
41826
  /**
@@ -41764,6 +41831,13 @@ var alarmPanelCapability = {
41764
41831
  */
41765
41832
  durability: "restored",
41766
41833
  /**
41834
+ * A slice persisted before #459 carries `requiresCode`; the boot seed reads it
41835
+ * once into `codeRequired` (`restoredPart`), so no reader meets the old key,
41836
+ * and rewrites the row once without it (`seedMirrorFromRow`) — so this entry
41837
+ * can be dropped after every node has booted once on a release that has it.
41838
+ */
41839
+ restoredFieldRenames: { requiresCode: "codeRequired" },
41840
+ /**
41767
41841
  * History (D850): the panel's lifecycle state as an `enum` series —
41768
41842
  * change-only, no floor, so an `arming -> pending -> triggered` sequence of a
41769
41843
  * few seconds keeps every step. Who armed it stays in the events ledger.
@@ -56822,6 +56896,71 @@ function sameIdentifiers(a, b) {
56822
56896
  return canonical(a) === canonical(b);
56823
56897
  }
56824
56898
  //#endregion
56899
+ //#region src/device/device-identity-candidates.ts
56900
+ /**
56901
+ * Cross-integration identity candidates (planning#593, step 2 of D1059's epic).
56902
+ *
56903
+ * Two devices brought by DIFFERENT integrations that share provider-declared
56904
+ * identifiers ({@link DeviceIdentifiers}) are candidates for being the same
56905
+ * physical object. This module holds the answer's shape; the device-manager
56906
+ * keeps the index that finds the pairs and the ONE rule that grades a match
56907
+ * (`classifyIdentityMatch`, `device-identity-index.ts`).
56908
+ *
56909
+ * The rule (operator, planning#590):
56910
+ *
56911
+ * | Matched keys | Confidence |
56912
+ * | ---------------------------------------------- | ----------- |
56913
+ * | two strong KINDS (e.g. `mac` + `serial`) | `auto` |
56914
+ * | `mac` + `ip` | `auto` |
56915
+ * | exactly one strong kind | `proposal` |
56916
+ * | weak keys only (`hostname`, `ip`) | no candidate|
56917
+ *
56918
+ * Strength counts distinct KINDS, not values: two MACs of one device matching
56919
+ * the other's two MACs are still one kind of evidence, so a proposal. In doubt,
56920
+ * no match.
56921
+ *
56922
+ * Read-only: a candidate is NOT a link. Links are step 3.
56923
+ */
56924
+ var IdentityConfidenceSchema = zod.z.enum(["auto", "proposal"]);
56925
+ /** One identifier both devices declared, with the same normalised value. */
56926
+ var IdentityMatchedKeySchema = zod.z.object({
56927
+ key: DeviceIdentifierKeySchema,
56928
+ value: zod.z.string()
56929
+ });
56930
+ /** One side of a pair: the device and the integration that brought it. */
56931
+ var IdentityCandidateDeviceSchema = zod.z.object({
56932
+ deviceId: zod.z.number().int(),
56933
+ addonId: zod.z.string(),
56934
+ /** The integration instance (`int_NNNN`) that adopted it; `null` when none was stamped. */
56935
+ integrationId: zod.z.string().nullable()
56936
+ });
56937
+ /** Two devices of different integrations sharing at least one strong identifier. `a.deviceId < b.deviceId`. */
56938
+ var IdentityCandidatePairSchema = zod.z.object({
56939
+ a: IdentityCandidateDeviceSchema,
56940
+ b: IdentityCandidateDeviceSchema,
56941
+ /** Every identifier the two share, weak ones included, ordered by key then value. */
56942
+ keys: zod.z.array(IdentityMatchedKeySchema).readonly(),
56943
+ confidence: IdentityConfidenceSchema
56944
+ });
56945
+ /**
56946
+ * The answer of `device-manager.listIdentityCandidates`.
56947
+ *
56948
+ * - `unknown` — the index has not loaded yet: nothing can be said, and it is
56949
+ * NOT an empty list (D315).
56950
+ * - `answered` — `pairs` holds every candidate. `undeclaredDeviceIds` are the
56951
+ * devices with no identifiers on record: whether they match anything is
56952
+ * UNKNOWN, never "no match" (D393). A device absent from both lists declared
56953
+ * identifiers and matched nobody.
56954
+ */
56955
+ var IdentityCandidatesSchema = zod.z.discriminatedUnion("status", [zod.z.object({
56956
+ status: zod.z.literal("unknown"),
56957
+ reason: zod.z.string()
56958
+ }), zod.z.object({
56959
+ status: zod.z.literal("answered"),
56960
+ pairs: zod.z.array(IdentityCandidatePairSchema).readonly(),
56961
+ undeclaredDeviceIds: zod.z.array(zod.z.number().int()).readonly()
56962
+ })]);
56963
+ //#endregion
56825
56964
  //#region src/capabilities/device-search.ts
56826
56965
  /**
56827
56966
  * `deviceManager.search` — the query behind the device → value picker.
@@ -58077,6 +58216,18 @@ var deviceManagerCapability = {
58077
58216
  kind: "mutation",
58078
58217
  auth: "admin"
58079
58218
  }),
58219
+ /** Cross-integration identity candidates (planning#593) — READ-ONLY, links
58220
+ * nothing. Every pair of devices from DIFFERENT integrations that share a
58221
+ * strong identifier, with the keys they share and a confidence: `auto` (two
58222
+ * strong kinds, or `mac` + `ip`), `proposal` (one strong kind). Weak keys
58223
+ * alone never pair; a same-integration match is no candidate. Answered from
58224
+ * the device-manager's identifier index, never a fleet scan. `unknown`
58225
+ * until the index has loaded (never an empty list); `undeclaredDeviceIds`
58226
+ * are the devices whose identity is unknown, never "no match". */
58227
+ listIdentityCandidates: require_sleep.method(zod.z.object({}), IdentityCandidatesSchema, {
58228
+ kind: "query",
58229
+ auth: "admin"
58230
+ }),
58080
58231
  /** Operator-curated location registry. Returns the union of:
58081
58232
  * (1) labels persisted in the registry via `addLocation`, and
58082
58233
  * (2) labels currently in use on at least one device's
@@ -69818,8 +69969,8 @@ var localNetworkCapability = {
69818
69969
  * (workplace keypad locks, hospitality). The optional `code` field
69819
69970
  * on the methods passes it through to the upstream service — the
69820
69971
  * code is NEVER persisted in the runtime slice or any event payload.
69821
- * Locks that REQUIRE a code set `DeviceFeature.LockPinRequired` so
69822
- * the UI gates a code-entry field without a slice fetch.
69972
+ * Whether a lock REQUIRES a code is the slice's `codeRequired` (#459):
69973
+ * `true` / `false` when the provider knows, `null` when it does not (D393).
69823
69974
  *
69824
69975
  * Locks that support a latch-release ("open door") action advertise
69825
69976
  * `DeviceFeature.LockOpen`. The `open` method triggers the latch
@@ -69848,6 +69999,13 @@ var LockControlStatusSchema = zod.z.object({
69848
69999
  /** Lifecycle state of the lock. `jammed` means the motor reported
69849
70000
  * failure to reach the target — operator intervention required. */
69850
70001
  state: LockStateSchema,
70002
+ /**
70003
+ * Whether lock / unlock need a PIN `code` (#459, replaces the
70004
+ * `lock-pin-required` device feature). `null` = the provider cannot tell
70005
+ * (D393) — never `false`. `.optional()` so a restored slice written before
70006
+ * the field still parses; readers treat absent exactly like `null`.
70007
+ */
70008
+ codeRequired: zod.z.boolean().nullable().optional(),
69851
70009
  /** Ms epoch when the slice was last updated. */
69852
70010
  lastChangedAt: zod.z.number()
69853
70011
  });
@@ -115768,8 +115926,8 @@ var ALARM_MODES = [
115768
115926
  "vacation",
115769
115927
  "custom_bypass"
115770
115928
  ];
115771
- function alarmControls(state, modes, requiresCode) {
115772
- if (requiresCode) return [];
115929
+ function alarmControls(state, modes, codeRequired) {
115930
+ if (codeRequired) return [];
115773
115931
  const disarm = asAction(action("alarm.disarm", require_sleep.t("Disarm", "Disinserisci"), "shield-off", "alarm-panel", "disarm", {}, "primary"));
115774
115932
  const arm = (primaryFirst) => modes.map((mode, i) => asAction(action(`alarm.arm.${mode}`, ARM_LABELS[mode], "shield-check", "alarm-panel", "arm", { mode }, primaryFirst && i === 0 ? "primary" : "normal")));
115775
115933
  switch (state) {
@@ -115789,7 +115947,7 @@ var ACCESS_FAMILY_CONTRIBUTIONS = {
115789
115947
  const modes = slice === void 0 ? ALARM_MODES : slice.availableModes;
115790
115948
  return {
115791
115949
  reading: reading("alarm-panel", words?.state ?? "unknown", false, words?.title),
115792
- rows: [row$1("alarm", state === "triggered" ? "shield-alert" : state === "disarmed" ? "shield-off" : "shield-check", joinText([words?.title ?? NOT_REPORTED, since]), alarmControls(state, modes, slice?.requiresCode ?? false))],
115950
+ rows: [row$1("alarm", state === "triggered" ? "shield-alert" : state === "disarmed" ? "shield-off" : "shield-check", joinText([words?.title ?? NOT_REPORTED, since]), alarmControls(state, modes, slice?.codeRequired !== false))],
115793
115951
  ...since === null || words === null ? {} : { facts: [fact("since", "clock", since, state === "triggered" ? "danger" : "muted")] },
115794
115952
  ...words === null ? {} : { tiles: {
115795
115953
  left: [{
@@ -122184,6 +122342,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
122184
122342
  access: "view",
122185
122343
  role: "admin"
122186
122344
  },
122345
+ "deviceManager.listIdentityCandidates": {
122346
+ capName: "device-manager",
122347
+ capScope: "system",
122348
+ addonId: null,
122349
+ access: "view",
122350
+ role: "admin"
122351
+ },
122187
122352
  "deviceManager.listLocationDescriptions": {
122188
122353
  capName: "device-manager",
122189
122354
  capScope: "system",
@@ -131193,7 +131358,6 @@ var DEVICE_FEATURE_REQUIREMENTS = {
131193
131358
  [require_composed_stable_id.DeviceFeature.FanPreset]: bound("fan-control", ["setPreset"]),
131194
131359
  [require_composed_stable_id.DeviceFeature.FanDirection]: bound("fan-control", ["setDirection"]),
131195
131360
  [require_composed_stable_id.DeviceFeature.FanOscillating]: bound("fan-control", ["setOscillating"]),
131196
- [require_composed_stable_id.DeviceFeature.LockPinRequired]: reported(CAP_PENDING),
131197
131361
  [require_composed_stable_id.DeviceFeature.LockOpen]: bound("lock-control", ["open"]),
131198
131362
  [require_composed_stable_id.DeviceFeature.MediaPlayerSeek]: bound("media-player", ["seek"]),
131199
131363
  [require_composed_stable_id.DeviceFeature.MediaPlayerVolume]: bound("media-player", ["setVolume"]),
@@ -131208,7 +131372,6 @@ var DEVICE_FEATURE_REQUIREMENTS = {
131208
131372
  [require_composed_stable_id.DeviceFeature.MediaPlayerVolumeStep]: bound("media-player", ["volumeUp", "volumeDown"]),
131209
131373
  [require_composed_stable_id.DeviceFeature.MediaPlayerChannelStep]: bound("media-player", ["channelUp", "channelDown"]),
131210
131374
  [require_composed_stable_id.DeviceFeature.MediaPlayerPower]: bound("media-player", ["turnOn", "turnOff"]),
131211
- [require_composed_stable_id.DeviceFeature.AlarmPinRequired]: reported(CAP_PENDING),
131212
131375
  [require_composed_stable_id.DeviceFeature.PresenceGps]: reported(CAP_PENDING),
131213
131376
  [require_composed_stable_id.DeviceFeature.NotifierImage]: reported(CAP_PENDING),
131214
131377
  [require_composed_stable_id.DeviceFeature.NotifierPriority]: reported(CAP_PENDING),
@@ -136354,7 +136517,8 @@ var RUNTIME_STATE_POLICY = {
136354
136517
  },
136355
136518
  "alarm-panel": {
136356
136519
  durability: "restored",
136357
- volatileFields: ["lastChangedAt"]
136520
+ volatileFields: ["lastChangedAt"],
136521
+ renamedFields: { requiresCode: "codeRequired" }
136358
136522
  },
136359
136523
  "ambient-light-sensor": {
136360
136524
  durability: "restored",
@@ -137539,6 +137703,7 @@ function createSystemProxy(api) {
137539
137703
  checkDeviceTemplates: (input) => dispatch("deviceManager", "checkDeviceTemplates", "query", input),
137540
137704
  getRoleDisplayDefaults: (input) => dispatch("deviceManager", "getRoleDisplayDefaults", "query", input),
137541
137705
  setRoleDisplayDefaults: (input) => dispatch("deviceManager", "setRoleDisplayDefaults", "mutation", input),
137706
+ listIdentityCandidates: (input) => dispatch("deviceManager", "listIdentityCandidates", "query", input),
137542
137707
  listLocations: (input) => dispatch("deviceManager", "listLocations", "query", input),
137543
137708
  addLocation: (input) => dispatch("deviceManager", "addLocation", "mutation", input),
137544
137709
  removeLocation: (input) => dispatch("deviceManager", "removeLocation", "mutation", input),
@@ -150539,6 +150704,14 @@ exports.AlertSourceSchema = AlertSourceSchema;
150539
150704
  exports.AlertStatusSchema = AlertStatusSchema;
150540
150705
  exports.AmbientLightSensorStatusSchema = AmbientLightSensorStatusSchema;
150541
150706
  exports.AnalyticsLtsSeriesSchema = AnalyticsLtsSeriesSchema;
150707
+ exports.ApiCallableSchema = ApiCallableSchema;
150708
+ exports.ApiCatalogEntrySchema = ApiCatalogEntrySchema;
150709
+ exports.ApiCatalogInputSchemaOutputSchema = ApiCatalogInputSchemaOutputSchema;
150710
+ exports.ApiCatalogListOutputSchema = ApiCatalogListOutputSchema;
150711
+ exports.ApiCatalogMethodSchema = ApiCatalogMethodSchema;
150712
+ exports.ApiCatalogScopeSchema = ApiCatalogScopeSchema;
150713
+ exports.ApiProcedureKindSchema = ApiProcedureKindSchema;
150714
+ exports.ApiProcedureTierSchema = ApiProcedureTierSchema;
150542
150715
  exports.AppFlowPurposeSchema = AppFlowPurposeSchema;
150543
150716
  exports.AppLoginPathSchema = AppLoginPathSchema;
150544
150717
  exports.AppPageLangSchema = AppPageLangSchema;
@@ -151519,6 +151692,11 @@ exports.IR_NATIVE_CODECS = IR_NATIVE_CODECS;
151519
151692
  exports.IR_NATIVE_CODE_MAX_CHARS = IR_NATIVE_CODE_MAX_CHARS;
151520
151693
  exports.IR_TIMINGS_MAX = IR_TIMINGS_MAX;
151521
151694
  exports.IconKeySchema = IconKeySchema;
151695
+ exports.IdentityCandidateDeviceSchema = IdentityCandidateDeviceSchema;
151696
+ exports.IdentityCandidatePairSchema = IdentityCandidatePairSchema;
151697
+ exports.IdentityCandidatesSchema = IdentityCandidatesSchema;
151698
+ exports.IdentityConfidenceSchema = IdentityConfidenceSchema;
151699
+ exports.IdentityMatchedKeySchema = IdentityMatchedKeySchema;
151522
151700
  exports.ImageContractSchema = ImageContractSchema;
151523
151701
  exports.ImageContractStateSchema = ImageContractStateSchema;
151524
151702
  exports.ImageRotateSchema = ImageRotateSchema;
@@ -151563,6 +151741,7 @@ exports.IrTransmitterAttemptSchema = IrTransmitterAttemptSchema;
151563
151741
  exports.IrTransmitterInfoSchema = IrTransmitterInfoSchema;
151564
151742
  exports.IrTransmitterRuntimeStateSchema = IrTransmitterRuntimeStateSchema;
151565
151743
  exports.IrTransmitterSendRecordSchema = IrTransmitterSendRecordSchema;
151744
+ exports.JsonSchemaDocumentSchema = JsonSchemaDocumentSchema;
151566
151745
  exports.KEYCHAIN_MAX_REFS_PER_CALL = KEYCHAIN_MAX_REFS_PER_CALL;
151567
151746
  exports.KEYCHAIN_RESET_CONFIRMATION = KEYCHAIN_RESET_CONFIRMATION;
151568
151747
  exports.KEYCHAIN_RESET_TRIGGER_ACTOR = KEYCHAIN_RESET_TRIGGER_ACTOR;