@cargo-ai/cli 1.0.1
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 +114 -0
- package/build/api.d.ts +4 -0
- package/build/api.d.ts.map +1 -0
- package/build/api.js +10 -0
- package/build/commands/ai/agent.d.ts +4 -0
- package/build/commands/ai/agent.d.ts.map +1 -0
- package/build/commands/ai/agent.js +83 -0
- package/build/commands/ai/chat.d.ts +4 -0
- package/build/commands/ai/chat.d.ts.map +1 -0
- package/build/commands/ai/chat.js +71 -0
- package/build/commands/ai/document.d.ts +4 -0
- package/build/commands/ai/document.d.ts.map +1 -0
- package/build/commands/ai/document.js +59 -0
- package/build/commands/ai/file.d.ts +4 -0
- package/build/commands/ai/file.d.ts.map +1 -0
- package/build/commands/ai/file.js +74 -0
- package/build/commands/ai/index.d.ts +4 -0
- package/build/commands/ai/index.d.ts.map +1 -0
- package/build/commands/ai/index.js +33 -0
- package/build/commands/ai/mcpClient.d.ts +4 -0
- package/build/commands/ai/mcpClient.d.ts.map +1 -0
- package/build/commands/ai/mcpClient.js +31 -0
- package/build/commands/ai/mcpServer.d.ts +4 -0
- package/build/commands/ai/mcpServer.d.ts.map +1 -0
- package/build/commands/ai/mcpServer.js +62 -0
- package/build/commands/ai/memory.d.ts +4 -0
- package/build/commands/ai/memory.d.ts.map +1 -0
- package/build/commands/ai/memory.js +50 -0
- package/build/commands/ai/message.d.ts +4 -0
- package/build/commands/ai/message.d.ts.map +1 -0
- package/build/commands/ai/message.js +86 -0
- package/build/commands/ai/prompt.d.ts +4 -0
- package/build/commands/ai/prompt.d.ts.map +1 -0
- package/build/commands/ai/prompt.js +34 -0
- package/build/commands/ai/release.d.ts +4 -0
- package/build/commands/ai/release.d.ts.map +1 -0
- package/build/commands/ai/release.js +150 -0
- package/build/commands/ai/skill.d.ts +4 -0
- package/build/commands/ai/skill.d.ts.map +1 -0
- package/build/commands/ai/skill.js +96 -0
- package/build/commands/ai/suggestedAction.d.ts +4 -0
- package/build/commands/ai/suggestedAction.d.ts.map +1 -0
- package/build/commands/ai/suggestedAction.js +37 -0
- package/build/commands/ai/template.d.ts +4 -0
- package/build/commands/ai/template.d.ts.map +1 -0
- package/build/commands/ai/template.js +14 -0
- package/build/commands/ai/vote.d.ts +4 -0
- package/build/commands/ai/vote.d.ts.map +1 -0
- package/build/commands/ai/vote.js +28 -0
- package/build/commands/auth.d.ts +3 -0
- package/build/commands/auth.d.ts.map +1 -0
- package/build/commands/auth.js +73 -0
- package/build/commands/billing/index.d.ts +4 -0
- package/build/commands/billing/index.d.ts.map +1 -0
- package/build/commands/billing/index.js +9 -0
- package/build/commands/billing/subscription.d.ts +4 -0
- package/build/commands/billing/subscription.d.ts.map +1 -0
- package/build/commands/billing/subscription.js +119 -0
- package/build/commands/billing/usage.d.ts +4 -0
- package/build/commands/billing/usage.d.ts.map +1 -0
- package/build/commands/billing/usage.js +33 -0
- package/build/commands/connection/connector.d.ts +4 -0
- package/build/commands/connection/connector.d.ts.map +1 -0
- package/build/commands/connection/connector.js +129 -0
- package/build/commands/connection/index.d.ts +4 -0
- package/build/commands/connection/index.d.ts.map +1 -0
- package/build/commands/connection/index.js +11 -0
- package/build/commands/connection/integration.d.ts +4 -0
- package/build/commands/connection/integration.d.ts.map +1 -0
- package/build/commands/connection/integration.js +35 -0
- package/build/commands/connection/nativeIntegration.d.ts +4 -0
- package/build/commands/connection/nativeIntegration.d.ts.map +1 -0
- package/build/commands/connection/nativeIntegration.js +14 -0
- package/build/commands/expression/expressionEval.d.ts +4 -0
- package/build/commands/expression/expressionEval.d.ts.map +1 -0
- package/build/commands/expression/expressionEval.js +32 -0
- package/build/commands/expression/favoriteRecipe.d.ts +4 -0
- package/build/commands/expression/favoriteRecipe.d.ts.map +1 -0
- package/build/commands/expression/favoriteRecipe.js +24 -0
- package/build/commands/expression/index.d.ts +4 -0
- package/build/commands/expression/index.d.ts.map +1 -0
- package/build/commands/expression/index.js +11 -0
- package/build/commands/expression/recipe.d.ts +4 -0
- package/build/commands/expression/recipe.d.ts.map +1 -0
- package/build/commands/expression/recipe.js +98 -0
- package/build/commands/init.d.ts +4 -0
- package/build/commands/init.d.ts.map +1 -0
- package/build/commands/init.js +11 -0
- package/build/commands/orchestration/batch.d.ts +4 -0
- package/build/commands/orchestration/batch.d.ts.map +1 -0
- package/build/commands/orchestration/batch.js +106 -0
- package/build/commands/orchestration/draftRelease.d.ts +4 -0
- package/build/commands/orchestration/draftRelease.d.ts.map +1 -0
- package/build/commands/orchestration/draftRelease.js +73 -0
- package/build/commands/orchestration/index.d.ts +4 -0
- package/build/commands/orchestration/index.d.ts.map +1 -0
- package/build/commands/orchestration/index.js +25 -0
- package/build/commands/orchestration/node.d.ts +4 -0
- package/build/commands/orchestration/node.d.ts.map +1 -0
- package/build/commands/orchestration/node.js +44 -0
- package/build/commands/orchestration/play.d.ts +4 -0
- package/build/commands/orchestration/play.d.ts.map +1 -0
- package/build/commands/orchestration/play.js +63 -0
- package/build/commands/orchestration/record.d.ts +4 -0
- package/build/commands/orchestration/record.d.ts.map +1 -0
- package/build/commands/orchestration/record.js +194 -0
- package/build/commands/orchestration/release.d.ts +4 -0
- package/build/commands/orchestration/release.d.ts.map +1 -0
- package/build/commands/orchestration/release.js +27 -0
- package/build/commands/orchestration/run.d.ts +4 -0
- package/build/commands/orchestration/run.d.ts.map +1 -0
- package/build/commands/orchestration/run.js +196 -0
- package/build/commands/orchestration/template.d.ts +4 -0
- package/build/commands/orchestration/template.d.ts.map +1 -0
- package/build/commands/orchestration/template.js +22 -0
- package/build/commands/orchestration/tool.d.ts +4 -0
- package/build/commands/orchestration/tool.d.ts.map +1 -0
- package/build/commands/orchestration/tool.js +72 -0
- package/build/commands/orchestration/workflow.d.ts +4 -0
- package/build/commands/orchestration/workflow.d.ts.map +1 -0
- package/build/commands/orchestration/workflow.js +14 -0
- package/build/commands/revenueOrganization/allocation.d.ts +4 -0
- package/build/commands/revenueOrganization/allocation.d.ts.map +1 -0
- package/build/commands/revenueOrganization/allocation.js +45 -0
- package/build/commands/revenueOrganization/capacity.d.ts +4 -0
- package/build/commands/revenueOrganization/capacity.d.ts.map +1 -0
- package/build/commands/revenueOrganization/capacity.js +94 -0
- package/build/commands/revenueOrganization/index.d.ts +4 -0
- package/build/commands/revenueOrganization/index.d.ts.map +1 -0
- package/build/commands/revenueOrganization/index.js +13 -0
- package/build/commands/revenueOrganization/member.d.ts +4 -0
- package/build/commands/revenueOrganization/member.d.ts.map +1 -0
- package/build/commands/revenueOrganization/member.js +62 -0
- package/build/commands/revenueOrganization/territory.d.ts +4 -0
- package/build/commands/revenueOrganization/territory.d.ts.map +1 -0
- package/build/commands/revenueOrganization/territory.js +72 -0
- package/build/commands/runHandler.d.ts +4 -0
- package/build/commands/runHandler.d.ts.map +1 -0
- package/build/commands/runHandler.js +33 -0
- package/build/commands/segmentation/change.d.ts +4 -0
- package/build/commands/segmentation/change.d.ts.map +1 -0
- package/build/commands/segmentation/change.js +61 -0
- package/build/commands/segmentation/index.d.ts +4 -0
- package/build/commands/segmentation/index.d.ts.map +1 -0
- package/build/commands/segmentation/index.js +11 -0
- package/build/commands/segmentation/record.d.ts +4 -0
- package/build/commands/segmentation/record.d.ts.map +1 -0
- package/build/commands/segmentation/record.js +21 -0
- package/build/commands/segmentation/segment.d.ts +4 -0
- package/build/commands/segmentation/segment.d.ts.map +1 -0
- package/build/commands/segmentation/segment.js +130 -0
- package/build/commands/storage/column.d.ts +4 -0
- package/build/commands/storage/column.d.ts.map +1 -0
- package/build/commands/storage/column.js +84 -0
- package/build/commands/storage/dataset.d.ts +4 -0
- package/build/commands/storage/dataset.d.ts.map +1 -0
- package/build/commands/storage/dataset.js +20 -0
- package/build/commands/storage/index.d.ts +4 -0
- package/build/commands/storage/index.d.ts.map +1 -0
- package/build/commands/storage/index.js +17 -0
- package/build/commands/storage/model.d.ts +4 -0
- package/build/commands/storage/model.d.ts.map +1 -0
- package/build/commands/storage/model.js +141 -0
- package/build/commands/storage/record.d.ts +4 -0
- package/build/commands/storage/record.d.ts.map +1 -0
- package/build/commands/storage/record.js +15 -0
- package/build/commands/storage/relationship.d.ts +4 -0
- package/build/commands/storage/relationship.d.ts.map +1 -0
- package/build/commands/storage/relationship.js +27 -0
- package/build/commands/storage/run.d.ts +4 -0
- package/build/commands/storage/run.d.ts.map +1 -0
- package/build/commands/storage/run.js +42 -0
- package/build/commands/systemOfRecordIntegration/client.d.ts +4 -0
- package/build/commands/systemOfRecordIntegration/client.d.ts.map +1 -0
- package/build/commands/systemOfRecordIntegration/client.js +46 -0
- package/build/commands/systemOfRecordIntegration/index.d.ts +4 -0
- package/build/commands/systemOfRecordIntegration/index.d.ts.map +1 -0
- package/build/commands/systemOfRecordIntegration/index.js +11 -0
- package/build/commands/systemOfRecordIntegration/log.d.ts +4 -0
- package/build/commands/systemOfRecordIntegration/log.d.ts.map +1 -0
- package/build/commands/systemOfRecordIntegration/log.js +36 -0
- package/build/commands/systemOfRecordIntegration/systemOfRecord.d.ts +4 -0
- package/build/commands/systemOfRecordIntegration/systemOfRecord.d.ts.map +1 -0
- package/build/commands/systemOfRecordIntegration/systemOfRecord.js +72 -0
- package/build/commands/userManagement/index.d.ts +4 -0
- package/build/commands/userManagement/index.d.ts.map +1 -0
- package/build/commands/userManagement/index.js +32 -0
- package/build/commands/workspace/file.d.ts +4 -0
- package/build/commands/workspace/file.d.ts.map +1 -0
- package/build/commands/workspace/file.js +44 -0
- package/build/commands/workspace/folder.d.ts +4 -0
- package/build/commands/workspace/folder.d.ts.map +1 -0
- package/build/commands/workspace/folder.js +64 -0
- package/build/commands/workspace/index.d.ts +4 -0
- package/build/commands/workspace/index.d.ts.map +1 -0
- package/build/commands/workspace/index.js +17 -0
- package/build/commands/workspace/role.d.ts +4 -0
- package/build/commands/workspace/role.d.ts.map +1 -0
- package/build/commands/workspace/role.js +12 -0
- package/build/commands/workspace/token.d.ts +4 -0
- package/build/commands/workspace/token.d.ts.map +1 -0
- package/build/commands/workspace/token.js +31 -0
- package/build/commands/workspace/user.d.ts +4 -0
- package/build/commands/workspace/user.d.ts.map +1 -0
- package/build/commands/workspace/user.js +105 -0
- package/build/commands/workspace/workspaces.d.ts +4 -0
- package/build/commands/workspace/workspaces.d.ts.map +1 -0
- package/build/commands/workspace/workspaces.js +74 -0
- package/build/config.d.ts +7 -0
- package/build/config.d.ts.map +1 -0
- package/build/config.js +45 -0
- package/build/credentials.d.ts +10 -0
- package/build/credentials.d.ts.map +1 -0
- package/build/credentials.js +31 -0
- package/build/index.d.ts +2 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +37 -0
- package/package.json +44 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
|
|
2
|
+
export function registerRecipeCommands(parent, getApi) {
|
|
3
|
+
const recipe = parent.command("recipe").description("Recipe operations");
|
|
4
|
+
recipe
|
|
5
|
+
.command("list")
|
|
6
|
+
.description("List recipes")
|
|
7
|
+
.option("--tab <tab>", "Tab filter (all, user, workspace, favorites)")
|
|
8
|
+
.option("--ui-types <types>", "UI types (comma-separated: js, ai)")
|
|
9
|
+
.option("--categories <cats>", "Categories (comma-separated)")
|
|
10
|
+
.option("--name <name>", "Filter by name")
|
|
11
|
+
.option("--limit <n>", "Limit")
|
|
12
|
+
.option("--offset <n>", "Offset")
|
|
13
|
+
.action(async (opts) => {
|
|
14
|
+
const api = getApi();
|
|
15
|
+
const result = await handleApiCall(() => api.expression.recipe.list({
|
|
16
|
+
tab: opts.tab,
|
|
17
|
+
uiTypes: opts.uiTypes !== undefined
|
|
18
|
+
? opts.uiTypes.split(",").map((s) => s.trim())
|
|
19
|
+
: undefined,
|
|
20
|
+
categories: opts.categories !== undefined
|
|
21
|
+
? opts.categories
|
|
22
|
+
.split(",")
|
|
23
|
+
.map((s) => s.trim())
|
|
24
|
+
: undefined,
|
|
25
|
+
name: opts.name,
|
|
26
|
+
limit: opts.limit !== undefined ? parseInt(opts.limit, 10) : undefined,
|
|
27
|
+
offset: opts.offset !== undefined ? parseInt(opts.offset, 10) : undefined,
|
|
28
|
+
}));
|
|
29
|
+
outputJson(result);
|
|
30
|
+
});
|
|
31
|
+
recipe
|
|
32
|
+
.command("get <uuidOrShortId> [version]")
|
|
33
|
+
.description("Get recipe by UUID/shortId and optional version")
|
|
34
|
+
.action(async (uuidOrShortId, version) => {
|
|
35
|
+
const api = getApi();
|
|
36
|
+
const ver = version !== undefined ? parseInt(version, 10) : undefined;
|
|
37
|
+
const result = await handleApiCall(() => ver !== undefined
|
|
38
|
+
? api.expression.recipe.get(uuidOrShortId, ver)
|
|
39
|
+
: api.expression.recipe.getLastVersion(uuidOrShortId));
|
|
40
|
+
outputJson(result);
|
|
41
|
+
});
|
|
42
|
+
recipe
|
|
43
|
+
.command("create")
|
|
44
|
+
.description("Create a recipe")
|
|
45
|
+
.requiredOption("--name <name>", "Recipe name")
|
|
46
|
+
.requiredOption("--description <text>", "Recipe description")
|
|
47
|
+
.requiredOption("--category <cat>", "Category (other, classification, cleaning, marketing, sales, event, copywriting)")
|
|
48
|
+
.requiredOption("--kind <kind>", "Kind (jsExpression or templateExpression)")
|
|
49
|
+
.requiredOption("--expression <expr>", "Expression")
|
|
50
|
+
.requiredOption("--instruct-to <value>", "Instruct to (ai or none)")
|
|
51
|
+
.requiredOption("--placeholders <json>", 'Placeholders (JSON array, e.g. [{"slug":"my_var","label":"My Variable","kind":"text"}])')
|
|
52
|
+
.option("--is-public", "Make recipe public")
|
|
53
|
+
.action(async (opts) => {
|
|
54
|
+
const api = getApi();
|
|
55
|
+
const result = await handleApiCall(() => api.expression.recipe.create({
|
|
56
|
+
name: opts.name,
|
|
57
|
+
description: opts.description,
|
|
58
|
+
category: opts.category,
|
|
59
|
+
kind: opts.kind,
|
|
60
|
+
expression: opts.expression,
|
|
61
|
+
instructTo: opts.instructTo,
|
|
62
|
+
placeholders: parseJson(opts.placeholders, "--placeholders"),
|
|
63
|
+
isPublic: opts.isPublic === true,
|
|
64
|
+
}));
|
|
65
|
+
outputJson(result);
|
|
66
|
+
});
|
|
67
|
+
recipe
|
|
68
|
+
.command("create-new-version")
|
|
69
|
+
.description("Create a new version of a recipe")
|
|
70
|
+
.requiredOption("--uuid <uuid>", "Recipe UUID")
|
|
71
|
+
.requiredOption("--name <name>", "Recipe name")
|
|
72
|
+
.requiredOption("--description <text>", "Recipe description")
|
|
73
|
+
.requiredOption("--category <cat>", "Category (other, classification, cleaning, marketing, sales, event, copywriting)")
|
|
74
|
+
.requiredOption("--expression <expr>", "Expression")
|
|
75
|
+
.requiredOption("--placeholders <json>", 'Placeholders (JSON array, e.g. [{"slug":"my_var","label":"My Variable","kind":"text"}])')
|
|
76
|
+
.option("--is-public", "Make recipe public")
|
|
77
|
+
.action(async (opts) => {
|
|
78
|
+
const api = getApi();
|
|
79
|
+
const result = await handleApiCall(() => api.expression.recipe.createNewVersion({
|
|
80
|
+
uuid: opts.uuid,
|
|
81
|
+
name: opts.name,
|
|
82
|
+
description: opts.description,
|
|
83
|
+
category: opts.category,
|
|
84
|
+
expression: opts.expression,
|
|
85
|
+
placeholders: parseJson(opts.placeholders, "--placeholders"),
|
|
86
|
+
isPublic: opts.isPublic === true,
|
|
87
|
+
}));
|
|
88
|
+
outputJson(result);
|
|
89
|
+
});
|
|
90
|
+
recipe
|
|
91
|
+
.command("archive <uuid>")
|
|
92
|
+
.description("Archive a recipe")
|
|
93
|
+
.action(async (uuid) => {
|
|
94
|
+
const api = getApi();
|
|
95
|
+
await handleApiCall(() => api.expression.recipe.archive(uuid));
|
|
96
|
+
outputJson({ ok: true });
|
|
97
|
+
});
|
|
98
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAGrC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAW5E"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { handleApiCall, outputJson } from "./runHandler.js";
|
|
2
|
+
export function registerInitCommand(parent, getApi) {
|
|
3
|
+
parent
|
|
4
|
+
.command("init")
|
|
5
|
+
.description("Fetch workspace initialisation (user, workspace, datasets, etc.)")
|
|
6
|
+
.action(async () => {
|
|
7
|
+
const api = getApi();
|
|
8
|
+
const result = await handleApiCall(() => api.getInitialisation());
|
|
9
|
+
outputJson(result);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
|
|
2
|
+
export function registerBatchCommands(parent, getApi) {
|
|
3
|
+
const batch = parent.command("batch").description("Batch operations");
|
|
4
|
+
batch
|
|
5
|
+
.command("list")
|
|
6
|
+
.description("List batches")
|
|
7
|
+
.option("--workflow-uuids <uuids>", "Workflow UUIDs (comma-separated)")
|
|
8
|
+
.option("--release-uuid <uuid>", "Release UUID")
|
|
9
|
+
.option("--parent-batch-uuid <uuid>", "Parent batch UUID")
|
|
10
|
+
.option("--parent-run-uuid <uuid>", "Parent run UUID")
|
|
11
|
+
.option("--parent-node-uuid <uuid>", "Parent node UUID")
|
|
12
|
+
.option("--statuses <list>", "Statuses (comma-separated)")
|
|
13
|
+
.option("--has-runs", "Only batches with runs")
|
|
14
|
+
.option("--is-skipped", "Only skipped batches")
|
|
15
|
+
.option("--is-finished", "Only finished batches")
|
|
16
|
+
.option("--included-data-kinds <list>", "Included data kinds (comma-separated)")
|
|
17
|
+
.option("--excluded-data-kinds <list>", "Excluded data kinds (comma-separated)")
|
|
18
|
+
.option("--limit <n>", "Limit", "20")
|
|
19
|
+
.option("--offset <n>", "Offset", "0")
|
|
20
|
+
.action(async (opts) => {
|
|
21
|
+
const api = getApi();
|
|
22
|
+
const result = await handleApiCall(() => api.orchestration.batch.list({
|
|
23
|
+
workflowUuids: opts.workflowUuids !== undefined
|
|
24
|
+
? opts.workflowUuids.split(",").map((s) => s.trim())
|
|
25
|
+
: undefined,
|
|
26
|
+
releaseUuid: opts.releaseUuid,
|
|
27
|
+
parentBatchUuid: opts.parentBatchUuid,
|
|
28
|
+
parentRunUuid: opts.parentRunUuid,
|
|
29
|
+
parentNodeUuid: opts.parentNodeUuid,
|
|
30
|
+
statuses: opts.statuses !== undefined
|
|
31
|
+
? opts.statuses.split(",").map((s) => s.trim())
|
|
32
|
+
: undefined,
|
|
33
|
+
hasRuns: opts.hasRuns,
|
|
34
|
+
isSkipped: opts.isSkipped,
|
|
35
|
+
isFinished: opts.isFinished,
|
|
36
|
+
includedDataKinds: opts.includedDataKinds !== undefined
|
|
37
|
+
? opts.includedDataKinds
|
|
38
|
+
.split(",")
|
|
39
|
+
.map((s) => s.trim())
|
|
40
|
+
: undefined,
|
|
41
|
+
excludedDataKinds: opts.excludedDataKinds !== undefined
|
|
42
|
+
? opts.excludedDataKinds
|
|
43
|
+
.split(",")
|
|
44
|
+
.map((s) => s.trim())
|
|
45
|
+
: undefined,
|
|
46
|
+
limit: opts.limit !== undefined ? parseInt(opts.limit, 10) : undefined,
|
|
47
|
+
offset: opts.offset !== undefined ? parseInt(opts.offset, 10) : undefined,
|
|
48
|
+
}));
|
|
49
|
+
outputJson(result);
|
|
50
|
+
});
|
|
51
|
+
batch
|
|
52
|
+
.command("get <uuid>")
|
|
53
|
+
.description("Get a batch by UUID")
|
|
54
|
+
.action(async (uuid) => {
|
|
55
|
+
const api = getApi();
|
|
56
|
+
const result = await handleApiCall(() => api.orchestration.batch.get(uuid));
|
|
57
|
+
outputJson(result);
|
|
58
|
+
});
|
|
59
|
+
batch
|
|
60
|
+
.command("create")
|
|
61
|
+
.description("Create a batch")
|
|
62
|
+
.requiredOption("--workflow-uuid <uuid>", "Workflow UUID")
|
|
63
|
+
.requiredOption("--data <json>", 'Batch data (JSON, e.g. {"kind":"segment","segmentUuid":"..."} or {"kind":"file","s3Filename":"..."})')
|
|
64
|
+
.action(async (opts) => {
|
|
65
|
+
const api = getApi();
|
|
66
|
+
const result = await handleApiCall(() => api.orchestration.batch.create({
|
|
67
|
+
workflowUuid: opts.workflowUuid,
|
|
68
|
+
data: parseJson(opts.data, "--data"),
|
|
69
|
+
}));
|
|
70
|
+
outputJson(result);
|
|
71
|
+
});
|
|
72
|
+
batch
|
|
73
|
+
.command("cancel <uuid>")
|
|
74
|
+
.description("Cancel a batch")
|
|
75
|
+
.action(async (uuid) => {
|
|
76
|
+
const api = getApi();
|
|
77
|
+
await handleApiCall(() => api.orchestration.batch.cancel(uuid));
|
|
78
|
+
outputJson({ ok: true });
|
|
79
|
+
});
|
|
80
|
+
batch
|
|
81
|
+
.command("preview")
|
|
82
|
+
.description("Preview a batch")
|
|
83
|
+
.requiredOption("--workflow-uuid <uuid>", "Workflow UUID")
|
|
84
|
+
.requiredOption("--data <json>", 'Batch data (JSON, e.g. {"kind":"segment","segmentUuid":"..."} or {"kind":"file","s3Filename":"..."})')
|
|
85
|
+
.action(async (opts) => {
|
|
86
|
+
const api = getApi();
|
|
87
|
+
const result = await handleApiCall(() => api.orchestration.batch.preview({
|
|
88
|
+
workflowUuid: opts.workflowUuid,
|
|
89
|
+
data: parseJson(opts.data, "--data"),
|
|
90
|
+
}));
|
|
91
|
+
outputJson(result);
|
|
92
|
+
});
|
|
93
|
+
batch
|
|
94
|
+
.command("download")
|
|
95
|
+
.description("Download batch results")
|
|
96
|
+
.requiredOption("--uuid <uuid>", "Batch UUID")
|
|
97
|
+
.requiredOption("--output-node-slug <slug>", "Output node slug")
|
|
98
|
+
.action(async (opts) => {
|
|
99
|
+
const api = getApi();
|
|
100
|
+
const result = await handleApiCall(() => api.orchestration.batch.download({
|
|
101
|
+
uuid: opts.uuid,
|
|
102
|
+
outputNodeSlug: opts.outputNodeSlug,
|
|
103
|
+
}));
|
|
104
|
+
outputJson(result);
|
|
105
|
+
});
|
|
106
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draftRelease.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/draftRelease.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA2GN"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
|
|
2
|
+
export function registerDraftReleaseCommands(parent, getApi) {
|
|
3
|
+
const draftRelease = parent
|
|
4
|
+
.command("draft-release")
|
|
5
|
+
.description("Draft release operations");
|
|
6
|
+
draftRelease
|
|
7
|
+
.command("get")
|
|
8
|
+
.description("Get draft release for a workflow")
|
|
9
|
+
.requiredOption("--workflow-uuid <uuid>", "Workflow UUID")
|
|
10
|
+
.action(async (opts) => {
|
|
11
|
+
const api = getApi();
|
|
12
|
+
const result = await handleApiCall(() => api.orchestration.draftRelease.get({
|
|
13
|
+
workflowUuid: opts.workflowUuid,
|
|
14
|
+
}));
|
|
15
|
+
outputJson(result);
|
|
16
|
+
});
|
|
17
|
+
draftRelease
|
|
18
|
+
.command("deploy")
|
|
19
|
+
.description("Deploy draft release")
|
|
20
|
+
.requiredOption("--workflow-uuid <uuid>", "Workflow UUID")
|
|
21
|
+
.requiredOption("--version <version>", "Release version")
|
|
22
|
+
.requiredOption("--nodes <json>", "Nodes (JSON array of node definitions)")
|
|
23
|
+
.requiredOption("--form-fields <json>", "Form fields (JSON array, or 'null')")
|
|
24
|
+
.option("--description <text>", "Release description")
|
|
25
|
+
.option("--options <json>", "Options (JSON object)")
|
|
26
|
+
.action(async (opts) => {
|
|
27
|
+
const api = getApi();
|
|
28
|
+
const result = await handleApiCall(() => api.orchestration.draftRelease.deploy({
|
|
29
|
+
workflowUuid: opts.workflowUuid,
|
|
30
|
+
version: opts.version,
|
|
31
|
+
nodes: parseJson(opts.nodes, "--nodes"),
|
|
32
|
+
formFields: opts.formFields === "null"
|
|
33
|
+
? null
|
|
34
|
+
: parseJson(opts.formFields, "--form-fields"),
|
|
35
|
+
description: opts.description,
|
|
36
|
+
options: opts.options !== undefined
|
|
37
|
+
? parseJson(opts.options, "--options")
|
|
38
|
+
: undefined,
|
|
39
|
+
}));
|
|
40
|
+
outputJson(result);
|
|
41
|
+
});
|
|
42
|
+
draftRelease
|
|
43
|
+
.command("update")
|
|
44
|
+
.description("Update draft release")
|
|
45
|
+
.requiredOption("--workflow-uuid <uuid>", "Workflow UUID")
|
|
46
|
+
.option("--parent-uuid <uuid>", "Parent release UUID")
|
|
47
|
+
.option("--nodes <json>", "Nodes (JSON array of node definitions)")
|
|
48
|
+
.option("--test-records <json>", "Test records (JSON array)")
|
|
49
|
+
.option("--form-fields <json>", "Form fields (JSON array, or 'null')")
|
|
50
|
+
.option("--options <json>", "Options (JSON object)")
|
|
51
|
+
.action(async (opts) => {
|
|
52
|
+
const api = getApi();
|
|
53
|
+
const result = await handleApiCall(() => api.orchestration.draftRelease.update({
|
|
54
|
+
workflowUuid: opts.workflowUuid,
|
|
55
|
+
parentUuid: opts.parentUuid,
|
|
56
|
+
nodes: opts.nodes !== undefined
|
|
57
|
+
? parseJson(opts.nodes, "--nodes")
|
|
58
|
+
: undefined,
|
|
59
|
+
testRecords: opts.testRecords !== undefined
|
|
60
|
+
? parseJson(opts.testRecords, "--test-records")
|
|
61
|
+
: undefined,
|
|
62
|
+
formFields: opts.formFields === "null"
|
|
63
|
+
? null
|
|
64
|
+
: opts.formFields !== undefined
|
|
65
|
+
? parseJson(opts.formFields, "--form-fields")
|
|
66
|
+
: undefined,
|
|
67
|
+
options: opts.options !== undefined
|
|
68
|
+
? parseJson(opts.options, "--options")
|
|
69
|
+
: undefined,
|
|
70
|
+
}));
|
|
71
|
+
outputJson(result);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAYxC,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAeN"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { registerBatchCommands } from "./batch.js";
|
|
2
|
+
import { registerDraftReleaseCommands } from "./draftRelease.js";
|
|
3
|
+
import { registerNodeCommands } from "./node.js";
|
|
4
|
+
import { registerPlayCommands } from "./play.js";
|
|
5
|
+
import { registerRecordCommands } from "./record.js";
|
|
6
|
+
import { registerReleaseCommands } from "./release.js";
|
|
7
|
+
import { registerRunCommands } from "./run.js";
|
|
8
|
+
import { registerTemplateCommands } from "./template.js";
|
|
9
|
+
import { registerToolCommands } from "./tool.js";
|
|
10
|
+
import { registerWorkflowCommands } from "./workflow.js";
|
|
11
|
+
export function registerOrchestrationCommands(parent, getApi) {
|
|
12
|
+
const orchestration = parent
|
|
13
|
+
.command("orchestration")
|
|
14
|
+
.description("Workflows, plays, runs, batches, tools, templates");
|
|
15
|
+
registerWorkflowCommands(orchestration, getApi);
|
|
16
|
+
registerPlayCommands(orchestration, getApi);
|
|
17
|
+
registerRunCommands(orchestration, getApi);
|
|
18
|
+
registerBatchCommands(orchestration, getApi);
|
|
19
|
+
registerReleaseCommands(orchestration, getApi);
|
|
20
|
+
registerDraftReleaseCommands(orchestration, getApi);
|
|
21
|
+
registerToolCommands(orchestration, getApi);
|
|
22
|
+
registerRecordCommands(orchestration, getApi);
|
|
23
|
+
registerTemplateCommands(orchestration, getApi);
|
|
24
|
+
registerNodeCommands(orchestration, getApi);
|
|
25
|
+
}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
|
|
2
|
+
export function registerNodeCommands(parent, getApi) {
|
|
3
|
+
const node = parent.command("node").description("Node operations");
|
|
4
|
+
node
|
|
5
|
+
.command("compute")
|
|
6
|
+
.description("Compute a node")
|
|
7
|
+
.requiredOption("--node <json>", "Node definition (JSON object)")
|
|
8
|
+
.requiredOption("--context <json>", "Execution context (JSON object)")
|
|
9
|
+
.option("--group-context <json>", "Group context (JSON object)")
|
|
10
|
+
.action(async (opts) => {
|
|
11
|
+
const api = getApi();
|
|
12
|
+
const result = await handleApiCall(() => api.orchestration.node.compute({
|
|
13
|
+
node: parseJson(opts.node, "--node"),
|
|
14
|
+
context: parseJson(opts.context, "--context"),
|
|
15
|
+
groupContext: opts.groupContext !== undefined
|
|
16
|
+
? parseJson(opts.groupContext, "--group-context")
|
|
17
|
+
: undefined,
|
|
18
|
+
}));
|
|
19
|
+
outputJson(result);
|
|
20
|
+
});
|
|
21
|
+
node
|
|
22
|
+
.command("execute")
|
|
23
|
+
.description("Execute a node")
|
|
24
|
+
.requiredOption("--workflow-uuid <uuid>", "Workflow UUID")
|
|
25
|
+
.requiredOption("--release-uuid <uuid>", "Release UUID")
|
|
26
|
+
.requiredOption("--node <json>", "Node definition (JSON object)")
|
|
27
|
+
.requiredOption("--computed-config <json>", "Computed config (JSON object)")
|
|
28
|
+
.requiredOption("--context <json>", "Execution context (JSON object)")
|
|
29
|
+
.option("--group-context <json>", "Group context (JSON object)")
|
|
30
|
+
.action(async (opts) => {
|
|
31
|
+
const api = getApi();
|
|
32
|
+
const result = await handleApiCall(() => api.orchestration.node.execute({
|
|
33
|
+
workflowUuid: opts.workflowUuid,
|
|
34
|
+
releaseUuid: opts.releaseUuid,
|
|
35
|
+
node: parseJson(opts.node, "--node"),
|
|
36
|
+
computedConfig: parseJson(opts.computedConfig, "--computed-config"),
|
|
37
|
+
context: parseJson(opts.context, "--context"),
|
|
38
|
+
groupContext: opts.groupContext !== undefined
|
|
39
|
+
? parseJson(opts.groupContext, "--group-context")
|
|
40
|
+
: undefined,
|
|
41
|
+
}));
|
|
42
|
+
outputJson(result);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"play.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/play.ts"],"names":[],"mappings":"AACA,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,CAsF7E"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { handleApiCall, outputJson } from "../runHandler.js";
|
|
2
|
+
export function registerPlayCommands(parent, getApi) {
|
|
3
|
+
const play = parent.command("play").description("Play operations");
|
|
4
|
+
play
|
|
5
|
+
.command("list")
|
|
6
|
+
.description("List all plays")
|
|
7
|
+
.action(async () => {
|
|
8
|
+
const api = getApi();
|
|
9
|
+
const result = await handleApiCall(() => api.orchestration.play.all());
|
|
10
|
+
outputJson(result);
|
|
11
|
+
});
|
|
12
|
+
play
|
|
13
|
+
.command("create")
|
|
14
|
+
.description("Create a play")
|
|
15
|
+
.requiredOption("--name <name>", "Play name")
|
|
16
|
+
.requiredOption("--model-uuid <uuid>", "Model UUID")
|
|
17
|
+
.requiredOption("--change-kinds <kinds>", "Change kinds (comma-separated)")
|
|
18
|
+
.requiredOption("--run-creation-rule <rule>", 'Run creation rule (JSON, e.g. {"kind":"segment","segmentUuid":"..."} or {"kind":"record","record":{}})')
|
|
19
|
+
.option("--description <description>", "Description")
|
|
20
|
+
.option("--folder-uuid <uuid>", "Folder UUID")
|
|
21
|
+
.action(async (opts) => {
|
|
22
|
+
const api = getApi();
|
|
23
|
+
const changeKinds = opts.changeKinds
|
|
24
|
+
.split(",")
|
|
25
|
+
.map((s) => s.trim());
|
|
26
|
+
const validRules = [
|
|
27
|
+
"always",
|
|
28
|
+
"once",
|
|
29
|
+
"noConcurrency",
|
|
30
|
+
];
|
|
31
|
+
const runCreationRule = opts.runCreationRule;
|
|
32
|
+
if (validRules.includes(runCreationRule) === false) {
|
|
33
|
+
throw new Error(`--run-creation-rule must be one of: ${validRules.join(", ")}`);
|
|
34
|
+
}
|
|
35
|
+
const result = await handleApiCall(() => api.orchestration.play.create({
|
|
36
|
+
name: opts.name,
|
|
37
|
+
modelUuid: opts.modelUuid,
|
|
38
|
+
changeKinds,
|
|
39
|
+
runCreationRule,
|
|
40
|
+
description: opts.description,
|
|
41
|
+
folderUuid: opts.folderUuid,
|
|
42
|
+
}));
|
|
43
|
+
outputJson(result);
|
|
44
|
+
});
|
|
45
|
+
play
|
|
46
|
+
.command("update <uuid>")
|
|
47
|
+
.description("Update a play")
|
|
48
|
+
.option("--name <name>", "Play name")
|
|
49
|
+
.option("--description <description>", "Description")
|
|
50
|
+
.action(async (uuid, opts) => {
|
|
51
|
+
const api = getApi();
|
|
52
|
+
const result = await handleApiCall(() => api.orchestration.play.update({ uuid, ...opts }));
|
|
53
|
+
outputJson(result);
|
|
54
|
+
});
|
|
55
|
+
play
|
|
56
|
+
.command("remove <uuid>")
|
|
57
|
+
.description("Remove a play")
|
|
58
|
+
.action(async (uuid) => {
|
|
59
|
+
const api = getApi();
|
|
60
|
+
await handleApiCall(() => api.orchestration.play.remove(uuid));
|
|
61
|
+
outputJson({ ok: true });
|
|
62
|
+
});
|
|
63
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/record.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAuTN"}
|