@cargo-ai/cli 1.0.99 → 1.0.100

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 CHANGED
@@ -152,23 +152,23 @@ cargo-ai orchestration workflow --help
152
152
 
153
153
  ### Domains and example commands
154
154
 
155
- | Domain | Description | Example commands |
156
- | ------------------------ | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
157
- | **orchestration** | Workflows, plays, runs, batches, tools, templates | `cargo-ai orchestration workflow list`, `cargo-ai orchestration run list --workflow-uuid <uuid>` |
158
- | **workspaceManagement** | Workspaces, users, tokens, roles, folders | `cargo-ai workspaceManagement workspaces list`, `cargo-ai workspaceManagement token list` |
159
- | **storage** | Datasets, models, relationships, runs, records | `cargo-ai storage dataset list`, `cargo-ai storage model list` |
160
- | **connection** | Connectors and integrations | `cargo-ai connection connector list`, `cargo-ai connection integration list` |
161
- | **billing** | Usage and subscription | `cargo-ai billing subscription get`, `cargo-ai billing usage get-metrics --payload '{"from":"2025-01-01","to":"2025-01-31"}'` |
162
- | **segmentation** | Segments and changes | `cargo-ai segmentation segment list`, `cargo-ai segmentation change list --payload '{}'` |
163
- | **revenue-organization** | Allocations, capacities, members, territories | `cargo-ai revenue-organization member list`, `cargo-ai revenue-organization territory list` |
164
- | **expression** | Recipes and expression evaluation | `cargo-ai expression recipe list`, `cargo-ai expression eval evaluate --payload '{}'` |
165
- | **system-of-record** | System of record, client, logs | `cargo-ai system-of-record sor list`, `cargo-ai system-of-record log list --payload '{}'` |
166
- | **user-management** | Current user (no workspace context) | `cargo-ai user-management user get-current` |
167
- | **ai** | AI templates, agents, releases, chats, MCP, files | `cargo-ai ai template list`, `cargo-ai ai agent list`, `cargo-ai ai file list` |
168
- | **context** | Context repository, runtime sandbox, and knowledge graph | `cargo-ai context repository get`, `cargo-ai context runtime browse --path <path>`, `cargo-ai context graph get` |
169
- | **hosting** | Cargo Hosting apps (Vite SPAs), workers, and deployments | `cargo-ai hosting app list`, `cargo-ai hosting worker list`, `cargo-ai hosting deployment list --payload '{}'` |
170
- | **mailboxManagement** | Owned sending mailboxes, threads, events, suppressions, pricing | `cargo-ai mailboxManagement mailbox list`, `cargo-ai mailboxManagement mailbox get-send-allowance <uuid>` |
171
- | **project** | Declarative IaC: define resources in code, deploy, generate types | `cargo-ai project init <dir>`, `cargo-ai project types`, `cargo-ai project plan`, `cargo-ai project deploy` (`cdk` is an alias) |
155
+ | Domain | Description | Example commands |
156
+ | ------------------------ | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
157
+ | **orchestration** | Workflows, plays, runs, batches, tools, templates | `cargo-ai orchestration workflow list`, `cargo-ai orchestration run list --workflow-uuid <uuid>` |
158
+ | **workspaceManagement** | Workspaces, users, tokens, roles, folders | `cargo-ai workspaceManagement workspaces list`, `cargo-ai workspaceManagement token list` |
159
+ | **storage** | Datasets, models, relationships, runs, records | `cargo-ai storage dataset list`, `cargo-ai storage model list` |
160
+ | **connection** | Connectors and integrations | `cargo-ai connection connector list`, `cargo-ai connection integration list` |
161
+ | **billing** | Usage and subscription | `cargo-ai billing subscription get`, `cargo-ai billing usage get-metrics --payload '{"from":"2025-01-01","to":"2025-01-31"}'` |
162
+ | **segmentation** | Segments and changes | `cargo-ai segmentation segment list`, `cargo-ai segmentation change list --payload '{}'` |
163
+ | **revenue-organization** | Allocations, capacities, members, territories | `cargo-ai revenue-organization member list`, `cargo-ai revenue-organization territory list` |
164
+ | **expression** | Recipes and expression evaluation | `cargo-ai expression recipe list`, `cargo-ai expression eval evaluate --payload '{}'` |
165
+ | **system-of-record** | System of record, client, logs | `cargo-ai system-of-record sor list`, `cargo-ai system-of-record log list --payload '{}'` |
166
+ | **user-management** | Current user (no workspace context) | `cargo-ai user-management user get-current` |
167
+ | **ai** | AI templates, agents, releases, chats, MCP, files | `cargo-ai ai template list`, `cargo-ai ai agent list`, `cargo-ai ai file list` |
168
+ | **context** | Context repository, runtime sandbox, and knowledge graph | `cargo-ai context repository get`, `cargo-ai context runtime browse --path <path>`, `cargo-ai context graph get` |
169
+ | **hosting** | Cargo Hosting apps (Vite SPAs), workers (env vars, logs), and deployments | `cargo-ai hosting app list`, `cargo-ai hosting worker env list --worker-uuid <uuid>`, `cargo-ai hosting worker logs list --worker-uuid <uuid>`, `cargo-ai hosting deployment list --payload '{}'` |
170
+ | **mailboxManagement** | Owned sending mailboxes, threads, events, suppressions, pricing | `cargo-ai mailboxManagement mailbox list`, `cargo-ai mailboxManagement mailbox get-send-allowance <uuid>` |
171
+ | **project** | Declarative IaC: define resources in code, deploy, generate types | `cargo-ai project init <dir>`, `cargo-ai project types`, `cargo-ai project plan`, `cargo-ai project deploy` (`cdk` is an alias) |
172
172
 
