devrage 0.6.2 → 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,10 +3504,9 @@ 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
- const categoryTally = {};
3511
3510
  const perAgent = {};
3512
3511
  let totalMessages = 0;
3513
3512
  let totalHits = 0;
@@ -3535,7 +3534,6 @@ async function slop(args) {
3535
3534
  agentTainted++;
3536
3535
  for (const match of result.matches) {
3537
3536
  tellTally[match.tell] = (tellTally[match.tell] ?? 0) + 1;
3538
- categoryTally[match.category] = (categoryTally[match.category] ?? 0) + 1;
3539
3537
  }
3540
3538
  }
3541
3539
  if (agentMessages > 0) {
@@ -3550,38 +3548,31 @@ async function slop(args) {
3550
3548
  spinner.stop();
3551
3549
  }
3552
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
+ );
3553
3554
  console.log("");
3554
3555
  printReportHeader(options, "slop");
3555
3556
  printSlopOverview(totalMessages, totalHits, taintedMessages);
3556
- if (activeAgents.length > 1) {
3557
- console.log("");
3558
- console.log(` ${sectionTitle("agent slop")}`);
3559
- for (const [name, stats] of activeAgents) {
3560
- const rate = stats.messages > 0 ? stats.tainted / stats.messages : 0;
3561
- console.log(
3562
- ` ${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}`
3563
- );
3564
- }
3565
- }
3566
3557
  if (totalHits > 0) {
3567
3558
  const tells = Object.entries(tellTally).sort(
3568
3559
  ([left, leftCount], [right, rightCount]) => rightCount - leftCount || left.localeCompare(right)
3569
3560
  );
3570
3561
  console.log("");
3571
- console.log(` ${sectionTitle("top tells")}`);
3562
+ console.log(` ${sectionTitle("top slop")}`);
3572
3563
  for (const [tell, count] of tells.slice(0, 15)) {
3573
3564
  console.log(
3574
3565
  ` ${c.yellow}${tell.padEnd(28)}${c.reset} ${c.bold}${String(count).padStart(4)}${c.reset}`
3575
3566
  );
3576
3567
  }
3577
- const categories = Object.entries(categoryTally).sort(
3578
- ([left, leftCount], [right, rightCount]) => (rightCount ?? 0) - (leftCount ?? 0) || left.localeCompare(right)
3579
- );
3568
+ }
3569
+ if (activeAgents.length > 1 && rankedAgents.length > 0) {
3580
3570
  console.log("");
3581
- console.log(` ${sectionTitle("slop flavors")}`);
3582
- for (const [category, count] of categories) {
3571
+ console.log(` ${sectionTitle("agent breakdown")}`);
3572
+ for (const [name, stats] of rankedAgents) {
3573
+ const rate = stats.messages > 0 ? stats.tainted / stats.messages : 0;
3583
3574
  console.log(
3584
- ` ${c.cyan}${category.padEnd(28)}${c.reset} ${c.bold}${String(count).padStart(4)}${c.reset}`
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}`
3585
3576
  );
3586
3577
  }
3587
3578
  }
@@ -3988,22 +3979,20 @@ function jsonForScript(value) {
3988
3979
  return JSON.stringify(value).replace(/</g, "\\u003c");
3989
3980
  }
3990
3981
  function printReportHeader(options, label = "report") {
3991
- const scope = options.rangeLabel ?? (options.since ? `since ${formatDate(options.since)}` : "all local history");
3992
- 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 ");
3993
3984
  console.log(` ${c.bold}${c.red}devrage${c.reset} ${c.dim}${label}${c.reset}`);
3994
- console.log(` ${c.dim}${scope}${agent}${c.reset}`);
3985
+ if (context) {
3986
+ console.log(` ${c.dim}${context}${c.reset}`);
3987
+ }
3995
3988
  console.log(` ${c.dim}${"\u2500".repeat(54)}${c.reset}`);
3996
3989
  }
3997
3990
  function printSlopOverview(totalMessages, totalHits, taintedMessages) {
3998
3991
  const rate = totalMessages > 0 ? taintedMessages / totalMessages : 0;
3992
+ const messageLabel = totalMessages === 1 ? "message" : "messages";
3993
+ const hitLabel = totalHits === 1 ? "slop hit" : "slop hits";
3999
3994
  console.log(
4000
- ` ${c.dim}assistant messages${c.reset} ${c.bold}${formatNumber(totalMessages)}${c.reset}`
4001
- );
4002
- console.log(
4003
- ` ${c.dim}slop hits${c.reset} ${c.bold}${c.yellow}${formatNumber(totalHits)}${c.reset}`
4004
- );
4005
- console.log(
4006
- ` ${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}`
4007
3996
  );
4008
3997
  }
4009
3998
  function printBasicOverview(totalMessages, totalSwears) {
@@ -4168,7 +4157,7 @@ async function main() {
4168
4157
  process.exit(0);
4169
4158
  }
4170
4159
  if (command === "--version") {
4171
- console.log("0.6.2");
4160
+ console.log("0.6.4");
4172
4161
  process.exit(0);
4173
4162
  }
4174
4163
  const parsed = parseCommand(args);