Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/repl-bench/journeys/conversation.test.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@
<Terminal.WaitForText text="REPL.Environment result" row={currentTurn.row + 1} />
<Terminal.WaitForText text="linked entry Round 1" />
<Terminal.Screenshot name="saved-turn-2" />
<Terminal.WaitForText text="DRAFT" present={false} />
<Terminal.WaitForText text="· draft" present={false} />
<Repl.Focus.Draft />
<Terminal.Key key="Enter" />
<Terminal.WaitForText text="saved turn 2 of 3" present={false} />
<Terminal.WaitForText text="DRAFT" />
<Terminal.WaitForText text="· draft" />
<Terminal.Type text="visible-draft-witness" />
<Terminal.WaitForText text="visible-draft-witness" />

Expand Down
5 changes: 3 additions & 2 deletions examples/repl-bench/journeys/focus-hints.test.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Run this acceptance document with the REPL Bench plugin. The expected screens ar
</Terminal.Region>

<Repl.Focus.Draft />
<Terminal.WaitForText text="DRAFT" bold={true} />
<Terminal.Key key="Enter" />
<Terminal.WaitForText text="· draft" bold={true} />
<Terminal.Type text="unsent-entry" />
<Terminal.WaitForText text="unsent-entry" />
<Repl.Focus.Message />
Expand All @@ -26,7 +27,7 @@ Run this acceptance document with the REPL Bench plugin. The expected screens ar
<Terminal.Key key="9" />
<Terminal.WaitForText text="[1]" bold={true} />
<Terminal.Key key="4" />
<Terminal.WaitForText text="DRAFT" bold={true} />
<Terminal.WaitForText text="· draft" bold={true} />
<Terminal.WaitForText text="[1]" present={false} />
<Terminal.WaitForText text="unsent-entry" />

