@camstack/types 1.2.326 → 1.2.328

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 (80) hide show
  1. package/dist/addon/base-addon.d.ts +58 -0
  2. package/dist/addon/secret-aware-context.d.ts +27 -0
  3. package/dist/addon/secret-paths.d.ts +48 -0
  4. package/dist/addon/secret-settings-view.d.ts +80 -0
  5. package/dist/addon.d.ts +2 -0
  6. package/dist/addon.js +54 -4
  7. package/dist/addon.mjs +27 -5
  8. package/dist/capabilities/addon-routes.cap.d.ts +2 -2
  9. package/dist/capabilities/addons.cap.d.ts +4 -4
  10. package/dist/capabilities/alerts.cap.d.ts +5 -5
  11. package/dist/capabilities/control.cap.d.ts +11 -11
  12. package/dist/capabilities/day-night.cap.d.ts +8 -8
  13. package/dist/capabilities/device-manager.cap.d.ts +9 -0
  14. package/dist/capabilities/enum-sensor.cap.d.ts +4 -4
  15. package/dist/capabilities/index.d.ts +7 -3
  16. package/dist/capabilities/integrations.cap.d.ts +6 -3
  17. package/dist/capabilities/keychain-admin.cap.d.ts +312 -0
  18. package/dist/capabilities/keychain.cap.d.ts +180 -0
  19. package/dist/capabilities/lawn-mower-control.cap.d.ts +4 -4
  20. package/dist/capabilities/local-network.cap.d.ts +2 -2
  21. package/dist/capabilities/log-channels.cap.d.ts +1 -1
  22. package/dist/capabilities/log-destination.cap.d.ts +5 -5
  23. package/dist/capabilities/login-method.cap.d.ts +3 -0
  24. package/dist/capabilities/mesh-network.cap.d.ts +3 -3
  25. package/dist/capabilities/network-access.cap.d.ts +7 -7
  26. package/dist/capabilities/notification-rules.cap.d.ts +30 -30
  27. package/dist/capabilities/osd-manager.cap.d.ts +11 -11
  28. package/dist/capabilities/osd.cap.d.ts +5 -5
  29. package/dist/capabilities/pipeline-analytics.cap.d.ts +1127 -104
  30. package/dist/capabilities/pipeline-orchestrator.cap.d.ts +384 -0
  31. package/dist/capabilities/pipeline-runner.cap.d.ts +145 -2
  32. package/dist/capabilities/sso-bridge.cap.d.ts +6 -0
  33. package/dist/capabilities/storage.cap.d.ts +1 -1
  34. package/dist/capabilities/system.cap.d.ts +21 -21
  35. package/dist/capabilities/user-management.cap.d.ts +53 -1
  36. package/dist/capabilities/webrtc-session.cap.d.ts +3 -3
  37. package/dist/client.js +38 -1
  38. package/dist/client.mjs +38 -1
  39. package/dist/device/device-context.d.ts +11 -1
  40. package/dist/device/display-icon-vocabulary.d.ts +7 -0
  41. package/dist/device/index.d.ts +2 -1
  42. package/dist/device/zod-secret.d.ts +35 -0
  43. package/dist/enums/event-category.d.ts +7 -0
  44. package/dist/enums.js +1 -1
  45. package/dist/enums.mjs +1 -1
  46. package/dist/{event-category-CtBAl88K.js → event-category-CHduMGvg.js} +7 -0
  47. package/dist/{event-category-B_0XEcLF.mjs → event-category-DaIZi00R.mjs} +7 -0
  48. package/dist/generated/addon-api.d.ts +376 -0
  49. package/dist/generated/cap-input-defaults.d.ts +1 -1
  50. package/dist/generated/capability-router-map.d.ts +8 -2
  51. package/dist/generated/method-access-map.d.ts +1 -1
  52. package/dist/generated/method-device-selectors.d.ts +1 -1
  53. package/dist/generated/system-proxy.d.ts +5 -3
  54. package/dist/health/wiring-health.d.ts +8 -8
  55. package/dist/index.d.ts +8 -3
  56. package/dist/index.js +1970 -110
  57. package/dist/index.mjs +1849 -107
  58. package/dist/interfaces/addon.d.ts +25 -0
  59. package/dist/interfaces/config-ui-secrets.d.ts +12 -0
  60. package/dist/interfaces/config-ui.d.ts +60 -3
  61. package/dist/interfaces/event-bus.d.ts +11 -0
  62. package/dist/interfaces/pipeline-runner-capability.d.ts +18 -0
  63. package/dist/keychain/index.d.ts +5 -0
  64. package/dist/keychain/known-secrets.d.ts +31 -0
  65. package/dist/keychain/resolve-secret-views.d.ts +2 -0
  66. package/dist/keychain/secret-marker.d.ts +52 -0
  67. package/dist/keychain/secret-ref.d.ts +62 -0
  68. package/dist/keychain/secrets-access.d.ts +77 -0
  69. package/dist/logging/log-channel.d.ts +2 -2
  70. package/dist/pipeline/auto-tune/plan-schemas.d.ts +123 -0
  71. package/dist/pipeline/auto-tune/recommend.d.ts +26 -1
  72. package/dist/pipeline/load-balancing/schemas.d.ts +8 -7
  73. package/dist/pipeline/node-benchmark/benchmark-mode.d.ts +57 -0
  74. package/dist/pipeline/node-benchmark/index.d.ts +9 -0
  75. package/dist/pipeline/node-benchmark/results.d.ts +52 -0
  76. package/dist/pipeline/node-benchmark/schemas.d.ts +848 -0
  77. package/dist/pipeline/node-benchmark/step-tree.d.ts +23 -0
  78. package/dist/{sleep-BNeXenvr.mjs → sleep-Cr5YOk3m.mjs} +1337 -33
  79. package/dist/{sleep-DPar9AHl.js → sleep-i3kl-0Na.js} +1628 -66
  80. package/package.json +1 -1
