@tomorrowos/sdk 0.9.59 → 0.9.60

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
@@ -98,9 +98,9 @@ Supported hosts: **Replit** and **Vercel / v0**.
98
98
  1. Follow the host setup doc for this request (`REPLIT_SETUP.md` / `REPLIT_UPGRADE.md`, or `VERCEL_SETUP.md` + `VERCEL_QUESTIONS.md`).
99
99
  2. On Vercel: paste Q1–Q3 **verbatim** from `VERCEL_QUESTIONS.md`; after database choice set `TOMORROWOS_STORE` and `DATABASE_SSL` yourself; after media choice set `TOMORROWOS_MEDIA` yourself.
100
100
  3. Read `brand.schema.json` for the validated shape of `brand.json`.
101
- 4. Scaffold with the correct template:
102
- - Replit / self-host style: `npx @tomorrowos/sdk init` (default `cms-starter`)
103
- - Vercel / v0: `npx @tomorrowos/sdk init . --hosting v0 --force` (`cms-starter-v0`)
101
+ 4. Scaffold with the correct template (**always `@latest`**):
102
+ - Replit / self-host style: `npx @tomorrowos/sdk@latest init .` (default `cms-starter`)
103
+ - Vercel / v0: `npx @tomorrowos/sdk@latest init . --hosting v0 --force` (`cms-starter-v0`)
104
104
  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`.
105
105
  6. Point the user at `PLAYER_INSTALL.md` and the Control Panel **Download Players** UI once the CMS is running.
106
106
 
@@ -115,17 +115,17 @@ Do not write WebSocket transport, pairing wire format, or platform-specific play
115
115
  ## 2. Build it yourself
116
116
 
117
117
  ```bash
118
- npm install @tomorrowos/sdk
118
+ npm install @tomorrowos/sdk@latest
119
119
  ```
120
120
 
121
121
  Scaffold, install, run:
122
122
 
123
123
  ```bash
124
124
  # Default template (good for Replit, Railway, Render, Fly.io, self-host)
125
- npx tomorrowos init my-cms
125
+ npx @tomorrowos/sdk@latest init my-cms
126
126
 
127
127
  # Vercel / v0 Publish (cms-panel + vercel.json + optional Next preview)
128
- npx tomorrowos init my-cms --hosting v0
128
+ npx @tomorrowos/sdk@latest init my-cms --hosting v0
129
129
 
130
130
  cd my-cms
131
131
  npm install
