@camstack/types 1.2.386 → 1.2.388

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 (41) hide show
  1. package/dist/addon.js +26 -16
  2. package/dist/addon.mjs +26 -16
  3. package/dist/auth/credential-scope.d.ts +37 -5
  4. package/dist/auth/principal-scope.d.ts +1 -1
  5. package/dist/capabilities/alarm-panel.cap.d.ts +10 -2
  6. package/dist/capabilities/capability-definition.d.ts +21 -3
  7. package/dist/capabilities/connectivity.cap.d.ts +10 -2
  8. package/dist/capabilities/device-history.cap.d.ts +195 -3
  9. package/dist/capabilities/dishwasher.cap.d.ts +17 -0
  10. package/dist/capabilities/enum-sensor.cap.d.ts +12 -2
  11. package/dist/capabilities/index.d.ts +6 -5
  12. package/dist/capabilities/llm.cap.d.ts +252 -309
  13. package/dist/capabilities/lock-control.cap.d.ts +9 -2
  14. package/dist/capabilities/log-destination.cap.d.ts +148 -19
  15. package/dist/capabilities/media-player.cap.d.ts +15 -2
  16. package/dist/capabilities/notification-rules.cap.d.ts +213 -13
  17. package/dist/capabilities/stream-params.cap.d.ts +24 -2
  18. package/dist/capabilities/user-management.cap.d.ts +4 -409
  19. package/dist/client.js +76 -11
  20. package/dist/client.mjs +76 -11
  21. package/dist/device/base-device.d.ts +34 -1
  22. package/dist/device/index.d.ts +2 -2
  23. package/dist/generated/addon-api.d.ts +548 -187
  24. package/dist/generated/cap-input-defaults.d.ts +1 -1
  25. package/dist/generated/collection-array-methods.d.ts +2 -2
  26. package/dist/generated/history-catalog.d.ts +1 -1
  27. package/dist/generated/method-access-map.d.ts +1 -1
  28. package/dist/generated/method-device-selectors.d.ts +2 -2
  29. package/dist/generated/system-proxy.d.ts +2 -2
  30. package/dist/index.d.ts +5 -3
  31. package/dist/index.js +861 -164
  32. package/dist/index.mjs +815 -162
  33. package/dist/interfaces/addon-data-plane.d.ts +4 -4
  34. package/dist/interfaces/addon-peer-bytes.d.ts +1 -1
  35. package/dist/interfaces/logging.d.ts +16 -1
  36. package/dist/notification/media-image.d.ts +67 -0
  37. package/dist/schemas/auth-records.d.ts +1 -1
  38. package/dist/schemas/user-preferences.d.ts +103 -0
  39. package/dist/{sleep-BxjU_fJM.mjs → sleep-BSuCCFjf.mjs} +34 -5
  40. package/dist/{sleep-BE7_6UnC.js → sleep-DKtoyk6X.js} +34 -5
  41. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-BE7_6UnC.js");
2
+ const require_sleep = require("./sleep-DKtoyk6X.js");
3
3
  const require_event_category = require("./event-category-eSqkye-K.js");
4
4
  const require_err_msg = require("./err-msg-BhVbr0NX.js");
5
5
  //#region src/generated/cap-input-defaults.ts
@@ -16,7 +16,7 @@ const require_err_msg = require("./err-msg-BhVbr0NX.js");
16
16
  * Plain data, zero Zod: a forked runner must not import the schema barrel
17
17
  * (~144MB RSS per runner — D28).
18
18
  *
19
- * Coverage: 29 caps, 71 methods with defaults.
19
+ * Coverage: 29 caps, 72 methods with defaults.
20
20
  */
21
21
  var CAP_INPUT_DEFAULTS = Object.freeze({
22
22
  "addons": { "getLogs": { "limit": 100 } },
@@ -45,6 +45,10 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
45
45
  "resolution": "auto",
46
46
  "maxPoints": 1e3
47
47
  },
48
+ "queryMany": {
49
+ "resolution": "auto",
50
+ "maxPoints": 1e3
51
+ },
48
52
  "queryNode": {
49
53
  "resolution": "auto",
50
54
  "maxPoints": 1e3
@@ -63,7 +67,8 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
63
67
  "enabled": false,
64
68
  "maxAttempts": 1
65
69
  },
66
- "toolsEnabled": false
70
+ "toolsEnabled": false,
71
+ "providerConfig": {}
67
72
  } } } },
