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. |
| 2 | import { open, signInAs, shot } from './harness.mjs'; |
| 3 | |
| 4 | const s = await open({ name: 'artefacts-shot', connect: false }); |
| 5 | const p = s.page; |
| 6 | await p.waitForTimeout(2500); |
| 7 | |
| 8 | await 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 | }); |
| 20 | await p.reload({ waitUntil: 'domcontentloaded' }); |
| 21 | await signInAs(s, 'artefacts-shot'); |
| 22 | await p.waitForTimeout(3000); |
| 23 | |
| 24 | await 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 | }); |
| 30 | await shot(s, 'artefacts-closed'); |
| 31 | |
| 32 | await p.evaluate(async () => { |
| 33 | document.getElementById('arte-strip').click(); |
| 34 | await new Promise(r => setTimeout(r, 700)); |
| 35 | }); |
| 36 | await shot(s, 'artefacts-open'); |
| 37 | |
| 38 | await s.close(); |
| 39 | console.log('shots written'); |