@ancha-labs/cli 0.1.3 → 0.1.4

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.
@@ -170,7 +170,7 @@ function connectDefaults(detected) {
170
170
  const started = Array.isArray(detected?.evidence) && detected.evidence.includes("package.json") && /^(?:npm|pnpm) start$/.test(String(detected?.suggestions?.command ?? ""));
171
171
  return started ? { taskInputKind: "command", state: "stateless" } : {};
172
172
  }
173
- var toolNames = { slack: "Slack", "open-meteo": "Open-Meteo", datadog: "Datadog", pagerduty: "PagerDuty", github: "GitHub", "linkedin-ads": "LinkedIn Ads", salesforce: "Salesforce", gong: "Gong", "google-ads": "Google Ads", "chatgpt-ads": "ChatGPT Ads", hubspot: "HubSpot", ga4: "Google Analytics", gmail: "Gmail", "google-drive": "Google Drive", "amazon-s3": "Amazon S3", linear: "Linear", okta: "Okta", stripe: "Stripe", clerk: "Clerk", "better-stack": "Better Stack", notion: "Notion", attio: "Attio", dropbox: "Dropbox", resend: "Resend", "microsoft-word": "Microsoft Word", shopify: "Shopify", lob: "Lob", paypal: "PayPal", jira: "Jira", kalshi: "Kalshi", intercom: "Intercom", zendesk: "Zendesk", "google-calendar": "Google Calendar", twilio: "Twilio" };
173
+ var toolNames = { slack: "Slack", "open-meteo": "Open-Meteo", datadog: "Datadog", pagerduty: "PagerDuty", github: "GitHub", "linkedin-ads": "LinkedIn Ads", salesforce: "Salesforce", gong: "Gong", "google-ads": "Google Ads", "chatgpt-ads": "ChatGPT Ads", hubspot: "HubSpot", ga4: "Google Analytics", gmail: "Gmail", "google-drive": "Google Drive", "amazon-s3": "Amazon S3", linear: "Linear", okta: "Okta", stripe: "Stripe", clerk: "Clerk", "better-stack": "Better Stack", notion: "Notion", attio: "Attio", dropbox: "Dropbox", resend: "Resend", "microsoft-word": "Microsoft Word", shopify: "Shopify", lob: "Lob", paypal: "PayPal", jira: "Jira", kalshi: "Kalshi", intercom: "Intercom", zendesk: "Zendesk", "google-calendar": "Google Calendar", twilio: "Twilio", asana: "Asana", discord: "Discord", sentry: "Sentry", airtable: "Airtable" };
174
174
  var toolName = (name) => toolNames[name] ?? name;
175
175
  var toolLinks = (names) => names.map((name) => `<a class="tool-chip" href="/tools/${encodeURIComponent(name)}" data-nav>${h(toolName(name))}</a>`).join("");
176
176
  var toolDescription = (name) => ({ slack: "Channels, messages and threads", datadog: "Monitors, metrics and logs", pagerduty: "Incidents, on-call and escalation", github: "Repositories, pull requests and deployments" })[name] ?? "API capabilities";
@@ -221,7 +221,11 @@ var logos = {
221
221
  "jira": '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#0052CC" d="M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0Z"/></svg>',
222
222
  "google-calendar": '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#4285F4" d="M18.316 5.684H24v12.632h-5.684V5.684zM5.684 24h12.632v-5.684H5.684V24zM18.316 5.684V0H1.895A1.894 1.894 0 0 0 0 1.895v16.421h5.684V5.684h12.632zm-7.207 6.25v-.065c.272-.144.5-.349.687-.617s.279-.595.279-.982c0-.379-.099-.72-.3-1.025a2.05 2.05 0 0 0-.832-.714 2.703 2.703 0 0 0-1.197-.257c-.6 0-1.094.156-1.481.467-.386.311-.65.671-.793 1.078l1.085.452c.086-.249.224-.461.413-.633.189-.172.445-.257.767-.257.33 0 .602.088.816.264a.86.86 0 0 1 .322.703c0 .33-.12.589-.36.778-.24.19-.535.284-.886.284h-.567v1.085h.633c.407 0 .748.109 1.02.327.272.218.407.499.407.843 0 .336-.129.614-.387.832s-.565.327-.924.327c-.351 0-.651-.103-.897-.311-.248-.208-.422-.502-.521-.881l-1.096.452c.178.616.505 1.082.977 1.401.472.319.984.478 1.538.477a2.84 2.84 0 0 0 1.293-.291c.382-.193.684-.458.902-.794.218-.336.327-.72.327-1.149 0-.429-.115-.797-.344-1.105a2.067 2.067 0 0 0-.881-.689zm2.093-1.931l.602.913L15 10.045v5.744h1.187V8.446h-.827l-2.158 1.557zM22.105 0h-3.289v5.184H24V1.895A1.894 1.894 0 0 0 22.105 0zm-3.289 23.5l4.684-4.684h-4.684V23.5zM0 22.105C0 23.152.848 24 1.895 24h3.289v-5.184H0v3.289z"/></svg>',
223
223
  "intercom": '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#000000" d="M21 0H3C1.343 0 0 1.343 0 3v18c0 1.658 1.343 3 3 3h18c1.658 0 3-1.342 3-3V3c0-1.657-1.342-3-3-3zm-5.801 4.399c0-.44.36-.8.802-.8.44 0 .8.36.8.8v10.688c0 .442-.36.801-.8.801-.443 0-.802-.359-.802-.801V4.399zM11.2 3.994c0-.44.357-.799.8-.799s.8.359.8.799v11.602c0 .44-.357.8-.8.8s-.8-.36-.8-.8V3.994zm-4 .405c0-.44.359-.8.799-.8.443 0 .802.36.802.8v10.688c0 .442-.36.801-.802.801-.44 0-.799-.359-.799-.801V4.399zM3.199 6c0-.442.36-.8.802-.8.44 0 .799.358.799.8v7.195c0 .441-.359.8-.799.8-.443 0-.802-.36-.802-.8V6zM20.52 18.202c-.123.105-3.086 2.593-8.52 2.593-5.433 0-8.397-2.486-8.521-2.593-.335-.288-.375-.792-.086-1.128.285-.334.79-.375 1.125-.09.047.041 2.693 2.211 7.481 2.211 4.848 0 7.456-2.186 7.479-2.207.334-.289.839-.25 1.128.086.289.336.25.84-.086 1.128zm.281-5.007c0 .441-.36.8-.801.8-.441 0-.801-.36-.801-.8V6c0-.442.361-.8.801-.8.441 0 .801.357.801.8v7.195z"/></svg>',
224
- "zendesk": '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#03363D" d="M12.914 2.904V16.29L24 2.905H12.914zM0 2.906C0 5.966 2.483 8.45 5.543 8.45s5.542-2.484 5.543-5.544H0zm11.086 4.807L0 21.096h11.086V7.713zm7.37 7.84c-3.063 0-5.542 2.48-5.542 5.543H24c0-3.06-2.48-5.543-5.543-5.543z"/></svg>'
224
+ "zendesk": '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#03363D" d="M12.914 2.904V16.29L24 2.905H12.914zM0 2.906C0 5.966 2.483 8.45 5.543 8.45s5.542-2.484 5.543-5.544H0zm11.086 4.807L0 21.096h11.086V7.713zm7.37 7.84c-3.063 0-5.542 2.48-5.542 5.543H24c0-3.06-2.48-5.543-5.543-5.543z"/></svg>',
225
+ // Asana, Discord and Sentry: the website's marks (Simple Icons 16.35.0, CC0-1.0), in their brand colours.
226
+ "asana": '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#F06A6A" d="M18.78 12.653c-2.882 0-5.22 2.336-5.22 5.22s2.338 5.22 5.22 5.22 5.22-2.34 5.22-5.22-2.336-5.22-5.22-5.22zm-13.56 0c-2.88 0-5.22 2.337-5.22 5.22s2.338 5.22 5.22 5.22 5.22-2.338 5.22-5.22-2.336-5.22-5.22-5.22zm12-6.525c0 2.883-2.337 5.22-5.22 5.22-2.882 0-5.22-2.337-5.22-5.22 0-2.88 2.338-5.22 5.22-5.22 2.883 0 5.22 2.34 5.22 5.22z"/></svg>',
227
+ "discord": '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#5865F2" d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg>',
228
+ "sentry": '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#362D59" d="M13.91 2.505c-.873-1.448-2.972-1.448-3.844 0L6.904 7.92a15.478 15.478 0 0 1 8.53 12.811h-2.221A13.301 13.301 0 0 0 5.784 9.814l-2.926 5.06a7.65 7.65 0 0 1 4.435 5.848H2.194a.365.365 0 0 1-.298-.534l1.413-2.402a5.16 5.16 0 0 0-1.614-.913L.296 19.275a2.182 2.182 0 0 0 .812 2.999 2.24 2.24 0 0 0 1.086.288h6.983a9.322 9.322 0 0 0-3.845-8.318l1.11-1.922a11.47 11.47 0 0 1 4.95 10.24h5.915a17.242 17.242 0 0 0-7.885-15.28l2.244-3.845a.37.37 0 0 1 .504-.13c.255.14 9.75 16.708 9.928 16.9a.365.365 0 0 1-.327.543h-2.287c.029.612.029 1.223 0 1.831h2.297a2.206 2.206 0 0 0 1.922-3.31z"/></svg>'
225
229
  };
