Merge remote-tracking branch 'origin/master' into worktree/pr743-merge-20260727

# Conflicts:
#	examples/tui-agent/tests/snapshots/cordis-dynamic-toolchain/terminal.expected.txt
#	packages/ui/tui/tests/snapshots/cordis-tools-pending.expected.txt
This commit is contained in:
Tianyi Cui
2026-07-28 00:03:56 +08:00
184 changed files with 8971 additions and 4357 deletions

View File

@@ -1,63 +1,54 @@
terminal 100x36 buffer=normal length=36 base=0 viewport=0
lifecycle started=1 stopped=0 progress=inactive
title "Use the bash tool to — DSH TUI snapshot"
cursor hidden column=1 viewportRow=25 bufferRow=25
cursor hidden column=7 viewportRow=24 bufferRow=24
buffer
0| " DEEPSEEK HARNESS"
style 1-8 fg=bright-blue bold
style 10-16 bold
1| " Use the bash tool to"
style 1-20 fg=bright-black
2| " deepseek-v4-flash • main-session"
style 1-34 dim
2| " main-session"
style 1-12 dim
3| <blank>
4| " "
style 0-0 fg=bright-blue
5| "▌ You "
style 0-0 fg=bright-blue
style 2-4 fg=bright-blue bold
6| "▌ Use the bash tool to run exactly: echo TERMINAL_OK. Then reply with the single word DONE and stop."
style 0-0 fg=bright-blue
7| "▌ "
style 0-0 fg=bright-blue
8| <blank>
9| " Reasoning "
style 1-9 fg=bright-black italic
10| " The user wants me to run a simple bash command and then reply with \"DONE\". "
style 1-74 fg=bright-black italic
11| <blank>
12| " "
style 0-0 fg=green
13| "▌ ✓ echo TERMINAL_OK "
style 0-0 fg=green
style 2-2 fg=green bold
style 3-19 bold
14| "▌ Echo TERMINAL_OK to verify terminal access "
style 0-0 fg=green
style 2-43 fg=bright-black
15| "▌ TERMINAL_OK "
style 0-0 fg=green
16| "▌ [exit 0] "
style 0-0 fg=green
style 2-9 dim
17| "▌ "
style 0-0 fg=green
18| <blank>
19| " Reasoning "
style 1-9 fg=bright-black italic
20| " The command ran successfully and output \"TERMINAL_OK\". I should now reply with just \"DONE\". "
style 1-91 fg=bright-black italic
21| <blank>
22| " Assistant "
style 1-9 fg=bright-magenta bold
23| " DONE "
24| "────────────────────────────────────────────────────────────────────────────────────────────────────"
style 0-99 dim
25| " "
style 1-1 inverse
26| "────────────────────────────────────────────────────────────────────────────────────────────────────"
style 0-99 dim
27| "deepseek-v4-flash /workspace/project ↑3.0k ↓115 cache 48% 3% contex"
style 0-88 dim
style 91-99 dim
28-35| <blank>
4| "You "
style 0-2 fg=bright-blue bold underline
5| "Use the bash tool to run exactly: echo TERMINAL_OK. Then reply with the single word DONE and stop. "
6| <blank>
7| "Assistant "
style 0-8 fg=bright-magenta bold underline
8| "Reasoning "
style 0-8 fg=bright-black italic
9| "The user wants me to run a simple bash command and then reply with \"DONE\". "
style 0-73 fg=bright-black italic
10| <blank>
11| "● Tool / bash / Echo TERMINAL_OK to verify terminal access"
style 0-57 fg=green
12| "$ echo TERMINAL_OK "
style 0-17 fg=cyan
13| "TERMINAL_OK "
14| "[exit 0] "
style 0-7 dim
15| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
16| <blank>
17| "Assistant "
style 0-8 fg=bright-magenta bold underline
18| "Reasoning "
style 0-8 fg=bright-black italic
19| "The command ran successfully and output \"TERMINAL_OK\". I should now reply with just \"DONE\". "
style 0-90 fg=bright-black italic
20| "DONE "
21| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
22| <blank>
23| "/workspace/project deepseek-v4-flash ↑3.0k ↓115 cache 48% 3% contex"
style 0-46 fg=bright-blue bold
style 49-65 fg=bright-black
style 68-88 fg=bright-black
style 91-99 fg=bright-black
24| " dsh ◍ "
style 1-3 fg=bright-blue bold
style 5-6 fg=bright-black
style 7-7 inverse
25-35| <blank>

View File

@@ -1,65 +1,57 @@
terminal 100x36 buffer=normal length=36 base=0 viewport=0
lifecycle started=1 stopped=0 progress=inactive
title "Using ONE run_code program: call — DSH TUI snapshot"
cursor hidden column=1 viewportRow=26 bufferRow=26
cursor hidden column=7 viewportRow=26 bufferRow=26
buffer
0| " DEEPSEEK HARNESS"
style 1-8 fg=bright-blue bold
style 10-16 bold
1| " Using ONE run_code program: call"
style 1-32 fg=bright-black
2| " deepseek-v4-flash • main-session"
style 1-34 dim
2| " main-session"
style 1-12 dim
3| <blank>
4| " "
style 0-0 fg=bright-blue
5| "▌ You "
style 0-0 fg=bright-blue
style 2-4 fg=bright-blue bold
6| "▌ Using ONE run_code program: call the bash tool exactly once with the command seq 1 200 | awk "
style 0-0 fg=bright-blue
style 79-99 fg=cyan
7| "▌ '{printf \"line %04d: the quick brown fox jumps over the lazy dog\\n\", $1}', then return ONLY the "
style 0-0 fg=bright-blue
style 2-74 fg=cyan
8| "▌ number of lines in its output. Reply with just that number and stop. "
style 0-0 fg=bright-blue
9| "▌ "
style 0-0 fg=bright-blue
10| <blank>
11| " Reasoning "
style 1-9 fg=bright-black italic
12| " The user wants me to write a single run_code program that calls bash exactly once with a specific "
style 1-99 fg=bright-black italic
13| " command, then returns only the number of lines in its output. "
style 1-61 fg=bright-black italic
14| <blank>
15| "▌ "
style 0-0 fg=green
16| "▌ ✓ Count lines in seq/awk output "
style 0-0 fg=green
style 2-2 fg=green bold
style 3-32 bold
17| "▌ 200 "
style 0-0 fg=green
18| " "
style 0-0 fg=green
19| <blank>
20| " Reasoning "
style 1-9 fg=bright-black italic
21| " The result is 200 lines. The user wants me to reply with just that number and stop. "
style 1-83 fg=bright-black italic
22| <blank>
23| " Assistant "
style 1-9 fg=bright-magenta bold
24| " 200 "
25| "────────────────────────────────────────────────────────────────────────────────────────────────────"
style 0-99 dim
26| " "
style 1-1 inverse
27| "────────────────────────────────────────────────────────────────────────────────────────────────────"
style 0-99 dim
28| "deepseek-v4-flash /workspace/project ↑123 ↓208 cache 99% 3% c"
style 0-93 dim
style 96-99 dim
29-35| <blank>
4| "You "
style 0-2 fg=bright-blue bold underline
5| "Using ONE run_code program: call the bash tool exactly once with the command seq 1 200 | awk "
style 77-99 fg=cyan
6| "'{printf \"line %04d: the quick brown fox jumps over the lazy dog\\n\", $1}', then return ONLY the "
style 0-72 fg=cyan
7| "number of lines in its output. Reply with just that number and stop. "
8| <blank>
9| "Assistant "
style 0-8 fg=bright-magenta bold underline
10| "Reasoning "
style 0-8 fg=bright-black italic
11| "The user wants me to write a single run_code program that calls bash exactly once with a specific "
style 0-99 fg=bright-black italic
12| "command, then returns only the number of lines in its output. "
style 0-60 fg=bright-black italic
13| <blank>
14| "● Tool / run_code"
style 0-16 fg=green
15| "Count lines in seq/awk output "
16| "200 "
17| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
18| <blank>
19| "Assistant "
style 0-8 fg=bright-magenta bold underline
20| "Reasoning "
style 0-8 fg=bright-black italic
21| "The result is 200 lines. The user wants me to reply with just that number and stop. "
style 0-82 fg=bright-black italic
22| "200 "
23| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
24| <blank>
25| "/workspace/project deepseek-v4-flash ↑123 ↓208 cache 99% 3% c"
style 0-52 fg=bright-blue bold
style 55-71 fg=bright-black
style 74-93 fg=bright-black
style 96-99 fg=bright-black
26| " dsh ◍ "
style 1-3 fg=bright-blue bold
style 5-6 fg=bright-black
style 7-7 inverse
27-35| <blank>

