feat(session-export): add command and Header action

This commit is contained in:
NI0317
2026-08-12 14:23:06 +08:00
parent 185a1f7da3
commit 8940282aee
114 changed files with 1533 additions and 368 deletions

View File

@@ -283,6 +283,7 @@ describe('web e2e: agent-preset selection', () => {
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 "Session log"'))
// 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"')

View File

@@ -43,6 +43,7 @@ const PLUGINS: readonly (WebBootEntry & { bundlePath: string })[] = [
'@deepseek-ai/dsh-client-ui-sidebar',
],
},
{ id: '@deepseek-ai/dsh-session-export', bundlePath: 'packages/session-query/session-export/lib/client.js', url: '/plugins/session-export.js', rev: 'fx', inject: ['@deepseek-ai/dsh-client-ui-command', '@deepseek-ai/dsh-client-ui-conversation'] },
{ id: '@deepseek-ai/dsh-client-ui-trajectory', bundlePath: 'packages/client/ui-trajectory/lib/client.js', url: '/plugins/ui-trajectory.js', rev: 'fx', inject: ['@deepseek-ai/dsh-client-ui-conversation'] },
]

View File

@@ -283,14 +283,29 @@ describe('web e2e: navigation & panes over a rich seeded session', () => {
await details.getByRole('button', { name: 'Close details' }).click()
}, 60_000)
it.skipIf(MODE === 'record')('downloads the session-log ZIP from the trajectory toolbar', async () => {
it.skipIf(MODE === 'record')('downloads through the Session Header and /export with one dialog', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-navigation-export'))
await ensureSeedOpen(page)
await page.getByRole('tab', { name: 'Trajectory' }).click()
const exportButton = page.getByRole('button', { name: 'Session log' })
expect(await exportButton.isDisabled()).toBe(false)
const header = exportButton.locator('xpath=ancestor::header[1]')
const [buttonBox, headerBox] = await Promise.all([
exportButton.boundingBox(), header.boundingBox(),
])
if (buttonBox === null || headerBox === null) {
throw new Error('Session Header export geometry is unavailable')
}
expect(headerBox.x + headerBox.width - (buttonBox.x + buttonBox.width)).toBeLessThanOrEqual(32)
const responsePromise = page.waitForResponse(response =>
new URL(response.url()).pathname === '/api/session.export', { timeout: 30_000 })
const downloadPromise = page.waitForEvent('download', { timeout: 30_000 })
await page.getByRole('button', { name: 'Export session log' }).click()
await exportButton.click()
const response = await responsePromise
expect(response.status()).toBe(200)
const download = await downloadPromise
expect(download.suggestedFilename()).toMatch(/^dsh-session-.+\.zip$/)
const dialog = page.getByRole('dialog', { name: 'Session download started' })
await dialog.waitFor({ timeout: 30_000 })
// The real host streamed the ZIP; its root entry is the persisted log
// text verbatim (the assembled seam: real route, real persistence read).
const files = unzipSync(await readFile(await download.path()))
@@ -298,6 +313,18 @@ describe('web e2e: navigation & panes over a rich seeded session', () => {
const content = strFromU8(files['session.jsonl'] as Uint8Array)
expect(content.split('\n')[0]).toContain(SEED_ID)
expect(content).toContain('FIRST_DONE')
await dialog.getByText('Close', { exact: true }).click()
const input = page.locator('textarea').first()
const slashDownloadPromise = page.waitForEvent('download', { timeout: 30_000 })
await input.fill('/export')
await page.getByRole('option', { name: /export/u }).waitFor({ timeout: 10_000 })
await input.press('Enter')
const slashDownload = await slashDownloadPromise
expect(slashDownload.suggestedFilename()).toBe(download.suggestedFilename())
await page.getByRole('dialog', { name: 'Session download started' }).waitFor({ timeout: 30_000 })
await page.getByRole('dialog', { name: 'Session download started' })
.getByText('Close', { exact: true }).click()
}, 60_000)
it.skipIf(MODE === 'record')('focuses the ledger by dragging an overview interval', async () => {

View File

@@ -138,13 +138,13 @@ async function detailsTrack(page: Page): Promise<number> {
return Number(cols.split(' ').pop()!.replace('px', ''))
}
// Readiness gate: `dsh web` serves all ten production manifest plugins; until every UI
// Readiness gate: `dsh web` serves every production manifest plugin; until every UI
// plugin's client bundle exists and exports apply, the loader fail-louds and
// the frame never appears.
const UI_PLUGIN_DIRS = [
'connection', 'runtime', 'ui-theme', 'locale', 'ui-layout', 'ui-sidebar',
'ui-settings', 'ui-settings-general', 'ui-models', 'ui-conversation',
'ui-model', 'ui-question', 'ui-trajectory',
'ui-model', 'ui-question', 'ui-trajectory', '../session-query/session-export',
]
const ROUND_DONE_MARKER = 'WEB_ROUND_DONE'
const notReady = UI_PLUGIN_DIRS.filter((dir) => {

View File

@@ -5,3 +5,6 @@
- button "1 subagent":
- text: 1 subagent
- img
- button "Session log":
- text: Session log
- img

View File

@@ -1,6 +1,9 @@
- banner:
- navigation "Session hierarchy":
- 'button "Run two shell commands: wait" [disabled]'
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- 'button "Using ONE run_code program: run" [disabled]'
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "Use only Cordis tools. First" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "Reply with the single word" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "Use the bash tool to" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "workspace" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "workspace" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -1,6 +1,7 @@
- listbox "Trigger suggestions":
- text: Commands
- option "compact Compact older conversation history" [selected]
- option "export Download this Session log as a ZIP archive"
- option "feedback record feedback about this session"
- option "goal set or view the goal for a long-running task"
- option "permission Switch the permission preset (sandbox mode + approval policy)"

View File

@@ -3,6 +3,9 @@
- button "Reply with the single word" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "Reply with a one-sentence description" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "Reply with a one-sentence description" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "Reply with a one-sentence description" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "Reply with a one-sentence description" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -1,6 +1,9 @@
- banner:
- navigation "Session hierarchy":
- button "CJK strong emphasis" [disabled]
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -1,6 +1,9 @@
- banner:
- navigation "Session hierarchy":
- button "Markdown image policy" [disabled]
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -1,6 +1,9 @@
- banner:
- navigation "Session hierarchy":
- button "Inline code links" [disabled]
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -1,6 +1,9 @@
- banner:
- navigation "Session hierarchy":
- button "Math rendering" [disabled]
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -1,6 +1,9 @@
- banner:
- navigation "Session hierarchy":
- button "Use the read tool twice" [disabled]
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -2,7 +2,6 @@
- button "Use actual duration": Duration
- button "Collapse turns": Turns
- button "Collapse calls": Calls
- button "Export session log": Export
- img
- searchbox "Search trajectory"
- region "Trajectory timeline":

View File

@@ -3,6 +3,9 @@
- 'button "Plan a small change: add" [disabled]'
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "Use the ask_user_question tool to" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "Reply with a one-sentence description" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "Reply with a one-sentence description" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "workspace" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "Reply with a one-sentence description" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "Reply with a one-sentence description" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -1,6 +1,9 @@
- banner:
- navigation "Session hierarchy":
- button "Use the read tool twice" [disabled]
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -1,6 +1,9 @@
- banner:
- navigation "Session hierarchy":
- button "Use the read tool twice" [disabled]
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -1,6 +1,9 @@
- banner:
- navigation "Session hierarchy":
- button "Use the read tool twice" [disabled]
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -1,6 +1,9 @@
- banner:
- navigation "Session hierarchy":
- button "Load the snapshot-skill skill with" [disabled]
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "/user-invoke-demo and confirm the fixtur" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "Use the ask_user_question tool to" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "Use the ask_user_question tool to" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "Use the ask_user_question tool to" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "Use the ask_user_question tool to" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -5,6 +5,9 @@
- button "event-sourcing researcher"
- text: /
- button "example editor" [disabled]
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -8,6 +8,9 @@
- button "1 subagent":
- text: 1 subagent
- img
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -5,6 +5,9 @@
- button "event-sourcing researcher" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "Begin your reply with the" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "Begin your reply with the" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"

View File

@@ -3,6 +3,9 @@
- button "Use web_search to search exactly" [disabled]
- img
- text: Standard mode
- button "Session log":
- text: Session log
- img
- tablist:
- tab "Chat" [selected]
- tab "Trajectory"