@camstack/types 1.2.388 → 1.2.390

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.
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Coral Edge TPU units — the ONE place a probed {@link CoralInfo} becomes
3
+ * addressable units, and a unit's device-key suffix becomes the device string
4
+ * the libedgetpu delegate is opened with. Pure: no I/O.
5
+ *
6
+ * Key suffix (what `edgetpu:<suffix>` carries, and what the pool's `device`
7
+ * holds until the delegate opens): `usb`, `usb:1`, …, `pci`, `pci:1`, …
8
+ * The first unit of a bus keeps the bare bus name, so a node's first USB Coral
9
+ * keeps the `edgetpu:usb` key every stored setting already uses.
10
+ *
11
+ * Delegate device string (libedgetpu's `device` option): ALWAYS an explicit
12
+ * ordinal, `usb:0` / `usb:1` / `pci:0` / `pci:1`. A bare or omitted device
13
+ * means "the first Edge TPU of any bus" to libedgetpu, which on a node with
14
+ * both buses would let two pools open the same unit.
15
+ */
16
+ import type { CoralBus, CoralInfo } from '../interfaces/platform.js';
17
+ /** One usable Coral unit: its bus, its ordinal on that bus, its key suffix. */
18
+ export interface CoralUnitAddress {
19
+ readonly bus: CoralBus;
20
+ readonly index: number;
21
+ /** The device-key suffix: `usb`, `usb:1`, `pci`, `pci:1`, … */
22
+ readonly device: string;
23
+ }
24
+ /** Every usable Coral unit on a node, USB first then PCIe, in ordinal order. */
25
+ export declare function coralUsableUnits(coral: CoralInfo | null | undefined): readonly CoralUnitAddress[];
26
+ /**
27
+ * Map an edgetpu key suffix (`usb`, `usb:1`, `pci`, `pci:1`) to the explicit
28
+ * libedgetpu device string (`usb:0`, `usb:1`, `pci:0`, `pci:1`). Throws on any
29
+ * other string — a pool must never open "whichever Edge TPU comes first".
30
+ */
31
+ export declare function edgetpuDelegateDevice(device: string): string;
@@ -54,7 +54,7 @@ interface ScoreRuntimesResult {
54
54
  * - coreml: score 95, darwin+arm64
55
55
  * - cuda: score 85, nvidia gpu
56
56
  * - openvino: score 90 if intel-npu present, else 80 if intel gpu
57
- * - edgetpu: score 70, coral usb present
57
+ * - edgetpu: score 70, a usable Coral unit (USB or PCIe)
58
58
  * - cpu: score 50 (universal floor, always included)
59
59
  *
60
60
  * All hardware-matched entries are `available: true`.
@@ -3,6 +3,7 @@ import type { CapabilityDefinition, InferProvider } from '../capabilities/capabi
3
3
  import type { CustomActionCaller, CustomActionsSpec } from '../capabilities/custom-actions.js';
4
4
  import type { PipelineSlot } from '../types/pipeline.js';
5
5
  import type { AddonDataPlane } from './addon-data-plane.js';
6
+ import type { CoralInfo } from './platform.js';
6
7
  import type { AddonPeerBytes } from './addon-peer-bytes.js';
7
8
  import type { SecretsAccess } from '../keychain/secrets-access.js';
8
9
  import type { RecordsAccess } from '../records/records-access.js';
@@ -383,10 +384,8 @@ export interface KernelInferenceHardware {
383
384
  readonly npu: {
384
385
  readonly type: string;
385
386
  } | null;
386
- /** Coral USB Edge TPU, when present (gates the `edgetpu` runtime). */
387
- readonly coral?: {
388
- readonly type: string;
389
- } | null;
387
+ /** Coral Edge TPU hardware (USB and/or PCIe), when found — whole, units included. */
388
+ readonly coral?: CoralInfo | null;
390
389
  }
391
390
  export interface IKernelInferenceEngine {
392
391
  /**
@@ -10,9 +10,10 @@ export interface HardwareInfo {
10
10
  readonly gpu: GpuInfo | null;
11
11
  readonly npu: NpuInfo | null;
12
12
  /**
13
- * Coral USB Edge TPU, when present. Optional so existing HardwareInfo
14
- * construction sites and older cross-node probe reports stay valid; absent /
15
- * null ⇒ no Coral ⇒ the `edgetpu` runtime is withheld.
13
+ * Coral Edge TPU hardware (USB and/or PCIe), when found. Optional so existing
14
+ * HardwareInfo construction sites and older cross-node probe reports stay
15
+ * valid; absent / null ⇒ no Coral. Non-null with no usable unit (driver
16
+ * missing, device not accessible) ⇒ the `edgetpu` runtime is withheld too.
16
17
  */
17
18
  readonly coral?: CoralInfo | null;
18
19
  }
@@ -31,24 +32,61 @@ export interface NpuInfo {
31
32
  */
32
33
  readonly generation?: 'xdna1' | 'xdna2';
33
34
  }
35
+ /** The bus a Coral Edge TPU sits on — libedgetpu's own device-family names. */
36
+ export type CoralBus = 'usb' | 'pci';
37
+ /** Usable Coral units on one bus: enumerated, and their device node opens. */
38
+ export interface CoralBusUnits {
39
+ readonly bus: CoralBus;
40
+ readonly count: number;
41
+ }
42
+ /**
43
+ * Why a Coral that IS physically present cannot run (D393/D315: present but
44
+ * unusable is never reported as absent).
45
+ * - `driver-missing`: the PCI function (`1ac1:089a`) is enumerated but no
46
+ * `/sys/class/apex/apex_N` exists — the gasket/apex kernel driver is not
47
+ * loaded on the host.
48
+ * - `device-not-accessible`: the driver is loaded but `/dev/apex_N` is absent
49
+ * from this process's view (not passed into the container) or cannot be
50
+ * opened read/write (permissions).
51
+ */
52
+ export type CoralUnavailableReason = 'driver-missing' | 'device-not-accessible';
53
+ /** Present-but-unusable Coral units on one bus, with the typed reason. */
54
+ export interface CoralUnavailableUnits {
55
+ readonly bus: CoralBus;
56
+ readonly count: number;
57
+ readonly reason: CoralUnavailableReason;
58
+ }
34
59
  /**
35
- * Coral USB Edge TPU (Google Coral). A discrete USB inference accelerator that
36
- * coexists with the host GPU/NPU (e.g. the Unraid hub carries both an Intel NPU
37
- * and a Coral). Tracked separately from {@link NpuInfo} so its presence gates
38
- * the `edgetpu` inference runtime without colliding with the Intel-NPU signal.
60
+ * Coral Edge TPU (Google Coral), USB and/or PCIe/M.2. A discrete inference
61
+ * accelerator that coexists with the host GPU/NPU (e.g. the Unraid hub carries
62
+ * both an Intel NPU and a USB Coral). Tracked separately from {@link NpuInfo} so
63
+ * its presence gates the `edgetpu` inference runtime without colliding with the
64
+ * Intel-NPU signal.
65
+ *
66
+ * Non-null ⇒ Coral hardware was FOUND — usable or not. Only `units` (read
67
+ * through `coralUsableUnits`) gates the runtime and the device keys; a unit in
68
+ * `unavailable` is reported, never enumerated.
39
69
  */
40
70
  export interface CoralInfo {
41
71
  readonly type: 'coral-edgetpu';
42
- /** Bus location hint (e.g. `usb`), informational. */
72
+ /**
73
+ * @deprecated Legacy single-bus report (older nodes). Read only through
74
+ * `coralUsableUnits`, which falls back to it when `units` is absent.
75
+ */
43
76
  readonly bus?: string;
44
77
  /**
45
- * Number of physically attached Coral Edge TPUs. Multiple Corals coexist on
46
- * one host and run CONCURRENTLY, one inference pool each — the enumerator emits
47
- * one device descriptor per unit (`edgetpu:usb`, `edgetpu:usb:1`, …). Omitted /
48
- * undefined ⇒ treat as a single Coral (the probe couldn't count them, e.g. a
49
- * container with a limited `/sys` USB view — the delegate-presence fallback).
78
+ * @deprecated Legacy USB unit count (older nodes); undefined ⇒ one Coral.
79
+ * Read only through `coralUsableUnits`.
50
80
  */
51
81
  readonly count?: number;
82
+ /**
83
+ * Usable units per bus. Each unit is its own concurrent pool — the enumerator
84
+ * emits one device descriptor per unit (`edgetpu:usb`, `edgetpu:usb:1`,
85
+ * `edgetpu:pci`, `edgetpu:pci:1`, …). Absent ⇒ a legacy report (see `bus`).
86
+ */
87
+ readonly units?: readonly CoralBusUnits[];
88
+ /** Units that are present but cannot run, each with its typed reason. */
89
+ readonly unavailable?: readonly CoralUnavailableUnits[];
52
90
  }
53
91
  /** A probed backend with availability and score */
54
92
  export interface PlatformScore {
@@ -18,7 +18,6 @@ export interface EntryKindSpec<S extends z.ZodType> {
18
18
  readonly database?: 'settings' | 'events';
19
19
  readonly indexes?: readonly RecordIndex[];
20
20
  readonly secretArrayKeys?: Readonly<Record<string, string>>;
21
- readonly adoptsFrom?: string;
22
21
  }
23
22
  /** The body of a plain entry: a name and the fields the kind adds. */
24
23
  export declare function entryBody<Shape extends z.ZodRawShape>(shape: Shape): z.ZodObject<{
@@ -8,7 +8,7 @@
8
8
  * A failed read is never `[]` or `undefined`: it throws one of these.
9
9
  */
10
10
  /** Every code a records failure carries. */
11
- export declare const RECORDS_ERROR_CODES: readonly ['rev-conflict', 'too-large', 'unindexed-filter', 'filter-required', 'unknown-kind', 'not-found', 'unique-violation', 'plaintext-secret', 'foreign-marker', 'secret-unavailable', 'invalid-record', 'declaration-refused', 'adoption-pending', 'no-caller', 'batch-too-large'];
11
+ export declare const RECORDS_ERROR_CODES: readonly ['rev-conflict', 'too-large', 'unindexed-filter', 'filter-required', 'unknown-kind', 'not-found', 'unique-violation', 'plaintext-secret', 'foreign-marker', 'secret-unavailable', 'invalid-record', 'declaration-refused', 'no-caller', 'batch-too-large'];
12
12
  export type RecordsErrorCode = (typeof RECORDS_ERROR_CODES)[number];
13
13
  /** The base of every records failure. `detail` is the human part of the message. */
14
14
  export declare class RecordsError extends Error {
@@ -62,10 +62,6 @@ export declare class InvalidRecordError extends RecordsError {
62
62
  export declare class DeclarationRefusedError extends RecordsError {
63
63
  constructor(detail: string);
64
64
  }
65
- /** A kind is empty while the legacy table it adopts from still holds rows. */
66
- export declare class AdoptionPendingError extends RecordsError {
67
- constructor(detail: string);
68
- }
69
65
  export declare class NoCallerError extends RecordsError {
70
66
  constructor(detail: string);
71
67
  }
@@ -4,6 +4,4 @@ export * from './record-kind.js';
4
4
  export * from './secret-paths.js';
5
5
  export * from './records-access.js';
6
6
  export * from './entry-kind.js';
7
- export * from './settings-brokers-adopts-from.js';
8
- export * from './settings-array-adopts-from.js';
9
7
  export { makeInMemoryRecords, type InMemoryRecords } from './in-memory-records.js';
@@ -118,7 +118,6 @@ export interface RecordKindSpec<S extends z.ZodType = z.ZodType> {
118
118
  readonly deviceRemoval?: 'delete' | 'none';
119
119
  readonly maxDataBytes?: number;
120
120
  readonly secretArrayKeys?: Readonly<Record<string, string>>;
121
- readonly adoptsFrom?: string;
122
121
  readonly transactFamily?: string;
123
122
  /** Makes this an ENTRY kind: it gets the generic list/add/edit/delete UI. */
124
123
  readonly entry?: {
@@ -27,7 +27,6 @@ import type { z } from 'zod';
27
27
  import type { DeclareKindResult, IRecordsProvider, RecordQueryInput, RecordWhere } from '../capabilities/records.cap.js';
28
28
  import type { SecretsAccess } from '../keychain/secrets-access.js';
29
29
  import { type DefinedRecordKind } from './record-kind.js';
30
- import { collectSecretLeaves } from './secret-paths.js';
31
30
  /** The wire: the `records` provider's methods. The owner is never an argument. */
32
31
  export type RecordsTransport = IRecordsProvider;
33
32
  /** A row as the owner sees it. Secret fields hold the redaction token unless resolved. */
@@ -130,9 +129,7 @@ export interface RecordsAccess {
130
129
  readonly owner: string;
131
130
  /**
132
131
  * Reconcile this addon's kinds (the engine creates the indexes; additive
133
- * only). THROWS {@link AdoptionPendingError} while a kind is empty and the
134
- * legacy table it adopts from still holds rows - the boot guard (D853: no
135
- * migration code in the product).
132
+ * only; it never moves data, D853).
136
133
  */
137
134
  declare(kinds: Readonly<Record<string, DefinedRecordKind>>): Promise<Readonly<Record<string, DeclareKindResult>>>;
138
135
  kind<S extends z.ZodType>(definition: DefinedRecordKind<S>): RecordKindHandle<z.infer<S>>;
@@ -149,5 +146,3 @@ export interface RecordsAccess {
149
146
  }
150
147
  /** Build the owner's records handle. */
151
148
  export declare function createRecordsAccess(options: RecordsAccessOptions): RecordsAccess;
152
- /** Re-exported so adoption tooling builds the same concrete paths the facade does. */
153
- export { collectSecretLeaves };
@@ -3226,7 +3226,6 @@ var RECORDS_ERROR_CODES = [
3226
3226
  "secret-unavailable",
3227
3227
  "invalid-record",
3228
3228
  "declaration-refused",
3229
- "adoption-pending",
3230
3229
  "no-caller",
3231
3230
  "batch-too-large"
3232
3231
  ];
@@ -3324,13 +3323,6 @@ var DeclarationRefusedError = class extends RecordsError {
3324
3323
  this.name = "DeclarationRefusedError";
3325
3324
  }
3326
3325
  };
3327
- /** A kind is empty while the legacy table it adopts from still holds rows. */
3328
- var AdoptionPendingError = class extends RecordsError {
3329
- constructor(detail) {
3330
- super("adoption-pending", detail);
3331
- this.name = "AdoptionPendingError";
3332
- }
3333
- };
3334
3326
  var NoCallerError = class extends RecordsError {
3335
3327
  constructor(detail) {
3336
3328
  super("no-caller", detail);
@@ -3356,7 +3348,6 @@ var FACTORIES = {
3356
3348
  "secret-unavailable": (d) => new RecordSecretUnavailableError(d),
3357
3349
  "invalid-record": (d) => new InvalidRecordError(d),
3358
3350
  "declaration-refused": (d) => new DeclarationRefusedError(d),
3359
- "adoption-pending": (d) => new AdoptionPendingError(d),
3360
3351
  "no-caller": (d) => new NoCallerError(d),
3361
3352
  "batch-too-large": (d) => new BatchTooLargeError(d)
3362
3353
  };
@@ -3668,7 +3659,13 @@ var RecordKindDeclarationSchema = z.object({
3668
3659
  secretPaths: z.array(z.string().min(1)).default([]),
3669
3660
  /** The id key of each array that carries a secret (`{ headers: 'name' }`). */
3670
3661
  secretArrayKeys: z.record(z.string(), z.string()).default({}),
3671
- /** The legacy table this kind adopts from; the boot guard reads it (D853: no migration code). */
3662
+ /**
3663
+ * RETIRED (D900): the legacy table a kind adopted from during the records
3664
+ * migration. Nothing declares it any more and nothing reads it; the schema
3665
+ * still ACCEPTS it because the catalog rows the migration wrote carry it
3666
+ * (an orphaned kind is never redeclared) and an addon built before the
3667
+ * removal still sends it. Never set it.
3668
+ */
3672
3669
  adoptsFrom: z.string().min(1).optional(),
3673
3670
  /** Kinds that must agree through `transact` sit in one file under one family name. */
3674
3671
  transactFamily: z.string().min(1).optional(),
@@ -3743,7 +3740,6 @@ function defineRecordKinds(specs) {
3743
3740
  maxDataBytes: spec.maxDataBytes,
3744
3741
  secretPaths: [...secretPaths],
3745
3742
  secretArrayKeys: spec.secretArrayKeys === void 0 ? void 0 : { ...spec.secretArrayKeys },
3746
- adoptsFrom: spec.adoptsFrom,
3747
3743
  transactFamily: spec.transactFamily,
3748
3744
  entry: spec.entry === void 0 ? void 0 : {
3749
3745
  title: spec.entry.title,
@@ -4084,10 +4080,7 @@ function createRecordsAccess(options) {
4084
4080
  return delegate;
4085
4081
  },
4086
4082
  async declare(kinds) {
4087
- const result = await call(() => options.transport.declareKinds({ kinds: { ...declarationsOf(kinds) } }));
4088
- const pending = Object.entries(result.kinds).filter((entry) => entry[1].adoptionPending !== null);
4089
- if (pending.length > 0) throw new AdoptionPendingError(`${pending.map(([name, r]) => r.adoptionPending === null ? name : `${name} (legacy table "${r.adoptionPending.legacyTable}" holds ${r.adoptionPending.legacyRows} rows)`).join(", ")}. Stop the addon and run scripts/hub/records-adopt.ts --copy --apply before starting this build`);
4090
- return result.kinds;
4083
+ return (await call(() => options.transport.declareKinds({ kinds: { ...declarationsOf(kinds) } }))).kinds;
4091
4084
  },
4092
4085
  kind(definition) {
4093
4086
  const existing = handles.get(definition);
@@ -4142,7 +4135,6 @@ function defineEntryKind(name, spec) {
4142
4135
  ...spec.database === void 0 ? {} : { database: spec.database },
4143
4136
  ...spec.indexes === void 0 ? {} : { indexes: spec.indexes },
4144
4137
  ...spec.secretArrayKeys === void 0 ? {} : { secretArrayKeys: spec.secretArrayKeys },
4145
- ...spec.adoptsFrom === void 0 ? {} : { adoptsFrom: spec.adoptsFrom },
4146
4138
  entry: {
4147
4139
  title: spec.title,
4148
4140
  ...spec.nameField === void 0 ? {} : { nameField: spec.nameField }
@@ -4152,49 +4144,6 @@ function defineEntryKind(name, spec) {
4152
4144
  return defined;
4153
4145
  }
4154
4146
  //#endregion
4155
- //#region src/records/settings-brokers-adopts-from.ts
4156
- /**
4157
- * Legacy source for broker entry adoption (B2): brokers live in addon-settings
4158
- * as one row `<addonId>.brokers` whose value is an array until records-adopt
4159
- * copies them into the entry kind.
4160
- */
4161
- var SETTINGS_BROKERS_ADOPTS_PREFIX = "@settings-brokers/";
4162
- /** The `adoptsFrom` value for an addon's broker entry kind. */
4163
- function settingsBrokersAdoptsFrom(addonId) {
4164
- return `${SETTINGS_BROKERS_ADOPTS_PREFIX}${addonId}`;
4165
- }
4166
- /** When non-null, `from` names an addon-settings brokers blob, not a SQL table. */
4167
- function parseSettingsBrokersAdoptsFrom(from) {
4168
- if (!from.startsWith("@settings-brokers/")) return null;
4169
- const addonId = from.slice(18);
4170
- return addonId.length > 0 ? addonId : null;
4171
- }
4172
- //#endregion
4173
- //#region src/records/settings-array-adopts-from.ts
4174
- /**
4175
- * Legacy source for entry adoption (B3): a list stored under addon-settings
4176
- * `<addonId>.<key>` until records-adopt copies rows into the entry kind.
4177
- */
4178
- var SETTINGS_ARRAY_ADOPTS_PREFIX = "@settings-array/";
4179
- /** The `adoptsFrom` value for an addon-settings array field. */
4180
- function settingsArrayAdoptsFrom(addonId, settingsKey) {
4181
- return `${SETTINGS_ARRAY_ADOPTS_PREFIX}${addonId}/${settingsKey}`;
4182
- }
4183
- /** When non-null, `from` names an addon-settings array blob, not a SQL table. */
4184
- function parseSettingsArrayAdoptsFrom(from) {
4185
- if (!from.startsWith("@settings-array/")) return null;
4186
- const rest = from.slice(16);
4187
- const slash = rest.indexOf("/");
4188
- if (slash <= 0 || slash >= rest.length - 1) return null;
4189
- const addonId = rest.slice(0, slash);
4190
- const settingsKey = rest.slice(slash + 1);
4191
- if (addonId.length === 0 || settingsKey.length === 0) return null;
4192
- return {
4193
- addonId,
4194
- settingsKey
4195
- };
4196
- }
4197
- //#endregion
4198
4147
  //#region src/records/in-memory-records.ts
4199
4148
  /**
4200
4149
  * In-memory `RecordsAccess` for specs. Kinds are declared by the caller.
@@ -7555,4 +7504,4 @@ function sleepCancellable(ms, signal) {
7555
7504
  });
7556
7505
  }
7557
7506
  //#endregion
7558
- export { optionalMethod as $, PEER_BYTES_CHUNK_BYTES as $n, omitTransientConfig as $r, REMOVE_LEAF as $t, HF_REPO as A, RECORD_BATCH_MAX_BYTES as An, emitReadiness as Ar, makeProfileBrokerId as At, describeCustomActions as B, RECORD_SECRET_COLLECTION_PREFIX as Bn, SECRET_CLEAR as Br, settingsBrokersAdoptsFrom as Bt, addonSliceHandleApi as C, RecordsError as Cn, globalSecretScope as Cr, ProfileRtspEntrySchema as Ct, createSliceHandle as D, asRecordsError as Dn, normalizeNodeId as Dr, StreamSourceSchema as Dt, createMirrorSource as E, UnknownRecordKindError as En, parseSecretRef as Er, StreamSourceEntrySchema$1 as Et, DEVICE_CHILDREN_BATCH_MAX as F, RECORD_ID_MAX_LENGTH as Fn, collectHydratedFieldValues as Fr, SETTINGS_ARRAY_ADOPTS_PREFIX as Ft, DEVICE_STATUS_METHOD as G, createSecretsAccess as Gn, isSecretMarkerLike as Gr, RecordFieldPathSchema as Gt, adminUiCapability as H, RECORD_SWEEP_INTERVAL_MS as Hn, isSecretClear as Hr, entryBody as Ht, CALLER_STAMPED_CAPABILITIES as I, RECORD_MAX_DATA_BYTES as In, dehydrateConfigField as Ir, parseSettingsArrayAdoptsFrom as It, PROVIDER_PIN_FIELD as J, forgetKnownSecret as Jn, REDACTED_SECRET as Jr, RecordKindNameSchema as Jt, HISTORY_DEFAULT_MIN_INTERVAL_MS as K, MIN_SCRUBBED_LENGTH as Kn, makeSecretMarker as Kr, RecordIndexSchema as Kt, withoutCallerStamp as L, RECORD_MAX_INDEXES as Ln, dehydrateSchema as Lr, settingsArrayAdoptsFrom as Lt, RawStateResultSchema as M, RECORD_DATABASES as Mn, WELL_KNOWN_TABS as Mr, parseProfileBrokerId as Mt, deviceOpsCapability as N, RECORD_DEFAULT_MAX_DATA_BYTES as Nn, WELL_KNOWN_TAB_MAP as Nr, selectAssignedProfileSlots as Nt, DEFAULT_TOKEN_EXPIRY as O, recordsErrorFromMessage as On, createDurableState as Or, SubscribeAudioChunksInputSchema as Ot, viewerUiCapability as P, RECORD_DELETE_BATCH as Pn, collectHydratedFieldEntries as Pr, makeInMemoryRecords as Pt, method as Q, shortSecretRefHash as Qn, isSecretConfigField as Qr, defineRecordKinds as Qt, customAction as R, RECORD_MAX_INDEX_FIELDS as Rn, hydrateSchema as Rr, SETTINGS_BROKERS_ADOPTS_PREFIX as Rt, invokeTrpcLeaf as S, RecordUniqueViolationError as Sn, formatSecretScope as Sr, FrameHandleSchema as St, createLazyTrpcSource as T, UnindexedFilterError as Tn, normalizeSecretOwner as Tr, ProfileSlotStatusSchema as Tt, DEFAULT_RUNTIME_STATE_DURABILITY as U, resolveSecretViewsIn as Un, isSecretFieldView as Ur, createRecordsAccess as Ut, deviceCustomAction as V, RECORD_SETTINGS_MAX_ROWS as Vn, classifySecretWrite as Vr, defineEntryKind as Vt, DEVICE_SETTINGS_CONTRIBUTION_METHODS as W, REVALIDATE_AFTER_MS as Wn, isSecretMarker as Wr, EntryDescriptorSchema as Wt, expandCapMethods as X, registerKnownSecret as Xn, collectSecretConfigKeys as Xr, assertValidDeclaration as Xt, event as Y, knownSecretCount as Yn, collectKeychainStoredKeys as Yr, RecordRetentionSchema as Yt, isDeviceConfigCap as Z, scrubKnownSecrets as Zn, isKeychainStoredField as Zr, declarationsOf as Zt, readErrorI18n as _, PlaintextSecretError as _n, resolveSecretMarkers as _r, CamProfileSchema as _t, asJsonArray as a, recordSecretRef as an, SHARE_VIEW_KINDS as ar, toNodeId as at, isDeviceScopedCap as b, RecordSecretUnavailableError as bn, arrayItemFieldPath as br, CameraStreamSchema as bt, asString as c, collectZodSecretPaths as cn, classifyStoreError as cr, ReadinessTimeoutError as ct, parseJsonUnknown as d, BatchTooLargeError as dn, parseSecretStatePath as dr, scopeKey as dt, schemaDeclaresAnyField as ei, collectSecretLeaves as en, PEER_BYTES_MAX_OUTSTANDING as er, resolveCapMount as et, hfModelUrl as f, DeclarationRefusedError as fn, secretTreeFromPaths as fr, AudioChunkFormatSchema as ft, ErrorI18nPayloadSchema as g, NoCallerError as gn, isSecretRefOwnedBy as gr, CAM_PROFILE_ORDER as gt, ErrorCodeSchema as h, InvalidRecordError as hn, collectSecretMarkerRefs as hr, BrokerStatusSchema as ht, asBoolean as i, isAudioChunkFormat as ii, recordSecretCollection as in, DATAPLANE_SECRET_HEADER as ir, readNodePin as it, RUNTIME_DEFAULTS as j, RECORD_CLASSES as jn, isEvent as jr, makeSourceBrokerId as jt, HF_BASE_URL as k, RECORD_BATCH_MAX as kn, createEvent as kr, SubscribeAudioChunksResultSchema as kt, parseJsonArray as l, isZodSecret as ln, normalizeAddonInitResult as lr, emitDownForOwnedCaps as lt, CamstackError as m, ForeignSecretMarkerError as mn, KeychainWriteRefusedError as mr, BrokerStatsSchema as mt, sleepCancellable as n, audioChunkBytesPerSample as ni, parseSecretPath as nn, PEER_BYTES_TICKET_TTL_MS as nr, CAP_NODE_PIN_CONTEXT_KEY as nt, asJsonObject as o, secretArrayPrefixes as on, DisposerChain as or, MODEL_FORMATS as ot, BOOT_RECOVERY_BACKOFF_MS as p, FilterRequiredError as pn, secretTreeFromSchema as pr, AudioStreamPickSchema as pt, HISTORY_UNIT_LABELS as q, clearKnownSecrets as qn, toSecretFieldView as qr, RecordKindDeclarationSchema as qt, maskUrlCredentials as r, expandAudioChunkToF32le as ri, recordArrayItemPath as rn, PeerBytesTicketSchema as rr, nodePin as rt, asNumber as s, SECRET_META as sn, BaseAddon as sr, ReadinessRegistry as st, sleep as t, AUDIO_CHUNK_FORMATS as ti, mapSecretLeaves as tn, PEER_BYTES_STALL_MS as tr, systemMethod as tt, parseJsonObject as u, AdoptionPendingError as un, mergeSecretStatePaths as ur, readinessKey as ut, userError as v, RECORDS_ERROR_CODES as vn, transformSecretWrite as vr, CamStreamKindSchema as vt, createEventBusSliceSource as w, RevConflictError as wn, isSecretRef as wr, ProfileSlotSchema as wt, createDeviceProxy as x, RecordTooLargeError as xn, buildSecretRef as xr, DecodedAudioChunkSchema as xt, DEVICE_SCOPED_CAPS as y, RecordNotFoundError as yn, SECRET_REF_SCHEME as yr, CamStreamResolutionSchema as yt, defineCustomActions as z, RECORD_QUERY_MAX as zn, resolveHydratedFieldValue as zr, parseSettingsBrokersAdoptsFrom as zt };
7507
+ export { optionalMethod as $, DisposerChain as $n, recordSecretRef as $t, HF_REPO as A, RECORD_MAX_INDEXES as An, dehydrateSchema as Ar, makeProfileBrokerId as At, describeCustomActions as B, clearKnownSecrets as Bn, toSecretFieldView as Br, RecordIndexSchema as Bt, addonSliceHandleApi as C, RECORD_BATCH_MAX_BYTES as Cn, emitReadiness as Cr, ProfileRtspEntrySchema as Ct, createSliceHandle as D, RECORD_DELETE_BATCH as Dn, collectHydratedFieldEntries as Dr, StreamSourceSchema as Dt, createMirrorSource as E, RECORD_DEFAULT_MAX_DATA_BYTES as En, WELL_KNOWN_TAB_MAP as Er, StreamSourceEntrySchema$1 as Et, DEVICE_CHILDREN_BATCH_MAX as F, RECORD_SWEEP_INTERVAL_MS as Fn, isSecretClear as Fr, defineEntryKind as Ft, DEVICE_STATUS_METHOD as G, shortSecretRefHash as Gn, isSecretConfigField as Gr, declarationsOf as Gt, adminUiCapability as H, knownSecretCount as Hn, collectKeychainStoredKeys as Hr, RecordKindNameSchema as Ht, CALLER_STAMPED_CAPABILITIES as I, resolveSecretViewsIn as In, isSecretFieldView as Ir, entryBody as It, PROVIDER_PIN_FIELD as J, PEER_BYTES_STALL_MS as Jn, AUDIO_CHUNK_FORMATS as Jr, collectSecretLeaves as Jt, HISTORY_DEFAULT_MIN_INTERVAL_MS as K, PEER_BYTES_CHUNK_BYTES as Kn, omitTransientConfig as Kr, defineRecordKinds as Kt, withoutCallerStamp as L, REVALIDATE_AFTER_MS as Ln, isSecretMarker as Lr, createRecordsAccess as Lt, RawStateResultSchema as M, RECORD_QUERY_MAX as Mn, resolveHydratedFieldValue as Mr, parseProfileBrokerId as Mt, deviceOpsCapability as N, RECORD_SECRET_COLLECTION_PREFIX as Nn, SECRET_CLEAR as Nr, selectAssignedProfileSlots as Nt, DEFAULT_TOKEN_EXPIRY as O, RECORD_ID_MAX_LENGTH as On, collectHydratedFieldValues as Or, SubscribeAudioChunksInputSchema as Ot, viewerUiCapability as P, RECORD_SETTINGS_MAX_ROWS as Pn, classifySecretWrite as Pr, makeInMemoryRecords as Pt, method as Q, SHARE_VIEW_KINDS as Qn, recordSecretCollection as Qt, customAction as R, createSecretsAccess as Rn, isSecretMarkerLike as Rr, EntryDescriptorSchema as Rt, invokeTrpcLeaf as S, RECORD_BATCH_MAX as Sn, createEvent as Sr, FrameHandleSchema as St, createLazyTrpcSource as T, RECORD_DATABASES as Tn, WELL_KNOWN_TABS as Tr, ProfileSlotStatusSchema as Tt, DEFAULT_RUNTIME_STATE_DURABILITY as U, registerKnownSecret as Un, collectSecretConfigKeys as Ur, RecordRetentionSchema as Ut, deviceCustomAction as V, forgetKnownSecret as Vn, REDACTED_SECRET as Vr, RecordKindDeclarationSchema as Vt, DEVICE_SETTINGS_CONTRIBUTION_METHODS as W, scrubKnownSecrets as Wn, isKeychainStoredField as Wr, assertValidDeclaration as Wt, expandCapMethods as X, PeerBytesTicketSchema as Xn, expandAudioChunkToF32le as Xr, parseSecretPath as Xt, event as Y, PEER_BYTES_TICKET_TTL_MS as Yn, audioChunkBytesPerSample as Yr, mapSecretLeaves as Yt, isDeviceConfigCap as Z, DATAPLANE_SECRET_HEADER as Zn, isAudioChunkFormat as Zr, recordArrayItemPath as Zt, readErrorI18n as _, RevConflictError as _n, isSecretRef as _r, CamProfileSchema as _t, asJsonArray as a, DeclarationRefusedError as an, secretTreeFromPaths as ar, toNodeId as at, isDeviceScopedCap as b, asRecordsError as bn, normalizeNodeId as br, CameraStreamSchema as bt, asString as c, InvalidRecordError as cn, collectSecretMarkerRefs as cr, ReadinessTimeoutError as ct, parseJsonUnknown as d, RECORDS_ERROR_CODES as dn, transformSecretWrite as dr, scopeKey as dt, secretArrayPrefixes as en, BaseAddon as er, resolveCapMount as et, hfModelUrl as f, RecordNotFoundError as fn, SECRET_REF_SCHEME as fr, AudioChunkFormatSchema as ft, ErrorI18nPayloadSchema as g, RecordsError as gn, globalSecretScope as gr, CAM_PROFILE_ORDER as gt, ErrorCodeSchema as h, RecordUniqueViolationError as hn, formatSecretScope as hr, BrokerStatusSchema as ht, asBoolean as i, BatchTooLargeError as in, parseSecretStatePath as ir, readNodePin as it, RUNTIME_DEFAULTS as j, RECORD_MAX_INDEX_FIELDS as jn, hydrateSchema as jr, makeSourceBrokerId as jt, HF_BASE_URL as k, RECORD_MAX_DATA_BYTES as kn, dehydrateConfigField as kr, SubscribeAudioChunksResultSchema as kt, parseJsonArray as l, NoCallerError as ln, isSecretRefOwnedBy as lr, emitDownForOwnedCaps as lt, CamstackError as m, RecordTooLargeError as mn, buildSecretRef as mr, BrokerStatsSchema as mt, sleepCancellable as n, collectZodSecretPaths as nn, normalizeAddonInitResult as nr, CAP_NODE_PIN_CONTEXT_KEY as nt, asJsonObject as o, FilterRequiredError as on, secretTreeFromSchema as or, MODEL_FORMATS as ot, BOOT_RECOVERY_BACKOFF_MS as p, RecordSecretUnavailableError as pn, arrayItemFieldPath as pr, AudioStreamPickSchema as pt, HISTORY_UNIT_LABELS as q, PEER_BYTES_MAX_OUTSTANDING as qn, schemaDeclaresAnyField as qr, REMOVE_LEAF as qt, maskUrlCredentials as r, isZodSecret as rn, mergeSecretStatePaths as rr, nodePin as rt, asNumber as s, ForeignSecretMarkerError as sn, KeychainWriteRefusedError as sr, ReadinessRegistry as st, sleep as t, SECRET_META as tn, classifyStoreError as tr, systemMethod as tt, parseJsonObject as u, PlaintextSecretError as un, resolveSecretMarkers as ur, readinessKey as ut, userError as v, UnindexedFilterError as vn, normalizeSecretOwner as vr, CamStreamKindSchema as vt, createEventBusSliceSource as w, RECORD_CLASSES as wn, isEvent as wr, ProfileSlotSchema as wt, createDeviceProxy as x, recordsErrorFromMessage as xn, createDurableState as xr, DecodedAudioChunkSchema as xt, DEVICE_SCOPED_CAPS as y, UnknownRecordKindError as yn, parseSecretRef as yr, CamStreamResolutionSchema as yt, defineCustomActions as z, MIN_SCRUBBED_LENGTH as zn, makeSecretMarker as zr, RecordFieldPathSchema as zt };
@@ -3226,7 +3226,6 @@ var RECORDS_ERROR_CODES = [
3226
3226
  "secret-unavailable",
3227
3227
  "invalid-record",
3228
3228
  "declaration-refused",
3229
- "adoption-pending",
3230
3229
  "no-caller",
3231
3230
  "batch-too-large"
3232
3231
  ];
@@ -3324,13 +3323,6 @@ var DeclarationRefusedError = class extends RecordsError {
3324
3323
  this.name = "DeclarationRefusedError";
3325
3324
  }
3326
3325
  };
3327
- /** A kind is empty while the legacy table it adopts from still holds rows. */
3328
- var AdoptionPendingError = class extends RecordsError {
3329
- constructor(detail) {
3330
- super("adoption-pending", detail);
3331
- this.name = "AdoptionPendingError";
3332
- }
3333
- };
3334
3326
  var NoCallerError = class extends RecordsError {
3335
3327
  constructor(detail) {
3336
3328
  super("no-caller", detail);
@@ -3356,7 +3348,6 @@ var FACTORIES = {
3356
3348
  "secret-unavailable": (d) => new RecordSecretUnavailableError(d),
3357
3349
  "invalid-record": (d) => new InvalidRecordError(d),
3358
3350
  "declaration-refused": (d) => new DeclarationRefusedError(d),
3359
- "adoption-pending": (d) => new AdoptionPendingError(d),
3360
3351
  "no-caller": (d) => new NoCallerError(d),
3361
3352
  "batch-too-large": (d) => new BatchTooLargeError(d)
3362
3353
  };
@@ -3668,7 +3659,13 @@ var RecordKindDeclarationSchema = zod.z.object({
3668
3659
  secretPaths: zod.z.array(zod.z.string().min(1)).default([]),
3669
3660
  /** The id key of each array that carries a secret (`{ headers: 'name' }`). */
3670
3661
  secretArrayKeys: zod.z.record(zod.z.string(), zod.z.string()).default({}),
3671
- /** The legacy table this kind adopts from; the boot guard reads it (D853: no migration code). */
3662
+ /**
3663
+ * RETIRED (D900): the legacy table a kind adopted from during the records
3664
+ * migration. Nothing declares it any more and nothing reads it; the schema
3665
+ * still ACCEPTS it because the catalog rows the migration wrote carry it
3666
+ * (an orphaned kind is never redeclared) and an addon built before the
3667
+ * removal still sends it. Never set it.
3668
+ */
3672
3669
  adoptsFrom: zod.z.string().min(1).optional(),
3673
3670
  /** Kinds that must agree through `transact` sit in one file under one family name. */
3674
3671
  transactFamily: zod.z.string().min(1).optional(),
@@ -3743,7 +3740,6 @@ function defineRecordKinds(specs) {
3743
3740
  maxDataBytes: spec.maxDataBytes,
3744
3741
  secretPaths: [...secretPaths],
3745
3742
  secretArrayKeys: spec.secretArrayKeys === void 0 ? void 0 : { ...spec.secretArrayKeys },
3746
- adoptsFrom: spec.adoptsFrom,
3747
3743
  transactFamily: spec.transactFamily,
3748
3744
  entry: spec.entry === void 0 ? void 0 : {
3749
3745
  title: spec.entry.title,
@@ -4084,10 +4080,7 @@ function createRecordsAccess(options) {
4084
4080
  return delegate;
4085
4081
  },
4086
4082
  async declare(kinds) {
4087
- const result = await call(() => options.transport.declareKinds({ kinds: { ...declarationsOf(kinds) } }));
4088
- const pending = Object.entries(result.kinds).filter((entry) => entry[1].adoptionPending !== null);
4089
- if (pending.length > 0) throw new AdoptionPendingError(`${pending.map(([name, r]) => r.adoptionPending === null ? name : `${name} (legacy table "${r.adoptionPending.legacyTable}" holds ${r.adoptionPending.legacyRows} rows)`).join(", ")}. Stop the addon and run scripts/hub/records-adopt.ts --copy --apply before starting this build`);
4090
- return result.kinds;
4083
+ return (await call(() => options.transport.declareKinds({ kinds: { ...declarationsOf(kinds) } }))).kinds;
4091
4084
  },
4092
4085
  kind(definition) {
4093
4086
  const existing = handles.get(definition);
@@ -4142,7 +4135,6 @@ function defineEntryKind(name, spec) {
4142
4135
  ...spec.database === void 0 ? {} : { database: spec.database },
4143
4136
  ...spec.indexes === void 0 ? {} : { indexes: spec.indexes },
4144
4137
  ...spec.secretArrayKeys === void 0 ? {} : { secretArrayKeys: spec.secretArrayKeys },
4145
- ...spec.adoptsFrom === void 0 ? {} : { adoptsFrom: spec.adoptsFrom },
4146
4138
  entry: {
4147
4139
  title: spec.title,
4148
4140
  ...spec.nameField === void 0 ? {} : { nameField: spec.nameField }
@@ -4152,49 +4144,6 @@ function defineEntryKind(name, spec) {
4152
4144
  return defined;
4153
4145
  }
4154
4146
  //#endregion
4155
- //#region src/records/settings-brokers-adopts-from.ts
4156
- /**
4157
- * Legacy source for broker entry adoption (B2): brokers live in addon-settings
4158
- * as one row `<addonId>.brokers` whose value is an array until records-adopt
4159
- * copies them into the entry kind.
4160
- */
4161
- var SETTINGS_BROKERS_ADOPTS_PREFIX = "@settings-brokers/";
4162
- /** The `adoptsFrom` value for an addon's broker entry kind. */
4163
- function settingsBrokersAdoptsFrom(addonId) {
4164
- return `${SETTINGS_BROKERS_ADOPTS_PREFIX}${addonId}`;
4165
- }
4166
- /** When non-null, `from` names an addon-settings brokers blob, not a SQL table. */
4167
- function parseSettingsBrokersAdoptsFrom(from) {
4168
- if (!from.startsWith("@settings-brokers/")) return null;
4169
- const addonId = from.slice(18);
4170
- return addonId.length > 0 ? addonId : null;
4171
- }
4172
- //#endregion
4173
- //#region src/records/settings-array-adopts-from.ts
4174
- /**
4175
- * Legacy source for entry adoption (B3): a list stored under addon-settings
4176
- * `<addonId>.<key>` until records-adopt copies rows into the entry kind.
4177
- */
4178
- var SETTINGS_ARRAY_ADOPTS_PREFIX = "@settings-array/";
4179
- /** The `adoptsFrom` value for an addon-settings array field. */
4180
- function settingsArrayAdoptsFrom(addonId, settingsKey) {
4181
- return `${SETTINGS_ARRAY_ADOPTS_PREFIX}${addonId}/${settingsKey}`;
4182
- }
4183
- /** When non-null, `from` names an addon-settings array blob, not a SQL table. */
4184
- function parseSettingsArrayAdoptsFrom(from) {
4185
- if (!from.startsWith("@settings-array/")) return null;
4186
- const rest = from.slice(16);
4187
- const slash = rest.indexOf("/");
4188
- if (slash <= 0 || slash >= rest.length - 1) return null;
4189
- const addonId = rest.slice(0, slash);
4190
- const settingsKey = rest.slice(slash + 1);
4191
- if (addonId.length === 0 || settingsKey.length === 0) return null;
4192
- return {
4193
- addonId,
4194
- settingsKey
4195
- };
4196
- }
4197
- //#endregion
4198
4147
  //#region src/records/in-memory-records.ts
4199
4148
  /**
4200
4149
  * In-memory `RecordsAccess` for specs. Kinds are declared by the caller.
@@ -7561,12 +7510,6 @@ Object.defineProperty(exports, "AUDIO_CHUNK_FORMATS", {
7561
7510
  return AUDIO_CHUNK_FORMATS;
7562
7511
  }
7563
7512
  });
7564
- Object.defineProperty(exports, "AdoptionPendingError", {
7565
- enumerable: true,
7566
- get: function() {
7567
- return AdoptionPendingError;
7568
- }
7569
- });
7570
7513
  Object.defineProperty(exports, "AudioChunkFormatSchema", {
7571
7514
  enumerable: true,
7572
7515
  get: function() {
@@ -8083,18 +8026,6 @@ Object.defineProperty(exports, "SECRET_REF_SCHEME", {
8083
8026
  return SECRET_REF_SCHEME;
8084
8027
  }
8085
8028
  });
8086
- Object.defineProperty(exports, "SETTINGS_ARRAY_ADOPTS_PREFIX", {
8087
- enumerable: true,
8088
- get: function() {
8089
- return SETTINGS_ARRAY_ADOPTS_PREFIX;
8090
- }
8091
- });
8092
- Object.defineProperty(exports, "SETTINGS_BROKERS_ADOPTS_PREFIX", {
8093
- enumerable: true,
8094
- get: function() {
8095
- return SETTINGS_BROKERS_ADOPTS_PREFIX;
8096
- }
8097
- });
8098
8029
  Object.defineProperty(exports, "SHARE_VIEW_KINDS", {
8099
8030
  enumerable: true,
8100
8031
  get: function() {
@@ -8677,18 +8608,6 @@ Object.defineProperty(exports, "parseSecretStatePath", {
8677
8608
  return parseSecretStatePath;
8678
8609
  }
8679
8610
  });
8680
- Object.defineProperty(exports, "parseSettingsArrayAdoptsFrom", {
8681
- enumerable: true,
8682
- get: function() {
8683
- return parseSettingsArrayAdoptsFrom;
8684
- }
8685
- });
8686
- Object.defineProperty(exports, "parseSettingsBrokersAdoptsFrom", {
8687
- enumerable: true,
8688
- get: function() {
8689
- return parseSettingsBrokersAdoptsFrom;
8690
- }
8691
- });
8692
8611
  Object.defineProperty(exports, "readErrorI18n", {
8693
8612
  enumerable: true,
8694
8613
  get: function() {
@@ -8803,18 +8722,6 @@ Object.defineProperty(exports, "selectAssignedProfileSlots", {
8803
8722
  return selectAssignedProfileSlots;
8804
8723
  }
8805
8724
  });
8806
- Object.defineProperty(exports, "settingsArrayAdoptsFrom", {
8807
- enumerable: true,
8808
- get: function() {
8809
- return settingsArrayAdoptsFrom;
8810
- }
8811
- });
8812
- Object.defineProperty(exports, "settingsBrokersAdoptsFrom", {
8813
- enumerable: true,
8814
- get: function() {
8815
- return settingsBrokersAdoptsFrom;
8816
- }
8817
- });
8818
8725
  Object.defineProperty(exports, "shortSecretRefHash", {
8819
8726
  enumerable: true,
8820
8727
  get: function() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.388",
3
+ "version": "1.2.390",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",
@@ -1,12 +0,0 @@
1
- /**
2
- * Legacy source for entry adoption (B3): a list stored under addon-settings
3
- * `<addonId>.<key>` until records-adopt copies rows into the entry kind.
4
- */
5
- export declare const SETTINGS_ARRAY_ADOPTS_PREFIX = "@settings-array/";
6
- /** The `adoptsFrom` value for an addon-settings array field. */
7
- export declare function settingsArrayAdoptsFrom(addonId: string, settingsKey: string): string;
8
- /** When non-null, `from` names an addon-settings array blob, not a SQL table. */
9
- export declare function parseSettingsArrayAdoptsFrom(from: string): {
10
- readonly addonId: string;
11
- readonly settingsKey: string;
12
- } | null;
@@ -1,10 +0,0 @@
1
- /**
2
- * Legacy source for broker entry adoption (B2): brokers live in addon-settings
3
- * as one row `<addonId>.brokers` whose value is an array until records-adopt
4
- * copies them into the entry kind.
5
- */
6
- export declare const SETTINGS_BROKERS_ADOPTS_PREFIX = "@settings-brokers/";
7
- /** The `adoptsFrom` value for an addon's broker entry kind. */
8
- export declare function settingsBrokersAdoptsFrom(addonId: string): string;
9
- /** When non-null, `from` names an addon-settings brokers blob, not a SQL table. */
10
- export declare function parseSettingsBrokersAdoptsFrom(from: string): string | null;