View File

@@ -1,136 +1,140 @@
terminal 100x36 buffer=normal length=64 base=28 viewport=28
terminal 100x36 buffer=normal length=62 base=26 viewport=26
lifecycle started=1 stopped=0 progress=inactive
title "Using ONE run_code program: call — DSH TUI snapshot"
cursor hidden column=1 viewportRow=33 bufferRow=61
cursor hidden column=7 viewportRow=35 bufferRow=61
buffer
0| " DEEPSEEK HARNESS"
style 1-8 fg=bright-blue bold
style 10-16 bold
1| " Using ONE run_code program: call"
style 1-32 fg=bright-black
2| " deepseek-v4-flash • main-session"
style 1-34 dim
2| " main-session"
style 1-12 dim
3| <blank>
4| " "
style 0-0 fg=bright-blue
5| "▌ You "
style 0-0 fg=bright-blue
style 2-4 fg=bright-blue bold
6| "▌ Using ONE run_code program: call the bash tool twice — exactly echo CODE_ONE then exactly echo "
style 0-0 fg=bright-blue
style 65-77 fg=cyan
style 92-99 fg=cyan
7| "▌ CODE_TWO. Inside that same program, console.log exactly captured output, then return the two "
style 0-0 fg=bright-blue
style 2-9 fg=cyan
style 58-72 fg=cyan
8| "▌ outputs joined with a plus sign. Reply with that joined string only and stop. "
style 0-0 fg=bright-blue
9| "▌ "
style 0-0 fg=bright-blue
10| <blank>
11| " Reasoning "
style 1-9 fg=bright-black italic
12| " The user wants me to write a single run_code program that: "
style 1-36 fg=bright-black italic
style 37-44 fg=cyan
style 45-58 fg=bright-black italic
13| " 1. Calls bash tool twice - first with echo CODE_ONE, then with echo CODE_TWO "
style 1-3 fg=bright-blue
style 4-9 fg=bright-black italic
style 10-13 fg=cyan
style 14-38 fg=bright-black italic
style 39-51 fg=cyan
style 52-63 fg=bright-black italic
style 64-76 fg=cyan
14| " 2. console.log exactly captured output "
style 1-3 fg=bright-blue
style 4-14 fg=cyan
style 15-23 fg=bright-black italic
style 24-38 fg=cyan
15| " 3. Returns the two outputs joined with a plus sign "
style 1-3 fg=bright-blue
style 4-50 fg=bright-black italic
16| " "
17| " Let me think about the structure. The bash tool returns an object with stdout/stderr. I need to "
style 1-38 fg=bright-black italic
style 39-42 fg=cyan
style 43-99 fg=bright-black italic
18| " extract the stdout text from each call. "
style 1-39 fg=bright-black italic
19| " "
20| " Looking at the bash output type: "
style 1-32 fg=bright-black italic
4| "You "
style 0-2 fg=bright-blue bold underline
5| "Using ONE run_code program: call the bash tool twice — exactly echo CODE_ONE then exactly echo "
style 63-75 fg=cyan
style 90-99 fg=cyan
6| "CODE_TWO. Inside that same program, console.log exactly captured output, then return the two outputs"
style 0-7 fg=cyan
style 56-70 fg=cyan
7| "joined with a plus sign. Reply with that joined string only and stop. "
8| <blank>
9| "Assistant "
style 0-8 fg=bright-magenta bold underline
10| "Reasoning "
style 0-8 fg=bright-black italic
11| "The user wants me to write a single run_code program that: "
style 0-35 fg=bright-black italic
style 36-43 fg=cyan
style 44-57 fg=bright-black italic
12| "1. Calls bash tool twice - first with echo CODE_ONE, then with echo CODE_TWO "
style 0-2 fg=bright-blue
style 3-8 fg=bright-black italic
style 9-12 fg=cyan
style 13-37 fg=bright-black italic
style 38-50 fg=cyan
style 51-62 fg=bright-black italic
style 63-75 fg=cyan
13| "2. console.log exactly captured output "
style 0-2 fg=bright-blue
style 3-13 fg=cyan
style 14-22 fg=bright-black italic
style 23-37 fg=cyan
14| "3. Returns the two outputs joined with a plus sign "
style 0-2 fg=bright-blue
style 3-49 fg=bright-black italic
15| " "
16| "Let me think about the structure. The bash tool returns an object with stdout/stderr. I need to "
style 0-37 fg=bright-black italic
style 38-41 fg=cyan
style 42-99 fg=bright-black italic
17| "extract the stdout text from each call. "
style 0-38 fg=bright-black italic
18| " "
19| "Looking at the bash output type: "
style 0-31 fg=bright-black italic
20| " "
21| " "
22| " ``` "
style 1-3 dim
23| " { "
24| " kind: \"foreground\"; "
25| " exitCode: number | null; "
26| " signal: string | null; "
27| " timedOut: boolean; "
28| " aborted: boolean; "
29| " timeoutMs: number; "
30| " stdout: { "
31| " text: string; "
32| " truncated: boolean; "
33| " spillPath?: string; "
34| " }; "
35| " stderr: { ... }; "
36| " sandbox?: { ... }; "
37| " } "
38| " ``` "
style 1-3 dim
39| " "
40| " So I need to access .stdout.text from each result. "
style 1-20 fg=bright-black italic
style 21-32 fg=cyan
style 33-50 fg=bright-black italic
41| " "
42| " Let me write the program. "
style 1-25 fg=bright-black italic
43| <blank>
44| " "
style 0-0 fg=green
45| "▌ ✓ Call bash twice, log, join outputs "
style 0-0 fg=green
style 2-2 fg=green bold
style 3-37 bold
46| "▌ captured output "
style 0-0 fg=green
47| "▌ CODE_ONE+CODE_TWO "
style 0-0 fg=green
48| "▌ "
style 0-0 fg=green
49| <blank>
50| " Reasoning "
style 1-9 fg=bright-black italic
51| " The program ran successfully. The output shows: "
style 1-47 fg=bright-black italic
52| " - captured output (from console.log) "
style 1-2 fg=bright-blue
style 3-17 fg=cyan
style 18-36 fg=bright-black italic
53| " - CODE_ONE+CODE_TWO (the returned joined string) "
style 1-2 fg=bright-blue
style 3-19 fg=cyan
style 20-48 fg=bright-black italic
22| " { "
style 2-2 fg=cyan
23| " kind: \"foreground\"; "
style 2-22 fg=cyan
24| " exitCode: number | null; "
style 2-27 fg=cyan
25| " signal: string | null; "
style 2-25 fg=cyan
26| " timedOut: boolean; "
style 2-21 fg=cyan
27| " aborted: boolean; "
style 2-20 fg=cyan
28| " timeoutMs: number; "
style 2-21 fg=cyan
29| " stdout: { "
style 2-12 fg=cyan
30| " text: string; "
style 2-18 fg=cyan
31| " truncated: boolean; "
style 2-24 fg=cyan
32| " spillPath?: string; "
style 2-24 fg=cyan
33| " }; "
style 2-5 fg=cyan
34| " stderr: { ... }; "
style 2-19 fg=cyan
35| " sandbox?: { ... }; "
style 2-21 fg=cyan
36| " } "
style 2-2 fg=cyan
37| " "
38| " "
39| "So I need to access .stdout.text from each result. "
style 0-19 fg=bright-black italic
style 20-31 fg=cyan
style 32-49 fg=bright-black italic
40| " "
41| "Let me write the program. "
style 0-24 fg=bright-black italic
42| <blank>
43| "● Tool / run_code"
style 0-16 fg=green
44| "Call bash twice, log, join outputs "
45| "captured output "
46| "CODE_ONE+CODE_TWO "
47| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
48| <blank>
49| "Assistant "
style 0-8 fg=bright-magenta bold underline
50| "Reasoning "
style 0-8 fg=bright-black italic
51| "The program ran successfully. The output shows: "
style 0-46 fg=bright-black italic
52| "- captured output (from console.log) "
style 0-1 fg=bright-blue
style 2-16 fg=cyan
style 17-35 fg=bright-black italic
53| "- CODE_ONE+CODE_TWO (the returned joined string) "
style 0-1 fg=bright-blue
style 2-18 fg=cyan
style 19-47 fg=bright-black italic
54| " "
55| " The user asked me to reply with that joined string only and stop. So I'll reply with just "
style 1-99 fg=bright-black italic
56| " CODE_ONE+CODE_TWO. "
style 1-17 fg=cyan
style 18-18 fg=bright-black italic
57| <blank>
58| " Assistant "
style 1-9 fg=bright-magenta bold
59| " CODE_ONE+CODE_TWO "
60| "────────────────────────────────────────────────────────────────────────────────────────────────────"
style 0-99 dim
61| " "
style 1-1 inverse
62| "────────────────────────────────────────────────────────────────────────────────────────────────────"
style 0-99 dim
63| "deepseek-v4-flash /workspace/project ↑182 ↓446 cache 98% 4% context tools:c"
style 0-78 dim
style 81-99 dim
55| "The user asked me to reply with that joined string only and stop. So I'll reply with just "
style 0-99 fg=bright-black italic
56| "CODE_ONE+CODE_TWO. "
style 0-16 fg=cyan
style 17-17 fg=bright-black italic
57| "CODE_ONE+CODE_TWO "
58| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
59| <blank>
60| "/workspace/project deepseek-v4-flash ↑182 ↓446 cache 98% 4% context"
style 0-37 fg=bright-blue bold
style 40-56 fg=bright-black
style 59-78 fg=bright-black
style 81-90 fg=bright-black
61| " dsh ◍ "
style 1-3 fg=bright-blue bold
style 5-6 fg=bright-black
style 7-7 inverse