Expand Down
61 changes: 32 additions & 29 deletions examples/repl-bench/journeys/repl-bench.test.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Test name="literal input reaches the focused Sidekick composer and Ctrl+C clears it before exit">
<ReplBench columns={120} rows={30} expectExit={true} as="closed">
<Repl.Focus.Draft />
<ReplBench.Key key="Enter" />
<ReplBench.Type text="draft-only" />
<ReplBench.WaitForText text="draft-only" />
<ReplBench.Focus target="sidekick-composer" />
Expand Down Expand Up @@ -52,8 +53,10 @@
<File path="repl-fixture.txt">scoped-repl-fixture</File>
<ReplBench columns={160} rows={36}>
<Repl.Focus.Draft />
<ReplBench.Key key="Enter" />
<ReplBench.Type text={'<Cwd as="directory" />\n<Let as="basename" value={directory.split("/").at(-1)} />\n\nDir {basename}\n\n<File path="repl-fixture.txt" />'} />
<ReplBench.WaitForText text="repl-fixture.txt" />
<ReplBench.Key key="Tab" />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text="scoped-repl-fixture" />
<ReplBench.WaitForText text={directory.split("/").at(-1)} />
Expand All @@ -64,10 +67,12 @@
<Test name="submitting the Draft shows its result and settled History mark">
<ReplBench columns={160} rows={36} expectExit={true} as="closed">
<Repl.Focus.Draft />
<ReplBench.WaitForText text="> DRAFT" />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text="> Round" />
<ReplBench.WaitForText text="HEAD · EMPTY" />
<ReplBench.Type text={'```js eval\nconst count = 6 * 7;\n```\n\nDraft result {count}'} />
<ReplBench.WaitForText text="Draft result {count}" />
<ReplBench.Key key="Tab" />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text="HEAD · SETTLED" />
<ReplBench.WaitForText text="✓ COMPLETED" />
Expand All @@ -81,14 +86,11 @@
<Test name="History takes focus and the Draft survives narrow and wide layouts">
<ReplBench columns={160} rows={36} expectExit={true} as="closed">
<Repl.Focus.Draft />
<ReplBench.WaitForText text="> DRAFT" />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text="> Round" />
<ReplBench.Type text="draft survives" />
<ReplBench.WaitForText text="draft survives" />
<ReplBench.Key key="Shift+Tab" />
<ReplBench.WaitForText text="> Entries" />
<ReplBench.Key key="Shift+Tab" />
<ReplBench.WaitForText text="> All sessions" />
<ReplBench.Key key="Shift+Tab" />
<Repl.Focus.History />
<ReplBench.WaitForText text="> [history]" />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text="[close]" />
Expand All @@ -98,13 +100,13 @@
<ReplBench.Resize columns={72} rows={20} />
<ReplBench.WaitForText text="* Entries" row={1} />
<ReplBench.WaitForText text="[exit]" row={19} />
<ReplBench.WaitForText text="DRAFT" as="narrowDraft" />
<ReplBench.WaitForText text="draft survives" at={{ row: narrowDraft.row + 1, column: narrowDraft.column - 2 }} />
<ReplBench.WaitForText text="· draft" as="narrowDraft" />
<ReplBench.WaitForText text="draft survives" row={narrowDraft.row + 1} />
<ReplBench.Resize columns={160} rows={36} />
<ReplBench.WaitForText text="TRANSCRIPT" row={1} />
<ReplBench.WaitForText text="[exit]" row={35} />
<ReplBench.WaitForText text="DRAFT" as="wideDraft" />
<ReplBench.WaitForText text="draft survives" at={{ row: wideDraft.row + 1, column: wideDraft.column - 2 }} />
<ReplBench.WaitForText text="· draft" as="wideDraft" />
<ReplBench.WaitForText text="draft survives" row={wideDraft.row + 1} />
<ReplBench.WaitForText text="stray input" present={false} />
<ReplBench.Key key="Ctrl+C" />
</ReplBench>
Expand All @@ -115,15 +117,13 @@
<Test name="Enter on the focused exit allows the settled entry to reopen">
<ReplBench columns={160} rows={36} expectExit={true} as="closed">
<Repl.Focus.Draft />
<ReplBench.Key key="Enter" />
<ReplBench.Type text="Retained reading" />
<ReplBench.WaitForText text="Retained reading" />
<ReplBench.Key key="Tab" />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text="1 ✓" />
<ReplBench.Key key="Shift+Tab" />
<ReplBench.WaitForText text="> Entries" />
<ReplBench.Key key="Shift+Tab" />
<ReplBench.WaitForText text="> All sessions" />
<ReplBench.Key key="Shift+Tab" />
<Repl.Focus.History />
<ReplBench.WaitForText text="> [history]" />
<ReplBench.Key key="ArrowRight" />
<ReplBench.WaitForText text="> [exit]" />
Expand All @@ -142,7 +142,8 @@
<Test name="the visible Draft Send submits its entry and leaves Sidekick idle">
<ReplBench columns={160} rows={36}>
<Repl.Focus.Draft />
<ReplBench.WaitForText text="> DRAFT" as="draft" />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text="> Round" as="draft" />
<ReplBench.WaitForText text="message the sidekick" as="composer" />
<ReplBench.WaitForText text="[send]" row={composer.row-1} as="sidekickSend" />
<ReplBench.WaitForText text="No messages yet." />
Expand All @@ -151,7 +152,8 @@
<ReplBench.Region name="sidekick-composer">
<ReplBench.WaitForText text="Draft Send witness" present={false} />
</ReplBench.Region>
<ReplBench.WaitForText text="[send]" row={draft.row} as="draftSend" />
<ReplBench.WaitForText text="✎ draft" as="bar" />
<ReplBench.WaitForText text="Send" row={bar.row} as="draftSend" />
<ReplBench.Click at={draftSend} />
<ReplBench.WaitForText text="1 ✓" />
<ReplBench.WaitForText text="✓ COMPLETED" />
Expand All @@ -160,30 +162,31 @@
<ReplBench.WaitForText text="[send]" at={sidekickSend} />
<ReplBench.WaitForText text="No messages yet." />
<ReplBench.Region name="transcript">
<ReplBench.WaitForText text="(none retained)" />
<ReplBench.WaitForText text="── Round 1 ──" />
</ReplBench.Region>
</ReplBench>
</Test>

<Test name="the Draft survives all layouts and submits after the minimum-size refusal">
<ReplBench columns={160} rows={36}>
<Repl.Focus.Draft />
<ReplBench.WaitForText text="> DRAFT" as="beforeResize" />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text="> Round" as="beforeResize" />
<ReplBench.Type text="Draft kept through resize" />
<ReplBench.WaitForText text="Draft kept through resize" />

