@camstack/types 1.2.601 → 1.2.603

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.603] - 2026-11-19
11
+
12
+ ### Changed
13
+
14
+ - Unit preparation no longer throws on a command step with no action chosen yet
15
+ - Every event category now has a catalogue entry (group, English and Italian label, noise and deprecated flags); the event-ring deny list is derived from it
16
+
17
+ ## [1.2.602] - 2026-11-19
18
+
19
+ ### Changed
20
+
21
+ - An instance's on/off switch is now kept only in the hub registry row; addons learn it at boot and from the hub's notification
22
+
10
23
  ## [1.2.601] - 2026-11-19
11
24
 
12
25
  ### Changed
@@ -233,8 +233,47 @@ export declare abstract class BaseAddon<TConfig extends object = Record<string,
233
233
  private retiredMigrationIds;
234
234
  protected declareRetiredMigrations(ids: readonly string[]): void;
235
235
  private registrySwitchSpec;
236
+ /** The instance kinds whose switch move this process already ran (or tried), by record kind name. */
237
+ private readonly switchMoved;
238
+ private lastDeclared;
236
239
  private registrySwitchBound;
240
+ /**
241
+ * A helper built AFTER the addon's migrations ran has a kind that moved nothing yet. Run its
242
+ * switch move now (the engine replaces an owner's catalogue on every declare, so the whole
243
+ * declared set goes with it, phased to the late ids), read the registry again, and tell the
244
+ * addon about every instance that is off so it stops what it started on the default.
245
+ */
246
+ private moveLateInstanceKinds;
237
247
  private runBound;
248
+ /**
249
+ * Learn the on/off state of this addon's instances from the registry rows (D1066), at boot, after
250
+ * a migration run, and again through {@link rehydrateSwitches}. It runs on the addon's own boot
251
+ * path, never inside a method the hub calls into. A registry that cannot answer leaves the
252
+ * instances of THIS addon reading off (fail closed, per owner) until a read answers.
253
+ */
254
+ private switchesHydrated;
255
+ private hydrateSwitches;
256
+ /**
257
+ * Every record of a served kind the registry holds no row for (created outside the hub door:
258
+ * a seed, a store write) is adopted with the state it effectively had, on unless this process
259
+ * stated it off, so the hub can switch it. A failure is logged; the next hydration retries.
260
+ */
261
+ private adoptUnrowed;
262
+ /**
263
+ * Read the switches from the registry again and announce the states now known, so an addon that
264
+ * started on the fail-closed default (off) starts what is on. Throws
265
+ * {@link InstanceSwitchesUnreadError} when the registry still does not answer while this addon
266
+ * serves instance kinds: a forked runner turns that into a failed boot (the supervisor respawns
267
+ * it, bounded, D6), an agent or the hub reads again on the next hub connect (event-driven, D3).
268
+ * An addon with no instance kind has nothing waiting and never throws.
269
+ */
270
+ rehydrateSwitches(): Promise<void>;
271
+ /**
272
+ * Called on the hub-reachable event (instead of `onHubReachable` directly): the switches are
273
+ * read again, then `onHubReachable` runs. A registry that still does not answer is logged and
274
+ * left for the next connect.
275
+ */
276
+ hubReachable(): Promise<void>;
238
277
  /**
239
278
  * Called by the isolated-process runner AFTER `broker.start()`.
240
279
  * In-process addons never need this because the hub broker is already
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The registry could not be read for the switches of an addon that serves instance kinds, so its
3
+ * instances read off (D1066). A forked runner treats it as a failed boot: the supervisor respawns
4
+ * it, bounded and marked terminally failed (D6), rather than leave instances off silently.
5
+ */
6
+ export declare const INSTANCE_SWITCHES_UNREAD_ERROR_NAME = "InstanceSwitchesUnreadError";
7
+ export declare class InstanceSwitchesUnreadError extends Error {
8
+ readonly ownerId: string;
9
+ constructor(ownerId: string);
10
+ }
11
+ /** By name, so a second copy of this module in a bundle still matches. */
12
+ export declare function isInstanceSwitchesUnreadError(err: unknown): err is InstanceSwitchesUnreadError;
@@ -0,0 +1,75 @@
1
+ /**
2
+ * The process-local copy of the on/off state of the instances this process serves (D1066).
3
+ *
4
+ * The hub registry row, keyed by (addon, integration id) like a device, is the ONLY stored switch of
5
+ * an instance. An addon keeps no field of its own: it learns the state from the registry at boot
6
+ * ({@link hydrateInstanceSwitches}) and afterwards from the hub's `setInstanceEnabled` notification
7
+ * ({@link recordRegistrySwitch}). A read inside a method the hub calls into is therefore a memory
8
+ * read, never a call back to the hub.
9
+ *
10
+ * Fail closed, per owner: while an addon that serves an instance kind has not been answered by the
11
+ * registry, an id of that addon nobody stated reads as OFF. Once it answered, an id nobody stated is
12
+ * a fresh instance and reads as on. An addon with no instance kind is never held back.
13
+ */
14
+ import type { DefinedRecordKind } from '../records/record-kind.js';
15
+ /**
16
+ * An addon's boot is about to read the registry for its rows. From now on, until the registry
17
+ * answers, its served instance kinds (already built or built later in its boot) fail closed. A
18
+ * helper used with no addon boot around it (a spec, a tool) is never held back.
19
+ */
20
+ export declare function beginHydration(ownerId: string): void;
21
+ /** The helper of `ownerId` serves `id`: its fail-closed window is that owner's, not the process's. */
22
+ export declare function claimInstance(ownerId: string, id: string): void;
23
+ /** Whether `ownerId` still waits for the registry to answer (it serves a kind and has no rows yet). */
24
+ export declare function isHydrationPending(ownerId: string): boolean;
25
+ /** The owners still waiting for the registry. */
26
+ export declare function pendingHydrationOwners(): readonly string[];
27
+ /**
28
+ * The switch of `id` as this process knows it. An id nobody stated reads off while ITS owner waits
29
+ * for the registry, on afterwards (a fresh instance). An id with no known owner reads off while any
30
+ * owner waits.
31
+ */
32
+ export declare function isInstanceOn(id: string): boolean;
33
+ /** Record a state this process holds for `id` (a local mirror; the registry may not have a row yet). */
34
+ export declare function recordInstanceSwitch(id: string, enabled: boolean): void;
35
+ /** Record what the hub told: the registry holds a row of `id` in this state. */
36
+ export declare function recordRegistrySwitch(id: string, enabled: boolean): void;
37
+ /** Whether the registry is known to hold a row for `id`. */
38
+ export declare function hasRegistryRow(id: string): boolean;
39
+ /** The state this process holds for `id`, or undefined when it holds none. */
40
+ export declare function statedInstanceSwitch(id: string): boolean | undefined;
41
+ /** Forget `id` (the instance was deleted). */
42
+ export declare function forgetInstanceSwitch(id: string): void;
43
+ /** Seed the store from the registry rows of `ownerId`; the registry answered, so the owner is known. */
44
+ export declare function hydrateInstanceSwitches(ownerId: string, rows: readonly {
45
+ readonly id: string;
46
+ readonly enabled: boolean;
47
+ }[]): void;
48
+ /** The addon's boot has built every instance kind and read the registry: unknown ids now read on. */
49
+ export declare function settleHydration(ownerId: string): void;
50
+ /** Spec seam: start from an empty store. */
51
+ export declare function clearInstanceSwitches(): void;
52
+ /** A record of a served kind with no registry row: adopted with the state it effectively had. */
53
+ export interface UnrowedInstance {
54
+ readonly id: string;
55
+ readonly name: string;
56
+ readonly enabled: boolean;
57
+ }
58
+ /** An instance kind an addon serves through {@link RecordIntegrationInstances}. */
59
+ export interface ServedInstanceKind {
60
+ readonly kind: DefinedRecordKind;
61
+ /** Tell the helper's switch listeners the state of every instance of its kind, on and off. */
62
+ readonly reapply: () => Promise<void>;
63
+ /** The records of this kind the registry holds no row for, with the state this process holds. */
64
+ readonly unrowed: () => Promise<readonly UnrowedInstance[]>;
65
+ }
66
+ /**
67
+ * A helper announces the kind it serves, by owner addon. The one-time body-to-registry move
68
+ * (D1066) walks exactly these kinds, so an addon needs no list of its own: a record kind IS an
69
+ * instance kind precisely when a helper wraps it.
70
+ */
71
+ export declare function registerServedInstanceKind(ownerId: string, served: ServedInstanceKind): void;
72
+ /** The instance kinds announced for `ownerId` so far. */
73
+ export declare function servedInstanceKindsOf(ownerId: string): readonly ServedInstanceKind[];
74
+ /** Spec seam: forget every served kind announced so far. */
75
+ export declare function clearServedInstanceKinds(): void;
@@ -84,8 +84,6 @@ export declare class NotificationTargetStore {
84
84
  /** Insert or replace by id; a target whose kind changed leaves the record of its old kind. */
85
85
  upsert(target: Target): Promise<void>;
86
86
  delete(id: string): Promise<void>;
87
- /** Flip the switch on an existing target; null when it does not exist. */
88
- setEnabled(id: string, enabled: boolean): Promise<Target | null>;
89
87
  }
