feat(session-query): add model-facing tools (round 1)

This commit is contained in:
Hypatia May
2026-07-24 15:09:55 +08:00
parent b92235c490
commit a350e95165
40 changed files with 2781 additions and 13 deletions

View File

@@ -141,6 +141,24 @@ describe('bootHost / startHost', () => {
await handle.dispose()
})
it('assembles workspace-authorized session query tools over the derived SQLite index', async () => {
const persistenceRoot = mkdtempSync(join(tmpdir(), 'dsh-boot-session-query-'))
const handle = await bootHost({
persistenceRoot,
workspaceContext: false,
})
expect(handle.ctx.get('sessionQuery')).toBeDefined()
expect(handle.ctx.tools.schemas().map(schema => schema.name)).toEqual(expect.arrayContaining([
'session_search',
'session_event_search',
'session_trace',
'session_event_trace',
'session_event_read',
]))
expect(handle.ctx.tools.get('session_search')?.timeoutMs).toBe(30_000)
await handle.dispose()
})
it('startHost assembles api + handler over the same defaults and dedupes dispose', async () => {
const running = await boot()
expect(running.defaults).toMatchObject({ provider: 'scripted', model: 'test-model' })