@hawkeyexl/manni 4.5.0 → 4.6.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 (215) hide show
  1. package/README.md +1 -1
  2. package/dist/batch-OZOACN4G.js +41 -0
  3. package/dist/build-Z5VOVADH.js +32 -0
  4. package/dist/calibrate-TZYT42DR.js +36 -0
  5. package/dist/capture-SL4MNDDP.js +34 -0
  6. package/dist/check-5OMA42Y6.js +26 -0
  7. package/dist/{check-ESNS7ZBC.js → check-OAJWC3WD.js} +7 -5
  8. package/dist/{check-RQIIIURI.js → check-PKY7KTQE.js} +13 -14
  9. package/dist/check-WB2QDHJQ.js +880 -0
  10. package/dist/check-WB2QDHJQ.js.map +1 -0
  11. package/dist/{chunk-F2OVHJNC.js → chunk-2JFPBZJK.js} +11 -11
  12. package/dist/{chunk-CP4ZM43V.js → chunk-2KRB3EG7.js} +2 -2
  13. package/dist/{chunk-QLUMKWQQ.js → chunk-2M6DVNI5.js} +10 -6
  14. package/dist/{chunk-QLUMKWQQ.js.map → chunk-2M6DVNI5.js.map} +1 -1
  15. package/dist/{chunk-HQFVJDEN.js → chunk-3NWX34ZI.js} +19 -19
  16. package/dist/{chunk-TCC737IS.js → chunk-5G53XATW.js} +4 -4
  17. package/dist/{chunk-B7XUEQF3.js → chunk-6KKZXB2O.js} +7 -5
  18. package/dist/{chunk-B7XUEQF3.js.map → chunk-6KKZXB2O.js.map} +1 -1
  19. package/dist/{chunk-SNEHX4VE.js → chunk-733Y2STG.js} +2 -2
  20. package/dist/{chunk-ELZ2IIOF.js → chunk-73TC4DYH.js} +2 -2
  21. package/dist/{chunk-QY3DOZMS.js → chunk-7WRP5FFP.js} +4 -4
  22. package/dist/{chunk-3R5Y3XOL.js → chunk-APKH2T6E.js} +29 -591
  23. package/dist/chunk-APKH2T6E.js.map +1 -0
  24. package/dist/{chunk-FLF6AECQ.js → chunk-B3TS4WRM.js} +17 -15
  25. package/dist/{chunk-FLF6AECQ.js.map → chunk-B3TS4WRM.js.map} +1 -1
  26. package/dist/chunk-BWCWTHYS.js +146 -0
  27. package/dist/chunk-BWCWTHYS.js.map +1 -0
  28. package/dist/{chunk-C6HZ6C5T.js → chunk-C3B2VJNC.js} +2 -2
  29. package/dist/{chunk-NN4ASVTY.js → chunk-C73RSUIC.js} +4 -4
  30. package/dist/chunk-CU57HT2E.js +116 -0
  31. package/dist/chunk-CU57HT2E.js.map +1 -0
  32. package/dist/chunk-CWXZ2MRT.js +222 -0
  33. package/dist/chunk-CWXZ2MRT.js.map +1 -0
  34. package/dist/{chunk-GAZFKZHM.js → chunk-DC5DDJVE.js} +6 -6
  35. package/dist/{chunk-52PDIZKV.js → chunk-ECVQNGTH.js} +3 -3
  36. package/dist/chunk-FLAO4ZS3.js +502 -0
  37. package/dist/chunk-FLAO4ZS3.js.map +1 -0
  38. package/dist/chunk-FQGLRJGX.js +174 -0
  39. package/dist/chunk-FQGLRJGX.js.map +1 -0
  40. package/dist/{chunk-XWFNO5PO.js → chunk-GAJIJKET.js} +3 -3
  41. package/dist/{chunk-QCBICNKC.js → chunk-GREQKO6M.js} +202 -54
  42. package/dist/chunk-GREQKO6M.js.map +1 -0
  43. package/dist/chunk-HX44GB4Z.js +30 -0
  44. package/dist/chunk-HX44GB4Z.js.map +1 -0
  45. package/dist/{chunk-7ZUCEMCY.js → chunk-IY7NYNPZ.js} +9 -11
  46. package/dist/{chunk-7ZUCEMCY.js.map → chunk-IY7NYNPZ.js.map} +1 -1
  47. package/dist/{chunk-527HHQPS.js → chunk-KCOFEWV5.js} +6 -4
  48. package/dist/{chunk-527HHQPS.js.map → chunk-KCOFEWV5.js.map} +1 -1
  49. package/dist/chunk-M2RLHZ4J.js +849 -0
  50. package/dist/chunk-M2RLHZ4J.js.map +1 -0
  51. package/dist/{chunk-K3U5F2QT.js → chunk-M6GSS72T.js} +12 -12
  52. package/dist/{chunk-UK2I3ACY.js → chunk-MHM4QEBV.js} +4 -4
  53. package/dist/{chunk-EL2BZTDL.js → chunk-MOWMCEOJ.js} +13 -11
  54. package/dist/{chunk-EL2BZTDL.js.map → chunk-MOWMCEOJ.js.map} +1 -1
  55. package/dist/{chunk-OIZ3XMKB.js → chunk-MWBJ3KTF.js} +4 -4
  56. package/dist/chunk-N7JSEDSC.js +233 -0
  57. package/dist/chunk-N7JSEDSC.js.map +1 -0
  58. package/dist/{chunk-MZC62HPZ.js → chunk-NBMPHD4I.js} +2 -2
  59. package/dist/{chunk-YA63PVWI.js → chunk-NHHOPZRA.js} +12 -10
  60. package/dist/{chunk-YA63PVWI.js.map → chunk-NHHOPZRA.js.map} +1 -1
  61. package/dist/{chunk-DX32P2DT.js → chunk-NTWW7J76.js} +2 -2
  62. package/dist/{chunk-6XTQDFGP.js → chunk-PCFG7E6B.js} +3 -3
  63. package/dist/{chunk-6XTQDFGP.js.map → chunk-PCFG7E6B.js.map} +1 -1
  64. package/dist/{chunk-SJO2FTPG.js → chunk-PL4UAF4S.js} +73 -1304
  65. package/dist/chunk-PL4UAF4S.js.map +1 -0
  66. package/dist/chunk-QCHVR4ZM.js +286 -0
  67. package/dist/chunk-QCHVR4ZM.js.map +1 -0
  68. package/dist/{chunk-JQU7FHYH.js → chunk-QW77LCOU.js} +10 -10
  69. package/dist/{chunk-IA7BMIPE.js → chunk-SM6NOMJS.js} +2 -2
  70. package/dist/{chunk-DE7JSWXV.js → chunk-SWSTHZBI.js} +8 -6
  71. package/dist/{chunk-DE7JSWXV.js.map → chunk-SWSTHZBI.js.map} +1 -1
  72. package/dist/{chunk-NGK3N6F2.js → chunk-T6SYGLWR.js} +3 -3
  73. package/dist/chunk-TH4JVQPF.js +133 -0
  74. package/dist/chunk-TH4JVQPF.js.map +1 -0
  75. package/dist/{chunk-TVIX653Q.js → chunk-TLXE7LYK.js} +4 -4
  76. package/dist/{chunk-HVFR66GQ.js → chunk-TUAAR3MM.js} +3280 -283
  77. package/dist/chunk-TUAAR3MM.js.map +1 -0
  78. package/dist/{chunk-TA42STP7.js → chunk-UAKNZVCD.js} +4 -4
  79. package/dist/{chunk-C3KI45RF.js → chunk-UJSGS2Y5.js} +4 -4
  80. package/dist/{chunk-ZX43SRZR.js → chunk-UWQ2UVHE.js} +8 -6
  81. package/dist/{chunk-ZX43SRZR.js.map → chunk-UWQ2UVHE.js.map} +1 -1
  82. package/dist/chunk-WQWKYAAK.js +86 -0
  83. package/dist/chunk-WQWKYAAK.js.map +1 -0
  84. package/dist/{chunk-LJ2RDH3F.js → chunk-XG6PVB5S.js} +1 -23
  85. package/dist/chunk-XG6PVB5S.js.map +1 -0
  86. package/dist/{chunk-Q35YIDBV.js → chunk-XKBEHKWO.js} +29 -264
  87. package/dist/chunk-XKBEHKWO.js.map +1 -0
  88. package/dist/chunk-XPEWUK7J.js +532 -0
  89. package/dist/chunk-XPEWUK7J.js.map +1 -0
  90. package/dist/{chunk-BOIF2XGG.js → chunk-XXDXIIQ4.js} +2 -2
  91. package/dist/chunk-YLK2J5YK.js +610 -0
  92. package/dist/chunk-YLK2J5YK.js.map +1 -0
  93. package/dist/{chunk-7OQAU4EA.js → chunk-Z4IZGEM3.js} +16 -12
  94. package/dist/{chunk-7OQAU4EA.js.map → chunk-Z4IZGEM3.js.map} +1 -1
  95. package/dist/{cli-E3H6ZP4I.js → cli-6EWVMEN6.js} +5 -3
  96. package/dist/{cli-E3H6ZP4I.js.map → cli-6EWVMEN6.js.map} +1 -1
  97. package/dist/{cli-MHTYPVOD.js → cli-6H7HVDMQ.js} +113 -20
  98. package/dist/{cli-MHTYPVOD.js.map → cli-6H7HVDMQ.js.map} +1 -1
  99. package/dist/{cli-HUIMNJT6.js → cli-EPVZHAZS.js} +19 -20
  100. package/dist/{cli-HUIMNJT6.js.map → cli-EPVZHAZS.js.map} +1 -1
  101. package/dist/{cli-6PGVHP7Y.js → cli-LUCSGTVI.js} +17 -19
  102. package/dist/{cli-6PGVHP7Y.js.map → cli-LUCSGTVI.js.map} +1 -1
  103. package/dist/{cli-PRZHQ3QB.js → cli-NIG4N3XM.js} +14 -15
  104. package/dist/{cli-PRZHQ3QB.js.map → cli-NIG4N3XM.js.map} +1 -1
  105. package/dist/{cli-TYGOHJOJ.js → cli-PSKNB66T.js} +225 -58
  106. package/dist/cli-PSKNB66T.js.map +1 -0
  107. package/dist/{cli-QKIJOXGW.js → cli-UO4NHIB3.js} +17 -17
  108. package/dist/{cli-AAG3N4NB.js → cli-UQ7A3YA2.js} +17 -18
  109. package/dist/{cli-AAG3N4NB.js.map → cli-UQ7A3YA2.js.map} +1 -1
  110. package/dist/{cli-YW6VWBHX.js → cli-YHYDLQAF.js} +10 -10
  111. package/dist/cli.js +11 -11
  112. package/dist/config-P4HDNTYD.js +26 -0
  113. package/dist/conformance-ZFCMKM6M.js +18 -0
  114. package/dist/docmeta.js +9 -9
  115. package/dist/github-7ZCH5PSO.js +26 -0
  116. package/dist/github-POT6724K.js +31 -0
  117. package/dist/host-6GURH5HE.js +23 -0
  118. package/dist/index.d.ts +72 -4
  119. package/dist/index.js +176 -166
  120. package/dist/index.js.map +1 -1
  121. package/dist/{json-4DCKDGUV.js → json-KT2K62L5.js} +12 -13
  122. package/dist/lint-5AQ5C2BV.js +29 -0
  123. package/dist/list-5JZKX2NK.js +28 -0
  124. package/dist/list-SWPFXQMU.js +30 -0
  125. package/dist/{page-QEDB7EVU.js → page-UPSXRP75.js} +11 -12
  126. package/dist/prepare-6GNEWCNH.js +155 -0
  127. package/dist/prepare-6GNEWCNH.js.map +1 -0
  128. package/dist/{pretty-SQX33UM2.js → pretty-Q6FQAOK4.js} +13 -14
  129. package/dist/{pretty-5DGEBZSV.js → pretty-SQRPFPSQ.js} +12 -13
  130. package/dist/provider-AMGRDY6V.js +34 -0
  131. package/dist/release-IECYCLTD.js +36 -0
  132. package/dist/release-IECYCLTD.js.map +1 -0
  133. package/dist/{reporters-OHSI3RMV.js → reporters-45MMC2ID.js} +11 -12
  134. package/dist/{reporters-YELDDYJD.js → reporters-XUV4MM64.js} +7 -5
  135. package/dist/reporters-XUV4MM64.js.map +1 -0
  136. package/dist/run-KMWY2IAN.js +32 -0
  137. package/dist/run-KMWY2IAN.js.map +1 -0
  138. package/dist/{term-2WMDZ4PY.js → term-PCJUCWNF.js} +16 -17
  139. package/dist/{term-2WMDZ4PY.js.map → term-PCJUCWNF.js.map} +1 -1
  140. package/dist/validate-IMNCZNWG.js +17 -0
  141. package/dist/validate-IMNCZNWG.js.map +1 -0
  142. package/package.json +2 -2
  143. package/plugin/manni/.claude-plugin/plugin.json +1 -1
  144. package/plugin/manni/hooks/hooks.json +47 -0
  145. package/dist/batch-GOE3UXOD.js +0 -36
  146. package/dist/build-M7BMEHL2.js +0 -33
  147. package/dist/calibrate-6RRAILUY.js +0 -31
  148. package/dist/capture-RJPQ6B4N.js +0 -32
  149. package/dist/check-BQD64X3N.js +0 -27
  150. package/dist/chunk-3R5Y3XOL.js.map +0 -1
  151. package/dist/chunk-3YHAYXBC.js +0 -164
  152. package/dist/chunk-3YHAYXBC.js.map +0 -1
  153. package/dist/chunk-HVFR66GQ.js.map +0 -1
  154. package/dist/chunk-LJ2RDH3F.js.map +0 -1
  155. package/dist/chunk-NAZRLJAK.js +0 -3090
  156. package/dist/chunk-NAZRLJAK.js.map +0 -1
  157. package/dist/chunk-Q35YIDBV.js.map +0 -1
  158. package/dist/chunk-QCBICNKC.js.map +0 -1
  159. package/dist/chunk-SJO2FTPG.js.map +0 -1
  160. package/dist/chunk-TU2WUBVZ.js +0 -2
  161. package/dist/cli-TYGOHJOJ.js.map +0 -1
  162. package/dist/github-3WMSTNTK.js +0 -32
  163. package/dist/github-OXSJQ4PS.js +0 -27
  164. package/dist/lint-YDHVVZHT.js +0 -30
  165. package/dist/list-3ZO2NIYO.js +0 -31
  166. package/dist/list-EJH6VAOW.js +0 -29
  167. package/dist/run-IP6NZHAG.js +0 -33
  168. package/dist/validate-G6HH3YXL.js +0 -16
  169. /package/dist/{batch-GOE3UXOD.js.map → batch-OZOACN4G.js.map} +0 -0
  170. /package/dist/{build-M7BMEHL2.js.map → build-Z5VOVADH.js.map} +0 -0
  171. /package/dist/{calibrate-6RRAILUY.js.map → calibrate-TZYT42DR.js.map} +0 -0
  172. /package/dist/{capture-RJPQ6B4N.js.map → capture-SL4MNDDP.js.map} +0 -0
  173. /package/dist/{check-BQD64X3N.js.map → check-5OMA42Y6.js.map} +0 -0
  174. /package/dist/{check-ESNS7ZBC.js.map → check-OAJWC3WD.js.map} +0 -0
  175. /package/dist/{check-RQIIIURI.js.map → check-PKY7KTQE.js.map} +0 -0
  176. /package/dist/{chunk-F2OVHJNC.js.map → chunk-2JFPBZJK.js.map} +0 -0
  177. /package/dist/{chunk-CP4ZM43V.js.map → chunk-2KRB3EG7.js.map} +0 -0
  178. /package/dist/{chunk-HQFVJDEN.js.map → chunk-3NWX34ZI.js.map} +0 -0
  179. /package/dist/{chunk-TCC737IS.js.map → chunk-5G53XATW.js.map} +0 -0
  180. /package/dist/{chunk-SNEHX4VE.js.map → chunk-733Y2STG.js.map} +0 -0
  181. /package/dist/{chunk-ELZ2IIOF.js.map → chunk-73TC4DYH.js.map} +0 -0
  182. /package/dist/{chunk-QY3DOZMS.js.map → chunk-7WRP5FFP.js.map} +0 -0
  183. /package/dist/{chunk-C6HZ6C5T.js.map → chunk-C3B2VJNC.js.map} +0 -0
  184. /package/dist/{chunk-NN4ASVTY.js.map → chunk-C73RSUIC.js.map} +0 -0
  185. /package/dist/{chunk-GAZFKZHM.js.map → chunk-DC5DDJVE.js.map} +0 -0
  186. /package/dist/{chunk-52PDIZKV.js.map → chunk-ECVQNGTH.js.map} +0 -0
  187. /package/dist/{chunk-XWFNO5PO.js.map → chunk-GAJIJKET.js.map} +0 -0
  188. /package/dist/{chunk-K3U5F2QT.js.map → chunk-M6GSS72T.js.map} +0 -0
  189. /package/dist/{chunk-UK2I3ACY.js.map → chunk-MHM4QEBV.js.map} +0 -0
  190. /package/dist/{chunk-OIZ3XMKB.js.map → chunk-MWBJ3KTF.js.map} +0 -0
  191. /package/dist/{chunk-MZC62HPZ.js.map → chunk-NBMPHD4I.js.map} +0 -0
  192. /package/dist/{chunk-DX32P2DT.js.map → chunk-NTWW7J76.js.map} +0 -0
  193. /package/dist/{chunk-JQU7FHYH.js.map → chunk-QW77LCOU.js.map} +0 -0
  194. /package/dist/{chunk-IA7BMIPE.js.map → chunk-SM6NOMJS.js.map} +0 -0
  195. /package/dist/{chunk-NGK3N6F2.js.map → chunk-T6SYGLWR.js.map} +0 -0
  196. /package/dist/{chunk-TVIX653Q.js.map → chunk-TLXE7LYK.js.map} +0 -0
  197. /package/dist/{chunk-TA42STP7.js.map → chunk-UAKNZVCD.js.map} +0 -0
  198. /package/dist/{chunk-C3KI45RF.js.map → chunk-UJSGS2Y5.js.map} +0 -0
  199. /package/dist/{chunk-BOIF2XGG.js.map → chunk-XXDXIIQ4.js.map} +0 -0
  200. /package/dist/{cli-QKIJOXGW.js.map → cli-UO4NHIB3.js.map} +0 -0
  201. /package/dist/{chunk-TU2WUBVZ.js.map → cli-YHYDLQAF.js.map} +0 -0
  202. /package/dist/{cli-YW6VWBHX.js.map → config-P4HDNTYD.js.map} +0 -0
  203. /package/dist/{github-3WMSTNTK.js.map → conformance-ZFCMKM6M.js.map} +0 -0
  204. /package/dist/{github-OXSJQ4PS.js.map → github-7ZCH5PSO.js.map} +0 -0
  205. /package/dist/{json-4DCKDGUV.js.map → github-POT6724K.js.map} +0 -0
  206. /package/dist/{lint-YDHVVZHT.js.map → host-6GURH5HE.js.map} +0 -0
  207. /package/dist/{list-3ZO2NIYO.js.map → json-KT2K62L5.js.map} +0 -0
  208. /package/dist/{list-EJH6VAOW.js.map → lint-5AQ5C2BV.js.map} +0 -0
  209. /package/dist/{page-QEDB7EVU.js.map → list-5JZKX2NK.js.map} +0 -0
  210. /package/dist/{pretty-5DGEBZSV.js.map → list-SWPFXQMU.js.map} +0 -0
  211. /package/dist/{pretty-SQX33UM2.js.map → page-UPSXRP75.js.map} +0 -0
  212. /package/dist/{reporters-OHSI3RMV.js.map → pretty-Q6FQAOK4.js.map} +0 -0
  213. /package/dist/{reporters-YELDDYJD.js.map → pretty-SQRPFPSQ.js.map} +0 -0
  214. /package/dist/{run-IP6NZHAG.js.map → provider-AMGRDY6V.js.map} +0 -0
  215. /package/dist/{validate-G6HH3YXL.js.map → reporters-45MMC2ID.js.map} +0 -0
