@mycadet/gateway 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 +3 -3
  2. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/package.json +2 -2
  3. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/{platform-credential.ts → cloud-credential.ts} +9 -9
  4. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/handles.ts +3 -3
  5. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/index.ts +1 -1
  6. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/ingress.ts +11 -5
  7. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/remote-web-pairing.ts +1 -1
  8. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/rpc.ts +14 -14
  9. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/trust-rules.ts +5 -5
  10. package/node_modules/@mycadet/ces-client/package.json +1 -1
  11. package/node_modules/@mycadet/ces-client/src/__tests__/ces-client.test.ts +14 -14
  12. package/node_modules/@mycadet/ces-client/src/rpc-client.ts +1 -1
  13. package/node_modules/@mycadet/environments/src/seeds.ts +6 -6
  14. package/node_modules/@mycadet/environments/src/shell.test.ts +1 -1
  15. package/node_modules/@mycadet/environments/src/types.ts +6 -6
  16. package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/package.json +2 -2
  17. package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/{platform-credential.ts → cloud-credential.ts} +9 -9
  18. package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/handles.ts +3 -3
  19. package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/index.ts +1 -1
  20. package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/ingress.ts +11 -5
  21. package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/remote-web-pairing.ts +1 -1
  22. package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/rpc.ts +14 -14
  23. package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/trust-rules.ts +5 -5
  24. package/node_modules/@mycadet/gateway-client/src/binding-strength-contract.ts +5 -5
  25. package/node_modules/@mycadet/gateway-client/src/gateway-ipc-contracts.ts +1 -1
  26. package/node_modules/@mycadet/gateway-client/src/inbound-contract.ts +2 -2
  27. package/node_modules/@mycadet/gateway-client/src/outbound-contract.ts +1 -1
  28. package/node_modules/@mycadet/service-contracts/package.json +2 -2
  29. package/node_modules/@mycadet/service-contracts/src/{platform-credential.ts → cloud-credential.ts} +9 -9
  30. package/node_modules/@mycadet/service-contracts/src/handles.ts +3 -3
  31. package/node_modules/@mycadet/service-contracts/src/index.ts +1 -1
  32. package/node_modules/@mycadet/service-contracts/src/ingress.ts +11 -5
  33. package/node_modules/@mycadet/service-contracts/src/remote-web-pairing.ts +1 -1
  34. package/node_modules/@mycadet/service-contracts/src/rpc.ts +14 -14
  35. package/node_modules/@mycadet/service-contracts/src/trust-rules.ts +5 -5
  36. package/openapi.json +17 -17
  37. package/package.json +1 -1
  38. package/scripts/generate-openapi.ts +1 -1
  39. package/src/__tests__/actor-token-revocation.test.ts +0 -1
  40. package/src/__tests__/{backup-worker-platform-mode.test.ts → backup-worker-cloud-mode.test.ts} +4 -4
  41. package/src/__tests__/channel-verification-session-proxy.test.ts +0 -1
  42. package/src/__tests__/{platform-identity.test.ts → cloud-identity.test.ts} +72 -86
  43. package/src/__tests__/config.test.ts +0 -24
  44. package/src/__tests__/contacts-control-plane-proxy.test.ts +0 -1
  45. package/src/__tests__/credential-requests.test.ts +6 -6
  46. package/src/__tests__/{credential-watcher-managed-bootstrap.test.ts → credential-watcher-cloud-bootstrap.test.ts} +1 -1
  47. package/src/__tests__/edge-auth.test.ts +18 -18
  48. package/src/__tests__/edge-guardian-auth.test.ts +10 -10
  49. package/src/__tests__/guardian-init-lockfile.test.ts +6 -8
  50. package/src/__tests__/guardian-pin.test.ts +8 -8
  51. package/src/__tests__/handle-inbound-admission.test.ts +0 -1
  52. package/src/__tests__/handle-inbound-app-context.test.ts +0 -1
  53. package/src/__tests__/handle-inbound-invite-intercept.test.ts +0 -1
  54. package/src/__tests__/handle-inbound-trust-verdict.test.ts +0 -1
  55. package/src/__tests__/inbound-contact-seed.test.ts +1 -1
  56. package/src/__tests__/live-voice-websocket.test.ts +12 -12
  57. package/src/__tests__/load-guards.test.ts +0 -1
  58. package/src/__tests__/migration-teleport-gcs-proxy.test.ts +0 -1
  59. package/src/__tests__/oauth-callback.test.ts +0 -1
  60. package/src/__tests__/remote-feature-flag-sync.test.ts +35 -45
  61. package/src/__tests__/resolve-assistant.test.ts +0 -1
  62. package/src/__tests__/route-schema-guard.test.ts +4 -1
  63. package/src/__tests__/runtime-client.test.ts +1 -2
  64. package/src/__tests__/runtime-health-proxy.test.ts +0 -1
  65. package/src/__tests__/runtime-proxy-auth.test.ts +3 -2
  66. package/src/__tests__/runtime-proxy-device-stamp.test.ts +0 -1
  67. package/src/__tests__/runtime-proxy-error-body.test.ts +0 -1
  68. package/src/__tests__/runtime-proxy.test.ts +0 -1
  69. package/src/__tests__/runtime-stream-test-utils.ts +0 -1
  70. package/src/__tests__/shared-invite-registration.test.ts +15 -32
  71. package/src/__tests__/slack-control-plane-proxy.test.ts +0 -1
  72. package/src/__tests__/slack-display-name.test.ts +0 -1
  73. package/src/__tests__/slack-normalize.test.ts +0 -1
  74. package/src/__tests__/slack-reaction-normalize.test.ts +0 -1
  75. package/src/__tests__/slack-socket-mode-catchup.test.ts +0 -1
  76. package/src/__tests__/slack-socket-mode-group-dm.test.ts +0 -1
  77. package/src/__tests__/slack-socket-mode-liveness.test.ts +0 -1
  78. package/src/__tests__/slack-socket-mode-outbound-root.test.ts +0 -1
  79. package/src/__tests__/slack-socket-mode-thread-tracking.test.ts +0 -1
  80. package/src/__tests__/speech-relay-websocket.test.ts +16 -14
  81. package/src/__tests__/stt-stream-websocket.test.ts +5 -5
  82. package/src/__tests__/telegram-control-plane-proxy.test.ts +0 -1
  83. package/src/__tests__/telegram-webhook-drop-visibility.test.ts +0 -1
  84. package/src/__tests__/telegram-webhook-handler.test.ts +0 -1
  85. package/src/__tests__/telegram-webhook-manager.test.ts +79 -80
  86. package/src/__tests__/twilio-media-websocket.test.ts +0 -1
  87. package/src/__tests__/twilio-webhooks.test.ts +6 -7
  88. package/src/__tests__/whatsapp-download.test.ts +0 -1
  89. package/src/__tests__/whatsapp-webhook.test.ts +0 -1
  90. package/src/attachments/ingest.test.ts +0 -1
  91. package/src/auth/guardian-bootstrap.ts +16 -15
  92. package/src/auth/scopes.ts +1 -1
  93. package/src/auth-fallback-reporter.ts +1 -1
  94. package/src/backup/backup-worker.ts +2 -2
  95. package/src/channels/inbound-event.ts +3 -3
  96. package/src/channels/ingress-inbound-vendors.test.ts +2 -2
  97. package/src/channels/ingress-inbound.ts +1 -1
  98. package/src/channels/ingress-verification.test.ts +2 -2
  99. package/src/channels/ingress-verification.ts +4 -4
  100. package/src/channels/plugin-ingress-approvals.test.ts +1 -1
  101. package/src/channels/plugin-ingress-approvals.ts +1 -1
  102. package/src/channels/plugin-ingress.test.ts +3 -3
  103. package/src/channels/plugin-ingress.ts +3 -3
  104. package/src/channels/room-admission.ts +2 -2
  105. package/src/cli/contacts.ts +3 -1
  106. package/src/cli/index.ts +1 -1
  107. package/src/{platform-identity.ts → cloud-identity.ts} +60 -68
  108. package/src/cloud-url.ts +25 -0
  109. package/src/{platform-user-id.ts → cloud-user-id.ts} +4 -4
  110. package/src/config.ts +2 -4
  111. package/src/credential-reader.ts +2 -2
  112. package/src/db/assistant-db-proxy.ts +1 -1
  113. package/src/discord/forward.ts +1 -1
  114. package/src/email/normalize.ts +4 -4
  115. package/src/email/register-callback.test.ts +27 -34
  116. package/src/email/register-callback.ts +21 -26
  117. package/src/feature-flag-registry.json +5 -5
  118. package/src/feature-flag-remote-store.ts +2 -2
  119. package/src/feature-flag-resolver.ts +5 -5
  120. package/src/http/cadet-signature.ts +1 -1
  121. package/src/http/edge-forwarded-header.ts +1 -1
  122. package/src/http/loopback-guard.ts +1 -1
  123. package/src/http/middleware/auth.ts +22 -22
  124. package/src/http/router.ts +1 -1
  125. package/src/http/routes/auto-approve-thresholds-routes.ts +1 -1
  126. package/src/http/routes/cadet-identity.ts +2 -2
  127. package/src/http/routes/channel-admission-policy-routes.ts +2 -2
  128. package/src/http/routes/channel-ingress-routes.ts +3 -3
  129. package/src/http/routes/channel-ingress.test.ts +13 -2
  130. package/src/http/routes/channel-permission-overrides-routes.ts +3 -3
  131. package/src/http/routes/channel-verification-session-proxy.ts +8 -22
  132. package/src/http/routes/{platform-push-proxy.test.ts → cloud-push-proxy.test.ts} +21 -22
  133. package/src/http/routes/{platform-push-proxy.ts → cloud-push-proxy.ts} +13 -14
  134. package/src/http/routes/contacts-control-plane-proxy.ts +3 -3
  135. package/src/http/routes/contacts-control-plane-routes.ts +5 -5
  136. package/src/http/routes/email-webhook.test.ts +2 -3
  137. package/src/http/routes/email-webhook.ts +4 -4
  138. package/src/http/routes/feature-flags.ts +1 -1
  139. package/src/http/routes/guardian-channel-create.ts +3 -3
  140. package/src/http/routes/guardian-pin.ts +9 -9
  141. package/src/http/routes/inbound-register.ts +2 -2
  142. package/src/http/routes/ingress-domains.test.ts +129 -0
  143. package/src/http/routes/ingress-domains.ts +73 -0
  144. package/src/http/routes/live-voice-websocket.ts +2 -2
  145. package/src/http/routes/log-export.test.ts +0 -1
  146. package/src/http/routes/log-tail.test.ts +0 -1
  147. package/src/http/routes/migration-proxy.ts +1 -1
  148. package/src/http/routes/plugin-webhook-websocket.test.ts +3 -3
  149. package/src/http/routes/plugin-webhook.test.ts +9 -8
  150. package/src/http/routes/plugin-webhook.ts +1 -1
  151. package/src/http/routes/speech-relay-websocket.ts +8 -11
  152. package/src/http/routes/stt-stream-websocket.ts +1 -1
  153. package/src/http/routes/telegram-webhook.test.ts +0 -1
  154. package/src/http/routes/trust-rules-routes.ts +2 -2
  155. package/src/http/routes/twilio-voice-verify-callback.ts +3 -3
  156. package/src/http/routes/twilio-voice-webhook.test.ts +3 -4
  157. package/src/http/routes/twilio-voice-webhook.ts +3 -3
  158. package/src/http/routes/whatsapp-webhook.test.ts +0 -1
  159. package/src/index.ts +57 -56
  160. package/src/ipc/credential-request-handlers.ts +4 -4
  161. package/src/ipc/debug-export-handlers.test.ts +0 -1
  162. package/src/ipc/log-tail-handlers.test.ts +0 -1
  163. package/src/ipc/risk-classification-handlers.test.ts +4 -4
  164. package/src/ipc/risk-classification-handlers.ts +2 -2
  165. package/src/remote-feature-flag-sync.ts +17 -19
  166. package/src/risk/command-registry/commands/assistant.ts +2 -2
  167. package/src/risk/skill-risk-classifier.test.ts +24 -24
  168. package/src/risk/skill-risk-classifier.ts +10 -10
  169. package/src/runtime/client.ts +17 -17
  170. package/src/schema.ts +29 -29
  171. package/src/telegram/send.test.ts +0 -1
  172. package/src/telegram/webhook-manager.ts +33 -38
  173. package/src/tunnel/allowed-paths.test.ts +3 -3
  174. package/src/tunnel/allowed-paths.ts +1 -1
  175. package/src/tunnel/client.test.ts +20 -21
  176. package/src/tunnel/client.ts +16 -17
  177. package/src/verification/shared-invite-registration.ts +22 -17
  178. package/src/version.ts +1 -1
  179. package/src/platform-url.ts +0 -24
