@cargo-ai/cli 1.0.72 → 1.0.74
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 +21 -0
- package/build/commands/ai/agent.js +2 -2
- package/build/commands/ai/chat.js +1 -1
- package/build/commands/ai/document.js +1 -1
- package/build/commands/ai/memory.js +3 -3
- package/build/commands/ai/message.js +2 -2
- package/build/commands/ai/release.d.ts.map +1 -1
- package/build/commands/ai/release.js +3 -3
- package/build/commands/ai/vote.d.ts.map +1 -1
- package/build/commands/ai/vote.js +1 -1
- package/build/commands/auth/email.d.ts +24 -0
- package/build/commands/auth/email.d.ts.map +1 -1
- package/build/commands/auth/email.js +27 -14
- package/build/commands/auth/index.d.ts.map +1 -1
- package/build/commands/auth/index.js +9 -3
- package/build/commands/auth/workspace.d.ts.map +1 -1
- package/build/commands/auth/workspace.js +99 -26
- package/build/commands/billing/subscription.d.ts.map +1 -1
- package/build/commands/billing/subscription.js +3 -3
- package/build/commands/billing/usage.d.ts.map +1 -1
- package/build/commands/billing/usage.js +1 -1
- package/build/commands/connection/action.d.ts.map +1 -1
- package/build/commands/connection/action.js +1 -1
- package/build/commands/connection/connector.d.ts.map +1 -1
- package/build/commands/connection/connector.js +145 -22
- package/build/commands/connection/integration.d.ts.map +1 -1
- package/build/commands/connection/integration.js +1 -1
- package/build/commands/content/library.js +1 -1
- package/build/commands/context/runtime.js +1 -1
- package/build/commands/expression/recipe.d.ts.map +1 -1
- package/build/commands/expression/recipe.js +9 -9
- package/build/commands/mailboxManagement/event.js +1 -1
- package/build/commands/mailboxManagement/mailbox.d.ts.map +1 -1
- package/build/commands/mailboxManagement/mailbox.js +3 -3
- package/build/commands/mailboxManagement/message.js +1 -1
- package/build/commands/mailboxManagement/suppression.js +1 -1
- package/build/commands/mailboxManagement/thread.js +1 -1
- package/build/commands/observability/alert.js +2 -2
- package/build/commands/orchestration/action.d.ts.map +1 -1
- package/build/commands/orchestration/action.js +18 -63
- package/build/commands/orchestration/batch.js +7 -7
- package/build/commands/orchestration/node.js +2 -2
- package/build/commands/orchestration/play.d.ts.map +1 -1
- package/build/commands/orchestration/play.js +9 -9
- package/build/commands/orchestration/record.d.ts.map +1 -1
- package/build/commands/orchestration/record.js +10 -10
- package/build/commands/orchestration/release.js +1 -1
- package/build/commands/orchestration/run.d.ts.map +1 -1
- package/build/commands/orchestration/run.js +14 -14
- package/build/commands/orchestration/span.d.ts.map +1 -1
- package/build/commands/orchestration/span.js +4 -4
- package/build/commands/orchestration/tool.js +2 -2
- package/build/commands/orchestration/trace.d.ts.map +1 -1
- package/build/commands/orchestration/trace.js +2 -2
- package/build/commands/revenueOrganization/capacity.d.ts.map +1 -1
- package/build/commands/revenueOrganization/capacity.js +2 -2
- package/build/commands/revenueOrganization/territory.js +2 -2
- package/build/commands/segmentation/change.d.ts.map +1 -1
- package/build/commands/segmentation/change.js +4 -4
- package/build/commands/segmentation/record.js +1 -1
- package/build/commands/segmentation/segment.js +2 -2
- package/build/commands/start/brief.d.ts +107 -0
- package/build/commands/start/brief.d.ts.map +1 -0
- package/build/commands/start/brief.js +222 -0
- package/build/commands/start/index.d.ts +44 -0
- package/build/commands/start/index.d.ts.map +1 -0
- package/build/commands/start/index.js +431 -0
- package/build/commands/start/state.d.ts +50 -0
- package/build/commands/start/state.d.ts.map +1 -0
- package/build/commands/start/state.js +101 -0
- package/build/commands/storage/query.js +1 -1
- package/build/commands/storage/record.js +2 -2
- package/build/commands/storage/run.js +2 -2
- package/build/commands/systemOfRecordIntegration/log.js +1 -1
- package/build/commands/systemOfRecordIntegration/systemOfRecord.js +1 -1
- package/build/commands/version.js +1 -1
- package/build/commands/workspaceManagement/folder.d.ts.map +1 -1
- package/build/commands/workspaceManagement/folder.js +1 -1
- package/build/commands/workspaceManagement/role.d.ts.map +1 -1
- package/build/commands/workspaceManagement/role.js +2 -2
- package/build/commands/workspaceManagement/session.js +1 -1
- package/build/commands/workspaceManagement/user.d.ts.map +1 -1
- package/build/commands/workspaceManagement/user.js +2 -2
- package/build/commands/workspaceManagement/workspaces.js +1 -1
- package/build/config.d.ts +1 -0
- package/build/config.d.ts.map +1 -1
- package/build/config.js +1 -0
- package/build/index.js +50 -6
- package/build/paletteLayout.d.ts +16 -0
- package/build/paletteLayout.d.ts.map +1 -0
- package/build/paletteLayout.js +131 -0
- package/build/setupIssues.d.ts +4 -16
- package/build/setupIssues.d.ts.map +1 -1
- package/build/setupIssues.js +3 -52
- package/build/utils/booleanOption.d.ts.map +1 -1
- package/build/utils/booleanOption.js +5 -4
- package/package.json +3 -3
- package/build/commands/orchestration/costTable.d.ts +0 -121
- package/build/commands/orchestration/costTable.d.ts.map +0 -1
- package/build/commands/orchestration/costTable.js +0 -363
package/README.md
CHANGED
|
@@ -234,6 +234,27 @@ npm run type:check
|
|
|
234
234
|
npm run lint:check
|
|
235
235
|
```
|
|
236
236
|
|
|
237
|
+
### Declaring an option's values
|
|
238
|
+
|
|
239
|
+
An option with a closed set of values lists them in its placeholder, never in
|
|
240
|
+
its description:
|
|
241
|
+
|
|
242
|
+
```ts
|
|
243
|
+
.option("--format <csv|json>", "Export format")
|
|
244
|
+
.option("--statuses <idle,pending,success>", "Filter by statuses")
|
|
245
|
+
.option("--is-finished [true|false]", "Only return finished runs")
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
A pipe means "one of these", a comma means "any of these, comma-separated", and
|
|
249
|
+
that is the whole grammar. Commander treats the placeholder as a display name,
|
|
250
|
+
so this changes nothing at parse time — but `--help` shows the set, and the
|
|
251
|
+
interactive palette turns it into a menu rather than an empty text field. Values
|
|
252
|
+
written into the description instead are invisible to both.
|
|
253
|
+
|
|
254
|
+
Use commander's own `.choices()` only when the CLI should _reject_ anything
|
|
255
|
+
else. It usually should not: the API owns these lists, and a value it starts
|
|
256
|
+
accepting would be refused here until someone noticed.
|
|
257
|
+
|
|
237
258
|
## License
|
|
238
259
|
|
|
239
260
|
See the project for license information.
|
|
@@ -23,7 +23,7 @@ export function registerAgentCommands(parent, getApi) {
|
|
|
23
23
|
.command("create")
|
|
24
24
|
.description("Create an agent")
|
|
25
25
|
.requiredOption("--name <name>", "Agent name (string, required)")
|
|
26
|
-
.requiredOption("--icon-color <
|
|
26
|
+
.requiredOption("--icon-color <grey|green|purple|yellow|blue|red>", "Icon color (string, required)")
|
|
27
27
|
.requiredOption("--icon-face <face>", "Icon face identifier (string, required)")
|
|
28
28
|
.option("--description <text>", "Agent description (string)")
|
|
29
29
|
.option("--folder-uuid <uuid>", "Folder UUID to place the agent in (string)")
|
|
@@ -65,7 +65,7 @@ Trigger object shape:
|
|
|
65
65
|
.description("Update an agent")
|
|
66
66
|
.requiredOption("--uuid <uuid>", "Agent UUID (string, required)")
|
|
67
67
|
.option("--name <name>", "Agent name (string)")
|
|
68
|
-
.option("--icon-color <
|
|
68
|
+
.option("--icon-color <grey|green|purple|yellow|blue|red>", "Icon color (string)")
|
|
69
69
|
.option("--icon-face <face>", "Icon face identifier (string)")
|
|
70
70
|
.option("--description <text>", "Agent description (string)")
|
|
71
71
|
.option("--folder-uuid <uuid>", "Folder UUID (string)")
|
|
@@ -9,7 +9,7 @@ export function registerChatCommands(parent, getApi) {
|
|
|
9
9
|
.option("--agent-uuid <uuid>", "Filter by agent UUID (string)")
|
|
10
10
|
.option("--release-uuid <uuid>", "Filter by release UUID (string)")
|
|
11
11
|
.option("--user-uuid <uuid>", "Filter by user UUID (string)")
|
|
12
|
-
.option("--trigger-type <
|
|
12
|
+
.option("--trigger-type <chat|connector|draft|web_extension|app|schedule|workflow>", "Filter by trigger type")
|
|
13
13
|
.option("--search <text>", "Case-insensitive partial match on chat name or slug")
|
|
14
14
|
.option("--limit <n>", "Max results to return (integer)")
|
|
15
15
|
.option("--offset <n>", "Number of results to skip (integer)")
|
|
@@ -30,7 +30,7 @@ export function registerDocumentCommands(parent, getApi) {
|
|
|
30
30
|
.command("create")
|
|
31
31
|
.description("Create a document")
|
|
32
32
|
.requiredOption("--uuid <uuid>", "Document UUID")
|
|
33
|
-
.requiredOption("--kind <
|
|
33
|
+
.requiredOption("--kind <text|code|image|sheet>", "Document kind")
|
|
34
34
|
.requiredOption("--title <title>", "Document title")
|
|
35
35
|
.requiredOption("--content <content>", "Document content")
|
|
36
36
|
.action(async (opts) => {
|
|
@@ -4,7 +4,7 @@ export function registerMemoryCommands(parent, getApi) {
|
|
|
4
4
|
memory
|
|
5
5
|
.command("list")
|
|
6
6
|
.description("List memories")
|
|
7
|
-
.requiredOption("--scope <
|
|
7
|
+
.requiredOption("--scope <user|agent>", "Scope")
|
|
8
8
|
.option("--agent-uuid <uuid>", "Agent UUID (required when scope is agent)")
|
|
9
9
|
.action(async (opts) => {
|
|
10
10
|
const api = getApi();
|
|
@@ -18,7 +18,7 @@ export function registerMemoryCommands(parent, getApi) {
|
|
|
18
18
|
.command("remove")
|
|
19
19
|
.description("Remove a memory")
|
|
20
20
|
.requiredOption("--mem0-id <id>", "Memory ID")
|
|
21
|
-
.requiredOption("--scope <
|
|
21
|
+
.requiredOption("--scope <user|agent>", "Scope")
|
|
22
22
|
.option("--agent-uuid <uuid>", "Agent UUID (required when scope is agent)")
|
|
23
23
|
.action(async (opts) => {
|
|
24
24
|
const api = getApi();
|
|
@@ -33,7 +33,7 @@ export function registerMemoryCommands(parent, getApi) {
|
|
|
33
33
|
.description("Update a memory")
|
|
34
34
|
.requiredOption("--mem0-id <id>", "Memory ID")
|
|
35
35
|
.requiredOption("--content <text>", "Memory content")
|
|
36
|
-
.requiredOption("--scope <
|
|
36
|
+
.requiredOption("--scope <user|agent>", "Scope")
|
|
37
37
|
.option("--agent-uuid <uuid>", "Agent UUID (required when scope is agent)")
|
|
38
38
|
.action(async (opts) => {
|
|
39
39
|
const api = getApi();
|
|
@@ -21,14 +21,14 @@ export function registerMessageCommands(parent, getApi) {
|
|
|
21
21
|
.option("--capabilities <json>", "Capabilities to enable (JSON array of capability objects)")
|
|
22
22
|
.option("--mcp-clients <json>", "MCP clients to connect (JSON array of MCP client objects)")
|
|
23
23
|
.option("--system-prompt <text>", "System prompt override (string)")
|
|
24
|
-
.option("--with-reasoning [
|
|
24
|
+
.option("--with-reasoning [true|false]", "Enable reasoning mode (defaults to true when passed bare)", parseBooleanOption)
|
|
25
25
|
.option("--temperature <n>", "Sampling temperature (float, 0.0-1.0)")
|
|
26
26
|
.option("--max-steps <n>", "Maximum number of agentic steps (integer)")
|
|
27
27
|
.option("--integration-slug <slug>", "Integration slug (string)")
|
|
28
28
|
.option("--connector-uuid <uuid>", "Connector UUID (string)")
|
|
29
29
|
.option("--language-model-slug <slug>", "Language model slug (string)")
|
|
30
30
|
.option("--output <json>", 'Output format for the assistant message (JSON object, e.g. \'{"type":"text"}\' or \'{"type":"jsonSchema","jsonSchema":{...}}\'). Defaults to text when omitted.')
|
|
31
|
-
.option("--wait-until-finished [
|
|
31
|
+
.option("--wait-until-finished [true|false]", "Poll the assistant message until finished before returning (defaults to true when passed bare)", parseBooleanOption)
|
|
32
32
|
.option("--polling-interval <ms>", "Polling interval in milliseconds, used with --wait-until-finished (integer, default: 5000)", "5000")
|
|
33
33
|
.addHelpText("after", `
|
|
34
34
|
Examples:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/release.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,
|
|
1
|
+
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/release.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,CA0SN"}
|
|
@@ -9,7 +9,7 @@ export function registerReleaseCommands(parent, getApi) {
|
|
|
9
9
|
.description("List AI releases")
|
|
10
10
|
.option("--agent-uuid <uuid>", "Filter by agent UUID (string)")
|
|
11
11
|
.option("--user-uuid <uuid>", "Filter by user UUID (string)")
|
|
12
|
-
.option("--statuses <
|
|
12
|
+
.option("--statuses <draft,deployed,archived>", "Filter by statuses")
|
|
13
13
|
.option("--limit <n>", "Max results to return (integer)")
|
|
14
14
|
.option("--offset <n>", "Number of results to skip (integer)")
|
|
15
15
|
.action(async (opts) => {
|
|
@@ -57,7 +57,7 @@ export function registerReleaseCommands(parent, getApi) {
|
|
|
57
57
|
.requiredOption("--agent-uuid <uuid>", "Agent UUID (string, required)")
|
|
58
58
|
.option("--parent-uuid <uuid>", "Parent release UUID to inherit from (string)")
|
|
59
59
|
.option("--system-prompt <text>", "System prompt (string)")
|
|
60
|
-
.option("--with-reasoning [
|
|
60
|
+
.option("--with-reasoning [true|false]", "Enable reasoning mode (defaults to true when passed bare)", parseBooleanOption)
|
|
61
61
|
.option("--temperature <n>", "Sampling temperature (float, 0.0-1.0)")
|
|
62
62
|
.option("--max-steps <n>", "Maximum agentic steps (integer)")
|
|
63
63
|
.option("--integration-slug <slug>", "LLM integration slug (string)")
|
|
@@ -129,7 +129,7 @@ Set "isReadOnly": false on a model resource to grant the agent write tools (inse
|
|
|
129
129
|
.requiredOption("--capabilities <json>", "Capabilities to enable (JSON array, required)")
|
|
130
130
|
.requiredOption("--suggested-actions <json>", "Suggested actions for chat UI (JSON array, required)")
|
|
131
131
|
.option("--system-prompt <text>", "System prompt (string)")
|
|
132
|
-
.option("--with-reasoning [
|
|
132
|
+
.option("--with-reasoning [true|false]", "Enable reasoning mode (defaults to true when passed bare)", parseBooleanOption)
|
|
133
133
|
.option("--temperature <n>", "Sampling temperature (float, 0.0-1.0)")
|
|
134
134
|
.option("--max-steps <n>", "Maximum agentic steps (integer)")
|
|
135
135
|
.option("--connector-uuid <uuid>", "Connector UUID (string)")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vote.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/vote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAIxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"vote.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/vote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAIxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CA0C7E"}
|
|
@@ -7,7 +7,7 @@ export function registerVoteCommands(parent, getApi) {
|
|
|
7
7
|
.description("Upsert a vote")
|
|
8
8
|
.requiredOption("--chat-uuid <uuid>", "Chat UUID")
|
|
9
9
|
.requiredOption("--message-uuid <uuid>", "Message UUID")
|
|
10
|
-
.option("--is-upvoted [
|
|
10
|
+
.option("--is-upvoted [true|false]", "Upvote the message", parseBooleanOption)
|
|
11
11
|
.action(async (opts) => {
|
|
12
12
|
const api = getApi();
|
|
13
13
|
const result = await handleApiCall(() => api.ai.vote.upsert({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ResolvedWorkspace } from "./workspace.js";
|
|
1
2
|
/** `--code -` reads the code from stdin, keeping it out of shell history. */
|
|
2
3
|
export declare const STDIN_CODE = "-";
|
|
3
4
|
export type EmailLoginOptions = {
|
|
@@ -6,11 +7,34 @@ export type EmailLoginOptions = {
|
|
|
6
7
|
workspaceName?: string;
|
|
7
8
|
workspaceUuid?: string;
|
|
8
9
|
baseUrl?: string;
|
|
10
|
+
/**
|
|
11
|
+
* What to re-run when a code was sent but there is no terminal to type it
|
|
12
|
+
* into. Defaults to the `login` form. `start` passes its own, because
|
|
13
|
+
* finishing through `login` would sign the user in and stop there, losing
|
|
14
|
+
* the destination the run was headed for.
|
|
15
|
+
*/
|
|
16
|
+
resumeCommand?: string;
|
|
17
|
+
};
|
|
18
|
+
export type EmailSignInResult = {
|
|
19
|
+
outcome: "signedIn";
|
|
20
|
+
email: string;
|
|
21
|
+
workspace: ResolvedWorkspace;
|
|
22
|
+
}
|
|
23
|
+
/** The code was sent, but there is no terminal to type it back into. */
|
|
24
|
+
| {
|
|
25
|
+
outcome: "codeSent";
|
|
26
|
+
email: string;
|
|
27
|
+
next: string;
|
|
9
28
|
};
|
|
10
29
|
/**
|
|
11
30
|
* Signs in with a code emailed by the identity provider, creating the account
|
|
12
31
|
* on first use. This is the only channel that needs neither a browser nor an
|
|
13
32
|
* existing credential.
|
|
33
|
+
*
|
|
34
|
+
* Returns rather than prints, because two callers need the same exchange and
|
|
35
|
+
* report it differently: `login` writes the JSON result a script reads, while
|
|
36
|
+
* `start` carries on to the next question.
|
|
14
37
|
*/
|
|
38
|
+
export declare function signInWithEmail(opts: EmailLoginOptions): Promise<EmailSignInResult>;
|
|
15
39
|
export declare function runEmailLogin(opts: EmailLoginOptions): Promise<void>;
|
|
16
40
|
//# sourceMappingURL=email.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/email.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/email.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,6EAA6E;AAC7E,eAAO,MAAM,UAAU,MAAM,CAAC;AAE9B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GACzB;IAAE,OAAO,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,iBAAiB,CAAA;CAAE;AACtE,wEAAwE;GACtE;IAAE,OAAO,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzD;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,iBAAiB,CAAC,CA8B5B;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B1E"}
|
|
@@ -10,24 +10,22 @@ export const STDIN_CODE = "-";
|
|
|
10
10
|
* Signs in with a code emailed by the identity provider, creating the account
|
|
11
11
|
* on first use. This is the only channel that needs neither a browser nor an
|
|
12
12
|
* existing credential.
|
|
13
|
+
*
|
|
14
|
+
* Returns rather than prints, because two callers need the same exchange and
|
|
15
|
+
* report it differently: `login` writes the JSON result a script reads, while
|
|
16
|
+
* `start` carries on to the next question.
|
|
13
17
|
*/
|
|
14
|
-
export async function
|
|
18
|
+
export async function signInWithEmail(opts) {
|
|
15
19
|
const email = opts.email;
|
|
16
20
|
if (email === undefined || email.length === 0) {
|
|
17
21
|
failWith("Must pass --email <email>.", { code: ExitCodes.InvalidUsage });
|
|
18
22
|
}
|
|
19
|
-
const resumeCommand =
|
|
23
|
+
const resumeCommand = opts.resumeCommand !== undefined
|
|
24
|
+
? opts.resumeCommand
|
|
25
|
+
: `cargo-ai login --email ${email} --code <code>`;
|
|
20
26
|
const code = await resolveCode({ email, code: opts.code, resumeCommand });
|
|
21
27
|
if (code === undefined) {
|
|
22
|
-
|
|
23
|
-
// successfully so an agent can relay the code and re-run non-interactively.
|
|
24
|
-
outputJson({
|
|
25
|
-
ok: true,
|
|
26
|
-
status: "codeSent",
|
|
27
|
-
email,
|
|
28
|
-
next: resumeCommand,
|
|
29
|
-
});
|
|
30
|
-
return;
|
|
28
|
+
return { outcome: "codeSent", email, next: resumeCommand };
|
|
31
29
|
}
|
|
32
30
|
const spinner = startSpinner("Verifying code...");
|
|
33
31
|
const tokens = await exchangeEmailOtp({ email, otp: code });
|
|
@@ -38,15 +36,30 @@ export async function runEmailLogin(opts) {
|
|
|
38
36
|
workspaceUuid: opts.workspaceUuid,
|
|
39
37
|
workspaceName: opts.workspaceName,
|
|
40
38
|
});
|
|
41
|
-
|
|
39
|
+
return { outcome: "signedIn", email, workspace };
|
|
40
|
+
}
|
|
41
|
+
export async function runEmailLogin(opts) {
|
|
42
|
+
const result = await signInWithEmail(opts);
|
|
43
|
+
if (result.outcome === "codeSent") {
|
|
44
|
+
// Exit successfully so an agent can relay the code and re-run
|
|
45
|
+
// non-interactively.
|
|
46
|
+
outputJson({
|
|
47
|
+
ok: true,
|
|
48
|
+
status: "codeSent",
|
|
49
|
+
email: result.email,
|
|
50
|
+
next: result.next,
|
|
51
|
+
});
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
success(`Signed in as ${result.email}. Workspace: ${result.workspace.name}.`);
|
|
42
55
|
info(AGENT_SKILLS_NEXT_STEP);
|
|
43
56
|
outputJson({
|
|
44
57
|
ok: true,
|
|
45
58
|
status: "signedIn",
|
|
46
59
|
credentialsFile: getCredentialsPath(),
|
|
47
60
|
baseUrl: resolveBaseUrl(opts.baseUrl),
|
|
48
|
-
email,
|
|
49
|
-
workspace,
|
|
61
|
+
email: result.email,
|
|
62
|
+
workspace: result.workspace,
|
|
50
63
|
tokenType: "session",
|
|
51
64
|
});
|
|
52
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAGjD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAGjD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AA2BxD,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAsIN;AA2GD,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpE;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,IAAI,EAAE,aAAa,GAClB,cAAc,CAchB"}
|
|
@@ -5,6 +5,7 @@ import { getConfig } from "../../config.js";
|
|
|
5
5
|
import { clearCredentials, CredentialsNotClearedError, getCredentialsPath, loadCredentials, saveCredentials, } from "../../credentials.js";
|
|
6
6
|
import { parseBooleanOption } from "../../utils/booleanOption.js";
|
|
7
7
|
import { ExitCodes, failWith, handleApiCall, info, outputJson, success, } from "../runHandler.js";
|
|
8
|
+
import { clearStartState } from "../start/state.js";
|
|
8
9
|
import { runEmailLogin } from "./email.js";
|
|
9
10
|
import { selectLoginChannel } from "./loginChannel.js";
|
|
10
11
|
import { runOAuthDeviceFlow } from "./oauth.js";
|
|
@@ -15,7 +16,7 @@ export function registerAuthCommands(program, getApi) {
|
|
|
15
16
|
.description("Sign in to Cargo with an emailed code (--email), via browser (--oauth), or with an existing API token (--token)")
|
|
16
17
|
.option("--email <email>", "Sign in with a code emailed to this address; creates the account on first use")
|
|
17
18
|
.option("--code <code>", 'Verification code from the email, or "-" to read it from stdin; omit to have one sent (--email only)')
|
|
18
|
-
.option("--oauth [
|
|
19
|
+
.option("--oauth [true|false]", "Sign in via browser using the OAuth 2.0 Device Authorization Flow", parseBooleanOption)
|
|
19
20
|
.option("--token <token>", "Existing Cargo API token")
|
|
20
21
|
.option("--workspace-name <name>", "Workspace to use, created if no workspace of that name exists (skips the workspace prompt)")
|
|
21
22
|
.option("--workspace-uuid <uuid>", "Workspace UUID to sign in for (skips the workspace prompt)")
|
|
@@ -82,7 +83,7 @@ Environment variables (CARGO_API_TOKEN, CARGO_WORKSPACE_UUID, CARGO_BASE_URL) ta
|
|
|
82
83
|
program
|
|
83
84
|
.command("logout")
|
|
84
85
|
.description("Sign out: revoke the saved credential and remove it locally")
|
|
85
|
-
.option("--keep-token [
|
|
86
|
+
.option("--keep-token [true|false]", "Only forget the credentials locally, leaving the session or token valid", parseBooleanOption)
|
|
86
87
|
// The credential is usually a session now, so accept the name people reach
|
|
87
88
|
// for; --keep-token stays the documented spelling for existing scripts.
|
|
88
89
|
.addOption(new Option("--keep-session").hideHelp())
|
|
@@ -171,16 +172,21 @@ async function runLogout(opts) {
|
|
|
171
172
|
}
|
|
172
173
|
throw error;
|
|
173
174
|
}
|
|
175
|
+
// Not conditional on `removed`: someone whose credential was an environment
|
|
176
|
+
// variable, or who is signing out a second time, still means "start over".
|
|
177
|
+
const startStateCleared = clearStartState();
|
|
174
178
|
if (removed === true) {
|
|
175
179
|
success(revoked === true ? "Signed out and revoked access." : "Signed out.");
|
|
176
180
|
}
|
|
177
181
|
else {
|
|
178
|
-
info("No saved credentials to remove.");
|
|
182
|
+
info("No saved credentials to remove — nothing was signed in through this CLI.");
|
|
183
|
+
info("If commands still work, the token is coming from CARGO_API_TOKEN or a project .env.");
|
|
179
184
|
}
|
|
180
185
|
outputJson({
|
|
181
186
|
ok: true,
|
|
182
187
|
removed,
|
|
183
188
|
revoked,
|
|
189
|
+
startStateCleared,
|
|
184
190
|
credentialsFile: getCredentialsPath(),
|
|
185
191
|
});
|
|
186
192
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/workspace.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/workspace.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAazD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,mFAAmF;IACnF,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAUF,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAkG/B;AAED,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,SAAS,mBAAmB,CAAC,SAAS,EAAE,EACpD,IAAI,EAAE,MAAM,GACX,iBAAiB,GAAG,SAAS,CAY/B"}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import * as readline from "node:readline/promises";
|
|
2
|
+
import { askText, isInteractive, selectOne } from "@cargo-ai/cdk/cli";
|
|
2
3
|
import { createApi } from "../../api.js";
|
|
3
4
|
import { askQuestion, openPromptInput } from "../../utils/prompt.js";
|
|
4
5
|
import { ExitCodes, failWith, handleApiCall, info, success, } from "../runHandler.js";
|
|
6
|
+
/**
|
|
7
|
+
* The "make me a new one" row. A leading space keeps it out of the uuid
|
|
8
|
+
* namespace, so it can never collide with a real workspace.
|
|
9
|
+
*/
|
|
10
|
+
const CREATE = " create";
|
|
11
|
+
const DEFAULT_WORKSPACE_NAME = "My workspace";
|
|
5
12
|
export async function resolveWorkspace(opts) {
|
|
6
13
|
const accessToken = opts.accessToken;
|
|
7
14
|
const api = createApi({
|
|
@@ -34,28 +41,6 @@ export async function resolveWorkspace(opts) {
|
|
|
34
41
|
wasCreated: false,
|
|
35
42
|
};
|
|
36
43
|
}
|
|
37
|
-
if (workspaces.length === 0) {
|
|
38
|
-
const promptInput = openPromptInput();
|
|
39
|
-
if (promptInput === undefined) {
|
|
40
|
-
failWith("No workspaces found. Re-run with --workspace-name <name> to create one.", { code: ExitCodes.NotFound });
|
|
41
|
-
}
|
|
42
|
-
let name;
|
|
43
|
-
try {
|
|
44
|
-
info("You don't have any workspaces yet. Let's create one.");
|
|
45
|
-
name = await askQuestion(promptInput.stream, "Workspace name (or press Enter to skip): ");
|
|
46
|
-
}
|
|
47
|
-
finally {
|
|
48
|
-
promptInput.close();
|
|
49
|
-
}
|
|
50
|
-
if (name === undefined) {
|
|
51
|
-
failWith("No workspace name provided.", {
|
|
52
|
-
code: ExitCodes.InvalidUsage,
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
const workspace = await createWorkspace(api, name);
|
|
56
|
-
success(`Created workspace: ${workspace.name} (${workspace.uuid})`);
|
|
57
|
-
return { workspace, wasCreated: true };
|
|
58
|
-
}
|
|
59
44
|
if (workspaces.length === 1) {
|
|
60
45
|
const [firstWorkspace] = workspaces;
|
|
61
46
|
if (firstWorkspace === undefined) {
|
|
@@ -66,6 +51,15 @@ export async function resolveWorkspace(opts) {
|
|
|
66
51
|
wasCreated: false,
|
|
67
52
|
};
|
|
68
53
|
}
|
|
54
|
+
// Picking an existing workspace and creating one are the same decision, so
|
|
55
|
+
// they are one question rather than two branches with two different pieces
|
|
56
|
+
// of UI. The readline path below stays for the terminals clack cannot use.
|
|
57
|
+
if (isInteractive() === true) {
|
|
58
|
+
return await chooseWorkspace(api, workspaces);
|
|
59
|
+
}
|
|
60
|
+
if (workspaces.length === 0) {
|
|
61
|
+
return await createWorkspaceByAsking(api);
|
|
62
|
+
}
|
|
69
63
|
const promptInput = openPromptInput();
|
|
70
64
|
if (promptInput === undefined) {
|
|
71
65
|
failWith("Multiple workspaces available and no interactive terminal; pass --workspace-uuid <uuid> (or set CARGO_WORKSPACE_UUID when using install.sh) to select one.", { code: ExitCodes.InvalidUsage });
|
|
@@ -82,10 +76,6 @@ export async function resolveWorkspace(opts) {
|
|
|
82
76
|
}
|
|
83
77
|
return { workspace: selectedWorkspace, wasCreated: false };
|
|
84
78
|
}
|
|
85
|
-
async function createWorkspace(api, name) {
|
|
86
|
-
const result = await handleApiCall(() => api.workspaceManagement.workspace.create({ name }), { spinner: "Creating workspace..." });
|
|
87
|
-
return { uuid: result.workspace.uuid, name: result.workspace.name };
|
|
88
|
-
}
|
|
89
79
|
export function findWorkspaceByName(workspaces, name) {
|
|
90
80
|
const wanted = name.trim().toLowerCase();
|
|
91
81
|
const matched = workspaces.find((workspace) => {
|
|
@@ -96,6 +86,89 @@ export function findWorkspaceByName(workspaces, name) {
|
|
|
96
86
|
}
|
|
97
87
|
return { uuid: matched.uuid, name: matched.name };
|
|
98
88
|
}
|
|
89
|
+
/** Pick from the workspaces you have, or name a new one, in one question. */
|
|
90
|
+
async function chooseWorkspace(api, workspaces) {
|
|
91
|
+
if (workspaces.length === 0) {
|
|
92
|
+
info("You don't have any workspaces yet. Let's create one.");
|
|
93
|
+
return {
|
|
94
|
+
workspace: await createWorkspace(api, await askWorkspaceName()),
|
|
95
|
+
wasCreated: true,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
const chosen = await selectOne({
|
|
99
|
+
// First, not last: past a dozen workspaces the list scrolls, and a create
|
|
100
|
+
// row at the bottom is off-screen — reachable only by someone who already
|
|
101
|
+
// guessed to type "create". The cursor still starts on the first
|
|
102
|
+
// workspace, so the row is visible without Enter landing on it.
|
|
103
|
+
message: "Which workspace should this CLI work in?",
|
|
104
|
+
recommended: workspaces[0] === undefined ? CREATE : workspaces[0].uuid,
|
|
105
|
+
choices: [
|
|
106
|
+
{
|
|
107
|
+
value: CREATE,
|
|
108
|
+
label: "+ Create a new workspace",
|
|
109
|
+
hint: "you name it",
|
|
110
|
+
fallback: true,
|
|
111
|
+
},
|
|
112
|
+
...workspaces.map((workspace) => ({
|
|
113
|
+
value: workspace.uuid,
|
|
114
|
+
label: workspace.name,
|
|
115
|
+
hint: workspace.uuid,
|
|
116
|
+
})),
|
|
117
|
+
],
|
|
118
|
+
});
|
|
119
|
+
if (chosen === CREATE) {
|
|
120
|
+
return {
|
|
121
|
+
workspace: await createWorkspace(api, await askWorkspaceName()),
|
|
122
|
+
wasCreated: true,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
const selected = workspaces.find((workspace) => workspace.uuid === chosen);
|
|
126
|
+
if (selected === undefined) {
|
|
127
|
+
failWith("No workspace selected.", { code: ExitCodes.InvalidUsage });
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
workspace: { uuid: selected.uuid, name: selected.name },
|
|
131
|
+
wasCreated: false,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
async function askWorkspaceName() {
|
|
135
|
+
return await askText({
|
|
136
|
+
message: "Name it",
|
|
137
|
+
placeholder: DEFAULT_WORKSPACE_NAME,
|
|
138
|
+
defaultValue: DEFAULT_WORKSPACE_NAME,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* The zero-workspace path for terminals clack cannot drive — `curl | sh`
|
|
143
|
+
* installers pipe stdin while the controlling terminal stays reachable through
|
|
144
|
+
* /dev/tty, and this is what reads it.
|
|
145
|
+
*/
|
|
146
|
+
async function createWorkspaceByAsking(api) {
|
|
147
|
+
const promptInput = openPromptInput();
|
|
148
|
+
if (promptInput === undefined) {
|
|
149
|
+
failWith("No workspaces found. Re-run with --workspace-name <name> to create one.", { code: ExitCodes.NotFound });
|
|
150
|
+
}
|
|
151
|
+
let name;
|
|
152
|
+
try {
|
|
153
|
+
info("You don't have any workspaces yet. Let's create one.");
|
|
154
|
+
name = await askQuestion(promptInput.stream, "Workspace name (or press Enter to skip): ");
|
|
155
|
+
}
|
|
156
|
+
finally {
|
|
157
|
+
promptInput.close();
|
|
158
|
+
}
|
|
159
|
+
if (name === undefined) {
|
|
160
|
+
failWith("No workspace name provided.", {
|
|
161
|
+
code: ExitCodes.InvalidUsage,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
const workspace = await createWorkspace(api, name);
|
|
165
|
+
success(`Created workspace: ${workspace.name} (${workspace.uuid})`);
|
|
166
|
+
return { workspace, wasCreated: true };
|
|
167
|
+
}
|
|
168
|
+
async function createWorkspace(api, name) {
|
|
169
|
+
const result = await handleApiCall(() => api.workspaceManagement.workspace.create({ name }), { spinner: "Creating workspace..." });
|
|
170
|
+
return { uuid: result.workspace.uuid, name: result.workspace.name };
|
|
171
|
+
}
|
|
99
172
|
async function promptWorkspaceSelection(workspaces, input) {
|
|
100
173
|
const rl = readline.createInterface({
|
|
101
174
|
input,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../src/commands/billing/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAwFxC,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../src/commands/billing/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAwFxC,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAoSN"}
|
|
@@ -86,7 +86,7 @@ Example:
|
|
|
86
86
|
.option("--card-number <number>", "Card number")
|
|
87
87
|
.option("--card-exp <MM/YYYY>", "Card expiry, e.g. 12/2030")
|
|
88
88
|
.option("--card-cvc <cvc>", "Card security code")
|
|
89
|
-
.option("--card-stdin [
|
|
89
|
+
.option("--card-stdin [true|false]", 'Read {"number","expMonth","expYear","cvc"} as JSON from stdin', parseBooleanOption)
|
|
90
90
|
.option("--timeout <seconds>", `Hosted-form mode: how long to wait for the card to change (default: ${String(DEFAULT_TIMEOUT_SECONDS)})`)
|
|
91
91
|
.option("--poll-interval <seconds>", `Hosted-form mode: how often to check for the new card (default: ${String(DEFAULT_POLL_INTERVAL_SECONDS)})`)
|
|
92
92
|
.option("--no-open", "Hosted-form mode: print the URL without launching a browser")
|
|
@@ -160,7 +160,7 @@ Example:
|
|
|
160
160
|
.command("update-plan")
|
|
161
161
|
.description("Change the credit allotment and billing cadence")
|
|
162
162
|
.requiredOption("--credits-count <n>", "Number of credits per period")
|
|
163
|
-
.requiredOption("--cadence <
|
|
163
|
+
.requiredOption("--cadence <monthly|yearly>", "Billing cadence")
|
|
164
164
|
.addHelpText("after", `
|
|
165
165
|
Examples:
|
|
166
166
|
$ cargo-ai billing subscription update-plan --credits-count 10000 --cadence monthly
|
|
@@ -176,7 +176,7 @@ Examples:
|
|
|
176
176
|
subscription
|
|
177
177
|
.command("update-topup")
|
|
178
178
|
.description("Configure automatic credit top-ups")
|
|
179
|
-
.option("--enabled [
|
|
179
|
+
.option("--enabled [true|false]", "Enable automatic top-ups (omit to disable)", parseBooleanOption)
|
|
180
180
|
.requiredOption("--credits-count <n>", "Number of credits to add per top-up")
|
|
181
181
|
.requiredOption("--threshold <n>", "Trigger top-up when remaining credits drop below this number")
|
|
182
182
|
.addHelpText("after", `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/commands/billing/usage.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,
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/commands/billing/usage.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,CAsDN"}
|
|
@@ -13,7 +13,7 @@ export function registerUsageCommands(parent, getApi) {
|
|
|
13
13
|
.option("--slug <slug>", "Slug")
|
|
14
14
|
.option("--agent-uuid <uuid>", "Agent UUID")
|
|
15
15
|
.option("--group-by <value>", "Group by field")
|
|
16
|
-
.option("--unit <
|
|
16
|
+
.option("--unit <billing.credits|storage.records|orchestration.executions>", "Usage unit")
|
|
17
17
|
.action(async (opts) => {
|
|
18
18
|
const api = getApi();
|
|
19
19
|
const result = await handleApiCall(() => api.billing.usage.getMetrics({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../src/commands/connection/action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AA+CxC,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../src/commands/connection/action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AA+CxC,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA2HN"}
|
|
@@ -9,7 +9,7 @@ export function registerActionSearchCommands(parent, getApi) {
|
|
|
9
9
|
.command("search [query...]")
|
|
10
10
|
.description("Search integration actions by keyword across action slug, name, description, and integration — " +
|
|
11
11
|
"instead of scanning the full `integration list` payload")
|
|
12
|
-
.option("--category <
|
|
12
|
+
.option("--category <engagement|marketing|sales|finance|analytics|freeform|success|support|enrichment|storage|custom>", "Filter by integration category")
|
|
13
13
|
.option("--integration <slug>", "Filter by integration slug (string)")
|
|
14
14
|
.option("--credits-only", "Only return credits-based (paid) actions (presence flag)")
|
|
15
15
|
.option("--limit <n>", `Maximum results to return (integer, default: ${String(DEFAULT_LIMIT)})`, String(DEFAULT_LIMIT))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../../src/commands/connection/connector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../../src/commands/connection/connector.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAcxC,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA6TN"}
|