@camstack/addon-pipeline-orchestrator 0.1.12 → 0.1.13

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.
package/dist/index.mjs CHANGED
@@ -8591,10 +8591,30 @@ const StatusSchema = object({
8591
8591
  }
8592
8592
  });
8593
8593
  const LinkStateSchema = _enum(["unlinked", "linked", "error"]);
8594
+ const ExportSetupFieldSchema = object({
8595
+ label: string(),
8596
+ value: string(),
8597
+ /** Mask the value by default + render a reveal toggle (client id, secrets). */
8598
+ secret: boolean().optional()
8599
+ });
8600
+ const ExportSetupSchema = object({
8601
+ /** A string to render as a scannable QR — HAP `X-HM://…` URI, a pairing URL, etc. Omitted when there's nothing to scan. */
8602
+ qr: string().optional(),
8603
+ /** Label/value rows shown with a copy button (HAP setup code, OAuth URLs, client id, linked-account count, …). */
8604
+ fields: array(ExportSetupFieldSchema).readonly().optional(),
8605
+ /** Free-form operator instructions rendered above the fields. */
8606
+ note: string().optional()
8607
+ });
8594
8608
  const DeviceExportStatusSchema = object({
8595
8609
  linkState: LinkStateSchema,
8596
8610
  exposedDeviceCount: number(),
8597
- error: string().optional()
8611
+ error: string().optional(),
8612
+ /**
8613
+ * Optional pairing/account info the panel renders in a generic
8614
+ * "Setup" section. Addon-agnostic — the addon id identifies the
8615
+ * export target, never an `ecosystem` key here.
8616
+ */
8617
+ setup: ExportSetupSchema.optional()
8598
8618
  });
8599
8619
  const DeviceKindSchema = string();
