@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.
- package/Dockerfile +1 -0
- package/README.md +10 -10
- package/eslint.config.mjs +7 -8
- package/knip.json +2 -8
- package/node_modules/@mycadet/assistant-client/src/__tests__/assistant-client.test.ts +40 -34
- package/node_modules/@mycadet/assistant-client/src/http-client.ts +59 -8
- package/node_modules/@mycadet/assistant-client/src/index.ts +4 -0
- package/node_modules/@mycadet/assistant-client/src/proxy-forward.ts +5 -4
- package/node_modules/@mycadet/assistant-client/src/websocket-upstream.ts +21 -31
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/ipc-server-utils/package.json +18 -0
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/ipc-server-utils/src/endpoint.test.ts +36 -0
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/ipc-server-utils/src/endpoint.ts +142 -0
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/ipc-server-utils/src/index.ts +18 -0
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/ipc-server-utils/src/ipc-framing.ts +295 -0
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/ipc-server-utils/src/listen-options.ts +3 -0
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/ipc-server-utils/src/socket-watchdog.test.ts +444 -0
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/ipc-server-utils/src/socket-watchdog.ts +236 -0
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/ipc-server-utils/tsconfig.json +20 -0
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/__tests__/contracts.test.ts +5 -2
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/__tests__/remote-web-pairing.test.ts +17 -14
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/channels.ts +0 -1
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/cloud-credential.ts +5 -5
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/ingress.ts +7 -3
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/remote-web-pairing.ts +32 -70
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/rpc.ts +33 -3
- package/node_modules/@mycadet/ces-client/package.json +7 -2
- package/node_modules/@mycadet/ces-client/src/index.ts +6 -0
- package/node_modules/@mycadet/ces-client/src/ipc-credentials.ts +363 -0
- package/node_modules/@mycadet/ces-client/src/log-export.ts +187 -0
- package/node_modules/@mycadet/ces-client/src/socket-path.ts +34 -0
- package/node_modules/@mycadet/ces-client/src/test-support.ts +280 -0
- package/node_modules/@mycadet/environments/package.json +0 -1
- package/node_modules/@mycadet/environments/src/index.ts +7 -19
- package/node_modules/@mycadet/environments/src/shell.test.ts +0 -45
- package/node_modules/@mycadet/environments/src/shell.ts +0 -50
- package/node_modules/@mycadet/environments/src/test-path-guard.ts +1 -1
- package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/__tests__/contracts.test.ts +5 -2
- package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/__tests__/remote-web-pairing.test.ts +17 -14
- package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/channels.ts +0 -1
- package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/cloud-credential.ts +5 -5
- package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/ingress.ts +7 -3
- package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/remote-web-pairing.ts +32 -70
- package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/rpc.ts +33 -3
- package/node_modules/@mycadet/gateway-client/src/__tests__/gateway-client.test.ts +5 -5
- package/node_modules/@mycadet/gateway-client/src/__tests__/package-boundary.test.ts +1 -1
- package/node_modules/@mycadet/gateway-client/src/__tests__/status-contracts.test.ts +1 -20
- package/node_modules/@mycadet/gateway-client/src/admission-policy-contract.ts +1 -2
- package/node_modules/@mycadet/gateway-client/src/gateway-ipc-contracts.ts +0 -16
- package/node_modules/@mycadet/ipc-server-utils/src/socket-watchdog.test.ts +1 -1
- package/node_modules/@mycadet/service-contracts/src/__tests__/contracts.test.ts +5 -2
- package/node_modules/@mycadet/service-contracts/src/__tests__/remote-web-pairing.test.ts +17 -14
- package/node_modules/@mycadet/service-contracts/src/channels.ts +0 -1
- package/node_modules/@mycadet/service-contracts/src/cloud-credential.ts +5 -5
- package/node_modules/@mycadet/service-contracts/src/ingress.ts +7 -3
- package/node_modules/@mycadet/service-contracts/src/remote-web-pairing.ts +32 -70
- package/node_modules/@mycadet/service-contracts/src/rpc.ts +33 -3
- package/package.json +15 -13
- package/scripts/generate-openapi.ts +24 -32
- package/src/__tests__/actor-token-revocation.test.ts +14 -7
- package/src/__tests__/auto-approve-conversation-thresholds.test.ts +16 -16
- package/src/__tests__/auto-approve-thresholds.test.ts +22 -20
- package/src/__tests__/binding-helpers.test.ts +9 -12
- package/src/__tests__/channel-admission-policy-routes.test.ts +20 -34
- package/src/__tests__/channel-permission-overrides-routes.test.ts +20 -26
- package/src/__tests__/channel-verification-session-proxy.test.ts +36 -22
- package/src/__tests__/cli-entry-init.test.ts +103 -0
- package/src/__tests__/config.test.ts +4 -5
- package/src/__tests__/contact-handlers.test.ts +8 -10
- package/src/__tests__/contact-prompt-submit.test.ts +3 -1
- package/src/__tests__/contact-record-submit.test.ts +3 -1
- package/src/__tests__/contact-rich-read.test.ts +11 -20
- package/src/__tests__/contact-store-bind-principal.test.ts +12 -15
- package/src/__tests__/contact-store-invites.test.ts +6 -6
- package/src/__tests__/contact-store-mark-channel-verified.test.ts +8 -10
- package/src/__tests__/contact-store-merge-contacts.test.ts +7 -10
- package/src/__tests__/contact-store-mirror-op-missing.test.ts +7 -11
- package/src/__tests__/contacts-control-plane-proxy.test.ts +3 -21
- package/src/__tests__/contacts-info-client.test.ts +6 -5
- package/src/__tests__/contacts-info-joiner.test.ts +8 -13
- package/src/__tests__/contacts-scoped-route-fallthrough.test.ts +14 -12
- package/src/__tests__/credential-cache.test.ts +1 -6
- package/src/__tests__/credential-reader.test.ts +146 -157
- package/src/__tests__/credential-requests.test.ts +1 -3
- package/src/__tests__/credential-watcher-cloud-bootstrap.test.ts +57 -104
- package/src/__tests__/data-migration-m0007-backfill-ingress-invites.test.ts +14 -17
- package/src/__tests__/data-migration-m0008-upsert-acl-columns-from-assistant.test.ts +10 -13
- package/src/__tests__/data-migration-m0009-invite-fields-backfill.test.ts +20 -19
- package/src/__tests__/data-migration-m0010-drop-assistant-ingress-invites.test.ts +12 -15
- package/src/__tests__/data-migration-m0013-verification-sessions-backfill.test.ts +20 -23
- package/src/__tests__/data-migration-m0014-drop-assistant-verification-tables.test.ts +12 -15
- package/src/__tests__/data-migration-m0015-guardian-requests-backfill.test.ts +6 -9
- package/src/__tests__/data-migration-m0016-drop-assistant-guardian-tables.test.ts +16 -19
- package/src/__tests__/data-migration-m0017-coerce-escalate-policy.test.ts +6 -10
- package/src/__tests__/db-connection-isolation.test.ts +1 -2
- package/src/__tests__/db-proxy-allowlist.test.ts +25 -16
- package/src/__tests__/desktop-stream-websocket.test.ts +34 -28
- package/src/__tests__/device-identity-text.test.ts +4 -6
- package/src/__tests__/devices-mine.test.ts +12 -11
- package/src/__tests__/devices.test.ts +60 -260
- package/src/__tests__/discord-verification-contact-upgrade.test.ts +10 -13
- package/src/__tests__/edge-auth.test.ts +10 -148
- package/src/__tests__/edge-guardian-auth.test.ts +60 -44
- package/src/__tests__/guardian-binding-channel-reuse.test.ts +16 -18
- package/src/__tests__/guardian-bootstrap-binding.test.ts +7 -8
- package/src/__tests__/guardian-bootstrap-lookups.test.ts +25 -27
- package/src/__tests__/guardian-delivery-resolver.test.ts +8 -12
- package/src/__tests__/guardian-pin.test.ts +3 -1
- package/src/__tests__/handle-inbound-admission.test.ts +3 -12
- package/src/__tests__/handle-inbound-app-context.test.ts +3 -6
- package/src/__tests__/handle-inbound-invite-intercept.test.ts +3 -6
- package/src/__tests__/handle-inbound-trust-verdict.test.ts +3 -12
- package/src/__tests__/helpers/contact-route-table.ts +53 -32
- package/src/__tests__/helpers/env.ts +19 -0
- package/src/__tests__/helpers/gateway-config.ts +32 -0
- package/src/__tests__/helpers/remote-web-pairing-fixtures.ts +1 -7
- package/src/__tests__/helpers/signing-key.ts +27 -0
- package/src/__tests__/inbound-contact-seed.test.ts +7 -8
- package/src/__tests__/invite-redemption-engine-voice.test.ts +2 -3
- package/src/__tests__/invite-route-auth.test.ts +17 -15
- package/src/__tests__/ipc-contact-routes.test.ts +11 -19
- package/src/__tests__/ipc-contact-threshold.test.ts +16 -9
- package/src/__tests__/ipc-invite-routes.test.ts +6 -5
- package/src/__tests__/ipc-server-multi-client.test.ts +8 -1
- package/src/__tests__/ipc-server-watchdog.test.ts +16 -6
- package/src/__tests__/ipc-slack-thread-routes.test.ts +1 -2
- package/src/__tests__/ipc-voice-invite-routes.test.ts +3 -5
- package/src/__tests__/live-voice-websocket.test.ts +103 -95
- package/src/__tests__/load-guards.test.ts +0 -1
- package/src/__tests__/logger-retention.test.ts +11 -9
- package/src/__tests__/lum-2783-recovery-e2e.test.ts +3 -1
- package/src/__tests__/m0006-reconcile-contacts.test.ts +10 -13
- package/src/__tests__/oauth-callback.test.ts +13 -5
- package/src/__tests__/pair-origin-allowlist.test.ts +4 -118
- package/src/__tests__/rate-limit-loopback.test.ts +1 -5
- package/src/__tests__/refresh-device-binding.test.ts +3 -1
- package/src/__tests__/remote-web-pairing-challenge.test.ts +71 -132
- package/src/__tests__/remote-web-pairing-token.test.ts +16 -140
- package/src/__tests__/remote-web-pairing-verification.test.ts +17 -1
- package/src/__tests__/remote-web-public-base-url.test.ts +79 -0
- package/src/__tests__/resolve-assistant.test.ts +0 -1
- package/src/__tests__/runtime-client.test.ts +9 -9
- package/src/__tests__/runtime-health-proxy.test.ts +19 -14
- package/src/__tests__/runtime-proxy-auth.test.ts +129 -63
- package/src/__tests__/runtime-proxy-catchall-methods.test.ts +152 -0
- package/src/__tests__/runtime-proxy-device-stamp.test.ts +31 -24
- package/src/__tests__/runtime-proxy-error-body.test.ts +28 -30
- package/src/__tests__/runtime-proxy.test.ts +66 -59
- package/src/__tests__/runtime-stream-test-utils.ts +14 -3
- package/src/__tests__/seed-admission-policy.test.ts +1 -10
- package/src/__tests__/shared-invite-redeem.test.ts +7 -20
- package/src/__tests__/shared-invite-registration.test.ts +0 -34
- package/src/__tests__/slack-control-plane-proxy.test.ts +29 -17
- package/src/__tests__/slack-display-name.test.ts +3 -6
- package/src/__tests__/slack-normalize.test.ts +0 -1
- package/src/__tests__/slack-reaction-normalize.test.ts +0 -1
- package/src/__tests__/slack-socket-mode-catchup.test.ts +1 -2
- package/src/__tests__/slack-socket-mode-group-dm.test.ts +2 -3
- package/src/__tests__/slack-socket-mode-liveness.test.ts +6 -29
- package/src/__tests__/slack-socket-mode-outbound-root.test.ts +2 -3
- package/src/__tests__/slack-socket-mode-thread-tracking.test.ts +2 -3
- package/src/__tests__/sleep-wake-detector.test.ts +52 -25
- package/src/__tests__/speech-relay-websocket.test.ts +108 -100
- package/src/__tests__/stt-stream-websocket.test.ts +62 -69
- package/src/__tests__/telegram-control-plane-proxy.test.ts +36 -19
- package/src/__tests__/telegram-normalize.test.ts +1 -1
- package/src/__tests__/telegram-webhook-drop-visibility.test.ts +2 -3
- package/src/__tests__/telegram-webhook-handler.test.ts +121 -68
- package/src/__tests__/telegram-webhook-manager.test.ts +70 -90
- package/src/__tests__/test-preload.ts +21 -3
- package/src/__tests__/text-verification-helpers.test.ts +1 -1
- package/src/__tests__/trust-rules-route-auth.test.ts +16 -26
- package/src/__tests__/trust-rules-routes.test.ts +22 -25
- package/src/__tests__/twilio-media-websocket.test.ts +61 -59
- package/src/__tests__/twilio-webhooks.test.ts +5 -6
- package/src/__tests__/unversioned-api-fallthrough.test.ts +86 -0
- package/src/__tests__/upgrade-policy.test.ts +161 -0
- package/src/__tests__/upstream-transport.test.ts +20 -15
- package/src/__tests__/vercel-route-auth.test.ts +22 -36
- package/src/__tests__/watch-stream-websocket.test.ts +84 -91
- package/src/__tests__/whatsapp-download.test.ts +0 -1
- package/src/__tests__/whatsapp-webhook.test.ts +3 -3
- package/src/attachments/ingest.test.ts +0 -1
- package/src/auth/guardian-bootstrap.ts +5 -12
- package/src/auth/guardian-refresh.ts +0 -2
- package/src/auth/token-exchange.ts +23 -57
- package/src/auth/token-service.ts +69 -22
- package/src/auth-rate-limiter.ts +6 -0
- package/src/channels/inbound-event.test.ts +54 -0
- package/src/channels/inbound-event.ts +29 -3
- package/src/channels/ingress-verification.ts +10 -3
- package/src/channels/plugin-inbound.test.ts +4 -3
- package/src/channels/types.ts +0 -2
- package/src/cli/__tests__/contacts.test.ts +83 -60
- package/src/cli/__tests__/pairing.test.ts +230 -48
- package/src/cli/contacts.ts +0 -130
- package/src/cli/index.ts +20 -34
- package/src/cli/pairing.ts +118 -59
- package/src/cli/program.ts +227 -0
- package/src/cloud-features.ts +13 -0
- package/src/cloud-identity.ts +1 -1
- package/src/config-file-cache.ts +6 -0
- package/src/config-file-utils.ts +1 -1
- package/src/config-file-watcher.ts +104 -0
- package/src/config.ts +25 -23
- package/src/credential-cache.ts +6 -0
- package/src/credential-reader.ts +53 -35
- package/src/credential-watcher.ts +219 -22
- package/src/db/__tests__/session-store.test.ts +2 -1
- package/src/db/admission-policy-store.ts +1 -2
- package/src/db/connection.ts +12 -4
- package/src/db/contact-store.ts +82 -0
- package/src/db/data-migrations/m0002-actor-token-tables-to-gateway.ts +2 -7
- package/src/db/schema.ts +15 -0
- package/src/db/seed-admission-policy.ts +1 -1
- package/src/db/seed-trust-rules.ts +1 -4
- package/src/db/session-store.ts +0 -6
- package/src/discord/admission-log-visibility.test.ts +2 -2
- package/src/discord/forward.test.ts +3 -6
- package/src/discord/forward.ts +4 -8
- package/src/discord/lifecycle.ts +104 -0
- package/src/email/normalize.ts +1 -1
- package/src/email/register-callback.test.ts +1 -2
- package/src/email/register-callback.ts +4 -11
- package/src/guardian-contract.ts +30 -0
- package/src/handlers/handle-inbound.ts +2 -2
- package/src/http/browser-auth-cookies.ts +27 -22
- package/src/http/edge-forwarded-header.ts +0 -39
- package/src/http/loopback-guard.ts +0 -47
- package/src/http/middleware/auth.ts +35 -188
- package/src/http/middleware/cors.test.ts +66 -0
- package/src/http/middleware/cors.ts +23 -2
- package/src/http/router.ts +188 -151
- package/src/http/routes/assistant-handle.test.ts +133 -0
- package/src/http/routes/assistant-handle.ts +94 -0
- package/src/http/routes/audio-proxy.ts +49 -39
- package/src/http/routes/auto-approve-thresholds.ts +308 -230
- package/src/http/routes/brain-graph-proxy.ts +61 -52
- package/src/http/routes/channel-admission-policy.ts +219 -154
- package/src/http/routes/channel-ingress.test.ts +24 -19
- package/src/http/routes/channel-ingress.ts +255 -137
- package/src/http/routes/channel-permission-overrides.ts +189 -112
- package/src/http/routes/channel-readiness-proxy.ts +66 -45
- package/src/http/routes/channel-verification-session-proxy.test.ts +33 -82
- package/src/http/routes/channel-verification-session-proxy.ts +100 -455
- package/src/http/routes/cloud-hop.ts +138 -0
- package/src/http/routes/cloud-push-proxy.test.ts +34 -33
- package/src/http/routes/cloud-push-proxy.ts +56 -127
- package/src/http/routes/contacts-control-plane-proxy.ts +0 -12
- package/src/http/routes/contacts-control-plane-route-table.ts +372 -119
- package/src/http/routes/credential-entry-page.ts +12 -0
- package/src/http/routes/credential-requests.ts +10 -4
- package/src/http/routes/desktop-setup-proxy.ts +21 -11
- package/src/http/routes/desktop-stream-websocket.ts +67 -41
- package/src/http/routes/devices-mine.ts +11 -0
- package/src/http/routes/devices.ts +7 -63
- package/src/http/routes/email-webhook.test.ts +4 -20
- package/src/http/routes/guardian-channel-create.test.ts +6 -9
- package/src/http/routes/guardian-pin.ts +1 -1
- package/src/http/routes/guardian-refresh.ts +65 -2
- package/src/http/routes/index.ts +88 -0
- package/src/http/routes/ingress-domains.test.ts +57 -2
- package/src/http/routes/ingress-domains.ts +46 -14
- package/src/http/routes/integrations-status.ts +18 -0
- package/src/http/routes/ipc-runtime-proxy.test.ts +31 -6
- package/src/http/routes/ipc-runtime-proxy.ts +6 -3
- package/src/http/routes/live-voice-websocket.ts +159 -148
- package/src/http/routes/log-export.test.ts +61 -87
- package/src/http/routes/log-export.ts +143 -150
- package/src/http/routes/log-tail.test.ts +49 -32
- package/src/http/routes/log-tail.ts +31 -21
- package/src/http/routes/migration-rollback-proxy.ts +38 -32
- package/src/http/routes/oauth-apps-proxy.ts +109 -62
- package/src/http/routes/oauth-providers-proxy.ts +60 -51
- package/src/http/routes/pair.ts +23 -346
- package/src/http/routes/plugin-webhook-websocket.test.ts +73 -77
- package/src/http/routes/plugin-webhook-websocket.ts +210 -215
- package/src/http/routes/plugin-webhook.test.ts +3 -1
- package/src/http/routes/plugin-webhook.ts +0 -3
- package/src/http/routes/ps.ts +25 -20
- package/src/http/routes/regex-to-openapi-path.ts +39 -0
- package/src/http/routes/remote-web-pairing-challenge.ts +35 -81
- package/src/http/routes/remote-web-pairing-routes.ts +39 -0
- package/src/http/routes/remote-web-pairing-token.ts +6 -11
- package/src/http/routes/remote-web-pairing-verification.ts +7 -7
- package/src/http/routes/runtime-audio-stream.ts +147 -147
- package/src/http/routes/runtime-health-proxy.ts +43 -32
- package/src/http/routes/runtime-proxy.ts +54 -20
- package/src/http/routes/shared-invite-redeem.ts +1 -7
- package/src/http/routes/slack-control-plane-proxy.ts +57 -46
- package/src/http/routes/speech-relay-websocket.ts +310 -270
- package/src/http/routes/stt-stream-websocket.ts +102 -107
- package/src/http/routes/telegram-control-plane-proxy.ts +87 -58
- package/src/http/routes/telegram-webhook.test.ts +3 -19
- package/src/http/routes/telegram-webhook.ts +3 -2
- package/src/http/routes/terminal.test.ts +165 -0
- package/src/http/routes/terminal.ts +123 -0
- package/src/http/routes/trust-rules.suggest.test.ts +14 -22
- package/src/http/routes/trust-rules.ts +432 -246
- package/src/http/routes/tunnel-status.ts +26 -13
- package/src/http/routes/twilio-control-plane-proxy.ts +105 -64
- package/src/http/routes/twilio-media-websocket.ts +157 -147
- package/src/http/routes/twilio-voice-webhook.test.ts +14 -43
- package/src/http/routes/types.ts +92 -10
- package/src/http/routes/upgrade-broadcast-proxy.ts +38 -32
- package/src/http/routes/upgrade-policy.ts +186 -0
- package/src/http/routes/user-profile.test.ts +129 -0
- package/src/http/routes/user-profile.ts +204 -0
- package/src/http/routes/vercel-control-plane-proxy.ts +74 -52
- package/src/http/routes/watch-stream-websocket.ts +99 -138
- package/src/http/routes/webhook-routes.ts +214 -0
- package/src/http/routes/whatsapp-webhook.test.ts +3 -19
- package/src/http/routes/whatsapp-webhook.ts +2 -1
- package/src/http/routes/workspace-commit-proxy.ts +38 -30
- package/src/index.ts +298 -2481
- package/src/ipc/__tests__/admission-policy-handlers.test.ts +4 -18
- package/src/ipc/__tests__/guardian-request-routes.test.ts +7 -3
- package/src/ipc/__tests__/invite-ipc-routes.test.ts +13 -5
- package/src/ipc/__tests__/verification-session-routes.test.ts +5 -3
- package/src/ipc/admission-policy-handlers.ts +2 -2
- package/src/ipc/channel-socket-health-handlers.test.ts +56 -41
- package/src/ipc/channel-socket-health-handlers.ts +41 -31
- package/src/ipc/credential-request-handlers.ts +43 -19
- package/src/ipc/log-tail-handlers.test.ts +8 -35
- package/src/ipc/log-tail-handlers.ts +8 -11
- package/src/ipc/risk-classification-handlers.test.ts +0 -3
- package/src/ipc/risk-classification-handlers.ts +4 -4
- package/src/ipc/routes.ts +37 -0
- package/src/ipc/server.ts +13 -43
- package/src/ipc/trust-rules-handlers.test.ts +1 -2
- package/src/ipc/tunnel-handlers.ts +18 -18
- package/src/ipc/webhook-route-handlers.test.ts +5 -27
- package/src/ipc/webhook-route-handlers.ts +35 -39
- package/src/logger.ts +6 -26
- package/src/paths.ts +4 -4
- package/src/remote-web/pairing-challenge-store.ts +6 -35
- package/src/remote-web/pairing-mint.ts +2 -6
- package/src/remote-web/public-base-url.ts +65 -0
- package/src/risk/admission-policy-cache.ts +5 -12
- package/src/risk/bash-risk-classifier.test.ts +5 -6
- package/src/risk/bash-risk-classifier.ts +0 -3
- package/src/risk/command-registry/commands/gateway.ts +2 -1
- package/src/risk/file-risk-classifier.test.ts +1 -8
- package/src/risk/project-boundary.test.ts +3 -1
- package/src/risk/shell-identity.ts +1 -4
- package/src/risk/shell-parser.ts +1 -5
- package/src/risk/skill-risk-classifier.ts +1 -2
- package/src/runtime/client.ts +33 -27
- package/src/schema.ts +725 -163
- package/src/slack/errors.ts +1 -2
- package/src/slack/lifecycle.ts +327 -0
- package/src/slack/message-schemas.ts +1 -1
- package/src/slack/slack-web.ts +0 -1
- package/src/slack/socket-mode.ts +1 -1
- package/src/sleep-wake-detector.ts +62 -33
- package/src/telegram/normalize.test.ts +1 -1
- package/src/telegram/normalize.ts +1 -1
- package/src/telegram/send.test.ts +3 -19
- package/src/telegram/webhook-manager.ts +16 -31
- package/src/tunnel/allowed-paths.test.ts +27 -65
- package/src/tunnel/allowed-paths.ts +2 -27
- package/src/tunnel/binary-websocket.ts +1 -2
- package/src/tunnel/bridge-utils.ts +3 -8
- package/src/tunnel/client.test.ts +80 -67
- package/src/tunnel/client.ts +36 -28
- package/src/tunnel/http-bridge.test.ts +13 -40
- package/src/tunnel/websocket-bridge.test.ts +11 -2
- package/src/tunnel/websocket-bridge.ts +3 -1
- package/src/twilio/webhook-sync-trigger.ts +4 -4
- package/src/twilio/webhook-sync.test.ts +1 -33
- package/src/twilio/webhook-sync.ts +0 -4
- package/src/verification/code-parsing.ts +0 -3
- package/src/verification/rate-limit-helpers.ts +6 -2
- package/src/verification/session-service.ts +1 -1
- package/src/verification/shared-invite-registration.ts +3 -13
- package/src/verification/text-verification.ts +1 -1
- package/src/whatsapp/normalize.ts +1 -1
- package/node_modules/@mycadet/environments/src/__tests__/cloud-assistant-hub-url.test.ts +0 -38
- package/node_modules/@mycadet/environments/src/seeds.ts +0 -99
- package/node_modules/@mycadet/environments/src/types.ts +0 -70
- package/openapi.json +0 -2325
- package/src/__tests__/feature-flag-defaults-sync.test.ts +0 -44
- package/src/__tests__/feature-flag-resolver.test.ts +0 -151
- package/src/__tests__/feature-flag-watcher-callback.test.ts +0 -63
- package/src/__tests__/feature-flags-route.test.ts +0 -764
- package/src/__tests__/guardian-init-lockfile.test.ts +0 -883
- package/src/__tests__/ipc-feature-flag-routes.test.ts +0 -240
- package/src/__tests__/pair-device-bound.test.ts +0 -296
- package/src/__tests__/remote-web-ingress-denylist.test.ts +0 -113
- package/src/__tests__/remote-web-pairing-requests.test.ts +0 -277
- package/src/__tests__/route-schema-guard.test.ts +0 -489
- package/src/cloud-user-id.ts +0 -12
- package/src/feature-flag-defaults.ts +0 -197
- package/src/feature-flag-env-overrides.test.ts +0 -166
- package/src/feature-flag-env-overrides.ts +0 -58
- package/src/feature-flag-registry.json +0 -506
- package/src/feature-flag-resolver.ts +0 -47
- package/src/feature-flag-store.ts +0 -115
- package/src/feature-flag-watcher.ts +0 -105
- package/src/http/routes/a2a-routes.test.ts +0 -146
- package/src/http/routes/a2a-routes.ts +0 -126
- package/src/http/routes/auto-approve-thresholds-routes.ts +0 -92
- package/src/http/routes/channel-admission-policy-routes.ts +0 -67
- package/src/http/routes/channel-ingress-routes.ts +0 -135
- package/src/http/routes/channel-permission-overrides-routes.ts +0 -92
- package/src/http/routes/contacts-control-plane-routes.ts +0 -278
- package/src/http/routes/feature-flags.ts +0 -185
- package/src/http/routes/remote-web-pairing-requests.ts +0 -123
- package/src/http/routes/trust-rules-routes.ts +0 -188
- package/src/ipc/feature-flag-handlers.ts +0 -63
- package/src/types.ts +0 -11
package/src/schema.ts
CHANGED
|
@@ -168,6 +168,325 @@ export function buildSchema(): Record<string, unknown> {
|
|
|
168
168
|
},
|
|
169
169
|
},
|
|
170
170
|
},
|
|
171
|
+
"/v1/handle-available": {
|
|
172
|
+
get: {
|
|
173
|
+
summary: "Check assistant handle availability",
|
|
174
|
+
description:
|
|
175
|
+
"Cloud-namespace check proxied on the assistant's own credentials. The candidate handle is lowercased before the check.",
|
|
176
|
+
operationId: "handleAvailableRetrieve",
|
|
177
|
+
security: [{ BearerAuth: [] }],
|
|
178
|
+
parameters: [
|
|
179
|
+
{
|
|
180
|
+
name: "handle",
|
|
181
|
+
in: "query",
|
|
182
|
+
required: true,
|
|
183
|
+
schema: { type: "string" },
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
responses: {
|
|
187
|
+
"200": {
|
|
188
|
+
description: "Availability verdict",
|
|
189
|
+
content: {
|
|
190
|
+
"application/json": {
|
|
191
|
+
schema: {
|
|
192
|
+
type: "object",
|
|
193
|
+
properties: {
|
|
194
|
+
available: { type: "boolean" },
|
|
195
|
+
code: { type: ["string", "null"] },
|
|
196
|
+
message: { type: ["string", "null"] },
|
|
197
|
+
},
|
|
198
|
+
required: ["available", "code", "message"],
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
"401": {
|
|
204
|
+
description: "Unauthorized — missing or invalid bearer token",
|
|
205
|
+
},
|
|
206
|
+
"502": { description: "Failed to reach the cloud" },
|
|
207
|
+
"503": { description: "Assistant credentials not provisioned" },
|
|
208
|
+
"504": { description: "Cloud request timed out" },
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
"/v1/handle": {
|
|
213
|
+
patch: {
|
|
214
|
+
summary: "Claim the assistant's public handle",
|
|
215
|
+
description:
|
|
216
|
+
"Cloud write proxied on the assistant's own credentials — the assistant's public handle is a cloud identity (one global namespace). Failures come back as DRF field errors ({handle: [{code, string}]}).",
|
|
217
|
+
operationId: "handlePartialUpdate",
|
|
218
|
+
security: [{ BearerAuth: [] }],
|
|
219
|
+
requestBody: {
|
|
220
|
+
required: true,
|
|
221
|
+
content: {
|
|
222
|
+
"application/json": {
|
|
223
|
+
schema: {
|
|
224
|
+
type: "object",
|
|
225
|
+
properties: { handle: { type: "string" } },
|
|
226
|
+
required: ["handle"],
|
|
227
|
+
additionalProperties: false,
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
responses: {
|
|
233
|
+
"200": {
|
|
234
|
+
description: "The cloud's assistant record, answered verbatim",
|
|
235
|
+
content: {
|
|
236
|
+
"application/json": {
|
|
237
|
+
schema: {
|
|
238
|
+
type: "object",
|
|
239
|
+
properties: { handle: { type: "string" } },
|
|
240
|
+
additionalProperties: true,
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
"400": { description: "Invalid handle (DRF field errors)" },
|
|
246
|
+
"401": {
|
|
247
|
+
description: "Unauthorized — missing or invalid bearer token",
|
|
248
|
+
},
|
|
249
|
+
"409": { description: "Handle already claimed" },
|
|
250
|
+
"502": { description: "Failed to reach the cloud" },
|
|
251
|
+
"503": { description: "Assistant credentials not provisioned" },
|
|
252
|
+
"504": { description: "Cloud request timed out" },
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
"/v1/domains": {
|
|
257
|
+
get: {
|
|
258
|
+
summary: "List the assistant's domains",
|
|
259
|
+
description:
|
|
260
|
+
"The cloud's domain registrations for this assistant, proxied on its own credentials — the registered subdomain holds the handle.",
|
|
261
|
+
operationId: "domainsList",
|
|
262
|
+
security: [{ BearerAuth: [] }],
|
|
263
|
+
responses: {
|
|
264
|
+
"200": {
|
|
265
|
+
description: "Paginated domain list",
|
|
266
|
+
content: {
|
|
267
|
+
"application/json": {
|
|
268
|
+
schema: {
|
|
269
|
+
type: "object",
|
|
270
|
+
properties: {
|
|
271
|
+
results: {
|
|
272
|
+
type: "array",
|
|
273
|
+
items: {
|
|
274
|
+
type: "object",
|
|
275
|
+
properties: {
|
|
276
|
+
subdomain: { type: "string" },
|
|
277
|
+
status: { type: "string" },
|
|
278
|
+
},
|
|
279
|
+
required: ["subdomain", "status"],
|
|
280
|
+
additionalProperties: true,
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
required: ["results"],
|
|
285
|
+
additionalProperties: true,
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
"401": {
|
|
291
|
+
description: "Unauthorized — missing or invalid bearer token",
|
|
292
|
+
},
|
|
293
|
+
"502": { description: "Failed to reach the cloud" },
|
|
294
|
+
"503": { description: "Assistant credentials not provisioned" },
|
|
295
|
+
"504": { description: "Cloud request timed out" },
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
"/v1/user/me": {
|
|
300
|
+
get: {
|
|
301
|
+
summary: "Get the user's account profile",
|
|
302
|
+
description:
|
|
303
|
+
"The assistant tracks the user's profile for them: the handle rides the guardian's cadet channel address, the email their email channel, and the name their contact displayName.",
|
|
304
|
+
operationId: "userMeGet",
|
|
305
|
+
security: [{ BearerAuth: [] }],
|
|
306
|
+
responses: {
|
|
307
|
+
"200": {
|
|
308
|
+
description: "The user's profile",
|
|
309
|
+
content: {
|
|
310
|
+
"application/json": {
|
|
311
|
+
schema: {
|
|
312
|
+
$ref: "#/components/schemas/UserProfile",
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
"401": {
|
|
318
|
+
description: "Unauthorized — missing or invalid bearer token",
|
|
319
|
+
},
|
|
320
|
+
"404": { description: "No guardian profile is bound yet" },
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
patch: {
|
|
324
|
+
summary: "Update the user's account profile",
|
|
325
|
+
description:
|
|
326
|
+
"Writes the guardian's cadet channel address. Handle rules are enforced locally and failures come back as DRF field errors ({username: [{code, string}]}).",
|
|
327
|
+
operationId: "userMePartialUpdate",
|
|
328
|
+
security: [{ BearerAuth: [] }],
|
|
329
|
+
requestBody: {
|
|
330
|
+
required: true,
|
|
331
|
+
content: {
|
|
332
|
+
"application/json": {
|
|
333
|
+
schema: {
|
|
334
|
+
type: "object",
|
|
335
|
+
properties: { username: { type: "string", minLength: 1 } },
|
|
336
|
+
additionalProperties: false,
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
responses: {
|
|
342
|
+
"200": {
|
|
343
|
+
description: "The updated profile",
|
|
344
|
+
content: {
|
|
345
|
+
"application/json": {
|
|
346
|
+
schema: {
|
|
347
|
+
$ref: "#/components/schemas/UserProfile",
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
"400": { description: "Invalid username (DRF field errors)" },
|
|
353
|
+
"401": {
|
|
354
|
+
description: "Unauthorized — missing or invalid bearer token",
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
"/v1/terminal/sessions": {
|
|
360
|
+
post: {
|
|
361
|
+
summary: "Create a terminal session",
|
|
362
|
+
description:
|
|
363
|
+
"Cloud write proxied on the assistant's own credentials. The cloud spawns the PTY and answers its session record.",
|
|
364
|
+
operationId: "terminalSessionsCreate",
|
|
365
|
+
security: [{ BearerAuth: [] }],
|
|
366
|
+
requestBody: {
|
|
367
|
+
content: {
|
|
368
|
+
"application/json": {
|
|
369
|
+
schema: { type: "object", additionalProperties: true },
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
},
|
|
373
|
+
responses: {
|
|
374
|
+
"200": {
|
|
375
|
+
description: "The cloud's session record",
|
|
376
|
+
content: {
|
|
377
|
+
"application/json": {
|
|
378
|
+
schema: {
|
|
379
|
+
type: "object",
|
|
380
|
+
properties: { session_id: { type: "string" } },
|
|
381
|
+
required: ["session_id"],
|
|
382
|
+
additionalProperties: true,
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
},
|
|
386
|
+
},
|
|
387
|
+
"401": {
|
|
388
|
+
description: "Unauthorized — missing or invalid bearer token",
|
|
389
|
+
},
|
|
390
|
+
"502": { description: "Failed to reach the cloud" },
|
|
391
|
+
"503": { description: "Assistant credentials not provisioned" },
|
|
392
|
+
"504": { description: "Cloud request timed out" },
|
|
393
|
+
},
|
|
394
|
+
},
|
|
395
|
+
},
|
|
396
|
+
"/v1/terminal/sessions/{session_id}": {
|
|
397
|
+
delete: {
|
|
398
|
+
summary: "Destroy a terminal session",
|
|
399
|
+
description:
|
|
400
|
+
"Cloud write proxied on the assistant's own credentials — the session id rides the upstream path.",
|
|
401
|
+
operationId: "terminalSessionsDestroy",
|
|
402
|
+
security: [{ BearerAuth: [] }],
|
|
403
|
+
parameters: [
|
|
404
|
+
{
|
|
405
|
+
name: "session_id",
|
|
406
|
+
in: "path",
|
|
407
|
+
required: true,
|
|
408
|
+
schema: { type: "string" },
|
|
409
|
+
},
|
|
410
|
+
],
|
|
411
|
+
responses: {
|
|
412
|
+
"200": { description: "Session destroyed" },
|
|
413
|
+
"401": {
|
|
414
|
+
description: "Unauthorized — missing or invalid bearer token",
|
|
415
|
+
},
|
|
416
|
+
"502": { description: "Failed to reach the cloud" },
|
|
417
|
+
"503": { description: "Assistant credentials not provisioned" },
|
|
418
|
+
"504": { description: "Cloud request timed out" },
|
|
419
|
+
},
|
|
420
|
+
},
|
|
421
|
+
},
|
|
422
|
+
"/v1/terminal/sessions/{session_id}/input": {
|
|
423
|
+
post: {
|
|
424
|
+
summary: "Write to a terminal session",
|
|
425
|
+
description:
|
|
426
|
+
"Cloud write proxied on the assistant's own credentials — PTY input bytes batched by the web's terminal session hook.",
|
|
427
|
+
operationId: "terminalSessionsInputCreate",
|
|
428
|
+
security: [{ BearerAuth: [] }],
|
|
429
|
+
parameters: [
|
|
430
|
+
{
|
|
431
|
+
name: "session_id",
|
|
432
|
+
in: "path",
|
|
433
|
+
required: true,
|
|
434
|
+
schema: { type: "string" },
|
|
435
|
+
},
|
|
436
|
+
],
|
|
437
|
+
requestBody: {
|
|
438
|
+
required: true,
|
|
439
|
+
content: {
|
|
440
|
+
"application/json": {
|
|
441
|
+
schema: { type: "object", additionalProperties: true },
|
|
442
|
+
},
|
|
443
|
+
},
|
|
444
|
+
},
|
|
445
|
+
responses: {
|
|
446
|
+
"200": { description: "Input accepted" },
|
|
447
|
+
"401": {
|
|
448
|
+
description: "Unauthorized — missing or invalid bearer token",
|
|
449
|
+
},
|
|
450
|
+
"502": { description: "Failed to reach the cloud" },
|
|
451
|
+
"503": { description: "Assistant credentials not provisioned" },
|
|
452
|
+
"504": { description: "Cloud request timed out" },
|
|
453
|
+
},
|
|
454
|
+
},
|
|
455
|
+
},
|
|
456
|
+
"/v1/terminal/sessions/{session_id}/resize": {
|
|
457
|
+
post: {
|
|
458
|
+
summary: "Resize a terminal session",
|
|
459
|
+
description:
|
|
460
|
+
"Cloud write proxied on the assistant's own credentials — the web's debounced PTY resize.",
|
|
461
|
+
operationId: "terminalSessionsResizeCreate",
|
|
462
|
+
security: [{ BearerAuth: [] }],
|
|
463
|
+
parameters: [
|
|
464
|
+
{
|
|
465
|
+
name: "session_id",
|
|
466
|
+
in: "path",
|
|
467
|
+
required: true,
|
|
468
|
+
schema: { type: "string" },
|
|
469
|
+
},
|
|
470
|
+
],
|
|
471
|
+
requestBody: {
|
|
472
|
+
required: true,
|
|
473
|
+
content: {
|
|
474
|
+
"application/json": {
|
|
475
|
+
schema: { type: "object", additionalProperties: true },
|
|
476
|
+
},
|
|
477
|
+
},
|
|
478
|
+
},
|
|
479
|
+
responses: {
|
|
480
|
+
"200": { description: "Resize accepted" },
|
|
481
|
+
"401": {
|
|
482
|
+
description: "Unauthorized — missing or invalid bearer token",
|
|
483
|
+
},
|
|
484
|
+
"502": { description: "Failed to reach the cloud" },
|
|
485
|
+
"503": { description: "Assistant credentials not provisioned" },
|
|
486
|
+
"504": { description: "Cloud request timed out" },
|
|
487
|
+
},
|
|
488
|
+
},
|
|
489
|
+
},
|
|
171
490
|
"/v1/ps": {
|
|
172
491
|
get: {
|
|
173
492
|
summary: "Process status",
|
|
@@ -2092,52 +2411,6 @@ export function buildSchema(): Record<string, unknown> {
|
|
|
2092
2411
|
},
|
|
2093
2412
|
},
|
|
2094
2413
|
},
|
|
2095
|
-
"/v1/guardian/init": {
|
|
2096
|
-
post: {
|
|
2097
|
-
summary: "Initialize guardian",
|
|
2098
|
-
description:
|
|
2099
|
-
"Authenticated gateway endpoint that initializes the guardian identity and binds it to the assistant runtime.",
|
|
2100
|
-
operationId: "guardianInit",
|
|
2101
|
-
security: [{ BearerAuth: [] }],
|
|
2102
|
-
requestBody: {
|
|
2103
|
-
required: true,
|
|
2104
|
-
content: {
|
|
2105
|
-
"application/json": {
|
|
2106
|
-
schema: { type: "object", additionalProperties: true },
|
|
2107
|
-
},
|
|
2108
|
-
},
|
|
2109
|
-
},
|
|
2110
|
-
responses: {
|
|
2111
|
-
"200": { description: "Guardian initialized" },
|
|
2112
|
-
"400": { description: "Invalid request payload" },
|
|
2113
|
-
"401": {
|
|
2114
|
-
description: "Unauthorized — missing or invalid bearer token",
|
|
2115
|
-
},
|
|
2116
|
-
"503": { description: "Bearer token not configured" },
|
|
2117
|
-
"502": { description: "Failed to reach assistant runtime" },
|
|
2118
|
-
"504": { description: "Assistant runtime request timed out" },
|
|
2119
|
-
},
|
|
2120
|
-
},
|
|
2121
|
-
},
|
|
2122
|
-
"/v1/guardian/reset-bootstrap": {
|
|
2123
|
-
post: {
|
|
2124
|
-
summary: "Reset guardian bootstrap lock",
|
|
2125
|
-
description:
|
|
2126
|
-
"Loopback-only endpoint that removes the guardian-init lock file so that /v1/guardian/init can be called again. When bootstrap secrets are configured, callers must provide a valid x-bootstrap-secret header. Used by the desktop app to recover from a lost actor token.",
|
|
2127
|
-
operationId: "guardianResetBootstrap",
|
|
2128
|
-
responses: {
|
|
2129
|
-
"200": { description: "Lock file removed, or already absent" },
|
|
2130
|
-
"403": {
|
|
2131
|
-
description:
|
|
2132
|
-
"Forbidden — non-loopback origin or invalid bootstrap secret",
|
|
2133
|
-
},
|
|
2134
|
-
"409": {
|
|
2135
|
-
description: "Guardian init is in progress — try again shortly",
|
|
2136
|
-
},
|
|
2137
|
-
"500": { description: "Failed to remove lock file" },
|
|
2138
|
-
},
|
|
2139
|
-
},
|
|
2140
|
-
},
|
|
2141
2414
|
"/v1/channel-verification-sessions/revoke": {
|
|
2142
2415
|
post: {
|
|
2143
2416
|
summary: "Revoke verification binding",
|
|
@@ -2833,122 +3106,6 @@ export function buildSchema(): Record<string, unknown> {
|
|
|
2833
3106
|
},
|
|
2834
3107
|
},
|
|
2835
3108
|
},
|
|
2836
|
-
"/v1/feature-flags": {
|
|
2837
|
-
get: {
|
|
2838
|
-
summary: "List feature flags",
|
|
2839
|
-
description:
|
|
2840
|
-
"Scope-protected gateway endpoint that lists current feature flag values. Requires a bearer token with `feature_flags.read` scope.",
|
|
2841
|
-
operationId: "featureFlagsGet",
|
|
2842
|
-
security: [{ BearerAuth: [] }],
|
|
2843
|
-
responses: {
|
|
2844
|
-
"200": { description: "Feature flags returned" },
|
|
2845
|
-
"401": {
|
|
2846
|
-
description: "Unauthorized — missing or invalid bearer token",
|
|
2847
|
-
},
|
|
2848
|
-
"403": { description: "Insufficient scope" },
|
|
2849
|
-
},
|
|
2850
|
-
},
|
|
2851
|
-
},
|
|
2852
|
-
"/v1/feature-flags/{flagKey}": {
|
|
2853
|
-
patch: {
|
|
2854
|
-
summary: "Update a feature flag",
|
|
2855
|
-
description:
|
|
2856
|
-
"Scope-protected gateway endpoint that updates a single feature flag value. Requires a bearer token with `feature_flags.write` scope.",
|
|
2857
|
-
operationId: "featureFlagsPatch",
|
|
2858
|
-
security: [{ BearerAuth: [] }],
|
|
2859
|
-
parameters: [
|
|
2860
|
-
{
|
|
2861
|
-
name: "flagKey",
|
|
2862
|
-
in: "path",
|
|
2863
|
-
required: true,
|
|
2864
|
-
schema: { type: "string" },
|
|
2865
|
-
description: "The feature flag key to update.",
|
|
2866
|
-
},
|
|
2867
|
-
],
|
|
2868
|
-
requestBody: {
|
|
2869
|
-
required: true,
|
|
2870
|
-
content: {
|
|
2871
|
-
"application/json": {
|
|
2872
|
-
schema: { type: "object", additionalProperties: true },
|
|
2873
|
-
},
|
|
2874
|
-
},
|
|
2875
|
-
},
|
|
2876
|
-
responses: {
|
|
2877
|
-
"200": { description: "Feature flag updated" },
|
|
2878
|
-
"400": { description: "Invalid flag key encoding" },
|
|
2879
|
-
"401": {
|
|
2880
|
-
description: "Unauthorized — missing or invalid bearer token",
|
|
2881
|
-
},
|
|
2882
|
-
"403": { description: "Insufficient scope" },
|
|
2883
|
-
},
|
|
2884
|
-
},
|
|
2885
|
-
},
|
|
2886
|
-
"/v1/assistants/{assistantId}/feature-flags": {
|
|
2887
|
-
get: {
|
|
2888
|
-
summary: "List feature flags (assistant-scoped)",
|
|
2889
|
-
description:
|
|
2890
|
-
"Assistant-scoped variant of the feature flags endpoint. Requires a bearer token with `feature_flags.read` scope.",
|
|
2891
|
-
operationId: "assistantFeatureFlagsGet",
|
|
2892
|
-
security: [{ BearerAuth: [] }],
|
|
2893
|
-
parameters: [
|
|
2894
|
-
{
|
|
2895
|
-
name: "assistantId",
|
|
2896
|
-
in: "path",
|
|
2897
|
-
required: true,
|
|
2898
|
-
schema: { type: "string" },
|
|
2899
|
-
description: "The assistant identifier.",
|
|
2900
|
-
},
|
|
2901
|
-
],
|
|
2902
|
-
responses: {
|
|
2903
|
-
"200": { description: "Feature flags returned" },
|
|
2904
|
-
"401": {
|
|
2905
|
-
description: "Unauthorized — missing or invalid bearer token",
|
|
2906
|
-
},
|
|
2907
|
-
"403": { description: "Insufficient scope" },
|
|
2908
|
-
},
|
|
2909
|
-
},
|
|
2910
|
-
},
|
|
2911
|
-
"/v1/assistants/{assistantId}/feature-flags/{flagKey}": {
|
|
2912
|
-
patch: {
|
|
2913
|
-
summary: "Update a feature flag (assistant-scoped)",
|
|
2914
|
-
description:
|
|
2915
|
-
"Assistant-scoped variant of the feature flag update endpoint. Requires a bearer token with `feature_flags.write` scope.",
|
|
2916
|
-
operationId: "assistantFeatureFlagsPatch",
|
|
2917
|
-
security: [{ BearerAuth: [] }],
|
|
2918
|
-
parameters: [
|
|
2919
|
-
{
|
|
2920
|
-
name: "assistantId",
|
|
2921
|
-
in: "path",
|
|
2922
|
-
required: true,
|
|
2923
|
-
schema: { type: "string" },
|
|
2924
|
-
description: "The assistant identifier.",
|
|
2925
|
-
},
|
|
2926
|
-
{
|
|
2927
|
-
name: "flagKey",
|
|
2928
|
-
in: "path",
|
|
2929
|
-
required: true,
|
|
2930
|
-
schema: { type: "string" },
|
|
2931
|
-
description: "The feature flag key to update.",
|
|
2932
|
-
},
|
|
2933
|
-
],
|
|
2934
|
-
requestBody: {
|
|
2935
|
-
required: true,
|
|
2936
|
-
content: {
|
|
2937
|
-
"application/json": {
|
|
2938
|
-
schema: { type: "object", additionalProperties: true },
|
|
2939
|
-
},
|
|
2940
|
-
},
|
|
2941
|
-
},
|
|
2942
|
-
responses: {
|
|
2943
|
-
"200": { description: "Feature flag updated" },
|
|
2944
|
-
"400": { description: "Invalid flag key encoding" },
|
|
2945
|
-
"401": {
|
|
2946
|
-
description: "Unauthorized — missing or invalid bearer token",
|
|
2947
|
-
},
|
|
2948
|
-
"403": { description: "Insufficient scope" },
|
|
2949
|
-
},
|
|
2950
|
-
},
|
|
2951
|
-
},
|
|
2952
3109
|
"/v1/permissions/thresholds": {
|
|
2953
3110
|
get: {
|
|
2954
3111
|
summary: "Get global auto-approve thresholds",
|
|
@@ -3297,6 +3454,400 @@ export function buildSchema(): Record<string, unknown> {
|
|
|
3297
3454
|
},
|
|
3298
3455
|
},
|
|
3299
3456
|
},
|
|
3457
|
+
"/v1/upgrade-policy": {
|
|
3458
|
+
get: {
|
|
3459
|
+
summary: "Get the assistant's automatic-upgrade schedule",
|
|
3460
|
+
description:
|
|
3461
|
+
"Returns the stored policy, or the defaults (enabled, weekly, Mon 06:00–08:00 UTC) when none has been saved yet.",
|
|
3462
|
+
operationId: "upgradePolicyGet",
|
|
3463
|
+
security: [{ EdgeScoped: [] }],
|
|
3464
|
+
responses: {
|
|
3465
|
+
"200": {
|
|
3466
|
+
description: "Current upgrade policy",
|
|
3467
|
+
content: {
|
|
3468
|
+
"application/json": {
|
|
3469
|
+
schema: {
|
|
3470
|
+
type: "object",
|
|
3471
|
+
properties: {
|
|
3472
|
+
enabled: { type: "boolean" },
|
|
3473
|
+
timezone: { type: "string", maxLength: 64 },
|
|
3474
|
+
schedule: {
|
|
3475
|
+
type: "object",
|
|
3476
|
+
properties: {
|
|
3477
|
+
frequency: {
|
|
3478
|
+
type: "string",
|
|
3479
|
+
enum: ["daily", "weekly", "monthly"],
|
|
3480
|
+
},
|
|
3481
|
+
days_of_week: {
|
|
3482
|
+
type: "array",
|
|
3483
|
+
items: { type: "integer", minimum: 0, maximum: 6 },
|
|
3484
|
+
},
|
|
3485
|
+
days_of_month: {
|
|
3486
|
+
type: "array",
|
|
3487
|
+
items: { type: "integer", minimum: 1, maximum: 31 },
|
|
3488
|
+
},
|
|
3489
|
+
window: {
|
|
3490
|
+
type: "object",
|
|
3491
|
+
properties: {
|
|
3492
|
+
start: {
|
|
3493
|
+
type: "string",
|
|
3494
|
+
pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
3495
|
+
},
|
|
3496
|
+
end: {
|
|
3497
|
+
type: "string",
|
|
3498
|
+
pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
3499
|
+
},
|
|
3500
|
+
},
|
|
3501
|
+
required: ["start", "end"],
|
|
3502
|
+
additionalProperties: false,
|
|
3503
|
+
},
|
|
3504
|
+
},
|
|
3505
|
+
required: [
|
|
3506
|
+
"frequency",
|
|
3507
|
+
"days_of_week",
|
|
3508
|
+
"days_of_month",
|
|
3509
|
+
"window",
|
|
3510
|
+
],
|
|
3511
|
+
additionalProperties: false,
|
|
3512
|
+
},
|
|
3513
|
+
},
|
|
3514
|
+
required: ["enabled", "timezone", "schedule"],
|
|
3515
|
+
additionalProperties: false,
|
|
3516
|
+
},
|
|
3517
|
+
},
|
|
3518
|
+
},
|
|
3519
|
+
},
|
|
3520
|
+
"500": { description: "Internal server error" },
|
|
3521
|
+
},
|
|
3522
|
+
},
|
|
3523
|
+
put: {
|
|
3524
|
+
summary: "Save the assistant's automatic-upgrade schedule",
|
|
3525
|
+
description:
|
|
3526
|
+
"Full replace — the request body is the complete policy.",
|
|
3527
|
+
operationId: "upgradePolicyPut",
|
|
3528
|
+
security: [{ EdgeScoped: [] }],
|
|
3529
|
+
requestBody: {
|
|
3530
|
+
required: true,
|
|
3531
|
+
content: {
|
|
3532
|
+
"application/json": {
|
|
3533
|
+
schema: {
|
|
3534
|
+
type: "object",
|
|
3535
|
+
properties: {
|
|
3536
|
+
enabled: { type: "boolean" },
|
|
3537
|
+
timezone: { type: "string", maxLength: 64 },
|
|
3538
|
+
schedule: {
|
|
3539
|
+
type: "object",
|
|
3540
|
+
properties: {
|
|
3541
|
+
frequency: {
|
|
3542
|
+
type: "string",
|
|
3543
|
+
enum: ["daily", "weekly", "monthly"],
|
|
3544
|
+
},
|
|
3545
|
+
days_of_week: {
|
|
3546
|
+
type: "array",
|
|
3547
|
+
items: { type: "integer", minimum: 0, maximum: 6 },
|
|
3548
|
+
},
|
|
3549
|
+
days_of_month: {
|
|
3550
|
+
type: "array",
|
|
3551
|
+
items: { type: "integer", minimum: 1, maximum: 31 },
|
|
3552
|
+
},
|
|
3553
|
+
window: {
|
|
3554
|
+
type: "object",
|
|
3555
|
+
properties: {
|
|
3556
|
+
start: {
|
|
3557
|
+
type: "string",
|
|
3558
|
+
pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
3559
|
+
},
|
|
3560
|
+
end: {
|
|
3561
|
+
type: "string",
|
|
3562
|
+
pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
3563
|
+
},
|
|
3564
|
+
},
|
|
3565
|
+
required: ["start", "end"],
|
|
3566
|
+
additionalProperties: false,
|
|
3567
|
+
},
|
|
3568
|
+
},
|
|
3569
|
+
required: [
|
|
3570
|
+
"frequency",
|
|
3571
|
+
"days_of_week",
|
|
3572
|
+
"days_of_month",
|
|
3573
|
+
"window",
|
|
3574
|
+
],
|
|
3575
|
+
additionalProperties: false,
|
|
3576
|
+
},
|
|
3577
|
+
},
|
|
3578
|
+
required: ["enabled", "timezone", "schedule"],
|
|
3579
|
+
additionalProperties: false,
|
|
3580
|
+
},
|
|
3581
|
+
},
|
|
3582
|
+
},
|
|
3583
|
+
},
|
|
3584
|
+
responses: {
|
|
3585
|
+
"200": {
|
|
3586
|
+
description: "Saved upgrade policy",
|
|
3587
|
+
content: {
|
|
3588
|
+
"application/json": {
|
|
3589
|
+
schema: {
|
|
3590
|
+
type: "object",
|
|
3591
|
+
properties: {
|
|
3592
|
+
enabled: { type: "boolean" },
|
|
3593
|
+
timezone: { type: "string", maxLength: 64 },
|
|
3594
|
+
schedule: {
|
|
3595
|
+
type: "object",
|
|
3596
|
+
properties: {
|
|
3597
|
+
frequency: {
|
|
3598
|
+
type: "string",
|
|
3599
|
+
enum: ["daily", "weekly", "monthly"],
|
|
3600
|
+
},
|
|
3601
|
+
days_of_week: {
|
|
3602
|
+
type: "array",
|
|
3603
|
+
items: { type: "integer", minimum: 0, maximum: 6 },
|
|
3604
|
+
},
|
|
3605
|
+
days_of_month: {
|
|
3606
|
+
type: "array",
|
|
3607
|
+
items: { type: "integer", minimum: 1, maximum: 31 },
|
|
3608
|
+
},
|
|
3609
|
+
window: {
|
|
3610
|
+
type: "object",
|
|
3611
|
+
properties: {
|
|
3612
|
+
start: {
|
|
3613
|
+
type: "string",
|
|
3614
|
+
pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
3615
|
+
},
|
|
3616
|
+
end: {
|
|
3617
|
+
type: "string",
|
|
3618
|
+
pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
3619
|
+
},
|
|
3620
|
+
},
|
|
3621
|
+
required: ["start", "end"],
|
|
3622
|
+
additionalProperties: false,
|
|
3623
|
+
},
|
|
3624
|
+
},
|
|
3625
|
+
required: [
|
|
3626
|
+
"frequency",
|
|
3627
|
+
"days_of_week",
|
|
3628
|
+
"days_of_month",
|
|
3629
|
+
"window",
|
|
3630
|
+
],
|
|
3631
|
+
additionalProperties: false,
|
|
3632
|
+
},
|
|
3633
|
+
},
|
|
3634
|
+
required: ["enabled", "timezone", "schedule"],
|
|
3635
|
+
additionalProperties: false,
|
|
3636
|
+
},
|
|
3637
|
+
},
|
|
3638
|
+
},
|
|
3639
|
+
},
|
|
3640
|
+
"400": { description: "Invalid request body" },
|
|
3641
|
+
"500": { description: "Internal server error" },
|
|
3642
|
+
},
|
|
3643
|
+
},
|
|
3644
|
+
},
|
|
3645
|
+
"/v1/assistants/{assistantId}/upgrade-policy": {
|
|
3646
|
+
get: {
|
|
3647
|
+
summary:
|
|
3648
|
+
"Get the assistant's automatic-upgrade schedule (assistant-scoped)",
|
|
3649
|
+
description:
|
|
3650
|
+
"Returns the stored policy, or the defaults (enabled, weekly, Mon 06:00–08:00 UTC) when none has been saved yet.",
|
|
3651
|
+
operationId: "upgradePolicyGetScoped",
|
|
3652
|
+
security: [{ EdgeScoped: [] }],
|
|
3653
|
+
parameters: [
|
|
3654
|
+
{
|
|
3655
|
+
name: "assistantId",
|
|
3656
|
+
in: "path",
|
|
3657
|
+
required: true,
|
|
3658
|
+
schema: { type: "string" },
|
|
3659
|
+
},
|
|
3660
|
+
],
|
|
3661
|
+
responses: {
|
|
3662
|
+
"200": {
|
|
3663
|
+
description: "Current upgrade policy",
|
|
3664
|
+
content: {
|
|
3665
|
+
"application/json": {
|
|
3666
|
+
schema: {
|
|
3667
|
+
type: "object",
|
|
3668
|
+
properties: {
|
|
3669
|
+
enabled: { type: "boolean" },
|
|
3670
|
+
timezone: { type: "string", maxLength: 64 },
|
|
3671
|
+
schedule: {
|
|
3672
|
+
type: "object",
|
|
3673
|
+
properties: {
|
|
3674
|
+
frequency: {
|
|
3675
|
+
type: "string",
|
|
3676
|
+
enum: ["daily", "weekly", "monthly"],
|
|
3677
|
+
},
|
|
3678
|
+
days_of_week: {
|
|
3679
|
+
type: "array",
|
|
3680
|
+
items: { type: "integer", minimum: 0, maximum: 6 },
|
|
3681
|
+
},
|
|
3682
|
+
days_of_month: {
|
|
3683
|
+
type: "array",
|
|
3684
|
+
items: { type: "integer", minimum: 1, maximum: 31 },
|
|
3685
|
+
},
|
|
3686
|
+
window: {
|
|
3687
|
+
type: "object",
|
|
3688
|
+
properties: {
|
|
3689
|
+
start: {
|
|
3690
|
+
type: "string",
|
|
3691
|
+
pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
3692
|
+
},
|
|
3693
|
+
end: {
|
|
3694
|
+
type: "string",
|
|
3695
|
+
pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
3696
|
+
},
|
|
3697
|
+
},
|
|
3698
|
+
required: ["start", "end"],
|
|
3699
|
+
additionalProperties: false,
|
|
3700
|
+
},
|
|
3701
|
+
},
|
|
3702
|
+
required: [
|
|
3703
|
+
"frequency",
|
|
3704
|
+
"days_of_week",
|
|
3705
|
+
"days_of_month",
|
|
3706
|
+
"window",
|
|
3707
|
+
],
|
|
3708
|
+
additionalProperties: false,
|
|
3709
|
+
},
|
|
3710
|
+
},
|
|
3711
|
+
required: ["enabled", "timezone", "schedule"],
|
|
3712
|
+
additionalProperties: false,
|
|
3713
|
+
},
|
|
3714
|
+
},
|
|
3715
|
+
},
|
|
3716
|
+
},
|
|
3717
|
+
"500": { description: "Internal server error" },
|
|
3718
|
+
},
|
|
3719
|
+
},
|
|
3720
|
+
put: {
|
|
3721
|
+
summary:
|
|
3722
|
+
"Save the assistant's automatic-upgrade schedule (assistant-scoped)",
|
|
3723
|
+
description:
|
|
3724
|
+
"Full replace — the request body is the complete policy.",
|
|
3725
|
+
operationId: "upgradePolicyPutScoped",
|
|
3726
|
+
security: [{ EdgeScoped: [] }],
|
|
3727
|
+
parameters: [
|
|
3728
|
+
{
|
|
3729
|
+
name: "assistantId",
|
|
3730
|
+
in: "path",
|
|
3731
|
+
required: true,
|
|
3732
|
+
schema: { type: "string" },
|
|
3733
|
+
},
|
|
3734
|
+
],
|
|
3735
|
+
requestBody: {
|
|
3736
|
+
required: true,
|
|
3737
|
+
content: {
|
|
3738
|
+
"application/json": {
|
|
3739
|
+
schema: {
|
|
3740
|
+
type: "object",
|
|
3741
|
+
properties: {
|
|
3742
|
+
enabled: { type: "boolean" },
|
|
3743
|
+
timezone: { type: "string", maxLength: 64 },
|
|
3744
|
+
schedule: {
|
|
3745
|
+
type: "object",
|
|
3746
|
+
properties: {
|
|
3747
|
+
frequency: {
|
|
3748
|
+
type: "string",
|
|
3749
|
+
enum: ["daily", "weekly", "monthly"],
|
|
3750
|
+
},
|
|
3751
|
+
days_of_week: {
|
|
3752
|
+
type: "array",
|
|
3753
|
+
items: { type: "integer", minimum: 0, maximum: 6 },
|
|
3754
|
+
},
|
|
3755
|
+
days_of_month: {
|
|
3756
|
+
type: "array",
|
|
3757
|
+
items: { type: "integer", minimum: 1, maximum: 31 },
|
|
3758
|
+
},
|
|
3759
|
+
window: {
|
|
3760
|
+
type: "object",
|
|
3761
|
+
properties: {
|
|
3762
|
+
start: {
|
|
3763
|
+
type: "string",
|
|
3764
|
+
pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
3765
|
+
},
|
|
3766
|
+
end: {
|
|
3767
|
+
type: "string",
|
|
3768
|
+
pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
3769
|
+
},
|
|
3770
|
+
},
|
|
3771
|
+
required: ["start", "end"],
|
|
3772
|
+
additionalProperties: false,
|
|
3773
|
+
},
|
|
3774
|
+
},
|
|
3775
|
+
required: [
|
|
3776
|
+
"frequency",
|
|
3777
|
+
"days_of_week",
|
|
3778
|
+
"days_of_month",
|
|
3779
|
+
"window",
|
|
3780
|
+
],
|
|
3781
|
+
additionalProperties: false,
|
|
3782
|
+
},
|
|
3783
|
+
},
|
|
3784
|
+
required: ["enabled", "timezone", "schedule"],
|
|
3785
|
+
additionalProperties: false,
|
|
3786
|
+
},
|
|
3787
|
+
},
|
|
3788
|
+
},
|
|
3789
|
+
},
|
|
3790
|
+
responses: {
|
|
3791
|
+
"200": {
|
|
3792
|
+
description: "Saved upgrade policy",
|
|
3793
|
+
content: {
|
|
3794
|
+
"application/json": {
|
|
3795
|
+
schema: {
|
|
3796
|
+
type: "object",
|
|
3797
|
+
properties: {
|
|
3798
|
+
enabled: { type: "boolean" },
|
|
3799
|
+
timezone: { type: "string", maxLength: 64 },
|
|
3800
|
+
schedule: {
|
|
3801
|
+
type: "object",
|
|
3802
|
+
properties: {
|
|
3803
|
+
frequency: {
|
|
3804
|
+
type: "string",
|
|
3805
|
+
enum: ["daily", "weekly", "monthly"],
|
|
3806
|
+
},
|
|
3807
|
+
days_of_week: {
|
|
3808
|
+
type: "array",
|
|
3809
|
+
items: { type: "integer", minimum: 0, maximum: 6 },
|
|
3810
|
+
},
|
|
3811
|
+
days_of_month: {
|
|
3812
|
+
type: "array",
|
|
3813
|
+
items: { type: "integer", minimum: 1, maximum: 31 },
|
|
3814
|
+
},
|
|
3815
|
+
window: {
|
|
3816
|
+
type: "object",
|
|
3817
|
+
properties: {
|
|
3818
|
+
start: {
|
|
3819
|
+
type: "string",
|
|
3820
|
+
pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
3821
|
+
},
|
|
3822
|
+
end: {
|
|
3823
|
+
type: "string",
|
|
3824
|
+
pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
3825
|
+
},
|
|
3826
|
+
},
|
|
3827
|
+
required: ["start", "end"],
|
|
3828
|
+
additionalProperties: false,
|
|
3829
|
+
},
|
|
3830
|
+
},
|
|
3831
|
+
required: [
|
|
3832
|
+
"frequency",
|
|
3833
|
+
"days_of_week",
|
|
3834
|
+
"days_of_month",
|
|
3835
|
+
"window",
|
|
3836
|
+
],
|
|
3837
|
+
additionalProperties: false,
|
|
3838
|
+
},
|
|
3839
|
+
},
|
|
3840
|
+
required: ["enabled", "timezone", "schedule"],
|
|
3841
|
+
additionalProperties: false,
|
|
3842
|
+
},
|
|
3843
|
+
},
|
|
3844
|
+
},
|
|
3845
|
+
},
|
|
3846
|
+
"400": { description: "Invalid request body" },
|
|
3847
|
+
"500": { description: "Internal server error" },
|
|
3848
|
+
},
|
|
3849
|
+
},
|
|
3850
|
+
},
|
|
3300
3851
|
"/v1/logs/export": {
|
|
3301
3852
|
post: {
|
|
3302
3853
|
summary: "Export logs from all services",
|
|
@@ -3684,7 +4235,7 @@ export function buildSchema(): Record<string, unknown> {
|
|
|
3684
4235
|
delete: {
|
|
3685
4236
|
summary: "Delete a channel admission policy",
|
|
3686
4237
|
description:
|
|
3687
|
-
"Authenticated gateway endpoint that removes the admission policy for a single channel from the SQLite-backed store and invalidates the in-memory admission-policy cache. Exempt channels (platform
|
|
4238
|
+
"Authenticated gateway endpoint that removes the admission policy for a single channel from the SQLite-backed store and invalidates the in-memory admission-policy cache. Exempt channels (platform) and hidden channels (cadet, whatsapp) refuse deletion per §8.1.",
|
|
3688
4239
|
operationId: "channelAdmissionPolicyDelete",
|
|
3689
4240
|
security: [{ BearerAuth: [] }],
|
|
3690
4241
|
parameters: [
|
|
@@ -4322,6 +4873,17 @@ export function buildSchema(): Record<string, unknown> {
|
|
|
4322
4873
|
},
|
|
4323
4874
|
components: {
|
|
4324
4875
|
schemas: {
|
|
4876
|
+
UserProfile: {
|
|
4877
|
+
type: "object",
|
|
4878
|
+
properties: {
|
|
4879
|
+
id: { type: "string" },
|
|
4880
|
+
username: { type: "string" },
|
|
4881
|
+
email: { type: "string" },
|
|
4882
|
+
first_name: { type: "string" },
|
|
4883
|
+
last_name: { type: "string" },
|
|
4884
|
+
},
|
|
4885
|
+
required: ["id", "username", "email", "first_name", "last_name"],
|
|
4886
|
+
},
|
|
4325
4887
|
BackupSnapshot: {
|
|
4326
4888
|
type: "object",
|
|
4327
4889
|
required: [
|