@camstack/types 1.2.600 → 1.2.602
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 +12 -0
- package/dist/addon/base-addon.d.ts +39 -0
- package/dist/addon/instance-switches-unread-error.d.ts +12 -0
- package/dist/addon/instance-switches.d.ts +75 -0
- package/dist/addon/notification-targets.d.ts +0 -2
- package/dist/addon/record-integration-instances.d.ts +29 -13
- package/dist/addon.d.ts +2 -0
- package/dist/addon.js +3 -1
- package/dist/addon.mjs +2 -2
- package/dist/automation/index.d.ts +1 -1
- package/dist/automation/trace.d.ts +10 -0
- package/dist/capabilities/integrations.cap.d.ts +43 -6
- package/dist/client.js +2 -0
- package/dist/client.mjs +2 -0
- package/dist/generated/addon-api.d.ts +14 -0
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.js +129 -189
- package/dist/index.mjs +105 -184
- package/dist/interfaces/addon.d.ts +12 -0
- package/dist/interfaces/integration-registry.d.ts +12 -0
- package/dist/migrations/api/migration-api-ports.d.ts +3 -0
- package/dist/migrations/body-switch-to-registry.d.ts +102 -0
- package/dist/{runtime-capabilities-azf1ve5b.js → runtime-capabilities-D9KsXMv7.js} +726 -24
- package/dist/{runtime-capabilities-B36VcCR6.mjs → runtime-capabilities-ql3VRzQu.mjs} +605 -23
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.602] - 2026-11-19
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- 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
|
|
15
|
+
|
|
16
|
+
## [1.2.601] - 2026-11-19
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- An automation run trace records a run-level error, and a hold's pending row is folded into the run it became.
|
|
21
|
+
|
|
10
22
|
## [1.2.600] - 2026-11-19
|
|
11
23
|
|
|
12
24
|
### 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
|
-
|
|
21
|
-
export type InstanceBody = Record<string, unknown> & {
|
|
22
|
-
readonly enabled?: boolean | undefined;
|
|
23
|
-
};
|
|
20
|
+
import { type UnrowedInstance } from './instance-switches.js';
|
|
24
21
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
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
|
|
147
|
-
*
|
|
148
|
-
*
|
|
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-
|
|
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
|
|
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 };
|
|
@@ -25,7 +25,7 @@ export { triggerLeafVariables, triggerVariablesOf } from './trigger-variables.js
|
|
|
25
25
|
export type { CooldownInput, CooldownVerdict, RunGateAdmission } from './run-gate.js';
|
|
26
26
|
export { RunGate } from './run-gate.js';
|
|
27
27
|
export type { AutomationConditionTraceNode, AutomationRunOutcome, AutomationRunTrace, AutomationRunVerdict, AutomationStateDoc, AutomationStepTrace, NestedStepTrace, AutomationTriggerTrace, StepDeviceTrace, TraceNodeOutcome, TraceValue, } from './trace.js';
|
|
28
|
-
export { AutomationConditionTraceNodeSchema, EMPTY_AUTOMATION_STATE, mergeSkipTraces, AutomationRunOutcomeSchema, AutomationRunTraceSchema, AutomationRunVerdictSchema, AutomationStateDocSchema, AutomationStepTraceSchema, AutomationTriggerTraceSchema, appendTrace, buildStepArgsTrace, buildTriggerTrace, isSkippedTrace, MAX_TRACE_ARG_LENGTH, MAX_STEP_DEVICE_OUTCOMES, MAX_TRACE_ARGS, REDACTED_ARG, skipSignature, StepDeviceTraceSchema, TraceNodeOutcomeSchema, TraceValueSchema, } from './trace.js';
|
|
28
|
+
export { AutomationConditionTraceNodeSchema, EMPTY_AUTOMATION_STATE, mergeSkipTraces, AutomationRunOutcomeSchema, AutomationRunTraceSchema, AutomationRunVerdictSchema, AutomationStateDocSchema, AutomationStepTraceSchema, AutomationTriggerTraceSchema, appendTrace, foldHoldEpisodes, buildStepArgsTrace, buildTriggerTrace, isSkippedTrace, MAX_TRACE_ARG_LENGTH, MAX_STEP_DEVICE_OUTCOMES, MAX_TRACE_ARGS, REDACTED_ARG, skipSignature, StepDeviceTraceSchema, TraceNodeOutcomeSchema, TraceValueSchema, } from './trace.js';
|
|
29
29
|
export type { ActionStep, AutomationAction, AutomationCommandStep, AutomationRecipe, AutomationRunMode, LegacyAutomationRecipe, AutomationBodyStep, AutomationBranchStep, AutomationRecipeInput, AutomationChooseStep, AutomationWaitUntilStep, AutomationParallelStep, AutomationRepeatLoop, AutomationRepeatStep, AutomationSetStep, StepConditionRef, AutomationStopStep, } from './recipe.js';
|
|
30
30
|
export { ActionStepSchema, AutomationActionSchema, AutomationCommandStepBaseSchema, AutomationCommandStepSchema, AutomationWaitStepSchema, AutomationChooseStepSchema, AutomationWaitUntilStepSchema, AutomationParallelStepSchema, AutomationRepeatLoopSchema, AutomationRepeatStepSchema, AutomationSetStepSchema, CHOOSE_BRANCHES_MAX, WAIT_UNTIL_TIMEOUT_MAX_S, PARALLEL_STEPS_MAX, REPEAT_COUNT_MAX, REPEAT_DEVICES_MAX, REPEAT_ITEM_VAR, REPEAT_ITERATIONS_MAX, REPEAT_STEPS_MAX, STEP_NEST_MAX, PARALLEL_STEPS_MIN, nestedStepsOf, stepConditionsOf, AutomationStopStepSchema, RESERVED_RUN_VARS, SET_VAR_NAME_RE, SET_VAR_VALUE_MAX, SET_VARS_MAX, STOP_REASON_MAX, stepGuardOf, WAIT_MAX_SECONDS, AutomationRecipeSchema, AutomationRunModeSchema, CurrentAutomationRecipeSchema, convertLegacyRecipe, DEFAULT_TRACE_KEEP, LegacyAutomationRecipeSchema, MAX_TRACE_KEEP, MAX_CONDITION_DEPTH, MAX_CONDITION_LEAVES, validateRecipeBounds, } from './recipe.js';
|
|
31
31
|
export type { AutomationAll, AutomationAny, AutomationConditionOperator, AutomationEventLeaf, AutomationLeaf, AutomationNot, AutomationStateLeaf, AutomationWhen, DetectionLeaf, DeviceBecomesLeaf, DeviceFiredLeaf, DeviceFiredMatch, DeviceIsLeaf, ExpressionLeaf, TimeIsLeaf, TriggeredByLeaf, IdentifiedEventLeaf, StationaryLeaf, StationaryPresentLeaf, } from './when.js';
|
|
@@ -661,6 +661,7 @@ declare const runTraceObject: z.ZodObject<{
|
|
|
661
661
|
overridden: "overridden";
|
|
662
662
|
"suspended-manual": "suspended-manual";
|
|
663
663
|
}>>;
|
|
664
|
+
error: z.ZodOptional<z.ZodString>;
|
|
664
665
|
}, z.core.$strip>;
|
|
665
666
|
/**
|
|
666
667
|
* Declared as an interface so it is printed by NAME: a capability that embeds
|
|
@@ -693,6 +694,15 @@ export declare function skipSignature(trace: AutomationRunTrace): string;
|
|
|
693
694
|
* {@link appendTrace}.
|
|
694
695
|
*/
|
|
695
696
|
export declare function mergeSkipTraces(prev: AutomationRunTrace, next: AutomationRunTrace): AutomationRunTrace | null;
|
|
697
|
+
/**
|
|
698
|
+
* One hold episode is ONE run. A `for` trigger first writes a skipped
|
|
699
|
+
* "hold pending" row when the value changes, and a run row when the hold is
|
|
700
|
+
* met; both carry the same leaf path and the same hold start (`since`), so the
|
|
701
|
+
* pending row is the run's own beginning and is dropped once the run exists.
|
|
702
|
+
* Pure, so the ledger (on append) and the list (for traces written before this
|
|
703
|
+
* rule) apply the same fold.
|
|
704
|
+
*/
|
|
705
|
+
export declare function foldHoldEpisodes(traces: readonly AutomationRunTrace[]): AutomationRunTrace[];
|
|
696
706
|
/**
|
|
697
707
|
* Append a trace to a ring of at most `keep` entries, without mutating it.
|
|
698
708
|
*
|
|
@@ -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)
|
|
@@ -4719,6 +4719,20 @@ export type AppRouter = TrpcCoreRouter<{
|
|
|
4719
4719
|
output: z.infer<typeof integrationsCapability.methods.getByAddonId.output>;
|
|
4720
4720
|
meta: object;
|
|
4721
4721
|
}>;
|
|
4722
|
+
listByAddon: TRPCQueryProcedure<{
|
|
4723
|
+
input: {
|
|
4724
|
+
[x: string]: unknown;
|
|
4725
|
+
} & z.input<typeof integrationsCapability.methods.listByAddon.input>;
|
|
4726
|
+
output: z.infer<typeof integrationsCapability.methods.listByAddon.output>;
|
|
4727
|
+
meta: object;
|
|
4728
|
+
}>;
|
|
4729
|
+
adoptInstanceRows: TRPCMutationProcedure<{
|
|
4730
|
+
input: {
|
|
4731
|
+
[x: string]: unknown;
|
|
4732
|
+
} & z.input<typeof integrationsCapability.methods.adoptInstanceRows.input>;
|
|
4733
|
+
output: z.infer<typeof integrationsCapability.methods.adoptInstanceRows.output>;
|
|
4734
|
+
meta: object;
|
|
4735
|
+
}>;
|
|
4722
4736
|
update: TRPCMutationProcedure<{
|
|
4723
4737
|
input: {
|
|
4724
4738
|
[x: string]: unknown;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* scope+access check inside `protectedProcedure` (see
|
|
7
7
|
* `server/backend/src/api/trpc/trpc.middleware.ts`).
|
|
8
8
|
*
|
|
9
|
-
* Coverage:
|
|
9
|
+
* Coverage: 1536 method paths across 214 capabilities.
|
|
10
10
|
*/
|
|
11
11
|
import type { MethodRole } from '../auth/viewer-access.js';
|
|
12
12
|
import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
|
|
@@ -102,7 +102,7 @@ export interface SystemProxy {
|
|
|
102
102
|
readonly fanPresets: Pick<InferProvider<typeof fanPresetsCapability>, 'getPresets' | 'setPresets' | 'applyPreset' | 'capturePreset'>;
|
|
103
103
|
readonly heroLayout: Pick<InferProvider<typeof heroLayoutCapability>, 'getHeroModel' | 'getRowModels' | 'getLayout'>;
|
|
104
104
|
readonly integrationInstances: Pick<InferProvider<typeof integrationInstancesCapability>, 'describe' | 'instanceFormSchema' | 'listInstances' | 'getInstance' | 'createInstance' | 'updateInstance' | 'setInstanceEnabled' | 'deleteInstance' | 'testInstance'>;
|
|
105
|
-
readonly integrations: Pick<InferProvider<typeof integrationsCapability>, 'list' | 'get' | 'getByAddonId' | 'update' | 'delete' | 'getAvailableTypes'>;
|
|
105
|
+
readonly integrations: Pick<InferProvider<typeof integrationsCapability>, 'list' | 'get' | 'getByAddonId' | 'listByAddon' | 'adoptInstanceRows' | 'update' | 'delete' | 'getAvailableTypes'>;
|
|
106
106
|
readonly keychainAdmin: Pick<InferProvider<typeof keychainAdminCapability>, 'status' | 'listSecrets' | 'listAudit' | 'reveal' | 'setSystemSecret' | 'importSecret' | 'deleteOrphans' | 'rotateMasterKey' | 'purgeRetiredKeys' | 'downloadRecoveryKey' | 'resetKeychain' | 'resetReport' | 'acknowledgeReset'>;
|
|
107
107
|
readonly llm: Pick<InferProvider<typeof llmCapability>, 'generate' | 'generateVision' | 'cancel' | 'listModels' | 'getDefaults' | 'setDefault' | 'getUsage' | 'listModelCatalog' | 'listRuntimeNodes' | 'listNodeModels' | 'resolveModelRef' | 'installModel' | 'deleteModel' | 'getRuntimeStatus' | 'startRuntime' | 'stopRuntime'>;
|
|
108
108
|
readonly localNetwork: Pick<InferProvider<typeof localNetworkCapability>, 'list' | 'getPreferred' | 'getConnectionEndpoints' | 'getNotificationEndpoint' | 'setNotificationEndpoint' | 'getViewerEndpoints' | 'setViewerEndpoints' | 'getAddresses' | 'addCustomAddress' | 'removeCustomAddress' | 'setAddressRole' | 'getHubAddresses' | 'getAllowedAddresses' | 'setAllowedAddresses' | 'resetAllowlistToBestMatch' | 'getTlsStatus' | 'regenerateCertificate' | 'uploadCertificate' | 'downloadCa' | 'useStoredUploadedCertificate' | 'scanNetwork' | 'getScanSubnets' | 'setScanSubnets' | 'revertToGeneratedCertificate'>;
|
package/dist/index.d.ts
CHANGED
|
@@ -20,9 +20,11 @@ export { buildSessionLostAlert, DEFAULT_SESSION_LOST_DEBOUNCE_MS, IntegrationSes
|
|
|
20
20
|
export type { InstanceChange, RecordIntegrationInstancesHooks, ResolvedInstance, ResolvedSecretsState, } from './addon/record-integration-instances.js';
|
|
21
21
|
export { CONNECTION_TEST_TIMEOUT_MS } from './addon/connection-probe.js';
|
|
22
22
|
export type { ConnectionTestOutcome, IConnectionProbe } from './addon/connection-probe.js';
|
|
23
|
-
export { RecordIntegrationInstances, defaultAddDeviceMode,
|
|
23
|
+
export { RecordIntegrationInstances, defaultAddDeviceMode, } from './addon/record-integration-instances.js';
|
|
24
|
+
export { beginHydration, claimInstance, isHydrationPending, pendingHydrationOwners, clearInstanceSwitches, forgetInstanceSwitch, hydrateInstanceSwitches, isInstanceOn, recordInstanceSwitch, recordRegistrySwitch, settleHydration, } from './addon/instance-switches.js';
|
|
24
25
|
export { composeInstanceKinds, UnknownInstanceError, UnknownInstanceKindError, } from './addon/compose-instance-kinds.js';
|
|
25
26
|
export type { InstanceKindPart } from './addon/compose-instance-kinds.js';
|
|
27
|
+
export { InstanceSwitchesUnreadError, isInstanceSwitchesUnreadError, } from './addon/instance-switches-unread-error.js';
|
|
26
28
|
export * from './addon/notification-targets.js';
|
|
27
29
|
export * from './addon/instances-of-cap.js';
|
|
28
30
|
export type { DurableState, DurableStateDeps } from './addon/durable-state.js';
|
|
@@ -81,6 +83,7 @@ export * from './migrations/integration-rows-api-ports.js';
|
|
|
81
83
|
export * from './migrations/claim-devices-to-default-integration.js';
|
|
82
84
|
export * from './migrations/default-integration-migrations.js';
|
|
83
85
|
export * from './migrations/registry-switch-to-body.js';
|
|
86
|
+
export * from './migrations/body-switch-to-registry.js';
|
|
84
87
|
export * from './training/index.js';
|
|
85
88
|
export * from './retrain-review.js';
|
|
86
89
|
export { mergeSecretStatePaths, parseSecretStatePath, type SecretNode, type SecretTree, secretTreeFromPaths, secretTreeFromSchema, } from './addon/secret-paths.js';
|
|
@@ -104,6 +107,7 @@ export type * from './interfaces/frame-handle.js';
|
|
|
104
107
|
export type * from './interfaces/inference-capabilities.js';
|
|
105
108
|
export type * from './interfaces/inference-engine.js';
|
|
106
109
|
export type { CreateIntegrationInput, IIntegrationRegistry, Integration, } from './interfaces/integration-registry.js';
|
|
110
|
+
export { SERVICE_INSTANCE_INFO_KEY } from './interfaces/integration-registry.js';
|
|
107
111
|
export type * from './interfaces/kernel-abstractions.js';
|
|
108
112
|
export type * from './interfaces/lifecycle.js';
|
|
109
113
|
export type * from './interfaces/logging.js';
|
|
@@ -197,7 +201,7 @@ export { SSO_STATE_COOKIE, SSO_STATE_COOKIE_MAX_AGE_SEC } from './auth/sso-state
|
|
|
197
201
|
export { buildDeviceEnrollmentLink, buildDeviceSignatureMessage, type CompleteEnrollmentInput, CompleteEnrollmentInputSchema, type CompleteEnrollmentOutput, CompleteEnrollmentOutputSchema, DEVICE_CERT_RENEW_WINDOW_DAYS, DEVICE_CERT_SIGNATURE, DEVICE_CERT_VALIDITY_DAYS, DEVICE_ENROLLMENT_TTL_MS, DEVICE_NONCE_TTL_MS, DEVICE_SAN_CREDENTIAL_PREFIX, DEVICE_SAN_USER_PREFIX, DEVICE_SIGNATURE_MESSAGE_VERSION, type DeviceCertificateLoginMethod, DeviceCertificateLoginMethodSchema, type DeviceChallenge, DeviceChallengeSchema, type DeviceCredential, DeviceCredentialSchema, type DeviceCredentialStatus, DeviceCredentialStatusSchema, type DevicePlatform, DevicePlatformSchema, type DeviceProofInput, DeviceProofInputSchema, type CompleteEnrollmentResult, CompleteEnrollmentResultSchema, DEFINITIVE_DEVICE_REFUSALS, DEVICE_DEFINITIVE_REFUSALS_BEFORE_DELETE, DEVICE_REFRESH_REFUSAL_PREFIX, deviceRefusalFromMessage, type DeviceChallengeResult, DeviceChallengeResultSchema, DeviceEnrollProofSchema, type DeviceRefusal, type DeviceRefusalReason, DeviceRefusalReasonSchema, DeviceRefusalSchema, type DeviceRevoker, type EnrollSelfInput, EnrollSelfInputSchema, formatDeviceRevoker, isDefinitiveDeviceRefusal, type RenewDeviceCertificateResult, RenewDeviceCertificateResultSchema, type RevokeOwnDeviceCertificateResult, RevokeOwnDeviceCertificateResultSchema, type DeviceSignaturePurpose, DeviceSignaturePurposeSchema, type RenewDeviceCertificateOutput, RenewDeviceCertificateOutputSchema, type StartEnrollmentOutput, StartEnrollmentOutputSchema, parseDeviceEnrollmentLink, } from './auth/device-certificate.js';
|
|
198
202
|
export { advertisedHubOrigins, claimedRequestOrigins, normalizeOrigin, pickRequestOrigin, type RequestHeaders, requestMountPrefix, } from './auth/request-origin.js';
|
|
199
203
|
export type { ActionStep, AutomationAction, AutomationAll, AutomationAny, AutomationCommandStep, AutomationConditionOperator, AutomationConditionTraceNode, AutomationEventLeaf, AutomationLeaf, AutomationNot, AutomationStateLeaf, AutomationWhen, DetectionLabelSource, DetectionLeaf, DetectionSubject, DeviceBecomesLeaf, BecomesDeps, BecomesEffect, BecomesOperator, BecomesSpec, DeviceIsLeaf, ExpressionLeaf, TimeIsLeaf, TriggeredByLeaf, DeviceFiredLeaf, DeviceFiredMatch, IdentifiedEventLeaf, WhenSiteIssue, HoldMode, HoldReading, HoldSpec, HoldTrace, IdentityLabel, LegacyAutomationRecipe, AutomationBodyStep, AutomationBranchStep, AutomationRecipeInput, AutomationChooseStep, AutomationWaitUntilStep, AutomationParallelStep, AutomationRepeatLoop, AutomationRepeatStep, AutomationSetStep, StepConditionRef, AutomationStopStep, StepDeviceTrace, LegacyCondition, LegacyTrigger, PlateLabel, StationaryLeaf, StationaryPresentLeaf, SubClassLabel, SubjectObservation, SubjectVerdict, AutomationRecipe, AutomationRunMode, AutomationRunOutcome, AutomationRunTrace, AutomationRunVerdict, AutomationStateDoc, AutomationStepTrace, NestedStepTrace, AutomationTriggerTrace, ConditionEvaluation, ConditionReader, DetectionDecision, DetectionTrigger, DetectionVars, GenerateAutomationBlockInput, MirrorRefreshFetchers, RunTrigger, MirrorRefreshReport, MirrorSource, StationaryChangedInput, StationaryDecision, StationaryTrigger, StationaryVars, DeviceFiredDecision, DeviceFiredVars, FiredDataScalar, FiredDataVars, TraceNodeOutcome, TraceValue, TrackLifecycleInput, TriggerVariable, } from './automation/index.js';
|
|
200
|
-
export { ActionStepSchema, AutomationActionSchema, AutomationCommandStepBaseSchema, AutomationCommandStepSchema, AutomationWaitStepSchema, AutomationChooseStepSchema, AutomationWaitUntilStepSchema, AutomationParallelStepSchema, AutomationRepeatLoopSchema, AutomationRepeatStepSchema, AutomationSetStepSchema, CHOOSE_BRANCHES_MAX, WAIT_UNTIL_TIMEOUT_MAX_S, PARALLEL_STEPS_MAX, REPEAT_COUNT_MAX, REPEAT_DEVICES_MAX, REPEAT_ITEM_VAR, REPEAT_ITERATIONS_MAX, REPEAT_STEPS_MAX, STEP_NEST_MAX, PARALLEL_STEPS_MIN, nestedStepsOf, stepConditionsOf, AutomationStopStepSchema, RESERVED_RUN_VARS, SET_VAR_NAME_RE, SET_VAR_VALUE_MAX, SET_VARS_MAX, STOP_REASON_MAX, stepGuardOf, WAIT_MAX_SECONDS, EMPTY_AUTOMATION_STATE, mergeSkipTraces, AutomationConditionOperatorSchema, AutomationConditionTraceNodeSchema, AutomationRecipeSchema, AutomationWhenSchema, CurrentAutomationRecipeSchema, DETECTION_LABEL_SOURCES, DetectionSubjectSchema, LegacyAutomationRecipeSchema, LegacyConditionSchema, LegacyTriggerSchema, MAX_TRACE_ARG_LENGTH, MAX_STEP_DEVICE_OUTCOMES, MAX_TRACE_ARGS, MAX_WHEN_DEPTH, StepDeviceTraceSchema, MAX_WHEN_LEAVES, REDACTED_ARG, StationarySubjectSchema, anySubjectMatches, buildStepArgsTrace, collectWhenMirrorSources, convertLegacyCondition, convertLegacyRecipe, convertLegacyWhen, countWhenLeaves, describeSubject, evaluateWhenTree, eventLeafIdAt, identifiedEventLeaves, hasTriggeredByLeaves, triggeredByIssue, EVENT_LEAF_ID_RE, TRIGGERED_BY_MAX_IDS, recipeSiteIssues, stepGuardSiteIssues, whenSiteIssues, forEachLeaf, BecomesOperatorSchema, BecomesWatch, HoldCore, HoldSpecSchema, HoldTraceSchema, HoldTracker, describeHold, describeHoldMs, hasEventLeaves, hasHoldLeaves, hasTimeLeaves, nextTimeBoundaryInMs, holdOf, observeHoldLeaves, isEventLeaf, isLeaf, subClassesOf, subjectFromClassName, subjectMatches, validateWhenTree, whenDepth, AutomationRunModeSchema, AutomationRunOutcomeSchema, AutomationRunTraceSchema, AutomationRunVerdictSchema, AutomationStateDocSchema, AutomationStepTraceSchema, AutomationTriggerTraceSchema, appendTrace, buildTriggerTrace, collectMirrorSources, ConditionMirror, stableIdKey, stableIdMapOf, DEFAULT_TRACE_KEEP, DetectionTriggerFilter, detectionClassMatches, evaluateConditionTree, evaluateStationaryTrigger, DeviceFiredWatch, FIRED_RECOVERED_NOTE, firedDataVars, DeviceFiredMatchSchema, generateAutomationBlock, isSkippedTrace, MAX_CONDITION_DEPTH, MAX_CONDITION_LEAVES, MAX_TRACE_KEEP, RunGate, skipSignature, TraceNodeOutcomeSchema, TraceValueSchema, triggerLeafVariables, triggerVariablesOf, validateRecipeBounds, } from './automation/index.js';
|
|
204
|
+
export { ActionStepSchema, AutomationActionSchema, AutomationCommandStepBaseSchema, AutomationCommandStepSchema, AutomationWaitStepSchema, AutomationChooseStepSchema, AutomationWaitUntilStepSchema, AutomationParallelStepSchema, AutomationRepeatLoopSchema, AutomationRepeatStepSchema, AutomationSetStepSchema, CHOOSE_BRANCHES_MAX, WAIT_UNTIL_TIMEOUT_MAX_S, PARALLEL_STEPS_MAX, REPEAT_COUNT_MAX, REPEAT_DEVICES_MAX, REPEAT_ITEM_VAR, REPEAT_ITERATIONS_MAX, REPEAT_STEPS_MAX, STEP_NEST_MAX, PARALLEL_STEPS_MIN, nestedStepsOf, stepConditionsOf, AutomationStopStepSchema, RESERVED_RUN_VARS, SET_VAR_NAME_RE, SET_VAR_VALUE_MAX, SET_VARS_MAX, STOP_REASON_MAX, stepGuardOf, WAIT_MAX_SECONDS, EMPTY_AUTOMATION_STATE, mergeSkipTraces, AutomationConditionOperatorSchema, AutomationConditionTraceNodeSchema, AutomationRecipeSchema, AutomationWhenSchema, CurrentAutomationRecipeSchema, DETECTION_LABEL_SOURCES, DetectionSubjectSchema, LegacyAutomationRecipeSchema, LegacyConditionSchema, LegacyTriggerSchema, MAX_TRACE_ARG_LENGTH, MAX_STEP_DEVICE_OUTCOMES, MAX_TRACE_ARGS, MAX_WHEN_DEPTH, StepDeviceTraceSchema, MAX_WHEN_LEAVES, REDACTED_ARG, StationarySubjectSchema, anySubjectMatches, buildStepArgsTrace, collectWhenMirrorSources, convertLegacyCondition, convertLegacyRecipe, convertLegacyWhen, countWhenLeaves, describeSubject, evaluateWhenTree, eventLeafIdAt, identifiedEventLeaves, hasTriggeredByLeaves, triggeredByIssue, EVENT_LEAF_ID_RE, TRIGGERED_BY_MAX_IDS, recipeSiteIssues, stepGuardSiteIssues, whenSiteIssues, forEachLeaf, BecomesOperatorSchema, BecomesWatch, HoldCore, HoldSpecSchema, HoldTraceSchema, HoldTracker, describeHold, describeHoldMs, hasEventLeaves, hasHoldLeaves, hasTimeLeaves, nextTimeBoundaryInMs, holdOf, observeHoldLeaves, isEventLeaf, isLeaf, subClassesOf, subjectFromClassName, subjectMatches, validateWhenTree, whenDepth, AutomationRunModeSchema, AutomationRunOutcomeSchema, AutomationRunTraceSchema, AutomationRunVerdictSchema, AutomationStateDocSchema, AutomationStepTraceSchema, AutomationTriggerTraceSchema, appendTrace, foldHoldEpisodes, buildTriggerTrace, collectMirrorSources, ConditionMirror, stableIdKey, stableIdMapOf, DEFAULT_TRACE_KEEP, DetectionTriggerFilter, detectionClassMatches, evaluateConditionTree, evaluateStationaryTrigger, DeviceFiredWatch, FIRED_RECOVERED_NOTE, firedDataVars, DeviceFiredMatchSchema, generateAutomationBlock, isSkippedTrace, MAX_CONDITION_DEPTH, MAX_CONDITION_LEAVES, MAX_TRACE_KEEP, RunGate, skipSignature, TraceNodeOutcomeSchema, TraceValueSchema, triggerLeafVariables, triggerVariablesOf, validateRecipeBounds, } from './automation/index.js';
|
|
201
205
|
export { UnitWarningSchema, assertStepsOffered, type BoundCapsReader, capUnitResolver, normalizeActionUnits, normalizeConditionUnits, normalizeRecipeUnits, prepareRecipeUnits, } from './automation/index.js';
|
|
202
206
|
export type { PreparedRecipe, UnitResolver, UnitWarning, UnitsNormalized, } from './automation/index.js';
|
|
203
207
|
export * from './automation/action.js';
|