@tomorrowos/sdk 0.7.7 → 0.7.8

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/LLM_PROMPT.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **This file is the contract between TomorrowOS and any LLM generating code using this package. You must follow it literally. Do not skip questions, do not infer answers, do not start writing code until the protocol is complete.**
4
4
 
5
- > **Replit Agent:** if the user is setting up a CMS on Replit (or pastes a prompt that mentions `REPLIT_SETUP.md`), follow **`REPLIT_SETUP.md`** instead of this file. That protocol covers SQLite vs Supabase by screen count, `SUPABASE_URL`, Cloudinary vs Object Storage, and `brand.json`.
5
+ > **Replit Agent:** if the user is setting up a CMS on Replit (or pastes a prompt that mentions `REPLIT_SETUP.md`), follow **`REPLIT_SETUP.md` only** not this file. Do **not** ask `LLM_PROMPT.md` questions (e.g. standalone “Which screen platform will you manage?”). Replit uses four questions: screen count optional Supabase media storage → brand (including platform and use case inside Question 4).
6
6
 
7
7
  You are generating a digital signage CMS using `@tomorrowos/sdk`. The user has asked you to build something like "a CMS for my restaurant" or "a signage dashboard for my retail network". Before you write any code, you must gather five pieces of information from the user.
8
8
 
package/REPLIT_SETUP.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  > **This file is a contract for Replit Agent / Replit AI.**
4
4
  > Follow it literally. Ask questions in order. Do not invent answers. Do not write or rewrite application logic until the Q&A is complete. Prefer configuring Secrets, `.env`, `brand.json`, and `server.ts` store wiring over inventing a custom CMS.
5
+ >
6
+ > **On Replit, this file is the ONLY questionnaire.** Do **not** use `LLM_PROMPT.md` questions.
5
7
 
6
8
  ## User trigger (copy-paste)
7
9
 
@@ -9,7 +11,8 @@ When a human pastes a prompt like this, **read this file and start Question 1 im
9
11
 
10
12
  ```text
11
13
  Follow @tomorrowos/sdk REPLIT_SETUP.md and set up my TomorrowOS CMS.
12
- Ask me the questions in order. Do not skip steps.
14
+ Ask only the questions listed in REPLIT_SETUP.md, in order. Do not use LLM_PROMPT.md.
15
+ Do not skip steps.
13
16
  ```
14
17
 
15
18
  Alternate triggers that also activate this protocol:
@@ -17,20 +20,66 @@ Alternate triggers that also activate this protocol:
17
20
  - “Set up TomorrowOS on Replit using REPLIT_SETUP.md”
18
21
  - “Configure my TomorrowOS CMS (Replit wizard)”
19
22
 
23
+ When any of these triggers fire, **ignore `LLM_PROMPT.md` entirely** for the Q&A phase.
24
+
25
+ ---
26
+
27
+ ## Questionnaire scope (STRICT — read before asking anything)
28
+
29
+ Replit Agent must ask **only** the questions defined in **this file**, in **this exact order**:
30
+
31
+ | Step | Section | When |
32
+ |------|---------|------|
33
+ | 1 | **Question 1** — How many screens / devices? | Always |
34
+ | 2 | **Question 2** — Supabase connection | Only if answer to Q1 is **> 5** |
35
+ | 3 | **Question 3** — Media storage (Cloudinary vs Object Storage) | Always (after Q1 or Q2) |
36
+ | 4 | **Question 4** — Brand / TomorrowOS app look | Always last, before execution |
37
+
38
+ **That is the complete list.** There are no other setup questions.
39
+
40
+ ### Forbidden questions (never ask on Replit setup)
41
+
42
+ Do **not** ask questions from `LLM_PROMPT.md` or improvise similar ones, including but not limited to:
43
+
44
+ - ❌ “Which screen platform will you manage? … Tizen … BrightSign …” as a **standalone first question**
45
+ - ❌ “What's the primary use case?” as a **standalone** question (use case is collected **inside Question 4** only)
46
+ - ❌ “Where will the CMS server run? … here / vercel / railway …” — on Replit, hosting is always **`here`**; set `cms.hostingTarget: "here"` without asking
47
+ - ❌ Separate “brand identity” interview before Question 4 (colours, logo, name belong in **Question 4** only)
48
+ - ❌ “How many screens?” asked **again** after Question 1 (you already have `cms.expectedScreens`)
49
+ - ❌ Any technical implementation question (WebSocket library, pairing format, etc.)
50
+
51
+ **Target platform (`tizen` / `brightsign`):** collect only as **item 8 inside Question 4**, not as its own step.
52
+
53
+ If the user volunteers extra info early (e.g. brand name before Q4), **record it** and still ask the current question’s required fields you do not yet have. Do not skip ahead to execution until Q1–Q4 (or Q1, Q3, Q4 if ≤5 screens) are complete.
54
+
55
+ If the user says “just set it up, don’t ask questions,” respond:
56
+
57
+ > I need four quick answers from REPLIT_SETUP.md (screen count, media storage, and branding). It takes about a minute and ensures the CMS deploys correctly on Replit.
58
+
59
+ Then ask **Question 1** — do not switch to `LLM_PROMPT.md`.
60
+
20
61
  ---
21
62
 
22
63
  ## Hard rules
23
64
 
