@camstack/types 1.2.377 → 1.2.379

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/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-Dq0Uyeh0.js");
3
- const require_event_category = require("./event-category-T43rdQWR.js");
2
+ const require_sleep = require("./sleep-DQYi915G.js");
3
+ const require_event_category = require("./event-category-Hoe-mqbd.js");
4
4
  const require_composition = require("./composition-CUAOHZ38.js");
5
5
  const require_node_color = require("./node-color.js");
6
6
  const require_err_msg = require("./err-msg-Bb-s4Xuj.js");
@@ -13088,6 +13088,43 @@ function describeComposableCaps(defs, deviceType) {
13088
13088
  }).toSorted((a, b) => a.cap.localeCompare(b.cap));
13089
13089
  }
13090
13090
  //#endregion
13091
+ //#region src/capabilities/raw-secret-migration.ts
13092
+ /**
13093
+ * The report of a one-shot "move this owner's plaintext secrets into the
13094
+ * keychain" run (D878). COUNTS only - never a value, never a ref.
13095
+ *
13096
+ * The owner runs it on its own rows, through its own write path; an operator
13097
+ * script (`scripts/hub/migrate-raw-secrets.ts`) calls the owner's cap method.
13098
+ * Dry run (`apply: false`) reports what WOULD move and changes nothing.
13099
+ */
13100
+ var RawSecretMigrationInputSchema = zod.z.object({
13101
+ /** `false` (the default of the script) = report only. */
13102
+ apply: zod.z.boolean() });
13103
+ var RawSecretMigrationReportSchema = zod.z.object({
13104
+ apply: zod.z.boolean(),
13105
+ /** Rows that can carry a secret (a profile, an enrolment). */
13106
+ rows: zod.z.number().int(),
13107
+ /** Rows whose secret was plaintext when the run started. */
13108
+ raw: zod.z.number().int(),
13109
+ /** Rows that already held a keychain marker when the run started. */
13110
+ markers: zod.z.number().int(),
13111
+ /** Plaintext rows moved by THIS run (always 0 on a dry run). */
13112
+ migrated: zod.z.number().int(),
13113
+ /** Plaintext rows left in place because the move or its read-back failed. */
13114
+ failed: zod.z.number().int(),
13115
+ /** After the run: rows still holding plaintext. */
13116
+ remainingRaw: zod.z.number().int(),
13117
+ /** After the run: markers the keychain could not resolve right now. */
13118
+ unresolvedMarkers: zod.z.number().int(),
13119
+ /**
13120
+ * A second, redundant copy of the secrets' rows that the run found (and, on
13121
+ * `apply`, deleted after verifying the first). Owners with a single copy omit it.
13122
+ */
13123
+ redundantCopies: zod.z.number().int().optional(),
13124
+ /** True when nothing is raw and every marker resolves. */
13125
+ verified: zod.z.boolean()
13126
+ });
13127
+ //#endregion
13091
13128
  //#region src/capabilities/core-blocks.cap.ts
13092
13129
  /**
13093
13130
  * core-blocks — user-authored TypeScript, stored in the kernel and executed in
@@ -13453,14 +13490,16 @@ var coreBlocksCapability = {
13453
13490
  /**
13454
13491
  * Hydrated settings form for one block, or null until a `settingsSchema`
13455
13492
  * is known (extracted from the compiled entry's named export, or set on
13456
- * the block). Values live in the `core-blocks:settings` collection.
13493
+ * the block). Values live in the block addon's `addon-settings` rows (D880);
13494
+ * a password field answers as a "set" view, never the value.
13457
13495
  */
13458
13496
  getBlockSettings: require_sleep.method(zod.z.object({ blockId: zod.z.string() }), SettingsSchemaWithValuesSchema.nullable(), { auth: "admin" }),
13459
13497
  /**
13460
13498
  * Patch persisted preference values for one block. The schema is not
13461
- * rewritten here — only values. Scripts read the same blob via
13462
- * `ctx.settings.readAddonStore()` (mirrored into the block addon's
13463
- * `addon-settings` namespace on every patch).
13499
+ * rewritten here — only values. Scripts read the same rows via
13500
+ * `ctx.settings.readAddonStore()`. A field the schema declares `password` /
13501
+ * `secret: true` is stored in the keychain (owner = the block's addon id)
13502
+ * and the row holds a marker; a REDACTED or view value keeps the stored one.
13464
13503
  */
