faf-cli 5.1.0 → 6.0.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 (731) hide show
  1. package/README.md +80 -52
  2. package/dist/cli.js +313 -1884
  3. package/dist/index.js +4 -46
  4. package/package.json +29 -104
  5. package/project.faf +33 -141
  6. package/assets/project-faf-screenshot.png +0 -0
  7. package/dist/big-orange/bigo-push.d.ts +0 -18
  8. package/dist/big-orange/bigo-push.d.ts.map +0 -1
  9. package/dist/big-orange/bigo-push.js +0 -88
  10. package/dist/big-orange/bigo-push.js.map +0 -1
  11. package/dist/big-orange/compare.d.ts +0 -11
  12. package/dist/big-orange/compare.d.ts.map +0 -1
  13. package/dist/big-orange/compare.js +0 -179
  14. package/dist/big-orange/compare.js.map +0 -1
  15. package/dist/big-orange/faf-generator.d.ts +0 -22
  16. package/dist/big-orange/faf-generator.d.ts.map +0 -1
  17. package/dist/big-orange/faf-generator.js +0 -215
  18. package/dist/big-orange/faf-generator.js.map +0 -1
  19. package/dist/big-orange/index.d.ts +0 -7
  20. package/dist/big-orange/index.d.ts.map +0 -1
  21. package/dist/big-orange/index.js +0 -96
  22. package/dist/big-orange/index.js.map +0 -1
  23. package/dist/big-orange/types.d.ts +0 -62
  24. package/dist/big-orange/types.d.ts.map +0 -1
  25. package/dist/big-orange/types.js +0 -7
  26. package/dist/big-orange/types.js.map +0 -1
  27. package/dist/cli.d.ts +0 -8
  28. package/dist/cli.d.ts.map +0 -1
  29. package/dist/cli.js.map +0 -1
  30. package/dist/commands/agents.d.ts +0 -14
  31. package/dist/commands/agents.d.ts.map +0 -1
  32. package/dist/commands/agents.js +0 -353
  33. package/dist/commands/agents.js.map +0 -1
  34. package/dist/commands/ai-analyze.d.ts +0 -18
  35. package/dist/commands/ai-analyze.d.ts.map +0 -1
  36. package/dist/commands/ai-analyze.js +0 -190
  37. package/dist/commands/ai-analyze.js.map +0 -1
  38. package/dist/commands/ai-enhance.d.ts +0 -17
  39. package/dist/commands/ai-enhance.d.ts.map +0 -1
  40. package/dist/commands/ai-enhance.js +0 -275
  41. package/dist/commands/ai-enhance.js.map +0 -1
  42. package/dist/commands/antigravity.d.ts +0 -16
  43. package/dist/commands/antigravity.d.ts.map +0 -1
  44. package/dist/commands/antigravity.js +0 -398
  45. package/dist/commands/antigravity.js.map +0 -1
  46. package/dist/commands/audit.d.ts +0 -11
  47. package/dist/commands/audit.d.ts.map +0 -1
  48. package/dist/commands/audit.js +0 -148
  49. package/dist/commands/audit.js.map +0 -1
  50. package/dist/commands/auto.d.ts +0 -27
  51. package/dist/commands/auto.d.ts.map +0 -1
  52. package/dist/commands/auto.js +0 -498
  53. package/dist/commands/auto.js.map +0 -1
  54. package/dist/commands/bi-sync.d.ts +0 -50
  55. package/dist/commands/bi-sync.d.ts.map +0 -1
  56. package/dist/commands/bi-sync.js +0 -307
  57. package/dist/commands/bi-sync.js.map +0 -1
  58. package/dist/commands/chat.d.ts +0 -7
  59. package/dist/commands/chat.d.ts.map +0 -1
  60. package/dist/commands/chat.js +0 -415
  61. package/dist/commands/chat.js.map +0 -1
  62. package/dist/commands/check.d.ts +0 -31
  63. package/dist/commands/check.d.ts.map +0 -1
  64. package/dist/commands/check.js +0 -301
  65. package/dist/commands/check.js.map +0 -1
  66. package/dist/commands/clear.d.ts +0 -15
  67. package/dist/commands/clear.d.ts.map +0 -1
  68. package/dist/commands/clear.js +0 -167
  69. package/dist/commands/clear.js.map +0 -1
  70. package/dist/commands/compile.d.ts +0 -12
  71. package/dist/commands/compile.d.ts.map +0 -1
  72. package/dist/commands/compile.js +0 -51
  73. package/dist/commands/compile.js.map +0 -1
  74. package/dist/commands/conductor.d.ts +0 -15
  75. package/dist/commands/conductor.d.ts.map +0 -1
  76. package/dist/commands/conductor.js +0 -339
  77. package/dist/commands/conductor.js.map +0 -1
  78. package/dist/commands/convert.d.ts +0 -19
  79. package/dist/commands/convert.d.ts.map +0 -1
  80. package/dist/commands/convert.js +0 -99
  81. package/dist/commands/convert.js.map +0 -1
  82. package/dist/commands/credit.d.ts +0 -13
  83. package/dist/commands/credit.d.ts.map +0 -1
  84. package/dist/commands/credit.js +0 -149
  85. package/dist/commands/credit.js.map +0 -1
  86. package/dist/commands/cursor.d.ts +0 -13
  87. package/dist/commands/cursor.d.ts.map +0 -1
  88. package/dist/commands/cursor.js +0 -310
  89. package/dist/commands/cursor.js.map +0 -1
  90. package/dist/commands/decompile.d.ts +0 -9
  91. package/dist/commands/decompile.d.ts.map +0 -1
  92. package/dist/commands/decompile.js +0 -21
  93. package/dist/commands/decompile.js.map +0 -1
  94. package/dist/commands/demo.d.ts +0 -20
  95. package/dist/commands/demo.d.ts.map +0 -1
  96. package/dist/commands/demo.js +0 -205
  97. package/dist/commands/demo.js.map +0 -1
  98. package/dist/commands/doctor.d.ts +0 -6
  99. package/dist/commands/doctor.d.ts.map +0 -1
  100. package/dist/commands/doctor.js +0 -230
  101. package/dist/commands/doctor.js.map +0 -1
  102. package/dist/commands/drift.d.ts +0 -16
  103. package/dist/commands/drift.d.ts.map +0 -1
  104. package/dist/commands/drift.js +0 -524
  105. package/dist/commands/drift.js.map +0 -1
  106. package/dist/commands/edit-helper.d.ts +0 -6
  107. package/dist/commands/edit-helper.d.ts.map +0 -1
  108. package/dist/commands/edit-helper.js +0 -52
  109. package/dist/commands/edit-helper.js.map +0 -1
  110. package/dist/commands/edit.d.ts +0 -14
  111. package/dist/commands/edit.d.ts.map +0 -1
  112. package/dist/commands/edit.js +0 -196
  113. package/dist/commands/edit.js.map +0 -1
  114. package/dist/commands/enhance-real.d.ts +0 -18
  115. package/dist/commands/enhance-real.d.ts.map +0 -1
  116. package/dist/commands/enhance-real.js +0 -1164
  117. package/dist/commands/enhance-real.js.map +0 -1
  118. package/dist/commands/faf-auth.d.ts +0 -10
  119. package/dist/commands/faf-auth.d.ts.map +0 -1
  120. package/dist/commands/faf-auth.js +0 -162
  121. package/dist/commands/faf-auth.js.map +0 -1
  122. package/dist/commands/faf-dna.d.ts +0 -9
  123. package/dist/commands/faf-dna.d.ts.map +0 -1
  124. package/dist/commands/faf-dna.js +0 -141
  125. package/dist/commands/faf-dna.js.map +0 -1
  126. package/dist/commands/faf-log.d.ts +0 -9
  127. package/dist/commands/faf-log.d.ts.map +0 -1
  128. package/dist/commands/faf-log.js +0 -135
  129. package/dist/commands/faf-log.js.map +0 -1
  130. package/dist/commands/faf-recover.d.ts +0 -3
  131. package/dist/commands/faf-recover.d.ts.map +0 -1
  132. package/dist/commands/faf-recover.js +0 -296
  133. package/dist/commands/faf-recover.js.map +0 -1
  134. package/dist/commands/faf-update.d.ts +0 -9
  135. package/dist/commands/faf-update.d.ts.map +0 -1
  136. package/dist/commands/faf-update.js +0 -68
  137. package/dist/commands/faf-update.js.map +0 -1
  138. package/dist/commands/fam.d.ts +0 -15
  139. package/dist/commands/fam.d.ts.map +0 -1
  140. package/dist/commands/fam.js +0 -339
  141. package/dist/commands/fam.js.map +0 -1
  142. package/dist/commands/faq.d.ts +0 -12
  143. package/dist/commands/faq.d.ts.map +0 -1
  144. package/dist/commands/faq.js +0 -84
  145. package/dist/commands/faq.js.map +0 -1
  146. package/dist/commands/formats.d.ts +0 -12
  147. package/dist/commands/formats.d.ts.map +0 -1
  148. package/dist/commands/formats.js +0 -107
  149. package/dist/commands/formats.js.map +0 -1
  150. package/dist/commands/gemini.d.ts +0 -15
  151. package/dist/commands/gemini.d.ts.map +0 -1
  152. package/dist/commands/gemini.js +0 -357
  153. package/dist/commands/gemini.js.map +0 -1
  154. package/dist/commands/git.d.ts +0 -25
  155. package/dist/commands/git.d.ts.map +0 -1
  156. package/dist/commands/git.js +0 -365
  157. package/dist/commands/git.js.map +0 -1
  158. package/dist/commands/go.d.ts +0 -23
  159. package/dist/commands/go.d.ts.map +0 -1
  160. package/dist/commands/go.js +0 -283
  161. package/dist/commands/go.js.map +0 -1
  162. package/dist/commands/human.d.ts +0 -19
  163. package/dist/commands/human.d.ts.map +0 -1
  164. package/dist/commands/human.js +0 -204
  165. package/dist/commands/human.js.map +0 -1
  166. package/dist/commands/index.d.ts +0 -26
  167. package/dist/commands/index.d.ts.map +0 -1
  168. package/dist/commands/index.js +0 -438
  169. package/dist/commands/index.js.map +0 -1
  170. package/dist/commands/init.d.ts +0 -19
  171. package/dist/commands/init.d.ts.map +0 -1
  172. package/dist/commands/init.js +0 -409
  173. package/dist/commands/init.js.map +0 -1
  174. package/dist/commands/lint.d.ts +0 -11
  175. package/dist/commands/lint.d.ts.map +0 -1
  176. package/dist/commands/lint.js +0 -233
  177. package/dist/commands/lint.js.map +0 -1
  178. package/dist/commands/memory.d.ts +0 -14
  179. package/dist/commands/memory.d.ts.map +0 -1
  180. package/dist/commands/memory.js +0 -293
  181. package/dist/commands/memory.js.map +0 -1
  182. package/dist/commands/migrate.d.ts +0 -11
  183. package/dist/commands/migrate.d.ts.map +0 -1
  184. package/dist/commands/migrate.js +0 -85
  185. package/dist/commands/migrate.js.map +0 -1
  186. package/dist/commands/notifications.d.ts +0 -12
  187. package/dist/commands/notifications.d.ts.map +0 -1
  188. package/dist/commands/notifications.js +0 -35
  189. package/dist/commands/notifications.js.map +0 -1
  190. package/dist/commands/plugin-install.d.ts +0 -20
  191. package/dist/commands/plugin-install.d.ts.map +0 -1
  192. package/dist/commands/plugin-install.js +0 -183
  193. package/dist/commands/plugin-install.js.map +0 -1
  194. package/dist/commands/pro.d.ts +0 -10
  195. package/dist/commands/pro.d.ts.map +0 -1
  196. package/dist/commands/pro.js +0 -113
  197. package/dist/commands/pro.js.map +0 -1
  198. package/dist/commands/quick.d.ts +0 -10
  199. package/dist/commands/quick.d.ts.map +0 -1
  200. package/dist/commands/quick.js +0 -207
  201. package/dist/commands/quick.js.map +0 -1
  202. package/dist/commands/ram.d.ts +0 -17
  203. package/dist/commands/ram.d.ts.map +0 -1
  204. package/dist/commands/ram.js +0 -322
  205. package/dist/commands/ram.js.map +0 -1
  206. package/dist/commands/readme.d.ts +0 -21
  207. package/dist/commands/readme.d.ts.map +0 -1
  208. package/dist/commands/readme.js +0 -519
  209. package/dist/commands/readme.js.map +0 -1
  210. package/dist/commands/rename.d.ts +0 -18
  211. package/dist/commands/rename.d.ts.map +0 -1
  212. package/dist/commands/rename.js +0 -212
  213. package/dist/commands/rename.js.map +0 -1
  214. package/dist/commands/score-v3.d.ts +0 -15
  215. package/dist/commands/score-v3.d.ts.map +0 -1
  216. package/dist/commands/score-v3.js +0 -224
  217. package/dist/commands/score-v3.js.map +0 -1
  218. package/dist/commands/score.d.ts +0 -16
  219. package/dist/commands/score.d.ts.map +0 -1
  220. package/dist/commands/score.js +0 -19
  221. package/dist/commands/score.js.map +0 -1
  222. package/dist/commands/search.d.ts +0 -16
  223. package/dist/commands/search.d.ts.map +0 -1
  224. package/dist/commands/search.js +0 -174
  225. package/dist/commands/search.js.map +0 -1
  226. package/dist/commands/share.d.ts +0 -17
  227. package/dist/commands/share.d.ts.map +0 -1
  228. package/dist/commands/share.js +0 -261
  229. package/dist/commands/share.js.map +0 -1
  230. package/dist/commands/show.d.ts +0 -10
  231. package/dist/commands/show.d.ts.map +0 -1
  232. package/dist/commands/show.js +0 -142
  233. package/dist/commands/show.js.map +0 -1
  234. package/dist/commands/sixws.d.ts +0 -6
  235. package/dist/commands/sixws.d.ts.map +0 -1
  236. package/dist/commands/sixws.js +0 -154
  237. package/dist/commands/sixws.js.map +0 -1
  238. package/dist/commands/skills.d.ts +0 -8
  239. package/dist/commands/skills.d.ts.map +0 -1
  240. package/dist/commands/skills.js +0 -43
  241. package/dist/commands/skills.js.map +0 -1
  242. package/dist/commands/stacks.d.ts +0 -51
  243. package/dist/commands/stacks.d.ts.map +0 -1
  244. package/dist/commands/stacks.js +0 -180
  245. package/dist/commands/stacks.js.map +0 -1
  246. package/dist/commands/status.d.ts +0 -14
  247. package/dist/commands/status.d.ts.map +0 -1
  248. package/dist/commands/status.js +0 -210
  249. package/dist/commands/status.js.map +0 -1
  250. package/dist/commands/sync.d.ts +0 -11
  251. package/dist/commands/sync.d.ts.map +0 -1
  252. package/dist/commands/sync.js +0 -543
  253. package/dist/commands/sync.js.map +0 -1
  254. package/dist/commands/taf-init.d.ts +0 -14
  255. package/dist/commands/taf-init.d.ts.map +0 -1
  256. package/dist/commands/taf-init.js +0 -138
  257. package/dist/commands/taf-init.js.map +0 -1
  258. package/dist/commands/taf-log.d.ts +0 -31
  259. package/dist/commands/taf-log.d.ts.map +0 -1
  260. package/dist/commands/taf-log.js +0 -351
  261. package/dist/commands/taf-log.js.map +0 -1
  262. package/dist/commands/taf-stars.d.ts +0 -8
  263. package/dist/commands/taf-stars.d.ts.map +0 -1
  264. package/dist/commands/taf-stars.js +0 -105
  265. package/dist/commands/taf-stars.js.map +0 -1
  266. package/dist/commands/taf-stats.d.ts +0 -8
  267. package/dist/commands/taf-stats.d.ts.map +0 -1
  268. package/dist/commands/taf-stats.js +0 -133
  269. package/dist/commands/taf-stats.js.map +0 -1
  270. package/dist/commands/taf-validate.d.ts +0 -8
  271. package/dist/commands/taf-validate.d.ts.map +0 -1
  272. package/dist/commands/taf-validate.js +0 -108
  273. package/dist/commands/taf-validate.js.map +0 -1
  274. package/dist/commands/taf.d.ts +0 -14
  275. package/dist/commands/taf.d.ts.map +0 -1
  276. package/dist/commands/taf.js +0 -106
  277. package/dist/commands/taf.js.map +0 -1
  278. package/dist/commands/todo.d.ts +0 -14
  279. package/dist/commands/todo.d.ts.map +0 -1
  280. package/dist/commands/todo.js +0 -282
  281. package/dist/commands/todo.js.map +0 -1
  282. package/dist/commands/trust.d.ts +0 -33
  283. package/dist/commands/trust.d.ts.map +0 -1
  284. package/dist/commands/trust.js +0 -308
  285. package/dist/commands/trust.js.map +0 -1
  286. package/dist/commands/tsa.d.ts +0 -9
  287. package/dist/commands/tsa.d.ts.map +0 -1
  288. package/dist/commands/tsa.js +0 -60
  289. package/dist/commands/tsa.js.map +0 -1
  290. package/dist/commands/validate.d.ts +0 -11
  291. package/dist/commands/validate.d.ts.map +0 -1
  292. package/dist/commands/validate.js +0 -64
  293. package/dist/commands/validate.js.map +0 -1
  294. package/dist/commands/verify.d.ts +0 -36
  295. package/dist/commands/verify.d.ts.map +0 -1
  296. package/dist/commands/verify.js +0 -194
  297. package/dist/commands/verify.js.map +0 -1
  298. package/dist/commands/version.d.ts +0 -5
  299. package/dist/commands/version.d.ts.map +0 -1
  300. package/dist/commands/version.js +0 -29
  301. package/dist/commands/version.js.map +0 -1
  302. package/dist/commands/vibe.d.ts +0 -7
  303. package/dist/commands/vibe.d.ts.map +0 -1
  304. package/dist/commands/vibe.js +0 -73
  305. package/dist/commands/vibe.js.map +0 -1
  306. package/dist/commands/welcome.d.ts +0 -10
  307. package/dist/commands/welcome.d.ts.map +0 -1
  308. package/dist/commands/welcome.js +0 -117
  309. package/dist/commands/welcome.js.map +0 -1
  310. package/dist/commands/yolo.d.ts +0 -12
  311. package/dist/commands/yolo.d.ts.map +0 -1
  312. package/dist/commands/yolo.js +0 -212
  313. package/dist/commands/yolo.js.map +0 -1
  314. package/dist/compiler/faf-compiler.d.ts +0 -176
  315. package/dist/compiler/faf-compiler.d.ts.map +0 -1
  316. package/dist/compiler/faf-compiler.js +0 -1587
  317. package/dist/compiler/faf-compiler.js.map +0 -1
  318. package/dist/converters/faf-converters.d.ts +0 -43
  319. package/dist/converters/faf-converters.d.ts.map +0 -1
  320. package/dist/converters/faf-converters.js +0 -197
  321. package/dist/converters/faf-converters.js.map +0 -1
  322. package/dist/core-extraction-fixes.d.ts +0 -92
  323. package/dist/core-extraction-fixes.d.ts.map +0 -1
  324. package/dist/core-extraction-fixes.js +0 -265
  325. package/dist/core-extraction-fixes.js.map +0 -1
  326. package/dist/engines/art-ansi-renderer.d.ts +0 -335
  327. package/dist/engines/art-ansi-renderer.d.ts.map +0 -1
  328. package/dist/engines/art-ansi-renderer.js +0 -290
  329. package/dist/engines/art-ansi-renderer.js.map +0 -1
  330. package/dist/engines/c-mirror/broadcast/terminal-display.d.ts +0 -23
  331. package/dist/engines/c-mirror/broadcast/terminal-display.d.ts.map +0 -1
  332. package/dist/engines/c-mirror/broadcast/terminal-display.js +0 -194
  333. package/dist/engines/c-mirror/broadcast/terminal-display.js.map +0 -1
  334. package/dist/engines/c-mirror/core/claude-to-faf.d.ts +0 -28
  335. package/dist/engines/c-mirror/core/claude-to-faf.d.ts.map +0 -1
  336. package/dist/engines/c-mirror/core/claude-to-faf.js +0 -195
  337. package/dist/engines/c-mirror/core/claude-to-faf.js.map +0 -1
  338. package/dist/engines/c-mirror/core/events/event-emitter.d.ts +0 -36
  339. package/dist/engines/c-mirror/core/events/event-emitter.d.ts.map +0 -1
  340. package/dist/engines/c-mirror/core/events/event-emitter.js +0 -77
  341. package/dist/engines/c-mirror/core/events/event-emitter.js.map +0 -1
  342. package/dist/engines/c-mirror/core/events/mirror-events.d.ts +0 -103
  343. package/dist/engines/c-mirror/core/events/mirror-events.d.ts.map +0 -1
  344. package/dist/engines/c-mirror/core/events/mirror-events.js +0 -65
  345. package/dist/engines/c-mirror/core/events/mirror-events.js.map +0 -1
  346. package/dist/engines/c-mirror/core/faf-to-claude.d.ts +0 -18
  347. package/dist/engines/c-mirror/core/faf-to-claude.d.ts.map +0 -1
  348. package/dist/engines/c-mirror/core/faf-to-claude.js +0 -162
  349. package/dist/engines/c-mirror/core/faf-to-claude.js.map +0 -1
  350. package/dist/engines/c-mirror/core/interfaces.d.ts +0 -153
  351. package/dist/engines/c-mirror/core/interfaces.d.ts.map +0 -1
  352. package/dist/engines/c-mirror/core/interfaces.js +0 -8
  353. package/dist/engines/c-mirror/core/interfaces.js.map +0 -1
  354. package/dist/engines/c-mirror/core/mirror-engine.d.ts +0 -49
  355. package/dist/engines/c-mirror/core/mirror-engine.d.ts.map +0 -1
  356. package/dist/engines/c-mirror/core/mirror-engine.js +0 -315
  357. package/dist/engines/c-mirror/core/mirror-engine.js.map +0 -1
  358. package/dist/engines/c-mirror/faf-extensions/faf-mirror.d.ts +0 -33
  359. package/dist/engines/c-mirror/faf-extensions/faf-mirror.d.ts.map +0 -1
  360. package/dist/engines/c-mirror/faf-extensions/faf-mirror.js +0 -115
  361. package/dist/engines/c-mirror/faf-extensions/faf-mirror.js.map +0 -1
  362. package/dist/engines/c-mirror/strategies/atomic-write.d.ts +0 -34
  363. package/dist/engines/c-mirror/strategies/atomic-write.d.ts.map +0 -1
  364. package/dist/engines/c-mirror/strategies/atomic-write.js +0 -132
  365. package/dist/engines/c-mirror/strategies/atomic-write.js.map +0 -1
  366. package/dist/engines/claude-todo-engine.d.ts +0 -115
  367. package/dist/engines/claude-todo-engine.d.ts.map +0 -1
  368. package/dist/engines/claude-todo-engine.js +0 -346
  369. package/dist/engines/claude-todo-engine.js.map +0 -1
  370. package/dist/engines/dependency-tsa.d.ts +0 -89
  371. package/dist/engines/dependency-tsa.d.ts.map +0 -1
  372. package/dist/engines/dependency-tsa.js +0 -365
  373. package/dist/engines/dependency-tsa.js.map +0 -1
  374. package/dist/engines/drop-coach.d.ts +0 -64
  375. package/dist/engines/drop-coach.d.ts.map +0 -1
  376. package/dist/engines/drop-coach.js +0 -222
  377. package/dist/engines/drop-coach.js.map +0 -1
  378. package/dist/engines/execution-context.d.ts +0 -75
  379. package/dist/engines/execution-context.d.ts.map +0 -1
  380. package/dist/engines/execution-context.js +0 -308
  381. package/dist/engines/execution-context.js.map +0 -1
  382. package/dist/engines/fab-formats-processor.d.ts +0 -179
  383. package/dist/engines/fab-formats-processor.d.ts.map +0 -1
  384. package/dist/engines/fab-formats-processor.js +0 -1524
  385. package/dist/engines/fab-formats-processor.js.map +0 -1
  386. package/dist/engines/faf-dna.d.ts +0 -160
  387. package/dist/engines/faf-dna.d.ts.map +0 -1
  388. package/dist/engines/faf-dna.js +0 -547
  389. package/dist/engines/faf-dna.js.map +0 -1
  390. package/dist/engines/relentless-context-extractor.d.ts +0 -105
  391. package/dist/engines/relentless-context-extractor.d.ts.map +0 -1
  392. package/dist/engines/relentless-context-extractor.js +0 -698
  393. package/dist/engines/relentless-context-extractor.js.map +0 -1
  394. package/dist/engines/v252-hybrid-engine.d.ts +0 -60
  395. package/dist/engines/v252-hybrid-engine.d.ts.map +0 -1
  396. package/dist/engines/v252-hybrid-engine.js +0 -290
  397. package/dist/engines/v252-hybrid-engine.js.map +0 -1
  398. package/dist/family/detectors/n8n.d.ts +0 -10
  399. package/dist/family/detectors/n8n.d.ts.map +0 -1
  400. package/dist/family/detectors/n8n.js +0 -102
  401. package/dist/family/detectors/n8n.js.map +0 -1
  402. package/dist/family/detectors/next.d.ts +0 -8
  403. package/dist/family/detectors/next.d.ts.map +0 -1
  404. package/dist/family/detectors/next.js +0 -106
  405. package/dist/family/detectors/next.js.map +0 -1
  406. package/dist/family/detectors/react.d.ts +0 -8
  407. package/dist/family/detectors/react.d.ts.map +0 -1
  408. package/dist/family/detectors/react.js +0 -85
  409. package/dist/family/detectors/react.js.map +0 -1
  410. package/dist/family/detectors/svelte.d.ts +0 -8
  411. package/dist/family/detectors/svelte.d.ts.map +0 -1
  412. package/dist/family/detectors/svelte.js +0 -102
  413. package/dist/family/detectors/svelte.js.map +0 -1
  414. package/dist/family/detectors/typescript.d.ts +0 -8
  415. package/dist/family/detectors/typescript.d.ts.map +0 -1
  416. package/dist/family/detectors/typescript.js +0 -112
  417. package/dist/family/detectors/typescript.js.map +0 -1
  418. package/dist/family/detectors/vite.d.ts +0 -8
  419. package/dist/family/detectors/vite.d.ts.map +0 -1
  420. package/dist/family/detectors/vite.js +0 -97
  421. package/dist/family/detectors/vite.js.map +0 -1
  422. package/dist/family/index.d.ts +0 -21
  423. package/dist/family/index.d.ts.map +0 -1
  424. package/dist/family/index.js +0 -73
  425. package/dist/family/index.js.map +0 -1
  426. package/dist/family/registry.d.ts +0 -57
  427. package/dist/family/registry.d.ts.map +0 -1
  428. package/dist/family/registry.js +0 -156
  429. package/dist/family/registry.js.map +0 -1
  430. package/dist/family/types.d.ts +0 -102
  431. package/dist/family/types.d.ts.map +0 -1
  432. package/dist/family/types.js +0 -8
  433. package/dist/family/types.js.map +0 -1
  434. package/dist/fix-once/colors.d.ts +0 -105
  435. package/dist/fix-once/colors.d.ts.map +0 -1
  436. package/dist/fix-once/colors.js +0 -248
  437. package/dist/fix-once/colors.js.map +0 -1
  438. package/dist/fix-once/commander.d.ts +0 -18
  439. package/dist/fix-once/commander.d.ts.map +0 -1
  440. package/dist/fix-once/commander.js +0 -25
  441. package/dist/fix-once/commander.js.map +0 -1
  442. package/dist/fix-once/types.d.ts +0 -258
  443. package/dist/fix-once/types.d.ts.map +0 -1
  444. package/dist/fix-once/types.js +0 -26
  445. package/dist/fix-once/types.js.map +0 -1
  446. package/dist/fix-once/yaml.d.ts +0 -58
  447. package/dist/fix-once/yaml.d.ts.map +0 -1
  448. package/dist/fix-once/yaml.js +0 -172
  449. package/dist/fix-once/yaml.js.map +0 -1
  450. package/dist/framework-detector.d.ts +0 -307
  451. package/dist/framework-detector.d.ts.map +0 -1
  452. package/dist/framework-detector.js +0 -951
  453. package/dist/framework-detector.js.map +0 -1
  454. package/dist/generators/faf-generator-championship.d.ts +0 -17
  455. package/dist/generators/faf-generator-championship.d.ts.map +0 -1
  456. package/dist/generators/faf-generator-championship.js +0 -612
  457. package/dist/generators/faf-generator-championship.js.map +0 -1
  458. package/dist/github/current-score-calculator.d.ts +0 -15
  459. package/dist/github/current-score-calculator.d.ts.map +0 -1
  460. package/dist/github/current-score-calculator.js +0 -125
  461. package/dist/github/current-score-calculator.js.map +0 -1
  462. package/dist/github/faf-git-generator.d.ts +0 -52
  463. package/dist/github/faf-git-generator.d.ts.map +0 -1
  464. package/dist/github/faf-git-generator.js +0 -527
  465. package/dist/github/faf-git-generator.js.map +0 -1
  466. package/dist/github/github-extractor.d.ts +0 -60
  467. package/dist/github/github-extractor.d.ts.map +0 -1
  468. package/dist/github/github-extractor.js +0 -381
  469. package/dist/github/github-extractor.js.map +0 -1
  470. package/dist/github/popular-repos.d.ts +0 -43
  471. package/dist/github/popular-repos.d.ts.map +0 -1
  472. package/dist/github/popular-repos.js +0 -205
  473. package/dist/github/popular-repos.js.map +0 -1
  474. package/dist/github/repo-selector.d.ts +0 -48
  475. package/dist/github/repo-selector.d.ts.map +0 -1
  476. package/dist/github/repo-selector.js +0 -297
  477. package/dist/github/repo-selector.js.map +0 -1
  478. package/dist/index.d.ts +0 -20
  479. package/dist/index.d.ts.map +0 -1
  480. package/dist/index.js.map +0 -1
  481. package/dist/licensing/license-messages.d.ts +0 -20
  482. package/dist/licensing/license-messages.d.ts.map +0 -1
  483. package/dist/licensing/license-messages.js +0 -77
  484. package/dist/licensing/license-messages.js.map +0 -1
  485. package/dist/licensing/pro-gate.d.ts +0 -54
  486. package/dist/licensing/pro-gate.d.ts.map +0 -1
  487. package/dist/licensing/pro-gate.js +0 -243
  488. package/dist/licensing/pro-gate.js.map +0 -1
  489. package/dist/output/experience-manager.d.ts +0 -58
  490. package/dist/output/experience-manager.d.ts.map +0 -1
  491. package/dist/output/experience-manager.js +0 -215
  492. package/dist/output/experience-manager.js.map +0 -1
  493. package/dist/schema/faf-schema.d.ts +0 -97
  494. package/dist/schema/faf-schema.d.ts.map +0 -1
  495. package/dist/schema/faf-schema.js +0 -173
  496. package/dist/schema/faf-schema.js.map +0 -1
  497. package/dist/smart-faf.d.ts +0 -68
  498. package/dist/smart-faf.d.ts.map +0 -1
  499. package/dist/smart-faf.js +0 -400
  500. package/dist/smart-faf.js.map +0 -1
  501. package/dist/systems/question-system.d.ts +0 -122
  502. package/dist/systems/question-system.d.ts.map +0 -1
  503. package/dist/systems/question-system.js +0 -413
  504. package/dist/systems/question-system.js.map +0 -1
  505. package/dist/taf/index.d.ts +0 -21
  506. package/dist/taf/index.d.ts.map +0 -1
  507. package/dist/taf/index.js +0 -72
  508. package/dist/taf/index.js.map +0 -1
  509. package/dist/taf/logger.d.ts +0 -88
  510. package/dist/taf/logger.d.ts.map +0 -1
  511. package/dist/taf/logger.js +0 -137
  512. package/dist/taf/logger.js.map +0 -1
  513. package/dist/taf/parser.d.ts +0 -32
  514. package/dist/taf/parser.d.ts.map +0 -1
  515. package/dist/taf/parser.js +0 -161
  516. package/dist/taf/parser.js.map +0 -1
  517. package/dist/taf/star-badge.d.ts +0 -32
  518. package/dist/taf/star-badge.d.ts.map +0 -1
  519. package/dist/taf/star-badge.js +0 -158
  520. package/dist/taf/star-badge.js.map +0 -1
  521. package/dist/taf/star-rating.d.ts +0 -30
  522. package/dist/taf/star-rating.d.ts.map +0 -1
  523. package/dist/taf/star-rating.js +0 -79
  524. package/dist/taf/star-rating.js.map +0 -1
  525. package/dist/taf/stats.d.ts +0 -31
  526. package/dist/taf/stats.d.ts.map +0 -1
  527. package/dist/taf/stats.js +0 -190
  528. package/dist/taf/stats.js.map +0 -1
  529. package/dist/taf/test-output-parser.d.ts +0 -42
  530. package/dist/taf/test-output-parser.d.ts.map +0 -1
  531. package/dist/taf/test-output-parser.js +0 -127
  532. package/dist/taf/test-output-parser.js.map +0 -1
  533. package/dist/taf/types.d.ts +0 -77
  534. package/dist/taf/types.d.ts.map +0 -1
  535. package/dist/taf/types.js +0 -9
  536. package/dist/taf/types.js.map +0 -1
  537. package/dist/taf/validator.d.ts +0 -18
  538. package/dist/taf/validator.d.ts.map +0 -1
  539. package/dist/taf/validator.js +0 -148
  540. package/dist/taf/validator.js.map +0 -1
  541. package/dist/telemetry/analytics.d.ts +0 -74
  542. package/dist/telemetry/analytics.d.ts.map +0 -1
  543. package/dist/telemetry/analytics.js +0 -370
  544. package/dist/telemetry/analytics.js.map +0 -1
  545. package/dist/tests/test-chrome-fuzzy.d.ts +0 -5
  546. package/dist/tests/test-chrome-fuzzy.d.ts.map +0 -1
  547. package/dist/tests/test-chrome-fuzzy.js +0 -68
  548. package/dist/tests/test-chrome-fuzzy.js.map +0 -1
  549. package/dist/types/faf-types.d.ts +0 -144
  550. package/dist/types/faf-types.d.ts.map +0 -1
  551. package/dist/types/faf-types.js +0 -21
  552. package/dist/types/faf-types.js.map +0 -1
  553. package/dist/types/index.d.ts +0 -36
  554. package/dist/types/index.d.ts.map +0 -1
  555. package/dist/types/index.js +0 -7
  556. package/dist/types/index.js.map +0 -1
  557. package/dist/utils/agents-parser.d.ts +0 -60
  558. package/dist/utils/agents-parser.d.ts.map +0 -1
  559. package/dist/utils/agents-parser.js +0 -339
  560. package/dist/utils/agents-parser.js.map +0 -1
  561. package/dist/utils/announcements.d.ts +0 -16
  562. package/dist/utils/announcements.d.ts.map +0 -1
  563. package/dist/utils/announcements.js +0 -131
  564. package/dist/utils/announcements.js.map +0 -1
  565. package/dist/utils/balance-visualizer.d.ts +0 -38
  566. package/dist/utils/balance-visualizer.d.ts.map +0 -1
  567. package/dist/utils/balance-visualizer.js +0 -190
  568. package/dist/utils/balance-visualizer.js.map +0 -1
  569. package/dist/utils/championship-core.d.ts +0 -127
  570. package/dist/utils/championship-core.d.ts.map +0 -1
  571. package/dist/utils/championship-core.js +0 -212
  572. package/dist/utils/championship-core.js.map +0 -1
  573. package/dist/utils/championship-style.d.ts +0 -110
  574. package/dist/utils/championship-style.d.ts.map +0 -1
  575. package/dist/utils/championship-style.js +0 -219
  576. package/dist/utils/championship-style.js.map +0 -1
  577. package/dist/utils/chrome-extension-confirmer.d.ts +0 -41
  578. package/dist/utils/chrome-extension-confirmer.d.ts.map +0 -1
  579. package/dist/utils/chrome-extension-confirmer.js +0 -203
  580. package/dist/utils/chrome-extension-confirmer.js.map +0 -1
  581. package/dist/utils/chrome-extension-detector.d.ts +0 -74
  582. package/dist/utils/chrome-extension-detector.d.ts.map +0 -1
  583. package/dist/utils/chrome-extension-detector.js +0 -268
  584. package/dist/utils/chrome-extension-detector.js.map +0 -1
  585. package/dist/utils/color-utils.d.ts +0 -17
  586. package/dist/utils/color-utils.d.ts.map +0 -1
  587. package/dist/utils/color-utils.js +0 -112
  588. package/dist/utils/color-utils.js.map +0 -1
  589. package/dist/utils/conductor-parser.d.ts +0 -86
  590. package/dist/utils/conductor-parser.d.ts.map +0 -1
  591. package/dist/utils/conductor-parser.js +0 -293
  592. package/dist/utils/conductor-parser.js.map +0 -1
  593. package/dist/utils/cursorrules-parser.d.ts +0 -56
  594. package/dist/utils/cursorrules-parser.d.ts.map +0 -1
  595. package/dist/utils/cursorrules-parser.js +0 -327
  596. package/dist/utils/cursorrules-parser.js.map +0 -1
  597. package/dist/utils/email-opt-in.d.ts +0 -31
  598. package/dist/utils/email-opt-in.d.ts.map +0 -1
  599. package/dist/utils/email-opt-in.js +0 -199
  600. package/dist/utils/email-opt-in.js.map +0 -1
  601. package/dist/utils/fab-formats-engine.d.ts +0 -83
  602. package/dist/utils/fab-formats-engine.d.ts.map +0 -1
  603. package/dist/utils/fab-formats-engine.js +0 -502
  604. package/dist/utils/fab-formats-engine.js.map +0 -1
  605. package/dist/utils/fafb-compiler.d.ts +0 -62
  606. package/dist/utils/fafb-compiler.d.ts.map +0 -1
  607. package/dist/utils/fafb-compiler.js +0 -225
  608. package/dist/utils/fafb-compiler.js.map +0 -1
  609. package/dist/utils/fafb-detector.d.ts +0 -26
  610. package/dist/utils/fafb-detector.d.ts.map +0 -1
  611. package/dist/utils/fafb-detector.js +0 -180
  612. package/dist/utils/fafb-detector.js.map +0 -1
  613. package/dist/utils/fafignore-parser.d.ts +0 -21
  614. package/dist/utils/fafignore-parser.d.ts.map +0 -1
  615. package/dist/utils/fafignore-parser.js +0 -178
  616. package/dist/utils/fafignore-parser.js.map +0 -1
  617. package/dist/utils/feedback-messages.d.ts +0 -13
  618. package/dist/utils/feedback-messages.d.ts.map +0 -1
  619. package/dist/utils/feedback-messages.js +0 -118
  620. package/dist/utils/feedback-messages.js.map +0 -1
  621. package/dist/utils/file-utils.d.ts +0 -113
  622. package/dist/utils/file-utils.d.ts.map +0 -1
  623. package/dist/utils/file-utils.js +0 -949
  624. package/dist/utils/file-utils.js.map +0 -1
  625. package/dist/utils/gemini-parser.d.ts +0 -58
  626. package/dist/utils/gemini-parser.d.ts.map +0 -1
  627. package/dist/utils/gemini-parser.js +0 -263
  628. package/dist/utils/gemini-parser.js.map +0 -1
  629. package/dist/utils/markdown-to-context.d.ts +0 -28
  630. package/dist/utils/markdown-to-context.d.ts.map +0 -1
  631. package/dist/utils/markdown-to-context.js +0 -206
  632. package/dist/utils/markdown-to-context.js.map +0 -1
  633. package/dist/utils/memory-parser.d.ts +0 -95
  634. package/dist/utils/memory-parser.d.ts.map +0 -1
  635. package/dist/utils/memory-parser.js +0 -408
  636. package/dist/utils/memory-parser.js.map +0 -1
  637. package/dist/utils/memory-topic-writer.d.ts +0 -52
  638. package/dist/utils/memory-topic-writer.d.ts.map +0 -1
  639. package/dist/utils/memory-topic-writer.js +0 -415
  640. package/dist/utils/memory-topic-writer.js.map +0 -1
  641. package/dist/utils/native-cli-parser.d.ts +0 -152
  642. package/dist/utils/native-cli-parser.d.ts.map +0 -1
  643. package/dist/utils/native-cli-parser.js +0 -466
  644. package/dist/utils/native-cli-parser.js.map +0 -1
  645. package/dist/utils/native-file-finder.d.ts +0 -116
  646. package/dist/utils/native-file-finder.d.ts.map +0 -1
  647. package/dist/utils/native-file-finder.js +0 -211
  648. package/dist/utils/native-file-finder.js.map +0 -1
  649. package/dist/utils/platform-detector.d.ts +0 -31
  650. package/dist/utils/platform-detector.d.ts.map +0 -1
  651. package/dist/utils/platform-detector.js +0 -220
  652. package/dist/utils/platform-detector.js.map +0 -1
  653. package/dist/utils/score-header.d.ts +0 -22
  654. package/dist/utils/score-header.d.ts.map +0 -1
  655. package/dist/utils/score-header.js +0 -88
  656. package/dist/utils/score-header.js.map +0 -1
  657. package/dist/utils/slot-counter.d.ts +0 -56
  658. package/dist/utils/slot-counter.d.ts.map +0 -1
  659. package/dist/utils/slot-counter.js +0 -100
  660. package/dist/utils/slot-counter.js.map +0 -1
  661. package/dist/utils/technical-credit.d.ts +0 -36
  662. package/dist/utils/technical-credit.d.ts.map +0 -1
  663. package/dist/utils/technical-credit.js +0 -286
  664. package/dist/utils/technical-credit.js.map +0 -1
  665. package/dist/utils/trust-cache.d.ts +0 -29
  666. package/dist/utils/trust-cache.d.ts.map +0 -1
  667. package/dist/utils/trust-cache.js +0 -122
  668. package/dist/utils/trust-cache.js.map +0 -1
  669. package/dist/utils/turbo-cat-knowledge.d.ts +0 -105
  670. package/dist/utils/turbo-cat-knowledge.d.ts.map +0 -1
  671. package/dist/utils/turbo-cat-knowledge.js +0 -1941
  672. package/dist/utils/turbo-cat-knowledge.js.map +0 -1
  673. package/dist/utils/turbo-cat-pyramid.d.ts +0 -48
  674. package/dist/utils/turbo-cat-pyramid.d.ts.map +0 -1
  675. package/dist/utils/turbo-cat-pyramid.js +0 -380
  676. package/dist/utils/turbo-cat-pyramid.js.map +0 -1
  677. package/dist/utils/turbo-cat.d.ts +0 -99
  678. package/dist/utils/turbo-cat.d.ts.map +0 -1
  679. package/dist/utils/turbo-cat.js +0 -456
  680. package/dist/utils/turbo-cat.js.map +0 -1
  681. package/dist/utils/universal-fuzzy-detector.d.ts +0 -64
  682. package/dist/utils/universal-fuzzy-detector.d.ts.map +0 -1
  683. package/dist/utils/universal-fuzzy-detector.js +0 -386
  684. package/dist/utils/universal-fuzzy-detector.js.map +0 -1
  685. package/dist/utils/update-checker.d.ts +0 -15
  686. package/dist/utils/update-checker.d.ts.map +0 -1
  687. package/dist/utils/update-checker.js +0 -200
  688. package/dist/utils/update-checker.js.map +0 -1
  689. package/dist/utils/vibe-sync.d.ts +0 -25
  690. package/dist/utils/vibe-sync.d.ts.map +0 -1
  691. package/dist/utils/vibe-sync.js +0 -175
  692. package/dist/utils/vibe-sync.js.map +0 -1
  693. package/dist/utils/yaml-generator.d.ts +0 -52
  694. package/dist/utils/yaml-generator.d.ts.map +0 -1
  695. package/dist/utils/yaml-generator.js +0 -432
  696. package/dist/utils/yaml-generator.js.map +0 -1
  697. package/faf-banner.png +0 -0
  698. package/scripts/ANTHROPIC-DEMO.sh +0 -203
  699. package/scripts/boris-ready.sh +0 -169
  700. package/scripts/bundle-yaml.js +0 -87
  701. package/scripts/check-version.js +0 -88
  702. package/scripts/clean-build.js +0 -34
  703. package/scripts/cleanup-unused.sh +0 -54
  704. package/scripts/debug-django.txt +0 -9
  705. package/scripts/debug-mongo.txt +0 -9
  706. package/scripts/debug-react.txt +0 -9
  707. package/scripts/debug-rust.txt +0 -9
  708. package/scripts/debug-whisper.cpp.txt +0 -9
  709. package/scripts/evaluate-family-member.ts +0 -300
  710. package/scripts/generate-docs.ts +0 -358
  711. package/scripts/generate-drift-reports.sh +0 -111
  712. package/scripts/industry-showcase.json +0 -122
  713. package/scripts/mcp-ecosystem-research.sh +0 -58
  714. package/scripts/migrate-yaml-imports.sh +0 -55
  715. package/scripts/migrate-yaml.ts +0 -132
  716. package/scripts/performance-validation.ts +0 -460
  717. package/scripts/postinstall.js +0 -30
  718. package/scripts/prepare-release.ts +0 -421
  719. package/scripts/run-industry-showcase.ts +0 -237
  720. package/scripts/run-test-showcase.ts +0 -244
  721. package/scripts/setup-github-watch.sh +0 -43
  722. package/scripts/sync-version.js +0 -35
  723. package/scripts/test-integration-detection.ts +0 -93
  724. package/scripts/test-integration-simple.js +0 -93
  725. package/scripts/test-medal-progression.sh +0 -143
  726. package/scripts/test-showcase-results.json +0 -109
  727. package/scripts/test-showcase.json +0 -32
  728. package/scripts/update-version.js +0 -148
  729. package/scripts/verify-build.js +0 -343
  730. package/scripts/version-check.js +0 -78
  731. package/scripts/watch-discussions.sh +0 -86
package/dist/cli.js CHANGED
@@ -1,1887 +1,316 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- /**
4
- * 🚀 .faf CLI - Command Line Interface
5
- * Universal AI Context Format Tooling
6
- */
7
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
- if (k2 === undefined) k2 = k;
9
- var desc = Object.getOwnPropertyDescriptor(m, k);
10
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
- desc = { enumerable: true, get: function() { return m[k]; } };
12
- }
13
- Object.defineProperty(o, k2, desc);
14
- }) : (function(o, m, k, k2) {
15
- if (k2 === undefined) k2 = k;
16
- o[k2] = m[k];
17
- }));
18
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
19
- Object.defineProperty(o, "default", { enumerable: true, value: v });
20
- }) : function(o, v) {
21
- o["default"] = v;
22
- });
23
- var __importStar = (this && this.__importStar) || (function () {
24
- var ownKeys = function(o) {
25
- ownKeys = Object.getOwnPropertyNames || function (o) {
26
- var ar = [];
27
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
28
- return ar;
29
- };
30
- return ownKeys(o);
31
- };
32
- return function (mod) {
33
- if (mod && mod.__esModule) return mod;
34
- var result = {};
35
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
36
- __setModuleDefault(result, mod);
37
- return result;
38
- };
39
- })();
40
- var __importDefault = (this && this.__importDefault) || function (mod) {
41
- return (mod && mod.__esModule) ? mod : { "default": mod };
42
- };
43
- Object.defineProperty(exports, "__esModule", { value: true });
44
- exports.program = void 0;
45
- const commander_1 = require("./fix-once/commander");
46
- Object.defineProperty(exports, "program", { enumerable: true, get: function () { return commander_1.program; } });
47
- const colors_1 = require("./fix-once/colors");
48
- const inquirer_1 = __importDefault(require("inquirer"));
49
- const validate_1 = require("./commands/validate");
50
- const init_1 = require("./commands/init");
51
- const score_1 = require("./commands/score");
52
- const show_1 = require("./commands/show");
53
- const edit_helper_1 = require("./commands/edit-helper");
54
- const auto_1 = require("./commands/auto");
55
- const go_1 = require("./commands/go");
56
- const yolo_1 = require("./commands/yolo");
57
- const formats_1 = require("./commands/formats");
58
- const version_1 = require("./commands/version");
59
- const sync_1 = require("./commands/sync");
60
- const audit_1 = require("./commands/audit");
61
- const lint_1 = require("./commands/lint");
62
- const enhance_real_1 = require("./commands/enhance-real");
63
- const ai_analyze_1 = require("./commands/ai-analyze");
64
- const trust_1 = require("./commands/trust");
65
- const status_1 = require("./commands/status");
66
- const verify_1 = require("./commands/verify");
67
- const stacks_1 = require("./commands/stacks");
68
- const bi_sync_1 = require("./commands/bi-sync");
69
- const credit_1 = require("./commands/credit");
70
- const todo_1 = require("./commands/todo");
71
- const check_1 = require("./commands/check");
72
- const clear_1 = require("./commands/clear");
73
- const fam_1 = require("./commands/fam");
74
- const edit_1 = require("./commands/edit");
75
- const search_1 = require("./commands/search");
76
- const index_1 = require("./commands/index");
77
- const share_1 = require("./commands/share");
78
- const chat_1 = require("./commands/chat");
79
- const convert_1 = require("./commands/convert");
80
- const notifications_1 = require("./commands/notifications");
81
- const skills_1 = require("./commands/skills");
82
- const demo_1 = require("./commands/demo");
83
- const drift_1 = require("./commands/drift");
84
- const git_1 = require("./commands/git");
85
- const taf_1 = require("./commands/taf");
86
- const conductor_1 = require("./commands/conductor");
87
- const gemini_1 = require("./commands/gemini");
88
- const antigravity_1 = require("./commands/antigravity");
89
- const agents_1 = require("./commands/agents");
90
- const cursor_1 = require("./commands/cursor");
91
- const ram_1 = require("./commands/ram");
92
- const pro_1 = require("./commands/pro");
93
- const pro_gate_1 = require("./licensing/pro-gate");
94
- const migrate_1 = require("./commands/migrate");
95
- const rename_1 = require("./commands/rename");
96
- const readme_1 = require("./commands/readme");
97
- const human_1 = require("./commands/human");
98
- const sixws_1 = require("./commands/sixws");
99
- const plugin_install_1 = require("./commands/plugin-install");
100
- // FAFb Commands — WASM kernel (no external binary needed)
101
- const compile_1 = require("./commands/compile");
102
- const decompile_1 = require("./commands/decompile");
103
- const color_utils_1 = require("./utils/color-utils");
104
- const championship_style_1 = require("./utils/championship-style");
105
- const analytics_1 = require("./telemetry/analytics");
106
- const update_checker_1 = require("./utils/update-checker");
107
- const announcements_1 = require("./utils/announcements");
108
- const version = require('../package.json').version;
109
- /**
110
- * Analytics tracking wrapper for commands
111
- */
112
- function withAnalyticsTracking(commandName, fn) {
113
- return (async (...args) => {
114
- const start = Date.now();
115
- const commandArgs = process.argv.slice(2);
116
- try {
117
- const result = await fn(...args);
118
- const duration = Date.now() - start;
119
- await (0, analytics_1.trackCommand)(commandName, commandArgs, duration, true);
120
- return result;
121
- }
122
- catch (error) {
123
- const duration = Date.now() - start;
124
- await (0, analytics_1.trackCommand)(commandName, commandArgs, duration, false);
125
- await (0, analytics_1.trackError)(error, commandName, commandArgs);
126
- throw error;
127
- }
128
- });
129
- }
130
- function showHeaderIfAppropriate(commandName) {
131
- // Check for quiet mode
132
- const opts = commander_1.program.opts();
133
- if (opts.quiet) {
134
- return; // Skip header in quiet mode
135
- }
136
- const showHeaderCommands = ['help', 'clear', 'enhance', 'analyze', 'chat', 'formats', 'version'];
137
- if (!commandName || showHeaderCommands.includes(commandName)) {
138
- console.log((0, championship_style_1.generateFAFHeader)());
139
- }
140
- }
141
- commander_1.program
142
- .name('faf')
143
- .description('.faf = Project DNA for ANY AI | Foundational AI-context Format | SPEEDY AI you can TRUST! 🧡⚡️')
144
- .version(version)
145
- .option('--no-color', 'Disable colored output for accessibility')
146
- .option('--color-scheme <scheme>', 'Color scheme for colorblind accessibility: normal|deuteranopia|protanopia|tritanopia', 'normal')
147
- .option('-q, --quiet', 'Quiet mode - minimal output, no ASCII banners (AI/Codex mode)')
148
- .option('--auto', 'Auto mode - menu-driven interface for learning and exploration')
149
- .option('--manual', 'Manual mode - direct command-line interface for power users')
150
- .addHelpText('after', `
151
- ${championship_style_1.FAF_COLORS.fafOrange('💡 In Terminal:')} Use ${colors_1.chalk.cyan('faf')} prefix - like ${colors_1.chalk.cyan('faf init')}, ${colors_1.chalk.cyan('faf faq')}
2
+ import{createRequire as gJ}from"node:module";var jJ=Object.create;var{getPrototypeOf:bJ,defineProperty:n2,getOwnPropertyNames:xJ}=Object;var kJ=Object.prototype.hasOwnProperty;var fJ=($,Z,X)=>{X=$!=null?jJ(bJ($)):{};let z=Z||!$||!$.__esModule?n2(X,"default",{value:$,enumerable:!0}):X;for(let J of xJ($))if(!kJ.call(z,J))n2(z,J,{get:()=>$[J],enumerable:!0});return z};var T=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var yJ=($,Z)=>{for(var X in Z)n2($,X,{get:Z[X],enumerable:!0,configurable:!0,set:(z)=>Z[X]=()=>z})};var j=($,Z)=>()=>($&&(Z=$($=0)),Z);var z0=gJ(import.meta.url);var Q6=T((hJ)=>{class s2 extends Error{constructor($,Z,X){super(X);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=Z,this.exitCode=$,this.nestedError=void 0}}class y5 extends s2{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}hJ.CommanderError=s2;hJ.InvalidArgumentError=y5});var M8=T((cJ)=>{var{InvalidArgumentError:mJ}=Q6();class g5{constructor($,Z){switch(this.description=Z||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,$[0]){case"<":this.required=!0,this._name=$.slice(1,-1);break;case"[":this.required=!1,this._name=$.slice(1,-1);break;default:this.required=!0,this._name=$;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue($,Z){if(Z===this.defaultValue||!Array.isArray(Z))return[$];return Z.push($),Z}default($,Z){return this.defaultValue=$,this.defaultValueDescription=Z,this}argParser($){return this.parseArg=$,this}choices($){return this.argChoices=$.slice(),this.parseArg=(Z,X)=>{if(!this.argChoices.includes(Z))throw new mJ(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Z,X);return Z},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function dJ($){let Z=$.name()+($.variadic===!0?"...":"");return $.required?"<"+Z+">":"["+Z+"]"}cJ.Argument=g5;cJ.humanReadableArgName=dJ});var r2=T((nJ)=>{var{humanReadableArgName:iJ}=M8();class h5{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext($){this.helpWidth=this.helpWidth??$.helpWidth??80}visibleCommands($){let Z=$.commands.filter((z)=>!z._hidden),X=$._getHelpCommand();if(X&&!X._hidden)Z.push(X);if(this.sortSubcommands)Z.sort((z,J)=>{return z.name().localeCompare(J.name())});return Z}compareOptions($,Z){let X=(z)=>{return z.short?z.short.replace(/^-/,""):z.long.replace(/^--/,"")};return X($).localeCompare(X(Z))}visibleOptions($){let Z=$.options.filter((z)=>!z.hidden),X=$._getHelpOption();if(X&&!X.hidden){let z=X.short&&$._findOption(X.short),J=X.long&&$._findOption(X.long);if(!z&&!J)Z.push(X);else if(X.long&&!J)Z.push($.createOption(X.long,X.description));else if(X.short&&!z)Z.push($.createOption(X.short,X.description))}if(this.sortOptions)Z.sort(this.compareOptions);return Z}visibleGlobalOptions($){if(!this.showGlobalOptions)return[];let Z=[];for(let X=$.parent;X;X=X.parent){let z=X.options.filter((J)=>!J.hidden);Z.push(...z)}if(this.sortOptions)Z.sort(this.compareOptions);return Z}visibleArguments($){if($._argsDescription)$.registeredArguments.forEach((Z)=>{Z.description=Z.description||$._argsDescription[Z.name()]||""});if($.registeredArguments.find((Z)=>Z.description))return $.registeredArguments;return[]}subcommandTerm($){let Z=$.registeredArguments.map((X)=>iJ(X)).join(" ");return $._name+($._aliases[0]?"|"+$._aliases[0]:"")+($.options.length?" [options]":"")+(Z?" "+Z:"")}optionTerm($){return $.flags}argumentTerm($){return $.name()}longestSubcommandTermLength($,Z){return Z.visibleCommands($).reduce((X,z)=>{return Math.max(X,this.displayWidth(Z.styleSubcommandTerm(Z.subcommandTerm(z))))},0)}longestOptionTermLength($,Z){return Z.visibleOptions($).reduce((X,z)=>{return Math.max(X,this.displayWidth(Z.styleOptionTerm(Z.optionTerm(z))))},0)}longestGlobalOptionTermLength($,Z){return Z.visibleGlobalOptions($).reduce((X,z)=>{return Math.max(X,this.displayWidth(Z.styleOptionTerm(Z.optionTerm(z))))},0)}longestArgumentTermLength($,Z){return Z.visibleArguments($).reduce((X,z)=>{return Math.max(X,this.displayWidth(Z.styleArgumentTerm(Z.argumentTerm(z))))},0)}commandUsage($){let Z=$._name;if($._aliases[0])Z=Z+"|"+$._aliases[0];let X="";for(let z=$.parent;z;z=z.parent)X=z.name()+" "+X;return X+Z+" "+$.usage()}commandDescription($){return $.description()}subcommandDescription($){return $.summary()||$.description()}optionDescription($){let Z=[];if($.argChoices)Z.push(`choices: ${$.argChoices.map((X)=>JSON.stringify(X)).join(", ")}`);if($.defaultValue!==void 0){if($.required||$.optional||$.isBoolean()&&typeof $.defaultValue==="boolean")Z.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`)}if($.presetArg!==void 0&&$.optional)Z.push(`preset: ${JSON.stringify($.presetArg)}`);if($.envVar!==void 0)Z.push(`env: ${$.envVar}`);if(Z.length>0){let X=`(${Z.join(", ")})`;if($.description)return`${$.description} ${X}`;return X}return $.description}argumentDescription($){let Z=[];if($.argChoices)Z.push(`choices: ${$.argChoices.map((X)=>JSON.stringify(X)).join(", ")}`);if($.defaultValue!==void 0)Z.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`);if(Z.length>0){let X=`(${Z.join(", ")})`;if($.description)return`${$.description} ${X}`;return X}return $.description}formatItemList($,Z,X){if(Z.length===0)return[];return[X.styleTitle($),...Z,""]}groupItems($,Z,X){let z=new Map;return $.forEach((J)=>{let q=X(J);if(!z.has(q))z.set(q,[])}),Z.forEach((J)=>{let q=X(J);if(!z.has(q))z.set(q,[]);z.get(q).push(J)}),z}formatHelp($,Z){let X=Z.padWidth($,Z),z=Z.helpWidth??80;function J(W,H){return Z.formatItem(W,X,H,Z)}let q=[`${Z.styleTitle("Usage:")} ${Z.styleUsage(Z.commandUsage($))}`,""],Q=Z.commandDescription($);if(Q.length>0)q=q.concat([Z.boxWrap(Z.styleCommandDescription(Q),z),""]);let Y=Z.visibleArguments($).map((W)=>{return J(Z.styleArgumentTerm(Z.argumentTerm(W)),Z.styleArgumentDescription(Z.argumentDescription(W)))});if(q=q.concat(this.formatItemList("Arguments:",Y,Z)),this.groupItems($.options,Z.visibleOptions($),(W)=>W.helpGroupHeading??"Options:").forEach((W,H)=>{let V=W.map((D)=>{return J(Z.styleOptionTerm(Z.optionTerm(D)),Z.styleOptionDescription(Z.optionDescription(D)))});q=q.concat(this.formatItemList(H,V,Z))}),Z.showGlobalOptions){let W=Z.visibleGlobalOptions($).map((H)=>{return J(Z.styleOptionTerm(Z.optionTerm(H)),Z.styleOptionDescription(Z.optionDescription(H)))});q=q.concat(this.formatItemList("Global Options:",W,Z))}return this.groupItems($.commands,Z.visibleCommands($),(W)=>W.helpGroup()||"Commands:").forEach((W,H)=>{let V=W.map((D)=>{return J(Z.styleSubcommandTerm(Z.subcommandTerm(D)),Z.styleSubcommandDescription(Z.subcommandDescription(D)))});q=q.concat(this.formatItemList(H,V,Z))}),q.join(`
3
+ `)}displayWidth($){return v5($).length}styleTitle($){return $}styleUsage($){return $.split(" ").map((Z)=>{if(Z==="[options]")return this.styleOptionText(Z);if(Z==="[command]")return this.styleSubcommandText(Z);if(Z[0]==="["||Z[0]==="<")return this.styleArgumentText(Z);return this.styleCommandText(Z)}).join(" ")}styleCommandDescription($){return this.styleDescriptionText($)}styleOptionDescription($){return this.styleDescriptionText($)}styleSubcommandDescription($){return this.styleDescriptionText($)}styleArgumentDescription($){return this.styleDescriptionText($)}styleDescriptionText($){return $}styleOptionTerm($){return this.styleOptionText($)}styleSubcommandTerm($){return $.split(" ").map((Z)=>{if(Z==="[options]")return this.styleOptionText(Z);if(Z[0]==="["||Z[0]==="<")return this.styleArgumentText(Z);return this.styleSubcommandText(Z)}).join(" ")}styleArgumentTerm($){return this.styleArgumentText($)}styleOptionText($){return $}styleArgumentText($){return $}styleSubcommandText($){return $}styleCommandText($){return $}padWidth($,Z){return Math.max(Z.longestOptionTermLength($,Z),Z.longestGlobalOptionTermLength($,Z),Z.longestSubcommandTermLength($,Z),Z.longestArgumentTermLength($,Z))}preformatted($){return/\n[^\S\r\n]/.test($)}formatItem($,Z,X,z){let q=" ".repeat(2);if(!X)return q+$;let Q=$.padEnd(Z+$.length-z.displayWidth($)),Y=2,U=(this.helpWidth??80)-Z-Y-2,W;if(U<this.minWidthToWrap||z.preformatted(X))W=X;else W=z.boxWrap(X,U).replace(/\n/g,`
4
+ `+" ".repeat(Z+Y));return q+Q+" ".repeat(Y)+W.replace(/\n/g,`
5
+ ${q}`)}boxWrap($,Z){if(Z<this.minWidthToWrap)return $;let X=$.split(/\r\n|\n/),z=/[\s]*[^\s]+/g,J=[];return X.forEach((q)=>{let Q=q.match(z);if(Q===null){J.push("");return}let Y=[Q.shift()],G=this.displayWidth(Y[0]);Q.forEach((U)=>{let W=this.displayWidth(U);if(G+W<=Z){Y.push(U),G+=W;return}J.push(Y.join(""));let H=U.trimStart();Y=[H],G=this.displayWidth(H)}),J.push(Y.join(""))}),J.join(`
6
+ `)}}function v5($){let Z=/\x1b\[\d*(;\d*)*m/g;return $.replace(Z,"")}nJ.Help=h5;nJ.stripColor=v5});var a2=T((tJ)=>{var{InvalidArgumentError:aJ}=Q6();class m5{constructor($,Z){this.flags=$,this.description=Z||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let X=oJ($);if(this.short=X.shortFlag,this.long=X.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default($,Z){return this.defaultValue=$,this.defaultValueDescription=Z,this}preset($){return this.presetArg=$,this}conflicts($){return this.conflictsWith=this.conflictsWith.concat($),this}implies($){let Z=$;if(typeof $==="string")Z={[$]:!0};return this.implied=Object.assign(this.implied||{},Z),this}env($){return this.envVar=$,this}argParser($){return this.parseArg=$,this}makeOptionMandatory($=!0){return this.mandatory=!!$,this}hideHelp($=!0){return this.hidden=!!$,this}_collectValue($,Z){if(Z===this.defaultValue||!Array.isArray(Z))return[$];return Z.push($),Z}choices($){return this.argChoices=$.slice(),this.parseArg=(Z,X)=>{if(!this.argChoices.includes(Z))throw new aJ(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Z,X);return Z},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return u5(this.name().replace(/^no-/,""));return u5(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class d5{constructor($){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,$.forEach((Z)=>{if(Z.negate)this.negativeOptions.set(Z.attributeName(),Z);else this.positiveOptions.set(Z.attributeName(),Z)}),this.negativeOptions.forEach((Z,X)=>{if(this.positiveOptions.has(X))this.dualOptions.add(X)})}valueFromOption($,Z){let X=Z.attributeName();if(!this.dualOptions.has(X))return!0;let z=this.negativeOptions.get(X).presetArg,J=z!==void 0?z:!1;return Z.negate===(J===$)}}function u5($){return $.split("-").reduce((Z,X)=>{return Z+X[0].toUpperCase()+X.slice(1)})}function oJ($){let Z,X,z=/^-[^-]$/,J=/^--[^-]/,q=$.split(/[ |,]+/).concat("guard");if(z.test(q[0]))Z=q.shift();if(J.test(q[0]))X=q.shift();if(!Z&&z.test(q[0]))Z=q.shift();if(!Z&&J.test(q[0]))Z=X,X=q.shift();if(q[0].startsWith("-")){let Q=q[0],Y=`option creation failed due to '${Q}' in option flags '${$}'`;if(/^-[^-][^-]/.test(Q))throw Error(`${Y}
7
+ - a short flag is a single dash and a single character
8
+ - either use a single dash and a single character (for a short flag)
9
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(z.test(Q))throw Error(`${Y}
10
+ - too many short flags`);if(J.test(Q))throw Error(`${Y}
11
+ - too many long flags`);throw Error(`${Y}
12
+ - unrecognised flag format`)}if(Z===void 0&&X===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:Z,longFlag:X}}tJ.Option=m5;tJ.DualOptions=d5});var c5=T((zq)=>{function Zq($,Z){if(Math.abs($.length-Z.length)>3)return Math.max($.length,Z.length);let X=[];for(let z=0;z<=$.length;z++)X[z]=[z];for(let z=0;z<=Z.length;z++)X[0][z]=z;for(let z=1;z<=Z.length;z++)for(let J=1;J<=$.length;J++){let q=1;if($[J-1]===Z[z-1])q=0;else q=1;if(X[J][z]=Math.min(X[J-1][z]+1,X[J][z-1]+1,X[J-1][z-1]+q),J>1&&z>1&&$[J-1]===Z[z-2]&&$[J-2]===Z[z-1])X[J][z]=Math.min(X[J][z],X[J-2][z-2]+1)}return X[$.length][Z.length]}function Xq($,Z){if(!Z||Z.length===0)return"";Z=Array.from(new Set(Z));let X=$.startsWith("--");if(X)$=$.slice(2),Z=Z.map((Q)=>Q.slice(2));let z=[],J=3,q=0.4;if(Z.forEach((Q)=>{if(Q.length<=1)return;let Y=Zq($,Q),G=Math.max($.length,Q.length);if((G-Y)/G>q){if(Y<J)J=Y,z=[Q];else if(Y===J)z.push(Q)}}),z.sort((Q,Y)=>Q.localeCompare(Y)),X)z=z.map((Q)=>`--${Q}`);if(z.length>1)return`
13
+ (Did you mean one of ${z.join(", ")}?)`;if(z.length===1)return`
14
+ (Did you mean ${z[0]}?)`;return""}zq.suggestSimilar=Xq});var n5=T((Vq)=>{var qq=z0("node:events").EventEmitter,o2=z0("node:child_process"),S0=z0("node:path"),O8=z0("node:fs"),h=z0("node:process"),{Argument:Qq,humanReadableArgName:Yq}=M8(),{CommanderError:t2}=Q6(),{Help:Gq,stripColor:Uq}=r2(),{Option:p5,DualOptions:Wq}=a2(),{suggestSimilar:l5}=c5();class $Z extends qq{constructor($){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=$||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(Z)=>h.stdout.write(Z),writeErr:(Z)=>h.stderr.write(Z),outputError:(Z,X)=>X(Z),getOutHelpWidth:()=>h.stdout.isTTY?h.stdout.columns:void 0,getErrHelpWidth:()=>h.stderr.isTTY?h.stderr.columns:void 0,getOutHasColors:()=>e2()??(h.stdout.isTTY&&h.stdout.hasColors?.()),getErrHasColors:()=>e2()??(h.stderr.isTTY&&h.stderr.hasColors?.()),stripColor:(Z)=>Uq(Z)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings($){return this._outputConfiguration=$._outputConfiguration,this._helpOption=$._helpOption,this._helpCommand=$._helpCommand,this._helpConfiguration=$._helpConfiguration,this._exitCallback=$._exitCallback,this._storeOptionsAsProperties=$._storeOptionsAsProperties,this._combineFlagAndOptionalValue=$._combineFlagAndOptionalValue,this._allowExcessArguments=$._allowExcessArguments,this._enablePositionalOptions=$._enablePositionalOptions,this._showHelpAfterError=$._showHelpAfterError,this._showSuggestionAfterError=$._showSuggestionAfterError,this}_getCommandAndAncestors(){let $=[];for(let Z=this;Z;Z=Z.parent)$.push(Z);return $}command($,Z,X){let z=Z,J=X;if(typeof z==="object"&&z!==null)J=z,z=null;J=J||{};let[,q,Q]=$.match(/([^ ]+) *(.*)/),Y=this.createCommand(q);if(z)Y.description(z),Y._executableHandler=!0;if(J.isDefault)this._defaultCommandName=Y._name;if(Y._hidden=!!(J.noHelp||J.hidden),Y._executableFile=J.executableFile||null,Q)Y.arguments(Q);if(this._registerCommand(Y),Y.parent=this,Y.copyInheritedSettings(this),z)return this;return Y}createCommand($){return new $Z($)}createHelp(){return Object.assign(new Gq,this.configureHelp())}configureHelp($){if($===void 0)return this._helpConfiguration;return this._helpConfiguration=$,this}configureOutput($){if($===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...$},this}showHelpAfterError($=!0){if(typeof $!=="string")$=!!$;return this._showHelpAfterError=$,this}showSuggestionAfterError($=!0){return this._showSuggestionAfterError=!!$,this}addCommand($,Z){if(!$._name)throw Error(`Command passed to .addCommand() must have a name
15
+ - specify the name in Command constructor or using .name()`);if(Z=Z||{},Z.isDefault)this._defaultCommandName=$._name;if(Z.noHelp||Z.hidden)$._hidden=!0;return this._registerCommand($),$.parent=this,$._checkForBrokenPassThrough(),this}createArgument($,Z){return new Qq($,Z)}argument($,Z,X,z){let J=this.createArgument($,Z);if(typeof X==="function")J.default(z).argParser(X);else J.default(X);return this.addArgument(J),this}arguments($){return $.trim().split(/ +/).forEach((Z)=>{this.argument(Z)}),this}addArgument($){let Z=this.registeredArguments.slice(-1)[0];if(Z?.variadic)throw Error(`only the last argument can be variadic '${Z.name()}'`);if($.required&&$.defaultValue!==void 0&&$.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${$.name()}'`);return this.registeredArguments.push($),this}helpCommand($,Z){if(typeof $==="boolean"){if(this._addImplicitHelpCommand=$,$&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let X=$??"help [command]",[,z,J]=X.match(/([^ ]+) *(.*)/),q=Z??"display help for command",Q=this.createCommand(z);if(Q.helpOption(!1),J)Q.arguments(J);if(q)Q.description(q);if(this._addImplicitHelpCommand=!0,this._helpCommand=Q,$||Z)this._initCommandGroup(Q);return this}addHelpCommand($,Z){if(typeof $!=="object")return this.helpCommand($,Z),this;return this._addImplicitHelpCommand=!0,this._helpCommand=$,this._initCommandGroup($),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook($,Z){let X=["preSubcommand","preAction","postAction"];if(!X.includes($))throw Error(`Unexpected value for event passed to hook : '${$}'.
16
+ Expecting one of '${X.join("', '")}'`);if(this._lifeCycleHooks[$])this._lifeCycleHooks[$].push(Z);else this._lifeCycleHooks[$]=[Z];return this}exitOverride($){if($)this._exitCallback=$;else this._exitCallback=(Z)=>{if(Z.code!=="commander.executeSubCommandAsync")throw Z};return this}_exit($,Z,X){if(this._exitCallback)this._exitCallback(new t2($,Z,X));h.exit($)}action($){let Z=(X)=>{let z=this.registeredArguments.length,J=X.slice(0,z);if(this._storeOptionsAsProperties)J[z]=this;else J[z]=this.opts();return J.push(this),$.apply(this,J)};return this._actionHandler=Z,this}createOption($,Z){return new p5($,Z)}_callParseArg($,Z,X,z){try{return $.parseArg(Z,X)}catch(J){if(J.code==="commander.invalidArgument"){let q=`${z} ${J.message}`;this.error(q,{exitCode:J.exitCode,code:J.code})}throw J}}_registerOption($){let Z=$.short&&this._findOption($.short)||$.long&&this._findOption($.long);if(Z){let X=$.long&&this._findOption($.long)?$.long:$.short;throw Error(`Cannot add option '${$.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${X}'
17
+ - already used by option '${Z.flags}'`)}this._initOptionGroup($),this.options.push($)}_registerCommand($){let Z=(z)=>{return[z.name()].concat(z.aliases())},X=Z($).find((z)=>this._findCommand(z));if(X){let z=Z(this._findCommand(X)).join("|"),J=Z($).join("|");throw Error(`cannot add command '${J}' as already have command '${z}'`)}this._initCommandGroup($),this.commands.push($)}addOption($){this._registerOption($);let Z=$.name(),X=$.attributeName();if($.negate){let J=$.long.replace(/^--no-/,"--");if(!this._findOption(J))this.setOptionValueWithSource(X,$.defaultValue===void 0?!0:$.defaultValue,"default")}else if($.defaultValue!==void 0)this.setOptionValueWithSource(X,$.defaultValue,"default");let z=(J,q,Q)=>{if(J==null&&$.presetArg!==void 0)J=$.presetArg;let Y=this.getOptionValue(X);if(J!==null&&$.parseArg)J=this._callParseArg($,J,Y,q);else if(J!==null&&$.variadic)J=$._collectValue(J,Y);if(J==null)if($.negate)J=!1;else if($.isBoolean()||$.optional)J=!0;else J="";this.setOptionValueWithSource(X,J,Q)};if(this.on("option:"+Z,(J)=>{let q=`error: option '${$.flags}' argument '${J}' is invalid.`;z(J,q,"cli")}),$.envVar)this.on("optionEnv:"+Z,(J)=>{let q=`error: option '${$.flags}' value '${J}' from env '${$.envVar}' is invalid.`;z(J,q,"env")});return this}_optionEx($,Z,X,z,J){if(typeof Z==="object"&&Z instanceof p5)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let q=this.createOption(Z,X);if(q.makeOptionMandatory(!!$.mandatory),typeof z==="function")q.default(J).argParser(z);else if(z instanceof RegExp){let Q=z;z=(Y,G)=>{let U=Q.exec(Y);return U?U[0]:G},q.default(J).argParser(z)}else q.default(z);return this.addOption(q)}option($,Z,X,z){return this._optionEx({},$,Z,X,z)}requiredOption($,Z,X,z){return this._optionEx({mandatory:!0},$,Z,X,z)}combineFlagAndOptionalValue($=!0){return this._combineFlagAndOptionalValue=!!$,this}allowUnknownOption($=!0){return this._allowUnknownOption=!!$,this}allowExcessArguments($=!0){return this._allowExcessArguments=!!$,this}enablePositionalOptions($=!0){return this._enablePositionalOptions=!!$,this}passThroughOptions($=!0){return this._passThroughOptions=!!$,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties($=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!$,this}getOptionValue($){if(this._storeOptionsAsProperties)return this[$];return this._optionValues[$]}setOptionValue($,Z){return this.setOptionValueWithSource($,Z,void 0)}setOptionValueWithSource($,Z,X){if(this._storeOptionsAsProperties)this[$]=Z;else this._optionValues[$]=Z;return this._optionValueSources[$]=X,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let Z;return this._getCommandAndAncestors().forEach((X)=>{if(X.getOptionValueSource($)!==void 0)Z=X.getOptionValueSource($)}),Z}_prepareUserArgs($,Z){if($!==void 0&&!Array.isArray($))throw Error("first parameter to parse must be array or undefined");if(Z=Z||{},$===void 0&&Z.from===void 0){if(h.versions?.electron)Z.from="electron";let z=h.execArgv??[];if(z.includes("-e")||z.includes("--eval")||z.includes("-p")||z.includes("--print"))Z.from="eval"}if($===void 0)$=h.argv;this.rawArgs=$.slice();let X;switch(Z.from){case void 0:case"node":this._scriptPath=$[1],X=$.slice(2);break;case"electron":if(h.defaultApp)this._scriptPath=$[1],X=$.slice(2);else X=$.slice(1);break;case"user":X=$.slice(0);break;case"eval":X=$.slice(1);break;default:throw Error(`unexpected parse option { from: '${Z.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",X}parse($,Z){this._prepareForParse();let X=this._prepareUserArgs($,Z);return this._parseCommand([],X),this}async parseAsync($,Z){this._prepareForParse();let X=this._prepareUserArgs($,Z);return await this._parseCommand([],X),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
18
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable($,Z,X){if(O8.existsSync($))return;let z=Z?`searched for local subcommand relative to directory '${Z}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",J=`'${$}' does not exist
19
+ - if '${X}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20
+ - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21
+ - ${z}`;throw Error(J)}_executeSubCommand($,Z){Z=Z.slice();let X=!1,z=[".js",".ts",".tsx",".mjs",".cjs"];function J(U,W){let H=S0.resolve(U,W);if(O8.existsSync(H))return H;if(z.includes(S0.extname(W)))return;let V=z.find((D)=>O8.existsSync(`${H}${D}`));if(V)return`${H}${V}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let q=$._executableFile||`${this._name}-${$._name}`,Q=this._executableDir||"";if(this._scriptPath){let U;try{U=O8.realpathSync(this._scriptPath)}catch{U=this._scriptPath}Q=S0.resolve(S0.dirname(U),Q)}if(Q){let U=J(Q,q);if(!U&&!$._executableFile&&this._scriptPath){let W=S0.basename(this._scriptPath,S0.extname(this._scriptPath));if(W!==this._name)U=J(Q,`${W}-${$._name}`)}q=U||q}X=z.includes(S0.extname(q));let Y;if(h.platform!=="win32")if(X)Z.unshift(q),Z=i5(h.execArgv).concat(Z),Y=o2.spawn(h.argv[0],Z,{stdio:"inherit"});else Y=o2.spawn(q,Z,{stdio:"inherit"});else this._checkForMissingExecutable(q,Q,$._name),Z.unshift(q),Z=i5(h.execArgv).concat(Z),Y=o2.spawn(h.execPath,Z,{stdio:"inherit"});if(!Y.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((W)=>{h.on(W,()=>{if(Y.killed===!1&&Y.exitCode===null)Y.kill(W)})});let G=this._exitCallback;Y.on("close",(U)=>{if(U=U??1,!G)h.exit(U);else G(new t2(U,"commander.executeSubCommandAsync","(close)"))}),Y.on("error",(U)=>{if(U.code==="ENOENT")this._checkForMissingExecutable(q,Q,$._name);else if(U.code==="EACCES")throw Error(`'${q}' not executable`);if(!G)h.exit(1);else{let W=new t2(1,"commander.executeSubCommandAsync","(error)");W.nestedError=U,G(W)}}),this.runningCommand=Y}_dispatchSubcommand($,Z,X){let z=this._findCommand($);if(!z)this.help({error:!0});z._prepareForParse();let J;return J=this._chainOrCallSubCommandHook(J,z,"preSubcommand"),J=this._chainOrCall(J,()=>{if(z._executableHandler)this._executeSubCommand(z,Z.concat(X));else return z._parseCommand(Z,X)}),J}_dispatchHelpCommand($){if(!$)this.help();let Z=this._findCommand($);if(Z&&!Z._executableHandler)Z.help();return this._dispatchSubcommand($,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach(($,Z)=>{if($.required&&this.args[Z]==null)this.missingArgument($.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let $=(X,z,J)=>{let q=z;if(z!==null&&X.parseArg){let Q=`error: command-argument value '${z}' is invalid for argument '${X.name()}'.`;q=this._callParseArg(X,z,J,Q)}return q};this._checkNumberOfArguments();let Z=[];this.registeredArguments.forEach((X,z)=>{let J=X.defaultValue;if(X.variadic){if(z<this.args.length){if(J=this.args.slice(z),X.parseArg)J=J.reduce((q,Q)=>{return $(X,Q,q)},X.defaultValue)}else if(J===void 0)J=[]}else if(z<this.args.length){if(J=this.args[z],X.parseArg)J=$(X,J,X.defaultValue)}Z[z]=J}),this.processedArgs=Z}_chainOrCall($,Z){if($?.then&&typeof $.then==="function")return $.then(()=>Z());return Z()}_chainOrCallHooks($,Z){let X=$,z=[];if(this._getCommandAndAncestors().reverse().filter((J)=>J._lifeCycleHooks[Z]!==void 0).forEach((J)=>{J._lifeCycleHooks[Z].forEach((q)=>{z.push({hookedCommand:J,callback:q})})}),Z==="postAction")z.reverse();return z.forEach((J)=>{X=this._chainOrCall(X,()=>{return J.callback(J.hookedCommand,this)})}),X}_chainOrCallSubCommandHook($,Z,X){let z=$;if(this._lifeCycleHooks[X]!==void 0)this._lifeCycleHooks[X].forEach((J)=>{z=this._chainOrCall(z,()=>{return J(this,Z)})});return z}_parseCommand($,Z){let X=this.parseOptions(Z);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(X.operands),Z=X.unknown,this.args=$.concat(Z),$&&this._findCommand($[0]))return this._dispatchSubcommand($[0],$.slice(1),Z);if(this._getHelpCommand()&&$[0]===this._getHelpCommand().name())return this._dispatchHelpCommand($[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(Z),this._dispatchSubcommand(this._defaultCommandName,$,Z);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(X.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let z=()=>{if(X.unknown.length>0)this.unknownOption(X.unknown[0])},J=`command:${this.name()}`;if(this._actionHandler){z(),this._processArguments();let q;if(q=this._chainOrCallHooks(q,"preAction"),q=this._chainOrCall(q,()=>this._actionHandler(this.processedArgs)),this.parent)q=this._chainOrCall(q,()=>{this.parent.emit(J,$,Z)});return q=this._chainOrCallHooks(q,"postAction"),q}if(this.parent?.listenerCount(J))z(),this._processArguments(),this.parent.emit(J,$,Z);else if($.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",$,Z);if(this.listenerCount("command:*"))this.emit("command:*",$,Z);else if(this.commands.length)this.unknownCommand();else z(),this._processArguments()}else if(this.commands.length)z(),this.help({error:!0});else z(),this._processArguments()}_findCommand($){if(!$)return;return this.commands.find((Z)=>Z._name===$||Z._aliases.includes($))}_findOption($){return this.options.find((Z)=>Z.is($))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(($)=>{$.options.forEach((Z)=>{if(Z.mandatory&&$.getOptionValue(Z.attributeName())===void 0)$.missingMandatoryOptionValue(Z)})})}_checkForConflictingLocalOptions(){let $=this.options.filter((X)=>{let z=X.attributeName();if(this.getOptionValue(z)===void 0)return!1;return this.getOptionValueSource(z)!=="default"});$.filter((X)=>X.conflictsWith.length>0).forEach((X)=>{let z=$.find((J)=>X.conflictsWith.includes(J.attributeName()));if(z)this._conflictingOption(X,z)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let Z=[],X=[],z=Z;function J(U){return U.length>1&&U[0]==="-"}let q=(U)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(U))return!1;return!this._getCommandAndAncestors().some((W)=>W.options.map((H)=>H.short).some((H)=>/^-\d$/.test(H)))},Q=null,Y=null,G=0;while(G<$.length||Y){let U=Y??$[G++];if(Y=null,U==="--"){if(z===X)z.push(U);z.push(...$.slice(G));break}if(Q&&(!J(U)||q(U))){this.emit(`option:${Q.name()}`,U);continue}if(Q=null,J(U)){let W=this._findOption(U);if(W){if(W.required){let H=$[G++];if(H===void 0)this.optionMissingArgument(W);this.emit(`option:${W.name()}`,H)}else if(W.optional){let H=null;if(G<$.length&&(!J($[G])||q($[G])))H=$[G++];this.emit(`option:${W.name()}`,H)}else this.emit(`option:${W.name()}`);Q=W.variadic?W:null;continue}}if(U.length>2&&U[0]==="-"&&U[1]!=="-"){let W=this._findOption(`-${U[1]}`);if(W){if(W.required||W.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${W.name()}`,U.slice(2));else this.emit(`option:${W.name()}`),Y=`-${U.slice(2)}`;continue}}if(/^--[^=]+=/.test(U)){let W=U.indexOf("="),H=this._findOption(U.slice(0,W));if(H&&(H.required||H.optional)){this.emit(`option:${H.name()}`,U.slice(W+1));continue}}if(z===Z&&J(U)&&!(this.commands.length===0&&q(U)))z=X;if((this._enablePositionalOptions||this._passThroughOptions)&&Z.length===0&&X.length===0){if(this._findCommand(U)){Z.push(U),X.push(...$.slice(G));break}else if(this._getHelpCommand()&&U===this._getHelpCommand().name()){Z.push(U,...$.slice(G));break}else if(this._defaultCommandName){X.push(U,...$.slice(G));break}}if(this._passThroughOptions){z.push(U,...$.slice(G));break}z.push(U)}return{operands:Z,unknown:X}}opts(){if(this._storeOptionsAsProperties){let $={},Z=this.options.length;for(let X=0;X<Z;X++){let z=this.options[X].attributeName();$[z]=z===this._versionOptionName?this._version:this[z]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,Z)=>Object.assign($,Z.opts()),{})}error($,Z){if(this._outputConfiguration.outputError(`${$}
22
+ `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
+ `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
24
+ `),this.outputHelp({error:!0});let X=Z||{},z=X.exitCode||1,J=X.code||"commander.error";this._exit(z,J,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in h.env){let Z=$.attributeName();if(this.getOptionValue(Z)===void 0||["default","config","env"].includes(this.getOptionValueSource(Z)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,h.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new Wq(this.options),Z=(X)=>{return this.getOptionValue(X)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(X))};this.options.filter((X)=>X.implied!==void 0&&Z(X.attributeName())&&$.valueFromOption(this.getOptionValue(X.attributeName()),X)).forEach((X)=>{Object.keys(X.implied).filter((z)=>!Z(z)).forEach((z)=>{this.setOptionValueWithSource(z,X.implied[z],"implied")})})}missingArgument($){let Z=`error: missing required argument '${$}'`;this.error(Z,{code:"commander.missingArgument"})}optionMissingArgument($){let Z=`error: option '${$.flags}' argument missing`;this.error(Z,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let Z=`error: required option '${$.flags}' not specified`;this.error(Z,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,Z){let X=(q)=>{let Q=q.attributeName(),Y=this.getOptionValue(Q),G=this.options.find((W)=>W.negate&&Q===W.attributeName()),U=this.options.find((W)=>!W.negate&&Q===W.attributeName());if(G&&(G.presetArg===void 0&&Y===!1||G.presetArg!==void 0&&Y===G.presetArg))return G;return U||q},z=(q)=>{let Q=X(q),Y=Q.attributeName();if(this.getOptionValueSource(Y)==="env")return`environment variable '${Q.envVar}'`;return`option '${Q.flags}'`},J=`error: ${z($)} cannot be used with ${z(Z)}`;this.error(J,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let Z="";if($.startsWith("--")&&this._showSuggestionAfterError){let z=[],J=this;do{let q=J.createHelp().visibleOptions(J).filter((Q)=>Q.long).map((Q)=>Q.long);z=z.concat(q),J=J.parent}while(J&&!J._enablePositionalOptions);Z=l5($,z)}let X=`error: unknown option '${$}'${Z}`;this.error(X,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let Z=this.registeredArguments.length,X=Z===1?"":"s",J=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${Z} argument${X} but got ${$.length}.`;this.error(J,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],Z="";if(this._showSuggestionAfterError){let z=[];this.createHelp().visibleCommands(this).forEach((J)=>{if(z.push(J.name()),J.alias())z.push(J.alias())}),Z=l5($,z)}let X=`error: unknown command '${$}'${Z}`;this.error(X,{code:"commander.unknownCommand"})}version($,Z,X){if($===void 0)return this._version;this._version=$,Z=Z||"-V, --version",X=X||"output the version number";let z=this.createOption(Z,X);return this._versionOptionName=z.attributeName(),this._registerOption(z),this.on("option:"+z.name(),()=>{this._outputConfiguration.writeOut(`${$}
25
+ `),this._exit(0,"commander.version",$)}),this}description($,Z){if($===void 0&&Z===void 0)return this._description;if(this._description=$,Z)this._argsDescription=Z;return this}summary($){if($===void 0)return this._summary;return this._summary=$,this}alias($){if($===void 0)return this._aliases[0];let Z=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)Z=this.commands[this.commands.length-1];if($===Z._name)throw Error("Command alias can't be the same as its name");let X=this.parent?._findCommand($);if(X){let z=[X.name()].concat(X.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${z}'`)}return Z._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((Z)=>this.alias(Z)),this}usage($){if($===void 0){if(this._usage)return this._usage;let Z=this.registeredArguments.map((X)=>{return Yq(X)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?Z:[]).join(" ")}return this._usage=$,this}name($){if($===void 0)return this._name;return this._name=$,this}helpGroup($){if($===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=$,this}commandsGroup($){if($===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=$,this}optionsGroup($){if($===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=$,this}_initOptionGroup($){if(this._defaultOptionGroup&&!$.helpGroupHeading)$.helpGroup(this._defaultOptionGroup)}_initCommandGroup($){if(this._defaultCommandGroup&&!$.helpGroup())$.helpGroup(this._defaultCommandGroup)}nameFromFilename($){return this._name=S0.basename($,S0.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let Z=this.createHelp(),X=this._getOutputContext($);Z.prepareContext({error:X.error,helpWidth:X.helpWidth,outputHasColors:X.hasColors});let z=Z.formatHelp(this,Z);if(X.hasColors)return z;return this._outputConfiguration.stripColor(z)}_getOutputContext($){$=$||{};let Z=!!$.error,X,z,J;if(Z)X=(Q)=>this._outputConfiguration.writeErr(Q),z=this._outputConfiguration.getErrHasColors(),J=this._outputConfiguration.getErrHelpWidth();else X=(Q)=>this._outputConfiguration.writeOut(Q),z=this._outputConfiguration.getOutHasColors(),J=this._outputConfiguration.getOutHelpWidth();return{error:Z,write:(Q)=>{if(!z)Q=this._outputConfiguration.stripColor(Q);return X(Q)},hasColors:z,helpWidth:J}}outputHelp($){let Z;if(typeof $==="function")Z=$,$=void 0;let X=this._getOutputContext($),z={error:X.error,write:X.write,command:this};this._getCommandAndAncestors().reverse().forEach((q)=>q.emit("beforeAllHelp",z)),this.emit("beforeHelp",z);let J=this.helpInformation({error:X.error});if(Z){if(J=Z(J),typeof J!=="string"&&!Buffer.isBuffer(J))throw Error("outputHelp callback must return a string or a Buffer")}if(X.write(J),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",z),this._getCommandAndAncestors().forEach((q)=>q.emit("afterAllHelp",z))}helpOption($,Z){if(typeof $==="boolean"){if($){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption($??"-h, --help",Z??"display help for command"),$||Z)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption($){return this._helpOption=$,this._initOptionGroup($),this}help($){this.outputHelp($);let Z=Number(h.exitCode??0);if(Z===0&&$&&typeof $!=="function"&&$.error)Z=1;this._exit(Z,"commander.help","(outputHelp)")}addHelpText($,Z){let X=["beforeAll","before","after","afterAll"];if(!X.includes($))throw Error(`Unexpected value for position to addHelpText.
26
+ Expecting one of '${X.join("', '")}'`);let z=`${$}Help`;return this.on(z,(J)=>{let q;if(typeof Z==="function")q=Z({error:J.error,command:J.command});else q=Z;if(q)J.write(`${q}
27
+ `)}),this}_outputHelpIfRequested($){let Z=this._getHelpOption();if(Z&&$.find((z)=>Z.is(z)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function i5($){return $.map((Z)=>{if(!Z.startsWith("--inspect"))return Z;let X,z="127.0.0.1",J="9229",q;if((q=Z.match(/^(--inspect(-brk)?)$/))!==null)X=q[1];else if((q=Z.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(X=q[1],/^\d+$/.test(q[3]))J=q[3];else z=q[3];else if((q=Z.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)X=q[1],z=q[3],J=q[4];if(X&&J!=="0")return`${X}=${z}:${parseInt(J)+1}`;return Z})}function e2(){if(h.env.NO_COLOR||h.env.FORCE_COLOR==="0"||h.env.FORCE_COLOR==="false")return!1;if(h.env.FORCE_COLOR||h.env.CLICOLOR_FORCE!==void 0)return!0;return}Vq.Command=$Z;Vq.useColor=e2});var o5=T((Nq)=>{var{Argument:s5}=M8(),{Command:ZZ}=n5(),{CommanderError:Bq,InvalidArgumentError:r5}=Q6(),{Help:Dq}=r2(),{Option:a5}=a2();Nq.program=new ZZ;Nq.createCommand=($)=>new ZZ($);Nq.createOption=($,Z)=>new a5($,Z);Nq.createArgument=($,Z)=>new s5($,Z);Nq.Command=ZZ;Nq.Option=a5;Nq.Argument=s5;Nq.Help=Dq;Nq.CommanderError=Bq;Nq.InvalidArgumentError=r5;Nq.InvalidOptionArgumentError=r5});var k=T((fq)=>{var XZ=Symbol.for("yaml.alias"),$7=Symbol.for("yaml.document"),w8=Symbol.for("yaml.map"),Z7=Symbol.for("yaml.pair"),zZ=Symbol.for("yaml.scalar"),F8=Symbol.for("yaml.seq"),_0=Symbol.for("yaml.node.type"),_q=($)=>!!$&&typeof $==="object"&&$[_0]===XZ,Cq=($)=>!!$&&typeof $==="object"&&$[_0]===$7,Eq=($)=>!!$&&typeof $==="object"&&$[_0]===w8,jq=($)=>!!$&&typeof $==="object"&&$[_0]===Z7,X7=($)=>!!$&&typeof $==="object"&&$[_0]===zZ,bq=($)=>!!$&&typeof $==="object"&&$[_0]===F8;function z7($){if($&&typeof $==="object")switch($[_0]){case w8:case F8:return!0}return!1}function xq($){if($&&typeof $==="object")switch($[_0]){case XZ:case w8:case zZ:case F8:return!0}return!1}var kq=($)=>(X7($)||z7($))&&!!$.anchor;fq.ALIAS=XZ;fq.DOC=$7;fq.MAP=w8;fq.NODE_TYPE=_0;fq.PAIR=Z7;fq.SCALAR=zZ;fq.SEQ=F8;fq.hasAnchor=kq;fq.isAlias=_q;fq.isCollection=z7;fq.isDocument=Cq;fq.isMap=Eq;fq.isNode=xq;fq.isPair=jq;fq.isScalar=X7;fq.isSeq=bq});var Y6=T((tq)=>{var $0=k(),Y0=Symbol("break visit"),J7=Symbol("skip children"),w0=Symbol("remove node");function R8($,Z){let X=q7(Z);if($0.isDocument($)){if(M$(null,$.contents,X,Object.freeze([$]))===w0)$.contents=null}else M$(null,$,X,Object.freeze([]))}R8.BREAK=Y0;R8.SKIP=J7;R8.REMOVE=w0;function M$($,Z,X,z){let J=Q7($,Z,X,z);if($0.isNode(J)||$0.isPair(J))return Y7($,z,J),M$($,J,X,z);if(typeof J!=="symbol"){if($0.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let q=0;q<Z.items.length;++q){let Q=M$(q,Z.items[q],X,z);if(typeof Q==="number")q=Q-1;else if(Q===Y0)return Y0;else if(Q===w0)Z.items.splice(q,1),q-=1}}else if($0.isPair(Z)){z=Object.freeze(z.concat(Z));let q=M$("key",Z.key,X,z);if(q===Y0)return Y0;else if(q===w0)Z.key=null;let Q=M$("value",Z.value,X,z);if(Q===Y0)return Y0;else if(Q===w0)Z.value=null}}return J}async function A8($,Z){let X=q7(Z);if($0.isDocument($)){if(await O$(null,$.contents,X,Object.freeze([$]))===w0)$.contents=null}else await O$(null,$,X,Object.freeze([]))}A8.BREAK=Y0;A8.SKIP=J7;A8.REMOVE=w0;async function O$($,Z,X,z){let J=await Q7($,Z,X,z);if($0.isNode(J)||$0.isPair(J))return Y7($,z,J),O$($,J,X,z);if(typeof J!=="symbol"){if($0.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let q=0;q<Z.items.length;++q){let Q=await O$(q,Z.items[q],X,z);if(typeof Q==="number")q=Q-1;else if(Q===Y0)return Y0;else if(Q===w0)Z.items.splice(q,1),q-=1}}else if($0.isPair(Z)){z=Object.freeze(z.concat(Z));let q=await O$("key",Z.key,X,z);if(q===Y0)return Y0;else if(q===w0)Z.key=null;let Q=await O$("value",Z.value,X,z);if(Q===Y0)return Y0;else if(Q===w0)Z.value=null}}return J}function q7($){if(typeof $==="object"&&($.Collection||$.Node||$.Value))return Object.assign({Alias:$.Node,Map:$.Node,Scalar:$.Node,Seq:$.Node},$.Value&&{Map:$.Value,Scalar:$.Value,Seq:$.Value},$.Collection&&{Map:$.Collection,Seq:$.Collection},$);return $}function Q7($,Z,X,z){if(typeof X==="function")return X($,Z,z);if($0.isMap(Z))return X.Map?.($,Z,z);if($0.isSeq(Z))return X.Seq?.($,Z,z);if($0.isPair(Z))return X.Pair?.($,Z,z);if($0.isScalar(Z))return X.Scalar?.($,Z,z);if($0.isAlias(Z))return X.Alias?.($,Z,z);return}function Y7($,Z,X){let z=Z[Z.length-1];if($0.isCollection(z))z.items[$]=X;else if($0.isPair(z))if($==="key")z.key=X;else z.value=X;else if($0.isDocument(z))z.contents=X;else{let J=$0.isAlias(z)?"alias":"scalar";throw Error(`Cannot replace node with ${J} parent`)}}tq.visit=R8;tq.visitAsync=A8});var JZ=T((JQ)=>{var G7=k(),ZQ=Y6(),XQ={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},zQ=($)=>$.replace(/[!,[\]{}]/g,(Z)=>XQ[Z]);class D0{constructor($,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},D0.defaultYaml,$),this.tags=Object.assign({},D0.defaultTags,Z)}clone(){let $=new D0(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new D0(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:D0.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},D0.defaultTags);break}return $}add($,Z){if(this.atNextDocument)this.yaml={explicit:D0.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},D0.defaultTags),this.atNextDocument=!1;let X=$.trim().split(/[ \t]+/),z=X.shift();switch(z){case"%TAG":{if(X.length!==2){if(Z(0,"%TAG directive should contain exactly two parts"),X.length<2)return!1}let[J,q]=X;return this.tags[J]=q,!0}case"%YAML":{if(this.yaml.explicit=!0,X.length!==1)return Z(0,"%YAML directive should contain exactly one part"),!1;let[J]=X;if(J==="1.1"||J==="1.2")return this.yaml.version=J,!0;else{let q=/^\d+\.\d+$/.test(J);return Z(6,`Unsupported YAML version ${J}`,q),!1}}default:return Z(0,`Unknown directive ${z}`,!0),!1}}tagName($,Z){if($==="!")return"!";if($[0]!=="!")return Z(`Not a valid tag: ${$}`),null;if($[1]==="<"){let q=$.slice(2,-1);if(q==="!"||q==="!!")return Z(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")Z("Verbatim tags must end with a >");return q}let[,X,z]=$.match(/^(.*!)([^!]*)$/s);if(!z)Z(`The ${$} tag has no suffix`);let J=this.tags[X];if(J)try{return J+decodeURIComponent(z)}catch(q){return Z(String(q)),null}if(X==="!")return $;return Z(`Could not resolve tag: ${$}`),null}tagString($){for(let[Z,X]of Object.entries(this.tags))if($.startsWith(X))return Z+zQ($.substring(X.length));return $[0]==="!"?$:`!<${$}>`}toString($){let Z=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],X=Object.entries(this.tags),z;if($&&X.length>0&&G7.isNode($.contents)){let J={};ZQ.visit($.contents,(q,Q)=>{if(G7.isNode(Q)&&Q.tag)J[Q.tag]=!0}),z=Object.keys(J)}else z=[];for(let[J,q]of X){if(J==="!!"&&q==="tag:yaml.org,2002:")continue;if(!$||z.some((Q)=>Q.startsWith(q)))Z.push(`%TAG ${J} ${q}`)}return Z.join(`
28
+ `)}}D0.defaultYaml={explicit:!1,version:"1.2"};D0.defaultTags={"!!":"tag:yaml.org,2002:"};JQ.Directives=D0});var P8=T((UQ)=>{var U7=k(),QQ=Y6();function YQ($){if(/[\x00-\x19\s,[\]{}]/.test($)){let X=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(X)}return!0}function W7($){let Z=new Set;return QQ.visit($,{Value(X,z){if(z.anchor)Z.add(z.anchor)}}),Z}function V7($,Z){for(let X=1;;++X){let z=`${$}${X}`;if(!Z.has(z))return z}}function GQ($,Z){let X=[],z=new Map,J=null;return{onAnchor:(q)=>{X.push(q),J??(J=W7($));let Q=V7(Z,J);return J.add(Q),Q},setAnchors:()=>{for(let q of X){let Q=z.get(q);if(typeof Q==="object"&&Q.anchor&&(U7.isScalar(Q.node)||U7.isCollection(Q.node)))Q.node.anchor=Q.anchor;else{let Y=Error("Failed to resolve repeated object (this should not happen)");throw Y.source=q,Y}}},sourceObjects:z}}UQ.anchorIsValid=YQ;UQ.anchorNames=W7;UQ.createNodeAnchors=GQ;UQ.findNewAnchor=V7});var qZ=T((BQ)=>{function G6($,Z,X,z){if(z&&typeof z==="object")if(Array.isArray(z))for(let J=0,q=z.length;J<q;++J){let Q=z[J],Y=G6($,z,String(J),Q);if(Y===void 0)delete z[J];else if(Y!==Q)z[J]=Y}else if(z instanceof Map)for(let J of Array.from(z.keys())){let q=z.get(J),Q=G6($,z,J,q);if(Q===void 0)z.delete(J);else if(Q!==q)z.set(J,Q)}else if(z instanceof Set)for(let J of Array.from(z)){let q=G6($,z,J,J);if(q===void 0)z.delete(J);else if(q!==J)z.delete(J),z.add(q)}else for(let[J,q]of Object.entries(z)){let Q=G6($,z,J,q);if(Q===void 0)delete z[J];else if(Q!==q)z[J]=Q}return $.call(Z,X,z)}BQ.applyReviver=G6});var h0=T((IQ)=>{var NQ=k();function H7($,Z,X){if(Array.isArray($))return $.map((z,J)=>H7(z,String(J),X));if($&&typeof $.toJSON==="function"){if(!X||!NQ.hasAnchor($))return $.toJSON(Z,X);let z={aliasCount:0,count:1,res:void 0};X.anchors.set($,z),X.onCreate=(q)=>{z.res=q,delete X.onCreate};let J=$.toJSON(Z,X);if(X.onCreate)X.onCreate(J);return J}if(typeof $==="bigint"&&!X?.keep)return Number($);return $}IQ.toJS=H7});var S8=T((OQ)=>{var TQ=qZ(),K7=k(),MQ=h0();class B7{constructor($){Object.defineProperty(this,K7.NODE_TYPE,{value:$})}clone(){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)$.range=this.range.slice();return $}toJS($,{mapAsMap:Z,maxAliasCount:X,onAnchor:z,reviver:J}={}){if(!K7.isDocument($))throw TypeError("A document argument is required");let q={anchors:new Map,doc:$,keep:!0,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof X==="number"?X:100},Q=MQ.toJS(this,"",q);if(typeof z==="function")for(let{count:Y,res:G}of q.anchors.values())z(G,Y);return typeof J==="function"?TQ.applyReviver(J,{"":Q},"",Q):Q}}OQ.NodeBase=B7});var U6=T((SQ)=>{var FQ=P8(),RQ=Y6(),w$=k(),AQ=S8(),PQ=h0();class D7 extends AQ.NodeBase{constructor($){super(w$.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,Z){let X;if(Z?.aliasResolveCache)X=Z.aliasResolveCache;else if(X=[],RQ.visit($,{Node:(J,q)=>{if(w$.isAlias(q)||w$.hasAnchor(q))X.push(q)}}),Z)Z.aliasResolveCache=X;let z=void 0;for(let J of X){if(J===this)break;if(J.anchor===this.source)z=J}return z}toJSON($,Z){if(!Z)return{source:this.source};let{anchors:X,doc:z,maxAliasCount:J}=Z,q=this.resolve(z,Z);if(!q){let Y=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(Y)}let Q=X.get(q);if(!Q)PQ.toJS(q,null,Z),Q=X.get(q);if(Q?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(J>=0){if(Q.count+=1,Q.aliasCount===0)Q.aliasCount=_8(z,q,X);if(Q.count*Q.aliasCount>J)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return Q.res}toString($,Z,X){let z=`*${this.source}`;if($){if(FQ.anchorIsValid(this.source),$.options.verifyAliasOrder&&!$.anchors.has(this.source)){let J=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(J)}if($.implicitKey)return`${z} `}return z}}function _8($,Z,X){if(w$.isAlias(Z)){let z=Z.resolve($),J=X&&z&&X.get(z);return J?J.count*J.aliasCount:0}else if(w$.isCollection(Z)){let z=0;for(let J of Z.items){let q=_8($,J,X);if(q>z)z=q}return z}else if(w$.isPair(Z)){let z=_8($,Z.key,X),J=_8($,Z.value,X);return Math.max(z,J)}return 1}SQ.Alias=D7});var r=T((xQ)=>{var CQ=k(),EQ=S8(),jQ=h0(),bQ=($)=>!$||typeof $!=="function"&&typeof $!=="object";class z$ extends EQ.NodeBase{constructor($){super(CQ.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:jQ.toJS(this.value,$,Z)}toString(){return String(this.value)}}z$.BLOCK_FOLDED="BLOCK_FOLDED";z$.BLOCK_LITERAL="BLOCK_LITERAL";z$.PLAIN="PLAIN";z$.QUOTE_DOUBLE="QUOTE_DOUBLE";z$.QUOTE_SINGLE="QUOTE_SINGLE";xQ.Scalar=z$;xQ.isScalarValue=bQ});var W6=T((uQ)=>{var yQ=U6(),J$=k(),N7=r(),gQ="tag:yaml.org,2002:";function hQ($,Z,X){if(Z){let z=X.filter((q)=>q.tag===Z),J=z.find((q)=>!q.format)??z[0];if(!J)throw Error(`Tag ${Z} not found`);return J}return X.find((z)=>z.identify?.($)&&!z.format)}function vQ($,Z,X){if(J$.isDocument($))$=$.contents;if(J$.isNode($))return $;if(J$.isPair($)){let H=X.schema[J$.MAP].createNode?.(X.schema,null,X);return H.items.push($),H}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:z,onAnchor:J,onTagObj:q,schema:Q,sourceObjects:Y}=X,G=void 0;if(z&&$&&typeof $==="object")if(G=Y.get($),G)return G.anchor??(G.anchor=J($)),new yQ.Alias(G.anchor);else G={anchor:null,node:null},Y.set($,G);if(Z?.startsWith("!!"))Z=gQ+Z.slice(2);let U=hQ($,Z,Q.tags);if(!U){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let H=new N7.Scalar($);if(G)G.node=H;return H}U=$ instanceof Map?Q[J$.MAP]:(Symbol.iterator in Object($))?Q[J$.SEQ]:Q[J$.MAP]}if(q)q(U),delete X.onTagObj;let W=U?.createNode?U.createNode(X.schema,$,X):typeof U?.nodeClass?.from==="function"?U.nodeClass.from(X.schema,$,X):new N7.Scalar($);if(Z)W.tag=Z;else if(!U.default)W.tag=U.tag;if(G)G.node=W;return W}uQ.createNode=vQ});var C8=T((pQ)=>{var dQ=W6(),F0=k(),cQ=S8();function QZ($,Z,X){let z=X;for(let J=Z.length-1;J>=0;--J){let q=Z[J];if(typeof q==="number"&&Number.isInteger(q)&&q>=0){let Q=[];Q[q]=z,z=Q}else z=new Map([[q,z]])}return dQ.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var I7=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class L7 extends cQ.NodeBase{constructor($,Z){super($);Object.defineProperty(this,"schema",{value:Z,configurable:!0,enumerable:!1,writable:!0})}clone($){let Z=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if($)Z.schema=$;if(Z.items=Z.items.map((X)=>F0.isNode(X)||F0.isPair(X)?X.clone($):X),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(I7($))this.add(Z);else{let[X,...z]=$,J=this.get(X,!0);if(F0.isCollection(J))J.addIn(z,Z);else if(J===void 0&&this.schema)this.set(X,QZ(this.schema,z,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${z}`)}}deleteIn($){let[Z,...X]=$;if(X.length===0)return this.delete(Z);let z=this.get(Z,!0);if(F0.isCollection(z))return z.deleteIn(X);else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${X}`)}getIn($,Z){let[X,...z]=$,J=this.get(X,!0);if(z.length===0)return!Z&&F0.isScalar(J)?J.value:J;else return F0.isCollection(J)?J.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!F0.isPair(Z))return!1;let X=Z.value;return X==null||$&&F0.isScalar(X)&&X.value==null&&!X.commentBefore&&!X.comment&&!X.tag})}hasIn($){let[Z,...X]=$;if(X.length===0)return this.has(Z);let z=this.get(Z,!0);return F0.isCollection(z)?z.hasIn(X):!1}setIn($,Z){let[X,...z]=$;if(z.length===0)this.set(X,Z);else{let J=this.get(X,!0);if(F0.isCollection(J))J.setIn(z,Z);else if(J===void 0&&this.schema)this.set(X,QZ(this.schema,z,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${z}`)}}}pQ.Collection=L7;pQ.collectionFromPath=QZ;pQ.isEmptyPath=I7});var V6=T((aQ)=>{var sQ=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function YZ($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var rQ=($,Z,X)=>$.endsWith(`
29
+ `)?YZ(X,Z):X.includes(`
30
+ `)?`
31
+ `+YZ(X,Z):($.endsWith(" ")?"":" ")+X;aQ.indentComment=YZ;aQ.lineComment=rQ;aQ.stringifyComment=sQ});var M7=T((Z1)=>{function $1($,Z,X="flow",{indentAtStart:z,lineWidth:J=80,minContentWidth:q=20,onFold:Q,onOverflow:Y}={}){if(!J||J<0)return $;if(J<q)q=0;let G=Math.max(1+q,1+J-Z.length);if($.length<=G)return $;let U=[],W={},H=J-Z.length;if(typeof z==="number")if(z>J-Math.max(2,q))U.push(0);else H=J-z;let V=void 0,D=void 0,M=!1,B=-1,N=-1,L=-1;if(X==="block"){if(B=T7($,B,Z.length),B!==-1)H=B+G}for(let _;_=$[B+=1];){if(X==="quoted"&&_==="\\"){switch(N=B,$[B+1]){case"x":B+=3;break;case"u":B+=5;break;case"U":B+=9;break;default:B+=1}L=B}if(_===`
32
+ `){if(X==="block")B=T7($,B,Z.length);H=B+Z.length+G,V=void 0}else{if(_===" "&&D&&D!==" "&&D!==`
33
+ `&&D!=="\t"){let C=$[B+1];if(C&&C!==" "&&C!==`
34
+ `&&C!=="\t")V=B}if(B>=H)if(V)U.push(V),H=V+G,V=void 0;else if(X==="quoted"){while(D===" "||D==="\t")D=_,_=$[B+=1],M=!0;let C=B>L+1?B-2:N-1;if(W[C])return $;U.push(C),W[C]=!0,H=C+G,V=void 0}else M=!0}D=_}if(M&&Y)Y();if(U.length===0)return $;if(Q)Q();let S=$.slice(0,U[0]);for(let _=0;_<U.length;++_){let C=U[_],R=U[_+1]||$.length;if(C===0)S=`
35
+ ${Z}${$.slice(0,R)}`;else{if(X==="quoted"&&W[C])S+=`${$[C]}\\`;S+=`
36
+ ${Z}${$.slice(C+1,R)}`}}return S}function T7($,Z,X){let z=Z,J=Z+1,q=$[J];while(q===" "||q==="\t")if(Z<J+X)q=$[++Z];else{do q=$[++Z];while(q&&q!==`
37
+ `);z=Z,J=Z+1,q=$[J]}return z}Z1.FOLD_BLOCK="block";Z1.FOLD_FLOW="flow";Z1.FOLD_QUOTED="quoted";Z1.foldFlowLines=$1});var K6=T((U1)=>{var T0=r(),v0=M7(),j8=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),b8=($)=>/^(%|---|\.\.\.)/m.test($);function Q1($,Z,X){if(!Z||Z<0)return!1;let z=Z-X,J=$.length;if(J<=z)return!1;for(let q=0,Q=0;q<J;++q)if($[q]===`
38
+ `){if(q-Q>z)return!0;if(Q=q+1,J-Q<=z)return!1}return!0}function H6($,Z){let X=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return X;let{implicitKey:z}=Z,J=Z.options.doubleQuotedMinMultiLineLength,q=Z.indent||(b8($)?" ":""),Q="",Y=0;for(let G=0,U=X[G];U;U=X[++G]){if(U===" "&&X[G+1]==="\\"&&X[G+2]==="n")Q+=X.slice(Y,G)+"\\ ",G+=1,Y=G,U="\\";if(U==="\\")switch(X[G+1]){case"u":{Q+=X.slice(Y,G);let W=X.substr(G+2,4);switch(W){case"0000":Q+="\\0";break;case"0007":Q+="\\a";break;case"000b":Q+="\\v";break;case"001b":Q+="\\e";break;case"0085":Q+="\\N";break;case"00a0":Q+="\\_";break;case"2028":Q+="\\L";break;case"2029":Q+="\\P";break;default:if(W.substr(0,2)==="00")Q+="\\x"+W.substr(2);else Q+=X.substr(G,6)}G+=5,Y=G+1}break;case"n":if(z||X[G+2]==='"'||X.length<J)G+=1;else{Q+=X.slice(Y,G)+`
39
+
40
+ `;while(X[G+2]==="\\"&&X[G+3]==="n"&&X[G+4]!=='"')Q+=`
41
+ `,G+=2;if(Q+=q,X[G+2]===" ")Q+="\\";G+=1,Y=G+1}break;default:G+=1}}return Q=Y?Q+X.slice(Y):X,z?Q:v0.foldFlowLines(Q,q,v0.FOLD_QUOTED,j8(Z,!1))}function GZ($,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&$.includes(`
42
+ `)||/[ \t]\n|\n[ \t]/.test($))return H6($,Z);let X=Z.indent||(b8($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
43
+ ${X}`)+"'";return Z.implicitKey?z:v0.foldFlowLines(z,X,v0.FOLD_FLOW,j8(Z,!1))}function F$($,Z){let{singleQuote:X}=Z.options,z;if(X===!1)z=H6;else{let J=$.includes('"'),q=$.includes("'");if(J&&!q)z=GZ;else if(q&&!J)z=H6;else z=X?GZ:H6}return z($,Z)}var UZ;try{UZ=new RegExp(`(^|(?<!
44
+ ))
45
+ +(?!
46
+ |$)`,"g")}catch{UZ=/\n+(?!\n|$)/g}function E8({comment:$,type:Z,value:X},z,J,q){let{blockQuote:Q,commentString:Y,lineWidth:G}=z.options;if(!Q||/\n[\t ]+$/.test(X))return F$(X,z);let U=z.indent||(z.forceBlockIndent||b8(X)?" ":""),W=Q==="literal"?!0:Q==="folded"||Z===T0.Scalar.BLOCK_FOLDED?!1:Z===T0.Scalar.BLOCK_LITERAL?!0:!Q1(X,G,U.length);if(!X)return W?`|
47
+ `:`>
48
+ `;let H,V;for(V=X.length;V>0;--V){let R=X[V-1];if(R!==`
49
+ `&&R!=="\t"&&R!==" ")break}let D=X.substring(V),M=D.indexOf(`
50
+ `);if(M===-1)H="-";else if(X===D||M!==D.length-1){if(H="+",q)q()}else H="";if(D){if(X=X.slice(0,-D.length),D[D.length-1]===`
51
+ `)D=D.slice(0,-1);D=D.replace(UZ,`$&${U}`)}let B=!1,N,L=-1;for(N=0;N<X.length;++N){let R=X[N];if(R===" ")B=!0;else if(R===`
52
+ `)L=N;else break}let S=X.substring(0,L<N?L+1:N);if(S)X=X.substring(S.length),S=S.replace(/\n+/g,`$&${U}`);let C=(B?U?"2":"1":"")+H;if($){if(C+=" "+Y($.replace(/ ?[\r\n]+/g," ")),J)J()}if(!W){let R=X.replace(/\n+/g,`
53
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${U}`),F=!1,d=j8(z,!0);if(Q!=="folded"&&Z!==T0.Scalar.BLOCK_FOLDED)d.onOverflow=()=>{F=!0};let P=v0.foldFlowLines(`${S}${R}${D}`,U,v0.FOLD_BLOCK,d);if(!F)return`>${C}
54
+ ${U}${P}`}return X=X.replace(/\n+/g,`$&${U}`),`|${C}
55
+ ${U}${S}${X}${D}`}function Y1($,Z,X,z){let{type:J,value:q}=$,{actualString:Q,implicitKey:Y,indent:G,indentStep:U,inFlow:W}=Z;if(Y&&q.includes(`
56
+ `)||W&&/[[\]{},]/.test(q))return F$(q,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(q))return Y||W||!q.includes(`
57
+ `)?F$(q,Z):E8($,Z,X,z);if(!Y&&!W&&J!==T0.Scalar.PLAIN&&q.includes(`
58
+ `))return E8($,Z,X,z);if(b8(q)){if(G==="")return Z.forceBlockIndent=!0,E8($,Z,X,z);else if(Y&&G===U)return F$(q,Z)}let H=q.replace(/\n+/g,`$&
59
+ ${G}`);if(Q){let V=(B)=>B.default&&B.tag!=="tag:yaml.org,2002:str"&&B.test?.test(H),{compat:D,tags:M}=Z.doc.schema;if(M.some(V)||D?.some(V))return F$(q,Z)}return Y?H:v0.foldFlowLines(H,G,v0.FOLD_FLOW,j8(Z,!1))}function G1($,Z,X,z){let{implicitKey:J,inFlow:q}=Z,Q=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:Y}=$;if(Y!==T0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(Q.value))Y=T0.Scalar.QUOTE_DOUBLE}let G=(W)=>{switch(W){case T0.Scalar.BLOCK_FOLDED:case T0.Scalar.BLOCK_LITERAL:return J||q?F$(Q.value,Z):E8(Q,Z,X,z);case T0.Scalar.QUOTE_DOUBLE:return H6(Q.value,Z);case T0.Scalar.QUOTE_SINGLE:return GZ(Q.value,Z);case T0.Scalar.PLAIN:return Y1(Q,Z,X,z);default:return null}},U=G(Y);if(U===null){let{defaultKeyType:W,defaultStringType:H}=Z.options,V=J&&W||H;if(U=G(V),U===null)throw Error(`Unsupported default string type ${V}`)}return U}U1.stringifyString=G1});var B6=T((L1)=>{var V1=P8(),u0=k(),H1=V6(),K1=K6();function B1($,Z){let X=Object.assign({blockQuote:!0,commentString:H1.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},$.schema.toStringOptions,Z),z;switch(X.collectionStyle){case"block":z=!1;break;case"flow":z=!0;break;default:z=null}return{anchors:new Set,doc:$,flowCollectionPadding:X.flowCollectionPadding?" ":"",indent:"",indentStep:typeof X.indent==="number"?" ".repeat(X.indent):" ",inFlow:z,options:X}}function D1($,Z){if(Z.tag){let J=$.filter((q)=>q.tag===Z.tag);if(J.length>0)return J.find((q)=>q.format===Z.format)??J[0]}let X=void 0,z;if(u0.isScalar(Z)){z=Z.value;let J=$.filter((q)=>q.identify?.(z));if(J.length>1){let q=J.filter((Q)=>Q.test);if(q.length>0)J=q}X=J.find((q)=>q.format===Z.format)??J.find((q)=>!q.format)}else z=Z,X=$.find((J)=>J.nodeClass&&z instanceof J.nodeClass);if(!X){let J=z?.constructor?.name??(z===null?"null":typeof z);throw Error(`Tag not resolved for ${J} value`)}return X}function N1($,Z,{anchors:X,doc:z}){if(!z.directives)return"";let J=[],q=(u0.isScalar($)||u0.isCollection($))&&$.anchor;if(q&&V1.anchorIsValid(q))X.add(q),J.push(`&${q}`);let Q=$.tag??(Z.default?null:Z.tag);if(Q)J.push(z.directives.tagString(Q));return J.join(" ")}function I1($,Z,X,z){if(u0.isPair($))return $.toString(Z,X,z);if(u0.isAlias($)){if(Z.doc.directives)return $.toString(Z);if(Z.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(Z.resolvedAliases)Z.resolvedAliases.add($);else Z.resolvedAliases=new Set([$]);$=$.resolve(Z.doc)}}let J=void 0,q=u0.isNode($)?$:Z.doc.createNode($,{onTagObj:(G)=>J=G});J??(J=D1(Z.doc.schema.tags,q));let Q=N1(q,J,Z);if(Q.length>0)Z.indentAtStart=(Z.indentAtStart??0)+Q.length+1;let Y=typeof J.stringify==="function"?J.stringify(q,Z,X,z):u0.isScalar(q)?K1.stringifyString(q,Z,X,z):q.toString(Z,X,z);if(!Q)return Y;return u0.isScalar(q)||Y[0]==="{"||Y[0]==="["?`${Q} ${Y}`:`${Q}
60
+ ${Z.indent}${Y}`}L1.createStringifyContext=B1;L1.stringify=I1});var F7=T((w1)=>{var C0=k(),O7=r(),w7=B6(),D6=V6();function O1({key:$,value:Z},X,z,J){let{allNullValues:q,doc:Q,indent:Y,indentStep:G,options:{commentString:U,indentSeq:W,simpleKeys:H}}=X,V=C0.isNode($)&&$.comment||null;if(H){if(V)throw Error("With simple keys, key nodes cannot have comments");if(C0.isCollection($)||!C0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let D=!H&&(!$||V&&Z==null&&!X.inFlow||C0.isCollection($)||(C0.isScalar($)?$.type===O7.Scalar.BLOCK_FOLDED||$.type===O7.Scalar.BLOCK_LITERAL:typeof $==="object"));X=Object.assign({},X,{allNullValues:!1,implicitKey:!D&&(H||!q),indent:Y+G});let M=!1,B=!1,N=w7.stringify($,X,()=>M=!0,()=>B=!0);if(!D&&!X.inFlow&&N.length>1024){if(H)throw Error("With simple keys, single line scalar must not span more than 1024 characters");D=!0}if(X.inFlow){if(q||Z==null){if(M&&z)z();return N===""?"?":D?`? ${N}`:N}}else if(q&&!H||Z==null&&D){if(N=`? ${N}`,V&&!M)N+=D6.lineComment(N,X.indent,U(V));else if(B&&J)J();return N}if(M)V=null;if(D){if(V)N+=D6.lineComment(N,X.indent,U(V));N=`? ${N}
61
+ ${Y}:`}else if(N=`${N}:`,V)N+=D6.lineComment(N,X.indent,U(V));let L,S,_;if(C0.isNode(Z))L=!!Z.spaceBefore,S=Z.commentBefore,_=Z.comment;else if(L=!1,S=null,_=null,Z&&typeof Z==="object")Z=Q.createNode(Z);if(X.implicitKey=!1,!D&&!V&&C0.isScalar(Z))X.indentAtStart=N.length+1;if(B=!1,!W&&G.length>=2&&!X.inFlow&&!D&&C0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)X.indent=X.indent.substring(2);let C=!1,R=w7.stringify(Z,X,()=>C=!0,()=>B=!0),F=" ";if(V||L||S){if(F=L?`
62
+ `:"",S){let d=U(S);F+=`
63
+ ${D6.indentComment(d,X.indent)}`}if(R===""&&!X.inFlow){if(F===`
64
+ `&&_)F=`
65
+
66
+ `}else F+=`
67
+ ${X.indent}`}else if(!D&&C0.isCollection(Z)){let d=R[0],P=R.indexOf(`
68
+ `),t=P!==-1,g0=X.inFlow??Z.flow??Z.items.length===0;if(t||!g0){let T$=!1;if(t&&(d==="&"||d==="!")){let e=R.indexOf(" ");if(d==="&"&&e!==-1&&e<P&&R[e+1]==="!")e=R.indexOf(" ",e+1);if(e===-1||P<e)T$=!0}if(!T$)F=`
69
+ ${X.indent}`}}else if(R===""||R[0]===`
70
+ `)F="";if(N+=F+R,X.inFlow){if(C&&z)z()}else if(_&&!C)N+=D6.lineComment(N,X.indent,U(_));else if(B&&J)J();return N}w1.stringifyPair=O1});var WZ=T((P1)=>{var R7=z0("process");function R1($,...Z){if($==="debug")console.log(...Z)}function A1($,Z){if($==="debug"||$==="warn")if(typeof R7.emitWarning==="function")R7.emitWarning(Z);else console.warn(Z)}P1.debug=R1;P1.warn=A1});var f8=T((E1)=>{var N6=k(),A7=r(),x8="<<",k8={identify:($)=>$===x8||typeof $==="symbol"&&$.description===x8,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new A7.Scalar(Symbol(x8)),{addToJSMap:P7}),stringify:()=>x8},C1=($,Z)=>(k8.identify(Z)||N6.isScalar(Z)&&(!Z.type||Z.type===A7.Scalar.PLAIN)&&k8.identify(Z.value))&&$?.doc.schema.tags.some((X)=>X.tag===k8.tag&&X.default);function P7($,Z,X){if(X=$&&N6.isAlias(X)?X.resolve($.doc):X,N6.isSeq(X))for(let z of X.items)VZ($,Z,z);else if(Array.isArray(X))for(let z of X)VZ($,Z,z);else VZ($,Z,X)}function VZ($,Z,X){let z=$&&N6.isAlias(X)?X.resolve($.doc):X;if(!N6.isMap(z))throw Error("Merge sources must be maps or map aliases");let J=z.toJSON(null,$,Map);for(let[q,Q]of J)if(Z instanceof Map){if(!Z.has(q))Z.set(q,Q)}else if(Z instanceof Set)Z.add(q);else if(!Object.prototype.hasOwnProperty.call(Z,q))Object.defineProperty(Z,q,{value:Q,writable:!0,enumerable:!0,configurable:!0});return Z}E1.addMergeToJSMap=P7;E1.isMergeKey=C1;E1.merge=k8});var KZ=T((h1)=>{var k1=WZ(),S7=f8(),f1=B6(),_7=k(),HZ=h0();function y1($,Z,{key:X,value:z}){if(_7.isNode(X)&&X.addToJSMap)X.addToJSMap($,Z,z);else if(S7.isMergeKey($,X))S7.addMergeToJSMap($,Z,z);else{let J=HZ.toJS(X,"",$);if(Z instanceof Map)Z.set(J,HZ.toJS(z,J,$));else if(Z instanceof Set)Z.add(J);else{let q=g1(X,J,$),Q=HZ.toJS(z,q,$);if(q in Z)Object.defineProperty(Z,q,{value:Q,writable:!0,enumerable:!0,configurable:!0});else Z[q]=Q}}return Z}function g1($,Z,X){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(_7.isNode($)&&X?.doc){let z=f1.createStringifyContext(X.doc,{});z.anchors=new Set;for(let q of X.anchors.keys())z.anchors.add(q.anchor);z.inFlow=!0,z.inStringifyKey=!0;let J=$.toString(z);if(!X.mapKeyWarned){let q=JSON.stringify(J);if(q.length>40)q=q.substring(0,36)+'..."';k1.warn(X.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${q}. Set mapAsMap: true to use object keys.`),X.mapKeyWarned=!0}return J}return JSON.stringify(Z)}h1.addPairToJSMap=y1});var m0=T((c1)=>{var C7=W6(),u1=F7(),m1=KZ(),y8=k();function d1($,Z,X){let z=C7.createNode($,void 0,X),J=C7.createNode(Z,void 0,X);return new g8(z,J)}class g8{constructor($,Z=null){Object.defineProperty(this,y8.NODE_TYPE,{value:y8.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:X}=this;if(y8.isNode(Z))Z=Z.clone($);if(y8.isNode(X))X=X.clone($);return new g8(Z,X)}toJSON($,Z){let X=Z?.mapAsMap?new Map:{};return m1.addPairToJSMap(Z,X,this)}toString($,Z,X){return $?.doc?u1.stringifyPair(this,$,Z,X):JSON.stringify(this)}}c1.Pair=g8;c1.createPair=d1});var BZ=T((r1)=>{var q$=k(),E7=B6(),h8=V6();function i1($,Z,X){return(Z.inFlow??$.flow?s1:n1)($,Z,X)}function n1({comment:$,items:Z},X,{blockItemPrefix:z,flowChars:J,itemIndent:q,onChompKeep:Q,onComment:Y}){let{indent:G,options:{commentString:U}}=X,W=Object.assign({},X,{indent:q,type:null}),H=!1,V=[];for(let M=0;M<Z.length;++M){let B=Z[M],N=null;if(q$.isNode(B)){if(!H&&B.spaceBefore)V.push("");if(v8(X,V,B.commentBefore,H),B.comment)N=B.comment}else if(q$.isPair(B)){let S=q$.isNode(B.key)?B.key:null;if(S){if(!H&&S.spaceBefore)V.push("");v8(X,V,S.commentBefore,H)}}H=!1;let L=E7.stringify(B,W,()=>N=null,()=>H=!0);if(N)L+=h8.lineComment(L,q,U(N));if(H&&N)H=!1;V.push(z+L)}let D;if(V.length===0)D=J.start+J.end;else{D=V[0];for(let M=1;M<V.length;++M){let B=V[M];D+=B?`
71
+ ${G}${B}`:`
72
+ `}}if($){if(D+=`
73
+ `+h8.indentComment(U($),G),Y)Y()}else if(H&&Q)Q();return D}function s1({items:$},Z,{flowChars:X,itemIndent:z}){let{indent:J,indentStep:q,flowCollectionPadding:Q,options:{commentString:Y}}=Z;z+=q;let G=Object.assign({},Z,{indent:z,inFlow:!0,type:null}),U=!1,W=0,H=[];for(let M=0;M<$.length;++M){let B=$[M],N=null;if(q$.isNode(B)){if(B.spaceBefore)H.push("");if(v8(Z,H,B.commentBefore,!1),B.comment)N=B.comment}else if(q$.isPair(B)){let S=q$.isNode(B.key)?B.key:null;if(S){if(S.spaceBefore)H.push("");if(v8(Z,H,S.commentBefore,!1),S.comment)U=!0}let _=q$.isNode(B.value)?B.value:null;if(_){if(_.comment)N=_.comment;if(_.commentBefore)U=!0}else if(B.value==null&&S?.comment)N=S.comment}if(N)U=!0;let L=E7.stringify(B,G,()=>N=null);if(M<$.length-1)L+=",";if(N)L+=h8.lineComment(L,z,Y(N));if(!U&&(H.length>W||L.includes(`
74
+ `)))U=!0;H.push(L),W=H.length}let{start:V,end:D}=X;if(H.length===0)return V+D;else{if(!U){let M=H.reduce((B,N)=>B+N.length+2,2);U=Z.options.lineWidth>0&&M>Z.options.lineWidth}if(U){let M=V;for(let B of H)M+=B?`
75
+ ${q}${J}${B}`:`
76
+ `;return`${M}
77
+ ${J}${D}`}else return`${V}${Q}${H.join(" ")}${Q}${D}`}}function v8({indent:$,options:{commentString:Z}},X,z,J){if(z&&J)z=z.replace(/^\n+/,"");if(z){let q=h8.indentComment(Z(z),$);X.push(q.trimStart())}}r1.stringifyCollection=i1});var c0=T((ZY)=>{var o1=BZ(),t1=KZ(),e1=C8(),d0=k(),u8=m0(),$Y=r();function I6($,Z){let X=d0.isScalar(Z)?Z.value:Z;for(let z of $)if(d0.isPair(z)){if(z.key===Z||z.key===X)return z;if(d0.isScalar(z.key)&&z.key.value===X)return z}return}class j7 extends e1.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(d0.MAP,$);this.items=[]}static from($,Z,X){let{keepUndefined:z,replacer:J}=X,q=new this($),Q=(Y,G)=>{if(typeof J==="function")G=J.call(Z,Y,G);else if(Array.isArray(J)&&!J.includes(Y))return;if(G!==void 0||z)q.items.push(u8.createPair(Y,G,X))};if(Z instanceof Map)for(let[Y,G]of Z)Q(Y,G);else if(Z&&typeof Z==="object")for(let Y of Object.keys(Z))Q(Y,Z[Y]);if(typeof $.sortMapEntries==="function")q.items.sort($.sortMapEntries);return q}add($,Z){let X;if(d0.isPair($))X=$;else if(!$||typeof $!=="object"||!("key"in $))X=new u8.Pair($,$?.value);else X=new u8.Pair($.key,$.value);let z=I6(this.items,X.key),J=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${X.key} already set`);if(d0.isScalar(z.value)&&$Y.isScalarValue(X.value))z.value.value=X.value;else z.value=X.value}else if(J){let q=this.items.findIndex((Q)=>J(X,Q)<0);if(q===-1)this.items.push(X);else this.items.splice(q,0,X)}else this.items.push(X)}delete($){let Z=I6(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=I6(this.items,$)?.value;return(!Z&&d0.isScalar(z)?z.value:z)??void 0}has($){return!!I6(this.items,$)}set($,Z){this.add(new u8.Pair($,Z),!0)}toJSON($,Z,X){let z=X?new X:Z?.mapAsMap?new Map:{};if(Z?.onCreate)Z.onCreate(z);for(let J of this.items)t1.addPairToJSMap(Z,z,J);return z}toString($,Z,X){if(!$)return JSON.stringify(this);for(let z of this.items)if(!d0.isPair(z))throw Error(`Map items must all be pairs; found ${JSON.stringify(z)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return o1.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:X,onComment:Z})}}ZY.YAMLMap=j7;ZY.findPair=I6});var R$=T((QY)=>{var JY=k(),b7=c0(),qY={collection:"map",default:!0,nodeClass:b7.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!JY.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,X)=>b7.YAMLMap.from($,Z,X)};QY.map=qY});var p0=T((KY)=>{var GY=W6(),UY=BZ(),WY=C8(),d8=k(),VY=r(),HY=h0();class x7 extends WY.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(d8.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=m8($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let X=m8($);if(typeof X!=="number")return;let z=this.items[X];return!Z&&d8.isScalar(z)?z.value:z}has($){let Z=m8($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let X=m8($);if(typeof X!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[X];if(d8.isScalar(z)&&VY.isScalarValue(Z))z.value=Z;else this.items[X]=Z}toJSON($,Z){let X=[];if(Z?.onCreate)Z.onCreate(X);let z=0;for(let J of this.items)X.push(HY.toJS(J,String(z++),Z));return X}toString($,Z,X){if(!$)return JSON.stringify(this);return UY.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:X,onComment:Z})}static from($,Z,X){let{replacer:z}=X,J=new this($);if(Z&&Symbol.iterator in Object(Z)){let q=0;for(let Q of Z){if(typeof z==="function"){let Y=Z instanceof Set?Q:String(q++);Q=z.call(Z,Y,Q)}J.items.push(GY.createNode(Q,void 0,X))}}return J}}function m8($){let Z=d8.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}KY.YAMLSeq=x7});var A$=T((IY)=>{var DY=k(),k7=p0(),NY={collection:"seq",default:!0,nodeClass:k7.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!DY.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,X)=>k7.YAMLSeq.from($,Z,X)};IY.seq=NY});var L6=T((OY)=>{var TY=K6(),MY={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,X,z){return Z=Object.assign({actualString:!0},Z),TY.stringifyString($,Z,X,z)}};OY.string=MY});var c8=T((FY)=>{var f7=r(),y7={identify:($)=>$==null,createNode:()=>new f7.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new f7.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&y7.test.test($)?$:Z.options.nullStr};FY.nullTag=y7});var DZ=T((PY)=>{var AY=r(),g7={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new AY.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},X){if($&&g7.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?X.options.trueStr:X.options.falseStr}};PY.boolTag=g7});var P$=T((CY)=>{function _Y({format:$,minFractionDigits:Z,tag:X,value:z}){if(typeof z==="bigint")return String(z);let J=typeof z==="number"?z:Number(z);if(!isFinite(J))return isNaN(J)?".nan":J<0?"-.inf":".inf";let q=Object.is(z,-0)?"-0":JSON.stringify(z);if(!$&&Z&&(!X||X==="tag:yaml.org,2002:float")&&/^\d/.test(q)){let Q=q.indexOf(".");if(Q<0)Q=q.length,q+=".";let Y=Z-(q.length-Q-1);while(Y-- >0)q+="0"}return q}CY.stringifyNumber=_Y});var IZ=T((fY)=>{var jY=r(),NZ=P$(),bY={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:NZ.stringifyNumber},xY={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($),stringify($){let Z=Number($.value);return isFinite(Z)?Z.toExponential():NZ.stringifyNumber($)}},kY={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new jY.Scalar(parseFloat($)),X=$.indexOf(".");if(X!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-X-1;return Z},stringify:NZ.stringifyNumber};fY.float=kY;fY.floatExp=xY;fY.floatNaN=bY});var TZ=T((dY)=>{var h7=P$(),p8=($)=>typeof $==="bigint"||Number.isInteger($),LZ=($,Z,X,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),X);function v7($,Z,X){let{value:z}=$;if(p8(z)&&z>=0)return X+z.toString(Z);return h7.stringifyNumber($)}var vY={identify:($)=>p8($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,X)=>LZ($,2,8,X),stringify:($)=>v7($,8,"0o")},uY={identify:p8,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,X)=>LZ($,0,10,X),stringify:h7.stringifyNumber},mY={identify:($)=>p8($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,X)=>LZ($,2,16,X),stringify:($)=>v7($,16,"0x")};dY.int=uY;dY.intHex=mY;dY.intOct=vY});var u7=T((tY)=>{var iY=R$(),nY=c8(),sY=A$(),rY=L6(),aY=DZ(),MZ=IZ(),OZ=TZ(),oY=[iY.map,sY.seq,rY.string,nY.nullTag,aY.boolTag,OZ.intOct,OZ.int,OZ.intHex,MZ.floatNaN,MZ.floatExp,MZ.float];tY.schema=oY});var d7=T((Q3)=>{var $3=r(),Z3=R$(),X3=A$();function m7($){return typeof $==="bigint"||Number.isInteger($)}var l8=({value:$})=>JSON.stringify($),z3=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:l8},{identify:($)=>$==null,createNode:()=>new $3.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:l8},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:l8},{identify:m7,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:X})=>X?BigInt($):parseInt($,10),stringify:({value:$})=>m7($)?$.toString():JSON.stringify($)},{identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:($)=>parseFloat($),stringify:l8}],J3={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},q3=[Z3.map,X3.seq].concat(z3,J3);Q3.schema=q3});var FZ=T((W3)=>{var T6=z0("buffer"),wZ=r(),G3=K6(),U3={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof T6.Buffer==="function")return T6.Buffer.from($,"base64");else if(typeof atob==="function"){let X=atob($.replace(/[\n\r]/g,"")),z=new Uint8Array(X.length);for(let J=0;J<X.length;++J)z[J]=X.charCodeAt(J);return z}else return Z("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:Z,value:X},z,J,q){if(!X)return"";let Q=X,Y;if(typeof T6.Buffer==="function")Y=Q instanceof T6.Buffer?Q.toString("base64"):T6.Buffer.from(Q.buffer).toString("base64");else if(typeof btoa==="function"){let G="";for(let U=0;U<Q.length;++U)G+=String.fromCharCode(Q[U]);Y=btoa(G)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=wZ.Scalar.BLOCK_LITERAL),Z!==wZ.Scalar.QUOTE_DOUBLE){let G=Math.max(z.options.lineWidth-z.indent.length,z.options.minContentWidth),U=Math.ceil(Y.length/G),W=Array(U);for(let H=0,V=0;H<U;++H,V+=G)W[H]=Y.substr(V,G);Y=W.join(Z===wZ.Scalar.BLOCK_LITERAL?`
78
+ `:" ")}return G3.stringifyString({comment:$,type:Z,value:Y},z,J,q)}};W3.binary=U3});var n8=T((D3)=>{var i8=k(),RZ=m0(),H3=r(),K3=p0();function c7($,Z){if(i8.isSeq($))for(let X=0;X<$.items.length;++X){let z=$.items[X];if(i8.isPair(z))continue;else if(i8.isMap(z)){if(z.items.length>1)Z("Each pair must have its own sequence indicator");let J=z.items[0]||new RZ.Pair(new H3.Scalar(null));if(z.commentBefore)J.key.commentBefore=J.key.commentBefore?`${z.commentBefore}
79
+ ${J.key.commentBefore}`:z.commentBefore;if(z.comment){let q=J.value??J.key;q.comment=q.comment?`${z.comment}
80
+ ${q.comment}`:z.comment}z=J}$.items[X]=i8.isPair(z)?z:new RZ.Pair(z)}else Z("Expected a sequence for this tag");return $}function p7($,Z,X){let{replacer:z}=X,J=new K3.YAMLSeq($);J.tag="tag:yaml.org,2002:pairs";let q=0;if(Z&&Symbol.iterator in Object(Z))for(let Q of Z){if(typeof z==="function")Q=z.call(Z,String(q++),Q);let Y,G;if(Array.isArray(Q))if(Q.length===2)Y=Q[0],G=Q[1];else throw TypeError(`Expected [key, value] tuple: ${Q}`);else if(Q&&Q instanceof Object){let U=Object.keys(Q);if(U.length===1)Y=U[0],G=Q[Y];else throw TypeError(`Expected tuple with one key, not ${U.length} keys`)}else Y=Q;J.items.push(RZ.createPair(Y,G,X))}return J}var B3={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:c7,createNode:p7};D3.createPairs=p7;D3.pairs=B3;D3.resolvePairs=c7});var PZ=T((O3)=>{var l7=k(),AZ=h0(),M6=c0(),T3=p0(),i7=n8();class Q$ extends T3.YAMLSeq{constructor(){super();this.add=M6.YAMLMap.prototype.add.bind(this),this.delete=M6.YAMLMap.prototype.delete.bind(this),this.get=M6.YAMLMap.prototype.get.bind(this),this.has=M6.YAMLMap.prototype.has.bind(this),this.set=M6.YAMLMap.prototype.set.bind(this),this.tag=Q$.tag}toJSON($,Z){if(!Z)return super.toJSON($);let X=new Map;if(Z?.onCreate)Z.onCreate(X);for(let z of this.items){let J,q;if(l7.isPair(z))J=AZ.toJS(z.key,"",Z),q=AZ.toJS(z.value,J,Z);else J=AZ.toJS(z,"",Z);if(X.has(J))throw Error("Ordered maps must not include duplicate keys");X.set(J,q)}return X}static from($,Z,X){let z=i7.createPairs($,Z,X),J=new this;return J.items=z.items,J}}Q$.tag="tag:yaml.org,2002:omap";var M3={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:Q$,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let X=i7.resolvePairs($,Z),z=[];for(let{key:J}of X.items)if(l7.isScalar(J))if(z.includes(J.value))Z(`Ordered maps must not include duplicate keys: ${J.value}`);else z.push(J.value);return Object.assign(new Q$,X)},createNode:($,Z,X)=>Q$.from($,Z,X)};O3.YAMLOMap=Q$;O3.omap=M3});var o7=T((R3)=>{var n7=r();function s7({value:$,source:Z},X){if(Z&&($?r7:a7).test.test(Z))return Z;return $?X.options.trueStr:X.options.falseStr}var r7={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new n7.Scalar(!0),stringify:s7},a7={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new n7.Scalar(!1),stringify:s7};R3.falseTag=a7;R3.trueTag=r7});var t7=T((j3)=>{var S3=r(),SZ=P$(),_3={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:SZ.stringifyNumber},C3={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($.replace(/_/g,"")),stringify($){let Z=Number($.value);return isFinite(Z)?Z.toExponential():SZ.stringifyNumber($)}},E3={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new S3.Scalar(parseFloat($.replace(/_/g,""))),X=$.indexOf(".");if(X!==-1){let z=$.substring(X+1).replace(/_/g,"");if(z[z.length-1]==="0")Z.minFractionDigits=z.length}return Z},stringify:SZ.stringifyNumber};j3.float=E3;j3.floatExp=C3;j3.floatNaN=_3});var $X=T((v3)=>{var e7=P$(),O6=($)=>typeof $==="bigint"||Number.isInteger($);function s8($,Z,X,{intAsBigInt:z}){let J=$[0];if(J==="-"||J==="+")Z+=1;if($=$.substring(Z).replace(/_/g,""),z){switch(X){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let Q=BigInt($);return J==="-"?BigInt(-1)*Q:Q}let q=parseInt($,X);return J==="-"?-1*q:q}function _Z($,Z,X){let{value:z}=$;if(O6(z)){let J=z.toString(Z);return z<0?"-"+X+J.substr(1):X+J}return e7.stringifyNumber($)}var f3={identify:O6,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,X)=>s8($,2,2,X),stringify:($)=>_Z($,2,"0b")},y3={identify:O6,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,X)=>s8($,1,8,X),stringify:($)=>_Z($,8,"0")},g3={identify:O6,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,X)=>s8($,0,10,X),stringify:e7.stringifyNumber},h3={identify:O6,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,X)=>s8($,2,16,X),stringify:($)=>_Z($,16,"0x")};v3.int=g3;v3.intBin=f3;v3.intHex=h3;v3.intOct=y3});var CZ=T((l3)=>{var o8=k(),r8=m0(),a8=c0();class Y$ extends a8.YAMLMap{constructor($){super($);this.tag=Y$.tag}add($){let Z;if(o8.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new r8.Pair($.key,null);else Z=new r8.Pair($,null);if(!a8.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let X=a8.findPair(this.items,$);return!Z&&o8.isPair(X)?o8.isScalar(X.key)?X.key.value:X.key:X}set($,Z){if(typeof Z!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof Z}`);let X=a8.findPair(this.items,$);if(X&&!Z)this.items.splice(this.items.indexOf(X),1);else if(!X&&Z)this.items.push(new r8.Pair($))}toJSON($,Z){return super.toJSON($,Z,Set)}toString($,Z,X){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),Z,X);else throw Error("Set items must all have null values")}static from($,Z,X){let{replacer:z}=X,J=new this($);if(Z&&Symbol.iterator in Object(Z))for(let q of Z){if(typeof z==="function")q=z.call(Z,q,q);J.items.push(r8.createPair(q,null,X))}return J}}Y$.tag="tag:yaml.org,2002:set";var p3={collection:"map",identify:($)=>$ instanceof Set,nodeClass:Y$,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,X)=>Y$.from($,Z,X),resolve($,Z){if(o8.isMap($))if($.hasAllNullValues(!0))return Object.assign(new Y$,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};l3.YAMLSet=Y$;l3.set=p3});var jZ=T((o3)=>{var s3=P$();function EZ($,Z){let X=$[0],z=X==="-"||X==="+"?$.substring(1):$,J=(Q)=>Z?BigInt(Q):Number(Q),q=z.replace(/_/g,"").split(":").reduce((Q,Y)=>Q*J(60)+J(Y),J(0));return X==="-"?J(-1)*q:q}function ZX($){let{value:Z}=$,X=(Q)=>Q;if(typeof Z==="bigint")X=(Q)=>BigInt(Q);else if(isNaN(Z)||!isFinite(Z))return s3.stringifyNumber($);let z="";if(Z<0)z="-",Z*=X(-1);let J=X(60),q=[Z%J];if(Z<60)q.unshift(0);else if(Z=(Z-q[0])/J,q.unshift(Z%J),Z>=60)Z=(Z-q[0])/J,q.unshift(Z);return z+q.map((Q)=>String(Q).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var r3={identify:($)=>typeof $==="bigint"||Number.isInteger($),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:($,Z,{intAsBigInt:X})=>EZ($,X),stringify:ZX},a3={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:($)=>EZ($,!1),stringify:ZX},XX={identify:($)=>$ instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve($){let Z=$.match(XX.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,X,z,J,q,Q,Y]=Z.map(Number),G=Z[7]?Number((Z[7]+"00").substr(1,3)):0,U=Date.UTC(X,z-1,J,q||0,Q||0,Y||0,G),W=Z[8];if(W&&W!=="Z"){let H=EZ(W,!1);if(Math.abs(H)<30)H*=60;U-=60000*H}return new Date(U)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};o3.floatTime=a3;o3.intTime=r3;o3.timestamp=XX});var JX=T((VG)=>{var ZG=R$(),XG=c8(),zG=A$(),JG=L6(),qG=FZ(),zX=o7(),bZ=t7(),t8=$X(),QG=f8(),YG=PZ(),GG=n8(),UG=CZ(),xZ=jZ(),WG=[ZG.map,zG.seq,JG.string,XG.nullTag,zX.trueTag,zX.falseTag,t8.intBin,t8.intOct,t8.int,t8.intHex,bZ.floatNaN,bZ.floatExp,bZ.float,qG.binary,QG.merge,YG.omap,GG.pairs,UG.set,xZ.intTime,xZ.floatTime,xZ.timestamp];VG.schema=WG});var BX=T((MG)=>{var GX=R$(),KG=c8(),UX=A$(),BG=L6(),DG=DZ(),kZ=IZ(),fZ=TZ(),NG=u7(),IG=d7(),WX=FZ(),w6=f8(),VX=PZ(),HX=n8(),qX=JX(),KX=CZ(),e8=jZ(),QX=new Map([["core",NG.schema],["failsafe",[GX.map,UX.seq,BG.string]],["json",IG.schema],["yaml11",qX.schema],["yaml-1.1",qX.schema]]),YX={binary:WX.binary,bool:DG.boolTag,float:kZ.float,floatExp:kZ.floatExp,floatNaN:kZ.floatNaN,floatTime:e8.floatTime,int:fZ.int,intHex:fZ.intHex,intOct:fZ.intOct,intTime:e8.intTime,map:GX.map,merge:w6.merge,null:KG.nullTag,omap:VX.omap,pairs:HX.pairs,seq:UX.seq,set:KX.set,timestamp:e8.timestamp},LG={"tag:yaml.org,2002:binary":WX.binary,"tag:yaml.org,2002:merge":w6.merge,"tag:yaml.org,2002:omap":VX.omap,"tag:yaml.org,2002:pairs":HX.pairs,"tag:yaml.org,2002:set":KX.set,"tag:yaml.org,2002:timestamp":e8.timestamp};function TG($,Z,X){let z=QX.get(Z);if(z&&!$)return X&&!z.includes(w6.merge)?z.concat(w6.merge):z.slice();let J=z;if(!J)if(Array.isArray($))J=[];else{let q=Array.from(QX.keys()).filter((Q)=>Q!=="yaml11").map((Q)=>JSON.stringify(Q)).join(", ");throw Error(`Unknown schema "${Z}"; use one of ${q} or define customTags array`)}if(Array.isArray($))for(let q of $)J=J.concat(q);else if(typeof $==="function")J=$(J.slice());if(X)J=J.concat(w6.merge);return J.reduce((q,Q)=>{let Y=typeof Q==="string"?YX[Q]:Q;if(!Y){let G=JSON.stringify(Q),U=Object.keys(YX).map((W)=>JSON.stringify(W)).join(", ");throw Error(`Unknown custom tag ${G}; use one of ${U}`)}if(!q.includes(Y))q.push(Y);return q},[])}MG.coreKnownTags=LG;MG.getTags=TG});var hZ=T((SG)=>{var yZ=k(),FG=R$(),RG=A$(),AG=L6(),$2=BX(),PG=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class gZ{constructor({compat:$,customTags:Z,merge:X,resolveKnownTags:z,schema:J,sortMapEntries:q,toStringDefaults:Q}){this.compat=Array.isArray($)?$2.getTags($,"compat"):$?$2.getTags(null,$):null,this.name=typeof J==="string"&&J||"core",this.knownTags=z?$2.coreKnownTags:{},this.tags=$2.getTags(Z,this.name,X),this.toStringOptions=Q??null,Object.defineProperty(this,yZ.MAP,{value:FG.map}),Object.defineProperty(this,yZ.SCALAR,{value:AG.string}),Object.defineProperty(this,yZ.SEQ,{value:RG.seq}),this.sortMapEntries=typeof q==="function"?q:q===!0?PG:null}clone(){let $=Object.create(gZ.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}SG.Schema=gZ});var DX=T((jG)=>{var CG=k(),vZ=B6(),F6=V6();function EG($,Z){let X=[],z=Z.directives===!0;if(Z.directives!==!1&&$.directives){let G=$.directives.toString($);if(G)X.push(G),z=!0;else if($.directives.docStart)z=!0}if(z)X.push("---");let J=vZ.createStringifyContext($,Z),{commentString:q}=J.options;if($.commentBefore){if(X.length!==1)X.unshift("");let G=q($.commentBefore);X.unshift(F6.indentComment(G,""))}let Q=!1,Y=null;if($.contents){if(CG.isNode($.contents)){if($.contents.spaceBefore&&z)X.push("");if($.contents.commentBefore){let W=q($.contents.commentBefore);X.push(F6.indentComment(W,""))}J.forceBlockIndent=!!$.comment,Y=$.contents.comment}let G=Y?void 0:()=>Q=!0,U=vZ.stringify($.contents,J,()=>Y=null,G);if(Y)U+=F6.lineComment(U,"",q(Y));if((U[0]==="|"||U[0]===">")&&X[X.length-1]==="---")X[X.length-1]=`--- ${U}`;else X.push(U)}else X.push(vZ.stringify($.contents,J));if($.directives?.docEnd)if($.comment){let G=q($.comment);if(G.includes(`
81
+ `))X.push("..."),X.push(F6.indentComment(G,""));else X.push(`... ${G}`)}else X.push("...");else{let G=$.comment;if(G&&Q)G=G.replace(/^\n+/,"");if(G){if((!Q||Y)&&X[X.length-1]!=="")X.push("");X.push(F6.indentComment(q(G),""))}}return X.join(`
82
+ `)+`
83
+ `}jG.stringifyDocument=EG});var R6=T((uG)=>{var xG=U6(),S$=C8(),N0=k(),kG=m0(),fG=h0(),yG=hZ(),gG=DX(),uZ=P8(),hG=qZ(),vG=W6(),mZ=JZ();class dZ{constructor($,Z,X){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,N0.NODE_TYPE,{value:N0.DOC});let z=null;if(typeof Z==="function"||Array.isArray(Z))z=Z;else if(X===void 0&&Z)X=Z,Z=void 0;let J=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},X);this.options=J;let{version:q}=J;if(X?._directives){if(this.directives=X._directives.atDocument(),this.directives.yaml.explicit)q=this.directives.yaml.version}else this.directives=new mZ.Directives({version:q});this.setSchema(q,X),this.contents=$===void 0?null:this.createNode($,z,X)}clone(){let $=Object.create(dZ.prototype,{[N0.NODE_TYPE]:{value:N0.DOC}});if($.commentBefore=this.commentBefore,$.comment=this.comment,$.errors=this.errors.slice(),$.warnings=this.warnings.slice(),$.options=Object.assign({},this.options),this.directives)$.directives=this.directives.clone();if($.schema=this.schema.clone(),$.contents=N0.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(_$(this.contents))this.contents.add($)}addIn($,Z){if(_$(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let X=uZ.anchorNames(this);$.anchor=!Z||X.has(Z)?uZ.findNewAnchor(Z||"a",X):Z}return new xG.Alias($.anchor)}createNode($,Z,X){let z=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),z=Z;else if(Array.isArray(Z)){let B=(L)=>typeof L==="number"||L instanceof String||L instanceof Number,N=Z.filter(B).map(String);if(N.length>0)Z=Z.concat(N);z=Z}else if(X===void 0&&Z)X=Z,Z=void 0;let{aliasDuplicateObjects:J,anchorPrefix:q,flow:Q,keepUndefined:Y,onTagObj:G,tag:U}=X??{},{onAnchor:W,setAnchors:H,sourceObjects:V}=uZ.createNodeAnchors(this,q||"a"),D={aliasDuplicateObjects:J??!0,keepUndefined:Y??!1,onAnchor:W,onTagObj:G,replacer:z,schema:this.schema,sourceObjects:V},M=vG.createNode($,U,D);if(Q&&N0.isCollection(M))M.flow=!0;return H(),M}createPair($,Z,X={}){let z=this.createNode($,null,X),J=this.createNode(Z,null,X);return new kG.Pair(z,J)}delete($){return _$(this.contents)?this.contents.delete($):!1}deleteIn($){if(S$.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return _$(this.contents)?this.contents.deleteIn($):!1}get($,Z){return N0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(S$.isEmptyPath($))return!Z&&N0.isScalar(this.contents)?this.contents.value:this.contents;return N0.isCollection(this.contents)?this.contents.getIn($,Z):void 0}has($){return N0.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(S$.isEmptyPath($))return this.contents!==void 0;return N0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=S$.collectionFromPath(this.schema,[$],Z);else if(_$(this.contents))this.contents.set($,Z)}setIn($,Z){if(S$.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=S$.collectionFromPath(this.schema,Array.from($),Z);else if(_$(this.contents))this.contents.setIn($,Z)}setSchema($,Z={}){if(typeof $==="number")$=String($);let X;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new mZ.Directives({version:"1.1"});X={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=$;else this.directives=new mZ.Directives({version:$});X={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;X=null;break;default:{let z=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${z}`)}}if(Z.schema instanceof Object)this.schema=Z.schema;else if(X)this.schema=new yG.Schema(Object.assign(X,Z));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:Z,mapAsMap:X,maxAliasCount:z,onAnchor:J,reviver:q}={}){let Q={anchors:new Map,doc:this,keep:!$,mapAsMap:X===!0,mapKeyWarned:!1,maxAliasCount:typeof z==="number"?z:100},Y=fG.toJS(this.contents,Z??"",Q);if(typeof J==="function")for(let{count:G,res:U}of Q.anchors.values())J(U,G);return typeof q==="function"?hG.applyReviver(q,{"":Y},"",Y):Y}toJSON($,Z){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:Z})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let Z=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${Z}`)}return gG.stringifyDocument(this,$)}}function _$($){if(N0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}uG.Document=dZ});var A6=T((cG)=>{class Z2 extends Error{constructor($,Z,X,z){super();this.name=$,this.code=X,this.message=z,this.pos=Z}}class NX extends Z2{constructor($,Z,X){super("YAMLParseError",$,Z,X)}}class IX extends Z2{constructor($,Z,X){super("YAMLWarning",$,Z,X)}}var dG=($,Z)=>(X)=>{if(X.pos[0]===-1)return;X.linePos=X.pos.map((Y)=>Z.linePos(Y));let{line:z,col:J}=X.linePos[0];X.message+=` at line ${z}, column ${J}`;let q=J-1,Q=$.substring(Z.lineStarts[z-1],Z.lineStarts[z]).replace(/[\n\r]+$/,"");if(q>=60&&Q.length>80){let Y=Math.min(q-39,Q.length-79);Q="…"+Q.substring(Y),q-=Y-1}if(Q.length>80)Q=Q.substring(0,79)+"…";if(z>1&&/^ *$/.test(Q.substring(0,q))){let Y=$.substring(Z.lineStarts[z-2],Z.lineStarts[z-1]);if(Y.length>80)Y=Y.substring(0,79)+`…
84
+ `;Q=Y+Q}if(/[^ ]/.test(Q)){let Y=1,G=X.linePos[1];if(G?.line===z&&G.col>J)Y=Math.max(1,Math.min(G.col-J,80-q));let U=" ".repeat(q)+"^".repeat(Y);X.message+=`:
85
+
86
+ ${Q}
87
+ ${U}
88
+ `}};cG.YAMLError=Z2;cG.YAMLParseError=NX;cG.YAMLWarning=IX;cG.prettifyError=dG});var P6=T((rG)=>{function sG($,{flow:Z,indicator:X,next:z,offset:J,onError:q,parentIndent:Q,startOnNewline:Y}){let G=!1,U=Y,W=Y,H="",V="",D=!1,M=!1,B=null,N=null,L=null,S=null,_=null,C=null,R=null;for(let P of $){if(M){if(P.type!=="space"&&P.type!=="newline"&&P.type!=="comma")q(P.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");M=!1}if(B){if(U&&P.type!=="comment"&&P.type!=="newline")q(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");B=null}switch(P.type){case"space":if(!Z&&(X!=="doc-start"||z?.type!=="flow-collection")&&P.source.includes("\t"))B=P;W=!0;break;case"comment":{if(!W)q(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let t=P.source.substring(1)||" ";if(!H)H=t;else H+=V+t;V="",U=!1;break}case"newline":if(U){if(H)H+=P.source;else if(!C||X!=="seq-item-ind")G=!0}else V+=P.source;if(U=!0,D=!0,N||L)S=P;W=!0;break;case"anchor":if(N)q(P,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(P.source.endsWith(":"))q(P.offset+P.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);N=P,R??(R=P.offset),U=!1,W=!1,M=!0;break;case"tag":{if(L)q(P,"MULTIPLE_TAGS","A node can have at most one tag");L=P,R??(R=P.offset),U=!1,W=!1,M=!0;break}case X:if(N||L)q(P,"BAD_PROP_ORDER",`Anchors and tags must be after the ${P.source} indicator`);if(C)q(P,"UNEXPECTED_TOKEN",`Unexpected ${P.source} in ${Z??"collection"}`);C=P,U=X==="seq-item-ind"||X==="explicit-key-ind",W=!1;break;case"comma":if(Z){if(_)q(P,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);_=P,U=!1,W=!1;break}default:q(P,"UNEXPECTED_TOKEN",`Unexpected ${P.type} token`),U=!1,W=!1}}let F=$[$.length-1],d=F?F.offset+F.source.length:J;if(M&&z&&z.type!=="space"&&z.type!=="newline"&&z.type!=="comma"&&(z.type!=="scalar"||z.source!==""))q(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(B&&(U&&B.indent<=Q||z?.type==="block-map"||z?.type==="block-seq"))q(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:_,found:C,spaceBefore:G,comment:H,hasNewline:D,anchor:N,tag:L,newlineAfterProp:S,end:d,start:R??d}}rG.resolveProps=sG});var X2=T((oG)=>{function cZ($){if(!$)return null;switch($.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if($.source.includes(`
89
+ `))return!0;if($.end){for(let Z of $.end)if(Z.type==="newline")return!0}return!1;case"flow-collection":for(let Z of $.items){for(let X of Z.start)if(X.type==="newline")return!0;if(Z.sep){for(let X of Z.sep)if(X.type==="newline")return!0}if(cZ(Z.key)||cZ(Z.value))return!0}return!1;default:return!0}}oG.containsNewline=cZ});var pZ=T((ZU)=>{var eG=X2();function $U($,Z,X){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&eG.containsNewline(Z))X(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}ZU.flowIndentCheck=$U});var lZ=T((JU)=>{var LX=k();function zU($,Z,X){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let J=typeof z==="function"?z:(q,Q)=>q===Q||LX.isScalar(q)&&LX.isScalar(Q)&&q.value===Q.value;return Z.some((q)=>J(q.key,X))}JU.mapIncludes=zU});var FX=T((WU)=>{var TX=m0(),QU=c0(),MX=P6(),YU=X2(),OX=pZ(),GU=lZ(),wX="All mapping items must start at the same column";function UU({composeNode:$,composeEmptyNode:Z},X,z,J,q){let Y=new(q?.nodeClass??QU.YAMLMap)(X.schema);if(X.atRoot)X.atRoot=!1;let G=z.offset,U=null;for(let W of z.items){let{start:H,key:V,sep:D,value:M}=W,B=MX.resolveProps(H,{indicator:"explicit-key-ind",next:V??D?.[0],offset:G,onError:J,parentIndent:z.indent,startOnNewline:!0}),N=!B.found;if(N){if(V){if(V.type==="block-seq")J(G,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in V&&V.indent!==z.indent)J(G,"BAD_INDENT",wX)}if(!B.anchor&&!B.tag&&!D){if(U=B.end,B.comment)if(Y.comment)Y.comment+=`
90
+ `+B.comment;else Y.comment=B.comment;continue}if(B.newlineAfterProp||YU.containsNewline(V))J(V??H[H.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(B.found?.indent!==z.indent)J(G,"BAD_INDENT",wX);X.atKey=!0;let L=B.end,S=V?$(X,V,B,J):Z(X,L,H,null,B,J);if(X.schema.compat)OX.flowIndentCheck(z.indent,V,J);if(X.atKey=!1,GU.mapIncludes(X,Y.items,S))J(L,"DUPLICATE_KEY","Map keys must be unique");let _=MX.resolveProps(D??[],{indicator:"map-value-ind",next:M,offset:S.range[2],onError:J,parentIndent:z.indent,startOnNewline:!V||V.type==="block-scalar"});if(G=_.end,_.found){if(N){if(M?.type==="block-map"&&!_.hasNewline)J(G,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(X.options.strict&&B.start<_.found.offset-1024)J(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let C=M?$(X,M,_,J):Z(X,G,D,null,_,J);if(X.schema.compat)OX.flowIndentCheck(z.indent,M,J);G=C.range[2];let R=new TX.Pair(S,C);if(X.options.keepSourceTokens)R.srcToken=W;Y.items.push(R)}else{if(N)J(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(_.comment)if(S.comment)S.comment+=`
91
+ `+_.comment;else S.comment=_.comment;let C=new TX.Pair(S);if(X.options.keepSourceTokens)C.srcToken=W;Y.items.push(C)}}if(U&&U<G)J(U,"IMPOSSIBLE","Map comment with trailing content");return Y.range=[z.offset,G,U??G],Y}WU.resolveBlockMap=UU});var RX=T((NU)=>{var HU=p0(),KU=P6(),BU=pZ();function DU({composeNode:$,composeEmptyNode:Z},X,z,J,q){let Y=new(q?.nodeClass??HU.YAMLSeq)(X.schema);if(X.atRoot)X.atRoot=!1;if(X.atKey)X.atKey=!1;let G=z.offset,U=null;for(let{start:W,value:H}of z.items){let V=KU.resolveProps(W,{indicator:"seq-item-ind",next:H,offset:G,onError:J,parentIndent:z.indent,startOnNewline:!0});if(!V.found)if(V.anchor||V.tag||H)if(H?.type==="block-seq")J(V.end,"BAD_INDENT","All sequence items must start at the same column");else J(G,"MISSING_CHAR","Sequence item without - indicator");else{if(U=V.end,V.comment)Y.comment=V.comment;continue}let D=H?$(X,H,V,J):Z(X,V.end,W,null,V,J);if(X.schema.compat)BU.flowIndentCheck(z.indent,H,J);G=D.range[2],Y.items.push(D)}return Y.range=[z.offset,G,U??G],Y}NU.resolveBlockSeq=DU});var C$=T((TU)=>{function LU($,Z,X,z){let J="";if($){let q=!1,Q="";for(let Y of $){let{source:G,type:U}=Y;switch(U){case"space":q=!0;break;case"comment":{if(X&&!q)z(Y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let W=G.substring(1)||" ";if(!J)J=W;else J+=Q+W;Q="";break}case"newline":if(J)Q+=G;q=!0;break;default:z(Y,"UNEXPECTED_TOKEN",`Unexpected ${U} at node end`)}Z+=G.length}}return{comment:J,offset:Z}}TU.resolveEnd=LU});var SX=T((_U)=>{var OU=k(),wU=m0(),AX=c0(),FU=p0(),RU=C$(),PX=P6(),AU=X2(),PU=lZ(),iZ="Block collections are not allowed within flow collections",nZ=($)=>$&&($.type==="block-map"||$.type==="block-seq");function SU({composeNode:$,composeEmptyNode:Z},X,z,J,q){let Q=z.start.source==="{",Y=Q?"flow map":"flow sequence",U=new(q?.nodeClass??(Q?AX.YAMLMap:FU.YAMLSeq))(X.schema);U.flow=!0;let W=X.atRoot;if(W)X.atRoot=!1;if(X.atKey)X.atKey=!1;let H=z.offset+z.start.source.length;for(let N=0;N<z.items.length;++N){let L=z.items[N],{start:S,key:_,sep:C,value:R}=L,F=PX.resolveProps(S,{flow:Y,indicator:"explicit-key-ind",next:_??C?.[0],offset:H,onError:J,parentIndent:z.indent,startOnNewline:!1});if(!F.found){if(!F.anchor&&!F.tag&&!C&&!R){if(N===0&&F.comma)J(F.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Y}`);else if(N<z.items.length-1)J(F.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${Y}`);if(F.comment)if(U.comment)U.comment+=`
92
+ `+F.comment;else U.comment=F.comment;H=F.end;continue}if(!Q&&X.options.strict&&AU.containsNewline(_))J(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(N===0){if(F.comma)J(F.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Y}`)}else{if(!F.comma)J(F.start,"MISSING_CHAR",`Missing , between ${Y} items`);if(F.comment){let d="";$:for(let P of S)switch(P.type){case"comma":case"space":break;case"comment":d=P.source.substring(1);break $;default:break $}if(d){let P=U.items[U.items.length-1];if(OU.isPair(P))P=P.value??P.key;if(P.comment)P.comment+=`
93
+ `+d;else P.comment=d;F.comment=F.comment.substring(d.length+1)}}}if(!Q&&!C&&!F.found){let d=R?$(X,R,F,J):Z(X,F.end,C,null,F,J);if(U.items.push(d),H=d.range[2],nZ(R))J(d.range,"BLOCK_IN_FLOW",iZ)}else{X.atKey=!0;let d=F.end,P=_?$(X,_,F,J):Z(X,d,S,null,F,J);if(nZ(_))J(P.range,"BLOCK_IN_FLOW",iZ);X.atKey=!1;let t=PX.resolveProps(C??[],{flow:Y,indicator:"map-value-ind",next:R,offset:P.range[2],onError:J,parentIndent:z.indent,startOnNewline:!1});if(t.found){if(!Q&&!F.found&&X.options.strict){if(C)for(let e of C){if(e===t.found)break;if(e.type==="newline"){J(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(F.start<t.found.offset-1024)J(t.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(R)if("source"in R&&R.source?.[0]===":")J(R,"MISSING_CHAR",`Missing space after : in ${Y}`);else J(t.start,"MISSING_CHAR",`Missing , or : between ${Y} items`);let g0=R?$(X,R,t,J):t.found?Z(X,t.end,C,null,t,J):null;if(g0){if(nZ(R))J(g0.range,"BLOCK_IN_FLOW",iZ)}else if(t.comment)if(P.comment)P.comment+=`
94
+ `+t.comment;else P.comment=t.comment;let T$=new wU.Pair(P,g0);if(X.options.keepSourceTokens)T$.srcToken=L;if(Q){let e=U;if(PU.mapIncludes(X,e.items,P))J(d,"DUPLICATE_KEY","Map keys must be unique");e.items.push(T$)}else{let e=new AX.YAMLMap(X.schema);e.flow=!0,e.items.push(T$);let f5=(g0??P).range;e.range=[P.range[0],f5[1],f5[2]],U.items.push(e)}H=g0?g0.range[2]:t.end}}let V=Q?"}":"]",[D,...M]=z.end,B=H;if(D?.source===V)B=D.offset+D.source.length;else{let N=Y[0].toUpperCase()+Y.substring(1),L=W?`${N} must end with a ${V}`:`${N} in block collection must be sufficiently indented and end with a ${V}`;if(J(H,W?"MISSING_CHAR":"BAD_INDENT",L),D&&D.source.length!==1)M.unshift(D)}if(M.length>0){let N=RU.resolveEnd(M,B,X.options.strict,J);if(N.comment)if(U.comment)U.comment+=`
95
+ `+N.comment;else U.comment=N.comment;U.range=[z.offset,B,N.offset]}else U.range=[z.offset,B,B];return U}_U.resolveFlowCollection=SU});var _X=T((hU)=>{var EU=k(),jU=r(),bU=c0(),xU=p0(),kU=FX(),fU=RX(),yU=SX();function sZ($,Z,X,z,J,q){let Q=X.type==="block-map"?kU.resolveBlockMap($,Z,X,z,q):X.type==="block-seq"?fU.resolveBlockSeq($,Z,X,z,q):yU.resolveFlowCollection($,Z,X,z,q),Y=Q.constructor;if(J==="!"||J===Y.tagName)return Q.tag=Y.tagName,Q;if(J)Q.tag=J;return Q}function gU($,Z,X,z,J){let q=z.tag,Q=!q?null:Z.directives.tagName(q.source,(V)=>J(q,"TAG_RESOLVE_FAILED",V));if(X.type==="block-seq"){let{anchor:V,newlineAfterProp:D}=z,M=V&&q?V.offset>q.offset?V:q:V??q;if(M&&(!D||D.offset<M.offset))J(M,"MISSING_CHAR","Missing newline after block sequence props")}let Y=X.type==="block-map"?"map":X.type==="block-seq"?"seq":X.start.source==="{"?"map":"seq";if(!q||!Q||Q==="!"||Q===bU.YAMLMap.tagName&&Y==="map"||Q===xU.YAMLSeq.tagName&&Y==="seq")return sZ($,Z,X,J,Q);let G=Z.schema.tags.find((V)=>V.tag===Q&&V.collection===Y);if(!G){let V=Z.schema.knownTags[Q];if(V?.collection===Y)Z.schema.tags.push(Object.assign({},V,{default:!1})),G=V;else{if(V)J(q,"BAD_COLLECTION_TYPE",`${V.tag} used for ${Y} collection, but expects ${V.collection??"scalar"}`,!0);else J(q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Q}`,!0);return sZ($,Z,X,J,Q)}}let U=sZ($,Z,X,J,Q,G),W=G.resolve?.(U,(V)=>J(q,"TAG_RESOLVE_FAILED",V),Z.options)??U,H=EU.isNode(W)?W:new jU.Scalar(W);if(H.range=U.range,H.tag=Q,G?.format)H.format=G.format;return H}hU.composeCollection=gU});var aZ=T((cU)=>{var rZ=r();function uU($,Z,X){let z=Z.offset,J=mU(Z,$.options.strict,X);if(!J)return{value:"",type:null,comment:"",range:[z,z,z]};let q=J.mode===">"?rZ.Scalar.BLOCK_FOLDED:rZ.Scalar.BLOCK_LITERAL,Q=Z.source?dU(Z.source):[],Y=Q.length;for(let B=Q.length-1;B>=0;--B){let N=Q[B][1];if(N===""||N==="\r")Y=B;else break}if(Y===0){let B=J.chomp==="+"&&Q.length>0?`
96
+ `.repeat(Math.max(1,Q.length-1)):"",N=z+J.length;if(Z.source)N+=Z.source.length;return{value:B,type:q,comment:J.comment,range:[z,N,N]}}let G=Z.indent+J.indent,U=Z.offset+J.length,W=0;for(let B=0;B<Y;++B){let[N,L]=Q[B];if(L===""||L==="\r"){if(J.indent===0&&N.length>G)G=N.length}else{if(N.length<G)X(U+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(J.indent===0)G=N.length;if(W=B,G===0&&!$.atRoot)X(U,"BAD_INDENT","Block scalar values in collections must be indented");break}U+=N.length+L.length+1}for(let B=Q.length-1;B>=Y;--B)if(Q[B][0].length>G)Y=B+1;let H="",V="",D=!1;for(let B=0;B<W;++B)H+=Q[B][0].slice(G)+`
97
+ `;for(let B=W;B<Y;++B){let[N,L]=Q[B];U+=N.length+L.length+1;let S=L[L.length-1]==="\r";if(S)L=L.slice(0,-1);if(L&&N.length<G){let C=`Block scalar lines must not be less indented than their ${J.indent?"explicit indentation indicator":"first line"}`;X(U-L.length-(S?2:1),"BAD_INDENT",C),N=""}if(q===rZ.Scalar.BLOCK_LITERAL)H+=V+N.slice(G)+L,V=`
98
+ `;else if(N.length>G||L[0]==="\t"){if(V===" ")V=`
99
+ `;else if(!D&&V===`
100
+ `)V=`
101
+
102
+ `;H+=V+N.slice(G)+L,V=`
103
+ `,D=!0}else if(L==="")if(V===`
104
+ `)H+=`
105
+ `;else V=`
106
+ `;else H+=V+L,V=" ",D=!1}switch(J.chomp){case"-":break;case"+":for(let B=Y;B<Q.length;++B)H+=`
107
+ `+Q[B][0].slice(G);if(H[H.length-1]!==`
108
+ `)H+=`
109
+ `;break;default:H+=`
110
+ `}let M=z+J.length+Z.source.length;return{value:H,type:q,comment:J.comment,range:[z,M,M]}}function mU({offset:$,props:Z},X,z){if(Z[0].type!=="block-scalar-header")return z(Z[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:J}=Z[0],q=J[0],Q=0,Y="",G=-1;for(let V=1;V<J.length;++V){let D=J[V];if(!Y&&(D==="-"||D==="+"))Y=D;else{let M=Number(D);if(!Q&&M)Q=M;else if(G===-1)G=$+V}}if(G!==-1)z(G,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${J}`);let U=!1,W="",H=J.length;for(let V=1;V<Z.length;++V){let D=Z[V];switch(D.type){case"space":U=!0;case"newline":H+=D.source.length;break;case"comment":if(X&&!U)z(D,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");H+=D.source.length,W=D.source.substring(1);break;case"error":z(D,"UNEXPECTED_TOKEN",D.message),H+=D.source.length;break;default:{let M=`Unexpected token in block scalar header: ${D.type}`;z(D,"UNEXPECTED_TOKEN",M);let B=D.source;if(B&&typeof B==="string")H+=B.length}}}return{mode:q,indent:Q,chomp:Y,comment:W,length:H}}function dU($){let Z=$.split(/\n( *)/),X=Z[0],z=X.match(/^( *)/),q=[z?.[1]?[z[1],X.slice(z[1].length)]:["",X]];for(let Q=1;Q<Z.length;Q+=2)q.push([Z[Q],Z[Q+1]]);return q}cU.resolveBlockScalar=uU});var tZ=T((eU)=>{var oZ=r(),lU=C$();function iU($,Z,X){let{offset:z,type:J,source:q,end:Q}=$,Y,G,U=(V,D,M)=>X(z+V,D,M);switch(J){case"scalar":Y=oZ.Scalar.PLAIN,G=nU(q,U);break;case"single-quoted-scalar":Y=oZ.Scalar.QUOTE_SINGLE,G=sU(q,U);break;case"double-quoted-scalar":Y=oZ.Scalar.QUOTE_DOUBLE,G=rU(q,U);break;default:return X($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${J}`),{value:"",type:null,comment:"",range:[z,z+q.length,z+q.length]}}let W=z+q.length,H=lU.resolveEnd(Q,W,Z,X);return{value:G,type:Y,comment:H.comment,range:[z,W,H.offset]}}function nU($,Z){let X="";switch($[0]){case"\t":X="a tab character";break;case",":X="flow indicator character ,";break;case"%":X="directive indicator character %";break;case"|":case">":{X=`block scalar indicator ${$[0]}`;break}case"@":case"`":{X=`reserved character ${$[0]}`;break}}if(X)Z(0,"BAD_SCALAR_START",`Plain value cannot start with ${X}`);return CX($)}function sU($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return CX($.slice(1,-1)).replace(/''/g,"'")}function CX($){let Z,X;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
111
+ `,"sy"),X=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
112
+ `,"sy")}catch{Z=/(.*?)[ \t]*\r?\n/sy,X=/[ \t]*(.*?)[ \t]*\r?\n/sy}let z=Z.exec($);if(!z)return $;let J=z[1],q=" ",Q=Z.lastIndex;X.lastIndex=Q;while(z=X.exec($)){if(z[1]==="")if(q===`
113
+ `)J+=q;else q=`
114
+ `;else J+=q+z[1],q=" ";Q=X.lastIndex}let Y=/[ \t]*(.*)/sy;return Y.lastIndex=Q,z=Y.exec($),J+q+(z?.[1]??"")}function rU($,Z){let X="";for(let z=1;z<$.length-1;++z){let J=$[z];if(J==="\r"&&$[z+1]===`
115
+ `)continue;if(J===`
116
+ `){let{fold:q,offset:Q}=aU($,z);X+=q,z=Q}else if(J==="\\"){let q=$[++z],Q=oU[q];if(Q)X+=Q;else if(q===`
117
+ `){q=$[z+1];while(q===" "||q==="\t")q=$[++z+1]}else if(q==="\r"&&$[z+1]===`
118
+ `){q=$[++z+1];while(q===" "||q==="\t")q=$[++z+1]}else if(q==="x"||q==="u"||q==="U"){let Y={x:2,u:4,U:8}[q];X+=tU($,z+1,Y,Z),z+=Y}else{let Y=$.substr(z-1,2);Z(z-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Y}`),X+=Y}}else if(J===" "||J==="\t"){let q=z,Q=$[z+1];while(Q===" "||Q==="\t")Q=$[++z+1];if(Q!==`
119
+ `&&!(Q==="\r"&&$[z+2]===`
120
+ `))X+=z>q?$.slice(q,z+1):J}else X+=J}if($[$.length-1]!=='"'||$.length===1)Z($.length,"MISSING_CHAR",'Missing closing "quote');return X}function aU($,Z){let X="",z=$[Z+1];while(z===" "||z==="\t"||z===`
121
+ `||z==="\r"){if(z==="\r"&&$[Z+2]!==`
122
+ `)break;if(z===`
123
+ `)X+=`
124
+ `;Z+=1,z=$[Z+1]}if(!X)X=" ";return{fold:X,offset:Z}}var oU={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
125
+ `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function tU($,Z,X,z){let J=$.substr(Z,X),Q=J.length===X&&/^[0-9a-fA-F]+$/.test(J)?parseInt(J,16):NaN;if(isNaN(Q)){let Y=$.substr(Z-2,X+2);return z(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Y}`),Y}return String.fromCodePoint(Q)}eU.resolveFlowScalar=iU});var jX=T((QW)=>{var G$=k(),EX=r(),ZW=aZ(),XW=tZ();function zW($,Z,X,z){let{value:J,type:q,comment:Q,range:Y}=Z.type==="block-scalar"?ZW.resolveBlockScalar($,Z,z):XW.resolveFlowScalar(Z,$.options.strict,z),G=X?$.directives.tagName(X.source,(H)=>z(X,"TAG_RESOLVE_FAILED",H)):null,U;if($.options.stringKeys&&$.atKey)U=$.schema[G$.SCALAR];else if(G)U=JW($.schema,J,G,X,z);else if(Z.type==="scalar")U=qW($,J,Z,z);else U=$.schema[G$.SCALAR];let W;try{let H=U.resolve(J,(V)=>z(X??Z,"TAG_RESOLVE_FAILED",V),$.options);W=G$.isScalar(H)?H:new EX.Scalar(H)}catch(H){let V=H instanceof Error?H.message:String(H);z(X??Z,"TAG_RESOLVE_FAILED",V),W=new EX.Scalar(J)}if(W.range=Y,W.source=J,q)W.type=q;if(G)W.tag=G;if(U.format)W.format=U.format;if(Q)W.comment=Q;return W}function JW($,Z,X,z,J){if(X==="!")return $[G$.SCALAR];let q=[];for(let Y of $.tags)if(!Y.collection&&Y.tag===X)if(Y.default&&Y.test)q.push(Y);else return Y;for(let Y of q)if(Y.test?.test(Z))return Y;let Q=$.knownTags[X];if(Q&&!Q.collection)return $.tags.push(Object.assign({},Q,{default:!1,test:void 0})),Q;return J(z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${X}`,X!=="tag:yaml.org,2002:str"),$[G$.SCALAR]}function qW({atKey:$,directives:Z,schema:X},z,J,q){let Q=X.tags.find((Y)=>(Y.default===!0||$&&Y.default==="key")&&Y.test?.test(z))||X[G$.SCALAR];if(X.compat){let Y=X.compat.find((G)=>G.default&&G.test?.test(z))??X[G$.SCALAR];if(Q.tag!==Y.tag){let G=Z.tagString(Q.tag),U=Z.tagString(Y.tag),W=`Value may be parsed as either ${G} or ${U}`;q(J,"TAG_RESOLVE_FAILED",W,!0)}}return Q}QW.composeScalar=zW});var bX=T((UW)=>{function GW($,Z,X){if(Z){X??(X=Z.length);for(let z=X-1;z>=0;--z){let J=Z[z];switch(J.type){case"space":case"comment":case"newline":$-=J.source.length;continue}J=Z[++z];while(J?.type==="space")$+=J.source.length,J=Z[++z];break}}return $}UW.emptyScalarPosition=GW});var fX=T((LW)=>{var VW=U6(),HW=k(),KW=_X(),xX=jX(),BW=C$(),DW=bX(),NW={composeNode:kX,composeEmptyNode:eZ};function kX($,Z,X,z){let J=$.atKey,{spaceBefore:q,comment:Q,anchor:Y,tag:G}=X,U,W=!0;switch(Z.type){case"alias":if(U=IW($,Z,z),Y||G)z(Z,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(U=xX.composeScalar($,Z,G,z),Y)U.anchor=Y.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(U=KW.composeCollection(NW,$,Z,X,z),Y)U.anchor=Y.source.substring(1);break;default:{let H=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;z(Z,"UNEXPECTED_TOKEN",H),U=eZ($,Z.offset,void 0,null,X,z),W=!1}}if(Y&&U.anchor==="")z(Y,"BAD_ALIAS","Anchor cannot be an empty string");if(J&&$.options.stringKeys&&(!HW.isScalar(U)||typeof U.value!=="string"||U.tag&&U.tag!=="tag:yaml.org,2002:str"))z(G??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(q)U.spaceBefore=!0;if(Q)if(Z.type==="scalar"&&Z.source==="")U.comment=Q;else U.commentBefore=Q;if($.options.keepSourceTokens&&W)U.srcToken=Z;return U}function eZ($,Z,X,z,{spaceBefore:J,comment:q,anchor:Q,tag:Y,end:G},U){let W={type:"scalar",offset:DW.emptyScalarPosition(Z,X,z),indent:-1,source:""},H=xX.composeScalar($,W,Y,U);if(Q){if(H.anchor=Q.source.substring(1),H.anchor==="")U(Q,"BAD_ALIAS","Anchor cannot be an empty string")}if(J)H.spaceBefore=!0;if(q)H.comment=q,H.range[2]=G;return H}function IW({options:$},{offset:Z,source:X,end:z},J){let q=new VW.Alias(X.substring(1));if(q.source==="")J(Z,"BAD_ALIAS","Alias cannot be an empty string");if(q.source.endsWith(":"))J(Z+X.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let Q=Z+X.length,Y=BW.resolveEnd(z,Q,$.strict,J);if(q.range=[Z,Q,Y.offset],Y.comment)q.comment=Y.comment;return q}LW.composeEmptyNode=eZ;LW.composeNode=kX});var gX=T((AW)=>{var OW=R6(),yX=fX(),wW=C$(),FW=P6();function RW($,Z,{offset:X,start:z,value:J,end:q},Q){let Y=Object.assign({_directives:Z},$),G=new OW.Document(void 0,Y),U={atKey:!1,atRoot:!0,directives:G.directives,options:G.options,schema:G.schema},W=FW.resolveProps(z,{indicator:"doc-start",next:J??q?.[0],offset:X,onError:Q,parentIndent:0,startOnNewline:!0});if(W.found){if(G.directives.docStart=!0,J&&(J.type==="block-map"||J.type==="block-seq")&&!W.hasNewline)Q(W.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}G.contents=J?yX.composeNode(U,J,W,Q):yX.composeEmptyNode(U,W.end,z,null,W,Q);let H=G.contents.range[2],V=wW.resolveEnd(q,H,!1,Q);if(V.comment)G.comment=V.comment;return G.range=[X,H,V.offset],G}AW.composeDoc=RW});var $4=T((bW)=>{var SW=z0("process"),_W=JZ(),CW=R6(),S6=A6(),hX=k(),EW=gX(),jW=C$();function _6($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:Z,source:X}=$;return[Z,Z+(typeof X==="string"?X.length:1)]}function vX($){let Z="",X=!1,z=!1;for(let J=0;J<$.length;++J){let q=$[J];switch(q[0]){case"#":Z+=(Z===""?"":z?`
126
+
127
+ `:`
128
+ `)+(q.substring(1)||" "),X=!0,z=!1;break;case"%":if($[J+1]?.[0]!=="#")J+=1;X=!1;break;default:if(!X)z=!0;X=!1}}return{comment:Z,afterEmptyLine:z}}class uX{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,X,z,J)=>{let q=_6(Z);if(J)this.warnings.push(new S6.YAMLWarning(q,X,z));else this.errors.push(new S6.YAMLParseError(q,X,z))},this.directives=new _W.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:X,afterEmptyLine:z}=vX(this.prelude);if(X){let J=$.contents;if(Z)$.comment=$.comment?`${$.comment}
129
+ ${X}`:X;else if(z||$.directives.docStart||!J)$.commentBefore=X;else if(hX.isCollection(J)&&!J.flow&&J.items.length>0){let q=J.items[0];if(hX.isPair(q))q=q.key;let Q=q.commentBefore;q.commentBefore=Q?`${X}
130
+ ${Q}`:X}else{let q=J.commentBefore;J.commentBefore=q?`${X}
131
+ ${q}`:X}}if(Z)Array.prototype.push.apply($.errors,this.errors),Array.prototype.push.apply($.warnings,this.warnings);else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:vX(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,Z=!1,X=-1){for(let z of $)yield*this.next(z);yield*this.end(Z,X)}*next($){if(SW.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,X,z)=>{let J=_6($);J[0]+=Z,this.onError(J,"BAD_DIRECTIVE",X,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=EW.composeDoc(this.options,this.directives,$,this.onError);if(this.atDirectives&&!Z.directives.docStart)this.onError($,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(Z,!1),this.doc)yield this.doc;this.doc=Z,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push($.source);break;case"error":{let Z=$.source?`${$.message}: ${JSON.stringify($.source)}`:$.message,X=new S6.YAMLParseError(_6($),"UNEXPECTED_TOKEN",Z);if(this.atDirectives||!this.doc)this.errors.push(X);else this.doc.errors.push(X);break}case"doc-end":{if(!this.doc){this.errors.push(new S6.YAMLParseError(_6($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=jW.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),Z.comment){let X=this.doc.comment;this.doc.comment=X?`${X}
132
+ ${Z.comment}`:Z.comment}this.doc.range[2]=Z.offset;break}default:this.errors.push(new S6.YAMLParseError(_6($),"UNEXPECTED_TOKEN",`Unsupported token ${$.type}`))}}*end($=!1,Z=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if($){let X=Object.assign({_directives:this.directives},this.options),z=new CW.Document(void 0,X);if(this.atDirectives)this.onError(Z,"MISSING_CHAR","Missing directives-end indicator line");z.range=[0,Z,Z],this.decorate(z,!1),yield z}}}bW.Composer=uX});var cX=T((mW)=>{var kW=aZ(),fW=tZ(),yW=A6(),mX=K6();function gW($,Z=!0,X){if($){let z=(J,q,Q)=>{let Y=typeof J==="number"?J:Array.isArray(J)?J[0]:J.offset;if(X)X(Y,q,Q);else throw new yW.YAMLParseError([Y,Y+1],q,Q)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return fW.resolveFlowScalar($,Z,z);case"block-scalar":return kW.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function hW($,Z){let{implicitKey:X=!1,indent:z,inFlow:J=!1,offset:q=-1,type:Q="PLAIN"}=Z,Y=mX.stringifyString({type:Q,value:$},{implicitKey:X,indent:z>0?" ".repeat(z):"",inFlow:J,options:{blockQuote:!0,lineWidth:-1}}),G=Z.end??[{type:"newline",offset:-1,indent:z,source:`
133
+ `}];switch(Y[0]){case"|":case">":{let U=Y.indexOf(`
134
+ `),W=Y.substring(0,U),H=Y.substring(U+1)+`
135
+ `,V=[{type:"block-scalar-header",offset:q,indent:z,source:W}];if(!dX(V,G))V.push({type:"newline",offset:-1,indent:z,source:`
136
+ `});return{type:"block-scalar",offset:q,indent:z,props:V,source:H}}case'"':return{type:"double-quoted-scalar",offset:q,indent:z,source:Y,end:G};case"'":return{type:"single-quoted-scalar",offset:q,indent:z,source:Y,end:G};default:return{type:"scalar",offset:q,indent:z,source:Y,end:G}}}function vW($,Z,X={}){let{afterKey:z=!1,implicitKey:J=!1,inFlow:q=!1,type:Q}=X,Y="indent"in $?$.indent:null;if(z&&typeof Y==="number")Y+=2;if(!Q)switch($.type){case"single-quoted-scalar":Q="QUOTE_SINGLE";break;case"double-quoted-scalar":Q="QUOTE_DOUBLE";break;case"block-scalar":{let U=$.props[0];if(U.type!=="block-scalar-header")throw Error("Invalid block scalar header");Q=U.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:Q="PLAIN"}let G=mX.stringifyString({type:Q,value:Z},{implicitKey:J||Y===null,indent:Y!==null&&Y>0?" ".repeat(Y):"",inFlow:q,options:{blockQuote:!0,lineWidth:-1}});switch(G[0]){case"|":case">":uW($,G);break;case'"':Z4($,G,"double-quoted-scalar");break;case"'":Z4($,G,"single-quoted-scalar");break;default:Z4($,G,"scalar")}}function uW($,Z){let X=Z.indexOf(`
137
+ `),z=Z.substring(0,X),J=Z.substring(X+1)+`
138
+ `;if($.type==="block-scalar"){let q=$.props[0];if(q.type!=="block-scalar-header")throw Error("Invalid block scalar header");q.source=z,$.source=J}else{let{offset:q}=$,Q="indent"in $?$.indent:-1,Y=[{type:"block-scalar-header",offset:q,indent:Q,source:z}];if(!dX(Y,"end"in $?$.end:void 0))Y.push({type:"newline",offset:-1,indent:Q,source:`
139
+ `});for(let G of Object.keys($))if(G!=="type"&&G!=="offset")delete $[G];Object.assign($,{type:"block-scalar",indent:Q,props:Y,source:J})}}function dX($,Z){if(Z)for(let X of Z)switch(X.type){case"space":case"comment":$.push(X);break;case"newline":return $.push(X),!0}return!1}function Z4($,Z,X){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=X,$.source=Z;break;case"block-scalar":{let z=$.props.slice(1),J=Z.length;if($.props[0].type==="block-scalar-header")J-=$.props[0].source.length;for(let q of z)q.offset+=J;delete $.props,Object.assign($,{type:X,source:Z,end:z});break}case"block-map":case"block-seq":{let J={type:"newline",offset:$.offset+Z.length,indent:$.indent,source:`
140
+ `};delete $.items,Object.assign($,{type:X,source:Z,end:[J]});break}default:{let z="indent"in $?$.indent:-1,J="end"in $&&Array.isArray($.end)?$.end.filter((q)=>q.type==="space"||q.type==="comment"||q.type==="newline"):[];for(let q of Object.keys($))if(q!=="type"&&q!=="offset")delete $[q];Object.assign($,{type:X,indent:z,source:Z,end:J})}}}mW.createScalarToken=hW;mW.resolveAsScalar=gW;mW.setScalarValue=vW});var pX=T((iW)=>{var lW=($)=>("type"in $)?J2($):z2($);function J2($){switch($.type){case"block-scalar":{let Z="";for(let X of $.props)Z+=J2(X);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let X of $.items)Z+=z2(X);return Z}case"flow-collection":{let Z=$.start.source;for(let X of $.items)Z+=z2(X);for(let X of $.end)Z+=X.source;return Z}case"document":{let Z=z2($);if($.end)for(let X of $.end)Z+=X.source;return Z}default:{let Z=$.source;if("end"in $&&$.end)for(let X of $.end)Z+=X.source;return Z}}}function z2({start:$,key:Z,sep:X,value:z}){let J="";for(let q of $)J+=q.source;if(Z)J+=J2(Z);if(X)for(let q of X)J+=q.source;if(z)J+=J2(z);return J}iW.stringify=lW});var nX=T((rW)=>{var X4=Symbol("break visit"),sW=Symbol("skip children"),lX=Symbol("remove item");function U$($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};iX(Object.freeze([]),$,Z)}U$.BREAK=X4;U$.SKIP=sW;U$.REMOVE=lX;U$.itemAtPath=($,Z)=>{let X=$;for(let[z,J]of Z){let q=X?.[z];if(q&&"items"in q)X=q.items[J];else return}return X};U$.parentCollection=($,Z)=>{let X=U$.itemAtPath($,Z.slice(0,-1)),z=Z[Z.length-1][0],J=X?.[z];if(J&&"items"in J)return J;throw Error("Parent collection not found")};function iX($,Z,X){let z=X(Z,$);if(typeof z==="symbol")return z;for(let J of["key","value"]){let q=Z[J];if(q&&"items"in q){for(let Q=0;Q<q.items.length;++Q){let Y=iX(Object.freeze($.concat([[J,Q]])),q.items[Q],X);if(typeof Y==="number")Q=Y-1;else if(Y===X4)return X4;else if(Y===lX)q.items.splice(Q,1),Q-=1}if(typeof z==="function"&&J==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}rW.visit=U$});var q2=T((zV)=>{var z4=cX(),oW=pX(),tW=nX(),J4="\uFEFF",q4="\x02",Q4="\x18",Y4="\x1F",eW=($)=>!!$&&("items"in $),$V=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function ZV($){switch($){case J4:return"<BOM>";case q4:return"<DOC>";case Q4:return"<FLOW_END>";case Y4:return"<SCALAR>";default:return JSON.stringify($)}}function XV($){switch($){case J4:return"byte-order-mark";case q4:return"doc-mode";case Q4:return"flow-error-end";case Y4:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
141
+ `:case`\r
142
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch($[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}zV.createScalarToken=z4.createScalarToken;zV.resolveAsScalar=z4.resolveAsScalar;zV.setScalarValue=z4.setScalarValue;zV.stringify=oW.stringify;zV.visit=tW.visit;zV.BOM=J4;zV.DOCUMENT=q4;zV.FLOW_END=Q4;zV.SCALAR=Y4;zV.isCollection=eW;zV.isScalar=$V;zV.prettyToken=ZV;zV.tokenType=XV});var U4=T((TV)=>{var C6=q2();function M0($){switch($){case void 0:case" ":case`
143
+ `:case"\r":case"\t":return!0;default:return!1}}var sX=new Set("0123456789ABCDEFabcdef"),IV=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Q2=new Set(",[]{}"),LV=new Set(` ,[]{}
144
+ \r `),G4=($)=>!$||LV.has($);class rX{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex($,Z=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!Z;let X=this.next??"stream";while(X&&(Z||this.hasChars(1)))X=yield*this.parseNext(X)}atLineEnd(){let $=this.pos,Z=this.buffer[$];while(Z===" "||Z==="\t")Z=this.buffer[++$];if(!Z||Z==="#"||Z===`
145
+ `)return!0;if(Z==="\r")return this.buffer[$+1]===`
146
+ `;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let Z=this.buffer[$];if(this.indentNext>0){let X=0;while(Z===" ")Z=this.buffer[++X+$];if(Z==="\r"){let z=this.buffer[X+$+1];if(z===`
147
+ `||!z&&!this.atEnd)return $+X+1}return Z===`
148
+ `||X>=this.indentNext||!Z&&!this.atEnd?$+X:-1}if(Z==="-"||Z==="."){let X=this.buffer.substr($,3);if((X==="---"||X==="...")&&M0(this.buffer[$+3]))return-1}return $}getLine(){let $=this.lineEndPos;if(typeof $!=="number"||$!==-1&&$<this.pos)$=this.buffer.indexOf(`
149
+ `,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===C6.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let Z=$.length,X=$.indexOf("#");while(X!==-1){let J=$[X-1];if(J===" "||J==="\t"){Z=X-1;break}else X=$.indexOf("#",X+1)}while(!0){let J=$[Z-1];if(J===" "||J==="\t")Z-=1;else break}let z=(yield*this.pushCount(Z))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-z),this.pushNewline(),"stream"}if(this.atLineEnd()){let Z=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-Z),yield*this.pushNewline(),"stream"}return yield C6.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let $=this.charAt(0);if(!$&&!this.atEnd)return this.setNext("line-start");if($==="-"||$==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let Z=this.peek(3);if((Z==="---"||Z==="...")&&M0(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,Z==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!M0(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,Z]=this.peek(2);if(!Z&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&M0(Z)){let X=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=X,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let $=this.getLine();if($===null)return this.setNext("doc");let Z=yield*this.pushIndicators();switch($[Z]){case"#":yield*this.pushCount($.length-Z);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(G4),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return Z+=yield*this.parseBlockScalarHeader(),Z+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-Z),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,Z,X=-1;do{if($=yield*this.pushNewline(),$>0)Z=yield*this.pushSpaces(!1),this.indentValue=X=Z;else Z=0;Z+=yield*this.pushSpaces(!0)}while($+Z>0);let z=this.getLine();if(z===null)return this.setNext("flow");if(X!==-1&&X<this.indentNext&&z[0]!=="#"||X===0&&(z.startsWith("---")||z.startsWith("..."))&&M0(z[3])){if(!(X===this.indentNext-1&&this.flowLevel===1&&(z[0]==="]"||z[0]==="}")))return this.flowLevel=0,yield C6.FLOW_END,yield*this.parseLineStart()}let J=0;while(z[J]===",")J+=yield*this.pushCount(1),J+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(J+=yield*this.pushIndicators(),z[J]){case void 0:return"flow";case"#":return yield*this.pushCount(z.length-J),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(G4),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let q=this.charAt(1);if(this.flowKey||M0(q)||q===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),Z=this.buffer.indexOf($,this.pos+1);if($==="'")while(Z!==-1&&this.buffer[Z+1]==="'")Z=this.buffer.indexOf("'",Z+2);else while(Z!==-1){let J=0;while(this.buffer[Z-1-J]==="\\")J+=1;if(J%2===0)break;Z=this.buffer.indexOf('"',Z+1)}let X=this.buffer.substring(0,Z),z=X.indexOf(`
150
+ `,this.pos);if(z!==-1){while(z!==-1){let J=this.continueScalar(z+1);if(J===-1)break;z=X.indexOf(`
151
+ `,J)}if(z!==-1)Z=z-(X[z-1]==="\r"?2:1)}if(Z===-1){if(!this.atEnd)return this.setNext("quoted-scalar");Z=this.buffer.length}return yield*this.pushToIndex(Z+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let Z=this.buffer[++$];if(Z==="+")this.blockScalarKeep=!0;else if(Z>"0"&&Z<="9")this.blockScalarIndent=Number(Z)-1;else if(Z!=="-")break}return yield*this.pushUntil((Z)=>M0(Z)||Z==="#")}*parseBlockScalar(){let $=this.pos-1,Z=0,X;$:for(let J=this.pos;X=this.buffer[J];++J)switch(X){case" ":Z+=1;break;case`
152
+ `:$=J,Z=0;break;case"\r":{let q=this.buffer[J+1];if(!q&&!this.atEnd)return this.setNext("block-scalar");if(q===`
153
+ `)break}default:break $}if(!X&&!this.atEnd)return this.setNext("block-scalar");if(Z>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=Z;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let J=this.continueScalar($+1);if(J===-1)break;$=this.buffer.indexOf(`
154
+ `,J)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let z=$+1;X=this.buffer[z];while(X===" ")X=this.buffer[++z];if(X==="\t"){while(X==="\t"||X===" "||X==="\r"||X===`
155
+ `)X=this.buffer[++z];$=z-1}else if(!this.blockScalarKeep)do{let J=$-1,q=this.buffer[J];if(q==="\r")q=this.buffer[--J];let Q=J;while(q===" ")q=this.buffer[--J];if(q===`
156
+ `&&J>=this.pos&&J+1+Z>Q)$=J;else break}while(!0);return yield C6.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,Z=this.pos-1,X=this.pos-1,z;while(z=this.buffer[++X])if(z===":"){let J=this.buffer[X+1];if(M0(J)||$&&Q2.has(J))break;Z=X}else if(M0(z)){let J=this.buffer[X+1];if(z==="\r")if(J===`
157
+ `)X+=1,z=`
158
+ `,J=this.buffer[X+1];else Z=X;if(J==="#"||$&&Q2.has(J))break;if(z===`
159
+ `){let q=this.continueScalar(X+1);if(q===-1)break;X=Math.max(X,q-2)}}else{if($&&Q2.has(z))break;Z=X}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield C6.SCALAR,yield*this.pushToIndex(Z+1,!0),$?"flow":"doc"}*pushCount($){if($>0)return yield this.buffer.substr(this.pos,$),this.pos+=$,$;return 0}*pushToIndex($,Z){let X=this.buffer.slice(this.pos,$);if(X)return yield X,this.pos+=X.length,X.length;else if(Z)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(G4))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,Z=this.charAt(1);if(M0(Z)||$&&Q2.has(Z)){if(!$)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let $=this.pos+2,Z=this.buffer[$];while(!M0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(IV.has(Z))Z=this.buffer[++$];else if(Z==="%"&&sX.has(this.buffer[$+1])&&sX.has(this.buffer[$+2]))Z=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
160
+ `)return yield*this.pushCount(1);else if($==="\r"&&this.charAt(1)===`
161
+ `)return yield*this.pushCount(2);else return 0}*pushSpaces($){let Z=this.pos-1,X;do X=this.buffer[++Z];while(X===" "||$&&X==="\t");let z=Z-this.pos;if(z>0)yield this.buffer.substr(this.pos,z),this.pos=Z;return z}*pushUntil($){let Z=this.pos,X=this.buffer[Z];while(!$(X))X=this.buffer[++Z];return yield*this.pushToIndex(Z,!1)}}TV.Lexer=rX});var W4=T((OV)=>{class aX{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let Z=0,X=this.lineStarts.length;while(Z<X){let J=Z+X>>1;if(this.lineStarts[J]<$)Z=J+1;else X=J}if(this.lineStarts[Z]===$)return{line:Z+1,col:1};if(Z===0)return{line:0,col:$};let z=this.lineStarts[Z-1];return{line:Z,col:$-z+1}}}}OV.LineCounter=aX});var V4=T((AV)=>{var FV=z0("process"),oX=q2(),RV=U4();function l0($,Z){for(let X=0;X<$.length;++X)if($[X].type===Z)return!0;return!1}function tX($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function $z($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Y2($){switch($.type){case"document":return $.start;case"block-map":{let Z=$.items[$.items.length-1];return Z.sep??Z.start}case"block-seq":return $.items[$.items.length-1].start;default:return[]}}function E$($){if($.length===0)return[];let Z=$.length;$:while(--Z>=0)switch($[Z].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break $}while($[++Z]?.type==="space");return $.splice(Z,$.length)}function eX($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!l0(Z.start,"explicit-key-ind")&&!l0(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,$z(Z.value))if(Z.value.end)Array.prototype.push.apply(Z.value.end,Z.sep);else Z.value.end=Z.sep;else Array.prototype.push.apply(Z.start,Z.sep);delete Z.sep}}}class Zz{constructor($){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new RV.Lexer,this.onNewLine=$}*parse($,Z=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let X of this.lexer.lex($,Z))yield*this.next(X);if(!Z)yield*this.end()}*next($){if(this.source=$,FV.env.LOG_TOKENS)console.log("|",oX.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=oX.tokenType($);if(!Z){let X=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:X,source:$}),this.offset+=$.length}else if(Z==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=Z,yield*this.step(),Z){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+$.length);break;case"space":if(this.atNewLine&&$[0]===" ")this.indent+=$.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=$.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=$.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let $=this.peek(1);if(this.type==="doc-end"&&$?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!$)return yield*this.stream();switch($.type){case"document":return yield*this.document($);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar($);case"block-scalar":return yield*this.blockScalar($);case"block-map":return yield*this.blockMap($);case"block-seq":return yield*this.blockSequence($);case"flow-collection":return yield*this.flowCollection($);case"doc-end":return yield*this.documentEnd($)}yield*this.pop()}peek($){return this.stack[this.stack.length-$]}*pop($){let Z=$??this.stack.pop();if(!Z)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield Z;else{let X=this.peek(1);if(Z.type==="block-scalar")Z.indent="indent"in X?X.indent:0;else if(Z.type==="flow-collection"&&X.type==="document")Z.indent=0;if(Z.type==="flow-collection")eX(Z);switch(X.type){case"document":X.value=Z;break;case"block-scalar":X.props.push(Z);break;case"block-map":{let z=X.items[X.items.length-1];if(z.value){X.items.push({start:[],key:Z,sep:[]}),this.onKeyLine=!0;return}else if(z.sep)z.value=Z;else{Object.assign(z,{key:Z,sep:[]}),this.onKeyLine=!z.explicitKey;return}break}case"block-seq":{let z=X.items[X.items.length-1];if(z.value)X.items.push({start:[],value:Z});else z.value=Z;break}case"flow-collection":{let z=X.items[X.items.length-1];if(!z||z.value)X.items.push({start:[],key:Z,sep:[]});else if(z.sep)z.value=Z;else Object.assign(z,{key:Z,sep:[]});return}default:yield*this.pop(),yield*this.pop(Z)}if((X.type==="document"||X.type==="block-map"||X.type==="block-seq")&&(Z.type==="block-map"||Z.type==="block-seq")){let z=Z.items[Z.items.length-1];if(z&&!z.sep&&!z.value&&z.start.length>0&&tX(z.start)===-1&&(Z.indent===0||z.start.every((J)=>J.type!=="comment"||J.indent<Z.indent))){if(X.type==="document")X.end=z.start;else X.items.push({start:z.start});Z.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if(tX($.start)!==-1)yield*this.pop(),yield*this.step();else $.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":$.start.push(this.sourceToken);return}let Z=this.startBlockValue($);if(Z)this.stack.push(Z);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar($){if(this.type==="map-value-ind"){let Z=Y2(this.peek(2)),X=E$(Z),z;if($.end)z=$.end,z.push(this.sourceToken),delete $.end;else z=[this.sourceToken];let J={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:X,key:$,sep:z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=J}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let Z=this.source.indexOf(`
162
+ `)+1;while(Z!==0)this.onNewLine(this.offset+Z),Z=this.source.indexOf(`
163
+ `,Z)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let Z=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,Z.value){let X="end"in Z.value?Z.value.end:void 0;if((Array.isArray(X)?X[X.length-1]:void 0)?.type==="comment")X?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)$.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else{if(this.atIndentedComment(Z.start,$.indent)){let z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){Array.prototype.push.apply(z,Z.start),z.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let X=!this.onKeyLine&&this.indent===$.indent,z=X&&(Z.sep||Z.explicitKey)&&this.type!=="seq-item-ind",J=[];if(z&&Z.sep&&!Z.value){let q=[];for(let Q=0;Q<Z.sep.length;++Q){let Y=Z.sep[Q];switch(Y.type){case"newline":q.push(Q);break;case"space":break;case"comment":if(Y.indent>$.indent)q.length=0;break;default:q.length=0}}if(q.length>=2)J=Z.sep.splice(q[1])}switch(this.type){case"anchor":case"tag":if(z||Z.value)J.push(this.sourceToken),$.items.push({start:J}),this.onKeyLine=!0;else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"explicit-key-ind":if(!Z.sep&&!Z.explicitKey)Z.start.push(this.sourceToken),Z.explicitKey=!0;else if(z||Z.value)J.push(this.sourceToken),$.items.push({start:J,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(Z.explicitKey)if(!Z.sep)if(l0(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let q=E$(Z.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:q,key:null,sep:[this.sourceToken]}]})}else if(Z.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(l0(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,key:null,sep:[this.sourceToken]}]});else if($z(Z.key)&&!l0(Z.sep,"newline")){let q=E$(Z.start),Q=Z.key,Y=Z.sep;Y.push(this.sourceToken),delete Z.key,delete Z.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:q,key:Q,sep:Y}]})}else if(J.length>0)Z.sep=Z.sep.concat(J,this.sourceToken);else Z.sep.push(this.sourceToken);else if(!Z.sep)Object.assign(Z,{key:null,sep:[this.sourceToken]});else if(Z.value||z)$.items.push({start:J,key:null,sep:[this.sourceToken]});else if(l0(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else Z.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let q=this.flowScalar(this.type);if(z||Z.value)$.items.push({start:J,key:q,sep:[]}),this.onKeyLine=!0;else if(Z.sep)this.stack.push(q);else Object.assign(Z,{key:q,sep:[]}),this.onKeyLine=!0;return}default:{let q=this.startBlockValue($);if(q){if(q.type==="block-seq"){if(!Z.explicitKey&&Z.sep&&!l0(Z.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(X)$.items.push({start:J});this.stack.push(q);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let Z=$.items[$.items.length-1];switch(this.type){case"newline":if(Z.value){let X="end"in Z.value?Z.value.end:void 0;if((Array.isArray(X)?X[X.length-1]:void 0)?.type==="comment")X?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(Z.start,$.indent)){let z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){Array.prototype.push.apply(z,Z.start),z.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return;case"anchor":case"tag":if(Z.value||this.indent<=$.indent)break;Z.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(Z.value||l0(Z.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return}if(this.indent>$.indent){let X=this.startBlockValue($);if(X){this.stack.push(X);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let Z=$.items[$.items.length-1];if(this.type==="flow-error-end"){let X;do yield*this.pop(),X=this.peek(1);while(X?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!Z||Z.sep)$.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return;case"map-value-ind":if(!Z||Z.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Object.assign(Z,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!Z||Z.value)$.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let z=this.flowScalar(this.type);if(!Z||Z.value)$.items.push({start:[],key:z,sep:[]});else if(Z.sep)this.stack.push(z);else Object.assign(Z,{key:z,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let X=this.startBlockValue($);if(X)this.stack.push(X);else yield*this.pop(),yield*this.step()}else{let X=this.peek(2);if(X.type==="block-map"&&(this.type==="map-value-ind"&&X.indent===$.indent||this.type==="newline"&&!X.items[X.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&X.type!=="flow-collection"){let z=Y2(X),J=E$(z);eX($);let q=$.end.splice(1,$.end.length);q.push(this.sourceToken);let Q={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:J,key:$,sep:q}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Q}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let Z=this.source.indexOf(`
164
+ `)+1;while(Z!==0)this.onNewLine(this.offset+Z),Z=this.source.indexOf(`
165
+ `,Z)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let Z=Y2($),X=E$(Z);return X.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Z=Y2($),X=E$(Z);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,Z){if(this.type!=="comment")return!1;if(this.indent<=Z)return!1;return $.every((X)=>X.type==="newline"||X.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}AV.Parser=Zz});var Qz=T((kV)=>{var Xz=$4(),SV=R6(),E6=A6(),_V=WZ(),CV=k(),EV=W4(),zz=V4();function Jz($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new EV.LineCounter||null,prettyErrors:Z}}function jV($,Z={}){let{lineCounter:X,prettyErrors:z}=Jz(Z),J=new zz.Parser(X?.addNewLine),q=new Xz.Composer(Z),Q=Array.from(q.compose(J.parse($)));if(z&&X)for(let Y of Q)Y.errors.forEach(E6.prettifyError($,X)),Y.warnings.forEach(E6.prettifyError($,X));if(Q.length>0)return Q;return Object.assign([],{empty:!0},q.streamInfo())}function qz($,Z={}){let{lineCounter:X,prettyErrors:z}=Jz(Z),J=new zz.Parser(X?.addNewLine),q=new Xz.Composer(Z),Q=null;for(let Y of q.compose(J.parse($),!0,$.length))if(!Q)Q=Y;else if(Q.options.logLevel!=="silent"){Q.errors.push(new E6.YAMLParseError(Y.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&X)Q.errors.forEach(E6.prettifyError($,X)),Q.warnings.forEach(E6.prettifyError($,X));return Q}function bV($,Z,X){let z=void 0;if(typeof Z==="function")z=Z;else if(X===void 0&&Z&&typeof Z==="object")X=Z;let J=qz($,X);if(!J)return null;if(J.warnings.forEach((q)=>_V.warn(J.options.logLevel,q)),J.errors.length>0)if(J.options.logLevel!=="silent")throw J.errors[0];else J.errors=[];return J.toJS(Object.assign({reviver:z},X))}function xV($,Z,X){let z=null;if(typeof Z==="function"||Array.isArray(Z))z=Z;else if(X===void 0&&Z)X=Z;if(typeof X==="string")X=X.length;if(typeof X==="number"){let J=Math.round(X);X=J<1?void 0:J>8?{indent:8}:{indent:J}}if($===void 0){let{keepUndefined:J}=X??Z??{};if(!J)return}if(CV.isDocument($)&&!z)return $.toString(X);return new SV.Document($,z,X).toString(X)}kV.parse=bV;kV.parseAllDocuments=jV;kV.parseDocument=qz;kV.stringify=xV});var Kz=T((_H,Hz)=>{var __dirname="/Users/wolfejam/FAF/cli/node_modules/faf-scoring-kernel",Wz={};Wz.__wbindgen_placeholder__=_H;var U2=null;function j$(){if(U2===null||U2.byteLength===0)U2=new Uint8Array(v.memory.buffer);return U2}var Vz=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});Vz.decode();function FH($,Z){return Vz.decode(j$().subarray($,$+Z))}function W$($,Z){return $=$>>>0,FH($,Z)}_H.sdk_version=function(){let $,Z;try{let X=v.sdk_version();return $=X[0],Z=X[1],W$(X[0],X[1])}finally{v.__wbindgen_free($,Z,1)}};var R0=0,b6=new TextEncoder;if(!("encodeInto"in b6))b6.encodeInto=function($,Z){let X=b6.encode($);return Z.set(X),{read:$.length,written:X.length}};function W2($,Z,X){if(X===void 0){let Y=b6.encode($),G=Z(Y.length,1)>>>0;return j$().subarray(G,G+Y.length).set(Y),R0=Y.length,G}let z=$.length,J=Z(z,1)>>>0,q=j$(),Q=0;for(;Q<z;Q++){let Y=$.charCodeAt(Q);if(Y>127)break;q[J+Q]=Y}if(Q!==z){if(Q!==0)$=$.slice(Q);J=X(J,z,z=Q+$.length*3,1)>>>0;let Y=j$().subarray(J+Q,J+z),G=b6.encodeInto($,Y);Q+=G.written,J=X(J,z,Q,1)>>>0}return R0=Q,J}function b$($){let Z=v.__wbindgen_externrefs.get($);return v.__externref_table_dealloc($),Z}_H.score_faf_enterprise=function($){let Z,X;try{let q=W2($,v.__wbindgen_malloc,v.__wbindgen_realloc),Q=R0,Y=v.score_faf_enterprise(q,Q);var z=Y[0],J=Y[1];if(Y[3])throw z=0,J=0,b$(Y[2]);return Z=z,X=J,W$(z,J)}finally{v.__wbindgen_free(Z,X,1)}};_H.score_faf=function($){let Z,X;try{let q=W2($,v.__wbindgen_malloc,v.__wbindgen_realloc),Q=R0,Y=v.score_faf(q,Q);var z=Y[0],J=Y[1];if(Y[3])throw z=0,J=0,b$(Y[2]);return Z=z,X=J,W$(z,J)}finally{v.__wbindgen_free(Z,X,1)}};function B4($,Z){let X=Z($.length*1,1)>>>0;return j$().set($,X/1),R0=$.length,X}_H.decompile_fafb=function($){let Z,X;try{let q=B4($,v.__wbindgen_malloc),Q=R0,Y=v.decompile_fafb(q,Q);var z=Y[0],J=Y[1];if(Y[3])throw z=0,J=0,b$(Y[2]);return Z=z,X=J,W$(z,J)}finally{v.__wbindgen_free(Z,X,1)}};_H.score_fafb=function($){let Z,X;try{let q=B4($,v.__wbindgen_malloc),Q=R0,Y=v.score_fafb(q,Q);var z=Y[0],J=Y[1];if(Y[3])throw z=0,J=0,b$(Y[2]);return Z=z,X=J,W$(z,J)}finally{v.__wbindgen_free(Z,X,1)}};_H.validate_faf=function($){let Z=W2($,v.__wbindgen_malloc,v.__wbindgen_realloc),X=R0;return v.validate_faf(Z,X)!==0};function RH($,Z){return $=$>>>0,j$().subarray($/1,$/1+Z)}_H.compile_fafb=function($){let Z=W2($,v.__wbindgen_malloc,v.__wbindgen_realloc),X=R0,z=v.compile_fafb(Z,X);if(z[3])throw b$(z[2]);var J=RH(z[0],z[1]).slice();return v.__wbindgen_free(z[0],z[1]*1,1),J};_H.fafb_info=function($){let Z,X;try{let q=B4($,v.__wbindgen_malloc),Q=R0,Y=v.fafb_info(q,Q);var z=Y[0],J=Y[1];if(Y[3])throw z=0,J=0,b$(Y[2]);return Z=z,X=J,W$(z,J)}finally{v.__wbindgen_free(Z,X,1)}};_H.__wbindgen_cast_2241b6af4c4b2941=function($,Z){return W$($,Z)};_H.__wbindgen_init_externref_table=function(){let $=v.__wbindgen_externrefs,Z=$.grow(4);$.set(0,void 0),$.set(Z+0,void 0),$.set(Z+1,null),$.set(Z+2,!0),$.set(Z+3,!1)};var AH=`${__dirname}/faf_wasm_sdk_bg.wasm`,PH=z0("fs").readFileSync(AH),SH=new WebAssembly.Module(PH),v=_H.__wasm=new WebAssembly.Instance(SH,Wz).exports;v.__wbindgen_start()});var az=T((kL,NK)=>{NK.exports={name:"faf-cli",version:"6.0.0",description:"The Persistent AI Context Standard — project DNA for any AI. IANA-registered. Anthropic-approved.",type:"module",icon:"https://faf.one/orange-smiley.svg",logo:"https://faf.one/orange-smiley.svg",main:"dist/index.js",bin:{faf:"dist/cli.js","faf-cli":"dist/cli.js"},exports:{".":{bun:"./src/index.ts",default:"./dist/index.js"}},files:["dist/**/*","README.md","LICENSE","project.faf"],scripts:{dev:"bun src/cli.ts",build:"bun build src/cli.ts --outfile dist/cli.js --target=node --minify && bun build src/index.ts --outfile dist/index.js --target=node --minify",compile:"bun build src/cli.ts --compile --bytecode --minify --outfile faf","compile:all":"bun build src/cli.ts --compile --target=bun-darwin-arm64 --outfile faf-darwin-arm64 && bun build src/cli.ts --compile --target=bun-darwin-x64 --outfile faf-darwin-x64 && bun build src/cli.ts --compile --target=bun-linux-x64 --outfile faf-linux-x64 && bun build src/cli.ts --compile --target=bun-windows-x64 --outfile faf-windows-x64.exe",test:"bun test","test:watch":"bun test --watch",lint:"eslint src/**/*.ts",format:"prettier --write 'src/**/*.ts'",prepublishOnly:"bun run build"},keywords:["faf","ai-context","project-dna","bi-sync","cli","claude","gemini","cursor","mcp","model-context-protocol","persistent-context","ai-readiness","foundational"],author:"wolfejam <wolfejam@faf.one>",license:"MIT",repository:{type:"git",url:"https://github.com/Wolfe-Jam/faf-cli.git"},homepage:"https://faf.one",bugs:{url:"https://github.com/Wolfe-Jam/faf-cli/issues"},dependencies:{commander:"^14.0.1","faf-scoring-kernel":"^2.0.3",open:"8.4.2",yaml:"^2.4.1"},optionalDependencies:{"@anthropic-ai/sdk":"^0.74.0"},devDependencies:{"@types/node":"^22.15.0",typescript:"^5.3.3",eslint:"^9.39.2","@typescript-eslint/eslint-plugin":"^8.41.0","@typescript-eslint/parser":"^8.41.0",prettier:"^3.2.5"},engines:{node:">=18.0.0"},publishConfig:{access:"public"}}});var P4=T((LT,G9)=>{var Y9=z0("fs"),A4;function AK(){try{return Y9.statSync("/.dockerenv"),!0}catch($){return!1}}function PK(){try{return Y9.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch($){return!1}}G9.exports=()=>{if(A4===void 0)A4=AK()||PK();return A4}});var V9=T((TT,S4)=>{var SK=z0("os"),_K=z0("fs"),U9=P4(),W9=()=>{if(process.platform!=="linux")return!1;if(SK.release().toLowerCase().includes("microsoft")){if(U9())return!1;return!0}try{return _K.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!U9():!1}catch($){return!1}};if(process.env.__IS_WSL_TEST__)S4.exports=W9;else S4.exports=W9()});var K9=T((MT,H9)=>{H9.exports=($,Z,X)=>{let z=(J)=>Object.defineProperty($,Z,{value:J,enumerable:!0,writable:!0});return Object.defineProperty($,Z,{configurable:!0,enumerable:!0,get(){let J=X();return z(J),J},set(J){z(J)}}),$}});var M9=T((OT,T9)=>{var __dirname="/Users/wolfejam/FAF/cli/node_modules/open",CK=z0("path"),EK=z0("child_process"),{promises:N2,constants:L9}=z0("fs"),D2=V9(),jK=P4(),C4=K9(),B9=CK.join(__dirname,"xdg-open"),{platform:h$,arch:D9}=process,bK=()=>{try{return N2.statSync("/run/.containerenv"),!0}catch{return!1}},_4;function xK(){if(_4===void 0)_4=bK()||jK();return _4}var kK=(()=>{let Z;return async function(){if(Z)return Z;let X="/etc/wsl.conf",z=!1;try{await N2.access(X,L9.F_OK),z=!0}catch{}if(!z)return"/mnt/";let J=await N2.readFile(X,{encoding:"utf8"}),q=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(J);if(!q)return"/mnt/";return Z=q.groups.mountPoint.trim(),Z=Z.endsWith("/")?Z:`${Z}/`,Z}})(),N9=async($,Z)=>{let X;for(let z of $)try{return await Z(z)}catch(J){X=J}throw X},I2=async($)=>{if($={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...$},Array.isArray($.app))return N9($.app,(Y)=>I2({...$,app:Y}));let{name:Z,arguments:X=[]}=$.app||{};if(X=[...X],Array.isArray(Z))return N9(Z,(Y)=>I2({...$,app:{name:Y,arguments:X}}));let z,J=[],q={};if(h$==="darwin"){if(z="open",$.wait)J.push("--wait-apps");if($.background)J.push("--background");if($.newInstance)J.push("--new");if(Z)J.push("-a",Z)}else if(h$==="win32"||D2&&!xK()&&!Z){let Y=await kK();if(z=D2?`${Y}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,J.push("-NoProfile","-NonInteractive","–ExecutionPolicy","Bypass","-EncodedCommand"),!D2)q.windowsVerbatimArguments=!0;let G=["Start"];if($.wait)G.push("-Wait");if(Z){if(G.push(`"\`"${Z}\`""`,"-ArgumentList"),$.target)X.unshift($.target)}else if($.target)G.push(`"${$.target}"`);if(X.length>0)X=X.map((U)=>`"\`"${U}\`""`),G.push(X.join(","));$.target=Buffer.from(G.join(" "),"utf16le").toString("base64")}else{if(Z)z=Z;else{let Y=!__dirname||__dirname==="/",G=!1;try{await N2.access(B9,L9.X_OK),G=!0}catch{}z=process.versions.electron||h$==="android"||Y||!G?"xdg-open":B9}if(X.length>0)J.push(...X);if(!$.wait)q.stdio="ignore",q.detached=!0}if($.target)J.push($.target);if(h$==="darwin"&&X.length>0)J.push("--args",...X);let Q=EK.spawn(z,J,q);if($.wait)return new Promise((Y,G)=>{Q.once("error",G),Q.once("close",(U)=>{if(!$.allowNonzeroExitCode&&U>0){G(Error(`Exited with code ${U}`));return}Y(Q)})});return Q.unref(),Q},E4=($,Z)=>{if(typeof $!=="string")throw TypeError("Expected a `target`");return I2({...Z,target:$})},fK=($,Z)=>{if(typeof $!=="string")throw TypeError("Expected a `name`");let{arguments:X=[]}=Z||{};if(X!==void 0&&X!==null&&!Array.isArray(X))throw TypeError("Expected `appArguments` as Array type");return I2({...Z,app:{name:$,arguments:X}})};function I9($){if(typeof $==="string"||Array.isArray($))return $;let{[D9]:Z}=$;if(!Z)throw Error(`${D9} is not supported`);return Z}function j4({[h$]:$},{wsl:Z}){if(Z&&D2)return I9(Z);if(!$)throw Error(`${h$} is not supported`);return I9($)}var L2={};C4(L2,"chrome",()=>j4({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));C4(L2,"firefox",()=>j4({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));C4(L2,"edge",()=>j4({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));E4.apps=L2;E4.openApp=fK;T9.exports=E4});function O($,Z,X,z,J){if(z==="m")throw TypeError("Private method is not writable");if(z==="a"&&!J)throw TypeError("Private accessor was defined without a setter");if(typeof Z==="function"?$!==Z||!J:!Z.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return z==="a"?J.call($,X):J?J.value=X:Z.set($,X),X}function K($,Z,X,z){if(X==="a"&&!z)throw TypeError("Private accessor was defined without a getter");if(typeof Z==="function"?$!==Z||!z:!Z.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return X==="m"?z:X==="a"?z.call($):z?z.value:Z.get($)}var j0=()=>{};var b4=function(){let{crypto:$}=globalThis;if($?.randomUUID)return b4=$.randomUUID.bind($),$.randomUUID();let Z=new Uint8Array(1),X=$?()=>$.getRandomValues(Z)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(z)=>(+z^X()&15>>+z/4).toString(16))};function b0($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var h6=($)=>{if($ instanceof Error)return $;if(typeof $==="object"&&$!==null){try{if(Object.prototype.toString.call($)==="[object Error]"){let Z=Error($.message,$.cause?{cause:$.cause}:{});if($.stack)Z.stack=$.stack;if($.cause&&!Z.cause)Z.cause=$.cause;if($.name)Z.name=$.name;return Z}}catch{}try{return Error(JSON.stringify($))}catch{}}return Error($)};var A,o,q0,n0,v$,u$,m$,d$,c$,p$,l$,i$,n$;var U0=j(()=>{A=class A extends Error{};o=class o extends A{constructor($,Z,X,z){super(`${o.makeMessage($,Z,X)}`);this.status=$,this.headers=z,this.requestID=z?.get("request-id"),this.error=Z}static makeMessage($,Z,X){let z=Z?.message?typeof Z.message==="string"?Z.message:JSON.stringify(Z.message):Z?JSON.stringify(Z):X;if($&&z)return`${$} ${z}`;if($)return`${$} status code (no body)`;if(z)return z;return"(no status code or body)"}static generate($,Z,X,z){if(!$||!z)return new n0({message:X,cause:h6(Z)});let J=Z;if($===400)return new u$($,J,X,z);if($===401)return new m$($,J,X,z);if($===403)return new d$($,J,X,z);if($===404)return new c$($,J,X,z);if($===409)return new p$($,J,X,z);if($===422)return new l$($,J,X,z);if($===429)return new i$($,J,X,z);if($>=500)return new n$($,J,X,z);return new o($,J,X,z)}};q0=class q0 extends o{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};n0=class n0 extends o{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};v$=class v$ extends n0{constructor({message:$}={}){super({message:$??"Request timed out."})}};u$=class u$ extends o{};m$=class m$ extends o{};d$=class d$ extends o{};c$=class c$ extends o{};p$=class p$ extends o{};l$=class l$ extends o{};i$=class i$ extends o{};n$=class n$ extends o{}});function T2($){if(typeof $!=="object")return{};return $??{}}function E9($){if(!$)return!0;for(let Z in $)return!1;return!0}function j9($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var $B,C9=($)=>{return $B.test($)},x4=($)=>(x4=Array.isArray,x4($)),k4,b9=($,Z)=>{if(typeof Z!=="number"||!Number.isInteger(Z))throw new A(`${$} must be an integer`);if(Z<0)throw new A(`${$} must be a positive integer`);return Z},M2=($)=>{try{return JSON.parse($)}catch(Z){return}};var K$=j(()=>{U0();$B=/^[a-z][a-z0-9+.-]*:/i,k4=x4});var x9=($)=>new Promise((Z)=>setTimeout(Z,$));var s0="0.74.0";function ZB(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}function zB(){if(typeof navigator>"u"||!navigator)return null;let $=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:Z,pattern:X}of $){let z=X.exec(navigator.userAgent);if(z){let J=z[1]||0,q=z[2]||0,Q=z[3]||0;return{browser:Z,version:`${J}.${q}.${Q}`}}}return null}var g9=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},XB=()=>{let $=ZB();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":s0,"X-Stainless-OS":f9(Deno.build.os),"X-Stainless-Arch":k9(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":s0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if($==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":s0,"X-Stainless-OS":f9(globalThis.process.platform??"unknown"),"X-Stainless-Arch":k9(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=zB();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":s0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${Z.browser}`,"X-Stainless-Runtime-Version":Z.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":s0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},k9=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},f9=($)=>{if($=$.toLowerCase(),$.includes("ios"))return"iOS";if($==="android")return"Android";if($==="darwin")return"MacOS";if($==="win32")return"Windows";if($==="freebsd")return"FreeBSD";if($==="openbsd")return"OpenBSD";if($==="linux")return"Linux";if($)return`Other:${$}`;return"Unknown"},y9,h9=()=>{return y9??(y9=XB())};var f4=()=>{};function v9(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function y4(...$){let Z=globalThis.ReadableStream;if(typeof Z>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new Z(...$)}function O2($){let Z=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return y4({start(){},async pull(X){let{done:z,value:J}=await Z.next();if(z)X.close();else X.enqueue(J)},async cancel(){await Z.return?.()}})}function v6($){if($[Symbol.asyncIterator])return $;let Z=$.getReader();return{async next(){try{let X=await Z.read();if(X?.done)Z.releaseLock();return X}catch(X){throw Z.releaseLock(),X}},async return(){let X=Z.cancel();return Z.releaseLock(),await X,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function u9($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),X=Z.cancel();Z.releaseLock(),await X}var m9=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function p9($){let Z=0;for(let J of $)Z+=J.length;let X=new Uint8Array(Z),z=0;for(let J of $)X.set(J,z),z+=J.length;return X}function u6($){let Z;return(d9??(Z=new globalThis.TextEncoder,d9=Z.encode.bind(Z)))($)}function g4($){let Z;return(c9??(Z=new globalThis.TextDecoder,c9=Z.decode.bind(Z)))($)}var d9,c9;class r0{constructor(){W0.set(this,void 0),V0.set(this,void 0),O(this,W0,new Uint8Array,"f"),O(this,V0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?u6($):$;O(this,W0,p9([K(this,W0,"f"),Z]),"f");let X=[],z;while((z=QB(K(this,W0,"f"),K(this,V0,"f")))!=null){if(z.carriage&&K(this,V0,"f")==null){O(this,V0,z.index,"f");continue}if(K(this,V0,"f")!=null&&(z.index!==K(this,V0,"f")+1||z.carriage)){X.push(g4(K(this,W0,"f").subarray(0,K(this,V0,"f")-1))),O(this,W0,K(this,W0,"f").subarray(K(this,V0,"f")),"f"),O(this,V0,null,"f");continue}let J=K(this,V0,"f")!==null?z.preceding-1:z.preceding,q=g4(K(this,W0,"f").subarray(0,J));X.push(q),O(this,W0,K(this,W0,"f").subarray(z.index),"f"),O(this,V0,null,"f")}return X}flush(){if(!K(this,W0,"f").length)return[];return this.decode(`
166
+ `)}}function QB($,Z){for(let J=Z??0;J<$.length;J++){if($[J]===10)return{preceding:J,index:J+1,carriage:!1};if($[J]===13)return{preceding:J,index:J+1,carriage:!0}}return null}function l9($){for(let z=0;z<$.length-1;z++){if($[z]===10&&$[z+1]===10)return z+2;if($[z]===13&&$[z+1]===13)return z+2;if($[z]===13&&$[z+1]===10&&z+3<$.length&&$[z+2]===13&&$[z+3]===10)return z+4}return-1}var W0,V0;var h4=j(()=>{j0();W0=new WeakMap,V0=new WeakMap;r0.NEWLINE_CHARS=new Set([`
167
+ `,"\r"]);r0.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function m6(){}function w2($,Z,X){if(!Z||F2[$]>F2[X])return m6;else return Z[$].bind(Z)}function J0($){let Z=$.logger,X=$.logLevel??"off";if(!Z)return YB;let z=i9.get(Z);if(z&&z[0]===X)return z[1];let J={error:w2("error",Z,X),warn:w2("warn",Z,X),info:w2("info",Z,X),debug:w2("debug",Z,X)};return i9.set(Z,[X,J]),J}var F2,v4=($,Z,X)=>{if(!$)return;if(j9(F2,$))return $;J0(X).warn(`${Z} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(F2))}`);return},YB,i9,x0=($)=>{if($.options)$.options={...$.options},delete $.options.headers;if($.headers)$.headers=Object.fromEntries(($.headers instanceof Headers?[...$.headers]:Object.entries($.headers)).map(([Z,X])=>[Z,Z.toLowerCase()==="x-api-key"||Z.toLowerCase()==="authorization"||Z.toLowerCase()==="cookie"||Z.toLowerCase()==="set-cookie"?"***":X]));if("retryOfRequestLogID"in $){if($.retryOfRequestLogID)$.retryOf=$.retryOfRequestLogID;delete $.retryOfRequestLogID}return $};var R2=j(()=>{K$();F2={off:0,error:200,warn:300,info:400,debug:500};YB={error:m6,warn:m6,info:m6,debug:m6},i9=new WeakMap});async function*GB($,Z){if(!$.body){if(Z.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new A("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new A("Attempted to iterate over a response with no body")}let X=new n9,z=new r0,J=v6($.body);for await(let q of UB(J))for(let Q of z.decode(q)){let Y=X.decode(Q);if(Y)yield Y}for(let q of z.flush()){let Q=X.decode(q);if(Q)yield Q}}async function*UB($){let Z=new Uint8Array;for await(let X of $){if(X==null)continue;let z=X instanceof ArrayBuffer?new Uint8Array(X):typeof X==="string"?u6(X):X,J=new Uint8Array(Z.length+z.length);J.set(Z),J.set(z,Z.length),Z=J;let q;while((q=l9(Z))!==-1)yield Z.slice(0,q),Z=Z.slice(q)}if(Z.length>0)yield Z}class n9{constructor(){this.event=null,this.data=[],this.chunks=[]}decode($){if($.endsWith("\r"))$=$.substring(0,$.length-1);if(!$){if(!this.event&&!this.data.length)return null;let J={event:this.event,data:this.data.join(`
168
+ `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],J}if(this.chunks.push($),$.startsWith(":"))return null;let[Z,X,z]=WB($,":");if(z.startsWith(" "))z=z.substring(1);if(Z==="event")this.event=z;else if(Z==="data")this.data.push(z);return null}}function WB($,Z){let X=$.indexOf(Z);if(X!==-1)return[$.substring(0,X),Z,$.substring(X+Z.length)];return[$,"",""]}var d6,H0;var u4=j(()=>{j0();U0();h4();K$();R2();U0();H0=class H0{constructor($,Z,X){this.iterator=$,d6.set(this,void 0),this.controller=Z,O(this,d6,X,"f")}static fromSSEResponse($,Z,X){let z=!1,J=X?J0(X):console;async function*q(){if(z)throw new A("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");z=!0;let Q=!1;try{for await(let Y of GB($,Z)){if(Y.event==="completion")try{yield JSON.parse(Y.data)}catch(G){throw J.error("Could not parse message into JSON:",Y.data),J.error("From chunk:",Y.raw),G}if(Y.event==="message_start"||Y.event==="message_delta"||Y.event==="message_stop"||Y.event==="content_block_start"||Y.event==="content_block_delta"||Y.event==="content_block_stop")try{yield JSON.parse(Y.data)}catch(G){throw J.error("Could not parse message into JSON:",Y.data),J.error("From chunk:",Y.raw),G}if(Y.event==="ping")continue;if(Y.event==="error")throw new o(void 0,M2(Y.data)??Y.data,void 0,$.headers)}Q=!0}catch(Y){if(b0(Y))return;throw Y}finally{if(!Q)Z.abort()}}return new H0(q,Z,X)}static fromReadableStream($,Z,X){let z=!1;async function*J(){let Q=new r0,Y=v6($);for await(let G of Y)for(let U of Q.decode(G))yield U;for(let G of Q.flush())yield G}async function*q(){if(z)throw new A("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");z=!0;let Q=!1;try{for await(let Y of J()){if(Q)continue;if(Y)yield JSON.parse(Y)}Q=!0}catch(Y){if(b0(Y))return;throw Y}finally{if(!Q)Z.abort()}}return new H0(q,Z,X)}[(d6=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let $=[],Z=[],X=this.iterator(),z=(J)=>{return{next:()=>{if(J.length===0){let q=X.next();$.push(q),Z.push(q)}return J.shift()}}};return[new H0(()=>z($),this.controller,K(this,d6,"f")),new H0(()=>z(Z),this.controller,K(this,d6,"f"))]}toReadableStream(){let $=this,Z;return y4({async start(){Z=$[Symbol.asyncIterator]()},async pull(X){try{let{value:z,done:J}=await Z.next();if(J)return X.close();let q=u6(JSON.stringify(z)+`
169
+ `);X.enqueue(q)}catch(z){X.error(z)}},async cancel(){await Z.return?.()}})}}});async function A2($,Z){let{response:X,requestLogID:z,retryOfRequestLogID:J,startTime:q}=Z,Q=await(async()=>{if(Z.options.stream){if(J0($).debug("response",X.status,X.url,X.headers,X.body),Z.options.__streamClass)return Z.options.__streamClass.fromSSEResponse(X,Z.controller);return H0.fromSSEResponse(X,Z.controller)}if(X.status===204)return null;if(Z.options.__binaryResponse)return X;let G=X.headers.get("content-type")?.split(";")[0]?.trim();if(G?.includes("application/json")||G?.endsWith("+json")){if(X.headers.get("content-length")==="0")return;let V=await X.json();return m4(V,X)}return await X.text()})();return J0($).debug(`[${z}] response parsed`,x0({retryOfRequestLogID:J,url:X.url,status:X.status,body:Q,durationMs:Date.now()-q})),Q}function m4($,Z){if(!$||typeof $!=="object"||Array.isArray($))return $;return Object.defineProperty($,"_request_id",{value:Z.headers.get("request-id"),enumerable:!1})}var d4=j(()=>{u4();R2()});var c6,a0;var P2=j(()=>{j0();d4();a0=class a0 extends Promise{constructor($,Z,X=A2){super((z)=>{z(null)});this.responsePromise=Z,this.parseResponse=X,c6.set(this,void 0),O(this,c6,$,"f")}_thenUnwrap($){return new a0(K(this,c6,"f"),this.responsePromise,async(Z,X)=>m4($(await this.parseResponse(Z,X),X),X.response))}asResponse(){return this.responsePromise.then(($)=>$.response)}async withResponse(){let[$,Z]=await Promise.all([this.parse(),this.asResponse()]);return{data:$,response:Z,request_id:Z.headers.get("request-id")}}parse(){if(!this.parsedPromise)this.parsedPromise=this.responsePromise.then(($)=>this.parseResponse(K(this,c6,"f"),$));return this.parsedPromise}then($,Z){return this.parse().then($,Z)}catch($){return this.parse().catch($)}finally($){return this.parse().finally($)}};c6=new WeakMap});var S2,c4,p6,O0,l6;var A0=j(()=>{j0();U0();d4();P2();K$();c4=class c4{constructor($,Z,X,z){S2.set(this,void 0),O(this,S2,$,"f"),this.options=z,this.response=Z,this.body=X}hasNextPage(){if(!this.getPaginatedItems().length)return!1;return this.nextPageRequestOptions()!=null}async getNextPage(){let $=this.nextPageRequestOptions();if(!$)throw new A("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await K(this,S2,"f").requestAPIList(this.constructor,$)}async*iterPages(){let $=this;yield $;while($.hasNextPage())$=await $.getNextPage(),yield $}async*[(S2=new WeakMap,Symbol.asyncIterator)](){for await(let $ of this.iterPages())for(let Z of $.getPaginatedItems())yield Z}};p6=class p6 extends a0{constructor($,Z,X){super($,Z,async(z,J)=>new X(z,J.response,await A2(z,J),J.options))}async*[Symbol.asyncIterator](){let $=await this;for await(let Z of $)yield Z}};O0=class O0 extends c4{constructor($,Z,X,z){super($,Z,X,z);this.data=X.data||[],this.has_more=X.has_more||!1,this.first_id=X.first_id||null,this.last_id=X.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let Z=this.first_id;if(!Z)return null;return{...this.options,query:{...T2(this.options.query),before_id:Z}}}let $=this.last_id;if(!$)return null;return{...this.options,query:{...T2(this.options.query),after_id:$}}}};l6=class l6 extends c4{constructor($,Z,X,z){super($,Z,X,z);this.data=X.data||[],this.has_more=X.has_more||!1,this.next_page=X.next_page||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){let $=this.next_page;if(!$)return null;return{...this.options,query:{...T2(this.options.query),page:$}}}}});function B$($,Z,X){return l4(),new File($,Z??"unknown_file",X)}function i6($,Z){let X=typeof $==="object"&&$!==null&&(("name"in $)&&$.name&&String($.name)||("url"in $)&&$.url&&String($.url)||("filename"in $)&&$.filename&&String($.filename)||("path"in $)&&$.path&&String($.path))||"";return Z?X.split(/[\\/]/).pop()||void 0:X}function HB($){let Z=typeof $==="function"?$:$.fetch,X=s9.get(Z);if(X)return X;let z=(async()=>{try{let J="Response"in Z?Z.Response:(await Z("data:,")).constructor,q=new FormData;if(q.toString()===await new J(q).text())return!1;return!0}catch{return!0}})();return s9.set(Z,z),z}var l4=()=>{if(typeof File>"u"){let{process:$}=globalThis,Z=typeof $?.versions?.node==="string"&&parseInt($.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(Z?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},i4=($)=>$!=null&&typeof $==="object"&&typeof $[Symbol.asyncIterator]==="function",s$=async($,Z,X=!0)=>{return{...$,body:await KB($.body,Z,X)}},s9,KB=async($,Z,X=!0)=>{if(!await HB(Z))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let z=new FormData;return await Promise.all(Object.entries($||{}).map(([J,q])=>p4(z,J,q,X))),z},BB=($)=>$ instanceof Blob&&("name"in $),p4=async($,Z,X,z)=>{if(X===void 0)return;if(X==null)throw TypeError(`Received null for "${Z}"; to pass null in FormData, you must use the string 'null'`);if(typeof X==="string"||typeof X==="number"||typeof X==="boolean")$.append(Z,String(X));else if(X instanceof Response){let J={},q=X.headers.get("Content-Type");if(q)J={type:q};$.append(Z,B$([await X.blob()],i6(X,z),J))}else if(i4(X))$.append(Z,B$([await new Response(O2(X)).blob()],i6(X,z)));else if(BB(X))$.append(Z,B$([X],i6(X,z),{type:X.type}));else if(Array.isArray(X))await Promise.all(X.map((J)=>p4($,Z+"[]",J,z)));else if(typeof X==="object")await Promise.all(Object.entries(X).map(([J,q])=>p4($,`${Z}[${J}]`,q,z)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${X} instead`)};var r$=j(()=>{s9=new WeakMap});async function n6($,Z,X){if(l4(),$=await $,Z||(Z=i6($,!0)),DB($)){if($ instanceof File&&Z==null&&X==null)return $;return B$([await $.arrayBuffer()],Z??$.name,{type:$.type,lastModified:$.lastModified,...X})}if(NB($)){let J=await $.blob();return Z||(Z=new URL($.url).pathname.split(/[\\/]/).pop()),B$(await n4(J),Z,X)}let z=await n4($);if(!X?.type){let J=z.find((q)=>typeof q==="object"&&("type"in q)&&q.type);if(typeof J==="string")X={...X,type:J}}return B$(z,Z,X)}async function n4($){let Z=[];if(typeof $==="string"||ArrayBuffer.isView($)||$ instanceof ArrayBuffer)Z.push($);else if(r9($))Z.push($ instanceof Blob?$:await $.arrayBuffer());else if(i4($))for await(let X of $)Z.push(...await n4(X));else{let X=$?.constructor?.name;throw Error(`Unexpected data type: ${typeof $}${X?`; constructor: ${X}`:""}${IB($)}`)}return Z}function IB($){if(typeof $!=="object"||$===null)return"";return`; props: [${Object.getOwnPropertyNames($).map((X)=>`"${X}"`).join(", ")}]`}var r9=($)=>$!=null&&typeof $==="object"&&typeof $.size==="number"&&typeof $.type==="string"&&typeof $.text==="function"&&typeof $.slice==="function"&&typeof $.arrayBuffer==="function",DB=($)=>$!=null&&typeof $==="object"&&typeof $.name==="string"&&typeof $.lastModified==="number"&&r9($),NB=($)=>$!=null&&typeof $==="object"&&typeof $.url==="string"&&typeof $.blob==="function";var a9=j(()=>{r$();r$()});var s4=j(()=>{a9()});var o9=()=>{};class l{constructor($){this._client=$}}function*TB($){if(!$)return;if(t9 in $){let{values:z,nulls:J}=$;yield*z.entries();for(let q of J)yield[q,null];return}let Z=!1,X;if($ instanceof Headers)X=$.entries();else if(k4($))X=$;else Z=!0,X=Object.entries($??{});for(let z of X){let J=z[0];if(typeof J!=="string")throw TypeError("expected header name to be a string");let q=k4(z[1])?z[1]:[z[1]],Q=!1;for(let Y of q){if(Y===void 0)continue;if(Z&&!Q)Q=!0,yield[J,null];yield[J,Y]}}}var t9,E=($)=>{let Z=new Headers,X=new Set;for(let z of $){let J=new Set;for(let[q,Q]of TB(z)){let Y=q.toLowerCase();if(!J.has(Y))Z.delete(q),J.add(Y);if(Q===null)Z.delete(q),X.add(Y);else Z.append(q,Q),X.delete(Y)}}return{[t9]:!0,values:Z,nulls:X}};var K0=j(()=>{K$();t9=Symbol.for("brand.privateNullableHeaders")});function _2($){return typeof $==="object"&&$!==null&&s6 in $}function r4($,Z){let X=new Set;if($){for(let z of $)if(_2(z))X.add(z[s6])}if(Z)for(let z of Z){if(_2(z))X.add(z[s6]);if(Array.isArray(z.content)){for(let J of z.content)if(_2(J))X.add(J[s6])}}return Array.from(X)}function C2($,Z){let X=r4($,Z);if(X.length===0)return{};return{"x-stainless-helper":X.join(", ")}}function e9($){if(_2($))return{"x-stainless-helper":$[s6]};return{}}var s6;var r6=j(()=>{s6=Symbol("anthropic.sdk.stainlessHelper")});function ZJ($){return $.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var $J,MB=($=ZJ)=>function(X,...z){if(X.length===1)return X[0];let J=!1,q=[],Q=X.reduce((W,H,V)=>{if(/[?#]/.test(H))J=!0;let D=z[V],M=(J?encodeURIComponent:$)(""+D);if(V!==z.length&&(D==null||typeof D==="object"&&D.toString===Object.getPrototypeOf(Object.getPrototypeOf(D.hasOwnProperty??$J)??$J)?.toString))M=D+"",q.push({start:W.length+H.length,length:M.length,error:`Value of type ${Object.prototype.toString.call(D).slice(8,-1)} is not a valid path parameter`});return W+H+(V===z.length?"":M)},""),Y=Q.split(/[?#]/,1)[0],G=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,U;while((U=G.exec(Y))!==null)q.push({start:U.index,length:U[0].length,error:`Value "${U[0]}" can't be safely passed as a path parameter`});if(q.sort((W,H)=>W.start-H.start),q.length>0){let W=0,H=q.reduce((V,D)=>{let M=" ".repeat(D.start-W),B="^".repeat(D.length);return W=D.start+D.length,V+M+B},"");throw new A(`Path parameters result in path with invalid segments:
170
+ ${q.map((V)=>V.error).join(`
171
+ `)}
172
+ ${Q}
173
+ ${H}`)}return Q},c;var o0=j(()=>{U0();$J=Object.freeze(Object.create(null)),c=MB(ZJ)});var a6;var a4=j(()=>{A0();K0();r6();r$();o0();a6=class a6 extends l{list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/files",O0,{query:z,...Z,headers:E([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(c`/v1/files/${$}`,{...X,headers:E([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},X?.headers])})}download($,Z={},X){let{betas:z}=Z??{};return this._client.get(c`/v1/files/${$}/content`,{...X,headers:E([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},X?.headers]),__binaryResponse:!0})}retrieveMetadata($,Z={},X){let{betas:z}=Z??{};return this._client.get(c`/v1/files/${$}`,{...X,headers:E([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},X?.headers])})}upload($,Z){let{betas:X,...z}=$;return this._client.post("/v1/files",s$({body:z,...Z,headers:E([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},e9(z.file),Z?.headers])},this._client))}}});var o6;var o4=j(()=>{A0();K0();o0();o6=class o6 extends l{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(c`/v1/models/${$}?beta=true`,{...X,headers:E([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/models?beta=true",O0,{query:z,...Z,headers:E([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var a$=j(()=>{U0()});var E2;var t4=j(()=>{E2={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function XJ($){return $?.output_format??$?.output_config?.format}function e4($,Z,X){let z=XJ(Z);if(!Z||!("parse"in(z??{})))return{...$,content:$.content.map((J)=>{if(J.type==="text"){let q=Object.defineProperty({...J},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(q,"parsed",{get(){return X.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return J}),parsed_output:null};return $5($,Z,X)}function $5($,Z,X){let z=null,J=$.content.map((q)=>{if(q.type==="text"){let Q=FB(Z,q.text);if(z===null)z=Q;let Y=Object.defineProperty({...q},"parsed_output",{value:Q,enumerable:!1});return Object.defineProperty(Y,"parsed",{get(){return X.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),Q},enumerable:!1})}return q});return{...$,content:J,parsed_output:z}}function FB($,Z){let X=XJ($);if(X?.type!=="json_schema")return null;try{if("parse"in X)return X.parse(Z);return JSON.parse(Z)}catch(z){throw new A(`Failed to parse structured output: ${z}`)}}var Z5=j(()=>{U0()});var RB=($)=>{let Z=0,X=[];while(Z<$.length){let z=$[Z];if(z==="\\"){Z++;continue}if(z==="{"){X.push({type:"brace",value:"{"}),Z++;continue}if(z==="}"){X.push({type:"brace",value:"}"}),Z++;continue}if(z==="["){X.push({type:"paren",value:"["}),Z++;continue}if(z==="]"){X.push({type:"paren",value:"]"}),Z++;continue}if(z===":"){X.push({type:"separator",value:":"}),Z++;continue}if(z===","){X.push({type:"delimiter",value:","}),Z++;continue}if(z==='"'){let Y="",G=!1;z=$[++Z];while(z!=='"'){if(Z===$.length){G=!0;break}if(z==="\\"){if(Z++,Z===$.length){G=!0;break}Y+=z+$[Z],z=$[++Z]}else Y+=z,z=$[++Z]}if(z=$[++Z],!G)X.push({type:"string",value:Y});continue}if(z&&/\s/.test(z)){Z++;continue}let q=/[0-9]/;if(z&&q.test(z)||z==="-"||z==="."){let Y="";if(z==="-")Y+=z,z=$[++Z];while(z&&q.test(z)||z===".")Y+=z,z=$[++Z];X.push({type:"number",value:Y});continue}let Q=/[a-z]/i;if(z&&Q.test(z)){let Y="";while(z&&Q.test(z)){if(Z===$.length)break;Y+=z,z=$[++Z]}if(Y=="true"||Y=="false"||Y==="null")X.push({type:"name",value:Y});else{Z++;continue}continue}Z++}return X},o$=($)=>{if($.length===0)return $;let Z=$[$.length-1];switch(Z.type){case"separator":return $=$.slice(0,$.length-1),o$($);break;case"number":let X=Z.value[Z.value.length-1];if(X==="."||X==="-")return $=$.slice(0,$.length-1),o$($);case"string":let z=$[$.length-2];if(z?.type==="delimiter")return $=$.slice(0,$.length-1),o$($);else if(z?.type==="brace"&&z.value==="{")return $=$.slice(0,$.length-1),o$($);break;case"delimiter":return $=$.slice(0,$.length-1),o$($);break}return $},AB=($)=>{let Z=[];if($.map((X)=>{if(X.type==="brace")if(X.value==="{")Z.push("}");else Z.splice(Z.lastIndexOf("}"),1);if(X.type==="paren")if(X.value==="[")Z.push("]");else Z.splice(Z.lastIndexOf("]"),1)}),Z.length>0)Z.reverse().map((X)=>{if(X==="}")$.push({type:"brace",value:"}"});else if(X==="]")$.push({type:"paren",value:"]"})});return $},PB=($)=>{let Z="";return $.map((X)=>{switch(X.type){case"string":Z+='"'+X.value+'"';break;default:Z+=X.value;break}}),Z},j2=($)=>JSON.parse(PB(AB(o$(RB($)))));var X5=()=>{};var z5=j(()=>{u4()});function QJ($){return $.type==="tool_use"||$.type==="server_tool_use"||$.type==="mcp_tool_use"}function YJ($){}var I0,t0,t$,t6,b2,e6,$8,x2,Z8,k0,X8,k2,f2,D$,y2,g2,z8,J5,zJ,h2,q5,Q5,Y5,JJ,qJ="__json_buf",J8;var GJ=j(()=>{j0();X5();a$();z5();Z5();J8=class J8{constructor($,Z){I0.add(this),this.messages=[],this.receivedMessages=[],t0.set(this,void 0),t$.set(this,null),this.controller=new AbortController,t6.set(this,void 0),b2.set(this,()=>{}),e6.set(this,()=>{}),$8.set(this,void 0),x2.set(this,()=>{}),Z8.set(this,()=>{}),k0.set(this,{}),X8.set(this,!1),k2.set(this,!1),f2.set(this,!1),D$.set(this,!1),y2.set(this,void 0),g2.set(this,void 0),z8.set(this,void 0),h2.set(this,(X)=>{if(O(this,k2,!0,"f"),b0(X))X=new q0;if(X instanceof q0)return O(this,f2,!0,"f"),this._emit("abort",X);if(X instanceof A)return this._emit("error",X);if(X instanceof Error){let z=new A(X.message);return z.cause=X,this._emit("error",z)}return this._emit("error",new A(String(X)))}),O(this,t6,new Promise((X,z)=>{O(this,b2,X,"f"),O(this,e6,z,"f")}),"f"),O(this,$8,new Promise((X,z)=>{O(this,x2,X,"f"),O(this,Z8,z,"f")}),"f"),K(this,t6,"f").catch(()=>{}),K(this,$8,"f").catch(()=>{}),O(this,t$,$,"f"),O(this,z8,Z?.logger??console,"f")}get response(){return K(this,y2,"f")}get request_id(){return K(this,g2,"f")}async withResponse(){O(this,D$,!0,"f");let $=await K(this,t6,"f");if(!$)throw Error("Could not resolve a `Response` object");return{data:this,response:$,request_id:$.headers.get("request-id")}}static fromReadableStream($){let Z=new J8(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new J8(Z,{logger:z});for(let q of Z.messages)J._addMessageParam(q);return O(J,t$,{...Z,stream:!0},"f"),J._run(()=>J._createMessage($,{...Z,stream:!0},{...X,headers:{...X?.headers,"X-Stainless-Helper-Method":"stream"}})),J}_run($){$().then(()=>{this._emitFinal(),this._emit("end")},K(this,h2,"f"))}_addMessageParam($){this.messages.push($)}_addMessage($,Z=!0){if(this.receivedMessages.push($),Z)this._emit("message",$)}async _createMessage($,Z,X){let z=X?.signal,J;if(z){if(z.aborted)this.controller.abort();J=this.controller.abort.bind(this.controller),z.addEventListener("abort",J)}try{K(this,I0,"m",q5).call(this);let{response:q,data:Q}=await $.create({...Z,stream:!0},{...X,signal:this.controller.signal}).withResponse();this._connected(q);for await(let Y of Q)K(this,I0,"m",Q5).call(this,Y);if(Q.controller.signal?.aborted)throw new q0;K(this,I0,"m",Y5).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;O(this,y2,$,"f"),O(this,g2,$?.headers.get("request-id"),"f"),K(this,b2,"f").call(this,$),this._emit("connect")}get ended(){return K(this,X8,"f")}get errored(){return K(this,k2,"f")}get aborted(){return K(this,f2,"f")}abort(){this.controller.abort()}on($,Z){return(K(this,k0,"f")[$]||(K(this,k0,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=K(this,k0,"f")[$];if(!X)return this;let z=X.findIndex((J)=>J.listener===Z);if(z>=0)X.splice(z,1);return this}once($,Z){return(K(this,k0,"f")[$]||(K(this,k0,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(O(this,D$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){O(this,D$,!0,"f"),await K(this,$8,"f")}get currentMessage(){return K(this,t0,"f")}async finalMessage(){return await this.done(),K(this,I0,"m",J5).call(this)}async finalText(){return await this.done(),K(this,I0,"m",zJ).call(this)}_emit($,...Z){if(K(this,X8,"f"))return;if($==="end")O(this,X8,!0,"f"),K(this,x2,"f").call(this);let X=K(this,k0,"f")[$];if(X)K(this,k0,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!K(this,D$,"f")&&!X?.length)Promise.reject(z);K(this,e6,"f").call(this,z),K(this,Z8,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!K(this,D$,"f")&&!X?.length)Promise.reject(z);K(this,e6,"f").call(this,z),K(this,Z8,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",K(this,I0,"m",J5).call(this))}async _fromReadableStream($,Z){let X=Z?.signal,z;if(X){if(X.aborted)this.controller.abort();z=this.controller.abort.bind(this.controller),X.addEventListener("abort",z)}try{K(this,I0,"m",q5).call(this),this._connected(null);let J=H0.fromReadableStream($,this.controller);for await(let q of J)K(this,I0,"m",Q5).call(this,q);if(J.controller.signal?.aborted)throw new q0;K(this,I0,"m",Y5).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(t0=new WeakMap,t$=new WeakMap,t6=new WeakMap,b2=new WeakMap,e6=new WeakMap,$8=new WeakMap,x2=new WeakMap,Z8=new WeakMap,k0=new WeakMap,X8=new WeakMap,k2=new WeakMap,f2=new WeakMap,D$=new WeakMap,y2=new WeakMap,g2=new WeakMap,z8=new WeakMap,h2=new WeakMap,I0=new WeakSet,J5=function(){if(this.receivedMessages.length===0)throw new A("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},zJ=function(){if(this.receivedMessages.length===0)throw new A("stream ended without producing a Message with role=assistant");let Z=this.receivedMessages.at(-1).content.filter((X)=>X.type==="text").map((X)=>X.text);if(Z.length===0)throw new A("stream ended without producing a content block with type=text");return Z.join(" ")},q5=function(){if(this.ended)return;O(this,t0,void 0,"f")},Q5=function(Z){if(this.ended)return;let X=K(this,I0,"m",JJ).call(this,Z);switch(this._emit("streamEvent",Z,X),Z.type){case"content_block_delta":{let z=X.content.at(-1);switch(Z.delta.type){case"text_delta":{if(z.type==="text")this._emit("text",Z.delta.text,z.text||"");break}case"citations_delta":{if(z.type==="text")this._emit("citation",Z.delta.citation,z.citations??[]);break}case"input_json_delta":{if(QJ(z)&&z.input)this._emit("inputJson",Z.delta.partial_json,z.input);break}case"thinking_delta":{if(z.type==="thinking")this._emit("thinking",Z.delta.thinking,z.thinking);break}case"signature_delta":{if(z.type==="thinking")this._emit("signature",z.signature);break}case"compaction_delta":{if(z.type==="compaction"&&z.content)this._emit("compaction",z.content);break}default:YJ(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(e4(X,K(this,t$,"f"),{logger:K(this,z8,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{O(this,t0,X,"f");break}case"content_block_start":case"message_delta":break}},Y5=function(){if(this.ended)throw new A("stream has ended, this shouldn't happen");let Z=K(this,t0,"f");if(!Z)throw new A("request ended without sending any chunks");return O(this,t0,void 0,"f"),e4(Z,K(this,t$,"f"),{logger:K(this,z8,"f")})},JJ=function(Z){let X=K(this,t0,"f");if(Z.type==="message_start"){if(X)throw new A(`Unexpected event order, got ${Z.type} before receiving "message_stop"`);return Z.message}if(!X)throw new A(`Unexpected event order, got ${Z.type} before "message_start"`);switch(Z.type){case"message_stop":return X;case"message_delta":if(X.container=Z.delta.container,X.stop_reason=Z.delta.stop_reason,X.stop_sequence=Z.delta.stop_sequence,X.usage.output_tokens=Z.usage.output_tokens,X.context_management=Z.context_management,Z.usage.input_tokens!=null)X.usage.input_tokens=Z.usage.input_tokens;if(Z.usage.cache_creation_input_tokens!=null)X.usage.cache_creation_input_tokens=Z.usage.cache_creation_input_tokens;if(Z.usage.cache_read_input_tokens!=null)X.usage.cache_read_input_tokens=Z.usage.cache_read_input_tokens;if(Z.usage.server_tool_use!=null)X.usage.server_tool_use=Z.usage.server_tool_use;if(Z.usage.iterations!=null)X.usage.iterations=Z.usage.iterations;return X;case"content_block_start":return X.content.push(Z.content_block),X;case"content_block_delta":{let z=X.content.at(Z.index);switch(Z.delta.type){case"text_delta":{if(z?.type==="text")X.content[Z.index]={...z,text:(z.text||"")+Z.delta.text};break}case"citations_delta":{if(z?.type==="text")X.content[Z.index]={...z,citations:[...z.citations??[],Z.delta.citation]};break}case"input_json_delta":{if(z&&QJ(z)){let J=z[qJ]||"";J+=Z.delta.partial_json;let q={...z};if(Object.defineProperty(q,qJ,{value:J,enumerable:!1,writable:!0}),J)try{q.input=j2(J)}catch(Q){let Y=new A(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${Q}. JSON: ${J}`);K(this,h2,"f").call(this,Y)}X.content[Z.index]=q}break}case"thinking_delta":{if(z?.type==="thinking")X.content[Z.index]={...z,thinking:z.thinking+Z.delta.thinking};break}case"signature_delta":{if(z?.type==="thinking")X.content[Z.index]={...z,signature:Z.delta.signature};break}case"compaction_delta":{if(z?.type==="compaction")X.content[Z.index]={...z,content:(z.content||"")+Z.delta.content};break}default:YJ(Z.delta)}return X}case"content_block_stop":return X}},Symbol.asyncIterator)](){let $=[],Z=[],X=!1;return this.on("streamEvent",(z)=>{let J=Z.shift();if(J)J.resolve(z);else $.push(z)}),this.on("end",()=>{X=!0;for(let z of Z)z.resolve(void 0);Z.length=0}),this.on("abort",(z)=>{X=!0;for(let J of Z)J.reject(z);Z.length=0}),this.on("error",(z)=>{X=!0;for(let J of Z)J.reject(z);Z.length=0}),{next:async()=>{if(!$.length){if(X)return{value:void 0,done:!0};return new Promise((J,q)=>Z.push({resolve:J,reject:q})).then((J)=>J?{value:J,done:!1}:{value:void 0,done:!0})}return{value:$.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new H0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var e$;var v2=j(()=>{e$=class e$ extends Error{constructor($){let Z=typeof $==="string"?$:$.map((X)=>{if(X.type==="text")return X.text;return`[${X.type}]`}).join(" ");super(Z);this.name="ToolError",this.content=$}}});var UJ=1e5,WJ=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
174
+ 1. Task Overview
175
+ The user's core request and success criteria
176
+ Any clarifications or constraints they specified
177
+ 2. Current State
178
+ What has been completed so far
179
+ Files created, modified, or analyzed (with paths if relevant)
180
+ Key outputs or artifacts produced
181
+ 3. Important Discoveries
182
+ Technical constraints or requirements uncovered
183
+ Decisions made and their rationale
184
+ Errors encountered and how they were resolved
185
+ What approaches were tried that didn't work (and why)
186
+ 4. Next Steps
187
+ Specific actions needed to complete the task
188
+ Any blockers or open questions to resolve
189
+ Priority order if multiple steps remain
190
+ 5. Context to Preserve
191
+ User preferences or style requirements
192
+ Domain-specific details that aren't obvious
193
+ Any promises made to the user
194
+ Be concise but complete—err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task.
195
+ Wrap your summary in <summary></summary> tags.`;function HJ(){let $,Z;return{promise:new Promise((z,J)=>{$=z,Z=J}),resolve:$,reject:Z}}async function SB($,Z=$.messages.at(-1)){if(!Z||Z.role!=="assistant"||!Z.content||typeof Z.content==="string")return null;let X=Z.content.filter((J)=>J.type==="tool_use");if(X.length===0)return null;return{role:"user",content:await Promise.all(X.map(async(J)=>{let q=$.tools.find((Q)=>("name"in Q?Q.name:Q.mcp_server_name)===J.name);if(!q||!("run"in q))return{type:"tool_result",tool_use_id:J.id,content:`Error: Tool '${J.name}' not found`,is_error:!0};try{let Q=J.input;if("parse"in q&&q.parse)Q=q.parse(Q);let Y=await q.run(Q);return{type:"tool_result",tool_use_id:J.id,content:Y}}catch(Q){return{type:"tool_result",tool_use_id:J.id,content:Q instanceof e$?Q.content:`Error: ${Q instanceof Error?Q.message:String(Q)}`,is_error:!0}}}))}}var q8,$6,N$,X0,Q8,B0,f0,e0,Y8,VJ,G5,G8;var U5=j(()=>{j0();v2();U0();K0();r6();G8=class G8{constructor($,Z,X){q8.add(this),this.client=$,$6.set(this,!1),N$.set(this,!1),X0.set(this,void 0),Q8.set(this,void 0),B0.set(this,void 0),f0.set(this,void 0),e0.set(this,void 0),Y8.set(this,0),O(this,X0,{params:{...Z,messages:structuredClone(Z.messages)}},"f");let J=["BetaToolRunner",...r4(Z.tools,Z.messages)].join(", ");O(this,Q8,{...X,headers:E([{"x-stainless-helper":J},X?.headers])},"f"),O(this,e0,HJ(),"f")}async*[($6=new WeakMap,N$=new WeakMap,X0=new WeakMap,Q8=new WeakMap,B0=new WeakMap,f0=new WeakMap,e0=new WeakMap,Y8=new WeakMap,q8=new WeakSet,VJ=async function(){let Z=K(this,X0,"f").params.compactionControl;if(!Z||!Z.enabled)return!1;let X=0;if(K(this,B0,"f")!==void 0)try{let G=await K(this,B0,"f");X=G.usage.input_tokens+(G.usage.cache_creation_input_tokens??0)+(G.usage.cache_read_input_tokens??0)+G.usage.output_tokens}catch{return!1}let z=Z.contextTokenThreshold??UJ;if(X<z)return!1;let J=Z.model??K(this,X0,"f").params.model,q=Z.summaryPrompt??WJ,Q=K(this,X0,"f").params.messages;if(Q[Q.length-1].role==="assistant"){let G=Q[Q.length-1];if(Array.isArray(G.content)){let U=G.content.filter((W)=>W.type!=="tool_use");if(U.length===0)Q.pop();else G.content=U}}let Y=await this.client.beta.messages.create({model:J,messages:[...Q,{role:"user",content:[{type:"text",text:q}]}],max_tokens:K(this,X0,"f").params.max_tokens},{headers:{"x-stainless-helper":"compaction"}});if(Y.content[0]?.type!=="text")throw new A("Expected text response for compaction");return K(this,X0,"f").params.messages=[{role:"user",content:Y.content}],!0},Symbol.asyncIterator)](){var $;if(K(this,$6,"f"))throw new A("Cannot iterate over a consumed stream");O(this,$6,!0,"f"),O(this,N$,!0,"f"),O(this,f0,void 0,"f");try{while(!0){let Z;try{if(K(this,X0,"f").params.max_iterations&&K(this,Y8,"f")>=K(this,X0,"f").params.max_iterations)break;O(this,N$,!1,"f"),O(this,f0,void 0,"f"),O(this,Y8,($=K(this,Y8,"f"),$++,$),"f"),O(this,B0,void 0,"f");let{max_iterations:X,compactionControl:z,...J}=K(this,X0,"f").params;if(J.stream)Z=this.client.beta.messages.stream({...J},K(this,Q8,"f")),O(this,B0,Z.finalMessage(),"f"),K(this,B0,"f").catch(()=>{}),yield Z;else O(this,B0,this.client.beta.messages.create({...J,stream:!1},K(this,Q8,"f")),"f"),yield K(this,B0,"f");if(!await K(this,q8,"m",VJ).call(this)){if(!K(this,N$,"f")){let{role:Y,content:G}=await K(this,B0,"f");K(this,X0,"f").params.messages.push({role:Y,content:G})}let Q=await K(this,q8,"m",G5).call(this,K(this,X0,"f").params.messages.at(-1));if(Q)K(this,X0,"f").params.messages.push(Q);else if(!K(this,N$,"f"))break}}finally{if(Z)Z.abort()}}if(!K(this,B0,"f"))throw new A("ToolRunner concluded without a message from the server");K(this,e0,"f").resolve(await K(this,B0,"f"))}catch(Z){throw O(this,$6,!1,"f"),K(this,e0,"f").promise.catch(()=>{}),K(this,e0,"f").reject(Z),O(this,e0,HJ(),"f"),Z}}setMessagesParams($){if(typeof $==="function")K(this,X0,"f").params=$(K(this,X0,"f").params);else K(this,X0,"f").params=$;O(this,N$,!0,"f"),O(this,f0,void 0,"f")}async generateToolResponse(){let $=await K(this,B0,"f")??this.params.messages.at(-1);if(!$)return null;return K(this,q8,"m",G5).call(this,$)}done(){return K(this,e0,"f").promise}async runUntilDone(){if(!K(this,$6,"f"))for await(let $ of this);return this.done()}get params(){return K(this,X0,"f").params}pushMessages(...$){this.setMessagesParams((Z)=>({...Z,messages:[...Z.messages,...$]}))}then($,Z){return this.runUntilDone().then($,Z)}};G5=async function(Z){if(K(this,f0,"f")!==void 0)return K(this,f0,"f");return O(this,f0,SB(K(this,X0,"f").params,Z),"f"),K(this,f0,"f")}});var Z6;var W5=j(()=>{U0();h4();Z6=class Z6{constructor($,Z){this.iterator=$,this.controller=Z}async*decoder(){let $=new r0;for await(let Z of this.iterator)for(let X of $.decode(Z))yield JSON.parse(X);for(let Z of $.flush())yield JSON.parse(Z)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse($,Z){if(!$.body){if(Z.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new A("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new A("Attempted to iterate over a response with no body")}return new Z6(v6($.body),Z)}}});var U8;var V5=j(()=>{A0();K0();W5();a$();o0();U8=class U8 extends l{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/messages/batches?beta=true",{body:z,...Z,headers:E([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(c`/v1/messages/batches/${$}?beta=true`,{...X,headers:E([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/messages/batches?beta=true",O0,{query:z,...Z,headers:E([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(c`/v1/messages/batches/${$}?beta=true`,{...X,headers:E([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}cancel($,Z={},X){let{betas:z}=Z??{};return this._client.post(c`/v1/messages/batches/${$}/cancel?beta=true`,{...X,headers:E([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}async results($,Z={},X){let z=await this.retrieve($);if(!z.results_url)throw new A(`No batch \`results_url\`; Has it finished processing? ${z.processing_status} - ${z.id}`);let{betas:J}=Z??{};return this._client.get(z.results_url,{...X,headers:E([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},X?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((q,Q)=>Z6.fromResponse(Q.response,Q.controller))}}});function BJ($){if(!$.output_format)return $;if($.output_config?.format)throw new A("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:Z,...X}=$;return{...X,output_config:{...$.output_config,format:Z}}}var KJ,CB,$$;var H5=j(()=>{a$();t4();K0();r6();Z5();GJ();U5();v2();V5();V5();U5();v2();KJ={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},CB=["claude-opus-4-6"];$$=class $$ extends l{constructor(){super(...arguments);this.batches=new U8(this._client)}create($,Z){let X=BJ($),{betas:z,...J}=X;if(J.model in KJ)console.warn(`The model '${J.model}' is deprecated and will reach end-of-life on ${KJ[J.model]}
196
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(J.model in CB&&J.thinking&&J.thinking.type==="enabled")console.warn(`Using Claude with ${J.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let q=this._client._options.timeout;if(!J.stream&&q==null){let Y=E2[J.model]??void 0;q=this._client.calculateNonstreamingTimeout(J.max_tokens,Y)}let Q=C2(J.tools,J.messages);return this._client.post("/v1/messages?beta=true",{body:J,timeout:q??600000,...Z,headers:E([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},Q,Z?.headers]),stream:X.stream??!1})}parse($,Z){return Z={...Z,headers:E([{"anthropic-beta":[...$.betas??[],"structured-outputs-2025-12-15"].toString()},Z?.headers])},this.create($,Z).then((X)=>$5(X,$,{logger:this._client.logger??console}))}stream($,Z){return J8.createMessage(this,$,Z)}countTokens($,Z){let X=BJ($),{betas:z,...J}=X;return this._client.post("/v1/messages/count_tokens?beta=true",{body:J,...Z,headers:E([{"anthropic-beta":[...z??[],"token-counting-2024-11-01"].toString()},Z?.headers])})}toolRunner($,Z){return new G8(this._client,$,Z)}};$$.Batches=U8;$$.BetaToolRunner=G8;$$.ToolError=e$});var W8;var K5=j(()=>{A0();K0();r$();o0();W8=class W8 extends l{create($,Z={},X){let{betas:z,...J}=Z??{};return this._client.post(c`/v1/skills/${$}/versions?beta=true`,s$({body:J,...X,headers:E([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])},this._client))}retrieve($,Z,X){let{skill_id:z,betas:J}=Z;return this._client.get(c`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:E([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(c`/v1/skills/${$}/versions?beta=true`,l6,{query:J,...X,headers:E([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}delete($,Z,X){let{skill_id:z,betas:J}=Z;return this._client.delete(c`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:E([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}}});var X6;var B5=j(()=>{K5();K5();A0();K0();r$();o0();X6=class X6 extends l{constructor(){super(...arguments);this.versions=new W8(this._client)}create($={},Z){let{betas:X,...z}=$??{};return this._client.post("/v1/skills?beta=true",s$({body:z,...Z,headers:E([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},Z?.headers])},this._client,!1))}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(c`/v1/skills/${$}?beta=true`,{...X,headers:E([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/skills?beta=true",l6,{query:z,...Z,headers:E([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(c`/v1/skills/${$}?beta=true`,{...X,headers:E([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}};X6.Versions=W8});var P0;var D5=j(()=>{a4();a4();o4();o4();H5();H5();B5();B5();P0=class P0 extends l{constructor(){super(...arguments);this.models=new o6(this._client),this.messages=new $$(this._client),this.files=new a6(this._client),this.skills=new X6(this._client)}};P0.Models=o6;P0.Messages=$$;P0.Files=a6;P0.Skills=X6});var z6;var N5=j(()=>{K0();z6=class z6 extends l{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/complete",{body:z,timeout:this._client._options.timeout??600000,...Z,headers:E([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers]),stream:$.stream??!1})}}});function DJ($){return $?.output_config?.format}function I5($,Z,X){let z=DJ(Z);if(!Z||!("parse"in(z??{})))return{...$,content:$.content.map((J)=>{if(J.type==="text")return Object.defineProperty({...J},"parsed_output",{value:null,enumerable:!1});return J}),parsed_output:null};return L5($,Z,X)}function L5($,Z,X){let z=null,J=$.content.map((q)=>{if(q.type==="text"){let Q=xB(Z,q.text);if(z===null)z=Q;return Object.defineProperty({...q},"parsed_output",{value:Q,enumerable:!1})}return q});return{...$,content:J,parsed_output:z}}function xB($,Z){let X=DJ($);if(X?.type!=="json_schema")return null;try{if("parse"in X)return X.parse(Z);return JSON.parse(Z)}catch(z){throw new A(`Failed to parse structured output: ${z}`)}}var T5=j(()=>{U0()});function TJ($){return $.type==="tool_use"||$.type==="server_tool_use"}function MJ($){}var L0,Z$,J6,V8,u2,H8,K8,m2,B8,y0,D8,d2,c2,I$,p2,l2,N8,M5,NJ,O5,w5,F5,R5,IJ,LJ="__json_buf",I8;var OJ=j(()=>{j0();a$();z5();X5();T5();I8=class I8{constructor($,Z){L0.add(this),this.messages=[],this.receivedMessages=[],Z$.set(this,void 0),J6.set(this,null),this.controller=new AbortController,V8.set(this,void 0),u2.set(this,()=>{}),H8.set(this,()=>{}),K8.set(this,void 0),m2.set(this,()=>{}),B8.set(this,()=>{}),y0.set(this,{}),D8.set(this,!1),d2.set(this,!1),c2.set(this,!1),I$.set(this,!1),p2.set(this,void 0),l2.set(this,void 0),N8.set(this,void 0),O5.set(this,(X)=>{if(O(this,d2,!0,"f"),b0(X))X=new q0;if(X instanceof q0)return O(this,c2,!0,"f"),this._emit("abort",X);if(X instanceof A)return this._emit("error",X);if(X instanceof Error){let z=new A(X.message);return z.cause=X,this._emit("error",z)}return this._emit("error",new A(String(X)))}),O(this,V8,new Promise((X,z)=>{O(this,u2,X,"f"),O(this,H8,z,"f")}),"f"),O(this,K8,new Promise((X,z)=>{O(this,m2,X,"f"),O(this,B8,z,"f")}),"f"),K(this,V8,"f").catch(()=>{}),K(this,K8,"f").catch(()=>{}),O(this,J6,$,"f"),O(this,N8,Z?.logger??console,"f")}get response(){return K(this,p2,"f")}get request_id(){return K(this,l2,"f")}async withResponse(){O(this,I$,!0,"f");let $=await K(this,V8,"f");if(!$)throw Error("Could not resolve a `Response` object");return{data:this,response:$,request_id:$.headers.get("request-id")}}static fromReadableStream($){let Z=new I8(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new I8(Z,{logger:z});for(let q of Z.messages)J._addMessageParam(q);return O(J,J6,{...Z,stream:!0},"f"),J._run(()=>J._createMessage($,{...Z,stream:!0},{...X,headers:{...X?.headers,"X-Stainless-Helper-Method":"stream"}})),J}_run($){$().then(()=>{this._emitFinal(),this._emit("end")},K(this,O5,"f"))}_addMessageParam($){this.messages.push($)}_addMessage($,Z=!0){if(this.receivedMessages.push($),Z)this._emit("message",$)}async _createMessage($,Z,X){let z=X?.signal,J;if(z){if(z.aborted)this.controller.abort();J=this.controller.abort.bind(this.controller),z.addEventListener("abort",J)}try{K(this,L0,"m",w5).call(this);let{response:q,data:Q}=await $.create({...Z,stream:!0},{...X,signal:this.controller.signal}).withResponse();this._connected(q);for await(let Y of Q)K(this,L0,"m",F5).call(this,Y);if(Q.controller.signal?.aborted)throw new q0;K(this,L0,"m",R5).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;O(this,p2,$,"f"),O(this,l2,$?.headers.get("request-id"),"f"),K(this,u2,"f").call(this,$),this._emit("connect")}get ended(){return K(this,D8,"f")}get errored(){return K(this,d2,"f")}get aborted(){return K(this,c2,"f")}abort(){this.controller.abort()}on($,Z){return(K(this,y0,"f")[$]||(K(this,y0,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=K(this,y0,"f")[$];if(!X)return this;let z=X.findIndex((J)=>J.listener===Z);if(z>=0)X.splice(z,1);return this}once($,Z){return(K(this,y0,"f")[$]||(K(this,y0,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(O(this,I$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){O(this,I$,!0,"f"),await K(this,K8,"f")}get currentMessage(){return K(this,Z$,"f")}async finalMessage(){return await this.done(),K(this,L0,"m",M5).call(this)}async finalText(){return await this.done(),K(this,L0,"m",NJ).call(this)}_emit($,...Z){if(K(this,D8,"f"))return;if($==="end")O(this,D8,!0,"f"),K(this,m2,"f").call(this);let X=K(this,y0,"f")[$];if(X)K(this,y0,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!K(this,I$,"f")&&!X?.length)Promise.reject(z);K(this,H8,"f").call(this,z),K(this,B8,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!K(this,I$,"f")&&!X?.length)Promise.reject(z);K(this,H8,"f").call(this,z),K(this,B8,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",K(this,L0,"m",M5).call(this))}async _fromReadableStream($,Z){let X=Z?.signal,z;if(X){if(X.aborted)this.controller.abort();z=this.controller.abort.bind(this.controller),X.addEventListener("abort",z)}try{K(this,L0,"m",w5).call(this),this._connected(null);let J=H0.fromReadableStream($,this.controller);for await(let q of J)K(this,L0,"m",F5).call(this,q);if(J.controller.signal?.aborted)throw new q0;K(this,L0,"m",R5).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(Z$=new WeakMap,J6=new WeakMap,V8=new WeakMap,u2=new WeakMap,H8=new WeakMap,K8=new WeakMap,m2=new WeakMap,B8=new WeakMap,y0=new WeakMap,D8=new WeakMap,d2=new WeakMap,c2=new WeakMap,I$=new WeakMap,p2=new WeakMap,l2=new WeakMap,N8=new WeakMap,O5=new WeakMap,L0=new WeakSet,M5=function(){if(this.receivedMessages.length===0)throw new A("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},NJ=function(){if(this.receivedMessages.length===0)throw new A("stream ended without producing a Message with role=assistant");let Z=this.receivedMessages.at(-1).content.filter((X)=>X.type==="text").map((X)=>X.text);if(Z.length===0)throw new A("stream ended without producing a content block with type=text");return Z.join(" ")},w5=function(){if(this.ended)return;O(this,Z$,void 0,"f")},F5=function(Z){if(this.ended)return;let X=K(this,L0,"m",IJ).call(this,Z);switch(this._emit("streamEvent",Z,X),Z.type){case"content_block_delta":{let z=X.content.at(-1);switch(Z.delta.type){case"text_delta":{if(z.type==="text")this._emit("text",Z.delta.text,z.text||"");break}case"citations_delta":{if(z.type==="text")this._emit("citation",Z.delta.citation,z.citations??[]);break}case"input_json_delta":{if(TJ(z)&&z.input)this._emit("inputJson",Z.delta.partial_json,z.input);break}case"thinking_delta":{if(z.type==="thinking")this._emit("thinking",Z.delta.thinking,z.thinking);break}case"signature_delta":{if(z.type==="thinking")this._emit("signature",z.signature);break}default:MJ(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(I5(X,K(this,J6,"f"),{logger:K(this,N8,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{O(this,Z$,X,"f");break}case"content_block_start":case"message_delta":break}},R5=function(){if(this.ended)throw new A("stream has ended, this shouldn't happen");let Z=K(this,Z$,"f");if(!Z)throw new A("request ended without sending any chunks");return O(this,Z$,void 0,"f"),I5(Z,K(this,J6,"f"),{logger:K(this,N8,"f")})},IJ=function(Z){let X=K(this,Z$,"f");if(Z.type==="message_start"){if(X)throw new A(`Unexpected event order, got ${Z.type} before receiving "message_stop"`);return Z.message}if(!X)throw new A(`Unexpected event order, got ${Z.type} before "message_start"`);switch(Z.type){case"message_stop":return X;case"message_delta":if(X.stop_reason=Z.delta.stop_reason,X.stop_sequence=Z.delta.stop_sequence,X.usage.output_tokens=Z.usage.output_tokens,Z.usage.input_tokens!=null)X.usage.input_tokens=Z.usage.input_tokens;if(Z.usage.cache_creation_input_tokens!=null)X.usage.cache_creation_input_tokens=Z.usage.cache_creation_input_tokens;if(Z.usage.cache_read_input_tokens!=null)X.usage.cache_read_input_tokens=Z.usage.cache_read_input_tokens;if(Z.usage.server_tool_use!=null)X.usage.server_tool_use=Z.usage.server_tool_use;return X;case"content_block_start":return X.content.push({...Z.content_block}),X;case"content_block_delta":{let z=X.content.at(Z.index);switch(Z.delta.type){case"text_delta":{if(z?.type==="text")X.content[Z.index]={...z,text:(z.text||"")+Z.delta.text};break}case"citations_delta":{if(z?.type==="text")X.content[Z.index]={...z,citations:[...z.citations??[],Z.delta.citation]};break}case"input_json_delta":{if(z&&TJ(z)){let J=z[LJ]||"";J+=Z.delta.partial_json;let q={...z};if(Object.defineProperty(q,LJ,{value:J,enumerable:!1,writable:!0}),J)q.input=j2(J);X.content[Z.index]=q}break}case"thinking_delta":{if(z?.type==="thinking")X.content[Z.index]={...z,thinking:z.thinking+Z.delta.thinking};break}case"signature_delta":{if(z?.type==="thinking")X.content[Z.index]={...z,signature:Z.delta.signature};break}default:MJ(Z.delta)}return X}case"content_block_stop":return X}},Symbol.asyncIterator)](){let $=[],Z=[],X=!1;return this.on("streamEvent",(z)=>{let J=Z.shift();if(J)J.resolve(z);else $.push(z)}),this.on("end",()=>{X=!0;for(let z of Z)z.resolve(void 0);Z.length=0}),this.on("abort",(z)=>{X=!0;for(let J of Z)J.reject(z);Z.length=0}),this.on("error",(z)=>{X=!0;for(let J of Z)J.reject(z);Z.length=0}),{next:async()=>{if(!$.length){if(X)return{value:void 0,done:!0};return new Promise((J,q)=>Z.push({resolve:J,reject:q})).then((J)=>J?{value:J,done:!1}:{value:void 0,done:!0})}return{value:$.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new H0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var L8;var A5=j(()=>{A0();K0();W5();a$();o0();L8=class L8 extends l{create($,Z){return this._client.post("/v1/messages/batches",{body:$,...Z})}retrieve($,Z){return this._client.get(c`/v1/messages/batches/${$}`,Z)}list($={},Z){return this._client.getAPIList("/v1/messages/batches",O0,{query:$,...Z})}delete($,Z){return this._client.delete(c`/v1/messages/batches/${$}`,Z)}cancel($,Z){return this._client.post(c`/v1/messages/batches/${$}/cancel`,Z)}async results($,Z){let X=await this.retrieve($);if(!X.results_url)throw new A(`No batch \`results_url\`; Has it finished processing? ${X.processing_status} - ${X.id}`);return this._client.get(X.results_url,{...Z,headers:E([{Accept:"application/binary"},Z?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((z,J)=>Z6.fromResponse(J.response,J.controller))}}});var L$,wJ,fB;var P5=j(()=>{K0();r6();OJ();T5();A5();A5();t4();L$=class L$ extends l{constructor(){super(...arguments);this.batches=new L8(this._client)}create($,Z){if($.model in wJ)console.warn(`The model '${$.model}' is deprecated and will reach end-of-life on ${wJ[$.model]}
197
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if($.model in fB&&$.thinking&&$.thinking.type==="enabled")console.warn(`Using Claude with ${$.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let X=this._client._options.timeout;if(!$.stream&&X==null){let J=E2[$.model]??void 0;X=this._client.calculateNonstreamingTimeout($.max_tokens,J)}let z=C2($.tools,$.messages);return this._client.post("/v1/messages",{body:$,timeout:X??600000,...Z,headers:E([z,Z?.headers]),stream:$.stream??!1})}parse($,Z){return this.create($,Z).then((X)=>L5(X,$,{logger:this._client.logger??console}))}stream($,Z){return I8.createMessage(this,$,Z,{logger:this._client.logger??console})}countTokens($,Z){return this._client.post("/v1/messages/count_tokens",{body:$,...Z})}};wJ={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026"},fB=["claude-opus-4-6"];L$.Batches=L8});var q6;var S5=j(()=>{A0();K0();o0();q6=class q6 extends l{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(c`/v1/models/${$}`,{...X,headers:E([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/models",O0,{query:z,...Z,headers:E([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var FJ=j(()=>{D5();N5();P5();S5();o9()});var T8=($)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[$]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.($)?.trim();return};class i{constructor({baseURL:$=T8("ANTHROPIC_BASE_URL"),apiKey:Z=T8("ANTHROPIC_API_KEY")??null,authToken:X=T8("ANTHROPIC_AUTH_TOKEN")??null,...z}={}){_5.add(this),i2.set(this,void 0);let J={apiKey:Z,authToken:X,...z,baseURL:$||"https://api.anthropic.com"};if(!J.dangerouslyAllowBrowser&&g9())throw new A(`It looks like you're running in a browser-like environment.
198
+
199
+ This is disabled by default, as it risks exposing your secret API credentials to attackers.
200
+ If you understand the risks and have appropriate mitigations in place,
201
+ you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
202
+
203
+ new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
204
+ `);this.baseURL=J.baseURL,this.timeout=J.timeout??C5.DEFAULT_TIMEOUT,this.logger=J.logger??console;let q="warn";this.logLevel=q,this.logLevel=v4(J.logLevel,"ClientOptions.logLevel",this)??v4(T8("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??q,this.fetchOptions=J.fetchOptions,this.maxRetries=J.maxRetries??2,this.fetch=J.fetch??v9(),O(this,i2,m9,"f"),this._options=J,this.apiKey=typeof Z==="string"?Z:null,this.authToken=X}withOptions($){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...$})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:$,nulls:Z}){if($.get("x-api-key")||$.get("authorization"))return;if(this.apiKey&&$.get("x-api-key"))return;if(Z.has("x-api-key"))return;if(this.authToken&&$.get("authorization"))return;if(Z.has("authorization"))return;throw Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}async authHeaders($){return E([await this.apiKeyAuth($),await this.bearerAuth($)])}async apiKeyAuth($){if(this.apiKey==null)return;return E([{"X-Api-Key":this.apiKey}])}async bearerAuth($){if(this.authToken==null)return;return E([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery($){return Object.entries($).filter(([Z,X])=>typeof X<"u").map(([Z,X])=>{if(typeof X==="string"||typeof X==="number"||typeof X==="boolean")return`${encodeURIComponent(Z)}=${encodeURIComponent(X)}`;if(X===null)return`${encodeURIComponent(Z)}=`;throw new A(`Cannot stringify type ${typeof X}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${s0}`}defaultIdempotencyKey(){return`stainless-node-retry-${b4()}`}makeStatusError($,Z,X,z){return o.generate($,Z,X,z)}buildURL($,Z,X){let z=!K(this,_5,"m",RJ).call(this)&&X||this.baseURL,J=C9($)?new URL($):new URL(z+(z.endsWith("/")&&$.startsWith("/")?$.slice(1):$)),q=this.defaultQuery();if(!E9(q))Z={...q,...Z};if(typeof Z==="object"&&Z&&!Array.isArray(Z))J.search=this.stringifyQuery(Z);return J.toString()}_calculateNonstreamingTimeout($){if(3600*$/128000>600)throw new A("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600000}async prepareOptions($){}async prepareRequest($,{url:Z,options:X}){}get($,Z){return this.methodRequest("get",$,Z)}post($,Z){return this.methodRequest("post",$,Z)}patch($,Z){return this.methodRequest("patch",$,Z)}put($,Z){return this.methodRequest("put",$,Z)}delete($,Z){return this.methodRequest("delete",$,Z)}methodRequest($,Z,X){return this.request(Promise.resolve(X).then((z)=>{return{method:$,path:Z,...z}}))}request($,Z=null){return new a0(this,this.makeRequest($,Z,void 0))}async makeRequest($,Z,X){let z=await $,J=z.maxRetries??this.maxRetries;if(Z==null)Z=J;await this.prepareOptions(z);let{req:q,url:Q,timeout:Y}=await this.buildRequest(z,{retryCount:J-Z});await this.prepareRequest(q,{url:Q,options:z});let G="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),U=X===void 0?"":`, retryOf: ${X}`,W=Date.now();if(J0(this).debug(`[${G}] sending request`,x0({retryOfRequestLogID:X,method:z.method,url:Q,options:z,headers:q.headers})),z.signal?.aborted)throw new q0;let H=new AbortController,V=await this.fetchWithTimeout(Q,q,Y,H).catch(h6),D=Date.now();if(V instanceof globalThis.Error){let N=`retrying, ${Z} attempts remaining`;if(z.signal?.aborted)throw new q0;let L=b0(V)||/timed? ?out/i.test(String(V)+("cause"in V?String(V.cause):""));if(Z)return J0(this).info(`[${G}] connection ${L?"timed out":"failed"} - ${N}`),J0(this).debug(`[${G}] connection ${L?"timed out":"failed"} (${N})`,x0({retryOfRequestLogID:X,url:Q,durationMs:D-W,message:V.message})),this.retryRequest(z,Z,X??G);if(J0(this).info(`[${G}] connection ${L?"timed out":"failed"} - error; no more retries left`),J0(this).debug(`[${G}] connection ${L?"timed out":"failed"} (error; no more retries left)`,x0({retryOfRequestLogID:X,url:Q,durationMs:D-W,message:V.message})),L)throw new v$;throw new n0({cause:V})}let M=[...V.headers.entries()].filter(([N])=>N==="request-id").map(([N,L])=>", "+N+": "+JSON.stringify(L)).join(""),B=`[${G}${U}${M}] ${q.method} ${Q} ${V.ok?"succeeded":"failed"} with status ${V.status} in ${D-W}ms`;if(!V.ok){let N=await this.shouldRetry(V);if(Z&&N){let F=`retrying, ${Z} attempts remaining`;return await u9(V.body),J0(this).info(`${B} - ${F}`),J0(this).debug(`[${G}] response error (${F})`,x0({retryOfRequestLogID:X,url:V.url,status:V.status,headers:V.headers,durationMs:D-W})),this.retryRequest(z,Z,X??G,V.headers)}let L=N?"error; no more retries left":"error; not retryable";J0(this).info(`${B} - ${L}`);let S=await V.text().catch((F)=>h6(F).message),_=M2(S),C=_?void 0:S;throw J0(this).debug(`[${G}] response error (${L})`,x0({retryOfRequestLogID:X,url:V.url,status:V.status,headers:V.headers,message:C,durationMs:Date.now()-W})),this.makeStatusError(V.status,_,C,V.headers)}return J0(this).info(B),J0(this).debug(`[${G}] response start`,x0({retryOfRequestLogID:X,url:V.url,status:V.status,headers:V.headers,durationMs:D-W})),{response:V,options:z,controller:H,requestLogID:G,retryOfRequestLogID:X,startTime:W}}getAPIList($,Z,X){return this.requestAPIList(Z,X&&"then"in X?X.then((z)=>({method:"get",path:$,...z})):{method:"get",path:$,...X})}requestAPIList($,Z){let X=this.makeRequest(Z,null,void 0);return new p6(this,X,$)}async fetchWithTimeout($,Z,X,z){let{signal:J,method:q,...Q}=Z||{},Y=this._makeAbort(z);if(J)J.addEventListener("abort",Y,{once:!0});let G=setTimeout(Y,X),U=globalThis.ReadableStream&&Q.body instanceof globalThis.ReadableStream||typeof Q.body==="object"&&Q.body!==null&&Symbol.asyncIterator in Q.body,W={signal:z.signal,...U?{duplex:"half"}:{},method:"GET",...Q};if(q)W.method=q.toUpperCase();try{return await this.fetch.call(void 0,$,W)}finally{clearTimeout(G)}}async shouldRetry($){let Z=$.headers.get("x-should-retry");if(Z==="true")return!0;if(Z==="false")return!1;if($.status===408)return!0;if($.status===409)return!0;if($.status===429)return!0;if($.status>=500)return!0;return!1}async retryRequest($,Z,X,z){let J,q=z?.get("retry-after-ms");if(q){let Y=parseFloat(q);if(!Number.isNaN(Y))J=Y}let Q=z?.get("retry-after");if(Q&&!J){let Y=parseFloat(Q);if(!Number.isNaN(Y))J=Y*1000;else J=Date.parse(Q)-Date.now()}if(!(J&&0<=J&&J<60000)){let Y=$.maxRetries??this.maxRetries;J=this.calculateDefaultRetryTimeoutMillis(Z,Y)}return await x9(J),this.makeRequest($,Z-1,X)}calculateDefaultRetryTimeoutMillis($,Z){let J=Z-$,q=Math.min(0.5*Math.pow(2,J),8),Q=1-Math.random()*0.25;return q*Q*1000}calculateNonstreamingTimeout($,Z){if(3600000*$/128000>600000||Z!=null&&$>Z)throw new A("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 600000}async buildRequest($,{retryCount:Z=0}={}){let X={...$},{method:z,path:J,query:q,defaultBaseURL:Q}=X,Y=this.buildURL(J,q,Q);if("timeout"in X)b9("timeout",X.timeout);X.timeout=X.timeout??this.timeout;let{bodyHeaders:G,body:U}=this.buildBody({options:X}),W=await this.buildHeaders({options:$,method:z,bodyHeaders:G,retryCount:Z});return{req:{method:z,headers:W,...X.signal&&{signal:X.signal},...globalThis.ReadableStream&&U instanceof globalThis.ReadableStream&&{duplex:"half"},...U&&{body:U},...this.fetchOptions??{},...X.fetchOptions??{}},url:Y,timeout:X.timeout}}async buildHeaders({options:$,method:Z,bodyHeaders:X,retryCount:z}){let J={};if(this.idempotencyHeader&&Z!=="get"){if(!$.idempotencyKey)$.idempotencyKey=this.defaultIdempotencyKey();J[this.idempotencyHeader]=$.idempotencyKey}let q=E([J,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(z),...$.timeout?{"X-Stainless-Timeout":String(Math.trunc($.timeout/1000))}:{},...h9(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders($),this._options.defaultHeaders,X,$.headers]);return this.validateHeaders(q),q.values}_makeAbort($){return()=>$.abort()}buildBody({options:{body:$,headers:Z}}){if(!$)return{bodyHeaders:void 0,body:void 0};let X=E([Z]);if(ArrayBuffer.isView($)||$ instanceof ArrayBuffer||$ instanceof DataView||typeof $==="string"&&X.values.has("content-type")||globalThis.Blob&&$ instanceof globalThis.Blob||$ instanceof FormData||$ instanceof URLSearchParams||globalThis.ReadableStream&&$ instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:$};else if(typeof $==="object"&&((Symbol.asyncIterator in $)||(Symbol.iterator in $)&&("next"in $)&&typeof $.next==="function"))return{bodyHeaders:void 0,body:O2($)};else return K(this,i2,"f").call(this,{body:$,headers:X})}}var _5,C5,i2,RJ,E5="\\n\\nHuman:",j5="\\n\\nAssistant:",X$;var b5=j(()=>{j0();K$();f4();U0();A0();s4();FJ();P2();N5();S5();D5();P5();f4();K0();R2();K$();C5=i,i2=new WeakMap,_5=new WeakSet,RJ=function(){return this.baseURL!=="https://api.anthropic.com"};i.Anthropic=C5;i.HUMAN_PROMPT=E5;i.AI_PROMPT=j5;i.DEFAULT_TIMEOUT=600000;i.AnthropicError=A;i.APIError=o;i.APIConnectionError=n0;i.APIConnectionTimeoutError=v$;i.APIUserAbortError=q0;i.NotFoundError=c$;i.ConflictError=p$;i.RateLimitError=i$;i.BadRequestError=u$;i.AuthenticationError=m$;i.InternalServerError=n$;i.PermissionDeniedError=d$;i.UnprocessableEntityError=l$;i.toFile=n6;X$=class X$ extends i{constructor(){super(...arguments);this.completions=new z6(this),this.messages=new L$(this),this.models=new q6(this),this.beta=new P0(this)}};X$.Completions=z6;X$.Messages=L$;X$.Models=q6;X$.Beta=P0});var AJ={};yJ(AJ,{toFile:()=>n6,default:()=>X$,UnprocessableEntityError:()=>l$,RateLimitError:()=>i$,PermissionDeniedError:()=>d$,PagePromise:()=>p6,NotFoundError:()=>c$,InternalServerError:()=>n$,HUMAN_PROMPT:()=>E5,ConflictError:()=>p$,BaseAnthropic:()=>i,BadRequestError:()=>u$,AuthenticationError:()=>m$,AnthropicError:()=>A,Anthropic:()=>X$,APIUserAbortError:()=>q0,APIPromise:()=>a0,APIError:()=>o,APIConnectionTimeoutError:()=>v$,APIConnectionError:()=>n0,AI_PROMPT:()=>j5});var PJ=j(()=>{b5();s4();P2();b5();A0();U0()});var t5=fJ(o5(),1),{program:$D,createCommand:ZD,createArgument:XD,createOption:zD,CommanderError:JD,InvalidArgumentError:qD,InvalidOptionArgumentError:QD,Command:e5,Argument:YD,Option:GD,Help:UD}=t5.default;import{readFileSync as Uz,writeFileSync as wH,existsSync as Gz}from"fs";var vV=$4(),uV=R6(),mV=hZ(),H4=A6(),dV=U6(),i0=k(),cV=m0(),pV=r(),lV=c0(),iV=p0(),_N=q2(),nV=U4(),sV=W4(),rV=V4(),G2=Qz(),Yz=Y6();var aV=vV.Composer,oV=uV.Document,tV=mV.Schema,eV=H4.YAMLError,$H=H4.YAMLParseError,ZH=H4.YAMLWarning,XH=dV.Alias,zH=i0.isAlias,JH=i0.isCollection,qH=i0.isDocument,QH=i0.isMap,YH=i0.isNode,GH=i0.isPair,UH=i0.isScalar,WH=i0.isSeq,VH=cV.Pair,HH=pV.Scalar,KH=lV.YAMLMap,BH=iV.YAMLSeq;var DH=nV.Lexer,NH=sV.LineCounter,IH=rV.Parser,j6=G2.parse,LH=G2.parseAllDocuments,TH=G2.parseDocument,K4=G2.stringify,MH=Yz.visit,OH=Yz.visitAsync;function m($){let Z=Uz($,"utf-8");return j6(Z)}function p($,Z){let X=K4(Z,{lineWidth:0});wH($,X,"utf-8")}function u($){return Uz($,"utf-8")}function f($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let J=`${$}/${z}`;if(Gz(J))return J}let X=$.replace(/\/[^/]+$/,"");if(X!==$)for(let z of Z){let J=`${X}/${z}`;if(Gz(J))return J}return null}var D4=null;function x6(){if(!D4)try{D4=Kz()}catch{throw Error(`faf-scoring-kernel not installed.
205
+
206
+ Run: npm install faf-scoring-kernel
207
+ `)}return D4}function n($){return JSON.parse(x6().score_faf($))}function Bz($){return x6().validate_faf($)}function Dz($){return x6().compile_fafb($)}function Nz($){return JSON.parse(x6().decompile_fafb($))}function Iz(){return x6().sdk_version()}var N4=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,b=N4("1"),I=N4("2"),kN=N4("3"),w=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,E0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var I4=[{name:"TROPHY",indicator:`${E0("\uD83C\uDFC6")} ${E0("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${E0(b("★"))} ${E0("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${w("◆")} ${w("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${w("◇")} ${w("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${b("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${I("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${I("○")} RED`,threshold:1},{name:"WHITE",indicator:`${I("♡")}`,threshold:0}];function V2($){return $.indicator}function Lz($){for(let Z of I4)if($>=Z.threshold)return Z;return I4[I4.length-1]}function s($){return{score:$.score,tier:Lz($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}function a($,Z,X=!1){let z=V2($.tier),J=$.score===100?E0(b("100%")):b(`${$.score}%`);if(console.log(`${z} ${J} ${I(`${$.populated}/${$.active} slots`)} ${I("—")} ${Z}`),$.tier.name!=="TROPHY"&&$.empty>0)console.log(I(` ${$.empty} empty`));if(X)console.log(""),vH($)}function vH($){for(let[Z,X]of Object.entries($.slots)){let z=X==="populated"?w("●"):X==="slotignored"?I("—"):I("○");console.log(` ${z} ${X==="slotignored"?I(Z):Z}`)}}function L4($,Z={}){let X=$??f();if(!X)console.error(`Error: project.faf not found
208
+
209
+ Run 'faf init' to create one.`),process.exit(2);let z=u(X),J=n(z),q=s(J);if(Z.json){console.log(JSON.stringify(q,null,2));return}if(Z.status){console.log(`${V2(q.tier)} ${q.score}%`);return}a(q,X,Z.verbose)}import{existsSync as pH}from"fs";import{join as _z}from"path";var Q0=[{index:1,path:"project.name",description:"Project name",category:"project"},{index:2,path:"project.goal",description:"What the project does",category:"project"},{index:3,path:"project.main_language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",description:"Who is building this",category:"human"},{index:5,path:"human_context.what",description:"What are they building",category:"human"},{index:6,path:"human_context.why",description:"Why does it exist",category:"human"},{index:7,path:"human_context.where",description:"Where does it run",category:"human"},{index:8,path:"human_context.when",description:"When was it started / timeline",category:"human"},{index:9,path:"human_context.how",description:"How is it built",category:"human"},{index:10,path:"stack.frontend",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",description:"State management",category:"frontend"},{index:14,path:"stack.backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",description:"API style (REST, GraphQL, etc.)",category:"backend"},{index:16,path:"stack.runtime",description:"Runtime (Node, Bun, Python, etc.)",category:"backend"},{index:17,path:"stack.database",description:"Database",category:"backend"},{index:18,path:"stack.connection",description:"Connection method (Prisma, etc.)",category:"backend"},{index:19,path:"stack.hosting",description:"Hosting platform",category:"universal"},{index:20,path:"stack.build",description:"Build tool",category:"universal"},{index:21,path:"stack.cicd",description:"CI/CD",category:"universal"},{index:22,path:"stack.monorepo_tool",description:"Monorepo tool",category:"enterprise_infra"},{index:23,path:"stack.package_manager",description:"Package manager",category:"enterprise_infra"},{index:24,path:"stack.workspaces",description:"Workspace configuration",category:"enterprise_infra"},{index:25,path:"monorepo.packages_count",description:"Number of packages",category:"enterprise_infra"},{index:26,path:"monorepo.build_orchestrator",description:"Build orchestration tool",category:"enterprise_infra"},{index:27,path:"stack.admin",description:"Admin panel",category:"enterprise_app"},{index:28,path:"stack.cache",description:"Caching layer",category:"enterprise_app"},{index:29,path:"stack.search",description:"Search engine",category:"enterprise_app"},{index:30,path:"stack.storage",description:"Object storage",category:"enterprise_app"},{index:31,path:"monorepo.versioning_strategy",description:"Version strategy",category:"enterprise_ops"},{index:32,path:"monorepo.shared_configs",description:"Shared configs",category:"enterprise_ops"},{index:33,path:"monorepo.remote_cache",description:"Remote build cache",category:"enterprise_ops"}],sN=new Map(Q0.map(($)=>[$.path,$]));var rN=Q0.filter(($)=>$.index<=21);var uH=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]);function x$($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return uH.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var k$={cli:["project","human"],library:["project","human"],mcp:["project","backend","human"],backend:["project","backend","universal","human"],"data-science":["project","backend","human"],frontend:["project","frontend","human"],fullstack:["project","frontend","backend","universal","human"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]};import{existsSync as g,readFileSync as mH,readdirSync as Mz}from"fs";import{join as y}from"path";var Tz=[{name:"Next.js",slug:"nextjs",category:"frontend",signals:[{type:"dependency",key:"next"},{type:"file",pattern:"next.config.*"}]},{name:"React",slug:"react",category:"frontend",signals:[{type:"dependency",key:"react"}]},{name:"SvelteKit",slug:"sveltekit",category:"frontend",signals:[{type:"dependency",key:"@sveltejs/kit"},{type:"file",pattern:"svelte.config.*"}]},{name:"Svelte",slug:"svelte",category:"frontend",signals:[{type:"dependency",key:"svelte"}]},{name:"Vue.js",slug:"vue",category:"frontend",signals:[{type:"dependency",key:"vue"}]},{name:"Nuxt",slug:"nuxt",category:"frontend",signals:[{type:"dependency",key:"nuxt"},{type:"file",pattern:"nuxt.config.*"}]},{name:"Angular",slug:"angular",category:"frontend",signals:[{type:"dependency",key:"@angular/core"},{type:"file",pattern:"angular.json"}]},{name:"Astro",slug:"astro",category:"frontend",signals:[{type:"dependency",key:"astro"},{type:"file",pattern:"astro.config.*"}]},{name:"Solid",slug:"solid",category:"frontend",signals:[{type:"dependency",key:"solid-js"}]},{name:"Remix",slug:"remix",category:"frontend",signals:[{type:"dependency",key:"@remix-run/react"}]},{name:"Gatsby",slug:"gatsby",category:"frontend",signals:[{type:"dependency",key:"gatsby"},{type:"file",pattern:"gatsby-config.*"}]},{name:"Qwik",slug:"qwik",category:"frontend",signals:[{type:"dependency",key:"@builder.io/qwik"}]},{name:"Tailwind CSS",slug:"tailwind",category:"css",signals:[{type:"dependency",key:"tailwindcss"},{type:"devDependency",key:"tailwindcss"},{type:"file",pattern:"tailwind.config.*"}]},{name:"Bootstrap",slug:"bootstrap",category:"css",signals:[{type:"dependency",key:"bootstrap"}]},{name:"Styled Components",slug:"styled-components",category:"css",signals:[{type:"dependency",key:"styled-components"}]},{name:"shadcn/ui",slug:"shadcn",category:"ui",signals:[{type:"file",pattern:"components.json"},{type:"dependency",key:"@radix-ui/react-dialog"}]},{name:"Material UI",slug:"mui",category:"ui",signals:[{type:"dependency",key:"@mui/material"}]},{name:"Chakra UI",slug:"chakra",category:"ui",signals:[{type:"dependency",key:"@chakra-ui/react"}]},{name:"Ant Design",slug:"antd",category:"ui",signals:[{type:"dependency",key:"antd"}]},{name:"Redux",slug:"redux",category:"state",signals:[{type:"dependency",key:"@reduxjs/toolkit"}]},{name:"Zustand",slug:"zustand",category:"state",signals:[{type:"dependency",key:"zustand"}]},{name:"Jotai",slug:"jotai",category:"state",signals:[{type:"dependency",key:"jotai"}]},{name:"Pinia",slug:"pinia",category:"state",signals:[{type:"dependency",key:"pinia"}]},{name:"Express",slug:"express",category:"backend",signals:[{type:"dependency",key:"express"}]},{name:"Fastify",slug:"fastify",category:"backend",signals:[{type:"dependency",key:"fastify"}]},{name:"Hono",slug:"hono",category:"backend",signals:[{type:"dependency",key:"hono"}]},{name:"Elysia",slug:"elysia",category:"backend",signals:[{type:"dependency",key:"elysia"}]},{name:"NestJS",slug:"nestjs",category:"backend",signals:[{type:"dependency",key:"@nestjs/core"}]},{name:"Koa",slug:"koa",category:"backend",signals:[{type:"dependency",key:"koa"}]},{name:"Django",slug:"django",category:"backend",signals:[{type:"file",pattern:"manage.py"},{type:"file",pattern:"settings.py"}]},{name:"Flask",slug:"flask",category:"backend",signals:[{type:"file",pattern:"app.py"}]},{name:"FastAPI",slug:"fastapi",category:"backend",signals:[{type:"file",pattern:"main.py"}]},{name:"Rails",slug:"rails",category:"backend",signals:[{type:"file",pattern:"Gemfile"},{type:"file",pattern:"config/routes.rb"}]},{name:"Spring Boot",slug:"spring",category:"backend",signals:[{type:"file",pattern:"pom.xml"},{type:"file",pattern:"build.gradle"}]},{name:"Prisma",slug:"prisma",category:"database",signals:[{type:"dependency",key:"prisma"},{type:"devDependency",key:"prisma"},{type:"file",pattern:"prisma/schema.prisma"}]},{name:"Drizzle",slug:"drizzle",category:"database",signals:[{type:"dependency",key:"drizzle-orm"},{type:"file",pattern:"drizzle.config.*"}]},{name:"TypeORM",slug:"typeorm",category:"database",signals:[{type:"dependency",key:"typeorm"}]},{name:"Mongoose",slug:"mongoose",category:"database",signals:[{type:"dependency",key:"mongoose"}]},{name:"Vite",slug:"vite",category:"build",signals:[{type:"dependency",key:"vite"},{type:"devDependency",key:"vite"},{type:"file",pattern:"vite.config.*"}]},{name:"webpack",slug:"webpack",category:"build",signals:[{type:"dependency",key:"webpack"},{type:"devDependency",key:"webpack"},{type:"file",pattern:"webpack.config.*"}]},{name:"esbuild",slug:"esbuild",category:"build",signals:[{type:"dependency",key:"esbuild"},{type:"devDependency",key:"esbuild"}]},{name:"Turbopack",slug:"turbopack",category:"build",signals:[{type:"file",pattern:"turbo.json"}]},{name:"Jest",slug:"jest",category:"testing",signals:[{type:"devDependency",key:"jest"},{type:"file",pattern:"jest.config.*"}]},{name:"Vitest",slug:"vitest",category:"testing",signals:[{type:"devDependency",key:"vitest"}]},{name:"Playwright",slug:"playwright",category:"testing",signals:[{type:"devDependency",key:"@playwright/test"},{type:"file",pattern:"playwright.config.*"}]},{name:"Cypress",slug:"cypress",category:"testing",signals:[{type:"devDependency",key:"cypress"},{type:"file",pattern:"cypress.config.*"}]},{name:"Turborepo",slug:"turborepo",category:"monorepo",signals:[{type:"devDependency",key:"turbo"},{type:"file",pattern:"turbo.json"}]},{name:"Nx",slug:"nx",category:"monorepo",signals:[{type:"devDependency",key:"nx"},{type:"file",pattern:"nx.json"}]},{name:"Lerna",slug:"lerna",category:"monorepo",signals:[{type:"devDependency",key:"lerna"},{type:"file",pattern:"lerna.json"}]},{name:"MCP SDK",slug:"mcp",category:"ai",signals:[{type:"dependency",key:"@modelcontextprotocol/sdk"}]},{name:"Anthropic SDK",slug:"anthropic",category:"ai",signals:[{type:"dependency",key:"@anthropic-ai/sdk"}]},{name:"OpenAI SDK",slug:"openai",category:"ai",signals:[{type:"dependency",key:"openai"}]},{name:"LangChain",slug:"langchain",category:"ai",signals:[{type:"dependency",key:"langchain"}]},{name:"Vercel",slug:"vercel",category:"hosting",signals:[{type:"file",pattern:"vercel.json"}]},{name:"Netlify",slug:"netlify",category:"hosting",signals:[{type:"file",pattern:"netlify.toml"}]},{name:"Docker",slug:"docker",category:"hosting",signals:[{type:"file",pattern:"Dockerfile"},{type:"file",pattern:"docker-compose.yml"}]},{name:"Cloudflare Workers",slug:"cloudflare",category:"hosting",signals:[{type:"file",pattern:"wrangler.toml"},{type:"dependency",key:"wrangler"}]},{name:"GitHub Actions",slug:"github-actions",category:"cicd",signals:[{type:"file",pattern:".github/workflows/*.yml"}]},{name:"Commander.js",slug:"commander",category:"cli",signals:[{type:"dependency",key:"commander"}]}];function V$($){let Z=y($,"package.json");if(!g(Z))return null;try{return JSON.parse(mH(Z,"utf-8"))}catch{return null}}function dH($,Z){if(!Z.includes("*"))return g(y($,Z));let X=Z.split("/");if(X.length===1){let Y=Z.split("*")[0];try{return Mz($).some((G)=>G.startsWith(Y))}catch{return!1}}let z=y($,...X.slice(0,-1)),J=X[X.length-1],q=J.split("*")[0],Q=J.split("*")[1]||"";try{return Mz(z).some((Y)=>Y.startsWith(q)&&Y.endsWith(Q))}catch{return!1}}function cH($,Z,X){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"file":return dH(X,$.pattern);default:return!1}}function T4($){let Z=V$($);return Tz.map((X)=>{let J=X.signals.filter((q)=>cH(q,Z,$)).length/X.signals.length;return{name:X.name,slug:X.slug,category:X.category,confidence:J}}).filter((X)=>X.confidence>0).sort((X,z)=>z.confidence-X.confidence)}function Oz($){let Z=V$($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(g(y($,"tsconfig.json")))return"TypeScript";if(g(y($,"Cargo.toml")))return"Rust";if(g(y($,"go.mod")))return"Go";if(g(y($,"pyproject.toml"))||g(y($,"setup.py")))return"Python";if(g(y($,"Gemfile")))return"Ruby";if(g(y($,"pom.xml"))||g(y($,"build.gradle")))return"Java";if(g(y($,"Package.swift")))return"Swift";if(g(y($,"build.zig")))return"Zig";if(Z)return"JavaScript";return"Unknown"}function wz($){let Z=V$($),X=T4($);if(Z?.bin)return"cli";if(X.some((Q)=>Q.slug==="mcp"))return"mcp";let J=X.some((Q)=>Q.category==="frontend"),q=X.some((Q)=>Q.category==="backend");if(J&&q)return"fullstack";if(J)return"frontend";if(q)return"backend";if(Z?.main&&!Z?.bin)return"library";return"library"}function Fz($){if(g(y($,"bunfig.toml")))return"Bun";if(g(y($,"deno.json"))||g(y($,"deno.jsonc")))return"Deno";if(V$($))return"Node.js";if(g(y($,"Cargo.toml")))return"Rust";if(g(y($,"go.mod")))return"Go";return"Unknown"}function Rz($){if(g(y($,"bun.lockb"))||g(y($,"bun.lock")))return"bun";if(g(y($,"pnpm-lock.yaml")))return"pnpm";if(g(y($,"yarn.lock")))return"yarn";if(g(y($,"package-lock.json")))return"npm";return"npm"}function Az($){if(g(y($,".github/workflows")))return"GitHub Actions";if(g(y($,".gitlab-ci.yml")))return"GitLab CI";if(g(y($,".circleci")))return"CircleCI";if(g(y($,"Jenkinsfile")))return"Jenkins";return null}function Pz($){if(g(y($,"vercel.json")))return"Vercel";if(g(y($,"netlify.toml")))return"Netlify";if(g(y($,"wrangler.toml")))return"Cloudflare";if(g(y($,"Dockerfile")))return"Docker";if(g(y($,"fly.toml")))return"Fly.io";if(g(y($,"render.yaml")))return"Render";return null}function Sz($){let Z=V$($);if(Z?.devDependencies?.vite||Z?.dependencies?.vite)return"Vite";if(Z?.devDependencies?.webpack||Z?.dependencies?.webpack)return"webpack";if(Z?.devDependencies?.esbuild||Z?.dependencies?.esbuild)return"esbuild";if(g(y($,"tsconfig.json"))&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function f$($){let Z=V$($),X=T4($),z=Oz($),J=wz($),q=Fz($),Q=Rz($),Y=Az($),G=Pz($),U=Sz($),W=X.find((R)=>R.category==="frontend"),H=X.find((R)=>R.category==="css"),V=X.find((R)=>R.category==="ui"),D=X.find((R)=>R.category==="state"),M=X.find((R)=>R.category==="backend"),B=X.find((R)=>R.category==="database"),N=k$[J]||k$.library,L={},S=Q0.filter((R)=>R.path.startsWith("stack."));for(let R of S){let F=R.path.replace("stack.","");if(!N.includes(R.category)){L[F]="slotignored";continue}switch(F){case"frontend":L[F]=W?.name??(J==="cli"?"CLI":"");break;case"css_framework":L[F]=H?.name??"";break;case"ui_library":L[F]=V?.name??"";break;case"state_management":L[F]=D?.name??"";break;case"backend":L[F]=M?.name??"";break;case"api_type":L[F]="";break;case"runtime":L[F]=q!=="Unknown"?q:"";break;case"database":L[F]=B?.name??"";break;case"connection":L[F]=B?.name??"";break;case"hosting":L[F]=G??"";break;case"build":L[F]=U??"";break;case"cicd":L[F]=Y??"";break;case"package_manager":L[F]=Q;break;default:L[F]="";break}}let _={},C=Q0.filter((R)=>R.path.startsWith("monorepo."));for(let R of C){let F=R.path.replace("monorepo.","");if(!N.includes(R.category))_[F]="slotignored";else _[F]=""}return{faf_version:"2.5.0",project:{name:Z?.name??$.split("/").pop()??"project",goal:Z?.description??"",main_language:z,type:J},stack:L,human_context:{who:"",what:Z?.description??"",why:"",where:"",when:"",how:""},monorepo:_}}function M4($={}){let Z=process.cwd(),X=$.output?$.output.endsWith(".faf")?$.output:_z(Z,$.output):_z(Z,"project.faf");if(pH(X)&&!$.force)console.error(`project.faf already exists. Use ${b("--force")} to overwrite.`),process.exit(1);let z=f$(Z);p(X,z);let J=u(X),q=s(n(J));if(console.log(`${w("created")} ${X}`),a(q,X),q.score<100)console.log(I(`
210
+ run ${b("'faf go'")} to fill empty slots`))}import{existsSync as lH}from"fs";import{join as iH}from"path";function Cz(){let $=process.cwd(),Z=iH($,"project.faf"),X=f$($);if(lH(Z)){let q=m(Z),Q=Ez(q,X);p(Z,Q),console.log(`${w("updated")} ${Z}`)}else{let q=X.project?.type??"library",Q=k$[q]||k$.library;for(let Y of Q0)if(!Q.includes(Y.category)){let[G,U]=Y.path.split(".");if(G==="stack"&&X.stack)X.stack[U]="slotignored";if(G==="monorepo"&&X.monorepo)X.monorepo[U]="slotignored"}p(Z,X),console.log(`${w("created")} ${Z}`)}let z=u(Z),J=s(n(z));if(a(J,Z),J.score<100)console.log(I(`
211
+ run ${b("'faf go'")} to reach 100%`))}function Ez($,Z){let X={...$};for(let[z,J]of Object.entries(Z))if(!(z in X)||X[z]===null||X[z]===void 0)X[z]=J;else if(typeof J==="object"&&J!==null&&!Array.isArray(J))X[z]=Ez(X[z]??{},J);return X}import{existsSync as g$,statSync as K2}from"fs";import{join as gz}from"path";import{readFileSync as nH,writeFileSync as sH,existsSync as rH,statSync as FI}from"fs";import{join as jz}from"path";var bz="CLAUDE.md",aH="STATUS: BI-SYNC ACTIVE";function xz($){let Z=jz($,bz);if(!rH(Z))return null;return nH(Z,"utf-8")}function kz($,Z){let X=jz($,bz);sH(X,Z,"utf-8")}function H$($){return`<!-- faf: ${[$.project?.name,$.project?.main_language,$.project?.goal].filter(Boolean).map((X)=>String(X).trim()).join(" | ")} -->`}function fz($){let Z=[],X=$.project?.name??"Project",z=$.project?.main_language??"",J=$.project?.goal??"";if(Z.push(H$($)),Z.push(""),Z.push(`# CLAUDE.md — ${X}`),Z.push(""),J)Z.push("## What This Is"),Z.push(""),Z.push(J),Z.push("");let q=$.stack??{},Q=[];if(z)Q.push(`**Language:** ${z}`);for(let[U,W]of Object.entries(q))if(W&&W!=="slotignored"&&String(W).trim()){let H=U.replace(/_/g," ").replace(/\b\w/g,(V)=>V.toUpperCase());Q.push(`**${H}:** ${W}`)}if(Q.length>0){Z.push("## Stack"),Z.push("");for(let U of Q)Z.push(`- ${U}`);Z.push("")}let Y=$.human_context??{},G=[["Who",Y.who],["What",Y.what],["Why",Y.why],["Where",Y.where],["When",Y.when],["How",Y.how]].filter(([U,W])=>W&&String(W).trim());if(G.length>0){Z.push("## Context"),Z.push("");for(let[U,W]of G)Z.push(`- **${U}:** ${W}`);Z.push("")}return Z.push("---"),Z.push(""),Z.push(`*${aH} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
212
+ `)}function H2($){let Z={project:{}},X=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(X)Z.project.name=X[1].trim();if(!Z.project.name){let q=$.match(/\*\*Name:\*\*\s*(.+)/);if(q)Z.project.name=q[1].trim()}let z=$.match(/## What This Is\s*\n\s*\n(.+)/);if(z)Z.project.goal=z[1].trim();if(!Z.project.goal){let q=$.match(/\*\*What Building:\*\*\s*(.+)/);if(q)Z.project.goal=q[1].trim()}let J=$.match(/\*\*Language:\*\*\s*(.+)/);if(J)Z.project.main_language=J[1].trim();if(!Z.project.main_language){let q=$.match(/\*\*Main Language:\*\*\s*(.+)/);if(q)Z.project.main_language=q[1].trim()}return Z}import{readFileSync as SI,writeFileSync as oH,existsSync as _I}from"fs";import{join as tH}from"path";function yz($,Z){oH(tH($,"MEMORY.md"),Z,"utf-8")}function y$(){return process.env.FAF_PRO==="1"||process.env.FAF_PRO==="true"}function O4($={}){let Z=process.cwd(),X=f(Z);if(!X)console.error(`Error: project.faf not found
213
+
214
+ Run 'faf init' to create one.`),process.exit(2);let z=gz(Z,"CLAUDE.md"),J=gz(Z,"MEMORY.md"),q=$.direction??"auto";if(q==="auto")hz(X,z,Z);else if(q==="push")vz(X,Z);else if(q==="pull")uz(X,z);if(y$())mz(X,J,Z);if($.watch)console.log(I("watching for changes... (Ctrl+C to stop)")),$K(X,z,J,Z)}function hz($,Z,X){let z=K2($).mtimeMs,J=g$(Z)?K2(Z).mtimeMs:0;if(!g$(Z)||z>J)vz($,X);else uz($,Z)}function vz($,Z){let X=m($),z=fz(X);kz(Z,z),console.log(`${w("◆")} sync .faf → CLAUDE.md ${I("← bi-sync")}`);let J=s(n(u($)));a(J,$)}function uz($,Z){let X=xz(Z.replace("/CLAUDE.md",""));if(!X){console.error("CLAUDE.md not found.");return}let z=H2(X),J=m($);if(z.project?.name)J.project={...J.project,name:z.project.name};if(z.project?.goal)J.project={...J.project,goal:z.project.goal};if(z.project?.main_language)J.project={...J.project,main_language:z.project.main_language};p($,J),console.log(`${w("◆")} sync CLAUDE.md → .faf ${I("← bi-sync")}`);let q=s(n(u($)));a(q,$)}function mz($,Z,X){let z=m($),J=K2($).mtimeMs,q=g$(Z)?K2(Z).mtimeMs:0;if(!g$(Z)||J>q){let Q=eH(z);yz(X,Q),console.log(`${w("◆")} sync .faf → MEMORY.md ${I("← tri-sync")}`)}else console.log(`${w("◆")} sync MEMORY.md → .faf ${I("← tri-sync")}`)}function eH($){let Z=$.project??{},X=[`# ${Z.name??"Project"} — Memory Topics`,"","> Generated by faf sync (tri-sync)",""];if(Z.name)X.push(`- **Project:** ${Z.name}`);if(Z.goal)X.push(`- **Goal:** ${Z.goal}`);if(Z.main_language)X.push(`- **Language:** ${Z.main_language}`);if(Z.type)X.push(`- **Type:** ${Z.type}`);return X.join(`
215
+ `)+`
216
+ `}function $K($,Z,X,z){let{watch:J}=z0("fs"),q=null,Q=()=>{if(q)clearTimeout(q);q=setTimeout(()=>{if(console.log(I("change detected...")),hz($,Z,z),y$())mz($,X,z)},200)};if(J($,Q),g$(Z))J(Z,Q);if(y$()&&g$(X))J(X,Q)}import{writeFileSync as ZK}from"fs";function dz($,Z={}){let X=$??f();if(!X)console.error(`Error: project.faf not found
217
+
218
+ Run 'faf init' to create one.`),process.exit(2);let z=u(X),J=Dz(z),q=Z.output??X.replace(/\.faf$/,".fafb");ZK(q,J),console.log(`${w("compiled")} ${q} ${I(`(${J.length} bytes)`)}`)}import{readFileSync as XK}from"fs";function cz($,Z={}){if(!$)console.error("Error: Please specify a .fafb file to decompile."),process.exit(1);let X=new Uint8Array(XK($));if(String.fromCharCode(X[0],X[1],X[2],X[3])!=="FAFB")console.error("Error: Not a valid .fafb file (missing FAFB magic bytes)."),process.exit(3);let z=Nz(X);console.log(JSON.stringify(z,null,2))}function pz($){let Z=[];if(!$||typeof $!=="object")return Z.push("File is not a valid YAML mapping"),{valid:!1,errors:Z};let X=$;if(!X.faf_version)Z.push("Missing required field: faf_version");if(!X.project?.name)Z.push("Missing required field: project.name");return{valid:Z.length===0,errors:Z}}function w4($,Z={}){let X=$??f();if(!X)console.error(`Error: project.faf not found
219
+
220
+ Run 'faf init' to create one.`),process.exit(2);let z=m(X),J=pz(z);if(!J.valid){console.log(`${b("invalid")} ${X}`);for(let Y of J.errors)console.log(` ${I("x")} ${Y}`);process.exit(3)}let q=u(X);if(!Bz(q))console.log(`${b("invalid yaml")} ${X}`),process.exit(3);console.log(`${w("valid")} ${X}`);let Q=s(n(q));if(a(Q,X),Z.strict&&Q.score<100)console.log(I(`
221
+ --strict requires 100%`)),process.exit(1)}import{writeFileSync as zK}from"fs";import{join as JK}from"path";function qK($){let Z=[];if(Z.push(H$($)),Z.push(""),Z.push(`# AGENTS.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Auto-generated from project.faf — do not edit directly"),Z.push(""),Z.push("## Project Context"),Z.push(""),$.project?.name)Z.push(`- **Name:** ${$.project.name}`);if($.project?.goal)Z.push(`- **Goal:** ${$.project.goal}`);if($.project?.main_language)Z.push(`- **Language:** ${$.project.main_language}`);if(Z.push(""),Z.push("## Stack"),Z.push(""),$.stack){for(let[X,z]of Object.entries($.stack))if(z&&z!=="slotignored"&&z!=="")Z.push(`- **${X}:** ${z}`)}if($.human_context){Z.push(""),Z.push("## Human Context"),Z.push("");for(let[X,z]of Object.entries($.human_context))if(z&&z!=="")Z.push(`- **${X}:** ${z}`)}return Z.push(""),Z.join(`
222
+ `)}function lz($,Z){zK(JK($,"AGENTS.md"),qK(Z),"utf-8")}import{writeFileSync as QK}from"fs";import{join as YK}from"path";function GK($){let Z=[];if(Z.push(H$($)),Z.push(""),Z.push("# .cursorrules"),Z.push(`# Auto-generated from project.faf — ${$.project?.name??"Project"}`),Z.push(""),$.project?.main_language)Z.push(`language: ${$.project.main_language}`);if($.stack){Z.push(""),Z.push("# Stack");for(let[X,z]of Object.entries($.stack))if(z&&z!=="slotignored"&&z!=="")Z.push(`# ${X}: ${z}`)}return Z.push(""),Z.join(`
223
+ `)}function iz($,Z){QK(YK($,".cursorrules"),GK(Z),"utf-8")}import{writeFileSync as UK}from"fs";import{join as WK}from"path";function VK($){let Z=[];if(Z.push(H$($)),Z.push(""),Z.push(`# GEMINI.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Auto-generated from project.faf"),Z.push(""),$.project?.name)Z.push(`Project: ${$.project.name}`);if($.project?.goal)Z.push(`Goal: ${$.project.goal}`);if($.project?.main_language)Z.push(`Language: ${$.project.main_language}`);if($.stack){Z.push(""),Z.push("## Stack");for(let[X,z]of Object.entries($.stack))if(z&&z!=="slotignored"&&z!=="")Z.push(`- ${X}: ${z}`)}return Z.push(""),Z.join(`
224
+ `)}function nz($,Z){UK(WK($,"GEMINI.md"),VK(Z),"utf-8")}function k6($={}){let Z=f();if(!Z)console.error(`Error: project.faf not found
225
+
226
+ Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),z=m(Z),J=$.all||!$.agents&&!$.cursor&&!$.gemini&&!$.conductor;if(J||$.agents)lz(X,z),console.log(" AGENTS.md");if(J||$.cursor)iz(X,z),console.log(" .cursorrules");if(J||$.gemini)nz(X,z),console.log(" GEMINI.md");console.log(`${w("exported")} ${I(`from ${Z}`)}`)}import{mkdirSync as HK,rmSync as KK}from"fs";import{join as sz}from"path";import{execSync as BK}from"child_process";import{tmpdir as DK}from"os";function rz($){if(!$)console.error(`Error: Please provide a GitHub URL.
227
+
228
+ Usage: faf git <url>`),process.exit(1);let Z=$.endsWith(".git")?$:`${$}.git`,X=sz(DK(),`faf-git-${Date.now()}`);HK(X,{recursive:!0});try{console.log(I(`cloning ${$}...`)),BK(`git clone --depth 1 ${Z} ${X}`,{stdio:"pipe"});let z=f$(X),J=sz(process.cwd(),"project.faf");p(J,z),console.log(`${w("created")} ${J}`);let q=u(J),Q=s(n(q));a(Q,J)}finally{KK(X,{recursive:!0,force:!0})}}function oz($={}){if($.version||Object.keys($).length===0)IK()}function IK(){let $=az();console.log(`${w(b("faf"))} v${$.version}`),console.log(I(`kernel ${Iz()} IANA application/vnd.faf+yaml`))}var f6=[{name:"HTML",extensions:[".html",".htm"],category:"web"},{name:"CSS",extensions:[".css"],category:"web"},{name:"JavaScript",extensions:[".js",".mjs",".cjs"],category:"web"},{name:"TypeScript",extensions:[".ts",".tsx",".mts",".cts"],category:"web"},{name:"JSX",extensions:[".jsx"],category:"web"},{name:"Vue",extensions:[".vue"],category:"web"},{name:"Svelte",extensions:[".svelte"],category:"web"},{name:"Astro",extensions:[".astro"],category:"web"},{name:"JSON",extensions:[".json"],category:"data"},{name:"YAML",extensions:[".yml",".yaml"],category:"data"},{name:"TOML",extensions:[".toml"],category:"data"},{name:"XML",extensions:[".xml"],category:"data"},{name:"CSV",extensions:[".csv"],category:"data"},{name:"INI",extensions:[".ini",".cfg"],category:"config"},{name:"Env",extensions:[".env"],category:"config"},{name:"Dockerfile",extensions:["Dockerfile"],category:"config"},{name:"Rust",extensions:[".rs"],category:"systems"},{name:"Go",extensions:[".go"],category:"systems"},{name:"C",extensions:[".c",".h"],category:"systems"},{name:"C++",extensions:[".cpp",".cc",".hpp"],category:"systems"},{name:"Zig",extensions:[".zig"],category:"systems"},{name:"Python",extensions:[".py"],category:"scripting"},{name:"Ruby",extensions:[".rb"],category:"scripting"},{name:"Shell",extensions:[".sh",".bash",".zsh"],category:"scripting"},{name:"Lua",extensions:[".lua"],category:"scripting"},{name:"Java",extensions:[".java"],category:"jvm"},{name:"Kotlin",extensions:[".kt",".kts"],category:"jvm"},{name:"Scala",extensions:[".scala"],category:"jvm"},{name:"C#",extensions:[".cs"],category:"dotnet"},{name:"F#",extensions:[".fs"],category:"dotnet"},{name:"Swift",extensions:[".swift"],category:"mobile"},{name:"Dart",extensions:[".dart"],category:"mobile"},{name:"Markdown",extensions:[".md",".mdx"],category:"docs"},{name:"LaTeX",extensions:[".tex"],category:"docs"},{name:"reStructuredText",extensions:[".rst"],category:"docs"},{name:"FAF",extensions:[".faf"],category:"faf"},{name:"FAFb",extensions:[".fafb"],category:"faf"}];function tz(){console.log(`${w("formats")} ${I("— supported file types")}
229
+ `);let $=new Map;for(let Z of f6){let X=$.get(Z.category)??[];X.push(Z),$.set(Z.category,X)}for(let[Z,X]of $){console.log(` ${b(Z)}`);for(let z of X)console.log(` ${z.name} ${I(z.extensions.join(", "))}`);console.log()}console.log(I(` ${f6.length} formats across ${$.size} categories`))}import{readdirSync as LK,rmSync as TK}from"fs";import{tmpdir as MK}from"os";import{join as OK}from"path";function ez(){let $=MK(),Z=0;try{let X=LK($);for(let z of X)if(z.startsWith("faf-git-"))TK(OK($,z),{recursive:!0,force:!0}),Z++}catch{}if(Z>0)console.log(`${w("cleared")} ${Z} cached director${Z===1?"y":"ies"}`);else console.log(I("nothing to clear"))}function $9($={}){let Z=f();if(!Z)console.error(`Error: project.faf not found
230
+
231
+ Run 'faf init' to create one.`),process.exit(2);if($.json){let X=m(Z);console.log(JSON.stringify(X,null,2))}else{let X=u(Z);console.log(X)}}function Z9(){let $=f();if(!$)console.error(`Error: project.faf not found
232
+
233
+ Run 'faf init' to create one.`),process.exit(2);let Z=m($),X=[];for(let z of Q0){let[J,q]=z.path.split("."),Y=Z[J]?.[q];if(x$(Y)||Y==="slotignored")continue;X.push(`${z.path}: ${Y}`)}if(X.length===0){console.log(I("no populated slots"));return}console.log(X.join(`
234
+ `))}import{existsSync as wK,statSync as X9}from"fs";import{join as FK}from"path";var RK=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"];function z9(){let $=f();if(!$)console.error(`Error: project.faf not found
235
+
236
+ Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),X=X9($).mtimeMs;console.log(`${w("drift")} ${I("— context file sync status")}
237
+ `),console.log(` ${b(".faf")} ${I(F4(X))}`);let z=0;for(let J of RK){let q=FK(Z,J);if(!wK(q)){console.log(` ${I("○")} ${J} ${I("missing")}`);continue}let Q=X9(q).mtimeMs,Y=Q-X;if(Math.abs(Y)<1000)console.log(` ${w("●")} ${J} ${I("in sync")}`);else if(Y>0)console.log(` ${b("!")} ${J} ${b("newer")} ${I(F4(Q))}`),z++;else console.log(` ${I("○")} ${J} ${I("older")} ${I(F4(Q))}`),z++}if(z>0)console.log(I(`
238
+ run ${b("'faf sync'")} to resolve drift`))}function F4($){let Z=Date.now()-$,X=Math.floor(Z/1000);if(X<60)return`${X}s ago`;let z=Math.floor(X/60);if(z<60)return`${z}m ago`;let J=Math.floor(z/60);if(J<24)return`${J}h ago`;return`${Math.floor(J/24)}d ago`}function J9($,Z){if(!$||Z===void 0)console.error(`Usage: faf edit <path> <value>
239
+
240
+ Example: faf edit project.name "My Project"`),process.exit(1);let X=f();if(!X)console.error(`Error: project.faf not found
241
+
242
+ Run 'faf init' to create one.`),process.exit(2);let z=m(X),J=$.split(".");if(J.length!==2)console.error("Error: path must be section.field (e.g. project.name)"),process.exit(1);let[q,Q]=J;if(!z[q]||typeof z[q]!=="object")z[q]={};z[q][Q]=Z,p(X,z),console.log(`${w("updated")} ${$} ${I("→")} ${Z}`)}import{existsSync as B2,readFileSync as R4}from"fs";import{join as y6}from"path";function q9(){let $=process.cwd(),Z=[],X={faf_version:"2.5.0",project:{}},z=y6($,"CLAUDE.md");if(B2(z)){let G=R4(z,"utf-8"),U=H2(G);if(U.project?.name)X.project.name=U.project.name;if(U.project?.goal)X.project.goal=U.project.goal;if(U.project?.main_language)X.project.main_language=U.project.main_language;Z.push("CLAUDE.md")}let J=y6($,"AGENTS.md");if(B2(J)){let G=R4(J,"utf-8");if(!X.project.name){let U=G.match(/^#\s+(.+)/m);if(U)X.project.name=U[1].trim()}Z.push("AGENTS.md")}let q=y6($,"GEMINI.md");if(B2(q)){let G=R4(q,"utf-8");if(!X.project.name){let U=G.match(/^#\s+(.+)/m);if(U)X.project.name=U[1].trim()}Z.push("GEMINI.md")}let Q=y6($,".cursorrules");if(B2(Q))Z.push(".cursorrules");if(Z.length===0)console.error("No context files found (CLAUDE.md, AGENTS.md, GEMINI.md, .cursorrules)."),process.exit(2);let Y=f($);if(Y){let G=m(Y);if(!G.project)G.project={};if(X.project.name&&!G.project.name)G.project.name=X.project.name;if(X.project.goal&&!G.project.goal)G.project.goal=X.project.goal;if(X.project.main_language&&!G.project.main_language)G.project.main_language=X.project.main_language;p(Y,G),console.log(`${w("◆")} recover merged into ${Y}`)}else{let G=y6($,"project.faf");p(G,X),console.log(`${w("◆")} recover created ${G}`)}console.log(I(` sources: ${Z.join(", ")}`))}var g6="2.5.0";function Q9($={}){let Z=f();if(!Z)console.error(`Error: project.faf not found
243
+
244
+ Run 'faf init' to create one.`),process.exit(2);let X=m(Z),z=X.faf_version??"unknown";if(z===g6){console.log(`${w("◆")} migrate already at v${g6}`);return}if(X.faf_version=g6,!X.project)X.project={};if(!X.stack)X.stack={};if(!X.human_context)X.human_context={};if(!X.monorepo)X.monorepo={};if($.dryRun){console.log(`${w("◆")} migrate ${I("(dry run)")} v${z} → v${g6}`),console.log(I(` would update ${Z}`));return}p(Z,X),console.log(`${w("◆")} migrate v${z} → v${g6}`),console.log(I(` updated ${Z}`))}function O9($){if($==="features")gK();else if($==="activate")hK();else yK()}function yK(){let $=y$();if(console.log(`${w("pro")} ${I("— FAF Pro status")}
245
+ `),console.log(` Status: ${$?E0(b("PRO")):b("Free")}`),console.log(""),!$)console.log(I(" Upgrade: faf pro activate"))}function gK(){console.log(`${w("pro")} ${I("— Pro features")}
246
+ `);let $=[["tri-sync",".faf ↔ CLAUDE.md ↔ MEMORY.md"],["enterprise slots","33-slot scoring (slots 22-33)"],["advanced analytics","Drift tracking & team metrics"]];for(let[Z,X]of $)console.log(` ${w("◆")} ${b(Z)} ${I("—")} ${X}`);console.log("")}function hK(){console.log(`${w("pro")} ${I("— activate")}
247
+ `),console.log(" Set FAF_PRO=1 in your environment to enable Pro features."),console.log(""),console.log(I(" export FAF_PRO=1")),console.log("");try{M9()("https://faf.one/pro")}catch{console.log(I(" Visit: https://faf.one/pro"))}}import{gzipSync as vK}from"zlib";function w9($={}){let Z=f();if(!Z)console.error(`Error: project.faf not found
248
+
249
+ Run 'faf init' to create one.`),process.exit(2);let X=u(Z),J=vK(Buffer.from(X)).toString("base64url");if($.raw){console.log(J);return}let q=`https://faf.one/share?d=${J}`;if(console.log(`${w("◆")} share ${I(Z)}
250
+ `),console.log(` ${q}`),$.copy)try{let{execSync:Q}=z0("child_process"),Y=process.platform;if(Y==="darwin")Q("pbcopy",{input:q});else if(Y==="linux")Q("xclip -selection clipboard",{input:q});console.log(I(`
251
+ copied to clipboard`))}catch{console.log(I(`
252
+ copy failed — install xclip or pbcopy`))}}import{mkdirSync as uK,writeFileSync as mK,rmSync as dK}from"fs";import{tmpdir as cK}from"os";import{join as F9}from"path";function R9(){let $=F9(cK(),`faf-demo-${Date.now()}`);uK($,{recursive:!0}),console.log(`${w("demo")} ${I("— FAF in action")}
253
+ `);let Z=`faf_version: 2.5.0
254
+ project:
255
+ name: acme-app
256
+ goal: Full-stack web application for team collaboration
257
+ main_language: TypeScript
258
+ stack:
259
+ frontend: React
260
+ css_framework: Tailwind CSS
261
+ ui_library: shadcn/ui
262
+ state_management: Zustand
263
+ backend: Express
264
+ api_type: REST
265
+ runtime: Node.js
266
+ database: PostgreSQL
267
+ connection: Prisma
268
+ hosting: Vercel
269
+ build: Vite
270
+ cicd: GitHub Actions
271
+ human_context:
272
+ who: Startup engineering team
273
+ what: Real-time collaboration platform
274
+ why: Replace fragmented team tools
275
+ where: Cloud (Vercel + AWS)
276
+ when: "2026"
277
+ how: Agile sprints with CI/CD
278
+ `,X=F9($,"project.faf");mK(X,Z),console.log(` ${b("1.")} Created sample project.faf`),console.log(I(` ${X}
279
+ `)),console.log(` ${b("2.")} Scoring...`);let z=s(n(u(X)));console.log(""),a(z,"project.faf",!0),dK($,{recursive:!0,force:!0}),console.log(`
280
+ ${I(' Demo complete. Run "faf init" in your project to get started.')}`)}function A9($,Z={}){if(!$)console.error("Usage: faf search <keyword>"),process.exit(2);let X=$.toLowerCase(),z=!Z.slots&&!Z.formats,J=0;if(z||Z.slots){let q=Q0.filter((Q)=>Q.path.toLowerCase().includes(X)||Q.description.toLowerCase().includes(X)||Q.category.toLowerCase().includes(X));if(q.length>0){console.log(`${w("slots")} ${I(`— ${q.length} match${q.length===1?"":"es"}`)}
281
+ `);for(let Q of q)console.log(` ${b(`#${Q.index}`)} ${Q.path} ${I("—")} ${Q.description} ${I(`[${Q.category}]`)}`);console.log(""),J+=q.length}}if(z||Z.formats){let q=f6.filter((Q)=>Q.name.toLowerCase().includes(X)||Q.extensions.some((Y)=>Y.toLowerCase().includes(X))||Q.category.toLowerCase().includes(X));if(q.length>0){console.log(`${w("formats")} ${I(`— ${q.length} match${q.length===1?"":"es"}`)}
282
+ `);for(let Q of q)console.log(` ${b(Q.name)} ${I(Q.extensions.join(", "))} ${I(`[${Q.category}]`)}`);console.log(""),J+=q.length}}if(J===0)console.log(I(` No results for "${$}"`))}import{writeFileSync as pK}from"fs";function P9($={}){let Z=f();if(!Z)console.error(`Error: project.faf not found
283
+
284
+ Run 'faf init' to create one.`),process.exit(2);let X=m(Z),z=u(Z),J=s(n(z)),q={taf_version:"1.0.0",generated:new Date().toISOString(),source:Z,project:X.project?.name??"unknown",faf_version:X.faf_version??"unknown",score:J.score,tier:J.tier.name,populated:J.populated,active:J.active,total:J.total,slots:J.slots},Q=JSON.stringify(q,null,2);if($.output)pK($.output,Q,"utf-8"),console.log(`${w("◆")} taf receipt written to ${$.output}`);else console.log(Q)}import{createInterface as lK}from"readline";import{existsSync as S9,readFileSync as iK,writeFileSync as nK,unlinkSync as sK}from"fs";import{join as rK}from"path";var aK=".faf-session.json";function oK($,Z){let X=Z.split("."),z=$;for(let J of X){if(z===null||z===void 0||typeof z!=="object")return;z=z[J]}return z}function tK($,Z,X){let z=Z.split("."),J=$;for(let q=0;q<z.length-1;q++){if(!J[z[q]]||typeof J[z[q]]!=="object")J[z[q]]={};J=J[z[q]]}J[z[z.length-1]]=X}async function _9($={}){let Z=f();if(!Z)console.error(`Error: project.faf not found
285
+
286
+ Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),z=rK(X,aK),J=0;if($.resume&&S9(z))try{J=JSON.parse(iK(z,"utf-8")).slotIndex,console.log(I(` resuming from slot #${J+1}`))}catch{}let q=m(Z),Q=Q0.filter((V)=>{let D=oK(q,V.path);return x$(D)&&D!=="slotignored"});if(Q.length===0){console.log(`${w("◆")} go all slots populated`);let V=s(n(u(Z)));a(V,Z);return}console.log(`${w("go")} ${I("— guided interview")}`),console.log(I(` ${Q.length} empty slots. Enter a value, "skip" to skip, or "quit" to stop.
287
+ `));let Y=lK({input:process.stdin,output:process.stdout}),G=(V)=>new Promise((D)=>Y.question(V,D)),U=0,W=Q.slice(J);for(let V=0;V<W.length;V++){let D=W[V],M=await G(` ${b(`#${D.index}`)} ${D.description} ${I(`(${D.path})`)}: `);if(M.toLowerCase()==="quit"){let B={slotIndex:J+V,fafPath:Z};nK(z,JSON.stringify(B),"utf-8"),console.log(I(`
288
+ session saved. Resume with: faf go --resume`));break}if(M.toLowerCase()==="skip"||M.trim()==="")continue;tK(q,D.path,M.trim()),U++}if(Y.close(),U>0)p(Z,q),console.log(`
289
+ ${w("◆")} go filled ${U} slot${U===1?"":"s"}`);let H=s(n(u(Z)));if(a(H,Z),S9(z))try{sK(z)}catch{}}function gB($,Z){let X=Z.split("."),z=$;for(let J of X){if(z===null||z===void 0||typeof z!=="object")return;z=z[J]}return z}function hB($,Z,X){let z=Z.split("."),J=$;for(let q=0;q<z.length-1;q++){if(!J[z[q]]||typeof J[z[q]]!=="object")J[z[q]]={};J=J[z[q]]}J[z[z.length-1]]=X}async function SJ($){if($==="analyze")await uB();else if($==="enhance")await vB();else console.log(`${w("ai")} ${I("— AI-powered features")}
290
+ `),console.log(` ${b("faf ai enhance")} ${I("— fill empty slots via Claude")}`),console.log(` ${b("faf ai analyze")} ${I("— get improvement suggestions")}`),console.log(""),console.log(I(" Requires ANTHROPIC_API_KEY environment variable."))}async function _J(){let $=process.env.ANTHROPIC_API_KEY;if(!$)console.error(`Error: ANTHROPIC_API_KEY not set.
291
+
292
+ export ANTHROPIC_API_KEY=sk-...`),process.exit(2);try{let{default:Z}=await Promise.resolve().then(() => (PJ(),AJ));return new Z({apiKey:$})}catch{console.error(`Error: @anthropic-ai/sdk not installed.
293
+
294
+ npm install @anthropic-ai/sdk`),process.exit(2)}}async function vB(){let $=f();if(!$)console.error(`Error: project.faf not found
295
+
296
+ Run 'faf init' to create one.`),process.exit(2);let Z=m($),X=u($),z=Q0.filter((G)=>{let U=gB(Z,G.path);return x$(U)&&U!=="slotignored"});if(z.length===0){console.log(`${w("◆")} ai enhance all slots populated`);return}console.log(`${w("ai")} enhance ${I(`filling ${z.length} empty slots...`)}`);let J=await _J(),q=z.map((G)=>`- ${G.path}: ${G.description}`).join(`
297
+ `),Q=`Given this project .faf file:
152
298
 
153
- ${championship_style_1.FAF_COLORS.fafCyan('🚀 Quick Start - Get Perfect AI Context:')}
299
+ ${X}
300
+
301
+ Fill in these empty slots with reasonable values based on the project context. Return ONLY a JSON object mapping dot-paths to values.
154
302
 
155
- ${colors_1.chalk.green(colors_1.chalk.bold('FASTEST:'))} ${colors_1.chalk.cyan('faf auto')} ${colors_1.chalk.gray('# ONE COMMAND - Zero to Championship!')}
156
-
157
- ${colors_1.chalk.gray('Or step by step:')}
158
- ${championship_style_1.FAF_COLORS.fafOrange('1.')} ${colors_1.chalk.cyan('faf init')} ${colors_1.chalk.gray('# Get your .faf file')}
159
- ${championship_style_1.FAF_COLORS.fafOrange('2.')} ${colors_1.chalk.cyan('faf score')} ${colors_1.chalk.gray('# Get a high score (70%+)')}
160
- ${championship_style_1.FAF_COLORS.fafOrange('3.')} ${colors_1.chalk.cyan('faf trust')} ${colors_1.chalk.gray('# Build AI trust & confidence')}
161
- ${championship_style_1.FAF_COLORS.fafOrange('4.')} ${colors_1.chalk.cyan('faf bi-sync')} ${colors_1.chalk.gray('# Set & forget - persistent context-mirroring')}
162
-
163
- ${championship_style_1.FAF_COLORS.fafCyan('🎯 What is .faf?')}
164
- .faf = Foundational AI-context Format (Project DNA for AI✨)
165
- Just like JPEG makes images universal, .faf makes projects AI-readable.
166
- bi-sync = persistent context-mirroring through thick and thin
167
- Get high score, build trust, share freely!
168
-
169
- ${championship_style_1.FAF_COLORS.fafOrange('📚 Need more?')} ${colors_1.chalk.cyan('faf index')} ${colors_1.chalk.gray('# Complete A-Z reference guide')}
170
- ${championship_style_1.FAF_COLORS.fafOrange('🎯 VS Coders?')} ${colors_1.chalk.cyan('faf faq')} ${colors_1.chalk.gray('# VS Code extension & Command Palette info!')}
171
- `);
172
- // 🏎️ faf auto - The One Command Championship (PRIORITY #1)
173
- commander_1.program
174
- .command('auto [directory]')
175
- .description('🏎️ ONE COMMAND TO RULE THEM ALL - Zero to Championship instantly!')
176
- .option('-f, --force', 'Force overwrite existing files')
177
- .option('-a, --ai', 'Include AI enhancement (requires API key)')
178
- .option('--no-show', 'Skip showing scorecard at end')
179
- .addHelpText('after', `
180
- Examples:
181
- $ faf auto # Transform current directory to Championship
182
- $ faf auto ./my-project # Transform specific project
183
- $ faf auto --ai # Include AI enhancements
184
- $ faf auto --force # Overwrite everything, fresh start
185
-
186
- 🏎️ What FAF AUTO Does (in 30 seconds):
187
- 1. Creates perfect .faf file
188
- 2. Syncs all dependencies
189
- 3. Generates CLAUDE.md
190
- 4. Sets up bi-directional sync
191
- 5. Shows your Championship scorecard
192
-
193
- From 0% to 99% in one command. No faffing about!`)
194
- .action(withAnalyticsTracking('auto', auto_1.autoCommand));
195
- // 🎯 faf go - Guided Path to Gold Code (Claude Code friendly!)
196
- commander_1.program
197
- .command('go [directory]')
198
- .description('🎯 Guided interview to Gold Code - Claude asks questions till you hit 100%!')
199
- .option('-q, --quiet', 'Minimal output')
200
- .option('-f, --force', 'Force even if already at 100%')
201
- .addHelpText('after', `
202
- Examples:
203
- $ faf go # Start guided interview in current directory
204
- $ faf go ./my-project # Start interview for specific project
205
-
206
- 🎯 How FAF GO Works:
207
- - In Terminal: Interactive prompts (inquirer)
208
- - In Claude Code: Returns structured questions for AskUserQuestion
209
- - Prioritizes most impactful questions first
210
- - Saves answers to .faf automatically
211
- - Run again to continue where you left off
212
-
213
- Just type 'faf go' and answer questions till you're done. 100% target!`)
214
- .action(withAnalyticsTracking('go', go_1.goCommand));
215
- // 🚀 faf yolo - Claude Power User Mode
216
- commander_1.program
217
- .command('yolo [directory]')
218
- .description('🚀 Claude Power User Mode - Maximum extraction, no prompts, speed run!')
219
- .option('-v, --verbose', 'Show verbose output')
220
- .addHelpText('after', `
221
- Examples:
222
- $ faf yolo # YOLO the current directory
223
- $ faf yolo ./my-project # YOLO a specific project
224
- $ faf yolo -v # Verbose output
225
-
226
- 🏎️ What FAF YOLO Does:
227
- - Force creates fresh .faf (no prompts!)
228
- - TURBO-CAT format discovery
229
- - Aggressive human context extraction (accepts INFERRED!)
230
- - Bi-syncs CLAUDE.md
231
- - Speed optimized output
232
-
233
- For Claude power users who know what they want!`)
234
- .action(withAnalyticsTracking('yolo', yolo_1.yoloCommand));
235
- // Add all the command definitions back
236
- commander_1.program
237
- .command('init [directory]')
238
- .description('Create .faf file from your project (detects React, Python, Node.js, etc.)')
239
- .option('-f, --force', 'Overwrite existing .faf file')
240
- .option('-n, --new', 'Create a fresh .faf file (friendlier than --force)')
241
- .option('-c, --choose', 'Interactive choice when .faf exists')
242
- .option('-t, --template <type>', 'Use specific template (svelte, react, vue, node)', 'auto')
243
- .option('-o, --output <file>', 'Output file path')
244
- .option('--xai', 'Generate xAI/Grok-optimized .faf with voice config')
245
- .option('--gemini', 'Configure Gemini CLI integration (auto-detects if installed)')
246
- .option('--taf', 'Create .taf file (Testing Activity Feed) instead of .faf')
247
- .addHelpText('after', `
248
- Examples:
249
- $ faf init # Detect project type automatically
250
- $ faf init --new # Create a fresh .faf file
251
- $ faf init --xai # xAI/Grok-optimized with voice config
252
- $ faf init --gemini # Gemini CLI native handshake
253
- $ faf init --taf # Create .taf (Testing Activity Feed)
254
- $ faf init --choose # Interactive choice when .faf exists
255
- $ faf init my-app # Create .faf for different directory
256
- $ faf init -t react # Force React template`)
257
- .action(withAnalyticsTracking('init', (directory, options) => (0, init_1.initFafFile)(directory, options)));
258
- // 🇬🇧 faf innit - British slang fun version of init
259
- commander_1.program
260
- .command('innit [directory]')
261
- .description('🇬🇧 British version of init - same championship, more bruv!')
262
- .option('-f, --force', 'Overwrite existing .faf file')
263
- .option('-n, --new', 'Create a fresh .faf file')
264
- .option('-c, --choose', 'Interactive choice when .faf exists')
265
- .option('-t, --template <type>', 'Use specific template', 'auto')
266
- .option('-o, --output <file>', 'Output file path')
267
- .addHelpText('after', `
268
- Examples:
269
- $ faf innit # Init bruv!
270
- $ faf innit --new # Fresh start innit
271
- $ faf innit my-app # Create .faf for different directory
272
-
273
- 🇬🇧 Same as 'faf init', just more British! Proper cheeky!`)
274
- .action(withAnalyticsTracking('innit', (directory, options) => {
275
- console.log(championship_style_1.FAF_COLORS.fafOrange('🇬🇧 doing it now Bruv'));
276
- console.log('');
277
- return (0, init_1.initFafFile)(directory, options);
278
- }));
279
- // 📖 faf readme - Extract 6 Ws from README intelligently
280
- commander_1.program
281
- .command('readme [directory]')
282
- .description('📋 6Ws README Builder - Interactive questionnaire with smart defaults')
283
- .option('-q, --quiet', 'Minimal output')
284
- .option('-o, --output <file>', 'Output file for README section (default: README-6ws.md)')
285
- .addHelpText('after', `
286
- Examples:
287
- $ faf readme # Interactive 6Ws (auto-extracts from README)
288
- $ faf readme ./my-project # Run in different directory
289
- $ faf readme --output CONTEXT.md # Save to custom file
290
-
291
- 📋 What faf readme does (v4.4.0):
292
- 1. Auto-extracts 6 Ws from README.md (if exists)
293
- 2. Interactive questionnaire with smart defaults
294
- 3. Updates project.faf (context_score: 100%)
295
- 4. Generates README section (copy/paste ready)
296
-
297
- The 6 Ws (1W-6W notation):
298
- - 1W (WHO): Who is this for?
299
- - 2W (WHAT): What does it do?
300
- - 3W (WHY): Why does it exist?
301
- - 4W (WHERE): Where does it run?
302
- - 5W (WHEN): When to use it?
303
- - 6W (HOW): How to get started?
304
-
305
- 💡 User-provided answers = 100% context quality!
306
-
307
- Replaces: 'faf human' (deprecated)`)
308
- .action(withAnalyticsTracking('readme', (directory, options) => (0, readme_1.readmeCommand)(directory, options)));
309
- // ✨ faf 6ws - Web-based 6Ws Builder
310
- commander_1.program
311
- .command('6ws')
312
- .description('✨ Open web interface for 6Ws - paste back to CLI')
313
- .addHelpText('after', `
314
- Examples:
315
- $ faf 6ws # Open browser, paste results back
316
-
317
- ✨ Interactive paste-back workflow:
318
- 1. Opens faf.one/6ws in your browser
319
- 2. Fill out 6 questions (nice web UI)
320
- 3. Copy the generated human_context YAML
321
- 4. Paste back into CLI
322
- 5. CLI validates and writes to project.faf
323
-
324
- 💡 Best of both worlds: Web UX + CLI automation!`)
325
- .action(withAnalyticsTracking('6ws', sixws_1.sixwsCommand));
326
- // 🧡 faf human - Interactive Human Context Collection
327
- commander_1.program
328
- .command('human [directory]')
329
- .description('🧡 Fill human_context interactively - one question at a time')
330
- .option('-a, --all', 'Ask all questions (even if already filled)')
331
- .addHelpText('after', `
332
- Examples:
333
- $ faf human # Fill empty human_context fields (interactive)
334
- $ faf human --all # Re-answer all 6 Ws (interactive)
335
- $ faf human set why "Speed" # Set single field (non-interactive)
336
-
337
- 🧡 The 6 Ws - Human Context:
338
- - WHO is this for?
339
- - WHAT does it do?
340
- - WHY does it exist?
341
- - WHERE does it run?
342
- - WHEN was it made?
343
- - HOW do you use it?
344
-
345
- Interactive mode: Press Enter to skip any question.
346
- Non-interactive: Use 'faf human set <field> "<value>"'`)
347
- .action(withAnalyticsTracking('human', (directory, options) => (0, human_1.humanCommand)(directory, options)));
348
- // 🧡 faf human set - Set single human_context field (non-interactive)
349
- commander_1.program
350
- .command('human-set <field> <value> [directory]')
351
- .description('🧡 Set a single human_context field (non-interactive)')
352
- .addHelpText('after', `
353
- Examples:
354
- $ faf human-set who "xAI developers"
355
- $ faf human-set what "6.4KB WASM scorer"
356
- $ faf human-set why "32x faster than Rust"
357
- $ faf human-set where "Browser, Edge, WASM"
358
- $ faf human-set when "Thanksgiving 2025"
359
- $ faf human-set how "zig build"
360
-
361
- Valid fields: who, what, why, where, when, how`)
362
- .action(withAnalyticsTracking('human-set', (field, value, directory) => (0, human_1.humanSetCommand)(field, value, directory)));
363
- // 🔄 faf migrate - Migrate .faf to project.faf (v1.2.0)
364
- commander_1.program
365
- .command('migrate [directory]')
366
- .description('Migrate .faf (legacy) to project.faf (v1.2.0 standard)')
367
- .option('-f, --force', 'Overwrite existing project.faf file')
368
- .option('--dry-run', 'Preview migration without making changes')
369
- .addHelpText('after', `
370
- Examples:
371
- $ faf migrate # Migrate .faf to project.faf
372
- $ faf migrate --dry-run # Preview migration
373
- $ faf migrate --force # Overwrite existing project.faf
374
-
375
- v1.2.0: project.faf is the new standard (visible, like package.json)`)
376
- .action(withAnalyticsTracking('migrate', (directory, options) => (0, migrate_1.migrateCommand)(directory, options)));
377
- // 🔄 faf rename - Bulk migration across multiple projects
378
- commander_1.program
379
- .command('rename [path]')
380
- .description('Bulk migrate all .faf files to project.faf recursively')
381
- .option('-f, --force', 'Overwrite existing project.faf files')
382
- .option('--dry-run', 'Preview migration without making changes')
383
- .option('--no-confirm', 'Skip confirmation for large migrations')
384
- .option('--max-depth <number>', 'Maximum directory depth to search', '10')
385
- .addHelpText('after', `
386
- Examples:
387
- $ faf rename ~/Projects # Migrate all repos in ~/Projects
388
- $ faf rename . --dry-run # Preview what would be migrated
389
- $ faf rename ~/code --force # Overwrite existing project.faf files
390
- $ faf rename --no-confirm # Skip confirmation prompt
391
-
392
- Power user tool: Migrate your entire system in one command!
393
- Searches recursively and renames all .faf → project.faf`)
394
- .action(withAnalyticsTracking('rename', (searchPath, options) => (0, rename_1.renameCommand)(searchPath, options)));
395
- // 🧬 faf dna - Show your journey at a glance
396
- commander_1.program
397
- .command('dna')
398
- .description('🧬 Show your FAF DNA journey (22% → 85% → 99% ← 92%)')
399
- .addHelpText('after', `
400
- Examples:
401
- $ faf dna # See your journey at a glance
402
-
403
- 🧬 Shows instantly:
404
- • Your complete journey line
405
- • Quick stats and growth
406
- • Achievements unlocked
407
- • Links to detailed info`)
408
- .action(withAnalyticsTracking('dna', () => {
409
- const dnaCommand = require('./commands/faf-dna');
410
- return dnaCommand.default?.();
411
- }));
412
- // 🔐 faf auth - Authenticate your FAF DNA
413
- commander_1.program
414
- .command('auth')
415
- .description('🔐 Authenticate your FAF project with a birth certificate')
416
- .option('--verify <certificate>', 'Verify an existing certificate')
417
- .option('--show', 'Show current authentication status')
418
- .addHelpText('after', `
419
- Examples:
420
- $ faf auth # Authenticate your project
421
- $ faf auth --show # Show authentication status
422
- $ faf auth --verify FAF-2025-PROJECT-XXXX # Verify certificate
423
-
424
- 🔐 Birth Certificate:
425
- • Proves origin of your context
426
- • Tracks evolution from birth weight
427
- • Enables Context-Mirroring recovery`)
428
- .action(withAnalyticsTracking('auth', () => {
429
- const authCommand = require('./commands/faf-auth');
430
- return authCommand.default?.();
431
- }));
432
- // 📜 faf log - View context evolution history
433
- commander_1.program
434
- .command('log')
435
- .description('📜 View complete evolution history of your FAF context')
436
- .option('--milestones', 'Show milestones only')
437
- .option('--analytics', 'Show growth analytics')
438
- .option('--json', 'Output as JSON')
439
- .addHelpText('after', `
440
- Examples:
441
- $ faf log # Full evolution history
442
- $ faf log --milestones # Key milestones only
443
- $ faf log --analytics # Growth analytics
444
- $ faf log --json # Export as JSON
445
-
446
- 📜 Shows Your Journey:
447
- • Birth weight (from CLAUDE.md)
448
- • Every version and growth
449
- • Milestones achieved
450
- • Current position vs peak`)
451
- .action(withAnalyticsTracking('log', () => {
452
- const logCommand = require('./commands/faf-log');
453
- return logCommand.default?.();
454
- }));
455
- // 💾 faf update - Save your current version
456
- commander_1.program
457
- .command('update')
458
- .description('💾 Save your current FAF version (checkpoint your progress)')
459
- .addHelpText('after', `
460
- Examples:
461
- $ faf update # Save current version
462
-
463
- 💾 Simple checkpoint:
464
- • Marks current state as good
465
- • Creates reference point
466
- • Track future changes from here`)
467
- .action(withAnalyticsTracking('update', () => {
468
- const updateCommand = require('./commands/faf-update');
469
- return updateCommand.default?.();
470
- }));
471
- // 🚨 faf recover - Disaster Recovery
472
- commander_1.program
473
- .command('recover')
474
- .description('🚨 Disaster recovery for corrupted or missing FAF files')
475
- .option('--auto', 'Attempt automatic recovery')
476
- .option('--backup', 'List available backups')
477
- .option('--check', 'Check health without recovery')
478
- .option('--force', 'Force recovery even if risky')
479
- .addHelpText('after', `
480
- Examples:
481
- $ faf recover # Interactive recovery
482
- $ faf recover --auto # Try automatic fix
483
- $ faf recover --backup # List backups
484
- $ faf recover --check # Health check only
485
-
486
- 🚨 Emergency Commands:
487
- • faf recover --auto: Try automatic recovery
488
- • git checkout HEAD -- .faf: Restore from git
489
- • faf init --force: Start fresh (loses history)`)
490
- .action(withAnalyticsTracking('recover', (options) => {
491
- const { spawn } = require('child_process');
492
- const recoverPath = require('path').join(__dirname, 'commands', 'faf-recover.js');
493
- const args = [recoverPath];
494
- if (options.auto) {
495
- args.push('--auto');
496
- }
497
- if (options.backup) {
498
- args.push('--backup');
499
- }
500
- if (options.check) {
501
- args.push('--check');
502
- }
503
- if (options.force) {
504
- args.push('--force');
505
- }
506
- const child = spawn('node', args, { stdio: 'inherit' });
507
- child.on('exit', (code) => {
508
- process.exit(code || 0);
509
- });
510
- }));
511
- // 😽 faf formats - TURBO-CAT Format Discovery
512
- commander_1.program
513
- .command('formats [directory]')
514
- .description('😽 TURBO-CAT™ discovers all formats in your project (154 validated types!)')
515
- .option('-e, --export', 'Export as JSON')
516
- .option('-c, --category', 'Show by category')
517
- .addHelpText('after', `
518
- Examples:
519
- $ faf formats # List all discovered formats
520
- $ faf formats --category # Show by category
521
- $ faf formats --export # Export as JSON`)
522
- .action(withAnalyticsTracking('formats', (directory, options) => (0, formats_1.formatsCommand)(directory, options)));
523
- // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
524
- // FAFb BINARY FORMAT COMMANDS — WASM kernel (no external binary needed)
525
- commander_1.program
526
- .command('compile [input]')
527
- .description('Compile .faf to .fafb binary format')
528
- .option('-o, --output <file>', 'Output .fafb file path')
529
- .option('-w, --watch', 'Watch and auto-recompile on changes')
530
- .option('-b, --benchmark', 'Compare .faf vs .fafb parse speeds')
531
- .option('-v, --verbose', 'Verbose output')
532
- .action(withAnalyticsTracking('compile', (input, options) => (0, compile_1.compileCommand)(input, options)));
533
- commander_1.program
534
- .command('decompile [input]')
535
- .description('Decompile .fafb binary to JSON')
536
- .option('-o, --output <file>', 'Output file path')
537
- .action(withAnalyticsTracking('decompile', (input, options) => (0, decompile_1.decompileCommand)(input, options)));
538
- // 🏆 faf version - Show version with MK3 status
539
- commander_1.program
540
- .command('version')
541
- .description('🏆 Show FAF version with MK3 Engine and TURBO-CAT status')
542
- .action(withAnalyticsTracking('version', () => (0, version_1.versionCommand)()));
543
- // 🧡 faf trust - Consolidated Trust Dashboard (The Emotional Core)
544
- commander_1.program
545
- .command('trust')
546
- .description('🧡 Unified trust dashboard - confidence, garage, panic, quality modes')
547
- .option('-d, --detailed', 'Show detailed trust metrics')
548
- .option('--confidence', 'Show AI confidence analysis')
549
- .option('--garage', 'Safe experimentation mode with backup')
550
- .option('--panic', 'Emergency context repair mode')
551
- .option('--quality', 'Quality checks and validation mode')
552
- .addHelpText('after', `
553
- Examples:
554
- $ faf trust # Main trust dashboard
555
- $ faf trust --detailed # Detailed metrics breakdown
556
- $ faf trust --confidence # AI confidence analysis
557
- $ faf trust --garage # Safe experiment mode
558
- $ faf trust --panic # Emergency repair
559
- $ faf trust --quality # Quality validation check
560
-
561
- Trust Modes:
562
- • Confidence: AI confidence levels and boosting tips
563
- • Garage: Safe experimentation with automatic backup
564
- • Panic: Emergency repair and restoration
565
- • Quality: Championship quality checks and validation`)
566
- .action(withAnalyticsTracking('trust', (options) => (0, trust_1.trustCommand)(options)));
567
- // ⚡️ faf vibe - No-Code/Low-Code Builder Edition
568
- commander_1.program
569
- .command('vibe')
570
- .description('⚡️ FAF VIBE - Detect your development platform')
571
- .option('-p, --preview', 'Preview TURBO-CAT discovery')
572
- .addHelpText('after', `
573
- Examples:
574
- $ faf vibe # Check platform type
575
- $ faf vibe --preview # Include TURBO-CAT preview
576
-
577
- ⚡️ FAF VIBE Features:
578
- • Auto-detects no-code platforms (Replit, Lovable, Wix, etc.)
579
- • FREE CLI tool for all platforms
580
- • TURBO-CAT format discovery
581
- • Lightning not rainbows!`)
582
- .action(withAnalyticsTracking('vibe', (options) => {
583
- const { vibeCommand } = require('./commands/vibe');
584
- return vibeCommand(options);
585
- }));
586
- // 🚀 faf status - Quick context health check (git status equivalent)
587
- commander_1.program
588
- .command('status')
589
- .description('Show quick .faf context health status (<200ms)')
590
- .option('--oneline', 'Single line output for npm hooks (predev, prebuild)')
591
- .addHelpText('after', `
592
- Examples:
593
- $ faf status # Quick health check
594
- $ faf status --oneline # Single line for hooks
595
-
596
- Shows:
597
- • Context health score (0-100%)
598
- • Files tracked and last sync time
599
- • AI readiness status
600
- • Performance metrics
601
- • Bi-sync (claude.md) status
602
-
603
- Hook usage (package.json):
604
- "predev": "faf status --oneline"`)
605
- .action(withAnalyticsTracking('status', (options) => (0, status_1.statusCommand)(options)));
606
- // 💎 faf credit - Technical Credit Dashboard (Revolutionary Psychology)
607
- commander_1.program
608
- .command('credit')
609
- .description('💎 Technical Credit Dashboard - See your accumulated development credits')
610
- .option('-d, --detailed', 'Show detailed credit breakdown by category')
611
- .option('-h, --history', 'Show credit earning history')
612
- .option('-c, --clear', 'Clear credit history (confirmation required)')
613
- .addHelpText('after', `
614
- Examples:
615
- $ faf credit # Show credit dashboard
616
- $ faf credit --detailed # Detailed breakdown by category
617
- $ faf credit --history # See credit earning timeline
618
-
619
- 💎 Technical Credit System:
620
- • Earn credit for every improvement (vs. technical debt)
621
- • Transform developer psychology from anxiety to confidence
622
- • Track AI happiness improvements and context quality
623
- • Build trust through measurable technical achievements
624
- • Championship levels: Beginner → Professional → Championship
625
-
626
- Expected Impact:
627
- 😰 "I hope this works" → 😎 "I trust my context"`)
628
- .action((options) => (0, credit_1.creditCommand)(options));
629
- // 📝 faf todo - Claude-Inspired Todo System (The Gamifier)
630
- commander_1.program
631
- .command('todo')
632
- .description('📝 Claude-inspired todo system - gamify your context improvements')
633
- .option('-s, --show', 'Show current todo list')
634
- .option('-c, --complete <task>', 'Mark task as completed (by number or keyword)')
635
- .option('-r, --reset', 'Reset current todo list')
636
- .addHelpText('after', `
637
- Examples:
638
- $ faf todo # Generate new improvement plan
639
- $ faf todo --show # View current todo list
640
- $ faf todo --complete 1 # Complete task #1
641
- $ faf todo --complete readme # Complete README task
642
- $ faf todo --reset # Start fresh
643
-
644
- Philosophy:
645
- • Transform low scores into exciting improvement games
646
- • Claude-inspired task prioritization and celebrations
647
- • Gamified progress tracking with championship rewards
648
- • Turn "I need better context" → "I'm completing achievements!"
649
-
650
- Expected Impact:
651
- 📉 47% score → 📈 85% score through guided achievements`)
652
- .action((options) => (0, todo_1.todoCommand)(options));
653
- // 🏆 faf fam - FAF Family Integration Marketplace
654
- commander_1.program
655
- .command('fam [subcommand] [arg]')
656
- .description('🏆 FAF Family - Championship integration marketplace')
657
- .option('-d, --detected', 'Show only detected integrations')
658
- .option('-a, --available', 'Show only available integrations')
659
- .addHelpText('after', `
660
- Examples:
661
- $ faf fam # Show all integrations + status
662
- $ faf fam show react # Details about React integration
663
- $ faf fam install n8n # Install integration (TURBO required)
664
-
665
- 🏆 FAF Family:
666
- • Discover 6 championship integrations (React, Next.js, Svelte, TypeScript, Vite, n8n)
667
- • See what's detected in YOUR project
668
- • Get MCP server recommendations
669
- • 74.8M+ developer ecosystem reach
670
-
671
- Integrations:
672
- • Auto-detect modern stacks in your project
673
- • Smart .faf context generation
674
- • MCP server recommendations per stack
675
- • Quality-gated: 85% minimum (Bronze tier)`)
676
- .action(withAnalyticsTracking('fam', (subcommand, arg, options) => (0, fam_1.famCommand)(subcommand, arg, options)));
677
- // 🚀 faf git - GitHub Repository Context Extractor
678
- commander_1.program
679
- .command('git [query]')
680
- .description('🚀 Generate AI context for ANY GitHub repo without cloning')
681
- .option('-o, --output <path>', 'Output path for .faf file')
682
- .option('--list', 'Show popular repositories')
683
- .option('--category <category>', 'Filter popular repos by category')
684
- .option('--scan', 'Metadata only (skip file tree)')
685
- .option('--clone', 'Clone repo after generating .faf')
686
- .addHelpText('after', `
687
- Examples:
688
- $ faf git react # Shorthand: facebook/react
689
- $ faf git svelte # Auto-resolve: sveltejs/svelte
690
- $ faf git facebook/react # owner/repo format
691
- $ faf git https://github.com/... # Full URL
692
- $ faf git --list # Show popular repos
693
- $ faf git --list --category auth # Show auth libraries
694
-
695
- # Batch processing (comparison mode)
696
- $ faf git react vue svelte # Compare multiple repos
697
-
698
- 🚀 Use Cases:
699
- • Get AI context for libraries you DON'T own
700
- • Compare repos before choosing one
701
- • Understand architecture before cloning
702
- • Ask AI about ANY repo instantly
703
-
704
- Features:
705
- • ⚡ <200ms extraction (no clone needed)
706
- • 🔍 Fuzzy matching for typos (svelt → svelte)
707
- • 📊 Rich metadata (stars, topics, languages)
708
- • 🏆 Quality scoring (0-100%)
709
- • 🎯 Smart shorthand (react → facebook/react)`)
710
- .action(withAnalyticsTracking('git', (query, options) => (0, git_1.gitCommand)(query, options)));
711
- // 📊 faf taf - Testing Activity Feed
712
- commander_1.program
713
- .command('taf')
714
- .description('📊 Testing Activity Feed - Git-friendly testing timeline')
715
- .addHelpText('after', `
716
- Subcommands:
717
- init Initialize .taf file
718
- log Log a test run
719
- validate Validate .taf format
720
- stats Show test statistics
721
-
722
- Examples:
723
- $ faf taf init # Create .taf file
724
- $ faf taf log --total 173 --passed 173 --failed 0
725
- $ faf taf validate # Check format
726
- $ faf taf stats # View statistics
727
-
728
- Features:
729
- • 📝 Git-friendly YAML format (append-only)
730
- • 🔗 Native Reference with .faf
731
- • 🏆 Podium scoring (🏆 🥇 🥈 🥉)
732
- • 📊 Pass rate tracking and trends
733
- • ⚡ Lightweight (5-60 lines per run)`)
734
- .action(withAnalyticsTracking('taf', () => {
735
- // Get raw arguments after 'taf' command
736
- const tafIndex = process.argv.indexOf('taf');
737
- const args = tafIndex >= 0 ? process.argv.slice(tafIndex + 1) : [];
738
- return (0, taf_1.tafCommand)(args);
739
- }));
740
- // 🔄 faf conductor - Google Conductor Interop
741
- commander_1.program
742
- .command('conductor')
743
- .description('🔄 Google Conductor interop - Import/export between FAF and Conductor')
744
- .addHelpText('after', `
745
- Subcommands:
746
- import Import conductor/ directory to project.faf
747
- export Export project.faf to conductor/ directory
748
- sync Bidirectional sync between formats
749
-
750
- Examples:
751
- $ faf conductor import # Import ./conductor to project.faf
752
- $ faf conductor import --merge # Merge with existing .faf
753
- $ faf conductor export # Export to ./conductor
754
- $ faf conductor sync # Sync (FAF is source of truth)
755
- $ faf conductor sync --source conductor # Sync (Conductor is source)
756
-
757
- About:
758
- FAF supports Google Gemini CLI Conductor extension format.
759
- Position FAF as the universal AI-context interchange format.`)
760
- .action(withAnalyticsTracking('conductor', () => {
761
- const conductorIndex = process.argv.indexOf('conductor');
762
- const args = conductorIndex >= 0 ? process.argv.slice(conductorIndex + 1) : [];
763
- return (0, conductor_1.conductorCommand)(args);
764
- }));
765
- // 🔷 faf gemini - Gemini CLI / Antigravity Interop
766
- commander_1.program
767
- .command('gemini')
768
- .description('🔷 Gemini CLI / Antigravity interop - Import/export GEMINI.md')
769
- .addHelpText('after', `
770
- Subcommands:
771
- import Import GEMINI.md to project.faf
772
- export Export project.faf to GEMINI.md
773
- sync Bidirectional sync between formats
774
-
775
- Examples:
776
- $ faf gemini import # Import ./GEMINI.md
777
- $ faf gemini import --global # Import ~/.gemini/GEMINI.md
778
- $ faf gemini export # Export to ./GEMINI.md
779
- $ faf gemini export --global # Export to ~/.gemini/GEMINI.md
780
- $ faf gemini sync # Sync (FAF is source of truth)
781
-
782
- About:
783
- FAF supports Gemini CLI and Google Antigravity GEMINI.md files.
784
- Position FAF as the universal AI-context interchange format.`)
785
- .action(withAnalyticsTracking('gemini', () => {
786
- const geminiIndex = process.argv.indexOf('gemini');
787
- const args = geminiIndex >= 0 ? process.argv.slice(geminiIndex + 1) : [];
788
- return (0, gemini_1.geminiCommand)(args);
789
- }));
790
- // 📋 faf agents - AGENTS.md Interop
791
- commander_1.program
792
- .command('agents')
793
- .description('📋 AGENTS.md interop - Import/export AGENTS.md')
794
- .addHelpText('after', `
795
- Subcommands:
796
- import Import AGENTS.md to project.faf
797
- export Export project.faf to AGENTS.md
798
- sync Bidirectional sync between formats
799
-
800
- Examples:
801
- $ faf agents import # Import ./AGENTS.md
802
- $ faf agents import --global # Import ~/.codex/AGENTS.md
803
- $ faf agents export # Export to ./AGENTS.md
804
- $ faf agents export --force # Overwrite existing
805
- $ faf agents sync # Sync (FAF is source of truth)
806
-
807
- About:
808
- FAF supports AGENTS.md files used by OpenAI Codex, Linux Foundation,
809
- and 20+ tools. Define once in .faf, generate everywhere.`)
810
- .action(withAnalyticsTracking('agents', () => {
811
- const agentsIndex = process.argv.indexOf('agents');
812
- const args = agentsIndex >= 0 ? process.argv.slice(agentsIndex + 1) : [];
813
- return (0, agents_1.agentsCommand)(args);
814
- }));
815
- // 🖱️ faf cursor - Cursor IDE Interop
816
- commander_1.program
817
- .command('cursor')
818
- .description('🖱️ Cursor IDE interop - Import/export .cursorrules')
819
- .addHelpText('after', `
820
- Subcommands:
821
- import Import .cursorrules to project.faf
822
- export Export project.faf to .cursorrules
823
- sync Bidirectional sync between formats
824
-
825
- Examples:
826
- $ faf cursor import # Import ./.cursorrules
827
- $ faf cursor import --merge # Merge with existing .faf
828
- $ faf cursor export # Export to ./.cursorrules
829
- $ faf cursor export --force # Overwrite existing
830
- $ faf cursor sync # Sync (FAF is source of truth)
831
-
832
- About:
833
- FAF supports Cursor IDE .cursorrules files. Define once in .faf,
834
- generate .cursorrules, AGENTS.md, CLAUDE.md, GEMINI.md, and more.`)
835
- .action(withAnalyticsTracking('cursor', () => {
836
- const cursorIndex = process.argv.indexOf('cursor');
837
- const args = cursorIndex >= 0 ? process.argv.slice(cursorIndex + 1) : [];
838
- return (0, cursor_1.cursorCommand)(args);
839
- }));
840
- // 🧠 faf ram - ROM ↔ RAM (tri-sync)
841
- commander_1.program
842
- .command('ram')
843
- .description('🧠 ROM ↔ RAM — tri-sync .faf ↔ Claude Code MEMORY.md')
844
- .addHelpText('after', `
845
- Subcommands:
846
- export ROM → RAM (seed MEMORY.md from .faf)
847
- import RAM → ROM (harvest Claude's notes into .faf)
848
- sync Bidirectional sync (ROM is source of truth)
849
- status Show RAM path, line count, breakdown
850
-
851
- Examples:
852
- $ faf ram export # Seed RAM from ROM
853
- $ faf ram export --force # Overwrite (don't merge)
854
- $ faf ram import # Harvest Claude's notes into ROM
855
- $ faf ram status # Check RAM path and line count
856
-
857
- About:
858
- .faf is ROM — persistent, structured, portable.
859
- MEMORY.md is RAM — session-loaded, personal, Claude's workspace.
860
- tri-sync bridges ROM ↔ RAM.
861
- RAM lives at ~/.claude/projects/<id>/memory/MEMORY.md
862
- First 200 lines auto-loaded into every Claude Code session.`)
863
- .action(withAnalyticsTracking('ram', () => {
864
- const ramIndex = process.argv.indexOf('ram');
865
- const args = ramIndex >= 0 ? process.argv.slice(ramIndex + 1) : [];
866
- return (0, ram_1.ramCommand)(args);
867
- }));
868
- // 🔑 faf pro - Manage FAF Pro license (tri-sync)
869
- commander_1.program
870
- .command('pro')
871
- .description('🔑 Manage FAF Pro license (tri-sync)')
872
- .addHelpText('after', `
873
- Subcommands:
874
- faf pro Show Pro status
875
- faf pro status Show Pro status (alias)
876
- faf pro activate <key> Activate a license key
877
-
878
- Examples:
879
- $ faf pro # Check your Pro status
880
- $ faf pro activate FAF-PRO-XXXX-XXXX-XXXX # Activate license
881
-
882
- About:
883
- tri-sync Pro gates: faf ram, faf tri-sync, faf bi-sync --ram/--all
884
- 14-day free trial starts on first use. No signup, no credit card.
885
- Purchase at faf.one/pro`)
886
- .action(withAnalyticsTracking('pro', () => {
887
- const proIndex = process.argv.indexOf('pro');
888
- const args = proIndex >= 0 ? process.argv.slice(proIndex + 1) : [];
889
- return (0, pro_1.proCommand)(args);
890
- }));
891
- // 🚀 faf antigravity - Google Antigravity IDE Global Context
892
- commander_1.program
893
- .command('antigravity')
894
- .description('🚀 Antigravity IDE integration - Global AI context for every project')
895
- .addHelpText('after', `
896
- Subcommands:
897
- import Import global ~/.gemini/GEMINI.md to project.faf
898
- export Export project.faf to global ~/.gemini/GEMINI.md
899
- sync Bidirectional sync with global config
900
- status Show current global config status
901
-
902
- Examples:
903
- $ faf antigravity status # Check global config
904
- $ faf antigravity export # Push .faf to global config
905
- $ faf antigravity import # Pull global config to .faf
906
- $ faf antigravity sync # Sync FAF with global config
907
-
908
- About:
909
- Antigravity is Google's AI-powered IDE built on Gemini.
910
- Your coding standards defined once, applied everywhere.
911
- Global config: ~/.gemini/GEMINI.md`)
912
- .action(withAnalyticsTracking('antigravity', () => {
913
- const agIndex = process.argv.indexOf('antigravity');
914
- const agShortIndex = process.argv.indexOf('ag');
915
- const cmdIndex = agIndex >= 0 ? agIndex : agShortIndex;
916
- const args = cmdIndex >= 0 ? process.argv.slice(cmdIndex + 1) : [];
917
- return (0, antigravity_1.antigravityCommand)(args);
918
- }));
919
- // 📚 faf index - Universal A-Z Reference (The Everything Catalog)
920
- commander_1.program
921
- .command('index [term]')
922
- .description('📚 Universal A-Z reference - commands, concepts, features, everything!')
923
- .option('--category <category>', 'Filter by category (core, ai, trust, utilities, etc.)')
924
- .option('--search <query>', 'Search within index entries')
925
- .option('--examples', 'Show usage examples for commands')
926
- .addHelpText('after', `
927
- Examples:
928
- $ faf index # Full A-Z catalog
929
- $ faf index trust # Everything about trust
930
- $ faf index --category ai # All AI-related entries
931
- $ faf index --search "context" # Search for "context"
932
- $ faf index --examples # Show usage examples
933
-
934
- The Everything Catalog:
935
- • ⚡️ Commands: All available commands with usage
936
- • 💡 Concepts: Core FAF concepts (bi-sync, technical-credit, etc.)
937
- • 🧡 Features: Specialized features (garage, panic, quality modes)
938
- • 📂 Categories: core, ai, trust, utilities, improvement, psychology
939
-
940
- Perfect for:
941
- • New users: "What can FAF do?" → faf index
942
- • Power users: "What were trust options?" → faf index trust
943
- • Discovery: "Show me AI features" → faf index --category ai`)
944
- .action((term, options) => (0, index_1.indexCommand)(term, options));
945
- // 🚀 faf share - Universal .faf Distribution System
946
- commander_1.program
947
- .command('share [file]')
948
- .description('🚀 Secure .faf sharing with auto-sanitization')
949
- .option('-p, --private', 'Keep sensitive info (default: sanitize)')
950
- .option('-f, --format <format>', 'Output format: yaml|json|url', 'yaml')
951
- .option('-e, --expires <duration>', 'Expiration: 24h|7d|30d', '7d')
952
- .option('--password <password>', 'Password protect shared .faf')
953
- .option('-d, --description <text>', 'Share description')
954
- .option('-a, --anonymous', 'Remove author information')
955
- .addHelpText('after', `
956
- Examples:
957
- $ faf share # Share with auto-sanitization
958
- $ faf share --private # Share with sensitive info intact
959
- $ faf share --format json # Share as JSON format
960
- $ faf share --expires 24h # Expire in 24 hours
961
- $ faf share --anonymous # Remove author info
962
- $ faf share --password secret123 # Password protect
963
-
964
- Security Features:
965
- • 🔒 Auto-sanitization removes sensitive data by default
966
- • 🎭 Anonymous sharing option removes author info
967
- • ⏰ Configurable expiration (24h, 7d, 30d)
968
- • 🔐 Optional password protection
969
- • 📝 Multiple formats: YAML, JSON, shareable URLs
970
-
971
- Perfect for:
972
- • Team handoffs: Clean context sharing
973
- • Community help: Sanitized project sharing
974
- • Documentation: Shareable project examples`)
975
- .action((file, options) => (0, share_1.shareCommand)(file, options));
976
- // 🏆 GOLDEN RULE: faf convert - YAML to MD/TXT
977
- commander_1.program
978
- .command('convert [file]')
979
- .alias('to-md')
980
- .description('🔄 Convert .faf YAML to Markdown or Text (Golden Rule: We SPEAK YAML)')
981
- .option('-f, --format <type>', 'Output format (md|txt)', 'md')
982
- .option('-o, --output <file>', 'Output file path')
983
- .option('-s, --save', 'Save to file (.faf.md or .faf.txt)')
984
- .addHelpText('after', `
985
- Examples:
986
- $ faf convert # Convert .faf to Markdown (console output)
987
- $ faf convert --save # Save as .faf.md
988
- $ faf to-md # Quick alias for Markdown
989
- $ faf convert -f txt # Convert to plain text
990
- $ faf convert -f txt -s # Save as .faf.txt
991
-
992
- 🏆 GOLDEN RULE: .faf = YAML ONLY
993
- • One source of truth: Pure YAML
994
- • Convert when needed: MD for docs, TXT for sharing
995
- • No parse errors ever again!`)
996
- .action(withAnalyticsTracking('convert', async (file, options) => {
997
- await (0, convert_1.convertCommand)(file, options);
998
- }));
999
- commander_1.program
1000
- .command('to-txt [file]')
1001
- .description('📝 Quick convert .faf YAML to plain text')
1002
- .action(withAnalyticsTracking('to-txt', async (file) => {
1003
- await (0, convert_1.toText)(file);
1004
- }));
1005
- // 👋 faf welcome - First-time user guide
1006
- commander_1.program
1007
- .command('welcome')
1008
- .description('👋 Welcome guide for new users')
1009
- .action(withAnalyticsTracking('welcome', async () => {
1010
- const { welcomeCommand } = await Promise.resolve().then(() => __importStar(require('./commands/welcome')));
1011
- return welcomeCommand();
1012
- }));
1013
- // 🏥 faf doctor - Diagnose issues
1014
- commander_1.program
1015
- .command('doctor')
1016
- .description('🏥 Diagnose and fix common FAF issues')
1017
- .addHelpText('after', `
1018
- Examples:
1019
- $ faf doctor # Run health check
1020
-
1021
- 🏥 Health Checks:
1022
- • .faf file validity
1023
- • Score assessment
1024
- • Project detection
1025
- • Configuration status
1026
- • Provides fixes for any issues found`)
1027
- .action(withAnalyticsTracking('doctor', async () => {
1028
- const { doctorCommand } = await Promise.resolve().then(() => __importStar(require('./commands/doctor')));
1029
- return doctorCommand();
1030
- }));
1031
- // ⚡ faf quick - Lightning-fast one-liner .faf creation
1032
- commander_1.program
1033
- .command('quick [input]')
1034
- .description('⚡ Quick .faf creation - one-liner format for instant context')
1035
- .option('--force', 'Overwrite existing .faf file')
1036
- .addHelpText('after', `
1037
- Examples:
1038
- $ faf quick "my-app, e-commerce platform, typescript, react, vercel"
1039
- $ faf quick "api, REST API for mobile, python, fastapi, aws"
1040
- $ faf quick "cli-tool, dev productivity, go"
1041
-
1042
- ⚡ Lightning Format:
1043
- • Comma-separated: name, description, language, framework, hosting
1044
- • Minimum: just name and description
1045
- • Auto-detects the rest from your project
1046
- • 0 to .faf in under 100ms!`)
1047
- .action(withAnalyticsTracking('quick', async (input, options) => {
1048
- const { quickCommand } = await Promise.resolve().then(() => __importStar(require('./commands/quick')));
1049
- return quickCommand(input, options);
1050
- }));
1051
- // 🗣️ faf chat - Natural Language .faf Generation
1052
- commander_1.program
1053
- .command('chat')
1054
- .description('🗣️ Natural language .faf generation - conversation-driven context building')
1055
- .addHelpText('after', `
1056
- Examples:
1057
- $ faf chat # Start conversational .faf creation
1058
-
1059
- 🗣️ Simple Natural Language Interface:
1060
- • Answer simple questions about your project
1061
- • Choose from numbered options (KISS method)
1062
- • Get perfect .faf file without technical flags
1063
- • Same championship output, accessible input
1064
-
1065
- Perfect for:
1066
- • Non-technical team members
1067
- • Quick project setup
1068
- • Learning FAF concepts through conversation`)
1069
- .action(withAnalyticsTracking('chat', () => (0, chat_1.chatCommand)()));
1070
- // 🤖 faf verify - AI Verification System (The Trust Builder)
1071
- commander_1.program
1072
- .command('verify')
1073
- .description('🤖 Test .faf context with Claude, ChatGPT & Gemini - prove AI understanding')
1074
- .option('-d, --detailed', 'Show detailed verification results')
1075
- .option('-m, --models <models>', 'Specify models to test (comma-separated)', 'claude,chatgpt,gemini')
1076
- .option('-t, --timeout <ms>', 'Verification timeout in milliseconds', '30000')
1077
- .addHelpText('after', `
1078
- Examples:
1079
- $ faf verify # Test with all AI models
1080
- $ faf verify --detailed # Show detailed results & suggestions
1081
- $ faf verify -m claude,chatgpt # Test with specific models only
1082
-
1083
- AI Verification Tests:
1084
- • Claude: Context understanding & confidence
1085
- • ChatGPT: Project comprehension & clarity
1086
- • Gemini: Technical stack recognition
1087
- • Trust Score: Updated based on AI feedback
1088
-
1089
- Expected Transformation:
1090
- 🔴 Needs improvement → ☑️ Perfect context`)
1091
- .action((options) => {
1092
- const models = options.models ? options.models.split(',').map((m) => m.trim()) : undefined;
1093
- (0, verify_1.verifyCommand)({
1094
- models,
1095
- timeout: parseInt(options.timeout),
1096
- detailed: options.detailed
1097
- });
1098
- });
1099
- // 📊 faf stacks - STACKTISTICS: Stack Discovery & Collection
1100
- commander_1.program
1101
- .command('stacks')
1102
- .description('📊 Discover and collect technology stack signatures')
1103
- .option('-s, --scan', 'Scan current project for stack signature')
1104
- .option('-e, --export-gallery', 'Export stacks for Gallery-Svelte')
1105
- .addHelpText('after', `
1106
- 📊 STACKTISTICS Examples:
1107
- $ faf stacks # List your discovered stacks
1108
- $ faf stacks --scan # Discover current project stack
1109
- $ faf stacks --export-gallery # Export for Gallery-Svelte
1110
-
1111
- Stack Discovery:
1112
- • Extends fab-formats intelligence - zero performance impact
1113
- • Simple YAML lookup of known stack patterns
1114
- • Builds collection of your technology experiences`)
1115
- .action(async (options) => {
1116
- if (options.scan) {
1117
- await (0, stacks_1.scanCurrentProject)();
1118
- }
1119
- else if (options['export-gallery']) {
1120
- await (0, stacks_1.exportForGallery)();
1121
- }
1122
- else {
1123
- await (0, stacks_1.listStacks)();
1124
- }
1125
- });
1126
- // 🔍 faf check - Quality inspection & protection system
1127
- commander_1.program
1128
- .command('check')
1129
- .description('🔍 Quality inspection for human_context + field protection')
1130
- .option('--format', 'Check format/validity (old validate)')
1131
- .option('--fresh', 'Check freshness/completeness (old audit)')
1132
- .option('--fix', 'Auto-fix issues where possible')
1133
- .option('-d, --detailed', 'Show detailed check results')
1134
- .option('--protect', 'Auto-protect good/excellent fields from overwrite')
1135
- .option('--unlock', 'Remove all field protections')
1136
- .option('-q, --quiet', 'Minimal output')
1137
- .addHelpText('after', `
1138
- Examples:
1139
- $ faf check # Quality inspection of human_context
1140
- $ faf check --protect # Lock good/excellent fields
1141
- $ faf check --unlock # Remove all protections
1142
- $ faf check --format # Format validation only
1143
- $ faf check --fresh # Freshness audit only
1144
-
1145
- Quality Levels:
1146
- ⬜ empty - Not filled
1147
- 🟡 generic - Placeholder or too short
1148
- 🟢 good - Quality content
1149
- 💎 excellent - High-value content
1150
-
1151
- Protection:
1152
- • Protected fields are skipped by faf readme and faf auto
1153
- • Use --unlock to remove all protections
1154
- • Shows 🔒 next to protected fields`)
1155
- .action((options) => (0, check_1.checkCommand)(options));
1156
- // ✅ faf validate - Check if .faf file is valid
1157
- commander_1.program
1158
- .command('validate [file]')
1159
- .description('Validate .faf file structure and content')
1160
- .option('-v, --verbose', 'Show detailed validation output')
1161
- .option('-s, --schema <path>', 'Custom schema file to validate against')
1162
- .addHelpText('after', `
1163
- Examples:
1164
- $ faf validate # Validate current .faf file
1165
- $ faf validate --verbose # Show detailed validation report`)
1166
- .action(withAnalyticsTracking('validate', validate_1.validateFafFile));
1167
- // 🔍 faf audit - Check freshness and quality
1168
- commander_1.program
1169
- .command('audit [file]')
1170
- .description('Check .faf file freshness and identify improvement areas')
1171
- .option('-w, --warn-days <days>', 'Days before warning about staleness', '7')
1172
- .option('-e, --error-days <days>', 'Days before marking as stale', '30')
1173
- .addHelpText('after', `
1174
- Examples:
1175
- $ faf audit # Check freshness and quality
1176
- $ faf audit --warn-days 3 # Warn if older than 3 days`)
1177
- .action(withAnalyticsTracking('audit', audit_1.auditFafFile));
1178
- // 📈 faf score - See how complete your context is
1179
- commander_1.program
1180
- .command('score [file]')
1181
- .description('Rate your .faf completeness (0-100%). Aim for 🥉85% BRONZE+ for solid AI context you can build on')
1182
- .option('-d, --details', 'Show detailed scoring breakdown')
1183
- .option('-m, --minimum <score>', 'Minimum required score (fails if below)')
1184
- .option('-c, --compiler', 'Use new compiler-based scoring (v3)')
1185
- .option('--trace', 'Show compilation trace (with --compiler)')
1186
- .option('--verify <checksum>', 'Verify checksum (with --compiler)')
1187
- .option('--checksum', 'Show checksum for verification')
1188
- .option('--breakdown', 'Show section breakdown (with --compiler)')
1189
- .addHelpText('after', `
1190
- Examples:
1191
- $ faf score # Quick score check
1192
- $ faf score --details # See what's missing for higher score
1193
- $ faf score --minimum 80 # Fail if score below 80%
1194
- $ faf score --compiler # Use v3 compiler scoring
1195
- $ faf score -c --trace # Show compilation process
1196
- $ faf score -c --checksum # Get verification checksum`)
1197
- .action(withAnalyticsTracking('score', score_1.scoreFafFile));
1198
- // 📝 faf edit - Edit helper
1199
- commander_1.program
1200
- .command('edit [file]')
1201
- .description('Get guidance on editing your .faf file to improve score')
1202
- .option('-o, --open', 'Open in default editor')
1203
- .addHelpText('after', `
1204
- Examples:
1205
- $ faf edit # Show what to edit
1206
- $ faf edit --open # Open in $EDITOR
1207
-
1208
- Helps you understand which fields to fill for a higher score.`)
1209
- .action(withAnalyticsTracking('edit', edit_helper_1.editFafFile));
1210
- // 🏎️ faf show - FAF Stats Display
1211
- commander_1.program
1212
- .command('show [directory]')
1213
- .description('🏎️ Display FAF Stats with clean markdown output')
1214
- .option('-r, --raw', 'Output raw markdown (for piping)')
1215
- .addHelpText('after', `
1216
- Examples:
1217
- $ faf show # Show score card for current directory
1218
- $ faf show ./my-project # Show score card for specific directory
1219
- $ faf show --raw # Output raw markdown for piping
1220
- $ faf show --raw | pbcopy # Copy score card to clipboard
1221
-
1222
- 🍫🍊 CHOCOLATE ORANGE - NO WRAPPERS!
1223
- Clean markdown output that displays naturally.`)
1224
- .action(withAnalyticsTracking('show', show_1.showFafScoreCard));
1225
- // 🔄 faf sync - Keep .faf up-to-date automatically + Bi-directional sync
1226
- commander_1.program
1227
- .command('sync [file]')
1228
- .description('Update .faf when dependencies change OR sync with claude.md (bi-directional sync)')
1229
- .option('-a, --auto', 'Automatically apply detected changes')
1230
- .option('-d, --dry-run', 'Show changes without applying')
1231
- .option('-b, --bi-sync', '🔗 Bi-directional sync .faf ↔ claude.md')
1232
- .option('-w, --watch', 'Start real-time file watching (with --bi-sync)')
1233
- .addHelpText('after', `
1234
- Examples:
1235
- $ faf sync # Show what needs updating
1236
- $ faf sync --auto # Update automatically
1237
- $ faf sync --dry-run # Preview changes only
1238
-
1239
- 🔗 Bi-Sync Examples:
1240
- $ faf sync --bi-sync # Real-time .faf ↔ claude.md sync
1241
- $ faf sync --bi-sync --watch # Continuous real-time monitoring
1242
- $ faf sync --bi-sync --auto # Automatic conflict-free sync
1243
-
1244
- Championship Bi-Sync Features:
1245
- • ⚡ Sub-40ms sync time (faster than most file operations)
1246
- • 🧠 Smart merge algorithms prevent conflicts and data corruption
1247
- • 🔄 Self-healing: Auto-recovers from file locks/system issues
1248
- • 💎 Credit propagation: Technical credit updates both files
1249
- • 🧡 Trust synchronization: AI compatibility scores stay aligned
1250
- • 🛡️ Conflict prevention: Detects simultaneous edits safely`)
1251
- .action(async (file, options) => {
1252
- if (options.biSync) {
1253
- // Bi-directional sync mode
1254
- await (0, bi_sync_1.biSyncCommand)({
1255
- auto: options.auto,
1256
- watch: options.watch,
1257
- force: false
1258
- });
1259
- }
1260
- else {
1261
- // Original sync functionality
1262
- await (0, sync_1.syncFafFile)(file, options);
1263
- }
1264
- });
1265
- // 🛂 faf tsa - Dependency Inspector (The TSA of Dependencies!)
1266
- commander_1.program
1267
- .command('tsa')
1268
- .description('🛂 Inspect dependencies - The TSA of package.json')
1269
- .option('-d, --detailed', 'Show detailed analysis')
1270
- .action(withAnalyticsTracking('tsa', async (options) => {
1271
- const { tsaCommand } = await Promise.resolve().then(() => __importStar(require('./commands/tsa')));
1272
- await tsaCommand(options);
1273
- }));
1274
- // 🔗 faf bi-sync - Standalone bi-directional sync command
1275
- commander_1.program
1276
- .command('bi-sync')
1277
- .description('🔗 Bi-directional sync .faf ↔ claude.md')
1278
- .option('-a, --auto', 'Automatic sync without prompts')
1279
- .option('-w, --watch', 'Start real-time file watching')
1280
- .option('-f, --force', 'Force overwrite conflicts')
1281
- .option('--agents', 'Also sync to AGENTS.md')
1282
- .option('--cursor', 'Also sync to .cursorrules')
1283
- .option('--ram', 'Also sync to MEMORY.md (tri-sync — ROM↔RAM)')
1284
- .option('--all', 'Sync to all targets (CLAUDE.md + AGENTS.md + .cursorrules + GEMINI.md + MEMORY.md)')
1285
- .addHelpText('after', `
1286
- Examples:
1287
- $ faf bi-sync # Create claude.md and sync
1288
- $ faf bi-sync --auto # Automatic conflict-free sync
1289
- $ faf bi-sync --watch # Continuous real-time monitoring
1290
- $ faf bi-sync --agents # Also generate AGENTS.md
1291
- $ faf bi-sync --cursor # Also generate .cursorrules
1292
- $ faf bi-sync --ram # tri-sync: also seed RAM from ROM
1293
- $ faf bi-sync --all # Sync to ALL targets including RAM
1294
-
1295
- Championship Bi-Sync Features:
1296
- • ⚡ Sub-40ms sync time (faster than most file operations)
1297
- • 🧠 Smart merge algorithms prevent conflicts and data corruption
1298
- • 🔄 Self-healing: Auto-recovers from file locks/system issues
1299
- • 💎 Credit propagation: Technical credit updates both files
1300
- • 🧡 Trust synchronization: AI compatibility scores stay aligned
1301
- • 🛡️ Conflict prevention: Detects simultaneous edits safely`)
1302
- .action(async (options) => {
1303
- await (0, bi_sync_1.biSyncCommand)({
1304
- auto: options.auto,
1305
- watch: options.watch,
1306
- force: options.force || false,
1307
- agents: options.agents,
1308
- cursor: options.cursor,
1309
- ram: options.ram,
1310
- all: options.all,
1311
- });
1312
- });
1313
- // 🧠 faf tri-sync - bi-sync + RAM (the third leg)
1314
- commander_1.program
1315
- .command('tri-sync')
1316
- .description('🧠 tri-sync — bi-sync + RAM (.faf ↔ CLAUDE.md ↔ MEMORY.md)')
1317
- .option('-a, --auto', 'Automatic sync without prompts')
1318
- .option('-f, --force', 'Force overwrite conflicts')
1319
- .option('--all', 'Also sync AGENTS.md, .cursorrules, GEMINI.md')
1320
- .addHelpText('after', `
1321
- Examples:
1322
- $ faf tri-sync # bi-sync + RAM
1323
- $ faf tri-sync --force # Force overwrite
1324
- $ faf tri-sync --all # All targets (tip: you don't need --all)
1325
-
1326
- What tri-sync does:
1327
- bi-sync = .faf ↔ CLAUDE.md (the pair)
1328
- tri-sync = bi-sync + RAM (the triangle)
1329
-
1330
- .faf is ROM. MEMORY.md is RAM. tri-sync is the bus.`)
1331
- .action(async (options) => {
1332
- if (!(0, pro_gate_1.gateProFeature)()) {
1333
- process.exit(0);
1334
- }
1335
- await (0, bi_sync_1.biSyncCommand)({
1336
- auto: options.auto,
1337
- force: options.force || false,
1338
- ram: true,
1339
- all: options.all || false,
1340
- });
1341
- });
1342
- // 📧 faf notifications - Version update notifications
1343
- commander_1.program
1344
- .command('notifications')
1345
- .description('📧 Add your email for new version notifications')
1346
- .option('--email <email>', 'Add email for notifications')
1347
- .option('--status', 'Check notification status')
1348
- .option('--remove', 'Remove email from notifications')
1349
- .option('-q, --quiet', 'Skip interactive prompts')
1350
- .addHelpText('after', `
1351
- Examples:
1352
- $ faf notifications # Interactive email add
1353
- $ faf notifications --email me@example.com # Direct add
1354
- $ faf notifications --status # Check if email added
1355
- $ faf notifications --remove # Remove your email
1356
-
1357
- What you get notified about:
1358
- • New versions with features
1359
- • Breaking changes that affect you
1360
- • Critical security updates
1361
- • Only major releases (not every patch)`)
1362
- .action((options) => (0, notifications_1.notificationsCommand)(options));
1363
- // 🧹 faf clear - Reset caches and state (Claude Code consistency)
1364
- commander_1.program
1365
- .command('clear')
1366
- .description('🧹 Clear caches, temporary files, and reset state')
1367
- .option('--cache', 'Clear trust cache only')
1368
- .option('--todos', 'Clear todo lists only')
1369
- .option('--backups', 'Clear backup files only')
1370
- .option('--all', 'Clear everything (default)')
1371
- .addHelpText('after', `
1372
- Examples:
1373
- $ faf clear # Clear all caches and temp files
1374
- $ faf clear --cache # Clear trust cache only
1375
- $ faf clear --todos # Clear todo lists only
1376
- $ faf clear --backups # Clear backup files only
1377
-
1378
- Claude Code Consistency:
1379
- • Similar to /clear command in Claude Code
1380
- • Fresh start for .faf system
1381
- • Removes temporary files and cached data`)
1382
- .action((options) => (0, clear_1.clearCommand)(options));
1383
- // 🎬 faf demo - Live Demonstrations
1384
- commander_1.program
1385
- .command('demo [subcommand]')
1386
- .description('Live demonstrations of FAF capabilities')
1387
- .option('--speed <speed>', 'Demo pacing: fast, normal, slow (default: normal)')
1388
- .option('--no-cleanup', 'Keep demo changes in files')
1389
- .addHelpText('after', `
1390
- Examples:
1391
- $ faf demo # Show available demos
1392
- $ faf demo sync # Live bi-sync demonstration
1393
- $ faf demo sync --fast # Speed up the demo
1394
- $ faf demo sync --slow # Slow down for presentations
1395
-
1396
- Available demos:
1397
- sync Live .faf <-> CLAUDE.md synchronization
1398
- Shows real-time bidirectional sync with timestamps`)
1399
- .action(withAnalyticsTracking('demo', (subcommand, options) => (0, demo_1.demoCommand)(subcommand, options)));
1400
- // 🍊 faf drift - Context-Drift Analyzer
1401
- commander_1.program
1402
- .command('drift')
1403
- .description('🍊 Analyze git history for context-drift - Context-drift makes you pay')
1404
- .option('--since <period>', 'Analyze drift since period (e.g., "90d", "6m")')
1405
- .option('--detailed', 'Show detailed breakdown of drift events')
1406
- .option('--export <file>', 'Export analysis to JSON file')
1407
- .addHelpText('after', `
1408
- Examples:
1409
- $ faf drift # Analyze entire git history
1410
- $ faf drift --since 90d # Last 90 days only
1411
- $ faf drift --detailed # Full breakdown
1412
- $ faf drift --export drift.json # Save to file
1413
-
1414
- What is Context-Drift?
1415
- • AI makes decisions without project context
1416
- • Each guess creates drift from your true architecture
1417
- • Drift compounds: auth → state → styling → framework
1418
- • Eventually: rewrites, migrations, or project death
1419
-
1420
- What faf drift detects:
1421
- • Auth system changes (JWT → Firebase → Supabase)
1422
- • State management swaps (Redux → Zustand)
1423
- • Styling migrations (CSS → Tailwind)
1424
- • Framework changes (React → Next.js)
1425
- • Database migrations (MongoDB → Postgres)
1426
-
1427
- Shows you:
1428
- • Files rewritten due to drift
1429
- • Weeks lost to cascade fixes
1430
- • Future drift risk level
1431
- • What .faf would have prevented
1432
-
1433
- Context-drift makes you pay.
1434
- .faf keeps you drift-free.`)
1435
- .action(withAnalyticsTracking('drift', (options) => (0, drift_1.driftCommand)(options)));
1436
- // ✏️ faf edit - Interactive .faf editor (Claude Code consistency)
1437
- commander_1.program
1438
- .command('edit')
1439
- .description('✏️ Interactive .faf editor with validation')
1440
- .option('--editor <editor>', 'Specific editor to use (code, vim, nano)')
1441
- .option('--section <section>', 'Edit specific section (project, stack, etc.)')
1442
- .option('--no-validate', 'Skip validation after editing')
1443
- .addHelpText('after', `
1444
- Examples:
1445
- $ faf edit # Open .faf in default editor
1446
- $ faf edit --editor vim # Use specific editor
1447
- $ faf edit --section project # Edit project section only
1448
- $ faf edit --no-validate # Skip post-edit validation
1449
-
1450
- Claude Code Consistency:
1451
- • Similar to /edit command in Claude Code
1452
- • Automatic backup before editing
1453
- • Post-edit validation with restore on errors`)
1454
- .action((options) => (0, edit_1.editCommand)(options));
1455
- // 🔍 faf search - Search .faf content (Claude Code consistency)
1456
- commander_1.program
1457
- .command('search <query>')
1458
- .description('🔍 Search within .faf file content with highlighting')
1459
- .option('--section <section>', 'Search in specific section only')
1460
- .option('--case', 'Case sensitive search')
1461
- .option('--keys', 'Search keys only')
1462
- .option('--values', 'Search values only')
1463
- .option('--count', 'Show match count only')
1464
- .addHelpText('after', `
1465
- Examples:
1466
- $ faf search "react" # Search for "react" anywhere
1467
- $ faf search "api" --section project # Search in project section only
1468
- $ faf search "test" --keys # Search in keys only
1469
- $ faf search "node" --case # Case sensitive search
1470
- $ faf search "component" --count # Just show match count
1471
-
1472
- Claude Code Consistency:
1473
- • Similar to /search command in Claude Code
1474
- • Intelligent highlighting of matches
1475
- • Section-aware searching with path display`)
1476
- .action(withAnalyticsTracking('search', (query, options) => (0, search_1.searchCommand)(query, options)));
1477
- // 🎸 faf skills - Claude Code Skills Integration
1478
- commander_1.program
1479
- .command('skills')
1480
- .description('🎸 List Claude Code skills from .faf file')
1481
- .option('-p, --path <path>', 'Path to .faf file or directory')
1482
- .addHelpText('after', `
1483
- Examples:
1484
- $ faf skills # List skills from .faf
1485
- $ faf skills --path ./project # Check specific project
1486
-
1487
- Claude Code Skills:
1488
- • Skills are loaded from ~/.claude/skills/
1489
- • Configure in .faf: skills: [faf, wjttc-tester]
1490
- • See: https://github.com/anthropics/skills`)
1491
- .action(withAnalyticsTracking('skills', (options) => (0, skills_1.skillsCommand)(options)));
1492
- // 📊 faf analytics - Analytics & Telemetry Management
1493
- commander_1.program
1494
- .command('analytics')
1495
- .description('📊 View usage analytics and manage telemetry settings')
1496
- .option('-s, --summary', 'Show analytics summary')
1497
- .option('-d, --disable', 'Disable telemetry collection')
1498
- .option('-e, --enable', 'Enable telemetry collection')
1499
- .option('--reset', 'Reset all analytics data')
1500
- .addHelpText('after', `
1501
- Examples:
1502
- $ faf analytics --summary # View usage statistics
1503
- $ faf analytics --disable # Turn off telemetry
1504
- $ faf analytics --enable # Turn on telemetry
1505
- $ faf analytics --reset # Clear analytics data
1506
-
1507
- Championship Analytics:
1508
- • 📊 Performance metrics (F1-inspired speed tracking)
1509
- • 📊 Command usage patterns and favorites
1510
- • 📈 Trust score improvements over time
1511
- • 🔒 Privacy-first: All data anonymized and local
1512
- • 🚀 Help make FAF better for everyone!
1513
-
1514
- Privacy Controls:
1515
- • Telemetry can be disabled anytime
1516
- • No sensitive data collected (keys, tokens filtered)
1517
- • All metrics stored locally first
1518
- • Opt-in for improvement insights`)
1519
- .action(withAnalyticsTracking('analytics', async (options) => {
1520
- if (options.summary) {
1521
- await analytics_1.analytics.showAnalyticsSummary();
1522
- }
1523
- else if (options.disable) {
1524
- await analytics_1.analytics.disableTelemetry();
1525
- }
1526
- else if (options.enable) {
1527
- await analytics_1.analytics.enableTelemetry();
1528
- }
1529
- else if (options.reset) {
1530
- console.log(colors_1.chalk.yellow('⚠️ Analytics reset not available'));
1531
- console.log(colors_1.chalk.gray(' Use: faf analytics --disable to turn off analytics'));
1532
- }
1533
- else {
1534
- // Default: show summary
1535
- await analytics_1.analytics.showAnalyticsSummary();
1536
- }
1537
- }));
1538
- // 🩵 faf faq - Show FAQ
1539
- commander_1.program
1540
- .command('faq')
1541
- .description('🩵 Frequently Asked Questions - Get help with common issues')
1542
- .option('-s, --search <term>', 'Search FAQ for specific topic')
1543
- .addHelpText('after', `
1544
- Examples:
1545
- $ faf faq # Show full FAQ
1546
- $ faf faq --search spacebar # Search for spacebar info
1547
- $ faf faq --search commands # Search for command info`)
1548
- .action(withAnalyticsTracking('faq', async (options) => {
1549
- const faqCommand = await Promise.resolve().then(() => __importStar(require('./commands/faq')));
1550
- await faqCommand.faqCommand(options);
1551
- }));
1552
- // 🔧 faf lint - Clean up formatting automatically
1553
- commander_1.program
1554
- .command('lint [file]')
1555
- .description('Fix .faf formatting and style issues')
1556
- .option('-f, --fix', 'Automatically fix formatting issues')
1557
- .option('--schema-version <version>', 'Validate against specific schema version')
1558
- .addHelpText('after', `
1559
- Examples:
1560
- $ faf lint # Check formatting issues
1561
- $ faf lint --fix # Fix formatting automatically
1562
- $ faf lint --schema-version 2.4.0 # Use specific schema`)
1563
- .action(lint_1.lintFafFile);
1564
- // 🚀 faf enhance - REAL Enhancement based on facts
1565
- commander_1.program
1566
- .command('enhance [file]')
1567
- .description('🚀 REAL Enhancement - Analyzes your project for actual improvements')
1568
- .option('-v, --verbose', 'Show detailed changes')
1569
- .option('--dry-run', 'Preview improvements without applying')
1570
- .option('--auto-fill', 'Automatically fill all detectable fields')
1571
- .option('-t, --target-score <score>', 'Target score to achieve (default: 100)', '100')
1572
- .option('-i, --interactive <bool>', 'Ask for missing data (default: true)', 'true')
1573
- .addHelpText('after', `
1574
- 🚀 REAL Enhancement:
1575
- $ faf enhance # Apply real improvements from project analysis
1576
- $ faf enhance --dry-run # Preview what will be improved
1577
- $ faf enhance --verbose # Show detailed changes
1578
- $ faf enhance -t 90 # RELENTLESSLY enhance until 90% score
1579
-
1580
- ✅ No BS, No Placeholders - Only facts from your actual project!
1581
- 🎯 Relentless mode: Keeps enhancing until target score achieved`)
1582
- .action((file, options) => {
1583
- const enhanceOptions = {
1584
- verbose: options.verbose,
1585
- dryRun: options.dryRun,
1586
- autoFill: options.autoFill,
1587
- targetScore: parseInt(options.targetScore),
1588
- interactive: options.interactive !== 'false'
1589
- };
1590
- return (0, enhance_real_1.realEnhanceFaf)(file, enhanceOptions);
1591
- });
1592
- // 🔍 faf analyze - Claude-First, Big-3 Compatible Analysis
1593
- commander_1.program
1594
- .command('analyze [file]')
1595
- .description('🔍 Claude-First AI Analysis - Big-3 Compatible Intelligence')
1596
- .option('-m, --model <model>', 'AI model: claude|chatgpt|gemini|big3|universal', 'claude')
1597
- .option('-f, --focus <area>', 'Focus: completeness|quality|ai-readiness|human-context|claude-exclusive')
1598
- .option('-v, --verbose', 'Show detailed section breakdown')
1599
- .option('-s, --suggestions', 'Include automated suggestions')
1600
- .option('-c, --comparative', 'Compare perspectives from multiple models')
1601
- .addHelpText('after', `
1602
- 🤖 Claude-First Analysis:
1603
- $ faf analyze # Claude intelligence (default)
1604
- $ faf analyze --model big3 # Big-3 perspective analysis
1605
- $ faf analyze --focus claude-exclusive # Claude's championship analysis
1606
- $ faf analyze --comparative # Multi-model comparison
1607
- $ faf analyze --verbose --suggestions # Detailed analysis + tips
1608
-
1609
- 🚀 NO EXTERNAL DEPENDENCIES - Uses our own Big-3 verification engine!`)
1610
- .action(ai_analyze_1.analyzeFafWithAI);
1611
- // 🔌 faf plugin-install - Workaround for Claude Code SSH bug
1612
- (0, plugin_install_1.registerPluginInstallCommand)(commander_1.program);
1613
- // Handle unknown commands with helpful suggestions
1614
- commander_1.program
1615
- .command('*')
1616
- .action((cmd) => {
1617
- console.log(colors_1.chalk.red(`❌ Unknown command: ${cmd}`));
1618
- console.log('');
1619
- console.log(championship_style_1.FAF_COLORS.fafOrange('💡 Did you mean:'));
1620
- console.log(` ${colors_1.chalk.cyan('faf init')} # Create .faf file`);
1621
- console.log(` ${colors_1.chalk.cyan('faf score')} # Check completeness`);
1622
- console.log(` ${colors_1.chalk.cyan('faf --help')} # See all commands`);
1623
- process.exit(1);
1624
- });
1625
- /**
1626
- * Interactive welcome screen with persistent bottom command line
1627
- */
1628
- async function showInteractiveWelcome() {
1629
- // Check if we're in an interactive terminal
1630
- if (!process.stdin.isTTY) {
1631
- console.log('\n🏎️ FAF Interactive Menu requires an interactive terminal\n');
1632
- console.log('💡 When using AI assistants or CI/CD:\n');
1633
- console.log(' faf init - Create .faf file');
1634
- console.log(' faf auto - Automatically enhance context');
1635
- console.log(' faf score - Check your score');
1636
- console.log(' faf --help - See all commands\n');
1637
- return;
1638
- }
1639
- // Clear screen and set up persistent layout
1640
- console.clear();
1641
- // ASCII Header
1642
- console.log((0, championship_style_1.generateFAFHeader)());
1643
- console.log('');
1644
- console.log(colors_1.chalk.dim('Using faf menu'));
1645
- console.log('');
1646
- // Hello User
1647
- const username = require('os').userInfo().username;
1648
- console.log(colors_1.chalk.cyan.bold(` 👋 Hello ${username}!`));
1649
- console.log('');
1650
- // Ready message
1651
- console.log(colors_1.chalk.white(' Ready to make your AI happy again?'));
1652
- console.log('');
1653
- try {
1654
- const answer = await inquirer_1.default.prompt([
1655
- {
1656
- type: 'list',
1657
- name: 'action',
1658
- message: 'Select an option',
1659
- choices: [
1660
- { name: '1. Create your first .faf file', value: 'init' },
1661
- { name: '2. Interactive context builder', value: 'chat' },
1662
- { name: '3. See all commands', value: 'help' },
1663
- { name: '4. FAQ - Get help & answers', value: 'faq' },
1664
- { name: '5. Browse everything A-Z', value: 'index' },
1665
- { name: '6. Switch to command line', value: 'commandline' },
1666
- new inquirer_1.default.Separator('')
1667
- ]
1668
- }
1669
- ]);
1670
- // If user selected command line mode, switch to persistent typing
1671
- if (answer.action === 'commandline') {
1672
- console.clear();
1673
- console.log((0, championship_style_1.generateFAFHeader)());
1674
- console.log('');
1675
- console.log(colors_1.chalk.dim('Using faf CLI'));
1676
- console.log('');
1677
- console.log(colors_1.chalk.cyan.bold('⌨️ Command Line Mode'));
1678
- console.log(colors_1.chalk.gray('Type commands, "menu" for menu, or "index" for the .faf A-Z'));
1679
- console.log('');
1680
- // Persistent command line loop with spacebar detection
1681
- let inCommandMode = true;
1682
- while (inCommandMode) {
1683
- const cmdAnswer = await new Promise((resolve) => {
1684
- let inputBuffer = '';
1685
- // Show prompt
1686
- process.stdout.write('> ');
1687
- // Set up raw keyboard input for spacebar detection
1688
- if (process.stdin.isTTY) {
1689
- process.stdin.setRawMode(true);
1690
- process.stdin.resume();
1691
- process.stdin.setEncoding('utf8');
1692
- const keyHandler = (key) => {
1693
- // Spacebar pressed - toggle to menu
1694
- if (key === ' ' && inputBuffer === '') {
1695
- process.stdin.setRawMode(false);
1696
- process.stdin.removeListener('data', keyHandler);
1697
- console.log(`\n${colors_1.chalk.dim('🎯 Switching to menu...')}`);
1698
- resolve({ command: 'menu' });
1699
- return;
1700
- }
1701
- // Escape pressed - exit
1702
- if (key === '\u001b') {
1703
- process.stdin.setRawMode(false);
1704
- process.stdin.removeListener('data', keyHandler);
1705
- console.log('\n👋 Goodbye!');
1706
- process.exit(0);
1707
- }
1708
- // Enter pressed - execute command
1709
- if (key === '\r' || key === '\n') {
1710
- process.stdin.setRawMode(false);
1711
- process.stdin.removeListener('data', keyHandler);
1712
- console.log('');
1713
- resolve({ command: inputBuffer });
1714
- return;
1715
- }
1716
- // Backspace
1717
- if (key === '\u007f') {
1718
- if (inputBuffer.length > 0) {
1719
- inputBuffer = inputBuffer.slice(0, -1);
1720
- process.stdout.write('\b \b');
1721
- }
1722
- return;
1723
- }
1724
- // Regular character
1725
- if (key >= ' ' && key <= '~') {
1726
- inputBuffer += key;
1727
- process.stdout.write(key);
1728
- }
1729
- };
1730
- process.stdin.on('data', keyHandler);
1731
- }
1732
- else {
1733
- // Fallback for non-TTY - use regular inquirer
1734
- inquirer_1.default.prompt([{
1735
- type: 'input',
1736
- name: 'command',
1737
- message: '>'
1738
- }]).then(resolve);
1739
- }
1740
- });
1741
- const command = cmdAnswer.command.trim().toLowerCase();
1742
- // Handle mode switching commands
1743
- if (command === 'exit' || command === 'quit') {
1744
- console.log('👋 Goodbye!');
1745
- process.exit(0);
1746
- }
1747
- if (command === 'menu') {
1748
- inCommandMode = false;
1749
- console.log(colors_1.chalk.dim('↩️ Returning to menu...'));
1750
- console.log('');
1751
- // Recursively call showInteractiveWelcome to return to menu
1752
- await showInteractiveWelcome();
1753
- return;
1754
- }
1755
- // Execute typed command
1756
- switch (command) {
1757
- case 'init':
1758
- await (0, init_1.initFafFile)();
1759
- break;
1760
- case 'chat':
1761
- await (0, chat_1.chatCommand)();
1762
- break;
1763
- case 'help':
1764
- commander_1.program.help();
1765
- break;
1766
- case 'index':
1767
- await (0, index_1.indexCommand)();
1768
- break;
1769
- case 'status':
1770
- await (0, status_1.statusCommand)();
1771
- break;
1772
- case 'faq':
1773
- const faqCommand = await Promise.resolve().then(() => __importStar(require('./commands/faq')));
1774
- await faqCommand.faqCommand();
1775
- break;
1776
- case '':
1777
- // Empty command, just continue
1778
- break;
1779
- default:
1780
- // Check if user tried a slash command
1781
- if (command.startsWith('/')) {
1782
- const commandWithoutSlash = command.slice(1);
1783
- console.log(colors_1.chalk.red(`❌ Unknown command: ${command}`));
1784
- console.log(championship_style_1.FAF_COLORS.fafCyan('🎉 Good news! You don\'t need a slash in FAF CLI mode'));
1785
- console.log(championship_style_1.FAF_COLORS.fafOrange(`💡 Try: ${commandWithoutSlash} (without the /)`));
1786
- }
1787
- else {
1788
- console.log(colors_1.chalk.red(`❌ Unknown command: ${command}`));
1789
- console.log(championship_style_1.FAF_COLORS.fafOrange('💡 Try: init, chat, help, index, status, score, exit'));
1790
- }
1791
- break;
1792
- }
1793
- console.log('');
1794
- }
1795
- }
1796
- else {
1797
- // Execute selected menu item
1798
- const action = answer.action;
1799
- switch (action) {
1800
- case 'init':
1801
- await (0, init_1.initFafFile)();
1802
- break;
1803
- case 'chat':
1804
- await (0, chat_1.chatCommand)();
1805
- break;
1806
- case 'help':
1807
- commander_1.program.help();
1808
- break;
1809
- case 'faq':
1810
- const faqMenuCommand = await Promise.resolve().then(() => __importStar(require('./commands/faq')));
1811
- await faqMenuCommand.faqCommand();
1812
- break;
1813
- case 'index':
1814
- await (0, index_1.indexCommand)();
1815
- break;
1816
- }
1817
- }
1818
- }
1819
- catch (error) {
1820
- if (error instanceof Error && error.message.includes('User force closed')) {
1821
- console.log(`\n${colors_1.chalk.cyan('👋 See you later!')}\n`);
1822
- }
1823
- else {
1824
- console.error(`\n${colors_1.chalk.red('❌ Error:')} ${error}\n`);
1825
- }
1826
- }
1827
- }
1828
- // Show header based on command used BEFORE parsing
1829
- const commandUsed = process.argv[2];
1830
- // Special case: No arguments at all - use smart FAF logic
1831
- if (!commandUsed) {
1832
- Promise.resolve().then(() => __importStar(require('./smart-faf'))).then(module => {
1833
- const SmartFaf = module.default;
1834
- const smartFaf = new SmartFaf();
1835
- return smartFaf.execute();
1836
- }).then(() => process.exit(0)).catch(err => {
1837
- console.error(err);
1838
- process.exit(1);
1839
- });
1840
- }
1841
- else {
1842
- // Parse CLI arguments to check for gearbox flags
1843
- const parsed = commander_1.program.parse(process.argv);
1844
- const options = commander_1.program.opts();
1845
- // Gearbox system: Auto/Manual mode detection
1846
- const isAutoMode = options.auto;
1847
- const isManualMode = options.manual;
1848
- // Auto mode - show interactive welcome
1849
- if (isAutoMode) {
1850
- showInteractiveWelcome().then(() => process.exit(0)).catch(err => {
1851
- console.error(err);
1852
- process.exit(1);
1853
- });
1854
- }
1855
- else {
1856
- const isHelp = commandUsed === '--help' || commandUsed === '-h' || commandUsed === 'help';
1857
- showHeaderIfAppropriate(isHelp ? 'help' : commandUsed);
1858
- // Check for updates (non-blocking, respects quiet mode)
1859
- (0, update_checker_1.checkForUpdates)({ quiet: options.quiet }).catch(() => {
1860
- // Silent fail - update check is not critical
1861
- });
1862
- // Show v2.4.0 announcement to existing users (one time only)
1863
- (0, announcements_1.showV240Announcement)();
1864
- // Apply color accessibility settings after parsing
1865
- if (options.noColor || process.env.NO_COLOR) {
1866
- (0, color_utils_1.setColorOptions)(false);
1867
- }
1868
- else if (options.colorScheme) {
1869
- const scheme = options.colorScheme;
1870
- const validSchemes = ['normal', 'deuteranopia', 'protanopia', 'tritanopia'];
1871
- if (validSchemes.includes(scheme)) {
1872
- (0, color_utils_1.setColorOptions)(true, scheme);
1873
- }
1874
- else {
1875
- console.log(colors_1.chalk.red(`❌ Invalid color scheme: ${scheme}`));
1876
- console.log(championship_style_1.FAF_COLORS.fafOrange(`💡 Valid schemes: ${validSchemes.join(', ')}`));
1877
- process.exit(1);
1878
- }
1879
- }
1880
- // Execute the parsed command
1881
- commander_1.program.execute(parsed).catch(err => {
1882
- console.error(err);
1883
- process.exit(1);
1884
- });
1885
- }
1886
- }
1887
- //# sourceMappingURL=cli.js.map
303
+ Empty slots:
304
+ ${q}
305
+
306
+ Respond with ONLY valid JSON, no markdown fences.`,Y=await J.messages.create({model:"claude-haiku-4-5-20251001",max_tokens:1024,messages:[{role:"user",content:Q}]});try{let G=Y.content[0].text,U=JSON.parse(G),W=0;for(let H of z){let V=U[H.path];if(V&&typeof V==="string")hB(Z,H.path,V),console.log(` ${w("●")} ${H.path} ${I("←")} ${V}`),W++}if(W>0){p($,Z),console.log(`
307
+ ${w("◆")} ai enhance filled ${W} slot${W===1?"":"s"}`);let H=s(n(u($)));a(H,$)}}catch{console.error("Error: Could not parse AI response.")}}async function uB(){let $=f();if(!$)console.error(`Error: project.faf not found
308
+
309
+ Run 'faf init' to create one.`),process.exit(2);let Z=u($);console.log(`${w("ai")} analyze ${I("getting suggestions...")}`);let z=await(await _J()).messages.create({model:"claude-haiku-4-5-20251001",max_tokens:1024,messages:[{role:"user",content:`Analyze this .faf project context file and provide 3-5 specific suggestions for improvement. Focus on completeness, accuracy, and best practices.
310
+
311
+ ${Z}
312
+
313
+ Be concise. One line per suggestion.`}]});console.log(""),console.log(z.content[0].text)}import{existsSync as x5,readFileSync as k5,readdirSync as mB}from"fs";import{join as CJ}from"path";function EJ($,Z){if($==="import")dB(Z);else if($==="export")cB();else console.log(`${w("conductor")} ${I("— conductor integration")}
314
+ `),console.log(` ${b("faf conductor import <path>")} ${I("— import conductor config into .faf")}`),console.log(` ${b("faf conductor export")} ${I("— generate conductor config from .faf")}`)}function dB($){if(!$)console.error("Usage: faf conductor import <path>"),process.exit(2);if(!x5($))console.error(`Error: path not found: ${$}`),process.exit(2);let Z={faf_version:"2.5.0",project:{}};if(x5($)&&$.endsWith(".json")){let J=JSON.parse(k5($,"utf-8"));if(J.name)Z.project.name=J.name;if(J.description)Z.project.goal=J.description;if(J.language)Z.project.main_language=J.language}else if(x5($)&&($.endsWith(".yml")||$.endsWith(".yaml"))){let J=j6(k5($,"utf-8"));if(J.name)Z.project.name=J.name;if(J.description)Z.project.goal=J.description;if(J.language)Z.project.main_language=J.language}else try{let J=mB($);for(let q of J){let Q=CJ($,q);if(q.endsWith(".json"))try{let Y=JSON.parse(k5(Q,"utf-8"));if(Y.name&&!Z.project.name)Z.project.name=Y.name;if(Y.description&&!Z.project.goal)Z.project.goal=Y.description}catch{}}}catch{console.error(`Error: could not read directory: ${$}`),process.exit(2)}let X=process.cwd(),z=f(X);if(z){let J=m(z);if(!J.project)J.project={};if(Z.project.name&&!J.project.name)J.project.name=Z.project.name;if(Z.project.goal&&!J.project.goal)J.project.goal=Z.project.goal;if(Z.project.main_language&&!J.project.main_language)J.project.main_language=Z.project.main_language;p(z,J),console.log(`${w("◆")} conductor import merged into ${z}`)}else{let J=CJ(X,"project.faf");p(J,Z),console.log(`${w("◆")} conductor import created ${J}`)}}function cB(){let $=f();if(!$)console.error(`Error: project.faf not found
315
+
316
+ Run 'faf init' to create one.`),process.exit(2);let Z=m($),X={name:Z.project?.name??"",description:Z.project?.goal??"",language:Z.project?.main_language??"",stack:Z.stack??{}};console.log(JSON.stringify(X,null,2))}var pB="6.0.0-alpha.0",x=new e5;x.name("faf").description("Foundational AI-Context Format — project DNA for any AI").version(pB,"-v, --version");x.command("init").description("Create .faf from your project").option("--yolo","Quick init with sensible defaults").option("--quick","Alias for --yolo").option("--force","Overwrite existing project.faf").option("--output <path>","Output path").action(($)=>M4($));x.command("auto").description("Zero to 100% in one command").action(()=>Cz());x.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>_9($));x.command("score [file]").description("Score a .faf file").option("--verbose","Show slot breakdown").option("--status","Compact one-liner output").option("--json","Output as JSON").action(($,Z)=>L4($,Z));x.command("sync").description(".faf ↔ CLAUDE.md (bi-sync, mtime auto-direction)").option("--watch","Watch for changes").option("--direction <dir>","Force direction: auto|push|pull","auto").action(($)=>O4($));x.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,Z)=>dz($,Z));x.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,Z)=>cz($,Z));x.command("git <url>").description("Instant .faf from any GitHub repo").action(($)=>rz($));x.command("export").description("Export context files from .faf").option("--agents","Generate AGENTS.md").option("--cursor","Generate .cursorrules").option("--gemini","Generate GEMINI.md").option("--conductor","Generate conductor config").option("--all","Generate all formats").action(($)=>k6($));x.command("check [file]").description("Validate .faf file").option("--strict","Require 100% score").option("--fix","Auto-fix issues").option("--doctor","Full diagnostic").option("--trust","Verify trust chain").action(($,Z)=>w4($,Z));x.command("info").description("Show version and system info").option("--version","Show version").option("--faq","Show FAQ").option("--index","Show command index").option("--stacks","Show supported stacks").action(($)=>oz($));x.command("formats").description("Show supported formats").action(()=>tz());x.command("clear").description("Clear cached data").action(()=>ez());x.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>$9($));x.command("context").description("Generate context output").action(()=>Z9());x.command("drift").description("Check context drift").action(()=>z9());x.command("edit <path> <value>").description("Edit .faf fields").action(($,Z)=>J9($,Z));x.command("recover").description("Recover .faf from context files").action(()=>q9());x.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>Q9($));x.command("pro [subcommand]").description("Pro features & licensing").action(($)=>O9($));x.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>w9($));x.command("demo").description("Demo walkthrough").action(()=>R9());x.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,Z)=>A9($,Z));x.command("taf").description("Test Archive Format receipt").option("--output <path>","Write receipt to file").action(($)=>P9($));x.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>SJ($));x.command("conductor [subcommand] [path]").description("Conductor integration").action(($,Z)=>EJ($,Z));x.command("bi-sync",{hidden:!0}).action(()=>O4());x.command("status",{hidden:!0}).action(()=>L4(void 0,{status:!0}));x.command("agents",{hidden:!0}).action(()=>k6({agents:!0}));x.command("cursor",{hidden:!0}).action(()=>k6({cursor:!0}));x.command("gemini",{hidden:!0}).action(()=>k6({gemini:!0}));x.command("validate",{hidden:!0}).action(($)=>w4($));x.command("yolo",{hidden:!0}).action(()=>M4({yolo:!0}));x.parse(process.argv);