|
|
@@ -19,6 +19,7 @@ import {
|
|
|
SESSION_FORMAT_VERSION, SessionId as sessionId, type SessionEvent, type SessionHeader, type SessionId,
|
|
|
} from '@deepseek-ai/dsh-session'
|
|
|
import { snapshotSubagentDescriptor } from '@deepseek-ai/dsh-subagent'
|
|
|
+import { createSystemMessage, createUserMessage } from '@deepseek-ai/dsh-llm'
|
|
|
import {
|
|
|
captureStableAria, compareOrRefreshGolden, launchWebScaffold, seedSession, watchConsole,
|
|
|
webSnapshotMode, type WebScaffold,
|
|
|
@@ -81,7 +82,8 @@ async function seedWorkspaceSkill(workspaceCwd: string): Promise<void> {
|
|
|
/**
|
|
|
* A settled one-turn session with no model content: this lane asserts chrome
|
|
|
* around a conversation, not a conversation, and a recorded turn would tie
|
|
|
- * the golden to a provider's wording for no gain.
|
|
|
+ * the golden to a provider's wording for no gain. Its empty system head
|
|
|
+ * belongs to the first step, before the user message.
|
|
|
* @returns a tokenized session log ending on a closed turn.
|
|
|
*/
|
|
|
function seedLog(): string {
|
|
|
@@ -89,9 +91,18 @@ function seedLog(): string {
|
|
|
const at = (index: number, event: Record<string, unknown>): string =>
|
|
|
JSON.stringify({ ...event, seq: index, time: time + index })
|
|
|
return [
|
|
|
- JSON.stringify({ type: 'session', version: 0, id: '{{sessionId}}', createdAt: time, cwd: '{{cwd}}/workspace' }),
|
|
|
+ JSON.stringify({
|
|
|
+ type: 'session', version: SESSION_FORMAT_VERSION, id: '{{sessionId}}',
|
|
|
+ createdAt: time, cwd: '{{cwd}}/workspace', isSeeded: false, delegationDepth: 0,
|
|
|
+ }),
|
|
|
at(0, { type: 'turn/start', data: { turn: 1, trigger: { kind: 'message', source: { kind: 'user', rpcId: 'seed' } } } }),
|
|
|
- at(1, {
|
|
|
+ at(1, { type: 'step/start', data: { turn: 1, step: 1 } }),
|
|
|
+ at(2, {
|
|
|
+ type: 'system/message',
|
|
|
+ data: { turn: 1, step: 1, message: createSystemMessage('', '@deepseek-ai/dsh-system-prompt') },
|
|
|
+ surfaceOp: 'append',
|
|
|
+ }),
|
|
|
+ at(3, {
|
|
|
type: 'user/message',
|
|
|
data: {
|
|
|
id: '00000000-0000-4000-9000-000000000001',
|
|
|
@@ -101,8 +112,9 @@ function seedLog(): string {
|
|
|
},
|
|
|
surfaceOp: 'append',
|
|
|
}),
|
|
|
- at(2, { type: 'session/title', data: { title: 'Seeded turn', messageSeqs: [1], source: { kind: 'fallback' } } }),
|
|
|
- at(3, { type: 'turn/end', data: { turn: 1, reason: { kind: 'completed' } } }),
|
|
|
+ at(4, { type: 'session/title', data: { title: 'Seeded turn', messageSeqs: [3], source: { kind: 'fallback' } } }),
|
|
|
+ at(5, { type: 'step/end', data: { turn: 1, step: 1 } }),
|
|
|
+ at(6, { type: 'turn/end', data: { turn: 1, reason: { kind: 'completed' } } }),
|
|
|
].join('\n')
|
|
|
}
|
|
|
|
|
|
@@ -138,10 +150,10 @@ async function seedSubagent(scaffold: WebScaffold, parentId: SessionId): Promise
|
|
|
type: 'user/message',
|
|
|
seq: 1,
|
|
|
time: createdAt + 1,
|
|
|
- data: {
|
|
|
+ data: createUserMessage({
|
|
|
content: [{ type: 'text', text: 'Check the session-header action order.' }],
|
|
|
source: { kind: 'user' },
|
|
|
- },
|
|
|
+ }),
|
|
|
surfaceOp: 'append',
|
|
|
},
|
|
|
{
|