@tomorrowos/sdk 0.9.67 → 0.9.69

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/README.md CHANGED
@@ -6,9 +6,9 @@
6
6
 
7
7
  Build and own your digital signage CMS.
8
8
 
9
- An open-source SDK and player runtime for digital signage. One server-side API drives commercial signage panels — you write the CMS, we handle device sessions, pairing, and the wire protocol.
9
+ An open-source SDK and player runtime for digital signage. One server-side API drives commercial signage panels �?you write the CMS, we handle device sessions, pairing, and the wire protocol.
10
10
 
11
- Apache 2.0. Build a proprietary CMS on top of it and sell it as your own — no royalty, no permission needed.
11
+ Apache 2.0. Build a proprietary CMS on top of it and sell it as your own �?no royalty, no permission needed.
12
12
 
13
13
  ---
14
14
 
@@ -19,7 +19,7 @@ Apache 2.0. Build a proprietary CMS on top of it and sell it as your own — no
19
19
  | Node.js | **18** or newer (`engines.node` in this package) |
20
20
  | npm | 9 or newer (or a compatible client) |
21
21
  | OS | macOS, Linux, Windows (WSL2 recommended on Windows) |
22
- | Network | CMS host reachable from your screens — a public HTTPS address in production |
22
+ | Network | CMS host reachable from your screens �?a public HTTPS address in production |
23
23
 
24
24
  Screens connect to your CMS over the network. For real panels, deploy to a public host (Railway, Render, Fly, Vercel Fluid, Replit, your own server), or use a tunnel while developing locally.
25
25
 
@@ -52,7 +52,7 @@ Guided setup is supported for **Replit** and **Vercel / v0** only. **Replit is r
52
52
 
53
53
  The SDK ships an elicitation protocol so the agent asks the right questions before it writes anything. Skipping it reliably produces a CMS that doesn't run.
54
54
 
55
- ### Replit (recommended) — use Power agent mode
55
+ ### Replit (recommended) �?use Power agent mode
56
56
 
57
57
  Paste into Replit **Power**:
58
58
 
@@ -70,31 +70,15 @@ Follow NPM package @tomorrowos/sdk REPLIT_UPGRADE.md to upgrade my CMS with the
70
70
 
71
71
  That protocol diffs and merges against the current templates. It must never run `init --force` or delete `data/` or `public/uploads/`.
72
72
 
73
- ### Vercel / v0 — use v0 Max
73
+ ### Vercel / v0 �?use v0 Max
74
74
 
75
75
  Paste into **v0 Max** (or Vercel Agent with Max capability):
76
76
 
77
77
  ```text
78
- Follow @tomorrowos/sdk (an NPM package) VERCEL_SETUP.md and set up my TomorrowOS CMS from scratch.
79
-
80
- Open VERCEL_QUESTIONS.md first.
81
- For Q1, Q2, Q3: paste each question block VERBATIM. Do not rephrase options.
82
- For Q3: DO NOT ask a branding choice. Open one form with ALL SEVEN optional inputs at once, then HARD STOP and WAIT for my submit or "skip". Never auto-continue with defaults without my reply. Never only Name + Primary colour. Logo = Upload above Logo URL.
83
- After Q1 database choice, YOU set TOMORROWOS_STORE and DATABASE_SSL. Do not ask me to fill those.
84
- After Q2 media storage choice, YOU set TOMORROWOS_MEDIA. Do not ask me to fill those.
85
- Run: npx @tomorrowos/sdk@latest init . --hosting v0 --force
86
- Keep cms-starter-v0 layout.
87
- Apply the NON-NEGOTIABLE VERCEL RUNTIME CONTRACT exactly:
88
- one TomorrowOS instance only
89
- never create a second TomorrowOS in api/ws.ts
90
- never use public/ as Vercel Output Directory
91
- Preview Next only under preview/
92
- Publish must be the Fluid Function
93
- after deploy verify: GET /status → JSON, GET / → Control Panel, WebSocket on / or /api → 101
94
- pair devices against the Production URL only
78
+ Follow NPM package @tomorrowos/sdk VERCEL_SETUP.md and set up my TomorrowOS CMS.
95
79
  ```
96
80
 
