@camstack/types 1.2.376 → 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.
Files changed (35) hide show
  1. package/dist/addon.js +15 -3
  2. package/dist/addon.mjs +15 -3
  3. package/dist/capabilities/addons.cap.d.ts +2 -0
  4. package/dist/capabilities/climate-control.cap.d.ts +9 -0
  5. package/dist/capabilities/index.d.ts +2 -1
  6. package/dist/capabilities/llm.cap.d.ts +19 -0
  7. package/dist/capabilities/raw-secret-migration.d.ts +25 -0
  8. package/dist/capabilities/server-management.cap.d.ts +89 -1
  9. package/dist/capabilities/user-management.cap.d.ts +18 -0
  10. package/dist/client.js +2 -0
  11. package/dist/client.mjs +2 -0
  12. package/dist/{composition-DIp0uE_b.js → composition-CUAOHZ38.js} +1 -1
  13. package/dist/{composition-EQ9Ok0Ee.mjs → composition-DOwQB_Ua.mjs} +1 -1
  14. package/dist/device/device-type.d.ts +3 -0
  15. package/dist/enums/event-category.d.ts +18 -0
  16. package/dist/enums.js +1 -1
  17. package/dist/enums.mjs +1 -1
  18. package/dist/{err-msg-DLerKiVO.mjs → err-msg--2RrYiLO.mjs} +3 -0
  19. package/dist/{err-msg-Ls8Q6dHO.js → err-msg-Bb-s4Xuj.js} +3 -0
  20. package/dist/{event-category-C4hVnRo8.mjs → event-category-BvOFi6PY.mjs} +18 -0
  21. package/dist/{event-category-T43rdQWR.js → event-category-Hoe-mqbd.js} +18 -0
  22. package/dist/generated/addon-api.d.ts +14 -0
  23. package/dist/generated/addon-cap-facts.d.ts +1 -1
  24. package/dist/generated/method-access-map.d.ts +1 -1
  25. package/dist/generated/system-proxy.d.ts +2 -2
  26. package/dist/index.js +151 -10
  27. package/dist/index.mjs +147 -11
  28. package/dist/interfaces/addon.d.ts +4 -1
  29. package/dist/interfaces/agent.d.ts +15 -0
  30. package/dist/interfaces/event-bus.d.ts +35 -0
  31. package/dist/node.js +2 -2
  32. package/dist/node.mjs +2 -2
  33. package/dist/{sleep-bwsTj221.mjs → sleep-bgZLodYc.mjs} +1 -1
  34. package/dist/{sleep-Dq0Uyeh0.js → sleep-gxUz0C9M.js} +1 -1
  35. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
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");
4
- const require_composition = require("./composition-DIp0uE_b.js");
2
+ const require_sleep = require("./sleep-gxUz0C9M.js");
3
+ const require_event_category = require("./event-category-Hoe-mqbd.js");
4
+ const require_composition = require("./composition-CUAOHZ38.js");
5
5
  const require_node_color = require("./node-color.js");
6
- const require_err_msg = require("./err-msg-Ls8Q6dHO.js");
6
+ const require_err_msg = require("./err-msg-Bb-s4Xuj.js");
7
7
  const require_enums = require("./enums.js");
8
8
  let zod = require("zod");
9
9
  //#region src/media/media-owner-key.ts
@@ -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.
@@ -59701,6 +59807,12 @@ var ClimateControlStatusSchema = zod.z.object({
59701
59807
  /** Horizontal louver swing on/off. Null when the device has no
59702
59808
  * horizontal swing surface (gate with `DeviceFeature.ClimateSwingHorizontal`). */
59703
59809
  swingHorizontal: zod.z.boolean().nullable(),
59810
+ /** Lowest setpoint the device accepts, Celsius. Absent / null = not reported. */
59811
+ minTemp: zod.z.number().nullable().optional(),
59812
+ /** Highest setpoint the device accepts, Celsius. Absent / null = not reported. */
59813
+ maxTemp: zod.z.number().nullable().optional(),
59814
+ /** Setpoint granularity, Celsius (0.5, 1). Absent / null = not reported. */
59815
+ tempStep: zod.z.number().positive().nullable().optional(),
59704
59816
  /** Ms epoch when the slice was last updated (push or command). */
59705
59817
  lastFetchedAt: zod.z.number()
59706
59818
  });
@@ -71575,6 +71687,16 @@ var userManagementCapability = {
71575
71687
  access: "delete"
71576
71688
  }),
