@liquidmetal-ai/raindrop 0.9.7 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -86
- package/bundle/{chunk-AWVSG5HH.js → chunk-2GD7Q3YS.js} +1 -1
- package/bundle/{chunk-FYMUM7KM.js → chunk-2QH4PO44.js} +1 -1
- package/bundle/{chunk-2KEFV5U5.js → chunk-3DZWEZ2R.js} +1 -1
- package/bundle/{chunk-FFKINGT5.js → chunk-45V47YNS.js} +4 -4
- package/bundle/{chunk-ILG4QJPW.js → chunk-4FXE4I6S.js} +2 -2
- package/bundle/{chunk-43UGYZQA.js → chunk-4RN4TIJI.js} +1 -1
- package/bundle/{chunk-OHP3SQGY.js → chunk-4U2CSHCN.js} +1 -1
- package/bundle/{chunk-T3VHOMDJ.js → chunk-4UUTGMDZ.js} +1 -1
- package/bundle/{chunk-6VCATADU.js → chunk-4WNBHWJP.js} +4 -4
- package/bundle/{chunk-CEFC4JXX.js → chunk-5KMI72AS.js} +1 -1
- package/bundle/{chunk-2HWWLWLM.js → chunk-5REFCZTG.js} +2 -2
- package/bundle/{chunk-ZEKMKKMJ.js → chunk-6BCRCAR4.js} +1 -1
- package/bundle/{chunk-YWKX37S2.js → chunk-7GDFE7HE.js} +3 -1
- package/bundle/{chunk-FV4QERYA.js → chunk-AI5PKHR7.js} +1 -1
- package/bundle/{chunk-WTTFYUHL.js → chunk-D5MXH3QV.js} +1 -1
- package/bundle/{chunk-GBFY2PMX.js → chunk-ETDAUGBG.js} +2 -2
- package/bundle/{chunk-O75RZNCU.js → chunk-GBUNP7OT.js} +2 -2
- package/bundle/{chunk-Z2VVSBIX.js → chunk-GRUPCK5H.js} +4 -4
- package/bundle/{chunk-XN52RPCA.js → chunk-JENN4EVA.js} +2 -2
- package/bundle/{chunk-KYP4ZWG7.js → chunk-JZYHHRGL.js} +2 -2
- package/bundle/{chunk-VW5YPIKL.js → chunk-LJKAU7FY.js} +30 -2
- package/bundle/{chunk-DSP542FN.js → chunk-MJZG4ABT.js} +1 -1
- package/bundle/{chunk-T7WFDN3I.js → chunk-MZZHXHB4.js} +4 -4
- package/bundle/{chunk-RUORC7A6.js → chunk-ORUMKXQZ.js} +2 -2
- package/bundle/{chunk-B4MQISI4.js → chunk-PMHLHYMI.js} +4 -4
- package/bundle/{chunk-4NTUYQ5R.js → chunk-QRJUX37T.js} +1 -1
- package/bundle/chunk-QTCJ6YYG.js +147 -0
- package/bundle/{chunk-E7J2LWQ5.js → chunk-RAPSKVRO.js} +1 -1
- package/bundle/{chunk-BC3Z5E5X.js → chunk-U7NHRBYD.js} +1 -1
- package/bundle/{chunk-QN2OJEAL.js → chunk-WDR5M2SS.js} +25 -25
- package/bundle/{chunk-SPBJ5BNI.js → chunk-YXJU5KSB.js} +1 -1
- package/bundle/{chunk-6AU7I5YZ.js → chunk-ZQIPU6IX.js} +2 -2
- package/bundle/commands/annotation/get.js +3 -3
- package/bundle/commands/annotation/list.js +3 -3
- package/bundle/commands/annotation/put.js +3 -3
- package/bundle/commands/auth/list.js +2 -2
- package/bundle/commands/auth/login.js +3 -3
- package/bundle/commands/auth/logout.js +2 -2
- package/bundle/commands/auth/select.js +3 -3
- package/bundle/commands/bucket/create-credential.js +2 -2
- package/bundle/commands/bucket/delete-credential.js +2 -2
- package/bundle/commands/bucket/get-credential.js +2 -2
- package/bundle/commands/bucket/list-credentials.js +2 -2
- package/bundle/commands/build/branch.js +9 -9
- package/bundle/commands/build/checkout.js +6 -6
- package/bundle/commands/build/clone.js +7 -7
- package/bundle/commands/build/delete.js +6 -6
- package/bundle/commands/build/deploy.js +9 -9
- package/bundle/commands/build/env/get.js +2 -2
- package/bundle/commands/build/env/set.js +2 -2
- package/bundle/commands/build/find.js +4 -4
- package/bundle/commands/build/generate.js +3 -3
- package/bundle/commands/build/init-workspace.js +3 -3
- package/bundle/commands/build/init.js +3 -3
- package/bundle/commands/build/list.js +5 -5
- package/bundle/commands/build/sandbox.js +7 -7
- package/bundle/commands/build/start.js +2 -2
- package/bundle/commands/build/status.js +5 -5
- package/bundle/commands/build/stop.js +2 -2
- package/bundle/commands/build/tools/check.js +2 -2
- package/bundle/commands/build/tools/fmt.js +2 -2
- package/bundle/commands/build/unsandbox.js +7 -7
- package/bundle/commands/build/upload.js +5 -5
- package/bundle/commands/build/validate.js +4 -4
- package/bundle/commands/build/workos/delete.js +4 -4
- package/bundle/commands/build/workos/env/attach.js +3 -3
- package/bundle/commands/build/workos/env/create.js +3 -3
- package/bundle/commands/build/workos/env/delete.js +3 -3
- package/bundle/commands/build/workos/env/detach.js +3 -3
- package/bundle/commands/build/workos/env/get.js +3 -3
- package/bundle/commands/build/workos/env/list.js +3 -3
- package/bundle/commands/build/workos/env/set.js +3 -3
- package/bundle/commands/build/workos/invite.js +3 -3
- package/bundle/commands/build/workos/setup.js +3 -3
- package/bundle/commands/build/workos/status.js +3 -3
- package/bundle/commands/dns/create.js +2 -2
- package/bundle/commands/dns/delete.js +4 -4
- package/bundle/commands/dns/get.js +4 -4
- package/bundle/commands/dns/list.js +3 -3
- package/bundle/commands/dns/records/create.js +2 -2
- package/bundle/commands/dns/records/delete.js +3 -3
- package/bundle/commands/dns/records/get.js +2 -2
- package/bundle/commands/dns/records/list.js +2 -2
- package/bundle/commands/dns/records/update.js +2 -2
- package/bundle/commands/logs/query.js +3 -3
- package/bundle/commands/logs/tail.js +3 -3
- package/bundle/commands/mcp/install-claude.js +2 -2
- package/bundle/commands/mcp/install-gemini.js +2 -2
- package/bundle/commands/mcp/install-goose.js +2 -2
- package/bundle/commands/mcp/status.js +2 -2
- package/bundle/commands/object/delete.js +2 -2
- package/bundle/commands/object/get.js +2 -2
- package/bundle/commands/object/list.js +73 -7
- package/bundle/commands/object/put.js +2 -2
- package/bundle/commands/query/chunk-search.js +3 -3
- package/bundle/commands/query/document.js +3 -3
- package/bundle/commands/query/events.js +2 -2
- package/bundle/commands/query/reindex.js +2 -2
- package/bundle/commands/query/search.js +3 -3
- package/bundle/commands/tail.js +2 -2
- package/bundle/index.js +1 -1
- package/dist/build.test.d.ts +2 -0
- package/dist/build.test.d.ts.map +1 -0
- package/dist/build.test.js +46 -0
- package/dist/codegen.test.d.ts +2 -0
- package/dist/codegen.test.d.ts.map +1 -0
- package/dist/codegen.test.js +223 -0
- package/dist/commands/logs/tail.test.d.ts +2 -0
- package/dist/commands/logs/tail.test.d.ts.map +1 -0
- package/dist/commands/logs/tail.test.js +366 -0
- package/dist/commands/object/list.d.ts.map +1 -1
- package/dist/commands/object/list.js +91 -4
- package/dist/config.test.d.ts +2 -0
- package/dist/config.test.d.ts.map +1 -0
- package/dist/config.test.js +27 -0
- package/dist/index.test.d.ts +2 -0
- package/dist/index.test.d.ts.map +1 -0
- package/dist/index.test.js +56 -0
- package/oclif.manifest.json +2058 -2058
- package/package.json +4 -4
- package/templates/db/node_modules/.bin/prisma +2 -2
- package/templates/db/node_modules/.bin/prisma-kysely +2 -2
- package/templates/db/node_modules/.bin/tsc +3 -7
- package/templates/db/node_modules/.bin/tsserver +3 -7
- package/templates/db/node_modules/.bin/zx +2 -2
- package/templates/init/RAINDROP.md.hbs +26 -22
- package/templates/init/src/_app/cors.ts +5 -4
- package/bundle/chunk-B6JLI47W.js +0 -315
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liquidmetal-ai/raindrop",
|
|
3
3
|
"description": "CLI for the Raindrop platform",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.10.0",
|
|
5
5
|
"author": "bosgood",
|
|
6
6
|
"bin": {
|
|
7
7
|
"raindrop": "./bin/run.js"
|
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
"@connectrpc/connect": "^2.0.2",
|
|
13
13
|
"@connectrpc/connect-web": "^2.0.2",
|
|
14
14
|
"@inquirer/prompts": "^7.0.0",
|
|
15
|
-
"@liquidmetal-ai/drizzle": "^0.9.2",
|
|
16
|
-
"@liquidmetal-ai/raindrop-framework": "^0.9.2",
|
|
17
15
|
"@oclif/core": "^4",
|
|
18
16
|
"@oclif/plugin-help": "^6",
|
|
19
17
|
"@oclif/plugin-plugins": "^5",
|
|
@@ -38,7 +36,9 @@
|
|
|
38
36
|
"semver": "^7.7.2",
|
|
39
37
|
"typescript": "^5",
|
|
40
38
|
"zod": "^3.23.8",
|
|
41
|
-
"zx": "^8.1.9"
|
|
39
|
+
"zx": "^8.1.9",
|
|
40
|
+
"@liquidmetal-ai/drizzle": "0.10.0",
|
|
41
|
+
"@liquidmetal-ai/raindrop-framework": "0.10.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@changesets/cli": "^2.27.9",
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/Users/
|
|
13
|
+
export NODE_PATH="/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/prisma@6.10.1_typescript@5.9.2/node_modules/prisma/build/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/prisma@6.10.1_typescript@5.9.2/node_modules/prisma/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/prisma@6.10.1_typescript@5.9.2/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/Users/
|
|
15
|
+
export NODE_PATH="/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/prisma@6.10.1_typescript@5.9.2/node_modules/prisma/build/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/prisma@6.10.1_typescript@5.9.2/node_modules/prisma/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/prisma@6.10.1_typescript@5.9.2/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/prisma@6.10.1_typescript@5.9.2/node_modules/prisma/build/index.js" "$@"
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/Users/
|
|
13
|
+
export NODE_PATH="/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/prisma-kysely@1.8.0/node_modules/prisma-kysely/dist/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/prisma-kysely@1.8.0/node_modules/prisma-kysely/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/prisma-kysely@1.8.0/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/Users/
|
|
15
|
+
export NODE_PATH="/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/prisma-kysely@1.8.0/node_modules/prisma-kysely/dist/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/prisma-kysely@1.8.0/node_modules/prisma-kysely/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/prisma-kysely@1.8.0/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/prisma-kysely@1.8.0/node_modules/prisma-kysely/dist/bin.js" "$@"
|
|
@@ -2,17 +2,13 @@
|
|
|
2
2
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
3
|
|
|
4
4
|
case `uname` in
|
|
5
|
-
*CYGWIN
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
10
6
|
esac
|
|
11
7
|
|
|
12
8
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/Users/
|
|
9
|
+
export NODE_PATH="/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/bin/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/typescript@5.9.2/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/node_modules"
|
|
14
10
|
else
|
|
15
|
-
export NODE_PATH="/Users/
|
|
11
|
+
export NODE_PATH="/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/bin/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/typescript@5.9.2/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
12
|
fi
|
|
17
13
|
if [ -x "$basedir/node" ]; then
|
|
18
14
|
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/bin/tsc" "$@"
|
|
@@ -2,17 +2,13 @@
|
|
|
2
2
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
3
|
|
|
4
4
|
case `uname` in
|
|
5
|
-
*CYGWIN
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
10
6
|
esac
|
|
11
7
|
|
|
12
8
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/Users/
|
|
9
|
+
export NODE_PATH="/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/bin/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/typescript@5.9.2/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/node_modules"
|
|
14
10
|
else
|
|
15
|
-
export NODE_PATH="/Users/
|
|
11
|
+
export NODE_PATH="/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/bin/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/typescript@5.9.2/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
12
|
fi
|
|
17
13
|
if [ -x "$basedir/node" ]; then
|
|
18
14
|
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/bin/tsserver" "$@"
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/Users/
|
|
13
|
+
export NODE_PATH="/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/zx@8.6.0/node_modules/zx/build/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/zx@8.6.0/node_modules/zx/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/zx@8.6.0/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/Users/
|
|
15
|
+
export NODE_PATH="/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/zx@8.6.0/node_modules/zx/build/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/zx@8.6.0/node_modules/zx/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/zx@8.6.0/node_modules:/Users/mattbarto/code/liquidmetal/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/zx@8.6.0/node_modules/zx/build/cli.js" "$@"
|
|
@@ -14,8 +14,8 @@ A Raindrop application built with Hono.js and modern web technologies.
|
|
|
14
14
|
|
|
15
15
|
1. **Initialize your project** (already done if you're reading this)
|
|
16
16
|
```bash
|
|
17
|
-
raindrop build init
|
|
18
|
-
|
|
17
|
+
raindrop build init .
|
|
18
|
+
npm install
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
2. **Generate initial code**
|
|
@@ -43,13 +43,15 @@ A Raindrop application built with Hono.js and modern web technologies.
|
|
|
43
43
|
| `raindrop build generate` | Generate TypeScript types and handler scaffolding | After changing `raindrop.manifest` |
|
|
44
44
|
| `raindrop build deploy --start` | Build, upload and start your application | When ready to deploy |
|
|
45
45
|
| `raindrop build stop` | Stop your running application | To stop services |
|
|
46
|
-
| `raindrop build status` | Check deployment status | To see current state
|
|
46
|
+
| `raindrop build status` | Check deployment status | To see current state |
|
|
47
|
+
| `raindrop build find` | Get service locations | To see current service URLs |
|
|
47
48
|
|
|
48
49
|
### Advanced Commands
|
|
49
50
|
|
|
50
51
|
| Command | Description | Example |
|
|
51
52
|
|---------|-------------|---------|
|
|
52
|
-
| `raindrop logs tail` | View logs | `raindrop logs tail
|
|
53
|
+
| `raindrop logs tail` | View real-time logs | `raindrop logs tail` |
|
|
54
|
+
| `raindrop logs query` | Query historical logs | `raindrop logs query --since 30s` |
|
|
53
55
|
|
|
54
56
|
### Utility Commands
|
|
55
57
|
|
|
@@ -64,9 +66,9 @@ A Raindrop application built with Hono.js and modern web technologies.
|
|
|
64
66
|
{{ applicationName }}/
|
|
65
67
|
├── src/
|
|
66
68
|
│ ├── _app/ # App-level configuration (see below)
|
|
67
|
-
│ └──
|
|
69
|
+
│ └── handlers/ # Your service/actor/observer handlers
|
|
68
70
|
├── db/ # Database migration files
|
|
69
|
-
│
|
|
71
|
+
│ └──<db_name>/ # Database-specific SQL migrations
|
|
70
72
|
│ ├── 0000_initial_schema.sql
|
|
71
73
|
│ ├── 0001_add_users_table.sql
|
|
72
74
|
│ └── ...
|
|
@@ -171,13 +173,13 @@ application "{{ applicationName }}" {
|
|
|
171
173
|
|
|
172
174
|
## Handler Examples
|
|
173
175
|
|
|
174
|
-
Your handlers are generated in `src/` with comprehensive examples:
|
|
176
|
+
Your handlers are generated in `src/handlers/` with comprehensive examples:
|
|
175
177
|
|
|
176
|
-
### HTTP Service
|
|
178
|
+
### HTTP Service (`src/handlers/http-service/`)
|
|
177
179
|
- ✅ **Working**: Basic Hono setup with `/health` and `/api/hello` endpoints
|
|
178
180
|
- 💡 **Examples**: Actor calls, SmartBucket operations, KV cache, queues (commented)
|
|
179
181
|
|
|
180
|
-
### Actor
|
|
182
|
+
### Actor (`src/handlers/actor/`)
|
|
181
183
|
- 💡 **Examples**: State management, SmartBucket integration, caching, alarms (commented)
|
|
182
184
|
|
|
183
185
|
### Other Handlers
|
|
@@ -222,10 +224,10 @@ raindrop build status
|
|
|
222
224
|
raindrop logs tail
|
|
223
225
|
|
|
224
226
|
# Query logs
|
|
225
|
-
raindrop logs
|
|
227
|
+
raindrop logs query --limit 100
|
|
226
228
|
|
|
227
229
|
# List resources
|
|
228
|
-
raindrop build
|
|
230
|
+
raindrop build list
|
|
229
231
|
```
|
|
230
232
|
|
|
231
233
|
### 4. Environment Variables
|
|
@@ -242,15 +244,10 @@ application "my-app" {
|
|
|
242
244
|
}
|
|
243
245
|
```
|
|
244
246
|
|
|
245
|
-
Set values:
|
|
246
|
-
```bash
|
|
247
|
-
raindrop build env set env:PUBLIC_KEY "my-public-key"
|
|
248
|
-
```
|
|
249
|
-
|
|
250
247
|
### 5. Resource Binding
|
|
251
248
|
Access bound resources in handlers:
|
|
252
249
|
```typescript
|
|
253
|
-
// In HTTP service
|
|
250
|
+
// In HTTP service
|
|
254
251
|
const smartbucket = c.env.MY_SMARTBUCKET; // Name from manifest
|
|
255
252
|
const cache = c.env.MY_CACHE_KV;
|
|
256
253
|
|
|
@@ -280,12 +277,19 @@ export default class extends Service<Env> {
|
|
|
280
277
|
### Updating Existing Code
|
|
281
278
|
1. Make code changes
|
|
282
279
|
2. Build TypeScript: `npm run build`
|
|
283
|
-
3.
|
|
280
|
+
3. Validate: `raindrop build validate`
|
|
281
|
+
4. Deploy: `raindrop build deploy`
|
|
284
282
|
|
|
285
283
|
### Branching for Development
|
|
286
284
|
```bash
|
|
287
|
-
# Create development branch
|
|
285
|
+
# Create development branch
|
|
288
286
|
raindrop build branch dev
|
|
287
|
+
|
|
288
|
+
# Switch to branch
|
|
289
|
+
raindrop build checkout dev
|
|
290
|
+
|
|
291
|
+
# Deploy to branch
|
|
292
|
+
raindrop build deploy
|
|
289
293
|
```
|
|
290
294
|
|
|
291
295
|
## Framework Features
|
|
@@ -314,7 +318,7 @@ raindrop build branch dev
|
|
|
314
318
|
|
|
315
319
|
Database migration files are automatically executed during deployment:
|
|
316
320
|
|
|
317
|
-
**Location**: `db/<db_name
|
|
321
|
+
**Location**: `db/<db_name>/<migration>`
|
|
318
322
|
|
|
319
323
|
**Naming Convention**: `4-digit_number_description.sql`
|
|
320
324
|
- `0000_initial_schema.sql`
|
|
@@ -343,9 +347,9 @@ CREATE TABLE users (
|
|
|
343
347
|
## Next Steps
|
|
344
348
|
|
|
345
349
|
1. **Explore the manifest** - Uncomment modules you need in `raindrop.manifest`
|
|
346
|
-
2. **Check the examples** - Browse handler templates in `src
|
|
350
|
+
2. **Check the examples** - Browse handler templates in `src/handlers/`
|
|
347
351
|
3. **Build something** - Start by uncommenting a service in the manifest
|
|
348
352
|
4. **Add intelligence** - Try SmartBucket for AI-powered features
|
|
349
|
-
5. **Scale up** - Add actors for background processing
|
|
353
|
+
5. **Scale up** - Add actors for background processing
|
|
350
354
|
|
|
351
355
|
Welcome to Raindrop! 🚀
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { corsDisabled } from '@liquidmetal-ai/raindrop-framework/core/cors';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* cors is the application-wide CORS (Cross-Origin Resource Sharing) handler.
|
|
@@ -6,8 +6,9 @@ import { corsAllowAll } from '@liquidmetal-ai/raindrop-framework/core/cors';
|
|
|
6
6
|
* This handler is automatically applied to all HTTP services in your application.
|
|
7
7
|
* You can override this per-handler by exporting a `cors` function from your handler.
|
|
8
8
|
*
|
|
9
|
-
* **Default Behavior (
|
|
10
|
-
*
|
|
9
|
+
* **Default Behavior (Secure):**
|
|
10
|
+
* By default, CORS is disabled for security. Browsers will block cross-origin requests
|
|
11
|
+
* to your API unless you explicitly configure allowed origins.
|
|
11
12
|
*
|
|
12
13
|
* **When to Enable CORS:**
|
|
13
14
|
* Enable CORS when you need to allow web applications from different domains to access
|
|
@@ -60,4 +61,4 @@ import { corsAllowAll } from '@liquidmetal-ai/raindrop-framework/core/cors';
|
|
|
60
61
|
* };
|
|
61
62
|
* ```
|
|
62
63
|
*/
|
|
63
|
-
export const cors =
|
|
64
|
+
export const cors = corsDisabled;
|
package/bundle/chunk-B6JLI47W.js
DELETED
|
@@ -1,315 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
source_default
|
|
3
|
-
} from "./chunk-AWVSG5HH.js";
|
|
4
|
-
import {
|
|
5
|
-
UnitState,
|
|
6
|
-
init_cjs_shims,
|
|
7
|
-
timestampDate,
|
|
8
|
-
valueOf
|
|
9
|
-
} from "./chunk-YWKX37S2.js";
|
|
10
|
-
|
|
11
|
-
// src/status.ts
|
|
12
|
-
init_cjs_shims();
|
|
13
|
-
import * as readline from "readline";
|
|
14
|
-
var statusString = {
|
|
15
|
-
[UnitState.UNSPECIFIED]: "<unknown>",
|
|
16
|
-
[UnitState.PENDING]: "pending...",
|
|
17
|
-
[UnitState.STARTING]: "starting...",
|
|
18
|
-
[UnitState.RUNNING]: "running",
|
|
19
|
-
[UnitState.STOPPING]: "stopping...",
|
|
20
|
-
[UnitState.STOPPED]: "stopped",
|
|
21
|
-
[UnitState.DELETING]: "deleting...",
|
|
22
|
-
[UnitState.DELETED]: "deleted"
|
|
23
|
-
};
|
|
24
|
-
function mergeStatusWithDetails(statusResponse, modulesResponse) {
|
|
25
|
-
const enhancedModules = statusResponse.modules.map((statusModule) => {
|
|
26
|
-
const detailsModule = modulesResponse.modules.find(
|
|
27
|
-
(m) => m.name === statusModule.name
|
|
28
|
-
);
|
|
29
|
-
const enhancedModule = {
|
|
30
|
-
// From status API
|
|
31
|
-
name: statusModule.name,
|
|
32
|
-
state: statusModule.state,
|
|
33
|
-
notification: statusModule.notification
|
|
34
|
-
};
|
|
35
|
-
if (detailsModule) {
|
|
36
|
-
enhancedModule.moduleId = detailsModule.moduleId;
|
|
37
|
-
enhancedModule.type = detailsModule.type;
|
|
38
|
-
enhancedModule.moduleType = detailsModule.moduleType;
|
|
39
|
-
enhancedModule.convergedAt = detailsModule.convergedAt ? timestampDate(detailsModule.convergedAt) : void 0;
|
|
40
|
-
enhancedModule.organizationId = detailsModule.organizationId;
|
|
41
|
-
enhancedModule.applicationName = detailsModule.applicationName;
|
|
42
|
-
enhancedModule.applicationVersionId = detailsModule.applicationVersionId;
|
|
43
|
-
if (detailsModule.smartBucket) enhancedModule.smartBucket = detailsModule.smartBucket;
|
|
44
|
-
if (detailsModule.bucket) enhancedModule.bucket = detailsModule.bucket;
|
|
45
|
-
if (detailsModule.service) enhancedModule.service = detailsModule.service;
|
|
46
|
-
if (detailsModule.actor) enhancedModule.actor = detailsModule.actor;
|
|
47
|
-
if (detailsModule.observer) enhancedModule.observer = detailsModule.observer;
|
|
48
|
-
if (detailsModule.task) enhancedModule.task = detailsModule.task;
|
|
49
|
-
if (detailsModule.sqlDatabase) enhancedModule.sqlDatabase = detailsModule.sqlDatabase;
|
|
50
|
-
if (detailsModule.vectorIndex) enhancedModule.vectorIndex = detailsModule.vectorIndex;
|
|
51
|
-
if (detailsModule.queue) enhancedModule.queue = detailsModule.queue;
|
|
52
|
-
if (detailsModule.kvCache) enhancedModule.kvCache = detailsModule.kvCache;
|
|
53
|
-
if (detailsModule.smartMemory) enhancedModule.smartMemory = detailsModule.smartMemory;
|
|
54
|
-
if (detailsModule.smartSql) enhancedModule.smartSql = detailsModule.smartSql;
|
|
55
|
-
if (detailsModule.mcpService) enhancedModule.mcpService = detailsModule.mcpService;
|
|
56
|
-
}
|
|
57
|
-
return enhancedModule;
|
|
58
|
-
});
|
|
59
|
-
return {
|
|
60
|
-
state: statusResponse.state,
|
|
61
|
-
modules: enhancedModules,
|
|
62
|
-
lock: statusResponse.lock
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
async function getStatus(options) {
|
|
66
|
-
const { command, impersonate } = options;
|
|
67
|
-
let applicationName = options.applicationName;
|
|
68
|
-
let versionId = options.versionId;
|
|
69
|
-
if (!versionId) {
|
|
70
|
-
const config = await command.loadConfig();
|
|
71
|
-
versionId = config.versionId;
|
|
72
|
-
}
|
|
73
|
-
if (!applicationName) {
|
|
74
|
-
const apps = await command.loadManifest();
|
|
75
|
-
const app = apps[0];
|
|
76
|
-
if (app === void 0) {
|
|
77
|
-
command.error("No application provided or found in manifest");
|
|
78
|
-
}
|
|
79
|
-
applicationName = valueOf(app.name);
|
|
80
|
-
}
|
|
81
|
-
const { client: catalogService, userId, organizationId: defaultOrganizationId } = await command.catalogService();
|
|
82
|
-
const organizationId = impersonate ?? defaultOrganizationId;
|
|
83
|
-
const status = await catalogService.status({
|
|
84
|
-
userId,
|
|
85
|
-
organizationId,
|
|
86
|
-
applicationName,
|
|
87
|
-
currentVersionId: versionId || ""
|
|
88
|
-
});
|
|
89
|
-
if (status === void 0) {
|
|
90
|
-
command.error(`Application ${applicationName} not found`);
|
|
91
|
-
}
|
|
92
|
-
return status;
|
|
93
|
-
}
|
|
94
|
-
async function getEnhancedStatus(options) {
|
|
95
|
-
const { command, impersonate } = options;
|
|
96
|
-
let applicationName = options.applicationName;
|
|
97
|
-
let versionId = options.versionId;
|
|
98
|
-
if (!versionId) {
|
|
99
|
-
const config = await command.loadConfig();
|
|
100
|
-
versionId = config.versionId;
|
|
101
|
-
}
|
|
102
|
-
if (!applicationName) {
|
|
103
|
-
const apps = await command.loadManifest();
|
|
104
|
-
const app = apps[0];
|
|
105
|
-
if (app === void 0) {
|
|
106
|
-
command.error("No application provided or found in manifest");
|
|
107
|
-
}
|
|
108
|
-
applicationName = valueOf(app.name);
|
|
109
|
-
}
|
|
110
|
-
const { client: catalogService, userId, organizationId: defaultOrganizationId } = await command.catalogService();
|
|
111
|
-
const organizationId = impersonate ?? defaultOrganizationId;
|
|
112
|
-
const statusResponse = await catalogService.status({
|
|
113
|
-
userId,
|
|
114
|
-
organizationId,
|
|
115
|
-
applicationName,
|
|
116
|
-
currentVersionId: versionId || ""
|
|
117
|
-
});
|
|
118
|
-
if (statusResponse === void 0) {
|
|
119
|
-
command.error(`Application ${applicationName} not found`);
|
|
120
|
-
}
|
|
121
|
-
if (statusResponse.state === UnitState.RUNNING) {
|
|
122
|
-
try {
|
|
123
|
-
const modulesResponse = await catalogService.queryModules({
|
|
124
|
-
userId,
|
|
125
|
-
organizationId,
|
|
126
|
-
applicationName,
|
|
127
|
-
applicationVersionId: versionId || ""
|
|
128
|
-
});
|
|
129
|
-
return mergeStatusWithDetails(statusResponse, modulesResponse);
|
|
130
|
-
} catch (error) {
|
|
131
|
-
command.log(`Warning: Could not fetch module details: ${error}`);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
return {
|
|
135
|
-
state: statusResponse.state,
|
|
136
|
-
modules: statusResponse.modules.map((module) => ({
|
|
137
|
-
name: module.name,
|
|
138
|
-
state: module.state,
|
|
139
|
-
notification: module.notification
|
|
140
|
-
})),
|
|
141
|
-
lock: statusResponse.lock
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
async function watchStatus(options) {
|
|
145
|
-
const { command } = options;
|
|
146
|
-
const renderer = new StatusRenderer();
|
|
147
|
-
let applicationName = options.applicationName;
|
|
148
|
-
let versionId = options.versionId;
|
|
149
|
-
if (!applicationName) {
|
|
150
|
-
const apps = await command.loadManifest();
|
|
151
|
-
const app = apps[0];
|
|
152
|
-
if (app) {
|
|
153
|
-
applicationName = valueOf(app.name);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
if (!versionId) {
|
|
157
|
-
const config = await command.loadConfig();
|
|
158
|
-
versionId = config.versionId;
|
|
159
|
-
}
|
|
160
|
-
let status = await getEnhancedStatus(options);
|
|
161
|
-
while (true) {
|
|
162
|
-
renderer.renderLive(status, applicationName, versionId);
|
|
163
|
-
if (status.state === UnitState.RUNNING || status.state === UnitState.STOPPED) {
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
|
-
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
167
|
-
status = await getEnhancedStatus(options);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
var StatusRenderer = class {
|
|
171
|
-
linesLastRendered = 0;
|
|
172
|
-
getStatusColor(state) {
|
|
173
|
-
switch (state) {
|
|
174
|
-
case UnitState.RUNNING:
|
|
175
|
-
return source_default.green;
|
|
176
|
-
case UnitState.PENDING:
|
|
177
|
-
case UnitState.STARTING:
|
|
178
|
-
return source_default.yellow;
|
|
179
|
-
case UnitState.STOPPING:
|
|
180
|
-
case UnitState.DELETING:
|
|
181
|
-
return source_default.yellow;
|
|
182
|
-
case UnitState.STOPPED:
|
|
183
|
-
case UnitState.DELETED:
|
|
184
|
-
return source_default.red;
|
|
185
|
-
default:
|
|
186
|
-
return source_default.gray;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
formatConvergedInfo(module) {
|
|
190
|
-
if (!module.convergedAt) return "";
|
|
191
|
-
const now = /* @__PURE__ */ new Date();
|
|
192
|
-
const converged = new Date(module.convergedAt);
|
|
193
|
-
const diffMs = now.getTime() - converged.getTime();
|
|
194
|
-
const diffMinutes = Math.floor(diffMs / 6e4);
|
|
195
|
-
if (diffMinutes < 1) return source_default.green("converged just now");
|
|
196
|
-
if (diffMinutes < 60) return source_default.green(`converged ${diffMinutes}m ago`);
|
|
197
|
-
const diffHours = Math.floor(diffMinutes / 60);
|
|
198
|
-
if (diffHours < 24) return source_default.green(`converged ${diffHours}h ago`);
|
|
199
|
-
return source_default.green(`converged ${converged.toLocaleDateString()}`);
|
|
200
|
-
}
|
|
201
|
-
renderModuleRoutes(module) {
|
|
202
|
-
const routes = [];
|
|
203
|
-
const serviceOrActor = module.service || module.actor || module.mcpService;
|
|
204
|
-
if (serviceOrActor?.routes && serviceOrActor.routes.length > 0) {
|
|
205
|
-
for (const route of serviceOrActor.routes) {
|
|
206
|
-
const routeInfo = route.id ? `${source_default.green(route.domain)} ${source_default.cyan(`[${route.id}]`)}` : source_default.green(route.domain);
|
|
207
|
-
routes.push(` \u2192 ${routeInfo}`);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
return routes;
|
|
211
|
-
}
|
|
212
|
-
renderModuleAttributes(module) {
|
|
213
|
-
const attributes = [];
|
|
214
|
-
if (module.smartBucket?.url) {
|
|
215
|
-
attributes.push(` Url: ${source_default.yellow(module.smartBucket.url)}`);
|
|
216
|
-
}
|
|
217
|
-
if (module.service?.visibility || module.actor?.visibility || module.mcpService?.visibility) {
|
|
218
|
-
const visibility = module.service?.visibility || module.actor?.visibility || module.mcpService?.visibility;
|
|
219
|
-
attributes.push(` visibility: ${source_default.yellow(visibility)}`);
|
|
220
|
-
}
|
|
221
|
-
return attributes;
|
|
222
|
-
}
|
|
223
|
-
renderLive(status, applicationName, versionId) {
|
|
224
|
-
if (this.linesLastRendered > 0) {
|
|
225
|
-
readline.moveCursor(process.stdout, 0, -this.linesLastRendered);
|
|
226
|
-
readline.clearScreenDown(process.stdout);
|
|
227
|
-
}
|
|
228
|
-
const lines = [];
|
|
229
|
-
lines.push(`${source_default.bold(applicationName)} ${source_default.dim(versionId ? `@${versionId.substring(0, 8)}...` : "")} ${source_default.dim(`(${status.modules.length} module${status.modules.length !== 1 ? "s" : ""})`)}`);
|
|
230
|
-
lines.push(source_default.dim(`Status: ${this.getStatusColor(status.state)(statusString[status.state])}`));
|
|
231
|
-
const hasEnhancedDetails = status.modules.some((m) => m.type);
|
|
232
|
-
if (hasEnhancedDetails) {
|
|
233
|
-
for (const module of status.modules) {
|
|
234
|
-
const statusColor = this.getStatusColor(module.state);
|
|
235
|
-
const typeInfo = module.type ? source_default.yellow(module.type) : source_default.gray("unknown");
|
|
236
|
-
const convergedInfo = this.formatConvergedInfo(module);
|
|
237
|
-
const hasExtraInfo = convergedInfo || this.renderModuleRoutes(module).length > 0 || this.renderModuleAttributes(module).length > 0;
|
|
238
|
-
const separator = hasExtraInfo ? convergedInfo ? ` - ${convergedInfo}` : "" : "";
|
|
239
|
-
lines.push(`\u2514\u2500 ${source_default.cyan(module.name)} ${typeInfo} - ${statusColor(statusString[module.state])}${separator}`);
|
|
240
|
-
const routes = this.renderModuleRoutes(module);
|
|
241
|
-
if (routes.length > 0) {
|
|
242
|
-
lines.push(...routes);
|
|
243
|
-
}
|
|
244
|
-
const attributes = this.renderModuleAttributes(module);
|
|
245
|
-
if (attributes.length > 0) {
|
|
246
|
-
lines.push(...attributes);
|
|
247
|
-
}
|
|
248
|
-
if ((routes.length > 0 || attributes.length > 0) && module !== status.modules[status.modules.length - 1]) {
|
|
249
|
-
lines.push("");
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
} else {
|
|
253
|
-
lines.push(`${source_default.bold("Modules")} ${source_default.dim(`(${status.modules.length})`)}`);
|
|
254
|
-
for (const module of status.modules) {
|
|
255
|
-
const statusColor = this.getStatusColor(module.state);
|
|
256
|
-
const notification = module.notification ? ` - ${source_default.cyan(module.notification)}` : "";
|
|
257
|
-
lines.push(` \u2514\u2500 ${source_default.yellow(module.name)} - ${statusColor(statusString[module.state])}${notification}`);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
const runningModules = status.modules.filter((m) => m.state === UnitState.RUNNING).length;
|
|
261
|
-
const totalModules = status.modules.length;
|
|
262
|
-
lines.push(source_default.dim("\u2500".repeat(50)));
|
|
263
|
-
lines.push(source_default.dim(`Total: ${totalModules} modules (${runningModules} running)`));
|
|
264
|
-
for (const line of lines) {
|
|
265
|
-
console.log(line);
|
|
266
|
-
}
|
|
267
|
-
this.linesLastRendered = lines.length;
|
|
268
|
-
}
|
|
269
|
-
renderCompact(status, applicationName, versionId) {
|
|
270
|
-
console.log(`${source_default.bold(applicationName)} ${source_default.dim(versionId ? `@${versionId.substring(0, 8)}...` : "")} ${source_default.dim(`(${status.modules.length} module${status.modules.length !== 1 ? "s" : ""})`)}`);
|
|
271
|
-
console.log(source_default.dim(`Status: ${this.getStatusColor(status.state)(statusString[status.state])}`));
|
|
272
|
-
const hasEnhancedDetails = status.modules.some((m) => m.type);
|
|
273
|
-
if (hasEnhancedDetails) {
|
|
274
|
-
for (const module of status.modules) {
|
|
275
|
-
const statusColor = this.getStatusColor(module.state);
|
|
276
|
-
const typeInfo = module.type ? source_default.yellow(module.type) : source_default.gray("unknown");
|
|
277
|
-
const convergedInfo = this.formatConvergedInfo(module);
|
|
278
|
-
const hasExtraInfo = convergedInfo || this.renderModuleRoutes(module).length > 0 || this.renderModuleAttributes(module).length > 0;
|
|
279
|
-
const separator = hasExtraInfo ? convergedInfo ? ` - ${convergedInfo}` : "" : "";
|
|
280
|
-
console.log(`\u2514\u2500 ${source_default.cyan(module.name)} ${typeInfo} - ${statusColor(statusString[module.state])}${separator}`);
|
|
281
|
-
const routes = this.renderModuleRoutes(module);
|
|
282
|
-
if (routes.length > 0) {
|
|
283
|
-
for (const route of routes) {
|
|
284
|
-
console.log(route);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
const attributes = this.renderModuleAttributes(module);
|
|
288
|
-
if (attributes.length > 0) {
|
|
289
|
-
for (const attribute of attributes) {
|
|
290
|
-
console.log(attribute);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
} else {
|
|
295
|
-
console.log(`${source_default.bold("Modules")} ${source_default.dim(`(${status.modules.length})`)}`);
|
|
296
|
-
for (const module of status.modules) {
|
|
297
|
-
const statusColor = this.getStatusColor(module.state);
|
|
298
|
-
const notification = module.notification ? ` - ${source_default.cyan(module.notification)}` : "";
|
|
299
|
-
console.log(` \u2514\u2500 ${source_default.yellow(module.name)} - ${statusColor(statusString[module.state])}${notification}`);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
const runningModules = status.modules.filter((m) => m.state === UnitState.RUNNING).length;
|
|
303
|
-
const totalModules = status.modules.length;
|
|
304
|
-
console.log(source_default.dim("\u2500".repeat(50)));
|
|
305
|
-
console.log(source_default.dim(`Total: ${totalModules} modules (${runningModules} running)`));
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
|
|
309
|
-
export {
|
|
310
|
-
statusString,
|
|
311
|
-
getStatus,
|
|
312
|
-
getEnhancedStatus,
|
|
313
|
-
watchStatus,
|
|
314
|
-
StatusRenderer
|
|
315
|
-
};
|