@cargo-ai/cli 1.0.1 → 1.0.3

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":"skill.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/skill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAgJN"}
1
+ {"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/skill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAmJN"}
@@ -2,7 +2,7 @@ import { handleApiCall, outputJson } from "../runHandler.js";
2
2
  export function registerSkillCommands(parent, getApi) {
3
3
  const skill = parent
4
4
  .command("skill")
5
- .description("Skill operations (list, get, create, install, remove)");
5
+ .description("Skill operations (list, get, create, remove, existsBySlug)");
6
6
  skill
7
7
  .command("all")
8
8
  .description("Get all workspace skills")
@@ -29,24 +29,32 @@ export function registerSkillCommands(parent, getApi) {
29
29
  });
30
30
  skill
31
31
  .command("create")
32
- .description("Create a custom skill")
33
- .requiredOption("--slug <slug>", "Skill slug (lowercase, hyphens)")
34
- .requiredOption("--name <name>", "Skill display name")
35
- .requiredOption("--description <description>", "Skill description")
36
- .requiredOption("--body <body>", "Skill body (markdown instructions)")
37
- .option("--files <json>", "JSON array of {path, content} file entries")
32
+ .description("Create a skill (custom or from a GitHub community source)")
33
+ .requiredOption("--slug <slug>", "Skill slug (lowercase, underscores)")
34
+ .option("--name <name>", "Skill display name")
35
+ .option("--description <description>", "Skill description")
36
+ .option("--body <body>", "Skill body content")
37
+ .option("--source-owner <owner>", "GitHub repo owner (community source)")
38
+ .option("--source-repo <repo>", "GitHub repo name (community source)")
39
+ .option("--source-path <path>", "Path to skill within the repo (community source)")
38
40
  .action(async (options) => {
39
41
  const api = getApi();
40
- const payload = {
42
+ const isCommunity = options.sourceOwner !== undefined && options.sourceRepo !== undefined;
43
+ const source = isCommunity === true
44
+ ? {
45
+ kind: "community",
46
+ owner: options.sourceOwner,
47
+ repo: options.sourceRepo,
48
+ path: options.sourcePath,
49
+ }
50
+ : { kind: "custom" };
51
+ const result = await handleApiCall(() => api.ai.skill.create({
41
52
  slug: options.slug,
42
53
  name: options.name,
43
54
  description: options.description,
44
55
  body: options.body,
45
- };
46
- if (options.files !== undefined) {
47
- payload.files = JSON.parse(options.files);
48
- }
49
- const result = await handleApiCall(() => api.ai.skill.create(payload));
56
+ source,
57
+ }));
50
58
  outputJson(result);
51
59
  });
52
60
  skill
@@ -75,14 +83,11 @@ export function registerSkillCommands(parent, getApi) {
75
83
  outputJson(result);
76
84
  });
77
85
  skill
78
- .command("install")
79
- .description("Install a community skill from a GitHub repository")
80
- .requiredOption("--source-owner <owner>", "GitHub repo owner")
81
- .requiredOption("--source-repo <repo>", "GitHub repo name")
82
- .option("--skill-path <path>", "Path to skill within the repo")
83
- .action(async (options) => {
86
+ .command("exists-by-slug <slug>")
87
+ .description("Check if a skill with the given slug exists")
88
+ .action(async (slug) => {
84
89
  const api = getApi();
85
- const result = await handleApiCall(() => api.ai.skill.install(options));
90
+ const result = await handleApiCall(() => api.ai.skill.existsBySlug({ slug }));
86
91
  outputJson(result);
87
92
  });
88
93
  skill
@@ -1 +1 @@
1
- {"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/batch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAgKN"}
1
+ {"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/batch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAiLN"}
@@ -59,12 +59,18 @@ export function registerBatchCommands(parent, getApi) {
59
59
  batch
60
60
  .command("create")
61
61
  .description("Create a batch")
62
- .requiredOption("--workflow-uuid <uuid>", "Workflow UUID")
62
+ .option("--workflow-uuid <uuid>", "Workflow UUID")
63
63
  .requiredOption("--data <json>", 'Batch data (JSON, e.g. {"kind":"segment","segmentUuid":"..."} or {"kind":"file","s3Filename":"..."})')
64
+ .option("--release-uuid <uuid>", "Release UUID")
65
+ .option("--nodes <json>", 'Custom nodes to override the workflow definition (JSON array). Must include a start node (slug:"start") and an end node (slug:"end"). E.g. [{"uuid":"a","slug":"start","kind":"native","actionSlug":"start","config":{},"childrenUuids":["b"],"fallbackOnFailure":false,"position":{"x":0,"y":0}},{"uuid":"b","slug":"end","kind":"native","actionSlug":"end","config":{},"childrenUuids":[],"fallbackOnFailure":false,"position":{"x":1,"y":0}}]')
64
66
  .action(async (opts) => {
65
67
  const api = getApi();
66
68
  const result = await handleApiCall(() => api.orchestration.batch.create({
67
69
  workflowUuid: opts.workflowUuid,
70
+ releaseUuid: opts.releaseUuid,
71
+ nodes: opts.nodes !== undefined
72
+ ? parseJson(opts.nodes, "--nodes")
73
+ : undefined,
68
74
  data: parseJson(opts.data, "--data"),
69
75
  }));
70
76
  outputJson(result);
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/node.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,CAiE7E"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/node.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,CA+E7E"}
@@ -18,6 +18,17 @@ export function registerNodeCommands(parent, getApi) {
18
18
  }));
19
19
  outputJson(result);
20
20
  });
