feat: add TypeRT remote gateway infrastructure

This commit is contained in:
imccyu
2026-08-05 11:17:47 +08:00
parent effd8e1ebd
commit 64a963da0b
98 changed files with 7812 additions and 444 deletions
@@ -0,0 +1,26 @@
import { describe, expect, it } from 'vitest'
import { Context } from 'cordis'
import SessionStore, { SessionId } from '@deepseek-ai/dsh-session'
import TypertRegistry from '@deepseek-ai/dsh-typert-registry'
describe('Session TypeRT provider', () => {
it('contributes live Session lookup in either service load order', async () => {
const ctx = new Context()
const sessionFiber = ctx.plugin(SessionStore)
await sessionFiber
await ctx.plugin(TypertRegistry)
const session = ctx.sessions.create(SessionId('remote-session'))
const lookup = ctx.typert.lookups.get('session')
expect(lookup).toMatchObject({
parameter: 'session',
wire: 'sessionId',
hostTypeSymbol: '@deepseek-ai/dsh-session#Session',
wireTypeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
})
expect(lookup?.resolve(session.id)).toBe(session)
await sessionFiber.dispose()
expect(ctx.typert.lookups.get('session')).toBeUndefined()
})
})