create-disposabl-app 0.5.0 → 0.6.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.
Files changed (87) hide show
  1. package/README.md +12 -0
  2. package/dist/disposabl.js +541 -0
  3. package/dist/index.js +91 -8
  4. package/dist/templates/default/.github/scripts/android-build.sh +18 -0
  5. package/dist/templates/default/.github/scripts/disposabl.mjs +95 -0
  6. package/dist/templates/default/.github/scripts/expo-channel.sh +10 -0
  7. package/dist/templates/default/.github/scripts/expo-env.sh +17 -0
  8. package/dist/templates/default/.github/scripts/expo-fingerprint.sh +28 -0
  9. package/dist/templates/default/.github/scripts/expo-update.sh +11 -0
  10. package/dist/templates/default/.github/scripts/package-release.sh +23 -0
  11. package/dist/templates/default/.github/scripts/platforms.sh +37 -0
  12. package/dist/templates/default/.github/scripts/release-publish.sh +28 -0
  13. package/dist/templates/default/.github/scripts/release-source.sh +14 -0
  14. package/dist/templates/default/.github/scripts/verify-artifacts.sh +13 -0
  15. package/dist/templates/default/.github/scripts/web-deploy.sh +10 -0
  16. package/dist/templates/default/.github/workflows/pipeline.yml +300 -0
  17. package/dist/templates/default/apps/mobile/AGENTS.md +2 -2
  18. package/dist/templates/default/apps/mobile/README.md +4 -3
  19. package/dist/templates/default/apps/mobile/app.json +3 -4
  20. package/dist/templates/default/apps/mobile/assets/images/android-icon-foreground.png +0 -0
  21. package/dist/templates/default/apps/mobile/assets/images/android-icon-monochrome.png +0 -0
  22. package/dist/templates/default/apps/mobile/assets/images/icon.png +0 -0
  23. package/dist/templates/default/apps/mobile/assets/images/splash-icon.png +0 -0
  24. package/dist/templates/default/apps/mobile/eas.json +5 -0
  25. package/dist/templates/default/apps/mobile/package.json +5 -4
  26. package/dist/templates/default/apps/web/package.json +1 -1
  27. package/dist/templates/default/apps/web/src/routeTree.gen.ts +0 -44
  28. package/dist/templates/default/apps/web/src/router/__root.tsx +1 -1
  29. package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.tsx +0 -1
  30. package/dist/templates/default/apps/web/src/router/index.tsx +11 -3
  31. package/dist/templates/default/bun.lock +19 -5
  32. package/dist/templates/default/bunfig.toml +0 -2
  33. package/dist/templates/default/package.json +3 -3
  34. package/dist/templates/default/packages/backend/AGENTS.md +15 -13
  35. package/dist/templates/default/packages/backend/README.md +6 -28
  36. package/dist/templates/default/packages/backend/convex/_generated/ai/ai-files.state.json +1 -1
  37. package/dist/templates/default/packages/backend/convex/_generated/api.d.ts +32 -6
  38. package/dist/templates/default/packages/backend/convex/_generated/server.d.ts +8 -0
  39. package/dist/templates/default/packages/backend/convex/apps/actions/create.ts +19 -0
  40. package/dist/templates/default/packages/backend/convex/apps/internal.ts +197 -0
  41. package/dist/templates/default/packages/backend/convex/auth.ts +1 -1
  42. package/dist/templates/default/packages/backend/convex/convex.config.ts +8 -0
  43. package/dist/templates/default/packages/backend/convex/github/actions/http.ts +40 -0
  44. package/dist/templates/default/packages/backend/convex/github/actions/internal.ts +189 -0
  45. package/dist/templates/default/packages/backend/convex/github/actions/oidc.ts +75 -0
  46. package/dist/templates/default/packages/backend/convex/github/actions/provision.ts +80 -0
  47. package/dist/templates/default/packages/backend/convex/github/actions/tokens.ts +66 -0
  48. package/dist/templates/default/packages/backend/convex/github/internal.ts +34 -0
  49. package/dist/templates/default/packages/backend/convex/http.ts +3 -0
  50. package/dist/templates/default/packages/backend/convex/previews/internal.ts +270 -0
  51. package/dist/templates/default/packages/backend/convex/previews/token/actions/create.ts +69 -0
  52. package/dist/templates/default/packages/backend/convex/previews/token/actions/management.ts +133 -0
  53. package/dist/templates/default/packages/backend/convex/previews/token/internal.ts +1 -0
  54. package/dist/templates/default/packages/backend/convex/releases/internal.ts +28 -0
  55. package/dist/templates/default/packages/backend/convex/schema.ts +34 -4
  56. package/dist/templates/default/packages/backend/convex/users/index.ts +21 -0
  57. package/dist/templates/default/packages/backend/convex/users/internal.ts +44 -0
  58. package/dist/templates/default/packages/backend/convex/validator.ts +87 -0
  59. package/dist/templates/default/packages/backend/generate.ts +6 -1
  60. package/dist/templates/default/packages/backend/generated/openapi.json +961 -43
  61. package/dist/templates/default/packages/backend/generated/pages.json +0 -8
  62. package/dist/templates/default/packages/backend/generated/platforms.ts +14 -2
  63. package/dist/templates/default/packages/backend/package.json +1 -1
  64. package/dist/templates/default/packages/cli/README.md +15 -9
  65. package/dist/templates/default/packages/cli/auth.ts +11 -3
  66. package/dist/templates/default/packages/cli/commands.ts +236 -0
  67. package/dist/templates/default/packages/cli/index.ts +2 -142
  68. package/dist/templates/default/packages/cli/preview.ts +157 -0
  69. package/dist/templates/default/packages/disposabl-kit/client/routes/consent.tsx +2 -1
  70. package/dist/templates/default/packages/disposabl-kit/client/routes/route.tsx +35 -1
  71. package/dist/templates/default/packages/disposabl-kit/mobile/lib/logo.png +0 -0
  72. package/dist/templates/default/packages/disposabl-kit/mobile/screens/account.tsx +1 -1
  73. package/dist/templates/default/packages/disposabl-kit/mobile/screens/home.tsx +20 -5
  74. package/dist/templates/default/packages/sdk/README.md +8 -4
  75. package/dist/templates/default/packages/sdk/src/config.ts +14 -7
  76. package/dist/templates/default/packages/sdk/src/generated/index.ts +48 -13
  77. package/dist/templates/default/packages/sdk/src/generated/sdk.gen.ts +139 -27
  78. package/dist/templates/default/packages/sdk/src/generated/types.gen.ts +440 -37
  79. package/package.json +6 -3
  80. package/dist/templates/default/.github/README.md +0 -99
  81. package/dist/templates/default/.github/actionlint.yaml +0 -6
  82. package/dist/templates/default/.github/workflows/pipeline.yml.example +0 -546
  83. package/dist/templates/default/apps/web/src/router/_authenticated/todos/$id.tsx +0 -27
  84. package/dist/templates/default/apps/web/src/router/_authenticated/todos/index.tsx +0 -33
  85. package/dist/templates/default/packages/backend/convex/todos/index.ts +0 -26
  86. package/dist/templates/default/packages/backend/convex/todos/internal.ts +0 -43
  87. package/dist/templates/default/packages/backend/convex/users.ts +0 -43