@@ -2,6 +2,7 @@ import type { ZodType } from 'zod';
2
2
  import type { AddonContext, AddonInitResult, CapabilitiesAccess, ProviderRegistration, StoredKeyRead } from '../interfaces/addon.js';
3
3
  import type { ConfigField, ConfigSection, ConfigUISchema, ConfigUISchemaWithValues } from '../interfaces/config-ui.js';
4
4
  import { type DurableState } from './durable-state.js';
5
+ import { type UnresolvedSecret } from './secret-settings-view.js';
5
6
  export type { CapabilitiesAccess };
6
7
  /**
7
8
  * Utility type that constrains a ConfigField's `key` to only accept
@@ -108,6 +109,25 @@ export declare abstract class BaseAddon<TConfig extends object = Record<string,
108
109
  protected settingsStoreReady: boolean;
109
110
  /** Default config values. Provided via constructor. */
110
111
  protected readonly defaults: TConfig;
112
+ /**
113
+ * Hidden-state paths that hold secrets (D787) — values the addon writes
114
+ * itself (`updateGlobalSettings`, `state()`) that no form field declares.
115
+ * Stored in the keychain exactly like a `password` field. Syntax:
116
+ * `'snapshotSigningKey'`, `'identity.pincode'`, `'tokens[userId].accessToken'`
117
+ * (`key[<id field>]` addresses array items by id, never by index).
118
+ */
119
+ protected readonly secretStatePaths: readonly string[];
120
+ private _addonSecretTree;
121
+ private _deviceSecretTree;
122
+ /** Refs the last resolved config pointed at — a change to one re-resolves. */
123
+ private _configSecretRefs;
124
+ private _unresolvedSecrets;
125
+ private _secretRetryTimer;
126
+ private _secretRetryDelayMs;
127
+ private _secretChangeTimer;
128
+ private _secretChangeUnsub;
129
+ /** >0 while an OPERATOR's settings write is being applied. */
130
+ private _operatorWriteDepth;
111
131
  constructor(defaults: TConfig);
112
132
  /**
113
133
  * Override to opt out of the automatic `system.ready-state` emission.
@@ -269,7 +289,25 @@ export declare abstract class BaseAddon<TConfig extends object = Record<string,
269
289
  * not supported here: its stored name is scoped.
270
290
  */
271
291
  protected readStoredGlobalKey(key: string): Promise<StoredKeyRead>;
292
+ /**
293
+ * The OPERATOR's write — a settings form or an admin API call, dispatched by
294
+ * the kernel. Identical to {@link updateGlobalSettings}, except that a secret
295
+ * the operator sends is stored as sent even when it equals a pre-keychain
296
+ * inline value: the operator re-entering a password is a change, an addon
297
+ * writing back what it read is not (D787).
298
+ */
299
+ updateGlobalSettingsAsOperator(patch: Record<string, unknown>, nodeId?: string): Promise<void>;
272
300
  updateGlobalSettings(patch: Partial<TConfig>, nodeId?: string): Promise<void>;
301
+ /**
302
+ * REMOVE stored secrets — their keychain values and their markers (D787).
303
+ *
304
+ * Writing `''` to a secret field KEEPS what is stored (an empty string is
305
+ * what a defaults fallback writes back, and it must never destroy a
306
+ * credential), so code that means "forget this token" says so here. Without
307
+ * a keychain (an older kernel) it writes `''`, as such code always did.
308
+ */
309
+ protected clearSecrets(keys: ReadonlyArray<keyof TConfig & string>, nodeId?: string): Promise<void>;
310
+ private applyGlobalPatch;
273
311
  /**
274
312
  * The set of field keys the global settings schema declares `perNode: true`
275
313
  * — derived once per `cap` argument and memoized (schemas are static
@@ -366,6 +404,26 @@ export declare abstract class BaseAddon<TConfig extends object = Record<string,
366
404
  protected state<T>(key: string, schema: ZodType<T>, fallback: T): DurableState<T>;
367
405
  /** Per-device variant of {@link state}, backed by the per-device store. */
368
406
  protected deviceState<T>(deviceId: number, key: string, schema: ZodType<T>, fallback: T): DurableState<T>;
