@trillboards/edge-sdk 0.2.3 → 0.2.6

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 (200) hide show
  1. package/README.md +4 -3
  2. package/deploy/docker/Dockerfile.cloud-sense +117 -0
  3. package/deploy/docker/Dockerfile.cpu +30 -21
  4. package/deploy/docker/Dockerfile.cuda +30 -21
  5. package/deploy/docker/Dockerfile.openvino +30 -20
  6. package/deploy/docker/README.md +9 -4
  7. package/deploy/docker/connector-entrypoint.sh +122 -0
  8. package/deploy/helm/README.md +1 -1
  9. package/deploy/k8s/daemonset.yaml +1 -1
  10. package/deploy/macos/README.md +161 -0
  11. package/deploy/macos/TrillboardsSetupApp.m +603 -0
  12. package/deploy/macos/build-macos-pkg.sh +588 -0
  13. package/deploy/macos/com.trillboards.edge.plist +62 -0
  14. package/deploy/macos/com.trillboards.litertlm.plist +45 -0
  15. package/deploy/macos/pair.command +519 -0
  16. package/deploy/macos/scripts/ensure-litertlm.sh +62 -0
  17. package/deploy/macos/scripts/postinstall +153 -0
  18. package/deploy/macos/scripts/setup-litertlm.sh +272 -0
  19. package/deploy/macos/test-install-pair.sh +383 -0
  20. package/deploy/macos/test-setup-litertlm-reinstall.sh +109 -0
  21. package/deploy/systemd/install.sh +25 -15
  22. package/deploy/systemd/trillboards-edge.service +4 -1
  23. package/deploy/windows/README.md +70 -0
  24. package/deploy/windows/build-windows.ps1 +225 -0
  25. package/deploy/windows/bundle-windows-installer.ps1 +153 -0
  26. package/deploy/windows/check-feeds.js +26 -0
  27. package/deploy/windows/e2e/fixtures/person.jpg +0 -0
  28. package/deploy/windows/e2e/test-local-sense.ps1 +185 -0
  29. package/deploy/windows/install-update.ps1 +101 -0
  30. package/deploy/windows/installer.nsi +138 -0
  31. package/deploy/windows/register-litertlm-task.ps1 +42 -0
  32. package/deploy/windows/register-task.ps1 +44 -0
  33. package/deploy/windows/run-connector.ps1 +69 -0
  34. package/deploy/windows/setup-litertlm.ps1 +361 -0
  35. package/deploy/windows/stop-existing.ps1 +72 -0
  36. package/deploy/windows/trillboards-edge-task.vbs +25 -0
  37. package/deploy/windows/trillboards-edge.cmd +33 -0
  38. package/deploy/windows/trillboards-pair.cmd +276 -0
  39. package/deploy/windows/trillboards-setup.ps1 +456 -0
  40. package/deploy/windows/trillboards-setup.vbs +13 -0
  41. package/dist/AudienceAnalyzeClient.d.ts +136 -0
  42. package/dist/AudienceAnalyzeClient.d.ts.map +1 -0
  43. package/dist/AudienceAnalyzeClient.js +246 -0
  44. package/dist/AudienceAnalyzeClient.js.map +1 -0
  45. package/dist/ChannelProber.d.ts +150 -0
  46. package/dist/ChannelProber.d.ts.map +1 -0
  47. package/dist/ChannelProber.js +887 -0
  48. package/dist/ChannelProber.js.map +1 -0
  49. package/dist/CloudEscalationPolicy.d.ts +143 -0
  50. package/dist/CloudEscalationPolicy.d.ts.map +1 -0
  51. package/dist/CloudEscalationPolicy.js +137 -0
  52. package/dist/CloudEscalationPolicy.js.map +1 -0
  53. package/dist/CloudSensingManager.d.ts +533 -0
  54. package/dist/CloudSensingManager.d.ts.map +1 -0
  55. package/dist/CloudSensingManager.js +1254 -0
  56. package/dist/CloudSensingManager.js.map +1 -0
  57. package/dist/DiscoveryReportClient.d.ts +66 -0
  58. package/dist/DiscoveryReportClient.d.ts.map +1 -0
  59. package/dist/DiscoveryReportClient.js +85 -0
  60. package/dist/DiscoveryReportClient.js.map +1 -0
  61. package/dist/EdgeAgent.d.ts +12 -2
  62. package/dist/EdgeAgent.d.ts.map +1 -1
  63. package/dist/EdgeAgent.js +122 -65
  64. package/dist/EdgeAgent.js.map +1 -1
  65. package/dist/LiteRtVlmProvider.d.ts +193 -0
  66. package/dist/LiteRtVlmProvider.d.ts.map +1 -0
  67. package/dist/LiteRtVlmProvider.js +436 -0
  68. package/dist/LiteRtVlmProvider.js.map +1 -0
  69. package/dist/MosaicSource.d.ts +108 -0
  70. package/dist/MosaicSource.d.ts.map +1 -0
  71. package/dist/MosaicSource.js +274 -0
  72. package/dist/MosaicSource.js.map +1 -0
  73. package/dist/OnvifClient.d.ts +83 -0
  74. package/dist/OnvifClient.d.ts.map +1 -0
  75. package/dist/OnvifClient.js +209 -0
  76. package/dist/OnvifClient.js.map +1 -0
  77. package/dist/PairClient.d.ts +106 -0
  78. package/dist/PairClient.d.ts.map +1 -0
  79. package/dist/PairClient.js +186 -0
  80. package/dist/PairClient.js.map +1 -0
  81. package/dist/RecorderAddressRecovery.d.ts +53 -0
  82. package/dist/RecorderAddressRecovery.d.ts.map +1 -0
  83. package/dist/RecorderAddressRecovery.js +359 -0
  84. package/dist/RecorderAddressRecovery.js.map +1 -0
  85. package/dist/SceneChangeDetector.d.ts +291 -0
  86. package/dist/SceneChangeDetector.d.ts.map +1 -0
  87. package/dist/SceneChangeDetector.js +682 -0
  88. package/dist/SceneChangeDetector.js.map +1 -0
  89. package/dist/SensingProfileClient.d.ts +59 -0
  90. package/dist/SensingProfileClient.d.ts.map +1 -0
  91. package/dist/SensingProfileClient.js +78 -0
  92. package/dist/SensingProfileClient.js.map +1 -0
  93. package/dist/SetupSessionClient.d.ts +114 -0
  94. package/dist/SetupSessionClient.d.ts.map +1 -0
  95. package/dist/SetupSessionClient.js +95 -0
  96. package/dist/SetupSessionClient.js.map +1 -0
  97. package/dist/VlmAdmissionGate.d.ts +126 -0
  98. package/dist/VlmAdmissionGate.d.ts.map +1 -0
  99. package/dist/VlmAdmissionGate.js +166 -0
  100. package/dist/VlmAdmissionGate.js.map +1 -0
  101. package/dist/autoSense.d.ts +216 -0
  102. package/dist/autoSense.d.ts.map +1 -0
  103. package/dist/autoSense.js +521 -0
  104. package/dist/autoSense.js.map +1 -0
  105. package/dist/cli.d.ts +27 -1
  106. package/dist/cli.d.ts.map +1 -1
  107. package/dist/cli.js +511 -21
  108. package/dist/cli.js.map +1 -1
  109. package/dist/combinedSense.d.ts +128 -0
  110. package/dist/combinedSense.d.ts.map +1 -0
  111. package/dist/combinedSense.js +261 -0
  112. package/dist/combinedSense.js.map +1 -0
  113. package/dist/config.d.ts +351 -0
  114. package/dist/config.d.ts.map +1 -1
  115. package/dist/config.js +99 -2
  116. package/dist/config.js.map +1 -1
  117. package/dist/connectorCadence.d.ts +135 -0
  118. package/dist/connectorCadence.d.ts.map +1 -0
  119. package/dist/connectorCadence.js +151 -0
  120. package/dist/connectorCadence.js.map +1 -0
  121. package/dist/dataDir.d.ts +33 -0
  122. package/dist/dataDir.d.ts.map +1 -0
  123. package/dist/dataDir.js +76 -0
  124. package/dist/dataDir.js.map +1 -0
  125. package/dist/deployedCadence.d.ts +167 -0
  126. package/dist/deployedCadence.d.ts.map +1 -0
  127. package/dist/deployedCadence.js +209 -0
  128. package/dist/deployedCadence.js.map +1 -0
  129. package/dist/deployedCadenceSource.d.ts +48 -0
  130. package/dist/deployedCadenceSource.d.ts.map +1 -0
  131. package/dist/deployedCadenceSource.js +74 -0
  132. package/dist/deployedCadenceSource.js.map +1 -0
  133. package/dist/diagnose.d.ts +1 -1
  134. package/dist/diagnose.d.ts.map +1 -1
  135. package/dist/diagnose.js +13 -12
  136. package/dist/diagnose.js.map +1 -1
  137. package/dist/discovery.d.ts +131 -0
  138. package/dist/discovery.d.ts.map +1 -0
  139. package/dist/discovery.js +499 -0
  140. package/dist/discovery.js.map +1 -0
  141. package/dist/gemmaModelOta.d.ts +118 -0
  142. package/dist/gemmaModelOta.d.ts.map +1 -0
  143. package/dist/gemmaModelOta.js +291 -0
  144. package/dist/gemmaModelOta.js.map +1 -0
  145. package/dist/index.d.ts +16 -1
  146. package/dist/index.d.ts.map +1 -1
  147. package/dist/index.js +40 -1
  148. package/dist/index.js.map +1 -1
  149. package/dist/init.d.ts.map +1 -1
  150. package/dist/init.js +41 -18
  151. package/dist/init.js.map +1 -1
  152. package/dist/keepAwake.d.ts +33 -0
  153. package/dist/keepAwake.d.ts.map +1 -0
  154. package/dist/keepAwake.js +54 -0
  155. package/dist/keepAwake.js.map +1 -0
  156. package/dist/legacyRecorderProfile.d.ts +20 -0
  157. package/dist/legacyRecorderProfile.d.ts.map +1 -0
  158. package/dist/legacyRecorderProfile.js +27 -0
  159. package/dist/legacyRecorderProfile.js.map +1 -0
  160. package/dist/localInferenceSchema.d.ts +132 -0
  161. package/dist/localInferenceSchema.d.ts.map +1 -0
  162. package/dist/localInferenceSchema.js +274 -0
  163. package/dist/localInferenceSchema.js.map +1 -0
  164. package/dist/localSenseE2eHarness.d.ts +101 -0
  165. package/dist/localSenseE2eHarness.d.ts.map +1 -0
  166. package/dist/localSenseE2eHarness.js +279 -0
  167. package/dist/localSenseE2eHarness.js.map +1 -0
  168. package/dist/localSensing.d.ts +268 -0
  169. package/dist/localSensing.d.ts.map +1 -0
  170. package/dist/localSensing.js +492 -0
  171. package/dist/localSensing.js.map +1 -0
  172. package/dist/modelIntegrity.d.ts +59 -0
  173. package/dist/modelIntegrity.d.ts.map +1 -0
  174. package/dist/modelIntegrity.js +165 -0
  175. package/dist/modelIntegrity.js.map +1 -0
  176. package/dist/pairVerify.d.ts +100 -0
  177. package/dist/pairVerify.d.ts.map +1 -0
  178. package/dist/pairVerify.js +296 -0
  179. package/dist/pairVerify.js.map +1 -0
  180. package/dist/qrScanner.d.ts +33 -0
  181. package/dist/qrScanner.d.ts.map +1 -0
  182. package/dist/qrScanner.js +103 -0
  183. package/dist/qrScanner.js.map +1 -0
  184. package/dist/runtimePaths.d.ts +10 -0
  185. package/dist/runtimePaths.d.ts.map +1 -0
  186. package/dist/runtimePaths.js +79 -0
  187. package/dist/runtimePaths.js.map +1 -0
  188. package/dist/sensingRunMode.d.ts +68 -0
  189. package/dist/sensingRunMode.d.ts.map +1 -0
  190. package/dist/sensingRunMode.js +346 -0
  191. package/dist/sensingRunMode.js.map +1 -0
  192. package/dist/setupMode.d.ts +98 -0
  193. package/dist/setupMode.d.ts.map +1 -0
  194. package/dist/setupMode.js +828 -0
  195. package/dist/setupMode.js.map +1 -0
  196. package/dist/setupProgress.d.ts +31 -0
  197. package/dist/setupProgress.d.ts.map +1 -0
  198. package/dist/setupProgress.js +173 -0
  199. package/dist/setupProgress.js.map +1 -0
  200. package/package.json +13 -4
