@tomorrowos/sdk 0.7.9 → 0.7.10

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/REPLIT_SETUP.md CHANGED
@@ -12,6 +12,7 @@ When a human pastes a prompt like this, **read this file and start Question 1 im
12
12
  ```text
13
13
  Follow @tomorrowos/sdk REPLIT_SETUP.md and set up my TomorrowOS CMS.
14
14
  Ask only the questions listed in REPLIT_SETUP.md, in order. Do not use LLM_PROMPT.md.
15
+ After the four answers, configure and start — minimal verification only (Web app type + Preview at /). No Supabase or WebSocket tests.
15
16
  Do not skip steps.
16
17
  ```
17
18
 
@@ -58,10 +59,7 @@ Then ask **Question 1** — do not switch to `LLM_PROMPT.md`.
58
59
  4. **Do not use Replit’s reserved `DATABASE_URL` Secret for Supabase.** On Replit, `DATABASE_URL` is often pre-claimed. Always use **`SUPABASE_URL`** for TomorrowOS ↔ Supabase.
59
60
  5. **Prefer `npx @tomorrowos/sdk init`** (or the package’s `templates/cms-starter`) as the project seed. Do not rebuild pairing, WebSocket, or playlist APIs from scratch.
60
61
  6. **Never commit secrets** into git. Put credentials only in Replit **Secrets** (and optionally mirror non-secret flags in `.env` that reference env vars).
61
- 7. After Q&A, apply configuration, install deps, start the server, and verify:
62
- - HTTP Control Panel loads
63
- - `GET /brand.json` returns 200
64
- - WebSocket upgrade on `wss://<repl-host>/` succeeds (critical for TV pairing)
62
+ 7. After Q&A, **configure and start** do **not** run a long test suite (see **Post-Q&A: minimal verification only**).
65
63
  8. **Follow the Runtime & Replit publish rules below exactly.** A project that cannot Deploy / Publish on Replit is incomplete.
66
64
 
67
65
  **Question order after Q1:**
@@ -200,7 +198,7 @@ Allowed extras (optional): `"build-player": "tomorrowos build --platform tizen"`
200
198
  "node": ">=20"
201
199
  },
202
200
  "dependencies": {
203
- "@tomorrowos/sdk": "^0.7.9",
201
+ "@tomorrowos/sdk": "^0.7.10",
204
202
  "dotenv": "^17.2.3",
205
203
  "tsx": "^4.19.0"
206
204
  },
@@ -252,21 +250,13 @@ If the workspace already has a `.replit`, **merge** these keys — do not wipe u
252
250
 
253
251
  ### Publish readiness checklist (before telling the user “done”)
254
252
 
255
- 1. Replit project / primary artifact is **Web app** (not API-only / `api-kind`)
256
- 2. `.replit` has `entrypoint = "server.ts"`, `modules = ["nodejs-20"]`, `[[ports]]` with `externalPort = 80`, `deploymentTarget = "autoscale"`
257
- 3. Publishing type is **Autoscale** or **Reserved VM** (not Static-only)
258
- 4. `package.json` has `scripts.start` = `tsx server.ts`
259
- 5. `tsx` is listed under `dependencies` (runtime-safe for Deploy)
260
- 6. Dependency is `@tomorrowos/sdk` (not a fork or vendored rewrite)
261
- 7. `.replit` Run + `[deployment].run` use `npm run start`
262
- 8. Node is **20+**
263
- 9. Preview at `/` shows the TomorrowOS Control Panel (not Canvas, not another app, not API JSON)
264
- 10. Stale processes / port conflicts cleared before publish
265
- 11. `npm run start` prints `[TomorrowOS] listening on http://0.0.0.0:...`
266
- 12. Browser WebSocket test to `wss://<host>/` succeeds
267
- 13. Secrets required by the Q&A answers are set (`SUPABASE_URL`, Cloudinary, etc.)
268
-
269
- If any item fails, fix it before finishing.
253
+ **Only these three checks matter after setup.** Do not add more unless Publish fails.
254
+
255
+ 1. **Web app, not API** project / primary artifact is **Web app** (not `api-kind` / API-only).
256
+ 2. **`.replit` is correct** — `entrypoint = "server.ts"`, `modules = ["nodejs-20"]`, `[[ports]]` with `externalPort = 80`, `deploymentTarget = "autoscale"`, Run/Deploy = `npm run start`.
257
+ 3. **Preview at `/`** — after `npm run start`, logs show `[TomorrowOS] listening on http://0.0.0.0:...` and Preview shows the Control Panel (HTML), not empty / API JSON.
258
+
259
+ If all three pass, tell the user setup is complete. **Do not** block on extra tests below.
270
260
 
