@anusornneal/chat-relay 1.3.4 → 1.4.0
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/README.md +1 -1
- package/agent/file-manager.mjs +82 -14
- package/cli/tui.mjs +58 -55
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -170,7 +170,7 @@ A single account can own multiple computers. Each computer keeps its own agent i
|
|
|
170
170
|
|
|
171
171
|
Clone the repository only when developing Chat Relay itself. Normal users should use the zero-checkout `npx` flow above.
|
|
172
172
|
|
|
173
|
-
Agents must create new WIP backups or Git worktrees only when necessary and only inside the **owning target project's**
|
|
173
|
+
Agents must create new WIP backups or Git worktrees only when necessary and only inside the **owning target project's** `.workspace/` folder (e.g. `chat-relay/.workspace/worktrees/<id>`). Do not create sibling project folders. See [Project workspace policy](docs/PROJECT_WORKSPACE_POLICY.md) and `AGENTS.md`; existing legacy folders remain untouched until verified cleanup.
|
|
174
174
|
|
|
175
175
|
Common development commands:
|
|
176
176
|
|
package/agent/file-manager.mjs
CHANGED
|
@@ -22,6 +22,16 @@ const MAX_READ_RESPONSE_BYTES = 48 * 1024;
|
|
|
22
22
|
const MIN_READ_RESPONSE_BYTES = 1024;
|
|
23
23
|
const MAX_WRITE_BYTES = 256 * 1024;
|
|
24
24
|
const MAX_SEARCH_FILES = 5000;
|
|
25
|
+
const MAX_SEARCH_FIRST_PAGE_RESULTS = 20;
|
|
26
|
+
const MAX_SEARCH_FIRST_PAGE_BYTES = 16 * 1024;
|
|
27
|
+
const MAX_SEARCH_SESSIONS = 64;
|
|
28
|
+
const SEARCH_SESSION_TTL_MS = 15 * 60 * 1000;
|
|
29
|
+
const GENERATED_SEARCH_DIRS = new Set(["build", "dist", "coverage", "out", "__pycache__"]);
|
|
30
|
+
const SEARCH_BINARY_EXTENSIONS = new Set([
|
|
31
|
+
".apk", ".aab", ".class", ".dex", ".jar", ".so", ".dll", ".exe", ".bin",
|
|
32
|
+
".png", ".jpg", ".jpeg", ".gif", ".webp", ".ico", ".pdf", ".zip", ".gz",
|
|
33
|
+
".mp3", ".mp4", ".woff", ".woff2", ".ttf", ".otf", ".db", ".sqlite",
|
|
34
|
+
]);
|
|
25
35
|
const DEFAULT_LIST_LIMIT = 200;
|
|
26
36
|
const MAX_LIST_LIMIT = 500;
|
|
27
37
|
const DEFAULT_LIST_RESPONSE_BYTES = 48 * 1024;
|
|
@@ -32,6 +42,10 @@ function skipWalkDirectory(name) {
|
|
|
32
42
|
return SKIP_DIRS.has(name) || (name.startsWith(".") && !ALLOWED_DOT_DIRS.has(name));
|
|
33
43
|
}
|
|
34
44
|
|
|
45
|
+
function skipSearchDirectory(name) {
|
|
46
|
+
return skipWalkDirectory(name) || GENERATED_SEARCH_DIRS.has(name.toLowerCase());
|
|
47
|
+
}
|
|
48
|
+
|
|
35
49
|
function splitRoots(spec) {
|
|
36
50
|
if (!spec) return [process.cwd()];
|
|
37
51
|
return spec.split(";").map((value) => value.trim()).filter(Boolean).map((value) => path.resolve(value));
|
|
@@ -442,6 +456,16 @@ export class FileManager {
|
|
|
442
456
|
return { ok: true, path: target };
|
|
443
457
|
}
|
|
444
458
|
|
|
459
|
+
#pruneSearchSessions(reserve = 0) {
|
|
460
|
+
const now = Date.now();
|
|
461
|
+
for (const [id, session] of this.searches) {
|
|
462
|
+
if (session.expiresAt <= now) this.searches.delete(id);
|
|
463
|
+
}
|
|
464
|
+
while (this.searches.size > MAX_SEARCH_SESSIONS - reserve) {
|
|
465
|
+
this.searches.delete(this.searches.keys().next().value);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
445
469
|
async startSearch(input, pattern, searchType = "files", maxResults = 100) {
|
|
446
470
|
const target = await this.#resolveExisting(input);
|
|
447
471
|
if (typeof pattern !== "string" || pattern.length === 0 || pattern.length > 300) {
|
|
@@ -455,33 +479,40 @@ export class FileManager {
|
|
|
455
479
|
status: "RUNNING",
|
|
456
480
|
createdAt: Date.now(),
|
|
457
481
|
results: [],
|
|
482
|
+
scanned: 0,
|
|
483
|
+
incomplete: false,
|
|
484
|
+
stopReason: null,
|
|
458
485
|
error: null,
|
|
459
486
|
};
|
|
460
|
-
this.searches.set(sessionId, session);
|
|
461
487
|
|
|
462
488
|
try {
|
|
463
489
|
const limit = Math.min(Math.max(Number(maxResults) || 100, 1), 500);
|
|
464
490
|
const needle = pattern.toLowerCase();
|
|
465
|
-
let scanned = 0;
|
|
466
|
-
|
|
467
491
|
const queue = [target];
|
|
468
|
-
|
|
492
|
+
|
|
493
|
+
while (queue.length > 0 && session.results.length < limit && session.scanned < MAX_SEARCH_FILES) {
|
|
469
494
|
const current = queue.shift();
|
|
470
495
|
const items = await fs.readdir(current, { withFileTypes: true }).catch(() => []);
|
|
471
496
|
items.sort((a, b) => a.name.localeCompare(b.name));
|
|
472
497
|
for (const item of items) {
|
|
473
|
-
if (session.results.length >= limit || scanned >= MAX_SEARCH_FILES)
|
|
474
|
-
|
|
498
|
+
if (session.results.length >= limit || session.scanned >= MAX_SEARCH_FILES) {
|
|
499
|
+
session.incomplete = true;
|
|
500
|
+
session.stopReason = session.results.length >= limit ? "result_limit" : "scan_limit";
|
|
501
|
+
break;
|
|
502
|
+
}
|
|
503
|
+
if (item.isDirectory() && skipSearchDirectory(item.name)) continue;
|
|
475
504
|
const fullPath = path.join(current, item.name);
|
|
476
|
-
scanned++;
|
|
505
|
+
session.scanned++;
|
|
477
506
|
|
|
478
507
|
if (searchType === "files" && item.name.toLowerCase().includes(needle)) {
|
|
479
508
|
session.results.push({ path: fullPath, name: item.name, type: item.isDirectory() ? "directory" : "file" });
|
|
480
|
-
} else if (searchType === "content" && item.isFile()
|
|
509
|
+
} else if (searchType === "content" && item.isFile()
|
|
510
|
+
&& !SEARCH_BINARY_EXTENSIONS.has(path.extname(item.name).toLowerCase())) {
|
|
481
511
|
const info = await fs.stat(fullPath).catch(() => null);
|
|
482
512
|
if (info && info.size <= 1024 * 1024) {
|
|
483
|
-
const
|
|
484
|
-
if (
|
|
513
|
+
const bytes = await fs.readFile(fullPath).catch(() => null);
|
|
514
|
+
if (bytes && !bytes.subarray(0, 1024).includes(0)) {
|
|
515
|
+
const text = bytes.toString("utf8");
|
|
485
516
|
const index = text.toLowerCase().indexOf(needle);
|
|
486
517
|
if (index >= 0) {
|
|
487
518
|
const before = text.slice(0, index);
|
|
@@ -493,34 +524,71 @@ export class FileManager {
|
|
|
493
524
|
}
|
|
494
525
|
if (item.isDirectory()) queue.push(fullPath);
|
|
495
526
|
}
|
|
527
|
+
if (!session.incomplete && queue.length > 0
|
|
528
|
+
&& (session.results.length >= limit || session.scanned >= MAX_SEARCH_FILES)) {
|
|
529
|
+
session.incomplete = true;
|
|
530
|
+
session.stopReason = session.results.length >= limit ? "result_limit" : "scan_limit";
|
|
531
|
+
}
|
|
496
532
|
}
|
|
497
533
|
session.status = "COMPLETED";
|
|
498
|
-
session.scanned = scanned;
|
|
499
534
|
} catch (error) {
|
|
500
535
|
session.status = "ERROR";
|
|
536
|
+
session.incomplete = true;
|
|
537
|
+
session.stopReason = "error";
|
|
501
538
|
session.error = error instanceof Error ? error.message : "search_failed";
|
|
502
539
|
}
|
|
503
540
|
|
|
541
|
+
// The search is synchronous from the caller's perspective. Retain only finished sessions.
|
|
542
|
+
this.#pruneSearchSessions(1);
|
|
543
|
+
session.expiresAt = Date.now() + SEARCH_SESSION_TTL_MS;
|
|
544
|
+
this.searches.set(sessionId, session);
|
|
545
|
+
|
|
546
|
+
// Most callers only need the first few matches; avoid a second MCP round trip.
|
|
547
|
+
const firstPage = [];
|
|
548
|
+
let pageBytes = 0;
|
|
549
|
+
for (const item of session.results.slice(0, MAX_SEARCH_FIRST_PAGE_RESULTS)) {
|
|
550
|
+
const size = byteSize(item);
|
|
551
|
+
if (firstPage.length > 0 && pageBytes + size > MAX_SEARCH_FIRST_PAGE_BYTES) break;
|
|
552
|
+
firstPage.push(item);
|
|
553
|
+
pageBytes += size;
|
|
554
|
+
}
|
|
504
555
|
return {
|
|
505
556
|
sessionId,
|
|
506
557
|
status: session.status,
|
|
507
558
|
totalResults: session.results.length,
|
|
508
|
-
scanned: session.scanned
|
|
559
|
+
scanned: session.scanned,
|
|
560
|
+
incomplete: session.incomplete,
|
|
561
|
+
stopReason: session.stopReason,
|
|
509
562
|
error: session.error,
|
|
563
|
+
offset: 0,
|
|
564
|
+
results: firstPage,
|
|
565
|
+
nextOffset: firstPage.length < session.results.length ? firstPage.length : null,
|
|
510
566
|
};
|
|
511
567
|
}
|
|
512
568
|
|
|
513
569
|
getSearchResults(sessionId, offset = 0, length = 50) {
|
|
514
|
-
|
|
570
|
+
this.#pruneSearchSessions();
|
|
571
|
+
const key = String(sessionId);
|
|
572
|
+
const session = this.searches.get(key);
|
|
515
573
|
if (!session) throw new Error("search_not_found");
|
|
574
|
+
session.expiresAt = Date.now() + SEARCH_SESSION_TTL_MS;
|
|
575
|
+
this.searches.delete(key);
|
|
576
|
+
this.searches.set(key, session);
|
|
577
|
+
|
|
516
578
|
const start = Math.max(Number(offset) || 0, 0);
|
|
517
579
|
const count = Math.min(Math.max(Number(length) || 50, 1), 100);
|
|
580
|
+
const results = session.results.slice(start, start + count);
|
|
581
|
+
const nextOffset = start + results.length;
|
|
518
582
|
return {
|
|
519
583
|
sessionId: session.id,
|
|
520
584
|
status: session.status,
|
|
521
585
|
totalResults: session.results.length,
|
|
586
|
+
scanned: session.scanned,
|
|
587
|
+
incomplete: session.incomplete,
|
|
588
|
+
stopReason: session.stopReason,
|
|
522
589
|
offset: start,
|
|
523
|
-
results
|
|
590
|
+
results,
|
|
591
|
+
nextOffset: nextOffset < session.results.length ? nextOffset : null,
|
|
524
592
|
error: session.error,
|
|
525
593
|
};
|
|
526
594
|
}
|
package/cli/tui.mjs
CHANGED
|
@@ -238,14 +238,11 @@ function wrapText(value, width, maxLines = 3) {
|
|
|
238
238
|
export function formatTransactionRows(item, width = 110, { color = false } = {}) {
|
|
239
239
|
const requested = Number(width) || 110;
|
|
240
240
|
const usable = clamp(requested, Math.min(60, Math.max(1, requested)), 180);
|
|
241
|
-
const status = item.status === "running" ? "🟡" : item.ok === false ? "❌" : "✅";
|
|
242
241
|
if (usable < 32) {
|
|
243
|
-
const compact = truncateCells(`${clock(item.at)} ${
|
|
244
|
-
|
|
245
|
-
const glyphStyle = item.status === "running" ? STYLE.yellow : item.ok === false ? STYLE.red : STYLE.green;
|
|
246
|
-
return [paint(compact, glyphStyle)];
|
|
242
|
+
const compact = truncateCells(`${clock(item.at)} ${item.summary || item.action || "Tool call"}`, usable);
|
|
243
|
+
return [color && item.ok === false ? paint(compact, STYLE.red) : compact];
|
|
247
244
|
}
|
|
248
|
-
const prefix = `${clock(item.at)}
|
|
245
|
+
const prefix = `${clock(item.at)} `;
|
|
249
246
|
const prefixWidth = terminalCellWidth(prefix);
|
|
250
247
|
const continuationPrefix = " ".repeat(prefixWidth);
|
|
251
248
|
const duration = formatDuration(item.durationMs, item.status);
|
|
@@ -263,11 +260,9 @@ export function formatTransactionRows(item, width = 110, { color = false } = {})
|
|
|
263
260
|
if (!color) return plainRow;
|
|
264
261
|
if (item.ok === false) return paint(plainRow, STYLE.red);
|
|
265
262
|
const time = paint(clock(item.at), STYLE.gray);
|
|
266
|
-
const glyphStyle = item.status === "running" ? STYLE.yellow : STYLE.green;
|
|
267
|
-
const glyph = paint(status, glyphStyle, STYLE.bold);
|
|
268
263
|
const summary = item.status === "running" ? paint(line.padEnd(summaryWidth), STYLE.bold) : line.padEnd(summaryWidth);
|
|
269
264
|
const timing = paint(suffix, STYLE.gray);
|
|
270
|
-
return `${time} ${
|
|
265
|
+
return `${time} ${summary}${timing}`;
|
|
271
266
|
}
|
|
272
267
|
if (!color) return continuationPrefix + line;
|
|
273
268
|
if (item.ok === false) return continuationPrefix + paint(line, STYLE.red);
|
|
@@ -332,62 +327,83 @@ function activityCategory(item) {
|
|
|
332
327
|
return "Agent";
|
|
333
328
|
}
|
|
334
329
|
|
|
330
|
+
function activityIcon(item) {
|
|
331
|
+
const action = String(item.action || "").toLowerCase();
|
|
332
|
+
const title = String(item.operation || item.summary || "").toLowerCase();
|
|
333
|
+
if (/search/.test(action) || /^(start|search)\b/.test(title)) return "🔎";
|
|
334
|
+
if (/(^|\.)(read|readmany|getcontent)(_|$|\.)/.test(action) || /^read\b/.test(title)) return "📖";
|
|
335
|
+
if (/(^|\.)(write|edit|move|mkdir|delete)(_|$|\.)/.test(action) || /^(write|edit|create|delete|move)\b/.test(title)) return "✏️";
|
|
336
|
+
if (activityCategory(item) === "Terminal") return "📟";
|
|
337
|
+
if (activityCategory(item) === "Filesystem") return "📁";
|
|
338
|
+
return "";
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
function shortActivityDetail(value, project) {
|
|
342
|
+
const normalized = String(value || "").replace(/\\/g, "/").replace(/\s+/g, " ").trim();
|
|
343
|
+
if (!normalized) return "";
|
|
344
|
+
const projectName = String(project || "").toLowerCase();
|
|
345
|
+
const rootMatch = normalized.match(/(?:[A-Za-z]:)?\/[^\s]*?\/Projects\/([^/\s]+)\//i);
|
|
346
|
+
if (rootMatch) {
|
|
347
|
+
const beginning = normalized.slice(0, rootMatch.index);
|
|
348
|
+
const tail = normalized.slice(rootMatch.index + rootMatch[0].length);
|
|
349
|
+
return beginning + (rootMatch[1].toLowerCase() === projectName ? "" : rootMatch[1] + "/") + tail;
|
|
350
|
+
}
|
|
351
|
+
return normalized.replace(/(?:[A-Za-z]:)?\/[^\s]*?\/Projects\//ig, "");
|
|
352
|
+
}
|
|
353
|
+
|
|
335
354
|
function activityTitle(item) {
|
|
336
355
|
const value = String(item.operation || item.summary || item.action || "Tool call").replace(/\s+/g, " ").trim();
|
|
337
356
|
if (!item.operation && /^Run (?:Write-Output|Get-Command|Get-Content|Set-Variable|Start-Process)\b/i.test(value)) {
|
|
338
357
|
return "Execute terminal command";
|
|
339
358
|
}
|
|
340
359
|
// Preserve the familiar Learn marker even when an operation is humanized.
|
|
341
|
-
|
|
360
|
+
if (activityCategory(item) === "Learn") return value.startsWith("🧠") ? value : "🧠 " + value;
|
|
361
|
+
const icon = activityIcon(item);
|
|
362
|
+
const cleaned = value.replace(/^(?:Start Search|Search|Read|Write|Filesystem|Terminal)\b\s*/i, "").trim();
|
|
363
|
+
return icon ? icon + " " + (cleaned || value) : value;
|
|
342
364
|
}
|
|
343
365
|
|
|
344
366
|
function activityRows(item, width, { color = false, twoLines = false } = {}) {
|
|
345
367
|
const limit = Math.max(1, width);
|
|
346
368
|
const project = String(item.project || "General");
|
|
347
369
|
const title = activityTitle(item);
|
|
348
|
-
const symbol = item.status === "running" ? "◌" : item.ok === false ? "×" : "✓";
|
|
349
|
-
const symbolColor = item.status === "running" ? MONITOR.warning : item.ok === false ? MONITOR.bad : MONITOR.good;
|
|
350
370
|
const time = clock(item.at);
|
|
351
371
|
if (limit < 52) {
|
|
352
|
-
if (limit <= 2) return [tint(truncateCells(
|
|
372
|
+
if (limit <= 2) return [tint(truncateCells(title, limit), item.ok === false ? MONITOR.bad : MONITOR.bright, color)];
|
|
353
373
|
const prefix = limit >= 37 ? time.slice(0, 5) + " " : "";
|
|
354
|
-
const bodyWidth = Math.max(0, limit - terminalCellWidth(prefix)
|
|
374
|
+
const bodyWidth = Math.max(0, limit - terminalCellWidth(prefix));
|
|
355
375
|
const projectText = truncateCells(project + " · ", bodyWidth);
|
|
356
376
|
const titleText = truncateCells(title, Math.max(0, bodyWidth - terminalCellWidth(projectText)));
|
|
357
|
-
|
|
358
|
-
return [
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
: plain];
|
|
377
|
+
if (!color) return [prefix + projectText + titleText];
|
|
378
|
+
if (item.ok === false) return [tint(prefix + projectText + titleText, MONITOR.bad, true)];
|
|
379
|
+
return [tint(prefix, MONITOR.dim, true) + tint(projectText, MONITOR.muted, true)
|
|
380
|
+
+ tint(titleText, MONITOR.bright, true)];
|
|
362
381
|
}
|
|
363
|
-
const opStart =
|
|
382
|
+
const opStart = 10;
|
|
364
383
|
const durationWidth = 10;
|
|
365
384
|
const operationWidth = Math.max(1, limit - opStart - durationWidth);
|
|
366
385
|
const duration = formatDuration(item.durationMs, item.status);
|
|
367
386
|
const operation = cellPad(title, operationWidth);
|
|
368
387
|
const prefix = cellPad(time, 8) + " ";
|
|
369
388
|
const ending = cellPad(duration, durationWidth);
|
|
370
|
-
const headline =
|
|
371
|
-
? tint(prefix
|
|
372
|
-
:
|
|
389
|
+
const headline = item.ok === false
|
|
390
|
+
? tint(prefix + operation + ending, MONITOR.bad, color)
|
|
391
|
+
: color
|
|
392
|
+
? tint(prefix, MONITOR.dim, true) + tint(operation, MONITOR.bright, true) + tint(ending, MONITOR.dim, true)
|
|
393
|
+
: prefix + operation + ending;
|
|
373
394
|
if (!twoLines) return [headline];
|
|
374
395
|
|
|
375
|
-
|
|
376
|
-
const
|
|
377
|
-
? " · Error: " + String(item.error).replace(/\s+/g, " ").slice(0, 70)
|
|
378
|
-
: item.detail ? " · " + String(item.detail).replace(/\s+/g, " ").slice(0, 100) : "";
|
|
379
|
-
const secondary = " · " + category + extra;
|
|
380
|
-
// Keep request/response telemetry in transaction state but leave it out of
|
|
381
|
-
// the monitoring view, where it competes with operation and project context.
|
|
382
|
-
const textWidth = Math.max(1, limit - opStart);
|
|
383
|
-
const name = truncateCells(project, textWidth);
|
|
384
|
-
const rest = truncateCells(secondary, Math.max(0, textWidth - terminalCellWidth(name)));
|
|
396
|
+
// Display the project on its own line without duplicating the operation icon.
|
|
397
|
+
const name = truncateCells(project, Math.max(1, limit - opStart));
|
|
385
398
|
const metadata = " ".repeat(opStart)
|
|
386
|
-
+ (color
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
399
|
+
+ tint(name, item.ok === false ? MONITOR.bad : item.project ? MONITOR.muted : MONITOR.dim, color);
|
|
400
|
+
const rows = [headline, metadata];
|
|
401
|
+
const extra = item.error && item.ok === false ? "Error: " + shortActivityDetail(item.error, project)
|
|
402
|
+
: shortActivityDetail(item.detail, project);
|
|
403
|
+
if (extra) {
|
|
404
|
+
rows.push(" ".repeat(opStart) + tint(truncateCells(extra, Math.max(1, limit - opStart)), item.ok === false ? MONITOR.bad : MONITOR.dim, color));
|
|
405
|
+
}
|
|
406
|
+
return rows;
|
|
391
407
|
}
|
|
392
408
|
|
|
393
409
|
function monitorCapabilities(state, width, color) {
|
|
@@ -437,25 +453,12 @@ function monitoringSummary(state, width, layout, color) {
|
|
|
437
453
|
}
|
|
438
454
|
|
|
439
455
|
function headingRow(width, color) {
|
|
440
|
-
const left = cellPad("TIME",
|
|
441
|
-
const op = cellPad("OPERATION", Math.max(1, width -
|
|
456
|
+
const left = cellPad("TIME", 10);
|
|
457
|
+
const op = cellPad("OPERATION", Math.max(1, width - 20));
|
|
442
458
|
const right = cellPad("DURATION", 10);
|
|
443
459
|
return tint(left + op + right, MONITOR.muted, color);
|
|
444
460
|
}
|
|
445
461
|
|
|
446
|
-
function monitorFooter(width, color, online, demo = false) {
|
|
447
|
-
const hint = width >= 65
|
|
448
|
-
? "↑↓ Scroll · End " + (demo ? "Newest" : "Live") + " · Ctrl+C Exit"
|
|
449
|
-
: "Ctrl+C Exit";
|
|
450
|
-
const status = demo ? "◈ Offline preview" : online ? "● Connected" : "○ Disconnected";
|
|
451
|
-
if (terminalCellWidth(hint) + terminalCellWidth(status) + 3 > width) {
|
|
452
|
-
return tint(truncateCells(hint, width), MONITOR.dim, color);
|
|
453
|
-
}
|
|
454
|
-
return tint(hint, MONITOR.dim, color)
|
|
455
|
-
+ " ".repeat(width - terminalCellWidth(hint) - terminalCellWidth(status))
|
|
456
|
-
+ tint(status, demo ? MONITOR.accent : online ? MONITOR.accent : MONITOR.warning, color);
|
|
457
|
-
}
|
|
458
|
-
|
|
459
462
|
export class RemoteTui {
|
|
460
463
|
constructor({
|
|
461
464
|
config,
|
|
@@ -559,7 +562,7 @@ export class RemoteTui {
|
|
|
559
562
|
let summaryRows = layout === "wide" ? 4 : layout === "medium" ? 3 : 1;
|
|
560
563
|
let dividerRows = usableHeight >= 6 ? 1 : 0;
|
|
561
564
|
let headingRows = layout === "tiny" ? 0 : 2;
|
|
562
|
-
const footerRows =
|
|
565
|
+
const footerRows = 0;
|
|
563
566
|
let fixedRows = 1 + topLine + summaryRows + dividerRows + 1 + headingRows + footerRows;
|
|
564
567
|
if (fixedRows >= usableHeight && layout !== "tiny") {
|
|
565
568
|
layout = "tiny";
|
|
@@ -816,7 +819,7 @@ export class RemoteTui {
|
|
|
816
819
|
}
|
|
817
820
|
lines.push(...visible);
|
|
818
821
|
while (lines.length < usableHeight - footerRows) lines.push("");
|
|
819
|
-
|
|
822
|
+
|
|
820
823
|
const screen = lines.slice(0, Math.max(1, usableHeight)).join("\n");
|
|
821
824
|
if (screen !== this.previousFrame) {
|
|
822
825
|
this.previousFrame = screen;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anusornneal/chat-relay",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Zero-checkout remote MCP agent for ChatGPT with terminal, filesystem, process, multi-user, and multi-agent support.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -59,12 +59,13 @@
|
|
|
59
59
|
"test:self-update": "node --test test/self-update.test.mjs test/agent-lifecycle-upgrade.test.mjs",
|
|
60
60
|
"test:budget": "node --test test/relay-health.test.mjs test/usage-budget.test.mjs",
|
|
61
61
|
"test:soak": "node test/soak-smoke.mjs",
|
|
62
|
-
"test:
|
|
62
|
+
"test:file-search": "node --test test/file-search.test.mjs",
|
|
63
|
+
"test:hardening": "npm run test:file-search && npm run test:tool-guidance && npm run test:tui && npm run test:config-security && npm run test:self-update && npm run test:budget && npm run test:worker-hotpath && node --test test/connection-generation.test.mjs && npm run test:agent-state && node test/heartbeat-ack-watchdog.test.mjs && npm run test:no-quota && npm run test:usage-storage && npm run test:learn && npm run test:learn-bootstrap && npm run test:soak",
|
|
63
64
|
"test:tool-guidance": "node --test test/tool-error-guidance.test.mjs",
|
|
64
65
|
"verify:review": "node scripts/verify-review-artifacts.mjs",
|
|
65
66
|
"test:learn": "node test/learning-smoke.mjs && node test/project-alias-sqlite.test.mjs && node test/project-merge-mcp.test.mjs && node --test test/shared-learn.test.mjs test/shared-learn-ui.test.mjs && npm run test:learn-usage",
|
|
66
67
|
"test:learn-usage": "node test/learn-usage.test.mjs && node test/learn-usage-integration.test.mjs && node test/learn-usage-mcp.test.mjs",
|
|
67
|
-
"test:learn-bootstrap": "node test/learning-bootstrap-smoke.mjs && node test/learning-thai-fixtures.mjs",
|
|
68
|
+
"test:learn-bootstrap": "node test/learning-bootstrap-smoke.mjs && node test/learning-thai-fixtures.mjs && node --test test/learn-preflight-gate.test.mjs test/learn-reflection.test.mjs",
|
|
68
69
|
"test:worker-hotpath": "node --experimental-strip-types --test test/relay-result.test.mjs"
|
|
69
70
|
},
|
|
70
71
|
"dependencies": {
|