package/REPLIT_SETUP.md CHANGED
@@ -18,6 +18,7 @@ If Supabase: show the SUPABASE_URL Secrets input immediately after the choice (s
18
18
  If Cloudinary: show all CLOUDINARY_* Secrets inputs immediately after the choice (same Question 2 — one multi-field dialog).
19
19
  Question 3: one multi-field dialog with all seven branding inputs stacked (all optional; blanks keep brand.json defaults). Never ask branding fields one-by-one with Next.
20
20
  After all setup questions are answered, configure and start — minimal verification only (Web app type + Preview at /). **Never test database connection** in Preview — configure and move on. No DB or WebSocket tests.
21
+ Seed with **`npx @tomorrowos/sdk@latest init .`** only (never untagged `npx @tomorrowos/sdk init` — that can install a stale cached version).
21
22
  Do not skip steps.
22
23
  ```
23
24
 
@@ -108,7 +109,7 @@ Then ask **Question 1** — stay on this file.
108
109
  4a. **If Supabase is chosen: never collect `SUPABASE_URL` twice.** One capture right after the choice is enough.
109
110
  4b. **Question 3 fields are all optional.** Missing values → keep starter `brand.json` defaults; do not block or re-prompt.
110
111
  4c. **`TOMORROWOS_STORE` + `DATABASE_SSL` are agent-owned.** After the Q1 choice (and URL if needed), set them yourself. Never ask the user to type those names/values.
111
- 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.
112
+ 5. **Always seed with `npx @tomorrowos/sdk@latest init .`** (or merge `templates/cms-starter` from that same `@latest` install). **Never** run untagged `npx @tomorrowos/sdk init` — npx may reuse a stale cache and pin an old SDK. Do not rebuild pairing, WebSocket, or playlist APIs from scratch.
112
113
  6. **Never commit secrets** into git. Put credentials only in Replit **Secrets** (and optionally mirror non-secret flags in `.env` that reference env vars).
113
114
  7. After Q&A, **configure and start** — do **not** run a long test suite (see **Post-Q&A: minimal verification only**).
114
115
  8. **Follow the Runtime & Replit publish rules below exactly.** A project that cannot Deploy / Publish on Replit is incomplete.
@@ -136,7 +137,7 @@ When scaffolding a **new** Repl:
136
137
  1. On the Replit homepage, open the artifact-type dropdown and choose **Web app** (not API, not “Backend only”, not Agent & Automation-only).
137
138
  2. **Do not** create an “API server” artifact as the only publishable output.
138
139
  3. Describe the project as: *“TomorrowOS digital signage CMS — web Control Panel at `/` with WebSocket device pairing.”*
139
- 4. Run `npx @tomorrowos/sdk init` at the project root (or merge the cms-starter template).
140
+ 4. Run `npx @tomorrowos/sdk@latest init .` at the project root (or merge the cms-starter template from that install).
140
141
 
141
142
  **Forbidden setups that cause publish failure:**
142
143
 
@@ -255,7 +256,7 @@ Allowed extras (optional): `"build-player": "tomorrowos build --platform tizen"`
255
256
  "node": ">=20"
256
257
  },
257
258
  "dependencies": {
258
- "@tomorrowos/sdk": "^0.9.12",
259
+ "@tomorrowos/sdk": "^0.9.60",
259
260
  "dotenv": "^17.2.3",
260
261
  "tsx": "^4.19.0"
261
262
  },
@@ -270,7 +271,7 @@ Allowed extras (optional): `"build-player": "tomorrowos build --platform tizen"`
270
271
  }
271
272
  ```
272
273
 
273
- Bump `@tomorrowos/sdk` to the latest published version when scaffolding.
274
+ **IRON RULE — always latest SDK:** Scaffold only via `npx @tomorrowos/sdk@latest init .`. After init, confirm `node_modules/@tomorrowos/sdk/package.json` `"version"` matches current npm `latest` (or newer). If older, run `npm install @tomorrowos/sdk@latest` and fix `package.json` to `^<that version>`.
274
275
 
275
276
  ### Replit Run command
276
277
 
@@ -671,11 +672,21 @@ Run these steps in order. Tick mentally; do not skip.
671
672
  **If creating a new Repl:** choose **Web app** on the Replit homepage before `init`. Confirm `.replit-artifact/artifact.toml` has **`kind = "web"`** after init.
672
673
 
673
674
  ```bash
675
+ # REQUIRED: @latest — untagged `npx @tomorrowos/sdk init` can install a stale cached SDK.
674
676
  npx @tomorrowos/sdk@latest init .
675
677
  # If the directory is not empty and the user confirms overwrite of starter files only:
676
678
  # npx @tomorrowos/sdk@latest init . --force
677
679
  ```
678
680
 
681
+ Then verify:
682
+
683
+ ```bash
684
+ node -p "require('./node_modules/@tomorrowos/sdk/package.json').version"
685
+ # or: npm ls @tomorrowos/sdk --depth=0
686
+ ```
687
+
688
+ If not the current npm latest, run `npm install @tomorrowos/sdk@latest` before continuing.
689
+
679
690
  If `init` is inappropriate (existing customised project), merge carefully:
680
691
 
681
692
  - Keep `data/tomorrowos.db` and `public/uploads/`
@@ -775,6 +786,7 @@ Do **not** ask the user how to implement:
775
786
 
776
787
  Do **not**:
777
788
 
789
+ - Run untagged `npx @tomorrowos/sdk init` (always use `npx @tomorrowos/sdk@latest init .`)
778
790
  - Replace `@tomorrowos/sdk` with a hand-rolled server
779
791
  - Change the production start command away from `tsx server.ts` / `npm run start`
780
792
  - Point Supabase at Replit’s reserved `DATABASE_URL` when `SUPABASE_URL` should be used
@@ -823,7 +835,9 @@ Do **not**:
823
835
 
824
836
  ## Protocol version
825
837
 
826
- `replit-setup/1.12` — aligned with TomorrowOS protocol `1.0` and `@tomorrowos/sdk` store drivers `sqlite` | `supabase` | `postgres` | `memory`.
838
+ `replit-setup/1.13` — aligned with TomorrowOS protocol `1.0` and `@tomorrowos/sdk` store drivers `sqlite` | `supabase` | `postgres` | `memory`.
839
+
840
+ **Changelog 1.13:** Seed / upgrade commands **must** use `@latest` (`npx @tomorrowos/sdk@latest init .`, `npm install @tomorrowos/sdk@latest`). Untagged `npx @tomorrowos/sdk init` is forbidden (stale npx cache pinned old SDKs such as 0.9.51).
827
841
 
828
842
  **Changelog 1.12:** Q1 no longer offers SQLite (Supabase or Replit Postgres only). Q2 no longer offers local disk (Cloudinary or Replit Object Storage only).
829
843
 
package/REPLIT_UPGRADE.md CHANGED
@@ -32,7 +32,7 @@ When any of these triggers fire:
32
32
 
33
33
  ## Hard rules (non-negotiable)
34
34
 
35
- 1. **Do NOT** run `npx @tomorrowos/sdk init` or `npx @tomorrowos/sdk init --force` (or any command that re-scaffolds / overwrites the project from the starter). That would wipe customisations.
35
+ 1. **Do NOT** run `npx @tomorrowos/sdk init`, `npx @tomorrowos/sdk@latest init`, or any `init --force` (or any command that re-scaffolds / overwrites the project from the starter). That would wipe customisations. Upgrade = **`npm install @tomorrowos/sdk@latest` only**.
36
36
  2. **Do NOT** delete `data/` or `public/uploads/` (or move them aside permanently). Pairings, playlists, and local media must survive the upgrade.
37
37
  3. **Do NOT** invent or rotate Secrets (`SUPABASE_URL`, Cloudinary keys, etc.). Keep existing Secrets / `.env`.
38
38
  4. **Do NOT** blindly overwrite `public/methods.js`, `public/index.html`, `public/panel.css`, or `server.ts` with template copies. Always **diff → report → merge only with user consent** (or apply surgical patches that preserve custom code).
@@ -79,10 +79,14 @@ Record the **backup path** for the final report.
79
79
 
80
80
  ### 3. Install latest SDK
81
81
 
82
+ **REQUIRED — always `@latest`:**
83
+
82
84
  ```bash
83
85
  npm install @tomorrowos/sdk@latest
84
86
  ```
85
87
 
88
+ Do **not** run `npm install @tomorrowos/sdk` without `@latest` (may keep a stale lockfile / range).
89
+
86
90
  ### 4. Verify `package.json` dependency
87
91
 
88
92
  Confirm `dependencies["@tomorrowos/sdk"]` reflects a newer / latest range (or exact version after install).
@@ -90,10 +94,17 @@ Confirm `dependencies["@tomorrowos/sdk"]` reflects a newer / latest range (or ex
90
94
  - If `package.json` did not update, set `"@tomorrowos/sdk": "^<installed version>"` (or `@latest` resolution result) and run:
91
95
 
92
96
  ```bash
93
- npm install
97
+ npm install @tomorrowos/sdk@latest
98
+ ```
99
+
100
+ - Confirm `node_modules/@tomorrowos/sdk/package.json` `"version"` is the **current npm latest** (not an older pin such as 0.9.51).
101
+
102
+ ```bash
103
+ node -p "require('./node_modules/@tomorrowos/sdk/package.json').version"
104
+ npm view @tomorrowos/sdk version
94
105
  ```
95
106
 
96
- - Confirm `node_modules/@tomorrowos/sdk/package.json` `"version"` is the **new** version.
107
+ If local version < npm latest, re-run Step 3 until they match.
97
108
 
98
109
  Record **new SDK version** for the final report.
99
110
 
@@ -176,7 +187,7 @@ Tell the user clearly:
176
187
 
177
188
  ## What not to do
178
189
 
179
- - ❌ `npx @tomorrowos/sdk init` / `init --force`
190
+ - ❌ `npx @tomorrowos/sdk init` / `npx @tomorrowos/sdk@latest init` / `init --force` (upgrade must not re-scaffold)
180
191
  - ❌ Delete or empty `data/`, `public/uploads/`, or SQLite DB files
181
192
  - ❌ Blind overwrite of customised panel / `server.ts`
182
193
  - ❌ Re-run full `REPLIT_SETUP.md` questionnaire during upgrade
@@ -200,6 +211,8 @@ Tell the user clearly:
200
211
 
201
212
  ## Protocol version
202
213
 
203
- `replit-upgrade/1.0` — pairs with `@tomorrowos/sdk` packages that ship `templates/cms-starter` and this file.
214
+ `replit-upgrade/1.1` — pairs with `@tomorrowos/sdk` packages that ship `templates/cms-starter` and this file.
215
+
216
+ **Changelog 1.1:** Emphasize **`npm install @tomorrowos/sdk@latest` only**; verify against `npm view @tomorrowos/sdk version`; forbid untagged installs that leave stale pins (e.g. 0.9.51).
204
217
 
205
218
  **Changelog 1.0:** Initial upgrade-only Agent contract: install `@latest`, backup, template diff/merge (no init, no data wipe), restart, report versions + smoke.
package/VERCEL_SETUP.md CHANGED
@@ -39,7 +39,7 @@ Open VERCEL_QUESTIONS.md first.
39
39
  For Q1, Q2, Q3: paste each question block VERBATIM. Do not rephrase options.
40
40
  After Q1 database choice, YOU set TOMORROWOS_STORE and DATABASE_SSL. Do not ask me to fill those.
41
41
  After Q2 media storage choice, YOU set TOMORROWOS_MEDIA. Do not ask me to fill those.
42
- Run: npx @tomorrowos/sdk@0.9.58 init . --hosting v0 --force
42
+ Run: npx @tomorrowos/sdk@latest init . --hosting v0 --force
43
43
  Keep cms-starter-v0 layout.
44
44
  Apply the NON-NEGOTIABLE VERCEL RUNTIME CONTRACT exactly:
45
45
  one TomorrowOS instance only
@@ -206,7 +206,7 @@ Then ask **Question 1**.
206
206
  5. **Do not invent** Cloudinary credentials, database URLs, Vercel Blob tokens, brand colours, **or LLM API keys**.
207
207
  6. **Postgres env naming:** prefer **`SUPABASE_URL`** for Supabase; prefer **`DATABASE_URL`** for Neon.
208
208
  7. **Always prefer pooled connection strings** (Supabase Session pooler **6543**; Neon pooled host).
209
- 8. **Prefer `npx @tomorrowos/sdk init --hosting v0`**. For Replit/Railway use default `init`. Do not rebuild pairing / WebSocket APIs.
209
+ 8. **Prefer `npx @tomorrowos/sdk@latest init --hosting v0`**. For Replit/Railway use `npx @tomorrowos/sdk@latest init .`. Do not rebuild pairing / WebSocket APIs. Untagged `npx @tomorrowos/sdk init` is forbidden (stale cache).
210
210
  9. **Never commit secrets.** Use Vercel Environment Variables.
211
211
  10. **Skip Replit-only files.**
212
212
  11. **SQLite is not a production store on Vercel.**
@@ -225,7 +225,7 @@ Then ask **Question 1**.
225
225
  ## Scheme A ??Vercel Functions + WebSockets (mandatory for Production)
226
226
 
227
227
  > **Goal:** Preview may use Next + proxy; **Publish** runs TomorrowOS as a **Vercel Function** (`api/index.ts`) on **Fluid**, with WebSocket support per [Vercel WebSockets docs](https://vercel.com/docs/functions/websockets).
228
- > **Scope:** Layout + `vercel.json` + dashboard. Prefer `npx @tomorrowos/sdk init --hosting v0` (`cms-starter-v0`).
228
+ > **Scope:** Layout + `vercel.json` + dashboard. Prefer `npx @tomorrowos/sdk@latest init --hosting v0` (`cms-starter-v0`).
229
229
  > **Do not** break Replit/Railway: those keep using default `init` ??`cms-starter` (root `server.ts` + `server.listen`, no `api/`).
230
230
 
231
231
  ### Why Scheme A exists
package/dist/cli.js CHANGED
@@ -201,10 +201,10 @@ Options:
201
201
  --force With init: copy into a non-empty directory
202
202
 
203
203
  Examples:
204
- npx @tomorrowos/sdk init
205
- npx @tomorrowos/sdk init ./my-cms --hosting replit
206
- npx @tomorrowos/sdk init ./my-cms --hosting v0
207
- npx @tomorrowos/sdk migrate --from sqlite --from-sqlite ./data/tomorrowos.db --to supabase --to-database-url "$DATABASE_URL"
204
+ npx @tomorrowos/sdk@latest init .
205
+ npx @tomorrowos/sdk@latest init ./my-cms --hosting replit
206
+ npx @tomorrowos/sdk@latest init ./my-cms --hosting v0
207
+ npx @tomorrowos/sdk@latest migrate --from sqlite --from-sqlite ./data/tomorrowos.db --to supabase --to-database-url "$DATABASE_URL"
208
208
  `);
209
209
  }
210
210
  function printMigrateHelp() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomorrowos/sdk",
3
- "version": "0.9.59",
3
+ "version": "0.9.60",
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.9.59",
3
+ "version": "0.9.60",
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.9.59",
16
+ "@tomorrowos/sdk": "^0.9.60",
17
17
  "dotenv": "^17.2.3",
18
18
  "tsx": "^4.19.0"
19
19
  },
@@ -22,4 +22,3 @@
22
22
  "typescript": "^5.5.0"
23
23
  }
24
24
  }
25
-
@@ -13,7 +13,7 @@ This starter is for **Vercel Publish** and **v0**. It follows
13
13
  ## Scaffold
14
14
 
15
15
  ```bash
16
- npx @tomorrowos/sdk init my-cms --hosting v0
16
+ npx @tomorrowos/sdk@latest init my-cms --hosting v0
17
17
  ```
18
18
 
19
19
  ## Local development
@@ -46,5 +46,5 @@ TV endpoint: `https://YOUR.vercel.app/` (players also try `/api` on `*.vercel.ap
46
46
  Use the default starter (unchanged Node listen, no `api/` Function):
47
47
 
48
48
  ```bash
49
- npx @tomorrowos/sdk init my-cms --hosting replit
49
+ npx @tomorrowos/sdk@latest init my-cms --hosting replit
50
50
  ```
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-cms",
3
- "version": "0.9.59",
3
+ "version": "0.9.60",
4
4
  "description": "TomorrowOS CMS for Vercel / v0 Publish (Fluid Function + WebSockets + optional Next Preview).",
5
5
  "private": true,
6
6
  "type": "module",
@@ -17,7 +17,7 @@
17
17
  "build-player": "tomorrowos build --platform tizen"
18
18
  },
19
19
  "dependencies": {
20
- "@tomorrowos/sdk": "^0.9.59",
20
+ "@tomorrowos/sdk": "^0.9.60",
21
21
  "dotenv": "^17.2.3",
22
22
  "tsx": "^4.19.0"
23
23
  },