@garuda-agent/garuda 0.18.1 → 0.19.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 (51) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/README.md +1 -1
  3. package/dist/{acpCommand-JAYNMIMP.js → acpCommand-SIFV5XBS.js} +12 -13
  4. package/dist/advise-EA7OIYSV.js +433 -0
  5. package/dist/{anthropic-NQIZLD64.js → anthropic-6DKONNQG.js} +4 -2
  6. package/dist/{buildCheck-HB46NWLX.js → buildCheck-JNWGER5R.js} +4 -4
  7. package/dist/buildInfo-APQVLWI7.js +8 -0
  8. package/dist/{chunk-TWQ7V2L6.js → chunk-2THG7PEC.js} +2 -2
  9. package/dist/chunk-2TX3KY4M.js +88 -0
  10. package/dist/{chunk-TLA2PDGM.js → chunk-4BELTWP4.js} +5 -5
  11. package/dist/{chunk-QXTHEFKP.js → chunk-5GF2VINR.js} +2 -2
  12. package/dist/{chunk-JMH5W5DG.js → chunk-65NUEOI7.js} +44 -1
  13. package/dist/{chunk-WK5NE6RY.js → chunk-A4SSBJ2P.js} +2 -2
  14. package/dist/{chunk-DQSCCE77.js → chunk-AX3A5KPH.js} +5 -5
  15. package/dist/{chunk-5UDYQ5MK.js → chunk-BFK432BK.js} +12 -14
  16. package/dist/{chunk-GKU62MHQ.js → chunk-CHAWBYB4.js} +2 -2
  17. package/dist/chunk-CKVF67VJ.js +1780 -0
  18. package/dist/{chunk-IKPGHM54.js → chunk-DRAZNXNP.js} +3 -3
  19. package/dist/{chunk-ZKT4P2PC.js → chunk-FALYVAFB.js} +2 -2
  20. package/dist/chunk-FBCVU2P2.js +9 -0
  21. package/dist/{chunk-LMKGSYJC.js → chunk-L5TZTKUV.js} +3 -1
  22. package/dist/{chunk-34WBDQBL.js → chunk-MTJT3D3X.js} +19 -19
  23. package/dist/{chunk-QLBCM2YQ.js → chunk-QE7E77IR.js} +4 -4
  24. package/dist/chunk-U6Z4WH3B.js +9 -0
  25. package/dist/{chunk-R7RCW4BQ.js → chunk-WXNIMQOA.js} +5 -5
  26. package/dist/{chunk-YAQ6QLKB.js → chunk-YIU5QGMV.js} +3 -3
  27. package/dist/cli/index.js +50 -51
  28. package/dist/{create-OACSGJ37.js → create-GHGJR3AY.js} +5 -5
  29. package/dist/{evalCommand-BLJJ4G76.js → evalCommand-GQWNI2YJ.js} +73 -45
  30. package/dist/{evalTune-W53KAD4V.js → evalTune-LKEIFX7F.js} +20 -21
  31. package/dist/{export-E677HIQS.js → export-ZPF3AMO6.js} +5 -5
  32. package/dist/{exportHtml-BMV73YRO.js → exportHtml-ISISG5HG.js} +4 -4
  33. package/dist/{inkChat-EVLYDC3K.js → inkChat-3YNJC7KE.js} +12 -13
  34. package/dist/{install-4ST5BNRG.js → install-BQVAOQHD.js} +3 -3
  35. package/dist/{jobCommand-ILOTYOX3.js → jobCommand-WPHZYBXM.js} +6 -6
  36. package/dist/{launchd-QG6R5RAK.js → launchd-JZ6Y6JIH.js} +4 -4
  37. package/dist/{lspCommand-X4FTTONR.js → lspCommand-4LYQRYXL.js} +3 -3
  38. package/dist/{manager-L25IUXHW.js → manager-7MA6APCK.js} +3 -3
  39. package/dist/{nightCommand-XPWT6CQZ.js → nightCommand-RQKQGDTB.js} +6 -6
  40. package/dist/{remove-STX5UO7X.js → remove-S45S7ICN.js} +3 -3
  41. package/dist/runner-EUXA5UCH.js +97 -0
  42. package/dist/{setupCommand-OSOMFHDQ.js → setupCommand-YHDRJTPZ.js} +8 -9
  43. package/dist/{tune-VX2WQTHS.js → tune-XPBOEWU6.js} +12 -13
  44. package/package.json +5 -5
  45. package/dist/advise-HDKJGNBL.js +0 -195
  46. package/dist/buildInfo-K73FFI5S.js +0 -8
  47. package/dist/chunk-CWVXOSAA.js +0 -894
  48. package/dist/chunk-DUYLVGPY.js +0 -821
  49. package/dist/chunk-H7LIBGZT.js +0 -9
  50. package/dist/chunk-IYGJWX65.js +0 -9
  51. package/dist/chunk-NH72AELP.js +0 -48
