@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
@@ -4649,7 +4649,7 @@ function _instanceof(cls, params = {}) {
4649
4649
  return inst;
4650
4650
  }
4651
4651
  //#endregion
4652
- //#region ../types/dist/index-YnRVILXN.mjs
4652
+ //#region ../types/dist/index-Ce7RZWP4.mjs
4653
4653
  var MODEL_FORMATS = [
4654
4654
  "onnx",
4655
4655
  "coreml",
@@ -7321,14 +7321,35 @@ var StatusSchema = object({
7321
7321
  embeddedRunning: boolean()
7322
7322
  });
7323
7323
  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);
7324
+ var LinkStateSchema = _enum([
7325
+ "unlinked",
7326
+ "linked",
7327
+ "error"
7328
+ ]);
7329
+ var ExportSetupFieldSchema = object({
7330
+ label: string(),
7331
+ value: string(),
7332
+ /** Mask the value by default + render a reveal toggle (client id, secrets). */
7333
+ secret: boolean().optional()
7334
+ });
7335
+ var ExportSetupSchema = object({
7336
+ /** A string to render as a scannable QR — HAP `X-HM://…` URI, a pairing URL, etc. Omitted when there's nothing to scan. */
7337
+ qr: string().optional(),
7338
+ /** Label/value rows shown with a copy button (HAP setup code, OAuth URLs, client id, linked-account count, …). */
7339
+ fields: array(ExportSetupFieldSchema).readonly().optional(),
7340
+ /** Free-form operator instructions rendered above the fields. */
7341
+ note: string().optional()
7342
+ });
7324
7343
  var DeviceExportStatusSchema = object({
7325
- linkState: _enum([
7326
- "unlinked",
7327
- "linked",
7328
- "error"
7329
- ]),
7344
+ linkState: LinkStateSchema,
7330
7345
  exposedDeviceCount: number(),
7331
- error: string().optional()
7346
+ error: string().optional(),
7347
+ /**
7348
+ * Optional pairing/account info the panel renders in a generic
7349
+ * "Setup" section. Addon-agnostic — the addon id identifies the
7350
+ * export target, never an `ecosystem` key here.
7351
+ */
7352
+ setup: ExportSetupSchema.optional()
7332
7353
  });
7333
7354
  var DeviceKindSchema = string();