68
73
  "llm-runtime": {
69
74
  "complete": { "runtime": { "__nested__": {
@@ -102,7 +107,7 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
102
107
  "createRule": { "rule": { "__nested__": {
103
108
  "enabled": true,
104
109
  "conditions": {},
105
- "media": { "attach": "best" },
110
+ "media": {},
106
111
  "throttle": {
107
112
  "cooldownSec": 60,
108
113
  "scope": "rule-device"
@@ -113,7 +118,7 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
113
118
  "previewStateSummary": { "rule": { "__nested__": {
114
119
  "enabled": true,
115
120
  "conditions": {},
116
- "media": { "attach": "best" },
121
+ "media": {},
117
122
  "throttle": {
118
123
  "cooldownSec": 60,
119
124
  "scope": "rule-device"
@@ -124,7 +129,7 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
124
129
  "rule": { "__nested__": {
125
130
  "enabled": true,
126
131
  "conditions": {},
127
- "media": { "attach": "best" },
132
+ "media": {},
128
133
  "throttle": {
129
134
  "cooldownSec": 60,
130
135
  "scope": "rule-device"
@@ -357,7 +362,7 @@ function materialise(defaults) {
357
362
  * barrel (`ALL_CAPABILITY_DEFINITIONS`), which would cost ~144MB RSS per
358
363
  * forked runner. See docs/decisions/adr-0028.md.
359
364
  *
360
- * Coverage: 27 collection caps, 46 array methods.
365
+ * Coverage: 26 collection caps, 44 array methods.
361
366
  */
362
367
  var COLLECTION_ARRAY_METHODS = Object.freeze({
363
368
  "addon-pages-source": ["listPages"],
@@ -376,7 +381,6 @@ var COLLECTION_ARRAY_METHODS = Object.freeze({
376
381
  "getDefaults",
377
382
  "getUsage",
378
383
  "listModelCatalog",
379
- "listModels",
380
384
  "listNodeModels",
381
385
  "listProfileKinds",
382
386
  "listProfiles",
@@ -384,7 +388,6 @@ var COLLECTION_ARRAY_METHODS = Object.freeze({
384
388
  ],
385
389
  "load-contribution": ["list"],
386
390
  "log-channels": ["list"],
387
- "log-destination": ["query"],
388
391
  "login-method": ["getLoginMethods"],
389
392
  "mqtt-broker": ["listBrokers"],
390
393
  "network-access": ["listEndpoints"],
@@ -419,14 +422,21 @@ function isCollectionArrayMethodName(capName, method) {
419
422
  * Per capability, the methods declared `optionalMethod` — the ones whose
420
423
  * ABSENCE on a provider is a fact about that provider, not a bug.
421
424
  *
422
- * Coverage: 1 caps, 4 methods.
425
+ * Coverage: 2 caps, 7 methods.
423
426
  */
424
- var PROVIDER_OPTIONAL_METHODS = Object.freeze({ "videoclips": [
425
- "dialClipStream",
426
- "getPlaybackOptions",
427
- "offerClipBytes",
428
- "readClipBytes"
429
- ] });
427
+ var PROVIDER_OPTIONAL_METHODS = Object.freeze({
428
+ "log-destination": [
429
+ "cancelRead",
430
+ "describeRead",
431
+ "read"
432
+ ],
433
+ "videoclips": [
434
+ "dialClipStream",
435
+ "getPlaybackOptions",
436
+ "offerClipBytes",
437
+ "readClipBytes"
438
+ ]
439
+ });
430
440
  /**
431
441
  * True when `method` on cap `capName` is declared `optionalMethod`.
432
442
  *
package/dist/addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $n as PEER_BYTES_CHUNK_BYTES, $t as REMOVE_LEAF, A as HF_REPO, An as RECORD_BATCH_MAX_BYTES, Ar as emitReadiness, B as describeCustomActions, Bn as RECORD_SECRET_COLLECTION_PREFIX, Br as SECRET_CLEAR, Bt as settingsBrokersAdoptsFrom, C as addonSliceHandleApi, Cn as RecordsError, Cr as globalSecretScope, Dn as asRecordsError, En as UnknownRecordKindError, Er as parseSecretRef, F as DEVICE_CHILDREN_BATCH_MAX, Fn as RECORD_ID_MAX_LENGTH, Ft as SETTINGS_ARRAY_ADOPTS_PREFIX, Gn as createSecretsAccess, Gr as isSecretMarkerLike, Gt as RecordFieldPathSchema, H as adminUiCapability, Hn as RECORD_SWEEP_INTERVAL_MS, Hr as isSecretClear, Ht as entryBody, I as CALLER_STAMPED_CAPABILITIES, In as RECORD_MAX_DATA_BYTES, It as parseSettingsArrayAdoptsFrom, Jn as forgetKnownSecret, Jt as RecordKindNameSchema, Kn as MIN_SCRUBBED_LENGTH, Kr as makeSecretMarker, Kt as RecordIndexSchema, L as withoutCallerStamp, Ln as RECORD_MAX_INDEXES, Lt as settingsArrayAdoptsFrom, Mn as RECORD_DATABASES, N as deviceOpsCapability, Nn as RECORD_DEFAULT_MAX_DATA_BYTES, On as recordsErrorFromMessage, P as viewerUiCapability, Pn as RECORD_DELETE_BATCH, Pt as makeInMemoryRecords, Qn as shortSecretRefHash, Qt as defineRecordKinds, Rn as RECORD_MAX_INDEX_FIELDS, Rt as SETTINGS_BROKERS_ADOPTS_PREFIX, Sn as RecordUniqueViolationError, Sr as formatSecretScope, Tn as UnindexedFilterError, Tr as normalizeSecretOwner, Un as resolveSecretViewsIn, Ur as isSecretFieldView, Ut as createRecordsAccess, Vn as RECORD_SETTINGS_MAX_ROWS, Vr as classifySecretWrite, Vt as defineEntryKind, Wn as REVALIDATE_AFTER_MS, Wr as isSecretMarker, Wt as EntryDescriptorSchema, X as expandCapMethods, Xn as registerKnownSecret, Xt as assertValidDeclaration, Yn as knownSecretCount, Yt as RecordRetentionSchema, Zn as scrubKnownSecrets, Zt as declarationsOf, _ as readErrorI18n, _n as PlaintextSecretError, an as recordSecretRef, b as isDeviceScopedCap, bn as RecordSecretUnavailableError, br as arrayItemFieldPath, c as asString, cn as collectZodSecretPaths, ct as ReadinessTimeoutError, d as parseJsonUnknown, dn as BatchTooLargeError, dt as scopeKey, en as collectSecretLeaves, er as PEER_BYTES_MAX_OUTSTANDING, f as hfModelUrl, fn as DeclarationRefusedError, g as ErrorI18nPayloadSchema, gn as NoCallerError, hn as InvalidRecordError, in as recordSecretCollection, ir as DATAPLANE_SECRET_HEADER, it as readNodePin, jn as RECORD_CLASSES, kn as RECORD_BATCH_MAX, kr as createEvent, ln as isZodSecret, lr as normalizeAddonInitResult, mn as ForeignSecretMarkerError, nn as parseSecretPath, nr as PEER_BYTES_TICKET_TTL_MS, o as asJsonObject, on as secretArrayPrefixes, or as DisposerChain, ot as MODEL_FORMATS, p as BOOT_RECOVERY_BACKOFF_MS, pn as FilterRequiredError, qn as clearKnownSecrets, qr as toSecretFieldView, qt as RecordKindDeclarationSchema, r as maskUrlCredentials, rn as recordArrayItemPath, rt as nodePin, sr as BaseAddon, st as ReadinessRegistry, t as sleep, tn as mapSecretLeaves, tr as PEER_BYTES_STALL_MS, un as AdoptionPendingError, vn as RECORDS_ERROR_CODES, w as createEventBusSliceSource, wn as RevConflictError, wr as isSecretRef, x as createDeviceProxy, xn as RecordTooLargeError, xr as buildSecretRef, y as DEVICE_SCOPED_CAPS, yn as RecordNotFoundError, yr as SECRET_REF_SCHEME, zn as RECORD_QUERY_MAX, zt as parseSettingsBrokersAdoptsFrom } from "./sleep-BxjU_fJM.mjs";
1
+ import { $n as PEER_BYTES_CHUNK_BYTES, $t as REMOVE_LEAF, A as HF_REPO, An as RECORD_BATCH_MAX_BYTES, Ar as emitReadiness, B as describeCustomActions, Bn as RECORD_SECRET_COLLECTION_PREFIX, Br as SECRET_CLEAR, Bt as settingsBrokersAdoptsFrom, C as addonSliceHandleApi, Cn as RecordsError, Cr as globalSecretScope, Dn as asRecordsError, En as UnknownRecordKindError, Er as parseSecretRef, F as DEVICE_CHILDREN_BATCH_MAX, Fn as RECORD_ID_MAX_LENGTH, Ft as SETTINGS_ARRAY_ADOPTS_PREFIX, Gn as createSecretsAccess, Gr as isSecretMarkerLike, Gt as RecordFieldPathSchema, H as adminUiCapability, Hn as RECORD_SWEEP_INTERVAL_MS, Hr as isSecretClear, Ht as entryBody, I as CALLER_STAMPED_CAPABILITIES, In as RECORD_MAX_DATA_BYTES, It as parseSettingsArrayAdoptsFrom, Jn as forgetKnownSecret, Jt as RecordKindNameSchema, Kn as MIN_SCRUBBED_LENGTH, Kr as makeSecretMarker, Kt as RecordIndexSchema, L as withoutCallerStamp, Ln as RECORD_MAX_INDEXES, Lt as settingsArrayAdoptsFrom, Mn as RECORD_DATABASES, N as deviceOpsCapability, Nn as RECORD_DEFAULT_MAX_DATA_BYTES, On as recordsErrorFromMessage, P as viewerUiCapability, Pn as RECORD_DELETE_BATCH, Pt as makeInMemoryRecords, Qn as shortSecretRefHash, Qt as defineRecordKinds, Rn as RECORD_MAX_INDEX_FIELDS, Rt as SETTINGS_BROKERS_ADOPTS_PREFIX, Sn as RecordUniqueViolationError, Sr as formatSecretScope, Tn as UnindexedFilterError, Tr as normalizeSecretOwner, Un as resolveSecretViewsIn, Ur as isSecretFieldView, Ut as createRecordsAccess, Vn as RECORD_SETTINGS_MAX_ROWS, Vr as classifySecretWrite, Vt as defineEntryKind, Wn as REVALIDATE_AFTER_MS, Wr as isSecretMarker, Wt as EntryDescriptorSchema, X as expandCapMethods, Xn as registerKnownSecret, Xt as assertValidDeclaration, Yn as knownSecretCount, Yt as RecordRetentionSchema, Zn as scrubKnownSecrets, Zt as declarationsOf, _ as readErrorI18n, _n as PlaintextSecretError, an as recordSecretRef, b as isDeviceScopedCap, bn as RecordSecretUnavailableError, br as arrayItemFieldPath, c as asString, cn as collectZodSecretPaths, ct as ReadinessTimeoutError, d as parseJsonUnknown, dn as BatchTooLargeError, dt as scopeKey, en as collectSecretLeaves, er as PEER_BYTES_MAX_OUTSTANDING, f as hfModelUrl, fn as DeclarationRefusedError, g as ErrorI18nPayloadSchema, gn as NoCallerError, hn as InvalidRecordError, in as recordSecretCollection, ir as DATAPLANE_SECRET_HEADER, it as readNodePin, jn as RECORD_CLASSES, kn as RECORD_BATCH_MAX, kr as createEvent, ln as isZodSecret, lr as normalizeAddonInitResult, mn as ForeignSecretMarkerError, nn as parseSecretPath, nr as PEER_BYTES_TICKET_TTL_MS, o as asJsonObject, on as secretArrayPrefixes, or as DisposerChain, ot as MODEL_FORMATS, p as BOOT_RECOVERY_BACKOFF_MS, pn as FilterRequiredError, qn as clearKnownSecrets, qr as toSecretFieldView, qt as RecordKindDeclarationSchema, r as maskUrlCredentials, rn as recordArrayItemPath, rt as nodePin, sr as BaseAddon, st as ReadinessRegistry, t as sleep, tn as mapSecretLeaves, tr as PEER_BYTES_STALL_MS, un as AdoptionPendingError, vn as RECORDS_ERROR_CODES, w as createEventBusSliceSource, wn as RevConflictError, wr as isSecretRef, x as createDeviceProxy, xn as RecordTooLargeError, xr as buildSecretRef, y as DEVICE_SCOPED_CAPS, yn as RecordNotFoundError, yr as SECRET_REF_SCHEME, zn as RECORD_QUERY_MAX, zt as parseSettingsBrokersAdoptsFrom } from "./sleep-BSuCCFjf.mjs";
2
2
  import { t as EventCategory } from "./event-category-DOl51-Ij.mjs";
3
3
  import { a as DeviceType, t as errMsg } from "./err-msg-BXKzRBwg.mjs";
4
4
  //#region src/generated/cap-input-defaults.ts
@@ -15,7 +15,7 @@ import { a as DeviceType, t as errMsg } from "./err-msg-BXKzRBwg.mjs";
15
15
  * Plain data, zero Zod: a forked runner must not import the schema barrel
16
16
  * (~144MB RSS per runner — D28).
17
17
  *
18
- * Coverage: 29 caps, 71 methods with defaults.
18
+ * Coverage: 29 caps, 72 methods with defaults.
19
19
  */
20
20
  var CAP_INPUT_DEFAULTS = Object.freeze({
21
21
  "addons": { "getLogs": { "limit": 100 } },
@@ -44,6 +44,10 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
44
44
  "resolution": "auto",
45
45
  "maxPoints": 1e3
46
46
  },
47
+ "queryMany": {
48
+ "resolution": "auto",
49
+ "maxPoints": 1e3
50
+ },
47
51
  "queryNode": {
48
52
  "resolution": "auto",
49
53
  "maxPoints": 1e3
@@ -62,7 +66,8 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
62
66
  "enabled": false,
63
67
  "maxAttempts": 1
64
68
  },
65
- "toolsEnabled": false
69
+ "toolsEnabled": false,
70
+ "providerConfig": {}
66
71
  } } } },
67
72
  "llm-runtime": {
68
73
  "complete": { "runtime": { "__nested__": {
@@ -101,7 +106,7 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
101
106
  "createRule": { "rule": { "__nested__": {
102
107
  "enabled": true,
103
108
  "conditions": {},
104
- "media": { "attach": "best" },
109
+ "media": {},
105
110
  "throttle": {
106
111
  "cooldownSec": 60,
107
112
  "scope": "rule-device"
@@ -112,7 +117,7 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
112
117
  "previewStateSummary": { "rule": { "__nested__": {
113
118
  "enabled": true,
114
119
  "conditions": {},
115
- "media": { "attach": "best" },
120
+ "media": {},
116
121
  "throttle": {
117
122
  "cooldownSec": 60,
118
123
  "scope": "rule-device"
@@ -123,7 +128,7 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
123
128
  "rule": { "__nested__": {
124
129
  "enabled": true,
125
130
  "conditions": {},
126
- "media": { "attach": "best" },
131
+ "media": {},
127
132
  "throttle": {
128
133
  "cooldownSec": 60,
129
134
  "scope": "rule-device"
@@ -356,7 +361,7 @@ function materialise(defaults) {
356
361
  * barrel (`ALL_CAPABILITY_DEFINITIONS`), which would cost ~144MB RSS per
357
362
  * forked runner. See docs/decisions/adr-0028.md.
358
363
  *
359
- * Coverage: 27 collection caps, 46 array methods.
364
+ * Coverage: 26 collection caps, 44 array methods.
360
365
  */
361
366
  var COLLECTION_ARRAY_METHODS = Object.freeze({
362
367
  "addon-pages-source": ["listPages"],
@@ -375,7 +380,6 @@ var COLLECTION_ARRAY_METHODS = Object.freeze({
375
380
  "getDefaults",
376
381
  "getUsage",
377
382
  "listModelCatalog",
378
- "listModels",
379
383
  "listNodeModels",
380
384
  "listProfileKinds",
381
385
  "listProfiles",
@@ -383,7 +387,6 @@ var COLLECTION_ARRAY_METHODS = Object.freeze({
383
387
  ],
384
388
  "load-contribution": ["list"],
385
389
  "log-channels": ["list"],
386
- "log-destination": ["query"],
387
390
  "login-method": ["getLoginMethods"],
388
391
  "mqtt-broker": ["listBrokers"],
389
392
  "network-access": ["listEndpoints"],
@@ -418,14 +421,21 @@ function isCollectionArrayMethodName(capName, method) {
418
421
  * Per capability, the methods declared `optionalMethod` — the ones whose
419
422
  * ABSENCE on a provider is a fact about that provider, not a bug.
420
423
  *
421
- * Coverage: 1 caps, 4 methods.
424
+ * Coverage: 2 caps, 7 methods.
422
425
  */
423
- var PROVIDER_OPTIONAL_METHODS = Object.freeze({ "videoclips": [
424
- "dialClipStream",
425
- "getPlaybackOptions",
426
- "offerClipBytes",
427
- "readClipBytes"
428
- ] });
426
+ var PROVIDER_OPTIONAL_METHODS = Object.freeze({
427
+ "log-destination": [
428
+ "cancelRead",
429
+ "describeRead",
430
+ "read"
431
+ ],
432
+ "videoclips": [
433
+ "dialClipStream",
434
+ "getPlaybackOptions",
435
+ "offerClipBytes",
436
+ "readClipBytes"
437
+ ]
438
+ });
429
439
  /**
430
440
  * True when `method` on cap `capName` is declared `optionalMethod`.
431
441
  *
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * The ONE permission vocabulary every credential is reduced to (D892).
3
3
  *
4
- * A credential — a login session, an account-link token, a legacy `csa_` /
5
- * `cst_` / `csv_` token, or the unified token `auth.mintToken` issues — is
4
+ * A credential — a login session, an account-link token, or a token
5
+ * `auth.mintToken` issues (there is no other format, D895) — is
6
6
  * verified into a principal whose permissions are a `CredentialScope[]`, and
7
7
  * nothing else. What KIND of credential it was never decides what it may do:
8
8
  *
9
- * - `'*'` — everything (the admin bypass). Held by an admin's session, a
10
- * legacy admin token, and a unified token minted with it.
9
+ * - `'*'` — everything (the admin bypass). Held by an admin's session and
10
+ * a token minted with it.
11
11
  * - a {@link TokenScope} — the v3 capability grants (`category`,
12
12
  * `capability`, `addon`, `device`) the tRPC matcher has always applied.
13
13
  * - `share-view` — one fail-closed embed perimeter (`grid-view` /
@@ -16,7 +16,12 @@
16
16
  * - `addon-routes` — may reach any addon's own `authenticated` HTTP routes
17
17
  * and data planes (never an `admin` one). A person's session has always
18
18
  * had this; an integration token never had it and must hold
19
- * `addon:<id>` instead.
19
+ * `addon:<id>` instead. Only an admin may mint it into a token.
20
+ * - `preferences-self` — may read and write the SUBJECT's own account
21
+ * preferences (D894), never another user's. Every person's session holds
22
+ * it; a unified token holds it only when minted with it. `'*'` does NOT
23
+ * imply it: the hub's own mesh principal holds `'*'` and is nobody's
24
+ * account.
20
25
  *
21
26
  * Pure: no I/O. It lives in `@camstack/types` so the hub, the kernel and any
22
27
  * addon read the same vocabulary.
@@ -58,6 +63,12 @@ export declare const AddonRoutesScopeSchema: z.ZodObject<{
58
63
  }>>;
59
64
  }, z.core.$strip>;
60
65
  export type AddonRoutesScope = z.infer<typeof AddonRoutesScopeSchema>;
66
+ export declare const PreferencesSelfScopeSchema: z.ZodObject<{
67
+ type: z.ZodLiteral<"preferences-self">;
68
+ }, z.core.$strip>;
69
+ export type PreferencesSelfScope = z.infer<typeof PreferencesSelfScopeSchema>;
70
+ /** The grant every person's session carries for its own account preferences. */
71
+ export declare const PREFERENCES_SELF_SCOPE: PreferencesSelfScope;
61
72
  export declare const CredentialScopeSchema: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodObject<{
62
73
  type: z.ZodLiteral<"share-view">;
63
74
  grant: z.ZodObject<{
@@ -75,6 +86,8 @@ export declare const CredentialScopeSchema: z.ZodUnion<readonly [z.ZodLiteral<"*
75
86
  delete: "delete";
76
87
  view: "view";
77
88
  }>>;
89
+ }, z.core.$strip>, z.ZodObject<{
90
+ type: z.ZodLiteral<"preferences-self">;
78
91
  }, z.core.$strip>, z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
79
92
  type: z.ZodLiteral<"category">;
80
93
  target: z.ZodEnum<{
@@ -138,6 +151,12 @@ export declare function shareViewGrantOf(scopes: readonly CredentialScope[]): Sh
138
151
  export declare function capabilityScopesOf(scopes: readonly CredentialScope[]): readonly TokenScope[];
139
152
  /** True iff the set reaches every addon's own routes at `access`. */
140
153
  export declare function scopesAllowAddonRoutes(scopes: readonly CredentialScope[], access: z.infer<typeof MethodAccessSchema>): boolean;
154
+ /**
155
+ * True iff the set may touch its subject's own account preferences: it holds
156
+ * `preferences-self` and no share-view grant restricts it. `'*'` alone is not
157
+ * enough (see the vocabulary above).
158
+ */
159
+ export declare function scopesAllowOwnPreferences(scopes: readonly CredentialScope[]): boolean;
141
160
  /**
142
161
  * Parse a scope array from an untrusted source (a JWT claim, a stored row).
143
162
  * Any element that does not parse makes the WHOLE set unusable — `null` — so
@@ -151,6 +170,17 @@ export declare function parseCredentialScopes(raw: unknown): readonly Credential
151
170
  * token may do: that is its `scopes`, and only its `scopes`.
152
171
  */
153
172
  export declare const CREDENTIAL_TOKEN_KIND = "credential";
173
+ /**
174
+ * The `aud` claim every minted token is signed with (D895). The hub's raw JWT
175
+ * verify (`AuthManager.verifyToken`, used by every surface that wants a LOGIN
176
+ * session — the OAuth consent page, the session cookie, health, backups)
177
+ * refuses a token carrying it, so a minted token — a share link above all —
178
+ * can never be replayed as a person's session. Only the credential verifier's
179
+ * own door (`verifyCredentialToken`) accepts it.
180
+ */
181
+ export declare const CREDENTIAL_TOKEN_AUDIENCE = "camstack:credential";
182
+ /** Does a verified JWT payload belong to the minted-token family? */
183
+ export declare function isCredentialTokenPayload(payload: unknown): boolean;
154
184
  /**
155
185
  * The claims of a unified token (`auth.mintToken`). It carries no `exp`: its
156
186
  * row (looked up by `jti` on every verify, for revocation) holds the ONE
@@ -178,6 +208,8 @@ export declare const CredentialTokenClaimsSchema: z.ZodObject<{
178
208
  delete: "delete";
179
209
  view: "view";
180
210
  }>>;
211
+ }, z.core.$strip>, z.ZodObject<{
212
+ type: z.ZodLiteral<"preferences-self">;
181
213
  }, z.core.$strip>, z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
182
214
  type: z.ZodLiteral<"category">;
183
215
  target: z.ZodEnum<{
@@ -114,7 +114,7 @@ export type PrincipalAddonReachVerdict = {
114
114
  * would lock every non-admin viewer out of recorder playback, snapshot media
115
115
  * and the stream-broker embed, which is a worse outcome than the hole.
116
116
  * - **integration** — must hold `addon:<addonId>` at the verb's access. This is
117
- * the same rule the `cst_` scoped-token branch has always applied; the JWT
117
+ * the same rule the scoped-token branch has always applied; the JWT
118
118
  * branch simply never applied it, and closing that divergence IS the fix.
119
119
  * `isAdmin` is ignored: an integration token is minted `isAdmin: false` and a
120
120
  * token claiming otherwise must not talk its way past the grant.
@@ -178,9 +178,17 @@ export declare const alarmPanelCapability: {
178
178
  */
179
179
  readonly durability: 'restored';
180
180
  /**
181
- * History (D850): none — enum state; arm/disarm history belongs in the events ledger.
181
+ * History (D850): the panel's lifecycle state as an `enum` series —
182
+ * change-only, no floor, so an `arming -> pending -> triggered` sequence of a
183
+ * few seconds keeps every step. Who armed it stays in the events ledger.
182
184
  */
183
- readonly history: 'none';
185
+ readonly history: {
186
+ readonly fields: {
187
+ readonly state: {
188
+ readonly kind: 'enum';
189
+ };
190
+ };
191
+ };
184
192
  /** Clock fields: written, but excluded from the compare that decides
185
193
  * whether persisting is worth a SQLite commit. */
186
194
  readonly volatileStateFields: readonly ["lastChangedAt"];
@@ -384,7 +384,7 @@ export declare const DEFAULT_RUNTIME_STATE_DURABILITY: RuntimeStateDurability;
384
384
  * through {@link HISTORY_UNIT_LABELS}. A series whose unit is a per-device fact
385
385
  * names a sibling field with {@link CapabilityHistoryField.unitFrom} instead.
386
386
  */
387
- export type HistoryUnit = '%' | 'dBFS' | 'dBm' | '°C' | 'W' | 'kWh' | 'V' | 'A' | 'VA' | 'lx' | 'ppm' | 'ppb' | 'ug/m3' | 'hPa' | 'count' | 'ratio' | 'ms' | 's' | 'days' | 'bytes';
387
+ export type HistoryUnit = '%' | 'dBFS' | 'dBm' | '°C' | 'W' | 'kWh' | 'V' | 'A' | 'VA' | 'lx' | 'ppm' | 'ppb' | 'ug/m3' | 'hPa' | 'count' | 'ratio' | 'ms' | 's' | 'days' | 'bytes' | 'kbps' | 'fps';
388
388
  /** Display label per {@link HistoryUnit} (only `'ug/m3'` differs from its id). */
389
389
  export declare const HISTORY_UNIT_LABELS: Readonly<Record<HistoryUnit, string>>;
390
390
  /** One `runtimeState` field recorded as a history series. */
@@ -394,8 +394,26 @@ export interface CapabilityHistoryField {
394
394
  * meter only (`kwhTotal`); a drop is a reset, never a negative reading. A
395
395
  * counter that restarts with the addon (`pressCountSinceStart`) is not one.
396
396
  * `boolean` — stored 0/1; a rollup gives the fraction of time true.
397
+ * `enum` — a STATE (a `z.enum`, or a `z.string` whose values are learned):
398
+ * stored as the ordinal of its value in the series' append-only value list,
399
+ * change-only; a rollup keeps the time spent in each state.
397
400
  */
398
- readonly kind: 'gauge' | 'counter' | 'boolean';
401
+ readonly kind: 'gauge' | 'counter' | 'boolean' | 'enum';
402
+ /**
403
+ * `enum` over a `z.enum` field: its values, in declaration order. WRITTEN BY
404
+ * CODEGEN from the field's schema (`scripts/generate-history-catalog.ts`) —
405
+ * never by hand, so the list cannot drift from the schema. Absent for a
406
+ * `z.string` enum field, whose values are learned as they are first seen.
407
+ * Ordinals are append-only in the store: reordering the `z.enum` later never
408
+ * changes what a stored ordinal means.
409
+ */
410
+ readonly values?: readonly string[];
411
+ /**
412
+ * Path of a SIBLING field: while it is set (not `undefined`, not `null`), the
413
+ * slice is not a reading of this field and nothing is captured. An
414
+ * `enum-sensor` with a `format` carries a timestamp, not a state.
415
+ */
416
+ readonly skipWhenSet?: string;
399
417
  /** Fixed unit of the series. Mutually exclusive with {@link unitFrom}. */
400
418
  readonly unit?: HistoryUnit;
401
419
  /**
@@ -416,7 +434,7 @@ export interface CapabilityHistoryField {
416
434
  readonly deadbandPct?: number;
417
435
  /**
418
436
  * At most one raw point per this many ms per series. Absent means the capture
419
- * floor of the kind: 10 000 for `gauge` and `counter`, none for `boolean`
437
+ * floor of the kind: 10 000 for `gauge` and `counter`, none for `boolean` and `enum`
420
438
  * (change-only). Set it ABOVE the floor to be sparser; the floor is not
421
439
  * lowered by a smaller value except `0`, which a field may state to opt out
422
440
  * of the floor (a flapping state that must not lose an edge).
@@ -40,9 +40,17 @@ export declare const connectivityCapability: {
40
40
  */
41
41
  readonly durability: 'restored';
42
42
  /**
43
- * History (D850): none — duplicates device-status.online (one authority for availability).
43
+ * History (D850): `connected` as a boolean series — change-only, no floor. It
44
+ * is the upstream entity's own link (a HA connectivity sensor), not the
45
+ * device's reachability, which stays `device-status.online`.
44
46
  */
45
- readonly history: 'none';
47
+ readonly history: {
48
+ readonly fields: {
49
+ readonly connected: {
50
+ readonly kind: 'boolean';
51
+ };
52
+ };
53
+ };
46
54
  /** Clock fields: written, but excluded from the compare that decides
47
55
  * whether persisting is worth a SQLite commit. */
48
56
  readonly volatileStateFields: readonly ["lastChangedAt"];