@mycadet/cli 0.12.7 → 0.12.9

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 (179) hide show
  1. package/README.md +2 -2
  2. package/knip.json +1 -1
  3. package/node_modules/@mycadet/assistant-api/events/cloud-disconnected.ts +21 -0
  4. package/node_modules/@mycadet/assistant-api/events/host-bash.ts +1 -1
  5. package/node_modules/@mycadet/assistant-api/events/host-cu.ts +1 -1
  6. package/node_modules/@mycadet/assistant-api/events/host-file.ts +1 -1
  7. package/node_modules/@mycadet/assistant-api/events/notification-intent.ts +1 -1
  8. package/node_modules/@mycadet/assistant-api/events/show-cloud-login.ts +18 -0
  9. package/node_modules/@mycadet/assistant-api/index.ts +11 -11
  10. package/node_modules/@mycadet/assistant-api/node_modules/@mycadet/service-contracts/package.json +2 -2
  11. package/node_modules/@mycadet/{service-contracts/src/platform-credential.ts → assistant-api/node_modules/@mycadet/service-contracts/src/cloud-credential.ts} +9 -9
  12. package/node_modules/@mycadet/assistant-api/node_modules/@mycadet/service-contracts/src/handles.ts +3 -3
  13. package/node_modules/@mycadet/assistant-api/node_modules/@mycadet/service-contracts/src/index.ts +1 -1
  14. package/node_modules/@mycadet/assistant-api/node_modules/@mycadet/service-contracts/src/ingress.ts +11 -5
  15. package/node_modules/@mycadet/assistant-api/node_modules/@mycadet/service-contracts/src/remote-web-pairing.ts +1 -1
  16. package/node_modules/@mycadet/assistant-api/node_modules/@mycadet/service-contracts/src/rpc.ts +14 -14
  17. package/node_modules/@mycadet/assistant-api/node_modules/@mycadet/service-contracts/src/trust-rules.ts +5 -5
  18. package/node_modules/@mycadet/assistant-api/responses/home.ts +1 -1
  19. package/node_modules/@mycadet/assistant-api/surfaces.ts +4 -4
  20. package/node_modules/@mycadet/avatar-manifest/src/__tests__/notification-avatar.test.ts +1 -1
  21. package/node_modules/@mycadet/avatar-manifest/src/notification-avatar.ts +2 -2
  22. package/node_modules/@mycadet/environments/src/seeds.ts +6 -6
  23. package/node_modules/@mycadet/environments/src/shell.test.ts +1 -1
  24. package/node_modules/@mycadet/environments/src/types.ts +6 -6
  25. package/node_modules/@mycadet/local-mode/node_modules/@mycadet/avatar-manifest/src/__tests__/notification-avatar.test.ts +1 -1
  26. package/node_modules/@mycadet/local-mode/node_modules/@mycadet/avatar-manifest/src/notification-avatar.ts +2 -2
  27. package/node_modules/@mycadet/local-mode/node_modules/@mycadet/environments/src/seeds.ts +6 -6
  28. package/node_modules/@mycadet/local-mode/node_modules/@mycadet/environments/src/shell.test.ts +1 -1
  29. package/node_modules/@mycadet/local-mode/node_modules/@mycadet/environments/src/types.ts +6 -6
  30. package/node_modules/@mycadet/local-mode/node_modules/@mycadet/service-contracts/package.json +2 -2
  31. package/node_modules/@mycadet/{assistant-api/node_modules/@mycadet/service-contracts/src/platform-credential.ts → local-mode/node_modules/@mycadet/service-contracts/src/cloud-credential.ts} +9 -9
  32. package/node_modules/@mycadet/local-mode/node_modules/@mycadet/service-contracts/src/handles.ts +3 -3
  33. package/node_modules/@mycadet/local-mode/node_modules/@mycadet/service-contracts/src/index.ts +1 -1
  34. package/node_modules/@mycadet/local-mode/node_modules/@mycadet/service-contracts/src/ingress.ts +11 -5
  35. package/node_modules/@mycadet/local-mode/node_modules/@mycadet/service-contracts/src/remote-web-pairing.ts +1 -1
  36. package/node_modules/@mycadet/local-mode/node_modules/@mycadet/service-contracts/src/rpc.ts +14 -14
  37. package/node_modules/@mycadet/local-mode/node_modules/@mycadet/service-contracts/src/trust-rules.ts +5 -5
  38. package/node_modules/@mycadet/local-mode/src/__tests__/pair.test.ts +5 -5
  39. package/node_modules/@mycadet/local-mode/src/__tests__/retire.test.ts +1 -1
  40. package/node_modules/@mycadet/local-mode/src/config.ts +2 -2
  41. package/node_modules/@mycadet/local-mode/src/index.ts +1 -1
  42. package/node_modules/@mycadet/local-mode/src/lockfile-contract.test.ts +3 -3
  43. package/node_modules/@mycadet/local-mode/src/lockfile-contract.ts +10 -5
  44. package/node_modules/@mycadet/local-mode/src/lockfile.test.ts +15 -15
  45. package/node_modules/@mycadet/local-mode/src/lockfile.ts +9 -9
  46. package/node_modules/@mycadet/local-mode/src/pair.ts +2 -2
  47. package/node_modules/@mycadet/local-mode/src/retire.ts +3 -3
  48. package/node_modules/@mycadet/local-mode/src/teleport-backup-policy.ts +2 -2
  49. package/node_modules/@mycadet/local-mode/src/unpair.ts +2 -2
  50. package/node_modules/@mycadet/service-contracts/package.json +2 -2
  51. package/node_modules/@mycadet/{local-mode/node_modules/@mycadet/service-contracts/src/platform-credential.ts → service-contracts/src/cloud-credential.ts} +9 -9
  52. package/node_modules/@mycadet/service-contracts/src/handles.ts +3 -3
  53. package/node_modules/@mycadet/service-contracts/src/index.ts +1 -1
  54. package/node_modules/@mycadet/service-contracts/src/ingress.ts +11 -5
  55. package/node_modules/@mycadet/service-contracts/src/remote-web-pairing.ts +1 -1
  56. package/node_modules/@mycadet/service-contracts/src/rpc.ts +14 -14
  57. package/node_modules/@mycadet/service-contracts/src/trust-rules.ts +5 -5
  58. package/package.json +3 -2
  59. package/src/__tests__/assistant-api-key-resolution.test.ts +6 -6
  60. package/src/__tests__/{assistant-client-platform-auth.test.ts → assistant-client-cloud-auth.test.ts} +10 -10
  61. package/src/__tests__/assistant-client-refresh.test.ts +2 -2
  62. package/src/__tests__/backup.test.ts +86 -91
  63. package/src/__tests__/client-token.test.ts +1 -1
  64. package/src/__tests__/client-tui-refresh.test.ts +1 -1
  65. package/src/__tests__/client-web-config.test.ts +2 -2
  66. package/src/__tests__/{platform-client.test.ts → cloud-client.test.ts} +59 -59
  67. package/src/__tests__/{platform-releases.test.ts → cloud-releases.test.ts} +28 -18
  68. package/src/__tests__/{cloudflare-tunnel.test.ts → cloudflare.test.ts} +1 -1
  69. package/src/__tests__/connect-import.test.ts +55 -39
  70. package/src/__tests__/debug.test.ts +38 -38
  71. package/src/__tests__/ensure-binary.test.ts +182 -0
  72. package/src/__tests__/guardian-token.test.ts +149 -56
  73. package/src/__tests__/hatch-provider-secrets.test.ts +2 -2
  74. package/src/__tests__/helpers/guardian-token.ts +22 -0
  75. package/src/__tests__/helpers/http.ts +10 -0
  76. package/src/__tests__/nginx-ingress.test.ts +21 -20
  77. package/src/__tests__/ngrok-spawn.test.ts +49 -0
  78. package/src/__tests__/orphan-detection.test.ts +1 -1
  79. package/src/__tests__/pair.test.ts +1 -8
  80. package/src/__tests__/{ps-platform-status.test.ts → ps-cloud-status.test.ts} +79 -26
  81. package/src/__tests__/ps-table.test.ts +79 -0
  82. package/src/__tests__/{recover.test.ts → restore.test.ts} +29 -28
  83. package/src/__tests__/retire.test.ts +58 -199
  84. package/src/__tests__/root-process-lockfile.test.ts +99 -0
  85. package/src/__tests__/sleep.test.ts +19 -19
  86. package/src/__tests__/statefulset.test.ts +8 -8
  87. package/src/__tests__/{tailscale-tunnel.test.ts → tailscale.test.ts} +2 -2
  88. package/src/__tests__/teleport-backup.test.ts +3 -3
  89. package/src/__tests__/teleport.test.ts +181 -197
  90. package/src/__tests__/tunnel.test.ts +257 -222
  91. package/src/__tests__/uninstall.test.ts +13 -4
  92. package/src/__tests__/upgrade-local.test.ts +3 -3
  93. package/src/__tests__/upgrade-replay-env.test.ts +12 -12
  94. package/src/__tests__/wake.test.ts +260 -43
  95. package/src/__tests__/workos-pkce.test.ts +2 -2
  96. package/src/commands/backup.ts +24 -24
  97. package/src/commands/client.ts +76 -76
  98. package/src/commands/completions.test.ts +104 -0
  99. package/src/commands/completions.ts +87 -0
  100. package/src/commands/debug.ts +20 -20
  101. package/src/commands/exec.ts +12 -12
  102. package/src/commands/flags.ts +2 -2
  103. package/src/commands/hatch.ts +23 -23
  104. package/src/commands/login.ts +22 -22
  105. package/src/commands/logs.ts +8 -8
  106. package/src/commands/ps.ts +244 -86
  107. package/src/commands/restart.ts +30 -0
  108. package/src/commands/restore.ts +140 -22
  109. package/src/commands/retire.ts +48 -150
  110. package/src/commands/rollback.ts +20 -26
  111. package/src/commands/setup.ts +2 -2
  112. package/src/commands/sleep.ts +2 -2
  113. package/src/commands/teleport.ts +109 -109
  114. package/src/commands/terminal.ts +158 -18
  115. package/src/commands/tunnel.ts +138 -157
  116. package/src/commands/uninstall.ts +57 -9
  117. package/src/commands/unpair.ts +3 -3
  118. package/src/commands/upgrade.ts +30 -54
  119. package/src/commands/use.ts +1 -1
  120. package/src/commands/wake.ts +166 -50
  121. package/src/index.ts +18 -9
  122. package/src/lib/__tests__/{platform-client-signed-url.test.ts → cloud-client-signed-url.test.ts} +16 -16
  123. package/src/lib/__tests__/docker.test.ts +168 -20
  124. package/src/lib/__tests__/job-polling.test.ts +2 -2
  125. package/src/lib/__tests__/local-runtime-client.test.ts +4 -4
  126. package/src/lib/__tests__/runtime-url.test.ts +1 -1
  127. package/src/lib/assistant-api-key-resolution.ts +5 -5
  128. package/src/lib/assistant-client.ts +8 -8
  129. package/src/lib/assistant-config.ts +58 -12
  130. package/src/lib/{platform-client.ts → cloud-client.ts} +107 -98
  131. package/src/lib/cloud-login.ts +24 -24
  132. package/src/lib/{platform-releases.ts → cloud-releases.ts} +11 -9
  133. package/src/lib/cloud-values.ts +3 -0
  134. package/src/lib/config-utils.ts +1 -1
  135. package/src/lib/detached-process.ts +1 -1
  136. package/src/lib/docker.ts +260 -53
  137. package/src/lib/ensure-binary.ts +171 -0
  138. package/src/lib/environments/__tests__/paths.test.ts +2 -2
  139. package/src/lib/environments/__tests__/resolve.test.ts +26 -26
  140. package/src/lib/environments/resolve.ts +8 -8
  141. package/src/lib/flag-args.test.ts +1 -1
  142. package/src/lib/flag-args.ts +1 -1
  143. package/src/lib/guardian-token.ts +37 -5
  144. package/src/lib/hatch-local.ts +19 -23
  145. package/src/lib/health-check.ts +6 -6
  146. package/src/lib/ingress-config.ts +8 -35
  147. package/src/lib/job-polling.ts +2 -2
  148. package/src/lib/live-voice/connection.ts +12 -12
  149. package/src/lib/live-voice/tunnel.test.ts +11 -11
  150. package/src/lib/live-voice/tunnel.ts +15 -15
  151. package/src/lib/local-runtime-client.ts +20 -20
  152. package/src/lib/local.ts +10 -31
  153. package/src/lib/nginx-ingress.ts +42 -15
  154. package/src/lib/pair.ts +1 -1
  155. package/src/lib/process.ts +1 -1
  156. package/src/lib/provider-secrets.ts +3 -3
  157. package/src/lib/retire-apple-container.ts +1 -1
  158. package/src/lib/runtime-url.ts +8 -8
  159. package/src/lib/statefulset.ts +2 -2
  160. package/src/lib/sync-cloud-assistants.ts +19 -19
  161. package/src/lib/teleport-backup.ts +4 -4
  162. package/src/lib/terminal-client.ts +17 -17
  163. package/src/lib/terminal-session.ts +24 -24
  164. package/src/lib/{tunnel-edge.ts → tunnel.ts} +199 -11
  165. package/src/lib/tunnels/cadet.ts +29 -0
  166. package/src/lib/{cloudflare-tunnel.ts → tunnels/cloudflare.ts} +36 -15
  167. package/src/lib/tunnels/gateway-notify.ts +61 -0
  168. package/src/lib/{ngrok.ts → tunnels/ngrok.ts} +350 -89
  169. package/src/lib/{tailscale-tunnel.ts → tunnels/tailscale.ts} +53 -9
  170. package/src/lib/upgrade-lifecycle.ts +8 -21
  171. package/src/lib/upgrade-preflight.ts +2 -2
  172. package/src/lib/workos-pkce.ts +5 -5
  173. package/node_modules/@mycadet/assistant-api/events/platform-disconnected.ts +0 -21
  174. package/node_modules/@mycadet/assistant-api/events/show-platform-login.ts +0 -20
  175. package/src/commands/recover.ts +0 -131
  176. package/src/commands/roadmap.ts +0 -459
  177. package/src/commands/ssh.ts +0 -144
  178. package/src/commands/workflows.ts +0 -305
  179. package/src/lib/managed-cloud.ts +0 -3
