llm-relay 0.54.0 → 0.55.2

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 (36) hide show
  1. package/dist/cli.js +23 -1
  2. package/dist/cli.js.map +1 -1
  3. package/dist/delegate-gate/cast-necessity.d.ts +14 -0
  4. package/dist/delegate-gate/cast-necessity.js +150 -0
  5. package/dist/delegate-gate/cast-necessity.js.map +1 -0
  6. package/dist/delegate-gate/cli.d.ts +20 -0
  7. package/dist/delegate-gate/cli.js +51 -0
  8. package/dist/delegate-gate/cli.js.map +1 -0
  9. package/dist/delegate-gate/diff-parser.d.ts +59 -0
  10. package/dist/delegate-gate/diff-parser.js +147 -0
  11. package/dist/delegate-gate/diff-parser.js.map +1 -0
  12. package/dist/delegate-gate/fix.d.ts +16 -0
  13. package/dist/delegate-gate/fix.js +43 -0
  14. package/dist/delegate-gate/fix.js.map +1 -0
  15. package/dist/delegate-gate/gate.d.ts +18 -0
  16. package/dist/delegate-gate/gate.js +42 -0
  17. package/dist/delegate-gate/gate.js.map +1 -0
  18. package/dist/delegate-gate/minimality.d.ts +30 -0
  19. package/dist/delegate-gate/minimality.js +120 -0
  20. package/dist/delegate-gate/minimality.js.map +1 -0
  21. package/dist/delegate-gate/post-image.d.ts +10 -0
  22. package/dist/delegate-gate/post-image.js +45 -0
  23. package/dist/delegate-gate/post-image.js.map +1 -0
  24. package/dist/delegate-gate/shared-state.d.ts +15 -0
  25. package/dist/delegate-gate/shared-state.js +158 -0
  26. package/dist/delegate-gate/shared-state.js.map +1 -0
  27. package/dist/delegate-gate/test-assertions.d.ts +18 -0
  28. package/dist/delegate-gate/test-assertions.js +273 -0
  29. package/dist/delegate-gate/test-assertions.js.map +1 -0
  30. package/dist/delegate-gate/types.d.ts +26 -0
  31. package/dist/delegate-gate/types.js +19 -0
  32. package/dist/delegate-gate/types.js.map +1 -0
  33. package/dist/refusal-interpretation.d.ts +3 -0
  34. package/dist/refusal-interpretation.js +7 -1
  35. package/dist/refusal-interpretation.js.map +1 -1
  36. package/package.json +3 -3
package/dist/cli.js CHANGED
@@ -37,6 +37,7 @@ import { DASHBOARD_BOOTSTRAP_SCHEMA, DASHBOARD_BOOTSTRAP_REQUEST_SCHEMA } from "
37
37
  import { flushRuntimeTelemetry } from "./ping/runtime-telemetry.js";
38
38
  import { flushProbeCache } from "./ping/probe-cache.js";
39
39
  import { runKeysAddLocal, runKeysDisableLocal, runKeysEnableLocal, runKeysExportLocal, runKeysImportLocal, runKeysListLocal, runKeysRemoveLocal, runKeysRevokeLocal, runKeysRotateLocal, runKeysUnlockLocal, } from "./keys-cli.js";
40
+ import { runDelegateGateCli } from "./delegate-gate/cli.js";
40
41
  // Provenance stays attached to the rendered number: a first-party figure and a same-model figure
41
42
  // taken from another host are different claims, and a future source must be a compile error at the
42
43
  // table, not an unknown rendered as the strongest claim.
@@ -79,6 +80,7 @@ const VALUE_FLAGS = new Set([
79
80
  "--label", "-label",
80
81
  "--env-name", "-env-name",
81
82
  "--out", "-out",
83
+ "--repo", "-repo",
82
84
  ]);
83
85
  let cachedArgv;
84
86
  let cachedParsedArgs;
@@ -198,6 +200,7 @@ ${formatTextTable([
198
200
  ["eligibility scope breadth", "credential = current credential slot; provider = all credentials for that provider."],
199
201
  ["llm-relay dispatch [lane] [options]", "Choose next dispatch lane; adapts to the calling host."],
200
202
  ["llm-relay dispatch --next-command -t <task>", "Print only the runnable command for the next lane."],
203
+ ["llm-relay delegate-gate <diff-file> --repo <root> [--fix]", "Quality-gate a delegated lane's diff before judgment/merge."],
201
204
  ["llm-relay help | --help | -h", "Show help."],
202
205
  ["llm-relay version | --version | -v", "Print version."],
203
206
  ], " ")}
@@ -917,7 +920,7 @@ const COOLDOWN_CLEAR_OPTIONS = new Map([
917
920
  export const CLI_COMMAND_NAMES = new Set([
918
921
  "onboard", "setup", "keys", "check-keys", "models", "ping", "dashboard", "telemetry",
919
922
  "offload", "lanes", "dispatch", "cooldowns", "eligibility", "candidates", "cost", "pools",
920
- "routing", "route", "config", "help", "version",
923
+ "routing", "route", "config", "delegate-gate", "help", "version",
921
924
  ]);
922
925
  /**
923
926
  * Positional-ARITY bounds per command — the shared half of "an ignored argument is a lie".
@@ -981,6 +984,8 @@ const COMMAND_ARITY = {
981
984
  routing: { min: 1, max: -1 },
982
985
  // Same handler as `routing`; omitting the alias would leave it unguarded.
983
986
  route: { min: 1, max: -1 },
987
+ // `runDelegateGateCli(arg3)` — one required diff-file positional; `--repo` and `--fix` are flags.
988
+ "delegate-gate": { min: 2, max: 2, hint: "llm-relay delegate-gate <diff-file> --repo <root> [--fix]" },
984
989
  };
985
990
  /**
986
991
  * Refuse a command given more positionals than it can read, or fewer than it needs.
@@ -3312,6 +3317,18 @@ export function main() {
3312
3317
  });
3313
3318
  return;
3314
3319
  }
3320
+ if (arg2 === "delegate-gate") {
3321
+ const result = runDelegateGateCli({
3322
+ diffPath: arg3,
3323
+ repoRoot: argValue("--repo", "-repo"),
3324
+ fix: hasFlag("--fix", "-fix"),
3325
+ });
3326
+ if (result.stdout.length > 0)
3327
+ process.stdout.write(result.stdout);
3328
+ if (result.stderr.length > 0)
3329
+ process.stderr.write(result.stderr);
3330
+ process.exit(result.exitCode);
3331
+ }
3315
3332
  dispatchDashboardOrProxy(arg2, {
3316
3333
  loadConfig: loadOrExit,
3317
3334
  runDashboard: runDashboardCommand,
@@ -3402,6 +3419,11 @@ export function classifyCommand(argv) {
3402
3419
  return arg3 === "accept" || arg3 === "reject" || arg3 === "propose" ? "mutating" : "read-only";
3403
3420
  case "dashboard":
3404
3421
  return "read-only";
3422
+ // Analyzes a diff file and optionally writes `<diff-file>.fixed.patch` NEXT TO THE INPUT —
3423
+ // never touches this machine's own config/state, so it stays read-only for update-check
3424
+ // purposes exactly like `dispatch -x` does for the same reason.
3425
+ case "delegate-gate":
3426
+ return "read-only";
3405
3427
  // check-keys, models, telemetry, dispatch, candidates, pools, ping, help, version —
3406
3428
  // and anything not yet listed. `dispatch -x` is included on purpose: it reports spend to a
3407
3429
  // running proxy's in-memory cooldowns and changes nothing on this machine.