aiterm-mcp 0.29.5 → 0.29.6

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.
@@ -11,7 +11,12 @@ const STORE_SCHEMA = "aiterm-mcp.runtime-errors.v1";
11
11
  const STATE_SCHEMA = "1.0";
12
12
  const MAX_CONFIG_BYTES = 16 * 1024;
13
13
  const MAX_STORE_BYTES = 1024 * 1024;
14
- const WORKER_TIMEOUT_MS = 2_000;
14
+ const POSIX_WORKER_TIMEOUT_MS = 2_000;
15
+ // Windows はprivate DACLの適用とreadbackをPowerShell 7境界で行う。診断は最大2回、
16
+ // 記録はlock queueとstate更新で複数回この境界を通るため、process起動だけを想定した
17
+ // POSIXの2秒上限では正常処理まで強制終了する。各境界自身の5秒上限は維持し、worker全体だけ分ける。
18
+ const WINDOWS_DIAGNOSTIC_WORKER_TIMEOUT_MS = 12_000;
19
+ const WINDOWS_RECORD_WORKER_TIMEOUT_MS = 30_000;
15
20
  export const RUNTIME_ERROR_DEFINITIONS = Object.freeze({
16
21
  "AITERM.PTY_DEPENDENCY_UNAVAILABLE": Object.freeze({
17
22
  component: "pty-dependency", message_template: "PTY dependency is unavailable", severity: "high",
@@ -635,6 +640,11 @@ export class RuntimeErrorStore {
635
640
  }
636
641
  const WORKER = fileURLToPath(new URL("./runtime-error-worker.js", import.meta.url));
637
642
  function fixedStoreFailure(stderr) { stderr("aiterm: runtime error store unavailable\n"); }
643
+ function defaultWorkerTimeoutMs(action) {
644
+ if (process.platform !== "win32")
645
+ return POSIX_WORKER_TIMEOUT_MS;
646
+ return action === "record" ? WINDOWS_RECORD_WORKER_TIMEOUT_MS : WINDOWS_DIAGNOSTIC_WORKER_TIMEOUT_MS;
647
+ }
638
648
  export function recordRuntimeError(code, options = {}) {
639
649
  validateRuntimeObservation({ code });
640
650
  const stderr = options.stderr ?? ((line) => process.stderr.write(line));
@@ -647,7 +657,7 @@ export function recordRuntimeError(code, options = {}) {
647
657
  const child = spawn(process.execPath, [options.workerPath ?? WORKER, "record", code], {
648
658
  stdio: "ignore", windowsHide: true, env: process.env,
649
659
  });
650
- const timer = setTimeout(() => { report(); forceKill(child); }, options.timeoutMs ?? WORKER_TIMEOUT_MS);
660
+ const timer = setTimeout(() => { report(); forceKill(child); }, options.timeoutMs ?? defaultWorkerTimeoutMs("record"));
651
661
  timer.unref();
652
662
  child.once("error", report);
653
663
  child.once("exit", (exitCode, signal) => { clearTimeout(timer); if (exitCode !== 0 || signal)
@@ -686,7 +696,7 @@ export async function runtimeErrorStoreDiagnostic(options = {}) {
686
696
  finish(fallback);
687
697
  return;
688
698
  }
689
- const timer = setTimeout(() => { forceKill(child); finish(fallback); }, options.timeoutMs ?? WORKER_TIMEOUT_MS);
699
+ const timer = setTimeout(() => { forceKill(child); finish(fallback); }, options.timeoutMs ?? defaultWorkerTimeoutMs("diagnostic"));
690
700
  child.stdout.setEncoding("utf8");
691
701
  child.stdout.on("data", (chunk) => { if (stdout.length <= 4096)
692
702
  stdout += chunk; });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiterm-mcp",
3
- "version": "0.29.5",
3
+ "version": "0.29.6",
4
4
  "mcpName": "io.github.kitepon/aiterm-mcp",
5
5
  "description": "Persistent terminal MCP with one harness-based launcher for Claude Code, Codex CLI, Grok CLI, and Cursor Agent CLI, plus durable PTYs for SSH, containers, and REPLs.",
6
6
  "keywords": [