@liquidmetal-ai/raindrop 0.13.0 → 0.15.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 +327 -89
- package/bundle/build-CBEGQPJT.js +62 -0
- package/bundle/{chunk-IEF2XC25.js → chunk-2PH3PHH3.js} +5 -3
- package/bundle/{chunk-4HZ22KOV.js → chunk-3CMR7ES5.js} +4 -4
- package/bundle/{chunk-JSBM2JYW.js → chunk-3EYKCHIK.js} +1 -1
- package/bundle/chunk-5XHDP4VK.js +1697 -0
- package/bundle/{chunk-TSQK4HH6.js → chunk-674GMSXY.js} +1 -1
- package/bundle/{chunk-PS3WZBDF.js → chunk-6L4V66WZ.js} +1105 -2728
- package/bundle/{chunk-5245CEUM.js → chunk-AGG7JZVH.js} +2 -2
- package/bundle/{chunk-3GFKUF5D.js → chunk-B3IY2XS6.js} +4 -2
- package/bundle/{chunk-WIDI65NO.js → chunk-CBAXTRCS.js} +1 -1
- package/bundle/{chunk-JLVDTXO2.js → chunk-DPV5HIG7.js} +4 -4
- package/bundle/{chunk-36GNZK4A.js → chunk-EVXLXWP7.js} +1 -1
- package/bundle/{chunk-4YVU5KEQ.js → chunk-HN3AAKRY.js} +4 -2
- package/bundle/{chunk-NVNEQXHN.js → chunk-IGLE4Y3B.js} +7 -5
- package/bundle/{chunk-FGSYWVBA.js → chunk-IQ6HFRA6.js} +1 -1
- package/bundle/{chunk-O3QZDJ75.js → chunk-JQONDSHY.js} +2 -2
- package/bundle/{chunk-W4IPOFZC.js → chunk-KADMFJLN.js} +8 -6
- package/bundle/chunk-KG5BLUGU.js +246 -0
- package/bundle/{chunk-V5LHJTYS.js → chunk-KLOYSTZY.js} +13 -2
- package/bundle/{chunk-ETC5VU7H.js → chunk-KXHVSLAI.js} +1 -1
- package/bundle/{chunk-Y4WFGNPM.js → chunk-L6FRQULN.js} +1 -1
- package/bundle/{chunk-3QCVYSRU.js → chunk-LT3BFQ4O.js} +1 -1
- package/bundle/{chunk-KQZJHBNG.js → chunk-MBLKVNI5.js} +1 -1
- package/bundle/{chunk-6AIUQUUM.js → chunk-MFMVJZW6.js} +71 -15
- package/bundle/{chunk-25T7MEKO.js → chunk-MJBLNWG3.js} +1 -1
- package/bundle/{chunk-MSJ33O5Y.js → chunk-NRCQIE3Z.js} +95 -115
- package/bundle/{chunk-XKKPPSPC.js → chunk-OCYTN4IH.js} +2 -2
- package/bundle/{chunk-2GAMWFJE.js → chunk-QEF5D4VE.js} +1 -1
- package/bundle/{chunk-4B3QYXBA.js → chunk-T7MQCLXF.js} +5 -3
- package/bundle/{chunk-LDFYPOXJ.js → chunk-TFQY5TSY.js} +1 -1
- package/bundle/{chunk-BWK4MC7Y.js → chunk-USZXZZAR.js} +8 -6
- package/bundle/{chunk-ER2RCPCY.js → chunk-V54KHS5B.js} +2 -2
- package/bundle/{chunk-YSKASURB.js → chunk-V6J23FL2.js} +1 -1
- package/bundle/{chunk-UHSTDJ7X.js → chunk-VN2QYX4C.js} +1 -1
- package/bundle/{chunk-Z4OWKG7J.js → chunk-VOT5MMEY.js} +1 -1
- package/bundle/{chunk-W6GU26WO.js → chunk-WG6BDFPZ.js} +1 -1
- package/bundle/{chunk-AK77X5GL.js → chunk-XX74I5RK.js} +4 -2
- package/bundle/{chunk-6BT265R3.js → chunk-YQCRWPNI.js} +1 -1
- 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/apikey.js +2 -2
- package/bundle/commands/auth/list.js +2 -2
- package/bundle/commands/auth/login.js +2 -2
- 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/actor/setup.js +124 -0
- package/bundle/commands/build/branch.js +10 -10
- package/bundle/commands/build/bucket-events/setup.js +146 -0
- package/bundle/commands/build/checkout.js +8 -8
- package/bundle/commands/build/clone.js +6 -6
- package/bundle/commands/build/delete.js +8 -8
- package/bundle/commands/build/deploy.js +10 -10
- package/bundle/commands/build/env/get.js +3 -3
- package/bundle/commands/build/env/list.js +2 -2
- package/bundle/commands/build/env/set.js +3 -3
- package/bundle/commands/build/env.js +2 -2
- package/bundle/commands/build/features.js +192 -0
- package/bundle/commands/build/find.js +4 -4
- package/bundle/commands/build/generate.js +52 -3
- package/bundle/commands/build/init-workspace.js +3 -3
- package/bundle/commands/build/init.js +15 -3
- package/bundle/commands/build/list.js +5 -5
- package/bundle/commands/build/queue/setup.js +133 -0
- package/bundle/commands/build/sandbox.js +6 -6
- package/bundle/commands/build/smartbucket/setup.js +165 -0
- package/bundle/commands/build/smartmemory/setup.js +171 -0
- package/bundle/commands/build/smartsql/setup.js +167 -0
- 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/stripe/dashboard.js +3 -3
- package/bundle/commands/build/stripe/onboard.js +3 -3
- package/bundle/commands/build/stripe/setup.js +3 -3
- package/bundle/commands/build/stripe/start.js +14 -14
- package/bundle/commands/build/stripe/status.js +3 -3
- package/bundle/commands/build/stripe/subscription/create.js +4 -4
- package/bundle/commands/build/stripe/subscription/get.js +4 -4
- package/bundle/commands/build/stripe/subscription/update.js +4 -4
- package/bundle/commands/build/tools/check.js +2 -2
- package/bundle/commands/build/tools/fmt.js +2 -2
- package/bundle/commands/build/unsandbox.js +6 -6
- package/bundle/commands/build/upload.js +5 -5
- package/bundle/commands/build/validate.js +85 -14
- package/bundle/commands/build/workos/delete.js +6 -6
- package/bundle/commands/build/workos/env/attach.js +3 -3
- package/bundle/commands/build/workos/env/attached.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/dev-login.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/jwt.js +172 -0
- 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 +6 -6
- package/bundle/commands/dns/get.js +6 -6
- 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/doctor.js +309 -0
- 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 +5 -37
- package/bundle/commands/object/get.js +5 -37
- package/bundle/commands/object/list.js +7 -39
- package/bundle/commands/object/put.js +5 -37
- package/bundle/commands/query/chunk-search.js +14 -46
- package/bundle/commands/query/document.js +17 -55
- package/bundle/commands/query/events.js +2 -2
- package/bundle/commands/query/reindex.js +2 -2
- package/bundle/commands/query/search.js +14 -46
- package/bundle/commands/tail.js +2 -2
- package/bundle/index.js +1 -1
- package/dist/commands/build/actor/setup.d.ts +22 -0
- package/dist/commands/build/actor/setup.d.ts.map +1 -0
- package/dist/commands/build/actor/setup.js +116 -0
- package/dist/commands/build/bucket-events/setup.d.ts +22 -0
- package/dist/commands/build/bucket-events/setup.d.ts.map +1 -0
- package/dist/commands/build/bucket-events/setup.js +134 -0
- package/dist/commands/build/features.d.ts +19 -0
- package/dist/commands/build/features.d.ts.map +1 -0
- package/dist/commands/build/features.js +97 -0
- package/dist/commands/build/generate.d.ts +2 -0
- package/dist/commands/build/generate.d.ts.map +1 -1
- package/dist/commands/build/generate.js +52 -0
- package/dist/commands/build/init.d.ts.map +1 -1
- package/dist/commands/build/init.js +10 -0
- package/dist/commands/build/queue/setup.d.ts +21 -0
- package/dist/commands/build/queue/setup.d.ts.map +1 -0
- package/dist/commands/build/queue/setup.js +120 -0
- package/dist/commands/build/smartbucket/setup.d.ts +23 -0
- package/dist/commands/build/smartbucket/setup.d.ts.map +1 -0
- package/dist/commands/build/smartbucket/setup.js +167 -0
- package/dist/commands/build/smartmemory/setup.d.ts +23 -0
- package/dist/commands/build/smartmemory/setup.d.ts.map +1 -0
- package/dist/commands/build/smartmemory/setup.js +172 -0
- package/dist/commands/build/smartsql/setup.d.ts +23 -0
- package/dist/commands/build/smartsql/setup.d.ts.map +1 -0
- package/dist/commands/build/smartsql/setup.js +169 -0
- package/dist/commands/build/validate.d.ts +2 -0
- package/dist/commands/build/validate.d.ts.map +1 -1
- package/dist/commands/build/validate.js +80 -8
- package/dist/commands/build/workos/jwt.d.ts +23 -0
- package/dist/commands/build/workos/jwt.d.ts.map +1 -0
- package/dist/commands/build/workos/jwt.js +172 -0
- package/dist/commands/doctor.d.ts +27 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +328 -0
- package/dist/commands/object/delete.d.ts +0 -2
- package/dist/commands/object/delete.d.ts.map +1 -1
- package/dist/commands/object/delete.js +3 -38
- package/dist/commands/object/get.d.ts +0 -2
- package/dist/commands/object/get.d.ts.map +1 -1
- package/dist/commands/object/get.js +3 -38
- package/dist/commands/object/list.d.ts +0 -2
- package/dist/commands/object/list.d.ts.map +1 -1
- package/dist/commands/object/list.js +5 -40
- package/dist/commands/object/put.d.ts +0 -2
- package/dist/commands/object/put.d.ts.map +1 -1
- package/dist/commands/object/put.js +3 -38
- package/dist/commands/query/chunk-search.d.ts +0 -2
- package/dist/commands/query/chunk-search.d.ts.map +1 -1
- package/dist/commands/query/chunk-search.js +12 -46
- package/dist/commands/query/document.d.ts +1 -3
- package/dist/commands/query/document.d.ts.map +1 -1
- package/dist/commands/query/document.js +16 -60
- package/dist/commands/query/search.d.ts +0 -2
- package/dist/commands/query/search.d.ts.map +1 -1
- package/dist/commands/query/search.js +12 -46
- package/dist/feature-catalog.d.ts +28 -0
- package/dist/feature-catalog.d.ts.map +1 -0
- package/dist/feature-catalog.js +104 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -2
- package/oclif.manifest.json +4811 -3433
- package/package.json +3 -3
- package/templates/examples/smartbucket-minimal.ts.hbs +87 -0
- package/templates/examples/smartmemory-minimal.ts.hbs +82 -0
- package/templates/examples/smartsql-minimal.ts.hbs +69 -0
- package/templates/handlers/actor/index.test.ts.hbs +48 -85
- package/templates/handlers/actor/index.ts.hbs +16 -316
- package/templates/handlers/bucket-event-notification/index.ts.hbs +32 -235
- package/templates/handlers/bucket-event-observer.ts.hbs +79 -0
- package/templates/handlers/http-service/index.test.ts.hbs +3 -0
- package/templates/handlers/http-service/index.ts.hbs +43 -15
- package/templates/handlers/queue-consumer-setup.ts.hbs +45 -0
- package/templates/handlers/task/index.test.ts.hbs +30 -112
- package/templates/handlers/task/index.ts.hbs +19 -58
- package/templates/init/RAINDROP.md.hbs +97 -1
- package/templates/init/eslint.config.js +43 -0
- package/templates/init/package.json.hbs +4 -1
- package/templates/init/tsconfig.json +3 -3
- package/bundle/chunk-23UBI7BN.js +0 -48
- package/bundle/chunk-2QWMBNE3.js +0 -384
- package/bundle/chunk-45IYWQDC.js +0 -384
- package/bundle/chunk-5YUO23QU.js +0 -4585
- package/bundle/chunk-6MIGCNUO.js +0 -75
- package/bundle/chunk-7ZJWA6HP.js +0 -805
- package/bundle/chunk-AIYVX2M7.js +0 -44
- package/bundle/chunk-BB5TNIEM.js +0 -48
- package/bundle/chunk-BUR3HFKH.js +0 -488
- package/bundle/chunk-BYSBS7KT.js +0 -488
- package/bundle/chunk-CX3RWI62.js +0 -28658
- package/bundle/chunk-DLH7MI57.js +0 -305
- package/bundle/chunk-E3WJIYJZ.js +0 -12148
- package/bundle/chunk-EX7NOPRF.js +0 -12148
- package/bundle/chunk-F76JQS2J.js +0 -231
- package/bundle/chunk-FBOXMVKD.js +0 -28679
- package/bundle/chunk-FTPZ6SQW.js +0 -238909
- package/bundle/chunk-H3CFZ7ZH.js +0 -74
- package/bundle/chunk-HXOILVWA.js +0 -384
- package/bundle/chunk-IMP7O5AC.js +0 -22452
- package/bundle/chunk-IPYOAKRE.js +0 -231
- package/bundle/chunk-J7HN6XF2.js +0 -4461
- package/bundle/chunk-JOLOAALA.js +0 -231
- package/bundle/chunk-JZ2G4Q35.js +0 -4585
- package/bundle/chunk-KVAWPWF7.js +0 -231
- package/bundle/chunk-MEUAAIXV.js +0 -28657
- package/bundle/chunk-QBWFE57Z.js +0 -384
- package/bundle/chunk-SP3LOXPC.js +0 -46
- package/bundle/chunk-T7C564PR.js +0 -28678
- package/bundle/chunk-UFH545WJ.js +0 -22452
- package/bundle/chunk-UHVMPWM5.js +0 -315
- package/bundle/chunk-VB7ZTSZV.js +0 -1089
- package/bundle/chunk-VBIJDFMJ.js +0 -384
- package/bundle/chunk-VR7RLTE3.js +0 -231
- package/bundle/chunk-WFZUJLEC.js +0 -231
- package/bundle/chunk-YDGJTLVZ.js +0 -133
- package/bundle/chunk-YPNQ7UFK.js +0 -502
- package/bundle/chunk-YXFDRMSN.js +0 -384
- package/dist/lib/dns-utils.d.ts +0 -7
- package/dist/lib/dns-utils.d.ts.map +0 -1
- package/dist/lib/dns-utils.js +0 -44
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ulid
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-VOT5MMEY.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseCommand
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-TFQY5TSY.js";
|
|
7
7
|
import {
|
|
8
8
|
__toESM,
|
|
9
9
|
init_cjs_shims,
|
|
10
10
|
require_lib
|
|
11
|
-
} from "../../chunk-
|
|
11
|
+
} from "../../chunk-KLOYSTZY.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/query/search.ts
|
|
14
14
|
init_cjs_shims();
|
|
@@ -37,26 +37,6 @@ Get page 2 of previous search results.
|
|
|
37
37
|
multiple: true,
|
|
38
38
|
required: false
|
|
39
39
|
}),
|
|
40
|
-
"module-ids": import_core.Flags.string({
|
|
41
|
-
description: "Module IDs to search in (deprecated, use --buckets with smartbucket names)",
|
|
42
|
-
multiple: true,
|
|
43
|
-
required: false,
|
|
44
|
-
hidden: true,
|
|
45
|
-
deprecated: {
|
|
46
|
-
message: "use --buckets with smartbucket names instead",
|
|
47
|
-
version: "3.0.0"
|
|
48
|
-
}
|
|
49
|
-
}),
|
|
50
|
-
moduleIds: import_core.Flags.string({
|
|
51
|
-
description: "Module IDs to search in (deprecated, use --module-ids)",
|
|
52
|
-
multiple: true,
|
|
53
|
-
required: false,
|
|
54
|
-
hidden: true,
|
|
55
|
-
deprecated: {
|
|
56
|
-
message: "use --module-ids instead",
|
|
57
|
-
version: "2.0.0"
|
|
58
|
-
}
|
|
59
|
-
}),
|
|
60
40
|
"request-id": import_core.Flags.string({
|
|
61
41
|
description: "request ID for pagination",
|
|
62
42
|
required: false
|
|
@@ -94,11 +74,7 @@ Get page 2 of previous search results.
|
|
|
94
74
|
})
|
|
95
75
|
};
|
|
96
76
|
async run() {
|
|
97
|
-
const moduleIds = this.flags["module-ids"] || this.flags.moduleIds;
|
|
98
77
|
const requestIdValue = this.flags["request-id"] || this.flags.requestId;
|
|
99
|
-
if (this.flags.buckets?.length && moduleIds?.length) {
|
|
100
|
-
this.error("Cannot specify both --buckets and --module-ids flags. Please use only one type of filter.");
|
|
101
|
-
}
|
|
102
78
|
if (this.flags.buckets?.some((bucket) => !bucket.includes("#"))) {
|
|
103
79
|
await this.loadConfig();
|
|
104
80
|
}
|
|
@@ -133,27 +109,19 @@ Get page 2 of previous search results.
|
|
|
133
109
|
response = await searchAgentService.runSupervisorAgent({
|
|
134
110
|
requestId,
|
|
135
111
|
input: args.query,
|
|
136
|
-
bucketLocations: [
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
return {
|
|
140
|
-
bucketLocation: {
|
|
141
|
-
case: "bucket",
|
|
142
|
-
value: {
|
|
143
|
-
name: bucketName,
|
|
144
|
-
version: version || this.raindropConfig?.versionId || "",
|
|
145
|
-
applicationName
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
}),
|
|
150
|
-
...(moduleIds || []).map((moduleId) => ({
|
|
112
|
+
bucketLocations: (this.flags.buckets || []).map((bucket) => {
|
|
113
|
+
const [bucketName, version] = bucket.split("#");
|
|
114
|
+
return {
|
|
151
115
|
bucketLocation: {
|
|
152
|
-
case: "
|
|
153
|
-
value:
|
|
116
|
+
case: "bucket",
|
|
117
|
+
value: {
|
|
118
|
+
name: bucketName,
|
|
119
|
+
version: version || this.raindropConfig?.versionId || "",
|
|
120
|
+
applicationName
|
|
121
|
+
}
|
|
154
122
|
}
|
|
155
|
-
}
|
|
156
|
-
|
|
123
|
+
};
|
|
124
|
+
}),
|
|
157
125
|
userId,
|
|
158
126
|
organizationId
|
|
159
127
|
});
|
package/bundle/commands/tail.js
CHANGED
package/bundle/index.js
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
2
|
+
export default class ActorSetup extends BaseCommand<typeof ActorSetup> {
|
|
3
|
+
static args: {};
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
rainbowAuthService: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
raindropCatalogService: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
rainbowAuthToken: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
rainbowOrganizationId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
rainbowUserId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
sendVersionMetadata: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
private toPascalCase;
|
|
19
|
+
private generateActorFile;
|
|
20
|
+
private updateManifest;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../../src/commands/build/actor/setup.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW,CAAC,OAAO,UAAU,CAAC;IACpE,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,WAAW,SAAgE;IAElF,MAAM,CAAC,QAAQ,WAOb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;MAUV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAuD1B,OAAO,CAAC,YAAY;YAON,iBAAiB;YAKjB,cAAc;CA6B7B"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import * as fs from 'node:fs/promises';
|
|
4
|
+
import * as path from 'node:path';
|
|
5
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
6
|
+
import { renderTemplateFromFile, TEMPLATES_DIR } from '../../../codegen.js';
|
|
7
|
+
export default class ActorSetup extends BaseCommand {
|
|
8
|
+
static args = {};
|
|
9
|
+
static description = 'Add a stateful actor (Durable Object) to your Raindrop app';
|
|
10
|
+
static examples = [
|
|
11
|
+
`<%= config.bin %> <%= command.id %>
|
|
12
|
+
Add actor with default name "my-actor"
|
|
13
|
+
|
|
14
|
+
<%= config.bin %> <%= command.id %> --name counter
|
|
15
|
+
Add actor with custom name "counter"
|
|
16
|
+
`,
|
|
17
|
+
];
|
|
18
|
+
static flags = {
|
|
19
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
20
|
+
name: Flags.string({
|
|
21
|
+
description: 'Name for the actor',
|
|
22
|
+
default: 'my-actor',
|
|
23
|
+
}),
|
|
24
|
+
'dry-run': Flags.boolean({
|
|
25
|
+
description: 'Preview changes without applying them',
|
|
26
|
+
default: false,
|
|
27
|
+
}),
|
|
28
|
+
};
|
|
29
|
+
async run() {
|
|
30
|
+
const actorName = this.flags.name;
|
|
31
|
+
const className = this.toPascalCase(actorName);
|
|
32
|
+
const dryRun = this.flags['dry-run'];
|
|
33
|
+
if (dryRun) {
|
|
34
|
+
this.log(chalk.blue.bold('DRY RUN - Preview of changes (no files will be modified)'));
|
|
35
|
+
this.log('');
|
|
36
|
+
this.log(chalk.blue('Would create:') + ' ' + chalk.bold(`src/${actorName}/index.ts`));
|
|
37
|
+
this.log(chalk.dim(' - 70 lines of actor code'));
|
|
38
|
+
this.log(chalk.dim(' - State management, counter, data storage'));
|
|
39
|
+
this.log('');
|
|
40
|
+
this.log(chalk.blue('Would update:') + ' ' + chalk.bold('raindrop.manifest'));
|
|
41
|
+
this.log(chalk.dim(` + actor "${actorName}" {}`));
|
|
42
|
+
this.log('');
|
|
43
|
+
this.log(chalk.blue('Environment binding:') + ' ' + chalk.bold(`this.env.${className.toUpperCase()}`));
|
|
44
|
+
this.log('');
|
|
45
|
+
this.log(chalk.yellow('Run without --dry-run to apply these changes'));
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
// Step 1: Create actor directory
|
|
50
|
+
const actorDir = path.join(process.cwd(), 'src', actorName);
|
|
51
|
+
await fs.mkdir(actorDir, { recursive: true });
|
|
52
|
+
// Step 2: Generate actor file
|
|
53
|
+
const actorContent = await this.generateActorFile(className);
|
|
54
|
+
const actorPath = path.join(actorDir, 'index.ts');
|
|
55
|
+
await fs.writeFile(actorPath, actorContent);
|
|
56
|
+
this.log(chalk.green('✓') + ' Created ' + chalk.bold(`src/${actorName}/index.ts`));
|
|
57
|
+
// Step 3: Update manifest
|
|
58
|
+
await this.updateManifest(actorName);
|
|
59
|
+
this.log(chalk.green('✓') + ' Updated ' + chalk.bold('raindrop.manifest'));
|
|
60
|
+
// Step 4: Show next steps
|
|
61
|
+
this.log('');
|
|
62
|
+
this.log(chalk.bold.cyan('Next Steps:'));
|
|
63
|
+
this.log('');
|
|
64
|
+
this.log('1. Run ' + chalk.bold('raindrop build generate') + ' to update types');
|
|
65
|
+
this.log('2. Check out ' + chalk.bold(`src/${actorName}/index.ts`) + ' for the actor code');
|
|
66
|
+
this.log('3. Call actor methods from your services:');
|
|
67
|
+
this.log('');
|
|
68
|
+
this.log(chalk.dim('Example usage:'));
|
|
69
|
+
this.log(chalk.dim(` const actorId = this.env.${className.toUpperCase()}.idFromName('user-123');`));
|
|
70
|
+
this.log(chalk.dim(` const actor = this.env.${className.toUpperCase()}.get(actorId);`));
|
|
71
|
+
this.log(chalk.dim(` const count = await actor.increment();`));
|
|
72
|
+
this.log('');
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
this.error(`Failed to set up actor: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
toPascalCase(str) {
|
|
79
|
+
return str
|
|
80
|
+
.split(/[-_]/)
|
|
81
|
+
.map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
|
82
|
+
.join('');
|
|
83
|
+
}
|
|
84
|
+
async generateActorFile(className) {
|
|
85
|
+
const templatePath = path.join(TEMPLATES_DIR, 'handlers', 'actor', 'index.ts.hbs');
|
|
86
|
+
return renderTemplateFromFile(templatePath, { actorClassName: className });
|
|
87
|
+
}
|
|
88
|
+
async updateManifest(actorName) {
|
|
89
|
+
const manifestPath = path.join(process.cwd(), 'raindrop.manifest');
|
|
90
|
+
try {
|
|
91
|
+
let content = await fs.readFile(manifestPath, 'utf-8');
|
|
92
|
+
// Check if actor already exists
|
|
93
|
+
if (content.includes(`actor "${actorName}"`)) {
|
|
94
|
+
this.log(chalk.yellow('⚠') + ' Actor already exists in manifest');
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
// Find the application block and add the actor
|
|
98
|
+
const appMatch = content.match(/application\s+"[^"]+"\s+\{/);
|
|
99
|
+
if (appMatch) {
|
|
100
|
+
const insertPos = appMatch.index + appMatch[0].length;
|
|
101
|
+
const binding = `\n actor "${actorName}" {}\n`;
|
|
102
|
+
content = content.slice(0, insertPos) + binding + content.slice(insertPos);
|
|
103
|
+
await fs.writeFile(manifestPath, content);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
throw new Error('Could not find application block in raindrop.manifest');
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
if (error.code === 'ENOENT') {
|
|
111
|
+
throw new Error('raindrop.manifest not found. Are you in a Raindrop project directory?');
|
|
112
|
+
}
|
|
113
|
+
throw error;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
2
|
+
export default class BucketEventsSetup extends BaseCommand<typeof BucketEventsSetup> {
|
|
3
|
+
static args: {};
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
bucket: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
observer: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
rainbowAuthService: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
raindropCatalogService: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
rainbowAuthToken: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
rainbowOrganizationId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
rainbowUserId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
sendVersionMetadata: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
};
|
|
18
|
+
run(): Promise<void>;
|
|
19
|
+
private generateObserverFile;
|
|
20
|
+
private updateManifest;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../../src/commands/build/bucket-events/setup.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,WAAW,CAAC,OAAO,iBAAiB,CAAC;IAClF,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,WAAW,SAAoE;IAEtF,MAAM,CAAC,QAAQ,WAOb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;;MAcV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;YA2DZ,oBAAoB;YAKpB,cAAc;CAiD7B"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import * as fs from 'node:fs/promises';
|
|
4
|
+
import * as path from 'node:path';
|
|
5
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
6
|
+
import { renderTemplateFromFile, TEMPLATES_DIR } from '../../../codegen.js';
|
|
7
|
+
export default class BucketEventsSetup extends BaseCommand {
|
|
8
|
+
static args = {};
|
|
9
|
+
static description = 'Add bucket event notifications (observer) to your Raindrop app';
|
|
10
|
+
static examples = [
|
|
11
|
+
`<%= config.bin %> <%= command.id %>
|
|
12
|
+
Add bucket event observer with default names
|
|
13
|
+
|
|
14
|
+
<%= config.bin %> <%= command.id %> --bucket uploads --observer file-processor
|
|
15
|
+
Add bucket event observer with custom names
|
|
16
|
+
`,
|
|
17
|
+
];
|
|
18
|
+
static flags = {
|
|
19
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
20
|
+
bucket: Flags.string({
|
|
21
|
+
description: 'Name of the bucket to watch',
|
|
22
|
+
default: 'my-bucket',
|
|
23
|
+
}),
|
|
24
|
+
observer: Flags.string({
|
|
25
|
+
description: 'Name for the event observer',
|
|
26
|
+
default: 'bucket-events',
|
|
27
|
+
}),
|
|
28
|
+
'dry-run': Flags.boolean({
|
|
29
|
+
description: 'Preview changes without applying them',
|
|
30
|
+
default: false,
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
async run() {
|
|
34
|
+
const bucketName = this.flags.bucket;
|
|
35
|
+
const observerName = this.flags.observer;
|
|
36
|
+
const dryRun = this.flags['dry-run'];
|
|
37
|
+
if (dryRun) {
|
|
38
|
+
this.log(chalk.blue.bold('DRY RUN - Preview of changes (no files will be modified)'));
|
|
39
|
+
this.log('');
|
|
40
|
+
this.log(chalk.blue('Would create:') + ' ' + chalk.bold(`src/${observerName}/index.ts`));
|
|
41
|
+
this.log(chalk.dim(' - 68 lines of bucket event handler code'));
|
|
42
|
+
this.log(chalk.dim(' - Upload, delete, multipart event handling'));
|
|
43
|
+
this.log('');
|
|
44
|
+
this.log(chalk.blue('Would update:') + ' ' + chalk.bold('raindrop.manifest'));
|
|
45
|
+
this.log(chalk.dim(` + bucket "${bucketName}" {} (if not exists)`));
|
|
46
|
+
this.log(chalk.dim(` + observer "${observerName}" {`));
|
|
47
|
+
this.log(chalk.dim(` source { bucket = "${bucketName}" ... }`));
|
|
48
|
+
this.log(chalk.dim(` }`));
|
|
49
|
+
this.log('');
|
|
50
|
+
this.log(chalk.blue('Environment binding:') + ' ' + chalk.bold(`this.env.${bucketName.toUpperCase().replace(/-/g, '_')}`));
|
|
51
|
+
this.log('');
|
|
52
|
+
this.log(chalk.yellow('Run without --dry-run to apply these changes'));
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
// Step 1: Create observer directory
|
|
57
|
+
const observerDir = path.join(process.cwd(), 'src', observerName);
|
|
58
|
+
await fs.mkdir(observerDir, { recursive: true });
|
|
59
|
+
// Step 2: Generate observer file
|
|
60
|
+
const observerContent = await this.generateObserverFile(bucketName);
|
|
61
|
+
const observerPath = path.join(observerDir, 'index.ts');
|
|
62
|
+
await fs.writeFile(observerPath, observerContent);
|
|
63
|
+
this.log(chalk.green('✓') + ' Created ' + chalk.bold(`src/${observerName}/index.ts`));
|
|
64
|
+
// Step 3: Update manifest
|
|
65
|
+
await this.updateManifest(bucketName, observerName);
|
|
66
|
+
this.log(chalk.green('✓') + ' Updated ' + chalk.bold('raindrop.manifest'));
|
|
67
|
+
// Step 4: Show next steps
|
|
68
|
+
this.log('');
|
|
69
|
+
this.log(chalk.bold.cyan('Next Steps:'));
|
|
70
|
+
this.log('');
|
|
71
|
+
this.log('1. Run ' + chalk.bold('raindrop build generate') + ' to update types');
|
|
72
|
+
this.log('2. Check out ' + chalk.bold(`src/${observerName}/index.ts`) + ' for the event handler');
|
|
73
|
+
this.log('3. Ensure the bucket exists in your manifest:');
|
|
74
|
+
this.log('');
|
|
75
|
+
this.log(chalk.dim(` bucket "${bucketName}" {}`));
|
|
76
|
+
this.log('');
|
|
77
|
+
this.log('4. Upload files to the bucket to trigger events:');
|
|
78
|
+
this.log('');
|
|
79
|
+
this.log(chalk.dim(` await this.env.${bucketName.toUpperCase().replace(/-/g, '_')}.put('file.txt', data);`));
|
|
80
|
+
this.log('');
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
this.error(`Failed to set up bucket events: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
async generateObserverFile(bucketName) {
|
|
87
|
+
const templatePath = path.join(TEMPLATES_DIR, 'handlers', 'bucket-event-observer.ts.hbs');
|
|
88
|
+
return renderTemplateFromFile(templatePath, { bucketName });
|
|
89
|
+
}
|
|
90
|
+
async updateManifest(bucketName, observerName) {
|
|
91
|
+
const manifestPath = path.join(process.cwd(), 'raindrop.manifest');
|
|
92
|
+
try {
|
|
93
|
+
let content = await fs.readFile(manifestPath, 'utf-8');
|
|
94
|
+
// Check if observer already exists
|
|
95
|
+
if (content.includes(`observer "${observerName}"`)) {
|
|
96
|
+
this.log(chalk.yellow('⚠') + ' Observer already exists in manifest');
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
// Check if bucket exists
|
|
100
|
+
const hasBucket = content.includes(`bucket "${bucketName}"`);
|
|
101
|
+
// Find the application block and add the bucket (if needed) and observer
|
|
102
|
+
const appMatch = content.match(/application\s+"[^"]+"\s+\{/);
|
|
103
|
+
if (appMatch) {
|
|
104
|
+
const insertPos = appMatch.index + appMatch[0].length;
|
|
105
|
+
let binding = '';
|
|
106
|
+
if (!hasBucket) {
|
|
107
|
+
binding += `\n bucket "${bucketName}" {}\n`;
|
|
108
|
+
this.log(chalk.green('✓') + ' Added bucket to manifest');
|
|
109
|
+
}
|
|
110
|
+
binding += `\n observer "${observerName}" {
|
|
111
|
+
source {
|
|
112
|
+
bucket = "${bucketName}"
|
|
113
|
+
max_retries = 5
|
|
114
|
+
batch_size = 1
|
|
115
|
+
rule {
|
|
116
|
+
actions = ["PutObject", "DeleteObject"]
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}\n`;
|
|
120
|
+
content = content.slice(0, insertPos) + binding + content.slice(insertPos);
|
|
121
|
+
await fs.writeFile(manifestPath, content);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
throw new Error('Could not find application block in raindrop.manifest');
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
if (error.code === 'ENOENT') {
|
|
129
|
+
throw new Error('raindrop.manifest not found. Are you in a Raindrop project directory?');
|
|
130
|
+
}
|
|
131
|
+
throw error;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command.js';
|
|
2
|
+
export default class Features extends BaseCommand<typeof Features> {
|
|
3
|
+
static args: {};
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
'available-only': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
rainbowAuthService: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
raindropCatalogService: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
rainbowAuthToken: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
rainbowOrganizationId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
rainbowUserId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
sendVersionMetadata: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=features.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../../src/commands/build/features.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,WAAW,CAAC,OAAO,QAAQ,CAAC;IAChE,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,WAAW,SAAgE;IAElF,MAAM,CAAC,QAAQ,WAUb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;MAYV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA2E3B"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { BaseCommand } from '../../base-command.js';
|
|
4
|
+
import { getFeaturesByCategory, getFeatures } from '../../feature-catalog.js';
|
|
5
|
+
export default class Features extends BaseCommand {
|
|
6
|
+
static args = {};
|
|
7
|
+
static description = 'List available features and integrations for Raindrop apps';
|
|
8
|
+
static examples = [
|
|
9
|
+
`<%= config.bin %> <%= command.id %>
|
|
10
|
+
List all available features grouped by category
|
|
11
|
+
|
|
12
|
+
<%= config.bin %> <%= command.id %> --available-only
|
|
13
|
+
Show only features that are currently ready to use
|
|
14
|
+
|
|
15
|
+
<%= config.bin %> <%= command.id %> --output json
|
|
16
|
+
Get machine-readable JSON output
|
|
17
|
+
`,
|
|
18
|
+
];
|
|
19
|
+
static flags = {
|
|
20
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
21
|
+
'available-only': Flags.boolean({
|
|
22
|
+
description: 'show only features that are currently available',
|
|
23
|
+
default: false,
|
|
24
|
+
}),
|
|
25
|
+
output: Flags.string({
|
|
26
|
+
char: 'o',
|
|
27
|
+
description: 'output format',
|
|
28
|
+
default: 'text',
|
|
29
|
+
options: ['text', 'json'],
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
async run() {
|
|
33
|
+
const onlyAvailable = this.flags['available-only'];
|
|
34
|
+
if (this.flags.output === 'json') {
|
|
35
|
+
const features = getFeatures(onlyAvailable);
|
|
36
|
+
console.log(JSON.stringify(features, null, 2));
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
// Text output
|
|
40
|
+
this.log('');
|
|
41
|
+
this.log(chalk.bold.underline('Available Features for Raindrop Apps'));
|
|
42
|
+
this.log('');
|
|
43
|
+
const grouped = getFeaturesByCategory();
|
|
44
|
+
// Data & Storage
|
|
45
|
+
this.log(chalk.bold.cyan('📦 Data & Storage'));
|
|
46
|
+
this.log('');
|
|
47
|
+
for (const feature of grouped.data) {
|
|
48
|
+
if (onlyAvailable && !feature.available)
|
|
49
|
+
continue;
|
|
50
|
+
const command = feature.command
|
|
51
|
+
? chalk.dim(`\n $ ${feature.command}`)
|
|
52
|
+
: chalk.yellow(' (planned)');
|
|
53
|
+
this.log(` ${chalk.bold(feature.name.padEnd(20))} ${feature.description}${command}`);
|
|
54
|
+
this.log('');
|
|
55
|
+
}
|
|
56
|
+
// Architecture
|
|
57
|
+
this.log(chalk.bold.magenta('🏗 Architecture Patterns'));
|
|
58
|
+
this.log('');
|
|
59
|
+
for (const feature of grouped.architecture) {
|
|
60
|
+
if (onlyAvailable && !feature.available)
|
|
61
|
+
continue;
|
|
62
|
+
const command = feature.command
|
|
63
|
+
? chalk.dim(`\n $ ${feature.command}`)
|
|
64
|
+
: chalk.yellow(' (planned)');
|
|
65
|
+
this.log(` ${chalk.bold(feature.name.padEnd(20))} ${feature.description}${command}`);
|
|
66
|
+
this.log('');
|
|
67
|
+
}
|
|
68
|
+
// Integrations
|
|
69
|
+
this.log(chalk.bold.blue('🔌 Integrations'));
|
|
70
|
+
this.log('');
|
|
71
|
+
for (const feature of grouped.integration) {
|
|
72
|
+
if (onlyAvailable && !feature.available)
|
|
73
|
+
continue;
|
|
74
|
+
const command = feature.command
|
|
75
|
+
? chalk.dim(`\n $ ${feature.command}`)
|
|
76
|
+
: chalk.yellow(' (planned)');
|
|
77
|
+
this.log(` ${chalk.bold(feature.name.padEnd(20))} ${feature.description}${command}`);
|
|
78
|
+
this.log('');
|
|
79
|
+
}
|
|
80
|
+
this.log(chalk.dim('─'.repeat(60)));
|
|
81
|
+
const availableCount = getFeatures(true).length;
|
|
82
|
+
const totalCount = getFeatures(false).length;
|
|
83
|
+
this.log(chalk.dim(`${availableCount} available, ${totalCount - availableCount} planned`));
|
|
84
|
+
this.log('');
|
|
85
|
+
this.log(chalk.bold('How to add features:'));
|
|
86
|
+
this.log(chalk.dim(' Use the setup command for any feature above, for example:'));
|
|
87
|
+
this.log(chalk.dim(' $ raindrop build smartmemory setup'));
|
|
88
|
+
this.log(chalk.dim(' $ raindrop build smartsql setup'));
|
|
89
|
+
this.log(chalk.dim(' $ raindrop build smartbucket setup'));
|
|
90
|
+
this.log('');
|
|
91
|
+
this.log(chalk.bold('Common combinations:'));
|
|
92
|
+
this.log(chalk.dim(' Chatbot: smartmemory + smartsql + ai'));
|
|
93
|
+
this.log(chalk.dim(' File API: smartbucket + queue'));
|
|
94
|
+
this.log(chalk.dim(' Auth App: workos + smartmemory'));
|
|
95
|
+
this.log('');
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -10,5 +10,7 @@ export default class Generate extends BaseCommand<typeof Generate> {
|
|
|
10
10
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
};
|
|
12
12
|
run(): Promise<void>;
|
|
13
|
+
private suggestFeatures;
|
|
14
|
+
private hasExampleFile;
|
|
13
15
|
}
|
|
14
16
|
//# sourceMappingURL=generate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/commands/build/generate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/commands/build/generate.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAUpD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,WAAW,CAAC,OAAO,QAAQ,CAAC;IAChE,OAAgB,IAAI,KAAM;IAE1B,OAAgB,WAAW,SAAwD;IAEnF,OAAgB,QAAQ,WAA2C;IAEnE,OAAgB,KAAK;;;;;MAgBnB;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;YAoCnB,eAAe;YA6Cf,cAAc;CAQ7B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { valueOf } from '@liquidmetal-ai/drizzle/appify/build';
|
|
2
2
|
import { Flags } from '@oclif/core';
|
|
3
|
+
import chalk from 'chalk';
|
|
3
4
|
import * as fs from 'node:fs/promises';
|
|
4
5
|
import * as path from 'node:path';
|
|
5
6
|
import { BaseCommand } from '../../base-command.js';
|
|
@@ -49,5 +50,56 @@ export default class Generate extends BaseCommand {
|
|
|
49
50
|
await fs.mkdir(path.dirname(dest), { recursive: true });
|
|
50
51
|
await fs.writeFile(dest, gatherEnvForHandler(handler, app));
|
|
51
52
|
}
|
|
53
|
+
// Check for smart components in manifest and suggest features
|
|
54
|
+
await this.suggestFeatures();
|
|
55
|
+
}
|
|
56
|
+
async suggestFeatures() {
|
|
57
|
+
// Read manifest file to check for features (simpler than using app API)
|
|
58
|
+
const manifestPath = path.join(this.flags.root, this.flags.manifest);
|
|
59
|
+
let manifestContent = '';
|
|
60
|
+
try {
|
|
61
|
+
manifestContent = await fs.readFile(manifestPath, 'utf-8');
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return; // Silently skip if can't read manifest
|
|
65
|
+
}
|
|
66
|
+
const hasSmartMemory = /^\s*smartmemory\s+"/m.test(manifestContent);
|
|
67
|
+
const hasSmartSQL = /^\s*smartsql\s+"/m.test(manifestContent);
|
|
68
|
+
const hasSmartBucket = /^\s*smartbucket\s+"/m.test(manifestContent);
|
|
69
|
+
const hasQueue = /^\s*queue\s+"/m.test(manifestContent);
|
|
70
|
+
const suggestions = [];
|
|
71
|
+
if (hasSmartMemory && !await this.hasExampleFile('smartmemory-minimal.ts')) {
|
|
72
|
+
suggestions.push('raindrop build smartmemory setup');
|
|
73
|
+
}
|
|
74
|
+
if (hasSmartSQL && !await this.hasExampleFile('smartsql-minimal.ts')) {
|
|
75
|
+
suggestions.push('raindrop build smartsql setup');
|
|
76
|
+
}
|
|
77
|
+
if (hasSmartBucket && !await this.hasExampleFile('smartbucket-minimal.ts')) {
|
|
78
|
+
suggestions.push('raindrop build smartbucket setup');
|
|
79
|
+
}
|
|
80
|
+
if (hasQueue && !await this.hasExampleFile('queue-minimal.ts')) {
|
|
81
|
+
suggestions.push('raindrop build queue setup');
|
|
82
|
+
}
|
|
83
|
+
if (suggestions.length > 0) {
|
|
84
|
+
console.log('');
|
|
85
|
+
console.log(chalk.bold('Tip:') + ' Get working examples with setup commands:');
|
|
86
|
+
suggestions.forEach(cmd => console.log(chalk.dim(` ${cmd}`)));
|
|
87
|
+
console.log('');
|
|
88
|
+
}
|
|
89
|
+
// Show features command if no suggestions
|
|
90
|
+
if (suggestions.length === 0 && (hasSmartMemory || hasSmartSQL || hasSmartBucket || hasQueue)) {
|
|
91
|
+
console.log('');
|
|
92
|
+
console.log(chalk.dim('Tip: Explore available features with: raindrop build features'));
|
|
93
|
+
console.log('');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
async hasExampleFile(filename) {
|
|
97
|
+
try {
|
|
98
|
+
await fs.access(path.join(this.flags.root, 'src', 'examples', filename));
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
52
104
|
}
|
|
53
105
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/commands/build/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/commands/build/init.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIpD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW,CAAC,OAAO,IAAI,CAAC;IACxD,MAAM,CAAC,IAAI;;;;MAET;IAEF,MAAM,CAAC,WAAW,SAAwC;IAE1D,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;MAEV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAsD3B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { mustManifestFromString } from '@liquidmetal-ai/drizzle/appify/index';
|
|
2
2
|
import { Args, Flags } from '@oclif/core';
|
|
3
|
+
import chalk from 'chalk';
|
|
3
4
|
import fs from 'node:fs/promises';
|
|
4
5
|
import * as path from 'node:path';
|
|
5
6
|
import { BaseCommand } from '../../base-command.js';
|
|
@@ -55,5 +56,14 @@ Initialize a project in the current directory.
|
|
|
55
56
|
this.error(`Could not initialize project at ${this.args.path}: ${error}`, { exit: 1 });
|
|
56
57
|
}
|
|
57
58
|
console.log(`Initialized LiquidMetal.AI in ${this.args.path}`);
|
|
59
|
+
console.log('');
|
|
60
|
+
console.log(chalk.bold('Next steps:'));
|
|
61
|
+
console.log(' 1. cd', this.args.path);
|
|
62
|
+
console.log(' 2. npm install');
|
|
63
|
+
console.log(' 3. raindrop build generate');
|
|
64
|
+
console.log(' 4. raindrop build features');
|
|
65
|
+
console.log(' 5. raindrop build deploy --start');
|
|
66
|
+
console.log('');
|
|
67
|
+
console.log(chalk.dim('Tip: Discover available features with "raindrop build features"'));
|
|
58
68
|
}
|
|
59
69
|
}
|