271
261
  ### Preview requirements (Replit workspace)
272
262
 
@@ -300,11 +290,37 @@ Tell the user their live CMS URLs:
300
290
 
301
291
  Replace `YOUR-REPLIT-DOMAIN` with the actual published hostname (e.g. `my-cms.replit.app`).
302
292
 
303
- Verify after publish:
293
+ **Do not** run post-publish smoke tests unless the user reports a problem. Telling them the URL is enough.
294
+
295
+ ---
296
+
297
+ ## Post-Q&A: minimal verification only
298
+
299
+ After Questions 1–4, **configure → `npm install` → `npm run start` → done.**
300
+
301
+ ### Do (maximum)
302
+
303
+ 1. Confirm **Web app** artifact (not API) — **most important**.
304
+ 2. Write Secrets / `.env` / `brand.json` / `server.ts` / `.replit` from answers.
305
+ 3. `npm install` && `npm run start`.
306
+ 4. Glance at logs for `[TomorrowOS] listening on http://0.0.0.0:...`.
307
+ 5. Glance at Preview — Control Panel visible at `/`.
308
+
309
+ ### Do NOT run after setup (unless user asks or Publish fails)
310
+
311
+ - ❌ **Supabase connection test** (no `psql`, no DB ping, no “testing Supabase connection…”)
312
+ - ❌ **Cloudinary upload test**
313
+ - ❌ **`curl` / `fetch` on `/brand.json`** as a formal gate
314
+ - ❌ **Browser WebSocket console snippet** as a formal gate
315
+ - ❌ **Publishing dry-run** unless the user asked to publish now
316
+ - ❌ **Long troubleshooting loops** when Preview already shows the Control Panel
317
+ - ❌ Re-running the full **Publish readiness checklist** item-by-item in chat
304
318
 
305
- 1. `https://YOUR-REPLIT-DOMAIN/` shows the Control Panel (not empty, not API docs).
306
- 2. `https://YOUR-REPLIT-DOMAIN/brand.json` returns 200.
307
- 3. WebSocket to `wss://YOUR-REPLIT-DOMAIN/` succeeds.
319
+ If Preview shows the Control Panel and the project is **Web app** type, **stop testing** and give the user their URL and next steps.
320
+
321
+ ### Only if Preview is empty or Publish fails
322
+
323
+ Then (and only then) check: API vs Web type → `.replit` ports/`deploymentTarget` → stale process / port conflict → see **Failure recovery cheat sheet**.
308
324
 
309
325
  ---
310
326
 
@@ -383,6 +399,7 @@ DATABASE_SSL=true
383
399
  ```
384
400
 
385
401
  5. **Do not** write the real password into committed files.
402
+ 6. **Do not** test the Supabase connection after saving the Secret — configuration only.
386
403
 
387
404
  If the user refuses Supabase but chose > 5 screens, warn them SQLite on Replit is fragile for fleets, then offer SQLite only after they confirm.
388
405
 
@@ -546,8 +563,6 @@ CLOUDINARY_API_SECRET=...
546
563
 
547
564
  ### E. Install and run
548
565
 
549
- **Before starting:** stop stale processes, clear old background tasks, free the port if needed, restart workspace if stuck.
550
-
551
566
  ```bash
552
567
  npm install
553
568
  npm run start
@@ -555,30 +570,15 @@ npm run start
555
570
 
556
571
  (Use `npm run dev` only for local edit/watch. **Publish / Deploy / Replit Run must use `npm run start`.**)
557
572
 
