@asteroidai/cli 1.9.432 → 1.9.436

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
@@ -542,6 +542,26 @@ var COMMANDS = [
542
542
  readOnly: true,
543
543
  destructive: false
544
544
  },
545
+ {
546
+ command: "custom-environment address list",
547
+ tool: "custom_environment_addresses_list",
548
+ title: "List custom environment addresses",
549
+ description: "List the logins on a custom environment: the ones its profile rows name, and the ones that ran on it in the last 30 days. Each comes with its own address, when it got it, and its last run, when present. A login has no address until its first run here. Empty unless the environment has `settings.addresses: one_per_login`.",
550
+ method: "GET",
551
+ path: "/agents/v2/custom-environments/{customEnvironmentId}/addresses",
552
+ args: [
553
+ {
554
+ name: "customEnvironmentId",
555
+ flag: "custom-environment-id",
556
+ type: "string",
557
+ required: true
558
+ }
559
+ ],
560
+ query: [],
561
+ binary: false,
562
+ readOnly: true,
563
+ destructive: false
564
+ },
545
565
  {
546
566
  command: "custom-environment create",
547
567
  tool: "custom_environments_create",
@@ -6902,11 +6922,19 @@ var COMMANDS = [
6902
6922
  }
6903
6923
  ];
6904
6924
 
6925
+ // src/args.ts
6926
+ var UsageError = class extends Error {
6927
+ };
6928
+
6905
6929
  // src/sync/types.ts
6906
6930
  var MANIFEST = ".asteroid.json";
6907
6931
  function get(path, query = {}) {
6908
6932
  return { method: "GET", path, query: new URLSearchParams(query) };
6909
6933
  }