<ReplBench.Resize columns={120} rows={30} />
<ReplBench.WaitForText text="HISTORY" row={29} />
<ReplBench.WaitForText text="> DRAFT" as="medium" />
<AssertEquals actual={medium.row < beforeResize.row} expected={true} />
<ReplBench.WaitForText text="> Round" as="medium" />
<AssertEquals actual={medium.row} expected={beforeResize.row} />
<ReplBench.WaitForText text="Draft kept through resize" row={medium.row+1} />

<ReplBench.Resize columns={72} rows={20} />
<ReplBench.WaitForText text="* Entries" />
<ReplBench.WaitForText text="> DRAFT" as="narrow" />
<ReplBench.WaitForText text="> Round" as="narrow" />
<ReplBench.WaitForText text="Draft kept through resize" row={narrow.row+1} />
<ReplBench.WaitForText text="[send]" as="narrowSend" />
<ReplBench.WaitForText text="[send]" row={narrow.row} at={narrowSend} />
<ReplBench.WaitForText text="✎ draft" as="narrowBar" />
<ReplBench.WaitForText text="Send" row={narrowBar.row} />
<ReplBench.WaitForText text="SIDEKICK" present={false} />
<ReplBench.WaitForText text="message the sidekick" present={false} />

Expand All @@ -195,12 +198,12 @@

<ReplBench.Resize columns={160} rows={36} />
<ReplBench.WaitForText text="> All sessions" />
<ReplBench.WaitForText text="DRAFT" as="wide" />
<ReplBench.WaitForText text="· draft" as="wide" />
<ReplBench.WaitForText text="Draft kept through resize" row={wide.row+1} />
<Repl.Focus.Draft />
<ReplBench.WaitForText text="> Round" />
<ReplBench.Key key="Tab" />
<ReplBench.WaitForText text="> Entries" />
<ReplBench.Key key="Tab" />
<ReplBench.WaitForText text="> DRAFT" />
<ReplBench.WaitForText text="> Send" />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text="HEAD · SETTLED" />
<ReplBench.WaitForText text="✓ COMPLETED" />
Expand Down
3 changes: 3 additions & 0 deletions examples/repl-bench/journeys/repl-command-output.test.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ printf 'hidden-%s\n' stderr >&2
</Let>

<Repl.Focus.Draft />
<ReplBench.Key key="Enter" />
<ReplBench.Type text={source} />
<ReplBench.WaitForText text="printf 'hidden-%s" />
<ReplBench.Key key="Tab" />
<ReplBench.WaitForText text="> Send" />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text="1 ✓" />
<ReplBench.WaitForText text="✓ COMPLETED" />
Expand Down
16 changes: 9 additions & 7 deletions examples/repl-bench/journeys/repl-focus-shortcuts.test.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@
</Terminal.Region>

<Repl.Focus.Draft />
<Terminal.WaitForText text="> DRAFT" bold={true} />
<Terminal.Key key="Enter" />
<Terminal.WaitForText text="> Round" bold={true} />
<Terminal.Type text="entry-draft" />
<Terminal.WaitForText text="entry-draft" />

<Terminal.Key key="Tab" />
<Terminal.WaitForText text="> BINDINGS" bold={true} />
<Terminal.WaitForText text="> Send" bold={true} />
<Terminal.WaitForText text="message the sidekick" bold={false} />
<Terminal.Key key="Shift+Tab" />
<Terminal.WaitForText text="> DRAFT" bold={true} />
<Terminal.WaitForText text="> Round" bold={true} />
<Terminal.WaitForText text="> BINDINGS" present={false} />

