@mycadet/gateway 0.13.0 → 0.14.0

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 (410) hide show
  1. package/Dockerfile +1 -0
  2. package/README.md +10 -10
  3. package/eslint.config.mjs +7 -8
  4. package/knip.json +2 -8
  5. package/node_modules/@mycadet/assistant-client/src/__tests__/assistant-client.test.ts +40 -34
  6. package/node_modules/@mycadet/assistant-client/src/http-client.ts +59 -8
  7. package/node_modules/@mycadet/assistant-client/src/index.ts +4 -0
  8. package/node_modules/@mycadet/assistant-client/src/proxy-forward.ts +5 -4
  9. package/node_modules/@mycadet/assistant-client/src/websocket-upstream.ts +21 -31
  10. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/ipc-server-utils/package.json +18 -0
  11. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/ipc-server-utils/src/endpoint.test.ts +36 -0
  12. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/ipc-server-utils/src/endpoint.ts +142 -0
  13. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/ipc-server-utils/src/index.ts +18 -0
  14. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/ipc-server-utils/src/ipc-framing.ts +295 -0
  15. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/ipc-server-utils/src/listen-options.ts +3 -0
  16. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/ipc-server-utils/src/socket-watchdog.test.ts +444 -0
  17. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/ipc-server-utils/src/socket-watchdog.ts +236 -0
  18. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/ipc-server-utils/tsconfig.json +20 -0
  19. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/__tests__/contracts.test.ts +5 -2
  20. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/__tests__/remote-web-pairing.test.ts +17 -14
  21. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/channels.ts +0 -1
  22. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/cloud-credential.ts +5 -5
  23. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/ingress.ts +7 -3
  24. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/remote-web-pairing.ts +32 -70
  25. package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/rpc.ts +33 -3
  26. package/node_modules/@mycadet/ces-client/package.json +7 -2
  27. package/node_modules/@mycadet/ces-client/src/index.ts +6 -0
  28. package/node_modules/@mycadet/ces-client/src/ipc-credentials.ts +363 -0
  29. package/node_modules/@mycadet/ces-client/src/log-export.ts +187 -0
  30. package/node_modules/@mycadet/ces-client/src/socket-path.ts +34 -0
  31. package/node_modules/@mycadet/ces-client/src/test-support.ts +280 -0
  32. package/node_modules/@mycadet/environments/package.json +0 -1
  33. package/node_modules/@mycadet/environments/src/index.ts +7 -19
  34. package/node_modules/@mycadet/environments/src/shell.test.ts +0 -45
  35. package/node_modules/@mycadet/environments/src/shell.ts +0 -50
  36. package/node_modules/@mycadet/environments/src/test-path-guard.ts +1 -1
  37. package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/__tests__/contracts.test.ts +5 -2
  38. package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/__tests__/remote-web-pairing.test.ts +17 -14
  39. package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/channels.ts +0 -1
  40. package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/cloud-credential.ts +5 -5
  41. package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/ingress.ts +7 -3
  42. package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/remote-web-pairing.ts +32 -70
  43. package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/rpc.ts +33 -3
  44. package/node_modules/@mycadet/gateway-client/src/__tests__/gateway-client.test.ts +5 -5
  45. package/node_modules/@mycadet/gateway-client/src/__tests__/package-boundary.test.ts +1 -1
  46. package/node_modules/@mycadet/gateway-client/src/__tests__/status-contracts.test.ts +1 -20
  47. package/node_modules/@mycadet/gateway-client/src/admission-policy-contract.ts +1 -2
  48. package/node_modules/@mycadet/gateway-client/src/gateway-ipc-contracts.ts +0 -16
  49. package/node_modules/@mycadet/ipc-server-utils/src/socket-watchdog.test.ts +1 -1
  50. package/node_modules/@mycadet/service-contracts/src/__tests__/contracts.test.ts +5 -2
  51. package/node_modules/@mycadet/service-contracts/src/__tests__/remote-web-pairing.test.ts +17 -14
  52. package/node_modules/@mycadet/service-contracts/src/channels.ts +0 -1
  53. package/node_modules/@mycadet/service-contracts/src/cloud-credential.ts +5 -5
  54. package/node_modules/@mycadet/service-contracts/src/ingress.ts +7 -3
  55. package/node_modules/@mycadet/service-contracts/src/remote-web-pairing.ts +32 -70
  56. package/node_modules/@mycadet/service-contracts/src/rpc.ts +33 -3
  57. package/package.json +15 -13
  58. package/scripts/generate-openapi.ts +24 -32
  59. package/src/__tests__/actor-token-revocation.test.ts +14 -7
  60. package/src/__tests__/auto-approve-conversation-thresholds.test.ts +16 -16
  61. package/src/__tests__/auto-approve-thresholds.test.ts +22 -20
  62. package/src/__tests__/binding-helpers.test.ts +9 -12
  63. package/src/__tests__/channel-admission-policy-routes.test.ts +20 -34
  64. package/src/__tests__/channel-permission-overrides-routes.test.ts +20 -26
  65. package/src/__tests__/channel-verification-session-proxy.test.ts +36 -22
  66. package/src/__tests__/cli-entry-init.test.ts +103 -0
  67. package/src/__tests__/config.test.ts +4 -5
  68. package/src/__tests__/contact-handlers.test.ts +8 -10
  69. package/src/__tests__/contact-prompt-submit.test.ts +3 -1
  70. package/src/__tests__/contact-record-submit.test.ts +3 -1
  71. package/src/__tests__/contact-rich-read.test.ts +11 -20
  72. package/src/__tests__/contact-store-bind-principal.test.ts +12 -15
  73. package/src/__tests__/contact-store-invites.test.ts +6 -6
  74. package/src/__tests__/contact-store-mark-channel-verified.test.ts +8 -10
  75. package/src/__tests__/contact-store-merge-contacts.test.ts +7 -10
  76. package/src/__tests__/contact-store-mirror-op-missing.test.ts +7 -11
  77. package/src/__tests__/contacts-control-plane-proxy.test.ts +3 -21
  78. package/src/__tests__/contacts-info-client.test.ts +6 -5
  79. package/src/__tests__/contacts-info-joiner.test.ts +8 -13
  80. package/src/__tests__/contacts-scoped-route-fallthrough.test.ts +14 -12
  81. package/src/__tests__/credential-cache.test.ts +1 -6
  82. package/src/__tests__/credential-reader.test.ts +146 -157
  83. package/src/__tests__/credential-requests.test.ts +1 -3
  84. package/src/__tests__/credential-watcher-cloud-bootstrap.test.ts +57 -104
  85. package/src/__tests__/data-migration-m0007-backfill-ingress-invites.test.ts +14 -17
  86. package/src/__tests__/data-migration-m0008-upsert-acl-columns-from-assistant.test.ts +10 -13
  87. package/src/__tests__/data-migration-m0009-invite-fields-backfill.test.ts +20 -19
  88. package/src/__tests__/data-migration-m0010-drop-assistant-ingress-invites.test.ts +12 -15
  89. package/src/__tests__/data-migration-m0013-verification-sessions-backfill.test.ts +20 -23
  90. package/src/__tests__/data-migration-m0014-drop-assistant-verification-tables.test.ts +12 -15
  91. package/src/__tests__/data-migration-m0015-guardian-requests-backfill.test.ts +6 -9
  92. package/src/__tests__/data-migration-m0016-drop-assistant-guardian-tables.test.ts +16 -19
  93. package/src/__tests__/data-migration-m0017-coerce-escalate-policy.test.ts +6 -10
  94. package/src/__tests__/db-connection-isolation.test.ts +1 -2
  95. package/src/__tests__/db-proxy-allowlist.test.ts +25 -16
  96. package/src/__tests__/desktop-stream-websocket.test.ts +34 -28
  97. package/src/__tests__/device-identity-text.test.ts +4 -6
  98. package/src/__tests__/devices-mine.test.ts +12 -11
  99. package/src/__tests__/devices.test.ts +60 -260
  100. package/src/__tests__/discord-verification-contact-upgrade.test.ts +10 -13
  101. package/src/__tests__/edge-auth.test.ts +10 -148
  102. package/src/__tests__/edge-guardian-auth.test.ts +60 -44
  103. package/src/__tests__/guardian-binding-channel-reuse.test.ts +16 -18
  104. package/src/__tests__/guardian-bootstrap-binding.test.ts +7 -8
  105. package/src/__tests__/guardian-bootstrap-lookups.test.ts +25 -27
  106. package/src/__tests__/guardian-delivery-resolver.test.ts +8 -12
  107. package/src/__tests__/guardian-pin.test.ts +3 -1
  108. package/src/__tests__/handle-inbound-admission.test.ts +3 -12
  109. package/src/__tests__/handle-inbound-app-context.test.ts +3 -6
  110. package/src/__tests__/handle-inbound-invite-intercept.test.ts +3 -6
  111. package/src/__tests__/handle-inbound-trust-verdict.test.ts +3 -12
  112. package/src/__tests__/helpers/contact-route-table.ts +53 -32
  113. package/src/__tests__/helpers/env.ts +19 -0
  114. package/src/__tests__/helpers/gateway-config.ts +32 -0
  115. package/src/__tests__/helpers/remote-web-pairing-fixtures.ts +1 -7
  116. package/src/__tests__/helpers/signing-key.ts +27 -0
  117. package/src/__tests__/inbound-contact-seed.test.ts +7 -8
  118. package/src/__tests__/invite-redemption-engine-voice.test.ts +2 -3
  119. package/src/__tests__/invite-route-auth.test.ts +17 -15
  120. package/src/__tests__/ipc-contact-routes.test.ts +11 -19
  121. package/src/__tests__/ipc-contact-threshold.test.ts +16 -9
  122. package/src/__tests__/ipc-invite-routes.test.ts +6 -5
  123. package/src/__tests__/ipc-server-multi-client.test.ts +8 -1
  124. package/src/__tests__/ipc-server-watchdog.test.ts +16 -6
  125. package/src/__tests__/ipc-slack-thread-routes.test.ts +1 -2
  126. package/src/__tests__/ipc-voice-invite-routes.test.ts +3 -5
  127. package/src/__tests__/live-voice-websocket.test.ts +103 -95
  128. package/src/__tests__/load-guards.test.ts +0 -1
  129. package/src/__tests__/logger-retention.test.ts +11 -9
  130. package/src/__tests__/lum-2783-recovery-e2e.test.ts +3 -1
  131. package/src/__tests__/m0006-reconcile-contacts.test.ts +10 -13
  132. package/src/__tests__/oauth-callback.test.ts +13 -5
  133. package/src/__tests__/pair-origin-allowlist.test.ts +4 -118
  134. package/src/__tests__/rate-limit-loopback.test.ts +1 -5
  135. package/src/__tests__/refresh-device-binding.test.ts +3 -1
  136. package/src/__tests__/remote-web-pairing-challenge.test.ts +71 -132
  137. package/src/__tests__/remote-web-pairing-token.test.ts +16 -140
  138. package/src/__tests__/remote-web-pairing-verification.test.ts +17 -1
  139. package/src/__tests__/remote-web-public-base-url.test.ts +79 -0
  140. package/src/__tests__/resolve-assistant.test.ts +0 -1
  141. package/src/__tests__/runtime-client.test.ts +9 -9
  142. package/src/__tests__/runtime-health-proxy.test.ts +19 -14
  143. package/src/__tests__/runtime-proxy-auth.test.ts +129 -63
  144. package/src/__tests__/runtime-proxy-catchall-methods.test.ts +152 -0
  145. package/src/__tests__/runtime-proxy-device-stamp.test.ts +31 -24
  146. package/src/__tests__/runtime-proxy-error-body.test.ts +28 -30
  147. package/src/__tests__/runtime-proxy.test.ts +66 -59
  148. package/src/__tests__/runtime-stream-test-utils.ts +14 -3
  149. package/src/__tests__/seed-admission-policy.test.ts +1 -10
  150. package/src/__tests__/shared-invite-redeem.test.ts +7 -20
  151. package/src/__tests__/shared-invite-registration.test.ts +0 -34
  152. package/src/__tests__/slack-control-plane-proxy.test.ts +29 -17
  153. package/src/__tests__/slack-display-name.test.ts +3 -6
  154. package/src/__tests__/slack-normalize.test.ts +0 -1
  155. package/src/__tests__/slack-reaction-normalize.test.ts +0 -1
  156. package/src/__tests__/slack-socket-mode-catchup.test.ts +1 -2
  157. package/src/__tests__/slack-socket-mode-group-dm.test.ts +2 -3
  158. package/src/__tests__/slack-socket-mode-liveness.test.ts +6 -29
  159. package/src/__tests__/slack-socket-mode-outbound-root.test.ts +2 -3
  160. package/src/__tests__/slack-socket-mode-thread-tracking.test.ts +2 -3
  161. package/src/__tests__/sleep-wake-detector.test.ts +52 -25
  162. package/src/__tests__/speech-relay-websocket.test.ts +108 -100
  163. package/src/__tests__/stt-stream-websocket.test.ts +62 -69
  164. package/src/__tests__/telegram-control-plane-proxy.test.ts +36 -19
  165. package/src/__tests__/telegram-normalize.test.ts +1 -1
  166. package/src/__tests__/telegram-webhook-drop-visibility.test.ts +2 -3
  167. package/src/__tests__/telegram-webhook-handler.test.ts +121 -68
  168. package/src/__tests__/telegram-webhook-manager.test.ts +70 -90
  169. package/src/__tests__/test-preload.ts +21 -3
  170. package/src/__tests__/text-verification-helpers.test.ts +1 -1
  171. package/src/__tests__/trust-rules-route-auth.test.ts +16 -26
  172. package/src/__tests__/trust-rules-routes.test.ts +22 -25
  173. package/src/__tests__/twilio-media-websocket.test.ts +61 -59
  174. package/src/__tests__/twilio-webhooks.test.ts +5 -6
  175. package/src/__tests__/unversioned-api-fallthrough.test.ts +86 -0
  176. package/src/__tests__/upgrade-policy.test.ts +161 -0
  177. package/src/__tests__/upstream-transport.test.ts +20 -15
  178. package/src/__tests__/vercel-route-auth.test.ts +22 -36
  179. package/src/__tests__/watch-stream-websocket.test.ts +84 -91
  180. package/src/__tests__/whatsapp-download.test.ts +0 -1
  181. package/src/__tests__/whatsapp-webhook.test.ts +3 -3
  182. package/src/attachments/ingest.test.ts +0 -1
  183. package/src/auth/guardian-bootstrap.ts +5 -12
  184. package/src/auth/guardian-refresh.ts +0 -2
  185. package/src/auth/token-exchange.ts +23 -57
  186. package/src/auth/token-service.ts +69 -22
  187. package/src/auth-rate-limiter.ts +6 -0
  188. package/src/channels/inbound-event.test.ts +54 -0
  189. package/src/channels/inbound-event.ts +29 -3
  190. package/src/channels/ingress-verification.ts +10 -3
  191. package/src/channels/plugin-inbound.test.ts +4 -3
  192. package/src/channels/types.ts +0 -2
  193. package/src/cli/__tests__/contacts.test.ts +83 -60
  194. package/src/cli/__tests__/pairing.test.ts +230 -48
  195. package/src/cli/contacts.ts +0 -130
  196. package/src/cli/index.ts +20 -34
  197. package/src/cli/pairing.ts +118 -59
  198. package/src/cli/program.ts +227 -0
  199. package/src/cloud-features.ts +13 -0
  200. package/src/cloud-identity.ts +1 -1
  201. package/src/config-file-cache.ts +6 -0
  202. package/src/config-file-utils.ts +1 -1
  203. package/src/config-file-watcher.ts +104 -0
  204. package/src/config.ts +25 -23
  205. package/src/credential-cache.ts +6 -0
  206. package/src/credential-reader.ts +53 -35
  207. package/src/credential-watcher.ts +219 -22
  208. package/src/db/__tests__/session-store.test.ts +2 -1
  209. package/src/db/admission-policy-store.ts +1 -2
  210. package/src/db/connection.ts +12 -4
  211. package/src/db/contact-store.ts +82 -0
  212. package/src/db/data-migrations/m0002-actor-token-tables-to-gateway.ts +2 -7
  213. package/src/db/schema.ts +15 -0
  214. package/src/db/seed-admission-policy.ts +1 -1
  215. package/src/db/seed-trust-rules.ts +1 -4
  216. package/src/db/session-store.ts +0 -6
  217. package/src/discord/admission-log-visibility.test.ts +2 -2
  218. package/src/discord/forward.test.ts +3 -6
  219. package/src/discord/forward.ts +4 -8
  220. package/src/discord/lifecycle.ts +104 -0
  221. package/src/email/normalize.ts +1 -1
  222. package/src/email/register-callback.test.ts +1 -2
  223. package/src/email/register-callback.ts +4 -11
  224. package/src/guardian-contract.ts +30 -0
  225. package/src/handlers/handle-inbound.ts +2 -2
  226. package/src/http/browser-auth-cookies.ts +27 -22
  227. package/src/http/edge-forwarded-header.ts +0 -39
  228. package/src/http/loopback-guard.ts +0 -47
  229. package/src/http/middleware/auth.ts +35 -188
  230. package/src/http/middleware/cors.test.ts +66 -0
  231. package/src/http/middleware/cors.ts +23 -2
  232. package/src/http/router.ts +188 -151
  233. package/src/http/routes/assistant-handle.test.ts +133 -0
  234. package/src/http/routes/assistant-handle.ts +94 -0
  235. package/src/http/routes/audio-proxy.ts +49 -39
  236. package/src/http/routes/auto-approve-thresholds.ts +308 -230
  237. package/src/http/routes/brain-graph-proxy.ts +61 -52
  238. package/src/http/routes/channel-admission-policy.ts +219 -154
  239. package/src/http/routes/channel-ingress.test.ts +24 -19
  240. package/src/http/routes/channel-ingress.ts +255 -137
  241. package/src/http/routes/channel-permission-overrides.ts +189 -112
  242. package/src/http/routes/channel-readiness-proxy.ts +66 -45
  243. package/src/http/routes/channel-verification-session-proxy.test.ts +33 -82
  244. package/src/http/routes/channel-verification-session-proxy.ts +100 -455
  245. package/src/http/routes/cloud-hop.ts +138 -0
  246. package/src/http/routes/cloud-push-proxy.test.ts +34 -33
  247. package/src/http/routes/cloud-push-proxy.ts +56 -127
  248. package/src/http/routes/contacts-control-plane-proxy.ts +0 -12
  249. package/src/http/routes/contacts-control-plane-route-table.ts +372 -119
  250. package/src/http/routes/credential-entry-page.ts +12 -0
  251. package/src/http/routes/credential-requests.ts +10 -4
  252. package/src/http/routes/desktop-setup-proxy.ts +21 -11
  253. package/src/http/routes/desktop-stream-websocket.ts +67 -41
  254. package/src/http/routes/devices-mine.ts +11 -0
  255. package/src/http/routes/devices.ts +7 -63
  256. package/src/http/routes/email-webhook.test.ts +4 -20
  257. package/src/http/routes/guardian-channel-create.test.ts +6 -9
  258. package/src/http/routes/guardian-pin.ts +1 -1
  259. package/src/http/routes/guardian-refresh.ts +65 -2
  260. package/src/http/routes/index.ts +88 -0
  261. package/src/http/routes/ingress-domains.test.ts +57 -2
  262. package/src/http/routes/ingress-domains.ts +46 -14
  263. package/src/http/routes/integrations-status.ts +18 -0
  264. package/src/http/routes/ipc-runtime-proxy.test.ts +31 -6
  265. package/src/http/routes/ipc-runtime-proxy.ts +6 -3
  266. package/src/http/routes/live-voice-websocket.ts +159 -148
  267. package/src/http/routes/log-export.test.ts +61 -87
  268. package/src/http/routes/log-export.ts +143 -150
  269. package/src/http/routes/log-tail.test.ts +49 -32
  270. package/src/http/routes/log-tail.ts +31 -21
  271. package/src/http/routes/migration-rollback-proxy.ts +38 -32
  272. package/src/http/routes/oauth-apps-proxy.ts +109 -62
  273. package/src/http/routes/oauth-providers-proxy.ts +60 -51
  274. package/src/http/routes/pair.ts +23 -346
  275. package/src/http/routes/plugin-webhook-websocket.test.ts +73 -77
  276. package/src/http/routes/plugin-webhook-websocket.ts +210 -215
  277. package/src/http/routes/plugin-webhook.test.ts +3 -1
  278. package/src/http/routes/plugin-webhook.ts +0 -3
  279. package/src/http/routes/ps.ts +25 -20
  280. package/src/http/routes/regex-to-openapi-path.ts +39 -0
  281. package/src/http/routes/remote-web-pairing-challenge.ts +35 -81
  282. package/src/http/routes/remote-web-pairing-routes.ts +39 -0
  283. package/src/http/routes/remote-web-pairing-token.ts +6 -11
  284. package/src/http/routes/remote-web-pairing-verification.ts +7 -7
  285. package/src/http/routes/runtime-audio-stream.ts +147 -147
  286. package/src/http/routes/runtime-health-proxy.ts +43 -32
  287. package/src/http/routes/runtime-proxy.ts +54 -20
  288. package/src/http/routes/shared-invite-redeem.ts +1 -7
  289. package/src/http/routes/slack-control-plane-proxy.ts +57 -46
  290. package/src/http/routes/speech-relay-websocket.ts +310 -270
  291. package/src/http/routes/stt-stream-websocket.ts +102 -107
  292. package/src/http/routes/telegram-control-plane-proxy.ts +87 -58
  293. package/src/http/routes/telegram-webhook.test.ts +3 -19
  294. package/src/http/routes/telegram-webhook.ts +3 -2
  295. package/src/http/routes/terminal.test.ts +165 -0
  296. package/src/http/routes/terminal.ts +123 -0
  297. package/src/http/routes/trust-rules.suggest.test.ts +14 -22
  298. package/src/http/routes/trust-rules.ts +432 -246
  299. package/src/http/routes/tunnel-status.ts +26 -13
  300. package/src/http/routes/twilio-control-plane-proxy.ts +105 -64
  301. package/src/http/routes/twilio-media-websocket.ts +157 -147
  302. package/src/http/routes/twilio-voice-webhook.test.ts +14 -43
  303. package/src/http/routes/types.ts +92 -10
  304. package/src/http/routes/upgrade-broadcast-proxy.ts +38 -32
  305. package/src/http/routes/upgrade-policy.ts +186 -0
  306. package/src/http/routes/user-profile.test.ts +129 -0
  307. package/src/http/routes/user-profile.ts +204 -0
  308. package/src/http/routes/vercel-control-plane-proxy.ts +74 -52
  309. package/src/http/routes/watch-stream-websocket.ts +99 -138
  310. package/src/http/routes/webhook-routes.ts +214 -0
  311. package/src/http/routes/whatsapp-webhook.test.ts +3 -19
  312. package/src/http/routes/whatsapp-webhook.ts +2 -1
  313. package/src/http/routes/workspace-commit-proxy.ts +38 -30
  314. package/src/index.ts +298 -2481
  315. package/src/ipc/__tests__/admission-policy-handlers.test.ts +4 -18
  316. package/src/ipc/__tests__/guardian-request-routes.test.ts +7 -3
  317. package/src/ipc/__tests__/invite-ipc-routes.test.ts +13 -5
  318. package/src/ipc/__tests__/verification-session-routes.test.ts +5 -3
  319. package/src/ipc/admission-policy-handlers.ts +2 -2
  320. package/src/ipc/channel-socket-health-handlers.test.ts +56 -41
  321. package/src/ipc/channel-socket-health-handlers.ts +41 -31
  322. package/src/ipc/credential-request-handlers.ts +43 -19
  323. package/src/ipc/log-tail-handlers.test.ts +8 -35
  324. package/src/ipc/log-tail-handlers.ts +8 -11
  325. package/src/ipc/risk-classification-handlers.test.ts +0 -3
  326. package/src/ipc/risk-classification-handlers.ts +4 -4
  327. package/src/ipc/routes.ts +37 -0
  328. package/src/ipc/server.ts +13 -43
  329. package/src/ipc/trust-rules-handlers.test.ts +1 -2
  330. package/src/ipc/tunnel-handlers.ts +18 -18
  331. package/src/ipc/webhook-route-handlers.test.ts +5 -27
  332. package/src/ipc/webhook-route-handlers.ts +35 -39
  333. package/src/logger.ts +6 -26
  334. package/src/paths.ts +4 -4
  335. package/src/remote-web/pairing-challenge-store.ts +6 -35
  336. package/src/remote-web/pairing-mint.ts +2 -6
  337. package/src/remote-web/public-base-url.ts +65 -0
  338. package/src/risk/admission-policy-cache.ts +5 -12
  339. package/src/risk/bash-risk-classifier.test.ts +5 -6
  340. package/src/risk/bash-risk-classifier.ts +0 -3
  341. package/src/risk/command-registry/commands/gateway.ts +2 -1
  342. package/src/risk/file-risk-classifier.test.ts +1 -8
  343. package/src/risk/project-boundary.test.ts +3 -1
  344. package/src/risk/shell-identity.ts +1 -4
  345. package/src/risk/shell-parser.ts +1 -5
  346. package/src/risk/skill-risk-classifier.ts +1 -2
  347. package/src/runtime/client.ts +33 -27
  348. package/src/schema.ts +725 -163
  349. package/src/slack/errors.ts +1 -2
  350. package/src/slack/lifecycle.ts +327 -0
  351. package/src/slack/message-schemas.ts +1 -1
  352. package/src/slack/slack-web.ts +0 -1
  353. package/src/slack/socket-mode.ts +1 -1
  354. package/src/sleep-wake-detector.ts +62 -33
  355. package/src/telegram/normalize.test.ts +1 -1
  356. package/src/telegram/normalize.ts +1 -1
  357. package/src/telegram/send.test.ts +3 -19
  358. package/src/telegram/webhook-manager.ts +16 -31
  359. package/src/tunnel/allowed-paths.test.ts +27 -65
  360. package/src/tunnel/allowed-paths.ts +2 -27
  361. package/src/tunnel/binary-websocket.ts +1 -2
  362. package/src/tunnel/bridge-utils.ts +3 -8
  363. package/src/tunnel/client.test.ts +80 -67
  364. package/src/tunnel/client.ts +36 -28
  365. package/src/tunnel/http-bridge.test.ts +13 -40
  366. package/src/tunnel/websocket-bridge.test.ts +11 -2
  367. package/src/tunnel/websocket-bridge.ts +3 -1
  368. package/src/twilio/webhook-sync-trigger.ts +4 -4
  369. package/src/twilio/webhook-sync.test.ts +1 -33
  370. package/src/twilio/webhook-sync.ts +0 -4
  371. package/src/verification/code-parsing.ts +0 -3
  372. package/src/verification/rate-limit-helpers.ts +6 -2
  373. package/src/verification/session-service.ts +1 -1
  374. package/src/verification/shared-invite-registration.ts +3 -13
  375. package/src/verification/text-verification.ts +1 -1
  376. package/src/whatsapp/normalize.ts +1 -1
  377. package/node_modules/@mycadet/environments/src/__tests__/cloud-assistant-hub-url.test.ts +0 -38
  378. package/node_modules/@mycadet/environments/src/seeds.ts +0 -99
  379. package/node_modules/@mycadet/environments/src/types.ts +0 -70
  380. package/openapi.json +0 -2325
  381. package/src/__tests__/feature-flag-defaults-sync.test.ts +0 -44
  382. package/src/__tests__/feature-flag-resolver.test.ts +0 -151
  383. package/src/__tests__/feature-flag-watcher-callback.test.ts +0 -63
  384. package/src/__tests__/feature-flags-route.test.ts +0 -764
  385. package/src/__tests__/guardian-init-lockfile.test.ts +0 -883
  386. package/src/__tests__/ipc-feature-flag-routes.test.ts +0 -240
  387. package/src/__tests__/pair-device-bound.test.ts +0 -296
  388. package/src/__tests__/remote-web-ingress-denylist.test.ts +0 -113
  389. package/src/__tests__/remote-web-pairing-requests.test.ts +0 -277
  390. package/src/__tests__/route-schema-guard.test.ts +0 -489
  391. package/src/cloud-user-id.ts +0 -12
  392. package/src/feature-flag-defaults.ts +0 -197
  393. package/src/feature-flag-env-overrides.test.ts +0 -166
  394. package/src/feature-flag-env-overrides.ts +0 -58
  395. package/src/feature-flag-registry.json +0 -506
  396. package/src/feature-flag-resolver.ts +0 -47
  397. package/src/feature-flag-store.ts +0 -115
  398. package/src/feature-flag-watcher.ts +0 -105
  399. package/src/http/routes/a2a-routes.test.ts +0 -146
  400. package/src/http/routes/a2a-routes.ts +0 -126
  401. package/src/http/routes/auto-approve-thresholds-routes.ts +0 -92
  402. package/src/http/routes/channel-admission-policy-routes.ts +0 -67
  403. package/src/http/routes/channel-ingress-routes.ts +0 -135
  404. package/src/http/routes/channel-permission-overrides-routes.ts +0 -92
  405. package/src/http/routes/contacts-control-plane-routes.ts +0 -278
  406. package/src/http/routes/feature-flags.ts +0 -185
  407. package/src/http/routes/remote-web-pairing-requests.ts +0 -123
  408. package/src/http/routes/trust-rules-routes.ts +0 -188
  409. package/src/ipc/feature-flag-handlers.ts +0 -63
  410. package/src/types.ts +0 -11
