@liquidmetal-ai/raindrop 0.7.0 → 0.8.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 +408 -73
- package/bin/cjs-shims.js +7 -0
- package/bin/run.js +20 -2
- package/bundle/chunk-5GH4FS6C.js +12148 -0
- package/bundle/chunk-6B4I2CKP.js +231 -0
- package/bundle/chunk-6UE75KX2.js +4481 -0
- package/bundle/chunk-AU3EGGJP.js +44 -0
- package/bundle/chunk-CDQRD3JA.js +75 -0
- package/bundle/chunk-CMCEP64V.js +380 -0
- package/bundle/chunk-CW5ZHVPX.js +292 -0
- package/bundle/chunk-G6NE675D.js +238720 -0
- package/bundle/chunk-GLIYVKQA.js +48 -0
- package/bundle/chunk-KXEV6E63.js +133 -0
- package/bundle/chunk-MCRKUPJY.js +4515 -0
- package/bundle/chunk-MGM2L2T3.js +805 -0
- package/bundle/chunk-MVQYQJHI.js +502 -0
- package/bundle/chunk-NG7CZTTE.js +147 -0
- package/bundle/chunk-PU4RCSXF.js +22452 -0
- package/bundle/chunk-VXAZKB3J.js +292 -0
- package/bundle/chunk-W2L3MYN6.js +4480 -0
- package/bundle/chunk-XYJACVNA.js +231 -0
- package/bundle/commands/annotation/get.js +153 -0
- package/bundle/commands/annotation/list.js +226 -0
- package/bundle/commands/annotation/put.js +177 -0
- package/bundle/commands/auth/list.js +75 -0
- package/bundle/commands/auth/login.js +1654 -0
- package/bundle/commands/auth/logout.js +27 -0
- package/bundle/commands/auth/select.js +53 -0
- package/bundle/commands/bucket/create-credential.js +173 -0
- package/bundle/commands/bucket/delete-credential.js +140 -0
- package/bundle/commands/bucket/get-credential.js +151 -0
- package/bundle/commands/bucket/list-credentials.js +148 -0
- package/bundle/commands/build/branch.js +126 -0
- package/bundle/commands/build/checkout.js +198 -0
- package/bundle/commands/build/clone.js +153 -0
- package/bundle/commands/build/delete.js +227 -0
- package/bundle/commands/build/deploy.js +160 -0
- package/bundle/commands/build/env/get.js +105 -0
- package/bundle/commands/build/env/set.js +115 -0
- package/bundle/commands/build/find.js +333 -0
- package/bundle/commands/build/generate.js +75 -0
- package/bundle/commands/build/init.js +76 -0
- package/bundle/commands/build/list.js +11 -0
- package/bundle/commands/build/sandbox.js +65 -0
- package/bundle/commands/build/start.js +84 -0
- package/bundle/commands/build/status.js +1839 -0
- package/bundle/commands/build/stop.js +84 -0
- package/bundle/commands/build/tools/check.js +32 -0
- package/bundle/commands/build/tools/fmt.js +49 -0
- package/bundle/commands/build/unsandbox.js +65 -0
- package/bundle/commands/build/upload.js +83 -0
- package/bundle/commands/build/validate.js +71 -0
- package/bundle/commands/build/workos/delete.js +86 -0
- package/bundle/commands/build/workos/env/attach.js +134 -0
- package/bundle/commands/build/workos/env/create.js +176 -0
- package/bundle/commands/build/workos/env/delete.js +84 -0
- package/bundle/commands/build/workos/env/detach.js +115 -0
- package/bundle/commands/build/workos/env/get.js +117 -0
- package/bundle/commands/build/workos/env/list.js +139 -0
- package/bundle/commands/build/workos/env/set.js +138 -0
- package/bundle/commands/build/workos/invite.js +91 -0
- package/bundle/commands/build/workos/setup.js +124 -0
- package/bundle/commands/build/workos/status.js +93 -0
- package/bundle/commands/dns/create.js +128 -0
- package/bundle/commands/dns/delete.js +80 -0
- package/bundle/commands/dns/get.js +167 -0
- package/bundle/commands/dns/list.js +193 -0
- package/bundle/commands/dns/records/create.js +150 -0
- package/bundle/commands/dns/records/delete.js +76 -0
- package/bundle/commands/dns/records/get.js +118 -0
- package/bundle/commands/dns/records/list.js +153 -0
- package/bundle/commands/dns/records/update.js +146 -0
- package/bundle/commands/logs/query.js +237 -0
- package/bundle/commands/logs/tail.js +155 -0
- package/bundle/commands/mcp/install-claude.js +220 -0
- package/bundle/commands/mcp/install-gemini.js +220 -0
- package/bundle/commands/mcp/install-goose.js +232 -0
- package/bundle/commands/mcp/status.js +153 -0
- package/bundle/commands/object/delete.js +180 -0
- package/bundle/commands/object/get.js +209 -0
- package/bundle/commands/object/list.js +206 -0
- package/bundle/commands/object/put.js +211 -0
- package/bundle/commands/query/chunk-search.js +123 -0
- package/bundle/commands/query/document.js +126 -0
- package/bundle/commands/query/events.js +98 -0
- package/bundle/commands/query/reindex.js +147 -0
- package/bundle/commands/query/search.js +169 -0
- package/bundle/commands/tail.js +31 -0
- package/bundle/index.js +51 -0
- package/dist/base-command.d.ts +6 -0
- package/dist/base-command.d.ts.map +1 -1
- package/dist/base-command.js +14 -1
- package/dist/build.d.ts +2 -1
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +169 -51
- package/dist/codegen.d.ts +1 -1
- package/dist/codegen.d.ts.map +1 -1
- package/dist/codegen.js +17 -3
- package/dist/codegen.test.js +44 -0
- package/dist/commands/build/checkout.d.ts.map +1 -1
- package/dist/commands/build/checkout.js +4 -0
- package/dist/commands/build/delete.d.ts.map +1 -1
- package/dist/commands/build/delete.js +6 -3
- package/dist/commands/build/deploy.d.ts.map +1 -1
- package/dist/commands/build/deploy.js +10 -2
- package/dist/commands/build/find.d.ts +1 -0
- package/dist/commands/build/find.d.ts.map +1 -1
- package/dist/commands/build/find.js +33 -2
- package/dist/commands/build/validate.d.ts.map +1 -1
- package/dist/commands/build/validate.js +0 -1
- package/dist/commands/build/workos/delete.d.ts +18 -0
- package/dist/commands/build/workos/delete.d.ts.map +1 -0
- package/dist/commands/build/workos/delete.js +72 -0
- package/dist/commands/build/workos/env/attach.d.ts +24 -0
- package/dist/commands/build/workos/env/attach.d.ts.map +1 -0
- package/dist/commands/build/workos/env/attach.js +111 -0
- package/dist/commands/build/workos/env/create.d.ts +26 -0
- package/dist/commands/build/workos/env/create.d.ts.map +1 -0
- package/dist/commands/build/workos/env/create.js +156 -0
- package/dist/commands/build/workos/env/delete.d.ts +20 -0
- package/dist/commands/build/workos/env/delete.d.ts.map +1 -0
- package/dist/commands/build/workos/env/delete.js +61 -0
- package/dist/commands/build/workos/env/detach.d.ts +21 -0
- package/dist/commands/build/workos/env/detach.d.ts.map +1 -0
- package/dist/commands/build/workos/env/detach.js +94 -0
- package/dist/commands/build/workos/env/get.d.ts +20 -0
- package/dist/commands/build/workos/env/get.d.ts.map +1 -0
- package/dist/commands/build/workos/env/get.js +94 -0
- package/dist/commands/build/workos/env/list.d.ts +18 -0
- package/dist/commands/build/workos/env/list.d.ts.map +1 -0
- package/dist/commands/build/workos/env/list.js +114 -0
- package/dist/commands/build/workos/env/set.d.ts +27 -0
- package/dist/commands/build/workos/env/set.d.ts.map +1 -0
- package/dist/commands/build/workos/env/set.js +115 -0
- package/dist/commands/build/workos/invite.d.ts +21 -0
- package/dist/commands/build/workos/invite.d.ts.map +1 -0
- package/dist/commands/build/workos/invite.js +68 -0
- package/dist/commands/build/workos/setup.d.ts +20 -0
- package/dist/commands/build/workos/setup.d.ts.map +1 -0
- package/dist/commands/build/workos/setup.js +106 -0
- package/dist/commands/build/workos/status.d.ts +18 -0
- package/dist/commands/build/workos/status.d.ts.map +1 -0
- package/dist/commands/build/workos/status.js +70 -0
- package/dist/commands/mcp/install-claude.d.ts.map +1 -1
- package/dist/commands/mcp/install-claude.js +0 -2
- package/dist/commands/mcp/install-gemini.d.ts.map +1 -1
- package/dist/commands/mcp/install-gemini.js +0 -2
- package/dist/commands/mcp/install-goose.d.ts.map +1 -1
- package/dist/commands/mcp/install-goose.js +0 -2
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/oclif.manifest.json +4286 -2208
- package/package.json +8 -5
- package/templates/claude-code/debug-raindrop-app.md +89 -0
- package/templates/claude-code/new-raindrop-app.md +10 -6
- package/templates/claude-code/reattach-raindrop-session.md +50 -12
- package/templates/claude-code/update-raindrop-app.md +61 -9
- 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 +2 -2
- package/templates/db/node_modules/.bin/tsserver +2 -2
- package/templates/db/node_modules/.bin/zx +2 -2
- package/templates/gemini-code/debug-raindrop-app.toml +86 -0
- package/templates/gemini-code/new-raindrop-app.toml +9 -5
- package/templates/gemini-code/reattach-raindrop-session.toml +9 -11
- package/templates/gemini-code/update-raindrop-app.toml +55 -10
- package/templates/goose/debug-raindrop-app.yaml +91 -0
- package/templates/goose/new-raindrop-app.yaml +12 -7
- package/templates/goose/reattach-raindrop-session.yaml +11 -4
- package/templates/goose/update-raindrop-app.yaml +57 -5
- package/templates/init/src/_app/auth.ts +18 -0
- package/templates/init/src/_app/cors.ts +64 -0
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/templates/claude-code/raindrop-guidelines.md +0 -322
- package/templates/gemini-code/raindrop-guidelines.md +0 -322
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseCommand
|
|
3
|
+
} from "../../chunk-MCRKUPJY.js";
|
|
4
|
+
import {
|
|
5
|
+
__toESM,
|
|
6
|
+
init_cjs_shims,
|
|
7
|
+
require_lib,
|
|
8
|
+
valueOf
|
|
9
|
+
} from "../../chunk-G6NE675D.js";
|
|
10
|
+
|
|
11
|
+
// src/commands/build/stop.ts
|
|
12
|
+
init_cjs_shims();
|
|
13
|
+
var import_core = __toESM(require_lib(), 1);
|
|
14
|
+
var Stop = class extends BaseCommand {
|
|
15
|
+
static args = {};
|
|
16
|
+
static description = "stop a Raindrop application";
|
|
17
|
+
static examples = [
|
|
18
|
+
`<%= config.bin %> <%= command.id %> .
|
|
19
|
+
Stop a Raindrop application.
|
|
20
|
+
`
|
|
21
|
+
];
|
|
22
|
+
static flags = {
|
|
23
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
24
|
+
root: import_core.Flags.string({ char: "r", description: "root directory", required: false, default: process.cwd() }),
|
|
25
|
+
manifest: import_core.Flags.string({
|
|
26
|
+
char: "M",
|
|
27
|
+
description: "project manifest",
|
|
28
|
+
required: false,
|
|
29
|
+
default: "raindrop.manifest"
|
|
30
|
+
}),
|
|
31
|
+
application: import_core.Flags.string({
|
|
32
|
+
char: "a",
|
|
33
|
+
description: "application to stop",
|
|
34
|
+
required: false
|
|
35
|
+
}),
|
|
36
|
+
version: import_core.Flags.string({
|
|
37
|
+
char: "v",
|
|
38
|
+
description: "application version to start",
|
|
39
|
+
required: false
|
|
40
|
+
}),
|
|
41
|
+
impersonate: import_core.Flags.string({
|
|
42
|
+
char: "i",
|
|
43
|
+
description: "impersonate organization",
|
|
44
|
+
required: false,
|
|
45
|
+
hidden: true
|
|
46
|
+
})
|
|
47
|
+
};
|
|
48
|
+
async run() {
|
|
49
|
+
const config = await this.loadConfig();
|
|
50
|
+
if (config.lock) {
|
|
51
|
+
this.error("Operation not allowed: application is in a locked state");
|
|
52
|
+
}
|
|
53
|
+
const { client: catalogService, userId, organizationId: defaultOrganizationId } = await this.catalogService();
|
|
54
|
+
const organizationId = this.flags.impersonate ?? defaultOrganizationId;
|
|
55
|
+
let applicationName = this.flags.application;
|
|
56
|
+
if (!applicationName) {
|
|
57
|
+
const apps = await this.loadManifest();
|
|
58
|
+
const app = apps[0];
|
|
59
|
+
if (!app) {
|
|
60
|
+
this.error("No application found");
|
|
61
|
+
}
|
|
62
|
+
applicationName = valueOf(app.name);
|
|
63
|
+
}
|
|
64
|
+
const currentVersionId = this.flags.version ?? config.versionId;
|
|
65
|
+
if (!currentVersionId) {
|
|
66
|
+
this.error("Expected a --version flag to be provided when a version is not currently set");
|
|
67
|
+
}
|
|
68
|
+
await catalogService.setActive({
|
|
69
|
+
userId,
|
|
70
|
+
organizationId,
|
|
71
|
+
applications: [
|
|
72
|
+
{
|
|
73
|
+
applicationName,
|
|
74
|
+
currentVersionId,
|
|
75
|
+
isActive: false
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
});
|
|
79
|
+
console.log(`Set ${applicationName}@${currentVersionId} as stopped.`);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
export {
|
|
83
|
+
Stop as default
|
|
84
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseCommand
|
|
3
|
+
} from "../../../chunk-MCRKUPJY.js";
|
|
4
|
+
import {
|
|
5
|
+
__toESM,
|
|
6
|
+
init_cjs_shims,
|
|
7
|
+
require_lib
|
|
8
|
+
} from "../../../chunk-G6NE675D.js";
|
|
9
|
+
|
|
10
|
+
// src/commands/build/tools/check.ts
|
|
11
|
+
init_cjs_shims();
|
|
12
|
+
var import_core = __toESM(require_lib(), 1);
|
|
13
|
+
var Check = class extends BaseCommand {
|
|
14
|
+
static args = {};
|
|
15
|
+
static description = "validate a LiquidMetal.AI raindrop.manifest";
|
|
16
|
+
static examples = ["<%= config.bin %> <%= command.id %>"];
|
|
17
|
+
static flags = {
|
|
18
|
+
root: import_core.Flags.string({ char: "r", description: "root directory", required: false, default: process.cwd() }),
|
|
19
|
+
manifest: import_core.Flags.string({
|
|
20
|
+
char: "m",
|
|
21
|
+
description: "project manifest",
|
|
22
|
+
required: false,
|
|
23
|
+
default: "raindrop.manifest"
|
|
24
|
+
})
|
|
25
|
+
};
|
|
26
|
+
async run() {
|
|
27
|
+
await this.loadManifest();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
Check as default
|
|
32
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseCommand
|
|
3
|
+
} from "../../../chunk-MCRKUPJY.js";
|
|
4
|
+
import {
|
|
5
|
+
Parser,
|
|
6
|
+
Tokenizer,
|
|
7
|
+
__toESM,
|
|
8
|
+
fmt,
|
|
9
|
+
init_cjs_shims,
|
|
10
|
+
require_lib
|
|
11
|
+
} from "../../../chunk-G6NE675D.js";
|
|
12
|
+
|
|
13
|
+
// src/commands/build/tools/fmt.ts
|
|
14
|
+
init_cjs_shims();
|
|
15
|
+
var import_core = __toESM(require_lib(), 1);
|
|
16
|
+
import * as fs from "node:fs/promises";
|
|
17
|
+
import * as path from "node:path";
|
|
18
|
+
var Fmt = class extends BaseCommand {
|
|
19
|
+
static args = {};
|
|
20
|
+
static description = "format a LiquidMetal.AI raindrop.manifest";
|
|
21
|
+
static examples = ["<%= config.bin %> <%= command.id %>"];
|
|
22
|
+
static flags = {
|
|
23
|
+
root: import_core.Flags.string({ char: "r", description: "root directory", required: false, default: process.cwd() }),
|
|
24
|
+
manifest: import_core.Flags.string({
|
|
25
|
+
char: "m",
|
|
26
|
+
description: "project manifest",
|
|
27
|
+
required: false,
|
|
28
|
+
default: "raindrop.manifest"
|
|
29
|
+
})
|
|
30
|
+
};
|
|
31
|
+
async run() {
|
|
32
|
+
let manifestPath = this.flags.manifest;
|
|
33
|
+
if (this.flags.root) {
|
|
34
|
+
manifestPath = path.isAbsolute(this.flags.manifest) ? this.flags.manifest : path.join(this.flags.root, this.flags.manifest);
|
|
35
|
+
}
|
|
36
|
+
const contents = await fs.readFile(manifestPath, "utf-8");
|
|
37
|
+
const tokenizer = new Tokenizer(contents);
|
|
38
|
+
const parser = new Parser(tokenizer);
|
|
39
|
+
const ast = parser.parse();
|
|
40
|
+
if (parser.errors.length > 0) {
|
|
41
|
+
this.error("errors parsing manifest", { exit: 1 });
|
|
42
|
+
}
|
|
43
|
+
const formatted = fmt(ast);
|
|
44
|
+
await fs.writeFile(manifestPath, formatted);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
Fmt as default
|
|
49
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {
|
|
2
|
+
sandbox
|
|
3
|
+
} from "../../chunk-XYJACVNA.js";
|
|
4
|
+
import "../../chunk-MGM2L2T3.js";
|
|
5
|
+
import "../../chunk-VXAZKB3J.js";
|
|
6
|
+
import "../../chunk-W2L3MYN6.js";
|
|
7
|
+
import "../../chunk-PU4RCSXF.js";
|
|
8
|
+
import {
|
|
9
|
+
BaseCommand
|
|
10
|
+
} from "../../chunk-MCRKUPJY.js";
|
|
11
|
+
import {
|
|
12
|
+
__toESM,
|
|
13
|
+
init_cjs_shims,
|
|
14
|
+
require_lib
|
|
15
|
+
} from "../../chunk-G6NE675D.js";
|
|
16
|
+
|
|
17
|
+
// src/commands/build/unsandbox.ts
|
|
18
|
+
init_cjs_shims();
|
|
19
|
+
var import_core = __toESM(require_lib(), 1);
|
|
20
|
+
var Unsandbox = class extends BaseCommand {
|
|
21
|
+
static args = {};
|
|
22
|
+
static description = "mark a version as unsandboxed in the Raindrop catalog";
|
|
23
|
+
static examples = [
|
|
24
|
+
`<%= config.bin %> <%= command.id %>
|
|
25
|
+
`
|
|
26
|
+
];
|
|
27
|
+
static flags = {
|
|
28
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
29
|
+
impersonate: import_core.Flags.string({
|
|
30
|
+
char: "i",
|
|
31
|
+
description: "impersonate organization",
|
|
32
|
+
required: false,
|
|
33
|
+
hidden: true
|
|
34
|
+
}),
|
|
35
|
+
manifest: import_core.Flags.string({ default: "raindrop.manifest", description: "project manifest" }),
|
|
36
|
+
version: import_core.Flags.string({
|
|
37
|
+
char: "v",
|
|
38
|
+
description: "application version to unsandbox",
|
|
39
|
+
required: false
|
|
40
|
+
})
|
|
41
|
+
};
|
|
42
|
+
async run() {
|
|
43
|
+
let applications;
|
|
44
|
+
try {
|
|
45
|
+
applications = await sandbox({
|
|
46
|
+
command: this,
|
|
47
|
+
isSandboxed: false,
|
|
48
|
+
impersonate: this.flags.impersonate,
|
|
49
|
+
versionId: this.flags.version
|
|
50
|
+
});
|
|
51
|
+
} catch (error) {
|
|
52
|
+
if (error instanceof Error) {
|
|
53
|
+
this.error(error.message);
|
|
54
|
+
}
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
for (const app of applications) {
|
|
58
|
+
const { applicationName, currentVersionId } = app;
|
|
59
|
+
this.log(`Set ${applicationName}@${currentVersionId} as unsandboxed.`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
export {
|
|
64
|
+
Unsandbox as default
|
|
65
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FileSystemBundle,
|
|
3
|
+
archive
|
|
4
|
+
} from "../../chunk-MGM2L2T3.js";
|
|
5
|
+
import {
|
|
6
|
+
buildHandlers
|
|
7
|
+
} from "../../chunk-VXAZKB3J.js";
|
|
8
|
+
import "../../chunk-W2L3MYN6.js";
|
|
9
|
+
import {
|
|
10
|
+
BaseCommand
|
|
11
|
+
} from "../../chunk-MCRKUPJY.js";
|
|
12
|
+
import {
|
|
13
|
+
BundleArchiveType,
|
|
14
|
+
__toESM,
|
|
15
|
+
init_cjs_shims,
|
|
16
|
+
require_lib,
|
|
17
|
+
valueOf
|
|
18
|
+
} from "../../chunk-G6NE675D.js";
|
|
19
|
+
|
|
20
|
+
// src/commands/build/upload.ts
|
|
21
|
+
init_cjs_shims();
|
|
22
|
+
var import_core = __toESM(require_lib(), 1);
|
|
23
|
+
import path from "node:path";
|
|
24
|
+
var Upload = class extends BaseCommand {
|
|
25
|
+
static args = {};
|
|
26
|
+
static description = "build and validate a LiquidMetal.AI project";
|
|
27
|
+
static examples = ["<%= config.bin %> <%= command.id %>"];
|
|
28
|
+
static flags = {
|
|
29
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
30
|
+
root: import_core.Flags.string({ char: "r", description: "root directory", required: false, default: process.cwd() }),
|
|
31
|
+
manifest: import_core.Flags.string({
|
|
32
|
+
char: "M",
|
|
33
|
+
description: "project manifest",
|
|
34
|
+
required: false,
|
|
35
|
+
default: "raindrop.manifest"
|
|
36
|
+
}),
|
|
37
|
+
output: import_core.Flags.string({ char: "o", description: "output directory", required: false, default: "dist" }),
|
|
38
|
+
versionId: import_core.Flags.string({ char: "v", description: "version ID", required: true }),
|
|
39
|
+
impersonate: import_core.Flags.string({
|
|
40
|
+
char: "i",
|
|
41
|
+
description: "impersonate organization",
|
|
42
|
+
required: false,
|
|
43
|
+
hidden: true
|
|
44
|
+
})
|
|
45
|
+
};
|
|
46
|
+
async run() {
|
|
47
|
+
const apps = await this.loadManifest();
|
|
48
|
+
const buildDir = path.isAbsolute(this.flags.output) ? this.flags.output : path.join(this.flags.root, this.flags.output);
|
|
49
|
+
await buildHandlers(this, apps, buildDir, this.flags.root);
|
|
50
|
+
const { client: catalogService, organizationId: defaultOrganizationId, userId } = await this.catalogService();
|
|
51
|
+
const organizationId = this.flags.impersonate ?? defaultOrganizationId;
|
|
52
|
+
const config = await this.loadConfig();
|
|
53
|
+
const app = apps[0];
|
|
54
|
+
if (!app) {
|
|
55
|
+
this.error("No application found in manifest", { exit: 1 });
|
|
56
|
+
}
|
|
57
|
+
for (const handler of app.handlers()) {
|
|
58
|
+
const bundle = new FileSystemBundle(path.join(buildDir, valueOf(handler.name)));
|
|
59
|
+
await catalogService.uploadBundle({
|
|
60
|
+
userId,
|
|
61
|
+
organizationId,
|
|
62
|
+
applicationName: valueOf(app.name),
|
|
63
|
+
applicationVersionId: this.flags.versionId || config.versionId || "",
|
|
64
|
+
archiveType: BundleArchiveType.ZIP,
|
|
65
|
+
bundleName: valueOf(handler.name),
|
|
66
|
+
archive: Buffer.from(await archive(bundle))
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
const dbBundle = new FileSystemBundle(path.join(this.flags.root, "db"));
|
|
70
|
+
await catalogService.uploadBundle({
|
|
71
|
+
userId,
|
|
72
|
+
organizationId,
|
|
73
|
+
applicationName: valueOf(app.name),
|
|
74
|
+
applicationVersionId: this.flags.versionId || config.versionId || "",
|
|
75
|
+
archiveType: BundleArchiveType.ZIP,
|
|
76
|
+
bundleName: "db",
|
|
77
|
+
archive: Buffer.from(await archive(dbBundle))
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
export {
|
|
82
|
+
Upload as default
|
|
83
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildHandlers
|
|
3
|
+
} from "../../chunk-VXAZKB3J.js";
|
|
4
|
+
import "../../chunk-W2L3MYN6.js";
|
|
5
|
+
import {
|
|
6
|
+
BaseCommand
|
|
7
|
+
} from "../../chunk-MCRKUPJY.js";
|
|
8
|
+
import {
|
|
9
|
+
__toESM,
|
|
10
|
+
init_cjs_shims,
|
|
11
|
+
require_lib
|
|
12
|
+
} from "../../chunk-G6NE675D.js";
|
|
13
|
+
|
|
14
|
+
// src/commands/build/validate.ts
|
|
15
|
+
init_cjs_shims();
|
|
16
|
+
var import_core = __toESM(require_lib(), 1);
|
|
17
|
+
import { spawn } from "node:child_process";
|
|
18
|
+
import path from "node:path";
|
|
19
|
+
async function runTypeCheck(root) {
|
|
20
|
+
return new Promise((resolve) => {
|
|
21
|
+
const tsc = spawn("npx", ["tsc", "--noEmit"], {
|
|
22
|
+
cwd: root,
|
|
23
|
+
stdio: "inherit"
|
|
24
|
+
// Inherit stdio to show compiler output in real-time
|
|
25
|
+
});
|
|
26
|
+
tsc.on("exit", (code) => {
|
|
27
|
+
resolve(code === 0);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
var Build = class extends BaseCommand {
|
|
32
|
+
static args = {};
|
|
33
|
+
static description = "build and validate a LiquidMetal.AI project";
|
|
34
|
+
static examples = ["<%= config.bin %> <%= command.id %>"];
|
|
35
|
+
static flags = {
|
|
36
|
+
root: import_core.Flags.string({ char: "r", description: "root directory", required: false, default: process.cwd() }),
|
|
37
|
+
manifest: import_core.Flags.string({
|
|
38
|
+
char: "M",
|
|
39
|
+
description: "project manifest",
|
|
40
|
+
required: false,
|
|
41
|
+
default: "raindrop.manifest"
|
|
42
|
+
}),
|
|
43
|
+
config: import_core.Flags.string({
|
|
44
|
+
char: "c",
|
|
45
|
+
description: "config file",
|
|
46
|
+
required: false,
|
|
47
|
+
hidden: true,
|
|
48
|
+
default: ".raindrop/config.json"
|
|
49
|
+
}),
|
|
50
|
+
output: import_core.Flags.string({ char: "o", description: "output directory", required: false, default: "dist" })
|
|
51
|
+
};
|
|
52
|
+
async run() {
|
|
53
|
+
const apps = await this.loadManifest();
|
|
54
|
+
const version = await this.raindropFrameworkVersion();
|
|
55
|
+
if (version === null) {
|
|
56
|
+
this.error("Failed to determine @liquidmetal-ai/raindrop-framework version; is it installed?", { exit: 1 });
|
|
57
|
+
}
|
|
58
|
+
console.log(`Using @liquidmetal-ai/raindrop-framework version ${version}`);
|
|
59
|
+
console.log("Running type check...");
|
|
60
|
+
const typeCheckPassed = await runTypeCheck(this.flags.root);
|
|
61
|
+
if (!typeCheckPassed) {
|
|
62
|
+
this.error("Type check failed. Please fix the TypeScript errors before building.");
|
|
63
|
+
}
|
|
64
|
+
console.log("Type check passed");
|
|
65
|
+
const buildDir = path.isAbsolute(this.flags.output) ? this.flags.output : path.join(this.flags.root, this.flags.output);
|
|
66
|
+
await buildHandlers(this, apps, buildDir, this.flags.root);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
Build as default
|
|
71
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import {
|
|
2
|
+
source_default
|
|
3
|
+
} from "../../../chunk-MVQYQJHI.js";
|
|
4
|
+
import {
|
|
5
|
+
esm_default
|
|
6
|
+
} from "../../../chunk-5GH4FS6C.js";
|
|
7
|
+
import {
|
|
8
|
+
BaseCommand
|
|
9
|
+
} from "../../../chunk-MCRKUPJY.js";
|
|
10
|
+
import {
|
|
11
|
+
__toESM,
|
|
12
|
+
init_cjs_shims,
|
|
13
|
+
require_lib
|
|
14
|
+
} from "../../../chunk-G6NE675D.js";
|
|
15
|
+
|
|
16
|
+
// src/commands/build/workos/delete.ts
|
|
17
|
+
init_cjs_shims();
|
|
18
|
+
var import_core = __toESM(require_lib(), 1);
|
|
19
|
+
var Delete = class extends BaseCommand {
|
|
20
|
+
static args = {};
|
|
21
|
+
static description = "Delete all WorkOS integration state from the organization";
|
|
22
|
+
static examples = [
|
|
23
|
+
`<%= config.bin %> <%= command.id %>
|
|
24
|
+
Delete all WorkOS state with confirmation prompt
|
|
25
|
+
|
|
26
|
+
<%= config.bin %> <%= command.id %> --force
|
|
27
|
+
Delete all WorkOS state without confirmation prompt
|
|
28
|
+
`
|
|
29
|
+
];
|
|
30
|
+
static flags = {
|
|
31
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
32
|
+
force: import_core.Flags.boolean({
|
|
33
|
+
char: "f",
|
|
34
|
+
description: "Skip confirmation prompt",
|
|
35
|
+
default: false
|
|
36
|
+
})
|
|
37
|
+
};
|
|
38
|
+
async run() {
|
|
39
|
+
const { client: workosService, userId, organizationId } = await this.workosIntegrationService();
|
|
40
|
+
this.log("");
|
|
41
|
+
this.log(source_default.red.bold("\u26A0\uFE0F WARNING: DESTRUCTIVE OPERATION"));
|
|
42
|
+
this.log(source_default.red("\u2501".repeat(50)));
|
|
43
|
+
this.log("");
|
|
44
|
+
this.log("This command will permanently delete ALL WorkOS integration state:");
|
|
45
|
+
this.log("");
|
|
46
|
+
this.log(source_default.yellow(" \u2022 WorkOS team information"));
|
|
47
|
+
this.log(source_default.yellow(" \u2022 All environment configurations"));
|
|
48
|
+
this.log(source_default.yellow(" \u2022 All API keys stored in state"));
|
|
49
|
+
this.log(source_default.yellow(" \u2022 Primary organization name"));
|
|
50
|
+
this.log("");
|
|
51
|
+
this.log(source_default.dim("Note: This only affects local state. Nothing will be deleted from"));
|
|
52
|
+
this.log(source_default.dim("WorkOS itself. You must manage WorkOS resources separately."));
|
|
53
|
+
this.log("");
|
|
54
|
+
this.log(source_default.red("This action CANNOT be undone!"));
|
|
55
|
+
this.log(source_default.red("\u2501".repeat(50)));
|
|
56
|
+
this.log("");
|
|
57
|
+
if (!this.flags.force) {
|
|
58
|
+
const shouldDelete = await esm_default({
|
|
59
|
+
message: "Are you absolutely sure you want to delete all WorkOS state?",
|
|
60
|
+
default: false
|
|
61
|
+
});
|
|
62
|
+
if (!shouldDelete) {
|
|
63
|
+
this.log(source_default.dim("Deletion cancelled"));
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
this.log("Deleting all WorkOS state...");
|
|
69
|
+
await workosService.deleteAllWorkOSState({
|
|
70
|
+
userId,
|
|
71
|
+
organizationId
|
|
72
|
+
});
|
|
73
|
+
this.log("");
|
|
74
|
+
this.log(source_default.green("\u2713 All WorkOS state has been deleted successfully"));
|
|
75
|
+
this.log("");
|
|
76
|
+
this.log(source_default.dim("To re-activate WorkOS integration, run:"));
|
|
77
|
+
this.log(source_default.dim(" raindrop build workos setup --admin-email <email>"));
|
|
78
|
+
} catch (error) {
|
|
79
|
+
const err = error;
|
|
80
|
+
this.error(`Failed to delete WorkOS state: ${err.message}`, { exit: 1 });
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
export {
|
|
85
|
+
Delete as default
|
|
86
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import {
|
|
2
|
+
source_default
|
|
3
|
+
} from "../../../../chunk-MVQYQJHI.js";
|
|
4
|
+
import {
|
|
5
|
+
BaseCommand
|
|
6
|
+
} from "../../../../chunk-MCRKUPJY.js";
|
|
7
|
+
import {
|
|
8
|
+
__toESM,
|
|
9
|
+
init_cjs_shims,
|
|
10
|
+
require_lib,
|
|
11
|
+
valueOf
|
|
12
|
+
} from "../../../../chunk-G6NE675D.js";
|
|
13
|
+
|
|
14
|
+
// src/commands/build/workos/env/attach.ts
|
|
15
|
+
init_cjs_shims();
|
|
16
|
+
var import_core = __toESM(require_lib(), 1);
|
|
17
|
+
var Attach = class extends BaseCommand {
|
|
18
|
+
static args = {
|
|
19
|
+
envName: import_core.Args.string({
|
|
20
|
+
description: "WorkOS environment name (defaults to application name)",
|
|
21
|
+
required: false
|
|
22
|
+
})
|
|
23
|
+
};
|
|
24
|
+
static description = "Attach a WorkOS environment to an application version";
|
|
25
|
+
static examples = [
|
|
26
|
+
`<%= config.bin %> <%= command.id %>
|
|
27
|
+
Attach environment with same name as application
|
|
28
|
+
|
|
29
|
+
<%= config.bin %> <%= command.id %> my-env
|
|
30
|
+
Attach specific environment
|
|
31
|
+
|
|
32
|
+
<%= config.bin %> <%= command.id %> my-env --application my-app --versionId abc123
|
|
33
|
+
Attach to specific application and version
|
|
34
|
+
`
|
|
35
|
+
];
|
|
36
|
+
static flags = {
|
|
37
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
38
|
+
root: import_core.Flags.string({
|
|
39
|
+
char: "r",
|
|
40
|
+
description: "root directory",
|
|
41
|
+
required: false,
|
|
42
|
+
default: process.cwd()
|
|
43
|
+
}),
|
|
44
|
+
manifest: import_core.Flags.string({
|
|
45
|
+
char: "M",
|
|
46
|
+
description: "project manifest",
|
|
47
|
+
required: false,
|
|
48
|
+
default: "raindrop.manifest"
|
|
49
|
+
}),
|
|
50
|
+
application: import_core.Flags.string({
|
|
51
|
+
char: "a",
|
|
52
|
+
description: "application name",
|
|
53
|
+
required: false
|
|
54
|
+
}),
|
|
55
|
+
versionId: import_core.Flags.string({
|
|
56
|
+
char: "v",
|
|
57
|
+
aliases: ["version"],
|
|
58
|
+
description: "version ID",
|
|
59
|
+
required: false
|
|
60
|
+
}),
|
|
61
|
+
output: import_core.Flags.string({
|
|
62
|
+
char: "o",
|
|
63
|
+
description: "output format",
|
|
64
|
+
default: "text",
|
|
65
|
+
options: ["text", "json"]
|
|
66
|
+
})
|
|
67
|
+
};
|
|
68
|
+
async run() {
|
|
69
|
+
const apps = await this.loadManifest();
|
|
70
|
+
const app = apps.find((app2) => valueOf(app2.name) === this.flags.application) || apps[0];
|
|
71
|
+
if (app === void 0) {
|
|
72
|
+
this.error(`application ${this.flags.application} not found in manifest`, { exit: 1 });
|
|
73
|
+
}
|
|
74
|
+
const applicationName = valueOf(app.name);
|
|
75
|
+
const environmentName = this.args.envName || applicationName;
|
|
76
|
+
const config = await this.loadConfig();
|
|
77
|
+
const versionId = this.flags.versionId || config.versionId;
|
|
78
|
+
if (!versionId) {
|
|
79
|
+
this.error(
|
|
80
|
+
"No version ID found. Deploy your application first with: raindrop build deploy",
|
|
81
|
+
{ exit: 1 }
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
const { client: workosService, userId, organizationId } = await this.workosIntegrationService();
|
|
85
|
+
try {
|
|
86
|
+
await workosService.attachEnvironmentToVersion({
|
|
87
|
+
userId,
|
|
88
|
+
organizationId,
|
|
89
|
+
applicationName,
|
|
90
|
+
versionId,
|
|
91
|
+
environmentName
|
|
92
|
+
});
|
|
93
|
+
switch (this.flags.output) {
|
|
94
|
+
case "json":
|
|
95
|
+
console.log(
|
|
96
|
+
JSON.stringify(
|
|
97
|
+
{
|
|
98
|
+
success: true,
|
|
99
|
+
applicationName,
|
|
100
|
+
versionId,
|
|
101
|
+
environmentName
|
|
102
|
+
},
|
|
103
|
+
null,
|
|
104
|
+
2
|
|
105
|
+
)
|
|
106
|
+
);
|
|
107
|
+
break;
|
|
108
|
+
case "text":
|
|
109
|
+
default:
|
|
110
|
+
this.log(source_default.green("\u2713") + ` WorkOS environment attached`);
|
|
111
|
+
this.log("");
|
|
112
|
+
this.log(` ${source_default.cyan("Application:")} ${applicationName}`);
|
|
113
|
+
this.log(` ${source_default.cyan("Version ID:")} ${versionId}`);
|
|
114
|
+
this.log(` ${source_default.cyan("Environment:")} ${environmentName}`);
|
|
115
|
+
this.log("");
|
|
116
|
+
this.log(source_default.dim("The WORKOS_ENVIRONMENT variable has been set for this version."));
|
|
117
|
+
this.log(source_default.dim("Changes will take effect after convergence completes."));
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
} catch (error) {
|
|
121
|
+
const err = error;
|
|
122
|
+
if (err.message.includes("not found")) {
|
|
123
|
+
this.error(
|
|
124
|
+
`WorkOS environment '${environmentName}' not found. Create it first with: raindrop build workos env create ${environmentName}`,
|
|
125
|
+
{ exit: 1 }
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
this.error(`Failed to attach WorkOS environment: ${err.message}`, { exit: 1 });
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
export {
|
|
133
|
+
Attach as default
|
|
134
|
+
};
|