Files
deepseek-harness/apps/cli/tests/profiles/web/tests/web-default-isolation.expected.e2e.ts
T
Chinesezjc 656adfc986 feat(web): mount time-context from the presets that use it
`packages/bundle/web-app/cordis.patch.yml` inserted `time-context` as a Host
row, so every session in the shipped Web profile — `minimal` included —
received a per-step clock reading its composition never declared. The row
moves into the `standard`, `cordis`, and `ptc` presets; `minimal` mounts
neither the reading nor the reminder tools. The Schedule service row and the
`ui-schedule` client row stay Host-wide. 139a7eb379 carried the bundle,
preset, and runtime-closure half of this move; this commit carries the
fixtures, documentation, and Agent Notes that follow it.

The `minimal` session fixture is refreshed keylessly, the assembled-Web spec
builds its every-step overlay from the shipped preset because a preset plugin
cannot be addressed by id from a top-level patch, and the composition Agent
Note points at the new note that owns the preset-scoped reading.
2026-09-24 20:50:12 +08:00

54 lines
3.2 KiB
TypeScript

/** Real Web startup, mounted plugin package identities, and delivered Client graph isolation. */
import { FiberState } from '@deepseek-ai/cordis'
import type { WebBootGraph } from '@deepseek-ai/dsh-client-modules/client'
import { expect, it } from 'vitest'
import { experimentalRuntimeReferences, modulePackage } from './runtime-roster.ts'
import { withDefaultWeb, webGet } from './default-web-process.ts'
const experimentalName = '@deepseek-ai/dsh-experimental-client-ui-agent-team'
it('boots default Web without experimental modules or an active built-in Browser', async (test) => {
await withDefaultWeb(test, async ({ url, request }) => {
const auth = await webGet(url, test.signal)
const cookie = auth.headers['set-cookie']?.[0]?.split(';', 1)[0]
expect(cookie).toBeDefined()
const page = await webGet(new URL('/', url), test.signal, { cookie: cookie! })
expect(page.status).toBe(200)
const html = page.text
const rawBoot = /globalThis\["__DSH_BOOT__"\] = ([\s\S]*?)<\/script>/u.exec(html)?.[1]
expect(rawBoot, html).toBeDefined()
const delivered = JSON.parse(rawBoot!) as WebBootGraph
const roster = await request('roster')
expect(roster.client).toEqual(delivered)
expect(roster.entries).toEqual(expect.arrayContaining([
expect.objectContaining({ name: '@deepseek-ai/dsh-host-webserver', state: FiberState.ACTIVE }),
expect.objectContaining({ name: '@deepseek-ai/dsh-client-modules', state: FiberState.ACTIVE }),
// The Loader rewrites an inserted row's id (`include:ui-schedule`), so
// the shipped Host rows are pinned by name and settled state. A preset's
// declared plugins mount in the registry-owned preset tree, so
// `time-context` is not among these rows.
expect.objectContaining({ name: '@deepseek-ai/dsh-schedule', state: FiberState.ACTIVE }),
expect.objectContaining({ name: '@deepseek-ai/dsh-client-ui-schedule', state: FiberState.ACTIVE }),
]))
expect(roster.entries.some(entry => entry.name.endsWith('/runtime-roster-observer.js') && entry.state === FiberState.ACTIVE)).toBe(true)
expect(roster.plugins.length).toBeGreaterThan(roster.entries.length)
expect(roster.modules.some(url => modulePackage(url) === '@deepseek-ai/dsh')).toBe(true)
expect(roster.client.entries.length).toBeGreaterThan(0)
const browserName = '@deepseek-ai/dsh-client-ui-sidebar-browser'
const browserEntry = roster.entries.find(entry => entry.name === browserName)
expect(browserEntry).toBeDefined()
expect(browserEntry!.state).toBeUndefined()
expect(delivered.entries.some(entry => entry.id === browserName)).toBe(false)
expect(experimentalRuntimeReferences(roster)).toEqual([])
const contaminated = await request('mount-experimental')
expect(contaminated.entries.some(entry => entry.name === experimentalName)).toBe(false)
const mounted = contaminated.plugins.filter(plugin => plugin.modules.some(url => modulePackage(url) === experimentalName))
expect(mounted).toEqual([expect.objectContaining({ state: FiberState.ACTIVE })])
expect(experimentalRuntimeReferences(contaminated)).toEqual(expect.arrayContaining([
expect.stringContaining('/packages/experimental/client-ui-agent-team/'),
]))
})
})