@afaik-lab/weigh 0.0.0 → 0.6.1

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 (349) hide show
  1. package/.env.example +49 -0
  2. package/LICENSE +373 -0
  3. package/README.md +103 -1
  4. package/dist/agent.d.ts +83 -0
  5. package/dist/agent.d.ts.map +1 -0
  6. package/dist/agent.js +204 -0
  7. package/dist/agent.js.map +1 -0
  8. package/dist/ceilings.d.ts +32 -0
  9. package/dist/ceilings.d.ts.map +1 -0
  10. package/dist/ceilings.js +61 -0
  11. package/dist/ceilings.js.map +1 -0
  12. package/dist/cli.d.ts +3 -0
  13. package/dist/cli.d.ts.map +1 -0
  14. package/dist/cli.js +530 -0
  15. package/dist/cli.js.map +1 -0
  16. package/dist/config-cli.d.ts +15 -0
  17. package/dist/config-cli.d.ts.map +1 -0
  18. package/dist/config-cli.js +141 -0
  19. package/dist/config-cli.js.map +1 -0
  20. package/dist/config.d.ts +198 -0
  21. package/dist/config.d.ts.map +1 -0
  22. package/dist/config.js +373 -0
  23. package/dist/config.js.map +1 -0
  24. package/dist/context-cli.d.ts +35 -0
  25. package/dist/context-cli.d.ts.map +1 -0
  26. package/dist/context-cli.js +251 -0
  27. package/dist/context-cli.js.map +1 -0
  28. package/dist/context.d.ts +118 -0
  29. package/dist/context.d.ts.map +1 -0
  30. package/dist/context.js +159 -0
  31. package/dist/context.js.map +1 -0
  32. package/dist/corrections/correction-set.d.ts +67 -0
  33. package/dist/corrections/correction-set.d.ts.map +1 -0
  34. package/dist/corrections/correction-set.js +104 -0
  35. package/dist/corrections/correction-set.js.map +1 -0
  36. package/dist/corrections/correction.d.ts +74 -0
  37. package/dist/corrections/correction.d.ts.map +1 -0
  38. package/dist/corrections/correction.js +154 -0
  39. package/dist/corrections/correction.js.map +1 -0
  40. package/dist/corrections/follow-up.d.ts +69 -0
  41. package/dist/corrections/follow-up.d.ts.map +1 -0
  42. package/dist/corrections/follow-up.js +217 -0
  43. package/dist/corrections/follow-up.js.map +1 -0
  44. package/dist/corrections/index.d.ts +31 -0
  45. package/dist/corrections/index.d.ts.map +1 -0
  46. package/dist/corrections/index.js +31 -0
  47. package/dist/corrections/index.js.map +1 -0
  48. package/dist/corrections/ledger.d.ts +78 -0
  49. package/dist/corrections/ledger.d.ts.map +1 -0
  50. package/dist/corrections/ledger.js +117 -0
  51. package/dist/corrections/ledger.js.map +1 -0
  52. package/dist/corrections/promotion.d.ts +119 -0
  53. package/dist/corrections/promotion.d.ts.map +1 -0
  54. package/dist/corrections/promotion.js +221 -0
  55. package/dist/corrections/promotion.js.map +1 -0
  56. package/dist/corrections/schema.d.ts +125 -0
  57. package/dist/corrections/schema.d.ts.map +1 -0
  58. package/dist/corrections/schema.js +100 -0
  59. package/dist/corrections/schema.js.map +1 -0
  60. package/dist/corrections-cli.d.ts +28 -0
  61. package/dist/corrections-cli.d.ts.map +1 -0
  62. package/dist/corrections-cli.js +157 -0
  63. package/dist/corrections-cli.js.map +1 -0
  64. package/dist/diff.d.ts +105 -0
  65. package/dist/diff.d.ts.map +1 -0
  66. package/dist/diff.js +202 -0
  67. package/dist/diff.js.map +1 -0
  68. package/dist/doctor.d.ts +38 -0
  69. package/dist/doctor.d.ts.map +1 -0
  70. package/dist/doctor.js +197 -0
  71. package/dist/doctor.js.map +1 -0
  72. package/dist/events.d.ts +21 -0
  73. package/dist/events.d.ts.map +1 -0
  74. package/dist/events.js +5 -0
  75. package/dist/events.js.map +1 -0
  76. package/dist/findings.d.ts +510 -0
  77. package/dist/findings.d.ts.map +1 -0
  78. package/dist/findings.js +645 -0
  79. package/dist/findings.js.map +1 -0
  80. package/dist/follow-up-cli.d.ts +88 -0
  81. package/dist/follow-up-cli.d.ts.map +1 -0
  82. package/dist/follow-up-cli.js +208 -0
  83. package/dist/follow-up-cli.js.map +1 -0
  84. package/dist/harness.d.ts +64 -0
  85. package/dist/harness.d.ts.map +1 -0
  86. package/dist/harness.js +71 -0
  87. package/dist/harness.js.map +1 -0
  88. package/dist/help/command-help.d.ts +9 -0
  89. package/dist/help/command-help.d.ts.map +1 -0
  90. package/dist/help/command-help.js +21 -0
  91. package/dist/help/command-help.js.map +1 -0
  92. package/dist/help/commands/answer.d.ts +3 -0
  93. package/dist/help/commands/answer.d.ts.map +1 -0
  94. package/dist/help/commands/answer.js +39 -0
  95. package/dist/help/commands/answer.js.map +1 -0
  96. package/dist/help/commands/config.d.ts +3 -0
  97. package/dist/help/commands/config.d.ts.map +1 -0
  98. package/dist/help/commands/config.js +25 -0
  99. package/dist/help/commands/config.js.map +1 -0
  100. package/dist/help/commands/context.d.ts +3 -0
  101. package/dist/help/commands/context.d.ts.map +1 -0
  102. package/dist/help/commands/context.js +44 -0
  103. package/dist/help/commands/context.js.map +1 -0
  104. package/dist/help/commands/corrections.d.ts +3 -0
  105. package/dist/help/commands/corrections.d.ts.map +1 -0
  106. package/dist/help/commands/corrections.js +30 -0
  107. package/dist/help/commands/corrections.js.map +1 -0
  108. package/dist/help/commands/doctor.d.ts +3 -0
  109. package/dist/help/commands/doctor.d.ts.map +1 -0
  110. package/dist/help/commands/doctor.js +12 -0
  111. package/dist/help/commands/doctor.js.map +1 -0
  112. package/dist/help/commands/index.d.ts +4 -0
  113. package/dist/help/commands/index.d.ts.map +1 -0
  114. package/dist/help/commands/index.js +27 -0
  115. package/dist/help/commands/index.js.map +1 -0
  116. package/dist/help/commands/memory.d.ts +3 -0
  117. package/dist/help/commands/memory.d.ts.map +1 -0
  118. package/dist/help/commands/memory.js +33 -0
  119. package/dist/help/commands/memory.js.map +1 -0
  120. package/dist/help/commands/models.d.ts +3 -0
  121. package/dist/help/commands/models.d.ts.map +1 -0
  122. package/dist/help/commands/models.js +17 -0
  123. package/dist/help/commands/models.js.map +1 -0
  124. package/dist/help/commands/options.d.ts +4 -0
  125. package/dist/help/commands/options.d.ts.map +1 -0
  126. package/dist/help/commands/options.js +13 -0
  127. package/dist/help/commands/options.js.map +1 -0
  128. package/dist/help/commands/review.d.ts +3 -0
  129. package/dist/help/commands/review.d.ts.map +1 -0
  130. package/dist/help/commands/review.js +50 -0
  131. package/dist/help/commands/review.js.map +1 -0
  132. package/dist/help/commands/sessions.d.ts +3 -0
  133. package/dist/help/commands/sessions.d.ts.map +1 -0
  134. package/dist/help/commands/sessions.js +23 -0
  135. package/dist/help/commands/sessions.js.map +1 -0
  136. package/dist/help/commands/show.d.ts +3 -0
  137. package/dist/help/commands/show.d.ts.map +1 -0
  138. package/dist/help/commands/show.js +18 -0
  139. package/dist/help/commands/show.js.map +1 -0
  140. package/dist/help/help.d.ts +16 -0
  141. package/dist/help/help.d.ts.map +1 -0
  142. package/dist/help/help.js +68 -0
  143. package/dist/help/help.js.map +1 -0
  144. package/dist/help/index.d.ts +4 -0
  145. package/dist/help/index.d.ts.map +1 -0
  146. package/dist/help/index.js +7 -0
  147. package/dist/help/index.js.map +1 -0
  148. package/dist/index.d.ts +80 -0
  149. package/dist/index.d.ts.map +1 -0
  150. package/dist/index.js +51 -0
  151. package/dist/index.js.map +1 -0
  152. package/dist/knowledge/block.d.ts +65 -0
  153. package/dist/knowledge/block.d.ts.map +1 -0
  154. package/dist/knowledge/block.js +89 -0
  155. package/dist/knowledge/block.js.map +1 -0
  156. package/dist/knowledge/claim.d.ts +143 -0
  157. package/dist/knowledge/claim.d.ts.map +1 -0
  158. package/dist/knowledge/claim.js +303 -0
  159. package/dist/knowledge/claim.js.map +1 -0
  160. package/dist/knowledge/index.d.ts +32 -0
  161. package/dist/knowledge/index.d.ts.map +1 -0
  162. package/dist/knowledge/index.js +29 -0
  163. package/dist/knowledge/index.js.map +1 -0
  164. package/dist/knowledge/novelty.d.ts +65 -0
  165. package/dist/knowledge/novelty.d.ts.map +1 -0
  166. package/dist/knowledge/novelty.js +100 -0
  167. package/dist/knowledge/novelty.js.map +1 -0
  168. package/dist/knowledge/recall.d.ts +134 -0
  169. package/dist/knowledge/recall.d.ts.map +1 -0
  170. package/dist/knowledge/recall.js +229 -0
  171. package/dist/knowledge/recall.js.map +1 -0
  172. package/dist/knowledge/recalled-claim.d.ts +35 -0
  173. package/dist/knowledge/recalled-claim.d.ts.map +1 -0
  174. package/dist/knowledge/recalled-claim.js +67 -0
  175. package/dist/knowledge/recalled-claim.js.map +1 -0
  176. package/dist/knowledge/recalled.d.ts +70 -0
  177. package/dist/knowledge/recalled.d.ts.map +1 -0
  178. package/dist/knowledge/recalled.js +149 -0
  179. package/dist/knowledge/recalled.js.map +1 -0
  180. package/dist/knowledge/schema.d.ts +83 -0
  181. package/dist/knowledge/schema.d.ts.map +1 -0
  182. package/dist/knowledge/schema.js +96 -0
  183. package/dist/knowledge/schema.js.map +1 -0
  184. package/dist/knowledge/staleness.d.ts +48 -0
  185. package/dist/knowledge/staleness.d.ts.map +1 -0
  186. package/dist/knowledge/staleness.js +85 -0
  187. package/dist/knowledge/staleness.js.map +1 -0
  188. package/dist/knowledge/store.d.ts +100 -0
  189. package/dist/knowledge/store.d.ts.map +1 -0
  190. package/dist/knowledge/store.js +184 -0
  191. package/dist/knowledge/store.js.map +1 -0
  192. package/dist/memory/compose-file.d.ts +14 -0
  193. package/dist/memory/compose-file.d.ts.map +1 -0
  194. package/dist/memory/compose-file.js +25 -0
  195. package/dist/memory/compose-file.js.map +1 -0
  196. package/dist/memory/index.d.ts +43 -0
  197. package/dist/memory/index.d.ts.map +1 -0
  198. package/dist/memory/index.js +119 -0
  199. package/dist/memory/index.js.map +1 -0
  200. package/dist/memory/oss.d.ts +62 -0
  201. package/dist/memory/oss.d.ts.map +1 -0
  202. package/dist/memory/oss.js +230 -0
  203. package/dist/memory/oss.js.map +1 -0
  204. package/dist/memory/platform.d.ts +37 -0
  205. package/dist/memory/platform.d.ts.map +1 -0
  206. package/dist/memory/platform.js +131 -0
  207. package/dist/memory/platform.js.map +1 -0
  208. package/dist/memory/scope.d.ts +49 -0
  209. package/dist/memory/scope.d.ts.map +1 -0
  210. package/dist/memory/scope.js +70 -0
  211. package/dist/memory/scope.js.map +1 -0
  212. package/dist/memory/types.d.ts +113 -0
  213. package/dist/memory/types.d.ts.map +1 -0
  214. package/dist/memory/types.js +18 -0
  215. package/dist/memory/types.js.map +1 -0
  216. package/dist/memory-cli.d.ts +17 -0
  217. package/dist/memory-cli.d.ts.map +1 -0
  218. package/dist/memory-cli.js +107 -0
  219. package/dist/memory-cli.js.map +1 -0
  220. package/dist/models-cli.d.ts +12 -0
  221. package/dist/models-cli.d.ts.map +1 -0
  222. package/dist/models-cli.js +54 -0
  223. package/dist/models-cli.js.map +1 -0
  224. package/dist/models.d.ts +111 -0
  225. package/dist/models.d.ts.map +1 -0
  226. package/dist/models.js +228 -0
  227. package/dist/models.js.map +1 -0
  228. package/dist/paths.d.ts +35 -0
  229. package/dist/paths.d.ts.map +1 -0
  230. package/dist/paths.js +65 -0
  231. package/dist/paths.js.map +1 -0
  232. package/dist/profile.d.ts +28 -0
  233. package/dist/profile.d.ts.map +1 -0
  234. package/dist/profile.js +154 -0
  235. package/dist/profile.js.map +1 -0
  236. package/dist/progress.d.ts +70 -0
  237. package/dist/progress.d.ts.map +1 -0
  238. package/dist/progress.js +132 -0
  239. package/dist/progress.js.map +1 -0
  240. package/dist/quiet.d.ts +2 -0
  241. package/dist/quiet.d.ts.map +1 -0
  242. package/dist/quiet.js +21 -0
  243. package/dist/quiet.js.map +1 -0
  244. package/dist/reconcile/continuation.d.ts +132 -0
  245. package/dist/reconcile/continuation.d.ts.map +1 -0
  246. package/dist/reconcile/continuation.js +306 -0
  247. package/dist/reconcile/continuation.js.map +1 -0
  248. package/dist/reconcile/index.d.ts +26 -0
  249. package/dist/reconcile/index.d.ts.map +1 -0
  250. package/dist/reconcile/index.js +28 -0
  251. package/dist/reconcile/index.js.map +1 -0
  252. package/dist/reconcile/outcome-set.d.ts +53 -0
  253. package/dist/reconcile/outcome-set.d.ts.map +1 -0
  254. package/dist/reconcile/outcome-set.js +124 -0
  255. package/dist/reconcile/outcome-set.js.map +1 -0
  256. package/dist/reconcile/outcome.d.ts +56 -0
  257. package/dist/reconcile/outcome.d.ts.map +1 -0
  258. package/dist/reconcile/outcome.js +60 -0
  259. package/dist/reconcile/outcome.js.map +1 -0
  260. package/dist/reconcile/reconciliation.d.ts +49 -0
  261. package/dist/reconcile/reconciliation.d.ts.map +1 -0
  262. package/dist/reconcile/reconciliation.js +88 -0
  263. package/dist/reconcile/reconciliation.js.map +1 -0
  264. package/dist/reconcile/schema.d.ts +157 -0
  265. package/dist/reconcile/schema.d.ts.map +1 -0
  266. package/dist/reconcile/schema.js +97 -0
  267. package/dist/reconcile/schema.js.map +1 -0
  268. package/dist/record/index.d.ts +23 -0
  269. package/dist/record/index.d.ts.map +1 -0
  270. package/dist/record/index.js +25 -0
  271. package/dist/record/index.js.map +1 -0
  272. package/dist/record/review-record.d.ts +28 -0
  273. package/dist/record/review-record.d.ts.map +1 -0
  274. package/dist/record/review-record.js +78 -0
  275. package/dist/record/review-record.js.map +1 -0
  276. package/dist/record/schema.d.ts +153 -0
  277. package/dist/record/schema.d.ts.map +1 -0
  278. package/dist/record/schema.js +87 -0
  279. package/dist/record/schema.js.map +1 -0
  280. package/dist/record/store.d.ts +83 -0
  281. package/dist/record/store.d.ts.map +1 -0
  282. package/dist/record/store.js +162 -0
  283. package/dist/record/store.js.map +1 -0
  284. package/dist/record/stored-review.d.ts +36 -0
  285. package/dist/record/stored-review.d.ts.map +1 -0
  286. package/dist/record/stored-review.js +90 -0
  287. package/dist/record/stored-review.js.map +1 -0
  288. package/dist/refute.d.ts +318 -0
  289. package/dist/refute.d.ts.map +1 -0
  290. package/dist/refute.js +513 -0
  291. package/dist/refute.js.map +1 -0
  292. package/dist/render.d.ts +212 -0
  293. package/dist/render.d.ts.map +1 -0
  294. package/dist/render.js +544 -0
  295. package/dist/render.js.map +1 -0
  296. package/dist/review-cli.d.ts +181 -0
  297. package/dist/review-cli.d.ts.map +1 -0
  298. package/dist/review-cli.js +598 -0
  299. package/dist/review-cli.js.map +1 -0
  300. package/dist/reviewer.d.ts +297 -0
  301. package/dist/reviewer.d.ts.map +1 -0
  302. package/dist/reviewer.js +584 -0
  303. package/dist/reviewer.js.map +1 -0
  304. package/dist/session-cli.d.ts +17 -0
  305. package/dist/session-cli.d.ts.map +1 -0
  306. package/dist/session-cli.js +62 -0
  307. package/dist/session-cli.js.map +1 -0
  308. package/dist/session.d.ts +36 -0
  309. package/dist/session.d.ts.map +1 -0
  310. package/dist/session.js +105 -0
  311. package/dist/session.js.map +1 -0
  312. package/dist/settings.d.ts +68 -0
  313. package/dist/settings.d.ts.map +1 -0
  314. package/dist/settings.js +175 -0
  315. package/dist/settings.js.map +1 -0
  316. package/dist/show-cli.d.ts +39 -0
  317. package/dist/show-cli.d.ts.map +1 -0
  318. package/dist/show-cli.js +56 -0
  319. package/dist/show-cli.js.map +1 -0
  320. package/dist/stdout.d.ts +28 -0
  321. package/dist/stdout.d.ts.map +1 -0
  322. package/dist/stdout.js +44 -0
  323. package/dist/stdout.js.map +1 -0
  324. package/dist/target.d.ts +58 -0
  325. package/dist/target.d.ts.map +1 -0
  326. package/dist/target.js +96 -0
  327. package/dist/target.js.map +1 -0
  328. package/dist/tools/index.d.ts +93 -0
  329. package/dist/tools/index.d.ts.map +1 -0
  330. package/dist/tools/index.js +146 -0
  331. package/dist/tools/index.js.map +1 -0
  332. package/dist/tools/root.d.ts +62 -0
  333. package/dist/tools/root.d.ts.map +1 -0
  334. package/dist/tools/root.js +51 -0
  335. package/dist/tools/root.js.map +1 -0
  336. package/dist/usage.d.ts +75 -0
  337. package/dist/usage.d.ts.map +1 -0
  338. package/dist/usage.js +100 -0
  339. package/dist/usage.js.map +1 -0
  340. package/dist/version.d.ts +14 -0
  341. package/dist/version.d.ts.map +1 -0
  342. package/dist/version.js +26 -0
  343. package/dist/version.js.map +1 -0
  344. package/dist/workspace.d.ts +48 -0
  345. package/dist/workspace.d.ts.map +1 -0
  346. package/dist/workspace.js +126 -0
  347. package/dist/workspace.js.map +1 -0
  348. package/docker-compose.yml +61 -0
  349. package/package.json +72 -1
