Oregami
Repositories/oxedyne/daimond

oxedyne/daimond/dev/shot_artefacts.mjs

1.4 KiB, 1 run

created by r2519314175:141, which is this file's identity for as long as the history lasts, whatever it is later renamed to

download · who wrote it · its history

1// shot_artefacts.mjs — a look at the artefact strip, open and closed.
2import { open, signInAs, shot } from './harness.mjs';
3
4const s = await open({ name: 'artefacts-shot', connect: false });
5const p = s.page;
6await p.waitForTimeout(2500);
7
8await p.evaluate(async () => {
9 const mod = await import('../pkg/oxedyne_daimond.js');
10 const app = new mod.DaimondApp('http://127.0.0.1/v1/chat/completions', '', 'none', 256, '', true);
11 const id = await app.create_diamond('Ship the launch');
12 const tl = (name, args) => ({ role: 'tool_log', name, args: JSON.stringify(args) });
13 await window.DaimondArtefacts.harvest(id, { sourceRun: { messages: [
14 tl('file_write', { path: 'notes/pricing.md' }),
15 tl('file_edit', { path: 'notes/launch-copy.md' }),
16 tl('web_open', { url: 'https://stripe.com/docs/billing' }),
17 tl('file_write', { path: 'notes/budget-2026.csv' }),
18 ] } });
19});
20await p.reload({ waitUntil: 'domcontentloaded' });
21await signInAs(s, 'artefacts-shot');
22await p.waitForTimeout(3000);
23
24await p.evaluate(async () => {
25 const row = Array.from(document.querySelectorAll('#diamond-list .diamond-box'))
26 .find(e => /Ship the launch/.test(e.textContent));
27 if (row) row.click();
28 await new Promise(r => setTimeout(r, 1200));
29});
30await shot(s, 'artefacts-closed');
31
32await p.evaluate(async () => {
33 document.getElementById('arte-strip').click();
34 await new Promise(r => setTimeout(r, 700));
35});
36await shot(s, 'artefacts-open');
37
38await s.close();
39console.log('shots written');