@bonyadnouri/autoend 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/explore/explorer.d.ts +4 -1
- package/dist/explore/explorer.js +61 -22
- package/dist/explore/explorer.js.map +1 -1
- package/dist/map/flow-map.d.ts +46 -0
- package/dist/map/flow-map.js +99 -6
- package/dist/map/flow-map.js.map +1 -1
- package/dist/replay/replay.d.ts +13 -2
- package/dist/replay/replay.js +92 -11
- package/dist/replay/replay.js.map +1 -1
- package/dist/report/artifact.d.ts +7 -1
- package/dist/report/artifact.js +10 -0
- package/dist/report/artifact.js.map +1 -1
- package/dist/report/types.d.ts +62 -0
- package/dist/run/run.d.ts +6 -1
- package/dist/run/run.js +64 -9
- package/dist/run/run.js.map +1 -1
- package/dist/run/sensitive-env.d.ts +24 -0
- package/dist/run/sensitive-env.js +45 -0
- package/dist/run/sensitive-env.js.map +1 -0
- package/dist/spa/assets/index-BYZk0rZl.js +264 -0
- package/dist/spa/assets/index-D8cAgArG.css +1 -0
- package/dist/spa/index.html +14 -0
- package/dist/spa/logo.svg +7 -0
- package/dist/viewer/server.d.ts +7 -6
- package/dist/viewer/server.js +168 -26
- package/dist/viewer/server.js.map +1 -1
- package/package.json +17 -4
- package/dist/viewer/html.d.ts +0 -7
- package/dist/viewer/html.js +0 -240
- package/dist/viewer/html.js.map +0 -1
package/dist/viewer/html.js
DELETED
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The Report page (ADR-0004: thin viewer over the static Run artifact).
|
|
3
|
-
* Single file, zero external assets — must render offline. Design direction:
|
|
4
|
-
* forensic terminal dossier. The page answers "did anything break?" in the
|
|
5
|
-
* first glance (the verdict), then presents Evidence per tier.
|
|
6
|
-
*/
|
|
7
|
-
export const VIEWER_HTML = /* html */ `<!doctype html>
|
|
8
|
-
<html lang="en">
|
|
9
|
-
<head>
|
|
10
|
-
<meta charset="utf-8">
|
|
11
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
12
|
-
<title>autoend Report</title>
|
|
13
|
-
<style>
|
|
14
|
-
:root {
|
|
15
|
-
--bg: #0a0d12;
|
|
16
|
-
--surface: #10141c;
|
|
17
|
-
--line: #1d2432;
|
|
18
|
-
--ink: #dce3ef;
|
|
19
|
-
--dim: #6d7890;
|
|
20
|
-
--hard: #ff5c5c;
|
|
21
|
-
--regression: #f2a53f;
|
|
22
|
-
--heal: #38cfc0;
|
|
23
|
-
--advisory: #8f7ff0;
|
|
24
|
-
--ok: #56d68b;
|
|
25
|
-
--mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
|
|
26
|
-
}
|
|
27
|
-
* { box-sizing: border-box; margin: 0; }
|
|
28
|
-
html { color-scheme: dark; }
|
|
29
|
-
body {
|
|
30
|
-
background:
|
|
31
|
-
radial-gradient(1200px 500px at 50% -10%, #131a26 0%, transparent 60%),
|
|
32
|
-
repeating-linear-gradient(0deg, transparent 0 47px, #ffffff05 47px 48px),
|
|
33
|
-
repeating-linear-gradient(90deg, transparent 0 47px, #ffffff05 47px 48px),
|
|
34
|
-
var(--bg);
|
|
35
|
-
color: var(--ink);
|
|
36
|
-
font-family: var(--mono);
|
|
37
|
-
font-size: 14px;
|
|
38
|
-
line-height: 1.55;
|
|
39
|
-
min-height: 100vh;
|
|
40
|
-
}
|
|
41
|
-
main { max-width: 66rem; margin: 0 auto; padding: 0 1.5rem 6rem; }
|
|
42
|
-
|
|
43
|
-
header {
|
|
44
|
-
display: flex; justify-content: space-between; align-items: baseline;
|
|
45
|
-
padding: 1.1rem 0; border-bottom: 1px solid var(--line);
|
|
46
|
-
font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim);
|
|
47
|
-
}
|
|
48
|
-
header .brand b { color: var(--ink); font-weight: 700; }
|
|
49
|
-
|
|
50
|
-
.verdict { padding: 3.2rem 0 0; animation: rise .5s ease-out both; }
|
|
51
|
-
.verdict h1 {
|
|
52
|
-
font-size: clamp(2rem, 5.4vw, 3.4rem);
|
|
53
|
-
font-weight: 800; letter-spacing: .01em; line-height: 1.1;
|
|
54
|
-
display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
|
|
55
|
-
}
|
|
56
|
-
.lamp {
|
|
57
|
-
width: .6em; height: .6em; border-radius: 50%;
|
|
58
|
-
background: var(--verdict-color, var(--ok));
|
|
59
|
-
box-shadow: 0 0 18px var(--verdict-color, var(--ok));
|
|
60
|
-
animation: pulse 2.4s ease-in-out infinite;
|
|
61
|
-
}
|
|
62
|
-
.verdict .sub { margin-top: .9rem; color: var(--dim); font-size: 13px; }
|
|
63
|
-
.verdict .sub b { color: var(--ink); font-weight: 600; }
|
|
64
|
-
|
|
65
|
-
.stats {
|
|
66
|
-
display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
|
|
67
|
-
gap: 1px; background: var(--line); border: 1px solid var(--line);
|
|
68
|
-
margin-top: 2.6rem; animation: rise .5s .08s ease-out both;
|
|
69
|
-
}
|
|
70
|
-
.stat { background: var(--surface); padding: .9rem 1rem .8rem; position: relative; }
|
|
71
|
-
.stat::before {
|
|
72
|
-
content: ""; position: absolute; inset: 0 auto auto 0; height: 2px; width: 100%;
|
|
73
|
-
background: var(--stat-color, transparent);
|
|
74
|
-
}
|
|
75
|
-
.stat .n { font-size: 1.7rem; font-weight: 800; }
|
|
76
|
-
.stat .l { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
|
|
77
|
-
.stat.zero .n { color: var(--dim); }
|
|
78
|
-
|
|
79
|
-
section { margin-top: 3.4rem; animation: rise .5s ease-out both; }
|
|
80
|
-
section:nth-of-type(1) { animation-delay: .14s }
|
|
81
|
-
section:nth-of-type(2) { animation-delay: .20s }
|
|
82
|
-
section:nth-of-type(3) { animation-delay: .26s }
|
|
83
|
-
section:nth-of-type(4) { animation-delay: .32s }
|
|
84
|
-
section h2 {
|
|
85
|
-
font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
|
|
86
|
-
display: flex; align-items: baseline; gap: .7rem;
|
|
87
|
-
}
|
|
88
|
-
section h2::before { content: "▮"; color: var(--tier); }
|
|
89
|
-
section h2 .count { color: var(--tier); }
|
|
90
|
-
section .explain { color: var(--dim); font-size: 12.5px; margin: .45rem 0 1.2rem; max-width: 44rem; }
|
|
91
|
-
|
|
92
|
-
.card {
|
|
93
|
-
border: 1px solid var(--line); border-left: 3px solid var(--tier);
|
|
94
|
-
background: var(--surface); padding: 1.1rem 1.25rem 1.25rem; margin-bottom: 1rem;
|
|
95
|
-
}
|
|
96
|
-
.card h3 { font-size: 15px; font-weight: 700; }
|
|
97
|
-
.card .detail {
|
|
98
|
-
color: var(--dim); font-size: 12.5px; margin-top: .4rem;
|
|
99
|
-
white-space: pre-wrap; word-break: break-word;
|
|
100
|
-
}
|
|
101
|
-
.card video {
|
|
102
|
-
width: 100%; margin-top: 1rem; border: 1px solid var(--line);
|
|
103
|
-
background: #000; display: block;
|
|
104
|
-
}
|
|
105
|
-
.card .flowid { color: var(--dim); font-size: 11px; margin-top: .55rem; letter-spacing: .06em; }
|
|
106
|
-
|
|
107
|
-
.allclear { text-align: center; padding: 5rem 0 2rem; animation: rise .5s .14s ease-out both; }
|
|
108
|
-
.allclear .mark { font-size: 3rem; color: var(--ok); }
|
|
109
|
-
.allclear h2 { font-size: 1.5rem; letter-spacing: .3em; text-transform: uppercase; margin-top: 1rem; }
|
|
110
|
-
.allclear p { color: var(--dim); margin-top: .8rem; }
|
|
111
|
-
|
|
112
|
-
footer {
|
|
113
|
-
margin-top: 5rem; padding-top: 1rem; border-top: 1px solid var(--line);
|
|
114
|
-
color: var(--dim); font-size: 11px; letter-spacing: .08em;
|
|
115
|
-
display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
@keyframes rise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
|
|
119
|
-
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .55 } }
|
|
120
|
-
@media (prefers-reduced-motion: reduce) { * { animation: none !important } }
|
|
121
|
-
</style>
|
|
122
|
-
</head>
|
|
123
|
-
<body>
|
|
124
|
-
<main>
|
|
125
|
-
<header>
|
|
126
|
-
<span class="brand"><b>autoend</b> ⁄ run report</span>
|
|
127
|
-
<span id="runid"></span>
|
|
128
|
-
</header>
|
|
129
|
-
<div class="verdict" id="verdict"></div>
|
|
130
|
-
<div class="stats" id="stats"></div>
|
|
131
|
-
<div id="body"></div>
|
|
132
|
-
<footer>
|
|
133
|
-
<span>evidence recorded headless during the run</span>
|
|
134
|
-
<span id="stamp"></span>
|
|
135
|
-
</footer>
|
|
136
|
-
</main>
|
|
137
|
-
<script>
|
|
138
|
-
const TIERS = {
|
|
139
|
-
'hard-failure': {
|
|
140
|
-
label: 'Hard failures', color: 'var(--hard)',
|
|
141
|
-
explain: 'Objectively broken — errors, crashes, failed requests. Fix these first.',
|
|
142
|
-
},
|
|
143
|
-
'regression': {
|
|
144
|
-
label: 'Regressions', color: 'var(--regression)',
|
|
145
|
-
explain: 'Worked in a previous run, failed in this one. If the removal was intentional, dismiss it to update the baseline.',
|
|
146
|
-
},
|
|
147
|
-
'heal': {
|
|
148
|
-
label: 'Heals', color: 'var(--heal)',
|
|
149
|
-
explain: 'The UI changed but the goal still works — the flow script was rewritten. Watch each video to confirm the heal is right.',
|
|
150
|
-
},
|
|
151
|
-
'advisory': {
|
|
152
|
-
label: 'Advisories', color: 'var(--advisory)',
|
|
153
|
-
explain: 'Agent judgment on UX, accessibility, and speed. Signals worth a look, not verdicts.',
|
|
154
|
-
},
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
function el(tag, attrs, children) {
|
|
158
|
-
const node = document.createElement(tag);
|
|
159
|
-
for (const [k, v] of Object.entries(attrs || {})) {
|
|
160
|
-
if (k === 'style') node.style.cssText = v; else if (k === 'text') node.textContent = v; else node.setAttribute(k, v);
|
|
161
|
-
}
|
|
162
|
-
for (const child of children || []) node.appendChild(child);
|
|
163
|
-
return node;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
fetch('/api/report').then(r => r.json()).then(report => {
|
|
167
|
-
const byTier = { 'hard-failure': [], 'regression': [], 'heal': [], 'advisory': [] };
|
|
168
|
-
for (const f of report.findings) (byTier[f.kind] || byTier['advisory']).push(f);
|
|
169
|
-
for (const h of report.heals) byTier['heal'].push({ title: 'Flow "' + h.flowId + '" healed', detail: h.summary, flowId: h.flowId, evidence: h.evidence });
|
|
170
|
-
|
|
171
|
-
const nHard = byTier['hard-failure'].length, nReg = byTier['regression'].length;
|
|
172
|
-
const nHeal = byTier['heal'].length, nAdv = byTier['advisory'].length;
|
|
173
|
-
|
|
174
|
-
document.getElementById('runid').textContent = report.runId;
|
|
175
|
-
document.getElementById('stamp').textContent = 'effort ' + report.effort + ' · ' + report.startedAt;
|
|
176
|
-
|
|
177
|
-
const durationS = report.finishedAt
|
|
178
|
-
? ((new Date(report.finishedAt) - new Date(report.startedAt)) / 1000).toFixed(1) + 's'
|
|
179
|
-
: '—';
|
|
180
|
-
|
|
181
|
-
let text, color;
|
|
182
|
-
if (nHard > 0) { text = nHard + ' hard failure' + (nHard > 1 ? 's' : ''); color = 'var(--hard)'; }
|
|
183
|
-
else if (nReg > 0) { text = nReg + ' regression' + (nReg > 1 ? 's' : ''); color = 'var(--regression)'; }
|
|
184
|
-
else if (nHeal > 0) { text = 'passing, ' + nHeal + ' heal' + (nHeal > 1 ? 's' : '') + ' to verify'; color = 'var(--heal)'; }
|
|
185
|
-
else { text = 'all clear'; color = 'var(--ok)'; }
|
|
186
|
-
|
|
187
|
-
const verdict = document.getElementById('verdict');
|
|
188
|
-
verdict.style.setProperty('--verdict-color', color);
|
|
189
|
-
verdict.appendChild(el('h1', {}, [el('span', { class: 'lamp' }), el('span', { text })]));
|
|
190
|
-
const sub = el('div', { class: 'sub' });
|
|
191
|
-
sub.innerHTML = 'target <b></b> · <b>' + report.flowsReplayed + '</b> flows replayed · <b>'
|
|
192
|
-
+ report.flowsDiscovered + '</b> discovered · <b>' + durationS + '</b>';
|
|
193
|
-
sub.querySelector('b').textContent = report.target;
|
|
194
|
-
verdict.appendChild(sub);
|
|
195
|
-
|
|
196
|
-
const stats = document.getElementById('stats');
|
|
197
|
-
for (const [kind, tier] of Object.entries(TIERS)) {
|
|
198
|
-
const n = byTier[kind].length;
|
|
199
|
-
stats.appendChild(el('div', { class: 'stat' + (n === 0 ? ' zero' : ''), style: '--stat-color:' + (n > 0 ? tier.color : 'transparent') }, [
|
|
200
|
-
el('div', { class: 'n', text: String(n) }),
|
|
201
|
-
el('div', { class: 'l', text: tier.label }),
|
|
202
|
-
]));
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
const body = document.getElementById('body');
|
|
206
|
-
const total = nHard + nReg + nHeal + nAdv;
|
|
207
|
-
if (total === 0) {
|
|
208
|
-
body.appendChild(el('div', { class: 'allclear' }, [
|
|
209
|
-
el('div', { class: 'mark', text: '✓' }),
|
|
210
|
-
el('h2', { text: 'all clear' }),
|
|
211
|
-
el('p', { text: report.flowsReplayed > 0
|
|
212
|
-
? 'Every known flow replayed successfully. Nothing to act on.'
|
|
213
|
-
: 'No flows in the map yet — the first exploration run will build your baseline.' }),
|
|
214
|
-
]));
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
for (const [kind, tier] of Object.entries(TIERS)) {
|
|
219
|
-
const items = byTier[kind];
|
|
220
|
-
if (items.length === 0) continue;
|
|
221
|
-
const section = el('section', { style: '--tier:' + tier.color });
|
|
222
|
-
section.appendChild(el('h2', {}, [
|
|
223
|
-
el('span', { text: tier.label + ' ' }),
|
|
224
|
-
el('span', { class: 'count', text: String(items.length) }),
|
|
225
|
-
]));
|
|
226
|
-
section.appendChild(el('div', { class: 'explain', text: tier.explain }));
|
|
227
|
-
for (const f of items) {
|
|
228
|
-
const card = el('div', { class: 'card' }, [el('h3', { text: f.title })]);
|
|
229
|
-
if (f.detail) card.appendChild(el('div', { class: 'detail', text: f.detail }));
|
|
230
|
-
if (f.evidence) card.appendChild(el('video', { controls: '', preload: 'metadata', src: '/evidence/' + f.evidence }));
|
|
231
|
-
if (f.flowId) card.appendChild(el('div', { class: 'flowid', text: 'flow: ' + f.flowId }));
|
|
232
|
-
section.appendChild(card);
|
|
233
|
-
}
|
|
234
|
-
body.appendChild(section);
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
</script>
|
|
238
|
-
</body>
|
|
239
|
-
</html>`;
|
|
240
|
-
//# sourceMappingURL=html.js.map
|
package/dist/viewer/html.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/viewer/html.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAwO9B,CAAC"}
|