toolcraft 0.0.116 → 0.0.118

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 (319) hide show
  1. package/composition.json +42 -2
  2. package/dist/composition.json +42 -2
  3. package/node_modules/@poe-code/agent-mcp-config/package.json +0 -3
  4. package/node_modules/@poe-code/config-mutations/package.json +0 -5
  5. package/node_modules/@poe-code/frontmatter/package.json +0 -3
  6. package/node_modules/@poe-code/process-runner/package.json +0 -3
  7. package/node_modules/@poe-code/task-list/package.json +0 -3
  8. package/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
  9. package/node_modules/fast-string-truncated-width/dist/index.js +111 -0
  10. package/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
  11. package/node_modules/fast-string-truncated-width/dist/types.js +2 -0
  12. package/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
  13. package/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
  14. package/node_modules/fast-string-truncated-width/license +21 -0
  15. package/node_modules/fast-string-truncated-width/package.json +35 -0
  16. package/node_modules/fast-string-truncated-width/readme.md +59 -0
  17. package/node_modules/fast-string-width/dist/index.d.ts +4 -0
  18. package/node_modules/fast-string-width/dist/index.js +14 -0
  19. package/node_modules/fast-string-width/license +21 -0
  20. package/node_modules/fast-string-width/package.json +34 -0
  21. package/node_modules/fast-string-width/readme.md +42 -0
  22. package/node_modules/fast-wrap-ansi/LICENSE +23 -0
  23. package/node_modules/fast-wrap-ansi/README.md +26 -0
  24. package/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
  25. package/node_modules/fast-wrap-ansi/lib/main.js +218 -0
  26. package/node_modules/fast-wrap-ansi/package.json +51 -0
  27. package/node_modules/ignore/LICENSE-MIT +21 -0
  28. package/node_modules/ignore/README.md +412 -0
  29. package/node_modules/ignore/index.d.ts +61 -0
  30. package/node_modules/ignore/index.js +636 -0
  31. package/node_modules/ignore/legacy.js +559 -0
  32. package/node_modules/ignore/package.json +74 -0
  33. package/node_modules/jsonc-parser/CHANGELOG.md +76 -0
  34. package/node_modules/jsonc-parser/LICENSE.md +21 -0
  35. package/node_modules/jsonc-parser/README.md +364 -0
  36. package/node_modules/jsonc-parser/SECURITY.md +41 -0
  37. package/node_modules/jsonc-parser/lib/esm/impl/edit.js +185 -0
  38. package/node_modules/jsonc-parser/lib/esm/impl/format.js +261 -0
  39. package/node_modules/jsonc-parser/lib/esm/impl/parser.js +659 -0
  40. package/node_modules/jsonc-parser/lib/esm/impl/scanner.js +443 -0
  41. package/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +29 -0
  42. package/node_modules/jsonc-parser/lib/esm/main.d.ts +351 -0
  43. package/node_modules/jsonc-parser/lib/esm/main.js +178 -0
  44. package/node_modules/jsonc-parser/lib/umd/impl/edit.js +201 -0
  45. package/node_modules/jsonc-parser/lib/umd/impl/format.js +275 -0
  46. package/node_modules/jsonc-parser/lib/umd/impl/parser.js +682 -0
  47. package/node_modules/jsonc-parser/lib/umd/impl/scanner.js +456 -0
  48. package/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +42 -0
  49. package/node_modules/jsonc-parser/lib/umd/main.d.ts +351 -0
  50. package/node_modules/jsonc-parser/lib/umd/main.js +194 -0
  51. package/node_modules/jsonc-parser/package.json +37 -0
  52. package/node_modules/sisteransi/license +21 -0
  53. package/node_modules/sisteransi/package.json +34 -0
  54. package/node_modules/sisteransi/readme.md +113 -0
  55. package/node_modules/sisteransi/src/index.js +58 -0
  56. package/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
  57. package/node_modules/smol-toml/LICENSE +24 -0
  58. package/node_modules/smol-toml/README.md +239 -0
  59. package/node_modules/smol-toml/dist/date.d.ts +41 -0
  60. package/node_modules/smol-toml/dist/date.js +127 -0
  61. package/node_modules/smol-toml/dist/error.d.ts +38 -0
  62. package/node_modules/smol-toml/dist/error.js +63 -0
  63. package/node_modules/smol-toml/dist/extract.d.ts +30 -0
  64. package/node_modules/smol-toml/dist/extract.js +100 -0
  65. package/node_modules/smol-toml/dist/index.cjs +897 -0
  66. package/node_modules/smol-toml/dist/index.d.ts +43 -0
  67. package/node_modules/smol-toml/dist/index.js +33 -0
  68. package/node_modules/smol-toml/dist/parse.d.ts +37 -0
  69. package/node_modules/smol-toml/dist/parse.js +148 -0
  70. package/node_modules/smol-toml/dist/primitive.d.ts +31 -0
  71. package/node_modules/smol-toml/dist/primitive.js +179 -0
  72. package/node_modules/smol-toml/dist/stringify.d.ts +31 -0
  73. package/node_modules/smol-toml/dist/stringify.js +167 -0
  74. package/node_modules/smol-toml/dist/struct.d.ts +32 -0
  75. package/node_modules/smol-toml/dist/struct.js +184 -0
  76. package/node_modules/smol-toml/dist/util.d.ts +42 -0
  77. package/node_modules/smol-toml/dist/util.js +111 -0
  78. package/node_modules/smol-toml/package.json +54 -0
  79. package/node_modules/tiny-stdio-mcp-server/dist/composition.json +1 -1
  80. package/node_modules/tiny-stdio-mcp-server/dist/server.js +9 -21
  81. package/node_modules/tiny-stdio-mcp-server/dist/uri-template.d.ts +6 -0
  82. package/node_modules/tiny-stdio-mcp-server/dist/uri-template.js +363 -0
  83. package/node_modules/tiny-stdio-mcp-server/package.json +0 -4
  84. package/node_modules/toolcraft-design/package.json +0 -5
  85. package/node_modules/toolcraft-schema/package.json +3 -2
  86. package/node_modules/yaml/LICENSE +13 -0
  87. package/node_modules/yaml/README.md +172 -0
  88. package/node_modules/yaml/bin.mjs +11 -0
  89. package/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
  90. package/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
  91. package/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
  92. package/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
  93. package/node_modules/yaml/browser/dist/compose/composer.js +219 -0
  94. package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
  95. package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
  96. package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
  97. package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
  98. package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
  99. package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +225 -0
  100. package/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
  101. package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
  102. package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
  103. package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
  104. package/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
  105. package/node_modules/yaml/browser/dist/doc/Document.js +335 -0
  106. package/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
  107. package/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
  108. package/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
  109. package/node_modules/yaml/browser/dist/doc/directives.js +176 -0
  110. package/node_modules/yaml/browser/dist/errors.js +57 -0
  111. package/node_modules/yaml/browser/dist/index.js +17 -0
  112. package/node_modules/yaml/browser/dist/log.js +11 -0
  113. package/node_modules/yaml/browser/dist/nodes/Alias.js +116 -0
  114. package/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
  115. package/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
  116. package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
  117. package/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
  118. package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
  119. package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
  120. package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
  121. package/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
  122. package/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
  123. package/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
  124. package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
  125. package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
  126. package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
  127. package/node_modules/yaml/browser/dist/parse/lexer.js +721 -0
  128. package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
  129. package/node_modules/yaml/browser/dist/parse/parser.js +975 -0
  130. package/node_modules/yaml/browser/dist/public-api.js +102 -0
  131. package/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
  132. package/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
  133. package/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
  134. package/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
  135. package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
  136. package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
  137. package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
  138. package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
  139. package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
  140. package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
  141. package/node_modules/yaml/browser/dist/schema/tags.js +96 -0
  142. package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
  143. package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
  144. package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
  145. package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
  146. package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +67 -0
  147. package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
  148. package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
  149. package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
  150. package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
  151. package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
  152. package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
  153. package/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
  154. package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
  155. package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
  156. package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
  157. package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +25 -0
  158. package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
  159. package/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
  160. package/node_modules/yaml/browser/dist/util.js +11 -0
  161. package/node_modules/yaml/browser/dist/visit.js +233 -0
  162. package/node_modules/yaml/browser/index.js +5 -0
  163. package/node_modules/yaml/browser/package.json +3 -0
  164. package/node_modules/yaml/dist/cli.d.ts +8 -0
  165. package/node_modules/yaml/dist/cli.mjs +201 -0
  166. package/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
  167. package/node_modules/yaml/dist/compose/compose-collection.js +90 -0
  168. package/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
  169. package/node_modules/yaml/dist/compose/compose-doc.js +45 -0
  170. package/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
  171. package/node_modules/yaml/dist/compose/compose-node.js +112 -0
  172. package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
  173. package/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
  174. package/node_modules/yaml/dist/compose/composer.d.ts +63 -0
  175. package/node_modules/yaml/dist/compose/composer.js +224 -0
  176. package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
  177. package/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
  178. package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
  179. package/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
  180. package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
  181. package/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
  182. package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
  183. package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
  184. package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
  185. package/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
  186. package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
  187. package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +227 -0
  188. package/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
  189. package/node_modules/yaml/dist/compose/resolve-props.js +148 -0
  190. package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
  191. package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
  192. package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
  193. package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
  194. package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
  195. package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
  196. package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
  197. package/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
  198. package/node_modules/yaml/dist/doc/Document.d.ts +141 -0
  199. package/node_modules/yaml/dist/doc/Document.js +337 -0
  200. package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
  201. package/node_modules/yaml/dist/doc/anchors.js +76 -0
  202. package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
  203. package/node_modules/yaml/dist/doc/applyReviver.js +57 -0
  204. package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
  205. package/node_modules/yaml/dist/doc/createNode.js +90 -0
  206. package/node_modules/yaml/dist/doc/directives.d.ts +49 -0
  207. package/node_modules/yaml/dist/doc/directives.js +178 -0
  208. package/node_modules/yaml/dist/errors.d.ts +21 -0
  209. package/node_modules/yaml/dist/errors.js +62 -0
  210. package/node_modules/yaml/dist/index.d.ts +25 -0
  211. package/node_modules/yaml/dist/index.js +50 -0
  212. package/node_modules/yaml/dist/log.d.ts +3 -0
  213. package/node_modules/yaml/dist/log.js +19 -0
  214. package/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
  215. package/node_modules/yaml/dist/nodes/Alias.js +118 -0
  216. package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
  217. package/node_modules/yaml/dist/nodes/Collection.js +151 -0
  218. package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
  219. package/node_modules/yaml/dist/nodes/Node.js +40 -0
  220. package/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
  221. package/node_modules/yaml/dist/nodes/Pair.js +39 -0
  222. package/node_modules/yaml/dist/nodes/Scalar.d.ts +47 -0
  223. package/node_modules/yaml/dist/nodes/Scalar.js +27 -0
  224. package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
  225. package/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
  226. package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
  227. package/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
  228. package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
  229. package/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
  230. package/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
  231. package/node_modules/yaml/dist/nodes/identity.js +53 -0
  232. package/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
  233. package/node_modules/yaml/dist/nodes/toJS.js +39 -0
  234. package/node_modules/yaml/dist/options.d.ts +350 -0
  235. package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
  236. package/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
  237. package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
  238. package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
  239. package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
  240. package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
  241. package/node_modules/yaml/dist/parse/cst.d.ts +109 -0
  242. package/node_modules/yaml/dist/parse/cst.js +112 -0
  243. package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
  244. package/node_modules/yaml/dist/parse/lexer.js +723 -0
  245. package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
  246. package/node_modules/yaml/dist/parse/line-counter.js +41 -0
  247. package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
  248. package/node_modules/yaml/dist/parse/parser.js +980 -0
  249. package/node_modules/yaml/dist/public-api.d.ts +44 -0
  250. package/node_modules/yaml/dist/public-api.js +107 -0
  251. package/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
  252. package/node_modules/yaml/dist/schema/Schema.js +39 -0
  253. package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
  254. package/node_modules/yaml/dist/schema/common/map.js +19 -0
  255. package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
  256. package/node_modules/yaml/dist/schema/common/null.js +17 -0
  257. package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
  258. package/node_modules/yaml/dist/schema/common/seq.js +19 -0
  259. package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
  260. package/node_modules/yaml/dist/schema/common/string.js +16 -0
  261. package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
  262. package/node_modules/yaml/dist/schema/core/bool.js +21 -0
  263. package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
  264. package/node_modules/yaml/dist/schema/core/float.js +47 -0
  265. package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
  266. package/node_modules/yaml/dist/schema/core/int.js +42 -0
  267. package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
  268. package/node_modules/yaml/dist/schema/core/schema.js +25 -0
  269. package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
  270. package/node_modules/yaml/dist/schema/json/schema.js +64 -0
  271. package/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
  272. package/node_modules/yaml/dist/schema/tags.d.ts +48 -0
  273. package/node_modules/yaml/dist/schema/tags.js +99 -0
  274. package/node_modules/yaml/dist/schema/types.d.ts +92 -0
  275. package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
  276. package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
  277. package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
  278. package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
  279. package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
  280. package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
  281. package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
  282. package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
  283. package/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
  284. package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +71 -0
  285. package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
  286. package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
  287. package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
  288. package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
  289. package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
  290. package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
  291. package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
  292. package/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
  293. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
  294. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
  295. package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
  296. package/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
  297. package/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
  298. package/node_modules/yaml/dist/stringify/stringify.js +132 -0
  299. package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
  300. package/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
  301. package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
  302. package/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
  303. package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
  304. package/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
  305. package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
  306. package/node_modules/yaml/dist/stringify/stringifyNumber.js +27 -0
  307. package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
  308. package/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
  309. package/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
  310. package/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
  311. package/node_modules/yaml/dist/test-events.d.ts +4 -0
  312. package/node_modules/yaml/dist/test-events.js +134 -0
  313. package/node_modules/yaml/dist/util.d.ts +16 -0
  314. package/node_modules/yaml/dist/util.js +28 -0
  315. package/node_modules/yaml/dist/visit.d.ts +102 -0
  316. package/node_modules/yaml/dist/visit.js +236 -0
  317. package/node_modules/yaml/package.json +97 -0
  318. package/node_modules/yaml/util.js +2 -0
  319. package/package.json +12 -7