@@ -0,0 +1,88 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ garudaCommit
4
+ } from "./chunk-YIU5QGMV.js";
5
+ import {
6
+ BUILD_COMMIT
7
+ } from "./chunk-FBCVU2P2.js";
8
+ import {
9
+ byTask,
10
+ consistency,
11
+ costPerPass,
12
+ failureSummary,
13
+ passInterval,
14
+ spread,
15
+ stepsSd,
16
+ unexpectedChanges
17
+ } from "./chunk-CKVF67VJ.js";
18
+ import {
19
+ VERSION
20
+ } from "./chunk-U6Z4WH3B.js";
21
+
22
+ // src/evals/report.ts
23
+ import { createHash } from "crypto";
24
+ import { arch, platform, release } from "os";
25
+ var REPORT_SCHEMA = 2;
26
+ function taskHash(task) {
27
+ const sorted = (record) => Object.fromEntries(Object.entries(record).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0));
28
+ const data = {
29
+ prompt: task.prompt,
30
+ files: sorted(task.files),
31
+ check: task.check,
32
+ protect: task.protect ?? null,
33
+ solution: sorted(task.solution),
34
+ allowChanges: task.allowChanges ?? null,
35
+ repo: task.repo === void 0 ? null : { base: task.repo.base, sha: task.repo.sha ?? null, tests: task.repo.tests }
36
+ };
37
+ return createHash("sha256").update(JSON.stringify(data)).digest("hex");
38
+ }
39
+ function buildFields(build, checkout) {
40
+ const commit = build ?? checkout;
41
+ return {
42
+ version: VERSION,
43
+ ...commit === void 0 ? {} : { commit },
44
+ ...build !== void 0 && checkout !== void 0 && checkout !== build ? { checkout } : {}
45
+ };
46
+ }
47
+ async function reportV2(meta, tasks, results) {
48
+ return {
49
+ schema: REPORT_SCHEMA,
50
+ garuda: buildFields(BUILD_COMMIT, await garudaCommit()),
51
+ spec: meta.model,
52
+ agent: meta.agent ?? { name: "garuda" },
53
+ provider: meta.provider,
54
+ // Evals set no effort: each model's default applies.
55
+ effort: "model default",
56
+ isolation: meta.isolation,
57
+ os: { platform: platform(), release: release(), arch: arch(), node: process.versions.node },
58
+ seed: meta.seed,
59
+ shuffle: meta.shuffle,
60
+ split: meta.split ?? "dev",
61
+ addendum: meta.addendum === void 0 ? null : {
62
+ file: meta.addendum.file,
63
+ chars: meta.addendum.text.length,
64
+ sha256: createHash("sha256").update(meta.addendum.text).digest("hex")
65
+ },
66
+ mcp: meta.mcp === void 0 ? null : {
67
+ server: meta.mcp.server,
68
+ ...meta.mcp.prepare === void 0 ? {} : { prepare: meta.mcp.prepare }
69
+ },
70
+ order: results.map((r) => ({ id: r.id, attempt: r.attempt ?? 1 })),
71
+ tasks: Object.fromEntries(tasks.map((t) => [t.id, taskHash(t)])),
72
+ evidence: {
73
+ interval: passInterval(results, { seed: meta.seed }) ?? null,
74
+ consistency: consistency(results),
75
+ spread: spread(results) ?? null,
76
+ stepsSd: Object.fromEntries(byTask(results).map((t) => [t.id, stepsSd(t.results) ?? null])),
77
+ costPerAcceptedChange: costPerPass(results),
78
+ unexpected: unexpectedChanges(results),
79
+ failures: failureSummary(results)
80
+ }
81
+ };
82
+ }
83
+
84
+ export {
85
+ taskHash,
86
+ reportV2
87
+ };
88
+ //# sourceMappingURL=chunk-2TX3KY4M.js.map
@@ -2,7 +2,10 @@
2
2
  import {
3
3
  summariseCall,
4
4
  summariseResult
5
- } from "./chunk-DQSCCE77.js";
5
+ } from "./chunk-AX3A5KPH.js";
6
+ import {
7
+ receiptText
8
+ } from "./chunk-2OYTNNUJ.js";
6
9
  import {
7
10
  hasReceipt
8
11
  } from "./chunk-4QRTTRVK.js";
