agent-lookout 0.2.8 → 0.2.9

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.
@@ -3,13 +3,13 @@ import {
3
3
  statusJson,
4
4
  statusReport,
5
5
  statusText
6
- } from "./chunk-LZ62RW3N.js";
6
+ } from "./chunk-AHCLJEYU.js";
7
7
  import {
8
8
  addressesToTry,
9
9
  findSnapshot,
10
10
  readAppVersion,
11
11
  readSessions
12
- } from "./chunk-I6Q35DHC.js";
12
+ } from "./chunk-XV7BYWVY.js";
13
13
 
14
14
  // src/cli/agentLookout.ts
15
15
  import { isatty } from "node:tty";
@@ -167,7 +167,7 @@ async function runCommand(options) {
167
167
  return EXIT.notKnown;
168
168
  }
169
169
  if (parsed.kind === "start") {
170
- const { startCommand } = await import("./startCommand-ANC7NVAO.js");
170
+ const { startCommand } = await import("./startCommand-XUZHHWZG.js");
171
171
  const url = await startCommand({
172
172
  ...parsed.options,
173
173
  distDir: options.distDir ?? fileURLToPath(new URL("../../dist/", import.meta.url)),
@@ -187,7 +187,7 @@ async function runCommand(options) {
187
187
  const read = options.read ?? ((address) => readSessions(address));
188
188
  const now = options.now ?? Date.now;
189
189
  if (parsed.kind === "mcp") {
190
- const { serveMcp } = await import("./mcpServer-BMSF2TXC.js");
190
+ const { serveMcp } = await import("./mcpServer-33QB6COH.js");
191
191
  await serveMcp({
192
192
  addresses: toTry,
193
193
  read,
@@ -8,7 +8,7 @@ import {
8
8
  pullRequestSummaryOf,
9
9
  sessionTitle,
10
10
  waitingLabel
11
- } from "./chunk-I6Q35DHC.js";
11
+ } from "./chunk-XV7BYWVY.js";
12
12
 
13
13
  // src/cli/statusReport.ts
14
14
  var NOT_KNOWN = "\u2013";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SESSION_STATUSES
3
- } from "./chunk-I6Q35DHC.js";
3
+ } from "./chunk-XV7BYWVY.js";
4
4
 
5
5
  // src/core/sessions/sorting.ts
6
6
  var STATUS_ORDER = SESSION_STATUSES;
@@ -429,6 +429,10 @@ var MAX_NAME_LENGTH = 200;
429
429
  var MAX_LINE_LENGTH = 80;
430
430
  var MAX_WAITING_TEXT_LENGTH = 200;
431
431
  var MAX_NOTICE_TEXT_LENGTH = 240;
432
+ var MAX_MESSAGE_LENGTH = 2e3;
433
+ var MESSAGE_START_REACH = 200;
434
+ var CONTROL_BUT_LINE_BREAK = /[^\P{Cc}\n]/gu;
435
+ var REORDERING = new RegExp(`[${REORDERING_MARKS}]`, "gu");
432
436
  function clean(value) {
433
437
  if (typeof value !== "string") return void 0;
434
438
  const text = value.replace(UNWANTED, " ").trim();
@@ -454,6 +458,18 @@ function oneLine(text, max = MAX_LINE_LENGTH) {
454
458
  if (characters.length <= max) return flat;
455
459
  return `${characters.slice(0, max - 1).join("").trimEnd()}\u2026`;
456
460
  }
461
+ function messageText(value) {
462
+ if (typeof value !== "string") return void 0;
463
+ const lines = value.replace(/\r\n?|[\u2028\u2029]/g, "\n").replace(/\t/g, " ").replace(CONTROL_BUT_LINE_BREAK, " ").replace(REORDERING, "").split("\n");
464
+ const text = lines.map((line) => line.trimEnd()).join("\n").replace(/\n{3,}/g, "\n\n").trim();
465
+ if (text === "") return void 0;
466
+ const characters = Array.from(text);
467
+ if (characters.length <= MAX_MESSAGE_LENGTH) return { text, cut: false };
468
+ const kept = characters.slice(-MAX_MESSAGE_LENGTH);
469
+ const lineBreak = kept.indexOf("\n");
470
+ const start = lineBreak !== -1 && lineBreak < MESSAGE_START_REACH ? lineBreak + 1 : 0;
471
+ return { text: kept.slice(start).join("").trimStart(), cut: true };
472
+ }
457
473
 
458
474
  // src/core/waits/answeredWaits.ts
459
475
  var ANSWER_HOLDS_MS = 1e4;
@@ -540,6 +556,7 @@ export {
540
556
  sessionName,
541
557
  waitingText,
542
558
  oneLine,
559
+ messageText,
543
560
  needsYou,
544
561
  inAnsweredWait,
545
562
  answeredNow
@@ -2,11 +2,11 @@ import {
2
2
  machineOf,
3
3
  statusReport,
4
4
  terminalText
5
- } from "./chunk-LZ62RW3N.js";
5
+ } from "./chunk-AHCLJEYU.js";
6
6
  import {
7
7
  STATUS_ORDER,
8
8
  sortSessions
9
- } from "./chunk-JSBQMY3Q.js";
9
+ } from "./chunk-CMDNRNYP.js";
10
10
  import {
11
11
  CAPABILITIES,
12
12
  CAPABILITY_LABEL,
@@ -27,7 +27,7 @@ import {
27
27
  readAppVersion,
28
28
  sessionTitle,
29
29
  surfaceLabel
30
- } from "./chunk-I6Q35DHC.js";
30
+ } from "./chunk-XV7BYWVY.js";
31
31
 
32
32
  // node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js
33
33
  var require_code = __commonJS({