13465
13504
  updateBlockSettings: require_sleep.method(zod.z.object({
13466
13505
  blockId: zod.z.string(),
@@ -13470,6 +13509,16 @@ var coreBlocksCapability = {
13470
13509
  auth: "admin"
13471
13510
  }),
13472
13511
  /**
13512
+ * D880: move every plaintext password a block's `settingsSchema` declares
13513
+ * into the keychain and delete the legacy `core-blocks:settings` copy. Dry
13514
+ * run unless `apply`; idempotent; counts only. A secret is read back from
13515
+ * the keychain before its row is rewritten.
13516
+ */
13517
+ migrateRawSecrets: require_sleep.method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
13518
+ kind: "mutation",
13519
+ auth: "admin"
13520
+ }),
13521
+ /**
13473
13522
  * The declaration files the editor type-checks against.
13474
13523
  *
13475
13524
  * Served rather than bundled: the graph is 3.4 MB across 344 files, and
@@ -39512,6 +39561,16 @@ var llmCapability = {
39512
39561
  kind: "mutation",
39513
39562
  auth: "admin"
39514
39563
  }),
39564
+ /**
39565
+ * D878: move every profile's plaintext `apiKey` into the keychain (owner
39566
+ * `ai`), leaving a marker in the row. Dry run unless `apply`; idempotent;
39567
+ * counts only. The plaintext is cleared only after the keychain read-back
39568
+ * matched.
39569
+ */
39570
+ migrateRawSecrets: require_sleep.method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
39571
+ kind: "mutation",
39572
+ auth: "admin"
39573
+ }),
39515
39574
  deleteProfile: require_sleep.method(ProfileRefInputSchema, zod.z.void(), {
39516
39575
  kind: "mutation",
39517
39576
  auth: "admin"
@@ -54094,6 +54153,41 @@ var ServerRollbackInfoSchema = zod.z.object({
54094
54153
  atMs: zod.z.number(),
54095
54154
  reason: zod.z.string()
54096
54155
  });
54156
+ /**
54157
+ * The runner boot check (D877): the runners this node PLANNED (hub: one per
54158
+ * `resolveRunnerId` over its forked addons; agent: the runners its process
54159
+ * service holds, because only the hub plans) against the states the process
54160
+ * service reports. Kept in memory, recomputed by the same one-shot check after
54161
+ * every boot, served on `getServerPackageStatus`.
54162
+ *
54163
+ * `failed` is the D6 breaker's terminal state, `refused` a deterministic Init
54164
+ * refusal (an addon that said "I will not start, and here is why"), `missing` a
54165
+ * planned runner the process service has no entry for.
54166
+ */
54167
+ var RunnerRefusalSchema = zod.z.object({
54168
+ runnerId: zod.z.string(),
54169
+ addonIds: zod.z.array(zod.z.string()),
54170
+ reason: zod.z.string()
54171
+ });
54172
+ var RunnerBootCheckSchema = zod.z.object({
54173
+ checkedAtMs: zod.z.number(),
54174
+ /** Runners planned for this node. */
54175
+ expected: zod.z.number(),
54176
+ /** Planned runners whose process is `running`. */
54177
+ running: zod.z.number(),
54178
+ failed: zod.z.array(zod.z.string()),
54179
+ refused: zod.z.array(RunnerRefusalSchema),
54180
+ missing: zod.z.array(zod.z.string()),
54181
+ /**
54182
+ * Runners still on their way: `starting`, or `crashed` waiting on a backoff
54183
+ * respawn. The check is FINAL only when this is empty; until then nothing is
54184
+ * pushed and the verdict is re-evaluated on the next runner state change.
54185
+ * Optional for version skew (absent = settled).
54186
+ */
54187
+ pending: zod.z.array(zod.z.string()).optional(),
54188
+ /** True when the plan is the hub's (`missing` is then meaningful); false on an agent. */
54189
+ planKnown: zod.z.boolean()
54190
+ });
54097
54191
  var ServerPackageStatusSchema = zod.z.object({
54098
54192
  /** Root package name (`@camstack/server` on the hub). */
54099
54193
  packageName: zod.z.string(),
@@ -54156,7 +54250,14 @@ var ServerPackageStatusSchema = zod.z.object({
54156
54250
  * for version skew: an older provider's payload simply omits it, and an
54157
54251
  * absent wrapper is unknown — never `native`.
54158
54252
  */
54159
- wrapper: WrapperIdentitySchema.optional()
54253
+ wrapper: WrapperIdentitySchema.optional(),
54254
+ /**
54255
+ * What this node PLANNED to run against what its process service reports
54256
+ * (D877). Absent until the one-shot boot check has run (~60 s after boot) and
54257
+ * on a provider that predates it. Absent is "not checked yet", never "all
54258
+ * well": a consumer that needs the answer treats it as pending.
54259
+ */
54260
+ runners: RunnerBootCheckSchema.optional()
54160
54261
  });
54161
54262
  var ServerUpdateCheckResultSchema = zod.z.object({
54162
54263
  packageName: zod.z.string(),
@@ -54207,6 +54308,13 @@ var ServerUpdateOutcomeSchema = zod.z.enum([
54207
54308
  "refused",
54208
54309
  "failed"
54209
54310
  ]);
54311
+ /** One addon the pre-flight found the target version would refuse (D877). */
54312
+ var UpdateBlockerSchema = zod.z.object({
54313
+ addonId: zod.z.string(),
54314
+ reason: zod.z.string(),
54315
+ /** What the operator does about it. */
54316
+ remedy: zod.z.string()
54317
+ });
54210
54318
  var ServerUpdateActionResultSchema = zod.z.object({
54211
54319
  accepted: zod.z.boolean(),
54212
54320
  targetVersion: zod.z.string().nullable(),
@@ -54224,7 +54332,13 @@ var ServerUpdateActionResultSchema = zod.z.object({
54224
54332
  * The failure itself, verbatim enough to act on (the npm output for a
54225
54333
  * staging install). Non-null only for `failed`.
54226
54334
  */
54227
- error: zod.z.string().nullable().optional()
54335
+ error: zod.z.string().nullable().optional(),
54336
+ /**
54337
+ * The addons the target version would refuse to start on this node's live
54338
+ * store (D877), present when the pre-flight refused the update
54339
+ * (`reason: 'addon-would-refuse'`). Optional for version skew.
54340
+ */
54341
+ blockers: zod.z.array(UpdateBlockerSchema).optional()
54228
54342
  });
54229
54343
  var serverManagementCapability = {
54230
54344
  name: "server-management",
@@ -54236,9 +54350,16 @@ var serverManagementCapability = {
54236
54350
  kind: "mutation",
54237
54351
  auth: "admin"
54238
54352
  }),
54239
- applyServerUpdate: require_sleep.method(zod.z.object({
54240
- /** Explicit target version; omitted = latest from the registry. */
54241
- version: zod.z.string().optional() }), ServerUpdateActionResultSchema, {
54353
+ applyServerUpdate: require_sleep.method(zod.z.object({
54354
+ /** Explicit target version; omitted = latest from the registry. */
54355
+ version: zod.z.string().optional(),
54356
+ /**
54357
+ * Apply even though the pre-flight (D877) found addons the target would
54358
+ * refuse to start. Off by default: those addons stay down until the
54359
+ * remedy is run, which is the incident this gate exists to prevent.
54360
+ */
54361
+ acknowledgeRefusals: zod.z.boolean().optional()
54362
+ }), ServerUpdateActionResultSchema, {
54242
54363
  kind: "mutation",
54243
54364
  auth: "admin",
54244
54365
  timeoutMs: 16 * 6e4
@@ -57951,7 +58072,9 @@ var ManifestShapeSchema = zod.z.object({
57951
58072
  var AddonProcessSchema = zod.z.object({
57952
58073
  pid: zod.z.number().optional(),
57953
58074
  mode: zod.z.string(),
57954
- state: zod.z.string()
58075
+ state: zod.z.string(),
58076
+ /** Why the runner is `refused` (an addon's own words), when it is (D877). */
58077
+ reason: zod.z.string().optional()
57955
58078
  });
57956
58079
  /**
57957
58080
  * Per-addon health snapshot from the kernel's AddonHealthMonitor.
@@ -71581,6 +71704,16 @@ var userManagementCapability = {
71581
71704
  access: "delete"
71582
71705
  }),
71583
71706
  getTotpStatus: require_sleep.method(zod.z.object({ userId: zod.z.string() }), TotpStatusSchema, { auth: "admin" }),
71707
+ /**
71708
+ * D878: move every TOTP seed stored in plaintext into the keychain (owner
71709
+ * `system`), leaving a marker in the row. Dry run unless `apply`;
71710
+ * idempotent; counts only.
71711
+ */
71712
+ migrateRawSecrets: require_sleep.method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
71713
+ kind: "mutation",
71714
+ auth: "admin",
71715
+ access: "create"
71716
+ }),
71584
71717
  verifyTotp: require_sleep.method(zod.z.object({
71585
71718
  userId: zod.z.string(),
71586
71719
  code: zod.z.string()
@@ -77822,6 +77955,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
77822
77955
  addonId: null,
77823
77956
  access: "view"
77824
77957
  },
77958
+ "coreBlocks.migrateRawSecrets": {
77959
+ capName: "core-blocks",
77960
+ capScope: "system",
77961
+ addonId: null,
77962
+ access: "create"
77963
+ },
77825
77964
  "coreBlocks.restart": {
77826
77965
  capName: "core-blocks",
77827
77966
  capScope: "system",
@@ -79682,6 +79821,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
79682
79821
  addonId: null,
79683
79822
  access: "view"
79684
79823
  },
79824
+ "llm.migrateRawSecrets": {
79825
+ capName: "llm",
79826
+ capScope: "system",
79827
+ addonId: null,
79828
+ access: "create"
79829
+ },
79685
79830
  "llm.resolveModelRef": {
79686
79831
  capName: "llm",
79687
79832
  capScope: "system",
@@ -84224,6 +84369,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
84224
84369
  addonId: null,
84225
84370
  access: "view"
84226
84371
  },
84372
+ "userManagement.migrateRawSecrets": {
84373
+ capName: "user-management",
84374
+ capScope: "system",
84375
+ addonId: null,
84376
+ access: "create"
84377
+ },
84227
84378
  "userManagement.oauthExchangeCode": {
84228
84379
  capName: "user-management",
84229
84380
  capScope: "system",
@@ -91933,6 +92084,7 @@ function createSystemProxy(api) {
91933
92084
  compile: (input) => dispatch("coreBlocks", "compile", "mutation", input),
91934
92085
  getBlockSettings: (input) => dispatch("coreBlocks", "getBlockSettings", "query", input),
91935
92086
  updateBlockSettings: (input) => dispatch("coreBlocks", "updateBlockSettings", "mutation", input),
92087
+ migrateRawSecrets: (input) => dispatch("coreBlocks", "migrateRawSecrets", "mutation", input),
91936
92088
  getTypeDefs: (input) => dispatch("coreBlocks", "getTypeDefs", "query", input),
91937
92089
  createComposition: (input) => dispatch("coreBlocks", "createComposition", "mutation", input),
91938
92090
  updateComposition: (input) => dispatch("coreBlocks", "updateComposition", "mutation", input),
@@ -92105,6 +92257,7 @@ function createSystemProxy(api) {
92105
92257
  listProfileKinds: (input) => dispatch("llm", "listProfileKinds", "query", input),
92106
92258
  listProfiles: (input) => dispatch("llm", "listProfiles", "query", input),
92107
92259
  upsertProfile: (input) => dispatch("llm", "upsertProfile", "mutation", input),
92260
+ migrateRawSecrets: (input) => dispatch("llm", "migrateRawSecrets", "mutation", input),
92108
92261
  deleteProfile: (input) => dispatch("llm", "deleteProfile", "mutation", input),
92109
92262
  testProfile: (input) => dispatch("llm", "testProfile", "mutation", input),
92110
92263
  listModels: (input) => dispatch("llm", "listModels", "query", input),
@@ -92552,6 +92705,7 @@ function createSystemProxy(api) {
92552
92705
  confirmTotp: (input) => dispatch("userManagement", "confirmTotp", "mutation", input),
92553
92706
  disableTotp: (input) => dispatch("userManagement", "disableTotp", "mutation", input),
92554
92707
  getTotpStatus: (input) => dispatch("userManagement", "getTotpStatus", "query", input),
92708
+ migrateRawSecrets: (input) => dispatch("userManagement", "migrateRawSecrets", "mutation", input),
92555
92709
  verifyTotp: (input) => dispatch("userManagement", "verifyTotp", "mutation", input),
92556
92710
  oauthIssueCode: (input) => dispatch("userManagement", "oauthIssueCode", "mutation", input),
92557
92711
  oauthExchangeCode: (input) => dispatch("userManagement", "oauthExchangeCode", "mutation", input),
@@ -102570,6 +102724,8 @@ exports.RUNTIME_DEFAULTS = require_sleep.RUNTIME_DEFAULTS;
102570
102724
  exports.RUNTIME_STATE_POLICY = RUNTIME_STATE_POLICY;
102571
102725
  exports.RUNTIME_STATE_REFRESH_MISS_COOLDOWN_MS = RUNTIME_STATE_REFRESH_MISS_COOLDOWN_MS;
102572
102726
  exports.RUNTIME_TO_FORMAT = RUNTIME_TO_FORMAT;
102727
+ exports.RawSecretMigrationInputSchema = RawSecretMigrationInputSchema;
102728
+ exports.RawSecretMigrationReportSchema = RawSecretMigrationReportSchema;
102573
102729
  exports.RawStateResultSchema = require_sleep.RawStateResultSchema;
102574
102730
  exports.ReadGopBytesResultSchema = ReadGopBytesResultSchema;
102575
102731
  exports.ReadSegmentBytesResultSchema = ReadSegmentBytesResultSchema;
@@ -102686,6 +102842,7 @@ exports.RingBuffer = RingBuffer;
102686
102842
  exports.RootStepSupplySchema = RootStepSupplySchema;
102687
102843
  exports.RtpSourceSchema = RtpSourceSchema;
102688
102844
  exports.RtspRestreamEntrySchema = RtspRestreamEntrySchema;
102845
+ exports.RunnerBootCheckSchema = RunnerBootCheckSchema;
102689
102846
  exports.RunnerCameraConfigSchema = RunnerCameraConfigSchema;
102690
102847
  exports.RunnerCameraDeviceUIFields = RunnerCameraDeviceUIFields;
102691
102848
  exports.RunnerFrameSourceSchema = RunnerFrameSourceSchema;
@@ -102693,6 +102850,7 @@ exports.RunnerInferenceDeviceSchema = RunnerInferenceDeviceSchema;
102693
102850
  exports.RunnerJumpStepProvisioningSchema = RunnerJumpStepProvisioningSchema;
102694
102851
  exports.RunnerLocalLoadSchema = RunnerLocalLoadSchema;
102695
102852
  exports.RunnerLocalMetricsSchema = RunnerLocalMetricsSchema;
102853
+ exports.RunnerRefusalSchema = RunnerRefusalSchema;
102696
102854
  exports.SCENE_CONDITIONS = SCENE_CONDITIONS;
102697
102855
  exports.SCENE_CONFIRM_DEFAULT_MAX_IMAGE_PX = SCENE_CONFIRM_DEFAULT_MAX_IMAGE_PX;
102698
102856
  exports.SCENE_CONFIRM_DEFAULT_TIMEOUT_MS = SCENE_CONFIRM_DEFAULT_TIMEOUT_MS;
@@ -102958,6 +103116,7 @@ exports.UninstallPackageResultSchema = UninstallPackageResultSchema;
102958
103116
  exports.UnitConversionError = UnitConversionError;
102959
103117
  exports.UnstampedEventMediaCountSchema = UnstampedEventMediaCountSchema;
102960
103118
  exports.UnstampedRowsSchema = UnstampedRowsSchema;
103119
+ exports.UpdateBlockerSchema = UpdateBlockerSchema;
102961
103120
  exports.UpdateIntegrationInputSchema = UpdateIntegrationInputSchema;
102962
103121
  exports.UpdateStatusSchema = UpdateStatusSchema;
102963
103122
  exports.UpdateUserInputSchema = UpdateUserInputSchema;
@@ -103443,6 +103602,7 @@ exports.isSecretFieldView = require_sleep.isSecretFieldView;
103443
103602
  exports.isSecretMarker = require_sleep.isSecretMarker;
103444
103603
  exports.isSecretMarkerLike = require_sleep.isSecretMarkerLike;
103445
103604
  exports.isSecretRef = require_sleep.isSecretRef;
103605
+ exports.isSecretRefOwnedBy = require_sleep.isSecretRefOwnedBy;
103446
103606
  exports.isSingleHubAddressRole = isSingleHubAddressRole;
103447
103607
  exports.isSoftwareDecode = require_composition.isSoftwareDecode;
103448
103608
  exports.isSourceCap = require_composition.isSourceCap;