initial relay scaffold

This commit is contained in:
local
2026-05-11 20:03:27 -05:00
commit b9d86fa303
58 changed files with 7609 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
import { i18n } from './i18n'
import { sdk } from './sdk'
import { uiPort } from './utils'
// Single HTTP interface on port 3002. Operators wire a public hostname
// (e.g. relay.yourdomain.com) to this interface via StartTunnel; Recap
// installs point their "Set Relay URL" action at that hostname. The
// /admin/* paths require admin auth (set via "Set Admin Password"
// action); the /relay/* paths are authenticated per-call via
// X-Recap-Install-Id + optional Authorization: Bearer LIC1-... headers.
export const setInterfaces = sdk.setupInterfaces(async ({ effects }) => {
const apiMulti = sdk.MultiHost.of(effects, 'api-multi')
const apiOrigin = await apiMulti.bindPort(uiPort, {
protocol: 'http',
})
const api = sdk.createInterface(effects, {
name: i18n('Relay Endpoint'),
id: 'api',
description: i18n(
'HTTP endpoint for Recap clients to relay transcribe + analyze ' +
'calls. Also serves the operator admin dashboard at /admin/.',
),
type: 'ui',
masked: false,
schemeOverride: null,
username: null,
path: '',
query: {},
})
const apiReceipt = await apiOrigin.export([api])
return [apiReceipt]
})