@myagentroam/node 0.13.2 → 0.13.3

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.
@@ -1 +1 @@
1
- {"type":"module","version":"0.13.2"}
1
+ {"type":"module","version":"0.13.3"}
package/dist/terminal.js CHANGED
@@ -6,9 +6,11 @@ import { homedir } from 'node:os';
6
6
  import { dirname, join } from 'node:path';
7
7
  import { terminalDataFrameSchema } from '@myagentroam/protocol';
8
8
  import { nodeExecutionEnvironment } from './node-execution-environment.js';
9
+ import { nodeLog } from './operational.js';
9
10
  import { terminateProcessTree } from './process-tree.js';
10
11
  import { TerminalPtyProcess } from './terminal-pty.js';
11
12
  import { TerminalPtyPool } from './terminal-pty-pool.js';
13
+ import { safeErrorCode } from './util/safe-error.js';
12
14
  const MAX_FRAME_CHARACTERS = 65_536;
13
15
  const TERMINAL_COMMAND_MAX_BYTES = 64 * 1024;
14
16
  const DEFAULT_MAX_TERMINALS = 10;
@@ -78,7 +80,19 @@ export class TerminalManager {
78
80
  this.pipeFactory = options.pipeFactory ?? nodePipeFactory;
79
81
  this.terminate =
80
82
  options.terminate ?? ((child, platform) => terminateProcessTree(child, platform));
81
- this.idleTimer = setInterval(() => void this.closeExpired(), Math.min(this.idleTimeoutMs, 60_000));
83
+ this.idleTimer = setInterval(() => {
84
+ void this.closeExpired().catch((error) => {
85
+ try {
86
+ nodeLog('terminal.cleanup.failed', {
87
+ source: 'idle',
88
+ errorCode: safeErrorCode(error, 'TERMINAL_CLEANUP_FAILED')
89
+ });
90
+ }
91
+ catch {
92
+ // Logging must not turn a handled background failure into another rejection.
93
+ }
94
+ });
95
+ }, Math.min(this.idleTimeoutMs, 60_000));
82
96
  this.idleTimer.unref();
83
97
  }
84
98
  availableProfiles() {
@@ -673,7 +687,18 @@ export class TerminalManager {
673
687
  .sort((left, right) => left.lastUsedAt - right.lastUsedAt || left.createdAt - right.createdAt)[0];
674
688
  if (candidate === undefined)
675
689
  throw new Error('TERMINAL_LIMIT_REACHED');
676
- void this.close(candidate.id);
690
+ void this.close(candidate.id).catch((error) => {
691
+ try {
692
+ nodeLog('terminal.cleanup.failed', {
693
+ source: 'capacity',
694
+ terminalId: candidate.id,
695
+ errorCode: safeErrorCode(error, 'TERMINAL_CLEANUP_FAILED')
696
+ });
697
+ }
698
+ catch {
699
+ // Logging must not turn a handled background failure into another rejection.
700
+ }
701
+ });
677
702
  }
678
703
  runningCountForWorkspace(workspaceId) {
679
704
  return [...this.terminals.values()].filter((terminal) => terminal.state === 'RUNNING' && terminal.workspaceId === workspaceId).length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/node",
3
- "version": "0.13.2",
3
+ "version": "0.13.3",
4
4
  "description": "MyAgentRoam Node runtime CLI.",
5
5
  "license": "Apache-2.0 AND GPL-2.0-or-later",
6
6
  "type": "module",
@@ -44,14 +44,14 @@
44
44
  "turndown-plugin-gfm": "^1.0.2",
45
45
  "ws": "^8.21.3",
46
46
  "zod": "4.4.3",
47
- "@myagentroam/agent": "0.13.2",
48
- "@myagentroam/protocol": "0.13.2"
47
+ "@myagentroam/agent": "0.13.3",
48
+ "@myagentroam/protocol": "0.13.3"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@types/turndown": "^5.0.6",
52
52
  "@types/ws": "^8.18.1",
53
53
  "@myagentroam/code-navigation": "0.11.1",
54
- "@myagentroam/marctl": "0.13.2"
54
+ "@myagentroam/marctl": "0.13.3"
55
55
  },
56
56
  "exports": {
57
57
  "./config": {