@anusornneal/chat-relay 1.8.0 → 1.9.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.
@@ -65,20 +65,20 @@ function candidatePaths(payload) {
65
65
  .map((job) => ({ value: job && typeof job === "object" ? job.cwd || fallbackCwd : fallbackCwd, directory: true }));
66
66
  }
67
67
  if (action.startsWith("terminal.")) {
68
- if (action === "terminal.exec" || action === "terminal.start" || action === "terminal.shell.start") {
68
+ if (action === "terminal.exec" || action === "terminal.exec.compact" || action === "terminal.start" || action === "terminal.shell.start") {
69
69
  return [{ value: payload.cwd, directory: true }];
70
70
  }
71
71
  return [];
72
72
  }
73
- if (action === "fs.batch") {
73
+ if (["fs.batch", "fs.batch.compact", "fs.editMany"].includes(action)) {
74
74
  return (Array.isArray(payload.operations) ? payload.operations : [])
75
75
  .flatMap((item) => [item?.path, item?.source, item?.destination]
76
76
  .filter((value) => typeof value === "string")
77
- .map((value) => ({ value, cwd: payload.cwd, directory: item?.op === "list" })));
77
+ .map((value) => ({ value, cwd: payload.basePath || payload.cwd, directory: item?.op === "list" || item?.op === "search" })));
78
78
  }
79
- if (action === "fs.readMany") {
79
+ if (action === "fs.readMany" || action === "fs.readMany.relative") {
80
80
  return (Array.isArray(payload.paths) ? payload.paths : [])
81
- .map((item) => ({ value: typeof item === "string" ? item : item?.path, cwd: payload.cwd }));
81
+ .map((item) => ({ value: typeof item === "string" ? item : item?.path, cwd: payload.basePath || payload.cwd }));
82
82
  }
83
83
  if (action === "fs.move") {
84
84
  return [{ value: payload.source, cwd: payload.cwd }, { value: payload.destination, cwd: payload.cwd }];
@@ -183,9 +183,14 @@ export function describeToolActivity(payload = {}, allowedRoots = [], linkedCont
183
183
  case "fs.read":
184
184
  operation = "Read " + shortName(payload.path);
185
185
  break;
186
+ case "fs.readMany.relative":
186
187
  case "fs.readMany":
187
188
  operation = "Read " + count(payload.paths) + " files";
188
189
  break;
190
+ case "fs.editMany":
191
+ operation = "Edit " + count(payload.operations) + " files";
192
+ break;
193
+ case "fs.batch.compact":
189
194
  case "fs.batch":
190
195
  operation = "Inspect " + count(payload.operations) + " filesystem items";
191
196
  break;
@@ -195,6 +200,7 @@ export function describeToolActivity(payload = {}, allowedRoots = [], linkedCont
195
200
  case "fs.list":
196
201
  operation = "Browse " + shortName(payload.path);
197
202
  break;
203
+ case "terminal.exec.compact":
198
204
  case "terminal.exec":
199
205
  case "terminal.start":
200
206
  operation = terminalTitle(payload);
@@ -202,12 +208,14 @@ export function describeToolActivity(payload = {}, allowedRoots = [], linkedCont
202
208
  case "terminal.batch.start":
203
209
  operation = "Run " + count(payload.jobs) + " terminal tasks";
204
210
  break;
211
+ case "terminal.batch.read.compact":
205
212
  case "terminal.batch.read":
206
213
  operation = "Review terminal batch results";
207
214
  break;
208
215
  case "terminal.batch.status":
209
216
  operation = "Check terminal batch progress";
210
217
  break;
218
+ case "terminal.read.compact":
211
219
  case "terminal.read":
212
220
  operation = "Review terminal output";
213
221
  break;
@@ -164,6 +164,9 @@ export function humanizeToolCall(payload = {}) {
164
164
  return "Check agent connection";
165
165
  case "agent.config":
166
166
  return "Read agent configuration";
167
+ case "agent.usageStats":
168
+ return `Read ${number(payload.days, 30)} days of local usage statistics`;
169
+ case "agent.recentCalls.page":
167
170
  case "agent.recentCalls":
168
171
  return `Read recent activity · up to ${number(payload.limit, 50)} calls`;
169
172
  case "agent.lifecycle.status":
@@ -181,8 +184,12 @@ export function humanizeToolCall(payload = {}) {
181
184
  return `Browse ${compactPath(payload.path)} · depth ${number(payload.depth)} · up to ${number(payload.limit, 100)} items`;
182
185
  case "fs.read":
183
186
  return `Read ${compactPath(payload.path)} · ${lineRange(payload)}`;
187
+ case "fs.readMany.relative":
184
188
  case "fs.readMany":
185
189
  return `Read ${Array.isArray(payload.paths) ? payload.paths.length : 0} files`;
190
+ case "fs.editMany":
191
+ return `Edit ${Array.isArray(payload.operations) ? payload.operations.length : 0} files`;
192
+ case "fs.batch.compact":
186
193
  case "fs.batch":
187
194
  return `Inspect filesystem · ${Array.isArray(payload.operations) ? payload.operations.length : 0} operations`;
188
195
  case "fs.artifact":
@@ -212,12 +219,14 @@ export function humanizeToolCall(payload = {}) {
212
219
  case "process.kill":
213
220
  return `Stop process ${number(payload.pid)}`;
214
221
 
222
+ case "terminal.exec.compact":
215
223
  case "terminal.exec":
216
224
  return withCwd(humanizeCommand(payload.command), payload.cwd);
217
225
  case "terminal.start":
218
226
  return withCwd(`Start background task · ${humanizeCommand(payload.command).replace(/^Run /, "")}`, payload.cwd);
219
227
  case "terminal.shell.start":
220
228
  return withCwd("Open interactive shell", payload.cwd);
229
+ case "terminal.read.compact":
221
230
  case "terminal.read":
222
231
  return `Read terminal output · ${cleanText(payload.sessionId, 24)} · after #${number(payload.afterSeq)}${Number(payload.waitMs) > 0 ? ` · wait up to ${number(payload.waitMs)}ms` : ""}`;
223
232
  case "terminal.write":
@@ -232,6 +241,7 @@ export function humanizeToolCall(payload = {}) {
232
241
  return `Run terminal batch · ${Array.isArray(payload.jobs) ? payload.jobs.length : 0} jobs · ${number(payload.concurrency, 1)} at a time`;
233
242
  case "terminal.batch.status":
234
243
  return `Check batch progress · ${cleanText(payload.batchId, 24)}`;
244
+ case "terminal.batch.read.compact":
235
245
  case "terminal.batch.read":
236
246
  return `Read batch output · ${cleanText(payload.batchId, 24)}`;
237
247
  case "terminal.batch.cancel":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anusornneal/chat-relay",
3
- "version": "1.8.0",
3
+ "version": "1.9.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": {
@@ -43,11 +43,11 @@
43
43
  "prepublishOnly": "npm run verify:publish",
44
44
  "test:oauth": "node test/oauth-smoke.mjs",
45
45
  "test:usage": "node test/usage-smoke.mjs",
46
- "test:usage-storage": "node test/usage-storage.test.mjs && node --test test/usage-batch.test.mjs",
46
+ "test:usage-storage": "node test/usage-storage.test.mjs && node --test test/usage-batch.test.mjs test/usage-fourhour-profile.test.mjs",
47
47
  "test:no-quota": "node test/no-quota-regression.test.mjs",
48
48
  "test:admin-api": "node test/admin-api-smoke.mjs",
49
49
  "test:admin-auth": "node test/admin-auth-smoke.mjs",
50
- "test:dashboard": "node test/dashboard-smoke.mjs",
50
+ "test:dashboard": "node --test test/dashboard-ui-contract.test.mjs test/dashboard-theme.test.mjs && node test/dashboard-smoke.mjs",
51
51
  "test:dashboard-timers": "node test/dashboard-timers.test.mjs",
52
52
  "test:ops": "node test/ops-smoke.mjs",
53
53
  "test:desktop": "node --test test/agent-desktop-adapter.test.mjs && node test/mcp-desktop-smoke.mjs",
@@ -61,8 +61,9 @@
61
61
  "test:soak": "node test/soak-smoke.mjs",
62
62
  "test:file-search": "node --test test/file-search.test.mjs test/search-preview.test.mjs test/adaptive-tools.test.mjs",
63
63
  "bench:search-preview:e2e": "node test/search-preview-e2e-benchmark.mjs",
64
- "test:hardening": "npm run test:file-search && npm run test:batch-contract && npm run test:terminal-perf && 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",
64
+ "test:hardening": "npm run test:file-search && npm run test:batch-contract && npm run test:tool-efficiency && npm run test:terminal-perf && 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",
65
65
  "test:batch-contract": "node --test test/tool-contract-batch.test.mjs",
66
+ "test:tool-efficiency": "node --test --test-concurrency=1 test/tool-efficiency.test.mjs test/tool-efficiency-mcp.test.mjs",
66
67
  "test:terminal-perf": "node --test test/terminal-perf.test.mjs test/terminal-wait.test.mjs",
67
68
  "test:tool-guidance": "node --test test/tool-error-guidance.test.mjs",
68
69
  "verify:review": "node scripts/verify-review-artifacts.mjs",