97
- Agents must paste questions from [`VERCEL_QUESTIONS.md`](./VERCEL_QUESTIONS.md) verbatim. Q1/Q2 are choice questions; **Q3 is a form only** — open **all seven** optional inputs at once, then **wait** for submit or `"skip"` (never auto-skip because fields are optional; never a branding choice first; never only Name + Primary colour). Logo = Upload above Logo URL. WebSockets require Fluid compute. The agent sets `cms.hostingTarget` to `"vercel"`.
81
+ Agents must paste questions from [`VERCEL_QUESTIONS.md`](./VERCEL_QUESTIONS.md) verbatim.
98
82
 
99
83
  Upgrading an existing Vercel / v0 CMS instead:
100
84
 
@@ -115,7 +99,7 @@ Supported hosts: **Replit** and **Vercel / v0**. Prefer **Replit Power agent mod
115
99
  4. Scaffold with the correct template (**always `@latest`**):
116
100
  - Replit / self-host style: `npx @tomorrowos/sdk@latest init .` (default `cms-starter`)
117
101
  - Vercel / v0: `npx @tomorrowos/sdk@latest init . --hosting v0 --force` (`cms-starter-v0`)
118
- 5. Apply the user’s answers — brand and use case. Validate `brand.json`. On Vercel, apply the **NON-NEGOTIABLE VERCEL RUNTIME CONTRACT** from `VERCEL_SETUP.md`.
102
+ 5. Apply the user’s answers �?brand and use case. Validate `brand.json`. On Vercel, apply the **NON-NEGOTIABLE VERCEL RUNTIME CONTRACT** from `VERCEL_SETUP.md`.
119
103
  6. Point the user at `PLAYER_INSTALL.md` and the Control Panel **Download Players** UI once the CMS is running.
120
104
 
121
105
  Do not write WebSocket transport, pairing wire format, or platform-specific player bridge code. The SDK handles server-side device sessions and HTTP helpers. Customise the UI, the branding, and how you call the SDK.
@@ -155,7 +139,7 @@ npm run dev
155
139
  | **Railway** | Simple Node deploy; good default for self-built CMS |
156
140
  | **Render** | Web Service with persistent process |
157
141
  | **Fly.io** | Global edge VMs; hold WebSockets cleanly |