7334
7355
  var ExposedDeviceSchema = object({
@@ -7403,13 +7424,7 @@ var AddonPageDeclarationSchema = object({
7403
7424
  */
7404
7425
  bundle: string()
7405
7426
  });
7406
- var addonPagesSourceCapability = {
7407
- name: "addon-pages-source",
7408
- scope: "system",
7409
- mode: "collection",
7410
- internal: true,
7411
- methods: { listPages: method(_void(), array(AddonPageDeclarationSchema).readonly()) }
7412
- };
7427
+ method(_void(), array(AddonPageDeclarationSchema).readonly());
7413
7428
  var WidgetHostEnum = _enum([
7414
7429
  "device-tab",
7415
7430
  "dashboard",
@@ -9597,7 +9612,24 @@ var MeshStatusSchema = object({
9597
9612
  * doesn't rotate keys for the bound host. Operator-facing surface
9598
9613
  * for "your access expires on …" banners.
9599
9614
  */
9600
- keyExpiry: number().nullable()
9615
+ keyExpiry: number().nullable(),
9616
+ /**
9617
+ * When the provider runs its OWN mesh daemon (e.g. the Tailscale
9618
+ * client addon in `onboard` mode spawns a private `tailscaled`),
9619
+ * this carries the local control-socket path. Companion addons that
9620
+ * must drive the SAME daemon — chiefly `tailscale-ingress` for
9621
+ * Serve/Funnel — read it to point their CLI at the right socket
9622
+ * instead of the system default. Empty when the provider uses the
9623
+ * host's system daemon (or doesn't have the concept).
9624
+ */
9625
+ daemonSocket: string().optional(),
9626
+ /**
9627
+ * Path to the mesh CLI binary the provider downloaded for onboard
9628
+ * mode. Companion addons reuse it so they don't need a system
9629
+ * install when the operator chose a fully self-contained mesh.
9630
+ * Empty in host mode.
9631
+ */
9632
+ daemonCliPath: string().optional()
9601
9633
  });
9602
9634
  method(_void(), MeshStatusSchema), method(object({
9603
9635
  /** Provider-specific auth key. For Tailscale this is the
@@ -10279,6 +10311,21 @@ var AddonAutoUpdateSchema = ChannelWithInheritSchema;
10279
10311
  var RestartAddonResultSchema = unknown();
10280
10312
  var InstallPackageResultSchema = unknown();
10281
10313
  var ReloadPackagesResultSchema = unknown();
10314
+ var UpdateFrameworkPackageResultSchema = object({
10315
+ packageName: string(),
10316
+ fromVersion: string(),
10317
+ toVersion: string(),
10318
+ /** Ms-epoch the server scheduled its self-restart. */
10319
+ restartingAt: number()
10320
+ });
10321
+ var FrameworkPackageStatusSchema = object({
10322
+ packageName: string(),
10323
+ currentVersion: string(),
10324
+ latestVersion: string().nullable(),
10325
+ hasUpdate: boolean(),
10326
+ /** Optional manifest description for the row tooltip. */
10327
+ description: string().optional()
10328
+ });
10282
10329
  var LogStreamEntrySchema = object({
10283
10330
  timestamp: string(),
10284
10331
  level: string(),
@@ -10310,21 +10357,43 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
10310
10357
  }), method(_void(), ReloadPackagesResultSchema, {
10311
10358
  kind: "mutation",
10312
10359
  auth: "admin"
10313
- }), method(object({ query: string().optional() }), array(SearchResultSchema)), method(_void(), array(PackageUpdateSchema).readonly(), { auth: "admin" }), method(object({
10360
+ }), method(object({ query: string().optional() }), array(SearchResultSchema)), method(object({ nodeId: string().optional() }), array(PackageUpdateSchema).readonly(), { auth: "admin" }), method(object({
10314
10361
  name: string().min(1),
10315
- version: string().optional()
10362
+ version: string().optional(),
10363
+ nodeId: string().optional()
10316
10364
  }), unknown(), {
10317
10365
  kind: "mutation",
10318
10366
  auth: "admin"
10319
10367
  }), method(object({ name: string().min(1) }), object({ rolledBackTo: string().nullable() }), {
10320
10368
  kind: "mutation",
10321
10369
  auth: "admin"
10322
- }), method(_void(), unknown(), {
10370
+ }), method(object({ nodeId: string().optional() }), unknown(), {
10323
10371
  kind: "mutation",
10324
10372
  auth: "admin"
10325
10373
  }), method(object({ confirm: literal(true) }), unknown(), {
10326
10374
  kind: "mutation",
10327
10375
  auth: "admin"
10376
+ }), method(_void(), object({
10377
+ kind: _enum([
10378
+ "framework-update",
10379
+ "manual",
10380
+ "system"
10381
+ ]),
10382
+ packageName: string().optional(),
10383
+ fromVersion: string().optional(),
10384
+ toVersion: string().optional(),
10385
+ requestedBy: string().optional(),
10386
+ requestedAt: number()
10387
+ }).nullable(), { auth: "admin" }), method(_void(), array(FrameworkPackageStatusSchema).readonly(), { auth: "admin" }), method(object({ capName: string().min(1) }), array(object({
10388
+ addonId: string(),
10389
+ mode: _enum(["singleton", "collection"]),
10390
+ isActive: boolean()
10391
+ })).readonly()), method(object({
10392
+ packageName: string().min(1),
10393
+ version: string().optional()
10394
+ }), UpdateFrameworkPackageResultSchema, {
10395
+ kind: "mutation",
10396
+ auth: "admin"
10328
10397
  }), method(object({ name: string() }), array(PackageVersionInfoSchema).readonly()), method(object({ addonId: string() }), RestartAddonResultSchema, {
10329
10398
  kind: "mutation",
10330
10399
  auth: "admin"
@@ -10356,6 +10425,7 @@ var EventCategory = /* @__PURE__ */ ((EventCategory2) => {
10356
10425
  EventCategory2["SystemBoot"] = "system.boot";
10357
10426
  EventCategory2["SystemAddonsReady"] = "system.addons-ready";
10358
10427
  EventCategory2["SystemRestarting"] = "system.restarting";
10428
+ EventCategory2["SystemRestartCompleted"] = "system.restart-completed";
10359
10429
  EventCategory2["SystemReadyState"] = "system.ready-state";
10360
10430
  EventCategory2["AddonStarted"] = "addon.started";
10361
10431
  EventCategory2["AddonStopped"] = "addon.stopped";
@@ -10886,6 +10956,12 @@ Object.freeze({
10886
10956
  addonId: null,
10887
10957
  access: "view"
10888
10958
  },
10959
+ "addons.getLastRestart": {
10960
+ capName: "addons",
10961
+ capScope: "system",
10962
+ addonId: null,
10963
+ access: "view"
10964
+ },
10889
10965
  "addons.getLogs": {
10890
10966
  capName: "addons",
10891
10967
  capScope: "system",
@@ -10922,6 +10998,18 @@ Object.freeze({
10922
10998
  addonId: null,
10923
10999
  access: "view"
10924
11000
  },
11001
+ "addons.listCapabilityProviders": {
11002
+ capName: "addons",
11003
+ capScope: "system",
11004
+ addonId: null,
11005
+ access: "view"
11006
+ },
11007
+ "addons.listFrameworkPackages": {
11008
+ capName: "addons",
11009
+ capScope: "system",
11010
+ addonId: null,
11011
+ access: "view"
11012
+ },
10925
11013
  "addons.listPackages": {
10926
11014
  capName: "addons",
10927
11015
  capScope: "system",
@@ -11000,6 +11088,12 @@ Object.freeze({
11000
11088
  addonId: null,
11001
11089
  access: "delete"
11002
11090
  },
11091
+ "addons.updateFrameworkPackage": {
11092
+ capName: "addons",
11093
+ capScope: "system",
11094
+ addonId: null,
11095
+ access: "create"
11096
+ },
11003
11097
  "addons.updatePackage": {
11004
11098
  capName: "addons",
11005
11099
  capScope: "system",
@@ -71356,20 +71450,6 @@ var DEFAULT_CONFIG = {
71356
71450
  },
71357
71451
  exposed: []
71358
71452
  };
71359
- /**
71360
- * Module-federation page declarations — picked up by the
71361
- * `addon-pages-source` aggregator and surfaced on admin-ui's
71362
- * Integrations page (Configure button) once the federation bundle
71363
- * is built. See `src/page/HomeKitOverviewPage.tsx`.
71364
- */
71365
- var HOMEKIT_OVERVIEW_PAGES = [{
71366
- id: "export-hap",
71367
- label: "HomeKit Export",
71368
- icon: "home",
71369
- path: "/addon/export-hap",
71370
- remoteName: "addon_export_hap_page",
71371
- bundle: "remoteEntry.js"
71372
- }];
71373
71453
  var BANNED_PINCODES = new Set([
71374
71454
  "000-00-000",
71375
71455
  "111-11-111",
@@ -71446,10 +71526,13 @@ var ExportHapAddon = class extends BaseAddon {
71446
71526
  provider: {
71447
71527
  getStatus: async () => {
71448
71528
  const state = this.bridge?.getState() ?? null;
71529
+ const linkState = this.lastError ? "error" : state?.paired ? "linked" : "unlinked";
71530
+ const setup = this.buildSetupBlock();
71449
71531
  return {
71450
- linkState: this.lastError ? "error" : state?.paired ? "linked" : "unlinked",
71532
+ linkState,
71451
71533
  exposedDeviceCount: this.exposed.size,
71452
- ...this.lastError ? { error: this.lastError } : {}
71534
+ ...this.lastError ? { error: this.lastError } : {},
71535
+ ...setup ? { setup } : {}
71453
71536
  };
71454
71537
  },
71455
71538
  listSupportedDeviceKinds: async () => [...SUPPORTED_MAPPER_KINDS],
@@ -71467,12 +71550,6 @@ var ExportHapAddon = class extends BaseAddon {
71467
71550
  getDeviceLiveContribution: async () => null,
71468
71551
  applyDeviceSettingsPatch: (input) => this.applyDeviceSettingsPatch(input.deviceId, input.patch)
71469
71552
  }
71470
- }, {
71471
- capability: addonPagesSourceCapability,
71472
- provider: {
71473
- id: "export-hap",
71474
- listPages: () => HOMEKIT_OVERVIEW_PAGES
71475
- }
71476
71553
  }];
71477
71554
  }
71478
71555
  async onConfigChanged() {
@@ -71516,6 +71593,28 @@ var ExportHapAddon = class extends BaseAddon {
71516
71593
  this.ctx.logger.info("export-hap: generated bridge identity on first boot", { meta: { username: fresh.username } });
71517
71594
  return fresh;
71518
71595
  }
71596
+ /**
71597
+ * Build the generic `device-export` `setup` block surfaced via
71598
+ * `getStatus` and rendered by the shared `DeviceExportPanel`: the
71599
+ * `X-HM://…` setup URI as a scannable QR, the 8-digit setup code as
71600
+ * a copyable field, and a short pairing instruction. Returns `null`
71601
+ * until the bridge has booted and produced both values.
71602
+ */
71603
+ buildSetupBlock() {
71604
+ const state = this.bridge?.getState() ?? null;
71605
+ const setupCode = state?.identity.pincode || this.config.identity.pincode;
71606
+ const setupUri = state?.setupURI ?? "";
71607
+ if (!setupCode) return null;
71608
+ const paired = state?.paired === true;
71609
+ return {
71610
+ ...setupUri ? { qr: setupUri } : {},
71611
+ fields: [{
71612
+ label: "Setup code",
71613
+ value: setupCode
71614
+ }],
71615
+ 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."
71616
+ };
71617
+ }
71519
71618
  async exposeDevice(deviceId, capabilities) {
71520
71619
  if (this.exposed.has(deviceId)) {
71521
71620
  this.ctx.logger.debug("export-hap: device already exposed — refreshing capabilities", { meta: { deviceId } });
@@ -71609,15 +71708,9 @@ var ExportHapAddon = class extends BaseAddon {
71609
71708
  return this.schema({ sections: [{
71610
71709
  id: "export-hap",
71611
71710
  title: "HomeKit Export",
71612
- 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.",
71711
+ 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.",
71613
71712
  columns: 1,
71614
71713
  fields: [
71615
- {
71616
- type: "info",
71617
- key: "__pair-instructions",
71618
- label: "Pairing",
71619
- 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."
71620
- },
71621
71714
  this.field({
71622
71715
  type: "text",
71623
71716
  key: "bridgeName",