Extract and summarise bounds are each agent's own limits, set on its form
agents.limits holds extract_top, extract_min, summarise_top and summarise_min; the scope query reads them per ranked row, and a row saved before this behaves like a fresh agent. The four global config keys go. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
e602eb3388
commit
cebe62ddc9
20 files changed
+229
-147
No files matched your search
@@ -20,6 +20,10 @@
|
||||
const $ = (sel, root = document) => root.querySelector(sel);
|
||||
|
||||
const DEFAULT_WEIGHTS = { fit: 0.6, recency: 0.2, affinity: 0.2, taste: 0.2 };
|
||||
// What the model reads after a pull, per agent: the best `extract_top`
|
||||
// roles scoring at least `extract_min` get their gate columns filled, the
|
||||
// best `summarise_top` at `summarise_min` or more a summary.
|
||||
const DEFAULT_LIMITS = { extract_top: 500, extract_min: 0.3, summarise_top: 30, summarise_min: 0.5 };
|
||||
const NEW = "new";
|
||||
|
||||
/** @type {object[]} every agent, as the server lists them */
|
||||
@@ -108,6 +112,11 @@
|
||||
return `fit ${w.fit} · newness ${w.recency} · companies ${w.affinity} · liked ${w.taste}${gates}`;
|
||||
}
|
||||
|
||||
function limitsLine(row) {
|
||||
const l = Object.assign({}, DEFAULT_LIMITS, row.limits);
|
||||
return `reads ${l.extract_top} at ${l.extract_min} · summarises ${l.summarise_top} at ${l.summarise_min}`;
|
||||
}
|
||||
|
||||
function card(row, fallback) {
|
||||
const div = el("article", "agent-card");
|
||||
if (!row.enabled) div.dataset.off = "true";
|
||||
@@ -127,6 +136,7 @@
|
||||
? el("p", "agent-intent", intent)
|
||||
: el("p", "agent-intent empty", "Nothing described yet, so fit has nothing to measure against. Edit says what this agent looks for."));
|
||||
div.appendChild(el("p", "agent-weights", weightsLine(row)));
|
||||
div.appendChild(el("p", "agent-limits", limitsLine(row)));
|
||||
|
||||
const actions = el("div", "agent-card-actions");
|
||||
const edit = el("button", "secondary", "Edit");
|
||||
@@ -151,6 +161,7 @@
|
||||
const div = el("article", "agent-card editing");
|
||||
const f = $("#agent-form-template").content.querySelector("form").cloneNode(true);
|
||||
const weights = Object.assign({}, DEFAULT_WEIGHTS, row ? row.weights : {});
|
||||
const limits = Object.assign({}, DEFAULT_LIMITS, row ? row.limits : {});
|
||||
$("#agent-form-title", f).textContent = row ? `Edit ${row.name}` : "New agent";
|
||||
$("#a-name", f).value = row ? row.name : "";
|
||||
$("#a-intent", f).value = row ? row.intent : "";
|
||||
@@ -159,6 +170,10 @@
|
||||
$("#a-recency", f).value = weights.recency;
|
||||
$("#a-affinity", f).value = weights.affinity;
|
||||
$("#a-taste", f).value = weights.taste;
|
||||
$("#a-extract-top", f).value = limits.extract_top;
|
||||
$("#a-extract-min", f).value = limits.extract_min;
|
||||
$("#a-summarise-top", f).value = limits.summarise_top;
|
||||
$("#a-summarise-min", f).value = limits.summarise_min;
|
||||
$("#a-delete", f).hidden = !row;
|
||||
f.addEventListener("input", () => { f.dataset.dirty = "true"; });
|
||||
f.addEventListener("submit", (event) => save(event, row));
|
||||
@@ -227,6 +242,12 @@
|
||||
affinity: Number($("#a-affinity", f).value),
|
||||
taste: Number($("#a-taste", f).value),
|
||||
},
|
||||
limits: {
|
||||
extract_top: Number($("#a-extract-top", f).value),
|
||||
extract_min: Number($("#a-extract-min", f).value),
|
||||
summarise_top: Number($("#a-summarise-top", f).value),
|
||||
summarise_min: Number($("#a-summarise-min", f).value),
|
||||
},
|
||||
// Saving an agent means it is wanted, so a new one starts on; the
|
||||
// card's switch is where an existing one is switched.
|
||||
enabled: row ? row.enabled : true,
|
||||
|
||||
Reference in new issue
Block a user