@ancha-labs/cli 0.4.21 → 0.4.22
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/lib/ancha.mjs +6028 -5292
- package/lib/assets/docs/compare.md +2 -0
- package/lib/assets/docs/explain.md +3 -0
- package/lib/assets/docs/scenes.md +15 -0
- package/lib/assets/docs/tools.md +44 -0
- package/lib/assets/harbor/companion.mjs +3592 -3157
- package/lib/assets/ui/app.js +82 -53
- package/lib/mcp-entry.mjs +6 -1
- package/lib/worker.mjs +3895 -3400
- package/lib/world-server.mjs +3574 -3139
- package/package.json +1 -1
package/lib/assets/ui/app.js
CHANGED
|
@@ -162,7 +162,7 @@ function seedData(scene, selected) {
|
|
|
162
162
|
if (selected === "pagerduty") body2 = `<div class="seed-cards">${(s.services ?? []).map((v) => `<article class="record"><span class="small muted">Service</span><h3>${h(v.name)}</h3><p>${h(label2(v.escalation_policy))}</p>${(s.escalation_policies ?? []).filter((p) => label2(v.escalation_policy) === label2("$" + p.ref)).map((p) => `<ol>${(p.levels ?? []).map((l) => `<li>${h((l.targets ?? []).map(label2).join(", "))}${l.after ? ` \xB7 escalate after ${h(l.after)}` : ""}</li>`).join("")}</ol>`).join("")}${v.slack_channel ? `<p class="small muted">Slack \xB7 #${h(label2(v.slack_channel))}</p>` : ""}</article>`).join("")}${(s.incidents ?? []).map((i) => `<article class="record">${badge(i.status)}<h3>${h(i.title)}</h3><p>${h(label2(i.service))}</p></article>`).join("")}</div>`;
|
|
163
163
|
return `<h2>${h(toolName(selected))}</h2>${body2 || empty("No data seeded")}${details("Full starting data", s)}${selected === "datadog" ? details("Generated telemetry definitions", { metrics: scene.world_rules?.metrics, logs: scene.world_rules?.logs, monitors: scene.world_rules?.monitors }) : ""}`;
|
|
164
164
|
}
|
|
165
|
-
var countLabel = (
|
|
165
|
+
var countLabel = (count3, noun, plural = noun + "s") => `${count3} ${count3 === 1 ? noun : plural}`;
|
|
166
166
|
function agentLabel(agent, all) {
|
|
167
167
|
const twins = all.filter((other) => other.name === agent.name);
|
|
168
168
|
if (twins.length < 2) return String(agent.name);
|
|
@@ -535,7 +535,7 @@ function shortId(id, keep = 8) {
|
|
|
535
535
|
}
|
|
536
536
|
var facts = (items, label2 = "Facts") => `<dl class="c-facts" aria-label="${h(label2)}">${items.map((f) => `<div><dt>${h(f.label)}</dt><dd class="c-fact-value${f.mono ? " mono" : ""}"${f.title ? ` title="${h(f.title)}"` : ""}>${f.html ?? h(f.value)}</dd>${f.sub ? `<dd class="c-fact-sub">${h(f.sub)}</dd>` : ""}</div>`).join("")}</dl>`;
|
|
537
537
|
var stateCard = (title2, bodyHtml = "", actionHtml = "", kind = "empty") => `<section class="c-state c-state-${h(kind)}"><strong>${h(title2)}</strong>${bodyHtml ? `<p>${bodyHtml}</p>` : ""}${actionHtml}</section>`;
|
|
538
|
-
var skeletonRows = (
|
|
538
|
+
var skeletonRows = (count3) => `<div class="c-skeleton" aria-busy="true" aria-label="Loading">${Array.from({ length: count3 }, () => "<div><i></i><i></i><i></i></div>").join("")}</div>`;
|
|
539
539
|
var MINUTE = 6e4;
|
|
540
540
|
var HOUR2 = 36e5;
|
|
541
541
|
var DAY2 = 864e5;
|
|
@@ -581,6 +581,28 @@ function duration(ms) {
|
|
|
581
581
|
return `${Math.floor(s / 3600)} h ${String(Math.floor(s / 60) % 60).padStart(2, "0")} m`;
|
|
582
582
|
}
|
|
583
583
|
|
|
584
|
+
// cloud/shared/outcome-counts.mjs
|
|
585
|
+
var count = (value) => Number.isSafeInteger(value) && value >= 0 ? value : void 0;
|
|
586
|
+
function attemptOutcome(attempt, graded) {
|
|
587
|
+
if (attempt.valid === false || attempt.exit === "invalid" || attempt.outcome === "invalid") return "invalid";
|
|
588
|
+
if (attempt.outcome === "skipped" || attempt.outcome === "xfailed") return "skipped";
|
|
589
|
+
if (graded === false || attempt.graded === false || attempt.outcome === "ungraded") return "ungraded";
|
|
590
|
+
if (attempt.outcome === "passed" || attempt.outcome === "failed") return attempt.outcome;
|
|
591
|
+
if (typeof attempt.passed === "boolean") return attempt.passed ? "passed" : "failed";
|
|
592
|
+
return ["completed", "error", "stopped"].includes(attempt.status) ? "ungraded" : "pending";
|
|
593
|
+
}
|
|
594
|
+
function countAttempts(attempts, requested, graded) {
|
|
595
|
+
const counts = { requested: Math.max(count(requested) ?? attempts.length, attempts.length), completed: 0, valid: 0, passed: 0, failed: 0, invalid: 0, ungraded: 0, skipped: 0, pending: 0 };
|
|
596
|
+
for (const attempt of attempts) {
|
|
597
|
+
const outcome = attemptOutcome(attempt, graded);
|
|
598
|
+
counts[outcome]++;
|
|
599
|
+
if (outcome !== "pending") counts.completed++;
|
|
600
|
+
if (["passed", "failed", "ungraded"].includes(outcome)) counts.valid++;
|
|
601
|
+
}
|
|
602
|
+
counts.pending += counts.requested - attempts.length;
|
|
603
|
+
return counts;
|
|
604
|
+
}
|
|
605
|
+
|
|
584
606
|
// frontend/src/runs-page.ts
|
|
585
607
|
var SOURCES = { console: "Console", cli: "CLI", ci: "CI", cloud: "Cloud" };
|
|
586
608
|
var TARGETS = { local: "Local", docker: "Docker", hosted: "Hosted", cloud: "Cloud" };
|
|
@@ -602,12 +624,9 @@ function runCounts(run) {
|
|
|
602
624
|
const verified = summary?.verdictVersion === 2 ? summary.counts : void 0;
|
|
603
625
|
const declared = tasks.length && tasks.every((task) => Number.isSafeInteger(task.attempts) && task.attempts > 0) ? tasks.reduce((sum2, task) => sum2 + task.attempts, 0) : void 0;
|
|
604
626
|
const requested = verified?.requested ?? declared;
|
|
605
|
-
const
|
|
606
|
-
const
|
|
607
|
-
|
|
608
|
-
const failed = attempts.filter((a) => a.outcome === "failed").length;
|
|
609
|
-
const graded = typeof summary?.pass_rate === "number" || attempts.some((a) => ["passed", "failed"].includes(a.outcome));
|
|
610
|
-
return { requested, total: requested ?? attempts.length, passed, failed, invalid, skipped, graded, finished: batchCounts(run).finished };
|
|
627
|
+
const counts = countAttempts(attempts, requested, summary?.graded);
|
|
628
|
+
const graded = counts.passed + counts.failed > 0;
|
|
629
|
+
return { ...counts, requested, total: counts.requested, graded, finished: batchCounts(run).finished };
|
|
611
630
|
}
|
|
612
631
|
function runStatus(run) {
|
|
613
632
|
if (run.status === "queued") return "queued";
|
|
@@ -630,8 +649,8 @@ var productionBadge = (text2, tone2 = "neutral") => `<span class="k-badge ${tone
|
|
|
630
649
|
function productionTag(reproduction) {
|
|
631
650
|
const rows3 = Array.isArray(reproduction) ? reproduction.filter((r) => r && typeof r === "object") : [];
|
|
632
651
|
if (!rows3.length) return "";
|
|
633
|
-
const
|
|
634
|
-
const again =
|
|
652
|
+
const count3 = (verdict) => rows3.filter((r) => r.verdict === verdict).length;
|
|
653
|
+
const again = count3("reproduced") + count3("partly") + count3("crashed"), fixed = count3("not-reproduced"), differs = count3("differs");
|
|
635
654
|
if (rows3.length === 1) {
|
|
636
655
|
const [text2, tone2] = { reproduced: ["Same failure", "fail"], partly: ["Partly the same", "fail"], crashed: ["Agent crashed", "fail"], "not-reproduced": ["Fixed", "pass"], matches: ["Matches production", "pass"], differs: ["New failure", "warn"], unknown: ["Production ungraded", "neutral"], ungraded: ["Not compared", "neutral"] }[String(rows3[0].verdict)] ?? ["Not compared", "neutral"];
|
|
637
656
|
return productionBadge(text2, tone2);
|
|
@@ -639,21 +658,27 @@ function productionTag(reproduction) {
|
|
|
639
658
|
if (again) return productionBadge(`${again} of ${rows3.length} fail again`, "fail");
|
|
640
659
|
if (differs) return productionBadge(`${differs} new ${differs === 1 ? "failure" : "failures"}`, "warn");
|
|
641
660
|
if (fixed) return productionBadge(`${fixed} of ${rows3.length} fixed`, "pass");
|
|
642
|
-
return
|
|
661
|
+
return count3("matches") === rows3.length ? productionBadge("Matches production", "pass") : productionBadge("Not compared", "neutral");
|
|
643
662
|
}
|
|
644
663
|
function baselineNote(run) {
|
|
645
664
|
const comparison = run.comparison;
|
|
646
665
|
if (!comparison || !Array.isArray(comparison.scenes)) return void 0;
|
|
647
666
|
const name = comparison.baselineRunId ? `vs ${shortId(String(comparison.baselineRunId))}` : "vs baseline";
|
|
667
|
+
const delta = comparison.scenes.length === 1 ? Number(comparison.scenes[0].delta) : NaN;
|
|
668
|
+
const rounded = Math.round(Math.abs(delta) * 100);
|
|
669
|
+
const points = Number.isFinite(delta) ? delta === 0 ? "0 pts" : `${delta > 0 ? "+" : "\u2212"}${rounded ? `${rounded} pts` : "<1 pt"}` : "";
|
|
670
|
+
if (comparison.regressed) {
|
|
671
|
+
const checks2 = (comparison.droppedChecks ?? []).map((check) => `${comparison.scenes.length > 1 ? `${check.sceneId} / ` : ""}${check.check}: ${check.before.passed}/${check.before.total} \u2192 ${check.after.passed}/${check.after.total}`);
|
|
672
|
+
return { text: `${["regressed", ...checks2, points].filter(Boolean).join(" \xB7 ")} ${name}`, tone: "fail" };
|
|
673
|
+
}
|
|
648
674
|
if (comparison.scenes.length === 1) {
|
|
649
|
-
|
|
650
|
-
if (Number.isFinite(delta)) return { text: delta ? `${delta > 0 ? "+" : "\u2212"}${Math.abs(delta)} pts ${name}` : `no change ${name}`, tone: delta > 0 ? "pass" : delta < 0 ? "fail" : "neutral" };
|
|
675
|
+
if (Number.isFinite(delta)) return { text: delta ? `${points} ${name}` : `no change ${name}`, tone: delta > 0 ? "pass" : delta < 0 ? "fail" : "neutral" };
|
|
651
676
|
}
|
|
652
|
-
return
|
|
677
|
+
return { text: `held ${name}`, tone: "neutral" };
|
|
653
678
|
}
|
|
654
679
|
function attemptStates(run) {
|
|
655
680
|
const attempts = run.attempts ?? [], c = runCounts(run);
|
|
656
|
-
const states = attempts.map((a) => ["passed", "failed", "invalid", "skipped"].includes(a.outcome) ? a.outcome : ["running", "starting"].includes(a.status) ? "running" : a.status === "queued" ? "queued" : terminal(a.status) ? "done" : "queued");
|
|
681
|
+
const states = attempts.map((a) => ["passed", "failed", "invalid", "skipped", "ungraded"].includes(a.outcome) ? a.outcome : ["running", "starting"].includes(a.status) ? "running" : a.status === "queued" ? "queued" : terminal(a.status) ? "done" : "queued");
|
|
657
682
|
while (states.length < c.total) states.push("queued");
|
|
658
683
|
return states;
|
|
659
684
|
}
|
|
@@ -677,16 +702,20 @@ function attemptSquares(states, links = [], labels = []) {
|
|
|
677
702
|
return links[i] ? `<a ${attrs} href="${h(links[i])}" data-nav></a>` : `<span ${attrs}></span>`;
|
|
678
703
|
}).join("")}</span>`;
|
|
679
704
|
}
|
|
680
|
-
function row(item, now, compared) {
|
|
705
|
+
function row(item, now, compared, references) {
|
|
681
706
|
const run = item.run, c = runCounts(run), baseline = baselineNote(run);
|
|
707
|
+
const baselineId = run.comparison?.baselineRunId;
|
|
708
|
+
const baselineText = baseline ? `<span class="k-${baseline.tone === "fail" ? "fail-text" : baseline.tone === "pass" ? "pass-text" : "muted"}">${h(baseline.text)}</span>` : "\u2014";
|
|
709
|
+
const baselineLink = baseline && baselineId ? `<a href="/playgrounds/${encodeURIComponent(String(baselineId))}" data-nav>${baselineText}</a>${references.get(String(baselineId))?.origin?.branch === "main" ? '<span class="k-meta"> \xB7 main</span>' : ""}` : baselineText;
|
|
682
710
|
const attemptLinks = whereKey(run.origin) === "cloud" && !terminal(run.status) ? [] : (run.attempts ?? []).map((a) => a.id && a.taskId ? `/playgrounds/${encodeURIComponent(String(run.id))}?task=${encodeURIComponent(String(a.taskId))}&attempt=${encodeURIComponent(String(a.id))}` : void 0);
|
|
683
711
|
const pending = item.status === "queued" ? queueLabel(run.queue) || "Queued" : item.status === "running" ? "Graded as attempts finish" : "";
|
|
684
|
-
const note = [pending, c.graded && !c.requested ? "Rerun to record requested attempts" : "", c.invalid ? `${c.invalid} invalid` : "", c.skipped ? `${c.skipped} skipped` : "", !c.graded && !pending && !c.invalid && !c.skipped ? "No checks evaluated" : ""].filter(Boolean).join(" \xB7 ");
|
|
685
|
-
return `<tr><td class="wrap"><a class="rt-row" href="/playgrounds/${encodeURIComponent(String(run.id))}" data-nav><span class="rt-result"><span class="c-${item.status}">${resultBadge(item.status)}</span></span><span class="k-name">${h(run.origin?.branch
|
|
712
|
+
const note = [pending, c.graded && !c.requested ? "Rerun to record requested attempts" : "", c.invalid ? `${c.invalid} invalid` : "", c.skipped ? `${c.skipped} skipped` : "", c.ungraded ? `${c.ungraded} ungraded` : "", !c.graded && !pending && !c.invalid && !c.skipped ? "No checks evaluated" : ""].filter(Boolean).join(" \xB7 ");
|
|
713
|
+
return `<tr><td class="wrap"><a class="rt-row" href="/playgrounds/${encodeURIComponent(String(run.id))}" data-nav><span class="rt-result"><span class="c-${item.status}">${resultBadge(item.status)}</span></span><span class="k-name">${h(item.title)}</span>${run.origin?.branch ? `<span class="k-meta">${h(run.origin.branch)}</span>` : ""}<span class="k-id">#${h(shortId(String(run.id)))}</span></a></td><td class="wrap"><span class="k-name">${h(item.agent || "\u2014")}</span>${item.command ? `<div class="k-id" title="${h(item.command)}">${h(item.command)}</div>` : ""}</td><td>${attemptSquares(attemptStates(run), attemptLinks)}<div class="k-meta">${h(`${c.finished} / ${c.total} done`)}</div></td><td class="num">${c.graded && c.requested ? `${c.passed}/${c.requested}` : "\u2014"}${note ? `<div class="k-meta">${h(note)}</div>` : ""}</td>` + (compared ? `<td>${baselineLink}</td>` : "") + `<td class="wrap k-meta">${h(originLabel(run.origin) || "Console")}</td><td class="wrap num k-meta">${when(run.createdAt, now)}<div>${h(item.status === "queued" ? "Queued" : duration(item.ms))}</div></td></tr>`;
|
|
686
714
|
}
|
|
687
715
|
function runsTable(runs, options = {}) {
|
|
688
716
|
const now = options.now ?? Date.now(), compared = runs.some((run) => baselineNote(run));
|
|
689
|
-
|
|
717
|
+
const references = new Map((options.referenceRuns ?? runs).map((run) => [String(run.id), run]));
|
|
718
|
+
return `<section class="k-card runs-v2" aria-label="Runs"><div class="k-scroll"><table class="k-table wider"><thead><tr><th>Run</th><th>Agent</th><th>Results</th><th class="num">Passed</th>${compared ? "<th>Baseline</th>" : ""}<th>From</th><th class="num">When</th></tr></thead><tbody>${runs.map((run) => row(view(run, now), now, compared, references)).join("")}</tbody></table></div></section>`;
|
|
690
719
|
}
|
|
691
720
|
function filterUrl(filters, change) {
|
|
692
721
|
const next = { ...filters, ...change }, params = new URLSearchParams();
|
|
@@ -702,7 +731,7 @@ function runsPage(runs, filters, options = {}) {
|
|
|
702
731
|
const inRange = range ? all.filter((item) => now - timeOf(item.run.createdAt) <= RANGES[range][1]) : all;
|
|
703
732
|
const values = (pick, chosen) => [...new Set([...all.map(pick), chosen].filter((v) => Boolean(v)))];
|
|
704
733
|
const query = String(filters.q ?? "").trim().toLowerCase();
|
|
705
|
-
const matches = (item) => !query || [item.title, item.run.id, item.agent, item.command, item.run.test?.name, ...(item.run.tasks ?? []).flatMap((t) => [t.id, t.title, t.prompt])].some((v) => String(v ?? "").toLowerCase().includes(query));
|
|
734
|
+
const matches = (item) => !query || [item.title, item.run.origin?.branch, item.run.id, item.agent, item.command, item.run.test?.name, ...(item.run.tasks ?? []).flatMap((t) => [t.id, t.title, t.prompt])].some((v) => String(v ?? "").toLowerCase().includes(query));
|
|
706
735
|
const shown = inRange.filter((item) => matches(item) && (!filters.agent || item.agent === filters.agent || item.run.agentId === filters.agent || item.run.entries?.some((entry) => entry.agentId === filters.agent)) && (!filters.result || item.status === filters.result) && (!filters.where || item.where === filters.where) && (!filters.commit || item.run.origin?.commit === filters.commit) && (!filters.source || item.run.origin?.source === filters.source) && (!filters.target || item.run.origin?.target === filters.target));
|
|
707
736
|
const select = (name, label2, choices, all2) => `<select class="k-filter" name="${name}" aria-label="${h(label2)}" data-run-filter><option value="">${h(all2)}</option>${choices.map(([value, text2]) => `<option value="${h(value)}" ${filters[name] === value ? "selected" : ""}>${h(text2)}</option>`).join("")}</select>`;
|
|
708
737
|
const commits = values((item) => item.run.origin?.commit, filters.commit);
|
|
@@ -715,7 +744,7 @@ function runsPage(runs, filters, options = {}) {
|
|
|
715
744
|
if (!shown.length) return `<div class="k-page">` + head2(meta) + bar + stateCard(filtered ? "No runs match these filters" : "No runs in this range", filtered ? h([query && `\u201C${filters.q}\u201D`, filters.agent && `Agent: ${named2 ?? filters.agent}`, filters.result && `Result: ${RESULT_ORDER.includes(filters.result) ? statusLabel(filters.result) : filters.result}`, filters.where && `Where: ${WHERE[filters.where] ?? filters.where}`, filters.commit && `Commit: ${filters.commit.slice(0, 7)}`].filter(Boolean).join(" \xB7 ")) : "", `<a class="button-link" href="${h(filtered ? filterUrl({ range: filters.range }, {}) : filterUrl(filters, { range: "" }))}" data-nav>${filtered ? "Clear filters" : "Show all runs"}</a>`, "filtered") + "</div>";
|
|
716
745
|
const limit = Math.max(PAGE, Number(filters.limit) || PAGE), page = shown.slice(0, limit);
|
|
717
746
|
const more = shown.length > page.length ? `<a class="button-link" href="${h(filterUrl(filters, { limit: limit + PAGE }))}" data-nav>Load ${Math.min(PAGE, shown.length - page.length)} more</a>` : "";
|
|
718
|
-
return `<div class="k-page">` + head2(meta) + bar + runsTable(page.map((item) => item.run), { now }) + `<div class="rt-foot"><span class="c-note">${page.length} of ${shown.length} ${shown.length === 1 ? "run" : "runs"}, newest first</span>${more}</div></div>`;
|
|
747
|
+
return `<div class="k-page">` + head2(meta) + bar + runsTable(page.map((item) => item.run), { now, referenceRuns: runs }) + `<div class="rt-foot"><span class="c-note">${page.length} of ${shown.length} ${shown.length === 1 ? "run" : "runs"}, newest first</span>${more}</div></div>`;
|
|
719
748
|
}
|
|
720
749
|
|
|
721
750
|
// frontend/src/experience.ts
|
|
@@ -1024,7 +1053,7 @@ function traceDescription(t) {
|
|
|
1024
1053
|
if (filename) result.push(filename);
|
|
1025
1054
|
}
|
|
1026
1055
|
if (t.service === "tools") {
|
|
1027
|
-
const fields2 = (value,
|
|
1056
|
+
const fields2 = (value, count3) => value && typeof value === "object" && !Array.isArray(value) ? Object.entries(value).filter(([, v]) => v === null || ["string", "number", "boolean"].includes(typeof v)).slice(0, count3).map(([k, v]) => `${k}: ${String(v).slice(0, 60)}`).join(", ") : "";
|
|
1028
1057
|
const args = fields2(t.request?.args, 3), answer = fields2(t.response?.result, 4);
|
|
1029
1058
|
if (args) result.push(args);
|
|
1030
1059
|
if (answer) result.push(`returned ${answer}`);
|
|
@@ -1135,7 +1164,7 @@ function attemptResult(observation2, scene, selectedCheck, baseHref = "") {
|
|
|
1135
1164
|
}
|
|
1136
1165
|
|
|
1137
1166
|
// frontend/src/attempt-workspace.ts
|
|
1138
|
-
var
|
|
1167
|
+
var count2 = (n, noun) => `${n} ${noun}${n === 1 ? "" : "s"}`;
|
|
1139
1168
|
var readOnlyRun = (batch) => batch.origin?.stored === true || batch.origin?.mirrored === true || ["cli", "ci", "pytest"].includes(batch.origin?.source);
|
|
1140
1169
|
var records = (value) => Array.isArray(value) ? value.filter((item) => item && typeof item === "object") : [];
|
|
1141
1170
|
var basePath = (batch) => "/playgrounds/" + encodeURIComponent(String(batch.id));
|
|
@@ -1144,7 +1173,7 @@ function taskDisplayName(task, index) {
|
|
|
1144
1173
|
const title2 = typeof task.title === "string" ? task.title.trim().replace(/\s+/g, " ") : "";
|
|
1145
1174
|
return title2 && title2.length <= 80 ? title2 : `Task ${index + 1}`;
|
|
1146
1175
|
}
|
|
1147
|
-
function
|
|
1176
|
+
function attemptOutcome2(attempt) {
|
|
1148
1177
|
if (attempt.outcome === "passed") return { key: "passed", label: "Passed", tone: "pass", mark: "\u2713" };
|
|
1149
1178
|
if (attempt.outcome === "failed") return { key: "failed", label: "Failed", tone: "fail", mark: "\u2717" };
|
|
1150
1179
|
if (attempt.outcome === "invalid") return { key: "invalid", label: "Invalid \xB7 harness", tone: "invalid", mark: "?" };
|
|
@@ -1218,7 +1247,7 @@ function executionBadge(attempt, compact = false) {
|
|
|
1218
1247
|
return `<span class="aw-execution ${tone2}">${h(attemptLabel(status))}</span>`;
|
|
1219
1248
|
}
|
|
1220
1249
|
function outcomeBadge(attempt) {
|
|
1221
|
-
const outcome =
|
|
1250
|
+
const outcome = attemptOutcome2(attempt);
|
|
1222
1251
|
return `<span class="aw-outcome ${outcome.tone}">${h(outcome.label)}</span>`;
|
|
1223
1252
|
}
|
|
1224
1253
|
function sentence(text2) {
|
|
@@ -1264,7 +1293,7 @@ function agentCrumb(batch) {
|
|
|
1264
1293
|
}
|
|
1265
1294
|
function runDetails(batch, tasks, attempts) {
|
|
1266
1295
|
const baseline = batch.comparison?.baselineRunId, total = timeOf(batch.finishedAt) - timeOf(batch.startedAt ?? batch.createdAt);
|
|
1267
|
-
return `<section class="k-card" aria-label="Details"><h2>Details</h2>` + (agentName(batch) ? detailRow("Agent", batch.agentId ? navLink(agentName(batch), "/agents/" + encodeURIComponent(String(batch.agentId))) : h(agentName(batch))) : "") + (batch.origin?.commit ? detailRow("Commit", `<span class="k-mono">${h(String(batch.origin.commit).slice(0, 7))}${batch.origin.dirty ? " + changes" : ""}</span>`) : "") + (baseline ? detailRow("Compared with", navLink(shortId(String(baseline)), "/playgrounds/" + encodeURIComponent(String(baseline)))) : "") + detailRow("From", h(originLabel(batch.origin) || "Console")) + (batch.createdAt ? detailRow("Started", `<time datetime="${h(batch.createdAt)}" title="${h(utc(batch.createdAt))}">${h(utcClock(batch.createdAt))}<span class="k-meta"> \xB7 ${h(utcDay(batch.createdAt))}</span></time>`) : "") + (Number.isFinite(total) && total >= 0 ? detailRow("Duration", h(duration(total))) : "") + detailRow("Tests \xD7 attempts", h(`${
|
|
1296
|
+
return `<section class="k-card" aria-label="Details"><h2>Details</h2>` + (agentName(batch) ? detailRow("Agent", batch.agentId ? navLink(agentName(batch), "/agents/" + encodeURIComponent(String(batch.agentId))) : h(agentName(batch))) : "") + (batch.origin?.commit ? detailRow("Commit", `<span class="k-mono">${h(String(batch.origin.commit).slice(0, 7))}${batch.origin.dirty ? " + changes" : ""}</span>`) : "") + (baseline ? detailRow("Compared with", navLink(shortId(String(baseline)), "/playgrounds/" + encodeURIComponent(String(baseline)))) : "") + detailRow("From", h(originLabel(batch.origin) || "Console")) + (batch.createdAt ? detailRow("Started", `<time datetime="${h(batch.createdAt)}" title="${h(utc(batch.createdAt))}">${h(utcClock(batch.createdAt))}<span class="k-meta"> \xB7 ${h(utcDay(batch.createdAt))}</span></time>`) : "") + (Number.isFinite(total) && total >= 0 ? detailRow("Duration", h(duration(total))) : "") + detailRow("Tests \xD7 attempts", h(`${count2(tasks.length, "test")} \xB7 ${count2(runCounts({ ...batch, tasks, attempts }).total, "attempt")}`)) + (Number(batch.concurrency) > 0 ? detailRow("At once", h(`${batch.concurrency} attempts`)) : "") + (batch.exitCode !== void 0 ? detailRow("Exit", h(batch.exitCode)) : "") + "</section>";
|
|
1268
1297
|
}
|
|
1269
1298
|
function testSquares(batch, task, attempts) {
|
|
1270
1299
|
const states = attemptStates({ tasks: [task], attempts });
|
|
@@ -1283,13 +1312,13 @@ function runProgress(batch) {
|
|
|
1283
1312
|
function renderRunOverview(batch, actionsHtml = "", options = {}) {
|
|
1284
1313
|
const groups = entrySections(batch), tasks = groups.flatMap((group) => group.tasks), allAttempts = records(batch.attempts), c = runCounts(batch);
|
|
1285
1314
|
const rows3 = groups.flatMap(({ entry, tasks: tasks2, attempts }) => tasks2.map((task) => ({ entry, task, attempts: attempts.filter((a) => a.taskId === task.id) }))).filter((row2) => !options.task || row2.task.id === options.task);
|
|
1286
|
-
const hasProduction = rows3.some((row2) => reproductionOf(batch, row2.task));
|
|
1315
|
+
const hasProduction = rows3.some((row2) => reproductionOf(batch, row2.task)), baseline = baselineNote(batch);
|
|
1287
1316
|
const failed = rows3.filter((row2) => row2.attempts.some((a) => a.outcome === "failed")).length;
|
|
1288
1317
|
const noResult = rows3.filter((row2) => row2.attempts.some((a) => ["completed", "error", "stopped"].includes(a.status) && !["passed", "failed"].includes(a.outcome))).length;
|
|
1289
|
-
return `<div class="k-page s059-run"><div class="s059-run-content k-stack"><nav class="k-crumbs" aria-label="Breadcrumb">${agentCrumb(batch)}${navLink("Runs", "/playgrounds")}<span>/</span><span aria-current="page">#${h(shortId(String(batch.id)))}</span></nav><header class="k-head"><div class="k-title"><h1>${h(batch.
|
|
1318
|
+
return `<div class="k-page s059-run"><div class="s059-run-content k-stack"><nav class="k-crumbs" aria-label="Breadcrumb">${agentCrumb(batch)}${navLink("Runs", "/playgrounds")}<span>/</span><span aria-current="page">#${h(shortId(String(batch.id)))}</span></nav><header class="k-head"><div class="k-title"><h1>${h(batch.groupName || runTitle(batch))} <span class="k-num">#${h(shortId(String(batch.id)))}</span></h1>${batch.origin?.branch ? `<span class="k-meta">${h(batch.origin.branch)}</span>` : ""}${resultBadge(runStatus(batch))}</div><div class="k-actions">${kitActions(actionsHtml)}</div></header>${queueLine(batch)}${errorMessage(batch.error)}<div class="k-cols"><div class="k-main">${options.task && rows3[0] ? `<section class="k-card k-task"><span class="k-label">Task</span><div>${h(rows3[0].task.prompt ?? "")}</div></section>${comparisonForm(batch, rows3[0].task, rows3[0].attempts)}` : ""}${["running", "starting", "queued"].includes(batch.status) ? runProgress(batch) : ""}<section class="k-card" aria-label="Tests"><div class="k-card-head"><h2>${c.passed} of ${c.total} passed</h2><nav class="k-seg" aria-label="Filter tests"><button type="button" id="run-filter-all" data-test-filter="all" aria-pressed="true">All (${rows3.length})</button><button type="button" id="run-filter-failed" data-test-filter="failed" aria-pressed="false">Failed (${failed})</button><button type="button" id="run-filter-none" data-test-filter="none" aria-pressed="false">No result (${noResult})</button></nav></div><div class="k-scroll"><table class="k-table mid"><thead><tr><th class="icon-cell"><span class="sr-only">Result</span></th><th>Test</th><th>Attempts</th><th class="num">Passed</th>${hasProduction ? "<th>vs production</th>" : ""}</tr></thead><tbody>${rows3.map(({ entry, task, attempts }) => {
|
|
1290
1319
|
const outcome = taskOutcome(attempts, hasChecks([task]), Number(task.attempts) || attempts.length), reproduction = reproductionOf(batch, task);
|
|
1291
1320
|
return `<tr data-test-row data-failed="${attempts.some((a) => a.outcome === "failed")}" data-none="${attempts.some((a) => ["completed", "error", "stopped"].includes(a.status) && !["passed", "failed"].includes(a.outcome))}"><td class="icon-cell">${resultIcon(taskKind(attempts))}</td><td class="wrap"><button class="k-name" type="button" id="run-test-${h(task.id)}" data-peek-task="${h(task.id)}" aria-haspopup="dialog">${h(taskDisplayName(task, tasks.indexOf(task)))}</button>${groups.length > 1 ? `<div class="k-meta">${h(entry?.agentName ?? entry?.name ?? "")}</div>` : ""}<div class="k-meta">${h(shortPrompt(task.prompt))}</div><template data-test-peek="${h(task.id)}">${testPeek(batch, task, attempts, tasks.indexOf(task))}</template></td><td>${testSquares(batch, task, attempts)}</td><td class="num">${attempts.some((a) => ["passed", "failed"].includes(a.outcome)) ? `${attempts.filter((a) => a.outcome === "passed").length}/${Number(task.attempts) || attempts.length}` : "\u2014"}<div class="k-meta">${h(outcome.note)}</div></td>${hasProduction ? `<td>${productionTag(reproduction ? [reproduction] : []) || "\u2014"}</td>` : ""}</tr>`;
|
|
1292
|
-
}).join("")}</tbody></table></div>${!rows3.length ? '<p class="k-empty">No tasks recorded.</p>' : ""}<p class="k-empty" data-test-empty hidden>No tests match this filter.</p></section></div><aside class="k-side">${runDetails(batch, tasks, allAttempts)}${
|
|
1321
|
+
}).join("")}</tbody></table></div>${!rows3.length ? '<p class="k-empty">No tasks recorded.</p>' : ""}<p class="k-empty" data-test-empty hidden>No tests match this filter.</p></section></div><aside class="k-side">${runDetails(batch, tasks, allAttempts)}${baseline ? `<p class="k-meta${baseline.tone === "fail" ? " k-fail-text" : ""}">${h(baseline.text)}</p>` : ""}</aside></div></div><div data-peek-host></div></div>`;
|
|
1293
1322
|
}
|
|
1294
1323
|
function mountRunOverview(container, state = {}) {
|
|
1295
1324
|
const page = container.querySelector(".s059-run");
|
|
@@ -1297,14 +1326,14 @@ function mountRunOverview(container, state = {}) {
|
|
|
1297
1326
|
const content = page.querySelector(".s059-run-content"), host = page.querySelector("[data-peek-host]");
|
|
1298
1327
|
const buttons = [...page.querySelectorAll("[data-peek-task]")];
|
|
1299
1328
|
const applyFilter = () => {
|
|
1300
|
-
let
|
|
1329
|
+
let count3 = 0;
|
|
1301
1330
|
const rows3 = [...page.querySelectorAll("[data-test-row]")];
|
|
1302
1331
|
for (const row2 of rows3) {
|
|
1303
1332
|
row2.hidden = state.filter === "failed" ? row2.dataset.failed !== "true" : state.filter === "none" ? row2.dataset.none !== "true" : false;
|
|
1304
|
-
if (!row2.hidden)
|
|
1333
|
+
if (!row2.hidden) count3++;
|
|
1305
1334
|
}
|
|
1306
1335
|
for (const button2 of page.querySelectorAll("[data-test-filter]")) button2.setAttribute("aria-pressed", String(button2.dataset.testFilter === (state.filter ?? "all")));
|
|
1307
|
-
page.querySelector("[data-test-empty]").hidden =
|
|
1336
|
+
page.querySelector("[data-test-empty]").hidden = count3 > 0 || rows3.length === 0;
|
|
1308
1337
|
};
|
|
1309
1338
|
const close = () => {
|
|
1310
1339
|
const id = state.peek;
|
|
@@ -1463,7 +1492,7 @@ function managedResponse(attempt) {
|
|
|
1463
1492
|
return original.replace(/<div class="response-text">[\s\S]*?<\/div>/, () => `<div class="aw-markdown">${safeMarkdown(text2)}</div>`);
|
|
1464
1493
|
}
|
|
1465
1494
|
function attemptKind(attempt) {
|
|
1466
|
-
const outcome =
|
|
1495
|
+
const outcome = attemptOutcome2(attempt).key;
|
|
1467
1496
|
if (outcome !== "ungraded") return outcome;
|
|
1468
1497
|
return attempt.status === "queued" ? "queued" : ["starting", "running"].includes(attempt.status) ? "running" : attempt.status === "error" ? "error" : attempt.status === "stopped" ? "stopped" : "ungraded";
|
|
1469
1498
|
}
|
|
@@ -1493,11 +1522,11 @@ function fieldsOf(value, limit = 60) {
|
|
|
1493
1522
|
walk(value, "");
|
|
1494
1523
|
return out;
|
|
1495
1524
|
}
|
|
1496
|
-
function gist(value,
|
|
1525
|
+
function gist(value, count3 = 3) {
|
|
1497
1526
|
if (value === void 0 || value === null || value === "") return "";
|
|
1498
1527
|
if (!(typeof value === "object")) return String(value).replace(/\s+/g, " ").slice(0, 120);
|
|
1499
|
-
const fields2 = fieldsOf(value,
|
|
1500
|
-
return fields2.slice(0,
|
|
1528
|
+
const fields2 = fieldsOf(value, count3 + 1).filter(([, v]) => v !== "");
|
|
1529
|
+
return fields2.slice(0, count3).map(([k, v]) => `${k}: ${v.length > 40 ? `${v.slice(0, 39)}\u2026` : v}`).join(", ") + (fields2.length > count3 ? ", \u2026" : "");
|
|
1501
1530
|
}
|
|
1502
1531
|
var fieldList = (value) => {
|
|
1503
1532
|
const fields2 = fieldsOf(value);
|
|
@@ -1560,7 +1589,7 @@ function stepsSection(observation2, checks2, callHref, jump) {
|
|
|
1560
1589
|
const stepOf = (check) => (Array.isArray(check.evidence) ? check.evidence : []).find((seq) => Number.isSafeInteger(seq) && seqs.has(Number(seq)));
|
|
1561
1590
|
const unlinked = failures.filter((check) => stepOf(check) === void 0);
|
|
1562
1591
|
const times = trace.map((t) => timeOf(t.tSim)).filter(Number.isFinite), start = times.length ? Math.min(...times) : NaN;
|
|
1563
|
-
return `<section class="k-card" aria-label="Steps"><div class="k-card-head"><h2>Steps</h2><span class="k-meta">${
|
|
1592
|
+
return `<section class="k-card" aria-label="Steps"><div class="k-card-head"><h2>Steps</h2><span class="k-meta">${count2(trace.length, "call")}</span></div>${unlinked.length ? `<div class="k-stack s059-unlinked">${unlinked.map((check) => failedCheckCard(check, jump)).join("")}</div>` : ""}<ol class="k-steps">${trace.map((call, i) => {
|
|
1564
1593
|
const seq = Number(call.seq), own = failures.filter((check) => stepOf(check) === seq), at2 = timeOf(call.tSim);
|
|
1565
1594
|
return `<li><div class="k-step${own.length ? " fail" : ""}" id="step-${h(seq)}"><span class="n">${i + 1}</span><span class="tool" title="${h(call.service ?? "")}">${h(call.service === "tools" ? "Tool" : toolName(String(call.service ?? "")) || "Call")}</span><span class="what">${navLink(callName(call), callHref(seq), "k-name")}${gist(call.service === "tools" ? call.request?.args : call.request) ? `<span class="s059-step-gist">${h(gist(call.service === "tools" ? call.request?.args : call.request))}</span>` : ""}</span><span class="t">${Number.isFinite(at2) && Number.isFinite(start) ? h(duration(at2 - start)) : "\u2014"}</span></div>${own.map((check) => `<div class="k-step-check">${failedCheckCard(check, jump)}</div>`).join("")}</li>`;
|
|
1566
1595
|
}).join("")}</ol>${trace.length ? "" : '<p class="k-empty">No calls in this attempt.</p>'}</section>`;
|
|
@@ -1632,7 +1661,7 @@ var resultBadge2 = (kind) => `<span class="k-badge ${tone(kind)}">${h(statusLabe
|
|
|
1632
1661
|
function attemptSquares2(attempts, runId, taskId) {
|
|
1633
1662
|
return `<div class="k-squares">${attempts.map((attempt) => {
|
|
1634
1663
|
const kind = attemptKind(attempt), state = kind === "running" ? "run" : kind === "queued" ? "queue" : tone(kind);
|
|
1635
|
-
const name = `Attempt ${attempt.number}: ${attemptLabel(attempt.status)} \xB7 ${
|
|
1664
|
+
const name = `Attempt ${attempt.number}: ${attemptLabel(attempt.status)} \xB7 ${attemptOutcome2(attempt).label}`;
|
|
1636
1665
|
return `<a data-nav class="k-sq ${state}" role="img" href="/playgrounds/${enc(runId)}?task=${enc(taskId)}&attempt=${enc(attempt.id)}" title="${h(name)}" aria-label="${h(name)}"></a>`;
|
|
1637
1666
|
}).join("")}</div>`;
|
|
1638
1667
|
}
|
|
@@ -2069,9 +2098,9 @@ var viewWorldsEmpty = (boot2) => viewBanner(boot2, /* @__PURE__ */ new Date(), "
|
|
|
2069
2098
|
|
|
2070
2099
|
// frontend/src/generated/tool-catalog.ts
|
|
2071
2100
|
var TOOL_CATALOG = [
|
|
2072
|
-
{ "name": "slack", "title": "Slack", "category": "Team chat", "description": "Channels, messages and threads", "version": "Web API", "env": ["SLACK_API_URL", "SLACK_BOT_TOKEN"], "endpoints": [["POST", "/api/apps.connections.open"], ["POST", "/api/auth.test"], ["POST", "/api/canvases.create"], ["POST", "/api/canvases.getContent"], ["POST", "/api/chat.delete"], ["POST", "/api/chat.getPermalink"], ["POST", "/api/chat.postMessage"], ["POST", "/api/chat.update"], ["POST", "/api/conversations.create"], ["POST", "/api/conversations.history"], ["POST", "/api/conversations.info"], ["POST", "/api/conversations.join"], ["POST", "/api/conversations.list"], ["POST", "/api/conversations.members"], ["POST", "/api/conversations.open"], ["POST", "/api/conversations.replies"], ["POST", "/api/files.info"], ["POST", "/api/files.list"], ["POST", "/api/reactions.add"], ["POST", "/api/reactions.get"], ["POST", "/api/reactions.remove"], ["POST", "/api/search.messages"], ["POST", "/api/users.conversations"], ["POST", "/api/users.info"], ["POST", "/api/users.list"], ["POST", "/api/users.lookupByEmail"], ["POST", "/api/views.publish"]] },
|
|
2101
|
+
{ "name": "slack", "title": "Slack", "category": "Team chat", "description": "Channels, messages and threads", "version": "Web API", "env": ["SLACK_API_URL", "SLACK_BOT_TOKEN"], "endpoints": [["POST", "/api/apps.connections.open"], ["POST", "/api/assistant.threads.setStatus"], ["POST", "/api/assistant.threads.setSuggestedPrompts"], ["POST", "/api/assistant.threads.setTitle"], ["POST", "/api/auth.test"], ["POST", "/api/canvases.create"], ["POST", "/api/canvases.getContent"], ["POST", "/api/chat.appendStream"], ["POST", "/api/chat.delete"], ["POST", "/api/chat.getPermalink"], ["POST", "/api/chat.postEphemeral"], ["POST", "/api/chat.postMessage"], ["POST", "/api/chat.startStream"], ["POST", "/api/chat.stopStream"], ["POST", "/api/chat.update"], ["POST", "/api/conversations.create"], ["POST", "/api/conversations.history"], ["POST", "/api/conversations.info"], ["POST", "/api/conversations.join"], ["POST", "/api/conversations.list"], ["POST", "/api/conversations.members"], ["POST", "/api/conversations.open"], ["POST", "/api/conversations.replies"], ["POST", "/api/files.info"], ["POST", "/api/files.list"], ["POST", "/api/reactions.add"], ["POST", "/api/reactions.get"], ["POST", "/api/reactions.remove"], ["POST", "/api/search.messages"], ["POST", "/api/users.conversations"], ["POST", "/api/users.info"], ["POST", "/api/users.list"], ["POST", "/api/users.lookupByEmail"], ["POST", "/api/views.publish"]] },
|
|
2073
2102
|
{ "name": "discord", "title": "Discord", "category": "Community chat", "description": "A community server as its bot sees it: channels, messages, threads and reactions", "version": "REST API v10", "env": ["DISCORD_API_URL", "DISCORD_BOT_TOKEN"], "endpoints": [["GET", "/api/v10/channels/{channel_id}"], ["GET", "/api/v10/channels/{channel_id}/messages"], ["POST", "/api/v10/channels/{channel_id}/messages"], ["GET", "/api/v10/channels/{channel_id}/messages/{message_id}"], ["PATCH", "/api/v10/channels/{channel_id}/messages/{message_id}"], ["DELETE", "/api/v10/channels/{channel_id}/messages/{message_id}"], ["GET", "/api/v10/channels/{channel_id}/messages/{message_id}/reactions/{emoji}"], ["PUT", "/api/v10/channels/{channel_id}/messages/{message_id}/reactions/{emoji}/@me"], ["DELETE", "/api/v10/channels/{channel_id}/messages/{message_id}/reactions/{emoji}/@me"], ["POST", "/api/v10/channels/{channel_id}/messages/{message_id}/threads"], ["GET", "/api/v10/channels/{channel_id}/pins"], ["PUT", "/api/v10/channels/{channel_id}/pins/{message_id}"], ["DELETE", "/api/v10/channels/{channel_id}/pins/{message_id}"], ["POST", "/api/v10/channels/{channel_id}/threads"], ["POST", "/api/v10/channels/{channel_id}/typing"], ["GET", "/api/v10/guilds/{guild_id}"], ["GET", "/api/v10/guilds/{guild_id}/channels"], ["GET", "/api/v10/guilds/{guild_id}/members"], ["GET", "/api/v10/guilds/{guild_id}/members/{user_id}"], ["GET", "/api/v10/guilds/{guild_id}/roles"], ["GET", "/api/v10/guilds/{guild_id}/threads/active"], ["GET", "/api/v10/users/{user_id}"], ["GET", "/api/v10/users/@me"], ["POST", "/api/v10/users/@me/channels"], ["GET", "/api/v10/users/@me/guilds"]] },
|
|
2074
|
-
{ "name": "github", "title": "GitHub", "category": "Code", "description": "Repositories, pull requests and deployments", "version": "REST", "env": ["GITHUB_API_URL", "GITHUB_TOKEN"], "endpoints": [["GET", "/repos/:owner/:repo/actions/runs"], ["GET", "/repos/:owner/:repo/actions/runs/:id"], ["POST", "/repos/:owner/:repo/actions/runs/:id/rerun"], ["GET", "/repos/:owner/:repo/actions/workflows/:workflow/runs"], ["GET", "/repos/:owner/:repo/branches"], ["GET", "/repos/:owner/:repo/branches/:branch"], ["GET", "/repos/:owner/:repo/check-runs/:id"], ["GET", "/repos/:owner/:repo/collaborators"], ["GET", "/repos/:owner/:repo/collaborators/:username"], ["PUT", "/repos/:owner/:repo/collaborators/:username"], ["DELETE", "/repos/:owner/:repo/collaborators/:username"], ["GET", "/repos/:owner/:repo/collaborators/:username/permission"], ["GET", "/repos/:owner/:repo/commits"], ["GET", "/repos/:owner/:repo/commits/:ref"], ["GET", "/repos/:owner/:repo/commits/:ref/check-runs"], ["GET", "/repos/:owner/:repo/compare/:base...:head"], ["PUT", "/repos/:owner/:repo/contents/:path"], ["GET", "/repos/:owner/:repo/contents/:path?"], ["GET", "/repos/:owner/:repo/deployments"], ["POST", "/repos/:owner/:repo/deployments"], ["GET", "/repos/:owner/:repo/deployments/:id"], ["GET", "/repos/:owner/:repo/deployments/:id/statuses"], ["POST", "/repos/:owner/:repo/deployments/:id/statuses"], ["GET", "/repos/:owner/:repo/deployments/:id/statuses/:statusId"], ["POST", "/repos/:owner/:repo/git/blobs"], ["GET", "/repos/:owner/:repo/git/blobs/:sha"], ["POST", "/repos/:owner/:repo/git/commits"], ["GET", "/repos/:owner/:repo/git/commits/:sha"], ["GET", "/repos/:owner/:repo/git/matching-refs/:ref?"], ["GET", "/repos/:owner/:repo/git/ref/:ref"], ["POST", "/repos/:owner/:repo/git/refs"], ["PATCH", "/repos/:owner/:repo/git/refs/:ref"], ["DELETE", "/repos/:owner/:repo/git/refs/:ref"], ["POST", "/repos/:owner/:repo/git/trees"], ["GET", "/repos/:owner/:repo/git/trees/:sha"], ["POST", "/graphql"], ["GET", "/repos/:owner/:repo/issues"], ["POST", "/repos/:owner/:repo/issues"], ["GET", "/repos/:owner/:repo/issues/:number"], ["PATCH", "/repos/:owner/:repo/issues/:number"], ["GET", "/repos/:owner/:repo/issues/:number/comments"], ["POST", "/repos/:owner/:repo/issues/:number/comments"], ["GET", "/repos/:owner/:repo/issues/:number/labels"], ["POST", "/repos/:owner/:repo/issues/:number/labels"], ["PUT", "/repos/:owner/:repo/issues/:number/labels"], ["DELETE", "/repos/:owner/:repo/issues/:number/labels"], ["DELETE", "/repos/:owner/:repo/issues/:number/labels/:name"], ["GET", "/repos/:owner/:repo/issues/comments"], ["GET", "/repos/:owner/:repo/issues/comments/:id"], ["PATCH", "/repos/:owner/:repo/issues/comments/:id"], ["DELETE", "/repos/:owner/:repo/issues/comments/:id"], ["GET", "/repos/:owner/:repo/labels"], ["POST", "/repos/:owner/:repo/labels"], ["GET", "/repos/:owner/:repo/labels/:name"], ["PATCH", "/repos/:owner/:repo/labels/:name"], ["DELETE", "/repos/:owner/:repo/labels/:name"], ["GET", "/orgs/:org/members"], ["GET", "/orgs/:org/members/:username"], ["DELETE", "/orgs/:org/members/:username"], ["GET", "/orgs/:org/memberships/:username"], ["DELETE", "/orgs/:org/memberships/:username"], ["GET", "/orgs/:org/repos"], ["GET", "/repos/:owner/:repo/pulls"], ["POST", "/repos/:owner/:repo/pulls"], ["GET", "/repos/:owner/:repo/pulls/:number"], ["PATCH", "/repos/:owner/:repo/pulls/:number"], ["GET", "/repos/:owner/:repo/pulls/:number/comments"], ["POST", "/repos/:owner/:repo/pulls/:number/comments"], ["GET", "/repos/:owner/:repo/pulls/:number/commits"], ["GET", "/repos/:owner/:repo/pulls/:number/files"], ["GET", "/repos/:owner/:repo/pulls/:number/merge"], ["PUT", "/repos/:owner/:repo/pulls/:number/merge"], ["GET", "/repos/:owner/:repo/pulls/:number/reviews"], ["POST", "/repos/:owner/:repo/pulls/:number/reviews"], ["GET", "/repos/:owner/:repo/pulls/:number/reviews/:id"], ["GET", "/repos/:owner/:repo/pulls/comments"], ["GET", "/repos/:owner/:repo/pulls/comments/:id"], ["PATCH", "/repos/:owner/:repo/pulls/comments/:id"], ["DELETE", "/repos/:owner/:repo/pulls/comments/:id"], ["GET", "/repos/:owner/:repo"], ["GET", "/user"], ["GET", "/user/repos"]] },
|
|
2103
|
+
{ "name": "github", "title": "GitHub", "category": "Code", "description": "Repositories, pull requests and deployments", "version": "REST", "env": ["GITHUB_API_URL", "GITHUB_TOKEN"], "endpoints": [["GET", "/repos/:owner/:repo/actions/runs"], ["GET", "/repos/:owner/:repo/actions/runs/:id"], ["POST", "/repos/:owner/:repo/actions/runs/:id/rerun"], ["GET", "/repos/:owner/:repo/actions/workflows/:workflow/runs"], ["GET", "/repos/:owner/:repo/branches"], ["GET", "/repos/:owner/:repo/branches/:branch"], ["GET", "/repos/:owner/:repo/check-runs/:id"], ["GET", "/repos/:owner/:repo/collaborators"], ["GET", "/repos/:owner/:repo/collaborators/:username"], ["PUT", "/repos/:owner/:repo/collaborators/:username"], ["DELETE", "/repos/:owner/:repo/collaborators/:username"], ["GET", "/repos/:owner/:repo/collaborators/:username/permission"], ["GET", "/repos/:owner/:repo/commits"], ["GET", "/repos/:owner/:repo/commits/:ref"], ["GET", "/repos/:owner/:repo/commits/:ref/check-runs"], ["GET", "/repos/:owner/:repo/compare/:base...:head"], ["PUT", "/repos/:owner/:repo/contents/:path"], ["GET", "/repos/:owner/:repo/contents/:path?"], ["GET", "/repos/:owner/:repo/deployments"], ["POST", "/repos/:owner/:repo/deployments"], ["GET", "/repos/:owner/:repo/deployments/:id"], ["GET", "/repos/:owner/:repo/deployments/:id/statuses"], ["POST", "/repos/:owner/:repo/deployments/:id/statuses"], ["GET", "/repos/:owner/:repo/deployments/:id/statuses/:statusId"], ["POST", "/repos/:owner/:repo/git/blobs"], ["GET", "/repos/:owner/:repo/git/blobs/:sha"], ["POST", "/repos/:owner/:repo/git/commits"], ["GET", "/repos/:owner/:repo/git/commits/:sha"], ["GET", "/repos/:owner/:repo/git/matching-refs/:ref?"], ["GET", "/repos/:owner/:repo/git/ref/:ref"], ["POST", "/repos/:owner/:repo/git/refs"], ["PATCH", "/repos/:owner/:repo/git/refs/:ref"], ["DELETE", "/repos/:owner/:repo/git/refs/:ref"], ["POST", "/repos/:owner/:repo/git/trees"], ["GET", "/repos/:owner/:repo/git/trees/:sha"], ["POST", "/graphql"], ["GET", "/repos/:owner/:repo/issues"], ["POST", "/repos/:owner/:repo/issues"], ["GET", "/repos/:owner/:repo/issues/:number"], ["PATCH", "/repos/:owner/:repo/issues/:number"], ["GET", "/repos/:owner/:repo/issues/:number/comments"], ["POST", "/repos/:owner/:repo/issues/:number/comments"], ["GET", "/repos/:owner/:repo/issues/:number/labels"], ["POST", "/repos/:owner/:repo/issues/:number/labels"], ["PUT", "/repos/:owner/:repo/issues/:number/labels"], ["DELETE", "/repos/:owner/:repo/issues/:number/labels"], ["DELETE", "/repos/:owner/:repo/issues/:number/labels/:name"], ["GET", "/repos/:owner/:repo/issues/comments"], ["GET", "/repos/:owner/:repo/issues/comments/:id"], ["PATCH", "/repos/:owner/:repo/issues/comments/:id"], ["DELETE", "/repos/:owner/:repo/issues/comments/:id"], ["GET", "/repos/:owner/:repo/labels"], ["POST", "/repos/:owner/:repo/labels"], ["GET", "/repos/:owner/:repo/labels/:name"], ["PATCH", "/repos/:owner/:repo/labels/:name"], ["DELETE", "/repos/:owner/:repo/labels/:name"], ["GET", "/orgs/:org/members"], ["GET", "/orgs/:org/members/:username"], ["DELETE", "/orgs/:org/members/:username"], ["GET", "/orgs/:org/memberships/:username"], ["DELETE", "/orgs/:org/memberships/:username"], ["GET", "/orgs/:org/repos"], ["GET", "/repos/:owner/:repo/pulls"], ["POST", "/repos/:owner/:repo/pulls"], ["GET", "/repos/:owner/:repo/pulls/:number"], ["PATCH", "/repos/:owner/:repo/pulls/:number"], ["GET", "/repos/:owner/:repo/pulls/:number/comments"], ["POST", "/repos/:owner/:repo/pulls/:number/comments"], ["GET", "/repos/:owner/:repo/pulls/:number/commits"], ["GET", "/repos/:owner/:repo/pulls/:number/files"], ["GET", "/repos/:owner/:repo/pulls/:number/merge"], ["PUT", "/repos/:owner/:repo/pulls/:number/merge"], ["GET", "/repos/:owner/:repo/pulls/:number/reviews"], ["POST", "/repos/:owner/:repo/pulls/:number/reviews"], ["GET", "/repos/:owner/:repo/pulls/:number/reviews/:id"], ["GET", "/repos/:owner/:repo/pulls/comments"], ["GET", "/repos/:owner/:repo/pulls/comments/:id"], ["PATCH", "/repos/:owner/:repo/pulls/comments/:id"], ["DELETE", "/repos/:owner/:repo/pulls/comments/:id"], ["GET", "/repos/:owner/:repo"], ["GET", "/search/issues"], ["GET", "/user"], ["GET", "/user/repos"]] },
|
|
2075
2104
|
{ "name": "linear", "title": "Linear", "category": "Issues", "description": "Issues, projects and team workflows", "version": "GraphQL", "env": ["LINEAR_API_URL", "LINEAR_API_KEY"], "endpoints": [["QUERY", "comment"], ["MUTATION", "commentCreate"], ["MUTATION", "commentDelete"], ["QUERY", "comments"], ["MUTATION", "commentUpdate"], ["QUERY", "issue"], ["MUTATION", "issueAddLabel"], ["MUTATION", "issueArchive"], ["MUTATION", "issueCreate"], ["MUTATION", "issueDelete"], ["QUERY", "issueLabel"], ["MUTATION", "issueLabelCreate"], ["QUERY", "issueLabels"], ["MUTATION", "issueRemoveLabel"], ["QUERY", "issues"], ["MUTATION", "issueUpdate"], ["QUERY", "organization"], ["QUERY", "project"], ["QUERY", "projects"], ["QUERY", "searchIssues"], ["QUERY", "team"], ["QUERY", "teams"], ["QUERY", "user"], ["QUERY", "users"], ["QUERY", "viewer"], ["QUERY", "workflowState"], ["QUERY", "workflowStates"]] },
|
|
2076
2105
|
{ "name": "jira", "title": "Jira", "category": "Issues", "description": "Issues, JQL search, comments, transitions and sprints", "version": "REST v3/v2 and agile 1.0", "env": ["JIRA_BASE_URL", "JIRA_EMAIL", "JIRA_API_TOKEN"], "endpoints": [["POST", "/rest/agile/1.0/backlog/issue"], ["GET", "/rest/agile/1.0/board"], ["GET", "/rest/agile/1.0/board/:id"], ["GET", "/rest/agile/1.0/board/:id/backlog"], ["GET", "/rest/agile/1.0/board/:id/issue"], ["GET", "/rest/agile/1.0/board/:id/sprint"], ["POST", "/rest/agile/1.0/sprint"], ["GET", "/rest/agile/1.0/sprint/:id"], ["POST", "/rest/agile/1.0/sprint/:id"], ["GET", "/rest/agile/1.0/sprint/:id/issue"], ["POST", "/rest/agile/1.0/sprint/:id/issue"], ["GET", "/rest/api/3/field"], ["POST", "/rest/api/3/issue"], ["GET", "/rest/api/3/issue/:key"], ["PUT", "/rest/api/3/issue/:key"], ["DELETE", "/rest/api/3/issue/:key"], ["PUT", "/rest/api/3/issue/:key/assignee"], ["GET", "/rest/api/3/issue/:key/changelog"], ["GET", "/rest/api/3/issue/:key/comment"], ["POST", "/rest/api/3/issue/:key/comment"], ["GET", "/rest/api/3/issue/:key/comment/:id"], ["PUT", "/rest/api/3/issue/:key/comment/:id"], ["DELETE", "/rest/api/3/issue/:key/comment/:id"], ["GET", "/rest/api/3/issue/:key/transitions"], ["POST", "/rest/api/3/issue/:key/transitions"], ["GET", "/rest/api/3/issue/:key/watchers"], ["POST", "/rest/api/3/issue/:key/watchers"], ["DELETE", "/rest/api/3/issue/:key/watchers"], ["POST", "/rest/api/3/issue/bulk"], ["GET", "/rest/api/3/issue/createmeta/:key/issuetypes"], ["GET", "/rest/api/3/issue/createmeta/:key/issuetypes/:type"], ["POST", "/rest/api/3/issueLink"], ["GET", "/rest/api/3/issueLink/:id"], ["DELETE", "/rest/api/3/issueLink/:id"], ["GET", "/rest/api/3/issueLinkType"], ["GET", "/rest/api/3/issuetype"], ["GET", "/rest/api/3/label"], ["GET", "/rest/api/3/myself"], ["GET", "/rest/api/3/priority"], ["GET", "/rest/api/3/project"], ["GET", "/rest/api/3/project/:key"], ["GET", "/rest/api/3/project/:key/components"], ["GET", "/rest/api/3/project/:key/statuses"], ["GET", "/rest/api/3/project/:key/versions"], ["GET", "/rest/api/3/project/search"], ["GET", "/rest/api/3/resolution"], ["GET", "/rest/api/3/search"], ["POST", "/rest/api/3/search"], ["POST", "/rest/api/3/search/approximate-count"], ["GET", "/rest/api/3/search/jql"], ["POST", "/rest/api/3/search/jql"], ["GET", "/rest/api/3/serverInfo"], ["GET", "/rest/api/3/status"], ["GET", "/rest/api/3/statuscategory"], ["GET", "/rest/api/3/user"], ["GET", "/rest/api/3/user/assignable/search"], ["GET", "/rest/api/3/user/search"]] },
|
|
2077
2106
|
{ "name": "asana", "title": "Asana", "category": "Projects", "description": "Projects, sections, tasks, subtasks and comments", "version": "REST API 1.0", "env": ["ASANA_API_URL", "ASANA_ACCESS_TOKEN"], "endpoints": [["GET", "/api/1.0/projects"], ["GET", "/api/1.0/projects/{project_gid}"], ["GET", "/api/1.0/projects/{project_gid}/sections"], ["POST", "/api/1.0/projects/{project_gid}/sections"], ["GET", "/api/1.0/projects/{project_gid}/tasks"], ["POST", "/api/1.0/sections/{section_gid}/addTask"], ["GET", "/api/1.0/sections/{section_gid}/tasks"], ["GET", "/api/1.0/tasks"], ["POST", "/api/1.0/tasks"], ["GET", "/api/1.0/tasks/{task_gid}"], ["PUT", "/api/1.0/tasks/{task_gid}"], ["DELETE", "/api/1.0/tasks/{task_gid}"], ["POST", "/api/1.0/tasks/{task_gid}/addProject"], ["POST", "/api/1.0/tasks/{task_gid}/removeProject"], ["GET", "/api/1.0/tasks/{task_gid}/stories"], ["POST", "/api/1.0/tasks/{task_gid}/stories"], ["GET", "/api/1.0/tasks/{task_gid}/subtasks"], ["POST", "/api/1.0/tasks/{task_gid}/subtasks"], ["GET", "/api/1.0/users"], ["GET", "/api/1.0/users/{user_gid}"], ["GET", "/api/1.0/workspaces"], ["GET", "/api/1.0/workspaces/{workspace_gid}"], ["GET", "/api/1.0/workspaces/{workspace_gid}/tasks/search"]] },
|
|
@@ -2354,8 +2383,8 @@ function mountTestFlow(node, options) {
|
|
|
2354
2383
|
} else if (step === "tasks") {
|
|
2355
2384
|
node.innerHTML += `<form id="test-tasks"><label>Test name<input name="name" value="${h(draft.name)}" required maxlength="120" placeholder="e.g. Customer follow-ups"></label><div id="task-editors">${taskFields(draft.tasks)}</div><button type="button" data-flow="add-task">Add task</button><div class="task-start-bar"><label>Run at once<input name="concurrency" type="number" min="1" max="10" value="${h(draft.concurrency)}" required></label><button type="submit" class="primary">Review</button></div></form>`;
|
|
2356
2385
|
} else {
|
|
2357
|
-
const
|
|
2358
|
-
node.innerHTML += `<section class="test-review"><h2>${h(draft.name)}</h2><div class="review-world"><span>${h(agent.name)}</span><span aria-hidden="true">\u2192</span><strong>${h(world?.name ?? "Loading saved world\u2026")}</strong>${world ? `<span class="muted">Revision ${h(world.revision)}</span>` : ""}<span class="world-marks">${(world?.configuration.preset.datasets ?? []).map((d) => toolLogo(d.tool)).join("")}</span></div>${draft.tasks.map((t, i) => `<div class="review-task"><span class="muted">${i + 1}</span><p>${h(t.prompt)}</p><span>${t.attempts} trials \xB7 ${Number((t.timeoutMs / 6e4).toFixed(2))} min</span></div>`).join("")}<div class="flow-footer"><span>${
|
|
2386
|
+
const count3 = draft.tasks.reduce((n, t) => n + t.attempts, 0);
|
|
2387
|
+
node.innerHTML += `<section class="test-review"><h2>${h(draft.name)}</h2><div class="review-world"><span>${h(agent.name)}</span><span aria-hidden="true">\u2192</span><strong>${h(world?.name ?? "Loading saved world\u2026")}</strong>${world ? `<span class="muted">Revision ${h(world.revision)}</span>` : ""}<span class="world-marks">${(world?.configuration.preset.datasets ?? []).map((d) => toolLogo(d.tool)).join("")}</span></div>${draft.tasks.map((t, i) => `<div class="review-task"><span class="muted">${i + 1}</span><p>${h(t.prompt)}</p><span>${t.attempts} trials \xB7 ${Number((t.timeoutMs / 6e4).toFixed(2))} min</span></div>`).join("")}<div class="flow-footer"><span>${count3} trials \xB7 up to ${Math.min(count3, draft.concurrency)} at once</span>${pending ? "" : `<button type="button" data-flow="save-test" ${!world ? "disabled" : ""}>Save test</button>`}<button type="button" data-flow="run-test" class="primary" ${!world ? "disabled" : ""}>${pending ? "Retry same run" : draft.savedTest ? "Run test" : "Save and run"}</button></div></section>`;
|
|
2359
2388
|
}
|
|
2360
2389
|
}
|
|
2361
2390
|
async function execute(action2) {
|
|
@@ -2575,7 +2604,7 @@ function mountGroupFlow(node, options) {
|
|
|
2575
2604
|
}
|
|
2576
2605
|
let saving = false, error = "";
|
|
2577
2606
|
const selectedWorld = () => options.worlds.find((world) => world.id === draft.worldId && world.revision === draft.worldRevision);
|
|
2578
|
-
const
|
|
2607
|
+
const count3 = () => draft.tasks.reduce((sum2, task) => sum2 + Number(task.attempts || 0), 0) * draft.agentIds.length;
|
|
2579
2608
|
const remember = () => {
|
|
2580
2609
|
try {
|
|
2581
2610
|
sessionStorage.setItem(key, JSON.stringify(draft));
|
|
@@ -2606,7 +2635,7 @@ function mountGroupFlow(node, options) {
|
|
|
2606
2635
|
}
|
|
2607
2636
|
function render() {
|
|
2608
2637
|
remember();
|
|
2609
|
-
const world = selectedWorld(), selected = new Set(draft.agentIds), total =
|
|
2638
|
+
const world = selectedWorld(), selected = new Set(draft.agentIds), total = count3();
|
|
2610
2639
|
const pending = !!draft.pendingSubmission, uncertain = !!draft.submissionUncertain;
|
|
2611
2640
|
node.innerHTML = `<div class="flow-error group-flow-error" role="alert" ${error ? "" : "hidden"}>${h(error)}</div>${pending || uncertain ? '<p class="hint" role="status">We could not confirm whether this run started. Retry the same request to avoid creating a duplicate.</p>' : ""}${draft.step === "review" ? `<form id="group-run-form"><section class="group-review"><h2>${h(draft.name || "Agent comparison")}</h2><div class="group-review-summary"><strong>${draft.agentIds.length} agents</strong><span>${h(world?.name ?? "Shared world")} \xB7 revision ${h(world?.revision ?? "unselected")}</span></div><div class="group-review-agents">${options.agents.filter((a) => selected.has(a.id)).map((a) => `<span>${h(a.name)}</span>`).join("")}</div>${draft.tasks.map((task, index) => `<div class="review-task"><span class="muted">Task ${index + 1}</span><p>${h(task.prompt)}</p><span>${task.attempts} trials \xB7 ${timeLimit(task.timeoutMs)}</span></div>`).join("")}<div class="flow-footer"><span>${total} trials \xB7 up to ${Math.min(Number(draft.concurrency), total)} requested at once</span>${pending || uncertain ? "" : `<button type="button" data-group="back">Edit</button>`}<button type="submit" class="primary" ${saving || uncertain ? "disabled" : ""}>${pending ? "Retry same request" : "Start group run"}</button></div></section></form>` : `<form id="group-run-form"><section class="group-section"><label>Run name<input name="name" value="${h(draft.name)}" maxlength="120" required></label><fieldset class="group-agent-select"><legend>Agents</legend>${options.agents.map((agent) => `<label class="group-agent-choice"><input type="checkbox" name="agentIds" value="${h(agent.id)}" ${selected.has(agent.id) ? "checked" : ""}><span><strong>${h(agentLabel(agent, options.agents))}</strong></span></label>`).join("")}</fieldset><label>Shared world<select name="worldId" required><option value="">Choose a world</option>${options.worlds.map((w) => `<option value="${h(w.id)}" ${w.id === draft.worldId ? "selected" : ""}>${h(w.name)} \xB7 revision ${h(w.revision)}</option>`).join("")}</select></label>${options.worlds.length ? "" : '<p class="quiet-empty">Create a world from an agent\u2019s New test flow before starting a group run.</p>'}</section><section class="group-section"><div class="section-title"><h2>Tasks</h2><button type="button" data-group="add-task">Add task</button></div><div id="group-task-editors">${taskFields(draft.tasks)}</div><div class="task-start-bar"><label>Run at once<input name="concurrency" type="number" min="1" max="10" value="${h(draft.concurrency)}" required></label><span id="group-attempt-count">${total} trials across ${draft.agentIds.length} agents</span><button type="submit" class="primary" ${options.agents.length < 2 || options.worlds.length === 0 ? "disabled" : ""}>Review</button></div></section></form>`}`;
|
|
2612
2641
|
}
|
|
@@ -2795,8 +2824,8 @@ function toolTiles(tools, filters = {}, worlds2 = []) {
|
|
|
2795
2824
|
function toolsCatalog(tools, filters = {}, worlds2 = []) {
|
|
2796
2825
|
const categories = [...new Set(filteredTools(tools).map((t) => toolCategory[t.name] ?? "Tool"))];
|
|
2797
2826
|
return `<section class="tools-catalog k-stack" aria-label="Tool catalog"><div class="k-head"><h2 class="k-h2">Mock tools \xB7 ${tools.length}</h2><label class="mock-tool-search"><span class="sr-only">Search tools</span><input class="k-field" id="tools-search" type="search" placeholder="Search name, category or description" value="${h(filters.q ?? "")}"></label></div><div class="k-seg" role="group" aria-label="Tool category">${["", ...categories].map((category) => {
|
|
2798
|
-
const
|
|
2799
|
-
return `<button type="button" data-tool-category="${h(category)}" aria-pressed="${(filters.category ?? "") === category}">${h(category || "All")} <span class="k-count">${
|
|
2827
|
+
const count3 = category ? tools.filter((t) => (toolCategory[t.name] ?? "Tool") === category).length : tools.length;
|
|
2828
|
+
return `<button type="button" data-tool-category="${h(category)}" aria-pressed="${(filters.category ?? "") === category}">${h(category || "All")} <span class="k-count">${count3}</span></button>`;
|
|
2800
2829
|
}).join("")}</div><p class="tools-result-count k-meta" role="status">${filteredTools(tools, filters).length} of ${tools.length} tools</p><div id="tool-tiles">${toolTiles(tools, filters, worlds2)}</div></section>`;
|
|
2801
2830
|
}
|
|
2802
2831
|
function toolEndpoints(coverage) {
|
|
@@ -2861,7 +2890,7 @@ function comparisonSetup(runId, runs) {
|
|
|
2861
2890
|
function comparisonResults(result, labels) {
|
|
2862
2891
|
const percent2 = (rate) => `${(rate * 100).toLocaleString("en-US", { maximumFractionDigits: 1 })}%`;
|
|
2863
2892
|
const change = (delta) => delta === 0 ? "No change" : Math.abs(delta * 100) < 0.1 ? `${delta > 0 ? "Increase" : "Decrease"} under 0.1 percentage points` : `${delta > 0 ? "+" : "\u2212"}${Math.abs(delta * 100).toLocaleString("en-US", { maximumFractionDigits: 1 })} percentage points`;
|
|
2864
|
-
const attempts = (
|
|
2893
|
+
const attempts = (count3) => `${count3} ${count3 === 1 ? "attempt" : "attempts"}`;
|
|
2865
2894
|
return `<p>${result.regressed ? "Pass rate decreased in one or more scenarios." : "No decrease in pass rate."}</p><div class="table-wrap comparison-table"><table><thead><tr><th scope="col">Scenario</th><th scope="col">Before</th><th scope="col">After</th><th scope="col">Change</th></tr></thead><tbody>${result.scenes.map((s, index) => `<tr><th scope="row">${h(labels[s.sceneId] ?? `Scenario ${index + 1}`)}</th><td><strong>${percent2(s.before)}</strong><span class="comparison-attempts">${attempts(s.beforeTrials)}</span></td><td><strong>${percent2(s.after)}</strong><span class="comparison-attempts">${attempts(s.afterTrials)}</span></td><td>${badge(change(s.delta), s.delta > 0 ? "good" : s.delta < 0 ? "bad" : "")}</td></tr>`).join("")}</tbody></table></div><p class="hint">Observed pass rates; no claim of statistical significance.</p>${details("Comparison details", result)}`;
|
|
2866
2895
|
}
|
|
2867
2896
|
function dataSelection(item) {
|
|
@@ -3423,13 +3452,13 @@ function updateTaskCount() {
|
|
|
3423
3452
|
const form = document.querySelector("#playground-form");
|
|
3424
3453
|
if (!form) return;
|
|
3425
3454
|
rememberDraft();
|
|
3426
|
-
const draft = agentDraft(form.dataset.agent),
|
|
3455
|
+
const draft = agentDraft(form.dataset.agent), count3 = draft.tasks.reduce((n, t) => n + (Number.isFinite(t.attempts) ? t.attempts : 0), 0);
|
|
3427
3456
|
const summary = document.querySelector("#task-count");
|
|
3428
|
-
if (summary) summary.textContent = `${
|
|
3457
|
+
if (summary) summary.textContent = `${count3} ${count3 === 1 ? "trial" : "trials"} \xB7 ${Math.min(draft.concurrency, count3)} at a time`;
|
|
3429
3458
|
const submit = form.querySelector("button[type=submit]");
|
|
3430
|
-
if (submit) submit.disabled = !playgroundReadiness.ready || !configuredTools().length ||
|
|
3459
|
+
if (submit) submit.disabled = !playgroundReadiness.ready || !configuredTools().length || count3 < 1 || count3 > 100;
|
|
3431
3460
|
const limit = document.querySelector("#task-limit");
|
|
3432
|
-
if (limit) limit.textContent =
|
|
3461
|
+
if (limit) limit.textContent = count3 > 100 ? "Use at most 100 trials per run." : "";
|
|
3433
3462
|
}
|
|
3434
3463
|
function taskInputFields(input) {
|
|
3435
3464
|
const kind = input?.kind ?? "";
|
|
@@ -3855,8 +3884,8 @@ function setupData() {
|
|
|
3855
3884
|
function updateRunCount() {
|
|
3856
3885
|
const form = document.querySelector("#test-form");
|
|
3857
3886
|
if (!form) return;
|
|
3858
|
-
const values = new FormData(form),
|
|
3859
|
-
document.querySelector("#run-count").textContent = `${
|
|
3887
|
+
const values = new FormData(form), count3 = 1 + values.getAll("extraScenes").length, repeats = Number(values.get("trials") || 1), parallel = Number(values.get("parallel") || 1);
|
|
3888
|
+
document.querySelector("#run-count").textContent = `${count3 * repeats} ${count3 * repeats === 1 ? "attempt" : "attempts"}${count3 > 1 ? ` across ${count3} scenarios` : ""}${count3 * repeats > 1 ? ` \xB7 up to ${parallel} at a time` : ""}`;
|
|
3860
3889
|
}
|
|
3861
3890
|
async function testForm(selected = "", preferred = selectedAgent) {
|
|
3862
3891
|
boot = await api("/bootstrap");
|
package/lib/mcp-entry.mjs
CHANGED
|
@@ -66944,6 +66944,7 @@ var GitHubSeedSchema = external_exports.strictObject({
|
|
|
66944
66944
|
draft: external_exports.boolean().optional(),
|
|
66945
66945
|
user: refUse3.optional().describe("Author; defaults to the GitHub bot"),
|
|
66946
66946
|
labels: external_exports.array(external_exports.string()).optional(),
|
|
66947
|
+
assignees: external_exports.array(refUse3).optional().describe("Assigned GitHub users"),
|
|
66947
66948
|
at: duration6("Creation offset from start_time; must be <= 0; defaults to start_time").optional()
|
|
66948
66949
|
})).optional(),
|
|
66949
66950
|
issues: external_exports.array(external_exports.strictObject({
|
|
@@ -66954,6 +66955,7 @@ var GitHubSeedSchema = external_exports.strictObject({
|
|
|
66954
66955
|
state: external_exports.enum(["open", "closed"]).optional(),
|
|
66955
66956
|
user: refUse3.optional().describe("Author; defaults to the GitHub bot"),
|
|
66956
66957
|
labels: external_exports.array(external_exports.string()).optional(),
|
|
66958
|
+
assignees: external_exports.array(refUse3).optional().describe("Assigned GitHub users"),
|
|
66957
66959
|
at: duration6("Creation offset from start_time; must be <= 0; defaults to start_time").optional(),
|
|
66958
66960
|
edits: external_exports.array(GitHubContentEditSeed).optional().describe("Body edit history with absolute timestamps; editor defaults to the bot"),
|
|
66959
66961
|
timeline: external_exports.array(GitHubTimelineSeed).optional().describe("Issue events with absolute timestamps; actor defaults to the bot"),
|
|
@@ -67523,6 +67525,7 @@ var githubStarterSeed = {
|
|
|
67523
67525
|
name: "acme/orders",
|
|
67524
67526
|
default_branch: "main",
|
|
67525
67527
|
private: true,
|
|
67528
|
+
collaborators: [{ user: "$github_bot", permission: "write" }],
|
|
67526
67529
|
commits: [
|
|
67527
67530
|
{ ref: "github_pagination", message: "Paginate GET /orders", author: "$github_greg", at: "-50h", files: { "src/orders/list.ts": "export const defaultPageSize = 50;\nexport const maxPageSize = 200;\n" } },
|
|
67528
67531
|
{ ref: "github_node24", message: "Upgrade the runtime to Node 24", author: "$github_ben", at: "-30h", parents: ["$github_pagination"], files: { ".nvmrc": "24\n" } },
|
|
@@ -67543,7 +67546,7 @@ var githubStarterSeed = {
|
|
|
67543
67546
|
{ ref: "github_rate_limit_pr", number: 11, title: "Rate-limit order creation per API key", body: "120 orders per minute per key; returns 429 with Retry-After.", head: "$github_rate_limit", base: "main" }
|
|
67544
67547
|
],
|
|
67545
67548
|
issues: [
|
|
67546
|
-
{ ref: "github_export_issue", number: 13, title: "Explain delayed CSV exports", body: "Add a note that exports may take two minutes to appear.", state: "open", comments: [{ user: "$github_ben", body: "Support reported this during the Ridgeway pilot." }] },
|
|
67549
|
+
{ ref: "github_export_issue", number: 13, assignees: ["$github_ben"], title: "Explain delayed CSV exports", body: "Add a note that exports may take two minutes to appear.", state: "open", comments: [{ user: "$github_ben", body: "Support reported this during the Ridgeway pilot." }] },
|
|
67547
67550
|
{ ref: "github_cents_issue", number: 1, title: "Order totals off by one cent for multi-currency carts", body: "Rounding happens per line instead of per order.", state: "closed", comments: [{ user: "$github_greg", body: "Fixed by rounding once at the order level." }] },
|
|
67548
67551
|
{ ref: "github_page_issue", number: 2, title: "GET /orders is slow for large accounts", body: "Accounts with more than 50k orders time out after 30 seconds.", state: "closed" },
|
|
67549
67552
|
{ ref: "github_timeout_issue", number: 4, title: "Fulfillment webhooks time out after 10 seconds", body: "Warehouse partners sometimes take 15 seconds to acknowledge.", state: "closed", comments: [{ user: "$github_rachel", body: "Retries with backoff in #10." }] },
|
|
@@ -67562,6 +67565,7 @@ var githubStarterSeed = {
|
|
|
67562
67565
|
name: "acme/web",
|
|
67563
67566
|
default_branch: "main",
|
|
67564
67567
|
private: true,
|
|
67568
|
+
collaborators: [{ user: "$github_bot", permission: "write" }],
|
|
67565
67569
|
commits: [
|
|
67566
67570
|
{ ref: "github_web_main", message: "Release 2026.10.29", author: "$github_greg", at: "-30h", files: { "README.md": "# Acme web\n\nThe dashboard app.\n", "src/config.ts": "export const pollIntervalSeconds = 30;\n" } },
|
|
67567
67571
|
{ ref: "github_web_schedule", message: "Add the report schedule page", author: "$github_greg", at: "-3h", parents: ["$github_web_main"], files: { "src/config.ts": "export const pollIntervalSeconds = 30;\nexport const maxSchedulesPerUser = 10;\n" } }
|
|
@@ -67579,6 +67583,7 @@ var githubStarterSeed = {
|
|
|
67579
67583
|
name: "acme/warehouse-sync",
|
|
67580
67584
|
default_branch: "main",
|
|
67581
67585
|
private: true,
|
|
67586
|
+
collaborators: [{ user: "$github_bot", permission: "write" }],
|
|
67582
67587
|
commits: [{ ref: "github_sync_main", message: "Stream large tables in batches", author: "$github_victor", at: "-10h", files: { "README.md": "# Warehouse sync\n\nCopies customer warehouse tables into Acme.\n", "config/sync.ts": "export const batchSize = 5000;\nexport const syncIntervalMinutes = 15;\n" } }],
|
|
67583
67588
|
branches: [{ name: "main", head: "$github_sync_main" }],
|
|
67584
67589
|
production: "$github_sync_main",
|