@trillboards/edge-sdk 0.2.17 → 0.2.18

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.
@@ -32,6 +32,17 @@ HF_REPO="litert-community/gemma-4-E2B-it-litert-lm"
32
32
  SERVE_LABEL="com.trillboards.litertlm"
33
33
  SERVE_PORT="9379"
34
34
  LITERT_PYTHON="${LITERT_LM_PYTHON:-3.12}"
35
+ # PINNED litert-lm. This is not hygiene — the accelerator is selected by posting
36
+ # a `<model-id>,gpu` model id, upstream calls that syntax deprecated, and it has
37
+ # already changed twice without any release of ours: 0.14.0 (2026-07-08) dropped
38
+ # both the `,gpu` entry from `GET /v1/models` AND the parse (measured: 404), and
39
+ # 0.15.0 restored the parse but never the entry. An unpinned `--upgrade` means a
40
+ # customer's per-frame cost can change 1.7-6.6x on a reinstall we did not ship.
41
+ # Keep in lockstep with deploy/windows/setup-litertlm.ps1, LiteRtVlmProvider's
42
+ # LITERT_LM_PINNED_VERSION, and .github/contracts/litert-lm-tested-versions.json
43
+ # — the `litert-lm-version-pin` guard fails CI if they diverge or if this version
44
+ # has no measured entry in that contract.
45
+ LITERT_LM_VERSION="${LITERT_LM_VERSION:-0.16.0}"
35
46
  REQUIRE_BUNDLED_MODEL="${TRILLBOARDS_REQUIRE_BUNDLED_MODEL:-0}"
36
47
  ALLOW_MODEL_DOWNLOAD="${TRILLBOARDS_ALLOW_MODEL_DOWNLOAD:-0}"
37
48
  # Customer packages stage the model here. A network fallback remains available
@@ -170,18 +181,32 @@ if ! command -v "$UV" >/dev/null 2>&1 && [ ! -x "$UV" ]; then
170
181
  log "ERROR: uv unavailable; cannot provision LiteRT-LM"; exit 0
171
182
  fi
172
183
 
173
- # 2. litert-lm CLI. Keep a healthy existing install, but actively repair a
174
- # broken one. Older connector versions could let uv bind the tool to Apple's
175
- # Python 3.9; current LiteRT-LM uses Python features introduced in 3.10 and then
176
- # crash-loops before serving. --force rebuilds that existing tool environment
177
- # with the explicit managed interpreter while --upgrade refreshes the package.
184
+ # 2. litert-lm CLI. Keep a healthy existing install AT THE PINNED VERSION, but
185
+ # actively repair a broken or drifted one. Older connector versions could let uv
186
+ # bind the tool to Apple's Python 3.9; current LiteRT-LM uses Python features
187
+ # introduced in 3.10 and then crash-loops before serving. --force rebuilds that
188
+ # existing tool environment with the explicit managed interpreter.
189
+ #
190
+ # The version check is part of "healthy". A `list`-only health check kept every
191
+ # machine on whatever it happened to install first — which is how the box this
192
+ # was designed on stayed on 0.13.1 (where the `,gpu` entry is advertised) while
193
+ # every customer install after 2026-07-08 got a build that omits it. The bug
194
+ # reproduced on their hosts and on none of ours.
178
195
  LITERTLM="$LOCAL_BIN/litert-lm"
179
196
  [ -x "$LITERTLM" ] || LITERTLM="$(command -v litert-lm || echo "$LITERTLM")"
180
- if [ -x "$LITERTLM" ] && "$LITERTLM" list >/dev/null 2>&1; then
181
- log "litert-lm CLI is healthy — keeping current install"
197
+ INSTALLED_LITERT_VERSION=""
198
+ if [ -x "$LITERTLM" ]; then
199
+ INSTALLED_LITERT_VERSION="$("$LITERTLM" --version 2>/dev/null | tr -d '\r' | awk '{print $NF}')"
200
+ fi
201
+ if [ -x "$LITERTLM" ] && [ "$INSTALLED_LITERT_VERSION" = "$LITERT_LM_VERSION" ] \
202
+ && "$LITERTLM" list >/dev/null 2>&1; then
203
+ log "litert-lm CLI is healthy at pinned $LITERT_LM_VERSION — keeping current install"
182
204
  else
