aicomputer 0.1.20 → 0.1.22

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.
@@ -132,8 +132,20 @@ async function readErrorMessage(response) {
132
132
 
133
133
  // src/lib/computers.ts
134
134
  async function listComputers(signal) {
135
- const response = await api("/v1/computers", { signal });
136
- return response.computers;
135
+ const [ownedResponse, sharedResponse] = await Promise.all([
136
+ api("/v1/computers", { signal }),
137
+ api("/v1/computers/shared", { signal }).catch((error) => {
138
+ if (!(error instanceof Error) || !("status" in error)) {
139
+ throw error;
140
+ }
141
+ const status = Reflect.get(error, "status");
142
+ if (status === 404 || status === 405) {
143
+ return { computers: [] };
144
+ }
145
+ throw error;
146
+ })
147
+ ]);
148
+ return mergeComputerLists(ownedResponse.computers, sharedResponse.computers);
137
149
  }
138
150
  async function getComputerByID(id) {
139
151
  return api(`/v1/computers/${id}`);
@@ -208,6 +220,18 @@ async function resolveComputer(identifier) {
208
220
  }
209
221
  throw new Error(`computer '${identifier}' not found`);
210
222
  }
223
+ function mergeComputerLists(owned, shared) {
224
+ const merged = [];
225
+ const seen = /* @__PURE__ */ new Set();
226
+ for (const computer of [...owned, ...shared]) {
227
+ if (seen.has(computer.id)) {
228
+ continue;
229
+ }
230
+ seen.add(computer.id);
231
+ merged.push(computer);
232
+ }
233
+ return merged;
234
+ }
211
235
  function webURL(computer) {
212
236
  return `https://${computer.primary_web_host}${normalizePrimaryPath(computer.primary_path)}`;
213
237
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getSSHResilienceConfigLines
3
- } from "./chunk-4TE5XTYE.js";
3
+ } from "./chunk-LGJN26BQ.js";
4
4
 
5
5
  // src/lib/ssh-config.ts
6
6
  import { homedir } from "os";
@@ -17,7 +17,7 @@ import {
17
17
  import {
18
18
  getConnectionInfo,
19
19
  listComputers
20
- } from "./chunk-LOGK7YYJ.js";
20
+ } from "./chunk-E7QD4MHI.js";
21
21
 
22
22
  // src/lib/mount-reconcile.ts
23
23
  import { readdir, mkdir, rm } from "fs/promises";
@@ -7,7 +7,7 @@ import {
7
7
  api,
8
8
  getConnectionInfo,
9
9
  resolveComputer
10
- } from "./chunk-LOGK7YYJ.js";
10
+ } from "./chunk-E7QD4MHI.js";
11
11
 
12
12
  // src/lib/ssh-access.ts
13
13
  import { spawn } from "child_process";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ensureSSHAliasConfig
4
- } from "./chunk-D3SAFNSI.js";
4
+ } from "./chunk-G7UQLVUZ.js";
5
5
  import {
6
6
  compareVersions,
7
7
  resolveLatestPublishedVersion
@@ -17,7 +17,7 @@ import {
17
17
  reconcileMounts,
18
18
  teardownManagedSessions,
19
19
  timeAgo
20
- } from "./chunk-36BZXAAX.js";
20
+ } from "./chunk-HDZTFK4U.js";
21
21
  import {
22
22
  isAbortError
23
23
  } from "./chunk-TPFE3CC6.js";
@@ -43,7 +43,7 @@ import {
43
43
  openSSHConnection,
44
44
  prepareSSHConnection,
45
45
  prepareSSHConnectionByIdentifier
46
- } from "./chunk-4TE5XTYE.js";
46
+ } from "./chunk-LGJN26BQ.js";
47
47
  import {
48
48
  ensureBundledAutosshInstalled
49
49
  } from "./chunk-3ZF7JRBW.js";
@@ -73,7 +73,7 @@ import {
73
73
  setAPIKey,
74
74
  vncURL,
75
75
  webURL
76
- } from "./chunk-LOGK7YYJ.js";
76
+ } from "./chunk-E7QD4MHI.js";
77
77
  import "./chunk-5Y2NWK5I.js";
78
78
 
79
79
  // src/index.ts
@@ -3,11 +3,11 @@ import {
3
3
  planMountReconcile,
4
4
  reconcileMounts,
5
5
  teardownManagedSessions
6
- } from "../chunk-36BZXAAX.js";
6
+ } from "../chunk-HDZTFK4U.js";
7
7
  import "../chunk-TPFE3CC6.js";
8
8
  import "../chunk-KXLTHWW3.js";
9
9
  import "../chunk-GD42GHW3.js";
10
- import "../chunk-LOGK7YYJ.js";
10
+ import "../chunk-E7QD4MHI.js";
11
11
  import "../chunk-5Y2NWK5I.js";
12
12
  export {
13
13
  computeMountPlan,
@@ -8,9 +8,9 @@ import {
8
8
  openSSHConnection,
9
9
  prepareSSHConnection,
10
10
  prepareSSHConnectionByIdentifier
11
- } from "../chunk-4TE5XTYE.js";
11
+ } from "../chunk-LGJN26BQ.js";
12
12
  import "../chunk-3ZF7JRBW.js";
13
- import "../chunk-LOGK7YYJ.js";
13
+ import "../chunk-E7QD4MHI.js";
14
14
  import "../chunk-5Y2NWK5I.js";
15
15
  export {
16
16
  SSH_SERVER_ALIVE_COUNT_MAX,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ensureSSHAliasConfig
3
- } from "../chunk-D3SAFNSI.js";
4
- import "../chunk-4TE5XTYE.js";
3
+ } from "../chunk-G7UQLVUZ.js";
4
+ import "../chunk-LGJN26BQ.js";
5
5
  import "../chunk-3ZF7JRBW.js";
6
- import "../chunk-LOGK7YYJ.js";
6
+ import "../chunk-E7QD4MHI.js";
7
7
  import "../chunk-5Y2NWK5I.js";
8
8
  export {
9
9
  ensureSSHAliasConfig
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aicomputer",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "description": "Computer CLI - manage your Agent Computer machines from the terminal",
5
5
  "homepage": "https://agentcomputer.ai",
6
6
  "repository": {