View File

@@ -1,110 +1,95 @@
terminal 100x36 buffer=normal length=50 base=14 viewport=14
terminal 100x36 buffer=normal length=59 base=23 viewport=23
lifecycle started=1 stopped=0 progress=inactive
title "Run this advanced flow exactly — DSH TUI snapshot"
cursor hidden column=1 viewportRow=33 bufferRow=47
cursor hidden column=7 viewportRow=35 bufferRow=58
buffer
0| " DEEPSEEK HARNESS"
style 1-8 fg=bright-blue bold
style 10-16 bold
1| " Run this advanced flow exactly"
style 1-30 fg=bright-black
2| " deepseek-v4-flash • main-session"
style 1-34 dim
2| " main-session"
style 1-12 dim
3| <blank>
4| " "
style 0-0 fg=bright-blue
5| "▌ You "
style 0-0 fg=bright-blue
style 2-4 fg=bright-blue bold
6| "▌ Run this advanced flow exactly once: try a no-op temporary Cordis Plugin named snapshot-marker; "
style 0-0 fg=bright-blue
7| "▌ use run_code to inspect the live temporary Plugins through tools.cordis_inspect; delegate once to "
style 0-0 fg=bright-blue
8| "▌ a direct spawn child; run one workflow that delegates to another spawn child; stop dyn-1; then "
style 0-0 fg=bright-blue
9| "▌ reply with exactly ADVANCED_ACP_OK. "
style 0-0 fg=bright-blue
10| "▌ "
style 0-0 fg=bright-blue
4| "You "
style 0-2 fg=bright-blue bold underline
5| "Run this advanced flow exactly once: try a no-op temporary Cordis Plugin named snapshot-marker; use "
6| "run_code to inspect the live temporary Plugins through tools.cordis_inspect; delegate once to a "
7| "direct spawn child; run one workflow that delegates to another spawn child; stop dyn-1; then reply "
8| "with exactly ADVANCED_ACP_OK. "
9| <blank>
10| "Assistant "
style 0-8 fg=bright-magenta bold underline
11| <blank>
12| ""
style 0-0 fg=green
13| "▌ ✓ Mount temporary Cordis Plugin "
style 0-0 fg=green
style 2-2 fg=green bold
style 3-32 bold
14| "▌ Temporary Plugin dyn-1 is running (plugin \"snapshot-marker\"; available until unmounted or DSH "
style 0-0 fg=green
15| "▌ restarts). "
style 0-0 fg=green
16| "▌ "
style 0-0 fg=green
12| "● Tool / cordis_mount"
style 0-20 fg=green
13| "Mount temporary Cordis Plugin "
14| "Temporary Plugin dyn-1 is running (plugin \"snapshot-marker\"; available until unmounted or DSH "
15| "restarts). "
16| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
17| <blank>
18| " "
style 0-0 fg=green
19| "▌ ✓ Verify the temporary marker Plugin "
style 0-0 fg=green
style 2-2 fg=green bold
style 3-37 bold
20| "▌ ## Temporary Plugins "
style 0-0 fg=green
21| "▌ - Temporary Plugin dyn-1: snapshot-marker [running] — provides: none; waiting for: none; lifetime:"
style 0-0 fg=green
22| "▌ until unmounted or DSH restarts "
style 0-0 fg=green
23| " "
style 0-0 fg=green
24| <blank>
25| "▌ "
style 0-0 fg=green
26| "▌ ✓ subagent "
style 0-0 fg=green
style 2-2 fg=green bold
style 3-11 bold
27| "DIRECT_CHILD_OK "
style 0-0 fg=green
28| "▌ "
style 0-0 fg=green
29| <blank>
30| "▌ "
style 0-0 fg=green
31| "▌ ✓ workflow: advanced-acp-snapshot "
style 0-0 fg=green
style 2-2 fg=green bold
style 3-34 bold
32| "▌ workflow \"advanced-acp-snapshot\" completed (1 agent). "
style 0-0 fg=green
33| "▌ Return value: "
style 0-0 fg=green
34| "▌ { "
style 0-0 fg=green
35| "▌ \"reply\": \"WORKFLOW_CHILD_OK\" "
style 0-0 fg=green
36| "▌ } "
style 0-0 fg=green
37| ""
style 0-0 fg=green
38| <blank>
39| " "
style 0-0 fg=green
40| "▌ ✓ Unmount temporary Cordis Plugin dyn-1 "
style 0-0 fg=green
style 2-2 fg=green bold
style 3-40 bold
41| "▌ Temporary Plugin dyn-1 was unmounted and removed. "
style 0-0 fg=green
42| "▌ "
style 0-0 fg=green
43| <blank>
44| " Assistant "
style 1-9 fg=bright-magenta bold
45| " ADVANCED_ACP_OK "
46| "────────────────────────────────────────────────────────────────────────────────────────────────────"
style 0-99 dim
47| " "
style 1-1 inverse
48| "────────────────────────────────────────────────────────────────────────────────────────────────────"
style 0-99 dim
49| "deepseek-v4-flash /workspace/project ↑18 ↓18 cache 0% 8% cont"
style 0-90 dim
style 93-99 dim
18| "Assistant "
style 0-8 fg=bright-magenta bold underline
19| <blank>
20| "● Tool / run_code"
style 0-16 fg=green
21| "Verify the temporary marker Plugin "
22| " "
23| "Temporary Plugins "
style 0-16 fg=bright-blue bold
24| " "
25| "- Temporary Plugin dyn-1: snapshot-marker [running] — provides: none; waiting for: none; lifetime: "
style 0-1 fg=bright-blue
26| " until unmounted or DSH restarts "
27| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
28| <blank>
29| "Assistant "
style 0-8 fg=bright-magenta bold underline
30| <blank>
31| "● Tool / subagent"
style 0-16 fg=green
32| "DIRECT_CHILD_OK "
33| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
34| <blank>
35| "Assistant "
style 0-8 fg=bright-magenta bold underline
36| <blank>
37| "● Tool / workflow"
style 0-16 fg=green
38| "workflow: advanced-acp-snapshot "
39| "workflow \"advanced-acp-snapshot\" completed (1 agent). "
40| "Return value: "
41| "{ "
42| " \"reply\": \"WORKFLOW_CHILD_OK\" "
43| "} "
44| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
45| <blank>
46| "Assistant "
style 0-8 fg=bright-magenta bold underline
47| <blank>
48| "● Tool / cordis_unmount"
style 0-22 fg=green
49| "Unmount temporary Cordis Plugin dyn-1 "
50| "Temporary Plugin dyn-1 was unmounted and removed. "
51| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
52| <blank>
53| "Assistant "
style 0-8 fg=bright-magenta bold underline
54| "ADVANCED_ACP_OK "
55| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
56| <blank>
57| "/workspace/project deepseek-v4-flash ↑18 ↓18 cache 0% 8% cont"
style 0-52 fg=bright-blue bold
style 55-71 fg=bright-black
style 74-90 fg=bright-black
style 93-99 fg=bright-black
58| " dsh ◍ "
style 1-3 fg=bright-blue bold
style 5-6 fg=bright-black
style 7-7 inverse