558
- Confirm logs contain something like:
573
+ **Minimal check:** logs contain `[TomorrowOS] listening on http://0.0.0.0:...` and Preview shows Control Panel at `/`. Then proceed to **G** — no further tests.
559
574
 
560
- ```text
561
- [TomorrowOS] listening on http://0.0.0.0:<PORT>
562
- ```
575
+ ### F. Done — skip extended verification
563
576
 
564
- Confirm the **Web preview** (not Canvas) shows the Control Panel at `/`.
565
-
566
- ### F. Verify before telling the user “done”
567
-
568
- 1. Replit project type is **Web**; preview at `/` shows Control Panel (not empty, not Canvas-only).
569
- 2. Open the Control Panel URL.
570
- 3. `GET /brand.json` → 200 and correct `name` / colours.
571
- 4. In browser console on the Control Panel origin:
572
-
573
- ```javascript
574
- const ws = new WebSocket(location.origin.replace(/^http/, "ws") + "/");
575
- ws.onopen = () => console.log("WS OK");
576
- ws.onerror = (e) => console.log("WS ERR", e);
577
- ```
577
+ If the **three-item Publish readiness checklist** passes (especially **Web app, not API**), mark setup complete.
578
578
 
579
- 5. Confirm the **Publish readiness checklist** in **Runtime & Replit publish rules**.
579
+ **Do not** run WebSocket console tests, Supabase connection tests, or `brand.json` curl checks here.
580
580
 
581
- If WebSocket fails, fix Run command / process crash / sleep **before** asking the user to pair a TV.
581
+ Only investigate further if Preview is empty, server crashed, or user reports Publish failure.
582
582
 
583
583
  ### G. Tell the user next steps (no code)
584
584
 
@@ -617,6 +617,7 @@ Do **not**:
617
617
  - Serve a different app or API-only response at `/` instead of the Control Panel
618
618
  - Create the Repl as **API-only** or publish with **Static Deployment** only
619
619
  - Omit `[[ports]]` / `deploymentTarget` from `.replit` when setting up for Publish
620
+ - Run **Supabase connection tests**, **WebSocket console tests**, or other post-setup smoke tests unless Preview fails or the user asks
620
621
 
621
622
  ---
622
623
 
@@ -657,6 +658,6 @@ TOMORROWOS_STORE=sqlite
657
658
 
658
659
  ## Protocol version
659
660
 
660
- `replit-setup/1.2` — aligned with TomorrowOS protocol `1.0` and `@tomorrowos/sdk` store drivers `sqlite` | `supabase` | `postgres` | `memory`.
661
+ `replit-setup/1.3` — aligned with TomorrowOS protocol `1.0` and `@tomorrowos/sdk` store drivers `sqlite` | `supabase` | `postgres` | `memory`.
661
662
 
662
- **Changelog 1.2:** Web app deployability rules avoid `api-kind` publish failure; full `.replit` with `[[ports]]`, `deploymentTarget = "autoscale"`, `entrypoint = "server.ts"`.
663
+ **Changelog 1.3:** minimal post-Q&A verificationno Supabase/WS smoke tests; prioritize **Web app vs API** only.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomorrowos/sdk",
3
- "version": "0.7.9",
3
+ "version": "0.7.10",
4
4
  "description": "TomorrowOS CMS server SDK - WebSocket transport, pairing, device commands, optional static CMS UI. Includes CLI (tomorrowos init / build) and starter templates.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-cms",
3
- "version": "0.7.9",
3
+ "version": "0.7.10",
4
4
  "description": "CMS server on @tomorrowos/sdk. Add your UI (React, static files, etc.) alongside this server.",
5
5
  "private": true,
6
6
  "type": "module",
@@ -13,7 +13,7 @@
13
13
  "build-player": "tomorrowos build --platform tizen"
14
14
  },
15
15
  "dependencies": {
16
- "@tomorrowos/sdk": "^0.7.9",
16
+ "@tomorrowos/sdk": "^0.7.10",
17
17
  "dotenv": "^17.2.3",
18
18
  "tsx": "^4.19.0"
19
19
  },