@@ -1,237 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- programName
4
- } from "./chunk-OWBRDNRZ.js";
3
+ warn
4
+ } from "./chunk-HX44GB4Z.js";
5
+ import {
6
+ PROVIDERS_KEY,
7
+ parseProviders
8
+ } from "./chunk-QCHVR4ZM.js";
5
9
  import {
6
10
  errorMessage
7
11
  } from "./chunk-G3T47CFV.js";
8
12
 
9
- // src/shared/warn.ts
10
- var said = /* @__PURE__ */ new Set();
11
- function warn(message) {
12
- if (said.has(message)) return;
13
- said.add(message);
14
- process.stderr.write(`${programName()}: ${message}
15
- `);
16
- }
17
- function notice(message) {
18
- process.stderr.write(`${programName()}: ${message}
19
- `);
20
- }
21
- var noticed = /* @__PURE__ */ new Set();
22
- function noticeOnce(message) {
23
- if (noticed.has(message)) return;
24
- noticed.add(message);
25
- notice(message);
26
- }
27
-
28
- // src/shared/providers.ts
29
- import { resolve } from "node:path";
30
- import {
31
- DEFAULT_MODELS,
32
- DEFAULT_OPENAI_BASE_URL,
33
- InferenceError,
34
- resolveProviderIdentityAsync
35
- } from "@hawkeyexl/inference";
36
- var DEFAULT_PROVIDER = "auto";
37
- var PROVIDERS = /* @__PURE__ */ new Set([
38
- ...Object.keys(DEFAULT_MODELS),
39
- DEFAULT_PROVIDER
40
- ]);
41
- var NAMEABLE_PROVIDERS = Object.keys(DEFAULT_MODELS).filter(
42
- (name) => name !== "mock"
43
- );
44
- function assertKnownProvider(name, toError) {
45
- if (PROVIDERS.has(name)) return;
46
- throw toError(
47
- `Unknown provider "${name}". Available: ${[...NAMEABLE_PROVIDERS, DEFAULT_PROVIDER].join(", ")}.`
48
- );
49
- }
50
- function assertModelHasProvider(name, model, configKey, toError) {
51
- if (name !== DEFAULT_PROVIDER || model == null) return;
52
- throw toError(
53
- `Model "${model}" was given without a provider: a model name does not say which provider owns it. Set --provider or ${configKey} to one of ${NAMEABLE_PROVIDERS.join(", ")}, or drop the model to take the detected provider's default.`
54
- );
55
- }
56
- var PROVIDERS_KEY = "providers";
57
- var CONNECTION_KEYS = {
58
- anthropic: ["apiKeyEnv"],
59
- openai: ["baseUrl", "apiKeyEnv"],
60
- "claude-cli": ["command"],
61
- "llama-cpp": ["modelsDir", "thoughtTokens"]
62
- };
63
- var CONNECTION_NAMES = Object.keys(CONNECTION_KEYS);
64
- var TOP_LEVEL_KEYS = ["provider", "model", ...CONNECTION_NAMES];
65
- function isMapping(value) {
66
- return typeof value === "object" && value !== null && !Array.isArray(value);
67
- }
68
- function rejectUnknown(raw, allowed, label, source, toError) {
69
- for (const key of Object.keys(raw)) {
70
- if (!allowed.includes(key)) {
71
- throw toError(
72
- `${source}: "${label}" has unknown key "${key}". Supported keys: ${allowed.join(", ")}.`
73
- );
74
- }
75
- }
76
- }
77
- function parseProviders(value, source, dir, toError) {
78
- if (value == null) return {};
79
- if (!isMapping(value)) {
80
- throw toError(`${source}: "${PROVIDERS_KEY}" must be a mapping.`);
81
- }
82
- rejectUnknown(value, TOP_LEVEL_KEYS, PROVIDERS_KEY, source, toError);
83
- const string = (raw, key, label) => {
84
- const v = raw[key];
85
- if (v === void 0) return void 0;
86
- if (typeof v !== "string") {
87
- throw toError(`${source}: "${label}" must be a string.`);
88
- }
89
- return v;
90
- };
91
- const parsed = {};
92
- const provider = string(value, "provider", `${PROVIDERS_KEY}.provider`);
93
- if (provider !== void 0) {
94
- assertKnownProvider(provider, (message) => toError(`${source}: ${message}`));
95
- parsed.provider = provider;
96
- }
97
- const model = string(value, "model", `${PROVIDERS_KEY}.model`);
98
- if (model !== void 0) {
99
- if (provider === void 0 || provider === DEFAULT_PROVIDER) {
100
- throw toError(
101
- `${source}: "${PROVIDERS_KEY}.model" was given without a provider: a model name does not say which provider owns it. Set ${PROVIDERS_KEY}.provider to one of ${NAMEABLE_PROVIDERS.join(", ")}, or drop the model to take the detected provider's default.`
102
- );
103
- }
104
- parsed.model = model;
105
- }
106
- for (const name of CONNECTION_NAMES) {
107
- const section = value[name];
108
- if (section == null) continue;
109
- const label = `${PROVIDERS_KEY}.${name}`;
110
- if (!isMapping(section)) {
111
- throw toError(`${source}: "${label}" must be a mapping.`);
112
- }
113
- rejectUnknown(section, CONNECTION_KEYS[name], label, source, toError);
114
- const field = (key) => string(section, key, `${label}.${key}`);
115
- switch (name) {
116
- case "anthropic": {
117
- const apiKeyEnv = field("apiKeyEnv");
118
- parsed.anthropic = apiKeyEnv === void 0 ? {} : { apiKeyEnv };
119
- break;
120
- }
121
- case "openai": {
122
- const baseUrl = field("baseUrl");
123
- const apiKeyEnv = field("apiKeyEnv");
124
- parsed.openai = {
125
- ...baseUrl !== void 0 ? { baseUrl } : {},
126
- ...apiKeyEnv !== void 0 ? { apiKeyEnv } : {}
127
- };
128
- break;
129
- }
130
- case "claude-cli": {
131
- const command = field("command");
132
- parsed["claude-cli"] = command === void 0 ? {} : { command };
133
- break;
134
- }
135
- case "llama-cpp": {
136
- const modelsDir = field("modelsDir");
137
- const thoughtTokens = section["thoughtTokens"];
138
- if (thoughtTokens !== void 0 && (typeof thoughtTokens !== "number" || !Number.isInteger(thoughtTokens) || thoughtTokens < 0)) {
139
- throw toError(
140
- `${source}: "${label}.thoughtTokens" must be a whole number of 0 or more, got ${JSON.stringify(thoughtTokens)}.`
141
- );
142
- }
143
- parsed["llama-cpp"] = {
144
- ...modelsDir !== void 0 ? { modelsDir: resolve(dir, modelsDir) } : {},
145
- ...thoughtTokens !== void 0 ? { thoughtTokens } : {}
146
- };
147
- break;
148
- }
149
- }
150
- }
151
- return parsed;
152
- }
153
- var LOCAL_PROVIDER = "llama-cpp";
154
- var LOCAL_FLAG_HELP = "run inference on this machine (llama-cpp); overrides any configured or eval-level provider";
155
- var LOCAL_COMPATIBLE = /* @__PURE__ */ new Set([LOCAL_PROVIDER, DEFAULT_PROVIDER, "mock"]);
156
- function assertLocalFlag(flag, toError) {
157
- if (flag.local !== true || flag.provider === void 0) return;
158
- assertKnownProvider(flag.provider, toError);
159
- if (LOCAL_COMPATIBLE.has(flag.provider)) return;
160
- throw toError(
161
- `--local and --provider ${flag.provider} contradict each other: --local runs inference on this machine with ${LOCAL_PROVIDER}. Drop one of them.`
162
- );
163
- }
164
- function selectProvider(flag, levels) {
165
- if (flag.local === true) return selectLocal(flag, levels);
166
- const provider = flag.provider ?? levels.find((level) => level.provider !== void 0)?.provider ?? DEFAULT_PROVIDER;
167
- const model = flag.model ?? levels.find(
168
- (level) => level.model !== void 0 && (level.provider === void 0 || level.provider === provider)
169
- )?.model;
170
- return { provider, model };
171
- }
172
- function selectLocal(flag, levels) {
173
- const provider = flag.provider === "mock" ? "mock" : LOCAL_PROVIDER;
174
- const model = flag.model ?? levels.find((level) => level.model !== void 0 && level.provider === provider)?.model;
175
- const chosen = flag.provider === void 0 ? levels.find((level) => level.provider !== void 0) : void 0;
176
- const replaced = chosen?.provider !== void 0 && chosen.origin !== void 0 && chosen.provider !== provider && chosen.provider !== DEFAULT_PROVIDER ? { provider: chosen.provider, source: chosen.origin } : void 0;
177
- return replaced === void 0 ? { provider, model } : { provider, model, replaced };
178
- }
179
- function localNotice(selection) {
180
- const { replaced } = selection;
181
- if (replaced === void 0) return void 0;
182
- return `--local: using ${LOCAL_PROVIDER} instead of "${replaced.provider}" from ${replaced.source}.`;
183
- }
184
- function providerSpecFor(connections, selection) {
185
- const { provider, model } = selection;
186
- const local = connections["llama-cpp"] ?? {};
187
- const llamaCpp = {
188
- thoughtTokens: local.thoughtTokens ?? 0,
189
- ...local.modelsDir !== void 0 ? { modelsDirectory: local.modelsDir } : {}
190
- };
191
- switch (provider) {
192
- case "anthropic":
193
- return {
194
- provider,
195
- model,
196
- apiKeyEnv: connections.anthropic?.apiKeyEnv ?? "ANTHROPIC_API_KEY"
197
- };
198
- case "openai":
199
- return {
200
- provider,
201
- model,
202
- apiKeyEnv: connections.openai?.apiKeyEnv ?? "OPENAI_API_KEY",
203
- baseUrl: connections.openai?.baseUrl ?? DEFAULT_OPENAI_BASE_URL
204
- };
205
- case "claude-cli":
206
- return { provider, model, command: connections["claude-cli"]?.command ?? "claude" };
207
- case "llama-cpp":
208
- return { provider, model, llamaCpp };
209
- case "mock":
210
- return { provider, model };
211
- case "auto": {
212
- const baseUrl = connections.openai?.baseUrl;
213
- const command = connections["claude-cli"]?.command;
214
- const configuredLocal = local.thoughtTokens !== void 0 || local.modelsDir !== void 0;
215
- return {
216
- provider,
217
- model,
218
- ...baseUrl !== void 0 ? { baseUrl } : {},
219
- ...command !== void 0 ? { command } : {},
220
- ...configuredLocal ? { llamaCpp } : {}
221
- };
222
- }
223
- }
224
- }
225
- async function resolveIdentity(spec, toError) {
226
- try {
227
- return await resolveProviderIdentityAsync(spec);
228
- } catch (err) {
229
- throw toError(
230
- err instanceof InferenceError ? err.message : `Could not resolve provider "${String(spec.provider)}": ${errorMessage(err)}`
231
- );
232
- }
233
- }
234
-
235
13
  // src/shared/encryption.ts