View File

@@ -1,96 +1,80 @@
terminal 100x36 buffer=normal length=45 base=9 viewport=9
terminal 100x36 buffer=normal length=43 base=7 viewport=7
lifecycle started=1 stopped=0 progress=inactive
title "Use the workflow tool exactly — DSH TUI snapshot"
cursor hidden column=1 viewportRow=33 bufferRow=42
cursor hidden column=7 viewportRow=35 bufferRow=42
buffer
0| " DEEPSEEK HARNESS"
style 1-8 fg=bright-blue bold
style 10-16 bold
1| " Use the workflow tool exactly"
style 1-29 fg=bright-black
2| " deepseek-v4-flash • main-session"
style 1-34 dim
2| " main-session"
style 1-12 dim
3| <blank>
4| " "
style 0-0 fg=bright-blue
5| "▌ You "
style 0-0 fg=bright-blue
style 2-4 fg=bright-blue bold
6| "▌ Use the workflow tool exactly once, with args omitted, meta set to { \"name\": \"snapshot-flow\", "
style 0-0 fg=bright-blue
7| "▌ \"description\": \"one child for the snapshot\" }, and this EXACT script body (copy it verbatim): "
style 0-0 fg=bright-blue
8| "▌ phase('Run') "
style 0-0 fg=bright-blue
9| "▌ const reply = await agent('Reply with exactly the word WF_CHILD_OK and nothing else.') "
style 0-0 fg=bright-blue
10| "▌ return { reply } "
style 0-0 fg=bright-blue
11| "▌ After the workflow returns, reply with the single word WORKFLOW_DONE and stop. Do not use any "
style 0-0 fg=bright-blue
12| "▌ other tool. "
style 0-0 fg=bright-blue
13| " "
style 0-0 fg=bright-blue
14| <blank>
15| " Reasoning "
style 1-9 fg=bright-black italic
16| " The user wants me to use the workflow tool exactly once with specific parameters. Let me carefully "
style 1-99 fg=bright-black italic
17| " follow the instructions: "
style 1-24 fg=bright-black italic
18| " "
19| " 1. args omitted (so I don't include it) "
style 1-3 fg=bright-blue
style 4-39 fg=bright-black italic
20| " 2. meta = { \"name\": \"snapshot-flow\", \"description\": \"one child for the snapshot\" } "
style 1-3 fg=bright-blue
style 4-82 fg=bright-black italic
21| " 3. script = as given verbatim "
style 1-3 fg=bright-blue
style 4-29 fg=bright-black italic
22| " 4. After it returns, reply with \"WORKFLOW_DONE\" "
style 1-3 fg=bright-blue
style 4-47 fg=bright-black italic
23| " "
24| " Let me do exactly that. "
style 1-23 fg=bright-black italic
25| <blank>
26| "▌ "
style 0-0 fg=green
27| "▌ ✓ workflow: snapshot-flow "
style 0-0 fg=green
style 2-2 fg=green bold
style 3-26 bold
28| "▌ workflow \"snapshot-flow\" completed (1 agent). "
style 0-0 fg=green
29| "▌ Return value: "
style 0-0 fg=green
30| "▌ { "
style 0-0 fg=green
31| "▌ \"reply\": \"WF_CHILD_OK\" "
style 0-0 fg=green
32| "▌ } "
style 0-0 fg=green
33| "▌ "
style 0-0 fg=green
34| <blank>
35| " Reasoning "
style 1-9 fg=bright-black italic
36| " The workflow returned successfully with the reply \"WF_CHILD_OK\". Now I need to reply with exactly "
style 1-99 fg=bright-black italic
37| " \"WORKFLOW_DONE\" and stop. "
style 1-25 fg=bright-black italic
38| <blank>
39| " Assistant "
style 1-9 fg=bright-magenta bold
40| " WORKFLOW_DONE "
41| "────────────────────────────────────────────────────────────────────────────────────────────────────"
style 0-99 dim
42| " "
style 1-1 inverse
43| "────────────────────────────────────────────────────────────────────────────────────────────────────"
style 0-99 dim
44| "deepseek-v4-flash /workspace/project ↑3.5k ↓227 cache 47% 3% context "
style 0-86 dim
style 89-99 dim
4| "You "
style 0-2 fg=bright-blue bold underline
5| "Use the workflow tool exactly once, with args omitted, meta set to { \"name\": \"snapshot-flow\", "
6| "\"description\": \"one child for the snapshot\" }, and this EXACT script body (copy it verbatim): "
7| "phase('Run') "
8| "const reply = await agent('Reply with exactly the word WF_CHILD_OK and nothing else.') "
9| "return { reply } "
10| "After the workflow returns, reply with the single word WORKFLOW_DONE and stop. Do not use any other "
11| "tool. "
12| <blank>
13| "Assistant "
style 0-8 fg=bright-magenta bold underline
14| "Reasoning "
style 0-8 fg=bright-black italic
15| "The user wants me to use the workflow tool exactly once with specific parameters. Let me carefully "
style 0-99 fg=bright-black italic
16| "follow the instructions: "
style 0-23 fg=bright-black italic
17| " "
18| "1. args omitted (so I don't include it) "
style 0-2 fg=bright-blue
style 3-38 fg=bright-black italic
19| "2. meta = { \"name\": \"snapshot-flow\", \"description\": \"one child for the snapshot\" } "
style 0-2 fg=bright-blue
style 3-81 fg=bright-black italic
20| "3. script = as given verbatim "
style 0-2 fg=bright-blue
style 3-28 fg=bright-black italic
21| "4. After it returns, reply with \"WORKFLOW_DONE\" "
style 0-2 fg=bright-blue
style 3-46 fg=bright-black italic
22| " "
23| "Let me do exactly that. "
style 0-22 fg=bright-black italic
24| <blank>
25| "● Tool / workflow"
style 0-16 fg=green
26| "workflow: snapshot-flow "
27| "workflow \"snapshot-flow\" completed (1 agent). "
28| "Return value: "
29| "{ "
30| " \"reply\": \"WF_CHILD_OK\" "
31| "} "
32| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
33| <blank>
34| "Assistant "
style 0-8 fg=bright-magenta bold underline
35| "Reasoning "
style 0-8 fg=bright-black italic
36| "The workflow returned successfully with the reply \"WF_CHILD_OK\". Now I need to reply with exactly "
style 0-99 fg=bright-black italic
37| "\"WORKFLOW_DONE\" and stop. "
style 0-24 fg=bright-black italic
38| "WORKFLOW_DONE "
39| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
40| <blank>
41| "/workspace/project deepseek-v4-flash ↑3.5k ↓227 cache 47% 3% context"
style 0-44 fg=bright-blue bold
style 47-63 fg=bright-black
style 66-86 fg=bright-black
style 89-98 fg=bright-black
42| " dsh ◍ "
style 1-3 fg=bright-blue bold
style 5-6 fg=bright-black
style 7-7 inverse

