@garuda-agent/garuda 0.17.0 → 0.18.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.
Files changed (30) hide show
  1. package/CHANGELOG.md +137 -0
  2. package/README.md +1 -1
  3. package/SECURITY.md +1 -1
  4. package/dist/{acpCommand-7EY3NHPG.js → acpCommand-IUZPLPLI.js} +16 -16
  5. package/dist/{chunk-JRVWH27M.js → chunk-2FIV2VZP.js} +7 -3
  6. package/dist/{chunk-TJIWD7R7.js → chunk-4BVCYCQT.js} +3 -3
  7. package/dist/{chunk-U65DQZDB.js → chunk-65NUEOI7.js} +2 -2
  8. package/dist/{chunk-J4346IDH.js → chunk-7KBOIPUT.js} +2 -1
  9. package/dist/chunk-C57GHLKP.js +9 -0
  10. package/dist/chunk-DOCDCQVM.js +484 -0
  11. package/dist/chunk-FOPBOB7W.js +332 -0
  12. package/dist/{chunk-2DYMJMRQ.js → chunk-NHWHG3SW.js} +60 -20
  13. package/dist/{chunk-Z66BWTMD.js → chunk-OQ26W5L4.js} +4 -4
  14. package/dist/chunk-Q4P3W657.js +6372 -0
  15. package/dist/{chunk-ZAE25JM2.js → chunk-QANRZW7W.js} +8 -1
  16. package/dist/{chunk-735BKABA.js → chunk-UKIE4AAM.js} +2 -2
  17. package/dist/cli/index.js +67 -34
  18. package/dist/config-WV2H64TF.js +23 -0
  19. package/dist/evalCommand-SKJQ6CW2.js +686 -0
  20. package/dist/evalTune-CZRCPSZ3.js +295 -0
  21. package/dist/{inkChat-FNUBK43U.js → inkChat-WYYAFZXD.js} +13 -13
  22. package/dist/{jobCommand-FE6XN3YD.js → jobCommand-2ODQLHB3.js} +4 -4
  23. package/dist/{manager-73MPYFTP.js → manager-TCYTA5XU.js} +10 -10
  24. package/dist/{nightCommand-OODJNWDT.js → nightCommand-WJU6VZA6.js} +4 -4
  25. package/dist/{run-ML6GSPN4.js → run-PTMRQCIU.js} +5 -5
  26. package/dist/{setupCommand-GBQIVYJC.js → setupCommand-YMF6I3MD.js} +4 -4
  27. package/dist/tune-YVI2KWQF.js +31 -0
  28. package/package.json +1 -1
  29. package/dist/chunk-BSK5T2ZG.js +0 -9
  30. package/dist/evalCommand-YVQAWUZE.js +0 -2833
@@ -57,6 +57,12 @@ async function loadMcpConfig({ home, root } = { home: homedir(), root: process.c
57
57
  problems.push(`${file}: invalid JSON: ${error.message}`);
58
58
  return [];
59
59
  }
60
+ if (Array.isArray(json?.servers)) {
61
+ problems.push(
62
+ `${file}: "servers" must be an object of name \u2192 server, not a list: { "servers": { "graphify": { "command": "\u2026" }, "linear": { "url": "\u2026" } } }`
63
+ );
64
+ return [];
65
+ }
60
66
  const parsed = fileSchema.safeParse(json);
61
67
  if (!parsed.success) {
62
68
  problems.push(`${file}: ${z.prettifyError(parsed.error)}`);
@@ -147,6 +153,7 @@ function commandLine(def) {
147
153
  }
148
154
 
149
155
  export {
156
+ MCP_FILE,
150
157
  SERVER_NAME,
151
158
  isHttp,
152
159
  loadMcpConfig,
@@ -155,4 +162,4 @@ export {
155
162
  expandEnv,
156
163
  commandLine
157
164
  };
158
- //# sourceMappingURL=chunk-ZAE25JM2.js.map
165
+ //# sourceMappingURL=chunk-QANRZW7W.js.map
@@ -3,7 +3,7 @@ import {
3
3
  Redactor,
4
4
  contextSize,
5
5
  totalTokens
6
- } from "./chunk-J4346IDH.js";
6
+ } from "./chunk-7KBOIPUT.js";
7
7
  import {
8
8
  cleanLine
9
9
  } from "./chunk-PZS3V6P3.js";
@@ -469,4 +469,4 @@ export {
469
469
  addSideUsage,
470
470
  gateProjectSettings
471
471
  };
472
- //# sourceMappingURL=chunk-735BKABA.js.map
472
+ //# sourceMappingURL=chunk-UKIE4AAM.js.map
package/dist/cli/index.js CHANGED
@@ -15,7 +15,11 @@ import {
15
15
  runCommand,
16
16
  runTurnInTerminal,
17
17
  stopMessage
18
- } from "../chunk-Z66BWTMD.js";
18
+ } from "../chunk-OQ26W5L4.js";
19
+ import {
20
+ SwitchApprover,
21
+ TerminalApprover
22
+ } from "../chunk-4JSUUDFQ.js";
19
23
  import {
20
24
  PlainRenderer
21
25
  } from "../chunk-FARS4R67.js";
@@ -23,13 +27,13 @@ import {
23
27
  AutoApprover
24
28
  } from "../chunk-NXJ4XLB5.js";
25
29
  import {
26
- Notifier,
27
- pickChannel
28
- } from "../chunk-N4I6YS3E.js";
29
- import {
30
- SwitchApprover,
31
- TerminalApprover
32
- } from "../chunk-4JSUUDFQ.js";
30
+ NO_MODEL,
31
+ chooseModel,
32
+ keepProviderKeys,
33
+ loadModelsConfig,
34
+ providerKeySource,
35
+ resolveModel
36
+ } from "../chunk-2FIV2VZP.js";
33
37
  import {
34
38
  DEFAULT_MAX_TOKENS,
35
39
  Runtime,
@@ -39,9 +43,16 @@ import {
39
43
  rebuildState,
40
44
  runAgent,
41
45
  signature
42
- } from "../chunk-2DYMJMRQ.js";
46
+ } from "../chunk-NHWHG3SW.js";
47
+ import {
48
+ loadCatalog
49
+ } from "../chunk-65NUEOI7.js";
43
50
  import "../chunk-G2AX7MGS.js";
