@camstack/types 0.1.33 → 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 (36) 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 +4 -0
  8. package/dist/capabilities/mesh-network.cap.d.ts.map +1 -1
  9. package/dist/capabilities/nodes.cap.d.ts +13 -0
  10. package/dist/capabilities/nodes.cap.d.ts.map +1 -1
  11. package/dist/enums/event-category.d.ts +10 -0
  12. package/dist/enums/event-category.d.ts.map +1 -1
  13. package/dist/generated/addon-api.d.ts +120 -8
  14. package/dist/generated/addon-api.d.ts.map +1 -1
  15. package/dist/generated/capability-router-map.d.ts.map +1 -1
  16. package/dist/generated/method-access-map.d.ts +1 -1
  17. package/dist/generated/method-access-map.d.ts.map +1 -1
  18. package/dist/generated/system-proxy.d.ts +1 -1
  19. package/dist/generated/system-proxy.d.ts.map +1 -1
  20. package/dist/{index-YnRVILXN.mjs → index-Ce7RZWP4.mjs} +332 -166
  21. package/dist/index-Ce7RZWP4.mjs.map +1 -0
  22. package/dist/{index-DRWlYskM.js → index-DS7418lf.js} +172 -6
  23. package/dist/index-DS7418lf.js.map +1 -0
  24. package/dist/index.js +12 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.mjs +173 -162
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/interfaces/addon.d.ts +21 -0
  29. package/dist/interfaces/addon.d.ts.map +1 -1
  30. package/dist/interfaces/event-bus.d.ts +21 -1
  31. package/dist/interfaces/event-bus.d.ts.map +1 -1
  32. package/dist/node.js +1 -1
  33. package/dist/node.mjs +1 -1
  34. package/package.json +6 -1
  35. package/dist/index-DRWlYskM.js.map +0 -1
  36. 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({
@@ -7551,7 +7571,25 @@ const MeshStatusSchema = zod.z.object({
7551
7571
  * doesn't rotate keys for the bound host. Operator-facing surface
7552
7572
  * for "your access expires on …" banners.
7553
7573
  */
7554
- keyExpiry: zod.z.number().nullable()
7574
+ keyExpiry: zod.z.number().nullable(),
7575
+ // ── Onboard-daemon handoff (Tailscale, generic slot) ────────────
7576
+ /**
7577
+ * When the provider runs its OWN mesh daemon (e.g. the Tailscale
7578
+ * client addon in `onboard` mode spawns a private `tailscaled`),
7579
+ * this carries the local control-socket path. Companion addons that
7580
+ * must drive the SAME daemon — chiefly `tailscale-ingress` for
7581
+ * Serve/Funnel — read it to point their CLI at the right socket
7582
+ * instead of the system default. Empty when the provider uses the
7583
+ * host's system daemon (or doesn't have the concept).
7584
+ */
7585
+ daemonSocket: zod.z.string().optional(),
7586
+ /**
7587
+ * Path to the mesh CLI binary the provider downloaded for onboard
7588
+ * mode. Companion addons reuse it so they don't need a system
7589
+ * install when the operator chose a fully self-contained mesh.
7590
+ * Empty in host mode.
7591
+ */
7592
+ daemonCliPath: zod.z.string().optional()
7555
7593
  });
7556
7594
  const meshNetworkCapability = {
7557
7595
  name: "mesh-network",
@@ -8181,6 +8219,7 @@ const nodesCapability = {
8181
8219
  name: "nodes",
8182
8220
  scope: "system",
8183
8221
  mode: "singleton",
8222
+ nodeIdMode: "data",
8184
8223
  methods: {
8185
8224
  topology: method(
8186
8225
  zod.z.void(),
@@ -8462,6 +8501,21 @@ const AddonAutoUpdateSchema = ChannelWithInheritSchema;
8462
8501
  const RestartAddonResultSchema = zod.z.unknown();
8463
8502
  const InstallPackageResultSchema = zod.z.unknown();
8464
8503
  const ReloadPackagesResultSchema = zod.z.unknown();
8504
+ const UpdateFrameworkPackageResultSchema = zod.z.object({
8505
+ packageName: zod.z.string(),
8506
+ fromVersion: zod.z.string(),
8507
+ toVersion: zod.z.string(),
8508
+ /** Ms-epoch the server scheduled its self-restart. */
8509
+ restartingAt: zod.z.number()
8510
+ });
8511
+ const FrameworkPackageStatusSchema = zod.z.object({
8512
+ packageName: zod.z.string(),
8513
+ currentVersion: zod.z.string(),
8514
+ latestVersion: zod.z.string().nullable(),
8515
+ hasUpdate: zod.z.boolean(),
8516
+ /** Optional manifest description for the row tooltip. */
8517
+ description: zod.z.string().optional()
8518
+ });
8465
8519
  const LogStreamEntrySchema = zod.z.object({
8466
8520
  timestamp: zod.z.string(),
8467
8521
  level: zod.z.string(),
@@ -8478,6 +8532,7 @@ const addonsCapability = {
8478
8532
  name: "addons",
8479
8533
  scope: "system",
8480
8534
  mode: "singleton",
8535
+ nodeIdMode: "data",
8481
8536
  methods: {
8482
8537
  // ── Listing ──────────────────────────────────────────────────────
8483
8538
  list: method(zod.z.void(), zod.z.array(AddonListItemSchema).readonly()),
@@ -8524,13 +8579,29 @@ const addonsCapability = {
8524
8579
  zod.z.object({ query: zod.z.string().optional() }),
8525
8580
  zod.z.array(SearchResultSchema)
8526
8581
  ),
8582
+ /**
8583
+ * Available package updates for a node. `nodeId` omitted (or
8584
+ * `'hub'`) checks the hub's own installed packages; an agent
8585
+ * `nodeId` checks that agent's installed roster against npm
8586
+ * (the hub does the npm lookups + diff — agents stay npm-free).
8587
+ */
8527
8588
  listUpdates: method(
8528
- zod.z.void(),
8589
+ zod.z.object({ nodeId: zod.z.string().optional() }),
8529
8590
  zod.z.array(PackageUpdateSchema).readonly(),
8530
8591
  { auth: "admin" }
8531
8592
  ),
8593
+ /**
8594
+ * Update one package on a node. `nodeId` omitted (or `'hub'`)
8595
+ * installs on the hub via npm; an agent `nodeId` makes the hub
8596
+ * pack the resolved version and push the tarball to that agent
8597
+ * (`$agent.deploy` + `$agent.reload`) — agents need no npm runtime.
8598
+ */
8532
8599
  updatePackage: method(
8533
- zod.z.object({ name: zod.z.string().min(1), version: zod.z.string().optional() }),
8600
+ zod.z.object({
8601
+ name: zod.z.string().min(1),
8602
+ version: zod.z.string().optional(),
8603
+ nodeId: zod.z.string().optional()
8604
+ }),
8534
8605
  zod.z.unknown(),
8535
8606
  { kind: "mutation", auth: "admin" }
8536
8607
  ),
@@ -8551,12 +8622,105 @@ const addonsCapability = {
8551
8622
  zod.z.object({ rolledBackTo: zod.z.string().nullable() }),
8552
8623
  { kind: "mutation", auth: "admin" }
8553
8624
  ),
8554
- forceRefresh: method(zod.z.void(), zod.z.unknown(), { kind: "mutation", auth: "admin" }),
8625
+ /** Re-check updates for a node, bypassing any cache. `nodeId`
8626
+ * omitted (or `'hub'`) refreshes the hub; an agent `nodeId`
8627
+ * re-checks that agent's roster. */
8628
+ forceRefresh: method(
8629
+ zod.z.object({ nodeId: zod.z.string().optional() }),
8630
+ zod.z.unknown(),
8631
+ { kind: "mutation", auth: "admin" }
8632
+ ),
8555
8633
  restartServer: method(
8556
8634
  zod.z.object({ confirm: zod.z.literal(true) }),
8557
8635
  zod.z.unknown(),
8558
8636
  { kind: "mutation", auth: "admin" }
8559
8637
  ),
8638
+ /**
8639
+ * Most-recent restart marker (kind / packageName / from→to versions
8640
+ * / requestedBy / requestedAt). Returns `null` when this process
8641
+ * didn't boot from a tracked restart, or when the
8642
+ * post-boot retention window (5 min) has elapsed.
8643
+ *
8644
+ * Drives the admin-UI reconnect overlay's success toast — the
8645
+ * `system.restart-completed` event itself is fired before the
8646
+ * client has time to re-subscribe, so the client queries this on
8647
+ * first reconnect instead.
8648
+ */
8649
+ getLastRestart: method(
8650
+ zod.z.void(),
8651
+ zod.z.object({
8652
+ kind: zod.z.enum(["framework-update", "manual", "system"]),
8653
+ packageName: zod.z.string().optional(),
8654
+ fromVersion: zod.z.string().optional(),
8655
+ toVersion: zod.z.string().optional(),
8656
+ requestedBy: zod.z.string().optional(),
8657
+ requestedAt: zod.z.number()
8658
+ }).nullable(),
8659
+ { auth: "admin" }
8660
+ ),
8661
+ /**
8662
+ * Snapshot of the framework packages installed under the hub's
8663
+ * `<appRoot>/node_modules/`. Each row carries the currently
8664
+ * installed version and (best-effort) the latest version
8665
+ * available on npm. Drives the admin-UI "System packages" panel.
8666
+ *
8667
+ * Spec: docs/superpowers/specs/2026-05-14-framework-live-update-design.md
8668
+ */
8669
+ listFrameworkPackages: method(
8670
+ zod.z.void(),
8671
+ zod.z.array(FrameworkPackageStatusSchema).readonly(),
8672
+ { auth: "admin" }
8673
+ ),
8674
+ /**
8675
+ * Cluster-wide capability-provider discovery. Returns the list of
8676
+ * `{ addonId, mode, isActive }` tuples for whatever addon(s)
8677
+ * currently provide the requested capability across the cluster.
8678
+ *
8679
+ * Why this lives on `addons` (and not on a `capabilities` cap of
8680
+ * its own): the hub's main-process `CapabilityRegistry` already
8681
+ * aggregates registrations from every forked group-runner and
8682
+ * remote agent via Moleculer event propagation — there's no
8683
+ * cross-process registry mirror to build, just an introspection
8684
+ * shim.
8685
+ *
8686
+ * Use this from addon code when you need to know whether another
8687
+ * addon has registered a specific cap (e.g. `tailscale-ingress`
8688
+ * checking `tailscale-client` is up before calling `tailscale
8689
+ * serve`). Don't reach for `ctx.capabilities.getCollectionEntries`
8690
+ * — that reads the LOCAL registry of the calling addon's group
8691
+ * runner and never sees providers in other processes. See
8692
+ * `CLAUDE.md` → Critical rules → ctx.api vs ctx.capabilities.
8693
+ */
8694
+ listCapabilityProviders: method(
8695
+ zod.z.object({ capName: zod.z.string().min(1) }),
8696
+ zod.z.array(zod.z.object({
8697
+ addonId: zod.z.string(),
8698
+ mode: zod.z.enum(["singleton", "collection"]),
8699
+ isActive: zod.z.boolean()
8700
+ })).readonly()
8701
+ ),
8702
+ /**
8703
+ * Live-update one of the framework packages marked
8704
+ * `camstack.system: true` (`@camstack/types|kernel|core|sdk|ui-library`).
8705
+ * Runs `npm install --prefix <appRoot> <name>@<version> --no-save`,
8706
+ * writes a `.restart-pending` marker, emits `system.restarting`
8707
+ * and schedules a graceful process exit. The supervisor (Docker /
8708
+ * Electron / systemd) brings the hub back up; on first boot after
8709
+ * the restart the marker fires `system.restart-completed`.
8710
+ *
8711
+ * `version` defaults to `'latest'`. The allow-list of valid
8712
+ * `packageName` values is enforced server-side.
8713
+ *
8714
+ * Spec: docs/superpowers/specs/2026-05-14-framework-live-update-design.md
8715
+ */
8716
+ updateFrameworkPackage: method(
8717
+ zod.z.object({
8718
+ packageName: zod.z.string().min(1),
8719
+ version: zod.z.string().optional()
8720
+ }),
8721
+ UpdateFrameworkPackageResultSchema,
8722
+ { kind: "mutation", auth: "admin" }
8723
+ ),
8560
8724
  getVersions: method(
8561
8725
  zod.z.object({ name: zod.z.string() }),
8562
8726
  zod.z.array(PackageVersionInfoSchema).readonly()
@@ -8753,6 +8917,8 @@ exports.EndDownloadInputSchema = EndDownloadInputSchema;
8753
8917
  exports.EnrichedWidgetMetadataSchema = EnrichedWidgetMetadataSchema;
8754
8918
  exports.EventItemSchema = EventItemSchema;
8755
8919
  exports.EventKindSchema = EventKindSchema;
8920
+ exports.ExportSetupFieldSchema = ExportSetupFieldSchema;
8921
+ exports.ExportSetupSchema = ExportSetupSchema;
8756
8922
  exports.ExposeInputSchema = ExposeInputSchema;
8757
8923
  exports.ExposedDeviceSchema = ExposedDeviceSchema;
8758
8924
  exports.ExposedResourceSchema = ExposedResourceSchema;
@@ -8996,4 +9162,4 @@ exports.webrtcSessionCapability = webrtcSessionCapability;
8996
9162
  exports.zoneAnalyticsCapability = zoneAnalyticsCapability;
8997
9163
  exports.zoneRulesCapability = zoneRulesCapability;
8998
9164
  exports.zonesCapability = zonesCapability;
8999
- //# sourceMappingURL=index-DRWlYskM.js.map
9165
+ //# sourceMappingURL=index-DS7418lf.js.map