robodev 0.47.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 +3 -3
- package/src/emit-starter.test.ts +4 -0
- package/templates/auth-chat/README.md +1 -1
- package/templates/auth-chat/ROBODEV.md +71 -0
- package/templates/auth-chat/package.json +1 -1
- package/templates/backend/README.md +1 -1
- package/templates/backend/ROBODEV.md +69 -0
- package/templates/backend/package.json +1 -1
- package/templates/empty/README.md +1 -1
- package/templates/empty/ROBODEV.md +72 -0
- package/templates/empty/package.json +1 -1
- package/templates/marketplace/README.md +1 -1
- package/templates/marketplace/ROBODEV.md +71 -0
- package/templates/marketplace/package.json +1 -1
- package/templates/shadcn/ROBODEV.md +32 -21
- package/templates/shadcn/package.json +1 -1
- package/templates/space/README.md +1 -1
- package/templates/space/ROBODEV.md +71 -0
- package/templates/space/package.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "robodev",
|
|
3
|
-
"version": "0.47.
|
|
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",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"embedded-postgres": "17.10.0-beta.17",
|
|
27
27
|
"fastify": "^5.12.1",
|
|
28
28
|
"tsx": "^4.20.5",
|
|
29
|
-
"@robodev-ai/
|
|
30
|
-
"@robodev-ai/
|
|
29
|
+
"@robodev-ai/runtime": "0.7.1",
|
|
30
|
+
"@robodev-ai/sdk": "0.13.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "^24.3.0",
|
package/src/emit-starter.test.ts
CHANGED
|
@@ -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);
|
|
@@ -178,6 +179,8 @@ test("emitStarter shadcn includes hosted Welcome plus orval and shadcn files", a
|
|
|
178
179
|
const notes = await readFile(join(dest, "ROBODEV.md"), "utf8");
|
|
179
180
|
assert.match(notes, /react-router-dom/);
|
|
180
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`/);
|
|
181
184
|
const endpoints = await readFile(join(dest, "src/api/generated/endpoints.ts"), "utf8");
|
|
182
185
|
assert.match(endpoints, /export const getHealth/);
|
|
183
186
|
assert.doesNotMatch(endpoints, /axios|@tanstack\/react-query/);
|
|
@@ -230,6 +233,7 @@ test("collectFiles for space starter is Tiny APIs without apps/fe", async () =>
|
|
|
230
233
|
assert.ok(paths.has("robodev/api/planets.ts"));
|
|
231
234
|
assert.ok(paths.has("robodev/api/planets/paginate.ts"));
|
|
232
235
|
assert.ok(paths.has("robodev/api/aliens/labels.ts"));
|
|
236
|
+
assert.ok(paths.has("ROBODEV.md"));
|
|
233
237
|
assert.ok(!paths.has("robodev/api/files/upload-request.ts"));
|
|
234
238
|
assert.ok(!paths.has("robodev/api/files/upload.ts"));
|
|
235
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`.
|
|
@@ -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`.
|
|
@@ -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`.
|
|
@@ -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`.
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
# Robodev
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
This is the hosted Shadcn layout. Keep it. Do not convert this tree to Tiny (`packages/be` + `apps/fe`).
|
|
6
|
-
|
|
7
|
-
## Layout
|
|
8
|
-
|
|
9
|
-
- Schema: `robodev/database.ts` (`defineDatabase` from `@robodev-ai/sdk`)
|
|
10
|
-
- HTTP handlers: `robodev/api/**/*.ts` (`defineApi` from `@robodev-ai/sdk`)
|
|
11
|
-
- 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.
|
|
12
|
-
- Frontend: root `index.html` + `src/**` (React, React Router, shadcn, generated orval client)
|
|
13
|
-
- Auth is reserved at `/api/user/*`. Do not add `robodev/api/user/**`.
|
|
14
|
-
|
|
15
|
-
Do not write a `frontend` block in `robodev/.robodev` — that block is for Tiny `apps/fe`. Root `index.html` + `src/` deploy as hosted React.
|
|
3
|
+
Use this file for Robodev and SDK facts. Do not web-search the SDK.
|
|
16
4
|
|
|
17
5
|
## defineApi (copy-paste)
|
|
18
6
|
|
|
@@ -46,22 +34,45 @@ export const get = defineApi({
|
|
|
46
34
|
|
|
47
35
|
## Backend
|
|
48
36
|
|
|
49
|
-
- Layout is `robodev/`. `robodev-publish be` maps `robodev/database.ts` → `database.ts` and `robodev/api/**` → `api/**`.
|
|
50
37
|
- Auth: robodev-auth get / set / users / users-delete. Do not invent control-plane HTTP.
|
|
51
38
|
- Secrets: robodev-secret list / set / delete. Use env.NAME in defineApi. List names only.
|
|
52
39
|
- SQL: psql or robodev-sql for DML, SELECT, and seed only. Never print DATABASE_URL. Never run DDL.
|
|
53
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 })`.
|
|
54
56
|
|
|
55
|
-
|
|
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.
|
|
56
72
|
|
|
57
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`.
|
|
58
74
|
- Call APIs through the committed orval client under `src/api/generated`. After API changes, update `src/api/openapi.json` and regenerate.
|
|
59
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.
|
|
60
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.
|
|
61
|
-
- Preview runs `pnpm install` / `vite --host` from the project root. Do not run those in this runner.
|
|
62
|
-
|
|
63
|
-
## Allowed paths
|
|
64
77
|
|
|
65
|
-
`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`.
|
|
66
|
-
|
|
67
|
-
Never write `.env` or secrets. Never write `.robodev`.
|
|
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`.
|
|
@@ -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`.
|