44
51
  import "../chunk-A2QAIRQL.js";
52
+ import {
53
+ Notifier,
54
+ pickChannel
55
+ } from "../chunk-N4I6YS3E.js";
45
56
  import {
46
57
  FileSessionStore,
47
58
  closeOpenToolCalls,
@@ -52,19 +63,8 @@ import {
52
63
  popPoint,
53
64
  pushPoint,
54
65
  redoPoint
55
- } from "../chunk-735BKABA.js";
56
- import {
57
- NO_MODEL,
58
- chooseModel,
59
- keepProviderKeys,
60
- loadModelsConfig,
61
- providerKeySource,
62
- resolveModel
63
- } from "../chunk-JRVWH27M.js";
64
- import {
65
- loadCatalog
66
- } from "../chunk-U65DQZDB.js";
67
- import "../chunk-J4346IDH.js";
66
+ } from "../chunk-UKIE4AAM.js";
67
+ import "../chunk-7KBOIPUT.js";
68
68
  import {
69
69
  loadSearchConfig
70
70
  } from "../chunk-B25VL4RU.js";
@@ -74,11 +74,11 @@ import {
74
74
  import "../chunk-EU7PA45O.js";
75
75
  import {
76
76
  VERSION
77
- } from "../chunk-BSK5T2ZG.js";
77
+ } from "../chunk-C57GHLKP.js";
78
78
  import "../chunk-5DEWP3YX.js";
79
- import "../chunk-ZAE25JM2.js";
80
- import "../chunk-ATW7BNIG.js";
81
79
  import "../chunk-PZS3V6P3.js";
80
+ import "../chunk-QANRZW7W.js";
81
+ import "../chunk-ATW7BNIG.js";
82
82
  import "../chunk-AOGFYUKG.js";