407
+ /** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
408
+ private addonSecretTree;
409
+ private deviceSecretTree;
410
+ /**
411
+ * Secrets of this addon's stored config that could not be resolved on the
412
+ * last read, with why. Non-empty means the addon is running WITHOUT them —
413
+ * an addon whose function needs one should report itself degraded rather
414
+ * than start on an empty credential.
415
+ */
416
+ protected get unresolvedSecrets(): readonly UnresolvedSecret[];
417
+ /**
418
+ * Substitute every keychain marker in a stored blob with its value. With no
419
+ * keychain (no `ctx.secrets`) or no marker, the blob comes back unchanged.
420
+ * An unresolvable value is LEFT OUT (never `''`), logged by ref — never by
421
+ * value — and, when the cause can pass, retried with backoff. Nothing is
422
+ * ever written back from here.
423
+ */
424
+ private resolveStoredSecrets;
425
+ /** Re-resolve the config (a keychain-only change, or a retry) and apply it. */
426
+ private scheduleSecretReresolve;
369
427
  /**
370
428
  * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
371
429
  * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Wrap an addon context so EVERY write to its settings store goes through the
3
+ * keychain save path (D787) — `updateGlobalSettings`, `state()` handles, and an
4
+ * addon's own direct `ctx.settings.writeAddonStore` / `writeDeviceStore` calls
5
+ * alike. Reads stay raw (markers): a read surface never sees a value, and the
6
+ * runtime resolves through `BaseAddon`.
7
+ *
8
+ * A Proxy rather than a copy: an in-process context carries getters (`api`)
9
+ * and a spread would freeze them at wrap time; a Proxy forwards every other
10
+ * property untouched, including to code that spreads the context.
11
+ */
12
+ import type { AddonContext } from '../interfaces/addon.js';
13
+ import type { SecretsAccess } from '../keychain/secrets-access.js';
14
+ import type { SecretTree } from './secret-paths.js';
15
+ export interface SecretAwareSettingsOptions {
16
+ readonly secrets: SecretsAccess;
17
+ /** The addon store's secret tree (schema + `secretStatePaths`). */
18
+ readonly addonTree: () => SecretTree;
19
+ /** The per-device store's secret tree. */
20
+ readonly deviceTree: () => SecretTree;
21
+ /** Told about refs a write dropped but could not delete (they are now orphans). */
22
+ readonly onOrphaned: (refs: readonly string[]) => void;
23
+ /** Is the write in progress the OPERATOR's (see `SecretWriteInput.operatorWrite`)? */
24
+ readonly isOperatorWrite?: () => boolean;
25
+ }
26
+ /** The context the addon sees: identical, except that its settings writes are secret-aware. */
27
+ export declare function withSecretAwareSettings(context: AddonContext, opts: SecretAwareSettingsOptions): AddonContext;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * WHERE an addon's secrets live in its settings blob — derived from the
3
+ * field TYPE (`type: 'password'` or `secret: true`, `storage` not `'inline'`)
4
+ * and from the addon's declared `secretStatePaths`, NEVER from a key's name
5
+ * (operator decision, D787). A text field called `password` is not secret; a
6
+ * textarea holding a PEM key with `secret: true` is.
7
+ *
8
+ * The result is a small tree over the blob's top-level keys:
9
+ * - `leaf` — the value at this key is a secret;
10
+ * - `object` — descend into a nested object (`identity.pincode`);
11
+ * - `array` — every item, matched by its id field, has secret members
12
+ * (`providers[id].clientSecret`, `tokens[userId].accessToken`).
13
+ *
14
+ * `secretStatePaths` syntax: dot-separated keys, an array segment written
15
+ * `key[<idField>]`: `'snapshotSigningKey'`, `'identity.pincode'`,
16
+ * `'tokens[userId].accessToken'`.
17
+ */
18
+ import type { ConfigUISchema } from '../interfaces/config-ui.js';
19
+ import { isKeychainStoredField } from '../interfaces/config-ui-secrets.js';
20
+ export type SecretNode = {
21
+ readonly kind: 'leaf';
22
+ } | {
23
+ readonly kind: 'object';
24
+ readonly children: ReadonlyMap<string, SecretNode>;
25
+ } | {
26
+ readonly kind: 'array';
27
+ readonly idKey: string;
28
+ readonly item: ReadonlyMap<string, SecretNode>;
29
+ };
30
+ export type SecretTree = ReadonlyMap<string, SecretNode>;
31
+ export { isKeychainStoredField };
32
+ /** The secret tree a settings schema declares. */
33
+ export declare function secretTreeFromSchema(schema: ConfigUISchema | null): SecretTree;
34
+ interface PathSegment {
35
+ readonly key: string;
36
+ /** Set when the segment is an array: the item id field. */
37
+ readonly idKey?: string;
38
+ }
39
+ /** Parse `a.b[id].c` into segments; throws on a malformed path (a declaration bug). */
40
+ export declare function parseSecretStatePath(path: string): readonly PathSegment[];
41
+ /** Add hidden-state paths (`secretStatePaths`) to a schema-derived tree. */
42
+ export declare function mergeSecretStatePaths(tree: SecretTree, paths: readonly string[]): SecretTree;
43
+ /**
44
+ * The tree of a DECLARED path list — a device's `secretConfigPaths`
45
+ * (`collectZodSecretPaths`: dotted, `[]` for array items). An array segment
46
+ * without a named id field is addressed by the item's `id`.
47
+ */
48
+ export declare function secretTreeFromPaths(paths: readonly string[]): SecretTree;
@@ -0,0 +1,80 @@
1
+ /**
2
+ * The secret-aware half of an addon's settings store (D787).
3
+ *
4
+ * WRITE — `transformSecretWrite` rewrites a patch before it reaches the store:
5
+ * every secret path (see `secret-paths.ts`) is classified by
6
+ * `classifySecretWrite` and
7
+ * - KEEP (`''`, `null`, a marker, a UI view, a redaction token) — the stored
8
+ * value stays exactly as it is; `''` NEVER clears;
9
+ * - SET (a non-empty string) — `put` into the keychain FIRST, then the
10
+ * marker goes into the patch. A value equal to what the ref already
11
+ * holds is not re-put;
12
+ * - CLEAR (`{"$secretClear":true}` only) — the marker becomes `null`, and the
13
+ * ref is deleted AFTER the blob write succeeded.
14
+ * Array items are matched by their id field: a reorder keeps refs, a removed
15
+ * row's refs are deleted after the write, a copied row's secret is "not set".
16
+ * Order is always put → blob → delete: a failed blob write can leave an orphan
17
+ * (the Secrets page collects it), never a marker pointing at nothing.
18
+ *
19
+ * STRICT: when a value cannot be stored (keychain locked or unreachable) the
20
+ * write is REFUSED. It never falls back to writing the plaintext into the blob,
21
+ * and nothing migrates plaintext silently — a blob that still holds an inline
22
+ * value keeps it until the operator's one-off migration.
23
+ *
24
+ * READ — `resolveSecretMarkers` substitutes every marker at any depth with its
25
+ * value, in ONE keychain round-trip, before the runtime config is assembled. A
26
+ * value that cannot be resolved is reported and left OUT (never `''`), so the
27
+ * caller can say so instead of starting on an empty credential.
28
+ */
29
+ import type { KeychainUnavailableReason } from '../capabilities/keychain.cap.js';
30
+ import { type SecretScope } from '../keychain/secret-ref.js';
31
+ import type { SecretsAccess } from '../keychain/secrets-access.js';
32
+ import type { SecretTree } from './secret-paths.js';
33
+ /** A write to a secret path could not be stored in the keychain, so it was refused. */
34
+ export declare class KeychainWriteRefusedError extends Error {
35
+ readonly fieldPath: string;
36
+ constructor(fieldPath: string, cause: unknown);
37
+ }
38
+ export interface SecretWriteInput {
39
+ readonly tree: SecretTree;
40
+ readonly secrets: SecretsAccess;
41
+ readonly patch: Record<string, unknown>;
42
+ /** The blob as stored now (markers, not values). */
43
+ readonly stored: Record<string, unknown>;
44
+ /** Scope of a non-perNode key: `global` for the addon store, `device/<id>` for a device store. */
45
+ readonly scope?: SecretScope;
46
+ readonly mintId?: () => string;
47
+ /**
48
+ * The write comes from the OPERATOR (a settings form, an admin API call),
49
+ * not from the addon's own code: a value equal to an inline pre-keychain one
50
+ * is then stored as sent — in the keychain. An addon's own write-back of an
51
+ * unchanged inline value keeps it inline (nothing migrates silently).
52
+ */
53
+ readonly operatorWrite?: boolean;
54
+ }
55
+ export interface SecretWriteResult {
56
+ /** The patch to write: markers in place of values. */
57
+ readonly patch: Record<string, unknown>;
58
+ /** Delete the refs this write dropped. Call ONLY after the blob write succeeded. */
59
+ readonly afterWrite: () => Promise<{
60
+ readonly orphaned: readonly string[];
61
+ }>;
62
+ }
63
+ /** Every marker ref anywhere under `value`. */
64
+ export declare function collectSecretMarkerRefs(value: unknown, out?: string[]): string[];
65
+ /** Rewrite a settings patch so no secret value reaches the blob. See the file doc. */
66
+ export declare function transformSecretWrite(input: SecretWriteInput): Promise<SecretWriteResult>;
67
+ export type UnresolvedReason = KeychainUnavailableReason | 'missing' | 'forbidden';
68
+ export interface UnresolvedSecret {
69
+ readonly ref: string;
70
+ readonly reason: UnresolvedReason;
71
+ }
72
+ export interface ResolvedSecrets<T> {
73
+ readonly value: T;
74
+ readonly unresolved: readonly UnresolvedSecret[];
75
+ }
76
+ /**
77
+ * Replace every marker in `value` with its keychain value. Returns the SAME
78
+ * reference when there is no marker (no allocation, no keychain call).
79
+ */
80
+ export declare function resolveSecretMarkers<T>(value: T, secrets: SecretsAccess): Promise<ResolvedSecrets<T>>;
package/dist/addon.d.ts CHANGED
@@ -27,6 +27,7 @@ export type { IViewerUiProvider } from './capabilities/viewer-ui.cap.js';
27
27
  export { viewerUiCapability } from './capabilities/viewer-ui.cap.js';
