robodev 0.46.0 → 0.47.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "robodev",
3
- "version": "0.46.0",
3
+ "version": "0.47.1",
4
4
  "description": "CLI for Robodev Starbase — create, auth, link, deploy, load, and run a project locally with robodev dev",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -149,6 +149,7 @@ test("collectFiles for empty starter includes hosted Welcome source", async () =
149
149
  assert.ok(paths.has("robodev/api/health.ts"));
150
150
  assert.ok(paths.has("index.html"));
151
151
  assert.ok(paths.has("src/main.tsx"));
152
+ assert.ok(paths.has("ROBODEV.md"));
152
153
  assert.ok(!paths.has("robodev/api/planets.ts"));
153
154
  assert.ok([...paths].every((path) => !path.startsWith("apps/")));
154
155
  assert.ok(files.length < 200);
@@ -167,9 +168,19 @@ test("emitStarter shadcn includes hosted Welcome plus orval and shadcn files", a
167
168
  assert.match(index, /<title>Kit<\/title>/);
168
169
  assert.match(index, /src\/main\.tsx/);
169
170
  const app = await readFile(join(dest, "src/App.tsx"), "utf8");
170
- assert.match(app, /<h1>Welcome<\/h1>/);
171
+ assert.match(app, /<Route path="\/" element=\{<Home \/>\} \/>/);
171
172
  assert.doesNotMatch(app, /<h1>Kit<\/h1>/);
172
- assert.match(app, /getHealth/);
173
+ assert.doesNotMatch(app, /<h1>Welcome<\/h1>/);
174
+ const home = await readFile(join(dest, "src/pages/Home.tsx"), "utf8");
175
+ assert.match(home, /<h1>Welcome<\/h1>/);
176
+ assert.match(home, /getHealth/);
177
+ const main = await readFile(join(dest, "src/main.tsx"), "utf8");
178
+ assert.match(main, /BrowserRouter/);
179
+ const notes = await readFile(join(dest, "ROBODEV.md"), "utf8");
180
+ assert.match(notes, /react-router-dom/);
181
+ assert.match(notes, /src\/pages\/Home\.tsx/);
182
+ assert.match(notes, /robodev-email templates list/);
183
+ assert.match(notes, /Do not write `robodev\/emails\/\*\.html`/);
173
184
  const endpoints = await readFile(join(dest, "src/api/generated/endpoints.ts"), "utf8");
174
185
  assert.match(endpoints, /export const getHealth/);
175
186
  assert.doesNotMatch(endpoints, /axios|@tanstack\/react-query/);
@@ -184,6 +195,7 @@ test("emitStarter shadcn includes hosted Welcome plus orval and shadcn files", a
184
195
  assert.equal(pkg.scripts?.["dev:fe"], "vite");
185
196
  assert.equal(pkg.scripts?.["generate:api"], "orval");
186
197
  assert.equal(pkg.dependencies?.["@robodev-ai/client"], "^0.12.0");
198
+ assert.match(pkg.dependencies?.["react-router-dom"] ?? "", /^\^6/);
187
199
  assert.match(pkg.devDependencies?.orval ?? "", /^\^/);
188
200
  const readme = await readFile(join(dest, "README.md"), "utf8");
189
201
  assert.match(readme, /^# Kit/m);
@@ -200,6 +212,8 @@ test("collectFiles for shadcn starter includes hosted Welcome and tooling config
200
212
  assert.ok(paths.has("robodev/api/health.ts"));
201
213
  assert.ok(paths.has("index.html"));
202
214
  assert.ok(paths.has("src/main.tsx"));
215
+ assert.ok(paths.has("src/pages/Home.tsx"));
216
+ assert.ok(paths.has("ROBODEV.md"));
203
217
  assert.ok(paths.has("src/components/ui/button.tsx"));
204
218
  assert.ok(paths.has("src/api/generated/endpoints.ts"));
205
219
  assert.ok(paths.has("src/api/openapi.json"));
@@ -219,6 +233,7 @@ test("collectFiles for space starter is Tiny APIs without apps/fe", async () =>
219
233
  assert.ok(paths.has("robodev/api/planets.ts"));
220
234
  assert.ok(paths.has("robodev/api/planets/paginate.ts"));
221
235
  assert.ok(paths.has("robodev/api/aliens/labels.ts"));
236
+ assert.ok(paths.has("ROBODEV.md"));
222
237
  assert.ok(!paths.has("robodev/api/files/upload-request.ts"));
223
238
  assert.ok(!paths.has("robodev/api/files/upload.ts"));
224
239
  assert.ok(!paths.has("index.html"));
@@ -1,6 +1,6 @@
1
1
  # {{NAME}}
2
2
 
3
- Starter from `robodev create --starter auth-chat`: Tiny chat APIs (`chat` database, `messages` table), authenticated invite email, and a Povio UI in `apps/fe`.
3
+ Starter from `robodev create --starter auth-chat`: Tiny chat APIs (`chat` database, `messages` table), authenticated invite email, and a Povio UI in `apps/fe`. Agents: read `ROBODEV.md`.
4
4
 
5
5
  After a CLI create or deploy with `.robodev` `frontend` set (the default for this starter), the project host serves the built Tiny SPA at `GET /`. APIs and Swagger still win over static files.
6
6
 
@@ -0,0 +1,71 @@
1
+ # Robodev
2
+
3
+ Use this file for Robodev and SDK facts. Do not web-search the SDK.
4
+
5
+ ## defineApi (copy-paste)
6
+
7
+ `db`, `email`, `storage`, and `env` are injected. Never `import { db } from "@robodev-ai/sdk"`.
8
+ The SDK is not installed in the runner. Do not `import("@robodev-ai/sdk")`. Do not search `/opt`, `node_modules`, or grok/gemini home for it.
9
+
10
+ ```ts
11
+ import { defineApi, z } from "@robodev-ai/sdk";
12
+
13
+ export const get = defineApi({
14
+ response: z.object({ ok: z.literal(true) }),
15
+ handler: async ({ db, email, storage, env }) => {
16
+ void db;
17
+ void email;
18
+ void storage;
19
+ void env;
20
+ return { ok: true as const };
21
+ },
22
+ });
23
+ ```
24
+
25
+ ## Hard rules
26
+
27
+ - Do not run npm, pnpm, or yarn install.
28
+ - Do not start npm run dev, vite, or any local server.
29
+ - Do not run tsc (node_modules is not installed in this runner).
30
+ - Do not port-scan or curl/fetch localhost.
31
+ - Preview is the WebContainer. Live APIs exist only after `robodev-publish be`.
32
+ - Publish backend after a batch of file edits, not after every file.
33
+ - Do not publish the frontend.
34
+
35
+ ## Backend
36
+
37
+ - Auth: robodev-auth get / set / users / users-delete. Do not invent control-plane HTTP.
38
+ - Secrets: robodev-secret list / set / delete. Use env.NAME in defineApi. List names only.
39
+ - SQL: psql or robodev-sql for DML, SELECT, and seed only. Never print DATABASE_URL. Never run DDL.
40
+ - Publish backend only with robodev-publish be. Do not publish the frontend.
41
+ - Email settings: robodev-email get / set / validate / logs.
42
+
43
+ ## Email templates
44
+
45
+ Hosted mail is the Email page. Changes apply immediately through these helpers — no Code save or deploy.
46
+
47
+ - `robodev-email templates list`
48
+ - `robodev-email templates get --slug <slug>`
49
+ - `robodev-email templates set --slug <slug> [--subject] [--html] [--text]`
50
+
51
+ `set` edits an existing slug. If the slug is missing and is a custom slug (`^[a-z][a-z0-9-]{0,62}$`, not `auth.*`), `set` creates it.
52
+
53
+ System slugs: `auth.welcome` (`{{email}}`, `{{name}}`), `auth.magic-link` (`{{link}}`, `{{email}}`, `{{name}}`, `{{appUrl}}`), `auth.forgot-password` (`{{link}}`, `{{code}}`, `{{email}}`, `{{name}}`, `{{appUrl}}`). Keep placeholders exact. Do not delete system templates. Do not invent `auth.*` slugs.
54
+
55
+ Send with `ctx.email.send({ template: "<slug>", to, vars })`.
56
+
57
+ Do not write `robodev/emails/*.html` or `robodev/emails/*.json` for hosted templates. Those files do not update the live project.
58
+
59
+ Never write `.env` or secrets. Never write `.robodev`.
60
+
61
+ ## Layout
62
+
63
+ CLI Tiny-family: `robodev/database.ts` + `robodev/api/**`, Povio UI in `apps/fe`. Keep that layout.
64
+
65
+ - Schema: `robodev/database.ts` (`defineDatabase` from `@robodev-ai/sdk`)
66
+ - HTTP handlers: `robodev/api/**/*.ts`
67
+ - Optional jobs / sockets / hooks under `robodev/`
68
+ - Frontend: `apps/fe` (Povio UI)
69
+ - Auth is reserved at `/api/user/*`. Do not add `robodev/api/user/**`.
70
+
71
+ Allowed paths: `robodev/database.ts`, `robodev/api/**/*.ts`, `robodev/jobs/**/*.ts`, `robodev/sockets/**/*.ts`, `robodev/hooks/**/*.ts`, `robodev/package.json`, `apps/fe/**`, `.rulesync/**`, `openapi.json`, `package.json`, `README.md`, `ROBODEV.md`, `.gitignore`.
@@ -12,7 +12,7 @@
12
12
  "@robodev-ai/sdk": "^0.13.0"
13
13
  },
14
14
  "devDependencies": {
15
- "robodev": "^0.46.0",
15
+ "robodev": "^0.47.1",
16
16
  "rulesync": "^8.18.0",
17
17
  "typescript": "^5.9.2"
18
18
  }
@@ -1,6 +1,6 @@
1
1
  # {{NAME}}
2
2
 
3
- Tiny Template planets, aliens, and media APIs — no Vite UI. For Lovable, Bolt, or v0.
3
+ Tiny Template planets, aliens, and media APIs — no Vite UI. For Lovable, Bolt, or v0. Agents: read `ROBODEV.md`.
4
4
 
5
5
  Deploy `robodev/database.ts` and `robodev/api/` from a real terminal:
6
6
 
@@ -0,0 +1,69 @@
1
+ # Robodev
2
+
3
+ Use this file for Robodev and SDK facts. Do not web-search the SDK.
4
+
5
+ ## defineApi (copy-paste)
6
+
7
+ `db`, `email`, `storage`, and `env` are injected. Never `import { db } from "@robodev-ai/sdk"`.
8
+ The SDK is not installed in the runner. Do not `import("@robodev-ai/sdk")`. Do not search `/opt`, `node_modules`, or grok/gemini home for it.
9
+
10
+ ```ts
11
+ import { defineApi, z } from "@robodev-ai/sdk";
12
+
13
+ export const get = defineApi({
14
+ response: z.object({ ok: z.literal(true) }),
15
+ handler: async ({ db, email, storage, env }) => {
16
+ void db;
17
+ void email;
18
+ void storage;
19
+ void env;
20
+ return { ok: true as const };
21
+ },
22
+ });
23
+ ```
24
+
25
+ ## Hard rules
26
+
27
+ - Do not run npm, pnpm, or yarn install.
28
+ - Do not start npm run dev, vite, or any local server.
29
+ - Do not run tsc (node_modules is not installed in this runner).
30
+ - Do not port-scan or curl/fetch localhost.
31
+ - Preview is the WebContainer. Live APIs exist only after `robodev-publish be`.
32
+ - Publish backend after a batch of file edits, not after every file.
33
+ - Do not publish the frontend.
34
+
35
+ ## Backend
36
+
37
+ - Auth: robodev-auth get / set / users / users-delete. Do not invent control-plane HTTP.
38
+ - Secrets: robodev-secret list / set / delete. Use env.NAME in defineApi. List names only.
39
+ - SQL: psql or robodev-sql for DML, SELECT, and seed only. Never print DATABASE_URL. Never run DDL.
40
+ - Publish backend only with robodev-publish be. Do not publish the frontend.
41
+ - Email settings: robodev-email get / set / validate / logs.
42
+
43
+ ## Email templates
44
+
45
+ Hosted mail is the Email page. Changes apply immediately through these helpers — no Code save or deploy.
46
+
47
+ - `robodev-email templates list`
48
+ - `robodev-email templates get --slug <slug>`
49
+ - `robodev-email templates set --slug <slug> [--subject] [--html] [--text]`
50
+
51
+ `set` edits an existing slug. If the slug is missing and is a custom slug (`^[a-z][a-z0-9-]{0,62}$`, not `auth.*`), `set` creates it.
52
+
53
+ System slugs: `auth.welcome` (`{{email}}`, `{{name}}`), `auth.magic-link` (`{{link}}`, `{{email}}`, `{{name}}`, `{{appUrl}}`), `auth.forgot-password` (`{{link}}`, `{{code}}`, `{{email}}`, `{{name}}`, `{{appUrl}}`). Keep placeholders exact. Do not delete system templates. Do not invent `auth.*` slugs.
54
+
55
+ Send with `ctx.email.send({ template: "<slug>", to, vars })`.
56
+
57
+ Do not write `robodev/emails/*.html` or `robodev/emails/*.json` for hosted templates. Those files do not update the live project.
58
+
59
+ Never write `.env` or secrets. Never write `.robodev`.
60
+
61
+ ## Layout
62
+
63
+ APIs only: `robodev/`. No Vite UI.
64
+
65
+ - Schema: `robodev/database.ts`
66
+ - HTTP handlers: `robodev/api/**/*.ts`
67
+ - Auth is reserved at `/api/user/*`. Do not add `robodev/api/user/**`.
68
+
69
+ Allowed paths: `robodev/database.ts`, `robodev/api/**/*.ts`, `robodev/jobs/**/*.ts`, `robodev/sockets/**/*.ts`, `robodev/hooks/**/*.ts`, `robodev/package.json`, `package.json`, `README.md`, `ROBODEV.md`, `.gitignore`.
@@ -11,7 +11,7 @@
11
11
  "@robodev-ai/sdk": "^0.13.0"
12
12
  },
13
13
  "devDependencies": {
14
- "robodev": "^0.46.0",
14
+ "robodev": "^0.47.1",
15
15
  "typescript": "^5.9.2"
16
16
  }
17
17
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Blank `robodev/database.ts` and `GET /api/health` plus a hosted Welcome page. No sample schema.
4
4
 
5
- The project App URL serves the hosted Welcome page. Edit `index.html` and `src/`, then `robodev deploy` (or Code + Save).
5
+ The project App URL serves the hosted Welcome page. Edit `index.html` and `src/`, then `robodev deploy` (or Code + Save). Agents: read `ROBODEV.md`.
6
6
 
7
7
  ```bash
8
8
  robodev create my-app
@@ -0,0 +1,72 @@
1
+ # Robodev
2
+
3
+ Use this file for Robodev and SDK facts. Do not web-search the SDK.
4
+
5
+ ## defineApi (copy-paste)
6
+
7
+ `db`, `email`, `storage`, and `env` are injected. Never `import { db } from "@robodev-ai/sdk"`.
8
+ The SDK is not installed in the runner. Do not `import("@robodev-ai/sdk")`. Do not search `/opt`, `node_modules`, or grok/gemini home for it.
9
+
10
+ ```ts
11
+ import { defineApi, z } from "@robodev-ai/sdk";
12
+
13
+ export const get = defineApi({
14
+ response: z.object({ ok: z.literal(true) }),
15
+ handler: async ({ db, email, storage, env }) => {
16
+ void db;
17
+ void email;
18
+ void storage;
19
+ void env;
20
+ return { ok: true as const };
21
+ },
22
+ });
23
+ ```
24
+
25
+ ## Hard rules
26
+
27
+ - Do not run npm, pnpm, or yarn install.
28
+ - Do not start npm run dev, vite, or any local server.
29
+ - Do not run tsc (node_modules is not installed in this runner).
30
+ - Do not port-scan or curl/fetch localhost.
31
+ - Preview is the WebContainer. Live APIs exist only after `robodev-publish be`.
32
+ - Publish backend after a batch of file edits, not after every file.
33
+ - Do not publish the frontend.
34
+
35
+ ## Backend
36
+
37
+ - Auth: robodev-auth get / set / users / users-delete. Do not invent control-plane HTTP.
38
+ - Secrets: robodev-secret list / set / delete. Use env.NAME in defineApi. List names only.
39
+ - SQL: psql or robodev-sql for DML, SELECT, and seed only. Never print DATABASE_URL. Never run DDL.
40
+ - Publish backend only with robodev-publish be. Do not publish the frontend.
41
+ - Email settings: robodev-email get / set / validate / logs.
42
+
43
+ ## Email templates
44
+
45
+ Hosted mail is the Email page. Changes apply immediately through these helpers — no Code save or deploy.
46
+
47
+ - `robodev-email templates list`
48
+ - `robodev-email templates get --slug <slug>`
49
+ - `robodev-email templates set --slug <slug> [--subject] [--html] [--text]`
50
+
51
+ `set` edits an existing slug. If the slug is missing and is a custom slug (`^[a-z][a-z0-9-]{0,62}$`, not `auth.*`), `set` creates it.
52
+
53
+ System slugs: `auth.welcome` (`{{email}}`, `{{name}}`), `auth.magic-link` (`{{link}}`, `{{email}}`, `{{name}}`, `{{appUrl}}`), `auth.forgot-password` (`{{link}}`, `{{code}}`, `{{email}}`, `{{name}}`, `{{appUrl}}`). Keep placeholders exact. Do not delete system templates. Do not invent `auth.*` slugs.
54
+
55
+ Send with `ctx.email.send({ template: "<slug>", to, vars })`.
56
+
57
+ Do not write `robodev/emails/*.html` or `robodev/emails/*.json` for hosted templates. Those files do not update the live project.
58
+
59
+ Never write `.env` or secrets. Never write `.robodev`.
60
+
61
+ ## Layout
62
+
63
+ This is the hosted Empty layout. Keep it.
64
+
65
+ - Schema: `robodev/database.ts`
66
+ - HTTP handlers: `robodev/api/**/*.ts`
67
+ - Frontend: root `index.html` + `src/**`
68
+ - Auth is reserved at `/api/user/*`. Do not add `robodev/api/user/**`.
69
+
70
+ Do not write a `frontend` block in `robodev/.robodev`. Root `index.html` + `src/` deploy as hosted React.
71
+
72
+ Allowed paths: `robodev/database.ts`, `robodev/api/**/*.ts`, `robodev/jobs/**/*.ts`, `robodev/sockets/**/*.ts`, `robodev/hooks/**/*.ts`, `robodev/package.json`, `index.html`, `src/**`, `package.json`, `README.md`, `ROBODEV.md`, `.gitignore`.
@@ -16,7 +16,7 @@
16
16
  "react-dom": "^18.3.1"
17
17
  },
18
18
  "devDependencies": {
19
- "robodev": "^0.46.0",
19
+ "robodev": "^0.47.1",
20
20
  "typescript": "^5.9.2",
21
21
  "vite": "^6.0.0"
22
22
  }
@@ -1,6 +1,6 @@
1
1
  # {{NAME}}
2
2
 
3
- Starter from `robodev create --starter marketplace`: Marketplace C2C marketplace schema (`categories`, `listings`, `cart_items`, `orders`, `watches`, `reviews`, `media`), file-based APIs in `robodev/api/`, and a Povio UI in `apps/fe`.
3
+ Starter from `robodev create --starter marketplace`: Marketplace C2C marketplace schema (`categories`, `listings`, `cart_items`, `orders`, `watches`, `reviews`, `media`), file-based APIs in `robodev/api/`, and a Povio UI in `apps/fe`. Agents: read `ROBODEV.md`.
4
4
 
5
5
  After a CLI create or deploy with `.robodev` `frontend` set (the default for this starter), the project host serves the built Marketplace SPA at `GET /`. APIs and Swagger still win over static files.
6
6
 
@@ -0,0 +1,71 @@
1
+ # Robodev
2
+
3
+ Use this file for Robodev and SDK facts. Do not web-search the SDK.
4
+
5
+ ## defineApi (copy-paste)
6
+
7
+ `db`, `email`, `storage`, and `env` are injected. Never `import { db } from "@robodev-ai/sdk"`.
8
+ The SDK is not installed in the runner. Do not `import("@robodev-ai/sdk")`. Do not search `/opt`, `node_modules`, or grok/gemini home for it.
9
+
10
+ ```ts
11
+ import { defineApi, z } from "@robodev-ai/sdk";
12
+
13
+ export const get = defineApi({
14
+ response: z.object({ ok: z.literal(true) }),
15
+ handler: async ({ db, email, storage, env }) => {
16
+ void db;
17
+ void email;
18
+ void storage;
19
+ void env;
20
+ return { ok: true as const };
21
+ },
22
+ });
23
+ ```
24
+
25
+ ## Hard rules
26
+
27
+ - Do not run npm, pnpm, or yarn install.
28
+ - Do not start npm run dev, vite, or any local server.
29
+ - Do not run tsc (node_modules is not installed in this runner).
30
+ - Do not port-scan or curl/fetch localhost.
31
+ - Preview is the WebContainer. Live APIs exist only after `robodev-publish be`.
32
+ - Publish backend after a batch of file edits, not after every file.
33
+ - Do not publish the frontend.
34
+
35
+ ## Backend
36
+
37
+ - Auth: robodev-auth get / set / users / users-delete. Do not invent control-plane HTTP.
38
+ - Secrets: robodev-secret list / set / delete. Use env.NAME in defineApi. List names only.
39
+ - SQL: psql or robodev-sql for DML, SELECT, and seed only. Never print DATABASE_URL. Never run DDL.
40
+ - Publish backend only with robodev-publish be. Do not publish the frontend.
41
+ - Email settings: robodev-email get / set / validate / logs.
42
+
43
+ ## Email templates
44
+
45
+ Hosted mail is the Email page. Changes apply immediately through these helpers — no Code save or deploy.
46
+
47
+ - `robodev-email templates list`
48
+ - `robodev-email templates get --slug <slug>`
49
+ - `robodev-email templates set --slug <slug> [--subject] [--html] [--text]`
50
+
51
+ `set` edits an existing slug. If the slug is missing and is a custom slug (`^[a-z][a-z0-9-]{0,62}$`, not `auth.*`), `set` creates it.
52
+
53
+ System slugs: `auth.welcome` (`{{email}}`, `{{name}}`), `auth.magic-link` (`{{link}}`, `{{email}}`, `{{name}}`, `{{appUrl}}`), `auth.forgot-password` (`{{link}}`, `{{code}}`, `{{email}}`, `{{name}}`, `{{appUrl}}`). Keep placeholders exact. Do not delete system templates. Do not invent `auth.*` slugs.
54
+
55
+ Send with `ctx.email.send({ template: "<slug>", to, vars })`.
56
+
57
+ Do not write `robodev/emails/*.html` or `robodev/emails/*.json` for hosted templates. Those files do not update the live project.
58
+
59
+ Never write `.env` or secrets. Never write `.robodev`.
60
+
61
+ ## Layout
62
+
63
+ CLI Tiny-family: `robodev/database.ts` + `robodev/api/**`, Povio UI in `apps/fe`. Keep that layout.
64
+
65
+ - Schema: `robodev/database.ts` (`defineDatabase` from `@robodev-ai/sdk`)
66
+ - HTTP handlers: `robodev/api/**/*.ts`
67
+ - Optional jobs / sockets / hooks under `robodev/`
68
+ - Frontend: `apps/fe` (Povio UI)
69
+ - Auth is reserved at `/api/user/*`. Do not add `robodev/api/user/**`.
70
+
71
+ Allowed paths: `robodev/database.ts`, `robodev/api/**/*.ts`, `robodev/jobs/**/*.ts`, `robodev/sockets/**/*.ts`, `robodev/hooks/**/*.ts`, `robodev/package.json`, `apps/fe/**`, `.rulesync/**`, `openapi.json`, `package.json`, `README.md`, `ROBODEV.md`, `.gitignore`.
@@ -12,7 +12,7 @@
12
12
  "@robodev-ai/sdk": "^0.13.0"
13
13
  },
14
14
  "devDependencies": {
15
- "robodev": "^0.46.0",
15
+ "robodev": "^0.47.1",
16
16
  "rulesync": "^8.18.0",
17
17
  "typescript": "^5.9.2"
18
18
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Blank `robodev/database.ts` and `GET /api/health` plus a hosted Welcome page with shadcn and an orval client. No sample schema.
4
4
 
5
- The project App URL serves the hosted Welcome page. Edit `index.html` and `src/`, then `robodev deploy` (or Code + Save).
5
+ The project App URL serves the hosted Welcome page (`/` via React Router in `src/pages/Home.tsx`). Edit `index.html` and `src/`, then `robodev deploy` (or Code + Save). Agents: read `ROBODEV.md`.
6
6
 
7
7
  ```bash
8
8
  robodev create my-app --template shadcn
@@ -0,0 +1,78 @@
1
+ # Robodev
2
+
3
+ Use this file for Robodev and SDK facts. Do not web-search the SDK.
4
+
5
+ ## defineApi (copy-paste)
6
+
7
+ `db`, `email`, `storage`, and `env` are injected. Never `import { db } from "@robodev-ai/sdk"`.
8
+ The SDK is not installed in the runner. Do not `import("@robodev-ai/sdk")`. Do not search `/opt`, `node_modules`, or grok/gemini home for it.
9
+
10
+ ```ts
11
+ import { defineApi, z } from "@robodev-ai/sdk";
12
+
13
+ export const get = defineApi({
14
+ response: z.object({ ok: z.literal(true) }),
15
+ handler: async ({ db, email, storage, env }) => {
16
+ void db;
17
+ void email;
18
+ void storage;
19
+ void env;
20
+ return { ok: true as const };
21
+ },
22
+ });
23
+ ```
24
+
25
+ ## Hard rules
26
+
27
+ - Do not run npm, pnpm, or yarn install.
28
+ - Do not start npm run dev, vite, or any local server.
29
+ - Do not run tsc (node_modules is not installed in this runner).
30
+ - Do not port-scan or curl/fetch localhost.
31
+ - Preview is the WebContainer. Live APIs exist only after `robodev-publish be`.
32
+ - Publish backend after a batch of file edits, not after every file.
33
+ - Do not publish the frontend.
34
+
35
+ ## Backend
36
+
37
+ - Auth: robodev-auth get / set / users / users-delete. Do not invent control-plane HTTP.
38
+ - Secrets: robodev-secret list / set / delete. Use env.NAME in defineApi. List names only.
39
+ - SQL: psql or robodev-sql for DML, SELECT, and seed only. Never print DATABASE_URL. Never run DDL.
40
+ - Publish backend only with robodev-publish be. Do not publish the frontend.
41
+ - Email settings: robodev-email get / set / validate / logs.
42
+
43
+ ## Email templates
44
+
45
+ Hosted mail is the Email page. Changes apply immediately through these helpers — no Code save or deploy.
46
+
47
+ - `robodev-email templates list`
48
+ - `robodev-email templates get --slug <slug>`
49
+ - `robodev-email templates set --slug <slug> [--subject] [--html] [--text]`
50
+
51
+ `set` edits an existing slug. If the slug is missing and is a custom slug (`^[a-z][a-z0-9-]{0,62}$`, not `auth.*`), `set` creates it.
52
+
53
+ System slugs: `auth.welcome` (`{{email}}`, `{{name}}`), `auth.magic-link` (`{{link}}`, `{{email}}`, `{{name}}`, `{{appUrl}}`), `auth.forgot-password` (`{{link}}`, `{{code}}`, `{{email}}`, `{{name}}`, `{{appUrl}}`). Keep placeholders exact. Do not delete system templates. Do not invent `auth.*` slugs.
54
+
55
+ Send with `ctx.email.send({ template: "<slug>", to, vars })`.
56
+
57
+ Do not write `robodev/emails/*.html` or `robodev/emails/*.json` for hosted templates. Those files do not update the live project.
58
+
59
+ Never write `.env` or secrets. Never write `.robodev`.
60
+
61
+ ## Layout
62
+
63
+ This is the hosted Shadcn layout. Keep it. Do not convert this tree to Tiny (`packages/be` + `apps/fe`).
64
+
65
+ - Schema: `robodev/database.ts` (`defineDatabase` from `@robodev-ai/sdk`)
66
+ - HTTP handlers: `robodev/api/**/*.ts` (`defineApi` from `@robodev-ai/sdk`)
67
+ - Optional jobs: `robodev/jobs/**/*.ts`. Optional sockets: `robodev/sockets/**/*.ts` (`defineSocket`). Optional runtime packages go in `robodev/package.json` (allowlisted exact semver only). Do not npm install in this runner — Starbase installs on publish.
68
+ - Frontend: root `index.html` + `src/**` (React, React Router, shadcn, generated orval client)
69
+ - Auth is reserved at `/api/user/*`. Do not add `robodev/api/user/**`.
70
+
71
+ Do not write a `frontend` block in `robodev/.robodev` — that block is for Tiny `apps/fe`. Root `index.html` + `src/` deploy as hosted React.
72
+
73
+ - Route with React Router in `src/`. `src/pages/Home.tsx` is `/`. Add a page by adding a component and a `<Route>` in `src/App.tsx`.
74
+ - Call APIs through the committed orval client under `src/api/generated`. After API changes, update `src/api/openapi.json` and regenerate.
75
+ - UI: shadcn under `src/components/ui`. Hosted compile does not run Tailwind. Keep hosted CSS in `src/app.css`. `tailwind.config.ts` and `postcss.config.js` are for local `shadcn add` / Vite only.
76
+ - Hosted FE packages: `react`, `react-dom`, `react-router-dom`, `@robodev-ai/client`. Do not import other npm packages in `src/` — hosted compile will fail.
77
+
78
+ Allowed paths: `robodev/database.ts`, `robodev/api/**/*.ts`, `robodev/jobs/**/*.ts`, `robodev/sockets/**/*.ts`, `robodev/hooks/**/*.ts`, `robodev/package.json`, `index.html`, `src/**`, `package.json`, `README.md`, `ROBODEV.md`, `.gitignore`.
@@ -14,13 +14,14 @@
14
14
  "@robodev-ai/sdk": "^0.13.0",
15
15
  "@robodev-ai/client": "^0.5.0",
16
16
  "react": "^18.3.1",
17
- "react-dom": "^18.3.1"
17
+ "react-dom": "^18.3.1",
18
+ "react-router-dom": "^6.30.1"
18
19
  },
19
20
  "devDependencies": {
20
21
  "autoprefixer": "^10.4.21",
21
22
  "orval": "^7.11.2",
22
23
  "postcss": "^8.5.6",
23
- "robodev": "^0.46.0",
24
+ "robodev": "^0.47.1",
24
25
  "shadcn": "^2.10.0",
25
26
  "tailwindcss": "^3.4.17",
26
27
  "typescript": "^5.9.2",
@@ -1,35 +1,10 @@
1
- import { useEffect, useState } from "react";
2
- import { getHealth } from "@/api/generated/endpoints";
3
- import { Button } from "@/components/ui/button";
1
+ import { Route, Routes } from "react-router-dom";
2
+ import { Home } from "./pages/Home";
4
3
 
5
4
  export function App() {
6
- const [status, setStatus] = useState("Checking health…");
7
-
8
- async function loadHealth() {
9
- try {
10
- const result = await getHealth();
11
- if (result.status !== 200 || result.data.ok !== true) {
12
- setStatus(`Request failed (${result.status})`);
13
- return;
14
- }
15
- setStatus("{ ok: true }");
16
- } catch (error) {
17
- setStatus(error instanceof Error ? error.message : "Request failed");
18
- }
19
- }
20
-
21
- useEffect(() => {
22
- void loadHealth();
23
- }, []);
24
-
25
5
  return (
26
- <main>
27
- <h1>Welcome</h1>
28
- <p>Your app is ready.</p>
29
- <Button type="button" onClick={() => void loadHealth()}>
30
- Check health
31
- </Button>
32
- <p>{status}</p>
33
- </main>
6
+ <Routes>
7
+ <Route path="/" element={<Home />} />
8
+ </Routes>
34
9
  );
35
10
  }
@@ -1,5 +1,10 @@
1
1
  import { createRoot } from "react-dom/client";
2
+ import { BrowserRouter } from "react-router-dom";
2
3
  import { App } from "./App";
3
4
  import "./app.css";
4
5
 
5
- createRoot(document.getElementById("root")!).render(<App />);
6
+ createRoot(document.getElementById("root")!).render(
7
+ <BrowserRouter>
8
+ <App />
9
+ </BrowserRouter>,
10
+ );
@@ -0,0 +1,35 @@
1
+ import { useEffect, useState } from "react";
2
+ import { getHealth } from "@/api/generated/endpoints";
3
+ import { Button } from "@/components/ui/button";
4
+
5
+ export function Home() {
6
+ const [status, setStatus] = useState("Checking health…");
7
+
8
+ async function loadHealth() {
9
+ try {
10
+ const result = await getHealth();
11
+ if (result.status !== 200 || result.data.ok !== true) {
12
+ setStatus(`Request failed (${result.status})`);
13
+ return;
14
+ }
15
+ setStatus("{ ok: true }");
16
+ } catch (error) {
17
+ setStatus(error instanceof Error ? error.message : "Request failed");
18
+ }
19
+ }
20
+
21
+ useEffect(() => {
22
+ void loadHealth();
23
+ }, []);
24
+
25
+ return (
26
+ <main>
27
+ <h1>Welcome</h1>
28
+ <p>Your app is ready.</p>
29
+ <Button type="button" onClick={() => void loadHealth()}>
30
+ Check health
31
+ </Button>
32
+ <p>{status}</p>
33
+ </main>
34
+ );
35
+ }
@@ -1,6 +1,6 @@
1
1
  # {{NAME}}
2
2
 
3
- Starter from `robodev create`: Tiny Template schema (`planets`, `aliens`, `media`, `planet_likes`), file-based APIs in `robodev/api/`, and a Povio UI in `apps/fe`.
3
+ Starter from `robodev create`: Tiny Template schema (`planets`, `aliens`, `media`, `planet_likes`), file-based APIs in `robodev/api/`, and a Povio UI in `apps/fe`. Agents: read `ROBODEV.md`.
4
4
 
5
5
  After a CLI create or deploy with `.robodev` `frontend` set (the default for this starter), the project host serves the built Tiny SPA at `GET /`. APIs and Swagger still win over static files.
6
6
 
@@ -0,0 +1,71 @@
1
+ # Robodev
2
+
3
+ Use this file for Robodev and SDK facts. Do not web-search the SDK.
4
+
5
+ ## defineApi (copy-paste)
6
+
7
+ `db`, `email`, `storage`, and `env` are injected. Never `import { db } from "@robodev-ai/sdk"`.
8
+ The SDK is not installed in the runner. Do not `import("@robodev-ai/sdk")`. Do not search `/opt`, `node_modules`, or grok/gemini home for it.
9
+
10
+ ```ts
11
+ import { defineApi, z } from "@robodev-ai/sdk";
12
+
13
+ export const get = defineApi({
14
+ response: z.object({ ok: z.literal(true) }),
15
+ handler: async ({ db, email, storage, env }) => {
16
+ void db;
17
+ void email;
18
+ void storage;
19
+ void env;
20
+ return { ok: true as const };
21
+ },
22
+ });
23
+ ```
24
+
25
+ ## Hard rules
26
+
27
+ - Do not run npm, pnpm, or yarn install.
28
+ - Do not start npm run dev, vite, or any local server.
29
+ - Do not run tsc (node_modules is not installed in this runner).
30
+ - Do not port-scan or curl/fetch localhost.
31
+ - Preview is the WebContainer. Live APIs exist only after `robodev-publish be`.
32
+ - Publish backend after a batch of file edits, not after every file.
33
+ - Do not publish the frontend.
34
+
35
+ ## Backend
36
+
37
+ - Auth: robodev-auth get / set / users / users-delete. Do not invent control-plane HTTP.
38
+ - Secrets: robodev-secret list / set / delete. Use env.NAME in defineApi. List names only.
39
+ - SQL: psql or robodev-sql for DML, SELECT, and seed only. Never print DATABASE_URL. Never run DDL.
40
+ - Publish backend only with robodev-publish be. Do not publish the frontend.
41
+ - Email settings: robodev-email get / set / validate / logs.
42
+
43
+ ## Email templates
44
+
45
+ Hosted mail is the Email page. Changes apply immediately through these helpers — no Code save or deploy.
46
+
47
+ - `robodev-email templates list`
48
+ - `robodev-email templates get --slug <slug>`
49
+ - `robodev-email templates set --slug <slug> [--subject] [--html] [--text]`
50
+
51
+ `set` edits an existing slug. If the slug is missing and is a custom slug (`^[a-z][a-z0-9-]{0,62}$`, not `auth.*`), `set` creates it.
52
+
53
+ System slugs: `auth.welcome` (`{{email}}`, `{{name}}`), `auth.magic-link` (`{{link}}`, `{{email}}`, `{{name}}`, `{{appUrl}}`), `auth.forgot-password` (`{{link}}`, `{{code}}`, `{{email}}`, `{{name}}`, `{{appUrl}}`). Keep placeholders exact. Do not delete system templates. Do not invent `auth.*` slugs.
54
+
55
+ Send with `ctx.email.send({ template: "<slug>", to, vars })`.
56
+
57
+ Do not write `robodev/emails/*.html` or `robodev/emails/*.json` for hosted templates. Those files do not update the live project.
58
+
59
+ Never write `.env` or secrets. Never write `.robodev`.
60
+
61
+ ## Layout
62
+
63
+ CLI Tiny-family: `robodev/database.ts` + `robodev/api/**`, Povio UI in `apps/fe`. Keep that layout.
64
+
65
+ - Schema: `robodev/database.ts` (`defineDatabase` from `@robodev-ai/sdk`)
66
+ - HTTP handlers: `robodev/api/**/*.ts`
67
+ - Optional jobs / sockets / hooks under `robodev/`
68
+ - Frontend: `apps/fe` (Povio UI)
69
+ - Auth is reserved at `/api/user/*`. Do not add `robodev/api/user/**`.
70
+
71
+ Allowed paths: `robodev/database.ts`, `robodev/api/**/*.ts`, `robodev/jobs/**/*.ts`, `robodev/sockets/**/*.ts`, `robodev/hooks/**/*.ts`, `robodev/package.json`, `apps/fe/**`, `.rulesync/**`, `openapi.json`, `package.json`, `README.md`, `ROBODEV.md`, `.gitignore`.
@@ -12,7 +12,7 @@
12
12
  "@robodev-ai/sdk": "^0.13.0"
13
13
  },
14
14
  "devDependencies": {
15
- "robodev": "^0.46.0",
15
+ "robodev": "^0.47.1",
16
16
  "rulesync": "^8.18.0",
17
17
  "typescript": "^5.9.2"
18
18
  }