@camstack/types 1.0.2 → 1.0.4

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.
@@ -63,9 +63,9 @@ declare const AddonListItemSchema: z.ZodObject<{
63
63
  hasBackup: z.ZodOptional<z.ZodBoolean>;
64
64
  health: z.ZodOptional<z.ZodNullable<z.ZodObject<{
65
65
  phase: z.ZodEnum<{
66
+ failed: "failed";
66
67
  pending: "pending";
67
68
  healthy: "healthy";
68
- failed: "failed";
69
69
  }>;
70
70
  retryCount: z.ZodNumber;
71
71
  firstFailureAt: z.ZodNullable<z.ZodNumber>;
@@ -143,10 +143,10 @@ declare const UpdateFrameworkPackageResultSchema: z.ZodObject<{
143
143
  restartingAt: z.ZodNumber;
144
144
  }, z.core.$strip>;
145
145
  declare const BulkUpdateItemStatusSchema: z.ZodEnum<{
146
- failed: "failed";
147
146
  queued: "queued";
148
- updating: "updating";
149
147
  done: "done";
148
+ failed: "failed";
149
+ updating: "updating";
150
150
  "done-pending-restart": "done-pending-restart";
151
151
  }>;
152
152
  declare const BulkUpdateItemSchema: z.ZodObject<{
@@ -155,10 +155,10 @@ declare const BulkUpdateItemSchema: z.ZodObject<{
155
155
  fromVersion: z.ZodString;
156
156
  toVersion: z.ZodString;
157
157
  status: z.ZodEnum<{
158
- failed: "failed";
159
158
  queued: "queued";
160
- updating: "updating";
161
159
  done: "done";
160
+ failed: "failed";
161
+ updating: "updating";
162
162
  "done-pending-restart": "done-pending-restart";
163
163
  }>;
164
164
  error: z.ZodOptional<z.ZodString>;
@@ -167,8 +167,8 @@ declare const BulkUpdateItemSchema: z.ZodObject<{
167
167
  }, z.core.$strip>;
168
168
  declare const BulkUpdatePhaseSchema: z.ZodEnum<{
169
169
  system: "system";
170
- regular: "regular";
171
170
  restarting: "restarting";
171
+ regular: "regular";
172
172
  finalizing: "finalizing";
173
173
  }>;
174
174
  declare const BulkUpdateStateSchema: z.ZodObject<{
@@ -182,8 +182,8 @@ declare const BulkUpdateStateSchema: z.ZodObject<{
182
182
  current: z.ZodNullable<z.ZodString>;
183
183
  phase: z.ZodEnum<{
184
184
  system: "system";
185
- regular: "regular";
186
185
  restarting: "restarting";
186
+ regular: "regular";
187
187
  finalizing: "finalizing";
188
188
  }>;
189
189
  cancelled: z.ZodBoolean;
@@ -193,10 +193,10 @@ declare const BulkUpdateStateSchema: z.ZodObject<{
193
193
  fromVersion: z.ZodString;
194
194
  toVersion: z.ZodString;
195
195
  status: z.ZodEnum<{
196
- failed: "failed";
197
196
  queued: "queued";
198
- updating: "updating";
199
197
  done: "done";
198
+ failed: "failed";
199
+ updating: "updating";
200
200
  "done-pending-restart": "done-pending-restart";
201
201
  }>;
202
202
  error: z.ZodOptional<z.ZodString>;
@@ -281,9 +281,9 @@ export declare const addonsCapability: {
281
281
  hasBackup: z.ZodOptional<z.ZodBoolean>;
282
282
  health: z.ZodOptional<z.ZodNullable<z.ZodObject<{
283
283
  phase: z.ZodEnum<{
284
+ failed: "failed";
284
285
  pending: "pending";
285
286
  healthy: "healthy";
286
- failed: "failed";
287
287
  }>;
288
288
  retryCount: z.ZodNumber;
289
289
  firstFailureAt: z.ZodNullable<z.ZodNumber>;
@@ -509,122 +509,6 @@ export declare const addonsCapability: {
509
509
  toVersion: z.ZodString;
510
510
  restartingAt: z.ZodNumber;
511
511
  }, z.core.$strip>, "mutation">;
512
- /**
513
- * Kicks off a server-side bulk update operation and returns the bulk
514
- * id immediately. The operation runs asynchronously; observe progress
515
- * via the `AddonsBulkUpdateProgress` event or `getBulkUpdateState`.
516
- * Items with `isSystem: true` use `deferRestart` — the hub restarts
517
- * ONCE at the end of the system phase, after all system packages are
518
- * installed.
519
- *
520
- * `items[].version` is REQUIRED — callers must pass the resolved
521
- * version from `listUpdates`. There is no `'latest'` default here
522
- * (unlike `updatePackage`) to guarantee deterministic bulk rolls.
523
- */
524
- readonly startBulkUpdate: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
525
- nodeId: z.ZodString;
526
- items: z.ZodReadonly<z.ZodArray<z.ZodObject<{
527
- name: z.ZodString;
528
- version: z.ZodString;
529
- isSystem: z.ZodBoolean;
530
- }, z.core.$strip>>>;
531
- }, z.core.$strip>, z.ZodObject<{
532
- id: z.ZodString;
533
- }, z.core.$strip>, "mutation">;
534
- /**
535
- * Returns the current state of a bulk update by id.
536
- * Returns `null` if the id is unknown or has been auto-cleaned
537
- * (5 minutes after `completedAt` the record is evicted from memory).
538
- */
539
- readonly getBulkUpdateState: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
540
- id: z.ZodString;
541
- }, z.core.$strip>, z.ZodNullable<z.ZodObject<{
542
- id: z.ZodString;
543
- nodeId: z.ZodString;
544
- startedAtMs: z.ZodNumber;
545
- completedAtMs: z.ZodOptional<z.ZodNumber>;
546
- total: z.ZodNumber;
547
- completed: z.ZodNumber;
548
- failed: z.ZodNumber;
549
- current: z.ZodNullable<z.ZodString>;
550
- phase: z.ZodEnum<{
551
- system: "system";
552
- regular: "regular";
553
- restarting: "restarting";
554
- finalizing: "finalizing";
555
- }>;
556
- cancelled: z.ZodBoolean;
557
- items: z.ZodReadonly<z.ZodArray<z.ZodObject<{
558
- name: z.ZodString;
559
- isSystem: z.ZodBoolean;
560
- fromVersion: z.ZodString;
561
- toVersion: z.ZodString;
562
- status: z.ZodEnum<{
563
- failed: "failed";
564
- queued: "queued";
565
- updating: "updating";
566
- done: "done";
567
- "done-pending-restart": "done-pending-restart";
568
- }>;
569
- error: z.ZodOptional<z.ZodString>;
570
- startedAtMs: z.ZodOptional<z.ZodNumber>;
571
- completedAtMs: z.ZodOptional<z.ZodNumber>;
572
- }, z.core.$strip>>>;
573
- }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
574
- /**
575
- * Cancels an in-flight bulk update. The update loop exits after the
576
- * currently-processing item completes — cancellation is not
577
- * instantaneous. Has no effect once the `restarting` phase has been
578
- * entered (the hub is already shutting down at that point).
579
- * Returns `{ cancelled: false }` if the id is unknown, the operation
580
- * has already completed, or the `restarting` phase is active.
581
- */
582
- readonly cancelBulkUpdate: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
583
- id: z.ZodString;
584
- }, z.core.$strip>, z.ZodObject<{
585
- cancelled: z.ZodBoolean;
586
- }, z.core.$strip>, "mutation">;
587
- /**
588
- * Lists all currently active (non-completed) bulk updates.
589
- * If `nodeId` is provided, filters to only bulk updates targeting
590
- * that node. Useful for restoring an in-progress banner on a fresh
591
- * page load when the UI reconnects mid-operation.
592
- */
593
- readonly listActiveBulkUpdates: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
594
- nodeId: z.ZodOptional<z.ZodString>;
595
- }, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
596
- id: z.ZodString;
597
- nodeId: z.ZodString;
598
- startedAtMs: z.ZodNumber;
599
- completedAtMs: z.ZodOptional<z.ZodNumber>;
600
- total: z.ZodNumber;
601
- completed: z.ZodNumber;
602
- failed: z.ZodNumber;
603
- current: z.ZodNullable<z.ZodString>;
604
- phase: z.ZodEnum<{
605
- system: "system";
606
- regular: "regular";
607
- restarting: "restarting";
608
- finalizing: "finalizing";
609
- }>;
610
- cancelled: z.ZodBoolean;
611
- items: z.ZodReadonly<z.ZodArray<z.ZodObject<{
612
- name: z.ZodString;
613
- isSystem: z.ZodBoolean;
614
- fromVersion: z.ZodString;
615
- toVersion: z.ZodString;
616
- status: z.ZodEnum<{
617
- failed: "failed";
618
- queued: "queued";
619
- updating: "updating";
620
- done: "done";
621
- "done-pending-restart": "done-pending-restart";
622
- }>;
623
- error: z.ZodOptional<z.ZodString>;
624
- startedAtMs: z.ZodOptional<z.ZodNumber>;
625
- completedAtMs: z.ZodOptional<z.ZodNumber>;
626
- }, z.core.$strip>>>;
627
- }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
628
512
  readonly getVersions: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
629
513
  name: z.ZodString;
630
514
  }, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
@@ -694,6 +578,193 @@ export declare const addonsCapability: {
694
578
  action: z.ZodString;
695
579
  input: z.ZodUnknown;
696
580
  }, z.core.$strip>, z.ZodUnknown, "mutation">;
581
+ /**
582
+ * Start a lifecycle job (install / update / uninstall / restart) for one
583
+ * or more addon packages. Returns the `jobId` immediately — the job runs
584
+ * asynchronously. Observe progress via `EventCategory.AddonsJobProgress` /
585
+ * `AddonsJobLog` events or poll `getJob`.
586
+ *
587
+ * For a single-addon update on the hub the provider also routes
588
+ * `updatePackage` through this path so the fast swap + atomic-restart
589
+ * path (`applyStagedAddonUpdate`) is always used.
590
+ */
591
+ readonly startJob: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
592
+ kind: z.ZodEnum<{
593
+ update: "update";
594
+ install: "install";
595
+ uninstall: "uninstall";
596
+ restart: "restart";
597
+ }>;
598
+ targets: z.ZodArray<z.ZodObject<{
599
+ name: z.ZodString;
600
+ version: z.ZodString;
601
+ }, z.core.$strip>>;
602
+ nodeIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
603
+ }, z.core.$strip>, z.ZodObject<{
604
+ jobId: z.ZodString;
605
+ }, z.core.$strip>, "mutation">;
606
+ /**
607
+ * Retrieve a lifecycle job by id. Returns `null` when the id is unknown
608
+ * (e.g. evicted after the retention window).
609
+ */
610
+ readonly getJob: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
611
+ jobId: z.ZodString;
612
+ }, z.core.$strip>, z.ZodNullable<z.ZodObject<{
613
+ jobId: z.ZodString;
614
+ kind: z.ZodEnum<{
615
+ update: "update";
616
+ install: "install";
617
+ uninstall: "uninstall";
618
+ restart: "restart";
619
+ }>;
620
+ createdAtMs: z.ZodNumber;
621
+ createdBy: z.ZodString;
622
+ scope: z.ZodEnum<{
623
+ single: "single";
624
+ bulk: "bulk";
625
+ cluster: "cluster";
626
+ }>;
627
+ tasks: z.ZodArray<z.ZodObject<{
628
+ taskId: z.ZodString;
629
+ nodeId: z.ZodString;
630
+ packageName: z.ZodString;
631
+ fromVersion: z.ZodNullable<z.ZodString>;
632
+ toVersion: z.ZodString;
633
+ target: z.ZodEnum<{
634
+ addon: "addon";
635
+ framework: "framework";
636
+ }>;
637
+ phase: z.ZodEnum<{
638
+ queued: "queued";
639
+ fetching: "fetching";
640
+ staged: "staged";
641
+ validating: "validating";
642
+ applying: "applying";
643
+ restarting: "restarting";
644
+ applied: "applied";
645
+ done: "done";
646
+ failed: "failed";
647
+ skipped: "skipped";
648
+ }>;
649
+ stagedPath: z.ZodNullable<z.ZodString>;
650
+ attempts: z.ZodNumber;
651
+ steps: z.ZodArray<z.ZodObject<{
652
+ tsMs: z.ZodNumber;
653
+ nodeId: z.ZodString;
654
+ packageName: z.ZodString;
655
+ phase: z.ZodEnum<{
656
+ queued: "queued";
657
+ fetching: "fetching";
658
+ staged: "staged";
659
+ validating: "validating";
660
+ applying: "applying";
661
+ restarting: "restarting";
662
+ applied: "applied";
663
+ done: "done";
664
+ failed: "failed";
665
+ skipped: "skipped";
666
+ }>;
667
+ message: z.ZodString;
668
+ }, z.core.$strip>>;
669
+ error: z.ZodNullable<z.ZodString>;
670
+ startedAtMs: z.ZodNullable<z.ZodNumber>;
671
+ finishedAtMs: z.ZodNullable<z.ZodNumber>;
672
+ }, z.core.$strip>>;
673
+ state: z.ZodEnum<{
674
+ running: "running";
675
+ failed: "failed";
676
+ completed: "completed";
677
+ "partially-failed": "partially-failed";
678
+ cancelled: "cancelled";
679
+ }>;
680
+ schemaVersion: z.ZodLiteral<1>;
681
+ }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
682
+ /**
683
+ * List lifecycle jobs. When `activeOnly` is true, only jobs still in
684
+ * `running` state are returned.
685
+ */
686
+ readonly listJobs: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
687
+ activeOnly: z.ZodOptional<z.ZodBoolean>;
688
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
689
+ jobId: z.ZodString;
690
+ kind: z.ZodEnum<{
691
+ update: "update";
692
+ install: "install";
693
+ uninstall: "uninstall";
694
+ restart: "restart";
695
+ }>;
696
+ createdAtMs: z.ZodNumber;
697
+ createdBy: z.ZodString;
698
+ scope: z.ZodEnum<{
699
+ single: "single";
700
+ bulk: "bulk";
701
+ cluster: "cluster";
702
+ }>;
703
+ tasks: z.ZodArray<z.ZodObject<{
704
+ taskId: z.ZodString;
705
+ nodeId: z.ZodString;
706
+ packageName: z.ZodString;
707
+ fromVersion: z.ZodNullable<z.ZodString>;
708
+ toVersion: z.ZodString;
709
+ target: z.ZodEnum<{
710
+ addon: "addon";
711
+ framework: "framework";
712
+ }>;
713
+ phase: z.ZodEnum<{
714
+ queued: "queued";
715
+ fetching: "fetching";
716
+ staged: "staged";
717
+ validating: "validating";
718
+ applying: "applying";
719
+ restarting: "restarting";
720
+ applied: "applied";
721
+ done: "done";
722
+ failed: "failed";
723
+ skipped: "skipped";
724
+ }>;
725
+ stagedPath: z.ZodNullable<z.ZodString>;
726
+ attempts: z.ZodNumber;
727
+ steps: z.ZodArray<z.ZodObject<{
728
+ tsMs: z.ZodNumber;
729
+ nodeId: z.ZodString;
730
+ packageName: z.ZodString;
731
+ phase: z.ZodEnum<{
732
+ queued: "queued";
733
+ fetching: "fetching";
734
+ staged: "staged";
735
+ validating: "validating";
736
+ applying: "applying";
737
+ restarting: "restarting";
738
+ applied: "applied";
739
+ done: "done";
740
+ failed: "failed";
741
+ skipped: "skipped";
742
+ }>;
743
+ message: z.ZodString;
744
+ }, z.core.$strip>>;
745
+ error: z.ZodNullable<z.ZodString>;
746
+ startedAtMs: z.ZodNullable<z.ZodNumber>;
747
+ finishedAtMs: z.ZodNullable<z.ZodNumber>;
748
+ }, z.core.$strip>>;
749
+ state: z.ZodEnum<{
750
+ running: "running";
751
+ failed: "failed";
752
+ completed: "completed";
753
+ "partially-failed": "partially-failed";
754
+ cancelled: "cancelled";
755
+ }>;
756
+ schemaVersion: z.ZodLiteral<1>;
757
+ }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
758
+ /**
759
+ * Cancel a lifecycle job that is queued but not yet actively running.
760
+ * Returns `{ cancelled: false }` if the job is unknown, already in a
761
+ * terminal state, or actively executing (cannot abort mid-flight).
762
+ */
763
+ readonly cancelJob: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
764
+ jobId: z.ZodString;
765
+ }, z.core.$strip>, z.ZodObject<{
766
+ cancelled: z.ZodBoolean;
767
+ }, z.core.$strip>, "mutation">;
697
768
  readonly onAddonLogs: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