28
28
  export { DEVICE_CHILDREN_BATCH_MAX } from './device/children-batch-max.js';
29
29
  export { DeviceType } from './device/device-type.js';
30
+ export { collectZodSecretPaths, isZodSecret } from './device/zod-secret.js';
30
31
  export { DisposerChain } from './disposer-chain.js';
31
32
  export { PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, } from './interfaces/addon-peer-bytes.js';
32
33
  export type * from './interfaces/addon-peer-bytes.js';
@@ -45,3 +46,4 @@ export { BOOT_RECOVERY_BACKOFF_MS } from './util/boot-recovery-backoff.js';
45
46
  export { errMsg } from './utils/err-msg.js';
46
47
  export { asJsonObject, asString, parseJsonUnknown } from './utils/json-safe.js';
47
48
  export { sleep } from './utils/sleep.js';
49
+ export * from './keychain/index.js';
package/dist/addon.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-DPar9AHl.js");
3
- const require_event_category = require("./event-category-CtBAl88K.js");
2
+ const require_sleep = require("./sleep-i3kl-0Na.js");
3
+ const require_event_category = require("./event-category-CHduMGvg.js");
4
4
  const require_err_msg = require("./err-msg-Dx2Kor0g.js");
5
5
  //#region src/generated/cap-input-defaults.ts
6
6
  /**
@@ -16,7 +16,7 @@ const require_err_msg = require("./err-msg-Dx2Kor0g.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: 24 caps, 59 methods with defaults.
19
+ * Coverage: 24 caps, 62 methods with defaults.
20
20
  */