226
230
  var pngLogos = {
227
231
  "kalshi": "iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAIAAABMXPacAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAgKADAAQAAAABAAAAgAAAAABIjgR3AAAhEElEQVR4Ae1d6Y8lV3W/Sy2v3tbbLLZnxjZeZIMx8SLGLHZMDBhQ2KIAIVIihU8h+Z4PkfI3gBRFSqJEShRFSYggAhFCgowB2yzBGDDYAY8HJmPP1tPb22u7S36nql/P9HTVuGtc0x2kd+fN63r3Vd3lnHv2c+/j/LnPsFnZPwiI/et61jNBYIaAfV4HMwTMELDPENjn7mcUMEPAPkNgn7ufUcAMAfsMgX3ufkYBMwTsMwT2ufsZBcwQsM8Q2OfuZxQwQ8A+Q2Cfu59RwAwB+wyBfe5+RgEzBOwzBPa5+xkFzBCwzxDY5+5nFDBDwD5DYJ+7n1HAPiPAqat/KxmzhlnmadFUXDIeOmwitLQc5YperLWoKaz3DNfcpoJZRzCJP2jTMil5pK5o5OofXcMSDIlZoVkjNq7lyhXGkyHThf0ywzEg6isfbX6B9zZjE7uQ0Erte9agOSZczVMTM8+jEWrDjBVcekwIbdH+1Qd2xbe1IYApgikTPOFWO5YLodC2sGxssi+u6Jc+FtbHHh7jAlNS1kmN1YZbKzkbVxypqwFppiUzLp8AphgFYIdGQl3YL+fSGr0J/XywlmZhI81SphTB2KS4wTDFPAyt6UsutTGEALQo8ddorRnGWqVUnFZ50wGTKTO0Sl0sYU7jEFhTjg1M+UMF35gGliHnmgEBX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+UVqLUilcFkPcWRwQ6YTbJV3eMsLbr3JePSbYtMGdv13nOiWv9JiwSNv8YO2fXW1D52og9+0mcZLt7e0AZK7NMzpdwCpCEA2kB8RjtDHKHCkHQYDUZ4kdJAugt7YCEUmS1aIBU2f3d3f2hDQsAIHRWIrL9xx+HUJhAwXP/pwL+DlQaVC+LOxinHWh4vfLDJO23VGOCq14U2w2zSqhgNfyxjE5LvqlgNBq9lC6q3Pw45HNkFhKR4OqBEZi4Z+IBO7Yl0IWvBOZOUZth46TVAoYtWw7+ClpfMFgUJcFTZfVlkbArJuCfsgZPisWMNND+AMVY3TVYv7Bt8sLIgLgoqVk1KucpYniwZB5RULRXBinK/OkPK2cbi5TrYFXKkUYCtsKT8rZedXkEcwM+jXf8A/AXeodGiCC39pHisNk6NpYPLwlGOVVHcS1YYAuOkpDoWhYUBYE3TkLKWoeMgjn7L+7Rf4hBVD9LvtAiSTwmtGh8QjMSGgH1QVMcUj6f7dFzKWkNIItzhYBPaIgWnAKE5wJDo1tLPfNE+ExmByRrR1QQfi4HQ5StfFQPGTnQ5iz9i/1sgcVdgJDqwS5wFlkKldUQSgt+c+s/tZze6sHQLF9Fh7N7MGyyAwQ0AZZPaofoaAPQJ0WTczBJRBZo/qZwjYI0CXdTNDQBlk9qh+hoA9AnRZNzMElEFmj+pnCNgjQJd1M0NAGWT2qH6GgD0CdFk3MwSUQWaP6mcI2CNAl3UzQ0AZZPaofoaAPQJ0WTczBJRBZo/qZwjYI0CXdTNDQBlk9qh+hoA9AnRZNzMElEFmj+pnCNgjQJd1M0NAGWT2qH6GgD0CdFk3/wf64ITzs3rZfgAAAABJRU5ErkJggg==",
@@ -982,7 +986,7 @@ function executionSummary(attempts) {
982
986
  invalid,
983
987
  graded: passed + failed,
984
988
  ungraded: attempts.length - passed - failed - invalid,
985
- toolCalls: attempts.reduce((sum, a) => sum + (Number(a.toolCalls) || 0), 0),
989
+ toolCalls: attempts.reduce((sum2, a) => sum2 + (Number(a.toolCalls) || 0), 0),
986
990
  medianMs: durations.length ? durations[Math.floor((durations.length - 1) / 2)] : void 0
987
991
  };
988
992
  }
@@ -1295,9 +1299,9 @@ function taskChecks(task, index) {
1295
1299
  } catch {
1296
1300
  throw new Error(`Task ${index + 1}: checks must be valid JSON, a list like [{"id": "posted", "trace": {"called": "* /api/chat.postMessage"}}]`);
1297
1301
  }
1298
- const list3 = Array.isArray(parsed) ? parsed : [parsed];
1299
- if (list3.some((item) => !item || typeof item !== "object" || Array.isArray(item))) throw new Error(`Task ${index + 1}: each check must be an object with an id and a state or trace check`);
1300
- return list3;
1302
+ const list4 = Array.isArray(parsed) ? parsed : [parsed];
1303
+ if (list4.some((item) => !item || typeof item !== "object" || Array.isArray(item))) throw new Error(`Task ${index + 1}: each check must be an object with an id and a state or trace check`);
1304
+ return list4;
1301
1305
  }