View File

@@ -1,70 +1,62 @@
terminal 100x36 buffer=normal length=36 base=0 viewport=0
lifecycle started=1 stopped=0 progress=inactive
title "Reply with exactly the word: — DSH TUI snapshot"
cursor hidden column=1 viewportRow=33 bufferRow=33
cursor hidden column=7 viewportRow=30 bufferRow=30
buffer
0| " DEEPSEEK HARNESS"
style 1-8 fg=bright-blue bold
style 10-16 bold
1| " Reply with exactly the word:"
style 1-28 fg=bright-black
2| " deepseek-v4-flash • main-session"
style 1-34 dim
2| " main-session"
style 1-12 dim
3| <blank>
4| " "
style 0-0 fg=bright-blue
5| "▌ You "
style 0-0 fg=bright-blue
style 2-4 fg=bright-blue bold
6| "▌ Reply with exactly the word: ONE. No tools. "
style 0-0 fg=bright-blue
7| "▌ "
style 0-0 fg=bright-blue
4| "You "
style 0-2 fg=bright-blue bold underline
5| "Reply with exactly the word: ONE. No tools. "
6| <blank>
7| "Entering plan mode (applies from the next step). Use /plan off to leave. "
style 0-71 fg=bright-black
8| <blank>
9| " Entering plan mode (applies from the next step). Use /plan off to leave. "
style 1-72 fg=bright-black
10| <blank>
11| " Reasoning "
style 1-9 fg=bright-black italic
12| " The user wants me to reply with exactly the word \"ONE\" and use no tools. "
style 1-72 fg=bright-black italic
13| <blank>
14| " Assistant "
style 1-9 fg=bright-magenta bold
15| " ONE "
9| "Assistant "
style 0-8 fg=bright-magenta bold underline
10| "Reasoning "
style 0-8 fg=bright-black italic
11| "The user wants me to reply with exactly the word \"ONE\" and use no tools. "
style 0-71 fg=bright-black italic
12| "ONE "
13| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
14| <blank>
15| "Leaving plan mode (applies from the next step). "
style 0-46 fg=bright-black
16| <blank>
17| " Leaving plan mode (applies from the next step). "
style 1-47 fg=bright-black
18| <blank>
19| "▌ "
style 0-0 fg=bright-blue
20| "▌ You "
style 0-0 fg=bright-blue
style 2-4 fg=bright-blue bold
21| "▌ Reply with exactly the word: TWO. No tools. "
style 0-0 fg=bright-blue
22| "▌ "
style 0-0 fg=bright-blue
23| <blank>
24| " Context · plan-mode "
style 1-19 dim
25| " The user switched this session back to the default mode. "
style 1-56 fg=bright-black
26| <blank>
27| " Reasoning "
style 1-9 fg=bright-black italic
28| " The user wants me to reply with exactly the word \"TWO\" and no tools. "
style 1-68 fg=bright-black italic
29| <blank>
30| " Assistant "
style 1-9 fg=bright-magenta bold
31| " TWO "
32| "────────────────────────────────────────────────────────────────────────────────────────────────────"
style 0-99 dim
33| " "
style 1-1 inverse
34| "────────────────────────────────────────────────────────────────────────────────────────────────────"
style 0-99 dim
35| "deepseek-v4-flash /workspace/project ↑2.9k ↓41 cache 49% 3% co"
style 0-92 dim
style 95-99 dim
17| "You "
style 0-2 fg=bright-blue bold underline
18| "Reply with exactly the word: TWO. No tools. "
19| <blank>
20| "Context · plan-mode "
style 0-18 dim
21| "The user switched this session back to the default mode. "
style 0-55 fg=bright-black
22| <blank>
23| "Assistant "
style 0-8 fg=bright-magenta bold underline
24| "Reasoning "
style 0-8 fg=bright-black italic
25| "The user wants me to reply with exactly the word \"TWO\" and no tools. "
style 0-67 fg=bright-black italic
26| "TWO "
27| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
28| <blank>
29| "/workspace/project deepseek-v4-flash ↑2.9k ↓41 cache 49% 3% co"
style 0-51 fg=bright-blue bold
style 54-70 fg=bright-black
style 73-92 fg=bright-black
style 95-99 fg=bright-black
30| " dsh ◍ "
style 1-3 fg=bright-blue bold
style 5-6 fg=bright-black
style 7-7 inverse
31-35| <blank>

