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.
- package/dist/{chunk-LOGK7YYJ.js → chunk-E7QD4MHI.js} +26 -2
- package/dist/{chunk-D3SAFNSI.js → chunk-G7UQLVUZ.js} +1 -1
- package/dist/{chunk-36BZXAAX.js → chunk-HDZTFK4U.js} +1 -1
- package/dist/{chunk-4TE5XTYE.js → chunk-LGJN26BQ.js} +1 -1
- package/dist/index.js +4 -4
- package/dist/lib/mount-reconcile.js +2 -2
- package/dist/lib/ssh-access.js +2 -2
- package/dist/lib/ssh-config.js +3 -3
- package/package.json +1 -1
|
@@ -132,8 +132,20 @@ async function readErrorMessage(response) {
|
|
|
132
132
|
|
|
133
133
|
// src/lib/computers.ts
|
|
134
134
|
async function listComputers(signal) {
|
|
135
|
-
const
|
|
136
|
-
|
|
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
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ensureSSHAliasConfig
|
|
4
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
10
|
+
import "../chunk-E7QD4MHI.js";
|
|
11
11
|
import "../chunk-5Y2NWK5I.js";
|
|
12
12
|
export {
|
|
13
13
|
computeMountPlan,
|
package/dist/lib/ssh-access.js
CHANGED
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
openSSHConnection,
|
|
9
9
|
prepareSSHConnection,
|
|
10
10
|
prepareSSHConnectionByIdentifier
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-LGJN26BQ.js";
|
|
12
12
|
import "../chunk-3ZF7JRBW.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-E7QD4MHI.js";
|
|
14
14
|
import "../chunk-5Y2NWK5I.js";
|
|
15
15
|
export {
|
|
16
16
|
SSH_SERVER_ALIVE_COUNT_MAX,
|
package/dist/lib/ssh-config.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureSSHAliasConfig
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-G7UQLVUZ.js";
|
|
4
|
+
import "../chunk-LGJN26BQ.js";
|
|
5
5
|
import "../chunk-3ZF7JRBW.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-E7QD4MHI.js";
|
|
7
7
|
import "../chunk-5Y2NWK5I.js";
|
|
8
8
|
export {
|
|
9
9
|
ensureSSHAliasConfig
|