@mycadet/cli 0.13.0-dev.202610261443.fed5783 → 0.13.0-dev.202610262105.8c45cc2

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 (63) 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/gateway-proxy.ts +13 -5
  11. package/node_modules/@mycadet/local-mode/src/index.ts +2 -1
  12. package/node_modules/@mycadet/local-mode/src/lockfile-contract.test.ts +7 -0
  13. package/node_modules/@mycadet/local-mode/src/lockfile-contract.ts +59 -0
  14. package/node_modules/@mycadet/local-mode/src/served-config.test.ts +77 -0
  15. package/node_modules/@mycadet/local-mode/src/served-config.ts +15 -0
  16. package/node_modules/@mycadet/service-contracts/package.json +1 -1
  17. package/node_modules/@mycadet/shared/package.json +1 -1
  18. package/package.json +1 -1
  19. package/src/__tests__/cloud-releases.test.ts +0 -7
  20. package/src/__tests__/guardian-token.test.ts +7 -2
  21. package/src/__tests__/runtime-url.test.ts +66 -0
  22. package/src/__tests__/tailscale.test.ts +0 -44
  23. package/src/__tests__/tunnel.test.ts +124 -145
  24. package/src/__tests__/upgrade-local.test.ts +28 -14
  25. package/src/__tests__/wake.test.ts +20 -20
  26. package/src/commands/client.ts +2 -5
  27. package/src/commands/debug.ts +3 -19
  28. package/src/commands/devices.ts +1 -1
  29. package/src/commands/gateway/token.ts +2 -2
  30. package/src/commands/hatch.ts +0 -4
  31. package/src/commands/pair.ts +1 -1
  32. package/src/commands/ps.ts +13 -17
  33. package/src/commands/restore.ts +7 -6
  34. package/src/commands/retire.ts +6 -9
  35. package/src/commands/setup.ts +2 -10
  36. package/src/commands/sleep.ts +1 -1
  37. package/src/commands/upgrade.ts +17 -46
  38. package/src/index.ts +1 -1
  39. package/src/lib/__tests__/cloud-client-signed-url.test.ts +6 -6
  40. package/src/lib/__tests__/port-heal.test.ts +1 -2
  41. package/src/lib/__tests__/runtime-url.test.ts +4 -4
  42. package/src/lib/assistant-client.ts +2 -8
  43. package/src/lib/assistant-config.ts +7 -7
  44. package/src/lib/cloud-client.ts +1 -1
  45. package/src/lib/cloud-login.ts +2 -7
  46. package/src/lib/cloud-releases.ts +5 -7
  47. package/src/lib/docker.ts +28 -48
  48. package/src/lib/environments/__tests__/paths.test.ts +8 -27
  49. package/src/lib/environments/__tests__/seeds.test.ts +15 -10
  50. package/src/lib/environments/paths.ts +4 -3
  51. package/src/lib/guardian-token.ts +8 -3
  52. package/src/lib/hatch-local.ts +4 -11
  53. package/src/lib/health-check.ts +9 -10
  54. package/src/lib/host-teleport.ts +9 -14
  55. package/src/lib/live-voice/connection.ts +5 -6
  56. package/src/lib/port-heal.ts +3 -19
  57. package/src/lib/runtime-url.ts +15 -25
  58. package/src/lib/tunnel.ts +40 -25
  59. package/src/lib/tunnels/cloudflare.ts +132 -54
  60. package/src/lib/tunnels/gateway-notify.ts +1 -1
  61. package/src/lib/tunnels/ngrok.ts +83 -196
  62. package/src/lib/tunnels/tailscale.ts +11 -99
  63. package/src/lib/upgrade-lifecycle.ts +3 -7
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/service-contracts",
3
- "version": "0.13.0-dev.202610261443.fed5783",
3
+ "version": "0.13.0-dev.202610262105.8c45cc2",
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.202610261443.fed5783",
3
+ "version": "0.13.0-dev.202610262105.8c45cc2",
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.202610261443.fed5783",
3
+ "version": "0.13.0-dev.202610262105.8c45cc2",
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.202610261443.fed5783",
3
+ "version": "0.13.0-dev.202610262105.8c45cc2",
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.202610261443.fed5783",
3
+ "version": "0.13.0-dev.202610262105.8c45cc2",
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.202610261443.fed5783",
3
+ "version": "0.13.0-dev.202610262105.8c45cc2",
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.202610261443.fed5783",
3
+ "version": "0.13.0-dev.202610262105.8c45cc2",
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.202610261443.fed5783",
3
+ "version": "0.13.0-dev.202610262105.8c45cc2",
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.202610261443.fed5783",
3
+ "version": "0.13.0-dev.202610262105.8c45cc2",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -3,7 +3,9 @@ import fs from "node:fs";
3
3
  import type { TokenResult } from "./guardian-token";
