@mycadet/assistant 0.12.10 → 0.13.0-dev.202610171617.9ea363e

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 (243) hide show
  1. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/__tests__/ingress.test.ts +10 -10
  2. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/channels.ts +0 -1
  3. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/ingress.ts +3 -3
  4. package/node_modules/@mycadet/ces-client/src/http-credentials.ts +18 -1
  5. package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/__tests__/ingress.test.ts +10 -10
  6. package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/channels.ts +0 -1
  7. package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/ingress.ts +3 -3
  8. package/node_modules/@mycadet/gateway-client/src/admission-policy-contract.ts +1 -2
  9. package/node_modules/@mycadet/gateway-client/src/gateway-ipc-contracts.ts +0 -20
  10. package/node_modules/@mycadet/service-contracts/src/__tests__/ingress.test.ts +10 -10
  11. package/node_modules/@mycadet/service-contracts/src/channels.ts +0 -1
  12. package/node_modules/@mycadet/service-contracts/src/ingress.ts +3 -3
  13. package/openapi.yaml +3 -942
  14. package/package.json +6 -3
  15. package/scripts/build-plugin-api.ts +6 -0
  16. package/scripts/sync-web-search-catalog.ts +1 -2
  17. package/src/__tests__/cloud-profile-guard.test.ts +41 -5
  18. package/src/__tests__/config-schema.test.ts +6 -38
  19. package/src/__tests__/conversation-pairing.test.ts +0 -247
  20. package/src/__tests__/conversation-queue.test.ts +45 -6
  21. package/src/__tests__/db-readiness-http-gate.test.ts +0 -6
  22. package/src/__tests__/emit-signal-routing-intent.test.ts +0 -157
  23. package/src/__tests__/feature-flag-test-helpers.ts +0 -18
  24. package/src/__tests__/persist-onboarding-artifacts.test.ts +0 -1
  25. package/src/__tests__/persona-resolver.test.ts +0 -51
  26. package/src/__tests__/provider-cloud-proxy-integration.test.ts +2 -110
  27. package/src/__tests__/run-due-schedules.test.ts +0 -4
  28. package/src/__tests__/schedule-store.test.ts +0 -12
  29. package/src/__tests__/stt-stream-session.test.ts +4 -4
  30. package/src/__tests__/telephony-tts-guard.test.ts +2 -50
  31. package/src/__tests__/voice-config-update.test.ts +12 -167
  32. package/src/__tests__/web-search-catalog-parity.test.ts +0 -2
  33. package/src/__tests__/workspace-migration-130-speech-mode-to-provider.test.ts +9 -7
  34. package/src/__tests__/workspace-migration-132-web-search-mode-to-provider.test.ts +6 -6
  35. package/src/calls/__tests__/voice-session-bridge.test.ts +1 -4
  36. package/src/calls/resolve-call-tts-provider.ts +6 -25
  37. package/src/calls/telephony-credential-preflight.ts +0 -10
  38. package/src/calls/telephony-tts-capability.ts +1 -17
  39. package/src/channels/config.ts +0 -6
  40. package/src/channels/types.ts +0 -13
  41. package/src/cli/commands/tts.ts +1 -2
  42. package/src/cli/index.help.ts +0 -2
  43. package/src/cli/program.ts +0 -2
  44. package/src/config/bundled-skills/settings/tools/voice-config-update.ts +4 -42
  45. package/src/config/feature-flag-registry.json +0 -130
  46. package/src/config/schema.ts +0 -2
  47. package/src/config/schemas/__tests__/stt.test.ts +10 -14
  48. package/src/config/schemas/channels.ts +0 -9
  49. package/src/config/schemas/llm.ts +3 -5
  50. package/src/config/schemas/services.ts +5 -6
  51. package/src/config/schemas/stt.ts +1 -3
  52. package/src/config/schemas/tts.ts +1 -30
  53. package/src/contacts/mirror-reconciler.ts +2 -2
  54. package/src/daemon/daemon-readiness.ts +4 -29
  55. package/src/daemon/lifecycle.ts +0 -31
  56. package/src/daemon/providers-setup.ts +0 -8
  57. package/src/heartbeat/__tests__/heartbeat-service.test.ts +0 -1
  58. package/src/heartbeat/heartbeat-service.ts +1 -66
  59. package/src/ipc/__tests__/db-readiness-ipc-gate.test.ts +1 -9
  60. package/src/live-voice/__tests__/live-voice-credential-preflight.test.ts +0 -44
  61. package/src/live-voice/__tests__/live-voice-flux-turn-end.test.ts +4 -6
  62. package/src/live-voice/__tests__/live-voice-stt.test.ts +1 -1
  63. package/src/live-voice/live-voice-credential-preflight.ts +9 -33
  64. package/src/live-voice/live-voice-session.ts +10 -6
  65. package/src/live-voice/live-voice-tts.ts +1 -8
  66. package/src/messaging/providers/__tests__/callback-routing.test.ts +0 -1
  67. package/src/messaging/providers/__tests__/transport-dispatch.test.ts +1 -16
  68. package/src/messaging/providers/callback-routing.ts +0 -1
  69. package/src/messaging/providers/index.ts +0 -2
  70. package/src/notifications/__tests__/broadcaster.test.ts +0 -259
  71. package/src/notifications/__tests__/completion-policy.test.ts +0 -37
  72. package/src/notifications/__tests__/home-feed-side-effect.test.ts +1 -815
  73. package/src/notifications/broadcaster.ts +7 -65
  74. package/src/notifications/completion-policy.ts +1 -7
  75. package/src/notifications/conversation-pairing.ts +1 -13
  76. package/src/notifications/emit-signal.ts +0 -28
  77. package/src/notifications/home-feed-side-effect.ts +2 -40
  78. package/src/notifications/signal.ts +0 -1
  79. package/src/persistence/conversation-queries.ts +2 -117
  80. package/src/persistence/conversation-types.ts +0 -35
  81. package/src/persistence/schema/index.ts +0 -1
  82. package/src/plugins/defaults/memory/worker.ts +3 -3
  83. package/src/prompts/persona-resolver.ts +0 -35
  84. package/src/providers/__tests__/search-provider-catalog.test.ts +5 -8
  85. package/src/providers/__tests__/voice-error-copy.test.ts +9 -10
  86. package/src/providers/search-provider-catalog.ts +7 -39
  87. package/src/providers/speech-to-text/__tests__/provider-catalog.test.ts +3 -47
  88. package/src/providers/speech-to-text/__tests__/resolve.test.ts +6 -372
  89. package/src/providers/speech-to-text/provider-catalog.ts +2 -73
  90. package/src/providers/speech-to-text/resolve.ts +3 -120
  91. package/src/runtime/auth/__tests__/route-policy.test.ts +0 -3
  92. package/src/runtime/http-router-types.ts +1 -3
  93. package/src/runtime/http-server.ts +1 -1
  94. package/src/runtime/routes/__tests__/conversation-query-routes.test.ts +13 -11
  95. package/src/runtime/routes/__tests__/tts-routes.test.ts +2 -6
  96. package/src/runtime/routes/channel-availability-routes.ts +0 -5
  97. package/src/runtime/routes/conversation-list-routes.ts +2 -42
  98. package/src/runtime/routes/conversation-query-routes.ts +0 -96
  99. package/src/runtime/routes/inbound-message-handler.ts +2 -2
  100. package/src/runtime/routes/inbound-stages/admission-policy.test.ts +0 -11
  101. package/src/runtime/routes/inbound-stages/transcribe-audio.test.ts +7 -7
  102. package/src/runtime/routes/index.ts +0 -6
  103. package/src/runtime/routes/live-voice-routes.test.ts +4 -11
  104. package/src/runtime/routes/live-voice-routes.ts +8 -11
  105. package/src/runtime/routes/secret-routes.ts +0 -6
  106. package/src/runtime/routes/tts-routes.ts +0 -38
  107. package/src/schedule/__tests__/plugin-schedule-reconciler.test.ts +1 -7
  108. package/src/schedule/__tests__/worker-mcp-readiness.test.ts +0 -4
  109. package/src/schedule/schedule-store.ts +0 -7
  110. package/src/schedule/scheduler.ts +0 -5
  111. package/src/schedule/worker.ts +1 -1
  112. package/src/stt/__tests__/daemon-batch-transcriber.test.ts +2 -10
  113. package/src/stt/daemon-batch-transcriber.ts +4 -38
  114. package/src/stt/types.ts +1 -9
  115. package/src/tools/network/__tests__/web-search.test.ts +3 -250
  116. package/src/tools/network/web-search.ts +4 -165
  117. package/src/tts/__tests__/provider-resolution.test.ts +0 -5
  118. package/src/tts/provider-catalog.ts +0 -4
  119. package/src/tts/types.ts +0 -1
  120. package/src/__tests__/cloud-speech-defaults.test.ts +0 -330
  121. package/src/__tests__/migration-cross-version-compatibility.test.ts +0 -1708
  122. package/src/__tests__/migration-export-http.test.ts +0 -557
  123. package/src/__tests__/migration-export-streaming.test.ts +0 -350
  124. package/src/__tests__/migration-export-to-gcs.test.ts +0 -706
  125. package/src/__tests__/migration-import-commit-http.test.ts +0 -1176
  126. package/src/__tests__/migration-import-from-gcs.test.ts +0 -534
  127. package/src/__tests__/migration-import-from-path.test.ts +0 -324
  128. package/src/__tests__/migration-import-from-url.test.ts +0 -588
  129. package/src/__tests__/migration-import-preflight-http.test.ts +0 -739
  130. package/src/__tests__/migration-jobs-status.test.ts +0 -139
  131. package/src/__tests__/migration-parity-persistence.test.ts +0 -1891
  132. package/src/__tests__/migration-transport.test.ts +0 -1089
  133. package/src/__tests__/migration-validate-http.test.ts +0 -634
  134. package/src/__tests__/migration-wizard.test.ts +0 -1395
  135. package/src/__tests__/rebind-secrets-screen.test.ts +0 -876
  136. package/src/__tests__/sanitize-config-for-transfer.test.ts +0 -259
  137. package/src/__tests__/transfer-progress-screen.test.ts +0 -1217
  138. package/src/__tests__/validation-results-screen.test.ts +0 -1130
  139. package/src/__tests__/vbundle-pax-and-symlink.test.ts +0 -147
  140. package/src/a2a/__tests__/agent-card.test.ts +0 -82
  141. package/src/a2a/__tests__/e2e-a2a-channel.test.ts +0 -595
  142. package/src/a2a/__tests__/protocol-helpers.test.ts +0 -113
  143. package/src/a2a/__tests__/task-store.test.ts +0 -237
  144. package/src/a2a/agent-card.ts +0 -52
  145. package/src/a2a/feature-gate.ts +0 -8
  146. package/src/a2a/protocol-constants.ts +0 -21
  147. package/src/a2a/protocol-errors.ts +0 -50
  148. package/src/a2a/protocol-types.ts +0 -162
  149. package/src/a2a/task-store.ts +0 -168
  150. package/src/background-wake/background-wake-routes.test.ts +0 -906
  151. package/src/background-wake/cloud-client.test.ts +0 -328
  152. package/src/background-wake/cloud-client.ts +0 -196
  153. package/src/background-wake/next-wake.test.ts +0 -335
  154. package/src/background-wake/next-wake.ts +0 -188
  155. package/src/background-wake/publisher.ts +0 -93
  156. package/src/background-wake/wake-intent-hooks.test.ts +0 -234
  157. package/src/cli/commands/__tests__/backup.test.ts +0 -363
  158. package/src/cli/commands/backup.help.ts +0 -180
  159. package/src/cli/commands/backup.ts +0 -398
  160. package/src/cloud/cloud-speech.test.ts +0 -335
  161. package/src/cloud/cloud-speech.ts +0 -300
  162. package/src/config/__tests__/assistant-initiated-threads-gate.test.ts +0 -60
  163. package/src/config/assistant-initiated-threads-gate.ts +0 -50
  164. package/src/config/cloud-speech-defaults.ts +0 -300
  165. package/src/config/sanitize-for-transfer.ts +0 -111
  166. package/src/daemon/handlers/__tests__/config-a2a-accept.test.ts +0 -532
  167. package/src/daemon/handlers/__tests__/config-a2a-complete.test.ts +0 -250
  168. package/src/daemon/handlers/__tests__/config-a2a-invite.test.ts +0 -160
  169. package/src/daemon/handlers/__tests__/config-a2a-redeem.test.ts +0 -144
  170. package/src/daemon/handlers/__tests__/config-a2a.test.ts +0 -88
  171. package/src/daemon/handlers/config-a2a.ts +0 -517
  172. package/src/live-voice/__tests__/live-voice-cloud-speech-fallback.test.ts +0 -250
  173. package/src/messaging/providers/a2a/__tests__/deliver.test.ts +0 -278
  174. package/src/messaging/providers/a2a/deliver.ts +0 -162
  175. package/src/messaging/providers/a2a/transport.ts +0 -10
  176. package/src/notifications/__tests__/assistant-initiated-thread.test.ts +0 -254
  177. package/src/notifications/__tests__/from-me-alert-integration.test.ts +0 -192
  178. package/src/notifications/assistant-initiated-thread.ts +0 -101
  179. package/src/persistence/a2a-invite-store.ts +0 -202
  180. package/src/persistence/schema/a2a.ts +0 -29
  181. package/src/providers/speech-to-text/__tests__/cadet-cloud-realtime.test.ts +0 -457
  182. package/src/providers/speech-to-text/__tests__/cadet-cloud.test.ts +0 -271
  183. package/src/providers/speech-to-text/__tests__/cadet-speech-relay-connection.test.ts +0 -126
  184. package/src/providers/speech-to-text/cadet-cloud-flux-realtime.ts +0 -309
  185. package/src/providers/speech-to-text/cadet-cloud-realtime.ts +0 -315
  186. package/src/providers/speech-to-text/cadet-cloud.ts +0 -108
  187. package/src/providers/speech-to-text/cadet-speech-relay-connection.ts +0 -176
  188. package/src/runtime/migrations/__tests__/gcs-signed-url.test.ts +0 -254
  189. package/src/runtime/migrations/__tests__/job-registry.test.ts +0 -346
  190. package/src/runtime/migrations/__tests__/origin-mode.test.ts +0 -62
  191. package/src/runtime/migrations/__tests__/rebind-secrets-credentials.test.ts +0 -184
  192. package/src/runtime/migrations/__tests__/staged-import-path.test.ts +0 -110
  193. package/src/runtime/migrations/__tests__/v1-test-helpers.ts +0 -112
  194. package/src/runtime/migrations/__tests__/vbundle-builder-credentials.test.ts +0 -285
  195. package/src/runtime/migrations/__tests__/vbundle-builder-fd-leak.test.ts +0 -126
  196. package/src/runtime/migrations/__tests__/vbundle-builder-v1-shape.test.ts +0 -253
  197. package/src/runtime/migrations/__tests__/vbundle-import-credentials.test.ts +0 -208
  198. package/src/runtime/migrations/__tests__/vbundle-import-parity.test.ts +0 -485
  199. package/src/runtime/migrations/__tests__/vbundle-import-policy.test.ts +0 -349
  200. package/src/runtime/migrations/__tests__/vbundle-import-version-compat.test.ts +0 -196
  201. package/src/runtime/migrations/__tests__/vbundle-legacy-user-md.test.ts +0 -551
  202. package/src/runtime/migrations/__tests__/vbundle-metadata-merge-integration.test.ts +0 -428
  203. package/src/runtime/migrations/__tests__/vbundle-metadata-merge.test.ts +0 -220
  204. package/src/runtime/migrations/__tests__/vbundle-streaming-importer.test.ts +0 -1823
  205. package/src/runtime/migrations/__tests__/vbundle-streaming-validator.test.ts +0 -598
  206. package/src/runtime/migrations/__tests__/vbundle-symlink-importer.test.ts +0 -463
  207. package/src/runtime/migrations/__tests__/vbundle-symlink-streaming-importer.test.ts +0 -538
  208. package/src/runtime/migrations/__tests__/vbundle-symlink-streaming.test.ts +0 -515
  209. package/src/runtime/migrations/__tests__/vbundle-symlink-tar.test.ts +0 -453
  210. package/src/runtime/migrations/__tests__/vbundle-symlink-walker.test.ts +0 -319
  211. package/src/runtime/migrations/__tests__/vbundle-tar-stream.test.ts +0 -240
  212. package/src/runtime/migrations/__tests__/vbundle-validator-v1-schema.test.ts +0 -473
  213. package/src/runtime/migrations/gcs-signed-url.ts +0 -190
  214. package/src/runtime/migrations/job-registry.ts +0 -297
  215. package/src/runtime/migrations/migration-transport.ts +0 -612
  216. package/src/runtime/migrations/migration-wizard.ts +0 -747
  217. package/src/runtime/migrations/origin-mode.ts +0 -42
  218. package/src/runtime/migrations/rebind-secrets-screen.ts +0 -412
  219. package/src/runtime/migrations/staged-import-path.ts +0 -116
  220. package/src/runtime/migrations/transfer-progress-screen.ts +0 -323
  221. package/src/runtime/migrations/validation-results-screen.ts +0 -469
  222. package/src/runtime/migrations/vbundle-builder.ts +0 -1382
  223. package/src/runtime/migrations/vbundle-import-analyzer.ts +0 -405
  224. package/src/runtime/migrations/vbundle-import-policy.ts +0 -241
  225. package/src/runtime/migrations/vbundle-importer.ts +0 -826
  226. package/src/runtime/migrations/vbundle-metadata-merge.ts +0 -113
  227. package/src/runtime/migrations/vbundle-streaming-importer.ts +0 -2844
  228. package/src/runtime/migrations/vbundle-streaming-validator.ts +0 -426
  229. package/src/runtime/migrations/vbundle-tar-stream.ts +0 -244
  230. package/src/runtime/migrations/vbundle-validator.ts +0 -724
  231. package/src/runtime/routes/__tests__/conversation-list-assistant-section.test.ts +0 -358
  232. package/src/runtime/routes/__tests__/migration-cadet-metadata-reconcile.test.ts +0 -227
  233. package/src/runtime/routes/__tests__/migration-export-secrets-redacted.test.ts +0 -54
  234. package/src/runtime/routes/__tests__/migration-import-allowed-hosts-env.test.ts +0 -70
  235. package/src/runtime/routes/__tests__/migration-import-credential-filter.test.ts +0 -257
  236. package/src/runtime/routes/background-wake-routes.ts +0 -387
  237. package/src/runtime/routes/integrations/a2a.ts +0 -331
  238. package/src/runtime/routes/migration-routes.ts +0 -2584
  239. package/src/tools/network/__tests__/cloud-search-proxy.test.ts +0 -282
  240. package/src/tools/network/cloud-search-proxy.ts +0 -211
  241. package/src/tts/__tests__/cadet-provider.test.ts +0 -253
  242. package/src/tts/providers/cadet-provider.ts +0 -244
  243. package/src/types/tar-stream.d.ts +0 -66