8600
8620
  const ExposedDeviceSchema = object({
@@ -12028,7 +12048,25 @@ const MeshStatusSchema = object({
12028
12048
  * doesn't rotate keys for the bound host. Operator-facing surface
12029
12049
  * for "your access expires on …" banners.
12030
12050
  */
12031
- keyExpiry: number().nullable()
12051
+ keyExpiry: number().nullable(),
12052
+ // ── Onboard-daemon handoff (Tailscale, generic slot) ────────────
12053
+ /**
12054
+ * When the provider runs its OWN mesh daemon (e.g. the Tailscale
12055
+ * client addon in `onboard` mode spawns a private `tailscaled`),
12056
+ * this carries the local control-socket path. Companion addons that
12057
+ * must drive the SAME daemon — chiefly `tailscale-ingress` for
12058
+ * Serve/Funnel — read it to point their CLI at the right socket
12059
+ * instead of the system default. Empty when the provider uses the
12060
+ * host's system daemon (or doesn't have the concept).
12061
+ */
12062
+ daemonSocket: string().optional(),
12063
+ /**
12064
+ * Path to the mesh CLI binary the provider downloaded for onboard
12065
+ * mode. Companion addons reuse it so they don't need a system
12066
+ * install when the operator chose a fully self-contained mesh.
12067
+ * Empty in host mode.
12068
+ */
12069
+ daemonCliPath: string().optional()
12032
12070
  });
12033
12071
  ({
12034
12072
  methods: {
@@ -12914,6 +12952,21 @@ const AddonAutoUpdateSchema = ChannelWithInheritSchema;
12914
12952
  const RestartAddonResultSchema = unknown();
12915
12953
  const InstallPackageResultSchema = unknown();
12916
12954
  const ReloadPackagesResultSchema = unknown();
12955
+ const UpdateFrameworkPackageResultSchema = object({
12956
+ packageName: string(),
12957
+ fromVersion: string(),
12958
+ toVersion: string(),
12959
+ /** Ms-epoch the server scheduled its self-restart. */
12960
+ restartingAt: number()
12961
+ });
12962
+ const FrameworkPackageStatusSchema = object({
12963
+ packageName: string(),
12964
+ currentVersion: string(),
12965
+ latestVersion: string().nullable(),
12966
+ hasUpdate: boolean(),
12967
+ /** Optional manifest description for the row tooltip. */
12968
+ description: string().optional()
12969
+ });
12917
12970
  const LogStreamEntrySchema = object({
12918
12971
  timestamp: string(),
12919
12972
  level: string(),
@@ -12973,13 +13026,29 @@ const CustomActionInputSchema = object({
12973
13026
  object({ query: string().optional() }),
12974
13027
  array(SearchResultSchema)
12975
13028
  ),
13029
+ /**
13030
+ * Available package updates for a node. `nodeId` omitted (or
13031
+ * `'hub'`) checks the hub's own installed packages; an agent
13032
+ * `nodeId` checks that agent's installed roster against npm
13033
+ * (the hub does the npm lookups + diff — agents stay npm-free).
13034
+ */
12976
13035
  listUpdates: method(
12977
- _void(),
13036
+ object({ nodeId: string().optional() }),
12978
13037
  array(PackageUpdateSchema).readonly(),
12979
13038
  { auth: "admin" }
12980
13039
  ),
13040
+ /**
13041
+ * Update one package on a node. `nodeId` omitted (or `'hub'`)
13042
+ * installs on the hub via npm; an agent `nodeId` makes the hub
13043
+ * pack the resolved version and push the tarball to that agent
13044
+ * (`$agent.deploy` + `$agent.reload`) — agents need no npm runtime.
13045
+ */
12981
13046
  updatePackage: method(
12982
- object({ name: string().min(1), version: string().optional() }),
13047
+ object({
13048
+ name: string().min(1),
13049
+ version: string().optional(),
13050
+ nodeId: string().optional()
13051
+ }),
12983
13052
  unknown(),
12984
13053
  { kind: "mutation", auth: "admin" }
12985
13054
  ),
@@ -13000,12 +13069,105 @@ const CustomActionInputSchema = object({
13000
13069
  object({ rolledBackTo: string().nullable() }),
13001
13070
  { kind: "mutation", auth: "admin" }
13002
13071
  ),
13003
- forceRefresh: method(_void(), unknown(), { kind: "mutation", auth: "admin" }),
13072
+ /** Re-check updates for a node, bypassing any cache. `nodeId`
13073
+ * omitted (or `'hub'`) refreshes the hub; an agent `nodeId`
13074
+ * re-checks that agent's roster. */
13075
+ forceRefresh: method(
13076
+ object({ nodeId: string().optional() }),
13077
+ unknown(),
13078
+ { kind: "mutation", auth: "admin" }
13079
+ ),
13004
13080
  restartServer: method(
13005
13081
  object({ confirm: literal(true) }),
13006
13082
  unknown(),
13007
13083
  { kind: "mutation", auth: "admin" }
13008
13084
  ),
13085
+ /**
13086
+ * Most-recent restart marker (kind / packageName / from→to versions
13087
+ * / requestedBy / requestedAt). Returns `null` when this process
13088
+ * didn't boot from a tracked restart, or when the
13089
+ * post-boot retention window (5 min) has elapsed.
13090
+ *
13091
+ * Drives the admin-UI reconnect overlay's success toast — the
13092
+ * `system.restart-completed` event itself is fired before the
13093
+ * client has time to re-subscribe, so the client queries this on
13094
+ * first reconnect instead.
13095
+ */
13096
+ getLastRestart: method(
13097
+ _void(),
13098
+ object({
13099
+ kind: _enum(["framework-update", "manual", "system"]),
13100
+ packageName: string().optional(),
13101
+ fromVersion: string().optional(),
13102
+ toVersion: string().optional(),
13103
+ requestedBy: string().optional(),
13104
+ requestedAt: number()
13105
+ }).nullable(),
13106
+ { auth: "admin" }
13107
+ ),
13108
+ /**
13109
+ * Snapshot of the framework packages installed under the hub's
13110
+ * `<appRoot>/node_modules/`. Each row carries the currently
13111
+ * installed version and (best-effort) the latest version
13112
+ * available on npm. Drives the admin-UI "System packages" panel.
13113
+ *
13114
+ * Spec: docs/superpowers/specs/2026-05-14-framework-live-update-design.md
13115
+ */
13116
+ listFrameworkPackages: method(
13117
+ _void(),
13118
+ array(FrameworkPackageStatusSchema).readonly(),
13119
+ { auth: "admin" }
13120
+ ),
13121
+ /**
13122
+ * Cluster-wide capability-provider discovery. Returns the list of
13123
+ * `{ addonId, mode, isActive }` tuples for whatever addon(s)
13124
+ * currently provide the requested capability across the cluster.
13125
+ *
13126
+ * Why this lives on `addons` (and not on a `capabilities` cap of
13127
+ * its own): the hub's main-process `CapabilityRegistry` already
13128
+ * aggregates registrations from every forked group-runner and
13129
+ * remote agent via Moleculer event propagation — there's no
13130
+ * cross-process registry mirror to build, just an introspection
13131
+ * shim.
13132
+ *
13133
+ * Use this from addon code when you need to know whether another
13134
+ * addon has registered a specific cap (e.g. `tailscale-ingress`
13135
+ * checking `tailscale-client` is up before calling `tailscale
13136
+ * serve`). Don't reach for `ctx.capabilities.getCollectionEntries`
13137
+ * — that reads the LOCAL registry of the calling addon's group
13138
+ * runner and never sees providers in other processes. See
13139
+ * `CLAUDE.md` → Critical rules → ctx.api vs ctx.capabilities.
13140
+ */
13141
+ listCapabilityProviders: method(
13142
+ object({ capName: string().min(1) }),
13143
+ array(object({
13144
+ addonId: string(),
13145
+ mode: _enum(["singleton", "collection"]),
13146
+ isActive: boolean()
13147
+ })).readonly()
13148
+ ),
13149
+ /**
13150
+ * Live-update one of the framework packages marked
13151
+ * `camstack.system: true` (`@camstack/types|kernel|core|sdk|ui-library`).
13152
+ * Runs `npm install --prefix <appRoot> <name>@<version> --no-save`,
13153
+ * writes a `.restart-pending` marker, emits `system.restarting`
13154
+ * and schedules a graceful process exit. The supervisor (Docker /
13155
+ * Electron / systemd) brings the hub back up; on first boot after
13156
+ * the restart the marker fires `system.restart-completed`.
13157
+ *
13158
+ * `version` defaults to `'latest'`. The allow-list of valid
13159
+ * `packageName` values is enforced server-side.
13160
+ *
13161
+ * Spec: docs/superpowers/specs/2026-05-14-framework-live-update-design.md
13162
+ */
13163
+ updateFrameworkPackage: method(
13164
+ object({
13165
+ packageName: string().min(1),
13166
+ version: string().optional()
13167
+ }),
13168
+ UpdateFrameworkPackageResultSchema,
13169
+ { kind: "mutation", auth: "admin" }
13170
+ ),
13009
13171
  getVersions: method(
13010
13172
  object({ name: string() }),
13011
13173
  array(PackageVersionInfoSchema).readonly()
@@ -13076,6 +13238,7 @@ var EventCategory = /* @__PURE__ */ ((EventCategory2) => {
13076
13238
  EventCategory2["SystemBoot"] = "system.boot";
13077
13239
  EventCategory2["SystemAddonsReady"] = "system.addons-ready";
13078
13240
  EventCategory2["SystemRestarting"] = "system.restarting";
13241
+ EventCategory2["SystemRestartCompleted"] = "system.restart-completed";
13079
13242
  EventCategory2["SystemReadyState"] = "system.ready-state";
13080
13243
  EventCategory2["AddonStarted"] = "addon.started";
13081
13244
  EventCategory2["AddonStopped"] = "addon.stopped";