@@ -10,9 +13,6 @@ import {
10
13
  serverCallText,
11
14
  serverResultSummary
12
15
  } from "./chunk-A2QAIRQL.js";
13
- import {
14
- receiptText
15
- } from "./chunk-2OYTNNUJ.js";
16
16
 
17
17
  // src/cli/exportHtml.ts
18
18
  function escapeHtml(text) {
@@ -153,4 +153,4 @@ export {
153
153
  callChange,
154
154
  sessionHtml
155
155
  };
156
- //# sourceMappingURL=chunk-TLA2PDGM.js.map
156
+ //# sourceMappingURL=chunk-4BELTWP4.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  DEFAULT_ENV_ALLOWLIST
4
- } from "./chunk-LMKGSYJC.js";
4
+ } from "./chunk-L5TZTKUV.js";
5
5
 
6
6
  // src/jobs/git.ts
7
7
  var GIT_TIMEOUT_MS = 12e4;
@@ -46,4 +46,4 @@ export {
46
46
  git,
47
47
  hostCommand
48
48
  };
49
- //# sourceMappingURL=chunk-QXTHEFKP.js.map
49
+ //# sourceMappingURL=chunk-5GF2VINR.js.map
@@ -91,10 +91,53 @@ function prefixInfo(id) {
91
91
  return best?.info;
92
92
  }
93
93
 
94
+ // src/tools/atomicWrite.ts
95
+ import { randomBytes } from "crypto";
96
+ import { chmod, link, realpath, rename, stat, unlink, writeFile as writeFile2 } from "fs/promises";
97
+ import { basename, dirname as dirname2, join as join2 } from "path";
98
+ async function writeFileAtomic(path, content, { createOnly }) {
99
+ const target = createOnly ? path : await realpath(path);
100
+ const temp = join2(
101
+ dirname2(target),
102
+ `.${basename(target)}.garuda-${randomBytes(4).toString("hex")}.tmp`
103
+ );
104
+ const mode = createOnly ? void 0 : (await stat(target)).mode & 4095;
105
+ await writeFile2(temp, content, { flag: "wx", ...mode === void 0 ? {} : { mode } });
106
+ try {
107
+ if (createOnly) {
108
+ try {
109
+ await link(temp, target);
110
+ } catch (error) {
111
+ const code = error.code;
112
+ if (code !== "EPERM" && code !== "ENOTSUP" && code !== "EXDEV") throw error;
113
+ if (await exists(target)) throw Object.assign(new Error("EEXIST"), { code: "EEXIST" });
114
+ await rename(temp, target);
115
+ return;
116
+ }
117
+ } else {
118
+ await chmod(temp, mode ?? 420);
119
+ await rename(temp, target);
120
+ return;
121
+ }
122
+ } finally {
123
+ await unlink(temp).catch(() => {
124
+ });
125
+ }
126
+ }
127
+ async function exists(path) {
128
+ try {
129
+ await stat(path);
130
+ return true;
131
+ } catch {
132
+ return false;
133
+ }
134
+ }
135
+
94
136
  export {
137
+ writeFileAtomic,
95
138
  fetchCatalog,
96
139
  saveCatalog,
97
140
  loadCatalog,
98
141
  mergedModels
99
142
  };
