feat: 서버 임베드 모듈 + maestro-server CLI (플러그인화 1단계) - #32
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab742a74d2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (probe.maestro) { | ||
| return { |
There was a problem hiding this comment.
Validate the requested repo before reusing a server
When the default port already hosts Maestro for repository A and a caller requests repoPath B, this branch returns the existing server without comparing probe.health.project.path to the requested path. The returned handle therefore claims success while subsequent operations still default to A via runtimeProjectState.path, potentially applying approvals or merges to the wrong repository. Reuse should be refused unless the requested and active repositories resolve to the same path.
Useful? React with 👍 / 👎.
| const url = `http://${host}:${port}`; | ||
| const wsUrl = `ws://${host}:${port}`; |
There was a problem hiding this comment.
Bracket IPv6 hosts when constructing probe URLs
When host is an unbracketed IPv6 literal such as ::1, which is valid for server.listen() and accepted by the CLI, this produces the invalid URL http://::1:<port>. Every health probe is consequently treated as unreachable even though the child binds successfully, and the supervisor eventually kills the healthy server and reports a startup timeout. Preserve the unbracketed bind host but bracket IPv6 literals when constructing HTTP and WebSocket URLs.
Useful? React with 👍 / 👎.
Summary
플러그인화 트랙 1단계 — Claude Code 플러그인·VS Code 확장·CLI가 공용으로 쓸 서버 임베드 코어입니다. 스펙:
docs/superpowers/specs/2026-07-22-server-embed-design.mdlib/server-embed.mjs—startMaestroServer(options)/health로 기동 확인 (서버 본체 무변경 — in-process 리팩터 대신 supervisor 래핑으로 회귀 0)reuseExisting(기본 on): 이미 떠 있는 Maestro 서버 재사용(핸들 비소유 — stop은 no-op), 비-Maestro 프로세스가 포트 점유 시 명확한 에러waitForExit()bin/maestro-server.mjs— 한 줄 실행 CLI--port --host --repo --no-mdns --token --help(신규 의존성 0, node:util parseArgs)bin등록(퍼블리시/npm link시npx maestro-server)Test plan
tests/server-embed.test.mjs5 tests: 기동/멱등 stop, 재사용(비소유 stop 안전), mdns off, 비-Maestro 포트 에러, CLI 스모크(SIGTERM 전파)다음 단계: 이 모듈을 소비하는 Claude Code 플러그인(별도 스펙 — monitors 기반 서버 자동 기동 + Stop 훅 + /maestro 스킬)
🤖 Generated with Claude Code