@camstack/addon-export-hap 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.
@@ -5167,14 +5167,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
5167
5167
  EventCategory["DeviceSleeping"] = "device.sleeping";
5168
5168
  EventCategory["RetentionCleanup"] = "retention.cleanup";
5169
5169
  /**
5170
- * Progress snapshot emitted by `BulkUpdateCoordinator` on every state
5171
- * transition (item status change, phase change, completion, cancel).
5172
- * Payload is `BulkUpdateState`. Admin UI subscribes via `useLiveEvent`
5173
- * to drive the sticky `BulkUpdateBanner` and per-row `AddonRowBadge`.
5174
- *
5175
- * Spec: docs/superpowers/specs/2026-05-21-addons-bulk-update-progress-design.md
5170
+ * Legacy bulk-update progress snapshot (payload `BulkUpdateState`). No longer
5171
+ * emitted F3 removed the coordinator that produced it; "Update all" now runs
5172
+ * as one lifecycle engine job (`AddonsJobProgress`/`AddonsJobLog`). Retained
5173
+ * (with `BulkUpdateState`) only to avoid regenerating the event maps; removed
5174
+ * in F4 once live bulk progress is re-implemented over the engine events.
5176
5175
  */
5177
5176
  EventCategory["AddonsBulkUpdateProgress"] = "addons.bulk-update-progress";
