@cargo-ai/cli 1.0.62 → 1.0.63
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role.d.ts","sourceRoot":"","sources":["../../../src/commands/workspaceManagement/role.ts"],"names":[],"mappings":"AAAA,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,
|
|
1
|
+
{"version":3,"file":"role.d.ts","sourceRoot":"","sources":["../../../src/commands/workspaceManagement/role.ts"],"names":[],"mappings":"AAAA,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,CAyF7E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { handleApiCall, outputJson } from "../runHandler.js";
|
|
1
|
+
import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
|
|
2
2
|
export function registerRoleCommands(parent, getApi) {
|
|
3
3
|
const role = parent.command("role").description("Role operations");
|
|
4
4
|
role
|
|
@@ -9,4 +9,52 @@ export function registerRoleCommands(parent, getApi) {
|
|
|
9
9
|
const result = await handleApiCall(() => api.workspaceManagement.role.all());
|
|
10
10
|
outputJson(result);
|
|
11
11
|
});
|
|
12
|
+
role
|
|
13
|
+
.command("create")
|
|
14
|
+
.description("Create a custom role")
|
|
15
|
+
.requiredOption("--name <name>", "Display name for the role")
|
|
16
|
+
.requiredOption("--slug <slug>", "Unique identifier for the role")
|
|
17
|
+
.option("--color <color>", "Role color (dot in the UI)", "grey")
|
|
18
|
+
.option("--description <description>", "Role description")
|
|
19
|
+
.option("--permissions <json>", "JSON array of permission objects", "[]")
|
|
20
|
+
.action(async (opts) => {
|
|
21
|
+
const api = getApi();
|
|
22
|
+
const result = await handleApiCall(() => api.workspaceManagement.role.create({
|
|
23
|
+
name: opts.name,
|
|
24
|
+
slug: opts.slug,
|
|
25
|
+
color: opts.color,
|
|
26
|
+
description: opts.description,
|
|
27
|
+
permissions: parseJson(opts.permissions, "--permissions"),
|
|
28
|
+
}));
|
|
29
|
+
outputJson(result);
|
|
30
|
+
});
|
|
31
|
+
role
|
|
32
|
+
.command("update")
|
|
33
|
+
.description("Update a custom role")
|
|
34
|
+
.requiredOption("--uuid <uuid>", "Role UUID")
|
|
35
|
+
.option("--name <name>", "Display name for the role")
|
|
36
|
+
.option("--color <color>", "Role color (dot in the UI)")
|
|
37
|
+
.option("--description <description>", "Role description")
|
|
38
|
+
.option("--permissions <json>", "JSON array of permission objects")
|
|
39
|
+
.action(async (opts) => {
|
|
40
|
+
const api = getApi();
|
|
41
|
+
const result = await handleApiCall(() => api.workspaceManagement.role.update({
|
|
42
|
+
uuid: opts.uuid,
|
|
43
|
+
name: opts.name,
|
|
44
|
+
color: opts.color,
|
|
45
|
+
description: opts.description,
|
|
46
|
+
permissions: opts.permissions !== undefined
|
|
47
|
+
? parseJson(opts.permissions, "--permissions")
|
|
48
|
+
: undefined,
|
|
49
|
+
}));
|
|
50
|
+
outputJson(result);
|
|
51
|
+
});
|
|
52
|
+
role
|
|
53
|
+
.command("remove <uuid>")
|
|
54
|
+
.description("Remove a custom role")
|
|
55
|
+
.action(async (uuid) => {
|
|
56
|
+
const api = getApi();
|
|
57
|
+
await handleApiCall(() => api.workspaceManagement.role.remove(uuid));
|
|
58
|
+
outputJson({ ok: true });
|
|
59
|
+
});
|
|
12
60
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cargo-ai/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.63",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://getcargo.ai",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"format:check": "prettier --check ."
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@cargo-ai/api": "^1.0.
|
|
62
|
+
"@cargo-ai/api": "^1.0.66",
|
|
63
63
|
"@cargo-ai/app-sdk": "^1.0.8",
|
|
64
64
|
"@cargo-ai/cdk": "^1.0.51",
|
|
65
|
-
"@cargo-ai/types": "^1.0.
|
|
65
|
+
"@cargo-ai/types": "^1.0.65",
|
|
66
66
|
"@cargo-ai/worker-sdk": "^1.0.16",
|
|
67
67
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
68
68
|
"commander": "^12.1.0",
|