repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

Add ui manual smoke playbook

ab0be26ecd22f5c032787ba52008f941d92ed641

Oliver Krylow <o.krylow@isp-insoft.de> ·

unsigned

Browse filesCompare with HEAD

Changed files (3)

+144 / −0 text lines

Diff layout

extensions/ui/docs/manual-playbook.md

Added
new file mode 100644

+52 / −0 text lines

1# UI manual smoke playbook
2
3## Host rule
4
5Use zellij on win32.
6Do not invoke tmux on win32.
7Use tmux only on non-win32 hosts where it is installed.
8
9## win32 zellij
11```sh
12node extensions/ui/scripts/zellij-smoke.mjs
13zellij attach <printed-session>
14```
16Checkpoints:
181. Run `pi -e extensions/ui/index.ts` inside the zellij pane if the script did not launch it.
192. Send `/ui`.
203. Verify the terminal widget shows a token URL and QR.
214. Open the exact URL in Chrome or Firefox.
225. Verify `/api/status` without the token returns `401`.
236. Try `/`, `/skill:`, `!`, `!!`, Esc, Ctrl+O, and Ctrl+P from the browser composer.
247. Ask for card, form, and raw HTML widgets.
258. Click one widget action and verify a visible attribution row appears before any widget-originated prompt reaches the agent.
269. Scroll, click, select text, background the tab, return, and send one prompt.
2710. Verify the digest indicator appears and the digest is attached once only.
2811. Send `/ui off` in Pi.
2912. Verify browser disconnect and terminal UI restores as far as Pi exposes.
31Cleanup:
33```sh
34zellij kill-session <printed-session>
35```
37## non-win32 tmux
39```sh
40node extensions/ui/scripts/tmux-smoke.mjs
41tmux attach -t <printed-session>
42```
44Use the same checkpoints.
46## Evidence to capture
48- zellij/tmux session name.
49- `/ui` URL redacted to origin plus `token=[redacted]`.
50- 401 result for tokenless request.
51- Browser stream screenshot for widget + attribution + digest.
52- `/ui off` terminal state.

extensions/ui/scripts/tmux-smoke.mjs

Added
new file mode 100644

+38 / −0 text lines

1#!/usr/bin/env node
2import { spawnSync } from "node:child_process";
3
4if (process.platform === "win32") {
5 console.error(
6 "tmux-smoke is disabled on win32. Use scripts/zellij-smoke.mjs.",
7 );
8 process.exit(2);
9}
11const tmux = process.env.TMUX_BIN ?? "tmux";
12const session = "ui-" + "smoke-" + Date.now().toString(36);
14run(tmux, ["-V"]);
15run(tmux, ["new-session", "-d", "-s", session, "pi -e extensions/ui/index.ts"]);
17console.log(`tmux session: ${session}`);
18console.log(`attach: ${tmux} attach -t ${session}`);
19console.log("manual checkpoints:");
20console.log("1. Send /ui and verify terminal widget shows URL + QR.");
21console.log(
22 "2. Open URL in browser; verify exact URL works and /api/status without token returns 401.",
23);
24console.log(
25 "3. Try /, /skill:, !, !!, Esc, Ctrl+O, Ctrl+P, card/form/raw widget, click widget action.",
26);
27console.log(
28 "4. Scroll/click/select/background/return/send next prompt; verify digest appears once.",
29);
30console.log(
31 "5. Send /ui off; verify browser disconnect and terminal UI restored as far as Pi exposes.",
32);
33console.log(`kill: ${tmux} kill-session -t ${session}`);
35function run(command, args) {
36 const result = spawnSync(command, args, { stdio: "inherit", shell: false });
37 if (result.status !== 0) process.exit(result.status ?? 1);
38}

extensions/ui/scripts/zellij-smoke.mjs

Added
new file mode 100644

+54 / −0 text lines

1#!/usr/bin/env node
2import { spawnSync } from "node:child_process";
3
4if (process.platform !== "win32") {
5 console.error(
6 "zellij-smoke is the win32 smoke path. Use scripts/tmux-smoke.mjs on non-win32.",
7 );
8 process.exit(2);
9}
11const zellij = process.env.ZELLIJ ?? "zellij";
12const session = "ui-" + "smoke-" + Date.now().toString(36);
13const cwd = process.cwd();
15run(zellij, ["--version"]);
16run(
17 zellij,
18 [
19 "--session",
20 session,
21 "--new-session-with-layout",
22 "default",
23 "options",
24 "--default-cwd",
25 cwd,
26 ],
27 { allowFailure: true },
28);
30console.log(`zellij session: ${session}`);
31console.log(`attach: ${zellij} attach ${session}`);
32console.log("manual checkpoints:");
33console.log("1. In the zellij pane run: pi -e extensions/ui/index.ts");
34console.log("2. Send /ui and verify terminal widget shows URL + QR.");
35console.log(
36 "3. Open URL in browser; verify exact URL works and /api/status without token returns 401.",
37);
38console.log(
39 "4. Try /, /skill:, !, !!, Esc, Ctrl+O, Ctrl+P, card/form/raw widget, click widget action.",
40);
41console.log(
42 "5. Scroll/click/select/background/return/send next prompt; verify digest appears once.",
43);
44console.log(
45 "6. Send /ui off; verify browser disconnect and terminal UI restored as far as Pi exposes.",
46);
47console.log(`kill: ${zellij} kill-session ${session}`);
49function run(command, args, options = {}) {
50 const result = spawnSync(command, args, { stdio: "inherit", shell: false });
51 if (!options.allowFailure && result.status !== 0)
52 process.exit(result.status ?? 1);
53 return result;
54}