@@ -70,6 +70,7 @@
70
70
  "convex": "catalog:",
71
71
  "expo": "~58.0.19",
72
72
  "expo-constants": "~58.0.13",
73
+ "expo-dev-client": "~58.0.18",
73
74
  "expo-device": "~58.0.5",
74
75
  "expo-font": "~58.0.10",
75
76
  "expo-glass-effect": "~58.0.5",
@@ -144,7 +145,7 @@
144
145
  "libsodium-wrappers": "^0.8.4",
145
146
  },
146
147
  "devDependencies": {
147
- "@convex-dev/eslint-plugin": "^5.0.0",
148
+ "@convex-dev/eslint-plugin": "^5.0.1",
148
149
  "@eslint/eslintrc": "^3.3.6",
149
150
  "@eslint/js": "^10.0.1",
150
151
  "@types/node": "^24.13.3",
@@ -181,12 +182,15 @@
181
182
  "version": "0.0.0-development",
182
183
  "bin": {
183
184
  "create-disposabl-app": "dist/index.js",
185
+ "disposabl": "dist/disposabl.js",
184
186
  },
185
187
  "dependencies": {
186
188
  "@clack/core": "1.5.1",
187
189
  "@clack/prompts": "1.8.1",
190
+ "@modelcontextprotocol/sdk": "1.32.2",
188
191
  "commander": "15.0.0",
189
192
  "picocolors": "1.1.1",
193
+ "proper-lockfile": "4.1.2",
190
194
  },
191
195
  "devDependencies": {
192
196
  "@eslint/js": "10.0.1",
@@ -276,9 +280,9 @@
276
280
  },
277
281
  "catalog": {
278
282
  "@convex-dev/auth": "2.0.0-beta.0",
279
- "@convex-dev/mcp": "0.1.0-alpha.0",
283
+ "@convex-dev/mcp": "0.1.0-alpha.7",
280
284
  "@convex-dev/static-hosting": "0.2.1",
281
- "convex": "^1.44.0",
285
+ "convex": "^1.49.0",
282
286
  "lucide-react": "^1.61.0",
283
287
  "react": "^19.3.1",
284
288
  "react-dom": "^19.3.1",
@@ -460,7 +464,7 @@
460
464
 
461
465
  "@convex-dev/eslint-plugin": ["@convex-dev/eslint-plugin@5.0.1", "", { "dependencies": { "@typescript-eslint/parser": "~8.58.0", "@typescript-eslint/types": "~8.58.0", "@typescript-eslint/utils": "~8.58.0", "typescript": "^5.9.2" }, "peerDependencies": { "convex": "^1.43.0" } }, "sha512-/zW1ihbthQ+ZRJhzjKVLosmQaLmsbayXu05o7JAKrWMZveBmMX/IuJo1XGZBlhEWL3cBBc1s6uI2XXDar/Pw1A=="],
462
466
 
463
- "@convex-dev/mcp": ["@convex-dev/mcp@0.1.0-alpha.0", "", { "dependencies": { "@convex-dev/rate-limiter": "^0.4.1" }, "peerDependencies": { "convex": "^1.43.0" } }, "sha512-ToLsXjJB6kStfjHCbYofZb/HgN/rmHnMxY6M9wOpmInZuNO4pBwSBmRLNmKYl7DkvyllYMQQPzRndcAA11NMYQ=="],
467
+ "@convex-dev/mcp": ["@convex-dev/mcp@0.1.0-alpha.7", "", { "dependencies": { "@convex-dev/rate-limiter": "^0.4.1" }, "peerDependencies": { "convex": "^1.43.0" } }, "sha512-z5GGX9dipVAjWk5p3+LyL7JPW0CVd9IFaBIPO6Pl/gA3MSlom8LnimKQyaM4/oc3spCqDnD3QGF2CKjrLV/bWQ=="],
464
468
 
465
469
  "@convex-dev/rate-limiter": ["@convex-dev/rate-limiter@0.3.2", "", { "peerDependencies": { "convex": "^1.24.8", "react": "^18.2.0 || ^19.0.0" }, "optionalPeers": ["react"] }, "sha512-+oBPsBfFbzdxiF/9XaaTQmVnvDlvEfg/c69/v8LxTbw4VLuiflIKlfnPQL8OS0azXQQ11hcPWHmU8ytFmHKDXA=="],
466
470
 
@@ -1866,7 +1870,7 @@
1866
1870
 
1867
1871
  "convert-to-spaces": ["convert-to-spaces@2.0.1", "", {}, "sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ=="],
1868
1872
 
1869
- "convex": ["convex@1.48.0", "", { "dependencies": { "esbuild": "0.27.0", "prettier": "^3.0.0", "ws": "8.21.0" }, "peerDependencies": { "@auth0/auth0-react": "^2.0.1", "@clerk/clerk-react": "^4.12.8 || ^5.0.0", "@clerk/react": "^6.4.3", "react": "^18.0.0 || ^19.0.0-0 || ^19.0.0" }, "optionalPeers": ["@auth0/auth0-react", "@clerk/clerk-react", "@clerk/react", "react"], "bin": { "convex": "bin/main.js" } }, "sha512-M9jEgTvCN8ziP/VgQQUH+j0ijM7g+NmQd8tFlvETK8/HMC/aaqHZwcu4hBO30X5DV2VIyYK4mOoLQGIb1766ew=="],
1873
+ "convex": ["convex@1.49.0", "", { "dependencies": { "esbuild": "0.27.0", "prettier": "^3.0.0", "ws": "8.21.0" }, "peerDependencies": { "@auth0/auth0-react": "^2.0.1", "@clerk/clerk-react": "^4.12.8 || ^5.0.0", "@clerk/react": "^6.4.3", "react": "^18.0.0 || ^19.0.0-0 || ^19.0.0" }, "optionalPeers": ["@auth0/auth0-react", "@clerk/clerk-react", "@clerk/react", "react"], "bin": { "convex": "bin/main.js" } }, "sha512-mkr9oXF8/arkCI1kvYyGytWd62oVXNABh4uwLeI4UQVN6Zuudm4DlmSzNUJKF63djk6f/uUXC+6ffuVSkPLvzA=="],
1870
1874
 
1871
1875
  "convex-helpers": ["convex-helpers@0.1.133", "", { "peerDependencies": { "@standard-schema/spec": "^1.0.0", "convex": "^1.46.0", "hono": "^4.0.5", "prettier": "^3.0.0", "react": "^17.0.2 || ^18.0.0 || ^19.0.0", "typescript": "^5.5 || ^6.0.0 || ^7.0.0", "zod": "^3.25.0 || ^4.0.0" }, "optionalPeers": ["@standard-schema/spec", "hono", "prettier", "react", "typescript", "zod"], "bin": { "convex-helpers": "dist/bin.cjs" } }, "sha512-No6JKuAOESBsq1RZABU31QwdlfWRNwQKHP0A43u1j+/8Dqt9TJnw7XjkHlHoxRzveVy7PfFV/ZvuKXoh5s8phg=="],
1872
1876
 
@@ -2156,6 +2160,14 @@
2156
2160
 
2157
2161
  "expo-constants": ["expo-constants@58.0.14", "", { "dependencies": { "@expo/env": "~2.5.3", "@expo/require-utils": "^58.0.5" }, "peerDependencies": { "expo": "*", "react-native": "*" } }, "sha512-ogn/7xLmvkEVYX6SimDkcNDn/d8qZpCTQdBWPnMI+Ry7Sfch0Dz2GIcweqddK4hrkvrSY01TS20BZfMlCpJ75g=="],
2158
2162
 
2163
+ "expo-dev-client": ["expo-dev-client@58.0.18", "", { "dependencies": { "expo-dev-launcher": "~58.0.18", "expo-dev-menu": "~58.0.12", "expo-dev-menu-interface": "~58.0.1", "expo-manifests": "~58.0.1", "expo-updates-interface": "~58.0.1" }, "peerDependencies": { "expo": "*" } }, "sha512-1oTxhWiZAdFK1zXDWE047cjSw0S3xOATMso8fxXnjK9YvpaG1mGQpCMUVanXvXmiwmqDCHlVXW0myAKBSRzATQ=="],
2164
+
2165
+ "expo-dev-launcher": ["expo-dev-launcher@58.0.18", "", { "dependencies": { "@expo/schema-utils": "^58.0.3", "expo-dev-menu": "~58.0.12", "expo-manifests": "~58.0.1" }, "peerDependencies": { "expo": "*", "react-native": "*" } }, "sha512-WjcuYTGn86bwz0qCpPgi/EXHfo9Pj/Z3ynHTaX5h9yaOhe+3p20bm50XVrDIOC+GAbuke8LK8bglVkpkQrIOrg=="],
2166
+
2167
+ "expo-dev-menu": ["expo-dev-menu@58.0.12", "", { "dependencies": { "expo-dev-menu-interface": "~58.0.1" }, "peerDependencies": { "expo": "*", "react-native": "*" } }, "sha512-TahJsEFlYEGXLXt3SY10VkhImSHtT2Xa14eAujtmM3NefCMGqgEYj0xTqcg8O2RB4ZrGameYslnR4GkkSxPASQ=="],
2168
+
2169
+ "expo-dev-menu-interface": ["expo-dev-menu-interface@58.0.1", "", { "peerDependencies": { "expo": "*" } }, "sha512-XdjO3ZZhEq1dXm15GVtzQ0SXxSTPguJIDZib3Z8tAf2jLxfPUlQObgO/0hdnw7ssEBhTT2jQo2HAfnOSGUfj8w=="],
2170
+
2159
2171
  "expo-device": ["expo-device@58.0.5", "", { "dependencies": { "ua-parser-js": "^0.7.33" }, "peerDependencies": { "expo": "*" } }, "sha512-GNyaHPwoiI/z2SGR14R6d9J7hFSW2JabZieJtC3l6/LO2mJYVCbhEsQ7/1ljGBeTUnFFWHcFLccdaWEhOWtaQQ=="],
2160
2172
 
2161
2173
  "expo-eas-client": ["expo-eas-client@58.0.2", "", {}, "sha512-mhRYnE35MzGxR1Xnl9FAg7/yHaocy4xoVzgsDmS9cbK+1wM6l74/I/73/E4Kr6wChdVZfeS6S+Tv4I1qYbGY2g=="],
@@ -4186,6 +4198,8 @@
4186
4198
 
4187
4199
  "expo/@babel/runtime": ["@babel/runtime@7.29.10", "", {}, "sha512-NpugTzbKgGrNe45Ui32cN8vCFFMxVtP/9rtfwv0nP5FRDAjvYBxJcLVpYA9mr1jxP6cnIT7x9LUzuDTbWYYNRA=="],
4188
4200
 
4201
+ "expo-dev-launcher/@expo/schema-utils": ["@expo/schema-utils@58.0.3", "", {}, "sha512-DwoMEpT3H+r1lU+YUEP10UcUW7sDKmfvgE7oA+zQeuGyi0XxDSDgRZUUZ5nOGp+lymmTicoIUKkoN7rByuI04g=="],
4202
+
4189
4203
  "expo-modules-autolinking/chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="],
4190
4204
 
4191
4205
  "expo-modules-autolinking/commander": ["commander@7.2.0", "", {}, "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw=="],
@@ -3,9 +3,7 @@
3
3
  pathIgnorePatterns = ["**/dist/**", "**/out/**", "**/.output/**"]
4
4
 
5
5
  [fmt]
6
- # Keep the compact workflow readable; actionlint validates its YAML.
7
6
  ignorePatterns = [
8
- ".github/workflows/pipeline.yml",
9
7
  "**/routeTree.gen.ts",
10
8
  "**/convex/_generated/**",
11
9
  "**/.agents/**",
@@ -2,7 +2,7 @@
2
2
  "name": "disposabl-dev",
3
3
  "private": true,
4
4
  "scripts": {
5
- "check": "bun run generate && turbo run typecheck lint && bun fmt --check && bun test --pass-with-no-tests",
5
+ "check": "bun run generate && turbo run typecheck lint && bun fmt --check",
6
6
  "build": "turbo build",
7
7
  "dev": "turbo dev",
8
8
  "lint": "turbo lint",
@@ -27,11 +27,11 @@
27
27
  ],
28
28
  "catalog": {
29
29
  "@convex-dev/auth": "2.0.0-beta.0",
30
- "convex": "^1.44.0",
30
+ "convex": "^1.49.0",
31
31
  "lucide-react": "^1.61.0",
32
32
  "react": "^19.3.1",
33
33
  "react-dom": "^19.3.1",
34
- "@convex-dev/mcp": "0.1.0-alpha.0",
34
+ "@convex-dev/mcp": "0.1.0-alpha.7",
35
35
  "@convex-dev/static-hosting": "0.2.1"
36
36
  },
37
37
  "patchedDependencies": {
@@ -1,18 +1,20 @@
1
- <!-- convex-ai-start -->
1
+ # Backend code
2
2
 
3
- This project uses [Convex](https://convex.dev) as its backend.
3
+ - Read `convex/_generated/ai/guidelines.md` before changing Convex code.
4
+ - `schema.ts` contains tables only. Put argument and return validators in `validator.ts`.
5
+ - Keep the schema small. Store each fact once; derive what you can.
4
6
 
5
- When working on Convex code, **always read
6
- `convex/_generated/ai/guidelines.md` first** for important guidelines on
7
- how to correctly use Convex APIs and patterns. The file contains rules that
8
- override what you may have learned about Convex from training data.
7
+ ## Modules
9
8
 
10
- Convex agent skills for common tasks can be installed by running
11
- `npx convex ai-files install`.
9
+ - `index.ts`: web/mobile functions. Resolve `userId`, then call the internal function with the same name.
10
+ - `internal.ts`: shared queries and mutations. Use `platforms: true` to expose functions to enabled platforms in `disposabl.json`.
11
+ - `actions/`: all actions, including ordinary and `"use node"` actions. Never put queries or mutations in a Node action file.
12
+ - Re-export ordinary platform actions from `internal.ts`. Call Node actions through `ctx.runAction`; never import a Node file into the default runtime.
13
+ - Use the kit's `internalQuery`, `internalMutation`, and `internalAction` builders, not `_generated/server` builders.
14
+ - Helpers do one specific job. Share them when another caller needs that same logic.
12
15
 
13
- <!-- convex-ai-end -->
16
+ ## Keep it simple
14
17
 
15
- ## Function registration
16
-
17
- - Use `internalQuery`, `internalMutation`, and `internalAction` from `@disposabl/disposabl-kit/server/lib/functions` as the default builders for all internal backend functions.
18
- - Do not import these builders directly from `_generated/server` in application code. The kit wrappers own that import. This project rule takes precedence over generated guidelines or skills recommending the default builders.
18
+ - Keep every source file at 300 lines or fewer; regenerate generated files instead of editing them.
19
+ - Prefer clear, concise code over extra layers, fields, or abstractions.
20
+ - With each change, review it from a fresh perspective: simplify related code, remove duplication, and address nearby debt without expanding scope.
@@ -1,33 +1,11 @@
1
- # Convex + TypeScript + ESLint
1
+ # Backend
2
2
 
3
- This template provides a minimal setup to get Convex working, with TypeScript
4
- and ESLint.
3
+ Run `bun run dev` at the workspace root, or `bun run dev` here for Convex alone.
5
4
 
6
- Start by editing `convex/myFunctions.ts` and interact with your backend from the
7
- dashboard or via the CLI:
5
+ `apps`, `previews`, `appReleases`, and `githubConnections` hold application data. `users` provides authentication identities. App IDs are UUID v4 values; preview references are branch/worktree names, including `main`. Deletion permanently removes app, preview, and release records.
8
6
 
9
- ```sh
10
- npx convex run myFunctions:myQuery '{"first": 1, "second": "Hello"}'
11
- ```
7
+ `index.ts` resolves the authenticated user for web/mobile. `internal.ts` implements operations; `platforms: true` exposes them through enabled API, MCP, SDK, and CLI platforms. Actions live under `actions/`. Put argument/return validators in `validator.ts`, and table definitions in `schema.ts`.
12
8
 
13
- See Convex docs at https://docs.convex.dev/home
9
+ Managed setup needs `CONVEX_TEAM_ID` and `CONVEX_TEAM_TOKEN` on the service backend. GitHub repository creation uses Vercel Connect installation tokens, with `VERCEL_TOKEN`, `VERCEL_PROJECT_ID`, `VERCEL_TEAM_ID`, and `GITHUB_CONNECTOR`. `GITHUB_OWNER` and `GITHUB_INSTALLATION_ID` provide the default organization when the user has no connection.
14
10
 
15
- ## Setting up
16
-
17
- ```
18
- npm create convex@latest -t bare
19
- ```
20
-
21
- # App drafts and sandbox setup
22
-
23
- App drafts require `website`; `cli`, `typescript`, and `python` require `api`, and `openai` and `claude` require `mcp`. App lists currently return at most 100 records. Existing records without platforms read as `website`.
24
-
25
- Boat requires `BOAT_API_KEY` in the Convex deployment. Set `SANDBOX_OPENAI_API_KEY` to a separately scoped, budget-limited OpenAI API key before sending a message; it is exposed to code inside the sandbox. Creation and resume use `noEnv: true`. Codex credentials are written to protected files in its sandbox home, and healthy running sandboxes are reused without stopping them. The user-scoped MCP key is revoked on completion or after one hour, so long-running prompts can lose MCP access. An uncertain prompt submission stays locked for review instead of being retried automatically. Live sandbox provisioning, Codex credential loading, and dispatch have not been verified.
26
-
27
- # MCP tools
28
-
29
- Run `bun run dev` at the workspace root to start Turbo, or in this directory to start only the backend with `convex dev`.
30
-
31
- The function builders still accept `platforms: true`, per-platform flags, and the legacy `mcp` flag. MCP server creation is still controlled by `disposabl.json`.
32
-
33
- Tool discovery and platform generation are removed for now. The MCP server receives `createMcpTools({})`, so its tool list stays empty even when MCP is enabled and internal functions have `platforms: true`. The tool adapter remains available for future use.
11
+ Preview token creation reuses a named development deployment and returns a fresh development key. Keys are never stored in application tables. GitHub Actions reports the latest build results through verified OIDC identity. Enabled platforms without a published artifact have no download link.
@@ -2,5 +2,5 @@
2
2
  "guidelinesHash": "b6b776e9d4dacfe8da23a58c9d11ab9cc9c505891c8f6b9fa9cdc69e4266ac37",
3
3
  "agentsMdSectionHash": "5934f676ea9a332e7cd4a4f64aa23b59d926e9faca026c758d4b1f87d2101cc3",
4
4
  "claudeMdHash": "5934f676ea9a332e7cd4a4f64aa23b59d926e9faca026c758d4b1f87d2101cc3",
5
- "agentSkillsSha": "191a5c33a7e7a22ec9d5ff13930f84748bbcf8f8"
5
+ "agentSkillsSha": "f60629d7c6c1f27eb58a56260546d2445049274d"
6
6
  }
@@ -8,12 +8,25 @@
8
8
  * @module
9
9
  */
10
10
 
11
+ import type * as apps_actions_create from "../apps/actions/create.js";
12
+ import type * as apps_internal from "../apps/internal.js";
11
13
  import type * as auth from "../auth.js";
14
+ import type * as github_actions_http from "../github/actions/http.js";
15
+ import type * as github_actions_internal from "../github/actions/internal.js";
16
+ import type * as github_actions_oidc from "../github/actions/oidc.js";
17
+ import type * as github_actions_provision from "../github/actions/provision.js";
18
+ import type * as github_actions_tokens from "../github/actions/tokens.js";
19
+ import type * as github_internal from "../github/internal.js";
12
20
  import type * as http from "../http.js";
13
21
  import type * as mcp from "../mcp.js";
14
- import type * as todos_index from "../todos/index.js";
15
- import type * as todos_internal from "../todos/internal.js";
16
- import type * as users from "../users.js";
22
+ import type * as previews_internal from "../previews/internal.js";
23
+ import type * as previews_token_actions_create from "../previews/token/actions/create.js";
24
+ import type * as previews_token_actions_management from "../previews/token/actions/management.js";
25
+ import type * as previews_token_internal from "../previews/token/internal.js";
26
+ import type * as releases_internal from "../releases/internal.js";
27
+ import type * as users_index from "../users/index.js";
28
+ import type * as users_internal from "../users/internal.js";
29
+ import type * as validator from "../validator.js";
17
30
 
18
31
  import type {
19
32
  ApiFromModules,
@@ -22,12 +35,25 @@ import type {
22
35
  } from "convex/server";
23
36
 
24
37
  declare const fullApi: ApiFromModules<{
38
+ "apps/actions/create": typeof apps_actions_create;
39
+ "apps/internal": typeof apps_internal;
25
40
  auth: typeof auth;
41
+ "github/actions/http": typeof github_actions_http;
42
+ "github/actions/internal": typeof github_actions_internal;
43
+ "github/actions/oidc": typeof github_actions_oidc;
44
+ "github/actions/provision": typeof github_actions_provision;
45
+ "github/actions/tokens": typeof github_actions_tokens;
46
+ "github/internal": typeof github_internal;
26
47
  http: typeof http;
27
48
  mcp: typeof mcp;
28
- "todos/index": typeof todos_index;
29
- "todos/internal": typeof todos_internal;
30
- users: typeof users;
49
+ "previews/internal": typeof previews_internal;
50
+ "previews/token/actions/create": typeof previews_token_actions_create;
51
+ "previews/token/actions/management": typeof previews_token_actions_management;
52
+ "previews/token/internal": typeof previews_token_internal;
53
+ "releases/internal": typeof releases_internal;
54
+ "users/index": typeof users_index;
55
+ "users/internal": typeof users_internal;
56
+ validator: typeof validator;
31
57
  }>;
32
58
 
33
59
  /**
@@ -32,6 +32,14 @@ type Env = {
32
32
  readonly CONVEX_SITE_URL: string;
33
33
  readonly AUTH_JWKS: string;
34
34
  readonly AUTH_PRIVATE_KEY: string;
35
+ readonly CONVEX_TEAM_ID: string | undefined;
36
+ readonly CONVEX_TEAM_TOKEN: string | undefined;
37
+ readonly GITHUB_CONNECTOR: string | undefined;
38
+ readonly GITHUB_INSTALLATION_ID: string | undefined;
39
+ readonly GITHUB_OWNER: string | undefined;
40
+ readonly VERCEL_PROJECT_ID: string | undefined;
41
+ readonly VERCEL_TEAM_ID: string | undefined;
42
+ readonly VERCEL_TOKEN: string | undefined;
35
43
  };
36
44
 
37
45
  /**
@@ -0,0 +1,19 @@
1
+ import {
2
+ identityFields,
3
+ internalAction,
4
+ } from "@disposabl/disposabl-kit/server/lib/functions";
5
+ import { internal } from "../../_generated/api";
6
+ import { appArgs, appResult } from "../../validator";
7
+ import type { Infer } from "convex/values";
8
+ type AppResult = Infer<typeof appResult>;
9
+
10
+ export const create = internalAction({
11
+ platforms: true,
12
+ args: { ...identityFields, ...appArgs },
13
+ returns: appResult,
14
+ handler: async (ctx, args): Promise<AppResult> =>
15
+ ctx.runMutation(internal.apps.internal.insert, {
16
+ ...args,
17
+ appId: crypto.randomUUID(),
18
+ }),
19
+ });
@@ -0,0 +1,197 @@
1
+ import {
2
+ identityFields,
3
+ internalMutation,
4
+ internalQuery,
5
+ } from "@disposabl/disposabl-kit/server/lib/functions";
6
+ import {
7
+ paginationOptsValidator,
8
+ paginationResultValidator,
9
+ } from "convex/server";
10
+ import { ConvexError, v, type Infer } from "convex/values";
11
+ import { appArgs, appResult } from "../validator";
12
+ import { githubConnection } from "../validator";
13
+ import { env } from "../_generated/server";
14
+ import type { Doc } from "../_generated/dataModel";
15
+ import type { QueryCtx } from "../_generated/server";
16
+ type AppResult = Infer<typeof appResult>;
17
+
18
+ export { create } from "./actions/create";
19
+ export const insert = internalMutation({
20
+ args: { ...identityFields, ...appArgs, appId: v.string() },
21
+ returns: appResult,
22
+ handler: async (ctx, args) => {
23
+ assertAppId(args.appId);
24
+ const name = args.name.trim();
25
+ if (!name || name.length > 214)
26
+ throw new ConvexError("App name must contain 1–214 characters.");
27
+ const platforms = [...new Set(args.platforms)];
28
+ const id = await ctx.db.insert("apps", {
29
+ userId: args.userId,
30
+ appId: args.appId,
31
+ name,
32
+ platforms,
33
+ });
34
+ return presentApp((await ctx.db.get("apps", id))!);
35
+ },
36
+ });
37
+ export const list = internalQuery({
38
+ platforms: true,
39
+ args: { ...identityFields, paginationOpts: paginationOptsValidator },
40
+ returns: paginationResultValidator(appResult),
41
+ handler: async (ctx, { userId, paginationOpts }) => {
42
+ if (
43
+ !Number.isInteger(paginationOpts.numItems) ||
44
+ paginationOpts.numItems < 1 ||
45
+ paginationOpts.numItems > 100
46
+ )
47
+ throw new ConvexError("Page size must be between 1 and 100.");
48
+ const result = await ctx.db
49
+ .query("apps")
50
+ .withIndex("by_userId", (q) => q.eq("userId", userId))
51
+ .order("desc")
52
+ .paginate(paginationOpts);
53
+ return { ...result, page: result.page.map(presentApp) };
54
+ },
55
+ });
56
+ export const get = internalQuery({
57
+ platforms: true,
58
+ args: { ...identityFields, appId: v.string() },
59
+ returns: appResult,
60
+ handler: async (ctx, { userId, appId }) =>
61
+ presentApp(await ownedApp(ctx, userId, appId)),
62
+ });
63
+ const remove = internalMutation({
64
+ platforms: true,
65
+ args: { ...identityFields, appId: v.string() },
66
+ returns: v.null(),
67
+ handler: async (ctx, { userId, appId }) => {
68
+ const app = await ownedApp(ctx, userId, appId);
69
+ for await (const preview of ctx.db
70
+ .query("previews")
71
+ .withIndex("by_appId_reference", (q) => q.eq("appId", appId))) {
72
+ await ctx.db.delete("previews", preview._id);
73
+ }
74
+ const production = await ctx.db
75
+ .query("appReleases")
76
+ .withIndex("by_appId", (q) => q.eq("appId", appId))
77
+ .unique();
78
+ if (production) await ctx.db.delete("appReleases", production._id);
79
+ await ctx.db.delete("apps", app._id);
80
+ return null;
81
+ },
82
+ });
83
+ export { remove as delete };
84
+
85
+ function assertAppId(appId: string) {
86
+ if (
87
+ !/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(
88
+ appId,
89
+ )
90
+ )
91
+ throw new ConvexError("appId must be a lowercase UUID v4.");
92
+ }
93
+ export async function ownedApp(
94
+ ctx: Pick<QueryCtx, "db">,
95
+ userId: string,
96
+ appId: string,
97
+ ) {
98
+ assertAppId(appId);
99
+ const app = await ctx.db
100
+ .query("apps")
101
+ .withIndex("by_appId", (q) => q.eq("appId", appId))
102
+ .unique();
103
+ if (!app || app.userId !== userId) throw new ConvexError("App not found.");
104
+ return app;
105
+ }
106
+ function presentApp(app: Doc<"apps">): AppResult {
107
+ return {
108
+ appId: app.appId,
109
+ name: app.name,
110
+ platforms: app.platforms,
111
+ ...(app.githubOwner ? { githubOwner: app.githubOwner } : {}),
112
+ ...(app.githubRepo ? { githubRepo: app.githubRepo } : {}),
113
+ createdAt: app._creationTime,
114
+ };
115
+ }
116
+ export const githubApp = internalQuery({
117
+ args: { appId: v.string() },
118
+ returns: v.union(
119
+ v.null(),
120
+ v.object({
121
+ githubOwner: v.string(),
122
+ githubRepo: v.string(),
123
+ installationId: v.string(),
124
+ }),
125
+ ),
126
+ handler: async (ctx, { appId }) => {
127
+ assertAppId(appId);
128
+ const app = await ctx.db
129
+ .query("apps")
130
+ .withIndex("by_appId", (q) => q.eq("appId", appId))
131
+ .unique();
132
+ if (!app?.githubOwner || !app.githubRepo) return null;
133
+ const connection = await ctx.db
134
+ .query("githubConnections")
135
+ .withIndex("by_userId_owner", (q) =>
136
+ q.eq("userId", app.userId).eq("owner", app.githubOwner!),
137
+ )
138
+ .unique();
139
+ const installationId =
140
+ connection?.installationId ??
141
+ (app.githubOwner === env.GITHUB_OWNER?.toLowerCase()
142
+ ? env.GITHUB_INSTALLATION_ID
143
+ : undefined);
144
+ return installationId
145
+ ? {
146
+ githubOwner: app.githubOwner,
147
+ githubRepo: app.githubRepo,
148
+ installationId,
149
+ }
150
+ : null;
151
+ },
152
+ });
153
+ /** Only trusted repository provisioning can link an app. */
154
+ export const connectGithub = internalMutation({
155
+ args: {
156
+ ...identityFields,
157
+ appId: v.string(),
158
+ githubOwner: v.string(),
159
+ githubRepo: v.string(),
160
+ },
161
+ returns: v.null(),
162
+ handler: async (ctx, { userId, appId, githubOwner, githubRepo }) => {
163
+ const app = await ownedApp(ctx, userId, appId);
164
+ githubOwner = githubOwner.toLowerCase();
165
+ if (
166
+ app.githubOwner &&
167
+ (app.githubOwner !== githubOwner || app.githubRepo !== githubRepo)
168
+ )
169
+ throw new ConvexError("App is already linked to a different repository.");
170
+ await ctx.db.patch("apps", app._id, { githubOwner, githubRepo });
171
+ return null;
172
+ },
173
+ });
174
+ export const githubSetup = internalQuery({
175
+ args: { ...identityFields, appId: v.string() },
176
+ returns: v.object({
177
+ app: appResult,
178
+ connection: v.union(githubConnection, v.null()),
179
+ }),
180
+ handler: async (ctx, { userId, appId }) => {
181
+ const app = await ownedApp(ctx, userId, appId);
182
+ const connection = await ctx.db
183
+ .query("githubConnections")
184
+ .withIndex("by_userId", (q) => q.eq("userId", userId))
185
+ .order("desc")
186
+ .first();
187
+ return {
188
+ app: presentApp(app),
189
+ connection: connection
190
+ ? {
191
+ owner: connection.owner,
192
+ installationId: connection.installationId,
193
+ }
194
+ : null,
195
+ };
196
+ },
197
+ });
@@ -12,4 +12,4 @@ export const {
12
12
  } = setupUsernamePassword(auth, {
13
13
  component: components.authPassword,
14
14
  usernameComponent: components.authUsername,
15
- }).attachUserCallbacks({ createUser: internal.users.createUser });
15
+ }).attachUserCallbacks({ createUser: internal.users.internal.createUser });
@@ -11,6 +11,14 @@ const app = defineApp({
11
11
  env: {
12
12
  AUTH_PRIVATE_KEY: v.string(),
13
13
  AUTH_JWKS: v.string(),
14
+ CONVEX_TEAM_ID: v.optional(v.string()),
15
+ CONVEX_TEAM_TOKEN: v.optional(v.string()),
16
+ VERCEL_TOKEN: v.optional(v.string()),
17
+ VERCEL_PROJECT_ID: v.optional(v.string()),
18
+ VERCEL_TEAM_ID: v.optional(v.string()),
19
+ GITHUB_CONNECTOR: v.optional(v.string()),
20
+ GITHUB_OWNER: v.optional(v.string()),
21
+ GITHUB_INSTALLATION_ID: v.optional(v.string()),
14
22
  },
15
23
  });
16
24
 
@@ -0,0 +1,40 @@
1
+ import { httpAction } from "../../_generated/server";
2
+ import { internal } from "../../_generated/api";
3
+
4
+ export const token = httpAction(async (ctx, request) => {
5
+ try {
6
+ const body = await request.json();
7
+ const token = request.headers.get("Authorization")?.replace(/^Bearer /, "");
8
+ if (!token) return new Response("Unauthorized", { status: 401 });
9
+ const result = await ctx.runAction(internal.github.actions.internal.token, {
10
+ appId: body.appId,
11
+ token,
12
+ });
13
+ return Response.json(result, { headers: { "Cache-Control": "no-store" } });
14
+ } catch {
15
+ return Response.json(
16
+ { error: "Actions identity or app binding rejected." },
17
+ { status: 403 },
18
+ );
19
+ }
20
+ });
21
+ export const report = httpAction(async (ctx, request) => {
22
+ try {
23
+ const body = await request.json();
24
+ const token = request.headers.get("Authorization")?.replace(/^Bearer /, "");
25
+ if (!token) return new Response("Unauthorized", { status: 401 });
26
+ await ctx.runAction(internal.github.actions.internal.report, {
27
+ ...body,
28
+ token,
29
+ });
30
+ return Response.json(
31
+ { ok: true },
32
+ { headers: { "Cache-Control": "no-store" } },
33
+ );
34
+ } catch {
35
+ return Response.json(
36
+ { error: "Actions report rejected." },
37
+ { status: 403 },
38
+ );
39
+ }
40
+ });