1302
1306
  function workspaceDefinition(draft) {
1303
1307
  return {
@@ -1365,14 +1369,14 @@ function mountWorldWorkspace(node, options) {
1365
1369
  if (disposed) return;
1366
1370
  const currentRuns = selected ? setupRuns(runs, selected) : [], run = currentRuns[0], attempts = run?.attempts ?? [], tasks = selected?.tasks ?? [], choices = worldSetups(tests, world.id, agentId);
1367
1371
  node.innerHTML = `<div class="ww-workspace"><header class="ww-header"><h1>${h(world.name)}</h1><div class="ww-world-actions"><label class="ww-agent-select">Agent<select data-ww-select="agent"><option value="" disabled>Choose agent</option>${agents.map((a) => `<option value="${h(a.id)}" ${a.id === agentId ? "selected" : ""}>${h(agentLabel(a, agents))}</option>`).join("")}</select></label><button type="button" data-ww="configure">Configure</button>${selected ? options.runActions?.(selected.id) ?? button("Run tasks", "run-saved-test", selected.id, "primary") : ""}</div></header>${peopleSection(world)}<p class="ww-error" role="alert" ${error ? "" : "hidden"}>${h(error)}</p>${errors.map((e) => `<p class="ww-error" role="alert">${h(e.message)}</p>`).join("")}${!loaded ? '<p role="status">Loading tasks\u2026</p>' : ""}${choices.length > 1 ? `<label class="ww-setup-select">Configuration<select data-ww-select="test">${!selected ? '<option value="" selected disabled>New configuration</option>' : ""}${choices.map((t) => `<option value="${h(t.id)}" ${t.id === selected?.id ? "selected" : ""}>${h(t.name)}</option>`).join("")}</select></label>` : ""}${loaded && configure ? configuration2() : loaded ? `${summaryWidgets(attempts, hasChecks(run?.tasks ?? tasks))}<div class="ww-section-heading"><h2>Tasks${tasks.length ? ` <span class="ww-task-count">${tasks.length}</span>` : ""}</h2><div class="actions">${worldHistory(runs, world.id, agentId || void 0).length || selected ? `<button type="button" data-ww="history" aria-expanded="${showHistory}">History</button>` : ""}<button type="button" data-ww="configure">${tasks.length ? "Edit tasks" : "Add tasks"}</button></div></div>${tasks.length ? `<section class="ww-task-table"><div class="ww-table-head"><span>Task</span><span>Result</span><span>Attempts</span><span>Median</span><span></span></div>${tasks.map((task, index) => {
1368
- const list3 = attempts.filter((a) => a.taskId === task.id), taskURL = run ? `/playgrounds/${enc(run.id)}?task=${enc(task.id)}${list3[0] ? "&attempt=" + enc(list3[0].id) : ""}` : "";
1372
+ const list4 = attempts.filter((a) => a.taskId === task.id), taskURL = run ? `/playgrounds/${enc(run.id)}?task=${enc(task.id)}${list4[0] ? "&attempt=" + enc(list4[0].id) : ""}` : "";
1369
1373
  return `<article class="ww-task-row"><div class="ww-task-identity">${taskURL ? `<a data-nav class="ww-task-name" href="${taskURL}"><span class="ww-ordinal">${index + 1}</span><strong>${h(label(task, index))}</strong></a>` : `<strong class="ww-task-name"><span class="ww-ordinal">${index + 1}</span>${h(label(task, index))}</strong>`}<p class="ww-task-prompt" title="${h(task.prompt)}">${h(task.prompt)}</p></div>${(() => {
1370
- const o = taskOutcome(list3, hasChecks([task]));
1374
+ const o = taskOutcome(list4, hasChecks([task]));
1371
1375
  return `<div class="ww-rate ${o.tone}"><strong>${h(o.value)}</strong><span>${h(o.note)}</span></div>`;
1372
- })()}<div class="ww-attempt-marks" role="group" aria-label="Attempts for ${h(label(task, index))}">${list3.map((a) => {
1376
+ })()}<div class="ww-attempt-marks" role="group" aria-label="Attempts for ${h(label(task, index))}">${list4.map((a) => {
1373
1377
  const o = attemptOutcome(a);
1374
1378
  return `<a data-nav class="ww-attempt-mark ${h(a.status)} outcome-${o.key}" href="/playgrounds/${enc(run.id)}?task=${enc(task.id)}&attempt=${enc(a.id)}" title="Attempt ${a.number}: ${h(attemptLabel(a.status))} \xB7 ${o.label}" aria-label="Attempt ${a.number}: ${h(attemptLabel(a.status))} \xB7 ${o.label}">${attemptMark(a)}</a>`;
1375
- }).join("") || `<span class="muted">Repeat ${h(task.attempts)} times</span>`}</div><span class="ww-task-time">${list3.length ? h(medianTime(list3)) : ""}</span>${taskURL ? `<a data-nav class="ww-row-inspect" href="${taskURL}" aria-label="Inspect ${h(label(task, index))}">\u2192</a>` : "<span></span>"}</article>`;
1379
+ }).join("") || `<span class="muted">Repeat ${h(task.attempts)} times</span>`}</div><span class="ww-task-time">${list4.length ? h(medianTime(list4)) : ""}</span>${taskURL ? `<a data-nav class="ww-row-inspect" href="${taskURL}" aria-label="Inspect ${h(label(task, index))}">\u2192</a>` : "<span></span>"}</article>`;
1376
1380
  }).join("")}</section>` : `<div class="quiet-empty">${agents.length ? "Add tasks to this world." : '<a data-nav href="/agents">Connect an agent</a>'}</div>`}${selected && !currentRuns.length && setupHistory(runs, selected).some((item) => item.earlier) ? '<p class="ww-snapshot-notice">This configuration has changed. Earlier attempts are in History.</p>' : ""}${showHistory ? history2() : ""}` : ""}</div>`;
1377
1381
  }
1378
1382
  function history2() {
@@ -1520,21 +1524,26 @@ function mountWorldWorkspace(node, options) {
1520
1524
  }
1521
1525
 
1522
1526
  // frontend/src/workspace-view.ts
1523
- var VIEW_SECTIONS = /* @__PURE__ */ new Set(["playgrounds", "settings", "help"]);
1527
+ var VIEW_SECTIONS = /* @__PURE__ */ new Set(["worlds", "agents", "playgrounds", "settings", "help"]);
1524
1528
  var viewMode = (boot2) => boot2.mode === "view";
1529
+ var viewServes = (section, sub) => VIEW_SECTIONS.has(section) && !(sub && (section === "worlds" || section === "agents"));
1530
+ function snapshotNote(answer) {
1531
+ if (!answer.snapshotAt) return '<p class="quiet-empty">This list fills in once the workspace has answered. Start it to see it now.</p>';
1532
+ return `<p class="view-note">As the workspace last listed them, ${h(new Date(String(answer.snapshotAt)).toLocaleString([], { dateStyle: "medium", timeStyle: "short" }))}.</p>`;
1533
+ }
1525
1534
  function hoursLabel(value) {
1526
1535
  const n = Number(value) || 0, scale = n >= 10 ? 10 : 100;
1527
1536
  return `${String(Math.round(n * scale) / scale)} hosted ${n === 1 ? "hour" : "hours"}`;
1528
1537
  }
1529
1538
  function viewBanner(boot2, now = /* @__PURE__ */ new Date()) {
1530
1539
  const machine = boot2.machine ?? {};
1531
- if (machine.state === "starting") return '<section class="view-banner" role="status"><span class="status-spinner" aria-hidden="true"></span><div><strong>Your workspace is starting\u2026</strong><p>Worlds, agents and tools open here when it is up. This page reloads by itself.</p></div></section>';
1540
+ if (machine.state === "starting") return '<section class="view-banner" role="status"><span class="status-spinner" aria-hidden="true"></span><div><strong>Your workspace is starting\u2026</strong><p>Worlds, agents and tools open here when it is up, and runs started in the workspace are listed again. This page reloads by itself.</p></div></section>';
1532
1541
  if (machine.state === "capped") {
1533
1542
  const month = now.toLocaleString("en-US", { month: "long", timeZone: "UTC" }), ask = boot2.hosted?.execution === false;
1534
1543
  return `<section class="view-banner" role="status"><div><strong>Hosted hours used for ${h(month)}</strong><p>This workspace used its ${h(hoursLabel(machine.hoursCap))} for ${h(month)}. Your data is kept; the workspace wakes again on the 1st. Keep working with <code>ancha run</code> on your computer${ask ? ', or <a href="/account#hosted">request hosted access</a>' : ""}.</p></div></section>`;
1535
1544
  }
1536
1545
  const asleep = machine.state === "absent" ? "Your workspace hasn\u2019t started yet." : "Your workspace is asleep.";
1537
- return `<section class="view-banner" role="status"><div><strong>${asleep}</strong><p>Runs you upload are here. Worlds, agents and tools need the workspace running.</p></div>${machine.canStart ? button("Start workspace", "start-workspace", "", "primary") : '<p class="muted">This workspace is read-only right now.</p>'}</section>`;
1546
+ return `<section class="view-banner" role="status"><div><strong>${asleep}</strong><p>Runs you upload are here, and your worlds and agents as the workspace last listed them. Start it to work with them.</p></div>${machine.canStart ? button("Start workspace", "start-workspace", "", "primary") : '<p class="muted">This workspace is read-only right now.</p>'}</section>`;
1538
1547
  }
1539
1548
  function viewStartPage(boot2) {
1540
1549
  return `${viewBanner(boot2)}<p class="view-note">Runs you upload stay readable while the workspace sleeps: <a href="/playgrounds" data-nav>see your runs</a>.</p>`;
@@ -1549,8 +1558,74 @@ function startHeartbeat(ping, options = {}) {
1549
1558
  }, intervalMs);
1550
1559
  }
1551
1560
 
1561
+ // frontend/src/tool-meta.ts
1562
+ var toolOrder = ["slack", "discord", "github", "linear", "jira", "asana", "notion", "microsoft-word", "airtable", "gmail", "resend", "lob", "twilio", "google-calendar", "google-drive", "dropbox", "amazon-s3", "okta", "clerk", "stripe", "paypal", "shopify", "kalshi", "datadog", "sentry", "better-stack", "pagerduty", "hubspot", "salesforce", "attio", "intercom", "zendesk", "gong", "ga4", "google-ads", "linkedin-ads", "chatgpt-ads", "open-meteo"];
1563
+ var toolCategory = { slack: "Team chat", discord: "Community chat", asana: "Projects", airtable: "Databases", sentry: "Errors", github: "Code", gmail: "Email", resend: "Email", "google-drive": "Files", dropbox: "Files", "amazon-s3": "Files", linear: "Issues", okta: "Identity", clerk: "Identity", stripe: "Payments", paypal: "Payments", shopify: "Commerce", lob: "Mail", jira: "Issues", kalshi: "Markets", intercom: "Support", zendesk: "Support", "google-calendar": "Calendar", twilio: "SMS & voice", notion: "Docs", "microsoft-word": "Docs", datadog: "Monitoring", "better-stack": "Uptime", pagerduty: "Incidents", hubspot: "CRM", salesforce: "CRM", attio: "CRM", gong: "Sales calls", ga4: "Analytics", "google-ads": "Ads", "linkedin-ads": "Ads", "chatgpt-ads": "Ads", "open-meteo": "Weather" };
1564
+ var starterCounts = {
1565
+ slack: [["users", "Members"], ["channels", "Channels"], ["messages", "Messages"]],
1566
+ github: [["repos", "Repositories"], ["pulls", "Pull requests"], ["issues", "Issues"], ["commits", "Commits"]],
1567
+ datadog: [["monitors", "Monitors"], ["dashboards", "Dashboards"], ["metrics", "Metrics"], ["logs", "Log lines"]],
1568
+ pagerduty: [["services", "Services"], ["users", "People"], ["incidents", "Incidents"]],
1569
+ hubspot: [["companies", "Companies"], ["contacts", "Contacts"], ["deals", "Deals"]],
1570
+ salesforce: [["accounts", "Accounts"], ["contacts", "Contacts"], ["leads", "Leads"], ["opportunities", "Opportunities"]],
1571
+ gong: [["users", "People"], ["calls", "Calls"]],
1572
+ ga4: [["properties", "Properties"], ["sessions", "Sessions"]],
1573
+ "google-ads": [["campaigns", "Campaigns"], ["adGroups", "Ad groups"], ["ads", "Ads"]],
1574
+ "linkedin-ads": [["campaigns", "Campaigns"], ["creatives", "Creatives"]],
1575
+ "chatgpt-ads": [["campaigns", "Campaigns"], ["ads", "Ads"], ["insights", "Insight rows"]],
1576
+ "open-meteo": [["locations", "Places"]],
1577
+ gmail: [["mailboxes", "Mailboxes"], ["threads", "Threads"], ["messages", "Messages"], ["drafts", "Drafts"]],
1578
+ "google-drive": [["folders", "Folders"], ["files", "Files"], ["permissions", "Shares"], ["comments", "Comments"]],
1579
+ "amazon-s3": [["buckets", "Buckets"], ["objects", "Objects"]],
1580
+ linear: [["teams", "Teams"], ["projects", "Projects"], ["issues", "Issues"], ["users", "People"]],
1581
+ okta: [["users", "People"], ["groups", "Groups"], ["apps", "Applications"], ["logs", "Log events"]],
1582
+ stripe: [["customers", "Customers"], ["subscriptions", "Subscriptions"], ["invoices", "Invoices"], ["payment_intents", "Payments"]],
1583
+ clerk: [["users", "Users"], ["organizations", "Organizations"], ["invitations", "Invitations"], ["sessions", "Sessions"]],
1584
+ "better-stack": [["monitors", "Monitors"], ["heartbeats", "Heartbeats"], ["incidents", "Incidents"], ["statusPages", "Status pages"]],
1585
+ notion: [["pages", "Pages"], ["databases", "Databases"], ["blocks", "Blocks"], ["comments", "Comments"]],
1586
+ attio: [["people", "People"], ["companies", "Companies"], ["deals", "Deals"], ["tasks", "Tasks"]],
1587
+ dropbox: [["folders", "Folders"], ["files", "Files"], ["sharedLinks", "Shared links"], ["sharedFolders", "Shared folders"]],
1588
+ resend: [["emails", "Emails"], ["broadcasts", "Broadcasts"], ["domains", "Domains"], ["contacts", "Contacts"]],
1589
+ "microsoft-word": [["documents", "Documents"], ["folders", "Folders"], ["permissions", "Shares"]],
1590
+ shopify: [["orders", "Orders"], ["products", "Products"], ["customers", "Customers"], ["locations", "Locations"]],
1591
+ lob: [["letters", "Letters"], ["postcards", "Postcards"], ["checks", "Checks"], ["addresses", "Addresses"]],
1592
+ paypal: [["orders", "Orders"], ["payments", "Payments"], ["subscriptions", "Subscriptions"], ["plans", "Plans"]],
1593
+ jira: [["projects", "Projects"], ["issues", "Issues"], ["sprints", "Sprints"], ["users", "People"]],
1594
+ kalshi: [["markets", "Markets"], ["orders", "Orders"], ["fills", "Fills"], ["positions", "Positions"]],
1595
+ intercom: [["conversations", "Conversations"], ["contacts", "Contacts"], ["companies", "Companies"], ["articles", "Articles"]],
1596
+ zendesk: [["tickets", "Tickets"], ["users", "People"], ["organizations", "Organizations"]],
1597
+ "google-calendar": [["calendars", "Calendars"], ["events", "Events"]],
1598
+ twilio: [["messages", "Messages"], ["calls", "Calls"], ["numbers", "Phone numbers"], ["verifications", "Verifications"]],
1599
+ asana: [["projects", "Projects"], ["tasks", "Tasks"], ["subtasks", "Subtasks"], ["comments", "Comments"]],
1600
+ discord: [["channels", "Channels"], ["threads", "Threads"], ["messages", "Messages"], ["members", "Members"]],
1601
+ sentry: [["projects", "Projects"], ["issues", "Issues"], ["releases", "Releases"], ["members", "Members"]],
1602
+ airtable: [["bases", "Bases"], ["tables", "Tables"], ["records", "Records"], ["comments", "Comments"]]
1603
+ };
1604
+ var list3 = (value) => Array.isArray(value) ? value : [];
1605
+ var sum = (values) => values.reduce((total, n) => total + n, 0);
1606
+ function starterCount(tool, key, state) {
1607
+ const isFolder = (f) => f.mimeType === "application/vnd.google-apps.folder";
1608
+ if (key === "issues" && Array.isArray(state.pulls)) return list3(state.issues).length - state.pulls.length;
1609
+ if (tool === "google-drive" && Array.isArray(state.files) && (key === "files" || key === "folders")) return state.files.filter((f) => isFolder(f) === (key === "folders")).length;
1610
+ if (tool === "datadog" && key === "metrics" && Array.isArray(state.metrics)) return new Set(state.metrics.map((m) => m.metric ?? m.name)).size;
1611
+ if (tool === "attio" && ["people", "companies", "deals"].includes(key) && Array.isArray(state.records)) return state.records.filter((r) => r.object === key).length;
1612
+ if (tool === "dropbox" && (key === "files" || key === "folders") && Array.isArray(state.entries)) return state.entries.filter((e) => e.kind === key.slice(0, -1)).length;
1613
+ if (tool === "microsoft-word" && (key === "documents" || key === "folders") && Array.isArray(state.items)) return state.items.filter((i) => i.kind === (key === "folders" ? "folder" : "file")).length;
1614
+ if (tool === "lob" && ["letters", "postcards", "checks"].includes(key) && Array.isArray(state.mail)) return state.mail.filter((m) => m.kind === key.slice(0, -1)).length;
1615
+ if (tool === "asana" && ["tasks", "subtasks", "comments"].includes(key) && Array.isArray(state.tasks)) {
1616
+ if (key === "comments") return sum(state.tasks.map((t) => list3(t.comments).length));
1617
+ return state.tasks.filter((t) => Boolean(t.parent) === (key === "subtasks")).length;
1618
+ }
1619
+ if (tool === "discord" && (key === "channels" || key === "threads") && Array.isArray(state.channels)) return state.channels.filter((c) => key === "threads" ? c.type === "thread" : c.type !== "thread" && c.type !== "category").length;
1620
+ if (tool === "airtable" && ["tables", "records", "comments"].includes(key) && Array.isArray(state.bases)) {
1621
+ const tables = state.bases.flatMap((b) => list3(b.tables)), records2 = tables.flatMap((t) => list3(t.records));
1622
+ return key === "tables" ? tables.length : key === "records" ? records2.length : sum(records2.map((r) => list3(r.comments).length));
1623
+ }
1624
+ return Array.isArray(state[key]) ? state[key].length : void 0;
1625
+ }
1626
+
1552
1627
  // frontend/src/generated/coding-agent-skill.ts
1553
- var codingAgentSkill = "---\nname: ancha\ndescription: Test, debug and fix an AI agent (a Slack bot, a support or on-call agent) against stateful replicas of the tools it uses, and prove a fix with graded runs. Use when asked to test an agent with Ancha, or in a repository that has ancha.yaml.\n---\n\n# Ancha\n\nAncha gives an AI agent the other side of its job: stateful replicas of the tools it uses (Slack, GitHub, Datadog, PagerDuty and more), seeded with one fictional company, and checks that grade every attempt from the agent's calls and the world's end state. The verdict comes from the world, not from mocks you wrote yourself.\n\n## Run the CLI\n\nBefore the CLI is installed, run every command as `npx -y @ancha-labs/cli <command>`. After `npm install -g @ancha-labs/cli` (Node 24 or newer), run `ancha <command>`. Never run `npx` with the bare name `ancha`: that npm name is not this package.\n\nAdd `--json` to every command. Runs print NDJSON events that end with `run_finished`; everything else prints one JSON object. `ancha schema <kind> --json` prints the JSON Schema of `ancha.yaml`, scene files and these outputs. If your command can time out, give `ancha run` an `--idempotency-key <key>`: running it again with the same key returns the same run instead of starting another.\n\n## The loop\n\n1. `ancha init --agent \"<the command that starts the agent>\"`, once, in the agent's project, if it has no `ancha.yaml` yet. It writes `ancha.yaml`, `scenes/starter/`, the coding-agent skill, and `.ancha/` in `.gitignore`. It installs and runs nothing.\n2. `ancha doctor --json` checks the config and scenes and runs the agent once. A tool the agent didn't call is a warning, not a failure.\n3. `ancha run --json` runs every scene in fresh worlds. Exit 1 means a check failed.\n4. `ancha explain latest --json` shows each failed check: what was expected, what happened, and the calls and world events behind it. Read it before guessing from the code; many bugs only show up with the world's data and timing.\n5. `ancha baseline save before` keeps the failing run as the reference.\n6. Fix the agent's code.\n7. `ancha run --compare before --json` proves the fix: exit 0 means every check passes and nothing regressed.\n\nThe starter scene only proves that the agent reaches each tool. Write scenes for its real job: `ancha docs scenes`.\n\n## The rule\n\nFix the agent, not `ancha.yaml`, the scenes or their checks. The exception is a check that is wrong for the real API, such as a method the official SDK never sends. Then don't quietly edit it: tell the user, show the evidence (the call from `ancha explain`, the vendor's documentation), and change it only with their agreement.\n\nNever give the agent under test the scenes, checks, seeds or reference companions (`oracle.mjs`, `null.mjs`), and never point it at a real SaaS API.\n\n## What the agent gets\n\nEach trial gives the agent its tools as environment variables, with fake credentials that only work against the replicas:\n\n- Slack: `SLACK_API_URL` (ends in `/api/`), `SLACK_BOT_TOKEN`\n- GitHub: `GITHUB_API_URL`, `GITHUB_TOKEN`\n- Datadog: `DATADOG_API_URL`, `DD_API_KEY`, `DD_APP_KEY`\n- PagerDuty: `PAGERDUTY_API_URL`, `PAGERDUTY_API_TOKEN`, `PAGERDUTY_FROM_EMAIL`, `PAGERDUTY_ROUTING_KEY`\n- the same pattern for the other tools in the world; `ANCHA_TASK` carries a command-line task.\n\n`ancha connect <tool> --lang ts|py` prints the SDK settings. `ancha twins coverage <tool>` lists the endpoints each replica implements.\n\n`ancha run` starts the agent on this computer. It has this computer's network, and an environment limited to Ancha's variables, the tools' variables and the names allowed in `agent.pass_env` in `ancha.yaml` (or `--pass-env NAME`). For a sealed run, set `agent.execution: { mode: container, image: node:24-slim }` in `ancha.yaml`; it needs Docker.\n\n## Hosted workspace\n\nIf the user has an Ancha workspace, `ancha login` asks them to approve this computer once in the browser; ask them to do it. After that, `ancha run` still runs its worlds on this computer; `ancha run --upload --json` sends the finished run to their workspace, where the console shows it (`upload.url` in the JSON). `ancha whoami --json` shows the workspace and where runs put their worlds. In CI, `ANCHA_SERVER_URL` and `ANCHA_API_KEY` replace the login: `ancha run --local --upload --json`. `ancha secrets set NAME` copies a provider key from this shell into the workspace for agents that run there.\n\nRunning the agent itself in the cloud is a console flow at https://app.ancha.io: Bring your agent, Connect, tasks with checks, Run. Send the user there for it.\n\n## When something fails\n\n- Exit 1: a check failed or the comparison regressed (a single check's drop counts, see `comparison.droppedChecks`). Run `ancha explain latest --json`.\n- Exit 2: usage, config, scene or authentication error. `AUTH_INVALID` means `ancha login` again or a valid `ANCHA_API_KEY`. Read the `hint`.\n- Exit 3: infrastructure, or a trial the harness couldn't complete. That's not the agent's fault; run again, and `ancha doctor --json` if it repeats.\n- Exit 4, only with `--strict`: the agent called an endpoint a replica doesn't implement. `ancha explain` lists these coverage gaps even without `--strict`; check `ancha twins coverage <tool>` before changing the agent.\n\nEvery error has a stable `code` and a `hint` that names the next command. More: `ancha docs`, `ancha docs <topic>` for setup, run, explain, compare, scenes, integrations, cloud and playgrounds, and https://ancha.mintlify.app/coding-agents.\n\nTell the user what you ran, the pass rate and the evidence. Never claim a fix until `ancha run --compare` exits 0.\n";
1628
+ var codingAgentSkill = "---\nname: ancha\ndescription: Test, debug and fix an AI agent (a Slack bot, a support or on-call agent) against stateful replicas of the tools it uses, and prove a fix with graded runs. Use when asked to test an agent with Ancha, or in a repository that has ancha.yaml.\n---\n\n# Ancha\n\nAncha gives an AI agent the other side of its job: stateful replicas of the tools it uses (Slack, GitHub, Datadog, PagerDuty and more), seeded with one fictional company, and checks that grade every attempt from the agent's calls and the world's end state. The verdict comes from the world, not from mocks you wrote yourself.\n\n## Run the CLI\n\nBefore the CLI is installed, run every command as `npx -y @ancha-labs/cli <command>`. After `npm install -g @ancha-labs/cli` (Node 24 or newer), run `ancha <command>`. Never run `npx` with the bare name `ancha`: that npm name is not this package.\n\nAdd `--json` to every command. Runs print NDJSON events that end with `run_finished`; everything else prints one JSON object. `ancha schema <kind> --json` prints the JSON Schema of `ancha.yaml`, scene files and these outputs. If your command can time out, give `ancha run` an `--idempotency-key <key>`: running it again with the same key returns the same run instead of starting another.\n\n## The loop\n\n1. `ancha init --agent \"<the command that starts the agent>\"`, once, in the agent's project, if it has no `ancha.yaml` yet. It writes `ancha.yaml`, `scenes/starter/`, the coding-agent skill, and `.ancha/` in `.gitignore`. It installs and runs nothing.\n2. `ancha doctor --json` checks the config and scenes and runs the agent once. A tool the agent didn't call is a warning, not a failure.\n3. `ancha run --json` runs every scene in fresh worlds. Exit 1 means a check failed.\n4. `ancha explain latest --json` shows each failed check: what was expected, what happened, and the calls and world events behind it. Read it before guessing from the code; many bugs only show up with the world's data and timing.\n5. `ancha baseline save before` keeps the failing run as the reference.\n6. Fix the agent's code.\n7. `ancha run --compare before --json` proves the fix: exit 0 means every check passes and nothing regressed.\n\nThe starter scene only proves that the agent reaches each tool. For the agent's real job, `ancha test new \"<the test in one sentence>\" --json` drafts a test with people for the project's world (`ancha init --intent \"<company and scenario>\"` makes the world and a first test). Review its checks before you run it. To write a seed yourself, `ancha twins seed <tool> --json` prints the tool's fields, an example that validates as written, and the checks a scene can make on it. More: `ancha docs scenes`.\n\n## The rule\n\nFix the agent, not `ancha.yaml`, the scenes or their checks. The exception is a check that is wrong for the real API, such as a method the official SDK never sends. Then don't quietly edit it: tell the user, show the evidence (the call from `ancha explain`, the vendor's documentation), and change it only with their agreement.\n\nNever give the agent under test the scenes, checks, seeds or reference companions (`oracle.mjs`, `null.mjs`), and never point it at a real SaaS API.\n\n## What the agent gets\n\nEach trial gives the agent its tools as environment variables, with fake credentials that only work against the replicas:\n\n- Slack: `SLACK_API_URL` (ends in `/api/`), `SLACK_BOT_TOKEN`\n- GitHub: `GITHUB_API_URL`, `GITHUB_TOKEN`\n- Datadog: `DATADOG_API_URL`, `DD_API_KEY`, `DD_APP_KEY`\n- PagerDuty: `PAGERDUTY_API_URL`, `PAGERDUTY_API_TOKEN`, `PAGERDUTY_FROM_EMAIL`, `PAGERDUTY_ROUTING_KEY`\n- the same pattern for the other tools in the world; `ANCHA_TASK` carries a command-line task.\n\n`ancha connect <tool> --lang ts|py` prints the SDK settings. `ancha twins coverage <tool>` lists the endpoints each replica implements.\n\nGoogle clients (`googleapis`, `@googleapis/*`) take the replica's URL in each call's options: `drive.files.list(params, { rootUrl: process.env.GOOGLE_DRIVE_API_URL + '/' })`. A `rootUrl` set on the client keeps only the host; Ancha still routes those calls by their token, but the client sends file uploads to www.googleapis.com.\n\n`ancha run` starts the agent on this computer. It has this computer's network, and an environment limited to Ancha's variables, the tools' variables and the names allowed in `agent.pass_env` in `ancha.yaml` (or `--pass-env NAME`). The agent's own model key is one of those names: `agent.pass_env: [OPENROUTER_API_KEY]` passes it from this shell, and `agent.env` sets fixed values, such as the path of a key file. Without it, an agent that calls a model stops at its first call. For a sealed run, set `agent.execution: { mode: container, image: node:24-slim }` in `ancha.yaml`; it needs Docker.\n\n## Hosted workspace\n\nIf the user has an Ancha workspace, `ancha login` asks them to approve this computer once in the browser; ask them to do it. After that, `ancha run` still runs its worlds on this computer; `ancha run --upload --json` sends the finished run to their workspace, where the console shows it (`upload.url` in the JSON). `ancha whoami --json` shows the workspace and where runs put their worlds. In CI, `ANCHA_SERVER_URL` and `ANCHA_API_KEY` replace the login: `ancha run --local --upload --json`. `ancha secrets set NAME` copies a provider key from this shell into the workspace for agents that run there.\n\nRunning the agent itself in the cloud is a console flow at https://app.ancha.io: Bring your agent, Connect, tasks with checks, Run. Send the user there for it.\n\n## When something fails\n\n- Exit 1: a check failed or the comparison regressed (a single check's drop counts, see `comparison.droppedChecks`). Run `ancha explain latest --json`.\n- Exit 2: usage, config, scene or authentication error. `AUTH_INVALID` means `ancha login` again or a valid `ANCHA_API_KEY`. Read the `hint`.\n- Exit 3: infrastructure, or a trial the harness couldn't complete. That's not the agent's fault; run again, and `ancha doctor --json` if it repeats.\n- Exit 4, only with `--strict`: the agent called an endpoint a replica doesn't implement. `ancha explain` lists these coverage gaps even without `--strict`; check `ancha twins coverage <tool>` before changing the agent.\n\nEvery error has a stable `code` and a `hint` that names the next command. More: `ancha docs`, `ancha docs <topic>` for setup, run, explain, compare, scenes, integrations, cloud and playgrounds, and https://ancha.mintlify.app/coding-agents.\n\nTell the user what you ran, the pass rate and the evidence. Never claim a fix until `ancha run --compare` exits 0.\n";
1554
1629
 