100
- //# sourceMappingURL=chunk-JMH5W5DG.js.map
143
+ //# sourceMappingURL=chunk-65NUEOI7.js.map
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  JobGitError,
4
4
  git
5
- } from "./chunk-QXTHEFKP.js";
5
+ } from "./chunk-5GF2VINR.js";
6
6
  import {
7
7
  inWriteScope
8
8
  } from "./chunk-UIRJOQQS.js";
@@ -155,4 +155,4 @@ export {
155
155
  outsideScope,
156
156
  jobChanges
157
157
  };
158
- //# sourceMappingURL=chunk-WK5NE6RY.js.map
158
+ //# sourceMappingURL=chunk-A4SSBJ2P.js.map
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- serverCallText,
4
- serverResultSummary
5
- } from "./chunk-A2QAIRQL.js";
6
2
  import {
7
3
  receiptText,
8
4
  screenReaderMode
9
5
  } from "./chunk-2OYTNNUJ.js";
6
+ import {
7
+ serverCallText,
8
+ serverResultSummary
9
+ } from "./chunk-A2QAIRQL.js";
10
10
 
11
11
  // src/cli/renderer.ts
12
12
  import { styleText } from "util";
@@ -220,4 +220,4 @@ export {
220
220
  summariseCall,
221
221
  summariseResult
222
222
  };
223
- //# sourceMappingURL=chunk-DQSCCE77.js.map
223
+ //# sourceMappingURL=chunk-AX3A5KPH.js.map
@@ -6,11 +6,9 @@ import {
6
6
  gateProjectSettings
7
7
  } from "./chunk-ULAJPMY7.js";
8
8
  import {
9
- mergedModels
10
- } from "./chunk-JMH5W5DG.js";
11
- import {
9
+ mergedModels,
12
10
  writeFileAtomic
13
- } from "./chunk-NH72AELP.js";
11
+ } from "./chunk-65NUEOI7.js";
14
12
  import {
15
13
  ReceiptCollector
16
14
  } from "./chunk-4QRTTRVK.js";
@@ -68,7 +66,7 @@ import {
68
66
  } from "./chunk-MNE7HHX2.js";
69
67
  import {
70
68
  VERSION
71
- } from "./chunk-IYGJWX65.js";
69
+ } from "./chunk-U6Z4WH3B.js";
72
70
  import {
73
71
  TrustStore
74
72
  } from "./chunk-5DEWP3YX.js";
@@ -101,7 +99,7 @@ import {
101
99
  isSensitive,
102
100
  loadSettings,
103
101
  presetFor
104
- } from "./chunk-LMKGSYJC.js";
102
+ } from "./chunk-L5TZTKUV.js";
105
103
  import {
106
104
  EFFORTS,
107
105
  ZERO_USAGE,
@@ -9686,7 +9684,7 @@ ${neutralizeTags(output)}`
9686
9684
  text: "There is no finished plan in this chat. Make one in plan mode (/plan), then type /schedule."
9687
9685
  };
9688
9686
  }
9689
- const { createJob } = await import("./create-OACSGJ37.js");
9687
+ const { createJob } = await import("./create-GHGJR3AY.js");
9690
9688
  const created = await createJob({
9691
9689
  root: this.root,
9692
9690
  executor: this.executor,
@@ -9769,7 +9767,7 @@ ${result.stderr.text}`)
9769
9767
  */