5177
+ EventCategory["AddonsJobProgress"] = "addons.job-progress";
5178
+ EventCategory["AddonsJobLog"] = "addons.job-log";
5178
5179
  /**
5179
5180
  * A container's child visibility toggled (hidden/shown). Emitted by the
5180
5181
  * `accessories` cap when a child device is hidden or revealed.
@@ -16073,6 +16074,69 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
16073
16074
  kind: "mutation",
16074
16075
  auth: "admin"
16075
16076
  });
16077
+ var jobKindSchema = _enum([
16078
+ "install",
16079
+ "update",
16080
+ "uninstall",
16081
+ "restart"
16082
+ ]);
16083
+ var taskPhaseSchema = _enum([
16084
+ "queued",
16085
+ "fetching",
16086
+ "staged",
16087
+ "validating",
16088
+ "applying",
16089
+ "restarting",
16090
+ "applied",
16091
+ "done",
16092
+ "failed",
16093
+ "skipped"
16094
+ ]);
16095
+ var taskTargetSchema = _enum(["framework", "addon"]);
16096
+ var taskLogEntrySchema = object({
16097
+ tsMs: number(),
16098
+ nodeId: string(),
16099
+ packageName: string(),
16100
+ phase: taskPhaseSchema,
16101
+ message: string()
16102
+ });
16103
+ var lifecycleTaskSchema = object({
16104
+ taskId: string(),
16105
+ nodeId: string(),
16106
+ packageName: string(),
16107
+ fromVersion: string().nullable(),
16108
+ toVersion: string(),
16109
+ target: taskTargetSchema,
16110
+ phase: taskPhaseSchema,
16111
+ stagedPath: string().nullable(),
16112
+ attempts: number(),
16113
+ steps: array(taskLogEntrySchema),
16114
+ error: string().nullable(),
16115
+ startedAtMs: number().nullable(),
16116
+ finishedAtMs: number().nullable()
16117
+ });
16118
+ var lifecycleJobStateSchema = _enum([
16119
+ "running",
16120
+ "completed",
16121
+ "failed",
16122
+ "partially-failed",
16123
+ "cancelled"
16124
+ ]);
16125
+ var lifecycleJobScopeSchema = _enum([
16126
+ "single",
16127
+ "bulk",
16128
+ "cluster"
16129
+ ]);
16130
+ var lifecycleJobSchema = object({
16131
+ jobId: string(),
16132
+ kind: jobKindSchema,
16133
+ createdAtMs: number(),
16134
+ createdBy: string(),
16135
+ scope: lifecycleJobScopeSchema,
16136
+ tasks: array(lifecycleTaskSchema),
16137
+ state: lifecycleJobStateSchema,
16138
+ schemaVersion: literal(1)
16139
+ });
16076
16140
  /**
16077
16141
  * addons — system-scoped singleton capability for addon package
16078
16142
  * management (install, update, configure, restart) and per-addon log
@@ -16255,7 +16319,7 @@ var BulkUpdatePhaseSchema = _enum([
16255
16319
  "restarting",
16256
16320
  "finalizing"
16257
16321
  ]);
16258
- var BulkUpdateStateSchema = object({
16322
+ object({
16259
16323
  id: string(),
16260
16324
  nodeId: string(),
16261
16325
  startedAtMs: number(),
@@ -16358,20 +16422,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
16358
16422
  }), UpdateFrameworkPackageResultSchema, {
16359
16423
  kind: "mutation",
16360
16424
  auth: "admin"
16361
- }), method(object({
16362
- nodeId: string(),
16363
- items: array(object({
16364
- name: string(),
16365
- version: string(),
16366
- isSystem: boolean()
16367
- })).readonly()
16368
- }), object({ id: string() }), {
16369
- kind: "mutation",
16370
- auth: "admin"
16371
- }), method(object({ id: string() }), BulkUpdateStateSchema.nullable(), { auth: "admin" }), method(object({ id: string() }), object({ cancelled: boolean() }), {
16372
- kind: "mutation",
16373
- auth: "admin"
16374
- }), method(object({ nodeId: string().optional() }), array(BulkUpdateStateSchema).readonly(), { auth: "admin" }), method(object({ name: string() }), array(PackageVersionInfoSchema).readonly()), method(object({ addonId: string() }), RestartAddonResultSchema, {
16425
+ }), method(object({ name: string() }), array(PackageVersionInfoSchema).readonly()), method(object({ addonId: string() }), RestartAddonResultSchema, {
16375
16426
  kind: "mutation",
16376
16427
  auth: "admin"
16377
16428
  }), method(object({ packageName: string() }), object({ success: literal(true) }), {
@@ -16393,6 +16444,24 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
16393
16444
  kind: "mutation",
16394
16445
  auth: "admin"
16395
16446
  }), method(CustomActionInputSchema, unknown(), { kind: "mutation" }), method(object({
16447
+ kind: _enum([
16448
+ "install",
16449
+ "update",
16450
+ "uninstall",
16451
+ "restart"
16452
+ ]),
16453
+ targets: array(object({
16454
+ name: string().min(1),
16455
+ version: string().min(1)
16456
+ })).min(1),
16457
+ nodeIds: array(string()).optional()
16458
+ }), object({ jobId: string() }), {
16459
+ kind: "mutation",
16460
+ auth: "admin"
16461
+ }), method(object({ jobId: string() }), lifecycleJobSchema.nullable(), { auth: "admin" }), method(object({ activeOnly: boolean().optional() }), array(lifecycleJobSchema), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16462
+ kind: "mutation",
16463
+ auth: "admin"
16464
+ }), method(object({
16396
16465
  addonId: string(),
16397
16466
  level: LogLevelSchema$1.optional()
16398
16467
  }), LogStreamEntrySchema, { kind: "subscription" });
@@ -16433,7 +16502,7 @@ Object.freeze({
16433
16502
  addonId: null,
16434
16503
  access: "create"
16435
16504
  },
16436
- "addons.cancelBulkUpdate": {
16505
+ "addons.cancelJob": {
16437
16506
  capName: "addons",
16438
16507
  capScope: "system",
16439
16508
  addonId: null,
@@ -16463,7 +16532,7 @@ Object.freeze({
16463
16532
  addonId: null,
16464
16533
  access: "view"
16465
16534
  },
16466
- "addons.getBulkUpdateState": {
16535
+ "addons.getJob": {
16467
16536
  capName: "addons",
16468
16537
  capScope: "system",
16469
16538
  addonId: null,
@@ -16511,19 +16580,19 @@ Object.freeze({
16511
16580
  addonId: null,
16512
16581
  access: "view"
16513
16582
  },
16514
- "addons.listActiveBulkUpdates": {
16583
+ "addons.listCapabilityProviders": {
16515
16584
  capName: "addons",
16516
16585
  capScope: "system",
16517
16586
  addonId: null,
16518
16587
  access: "view"
16519
16588
  },
16520
- "addons.listCapabilityProviders": {
16589
+ "addons.listFrameworkPackages": {
16521
16590
  capName: "addons",
16522
16591
  capScope: "system",
16523
16592
  addonId: null,
16524
16593
  access: "view"
16525
16594
  },
16526
- "addons.listFrameworkPackages": {
16595
+ "addons.listJobs": {
16527
16596
  capName: "addons",
16528
16597
  capScope: "system",
16529
16598
  addonId: null,
@@ -16607,7 +16676,7 @@ Object.freeze({
16607
16676
  addonId: null,
16608
16677
  access: "create"
16609
16678
  },
16610
- "addons.startBulkUpdate": {
16679
+ "addons.startJob": {
16611
16680
  capName: "addons",
16612
16681
  capScope: "system",
16613
16682
  addonId: null,
@@ -20594,6 +20663,32 @@ Object.freeze({
20594
20663
  "network-access": "ingress",
20595
20664
  "smtp-provider": "email"
20596
20665
  });
20666
+ var frameworkSwapPackageSchema = object({
20667
+ name: string(),
20668
+ stagedPath: string(),
20669
+ backupPath: string(),
20670
+ toVersion: string(),
20671
+ fromVersion: string().nullable()
20672
+ });
20673
+ object({
20674
+ jobId: string(),
20675
+ taskId: string(),
20676
+ packages: array(frameworkSwapPackageSchema),
20677
+ requestedAtMs: number(),
20678
+ schemaVersion: literal(1)
20679
+ });
20680
+ object({
20681
+ jobId: string(),
20682
+ taskId: string(),
20683
+ backups: array(object({
20684
+ name: string(),
20685
+ backupPath: string(),
20686
+ livePath: string()
20687
+ })),
20688
+ appliedAtMs: number(),
20689
+ bootAttempts: number(),
20690
+ schemaVersion: literal(1)
20691
+ });
20597
20692
  /**
20598
20693
  * Deterministic SHA-256 hash of an arbitrary serialisable value. The
20599
20694
  * canonical form sorts object keys alphabetically at every depth so two
@@ -5142,14 +5142,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
5142
5142
  EventCategory["DeviceSleeping"] = "device.sleeping";
5143
5143
  EventCategory["RetentionCleanup"] = "retention.cleanup";
5144
5144
  /**
5145
- * Progress snapshot emitted by `BulkUpdateCoordinator` on every state
5146
- * transition (item status change, phase change, completion, cancel).
5147
- * Payload is `BulkUpdateState`. Admin UI subscribes via `useLiveEvent`
5148
- * to drive the sticky `BulkUpdateBanner` and per-row `AddonRowBadge`.
5149
- *
5150
- * Spec: docs/superpowers/specs/2026-05-21-addons-bulk-update-progress-design.md
5145
+ * Legacy bulk-update progress snapshot (payload `BulkUpdateState`). No longer
5146
+ * emitted F3 removed the coordinator that produced it; "Update all" now runs
5147
+ * as one lifecycle engine job (`AddonsJobProgress`/`AddonsJobLog`). Retained
5148
+ * (with `BulkUpdateState`) only to avoid regenerating the event maps; removed
5149
+ * in F4 once live bulk progress is re-implemented over the engine events.
5151
5150
  */
