@mycadet/cli 0.13.0-dev.202610262105.8c45cc2 → 0.13.0-dev.202610271937.2f71260

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.
Files changed (70) hide show
  1. package/node_modules/@mycadet/assistant-api/node_modules/@mycadet/service-contracts/package.json +1 -1
  2. package/node_modules/@mycadet/avatar-manifest/package.json +1 -1
  3. package/node_modules/@mycadet/environments/package.json +1 -1
  4. package/node_modules/@mycadet/ipc-server-utils/package.json +1 -1
  5. package/node_modules/@mycadet/local-mode/node_modules/@mycadet/avatar-manifest/package.json +1 -1
  6. package/node_modules/@mycadet/local-mode/node_modules/@mycadet/environments/package.json +1 -1
  7. package/node_modules/@mycadet/local-mode/node_modules/@mycadet/service-contracts/package.json +1 -1
  8. package/node_modules/@mycadet/local-mode/node_modules/@mycadet/shared/package.json +1 -1
  9. package/node_modules/@mycadet/local-mode/package.json +1 -1
  10. package/node_modules/@mycadet/local-mode/src/__tests__/gateway-proxy.test.ts +23 -52
  11. package/node_modules/@mycadet/local-mode/src/__tests__/pair.test.ts +230 -144
  12. package/node_modules/@mycadet/local-mode/src/__tests__/unpair.test.ts +7 -3
  13. package/node_modules/@mycadet/local-mode/src/gateway-proxy.ts +2 -1
  14. package/node_modules/@mycadet/local-mode/src/index.ts +2 -1
  15. package/node_modules/@mycadet/local-mode/src/lockfile-contract.test.ts +34 -31
  16. package/node_modules/@mycadet/local-mode/src/lockfile-contract.ts +35 -45
  17. package/node_modules/@mycadet/local-mode/src/lockfile.test.ts +69 -112
  18. package/node_modules/@mycadet/local-mode/src/lockfile.ts +30 -69
  19. package/node_modules/@mycadet/local-mode/src/pair.ts +66 -108
  20. package/node_modules/@mycadet/local-mode/src/served-config.test.ts +1 -3
  21. package/node_modules/@mycadet/local-mode/src/status.ts +1 -14
  22. package/node_modules/@mycadet/local-mode/src/unpair.ts +8 -18
  23. package/node_modules/@mycadet/service-contracts/package.json +1 -1
  24. package/node_modules/@mycadet/shared/package.json +1 -1
  25. package/package.json +1 -1
  26. package/src/__tests__/app-command.test.ts +3 -8
  27. package/src/__tests__/assistant-client-cloud-auth.test.ts +10 -2
  28. package/src/__tests__/assistant-client-refresh.test.ts +0 -2
  29. package/src/__tests__/assistant-config.test.ts +22 -21
  30. package/src/__tests__/backup.test.ts +0 -4
  31. package/src/__tests__/client-tui-refresh.test.ts +12 -11
  32. package/src/__tests__/connect-import.test.ts +6 -4
  33. package/src/__tests__/debug.test.ts +1 -1
  34. package/src/__tests__/devices.test.ts +3 -5
  35. package/src/__tests__/gateway-token.test.ts +0 -2
  36. package/src/__tests__/host-teleport-docker.test.ts +10 -19
  37. package/src/__tests__/host-teleport.test.ts +0 -1
  38. package/src/__tests__/multi-local.test.ts +0 -3
  39. package/src/__tests__/nginx-ingress.test.ts +313 -443
  40. package/src/__tests__/ps-cloud-status.test.ts +3 -7
  41. package/src/__tests__/restore.test.ts +0 -1
  42. package/src/__tests__/root-backup-docker.test.ts +0 -1
  43. package/src/__tests__/root-backup.test.ts +0 -1
  44. package/src/__tests__/root-restore-command.test.ts +3 -4
  45. package/src/__tests__/runtime-url.test.ts +5 -21
  46. package/src/__tests__/setup.test.ts +49 -20
  47. package/src/__tests__/teleport.test.ts +0 -1
  48. package/src/__tests__/tui-midsession-refresh.test.ts +13 -8
  49. package/src/__tests__/tunnel-stop.test.ts +0 -1
  50. package/src/__tests__/tunnel.test.ts +42 -87
  51. package/src/__tests__/upgrade-local.test.ts +0 -1
  52. package/src/__tests__/upgrade-root-recovery.test.ts +5 -5
  53. package/src/__tests__/wake.test.ts +21 -51
  54. package/src/commands/app.ts +16 -48
  55. package/src/commands/completions.test.ts +0 -1
  56. package/src/commands/connect/import.ts +23 -15
  57. package/src/commands/ps.ts +6 -20
  58. package/src/commands/sleep.ts +1 -1
  59. package/src/commands/tunnel.ts +4 -6
  60. package/src/commands/upgrade.ts +1 -11
  61. package/src/commands/wake.ts +1 -6
  62. package/src/lib/__tests__/port-heal.test.ts +2 -3
  63. package/src/lib/__tests__/runtime-url.test.ts +0 -1
  64. package/src/lib/hatch-local.ts +142 -147
  65. package/src/lib/host-teleport.ts +4 -1
  66. package/src/lib/local.ts +1 -1
  67. package/src/lib/nginx-ingress.ts +159 -175
  68. package/src/lib/retire-local.ts +1 -1
  69. package/src/lib/sync-cloud-assistants.ts +0 -1
  70. package/src/lib/tunnel.ts +46 -52
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/service-contracts",
3
- "version": "0.13.0-dev.202610262105.8c45cc2",
3
+ "version": "0.13.0-dev.202610271937.2f71260",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/avatar-manifest",
3
- "version": "0.13.0-dev.202610262105.8c45cc2",
3
+ "version": "0.13.0-dev.202610271937.2f71260",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/environments",
3
- "version": "0.13.0-dev.202610262105.8c45cc2",
3
+ "version": "0.13.0-dev.202610271937.2f71260",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/ipc-server-utils",
3
- "version": "0.13.0-dev.202610262105.8c45cc2",
3
+ "version": "0.13.0-dev.202610271937.2f71260",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/avatar-manifest",
3
- "version": "0.13.0-dev.202610262105.8c45cc2",
3
+ "version": "0.13.0-dev.202610271937.2f71260",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/environments",
3
- "version": "0.13.0-dev.202610262105.8c45cc2",
3
+ "version": "0.13.0-dev.202610271937.2f71260",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/service-contracts",
3
- "version": "0.13.0-dev.202610262105.8c45cc2",
3
+ "version": "0.13.0-dev.202610271937.2f71260",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/shared",
3
- "version": "0.13.0-dev.202610262105.8c45cc2",
3
+ "version": "0.13.0-dev.202610271937.2f71260",
4
4
  "private": true,
