@camstack/types 0.1.32 → 0.1.34

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 (48) hide show
  1. package/dist/capabilities/addons.cap.d.ts +155 -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 +1 -1
  6. package/dist/capabilities/index.d.ts.map +1 -1
  7. package/dist/capabilities/mesh-network.cap.d.ts +58 -2
  8. package/dist/capabilities/mesh-network.cap.d.ts.map +1 -1
  9. package/dist/capabilities/mesh-orchestrator.cap.d.ts +67 -0
  10. package/dist/capabilities/mesh-orchestrator.cap.d.ts.map +1 -1
  11. package/dist/capabilities/nodes.cap.d.ts +36 -1
  12. package/dist/capabilities/nodes.cap.d.ts.map +1 -1
  13. package/dist/capabilities/user-management.cap.d.ts +4 -0
  14. package/dist/capabilities/user-management.cap.d.ts.map +1 -1
  15. package/dist/enums/event-category.d.ts +10 -0
  16. package/dist/enums/event-category.d.ts.map +1 -1
  17. package/dist/generated/addon-api.d.ts +386 -8
  18. package/dist/generated/addon-api.d.ts.map +1 -1
  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 +4 -4
  23. package/dist/generated/system-proxy.d.ts.map +1 -1
  24. package/dist/{index-BBVUwOlZ.mjs → index-Ce7RZWP4.mjs} +491 -170
  25. package/dist/index-Ce7RZWP4.mjs.map +1 -0
  26. package/dist/{index-BUBhoPUu.js → index-DS7418lf.js} +331 -10
  27. package/dist/index-DS7418lf.js.map +1 -0
  28. package/dist/index.js +23 -2
  29. package/dist/index.js.map +1 -1
  30. package/dist/index.mjs +184 -163
  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/api-responses.d.ts +6 -0
  35. package/dist/interfaces/api-responses.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/storage.d.ts +1 -1
  39. package/dist/interfaces/storage.d.ts.map +1 -1
  40. package/dist/node.js +6 -6
  41. package/dist/node.js.map +1 -1
  42. package/dist/node.mjs +6 -6
  43. package/dist/node.mjs.map +1 -1
  44. package/dist/storage/filesystem-storage-provider.d.ts +1 -1
  45. package/dist/storage/filesystem-storage-provider.d.ts.map +1 -1
  46. package/package.json +6 -1
  47. package/dist/index-BBVUwOlZ.mjs.map +0 -1
  48. package/dist/index-BUBhoPUu.js.map +0 -1
@@ -3868,10 +3868,30 @@ const mqttBrokerCapability = {
3868
3868
  }
3869
3869
  };
3870
3870
  const LinkStateSchema = z.enum(["unlinked", "linked", "error"]);
3871
+ const ExportSetupFieldSchema = z.object({
3872
+ label: z.string(),
3873
+ value: z.string(),
3874
+ /** Mask the value by default + render a reveal toggle (client id, secrets). */
3875
+ secret: z.boolean().optional()
3876
+ });
3877
+ const ExportSetupSchema = z.object({
3878
+ /** A string to render as a scannable QR — HAP `X-HM://…` URI, a pairing URL, etc. Omitted when there's nothing to scan. */
3879
+ qr: z.string().optional(),
3880
+ /** Label/value rows shown with a copy button (HAP setup code, OAuth URLs, client id, linked-account count, …). */
3881
+ fields: z.array(ExportSetupFieldSchema).readonly().optional(),
3882
+ /** Free-form operator instructions rendered above the fields. */
3883
+ note: z.string().optional()
3884
+ });
3871
3885
  const DeviceExportStatusSchema = z.object({
3872
3886
  linkState: LinkStateSchema,
3873
3887
  exposedDeviceCount: z.number(),
3874
- error: z.string().optional()
3888
+ error: z.string().optional(),
3889
+ /**
3890
+ * Optional pairing/account info the panel renders in a generic
3891
+ * "Setup" section. Addon-agnostic — the addon id identifies the
3892
+ * export target, never an `ecosystem` key here.
3893
+ */
3894
+ setup: ExportSetupSchema.optional()
3875
3895
  });
3876
3896
  const DeviceKindSchema = z.string();
