@cargo-ai/cli 1.0.73 → 1.0.75

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.
Files changed (79) hide show
  1. package/README.md +21 -0
  2. package/build/commands/ai/agent.js +2 -2
  3. package/build/commands/ai/chat.js +1 -1
  4. package/build/commands/ai/document.js +1 -1
  5. package/build/commands/ai/memory.js +3 -3
  6. package/build/commands/ai/message.js +2 -2
  7. package/build/commands/ai/release.d.ts.map +1 -1
  8. package/build/commands/ai/release.js +3 -3
  9. package/build/commands/ai/vote.d.ts.map +1 -1
  10. package/build/commands/ai/vote.js +1 -1
  11. package/build/commands/auth/index.js +2 -2
  12. package/build/commands/billing/subscription.d.ts.map +1 -1
  13. package/build/commands/billing/subscription.js +3 -3
  14. package/build/commands/billing/usage.d.ts.map +1 -1
  15. package/build/commands/billing/usage.js +1 -1
  16. package/build/commands/connection/action.d.ts.map +1 -1
  17. package/build/commands/connection/action.js +1 -1
  18. package/build/commands/connection/connector.js +1 -1
  19. package/build/commands/connection/integration.d.ts.map +1 -1
  20. package/build/commands/connection/integration.js +14 -0
  21. package/build/commands/content/library.js +1 -1
  22. package/build/commands/context/runtime.js +1 -1
  23. package/build/commands/expression/recipe.d.ts.map +1 -1
  24. package/build/commands/expression/recipe.js +9 -9
  25. package/build/commands/mailboxManagement/event.js +1 -1
  26. package/build/commands/mailboxManagement/mailbox.d.ts.map +1 -1
  27. package/build/commands/mailboxManagement/mailbox.js +3 -3
  28. package/build/commands/mailboxManagement/message.js +1 -1
  29. package/build/commands/mailboxManagement/suppression.js +1 -1
  30. package/build/commands/mailboxManagement/thread.js +1 -1
  31. package/build/commands/observability/alert.js +2 -2
  32. package/build/commands/orchestration/action.d.ts.map +1 -1
  33. package/build/commands/orchestration/action.js +18 -63
  34. package/build/commands/orchestration/batch.js +7 -7
  35. package/build/commands/orchestration/node.js +2 -2
  36. package/build/commands/orchestration/play.d.ts.map +1 -1
  37. package/build/commands/orchestration/play.js +9 -9
  38. package/build/commands/orchestration/record.d.ts.map +1 -1
  39. package/build/commands/orchestration/record.js +10 -10
  40. package/build/commands/orchestration/release.js +1 -1
  41. package/build/commands/orchestration/run.d.ts.map +1 -1
  42. package/build/commands/orchestration/run.js +14 -14
  43. package/build/commands/orchestration/span.d.ts.map +1 -1
  44. package/build/commands/orchestration/span.js +4 -4
  45. package/build/commands/orchestration/tool.js +2 -2
  46. package/build/commands/orchestration/trace.d.ts.map +1 -1
  47. package/build/commands/orchestration/trace.js +2 -2
  48. package/build/commands/revenueOrganization/capacity.d.ts.map +1 -1
  49. package/build/commands/revenueOrganization/capacity.js +2 -2
  50. package/build/commands/revenueOrganization/territory.js +2 -2
  51. package/build/commands/segmentation/change.d.ts.map +1 -1
  52. package/build/commands/segmentation/change.js +4 -4
  53. package/build/commands/segmentation/record.js +1 -1
  54. package/build/commands/segmentation/segment.js +2 -2
  55. package/build/commands/start/index.js +1 -1
  56. package/build/commands/storage/query.js +1 -1
  57. package/build/commands/storage/record.js +2 -2
  58. package/build/commands/storage/run.js +2 -2
  59. package/build/commands/systemOfRecordIntegration/log.js +1 -1
  60. package/build/commands/systemOfRecordIntegration/systemOfRecord.js +1 -1
  61. package/build/commands/version.js +1 -1
  62. package/build/commands/workspaceManagement/folder.d.ts.map +1 -1
  63. package/build/commands/workspaceManagement/folder.js +1 -1
  64. package/build/commands/workspaceManagement/role.d.ts.map +1 -1
  65. package/build/commands/workspaceManagement/role.js +2 -2
  66. package/build/commands/workspaceManagement/session.js +1 -1
  67. package/build/commands/workspaceManagement/user.d.ts.map +1 -1
  68. package/build/commands/workspaceManagement/user.js +2 -2
  69. package/build/commands/workspaceManagement/workspaces.js +1 -1
  70. package/build/index.js +52 -9
  71. package/build/paletteLayout.d.ts +16 -0
  72. package/build/paletteLayout.d.ts.map +1 -1
  73. package/build/paletteLayout.js +70 -27
  74. package/build/utils/booleanOption.d.ts.map +1 -1
  75. package/build/utils/booleanOption.js +5 -4
  76. package/package.json +3 -3
  77. package/build/commands/orchestration/costTable.d.ts +0 -121
  78. package/build/commands/orchestration/costTable.d.ts.map +0 -1
  79. package/build/commands/orchestration/costTable.js +0 -363