236
14
  import {
237
15
  createCipheriv,
@@ -379,7 +157,7 @@ import { posix as posix2, win32 } from "node:path";
379
157
 
380
158
  // src/shared/page-manifest.ts
381
159
  import { readFileSync, realpathSync } from "node:fs";
382
- import { isAbsolute, posix, relative, resolve as resolve2, sep } from "node:path";
160
+ import { isAbsolute, posix, relative, resolve, sep } from "node:path";
383
161
  import fg from "fast-glob";
384
162
  import { LineCounter, isMap, isNode, isScalar, parseDocument } from "yaml";
385
163
  var PAGE_PLACEHOLDER = "{page}";
@@ -402,7 +180,7 @@ function pageManifestPath(file, configDir, pageAbs) {
402
180
  const ext = posix.extname(pageRel);
403
181
  const page = ext === "" ? pageRel : pageRel.slice(0, -ext.length);
404
182
  const named = normalizeManifestPattern(file).replace(PAGE_PLACEHOLDER, () => page);
405
- const abs = resolve2(configDir, named);
183
+ const abs = resolve(configDir, named);
406
184
  return { abs, rel: slashes(relative(configDir, abs)) };
407
185
  }
408
186
  function strayManifestGlob(file) {
@@ -423,7 +201,7 @@ function findPageManifests(file, configDir, isMember2, skip = /* @__PURE__ */ ne
423
201
  onlyFiles: true,
424
202
  dot: false,
425
203
  ignore: ["**/node_modules/**", "**/.git/**"]
426
- }).map((path) => resolve2(path)).sort();
204
+ }).map((path) => resolve(path)).sort();
427
205
  const found = [];
