devrage 0.6.3 → 0.6.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.
package/dist/cli.js CHANGED
@@ -3504,7 +3504,7 @@ async function scan(args) {
3504
3504
  }
3505
3505
  async function slop(args) {
3506
3506
  const options = parseArgs(args, "slop");
3507
- const adapters = options.agent ? [createAdapter(options.agent)] : allAdapters();
3507
+ const adapters = options.agent ? [createAdapter(options.agent)] : allAdapters().filter((adapter) => adapter.name !== "t3code");
3508
3508
  const spinner = createSpinner(SLOP_SPINNER_MESSAGES);
3509
3509
  const tellTally = {};
3510
3510
  const perAgent = {};
@@ -3548,19 +3548,12 @@ async function slop(args) {
3548
3548
  spinner.stop();
3549
3549
  }
3550
3550
  const activeAgents = Object.entries(perAgent);
3551
+ const rankedAgents = activeAgents.filter(([, stats]) => stats.hits > 0).sort(
3552
+ ([leftName, left], [rightName, right]) => right.hits - left.hits || leftName.localeCompare(rightName)
3553
+ );
3551
3554
  console.log("");
3552
3555
  printReportHeader(options, "slop");
3553
3556
  printSlopOverview(totalMessages, totalHits, taintedMessages);
3554
- if (activeAgents.length > 1) {
3555
- console.log("");
3556
- console.log(` ${sectionTitle("agent slop")}`);
3557
- for (const [name, stats] of activeAgents) {
3558
- const rate = stats.messages > 0 ? stats.tainted / stats.messages : 0;
3559
- console.log(
3560
- ` ${colorText(name.padEnd(10), agentColor(name))} ${c.bold}${String(stats.hits).padStart(4)}${c.reset} ${c.dim}hits \xB7 ${stats.tainted}/${stats.messages} messages (${formatPercent(rate)})${c.reset}`
3561
- );
3562
- }
3563
- }
3564
3557
  if (totalHits > 0) {
3565
3558
  const tells = Object.entries(tellTally).sort(
3566
3559
  ([left, leftCount], [right, rightCount]) => rightCount - leftCount || left.localeCompare(right)
@@ -3573,6 +3566,16 @@ async function slop(args) {
3573
3566
  );
3574
3567
  }
3575
3568
  }
3569
+ if (activeAgents.length > 1 && rankedAgents.length > 0) {
3570
+ console.log("");
3571
+ console.log(` ${sectionTitle("agent breakdown")}`);
3572
+ for (const [name, stats] of rankedAgents) {
3573
+ const rate = stats.messages > 0 ? stats.tainted / stats.messages : 0;
3574
+ console.log(
3575
+ ` ${colorText(name.padEnd(10), agentColor(name))} ${c.bold}${String(stats.hits).padStart(4)}${c.reset} ${c.dim}hits \xB7 ${stats.tainted}/${stats.messages} messages (${formatPercent(rate)})${c.reset}`
3576
+ );
3577
+ }
3578
+ }
3576
3579
  console.log("");
3577
3580
  if (totalMessages === 0) {
3578
3581
  console.log(` ${c.gray}no assistant messages found.${c.reset}`);
@@ -3976,22 +3979,20 @@ function jsonForScript(value) {
3976
3979
  return JSON.stringify(value).replace(/</g, "\\u003c");
3977
3980
  }
3978
3981
  function printReportHeader(options, label = "report") {
3979
- const scope = options.rangeLabel ?? (options.since ? `since ${formatDate(options.since)}` : "all local history");
3980
- const agent = options.agent ? ` \xB7 ${options.agent}` : "";
3982
+ const scope = options.rangeLabel ?? (options.since ? `since ${formatDate(options.since)}` : label === "slop" ? void 0 : "all local history");
3983
+ const context = [scope, options.agent].filter(Boolean).join(" \xB7 ");
3981
3984
  console.log(` ${c.bold}${c.red}devrage${c.reset} ${c.dim}${label}${c.reset}`);
3982
- console.log(` ${c.dim}${scope}${agent}${c.reset}`);
3985
+ if (context) {
3986
+ console.log(` ${c.dim}${context}${c.reset}`);
3987
+ }
3983
3988
  console.log(` ${c.dim}${"\u2500".repeat(54)}${c.reset}`);
3984
3989
  }
3985
3990
  function printSlopOverview(totalMessages, totalHits, taintedMessages) {
3986
3991
  const rate = totalMessages > 0 ? taintedMessages / totalMessages : 0;
3992
+ const messageLabel = totalMessages === 1 ? "message" : "messages";
3993
+ const hitLabel = totalHits === 1 ? "slop hit" : "slop hits";
3987
3994
  console.log(
3988
- ` ${c.dim}assistant messages${c.reset} ${c.bold}${formatNumber(totalMessages)}${c.reset}`
3989
- );
3990
- console.log(
3991
- ` ${c.dim}slop hits${c.reset} ${c.bold}${c.yellow}${formatNumber(totalHits)}${c.reset}`
3992
- );
3993
- console.log(
3994
- ` ${c.dim}messages with slop${c.reset} ${c.bold}${formatNumber(taintedMessages)}${c.reset} ${c.dim}(${formatPercent(rate)})${c.reset}`
3995
+ ` ${c.bold}${formatNumber(totalMessages)}${c.reset} ${c.dim}${messageLabel} \xB7${c.reset} ${c.bold}${c.yellow}${formatNumber(totalHits)}${c.reset} ${c.dim}${hitLabel} \xB7${c.reset} ${c.bold}${formatNumber(taintedMessages)}${c.reset} ${c.dim}affected (${formatPercent(rate)})${c.reset}`
3995
3996
  );
3996
3997
  }
3997
3998
  function printBasicOverview(totalMessages, totalSwears) {
@@ -4156,7 +4157,7 @@ async function main() {
4156
4157
  process.exit(0);
4157
4158
  }
4158
4159
  if (command === "--version") {
4159
- console.log("0.6.3");
4160
+ console.log("0.6.4");
4160
4161
  process.exit(0);
4161
4162
  }
4162
4163
  const parsed = parseCommand(args);