183
- log "installing/repairing litert-lm with uv-managed Python $LITERT_PYTHON"
184
- if ! "$UV" tool install --python "$LITERT_PYTHON" --managed-python --upgrade --force litert-lm >>"$LOG" 2>&1; then
205
+ if [ -n "$INSTALLED_LITERT_VERSION" ] && [ "$INSTALLED_LITERT_VERSION" != "$LITERT_LM_VERSION" ]; then
206
+ log "litert-lm $INSTALLED_LITERT_VERSION differs from pinned $LITERT_LM_VERSION — reinstalling"
207
+ fi
208
+ log "installing/repairing litert-lm==$LITERT_LM_VERSION with uv-managed Python $LITERT_PYTHON"
209
+ if ! "$UV" tool install --python "$LITERT_PYTHON" --managed-python --force "litert-lm==$LITERT_LM_VERSION" >>"$LOG" 2>&1; then
185
210
  [ "$REQUIRE_BUNDLED_MODEL" = "1" ] && fail "litert-lm install/repair failed"
186
211
  log "ERROR: litert-lm install/repair failed; local AI will retry later"
187
212
  exit 0
@@ -193,7 +218,7 @@ else
193
218
  log "ERROR: litert-lm remains unhealthy after repair; local AI will retry later"
194
219
  exit 0
195
220
  fi
196
- log "litert-lm CLI repaired successfully"
221
+ log "litert-lm CLI repaired successfully at $("$LITERTLM" --version 2>/dev/null | awk '{print $NF}')"
197
222
  fi
198
223
 
199
224
  # 3. Model - import the verified bundled file. Idempotent: skip entirely if
@@ -19,7 +19,11 @@ bin\trillboards-pair.cmd hidden setup engine used by the setup window
19
19
  bin\trillboards-hidden-run.vbs runs a helper with NO console (never use cmd's
20
20
  `start`: it allocates a visible console before the
21
21
  child can hide itself)
22
- bin\register-task.ps1 registers the logon Scheduled Task
22
+ bin\register-task.ps1 registers the background Scheduled Task. Tries
23
+ S4U + boot trigger first (runs with NOBODY logged
24
+ on), and steps down one capability at a time to a
25
+ repeating trigger and then an interactive
26
+ principal, so a machine is never left with no task
23
27
  bin\stop-existing.ps1 DISABLES the task, stops this install's processes,
24
28
  and proves bin\node.exe is unlocked before a swap
25
29
  bin\ensure-sensing.ps1 re-arms the task (register/enable/start) — closing
@@ -40,13 +44,22 @@ serves every Windows 10/11 — no per-arch builds.
40
44
  2. Run it. Production installers are Authenticode-signed with Azure Trusted
41
45
  Signing and the release workflow verifies the signature before publishing.
42
46
  3. Installer copies the connector, installs and verifies the included local AI,
43
- registers the logon tasks, then opens **Trillboards CCTV Setup** without a
47
+ registers the startup tasks, then opens **Trillboards CCTV Setup** without a
44
48
  command window.
45
49
  4. Select **Start setup**. The app opens the Trillboards camera wizard, discovers
46
50
  local recorders, and validates each channel. Black, disconnected, and
47
51
  unreadable inputs are ignored; only working camera feeds become screens.
48
- 5. Sensing starts with the already-installed local AI and restarts on every
49
- logon; cloud inference is off by default.
52
+ 5. Sensing starts with the already-installed local AI; cloud inference is off
53
+ by default.
54
+ 6. Closing the setup window asks for **one UAC elevation**. That single prompt is
55
+ what makes sensing survive an unattended reboot, and it is a Windows rule
56
+ rather than a preference: an S4U principal performs a batch logon, and Task
57
+ Scheduler grants `SeBatchLogonRight` only when the caller is an administrator
58
+ (boot triggers are Administrators-only for the same reason). Accepting it
59
+ registers both tasks S4U + at boot, so the connector comes back within ~30 s
60
+ of every restart with nobody signed in. Declining it — or installing under a
61
+ standard user, who is never prompted because they could not satisfy it — keeps
62
+ a working task that repeats every 5 minutes but still needs someone logged on.
50
63
 
51
64
  ## Build (CI: `release-connector-windows.yml`, runs on `windows-latest`)
52
65