4
4
  import {
5
5
  FLATTENED_FIRST_SEGMENTS,
6
+ getGatewayUrl,
6
7
  getLoopbackGatewayPort,
8
+ isCloudHome,
7
9
  isLoopbackGatewayCloud,
8
10
  isUsableRuntimeUrl,
9
11
  LockfileAssistantSchema,
@@ -209,18 +211,24 @@ export function gatewayTargetsFromLockfile(lockfile: {
209
211
  if (!parsed.success) {
210
212
  continue;
211
213
  }
212
- const { assistantId, cloud, resources, runtimeUrl } = parsed.data;
214
+ const { assistantId } = parsed.data;
213
215
  if (!assistantId) {
214
216
  continue;
215
217
  }
216
- if (isUsableRuntimeUrl(runtimeUrl) && !isLoopbackPublicUrl(runtimeUrl)) {
217
- targets.set(assistantId, { kind: "remote", runtimeUrl });
218
+ const gatewayUrl = getGatewayUrl(parsed.data);
219
+ // Cloud assistants are driven through the platform session, never
220
+ // forwarded over this machine's proxy.
221
+ if (isCloudHome(parsed.data.cloud)) {
218
222
  continue;
219
223
  }
220
- if (!isLoopbackGatewayCloud(cloud)) {
224
+ if (isUsableRuntimeUrl(gatewayUrl) && !isLoopbackPublicUrl(gatewayUrl)) {
225
+ targets.set(assistantId, { kind: "remote", runtimeUrl: gatewayUrl });
221
226
  continue;
222
227
  }
223
- const port = getLoopbackGatewayPort({ resources, runtimeUrl });
228
+ if (!isLoopbackGatewayCloud(parsed.data.cloud)) {
229
+ continue;
230
+ }
231
+ const port = getLoopbackGatewayPort(parsed.data);
224
232
  if (port != null && port >= MIN_GATEWAY_PORT && port <= MAX_GATEWAY_PORT) {
225
233
  targets.set(assistantId, { kind: "loopback", port });
226
234
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mycadet/local-mode — shared host library for serving the local-assistant
2
+ * @mycadet/local-mode - shared host library for serving the local-assistant
3
3
  * surface (lockfile reads, guardian-token issuance, gateway proxying, and the
4
4
  * hatch/retire/wake lifecycle ops) over a loopback HTTP boundary. Consumed by the
5
5
  * CLI `client` server and the web app's dev-server middleware so the local
@@ -55,6 +55,7 @@ export {
55
55
  isActiveAssistant,
56
56
  isPairedLockfileEntry,
57
57
  } from "./lockfile";
58
+ export { servedConfigFromLockfile } from "./served-config";
58
59
  export type { LockfileResult, WriteResult } from "./lockfile";
59
60
  export { withLockfileLock } from "./lockfile-lock";
60
61
  export type { LockfileLockResult } from "./lockfile-lock";
@@ -28,6 +28,13 @@ describe("parseLockfile", () => {
28
28
  cloudOrganizationId: "org_1",
29
29
  resources: { gatewayPort: 7777, daemonPort: 7778 },
30
30
  },
31
+ {
32
+ assistantId: "asst_2",
33
+ name: "Bob",
34
+ cloud: "custom",
35
+ ipAddress: "203.0.113.9",
36
+ port: 7831,
37
+ },
31
38
  ],
32
39
  };
33
40
 
@@ -24,8 +24,12 @@
24
24
  */
25
25
  import { isLoopbackPublicUrl } from "@mycadet/service-contracts/remote-web-pairing";
26
26
  import { TUNNEL_PROVIDERS } from "@mycadet/service-contracts/ingress";
27
+ import { SEEDS } from "@mycadet/environments";
27
28
  import { z } from "zod";
28
29
 
30
+ import { resolveEnvironmentName } from "./environment";
31
+ import { readLockfile } from "./lockfile";
32
+
29
33
  /**
30
34
  * Known deployment topologies of a Cadet:
31
35
  * - `local` — on-machine bare-metal processes
@@ -187,6 +191,57 @@ export function getLoopbackGatewayPort(entry: {
187
191
  }
188
192
  }
189
193
 
194
+ /**
195
+ * The gateway port a freshly hatched assistant's gateway listens on, with
196
+ * the `GATEWAY_PORT` env override the CLI tooling honors.
197
+ */
198
+ export const GATEWAY_PORT = process.env.GATEWAY_PORT
199
+ ? Number(process.env.GATEWAY_PORT)
200
+ : 7830;
201
+
202
+ /**
203
+ * The cloud URL stack: the lockfile's platform base url (what the active
204
+ * assistant was last hatched/waked against), else the `CADET_CLOUD_URL`
205
+ * override, else the resolved environment's cloud url.
206
+ */
207
+ function getCloudUrl(): string {
208
+ const lockfileUrl = readLockfile().cloudBaseUrl;
209
+ return (
210
+ (typeof lockfileUrl === "string" && lockfileUrl.trim()) ||
211
+ process.env.CADET_CLOUD_URL?.trim() ||
212
+ SEEDS[resolveEnvironmentName()]?.cloudUrl ||
213
+ SEEDS.production!.cloudUrl
214
+ );
215
+ }
216
+
217
+ /**
218
+ * The URL to dial an entry's gateway on, derived from the entry's canonical
219
+ * fields — the one seam every consumer addresses a gateway through:
220
+ *
221
+ * - `custom` remotes: their recorded host and port.
222
+ * - cloud-managed: the recorded platform URL, else the cloud URL stack.
223
+ * - loopback topologies (`local`, `docker`, `apple-container`): the
224
+ * recorded loopback gateway port, else the default gateway port.
225
+ *
226
+ * The recorded `runtimeUrl` only survives as a last resort for entries
227
+ * whose canonical fields predate this resolver; it is scheduled to die
228
+ * once every consumer reads through here.
229
+ */
230
+ export function getGatewayUrl(entry: LockfileAssistant): string {
231
+ if (entry.cloud === "custom" && entry.ipAddress && entry.port) {
232
+ return `http://${entry.ipAddress}:${entry.port}`;
233
+ }
234
+ if (isCloudHome(entry.cloud)) {
235
+ return (entry.runtimeUrl || getCloudUrl()).replace(/\/+$/, "");
236
+ }
237
+ const port = getLoopbackGatewayPort(entry);
238
+ if (port) return `http://127.0.0.1:${port}`;
239
+ return (entry.runtimeUrl || `http://127.0.0.1:${GATEWAY_PORT}`).replace(
240
+ /\/+$/,
241
+ "",
242
+ );
243
+ }
244
+
190
245
  /**
191
246
  * Per-instance resources for a local assistant: the renderer-facing ports,
192
247
  * the instance directory, the local runtime install metadata, and the
@@ -238,6 +293,10 @@ export const LockfileAssistantSchema = z.object({
238
293
  name: z.string().optional(),
239
294
  /** Deployment topology; absent or unknown on-disk values parse as "local". */
240
295
  cloud: RemoteSchema.catch("local"),
296
+ /** Host address of a custom remote's gateway (cloud "custom"). */
297
+ ipAddress: z.string().optional(),
298
+ /** Gateway port on a custom remote (cloud "custom"). */
299
+ port: z.number().optional(),
241
300
  runtimeUrl: z.string().optional(),
242
301
  hatchedAt: z.string().optional(),
243
302
  /**
@@ -0,0 +1,77 @@
1
+ import { describe, expect, test } from "bun:test";
2
+
3
+ import type { Lockfile } from "./lockfile-contract";
4
+ import { servedConfigFromLockfile } from "./served-config";
5
+
6
+ describe("servedConfigFromLockfile", () => {
7
+ test("selects the active entry and exposes only public config fields", () => {
8
+ const lockfile: Lockfile = {
9
+ assistants: [
10
+ { assistantId: "other", cloud: "local" },
11
+ {
12
+ assistantId: "active",
13
+ name: "Example Assistant",
14
+ cloud: "docker",
15
+ bearerToken: "example-host-token",
16
+ guardianBootstrapSecret: "example-bootstrap-secret",
17
+ resources: { gatewayPort: 7830, daemonPort: 7831 },
18
+ },
19
+ ],
20
+ activeAssistant: "active",
21
+ };
22
+
23
+ expect(servedConfigFromLockfile(lockfile)).toEqual({
24
+ assistantId: "active",
25
+ assistantName: "Example Assistant",
26
+ remote: "docker",
27
+ });
28
+ expect(lockfile.assistants[1]?.bearerToken).toBe("example-host-token");
29
+ });
30
+
31
+ test("uses the sole entry when no active entry matches", () => {
32
+ expect(
33
+ servedConfigFromLockfile({
34
+ assistants: [{ assistantId: "sole", cloud: "local" }],
35
+ activeAssistant: "removed",
36
+ }).assistantId,
37
+ ).toBe("sole");
38
+ });
39
+
40
+ test("does not select an arbitrary entry from an ambiguous registry", () => {
41
+ expect(
42
+ servedConfigFromLockfile({
43
+ assistants: [
44
+ { assistantId: "first", cloud: "local" },
45
+ { assistantId: "second", cloud: "local" },
46
+ ],
47
+ activeAssistant: null,
48
+ }).assistantId,
49
+ ).toBeUndefined();
50
+ });
51
+
52
+ test("an empty registry has no served assistant", () => {
53
+ expect(
54
+ servedConfigFromLockfile({ assistants: [], activeAssistant: null })
55
+ .assistantId,
56
+ ).toBeUndefined();
57
+ });
58
+
59
+ test("never exposes the guardian credential, even for a paired entry", () => {
60
+ const config = servedConfigFromLockfile({
61
+ assistants: [
62
+ {
63
+ assistantId: "paired",
64
+ cloud: "local",
65
+ runtimeUrl: "https://gateway.example.com",
66
+ bearerToken: "example-host-token",
67
+ },
68
+ ],
69
+ activeAssistant: "paired",
70
+ });
71
+ expect(config.assistantId).toBe("paired");
72
+ expect(config.remote).toBe("local");
73
+ // The stamp carries public identity only - no runtime URL, no secrets.
74
+ expect(JSON.stringify(config)).not.toContain("example-host-token");
75
+ expect(JSON.stringify(config)).not.toContain("gateway.example.com");
76
+ });
77
+ });
@@ -0,0 +1,15 @@
1
+ import type { Lockfile } from "./lockfile-contract";
2
+
3
+ /** Public identity of the active assistant, or the sole entry before selection. */
4
+ export function servedConfigFromLockfile(lockfile: Lockfile) {
5
+ const served =
6
+ lockfile.assistants.find(
7
+ (assistant) => assistant.assistantId === lockfile.activeAssistant,
8
+ ) ??
9
+ (lockfile.assistants.length === 1 ? lockfile.assistants[0] : undefined);
10
+ return {
11
+ assistantId: served?.assistantId,
12
+ assistantName: served?.name,
13
+ remote: served?.cloud,
14
+ };
15
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/service-contracts",
3
- "version": "0.13.0-dev.202610261443.fed5783",
3
+ "version": "0.13.0-dev.202610262105.8c45cc2",
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.202610261443.fed5783",
3
+ "version": "0.13.0-dev.202610262105.8c45cc2",
4
4
  "private": true,
5
5
  "exports": {
6
6
  ".": "./github-repository.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/cli",
3
- "version": "0.13.0-dev.202610261443.fed5783",
3
+ "version": "0.13.0-dev.202610262105.8c45cc2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/vargasjr-dev/mycadet-temp.git"
@@ -58,13 +58,6 @@ describe("fetchReleases", () => {
58
58
  expect(url).toContain("limit=100");
59
59
  });
60
60
 
61
- test("uses the cloudUrl override over the resolved default", async () => {
62
- const fetchMock = mockFetchJson([RELEASE]);
63
- await fetchReleases({ cloudUrl: "https://other-platform.test" });
64
- const url = String(fetchMock.mock.calls[0][0]);
65
- expect(url).toContain("https://other-platform.test/v1/releases/");
66
- });
67
-
68
61
  test("returns null on non-OK response", async () => {
69
62
  mockFetchJson({ detail: "nope" }, 500);
70
63
  expect(await fetchReleases()).toBeNull();
@@ -26,6 +26,7 @@ import {
26
26
  } from "../lib/guardian-token.js";
27
27
  import { getCurrentEnvironment } from "../lib/environments/resolve.js";
28
28
  import { withPreconnect } from "./helpers/http.js";
29
+ import { makeEntry } from "./helpers/lockfile-entry.js";
29
30
 
30
31
  function makeTokenData(suffix: string): GuardianTokenData {
31
32
  const now = new Date().toISOString();
@@ -290,7 +291,9 @@ describe("refreshGuardianToken", () => {
290
291
  );
291
292
  });
292
293
 
293
- const leased = await leaseGuardianToken("https://gw.example.com", "px");
294
+ const leased = await leaseGuardianToken(
295
+ makeEntry({ assistantId: "px" }),
296
+ );
294
297
 
295
298
  expect(leased.accessToken).toBe("access-lease");
296
299
  expect(leased.refreshAfter).toBeDefined();
@@ -315,7 +318,9 @@ describe("refreshGuardianToken", () => {
315
318
  );
316
319
  });
317
320
 
318
- const err = await leaseGuardianToken("https://gw.example.com", "px").then(
321
+ const err = await leaseGuardianToken(
322
+ makeEntry({ assistantId: "px" }),
323
+ ).then(
319
324
  () => null,
320
325
  (e: unknown) => e,
321
326
  );
@@ -0,0 +1,66 @@
1
+ import { describe, expect, test } from "bun:test";
2
+
3
+ import { GATEWAY_PORT } from "../lib/constants.js";
4
+ import { getGatewayUrl } from "@mycadet/local-mode/contract";
5
+ import type { LockfileAssistant } from "../lib/assistant-config.js";
6
+
7
+ const entry = (overrides: Partial<LockfileAssistant>): LockfileAssistant =>
8
+ ({
9
+ assistantId: "asst_1",
10
+ ...overrides,
11
+ }) as LockfileAssistant;
12
+
13
+ describe("getGatewayUrl", () => {
14
+ test("custom remotes derive from their recorded host and port", () => {
15
+ expect(
16
+ getGatewayUrl(
17
+ entry({ cloud: "custom", ipAddress: "203.0.113.7", port: 7830 }),
18
+ ),
19
+ ).toBe("http://203.0.113.7:7830");
20
+ });
21
+
22
+ test("custom remotes with no recorded address fall back to the legacy runtimeUrl", () => {
23
+ expect(
24
+ getGatewayUrl(
25
+ entry({ cloud: "custom", runtimeUrl: "http://203.0.113.7:9000/" }),
26
+ ),
27
+ ).toBe("http://203.0.113.7:9000");
28
+ });
29
+
30
+ test("cloud-managed entries dial the URL they were hatched under", () => {
31
+ expect(
32
+ getGatewayUrl(
33
+ entry({ cloud: "cloud", runtimeUrl: "https://cloud.example.com/" }),
34
+ ),
35
+ ).toBe("https://cloud.example.com");
36
+ });
37
+
38
+ test("cloud-managed entries without a recorded URL resolve through the cloud-url stack", () => {
39
+ expect(getGatewayUrl(entry({ cloud: "cloud" }))).toMatch(/^https?:\/\//);
40
+ });
41
+
42
+ test("loopback topologies derive from the recorded gateway port", () => {
43
+ expect(
44
+ getGatewayUrl(
45
+ entry({
46
+ cloud: "local",
47
+ resources: { gatewayPort: 7900, daemonPort: 7901 },
48
+ }),
49
+ ),
50
+ ).toBe("http://127.0.0.1:7900");
51
+ });
52
+
53
+ test("loopback topologies whose port lives only in a legacy loopback runtimeUrl still resolve", () => {
54
+ expect(
55
+ getGatewayUrl(
56
+ entry({ cloud: "docker", runtimeUrl: "http://127.0.0.1:7842" }),
57
+ ),
58
+ ).toBe("http://127.0.0.1:7842");
59
+ });
60
+
61
+ test("an entry with nothing derives the default gateway port", () => {
62
+ expect(getGatewayUrl(entry({ cloud: "local" }))).toBe(
63
+ `http://127.0.0.1:${GATEWAY_PORT}`,
64
+ );
65
+ });
66
+ });
@@ -18,7 +18,6 @@ import {
18
18
  shouldClearIngressUrl,
19
19
  startTailscaleServe,
20
20
  stopTailscaleServe,
21
- TAILSCALE_PROVIDER,
22
21
  type TailscaleCommandResult,
23
22
  type TailscaleDeps,
24
23
  } from "../lib/tunnels/tailscale.js";
@@ -360,46 +359,3 @@ describe("shouldClearIngressUrl", () => {
360
359
  expect(shouldClearIngressUrl(null)).toBe(false);
361
360
  });
362
361
  });
363
-
364
- describe("TAILSCALE_PROVIDER.start — the restore-path start piece", () => {
365
- test("a pairing-only tailnet run leaves lastTunnel on the webhook provider, so nothing re-establishes", async () => {
366
- const workspaceDir = makeWorkspace();
367
- writeFileSync(
368
- join(workspaceDir, "config.json"),
369
- JSON.stringify({
370
- ingress: {
371
- enabled: true,
372
- publicBaseUrl: "https://x.ngrok.app",
373
- lastTunnel: {
374
- provider: "ngrok",
375
- publicBaseUrl: "https://x.ngrok.app",
376
- },
377
- },
378
- }),
379
- );
380
-
381
- const url = await TAILSCALE_PROVIDER.start?.({
382
- port: 7840,
383
- workspaceDir,
384
- assistantId: "assistant-1",
385
- });
386
-
387
- expect(url).toBeNull();
388
- });
389
-
390
- test("a workspace whose config never recorded a tunnel declines too", async () => {
391
- const workspaceDir = makeWorkspace();
392
- writeFileSync(
393
- join(workspaceDir, "config.json"),
394
- JSON.stringify({ ingress: { enabled: true } }),
395
- );
396
-
397
- const url = await TAILSCALE_PROVIDER.start?.({
398
- port: 7840,
399
- workspaceDir,
400
- assistantId: "assistant-1",
401
- });
402
-
403
- expect(url).toBeNull();
404
- });
405
- });