@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,232 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseCommand
|
|
3
|
+
} from "../../chunk-MCRKUPJY.js";
|
|
4
|
+
import {
|
|
5
|
+
init_cjs_shims,
|
|
6
|
+
urlifyOrganizationId
|
|
7
|
+
} from "../../chunk-G6NE675D.js";
|
|
8
|
+
|
|
9
|
+
// src/commands/mcp/install-goose.ts
|
|
10
|
+
init_cjs_shims();
|
|
11
|
+
import { spawn } from "node:child_process";
|
|
12
|
+
import { readFile, writeFile, mkdir, access } from "node:fs/promises";
|
|
13
|
+
import { dirname, join } from "node:path";
|
|
14
|
+
import { fileURLToPath } from "node:url";
|
|
15
|
+
import { homedir } from "node:os";
|
|
16
|
+
import { constants } from "node:fs";
|
|
17
|
+
var McpInstallGoose = class extends BaseCommand {
|
|
18
|
+
static description = "Install complete Raindrop integration for Goose";
|
|
19
|
+
static examples = [
|
|
20
|
+
`<%= config.bin %> mcp install-goose
|
|
21
|
+
Install Raindrop MCP server and Goose configuration files
|
|
22
|
+
|
|
23
|
+
This command will:
|
|
24
|
+
- Check if Goose is installed and accessible
|
|
25
|
+
- Verify if raindrop-mcp server already exists (prevents duplicates)
|
|
26
|
+
- Add the raindrop-mcp extension to your Goose configuration
|
|
27
|
+
- Create Goose recipe files in ~/.config/goose/recipes/:
|
|
28
|
+
\u2022 new-raindrop-app.yaml - Start new Raindrop application development
|
|
29
|
+
\u2022 update-raindrop-app.yaml - Update existing Raindrop applications
|
|
30
|
+
\u2022 reattach-raindrop-session.yaml - Resume previous development sessions
|
|
31
|
+
|
|
32
|
+
Requirements:
|
|
33
|
+
- Goose must be installed (https://block.github.io/goose/)
|
|
34
|
+
- You must be logged into your Raindrop organization via 'raindrop auth login'
|
|
35
|
+
`
|
|
36
|
+
];
|
|
37
|
+
static flags = {
|
|
38
|
+
...BaseCommand.HIDDEN_FLAGS
|
|
39
|
+
};
|
|
40
|
+
async run() {
|
|
41
|
+
await this.installGooseIntegration();
|
|
42
|
+
await this.createGooseConfigFiles();
|
|
43
|
+
}
|
|
44
|
+
async installGooseIntegration() {
|
|
45
|
+
console.log("\u{1F50D} Checking if Goose is installed...");
|
|
46
|
+
if (!await this.checkGooseInstalled()) {
|
|
47
|
+
this.error("Goose is not installed. Please install it first: https://block.github.io/goose/", { exit: 1 });
|
|
48
|
+
}
|
|
49
|
+
console.log("Goose is installed");
|
|
50
|
+
console.log("\u{1F50D} Getting organization identity...");
|
|
51
|
+
let identity;
|
|
52
|
+
try {
|
|
53
|
+
identity = await this.catalogIdentity();
|
|
54
|
+
console.log(`Organization ID: ${identity.organizationId}`);
|
|
55
|
+
} catch (error) {
|
|
56
|
+
console.log(`Failed to get identity: ${error.message}`);
|
|
57
|
+
this.error(`Failed to get organization identity: ${error.message}`, { exit: 1 });
|
|
58
|
+
}
|
|
59
|
+
const urlSafeOrgId = urlifyOrganizationId(identity.organizationId);
|
|
60
|
+
const mcpUrl = `https://raindrop-mcp.${urlSafeOrgId}.lmapp.run/mcp`;
|
|
61
|
+
console.log(`\u{1F50D} MCP URL: ${mcpUrl}`);
|
|
62
|
+
await this.updateGooseConfig(mcpUrl);
|
|
63
|
+
}
|
|
64
|
+
async updateGooseConfig(mcpUrl) {
|
|
65
|
+
const home = homedir();
|
|
66
|
+
const configPath = join(home, ".config", "goose", "config.yaml");
|
|
67
|
+
try {
|
|
68
|
+
await mkdir(dirname(configPath), { recursive: true });
|
|
69
|
+
let configContent = {};
|
|
70
|
+
try {
|
|
71
|
+
const existingConfig = await readFile(configPath, "utf-8");
|
|
72
|
+
configContent = this.parseYaml(existingConfig);
|
|
73
|
+
} catch {
|
|
74
|
+
console.log("Creating new Goose config.yaml file...");
|
|
75
|
+
}
|
|
76
|
+
if (!configContent.extensions) {
|
|
77
|
+
configContent.extensions = {};
|
|
78
|
+
}
|
|
79
|
+
if (configContent.extensions["raindrop-mcp"]) {
|
|
80
|
+
console.log('MCP extension "raindrop-mcp" already exists in Goose configuration');
|
|
81
|
+
console.log("");
|
|
82
|
+
console.log("To update the existing extension:");
|
|
83
|
+
console.log(" 1. Edit ~/.config/goose/config.yaml manually");
|
|
84
|
+
console.log(" 2. Update the raindrop-mcp extension URL");
|
|
85
|
+
console.log("");
|
|
86
|
+
this.error("MCP extension already exists. Please update it manually if needed.", { exit: 1 });
|
|
87
|
+
}
|
|
88
|
+
configContent.extensions["raindrop-mcp"] = {
|
|
89
|
+
enabled: true,
|
|
90
|
+
name: "raindrop-mcp",
|
|
91
|
+
timeout: 300,
|
|
92
|
+
type: "http",
|
|
93
|
+
url: mcpUrl
|
|
94
|
+
};
|
|
95
|
+
const yamlContent = this.stringifyYaml(configContent);
|
|
96
|
+
await writeFile(configPath, yamlContent, "utf-8");
|
|
97
|
+
console.log("MCP integration for Goose installed successfully");
|
|
98
|
+
console.log(`Configuration updated: ${configPath}`);
|
|
99
|
+
console.log(`Server URL: ${mcpUrl}`);
|
|
100
|
+
} catch (error) {
|
|
101
|
+
console.log(`Failed to update Goose config: ${error.message}`);
|
|
102
|
+
this.error(`Failed to configure Goose MCP integration: ${error.message}`, { exit: 1 });
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
async createGooseConfigFiles() {
|
|
106
|
+
try {
|
|
107
|
+
const home = homedir();
|
|
108
|
+
const raindropDir = join(home, ".raindrop");
|
|
109
|
+
const gooseRecipesDir = join(home, ".config", "goose", "recipes");
|
|
110
|
+
await mkdir(raindropDir, { recursive: true });
|
|
111
|
+
await mkdir(gooseRecipesDir, { recursive: true });
|
|
112
|
+
const currentFileUrl = import.meta.url;
|
|
113
|
+
const currentDir = dirname(fileURLToPath(currentFileUrl));
|
|
114
|
+
let packageRoot = currentDir;
|
|
115
|
+
while (packageRoot !== dirname(packageRoot)) {
|
|
116
|
+
try {
|
|
117
|
+
await access(join(packageRoot, "package.json"), constants.F_OK);
|
|
118
|
+
break;
|
|
119
|
+
} catch {
|
|
120
|
+
packageRoot = dirname(packageRoot);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
const templatesDir = join(packageRoot, "templates");
|
|
124
|
+
const fileMap = [
|
|
125
|
+
[join("goose", "new-raindrop-app.yaml"), join(gooseRecipesDir, "new-raindrop-app.yaml"), "New app recipe"],
|
|
126
|
+
[join("goose", "update-raindrop-app.yaml"), join(gooseRecipesDir, "update-raindrop-app.yaml"), "Update app recipe"],
|
|
127
|
+
[join("goose", "reattach-raindrop-session.yaml"), join(gooseRecipesDir, "reattach-raindrop-session.yaml"), "Reattach session recipe"]
|
|
128
|
+
];
|
|
129
|
+
const createdFiles = [];
|
|
130
|
+
const skippedFiles = [];
|
|
131
|
+
for (const [templateFile, destPath, description] of fileMap) {
|
|
132
|
+
try {
|
|
133
|
+
const templatePath = join(templatesDir, templateFile);
|
|
134
|
+
const content = await readFile(templatePath, "utf-8");
|
|
135
|
+
await writeFile(destPath, content, "utf-8");
|
|
136
|
+
createdFiles.push(destPath);
|
|
137
|
+
} catch (error) {
|
|
138
|
+
console.log(`Failed to create ${description}: ${error.message}`);
|
|
139
|
+
skippedFiles.push(destPath);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (createdFiles.length > 0) {
|
|
143
|
+
console.log("\u{1F4DD} Created Goose configuration files:");
|
|
144
|
+
for (const filePath of createdFiles) {
|
|
145
|
+
console.log(` ${filePath}`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (skippedFiles.length > 0) {
|
|
149
|
+
console.log("Skipped files due to errors:");
|
|
150
|
+
for (const filePath of skippedFiles) {
|
|
151
|
+
console.log(` ${filePath}`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (createdFiles.length > 0) {
|
|
155
|
+
console.log("");
|
|
156
|
+
console.log("To use Raindrop with Goose:");
|
|
157
|
+
console.log(" goose session --recipe ~/.config/goose/recipes/new-raindrop-app.yaml");
|
|
158
|
+
console.log(" goose session --recipe ~/.config/goose/recipes/update-raindrop-app.yaml");
|
|
159
|
+
console.log(" goose session --recipe ~/.config/goose/recipes/reattach-raindrop-session.yaml");
|
|
160
|
+
}
|
|
161
|
+
} catch (error) {
|
|
162
|
+
this.error(`Failed to create Goose configuration files: ${error.message}`, { exit: 1 });
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
async checkGooseInstalled() {
|
|
166
|
+
return new Promise((resolve) => {
|
|
167
|
+
const childProcess = spawn("goose", ["--version"], { stdio: "ignore" });
|
|
168
|
+
childProcess.on("close", (code) => resolve(code === 0));
|
|
169
|
+
childProcess.on("error", () => resolve(false));
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
parseYaml(content) {
|
|
173
|
+
const lines = content.split("\n");
|
|
174
|
+
const config = {};
|
|
175
|
+
const extensions = {};
|
|
176
|
+
let currentExtension = null;
|
|
177
|
+
let inExtensions = false;
|
|
178
|
+
for (const line of lines) {
|
|
179
|
+
const trimmed = line.trim();
|
|
180
|
+
if (trimmed.startsWith("extensions:")) {
|
|
181
|
+
inExtensions = true;
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
if (inExtensions) {
|
|
185
|
+
if (trimmed && !trimmed.startsWith(" ") && !line.startsWith(" ")) {
|
|
186
|
+
inExtensions = false;
|
|
187
|
+
} else if (trimmed.match(/^[\w-]+:$/)) {
|
|
188
|
+
currentExtension = trimmed.slice(0, -1);
|
|
189
|
+
extensions[currentExtension] = {
|
|
190
|
+
enabled: true,
|
|
191
|
+
name: currentExtension,
|
|
192
|
+
timeout: 300,
|
|
193
|
+
type: "http",
|
|
194
|
+
url: ""
|
|
195
|
+
};
|
|
196
|
+
} else if (currentExtension && trimmed.includes(":")) {
|
|
197
|
+
const ext = extensions[currentExtension];
|
|
198
|
+
if (!ext) continue;
|
|
199
|
+
const [key, ...valueParts] = trimmed.split(":");
|
|
200
|
+
const value = valueParts.join(":").trim().replace(/^["']|["']$/g, "");
|
|
201
|
+
if (key === "enabled") ext.enabled = value === "true";
|
|
202
|
+
if (key === "name") ext.name = value;
|
|
203
|
+
if (key === "timeout") ext.timeout = Number.parseInt(value, 10);
|
|
204
|
+
if (key === "type") ext.type = value;
|
|
205
|
+
if (key === "url") ext.url = value;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (Object.keys(extensions).length > 0) {
|
|
210
|
+
config.extensions = extensions;
|
|
211
|
+
}
|
|
212
|
+
return config;
|
|
213
|
+
}
|
|
214
|
+
stringifyYaml(config) {
|
|
215
|
+
const lines = [];
|
|
216
|
+
if (config.extensions) {
|
|
217
|
+
lines.push("extensions:");
|
|
218
|
+
for (const [name, ext] of Object.entries(config.extensions)) {
|
|
219
|
+
lines.push(` ${name}:`);
|
|
220
|
+
lines.push(` enabled: ${ext.enabled}`);
|
|
221
|
+
lines.push(` name: ${ext.name}`);
|
|
222
|
+
lines.push(` timeout: ${ext.timeout}`);
|
|
223
|
+
lines.push(` type: ${ext.type}`);
|
|
224
|
+
lines.push(` url: "${ext.url}"`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return lines.join("\n") + "\n";
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
export {
|
|
231
|
+
McpInstallGoose as default
|
|
232
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseCommand
|
|
3
|
+
} from "../../chunk-MCRKUPJY.js";
|
|
4
|
+
import {
|
|
5
|
+
__toESM,
|
|
6
|
+
init_cjs_shims,
|
|
7
|
+
require_lib,
|
|
8
|
+
urlifyOrganizationId
|
|
9
|
+
} from "../../chunk-G6NE675D.js";
|
|
10
|
+
|
|
11
|
+
// src/commands/mcp/status.ts
|
|
12
|
+
init_cjs_shims();
|
|
13
|
+
var import_core = __toESM(require_lib(), 1);
|
|
14
|
+
import { spawn } from "node:child_process";
|
|
15
|
+
var McpStatus = class _McpStatus extends BaseCommand {
|
|
16
|
+
static args = {};
|
|
17
|
+
static description = "show the status of MCP (Model Context Protocol) integration for Claude IDE";
|
|
18
|
+
static examples = [
|
|
19
|
+
`<%= config.bin %> <%= command.id %>
|
|
20
|
+
Show current MCP integration status
|
|
21
|
+
`
|
|
22
|
+
];
|
|
23
|
+
static flags = {
|
|
24
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
25
|
+
output: import_core.Flags.string({
|
|
26
|
+
char: "o",
|
|
27
|
+
description: "output format",
|
|
28
|
+
default: "text",
|
|
29
|
+
options: ["text", "json"]
|
|
30
|
+
})
|
|
31
|
+
};
|
|
32
|
+
async run() {
|
|
33
|
+
const { flags } = await this.parse(_McpStatus);
|
|
34
|
+
if (!await this.checkClaudeInstalled()) {
|
|
35
|
+
this.error("Claude CLI is not installed. Please install it first: https://claude.ai/download", { exit: 1 });
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
const identity = await this.catalogIdentity();
|
|
39
|
+
const urlSafeOrgId = urlifyOrganizationId(identity.organizationId);
|
|
40
|
+
const expectedMcpUrl = `https://raindrop-mcp.${urlSafeOrgId}.lmapp.run/mcp`;
|
|
41
|
+
const mcpServers = await this.getMcpServers();
|
|
42
|
+
const raindropMcp = mcpServers.find((server) => server.name === "raindrop-mcp");
|
|
43
|
+
if (flags.output === "json") {
|
|
44
|
+
const status = {
|
|
45
|
+
raindropMcp: raindropMcp ? {
|
|
46
|
+
configured: true,
|
|
47
|
+
name: raindropMcp.name,
|
|
48
|
+
url: raindropMcp.url,
|
|
49
|
+
transport: raindropMcp.transport,
|
|
50
|
+
urlMatches: raindropMcp.url === expectedMcpUrl,
|
|
51
|
+
expectedUrl: expectedMcpUrl
|
|
52
|
+
} : {
|
|
53
|
+
configured: false,
|
|
54
|
+
expectedUrl: expectedMcpUrl
|
|
55
|
+
},
|
|
56
|
+
allServers: mcpServers,
|
|
57
|
+
claudeInstalled: true
|
|
58
|
+
};
|
|
59
|
+
console.log(JSON.stringify(status, null, 2));
|
|
60
|
+
} else {
|
|
61
|
+
if (raindropMcp) {
|
|
62
|
+
console.log("\u2705 Raindrop MCP integration is configured");
|
|
63
|
+
console.log(` Name: ${raindropMcp.name}`);
|
|
64
|
+
console.log(` URL: ${raindropMcp.url}`);
|
|
65
|
+
console.log(` Transport: ${raindropMcp.transport}`);
|
|
66
|
+
if (raindropMcp.url === expectedMcpUrl) {
|
|
67
|
+
console.log("\u2705 Server URL matches current organization");
|
|
68
|
+
} else {
|
|
69
|
+
console.log("\u26A0\uFE0F Server URL does not match current organization");
|
|
70
|
+
console.log(` Expected: ${expectedMcpUrl}`);
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
console.log("\u274C Raindrop MCP integration is not configured");
|
|
74
|
+
console.log("\u{1F4A1} Run `raindrop mcp install-claude` to set it up");
|
|
75
|
+
}
|
|
76
|
+
if (mcpServers.length > 0) {
|
|
77
|
+
console.log(`
|
|
78
|
+
All configured MCP servers (${mcpServers.length}):`);
|
|
79
|
+
for (const server of mcpServers) {
|
|
80
|
+
const icon = server.name === "raindrop-mcp" ? "\u{1F535}" : "\u26AA";
|
|
81
|
+
console.log(` ${icon} ${server.name} (${server.transport}) - ${server.url}`);
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
84
|
+
console.log("\nNo MCP servers configured");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
} catch (error) {
|
|
88
|
+
const err = error;
|
|
89
|
+
this.error(`Failed to get MCP status: ${err.message}`, { exit: 1 });
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
async checkClaudeInstalled() {
|
|
93
|
+
return new Promise((resolve) => {
|
|
94
|
+
const childProcess = spawn("claude", ["--version"], { stdio: "ignore" });
|
|
95
|
+
childProcess.on("close", (code) => resolve(code === 0));
|
|
96
|
+
childProcess.on("error", () => resolve(false));
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
async getMcpServers() {
|
|
100
|
+
return new Promise((resolve, reject) => {
|
|
101
|
+
const childProcess = spawn("claude", ["mcp", "list"], {
|
|
102
|
+
stdio: "pipe"
|
|
103
|
+
});
|
|
104
|
+
let output = "";
|
|
105
|
+
let errorOutput = "";
|
|
106
|
+
if (childProcess.stdout) {
|
|
107
|
+
childProcess.stdout.on("data", (data) => {
|
|
108
|
+
output += data.toString();
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
if (childProcess.stderr) {
|
|
112
|
+
childProcess.stderr.on("data", (data) => {
|
|
113
|
+
errorOutput += data.toString();
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
childProcess.on("close", (code) => {
|
|
117
|
+
if (code === 0) {
|
|
118
|
+
resolve(this.parseMcpList(output));
|
|
119
|
+
} else {
|
|
120
|
+
reject(new Error(`Failed to get MCP server list: ${errorOutput || "Command failed"}`));
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
childProcess.on("error", (error) => {
|
|
124
|
+
reject(new Error(`Failed to execute Claude CLI: ${error.message}`));
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
parseMcpList(output) {
|
|
129
|
+
const servers = [];
|
|
130
|
+
const lines = output.split("\n");
|
|
131
|
+
for (const line of lines) {
|
|
132
|
+
const trimmed = line.trim();
|
|
133
|
+
if (!trimmed || trimmed.startsWith("Checking MCP server health") || trimmed.startsWith("MCP Servers:") || trimmed.startsWith("Name")) {
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
const match = trimmed.match(/^([^:]+):\s+([^\s]+)\s+\(([^)]+)\)/);
|
|
137
|
+
if (match && match[1] && match[2] && match[3]) {
|
|
138
|
+
const name = match[1].trim();
|
|
139
|
+
const url = match[2].trim();
|
|
140
|
+
const transport = match[3].trim().toLowerCase();
|
|
141
|
+
servers.push({
|
|
142
|
+
name,
|
|
143
|
+
url,
|
|
144
|
+
transport
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return servers;
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
export {
|
|
152
|
+
McpStatus as default
|
|
153
|
+
};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseCommand
|
|
3
|
+
} from "../../chunk-MCRKUPJY.js";
|
|
4
|
+
import {
|
|
5
|
+
DeleteObjectResponseSchema,
|
|
6
|
+
__toESM,
|
|
7
|
+
init_cjs_shims,
|
|
8
|
+
require_lib,
|
|
9
|
+
toJsonString
|
|
10
|
+
} from "../../chunk-G6NE675D.js";
|
|
11
|
+
|
|
12
|
+
// src/commands/object/delete.ts
|
|
13
|
+
init_cjs_shims();
|
|
14
|
+
var import_core = __toESM(require_lib(), 1);
|
|
15
|
+
var ObjectDelete = class extends BaseCommand {
|
|
16
|
+
static args = {
|
|
17
|
+
key: import_core.Args.string({
|
|
18
|
+
description: "key/path in the bucket to delete",
|
|
19
|
+
required: true
|
|
20
|
+
})
|
|
21
|
+
};
|
|
22
|
+
static description = "Delete a file from the object storage";
|
|
23
|
+
static examples = [
|
|
24
|
+
`<%= config.bin %> object delete my-key --bucket my-bucket
|
|
25
|
+
Delete file with key 'my-key' from my-bucket
|
|
26
|
+
`,
|
|
27
|
+
`<%= config.bin %> object delete my-key --application my-app --bucket my-bucket
|
|
28
|
+
Delete file with key 'my-key' from my-bucket within my-app
|
|
29
|
+
`
|
|
30
|
+
];
|
|
31
|
+
static flags = {
|
|
32
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
33
|
+
bucket: import_core.Flags.string({
|
|
34
|
+
char: "b",
|
|
35
|
+
description: "bucket name version can be specified with #, e.g. my-bucket#versionId",
|
|
36
|
+
required: false
|
|
37
|
+
}),
|
|
38
|
+
moduleId: import_core.Flags.string({
|
|
39
|
+
char: "m",
|
|
40
|
+
description: "moduleId",
|
|
41
|
+
required: false
|
|
42
|
+
}),
|
|
43
|
+
application: import_core.Flags.string({
|
|
44
|
+
char: "a",
|
|
45
|
+
description: "application name",
|
|
46
|
+
required: false
|
|
47
|
+
}),
|
|
48
|
+
output: import_core.Flags.string({
|
|
49
|
+
char: "o",
|
|
50
|
+
description: "output format",
|
|
51
|
+
default: "text",
|
|
52
|
+
options: ["text", "json"]
|
|
53
|
+
}),
|
|
54
|
+
impersonate: import_core.Flags.string({
|
|
55
|
+
char: "i",
|
|
56
|
+
description: "impersonate organization",
|
|
57
|
+
required: false,
|
|
58
|
+
hidden: true
|
|
59
|
+
}),
|
|
60
|
+
manifest: import_core.Flags.string({
|
|
61
|
+
char: "M",
|
|
62
|
+
description: "project manifest",
|
|
63
|
+
required: false,
|
|
64
|
+
default: "raindrop.manifest",
|
|
65
|
+
hidden: true
|
|
66
|
+
})
|
|
67
|
+
};
|
|
68
|
+
async run() {
|
|
69
|
+
if (this.flags.bucket && this.flags.moduleId) {
|
|
70
|
+
this.error("Cannot specify both --bucket and --moduleId flags.");
|
|
71
|
+
}
|
|
72
|
+
if (this.flags.moduleId && this.flags.application) {
|
|
73
|
+
this.error("Cannot specify both --moduleId and --application flags.");
|
|
74
|
+
}
|
|
75
|
+
if (!this.flags.bucket && !this.flags.moduleId && !this.flags.application) {
|
|
76
|
+
this.error("Must specify one of: --bucket, --moduleId, or --application");
|
|
77
|
+
}
|
|
78
|
+
const { client: objectService, userId, organizationId } = await this.objectService();
|
|
79
|
+
let bucketLocation;
|
|
80
|
+
if (this.flags.moduleId) {
|
|
81
|
+
bucketLocation = {
|
|
82
|
+
bucketLocation: {
|
|
83
|
+
case: "moduleId",
|
|
84
|
+
value: this.flags.moduleId
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
} else if (this.flags.application && this.flags.bucket) {
|
|
88
|
+
const applicationName = this.flags.application;
|
|
89
|
+
const config = await this.loadConfig();
|
|
90
|
+
const applicationVersionId = config.versionId || void 0;
|
|
91
|
+
const { client: catalogService } = await this.catalogService();
|
|
92
|
+
const queryParams = {
|
|
93
|
+
userId,
|
|
94
|
+
applicationName,
|
|
95
|
+
organizationId,
|
|
96
|
+
moduleType: "smartbucket",
|
|
97
|
+
...applicationVersionId && { applicationVersionId }
|
|
98
|
+
};
|
|
99
|
+
const modulesResp = await catalogService.queryModules(queryParams);
|
|
100
|
+
if (!modulesResp.modules || modulesResp.modules.length === 0) {
|
|
101
|
+
this.error(`No bucket modules found for application '${applicationName}'`);
|
|
102
|
+
}
|
|
103
|
+
const bucketName = this.flags.bucket.split("#")[0];
|
|
104
|
+
const bucketModules = modulesResp.modules.filter((module) => module.name === bucketName);
|
|
105
|
+
if (bucketModules.length === 0) {
|
|
106
|
+
this.error(`Bucket '${bucketName}' not found in application '${applicationName}'`);
|
|
107
|
+
}
|
|
108
|
+
const bucketModule = applicationVersionId ? bucketModules.find((m) => m.applicationVersionId === applicationVersionId) || bucketModules.sort((a, b) => b.applicationVersionId.localeCompare(a.applicationVersionId))[0] : bucketModules.sort((a, b) => b.applicationVersionId.localeCompare(a.applicationVersionId))[0];
|
|
109
|
+
if (!bucketModule) {
|
|
110
|
+
this.error(`Bucket '${bucketName}' not found in application '${applicationName}'`);
|
|
111
|
+
}
|
|
112
|
+
bucketLocation = {
|
|
113
|
+
bucketLocation: {
|
|
114
|
+
case: "bucket",
|
|
115
|
+
value: {
|
|
116
|
+
name: bucketName,
|
|
117
|
+
version: bucketModule.applicationVersionId
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
} else if (this.flags.bucket) {
|
|
122
|
+
if (!this.flags.bucket.includes("#")) {
|
|
123
|
+
await this.loadConfig();
|
|
124
|
+
}
|
|
125
|
+
bucketLocation = {
|
|
126
|
+
bucketLocation: {
|
|
127
|
+
case: "bucket",
|
|
128
|
+
value: {
|
|
129
|
+
name: this.flags.bucket.split("#")[0],
|
|
130
|
+
version: this.flags.bucket.includes("#") ? this.flags.bucket.split("#")[1] : this.raindropConfig?.versionId
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
} else if (this.flags.application) {
|
|
135
|
+
const applicationName = this.flags.application;
|
|
136
|
+
const config = await this.loadConfig();
|
|
137
|
+
const applicationVersionId = config.versionId || void 0;
|
|
138
|
+
const { client: catalogService } = await this.catalogService();
|
|
139
|
+
const queryParams = {
|
|
140
|
+
userId,
|
|
141
|
+
applicationName,
|
|
142
|
+
organizationId,
|
|
143
|
+
moduleType: "smartbucket",
|
|
144
|
+
...applicationVersionId && { applicationVersionId }
|
|
145
|
+
};
|
|
146
|
+
const modulesResp = await catalogService.queryModules(queryParams);
|
|
147
|
+
if (!modulesResp.modules || modulesResp.modules.length === 0) {
|
|
148
|
+
this.error(`No bucket modules found for application '${applicationName}'`);
|
|
149
|
+
}
|
|
150
|
+
const bucketModule = modulesResp.modules[0];
|
|
151
|
+
if (!bucketModule) {
|
|
152
|
+
this.error(`No bucket modules found for application '${applicationName}'`);
|
|
153
|
+
}
|
|
154
|
+
bucketLocation = {
|
|
155
|
+
bucketLocation: {
|
|
156
|
+
case: "bucket",
|
|
157
|
+
value: {
|
|
158
|
+
name: bucketModule.name,
|
|
159
|
+
version: bucketModule.applicationVersionId
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
const response = await objectService.deleteObject({
|
|
165
|
+
userId,
|
|
166
|
+
organizationId,
|
|
167
|
+
bucketLocation,
|
|
168
|
+
key: this.args.key
|
|
169
|
+
});
|
|
170
|
+
if (this.flags.output === "json") {
|
|
171
|
+
console.log(toJsonString(DeleteObjectResponseSchema, response, { prettySpaces: 2 }));
|
|
172
|
+
} else {
|
|
173
|
+
console.log("Successfully deleted file:");
|
|
174
|
+
console.log(`Key: ${this.args.key}`);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
export {
|
|
179
|
+
ObjectDelete as default
|
|
180
|
+
};
|