@cargo-ai/cli 1.0.18 → 1.0.19
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/build/commands/ai/index.d.ts.map +1 -1
- package/build/commands/ai/index.js +1 -3
- package/build/commands/content/file.d.ts.map +1 -0
- package/build/commands/{ai → content}/file.js +7 -7
- package/build/commands/content/index.d.ts +4 -0
- package/build/commands/content/index.d.ts.map +1 -0
- package/build/commands/content/index.js +9 -0
- package/build/commands/content/library.d.ts +4 -0
- package/build/commands/content/library.d.ts.map +1 -0
- package/build/commands/content/library.js +78 -0
- package/build/commands/storage/model.js +3 -3
- package/build/index.js +2 -0
- package/package.json +3 -3
- package/build/commands/ai/file.d.ts.map +0 -1
- /package/build/commands/{ai → content}/file.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAcxC,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAiB3E"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { registerAgentCommands } from "./agent.js";
|
|
2
2
|
import { registerChatCommands } from "./chat.js";
|
|
3
3
|
import { registerDocumentCommands } from "./document.js";
|
|
4
|
-
import { registerFileCommands } from "./file.js";
|
|
5
4
|
import { registerMcpClientCommands } from "./mcpClient.js";
|
|
6
5
|
import { registerMcpServerCommands } from "./mcpServer.js";
|
|
7
6
|
import { registerMemoryCommands } from "./memory.js";
|
|
@@ -14,13 +13,12 @@ import { registerVoteCommands } from "./vote.js";
|
|
|
14
13
|
export function registerAiCommands(parent, getApi) {
|
|
15
14
|
const ai = parent
|
|
16
15
|
.command("ai")
|
|
17
|
-
.description("AI templates, agents, releases, chats, MCP
|
|
16
|
+
.description("AI templates, agents, releases, chats, MCP");
|
|
18
17
|
registerTemplateCommands(ai, getApi);
|
|
19
18
|
registerAgentCommands(ai, getApi);
|
|
20
19
|
registerReleaseCommands(ai, getApi);
|
|
21
20
|
registerChatCommands(ai, getApi);
|
|
22
21
|
registerMcpServerCommands(ai, getApi);
|
|
23
|
-
registerFileCommands(ai, getApi);
|
|
24
22
|
registerMessageCommands(ai, getApi);
|
|
25
23
|
registerVoteCommands(ai, getApi);
|
|
26
24
|
registerDocumentCommands(ai, getApi);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/commands/content/file.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAkF7E"}
|
|
@@ -2,13 +2,13 @@ import { readFile } from "node:fs/promises";
|
|
|
2
2
|
import { basename } from "node:path";
|
|
3
3
|
import { handleApiCall, outputJson } from "../runHandler.js";
|
|
4
4
|
export function registerFileCommands(parent, getApi) {
|
|
5
|
-
const file = parent.command("file").description("
|
|
5
|
+
const file = parent.command("file").description("Storage file operations");
|
|
6
6
|
file
|
|
7
7
|
.command("list")
|
|
8
|
-
.description("List all
|
|
8
|
+
.description("List all workspace files")
|
|
9
9
|
.action(async () => {
|
|
10
10
|
const api = getApi();
|
|
11
|
-
const result = await handleApiCall(() => api.
|
|
11
|
+
const result = await handleApiCall(() => api.content.file.all());
|
|
12
12
|
outputJson(result);
|
|
13
13
|
});
|
|
14
14
|
file
|
|
@@ -16,7 +16,7 @@ export function registerFileCommands(parent, getApi) {
|
|
|
16
16
|
.description("Get file by UUID")
|
|
17
17
|
.action(async (uuid) => {
|
|
18
18
|
const api = getApi();
|
|
19
|
-
const result = await handleApiCall(() => api.
|
|
19
|
+
const result = await handleApiCall(() => api.content.file.get(uuid));
|
|
20
20
|
outputJson(result);
|
|
21
21
|
});
|
|
22
22
|
file
|
|
@@ -27,7 +27,7 @@ export function registerFileCommands(parent, getApi) {
|
|
|
27
27
|
.option("--folder-uuid <uuid>", "Folder UUID")
|
|
28
28
|
.action(async (opts) => {
|
|
29
29
|
const api = getApi();
|
|
30
|
-
const result = await handleApiCall(() => api.
|
|
30
|
+
const result = await handleApiCall(() => api.content.file.update({
|
|
31
31
|
uuid: opts.uuid,
|
|
32
32
|
name: opts.name,
|
|
33
33
|
folderUuid: opts.folderUuid,
|
|
@@ -39,7 +39,7 @@ export function registerFileCommands(parent, getApi) {
|
|
|
39
39
|
.description("Remove a file")
|
|
40
40
|
.action(async (uuid) => {
|
|
41
41
|
const api = getApi();
|
|
42
|
-
await handleApiCall(() => api.
|
|
42
|
+
await handleApiCall(() => api.content.file.remove(uuid));
|
|
43
43
|
outputJson({ ok: true });
|
|
44
44
|
});
|
|
45
45
|
file
|
|
@@ -53,7 +53,7 @@ export function registerFileCommands(parent, getApi) {
|
|
|
53
53
|
const fileObj = new File([buffer], name);
|
|
54
54
|
const api = getApi();
|
|
55
55
|
await handleApiCall(() => new Promise((resolve, reject) => {
|
|
56
|
-
api.
|
|
56
|
+
api.content.file.upload({
|
|
57
57
|
file: fileObj,
|
|
58
58
|
folderUuid: opts.folderUuid,
|
|
59
59
|
onProgress: (pct) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/content/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAIxC,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAON"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { registerFileCommands } from "./file.js";
|
|
2
|
+
import { registerLibraryCommands } from "./library.js";
|
|
3
|
+
export function registerContentCommands(parent, getApi) {
|
|
4
|
+
const content = parent
|
|
5
|
+
.command("content")
|
|
6
|
+
.description("Workspace files and libraries");
|
|
7
|
+
registerFileCommands(content, getApi);
|
|
8
|
+
registerLibraryCommands(content, getApi);
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../src/commands/content/library.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAwGN"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { handleApiCall, outputJson } from "../runHandler.js";
|
|
2
|
+
export function registerLibraryCommands(parent, getApi) {
|
|
3
|
+
const library = parent
|
|
4
|
+
.command("library")
|
|
5
|
+
.description("Storage library operations");
|
|
6
|
+
library
|
|
7
|
+
.command("list")
|
|
8
|
+
.description("List workspace libraries")
|
|
9
|
+
.option("--connector-uuid <uuid>", "Filter by connector UUID")
|
|
10
|
+
.option("--kind <kind>", "Filter by kind (native or connector)")
|
|
11
|
+
.action(async (opts) => {
|
|
12
|
+
const api = getApi();
|
|
13
|
+
const kind = opts.kind === "connector" || opts.kind === "native"
|
|
14
|
+
? opts.kind
|
|
15
|
+
: undefined;
|
|
16
|
+
const result = await handleApiCall(() => api.content.library.list({
|
|
17
|
+
connectorUuid: opts.connectorUuid,
|
|
18
|
+
kind,
|
|
19
|
+
}));
|
|
20
|
+
outputJson(result);
|
|
21
|
+
});
|
|
22
|
+
library
|
|
23
|
+
.command("get <uuid>")
|
|
24
|
+
.description("Get library by UUID")
|
|
25
|
+
.action(async (uuid) => {
|
|
26
|
+
const api = getApi();
|
|
27
|
+
const result = await handleApiCall(() => api.content.library.get(uuid));
|
|
28
|
+
outputJson(result);
|
|
29
|
+
});
|
|
30
|
+
library
|
|
31
|
+
.command("create")
|
|
32
|
+
.description("Create a connector library")
|
|
33
|
+
.requiredOption("--name <name>", "Library name")
|
|
34
|
+
.requiredOption("--extractor-slug <slug>", "Unstructured extractor slug")
|
|
35
|
+
.requiredOption("--connector-uuid <uuid>", "Connector UUID")
|
|
36
|
+
.option("--folder-uuid <uuid>", "Default folder UUID")
|
|
37
|
+
.option("--config <json>", "Library config JSON", "{}")
|
|
38
|
+
.action(async (opts) => {
|
|
39
|
+
const api = getApi();
|
|
40
|
+
const config = JSON.parse(opts.config);
|
|
41
|
+
const result = await handleApiCall(() => api.content.library.create({
|
|
42
|
+
name: opts.name,
|
|
43
|
+
extractorSlug: opts.extractorSlug,
|
|
44
|
+
connectorUuid: opts.connectorUuid,
|
|
45
|
+
folderUuid: opts.folderUuid,
|
|
46
|
+
config,
|
|
47
|
+
}));
|
|
48
|
+
outputJson(result);
|
|
49
|
+
});
|
|
50
|
+
library
|
|
51
|
+
.command("update")
|
|
52
|
+
.description("Update a library")
|
|
53
|
+
.requiredOption("--uuid <uuid>", "Library UUID")
|
|
54
|
+
.option("--name <name>", "Library name")
|
|
55
|
+
.option("--folder-uuid <uuid>", "Default folder UUID")
|
|
56
|
+
.option("--config <json>", "Library config JSON")
|
|
57
|
+
.action(async (opts) => {
|
|
58
|
+
const api = getApi();
|
|
59
|
+
const config = opts.config !== undefined
|
|
60
|
+
? JSON.parse(opts.config)
|
|
61
|
+
: undefined;
|
|
62
|
+
const result = await handleApiCall(() => api.content.library.update({
|
|
63
|
+
uuid: opts.uuid,
|
|
64
|
+
name: opts.name,
|
|
65
|
+
folderUuid: opts.folderUuid,
|
|
66
|
+
config,
|
|
67
|
+
}));
|
|
68
|
+
outputJson(result);
|
|
69
|
+
});
|
|
70
|
+
library
|
|
71
|
+
.command("remove <uuid>")
|
|
72
|
+
.description("Remove a library")
|
|
73
|
+
.action(async (uuid) => {
|
|
74
|
+
const api = getApi();
|
|
75
|
+
await handleApiCall(() => api.content.library.remove(uuid));
|
|
76
|
+
outputJson({ ok: true });
|
|
77
|
+
});
|
|
78
|
+
}
|
|
@@ -92,11 +92,11 @@ export function registerModelCommands(parent, getApi) {
|
|
|
92
92
|
outputJson(result);
|
|
93
93
|
});
|
|
94
94
|
model
|
|
95
|
-
.command("
|
|
96
|
-
.description("
|
|
95
|
+
.command("refresh <uuid>")
|
|
96
|
+
.description("Refresh a model")
|
|
97
97
|
.action(async (uuid) => {
|
|
98
98
|
const api = getApi();
|
|
99
|
-
const result = await handleApiCall(() => api.storage.model.
|
|
99
|
+
const result = await handleApiCall(() => api.storage.model.refresh(uuid));
|
|
100
100
|
outputJson(result);
|
|
101
101
|
});
|
|
102
102
|
model
|
package/build/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { registerAiCommands } from "./commands/ai/index.js";
|
|
|
6
6
|
import { registerAuthCommands } from "./commands/auth/index.js";
|
|
7
7
|
import { registerBillingCommands } from "./commands/billing/index.js";
|
|
8
8
|
import { registerConnectionCommands } from "./commands/connection/index.js";
|
|
9
|
+
import { registerContentCommands } from "./commands/content/index.js";
|
|
9
10
|
import { registerContextCommands } from "./commands/context/index.js";
|
|
10
11
|
import { registerExpressionCommands } from "./commands/expression/index.js";
|
|
11
12
|
import { registerHostingCommands } from "./commands/hosting/index.js";
|
|
@@ -60,6 +61,7 @@ registerInitCommand(program, getApi);
|
|
|
60
61
|
registerOrchestrationCommands(program, getApi);
|
|
61
62
|
registerWorkspaceManagementCommands(program, getApi);
|
|
62
63
|
registerStorageCommands(program, getApi);
|
|
64
|
+
registerContentCommands(program, getApi);
|
|
63
65
|
registerConnectionCommands(program, getApi);
|
|
64
66
|
registerContextCommands(program, getApi);
|
|
65
67
|
registerBillingCommands(program, getApi);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cargo-ai/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Command-line interface for the Cargo API",
|
|
6
6
|
"engines": {
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"format:check": "prettier --check ."
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@cargo-ai/api": "^1.0.
|
|
31
|
+
"@cargo-ai/api": "^1.0.27",
|
|
32
32
|
"@cargo-ai/app-sdk": "^1.0.0",
|
|
33
|
-
"@cargo-ai/worker-sdk": "^1.0.
|
|
33
|
+
"@cargo-ai/worker-sdk": "^1.0.2",
|
|
34
34
|
"commander": "^12.1.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/file.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAkF7E"}
|
|
File without changes
|