@@ -0,0 +1,363 @@
1
+ const operatorOptions = {
2
+ "": { prefix: "", separator: ",", named: false, ifEmpty: "", allowReserved: false },
3
+ "+": { prefix: "", separator: ",", named: false, ifEmpty: "", allowReserved: true },
4
+ "#": { prefix: "#", separator: ",", named: false, ifEmpty: "", allowReserved: true },
5
+ ".": { prefix: ".", separator: ".", named: false, ifEmpty: "", allowReserved: false },
6
+ "/": { prefix: "/", separator: "/", named: false, ifEmpty: "", allowReserved: false },
7
+ ";": { prefix: ";", separator: ";", named: true, ifEmpty: "", allowReserved: false },
8
+ "?": { prefix: "?", separator: "&", named: true, ifEmpty: "=", allowReserved: false },
9
+ "&": { prefix: "&", separator: "&", named: true, ifEmpty: "=", allowReserved: false }
10
+ };
11
+ const operators = new Set(["", "+", "#", ".", "/", ";", "?", "&"]);
12
+ const reservedCharacters = new Set(":/?#[]@!$&'()*+,;=".split(""));
13
+ class ParsedUriTemplate {
14
+ segments;
15
+ constructor(segments) {
16
+ this.segments = segments;
17
+ }
18
+ expand(variables) {
19
+ return this.segments
20
+ .map((segment) => segment.kind === "literal" ? segment.value : expandExpression(segment, variables))
21
+ .join("");
22
+ }
23
+ match(uri) {
24
+ return matchSegments(this.segments, uri, 0, 0, {});
25
+ }
26
+ }
27
+ export function parseUriTemplate(template) {
28
+ if (typeof template !== "string") {
29
+ throw new Error("URI template must be a string.");
30
+ }
31
+ const segments = [];
32
+ let literalStart = 0;
33
+ let index = 0;
34
+ while (index < template.length) {
35
+ const character = template[index];
36
+ if (character === "}") {
37
+ throw syntaxError(template, index, "unmatched closing brace");
38
+ }
39
+ if (character !== "{") {
40
+ index += 1;
41
+ continue;
42
+ }
43
+ if (index > literalStart) {
44
+ segments.push({ kind: "literal", value: template.slice(literalStart, index) });
45
+ }
46
+ const closeIndex = template.indexOf("}", index + 1);
47
+ if (closeIndex === -1) {
48
+ throw syntaxError(template, index, "unclosed expression");
49
+ }
50
+ const expression = template.slice(index + 1, closeIndex);
51
+ if (expression.includes("{")) {
52
+ throw syntaxError(template, index, "nested expression");
53
+ }
54
+ segments.push(parseExpression(template, expression, index));
55
+ index = closeIndex + 1;
56
+ literalStart = index;
57
+ }
58
+ if (literalStart < template.length) {
59
+ segments.push({ kind: "literal", value: template.slice(literalStart) });
60
+ }
61
+ if (segments.length === 0) {
62
+ segments.push({ kind: "literal", value: "" });
63
+ }
64
+ return new ParsedUriTemplate(segments);
65
+ }
66
+ function parseExpression(template, expression, offset) {
67
+ if (expression.length === 0) {
68
+ throw syntaxError(template, offset, "empty expression");
69
+ }
70
+ const first = expression[0];
71
+ const operator = operators.has(first) && first !== "" ? first : "";
72
+ const variableList = operator === "" ? expression : expression.slice(1);
73
+ if (variableList.length === 0) {
74
+ throw syntaxError(template, offset, "expression has no variables");
75
+ }
76
+ if (operator === "" && isReservedOperatorCharacter(first)) {
77
+ throw syntaxError(template, offset, `unsupported operator ${first}`);
78
+ }
79
+ const variables = variableList
80
+ .split(",")
81
+ .map((variable) => parseVariableSpec(template, variable, offset));
82
+ return { kind: "expression", operator, variables };
83
+ }
84
+ function parseVariableSpec(template, source, offset) {
85
+ if (source.length === 0) {
86
+ throw syntaxError(template, offset, "empty variable specification");
87
+ }
88
+ const explode = source.endsWith("*");
89
+ const withoutExplode = explode ? source.slice(0, -1) : source;
90
+ const colonIndex = withoutExplode.indexOf(":");
91
+ if (explode && colonIndex !== -1) {
92
+ throw syntaxError(template, offset, "explode and prefix modifiers cannot be combined");
93
+ }
94
+ const name = colonIndex === -1 ? withoutExplode : withoutExplode.slice(0, colonIndex);
95
+ if (!isValidVariableName(name)) {
96
+ throw syntaxError(template, offset, `invalid variable name ${name}`);
97
+ }
98
+ if (colonIndex === -1) {
99
+ return { name, explode };
100
+ }
101
+ const prefixSource = withoutExplode.slice(colonIndex + 1);
102
+ if (!isValidPrefix(prefixSource)) {
103
+ throw syntaxError(template, offset, `invalid prefix modifier ${prefixSource}`);
104
+ }
105
+ return { name, explode: false, prefixLength: Number(prefixSource) };
106
+ }
107
+ function isValidVariableName(name) {
108
+ if (name.length === 0) {
109
+ return false;
110
+ }
111
+ let componentLength = 0;
112
+ for (let index = 0; index < name.length; index += 1) {
113
+ const character = name[index];
114
+ if (character === ".") {
115
+ if (componentLength === 0)
116
+ return false;
117
+ componentLength = 0;
118
+ continue;
119
+ }
120
+ if (character === "%") {
121
+ if (!isHex(name[index + 1]) || !isHex(name[index + 2]))
122
+ return false;
123
+ index += 2;
124
+ componentLength += 1;
125
+ continue;
126
+ }
127
+ if (!isVariableCharacter(character))
128
+ return false;
129
+ componentLength += 1;
130
+ }
131
+ return componentLength > 0;
132
+ }
133
+ function isValidPrefix(value) {
134
+ if (value.length === 0 || value.length > 4 || value[0] === "0") {
135
+ return false;
136
+ }
137
+ return [...value].every((character) => character >= "0" && character <= "9");
138
+ }
139
+ function isReservedOperatorCharacter(character) {
140
+ return "=,!@|".includes(character);
141
+ }
142
+ function isVariableCharacter(character) {
143
+ return ((character >= "a" && character <= "z") ||
144
+ (character >= "A" && character <= "Z") ||
145
+ (character >= "0" && character <= "9") ||
146
+ character === "_");
147
+ }
148
+ function isHex(character) {
149
+ return (character !== undefined &&
150
+ ((character >= "0" && character <= "9") ||
151
+ (character >= "a" && character <= "f") ||
152
+ (character >= "A" && character <= "F")));
153
+ }
154
+ function syntaxError(template, index, detail) {
155
+ return new Error(`Invalid URI template at ${index}: ${detail} (${template})`);
156
+ }
157
+ function expandExpression(expression, variables) {
158
+ const options = operatorOptions[expression.operator];
159
+ const parts = [];
160
+ for (const variable of expression.variables) {
161
+ const value = variables[variable.name];
162
+ if (value === undefined || value === null) {
163
+ continue;
164
+ }
165
+ parts.push(...expandVariable(variable, value, options));
166
+ }
167
+ return parts.length === 0 ? "" : `${options.prefix}${parts.join(options.separator)}`;
168
+ }
169
+ function expandVariable(variable, value, options) {
170
+ if (Array.isArray(value)) {
171
+ if (variable.prefixLength !== undefined) {
172
+ throw new Error(`Prefix modifier requires a scalar value: ${variable.name}`);
173
+ }
174
+ return expandList(variable, value, options);
175
+ }
176
+ if (isRecord(value)) {
177
+ if (variable.prefixLength !== undefined) {
178
+ throw new Error(`Prefix modifier requires a scalar value: ${variable.name}`);
179
+ }
180
+ return expandAssociative(variable, value, options);
181
+ }
182
+ const original = String(value);
183
+ const scalar = variable.prefixLength === undefined
184
+ ? original
185
+ : [...original].slice(0, variable.prefixLength).join("");
186
+ const encoded = encodeValue(scalar, options.allowReserved);
187
+ return [namedValue(variable.name, encoded, options)];
188
+ }
189
+ function expandList(variable, value, options) {
190
+ if (value.length === 0) {
191
+ return [];
192
+ }
193
+ const encoded = value.map((item) => encodeValue(String(item), options.allowReserved));
194
+ if (!variable.explode) {
195
+ return [namedValue(variable.name, encoded.join(","), options)];
196
+ }
197
+ if (!options.named) {
198
+ return encoded;
199
+ }
200
+ return encoded.map((item) => namedValue(variable.name, item, options));
201
+ }
202
+ function expandAssociative(variable, value, options) {
203
+ const entries = Object.entries(value);
204
+ if (entries.length === 0) {
205
+ return [];
206
+ }
207
+ const encoded = entries.map(([key, item]) => [
208
+ encodeValue(key, options.allowReserved),
209
+ encodeValue(String(item), options.allowReserved)
210
+ ]);
211
+ if (!variable.explode) {
212
+ return [namedValue(variable.name, encoded.flat().join(","), options)];
213
+ }
214
+ return encoded.map(([key, item]) => `${key}=${item}`);
215
+ }
216
+ function namedValue(name, value, options) {
217
+ if (!options.named) {
218
+ return value;
219
+ }
220
+ const encodedName = encodeValue(name, true);
221
+ if (value.length === 0) {
222
+ return `${encodedName}${options.ifEmpty}`;
223
+ }
224
+ return `${encodedName}=${value}`;
225
+ }
226
+ function encodeValue(value, allowReserved) {
227
+ let result = "";
228
+ for (let index = 0; index < value.length; index += 1) {
229
+ const character = value[index];
230
+ if (allowReserved && character === "%" && isHex(value[index + 1]) && isHex(value[index + 2])) {
231
+ result += value.slice(index, index + 3);
232
+ index += 2;
233
+ continue;
234
+ }
235
+ const codePoint = value.codePointAt(index);
236
+ if (codePoint === undefined)
237
+ continue;
238
+ const scalar = String.fromCodePoint(codePoint);
239
+ if (scalar.length === 2)
240
+ index += 1;
241
+ if (isUnreserved(scalar) || (allowReserved && reservedCharacters.has(scalar))) {
242
+ result += scalar;
243
+ continue;
244
+ }
245
+ for (const byte of new TextEncoder().encode(scalar)) {
246
+ result += `%${byte.toString(16).toUpperCase().padStart(2, "0")}`;
247
+ }
248
+ }
249
+ return result;
250
+ }
251
+ function isUnreserved(character) {
252
+ return ((character >= "a" && character <= "z") ||
253
+ (character >= "A" && character <= "Z") ||
254
+ (character >= "0" && character <= "9") ||
255
+ "-._~".includes(character));
256
+ }
257
+ function isRecord(value) {
258
+ return typeof value === "object" && value !== null && !Array.isArray(value);
259
+ }
260
+ function matchSegments(segments, uri, segmentIndex, uriIndex, captures) {
261
+ if (segmentIndex === segments.length) {
262
+ return uriIndex === uri.length ? captures : null;
263
+ }
264
+ const segment = segments[segmentIndex];
265
+ if (segment.kind === "literal") {
266
+ return uri.startsWith(segment.value, uriIndex)
267
+ ? matchSegments(segments, uri, segmentIndex + 1, uriIndex + segment.value.length, captures)
268
+ : null;
269
+ }
270
+ for (const endIndex of candidateExpressionEnds(segments, uri, segmentIndex, uriIndex)) {
271
+ const expressionCaptures = matchExpression(segment, uri.slice(uriIndex, endIndex));
272
+ if (expressionCaptures === null)
273
+ continue;
274
+ const result = matchSegments(segments, uri, segmentIndex + 1, endIndex, {
275
+ ...captures,
276
+ ...expressionCaptures
277
+ });
278
+ if (result !== null)
279
+ return result;
280
+ }
281
+ return null;
282
+ }
283
+ function candidateExpressionEnds(segments, uri, segmentIndex, uriIndex) {
284
+ const next = segments[segmentIndex + 1];
285
+ if (next === undefined) {
286
+ return [uri.length];
287
+ }
288
+ const boundary = next.kind === "literal" ? next.value : operatorOptions[next.operator].prefix;
289
+ if (boundary.length === 0) {
290
+ return descendingRange(uriIndex, uri.length);
291
+ }
292
+ const indices = [];
293
+ let searchIndex = uri.length;
294
+ while (searchIndex >= uriIndex) {
295
+ const found = uri.lastIndexOf(boundary, searchIndex);
296
+ if (found < uriIndex)
297
+ break;
298
+ indices.push(found);
299
+ searchIndex = found - 1;
300
+ }
301
+ return indices;
302
+ }
303
+ function descendingRange(start, end) {
304
+ const values = [];
305
+ for (let value = end; value >= start; value -= 1)
306
+ values.push(value);
307
+ return values;
308
+ }
309
+ function matchExpression(expression, expansion) {
310
+ const options = operatorOptions[expression.operator];
311
+ if (expansion.length === 0) {
312
+ return {};
313
+ }
314
+ if (options.prefix.length > 0 && !expansion.startsWith(options.prefix)) {
315
+ return null;
316
+ }
317
+ const body = options.prefix.length === 0 ? expansion : expansion.slice(options.prefix.length);
318
+ if (options.named) {
319
+ return matchNamedExpression(expression.variables, body, options.separator);
320
+ }
321
+ return matchPositionalExpression(expression.variables, body, options.separator);
322
+ }
323
+ function matchNamedExpression(variables, body, separator) {
324
+ const captures = {};
325
+ const fields = body.length === 0 ? [] : body.split(separator);
326
+ for (const variable of variables) {
327
+ const encodedName = encodeValue(variable.name, true);
328
+ const values = [];
329
+ for (const field of fields) {
330
+ const equalsIndex = field.indexOf("=");
331
+ const key = equalsIndex === -1 ? field : field.slice(0, equalsIndex);
332
+ if (key === encodedName) {
333
+ values.push(equalsIndex === -1 ? "" : field.slice(equalsIndex + 1));
334
+ }
335
+ }
336
+ if (values.length > 0) {
337
+ captures[variable.name] = decodeValue(values.join(variable.explode ? "," : ""));
338
+ }
339
+ else if (variable.explode && variables.length === 1 && body.length > 0) {
340
+ captures[variable.name] = decodeValue(body);
341
+ }
342
+ }
343
+ return captures;
344
+ }
345
+ function matchPositionalExpression(variables, body, separator) {
346
+ if (variables.length === 1) {
347
+ return { [variables[0].name]: decodeValue(body) };
348
+ }
349
+ const captures = {};
350
+ const fields = body.split(separator);
351
+ for (let index = 0; index < variables.length && index < fields.length; index += 1) {
352
+ captures[variables[index].name] = decodeValue(index === variables.length - 1 ? fields.slice(index).join(separator) : fields[index]);
353
+ }
354
+ return captures;
355
+ }
356
+ function decodeValue(value) {
357
+ try {
358
+ return decodeURIComponent(value);
359
+ }
360
+ catch {
361
+ return value;
362
+ }
363
+ }
@@ -49,9 +49,5 @@
49
49
  ],