173
173
  Commands that accept complex payloads use a `--payload <json>` option (e.g. `cargo-ai orchestration play create --payload '{"name":"My Play",...}'`). Use `--help` on any subcommand for options.
174
174
 
@@ -65,7 +65,7 @@ export function registerReleaseCommands(parent, getApi) {
65
65
  .option("--connector-uuid <uuid>", "Connector UUID (string)")
66
66
  .option("--language-model-slug <slug>", "Language model slug (string)")
67
67
  .option("--harness-slug <slug>", `Coding-agent runtime: ${AiUtils.harnessSlugs.join(", ")}.`)
68
- .option("--repository <json>", "Git workspace for a coding harness (JSON object: connectorUuid, repository as owner/name, defaultBranch, rootDirectory, env)")
68
+ .option("--repository <json>", "Git workspace for a coding harness (JSON object: connectorUuid, repository as owner/name, defaultBranch, rootDirectory, env). The agent acts as the Cargo GitHub app, so install it on that repository first — it clones, pushes and comments as itself, and can do none of it where the app is not installed.")
69
69
  .option("--actions <json>", "Actions configuration (JSON array of action objects)")
70
70
  .option("--mcp-clients <json>", "MCP clients configuration (JSON array of MCP client objects)")
71
71
  .option("--resources <json>", "Resources configuration (JSON array of resource objects)")
@@ -130,7 +130,7 @@ Set "isReadOnly": false on a model resource to grant the agent write tools (inse
130
130
  .option("--integration-slug <slug>", "LLM integration slug (string)")
131
131
  .option("--language-model-slug <slug>", "Language model slug (string)")
132
132
  .option("--harness-slug <slug>", `Coding-agent runtime: ${AiUtils.harnessSlugs.join(", ")}.`)
133
- .option("--repository <json>", "Git workspace for a coding harness (JSON object: connectorUuid, repository as owner/name, defaultBranch, rootDirectory, env)")
133
+ .option("--repository <json>", "Git workspace for a coding harness (JSON object: connectorUuid, repository as owner/name, defaultBranch, rootDirectory, env). The agent acts as the Cargo GitHub app, so install it on that repository first — it clones, pushes and comments as itself, and can do none of it where the app is not installed.")
134
134
  .option("--version <version>", "Semver release version, e.g. 1.0.0 (string, auto-incremented if omitted)")
135
135
  .requiredOption("--actions <json>", "Actions configuration (JSON array of action objects, required)")
136
136
  .requiredOption("--mcp-clients <json>", "MCP clients configuration (JSON array, required)")
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/commands/hosting/app.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAMxC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAsO5E"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/commands/hosting/app.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAOxC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CA4O5E"}
@@ -4,6 +4,7 @@ import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { handleApiCall, outputJson } from "../runHandler.js";
6
6
  import { copyDirectory, listTemplates } from "../templateUtils.js";
7
+ import { registerHostingEnvVarCommands } from "./envVar.js";
7
8
  const require = createRequire(import.meta.url);
8
9
  export function registerAppCommands(parent, getApi) {
9
10
  const app = parent
@@ -87,6 +88,11 @@ export function registerAppCommands(parent, getApi) {
87
88
  ];
88
89
  process.stdout.write(lines.join("\n"));
89
90
  });