View File

@@ -1,81 +1,52 @@
terminal 100x36 buffer=normal length=37 base=1 viewport=1
terminal 100x36 buffer=normal length=36 base=0 viewport=0
lifecycle started=1 stopped=0 progress=inactive
title "Use the read tool twice — DSH TUI snapshot"
cursor hidden column=1 viewportRow=33 bufferRow=34
cursor hidden column=7 viewportRow=27 bufferRow=27
buffer
0| " DEEPSEEK HARNESS"
style 1-8 fg=bright-blue bold
style 10-16 bold
1| " Use the read tool twice"
style 1-23 fg=bright-black
2| " deepseek-v4-flash • main-session"
style 1-34 dim
2| " main-session"
style 1-12 dim
3| <blank>
4| " "
style 0-0 fg=bright-blue
5| "▌ You "
style 0-0 fg=bright-blue
style 2-4 fg=bright-blue bold
6| "▌ Use the read tool twice in the same assistant message: read a.txt and b.txt. Then reply DONE. "
style 0-0 fg=bright-blue
7| "▌ "
style 0-0 fg=bright-blue
4| "You "
style 0-2 fg=bright-blue bold underline
5| "Use the read tool twice in the same assistant message: read a.txt and b.txt. Then reply DONE. "
6| <blank>
7| "Assistant "
style 0-8 fg=bright-magenta bold underline
8| <blank>
9| ""
style 0-0 fg=green
10| "▌ ✓ Read a.txt "
style 0-0 fg=green
style 2-2 fg=green bold
style 3-13 bold
11| "▌ <path>/workspace/project/a.txt</path> "
style 0-0 fg=green
12| "▌ <type>file</type> "
style 0-0 fg=green
13| "▌ <content> "
style 0-0 fg=green
14| "▌ 1: alpha "
style 0-0 fg=green
15| "▌ "
style 0-0 fg=green
16| "▌ (End of file - total 1 lines) "
style 0-0 fg=green
17| "▌ </content> "
style 0-0 fg=green
18| "▌ "
style 0-0 fg=green
19| <blank>
20| "▌ "
style 0-0 fg=green
21| "▌ ✓ Read b.txt "
style 0-0 fg=green
style 2-2 fg=green bold
style 3-13 bold
22| "▌ <path>/workspace/project/b.txt</path> "
style 0-0 fg=green
23| "▌ <type>file</type> "
style 0-0 fg=green
24| "▌ <content> "
style 0-0 fg=green
25| "▌ 1: beta "
style 0-0 fg=green
26| "▌ "
style 0-0 fg=green
27| "▌ (End of file - total 1 lines) "
style 0-0 fg=green
28| "▌ </content> "
style 0-0 fg=green
29| "▌ "
style 0-0 fg=green
30| <blank>
31| " Assistant "
style 1-9 fg=bright-magenta bold
32| " DONE "
33| "────────────────────────────────────────────────────────────────────────────────────────────────────"
style 0-99 dim
34| " "
style 1-1 inverse
35| "────────────────────────────────────────────────────────────────────────────────────────────────────"
style 0-99 dim
36| "deepseek-v4-flash /workspace/project ↑20 ↓6 cache 0% 3% context t"
style 0-84 dim
style 87-99 dim
9| "● Tool / read"
style 0-12 fg=green
10| "Read a.txt "
11| "1: alpha "
12| " "
13| "(End of file - total 1 lines) "
14| <blank>
15| "● Tool / read"
style 0-12 fg=green
16| "Read b.txt "
17| "1: beta "
18| " "
19| "(End of file - total 1 lines) "
20| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
21| <blank>
22| "Assistant "
style 0-8 fg=bright-magenta bold underline
23| "DONE "
24| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
25| <blank>
26| "/workspace/project deepseek-v4-flash ↑20 ↓6 cache 0% 3% context"
style 0-47 fg=bright-blue bold
style 50-66 fg=bright-black
style 69-84 fg=bright-black
style 87-96 fg=bright-black
27| " dsh ◍ "
style 1-3 fg=bright-blue bold
style 5-6 fg=bright-black
style 7-7 inverse
28-35| <blank>