21
21
  var CAP_INPUT_DEFAULTS = Object.freeze({
22
22
  "addons": { "getLogs": { "limit": 100 } },
@@ -150,6 +150,14 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
150
150
  "headroom": .4,
151
151
  "minSessionsPerDevice": 2
152
152
  },
153
+ "getNodeBenchmarkPreflight": {
154
+ "phases": ["device", "pipeline"],
155
+ "steps": [],
156
+ "fpsPerStream": 10,
157
+ "budgetMinutes": 45,
158
+ "keepDownloadedModels": false,
159
+ "acceptInsufficientHeadroom": false
160
+ },
153
161
  "getPlacementStats": { "windowMs": 36e5 },
154
162
  "planAutoTune": {
155
163
  "headroom": .4,
@@ -159,6 +167,14 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
159
167
  "nodes": {},
160
168
  "devices": {}
161
169
  },
170
+ "startNodeBenchmark": {
171
+ "phases": ["device", "pipeline"],
172
+ "steps": [],
173
+ "fpsPerStream": 10,
174
+ "budgetMinutes": 45,
175
+ "keepDownloadedModels": false,
176
+ "acceptInsufficientHeadroom": false
177
+ },
162
178
  "suggestShares": {
163
179
  "headroom": .4,
164
180
  "source": "hardware"
@@ -183,7 +199,13 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
183
199
  "occupancyRecheckFrames": 4,
184
200
  "frameSource": { "kind": "local-broker" }
185
201
  },
186
- "reportMotion": { "source": "analyzer" }
202
+ "reportMotion": { "source": "analyzer" },
203
+ "startNodeBench": {
204
+ "steps": [],
205
+ "settleSec": 5,
206
+ "measureSec": 20,
207
+ "keepDownloadedModels": false
208
+ }
187
209
  },
