@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,123 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ulid
|
|
3
|
+
} from "../../chunk-CDQRD3JA.js";
|
|
4
|
+
import {
|
|
5
|
+
BaseCommand
|
|
6
|
+
} from "../../chunk-MCRKUPJY.js";
|
|
7
|
+
import {
|
|
8
|
+
RagSearchResponseSchema,
|
|
9
|
+
__toESM,
|
|
10
|
+
init_cjs_shims,
|
|
11
|
+
require_lib,
|
|
12
|
+
toJsonString
|
|
13
|
+
} from "../../chunk-G6NE675D.js";
|
|
14
|
+
|
|
15
|
+
// src/commands/query/chunk-search.ts
|
|
16
|
+
init_cjs_shims();
|
|
17
|
+
var import_core = __toESM(require_lib(), 1);
|
|
18
|
+
var RagSearch = class _RagSearch extends BaseCommand {
|
|
19
|
+
static args = {
|
|
20
|
+
query: import_core.Args.string({
|
|
21
|
+
description: "search query to run",
|
|
22
|
+
required: true
|
|
23
|
+
})
|
|
24
|
+
};
|
|
25
|
+
static description = "Run a RAG (Retrieval Augmented Generation) search query against a Smart Bucket";
|
|
26
|
+
static examples = [
|
|
27
|
+
`<%= config.bin %> query chunk-search "What is LiquidMetal?"
|
|
28
|
+
Run a RAG search query against a Smart Bucket.
|
|
29
|
+
`
|
|
30
|
+
];
|
|
31
|
+
static flags = {
|
|
32
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
33
|
+
buckets: import_core.Flags.string({
|
|
34
|
+
char: "b",
|
|
35
|
+
description: "Bucket names to search in, version can be specified with #, e.g. my-bucket#versionId",
|
|
36
|
+
multiple: true,
|
|
37
|
+
required: false
|
|
38
|
+
}),
|
|
39
|
+
moduleIds: import_core.Flags.string({
|
|
40
|
+
char: "m",
|
|
41
|
+
description: "Module IDs to search in",
|
|
42
|
+
multiple: true,
|
|
43
|
+
required: false
|
|
44
|
+
}),
|
|
45
|
+
output: import_core.Flags.string({
|
|
46
|
+
char: "o",
|
|
47
|
+
description: "output format",
|
|
48
|
+
default: "text",
|
|
49
|
+
options: ["text", "json"]
|
|
50
|
+
}),
|
|
51
|
+
impersonate: import_core.Flags.string({
|
|
52
|
+
char: "i",
|
|
53
|
+
description: "impersonate organization",
|
|
54
|
+
required: false,
|
|
55
|
+
hidden: true
|
|
56
|
+
}),
|
|
57
|
+
manifest: import_core.Flags.string({
|
|
58
|
+
char: "M",
|
|
59
|
+
description: "project manifest",
|
|
60
|
+
required: false,
|
|
61
|
+
default: "raindrop.manifest",
|
|
62
|
+
hidden: true
|
|
63
|
+
})
|
|
64
|
+
};
|
|
65
|
+
async searchAgent(query) {
|
|
66
|
+
if (this.flags.buckets?.length && this.flags.moduleIds?.length) {
|
|
67
|
+
this.error("Cannot specify both --buckets and --moduleIds flags. Please use only one type of filter.");
|
|
68
|
+
}
|
|
69
|
+
if (this.flags.buckets?.some((bucket) => !bucket.includes("#"))) {
|
|
70
|
+
await this.loadConfig();
|
|
71
|
+
}
|
|
72
|
+
const { client: searchAgentService, userId, organizationId } = await this.searchAgentService();
|
|
73
|
+
const response = await searchAgentService.ragSearch({
|
|
74
|
+
userId,
|
|
75
|
+
organizationId,
|
|
76
|
+
bucketLocations: [
|
|
77
|
+
...(this.flags.buckets || []).map((bucket) => {
|
|
78
|
+
const [bucketName, version] = bucket.split("#");
|
|
79
|
+
return {
|
|
80
|
+
bucketLocation: {
|
|
81
|
+
case: "bucket",
|
|
82
|
+
value: {
|
|
83
|
+
name: bucketName,
|
|
84
|
+
version: version || this.raindropConfig?.versionId || ""
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}),
|
|
89
|
+
...(this.flags.moduleIds || []).map((moduleId) => ({
|
|
90
|
+
bucketLocation: {
|
|
91
|
+
case: "moduleId",
|
|
92
|
+
value: moduleId
|
|
93
|
+
}
|
|
94
|
+
}))
|
|
95
|
+
],
|
|
96
|
+
requestId: ulid(),
|
|
97
|
+
input: query
|
|
98
|
+
});
|
|
99
|
+
if (this.flags.output === "json") {
|
|
100
|
+
console.log(toJsonString(RagSearchResponseSchema, response, { prettySpaces: 2 }));
|
|
101
|
+
} else {
|
|
102
|
+
console.log("\nSearch Results:\n");
|
|
103
|
+
for (const result of response.results) {
|
|
104
|
+
console.log("----------------------------------------");
|
|
105
|
+
console.log(`Type: ${result.type || "N/A"}`);
|
|
106
|
+
console.log(`Score: ${result.score || 0}`);
|
|
107
|
+
console.log(`Source: ${result.source ? `${result.source.bucket?.bucketName}/${result.source.object}` : "N/A"}`);
|
|
108
|
+
console.log(`Content: ${result.text || "N/A"}`);
|
|
109
|
+
console.log("----------------------------------------\n");
|
|
110
|
+
}
|
|
111
|
+
if (response.results.length === 0) {
|
|
112
|
+
console.log("No results found.");
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
async run() {
|
|
117
|
+
const { args } = await this.parse(_RagSearch);
|
|
118
|
+
await this.searchAgent(args.query);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
export {
|
|
122
|
+
RagSearch as default
|
|
123
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ulid
|
|
3
|
+
} from "../../chunk-CDQRD3JA.js";
|
|
4
|
+
import {
|
|
5
|
+
BaseCommand
|
|
6
|
+
} from "../../chunk-MCRKUPJY.js";
|
|
7
|
+
import {
|
|
8
|
+
DocumentChatResponseSchema,
|
|
9
|
+
__toESM,
|
|
10
|
+
init_cjs_shims,
|
|
11
|
+
require_lib,
|
|
12
|
+
toJsonString
|
|
13
|
+
} from "../../chunk-G6NE675D.js";
|
|
14
|
+
|
|
15
|
+
// src/commands/query/document.ts
|
|
16
|
+
init_cjs_shims();
|
|
17
|
+
var import_core = __toESM(require_lib(), 1);
|
|
18
|
+
var DocumentChat = class _DocumentChat extends BaseCommand {
|
|
19
|
+
static args = {
|
|
20
|
+
query: import_core.Args.string({
|
|
21
|
+
description: "question or query about the document",
|
|
22
|
+
required: true
|
|
23
|
+
})
|
|
24
|
+
};
|
|
25
|
+
static description = "Chat with a document stored in a Smart Bucket";
|
|
26
|
+
static examples = [
|
|
27
|
+
`<%= config.bin %> query document "What is the main topic of this document?" -b my-bucket -o document.pdf
|
|
28
|
+
Chat with a document in a Smart Bucket using bucket name.
|
|
29
|
+
`,
|
|
30
|
+
`<%= config.bin %> query document "What is the main topic of this document?" -m module-id -o document.pdf
|
|
31
|
+
Chat with a document in a Smart Bucket using module ID.
|
|
32
|
+
`
|
|
33
|
+
];
|
|
34
|
+
static flags = {
|
|
35
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
36
|
+
bucket: import_core.Flags.string({
|
|
37
|
+
char: "b",
|
|
38
|
+
description: "Bucket name containing the document, version can be specified with #, e.g. my-bucket#versionId",
|
|
39
|
+
required: false
|
|
40
|
+
}),
|
|
41
|
+
moduleId: import_core.Flags.string({
|
|
42
|
+
char: "m",
|
|
43
|
+
description: "Module ID containing the document",
|
|
44
|
+
required: false
|
|
45
|
+
}),
|
|
46
|
+
objectId: import_core.Flags.string({
|
|
47
|
+
char: "o",
|
|
48
|
+
description: "Object ID of the document to chat with",
|
|
49
|
+
required: true
|
|
50
|
+
}),
|
|
51
|
+
output: import_core.Flags.string({
|
|
52
|
+
char: "O",
|
|
53
|
+
description: "output format",
|
|
54
|
+
default: "text",
|
|
55
|
+
options: ["text", "json"]
|
|
56
|
+
}),
|
|
57
|
+
impersonate: import_core.Flags.string({
|
|
58
|
+
char: "i",
|
|
59
|
+
description: "impersonate organization",
|
|
60
|
+
required: false,
|
|
61
|
+
hidden: true
|
|
62
|
+
}),
|
|
63
|
+
manifest: import_core.Flags.string({
|
|
64
|
+
char: "M",
|
|
65
|
+
description: "project manifest",
|
|
66
|
+
required: false,
|
|
67
|
+
default: "raindrop.manifest",
|
|
68
|
+
hidden: true
|
|
69
|
+
})
|
|
70
|
+
};
|
|
71
|
+
async documentChat(query) {
|
|
72
|
+
if (this.flags.bucket && this.flags.moduleId) {
|
|
73
|
+
this.error("Cannot specify both --bucket and --moduleId flags. Please use only one type of location.");
|
|
74
|
+
}
|
|
75
|
+
if (!this.flags.bucket && !this.flags.moduleId) {
|
|
76
|
+
this.error("Must specify either --bucket or --moduleId flag to identify the document location.");
|
|
77
|
+
}
|
|
78
|
+
if (this.flags.bucket && !this.flags.bucket.includes("#")) {
|
|
79
|
+
await this.loadConfig();
|
|
80
|
+
}
|
|
81
|
+
const { client: searchAgentService, userId, organizationId } = await this.searchAgentService();
|
|
82
|
+
let bucketLocation;
|
|
83
|
+
if (this.flags.bucket) {
|
|
84
|
+
const [bucketName, version] = this.flags.bucket.split("#");
|
|
85
|
+
bucketLocation = {
|
|
86
|
+
bucketLocation: {
|
|
87
|
+
case: "bucket",
|
|
88
|
+
value: {
|
|
89
|
+
name: bucketName,
|
|
90
|
+
version: version || this.raindropConfig?.versionId || ""
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
} else {
|
|
95
|
+
bucketLocation = {
|
|
96
|
+
bucketLocation: {
|
|
97
|
+
case: "moduleId",
|
|
98
|
+
value: this.flags.moduleId
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
const response = await searchAgentService.documentChat({
|
|
103
|
+
userId,
|
|
104
|
+
organizationId,
|
|
105
|
+
bucketLocation,
|
|
106
|
+
objectId: this.flags.objectId,
|
|
107
|
+
requestId: ulid(),
|
|
108
|
+
input: query
|
|
109
|
+
});
|
|
110
|
+
if (this.flags.output === "json") {
|
|
111
|
+
console.log(toJsonString(DocumentChatResponseSchema, response, { prettySpaces: 2 }));
|
|
112
|
+
} else {
|
|
113
|
+
console.log("\nDocument Chat Response:\n");
|
|
114
|
+
console.log("----------------------------------------");
|
|
115
|
+
console.log(response.answer);
|
|
116
|
+
console.log("----------------------------------------\n");
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
async run() {
|
|
120
|
+
const { args } = await this.parse(_DocumentChat);
|
|
121
|
+
await this.documentChat(args.query);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
export {
|
|
125
|
+
DocumentChat as default
|
|
126
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
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/query/events.ts
|
|
12
|
+
init_cjs_shims();
|
|
13
|
+
var import_core = __toESM(require_lib(), 1);
|
|
14
|
+
var Events = class extends BaseCommand {
|
|
15
|
+
static args = {};
|
|
16
|
+
static description = "query and stream Raindrop application events";
|
|
17
|
+
static examples = [
|
|
18
|
+
`<%= config.bin %> <%= command.id %> .
|
|
19
|
+
`
|
|
20
|
+
];
|
|
21
|
+
static flags = {
|
|
22
|
+
output: import_core.Flags.string({
|
|
23
|
+
char: "o",
|
|
24
|
+
description: "output format",
|
|
25
|
+
default: "table",
|
|
26
|
+
options: ["text", "table", "json"]
|
|
27
|
+
}),
|
|
28
|
+
impersonate: import_core.Flags.string({
|
|
29
|
+
char: "i",
|
|
30
|
+
description: "impersonate organization",
|
|
31
|
+
required: false,
|
|
32
|
+
hidden: true
|
|
33
|
+
}),
|
|
34
|
+
manifest: import_core.Flags.string({
|
|
35
|
+
char: "m",
|
|
36
|
+
description: "project manifest",
|
|
37
|
+
required: false,
|
|
38
|
+
default: "raindrop.manifest",
|
|
39
|
+
hidden: true
|
|
40
|
+
}),
|
|
41
|
+
application: import_core.Flags.string({
|
|
42
|
+
char: "a",
|
|
43
|
+
description: "application",
|
|
44
|
+
required: false
|
|
45
|
+
}),
|
|
46
|
+
version: import_core.Flags.string({
|
|
47
|
+
char: "v",
|
|
48
|
+
description: "application version",
|
|
49
|
+
required: false
|
|
50
|
+
}),
|
|
51
|
+
rainbowAuthService: import_core.Flags.string({
|
|
52
|
+
default: "https://liquidmetal.run/api/connect",
|
|
53
|
+
hidden: true,
|
|
54
|
+
env: "LIQUIDMETAL_RAINBOW_AUTH_SERVICE"
|
|
55
|
+
}),
|
|
56
|
+
raindropCatalogService: import_core.Flags.string({
|
|
57
|
+
env: "RAINDROP_CATALOG_SERVICE",
|
|
58
|
+
description: "URL of the catalog service",
|
|
59
|
+
hidden: true
|
|
60
|
+
})
|
|
61
|
+
};
|
|
62
|
+
async run() {
|
|
63
|
+
if (!this.flags.version) {
|
|
64
|
+
const config = await this.loadConfig();
|
|
65
|
+
if (!config.versionId) {
|
|
66
|
+
this.error("No version provided or found in config", { exit: 1 });
|
|
67
|
+
}
|
|
68
|
+
this.flags.version = config.versionId;
|
|
69
|
+
}
|
|
70
|
+
if (!this.flags.application) {
|
|
71
|
+
const apps = await this.loadManifest();
|
|
72
|
+
const app = apps[0];
|
|
73
|
+
if (app === void 0) {
|
|
74
|
+
this.error("No application provided or found in manifest", { exit: 1 });
|
|
75
|
+
}
|
|
76
|
+
this.flags.application = valueOf(app.name);
|
|
77
|
+
}
|
|
78
|
+
const {
|
|
79
|
+
client: eventStreamService,
|
|
80
|
+
organizationId: defaultOrganizationId,
|
|
81
|
+
userId
|
|
82
|
+
} = await this.eventStreamService();
|
|
83
|
+
const organizationId = this.flags.impersonate ?? defaultOrganizationId;
|
|
84
|
+
for await (const resp of eventStreamService.tailEvents({
|
|
85
|
+
userId,
|
|
86
|
+
organizationId,
|
|
87
|
+
applicationName: this.flags.application,
|
|
88
|
+
applicationVersionId: this.flags.version
|
|
89
|
+
})) {
|
|
90
|
+
for (const event of resp.events) {
|
|
91
|
+
console.log(event);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
export {
|
|
97
|
+
Events as default
|
|
98
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
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/query/reindex.ts
|
|
11
|
+
init_cjs_shims();
|
|
12
|
+
var import_core = __toESM(require_lib(), 1);
|
|
13
|
+
import * as fs from "node:fs/promises";
|
|
14
|
+
import * as os from "node:os";
|
|
15
|
+
import * as path from "path";
|
|
16
|
+
var QueryReindex = class extends BaseCommand {
|
|
17
|
+
static description = "Reindex all objects in a bucket by downloading and re-uploading them";
|
|
18
|
+
static examples = [
|
|
19
|
+
`<%= config.bin %> query reindex -b my-bucket
|
|
20
|
+
Reindex all objects in my-bucket by downloading and re-uploading them
|
|
21
|
+
`,
|
|
22
|
+
`<%= config.bin %> query reindex -b my-bucket --parallel 5
|
|
23
|
+
Reindex objects with 5 parallel operations instead of the default 10
|
|
24
|
+
`
|
|
25
|
+
];
|
|
26
|
+
static flags = {
|
|
27
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
28
|
+
bucket: import_core.Flags.string({
|
|
29
|
+
char: "b",
|
|
30
|
+
description: "bucket name version can be specified with #, e.g. my-bucket#versionId",
|
|
31
|
+
required: true
|
|
32
|
+
}),
|
|
33
|
+
parallel: import_core.Flags.integer({
|
|
34
|
+
char: "p",
|
|
35
|
+
description: "number of parallel operations",
|
|
36
|
+
default: 10
|
|
37
|
+
}),
|
|
38
|
+
dryRun: import_core.Flags.boolean({
|
|
39
|
+
char: "d",
|
|
40
|
+
description: "show what would be reindexed without actually doing it",
|
|
41
|
+
default: false
|
|
42
|
+
}),
|
|
43
|
+
impersonate: import_core.Flags.string({
|
|
44
|
+
char: "i",
|
|
45
|
+
description: "impersonate organization",
|
|
46
|
+
required: false,
|
|
47
|
+
hidden: true
|
|
48
|
+
}),
|
|
49
|
+
manifest: import_core.Flags.string({
|
|
50
|
+
char: "M",
|
|
51
|
+
description: "project manifest",
|
|
52
|
+
required: false,
|
|
53
|
+
default: "raindrop.manifest",
|
|
54
|
+
hidden: true
|
|
55
|
+
})
|
|
56
|
+
};
|
|
57
|
+
async run() {
|
|
58
|
+
if (this.flags.bucket && !this.flags.bucket.includes("#")) {
|
|
59
|
+
await this.loadConfig();
|
|
60
|
+
}
|
|
61
|
+
const bucketLocation = {
|
|
62
|
+
bucketLocation: {
|
|
63
|
+
case: "bucket",
|
|
64
|
+
value: {
|
|
65
|
+
name: this.flags.bucket.split("#")[0],
|
|
66
|
+
version: this.flags.bucket.includes("#") ? this.flags.bucket.split("#")[1] : this.raindropConfig?.versionId
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const { client: objectService, userId, organizationId } = await this.objectService();
|
|
71
|
+
console.log(`Fetching object list from bucket: ${this.flags.bucket}`);
|
|
72
|
+
const listResponse = await objectService.listObjects({
|
|
73
|
+
userId,
|
|
74
|
+
organizationId,
|
|
75
|
+
bucketLocation
|
|
76
|
+
});
|
|
77
|
+
if (!listResponse.objects || listResponse.objects.length === 0) {
|
|
78
|
+
console.log("No objects found in bucket");
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
console.log(`Found ${listResponse.objects.length} objects to reindex`);
|
|
82
|
+
if (this.flags.dryRun) {
|
|
83
|
+
console.log("\nDry run - would reindex the following objects:");
|
|
84
|
+
for (const obj of listResponse.objects) {
|
|
85
|
+
console.log(` - ${obj.key}`);
|
|
86
|
+
}
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "raindrop-reindex-"));
|
|
90
|
+
try {
|
|
91
|
+
const batchSize = this.flags.parallel;
|
|
92
|
+
let processed = 0;
|
|
93
|
+
let failed = 0;
|
|
94
|
+
for (let i = 0; i < listResponse.objects.length; i += batchSize) {
|
|
95
|
+
const batch = listResponse.objects.slice(i, i + batchSize);
|
|
96
|
+
const promises = batch.map(async (obj) => {
|
|
97
|
+
try {
|
|
98
|
+
console.log(`Processing: ${obj.key}`);
|
|
99
|
+
const getResponse = await objectService.getObject({
|
|
100
|
+
userId,
|
|
101
|
+
organizationId,
|
|
102
|
+
key: obj.key,
|
|
103
|
+
bucketLocation
|
|
104
|
+
});
|
|
105
|
+
if (!getResponse.content) {
|
|
106
|
+
throw new Error("No content received");
|
|
107
|
+
}
|
|
108
|
+
const tempFile = path.join(tempDir, `${Date.now()}-${Math.random()}`);
|
|
109
|
+
await fs.writeFile(tempFile, getResponse.content);
|
|
110
|
+
const fileContent = await fs.readFile(tempFile);
|
|
111
|
+
await objectService.putObject({
|
|
112
|
+
userId,
|
|
113
|
+
organizationId,
|
|
114
|
+
key: obj.key,
|
|
115
|
+
content: fileContent,
|
|
116
|
+
contentType: getResponse.contentType || "application/octet-stream",
|
|
117
|
+
bucketLocation
|
|
118
|
+
});
|
|
119
|
+
await fs.unlink(tempFile);
|
|
120
|
+
console.log(`Completed: ${obj.key}`);
|
|
121
|
+
return true;
|
|
122
|
+
} catch (error) {
|
|
123
|
+
console.error(`Failed: ${obj.key} - ${error instanceof Error ? error.message : String(error)}`);
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
const results = await Promise.all(promises);
|
|
128
|
+
processed += results.filter(Boolean).length;
|
|
129
|
+
failed += results.filter((r) => !r).length;
|
|
130
|
+
console.log(`Batch ${Math.floor(i / batchSize) + 1} completed. Progress: ${processed + failed}/${listResponse.objects.length}`);
|
|
131
|
+
}
|
|
132
|
+
console.log("\nReindexing completed:");
|
|
133
|
+
console.log(` Successfully processed: ${processed}`);
|
|
134
|
+
console.log(` Failed: ${failed}`);
|
|
135
|
+
console.log(` Total: ${listResponse.objects.length}`);
|
|
136
|
+
} finally {
|
|
137
|
+
try {
|
|
138
|
+
await fs.rm(tempDir, { recursive: true });
|
|
139
|
+
} catch (_error) {
|
|
140
|
+
console.warn(`Warning: Could not clean up temp directory ${tempDir}`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
export {
|
|
146
|
+
QueryReindex as default
|
|
147
|
+
};
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ulid
|
|
3
|
+
} from "../../chunk-CDQRD3JA.js";
|
|
4
|
+
import {
|
|
5
|
+
BaseCommand
|
|
6
|
+
} from "../../chunk-MCRKUPJY.js";
|
|
7
|
+
import {
|
|
8
|
+
__toESM,
|
|
9
|
+
init_cjs_shims,
|
|
10
|
+
require_lib
|
|
11
|
+
} from "../../chunk-G6NE675D.js";
|
|
12
|
+
|
|
13
|
+
// src/commands/query/search.ts
|
|
14
|
+
init_cjs_shims();
|
|
15
|
+
var import_core = __toESM(require_lib(), 1);
|
|
16
|
+
var AgentSearch = class _AgentSearch extends BaseCommand {
|
|
17
|
+
static args = {
|
|
18
|
+
query: import_core.Args.string({
|
|
19
|
+
description: "search query",
|
|
20
|
+
required: false
|
|
21
|
+
})
|
|
22
|
+
};
|
|
23
|
+
static description = "Run a search query against a smart bucket using natural language";
|
|
24
|
+
static examples = [
|
|
25
|
+
`<%= config.bin %> query search "What is LiquidMetal?" --buckets my-bucket-1 my-bucket-2
|
|
26
|
+
Run a new supervisor agent search query across multiple buckets.
|
|
27
|
+
`,
|
|
28
|
+
`<%= config.bin %> query search --requestId 01HNG4V2RJXS5T --page 2
|
|
29
|
+
Get page 2 of previous search results.
|
|
30
|
+
`
|
|
31
|
+
];
|
|
32
|
+
static flags = {
|
|
33
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
34
|
+
buckets: import_core.Flags.string({
|
|
35
|
+
char: "b",
|
|
36
|
+
description: "Bucket names to search in, version can be specified with #, e.g. my-bucket#versionId",
|
|
37
|
+
multiple: true,
|
|
38
|
+
required: false
|
|
39
|
+
}),
|
|
40
|
+
moduleIds: import_core.Flags.string({
|
|
41
|
+
char: "m",
|
|
42
|
+
description: "Module IDs to search in",
|
|
43
|
+
multiple: true,
|
|
44
|
+
required: false
|
|
45
|
+
}),
|
|
46
|
+
requestId: import_core.Flags.string({
|
|
47
|
+
description: "request ID for pagination",
|
|
48
|
+
required: false
|
|
49
|
+
}),
|
|
50
|
+
page: import_core.Flags.integer({
|
|
51
|
+
char: "p",
|
|
52
|
+
description: "page number for paginated results",
|
|
53
|
+
default: 1
|
|
54
|
+
}),
|
|
55
|
+
output: import_core.Flags.string({
|
|
56
|
+
char: "o",
|
|
57
|
+
description: "output format",
|
|
58
|
+
default: "text",
|
|
59
|
+
options: ["text", "json"]
|
|
60
|
+
}),
|
|
61
|
+
impersonate: import_core.Flags.string({
|
|
62
|
+
char: "i",
|
|
63
|
+
description: "impersonate organization",
|
|
64
|
+
required: false,
|
|
65
|
+
hidden: true
|
|
66
|
+
}),
|
|
67
|
+
manifest: import_core.Flags.string({
|
|
68
|
+
char: "M",
|
|
69
|
+
description: "project manifest",
|
|
70
|
+
required: false,
|
|
71
|
+
default: "raindrop.manifest",
|
|
72
|
+
hidden: true
|
|
73
|
+
})
|
|
74
|
+
};
|
|
75
|
+
async run() {
|
|
76
|
+
if (this.flags.buckets?.length && this.flags.moduleIds?.length) {
|
|
77
|
+
this.error("Cannot specify both --buckets and --moduleIds flags. Please use only one type of filter.");
|
|
78
|
+
}
|
|
79
|
+
if (this.flags.buckets?.some((bucket) => !bucket.includes("#"))) {
|
|
80
|
+
await this.loadConfig();
|
|
81
|
+
}
|
|
82
|
+
const { args, flags } = await this.parse(_AgentSearch);
|
|
83
|
+
const { client: searchAgentService, userId, organizationId } = await this.searchAgentService();
|
|
84
|
+
let response;
|
|
85
|
+
let requestId;
|
|
86
|
+
if (flags.requestId) {
|
|
87
|
+
if (!flags.page) {
|
|
88
|
+
this.error("Page number is required when using requestId");
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
response = await searchAgentService.getPaginatedResults({
|
|
92
|
+
requestId: flags.requestId,
|
|
93
|
+
page: flags.page,
|
|
94
|
+
pageSize: 15,
|
|
95
|
+
userId,
|
|
96
|
+
organizationId
|
|
97
|
+
});
|
|
98
|
+
if (!response?.results?.length) {
|
|
99
|
+
this.error(`No results found for request ID: ${flags.requestId}. The search session might have expired.`);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
requestId = flags.requestId;
|
|
103
|
+
} else {
|
|
104
|
+
if (!args.query) {
|
|
105
|
+
this.error("Search query is required when not using requestId");
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
requestId = ulid();
|
|
109
|
+
response = await searchAgentService.runSupervisorAgent({
|
|
110
|
+
requestId,
|
|
111
|
+
input: args.query,
|
|
112
|
+
bucketLocations: [
|
|
113
|
+
...(this.flags.buckets || []).map((bucket) => {
|
|
114
|
+
const [bucketName, version] = bucket.split("#");
|
|
115
|
+
return {
|
|
116
|
+
bucketLocation: {
|
|
117
|
+
case: "bucket",
|
|
118
|
+
value: {
|
|
119
|
+
name: bucketName,
|
|
120
|
+
version: version || this.raindropConfig?.versionId || ""
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}),
|
|
125
|
+
...(this.flags.moduleIds || []).map((moduleId) => ({
|
|
126
|
+
bucketLocation: {
|
|
127
|
+
case: "moduleId",
|
|
128
|
+
value: moduleId
|
|
129
|
+
}
|
|
130
|
+
}))
|
|
131
|
+
],
|
|
132
|
+
userId,
|
|
133
|
+
organizationId
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
if (flags.output === "json") {
|
|
137
|
+
console.log(JSON.stringify({ requestId, ...response }, null, 2));
|
|
138
|
+
} else {
|
|
139
|
+
if (!flags.requestId) {
|
|
140
|
+
console.log(`Request ID: ${requestId}`);
|
|
141
|
+
}
|
|
142
|
+
console.log("\nSearch Results:\n");
|
|
143
|
+
for (const result of response.results) {
|
|
144
|
+
console.log("----------------------------------------");
|
|
145
|
+
console.log(`Type: ${result.type || "N/A"}`);
|
|
146
|
+
console.log(`Score: ${result.score || 0}`);
|
|
147
|
+
console.log(`Source: ${result.source ? `${result.source.bucket?.bucketName}/${result.source.object}` : "N/A"}`);
|
|
148
|
+
console.log(`Content: ${result.text || "N/A"}`);
|
|
149
|
+
console.log("----------------------------------------\n");
|
|
150
|
+
}
|
|
151
|
+
if (response.pagination) {
|
|
152
|
+
console.log("\nPagination Info:");
|
|
153
|
+
console.log(`Page ${response.pagination.page} of ${response.pagination.totalPages}`);
|
|
154
|
+
console.log(`Total Results: ${response.pagination.total}`);
|
|
155
|
+
console.log(`Has More: ${response.pagination.hasMore ? "Yes" : "No"}`);
|
|
156
|
+
if (response.pagination.hasMore) {
|
|
157
|
+
console.log(`
|
|
158
|
+
To see next page, run:`);
|
|
159
|
+
console.log(
|
|
160
|
+
`npx raindrop query agent-search --requestId ${requestId} --page ${response.pagination.page + 1}`
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
export {
|
|
168
|
+
AgentSearch as default
|
|
169
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseCommand
|
|
3
|
+
} from "../chunk-MCRKUPJY.js";
|
|
4
|
+
import {
|
|
5
|
+
init_cjs_shims
|
|
6
|
+
} from "../chunk-G6NE675D.js";
|
|
7
|
+
|
|
8
|
+
// src/commands/tail.ts
|
|
9
|
+
init_cjs_shims();
|
|
10
|
+
var Tail = class extends BaseCommand {
|
|
11
|
+
static args = {};
|
|
12
|
+
static description = 'Legacy command - use "raindrop logs tail" instead';
|
|
13
|
+
static examples = [
|
|
14
|
+
`<%= config.bin %> logs tail`,
|
|
15
|
+
`<%= config.bin %> logs tail --application my-app`,
|
|
16
|
+
`<%= config.bin %> logs tail --application my-app --version v1.2.3`
|
|
17
|
+
];
|
|
18
|
+
static flags = {
|
|
19
|
+
...BaseCommand.HIDDEN_FLAGS
|
|
20
|
+
};
|
|
21
|
+
async run() {
|
|
22
|
+
this.log('\u26A0\uFE0F Command moved to "raindrop logs tail"');
|
|
23
|
+
this.log("");
|
|
24
|
+
this.log("Please use: raindrop logs tail");
|
|
25
|
+
this.log("");
|
|
26
|
+
this.log("For more options, see: raindrop logs --help");
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
Tail as default
|
|
31
|
+
};
|