@camstack/addon-pipeline-orchestrator 1.1.34 → 1.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.
package/dist/index.js CHANGED
@@ -2,6 +2,33 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
+ //#region \0rolldown/runtime.js
6
+ var __create = Object.create;
7
+ var __defProp = Object.defineProperty;
8
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
+ var __getOwnPropNames = Object.getOwnPropertyNames;
10
+ var __getProtoOf = Object.getPrototypeOf;
11
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
14
+ key = keys[i];
15
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: ((k) => from[k]).bind(null, key),
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+ //#endregion
27
+ let node_fs = require("node:fs");
28
+ node_fs = __toESM(node_fs);
29
+ let node_path = require("node:path");
30
+ node_path = __toESM(node_path);
31
+ let node_url = require("node:url");
5
32
  //#region ../../node_modules/zod/v4/core/core.js
6
33
  var _a$1;
7
34
  function $constructor(name, initializer, params) {
@@ -7116,7 +7143,23 @@ var VersionOutputSchema$1 = object({ version: string() });
7116
7143
  method(_void(), StaticDirOutputSchema$1), method(_void(), VersionOutputSchema$1);
7117
7144
  var StaticDirOutputSchema = object({ staticDir: string() });
7118
7145
  var VersionOutputSchema = object({ version: string() });
7119
- method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
7146
+ /**
7147
+ * viewer-ui — serves the CamStack VIEWER web build (the Expo/React-Native
7148
+ * universal client's PWA export) from the hub, alongside admin-ui. Mirrors
7149
+ * `admin-ui` exactly: a singleton, server-internal cap exposing the static
7150
+ * dist directory + build version so `main.ts` can mount the SPA under a
7151
+ * dedicated prefix.
7152
+ */
7153
+ var viewerUiCapability = {
7154
+ name: "viewer-ui",
7155
+ scope: "system",
7156
+ mode: "singleton",
7157
+ internal: true,
7158
+ methods: {
7159
+ getStaticDir: method(_void(), StaticDirOutputSchema),
7160
+ getVersion: method(_void(), VersionOutputSchema)
7161
+ }
7162
+ };
7120
7163
  /**
7121
7164
  * device-ops — device-scoped cap that unifies the per-IDevice operations
7122
7165
  * previously routed through the `.device-ops` Moleculer bridge service.
@@ -30960,10 +31003,51 @@ async function buildOrchestratorControllers(deps) {
30960
31003
  };
30961
31004
  }
30962
31005
  //#endregion
31006
+ //#region src/viewer-ui-provider.ts
31007
+ /**
31008
+ * viewer-ui provider — the pipeline-orchestrator serves the CamStack viewer web
31009
+ * SPA (mirrors what the now-removed standalone addon-viewer-ui used to do).
31010
+ *
31011
+ * Why here: the orchestrator is a hub bootstrap addon (always installed + baked),
31012
+ * so folding the viewer serving into it avoids a second addon whose only job was
31013
+ * to hold static files. The viewer's Expo web export is COPIED into this addon's
31014
+ * `assets/viewer/` locally by the viewer repo's `scripts/copy-dist-to-orchestrator.js`
31015
+ * (run from a checkout that HAS the `camstack/` submodule + Expo toolchain — the
31016
+ * publish/image CI does not, which is exactly why we copy a pre-built dist rather
31017
+ * than build it here). vite emits only into `dist/`, so `assets/viewer` survives
31018
+ * the addon build; `assets` is in the package `files`, so it ships on
31019
+ * `camstack deploy`. The hub's `main.ts` resolves the `viewer-ui` singleton at
31020
+ * boot and mounts the SPA at `/viewer/camstack`.
31021
+ *
31022
+ * `index.js` runs from `dist/`, so the SPA root is one level up + `assets/viewer`.
31023
+ */
31024
+ var __dirname$1 = node_path.default.dirname((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
31025
+ /** Absolute path to the staged viewer web SPA (`<addon-root>/assets/viewer`). */
31026
+ function resolveViewerDistDir() {
31027
+ return node_path.default.resolve(__dirname$1, "..", "assets", "viewer");
31028
+ }
31029
+ /** Version of the staged viewer, written by the copy script; 'unknown' if absent. */
31030
+ function readViewerVersion() {
31031
+ try {
31032
+ const raw = node_fs.default.readFileSync(node_path.default.join(resolveViewerDistDir(), ".viewer-version"), "utf-8").trim();
31033
+ if (raw) return raw;
31034
+ } catch {}
31035
+ return "unknown";
31036
+ }
31037
+ /** Build the viewer-ui provider. Serves whatever dist was staged into
31038
+ * `assets/viewer`; when nothing is staged the hub's mount cleanly 404s. */
31039
+ function createViewerUiProvider() {
31040
+ return {
31041
+ getStaticDir: async () => ({ staticDir: resolveViewerDistDir() }),
31042
+ getVersion: async () => ({ version: readViewerVersion() })
31043
+ };
31044
+ }
31045
+ //#endregion
30963
31046
  //#region src/widget-catalog.ts
30964
31047
  var pipelineOrchestratorWidgets = [{
30965
31048
  tab: "device-tab",
30966
31049
  label: "Pipeline Quick Stats",
31050
+ preAuth: false,
30967
31051
  kind: "remote",
30968
31052
  remote: {
30969
31053
  remoteName: "addon_pipeline_orchestrator_widgets",
@@ -30990,6 +31074,7 @@ var pipelineOrchestratorWidgets = [{
30990
31074
  }, {
30991
31075
  tab: "device-tab",
30992
31076
  label: "Zone Editor",
31077
+ preAuth: false,
30993
31078
  kind: "remote",
30994
31079
  remote: {
30995
31080
  remoteName: "addon_pipeline_orchestrator_widgets",
@@ -31657,6 +31742,10 @@ var PipelineOrchestratorAddon = class PipelineOrchestratorAddon extends BaseAddo
31657
31742
  {
31658
31743
  capability: addonWidgetsSourceCapability,
31659
31744
  provider: { listWidgets: async () => pipelineOrchestratorWidgets }
31745
+ },
31746
+ {
31747
+ capability: viewerUiCapability,
31748
+ provider: createViewerUiProvider()
31660
31749
  }
31661
31750
  ],
31662
31751
  customActions: pipelineOrchestratorActions,
package/dist/index.mjs CHANGED
@@ -1,3 +1,6 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
1
4
  //#region ../../node_modules/zod/v4/core/core.js
2
5
  var _a$1;
3
6
  function $constructor(name, initializer, params) {
@@ -7112,7 +7115,23 @@ var VersionOutputSchema$1 = object({ version: string() });
7112
7115
  method(_void(), StaticDirOutputSchema$1), method(_void(), VersionOutputSchema$1);
7113
7116
  var StaticDirOutputSchema = object({ staticDir: string() });
7114
7117
  var VersionOutputSchema = object({ version: string() });
7115
- method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
7118
+ /**
7119
+ * viewer-ui — serves the CamStack VIEWER web build (the Expo/React-Native
7120
+ * universal client's PWA export) from the hub, alongside admin-ui. Mirrors
7121
+ * `admin-ui` exactly: a singleton, server-internal cap exposing the static
7122
+ * dist directory + build version so `main.ts` can mount the SPA under a
7123
+ * dedicated prefix.
7124
+ */
7125
+ var viewerUiCapability = {
7126
+ name: "viewer-ui",
7127
+ scope: "system",
7128
+ mode: "singleton",
7129
+ internal: true,
7130
+ methods: {
7131
+ getStaticDir: method(_void(), StaticDirOutputSchema),
7132
+ getVersion: method(_void(), VersionOutputSchema)
7133
+ }
7134
+ };
7116
7135
  /**
7117
7136
  * device-ops — device-scoped cap that unifies the per-IDevice operations
7118
7137
  * previously routed through the `.device-ops` Moleculer bridge service.
@@ -30956,10 +30975,51 @@ async function buildOrchestratorControllers(deps) {
30956
30975
  };
30957
30976
  }
30958
30977
  //#endregion
30978
+ //#region src/viewer-ui-provider.ts
30979
+ /**
30980
+ * viewer-ui provider — the pipeline-orchestrator serves the CamStack viewer web
30981
+ * SPA (mirrors what the now-removed standalone addon-viewer-ui used to do).
30982
+ *
30983
+ * Why here: the orchestrator is a hub bootstrap addon (always installed + baked),
30984
+ * so folding the viewer serving into it avoids a second addon whose only job was
30985
+ * to hold static files. The viewer's Expo web export is COPIED into this addon's
30986
+ * `assets/viewer/` locally by the viewer repo's `scripts/copy-dist-to-orchestrator.js`
30987
+ * (run from a checkout that HAS the `camstack/` submodule + Expo toolchain — the
30988
+ * publish/image CI does not, which is exactly why we copy a pre-built dist rather
30989
+ * than build it here). vite emits only into `dist/`, so `assets/viewer` survives
30990
+ * the addon build; `assets` is in the package `files`, so it ships on
30991
+ * `camstack deploy`. The hub's `main.ts` resolves the `viewer-ui` singleton at
30992
+ * boot and mounts the SPA at `/viewer/camstack`.
30993
+ *
30994
+ * `index.js` runs from `dist/`, so the SPA root is one level up + `assets/viewer`.
30995
+ */
30996
+ var __dirname = path.dirname(fileURLToPath(import.meta.url));
30997
+ /** Absolute path to the staged viewer web SPA (`<addon-root>/assets/viewer`). */
30998
+ function resolveViewerDistDir() {
30999
+ return path.resolve(__dirname, "..", "assets", "viewer");
31000
+ }
31001
+ /** Version of the staged viewer, written by the copy script; 'unknown' if absent. */
31002
+ function readViewerVersion() {
31003
+ try {
31004
+ const raw = fs.readFileSync(path.join(resolveViewerDistDir(), ".viewer-version"), "utf-8").trim();
31005
+ if (raw) return raw;
31006
+ } catch {}
31007
+ return "unknown";
31008
+ }
31009
+ /** Build the viewer-ui provider. Serves whatever dist was staged into
31010
+ * `assets/viewer`; when nothing is staged the hub's mount cleanly 404s. */
31011
+ function createViewerUiProvider() {
31012
+ return {
31013
+ getStaticDir: async () => ({ staticDir: resolveViewerDistDir() }),
31014
+ getVersion: async () => ({ version: readViewerVersion() })
31015
+ };
31016
+ }
31017
+ //#endregion
30959
31018
  //#region src/widget-catalog.ts
30960
31019
  var pipelineOrchestratorWidgets = [{
30961
31020
  tab: "device-tab",
30962
31021
  label: "Pipeline Quick Stats",
31022
+ preAuth: false,
30963
31023
  kind: "remote",
30964
31024
  remote: {
30965
31025
  remoteName: "addon_pipeline_orchestrator_widgets",
@@ -30986,6 +31046,7 @@ var pipelineOrchestratorWidgets = [{
30986
31046
  }, {
30987
31047
  tab: "device-tab",
30988
31048
  label: "Zone Editor",
31049
+ preAuth: false,
30989
31050
  kind: "remote",
30990
31051
  remote: {
30991
31052
  remoteName: "addon_pipeline_orchestrator_widgets",
@@ -31653,6 +31714,10 @@ var PipelineOrchestratorAddon = class PipelineOrchestratorAddon extends BaseAddo
31653
31714
  {
31654
31715
  capability: addonWidgetsSourceCapability,
31655
31716
  provider: { listWidgets: async () => pipelineOrchestratorWidgets }
31717
+ },
31718
+ {
31719
+ capability: viewerUiCapability,
31720
+ provider: createViewerUiProvider()
31656
31721
  }
31657
31722
  ],
31658
31723
  customActions: pipelineOrchestratorActions,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-pipeline-orchestrator",
3
- "version": "1.1.34",
3
+ "version": "1.1.35",
4
4
  "description": "Hub-side camera-to-agent load balancer — tracks runner capacity and dispatches attachCamera calls to the optimal pipeline-runner instance",
5
5
  "keywords": [
6
6
  "camstack",
@@ -55,6 +55,9 @@
55
55
  },
56
56
  {
57
57
  "name": "addon-widgets-source"
58
+ },
59
+ {
60
+ "name": "viewer-ui"
58
61
  }
59
62
  ],
60
63
  "passive": true,