@@ -0,0 +1,161 @@
1
+ # Trillboards Edge — macOS CCTV Connector (.pkg)
2
+
3
+ A self-contained macOS installer for the Trillboards CCTV connector. The
4
+ customer `.pkg` bundles Node, ffmpeg, the connector, and the pinned ~2.4 GB local
5
+ VLM. It installs and verifies local AI before camera pairing opens. The connector
6
+ never silently sends continuous camera load to cloud inference. No Node, ffmpeg,
7
+ Docker, or terminal is required on the operator's Mac.
8
+
9
+ What lands on disk (home-domain, **no sudo / no admin password**):
10
+
11
+ ```
12
+ ~/Library/Trillboards/edge/
13
+ bin/node pinned official Node v22 runtime (arm64/x64)
14
+ bin/ffmpeg bundled ffmpeg (from ffmpeg-static)
15
+ bin/trillboards-edge launcher (puts bin/ first on PATH, execs cli.js)
16
+ bin/trillboards-pair first-run pairing helper (GUI + headless)
17
+ lib/edge-sdk/dist/cli.js the connector CLI
18
+ lib/node_modules/… runtime deps (edge-core + edge-platform-rtsp +
19
+ edge-sdk), WITHOUT the heavy local-inference stack
20
+ share/com.trillboards.edge.plist LaunchAgent template
21
+ share/ensure-litertlm.sh background local-AI retry supervisor
22
+ share/models/gemma-4-E2B-it.litertlm required customer local VLM (removed after import)
23
+ ~/Applications/Trillboards CCTV Setup.app native customer setup window (opened automatically)
24
+ ~/Library/Application Support/Trillboards/trillboards.config.json (after pair, 0600)
25
+ ~/Library/Logs/Trillboards/edge.{out,err}.log
26
+ ~/Library/LaunchAgents/com.trillboards.edge.plist (after pair)
27
+ ```
28
+
29
+ The connector runs as a per-user **LaunchAgent** (`RunAtLoad` + `KeepAlive`),
30
+ bootstrapped automatically on first successful pair. The device token is
31
+ delivered **only by pairing** — it is never baked into the `.pkg`.
32
+
33
+ > The customer build includes Gemma and completes its local health check before
34
+ > pairing. Cloud inference requires explicit configuration. `--skip-model` is
35
+ > available only for engineering checks and must not be published.
36
+
37
+ ---
38
+
39
+ ## Install (operator)
40
+
41
+ 1. Download `TrillboardsEdge-<version>-arm64.pkg`.
42
+ 2. Double-click it. The installer offers **Install for me only** (home-domain) —
43
+ no admin password. (Equivalent CLI: `installer -pkg <pkg> -target
44
+ CurrentUserHomeDirectory`.)
45
+ 3. The installer installs and verifies the connector and included local AI
46
+ model. Only then does **Trillboards CCTV Setup** open automatically. Select
47
+ **Start setup**. The app opens the signed-in Trillboards camera wizard,
48
+ finds recorders on the local network, and validates each channel before any
49
+ camera screens are created. Black, disconnected, and unreadable inputs are
50
+ ignored. After the working cameras are saved, the already-installed local AI
51
+ begins sensing and the connector starts at every login. Reopen **Trillboards
52
+ CCTV Setup** from
53
+ `~/Applications` to resume or repair setup.
54
+
55
+ That's it. To check it's sensing: `tail -f ~/Library/Logs/Trillboards/edge.out.log`.
56
+
57
+ ### Adding RTSP credentials locally (optional, creds-stay-on-prem mode)
58
+
59
+ If the portal delivered camera feeds **without** an `rtspUrl` (so credentials
60
+ never leave the venue), edit
61
+ `~/Library/Application Support/Trillboards/trillboards.config.json` and add the
62
+ `rtspUrl` to each camera, then restart the agent:
63
+
64
+ ```bash
65
+ launchctl kickstart -k "gui/$(id -u)/com.trillboards.edge"
66
+ ```
67
+
68
+ ---
69
+
70
+ ## Build (engineering)
71
+
72
+ ```bash
73
+ cd trillboards-edge-sdk
74
+ npm install # ensures ffmpeg-static is fetched
75
+ cd packages/edge-sdk/deploy/macos
76
+ ./build-macos-pkg.sh # → dist-installer/TrillboardsEdge-<ver>-arm64.pkg
77
+ ```
78
+
79
+ Options:
80
+
81
+ | flag | default | meaning |
82
+ |------|---------|---------|
83
+ | `--arch arm64\|x64` | host arch | target architecture |
84
+ | `--node-version vX.Y.Z` | `v22.22.0` | pinned Node runtime to bundle |
85
+ | `--bundle-model` | on | include the pinned ~2.4 GB Gemma model required by customer setup |
86
+ | `--skip-model` | off | build a slim engineering artifact that must not be published to customers |
87
+ | `--offline` | off | skip the official Node download; copy the host `node` |
88
+ | `--sign-installer "Developer ID Installer: …"` | unset | `productsign` the pkg |
89
+
90
+ The build is idempotent (it wipes its staging tree each run) and **smoke-tests
91
+ the staged bundle** (`trillboards-edge version`) before packaging.
92
+
93
+ ### Local end-to-end test
94
+
95
+ ```bash
96
+ bash packages/edge-sdk/deploy/macos/test-install-pair.sh
97
+ ```
98
+
99
+ No sudo. It builds the pkg, installs it home-domain, starts a local stub
100
+ pair+analyze server, pairs headlessly, runs `cloud-sense` against a **synthetic
101
+ ffmpeg source** (a generated clip via `file:` — no RTSP server needed), asserts a
102
+ **real JPEG frame** is produced by the bundled ffmpeg and POSTed with the paired
103
+ `X-Device-Token`, verifies the LaunchAgent bootstraps and senses autonomously,
104
+ then tears everything down. TAP output; non-zero exit on any failure.
105
+
106
+ ---
107
+
108
+ ## Signing & notarization (distribution follow-on)
109
+
110
+ The local build is **unsigned** because this repo's signing keychain has only
111
+ `Apple Development` / `Apple Distribution` identities — there is **no
112
+ `Developer ID Installer`** cert (the one Gatekeeper requires for a `.pkg`
113
+ distributed outside the App Store).
114
+
115
+ To ship a Gatekeeper-clean installer, on a machine that has the
116
+ `Developer ID Installer` cert:
117
+
118
+ ```bash
119
+ # 1. Sign the installer
120
+ ./build-macos-pkg.sh --sign-installer "Developer ID Installer: Aethercorp Inc (78JQ7882U9)"
121
+ # (or: export MAC_INSTALLER_IDENTITY="Developer ID Installer: …" && ./build-macos-pkg.sh)
122
+
123
+ # 2. Notarize + staple
124
+ xcrun notarytool submit dist-installer/TrillboardsEdge-<ver>-arm64.pkg \
125
+ --keychain-profile <notary-profile> --wait
126
+ xcrun stapler staple dist-installer/TrillboardsEdge-<ver>-arm64.pkg
127
+ ```
128
+
129
+ The bundled `bin/node` and `bin/ffmpeg` are third-party Mach-O binaries; for full
130
+ notarization they should additionally be **codesigned with a Developer ID
131
+ Application cert + hardened runtime** before the pkg is built (notarytool checks
132
+ nested executables). That cert is likewise not present here, so it's part of the
133
+ same distribution follow-on. Until then, the unsigned pkg installs fine via the
134
+ `installer` CLI and for internal/manual installs.
135
+
136
+ ---
137
+
138
+ ## Other platforms (same pair-then-local-first flow)
139
+
140
+ macOS is the must-have one-click installer. The connector itself is
141
+ cross-platform; the other OS installers live alongside this one and follow the
142
+ **identical** flow — `pair` writes the config, then `auto-sense` waits for and
143
+ runs the local model:
144
+
145
+ - **Linux (systemd):** [`../systemd/`](../systemd/) — `install.sh` lays down the
146
+ SDK + a `trillboards-edge` systemd unit. Pair first, then point the unit at
147
+ `auto-sense`:
148
+ ```bash
149
+ trillboards-edge pair --code XXXX-XXXX --config /etc/trillboards/config.json
150
+ # edit the unit's ExecStart to: trillboards-edge auto-sense --config /etc/trillboards/config.json
151
+ sudo systemctl restart trillboards-edge
152
+ ```
153
+ ffmpeg is required on the host (the systemd install handles it via apt).
154
+ - **Windows (Service):** [`../windows/install-service.ps1`](../windows/install-service.ps1)
155
+ — installs the SDK as a Windows service. Same flow: `trillboards-edge pair
156
+ --code XXXX-XXXX --config <path>` then run `auto-sense --config <path>`.
157
+ - **Docker:** [`../docker/`](../docker/) — for headless/server NVR gateways.
158
+
159
+ The pairing endpoint (`POST /v2/earner/cameras/pair`), the config shape, and the
160
+ local-first sensing runtime are shared across all platforms — only the
161
+ service-supervisor wrapper differs.