premanmcp 1.0.5 → 1.1.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/bin/cli.js +36 -1
- package/bin/eval.js +1200 -0
- package/bin/eval_harness.py +231 -0
- package/bin/eval_target.js +530 -0
- package/bin/link.js +81 -6
- package/bin/runner.js +193 -7
- package/bin/shared.js +37 -2
- package/package.json +2 -2
package/bin/cli.js
CHANGED
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
import { HOSTED_HELP, linkCommand, runCommand, toolsCommand } from "./hosted.js";
|
|
37
37
|
import { STATUS_HELP, statusCommand } from "./status.js";
|
|
38
38
|
import { HOOK_HELP, hookCommand, installHook, scheduleHookRepair } from "./hook.js";
|
|
39
|
+
import { EVAL_HELP } from "./eval.js";
|
|
39
40
|
import { RUNNER_HELP, runnerCommand } from "./runner.js";
|
|
40
41
|
import { VERIFY_HELP, verifyCommand } from "./verify.js";
|
|
41
42
|
import {
|
|
@@ -94,6 +95,7 @@ function printHelp() {
|
|
|
94
95
|
["verify [options]", "Test endpoints against your local app"],
|
|
95
96
|
["hook install|uninstall|status", "Manage the git pre-push hook"],
|
|
96
97
|
["runner start|status|stop", "Run PreMan's queued agent work on this machine"],
|
|
98
|
+
["eval run|doctor", "Run PreMan's queued agent eval against your local agent"],
|
|
97
99
|
["doctor", "Diagnose credentials, backend, target, integrations"],
|
|
98
100
|
["install-desktop", "Download and install the PreMan desktop app"],
|
|
99
101
|
["onboard", "Create an account, install the app signed in, then integrations"],
|
|
@@ -107,6 +109,7 @@ function printHelp() {
|
|
|
107
109
|
["", "Start the PreMan MCP server"],
|
|
108
110
|
["link|tools|run ...", "Drive a published hosted MCP"],
|
|
109
111
|
["endpoints list|discover|setup ...", "Discover, list, and set up API endpoints"],
|
|
112
|
+
["test --agent [--only <id>]", "Measure your agent against the behaviours you turned on"],
|
|
110
113
|
["test <id> [--scenario ...] [--stress]", "Generate + run tests for an endpoint"],
|
|
111
114
|
["tests generate|review|setup|enrich", "Collections: generate, review, fixtures, enrich"],
|
|
112
115
|
];
|
|
@@ -119,7 +122,7 @@ function printHelp() {
|
|
|
119
122
|
|
|
120
123
|
Usage:
|
|
121
124
|
${usageLines}
|
|
122
|
-
${INTEGRATIONS_HELP}${CONNECT_HELP}${DISPATCH_HELP}${STATUS_HELP}${VERIFY_HELP}${HOOK_HELP}${RUNNER_HELP}${ACCOUNT_HELP}${DESKTOP_HELP}${ENDPOINTS_HELP}${TEST_HELP}${TESTS_HELP}
|
|
125
|
+
${INTEGRATIONS_HELP}${CONNECT_HELP}${DISPATCH_HELP}${STATUS_HELP}${VERIFY_HELP}${HOOK_HELP}${RUNNER_HELP}${EVAL_HELP}${ACCOUNT_HELP}${DESKTOP_HELP}${ENDPOINTS_HELP}${TEST_HELP}${TESTS_HELP}
|
|
123
126
|
Login options:
|
|
124
127
|
--email <email> Pre-fill the email prompt
|
|
125
128
|
--backend <url> PreMan backend URL. Defaults to ${DEFAULT_BACKEND}
|
|
@@ -259,6 +262,22 @@ async function main() {
|
|
|
259
262
|
// depends on: the agent picker lives there, and importing it back would
|
|
260
263
|
// close the cycle.
|
|
261
264
|
await runnerCommand(commandArgs, { resolveAgent: resolveAgentForPairing });
|
|
265
|
+
} else if (command === "eval") {
|
|
266
|
+
// Same injection for the same reason, plus the runner protocol pieces:
|
|
267
|
+
// eval.js executes a leased run, and runner.js owns pairing and the stream.
|
|
268
|
+
// Passing them in keeps the dependency one-directional.
|
|
269
|
+
const { evalCommand } = await import("./eval.js");
|
|
270
|
+
const runner = await import("./runner.js");
|
|
271
|
+
await evalCommand(commandArgs, {
|
|
272
|
+
makeArgs,
|
|
273
|
+
registerRunner: runner.registerRunner,
|
|
274
|
+
readRunnerState: runner.readRunnerState,
|
|
275
|
+
saveRunnerState: runner.saveRunnerState,
|
|
276
|
+
deviceId: runner.deviceId,
|
|
277
|
+
runnerLoop: runner.runnerLoop,
|
|
278
|
+
pairingIsLive: runner.pairingIsLive,
|
|
279
|
+
resolveAgent: resolveAgentForPairing,
|
|
280
|
+
});
|
|
262
281
|
} else if (command === "logout") {
|
|
263
282
|
await logoutCommand();
|
|
264
283
|
} else if (command === "doctor") {
|
|
@@ -297,6 +316,22 @@ async function main() {
|
|
|
297
316
|
await runCommand(commandArgs);
|
|
298
317
|
} else if (command === "endpoints") {
|
|
299
318
|
await endpointsCommand(commandArgs);
|
|
319
|
+
} else if (command === "test" && commandArgs[0] === "--agent") {
|
|
320
|
+
// `test` already meant an endpoint, and it keeps meaning that. `--agent`
|
|
321
|
+
// names the other subject rather than inventing a second verb for it: the
|
|
322
|
+
// question is the same one, and which thing is under test is the part that
|
|
323
|
+
// differs. Routed here rather than inside testCommand because the two share
|
|
324
|
+
// no arguments beyond the word `test`, and matched in first position only so
|
|
325
|
+
// that an endpoint id is never overtaken by a flag further along the line.
|
|
326
|
+
const { agentTestCommand } = await import("./eval.js");
|
|
327
|
+
const runner = await import("./runner.js");
|
|
328
|
+
await agentTestCommand(commandArgs, {
|
|
329
|
+
makeArgs,
|
|
330
|
+
runnerLoop: runner.runnerLoop,
|
|
331
|
+
saveRunnerState: runner.saveRunnerState,
|
|
332
|
+
readRunnerState: runner.readRunnerState,
|
|
333
|
+
deviceId: runner.deviceId,
|
|
334
|
+
});
|
|
300
335
|
} else if (command === "test") {
|
|
301
336
|
await testCommand(commandArgs);
|
|
302
337
|
} else if (command === "tests") {
|