@@ -14,7 +14,7 @@ export function registerRoleCommands(parent, getApi) {
14
14
  .description("Create a custom role")
15
15
  .requiredOption("--name <name>", "Display name for the role")
16
16
  .requiredOption("--slug <slug>", "Unique identifier for the role")
17
- .option("--color <color>", "Role color (dot in the UI)", "grey")
17
+ .option("--color <orange|red|purple|green|yellow|grey>", "Role color (dot in the UI)", "grey")
18
18
  .option("--description <description>", "Role description")
19
19
  .option("--permissions <json>", "JSON array of permission objects", "[]")
20
20
  .action(async (opts) => {
@@ -33,7 +33,7 @@ export function registerRoleCommands(parent, getApi) {
33
33
  .description("Update a custom role")
34
34
  .requiredOption("--uuid <uuid>", "Role UUID")
35
35
  .option("--name <name>", "Display name for the role")
36
- .option("--color <color>", "Role color (dot in the UI)")
36
+ .option("--color <orange|red|purple|green|yellow|grey>", "Role color (dot in the UI)")
37
37
  .option("--description <description>", "Role description")
38
38
  .option("--permissions <json>", "JSON array of permission objects")
39
39
  .action(async (opts) => {
@@ -10,7 +10,7 @@ export function registerSessionCommands(parent, getApi) {
10
10
  .requiredOption("--session-id <sessionId>", "Claude Code session id")
11
11
  .requiredOption("--title <title>", "Short title for the session")
12
12
  .requiredOption("--summary <summary>", "Summary of what happened in the session")
13
- .option("--finished [value]", "Mark the session as finished now (sets finishedAt = now)", parseBooleanOption)
13
+ .option("--finished [true|false]", "Mark the session as finished now (sets finishedAt = now)", parseBooleanOption)
14
14
  .option("--finished-at <timestamp>", "Explicit ISO timestamp for when the session finished")
15
15
  .action(async (opts) => {
16
16
  let finishedAt;
@@ -1 +1 @@
1
- {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/commands/workspaceManagement/user.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,CA8M7E"}
1
+ {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/commands/workspaceManagement/user.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,CAwM7E"}
@@ -78,7 +78,7 @@ Example:
78
78
  .option("--emails <emails>", "Target user emails (comma-separated strings). At least one of --user-uuids or --emails is required")
79
79
  .requiredOption("--action <action>", "Permission action (string, required)")
80
80
  .requiredOption("--resource-uuid <uuid>", "Resource UUID to grant/deny access to (string, required)")
81
- .requiredOption("--effect <effect>", "Permission effect. Allowed values: allow, deny")
81
+ .requiredOption("--effect <allow|deny>", "Permission effect")
82
82
  .addHelpText("after", `
83
83
  Examples:
84
84
  $ cargo-ai workspaceManagement user upsert-permission --emails alice@example.com --action read --resource-uuid 550e8400-... --effect allow
@@ -106,7 +106,7 @@ Examples:
106
106
  .description("Remove a previously granted/denied user permission")
107
107
  .requiredOption("--user-uuid <uuid>", "User UUID (string, required)")
108
108
  .requiredOption("--resource-uuid <uuid>", "Resource UUID (string, required)")
109
- .requiredOption("--effect <effect>", "Permission effect to remove. Allowed values: allow, deny")
109
+ .requiredOption("--effect <allow|deny>", "Permission effect to remove")
110
110
  .addHelpText("after", `
111
111
  Example:
112
112
  $ cargo-ai workspaceManagement user remove-permission --user-uuid 550e8400-... --resource-uuid 660e8400-... --effect allow`)
@@ -7,7 +7,7 @@ export function registerWorkspacesCommands(parent, getApi) {
7
7
  workspaces
8
8
  .command("list")
9
9
  .description("List all workspaces accessible to the current user")
10
- .option("--refresh [value]", "Bypass any token cache and re-fetch from the server (useful after permission changes)", parseBooleanOption)
10
+ .option("--refresh [true|false]", "Bypass any token cache and re-fetch from the server (useful after permission changes)", parseBooleanOption)
11
11
  .addHelpText("after", `
12
12
  Examples:
13
13
  $ cargo-ai workspaceManagement workspaces list
package/build/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from "node:module";
3
- import { availableCodingAgents, BRAND, canRunPalette, cdkProjectRoot, declareSources, fetchCreditsLeft, fetchWorkspaceName, formatWorkspaceSuffix, isInteractive, printSetupIssues, registerCommands as registerCdkCommands, runPalette, SessionExpiredError, } from "@cargo-ai/cdk/cli";
3
+ import { availableCodingAgents, BRAND, canRunPalette, cdkProjectDir, cdkProjectRoot, declareSources, fetchCreditsLeft, fetchWorkspaceName, formatWorkspaceSuffix, isInteractive, printSetupIssues, registerCommands as registerCdkCommands, runPalette, SessionExpiredError, } from "@cargo-ai/cdk/cli";
4
4
  import { Command } from "commander";
5
5
  import { AGENT_SKILLS_HINT } from "./agentSkills.js";
6
6
  import { createApi } from "./api.js";
@@ -125,10 +125,12 @@ const getApi = () => {
125
125
  };
126
126
  // Where the palette finds answers for an option that wants an id. Keyed by the
127
127
  // flag, because `--model-uuid` asks the same question in all 28 places it
128
- // appears; these six entries cover the 84 uuid options this CLI declares.
128
+ // appears; the uuid entries cover the 84 uuid options this CLI declares, and
129
+ // the integration-slug entries cover every catalog-slug flag the same way.
129
130
  //
130
- // Nobody knows a uuid. Every one of these replaces a field you would otherwise
131
- // have to leave the palette to fill.
131
+ // Nobody knows a uuid — and few people remember every integration slug. Every
132
+ // one of these replaces a field you would otherwise have to leave the palette
133
+ // to fill.
132
134
  declareSources({
133
135
  // A workflow row carries a uuid, two timestamps and a toolUuid — nothing to
134
136
  // choose between. The plays and tools that own those workflows carry a name
@@ -173,6 +175,35 @@ declareSources({
173
175
  "--segment-uuid": [
174
176
  { argv: ["segmentation", "segment", "list"], value: "uuid", label: "name" },
175
177
  ],
178
+ // Integration slugs are the catalog names (`hubspot`, `linkedin`) — same
179
+ // question for `--integration-slug`, the shorter `--integration` filters,
180
+ // and span filters keyed on the node. `--summary` is required: the full
181
+ // list is multi-megabyte and exceeds the palette's capture limit, which
182
+ // truncates JSON and falls back to a free-text prompt.
183
+ "--integration-slug": [
184
+ {
185
+ argv: ["connection", "integration", "list", "--summary"],
186
+ value: "slug",
187
+ label: "name",
188
+ hint: "slug",
189
+ },
190
+ ],
191
+ "--integration": [
192
+ {
193
+ argv: ["connection", "integration", "list", "--summary"],
194
+ value: "slug",
195
+ label: "name",
196
+ hint: "slug",
197
+ },
198
+ ],
199
+ "--node-integration-slug": [
200
+ {
201
+ argv: ["connection", "integration", "list", "--summary"],
202
+ value: "slug",
203
+ label: "name",
204
+ hint: "slug",
205
+ },
206
+ ],
176
207
  });
177
208
  const binPath = process.argv[1] === undefined ? "cargo-ai" : process.argv[1];
178
209
  // First, so it is the first row of the palette: for someone signed in, this is
@@ -231,11 +262,23 @@ async function openPalette(startPath) {
231
262
  // Re-read after each command: signing in or out from inside the palette
232
263
  // changes both what the setup line says and which rows are worth pinning.
233
264
  // The cwd is re-tested too — a command can create a project in it.
234
- const rebuildLayout = () => buildPaletteLayout({
235
- signedIn: isSignedIn(),
236
- agents,
237
- cdkProjectRoot: cdkProjectRoot(process.cwd()),
238
- });
265
+ const rebuildLayout = () => {
266
+ // Read once: a layout describing two different directories could offer to
267
+ // deploy one and name the other.
268
+ const cwd = process.cwd();
269
+ const root = cdkProjectRoot(cwd);
270
+ return buildPaletteLayout({
271
+ signedIn: isSignedIn(),
272
+ agents,
273
+ cdkProjectRoot: root,
274
+ // Resolved from the root, never the cwd. `cdkProjectDir` looks *down* for
275
+ // `infra/` rather than walking up, and a scaffolded `infra/` carries no
276
+ // package.json to be recognised by — so asked from inside one it answers
277
+ // undefined, and `deploy` would fall back to the root it must not use.
278
+ cdkProjectDir: root === undefined ? undefined : cdkProjectDir(root),
279
+ cwd,
280
+ });
281
+ };
239
282
  await runPalette({
240
283
  program,
241
284
  binPath,
@@ -4,6 +4,22 @@ export type PaletteLayoutInput = {
4
4
  agents: readonly CodingAgent[];
5
5
  /** The CDK repo root the palette is standing in, or undefined when none. */
6
6
  cdkProjectRoot: string | undefined;
7
+ /**
8
+ * The directory holding the CDK project — `infra/` for a scaffolded repo, or
9
+ * the same as `cdkProjectRoot` for a hand-rolled layout. Commands that load
10
+ * the resource tree and state (`cdk deploy`) need this, not the repo root.
11
+ *
12
+ * Resolve it from `cdkProjectRoot` rather than from `cwd`: `cdkProjectDir`
13
+ * looks down for `infra/` instead of walking up, so from inside one it
14
+ * answers undefined.
15
+ */
16
+ cdkProjectDir: string | undefined;
17
+ /**
18
+ * Where the palette is standing. The project rows are resolved by walking
19
+ * *up* from here, so this is what says whether they point at the directory
20
+ * on screen or one somewhere above it.
21
+ */
22
+ cwd: string;
7
23
  };
8
24
  export declare function buildPaletteLayout(input: PaletteLayoutInput): PaletteLayout;
9
25
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"paletteLayout.d.ts","sourceRoot":"","sources":["../src/paletteLayout.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAsE/E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/B,4EAA4E;IAC5E,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,GAAG,aAAa,CAM3E;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,EAAE,CA+CjE"}
1
+ {"version":3,"file":"paletteLayout.d.ts","sourceRoot":"","sources":["../src/paletteLayout.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAwE/E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/B,4EAA4E;IAC5E,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC;;;;;;;;OAQG;IACH,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC;;;;OAIG;IACH,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,GAAG,aAAa,CAM3E;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,EAAE,CA4CjE"}
@@ -7,16 +7,19 @@
7
7
  // most often wants, a coding agent briefed on their workspace, two screens
8
8
  // down behind `start`. This is the missing opinion, kept in one place and as
9
9
  // data, so it can be read and tested rather than inferred from a menu.
10
+ import { basename, relative, resolve } from "node:path";
10
11
  /** Pinned row values. The leading space keeps them out of the command namespace. */
11
12
  const SIGN_IN = " sign-in";
12
13
  const DEMO = " demo";
13
14
  const CODE = " code";
14
- const ADD_COOKBOOK = " add-cookbook";
15
+ const ADD = " add";
16
+ const DEPLOY = " deploy";
15
17
  /**
16
18
  * `start` runs most of these; the pinned row is the shortcut to one of them.
17
- * The exception is "Add a cookbook", which runs `cdk add` directly: it is not
18
- * a `start` destination, because it needs neither the sign-in step nor a
19
- * choice of where to carry on — you are already in the project.
19
+ * The exceptions are "Add" and "Deploy", which run `cdk add` and `cdk deploy`
20
+ * directly: neither is a `start` destination, because neither needs the sign-in
21
+ * step nor a choice of where to carry on — you are already in the project. Bare
22
+ * `cdk add` asks connector vs cookbook, then shows that kind's list.
20
23
  */
21
24
  const ENTRANCE = "start";
22
25
  /**
@@ -95,24 +98,27 @@ export function pinnedRows(input) {
95
98
  },
96
99
  ];
97
100
  }
98
- // Inside a CDK project, "Add a cookbook" is more useful than "Set up as
99
- // code" — the project already exists. Outside, scaffold one.
100
- const cdkRow = input.cdkProjectRoot !== undefined
101
- ? {
102
- value: ADD_COOKBOOK,
103
- label: "Add a cookbook",
104
- hint: "install a worked pipeline into this project",
105
- // `--dir` because `cdk add` refuses a directory with no
106
- // package.json, and the palette is as often open in `infra/` — where
107
- // the scaffold's README sends people — as at the root.
108
- argv: ["cdk", "add", "--dir", input.cdkProjectRoot],
109
- }
110
- : {
111
- value: CODE,
112
- label: "Set up as code",
113
- hint: "scaffold a CDK project",
114
- argv: [ENTRANCE, "--continue", "code"],
115
- };
101
+ // Inside a CDK project the rows are the loop somebody is actually in — add a
102
+ // resource, deploy it — and the guided demo is not part of it: it is the tour
103
+ // for a workspace you have not built yet, and this one is open on screen.
104
+ // Outside, there is no project to add to or deploy, so offer the tour and the
105
+ // scaffold instead.
106
+ const projectRows = input.cdkProjectRoot !== undefined
107
+ ? cdkRows(input.cdkProjectRoot, input.cdkProjectDir, input.cwd)
108
+ : [
109
+ {
110
+ value: DEMO,
111
+ label: "Guided demo",
112
+ hint: "companies, then the people, for your ICP",
113
+ argv: [ENTRANCE, "--continue", "demo"],
114
+ },
115
+ {
116
+ value: CODE,
117
+ label: "Set up as code",
118
+ hint: "scaffold a CDK project",
119
+ argv: [ENTRANCE, "--continue", "code"],
120
+ },
121
+ ];
116
122
  return [
117
123
  ...input.agents.map((agent) => ({
118
124
  value: ` agent:${agent.bin}`,
@@ -120,12 +126,49 @@ export function pinnedRows(input) {
120
126
  hint: "briefed on this workspace",
121
127
  argv: [ENTRANCE, "--continue", agent.bin],
122
128
  })),
129
+ ...projectRows,
130
+ ];
131
+ }
132
+ /** The two rows for a palette standing in the CDK project rooted at `root`. */
133
+ function cdkRows(root, projectDir, cwd) {
134
+ // `cdk deploy` loads the resource tree and `cargo.state.json` from the
135
+ // directory it runs in, so it needs the CDK project — `infra/` in a
136
+ // scaffolded repo — where `add` takes the root and resolves that itself.
137
+ const target = projectDir !== undefined ? projectDir : root;
138
+ return [
139
+ {
140
+ value: ADD,
141
+ label: "Add",
142
+ hint: "a connector or a cookbook into this project",
143
+ // `--dir` because `cdk add` refuses a directory with no package.json,
144
+ // and the palette is as often open in `infra/` — where the scaffold's
145
+ // README sends people — as at the root.
146
+ argv: ["cdk", "add", "--dir", root],
147
+ },
123
148
  {
124
- value: DEMO,
125
- label: "Guided demo",
126
- hint: "companies, then the people, for your ICP",
127
- argv: [ENTRANCE, "--continue", "demo"],
149
+ value: DEPLOY,
150
+ label: "Deploy",
151
+ // Name the directory whenever it is not the one on screen. The project is
152
+ // found by walking *up*, so this row can target a project the cwd gives no
153
+ // sign of — and it mutates a live workspace, which in a repo holding more
154
+ // than one project is worth saying out loud before it is picked.
155
+ hint: resolve(target) === resolve(cwd)
156
+ ? "this project to your workspace"
157
+ : `${projectName(target, root)}/ to your workspace`,
158
+ // No `--yes`: `deploy` shows the plan and asks, which is the point of
159
+ // reaching it from a menu.
160
+ argv: ["cdk", "deploy", "--dir", target],
128
161
  },
129
- cdkRow,
130
162
  ];
131
163
  }
164
+ /**
165
+ * A short name for the CDK project directory: where it sits inside the repo
166
+ * (`infra`), or the repo's own directory name when it *is* the repo root.
167
+ *
168
+ * `relative` answers "" for two equal paths — the hand-rolled layout that keeps
169
+ * its resources at the root — and "" is not a name anybody can read.
170
+ */
171
+ function projectName(dir, root) {
172
+ const within = relative(root, dir);
173
+ return within === "" ? basename(root) : within;
174
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"booleanOption.d.ts","sourceRoot":"","sources":["../../src/utils/booleanOption.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,kBAAkB,UAAW,MAAM,GAAG,OAAO,KAAG,OAY5D,CAAC;AAMF,eAAO,MAAM,kBAAkB,aACnB,OAAO,GAAG,SAAS,YACnB,OAAO,GAAG,SAAS;cACN,MAAM;cAAY,MAAM;MAC9C,OAAO,GAAG,SAkBZ,CAAC"}
1
+ {"version":3,"file":"booleanOption.d.ts","sourceRoot":"","sources":["../../src/utils/booleanOption.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,kBAAkB,UAAW,MAAM,GAAG,OAAO,KAAG,OAY5D,CAAC;AAMF,eAAO,MAAM,kBAAkB,aACnB,OAAO,GAAG,SAAS,YACnB,OAAO,GAAG,SAAS;cACN,MAAM;cAAY,MAAM;MAC9C,OAAO,GAAG,SAkBZ,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import { InvalidArgumentError } from "commander";
2
- // Boolean flags are declared as `--flag [value]` so that both `--flag` and the
3
- // form people actually reach for, `--flag false`, are accepted. Commander hands
4
- // this parser the literal `true` when the flag is passed bare, and the raw
5
- // string when a value follows it.
2
+ // Boolean flags are declared as `--flag [true|false]` so that both `--flag` and
3
+ // the form people actually reach for, `--flag false`, are accepted. Commander
4
+ // hands this parser the literal `true` when the flag is passed bare, and the raw
5
+ // string when a value follows it. Spelling the two values out in the placeholder
6
+ // is what puts them in `--help` and turns the flag into a menu in the palette.
6
7
  //
7
8
  // Declaring them as bare flags instead is a trap: `--flag false` parses as the
8
9
  // flag plus a stray `false`, so the caller gets the opposite of what they typed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cargo-ai/cli",
3
- "version": "1.0.73",
3
+ "version": "1.0.75",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "homepage": "https://getcargo.ai",
@@ -64,9 +64,9 @@
64
64
  "format:check": "prettier --check ."
65
65
  },
66
66
  "dependencies": {
67
- "@cargo-ai/api": "^1.0.70",
67
+ "@cargo-ai/api": "^1.0.71",
68
68
  "@cargo-ai/app-sdk": "^1.0.9",
69
- "@cargo-ai/cdk": "^1.0.59",
69
+ "@cargo-ai/cdk": "^1.0.61",
70
70
  "@cargo-ai/types": "^1.0.66",
71
71
  "@cargo-ai/worker-sdk": "^1.0.17",
72
72
  "@modelcontextprotocol/sdk": "1.29.0",
@@ -1,121 +0,0 @@
1
- /**
2
- * Renders every credits-based action as a pricing table.
3
- *
4
- * The catalog is the only place pricing lives, and it moves — providers get
5
- * added, actions get repriced, tiers get split. Anything that copies those
6
- * numbers by hand goes stale silently, so the table is generated rather than
7
- * maintained.
8
- *
9
- * Sourced from `orchestration action list` (without a limit), which spans
10
- * connector and native actions in a single call. Natives are a small set but
11
- * not a free one — `sendEmail` is 0.1, `modelAsk` 0.5, `fileSearch` 0.02/1k
12
- * tokens — and a table built from connectors alone silently omits them while
13
- * claiming to be complete.
14
- */
15
- /**
16
- * Shape returned by `orchestration action list` for each matching action.
17
- */
18
- export type ListActionMatch = {
19
- name: string;
20
- description?: string;
21
- score: number;
22
- action: {
23
- kind: string;
24
- integrationSlug?: string;
25
- actionSlug?: string;
26
- };
27
- integrationName?: string;
28
- category?: string;
29
- credits?: CreditsCost[];
30
- };
31
- export type CreditsCost = {
32
- type?: string;
33
- cost?: number;
34
- unit?: string;
35
- unitsCount?: number;
36
- fixedCost?: number;
37
- config?: {
38
- jsonSchema?: JsonSchema;
39
- };
40
- };
41
- type JsonSchema = {
42
- type?: string;
43
- const?: unknown;
44
- enum?: unknown[];
45
- minItems?: number;
46
- maxItems?: number;
47
- properties?: Record<string, JsonSchema>;
48
- required?: string[];
49
- };
50
- export type CatalogAction = {
51
- name?: string;
52
- description?: string;
53
- credits?: {
54
- costs?: CreditsCost[];
55
- };
56
- };
57
- export type CatalogIntegration = {
58
- slug: string;
59
- name: string;
60
- category?: string;
61
- actions?: Record<string, CatalogAction>;
62
- };
63
- export type CostVariant = {
64
- /** Config that selects this price, e.g. `model=gpt-5-nano`. */
65
- when: string;
66
- /** Rendered price, e.g. `0.4 + 0.006 / 1k token`. */
67
- price: string;
68
- };
69
- export type CostRow = {
70
- integrationSlug: string;
71
- integrationName: string;
72
- category: string | undefined;
73
- actionSlug: string;
74
- name: string | undefined;
75
- description: string | undefined;
76
- /** Cheapest and dearest per-unit price, in credits. */
77
- minCost: number;
78
- maxCost: number;
79
- /**
80
- * What one call at the cheapest config costs — per-unit price plus any flat
81
- * component. The sort key, so a cheap-looking per-item rate with a base
82
- * charge doesn't outrank a genuinely cheaper flat action.
83
- */
84
- sortCost: number;
85
- /** Single price, or `min–max` when config picks between several. */
86
- price: string;
87
- /** Config fields that move the price; empty when there is only one. */
88
- variesBy: string[];
89
- variants: CostVariant[];
90
- };
91
- export type CostTableSummary = {
92
- integrations: number;
93
- integrationsWithActions: number;
94
- actions: number;
95
- creditsBasedActions: number;
96
- freeActions: number;
97
- };
98
- /**
99
- * Natives have no integration of their own. `native` cannot collide with a real
100
- * integration slug, and it is what `kind` an action object needs to run one:
101
- * `{"kind":"native","actionSlug":"sendEmail"}`.
102
- */
103
- export declare const NATIVE_PROVIDER_SLUG = "native";
104
- export declare function asNativeCatalogIntegration(actions: Record<string, CatalogAction> | undefined): CatalogIntegration;
105
- /**
106
- * Groups the flat action list returned by `orchestration action list` into the
107
- * integration-grouped shape that `buildCostRows` and `summarize` expect.
108
- */
109
- export declare function groupActionsByIntegration(actions: ListActionMatch[]): CatalogIntegration[];
110
- export declare function buildCostRows(integrations: CatalogIntegration[]): CostRow[];
111
- export declare function summarize(integrations: CatalogIntegration[]): CostTableSummary;
112
- export type RenderCostTableOptions = {
113
- generatedAt: string;
114
- filter?: {
115
- category?: string;
116
- integration?: string;
117
- };
118
- };
119
- export declare function renderCostTable(rows: CostRow[], summary: CostTableSummary, opts: RenderCostTableOptions): string;
120
- export {};
121
- //# sourceMappingURL=costTable.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"costTable.d.ts","sourceRoot":"","sources":["../../../src/commands/orchestration/costTable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,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