<Repl.Focus.Message />
Expand All @@ -47,7 +48,8 @@
<Terminal.WaitForText text="narrow-message" />
</Terminal.Region>
<Repl.Focus.Draft />
<Terminal.WaitForText text="> DRAFT" bold={true} />
<Terminal.Key key="Enter" />
<Terminal.WaitForText text="> Round" bold={true} />
<Terminal.Type text="narrow-draft" />
<Try>
<Repl.Focus.Tabs />
Expand Down Expand Up @@ -79,7 +81,7 @@
<Terminal.WaitForText text="narrow-message-kept" />
</Terminal.Region>
<Repl.Focus.Draft />
<Terminal.WaitForText text="> DRAFT" bold={true} />
<Terminal.WaitForText text="> Round" bold={true} />
<Terminal.WaitForText text="narrow-draft-kept" />
</ReplBench>
</Terminal>
Expand All @@ -93,7 +95,7 @@
<Repl.Focus.SelectedWork />
<Terminal.WaitForText text="> Entries" />
<Repl.Focus.Draft />
<Terminal.WaitForText text="> DRAFT" />
<Terminal.WaitForText text="> + New Round" />
<Repl.Focus.Tabs />
<Terminal.WaitForText text="> BINDINGS" />
<Repl.Focus.RightReading />
Expand All @@ -107,7 +109,7 @@
<Terminal.Resize columns={72} rows={20} />
<Terminal.WaitForText text="Sessions" row={1} />
<Repl.Focus.Draft />
<Terminal.WaitForText text="> DRAFT" />
<Terminal.WaitForText text="> + New Round" />
<Repl.Focus.SurfaceBar />
<Terminal.WaitForText text="> Sessions" row={1} />
</XMD.Repl>
Expand Down
24 changes: 24 additions & 0 deletions examples/repl-bench/journeys/repl-include-mount.test.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,39 @@ External-only rendered.

<ReplBench include={includes} expectExit={true} as="closed">
<Repl.Focus.Draft />
<ReplBench.Key key="Enter" />
<ReplBench.Type text={"<Greeting />\n<ExternalOnly />"} />
<ReplBench.WaitForText text="<ExternalOnly />" />
<ReplBench.Key key="Tab" />
<ReplBench.WaitForText text="> Send" />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text="Ready for Entry 2" />
<ReplBench.WaitForText text="First greeting rendered." />
<ReplBench.WaitForText text="External-only rendered." />
<ReplBench.WaitForText text="Second greeting rendered." present={false} />

<Repl.Focus.Draft />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text="> Round 2 · draft" />
<ReplBench.Type text="<WorkspaceOnly />" />
<ReplBench.WaitForText text="<WorkspaceOnly />" />
<ReplBench.Key key="Tab" />
<ReplBench.WaitForText text="> Send" />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text="Cannot resolve component: WorkspaceOnly" />
<ReplBench.WaitForText text="Local default rendered." present={false} />
<Repl.Focus.Draft />
<Each in={"<WorkspaceOnly />".split("")} let="character"><ReplBench.Key key="Backspace" /></Each>
<ReplBench.WaitForText text="<WorkspaceOnly />" present={false} />

<ReplBench.Type text="<RootOnly />" />
<ReplBench.WaitForText text="<RootOnly />" />
<ReplBench.Key key="Tab" />
<ReplBench.WaitForText text="> Send" />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text="Cannot resolve component: RootOnly" />
<ReplBench.WaitForText text="Root default rendered." present={false} />
<Repl.Focus.Draft />
<Each in={"<RootOnly />".split("")} let="character"><ReplBench.Key key="Backspace" /></Each>
<ReplBench.WaitForText text="<RootOnly />" present={false} />
<ReplBench.WaitForText text="Ready for Entry 2" />
Expand Down Expand Up @@ -74,8 +86,11 @@ External-only rendered.
<Dir path="second"><File path="Greeting.md">Second greeting rendered.</File></Dir>
<ReplBench include={[root+"/second","first"]}>
<Repl.Focus.Draft />
<ReplBench.Key key="Enter" />
<ReplBench.Type text="<Greeting />" />
<ReplBench.WaitForText text="<Greeting />" />
<ReplBench.Key key="Tab" />
<ReplBench.WaitForText text="> Send" />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text="Ready for Entry 2" />
<ReplBench.WaitForText text="Second greeting rendered." />
Expand All @@ -84,8 +99,11 @@ External-only rendered.

