@camstack/types 1.2.377 → 1.2.378

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-gxUz0C9M.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");
@@ -39304,6 +39304,38 @@ var llmRuntimeCapability = {
39304
39304
  }
39305
39305
  };
39306
39306
  //#endregion
39307
+ //#region src/capabilities/raw-secret-migration.ts
39308
+ /**
39309
+ * The report of a one-shot "move this owner's plaintext secrets into the
39310
+ * keychain" run (D878). COUNTS only - never a value, never a ref.
39311
+ *
39312
+ * The owner runs it on its own rows, through its own write path; an operator
39313
+ * script (`scripts/hub/migrate-raw-secrets.ts`) calls the owner's cap method.
39314
+ * Dry run (`apply: false`) reports what WOULD move and changes nothing.
39315
+ */
39316
+ var RawSecretMigrationInputSchema = zod.z.object({
39317
+ /** `false` (the default of the script) = report only. */
39318
+ apply: zod.z.boolean() });
39319
+ var RawSecretMigrationReportSchema = zod.z.object({
39320
+ apply: zod.z.boolean(),
39321
+ /** Rows that can carry a secret (a profile, an enrolment). */
39322
+ rows: zod.z.number().int(),
39323
+ /** Rows whose secret was plaintext when the run started. */
39324
+ raw: zod.z.number().int(),
39325
+ /** Rows that already held a keychain marker when the run started. */
39326
+ markers: zod.z.number().int(),
39327
+ /** Plaintext rows moved by THIS run (always 0 on a dry run). */
39328
+ migrated: zod.z.number().int(),
39329
+ /** Plaintext rows left in place because the move or its read-back failed. */
39330
+ failed: zod.z.number().int(),
39331
+ /** After the run: rows still holding plaintext. */
39332
+ remainingRaw: zod.z.number().int(),
39333
+ /** After the run: markers the keychain could not resolve right now. */
39334
+ unresolvedMarkers: zod.z.number().int(),
39335
+ /** True when nothing is raw and every marker resolves. */
39336
+ verified: zod.z.boolean()
39337
+ });
39338
+ //#endregion
39307
39339
  //#region src/capabilities/llm.cap.ts
