@asteroidai/cli 1.9.99 → 1.9.105

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/dist/asteroid.js CHANGED
@@ -5,6 +5,19 @@ import { spawn } from "node:child_process";
5
5
 
6
6
  // src/generated/commands.ts
7
7
  var COMMANDS = [
8
+ {
9
+ command: "api-key list",
10
+ tool: "api_keys_list",
11
+ title: "List API keys",
12
+ description: "List the organization's API keys, newest first: name, obfuscated value, creator, created, last used and expiry. Values never appear. Use it to check that a key exists before deploying. Keys are created in the platform; `organizationId` defaults to the caller's one organization.",
13
+ method: "GET",
14
+ path: "/users/v2/api-keys",
15
+ args: [],
16
+ query: [],
17
+ binary: false,
18
+ readOnly: true,
19
+ destructive: false
20
+ },
8
21
  {
9
22
  command: "batch cancel",
10
23
  tool: "execution_batch_cancel",
@@ -25,6 +38,61 @@ var COMMANDS = [
25
38
  readOnly: false,
26
39
  destructive: true
27
40
  },
41
+ {
42
+ command: "batch create",
43
+ tool: "execution_batch_create",
44
+ title: "Create execution batch",
45
+ description: 'Queue one execution per row of `items` for `workflowId`, starting at `startAt` (ISO 8601; now or earlier starts at once). `config` paces the runs: `{type: "maxConcurrent", maxConcurrent}` or `{type: "timeBatching", batchSize, batchInterval}` (seconds). Each item takes `inputs` (see `workflow_version_inputs_get`), optional `profileId` or `profileGroupId`, `metadata`, and `workflowVersionId` to pin a version. Check the same body first with `execution_batch_validate`. Returns the batch; follow it with `execution_batch_get`, and its runs with `executions_list` filtered by `batchId`.',
46
+ method: "POST",
47
+ path: "/agents/v2/execution-batches",
48
+ args: [],
49
+ query: [],
50
+ binary: false,
51
+ readOnly: false,
52
+ destructive: false,
53
+ body: {
54
+ required: true,
55
+ contentType: "application/json",
56
+ fields: [
57
+ {
58
+ name: "workflowId",
59
+ flag: "workflow-id",
60
+ type: "string",
61
+ required: false,
62
+ description: "Workflow ID for this batch. Set this or agentId."
63
+ },
64
+ {
65
+ name: "name",
66
+ flag: "name",
67
+ type: "string",
68
+ required: true
69
+ },
70
+ {
71
+ name: "startAt",
72
+ flag: "start-at",
73
+ type: "string",
74
+ required: true,
75
+ description: "When to start triggering executions"
76
+ },
77
+ {
78
+ name: "config",
79
+ flag: "config",
80
+ type: "json",
81
+ required: true,
82
+ description: "Discriminated union of batch configuration types (discriminated by type)"
83
+ },
84
+ {
85
+ name: "items",
86
+ flag: "items",
87
+ type: "json",
88
+ required: true
89
+ }
90
+ ],
91
+ files: [],
92
+ credentialOrganization: false
93
+ },
94
+ capability: "run_execution"
95
+ },
28
96
  {
29
97
  command: "batch get",
30
98
  tool: "execution_batch_get",
@@ -127,6 +195,60 @@ var COMMANDS = [
127
195
  destructive: false,
128
196
  capability: "run_execution"
129
197
  },
198
+ {
199
+ command: "batch validate",
200
+ tool: "execution_batch_validate",
201
+ title: "Validate execution batch",
202
+ description: "Check an `execution_batch_create` body without creating anything. Returns `valid`, `itemCount`, and `issues`: each row (by its 0-based `index` in `items`) whose inputs would fail the input schema of the version it runs. A problem with the whole batch, such as an empty `items` or a bad `config`, returns the same error create would.",
203
+ method: "POST",
204
+ path: "/agents/v2/execution-batches/validate",
205
+ args: [],
206
+ query: [],
207
+ binary: false,
208
+ readOnly: true,
209
+ destructive: false,
210
+ body: {
211
+ required: true,
212
+ contentType: "application/json",
213
+ fields: [
214
+ {
215
+ name: "workflowId",
216
+ flag: "workflow-id",
217
+ type: "string",
218
+ required: false,
219
+ description: "Workflow ID for this batch. Set this or agentId."
220
+ },
221
+ {
222
+ name: "name",
223
+ flag: "name",
224
+ type: "string",
225
+ required: true
226
+ },
227
+ {
228
+ name: "startAt",
229
+ flag: "start-at",
230
+ type: "string",
231
+ required: true,
232
+ description: "When to start triggering executions"
233
+ },
234
+ {
235
+ name: "config",
236
+ flag: "config",
237
+ type: "json",
238
+ required: true,
239
+ description: "Discriminated union of batch configuration types (discriminated by type)"
240
+ },
241
+ {
242
+ name: "items",
243
+ flag: "items",
244
+ type: "json",
245
+ required: true
246
+ }
247
+ ],
248
+ files: [],
249
+ credentialOrganization: false
250
+ }
251
+ },
130
252
  {
131
253
  command: "context",
132
254
  tool: "get_context",
@@ -1336,6 +1458,13 @@ var COMMANDS = [
1336
1458
  type: "string[]",
1337
1459
  required: false,
1338
1460
  description: "Filter by login profile IDs (can specify multiple, there is an 'OR' condition applied to these)"
1461
+ },
1462
+ {
1463
+ name: "batchId",
1464
+ flag: "batch-id",
1465
+ type: "string",
1466
+ required: false,
1467
+ description: "Only executions started by this batch, an ID from `execution_batches_list`. Rows not yet triggered have no execution yet: list them with `scheduled_executions_list` and `batchId`."
1339
1468
  }
1340
1469
  ],
1341
1470
  binary: false,
@@ -1610,6 +1739,13 @@ var COMMANDS = [
1610
1739
  type: "string[]",
1611
1740
  required: false,
1612
1741
  description: "Filter by login profile IDs (can specify multiple, there is an 'OR' condition applied to these)"
1742
+ },
1743
+ {
1744
+ name: "batchId",
1745
+ flag: "batch-id",
1746
+ type: "string",
1747
+ required: false,
1748
+ description: "Only executions started by this batch, an ID from `execution_batches_list`. Rows not yet triggered have no execution yet: list them with `scheduled_executions_list` and `batchId`."
1613
1749
  }
1614
1750
  ],
1615
1751
  binary: false,
@@ -6680,7 +6816,7 @@ var ApiError = class extends Error {
6680
6816
  status;
6681
6817
  body;
6682
6818
  };
6683
- var VERSION = "1.9.99";
6819
+ var VERSION = "1.9.105";
6684
6820
  function problem(status, body, fallback) {
6685
6821
  if (body && typeof body === "object") {
6686
6822
  const record2 = body;
@@ -7811,6 +7947,8 @@ async function entryBytes(sync, workflowId, tree, entry) {
7811
7947
  if (entry.contentBase64 !== void 0)
7812
7948
  return Buffer.from(entry.contentBase64, "base64");
7813
7949
  if (entry.content !== void 0) return Buffer.from(entry.content, "utf8");
7950
+ if (entry.storageObjectKey && sync.remote.object)
7951
+ return sync.remote.object(entry.storageObjectKey);
7814
7952
  if (!entry.fileId) return void 0;
7815
7953
  return agentFileBytes(sync, workflowId, tree, entry);
7816
7954
  }
@@ -7939,6 +8077,9 @@ async function pullWorkflow(sync, options) {
7939
8077
  ...variants !== void 0 && { variants },
7940
8078
  ...options.maxFileBytes !== void 0 && {
7941
8079
  maxFileBytes: options.maxFileBytes
8080
+ },
8081
+ ...options.maxTotalBytes !== void 0 && {
8082
+ maxTotalBytes: options.maxTotalBytes
7942
8083
  }
7943
8084
  });
7944
8085
  }
@@ -8043,6 +8184,8 @@ function headRequest(manifest) {
8043
8184
  request.query.set("variants", manifest.variants);
8044
8185
  if (manifest.maxFileBytes !== void 0)
8045
8186
  request.query.set("maxFileBytes", String(manifest.maxFileBytes));
8187
+ if (manifest.maxTotalBytes !== void 0)
8188
+ request.query.set("maxTotalBytes", String(manifest.maxTotalBytes));
8046
8189
  return request;
8047
8190
  }
8048
8191
  async function refresh2(sync, dir, manifest, pushed) {
@@ -8074,7 +8217,8 @@ async function rebase(sync, dir, manifest) {
8074
8217
  request: headRequest(manifest),
8075
8218
  dir,
8076
8219
  keepEdits: true,
8077
- maxFileBytes: manifest.maxFileBytes
8220
+ maxFileBytes: manifest.maxFileBytes,
8221
+ maxTotalBytes: manifest.maxTotalBytes
8078
8222
  });
8079
8223
  return readManifest(sync, dir);
8080
8224
  }
package/dist/core.js CHANGED
@@ -26,6 +26,19 @@ function matchCommand(words, commands) {
26
26
 
27
27
  // src/generated/commands.ts
28
28
  var COMMANDS = [
29
+ {
30
+ command: "api-key list",
31
+ tool: "api_keys_list",
32
+ title: "List API keys",
33
+ description: "List the organization's API keys, newest first: name, obfuscated value, creator, created, last used and expiry. Values never appear. Use it to check that a key exists before deploying. Keys are created in the platform; `organizationId` defaults to the caller's one organization.",
34
+ method: "GET",
35
+ path: "/users/v2/api-keys",
36
+ args: [],
37
+ query: [],
38
+ binary: false,
39
+ readOnly: true,
40
+ destructive: false
41
+ },
29
42
  {
30
43
  command: "batch cancel",
31
44
  tool: "execution_batch_cancel",
@@ -46,6 +59,61 @@ var COMMANDS = [
46
59
  readOnly: false,
47
60
  destructive: true
48
61
  },
62
+ {
63
+ command: "batch create",
64
+ tool: "execution_batch_create",
65
+ title: "Create execution batch",
66
+ description: 'Queue one execution per row of `items` for `workflowId`, starting at `startAt` (ISO 8601; now or earlier starts at once). `config` paces the runs: `{type: "maxConcurrent", maxConcurrent}` or `{type: "timeBatching", batchSize, batchInterval}` (seconds). Each item takes `inputs` (see `workflow_version_inputs_get`), optional `profileId` or `profileGroupId`, `metadata`, and `workflowVersionId` to pin a version. Check the same body first with `execution_batch_validate`. Returns the batch; follow it with `execution_batch_get`, and its runs with `executions_list` filtered by `batchId`.',
67
+ method: "POST",
68
+ path: "/agents/v2/execution-batches",
69
+ args: [],
70
+ query: [],
71
+ binary: false,
72
+ readOnly: false,
73
+ destructive: false,
74
+ body: {
75
+ required: true,
76
+ contentType: "application/json",
77
+ fields: [
78
+ {
79
+ name: "workflowId",
80
+ flag: "workflow-id",
81
+ type: "string",
82
+ required: false,
83
+ description: "Workflow ID for this batch. Set this or agentId."
84
+ },
85
+ {
86
+ name: "name",
87
+ flag: "name",
88
+ type: "string",
89
+ required: true
90
+ },
91
+ {
92
+ name: "startAt",
93
+ flag: "start-at",
94
+ type: "string",
95
+ required: true,
96
+ description: "When to start triggering executions"
97
+ },
98
+ {
99
+ name: "config",
100
+ flag: "config",
101
+ type: "json",
102
+ required: true,
103
+ description: "Discriminated union of batch configuration types (discriminated by type)"
104
+ },
105
+ {
106
+ name: "items",
107
+ flag: "items",
108
+ type: "json",
109
+ required: true
110
+ }
111
+ ],
112
+ files: [],
113
+ credentialOrganization: false
114
+ },
115
+ capability: "run_execution"
116
+ },
49
117
  {
50
118
  command: "batch get",
51
119
  tool: "execution_batch_get",
@@ -148,6 +216,60 @@ var COMMANDS = [
148
216
  destructive: false,
149
217
  capability: "run_execution"
150
218
  },
219
+ {
220
+ command: "batch validate",
221
+ tool: "execution_batch_validate",
222
+ title: "Validate execution batch",
223
+ description: "Check an `execution_batch_create` body without creating anything. Returns `valid`, `itemCount`, and `issues`: each row (by its 0-based `index` in `items`) whose inputs would fail the input schema of the version it runs. A problem with the whole batch, such as an empty `items` or a bad `config`, returns the same error create would.",
224
+ method: "POST",
225
+ path: "/agents/v2/execution-batches/validate",
226
+ args: [],
227
+ query: [],
228
+ binary: false,
229
+ readOnly: true,
230
+ destructive: false,
231
+ body: {
232
+ required: true,
233
+ contentType: "application/json",
234
+ fields: [
235
+ {
236
+ name: "workflowId",
237
+ flag: "workflow-id",
238
+ type: "string",
239
+ required: false,
240
+ description: "Workflow ID for this batch. Set this or agentId."
241
+ },
242
+ {
243
+ name: "name",
244
+ flag: "name",
245
+ type: "string",
246
+ required: true
247
+ },
248
+ {
249
+ name: "startAt",
250
+ flag: "start-at",
251
+ type: "string",
252
+ required: true,
253
+ description: "When to start triggering executions"
254
+ },
255
+ {
256
+ name: "config",
257
+ flag: "config",
258
+ type: "json",
259
+ required: true,
260
+ description: "Discriminated union of batch configuration types (discriminated by type)"
261
+ },
262
+ {
263
+ name: "items",
264
+ flag: "items",
265
+ type: "json",
266
+ required: true
267
+ }
268
+ ],
269
+ files: [],
270
+ credentialOrganization: false
271
+ }
272
+ },
151
273
  {
152
274
  command: "context",
153
275
  tool: "get_context",
@@ -1357,6 +1479,13 @@ var COMMANDS = [
1357
1479
  type: "string[]",
1358
1480
  required: false,
1359
1481
  description: "Filter by login profile IDs (can specify multiple, there is an 'OR' condition applied to these)"
1482
+ },
1483
+ {
1484
+ name: "batchId",
1485
+ flag: "batch-id",
1486
+ type: "string",
1487
+ required: false,
1488
+ description: "Only executions started by this batch, an ID from `execution_batches_list`. Rows not yet triggered have no execution yet: list them with `scheduled_executions_list` and `batchId`."
1360
1489
  }
1361
1490
  ],
1362
1491
  binary: false,
@@ -1631,6 +1760,13 @@ var COMMANDS = [
1631
1760
  type: "string[]",
1632
1761
  required: false,
1633
1762
  description: "Filter by login profile IDs (can specify multiple, there is an 'OR' condition applied to these)"
1763
+ },
1764
+ {
1765
+ name: "batchId",
1766
+ flag: "batch-id",
1767
+ type: "string",
1768
+ required: false,
1769
+ description: "Only executions started by this batch, an ID from `execution_batches_list`. Rows not yet triggered have no execution yet: list them with `scheduled_executions_list` and `batchId`."
1634
1770
  }
1635
1771
  ],
1636
1772
  binary: false,
@@ -6809,6 +6945,8 @@ async function entryBytes(sync, workflowId, tree, entry) {
6809
6945
  if (entry.contentBase64 !== void 0)
6810
6946
  return Buffer.from(entry.contentBase64, "base64");
6811
6947
  if (entry.content !== void 0) return Buffer.from(entry.content, "utf8");
6948
+ if (entry.storageObjectKey && sync.remote.object)
6949
+ return sync.remote.object(entry.storageObjectKey);
6812
6950
  if (!entry.fileId) return void 0;
6813
6951
  return agentFileBytes(sync, workflowId, tree, entry);
6814
6952
  }
@@ -6937,6 +7075,9 @@ async function pullWorkflow(sync, options) {
6937
7075
  ...variants !== void 0 && { variants },
6938
7076
  ...options.maxFileBytes !== void 0 && {
6939
7077
  maxFileBytes: options.maxFileBytes
7078
+ },
7079
+ ...options.maxTotalBytes !== void 0 && {
7080
+ maxTotalBytes: options.maxTotalBytes
6940
7081
  }
6941
7082
  });
6942
7083
  }
@@ -7041,6 +7182,8 @@ function headRequest(manifest) {
7041
7182
  request.query.set("variants", manifest.variants);
7042
7183
  if (manifest.maxFileBytes !== void 0)
7043
7184
  request.query.set("maxFileBytes", String(manifest.maxFileBytes));
7185
+ if (manifest.maxTotalBytes !== void 0)
7186
+ request.query.set("maxTotalBytes", String(manifest.maxTotalBytes));
7044
7187
  return request;
7045
7188
  }
7046
7189
  async function refresh(sync, dir, manifest, pushed) {
@@ -7072,7 +7215,8 @@ async function rebase(sync, dir, manifest) {
7072
7215
  request: headRequest(manifest),
7073
7216
  dir,
7074
7217
  keepEdits: true,
7075
- maxFileBytes: manifest.maxFileBytes
7218
+ maxFileBytes: manifest.maxFileBytes,
7219
+ maxTotalBytes: manifest.maxTotalBytes
7076
7220
  });
7077
7221
  return readManifest(sync, dir);
7078
7222
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asteroidai/cli",
3
- "version": "1.9.99",
3
+ "version": "1.9.105",
4
4
  "description": "The asteroid command-line interface for the Asteroid platform.",
5
5
  "type": "module",
6
6
  "license": "MIT",