9770
9768
  async cancelJob(id2, agent = {}) {
9771
9769
  const { loadJob, saveJob } = await import("./job-7JOI4YIQ.js");
9772
- const { defaultAgentEnv, nightSpec, removeAgent, removeSpec } = await import("./launchd-QG6R5RAK.js");
9770
+ const { defaultAgentEnv, nightSpec, removeAgent, removeSpec } = await import("./launchd-JZ6Y6JIH.js");
9773
9771
  if (id2 === "night") {
9774
9772
  const removed = await removeSpec(
9775
9773
  agent.executor ?? this.executor,
@@ -9801,8 +9799,8 @@ ${result.stderr.text}`)
9801
9799
  */
9802
9800
  async deleteJob(id2, signal, agent = {}) {
9803
9801
  const { loadJob } = await import("./job-7JOI4YIQ.js");
9804
- const { defaultAgentEnv, removeAgent } = await import("./launchd-QG6R5RAK.js");
9805
- const { jobLeftovers, removeJob } = await import("./remove-STX5UO7X.js");
9802
+ const { defaultAgentEnv, removeAgent } = await import("./launchd-JZ6Y6JIH.js");
9803
+ const { jobLeftovers, removeJob } = await import("./remove-S45S7ICN.js");
9806
9804
  let job;
9807
9805
  try {
9808
9806
  job = await loadJob(this.root, id2);
@@ -10144,7 +10142,7 @@ ${result.stderr.text}`)
10144
10142
  }
10145
10143
  /** Install a language server into ~/.garuda/lsp (the user asked for it). */
10146
10144
  async installLsp(language, signal) {
10147
- const { installServer } = await import("./install-4ST5BNRG.js");
10145
+ const { installServer } = await import("./install-BQVAOQHD.js");
10148
10146
  const result = await installServer(language, {
10149
10147
  executor: this.executor,
10150
10148
  home: this.lspHome,
@@ -10155,7 +10153,7 @@ ${result.stderr.text}`)
10155
10153
  }
10156
10154
  /** autoInstall (~/.garuda/lsp.json): ask before a managed install. */
10157
10155
  async askInstall(language, signal) {
10158
- const { installCommand } = await import("./install-4ST5BNRG.js");
10156
+ const { installCommand } = await import("./install-BQVAOQHD.js");
10159
10157
  const { LANGUAGE_LABELS } = await import("./manager-4PMSXT47.js");
10160
10158
  const { managedLabel, managedDir } = await import("./servers-6YDGWOZ6.js");
10161
10159
  const dir = managedDir(language, this.lspHome);
@@ -10188,7 +10186,7 @@ ${result.stderr.text}`)
10188
10186
  async startMcp(signal) {
10189
10187
  if (this.mcpServers.length === 0) return;
10190
10188
  this.mcpStarted ??= (async () => {
10191
- const { McpManager } = await import("./manager-L25IUXHW.js");
10189
+ const { McpManager } = await import("./manager-7MA6APCK.js");
10192
10190
  const { AuthStore } = await import("./oauth-W6OK6XXO.js");
10193
10191
  const manager = new McpManager({
10194
10192
  root: this.root,
@@ -10487,4 +10485,4 @@ export {
10487
10485
  modelFacts,
10488
10486
  Runtime
10489
10487
  };
10490
- //# sourceMappingURL=chunk-5UDYQ5MK.js.map
10488
+ //# sourceMappingURL=chunk-BFK432BK.js.map
@@ -5,7 +5,7 @@ import {
5
5
  PYPROJECT,
6
6
  PYTEST_CHECK,
7
7
  lines
8
- } from "./chunk-CWVXOSAA.js";
8
+ } from "./chunk-CKVF67VJ.js";
9
9
 
10
10
  // src/evals/taskKit.ts
11
11
  var NODE_PKG = lines("{", ' "type": "module",', ' "private": true', "}");
@@ -5255,4 +5255,4 @@ export {
5255
5255
  chooseTasks,
5256
5256
  requiredToolchains
5257
5257
  };
5258
- //# sourceMappingURL=chunk-GKU62MHQ.js.map
5258
+ //# sourceMappingURL=chunk-CHAWBYB4.js.map