158
- | **Replit** | Fastest AI-assisted path — see [Build with an AI tool](#1-build-with-an-ai-tool) |
142
+ | **Replit** | Fastest AI-assisted path �?see [Build with an AI tool](#1-build-with-an-ai-tool) |
159
143
  | **Vercel Fluid** | Use `--hosting v0` and follow [`VERCEL_SETUP.md`](./VERCEL_SETUP.md) |
160
144
 
161
145
  Avoid classic short-lived serverless without WebSocket support.
@@ -166,7 +150,7 @@ You now have a CMS serving:
166
150
  - `GET /brand.json` for player branding
167
151
  - a WebSocket device channel
168
152
  - media upload helpers (`/media/upload`, and Cloudinary direct upload when configured)
169
- - `GET /players/brightsign.zip` — BrightSign package with `config.js` `cmsEndpoint` set to this CMS origin
153
+ - `GET /players/brightsign.zip` �?BrightSign package with `config.js` `cmsEndpoint` set to this CMS origin
170
154
  - a minimal admin panel (static UI under `staticRoot`)
171
155
 
172
156
  Deploy it to a public HTTPS address before pairing a production screen. While developing locally, a tunnel is the fastest way to get one.
@@ -204,10 +188,10 @@ What you keep from your app: your auth, your users, your tenancy model, your UI.
204
188
 
205
189
  Points to plan for:
206
190
 
207
- - **Multi-tenancy.** Devices belong to whatever tenant model you already have. The SDK does not impose one — map device IDs to your own tenant records.
191
+ - **Multi-tenancy.** Devices belong to whatever tenant model you already have. The SDK does not impose one �?map device IDs to your own tenant records.
208
192
  - **Auth.** Pairing is a device-side flow. Your admin routes stay behind your existing auth.
209
193
  - **Store.** Use `createTomorrowOSStore` / `TOMORROWOS_STORE` for SQLite, Postgres, or Supabase, or pass a custom `TomorrowOSStore`.
210
- - **WebSockets.** Your host must hold long-lived connections. Most serverless platforms terminate idle sockets — check before you commit (Vercel needs Fluid compute).
194
+ - **WebSockets.** Your host must hold long-lived connections. Most serverless platforms terminate idle sockets �?check before you commit (Vercel needs Fluid compute).
211
195
 
212
196
  **Next:** [Connect a screen](#connect-a-screen).
213
197
 
@@ -216,19 +200,19 @@ Points to plan for:
216
200
  ## Architecture
217
201
 
218
202
  ```
219
- ┌─────────────────┐ WebSocket ┌─────────────────┐
220
- │ Your CMS │ ◄────────────────────────►│ TomorrowOS │
221
- │ (your server) │ │ Player on │
222
- │ │ │ screen │
223
- │ imports │ │ │
224
- │ @tomorrowos │ │ unified API │
225
- │ /sdk │ │ across panels │
226
- └─────────────────┘ └─────────────────┘
203
+ ┌─────────────────�? WebSocket ┌─────────────────�?
204
+ �? Your CMS �?◄────────────────────────►│ TomorrowOS �?
205
+ �? (your server) �? �? Player on �?
206
+ �? �? �? screen �?
207
+ �? imports �? �? �?
208
+ �? @tomorrowos �? �? unified API �?
209
+ �? /sdk �? �? across panels �?
210
+ └─────────────────�? └─────────────────�?
227
211
  ```
228
212
 
229
213
  You own the CMS: the UI, the branding, the business logic, the data. The SDK owns the device session, the pairing handshake, and the wire protocol.
230
214
 
231
- You should not need to write WebSocket transport, pairing wire format, or platform-specific player bridge code. If you find yourself doing that, open an issue — it means the SDK has a gap.
215
+ You should not need to write WebSocket transport, pairing wire format, or platform-specific player bridge code. If you find yourself doing that, open an issue �?it means the SDK has a gap.
232
216
 
233
217
  ---
234
218
 
@@ -238,7 +222,7 @@ Your CMS is running. This is what happens next, in order.
238
222
 
239
223
  1. **Deploy the CMS to a public HTTPS address** (or tunnel for local tests). Screens must reach it from their network.
240
224
  2. **Get a player package** for your platform (see below and [`PLAYER_INSTALL.md`](./PLAYER_INSTALL.md)).
241
- Note: `npx tomorrowos build --platform …` is still a **placeholder** in this package — packaging lives in the player repos / prebuilt downloads, not in the CLI yet.
225
+ Note: `npx tomorrowos build --platform …` is still a **placeholder** in this package �?packaging lives in the player repos / prebuilt downloads, not in the CLI yet.
242
226
  3. **Install the player on the panel.**
243
227
  4. **Pair.** The player shows a 6-character code. Enter it in the Control Panel. The device appears in your device list.
244
228
  5. **Publish content.** Assign playlists / push a content policy. The screen updates without reloading the app.
@@ -247,9 +231,9 @@ Your CMS is running. This is what happens next, in order.
247
231
 
248
232
  Supported target: **Tizen 6.5+** commercial displays (see Control Panel captions and [`PLAYER_INSTALL.md`](./PLAYER_INSTALL.md)).
249
233
 
250
- **Fastest path for many setups — URL Launcher / prebuilt package**
234
+ **Fastest path for many setups �?URL Launcher / prebuilt package**
251
235
 
252
- - From a running Control Panel, use **Download Players → Samsung**, or fetch the published Tizen package from TomorrowOS distribution (`https://tmr.sh/app/tizen/…`).
236
+ - From a running Control Panel, use **Download Players �?Samsung**, or fetch the published Tizen package from TomorrowOS distribution (`https://tmr.sh/app/tizen/…`).
253
237
  - Or host / sideload a `.wgt` as described in [`PLAYER_INSTALL.md`](./PLAYER_INSTALL.md).
254
238
 
255
239
  On the panel, enter the CMS HTTPS URL (or the player package URL your install path requires). The player shows a pairing code.
@@ -262,7 +246,7 @@ Supported target: **Series 5 / 6** (as labeled in the Control Panel). Older seri
262
246
 
263
247
  **Recommended download path**
264
248
 
265
- 1. Open your live CMS Control Panel → **Download Players → BrightSign**.
249
+ 1. Open your live CMS Control Panel �?**Download Players �?BrightSign**.
266
250
  2. That hits `GET /players/brightsign.zip` on *this* CMS.
267
251
  3. The SDK fetches the mother zip and rewrites `config.js` so:
268
252
 
@@ -281,7 +265,7 @@ Override the mother zip URL with `TOMORROWOS_BRIGHTSIGN_ZIP_URL` if you host you
281
265
 
282
266
  Android, LG webOS, and Windows are on the roadmap. They are not validated for production in this SDK release.
283
267
 
284
- If you are building for one of those platforms later: build your CMS against the same server API now. Server-side code does not need to change when a new player package lands — only the installable player does.
268
+ If you are building for one of those platforms later: build your CMS against the same server API now. Server-side code does not need to change when a new player package lands �?only the installable player does.
285
269
 
286
270
  ---
287
271
 
@@ -289,12 +273,12 @@ If you are building for one of those platforms later: build your CMS against the
289
273
 
290
274
  | Platform | Status | Install |
291
275
  |---|---|---|
292
- | Samsung Tizen 6.5+ | V1 supported | Control Panel download / `.wgt` / URL Launcher — see `PLAYER_INSTALL.md` |
293
- | BrightSign Series 5, 6 | V1 supported | Control Panel `GET /players/brightsign.zip` → microSD autorun |
276
+ | Samsung Tizen 6.5+ | V1 supported | Control Panel download / `.wgt` / URL Launcher �?see `PLAYER_INSTALL.md` |
277
+ | BrightSign Series 5, 6 | V1 supported | Control Panel `GET /players/brightsign.zip` �?microSD autorun |
294
278
  | BrightSign older series | Validate on hardware | Same autorun zip flow |
295
- | Android | Roadmap | — |
296
- | LG webOS | Roadmap | — |
297
- | Windows | Roadmap | — |
279
+ | Android | Roadmap | �?|
280
+ | LG webOS | Roadmap | �?|
281
+ | Windows | Roadmap | �?|
298
282
 
299
283
  Treat a platform as production-ready only after you have validated it on your panels.
300
284
 
@@ -315,7 +299,7 @@ DATABASE_SSL=true
315
299
 
316
300
  Supported store drivers: `sqlite`, `postgres`, `supabase`, `memory`.
317
301
 
318
- Use `memory` for throwaway demos only — nothing survives a restart.
302
+ Use `memory` for throwaway demos only �?nothing survives a restart.
319
303
 
320
304
  ### Migrating between stores
321
305
 
@@ -327,13 +311,14 @@ npx tomorrowos migrate \
327
311
  --to-database-url "$DATABASE_URL"
328
312
  ```
329
313
 
330
- Works in either direction across `sqlite`, `postgres`, and `supabase`. It moves database records only — copy `public/uploads` or object-storage / Cloudinary media separately.
314
+ Works in either direction across `sqlite`, `postgres`, and `supabase`. It moves database records only �?copy `public/uploads` or object-storage / Cloudinary media separately.
331
315
 
332
316
  ### Media
333
317
 
334
- - **Local disk:** small files may use `POST /media/upload`. Larger files use **chunked upload** (`/media/upload-init` → `/media/upload-chunk` → `/media/upload-complete`).
318
+ - **Local disk:** small files may use `POST /media/upload`. Larger files use **chunked upload** (`/media/upload-init` �?`/media/upload-chunk` �?`/media/upload-complete`).
335
319
  - **Replit Object Storage:** set `TOMORROWOS_MEDIA=replit-object-storage` (auto-preferred on Replit when Cloudinary is unset). Uses `@replit/object-storage`; URLs stay `/uploads/...` and are served from the bucket after Republish. Same upload HTTP routes as local.
336
- - **Cloudinary:** set `CLOUDINARY_CLOUD_NAME`, `CLOUDINARY_API_KEY`, `CLOUDINARY_API_SECRET` (optional `CLOUDINARY_FOLDER`). The Control Panel uses **browser → Cloudinary** direct upload (`/media/upload-sign` + `/media/register`) when Cloudinary is configured.
320
+ - **Cloudinary:** set `CLOUDINARY_CLOUD_NAME`, `CLOUDINARY_API_KEY`, `CLOUDINARY_API_SECRET` (optional `CLOUDINARY_FOLDER`). The Control Panel uses **browser �?Cloudinary** direct upload (`/media/upload-sign` + `/media/register`) when Cloudinary is configured.
321
+ - **Vercel Blob:** set `BLOB_READ_WRITE_TOKEN` and `TOMORROWOS_MEDIA=vercel-blob` (token alone also auto-enables Blob when Cloudinary is unset). SDK uploads via `@vercel/blob` `put()`; asset URLs are absolute `https://*.public.blob.vercel-storage.com/...`.
337
322
 
338
323
  Cloudinary account plans still enforce their own max file sizes (for example Free plan video caps).
339
324
 
@@ -366,7 +351,7 @@ POST /device/{deviceId}/content/set-policy
366
351
 
367
352
  Each playlist may include optional `schedule`, evaluated in **device local time**. The run window is **one continuous period**:
368
353
 
369
- **from** `startDate` + `start` **→ until** `endDate` + `end` (until is exclusive).
354
+ **from** `startDate` + `start` **�?until** `endDate` + `end` (until is exclusive).
370
355
 
371
356
  | Field | Format | Notes |
372
357
  |---|---|---|
@@ -386,16 +371,16 @@ The player must reach your CMS. Confirm a public HTTPS (or reachable tunnel) URL
386
371
  Common causes: media the player cannot decode (codec / profile / unexpected tracks), or HTML video surface alpha / HTML widget timing in `autorun.brs`. Re-encode to a supported profile and confirm `config.js` points at the correct CMS. Check player logs on the device.
387
372
 
388
373
  **Paired, but the screen is black (other).**
389
- Fetch `GET /brand.json` from the panel’s network. A live WebSocket with a black screen usually means no playable policy item — check published playlists, absolute media URLs, and fallback.
374
+ Fetch `GET /brand.json` from the panel’s network. A live WebSocket with a black screen usually means no playable policy item �?check published playlists, absolute media URLs, and fallback.
390
375
 
391
376
  **Media 404s on the screen but loads in your browser.**
392
377
  Policy URLs must be absolute and reachable from the screen. Relative paths or hosts only visible on your laptop will fail on the panel.
393
378
 
394
379
  **Upload fails with HTTP 413 on Replit (or similar hosts).**
395
- Use `@tomorrowos/sdk` Control Panel / templates: non-Cloudinary uploads over ~2MB go through **chunked** `/media/upload-chunk`. On Replit, set `TOMORROWOS_MEDIA=replit-object-storage` (or rely on auto-detect) so files land in App Storage. With Cloudinary configured, the panel uses browser direct upload instead.
380
+ Use `@tomorrowos/sdk` Control Panel / templates: non-Cloudinary uploads over ~2MB go through **chunked** `/media/upload-chunk`. On Replit, set `TOMORROWOS_MEDIA=replit-object-storage` (or rely on auto-detect) so files land in App Storage. On Vercel Blob, set `TOMORROWOS_MEDIA=vercel-blob` + `BLOB_READ_WRITE_TOKEN` so proxy/chunked complete stores absolute Blob URLs. With Cloudinary configured, the panel uses browser direct upload instead.
396
381
 
397
382
  **BrightSign zip has empty `cmsEndpoint`.**
398
- You downloaded the mother zip from a static CDN instead of **this** CMS’s `/players/brightsign.zip`. Use Control Panel → Download Players → BrightSign on the deployed CMS.
383
+ You downloaded the mother zip from a static CDN instead of **this** CMS’s `/players/brightsign.zip`. Use Control Panel �?Download Players �?BrightSign on the deployed CMS.
399
384
 
400
385
  **WebSocket disconnects on a serverless host.**
401
386
  Most serverless platforms terminate idle connections. Vercel requires Fluid compute. Prefer a long-lived Node host (Railway, Render, Fly, Replit) if your platform cannot hold sockets.
@@ -410,7 +395,7 @@ You are probably on `TOMORROWOS_STORE=memory`. Switch to `sqlite` or Postgres/Su
410
395
  - **Package docs:** the Markdown files listed below ship inside `@tomorrowos/sdk`
411
396
  - **npm:** [https://www.npmjs.com/package/@tomorrowos/sdk](https://www.npmjs.com/package/@tomorrowos/sdk)
412
397
 
413
- If something in this README doesn't match what the package actually does, treat that as a bug and report it — documentation drift matters as much as a code defect.
398
+ If something in this README doesn't match what the package actually does, treat that as a bug and report it �?documentation drift matters as much as a code defect.
414
399
 
415
400
  ---
416
401