@chapterdev/mcp-dev-studio 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,54 @@
1
+ // An attempt is one `mcp-dev-studio eval` run, kept with a snapshot of what it tested:
2
+ // every skill's text, every tool's description, the overrides. Comparing two
3
+ // attempts says what changed and whether it helped, without anyone keeping notes.
4
+ /** What the studio was testing right now. */
5
+ export function snapshotOf(surface, skills, overrides) {
6
+ const tools = {};
7
+ for (const t of surface?.tools ?? [])
8
+ if (!overrides[t.name]?.hidden)
9
+ tools[t.name] = overrides[t.name]?.description ?? t.description ?? '';
10
+ return { skills: Object.fromEntries(skills.map((s) => [s.id, s.content])), tools, overrides };
11
+ }
12
+ export function attemptResult(r) {
13
+ const counts = new Map();
14
+ for (const t of r.trials) {
15
+ for (const c of t.checks.filter((x) => !x.pass)) {
16
+ const key = `${c.name}\n${c.detail}`;
17
+ const cur = counts.get(key) ?? { check: c.name, detail: c.detail, runs: 0 };
18
+ cur.runs++;
19
+ counts.set(key, cur);
20
+ }
21
+ if (t.error) {
22
+ const key = `error\n${t.error}`;
23
+ const cur = counts.get(key) ?? { check: 'run error', detail: t.error, runs: 0 };
24
+ cur.runs++;
25
+ counts.set(key, cur);
26
+ }
27
+ }
28
+ const { slug, name, pass, summary, rates, costUsd, checks, error } = r;
29
+ return { slug, name, pass, summary, rates, costUsd, checks, ...(error ? { error } : {}), failures: [...counts.values()].sort((a, b) => b.runs - a.runs), runIds: r.trials.map((t) => t.runId).filter(Boolean) };
30
+ }
31
+ export function changesBetween(before, after) {
32
+ if (!before || !after)
33
+ return { skills: [], tools: [] };
34
+ const diff = (a, b) => [...new Set([...Object.keys(a), ...Object.keys(b)])].filter((k) => a[k] !== b[k]).sort().map((k) => ({ key: k, before: a[k], after: b[k] }));
35
+ return {
36
+ skills: diff(before.skills, after.skills).map(({ key, before, after }) => ({ id: key, before, after })),
37
+ tools: diff(before.tools, after.tools).map(({ key, before, after }) => ({ name: key, before, after })),
38
+ };
39
+ }
40
+ /** Per-test movement between two attempts: 'fixed', 'broke', or how the pass rate moved. */
41
+ export function movement(prev, cur) {
42
+ return cur.results.map((r) => {
43
+ const p = prev?.results.find((x) => x.slug === r.slug);
44
+ const rate = (x) => (x.rates.total ? x.rates.passed / x.rates.total : 0);
45
+ return {
46
+ slug: r.slug,
47
+ name: r.name,
48
+ was: p ? `${p.rates.passed}/${p.rates.total}` : null,
49
+ now: `${r.rates.passed}/${r.rates.total}`,
50
+ change: !p ? 'new' : p.pass === r.pass ? (rate(r) > rate(p) ? 'better' : rate(r) < rate(p) ? 'worse' : 'same') : r.pass ? 'fixed' : 'broke',
51
+ };
52
+ });
53
+ }
54
+ //# sourceMappingURL=attempts.js.map
@@ -0,0 +1,183 @@
1
+ // `mcp-dev-studio eval`: run saved tests in real agents, N runs each, and print how
2
+ // often the agent reached for your server, loaded the skill, and passed.
3
+ //
4
+ // Every run is saved as an attempt (.mcp-dev-studio/evals/<time>.json) with a
5
+ // snapshot of the skills and tool descriptions it tested, so the next run can
6
+ // say what changed and whether it helped. Built for a person reading a table,
7
+ // and for an agent iterating with --json. Exits 1 when a test fails.
8
+ import { runJourney } from './journeys.js';
9
+ import { detectHosts } from '../hosts/index.js';
10
+ import { attemptResult, changesBetween, movement, snapshotOf } from './attempts.js';
11
+ const tty = process.stdout.isTTY && !process.env.NO_COLOR;
12
+ const c = (code) => (s) => (tty ? `\x1b[${code}m${s}\x1b[0m` : s);
13
+ const green = c(32), red = c(31), dim = c(2), bold = c(1), yellow = c(33);
14
+ const strip = (s) => s.replace(/\x1b\[[0-9;]*m/g, '');
15
+ const pad = (s, n, right = false) => {
16
+ const len = strip(s).length;
17
+ return len >= n ? s : right ? ' '.repeat(n - len) + s : s + ' '.repeat(n - len);
18
+ };
19
+ const rate = (k, n) => (k === n ? green : k === 0 ? red : yellow)(`${k}/${n}`);
20
+ export async function runEvalCli(opts) {
21
+ const all = opts.store.journeys();
22
+ const settings = opts.store.settings();
23
+ const detected = await detectHosts(opts.store);
24
+ const wanted = opts.hosts?.length ? opts.hosts : [settings.host];
25
+ const hosts = [];
26
+ for (const id of wanted) {
27
+ let h = detected.find((x) => x.id === id);
28
+ if (!h) {
29
+ console.error(`Unknown host "${id}". Use claude-code, codex or api.`);
30
+ return 2;
31
+ }
32
+ // No host named: use the saved one, or whichever agent is installed if that one isn't.
33
+ if (!h.available && !opts.hosts?.length)
34
+ h = detected.find((x) => x.id !== 'api' && x.available) ?? h;
35
+ if (!h.available) {
36
+ console.error(`${h.label} isn't available: ${h.detail}${h.fix ? `\n ${h.fix}` : ''}`);
37
+ return 2;
38
+ }
39
+ hosts.push(h);
40
+ }
41
+ const out = [];
42
+ let failedAny = false;
43
+ for (const host of hosts) {
44
+ const previous = opts.store.attempts().find((a) => a.hostId === host.id);
45
+ let journeys = opts.filter ? all.filter((j) => j.slug.includes(opts.filter) || j.name.toLowerCase().includes(opts.filter.toLowerCase())) : all;
46
+ if (opts.failed) {
47
+ const failing = new Set(previous?.results.filter((r) => !r.pass).map((r) => r.slug) ?? []);
48
+ journeys = journeys.filter((j) => failing.has(j.slug));
49
+ }
50
+ if (!journeys.length) {
51
+ const why = opts.failed ? `Nothing failed in the last ${host.label} attempt.` : all.length ? `No tests match "${opts.filter}".` : `No tests in ${opts.store.root}/journeys. Save one from the Playground, or write one (see \`mcp-dev-studio skill\`).`;
52
+ if (opts.json)
53
+ out.push({ host: host.id, skipped: why });
54
+ else
55
+ console.error(why);
56
+ if (!opts.failed)
57
+ return 2;
58
+ continue;
59
+ }
60
+ const { attempt, code } = await runOne(opts, host, journeys, previous);
61
+ if (code)
62
+ failedAny = true;
63
+ if (opts.json) {
64
+ const changes = changesBetween(previous?.snapshot, attempt.snapshot);
65
+ out.push({
66
+ attempt: { id: attempt.id, at: attempt.at, note: attempt.note, host: attempt.host, passed: attempt.results.filter((r) => r.pass).length, total: attempt.results.length },
67
+ sinceLastAttempt: previous
68
+ ? { attempt: previous.id, note: previous.note, changed: { skills: changes.skills.map((s) => s.id), tools: changes.tools.map((t) => t.name) }, tests: movement(previous, attempt) }
69
+ : null,
70
+ tests: attempt.results.map((r) => ({ slug: r.slug, name: r.name, pass: r.pass, rates: r.rates, failures: r.failures, error: r.error, transcripts: r.runIds.map((id) => `${opts.store.root}/runs/${id}.json`) })),
71
+ });
72
+ }
73
+ }
74
+ if (opts.json)
75
+ console.log(JSON.stringify(out.length === 1 ? out[0] : out, null, 2));
76
+ return failedAny ? 1 : 0;
77
+ }
78
+ async function runOne(opts, host, journeys, previous) {
79
+ const settings = opts.store.settings();
80
+ const modelOf = (id) => (id === 'codex' ? settings.codexModel : id === 'claude-code' ? settings.hostModel : settings.model);
81
+ const prevTokens = new Map(previous?.results.filter((r) => !r.error && r.summary.totalTokens > 0).map((r) => [r.slug, r]) ?? []);
82
+ const server = opts.conn.surface?.server.name ?? 'server';
83
+ const hostLabel = `${host.label}${modelOf(host.id) ? ` ${modelOf(host.id)}` : ''}`;
84
+ if (!opts.json)
85
+ console.log(`\n${bold('mcp-dev-studio eval')} ${dim(`${server} in ${hostLabel} · ${journeys.length} test${journeys.length > 1 ? 's' : ''} × ${opts.trials ?? settings.trials} runs${opts.note ? ` · ${opts.note}` : ''}`)}\n`);
86
+ // What this attempt tests, captured before running so mid-run edits don't blur it.
87
+ const snapshot = snapshotOf(opts.conn.surface, opts.skills?.list() ?? [], opts.store.overrides());
88
+ // An open studio follows this run live (Tests page), via .mcp-dev-studio/live/.
89
+ const trials = opts.trials ?? settings.trials;
90
+ const now = () => new Date().toISOString();
91
+ const live = {
92
+ id: `${now().replace(/[:.]/g, '-')}-${process.pid}-${host.id}`,
93
+ source: process.env.CI ? 'ci' : 'cli',
94
+ host: host.label,
95
+ startedAt: now(),
96
+ updatedAt: now(),
97
+ done: false,
98
+ tests: journeys.map((j) => ({ slug: j.slug, name: j.name, total: j.trials ?? trials, trials: [], state: 'waiting' })),
99
+ };
100
+ const publish = () => {
101
+ live.updatedAt = now();
102
+ try {
103
+ opts.store.writeLive(live);
104
+ }
105
+ catch {
106
+ /* the run matters more than the live view */
107
+ }
108
+ };
109
+ publish();
110
+ const results = [];
111
+ for (const [i, j] of journeys.entries()) {
112
+ if (!opts.json)
113
+ process.stdout.write(dim(` ${j.name} `));
114
+ const lt = live.tests[i];
115
+ lt.state = 'running';
116
+ publish();
117
+ const r = await runJourney(j, {
118
+ conn: opts.conn,
119
+ store: opts.store,
120
+ skills: opts.skills,
121
+ trials: opts.trials,
122
+ host: host.id,
123
+ onTrial: (t) => {
124
+ if (!opts.json)
125
+ process.stdout.write(t.pass ? green('●') : red('●'));
126
+ lt.trials.push(t.pass);
127
+ publish();
128
+ },
129
+ });
130
+ Object.assign(lt, { state: 'done', pass: r.pass, total: r.trials.length, ...(r.error ? { error: r.error } : {}) });
131
+ publish();
132
+ results.push(r);
133
+ // Same record the UI writes, so CLI runs show up on the Tests page.
134
+ opts.store.saveJourneyResult(j.slug, { ...r, trials: r.trials.map((t) => ({ ...t, events: undefined })), at: now() });
135
+ if (!opts.json)
136
+ process.stdout.write(dim(` ${(r.durationMs / 1000).toFixed(0)}s\n`));
137
+ }
138
+ const attempt = {
139
+ id: '',
140
+ at: now(),
141
+ ...(opts.note ? { note: opts.note } : {}),
142
+ source: process.env.CI ? 'ci' : 'cli',
143
+ server: `${server}@${opts.conn.surface?.server.version}`,
144
+ host: hostLabel,
145
+ hostId: host.id,
146
+ ...(opts.filter || opts.failed ? { filter: [opts.filter, opts.failed && 'failed'].filter(Boolean).join(' ') } : {}),
147
+ results: results.map(attemptResult),
148
+ snapshot,
149
+ };
150
+ attempt.id = opts.store.saveEval(attempt);
151
+ live.done = true;
152
+ publish();
153
+ if (!opts.json)
154
+ printTable(attempt, previous, prevTokens, server);
155
+ return { attempt, code: results.every((r) => r.pass) ? 0 : 1 };
156
+ }
157
+ function printTable(attempt, previous, prevTokens, server) {
158
+ const head = ['', 'Test', `Used ${server}`, 'Skill', 'Passed', 'Tokens/run', 'Δ', 'Cost', 'Most common failure'];
159
+ const rows = attempt.results.map((r) => {
160
+ const p = prevTokens.get(r.slug);
161
+ const delta = p ? r.summary.totalTokens - p.summary.totalTokens : undefined;
162
+ const deltaStr = delta === undefined ? dim('new') : delta === 0 ? dim('±0') : (delta > 0 ? red : green)(`${delta > 0 ? '+' : ''}${Math.round((delta / p.summary.totalTokens) * 100)}%`);
163
+ const top = r.failures[0];
164
+ const failed = r.error ? red(r.error) : top ? yellow(truncate(`${top.check}: ${top.detail}`, 70)) : dim('—');
165
+ const skill = r.rates.skillLoaded !== undefined ? rate(r.rates.skillLoaded, r.rates.total) : r.rates.skillAvoided !== undefined ? `${rate(r.rates.skillAvoided, r.rates.total)} ${dim('skipped')}` : dim('—');
166
+ return [r.pass ? green('PASS') : red('FAIL'), truncate(r.name, 48), rate(r.rates.usedServer, r.rates.total), skill, rate(r.rates.passed, r.rates.total), r.summary.totalTokens.toLocaleString(), deltaStr, usd(r.costUsd), failed];
167
+ });
168
+ const widths = head.map((h, i) => Math.max(strip(h).length, ...rows.map((r) => strip(r[i]).length)));
169
+ const line = (cells) => ' ' + cells.map((cell, i) => pad(cell, widths[i], i >= 2 && i <= 7)).join(' ');
170
+ console.log('\n' + dim(line(head)));
171
+ for (const r of rows)
172
+ console.log(line(r));
173
+ const passed = attempt.results.filter((r) => r.pass).length;
174
+ const cost = attempt.results.reduce((a, r) => a + r.costUsd, 0);
175
+ const moved = movement(previous, attempt).filter((m) => m.change === 'fixed' || m.change === 'broke');
176
+ console.log(`\n ${(passed === attempt.results.length ? green : red)(`${passed}/${attempt.results.length} tests passed`)} ${dim(`· ${usd(cost)} spent · attempt ${attempt.id}`)}`);
177
+ for (const m of moved)
178
+ console.log(` ${m.change === 'fixed' ? green('fixed') : red('broke')} ${m.name} ${dim(`(${m.was} → ${m.now})`)}`);
179
+ console.log('');
180
+ }
181
+ const usd = (x) => (x < 0.1 ? `$${x.toFixed(3)}` : `$${x.toFixed(2)}`);
182
+ const truncate = (s, n) => (s.length > n ? s.slice(0, n - 1) + '…' : s);
183
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1,161 @@
1
+ // Tests ("journeys"): a natural prompt (or multi-turn script) run N times in a
2
+ // real host, with checks. Agents are non-deterministic, so every result is a
3
+ // rate: did it reach for your server, load the skill, and get it right?
4
+ import { exec } from 'node:child_process';
5
+ import { parseFrontmatter } from '../skills/skills.js';
6
+ import { addSummaries, emptySummary } from '../agent/runner.js';
7
+ import { createSession, judge } from '../hosts/index.js';
8
+ export function slugify(s) {
9
+ return s.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '').slice(0, 60) || 'journey';
10
+ }
11
+ export function checkAssertions(j, s, verdict, serverName, sequence = s.toolsUsed) {
12
+ const a = j.assertions;
13
+ const checks = [];
14
+ const host = s.host;
15
+ if (a.usesServer !== false) {
16
+ const other = host?.otherTools.map((o) => `${o.name}${o.denied ? ' (blocked)' : ''}`).join(', ');
17
+ checks.push({ name: `uses ${serverName}`, pass: !!host?.usedServer || s.toolCalls > 0, detail: host?.usedServer || s.toolCalls ? `${s.toolCalls} call${s.toolCalls === 1 ? '' : 's'}` : other ? `reached for ${other} instead` : 'never called it' });
18
+ }
19
+ for (const k of a.expectSkills ?? []) {
20
+ const loaded = host?.skillsLoaded.includes(k) ?? false;
21
+ checks.push({ name: `loads skill ${k}`, pass: loaded, detail: loaded ? 'loaded' : host?.skillsLoaded.length ? `loaded ${host.skillsLoaded.join(', ')} instead` : 'no skill loaded' });
22
+ }
23
+ for (const k of a.forbidSkills ?? []) {
24
+ const loaded = host?.skillsLoaded.includes(k) ?? false;
25
+ checks.push({ name: `doesn’t load skill ${k}`, pass: !loaded, detail: loaded ? 'loaded it anyway' : 'not loaded' });
26
+ }
27
+ for (const t of a.expectTools ?? [])
28
+ checks.push({ name: `calls ${t}`, pass: sequence.includes(t), detail: sequence.includes(t) ? 'called' : `never called (used: ${sequence.join(', ') || 'nothing'})` });
29
+ for (const t of a.forbidTools ?? [])
30
+ checks.push({ name: `never calls ${t}`, pass: !sequence.includes(t), detail: sequence.includes(t) ? 'was called' : 'not called' });
31
+ if (a.maxTurns !== undefined)
32
+ checks.push({ name: `≤ ${a.maxTurns} steps`, pass: s.modelCalls <= a.maxTurns, detail: `${s.modelCalls} steps` });
33
+ if (a.maxToolCalls !== undefined)
34
+ checks.push({ name: `≤ ${a.maxToolCalls} tool calls`, pass: s.toolCalls <= a.maxToolCalls, detail: `${s.toolCalls} calls` });
35
+ if (a.maxTokens !== undefined)
36
+ checks.push({ name: `≤ ${a.maxTokens.toLocaleString()} tokens`, pass: s.totalTokens <= a.maxTokens, detail: `${s.totalTokens.toLocaleString()} tokens` });
37
+ if (a.judge)
38
+ checks.push({ name: 'judge', pass: !!verdict?.pass, detail: verdict ? verdict.reason : 'judge did not run' });
39
+ if (['error', 'refusal', 'max_turns', 'budget'].includes(s.stopReason))
40
+ checks.push({ name: 'finishes', pass: false, detail: `stopped: ${s.stopReason}` });
41
+ return checks;
42
+ }
43
+ /** One full conversation in the host, then (optionally) a judge. */
44
+ /** Restore fixtures for servers whose data lives outside the process. */
45
+ export function runReset(command, cwd) {
46
+ return new Promise((resolve, reject) => exec(command, { cwd, timeout: 120_000 }, (err, _out, stderr) => (err ? reject(new Error(`Reset command failed: ${(stderr || err.message).trim().slice(-300)}`)) : resolve())));
47
+ }
48
+ export async function runTrial(spec, deps, onEvent = () => { }) {
49
+ const t0 = Date.now();
50
+ // Each session already gets a fresh server process; this covers external state (DBs, APIs).
51
+ const reset = deps.store.settings().resetCommand.trim();
52
+ if (reset)
53
+ await runReset(reset, deps.conn.target.kind === 'stdio' ? (deps.conn.target.cwd ?? process.cwd()) : process.cwd());
54
+ const session = createSession({ host: spec.host, skills: spec.skills, overrides: spec.overrides, label: spec.label }, { ...deps, source: 'eval' });
55
+ let error;
56
+ try {
57
+ for (const p of spec.prompts) {
58
+ await session.send(p, onEvent);
59
+ if (session.summary.stopReason === 'error')
60
+ break;
61
+ }
62
+ }
63
+ finally {
64
+ await session.close();
65
+ }
66
+ const runErr = session.events.find((e) => e.type === 'error');
67
+ let verdict;
68
+ if (spec.judge && !runErr) {
69
+ try {
70
+ verdict = await judge(session, spec.judge, deps.store);
71
+ const e = { type: 'judge', verdict };
72
+ session.events.push(e);
73
+ onEvent(e);
74
+ }
75
+ catch (e) {
76
+ error = `judge failed: ${e.message}`;
77
+ }
78
+ }
79
+ return { session, verdict, error: runErr?.type === 'error' ? runErr.message : error, durationMs: Date.now() - t0 };
80
+ }
81
+ export function loadSkills(ids, skills, override) {
82
+ const all = ids.includes('*') ? (skills?.list().map((s) => s.id) ?? []) : ids;
83
+ if (override && !all.includes(override.id))
84
+ all.push(override.id);
85
+ return all.flatMap((id) => {
86
+ if (override && id === override.id) {
87
+ const name = String(parseFrontmatter(override.content).data.name || id.split('/')[0]);
88
+ return [{ name, content: override.content }];
89
+ }
90
+ try {
91
+ const s = skills?.load(id);
92
+ return s ? [{ name: s.name, content: s.content }] : [];
93
+ }
94
+ catch {
95
+ return [];
96
+ }
97
+ });
98
+ }
99
+ export function ratesOf(trials, expectSkills, forbidSkills) {
100
+ return {
101
+ total: trials.length,
102
+ usedServer: trials.filter((t) => t.summary.host?.usedServer || t.summary.toolCalls > 0).length,
103
+ skillLoaded: expectSkills?.length ? trials.filter((t) => expectSkills.every((k) => t.summary.host?.skillsLoaded.includes(k))).length : undefined,
104
+ skillAvoided: forbidSkills?.length ? trials.filter((t) => !forbidSkills.some((k) => t.summary.host?.skillsLoaded.includes(k))).length : undefined,
105
+ passed: trials.filter((t) => t.pass).length,
106
+ };
107
+ }
108
+ export function average(xs) {
109
+ if (!xs.length)
110
+ return emptySummary();
111
+ const sum = addSummaries(xs);
112
+ const n = xs.length;
113
+ return { ...sum, modelCalls: Math.round(sum.modelCalls / n), toolCalls: Math.round(sum.toolCalls / n), toolErrors: Math.round(sum.toolErrors / n), inputTokens: Math.round(sum.inputTokens / n), outputTokens: Math.round(sum.outputTokens / n), totalTokens: Math.round(sum.totalTokens / n), latencyMs: Math.round(sum.latencyMs / n) };
114
+ }
115
+ export async function runJourney(j, deps) {
116
+ const t0 = Date.now();
117
+ const settings = deps.store.settings();
118
+ const host = deps.host ?? j.host ?? settings.host;
119
+ const n = Math.max(1, deps.trials ?? j.trials ?? settings.trials);
120
+ const serverName = deps.conn.surface?.server.name ?? 'your server';
121
+ const skills = loadSkills(j.skills ?? [], deps.skills, deps.skillOverride);
122
+ const results = new Array(n);
123
+ let next = 0;
124
+ const worker = async () => {
125
+ while (next < n) {
126
+ const i = next++;
127
+ try {
128
+ const r = await runTrial({ host, prompts: j.prompts, skills, overrides: deps.store.overrides(), judge: j.assertions.judge, label: j.slug }, deps, (e) => deps.onEvent?.(i, e));
129
+ const sequence = r.session.events.flatMap((e) => (e.type === 'tool_start' && e.kind === 'server' ? [e.name] : []));
130
+ const checks = checkAssertions(j, r.session.summary, r.verdict, serverName, sequence);
131
+ const trial = { index: i, pass: checks.every((c) => c.pass) && !r.error, checks, summary: r.session.summary, verdict: r.verdict, error: r.error, runId: r.session.id, durationMs: r.durationMs, events: r.session.events };
132
+ deps.store.saveRun(r.session.id, { ...r.session.toJSON(), journey: j.slug, trial: i, checks, verdict: r.verdict });
133
+ results[i] = trial;
134
+ deps.onTrial?.(trial);
135
+ }
136
+ catch (e) {
137
+ results[i] = { index: i, pass: false, checks: [], summary: emptySummary(), error: e.message, runId: '', durationMs: 0 };
138
+ deps.onTrial?.(results[i]);
139
+ }
140
+ }
141
+ };
142
+ // Two hosts at a time: real processes, real servers.
143
+ await Promise.all(Array.from({ length: Math.min(2, n) }, worker));
144
+ const rates = ratesOf(results, j.assertions.expectSkills, j.assertions.forbidSkills);
145
+ const need = Math.min(n, j.assertions.minPasses ?? n);
146
+ const firstFail = results.find((t) => !t.pass);
147
+ return {
148
+ slug: j.slug,
149
+ name: j.name,
150
+ host,
151
+ pass: rates.passed >= need,
152
+ rates,
153
+ trials: results,
154
+ summary: average(results.map((t) => t.summary)),
155
+ costUsd: results.reduce((a, t) => a + (t.summary.host?.costUsd ?? 0), 0),
156
+ checks: firstFail?.checks ?? results[0]?.checks ?? [],
157
+ error: results.every((t) => t.error) ? results[0]?.error : undefined,
158
+ durationMs: Date.now() - t0,
159
+ };
160
+ }
161
+ //# sourceMappingURL=journeys.js.map