package/dist/cli.js ADDED
@@ -0,0 +1,530 @@
1
+ #!/usr/bin/env node
2
+ // This Source Code Form is subject to the terms of the Mozilla Public
3
+ // License, v. 2.0. If a copy of the MPL was not distributed with this
4
+ // file, You can obtain one at https://mozilla.org/MPL/2.0/.
5
+ // Weigh runs against *other* people's repositories, so it must not take
6
+ // configuration from the directory it is pointed at. Node never auto-loads a
7
+ // `.env`, which is the main reason the published artifact targets node rather
8
+ // than bun: under bun the reviewed repo's `.env` is read before any of our code
9
+ // runs, and had to be suppressed with `--env-file=/dev/null` in this shebang.
10
+ // Credentials come from the environment, or from ~/.weigh/.env. The `dev` and
11
+ // `start` scripts keep the bun flag so running from source behaves the same.
12
+ //
13
+ // Must be first: quiet.js silences a dependency's stdout banner, and only works
14
+ // if it runs before the modules below are evaluated. See src/quiet.ts.
15
+ import './quiet.js';
16
+ import { parseArgs } from 'util';
17
+ import { loadConfig } from './config.js';
18
+ import { resolveModel } from './models.js';
19
+ import { runModelsCommand } from './models-cli.js';
20
+ import { runAgentWithRetry } from './agent.js';
21
+ import { initSessionDir, loadSession, saveMessage, newSessionPath, sessionId, pruneSessions } from './session.js';
22
+ import { isMemoryVerb, runMemoryCommand } from './memory-cli.js';
23
+ import { isSessionVerb, runSessionCommand } from './session-cli.js';
24
+ import { isContextVerb, runContextCommand } from './context-cli.js';
25
+ import { isCorrectionVerb, runCorrectionsCommand } from './corrections-cli.js';
26
+ import { FollowUp } from './corrections/index.js';
27
+ import { runFollowUpCommand } from './follow-up-cli.js';
28
+ import { isConfigVerb, runConfigCommand } from './config-cli.js';
29
+ import { runDoctor } from './doctor.js';
30
+ import { repoRootOf, resolveTarget } from './target.js';
31
+ import { runReviewCommand } from './review-cli.js';
32
+ import { runShowCommand } from './show-cli.js';
33
+ import { exitAfterFlush, exitOnClosedPipe } from './stdout.js';
34
+ import { ProgressReporter } from './progress.js';
35
+ import { Help } from './help/index.js';
36
+ import { VERSION } from './version.js';
37
+ exitOnClosedPipe();
38
+ // ── Argument parsing ────────────────────────────────────────────────
39
+ // Pre-scan argv for output mode so the catch below can format errors
40
+ // (unknown flag, bad config, etc.) according to --json / --quiet.
41
+ const argv = process.argv.slice(2);
42
+ const preMode = argv.includes('--json') || argv.includes('-j')
43
+ ? 'json'
44
+ : argv.includes('--quiet') || argv.includes('-q')
45
+ ? 'quiet'
46
+ : 'text';
47
+ function reportError(err) {
48
+ const message = err?.message ?? String(err);
49
+ if (preMode === 'json')
50
+ process.stdout.write(JSON.stringify({ type: 'error', message }) + '\n');
51
+ else if (preMode !== 'quiet')
52
+ process.stderr.write(`Error: ${message}\n`);
53
+ process.exit(1);
54
+ }
55
+ const EFFORTS = ['low', 'medium', 'high', 'xhigh', 'max'];
56
+ function parseEffort(raw) {
57
+ const level = raw.toLowerCase();
58
+ if (!EFFORTS.includes(level)) {
59
+ throw new Error(`--effort must be one of ${EFFORTS.join(' | ')}, got: ${raw}`);
60
+ }
61
+ return level;
62
+ }
63
+ function parseMemoryBackend(raw) {
64
+ const backend = raw.toLowerCase();
65
+ if (backend !== 'platform' && backend !== 'oss') {
66
+ throw new Error(`--memory-backend must be "platform" or "oss", got: ${raw}`);
67
+ }
68
+ return backend;
69
+ }
70
+ /** A share of something: zero is meaningful, so this is not parsePositive. */
71
+ function parseShare(flag, raw) {
72
+ const n = Number(raw);
73
+ if (!Number.isFinite(n) || n < 0 || n > 1) {
74
+ throw new Error(`${flag} must be between 0 and 1, got: ${raw}`);
75
+ }
76
+ return n;
77
+ }
78
+ /** Everything piped in, as text. Both callers want all of it or none. */
79
+ async function readAll(stream) {
80
+ const chunks = [];
81
+ for await (const chunk of stream)
82
+ chunks.push(chunk);
83
+ return Buffer.concat(chunks).toString('utf-8').trim();
84
+ }
85
+ function parsePositive(flag, raw) {
86
+ const n = Number(raw);
87
+ if (!Number.isFinite(n) || n <= 0)
88
+ throw new Error(`${flag} must be a positive number, got: ${raw}`);
89
+ return n;
90
+ }
91
+ let values;
92
+ let positionals;
93
+ try {
94
+ const parsed = parseArgs({
95
+ args: argv,
96
+ options: {
97
+ prompt: { type: 'string', short: 'p' },
98
+ json: { type: 'boolean', short: 'j', default: false },
99
+ quiet: { type: 'boolean', short: 'q', default: false },
100
+ 'no-session': { type: 'boolean', default: false },
101
+ 'no-promote': { type: 'boolean', default: false },
102
+ resume: { type: 'string' },
103
+ 'no-memory': { type: 'boolean', default: false },
104
+ user: { type: 'string', short: 'u' },
105
+ 'memory-backend': { type: 'string' },
106
+ session: { type: 'string' },
107
+ limit: { type: 'string' },
108
+ keep: { type: 'string' },
109
+ yes: { type: 'boolean', short: 'y', default: false },
110
+ model: { type: 'string', short: 'm' },
111
+ repo: { type: 'string' },
112
+ base: { type: 'string' },
113
+ head: { type: 'string' },
114
+ uncommitted: { type: 'boolean', default: false },
115
+ 'dry-run': { type: 'boolean', default: false },
116
+ stale: { type: 'boolean', default: false },
117
+ path: { type: 'string' },
118
+ 'if-new': { type: 'boolean', default: false },
119
+ 'no-progress': { type: 'boolean', default: false },
120
+ 'max-steps': { type: 'string' },
121
+ 'max-cost': { type: 'string' },
122
+ 'coverage-floor': { type: 'string' },
123
+ 'confidence-floor': { type: 'string' },
124
+ refute: { type: 'boolean' },
125
+ 'no-refute': { type: 'boolean', default: false },
126
+ review: { type: 'string' },
127
+ all: { type: 'boolean', default: false },
128
+ fresh: { type: 'boolean', default: false },
129
+ effort: { type: 'string' },
130
+ help: { type: 'boolean', short: 'h', default: false },
131
+ version: { type: 'boolean', short: 'v', default: false },
132
+ },
133
+ allowPositionals: true,
134
+ strict: true,
135
+ });
136
+ values = parsed.values;
137
+ positionals = parsed.positionals;
138
+ }
139
+ catch (err) {
140
+ reportError(err);
141
+ }
142
+ // ── Help and version ────────────────────────────────────────────────
143
+ // `weigh help <command>` too, because `help` would otherwise be a prompt, and
144
+ // asking for help should not call a model.
145
+ if (values.help || positionals[0] === 'help') {
146
+ const name = positionals[0] === 'help' ? positionals[1] : positionals[0];
147
+ const help = new Help();
148
+ process.stdout.write(help.for(name) ?? help.overview());
149
+ await exitAfterFlush(0);
150
+ }
151
+ if (values.version) {
152
+ process.stdout.write(values.json ? JSON.stringify({ version: VERSION }) + '\n' : `${VERSION}\n`);
153
+ await exitAfterFlush(0);
154
+ }
155
+ /**
156
+ * The configuration a command runs under, with the shared `.weigh.json` of
157
+ * the repository it is about — `--repo`, else the working directory — and the
158
+ * flags applied on top. Outside a repository there is no shared file.
159
+ */
160
+ function configFor(opts = {}) {
161
+ const repoRoot = repoRootOf(values.repo);
162
+ return applyOverrides(loadConfig({}, { ...opts, ...(repoRoot && { repoRoot }) }));
163
+ }
164
+ /** CLI flags win over config file and environment for both run and memory commands. */
165
+ function applyOverrides(config) {
166
+ // Through resolveModel, not assigned raw: this runs after loadConfig has
167
+ // already resolved its own layers, so a flag assigned straight through was
168
+ // the one place a short name or a typo reached the SDK untouched.
169
+ if (values.model)
170
+ config.model = resolveModel(values.model);
171
+ if (values.effort)
172
+ config.effort = parseEffort(values.effort);
173
+ if (values['max-steps'])
174
+ config.maxSteps = parsePositive('--max-steps', values['max-steps']);
175
+ if (values['max-cost'])
176
+ config.maxCost = parsePositive('--max-cost', values['max-cost']);
177
+ if (values.user)
178
+ config.memory.userId = values.user;
179
+ if (values['no-memory'])
180
+ config.memory.enabled = false;
181
+ if (values['memory-backend'])
182
+ config.memory.backend = parseMemoryBackend(String(values['memory-backend']));
183
+ return config;
184
+ }
185
+ // ── Memory subcommand ───────────────────────────────────────────────
186
+ // `weigh memory <verb>` only wins when a known verb follows, so an ordinary
187
+ // prompt that happens to start with the word "memory" still runs as a prompt.
188
+ const isMemoryCommand = positionals[0] === 'memory' && isMemoryVerb(positionals[1]);
189
+ const isContextCommand = positionals[0] === 'context' && isContextVerb(positionals[1]);
190
+ const isSessionCommand = positionals[0] === 'sessions' && isSessionVerb(positionals[1]);
191
+ if (isMemoryCommand) {
192
+ try {
193
+ const config = configFor();
194
+ const code = await runMemoryCommand(positionals[1], positionals.slice(2), config, {
195
+ json: Boolean(values.json),
196
+ ...(values.limit !== undefined && { limit: parsePositive('--limit', values.limit) }),
197
+ ...(values.session && { session: values.session }),
198
+ yes: Boolean(values.yes),
199
+ });
200
+ await exitAfterFlush(code);
201
+ }
202
+ catch (err) {
203
+ reportError(err);
204
+ }
205
+ }
206
+ if (isContextCommand) {
207
+ try {
208
+ const config = configFor();
209
+ const verb = positionals[1];
210
+ // `add` takes its claims on stdin, which is how the priming skill writes a
211
+ // batch of them. Read only for that verb: the others are not pipelines, and
212
+ // waiting on a TTY nobody is typing into would hang the command.
213
+ const input = verb === 'add' && !process.stdin.isTTY ? await readAll(process.stdin) : undefined;
214
+ const code = await runContextCommand(verb, positionals.slice(2), config, {
215
+ json: Boolean(values.json),
216
+ ...(values.repo && { repo: values.repo }),
217
+ ...(values.limit !== undefined && { limit: parsePositive('--limit', values.limit) }),
218
+ // `recall` runs the retrieval a review would run, so it takes the same
219
+ // two flags that decide which change that is.
220
+ ...(values.base && { base: values.base }),
221
+ ...(values.uncommitted && { uncommitted: true }),
222
+ // `list` narrowed for a refresh: claims about one part, or whose files
223
+ // changed since they last held.
224
+ ...(values.stale && { stale: true }),
225
+ ...(values.path !== undefined && { path: String(values.path) }),
226
+ // `add` writing only what the repository does not hold yet.
227
+ ...(values['if-new'] && { ifNew: true }),
228
+ yes: Boolean(values.yes),
229
+ ...(input !== undefined && { input }),
230
+ });
231
+ await exitAfterFlush(code);
232
+ }
233
+ catch (err) {
234
+ reportError(err);
235
+ }
236
+ }
237
+ // `weigh answer "#3 is intentional"` — a ruling on the last review, not a new
238
+ // one. Its own verb, and not a message after `review`, because which command
239
+ // runs must not depend on what the message says. Two ways that went wrong: the
240
+ // shell reads an unquoted `#3` as the start of a comment, so
241
+ // `weigh answer #3 is intentional` becomes `weigh answer` and refuses for
242
+ // free, where `weigh review #3 is intentional` became a bare `weigh review`
243
+ // and spent minutes and dollars re-reviewing the branch; and `weigh review
244
+ // main`, which people type, was answered with a complaint about findings.
245
+ if (positionals[0] === 'answer') {
246
+ try {
247
+ await exitAfterFlush(await runFollowUpCommand({
248
+ // Joined rather than demanded as one argument, because an unquoted
249
+ // message arrives in pieces and the grammar reads the whole sentence
250
+ // anyway. Empty, unreadable, or naming no finding is refused by
251
+ // FollowUp.parse: the dispatch does not keep a second, weaker copy of
252
+ // the grammar to decide whether this is a ruling at all.
253
+ message: positionals.slice(1).join(' '),
254
+ ...(values.repo && { repo: values.repo }),
255
+ ...(values.review && { review: values.review }),
256
+ json: Boolean(values.json),
257
+ quiet: Boolean(values.quiet),
258
+ noPromote: Boolean(values['no-promote']),
259
+ }, configFor()));
260
+ }
261
+ catch (err) {
262
+ reportError(err);
263
+ }
264
+ }
265
+ /**
266
+ * `--refute`, `--no-refute`, or neither — and neither leaves it to the
267
+ * `refute` setting, which is why this is not a plain boolean.
268
+ */
269
+ function refuteChoice() {
270
+ if (values.refute && values['no-refute'])
271
+ throw new Error('--refute and --no-refute contradict each other. Pass one.');
272
+ if (values.refute)
273
+ return { refute: true };
274
+ if (values['no-refute'])
275
+ return { refute: false };
276
+ return {};
277
+ }
278
+ if (positionals[0] === 'review') {
279
+ // A message here used to be how you ruled on findings. It read well and
280
+ // dispatched badly, and this is where both of the things people type land:
281
+ // a ruling, and a ref that belongs to --base.
282
+ if (positionals.length > 1) {
283
+ reportError(new Error(`weigh review takes no message. To rule on a finding: weigh answer "${FollowUp.example()}".\n` +
284
+ 'To review against another ref, pass it as --base.'));
285
+ }
286
+ try {
287
+ await exitAfterFlush(await runReviewCommand({
288
+ ...(values.repo && { repo: values.repo }),
289
+ ...(values.base && { base: values.base }),
290
+ ...(values.head && { head: values.head }),
291
+ ...(values.model && { model: values.model }),
292
+ ...(values['max-steps'] !== undefined && {
293
+ maxSteps: parsePositive('--max-steps', values['max-steps']),
294
+ }),
295
+ ...(values['max-cost'] !== undefined && {
296
+ maxCost: parsePositive('--max-cost', values['max-cost']),
297
+ }),
298
+ ...(values.effort !== undefined && { effort: parseEffort(values.effort) }),
299
+ ...(values['coverage-floor'] !== undefined && {
300
+ coverageFloor: parseShare('--coverage-floor', values['coverage-floor']),
301
+ }),
302
+ ...(values['confidence-floor'] !== undefined && {
303
+ confidenceFloor: parseShare('--confidence-floor', values['confidence-floor']),
304
+ }),
305
+ // A review reads the memory store, so the flags that point it at a
306
+ // store reach it too — the same three applyOverrides applies elsewhere.
307
+ ...(values.user && { user: values.user }),
308
+ ...(values['memory-backend'] && {
309
+ memoryBackend: parseMemoryBackend(String(values['memory-backend'])),
310
+ }),
311
+ noMemory: Boolean(values['no-memory']),
312
+ ...refuteChoice(),
313
+ fresh: Boolean(values.fresh),
314
+ uncommitted: Boolean(values.uncommitted),
315
+ dryRun: Boolean(values['dry-run']),
316
+ json: Boolean(values.json),
317
+ quiet: Boolean(values.quiet),
318
+ noProgress: Boolean(values['no-progress']),
319
+ noSession: Boolean(values['no-session']),
320
+ }));
321
+ }
322
+ catch (err) {
323
+ reportError(err);
324
+ }
325
+ }
326
+ // `weigh show <review>` — a stored review, printed. Its own verb for the
327
+ // reason `answer` is: which command runs must not depend on what follows it,
328
+ // and before this, `weigh show` was a prompt and called the model.
329
+ if (positionals[0] === 'show') {
330
+ if (positionals.length > 2) {
331
+ reportError(new Error('weigh show takes one review: its id, or the path of its record.'));
332
+ }
333
+ try {
334
+ await exitAfterFlush(await runShowCommand({
335
+ ...(positionals[1] && { review: positionals[1] }),
336
+ ...(values.repo && { repo: values.repo }),
337
+ json: Boolean(values.json),
338
+ }));
339
+ }
340
+ catch (err) {
341
+ reportError(err);
342
+ }
343
+ }
344
+ if (positionals[0] === 'corrections' && isCorrectionVerb(positionals[1])) {
345
+ try {
346
+ await exitAfterFlush(await runCorrectionsCommand(positionals[1], positionals.slice(2), configFor(), {
347
+ json: Boolean(values.json),
348
+ ...(values.repo && { repo: values.repo }),
349
+ ...(values.all && { all: true }),
350
+ ...(values['dry-run'] && { dryRun: true }),
351
+ ...(values.limit !== undefined && { limit: parsePositive('--limit', values.limit) }),
352
+ }));
353
+ }
354
+ catch (err) {
355
+ reportError(err);
356
+ }
357
+ }
358
+ if (positionals[0] === 'models') {
359
+ try {
360
+ await exitAfterFlush(await runModelsCommand({ json: Boolean(values.json) }));
361
+ }
362
+ catch (err) {
363
+ reportError(err);
364
+ }
365
+ }
366
+ if (positionals[0] === 'doctor') {
367
+ try {
368
+ await exitAfterFlush(await runDoctor({ json: Boolean(values.json) }));
369
+ }
370
+ catch (err) {
371
+ reportError(err);
372
+ }
373
+ }
374
+ if (positionals[0] === 'config' && isConfigVerb(positionals[1])) {
375
+ try {
376
+ await exitAfterFlush(await runConfigCommand(positionals[1], positionals.slice(2), {
377
+ json: Boolean(values.json),
378
+ ...(values.repo && { repo: values.repo }),
379
+ }));
380
+ }
381
+ catch (err) {
382
+ reportError(err);
383
+ }
384
+ }
385
+ if (isSessionCommand) {
386
+ try {
387
+ const config = configFor({ skipApiKey: true });
388
+ const code = await runSessionCommand(positionals[1], config, {
389
+ json: Boolean(values.json),
390
+ ...(values.limit !== undefined && { limit: parsePositive('--limit', values.limit) }),
391
+ ...(values.keep !== undefined && { keep: parsePositive('--keep', values.keep) }),
392
+ yes: Boolean(values.yes),
393
+ });
394
+ await exitAfterFlush(code);
395
+ }
396
+ catch (err) {
397
+ reportError(err);
398
+ }
399
+ }
400
+ // ── Resolve prompt ──────────────────────────────────────────────────
401
+ let prompt = values.prompt ?? positionals[0];
402
+ // stdin is piped — read all of it
403
+ if (!prompt && !process.stdin.isTTY)
404
+ prompt = await readAll(process.stdin);
405
+ if (!prompt) {
406
+ reportError(new Error('no prompt provided. Use --prompt, a positional arg, or pipe to stdin.'));
407
+ }
408
+ // ── Load config and apply overrides ─────────────────────────────────
409
+ let config;
410
+ // Resolved before the first model call: pointing Weigh at something that is
411
+ // not a repository should cost nothing and say so immediately.
412
+ let target;
413
+ try {
414
+ config = configFor();
415
+ target = resolveTarget({ ...(values.repo && { repo: values.repo }) });
416
+ }
417
+ catch (err) {
418
+ reportError(err);
419
+ }
420
+ // ── Session setup ───────────────────────────────────────────────────
421
+ const sessionEnabled = config.sessionEnabled && !values['no-session'];
422
+ let sessionPath;
423
+ // A resumed session replays its history as the model input; a fresh run
424
+ // sends the bare prompt.
425
+ let input = prompt;
426
+ if (sessionEnabled) {
427
+ initSessionDir(config.sessionDir);
428
+ sessionPath = values.resume ?? newSessionPath(config.sessionDir);
429
+ if (values.resume) {
430
+ const history = (await loadSession(sessionPath));
431
+ input = [...history, { role: 'user', content: prompt }];
432
+ }
433
+ saveMessage(sessionPath, { role: 'user', content: prompt });
434
+ }
435
+ // The session id doubles as the memory run scope, so every memory written this
436
+ // run can be traced back to the transcript that produced it. Without a session
437
+ // there is no run scope: memories are still written and still recalled, they
438
+ // just lose the link back to a transcript.
439
+ const runId = sessionPath ? sessionId(sessionPath) : undefined;
440
+ if (sessionPath && config.sessionRetention > 0) {
441
+ pruneSessions(config.sessionDir, config.sessionRetention);
442
+ }
443
+ // Emit the session up front in NDJSON mode so a caller can --resume it later.
444
+ // There is no way to learn the id otherwise.
445
+ if (values.json && sessionPath) {
446
+ process.stdout.write(JSON.stringify({ type: 'session', id: runId, path: sessionPath }) + '\n');
447
+ }
448
+ // ── Run agent ───────────────────────────────────────────────────────
449
+ try {
450
+ let hasEmittedText = false;
451
+ let recalled = 0;
452
+ let stored = 0;
453
+ // The same running commentary a review writes. Without it a prompt run that
454
+ // greps four times before answering is silent for half a minute, which is
455
+ // indistinguishable from a hang — the events were already being emitted and
456
+ // nothing in text mode printed them.
457
+ const progress = ProgressReporter.for({
458
+ quiet: Boolean(values.quiet),
459
+ noProgress: Boolean(values['no-progress']),
460
+ });
461
+ progress?.asking(`${config.model} · ${config.effort} effort · ${target.root}`);
462
+ // Warnings raised mid-stream would splice themselves into the middle of the
463
+ // model's output line, so once text is flowing they wait for the end.
464
+ const deferredWarnings = [];
465
+ const result = await runAgentWithRetry(config, input, {
466
+ ...(runId && { runId }),
467
+ repoRoot: target.root,
468
+ onEvent: (event) => {
469
+ if (event.type === 'memory_recall')
470
+ recalled = event.count;
471
+ if (event.type === 'memory_capture')
472
+ stored = event.count;
473
+ // Progress is on stderr, so it runs in NDJSON mode too — `--json | jq`
474
+ // is unaffected and the user still sees the run happening. In text mode
475
+ // it stops once the answer starts arriving: the run is no longer
476
+ // searching, and a line landing mid-paragraph would splice itself into
477
+ // what is being read. In NDJSON mode nothing is being read, so it does
478
+ // not stop.
479
+ if (event.type === 'tool_call' && !hasEmittedText) {
480
+ const detail = event.args.detail;
481
+ progress?.handle({
482
+ type: 'tool_call',
483
+ name: event.name,
484
+ ...(typeof detail === 'string' && detail && { detail }),
485
+ });
486
+ }
487
+ if (values.json) {
488
+ // NDJSON mode: write every event as a JSON line (including turn_end and done)
489
+ process.stdout.write(JSON.stringify(event) + '\n');
490
+ }
491
+ else if (!values.quiet) {
492
+ // Text mode: stream text deltas, insert newline at turn boundaries.
493
+ // Everything else stays off stdout so the output stays pipeable.
494
+ if (event.type === 'text') {
495
+ if (!hasEmittedText)
496
+ progress?.settled();
497
+ process.stdout.write(event.delta);
498
+ hasEmittedText = true;
499
+ }
500
+ else if (event.type === 'turn_end' && hasEmittedText) {
501
+ process.stdout.write('\n');
502
+ }
503
+ else if (event.type === 'warning') {
504
+ if (hasEmittedText)
505
+ deferredWarnings.push(event.message);
506
+ else
507
+ process.stderr.write(`Warning: ${event.message}\n`);
508
+ }
509
+ }
510
+ },
511
+ });
512
+ // In text mode, ensure output ends with a newline
513
+ if (!values.json && !values.quiet) {
514
+ process.stdout.write('\n');
515
+ for (const message of deferredWarnings)
516
+ process.stderr.write(`Warning: ${message}\n`);
517
+ if (recalled || stored) {
518
+ process.stderr.write(`↳ memory: recalled ${recalled}, stored ${stored}\n`);
519
+ }
520
+ }
521
+ if (sessionPath)
522
+ saveMessage(sessionPath, { role: 'assistant', content: result.text });
523
+ // The NDJSON stream and a long text answer both routinely exceed a pipe
524
+ // buffer, and `weigh --json | jq` is how this is meant to be used.
525
+ await exitAfterFlush(0);
526
+ }
527
+ catch (err) {
528
+ reportError(err);
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IG_VERBS)[number];
3
+ export declare function isConfigVerb(v: string | undefined): v is ConfigVerb;
4
+ /**
5
+ * `weigh config <verb>` — the answer to "why isn't my setting applied?".
6
+ *
7
+ * Provenance is the point: a value is never shown without where it came from,
8
+ * because with this many layers the interesting question is not what a setting is
9
+ * but which layer won.
10
+ */
11
+ export declare function runConfigCommand(verb: ConfigVerb, args: string[], options: {
12
+ json: boolean;
13
+ repo?: string;
14
+ }): Promise<number>;
15
+ //# sourceMappingURL=config-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-cli.d.ts","sourceRoot":"","sources":["../src/config-cli.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,YAAY,YAAI,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAU,CAAC;AACpE,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,CAAC,IAAI,UAAU,CAEnE;AAQD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GACxC,OAAO,CAAC,MAAM,CAAC,CAoHjB"}