@camstack/types 0.1.33 → 0.1.35

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 (52) hide show
  1. package/dist/capabilities/addons.cap.d.ts +176 -3
  2. package/dist/capabilities/addons.cap.d.ts.map +1 -1
  3. package/dist/capabilities/device-export.cap.d.ts +55 -1
  4. package/dist/capabilities/device-export.cap.d.ts.map +1 -1
  5. package/dist/capabilities/index.d.ts +4 -11
  6. package/dist/capabilities/index.d.ts.map +1 -1
  7. package/dist/capabilities/local-network.cap.d.ts +5 -5
  8. package/dist/capabilities/mesh-network.cap.d.ts +8 -2
  9. package/dist/capabilities/mesh-network.cap.d.ts.map +1 -1
  10. package/dist/capabilities/network-access.cap.d.ts +5 -4
  11. package/dist/capabilities/network-access.cap.d.ts.map +1 -1
  12. package/dist/capabilities/nodes.cap.d.ts +13 -0
  13. package/dist/capabilities/nodes.cap.d.ts.map +1 -1
  14. package/dist/enums/event-category.d.ts +10 -0
  15. package/dist/enums/event-category.d.ts.map +1 -1
  16. package/dist/generated/addon-api.d.ts +356 -516
  17. package/dist/generated/addon-api.d.ts.map +1 -1
  18. package/dist/generated/capability-router-map.d.ts +2 -14
  19. package/dist/generated/capability-router-map.d.ts.map +1 -1
  20. package/dist/generated/method-access-map.d.ts +1 -1
  21. package/dist/generated/method-access-map.d.ts.map +1 -1
  22. package/dist/generated/system-proxy.d.ts +3 -9
  23. package/dist/generated/system-proxy.d.ts.map +1 -1
  24. package/dist/{index-DRWlYskM.js → index-BkSgJYP7.js} +202 -257
  25. package/dist/index-BkSgJYP7.js.map +1 -0
  26. package/dist/{index-YnRVILXN.mjs → index-CWhQOnm9.mjs} +521 -576
  27. package/dist/index-CWhQOnm9.mjs.map +1 -0
  28. package/dist/index.js +24 -69
  29. package/dist/index.js.map +1 -1
  30. package/dist/index.mjs +294 -339
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/interfaces/addon.d.ts +21 -0
  33. package/dist/interfaces/addon.d.ts.map +1 -1
  34. package/dist/interfaces/capability.d.ts +1 -6
  35. package/dist/interfaces/capability.d.ts.map +1 -1
  36. package/dist/interfaces/event-bus.d.ts +21 -1
  37. package/dist/interfaces/event-bus.d.ts.map +1 -1
  38. package/dist/interfaces/server-network.d.ts +8 -33
  39. package/dist/interfaces/server-network.d.ts.map +1 -1
  40. package/dist/node.js +1 -1
  41. package/dist/node.mjs +1 -1
  42. package/package.json +6 -1
  43. package/dist/capabilities/authentication.cap.d.ts +0 -73
  44. package/dist/capabilities/authentication.cap.d.ts.map +0 -1
  45. package/dist/capabilities/mesh-orchestrator.cap.d.ts +0 -151
  46. package/dist/capabilities/mesh-orchestrator.cap.d.ts.map +0 -1
  47. package/dist/capabilities/remote-access.cap.d.ts +0 -91
  48. package/dist/capabilities/remote-access.cap.d.ts.map +0 -1
  49. package/dist/capabilities/turn-orchestrator.cap.d.ts +0 -64
  50. package/dist/capabilities/turn-orchestrator.cap.d.ts.map +0 -1
  51. package/dist/index-DRWlYskM.js.map +0 -1
  52. package/dist/index-YnRVILXN.mjs.map +0 -1
@@ -3869,10 +3869,30 @@ const mqttBrokerCapability = {
3869
3869
  }
3870
3870
  };
3871
3871
  const LinkStateSchema = zod.z.enum(["unlinked", "linked", "error"]);
3872
+ const ExportSetupFieldSchema = zod.z.object({
3873
+ label: zod.z.string(),
3874
+ value: zod.z.string(),
3875
+ /** Mask the value by default + render a reveal toggle (client id, secrets). */
3876
+ secret: zod.z.boolean().optional()
3877
+ });
3878
+ const ExportSetupSchema = zod.z.object({
3879
+ /** A string to render as a scannable QR — HAP `X-HM://…` URI, a pairing URL, etc. Omitted when there's nothing to scan. */
3880
+ qr: zod.z.string().optional(),
3881
+ /** Label/value rows shown with a copy button (HAP setup code, OAuth URLs, client id, linked-account count, …). */
3882
+ fields: zod.z.array(ExportSetupFieldSchema).readonly().optional(),
3883
+ /** Free-form operator instructions rendered above the fields. */
3884
+ note: zod.z.string().optional()
3885
+ });
3872
3886
  const DeviceExportStatusSchema = zod.z.object({
3873
3887
  linkState: LinkStateSchema,
3874
3888
  exposedDeviceCount: zod.z.number(),
3875
- error: zod.z.string().optional()
3889
+ error: zod.z.string().optional(),
3890
+ /**
3891
+ * Optional pairing/account info the panel renders in a generic
3892
+ * "Setup" section. Addon-agnostic — the addon id identifies the
3893
+ * export target, never an `ecosystem` key here.
3894
+ */
3895
+ setup: ExportSetupSchema.optional()
3876
3896
  });