83
83
  import {
84
84
  JOB_DENIAL
@@ -784,10 +784,23 @@ async function main() {
784
784
  ).option("--verbose", "with json output: also show the tool activity on stderr").action(async (options) => {
785
785
  process.exitCode = await start(options, program);
786
786
  });
787
- program.command("eval").description("run the eval tasks in scratch folders and report pass/fail, steps and cost").option("-m, --model <id>", "model id (or set GARUDA_MODEL)").option("-s, --suite <name>", "basic (default), hard, java, python, all or repo").option("-t, --task <ids...>", "run only these tasks (from any suite)").option("--max-steps <n>", "step limit per task", (v) => Number.parseInt(v, 10)).option(
787
+ const evalCommand = program.command("eval").description("run the eval tasks in scratch folders and report pass/fail, steps and cost").option("-m, --model <id>", "model id (or set GARUDA_MODEL)").option("-s, --suite <name>", "basic (default), hard, java, python, medium, all or repo").option(
788
+ "-t, --task <ids...>",
789
+ "run only these tasks (from any dev suite, or the held-out set with --split)"
790
+ ).option("--max-steps <n>", "step limit per task", (v) => Number.parseInt(v, 10)).option(
788
791
  "--repeat <n>",
789
792
  "run each task n times and show the mean",
790
793
  (v) => Number.parseInt(v, 10)
794
+ ).option("--agent <name>", "garuda (default) or claude-code: the baseline on the same tasks").option(
795
+ "--split <name>",
796
+ "dev (default), heldout or all: the held-out tasks run only on request"
797
+ ).option("--addendum <file>", "add this text (4000 characters at most) to the system prompt").option("--mcp <server>", "allow this one server from ~/.garuda/mcp.json (an MCP A/B)").option(
798
+ "--mcp-prepare <command>",
799
+ "with --mcp: run this in each scratch folder before the agent (e.g. graphify update .)"
800
+ ).option("--shuffle", "run the tasks and their repeats in a random order from --seed").option(
801
+ "--seed <n>",
802
+ "seed for --shuffle and the report's interval (default 1)",
803
+ (v) => Number(v)
791
804
  ).option("--index <mode>", "code index tools for the model: off (default), lookup or all").option("--executor <name>", "auto (default), os or host").option("--keep", "keep the scratch folders").option("--list", "list the tasks and exit").option("--subagents <mode>", "the explore subagent: off (default) or on, for A/B runs").option("--subagent-model <id>", "model of the explore subagent; default: the main model").option("--todo <mode>", "the todo_write tool: off (default) or on, for A/B runs").option("--lsp <mode>", "language server errors in edit results: off (default) or on").option(
792
805
  "--format <mode>",
793
806
  "the project's formatter after edits: off (default) or on, for A/B runs"
@@ -819,13 +832,33 @@ async function main() {
819
832
  "--test-command <cmd>",
820
833
  "with --from-git: the test command; {files} takes the test files (default: detected)"
821
834
  ).action(async (options) => {
822
- const { runEvalCommand } = await import("../evalCommand-YVQAWUZE.js");
835
+ const { runEvalCommand } = await import("../evalCommand-SKJQ6CW2.js");
823
836
  process.exitCode = await runEvalCommand({
824
837
  ...options,
825
838
  model: options.model ?? process.env.GARUDA_MODEL,
826
839
  subagentModel: options.subagentModel ?? process.env.GARUDA_SUBAGENT_MODEL
827
840
  });
828
841
  });
842
+ evalCommand.command("tune").description(
843
+ "improve a prompt addendum: a proposer model edits it, an edit stays when the dev score improves, the held-out set is measured once"
844
+ ).requiredOption(
845
+ "--addendum <file>",
846
+ "the starting addendum (a missing file starts empty); never edited"
847
+ ).option("--proposer <model>", "the model that proposes edits (default claude-opus-5-5)").option("-m, --model <id>", "the agent's model (or set GARUDA_MODEL)").option("-s, --suite <names...>", "dev suites (default: basic hard medium)").option("--rounds <n>", "proposals (default 5)", (v) => Number(v)).option("--repeat <n>", "runs of each dev task per score (default 3)", (v) => Number(v)).option("--heldout-repeat <n>", "runs of each held-out task (default 5)", (v) => Number(v)).option("--margin <n>", "more passing runs that keep an edit (default 2)", (v) => Number(v)).option(
848
+ "--max-cost <usd>",
849
+ "stop before a round that would pass this (default 20)",
850
+ (v) => Number(v)
851
+ ).option("--seed <n>", "seed for the run order and the intervals (default 1)", (v) => Number(v)).option("--yes", "start without the question").option("--parallel <n>", "runs at the same time in each score (default 4)", (v) => Number(v)).action(async (options) => {
852
+ const { runEvalTune } = await import("../evalTune-CZRCPSZ3.js");
853
+ process.exitCode = await runEvalTune({
854
+ ...options,
855
+ model: options.model ?? process.env.GARUDA_MODEL
856
+ });
857
+ });
858
+ evalCommand.command("compare").description("compare two eval reports of the same tasks (pass rates with a paired interval)").argument("<a>", "report.json, or its run folder (.garuda/evals/<run-id>)").argument("<b>", "the second report").option("--seed <n>", "seed for the bootstrap (default 1)", (v) => Number(v)).action(async (a, b, options) => {
859
+ const { runEvalCompare } = await import("../evalCommand-SKJQ6CW2.js");
860
+ process.exitCode = await runEvalCompare(a, b, options);
861
+ });
829
862
  program.command("init").description(
830
863
  "set up this folder (AGENTS.md; commands, MCP servers and rules from Claude Code, OpenCode, Codex, Gemini CLI, Tabnine, Cursor, Copilot), then chat"
831
864
  ).option("-m, --model <id>", "model id (or set GARUDA_MODEL)").action(async (options) => {
@@ -841,19 +874,19 @@ async function main() {
841
874
  program.command("night").description(
842
875
  "run this project's night queue (jobs from /schedule), up to 3 at a time, then write one digest"
843
876
  ).option("--at <HH:MM>", "wait until this local time first (keep the terminal open)").option("--parallel <n>", "jobs at the same time (1 to 10, default 3)").addOption(new Option("--from-launchd").hideHelp()).action(async (options) => {
844
- const { nightCommand } = await import("../nightCommand-OODJNWDT.js");
877
+ const { nightCommand } = await import("../nightCommand-WJU6VZA6.js");
845
878
  process.exitCode = await nightCommand(options, new PlainRenderer());
846
879
  });
847
880
  program.command("setup").description(
848
881
  "choose a provider and model and store its key (~/.garuda/credentials, only you can read it); editors run it to sign in"
849
882
  ).option("--show", "show the model and where each key comes from (keys masked)").option("--forget [key-name]", "remove a stored key, or all of them").action(async (options) => {
850
- const { setupCommand, terminalIO } = await import("../setupCommand-GBQIVYJC.js");
883
+ const { setupCommand, terminalIO } = await import("../setupCommand-YMF6I3MD.js");
851
884
  process.exitCode = await setupCommand(options, { io: await terminalIO() });
852
885
  });
853
886
  program.command("acp").description(
854
887
  "run as an agent for an editor over the Agent Client Protocol (VS Code with an extension, Zed, JetBrains, Neovim, Emacs); the editor starts it"
855
888
  ).argument("[action]", "setup: run garuda setup (the editor's sign-in, ACP Terminal Auth)").option("-m, --model <id>", "model id (or set GARUDA_MODEL)").action(async (action, options) => {
856
- const { acpCommand } = await import("../acpCommand-7EY3NHPG.js");
889
+ const { acpCommand } = await import("../acpCommand-IUZPLPLI.js");
857
890
  process.exitCode = await acpCommand({
858
891
  ...options,
859
892
  ...action === void 0 ? {} : { action }
@@ -876,7 +909,7 @@ async function start(options, program) {
876
909
  let job;
877
910
  let jobGuard;
878
911
  if (options.job !== void 0) {
879
- const { prepareJob } = await import("../jobCommand-FE6XN3YD.js");
912
+ const { prepareJob } = await import("../jobCommand-2ODQLHB3.js");
880
913
  const prepared = await prepareJob(
881
914
  mainRoot,
882
915
  options.job,
@@ -1115,7 +1148,7 @@ async function start(options, program) {
1115
1148
  if (resolved2.kind === "prompt") prompt = resolved2.prompt;
1116
1149
  }
1117
1150
  if (job !== void 0) {
1118
- const { testsBefore } = await import("../jobCommand-FE6XN3YD.js");
1151
+ const { testsBefore } = await import("../jobCommand-2ODQLHB3.js");
1119
1152
  await testsBefore(job, runtime, renderer);
1120
1153
  }
1121
1154
  const outcome = await runTurnInTerminal(
@@ -1128,7 +1161,7 @@ async function start(options, program) {
1128
1161
  await runtime.close();
1129
1162
  finish(outcome);
1130
1163
  if (job !== void 0) {
1131
- const { finishJob } = await import("../jobCommand-FE6XN3YD.js");
1164
+ const { finishJob } = await import("../jobCommand-2ODQLHB3.js");
1132
1165
  await finishJob(job, outcome, runtime, renderer, void 0, {
1133
1166
  fromLaunchd: options.fromLaunchd === true
1134
1167
  });
@@ -1214,7 +1247,7 @@ function wantsInk() {
1214
1247
  }
1215
1248
  async function loadInk(renderer) {
1216
1249
  try {
1217
- return await import("../inkChat-FNUBK43U.js");
1250
+ return await import("../inkChat-WYYAFZXD.js");
1218
1251
  } catch (error) {
1219
1252
  renderer.info(`Plain chat (Ink is not available: ${error.message.split("\n")[0]}).`);
1220
1253
  return void 0;
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ MCP_FILE,
4
+ SERVER_NAME,
5
+ checkServerUrl,
6
+ commandLine,
7
+ defHash,
8
+ expandEnv,
9
+ isHttp,
10
+ loadMcpConfig
11
+ } from "./chunk-QANRZW7W.js";
12
+ import "./chunk-ATW7BNIG.js";
13
+ export {
14
+ MCP_FILE,
15
+ SERVER_NAME,
16
+ checkServerUrl,
17
+ commandLine,
18
+ defHash,
19
+ expandEnv,
20
+ isHttp,
21
+ loadMcpConfig
22
+ };
23
+ //# sourceMappingURL=config-WV2H64TF.js.map