@@ -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
 
@@ -34,7 +34,7 @@ export const VERIFIED_VIA_CHALLENGE = "challenge";
34
34
  /** `verified_via` written when the guardian direct-trusts a workspace-vouched identity. */
35
35
  export const VERIFIED_VIA_MANUAL = "manual";
36
36
 
37
- /** `verified_via` written when the guardian trusts an identity the platform is not vouching for. */
37
+ /** `verified_via` written when the guardian trusts an identity the cloud is not vouching for. */
38
38
  export const VERIFIED_VIA_CHANNEL_CLAIM = "manual_channel_claim";
39
39
 
40
40
  // ---------------------------------------------------------------------------
@@ -48,10 +48,10 @@ export const VERIFIED_VIA_CHANNEL_CLAIM = "manual_channel_claim";
48
48
  *
49
49
  * - `verified_handshake` — the contact proved control of the channel by
50
50
  * returning a verification code (`verified_via: "challenge"`).
51
- * - `internal_workspace_match` — the platform authenticated the identity inside
51
+ * - `internal_workspace_match` — the cloud authenticated the identity inside
52
52
  * the guardian's own workspace; the guardian vouches directly
53
53
  * (`verified_via: "manual"`).
54
- * - `inbound_channel_claim` — the guardian trusts an identity the platform is
54
+ * - `inbound_channel_claim` — the guardian trusts an identity the cloud is
55
55
  * NOT vouching for (`verified_via: "manual_channel_claim"`).