39308
39340
  /**
39309
39341
  * `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
@@ -39512,6 +39544,16 @@ var llmCapability = {
39512
39544
  kind: "mutation",
39513
39545
  auth: "admin"
39514
39546
  }),
39547
+ /**
39548
+ * D878: move every profile's plaintext `apiKey` into the keychain (owner
39549
+ * `ai`), leaving a marker in the row. Dry run unless `apply`; idempotent;
39550
+ * counts only. The plaintext is cleared only after the keychain read-back
39551
+ * matched.
39552
+ */
39553
+ migrateRawSecrets: require_sleep.method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
39554
+ kind: "mutation",
39555
+ auth: "admin"
39556
+ }),
39515
39557
  deleteProfile: require_sleep.method(ProfileRefInputSchema, zod.z.void(), {
39516
39558
  kind: "mutation",
39517
39559
  auth: "admin"
@@ -54094,6 +54136,41 @@ var ServerRollbackInfoSchema = zod.z.object({
54094
54136
  atMs: zod.z.number(),
54095
54137
  reason: zod.z.string()
54096
54138
  });
54139
+ /**
54140
+ * The runner boot check (D877): the runners this node PLANNED (hub: one per
54141
+ * `resolveRunnerId` over its forked addons; agent: the runners its process
54142
+ * service holds, because only the hub plans) against the states the process
54143
+ * service reports. Kept in memory, recomputed by the same one-shot check after
54144
+ * every boot, served on `getServerPackageStatus`.
54145
+ *
54146
+ * `failed` is the D6 breaker's terminal state, `refused` a deterministic Init
54147
+ * refusal (an addon that said "I will not start, and here is why"), `missing` a
54148
+ * planned runner the process service has no entry for.
54149
+ */
54150
+ var RunnerRefusalSchema = zod.z.object({
54151
+ runnerId: zod.z.string(),
54152
+ addonIds: zod.z.array(zod.z.string()),
54153
+ reason: zod.z.string()
54154
+ });
54155
+ var RunnerBootCheckSchema = zod.z.object({
54156
+ checkedAtMs: zod.z.number(),
54157
+ /** Runners planned for this node. */
54158
+ expected: zod.z.number(),
54159
+ /** Planned runners whose process is `running`. */
54160
+ running: zod.z.number(),
54161
+ failed: zod.z.array(zod.z.string()),
54162
+ refused: zod.z.array(RunnerRefusalSchema),
54163
+ missing: zod.z.array(zod.z.string()),
54164
+ /**
54165
+ * Runners still on their way: `starting`, or `crashed` waiting on a backoff
54166
+ * respawn. The check is FINAL only when this is empty; until then nothing is
54167
+ * pushed and the verdict is re-evaluated on the next runner state change.
54168
+ * Optional for version skew (absent = settled).
54169
+ */
54170
+ pending: zod.z.array(zod.z.string()).optional(),
54171
+ /** True when the plan is the hub's (`missing` is then meaningful); false on an agent. */
54172
+ planKnown: zod.z.boolean()
54173
+ });
54097
54174
  var ServerPackageStatusSchema = zod.z.object({
54098
54175
  /** Root package name (`@camstack/server` on the hub). */
54099
54176
  packageName: zod.z.string(),
@@ -54156,7 +54233,14 @@ var ServerPackageStatusSchema = zod.z.object({
54156
54233
  * for version skew: an older provider's payload simply omits it, and an
54157
54234
  * absent wrapper is unknown — never `native`.
54158
54235
  */
54159
- wrapper: WrapperIdentitySchema.optional()
54236
+ wrapper: WrapperIdentitySchema.optional(),
54237
+ /**
54238
+ * What this node PLANNED to run against what its process service reports
54239
+ * (D877). Absent until the one-shot boot check has run (~60 s after boot) and
54240
+ * on a provider that predates it. Absent is "not checked yet", never "all
54241
+ * well": a consumer that needs the answer treats it as pending.
54242
+ */
54243
+ runners: RunnerBootCheckSchema.optional()
54160
54244
  });
54161
54245
  var ServerUpdateCheckResultSchema = zod.z.object({
54162
54246
  packageName: zod.z.string(),
@@ -54207,6 +54291,13 @@ var ServerUpdateOutcomeSchema = zod.z.enum([
54207
54291
  "refused",
54208
54292
  "failed"
54209
54293
  ]);
54294
+ /** One addon the pre-flight found the target version would refuse (D877). */
54295
+ var UpdateBlockerSchema = zod.z.object({
54296
+ addonId: zod.z.string(),
54297
+ reason: zod.z.string(),
54298
+ /** What the operator does about it. */
54299
+ remedy: zod.z.string()
54300
+ });
54210
54301
  var ServerUpdateActionResultSchema = zod.z.object({
54211
54302
  accepted: zod.z.boolean(),
54212
54303
  targetVersion: zod.z.string().nullable(),
@@ -54224,7 +54315,13 @@ var ServerUpdateActionResultSchema = zod.z.object({
54224
54315
  * The failure itself, verbatim enough to act on (the npm output for a
54225
54316
  * staging install). Non-null only for `failed`.
54226
54317
  */
54227
- error: zod.z.string().nullable().optional()
54318
+ error: zod.z.string().nullable().optional(),
54319
+ /**
54320
+ * The addons the target version would refuse to start on this node's live
54321
+ * store (D877), present when the pre-flight refused the update
54322
+ * (`reason: 'addon-would-refuse'`). Optional for version skew.
54323
+ */
54324
+ blockers: zod.z.array(UpdateBlockerSchema).optional()
54228
54325
  });
54229
54326
  var serverManagementCapability = {
54230
54327
  name: "server-management",
@@ -54236,9 +54333,16 @@ var serverManagementCapability = {
54236
54333
  kind: "mutation",
54237
54334
  auth: "admin"
54238
54335
  }),
54239
- applyServerUpdate: require_sleep.method(zod.z.object({
54240
- /** Explicit target version; omitted = latest from the registry. */
54241
- version: zod.z.string().optional() }), ServerUpdateActionResultSchema, {
54336
+ applyServerUpdate: require_sleep.method(zod.z.object({
54337
+ /** Explicit target version; omitted = latest from the registry. */
54338
+ version: zod.z.string().optional(),
54339
+ /**
54340
+ * Apply even though the pre-flight (D877) found addons the target would
54341
+ * refuse to start. Off by default: those addons stay down until the
54342
+ * remedy is run, which is the incident this gate exists to prevent.
54343
+ */
54344
+ acknowledgeRefusals: zod.z.boolean().optional()
54345
+ }), ServerUpdateActionResultSchema, {
54242
54346
  kind: "mutation",
54243
54347
  auth: "admin",
54244
54348
  timeoutMs: 16 * 6e4
@@ -57951,7 +58055,9 @@ var ManifestShapeSchema = zod.z.object({
57951
58055
  var AddonProcessSchema = zod.z.object({
57952
58056
  pid: zod.z.number().optional(),
57953
58057
  mode: zod.z.string(),
57954
- state: zod.z.string()
58058
+ state: zod.z.string(),
58059
+ /** Why the runner is `refused` (an addon's own words), when it is (D877). */
58060
+ reason: zod.z.string().optional()
57955
58061
  });
57956
58062
  /**
57957
58063
  * Per-addon health snapshot from the kernel's AddonHealthMonitor.
@@ -71581,6 +71687,16 @@ var userManagementCapability = {
71581
71687
  access: "delete"
71582
71688
  }),
71583
71689
  getTotpStatus: require_sleep.method(zod.z.object({ userId: zod.z.string() }), TotpStatusSchema, { auth: "admin" }),
71690
+ /**
71691
+ * D878: move every TOTP seed stored in plaintext into the keychain (owner
71692
+ * `system`), leaving a marker in the row. Dry run unless `apply`;
71693
+ * idempotent; counts only.
71694
+ */
71695
+ migrateRawSecrets: require_sleep.method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
71696
+ kind: "mutation",
71697
+ auth: "admin",
71698
+ access: "create"
71699
+ }),
71584
71700
  verifyTotp: require_sleep.method(zod.z.object({
71585
71701
  userId: zod.z.string(),
71586
71702
  code: zod.z.string()
@@ -79682,6 +79798,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
79682
79798
  addonId: null,
79683
79799
  access: "view"
79684
79800
  },
79801
+ "llm.migrateRawSecrets": {
79802
+ capName: "llm",
79803
+ capScope: "system",
79804
+ addonId: null,
79805
+ access: "create"
79806
+ },
79685
79807
  "llm.resolveModelRef": {
79686
79808
  capName: "llm",
79687
79809
  capScope: "system",
@@ -84224,6 +84346,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
84224
84346
  addonId: null,
84225
84347
  access: "view"
84226
84348
  },
84349
+ "userManagement.migrateRawSecrets": {
84350
+ capName: "user-management",
84351
+ capScope: "system",
84352
+ addonId: null,
84353
+ access: "create"
84354
+ },
84227
84355
  "userManagement.oauthExchangeCode": {
84228
84356
  capName: "user-management",
84229
84357
  capScope: "system",
@@ -92105,6 +92233,7 @@ function createSystemProxy(api) {
92105
92233
  listProfileKinds: (input) => dispatch("llm", "listProfileKinds", "query", input),
92106
92234
  listProfiles: (input) => dispatch("llm", "listProfiles", "query", input),
92107
92235
  upsertProfile: (input) => dispatch("llm", "upsertProfile", "mutation", input),
92236
+ migrateRawSecrets: (input) => dispatch("llm", "migrateRawSecrets", "mutation", input),
92108
92237
  deleteProfile: (input) => dispatch("llm", "deleteProfile", "mutation", input),
92109
92238
  testProfile: (input) => dispatch("llm", "testProfile", "mutation", input),
92110
92239
  listModels: (input) => dispatch("llm", "listModels", "query", input),
@@ -92552,6 +92681,7 @@ function createSystemProxy(api) {
92552
92681
  confirmTotp: (input) => dispatch("userManagement", "confirmTotp", "mutation", input),
92553
92682
  disableTotp: (input) => dispatch("userManagement", "disableTotp", "mutation", input),
92554
92683
  getTotpStatus: (input) => dispatch("userManagement", "getTotpStatus", "query", input),
92684
+ migrateRawSecrets: (input) => dispatch("userManagement", "migrateRawSecrets", "mutation", input),
92555
92685
  verifyTotp: (input) => dispatch("userManagement", "verifyTotp", "mutation", input),
92556
92686
  oauthIssueCode: (input) => dispatch("userManagement", "oauthIssueCode", "mutation", input),
92557
92687
  oauthExchangeCode: (input) => dispatch("userManagement", "oauthExchangeCode", "mutation", input),
@@ -102570,6 +102700,8 @@ exports.RUNTIME_DEFAULTS = require_sleep.RUNTIME_DEFAULTS;
102570
102700
  exports.RUNTIME_STATE_POLICY = RUNTIME_STATE_POLICY;
102571
102701
  exports.RUNTIME_STATE_REFRESH_MISS_COOLDOWN_MS = RUNTIME_STATE_REFRESH_MISS_COOLDOWN_MS;
102572
102702
  exports.RUNTIME_TO_FORMAT = RUNTIME_TO_FORMAT;
102703
+ exports.RawSecretMigrationInputSchema = RawSecretMigrationInputSchema;
102704
+ exports.RawSecretMigrationReportSchema = RawSecretMigrationReportSchema;
102573
102705
  exports.RawStateResultSchema = require_sleep.RawStateResultSchema;
102574
102706
  exports.ReadGopBytesResultSchema = ReadGopBytesResultSchema;
102575
102707
  exports.ReadSegmentBytesResultSchema = ReadSegmentBytesResultSchema;
@@ -102686,6 +102818,7 @@ exports.RingBuffer = RingBuffer;
102686
102818
  exports.RootStepSupplySchema = RootStepSupplySchema;
102687
102819
  exports.RtpSourceSchema = RtpSourceSchema;
102688
102820
  exports.RtspRestreamEntrySchema = RtspRestreamEntrySchema;
102821
+ exports.RunnerBootCheckSchema = RunnerBootCheckSchema;
102689
102822
  exports.RunnerCameraConfigSchema = RunnerCameraConfigSchema;
102690
102823
  exports.RunnerCameraDeviceUIFields = RunnerCameraDeviceUIFields;
102691
102824
  exports.RunnerFrameSourceSchema = RunnerFrameSourceSchema;
@@ -102693,6 +102826,7 @@ exports.RunnerInferenceDeviceSchema = RunnerInferenceDeviceSchema;
102693
102826
  exports.RunnerJumpStepProvisioningSchema = RunnerJumpStepProvisioningSchema;
102694
102827
  exports.RunnerLocalLoadSchema = RunnerLocalLoadSchema;
102695
102828
  exports.RunnerLocalMetricsSchema = RunnerLocalMetricsSchema;
102829
+ exports.RunnerRefusalSchema = RunnerRefusalSchema;
102696
102830
  exports.SCENE_CONDITIONS = SCENE_CONDITIONS;
102697
102831
  exports.SCENE_CONFIRM_DEFAULT_MAX_IMAGE_PX = SCENE_CONFIRM_DEFAULT_MAX_IMAGE_PX;
102698
102832
  exports.SCENE_CONFIRM_DEFAULT_TIMEOUT_MS = SCENE_CONFIRM_DEFAULT_TIMEOUT_MS;
@@ -102958,6 +103092,7 @@ exports.UninstallPackageResultSchema = UninstallPackageResultSchema;
102958
103092
  exports.UnitConversionError = UnitConversionError;
102959
103093
  exports.UnstampedEventMediaCountSchema = UnstampedEventMediaCountSchema;
102960
103094
  exports.UnstampedRowsSchema = UnstampedRowsSchema;
103095
+ exports.UpdateBlockerSchema = UpdateBlockerSchema;
102961
103096
  exports.UpdateIntegrationInputSchema = UpdateIntegrationInputSchema;
102962
103097
  exports.UpdateStatusSchema = UpdateStatusSchema;
102963
103098
  exports.UpdateUserInputSchema = UpdateUserInputSchema;