Merge branch 'feat/upstream-skills' into feat/wecom-plugin

This commit is contained in:
gengruilin committed 2026-11-17 15:06:35 +08:00
commit 4c7c1933bd
3267 files changed
+118001 -29842

No files matched your search

+4 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@deepseek-ai/dsh-web-frontend",
"description": "Web application entry: vite build over the @deepseek-ai/dsh-client-web shell library; dist/ served by apps/cli's dsh web",
"version": "0.2.2-rc.2",
"version": "0.2.2-rc.3",
"publishConfig": {
"access": "public"
},
@@ -32,6 +32,9 @@
"license": "MIT",
"devDependencies": {
"@deepseek-ai/dsh-brand": "workspace:*",
"zod": "4.6.6",
"@tanstack/react-virtual": "3.14.10",
"@deepseek-ai/cordis": "workspace:~",
"@deepseek-ai/cordis-plugin-group": "workspace:~",
"@deepseek-ai/dsh-client-modules": "workspace:*",
"@deepseek-ai/dsh-client-store": "workspace:*",
+3 -1
View File
@@ -93,7 +93,7 @@ async function mockPlatform() {
await new Promise<void>((resolve) => { server.listen(0, '127.0.0.1', resolve) })
const address = server.address()
if (address === null || typeof address === 'string') throw new Error('account login: missing mock listener')
const origin = `http://127.0.0.1:${String(address.port)}`
const origin = `http://localhost:${String(address.port)}`
return {
origin, inits, pages, avatarRequests: () => avatarRequests, notificationLists: () => notificationLists,
close: () => new Promise<void>((resolve) => { server.close(() => { resolve() }); server.closeAllConnections() }),
@@ -132,8 +132,10 @@ describe.skipIf(MODE === 'record')('web e2e: DeepSeek account sign-in in a plain
const menu = page.getByRole('button', { name: 'Account menu', exact: true })
await menu.click()
const tab = context.waitForEvent('page')
const callback = context.waitForEvent('request', request => new URL(request.url()).pathname === '/oauth/callback')
await page.getByRole('menuitem', { name: 'Sign in', exact: true }).click()
const authorization = await tab
expect((await (await callback).allHeaders())['sec-fetch-site']).toBe('cross-site')
await authorization.waitForURL(url => url.pathname === '/dsh/authorized', { timeout: 30_000 })
expect(await authorization.evaluate(() => window.opener === null)).toBe(true)
await expect.poll(() => menu.textContent(), { timeout: 30_000 }).toBe('Web User')
@@ -43,6 +43,16 @@ describe('web e2e: preset roster guidance', () => {
it('reads mode details and examples without changing the new-task default', async () => {
onTestFailed(() => saveFailureShot(page, 'preset-roster-guide'))
const settings = page.getByRole('dialog', { name: '设置' })
for (const name of ['标准模式', '创造模式']) {
const sharedTrigger = settings.getByRole('button', { name: `模式说明: ${name}`, exact: true })
await sharedTrigger.click()
const sharedGuide = page.getByRole('dialog', { name, exact: true })
await sharedGuide.getByText(/只读运行时检查/).waitFor()
expect(await sharedGuide.innerText()).not.toContain('增加了运行时检查')
if (name === '创造模式') expect(await sharedGuide.innerText()).toContain('创造模式专注于定制 DSH')
await page.keyboard.press('Escape')
await sharedGuide.waitFor({ state: 'detached' })
}
const trigger = settings.getByRole('button', { name: '模式说明: PTC 模式', exact: true })
await trigger.click()
const guide = page.getByRole('dialog', { name: 'PTC 模式', exact: true })
+5 -4
View File
@@ -428,9 +428,10 @@ describe('web e2e: agent-preset selection', () => {
await compareOrRefreshGolden(HEADER_EXPECTED, snapshot, MODE)
expect(snapshot).toContain('Minimal mode')
expect(snapshot).toContain('button "1 subagent"')
expect(snapshot.indexOf('Minimal mode')).toBeLessThan(snapshot.indexOf('button "1 subagent"'))
expect(snapshot.indexOf('button "1 subagent"')).toBeLessThan(snapshot.indexOf('button "More actions"'))
// The Session's subagents live in the Session panel, whose toggle follows the preset label.
expect(snapshot).not.toContain('button "1 subagent"')
expect(snapshot.indexOf('Minimal mode')).toBeLessThan(snapshot.indexOf('button "Session panel"'))
expect(snapshot.indexOf('button "Session panel"')).toBeLessThan(snapshot.indexOf('button "More actions"'))
// Static chrome, not a control: the header can only report a composition
// the host would refuse to change.
expect(snapshot).not.toContain('button "Minimal mode"')
@@ -486,7 +487,7 @@ it.each([false, true])('starts Creator from Plugins with Coding Tools=%s without
expect(scaffold.ctx.sessionProjections.checkpoint(creator.session).agentPreset?.val).toBe('cordis')
expect(scaffold.ctx.agentPresets.composedPreset(creator.ctx)).toBe('cordis')
expect(scaffold.ctx.tools.schemas(creator).map(tool => tool.name))
.toEqual(expect.arrayContaining(['cordis_inspect_list', 'cordis_inspect_query', 'plugin_manager']))
.toEqual(expect.arrayContaining(['cordis_inspect', 'plugin_manager']))
// The Session starts under Creator; a chip selection after the list updates records no switch.
expect(creator.session.snapshotEvents().filter(event => event.type === 'agent-preset/selected')).toEqual([])
expect(creator.session.snapshotEvents().some(event => event.type === 'user/message' || event.type === 'turn/start')).toBe(false)
File diff suppressed because it is too large. Load diff
+1 -2
View File
@@ -10,9 +10,8 @@ const PANELS = [
{ file: 'client/ui-schedule/src/client/TaskMenu.module.css', classes: 'list portal scrollable alignEnd', align: 'end' },
{ file: 'client/ui-schedule/src/client/PickerPopover.module.css', classes: 'panel', align: 'start' },
{ file: 'client/ui-schedule/src/client/ScheduleCatalogAction.module.css', classes: 'menu', align: 'start' },
{ file: 'client/ui-subagent/src/client/SubagentHeaderLineage.module.css', classes: 'menu', align: 'start' },
{ file: 'client/ui-subagent/src/client/SubagentCatalog.module.css', classes: 'menu', align: 'start' },
{ file: 'client/ui-approval/src/client/ApprovalPanel.module.css', classes: 'warningPopover', align: 'end' },
{ file: 'client/ui-jobs/src/client/JobListAction.module.css', classes: 'menu', align: 'start' },
{ file: 'client/ui-conversation/src/client/skeleton/ContextMeter.module.css', classes: 'panel', align: 'start' },
{ file: 'client/ui-chat/src/client/chat/stat-dialog.module.css', classes: 'panel', align: 'start' },
{ file: 'client/ui-sidebar-documentpreview/src/client/office/FontNotice.module.css', classes: 'panel', align: 'start' },
+3
View File
@@ -21,6 +21,9 @@ import {
createAssembledRemote, type AssembledRemote, type AssembledRemoteOptions,
} from './assembled-remote.ts'
// Dynamic plugins use built bundles; this in-process shell shares source platform namespaces.
vi.mock('@deepseek-ai/dsh-client-web/src/seed.ts', () => import('./source-static-modules.client.ts'))
interface AssembledPlugin extends WebBootEntry {
/** Absolute path to the built client artifact declared by this package. */
bundlePath: string
+152 -130
View File
@@ -1,6 +1,6 @@
import { executeToolFixture } from '@deepseek-ai/dsh-tool-testkit'
// Session-header background jobs driven by a real `ctx.jobs` entry. No model
// call is involved.
// The Session panel's background-jobs section driven by a real `ctx.jobs`
// entry. No model call is involved.
import { readFile, writeFile } from 'node:fs/promises'
import { fileURLToPath } from 'node:url'
import { join } from 'node:path'
@@ -16,12 +16,13 @@ import {
assertFixtureInventory, captureStableAria, compareOrRefreshGolden,
launchWebScaffold, seedSession, watchConsole, webSnapshotMode, type WebScaffold,
} from './scaffold.ts'
import { newEnglishPage, saveFailureShot } from './support.ts'
import { foldControlLayout, newEnglishPage, saveFailureShot, sessionPanelToggle, showSessionPanel } from './support.ts'
const FIXTURE = fileURLToPath(new URL('../../../snapshots/web/fresh-round-trip/session.v3.jsonl', import.meta.url))
const SNAPSHOT_DIR = fileURLToPath(new URL('../../../snapshots/web/background-job-list', import.meta.url))
const RUNNING_EXPECTED = join(SNAPSHOT_DIR, 'running.expected.md')
const SETTLED_EXPECTED = join(SNAPSHOT_DIR, 'settled.expected.md')
const SECTION = '[data-session-panel-section="background-jobs"]'
const MODE = webSnapshotMode()
const SEED_ID = 'background-job-list-web-e2e'
// A hold on a barrier file the test owns in the job's cwd: the process never
@@ -82,12 +83,18 @@ describe.skipIf(MODE === 'record')('web e2e: background job list', () => {
await scaffold?.close()
})
it('shows a running background job in the header without a refresh, then kills it from the two-press stop control', async () => {
it('shows a running background job in the Session panel without a refresh, then kills it from the two-press stop control', async () => {
let phase = 'running'
onTestFailed(() => saveFailureShot(page, `web-e2e-background-job-${phase}`))
// Polling for zero would pass at t=0 before delivery and prove nothing.
const trigger = page.getByRole('button', { name: '1 background job', exact: true })
expect(await trigger.count()).toBe(0)
const toggle = sessionPanelToggle(page)
const section = (await showSessionPanel(page)).locator(SECTION)
const list = section.getByRole('list')
// The mounted section keeps the roster stream open but renders no rows
// yet, so the panel hides it with its title. A one-shot check: polling for
// zero would pass at t=0 before delivery and prove nothing.
expect(await section.count()).toBe(1)
expect(await section.isVisible()).toBe(false)
expect(await list.count()).toBe(0)
const started = await executeToolFixture(scaffold.ctx, {
signal: new AbortController().signal,
@@ -101,31 +108,26 @@ describe.skipIf(MODE === 'record')('web e2e: background job list', () => {
if (matched === null) throw new Error(`background bash reported no job id: ${reported}`)
const jobId = brandString<JobId>(matched[0])
await trigger.waitFor({ timeout: 15_000 })
expect(await trigger.locator('[data-state="ongoing"]').count()).toBe(1)
expect(await trigger.locator('[data-icon="dsw-icon-chevron-down-outline-regular"]').count()).toBe(0)
await trigger.hover()
const list = page.getByRole('list', { name: 'Background jobs' })
const row = list.getByRole('listitem').first()
await row.waitFor({ timeout: 10_000 })
await row.waitFor({ timeout: 15_000 })
await expect.poll(() => row.textContent()).toContain(COMMAND)
expect(await trigger.getAttribute('aria-expanded')).toBe('true')
await row.hover()
await row.getByRole('button', { name: /Show live output/ }).focus()
await page.mouse.move(2, 2)
// Focusing a menu control pins it beyond the 120ms hover-leave deadline.
await page.waitForTimeout(180)
expect(await list.count()).toBe(1)
await trigger.click()
expect(await section.getByRole('heading', { name: 'Background jobs', level: 2 }).isVisible()).toBe(true)
expect(await row.locator('[data-state="ongoing"]').count()).toBe(1)
expect(await page.locator('[data-jobs-running]').count()).toBe(0)
// Hiding the panel unmounts the section, and a blue dot on the toggle reports the running job.
await toggle.click()
await list.waitFor({ state: 'detached' })
await trigger.click()
await list.waitFor()
await page.mouse.move(2, 2)
await page.waitForTimeout(180)
expect(await list.count()).toBe(1)
expect(await trigger.getAttribute('aria-label')).toBe('1 background job')
const dot = page.locator('[data-jobs-running]')
await dot.waitFor()
await page.getByRole('button', { name: 'Session panel Background jobs running: 1', exact: true }).waitFor()
expect(await dot.evaluate(element => getComputedStyle(element).width)).toBe('6px')
// Showing it again lists the live job, and the dot goes away.
await showSessionPanel(page)
await row.waitFor({ timeout: 10_000 })
expect(await toggle.getAttribute('aria-expanded')).toBe('true')
await dot.waitFor({ state: 'detached' })
const running = await captureStableAria(page, '[class*="menu"]', scaffold.workspaceCwd, { runningJobs: 'keep' })
const running = await captureStableAria(page, SECTION, scaffold.workspaceCwd)
await compareOrRefreshGolden(RUNNING_EXPECTED, running, MODE)
expect(tripwire.pageErrors).toEqual([])
expect(tripwire.warnings).toEqual([])
@@ -133,151 +135,171 @@ describe.skipIf(MODE === 'record')('web e2e: background job list', () => {
phase = 'settled'
// The whole human path: arm, confirm, job.kill, registry kill, jobs
// frames flipping the row — no registry call from the test.
const stop = page.locator('[data-kill-state]')
const stop = section.locator('[data-kill-state]')
await stop.waitFor({ timeout: 10_000 })
await stop.click()
await expect.poll(() => stop.getAttribute('data-kill-state')).toBe('armed')
await stop.click()
expect(await trigger.getAttribute('aria-label')).toBe('1 background job')
// The unclaimed report's reason lands in the settled row's detail.
await expect.poll(
() => page.getByRole('list', { name: 'Background jobs' }).textContent(),
{ timeout: 15_000 },
).toContain('cancelled by the user')
// The unclaimed report's reason lands in the settled row's detail; presses
// inside the overlay leave it open.
await expect.poll(() => list.textContent(), { timeout: 15_000 }).toContain('cancelled by the user')
expect(await toggle.getAttribute('aria-expanded')).toBe('true')
expect(scaffold.ctx.jobs.get(jobId, agent.id).status).toBe('killed')
const settled = await captureStableAria(page, '[class*="menu"]', scaffold.workspaceCwd)
const settled = await captureStableAria(page, SECTION, scaffold.workspaceCwd)
await compareOrRefreshGolden(SETTLED_EXPECTED, settled, MODE)
expect(tripwire.pageErrors).toEqual([])
expect(tripwire.warnings).toEqual([])
}, 90_000)
it('keeps the open list above the expanded right sidebar and in the header Tab order', async () => {
it('opens the section over the conversation beside the expanded right sidebar and closes it with Escape', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-background-job-right-sidebar'))
const trigger = page.getByRole('button', { name: '1 background job', exact: true })
if (await trigger.getAttribute('aria-expanded') === 'true') await trigger.click()
const toggle = sessionPanelToggle(page)
await page.getByRole('button', { name: 'Open right sidebar' }).click()
const sidebar = page.locator('[data-rightbar-col]')
// A toggle holds data-animating on the frame until its tracks settle.
await expect.poll(() => sidebar.evaluate(column => column.parentElement?.hasAttribute('data-animating'))).toBe(false)
await trigger.click()
const list = page.getByRole('list', { name: 'Background jobs' })
await list.waitFor({ timeout: 10_000 })
// The list crosses into the sidebar column, so the hit test below covers it.
const [menuBox, sidebarBox] = await Promise.all([list.boundingBox(), sidebar.boundingBox()])
if (menuBox === null || sidebarBox === null) throw new Error('job list geometry is unavailable')
expect(menuBox.x + menuBox.width).toBeGreaterThan(sidebarBox.x)
// Every corner of the list hit-tests to the list itself; the inset clears its rounded corners.
const covered = await list.evaluate((menu) => {
const rect = menu.getBoundingClientRect()
const panel = await showSessionPanel(page)
expect(await panel.getAttribute('data-session-panel')).toBe('overlay')
const section = panel.locator(SECTION)
const settledToggle = section.getByRole('button', { name: 'Finished 1', exact: true })
await settledToggle.waitFor({ timeout: 10_000 })
// The overlay stays in the conversation body, clear of the sidebar column.
const [panelBox, sidebarBox] = await Promise.all([panel.boundingBox(), sidebar.boundingBox()])
if (panelBox === null || sidebarBox === null) throw new Error('Session panel geometry is unavailable')
expect(panelBox.x + panelBox.width).toBeLessThanOrEqual(sidebarBox.x)
// Every corner of the panel hit-tests to the panel itself; the inset clears its rounded corners.
const covered = await panel.evaluate((element) => {
const rect = element.getBoundingClientRect()
const inset = 20
const points: Array<[number, number]> = [
[rect.left + inset, rect.top + inset], [rect.right - inset, rect.top + inset],
[rect.left + inset, rect.bottom - inset], [rect.right - inset, rect.bottom - inset],
]
return points.filter(([x, y]) => !menu.contains(document.elementFromPoint(x, y)))
return points.filter(([x, y]) => !element.contains(document.elementFromPoint(x, y)))
})
expect(covered).toEqual([])
// Keyboard order matches the in-place list: the trigger leads into the
// list, and Tab off its last control reaches the control after the trigger.
const after = await trigger.evaluate((node) => {
const all = [...document.querySelectorAll<HTMLElement>('button, a[href], [tabindex]:not([tabindex="-1"])')]
const outside = all.filter(el => el.closest('[aria-label="Background jobs"]') === null && el.tabIndex >= 0)
return outside[outside.indexOf(node as HTMLElement) + 1]?.outerHTML.slice(0, 120)
})
expect(after).toMatch(/^<button/)
await trigger.focus()
await page.keyboard.press('Tab')
expect(await list.evaluate(menu => menu.contains(document.activeElement))).toBe(true)
const controls = await list.evaluate(menu => menu.querySelectorAll('button:not(:disabled)').length)
for (let i = 1; i < controls; i += 1) await page.keyboard.press('Tab')
await page.keyboard.press('Tab')
expect(await page.evaluate(() => document.activeElement?.outerHTML.slice(0, 120))).toBe(after)
await trigger.focus()
await page.keyboard.press('Tab')
// Escape from a control in the section closes the overlay and returns focus to the toggle.
await settledToggle.focus()
await page.keyboard.press('Escape')
await list.waitFor({ state: 'detached', timeout: 10_000 })
expect(await trigger.evaluate(node => node === document.activeElement)).toBe(true)
await panel.waitFor({ state: 'detached', timeout: 10_000 })
expect(await toggle.getAttribute('aria-expanded')).toBe('false')
expect(await toggle.evaluate(node => node === document.activeElement)).toBe(true)
}, 60_000)
it('keeps the compact Layers trigger focused and opens jobs only on click or keyboard', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-background-job-compact-trigger'))
const trigger = page.getByRole('button', { name: '1 background job', exact: true })
const list = page.getByRole('list', { name: 'Background jobs' })
const count = trigger.locator('[data-job-count]')
it('fits the section into the narrow overlay and closes it on a press outside', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-background-job-narrow-overlay'))
const toggle = sessionPanelToggle(page)
const viewport = page.viewportSize()!
await page.getByRole('button', { name: 'Collapse right sidebar', exact: true }).click()
await expect.poll(() => page.locator('[data-rightbar-col]')
.evaluate(column => column.parentElement?.hasAttribute('data-animating'))).toBe(false)
await page.getByRole('button', { name: 'Open right sidebar', exact: true }).waitFor()
await page.mouse.move(2, 2)
expect(await count.isVisible()).toBe(true)
expect(await trigger.locator('[data-icon="dsw-icon-layers-outline-regular"]').count()).toBe(1)
expect(await trigger.locator('svg').count()).toBe(1)
expect(await trigger.locator('svg').evaluate((element) => {
const bounds = element.getBoundingClientRect()
return [bounds.width, bounds.height]
})).toEqual([14, 14])
await trigger.focus()
const original = await trigger.elementHandle()
if (original === null) throw new Error('Background jobs trigger is missing')
await toggle.focus()
const original = await toggle.elementHandle()
if (original === null) throw new Error('Session panel toggle is missing')
try {
await page.setViewportSize({ width: 390, height: 700 })
await expect.poll(() => count.evaluate(element => getComputedStyle(element).display)).toBe('none')
expect(await original.evaluate(element => element.isConnected && element === document.activeElement)).toBe(true)
const expandSidebar = page.locator('[data-sidebar-right-expand]')
const compactStyles = await Promise.all([trigger, expandSidebar].map(control => control.evaluate((element) => {
const style = getComputedStyle(element)
const bounds = element.getBoundingClientRect()
const icon = element.querySelector('svg')!.getBoundingClientRect()
return { width: bounds.width, height: bounds.height, padding: style.padding, radius: style.borderRadius,
color: style.color, iconWidth: icon.width, iconHeight: icon.height }
})))
expect(compactStyles[0]).toEqual(compactStyles[1])
expect(compactStyles[0]).toMatchObject({ width: 28, height: 28, padding: '0px', iconWidth: 15, iconHeight: 15 })
expect(await trigger.evaluate(element => getComputedStyle(element.closest('[data-slot="conversation.session.header.actions"]')!.parentElement!).gap)).toBe('8px')
await expandSidebar.hover()
const expandHover = await expandSidebar.evaluate((element) => {
const style = getComputedStyle(element)
return { background: style.backgroundColor, color: style.color }
})
await expect.poll(() => trigger.evaluate((element) => {
const bounds = element.getBoundingClientRect()
return element.contains(document.elementFromPoint(bounds.left + bounds.width / 2, bounds.top + bounds.height / 2))
})).toBe(true)
await trigger.hover()
expect(await trigger.evaluate((element) => {
const style = getComputedStyle(element)
return { background: style.backgroundColor, color: style.color }
})).toEqual(expandHover)
expect(expandHover.background).not.toBe('rgba(0, 0, 0, 0)')
// Compact hover stays closed beyond the wide trigger's 150ms open deadline.
await page.waitForTimeout(200)
expect(await list.count()).toBe(0)
await trigger.click()
await list.waitFor()
const panel = await showSessionPanel(page)
expect(await panel.getAttribute('data-session-panel')).toBe('overlay')
const list = panel.locator(SECTION).getByRole('list')
await list.getByRole('button', { name: 'Finished 1', exact: true }).waitFor()
await trigger.click()
await list.waitFor({ state: 'detached' })
await trigger.press('ArrowDown')
await list.waitFor()
expect(await list.getByRole('button').first().evaluate(element => element === document.activeElement)).toBe(true)
await page.mouse.move(2, 2)
// Keyboard activation remains pinned after leaving both trigger and menu.
await page.waitForTimeout(180)
expect(await list.count()).toBe(1)
await page.mouse.click(2, 2)
await list.waitFor({ state: 'detached' })
expect(await trigger.getAttribute('aria-expanded')).toBe('false')
// The long command truncates inside its row instead of widening the panel past the viewport.
const fit = await panel.evaluate((element) => {
const rect = element.getBoundingClientRect()
const rows = [...element.querySelectorAll<HTMLElement>('[data-jobs-section] li')]
return {
inViewport: rect.left >= 0 && rect.right <= innerWidth,
panelOverflow: element.scrollWidth > element.clientWidth,
rowOverflow: rows.some(row => row.getBoundingClientRect().right > rect.right),
}
})
expect(fit).toEqual({ inViewport: true, panelOverflow: false, rowOverflow: false })
// The overlay's inline margin is transcript: a press there is outside the panel.
const box = await panel.boundingBox()
if (box === null) throw new Error('Session panel geometry is unavailable')
expect(box.x).toBeGreaterThan(4)
await page.mouse.click(box.x / 2, box.y + box.height / 2)
await panel.waitFor({ state: 'detached' })
expect(await toggle.getAttribute('aria-expanded')).toBe('false')
} finally {
await page.keyboard.press('Escape')
await page.setViewportSize(viewport)
await original.dispose()
}
})
it('marks a job that finished with a nonzero exit code with the warning dot', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-background-job-nonzero-exit'))
await executeToolFixture(scaffold.ctx, {
signal: new AbortController().signal,
callId: brandString<ToolCallId>('background-job-list-nonzero-e2e'),
name: 'bash',
arguments: { command: 'exit 3', description: 'Exit with a failure', run_in_background: true },
agent: scaffold.ctx.agents.list()[0]!,
})
const panel = await showSessionPanel(page)
const row = panel.locator(SECTION).getByRole('listitem').filter({ hasText: 'exit 3' })
await row.getByText('bash · exit code: 3', { exact: true }).waitFor({ timeout: 15_000 })
expect(await row.locator('[data-state]').getAttribute('data-state')).toBe('warning')
})
it('holds back the rows past five in each group behind its fold control and keeps the choice while the panel is hidden', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-background-job-folds'))
// Seven jobs on the suite's barrier file: they run until this case, or `afterAll`, releases it.
for (let index = 0; index < 7; index++) {
await executeToolFixture(scaffold.ctx, {
signal: new AbortController().signal,
callId: brandString<ToolCallId>(`background-job-list-fold-${String(index)}`),
name: 'bash',
arguments: { command: `: fold-${String(index)}; ${COMMAND}`, description: 'Hold a slot for the fold', run_in_background: true },
agent,
})
}
const section = (await showSessionPanel(page)).locator(SECTION)
const rows = section.locator('[data-job-row]')
const liveRows = section.locator('[data-job-row]:has([data-state="ongoing"])')
const folds = section.locator('[data-session-panel-row="fold"]')
const names = async (): Promise<(string | undefined)[]> => (await liveRows.allTextContents()).map(text => /fold-\d/.exec(text)?.[0])
// The five jobs started last show, the most recent first, and the group's fold control follows them.
await expect.poll(names, { timeout: 20_000 }).toEqual(['fold-6', 'fold-5', 'fold-4', 'fold-3', 'fold-2'])
expect(await folds.allTextContents()).toEqual(['Show 2 more running'])
expect(await section.locator('li:has([data-session-panel-row="fold"])').count()).toBe(1)
// The control is one more row: the row height, its chevron under the state marks, its text under the commands.
expect(await foldControlLayout(folds.first(), liveRows.first(), '[data-job-label]'))
.toEqual({ heights: [28, 28], chevronOffset: 0, textOffset: 0, fontSize: '12px', expanded: 'false' })
const more = section.getByRole('button', { name: 'Show 2 more running (running background jobs)', exact: true })
await more.click()
await expect.poll(names).toEqual(['fold-6', 'fold-5', 'fold-4', 'fold-3', 'fold-2', 'fold-1', 'fold-0'])
const less = section.getByRole('button', { name: 'Show less (running background jobs)', exact: true })
expect([await less.textContent(), await less.getAttribute('aria-expanded')]).toEqual(['Show less', 'true'])
// The same button stays under the pointer's focus across the change.
expect(await less.evaluate(element => element === document.activeElement)).toBe(true)
// The choice is the Session's: hiding the panel unmounts the section, and showing it again lists every live row.
await sessionPanelToggle(page).click()
await section.getByRole('list').waitFor({ state: 'detached' })
await showSessionPanel(page)
await expect.poll(() => liveRows.count(), { timeout: 10_000 }).toBe(7)
// Released, the jobs settle. With nothing live the settled group opens, with its five latest rows and its own control.
await writeFile(join(scaffold.workspaceCwd, RELEASE), '')
await expect.poll(() => liveRows.count(), { timeout: 30_000 }).toBe(0)
const header = section.getByRole('button', { name: /^Finished \d+$/ })
await expect.poll(async () => Number(/\d+/.exec(await header.textContent() ?? '')?.[0]), { timeout: 15_000 }).toBeGreaterThanOrEqual(7)
const settled = Number(/\d+/.exec(await header.textContent() ?? '')?.[0])
expect(await header.getAttribute('aria-expanded')).toBe('true')
await expect.poll(() => rows.count()).toBe(5)
expect(await folds.allTextContents()).toEqual([`Show ${String(settled - 5)} more finished`])
expect(await foldControlLayout(folds.first(), rows.first(), '[data-job-label]'))
.toEqual({ heights: [28, 28], chevronOffset: 0, textOffset: 0, fontSize: '12px', expanded: 'false' })
await folds.first().getByRole('button').click()
await expect.poll(() => rows.count()).toBe(settled)
expect(tripwire.pageErrors).toEqual([])
expect(tripwire.warnings).toEqual([])
}, 120_000)
it('keeps its snapshot inventory closed', async () => {
await assertFixtureInventory(SNAPSHOT_DIR, ['running.expected.md', 'settled.expected.md'])
})
+2 -2
View File
@@ -2,8 +2,8 @@
// The built-bundle boot smoke: the assembled-jsdom test that owns the boot
// graph itself. Other files share the same scaffolding (assembled-boot.ts) to
// reach a surface only the built bundles expose; this one asserts that the
// graph assembles at all — staged activation across the immediately tier and
// the inject layers, per-plugin CSS injection, and a rendered journey reaching
// graph assembles at all — activation across the immediately tier and
// the inject layers, renderer-owned module styles, and a rendered journey reaching
// chat content from the keyless RemoteMock scenario.
//
// Component behavior remains owned by per-package suites (SlotTestRuntime
+3 -3
View File
@@ -264,8 +264,8 @@ async function withScrollWorld(
runFailure = error
try {
await saveFailureShot(world.page, options.failureShot)
} catch {
// Best-effort evidence must never prevent cleanup of the owned world.
} catch (_failureShotFailed) {
// A missing screenshot loses evidence only; cleanup of the owned world and the rethrown run failure still follow.
}
}
let cleanupFailure: unknown
@@ -1305,7 +1305,7 @@ describe('web e2e: long Chat scroll contract', () => {
const top = viewport.top + element.clientTop
return Math.max(
Math.abs((railBox.top + railBox.bottom) / 2 - (top + composerBox.top) / 2),
Math.abs(viewport.left + element.clientLeft + element.clientWidth - railBox.right - 12),
Math.abs(railBox.left - viewport.left - element.clientLeft - 12),
Math.abs(composerBox.top - buttonBox.bottom - 16),
)
}), { timeout: 10_000 }).toBeLessThanOrEqual(GEOMETRY_TOLERANCE)
+42 -23
View File
@@ -17,13 +17,25 @@ const SESSION_ACTION_EXPECTED = join(EXPECTED, 'session-actions.expected.md')
const SESSION_SEED = fileURLToPath(new URL('../../../snapshots/web/seeded-history/session.v3.jsonl', import.meta.url))
const SESSION_TITLE = 'Session action extension'
async function openInventory(page: Page, url: string) {
/** Load the page on the Plugins page, which reports this page's client synchronization. */
async function openPlugins(page: Page, url: string) {
await page.goto(url, { waitUntil: 'load' })
await page.getByRole('navigation', { name: '全局面板' }).getByRole('button', { name: '插件', exact: true }).click()
await page.locator('[data-plugin-body]').waitFor({ timeout: 10_000 })
}
/** Open the Models settings page's add-provider card and return its API key field, a page-local draft. */
async function openDraft(page: Page) {
await openSettings(page, 'zh')
const dialog = page.getByRole('dialog', { name: '设置' })
await dialog.getByRole('button', { name: '内置插件', exact: true }).click()
await dialog.getByRole('searchbox', { name: '搜索插件' }).waitFor()
return dialog
await dialog.getByRole('button', { name: '模型', exact: true }).click()
const add = dialog.getByRole('button', { name: '添加模型提供商', exact: true })
await expect.poll(() => add.isEnabled(), { timeout: 10_000 }).toBe(true)
await add.click()
await dialog.getByLabel('提供商', { exact: true }).selectOption('minimax-cn')
const draft = dialog.getByRole('textbox', { name: 'API 密钥', exact: true })
await draft.waitFor({ timeout: 10_000 })
return draft
}
it('keeps ordered legacy Session menu rows before Archive and removes them with their fiber', async () => {
@@ -42,6 +54,12 @@ it('keeps ordered legacy Session menu rows before Archive and removes them with
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
const row = page.getByRole('treeitem').filter({ has: page.getByText(SESSION_TITLE, { exact: true }) })
await row.waitFor({ timeout: 20_000 })
// Static library styles follow their module dependencies: dockkit imports primitives, so primitives install first.
const styleOwners = await page.evaluate(() => [...document.head.querySelectorAll('style[data-plugin]')].map(style => style.getAttribute('data-plugin')))
const primitives = styleOwners.flatMap((owner, index) => owner === '@deepseek-ai/dsh-client-ui-primitives' ? [index] : [])
const dockkit = styleOwners.indexOf('@deepseek-ai/dsh-client-ui-dockkit')
expect(primitives.length).toBeGreaterThan(0)
expect(dockkit).toBeGreaterThan(Math.max(...primitives))
const trigger = row.getByRole('button', { name: `Session actions for ${SESSION_TITLE}` })
const trailing = row.locator('[data-session-trailing]')
@@ -196,7 +214,7 @@ it('keeps ordered legacy Session menu rows before Archive and removes them with
await row.hover()
await trigger.click()
await menu.waitFor()
const remainingNames = ['Pin session', 'Rename', 'Fork session', 'Copy Session ID', 'Archive session']
const remainingNames = ['Pin session', 'Rename', 'Mark as unread', 'Fork session', 'Copy Session ID', 'Archive session']
const remainingItems = menu.getByRole('menuitem')
expect(await remainingItems.count()).toBe(remainingNames.length)
for (const [index, name] of remainingNames.entries()) {
@@ -231,8 +249,9 @@ it('synchronizes two pages, disposes effects and restores an offline page from t
const other = await otherContext.newPage()
const consoles = [watchConsole(page), watchConsole(other)]
onTestFailed(() => saveFailureShot(page, 'web-e2e-client-live'))
await openInventory(page, scaffold.authenticatedUrl)
const otherInventory = await openInventory(other, scaffold.authenticatedUrl)
await openPlugins(page, scaffold.authenticatedUrl)
await openPlugins(other, scaffold.authenticatedUrl)
const draft = await openDraft(other)
let entryId: string | undefined
const toggle = async () => {
if (entryId === undefined) entryId = await scaffold.ctx.loader.create({ name: '@fixture/live-client' })
@@ -259,9 +278,8 @@ it('synchronizes two pages, disposes effects and restores an offline page from t
}
await compareOrRefreshGolden(join(EXPECTED, 'enabled.expected.md'), await captureStableAria(page, '[data-live-client]', scaffold.workspaceCwd), webSnapshotMode())
// The inventory filter is page-owned state that live composition must preserve.
const draft = otherInventory.getByRole('searchbox', { name: '搜索插件' })
await draft.fill('unfinished-filter')
// An unsaved Settings field is page-owned state that live composition must preserve.
await draft.fill('unfinished-draft')
await toggle()
for (const target of [page, other]) {
await expect.poll(() => live(target).count()).toBe(0)
@@ -270,7 +288,7 @@ it('synchronizes two pages, disposes effects and restores an offline page from t
expect((await dataset(target)).liveHits).toBe('1')
expect(await target.locator('style[data-plugin="@fixture/live-client"]').count()).toBe(0)
}
expect(await draft.inputValue()).toBe('unfinished-filter')
expect(await draft.inputValue()).toBe('unfinished-draft')
await toggle()
for (const target of [page, other]) {
await live(target).waitFor()
@@ -293,7 +311,7 @@ it('synchronizes two pages, disposes effects and restores an offline page from t
expect(await live(other).count()).toBe(1)
await otherContext.setOffline(false)
await expect.poll(() => live(other).count(), { timeout: 20_000 }).toBe(0)
expect(await draft.inputValue()).toBe('unfinished-filter')
expect(await draft.inputValue()).toBe('unfinished-draft')
expect(navigations).toBe(0)
expect(scaffold.ctx.loader.ctx.fiber.uid).toBe(host)
for (const console of consoles) expect(console.pageErrors).toEqual([])
@@ -309,7 +327,7 @@ it('keeps a failed client download local and retries without changing Host enabl
try {
const page = await browser.newPage({ locale: ZH_BROWSER_LOCALE })
onTestFailed(() => saveFailureShot(page, 'web-e2e-client-live-retry'))
await openInventory(page, scaffold.authenticatedUrl)
await openPlugins(page, scaffold.authenticatedUrl)
const bundle = (url: URL) => url.pathname.startsWith('/plugins/') && url.search.includes('@fixture/live-client/client.js')
await page.route(bundle, route => route.abort())
const entryId = await scaffold.ctx.loader.create({ name: '@fixture/live-client' })
@@ -346,9 +364,9 @@ it('recovers an uncreated client entry with rebuilt factory code without navigat
try {
const page = await browser.newPage({ locale: ZH_BROWSER_LOCALE })
onTestFailed(() => saveFailureShot(page, 'web-e2e-client-factory-rebuild'))
const inventory = await openInventory(page, scaffold.authenticatedUrl)
const draft = inventory.getByRole('searchbox', { name: '搜索插件' })
await draft.fill('unfinished-filter')
await openPlugins(page, scaffold.authenticatedUrl)
const draft = await openDraft(page)
await draft.fill('unfinished-draft')
let navigations = 0
page.on('framenavigated', () => { navigations++ })
const entryId = await scaffold.ctx.loader.create({ name: '@fixture/live-client' })
@@ -360,7 +378,7 @@ it('recovers an uncreated client entry with rebuilt factory code without navigat
await page.getByText('动态插件 r1 已启用', { exact: true }).waitFor()
await expect.poll(() => failure.count()).toBe(0)
await compareOrRefreshGolden(join(EXPECTED, 'recovered.expected.md'), await captureStableAria(page, '[data-live-client]', scaffold.workspaceCwd), webSnapshotMode())
expect(await draft.inputValue()).toBe('unfinished-filter')
expect(await draft.inputValue()).toBe('unfinished-draft')
expect(await page.locator('style[data-plugin="@fixture/live-client"]').count()).toBe(1)
expect(await page.evaluate(() => document.documentElement.dataset.liveMounts)).toBe('1')
expect(scaffold.ctx.loader.resolve(entryId).fiber?.state).toBe(2)
@@ -380,9 +398,9 @@ it('reports bootstrap rebuilds without remounting the settings page or navigatin
const page = await browser.newPage({ locale: ZH_BROWSER_LOCALE })
const console = watchConsole(page)
onTestFailed(() => saveFailureShot(page, 'web-e2e-client-bootstrap-rebuild'))
const inventory = await openInventory(page, scaffold.authenticatedUrl)
const draft = inventory.getByRole('searchbox', { name: '搜索插件' })
await draft.fill('unfinished-filter')
await openPlugins(page, scaffold.authenticatedUrl)
const draft = await openDraft(page)
await draft.fill('unfinished-draft')
const originalInput = await draft.elementHandle()
let navigations = 0
page.on('framenavigated', () => { navigations++ })
@@ -393,11 +411,12 @@ it('reports bootstrap rebuilds without remounting the settings page or navigatin
scaffold.ctx.clientModules.rebuilt('@deepseek-ai/dsh-client-modules')
const failure = page.locator('[data-client-sync-failure]')
await failure.getByText(/replacing bootstrap module .* requires a page reload/).waitFor()
await failure.getByRole('button', { name: '重试本页面同步' }).click()
// The Settings dialog holding the draft covers the Plugins page, so the retry is dispatched to its button.
await failure.getByRole('button', { name: '重试本页面同步' }).dispatchEvent('click')
await failure.getByText(/replacing bootstrap module .* requires a page reload/).waitFor()
await compareOrRefreshGolden(join(EXPECTED, 'bootstrap-rebuild.expected.md'), await captureStableAria(page, '[data-client-sync-failure]', scaffold.workspaceCwd), webSnapshotMode())
expect(await originalInput!.evaluate(input => input.isConnected)).toBe(true)
expect(await draft.inputValue()).toBe('unfinished-filter')
expect(await draft.inputValue()).toBe('unfinished-draft')
expect(scaffold.ctx.loader.ctx.fiber.uid).toBe(host)
expect(navigations).toBe(0)
expect(console.pageErrors).toEqual([])
@@ -415,7 +434,7 @@ it('removes the client UI and resources while Host cleanup is still pending', as
const browser = await chromium.launch()
try {
const page = await browser.newPage({ locale: ZH_BROWSER_LOCALE })
await openInventory(page, scaffold.authenticatedUrl)
await openPlugins(page, scaffold.authenticatedUrl)
let navigations = 0
page.on('framenavigated', () => { navigations++ })
const entryId = await scaffold.ctx.loader.create({ name: '@fixture/live-client' })
+2 -3
View File
@@ -7,8 +7,7 @@ import { readFileSync } from 'node:fs'
import type { Browser, Page } from 'playwright'
import { chromium } from 'playwright'
import { afterAll, beforeAll, describe, expect, it, onTestFailed } from 'vitest'
import * as yaml from 'js-yaml'
import { entryListSchema } from '@deepseek-ai/cordis-plugin-include'
import { parseEntryYaml } from '@deepseek-ai/cordis-plugin-include'
import { brandString } from '@deepseek-ai/dsh-brand'
import {
createAssistantMessage, createMessage, createUserMessage, type ToolCallId,
@@ -32,7 +31,7 @@ const MODE = webSnapshotMode()
/** Overlay layer entries, for the composition guard below. */
function profileEntries(path: string): unknown[] {
const parsed = yaml.load(readFileSync(path, 'utf8'), { schema: entryListSchema })
const parsed = parseEntryYaml(readFileSync(path, 'utf8'))
if (!Array.isArray(parsed)) throw new Error(`profile layer at ${path} must be a list`)
return parsed
}
+2 -3
View File
@@ -10,7 +10,7 @@ import type { SessionId } from '@deepseek-ai/dsh-session'
import type {} from '@deepseek-ai/dsh-agent'
import type {} from '@deepseek-ai/dsh-subagent'
import { launchWebScaffold, selectedSessionFixture, webSnapshotMode, type WebScaffold } from './scaffold.ts'
import { connectFreshWorkspace, newEnglishPage, openSettings, saveFailureShot } from './support.ts'
import { connectFreshWorkspace, newEnglishPage, openSettings, saveFailureShot, showSessionPanel } from './support.ts'
const BASE_FIXTURE = fileURLToPath(new URL('../../../snapshots/web/live-interactions/session.v3.jsonl', import.meta.url))
const LABEL = 'event-sourcing researcher'
@@ -104,8 +104,7 @@ describe('web e2e: composer paste routing', () => {
parent,
})
await waitForAgentToSettle(scaffold, started.childId)
await page.getByRole('button', { name: '1 subagent', exact: true }).hover()
await page.getByRole('treeitem', { name: new RegExp(LABEL) })
await (await showSessionPanel(page)).getByRole('treeitem', { name: new RegExp(LABEL) })
.getByRole('button', { name: `Open ${LABEL} in sidebar`, exact: true }).click()
await page.locator('[data-sidebar-chat] [data-composer-card]').waitFor({ timeout: 15_000 })
})
+3 -1
View File
@@ -75,7 +75,9 @@ describe.each(['MacIntel', 'Win32', 'Linux x86_64'])('web context menus on %s',
const menu = page.getByRole('menu')
await menu.getByRole('menuitem', { name: /Copy.*[Ii][Dd]/ }).waitFor()
const names = await menuLabels(menu)
expect(names.slice(0, 4)).toEqual(['Pin session', 'Rename', 'Fork session', 'Copy Session ID'])
expect(names.slice(0, 5)).toEqual([
'Pin session', 'Rename', 'Mark as unread', 'Fork session', 'Copy Session ID',
])
expect(names).not.toContain('Open in')
expect(names.at(-1)).toBe('Archive session')
expect(await menu.getByRole('menuitem').evaluateAll(rows => rows.every(row => row.querySelector('svg[data-icon]')))).toBe(true)
+6 -2
View File
@@ -142,8 +142,12 @@ it.skipIf(MODE === 'record')('reuses saved native Account Flash translations acr
const account = scaffold.ctx.get('deepseekAccount')
if (account === undefined) throw new Error('Shipped native Account service is absent')
// Only credential acquisition is nondeterministic; the Loader-owned native route and wire remain real.
const auth = vi.spyOn(account, 'resolveToken').mockImplementation(async (url: string) =>
new URL(url).origin === origin ? 'paid-browser-fixture-token' : undefined)
const credential = {
headers: { 'x-dsh-auth-token': 'paid-browser-fixture-token' }, value: 'paid-browser-fixture-token',
revoked: new AbortController().signal, reject: () => Promise.resolve(),
}
const auth = vi.spyOn(account, 'resolveRequestCredential').mockImplementation(async (url: string) =>
new URL(url).origin === origin ? credential : undefined)
resources.restoreAuth = () => { auth.mockRestore() }
scaffold.ctx.emit('llm/adapters-updated')
const owner = [...scaffold.ctx.loader.entries()].find(entry => entry.options.id === 'llm-deepseek-account')
+12 -6
View File
@@ -8,7 +8,7 @@ import { readProfileManifest } from '@deepseek-ai/dsh-app-boot'
import type { SessionId } from '@deepseek-ai/dsh-session'
import type {} from '@deepseek-ai/dsh-ptc-runtime'
import type {} from '@deepseek-ai/dsh-agent-preset-registry'
import { load } from 'js-yaml'
import { parseEntryYaml } from '@deepseek-ai/cordis-plugin-include'
import { expect, it, vi } from 'vitest'
import { captureStableAria, compareOrRefreshGolden, launchWebScaffold, webSnapshotMode, type WebScaffold } from './scaffold.ts'
import { connectFreshWorkspaceZh, ZH_BROWSER_LOCALE } from './support.ts'
@@ -112,7 +112,8 @@ it.skipIf(process.platform !== 'darwin').each([
expect(await card.getByText('实验性', { exact: true }).count()).toBe(1)
expect(await card.textContent()).not.toContain('将 PTC 模式改为可持久化')
expect(await card.textContent()).not.toContain('请切换到 PTC 模式')
expect(await card.textContent()).toContain('通过 npm 安装 DSH 的 Windows 用户需要单独配置 helper')
expect(await card.textContent()).toContain('允许 agent 直接操作电脑上的应用程序。')
expect(await card.textContent()).not.toContain('helper')
expect(await card.textContent()).not.toContain('Swift')
const description = await card.getByRole('button', { name: '查看 Computer Use', exact: true }).evaluate((button) => {
const element = document.getElementById(button.getAttribute('aria-describedby')!)!
@@ -155,9 +156,9 @@ it.skipIf(process.platform !== 'darwin').each([
expect(scaffold.ctx.settings.describe().find(row => row.ns === 'ui-settings')?.value).toMatchObject({ enabled: codingTools })
expect(saved).not.toContain('executionMode:')
if (selectedDefault === undefined) {
expect(load(saved)).not.toEqual(expect.arrayContaining([expect.objectContaining({ id: 'agent-preset-registry' })]))
expect(parseEntryYaml(saved)).not.toEqual(expect.arrayContaining([expect.objectContaining({ id: 'agent-preset-registry' })]))
} else {
expect(load(saved)).toEqual(expect.arrayContaining([
expect(parseEntryYaml(saved)).toEqual(expect.arrayContaining([
expect.objectContaining({ id: 'agent-preset-registry', config: { default: 'standard', selectedDefault } }),
]))
}
@@ -175,7 +176,12 @@ it.skipIf(process.platform !== 'darwin').each([
expect(scaffold.ctx.agentPresets.composedPreset(fresh.ctx)).toBe('ptc')
expect(scaffold.ctx.tools.schemas(fresh).some(tool => tool.name === 'cua')).toBe(true)
await card.getByRole('button', { name: '查看 Computer Use', exact: true }).click()
await plugins.locator('[data-detail-document]').getByText('helperPath', { exact: true }).waitFor()
const detail = plugins.locator('[data-detail-document]')
await detail.getByRole('img', { name: '将会议要点填入备忘录的指令和输入结果' }).waitFor()
const guidance = plugins.locator('[data-cua-guidance]')
await guidance.getByText(/请谨慎在生产环境中使用/).waitFor()
expect(await guidance.textContent()).not.toContain('helperPath')
expect(await detail.textContent()).not.toContain('PTC')
toggle = page.locator('[data-plugin-panel]').getByRole('switch', { name: '启用 Computer Use', exact: true })
const persistent = page.getByRole('group', { name: 'PTC 执行方式', exact: true })
if (!codingTools) {
@@ -263,7 +269,7 @@ it.skipIf(process.platform !== 'darwin').each([
expect(scaffold.ctx.tools.schemas(ptcAgent).some(tool => tool.name === 'cua')).toBe(true)
expect((await runtime.run(runtime.resolve({ program, bindings: [], stateOwner: owner }))).value).toBe(3)
const confirmedSettings = await readFile(settingsPath, 'utf8')
expect(load(confirmedSettings)).toEqual(expect.arrayContaining([
expect(parseEntryYaml(confirmedSettings)).toEqual(expect.arrayContaining([
expect.objectContaining({ id: 'agent-preset-registry', config: { default: 'standard', selectedDefault: 'ptc' } }),
]))
await toggle.click()
+38
View File
@@ -333,3 +333,41 @@ it.skipIf(process.platform !== 'darwin')('keeps system requests pending until fr
await diagnostic.waitFor({ state: 'hidden' })
expect(tripwire.pageErrors).toEqual([])
})
it.skipIf(process.platform !== 'darwin' && process.platform !== 'win32')('shows Windows setup when the helper is missing', async () => {
const root = await mkdtemp(join(tmpdir(), 'dsh-cua-missing-helper-'))
const resources: { scaffold?: WebScaffold; browser?: Browser } = {}
onTestFinished(async () => {
try { await resources.browser?.close() } finally {
try { await resources.scaffold?.close() } finally { await rm(root, { recursive: true, force: true }) }
}
})
const patch = join(root, 'missing-helper.yml')
const row = process.platform === 'win32' ? 'cua-windows' : 'cua-macos'
await writeFile(patch, JSON.stringify([{ id: row, config: { helperPath: join(root, 'missing.exe') } }]))
const scaffold = resources.scaffold = await launchWebScaffold({
profile: { packages: [{ dir: bundle, enabled: true }] }, extraOverlayPath: patch,
})
if (process.platform === 'darwin') {
// The Host inventory reads this Loader flag; only the platform-specific input is substituted on macOS.
const windows = [...scaffold.ctx.loader.entries()].find(entry => entry.options.id === 'cua-windows')
if (!windows) throw new Error('CUA bundle has no Windows provider row')
vi.spyOn(windows, 'disabled', 'get').mockReturnValue(false)
}
const browser = resources.browser = await chromium.launch()
const page = await newEnglishPage(browser)
await page.goto(scaffold.authenticatedUrl)
await page.getByRole('button', { name: 'Plugins', exact: true }).click()
await page.getByRole('button', { name: 'View Computer use', exact: true }).click()
const panel = page.locator('[data-cua-settings]')
const guidance = panel.locator('[data-cua-guidance]')
await guidance.getByText(/pnpm run build:native:x64/).waitFor()
await guidance.getByText(/helperPath/).waitFor()
const preview = page.locator('[data-detail-document] img')
await preview.evaluate(async (image) => { await (image as HTMLImageElement).decode() })
const firstSetting = panel.getByRole('group', { name: 'Default mode for new sessions', exact: true })
const previewBox = await preview.boundingBox(), guidanceBox = await guidance.boundingBox(), settingBox = await firstSetting.boundingBox()
expect(previewBox!.y + previewBox!.height).toBeLessThanOrEqual(guidanceBox!.y)
expect(guidanceBox!.y + guidanceBox!.height).toBeLessThanOrEqual(settingBox!.y)
expect(await panel.getByRole('button', { name: 'Request permission', exact: true }).count()).toBe(0)
})
+174
View File
@@ -0,0 +1,174 @@
/**
* Web snapshot: the optional DeepSeek chat import bundle stores a synthetic
* export as Sessions through its owner upload route, and one imported Session
* continues with one recorded model turn. The committed Session is the imported
* history the model receives: the newest-leaf branch, reasoning, the
* `web_search` / `web_fetch` pair, and an excluded reply; a content-filtered
* round is left out entirely.
* Record: DSH_SNAPSHOT=record writes the current Session generation; a keyless
* DSH_SNAPSHOT=refresh then writes the system-prompt and tool-schema pins.
*/
import { readFile } from 'node:fs/promises'
import { basename, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { strToU8, zipSync } from 'fflate'
import { chromium, type Browser } from 'playwright'
import { expect, it, onTestFailed } from 'vitest'
import { SESSION_FORMAT_VERSION } from '@deepseek-ai/dsh-session'
import {
assertFixtureInventory, fixtureUserPrompts, launchWebScaffold, recordFixture, selectedSessionFixture,
watchConsole, webSnapshotMode, type WebScaffold,
} from './scaffold.ts'
import { newEnglishPage, saveFailureShot } from './support.ts'
const DIR = fileURLToPath(new URL('../../../snapshots/web/deepseek-chat-import', import.meta.url))
const FIXTURE = join(DIR, `session.v${SESSION_FORMAT_VERSION}.jsonl`)
const BUNDLE_DIR = fileURLToPath(new URL('../../../packages/experimental/deepseek-chat-import', import.meta.url))
const UPLOAD_PATH = '/api/deepseek-chat-import/archive'
const MODE = webSnapshotMode()
// Record sends this prompt; replay asserts the committed fixture recorded exactly it.
const PROMPT = 'Without calling any tools, answer in one short sentence: which bus did you recommend earlier, and which of my earlier questions has no answer yet?'
const BASE = Date.UTC(2026, 10, 11, 2, 0, 0)
const at = (seconds: number): string => new Date(BASE + seconds * 1000).toISOString()
const ROUTE_URL = 'https://transit.example/routes/12'
const RESUMED_TITLE = 'Bus to the city museum'
const FIRST_QUESTION = 'Which bus goes from Central Station to the City Museum?'
/**
* The continued conversation in the 2026-11-12 export structure.
* `current_message_id` 8 selects the branch through messages 1, 2, 5, 6, 7,
* and 8 and drops the side branch 3/4. The question 5 with its CONTENT_FILTER
* reply 6 is left out entirely; the INCOMPLETE reply 8 ends its turn with an
* error and stays out of model history.
*/
const RESUMED = {
id: 'museum-route', title: RESUMED_TITLE, current_message_id: 8, inserted_at: at(0),
messages: [
{ id: 1, parent_id: null, role: 'USER', status: 'FINISHED', inserted_at: at(10), fragments: [{ type: 'REQUEST', content: FIRST_QUESTION }] },
{
id: 2, parent_id: 1, role: 'ASSISTANT', status: 'FINISHED', inserted_at: at(12), fragments: [
{ type: 'THINK', content: 'Check the current route before answering.', elapsed_secs: 2 },
{ type: 'READ_LINK', results: [{ url: ROUTE_URL, title: 'Route 12 timetable' }] },
{
type: 'TOOL_SEARCH', queries: ['Central Station City Museum bus'], status: 'FINISHED', stage_id: 1, results: [{
url: ROUTE_URL, title: 'Route 12 timetable', snippet: 'Route 12 runs from Central Station to the City Museum every 10 minutes.', published_at: null,
}],
},
{ type: 'TOOL_OPEN', status: 'FINISHED', url: ROUTE_URL, title: 'Route 12 timetable', stage_id: 2 },
{ type: 'THINK', content: 'Route 12 stops at the museum.', elapsed_secs: 1 },
{ type: 'RESPONSE', content: 'Take bus 12 from Central Station; it stops at the City Museum.' },
],
},
{ id: 3, parent_id: 2, role: 'USER', status: 'FINISHED', inserted_at: at(60), fragments: [{ type: 'REQUEST', content: 'How long is the ride?' }] },
{ id: 4, parent_id: 3, role: 'ASSISTANT', status: 'FINISHED', inserted_at: at(62), fragments: [{ type: 'RESPONSE', content: 'About 25 minutes.' }] },
{ id: 5, parent_id: 2, role: 'USER', status: 'FINISHED', inserted_at: at(120), fragments: [{ type: 'REQUEST', content: 'Is there a night bus?' }] },
{ id: 6, parent_id: 5, role: 'ASSISTANT', status: 'CONTENT_FILTER', inserted_at: at(122), fragments: [{ type: 'RESPONSE', content: 'Withdrawn night bus answer.' }] },
{ id: 7, parent_id: 6, role: 'USER', status: 'FINISHED', inserted_at: at(180), fragments: [{ type: 'REQUEST', content: 'Does bus 12 run on Sundays?' }] },
{ id: 8, parent_id: 7, role: 'ASSISTANT', status: 'INCOMPLETE', inserted_at: at(182), fragments: [{ type: 'RESPONSE', content: 'Interrupted Sunday answer.' }] },
],
}
/** An older conversation imported beside the continued one. */
const OTHER = {
id: 'packing-list', title: 'Day trip packing list', current_message_id: 2, inserted_at: at(-86_400),
messages: [
{ id: 1, parent_id: null, role: 'USER', status: 'FINISHED', inserted_at: at(-86_390), fragments: [{ type: 'REQUEST', content: 'List three things to pack for a day trip.' }] },
{ id: 2, parent_id: 1, role: 'ASSISTANT', status: 'FINISHED', inserted_at: at(-86_388), fragments: [{ type: 'RESPONSE', content: 'Water, a snack, and a phone charger.' }] },
],
}
/** The final line of the upload route's NDJSON answer. */
interface ImportOutcomeLine {
readonly type: 'outcome'
readonly outcome:
| { readonly ok: true; readonly value: { readonly sessionIds: readonly string[] } & Record<string, unknown> }
| { readonly ok: false; readonly error: { readonly reason: string; readonly message: string } }
}
/** A `deepseek_data` ZIP holding the manifest and both conversations. */
function exportArchive(): Uint8Array<ArrayBuffer> {
return new Uint8Array(zipSync({
'manifest.json': strToU8(JSON.stringify({ export_format_version: 3 })),
'chat_session_index.json': strToU8(JSON.stringify([RESUMED, OTHER].map(file => ({
id: file.id, title: file.title, pinned: false, inserted_at: file.inserted_at,
updated_at: file.messages[file.messages.length - 1]?.inserted_at ?? file.inserted_at,
message_count: file.messages.length,
})))),
...Object.fromEntries([RESUMED, OTHER].map(file => [`chat_sessions/${file.id}.json`, strToU8(JSON.stringify(file))])),
}))
}
/**
* Upload the archive the way the bundle's browser half does and read the outcome line.
* @param scaffold - the booted Web scaffold, whose cookie authenticates the owner.
* @param workspaceId - Workspace receiving the imported Sessions.
* @returns the outcome, which must be the only outcome line and the last line.
*/
async function importArchive(scaffold: WebScaffold, workspaceId: string): Promise<ImportOutcomeLine['outcome']> {
const response = await scaffold.hostFetch(`${UPLOAD_PATH}?workspaceId=${encodeURIComponent(workspaceId)}`, {
method: 'POST', headers: { 'content-type': 'application/octet-stream' }, body: exportArchive(),
})
expect(response.status).toBe(200)
const lines = (await response.text()).split('\n').filter(line => line.trim() !== '')
.map(line => JSON.parse(line) as { readonly type?: string })
const outcomes = lines.filter((line): line is ImportOutcomeLine => line.type === 'outcome')
expect(outcomes, 'the import answer carries exactly one outcome line').toHaveLength(1)
expect(lines.at(-1)).toBe(outcomes[0])
return outcomes[0]!.outcome
}
it('continues a Session imported from a DeepSeek chat export with one model turn', async () => {
if (MODE !== 'record') {
expect(fixtureUserPrompts(await readFile(await selectedSessionFixture(FIXTURE), 'utf8')).at(-1)).toBe(PROMPT)
}
const scaffold = await launchWebScaffold({
profile: { packages: [{ dir: BUNDLE_DIR, enabled: true }] },
...(MODE === 'record' ? {} : { replayFixture: FIXTURE, compareReplaySession: true }),
})
let browser: Browser | undefined
try {
const workspace = await scaffold.ctx.workspaceRegistry.create(scaffold.workspaceCwd)
const outcome = await importArchive(scaffold, workspace.id)
expect(outcome).toMatchObject({ ok: true, value: { workspaceId: workspace.id, conversationCount: 2, omittedByLimit: 0, skipped: [] } })
const sessionIds = outcome.ok ? outcome.value.sessionIds : []
expect(sessionIds).toHaveLength(2)
browser = await chromium.launch()
const page = await newEnglishPage(browser)
const tripwire = watchConsole(page)
onTestFailed(() => saveFailureShot(page, 'web-e2e-deepseek-chat-import'))
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
await page.getByRole('treeitem').filter({ has: page.getByText(RESUMED_TITLE, { exact: true }) }).click({ timeout: 20_000 })
await page.getByText(FIRST_QUESTION, { exact: true }).first().waitFor({ timeout: 20_000 })
const input = page.locator('[data-composer-input][contenteditable="true"]').first()
await input.waitFor({ timeout: 15_000 })
const settled = scaffold.whenTurnSettled()
await input.fill(PROMPT)
await input.press('Enter')
const sessionId = await settled
expect(sessionIds).toContain(sessionId)
const session = scaffold.ctx.agents.get(sessionId)?.session
if (session === undefined) throw new Error('the continued Session has no live Agent')
const events = session.snapshotEvents()
const turn = events.slice(events.findLastIndex(event => event.type === 'turn/start'))
expect(turn.filter(event => event.type === 'tool/call'), 'the continued turn answers without tools').toEqual([])
expect(turn.find(event => event.type === 'turn/end')).toMatchObject({ data: { reason: { kind: 'completed' } } })
expect(tripwire.pageErrors).toEqual([])
expect(tripwire.warnings).toEqual([])
// Every check precedes the write, so a failed record run leaves no fixture behind.
if (MODE === 'record') await recordFixture(scaffold, sessionId, FIXTURE)
} finally {
try {
await browser?.close()
} finally {
await scaffold.close()
}
}
}, 240_000)
it.skipIf(MODE === 'record')('keeps a closed fixture inventory', async () => {
await assertFixtureInventory(DIR, [basename(FIXTURE), 'system-prompt.expected.md', 'tool-schemas.expected.json'])
})
+7 -1
View File
@@ -142,7 +142,13 @@ describe('web e2e: the composer model switch is the default for later sessions',
badge.textContent = ' — Provider identification badge with a long channel name'
node.appendChild(badge)
})
await expect.poll(async () => (await surface.boundingBox())!.width).toBeGreaterThan(original!.width + 50)
if (pane === 'root') {
expect(original!.width).toBe(240)
await expect.poll(async () => (await surface.boundingBox())!.width).toBe(240)
await expect.poll(async () => (await surface.boundingBox())!.x).toBeCloseTo(original!.x)
} else {
await expect.poll(async () => (await surface.boundingBox())!.width).toBeGreaterThan(original!.width + 50)
}
await expect.poll(async () => {
const box = (await surface.boundingBox())!
return box.x >= 12 && box.x + box.width <= 378
@@ -66,19 +66,35 @@ it('activates the actual default Client registry without experimental packages',
Object.defineProperty(globalThis, '__ModuleLoader__', { configurable: true, writable: true, value: target })
const create = target.create.bind(target)
target.create = function (options) {
const cordis = options.staticModules['@deepseek-ai/cordis'] as { RegistryService: typeof RegistryService }
const prototype = cordis.RegistryService.prototype
const cordis = options.staticModules.find(module => module.id === '@deepseek-ai/cordis')
if (cordis === undefined) throw new Error('Cordis platform module is missing from the static seed')
const forbidRequire = (specifier: string): never => {
throw new Error(`Cordis platform adapter unexpectedly requested ${specifier}`)
}
const require: Parameters<typeof cordis.factory>[0] = Object.assign(forbidRequire, {
async: async (specifier: string): Promise<never> => forbidRequire(specifier),
asset: forbidRequire,
})
const Registry = cordis.factory(require).RegistryService
if (typeof Registry !== 'function') throw new Error('Cordis platform adapter did not export RegistryService')
const prototype = (Registry as typeof RegistryService).prototype
// eslint-disable-next-line @typescript-eslint/unbound-method -- apply() preserves the runtime registry receiver.
const plugin = prototype.plugin
// Capture the first real root and immediately restore the registry method.
prototype.plugin = function (...args: Parameters<RegistryService['plugin']>) {
prototype.plugin = plugin
observation.ctx = this.ctx.root
// This init script runs in the page, where the test's `Context` import is unavailable.
observation.ctx = this.ctx[Symbol.for('cordis.root') as typeof Context.root]
return plugin.apply(this, args)
}
const modules = create(options)
observation.modules = modules
return modules
try {
const modules = create(options)
observation.modules = modules
return modules
} catch (error) {
prototype.plugin = plugin
throw error
}
}
},
})
+4 -2
View File
@@ -5,7 +5,6 @@ import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { connectDesktopWelcome } from '../../desktop/src/welcome-backend.ts'
import { authenticateWebHost } from '../../desktop/src/web-document.ts'
import { chromium, type Browser, type Page } from 'playwright'
import { afterEach, beforeEach, describe, expect, it, onTestFailed } from 'vitest'
import { credentialKey, credentialRef } from '@deepseek-ai/dsh-credentials'
@@ -109,7 +108,10 @@ describe.skipIf(MODE === 'record')('web e2e: App-only desktop onboarding', () =>
async function desktopPage(locale = ZH_BROWSER_LOCALE): Promise<Page> {
const opened = await browser.newPage({ viewport: { width: 1280, height: 840 }, locale, reducedMotion: 'reduce' })
const welcome = connectDesktopWelcome(scaffold.baseUrl, await authenticateWebHost(scaffold.authenticatedUrl))
const welcome = connectDesktopWelcome(scaffold.baseUrl, '', (input, init) => {
const target = new URL(input)
return scaffold.hostFetch(`${target.pathname}${target.search}`, init)
})
await opened.exposeFunction('__onboardingHasApiKey', async () => (await welcome.read()).hasApiKey)
await opened.addInitScript(() => {
Object.defineProperty(globalThis, 'dshOnboarding', { value: {
@@ -0,0 +1,99 @@
// Web e2e scenario: a composer draft's pasted image survives a sidebar session
// switch. The reported defect spans the whole chain — sidebar row click, Session
// scope retirement, the input shell's teardown, and the rail's rebuild — so only
// the real composition can pin it. Units cover each link separately (hub/shell/
// service specs); this covers the assembled path and the rail the user sees.
//
// Zero model calls: a seeded session is non-blank (so the sidebar can create a
// second one instead of reusing it) and the scenario never submits.
import { readFile } from 'node:fs/promises'
import { fileURLToPath } from 'node:url'
import type { Browser, Page } from 'playwright'
import { chromium } from 'playwright'
import { afterAll, beforeAll, describe, expect, it, onTestFailed } from 'vitest'
import {
launchWebScaffold, seedSession, watchConsole, webSnapshotMode, type WebScaffold,
} from './scaffold.ts'
import { newEnglishPage, saveFailureShot } from './support.ts'
const MODE = webSnapshotMode()
const SEED_ID = 'draft-attachment-switch-a'
const PEER_ID = 'draft-attachment-switch-b'
const FIXTURE = fileURLToPath(new URL('../../../snapshots/web/live-interactions/session.v3.jsonl', import.meta.url))
const PNG = fileURLToPath(new URL('../../../snapshots/session/read-image/workspace/red.png', import.meta.url))
const DRAFT_TEXT = 'draft text that survives the switch'
/** The composer's pending-attachment rail, present only while it holds items. */
const RAIL = '[role="group"][aria-label="Pending attachments"]'
/**
* Paste one real PNG into the composer through a genuine clipboard event, the
* same intake a user's screenshot paste performs.
* @param page - page holding the composer.
* @param bytes - PNG bytes.
*/
async function pasteImage(page: Page, bytes: Uint8Array): Promise<void> {
await page.locator('[data-composer-input]').first().evaluate((surface, data) => {
const transfer = new DataTransfer()
transfer.items.add(new File([new Uint8Array(data)], 'draft.png', { type: 'image/png' }))
surface.dispatchEvent(new ClipboardEvent('paste', {
clipboardData: transfer, bubbles: true, cancelable: true,
}))
}, [...bytes])
}
describe.skipIf(MODE === 'record')('web e2e: draft attachment across a session switch', () => {
let scaffold: WebScaffold
let browser: Browser
let page: Page
let tripwire: ReturnType<typeof watchConsole>
beforeAll(async () => {
scaffold = await launchWebScaffold({})
const log = await readFile(FIXTURE, 'utf8')
await seedSession(scaffold, log, SEED_ID)
await seedSession(scaffold, log, PEER_ID)
browser = await chromium.launch()
page = await newEnglishPage(browser)
tripwire = watchConsole(page)
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
await page.waitForSelector('[class*="frame"]', { timeout: 30_000 })
// Expand the workspace group and open the seeded session.
const groupRow = page.locator('[role="treeitem"]').first()
await groupRow.waitFor({ timeout: 15_000 })
await groupRow.click()
const sessionRow = page.locator(`[data-row-key="session:${SEED_ID}"]`)
await sessionRow.waitFor({ timeout: 15_000 })
await sessionRow.click()
await page.locator('[data-composer-input]').first().waitFor({ timeout: 15_000 })
})
afterAll(async () => {
await browser?.close()
await scaffold?.close()
})
it('keeps the pasted image and the typed draft when the sidebar leaves and returns', async () => {
onTestFailed(() => saveFailureShot(page, 'draft-attachment-session-switch'))
// (a) paste an image, then type text into the seeded session's composer.
await pasteImage(page, await readFile(PNG))
await expect.poll(() => page.locator(`${RAIL} img`).count(), { timeout: 15_000 }).toBe(1)
await page.locator('[data-composer-input]').first().click()
await page.keyboard.type(DRAFT_TEXT, { delay: 5 })
await expect.poll(() => page.locator(RAIL).locator('img').count(), { timeout: 10_000 }).toBe(1)
// (b) leave through the sidebar: switching to another session retires this
// one's Session scope.
await page.locator(`[data-row-key="session:${PEER_ID}"]`).click()
await expect.poll(() => page.locator(RAIL).count(), { timeout: 15_000 }).toBe(0)
// (c) return: the rebuilt composer must show the image AND the text.
await page.locator(`[data-row-key="session:${SEED_ID}"]`).click()
await expect.poll(() => page.locator(`${RAIL} img`).count(), { timeout: 15_000 }).toBe(1)
await expect.poll(
() => page.locator('[data-composer-input]').first().innerText(),
{ timeout: 10_000 },
).toContain(DRAFT_TEXT)
expect(tripwire.pageErrors).toEqual([])
})
})
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -1,5 +1,5 @@
- navigation "Session hierarchy": Seeded turn
- text: Minimal mode
- button "1 subagent"
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
@@ -1,5 +1,6 @@
- banner:
- navigation "Session hierarchy": Clickable links gallery
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,6 +1,7 @@
- menu:
- menuitem "Pin session"
- menuitem "Rename"
- menuitem "Mark as unread"
- menuitem "Fork session"
- separator
- menuitem "Copy Session ID"
@@ -1,5 +1,6 @@
Pin session
Rename
Mark as unread
Fork session
Copy Session ID
Archive session
@@ -1,5 +1,6 @@
- banner:
- navigation "Session hierarchy": Use only Cordis tools. First
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,4 +1,5 @@
- region "Authorize computer use":
- paragraph: Computer use is an experimental preview. The agent may click the wrong button or type in the wrong window. Use caution in production environments. We recommend native PTC mode so the agent can operate apps and call other tools in the same program.
- heading "Authorize computer use" [level=3]
- group "Default mode for new sessions":
- strong: Default mode for new sessions
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -3,7 +3,7 @@
- navigation:
- button "General"
- button "Models"
- button "Built-in plugins"
- button "Plugins"
- button "Agent presets"
- button "Open configuration file"
- button "Close"
@@ -1,4 +1,3 @@
- button "本地变更"
- text: HEAD → origin/main
- button "查看本会话的变更:1 个文件,新增 1 行,删除 0 行": +1 −0 1 个文件
- button "创建变更请求"
- button "本地变更 · 1 个文件,新增 1 行,删除 0 行": 本地变更 · 1 个文件
- text: +1 −0
- button "本地变更操作"
@@ -1,21 +1,22 @@
- text: feat 项目目录
- button "复制项目目录路径"
- button "本地变更"
- text: HEAD → origin/main
- button "查看本会话的变更:4 个文件,新增 4 行,删除 1 行": +4 −1 4 个文件
- heading "本会话的变更请求 · 1" [level=3]
- button "刷新状态"
- list:
- listitem:
- img "变更请求状态:需要处理"
- link "Add the pull request panel":
- /url: https://github.com/octo/demo/pull/7
- text: "#7 feat → main"
- button "在浏览器中打开"
- button "复制变更请求链接"
- 'button "从本会话移除 #7"'
- 'button "收起 #7" [expanded]'
- button "检查 已加载 1 项检查,仍有更多"
- button "评审 等待评审"
- text: 合并 无冲突
- 'button "查看 #7 的变更:新增 128 行,删除 14 行"': 变更 +128 −14 1 条未解决讨论
- complementary "会话面板":
- region "环境":
- heading "环境" [level=2]
- text: workspace {{cwd}} feat 项目目录
- button "本地变更 · 4 个文件,新增 4 行,删除 1 行": 本地变更 · 4 个文件
- text: +4 −1
- button "本地变更操作"
- region "变更请求":
- heading "变更请求" [level=2]
- text: "1"
- list:
- listitem:
- img "变更请求状态:需要处理"
- link "Add the pull request panel":
- /url: https://github.com/octo/demo/pull/7
- text: "#7 feat → main"
- button "#7 的操作"
- 'button "收起 #7" [expanded]'
- button "检查 已加载 1 项检查,仍有更多"
- button "评审 等待评审"
- text: 合并 无冲突
- 'button "查看 #7 的变更:新增 128 行,删除 14 行"': 变更 +128 −14 1 条未解决讨论
@@ -1,4 +1,3 @@
- button "Local changes"
- text: HEAD → origin/main
- 'button "View the changes of this Session: 60 files, 60 lines added, 0 lines deleted"': +60 −0 60 files
- button "Create change request"
- button "Local changes · 60 files, 60 lines added, 0 lines deleted": Local changes · 60 files
- text: +60 −0
- button "Local changes actions"
@@ -1,18 +1,19 @@
- text: dsh-{{worktree}} 工作树 · 基于 release
- button "复制工作树路径"
- heading "本会话的变更请求 · 1" [level=3]
- button "刷新状态"
- list:
- listitem:
- img "变更请求状态:需要处理"
- link "Add the pull request panel":
- /url: https://github.com/octo/demo/pull/7
- text: "#7 feat → main"
- button "在浏览器中打开"
- button "复制变更请求链接"
- 'button "从本会话移除 #7"'
- 'button "收起 #7" [expanded]'
- button "检查 已加载 1 项检查,仍有更多"
- button "评审 等待评审"
- text: 合并 无冲突
- 'button "查看 #7 的变更:新增 128 行,删除 14 行"': 变更 +128 −14 1 条未解决讨论
- complementary "会话面板":
- region "环境":
- heading "环境" [level=2]
- text: dsh-{{worktree}} {{cwd}}/workspace/.agents/worktrees dsh-{{worktree}} 工作树 · 基于 release
- region "变更请求":
- heading "变更请求" [level=2]
- text: "1"
- list:
- listitem:
- img "变更请求状态:需要处理"
- link "Add the pull request panel":
- /url: https://github.com/octo/demo/pull/7
- text: "#7 feat → main"
- button "#7 的操作"
- 'button "收起 #7" [expanded]'
- button "检查 已加载 1 项检查,仍有更多"
- button "评审 等待评审"
- text: 合并 无冲突
- 'button "查看 #7 的变更:新增 128 行,删除 14 行"': 变更 +128 −14 1 条未解决讨论
@@ -3,9 +3,7 @@
- link "Add the pull request panel":
- /url: https://github.com/octo/demo/pull/7
- text: "#7 feat → main"
- button "在浏览器中打开"
- button "复制变更请求链接"
- 'button "从本会话移除 #7"'
- button "#7 的操作"
- 'button "收起 #7" [expanded]'
- button "检查 已加载 1 项检查,仍有更多"
- button "评审 等待评审"
@@ -1 +0,0 @@
- button "代码审查和变更 查看代码变更与本会话的变更请求"
@@ -11,6 +11,7 @@
- banner:
- navigation "Session hierarchy": Review deepseek-ai/deepseek-harness#314
- text: Standard mode
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -11,6 +11,7 @@
- banner:
- navigation "Session hierarchy": Review deepseek-ai/deepseek-harness#314
- text: Standard mode
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,6 +1,7 @@
- banner:
- navigation "Session hierarchy": workspace
- text: Standard mode
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,35 +0,0 @@
# Background jobs above the Browser dock
```json
{
"collapsed": {
"dockMode": "push",
"bodyMounted": true,
"fixed": true,
"anchored": true,
"viewportBounded": true,
"overlapsBrowser": true,
"aboveBrowser": true
},
"expanded": {
"dockMode": "push",
"bodyMounted": true,
"fixed": true,
"anchored": true,
"viewportBounded": true,
"overlapsBrowser": true,
"aboveBrowser": true
},
"resized": {
"dockMode": "push",
"bodyMounted": true,
"fixed": true,
"anchored": true,
"viewportBounded": true,
"overlapsBrowser": true,
"aboveBrowser": true
},
"escapeRestoresFocus": true,
"outsideDismisses": true
}
```
@@ -0,0 +1,38 @@
# Background jobs beside the Browser dock
```json
{
"collapsed": {
"dockMode": "push",
"presentation": "overlay",
"insideBody": true,
"clearOfBrowser": true,
"clearOfComposer": true,
"viewportBounded": true,
"sectionShown": true,
"onTop": true
},
"expanded": {
"dockMode": "push",
"presentation": "overlay",
"insideBody": true,
"clearOfBrowser": true,
"clearOfComposer": true,
"viewportBounded": true,
"sectionShown": true,
"onTop": true
},
"resized": {
"dockMode": "push",
"presentation": "overlay",
"insideBody": true,
"clearOfBrowser": true,
"clearOfComposer": true,
"viewportBounded": true,
"sectionShown": true,
"onTop": true
},
"escapeRestoresFocus": true,
"outsideDismisses": true
}
```
@@ -1,5 +1,6 @@
- banner:
- navigation "Session hierarchy": CJK strong emphasis
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,5 +1,6 @@
- banner:
- navigation "Session hierarchy": Markdown image policy
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,5 +1,6 @@
- banner:
- navigation "Session hierarchy": Inline code links
- button "Session panel"
- button "More actions"
- tablist:
- tab "Chat" [selected]
@@ -1,5 +1,6 @@
- banner:
- navigation "Session hierarchy": Math rendering
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,6 +1,7 @@
- menu:
- menuitem "Pin session"
- menuitem "Rename"
- menuitem "Mark as unread"
- menuitem "Fork session"
- separator
- menuitem "Copy Session ID"
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -39,7 +39,7 @@
- switch "启用 自动授权审查"
- listitem:
- button "查看 变更请求与工作树": 变更请求与工作树
- text: 实验性 在会话侧栏集中跟踪关联的 GitHub PR:查看检查状态、评审意见与代码差异,并把修改建议交给智能体继续处理。也可查看本地改动,用独立工作树隔离任务。GitHub 功能需要本机安装 gh 并登录。
- text: 实验性 在会话侧栏集中跟踪关联的代码变更请求,支持 GitHub PR 以及 GitLab MR:查看检查状态、评审意见与代码差异,并把修改建议交给智能体继续处理。也可查看本地改动,用独立工作树隔离任务。GitHub 功能需要本机安装 gh 并登录。GitLab 合并请求需要本机安装 glab 并登录。
- status
- switch "启用 变更请求与工作树"
- heading "已安装插件" [level=3]
@@ -5,12 +5,12 @@
- text: v{{version}} 实验性
- paragraph:
- code: "@deepseek-ai/dsh-experimental-forge-bundle"
- paragraph: 在会话侧栏集中跟踪关联的 GitHub PR:查看检查状态、评审意见与代码差异,并把修改建议交给智能体继续处理。也可查看本地改动,用独立工作树隔离任务。GitHub 功能需要本机安装 gh 并登录。
- paragraph: 在会话侧栏集中跟踪关联的代码变更请求,支持 GitHub PR 以及 GitLab MR:查看检查状态、评审意见与代码差异,并把修改建议交给智能体继续处理。也可查看本地改动,用独立工作树隔离任务。GitHub 功能需要本机安装 gh 并登录。GitLab 合并请求需要本机安装 glab 并登录。
- region "详细介绍":
- paragraph:
- img "会话关联 GitHub PR,跟踪检查、评审与代码差异,并用工作树隔离任务改动"
- heading "包含的组件" [level=4]
- text: 共 6 个 · 6 已停用
- text: 共 7 个 · 7 已停用
- list:
- listitem:
- text: 工作树服务 创建命名的 Git 工作树,并切换当前会话的工作目录。
@@ -32,13 +32,18 @@
- code: forge-github
- code: "@deepseek-ai/dsh-experimental-forge-github"
- text: 已关闭
- listitem:
- text: GitLab 变更请求 通过宿主上的 GitLab CLI 为 forge 注册表读写 GitLab 合并请求。
- code: forge-gitlab
- code: "@deepseek-ai/dsh-forge-gitlab"
- text: 已关闭
- listitem:
- text: 会话变更请求 把变更请求绑定到创建、推送或跟踪它们的会话,并监听其状态。
- code: forge-session
- code: "@deepseek-ai/dsh-experimental-forge-session"
- text: 已关闭
- listitem:
- text: 变更请求面板 在侧栏标签页中显示会话的变更请求,并让新会话可以在工作树中开始。
- text: 变更请求面板 在会话面板中显示会话的变更请求,并让新会话可以在工作树中开始。
- code: forge-panel
- code: "@deepseek-ai/dsh-experimental-client-ui-forge"
- text: 已关闭
@@ -39,7 +39,7 @@
- switch "启用 自动授权审查"
- listitem:
- button "查看 变更请求与工作树": 变更请求与工作树
- text: 实验性 在会话侧栏集中跟踪关联的 GitHub PR:查看检查状态、评审意见与代码差异,并把修改建议交给智能体继续处理。也可查看本地改动,用独立工作树隔离任务。GitHub 功能需要本机安装 gh 并登录。
- text: 实验性 在会话侧栏集中跟踪关联的代码变更请求,支持 GitHub PR 以及 GitLab MR:查看检查状态、评审意见与代码差异,并把修改建议交给智能体继续处理。也可查看本地改动,用独立工作树隔离任务。GitHub 功能需要本机安装 gh 并登录。GitLab 合并请求需要本机安装 glab 并登录。
- status
- switch "启用 变更请求与工作树"
- heading "已安装插件" [level=3]
@@ -39,7 +39,7 @@
- switch "启用 自动授权审查"
- listitem:
- button "查看 变更请求与工作树": 变更请求与工作树
- text: 实验性 在会话侧栏集中跟踪关联的 GitHub PR:查看检查状态、评审意见与代码差异,并把修改建议交给智能体继续处理。也可查看本地改动,用独立工作树隔离任务。GitHub 功能需要本机安装 gh 并登录。
- text: 实验性 在会话侧栏集中跟踪关联的代码变更请求,支持 GitHub PR 以及 GitLab MR:查看检查状态、评审意见与代码差异,并把修改建议交给智能体继续处理。也可查看本地改动,用独立工作树隔离任务。GitHub 功能需要本机安装 gh 并登录。GitLab 合并请求需要本机安装 glab 并登录。
- status
- switch "启用 变更请求与工作树"
- heading "已安装插件" [level=3]
@@ -0,0 +1,12 @@
- region "Task tracking":
- heading "Task tracking" [level=2]
- text: Replace Todo tools (recommended)
- button "Uses Timeline task trees in place of Todo tools in this profile."
- switch "Replace Todo tools (recommended)" [checked]
- text: Auto-open sidebar
- button "Opens the sidebar when the first task tree appears in a session and the window is wider than 768 px. You can still open it from the progress bar."
- switch "Auto-open sidebar"
- text: Task update reminder
- button "Reminds the agent after this many consecutive steps in a turn without a successful task update."
- spinbutton "Task update reminder": "24"
- text: iterations
@@ -2,7 +2,7 @@
Touch refresh: one refresh request; no tooltip
Touch explanation: visible within the 390px viewport
- tooltip "在这里配置官方插件,安装和管理其他插件。内置插件列表及运行状态可在「设置 → 内置插件」中查看"
- tooltip "在这里配置官方插件,安装、管理和配置其他插件。"
Explanation closes on another tap or an outside touch
Keyboard focus after touch: refresh tooltip visible
Mouse hover after touch: refresh tooltip visible
@@ -5,4 +5,6 @@
- 768px: single row; index, search, labels, sort, and refresh are contained, reachable, and separate; no horizontal overflow; search focus retained.
- 1280px: single row; index, search, labels, sort, and refresh are contained, reachable, and separate; no horizontal overflow; search focus retained.
The source dialog treats a Raw URL and an unmarked custom URL as JSON. It shows Git fields for an SSH clone address or a git+https URL. The fields fit and stay reachable at 390px and 1280px. Editing the address preserves the Git draft, and Escape closes the dialog.
At 390px, restoring the previous no-wrap layout causes horizontal overflow and fails the same layout check. Removing that override restores the controls and preserves search focus.
@@ -1,5 +1,6 @@
- banner:
- navigation "Session hierarchy": Reference order target
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -0,0 +1,19 @@
- region "Recommended":
- heading "Recommended" [level=2]
- list:
- listitem:
- button "Daily brief": Daily brief Recent changes in the workspace and what needs follow-up, with what to do first today. Weekdays at 9:00
- listitem:
- button "Weekly review": Weekly review Your work in the workspace this week, with loose ends and what to do first next week. Fridays at {{clock}}
- listitem:
- button "Issue scan": Issue scan Sort new issues into bugs, requests, and questions, and flag duplicates and ones that need a reply. Weekdays at {{clock}}
- listitem:
- button "Plugin compatibility check": Plugin compatibility check When a new DSH version ships, check whether installed and self-made plugins need changes. Daily at {{clock}}
- listitem:
- button "Topic and paper tracking": Topic and paper tracking Search for news and new arXiv papers on chosen topics and list the key points. Daily at 9:00
- listitem:
- button "Branch and worktree cleanup": Branch and worktree cleanup List local branches and worktrees whose pull requests merged or closed, and delete them after confirmation. Fridays at {{clock}}
- listitem:
- button "Weather and travel": Weather and travel Weather for today and the next three days, with a note when an umbrella or warmer clothes are needed. Daily at 7:30
- listitem:
- button "Weekly workout plan": Weekly workout plan Plan next week's workouts around your goals and training days. Sundays at {{clock}}
@@ -0,0 +1,19 @@
- region "推荐":
- heading "推荐" [level=2]
- list:
- listitem:
- button "每日简报": 每日简报 汇总工作区最近的变化和待跟进的事,列出今天先做什么。 工作日 9:00
- listitem:
- button "每周回顾": 每周回顾 回顾自己这周在工作区做的事,列出没收尾的事和下周先做什么。 周五 {{clock}}
- listitem:
- button "Issue 扫描": Issue 扫描 把新开的 issue 分成 bug、需求、提问,标出重复的和需要回复的。 工作日 {{clock}}
- listitem:
- button "插件兼容检查": 插件兼容检查 DSH 出新版本时,检查已装的插件和自己做的插件要不要改。 每天 {{clock}}
- listitem:
- button "主题和论文追踪": 主题和论文追踪 搜索关注主题的新消息和 arXiv 新论文,各列几条要点。 每天 9:00
- listitem:
- button "分支和 worktree 清理": 分支和 worktree 清理 列出 PR 已合并或关闭的本地分支和 worktree,确认后再删。 周五 {{clock}}
- listitem:
- button "天气和出行": 天气和出行 今天和接下来三天的天气,要带伞或加衣时提一句。 每天 7:30
- listitem:
- button "一周运动计划": 一周运动计划 按目标和每周能练的日子排好下周的运动计划。 周日 {{clock}}
@@ -0,0 +1 @@
- treeitem "Unread Untitled {{age}}"
@@ -0,0 +1,11 @@
- menu:
- menuitem "Pin session"
- menuitem "Rename"
- menuitem "Mark as read"
- menuitem "Fork session"
- separator
- menuitem "Copy Session ID"
- separator
- menuitem "Archive session"
Row state: done
Title font weight: 400
@@ -3,7 +3,7 @@
- navigation:
- button "General"
- button "Models"
- button "Built-in plugins"
- button "Plugins"
- button "Agent presets"
- button "Open configuration file"
- button "Close"
@@ -3,7 +3,7 @@
- navigation:
- button "General"
- button "Models"
- button "Built-in plugins"
- button "Plugins"
- button "Agent presets"
- button "Open configuration file"
- button "Close"
@@ -3,7 +3,7 @@
- navigation:
- button "通用设置"
- button "模型"
- button "内置插件"
- button "插件管理"
- button "Agent 预设"
- button "打开配置文件"
- button "关闭"
@@ -1,16 +0,0 @@
- list:
- listitem:
- button "子智能体控制工具, tool-subagent-control, 已启用":
- strong: 子智能体控制工具
- text: 让 AI 向子智能体发送消息或中断其运行。
- code: tool-subagent-control
- listitem:
- button "子智能体委派工具, tool-subagent, 已启用":
- strong: 子智能体委派工具
- text: 让 AI 将任务交给子智能体,并获取运行结果。
- code: tool-subagent
- listitem:
- button "子智能体委派工具, tool-subagent-fork, 已启用":
- strong: 子智能体委派工具
- text: 让 AI 将任务交给子智能体,并获取运行结果。
- code: tool-subagent-fork
@@ -1,5 +0,0 @@
- listitem:
- button "子智能体委派工具, tool-subagent, 已启用":
- strong: 子智能体委派工具
- text: 让 AI 将任务交给子智能体,并获取运行结果。
- code: tool-subagent
@@ -54,6 +54,9 @@
- listitem:
- button "Edit shortcut for Close current page or window"
- text: Close current page or window ⌥ ⌘ W
- listitem:
- button "Edit shortcut for Toggle read/unread"
- text: Toggle read/unread ⇧ ⌘ U
- region "Message input":
- heading "Message input" [level=3]
- list:
@@ -1,6 +1,7 @@
- menu:
- menuitem "Pin session"
- menuitem "Rename"
- menuitem "Mark as unread"
- menuitem "Fork session"
- separator
- menuitem "Copy Session ID"
@@ -54,6 +54,9 @@
- listitem:
- button "Edit shortcut for Close current page or window"
- text: Close current page or window Ctrl + Alt + W
- listitem:
- button "Edit shortcut for Toggle read/unread"
- text: Toggle read/unread Ctrl + Shift + U
- region "Message input":
- heading "Message input" [level=3]
- list:
@@ -54,6 +54,9 @@
- listitem:
- button "修改关闭当前页面/窗口快捷键"
- text: 关闭当前页面/窗口 ⌥ ⌘ W
- listitem:
- button "修改切换已读/未读快捷键"
- text: 切换已读/未读 ⇧ ⌘ U
- region "消息输入":
- heading "消息输入" [level=3]
- list:
@@ -1,7 +1,6 @@
- banner:
- navigation "Session hierarchy": Delegate a background job.
- button "1 subagent"
- button "1 background job"
- 'button "Session panel Subagents running: 1 Background jobs running: 1"'
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,4 +1,4 @@
- tree "Sessions":
- treeitem "workspace" [expanded]
- treeitem "New Session" [selected]
- treeitem "1 subagent running Delegate a background job. now"
- treeitem "1 subagent running Unread Delegate a background job. now"
@@ -1,6 +1,7 @@
- banner:
- navigation "Session hierarchy": /user-invoke-demo @"meeting notes-this-i
- text: Standard mode
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,6 +1,7 @@
- banner:
- navigation "Session hierarchy": /user-invoke-demo @"meeting notes-this-i
- text: Standard mode
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,5 +1,6 @@
- banner:
- navigation "Session hierarchy": {{workspace}}
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,6 +1,7 @@
- banner:
- navigation "Session hierarchy": Use the ask_user_question tool to
- text: Standard mode
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,6 +1,7 @@
- banner:
- navigation "Session hierarchy": Use the ask_user_question tool to
- text: Standard mode
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -1,6 +1,7 @@
- banner:
- navigation "Session hierarchy": Use the ask_user_question tool to
- text: Standard mode
- button "Session panel"
- button "More actions"
- button "Open right sidebar"
- tablist:
@@ -2,12 +2,12 @@
- tree "Subagent sessions":
- treeitem "historical researcher migration-catalog-child · continuable · not running" [level=1]:
- text: historical researcher migration-catalog-child
- text: historical researcher
- button "Open historical researcher in sidebar"
# After opening the child
- tree "Subagent sessions":
- treeitem "historical editor migration-catalog-grandchild · continuable · not running" [level=1]:
- text: historical editor migration-catalog-grandchild
- text: historical editor
- button "Open historical editor in sidebar"
+2 -1
View File
@@ -12,8 +12,9 @@ import { createLaunchEnvironmentSnapshot, type LaunchEnvironmentSnapshot } from
import { launchWebScaffold, seedSession, watchConsole } from './scaffold.ts'
import { connectFreshWorkspace, saveFailureShot } from './support.ts'
/** Press at the centre of `from`, travel in steps, and release at `to`. */
/** Wait for a stable, hit-tested source, then drag its centre to `to`. */
async function drag(page: Page, from: Locator, to: { x: number; y: number }): Promise<void> {
await from.hover()
const box = await from.boundingBox()
if (box === null) throw new Error('drag source is not rendered')
await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2)
@@ -1,13 +1,18 @@
/** Test package using the published registration protocol, locale and slots. */
window.__ModuleLoader__.load({
id: '@fixture/live-client',
meta() {
return {
stylesheets: {
'style.css': {
text: () => '[data-live-client] { color: rgb(12, 34, 56); position: absolute; bottom: 20px; right: 20px; }',
},
},
}
},
factory(require) {
const React = require('react')
const { IconFolderCloseRegular, IconNewChatOutlineRegular, MenuItemButton } = require('@deepseek-ai/dsh-client-ui-primitives')
const style = document.createElement('style')
style.dataset.plugin = '@fixture/live-client'
style.textContent = '[data-live-client] { color: rgb(12, 34, 56); position: absolute; bottom: 20px; right: 20px; }'
document.head.append(style)
return {
inject: ['slots', 'locale'],
apply(ctx) {
@@ -0,0 +1,16 @@
/** Test package registering its own settings page into `settings.section`. */
window.__ModuleLoader__.load({
id: '@fixture/settings-section',
factory(require) {
const React = require('react')
return {
inject: ['slots'],
apply(ctx) {
ctx.slots.inject('settings.section', () => ctx.slots.register({
name: 'settings.section', id: 'fixture-settings-section', label: 'Fixture settings',
}, () => React.createElement('section', { 'data-fixture-settings-section': '', 'aria-label': 'Fixture settings' },
React.createElement('p', null, 'Settings content from the fixture'))))
},
}
},
})
@@ -0,0 +1,4 @@
# Web e2e fixture bundle whose browser half registers a plugin settings page.
- insert:
- id: fixture-settings-section
name: '@fixture/settings-section'
@@ -0,0 +1,2 @@
/** Host companion for the plugin settings page fixture. */
export function apply() {}
@@ -0,0 +1,12 @@
{
"name": "@fixture/settings-section",
"version": "0.0.1",
"private": true,
"type": "module",
"main": "index.js",
"exports": { ".": "./index.js", "./client": "./client.js" },
"dsh": {
"bundle": { "patch": "./cordis.patch.yml" },
"client": { "platform": "web" }
}
}
Loaded 100 of 3267 files, more files were not shown because too many files have changed in this diff. Show more