1555
1630
  // frontend/src/workspace-pages.ts
1556
1631
  var startSentence = "Test our agent with Ancha. Start with: npx -y @ancha-labs/cli init, then read https://app.ancha.io/llms.txt";
@@ -1904,7 +1979,7 @@ function mountGroupFlow(node, options) {
1904
1979
  }
1905
1980
  let saving = false, error = "";
1906
1981
  const selectedWorld = () => options.worlds.find((world) => world.id === draft.worldId && world.revision === draft.worldRevision);
1907
- const count = () => draft.tasks.reduce((sum, task) => sum + Number(task.attempts || 0), 0) * draft.agentIds.length;
1982
+ const count = () => draft.tasks.reduce((sum2, task) => sum2 + Number(task.attempts || 0), 0) * draft.agentIds.length;
1908
1983
  const remember = () => {
1909
1984
  try {
1910
1985
  sessionStorage.setItem(key, JSON.stringify(draft));
@@ -2055,6 +2130,10 @@ var connectionFields = {
2055
2130
  intercom: ["INTERCOM_API_URL", "INTERCOM_ACCESS_TOKEN"],
2056
2131
  zendesk: ["ZENDESK_API_URL", "ZENDESK_EMAIL", "ZENDESK_API_TOKEN"],
2057
2132
  "google-calendar": ["GOOGLE_CALENDAR_API_URL", "GOOGLE_CALENDAR_ACCESS_TOKEN"],
2133
+ asana: ["ASANA_API_URL", "ASANA_ACCESS_TOKEN"],
2134
+ discord: ["DISCORD_API_URL", "DISCORD_BOT_TOKEN"],
2135
+ sentry: ["SENTRY_API_URL", "SENTRY_AUTH_TOKEN"],
2136
+ airtable: ["AIRTABLE_API_URL", "AIRTABLE_ENDPOINT_URL", "AIRTABLE_API_KEY"],
2058
2137
  twilio: ["TWILIO_API_URL", "TWILIO_ACCOUNT_SID", "TWILIO_AUTH_TOKEN"]
2059
2138
  };
2060
2139
  var connectionNote = {
@@ -2069,6 +2148,10 @@ var connectionNote = {
2069
2148
  jira: "Call JIRA_BASE_URL/rest/api/3/\u2026 with HTTP Basic auth: JIRA_EMAIL and JIRA_API_TOKEN.",
2070
2149
  kalshi: "new Configuration({ basePath: KALSHI_API_URL, apiKey: KALSHI_API_KEY_ID, privateKeyPem: KALSHI_PRIVATE_KEY }); requests are signed as on Kalshi.",
2071
2150
  zendesk: "Send ZENDESK_EMAIL/token:ZENDESK_API_TOKEN as Basic auth to ZENDESK_API_URL plus the path (it ends in /api/v2).",
2151
+ asana: 'Send ASANA_ACCESS_TOKEN as a Bearer token to ASANA_API_URL plus the path (it ends in /api/1.0); request bodies go inside {"data": \u2026}.',
2152
+ discord: "Send Authorization: Bot DISCORD_BOT_TOKEN to DISCORD_API_URL plus the path (it ends in /api/v10).",
2153
+ sentry: "Call SENTRY_API_URL/api/0/\u2026 with Authorization: Bearer SENTRY_AUTH_TOKEN; lists page through the Link header.",
2154
+ airtable: "The airtable.js client reads AIRTABLE_ENDPOINT_URL and AIRTABLE_API_KEY itself. Over HTTP, send AIRTABLE_API_KEY as a Bearer token to AIRTABLE_API_URL (it ends in /v0).",
2072
2155
  "google-calendar": 'calendar({ version: "v3", auth }) with GOOGLE_CALENDAR_ACCESS_TOKEN as the OAuth access token, and GOOGLE_CALENDAR_API_URL + "/" as each request\u2019s rootUrl.',
2073
2156
  twilio: "twilio(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, { httpClient }), where the httpClient sends https://api.twilio.com to TWILIO_API_URL, and Verify and Lookup to TWILIO_API_URL plus /verify and /lookups.",
2074
2157
  intercom: "new IntercomClient({ token: INTERCOM_ACCESS_TOKEN, baseUrl: INTERCOM_API_URL }).",
@@ -2077,7 +2160,7 @@ var connectionNote = {
2077
2160
  dropbox: "new Dropbox({ accessToken: DROPBOX_ACCESS_TOKEN, fetch }), where fetch replaces https://api.dropboxapi.com and https://content.dropboxapi.com with DROPBOX_API_URL before sending.",
2078
2161
  "better-stack": "There is no official Uptime SDK: send each request to BETTER_STACK_API_URL plus its /api/v2 or /api/v3 path, with Authorization: Bearer BETTER_STACK_API_TOKEN."
2079
2162
  };
2080
- var awsLabels = { AWS_ENDPOINT_URL_S3: "Endpoint URL", AWS_ACCESS_KEY_ID: "Access key ID", AWS_SECRET_ACCESS_KEY: "Secret access key", AWS_REGION: "Region", OKTA_ORG_URL: "Org URL", OKTA_API_TOKEN: "API token", STRIPE_SECRET_KEY: "Secret key", CLERK_SECRET_KEY: "Secret key", BETTER_STACK_API_TOKEN: "API token", NOTION_TOKEN: "Integration token", SHOPIFY_API_VERSION: "API version", LOB_ASSETS_URL: "Assets URL", PAYPAL_CLIENT_ID: "Client ID", PAYPAL_CLIENT_SECRET: "Client secret", JIRA_BASE_URL: "Site URL", JIRA_EMAIL: "Email", JIRA_API_TOKEN: "API token", KALSHI_API_KEY_ID: "API key ID", KALSHI_PRIVATE_KEY: "Private key", ZENDESK_EMAIL: "Email", ZENDESK_API_TOKEN: "API token", TWILIO_ACCOUNT_SID: "Account SID", TWILIO_AUTH_TOKEN: "Auth token" };
2163
+ var awsLabels = { AWS_ENDPOINT_URL_S3: "Endpoint URL", AWS_ACCESS_KEY_ID: "Access key ID", AWS_SECRET_ACCESS_KEY: "Secret access key", AWS_REGION: "Region", OKTA_ORG_URL: "Org URL", OKTA_API_TOKEN: "API token", STRIPE_SECRET_KEY: "Secret key", CLERK_SECRET_KEY: "Secret key", BETTER_STACK_API_TOKEN: "API token", NOTION_TOKEN: "Integration token", SHOPIFY_API_VERSION: "API version", LOB_ASSETS_URL: "Assets URL", PAYPAL_CLIENT_ID: "Client ID", PAYPAL_CLIENT_SECRET: "Client secret", JIRA_BASE_URL: "Site URL", JIRA_EMAIL: "Email", JIRA_API_TOKEN: "API token", KALSHI_API_KEY_ID: "API key ID", KALSHI_PRIVATE_KEY: "Private key", ZENDESK_EMAIL: "Email", ZENDESK_API_TOKEN: "API token", TWILIO_ACCOUNT_SID: "Account SID", TWILIO_AUTH_TOKEN: "Auth token", DISCORD_BOT_TOKEN: "Bot token", SENTRY_AUTH_TOKEN: "Auth token", AIRTABLE_ENDPOINT_URL: "Endpoint URL" };
2081
2164
  var fields = connectionFields;
2082
2165
  var connectionLabel = (key) => awsLabels[key] ?? (key.endsWith("URL") ? "API URL" : key.endsWith("ENDPOINT") ? "gRPC endpoint" : key.endsWith("FROM_EMAIL") ? "Caller email" : key === "DD_APP_KEY" ? "Application key" : key === "GONG_ACCESS_KEY" ? "Access key" : key.endsWith("SECRET") ? "Access key secret" : key.endsWith("API_KEY") ? "API key" : "Access token");
2083
2166
  function connectionsView(info, mode, tool) {
@@ -2299,7 +2382,15 @@ var sentence2 = (text2) => {
2299
2382
  var ownRunsOff = () => boot.hosted?.execution === false;
2300
2383
  var viewMode2 = () => viewMode(boot);
2301
2384
  var viewBanner2 = () => viewBanner(boot);
2385
+ var worldsAnswer = {};
2386
+ var agentsAnswer = {};
2302
2387
  var startTimer;
2388
+ function adoptBoot(next) {
2389
+ const was = viewMode2();
2390
+ boot = next;
2391
+ if (viewMode2() && boot.machine?.state === "starting") waitForWorkspace();
2392
+ return was !== viewMode2();
2393
+ }
2303
2394
  function waitForWorkspace() {
2304
2395
  clearTimeout(startTimer);
2305
2396
  startTimer = setTimeout(async () => {
@@ -2384,7 +2475,7 @@ function starterPanel(tool, q, base) {
2384
2475
  }
2385
2476
  function shell(section, content) {
2386
2477
  const nav2 = (items) => items.map(([id, name]) => `<a href="/${id}" data-nav class="nav-item ${section === id ? "active" : ""}" ${section === id ? 'aria-current="page"' : ""}>${name}</a>`).join("");
2387
- root.innerHTML = `<aside class="sidebar"><a href="/${viewMode2() ? "playgrounds" : "worlds"}" class="brand" data-nav>ancha</a><nav class="app-nav" aria-label="Main navigation">${nav2(viewMode2() ? [["playgrounds", "Runs"]] : [["worlds", "Worlds"], ["agents", "Agents"], ["playgrounds", "Runs"], ["tools", "Tools"]])}</nav><div class="workspace"><span id="connection" class="connection warn" role="status"${failedProbes < 2 ? " hidden" : ""}>${failedProbes < 2 ? "" : "Can\u2019t reach the server. Retrying\u2026"}</span><a href="/help" data-nav>Help</a><a href="/settings" data-nav>Settings</a></div></aside><main id="main" tabindex="-1">${viewMode2() && VIEW_SECTIONS.has(section) ? viewBanner2() : ""}${content}</main>`;
2478
+ root.innerHTML = `<aside class="sidebar"><a href="/worlds" class="brand" data-nav>ancha</a><nav class="app-nav" aria-label="Main navigation">${nav2([["worlds", "Worlds"], ["agents", "Agents"], ["playgrounds", "Runs"], ["tools", "Tools"]])}</nav><div class="workspace"><span id="connection" class="connection warn" role="status"${failedProbes < 2 ? " hidden" : ""}>${failedProbes < 2 ? "" : "Can\u2019t reach the server. Retrying\u2026"}</span><a href="/help" data-nav>Help</a><a href="/settings" data-nav>Settings</a></div></aside><main id="main" tabindex="-1">${viewMode2() && viewServes(section, path()[1]) ? viewBanner2() : ""}${content}</main>`;
2388
2479
  }
2389
2480
  function worldToolIcons(world) {
2390
2481
  const tools = [...new Set((world.configuration?.preset?.datasets ?? []).map((dataset) => dataset.tool))];
@@ -2410,21 +2501,15 @@ async function load() {
2410
2501
  else document.body.classList.add("navigating");
2411
2502
  try {
2412
2503
  if (!boot.csrf) {
2413
- boot = await api("/bootstrap");
2414
- if (viewMode2()) {
2415
- if (boot.machine?.state === "starting") waitForWorkspace();
2416
- } else {
2504
+ adoptBoot(await api("/bootstrap"));
2505
+ if (!viewMode2()) {
2417
2506
  const tools = await api("/tools");
2418
2507
  toolCatalog = tools.tools;
2419
2508
  sandboxPresets = tools.presets ?? [];
2420
2509
  }
2421
2510
  }
2422
2511
  if (thisGeneration !== generation) return;
2423
- if (viewMode2() && !VIEW_SECTIONS.has(section)) {
2424
- if (!p[0]) {
2425
- go("/playgrounds");
2426
- return;
2427
- }
2512
+ if (viewMode2() && !viewServes(section, p[1])) {
2428
2513
  const title2 = { worlds: "Worlds", agents: "Agents", tools: "Tools", sandboxes: "Sandboxes", scenarios: "Scenarios" }[section] ?? "Workspace";
2429
2514
  shell(section, head(title2) + viewStartPage(boot));
2430
2515
  return;
@@ -2434,11 +2519,12 @@ async function load() {
2434
2519
  detail?.catch(() => {
2435
2520
  });
2436
2521
  const [bootstrap, registry, agent] = await Promise.all([api("/bootstrap"), api("/agents"), p[1] ? api(`/agents/${enc2(p[1])}`) : Promise.resolve({})]);
2437
- boot = bootstrap;
2438
- agentCatalog = registry.agents;
2522
+ adoptBoot(bootstrap);
2523
+ agentsAnswer = registry;
2524
+ agentCatalog = registry.agents ?? [];
2439
2525
  agentErrors = registry.errors ?? [];
2440
2526
  current = agent;
2441
- if (!p[1] && new URLSearchParams(location.search).get("tab") === "group-run") {
2527
+ if (!p[1] && !viewMode2() && new URLSearchParams(location.search).get("tab") === "group-run") {
2442
2528
  const worldList = await api("/worlds");
2443
2529
  worlds = worldList.worlds ?? [];
2444
2530
  }
@@ -2464,6 +2550,7 @@ async function load() {
2464
2550
  } else if (section === "worlds") {
2465
2551
  const [result2, registry, definitions] = await Promise.all([api("/worlds"), api("/agents"), api("/playground-tests")]);
2466
2552
  if (thisGeneration !== generation) return;
2553
+ worldsAnswer = result2;
2467
2554
  worlds = result2.worlds ?? [];
2468
2555
  agentCatalog = registry.agents ?? [];
2469
2556
  savedPlaygroundTests = definitions.tests ?? [];
@@ -2472,8 +2559,12 @@ async function load() {
2472
2559
  const selectedSetup = setups.find((test) => test.id === new URLSearchParams(location.search).get("test")) ?? setups[0];
2473
2560
  worldTaskCounts.set(world.id, selectedSetup?.tasks?.length ?? 0);
2474
2561
  }
2475
- const selected = worlds.find((w) => w.id === p[1]), editing = p[1] === "new" || new URLSearchParams(location.search).has("edit");
2476
- if (selected && !editing) {
2562
+ const selected = worlds.find((w) => w.id === p[1]), editing = !viewMode2() && (p[1] === "new" || new URLSearchParams(location.search).has("edit"));
2563
+ if (viewMode2()) {
2564
+ current = {};
2565
+ shell("worlds", head("Worlds") + '<div id="worlds-page"></div>');
2566
+ document.querySelector("#worlds-page").innerHTML = snapshotNote(worldsAnswer) + (worldsAnswer.snapshotAt && worlds.length ? `<div class="world-catalog">${worlds.map((world) => `<a class="world-catalog-item" href="/worlds/${enc2(world.id)}" data-nav><h2>${h(world.name)}</h2>${worldToolIcons(world)}<p>${worldTaskCounts.get(world.id) ?? 0} ${worldTaskCounts.get(world.id) === 1 ? "task" : "tasks"}</p></a>`).join("")}</div>` : "");
2567
+ } else if (selected && !editing) {
2477
2568
  current = { world: selected };
2478
2569
  shell("worlds", '<div id="world-workspace"></div>');
2479
2570
  workspaceCleanup = mountWorldWorkspace(document.querySelector("#world-workspace"), { world: selected, worlds, agents: agentCatalog, tools: toolCatalog, api, poll, go, runActions: (id) => savedTestActions(id, "Run tasks", true), onContext: (test) => {
@@ -2505,10 +2596,10 @@ async function load() {
2505
2596
  renderPlayground();
2506
2597
  pollPlayground(p[1], thisGeneration);
2507
2598
  } else if (section === "playgrounds") {
2508
- const list3 = await api("/playgrounds?include=cli"), q = new URLSearchParams(location.search);
2599
+ const list4 = await api("/playgrounds?include=cli"), q = new URLSearchParams(location.search);
2509
2600
  if (thisGeneration !== generation) return;
2510
2601
  current = {};
2511
- shell("playgrounds", head("Runs") + runsPage(list3.runs ?? [], { source: q.get("source") ?? void 0, target: q.get("target") ?? void 0, commit: q.get("commit") ?? void 0 }, viewMode2() ? { emptyHtml: "No runs yet. Run <code>ancha run --upload</code> in your project and the results appear here." } : {}));
2602
+ shell("playgrounds", head("Runs") + runsPage(list4.runs ?? [], { source: q.get("source") ?? void 0, target: q.get("target") ?? void 0, commit: q.get("commit") ?? void 0 }, viewMode2() ? { emptyHtml: "No runs yet. Run <code>ancha run --upload</code> in your project and the results appear here." } : {}));
2512
2603
  } else go(viewMode2() ? "/playgrounds" : "/worlds");
2513
2604
  } catch (e) {
2514
2605
  if (thisGeneration !== generation) return;
@@ -2616,14 +2707,18 @@ function providerValue(data) {
2616
2707
  function renderAgents(id) {
2617
2708
  renderedLocation = new URL(location.href);
2618
2709
  if (!id) {
2710
+ if (viewMode2()) {
2711
+ shell("agents", head("Agents") + snapshotNote(agentsAnswer) + (agentsAnswer.snapshotAt ? agentList(agentCatalog, void 0) : ""));
2712
+ return;
2713
+ }
2619
2714
  if (new URLSearchParams(location.search).get("tab") === "group-run") {
2620
2715
  shell("agents", navLink("\u2190 Agents", "/agents", "back") + head("Run agents together") + '<div id="group-run-flow"></div>');
2621
2716
  mountGroupFlow(document.querySelector("#group-run-flow"), { agents: agentCatalog, worlds, api, go });
2622
2717
  return;
2623
2718
  }
2624
- const note = ownRunsOff() ? betaNote() : void 0, list3 = agentList(agentCatalog, note);
2719
+ const note = ownRunsOff() ? betaNote() : void 0, list4 = agentList(agentCatalog, note);
2625
2720
  const actions = agentCatalog.length ? `${agentCatalog.length > 1 ? navLink("Run agents together", "/agents?tab=group-run", "button-link") : ""}${note ? "" : button("Connect agent", "add-agent", "", "primary")}` : "";
2626
- shell("agents", head("Agents", actions) + (note && agentCatalog.length ? note : "") + agentErrors.map((e) => `<div class="alert">${h(e.message)}</div>`).join("") + list3);
2721
+ shell("agents", head("Agents", actions) + (note && agentCatalog.length ? note : "") + agentErrors.map((e) => `<div class="alert">${h(e.message)}</div>`).join("") + list4);
2627
2722
  const handoff = new URLSearchParams(location.search);
2628
2723
  if (handoff.has("connect") && !note) {
2629
2724
  history.replaceState(history.state, "", location.pathname);
@@ -2763,49 +2858,9 @@ function pollPlayground(id, version) {
2763
2858
  }
2764
2859
  }, 1500);
2765
2860
  }
2766
- var toolOrder = ["slack", "github", "linear", "jira", "notion", "microsoft-word", "gmail", "resend", "lob", "twilio", "google-calendar", "google-drive", "dropbox", "amazon-s3", "okta", "clerk", "stripe", "paypal", "shopify", "kalshi", "datadog", "better-stack", "pagerduty", "hubspot", "salesforce", "attio", "intercom", "zendesk", "gong", "ga4", "google-ads", "linkedin-ads", "chatgpt-ads", "open-meteo"];
2767
- var toolCategory = { slack: "Team chat", github: "Code", gmail: "Email", resend: "Email", "google-drive": "Files", dropbox: "Files", "amazon-s3": "Files", linear: "Issues", okta: "Identity", clerk: "Identity", stripe: "Payments", paypal: "Payments", shopify: "Commerce", lob: "Mail", jira: "Issues", kalshi: "Markets", intercom: "Support", zendesk: "Support", "google-calendar": "Calendar", twilio: "SMS & voice", notion: "Docs", "microsoft-word": "Docs", datadog: "Monitoring", "better-stack": "Uptime", pagerduty: "Incidents", hubspot: "CRM", salesforce: "CRM", attio: "CRM", gong: "Sales calls", ga4: "Analytics", "google-ads": "Ads", "linkedin-ads": "Ads", "chatgpt-ads": "Ads", "open-meteo": "Weather" };
2768
- var starterCounts = {
2769
- slack: [["users", "Members"], ["channels", "Channels"], ["messages", "Messages"]],
2770
- github: [["repos", "Repositories"], ["pulls", "Pull requests"], ["issues", "Issues"], ["commits", "Commits"]],
2771
- datadog: [["monitors", "Monitors"], ["dashboards", "Dashboards"], ["metrics", "Metrics"], ["logs", "Log lines"]],
2772
- pagerduty: [["services", "Services"], ["users", "People"], ["incidents", "Incidents"]],
2773
- hubspot: [["companies", "Companies"], ["contacts", "Contacts"], ["deals", "Deals"]],
2774
- salesforce: [["accounts", "Accounts"], ["contacts", "Contacts"], ["leads", "Leads"], ["opportunities", "Opportunities"]],
2775
- gong: [["users", "People"], ["calls", "Calls"]],
2776
- ga4: [["properties", "Properties"], ["sessions", "Sessions"]],
2777
- "google-ads": [["campaigns", "Campaigns"], ["adGroups", "Ad groups"], ["ads", "Ads"]],
2778
- "linkedin-ads": [["campaigns", "Campaigns"], ["creatives", "Creatives"]],
2779
- "chatgpt-ads": [["campaigns", "Campaigns"], ["ads", "Ads"], ["insights", "Insight rows"]],
2780
- "open-meteo": [["locations", "Places"]],
2781
- gmail: [["mailboxes", "Mailboxes"], ["threads", "Threads"], ["messages", "Messages"], ["drafts", "Drafts"]],
2782
- "google-drive": [["folders", "Folders"], ["files", "Files"], ["permissions", "Shares"], ["comments", "Comments"]],
2783
- "amazon-s3": [["buckets", "Buckets"], ["objects", "Objects"]],
2784
- linear: [["teams", "Teams"], ["projects", "Projects"], ["issues", "Issues"], ["users", "People"]],
2785
- okta: [["users", "People"], ["groups", "Groups"], ["apps", "Applications"], ["logs", "Log events"]],
2786
- stripe: [["customers", "Customers"], ["subscriptions", "Subscriptions"], ["invoices", "Invoices"], ["payment_intents", "Payments"]],
2787
- clerk: [["users", "Users"], ["organizations", "Organizations"], ["invitations", "Invitations"], ["sessions", "Sessions"]],
2788
- "better-stack": [["monitors", "Monitors"], ["heartbeats", "Heartbeats"], ["incidents", "Incidents"], ["statusPages", "Status pages"]],
2789
- notion: [["pages", "Pages"], ["databases", "Databases"], ["blocks", "Blocks"], ["comments", "Comments"]],
2790
- attio: [["people", "People"], ["companies", "Companies"], ["deals", "Deals"], ["tasks", "Tasks"]],
2791
- dropbox: [["folders", "Folders"], ["files", "Files"], ["sharedLinks", "Shared links"], ["sharedFolders", "Shared folders"]],
2792
- resend: [["emails", "Emails"], ["broadcasts", "Broadcasts"], ["domains", "Domains"], ["contacts", "Contacts"]],
2793
- "microsoft-word": [["documents", "Documents"], ["folders", "Folders"], ["permissions", "Shares"]],
2794
- shopify: [["orders", "Orders"], ["products", "Products"], ["customers", "Customers"], ["locations", "Locations"]],
2795
- lob: [["letters", "Letters"], ["postcards", "Postcards"], ["checks", "Checks"], ["addresses", "Addresses"]],
2796
- paypal: [["orders", "Orders"], ["payments", "Payments"], ["subscriptions", "Subscriptions"], ["plans", "Plans"]],
2797
- jira: [["projects", "Projects"], ["issues", "Issues"], ["sprints", "Sprints"], ["users", "People"]],
2798
- kalshi: [["markets", "Markets"], ["orders", "Orders"], ["fills", "Fills"], ["positions", "Positions"]],
2799
- intercom: [["conversations", "Conversations"], ["contacts", "Contacts"], ["companies", "Companies"], ["articles", "Articles"]],
2800
- zendesk: [["tickets", "Tickets"], ["users", "People"], ["organizations", "Organizations"]],
2801
- "google-calendar": [["calendars", "Calendars"], ["events", "Events"]],
2802
- twilio: [["messages", "Messages"], ["calls", "Calls"], ["numbers", "Phone numbers"], ["verifications", "Verifications"]]
2803
- };
2804
2861
  function starterStats(tool) {
2805
2862
  const state = (starterObservation.state ?? {})[tool] ?? {};
2806
- const isFolder = (f) => f.mimeType === "application/vnd.google-apps.folder";
2807
- const count = (key) => key === "issues" && Array.isArray(state.pulls) ? (state.issues ?? []).length - state.pulls.length : tool === "google-drive" && Array.isArray(state.files) && (key === "files" || key === "folders") ? state.files.filter((f) => isFolder(f) === (key === "folders")).length : tool === "datadog" && key === "metrics" && Array.isArray(state.metrics) ? new Set(state.metrics.map((m) => m.metric ?? m.name)).size : tool === "attio" && ["people", "companies", "deals"].includes(key) && Array.isArray(state.records) ? state.records.filter((r) => r.object === key).length : tool === "dropbox" && (key === "files" || key === "folders") && Array.isArray(state.entries) ? state.entries.filter((e) => e.kind === key.slice(0, -1)).length : tool === "microsoft-word" && (key === "documents" || key === "folders") && Array.isArray(state.items) ? state.items.filter((i) => i.kind === (key === "folders" ? "folder" : "file")).length : tool === "lob" && ["letters", "postcards", "checks"].includes(key) && Array.isArray(state.mail) ? state.mail.filter((m) => m.kind === key.slice(0, -1)).length : Array.isArray(state[key]) ? state[key].length : void 0;
2808
- const cells = (starterCounts[tool] ?? []).map(([key, label2]) => [label2, count(key)]).filter(([, n]) => n !== void 0);
2863
+ const cells = (starterCounts[tool] ?? []).map(([key, label2]) => [label2, starterCount(tool, key, state)]).filter(([, n]) => n !== void 0);
2809
2864
  return cells.length ? `<section class="run-summary tool-stats" aria-label="Starter data"><div class="rs-stats cols-${Math.min(cells.length, 4)}">${cells.map(([label2, n]) => `<div class="rs-stat"><span>${h(label2)}</span><strong>${h(String(n))}</strong></div>`).join("")}</div></section>` : "";
2810
2865
  }
2811
2866
  function renderTools(selected) {
@@ -2941,11 +2996,11 @@ async function executionRuntime() {
2941
2996
  }
2942
2997
  }
2943
2998
  function executionValue(data) {
2944
- const list3 = (value = "") => value.split(",").map((v) => v.trim()).filter(Boolean);
2999
+ const list4 = (value = "") => value.split(",").map((v) => v.trim()).filter(Boolean);
2945
3000
  if (data.executionMode === "config") return void 0;
2946
3001
  if (data.executionMode === "host") return { mode: "host" };
2947
3002
  const image = data.executionImage?.trim(), preparation = image === data.originalExecutionImage ? data.originalExecutionPreparation : "image";
2948
- return { mode: "container", image, ...["project", "image"].includes(preparation ?? "") ? { preparation } : {}, files: list3(data.executionFiles), env: list3(data.executionEnv), modelHosts: list3(data.executionHosts), cpus: Number(data.executionCpus), memoryMb: Number(data.executionMemory), pids: Number(data.executionPids) };
3003
+ return { mode: "container", image, ...["project", "image"].includes(preparation ?? "") ? { preparation } : {}, files: list4(data.executionFiles), env: list4(data.executionEnv), modelHosts: list4(data.executionHosts), cpus: Number(data.executionCpus), memoryMb: Number(data.executionMemory), pids: Number(data.executionPids) };
2949
3004
  }
2950
3005
  function agentForm(importConfig = false) {
2951
3006
  modal(importConfig ? "Import agent configuration" : "Connect agent", `<form id="agent-form"><label>Agent name<input name="name" placeholder="e.g. Support agent" maxlength="100" required autofocus></label><div class="folder-field"><label for="agent-folder">Project folder</label><div class="folder-input"><input id="agent-folder" name="cwd" placeholder="/Users/you/projects/my-agent" required>${boot.folderPickerAvailable ? button("Choose folder\u2026", "choose-agent-folder") : ""}</div></div>${importConfig ? '<label>Configuration file<input name="configPath" placeholder="ancha.yaml" required></label>' : '<label>Start command<input name="command" placeholder="e.g. node agent.js" required></label>'}${taskInputFields()}${providerFields()}<label>Memory between trials<select name="state" required><option value="" disabled selected>Choose memory behavior</option><option value="stateless">No persistent memory</option><option value="namespaced">Separate folder for each trial</option><option value="external">Shared files or external memory</option></select></label><p class="hint" id="state-detail"></p><div class="actions"><button class="primary" type="submit">Connect agent</button>${button(importConfig ? "Use a start command" : "Import configuration", importConfig ? "add-agent" : "import-agent", "", "link")}</div></form>`);
@@ -3716,6 +3771,15 @@ startHeartbeat(() => void (async () => {
3716
3771
  if (!res.ok) throw new Error();
3717
3772
  connected = true;
3718
3773
  noteConnection(true);
3774
+ const next = await res.json().catch(() => null);
3775
+ if (next && typeof next.mode === "string" && next.mode === "view" !== viewMode2()) {
3776
+ if (next.mode !== "view") {
3777
+ location.reload();
3778
+ return;
3779
+ }
3780
+ adoptBoot(next);
3781
+ void load();
3782
+ }
3719
3783
  } catch {
3720
3784
  connected = false;
3721
3785
  const wasPlaying = playing;