@@ -4,7 +4,7 @@
4
4
  * A teleport ends with the source assistant being retired, so each surface
5
5
  * snapshots the source before any data leaves it. This module holds the
6
6
  * decisions those surfaces must agree on: how fresh an existing backup has to
7
- * be to stand in for a new one, and how a platform (PVC) snapshot is judged
7
+ * be to stand in for a new one, and how a cloud (PVC) snapshot is judged
8
8
  * restorable. Transport lives with each client; nothing here touches the
9
9
  * network or the filesystem.
10
10
  */
@@ -43,7 +43,7 @@ export function hasRecentBackup(
43
43
  return false;
44
44
  }
45
45
 
46
- /** The fields of a platform backup listing entry the policy reads. */
46
+ /** The fields of a cloud backup listing entry the policy reads. */
47
47
  export interface ManagedBackupEntry {
48
48
  snapshot_name?: string;
49
49
  created_at?: string;
@@ -16,7 +16,7 @@ import { withLockfileLock } from "./lockfile-lock";
16
16
  * `cadet unpair`: the remote assistant itself is never touched (host-side
17
17
  * device revocation is `cadet devices`). Only pairing records
18
18
  * (`cloud: "paired"`, created by `cadet connect import`) are forgettable this
19
- * way; local and managed assistants go through retire.
19
+ * way; local and cloud assistants go through retire.
20
20
  */
21
21
  export function unpairAssistant(
22
22
  lockfilePaths: string[],
@@ -53,7 +53,7 @@ function unpairAssistantLocked(
53
53
  ok: false,
54
54
  status: 400,
55
55
  error:
56
- "Only paired assistants can be unpaired. Use retire for local or managed assistants.",
56
+ "Only paired assistants can be unpaired. Use retire for local or cloud assistants.",
57
57
  };
58
58
  }
59
59
 
@@ -26,7 +26,7 @@
26
26
  "./error": "./src/error.ts",
27
27
  "./reactions": "./src/reactions.ts",
28
28
  "./guardian-requests": "./src/guardian-requests.ts",
29
- "./platform-credential": "./src/platform-credential.ts",
29
+ "./cloud-credential": "./src/cloud-credential.ts",
30
30
  "./plan-credit": "./src/plan-credit.ts",
31
31
  "./integration-categories": "./src/integration-categories.ts",
32
32
  "./mcp-oauth": "./src/mcp-oauth.ts"
@@ -40,6 +40,6 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/bun": "1.2.4",
43
- "typescript": "5.7.3"
43
+ "typescript": "5.9.3"
44
44
  }