@@ -10,7 +10,7 @@ import {
10
10
  trimmedNonEmptyString,
11
11
  TUNNEL_PROVIDERS,
12
12
  type TunnelRecord,
13
- tunnelHostForPlatformHost,
13
+ tunnelHostForCloudHost,
14
14
  } from "../ingress.js";
15
15
  import {
16
16
  buildTwilioMediaStreamUrl,
@@ -19,27 +19,27 @@ import {
19
19
  resolveTwilioPublicBaseUrl,
20
20
  } from "../twilio-ingress.js";
21
21
 
22
- describe("tunnelHostForPlatformHost", () => {
22
+ describe("tunnelHostForCloudHost", () => {
23
23
  test("maps the prod platform host to the prod tunnel", () => {
24
- expect(tunnelHostForPlatformHost("cloud.mycadet.ai")).toBe(
24
+ expect(tunnelHostForCloudHost("cloud.mycadet.ai")).toBe(
25
25
  "tunnel.mycadet.ai",
26
26
  );
27
27
  });
28
28
 
29
29
  test("maps env-prefixed platform hosts to their env tunnel", () => {
30
- expect(tunnelHostForPlatformHost("staging-cloud.mycadet.ai")).toBe(
31
- "tunnel-staging.mycadet.ai",
30
+ expect(tunnelHostForCloudHost("staging-cloud.mycadet.ai")).toBe(
31
+ "staging-tunnel.mycadet.ai",
32
32
  );
33
- expect(tunnelHostForPlatformHost("dev-cloud.mycadet.ai")).toBe(
34
- "tunnel-dev.mycadet.ai",
33
+ expect(tunnelHostForCloudHost("dev-cloud.mycadet.ai")).toBe(
34
+ "dev-tunnel.mycadet.ai",
35
35
  );
36
36
  });
37
37
 
38
38
  test("returns null for hosts outside the deployment convention", () => {
39
- expect(tunnelHostForPlatformHost("localhost")).toBeNull();
40
- expect(tunnelHostForPlatformHost("platform.example.com")).toBeNull();
39
+ expect(tunnelHostForCloudHost("localhost")).toBeNull();
40
+ expect(tunnelHostForCloudHost("platform.example.com")).toBeNull();
41
41
  expect(
42
- tunnelHostForPlatformHost("staging-cloud.mycadet.ai.evil.com"),
42
+ tunnelHostForCloudHost("staging-cloud.mycadet.ai.evil.com"),
43
43
  ).toBeNull();
44
44
  });
45
45
  });
@@ -39,7 +39,6 @@ export const CHANNEL_IDS = [
39
39
  "slack",
40
40
  "email",
41
41
  "platform",
42
- "a2a",
43
42
  "discord",
44
43
  "plugin",
45
44
  // Internal id for conversations a guardian shares with a contact. It has no
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * Map a Cadet Cloud host onto its environment's tunnel host, following the
3
3
  * deployment naming convention (`cloud.mycadet.ai` → `tunnel.mycadet.ai`,
4
- * `{env}-cloud.mycadet.ai` → `tunnel-{env}.mycadet.ai`). Returns null for
4
+ * `{env}-cloud.mycadet.ai` → `{env}-tunnel.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
7
  * cloud-speech transport can't drift.
8
8
  */
9
- export function tunnelHostForPlatformHost(host: string): string | null {
9
+ export function tunnelHostForCloudHost(host: string): string | null {
10
10
  if (host === "cloud.mycadet.ai") {
11
11
  return "tunnel.mycadet.ai";
12
12
  }
13
13
  const match = /^([a-z0-9-]+)-cloud\.mycadet\.ai$/.exec(host);
14
- return match ? `tunnel-${match[1]}.mycadet.ai` : null;
14
+ return match ? `${match[1]}-tunnel.mycadet.ai` : null;
15
15
  }
16
16
 
17
17
  export function normalizePublicBaseUrl(value: unknown): string | undefined {
@@ -143,6 +143,19 @@ export interface CesHttpCredentialClient {
143
143
  // Factory
144
144
  // ---------------------------------------------------------------------------
145
145
 
146
+ function listErrorContext(
147
+ response: Response,
148
+ path: string,
149
+ ): Record<string, unknown> {
150
+ const requestId = response.headers.get("x-ces-error-id");
151
+ return {
152
+ status: response.status,
153
+ method: "GET",
154
+ path,
155
+ ...(requestId && /^[a-f0-9-]{36}$/i.test(requestId) ? { requestId } : {}),
156
+ };
157
+ }
158
+
146
159
  export function createCesHttpCredentialClient(
147
160
  config: CesHttpCredentialConfig,
148
161
  logger: CesHttpLogger,
@@ -298,7 +311,7 @@ export function createCesHttpCredentialClient(
298
311
  if (!res) return { accounts: [], unreachable: true };
299
312
  if (!res.ok) {
300
313
  logger.warn(
301
- { status: res.status },
314
+ listErrorContext(res, "/v1/credentials"),
302
315
  "CES credential list returned non-OK status",
303
316
  );
304
317
  return { accounts: [], unreachable: true };
@@ -399,6 +412,10 @@ export function createCesHttpCredentialClient(
399
412
  return { records: [], unreachable: true };
400
413
  }
401
414
  if (!res.ok) {
415
+ logger.warn(
416
+ listErrorContext(res, "/v1/metadata"),
417
+ "CES metadata list returned non-OK status",
418
+ );
402
419
  return { records: [], unreachable: true };
403
420
  }
404
421
  const data = (await res.json()) as {
@@ -10,7 +10,7 @@ import {
10
10
  trimmedNonEmptyString,
11
11
  TUNNEL_PROVIDERS,
12
12
  type TunnelRecord,
13
- tunnelHostForPlatformHost,
13
+ tunnelHostForCloudHost,
14
14
  } from "../ingress.js";
15
15
  import {
16
16
  buildTwilioMediaStreamUrl,
@@ -19,27 +19,27 @@ import {
19
19
  resolveTwilioPublicBaseUrl,
20
20
  } from "../twilio-ingress.js";
21
21
 
22
- describe("tunnelHostForPlatformHost", () => {
22
+ describe("tunnelHostForCloudHost", () => {
23
23
  test("maps the prod platform host to the prod tunnel", () => {
24
- expect(tunnelHostForPlatformHost("cloud.mycadet.ai")).toBe(
24
+ expect(tunnelHostForCloudHost("cloud.mycadet.ai")).toBe(
25
25
  "tunnel.mycadet.ai",
26
26
  );
27
27
  });
28
28
 
29
29
  test("maps env-prefixed platform hosts to their env tunnel", () => {
30
- expect(tunnelHostForPlatformHost("staging-cloud.mycadet.ai")).toBe(
31
- "tunnel-staging.mycadet.ai",
30
+ expect(tunnelHostForCloudHost("staging-cloud.mycadet.ai")).toBe(
31
+ "staging-tunnel.mycadet.ai",
32
32
  );
33
- expect(tunnelHostForPlatformHost("dev-cloud.mycadet.ai")).toBe(
34
- "tunnel-dev.mycadet.ai",
33
+ expect(tunnelHostForCloudHost("dev-cloud.mycadet.ai")).toBe(
34
+ "dev-tunnel.mycadet.ai",
35
35
  );
36
36
  });
37
37
 
38
38
  test("returns null for hosts outside the deployment convention", () => {
39
- expect(tunnelHostForPlatformHost("localhost")).toBeNull();
40
- expect(tunnelHostForPlatformHost("platform.example.com")).toBeNull();
39
+ expect(tunnelHostForCloudHost("localhost")).toBeNull();
40
+ expect(tunnelHostForCloudHost("platform.example.com")).toBeNull();
41
41
  expect(
42
- tunnelHostForPlatformHost("staging-cloud.mycadet.ai.evil.com"),
42
+ tunnelHostForCloudHost("staging-cloud.mycadet.ai.evil.com"),
43
43
  ).toBeNull();
44
44
  });
45
45
  });
@@ -39,7 +39,6 @@ export const CHANNEL_IDS = [
39
39
  "slack",
40
40
  "email",
41
41
  "platform",
42
- "a2a",
43
42
  "discord",
44
43
  "plugin",
45
44
  // Internal id for conversations a guardian shares with a contact. It has no
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * Map a Cadet Cloud host onto its environment's tunnel host, following the
3
3
  * deployment naming convention (`cloud.mycadet.ai` → `tunnel.mycadet.ai`,
4
- * `{env}-cloud.mycadet.ai` → `tunnel-{env}.mycadet.ai`). Returns null for
4
+ * `{env}-cloud.mycadet.ai` → `{env}-tunnel.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
7
  * cloud-speech transport can't drift.
8
8
  */
9
- export function tunnelHostForPlatformHost(host: string): string | null {
9
+ export function tunnelHostForCloudHost(host: string): string | null {
10
10
  if (host === "cloud.mycadet.ai") {
11
11
  return "tunnel.mycadet.ai";
12
12
  }
13
13
  const match = /^([a-z0-9-]+)-cloud\.mycadet\.ai$/.exec(host);
14
- return match ? `tunnel-${match[1]}.mycadet.ai` : null;
14
+ return match ? `${match[1]}-tunnel.mycadet.ai` : null;
15
15
  }
16
16
 
17
17
  export function normalizePublicBaseUrl(value: unknown): string | undefined {
@@ -52,7 +52,7 @@ export const ADMISSION_FLOOR: Record<AdmissionPolicy, number> = {
52
52
  * Hard-exempt internal channels — never subject to PUT policy, omitted from
53
53
  * GET list, runtime admission stage short-circuits without floor check.
54
54
  *
55
- * `platform` / `a2a` are peer/internal channels with no human-trust model.
55
+ * `platform` is the peer/internal channel with no human-trust model.
56
56
  *
57
57
  * `phone` is NOT exempt — voice ingress enforces the admission floor.
58
58
  *
@@ -62,7 +62,6 @@ export const ADMISSION_FLOOR: Record<AdmissionPolicy, number> = {
62
62
  */
63
63
  export const ADMISSION_POLICY_EXEMPT_CHANNELS: ReadonlySet<string> = new Set([
64
64
  "platform",
65
- "a2a",
66
65
  ]);
67
66
 
68
67
  export function isAdmissionPolicyExemptChannel(channelType: string): boolean {
@@ -68,26 +68,6 @@ export type GatewayLogsTailRouteParams = z.infer<
68
68
  typeof GatewayLogsTailRouteParamsSchema
69
69
  >;
70
70
 
71
- /**
72
- * `gateway_debug_export`: a consistent copy of the gateway database plus its
73
- * recent log files, as one gzipped tar, for a debug bundle. No params.
74
- */
75
- export const GatewayDebugExportIpcParamsSchema = z
76
- .object({})
77
- .strict()
78
- .default({});
79
-
80
- export const GatewayDebugExportIpcResponseSchema = z.object({
81
- ok: z.literal(true),
82
- /** `tar.gz` bytes, base64. Contains gateway.sqlite and gateway-logs/. */
83
- archive_base64: z.string(),
84
- size_bytes: z.number().int().nonnegative(),
85
- });
86
-
87
- export type GatewayDebugExportIpcResponse = z.infer<
88
- typeof GatewayDebugExportIpcResponseSchema
89
- >;
90
-
91
71
  export const GatewayLogsTailIpcResponseSchema = z.object({
92
72
  lines: z.array(z.record(z.string(), z.unknown())),
93
73
  truncated: z.boolean(),
@@ -10,7 +10,7 @@ import {
10
10
  trimmedNonEmptyString,
11
11
  TUNNEL_PROVIDERS,
12
12
  type TunnelRecord,
13
- tunnelHostForPlatformHost,
13
+ tunnelHostForCloudHost,
14
14
  } from "../ingress.js";
15
15
  import {
16
16
  buildTwilioMediaStreamUrl,
@@ -19,27 +19,27 @@ import {
19
19
  resolveTwilioPublicBaseUrl,
20
20
  } from "../twilio-ingress.js";
21
21
 
22
- describe("tunnelHostForPlatformHost", () => {
22
+ describe("tunnelHostForCloudHost", () => {
23
23
  test("maps the prod platform host to the prod tunnel", () => {
24
- expect(tunnelHostForPlatformHost("cloud.mycadet.ai")).toBe(
24
+ expect(tunnelHostForCloudHost("cloud.mycadet.ai")).toBe(
25
25
  "tunnel.mycadet.ai",
26
26
  );
27
27
  });
28
28
 
29
29
  test("maps env-prefixed platform hosts to their env tunnel", () => {
30
- expect(tunnelHostForPlatformHost("staging-cloud.mycadet.ai")).toBe(
31
- "tunnel-staging.mycadet.ai",
30
+ expect(tunnelHostForCloudHost("staging-cloud.mycadet.ai")).toBe(
31
+ "staging-tunnel.mycadet.ai",
32
32
  );
33
- expect(tunnelHostForPlatformHost("dev-cloud.mycadet.ai")).toBe(
34
- "tunnel-dev.mycadet.ai",
33
+ expect(tunnelHostForCloudHost("dev-cloud.mycadet.ai")).toBe(
34
+ "dev-tunnel.mycadet.ai",
35
35
  );
36
36
  });
37
37
 
38
38
  test("returns null for hosts outside the deployment convention", () => {
39
- expect(tunnelHostForPlatformHost("localhost")).toBeNull();
40
- expect(tunnelHostForPlatformHost("platform.example.com")).toBeNull();
39
+ expect(tunnelHostForCloudHost("localhost")).toBeNull();
40
+ expect(tunnelHostForCloudHost("platform.example.com")).toBeNull();
41
41
  expect(
42
- tunnelHostForPlatformHost("staging-cloud.mycadet.ai.evil.com"),
42
+ tunnelHostForCloudHost("staging-cloud.mycadet.ai.evil.com"),
43
43
  ).toBeNull();
44
44
  });
45
45
  });
@@ -39,7 +39,6 @@ export const CHANNEL_IDS = [
39
39
  "slack",
40
40
  "email",
41
41
  "platform",
42
- "a2a",
43
42
  "discord",
44
43
  "plugin",
45
44
  // Internal id for conversations a guardian shares with a contact. It has no
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * Map a Cadet Cloud host onto its environment's tunnel host, following the
3
3
  * deployment naming convention (`cloud.mycadet.ai` → `tunnel.mycadet.ai`,
4
- * `{env}-cloud.mycadet.ai` → `tunnel-{env}.mycadet.ai`). Returns null for
4
+ * `{env}-cloud.mycadet.ai` → `{env}-tunnel.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
7
  * cloud-speech transport can't drift.
8
8
  */
9
- export function tunnelHostForPlatformHost(host: string): string | null {
9
+ export function tunnelHostForCloudHost(host: string): string | null {
10
10
  if (host === "cloud.mycadet.ai") {
11
11
  return "tunnel.mycadet.ai";
12
12
  }
13
13
  const match = /^([a-z0-9-]+)-cloud\.mycadet\.ai$/.exec(host);
14
- return match ? `tunnel-${match[1]}.mycadet.ai` : null;
14
+ return match ? `${match[1]}-tunnel.mycadet.ai` : null;
15
15
  }
16
16
 
17
17
  export function normalizePublicBaseUrl(value: unknown): string | undefined {