@camstack/addon-export-hap 0.1.2 → 0.1.3

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 (42) hide show
  1. package/dist/export-hap.addon.js +140 -47
  2. package/dist/export-hap.addon.js.map +1 -1
  3. package/dist/export-hap.addon.mjs +140 -47
  4. package/dist/export-hap.addon.mjs.map +1 -1
  5. package/package.json +3 -29
  6. package/dist/@mf-types/compiled-types/page/HomeKitOverviewPage.d.ts +0 -24
  7. package/dist/@mf-types/compiled-types/page/HomeKitOverviewPage.d.ts.map +0 -1
  8. package/dist/@mf-types/compiled-types/page/page.d.ts +0 -12
  9. package/dist/@mf-types/compiled-types/page/page.d.ts.map +0 -1
  10. package/dist/@mf-types/page.d.ts +0 -2
  11. package/dist/@mf-types.d.ts +0 -3
  12. package/dist/@mf-types.zip +0 -0
  13. package/dist/__mfe_internal__addon_export_hap_page__loadShare___mf_0_camstack_mf_1_sdk__loadShare__.mjs-B7qZNHZC.mjs +0 -12
  14. package/dist/__mfe_internal__addon_export_hap_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.mjs-B3wGuKgV.mjs +0 -12
  15. package/dist/__mfe_internal__addon_export_hap_page__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-D4zYQtXk.mjs +0 -73
  16. package/dist/__mfe_internal__addon_export_hap_page__loadShare___mf_0_trpc_mf_1_client__loadShare__.mjs-DrrRnQpW.mjs +0 -42
  17. package/dist/__mfe_internal__addon_export_hap_page__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs-BEeMNLCX.mjs +0 -46
  18. package/dist/__mfe_internal__addon_export_hap_page__loadShare__react__loadShare__.mjs-BPYrKf_3.mjs +0 -56
  19. package/dist/__mfe_internal__addon_export_hap_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-x684zh94.mjs +0 -18
  20. package/dist/__mfe_internal__addon_export_hap_page__loadShare__react_mf_2_dom__loadShare__.mjs-CHMNar3q.mjs +0 -28
  21. package/dist/__mfe_internal__addon_export_hap_page__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-CM8j15CX.mjs +0 -18
  22. package/dist/_stub.js +0 -3223
  23. package/dist/_virtual_mf-localSharedImportMap___mfe_internal__addon_export_hap_page-DtbdD5CL.mjs +0 -156
  24. package/dist/addon-export-hap.css +0 -3
  25. package/dist/browser-i_dCVxwk.mjs +0 -1227
  26. package/dist/client-COVrSAyU.mjs +0 -7592
  27. package/dist/dist-B4EgL9KT.mjs +0 -12922
  28. package/dist/dist-BLWGlNFD.mjs +0 -2483
  29. package/dist/dist-DOK7aZoj.mjs +0 -662
  30. package/dist/dist-DvB1ylHP.mjs +0 -1275
  31. package/dist/dist-RCwIG6iQ.mjs +0 -2229
  32. package/dist/dist-v8qx0EEt.mjs +0 -17192
  33. package/dist/getErrorShape-BPSzUA7W-m6tLWUI0.mjs +0 -189
  34. package/dist/hostInit-CWjIaYbZ.mjs +0 -144
  35. package/dist/jsx-runtime-C-bO5vlp.mjs +0 -22
  36. package/dist/modern-DN59UY0v.mjs +0 -2184
  37. package/dist/react-Bl6eCS2o.mjs +0 -293
  38. package/dist/react-dom-lYY58-MR.mjs +0 -131
  39. package/dist/remoteEntry.js +0 -83
  40. package/dist/rolldown-runtime-DC4cgjXG.mjs +0 -20
  41. package/dist/schemas-DswVYZsq.mjs +0 -3483
  42. package/dist/virtualExposes-Biq8M5a-.mjs +0 -27
@@ -4659,7 +4659,7 @@ function _instanceof(cls, params = {}) {
4659
4659
  return inst;
4660
4660
  }
4661
4661
  //#endregion