71577
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
+ }),
71578
71700
  verifyTotp: require_sleep.method(zod.z.object({
71579
71701
  userId: zod.z.string(),
71580
71702
  code: zod.z.string()
@@ -79676,6 +79798,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
79676
79798
  addonId: null,
79677
79799
  access: "view"
79678
79800
  },
79801
+ "llm.migrateRawSecrets": {
79802
+ capName: "llm",
79803
+ capScope: "system",
79804
+ addonId: null,
79805
+ access: "create"
79806
+ },
79679
79807
  "llm.resolveModelRef": {
79680
79808
  capName: "llm",
79681
79809
  capScope: "system",
@@ -84218,6 +84346,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
84218
84346
  addonId: null,
84219
84347
  access: "view"
84220
84348
  },
84349
+ "userManagement.migrateRawSecrets": {
84350
+ capName: "user-management",
84351
+ capScope: "system",
84352
+ addonId: null,
84353
+ access: "create"
84354
+ },
84221
84355
  "userManagement.oauthExchangeCode": {
84222
84356
  capName: "user-management",
84223
84357
  capScope: "system",
@@ -92099,6 +92233,7 @@ function createSystemProxy(api) {
92099
92233
  listProfileKinds: (input) => dispatch("llm", "listProfileKinds", "query", input),
92100
92234
  listProfiles: (input) => dispatch("llm", "listProfiles", "query", input),
92101
92235
  upsertProfile: (input) => dispatch("llm", "upsertProfile", "mutation", input),
92236
+ migrateRawSecrets: (input) => dispatch("llm", "migrateRawSecrets", "mutation", input),
92102
92237
  deleteProfile: (input) => dispatch("llm", "deleteProfile", "mutation", input),
92103
92238
  testProfile: (input) => dispatch("llm", "testProfile", "mutation", input),
92104
92239
  listModels: (input) => dispatch("llm", "listModels", "query", input),
@@ -92546,6 +92681,7 @@ function createSystemProxy(api) {
92546
92681
  confirmTotp: (input) => dispatch("userManagement", "confirmTotp", "mutation", input),
92547
92682
  disableTotp: (input) => dispatch("userManagement", "disableTotp", "mutation", input),
92548
92683
  getTotpStatus: (input) => dispatch("userManagement", "getTotpStatus", "query", input),
92684
+ migrateRawSecrets: (input) => dispatch("userManagement", "migrateRawSecrets", "mutation", input),
92549
92685
  verifyTotp: (input) => dispatch("userManagement", "verifyTotp", "mutation", input),
92550
92686
  oauthIssueCode: (input) => dispatch("userManagement", "oauthIssueCode", "mutation", input),
92551
92687
  oauthExchangeCode: (input) => dispatch("userManagement", "oauthExchangeCode", "mutation", input),
@@ -102564,6 +102700,8 @@ exports.RUNTIME_DEFAULTS = require_sleep.RUNTIME_DEFAULTS;
102564
102700
  exports.RUNTIME_STATE_POLICY = RUNTIME_STATE_POLICY;
102565
102701
  exports.RUNTIME_STATE_REFRESH_MISS_COOLDOWN_MS = RUNTIME_STATE_REFRESH_MISS_COOLDOWN_MS;
102566
102702
  exports.RUNTIME_TO_FORMAT = RUNTIME_TO_FORMAT;
102703
+ exports.RawSecretMigrationInputSchema = RawSecretMigrationInputSchema;
102704
+ exports.RawSecretMigrationReportSchema = RawSecretMigrationReportSchema;
102567
102705
  exports.RawStateResultSchema = require_sleep.RawStateResultSchema;
102568
102706
  exports.ReadGopBytesResultSchema = ReadGopBytesResultSchema;
102569
102707
  exports.ReadSegmentBytesResultSchema = ReadSegmentBytesResultSchema;
@@ -102680,6 +102818,7 @@ exports.RingBuffer = RingBuffer;
102680
102818
  exports.RootStepSupplySchema = RootStepSupplySchema;
102681
102819
  exports.RtpSourceSchema = RtpSourceSchema;
102682
102820
  exports.RtspRestreamEntrySchema = RtspRestreamEntrySchema;
102821
+ exports.RunnerBootCheckSchema = RunnerBootCheckSchema;
102683
102822
  exports.RunnerCameraConfigSchema = RunnerCameraConfigSchema;
102684
102823
  exports.RunnerCameraDeviceUIFields = RunnerCameraDeviceUIFields;
102685
102824
  exports.RunnerFrameSourceSchema = RunnerFrameSourceSchema;
@@ -102687,6 +102826,7 @@ exports.RunnerInferenceDeviceSchema = RunnerInferenceDeviceSchema;
102687
102826
  exports.RunnerJumpStepProvisioningSchema = RunnerJumpStepProvisioningSchema;
102688
102827
  exports.RunnerLocalLoadSchema = RunnerLocalLoadSchema;
102689
102828
  exports.RunnerLocalMetricsSchema = RunnerLocalMetricsSchema;
102829
+ exports.RunnerRefusalSchema = RunnerRefusalSchema;
102690
102830
  exports.SCENE_CONDITIONS = SCENE_CONDITIONS;
102691
102831
  exports.SCENE_CONFIRM_DEFAULT_MAX_IMAGE_PX = SCENE_CONFIRM_DEFAULT_MAX_IMAGE_PX;
102692
102832
  exports.SCENE_CONFIRM_DEFAULT_TIMEOUT_MS = SCENE_CONFIRM_DEFAULT_TIMEOUT_MS;
@@ -102952,6 +103092,7 @@ exports.UninstallPackageResultSchema = UninstallPackageResultSchema;
102952
103092
  exports.UnitConversionError = UnitConversionError;
102953
103093
  exports.UnstampedEventMediaCountSchema = UnstampedEventMediaCountSchema;
102954
103094
  exports.UnstampedRowsSchema = UnstampedRowsSchema;
103095
+ exports.UpdateBlockerSchema = UpdateBlockerSchema;
102955
103096
  exports.UpdateIntegrationInputSchema = UpdateIntegrationInputSchema;
102956
103097
  exports.UpdateStatusSchema = UpdateStatusSchema;
102957
103098
  exports.UpdateUserInputSchema = UpdateUserInputSchema;