@@ -1,506 +0,0 @@
1
- {
2
- "version": 1,
3
- "flags": [
4
- {
5
- "id": "interrupt-on-send",
6
- "scope": "both",
7
- "key": "interrupt-on-send",
8
- "label": "Interrupt On Send",
9
- "description": "A message sent while the assistant is busy interrupts the current tool call and is delivered immediately, instead of queueing",
10
- "defaultEnabled": false
11
- },
12
- {
13
- "id": "in-chat-onboarding-tour",
14
- "scope": "client",
15
- "key": "in-chat-onboarding-tour",
16
- "label": "In-Chat Onboarding Tour",
17
- "description": "Multivariate experiment for the eyes-led in-chat onboarding tour. control = straight to chat after research onboarding (current behavior); tour = the extended tour auto-plays on first workspace entry. Desktop-only: phone-width viewports and the native shell get neither the tour nor its telemetry (not even the exposure event), so the funnel measures desktop sessions exclusively. Targeted via LaunchDarkly (70% tour / 30% control).",
18
- "defaultEnabled": "control",
19
- "values": ["control", "tour"]
20
- },
21
- {
22
- "id": "vision-mode",
23
- "scope": "client",
24
- "key": "vision-mode",
25
- "label": "Vision Mode",
26
- "description": "Gates hold-to-Live ambient frame sampling in the voice room camera. String-valued so future A/B arms can be added as new values.",
27
- "defaultEnabled": "off",
28
- "values": ["off", "on"]
29
- },
30
- {
31
- "id": "assistant-initiated-threads",
32
- "scope": "assistant",
33
- "key": "assistant-initiated-threads",
34
- "label": "Assistant-Initiated Threads",
35
- "description": "Gates the sidebar section collecting the conversations the assistant started on its own: rows stamped `source='assistant_initiated'` at creation by producers that opt a thread in (heartbeat realizations worth the user's time; nothing stamps it yet, so the section starts empty and holds only new threads by construction). Transactional notification trails keep `source='notification'` and stay in Chats and the bell. When on, the daemon emits an `assistant` row from the section index and withholds member conversations from the Chats bucket; when off, they stay in Chats and no `assistant` row is emitted, which is the shipped behavior. Deliberately daemon-scope only: the index row is self-describing, so clients render the section on its presence rather than on a flag of their own. A second client-side gate could only hide a section whose rows the daemon has already withheld from Chats, which would lose those threads instead of reverting the feature. String-valued so future A/B arms can be added as new values.",
36
- "defaultEnabled": "off",
37
- "values": ["off", "on"]
38
- },
39
- {
40
- "id": "experiment-activation-flow-2026-06-03",
41
- "scope": "both",
42
- "key": "experiment-activation-flow-2026-06-03",
43
- "label": "Activation Flow Experiment 2026-06-03",
44
- "description": "Multivariate activation-flow experiment. control = standard flow; variant-a = activation rail; personal-page = new sign-up-page variant (front-end only). Targeted via LaunchDarkly.",
45
- "defaultEnabled": "control",
46
- "values": ["control", "variant-a", "personal-page"]
47
- },
48
- {
49
- "id": "a2a-channel",
50
- "scope": "assistant",
51
- "key": "a2a-channel",
52
- "label": "A2A Channel",
53
- "description": "Enable the A2A (Agent-to-Agent) channel for inter-assistant communication via the open A2A protocol",
54
- "defaultEnabled": false
55
- },
56
- {
57
- "id": "settings-developer-nav",
58
- "scope": "assistant",
59
- "key": "settings-developer-nav",
60
- "label": "Settings Developer Nav",
61
- "description": "Control Developer nav visibility in macOS settings",
62
- "defaultEnabled": false
63
- },
64
- {
65
- "id": "cadet-hosted-inference",
66
- "scope": "assistant",
67
- "key": "cadet-hosted-inference",
68
- "label": "Cadet Hosted Inference",
69
- "description": "Show Cadet-hosted GPU models (Qwen3 8B) in the catalog and the Settings Personality sliders that steer them.",
70
- "defaultEnabled": false
71
- },
72
- {
73
- "id": "developer-menu-items",
74
- "scope": "client",
75
- "key": "developer-menu-items",
76
- "label": "Developer Menu Items",
77
- "description": "Show Component Gallery and Replay Onboarding in the menu bar",
78
- "defaultEnabled": false
79
- },
80
- {
81
- "id": "multi-platform-assistant",
82
- "scope": "client",
83
- "key": "multi-platform-assistant",
84
- "label": "Multi-Platform Assistant Switcher",
85
- "description": "Enable the menu-bar assistant switcher for managing multiple cloud-hosted assistants (new/switch/retire)",
86
- "defaultEnabled": false
87
- },
88
- {
89
- "id": "quick-input",
90
- "scope": "client",
91
- "key": "quick-input",
92
- "label": "Quick Input",
93
- "description": "Enable the Quick Input popover on right-click of the menu bar icon",
94
- "defaultEnabled": false
95
- },
96
- {
97
- "id": "teach",
98
- "scope": "client",
99
- "key": "teach",
100
- "label": "Teach",
101
- "description": "Offer Teach, the session that reads the user's screen while they narrate what they are doing. Gates the companion surface's Teach control and the toggleWatch command that starts a session; evaluated in the app's window and read again in the Electron main process, which pushes it to the floating surface",
102
- "defaultEnabled": false
103
- },
104
- {
105
- "id": "quiet-turn-activity",
106
- "scope": "client",
107
- "key": "quiet-turn-activity",
108
- "label": "Quiet Turn Activity",
109
- "description": "While the assistant works, show a reply skeleton with one line naming where it is working instead of its intermediate text and steps; a settled turn shows only its opening line and its answer, with the steps behind a Worked summary in the message footer",
110
- "defaultEnabled": false
111
- },
112
- {
113
- "id": "inline-assistant-intermediates",
114
- "scope": "client",
115
- "key": "inline-assistant-intermediates",
116
- "label": "Inline Assistant Intermediates",
117
- "description": "Render a completed response's intermediate activity inline at full size instead of collapsing it behind the Earlier activity disclosure",
118
- "defaultEnabled": false
119
- },
120
- {
121
- "id": "fast-mode",
122
- "scope": "assistant",
123
- "key": "fast-mode",
124
- "label": "Fast Mode",
125
- "description": "Enable Anthropic fast mode for Opus models (4.6, 4.7, 4.8), delivering up to 2.5x higher output tokens per second at premium pricing",
126
- "defaultEnabled": false
127
- },
128
- {
129
- "id": "apple-container",
130
- "scope": "client",
131
- "key": "apple-container",
132
- "label": "Apple Container",
133
- "description": "Enable assistant sandboxing via Apple Containers on macOS 26+, providing a lightweight native sandbox without third-party dependencies",
134
- "defaultEnabled": false
135
- },
136
- {
137
- "id": "fork-from-message",
138
- "scope": "client",
139
- "key": "fork-from-message",
140
- "label": "Internal Thread Actions (legacy key)",
141
- "description": "Legacy key for `internal-thread-actions`. The client grants the internal thread affordances when either key is enabled, so the cloud may serve the gate under either name. Declared here so the flag mapper keeps the value instead of dropping it as undeclared.",
142
- "defaultEnabled": false
143
- },
144
- {
145
- "id": "internal-thread-actions",
146
- "scope": "client",
147
- "key": "internal-thread-actions",
148
- "label": "Internal Thread Actions",
149
- "description": "Show the internal thread affordances: 'Fork from here' and 'Summarize up to here' on messages, 'Fork Conversation', 'Analyze Conversation', and 'Copy conversation ID' in the thread menu, plus the LLM inspector surfaces. The flag is the sole gate: any session that enables it gets the affordances, including local sessions with no platform identity.",
150
- "defaultEnabled": false
151
- },
152
- {
153
- "id": "camera-gate-debug-hud",
154
- "scope": "client",
155
- "key": "camera-gate-debug-hud",
156
- "label": "Camera Gate Debug HUD",
157
- "description": "Unlock the camera frame gate's tuning readout: the switch in the camera's view options that turns it on, and the live panel over the composer's sight tile and the voice room's viewfinder showing motion, novelty and detail against their thresholds, the check that decided each frame, and sliders that move those thresholds while the camera runs. Staff sessions get it without the flag; the flag is for local gateway sessions, which carry no platform identity and are where the gate is tuned.",
158
- "defaultEnabled": false
159
- },
160
- {
161
- "id": "compaction-playground",
162
- "scope": "assistant",
163
- "key": "compaction-playground",
164
- "label": "Compaction Playground",
165
- "description": "Expose the developer-only Compaction Playground tab in macOS Settings and enable the /playground/* HTTP endpoints for exercising compaction conditions. Dev-only; default off.",
166
- "defaultEnabled": false
167
- },
168
- {
169
- "id": "app-control",
170
- "scope": "assistant",
171
- "key": "app-control",
172
- "label": "App Control",
173
- "description": "Enable the app-control skill (per-app screenshot + raw input bypassing AX tree)",
174
- "defaultEnabled": false
175
- },
176
- {
177
- "id": "velvet-theme",
178
- "scope": "client",
179
- "key": "velvet-theme",
180
- "label": "Velvet Theme",
181
- "description": "Show the Velvet theme option in the macOS appearance settings. Velvet is a dark-mode variant with red/pink accent colors.",
182
- "defaultEnabled": false
183
- },
184
- {
185
- "id": "chat-pull-to-refresh-enabled",
186
- "scope": "client",
187
- "key": "chat-pull-to-refresh-enabled",
188
- "label": "Chat Pull to Refresh",
189
- "description": "Enable pull-to-refresh gesture in the chat view.",
190
- "defaultEnabled": false
191
- },
192
- {
193
- "id": "preview-channel",
194
- "scope": "client",
195
- "key": "preview-channel",
196
- "label": "Preview Channel",
197
- "description": "Enable user-facing Preview release channel controls in assistant settings.",
198
- "defaultEnabled": false
199
- },
200
- {
201
- "id": "rollback-enabled",
202
- "scope": "assistant",
203
- "key": "rollback-enabled",
204
- "label": "Rollback Enabled",
205
- "description": "Show older versions in the version picker, allowing rollback to previous releases.",
206
- "defaultEnabled": false
207
- },
208
- {
209
- "id": "self-hosted-assistant",
210
- "scope": "client",
211
- "key": "self-hosted-assistant",
212
- "label": "Self-Hosted Assistant",
213
- "description": "Enable self-hosted assistant configuration.",
214
- "defaultEnabled": false
215
- },
216
- {
217
- "id": "paired-devices-ui",
218
- "scope": "client",
219
- "key": "paired-devices-ui",
220
- "label": "Paired Devices UI",
221
- "description": "Show the paired-devices list and revoke controls inside the pair-a-device settings card. Visibility only; `cadet devices` on the host stays available.",
222
- "defaultEnabled": false
223
- },
224
- {
225
- "id": "settings-sleep-policy",
226
- "scope": "assistant",
227
- "key": "settings-sleep-policy",
228
- "label": "Settings Sleep Policy",
229
- "description": "Enable sleep policy settings.",
230
- "defaultEnabled": false
231
- },
232
- {
233
- "id": "velvet",
234
- "scope": "client",
235
- "key": "velvet",
236
- "label": "Velvet",
237
- "description": "Enable the Velvet design theme.",
238
- "defaultEnabled": false
239
- },
240
- {
241
- "id": "memory-router-playground",
242
- "scope": "client",
243
- "key": "memory-router-playground",
244
- "label": "Memory Router Playground",
245
- "description": "Expose the developer-only Memory Router Playground tab in macOS Settings and the /assistant/memory-router-playground web page for dry-running v4 router config overrides against the live page index. Dev-only; default off.",
246
- "defaultEnabled": false
247
- },
248
- {
249
- "id": "self-intro-greeting",
250
- "scope": "both",
251
- "key": "self-intro-greeting",
252
- "label": "Self-intro first message",
253
- "description": "On the first conversation, send a natural self-introduction (e.g. \"Hi Vela, I'm alex. Nice to meet you.\") on the user's behalf and route it through real LLM inference, instead of serving the canned first greeting. Names come from the onboarding context; falls back to the canned greeting when no name is known. Exposed to clients so pre-hatch onboarding can compute the source-of-truth initial message, and to the assistant so older clients can still be gated server-side. See assistant/src/daemon/first-greeting.ts (buildSelfIntroMessage).",
254
- "defaultEnabled": false
255
- },
256
- {
257
- "id": "channel-trust-floors",
258
- "scope": "assistant",
259
- "key": "channel-trust-floors",
260
- "label": "Channel Trust Floors",
261
- "description": "Server-side switch for admission-floor enforcement: the gateway kill switch, the runtime floor stage, and enforcement-time policy resolution gate on it. Configuration reads and writes stay available while it is off. On by default. Client UI visibility is version-gated, not flag-gated.",
262
- "defaultEnabled": true
263
- },
264
- {
265
- "id": "mcp-add-server",
266
- "scope": "assistant",
267
- "key": "mcp-add-server",
268
- "label": "MCP Add Server",
269
- "description": "Show the Add Server action on the MCP settings page. The MCP page itself remains visible; this flag gates only creating new Model Context Protocol server connections.",
270
- "defaultEnabled": false
271
- },
272
- {
273
- "id": "mcp-catalog-qa-integrations",
274
- "scope": "assistant",
275
- "key": "mcp-catalog-qa-integrations",
276
- "label": "MCP Catalog QA Integrations",
277
- "description": "Show Gamma, Guru, Intercom, Ramp, Semrush, Typeform, and Upwork in the installable plugin catalog while their OAuth flows are validated. When off, catalog search, detail, and install-by-name cannot resolve them. Existing installed connections remain available.",
278
- "defaultEnabled": false
279
- },
280
- {
281
- "id": "os-beta",
282
- "scope": "assistant",
283
- "key": "os-beta",
284
- "label": "OS Beta",
285
- "description": "Enable the OS Beta model profile (MiniMax M3 / Together) in the assistant's model profile selection.",
286
- "defaultEnabled": false
287
- },
288
- {
289
- "id": "auto-profile",
290
- "scope": "assistant",
291
- "key": "auto-profile",
292
- "label": "Auto Profile",
293
- "description": "Enable the Auto model profile, which asks Jev which default profile should answer each message.",
294
- "defaultEnabled": false
295
- },
296
- {
297
- "id": "new-thread-suggestions",
298
- "scope": "client",
299
- "key": "new-thread-suggestions",
300
- "label": "New-thread suggestions library",
301
- "description": "Replace the empty-state conversation-starter chips with the scrollable, categorized suggestions library and detail drawer (currently mocked data).",
302
- "defaultEnabled": false
303
- },
304
- {
305
- "id": "account-mfa",
306
- "scope": "client",
307
- "key": "account-mfa",
308
- "label": "Account MFA",
309
- "description": "Surface the Security settings page where users enroll and manage TOTP two-factor authentication for their Cadet (WorkOS) account. Applies to email/password sign-in only.",
310
- "defaultEnabled": false
311
- },
312
- {
313
- "id": "chat-credential-reveal",
314
- "scope": "assistant",
315
- "key": "chat-credential-reveal",
316
- "label": "Chat Credential Reveal",
317
- "description": "Persist chat secret redactions as sentinel markers instead of the legacy HTML marker, enriched with the vault identity when the value byte-matches a credential revealed this turn. Also gates the `credentials reveal --for-chat` channel and the live-stream swap that replaces an echoed reveal plaintext with its sentinel before emission. Redaction itself is NOT gated: a route-proven reveal plaintext stays out of persisted rows in both modes. Client chip rendering is gated on daemon version, not on this flag.",
318
- "defaultEnabled": false
319
- },
320
- {
321
- "id": "marketing-pricing-takeover",
322
- "scope": "client",
323
- "key": "marketing-pricing-takeover",
324
- "label": "Marketing Pricing Takeover",
325
- "description": "Gates the marketing pricing takeover page (mycadet.ai/pricing) and the `/assistant/checkout?package=<slug>` deep link its package CTAs target. One flag covers both halves of the funnel so they can never be enabled independently and strand a CTA. When off, the checkout deep link redirects to the in-app plans takeover.",
326
- "defaultEnabled": false
327
- },
328
- {
329
- "id": "schedule-result-notify",
330
- "scope": "assistant",
331
- "key": "schedule-result-notify",
332
- "label": "Schedule Result Notify",
333
- "description": "Gates the `schedule.result` fallback notification the assistant sends when an execute-mode schedule run produces user-facing output but never notifies about it itself. On by default; turn it off to return to notify-only-if-the-run-said-so, where a scheduled briefing can run and leave no trace outside its own conversation.",
334
- "defaultEnabled": true
335
- },
336
- {
337
- "id": "assistant-reply-push",
338
- "scope": "assistant",
339
- "key": "assistant-reply-push",
340
- "label": "Assistant Reply Push",
341
- "description": "Gates the `chat.assistant_reply` push notification the assistant sends at the end of a user-initiated turn whose reply the user has not seen. On by default; turn it off to silence the push without disabling the rest of the notification pipeline.",
342
- "defaultEnabled": true
343
- },
344
- {
345
- "id": "activity-presence-suppression",
346
- "scope": "assistant",
347
- "key": "activity-presence-suppression",
348
- "label": "Activity Presence Suppression",
349
- "description": "Gates whether a background-activity failure notification is suppressed while a client reports itself visible on that conversation. Off by default; turn it on to stop notifying about work the user is already watching.",
350
- "defaultEnabled": false
351
- },
352
- {
353
- "id": "web-presence-suppression",
354
- "scope": "assistant",
355
- "key": "web-presence-suppression",
356
- "label": "Web Presence Suppression",
357
- "description": "Gates whether a `chat.assistant_reply` push is suppressed while a browser tab or desktop app window reports itself visible on that conversation. On by default; turn it off to restore unconditional reply pushes for web-visible conversations.",
358
- "defaultEnabled": true
359
- },
360
- {
361
- "id": "plugin-schedules",
362
- "scope": "assistant",
363
- "key": "plugin-schedules",
364
- "label": "Plugin Schedules",
365
- "description": "Plugins declare recurring schedules as files that register and run automatically",
366
- "defaultEnabled": true
367
- },
368
- {
369
- "id": "android-avatar-app-icon",
370
- "scope": "client",
371
- "key": "android-avatar-app-icon",
372
- "label": "Android Avatar App Icon",
373
- "description": "Shows the App icon picker in Settings -> General on Android, where any user chooses an eyes-on-color launcher icon, seeds the picker from their assistant's character avatar, or resets to the default. Android applies the change when the app goes to the background, and switching icons can reset a pinned home-screen shortcut. Off hides the picker and leaves the default icon in place.",
374
- "defaultEnabled": false
375
- },
376
- {
377
- "id": "push-avatar-sender",
378
- "scope": "client",
379
- "key": "push-avatar-sender",
380
- "label": "Push Avatar Sender",
381
- "description": "Native notifications show the assistant's avatar as the icon with the assistant's name on line one. Same key the cloud reads for APNs/FCM sender blocks.",
382
- "defaultEnabled": false
383
- },
384
- {
385
- "id": "local-notification-avatar",
386
- "scope": "client",
387
- "key": "local-notification-avatar",
388
- "label": "Local Notification Avatar",
389
- "description": "Shows the assistant name and avatar in notifications posted locally by native clients and supported browsers. Independent of remote push avatar presentation.",
390
- "defaultEnabled": false
391
- },
392
- {
393
- "id": "channel-conversation-sidecar",
394
- "scope": "client",
395
- "key": "channel-conversation-sidecar",
396
- "label": "Channel Conversation Sidecar",
397
- "description": "Renders a conversation bound to an external channel (Slack, Telegram, Discord, phone, email, and any other channel adapter) as two lanes in web chat: Cadet stays the primary full-width lane, and the canonical external-channel transcript moves into the existing read-only right drawer, opened from a channel-thread control in the chat header. Rows the client can attribute to the external channel are drawn once, in the drawer, instead of being blended into the Cadet lane. The drawer offers an Open in <channel> secondary action and a per-message Reference in Cadet action that stages one quoted reference above the Cadet composer. The Cadet composer stays the only input; nothing about delivery, routing, or permissions changes. Off leaves the header deep-link pill and the blended transcript unchanged.",
398
- "defaultEnabled": false
399
- },
400
- {
401
- "id": "monday-oauth",
402
- "scope": "assistant",
403
- "key": "monday-oauth",
404
- "label": "monday.com Integration",
405
- "description": "Gates the seeded monday.com OAuth provider. When off, the provider is hidden from GET /v1/oauth/providers, its get-by-id route, and the connect/update routes, so it cannot be listed or connected from the CLI, gateway, or web integrations list. The row is still seeded into oauth_providers on startup; only its visibility changes.",
406
- "defaultEnabled": false
407
- },
408
- {
409
- "id": "figma-oauth",
410
- "scope": "assistant",
411
- "key": "figma-oauth",
412
- "label": "Figma Integration",
413
- "description": "Gates the seeded Figma OAuth provider. When off, the provider is hidden from GET /v1/oauth/providers, its get-by-id route, and the connect/update routes, so it cannot be listed or connected from the CLI, gateway, or web integrations list. The row is still seeded into oauth_providers on startup, and existing connections keep injecting credentials; only its visibility changes.",
414
- "defaultEnabled": false
415
- },
416
- {
417
- "id": "quickbooks-oauth",
418
- "scope": "assistant",
419
- "key": "quickbooks-oauth",
420
- "label": "QuickBooks Integration",
421
- "description": "Gates the seeded QuickBooks OAuth provider. When off, the provider is hidden from GET /v1/oauth/providers, its get-by-id route, and the connect/update routes, so it cannot be listed or connected from the CLI, gateway, or web integrations list. The row is still seeded into oauth_providers on startup, and existing connections keep injecting credentials; only its visibility changes.",
422
- "defaultEnabled": false
423
- },
424
- {
425
- "id": "shopify-oauth",
426
- "scope": "assistant",
427
- "key": "shopify-oauth",
428
- "label": "Shopify Integration",
429
- "description": "Gates the seeded Shopify OAuth provider. When off, the provider is hidden from GET /v1/oauth/providers, its get-by-id route, and the connect/update routes, so it cannot be listed or connected from the CLI, gateway, or web integrations list. The row is still seeded into oauth_providers on startup, and existing connections keep injecting credentials; only its visibility changes. Off by default because Shopify is the first per-tenant provider: connecting needs the merchant's myshopify.com domain, and the shop-domain input in the clients ships separately from the seed.",
430
- "defaultEnabled": false
431
- },
432
- {
433
- "id": "chatgpt-device-code-login",
434
- "scope": "client",
435
- "key": "chatgpt-device-code-login",
436
- "label": "ChatGPT Device Code Login",
437
- "description": "Gates the device-code sign-in as the primary ChatGPT subscription connect flow in the web client. Off: the redirect-and-paste flow is the only flow the connect section shows, with no device code UI and no other-sign-in-options disclosure. On: device code leads, and the redirect-and-paste flow stays reachable behind that disclosure and takes the section over when the assistant has no device-auth route.",
438
- "defaultEnabled": false
439
- },
440
- {
441
- "id": "model-first-profile-create",
442
- "scope": "client",
443
- "key": "model-first-profile-create",
444
- "label": "Model-First Profile Create",
445
- "description": "Reverses the two questions the web client's New Model modal asks when creating an inference profile. Off: the modal asks for a provider first and then offers that provider's models. On: it opens on one searchable list of every catalog model the assistant can reach, deduplicated across providers, and only then asks which provider serves the chosen model. That second question is skipped when a single provider serves it, answered with radio cards when several do, and turned into an inline connect form (API key, setup, or ChatGPT sign-in) when the chosen route has no connection yet. Editing an existing profile is unchanged either way, and both flows persist the same profile shape.",
446
- "defaultEnabled": false
447
- },
448
- {
449
- "id": "tunnel-webhooks",
450
- "scope": "assistant",
451
- "key": "tunnel-webhooks",
452
- "label": "Tunnel Webhooks",
453
- "description": "Cloud pods resolve webhook callback URLs from the Tunnel-published ingress URL instead of registering platform callback routes. Falls back to platform callback registration while no tunnel URL is published.",
454
- "defaultEnabled": false
455
- },
456
- {
457
- "id": "experiment-activation-checklist-2026-09-10",
458
- "scope": "client",
459
- "key": "experiment-activation-checklist-2026-09-10",
460
- "label": "Experiment: Activation Checklist (2026-09-10)",
461
- "description": "A/B test of the post-onboarding activation checklist (welcome modal, suggestions pill, inspiration list). off = control, the standard chat landing with no checklist; smb / parent / general = the checklist with that persona's task list. Any other value hides the checklist. Percentages per arm are set in LaunchDarkly; the readout keys a user on their first-ever assignment, so a new round gets a new key.",
462
- "defaultEnabled": "off",
463
- "values": ["off", "smb", "parent", "general"]
464
- },
465
- {
466
- "id": "send-user-message",
467
- "scope": "both",
468
- "key": "send-user-message",
469
- "label": "Send User Message Tool",
470
- "description": "Route all user-facing assistant text through the send_user_message tool instead of streamed assistant text",
471
- "defaultEnabled": false
472
- },
473
- {
474
- "id": "session-groups",
475
- "scope": "both",
476
- "key": "session-groups",
477
- "label": "Session Groups",
478
- "description": "Records eligible computer use, browser, live vision, and ambient runs and presents them as collapsible transcript groups. Off preserves ordinary actions and the flat transcript without new session tracking.",
479
- "defaultEnabled": false
480
- },
481
- {
482
- "id": "assistant-desktop",
483
- "scope": "assistant",
484
- "key": "assistant-desktop",
485
- "label": "Virtual desktop",
486
- "description": "Streams an interactive virtual desktop from a cloud-hosted, containerized assistant over /v1/desktop/stream. Requires platform hosting; self-hosted assistants are excluded. Off: the virtual desktop is hidden. On: the chat header offers its viewer and controls.",
487
- "defaultEnabled": false
488
- },
489
- {
490
- "id": "sidebar-done",
491
- "scope": "both",
492
- "key": "sidebar-done",
493
- "label": "Sidebar Done",
494
- "description": "Turns archiving a chat into marking it done: the sidebar row carries a Done check instead of the overflow menu, an All chats page lists the full history, and done chats stay findable in search by default. Off keeps today's Archive wording, the overflow menu, and search that hides archived rows unless the query asks for them.",
495
- "defaultEnabled": false
496
- },
497
- {
498
- "id": "cadet-trusted-contacts",
499
- "scope": "both",
500
- "key": "cadet-trusted-contacts",
501
- "label": "Cadet Trusted Contacts",
502
- "description": "Lets a guardian give another person access to talk to their assistant in the Cadet UI as a trusted contact. Gates contact-role token minting in the gateway, trusted-contact trust resolution for `cadet` channel principals, and the assistant's trusted-contact route allowlist. Off: none of those surfaces admit a contact, and the assistant stays reachable only by its guardian.",
503
- "defaultEnabled": false
504
- }
505
- ]
506
- }
@@ -1,47 +0,0 @@
1
- import { loadFeatureFlagDefaults } from "./feature-flag-defaults.js";
2
- import { readEnvFeatureFlagOverrides } from "./feature-flag-env-overrides.js";
3
- import { readPersistedFeatureFlags } from "./feature-flag-store.js";
4
-
5
- /**
6
- * Resolve the raw value for a feature flag.
7
- *
8
- * Priority: env override > persisted (user-toggled) > registry default.
9
- * Undeclared keys return `false` (fail closed), even if stale local
10
- * state contains a value for them.
11
- */
12
- export function getFeatureFlagValue(key: string): boolean | string {
13
- const defaults = loadFeatureFlagDefaults();
14
- const defaultDef = defaults[key];
15
- if (defaultDef === undefined) return false;
16
-
17
- const envOverrides = readEnvFeatureFlagOverrides();
18
- if (key in envOverrides) return envOverrides[key];
19
-
20
- const persisted = readPersistedFeatureFlags();
21
- const persistedValue = persisted[key];
22
- if (persistedValue !== undefined) return persistedValue;
23
-
24
- return defaultDef.defaultEnabled;
25
- }
26
-
27
- /**
28
- * Resolve whether a feature flag is enabled (boolean coercion).
29
- *
30
- * For boolean flags, returns the resolved value directly.
31
- * For string flags, returns true if the value is non-empty.
32
- * Undeclared keys return `false` (fail closed).
33
- */
34
- export function isFeatureFlagEnabled(key: string): boolean {
35
- return !!getFeatureFlagValue(key);
36
- }
37
-
38
- export function isCloudServedBuild(): boolean {
39
- const v = process.env.IS_CLOUD?.trim().toLowerCase();
40
- return v === "true" || v === "1";
41
- }
42
-
43
- export function areCloudFeaturesEnabled(): boolean {
44
- if (isCloudServedBuild()) return true;
45
- const v = process.env.CADET_DISABLE_CLOUD?.trim().toLowerCase();
46
- return !(v === "true" || v === "1");
47
- }