4662
- //#region ../types/dist/index-YnRVILXN.mjs
4662
+ //#region ../types/dist/index-Ce7RZWP4.mjs
4663
4663
  var MODEL_FORMATS = [
4664
4664
  "onnx",
4665
4665
  "coreml",
@@ -7331,14 +7331,35 @@ var StatusSchema = object({
7331
7331
  embeddedRunning: boolean()
7332
7332
  });
7333
7333
  method(_void(), array(BrokerInfoSchema)), method(IdInputSchema, BrokerConnectionDetailsSchema), method(AddBrokerInputSchema, AddBrokerResultSchema, { kind: "mutation" }), method(IdInputSchema, _void(), { kind: "mutation" }), method(IdInputSchema, TestResultSchema, { kind: "mutation" }), method(StartEmbeddedInputSchema, StartEmbeddedResultSchema, { kind: "mutation" }), method(IdInputSchema, _void(), { kind: "mutation" }), method(_void(), StatusSchema);
7334
+ var LinkStateSchema = _enum([
7335
+ "unlinked",
7336
+ "linked",
7337
+ "error"
7338
+ ]);
7339
+ var ExportSetupFieldSchema = object({
7340
+ label: string(),
7341
+ value: string(),
7342
+ /** Mask the value by default + render a reveal toggle (client id, secrets). */
7343
+ secret: boolean().optional()
7344
+ });
7345
+ var ExportSetupSchema = object({
7346
+ /** A string to render as a scannable QR — HAP `X-HM://…` URI, a pairing URL, etc. Omitted when there's nothing to scan. */
7347
+ qr: string().optional(),
7348
+ /** Label/value rows shown with a copy button (HAP setup code, OAuth URLs, client id, linked-account count, …). */
7349
+ fields: array(ExportSetupFieldSchema).readonly().optional(),
7350
+ /** Free-form operator instructions rendered above the fields. */
7351
+ note: string().optional()
7352
+ });
7334
7353
  var DeviceExportStatusSchema = object({
7335
- linkState: _enum([
7336
- "unlinked",
7337
- "linked",
7338
- "error"
7339
- ]),
7354
+ linkState: LinkStateSchema,
7340
7355
  exposedDeviceCount: number(),
7341
- error: string().optional()
7356
+ error: string().optional(),
7357
+ /**
7358
+ * Optional pairing/account info the panel renders in a generic
7359
+ * "Setup" section. Addon-agnostic — the addon id identifies the
7360
+ * export target, never an `ecosystem` key here.
7361
+ */
7362
+ setup: ExportSetupSchema.optional()
7342
7363
  });
7343
7364
  var DeviceKindSchema = string();
7344
7365
  var ExposedDeviceSchema = object({
@@ -7413,13 +7434,7 @@ var AddonPageDeclarationSchema = object({
7413
7434
  */
7414
7435
  bundle: string()
7415
7436
  });
7416
- var addonPagesSourceCapability = {
7417
- name: "addon-pages-source",
7418
- scope: "system",
7419
- mode: "collection",
7420
- internal: true,
7421
- methods: { listPages: method(_void(), array(AddonPageDeclarationSchema).readonly()) }
7422
- };
7437
+ method(_void(), array(AddonPageDeclarationSchema).readonly());
7423
7438
  var WidgetHostEnum = _enum([
7424
7439
  "device-tab",
7425
7440
  "dashboard",
@@ -9607,7 +9622,24 @@ var MeshStatusSchema = object({
9607
9622
  * doesn't rotate keys for the bound host. Operator-facing surface
9608
9623
  * for "your access expires on …" banners.
9609
9624
  */
9610
- keyExpiry: number().nullable()
9625
+ keyExpiry: number().nullable(),
9626
+ /**
9627
+ * When the provider runs its OWN mesh daemon (e.g. the Tailscale
9628
+ * client addon in `onboard` mode spawns a private `tailscaled`),
9629
+ * this carries the local control-socket path. Companion addons that
9630
+ * must drive the SAME daemon — chiefly `tailscale-ingress` for
9631
+ * Serve/Funnel — read it to point their CLI at the right socket
9632
+ * instead of the system default. Empty when the provider uses the
9633
+ * host's system daemon (or doesn't have the concept).
9634
+ */
9635
+ daemonSocket: string().optional(),
9636
+ /**
9637
+ * Path to the mesh CLI binary the provider downloaded for onboard
9638
+ * mode. Companion addons reuse it so they don't need a system
9639
+ * install when the operator chose a fully self-contained mesh.
9640
+ * Empty in host mode.
9641
+ */
9642
+ daemonCliPath: string().optional()
9611
9643
  });
9612
9644
  method(_void(), MeshStatusSchema), method(object({
9613
9645
  /** Provider-specific auth key. For Tailscale this is the
@@ -10289,6 +10321,21 @@ var AddonAutoUpdateSchema = ChannelWithInheritSchema;
10289
10321
  var RestartAddonResultSchema = unknown();
10290
10322
  var InstallPackageResultSchema = unknown();
10291
10323
  var ReloadPackagesResultSchema = unknown();
10324
+ var UpdateFrameworkPackageResultSchema = object({
10325
+ packageName: string(),
10326
+ fromVersion: string(),
10327
+ toVersion: string(),
10328
+ /** Ms-epoch the server scheduled its self-restart. */
10329
+ restartingAt: number()
10330
+ });
10331
+ var FrameworkPackageStatusSchema = object({
10332
+ packageName: string(),
10333
+ currentVersion: string(),
10334
+ latestVersion: string().nullable(),
10335
+ hasUpdate: boolean(),
10336
+ /** Optional manifest description for the row tooltip. */
10337
+ description: string().optional()
10338
+ });
10292
10339
  var LogStreamEntrySchema = object({
10293
10340
  timestamp: string(),
10294
10341
  level: string(),
@@ -10320,21 +10367,43 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
10320
10367
  }), method(_void(), ReloadPackagesResultSchema, {
10321
10368
  kind: "mutation",
10322
10369
  auth: "admin"
10323
- }), method(object({ query: string().optional() }), array(SearchResultSchema)), method(_void(), array(PackageUpdateSchema).readonly(), { auth: "admin" }), method(object({
10370
+ }), method(object({ query: string().optional() }), array(SearchResultSchema)), method(object({ nodeId: string().optional() }), array(PackageUpdateSchema).readonly(), { auth: "admin" }), method(object({
10324
10371
  name: string().min(1),
10325
- version: string().optional()
10372
+ version: string().optional(),
10373
+ nodeId: string().optional()
10326
10374
  }), unknown(), {
10327
10375
  kind: "mutation",
10328
10376
  auth: "admin"
10329
10377
  }), method(object({ name: string().min(1) }), object({ rolledBackTo: string().nullable() }), {
10330
10378
  kind: "mutation",
10331
10379
  auth: "admin"
10332
- }), method(_void(), unknown(), {
10380
+ }), method(object({ nodeId: string().optional() }), unknown(), {
10333
10381
  kind: "mutation",
10334
10382
  auth: "admin"
10335
10383
  }), method(object({ confirm: literal(true) }), unknown(), {
10336
10384
  kind: "mutation",
10337
10385
  auth: "admin"
10386
+ }), method(_void(), object({
10387
+ kind: _enum([
10388
+ "framework-update",
10389
+ "manual",
10390
+ "system"
10391
+ ]),
10392
+ packageName: string().optional(),
10393
+ fromVersion: string().optional(),
10394
+ toVersion: string().optional(),
10395
+ requestedBy: string().optional(),
10396
+ requestedAt: number()
10397
+ }).nullable(), { auth: "admin" }), method(_void(), array(FrameworkPackageStatusSchema).readonly(), { auth: "admin" }), method(object({ capName: string().min(1) }), array(object({
10398
+ addonId: string(),
10399
+ mode: _enum(["singleton", "collection"]),
10400
+ isActive: boolean()
10401
+ })).readonly()), method(object({
10402
+ packageName: string().min(1),
10403
+ version: string().optional()
10404
+ }), UpdateFrameworkPackageResultSchema, {
10405
+ kind: "mutation",
10406
+ auth: "admin"
10338
10407
  }), method(object({ name: string() }), array(PackageVersionInfoSchema).readonly()), method(object({ addonId: string() }), RestartAddonResultSchema, {
10339
10408
  kind: "mutation",
10340
10409
  auth: "admin"
@@ -10366,6 +10435,7 @@ var EventCategory = /* @__PURE__ */ ((EventCategory2) => {
10366
10435
  EventCategory2["SystemBoot"] = "system.boot";
10367
10436
  EventCategory2["SystemAddonsReady"] = "system.addons-ready";
10368
10437
  EventCategory2["SystemRestarting"] = "system.restarting";
10438
+ EventCategory2["SystemRestartCompleted"] = "system.restart-completed";
10369
10439
  EventCategory2["SystemReadyState"] = "system.ready-state";
10370
10440
  EventCategory2["AddonStarted"] = "addon.started";
10371
10441
  EventCategory2["AddonStopped"] = "addon.stopped";
@@ -10896,6 +10966,12 @@ Object.freeze({
10896
10966
  addonId: null,
10897
10967
  access: "view"
10898
10968
  },
10969
+ "addons.getLastRestart": {
10970
+ capName: "addons",
10971
+ capScope: "system",
10972
+ addonId: null,
10973
+ access: "view"
10974
+ },
10899
10975
  "addons.getLogs": {
10900
10976
  capName: "addons",
10901
10977
  capScope: "system",
@@ -10932,6 +11008,18 @@ Object.freeze({
10932
11008
  addonId: null,
10933
11009
  access: "view"
10934
11010
  },
11011
+ "addons.listCapabilityProviders": {
11012
+ capName: "addons",
11013
+ capScope: "system",
11014
+ addonId: null,
11015
+ access: "view"
11016
+ },
11017
+ "addons.listFrameworkPackages": {
11018
+ capName: "addons",
11019
+ capScope: "system",
11020
+ addonId: null,
11021
+ access: "view"
11022
+ },
10935
11023
  "addons.listPackages": {
10936
11024
  capName: "addons",
10937
11025
  capScope: "system",
@@ -11010,6 +11098,12 @@ Object.freeze({
11010
11098
  addonId: null,
11011
11099
  access: "delete"
11012
11100
  },
11101
+ "addons.updateFrameworkPackage": {
11102
+ capName: "addons",
11103
+ capScope: "system",
11104
+ addonId: null,
11105
+ access: "create"
11106
+ },
11013
11107
  "addons.updatePackage": {
11014
11108
  capName: "addons",
11015
11109
  capScope: "system",
@@ -71366,20 +71460,6 @@ var DEFAULT_CONFIG = {
71366
71460
  },
71367
71461
  exposed: []
71368
71462
  };
71369
- /**
71370
- * Module-federation page declarations — picked up by the
71371
- * `addon-pages-source` aggregator and surfaced on admin-ui's
71372
- * Integrations page (Configure button) once the federation bundle
71373
- * is built. See `src/page/HomeKitOverviewPage.tsx`.
71374
- */
71375
- var HOMEKIT_OVERVIEW_PAGES = [{
71376
- id: "export-hap",
71377
- label: "HomeKit Export",
71378
- icon: "home",
71379
- path: "/addon/export-hap",
71380
- remoteName: "addon_export_hap_page",
71381
- bundle: "remoteEntry.js"
71382
- }];
71383
71463
  var BANNED_PINCODES = new Set([
71384
71464
  "000-00-000",
71385
71465
  "111-11-111",
@@ -71456,10 +71536,13 @@ var ExportHapAddon = class extends BaseAddon {
71456
71536
  provider: {
71457
71537
  getStatus: async () => {
71458
71538
  const state = this.bridge?.getState() ?? null;
71539
+ const linkState = this.lastError ? "error" : state?.paired ? "linked" : "unlinked";
71540
+ const setup = this.buildSetupBlock();
71459
71541
  return {
71460
- linkState: this.lastError ? "error" : state?.paired ? "linked" : "unlinked",
71542
+ linkState,
71461
71543
  exposedDeviceCount: this.exposed.size,
71462
- ...this.lastError ? { error: this.lastError } : {}
71544
+ ...this.lastError ? { error: this.lastError } : {},
71545
+ ...setup ? { setup } : {}
71463
71546
  };
71464
71547
  },
71465
71548
  listSupportedDeviceKinds: async () => [...SUPPORTED_MAPPER_KINDS],
@@ -71477,12 +71560,6 @@ var ExportHapAddon = class extends BaseAddon {
71477
71560
  getDeviceLiveContribution: async () => null,
71478
71561
  applyDeviceSettingsPatch: (input) => this.applyDeviceSettingsPatch(input.deviceId, input.patch)
71479
71562
  }
71480
- }, {
71481
- capability: addonPagesSourceCapability,
71482
- provider: {
71483
- id: "export-hap",
71484
- listPages: () => HOMEKIT_OVERVIEW_PAGES
71485
- }
71486
71563
  }];
71487
71564
  }
71488
71565
  async onConfigChanged() {
@@ -71526,6 +71603,28 @@ var ExportHapAddon = class extends BaseAddon {
71526
71603
  this.ctx.logger.info("export-hap: generated bridge identity on first boot", { meta: { username: fresh.username } });
71527
71604
  return fresh;
71528
71605
  }
71606
+ /**
71607
+ * Build the generic `device-export` `setup` block surfaced via
71608
+ * `getStatus` and rendered by the shared `DeviceExportPanel`: the
71609
+ * `X-HM://…` setup URI as a scannable QR, the 8-digit setup code as
71610
+ * a copyable field, and a short pairing instruction. Returns `null`
71611
+ * until the bridge has booted and produced both values.
71612
+ */
71613
+ buildSetupBlock() {
71614
+ const state = this.bridge?.getState() ?? null;
71615
+ const setupCode = state?.identity.pincode || this.config.identity.pincode;
71616
+ const setupUri = state?.setupURI ?? "";
71617
+ if (!setupCode) return null;
71618
+ const paired = state?.paired === true;
71619
+ return {
71620
+ ...setupUri ? { qr: setupUri } : {},
71621
+ fields: [{
71622
+ label: "Setup code",
71623
+ value: setupCode
71624
+ }],
71625
+ note: paired ? "This bridge is currently paired. To re-pair, scan the QR in the iOS Home app (+ → Add Accessory) or enter the setup code manually." : "Open the iOS Home app, tap + → Add Accessory, then scan this QR — or enter the setup code manually."
71626
+ };
71627
+ }
71529
71628
  async exposeDevice(deviceId, capabilities) {
71530
71629
  if (this.exposed.has(deviceId)) {
71531
71630
  this.ctx.logger.debug("export-hap: device already exposed — refreshing capabilities", { meta: { deviceId } });
@@ -71619,15 +71718,9 @@ var ExportHapAddon = class extends BaseAddon {
71619
71718
  return this.schema({ sections: [{
71620
71719
  id: "export-hap",
71621
71720
  title: "HomeKit Export",
71622
- description: "Publishes a HomeKit bridge. After the addon boots, open the iOS Home app, tap +, then \"Add Accessory\", then scan the QR code in the addon page (or type the setup code shown there). After pairing, mark individual devices as \"Expose to HomeKit\" on each device's settings page.",
71721
+ description: "Publishes a HomeKit bridge. After the addon boots, scan the pairing QR (or enter the setup code) from the Exported devices panel in the iOS Home app. After pairing, mark individual devices as \"Expose to HomeKit\" on each device's settings page.",
71623
71722
  columns: 1,
71624
71723
  fields: [
71625
- {
71626
- type: "info",
71627
- key: "__pair-instructions",
71628
- label: "Pairing",
71629
- content: "Setup code + QR are surfaced via the \"HomeKit Export\" integration page once the bridge has booted. Changing the bridge name or port requires a restart of the addon — handled automatically when you save."
71630
- },
71631
71724
  this.field({
71632
71725
  type: "text",
71633
71726
  key: "bridgeName",