3877
3897
  const ExposedDeviceSchema = z.object({
@@ -7469,7 +7489,9 @@ const MeshPeerSchema = z.object({
7469
7489
  id: z.string(),
7470
7490
  /** Hostname / device name as shown in the mesh dashboard. */
7471
7491
  hostname: z.string(),
7472
- /** Mesh IP(s). Multiple when the peer is dual-stacked. */
7492
+ /** MagicDNS / mesh DNS name (e.g. `peer-foo.tail-abc.ts.net`). Empty when the provider doesn't support DNS or peer-side resolution is disabled. */
7493
+ magicDns: z.string(),
7494
+ /** Mesh IPv4 / IPv6 addresses combined. Multiple when dual-stacked. */
7473
7495
  addresses: z.array(z.string()).readonly(),
7474
7496
  /** Operating system reported by the peer (informational). */
7475
7497
  os: z.string().optional(),
@@ -7478,7 +7500,32 @@ const MeshPeerSchema = z.object({
7478
7500
  /** Last-seen timestamp (epoch ms). 0 when never seen. */
7479
7501
  lastSeenMs: z.number(),
7480
7502
  /** True for the row representing the current host. */
7481
- isSelf: z.boolean()
7503
+ isSelf: z.boolean(),
7504
+ /**
7505
+ * Connection mode to this peer:
7506
+ * - `direct`: NAT-traversed P2P (UDP punched)
7507
+ * - `relay`: traffic relayed through provider edge (Tailscale DERP)
7508
+ * - `idle`: peer reachable but no recent traffic / handshake
7509
+ */
7510
+ connection: z.enum(["direct", "relay", "idle"]),
7511
+ /** DERP region / relay node identifier when `connection: relay`. Null otherwise. */
7512
+ relay: z.string().nullable(),
7513
+ /** Last successful handshake timestamp (epoch ms). 0 when never. */
7514
+ lastHandshakeMs: z.number(),
7515
+ /** Bytes received from this peer since the daemon started. */
7516
+ rxBytes: z.number(),
7517
+ /** Bytes transmitted to this peer since the daemon started. */
7518
+ txBytes: z.number(),
7519
+ /** ACL tags this peer carries (e.g. `["tag:server"]`). Empty when human-owned. */
7520
+ tags: z.array(z.string()).readonly(),
7521
+ /** True when the peer advertises itself as an exit-node candidate. */
7522
+ exitNodeOption: z.boolean(),
7523
+ /** Subnet routes the peer advertises (e.g. `["192.168.1.0/24"]`). */
7524
+ advertisedRoutes: z.array(z.string()).readonly(),
7525
+ /** Owner account login (e.g. `foo@example.com`). Null for tagged peers. */
7526
+ userLogin: z.string().nullable(),
7527
+ /** Pre-auth key / machine-key expiry (epoch ms). Null when keys don't expire. */
7528
+ keyExpiry: z.number().nullable()
7482
7529
  });
7483
7530
  const MeshStatusSchema = z.object({
7484
7531
  /** True when the host is joined and the daemon reports healthy. */
@@ -7492,7 +7539,56 @@ const MeshStatusSchema = z.object({
7492
7539
  /** Every endpoint this provider exposes for the current host. */
7493
7540
  endpoints: z.array(MeshEndpointSchema$1).readonly(),
7494
7541
  /** Last error from the daemon, when not joined. */
7495
- error: z.string().optional()
7542
+ error: z.string().optional(),
7543
+ // ── Account / tenant identity (generic across providers) ────────
7544
+ /**
7545
+ * Tenant / tailnet / network display name (Tailscale = tailnet
7546
+ * domain, Headscale = namespace, ZeroTier = network name). Empty
7547
+ * pre-join. Per-provider semantics, common slot.
7548
+ */
7549
+ tenantName: z.string(),
7550
+ /**
7551
+ * Mesh DNS suffix when the provider exposes peer-resolvable DNS
7552
+ * (Tailscale MagicDNS, Headscale MagicDNS, …). Empty when the
7553
+ * provider doesn't ship DNS (e.g. ZeroTier).
7554
+ */
7555
+ magicDnsSuffix: z.string(),
7556
+ /**
7557
+ * Authenticated user / account login bound to this host. Null when
7558
+ * the provider authenticates with a long-lived network token rather
7559
+ * than a user account (e.g. ZeroTier API token).
7560
+ */
7561
+ userLogin: z.string().nullable(),
7562
+ /**
7563
+ * Provider control-plane URL (Tailscale SaaS `https://login.tailscale.com`,
7564
+ * self-hosted Headscale, ZeroTier Central, …). Empty when not
7565
+ * applicable (rare).
7566
+ */
7567
+ controlPlaneUrl: z.string(),
7568
+ /**
7569
+ * Machine-key / node-key expiry (epoch ms). Null when the provider
7570
+ * doesn't rotate keys for the bound host. Operator-facing surface
7571
+ * for "your access expires on …" banners.
7572
+ */
7573
+ keyExpiry: z.number().nullable(),
7574
+ // ── Onboard-daemon handoff (Tailscale, generic slot) ────────────
7575
+ /**
7576
+ * When the provider runs its OWN mesh daemon (e.g. the Tailscale
7577
+ * client addon in `onboard` mode spawns a private `tailscaled`),
7578
+ * this carries the local control-socket path. Companion addons that
7579
+ * must drive the SAME daemon — chiefly `tailscale-ingress` for
7580
+ * Serve/Funnel — read it to point their CLI at the right socket
7581
+ * instead of the system default. Empty when the provider uses the
7582
+ * host's system daemon (or doesn't have the concept).
7583
+ */
7584
+ daemonSocket: z.string().optional(),
7585
+ /**
7586
+ * Path to the mesh CLI binary the provider downloaded for onboard
7587
+ * mode. Companion addons reuse it so they don't need a system
7588
+ * install when the operator chose a fully self-contained mesh.
7589
+ * Empty in host mode.
7590
+ */
7591
+ daemonCliPath: z.string().optional()
7496
7592
  });
7497
7593
  const meshNetworkCapability = {
7498
7594
  name: "mesh-network",
@@ -7544,12 +7640,26 @@ const meshNetworkCapability = {
7544
7640
  { kind: "mutation" }
7545
7641
  ),
7546
7642
  /** Leave the mesh. After this the meshIp/magicDnsHostname/etc.
7547
- * vanish until the next `join`. */
7643
+ * vanish until the next `join`. The bound account stays — a
7644
+ * subsequent `join` reuses it without prompting for a new login. */
7548
7645
  leave: method(
7549
7646
  z.void(),
7550
7647
  z.object({ left: z.literal(true) }),
7551
7648
  { kind: "mutation" }
7552
7649
  ),
7650
+ /**
7651
+ * Sign out of the mesh account entirely. Distinct from `leave`:
7652
+ * `leave` only takes the host off-mesh (`tailscale down`) while the
7653
+ * account binding survives, so the next `join` reconnects silently.
7654
+ * `logout` (`tailscale logout`) wipes the daemon's stored
7655
+ * credentials — the next `startLogin` MUST go through a fresh
7656
+ * browser-redirect flow to bind a new account.
7657
+ */
7658
+ logout: method(
7659
+ z.void(),
7660
+ z.object({ loggedOut: z.literal(true) }),
7661
+ { kind: "mutation" }
7662
+ ),
7553
7663
  /** Enumerate every peer the daemon currently knows about. */
7554
7664
  listPeers: method(z.void(), z.object({
7555
7665
  peers: z.array(MeshPeerSchema).readonly()
@@ -7583,6 +7693,15 @@ const meshNetworkCapability = {
7583
7693
  }),
7584
7694
  { kind: "mutation" }
7585
7695
  )
7696
+ // Provider-specific runtime knobs (accept-routes / advertise-routes /
7697
+ // shields-up / ssh / exit-node, …) live on the addon's own
7698
+ // `getSettingsUISchema` (form-builder), NOT here. Different mesh
7699
+ // providers (Tailscale, Headscale, ZeroTier, Nebula) have very
7700
+ // different config surfaces — picking one shape and forcing all
7701
+ // implementations to honour it would either lose options or
7702
+ // misrepresent them. The Mesh page renders the addon's settings
7703
+ // schema as a "Settings" tab next to the generic Status / Peers
7704
+ // tabs driven by this cap.
7586
7705
  }
7587
7706
  };
7588
7707
  const MeshEndpointSchema = z.object({
@@ -7610,7 +7729,18 @@ const MeshProviderInfoSchema = z.object({
7610
7729
  /** Active endpoints (mesh IP + MagicDNS + optional public Funnel). */
7611
7730
  endpoints: z.array(MeshEndpointSchema).readonly(),
7612
7731
  /** Last error reported by the provider. */
7613
- error: z.string().optional()
7732
+ error: z.string().optional(),
7733
+ // ── Generic identity fields mirrored from MeshStatus ─────────────
7734
+ /** Tenant / tailnet / network display name. Empty pre-join. */
7735
+ tenantName: z.string(),
7736
+ /** Mesh DNS suffix (e.g. tailXXXX.ts.net). Empty when not configured. */
7737
+ magicDnsSuffix: z.string(),
7738
+ /** Authenticated user / account login. Null for token-only providers. */
7739
+ userLogin: z.string().nullable(),
7740
+ /** Provider control-plane URL. */
7741
+ controlPlaneUrl: z.string(),
7742
+ /** Machine-key expiry (epoch ms). Null when keys don't rotate. */
7743
+ keyExpiry: z.number().nullable()
7614
7744
  });
7615
7745
  const meshOrchestratorCapability = {
7616
7746
  name: "mesh-orchestrator",
@@ -7636,6 +7766,43 @@ const meshOrchestratorCapability = {
7636
7766
  z.object({ addonId: z.string() }),
7637
7767
  z.object({ success: z.literal(true) }),
7638
7768
  { kind: "mutation" }
7769
+ ),
7770
+ /**
7771
+ * Browser-redirect login flow. Forwards to the named provider's
7772
+ * `mesh-network.startLogin` and returns the URL the daemon
7773
+ * prints. UI opens it in a new tab, then polls `listProviders`
7774
+ * for `joined: true`.
7775
+ */
7776
+ startLoginProvider: method(
7777
+ z.object({
7778
+ addonId: z.string(),
7779
+ hostname: z.string().optional()
7780
+ }),
7781
+ z.object({ loginUrl: z.string() }),
7782
+ { kind: "mutation" }
7783
+ ),
7784
+ /**
7785
+ * Sign out of the provider's account entirely (`mesh-network.logout`).
7786
+ * Distinct from `leaveProvider` which only takes the host off-mesh;
7787
+ * `logoutProvider` wipes credentials so the next start requires a
7788
+ * fresh login.
7789
+ */
7790
+ logoutProvider: method(
7791
+ z.object({ addonId: z.string() }),
7792
+ z.object({ loggedOut: z.literal(true) }),
7793
+ { kind: "mutation" }
7794
+ ),
7795
+ /**
7796
+ * Per-provider peer list. Forwards to `mesh-network.listPeers` on
7797
+ * the addressed provider. Separate from `listProviders` because
7798
+ * peer payloads can be large on a heavily-populated tailnet —
7799
+ * fetch only when the operator opens the Peers tab.
7800
+ */
7801
+ listProviderPeers: method(
7802
+ z.object({ addonId: z.string() }),
7803
+ z.object({
7804
+ peers: z.array(MeshPeerSchema).readonly()
7805
+ })
7639
7806
  )
7640
7807
  }
7641
7808
  };
@@ -7723,6 +7890,13 @@ const UserSummarySchema = z.object({
7723
7890
  allowedProviders: z.union([z.array(z.string()), z.literal("*")]),
7724
7891
  allowedDevices: z.record(z.string(), z.union([z.array(z.string()), z.literal("*")])),
7725
7892
  scopes: z.array(TokenScopeSchema).default([]),
7893
+ /**
7894
+ * True iff this user has a CONFIRMED TOTP enrollment. Surfaced on
7895
+ * `listUsers` so the admin Users page can render the "Remove 2FA"
7896
+ * action conditionally without firing one `getTotpStatus` query per
7897
+ * row. Self-service enrollment lives on the user's profile page.
7898
+ */
7899
+ totpEnabled: z.boolean().default(false),
7726
7900
  createdAt: z.number(),
7727
7901
  updatedAt: z.number()
7728
7902
  });
@@ -8021,6 +8195,12 @@ const NodeAddonInputSchema = z.object({
8021
8195
  nodeId: z.string(),
8022
8196
  addonId: z.string()
8023
8197
  });
8198
+ const NodeAddonEntrySchema = z.object({
8199
+ id: z.string(),
8200
+ status: z.string(),
8201
+ version: z.string().optional(),
8202
+ packageName: z.string().optional()
8203
+ });
8024
8204
  const SuccessSchema = z.object({ success: z.boolean() });
8025
8205
  const RestartProcessResultSchema = z.object({
8026
8206
  success: z.boolean(),
@@ -8038,6 +8218,7 @@ const nodesCapability = {
8038
8218
  name: "nodes",
8039
8219
  scope: "system",
8040
8220
  mode: "singleton",
8221
+ nodeIdMode: "data",
8041
8222
  methods: {
8042
8223
  topology: method(
8043
8224
  z.void(),
@@ -8081,6 +8262,19 @@ const nodesCapability = {
8081
8262
  z.record(z.string(), ClusterAddonStatusEntrySchema),
8082
8263
  { auth: "admin" }
8083
8264
  ),
8265
+ /**
8266
+ * Direct per-node addon listing — calls `$agent.status` on the target
8267
+ * node (or returns the hub registry for `nodeId === 'hub'`) and surfaces
8268
+ * the full addon roster including `version` + `packageName`. The
8269
+ * `topology` cap also includes addons but strips them down to
8270
+ * `{id, capabilities, status}` for the cluster diagram; this method
8271
+ * is the one the per-node "Addons" tab should call.
8272
+ */
8273
+ getNodeAddons: method(
8274
+ z.object({ nodeId: z.string() }),
8275
+ z.array(NodeAddonEntrySchema).readonly(),
8276
+ { auth: "admin" }
8277
+ ),
8084
8278
  setProcessLogLevel: method(
8085
8279
  z.object({ nodeId: z.string(), level: z.string() }),
8086
8280
  SuccessSchema,
@@ -8306,6 +8500,21 @@ const AddonAutoUpdateSchema = ChannelWithInheritSchema;
8306
8500
  const RestartAddonResultSchema = z.unknown();
8307
8501
  const InstallPackageResultSchema = z.unknown();
8308
8502
  const ReloadPackagesResultSchema = z.unknown();
8503
+ const UpdateFrameworkPackageResultSchema = z.object({
8504
+ packageName: z.string(),
8505
+ fromVersion: z.string(),
8506
+ toVersion: z.string(),
8507
+ /** Ms-epoch the server scheduled its self-restart. */
8508
+ restartingAt: z.number()
8509
+ });
8510
+ const FrameworkPackageStatusSchema = z.object({
8511
+ packageName: z.string(),
8512
+ currentVersion: z.string(),
8513
+ latestVersion: z.string().nullable(),
8514
+ hasUpdate: z.boolean(),
8515
+ /** Optional manifest description for the row tooltip. */
8516
+ description: z.string().optional()
8517
+ });
8309
8518
  const LogStreamEntrySchema = z.object({
8310
8519
  timestamp: z.string(),
8311
8520
  level: z.string(),
@@ -8322,6 +8531,7 @@ const addonsCapability = {
8322
8531
  name: "addons",
8323
8532
  scope: "system",
8324
8533
  mode: "singleton",
8534
+ nodeIdMode: "data",
8325
8535
  methods: {
8326
8536
  // ── Listing ──────────────────────────────────────────────────────
8327
8537
  list: method(z.void(), z.array(AddonListItemSchema).readonly()),
@@ -8368,13 +8578,29 @@ const addonsCapability = {
8368
8578
  z.object({ query: z.string().optional() }),
8369
8579
  z.array(SearchResultSchema)
8370
8580
  ),
8581
+ /**
8582
+ * Available package updates for a node. `nodeId` omitted (or
8583
+ * `'hub'`) checks the hub's own installed packages; an agent
8584
+ * `nodeId` checks that agent's installed roster against npm
8585
+ * (the hub does the npm lookups + diff — agents stay npm-free).
8586
+ */
8371
8587
  listUpdates: method(
8372
- z.void(),
8588
+ z.object({ nodeId: z.string().optional() }),
8373
8589
  z.array(PackageUpdateSchema).readonly(),
8374
8590
  { auth: "admin" }
8375
8591
  ),
8592
+ /**
8593
+ * Update one package on a node. `nodeId` omitted (or `'hub'`)
8594
+ * installs on the hub via npm; an agent `nodeId` makes the hub
8595
+ * pack the resolved version and push the tarball to that agent
8596
+ * (`$agent.deploy` + `$agent.reload`) — agents need no npm runtime.
8597
+ */
8376
8598
  updatePackage: method(
8377
- z.object({ name: z.string().min(1), version: z.string().optional() }),
8599
+ z.object({
8600
+ name: z.string().min(1),
8601
+ version: z.string().optional(),
8602
+ nodeId: z.string().optional()
8603
+ }),
8378
8604
  z.unknown(),
8379
8605
  { kind: "mutation", auth: "admin" }
8380
8606
  ),
@@ -8395,12 +8621,105 @@ const addonsCapability = {
8395
8621
  z.object({ rolledBackTo: z.string().nullable() }),
8396
8622
  { kind: "mutation", auth: "admin" }
8397
8623
  ),
8398
- forceRefresh: method(z.void(), z.unknown(), { kind: "mutation", auth: "admin" }),
8624
+ /** Re-check updates for a node, bypassing any cache. `nodeId`
8625
+ * omitted (or `'hub'`) refreshes the hub; an agent `nodeId`
8626
+ * re-checks that agent's roster. */
8627
+ forceRefresh: method(
8628
+ z.object({ nodeId: z.string().optional() }),
8629
+ z.unknown(),
8630
+ { kind: "mutation", auth: "admin" }
8631
+ ),
8399
8632
  restartServer: method(
8400
8633
  z.object({ confirm: z.literal(true) }),
8401
8634
  z.unknown(),
8402
8635
  { kind: "mutation", auth: "admin" }
8403
8636
  ),
8637
+ /**
8638
+ * Most-recent restart marker (kind / packageName / from→to versions
8639
+ * / requestedBy / requestedAt). Returns `null` when this process
8640
+ * didn't boot from a tracked restart, or when the
8641
+ * post-boot retention window (5 min) has elapsed.
8642
+ *
8643
+ * Drives the admin-UI reconnect overlay's success toast — the
8644
+ * `system.restart-completed` event itself is fired before the
8645
+ * client has time to re-subscribe, so the client queries this on
8646
+ * first reconnect instead.
8647
+ */
8648
+ getLastRestart: method(
8649
+ z.void(),
8650
+ z.object({
8651
+ kind: z.enum(["framework-update", "manual", "system"]),
8652
+ packageName: z.string().optional(),
8653
+ fromVersion: z.string().optional(),
8654
+ toVersion: z.string().optional(),
8655
+ requestedBy: z.string().optional(),
8656
+ requestedAt: z.number()
8657
+ }).nullable(),
8658
+ { auth: "admin" }
8659
+ ),
8660
+ /**
8661
+ * Snapshot of the framework packages installed under the hub's
8662
+ * `<appRoot>/node_modules/`. Each row carries the currently
8663
+ * installed version and (best-effort) the latest version
8664
+ * available on npm. Drives the admin-UI "System packages" panel.
8665
+ *
8666
+ * Spec: docs/superpowers/specs/2026-05-14-framework-live-update-design.md
8667
+ */
8668
+ listFrameworkPackages: method(
8669
+ z.void(),
8670
+ z.array(FrameworkPackageStatusSchema).readonly(),
8671
+ { auth: "admin" }
8672
+ ),
8673
+ /**
8674
+ * Cluster-wide capability-provider discovery. Returns the list of
8675
+ * `{ addonId, mode, isActive }` tuples for whatever addon(s)
8676
+ * currently provide the requested capability across the cluster.
8677
+ *
8678
+ * Why this lives on `addons` (and not on a `capabilities` cap of
8679
+ * its own): the hub's main-process `CapabilityRegistry` already
8680
+ * aggregates registrations from every forked group-runner and
8681
+ * remote agent via Moleculer event propagation — there's no
8682
+ * cross-process registry mirror to build, just an introspection
8683
+ * shim.
8684
+ *
8685
+ * Use this from addon code when you need to know whether another
8686
+ * addon has registered a specific cap (e.g. `tailscale-ingress`
8687
+ * checking `tailscale-client` is up before calling `tailscale
8688
+ * serve`). Don't reach for `ctx.capabilities.getCollectionEntries`
8689
+ * — that reads the LOCAL registry of the calling addon's group
8690
+ * runner and never sees providers in other processes. See
8691
+ * `CLAUDE.md` → Critical rules → ctx.api vs ctx.capabilities.
8692
+ */
8693
+ listCapabilityProviders: method(
8694
+ z.object({ capName: z.string().min(1) }),
8695
+ z.array(z.object({
8696
+ addonId: z.string(),
8697
+ mode: z.enum(["singleton", "collection"]),
8698
+ isActive: z.boolean()
8699
+ })).readonly()
8700
+ ),
8701
+ /**
8702
+ * Live-update one of the framework packages marked
8703
+ * `camstack.system: true` (`@camstack/types|kernel|core|sdk|ui-library`).
8704
+ * Runs `npm install --prefix <appRoot> <name>@<version> --no-save`,
8705
+ * writes a `.restart-pending` marker, emits `system.restarting`
8706
+ * and schedules a graceful process exit. The supervisor (Docker /
8707
+ * Electron / systemd) brings the hub back up; on first boot after
8708
+ * the restart the marker fires `system.restart-completed`.
8709
+ *
8710
+ * `version` defaults to `'latest'`. The allow-list of valid
8711
+ * `packageName` values is enforced server-side.
8712
+ *
8713
+ * Spec: docs/superpowers/specs/2026-05-14-framework-live-update-design.md
8714
+ */
8715
+ updateFrameworkPackage: method(
8716
+ z.object({
8717
+ packageName: z.string().min(1),
8718
+ version: z.string().optional()
8719
+ }),
8720
+ UpdateFrameworkPackageResultSchema,
8721
+ { kind: "mutation", auth: "admin" }
8722
+ ),
8404
8723
  getVersions: method(
8405
8724
  z.object({ name: z.string() }),
8406
8725
  z.array(PackageVersionInfoSchema).readonly()
@@ -8640,7 +8959,7 @@ export {
8640
8959
  ChargingStatus as by,
8641
8960
  ClientNetworkStatsSchema as bz,
8642
8961
  motionCapability as c,
8643
- OsdOverlayPatchSchema as c$,
8962
+ OrchestratorMetricsSchema as c$,
8644
8963
  UnexposeInputSchema as c0,
8645
8964
  DeviceFeature as c1,
8646
8965
  DeviceInfoSchema as c2,
@@ -8651,33 +8970,33 @@ export {
8651
8970
  DiscoveredChildDeviceSchema as c7,
8652
8971
  DiscoveredChildStatusSchema as c8,
8653
8972
  DiscoveredDeviceSchema as c9,
8654
- LogLevelSchema$1 as cA,
8655
- LogStreamEntrySchema as cB,
8656
- MODEL_FORMATS as cC,
8657
- MediaFileSchema as cD,
8658
- MethodAccessSchema as cE,
8659
- MotionAnalysisResultSchema as cF,
8660
- MotionEventSchema as cG,
8661
- MotionOnMotionChangedDataSchema as cH,
8662
- MotionRegionSchema as cI,
8663
- MotionSourceEnum as cJ,
8664
- MotionSourcesSchema as cK,
8665
- MotionStatusSchema as cL,
8666
- MotionTriggerRuntimeStateSchema as cM,
8667
- MotionTriggerStatusSchema as cN,
8668
- StatusSchema as cO,
8669
- NativeDetectionSchema as cP,
8670
- NativeObjectClassEnum as cQ,
8671
- NativeObjectDetectionStatusSchema as cR,
8672
- NetworkAccessStatusSchema as cS,
8673
- NetworkAddressSchema as cT,
8674
- NetworkEndpointSchema as cU,
8675
- NotificationHistoryEntrySchema as cV,
8676
- NotificationRuleSchema as cW,
8677
- NotificationSchema as cX,
8678
- ObjectEventSchema as cY,
8679
- OrchestratorMetricsSchema as cZ,
8680
- OsdOverlayKindEnum as c_,
8973
+ LocationStatSchema as cA,
8974
+ LogEntrySchema as cB,
8975
+ LogLevelSchema$1 as cC,
8976
+ LogStreamEntrySchema as cD,
8977
+ MODEL_FORMATS as cE,
8978
+ MediaFileSchema as cF,
8979
+ MethodAccessSchema as cG,
8980
+ MotionAnalysisResultSchema as cH,
8981
+ MotionEventSchema as cI,
8982
+ MotionOnMotionChangedDataSchema as cJ,
8983
+ MotionRegionSchema as cK,
8984
+ MotionSourceEnum as cL,
8985
+ MotionSourcesSchema as cM,
8986
+ MotionStatusSchema as cN,
8987
+ MotionTriggerRuntimeStateSchema as cO,
8988
+ MotionTriggerStatusSchema as cP,
8989
+ StatusSchema as cQ,
8990
+ NativeDetectionSchema as cR,
8991
+ NativeObjectClassEnum as cS,
8992
+ NativeObjectDetectionStatusSchema as cT,
8993
+ NetworkAccessStatusSchema as cU,
8994
+ NetworkAddressSchema as cV,
8995
+ NetworkEndpointSchema as cW,
8996
+ NotificationHistoryEntrySchema as cX,
8997
+ NotificationRuleSchema as cY,
8998
+ NotificationSchema as cZ,
8999
+ ObjectEventSchema as c_,
8681
9000
  DoorbellPressEventSchema as ca,
8682
9001
  DoorbellStatusSchema as cb,
8683
9002
  EmbeddingInfoSchema as cc,
@@ -8686,140 +9005,142 @@ export {
8686
9005
  EnrichedWidgetMetadataSchema as cf,
8687
9006
  EventItemSchema as cg,
8688
9007
  EventKindSchema as ch,
8689
- ExposedDeviceSchema as ci,
8690
- ExposedResourceSchema as cj,
8691
- FeatureManifestSchema as ck,
8692
- FeatureProbeStatusSchema as cl,
8693
- FrameInputSchema as cm,
8694
- GetStreamWithCodecInputSchema as cn,
8695
- GlobalMetricsSchema as co,
8696
- HWACCEL_OPTIONS as cp,
8697
- HealthStatusSchema as cq,
8698
- HistoryPointSchema as cr,
8699
- HistoryResolutionEnum as cs,
8700
- InstalledPackageSchema as ct,
8701
- IntegrationLiteSchema as cu,
8702
- IntegrationWithStateSchema as cv,
8703
- IntercomAbilitySchema as cw,
8704
- IntercomStatusSchema as cx,
8705
- LocationStatSchema as cy,
8706
- LogEntrySchema as cz,
9008
+ ExportSetupFieldSchema as ci,
9009
+ ExportSetupSchema as cj,
9010
+ ExposedDeviceSchema as ck,
9011
+ ExposedResourceSchema as cl,
9012
+ FeatureManifestSchema as cm,
9013
+ FeatureProbeStatusSchema as cn,
9014
+ FrameInputSchema as co,
9015
+ GetStreamWithCodecInputSchema as cp,
9016
+ GlobalMetricsSchema as cq,
9017
+ HWACCEL_OPTIONS as cr,
9018
+ HealthStatusSchema as cs,
9019
+ HistoryPointSchema as ct,
9020
+ HistoryResolutionEnum as cu,
9021
+ InstalledPackageSchema as cv,
9022
+ IntegrationLiteSchema as cw,
9023
+ IntegrationWithStateSchema as cx,
9024
+ IntercomAbilitySchema as cy,
9025
+ IntercomStatusSchema as cz,
8707
9026
  doorbellCapability as d,
8708
- StorageLocationSchema as d$,
8709
- OsdOverlaySchema as d0,
8710
- OsdPositionEnum as d1,
8711
- OsdStatusSchema as d2,
8712
- PIPELINE_FLOW_CAPABILITY_NAMES as d3,
8713
- PIPELINE_OWNER_CAPABILITY_NAMES as d4,
8714
- PackageUpdateSchema as d5,
8715
- PackageVersionInfoSchema as d6,
8716
- PasskeySummarySchema as d7,
8717
- PcmSampleFormatSchema as d8,
8718
- PerScopeBreakdownSchema as d9,
8719
- RunnerCameraDeviceUIFields as dA,
8720
- RunnerLocalLoadSchema as dB,
8721
- RunnerLocalMetricsSchema as dC,
8722
- STORAGE_LOCATION_CARDINALITY as dD,
8723
- ScopedTokenSchema as dE,
8724
- ScopedTokenSummarySchema as dF,
8725
- SearchResultSchema as dG,
8726
- SegmentSchema as dH,
8727
- SendEmailInputSchema as dI,
8728
- SendEmailResultSchema as dJ,
8729
- SettingsPatchSchema as dK,
8730
- SettingsRecordSchema as dL,
8731
- SettingsSchemaWithValuesSchema as dM,
8732
- SettingsUpdateResultSchema as dN,
8733
- SmtpStatusSchema as dO,
8734
- SnapshotImageSchema as dP,
8735
- SpatialDetectionSchema as dQ,
8736
- SsoBridgeClaimsSchema as dR,
8737
- StartEmbeddedInputSchema as dS,
8738
- AbortUploadInputSchema as dT,
8739
- BeginDownloadInputSchema as dU,
8740
- BeginDownloadResultSchema as dV,
8741
- BeginUploadInputSchema as dW,
8742
- BeginUploadResultSchema as dX,
8743
- EndDownloadInputSchema as dY,
8744
- FinalizeUploadInputSchema as dZ,
8745
- StorageLocationRefSchema as d_,
8746
- PipelineAssignmentSchema as da,
8747
- PipelineDefaultStepSchema as db,
8748
- PipelineEngineChoiceSchema as dc,
8749
- PipelineRunResultBridge as dd,
8750
- PipelineStepInputSchema as de,
8751
- PlaceholderReasonSchema as df,
8752
- PolygonPointSchema as dg,
8753
- ProfileSlotSchema as dh,
8754
- ProfileSlotStatusSchema as di,
8755
- ProviderStatusSchema as dj,
8756
- PtzAutotrackRuntimeStateSchema as dk,
8757
- PtzAutotrackSettingsSchema as dl,
8758
- PtzAutotrackStatusSchema as dm,
8759
- PtzAutotrackTargetOptionSchema as dn,
8760
- PtzMoveCommandSchema as dp,
8761
- PtzPositionSchema as dq,
8762
- PtzPresetSchema as dr,
8763
- QueryFilterSchema as ds,
8764
- RegisteredStreamSchema as dt,
8765
- RemoteAccessEndpointSchema as du,
8766
- RemoteAccessProviderInfoSchema as dv,
8767
- ReportMotionInputSchema as dw,
8768
- RtpSourceSchema as dx,
8769
- RtspRestreamEntrySchema as dy,
8770
- RunnerCameraConfigSchema as dz,
9027
+ FinalizeUploadInputSchema as d$,
9028
+ OsdOverlayKindEnum as d0,
9029
+ OsdOverlayPatchSchema as d1,
9030
+ OsdOverlaySchema as d2,
9031
+ OsdPositionEnum as d3,
9032
+ OsdStatusSchema as d4,
9033
+ PIPELINE_FLOW_CAPABILITY_NAMES as d5,
9034
+ PIPELINE_OWNER_CAPABILITY_NAMES as d6,
9035
+ PackageUpdateSchema as d7,
9036
+ PackageVersionInfoSchema as d8,
9037
+ PasskeySummarySchema as d9,
9038
+ RtspRestreamEntrySchema as dA,
9039
+ RunnerCameraConfigSchema as dB,
9040
+ RunnerCameraDeviceUIFields as dC,
9041
+ RunnerLocalLoadSchema as dD,
9042
+ RunnerLocalMetricsSchema as dE,
9043
+ STORAGE_LOCATION_CARDINALITY as dF,
9044
+ ScopedTokenSchema as dG,
9045
+ ScopedTokenSummarySchema as dH,
9046
+ SearchResultSchema as dI,
9047
+ SegmentSchema as dJ,
9048
+ SendEmailInputSchema as dK,
9049
+ SendEmailResultSchema as dL,
9050
+ SettingsPatchSchema as dM,
9051
+ SettingsRecordSchema as dN,
9052
+ SettingsSchemaWithValuesSchema as dO,
9053
+ SettingsUpdateResultSchema as dP,
9054
+ SmtpStatusSchema as dQ,
9055
+ SnapshotImageSchema as dR,
9056
+ SpatialDetectionSchema as dS,
9057
+ SsoBridgeClaimsSchema as dT,
9058
+ StartEmbeddedInputSchema as dU,
9059
+ AbortUploadInputSchema as dV,
9060
+ BeginDownloadInputSchema as dW,
9061
+ BeginDownloadResultSchema as dX,
9062
+ BeginUploadInputSchema as dY,
9063
+ BeginUploadResultSchema as dZ,
9064
+ EndDownloadInputSchema as d_,
9065
+ PcmSampleFormatSchema as da,
9066
+ PerScopeBreakdownSchema as db,
9067
+ PipelineAssignmentSchema as dc,
9068
+ PipelineDefaultStepSchema as dd,
9069
+ PipelineEngineChoiceSchema as de,
9070
+ PipelineRunResultBridge as df,
9071
+ PipelineStepInputSchema as dg,
9072
+ PlaceholderReasonSchema as dh,
9073
+ PolygonPointSchema as di,
9074
+ ProfileSlotSchema as dj,
9075
+ ProfileSlotStatusSchema as dk,
9076
+ ProviderStatusSchema as dl,
9077
+ PtzAutotrackRuntimeStateSchema as dm,
9078
+ PtzAutotrackSettingsSchema as dn,
9079
+ PtzAutotrackStatusSchema as dp,
9080
+ PtzAutotrackTargetOptionSchema as dq,
9081
+ PtzMoveCommandSchema as dr,
9082
+ PtzPositionSchema as ds,
9083
+ PtzPresetSchema as dt,
9084
+ QueryFilterSchema as du,
9085
+ RegisteredStreamSchema as dv,
9086
+ RemoteAccessEndpointSchema as dw,
9087
+ RemoteAccessProviderInfoSchema as dx,
9088
+ ReportMotionInputSchema as dy,
9089
+ RtpSourceSchema as dz,
8771
9090
  errMsg as e,
8772
- StorageLocationTypeSchema as e0,
8773
- ProviderInfoSchema as e1,
8774
- ReadChunkInputSchema as e2,
8775
- TestLocationResultSchema as e3,
8776
- WriteChunkInputSchema as e4,
8777
- StreamFormatSchema as e5,
8778
- StreamInfoSchema as e6,
8779
- StreamNetworkStatsSchema as e7,
8780
- StreamSourceEntrySchema$1 as e8,
8781
- StreamSourceSchema as e9,
8782
- ZoneRuleModeEnum as eA,
8783
- ZoneRuleSchema as eB,
8784
- ZoneRuleStageEnum as eC,
8785
- ZoneRulesArraySchema as eD,
8786
- ZoneSchema as eE,
8787
- ZoneScopeBreakdownSchema as eF,
8788
- accessoryStableId as eG,
8789
- deviceMatchesProfile as eH,
8790
- event as eI,
8791
- expandCapMethods as eJ,
8792
- getAudioMacroClassIds as eK,
8793
- mapAudioLabelToMacro as eL,
8794
- method as eM,
8795
- resolveDeviceProfile as eN,
8796
- webrtcClientHintsSchema as eO,
8797
- SwitchStatusSchema as ea,
8798
- SystemMetricsSchema as eb,
8799
- TestConnectionResultSchema as ec,
8800
- ToastSchema as ed,
8801
- TokenScopeSchema as ee,
8802
- TopologyNodeSchema as ef,
8803
- TopologyProcessSchema as eg,
8804
- TopologyServiceSchema as eh,
8805
- TrackSchema as ei,
8806
- TrackStateSchema as ej,
8807
- TrackedDetectionSchema as ek,
8808
- TurnProviderInfoSchema as el,
8809
- TurnServerSchema as em,
8810
- UpdateIntegrationInputSchema as en,
8811
- UpdateUserInputSchema as eo,
8812
- UserRecordSchema as ep,
8813
- UserSummarySchema as eq,
8814
- WELL_KNOWN_TABS as er,
8815
- WELL_KNOWN_TAB_MAP as es,
8816
- WebrtcStreamChoiceSchema as et,
8817
- WebrtcStreamTargetSchema as eu,
8818
- WidgetHostEnum as ev,
8819
- WidgetMetadataSchema as ew,
8820
- WidgetSizeEnum as ex,
8821
- YAMNET_TO_MACRO as ey,
8822
- ZoneKindEnum as ez,
9091
+ StorageLocationRefSchema as e0,
9092
+ StorageLocationSchema as e1,
9093
+ StorageLocationTypeSchema as e2,
9094
+ ProviderInfoSchema as e3,
9095
+ ReadChunkInputSchema as e4,
9096
+ TestLocationResultSchema as e5,
9097
+ WriteChunkInputSchema as e6,
9098
+ StreamFormatSchema as e7,
9099
+ StreamInfoSchema as e8,
9100
+ StreamNetworkStatsSchema as e9,
9101
+ YAMNET_TO_MACRO as eA,
9102
+ ZoneKindEnum as eB,
9103
+ ZoneRuleModeEnum as eC,
9104
+ ZoneRuleSchema as eD,
9105
+ ZoneRuleStageEnum as eE,
9106
+ ZoneRulesArraySchema as eF,
9107
+ ZoneSchema as eG,
9108
+ ZoneScopeBreakdownSchema as eH,
9109
+ accessoryStableId as eI,
9110
+ deviceMatchesProfile as eJ,
9111
+ event as eK,
9112
+ expandCapMethods as eL,
9113
+ getAudioMacroClassIds as eM,
9114
+ mapAudioLabelToMacro as eN,
9115
+ method as eO,
9116
+ resolveDeviceProfile as eP,
9117
+ webrtcClientHintsSchema as eQ,
9118
+ StreamSourceEntrySchema$1 as ea,
9119
+ StreamSourceSchema as eb,
9120
+ SwitchStatusSchema as ec,
9121
+ SystemMetricsSchema as ed,
9122
+ TestConnectionResultSchema as ee,
9123
+ ToastSchema as ef,
9124
+ TokenScopeSchema as eg,
9125
+ TopologyNodeSchema as eh,
9126
+ TopologyProcessSchema as ei,
9127
+ TopologyServiceSchema as ej,
9128
+ TrackSchema as ek,
9129
+ TrackStateSchema as el,
9130
+ TrackedDetectionSchema as em,
9131
+ TurnProviderInfoSchema as en,
9132
+ TurnServerSchema as eo,
9133
+ UpdateIntegrationInputSchema as ep,
9134
+ UpdateUserInputSchema as eq,
9135
+ UserRecordSchema as er,
9136
+ UserSummarySchema as es,
9137
+ WELL_KNOWN_TABS as et,
9138
+ WELL_KNOWN_TAB_MAP as eu,
9139
+ WebrtcStreamChoiceSchema as ev,
9140
+ WebrtcStreamTargetSchema as ew,
9141
+ WidgetHostEnum as ex,
9142
+ WidgetMetadataSchema as ey,
9143
+ WidgetSizeEnum as ez,
8823
9144
  featureProbeCapability as f,
8824
9145
  deviceStatusCapability as g,
8825
9146
  hydrateSchema as h,
@@ -8842,4 +9163,4 @@ export {
8842
9163
  addonsCapability as y,
8843
9164
  zonesCapability as z
8844
9165
  };
8845
- //# sourceMappingURL=index-BBVUwOlZ.mjs.map
9166
+ //# sourceMappingURL=index-Ce7RZWP4.mjs.map