91
+ // `env` is taken by the .env.local printer above.
92
+ registerHostingEnvVarCommands(app, getApi, {
93
+ subject: "app",
94
+ name: "env-var",
95
+ });
90
96
  app
91
97
  .command("init <directory>")
92
98
  .description("Scaffold a new Cargo Hosting app locally from a template (Vite + @cargo-ai/app-sdk).")
@@ -0,0 +1,14 @@
1
+ import type { Command } from "commander";
2
+ import type { Api } from "../../api.js";
3
+ type Subject = "app" | "worker";
4
+ /**
5
+ * `env list | set | remove` over the per-app / per-worker env vars
6
+ * (`/hosting/env-vars`). Workspace-wide variables live under
7
+ * `workspaceManagement envVar` and are inherited without being listed here.
8
+ */
9
+ export declare function registerHostingEnvVarCommands(parent: Command, getApi: () => Api, options: {
10
+ subject: Subject;
11
+ name: string;
12
+ }): void;
13
+ export {};
14
+ //# sourceMappingURL=envVar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envVar.d.ts","sourceRoot":"","sources":["../../../src/commands/hosting/envVar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AASxC,KAAK,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;AAehC;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,EACjB,OAAO,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC1C,IAAI,CAqIN"}
@@ -0,0 +1,136 @@
1
+ import { parseBooleanOption } from "../../utils/booleanOption.js";
2
+ import { ExitCodes, failWith, handleApiCall, outputJson, } from "../runHandler.js";
3
+ const SUBJECT_FLAG = {
4
+ app: "--app-uuid",
5
+ worker: "--worker-uuid",
6
+ };
7
+ // Both kinds read the current binding set when a deployment is built or
8
+ // promoted, never while one is live — so every write here says so.
9
+ const REDEPLOY_NOTE = {
10
+ worker: "Changes take effect on the next deployment: run `cargo-ai hosting deployment create --worker-uuid <uuid>` and promote it. `c.env` bindings are attached when a deployment is promoted, and non-secret values are also inlined as `process.env.KEY` at build time, so a live deployment keeps the values it was deployed with. Re-promoting the current deployment refreshes `c.env` only.",
11
+ app: "Changes take effect on the next deployment: run `cargo-ai hosting deployment create --app-uuid <uuid>` and promote it. Values are written into the build's .env, so a VITE_-prefixed value is compiled into the public bundle — never store a real secret on an app; put it on a worker.",
12
+ };
13
+ /**
14
+ * `env list | set | remove` over the per-app / per-worker env vars
15
+ * (`/hosting/env-vars`). Workspace-wide variables live under
16
+ * `workspaceManagement envVar` and are inherited without being listed here.
17
+ */
18
+ export function registerHostingEnvVarCommands(parent, getApi, options) {
19
+ const { subject, name } = options;
20
+ const flag = SUBJECT_FLAG[subject];
21
+ const note = REDEPLOY_NOTE[subject];
22
+ const env = parent
23
+ .command(name)
24
+ .description(`Environment variables set on one ${subject}; they take effect on its next deployment`)
25
+ .addHelpText("after", `
26
+ A key set here overrides a workspace variable (\`workspaceManagement envVar\`) with the same key.
27
+ ${note}`);
28
+ env
29
+ .command("list")
30
+ .description(`List the environment variables set on a ${subject}. Secret values come back as null.`)
31
+ .requiredOption(`${flag} <uuid>`, `${capitalize(subject)} UUID`)
32
+ .action(async (opts) => {
33
+ const api = getApi();
34
+ const subjectUuid = requireSubjectUuid(subject, opts);
35
+ const result = await handleApiCall(() => api.hosting.envVars.list(subject === "app"
36
+ ? { appUuid: subjectUuid }
37
+ : { workerUuid: subjectUuid }));
38
+ outputJson(result);
39
+ });
40
+ env
41
+ .command("set")
42
+ .description(`Create an environment variable on a ${subject}, or update it if the key already exists. Takes effect on the next deployment`)
43
+ .requiredOption(`${flag} <uuid>`, `${capitalize(subject)} UUID`)
44
+ .requiredOption("--key <key>", "Environment variable name")
45
+ .option("--value <value>", "Value. Pass '-' to read it from stdin, or omit it to read the local environment variable of the same name — both keep a secret out of shell history")
46
+ .option("--secret [true|false]", "Encrypt the value at rest and never return it. On an existing key, omit to keep its current setting", parseBooleanOption)
47
+ .addHelpText("after", `
48
+ Examples:
49
+ $ cargo-ai hosting ${subject} ${name} set ${flag} <uuid> --key LOG_LEVEL --value debug
50
+ $ printf %s "$TOKEN" | cargo-ai hosting ${subject} ${name} set ${flag} <uuid> --key CARGO_API_TOKEN --value - --secret
51
+ $ CARGO_API_TOKEN=... cargo-ai hosting ${subject} ${name} set ${flag} <uuid> --key CARGO_API_TOKEN --secret
52
+
53
+ ${note}`)
54
+ .action(async (opts) => {
55
+ const api = getApi();
56
+ const subjectUuid = requireSubjectUuid(subject, opts);
57
+ const value = await resolveValue(opts.key, opts.value);
58
+ const { envVars } = await handleApiCall(() => api.hosting.envVars.list(subject === "app"
59
+ ? { appUuid: subjectUuid }
60
+ : { workerUuid: subjectUuid }));
61
+ const existing = envVars.find((envVar) => envVar.key === opts.key);
62
+ if (existing !== undefined) {
63
+ const result = await handleApiCall(() => api.hosting.envVars.update({
64
+ uuid: existing.uuid,
65
+ value,
66
+ isSecret: opts.secret !== undefined ? opts.secret : existing.isSecret,
67
+ }));
68
+ outputJson({ outcome: "updated", envVar: result.envVar });
69
+ return;
70
+ }
71
+ const isSecret = opts.secret === true;
72
+ const result = await handleApiCall(() => api.hosting.envVars.create(subject === "app"
73
+ ? {
74
+ kind: "app",
75
+ appUuid: subjectUuid,
76
+ key: opts.key,
77
+ value,
78
+ isSecret,
79
+ }
80
+ : {
81
+ kind: "worker",
82
+ workerUuid: subjectUuid,
83
+ key: opts.key,
84
+ value,
85
+ isSecret,
86
+ }));
87
+ outputJson({ outcome: "created", envVar: result.envVar });
88
+ });
89
+ env
90
+ .command("remove <envVarUuid>")
91
+ .description(`Remove an environment variable from a ${subject} (UUID from \`${name} list\`). Takes effect on the next deployment`)
92
+ .addHelpText("after", `\n${note}`)
93
+ .action(async (envVarUuid) => {
94
+ const api = getApi();
95
+ await handleApiCall(() => api.hosting.envVars.remove({ uuid: envVarUuid }));
96
+ outputJson({ ok: true });
97
+ });
98
+ }
99
+ const capitalize = (value) => value.charAt(0).toUpperCase() + value.slice(1);
100
+ const requireSubjectUuid = (subject, opts) => {
101
+ const uuid = subject === "app" ? opts.appUuid : opts.workerUuid;
102
+ if (uuid === undefined) {
103
+ failWith(`${SUBJECT_FLAG[subject]} is required.`, {
104
+ code: ExitCodes.InvalidUsage,
105
+ });
106
+ }
107
+ return uuid;
108
+ };
109
+ /**
110
+ * `--value -` reads stdin and a missing `--value` falls back to the local
111
+ * environment: either way the secret never appears in argv or shell history.
112
+ * One trailing newline is dropped, since `echo` and here-strings add it.
113
+ */
114
+ const resolveValue = async (key, value) => {
115
+ if (value === "-") {
116
+ if (process.stdin.isTTY === true) {
117
+ failWith("--value - expects the value on stdin.", {
118
+ code: ExitCodes.InvalidUsage,
119
+ });
120
+ }
121
+ const chunks = [];
122
+ for await (const chunk of process.stdin)
123
+ chunks.push(chunk);
124
+ return Buffer.concat(chunks)
125
+ .toString("utf8")
126
+ .replace(/\r?\n$/, "");
127
+ }
128
+ if (value !== undefined) {
129
+ return value;
130
+ }
131
+ const fromEnvironment = process.env[key];
132
+ if (fromEnvironment === undefined) {
133
+ failWith(`No value given — pass --value, pipe it with --value -, or export ${key} before running this command.`, { code: ExitCodes.InvalidUsage });
134
+ }
135
+ return fromEnvironment;
136
+ };
@@ -0,0 +1,10 @@
1
+ import type { Command } from "commander";
2
+ import type { Api } from "../../api.js";
3
+ /**
4
+ * Runtime log lines for a worker (`/hosting/logs/*`), newest first: the
5
+ * `console.*` calls drained by `createWorker()` — an `Error` argument lands in
6
+ * `attributes.error` with its stack — plus one `error` line per invocation that
7
+ * crashed, timed out, or answered with HTTP 4xx/5xx.
8
+ */
9
+ export declare function registerWorkerLogCommands(parent: Command, getApi: () => Api): void;
10
+ //# sourceMappingURL=logs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../../src/commands/hosting/logs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AA8BxC;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAoEN"}
@@ -0,0 +1,77 @@
1
+ import { csvList, optionalLimit, optionalOffset, } from "../mailboxManagement/options.js";
2
+ import { ExitCodes, failWith, handleApiCall, outputJson, } from "../runHandler.js";
3
+ const LOG_LEVELS = [
4
+ "log",
5
+ "info",
6
+ "warn",
7
+ "error",
8
+ "debug",
9
+ ];
10
+ /**
11
+ * Runtime log lines for a worker (`/hosting/logs/*`), newest first: the
12
+ * `console.*` calls drained by `createWorker()` — an `Error` argument lands in
13
+ * `attributes.error` with its stack — plus one `error` line per invocation that
14
+ * crashed, timed out, or answered with HTTP 4xx/5xx.
15
+ */
16
+ export function registerWorkerLogCommands(parent, getApi) {
17
+ const logs = parent
18
+ .command("logs")
19
+ .description("Runtime logs of a worker: console output drained by createWorker() and one error line per failed invocation (crash, timeout, HTTP 4xx/5xx). Newest first.");
20
+ const withFilters = (command) => command
21
+ .requiredOption("--worker-uuid <uuid>", "Worker UUID")
22
+ .option("--run-uuid <uuid>", "Only lines from one invocation (the x-cargo-run-uuid of the request)")
23
+ .option(`--levels <${LOG_LEVELS.join(",")}>`, "Comma-separated levels to include")
24
+ .option("--search <text>", "Match the message or attributes")
25
+ .option("--occurred-after <date>", "Occurred after (ISO 8601)")
26
+ .option("--occurred-before <date>", "Occurred before (ISO 8601)");
27
+ withFilters(logs.command("list").description("List a worker's log lines, newest first"))
28
+ .option("--limit <n>", "Max lines to return (1-500)")
29
+ .option("--offset <n>", "Number of lines to skip (integer)")
30
+ .addHelpText("after", `
31
+ Examples:
32
+ $ cargo-ai hosting worker logs list --worker-uuid <uuid> --levels error,warn --limit 50
33
+ $ cargo-ai hosting worker logs list --worker-uuid <uuid> --run-uuid <runUuid>
34
+ $ cargo-ai hosting worker logs list --worker-uuid <uuid> --occurred-after 2026-09-21T00:00:00Z`)
35
+ .action(async (opts) => {
36
+ const api = getApi();
37
+ const result = await handleApiCall(() => api.hosting.log.list({
38
+ ...buildFilters(opts),
39
+ limit: optionalLimit(opts.limit),
40
+ offset: optionalOffset(opts.offset),
41
+ }));
42
+ outputJson(result);
43
+ });
44
+ withFilters(logs.command("count").description("Count a worker's log lines")).action(async (opts) => {
45
+ const api = getApi();
46
+ const result = await handleApiCall(() => api.hosting.log.count(buildFilters(opts)));
47
+ outputJson(result);
48
+ });
49
+ logs
50
+ .command("get <logUuid>")
51
+ .description("Show one log line with its full attributes")
52
+ .requiredOption("--worker-uuid <uuid>", "Worker that emitted the line")
53
+ .action(async (logUuid, opts) => {
54
+ const api = getApi();
55
+ const result = await handleApiCall(() => api.hosting.log.get({ workerUuid: opts.workerUuid, uuid: logUuid }));
56
+ outputJson(result);
57
+ });
58
+ }
59
+ const buildFilters = (opts) => ({
60
+ workerUuid: opts.workerUuid,
61
+ runUuid: opts.runUuid,
62
+ levels: parseLevels(opts.levels),
63
+ search: opts.search,
64
+ occurredAfter: opts.occurredAfter,
65
+ occurredBefore: opts.occurredBefore,
66
+ });
67
+ const parseLevels = (value) => {
68
+ const levels = csvList(value);
69
+ if (levels === undefined) {
70
+ return undefined;
71
+ }
72
+ const unknown = levels.filter((level) => LOG_LEVELS.includes(level) === false);
73
+ if (unknown.length > 0) {
74
+ failWith(`Unknown --levels value: ${unknown.join(", ")}. Expected any of ${LOG_LEVELS.join(", ")}.`, { code: ExitCodes.InvalidUsage });
75
+ }
76
+ return levels;
77
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../src/commands/hosting/worker.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAMxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAuON"}
1
+ {"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../src/commands/hosting/worker.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAQxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA6ON"}
@@ -4,6 +4,8 @@ import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
6
6
  import { copyDirectory, listTemplates } from "../templateUtils.js";
7
+ import { registerHostingEnvVarCommands } from "./envVar.js";
8
+ import { registerWorkerLogCommands } from "./logs.js";
7
9
  const require = createRequire(import.meta.url);
8
10
  export function registerWorkerCommands(parent, getApi) {
9
11
  const worker = parent
@@ -74,6 +76,11 @@ export function registerWorkerCommands(parent, getApi) {
74
76
  await handleApiCall(() => api.hosting.worker.remove(uuid));
75
77
  outputJson({ ok: true });
76
78
  });
79
+ registerHostingEnvVarCommands(worker, getApi, {
80
+ subject: "worker",
81
+ name: "env",
82
+ });
83
+ registerWorkerLogCommands(worker, getApi);
77
84
  worker
78
85
  .command("init <directory>")
79
86
  .description("Scaffold a new Cargo Hosting worker locally from a template (edge `fetch(request, env)` handler).")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cargo-ai/cli",
3
- "version": "1.0.99",
3
+ "version": "1.0.100",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "homepage": "https://getcargo.ai",
@@ -67,12 +67,12 @@
67
67
  "dependencies": {
68
68
  "@ai-sdk/harness": "^1.0.95",
69
69
  "@ai-sdk/harness-claude-code": "^1.0.99",
70
- "@cargo-ai/api": "^1.0.84",
70
+ "@cargo-ai/api": "^1.0.85",
71
71
  "@cargo-ai/app-sdk": "^1.0.10",
72
72
  "@cargo-ai/cdk": "^1.0.84",
73
- "@cargo-ai/types": "^1.0.80",
73
+ "@cargo-ai/types": "^1.0.82",
74
74
  "@cargo-ai/utils": "^1.0.31",
75
- "@cargo-ai/worker-sdk": "^1.0.19",
75
+ "@cargo-ai/worker-sdk": "^1.0.20",
76
76
  "@modelcontextprotocol/sdk": "1.29.0",
77
77
  "ai": "^7.0.84",
78
78
  "ai-sdk-sandbox-local": "^0.1.2",