6934
+ function pathId(id) {
6935
+ if (id === "." || id === "..") throw new UsageError(`invalid id: ${id}`);
6936
+ return encodeURIComponent(id);
6937
+ }
6910
6938
  function statusOf(error) {
6911
6939
  const status = error?.status;
6912
6940
  return typeof status === "number" ? status : void 0;
@@ -6922,7 +6950,7 @@ async function syncExecution(sync, executionId2, timeoutMs) {
6922
6950
  Math.max(1, Math.ceil(timeoutMs / 1e3))
6923
6951
  );
6924
6952
  return await sync.remote.json(
6925
- get(`/agents/v2/executions/${executionId2}/sync`, {
6953
+ get(`/agents/v2/executions/${pathId(executionId2)}/sync`, {
6926
6954
  timeoutSeconds: String(timeoutSeconds)
6927
6955
  })
6928
6956
  );
@@ -7294,10 +7322,6 @@ function orgLabel(org) {
7294
7322
  // src/program.ts
7295
7323
  import { Command, CommanderError, Option as Flag } from "commander";
7296
7324
 
7297
- // src/args.ts
7298
- var UsageError = class extends Error {
7299
- };
7300
-
7301
7325
  // src/reference.ts
7302
7326
  var BUILTINS = [
7303
7327
  {
@@ -8089,7 +8113,7 @@ var ApiError = class extends Error {
8089
8113
  status;
8090
8114
  body;
8091
8115
  };
8092
- var VERSION = "1.9.432";
8116
+ var VERSION = "1.9.436";
8093
8117
  function problem(status, body, fallback) {
8094
8118
  if (body && typeof body === "object") {
8095
8119
  const record2 = body;
@@ -9390,7 +9414,9 @@ async function writeText(sync, path, text3) {
9390
9414
  async function writeActivities(sync, dir, execution) {
9391
9415
  try {
9392
9416
  const activities = await sync.remote.json(
9393
- get(`/agents/v2/executions/${execution.id}/activities`, { order: "asc" })
9417
+ get(`/agents/v2/executions/${pathId(execution.id)}/activities`, {
9418
+ order: "asc"
9419
+ })
9394
9420
  );
9395
9421
  if (activities.length === 0) return false;
9396
9422
  const markdown = formatActivitiesMarkdown(
@@ -9406,12 +9432,12 @@ async function writeActivities(sync, dir, execution) {
9406
9432
  }
9407
9433
  async function listFiles(sync, executionId2) {
9408
9434
  const listing = await sync.remote.json(
9409
- get(`/agents/v2/executions/${executionId2}/files`)
9435
+ get(`/agents/v2/executions/${pathId(executionId2)}/files`)
9410
9436
  );
9411
9437
  return DIRECTORIES.flatMap((name) => listing.directories[name] ?? []);
9412
9438
  }
9413
9439
  async function download(sync, executionId2, file) {
9414
- const path = `/agents/v2/executions/${executionId2}/files/${file.id}/signed-url`;
9440
+ const path = `/agents/v2/executions/${pathId(executionId2)}/files/${pathId(file.id)}/signed-url`;
9415
9441
  const { url } = await sync.remote.json(get(path));
9416
9442
  return sync.remote.download(url);
9417
9443
  }
@@ -9460,7 +9486,7 @@ async function pullFiles(sync, dir, options) {
9460
9486
  }
9461
9487
  async function pullExecution(sync, options) {
9462
9488
  const execution = await sync.remote.json(
9463
- get(`/agents/v2/executions/${options.executionId}`)
9489
+ get(`/agents/v2/executions/${pathId(options.executionId)}`)
9464
9490
  );
9465
9491
  const dir = executionDir(options, execution);
9466
9492
  await writeText(
@@ -9612,7 +9638,7 @@ async function pullInsights(sync, options = {}) {
9612
9638
  const dir = options.dir ?? INSIGHTS_DIR;
9613
9639
  const insights = options.insightId ? [
9614
9640
  await sync.remote.json(
9615
- get(`/astro/v2/insights/${options.insightId}`)
9641
+ get(`/astro/v2/insights/${pathId(options.insightId)}`)
9616
9642
  )
9617
9643
  ] : await listInsights(sync, options.workflowId);
9618
9644
  const pulled = [];
@@ -9711,10 +9737,10 @@ function pullDir(root, tree, head) {
9711
9737
  return join3(base, ".versions", workflowDirName(tree.versionId, tree.version));
9712
9738
  }
9713
9739
  function headFilesRequest(workflowId) {
9714
- return get(`/agents/v2/workflows/${workflowId}/head/files`);
9740
+ return get(`/agents/v2/workflows/${pathId(workflowId)}/head/files`);
9715
9741
  }
9716
- async function agentFileBytes(sync, workflowId, tree, entry) {
9717
- const path = `/agents/v2/workflows/${workflowId}/versions/${tree.versionId}/files/${entry.fileId}/signed-url`;
9742
+ async function agentFileBytes(sync, workflowId, tree, fileId) {
9743
+ const path = `/agents/v2/workflows/${pathId(workflowId)}/versions/${pathId(tree.versionId)}/files/${pathId(fileId)}/signed-url`;
9718
9744
  const { url } = await sync.remote.json(get(path));
9719
9745
  return sync.remote.download(url);
9720
9746
  }
@@ -9725,7 +9751,7 @@ async function entryBytes(sync, workflowId, tree, entry) {
9725
9751
  if (entry.storageObjectKey && sync.remote.object)
9726
9752
  return sync.remote.object(entry.storageObjectKey);
9727
9753
  if (!entry.fileId) return void 0;
9728
- return agentFileBytes(sync, workflowId, tree, entry);
9754
+ return agentFileBytes(sync, workflowId, tree, entry.fileId);
9729
9755
  }
9730
9756
  function inlineBytes(entry) {
9731
9757
  if (entry.contentBase64 !== void 0)
@@ -9940,7 +9966,7 @@ async function patch(sync, manifest, writes, deletes) {
9940
9966
  try {
9941
9967
  const snapshot = await sync.remote.json({
9942
9968
  method: "PATCH",
9943
- path: `/agents/v2/workflows/${manifest.workflowId}/head/files`,
9969
+ path: `/agents/v2/workflows/${pathId(manifest.workflowId)}/head/files`,
9944
9970
  query: new URLSearchParams(),
9945
9971
  json: {
9946
9972
  baseRev: manifest.rev,
package/dist/core.js CHANGED
@@ -563,6 +563,26 @@ var COMMANDS = [
563
563
  readOnly: true,
564
564
  destructive: false
565
565
  },
566
+ {
567
+ command: "custom-environment address list",
568
+ tool: "custom_environment_addresses_list",
569
+ title: "List custom environment addresses",
570
+ description: "List the logins on a custom environment: the ones its profile rows name, and the ones that ran on it in the last 30 days. Each comes with its own address, when it got it, and its last run, when present. A login has no address until its first run here. Empty unless the environment has `settings.addresses: one_per_login`.",
571
+ method: "GET",
572
+ path: "/agents/v2/custom-environments/{customEnvironmentId}/addresses",
573
+ args: [
574
+ {
575
+ name: "customEnvironmentId",
576
+ flag: "custom-environment-id",
577
+ type: "string",
578
+ required: true
579
+ }
580
+ ],
581
+ query: [],
582
+ binary: false,
583
+ readOnly: true,
584
+ destructive: false
585
+ },
566
586
  {
567
587
  command: "custom-environment create",
568
588
  tool: "custom_environments_create",
@@ -7635,6 +7655,10 @@ var MANIFEST = ".asteroid.json";
7635
7655
  function get(path, query = {}) {
7636
7656
  return { method: "GET", path, query: new URLSearchParams(query) };
7637
7657
  }
7658
+ function pathId(id) {
7659
+ if (id === "." || id === "..") throw new UsageError(`invalid id: ${id}`);
7660
+ return encodeURIComponent(id);
7661
+ }
7638
7662
  function statusOf(error) {
7639
7663
  const status = error?.status;
7640
7664
  return typeof status === "number" ? status : void 0;
@@ -7650,7 +7674,7 @@ async function syncExecution(sync, executionId2, timeoutMs) {
7650
7674
  Math.max(1, Math.ceil(timeoutMs / 1e3))
7651
7675
  );
7652
7676
  return await sync.remote.json(
7653
- get(`/agents/v2/executions/${executionId2}/sync`, {
7677
+ get(`/agents/v2/executions/${pathId(executionId2)}/sync`, {
7654
7678
  timeoutSeconds: String(timeoutSeconds)
7655
7679
  })
7656
7680
  );
@@ -8010,7 +8034,9 @@ async function writeText(sync, path, text2) {
8010
8034
  async function writeActivities(sync, dir, execution) {
8011
8035
  try {
8012
8036
  const activities = await sync.remote.json(
8013
- get(`/agents/v2/executions/${execution.id}/activities`, { order: "asc" })
8037
+ get(`/agents/v2/executions/${pathId(execution.id)}/activities`, {
8038
+ order: "asc"
8039
+ })
8014
8040
  );
8015
8041
  if (activities.length === 0) return false;
8016
8042
  const markdown = formatActivitiesMarkdown(
@@ -8026,12 +8052,12 @@ async function writeActivities(sync, dir, execution) {
8026
8052
  }
8027
8053
  async function listFiles(sync, executionId2) {
8028
8054
  const listing = await sync.remote.json(
8029
- get(`/agents/v2/executions/${executionId2}/files`)
8055
+ get(`/agents/v2/executions/${pathId(executionId2)}/files`)
8030
8056
  );
8031
8057
  return DIRECTORIES.flatMap((name) => listing.directories[name] ?? []);
8032
8058
  }
8033
8059
  async function download(sync, executionId2, file) {
8034
- const path = `/agents/v2/executions/${executionId2}/files/${file.id}/signed-url`;
8060
+ const path = `/agents/v2/executions/${pathId(executionId2)}/files/${pathId(file.id)}/signed-url`;
8035
8061
  const { url } = await sync.remote.json(get(path));
8036
8062
  return sync.remote.download(url);
8037
8063
  }
@@ -8080,7 +8106,7 @@ async function pullFiles(sync, dir, options) {
8080
8106
  }
8081
8107
  async function pullExecution(sync, options) {
8082
8108
  const execution = await sync.remote.json(
8083
- get(`/agents/v2/executions/${options.executionId}`)
8109
+ get(`/agents/v2/executions/${pathId(options.executionId)}`)
8084
8110
  );
8085
8111
  const dir = executionDir(options, execution);
8086
8112
  await writeText(
@@ -8232,7 +8258,7 @@ async function pullInsights(sync, options = {}) {
8232
8258
  const dir = options.dir ?? INSIGHTS_DIR;
8233
8259
  const insights = options.insightId ? [
8234
8260
  await sync.remote.json(
8235
- get(`/astro/v2/insights/${options.insightId}`)
8261
+ get(`/astro/v2/insights/${pathId(options.insightId)}`)
8236
8262
  )
8237
8263
  ] : await listInsights(sync, options.workflowId);
8238
8264
  const pulled = [];
@@ -8331,10 +8357,10 @@ function pullDir(root, tree, head) {
8331
8357
  return join(base, ".versions", workflowDirName(tree.versionId, tree.version));
8332
8358
  }
8333
8359
  function headFilesRequest(workflowId) {
8334
- return get(`/agents/v2/workflows/${workflowId}/head/files`);
8360
+ return get(`/agents/v2/workflows/${pathId(workflowId)}/head/files`);
8335
8361
  }
8336
- async function agentFileBytes(sync, workflowId, tree, entry) {
8337
- const path = `/agents/v2/workflows/${workflowId}/versions/${tree.versionId}/files/${entry.fileId}/signed-url`;
8362
+ async function agentFileBytes(sync, workflowId, tree, fileId) {
8363
+ const path = `/agents/v2/workflows/${pathId(workflowId)}/versions/${pathId(tree.versionId)}/files/${pathId(fileId)}/signed-url`;
8338
8364
  const { url } = await sync.remote.json(get(path));
8339
8365
  return sync.remote.download(url);
8340
8366
  }
@@ -8345,7 +8371,7 @@ async function entryBytes(sync, workflowId, tree, entry) {
8345
8371
  if (entry.storageObjectKey && sync.remote.object)
8346
8372
  return sync.remote.object(entry.storageObjectKey);
8347
8373
  if (!entry.fileId) return void 0;
8348
- return agentFileBytes(sync, workflowId, tree, entry);
8374
+ return agentFileBytes(sync, workflowId, tree, entry.fileId);
8349
8375
  }
8350
8376
  function inlineBytes(entry) {
8351
8377
  if (entry.contentBase64 !== void 0)
@@ -8560,7 +8586,7 @@ async function patch(sync, manifest, writes, deletes) {
8560
8586
  try {
8561
8587
  const snapshot = await sync.remote.json({
8562
8588
  method: "PATCH",
8563
- path: `/agents/v2/workflows/${manifest.workflowId}/head/files`,
8589
+ path: `/agents/v2/workflows/${pathId(manifest.workflowId)}/head/files`,
8564
8590
  query: new URLSearchParams(),
8565
8591
  json: {
8566
8592
  baseRev: manifest.rev,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asteroidai/cli",
3
- "version": "1.9.432",
3
+ "version": "1.9.436",
4
4
  "description": "The asteroid command-line interface for the Asteroid platform.",
5
5
  "type": "module",
6
6
  "license": "MIT",