<ReplBench>
<Repl.Focus.Draft />
<ReplBench.Key key="Enter" />
<ReplBench.Type text={"<WorkspaceOnly />\n<RootOnly />"} />
<ReplBench.WaitForText text="<RootOnly />" />
<ReplBench.Key key="Tab" />
<ReplBench.WaitForText text="> Send" />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text="Ready for Entry 2" />
<ReplBench.WaitForText text="Local default rendered." />
Expand Down Expand Up @@ -140,8 +158,11 @@ pwd -P | tr -d '\n' > process-cwd.txt
</Let>
<ReplBench mount={initialMounts} allowAbsolute={true} expectExit={true} as="held">
<Repl.Focus.Draft />
<ReplBench.Key key="Enter" />
<ReplBench.Type text={"<Dir path="+JSON.stringify(fixtureTarget)+">\n"+fixtureBody+"\n</Dir>\n\n<Dir path="+path+">\n"+body+"\n</Dir>"} />
<ReplBench.WaitForText text="</Dir>" />
<ReplBench.Key key="Tab" />
<ReplBench.WaitForText text="> Send" />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text="waiting for an answer" />
<ReplBench.WaitForText text="[exit]" as="exit" />
Expand Down Expand Up @@ -195,8 +216,11 @@ fresh is {fresh}
```
</Let>
<Repl.Focus.Draft />
<ReplBench.Key key="Enter" />
<ReplBench.Type text={"<Dir path="+path+">\n"+freshBody+"\n</Dir>"} />
<ReplBench.WaitForText text="</Dir>" />
<ReplBench.Key key="Tab" />
<ReplBench.WaitForText text="> Send" />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text="Ready for Entry 3" />
<ReplBench.WaitForText text="Entries" row={1} as="catalog" />
Expand Down
5 changes: 4 additions & 1 deletion examples/repl-bench/journeys/repl-scripted-sidekick.test.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,14 @@

<Test name="History wheel and keyboard preserve a held Sidekick answer and reach its final outcome" timeout="120s">
<ReplBench scenario="examples/repl-bench/fixtures/repl-sidekick-held-history.md" columns={120} rows={30}>
<Repl.Focus.Draft />
<Each in={[0,1,2,3,4,5,6,7,8,9,10,11]} let="index">
<Repl.Focus.Draft />
<ReplBench.Key key="Enter" />
<Let as="source" value={index===11 ? Array.from({length:70},(_,row)=>"Bg row "+row).join("\n") : '<Let as="history'+index+'" value={'+index+'} />'} />
<ReplBench.Type text={source} />
<ReplBench.WaitForText text={index===11 ? "Bg row 69" : "value={"+index+"}"} />
<ReplBench.Key key="Tab" />
<ReplBench.WaitForText text="> Send" />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text={"Ready for Entry "+(index+2)} />
</Each>
Expand Down
3 changes: 3 additions & 0 deletions examples/repl-bench/journeys/repl-shared-terminal.test.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
<XMD.Repl expectExit={true} as="closed">
<Terminal.WaitForText text="Ready for Entry 1" />
<Repl.Focus.Draft />
<Terminal.Key key="Enter" />
<Terminal.Type text="retained-marker-1272" />
<Terminal.WaitForText text="retained-marker-1272" />
<Terminal.Key key="Tab" />
<Terminal.WaitForText text="> Send" />
<Terminal.Key key="Enter" />
<Terminal.WaitForText text="Ready for Entry 2" />
<Terminal.Focus target="sidekick-composer" />
Expand Down
5 changes: 4 additions & 1 deletion examples/repl-bench/journeys/repl-wheel-permission.test.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<Test name="Permission wheel preserves focus and keyboard reaches the final choice" timeout="60s">
<ReplBench columns={120} rows={30} entryPermissionFixture={true}>
<Repl.Focus.Draft />
<ReplBench.Key key="Enter" />
<ReplBench.Type text={'<AgentProvider name="wheel-permission-fixture" defaultAgent="fixture"><Session name="permission"><Prompt text="many choices" /></Session></AgentProvider>'} />
<ReplBench.WaitForText text="many choices" />
<ReplBench.WaitForText text="</AgentProvider>" />
<ReplBench.Key key="Tab" />
<ReplBench.WaitForText text="> Send" />
<ReplBench.Key key="Enter" />
<ReplBench.WaitForText text="asks:" as="permission" />
<ReplBench.Click at={permission} />
Expand Down
Loading
Loading