56
56
  */
57
57
  export type BindingStrength =
@@ -101,7 +101,7 @@ const PROVEN_VERIFIED_VIA: ReadonlySet<string> = new Set([
101
101
  "invite", // redeemed an invite code / token
102
102
  "voice", // returned a voice (DTMF) code
103
103
  "bootstrap", // guardian binding (also protected by the guardian-downgrade guard)
104
- "platform_auto_register", // guardian binding auto-registered by the platform
104
+ "platform_auto_register", // guardian binding auto-registered by the cloud
105
105
  "webhook_registration", // guardian binding registered via a provider webhook
106
106
  ]);
107
107
 
@@ -112,7 +112,7 @@ const PROVEN_VERIFIED_VIA: ReadonlySet<string> = new Set([
112
112
  * PRD (D4) may land on:
113
113
  *
114
114
  * 3 proven / possession — {@link PROVEN_VERIFIED_VIA}.
115
- * 2 workspace-vouched — the platform authenticated the identity but the
115
+ * 2 workspace-vouched — the cloud authenticated the identity but the
116
116
  * actor did not actively prove control here (`manual`).
117
117
  * 1 inbound channel claim — nobody vouches; the guardian trusted an
118
118
  * unproven claim (`manual_channel_claim`).
@@ -483,7 +483,7 @@ export type RegisterWebhookRouteIpcParams = z.infer<
483
483
  /**
484
484
  * A refusal is a normal result rather than an error: the daemon reads
485
485
  * `disabled` as "this assistant is not serving its own webhooks" and falls
486
- * back to the platform's callback routes.
486
+ * back to the cloud's callback routes.
487
487
  */
488
488
  export const RegisterWebhookRouteIpcResponseSchema = z.union([
489
489
  z.object({ disabled: z.literal(true) }),
@@ -85,7 +85,7 @@ export const SourceMetadataSchema = z
85
85
  commandIntent: CommandIntentSchema.optional(),
86
86
  /**
87
87
  * Whether the message addresses the assistant by name, an @-mention on
88
- * the platforms that have one. Stated by the channel's normalizer only
88
+ * the clouds that have one. Stated by the channel's normalizer only
89
89
  * where it proved the answer; absent means "not established". Read to
90
90
  * decide whether a reply is expected before any text exists, never to
91
91
  * admit or deny: admission is the gate's job, upstream of this.
@@ -154,7 +154,7 @@ export const SourceMetadataSchema = z
154
154
  */
155
155
  trustVerdict: TrustVerdictSchema.optional(),
156
156
  /**
157
- * The platform named no actor for this event; the actor id is the
157
+ * The cloud named no actor for this event; the actor id is the
158
158
  * channel's synthetic system identity, never an identity claim.
159
159
  */
160
160
  actorUnattributed: z.boolean().optional(),
@@ -6,7 +6,7 @@
6
6
  * them to the channel transport its callback URL names
7
7
  * (`messaging/providers`). `/deliver/{channel}` is only that callback URL's
8
8
  * addressing form: no service serves it. A callback URL no
9
- * transport owns (a managed callback carrying a `callback_token`) is POSTed
9
+ * transport owns (a cloud callback carrying a `callback_token`) is POSTed
10
10
  * over HTTP by `http-delivery.ts` instead.
11
11
  *
12
12
  * The gateway sends through the same transports, never to a provider itself:
@@ -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/openapi.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Cadet Gateway API",
5
- "version": "0.12.6",
5
+ "version": "0.12.8",
6
6
  "description": "Auto-generated OpenAPI specification for the Cadet Gateway HTTP endpoints."
7
7
  },
8
- "servers": [{ "url": "", "description": "Same-origin (gateway)" }],
8
+ "servers": [{ "url": "", "description": "Same-origin — the gateway" }],
9
9
  "paths": {
10
10
  "/v1/permissions/thresholds": {
11
11
  "get": {
@@ -105,7 +105,7 @@
105
105
  "operationId": "conversationThresholdGet",
106
106
  "summary": "Get a conversation's threshold override",
107
107
  "tags": ["permissions"],
108
- "description": "Returns { threshold: null } when no override exists. (Gateways predating that behavior returned 404 for the same condition; clients tolerate both during rollout.)",
108
+ "description": "Returns { threshold: null } when no override exists. Gateways predating that behavior returned 404 for the same condition; clients tolerate both during rollout.",
109
109
  "parameters": [
110
110
  {
111
111
  "name": "conversation_id",
@@ -209,7 +209,7 @@
209
209
  "operationId": "channelAdmissionPolicyList",
210
210
  "summary": "List per-channel admission floors",
211
211
  "tags": ["channel-admission-policy"],
212
- "description": "Returns one entry per enforced channel (exempt and hidden channels are omitted), seeded with defaults for channels without a stored row.",
212
+ "description": "Returns one entry per enforced channel, excluding exempt and hidden channels, seeded with defaults for channels without a stored row.",
213
213
  "responses": {
214
214
  "200": {
215
215
  "description": "Successful response",
@@ -272,7 +272,7 @@
272
272
  "in": "path",
273
273
  "required": true,
274
274
  "schema": { "type": "string" },
275
- "description": "The channel type (e.g. slack)"
275
+ "description": "The channel type, e.g. slack"
276
276
  }
277
277
  ],
278
278
  "requestBody": {
@@ -452,7 +452,7 @@
452
452
  "in": "path",
453
453
  "required": true,
454
454
  "schema": { "type": "string" },
455
- "description": "The declaring ingress source (today, a plugin name)"
455
+ "description": "The declaring ingress source, today a plugin name"
456
456
  }
457
457
  ],
458
458
  "requestBody": {
@@ -502,7 +502,7 @@
502
502
  "in": "path",
503
503
  "required": true,
504
504
  "schema": { "type": "string" },
505
- "description": "The declaring ingress source (today, a plugin name)"
505
+ "description": "The declaring ingress source, today a plugin name"
506
506
  }
507
507
  ],
508
508
  "responses": {
@@ -530,7 +530,7 @@
530
530
  "operationId": "channelPermissionOverridesList",
531
531
  "summary": "List channel-permission matrix cells",
532
532
  "tags": ["channel-permission-overrides"],
533
- "description": "Returns every persisted cell (cascade selector × contact-type → RiskThreshold). Unset cells fall through the cascade; the list contains only explicit overrides.",
533
+ "description": "Returns every persisted cell in the cascade selector × contact-type → RiskThreshold map. Unset cells fall through the cascade; the list contains only explicit overrides.",
534
534
  "responses": {
535
535
  "200": {
536
536
  "description": "Successful response",
@@ -854,7 +854,7 @@
854
854
  "operationId": "channelPermissionResolve",
855
855
  "summary": "Resolve the effective channel-permission threshold",
856
856
  "tags": ["channel-permission-overrides"],
857
- "description": "Read-only cascade resolution for one coordinate: walks channel → channel_type → adapter → workspace for the given selector keys and contact-type, returning the winning cell's threshold and scope, or null when no cell matches (the caller then falls through to the global thresholds). Same resolver the runtime evaluator uses over IPC.",
857
+ "description": "Read-only cascade resolution for one coordinate: walks channel → channel_type → adapter → workspace for the given selector keys and contact-type, returning the winning cell's threshold and scope, or null when no cell matches, in which case the caller falls through to the global thresholds. Same resolver the runtime evaluator uses over IPC.",
858
858
  "requestBody": {
859
859
  "required": true,
860
860
  "content": {
@@ -931,7 +931,7 @@
931
931
  "operationId": "channelPermissionOverrideDelete",
932
932
  "summary": "Delete a channel-permission matrix cell",
933
933
  "tags": ["channel-permission-overrides"],
934
- "description": "Removes one cell by its composite key (selector × contact-type), letting the next cascade tier up win. Returns whether a cell was removed.",
934
+ "description": "Removes one cell by its composite key, selector × contact-type, letting the next cascade tier up win. Returns whether a cell was removed.",
935
935
  "requestBody": {
936
936
  "required": true,
937
937
  "content": {
@@ -1027,7 +1027,7 @@
1027
1027
  "operationId": "contactsUpsert",
1028
1028
  "summary": "Create or update a contact",
1029
1029
  "tags": ["contacts"],
1030
- "description": "Gateway-native contact upsert (dual-writes the gateway ACL store and the assistant info mirror). Matches by id, then by any provided (type, address) channel, else creates.",
1030
+ "description": "Gateway-native contact upsert that dual-writes the gateway ACL store and the assistant info mirror. Matches by id, then by the provided type and address channel, else creates.",
1031
1031
  "requestBody": {
1032
1032
  "required": true,
1033
1033
  "content": {
@@ -1085,7 +1085,7 @@
1085
1085
  "address": { "type": "string" },
1086
1086
  "isPrimary": { "type": "boolean" },
1087
1087
  "externalChatId": {
1088
- "description": "Delivery chat id. Omit to preserve the stored value. A legacy explicit null is accepted for compatibility and treated as omitted; clearing is not supported (a stored null is indistinguishable from never-learned, so no consumer could tell a clear from a gap).",
1088
+ "description": "Delivery chat id. Omit to preserve the stored value. A legacy explicit null is accepted for compatibility and treated as omitted; clearing is not supported: a stored null is indistinguishable from never-learned, so no consumer could tell a clear from a gap.",
1089
1089
  "type": "string"
1090
1090
  },
1091
1091
  "status": { "type": "string" },
@@ -1141,7 +1141,7 @@
1141
1141
  },
1142
1142
  { "type": "null" }
1143
1143
  ],
1144
- "description": "Per-contact auto-approve ceiling. Null means unset (inherit cascade)."
1144
+ "description": "Per-contact auto-approve ceiling. Null means unset, inheriting the cascade."
1145
1145
  },
1146
1146
  "assistantMetadata": {
1147
1147
  "anyOf": [
@@ -1184,7 +1184,7 @@
1184
1184
  },
1185
1185
  "externalUserId": {
1186
1186
  "type": "string",
1187
- "description": "Compat alias for address (older macOS clients)"
1187
+ "description": "Compat alias for address, for older macOS clients"
1188
1188
  },
1189
1189
  "status": {
1190
1190
  "anyOf": [
@@ -1479,7 +1479,7 @@
1479
1479
  "operationId": "contactChannelVerify",
1480
1480
  "summary": "Manually verify a contact channel",
1481
1481
  "tags": ["contacts"],
1482
- "description": "Guardian-only manual attestation: marks the channel active/verified in the gateway store (source of truth) with a best-effort assistant mirror. Idempotent.",
1482
+ "description": "Guardian-only manual attestation: marks the channel active/verified in the gateway store, the source of truth, with a best-effort assistant mirror. Idempotent.",
1483
1483
  "parameters": [
1484
1484
  {
1485
1485
  "name": "channel_id",
@@ -1828,7 +1828,7 @@
1828
1828
  "in": "query",
1829
1829
  "required": false,
1830
1830
  "schema": { "type": "string" },
1831
- "description": "Filter by origin (default | user_defined)"
1831
+ "description": "Filter by origin: default or user_defined"
1832
1832
  },
1833
1833
  {
1834
1834
  "name": "tool",
@@ -1929,7 +1929,7 @@
1929
1929
  },
1930
1930
  "description": { "type": "string", "minLength": 1 },
1931
1931
  "scope": {
1932
- "description": "Compatibility field. Trust rules apply workspace-wide: the engine matches on (tool, pattern) only, so a narrower scope cannot be honored and any value other than \"everywhere\" is rejected rather than stored broader than the consent it records.",
1932
+ "description": "Compatibility field. Trust rules apply workspace-wide: the engine matches on tool and pattern only, so a narrower scope cannot be honored and any value other than \"everywhere\" is rejected rather than stored broader than the consent it records.",
1933
1933
  "type": "string",
1934
1934
  "const": "everywhere"
1935
1935
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/gateway",
3
- "version": "0.12.7",
3
+ "version": "0.12.9",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -126,7 +126,7 @@ function buildSpec(version: string) {
126
126
  description:
127
127
  "Auto-generated OpenAPI specification for the Cadet Gateway HTTP endpoints.",
128
128
  },
129
- servers: [{ url: "", description: "Same-origin (gateway)" }],
129
+ servers: [{ url: "", description: "Same-origin — the gateway" }],
130
130
  paths,
131
131
  });
132
132
  }
@@ -251,7 +251,6 @@ describe("runtime proxy enforcement", () => {
251
251
  routingEntries: [],
252
252
  port: 7830,
253
253
  runtimeProxyRequireAuth: true,
254
- shutdownDrainMs: 5000,
255
254
  runtimeTimeoutMs: 30000,
256
255
  runtimeMaxRetries: 2,
257
256
  runtimeInitialBackoffMs: 500,
@@ -1,7 +1,7 @@
1
1
  import { afterEach, expect, mock, test } from "bun:test";
2
2
 
3
3
  let exportRequested = false;
4
- const originalIsPlatform = process.env.IS_PLATFORM;
4
+ const originalIsPlatform = process.env.IS_CLOUD;
5
5
 
6
6
  mock.module("../config-file-utils.js", () => ({
7
7
  readConfigFileOrEmpty: () => ({
@@ -23,15 +23,15 @@ mock.module("../fetch.js", () => ({
23
23
 
24
24
  afterEach(() => {
25
25
  if (originalIsPlatform === undefined) {
26
- delete process.env.IS_PLATFORM;
26
+ delete process.env.IS_CLOUD;
27
27
  } else {
28
- process.env.IS_PLATFORM = originalIsPlatform;
28
+ process.env.IS_CLOUD = originalIsPlatform;
29
29
  }
30
30
  mock.restore();
31
31
  });
32
32
 
33
33
  test("platform mode disables the backup worker", async () => {
34
- process.env.IS_PLATFORM = "true";
34
+ process.env.IS_CLOUD = "true";
35
35
  const { startBackupWorker } = await import("../backup/backup-worker.js");
36
36
 
37
37
  const worker = startBackupWorker({
@@ -26,7 +26,6 @@ function makeConfig(overrides: Partial<GatewayConfig> = {}): GatewayConfig {
26
26
  routingEntries: [],
27
27
  port: 7830,
28
28
  runtimeProxyRequireAuth: true,
29
- shutdownDrainMs: 5000,
30
29
  runtimeTimeoutMs: 30000,
31
30
  runtimeMaxRetries: 2,
32
31
  runtimeInitialBackoffMs: 500,