24
- 1. **One question at a time.** Wait for the user’s answer before asking the next question (unless they already answered several in one message).
25
- 2. **Do not invent** screen counts, Cloudinary credentials, Supabase URLs, or brand colours.
26
- 3. **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.
27
- 4. **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.
28
- 5. **Never commit secrets** into git. Put credentials only in Replit **Secrets** (and optionally mirror non-secret flags in `.env` that reference env vars).
29
- 6. After Q&A, apply configuration, install deps, start the server, and verify:
65
+ 1. **Ask only REPLIT_SETUP.md questions 1–4** (see **Questionnaire scope**). Never use `LLM_PROMPT.md` on Replit.
66
+ 2. **One question at a time.** Wait for the user’s answer before asking the next question (unless they already answered several in one message).
67
+ 3. **Do not invent** screen counts, Cloudinary credentials, Supabase URLs, or brand colours.
68
+ 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.
69
+ 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.
70
+ 6. **Never commit secrets** into git. Put credentials only in Replit **Secrets** (and optionally mirror non-secret flags in `.env` that reference env vars).
71
+ 7. After Q&A, apply configuration, install deps, start the server, and verify:
30
72
  - HTTP Control Panel loads
31
73
  - `GET /brand.json` returns 200
32
74
  - WebSocket upgrade on `wss://<repl-host>/` succeeds (critical for TV pairing)
33
- 7. **Follow the Runtime & Replit publish rules below exactly.** A project that cannot Deploy / Publish on Replit is incomplete.
75
+ 8. **Follow the Runtime & Replit publish rules below exactly.** A project that cannot Deploy / Publish on Replit is incomplete.
76
+
77
+ **Question order after Q1:**
78
+
79
+ - If **≤ 5 screens:** Q1 → Q3 → Q4 → execution checklist
80
+ - If **> 5 screens:** Q1 → Q2 → Q3 → Q4 → execution checklist
81
+
82
+ Never insert extra questions between these steps.
34
83
 
35
84
  ---
36
85
 
@@ -70,7 +119,7 @@ Allowed extras (optional): `"build-player": "tomorrowos build --platform tizen"`
70
119
  "node": ">=20"
71
120
  },
72
121
  "dependencies": {
73
- "@tomorrowos/sdk": "^0.7.7",
122
+ "@tomorrowos/sdk": "^0.7.8",
74
123
  "dotenv": "^17.2.3",
75
124
  "tsx": "^4.19.0"
76
125
  },
@@ -168,7 +217,9 @@ Verify after publish:
168
217
 
169
218
  ## Question 1 — How many screens / devices?
170
219
 
171
- **Ask exactly:**
220
+ > **This is the first and only “screen count” question.** Do not re-ask later.
221
+
222
+ **Ask exactly (copy wording; do not substitute LLM_PROMPT questions):**
172
223
 
173
224
  > How many TomorrowOS screens (devices) do you expect to manage with this CMS?
174
225
  >
@@ -288,7 +339,9 @@ Tell the user:
288
339
 
289
340
  ## Question 4 — Brand / TomorrowOS app look
290
341
 
291
- **Ask exactly:**
342
+ > **This is the only branding / platform / use-case question block.** Do not ask separate LLM_PROMPT “target platform”, “use case”, or “hosting” questions before this.
343
+
344
+ **Ask exactly (one message; user may answer in one reply):**
292
345
 
293
346
  > Let’s brand your TomorrowOS experience. Please provide:
294
347
  >
@@ -332,7 +385,7 @@ If the user only gives a name and primary colour, use defaults for the rest and
332
385
  }
333
386
  ```
334
387
 
335
- Set `cms.expectedScreens` from Question 1. Set `cmsEndpoint` only if the user already knows their public `wss://…replit.app` URL; otherwise leave it out and tell them to pair TVs using the published HTTPS URL (player converts `https://` → `wss://`).
388
+ Set `cms.expectedScreens` from Question 1 (do not ask screen count again). Always set `cms.hostingTarget` to `"here"` on Replit without asking. Set `cmsEndpoint` only if the user already knows their public `wss://…replit.app` URL; otherwise leave it out and tell them to pair TVs using the published HTTPS URL (player converts `https://` → `wss://`).
336
389
 
337
390
  ---
338
391
 
@@ -453,6 +506,11 @@ If WebSocket fails, fix Run command / process crash / sleep **before** asking th
453
506
 
454
507
  ## What not to ask / change
455
508
 
509
+ ### Forbidden questionnaire sources
510
+
511
+ - **`LLM_PROMPT.md`** — not used on Replit setup; its five questions are **replaced** by REPLIT_SETUP Questions 1–4
512
+ - Standalone “target platform” / “hosting target” / “use case” prompts outside Question 4
513
+
456
514
  Do **not** ask the user how to implement:
457
515
 
458
516
  - WebSocket framing
@@ -509,4 +567,6 @@ TOMORROWOS_STORE=sqlite
509
567
 
510
568
  ## Protocol version
511
569
 
512
- `replit-setup/1.0` — aligned with TomorrowOS protocol `1.0` and `@tomorrowos/sdk` store drivers `sqlite` | `supabase` | `postgres` | `memory`.
570
+ `replit-setup/1.1` — aligned with TomorrowOS protocol `1.0` and `@tomorrowos/sdk` store drivers `sqlite` | `supabase` | `postgres` | `memory`.
571
+
572
+ **Changelog 1.1:** strict questionnaire scope; Replit must not use `LLM_PROMPT.md` questions (e.g. standalone target-platform prompt).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomorrowos/sdk",
3
- "version": "0.7.7",
3
+ "version": "0.7.8",
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.7",
3
+ "version": "0.7.8",
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.7",
16
+ "@tomorrowos/sdk": "^0.7.8",
17
17
  "dotenv": "^17.2.3",
18
18
  "tsx": "^4.19.0"
19
19
  },