428
206
  for (const abs of matched) {
429
207
  if (skip.has(abs)) continue;
@@ -446,7 +224,7 @@ function ownEntries(abs, file, configDir, isMember2) {
446
224
  const entries = [];
447
225
  for (const pair of root.items) {
448
226
  const spelled = isScalar(pair.key) ? String(pair.key.value) : String(pair.key);
449
- const pageAbs = resolve2(configDir, spelled);
227
+ const pageAbs = resolve(configDir, spelled);
450
228
  if (!isMember2(slashes(relative(configDir, pageAbs)))) continue;
451
229
  const resolved = pageManifestPath(file, configDir, pageAbs);
452
230
  if ("outside" in resolved || !sameFile(resolved.abs, abs)) continue;
@@ -512,7 +290,7 @@ function rejectUnknownKeys(raw, allowed, where, source, toError) {
512
290
  }
513
291
  }
514
292
  }
515
- function isMapping2(value) {
293
+ function isMapping(value) {
516
294
  return typeof value === "object" && value !== null && !Array.isArray(value);
517
295
  }
518
296
  function isNonEmptyString(value) {
@@ -530,7 +308,7 @@ function parseCollections(raw, source, toError) {
530
308
  const taken = /* @__PURE__ */ new Map();
531
309
  return raw.map((entry, i) => {
532
310
  const where = `collections[${i}]`;
533
- if (!isMapping2(entry)) {
311
+ if (!isMapping(entry)) {
534
312
  throw toError(`${source}: ${where} must be a mapping.`);
535
313
  }
536
314
  rejectUnknownKeys(entry, COLLECTION_KEYS, where, source, toError);
@@ -617,7 +395,7 @@ function parseExternalMetadata(raw, collectionWhere, source, toError) {
617
395
  let keyless;
618
396
  const parsedEntries = raw.map((entry, i) => {
619
397
  const where = `${collectionWhere}.externalMetadata[${i}]`;
620
- if (!isMapping2(entry)) {
398
+ if (!isMapping(entry)) {
621
399
  throw toError(`${source}: ${where} must be a mapping.`);
622
400
  }
623
401
  rejectUnknownKeys(entry, EXTERNAL_METADATA_KEYS, where, source, toError);
@@ -816,11 +594,11 @@ function isGlob(entry) {
816
594
  }
817
595
 
818
596
  // src/shared/tools.ts
819
- import { isAbsolute as isAbsolute2, resolve as resolve3 } from "node:path";
597
+ import { isAbsolute as isAbsolute2, resolve as resolve2 } from "node:path";
820
598
  var TOOL_KEYS = ["vale", "dita-ot"];
821
599
  var VALE_KEYS = ["config"];
822
600
  var DITA_OT_KEYS = ["home"];
823
- function isMapping3(value) {
601
+ function isMapping2(value) {
824
602
  return typeof value === "object" && value !== null && !Array.isArray(value);
825
603
  }
826
604
  function rejectUnknownKeys2(raw, allowed, where, source, toError) {
@@ -834,7 +612,7 @@ function rejectUnknownKeys2(raw, allowed, where, source, toError) {
834
612
  }
835
613
  function parseTools(raw, source, toError) {
836
614
  if (raw === null || raw === void 0) return {};
837
- if (!isMapping3(raw)) {
615
+ if (!isMapping2(raw)) {
838
616
  throw toError(`${source}: "tools" must be a mapping.`);
839
617
  }
840
618
  rejectUnknownKeys2(raw, TOOL_KEYS, "tools", source, toError);
@@ -848,7 +626,7 @@ function parseTools(raw, source, toError) {
848
626
  return tools;
849
627
  }
850
628
  function parseVale(raw, source, toError) {
851
- if (!isMapping3(raw)) {
629
+ if (!isMapping2(raw)) {
852
630
  throw toError(`${source}: tools.vale must be a mapping.`);
853
631
  }
854
632
  rejectUnknownKeys2(raw, VALE_KEYS, "tools.vale", source, toError);
@@ -863,7 +641,7 @@ function parseVale(raw, source, toError) {
863
641
  return vale;
864
642
  }
865
643
  function parseDitaOt(raw, source, toError) {
866
- if (!isMapping3(raw)) {
644
+ if (!isMapping2(raw)) {
867
645
  throw toError(`${source}: tools.dita-ot must be a mapping.`);
868
646
  }
869
647
  rejectUnknownKeys2(raw, DITA_OT_KEYS, "tools.dita-ot", source, toError);
@@ -880,24 +658,24 @@ function parseDitaOt(raw, source, toError) {
880
658
  function valeConfigPath(tools, configDir) {
881
659
  const config = tools.vale?.config;
882
660
  if (config === void 0) return void 0;
883
- return isAbsolute2(config) ? config : resolve3(configDir, config);
661
+ return isAbsolute2(config) ? config : resolve2(configDir, config);
884
662
  }
885
663
  function ditaOtHome(tools, configDir) {
886
664
  const home = tools["dita-ot"]?.home;
887
665
  if (home === void 0) return void 0;
888
- return isAbsolute2(home) ? home : resolve3(configDir, home);
666
+ return isAbsolute2(home) ? home : resolve2(configDir, home);
889
667
  }
890
668
 
891
669
  // src/shared/config-file.ts
892
670
  import { readFileSync as readFileSync2 } from "node:fs";
893
- import { basename, dirname as dirname2, join as join2, relative as relative2, resolve as resolve5 } from "node:path";
671
+ import { basename, dirname as dirname2, join as join2, relative as relative2, resolve as resolve4 } from "node:path";
894
672
  import { parse as parseYaml } from "yaml";
895
673
 
896
674
  // src/shared/git-root.ts
897
675
  import { existsSync } from "node:fs";
898
- import { dirname, join, resolve as resolve4 } from "node:path";
676
+ import { dirname, join, resolve as resolve3 } from "node:path";
899
677
  function findGitRoot(cwd) {
900
- let dir = resolve4(cwd);
678
+ let dir = resolve3(cwd);
901
679
  for (; ; ) {
902
680
  if (existsSync(join(dir, ".git"))) return dir;
903
681
  const parent = dirname(dir);
@@ -906,7 +684,7 @@ function findGitRoot(cwd) {
906
684
  }
907
685
  }
908
686
  function searchPath(cwd) {
909
- const start = resolve4(cwd);
687
+ const start = resolve3(cwd);
910
688
  const root = findGitRoot(start);
911
689
  if (root === null) return [start];
912
690
  const chain = [];
@@ -1018,7 +796,7 @@ function relativeSource(cwd, path) {
1018
796
  return relative2(cwd, path).replace(/\\/g, "/");
1019
797
  }
1020
798
  function findConfigFileSync(cwd, opts) {
1021
- const start = resolve5(cwd);
799
+ const start = resolve4(cwd);
1022
800
  for (const dir of searchPath(start)) {
1023
801
  for (const name of FAMILY_CONFIG_NAMES) {
1024
802
  const path = join2(dir, name);
@@ -1064,7 +842,7 @@ function findConfigFileSync(cwd, opts) {
1064
842
  return null;
1065
843
  }
1066
844
  function readConfigFileSync(explicitPath, cwd, opts) {
1067
- const path = resolve5(cwd, explicitPath);
845
+ const path = resolve4(cwd, explicitPath);
1068
846
  const document = readDocument(path, explicitPath, opts.toError);
1069
847
  if (document === null) {
1070
848
  throw opts.toError(`Config file not found: "${explicitPath}".`);
@@ -1100,7 +878,7 @@ function findFamilyConfigFile(cwd, toError) {
1100
878
  return Promise.resolve().then(() => findFamilyConfigFileSync(cwd, toError));
1101
879
  }
1102
880
  function findFamilyConfigFileSync(cwd, toError) {
1103
- const start = resolve5(cwd);
881
+ const start = resolve4(cwd);
1104
882
  for (const dir of searchPath(start)) {
1105
883
  for (const name of FAMILY_CONFIG_NAMES) {
1106
884
  const path = join2(dir, name);
@@ -1129,7 +907,7 @@ function readFamilyConfigFile(explicitPath, cwd, toError) {
1129
907
  );
1130
908
  }
1131
909
  function readFamilyConfigFileSync(explicitPath, cwd, toError) {
1132
- const path = resolve5(cwd, explicitPath);
910
+ const path = resolve4(cwd, explicitPath);
1133
911
  const document = readDocument(path, explicitPath, toError);
1134
912
  if (document === null) {
1135
913
  throw toError(`Config file not found: "${explicitPath}".`);
@@ -1152,19 +930,6 @@ function readFamilyConfigFileSync(explicitPath, cwd, toError) {
1152
930
  }
1153
931
 
1154
932
  export {
1155
- warn,
1156
- notice,
1157
- noticeOnce,
1158
- assertKnownProvider,
1159
- assertModelHasProvider,
1160
- PROVIDERS_KEY,
1161
- parseProviders,
1162
- LOCAL_FLAG_HELP,
1163
- assertLocalFlag,
1164
- selectProvider,
1165
- localNotice,
1166
- providerSpecFor,
1167
- resolveIdentity,
1168
933
  isEncryptedValue,
1169
934
  isValidEncryptionKey,
1170
935
  generateEncryptionKey,
@@ -1199,4 +964,4 @@ export {
1199
964
  findFamilyConfigFile,
1200
965
  readFamilyConfigFile
1201
966
  };
1202
- //# sourceMappingURL=chunk-Q35YIDBV.js.map
967
+ //# sourceMappingURL=chunk-XKBEHKWO.js.map