@garuda-agent/garuda 0.16.1 → 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 (63) hide show
  1. package/CHANGELOG.md +319 -0
  2. package/README.md +56 -1074
  3. package/SECURITY.md +9 -2
  4. package/dist/{acpCommand-OTAYW7BS.js → acpCommand-IUZPLPLI.js} +25 -23
  5. package/dist/{anthropic-NQDBCHJU.js → anthropic-NQIZLD64.js} +12 -6
  6. package/dist/{chunk-NP6RIC25.js → chunk-2FIV2VZP.js} +11 -7
  7. package/dist/{chunk-YQTGMCU6.js → chunk-3MRQJKUO.js} +29 -5
  8. package/dist/{chunk-HE2K657U.js → chunk-4BVCYCQT.js} +47 -16
  9. package/dist/{chunk-WMOLXTBU.js → chunk-4LFJFDCF.js} +2 -1
  10. package/dist/{chunk-44QN5SWZ.js → chunk-55CFEEIN.js} +22 -2
  11. package/dist/{chunk-USCUXCAU.js → chunk-5B5HDTUR.js} +3 -3
  12. package/dist/chunk-65NUEOI7.js +143 -0
  13. package/dist/{chunk-TUUEBHG2.js → chunk-6XHON3Q6.js} +2 -2
  14. package/dist/chunk-7KBOIPUT.js +157 -0
  15. package/dist/{chunk-B6FA4I7Q.js → chunk-7TH3NHCQ.js} +2 -2
  16. package/dist/{chunk-OUCV3FCT.js → chunk-AOGFYUKG.js} +3 -3
  17. package/dist/{chunk-GXZACJUI.js → chunk-B4SJY7KT.js} +322 -39
  18. package/dist/{chunk-3EQU2GUX.js → chunk-BHZ6G65V.js} +5 -1
  19. package/dist/chunk-C57GHLKP.js +9 -0
  20. package/dist/chunk-DOCDCQVM.js +484 -0
  21. package/dist/chunk-FOPBOB7W.js +332 -0
  22. package/dist/{chunk-TILFPYWO.js → chunk-NHWHG3SW.js} +1930 -992
  23. package/dist/{chunk-BQTUOO4G.js → chunk-OQ26W5L4.js} +81 -32
  24. package/dist/{chunk-HUIK3WXO.js → chunk-P6XWWIEK.js} +20 -3
  25. package/dist/chunk-Q4P3W657.js +6372 -0
  26. package/dist/{chunk-ZAE25JM2.js → chunk-QANRZW7W.js} +8 -1
  27. package/dist/chunk-UIRJOQQS.js +118 -0
  28. package/dist/chunk-UKIE4AAM.js +472 -0
  29. package/dist/{chunk-KKB5W47S.js → chunk-VTMD5IHD.js} +26 -2
  30. package/dist/cli/index.js +148 -57
  31. package/dist/config-WV2H64TF.js +23 -0
  32. package/dist/{create-VXIH2GUZ.js → create-W6BV75QX.js} +18 -12
  33. package/dist/{deadline-F5RJJ2QW.js → deadline-TP7ZGLT2.js} +4 -2
  34. package/dist/evalCommand-SKJQ6CW2.js +686 -0
  35. package/dist/evalTune-CZRCPSZ3.js +295 -0
  36. package/dist/{export-HN3CT7AV.js → export-SJ3DUP6W.js} +2 -2
  37. package/dist/{inkChat-WEDGQMCY.js → inkChat-WYYAFZXD.js} +20 -19
  38. package/dist/install-TKWN5AYH.js +19 -0
  39. package/dist/{job-3NYDMP2M.js → job-7JOI4YIQ.js} +6 -2
  40. package/dist/jobCommand-2ODQLHB3.js +33 -0
  41. package/dist/{launchd-SSX362VG.js → launchd-3A3ONEW5.js} +9 -8
  42. package/dist/{lspCommand-JRXKRSL7.js → lspCommand-ZZ6R4PA2.js} +7 -6
  43. package/dist/{manager-773PUDFE.js → manager-TCYTA5XU.js} +15 -14
  44. package/dist/{nightCommand-65MUEV32.js → nightCommand-WJU6VZA6.js} +26 -20
  45. package/dist/{openaiCompatible-CJWVJP5M.js → openaiCompatible-6TLDDW5U.js} +29 -15
  46. package/dist/{policy-EJPLEEXP.js → policy-ZJ7RMOFN.js} +10 -4
  47. package/dist/{remove-6GDSTAIO.js → remove-42WQNVPX.js} +8 -7
  48. package/dist/{run-ML6GSPN4.js → run-PTMRQCIU.js} +5 -5
  49. package/dist/{server-NGKVIQEV.js → server-VEYIJHEU.js} +2 -2
  50. package/dist/{setupCommand-VA7D5MZK.js → setupCommand-YMF6I3MD.js} +45 -13
  51. package/dist/text-LS35WSRL.js +17 -0
  52. package/dist/tune-YVI2KWQF.js +31 -0
  53. package/native/bin/garuda-reap +0 -0
  54. package/native/garuda-reap.c +113 -0
  55. package/package.json +39 -13
  56. package/dist/chunk-EIXUSVFX.js +0 -116
  57. package/dist/chunk-R7I2NBPX.js +0 -71
  58. package/dist/chunk-ULAJPMY7.js +0 -107
  59. package/dist/chunk-VBZCNMUD.js +0 -9
  60. package/dist/evalCommand-RGMZRYDR.js +0 -2812
  61. package/dist/install-EWDSPFFZ.js +0 -18
  62. package/dist/jobCommand-ACSGSBQ4.js +0 -32
  63. package/dist/text-J2GD647J.js +0 -11