90
88
  /** What a provider hands {@link buildNotificationTargetInstances}. */
91
89
  export interface NotificationTargetInstancesSpec {
@@ -17,18 +17,16 @@ import type { IntegrationTestConnectionResult } from '../capabilities/integratio
17
17
  import type { ConfigUISchema } from '../interfaces/config-ui.js';
18
18
  import type { DefinedRecordKind } from '../records/record-kind.js';
19
19
  import type { RecordsAccess } from '../records/records-access.js';
20
- /** What every instance body carries: an absent `enabled` means on (no data migration). */
21
- export type InstanceBody = Record<string, unknown> & {
22
- readonly enabled?: boolean | undefined;
23
- };
20
+ import { type UnrowedInstance } from './instance-switches.js';
24
21
  /**
25
- * The ONE reader of an instance's switch (D996): an absent field means on, so a row written
26
- * before the field existed needs no migration. Every consumer of an instance body asks this.
22
+ * What every instance body is. The on/off state is NOT part of it: the hub registry row is the only
23
+ * stored switch (D1066), read through {@link isInstanceOn}.
24
+ */
25
+ export type InstanceBody = Record<string, unknown>;
26
+ /**
27
+ * The body key the switch USED to live under (D1007, D1015). Nothing writes or reads it any more;
28
+ * the migrations that move it between the body and the registry name it.
27
29
  */
28
- export declare function isInstanceEnabled(body: {
29
- readonly enabled?: boolean | undefined;
30
- }): boolean;
31
- /** The body key of the switch; only {@link RecordIntegrationInstances.setInstanceEnabled} writes it. */
32
30
  export declare const SWITCH_KEY = "enabled";
33
31
  /**
34
32
  * The "Add device" mode an instance gets when its provider states none, from how the provider's
@@ -112,6 +110,12 @@ export declare class RecordIntegrationInstances<TBody extends InstanceBody> {
112
110
  private readonly secretKeys;
113
111
  private readonly secretMaps;
114
112
  private readonly nameField;
113
+ /** The state each instance had when the addon last read it or was told it: {@link reapply} announces only a change. */
114
+ private readonly knownSwitches;
115
+ /** What the addon reads for `id`: the switch as this process holds it, remembered as known. */
116
+ private knownSwitchOf;
117
+ /** What a view of `id` shows; the addon did not read it, so nothing is remembered as known. */
118
+ private viewSwitchOf;
115
119
  private readonly switchListeners;
116
120
  constructor(records: Pick<RecordsAccess, 'kind' | 'owner'>, kind: DefinedRecordKind<z.ZodType<TBody>>, hooks: RecordIntegrationInstancesHooks<TBody>);
117
121
  /**
@@ -143,11 +147,23 @@ export declare class RecordIntegrationInstances<TBody extends InstanceBody> {
143
147
  */
144
148
  onSwitched(listener: (id: string, enabled: boolean) => void | Promise<void>): void;
145
149
  /**
146
- * The ONE writer of the switch (D996, D1014): the record body's `enabled`, for every role. A
147
- * configured thing is an instance, so an id with no record yet (a default integration that was
148
- * never configured) gets its record from `initialBody` before the switch is written.
150
+ * The hub's notification that the registry row of `id` moved (D1066). The registry holds the
151
+ * switch; this keeps NO copy of it in the record. It remembers the state for this process's
152
+ * readers ({@link isInstanceOn}), lets the addon re-apply, and fires the listeners.
149
153
  */
150
154
  setInstanceEnabled: IIntegrationInstancesProvider['setInstanceEnabled'];
155
+ /**
156
+ * After the registry answered for a kind built before it could: announce the state of every
157
+ * instance of this kind, on and off, so an addon that started on the fail-closed default (off)
158
+ * starts what is on and stops what is off.
159
+ */
160
+ reapply(): Promise<void>;
161
+ /**
162
+ * The records of this kind the registry holds no row for: created outside the hub door (a
163
+ * seed, a migration, a store write). Each carries the state this process holds for it, on when
164
+ * it holds none, because on was its effective state before the registry owned the switch.
165
+ */
166
+ unrowed(): Promise<readonly UnrowedInstance[]>;
151
167
  /** The row and its keychain refs go together (the records door). */
152
168
  deleteInstance: IIntegrationInstancesProvider['deleteInstance'];
153
169
  testInstance: NonNullable<IIntegrationInstancesProvider['testInstance']>;
package/dist/addon.d.ts CHANGED
@@ -42,6 +42,7 @@ export { deviceOpsCapability } from './capabilities/device-ops.cap.js';
42
42
  export type { IViewerUiProvider } from './capabilities/viewer-ui.cap.js';
43
43
  export { viewerUiCapability } from './capabilities/viewer-ui.cap.js';
44
44
  export { DEVICE_CHILDREN_BATCH_MAX } from './device/children-batch-max.js';
45
+ export { DEVICE_RESTORE_RETRY_DELAYS_MS } from './device/device-restore-retry.js';
45
46
  export { COMPOSED_DEVICE_STABLE_ID_PREFIX } from './composition/composed-stable-id.js';
46
47
  export { DeviceType } from './device/device-type.js';
47
48
  export { collectZodSecretPaths, isZodSecret } from './device/zod-secret.js';
@@ -75,3 +76,4 @@ export * from './keychain/index.js';
75
76
  export * from './records/index.js';
76
77
  export { createDebugEmitter } from './logging/debug-watch.js';
77
78
  export { describeNvidia } from './inference/runtime-capabilities.js';
79
+ export { isInstanceSwitchesUnreadError } from './addon/instance-switches-unread-error.js';
package/dist/addon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_runtime_capabilities = require("./runtime-capabilities-azf1ve5b.js");
2
+ const require_runtime_capabilities = require("./runtime-capabilities-D9KsXMv7.js");
3
3
  const require_event_category = require("./event-category-CMA0-jGW.js");
4
4
  const require_composed_stable_id = require("./composed-stable-id-DkF5-kuf.js");
5
5
  //#region src/generated/cap-input-defaults.ts
@@ -570,6 +570,7 @@ exports.COMPOSED_DEVICE_STABLE_ID_PREFIX = require_composed_stable_id.COMPOSED_D
570
570
  exports.CommandOriginClaimSchema = require_runtime_capabilities.CommandOriginClaimSchema;
571
571
  exports.DATAPLANE_SECRET_HEADER = require_runtime_capabilities.DATAPLANE_SECRET_HEADER;
572
572
  exports.DEVICE_CHILDREN_BATCH_MAX = require_runtime_capabilities.DEVICE_CHILDREN_BATCH_MAX;
573
+ exports.DEVICE_RESTORE_RETRY_DELAYS_MS = require_runtime_capabilities.DEVICE_RESTORE_RETRY_DELAYS_MS;
573
574
  exports.DEVICE_SCOPED_CAPS = require_runtime_capabilities.DEVICE_SCOPED_CAPS;
574
575
  exports.DeclarationRefusedError = require_runtime_capabilities.DeclarationRefusedError;
575
576
  exports.DeviceType = require_composed_stable_id.DeviceType;
@@ -676,6 +677,7 @@ exports.isCapMethodAbsent = require_runtime_capabilities.isCapMethodAbsent;
676
677
  exports.isCollectionArrayMethodName = isCollectionArrayMethodName;
677
678
  exports.isCommand = require_runtime_capabilities.isCommand;
678
679
  exports.isDeviceScopedCap = require_runtime_capabilities.isDeviceScopedCap;
680
+ exports.isInstanceSwitchesUnreadError = require_runtime_capabilities.isInstanceSwitchesUnreadError;
679
681
  exports.isProviderOptionalMethodName = isProviderOptionalMethodName;
680
682
  exports.isSecretClear = require_runtime_capabilities.isSecretClear;
681
683
  exports.isSecretFieldView = require_runtime_capabilities.isSecretFieldView;
package/dist/addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as CAP_STATE_LEAVES, $i as normalizeSecretOwner, $n as createSecretsAccess, A as DEVICE_SCOPED_CAPS, Ai as recordSecretCollection, Ar as isZodSecret, Bi as RECORD_MAX_DATA_BYTES, Cr as RecordRetentionSchema, Ct as DEVICE_CHILDREN_BATCH_MAX, D as parseJsonUnknown, Di as mapSecretLeaves, Dr as defineRecordKinds, Ei as collectSecretLeaves, Er as declarationsOf, Et as addonPagesSourceCapability, F as createEventBusSliceSource, Fi as RECORD_CLASSES, Ga as isSecretClear, Gi as RECORD_SETTINGS_MAX_ROWS, Gn as OnBehalfSourceSchema, Hi as RECORD_MAX_INDEX_FIELDS, Ht as scopeKey, Ii as RECORD_DATABASES, J as HF_REPO, Ja as isSecretMarkerLike, Ji as arrayItemFieldPath, Jn as makeInMemoryRecords, Ka as isSecretFieldView, Ki as RECORD_SWEEP_INTERVAL_MS, Kn as RuleFireOriginSchema, Li as RECORD_DEFAULT_MAX_DATA_BYTES, Lt as MODEL_FORMATS, M as createDeviceProxy, Ma as createEvent, Mi as secretArrayPrefixes, Na as emitReadiness, Ni as RECORD_BATCH_MAX, O as hfModelUrl, Oi as parseSecretPath, P as addonSliceHandleApi, Pi as RECORD_BATCH_MAX_BYTES, Qi as isSecretRef, Qn as REVALIDATE_AFTER_MS, Qr as BaseAddon, Ri as RECORD_DELETE_BATCH, Rr as expandCapMethods, Rt as ReadinessRegistry, S as asJsonObject, Sa as recordsErrorFromMessage, Sr as RecordKindNameSchema, St as deviceOpsCapability, Ti as REMOVE_LEAF, Tr as assertValidDeclaration, Ua as SECRET_CLEAR, Ui as RECORD_QUERY_MAX, Un as CommandOriginClaimSchema, Vi as RECORD_MAX_INDEXES, W as isCommand, Wa as classifySecretWrite, Wi as RECORD_SECRET_COLLECTION_PREFIX, Wn as OnBehalfSchema, X as CAP_ADVANCE_FIELDS, Xa as toSecretFieldView, Xi as formatSecretScope, Xn as assertTransactScope, Xr as readErrorI18n, Xt as createDebugEmitter, Ya as makeSecretMarker, Yi as buildSecretRef, Yn as createRecordsAccess, Z as CAP_METHOD_TIMEOUTS_MS, Zi as globalSecretScope, Zn as resolveSecretViewsIn, _a as RevConflictError, _r as entryBody, _t as switchRefusesSetState, aa as DeclarationRefusedError, ao as findMigrationsBlocked, ar as scrubKnownSecrets, at as defineCustomActions, ba as UnknownRecordKindError, br as RecordIndexSchema, bt as MIGRATION_API_VERSION, ca as InvalidRecordError, cr as PEER_BYTES_MAX_OUTSTANDING, da as RECORDS_ERROR_CODES, di as SCOPED_SETTINGS_SCOPES, dt as nodePin, ea as parseSecretRef, er as MIN_SCRUBBED_LENGTH, et as CAP_METHOD_NOT_IMPLEMENTED, fa as RecordNotFoundError, fi as nodeIdOfScopedKey, fr as CALLER_USERNAME_HEADER, ft as readCommandOrigin, ga as RecordsError, gr as defineEntryKind, gt as SWITCH_SETTABLE_GATE, ha as RecordUniqueViolationError, hr as DisposerChain, ht as viewerUiCapability, ia as BatchTooLargeError, io as AddonMigrationsBlockedError, ir as registerKnownSecret, it as customAction, j as isDeviceScopedCap, ji as recordSecretRef, k as BOOT_RECOVERY_BACKOFF_MS, ki as recordArrayItemPath, kr as collectZodSecretPaths, la as NoCallerError, lr as PEER_BYTES_STALL_MS, ma as RecordTooLargeError, mi as resolvedValues, n as describeNvidia, nr as forgetKnownSecret, nt as CALLER_STAMPED_CAPABILITIES, oa as FilterRequiredError, or as shortSecretRefHash, ot as describeCustomActions, pa as RecordSecretUnavailableError, pi as resolveDeviceSettings, pr as DATAPLANE_SECRET_HEADER, pt as readNodePin, qa as isSecretMarker, qi as SECRET_REF_SCHEME, qn as ruleFireOfClaim, qr as ErrorI18nPayloadSchema, rr as knownSecretCount, rt as withoutCallerStamp, sa as ForeignSecretMarkerError, sr as PEER_BYTES_CHUNK_BYTES, ti as normalizeAddonInitResult, tr as clearKnownSecrets, tt as isCapMethodAbsent, u as sleep, ua as PlaintextSecretError, ur as PEER_BYTES_TICKET_TTL_MS, ut as commandOrigin, va as TransactRefusedError, vr as EntryDescriptorSchema, vt as PipelineRunResultBridge, w as asString, wi as secretViewsOf, wr as StoredRecordKindDeclarationSchema, wt as adminUiCapability, xa as asRecordsError, xr as RecordKindDeclarationSchema, y as maskUrlCredentials, ya as UnindexedFilterError, yr as RecordFieldPathSchema, yt as PipelineStepInputSchema, zi as RECORD_ID_MAX_LENGTH, zt as ReadinessTimeoutError } from "./runtime-capabilities-B36VcCR6.mjs";
1
+ import { $ as CAP_ADVANCE_FIELDS, $a as classifySecretWrite, $i as RECORD_SETTINGS_MAX_ROWS, $n as assertTransactScope, $r as readErrorI18n, $t as createDebugEmitter, A as DEVICE_SCOPED_CAPS, Aa as recordsErrorFromMessage, Ar as defineRecordKinds, Bi as secretArrayPrefixes, Bt as MODEL_FORMATS, Ca as RecordUniqueViolationError, Cr as RecordIndexSchema, Ct as MIGRATION_API_VERSION, D as parseJsonUnknown, Da as UnindexedFilterError, Dr as StoredRecordKindDeclarationSchema, Dt as adminUiCapability, Ea as TransactRefusedError, Er as RecordRetentionSchema, Et as DEVICE_CHILDREN_BATCH_MAX, F as createEventBusSliceSource, Fi as mapSecretLeaves, Gi as RECORD_DEFAULT_MAX_DATA_BYTES, Gt as scopeKey, Ha as emitReadiness, Hi as RECORD_BATCH_MAX_BYTES, Ht as ReadinessTimeoutError, Ii as parseSecretPath, Ji as RECORD_MAX_DATA_BYTES, Jn as OnBehalfSourceSchema, Ki as RECORD_DELETE_BATCH, Kn as CommandOriginClaimSchema, Li as recordArrayItemPath, M as createDeviceProxy, Mi as secretViewsOf, Mr as collectZodSecretPaths, Ni as REMOVE_LEAF, Nr as isZodSecret, O as hfModelUrl, Oa as UnknownRecordKindError, Or as assertValidDeclaration, P as addonSliceHandleApi, Pi as collectSecretLeaves, Qa as SECRET_CLEAR, Qi as RECORD_SECRET_COLLECTION_PREFIX, Qn as createRecordsAccess, Ri as recordSecretCollection, S as asJsonObject, Sa as RecordTooLargeError, Sr as RecordFieldPathSchema, St as PipelineStepInputSchema, Ta as RevConflictError, To as findMigrationsBlocked, Tr as RecordKindNameSchema, Tt as deviceOpsCapability, Ui as RECORD_CLASSES, Va as createEvent, Vi as RECORD_BATCH_MAX, Vr as expandCapMethods, Vt as ReadinessRegistry, W as isCommand, Wi as RECORD_DATABASES, Xi as RECORD_MAX_INDEX_FIELDS, Xn as ruleFireOfClaim, Xr as ErrorI18nPayloadSchema, Yi as RECORD_MAX_INDEXES, Yn as RuleFireOriginSchema, Z as HF_REPO, Zi as RECORD_QUERY_MAX, Zn as makeInMemoryRecords, _a as NoCallerError, _i as resolvedValues, aa as globalSecretScope, ao as toSecretFieldView, ar as forgetKnownSecret, at as CALLER_STAMPED_CAPABILITIES, ba as RecordNotFoundError, bi as isInstanceSwitchesUnreadError, br as entryBody, bt as switchRefusesSetState, ca as parseSecretRef, cr as scrubKnownSecrets, ct as defineCustomActions, dr as PEER_BYTES_MAX_OUTSTANDING, ea as RECORD_SWEEP_INTERVAL_MS, eo as isSecretClear, er as resolveSecretViewsIn, et as CAP_METHOD_TIMEOUTS_MS, fa as BatchTooLargeError, fr as PEER_BYTES_STALL_MS, ga as InvalidRecordError, gi as resolveDeviceSettings, gr as DATAPLANE_SECRET_HEADER, gt as readNodePin, ha as ForeignSecretMarkerError, hi as nodeIdOfScopedKey, hr as CALLER_USERNAME_HEADER, ht as readCommandOrigin, ia as formatSecretScope, ii as normalizeAddonInitResult, io as makeSecretMarker, ir as clearKnownSecrets, it as isCapMethodAbsent, j as isDeviceScopedCap, k as BOOT_RECOVERY_BACKOFF_MS, ka as asRecordsError, kr as declarationsOf, kt as addonPagesSourceCapability, lr as shortSecretRefHash, lt as describeCustomActions, ma as FilterRequiredError, mi as SCOPED_SETTINGS_SCOPES, mt as nodePin, n as describeNvidia, na as arrayItemFieldPath, no as isSecretMarker, nr as createSecretsAccess, nt as CAP_STATE_LEAVES, oa as isSecretRef, or as knownSecretCount, ot as withoutCallerStamp, pa as DeclarationRefusedError, pr as PEER_BYTES_TICKET_TTL_MS, pt as commandOrigin, q as DEVICE_RESTORE_RETRY_DELAYS_MS, qi as RECORD_ID_MAX_LENGTH, qn as OnBehalfSchema, ra as buildSecretRef, ro as isSecretMarkerLike, rr as MIN_SCRUBBED_LENGTH, rt as CAP_METHOD_NOT_IMPLEMENTED, sa as normalizeSecretOwner, sr as registerKnownSecret, st as customAction, ta as SECRET_REF_SCHEME, ti as BaseAddon, to as isSecretFieldView, tr as REVALIDATE_AFTER_MS, u as sleep, ur as PEER_BYTES_CHUNK_BYTES, va as PlaintextSecretError, vr as DisposerChain, vt as viewerUiCapability, w as asString, wa as RecordsError, wo as AddonMigrationsBlockedError, wr as RecordKindDeclarationSchema, xa as RecordSecretUnavailableError, xr as EntryDescriptorSchema, xt as PipelineRunResultBridge, y as maskUrlCredentials, ya as RECORDS_ERROR_CODES, yr as defineEntryKind, yt as SWITCH_SETTABLE_GATE, zi as recordSecretRef } from "./runtime-capabilities-ql3VRzQu.mjs";
2
2
  import { t as EventCategory } from "./event-category-7P4A3bYA.mjs";