View File

@@ -1,57 +1,48 @@
terminal 100x36 buffer=normal length=36 base=0 viewport=0
lifecycle started=1 stopped=0 progress=inactive
title "Use the todo_write tool to — DSH TUI snapshot"
cursor hidden column=1 viewportRow=31 bufferRow=31
cursor hidden column=7 viewportRow=31 bufferRow=31
buffer
0| " DEEPSEEK HARNESS"
style 1-8 fg=bright-blue bold
style 10-16 bold
1| " Use the todo_write tool to"
style 1-26 fg=bright-black
2| " deepseek-v4-flash • main-session"
style 1-34 dim
2| " main-session"
style 1-12 dim
3| <blank>
4| " "
style 0-0 fg=bright-blue
5| "▌ You "
style 0-0 fg=bright-blue
style 2-4 fg=bright-blue bold
6| "▌ Use the todo_write tool to record a plan with exactly three todos: \"read the code\" (in_progress), "
style 0-0 fg=bright-blue
7| "▌ \"write the fix\" (pending), \"run the tests\" (pending). Send all three in one todo_write call. Then "
style 0-0 fg=bright-blue
8| "▌ reply with the single word DONE and stop. "
style 0-0 fg=bright-blue
9| "▌ "
style 0-0 fg=bright-blue
10| <blank>
11| " Reasoning "
style 1-9 fg=bright-black italic
12| " The user wants me to use the todo_write tool to record a plan with exactly three todos in the "
style 1-99 fg=bright-black italic
13| " specified statuses, then reply with \"DONE\". "
style 1-43 fg=bright-black italic
14| <blank>
15| "▌ "
style 0-0 fg=green
16| "▌ ✓ Update todo list "
style 0-0 fg=green
style 2-2 fg=green bold
style 3-19 bold
17| "▌ Updated todo list: 2 pending, 1 in progress, 0 completed. "
style 0-0 fg=green
18| " "
style 0-0 fg=green
19| <blank>
20| " Reasoning "
style 1-9 fg=bright-black italic
21| " The todos have been written successfully. Now I just need to reply with the single word \"DONE\". "
style 1-95 fg=bright-black italic
22| <blank>
23| " Assistant "
style 1-9 fg=bright-magenta bold
24| " DONE "
25| <blank>
4| "You "
style 0-2 fg=bright-blue bold underline
5| "Use the todo_write tool to record a plan with exactly three todos: \"read the code\" (in_progress), "
6| "\"write the fix\" (pending), \"run the tests\" (pending). Send all three in one todo_write call. Then "
7| "reply with the single word DONE and stop. "
8| <blank>
9| "Assistant "
style 0-8 fg=bright-magenta bold underline
10| "Reasoning "
style 0-8 fg=bright-black italic
11| "The user wants me to use the todo_write tool to record a plan with exactly three todos in the "
style 0-99 fg=bright-black italic
12| "specified statuses, then reply with \"DONE\". "
style 0-42 fg=bright-black italic
13| <blank>
14| "● Tool / todo_write"
style 0-18 fg=green
15| "Update todo list "
16| "Updated todo list: 2 pending, 1 in progress, 0 completed. "
17| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
18| <blank>
19| "Assistant "
style 0-8 fg=bright-magenta bold underline
20| "Reasoning "
style 0-8 fg=bright-black italic
21| "The todos have been written successfully. Now I just need to reply with the single word \"DONE\". "
style 0-94 fg=bright-black italic
22| "DONE "
23| "Model wait 0.0s · Completed 2026-07-21 12:00:00 "
style 0-46 dim
24-25| <blank>
26| "Plan"
style 0-3 fg=bright-blue bold
27| " ● read the code"
@@ -60,13 +51,13 @@ buffer
style 2-2 dim
29| " ○ run the tests"
style 2-2 dim
30| "────────────────────────────────────────────────────────────────────────────────────────────────────"
style 0-99 dim
31| " "
style 1-1 inverse
32| "────────────────────────────────────────────────────────────────────────────────────────────────────"
style 0-99 dim
33| "deepseek-v4-flash /workspace/project ↑3.1k ↓145 cache 47% 3% context tools:"
style 0-79 dim
style 82-99 dim
34-35| <blank>
30| "/workspace/project deepseek-v4-flash ↑3.1k ↓145 cache 47% 3% context"
style 0-37 fg=bright-blue bold
style 40-56 fg=bright-black
style 59-79 fg=bright-black
style 82-91 fg=bright-black
31| " dsh ◍ "
style 1-3 fg=bright-blue bold
style 5-6 fg=bright-black
style 7-7 inverse
32-35| <blank>

View File

