aiterm-mcp 0.29.0 → 0.29.1

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.
Files changed (2) hide show
  1. package/dist/core.js +19 -0
  2. package/package.json +1 -1
package/dist/core.js CHANGED
@@ -2309,6 +2309,23 @@ function isAgentTuiIdleReady(kind, screen) {
2309
2309
  return false;
2310
2310
  return !isAgentTuiBusy(kind, screen);
2311
2311
  }
2312
+ // 起動側が明示応答すべき既知UI。ここで自動承認せず、ready timeoutを待たずに
2313
+ // `initial_prompt=not_sent`を返してsessionを生かしたままcallerへ制御を戻す。
2314
+ function isAgentTuiActionRequired(kind, screen) {
2315
+ if (kind === "codex") {
2316
+ return screen.includes("Update available!")
2317
+ || screen.includes("Do you trust the contents of this directory?")
2318
+ || screen.includes("Hooks need review")
2319
+ || screen.includes("Allow the room MCP server to run tool")
2320
+ || screen.includes("Would you like to run the following command?");
2321
+ }
2322
+ if (kind === "claude") {
2323
+ return /new MCP servers? found in this project/iu.test(screen)
2324
+ || screen.includes("Is this a project you created or one you trust")
2325
+ || screen.includes("trust this folder");
2326
+ }
2327
+ return false;
2328
+ }
2312
2329
  async function waitAgentTuiReadyImpl(kind, sample, sleepFn, opts = {}) {
2313
2330
  const timeoutMs = opts.timeoutMs ?? AGENT_TUI_READY_TIMEOUT_MS;
2314
2331
  const pollMs = opts.pollMs ?? AGENT_TUI_READY_POLL_MS;
@@ -2320,6 +2337,8 @@ async function waitAgentTuiReadyImpl(kind, sample, sleepFn, opts = {}) {
2320
2337
  for (;;) {
2321
2338
  lastScreen = sample();
2322
2339
  samples++;
2340
+ if (isAgentTuiActionRequired(kind, lastScreen))
2341
+ return { ready: false, samples, lastScreen };
2323
2342
  if (isAgentTuiIdleReady(kind, lastScreen)) {
2324
2343
  readyStreak++;
2325
2344
  if (readyStreak >= stableSamples)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiterm-mcp",
3
- "version": "0.29.0",
3
+ "version": "0.29.1",
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": [