@tomorrowos/sdk 0.9.23 → 0.9.25
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 +1 -1
- package/VERCEL_SETUP.md +47 -12
- package/package.json +1 -1
- package/templates/cms-starter/package.json +2 -2
package/README.md
CHANGED
|
@@ -72,7 +72,7 @@ IF any step contradicts Vercel, adapt to settings that Vercel can accept.
|
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
That wizard asks: database (**Supabase** → **Neon** → SQLite demo), media (**Cloudinary** → **Vercel Blob** → local),
|
|
75
|
-
branding (manual fields or **
|
|
75
|
+
branding (manual fields or **website URL → `brand.json` only**, no login unless asked). Preview may use a thin **Next.js reverse proxy**;
|
|
76
76
|
**Publish stays pure Node** `TomorrowOS.listen` (not Next). Cloudinary credentials are collected one-at-a-time
|
|
77
77
|
(cloud name → API key → API secret). Sets `cms.hostingTarget` to `"vercel"`.
|
|
78
78
|
|
package/VERCEL_SETUP.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
>
|
|
6
6
|
> **On Vercel, this file is the setup questionnaire** (not `REPLIT_SETUP.md`, not `LLM_PROMPT.md`).
|
|
7
7
|
>
|
|
8
|
-
> Protocol id: `vercel-setup/1.
|
|
8
|
+
> Protocol id: `vercel-setup/1.4` — pairs with `@tomorrowos/sdk` packages that ship `templates/cms-starter` and this file.
|
|
9
9
|
|
|
10
10
|
## User trigger (copy-paste)
|
|
11
11
|
|
|
@@ -14,9 +14,10 @@ When a human pastes a prompt like this, **read this file and start Question 1 im
|
|
|
14
14
|
```text
|
|
15
15
|
Follow @tomorrowos/sdk VERCEL_SETUP.md and set up my TomorrowOS CMS.
|
|
16
16
|
Ask only the questions listed in VERCEL_SETUP.md, in order. Do not use LLM_PROMPT.md or REPLIT_SETUP.md.
|
|
17
|
+
Do not ask for OpenAI / Anthropic / any LLM API keys — TomorrowOS CMS setup does not require them.
|
|
17
18
|
If any step contradicts Vercel, adapt to settings Vercel can accept (document the adaptation).
|
|
18
19
|
After all setup questions are answered (including Cloudinary or Vercel Blob Env Vars if you chose those), configure and deploy — minimal verification only (Control Panel at /). Prefer Supabase Session pooler URL or Neon pooled URL. Do not treat sandbox ENETUNREACH / IPv6 :5432 errors as a hard setup failure when a pooler URL is configured for production.
|
|
19
|
-
Question 3 only updates brand.json. Do not skip steps.
|
|
20
|
+
Question 3 only updates brand.json from colours/logo/name (a website URL is brand reference only — do not add CMS login/auth unless the user explicitly asks). Do not skip steps.
|
|
20
21
|
Use Next.js only as a v0/Preview shell with a reverse proxy; Production Publish must remain pure Node TomorrowOS.listen (not Next).
|
|
21
22
|
```
|
|
22
23
|
|
|
@@ -82,6 +83,16 @@ Ask **only** these questions, in **this exact order**:
|
|
|
82
83
|
|
|
83
84
|
**That is the complete list.** Do **not** ask how many screens / devices.
|
|
84
85
|
|
|
86
|
+
**Forbidden extra questions (never ask, even if the user skips a step):**
|
|
87
|
+
|
|
88
|
+
- ❌ OpenAI / Anthropic / Gemini / any LLM API key (`sk-…`, etc.)
|
|
89
|
+
- ❌ “AI pairing”, “AI feature logic”, or inventing auth that needs an LLM key
|
|
90
|
+
- ❌ Any secret not listed in Questions 1–3 (DB URL, media credentials, brand)
|
|
91
|
+
|
|
92
|
+
TomorrowOS pairing and Control Panel logic live in `@tomorrowos/sdk`. They do **not** call OpenAI.
|
|
93
|
+
|
|
94
|
+
If the user **skips** a Question 2 option, do **not** invent a substitute question. Re-state Question 2 choices, or proceed with a documented default (e.g. local uploads with a warning) — never pivot to LLM keys.
|
|
95
|
+
|
|
85
96
|
If the user says “just set it up, don’t ask questions,” respond:
|
|
86
97
|
|
|
87
98
|
> I need a few quick answers from VERCEL_SETUP.md (database — Supabase or Neon preferred — media storage, and branding). It takes about a minute and ensures the CMS works on Vercel.
|
|
@@ -92,9 +103,9 @@ Then ask **Question 1**.
|
|
|
92
103
|
|
|
93
104
|
## Hard rules
|
|
94
105
|
|
|
95
|
-
1. **Ask only VERCEL_SETUP.md questions 1–3.** Never use `LLM_PROMPT.md` or `REPLIT_SETUP.md` as the questionnaire.
|
|
106
|
+
1. **Ask only VERCEL_SETUP.md questions 1–3.** Never use `LLM_PROMPT.md` or `REPLIT_SETUP.md` as the questionnaire. **Never** ask for OpenAI or other LLM API keys.
|
|
96
107
|
2. **One question / one credential at a time.** For Cloudinary: ask **cloud name**, then **API key alone**, then **API secret alone** — never one message that mixes key + secret.
|
|
97
|
-
3. **Do not invent** Cloudinary credentials, database URLs, Vercel Blob tokens, or
|
|
108
|
+
3. **Do not invent** Cloudinary credentials, database URLs, Vercel Blob tokens, brand colours, **or LLM API keys**.
|
|
98
109
|
4. **Postgres env naming:** prefer **`SUPABASE_URL`** when using Supabase; prefer **`DATABASE_URL`** (or `NEON_DATABASE_URL`) when using Neon. `createTomorrowOSStore` accepts `SUPABASE_URL` then `DATABASE_URL`.
|
|
99
110
|
5. **Always prefer pooled connection strings** (Supabase Session pooler port **6543**; Neon pooled host). Direct `:5432` URLs commonly fail on Vercel/sandbox with **`ENETUNREACH`** (often IPv6).
|
|
100
111
|
6. **Prefer `npx @tomorrowos/sdk init`** (or `templates/cms-starter`) as the seed. Do not rebuild pairing / WebSocket / playlist APIs.
|
|
@@ -105,6 +116,8 @@ Then ask **Question 1**.
|
|
|
105
116
|
11. **Production:** export the HTTP server Vercel can capture: `const server = tomorrowos.listen(...); export default server;` (or equivalent). **Do not** make `next start` the Production entrypoint.
|
|
106
117
|
12. **Preview:** if the environment is v0 / Next-hardwired, install the Next reverse-proxy shell (see **Preview adapter**). Do not leave Preview broken.
|
|
107
118
|
13. After Q&A: **configure → install → run/deploy → minimal verify** (Control Panel at `/`). Do not run a long test suite.
|
|
119
|
+
14. **No inventing CMS login.** A branding URL never means “build auth.” Only add login if the user **explicitly** requests it.
|
|
120
|
+
15. **Skip ≠ invent.** If the user skips media choice or a credential, do not replace it with OpenAI/auth/login questions. Stay on Q1–Q3 only.
|
|
108
121
|
|
|
109
122
|
**Question order:** Q1 → Q2 → Q3 → execution checklist.
|
|
110
123
|
|
|
@@ -361,6 +374,9 @@ Only proceed after the user explicitly confirms.
|
|
|
361
374
|
|
|
362
375
|
## Question 2 — Media storage
|
|
363
376
|
|
|
377
|
+
> **This question is only about media files (images/videos).**
|
|
378
|
+
> It is **not** about OpenAI, AI pairing, or LLM keys. If you are about to ask for an `sk-` key, **stop** — you are off-protocol.
|
|
379
|
+
|
|
364
380
|
### Step A — Ask storage choice
|
|
365
381
|
|
|
366
382
|
**Ask exactly:**
|
|
@@ -458,6 +474,11 @@ import { put } from "@vercel/blob";
|
|
|
458
474
|
## Question 3 — Brand (`brand.json` only)
|
|
459
475
|
|
|
460
476
|
> Updates **only** `brand.json`. Does **not** change Vercel project settings, Env Vars, or `server.ts` store wiring beyond what Q1–Q2 already required.
|
|
477
|
+
>
|
|
478
|
+
> **IRON RULE — website URL ≠ build a website / login / auth CMS.**
|
|
479
|
+
> If the user pastes a URL (or says “make it look like this site”), that input is **reference material for `brand.json` only** (name, colours, fonts, logo, tagline).
|
|
480
|
+
> **Do not** scaffold a login page, signup, OAuth, gated dashboard, or copy the reference site’s IA/pages — **unless the user explicitly asks for CMS login / auth**.
|
|
481
|
+
> Default TomorrowOS Control Panel has **no login**. Keep it that way.
|
|
461
482
|
|
|
462
483
|
### Step A — Ask branding input
|
|
463
484
|
|
|
@@ -465,8 +486,9 @@ import { put } from "@vercel/blob";
|
|
|
465
486
|
|
|
466
487
|
> Let’s brand your TomorrowOS experience. You can answer in either way:
|
|
467
488
|
>
|
|
468
|
-
> **Option A — Website URL only**
|
|
469
|
-
> Paste **one public website URL
|
|
489
|
+
> **Option A — Website URL only (brand reference)**
|
|
490
|
+
> Paste **one public website URL**. I will use it **only** to infer colours, fonts, name, tagline, and logo for **`brand.json`**.
|
|
491
|
+
> I will **not** rebuild that website, add a login page, or change Control Panel features — unless you explicitly ask for login/auth later.
|
|
470
492
|
>
|
|
471
493
|
> **Option B — Manual fields**
|
|
472
494
|
> Provide:
|
|
@@ -483,7 +505,8 @@ import { put } from "@vercel/blob";
|
|
|
483
505
|
**You must:**
|
|
484
506
|
|
|
485
507
|
1. **Fetch and inspect** the page (HTTP GET the URL; follow one redirect if needed). Do not invent colours.
|
|
486
|
-
2. **
|
|
508
|
+
2. **Write / update `brand.json` only** from what you infer. Touch nothing else for this step (no new pages, no auth, no Next marketing site, no login UI).
|
|
509
|
+
3. **Derive branding** using this priority order:
|
|
487
510
|
- **Name:** `<title>`, `og:site_name`, or prominent header / logo `alt` text (trim to ≤ 60 chars).
|
|
488
511
|
- **Tagline:** `meta[name="description"]`, `og:description`, or first hero subtitle (≤ 120 chars).
|
|
489
512
|
- **Primary colour:** `meta[name="theme-color"]`, CSS `--primary` / `--brand` variables, or dominant accent from linked stylesheets / inline styles (convert to `#RRGGBB`).
|
|
@@ -492,10 +515,20 @@ import { put } from "@vercel/blob";
|
|
|
492
515
|
- **Secondary colour:** muted border / secondary button colour, or a tint of the primary.
|
|
493
516
|
- **Font:** first `font-family` on `body` (strip quotes; default `Inter` if generic system stack).
|
|
494
517
|
- **Logo:** prefer `og:image`, then `link[rel="icon"]` / apple-touch-icon, then header `<img>` logo. Download into `./assets/logo.png` or `./assets/logo.svg` and set `logoPath` accordingly. If only favicon exists, use it and note size in the summary.
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
518
|
+
4. **Contrast check:** if background is dark, set `activationScreen.theme` to `"dark"` and add `logoPathOnDark` when a light logo variant exists.
|
|
519
|
+
5. **Infer `cms.useCase`** from page content when obvious (restaurant / retail / corporate / etc.); otherwise `"other"`.
|
|
520
|
+
6. **Show a one-line summary** to the user (name + primary hex + logo path) before or while writing the file — do not ask a second branding question unless fetch failed.
|
|
521
|
+
7. If the URL is unreachable, blocked, or has no usable styles, say so and fall back to **Option B** manual questions for missing fields only.
|
|
522
|
+
|
|
523
|
+
**Explicitly forbidden when the user only gave a URL (no login request):**
|
|
524
|
+
|
|
525
|
+
- ❌ Login / signup / “Sign in to continue” screens
|
|
526
|
+
- ❌ Auth middleware, sessions, cookies, OAuth, password forms
|
|
527
|
+
- ❌ Cloning the reference site as a marketing landing or multi-page CMS
|
|
528
|
+
- ❌ Gating the Control Panel behind authentication
|
|
529
|
+
- ❌ Treating “make it like this site” as “rebuild this site”
|
|
530
|
+
|
|
531
|
+
If the reference site itself is a login page, **still only extract visual brand tokens** (colours/logo/name) into `brand.json` — do **not** recreate that login flow.
|
|
499
532
|
|
|
500
533
|
### Step C — Write `brand.json`
|
|
501
534
|
|
|
@@ -631,6 +664,8 @@ Tell the user:
|
|
|
631
664
|
| Secrets in git | Mistake | Rotate keys; move to Vercel Env Vars |
|
|
632
665
|
| Replit files present | Copied wrong protocol | Delete `.replit*`; use this file |
|
|
633
666
|
| Brand colours wrong from URL | SPA / blocked fetch | Manual Option B for colours + logo |
|
|
667
|
+
| Agent asked for OpenAI / `sk-` key during setup | Hallucinated “AI pairing” requirement | **Refuse.** TomorrowOS does not need LLM keys. Return to Q2 media choices only |
|
|
668
|
+
| Agent built a login page after user pasted a URL | Misread brand reference as product scope | Remove login; keep starter Control Panel; apply URL only to `brand.json` |
|
|
634
669
|
|
|
635
670
|
---
|
|
636
671
|
|
|
@@ -645,7 +680,7 @@ Tell the user:
|
|
|
645
680
|
| Media | Cloudinary or Replit Object Storage | Cloudinary **or Vercel Blob** |
|
|
646
681
|
| Preview | Replit Preview / Autoscale Node | **Next shell + proxy** when v0 hardwires Next |
|
|
647
682
|
| Publish | Long-lived Node | **Node `TomorrowOS.listen` only** (not Next) |
|
|
648
|
-
| Brand from URL | Not in Replit protocol | **Option A**
|
|
683
|
+
| Brand from URL | Not in Replit protocol | **Option A** — infer **`brand.json` only**; never invent login |
|
|
649
684
|
|
|
650
685
|
---
|
|
651
686
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomorrowos/sdk",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.25",
|
|
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.
|
|
3
|
+
"version": "0.9.25",
|
|
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.
|
|
16
|
+
"@tomorrowos/sdk": "^0.9.25",
|
|
17
17
|
"dotenv": "^17.2.3",
|
|
18
18
|
"tsx": "^4.19.0"
|
|
19
19
|
},
|