@@ -71,17 +71,37 @@ async function seedResumeSession(cwd: string): Promise<void> {
].join('\n'))
}
/** The rendered system prompt from the first `request/header` in the workspace's persisted session log. */
async function readLoggedSystemPrompt(cwd: string): Promise<string> {
/** Model-visible startup context from the first request in the workspace's persisted session log. */
interface LoggedRequestContext {
/** The system prompt string the launcher sends. */
system: string
/** The durable skill-catalog message serialized to text. */
skillCatalog: string
}
async function readLoggedRequestContext(cwd: string): Promise<LoggedRequestContext> {
const sessionsDir = join(cwd, '.sessions')
const entries = await readdir(sessionsDir, { recursive: true })
// A single keyless run writes one session log; the source section is global, so any log carries it.
const logRelPath = entries.find(name => name.endsWith('.jsonl'))
if (logRelPath === undefined) throw new Error(`no session log written under ${sessionsDir}`)
const lines = (await readFile(join(sessionsDir, logRelPath), 'utf8')).split('\n').filter(Boolean)
let skillCatalog = ''
for (const line of lines) {
const event = JSON.parse(line) as { type: string; data: { header?: { system?: string } } }
if (event.type === 'request/header') return event.data.header?.system ?? ''
const event = JSON.parse(line) as SessionEvent
if (
event.type === 'user/message'
&& event.data.source.kind === 'plugin'
&& event.data.source.plugin === 'dsh-tool-skill'
) {
skillCatalog = JSON.stringify(event.data.content)
}
if (event.type === 'request/header') {
return {
system: event.data.header.system ?? '',
skillCatalog,
}
}
}
throw new Error(`session log ${logRelPath} has no request/header event`)
}
@@ -176,6 +196,10 @@ describe('tui-agent keyless smoke (real Loader tree in a PTY)', () => {
expect(output).toContain('KV cache')
expect(output).toContain('Context')
expect(output).toContain('128,000')
expect(output).toContain('System prompt')
expect(output).toContain('You are an AI agent powered by the DeepSeek Harness SDK.')
expect(output).toContain('Registered tools')
expect(output).toContain('ask_user_question')
expect(output).toContain('\u001B[?2004l')
}, LOADER_SMOKE_TEST_TIMEOUT_MS)
@@ -208,6 +232,7 @@ describe('tui-agent keyless smoke (real Loader tree in a PTY)', () => {
{ waitFor: 'Scripted skill body received.', send: '/exit\r' },
],
})
expect(output).not.toContain('[instructions]')
expect(output).toContain('Scripted skill body received.')
expect(output).toContain('\u001B[?2004l')
}, LOADER_SMOKE_TEST_TIMEOUT_MS)
@@ -342,11 +367,13 @@ describe('dsh CLI keyless smoke (apps/cli through the same PTY)', () => {
expect(output).toContain('ui-tui: session "missing-session" failed to start:')
}, LOADER_SMOKE_TEST_TIMEOUT_MS)
it('tells the model where its own source lives, in the system prompt it sends', async () => {
it('tells the model its source path and offers the bundled maintenance skills', async () => {
// The launcher resolves the checkout root three hops up from apps/cli/{src,lib};
// this test file sits an equal depth under the same root, so the same hop applies.
// The source-path line is a system-prompt section; the bundled skills reach the
// model through a durable user message, so each assertion targets its own field.
const sourceRoot = fileURLToPath(new URL('../../..', import.meta.url))
let loggedSystem = ''
let context: LoggedRequestContext = { system: '', skillCatalog: '' }
await smoke({
label: 'dsh source-path prompt',
tempDirPrefix: 'dsh-source-path-',
@@ -358,8 +385,11 @@ describe('dsh CLI keyless smoke (apps/cli through the same PTY)', () => {
{ waitFor: 'How should the scripted run proceed?', send: '\r' },
{ waitFor: 'Decision received. Scripted TUI run complete.', send: '/exit\r' },
],
inspect: async (cwd) => { loggedSystem = await readLoggedSystemPrompt(cwd) },
inspect: async (cwd) => { context = await readLoggedRequestContext(cwd) },
})
expect(loggedSystem).toContain(`Your own source code is the checkout at ${sourceRoot}; you can read it there to learn how dsh works and how to extend it.`)
expect(context.system).toContain(`Your own source code is the checkout at ${sourceRoot}; you can read it there to learn how dsh works and how to extend it.`)
expect(context.skillCatalog).toContain("- `dsh-customize`: Customize or maintain any dsh source checkout — the one powering the current DSH process, the installed `dsh` command, or a sibling dsh/deepseek-harness clone. Use before any requested action that alters such a checkout's files or git state. Read-only questions that only inspect the checkout do not trigger this. Do not edit the personal staging checkout directly.")
expect(context.skillCatalog).toContain('- `dsh-upgrade`: Upgrades a source-installed, personally customized DSH checkout to upstream master while preserving local changes and an unchanged rollback worktree. Use when the user asks to update or upgrade DSH.')
expect(context.skillCatalog).toContain('- `dsh-upstream-customization`: Classifies personal DSH customizations for upstream contribution and, after explicit per-feature approval, rebuilds one on upstream master and opens a draft pull request. Use when the user asks to contribute, publish, or upstream a local DSH change, or asks whether one is worth proposing.')
}, LOADER_SMOKE_TEST_TIMEOUT_MS)
})

View File

@@ -2,7 +2,7 @@ import { cp, mkdir, mkdtemp, readFile, readdir, rm, writeFile } from 'node:fs/pr
import { tmpdir } from 'node:os'
import { basename, dirname, isAbsolute, join, relative, sep } from 'node:path'
import { fileURLToPath } from 'node:url'
import { afterAll, describe, expect, it } from 'vitest'
import { afterAll, describe, expect, it, vi } from 'vitest'
import { Context } from 'cordis'
import { scrubRequestHeaders } from '@deepseek-ai/dsh-acp-snapshot'
import type { Agent } from '@deepseek-ai/dsh-agent'
@@ -26,7 +26,7 @@ import * as ToolCordis from '@deepseek-ai/dsh-tool-cordis'
import * as ToolTodo from '@deepseek-ai/dsh-tool-todo'
import * as ToolRalph from '@deepseek-ai/dsh-tool-ralph'
import * as ToolWorkflow from '@deepseek-ai/dsh-tool-workflow'
import { createTuiChat, FILE_REFERENCE_PROMPT } from '@deepseek-ai/dsh-tui'
import { createTuiChat, FILE_REFERENCE_PROMPT, TuiPromptService } from '@deepseek-ai/dsh-tui'
import LocalSpillStore from '@deepseek-ai/dsh-spill-local'
import * as SpillPolicy from '@deepseek-ai/dsh-spill-policy'
import UserInteractionService from '@deepseek-ai/dsh-user-interaction'
@@ -227,6 +227,7 @@ async function mountScenarioContext(
await ctx.plugin(FsPolicy)
await ctx.plugin(ToolFs)
await ctx.plugin(UserInteractionService)
await ctx.plugin(TuiPromptService)
// todo_write is opt-in: only the todo-plan scenario mounts it, matching the shipped
// config that omits it. The other scenarios prove the default todo-free composition.
if (scenario.enableTodo === true) await ctx.plugin(ToolTodo)
@@ -264,6 +265,7 @@ interface ScenarioResult {
}
async function runScenario(scenario: Scenario): Promise<ScenarioResult> {
const clock = vi.spyOn(Date, 'now').mockReturnValue(new Date(2026, 6, 21, 12, 0, 0).getTime())
const dir = scenarioDir(scenario)
const fixtureFile = join(dir, 'session.jsonl')
const childFiles = childFixturePaths(scenario)
@@ -296,7 +298,7 @@ async function runScenario(scenario: Scenario): Promise<ScenarioResult> {
const agent: Agent = handle.agent
controller = createTuiChat(ctx, {
sessionId: 'main-session',
color: true,
theme: { color: true },
showReasoning: true,
title: 'DSH TUI snapshot',
welcome: `Recorded replay: ${scenario.name}`,
@@ -406,6 +408,7 @@ async function runScenario(scenario: Scenario): Promise<ScenarioResult> {
await ctx?.fiber.dispose()
await terminal.dispose()
await rm(cwd, { recursive: true, force: true })
clock.mockRestore()
}
}