45
45
  }
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Wire contract for asking an assistant whether its stored platform-managed
2
+ * Wire contract for asking an assistant whether its stored cloud-managed
3
3
  * credential still authenticates.
4
4
  *
5
5
  * The daemon route is the authoritative serving side:
6
6
  * - `POST /v1/platform/verify-credential`
7
- * (`assistant/src/runtime/routes/platform-routes.ts`)
7
+ * (`assistant/src/runtime/routes/cloud-routes.ts`)
8
8
  *
9
9
  * The daemon's platform client produces the verdict, the route reports it,
10
10
  * and the `cadet` CLI reads it before deciding whether a stored key can be
@@ -15,26 +15,26 @@
15
15
  import { z } from "zod";
16
16
 
17
17
  /**
18
- * What the platform said about the stored credential, right now.
18
+ * What the cloud said about the stored credential, right now.
19
19
  *
20
- * - `valid`: the platform accepted it.
21
- * - `rejected`: the platform refused it (unauthorized or forbidden); the
20
+ * - `valid`: the cloud accepted it.
21
+ * - `rejected`: the cloud refused it (unauthorized or forbidden); the
22
22
  * credential needs replacing.
23
23
  * - `unknown`: the check itself could not run (no credential stored, the
24
24
  * platform unreachable, a server error). Not evidence either way.
25
25
  */
