feat(web): copy original run prompt

This commit is contained in:
2026-10-21 12:19:26 +01:00
parent 634f241019
commit cc094fc06d
6 changed files with 275 additions and 0 deletions
+14
View File
@@ -14,6 +14,7 @@ import {
EMPTY_OUTPUT_MESSAGE,
EMPTY_TIMELINE_MESSAGE,
NO_STAGE_DETAILS_MESSAGE,
originalRunPrompt,
STAGE_SESSION_TITLE,
STAGE_EVIDENCE_TITLE,
STAGE_DEFINITION_TITLE,
@@ -99,6 +100,19 @@ test("the empty-state strings are exactly the app's wording", () => {
assert.equal(STAGE_DEFINITION_TITLE, "Stage definition");
});
test("originalRunPrompt returns only the recorded string, including an empty prompt", () => {
const prompt = "\n original prompt\nwith lines \n";
assert.equal(originalRunPrompt({
input: { prompt },
title: "different title",
output: { markdown: "different output" },
}), prompt);
assert.equal(originalRunPrompt({ input: { prompt: "" }, title: "not a prompt" }), "");
assert.equal(originalRunPrompt({ input: {}, title: "not a prompt", output: { prompt: "also not" } }), undefined);
assert.equal(originalRunPrompt({ title: "not a prompt" }), undefined);
assert.equal(originalRunPrompt({ input: { prompt: null } }), undefined);
});
// ---------------------------------------------------------------------------
// Field display text
// ---------------------------------------------------------------------------