188
210
  "recording-archive": {
189
211
  "renderClip": {
@@ -403,31 +425,59 @@ exports.DEVICE_SCOPED_CAPS = require_sleep.DEVICE_SCOPED_CAPS;
403
425
  exports.DeviceType = require_err_msg.DeviceType;
404
426
  exports.DisposerChain = require_sleep.DisposerChain;
405
427
  exports.EventCategory = require_event_category.EventCategory;
428
+ exports.MIN_SCRUBBED_LENGTH = require_sleep.MIN_SCRUBBED_LENGTH;
406
429
  exports.PEER_BYTES_CHUNK_BYTES = require_sleep.PEER_BYTES_CHUNK_BYTES;
407
430
  exports.PEER_BYTES_MAX_OUTSTANDING = require_sleep.PEER_BYTES_MAX_OUTSTANDING;
408
431
  exports.PEER_BYTES_STALL_MS = require_sleep.PEER_BYTES_STALL_MS;
409
432
  exports.PEER_BYTES_TICKET_TTL_MS = require_sleep.PEER_BYTES_TICKET_TTL_MS;
410
433
  exports.PROVIDER_OPTIONAL_METHODS = PROVIDER_OPTIONAL_METHODS;
434
+ exports.REVALIDATE_AFTER_MS = require_sleep.REVALIDATE_AFTER_MS;
411
435
  exports.ReadinessRegistry = require_sleep.ReadinessRegistry;
412
436
  exports.ReadinessTimeoutError = require_sleep.ReadinessTimeoutError;
437
+ exports.SECRET_CLEAR = require_sleep.SECRET_CLEAR;
438
+ exports.SECRET_REF_SCHEME = require_sleep.SECRET_REF_SCHEME;
413
439
  exports.adminUiCapability = require_sleep.adminUiCapability;
440
+ exports.arrayItemFieldPath = require_sleep.arrayItemFieldPath;
414
441
  exports.asJsonObject = require_sleep.asJsonObject;
415
442
  exports.asString = require_sleep.asString;
443
+ exports.buildSecretRef = require_sleep.buildSecretRef;
444
+ exports.classifySecretWrite = require_sleep.classifySecretWrite;
445
+ exports.clearKnownSecrets = require_sleep.clearKnownSecrets;
446
+ exports.collectZodSecretPaths = require_sleep.collectZodSecretPaths;
416
447
  exports.createDeviceProxy = require_sleep.createDeviceProxy;
417
448
  exports.createEventBusSliceSource = require_sleep.createEventBusSliceSource;
449
+ exports.createSecretsAccess = require_sleep.createSecretsAccess;
418
450
  exports.describeCustomActions = require_sleep.describeCustomActions;
419
451
  exports.deviceOpsCapability = require_sleep.deviceOpsCapability;
420
452
  exports.emitReadiness = require_sleep.emitReadiness;
421
453
  exports.errMsg = require_err_msg.errMsg;
422
454
  exports.expandCapMethods = require_sleep.expandCapMethods;
455
+ exports.forgetKnownSecret = require_sleep.forgetKnownSecret;
456
+ exports.formatSecretScope = require_sleep.formatSecretScope;
457
+ exports.globalSecretScope = require_sleep.globalSecretScope;
423
458
  exports.isCollectionArrayMethodName = isCollectionArrayMethodName;
424
459
  exports.isDeviceScopedCap = require_sleep.isDeviceScopedCap;
425
460
  exports.isProviderOptionalMethodName = isProviderOptionalMethodName;
461
+ exports.isSecretClear = require_sleep.isSecretClear;
462
+ exports.isSecretFieldView = require_sleep.isSecretFieldView;
463
+ exports.isSecretMarker = require_sleep.isSecretMarker;
464
+ exports.isSecretMarkerLike = require_sleep.isSecretMarkerLike;
465
+ exports.isSecretRef = require_sleep.isSecretRef;
466
+ exports.isZodSecret = require_sleep.isZodSecret;
467
+ exports.knownSecretCount = require_sleep.knownSecretCount;
468
+ exports.makeSecretMarker = require_sleep.makeSecretMarker;
426
469
  exports.nodePin = require_sleep.nodePin;
427
470
  exports.normalizeAddonInitResult = require_sleep.normalizeAddonInitResult;
471
+ exports.normalizeSecretOwner = require_sleep.normalizeSecretOwner;
428
472
  exports.parseJsonUnknown = require_sleep.parseJsonUnknown;
473
+ exports.parseSecretRef = require_sleep.parseSecretRef;
429
474
  exports.readNodePin = require_sleep.readNodePin;
475
+ exports.registerKnownSecret = require_sleep.registerKnownSecret;
476
+ exports.resolveSecretViewsIn = require_sleep.resolveSecretViewsIn;
430
477
  exports.scopeKey = require_sleep.scopeKey;
478
+ exports.scrubKnownSecrets = require_sleep.scrubKnownSecrets;
479
+ exports.shortSecretRefHash = require_sleep.shortSecretRefHash;
431
480
  exports.sleep = require_sleep.sleep;
481
+ exports.toSecretFieldView = require_sleep.toSecretFieldView;
432
482
  exports.viewerUiCapability = require_sleep.viewerUiCapability;
433
483
  exports.withCapInputDefaults = withCapInputDefaults;
package/dist/addon.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { B as nodePin, Ct as DisposerChain, D as adminUiCapability, N as expandCapMethods, S as DEVICE_CHILDREN_BATCH_MAX, T as describeCustomActions, Tt as normalizeAddonInitResult, U as ReadinessRegistry, V as readNodePin, W as ReadinessTimeoutError, _t as PEER_BYTES_MAX_OUTSTANDING, a as asJsonObject, b as deviceOpsCapability, d as BOOT_RECOVERY_BACKOFF_MS, f as DEVICE_SCOPED_CAPS, gt as PEER_BYTES_CHUNK_BYTES, h as createEventBusSliceSource, kt as emitReadiness, m as createDeviceProxy, p as isDeviceScopedCap, q as scopeKey, s as asString, t as sleep, u as parseJsonUnknown, vt as PEER_BYTES_STALL_MS, wt as BaseAddon, x as viewerUiCapability, xt as DATAPLANE_SECRET_HEADER, yt as PEER_BYTES_TICKET_TTL_MS } from "./sleep-BNeXenvr.mjs";
2
- import { t as EventCategory } from "./event-category-B_0XEcLF.mjs";
1
+ import { $t as normalizeSecretOwner, A as adminUiCapability, At as PEER_BYTES_MAX_OUTSTANDING, C as deviceOpsCapability, Ct as clearKnownSecrets, Dt as scrubKnownSecrets, Et as registerKnownSecret, I as expandCapMethods, It as DisposerChain, Jt as arrayItemFieldPath, K as ReadinessRegistry, Lt as BaseAddon, Mt as PEER_BYTES_TICKET_TTL_MS, O as describeCustomActions, Ot as shortSecretRefHash, Pt as DATAPLANE_SECRET_HEADER, Qt as isSecretRef, Rt as normalizeAddonInitResult, St as MIN_SCRUBBED_LENGTH, T as DEVICE_CHILDREN_BATCH_MAX, Tt as knownSecretCount, U as nodePin, W as readNodePin, X as scopeKey, Xt as formatSecretScope, Yt as buildSecretRef, Zt as globalSecretScope, _n as isSecretMarkerLike, a as asJsonObject, b as collectZodSecretPaths, bt as REVALIDATE_AFTER_MS, d as BOOT_RECOVERY_BACKOFF_MS, en as parseSecretRef, f as DEVICE_SCOPED_CAPS, fn as SECRET_CLEAR, gn as isSecretMarker, h as createEventBusSliceSource, hn as isSecretFieldView, in as emitReadiness, jt as PEER_BYTES_STALL_MS, kt as PEER_BYTES_CHUNK_BYTES, m as createDeviceProxy, mn as isSecretClear, p as isDeviceScopedCap, pn as classifySecretWrite, q as ReadinessTimeoutError, qt as SECRET_REF_SCHEME, s as asString, t as sleep, u as parseJsonUnknown, vn as makeSecretMarker, w as viewerUiCapability, wt as forgetKnownSecret, x as isZodSecret, xt as createSecretsAccess, yn as toSecretFieldView, yt as resolveSecretViewsIn } from "./sleep-Cr5YOk3m.mjs";
2
+ import { t as EventCategory } from "./event-category-DaIZi00R.mjs";
3
3
  import { a as DeviceType, t as errMsg } from "./err-msg-DX6i_MY4.mjs";
4
4
  //#region src/generated/cap-input-defaults.ts
5
5
  /**
@@ -15,7 +15,7 @@ import { a as DeviceType, t as errMsg } from "./err-msg-DX6i_MY4.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: 24 caps, 59 methods with defaults.
18
+ * Coverage: 24 caps, 62 methods with defaults.
19
19
  */
20
20
  var CAP_INPUT_DEFAULTS = Object.freeze({
21
21
  "addons": { "getLogs": { "limit": 100 } },
@@ -149,6 +149,14 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
149
149
  "headroom": .4,
150
150
  "minSessionsPerDevice": 2
151
151
  },
152
+ "getNodeBenchmarkPreflight": {
153
+ "phases": ["device", "pipeline"],
154
+ "steps": [],
155
+ "fpsPerStream": 10,
156
+ "budgetMinutes": 45,
157
+ "keepDownloadedModels": false,
158
+ "acceptInsufficientHeadroom": false
159
+ },
152
160
  "getPlacementStats": { "windowMs": 36e5 },
153
161
  "planAutoTune": {
154
162
  "headroom": .4,
@@ -158,6 +166,14 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
158
166
  "nodes": {},
159
167
  "devices": {}
160
168
  },
169
+ "startNodeBenchmark": {
170
+ "phases": ["device", "pipeline"],
171
+ "steps": [],
172
+ "fpsPerStream": 10,
173
+ "budgetMinutes": 45,
174
+ "keepDownloadedModels": false,
175
+ "acceptInsufficientHeadroom": false
176
+ },
161
177
  "suggestShares": {
162
178
  "headroom": .4,
163
179
  "source": "hardware"
@@ -182,7 +198,13 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
182
198
  "occupancyRecheckFrames": 4,
183
199
  "frameSource": { "kind": "local-broker" }
184
200
  },
185
- "reportMotion": { "source": "analyzer" }
201
+ "reportMotion": { "source": "analyzer" },
202
+ "startNodeBench": {
203
+ "steps": [],
204
+ "settleSec": 5,
205
+ "measureSec": 20,
206
+ "keepDownloadedModels": false
207
+ }
186
208
  },
187
209
  "recording-archive": {
188
210
  "renderClip": {
@@ -392,4 +414,4 @@ function isProviderOptionalMethodName(capName, method) {
392
414
  return methods !== void 0 && methods.includes(method);
393
415
  }
394
416
  //#endregion
395
- export { BOOT_RECOVERY_BACKOFF_MS, BaseAddon, CAP_INPUT_DEFAULTS, COLLECTION_ARRAY_METHODS, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DEVICE_SCOPED_CAPS, DeviceType, DisposerChain, EventCategory, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, PROVIDER_OPTIONAL_METHODS, ReadinessRegistry, ReadinessTimeoutError, adminUiCapability, asJsonObject, asString, createDeviceProxy, createEventBusSliceSource, describeCustomActions, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods, isCollectionArrayMethodName, isDeviceScopedCap, isProviderOptionalMethodName, nodePin, normalizeAddonInitResult, parseJsonUnknown, readNodePin, scopeKey, sleep, viewerUiCapability, withCapInputDefaults };
417
+ export { BOOT_RECOVERY_BACKOFF_MS, BaseAddon, CAP_INPUT_DEFAULTS, COLLECTION_ARRAY_METHODS, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DEVICE_SCOPED_CAPS, DeviceType, DisposerChain, EventCategory, MIN_SCRUBBED_LENGTH, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, PROVIDER_OPTIONAL_METHODS, REVALIDATE_AFTER_MS, ReadinessRegistry, ReadinessTimeoutError, SECRET_CLEAR, SECRET_REF_SCHEME, adminUiCapability, arrayItemFieldPath, asJsonObject, asString, buildSecretRef, classifySecretWrite, clearKnownSecrets, collectZodSecretPaths, createDeviceProxy, createEventBusSliceSource, createSecretsAccess, describeCustomActions, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods, forgetKnownSecret, formatSecretScope, globalSecretScope, isCollectionArrayMethodName, isDeviceScopedCap, isProviderOptionalMethodName, isSecretClear, isSecretFieldView, isSecretMarker, isSecretMarkerLike, isSecretRef, isZodSecret, knownSecretCount, makeSecretMarker, nodePin, normalizeAddonInitResult, normalizeSecretOwner, parseJsonUnknown, parseSecretRef, readNodePin, registerKnownSecret, resolveSecretViewsIn, scopeKey, scrubKnownSecrets, shortSecretRefHash, sleep, toSecretFieldView, viewerUiCapability, withCapInputDefaults };
@@ -37,9 +37,9 @@ export declare const addonRoutesCapability: {
37
37
  readonly methods: {
38
38
  readonly getRoutes: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodArray<z.ZodObject<{
39
39
  method: z.ZodEnum<{
40
- GET: "GET";
41
- POST: "POST";
42
40
  PUT: "PUT";
41
+ POST: "POST";
42
+ GET: "GET";
43
43
  DELETE: "DELETE";
44
44
  PATCH: "PATCH";
45
45
  }>;
@@ -16,9 +16,9 @@ import { type InferProvider } from './capability-definition.js';
16
16
  * as every other cap.
17
17
  */
18
18
  declare const LogLevelSchema: z.ZodEnum<{
19
+ info: "info";
19
20
  error: "error";
20
21
  debug: "debug";
21
- info: "info";
22
22
  warn: "warn";
23
23
  }>;
24
24
  declare const ChannelSchema: z.ZodEnum<{
@@ -386,9 +386,9 @@ export declare const addonsCapability: {
386
386
  addonId: z.ZodString;
387
387
  limit: z.ZodDefault<z.ZodNumber>;
388
388
  level: z.ZodOptional<z.ZodEnum<{
389
+ info: "info";
389
390
  error: "error";
390
391
  debug: "debug";
391
- info: "info";
392
392
  warn: "warn";
393
393
  }>>;
394
394
  }, z.core.$strip>, z.ZodArray<z.ZodUnknown>, import("./capability-definition.js").CapabilityMethodKind>;
@@ -601,8 +601,8 @@ export declare const addonsCapability: {
601
601
  }, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
602
602
  addonId: z.ZodString;
603
603
  mode: z.ZodEnum<{
604
- singleton: "singleton";
605
604
  collection: "collection";
605
+ singleton: "singleton";
606
606
  }>;
607
607
  isActive: z.ZodBoolean;
608
608
  }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
@@ -888,9 +888,9 @@ export declare const addonsCapability: {
888
888
  readonly onAddonLogs: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
889
889
  addonId: z.ZodString;
890
890
  level: z.ZodOptional<z.ZodEnum<{
891
+ info: "info";
891
892
  error: "error";
892
893
  debug: "debug";
893
- info: "info";
894
894
  warn: "warn";
895
895
  }>>;
896
896
  }, z.core.$strip>, z.ZodObject<{
@@ -8,9 +8,9 @@
8
8
  import { z } from 'zod';
9
9
  import { type InferProvider } from './capability-definition.js';
10
10
  export declare const AlertSeveritySchema: z.ZodEnum<{
11
+ info: "info";
11
12
  success: "success";
12
13
  error: "error";
13
- info: "info";
14
14
  warning: "warning";
15
15
  }>;
16
16
  export declare const AlertStatusSchema: z.ZodEnum<{
@@ -28,9 +28,9 @@ export declare const AlertSchema: z.ZodObject<{
28
28
  id: z.ZodString;
29
29
  category: z.ZodString;
30
30
  severity: z.ZodEnum<{
31
+ info: "info";
31
32
  success: "success";
32
33
  error: "error";
33
- info: "info";
34
34
  warning: "warning";
35
35
  }>;
36
36
  title: z.ZodString;
@@ -64,9 +64,9 @@ export declare const alertsCapability: {
64
64
  id: z.ZodString;
65
65
  category: z.ZodString;
66
66
  severity: z.ZodEnum<{
67
+ info: "info";
67
68
  success: "success";
68
69
  error: "error";
69
- info: "info";
70
70
  warning: "warning";
71
71
  }>;
72
72
  title: z.ZodString;
@@ -94,9 +94,9 @@ export declare const alertsCapability: {
94
94
  id: z.ZodOptional<z.ZodString>;
95
95
  category: z.ZodOptional<z.ZodString>;
96
96
  severity: z.ZodOptional<z.ZodEnum<{
97
+ info: "info";
97
98
  success: "success";
98
99
  error: "error";
99
- info: "info";
100
100
  warning: "warning";
101
101
  }>>;
102
102
  title: z.ZodOptional<z.ZodString>;
@@ -126,9 +126,9 @@ export declare const alertsCapability: {
126
126
  id: z.ZodString;
127
127
  category: z.ZodString;
128
128
  severity: z.ZodEnum<{
129
+ info: "info";
129
130
  success: "success";
130
131
  error: "error";
131
- info: "info";
132
132
  warning: "warning";
133
133
  }>;
134
134
  title: z.ZodString;
@@ -25,10 +25,10 @@ import { DeviceType } from '../device/device-type.js';
25
25
  * separate `sourceInfo` or device-config blob for these values.
26
26
  */
27
27
  export declare const ControlKindSchema: z.ZodEnum<{
28
- datetime: "datetime";
29
28
  text: "text";
30
- numeric: "numeric";
31
29
  select: "select";
30
+ datetime: "datetime";
31
+ numeric: "numeric";
32
32
  }>;
33
33
  export type ControlKind = z.infer<typeof ControlKindSchema>;
34
34
  /**
@@ -53,10 +53,10 @@ export type ControlKind = z.infer<typeof ControlKindSchema>;
53
53
  */
54
54
  export declare const ControlStatusSchema: z.ZodObject<{
55
55
  kind: z.ZodEnum<{
56
- datetime: "datetime";
57
56
  text: "text";
58
- numeric: "numeric";
59
57
  select: "select";
58
+ datetime: "datetime";
59
+ numeric: "numeric";
60
60
  }>;
61
61
  value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
62
62
  options: z.ZodArray<z.ZodString>;
@@ -67,8 +67,8 @@ export declare const ControlStatusSchema: z.ZodObject<{
67
67
  step: z.ZodOptional<z.ZodNumber>;
68
68
  precision: z.ZodOptional<z.ZodNumber>;
69
69
  format: z.ZodOptional<z.ZodEnum<{
70
- date: "date";
71
70
  datetime: "datetime";
71
+ date: "date";
72
72
  time: "time";
73
73
  }>>;
74
74
  }, z.core.$strip>;
@@ -114,10 +114,10 @@ export declare const controlCapability: {
114
114
  readonly status: {
115
115
  readonly schema: z.ZodObject<{
116
116
  kind: z.ZodEnum<{
117
- datetime: "datetime";
118
117
  text: "text";
119
- numeric: "numeric";
120
118
  select: "select";
119
+ datetime: "datetime";
120
+ numeric: "numeric";
121
121
  }>;
122
122
  value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
123
123
  options: z.ZodArray<z.ZodString>;
@@ -128,8 +128,8 @@ export declare const controlCapability: {
128
128
  step: z.ZodOptional<z.ZodNumber>;
129
129
  precision: z.ZodOptional<z.ZodNumber>;
130
130
  format: z.ZodOptional<z.ZodEnum<{
131
- date: "date";
132
131
  datetime: "datetime";
132
+ date: "date";
133
133
  time: "time";
134
134
  }>>;
135
135
  }, z.core.$strip>;
@@ -142,10 +142,10 @@ export declare const controlCapability: {
142
142
  */
143
143
  readonly runtimeState: z.ZodObject<{
144
144
  kind: z.ZodEnum<{
145
- datetime: "datetime";
146
145
  text: "text";
147
- numeric: "numeric";
148
146
  select: "select";
147
+ datetime: "datetime";
148
+ numeric: "numeric";
149
149
  }>;
150
150
  value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
151
151
  options: z.ZodArray<z.ZodString>;
@@ -156,8 +156,8 @@ export declare const controlCapability: {
156
156
  step: z.ZodOptional<z.ZodNumber>;
157
157
  precision: z.ZodOptional<z.ZodNumber>;
158
158
  format: z.ZodOptional<z.ZodEnum<{
159
- date: "date";
160
159
  datetime: "datetime";
160
+ date: "date";
161
161
  time: "time";
162
162
  }>>;
163
163
  }, z.core.$strip>;