5
5
  "exports": {
6
6
  ".": "./github-repository.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/local-mode",
3
- "version": "0.13.0-dev.202610262105.8c45cc2",
3
+ "version": "0.13.0-dev.202610271937.2f71260",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -3,6 +3,7 @@ import fs from "node:fs";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
5
 
6
+ import { GATEWAY_PORT } from "../lockfile-contract";
6
7
  import {
7
8
  authorizePairedForwardHeaders,
8
9
  gatewayTargetsFromLockfile,
@@ -192,26 +193,27 @@ describe("resolveGatewayProxyTarget", () => {
192
193
  });
193
194
 
194
195
  describe("gatewayTargetsFromLockfile", () => {
195
- test("resolves a paired entry with a usable runtimeUrl to a remote target", () => {
196
+ test("resolves a paired entry's custom addressing to a remote target", () => {
196
197
  expect(
197
198
  gatewayTargetsFromLockfile({
198
199
  assistants: [
199
200
  {
200
201
  assistantId: "abc-123",
201
- paired: true,
202
- runtimeUrl: "https://gw.example.com",
202
+ cloud: "custom",
203
+ ipAddress: "gw.example.com",
204
+ port: 443,
203
205
  },
204
206
  ],
205
207
  }),
206
208
  ).toEqual(targets({ "abc-123": remote("https://gw.example.com") })());
207
209
  });
208
210
 
209
- test("omits a paired entry whose runtimeUrl is unusable", () => {
211
+ test("omits loopback entries with no recorded port beyond the default's loopback form", () => {
210
212
  expect(
211
213
  gatewayTargetsFromLockfile({
212
214
  assistants: [
213
- { assistantId: "abc-123", paired: true, runtimeUrl: "not a url" },
214
- { assistantId: "def-456", paired: true },
215
+ { assistantId: "abc-123", cloud: "custom" },
216
+ { assistantId: "def-456", cloud: "cloud" },
215
217
  ],
216
218
  }),
217
219
  ).toEqual(new Map());
@@ -231,42 +233,12 @@ describe("gatewayTargetsFromLockfile", () => {
231
233
  ).toEqual(targets({ "abc-123": loopback(8080) })());
232
234
  });
233
235
 
234
- test("resolves a docker entry's loopback runtimeUrl (no resources block)", () => {
236
+ test("a docker entry without a recorded port derives the default gateway port", () => {
235
237
  expect(
236
238
  gatewayTargetsFromLockfile({
237
- assistants: [
238
- {
239
- assistantId: "abc-123",
240
- cloud: "docker",
241
- runtimeUrl: "http://127.0.0.1:9000",
242
- },
243
- ],
239
+ assistants: [{ assistantId: "abc-123", cloud: "docker" }],
244
240
  }),
245
- ).toEqual(new Map([["abc-123", loopback(9000)]]));
246
- });
247
-
248
- test("resolves a loopback-cloud entry whose runtimeUrl is remote as paired", () => {
249
- // Paired-ness derives from the addressing (no stored flag): a
250
- // loopback-gateway cloud whose runtimeUrl points off-machine is a
251
- // connect import, so it targets that remote runtimeUrl.
252
- expect(
253
- gatewayTargetsFromLockfile({
254
- assistants: [
255
- {
256
- assistantId: "abc-123",
257
- cloud: "local",
258
- runtimeUrl: "https://elsewhere.example.com",
259
- },
260
- ],
261
- }),
262
- ).toEqual(
263
- new Map([
264
- [
265
- "abc-123",
266
- { kind: "remote", runtimeUrl: "https://elsewhere.example.com" },
267
- ],
268
- ]),
269
- );
241
+ ).toEqual(new Map([["abc-123", loopback(GATEWAY_PORT)]]));
270
242
  });
271
243
 
272
244
  test("omits ports outside the 1024-65535 proxy range", () => {
@@ -281,7 +253,7 @@ describe("gatewayTargetsFromLockfile", () => {
281
253
  {
282
254
  assistantId: "def-456",
283
255
  cloud: "docker",
284
- runtimeUrl: "http://127.0.0.1:70000",
256
+ resources: { gatewayPort: 70000 },
285
257
  },
286
258
  ],
287
259
  }),
@@ -293,31 +265,29 @@ describe("gatewayTargetsFromLockfile", () => {
293
265
  gatewayTargetsFromLockfile({
294
266
  assistants: [
295
267
  { assistantId: "a", cloud: "cloud" },
296
- { assistantId: "b", cloud: "apple-container" },
297
- // A retired spelling parses as "local": loopback-gated, and with no
298
- // loopback port it is omitted.
299
- { assistantId: "d", cloud: "gcp" },
268
+ // A retired spelling parses as "local": loopback-gated, so it
269
+ // derives the default loopback port rather than being omitted.
270
+ { assistantId: "b", cloud: "gcp" },
300
271
  ],
301
272
  }),
302
- ).toEqual(new Map());
273
+ ).toEqual(new Map([["b", { kind: "loopback", port: GATEWAY_PORT }]]));
303
274
  });
304
275
 
305
- test("a custom entry's off-machine runtimeUrl is targetable by addressing", () => {
306
- // Targeting keys on the addressing alone: an entry whose runtimeUrl
307
- // points off this machine resolves as remote, whatever its cloud says.
276
+ test("a custom entry's recorded addressing is targetable", () => {
308
277
  expect(
309
278
  gatewayTargetsFromLockfile({
310
279
  assistants: [
311
280
  {
312
281
  assistantId: "c",
313
282
  cloud: "custom",
314
- runtimeUrl: "https://gw.example.com",
283
+ ipAddress: "gw.example.com",
284
+ port: 7831,
315
285
  },
316
286
  ],
317
287
  }),
318
288
  ).toEqual(
319
289
  new Map([
320
- ["c", { kind: "remote", runtimeUrl: "https://gw.example.com" }],
290
+ ["c", { kind: "remote", runtimeUrl: "https://gw.example.com:7831" }],
321
291
  ]),
322
292
  );
323
293
  });
@@ -356,8 +326,9 @@ describe("readGatewayTargets", () => {
356
326
  },
357
327
  {
358
328
  assistantId: "def-456",
359
- paired: true,
360
- runtimeUrl: "https://gw.example.com",
329
+ cloud: "custom",
330
+ ipAddress: "gw.example.com",
331
+ port: 443,
361
332
  },
362
333
  ],
363
334
  }),