50
50
  "devDependencies": {
51
51
  "@modelcontextprotocol/sdk": "^1.25.3"
52
- },
53
- "dependencies": {
54
- "uri-template": "^2.0.0",
55
- "uri-template-lite": "^23.4.0"
56
52
  }
57
53
  }
@@ -21,11 +21,6 @@
21
21
  "dist",
22
22
  "LICENSE"
23
23
  ],
24
- "dependencies": {
25
- "fast-string-width": "^3.0.2",
26
- "fast-wrap-ansi": "^0.2.0",
27
- "sisteransi": "^1.0.5"
28
- },
29
24
  "exports": {
30
25
  ".": {
31
26
  "types": "./dist/index.d.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toolcraft-schema",
3
- "version": "0.0.116",
3
+ "version": "0.0.118",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -8,7 +8,8 @@
8
8
  "exports": {
9
9
  ".": {
10
10
  "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js"
11
+ "import": "./dist/index.js",
12
+ "default": "./dist/index.js"
12
13
  }
13
14
  },
14
15
  "scripts": {
@@ -0,0 +1,13 @@
1
+ Copyright Eemeli Aro <eemeli@gmail.com>
2
+
3
+ Permission to use, copy, modify, and/or distribute this software for any purpose
4
+ with or without fee is hereby granted, provided that the above copyright notice
5
+ and this permission notice appear in all copies.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
9
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
11
+ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
12
+ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
13
+ THIS SOFTWARE.
@@ -0,0 +1,172 @@
1
+ # YAML <a href="https://www.npmjs.com/package/yaml"><img align="right" src="https://badge.fury.io/js/yaml.svg" title="npm package" /></a>
2
+
3
+ `yaml` is a definitive library for [YAML](https://yaml.org/), the human friendly data serialization standard.
4
+ This library:
5
+
6
+ - Supports both YAML 1.1 and YAML 1.2 and all common data schemas,
7
+ - Passes all of the [yaml-test-suite](https://github.com/yaml/yaml-test-suite) tests,
8
+ - Can accept any string as input without throwing, parsing as much YAML out of it as it can, and
9
+ - Supports parsing, modifying, and writing YAML comments and blank lines.
10
+
11
+ The library is released under the ISC open source license, and the code is [available on GitHub](https://github.com/eemeli/yaml/).
12
+ It has no external dependencies and runs on Node.js as well as modern browsers.
13
+
14
+ For the purposes of versioning, any changes that break any of the documented endpoints or APIs will be considered semver-major breaking changes.
15
+ Undocumented library internals may change between minor versions, and previous APIs may be deprecated (but not removed).
16
+
17
+ The minimum supported TypeScript version of the included typings is 3.9;
18
+ for use in earlier versions you may need to set `skipLibCheck: true` in your config.
19
+ This requirement may be updated between minor versions of the library.
20
+
21
+ For more information, see the project's documentation site: [**eemeli.org/yaml**](https://eemeli.org/yaml/)
22
+
23
+ For build instructions and contribution guidelines, see [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md).
24
+
25
+ To install:
26
+
27
+ ```sh
28
+ npm install yaml
29
+ # or
30
+ deno add jsr:@eemeli/yaml
31
+ ```
32
+
33
+ **Note:** These docs are for `yaml@2`. For v1, see the [v1.10.0 tag](https://github.com/eemeli/yaml/tree/v1.10.0) for the source and [eemeli.org/yaml/v1](https://eemeli.org/yaml/v1/) for the documentation.
34
+
35
+ ## API Overview
36
+
37
+ The API provided by `yaml` has three layers, depending on how deep you need to go: [Parse & Stringify](https://eemeli.org/yaml/#parse-amp-stringify), [Documents](https://eemeli.org/yaml/#documents), and the underlying [Lexer/Parser/Composer](https://eemeli.org/yaml/#parsing-yaml).
38
+ The first has the simplest API and "just works", the second gets you all the bells and whistles supported by the library along with a decent [AST](https://eemeli.org/yaml/#content-nodes), and the third lets you get progressively closer to YAML source, if that's your thing.
39
+
40
+ A [command-line tool](https://eemeli.org/yaml/#command-line-tool) is also included.
41
+
42
+ ### Parse & Stringify
43
+
44
+ ```js
45
+ import { parse, stringify } from 'yaml'
46
+ ```
47
+
48
+ - [`parse(str, reviver?, options?): value`](https://eemeli.org/yaml/#yaml-parse)
49
+ - [`stringify(value, replacer?, options?): string`](https://eemeli.org/yaml/#yaml-stringify)
50
+
51
+ ### Documents
52
+
53
+ <!-- prettier-ignore -->
54
+ ```js
55
+ import {
56
+ Document,
57
+ isDocument,
58
+ parseAllDocuments,
59
+ parseDocument
60
+ } from 'yaml'
61
+ ```
62
+
63
+ - [`Document`](https://eemeli.org/yaml/#documents)
64
+ - [`constructor(value, replacer?, options?)`](https://eemeli.org/yaml/#creating-documents)
65
+ - [`#contents`](https://eemeli.org/yaml/#content-nodes)
66
+ - [`#directives`](https://eemeli.org/yaml/#stream-directives)
67
+ - [`#errors`](https://eemeli.org/yaml/#errors)
68
+ - [`#warnings`](https://eemeli.org/yaml/#errors)
69
+ - [`isDocument(foo): boolean`](https://eemeli.org/yaml/#identifying-node-types)
70
+ - [`parseAllDocuments(str, options?): Document[]`](https://eemeli.org/yaml/#parsing-documents)
71
+ - [`parseDocument(str, options?): Document`](https://eemeli.org/yaml/#parsing-documents)
72
+
73
+ ### Content Nodes
74
+
75
+ <!-- prettier-ignore -->
76
+ ```js
77
+ import {
78
+ isAlias, isCollection, isMap, isNode,
79
+ isPair, isScalar, isSeq, Scalar,
80
+ visit, visitAsync, YAMLMap, YAMLSeq
81
+ } from 'yaml'
82
+ ```
83
+
84
+ - [`isAlias(foo): boolean`](https://eemeli.org/yaml/#identifying-node-types)
85
+ - [`isCollection(foo): boolean`](https://eemeli.org/yaml/#identifying-node-types)
86
+ - [`isMap(foo): boolean`](https://eemeli.org/yaml/#identifying-node-types)
87
+ - [`isNode(foo): boolean`](https://eemeli.org/yaml/#identifying-node-types)
88
+ - [`isPair(foo): boolean`](https://eemeli.org/yaml/#identifying-node-types)
89
+ - [`isScalar(foo): boolean`](https://eemeli.org/yaml/#identifying-node-types)
90
+ - [`isSeq(foo): boolean`](https://eemeli.org/yaml/#identifying-node-types)
91
+ - [`new Scalar(value)`](https://eemeli.org/yaml/#scalar-values)
92
+ - [`new YAMLMap()`](https://eemeli.org/yaml/#collections)
93
+ - [`new YAMLSeq()`](https://eemeli.org/yaml/#collections)
94
+ - [`doc.createAlias(node, name?): Alias`](https://eemeli.org/yaml/#creating-nodes)
95
+ - [`doc.createNode(value, options?): Node`](https://eemeli.org/yaml/#creating-nodes)
96
+ - [`doc.createPair(key, value): Pair`](https://eemeli.org/yaml/#creating-nodes)
97
+ - [`visit(node, visitor)`](https://eemeli.org/yaml/#finding-and-modifying-nodes)
98
+ - [`visitAsync(node, visitor)`](https://eemeli.org/yaml/#finding-and-modifying-nodes)
99
+
100
+ ### Parsing YAML
101
+
102
+ ```js
103
+ import { Composer, Lexer, Parser } from 'yaml'
104
+ ```
105
+
106
+ - [`new Lexer().lex(src)`](https://eemeli.org/yaml/#lexer)
107
+ - [`new Parser(onNewLine?).parse(src)`](https://eemeli.org/yaml/#parser)
108
+ - [`new Composer(options?).compose(tokens)`](https://eemeli.org/yaml/#composer)
109
+
110
+ ## YAML.parse
111
+
112
+ ```yaml
113
+ # file.yml
114
+ YAML:
115
+ - A human-readable data serialization language
116
+ - https://en.wikipedia.org/wiki/YAML
117
+ yaml:
118
+ - A complete JavaScript implementation
119
+ - https://www.npmjs.com/package/yaml
120
+ ```
121
+
122
+ ```js
123
+ import fs from 'fs'
124
+ import YAML from 'yaml'
125
+
126
+ YAML.parse('3.14159')
127
+ // 3.14159
128
+
129
+ YAML.parse('[ true, false, maybe, null ]\n')
130
+ // [ true, false, 'maybe', null ]
131
+
132
+ const file = fs.readFileSync('./file.yml', 'utf8')
133
+ YAML.parse(file)
134
+ // { YAML:
135
+ // [ 'A human-readable data serialization language',
136
+ // 'https://en.wikipedia.org/wiki/YAML' ],
137
+ // yaml:
138
+ // [ 'A complete JavaScript implementation',
139
+ // 'https://www.npmjs.com/package/yaml' ] }
140
+ ```
141
+
142
+ ## YAML.stringify
143
+
144
+ ```js
145
+ import YAML from 'yaml'
146
+
147
+ YAML.stringify(3.14159)
148
+ // '3.14159\n'
149
+
150
+ YAML.stringify([true, false, 'maybe', null])
151
+ // `- true
152
+ // - false
153
+ // - maybe
154
+ // - null
155
+ // `
156
+
157
+ YAML.stringify({ number: 3, plain: 'string', block: 'two\nlines\n' })
158
+ // `number: 3
159
+ // plain: string
160
+ // block: |
161
+ // two
162
+ // lines
163
+ // `
164
+ ```
165
+
166
+ ---
167
+
168
+ Browser testing provided by:
169
+
170
+ <a href="https://www.browserstack.com/open-source">
171
+ <img width=200 src="https://eemeli.org/yaml/images/browserstack.svg" alt="BrowserStack" />
172
+ </a>
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { UserError, cli, help } from './dist/cli.mjs'
4
+
5
+ cli(process.stdin, error => {
6
+ if (error instanceof UserError) {
7
+ if (error.code === UserError.ARGS) console.error(`${help}\n`)
8
+ console.error(error.message)
9
+ process.exitCode = error.code
10
+ } else if (error) throw error
11
+ })