5152
5151
  EventCategory["AddonsBulkUpdateProgress"] = "addons.bulk-update-progress";
5152
+ EventCategory["AddonsJobProgress"] = "addons.job-progress";
5153
+ EventCategory["AddonsJobLog"] = "addons.job-log";
5153
5154
  /**
5154
5155
  * A container's child visibility toggled (hidden/shown). Emitted by the
5155
5156
  * `accessories` cap when a child device is hidden or revealed.
@@ -16048,6 +16049,69 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
16048
16049
  kind: "mutation",
16049
16050
  auth: "admin"
16050
16051
  });
16052
+ var jobKindSchema = _enum([
16053
+ "install",
16054
+ "update",
16055
+ "uninstall",
16056
+ "restart"
16057
+ ]);
16058
+ var taskPhaseSchema = _enum([
16059
+ "queued",
16060
+ "fetching",
16061
+ "staged",
16062
+ "validating",
16063
+ "applying",
16064
+ "restarting",
16065
+ "applied",
16066
+ "done",
16067
+ "failed",
16068
+ "skipped"
16069
+ ]);
16070
+ var taskTargetSchema = _enum(["framework", "addon"]);
16071
+ var taskLogEntrySchema = object({
16072
+ tsMs: number(),
16073
+ nodeId: string(),
16074
+ packageName: string(),
16075
+ phase: taskPhaseSchema,
16076
+ message: string()
16077
+ });
16078
+ var lifecycleTaskSchema = object({
16079
+ taskId: string(),
16080
+ nodeId: string(),
16081
+ packageName: string(),
16082
+ fromVersion: string().nullable(),
16083
+ toVersion: string(),
16084
+ target: taskTargetSchema,
16085
+ phase: taskPhaseSchema,
16086
+ stagedPath: string().nullable(),
16087
+ attempts: number(),
16088
+ steps: array(taskLogEntrySchema),
16089
+ error: string().nullable(),
16090
+ startedAtMs: number().nullable(),
16091
+ finishedAtMs: number().nullable()
16092
+ });
16093
+ var lifecycleJobStateSchema = _enum([
16094
+ "running",
16095
+ "completed",
16096
+ "failed",
16097
+ "partially-failed",
16098
+ "cancelled"
16099
+ ]);
16100
+ var lifecycleJobScopeSchema = _enum([
16101
+ "single",
16102
+ "bulk",
16103
+ "cluster"
16104
+ ]);
16105
+ var lifecycleJobSchema = object({
16106
+ jobId: string(),
16107
+ kind: jobKindSchema,
16108
+ createdAtMs: number(),
16109
+ createdBy: string(),
16110
+ scope: lifecycleJobScopeSchema,
16111
+ tasks: array(lifecycleTaskSchema),
16112
+ state: lifecycleJobStateSchema,
16113
+ schemaVersion: literal(1)
16114
+ });
16051
16115
  /**
16052
16116
  * addons — system-scoped singleton capability for addon package
16053
16117
  * management (install, update, configure, restart) and per-addon log
@@ -16230,7 +16294,7 @@ var BulkUpdatePhaseSchema = _enum([
16230
16294
  "restarting",
16231
16295
  "finalizing"
16232
16296
  ]);
16233
- var BulkUpdateStateSchema = object({
16297
+ object({
16234
16298
  id: string(),
16235
16299
  nodeId: string(),
16236
16300
  startedAtMs: number(),
@@ -16333,20 +16397,7 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
16333
16397
  }), UpdateFrameworkPackageResultSchema, {
16334
16398
  kind: "mutation",
16335
16399
  auth: "admin"
16336
- }), method(object({
16337
- nodeId: string(),
16338
- items: array(object({
16339
- name: string(),
16340
- version: string(),
16341
- isSystem: boolean()
16342
- })).readonly()
16343
- }), object({ id: string() }), {
16344
- kind: "mutation",
16345
- auth: "admin"
16346
- }), method(object({ id: string() }), BulkUpdateStateSchema.nullable(), { auth: "admin" }), method(object({ id: string() }), object({ cancelled: boolean() }), {
16347
- kind: "mutation",
16348
- auth: "admin"
16349
- }), method(object({ nodeId: string().optional() }), array(BulkUpdateStateSchema).readonly(), { auth: "admin" }), method(object({ name: string() }), array(PackageVersionInfoSchema).readonly()), method(object({ addonId: string() }), RestartAddonResultSchema, {
16400
+ }), method(object({ name: string() }), array(PackageVersionInfoSchema).readonly()), method(object({ addonId: string() }), RestartAddonResultSchema, {
16350
16401
  kind: "mutation",
16351
16402
  auth: "admin"
16352
16403
  }), method(object({ packageName: string() }), object({ success: literal(true) }), {
@@ -16368,6 +16419,24 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
16368
16419
  kind: "mutation",
16369
16420
  auth: "admin"
16370
16421
  }), method(CustomActionInputSchema, unknown(), { kind: "mutation" }), method(object({
16422
+ kind: _enum([
16423
+ "install",
16424
+ "update",
16425
+ "uninstall",
16426
+ "restart"
16427
+ ]),
16428
+ targets: array(object({
16429
+ name: string().min(1),
16430
+ version: string().min(1)
16431
+ })).min(1),
16432
+ nodeIds: array(string()).optional()
16433
+ }), object({ jobId: string() }), {
16434
+ kind: "mutation",
16435
+ auth: "admin"
16436
+ }), method(object({ jobId: string() }), lifecycleJobSchema.nullable(), { auth: "admin" }), method(object({ activeOnly: boolean().optional() }), array(lifecycleJobSchema), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16437
+ kind: "mutation",
16438
+ auth: "admin"
16439
+ }), method(object({
16371
16440
  addonId: string(),
16372
16441
  level: LogLevelSchema$1.optional()
16373
16442
  }), LogStreamEntrySchema, { kind: "subscription" });
@@ -16408,7 +16477,7 @@ Object.freeze({
16408
16477
  addonId: null,
16409
16478
  access: "create"
16410
16479
  },
16411
- "addons.cancelBulkUpdate": {
16480
+ "addons.cancelJob": {
16412
16481
  capName: "addons",
16413
16482
  capScope: "system",
16414
16483
  addonId: null,
@@ -16438,7 +16507,7 @@ Object.freeze({
16438
16507
  addonId: null,
16439
16508
  access: "view"
16440
16509
  },
16441
- "addons.getBulkUpdateState": {
16510
+ "addons.getJob": {
16442
16511
  capName: "addons",
16443
16512
  capScope: "system",
16444
16513
  addonId: null,
@@ -16486,19 +16555,19 @@ Object.freeze({
16486
16555
  addonId: null,
16487
16556
  access: "view"
16488
16557
  },
16489
- "addons.listActiveBulkUpdates": {
16558
+ "addons.listCapabilityProviders": {
16490
16559
  capName: "addons",
16491
16560
  capScope: "system",
16492
16561
  addonId: null,
16493
16562
  access: "view"
16494
16563
  },
16495
- "addons.listCapabilityProviders": {
16564
+ "addons.listFrameworkPackages": {
16496
16565
  capName: "addons",
16497
16566
  capScope: "system",
16498
16567
  addonId: null,
16499
16568
  access: "view"
16500
16569
  },
16501
- "addons.listFrameworkPackages": {
16570
+ "addons.listJobs": {
16502
16571
  capName: "addons",
16503
16572
  capScope: "system",
16504
16573
  addonId: null,
@@ -16582,7 +16651,7 @@ Object.freeze({
16582
16651
  addonId: null,
16583
16652
  access: "create"
16584
16653
  },
16585
- "addons.startBulkUpdate": {
16654
+ "addons.startJob": {
16586
16655
  capName: "addons",
16587
16656
  capScope: "system",
16588
16657
  addonId: null,
@@ -20569,6 +20638,32 @@ Object.freeze({
20569
20638
  "network-access": "ingress",
20570
20639
  "smtp-provider": "email"
20571
20640
  });
20641
+ var frameworkSwapPackageSchema = object({
20642
+ name: string(),
20643
+ stagedPath: string(),
20644
+ backupPath: string(),
20645
+ toVersion: string(),
20646
+ fromVersion: string().nullable()
20647
+ });
20648
+ object({
20649
+ jobId: string(),
20650
+ taskId: string(),
20651
+ packages: array(frameworkSwapPackageSchema),
20652
+ requestedAtMs: number(),
20653
+ schemaVersion: literal(1)
20654
+ });
20655
+ object({
20656
+ jobId: string(),
20657
+ taskId: string(),
20658
+ backups: array(object({
20659
+ name: string(),
20660
+ backupPath: string(),
20661
+ livePath: string()
20662
+ })),
20663
+ appliedAtMs: number(),
20664
+ bootAttempts: number(),
20665
+ schemaVersion: literal(1)
20666
+ });
20572
20667
  /**
20573
20668
  * Deterministic SHA-256 hash of an arbitrary serialisable value. The
20574
20669
  * canonical form sorts object keys alphabetically at every depth so two
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-export-hap",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "HomeKit (HAP) bridge exporter for CamStack devices. Publishes a bridged accessory per exposed device — MotionSensor in this MVP; Camera/Doorbell/Switch/Light follow.",
5
5
  "keywords": [
6
6
  "camstack",