open-agents-ai 0.103.60 → 0.103.61

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.
Files changed (2) hide show
  1. package/dist/index.js +228 -584
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -37246,6 +37246,166 @@ function pick(key, variants) {
37246
37246
  narration.lastVariantIdx[key] = idx;
37247
37247
  return variants[idx];
37248
37248
  }
37249
+ function extractToolObject(toolName, args) {
37250
+ const path = args["path"];
37251
+ const file = path ? path.split("/").pop() ?? path : "";
37252
+ switch (toolName) {
37253
+ case "file_read":
37254
+ case "file_write":
37255
+ case "file_edit":
37256
+ case "file_patch":
37257
+ case "image_read":
37258
+ return file || String(args["file_path"] ?? "").split("/").pop() || "";
37259
+ case "shell": {
37260
+ const cmd = String(args["command"] ?? "");
37261
+ const essence = extractShellEssence(cmd);
37262
+ if (essence)
37263
+ return essence;
37264
+ const cat = getShellCategory(cmd);
37265
+ if (cat !== "generic")
37266
+ return cat;
37267
+ const snip = cmd.length > 50 ? cmd.slice(0, 47) + "..." : cmd;
37268
+ return snip.replace(/[|><&;$`\\]/g, " ").replace(/\s+/g, " ").trim();
37269
+ }
37270
+ case "grep_search":
37271
+ return String(args["pattern"] ?? "");
37272
+ case "find_files":
37273
+ return String(args["pattern"] ?? args["glob"] ?? "");
37274
+ case "list_directory":
37275
+ return file || String(args["directory"] ?? ".");
37276
+ case "web_search":
37277
+ return String(args["query"] ?? args["search"] ?? "");
37278
+ case "web_fetch":
37279
+ return String(args["url"] ?? "").replace(/https?:\/\//, "").split("/")[0] || "";
37280
+ case "memory_read":
37281
+ return String(args["key"] ?? args["topic"] ?? "notes");
37282
+ case "memory_write":
37283
+ return String(args["key"] ?? args["topic"] ?? "this");
37284
+ case "sub_agent": {
37285
+ const topic = extractSubAgentTopic(args);
37286
+ if (topic)
37287
+ return topic;
37288
+ const agentType = String(args["subagent_type"] ?? args["type"] ?? "").replace(/-/g, " ");
37289
+ return agentType || "sub agent";
37290
+ }
37291
+ case "batch_edit":
37292
+ return `${Object.keys(args["edits"] ?? {}).length || "multiple"} files`;
37293
+ case "browser_action":
37294
+ return String(args["action"] ?? "action");
37295
+ case "screenshot":
37296
+ return "the screen";
37297
+ case "ocr":
37298
+ return file || "image";
37299
+ case "codebase_map":
37300
+ return "the project structure";
37301
+ case "diagnostic":
37302
+ return "system health";
37303
+ case "git_info":
37304
+ return "repository state";
37305
+ default:
37306
+ return file || "";
37307
+ }
37308
+ }
37309
+ function extractToolVerb(toolName, args) {
37310
+ switch (toolName) {
37311
+ case "file_read":
37312
+ return ["reading", "looking at"];
37313
+ case "file_write":
37314
+ return ["writing", "saving changes to"];
37315
+ case "file_edit":
37316
+ case "file_patch":
37317
+ return ["editing", "modifying"];
37318
+ case "shell": {
37319
+ const cmd = String(args["command"] ?? "");
37320
+ const essence = extractShellEssence(cmd);
37321
+ if (essence)
37322
+ return [essence, essence];
37323
+ return ["running", "executing"];
37324
+ }
37325
+ case "grep_search":
37326
+ return ["searching for", "scanning the code for"];
37327
+ case "find_files":
37328
+ return ["finding", "locating files matching"];
37329
+ case "list_directory":
37330
+ return ["listing", "browsing"];
37331
+ case "web_search":
37332
+ return ["searching", "looking up"];
37333
+ case "web_fetch":
37334
+ return ["fetching", "pulling content from"];
37335
+ case "memory_read":
37336
+ return ["recalling", "checking memory for"];
37337
+ case "memory_write":
37338
+ return ["storing", "saving to memory"];
37339
+ case "sub_agent":
37340
+ return ["delegating", "handing off to"];
37341
+ case "batch_edit":
37342
+ return ["batch editing", "editing across"];
37343
+ case "browser_action": {
37344
+ const action = String(args["action"] ?? "interacting");
37345
+ return [
37346
+ action === "navigate" ? "navigating to" : `browser ${action}`,
37347
+ action === "navigate" ? "opening" : `performing browser ${action}`
37348
+ ];
37349
+ }
37350
+ case "screenshot":
37351
+ return ["capturing", "snapping"];
37352
+ case "ocr":
37353
+ return ["extracting text from", "running OCR on"];
37354
+ case "codebase_map":
37355
+ return ["mapping", "surveying"];
37356
+ case "diagnostic":
37357
+ return ["diagnosing", "running diagnostics on"];
37358
+ case "git_info":
37359
+ return ["checking", "inspecting"];
37360
+ case "image_read":
37361
+ return ["examining", "looking at"];
37362
+ default: {
37363
+ const readable = toolName.replace(/[_-]/g, " ");
37364
+ return [`invoking ${readable}`, `calling ${readable}`];
37365
+ }
37366
+ }
37367
+ }
37368
+ function composeToolNarration(toolName, args, tier, _emotion) {
37369
+ const obj = extractToolObject(toolName, args);
37370
+ const [terseVerb, expandedVerb] = extractToolVerb(toolName, args);
37371
+ if (toolName === "shell") {
37372
+ const shellEssence = extractShellEssence(String(args["command"] ?? ""));
37373
+ if (shellEssence) {
37374
+ let core2 = shellEssence.charAt(0).toUpperCase() + shellEssence.slice(1);
37375
+ return core2;
37376
+ }
37377
+ }
37378
+ let core;
37379
+ if (!obj) {
37380
+ const cleanVerb = terseVerb.replace(/\s+(on|to|from|for|in|at|of)$/i, "");
37381
+ core = cleanVerb.charAt(0).toUpperCase() + cleanVerb.slice(1);
37382
+ } else if (tier === "terse") {
37383
+ core = `${terseVerb.charAt(0).toUpperCase() + terseVerb.slice(1)} ${obj}`;
37384
+ } else {
37385
+ core = `${expandedVerb.charAt(0).toUpperCase() + expandedVerb.slice(1)} ${obj}`;
37386
+ }
37387
+ if (tier !== "terse") {
37388
+ const count = narration.toolCounts[toolName] ?? 0;
37389
+ const isRevisitFile = obj && narration.filesSeen.has(obj);
37390
+ const isSameFile = obj && obj === narration.lastFile;
37391
+ const isSameTool = toolName === narration.lastTool;
37392
+ if (narration.consecutiveErrors >= 3) {
37393
+ core = tier === "chatty" ? `Different angle now, ${core.charAt(0).toLowerCase() + core.slice(1)}` : `New approach, ${core.charAt(0).toLowerCase() + core.slice(1)}`;
37394
+ } else if (narration.consecutiveErrors === 2) {
37395
+ core = tier === "chatty" ? `That path didn't work, trying ${core.charAt(0).toLowerCase() + core.slice(1)}` : `Adjusting, ${core.charAt(0).toLowerCase() + core.slice(1)}`;
37396
+ } else if (narration.consecutiveErrors === 1) {
37397
+ core = `Recovering, ${core.charAt(0).toLowerCase() + core.slice(1)}`;
37398
+ } else if (isSameFile && count > 1) {
37399
+ const action = terseVerb.replace(/ing$/, "ing it again");
37400
+ core = tier === "chatty" ? `Still in ${obj}, ${action}` : `Back to ${obj}`;
37401
+ } else if (isRevisitFile && !isSameFile) {
37402
+ core = tier === "chatty" ? `Returning to ${obj}` : `Coming back to ${obj}`;
37403
+ } else if (isSameTool && count > 3 && tier === "chatty") {
37404
+ core = `${core}, iteration ${count}`;
37405
+ }
37406
+ }
37407
+ return core;
37408
+ }
37249
37409
  function extractSubAgentTopic(args) {
37250
37410
  const raw = String(args["description"] ?? args["prompt"] ?? "");
37251
37411
  if (!raw || raw.length < 5)
@@ -37308,42 +37468,6 @@ function getShellCategory(cmd) {
37308
37468
  return "container";
37309
37469
  return "generic";
37310
37470
  }
37311
- function contextPrefix(toolName, file) {
37312
- const count = narration.toolCounts[toolName] ?? 0;
37313
- const isSameFile = file && file === narration.lastFile;
37314
- const isRevisit = file && narration.filesSeen.has(file);
37315
- if (narration.toolCount === 0)
37316
- return "";
37317
- if (narration.consecutiveErrors === 1) {
37318
- const afterError = ["Okay, ", "Right, ", "Alright, "];
37319
- return pick("ctx_aftererr", afterError);
37320
- }
37321
- if (narration.consecutiveErrors === 2) {
37322
- const afterMultiErr = ["Let me try something different. ", "New approach. ", "Switching tactics. "];
37323
- return pick("ctx_multierr", afterMultiErr);
37324
- }
37325
- if (narration.consecutiveErrors >= 3) {
37326
- const persistent = ["Third time's the charm. ", "One more try. ", "Okay, different angle entirely. "];
37327
- return pick("ctx_persistent", persistent);
37328
- }
37329
- if (isSameFile && count > 0) {
37330
- const sameFile = ["Back to ", "Still working on ", ""];
37331
- const chosen = pick("ctx_samefile", sameFile);
37332
- if (chosen)
37333
- return chosen;
37334
- }
37335
- if (isRevisit && !isSameFile) {
37336
- const revisit = ["Coming back to ", "Revisiting ", ""];
37337
- const chosen = pick("ctx_revisit", revisit);
37338
- if (chosen)
37339
- return chosen;
37340
- }
37341
- if (narration.toolCount > 0 && narration.toolCount % 8 === 0) {
37342
- const beats = ["Making good progress. ", "Moving along. ", ""];
37343
- return pick("ctx_beat", beats);
37344
- }
37345
- return "";
37346
- }
37347
37471
  function getTier(personality) {
37348
37472
  if (personality <= 2)
37349
37473
  return "terse";
@@ -37456,7 +37580,6 @@ function describeToolCall(toolName, args, personality = 2, emotion, stark = fals
37456
37580
  const path = args["path"];
37457
37581
  const file = path ? path.split("/").pop() ?? path : "";
37458
37582
  const tier = getTier(personality);
37459
- const prefix = personality >= 3 ? contextPrefix(toolName, file) : "";
37460
37583
  narration.toolCount++;
37461
37584
  narration.toolCounts[toolName] = (narration.toolCounts[toolName] ?? 0) + 1;
37462
37585
  narration.lastTool = toolName;
@@ -37464,176 +37587,27 @@ function describeToolCall(toolName, args, personality = 2, emotion, stark = fals
37464
37587
  narration.filesSeen.add(file);
37465
37588
  narration.lastFile = file;
37466
37589
  }
37467
- let base;
37468
- const poolKey = `${toolName}_${tier}`;
37469
- switch (toolName) {
37470
- case "file_read":
37471
- base = pick(poolKey, (FILE_READ_VARIANTS[tier] ?? FILE_READ_VARIANTS.terse)(file, args));
37472
- break;
37473
- case "file_write":
37474
- base = pick(poolKey, (FILE_WRITE_VARIANTS[tier] ?? FILE_WRITE_VARIANTS.terse)(file, args));
37475
- break;
37476
- case "file_edit":
37477
- case "file_patch":
37478
- base = pick(poolKey, (FILE_EDIT_VARIANTS[tier] ?? FILE_EDIT_VARIANTS.terse)(file, args));
37479
- break;
37480
- case "shell": {
37481
- const cmd = String(args["command"] ?? "");
37482
- const cat = getShellCategory(cmd);
37483
- const essence = extractShellEssence(cmd);
37484
- if (essence && tier !== "terse") {
37485
- const essenceVariants = tier === "chatty" ? [`Alright, ${essence}`, `Let me handle ${essence}`, `Time to ${essence.startsWith("running") ? essence : "run " + essence}`] : [`Now ${essence}`, essence.charAt(0).toUpperCase() + essence.slice(1)];
37486
- base = pick(`shell_ess_${tier}`, essenceVariants);
37487
- } else {
37488
- const pool = SHELL_VARIANTS[cat] ?? SHELL_VARIANTS.generic;
37489
- base = pick(`shell_${cat}_${tier}`, pool[tier] ?? pool.terse);
37490
- }
37491
- break;
37492
- }
37493
- case "grep_search":
37494
- base = pick(poolKey, (GREP_VARIANTS[tier] ?? GREP_VARIANTS.terse)(file, args));
37495
- break;
37496
- case "find_files": {
37497
- const pat = args["pattern"] ?? "pattern";
37498
- const findVariants = {
37499
- terse: [`Finding ${pat}`, `Searching for ${pat}`],
37500
- conv: [`Looking for files matching ${pat}`, `Finding files that match ${pat}`],
37501
- chatty: [`Scouring the project for ${pat}`, `Searching far and wide for ${pat}`, `Let me find everything matching ${pat}`]
37502
- };
37503
- base = pick(poolKey, findVariants[tier] ?? findVariants.terse);
37504
- break;
37505
- }
37506
- case "list_directory": {
37507
- const dir = file || "the directory";
37508
- const listVariants = {
37509
- terse: [`Listing ${dir}`, `Checking ${dir}`],
37510
- conv: [`Checking what's in ${dir}`, `Looking at ${dir} contents`],
37511
- chatty: [`Let's see what we've got in ${dir}`, `Browsing through ${dir}`]
37512
- };
37513
- base = pick(poolKey, listVariants[tier] ?? listVariants.terse);
37514
- break;
37515
- }
37516
- case "web_search":
37517
- base = pick(poolKey, (WEB_SEARCH_VARIANTS[tier] ?? WEB_SEARCH_VARIANTS.terse)(file, args));
37518
- break;
37519
- case "web_fetch":
37520
- base = pick(poolKey, (WEB_FETCH_VARIANTS[tier] ?? WEB_FETCH_VARIANTS.terse)(file, args));
37521
- break;
37522
- case "memory_read":
37523
- base = pick(poolKey, (MEMORY_READ_VARIANTS[tier] ?? MEMORY_READ_VARIANTS.terse)(file, args));
37524
- break;
37525
- case "memory_write":
37526
- base = pick(poolKey, (MEMORY_WRITE_VARIANTS[tier] ?? MEMORY_WRITE_VARIANTS.terse)(file, args));
37527
- break;
37528
- case "task_complete":
37529
- base = String(args["summary"] ?? (tier === "chatty" ? "And that's a wrap" : tier === "conv" ? "All done" : "Task complete"));
37530
- break;
37531
- case "sub_agent":
37532
- base = pick(poolKey, (SUB_AGENT_VARIANTS[tier] ?? SUB_AGENT_VARIANTS.terse)(file, args));
37533
- break;
37534
- case "batch_edit": {
37535
- const batchV = {
37536
- terse: ["Editing multiple files", "Batch editing"],
37537
- conv: ["Editing several files at once", "Making changes across multiple files"],
37538
- chatty: ["Okay, editing a bunch of files here, bear with me", "Touching several files at once, lot of ground to cover"]
37539
- };
37540
- base = pick(poolKey, batchV[tier] ?? batchV.terse);
37541
- break;
37542
- }
37543
- case "codebase_map": {
37544
- const mapV = {
37545
- terse: ["Mapping project", "Scanning structure"],
37546
- conv: ["Mapping out the project structure", "Getting the project layout"],
37547
- chatty: ["Let me get the lay of the land on this project", "Mapping the whole codebase out"]
37548
- };
37549
- base = pick(poolKey, mapV[tier] ?? mapV.terse);
37550
- break;
37551
- }
37552
- case "diagnostic": {
37553
- const diagV = {
37554
- terse: ["Running diagnostics", "Diagnostic check"],
37555
- conv: ["Running some diagnostics", "Let me run a diagnostic"],
37556
- chatty: ["Running diagnostics, let's see if anything looks off", "Time for a health check"]
37557
- };
37558
- base = pick(poolKey, diagV[tier] ?? diagV.terse);
37559
- break;
37560
- }
37561
- case "git_info": {
37562
- const gitV = {
37563
- terse: ["Checking git", "Git status"],
37564
- conv: ["Checking the git status", "Looking at git info"],
37565
- chatty: ["Checking in with git to see where things stand", "Let me see what git has to say"]
37566
- };
37567
- base = pick(poolKey, gitV[tier] ?? gitV.terse);
37568
- break;
37569
- }
37570
- case "image_read": {
37571
- const imgV = {
37572
- terse: ["Reading image", "Loading image"],
37573
- conv: ["Taking a look at that image", "Opening the image"],
37574
- chatty: ["Let me get a good look at that image", "Opening up the image to see what's there"]
37575
- };
37576
- base = pick(poolKey, imgV[tier] ?? imgV.terse);
37577
- break;
37578
- }
37579
- case "screenshot": {
37580
- const ssV = {
37581
- terse: ["Taking screenshot", "Capturing screen"],
37582
- conv: ["Grabbing a screenshot", "Capturing what's on screen"],
37583
- chatty: ["Snapping a screenshot to see what's happening", "Let me grab a visual"]
37584
- };
37585
- base = pick(poolKey, ssV[tier] ?? ssV.terse);
37586
- break;
37587
- }
37588
- case "ocr": {
37589
- const ocrV = {
37590
- terse: ["Extracting text", "Running OCR"],
37591
- conv: ["Extracting text from the image", "Running OCR on this"],
37592
- chatty: ["Let me pull the text out of this image", "Running optical character recognition"]
37593
- };
37594
- base = pick(poolKey, ocrV[tier] ?? ocrV.terse);
37595
- break;
37596
- }
37597
- case "browser_action": {
37598
- const action = args["action"] ?? "action";
37599
- const browserV = {
37600
- terse: [`Browser ${action}`],
37601
- conv: [
37602
- action === "navigate" ? "Opening that page" : action === "screenshot" ? "Grabbing a screenshot of the browser" : `Browser ${action}`
37603
- ],
37604
- chatty: [
37605
- action === "navigate" ? "Firing up the browser, let's see what's on that page" : action === "screenshot" ? "Getting a visual from the browser" : `Doing a browser ${action}`
37606
- ]
37607
- };
37608
- base = pick(poolKey, browserV[tier] ?? browserV.terse);
37609
- break;
37610
- }
37611
- default: {
37612
- const defaultV = {
37613
- terse: [`Using ${toolName}`],
37614
- conv: [`Working with ${toolName}`, `Using ${toolName}`],
37615
- chatty: [`Pulling in ${toolName}, hang tight`, `Using ${toolName} for this`, `Working with ${toolName} here`]
37616
- };
37617
- base = pick(poolKey, defaultV[tier] ?? defaultV.terse);
37618
- break;
37619
- }
37590
+ let result = composeToolNarration(toolName, args, tier, emotion);
37591
+ if (toolName === "task_complete") {
37592
+ result = String(args["summary"] ?? "Task complete");
37620
37593
  }
37621
37594
  const emoPrefix = personality >= 3 ? emotionColor(emotion, stark) : "";
37622
- let result;
37623
- const fullPrefix = emoPrefix + prefix;
37624
- if (!fullPrefix) {
37625
- result = base;
37626
- } else if (fullPrefix.endsWith(". ") || fullPrefix.endsWith("! ")) {
37627
- result = fullPrefix + base;
37628
- } else if (base.length > 0) {
37629
- result = fullPrefix + base.charAt(0).toLowerCase() + base.slice(1);
37630
- } else {
37631
- result = base;
37595
+ if (emoPrefix) {
37596
+ if (emoPrefix.endsWith(". ") || emoPrefix.endsWith("! ")) {
37597
+ result = emoPrefix + result;
37598
+ } else {
37599
+ result = emoPrefix + result.charAt(0).toLowerCase() + result.slice(1);
37600
+ }
37632
37601
  }
37633
- if (narration.lastResultDigest && personality >= 3 && Math.random() < 0.4) {
37602
+ if (narration.lastResultDigest && personality >= 3 && Math.random() < 0.5) {
37634
37603
  const ctx = narration.lastResultDigest;
37635
- const bridges = tier === "chatty" ? [` \u2014 earlier I saw ${ctx}`, `, building on what we found: ${ctx}`, `. Given that we got ${ctx}`] : [` \u2014 saw ${ctx} earlier`, `, following up on ${ctx}`];
37636
- result += pick("ctx_lastresult", bridges);
37604
+ if (ctx.includes("error") || ctx.includes("fail")) {
37605
+ result += `, addressing the ${ctx} from before`;
37606
+ } else if (ctx.includes("pass") || ctx.includes("success")) {
37607
+ result += `, building on ${ctx}`;
37608
+ } else {
37609
+ result += `, following up on ${ctx}`;
37610
+ }
37637
37611
  narration.lastResultDigest = "";
37638
37612
  }
37639
37613
  return result;
@@ -37737,47 +37711,69 @@ function describeToolResult(toolName, success, personality = 2, resultContent, e
37737
37711
  narration.lastResultDigest = digest;
37738
37712
  }
37739
37713
  const emo = personality >= 3 ? emotionColor(emotion, stark) : "";
37714
+ const readable = toolName.replace(/[_-]/g, " ");
37715
+ const lastFile = narration.lastFile || "";
37716
+ const subject = lastFile || readable;
37740
37717
  if (success) {
37741
37718
  narration.consecutiveErrors = 0;
37742
- if (!digest && !emo && personality >= 3 && Math.random() < 0.4)
37743
- return "";
37744
- const base = pick(`result_ok_${tier}`, RESULT_SUCCESS_VARIANTS[tier] ?? RESULT_SUCCESS_VARIANTS.terse);
37745
- if (digest && personality >= 2) {
37719
+ if (digest) {
37720
+ if (tier === "terse") {
37721
+ return `${emo}${digest}`;
37722
+ }
37746
37723
  if (tier === "chatty" && digest.length > 15) {
37747
- if (Math.random() < 0.5) {
37748
- const contentLeads = [
37749
- `${emo}Interesting, ${digest}`,
37750
- `${emo}So we've got ${digest}`,
37751
- `${emo}${digest.charAt(0).toUpperCase() + digest.slice(1)}, that's useful`
37752
- ];
37753
- return pick("digest_lead", contentLeads);
37754
- }
37724
+ return `${emo}${digest.charAt(0).toUpperCase() + digest.slice(1)}`;
37755
37725
  }
37756
- const connectors = tier === "chatty" ? [` \u2014 ${digest}`, `, I see ${digest}`, `. Looks like ${digest}`, `, showing ${digest}`] : tier === "conv" ? [` \u2014 ${digest}`, `, ${digest}`, `. Shows ${digest}`] : [`: ${digest}`];
37757
- return emo + base + pick("digest_conn_ok", connectors);
37726
+ return `${emo}${subject}: ${digest}`;
37758
37727
  }
37759
- return emo + base;
37728
+ if (tier === "terse") {
37729
+ return `${emo}${subject} clean`;
37730
+ }
37731
+ const [terseVerb] = extractToolVerb(toolName, {});
37732
+ const pastVerb = terseVerb.replace(/ing$/, "ed").replace(/ching$/, "ched");
37733
+ if (tier === "conv") {
37734
+ return `${emo}${pastVerb.charAt(0).toUpperCase() + pastVerb.slice(1)} ${subject} successfully`;
37735
+ }
37736
+ return `${emo}${pastVerb.charAt(0).toUpperCase() + pastVerb.slice(1)} ${subject}, output was routine, moving forward`;
37760
37737
  }
37761
37738
  narration.consecutiveErrors++;
37762
37739
  narration.totalErrors++;
37763
- const failBase = narration.consecutiveErrors >= 3 ? pick(`result_multifail_${tier}`, RESULT_MULTI_FAIL_VARIANTS[tier] ?? RESULT_MULTI_FAIL_VARIANTS.terse) : pick(`result_fail_${tier}`, RESULT_FAIL_VARIANTS[tier] ?? RESULT_FAIL_VARIANTS.terse);
37764
- if (digest && personality >= 2) {
37765
- return emo + `${failBase} \u2014 ${digest}`;
37740
+ const errCount = narration.consecutiveErrors;
37741
+ const severity = errCount >= 3 ? "persistent" : errCount === 2 ? "repeated" : "single";
37742
+ let failSentence;
37743
+ if (digest) {
37744
+ if (tier === "terse") {
37745
+ failSentence = `${readable} failed: ${digest}`;
37746
+ } else if (severity === "persistent") {
37747
+ failSentence = `${readable} failed again on ${subject}, ${errCount} consecutive errors now, ${digest}`;
37748
+ } else {
37749
+ failSentence = `${readable} on ${subject} hit an issue: ${digest}`;
37750
+ }
37751
+ } else {
37752
+ if (tier === "terse") {
37753
+ failSentence = `${readable} on ${subject} failed`;
37754
+ } else if (severity === "persistent") {
37755
+ failSentence = `${readable} keeps failing on ${subject}, ${errCount} attempts now, no extractable error detail`;
37756
+ } else if (severity === "repeated") {
37757
+ failSentence = `${readable} failed again on ${subject}, second attempt`;
37758
+ } else {
37759
+ failSentence = `${readable} on ${subject} returned an error`;
37760
+ }
37766
37761
  }
37767
- return emo + failBase;
37762
+ return `${emo}${failSentence}`;
37768
37763
  }
37769
- function describeTaskComplete(summary, completed, personality = 2, stark = false) {
37770
- const truncated = summary.length > 300 ? summary.slice(0, 300) + "..." : summary;
37764
+ function describeTaskComplete(summary, completed, personality = 2, _stark = false) {
37771
37765
  const tier = getTier(personality);
37766
+ const truncated = summary.length > 200 ? summary.slice(0, 200) + "..." : summary;
37772
37767
  if (!completed) {
37773
- const pool2 = stark ? ["Not done. But I'll be back.", "It resisted. For now.", "Unfinished. This isn't over.", "Didn't crack it yet. Give me another shot."] : TASK_INCOMPLETE_VARIANTS[tier] ?? TASK_INCOMPLETE_VARIANTS.terse;
37774
- return pick(`task_incomplete_${stark ? "stark" : tier}`, pool2);
37768
+ if (truncated) {
37769
+ return tier === "terse" ? `Incomplete: ${truncated}` : `Could not finish. ${truncated}`;
37770
+ }
37771
+ return `Task ended without completion, no summary was provided`;
37772
+ }
37773
+ if (truncated) {
37774
+ return truncated;
37775
37775
  }
37776
- const pool = stark ? ["Nailed it.", "That's how it's done.", "Clean execution.", "Another one down.", "Executed. Next.", "And that's that."] : TASK_COMPLETE_VARIANTS[tier] ?? TASK_COMPLETE_VARIANTS.terse;
37777
- const opener = pick(`task_complete_${stark ? "stark" : tier}`, pool);
37778
- if (truncated)
37779
- return `${opener} ${truncated}`;
37780
- return opener;
37776
+ return `Task completed, but no summary was generated to describe the outcome`;
37781
37777
  }
37782
37778
  function formatBytes2(bytes) {
37783
37779
  if (bytes < 1024)
@@ -37786,7 +37782,7 @@ function formatBytes2(bytes) {
37786
37782
  return `${(bytes / 1024).toFixed(0)}KB`;
37787
37783
  return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
37788
37784
  }
37789
- var VOICE_MODELS, VoiceEngine, narration, FILE_READ_VARIANTS, FILE_WRITE_VARIANTS, FILE_EDIT_VARIANTS, GREP_VARIANTS, WEB_SEARCH_VARIANTS, WEB_FETCH_VARIANTS, MEMORY_READ_VARIANTS, MEMORY_WRITE_VARIANTS, SUB_AGENT_VARIANTS, SHELL_VARIANTS, RESULT_SUCCESS_VARIANTS, RESULT_FAIL_VARIANTS, RESULT_MULTI_FAIL_VARIANTS, TASK_COMPLETE_VARIANTS, TASK_INCOMPLETE_VARIANTS;
37785
+ var VOICE_MODELS, VoiceEngine, narration;
37790
37786
  var init_voice = __esm({
37791
37787
  "packages/cli/dist/tui/voice.js"() {
37792
37788
  "use strict";
@@ -38750,358 +38746,6 @@ Error: ${err instanceof Error ? err.message : String(err)}`);
38750
38746
  lastVariantIdx: {},
38751
38747
  lastResultDigest: ""
38752
38748
  };
38753
- FILE_READ_VARIANTS = {
38754
- terse: (f) => [`Reading ${f}`, `Opening ${f}`, `Loading ${f}`],
38755
- conv: (f) => [
38756
- `Let me take a look at ${f}`,
38757
- `Opening up ${f}`,
38758
- `Pulling up ${f}`,
38759
- `Checking ${f}`,
38760
- `Let me see what's in ${f}`
38761
- ],
38762
- chatty: (f) => [
38763
- `Alright, let's crack open ${f} and see what we're working with`,
38764
- `Diving into ${f}`,
38765
- `Let me pull up ${f} and see what's going on`,
38766
- `Time to see what ${f} has for us`,
38767
- `Opening ${f}, let's see what we've got`,
38768
- `Taking a look inside ${f}`
38769
- ]
38770
- };
38771
- FILE_WRITE_VARIANTS = {
38772
- terse: (f) => [`Writing ${f}`, `Saving ${f}`, `Creating ${f}`],
38773
- conv: (f) => [
38774
- `Writing changes to ${f}`,
38775
- `Saving the updates to ${f}`,
38776
- `Putting this into ${f}`,
38777
- `Writing this out to ${f}`
38778
- ],
38779
- chatty: (f) => [
38780
- `Time to write this out to ${f}`,
38781
- `Laying down the changes in ${f}`,
38782
- `Writing the new version of ${f}`,
38783
- `Let me save this to ${f} before I forget`,
38784
- `Committing these changes to ${f}`
38785
- ]
38786
- };
38787
- FILE_EDIT_VARIANTS = {
38788
- terse: (f) => [`Editing ${f}`, `Modifying ${f}`, `Updating ${f}`],
38789
- conv: (f) => [
38790
- `Making some edits to ${f}`,
38791
- `Adjusting ${f}`,
38792
- `Tweaking ${f}`,
38793
- `Updating ${f} with the fix`,
38794
- `Applying changes to ${f}`
38795
- ],
38796
- chatty: (f) => [
38797
- `Let me tweak ${f}, I think I see what needs to change`,
38798
- `Making some surgical edits to ${f}`,
38799
- `Alright, adjusting ${f} now`,
38800
- `Got it, let me fix that up in ${f}`,
38801
- `Reshaping ${f} a bit here`,
38802
- `Modifying ${f}, this should get us closer`
38803
- ]
38804
- };
38805
- GREP_VARIANTS = {
38806
- terse: (_f, a) => [`Searching for ${a["pattern"] ?? "pattern"}`, `Grepping ${a["pattern"] ?? "code"}`],
38807
- conv: (_f, a) => [
38808
- `Searching the code for ${a["pattern"] ?? "that pattern"}`,
38809
- `Looking for ${a["pattern"] ?? "matches"} in the codebase`,
38810
- `Scanning for ${a["pattern"] ?? "that"} across the files`
38811
- ],
38812
- chatty: (_f, a) => [
38813
- `Hunting through the code for ${a["pattern"] ?? "what we need"}`,
38814
- `Let me track down ${a["pattern"] ?? "that"} in the source`,
38815
- `Scouring the codebase for ${a["pattern"] ?? "our target"}`,
38816
- `Searching high and low for ${a["pattern"] ?? "this pattern"}`
38817
- ]
38818
- };
38819
- WEB_SEARCH_VARIANTS = {
38820
- terse: () => [`Searching the web`, `Web search`, `Looking it up online`],
38821
- conv: () => [
38822
- `Let me search the web for that`,
38823
- `Checking online for that`,
38824
- `Let me look that up`,
38825
- `Searching the web real quick`
38826
- ],
38827
- chatty: () => [
38828
- `Off to the web to track this down`,
38829
- `Let me see what the internet has to say about this`,
38830
- `Heading online to dig up some answers`,
38831
- `Time for a quick web search`,
38832
- `Let me consult the wider world on this one`
38833
- ]
38834
- };
38835
- WEB_FETCH_VARIANTS = {
38836
- terse: () => [`Fetching page`, `Loading page`, `Downloading page`],
38837
- conv: () => [
38838
- `Pulling up that web page`,
38839
- `Fetching the page now`,
38840
- `Loading that page`,
38841
- `Grabbing the content from that URL`
38842
- ],
38843
- chatty: () => [
38844
- `Grabbing that page, one moment`,
38845
- `Let me pull that page up and see what's there`,
38846
- `Fetching the goods from that URL`,
38847
- `Loading up that page now`
38848
- ]
38849
- };
38850
- MEMORY_READ_VARIANTS = {
38851
- terse: () => [`Reading memory`, `Checking notes`, `Recalling`],
38852
- conv: () => [
38853
- `Checking my notes`,
38854
- `Let me see what I remember`,
38855
- `Pulling up my notes on this`,
38856
- `Looking through memory`
38857
- ],
38858
- chatty: () => [
38859
- `Let me dig through my notes on this`,
38860
- `Checking what I've got stored away`,
38861
- `Searching my memory for something relevant`,
38862
- `Let me recall what I know about this`
38863
- ]
38864
- };
38865
- MEMORY_WRITE_VARIANTS = {
38866
- terse: () => [`Saving to memory`, `Noting that`, `Remembering`],
38867
- conv: () => [
38868
- `Making a note of that`,
38869
- `Saving this for later`,
38870
- `Jotting that down`,
38871
- `Storing that away`
38872
- ],
38873
- chatty: () => [
38874
- `Stashing this away for later`,
38875
- `Making a mental note of this one`,
38876
- `Saving this to memory so I don't forget`,
38877
- `Filing this away for next time`
38878
- ]
38879
- };
38880
- SUB_AGENT_VARIANTS = {
38881
- terse: (_f, a) => {
38882
- const topic = extractSubAgentTopic(a);
38883
- return topic ? [`Sub agent: ${topic}`, `Delegating: ${topic}`] : [`Delegating to sub agent`, `Spawning sub agent`];
38884
- },
38885
- conv: (_f, a) => {
38886
- const topic = extractSubAgentTopic(a);
38887
- return topic ? [`Handing off to a sub agent to ${topic}`, `Bringing in help to ${topic}`, `Delegating the ${topic} work`] : [`Handing this off to a sub agent`, `Bringing in some help for this`, `Delegating this part of the work`];
38888
- },
38889
- chatty: (_f, a) => {
38890
- const topic = extractSubAgentTopic(a);
38891
- return topic ? [`Spinning up a sub agent to ${topic}`, `This part needs a specialist, delegating to ${topic}`, `Calling in backup to handle ${topic}`] : [`Bringing in reinforcements for this one`, `Let me hand this off to a specialist`, `Calling in backup on this`];
38892
- }
38893
- };
38894
- SHELL_VARIANTS = {
38895
- test: {
38896
- terse: ["Running tests", "Testing", "Executing tests"],
38897
- conv: [
38898
- "Let's run the tests and see how we're doing",
38899
- "Running the test suite",
38900
- "Time to check if the tests pass",
38901
- "Let me run those tests"
38902
- ],
38903
- chatty: [
38904
- "Alright, moment of truth, let's see if the tests pass",
38905
- "Running the tests, fingers crossed",
38906
- "Test time, let's see where we stand",
38907
- "Kicking off the test suite, here goes nothing",
38908
- "Let's put this to the test, literally"
38909
- ]
38910
- },
38911
- build: {
38912
- terse: ["Building project", "Compiling", "Building"],
38913
- conv: [
38914
- "Building the project now",
38915
- "Compiling everything",
38916
- "Starting the build",
38917
- "Let me build this"
38918
- ],
38919
- chatty: [
38920
- "Kicking off a build, fingers crossed",
38921
- "Time to compile and see if everything holds together",
38922
- "Building the project, let's see how it goes",
38923
- "Alright, build time",
38924
- "Compiling the whole thing, one moment"
38925
- ]
38926
- },
38927
- install: {
38928
- terse: ["Installing dependencies", "Installing packages", "Running install"],
38929
- conv: [
38930
- "Installing the dependencies",
38931
- "Pulling in the packages",
38932
- "Getting the dependencies set up"
38933
- ],
38934
- chatty: [
38935
- "Pulling in dependencies, this might take a sec",
38936
- "Installing packages, grab a coffee",
38937
- "Setting up the dependencies now"
38938
- ]
38939
- },
38940
- git: {
38941
- terse: ["Running git command", "Git operation", "Checking git"],
38942
- conv: [
38943
- "Running a git command",
38944
- "Checking with git",
38945
- "Let me do a git operation"
38946
- ],
38947
- chatty: [
38948
- "Checking in with git to see where things stand",
38949
- "Let me consult git on this",
38950
- "Running a quick git operation",
38951
- "Talking to git for a second"
38952
- ]
38953
- },
38954
- lint: {
38955
- terse: ["Running linter", "Linting", "Checking style"],
38956
- conv: [
38957
- "Checking the code with the linter",
38958
- "Running the linter",
38959
- "Let me check the code style"
38960
- ],
38961
- chatty: [
38962
- "Running the linter, let's keep things tidy",
38963
- "Lint check time, making sure everything's clean",
38964
- "Let's see if the linter is happy with this"
38965
- ]
38966
- },
38967
- node: {
38968
- terse: ["Running Node script", "Executing script"],
38969
- conv: [
38970
- "Running a Node script",
38971
- "Executing this script",
38972
- "Let me run this"
38973
- ],
38974
- chatty: [
38975
- "Firing up this Node script, let's see what happens",
38976
- "Running the script now",
38977
- "Executing this one, stand by"
38978
- ]
38979
- },
38980
- python: {
38981
- terse: ["Running Python", "Executing Python script"],
38982
- conv: ["Running a Python script", "Executing the Python code"],
38983
- chatty: [
38984
- "Running the Python script, one moment",
38985
- "Firing up Python for this one"
38986
- ]
38987
- },
38988
- network: {
38989
- terse: ["Making network request", "Fetching data"],
38990
- conv: ["Making a network request", "Fetching some data"],
38991
- chatty: ["Reaching out to the network", "Making a request, let's see what comes back"]
38992
- },
38993
- container: {
38994
- terse: ["Running container command", "Docker operation"],
38995
- conv: ["Running a container command", "Working with containers"],
38996
- chatty: ["Spinning up containers, one moment", "Doing some container work"]
38997
- },
38998
- generic: {
38999
- terse: ["Running command", "Executing command", "Shell command"],
39000
- conv: [
39001
- "Running a command",
39002
- "Executing a shell command",
39003
- "Let me run this command",
39004
- "Firing off a command"
39005
- ],
39006
- chatty: [
39007
- "Running a command, one moment",
39008
- "Let me execute this and see what we get",
39009
- "Firing off a shell command, stand by",
39010
- "Executing this, let's see the output",
39011
- "Running something in the shell real quick"
39012
- ]
39013
- }
39014
- };
39015
- RESULT_SUCCESS_VARIANTS = {
39016
- terse: ["Done", "OK", "Complete", "Got it"],
39017
- conv: [
39018
- "Got it",
39019
- "That worked",
39020
- "Good to go",
39021
- "Looking good",
39022
- "All set",
39023
- "Done"
39024
- ],
39025
- chatty: [
39026
- "Looking good, moving on",
39027
- "That went well, next step",
39028
- "Nice, onward",
39029
- "Perfect, let's keep going",
39030
- "Got what I needed, moving on",
39031
- "That came through, great",
39032
- "Worked like a charm"
39033
- ]
39034
- };
39035
- RESULT_FAIL_VARIANTS = {
39036
- terse: [
39037
- "Failed, retrying",
39038
- "Error, adjusting",
39039
- "That failed, fixing"
39040
- ],
39041
- conv: [
39042
- "That didn't work, let me try another approach",
39043
- "Hit a snag, adjusting course",
39044
- "Ran into an issue, trying again",
39045
- "Didn't go as expected, let me rethink this",
39046
- "Not quite, let me try something else"
39047
- ],
39048
- chatty: [
39049
- "Hmm, that didn't go as planned, let me try a different angle",
39050
- "Well that didn't work, but I've got another idea",
39051
- "Okay, that approach didn't pan out, pivoting",
39052
- "Hit a wall there, but I think I see another way",
39053
- "Not the result I was hoping for, let me regroup",
39054
- "That blew up, but no worries, I'll come at it differently",
39055
- "Alright, that wasn't it, but I'm not giving up"
39056
- ]
39057
- };
39058
- RESULT_MULTI_FAIL_VARIANTS = {
39059
- terse: ["Still failing, changing approach", "Error again, different method"],
39060
- conv: [
39061
- "Another miss, time to rethink this fundamentally",
39062
- "Still not working, let me step back and reconsider",
39063
- "Okay, clearly this approach isn't it"
39064
- ],
39065
- chatty: [
39066
- "That's a few misses now, time to really change things up",
39067
- "Alright, clearly I need a completely different strategy here",
39068
- "This keeps failing, let me take a step back and think about this differently",
39069
- "Okay, I've been going about this wrong, new plan"
39070
- ]
39071
- };
39072
- TASK_COMPLETE_VARIANTS = {
39073
- terse: ["Task complete.", "Done.", "Finished."],
39074
- conv: [
39075
- "All done.",
39076
- "That's everything.",
39077
- "Finished up.",
39078
- "All taken care of.",
39079
- "Wrapped that up."
39080
- ],
39081
- chatty: [
39082
- "And we're done!",
39083
- "That's a wrap!",
39084
- "All finished, good stuff.",
39085
- "Mission accomplished.",
39086
- "Everything's taken care of.",
39087
- "Done and dusted."
39088
- ]
39089
- };
39090
- TASK_INCOMPLETE_VARIANTS = {
39091
- terse: ["Task did not complete.", "Incomplete.", "Could not finish."],
39092
- conv: [
39093
- "I wasn't able to finish that one.",
39094
- "Didn't quite get there.",
39095
- "Ran out of steam on that one.",
39096
- "Couldn't quite wrap that up."
39097
- ],
39098
- chatty: [
39099
- "Well, that didn't quite get there. You might want to take a look at what's left.",
39100
- "I gave it my best shot, but couldn't finish everything.",
39101
- "Got partway there, but some things still need attention.",
39102
- "Not fully done, but I made progress on it."
39103
- ]
39104
- };
39105
38749
  }
39106
38750
  });
39107
38751
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.103.60",
3
+ "version": "0.103.61",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",