Skip to content

Feat/issue 14 interactive install - #28

Merged
egdev6 merged 10 commits into
egdev6:mainfrom
aam9063:feat/issue-14-interactive-install
Oct 8, 2026
Merged

egdev6 merged 10 commits into
egdev6:mainfrom
aam9063:feat/issue-14-interactive-install

Conversation

@aam9063

@aam9063 aam9063 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Linked issue

Closes #14

Summary

  • Adds a read-only detection module (lib/detect.mjs) for Pi, Claude Code, Codex, OpenCode, and Gemini CLI: well-known config-directory probes plus a platform-aware PATH scan, no process spawning, fully injectable ({ home, pathEnv, platform }) for deterministic tests.
  • Adds an interactive prompt module (lib/prompt.mjs) with injected input/output streams: detected-host listing with evidence, multi-select targets (dedup display via the existing resolveUniqueDestinations), scope selection, plan summary, and confirmation. Cancellation (EOF or non-confirm) returns null and the caller performs zero writes. Pi is detection-only and renders the supported pi install npm:mobile-agent-orchestrator command; it is never a write target.
  • Wires the CLI (bin/mobile-agent-orchestrator.mjs): no-arguments install runs the interactive flow when a TTY is present and fails cleanly with a flags hint for CI otherwise; explicit --target invocations keep byte-identical validation, output, and behavior; an explicit --scope without --target is validated first and preselects the scope question. README documents the no-args form.

Intentionally out of scope (per the issue's non-goals): no new hosts, no changes to the canonical skill content, no npm publishing. The installer never installs Herdr, Moshi, SSH, Mosh, Tailscale, services, or firewall rules.

Verification

Platform note: verified on Windows native. The two detect-release failures below are the pre-existing Windows tooling bugs (spawned-child path resolution produces C:\C:\...), unchanged from main; they are unrelated to this change.

  • npm test: fails on this machine only at the two pre-existing Windows detect-release cases (CLI emits GitHub output for unchanged and taggable versions, CLI reports invalid transitions and exits nonzero); full runner: 77 tests, 68 pass, 2 fail (both pre-existing), 7 skipped (pre-existing).
  • npm run pack:check: exit 0, 11 entries.
  • node bin/mobile-agent-orchestrator.mjs --help: exit 0, documents both the interactive and explicit forms.
  • node bin/mobile-agent-orchestrator.mjs install --target codex --scope project --dry-run: exit 0, plan JSON printed, nothing written.
  • node bin/mobile-agent-orchestrator.mjs install (non-TTY shell): exit 1, single-line error suggesting explicit flags; no prompting.
  • Interactive flows are covered deterministically in tests/cli.test.mjs (8 cases) and tests/prompt.test.mjs (8 cases) via injected streams, including cancellation-equals-zero-writes.

Small correction to the issue text: the issue's verification snippet install --target codex --dry-run omits the required --scope (no default by design, per the shipped behavior from #12), and install --help was never a valid form (usage is shown by bare --help). The corrected commands above exit 0.

Checklist

  • The issue reference is correct: Closes for completed work or Refs for partial work.
  • The scope is focused and preserves the skill's safety contracts.
  • Verification results and any limitations are recorded above.
  • Documentation is updated where applicable.

@egdev6

egdev6 commented Oct 8, 2026

Copy link
Copy Markdown
Owner

@aam9063 please fix the interactive process cleanup before merging. I reproduced this on Linux with a real PTY: after selecting a target and project scope, both confirming with y and cancelling with n finish printing their output, but the Node process remains alive. It also happens with --dry-run and preselected --scope project.

P1: lib/prompt.mjs:64-75 and bin/mobile-agent-orchestrator.mjs:144-146 attach listeners to stdin without disposing them or pausing the input after the flow. Setting process.exitCode alone does not release the active stdin handle. Please add cleanup in a finally for both the line reader and the scope proxy, plus a regression test that keeps terminal input open after confirmation/cancellation. The current Readable.from(...) fixtures reach EOF and hide this bug.

Minor follow-up (P3): lib/detect.mjs:64 uses existsSync() for PATH candidates, so a directory named codex is reported as an installed executable. Check the file type and executable permission where applicable. Verification on this revision: npm test passes 77/77, npm run pack:check passes, and CI is green.

@egdev6

egdev6 commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

@aam9063

P2: Check stdin before entering interactive mode

Please also check that stdin is a TTY in bin/mobile-agent-orchestrator.mjs:192. The default currently checks only process.stdout.isTTY, so redirected input with terminal output bypasses the non-interactive guard and can write files without explicit target/scope flags.

Reproduced from a terminal (in a temporary directory):

printf '2\n2\ny\n' | node bin/mobile-agent-orchestrator.mjs install

This exited with code 0 and created .agents/skills/mobile-agent-orchestrator/SKILL.md.

Please add a regression test for piped stdin with TTY stdout. The current CLI tests inject isTTY, so they do not cover the default derivation. Verification on Linux: all 85 tests pass, npm run pack:check passes, and CI is green. No other confirmed findings.

@egdev6

egdev6 commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Thanks for the contribution and for addressing the review feedback! I re-reviewed commit ea1de10 and confirmed that the stdin/stdout TTY check resolves the previous P2 finding.

Verified the original piped-stdin + TTY-stdout scenario: exit 1, no writes. The real interactive TTY flow also installs successfully and exits cleanly. All 87 tests pass, npm run pack:check passes, and CI is green.

No remaining blockers found in this review. Thanks for adding the regression coverage!

@egdev6
egdev6 merged commit e964f47 into egdev6:main Oct 8, 2026
1 check passed
@aam9063
aam9063 deleted the feat/issue-14-interactive-install branch October 8, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detect installed coding agents and add interactive selection

2 participants