3877
3897
  const DeviceKindSchema = zod.z.string();
3878
3898
  const ExposedDeviceSchema = zod.z.object({
@@ -5650,54 +5670,6 @@ const authProviderCapability = {
5650
5670
  validateToken: method(zod.z.object({ token: zod.z.string() }), AuthResultSchema.nullable())
5651
5671
  }
5652
5672
  };
5653
- const AuthProviderInfoSchema = zod.z.object({
5654
- /** Stable id matching the addon id (used for `getLoginUrl({addonId,…})`). */
5655
- addonId: zod.z.string(),
5656
- /**
5657
- * Per-instance id when one addon registers multiple "logical"
5658
- * providers (e.g. OIDC with Google + Microsoft + custom). The login
5659
- * URL becomes `/addon/${addonId}/${instanceId}/start` — handler reads
5660
- * `:instanceId` from the route. Empty/unset means the addon is a
5661
- * single-instance provider; the URL is `/addon/${addonId}/start`.
5662
- */
5663
- instanceId: zod.z.string().optional(),
5664
- /** Display label shown on the login button + admin row. */
5665
- displayName: zod.z.string(),
5666
- /** Optional iconography hint (lucide-react icon name OR emoji). */
5667
- icon: zod.z.string().optional(),
5668
- /** When true, the provider exposes a redirect-based login flow
5669
- * (`getLoginUrl` returns a URL the browser navigates to). */
5670
- hasRedirectFlow: zod.z.boolean(),
5671
- /** When true, the provider exposes a credential-form login flow
5672
- * (`validateCredentials` accepts username + password). */
5673
- hasCredentialFlow: zod.z.boolean(),
5674
- /** Provider kind, drives admin-UI hint dispatch (oidc / saml / totp / …). */
5675
- kind: zod.z.string().optional(),
5676
- /** Operator-facing status string (e.g. "Connected to https://login.acme.com"). */
5677
- status: zod.z.string().optional(),
5678
- /** When false, the provider is registered but disabled by config; the
5679
- * UI surfaces it as inactive without enumerating it for login. */
5680
- enabled: zod.z.boolean()
5681
- });
5682
- const authenticationCapability = {
5683
- name: "authentication",
5684
- scope: "system",
5685
- mode: "singleton",
5686
- methods: {
5687
- /** All registered auth providers, both enabled and disabled. */
5688
- listProviders: method(zod.z.void(), zod.z.array(AuthProviderInfoSchema).readonly()),
5689
- /**
5690
- * Toggle a provider's enabled flag. Disabled providers stay
5691
- * registered but aren't surfaced on the login page. The orchestrator
5692
- * persists the state in `addon-settings` so it survives restarts.
5693
- */
5694
- setProviderEnabled: method(
5695
- zod.z.object({ addonId: zod.z.string(), enabled: zod.z.boolean() }),
5696
- zod.z.object({ success: zod.z.literal(true) }),
5697
- { kind: "mutation", auth: "admin" }
5698
- )
5699
- }
5700
- };
5701
5673
  const NetworkEndpointSchema = zod.z.object({
5702
5674
  url: zod.z.string(),
5703
5675
  hostname: zod.z.string(),
@@ -5726,7 +5698,6 @@ const networkAccessCapability = {
5726
5698
  name: "network-access",
5727
5699
  scope: "system",
5728
5700
  mode: "collection",
5729
- internal: true,
5730
5701
  providerKind: "ingress",
5731
5702
  methods: {
5732
5703
  start: method(zod.z.void(), NetworkEndpointSchema, { kind: "mutation" }),
@@ -5734,58 +5705,13 @@ const networkAccessCapability = {
5734
5705
  getEndpoint: method(zod.z.void(), NetworkEndpointSchema.nullable()),
5735
5706
  getStatus: method(zod.z.void(), NetworkAccessStatusSchema),
5736
5707
  /**
5737
- * Enumerate every active ingress entry. Default implementation (when
5738
- * the provider omits this method) is derived from `getEndpoint()` —
5739
- * see the remote-access orchestrator for the fallback path.
5708
+ * Enumerate every active ingress entry. Providers that expose only a
5709
+ * single endpoint may omit this method; callers fall back to
5710
+ * `getEndpoint()` in that case.
5740
5711
  */
5741
5712
  listEndpoints: method(zod.z.void(), zod.z.array(NetworkEndpointEntrySchema).readonly())
5742
5713
  }
5743
5714
  };
5744
- const RemoteAccessEndpointSchema = zod.z.object({
5745
- url: zod.z.string(),
5746
- hostname: zod.z.string(),
5747
- port: zod.z.number(),
5748
- protocol: zod.z.enum(["http", "https"])
5749
- });
5750
- const RemoteAccessProviderInfoSchema = zod.z.object({
5751
- /** Stable id matching the addon id. */
5752
- addonId: zod.z.string(),
5753
- /** Display label shown on the admin row — sourced from the addon manifest. */
5754
- displayName: zod.z.string(),
5755
- /** When false, the provider is registered but disabled. */
5756
- enabled: zod.z.boolean(),
5757
- /** True when the underlying tunnel/connection is up. */
5758
- connected: zod.z.boolean(),
5759
- /** Public-facing endpoint, when connected. Null otherwise. */
5760
- endpoint: RemoteAccessEndpointSchema.nullable(),
5761
- /** Last error message (when connected=false), if available. */
5762
- error: zod.z.string().optional()
5763
- });
5764
- const remoteAccessCapability = {
5765
- name: "remote-access",
5766
- scope: "system",
5767
- mode: "singleton",
5768
- methods: {
5769
- /** All registered remote-access providers + their live status. */
5770
- listProviders: method(zod.z.void(), zod.z.array(RemoteAccessProviderInfoSchema).readonly()),
5771
- /**
5772
- * Start a specific provider's tunnel. Per-provider config still
5773
- * lives on the addon's settings panel; this is just the on/off
5774
- * trigger so the admin UI can manage the lifecycle from one place.
5775
- */
5776
- startProvider: method(
5777
- zod.z.object({ addonId: zod.z.string() }),
5778
- RemoteAccessEndpointSchema,
5779
- { kind: "mutation", auth: "admin" }
5780
- ),
5781
- /** Stop a specific provider's tunnel (idempotent on already-stopped). */
5782
- stopProvider: method(
5783
- zod.z.object({ addonId: zod.z.string() }),
5784
- zod.z.object({ success: zod.z.literal(true) }),
5785
- { kind: "mutation", auth: "admin" }
5786
- )
5787
- }
5788
- };
5789
5715
  const TurnServerSchema = zod.z.object({
5790
5716
  /** Single URL or list of URLs (e.g. "turn:turn.example.com:3478?transport=udp"). */
5791
5717
  urls: zod.z.union([zod.z.string(), zod.z.array(zod.z.string())]),
@@ -5808,48 +5734,6 @@ const turnProviderCapability = {
5808
5734
  )
5809
5735
  }
5810
5736
  };
5811
- const TurnProviderInfoSchema = zod.z.object({
5812
- /** Stable id matching the addon id. */
5813
- addonId: zod.z.string(),
5814
- /** Display label shown on the admin row — sourced from the addon manifest. */
5815
- displayName: zod.z.string(),
5816
- /** When false, the provider is registered but disabled. */
5817
- enabled: zod.z.boolean(),
5818
- /** Number of servers this provider is currently exposing. */
5819
- serverCount: zod.z.number(),
5820
- /**
5821
- * Flat list of every TURN/STUN URL this provider currently exposes.
5822
- * One row per URL (multi-URL ICE server entries are flattened). The
5823
- * admin UI shows this in a compact per-provider list so operators
5824
- * can verify what's actually being negotiated without having to dig
5825
- * into the combined `getAllServers` output.
5826
- */
5827
- urls: zod.z.array(zod.z.string()).readonly(),
5828
- /** Last fetch error (when serverCount=0 due to API failure), if any. */
5829
- error: zod.z.string().optional()
5830
- });
5831
- const turnOrchestratorCapability = {
5832
- name: "turn-orchestrator",
5833
- scope: "system",
5834
- mode: "singleton",
5835
- methods: {
5836
- /** All registered TURN providers + per-provider stats. */
5837
- listProviders: method(zod.z.void(), zod.z.array(TurnProviderInfoSchema).readonly()),
5838
- /**
5839
- * Combined list of TURN/STUN servers from all ENABLED providers.
5840
- * Consumed by the WebRTC layer at session-creation time —
5841
- * implementations may fetch fresh short-lived credentials each
5842
- * call (e.g. Cloudflare API), so consumers SHOULD call per-session.
5843
- */
5844
- getAllServers: method(zod.z.void(), zod.z.array(TurnServerSchema).readonly()),
5845
- /** Toggle a provider's enabled flag. */
5846
- setProviderEnabled: method(
5847
- zod.z.object({ addonId: zod.z.string(), enabled: zod.z.boolean() }),
5848
- zod.z.object({ success: zod.z.literal(true) }),
5849
- { kind: "mutation", auth: "admin" }
5850
- )
5851
- }
5852
- };
5853
5737
  const SnapshotImageSchema = zod.z.object({
5854
5738
  base64: zod.z.string(),
5855
5739
  contentType: zod.z.string()
@@ -7445,7 +7329,7 @@ const localNetworkCapability = {
7445
7329
  )
7446
7330
  }
7447
7331
  };
7448
- const MeshEndpointSchema$1 = zod.z.object({
7332
+ const MeshEndpointSchema = zod.z.object({
7449
7333
  /** Stable identifier within the provider (e.g. `mesh-ipv4`, `magicdns`, `funnel`). */
7450
7334
  id: zod.z.string(),
7451
7335
  /** Operator-facing label (e.g. "Mesh IPv4", "MagicDNS"). */
@@ -7518,7 +7402,7 @@ const MeshStatusSchema = zod.z.object({
7518
7402
  /** Number of peers visible to this host (excluding self). */
7519
7403
  peerCount: zod.z.number(),
7520
7404
  /** Every endpoint this provider exposes for the current host. */
7521
- endpoints: zod.z.array(MeshEndpointSchema$1).readonly(),
7405
+ endpoints: zod.z.array(MeshEndpointSchema).readonly(),
7522
7406
  /** Last error from the daemon, when not joined. */
7523
7407
  error: zod.z.string().optional(),
7524
7408
  // ── Account / tenant identity (generic across providers) ────────
@@ -7551,7 +7435,25 @@ const MeshStatusSchema = zod.z.object({
7551
7435
  * doesn't rotate keys for the bound host. Operator-facing surface
7552
7436
  * for "your access expires on …" banners.
7553
7437
  */
7554
- keyExpiry: zod.z.number().nullable()
7438
+ keyExpiry: zod.z.number().nullable(),
7439
+ // ── Onboard-daemon handoff (Tailscale, generic slot) ────────────
7440
+ /**
7441
+ * When the provider runs its OWN mesh daemon (e.g. the Tailscale
7442
+ * client addon in `onboard` mode spawns a private `tailscaled`),
7443
+ * this carries the local control-socket path. Companion addons that
7444
+ * must drive the SAME daemon — chiefly `tailscale-ingress` for
7445
+ * Serve/Funnel — read it to point their CLI at the right socket
7446
+ * instead of the system default. Empty when the provider uses the
7447
+ * host's system daemon (or doesn't have the concept).
7448
+ */
7449
+ daemonSocket: zod.z.string().optional(),
7450
+ /**
7451
+ * Path to the mesh CLI binary the provider downloaded for onboard
7452
+ * mode. Companion addons reuse it so they don't need a system
7453
+ * install when the operator chose a fully self-contained mesh.
7454
+ * Empty in host mode.
7455
+ */
7456
+ daemonCliPath: zod.z.string().optional()
7555
7457
  });
7556
7458
  const meshNetworkCapability = {
7557
7459
  name: "mesh-network",
@@ -7667,108 +7569,6 @@ const meshNetworkCapability = {
7667
7569
  // tabs driven by this cap.
7668
7570
  }
7669
7571
  };
7670
- const MeshEndpointSchema = zod.z.object({
7671
- id: zod.z.string(),
7672
- label: zod.z.string(),
7673
- scope: zod.z.enum(["mesh", "public"]),
7674
- url: zod.z.string(),
7675
- hostname: zod.z.string(),
7676
- port: zod.z.number(),
7677
- protocol: zod.z.enum(["http", "https"])
7678
- });
7679
- const MeshProviderInfoSchema = zod.z.object({
7680
- /** Stable id matching the addon id. */
7681
- addonId: zod.z.string(),
7682
- /** Display label shown on the admin row — sourced from the addon manifest. */
7683
- displayName: zod.z.string(),
7684
- /** True when the host is joined to this provider's mesh. */
7685
- joined: zod.z.boolean(),
7686
- /** Local mesh IP (empty when not joined). */
7687
- meshIp: zod.z.string(),
7688
- /** MagicDNS / mesh hostname (empty when not configured). */
7689
- magicDnsHostname: zod.z.string(),
7690
- /** Peer count (excluding self). */
7691
- peerCount: zod.z.number(),
7692
- /** Active endpoints (mesh IP + MagicDNS + optional public Funnel). */
7693
- endpoints: zod.z.array(MeshEndpointSchema).readonly(),
7694
- /** Last error reported by the provider. */
7695
- error: zod.z.string().optional(),
7696
- // ── Generic identity fields mirrored from MeshStatus ─────────────
7697
- /** Tenant / tailnet / network display name. Empty pre-join. */
7698
- tenantName: zod.z.string(),
7699
- /** Mesh DNS suffix (e.g. tailXXXX.ts.net). Empty when not configured. */
7700
- magicDnsSuffix: zod.z.string(),
7701
- /** Authenticated user / account login. Null for token-only providers. */
7702
- userLogin: zod.z.string().nullable(),
7703
- /** Provider control-plane URL. */
7704
- controlPlaneUrl: zod.z.string(),
7705
- /** Machine-key expiry (epoch ms). Null when keys don't rotate. */
7706
- keyExpiry: zod.z.number().nullable()
7707
- });
7708
- const meshOrchestratorCapability = {
7709
- name: "mesh-orchestrator",
7710
- scope: "system",
7711
- mode: "singleton",
7712
- methods: {
7713
- /** All registered mesh-network providers + live status. */
7714
- listProviders: method(zod.z.void(), zod.z.array(MeshProviderInfoSchema).readonly()),
7715
- /**
7716
- * Join the mesh of a specific provider. Per-provider config still
7717
- * lives on its settings panel; the orchestrator forwards.
7718
- */
7719
- joinProvider: method(
7720
- zod.z.object({
7721
- addonId: zod.z.string(),
7722
- authKey: zod.z.string().min(8),
7723
- hostname: zod.z.string().optional()
7724
- }),
7725
- zod.z.object({ joined: zod.z.literal(true) }),
7726
- { kind: "mutation" }
7727
- ),
7728
- leaveProvider: method(
7729
- zod.z.object({ addonId: zod.z.string() }),
7730
- zod.z.object({ success: zod.z.literal(true) }),
7731
- { kind: "mutation" }
7732
- ),
7733
- /**
7734
- * Browser-redirect login flow. Forwards to the named provider's
7735
- * `mesh-network.startLogin` and returns the URL the daemon
7736
- * prints. UI opens it in a new tab, then polls `listProviders`
7737
- * for `joined: true`.
7738
- */
7739
- startLoginProvider: method(
7740
- zod.z.object({
7741
- addonId: zod.z.string(),
7742
- hostname: zod.z.string().optional()
7743
- }),
7744
- zod.z.object({ loginUrl: zod.z.string() }),
7745
- { kind: "mutation" }
7746
- ),
7747
- /**
7748
- * Sign out of the provider's account entirely (`mesh-network.logout`).
7749
- * Distinct from `leaveProvider` which only takes the host off-mesh;
7750
- * `logoutProvider` wipes credentials so the next start requires a
7751
- * fresh login.
7752
- */
7753
- logoutProvider: method(
7754
- zod.z.object({ addonId: zod.z.string() }),
7755
- zod.z.object({ loggedOut: zod.z.literal(true) }),
7756
- { kind: "mutation" }
7757
- ),
7758
- /**
7759
- * Per-provider peer list. Forwards to `mesh-network.listPeers` on
7760
- * the addressed provider. Separate from `listProviders` because
7761
- * peer payloads can be large on a heavily-populated tailnet —
7762
- * fetch only when the operator opens the Peers tab.
7763
- */
7764
- listProviderPeers: method(
7765
- zod.z.object({ addonId: zod.z.string() }),
7766
- zod.z.object({
7767
- peers: zod.z.array(MeshPeerSchema).readonly()
7768
- })
7769
- )
7770
- }
7771
- };
7772
7572
  const MethodAccessSchema = zod.z.enum(["view", "create", "delete"]);
7773
7573
  const AllowedProviderSchema = zod.z.union([zod.z.literal("*"), zod.z.array(zod.z.string())]);
7774
7574
  const AllowedDevicesSchema = zod.z.record(zod.z.string(), zod.z.union([zod.z.literal("*"), zod.z.array(zod.z.string())]));
@@ -8181,6 +7981,7 @@ const nodesCapability = {
8181
7981
  name: "nodes",
8182
7982
  scope: "system",
8183
7983
  mode: "singleton",
7984
+ nodeIdMode: "data",
8184
7985
  methods: {
8185
7986
  topology: method(
8186
7987
  zod.z.void(),
@@ -8462,6 +8263,21 @@ const AddonAutoUpdateSchema = ChannelWithInheritSchema;
8462
8263
  const RestartAddonResultSchema = zod.z.unknown();
8463
8264
  const InstallPackageResultSchema = zod.z.unknown();
8464
8265
  const ReloadPackagesResultSchema = zod.z.unknown();
8266
+ const UpdateFrameworkPackageResultSchema = zod.z.object({
8267
+ packageName: zod.z.string(),
8268
+ fromVersion: zod.z.string(),
8269
+ toVersion: zod.z.string(),
8270
+ /** Ms-epoch the server scheduled its self-restart. */
8271
+ restartingAt: zod.z.number()
8272
+ });
8273
+ const FrameworkPackageStatusSchema = zod.z.object({
8274
+ packageName: zod.z.string(),
8275
+ currentVersion: zod.z.string(),
8276
+ latestVersion: zod.z.string().nullable(),
8277
+ hasUpdate: zod.z.boolean(),
8278
+ /** Optional manifest description for the row tooltip. */
8279
+ description: zod.z.string().optional()
8280
+ });
8465
8281
  const LogStreamEntrySchema = zod.z.object({
8466
8282
  timestamp: zod.z.string(),
8467
8283
  level: zod.z.string(),
@@ -8478,6 +8294,7 @@ const addonsCapability = {
8478
8294
  name: "addons",
8479
8295
  scope: "system",
8480
8296
  mode: "singleton",
8297
+ nodeIdMode: "data",
8481
8298
  methods: {
8482
8299
  // ── Listing ──────────────────────────────────────────────────────
8483
8300
  list: method(zod.z.void(), zod.z.array(AddonListItemSchema).readonly()),
@@ -8524,13 +8341,29 @@ const addonsCapability = {
8524
8341
  zod.z.object({ query: zod.z.string().optional() }),
8525
8342
  zod.z.array(SearchResultSchema)
8526
8343
  ),
8344
+ /**
8345
+ * Available package updates for a node. `nodeId` omitted (or
8346
+ * `'hub'`) checks the hub's own installed packages; an agent
8347
+ * `nodeId` checks that agent's installed roster against npm
8348
+ * (the hub does the npm lookups + diff — agents stay npm-free).
8349
+ */
8527
8350
  listUpdates: method(
8528
- zod.z.void(),
8351
+ zod.z.object({ nodeId: zod.z.string().optional() }),
8529
8352
  zod.z.array(PackageUpdateSchema).readonly(),
8530
8353
  { auth: "admin" }
8531
8354
  ),
8355
+ /**
8356
+ * Update one package on a node. `nodeId` omitted (or `'hub'`)
8357
+ * installs on the hub via npm; an agent `nodeId` makes the hub
8358
+ * pack the resolved version and push the tarball to that agent
8359
+ * (`$agent.deploy` + `$agent.reload`) — agents need no npm runtime.
8360
+ */
8532
8361
  updatePackage: method(
8533
- zod.z.object({ name: zod.z.string().min(1), version: zod.z.string().optional() }),
8362
+ zod.z.object({
8363
+ name: zod.z.string().min(1),
8364
+ version: zod.z.string().optional(),
8365
+ nodeId: zod.z.string().optional()
8366
+ }),
8534
8367
  zod.z.unknown(),
8535
8368
  { kind: "mutation", auth: "admin" }
8536
8369
  ),
@@ -8551,12 +8384,128 @@ const addonsCapability = {
8551
8384
  zod.z.object({ rolledBackTo: zod.z.string().nullable() }),
8552
8385
  { kind: "mutation", auth: "admin" }
8553
8386
  ),
8554
- forceRefresh: method(zod.z.void(), zod.z.unknown(), { kind: "mutation", auth: "admin" }),
8387
+ /** Re-check updates for a node, bypassing any cache. `nodeId`
8388
+ * omitted (or `'hub'`) refreshes the hub; an agent `nodeId`
8389
+ * re-checks that agent's roster. */
8390
+ forceRefresh: method(
8391
+ zod.z.object({ nodeId: zod.z.string().optional() }),
8392
+ zod.z.unknown(),
8393
+ { kind: "mutation", auth: "admin" }
8394
+ ),
8555
8395
  restartServer: method(
8556
8396
  zod.z.object({ confirm: zod.z.literal(true) }),
8557
8397
  zod.z.unknown(),
8558
8398
  { kind: "mutation", auth: "admin" }
8559
8399
  ),
8400
+ /**
8401
+ * Most-recent restart marker (kind / packageName / from→to versions
8402
+ * / requestedBy / requestedAt). Returns `null` when this process
8403
+ * didn't boot from a tracked restart, or when the
8404
+ * post-boot retention window (5 min) has elapsed.
8405
+ *
8406
+ * Drives the admin-UI reconnect overlay's success toast — the
8407
+ * `system.restart-completed` event itself is fired before the
8408
+ * client has time to re-subscribe, so the client queries this on
8409
+ * first reconnect instead.
8410
+ */
8411
+ getLastRestart: method(
8412
+ zod.z.void(),
8413
+ zod.z.object({
8414
+ kind: zod.z.enum(["framework-update", "manual", "system"]),
8415
+ packageName: zod.z.string().optional(),
8416
+ fromVersion: zod.z.string().optional(),
8417
+ toVersion: zod.z.string().optional(),
8418
+ requestedBy: zod.z.string().optional(),
8419
+ requestedAt: zod.z.number()
8420
+ }).nullable(),
8421
+ { auth: "admin" }
8422
+ ),
8423
+ /**
8424
+ * Snapshot of the framework packages installed under the hub's
8425
+ * `<appRoot>/node_modules/`. Each row carries the currently
8426
+ * installed version and (best-effort) the latest version
8427
+ * available on npm. Drives the admin-UI "System packages" panel.
8428
+ *
8429
+ * Spec: docs/superpowers/specs/2026-05-14-framework-live-update-design.md
8430
+ */
8431
+ listFrameworkPackages: method(
8432
+ zod.z.void(),
8433
+ zod.z.array(FrameworkPackageStatusSchema).readonly(),
8434
+ { auth: "admin" }
8435
+ ),
8436
+ /**
8437
+ * Cluster-wide capability-provider discovery. Returns the list of
8438
+ * `{ addonId, mode, isActive }` tuples for whatever addon(s)
8439
+ * currently provide the requested capability across the cluster.
8440
+ *
8441
+ * Why this lives on `addons` (and not on a `capabilities` cap of
8442
+ * its own): the hub's main-process `CapabilityRegistry` already
8443
+ * aggregates registrations from every forked group-runner and
8444
+ * remote agent via Moleculer event propagation — there's no
8445
+ * cross-process registry mirror to build, just an introspection
8446
+ * shim.
8447
+ *
8448
+ * Use this from addon code when you need to know whether another
8449
+ * addon has registered a specific cap (e.g. `tailscale-ingress`
8450
+ * checking `tailscale-client` is up before calling `tailscale
8451
+ * serve`). Don't reach for `ctx.capabilities.getCollectionEntries`
8452
+ * — that reads the LOCAL registry of the calling addon's group
8453
+ * runner and never sees providers in other processes. See
8454
+ * `CLAUDE.md` → Critical rules → ctx.api vs ctx.capabilities.
8455
+ */
8456
+ listCapabilityProviders: method(
8457
+ zod.z.object({ capName: zod.z.string().min(1) }),
8458
+ zod.z.array(zod.z.object({
8459
+ addonId: zod.z.string(),
8460
+ mode: zod.z.enum(["singleton", "collection"]),
8461
+ isActive: zod.z.boolean()
8462
+ })).readonly()
8463
+ ),
8464
+ /**
8465
+ * Toggle a single collection-cap provider on/off. Generic write-side
8466
+ * counterpart of `listCapabilityProviders` — drives the per-provider
8467
+ * Enable/Disable affordance in admin pages (TURN servers, etc.)
8468
+ * without needing a bespoke orchestrator cap.
8469
+ *
8470
+ * Reaches the hub's `CapabilityRegistry` directly:
8471
+ * `enableCollectionProvider` / `disableCollectionProvider` flip the
8472
+ * registry-level `disabledProviders` set. `getCollectionEntries`
8473
+ * already filters disabled providers out, so a disabled provider
8474
+ * drops out of every collection aggregate immediately. Only valid
8475
+ * for `mode: 'collection'` caps — the registry no-ops + warns for
8476
+ * singletons.
8477
+ */
8478
+ setCapabilityProviderEnabled: method(
8479
+ zod.z.object({
8480
+ capName: zod.z.string().min(1),
8481
+ addonId: zod.z.string().min(1),
8482
+ enabled: zod.z.boolean()
8483
+ }),
8484
+ zod.z.object({ success: zod.z.literal(true) }),
8485
+ { kind: "mutation", auth: "admin" }
8486
+ ),
8487
+ /**
8488
+ * Live-update one of the framework packages marked
8489
+ * `camstack.system: true` (`@camstack/types|kernel|core|sdk|ui-library`).
8490
+ * Runs `npm install --prefix <appRoot> <name>@<version> --no-save`,
8491
+ * writes a `.restart-pending` marker, emits `system.restarting`
8492
+ * and schedules a graceful process exit. The supervisor (Docker /
8493
+ * Electron / systemd) brings the hub back up; on first boot after
8494
+ * the restart the marker fires `system.restart-completed`.
8495
+ *
8496
+ * `version` defaults to `'latest'`. The allow-list of valid
8497
+ * `packageName` values is enforced server-side.
8498
+ *
8499
+ * Spec: docs/superpowers/specs/2026-05-14-framework-live-update-design.md
8500
+ */
8501
+ updateFrameworkPackage: method(
8502
+ zod.z.object({
8503
+ packageName: zod.z.string().min(1),
8504
+ version: zod.z.string().optional()
8505
+ }),
8506
+ UpdateFrameworkPackageResultSchema,
8507
+ { kind: "mutation", auth: "admin" }
8508
+ ),
8560
8509
  getVersions: method(
8561
8510
  zod.z.object({ name: zod.z.string() }),
8562
8511
  zod.z.array(PackageVersionInfoSchema).readonly()
@@ -8673,7 +8622,6 @@ exports.AudioMetricsHistoryPointSchema = AudioMetricsHistoryPointSchema;
8673
8622
  exports.AudioMetricsHistorySchema = AudioMetricsHistorySchema;
8674
8623
  exports.AudioMetricsSnapshotSchema = AudioMetricsSnapshotSchema;
8675
8624
  exports.AudioPcmChunkSchema = AudioPcmChunkSchema;
8676
- exports.AuthProviderInfoSchema = AuthProviderInfoSchema;
8677
8625
  exports.AuthResultSchema = AuthResultSchema;
8678
8626
  exports.AutoUpdateSettingsSchema = AutoUpdateSettingsSchema;
8679
8627
  exports.AvailableIntegrationTypeSchema = AvailableIntegrationTypeSchema;
@@ -8753,6 +8701,8 @@ exports.EndDownloadInputSchema = EndDownloadInputSchema;
8753
8701
  exports.EnrichedWidgetMetadataSchema = EnrichedWidgetMetadataSchema;
8754
8702
  exports.EventItemSchema = EventItemSchema;
8755
8703
  exports.EventKindSchema = EventKindSchema;
8704
+ exports.ExportSetupFieldSchema = ExportSetupFieldSchema;
8705
+ exports.ExportSetupSchema = ExportSetupSchema;
8756
8706
  exports.ExposeInputSchema = ExposeInputSchema;
8757
8707
  exports.ExposedDeviceSchema = ExposedDeviceSchema;
8758
8708
  exports.ExposedResourceSchema = ExposedResourceSchema;
@@ -8777,6 +8727,8 @@ exports.LogLevelSchema = LogLevelSchema$1;
8777
8727
  exports.LogStreamEntrySchema = LogStreamEntrySchema;
8778
8728
  exports.MODEL_FORMATS = MODEL_FORMATS;
8779
8729
  exports.MediaFileSchema = MediaFileSchema;
8730
+ exports.MeshPeerSchema = MeshPeerSchema;
8731
+ exports.MeshStatusSchema = MeshStatusSchema;
8780
8732
  exports.MethodAccessSchema = MethodAccessSchema;
8781
8733
  exports.MotionAnalysisResultSchema = MotionAnalysisResultSchema;
8782
8734
  exports.MotionEventSchema = MotionEventSchema;
@@ -8831,8 +8783,6 @@ exports.PtzPresetSchema = PtzPresetSchema;
8831
8783
  exports.QueryFilterSchema = QueryFilterSchema;
8832
8784
  exports.ReadChunkInputSchema = ReadChunkInputSchema;
8833
8785
  exports.RegisteredStreamSchema = RegisteredStreamSchema;
8834
- exports.RemoteAccessEndpointSchema = RemoteAccessEndpointSchema;
8835
- exports.RemoteAccessProviderInfoSchema = RemoteAccessProviderInfoSchema;
8836
8786
  exports.ReportMotionInputSchema = ReportMotionInputSchema;
8837
8787
  exports.RtpSourceSchema = RtpSourceSchema;
8838
8788
  exports.RtspRestreamEntrySchema = RtspRestreamEntrySchema;
@@ -8877,7 +8827,6 @@ exports.TopologyServiceSchema = TopologyServiceSchema;
8877
8827
  exports.TrackSchema = TrackSchema;
8878
8828
  exports.TrackStateSchema = TrackStateSchema;
8879
8829
  exports.TrackedDetectionSchema = TrackedDetectionSchema;
8880
- exports.TurnProviderInfoSchema = TurnProviderInfoSchema;
8881
8830
  exports.TurnServerSchema = TurnServerSchema;
8882
8831
  exports.UnexposeInputSchema = UnexposeInputSchema;
8883
8832
  exports.UpdateIntegrationInputSchema = UpdateIntegrationInputSchema;
@@ -8917,7 +8866,6 @@ exports.audioAnalyzerCapability = audioAnalyzerCapability;
8917
8866
  exports.audioCodecCapability = audioCodecCapability;
8918
8867
  exports.audioMetricsCapability = audioMetricsCapability;
8919
8868
  exports.authProviderCapability = authProviderCapability;
8920
- exports.authenticationCapability = authenticationCapability;
8921
8869
  exports.backupCapability = backupCapability;
8922
8870
  exports.batteryCapability = batteryCapability;
8923
8871
  exports.brightnessCapability = brightnessCapability;
@@ -8948,7 +8896,6 @@ exports.localNetworkCapability = localNetworkCapability;
8948
8896
  exports.logDestinationCapability = logDestinationCapability;
8949
8897
  exports.mapAudioLabelToMacro = mapAudioLabelToMacro;
8950
8898
  exports.meshNetworkCapability = meshNetworkCapability;
8951
- exports.meshOrchestratorCapability = meshOrchestratorCapability;
8952
8899
  exports.method = method;
8953
8900
  exports.metricsProviderCapability = metricsProviderCapability;
8954
8901
  exports.motionCapability = motionCapability;
@@ -8971,7 +8918,6 @@ exports.ptzCapability = ptzCapability;
8971
8918
  exports.rebootCapability = rebootCapability;
8972
8919
  exports.recordingCapability = recordingCapability;
8973
8920
  exports.recordingEngineCapability = recordingEngineCapability;
8974
- exports.remoteAccessCapability = remoteAccessCapability;
8975
8921
  exports.resolveDeviceProfile = resolveDeviceProfile;
8976
8922
  exports.restreamerCapability = restreamerCapability;
8977
8923
  exports.settingsStoreCapability = settingsStoreCapability;
@@ -8986,7 +8932,6 @@ exports.streamingEngineCapability = streamingEngineCapability;
8986
8932
  exports.switchCapability = switchCapability;
8987
8933
  exports.systemCapability = systemCapability;
8988
8934
  exports.toastCapability = toastCapability;
8989
- exports.turnOrchestratorCapability = turnOrchestratorCapability;
8990
8935
  exports.turnProviderCapability = turnProviderCapability;
8991
8936
  exports.userManagementCapability = userManagementCapability;
8992
8937
  exports.userPasskeysCapability = userPasskeysCapability;
@@ -8996,4 +8941,4 @@ exports.webrtcSessionCapability = webrtcSessionCapability;
8996
8941
  exports.zoneAnalyticsCapability = zoneAnalyticsCapability;
8997
8942
  exports.zoneRulesCapability = zoneRulesCapability;
8998
8943
  exports.zonesCapability = zonesCapability;
8999
- //# sourceMappingURL=index-DRWlYskM.js.map
8944
+ //# sourceMappingURL=index-BkSgJYP7.js.map