Files
spaces-startos/startos/interfaces.ts
T
spacesops e41ff31221
Build Service / BuildPackage (push) Has been cancelled
Added optional Explorer/Indexer
2026-05-20 15:43:38 -04:00

48 lines
1.4 KiB
TypeScript

import { i18n } from './i18n'
import { sdk } from './sdk'
import { EXPLORER_PORT, uiPort } from './utils'
export const setInterfaces = sdk.setupInterfaces(async ({ effects }) => {
const uiMulti = sdk.MultiHost.of(effects, 'ui-multi')
const uiMultiOrigin = await uiMulti.bindPort(uiPort, {
protocol: 'http',
})
const ui = sdk.createInterface(effects, {
name: i18n('Space-CLI Web UI'),
id: 'ui',
description: i18n(
'Browser terminal that exposes space-cli inside the Spaces container.',
),
type: 'ui',
masked: false,
schemeOverride: null,
username: null,
path: '',
query: {},
})
const uiReceipt = await uiMultiOrigin.export([ui])
const explorerMulti = sdk.MultiHost.of(effects, 'explorer-multi')
const explorerMultiOrigin = await explorerMulti.bindPort(EXPLORER_PORT, {
protocol: 'http',
})
const explorer = sdk.createInterface(effects, {
name: i18n('Explorer Web UI'),
id: 'explorer',
description: i18n(
'SvelteKit explorer for the Spaces protocol. Reads from the embedded PostgreSQL populated by the indexer. Only useful while the embedded explorer is enabled.',
),
type: 'ui',
masked: false,
schemeOverride: null,
username: null,
path: '',
query: {},
})
const explorerReceipt = await explorerMultiOrigin.export([explorer])
return [uiReceipt, explorerReceipt]
})