Lines 246-286javascript
246 if (!reason) return void 0;
247 const parts = reason.split(";").filter(
248 (part) => part.startsWith("generatedEvidence=") || part === "generatedVerification=partial" || part === "index=unknown_nonblocking"
250 return parts.length > 0 ? parts.join(";") : void 0;
252function deriveAgentDisplayName(type, task) {
253 const stopWords = /* @__PURE__ */ new Set([
267 const asciiTask = Array.from(task.normalize("NFKD").toLowerCase()).map((char) => char.charCodeAt(0) <= 127 ? char : " ").
268 const tokens = asciiTask.replace(/[^a-z0-9]+/gu, " ").trim().split(/\s+/u).filter((token) => token &&
269 const base = tokens.length > 0 ? tokens.join("-") : `task-${createHash("sha1").update(task).digest("hex").slice(
270 const label = base.endsWith(`-${type}`) ? base : `${base}-${type}`;
271 return truncateAsciiLabel(label, 36);
273function truncateAsciiLabel(value, maxLength) {
274 const cleaned = value.replace(/[^a-z0-9-]/gu, "-").replace(/-{2,}/gu, "-").replace(/^-|-$/gu, "");
275 if (cleaned.length <= maxLength) {
276 return cleaned || "agent";
278 return cleaned.slice(0, maxLength).replace(/-+$/u, "") || "agent";
280function createDurableJobAgents(options, status, runningCap) {
281 const total = Math.max(1, options.requestedAgents);
282 const tasks = createDurableJobAgentTasks(options.goal, total);
283 return Array.from({ length: total }, (_, index) => {
284 const active = false;
285 const agentStatus = status === "running" ? index < runningCap ? "queued" : "sleeping" : status === "created" ? "created" : status;
286 const type = index === 0 ? "planner" : index === 1 ? "worker" : index === 2 ? "verifier" :