26
- export const PlatformCredentialVerificationStatusSchema = z.enum([
26
+ export const CloudCredentialVerificationStatusSchema = z.enum([
27
27
  "valid",
28
28
  "rejected",
29
29
  "unknown",
30
30
  ]);
31
- export type PlatformCredentialVerificationStatus = z.infer<
32
- typeof PlatformCredentialVerificationStatusSchema
31
+ export type CloudCredentialVerificationStatus = z.infer<
32
+ typeof CloudCredentialVerificationStatusSchema
33
33
  >;
34
34
 
35
35
  /** `POST /v1/platform/verify-credential` response body. */
36
36
  export const PlatformVerifyCredentialResponseSchema = z.object({
37
- status: PlatformCredentialVerificationStatusSchema,
37
+ status: CloudCredentialVerificationStatusSchema,
38
38
  });
39
39
  export type PlatformVerifyCredentialResponse = z.infer<
40
40
  typeof PlatformVerifyCredentialResponseSchema
@@ -15,9 +15,9 @@
15
15
  * Format: `local_oauth:<providerKey>/<connectionId>` where providerKey
16
16
  * is the bare provider name (e.g. `google`).
17
17
  *
18
- * 3. **Managed OAuth** — references an OAuth connection managed by the
18
+ * 3. **Cloud OAuth** — references an OAuth connection managed by the
19
19
  * platform. Format: `platform_oauth:<connectionId>` where connectionId
20
- * is the platform-assigned connection identifier.
20
+ * is the cloud-assigned connection identifier.
21
21
  */
22
22
 
23
23
  import { z } from "zod";
@@ -96,7 +96,7 @@ export function localOAuthHandle(
96
96
  }
97
97
 
98
98
  /**
99
- * Build a managed (platform) OAuth credential handle from a connection ID.
99
+ * Build a cloud (platform) OAuth credential handle from a connection ID.
100
100
  */
101
101
  export function platformOAuthHandle(connectionId: string): string {
102
102
  return `${HandleType.PlatformOAuth}:${connectionId}`;
@@ -31,7 +31,7 @@ export * from "./no-response.js";
31
31
  export * from "./plan-credit.js";
32
32
  export * from "./integration-categories.js";
33
33
  export * from "./mcp-oauth.js";
34
- export * from "./platform-credential.js";
34
+ export * from "./cloud-credential.js";
35
35
  export * from "./remote-web-pairing.js";
36
36
  export * from "./twilio-ingress.js";
37
37
  export * from "./url-normalization.js";
@@ -4,7 +4,7 @@
4
4
  * `{env}-cloud.mycadet.ai` → `tunnel-{env}.mycadet.ai`). Returns null for
5
5
  * hosts outside that convention (localhost, custom domains). Shared by the
6
6
  * gateway speech relay and the web live-voice client so the two ends of the
7
- * managed-speech transport can't drift.
7
+ * cloud-speech transport can't drift.
8
8
  */
9
9
  export function tunnelHostForPlatformHost(host: string): string | null {
10
10
  if (host === "cloud.mycadet.ai") {
@@ -100,11 +100,17 @@ export const INGRESS_PAIRING_TUNNEL_KEY = "pairingTunnel";
100
100
  export const INGRESS_ASSISTANT_ID_KEY = "assistantId";
101
101
 
102
102
  /**
103
- * The local tunnel providers the CLI can start, in the order they are offered.
104
- * `cadet tunnel`'s accepted `--provider` values and the persisted-record
105
- * validation below both derive from it.
103
+ * The tunnel providers the CLI offers, in the order they are presented —
104
+ * the managed `cadet` tunnel first (listed, not yet implemented), then the
105
+ * local ones. `cadet tunnel`'s accepted `--provider` values and the
106
+ * persisted-record validation below both derive from it.
106
107
  */
107
- export const TUNNEL_PROVIDERS = ["ngrok", "cloudflare", "tailscale"] as const;
108
+ export const TUNNEL_PROVIDERS = [
109
+ "cadet",
110
+ "ngrok",
111
+ "cloudflare",
112
+ "tailscale",
113
+ ] as const;
108
114
 
109
115
  export type TunnelProviderName = (typeof TUNNEL_PROVIDERS)[number];
110
116
 
@@ -152,7 +152,7 @@ export const DEFAULT_REMOTE_WEB_PAIRING_PLATFORM: RemoteWebPairingPlatform =
152
152
 
153
153
  /**
154
154
  * A requested platform coerced to a known value. The pairing-token route is
155
- * publicly reachable and the platform renders verbatim in the host's
155
+ * publicly reachable and the cloud renders verbatim in the host's
156
156
  * paired-devices list, so an unrecognized value never reaches the DB.
157
157
  */
158
158
  export function resolveRemoteWebPairingPlatform(
@@ -34,7 +34,7 @@ import { RpcErrorSchema } from "./error.js";
34
34
 
35
35
  export const CesRpcMethod = {
36
36
  /** Push an updated assistant credential to CES after post-hatch provisioning. */
37
- UpdateManagedCredential: "update_managed_credential",
37
+ UpdateCloudCredential: "update_managed_credential",
38
38
  /** Retrieve a single credential by account name. */
39
39
  GetCredential: "get_credential",
40
40
  /** Store or update a credential by account name. */
@@ -63,7 +63,7 @@ export type CesRpcMethod = (typeof CesRpcMethod)[keyof typeof CesRpcMethod];
63
63
  // update_managed_credential
64
64
  // ---------------------------------------------------------------------------
65
65
 
66
- export const UpdateManagedCredentialSchema = z.object({
66
+ export const UpdateCloudCredentialSchema = z.object({
67
67
  /** The assistant API key to push to CES for platform credential materialization. */
68
68
  assistantApiKey: z.string(), // nosemgrep: not-a-secret
69
69
  /**
@@ -72,16 +72,16 @@ export const UpdateManagedCredentialSchema = z.object({
72
72
  */
73
73
  assistantId: z.string().optional(),
74
74
  });
75
- export type UpdateManagedCredential = z.infer<
76
- typeof UpdateManagedCredentialSchema
75
+ export type UpdateCloudCredential = z.infer<
76
+ typeof UpdateCloudCredentialSchema
77
77
  >;
78
78
 
79
- export const UpdateManagedCredentialResponseSchema = z.object({
80
- /** Whether the managed credential was successfully updated. */
79
+ export const UpdateCloudCredentialResponseSchema = z.object({
80
+ /** Whether the cloud credential was successfully updated. */
81
81
  updated: z.boolean(),
82
82
  });
83
- export type UpdateManagedCredentialResponse = z.infer<
84
- typeof UpdateManagedCredentialResponseSchema
83
+ export type UpdateCloudCredentialResponse = z.infer<
84
+ typeof UpdateCloudCredentialResponseSchema
85
85
  >;
86
86
 
87
87
  // ---------------------------------------------------------------------------
@@ -311,9 +311,9 @@ export type BulkSetCredentialRecordsResponse = z.infer<
311
311
  * schemas. Useful for building type-safe RPC dispatch layers.
312
312
  */
313
313
  export interface CesRpcContract {
314
- [CesRpcMethod.UpdateManagedCredential]: {
315
- request: UpdateManagedCredential;
316
- response: UpdateManagedCredentialResponse;
314
+ [CesRpcMethod.UpdateCloudCredential]: {
315
+ request: UpdateCloudCredential;
316
+ response: UpdateCloudCredentialResponse;
317
317
  };
318
318
  [CesRpcMethod.GetCredential]: {
319
319
  request: GetCredential;
@@ -361,9 +361,9 @@ export interface CesRpcContract {
361
361
  * Schema lookup map for runtime validation of RPC payloads.
362
362
  */
363
363
  export const CesRpcSchemas = {
364
- [CesRpcMethod.UpdateManagedCredential]: {
365
- request: UpdateManagedCredentialSchema,
366
- response: UpdateManagedCredentialResponseSchema,
364
+ [CesRpcMethod.UpdateCloudCredential]: {
365
+ request: UpdateCloudCredentialSchema,
366
+ response: UpdateCloudCredentialResponseSchema,
367
367
  },
368
368
  [CesRpcMethod.GetCredential]: {
369
369
  request: GetCredentialSchema,
@@ -15,7 +15,7 @@
15
15
  * - **URL**: tools whose candidates include a URL (`web_fetch`,
16
16
  * `network_request`).
17
17
  * - **Managed skill**: tools that manage first-party skill packages
18
- * (`scaffold_managed_skill`, `delete_managed_skill`).
18
+ * (`scaffold_cloud_skill`, `delete_cloud_skill`).
19
19
  * - **Skill load**: the `skill_load` tool, which uses a distinct candidate
20
20
  * namespace (`skill_load:selector` or `skill_load_dynamic:selector`).
21
21
  * - **Generic**: everything else (computer-use tools, UI surface tools,
@@ -58,8 +58,8 @@ export const URL_TOOLS = ["web_fetch", "network_request"] as const;
58
58
  * Tools that manage first-party skill packages (scaffold/delete).
59
59
  */
60
60
  export const MANAGED_SKILL_TOOLS = [
61
- "scaffold_managed_skill",
62
- "delete_managed_skill",
61
+ "scaffold_cloud_skill",
62
+ "delete_cloud_skill",
63
63
  ] as const;
64
64
 
65
65
  /**
@@ -89,8 +89,8 @@ export function isUrlRule(rule: { tool: string }): boolean {
89
89
  return URL_TOOLS_SET.has(rule.tool);
90
90
  }
91
91
 
92
- /** Returns true when the rule's tool belongs to the managed-skill-tool family. */
93
- export function isManagedSkillRule(rule: { tool: string }): boolean {
92
+ /** Returns true when the rule's tool belongs to the cloud-skill-tool family. */
93
+ export function isCloudSkillRule(rule: { tool: string }): boolean {
94
94
  return MANAGED_SKILL_TOOLS_SET.has(rule.tool);
95
95
  }
96
96
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/cli",
3
- "version": "0.12.7",
3
+ "version": "0.12.9",
4
4
  "description": "CLI tools for mycadet",
5
5
  "type": "module",
6
6
  "exports": {
@@ -20,7 +20,7 @@
20
20
  "scripts": {
21
21
  "format": "prettier --write .",
22
22
  "format:check": "prettier --check .",
23
- "lint": "eslint --max-warnings 519",
23
+ "lint": "eslint --max-warnings 322",
24
24
  "lint:unused": "knip --include files,dependencies,unlisted",
25
25
  "compile:check": "bun build --compile src/index.ts --outfile /dev/null",
26
26
  "test": "bun run scripts/run-tests.ts",
@@ -41,6 +41,7 @@
41
41
  "qrcode-terminal": "0.12.0",
42
42
  "react": "19.2.6",
43
43
  "react-devtools-core": "7.0.1",
44
+ "yaml": "2.8.2",
44
45
  "zod": "4.3.6"
45
46
  },
46
47
  "bundledDependencies": [
@@ -1,6 +1,6 @@
1
1
  import { beforeEach, describe, expect, mock, test } from "bun:test";
2
2
 
3
- import * as realPlatformClient from "../lib/platform-client.js";
3
+ import * as realCloudClient from "../lib/cloud-client.js";
4
4
 
5
5
  const calls: string[] = [];
6
6
  let verifyResult: "valid" | "rejected" | "unknown" | null = "valid";
@@ -9,9 +9,9 @@ let readResult: { value: string | null; unreachable: boolean } = {
9
9
  unreachable: false,
10
10
  };
11
11
 
12
- mock.module("../lib/platform-client.js", () => ({
13
- ...realPlatformClient,
14
- verifyGatewayManagedCredential: mock(async () => {
12
+ mock.module("../lib/cloud-client.js", () => ({
13
+ ...realCloudClient,
14
+ verifyGatewayCloudCredential: mock(async () => {
15
15
  calls.push("verify");
16
16
  return verifyResult;
17
17
  }),
@@ -61,13 +61,13 @@ describe("resolveAssistantApiKeyForInjection", () => {
61
61
  // The verdict comes first and the key is read after it, so the value
62
62
  // returned is the one the verdict covered, never one a concurrent repair
63
63
  // has since replaced.
64
- test("a stored key the platform accepts is read after the verdict", async () => {
64
+ test("a stored key the cloud accepts is read after the verdict", async () => {
65
65
  const resolved = await resolveAssistantApiKeyForInjection(ARGS);
66
66
  expect(resolved).toEqual({ apiKey: "stored-key", source: "stored" });
67
67
  expect(calls).toEqual(["verify", "read"]);
68
68
  });
69
69
 
70
- test("a stored key the platform rejects is replaced without being read", async () => {
70
+ test("a stored key the cloud rejects is replaced without being read", async () => {
71
71
  verifyResult = "rejected";
72
72
  const resolved = await resolveAssistantApiKeyForInjection(ARGS);
73
73
  expect(resolved).toEqual({ apiKey: "fresh-key", source: "reprovisioned" });
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Tests for AssistantClient's platform-managed (`cloud: "cadet"`) auth path.
2
+ * Tests for AssistantClient's cloud-managed (`cloud: "cadet"`) auth path.
3
3
  * These entries have no guardian token on disk, so the client must authenticate
4
4
  * with the stored platform credential instead of sending an anonymous request
5
- * (which the platform answers with a bare 403).
5
+ * (which the cloud answers with a bare 403).
6
6
  */
7
7
  import {
8
8
  afterAll,
@@ -16,7 +16,7 @@ import { mkdtempSync, rmSync } from "node:fs";
16
16
  import { tmpdir } from "node:os";
17
17
  import { join } from "node:path";
18
18
 
19
- const testDir = mkdtempSync(join(tmpdir(), "client-platform-auth-test-"));
19
+ const testDir = mkdtempSync(join(tmpdir(), "client-cloud-auth-test-"));
20
20
  const ORIGINAL_LOCKFILE_DIR = process.env.CADET_LOCKFILE_DIR;
21
21
  const ORIGINAL_CONFIG_HOME = process.env.XDG_CONFIG_HOME;
22
22
  const ORIGINAL_FETCH = globalThis.fetch;
@@ -24,15 +24,15 @@ const ORIGINAL_FETCH = globalThis.fetch;
24
24
  import { AssistantClient } from "../lib/assistant-client.js";
25
25
  import { saveAssistantEntry } from "../lib/assistant-config.js";
26
26
  import {
27
- clearPlatformToken,
28
- savePlatformToken,
29
- } from "../lib/platform-client.js";
27
+ clearCloudToken,
28
+ saveCloudToken,
29
+ } from "../lib/cloud-client.js";
30
30
 
31
31
  const PLATFORM_URL = "https://platform.example.com";
32
32
  const ASSISTANT_ID = "019d1e04-cb20-719a-b04b-310072904444";
33
33
  const ORG_ID = "org-abc";
34
34
 
35
- /** Seed a platform-managed lockfile entry, optionally with a stored token. */
35
+ /** Seed a cloud-managed lockfile entry, optionally with a stored token. */
36
36
  function seedCloud(token?: string): void {
37
37
  saveAssistantEntry({
38
38
  assistantId: ASSISTANT_ID,
@@ -41,7 +41,7 @@ function seedCloud(token?: string): void {
41
41
  cloud: "cadet",
42
42
  });
43
43
  if (token) {
44
- savePlatformToken(token);
44
+ saveCloudToken(token);
45
45
  }
46
46
  }
47
47
 
@@ -68,7 +68,7 @@ const isOrgFetch = (url: string) => url.includes("/v1/organizations/");
68
68
  const isRefresh = (url: string) => url.includes("/v1/guardian/refresh");
69
69
 
70
70
  function orgResponse(): Response {
71
- return new Response(JSON.stringify({ results: [{ id: ORG_ID }] }), {
71
+ return new Response(JSON.stringify({ results: [{ id: ORG_ID, name: "My Cadet" }] }), {
72
72
  status: 200,
73
73
  headers: { "content-type": "application/json" },
74
74
  });
@@ -79,7 +79,7 @@ describe("AssistantClient cloud-managed auth", () => {
79
79
  process.env.CADET_LOCKFILE_DIR = testDir;
80
80
  process.env.XDG_CONFIG_HOME = testDir;
81
81
  // Tests share testDir, so a token saved by an earlier one must not leak.
82
- clearPlatformToken();
82
+ clearCloudToken();
83
83
  });
84
84
 
85
85
  afterEach(() => {
@@ -2,7 +2,7 @@
2
2
  * Tests for AssistantClient's reactive 401 -> refresh -> retry: a paired/local
3
3
  * guardian access token that 401s is refreshed once via the stored refresh
4
4
  * credential and the request retried. Self-gating (no refresh token => no
5
- * retry) and never applied to the platform session-auth path.
5
+ * retry) and never applied to the cloud session-auth path.
6
6
  */
7
7
  import {
8
8
  afterAll,
@@ -148,7 +148,7 @@ describe("AssistantClient 401 -> refresh -> retry", () => {
148
148
  expect(calls.filter((c) => isRefresh(c.url))).toHaveLength(0);
149
149
  });
150
150
 
151
- test("never refreshes on the platform session-auth path", async () => {
151
+ test("never refreshes on the cloud session-auth path", async () => {
152
152
  seedPaired("refresh-tok"); // entry must exist; session auth ignores it
153
153
  let assistantAttempts = 0;
154
154
  const calls = stubFetch((url) => {