698
769
  addonId: z.ZodString;
699
770
  level: z.ZodOptional<z.ZodEnum<{
@@ -444,14 +444,15 @@ export declare enum EventCategory {
444
444
  DeviceSleeping = "device.sleeping",
445
445
  RetentionCleanup = "retention.cleanup",
446
446
  /**
447
- * Progress snapshot emitted by `BulkUpdateCoordinator` on every state
448
- * transition (item status change, phase change, completion, cancel).
449
- * Payload is `BulkUpdateState`. Admin UI subscribes via `useLiveEvent`
450
- * to drive the sticky `BulkUpdateBanner` and per-row `AddonRowBadge`.
451
- *
452
- * Spec: docs/superpowers/specs/2026-05-21-addons-bulk-update-progress-design.md
447
+ * Legacy bulk-update progress snapshot (payload `BulkUpdateState`). No longer
448
+ * emitted F3 removed the coordinator that produced it; "Update all" now runs
449
+ * as one lifecycle engine job (`AddonsJobProgress`/`AddonsJobLog`). Retained
450
+ * (with `BulkUpdateState`) only to avoid regenerating the event maps; removed
451
+ * in F4 once live bulk progress is re-implemented over the engine events.
453
452
  */
454
453
  AddonsBulkUpdateProgress = "addons.bulk-update-progress",
454
+ AddonsJobProgress = "addons.job-progress",
455
+ AddonsJobLog = "addons.job-log",
455
456
  /**
456
457
  * A container's child visibility toggled (hidden/shown). Emitted by the
457
458
  * `accessories` cap when a child device is hidden or revealed.