@@ -0,0 +1,157 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ EFFORTS
4
+ } from "./chunk-BHZ6G65V.js";
5
+
6
+ // src/model/pricing.ts
7
+ var DEFAULT_CONTEXT_WINDOW = 2e5;
8
+ var M = 1e6;
9
+ var ALWAYS = { mode: "always", efforts: EFFORTS };
10
+ var OPTIONAL = { mode: "optional", efforts: EFFORTS };
11
+ var OPTIONAL_46 = {
12
+ mode: "optional",
13
+ efforts: EFFORTS.filter((e) => e !== "xhigh")
14
+ };
15
+ var KNOWN = [
16
+ // October 2026. Sonnet 5.5 turns thinking "off" with `between_tools`, Haiku 5.5 only at high
17
+ // effort or below: Garuda does not offer off for them yet, so they are "always" here.
18
+ ["claude-sonnet-5-5", { price: p(2, 10, 0.1, 2.5), contextWindow: M, thinking: ALWAYS }],
19
+ [
20
+ "claude-haiku-5-5",
21
+ {
22
+ price: {
23
+ ...p(0.1, 0.5, 0.01, 0.125),
24
+ over: { tokens: 1e5, price: p(0.5, 2.5, 0.05, 0.625) }
25
+ },
26
+ contextWindow: M,
27
+ thinking: ALWAYS
28
+ }
29
+ ],
30
+ ["claude-fable-5-1", { price: p(10, 50, 0.25, 12.5), contextWindow: M, thinking: ALWAYS }],
31
+ ["claude-fable-5", { price: p(10, 50, 1, 12.5), contextWindow: M, thinking: ALWAYS }],
32
+ ["claude-opus-5-5", { price: p(4, 20, 0.2, 5), contextWindow: M, thinking: ALWAYS }],
33
+ ["claude-opus-5", { price: p(5, 25, 0.5, 6.25), contextWindow: M, thinking: ALWAYS }],
34
+ ["claude-opus-4-8", { price: p(5, 25, 0.5, 6.25), contextWindow: M, thinking: OPTIONAL }],
35
+ ["claude-opus-4-7", { price: p(5, 25, 0.5, 6.25), contextWindow: M, thinking: OPTIONAL }],
36
+ ["claude-opus-4-6", { price: p(5, 25, 0.5, 6.25), contextWindow: M, thinking: OPTIONAL_46 }],
37
+ ["claude-opus-4-5", { price: p(5, 25, 0.5, 6.25), contextWindow: 2e5 }],
38
+ ["claude-sonnet-5", { price: p(2, 10, 0.2, 2.5), contextWindow: M, thinking: ALWAYS }],
39
+ ["claude-sonnet-4-6", { price: p(3, 15, 0.3, 3.75), contextWindow: M, thinking: OPTIONAL_46 }],
40
+ ["claude-sonnet-4-5", { price: p(3, 15, 0.3, 3.75), contextWindow: 2e5 }],
41
+ ["claude-haiku-4-5", { price: p(1, 5, 0.1, 1.25), contextWindow: 2e5 }]
42
+ ];
43
+ function p(input, output, cacheRead, cacheWrite) {
44
+ return { input, output, cacheRead, cacheWrite };
45
+ }
46
+ function aliasModel(alias) {
47
+ if (!/^(haiku|sonnet|opus|fable)$/.test(alias)) return void 0;
48
+ return KNOWN.find(([prefix]) => prefix.startsWith(`claude-${alias}-`))?.[0];
49
+ }
50
+ function knownModels() {
51
+ return KNOWN.map(([id, info]) => ({ id, info }));
52
+ }
53
+ function lookupModel(modelId) {
54
+ let best;
55
+ for (const [prefix, info] of KNOWN) {
56
+ if (modelId.startsWith(prefix) && prefix.length > (best?.prefix.length ?? 0)) {
57
+ best = { prefix, info };
58
+ }
59
+ }
60
+ return best?.info ?? { contextWindow: DEFAULT_CONTEXT_WINDOW };
61
+ }
62
+ var WEB_SEARCH_USD = 0.01;
63
+ function costOf(usage, price, factor = 1) {
64
+ const prompt = usage.inputTokens + usage.cacheReadTokens + usage.cacheWriteTokens;
65
+ const at = price.over !== void 0 && prompt > price.over.tokens ? price.over.price : price;
66
+ return (usage.inputTokens * at.input + usage.outputTokens * at.output + usage.cacheReadTokens * at.cacheRead + usage.cacheWriteTokens * at.cacheWrite) / M * factor + (usage.webSearches ?? 0) * WEB_SEARCH_USD;
67
+ }
68
+ function responseCost(response, price) {
69
+ if (response.usageReported === false) return void 0;
70
+ return costOf(response.usage, price, response.priceFactor ?? 1);
71
+ }
72
+ function totalTokens(usage) {
73
+ return usage.inputTokens + usage.outputTokens + usage.cacheReadTokens + usage.cacheWriteTokens;
74
+ }
75
+ function contextSize(usage) {
76
+ return totalTokens(usage);
77
+ }
78
+
79
+ // src/session/redact.ts
80
+ var REDACTED = "[REDACTED]";
81
+ var PATTERNS = [
82
+ /-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z0-9 ]*PRIVATE KEY-----/g,
83
+ /sk-ant-[A-Za-z0-9_-]{16,}/g,
84
+ /\bsk-(?:proj-)?[A-Za-z0-9_-]{20,}/g,
85
+ /\bAKIA[0-9A-Z]{16}\b/g,
86
+ /\bgh[pousr]_[A-Za-z0-9]{30,}\b/g,
87
+ /\bgithub_pat_[A-Za-z0-9_]{30,}\b/g,
88
+ /\bxox[abprs]-[A-Za-z0-9-]{10,}/g,
89
+ /\bAIza[0-9A-Za-z_-]{35}\b/g,
90
+ /\beyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/g
91
+ ];
92
+ var ASSIGNMENT = /\b([A-Za-z0-9_]*(?:api[_-]?key|secret|token|password|passwd)[A-Za-z0-9_]*)(["']?\s*[:=]\s*["']?)([^\s"'`,;]{8,})/gi;
93
+ var OPAQUE_KEYS = /* @__PURE__ */ new Set(["encrypted_content", "encrypted_index", "signature"]);
94
+ function looksLikeCode(name, value, next) {
95
+ if (/^[\d_.]+$/.test(value)) return !/pass|secret/i.test(name);
96
+ if (value.includes("(") || next === "(") return true;
97
+ return /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/.test(value) && !/\d{4,}/.test(value);
98
+ }
99
+ var SECRET_ENV_NAME = /(KEY|TOKEN|SECRET|PASSWORD|PASSWD|CREDENTIAL)/i;
100
+ var movedSecrets = /* @__PURE__ */ new Map();
101
+ function keepSecretForRedaction(name, value) {
102
+ movedSecrets.set(name, value);
103
+ }
104
+ var Redactor = class {
105
+ literals;
106
+ /**
107
+ * `env`: variables whose names look secret have their values removed wherever they appear.
108
+ * Default: this process's environment and the secrets moved out of it.
109
+ */
110
+ constructor(env = { ...process.env, ...Object.fromEntries(movedSecrets) }) {
111
+ this.literals = Object.entries(env).filter(
112
+ ([name, value]) => (SECRET_ENV_NAME.test(name) || value !== void 0 && movedSecrets.get(name) === value) && (value?.length ?? 0) >= 8
113
+ ).map(([, value]) => value).sort((a, b) => b.length - a.length);
114
+ }
115
+ text(input) {
116
+ let out = input;
117
+ for (const literal of this.literals) out = out.split(literal).join(REDACTED);
118
+ for (const pattern of PATTERNS) out = out.replace(pattern, REDACTED);
119
+ return out.replace(
120
+ ASSIGNMENT,
121
+ (all, name, sep, value, at) => looksLikeCode(name, value, out[at + all.length]) ? all : `${name}${sep}${REDACTED}`
122
+ );
123
+ }
124
+ /** A copy of `value` with every string redacted. */
125
+ value(value) {
126
+ return this.walk(value);
127
+ }
128
+ walk(value) {
129
+ if (typeof value === "string") return this.text(value);
130
+ if (Array.isArray(value)) return value.map((item) => this.walk(item));
131
+ if (value !== null && typeof value === "object") {
132
+ const redactedThinking = value.type === "redacted_thinking";
133
+ return Object.fromEntries(
134
+ Object.entries(value).map(([k, v]) => [
135
+ k,
136
+ (OPAQUE_KEYS.has(k) || redactedThinking && k === "data") && typeof v === "string" ? v : this.walk(v)
137
+ ])
138
+ );
139
+ }
140
+ return value;
141
+ }
142
+ };
143
+
144
+ export {
145
+ aliasModel,
146
+ knownModels,
147
+ lookupModel,
148
+ WEB_SEARCH_USD,
149
+ costOf,
150
+ responseCost,
151
+ totalTokens,
152
+ contextSize,
153
+ REDACTED,
154
+ keepSecretForRedaction,
155
+ Redactor
156
+ };
157
+ //# sourceMappingURL=chunk-7KBOIPUT.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-EU7PA45O.js";
7
7
  import {
8
8
  DEFAULT_ENV_ALLOWLIST
9
- } from "./chunk-GXZACJUI.js";
9
+ } from "./chunk-B4SJY7KT.js";
10
10
 
11
11
  // src/lsp/install.ts
12
12
  import { mkdir } from "fs/promises";
@@ -70,4 +70,4 @@ export {
70
70
  installCommand,
71
71
  installServer
72
72
  };
73
- //# sourceMappingURL=chunk-B6FA4I7Q.js.map
73
+ //# sourceMappingURL=chunk-7TH3NHCQ.js.map
@@ -178,8 +178,8 @@ function parseReview(text) {
178
178
  const m = /^\s*VERDICT:\s*(ready|needs a look)\b/im.exec(text);
179
179
  return { verdict: m?.[1]?.toLowerCase() === "ready" ? "ready" : "needs-look", text: text.trim() };
180
180
  }
181
- function jobVerdict(flags, review) {
182
- if (flags.some((f) => f.level === "stop")) return "needs-look";
181
+ function jobVerdict(flags, review, reviewFailed = false) {
182
+ if (reviewFailed || flags.some((f) => f.level === "stop")) return "needs-look";
183
183
  return review ?? (flags.length === 0 ? "ready" : "needs-look");
184
184
  }
185
185
  function tail(text, lines = TEST_TAIL_LINES) {
@@ -202,4 +202,4 @@ export {
202
202
  jobVerdict,
203
203
  tail
204
204
  };
205
- //# sourceMappingURL=chunk-OUCV3FCT.js.map
205
+ //# sourceMappingURL=chunk-AOGFYUKG.js.map