21
+ node
22
+ .command("validate")
23
+ .description("Validate nodes")
24
+ .requiredOption("--nodes <json>", "Array of node definitions (JSON array)")
25
+ .action(async (opts) => {
26
+ const api = getApi();
27
+ const result = await handleApiCall(() => api.orchestration.node.validate({
28
+ nodes: parseJson(opts.nodes, "--nodes"),
29
+ }));
30
+ outputJson(result);
31
+ });
21
32
  node
22
33
  .command("execute")
23
34
  .description("Execute a node")
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAoT5E"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CA0T5E"}
@@ -59,15 +59,19 @@ export function registerRunCommands(parent, getApi) {
59
59
  run
60
60
  .command("create")
61
61
  .description("Create a run")
62
- .requiredOption("--workflow-uuid <uuid>", "Workflow UUID")
63
- .requiredOption("--data <json>", 'Run data (JSON, e.g. {"kind":"segment","segmentUuid":"..."} or {"kind":"record","record":{}})')
62
+ .option("--workflow-uuid <uuid>", "Workflow UUID")
63
+ .requiredOption("--data <json>", "Run data (JSON, e.g. {...})")
64
64
  .option("--release-uuid <uuid>", "Release UUID")
65
+ .option("--nodes <json>", 'Custom nodes to override the workflow definition (JSON array). Must include a start node (slug:"start") and an end node (slug:"end"). E.g. [{"uuid":"a","slug":"start","kind":"native","actionSlug":"start","config":{},"childrenUuids":["b"],"fallbackOnFailure":false,"position":{"x":0,"y":0}},{"uuid":"b","slug":"end","kind":"native","actionSlug":"end","config":{},"childrenUuids":[],"fallbackOnFailure":false,"position":{"x":1,"y":0}}]')
65
66
  .action(async (opts) => {
66
67
  const data = parseJson(opts.data, "--data");
67
68
  const api = getApi();
68
69
  const result = await handleApiCall(() => api.orchestration.run.create({
69
70
  workflowUuid: opts.workflowUuid,
70
71
  releaseUuid: opts.releaseUuid,
72
+ nodes: opts.nodes !== undefined
73
+ ? parseJson(opts.nodes, "--nodes")
74
+ : undefined,
71
75
  data,
72
76
  }));
73
77
  outputJson(result);
package/build/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ #!/usr/bin/env node
1
2
  export {};
2
3
  //# sourceMappingURL=index.d.ts.map
package/build/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  import { Command } from "commander";
2
3
  import { createApi } from "./api.js";
3
4
  import { registerAiCommands } from "./commands/ai/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cargo-ai/cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "private": false,
5
5
  "description": "Command-line interface for the Cargo API",
6
6
  "engines": {
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "commander": "^12.1.0",
32
- "@cargo-ai/api": "^1.0.8"
32
+ "@cargo-ai/api": "^1.0.10"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@cargo-ai/eslint-config": "*",