premanmcp 0.9.0 → 0.10.0

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.
package/README.md CHANGED
@@ -42,19 +42,35 @@ Claude Code's MCP config, or `~/.codex/config.toml`):
42
42
  ```
43
43
 
44
44
  `connect` reads the config back after writing it, and prints a copy-paste snippet if it
45
- cannot confirm the entry landed. It then finishes the link itself by running your agent
46
- headlessly (`claude -p`, `cursor-agent -p`, `codex exec`) so it makes one PreMan call —
47
- that check-in is the only real proof the agent loaded the server. If the agent's CLI is
48
- not on PATH, `connect` asks you to restart it and waits instead. `--no-auto-checkin`
49
- turns the spawn off.
50
-
51
- Once the agent has checked in, `connect` walks you into your first test: it runs one
52
- against an endpoint you already have, or prints the discovery brief to hand your agent,
53
- followed by `preman endpoints setup` and `preman test`. Pass `--no-guide` to skip it.
45
+ cannot confirm the entry landed. Then it finishes the link itself rather than asking you
46
+ to go restart anything, in cheapest-first order:
47
+
48
+ 1. **Self-test.** It starts the MCP server exactly as your agent will and calls
49
+ `preman_status` over stdio. That both completes the link and proves the whole chain —
50
+ launcher, package, key, backend. `--no-self-test` turns it off.
51
+ 2. **Headless agent run** (`claude -p`, `cursor-agent -p`, `codex exec`), which also
52
+ proves your agent can load what was written. `--no-auto-checkin` turns it off.
53
+ 3. **Wait**, if neither is possible: restart your agent and it links on its first call.
54
+
55
+ A self-test that answers from an unexpected backend is reported with the file that
56
+ redirected it — a repo-local `preman-mcp.config.json` with `"PREMAN_CONFIG_OVERRIDE": true`
57
+ wins over the MCP config env, and otherwise only fills in what the env leaves unset.
58
+
59
+ Once linked, `connect` finishes onboarding without handing you homework:
60
+
61
+ | Step | What happens |
62
+ |------|--------------|
63
+ | Endpoints | Runs your agent on the discovery brief, then reports `N endpoints · M runnable` |
64
+ | First test | Generates and runs scenarios against the first runnable request |
65
+ | Runner | Pairs this machine and starts `preman runner` in the background, so PreMan can apply fixes here instead of only describing them |
66
+ | Desktop app | Offers the macOS app for watching runs and endpoints |
67
+ | Integrations | Shows GitHub / AWS / Slack, opens what is missing, and picks the connection up when you finish in the browser or the desktop app |
68
+ | Testing on push | Installs the git pre-push hook, so `git push` checks the endpoints you touched |
54
69
 
55
70
  Useful flags: `--agent cursor|claude-code|codex` skips the picker, `--project` writes
56
- project-local config, `--print` shows the config without writing it, `--no-guide` skips
57
- the guided first run.
71
+ project-local config, `--print` shows the config without writing it, `--yes` accepts every
72
+ optional step, `--no-guide` skips all of them, and `--no-runner` / `--no-desktop` /
73
+ `--no-integrations` / `--no-hook` skip one each.
58
74
 
59
75
  In CI or any non-interactive shell, run `connect --agent <name> --api-key pm_live_…`.
60
76
  Without `--agent` there is nothing to prompt on, so `connect` prints ready-to-paste
@@ -190,6 +206,24 @@ npm exec -y premanmcp@latest -- login # Create/login and generate a PreMan API
190
206
  npm exec -y premanmcp@latest -- install # Cursor-only installer (legacy)
191
207
  ```
192
208
 
209
+ ### Runner
210
+
211
+ `connect` sets this up for you; these are for managing it afterwards.
212
+
213
+ ```bash
214
+ preman runner status # Paired? Running?
215
+ preman runner start --background # Hold the job stream, log to ~/.preman/runner.log
216
+ preman runner stop # Stop it and report offline
217
+ preman runner register --agent claude-code # Re-pair (e.g. a different project)
218
+ ```
219
+
220
+ The runner holds one outbound connection to PreMan and runs the work PreMan queues for
221
+ this machine — a failing endpoint becomes an agent run in your own repo instead of a
222
+ prompt you have to paste. It is bound to the agent and directory it was registered with
223
+ and refuses any job that names a different one. The agent may edit files; running commands
224
+ needs `--full-access` (or `PREMAN_RUNNER_FULL_ACCESS=1`). Nothing runs until PreMan has
225
+ something to fix, and `preman runner stop` ends it.
226
+
193
227
  Options:
194
228
 
195
229
  - `--api-key <key>`: PreMan API key.
package/bin/cli.js CHANGED
@@ -34,6 +34,7 @@ import {
34
34
  import { HOSTED_HELP, linkCommand, runCommand, toolsCommand } from "./hosted.js";
35
35
  import { STATUS_HELP, statusCommand } from "./status.js";
36
36
  import { HOOK_HELP, hookCommand } from "./hook.js";
37
+ import { RUNNER_HELP, runnerCommand } from "./runner.js";
37
38
  import { VERIFY_HELP, verifyCommand } from "./verify.js";
38
39
  import { DESKTOP_HELP, installDesktopCommand } from "./desktop.js";
39
40
  import { ACCOUNT_HELP, doctorCommand, loginBrowser, logoutCommand, watchCommand } from "./account.js";
@@ -80,6 +81,7 @@ function printHelp() {
80
81
  ["status", "Healthy / failing / recently fixed endpoints"],
81
82
  ["verify [options]", "Test endpoints against your local app"],
82
83
  ["hook install|uninstall|status", "Manage the git pre-push hook"],
84
+ ["runner start|status|stop", "Run PreMan's queued agent work on this machine"],
83
85
  ["doctor", "Diagnose credentials, backend, target, integrations"],
84
86
  ["install-desktop", "Download and install the PreMan desktop app"],
85
87
  ["onboard", "Sign in, then connect agent, GitHub, AWS, Slack"],
@@ -104,7 +106,7 @@ function printHelp() {
104
106
 
105
107
  Usage:
106
108
  ${usageLines}
107
- ${INTEGRATIONS_HELP}${CONNECT_HELP}${DISPATCH_HELP}${STATUS_HELP}${VERIFY_HELP}${HOOK_HELP}${ACCOUNT_HELP}${DESKTOP_HELP}${ENDPOINTS_HELP}${TEST_HELP}
109
+ ${INTEGRATIONS_HELP}${CONNECT_HELP}${DISPATCH_HELP}${STATUS_HELP}${VERIFY_HELP}${HOOK_HELP}${RUNNER_HELP}${ACCOUNT_HELP}${DESKTOP_HELP}${ENDPOINTS_HELP}${TEST_HELP}
108
110
  Login options:
109
111
  --email <email> Pre-fill the email prompt
110
112
  --backend <url> PreMan backend URL. Defaults to ${DEFAULT_BACKEND}
@@ -221,6 +223,8 @@ async function main() {
221
223
  await verifyCommand(commandArgs);
222
224
  } else if (command === "hook") {
223
225
  await hookCommand(commandArgs);
226
+ } else if (command === "runner") {
227
+ await runnerCommand(commandArgs);
224
228
  } else if (command === "logout") {
225
229
  await logoutCommand();
226
230
  } else if (command === "doctor") {