3
3
  import { a as DeviceType, s as errMsg, t as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./composed-stable-id-DIeNz933.mjs";
4
4
  //#region src/generated/cap-input-defaults.ts
@@ -553,4 +553,4 @@ function isProviderOptionalMethodName(capName, method) {
553
553
  return methods !== void 0 && methods.includes(method);
554
554
  }
555
555
  //#endregion
556
- export { AddonMigrationsBlockedError, BOOT_RECOVERY_BACKOFF_MS, BaseAddon, BatchTooLargeError, CALLER_STAMPED_CAPABILITIES, CALLER_USERNAME_HEADER, CAP_ADVANCE_FIELDS, CAP_INPUT_DEFAULTS, CAP_METHOD_NOT_IMPLEMENTED, CAP_METHOD_TIMEOUTS_MS, CAP_STATE_LEAVES, COLLECTION_ARRAY_METHODS, COMPOSED_DEVICE_STABLE_ID_PREFIX, CommandOriginClaimSchema, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DEVICE_SCOPED_CAPS, DeclarationRefusedError, DeviceType, DisposerChain, EntryDescriptorSchema, ErrorI18nPayloadSchema, EventCategory, FilterRequiredError, ForeignSecretMarkerError, HF_REPO, InvalidRecordError, MIGRATION_API_VERSION, MIN_SCRUBBED_LENGTH, MODEL_FORMATS, NoCallerError, OnBehalfSchema, OnBehalfSourceSchema, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, PROVIDER_OPTIONAL_METHODS, PipelineRunResultBridge, PipelineStepInputSchema, PlaintextSecretError, RECORDS_ERROR_CODES, RECORD_BATCH_MAX, RECORD_BATCH_MAX_BYTES, RECORD_CLASSES, RECORD_DATABASES, RECORD_DEFAULT_MAX_DATA_BYTES, RECORD_DELETE_BATCH, RECORD_ID_MAX_LENGTH, RECORD_MAX_DATA_BYTES, RECORD_MAX_INDEXES, RECORD_MAX_INDEX_FIELDS, RECORD_QUERY_MAX, RECORD_SECRET_COLLECTION_PREFIX, RECORD_SETTINGS_MAX_ROWS, RECORD_SWEEP_INTERVAL_MS, REMOVE_LEAF, REVALIDATE_AFTER_MS, ReadinessRegistry, ReadinessTimeoutError, RecordFieldPathSchema, RecordIndexSchema, RecordKindDeclarationSchema, RecordKindNameSchema, RecordNotFoundError, RecordRetentionSchema, RecordSecretUnavailableError, RecordTooLargeError, RecordUniqueViolationError, RecordsError, RevConflictError, RuleFireOriginSchema, SCOPED_SETTINGS_SCOPES, SECRET_CLEAR, SECRET_REF_SCHEME, SWITCH_SETTABLE_GATE, StoredRecordKindDeclarationSchema, TransactRefusedError, UnindexedFilterError, UnknownRecordKindError, addonPagesSourceCapability, addonSliceHandleApi, adminUiCapability, arrayItemFieldPath, asJsonObject, asRecordsError, asString, assertTransactScope, assertValidDeclaration, buildSecretRef, classifySecretWrite, clearKnownSecrets, collectSecretLeaves, collectZodSecretPaths, commandOrigin, createDebugEmitter, createDeviceProxy, createEvent, createEventBusSliceSource, createRecordsAccess, createSecretsAccess, customAction, declarationsOf, defineCustomActions, defineEntryKind, defineRecordKinds, describeCustomActions, describeNvidia, deviceOpsCapability, emitReadiness, entryBody, errMsg, expandCapMethods, findMigrationsBlocked, forgetKnownSecret, formatSecretScope, globalSecretScope, hfModelUrl, isCapMethodAbsent, isCollectionArrayMethodName, isCommand, isDeviceScopedCap, isProviderOptionalMethodName, isSecretClear, isSecretFieldView, isSecretMarker, isSecretMarkerLike, isSecretRef, isZodSecret, knownSecretCount, makeInMemoryRecords, makeSecretMarker, mapSecretLeaves, maskUrlCredentials, nodeIdOfScopedKey, nodePin, normalizeAddonInitResult, normalizeSecretOwner, parseJsonUnknown, parseSecretPath, parseSecretRef, readCommandOrigin, readErrorI18n, readNodePin, recordArrayItemPath, recordSecretCollection, recordSecretRef, recordsErrorFromMessage, registerKnownSecret, resolveDeviceSettings, resolveSecretViewsIn, resolvedValues, ruleFireOfClaim, scopeKey, scrubKnownSecrets, secretArrayPrefixes, secretViewsOf, shortSecretRefHash, sleep, switchRefusesSetState, toSecretFieldView, viewerUiCapability, withCapInputDefaults, withoutCallerStamp };
556
+ export { AddonMigrationsBlockedError, BOOT_RECOVERY_BACKOFF_MS, BaseAddon, BatchTooLargeError, CALLER_STAMPED_CAPABILITIES, CALLER_USERNAME_HEADER, CAP_ADVANCE_FIELDS, CAP_INPUT_DEFAULTS, CAP_METHOD_NOT_IMPLEMENTED, CAP_METHOD_TIMEOUTS_MS, CAP_STATE_LEAVES, COLLECTION_ARRAY_METHODS, COMPOSED_DEVICE_STABLE_ID_PREFIX, CommandOriginClaimSchema, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DEVICE_RESTORE_RETRY_DELAYS_MS, DEVICE_SCOPED_CAPS, DeclarationRefusedError, DeviceType, DisposerChain, EntryDescriptorSchema, ErrorI18nPayloadSchema, EventCategory, FilterRequiredError, ForeignSecretMarkerError, HF_REPO, InvalidRecordError, MIGRATION_API_VERSION, MIN_SCRUBBED_LENGTH, MODEL_FORMATS, NoCallerError, OnBehalfSchema, OnBehalfSourceSchema, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, PROVIDER_OPTIONAL_METHODS, PipelineRunResultBridge, PipelineStepInputSchema, PlaintextSecretError, RECORDS_ERROR_CODES, RECORD_BATCH_MAX, RECORD_BATCH_MAX_BYTES, RECORD_CLASSES, RECORD_DATABASES, RECORD_DEFAULT_MAX_DATA_BYTES, RECORD_DELETE_BATCH, RECORD_ID_MAX_LENGTH, RECORD_MAX_DATA_BYTES, RECORD_MAX_INDEXES, RECORD_MAX_INDEX_FIELDS, RECORD_QUERY_MAX, RECORD_SECRET_COLLECTION_PREFIX, RECORD_SETTINGS_MAX_ROWS, RECORD_SWEEP_INTERVAL_MS, REMOVE_LEAF, REVALIDATE_AFTER_MS, ReadinessRegistry, ReadinessTimeoutError, RecordFieldPathSchema, RecordIndexSchema, RecordKindDeclarationSchema, RecordKindNameSchema, RecordNotFoundError, RecordRetentionSchema, RecordSecretUnavailableError, RecordTooLargeError, RecordUniqueViolationError, RecordsError, RevConflictError, RuleFireOriginSchema, SCOPED_SETTINGS_SCOPES, SECRET_CLEAR, SECRET_REF_SCHEME, SWITCH_SETTABLE_GATE, StoredRecordKindDeclarationSchema, TransactRefusedError, UnindexedFilterError, UnknownRecordKindError, addonPagesSourceCapability, addonSliceHandleApi, adminUiCapability, arrayItemFieldPath, asJsonObject, asRecordsError, asString, assertTransactScope, assertValidDeclaration, buildSecretRef, classifySecretWrite, clearKnownSecrets, collectSecretLeaves, collectZodSecretPaths, commandOrigin, createDebugEmitter, createDeviceProxy, createEvent, createEventBusSliceSource, createRecordsAccess, createSecretsAccess, customAction, declarationsOf, defineCustomActions, defineEntryKind, defineRecordKinds, describeCustomActions, describeNvidia, deviceOpsCapability, emitReadiness, entryBody, errMsg, expandCapMethods, findMigrationsBlocked, forgetKnownSecret, formatSecretScope, globalSecretScope, hfModelUrl, isCapMethodAbsent, isCollectionArrayMethodName, isCommand, isDeviceScopedCap, isInstanceSwitchesUnreadError, isProviderOptionalMethodName, isSecretClear, isSecretFieldView, isSecretMarker, isSecretMarkerLike, isSecretRef, isZodSecret, knownSecretCount, makeInMemoryRecords, makeSecretMarker, mapSecretLeaves, maskUrlCredentials, nodeIdOfScopedKey, nodePin, normalizeAddonInitResult, normalizeSecretOwner, parseJsonUnknown, parseSecretPath, parseSecretRef, readCommandOrigin, readErrorI18n, readNodePin, recordArrayItemPath, recordSecretCollection, recordSecretRef, recordsErrorFromMessage, registerKnownSecret, resolveDeviceSettings, resolveSecretViewsIn, resolvedValues, ruleFireOfClaim, scopeKey, scrubKnownSecrets, secretArrayPrefixes, secretViewsOf, shortSecretRefHash, sleep, switchRefusesSetState, toSecretFieldView, viewerUiCapability, withCapInputDefaults, withoutCallerStamp };
@@ -21,7 +21,6 @@ declare const IntegrationWithStateSchema: z.ZodObject<{
21
21
  addonId: z.ZodString;
22
22
  name: z.ZodString;
23
23
  enabled: z.ZodBoolean;
24
- switchUnknown: z.ZodOptional<z.ZodLiteral<true>>;
25
24
  info: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
26
25
  originStableId: z.ZodOptional<z.ZodString>;
27
26
  createdAt: z.ZodNumber;
@@ -33,7 +32,6 @@ declare const IntegrationLiteSchema: z.ZodObject<{
33
32
  addonId: z.ZodString;
34
33
  name: z.ZodString;
35
34
  enabled: z.ZodBoolean;
36
- switchUnknown: z.ZodOptional<z.ZodLiteral<true>>;
37
35
  info: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
38
36
  originStableId: z.ZodOptional<z.ZodString>;
39
37
  createdAt: z.ZodNumber;
@@ -124,7 +122,6 @@ export declare const integrationsCapability: {
124
122
  addonId: z.ZodString;
125
123
  name: z.ZodString;
126
124
  enabled: z.ZodBoolean;
127
- switchUnknown: z.ZodOptional<z.ZodLiteral<true>>;
128
125
  info: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
129
126
  originStableId: z.ZodOptional<z.ZodString>;
130
127
  createdAt: z.ZodNumber;
@@ -138,13 +135,13 @@ export declare const integrationsCapability: {
138
135
  addonId: z.ZodString;
139
136
  name: z.ZodString;
140
137
  enabled: z.ZodBoolean;
141
- switchUnknown: z.ZodOptional<z.ZodLiteral<true>>;
142
138
  info: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
143
139
  originStableId: z.ZodOptional<z.ZodString>;
144
140
  createdAt: z.ZodNumber;
145
141
  updatedAt: z.ZodNumber;
146
142
  processState: z.ZodString;
147
143
  }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
144
+ /** The devices-role row of an addon; a services instance row never answers for its addon. */
148
145
  readonly getByAddonId: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
149
146
  addonId: z.ZodString;
150
147
  }, z.core.$strip>, z.ZodNullable<z.ZodObject<{
@@ -152,12 +149,53 @@ export declare const integrationsCapability: {
152
149
  addonId: z.ZodString;
153
150
  name: z.ZodString;
154
151
  enabled: z.ZodBoolean;
155
- switchUnknown: z.ZodOptional<z.ZodLiteral<true>>;
156
152
  info: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
157
153
  originStableId: z.ZodOptional<z.ZodString>;
158
154
  createdAt: z.ZodNumber;
159
155
  updatedAt: z.ZodNumber;
160
156
  }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
157
+ /**
158
+ * Every registry row of one addon, services instances included: the addon reads its own switches
159
+ * with it at boot (D1066). A pure registry read; the Integrations list (`list`) hides the rows of
160
+ * a services instance, this does not.
161
+ */
162
+ readonly listByAddon: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
163
+ addonId: z.ZodString;
164
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
165
+ id: z.ZodString;
166
+ addonId: z.ZodString;
167
+ name: z.ZodString;
168
+ enabled: z.ZodBoolean;
169
+ info: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
170
+ originStableId: z.ZodOptional<z.ZodString>;
171
+ createdAt: z.ZodNumber;
172
+ updatedAt: z.ZodNumber;
173
+ }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
174
+ /**
175
+ * The one-time move of an addon's switches into the registry (D1066): for each instance record
176
+ * the addon holds, an absent row is created as a services row under the addon-minted id, and a
177
+ * row that disagrees with a STATED body switch is corrected (a body that states nothing never
178
+ * moves an existing row). A row
179
+ * that belongs to another addon is left alone and returned in `conflicts` (the caller keeps its
180
+ * own copy of that state), and an addon naming another addon's id is refused FORBIDDEN.
181
+ * Idempotent: a rerun changes nothing. It never notifies the addon.
182
+ */
183
+ readonly adoptInstanceRows: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
184
+ addonId: z.ZodString;
185
+ rows: z.ZodArray<z.ZodObject<{
186
+ id: z.ZodString;
187
+ name: z.ZodString;
188
+ enabled: z.ZodBoolean;
189
+ stated: z.ZodBoolean;
190
+ }, z.core.$strip>>;
191
+ }, z.core.$strip>, z.ZodObject<{
192
+ created: z.ZodNumber;
193
+ updated: z.ZodNumber;
194
+ conflicts: z.ZodArray<z.ZodObject<{
195
+ id: z.ZodString;
196
+ ownerAddonId: z.ZodString;
197
+ }, z.core.$strip>>;
198
+ }, z.core.$strip>, "mutation">;
161
199
  readonly update: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
162
200
  id: z.ZodString;
163
201
  name: z.ZodOptional<z.ZodString>;
@@ -168,7 +206,6 @@ export declare const integrationsCapability: {
168
206
  addonId: z.ZodString;
169
207
  name: z.ZodString;
170
208
  enabled: z.ZodBoolean;
171
- switchUnknown: z.ZodOptional<z.ZodLiteral<true>>;
172
209
  info: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
173
210
  originStableId: z.ZodOptional<z.ZodString>;
174
211
  createdAt: z.ZodNumber;
package/dist/client.js CHANGED
@@ -29806,6 +29806,8 @@ function createSystemProxy(api) {
29806
29806
  list: (input) => dispatch("integrations", "list", "query", input),
29807
29807
  get: (input) => dispatch("integrations", "get", "query", input),
29808
29808
  getByAddonId: (input) => dispatch("integrations", "getByAddonId", "query", input),
29809
+ listByAddon: (input) => dispatch("integrations", "listByAddon", "query", input),
29810
+ adoptInstanceRows: (input) => dispatch("integrations", "adoptInstanceRows", "mutation", input),
29809
29811
  update: (input) => dispatch("integrations", "update", "mutation", input),
29810
29812
  delete: (input) => dispatch("integrations", "delete", "mutation", input),
29811
29813
  getAvailableTypes: (input) => dispatch("integrations", "getAvailableTypes", "query", input)
package/dist/client.mjs CHANGED
@@ -29805,6 +29805,8 @@ function createSystemProxy(api) {
29805
29805
  list: (input) => dispatch("integrations", "list", "query", input),
29806
29806
  get: (input) => dispatch("integrations", "get", "query", input),
29807
29807
  getByAddonId: (input) => dispatch("integrations", "getByAddonId", "query", input),
29808
+ listByAddon: (input) => dispatch("integrations", "listByAddon", "query", input),
29809
+ adoptInstanceRows: (input) => dispatch("integrations", "adoptInstanceRows", "mutation", input),
29808
29810
  update: (input) => dispatch("integrations", "update", "mutation", input),
29809
29811
  delete: (input) => dispatch("integrations", "delete", "mutation", input),
29810
29812
  getAvailableTypes: (input) => dispatch("integrations", "getAvailableTypes", "query", input)
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The event-category catalogue: what an operator-facing surface (a picker, the
3
+ * Logs → Events section, the automation `device-event` row) needs to know about
4
+ * each {@link EventCategory}.
5
+ *
6
+ * `EVENT_CATEGORY_CATALOG` is a `Record<EventCategory, …>`, so it is TOTAL over
7
+ * the enum: a category without an entry here does not compile. That is the
8
+ * whole point — a new category cannot ship unlabelled, ungrouped and unclassified
9
+ * as noise. The kernel's ring-buffer deny list is derived from `noise`, so the
10
+ * broker's "do not retain" set cannot drift from the catalogue.
11
+ *
12
+ * Descriptions are not catalogued yet; a label is the shortest thing a picker
13
+ * can show next to the raw id.
14
+ */
15
+ import { EventCategory } from './event-category.js';
16
+ export type EventCategoryGroup = 'system' | 'addons' | 'devices' | 'integrations' | 'recording' | 'storage' | 'detection' | 'pipeline' | 'enrichment' | 'streams' | 'network' | 'agents' | 'notifications' | 'backup' | 'metrics';
17
+ /** Display order of the groups in a picker. */
18
+ export declare const EVENT_CATEGORY_GROUPS: readonly EventCategoryGroup[];
19
+ export interface EventCategoryLabel {
20
+ readonly en: string;
21
+ readonly it: string;
22
+ }
23
+ export interface EventCategoryEntry {
24
+ readonly group: EventCategoryGroup;
25
+ readonly label: EventCategoryLabel;
26
+ /** High-frequency telemetry: hidden from live views by default and never retained in the event ring. */
27
+ readonly noise: boolean;
28
+ /** Superseded by another category; still emitted or kept as an alias, never offered for new use. */
29
+ readonly deprecated: boolean;
30
+ }
31
+ export declare const EVENT_CATEGORY_CATALOG: Readonly<Record<EventCategory, EventCategoryEntry>>;
32
+ /** Every distinct category value of the enum. */
33
+ export declare function catalogedEventCategories(): readonly EventCategory[];
34
+ /** The raw ids a picker may offer: public (not owner-only), not deprecated. Sorted. */
35
+ export declare function offerableEventCategories(): readonly EventCategory[];
36
+ /** Categories marked `noise`: what the ring-buffer deny list and live views consume. Sorted. */
37
+ export declare function noiseEventCategories(): readonly EventCategory[];
@@ -1,2 +1,3 @@
1
1
  export { EventCategory } from './event-category.js';
2
2
  export { EventSourceType } from './event-source-type.js';
3
+ export { noiseEventCategories } from './event-category-catalog.js';