terminal-pilot 0.0.44 → 0.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (349) hide show
  1. package/dist/cli.js +134 -39
  2. package/dist/cli.js.map +4 -4
  3. package/dist/commands/close-session.js +36 -0
  4. package/dist/commands/close-session.js.map +3 -3
  5. package/dist/commands/create-session.js +36 -0
  6. package/dist/commands/create-session.js.map +3 -3
  7. package/dist/commands/daemon-runtime.js +36 -0
  8. package/dist/commands/daemon-runtime.js.map +3 -3
  9. package/dist/commands/fill.js +36 -0
  10. package/dist/commands/fill.js.map +3 -3
  11. package/dist/commands/get-session.js +36 -0
  12. package/dist/commands/get-session.js.map +3 -3
  13. package/dist/commands/index.js +36 -0
  14. package/dist/commands/index.js.map +3 -3
  15. package/dist/commands/install.js +36 -0
  16. package/dist/commands/install.js.map +3 -3
  17. package/dist/commands/installer.js +36 -0
  18. package/dist/commands/installer.js.map +3 -3
  19. package/dist/commands/list-sessions.js +36 -0
  20. package/dist/commands/list-sessions.js.map +3 -3
  21. package/dist/commands/press-key.js +36 -0
  22. package/dist/commands/press-key.js.map +3 -3
  23. package/dist/commands/read-history.js +36 -0
  24. package/dist/commands/read-history.js.map +3 -3
  25. package/dist/commands/read-screen.js +36 -0
  26. package/dist/commands/read-screen.js.map +3 -3
  27. package/dist/commands/resize.js +36 -0
  28. package/dist/commands/resize.js.map +3 -3
  29. package/dist/commands/runtime.js +36 -0
  30. package/dist/commands/runtime.js.map +3 -3
  31. package/dist/commands/screenshot.js +36 -0
  32. package/dist/commands/screenshot.js.map +3 -3
  33. package/dist/commands/send-signal.js +36 -0
  34. package/dist/commands/send-signal.js.map +3 -3
  35. package/dist/commands/type.js +36 -0
  36. package/dist/commands/type.js.map +3 -3
  37. package/dist/commands/uninstall.js +36 -0
  38. package/dist/commands/uninstall.js.map +3 -3
  39. package/dist/commands/wait-for-exit.js +36 -0
  40. package/dist/commands/wait-for-exit.js.map +3 -3
  41. package/dist/commands/wait-for.js +36 -0
  42. package/dist/commands/wait-for.js.map +3 -3
  43. package/dist/composition.json +36 -1
  44. package/dist/testing/cli-repl.js +134 -39
  45. package/dist/testing/cli-repl.js.map +4 -4
  46. package/dist/testing/qa-cli.js +134 -39
  47. package/dist/testing/qa-cli.js.map +4 -4
  48. package/node_modules/@poe-code/config-mutations/package.json +0 -5
  49. package/node_modules/@poe-code/frontmatter/package.json +0 -3
  50. package/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
  51. package/node_modules/fast-string-truncated-width/dist/index.js +111 -0
  52. package/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
  53. package/node_modules/fast-string-truncated-width/dist/types.js +2 -0
  54. package/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
  55. package/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
  56. package/node_modules/fast-string-truncated-width/license +21 -0
  57. package/node_modules/fast-string-truncated-width/package.json +35 -0
  58. package/node_modules/fast-string-truncated-width/readme.md +59 -0
  59. package/node_modules/fast-string-width/dist/index.d.ts +4 -0
  60. package/node_modules/fast-string-width/dist/index.js +14 -0
  61. package/node_modules/fast-string-width/license +21 -0
  62. package/node_modules/fast-string-width/package.json +34 -0
  63. package/node_modules/fast-string-width/readme.md +42 -0
  64. package/node_modules/fast-wrap-ansi/LICENSE +23 -0
  65. package/node_modules/fast-wrap-ansi/README.md +26 -0
  66. package/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
  67. package/node_modules/fast-wrap-ansi/lib/main.js +218 -0
  68. package/node_modules/fast-wrap-ansi/package.json +51 -0
  69. package/node_modules/jsonc-parser/CHANGELOG.md +76 -0
  70. package/node_modules/jsonc-parser/LICENSE.md +21 -0
  71. package/node_modules/jsonc-parser/README.md +364 -0
  72. package/node_modules/jsonc-parser/SECURITY.md +41 -0
  73. package/node_modules/jsonc-parser/lib/esm/impl/edit.js +185 -0
  74. package/node_modules/jsonc-parser/lib/esm/impl/format.js +261 -0
  75. package/node_modules/jsonc-parser/lib/esm/impl/parser.js +659 -0
  76. package/node_modules/jsonc-parser/lib/esm/impl/scanner.js +443 -0
  77. package/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +29 -0
  78. package/node_modules/jsonc-parser/lib/esm/main.d.ts +351 -0
  79. package/node_modules/jsonc-parser/lib/esm/main.js +178 -0
  80. package/node_modules/jsonc-parser/lib/umd/impl/edit.js +201 -0
  81. package/node_modules/jsonc-parser/lib/umd/impl/format.js +275 -0
  82. package/node_modules/jsonc-parser/lib/umd/impl/parser.js +682 -0
  83. package/node_modules/jsonc-parser/lib/umd/impl/scanner.js +456 -0
  84. package/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +42 -0
  85. package/node_modules/jsonc-parser/lib/umd/main.d.ts +351 -0
  86. package/node_modules/jsonc-parser/lib/umd/main.js +194 -0
  87. package/node_modules/jsonc-parser/package.json +37 -0
  88. package/node_modules/sisteransi/license +21 -0
  89. package/node_modules/sisteransi/package.json +34 -0
  90. package/node_modules/sisteransi/readme.md +113 -0
  91. package/node_modules/sisteransi/src/index.js +58 -0
  92. package/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
  93. package/node_modules/smol-toml/LICENSE +24 -0
  94. package/node_modules/smol-toml/README.md +239 -0
  95. package/node_modules/smol-toml/dist/date.d.ts +41 -0
  96. package/node_modules/smol-toml/dist/date.js +127 -0
  97. package/node_modules/smol-toml/dist/error.d.ts +38 -0
  98. package/node_modules/smol-toml/dist/error.js +63 -0
  99. package/node_modules/smol-toml/dist/extract.d.ts +30 -0
  100. package/node_modules/smol-toml/dist/extract.js +100 -0
  101. package/node_modules/smol-toml/dist/index.cjs +897 -0
  102. package/node_modules/smol-toml/dist/index.d.ts +43 -0
  103. package/node_modules/smol-toml/dist/index.js +33 -0
  104. package/node_modules/smol-toml/dist/parse.d.ts +37 -0
  105. package/node_modules/smol-toml/dist/parse.js +148 -0
  106. package/node_modules/smol-toml/dist/primitive.d.ts +31 -0
  107. package/node_modules/smol-toml/dist/primitive.js +179 -0
  108. package/node_modules/smol-toml/dist/stringify.d.ts +31 -0
  109. package/node_modules/smol-toml/dist/stringify.js +167 -0
  110. package/node_modules/smol-toml/dist/struct.d.ts +32 -0
  111. package/node_modules/smol-toml/dist/struct.js +184 -0
  112. package/node_modules/smol-toml/dist/util.d.ts +42 -0
  113. package/node_modules/smol-toml/dist/util.js +111 -0
  114. package/node_modules/smol-toml/package.json +54 -0
  115. package/node_modules/toolcraft-design/package.json +0 -5
  116. package/node_modules/yaml/LICENSE +13 -0
  117. package/node_modules/yaml/README.md +172 -0
  118. package/node_modules/yaml/bin.mjs +11 -0
  119. package/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
  120. package/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
  121. package/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
  122. package/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
  123. package/node_modules/yaml/browser/dist/compose/composer.js +219 -0
  124. package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
  125. package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
  126. package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
  127. package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
  128. package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
  129. package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +225 -0
  130. package/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
  131. package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
  132. package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
  133. package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
  134. package/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
  135. package/node_modules/yaml/browser/dist/doc/Document.js +335 -0
  136. package/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
  137. package/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
  138. package/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
  139. package/node_modules/yaml/browser/dist/doc/directives.js +176 -0
  140. package/node_modules/yaml/browser/dist/errors.js +57 -0
  141. package/node_modules/yaml/browser/dist/index.js +17 -0
  142. package/node_modules/yaml/browser/dist/log.js +11 -0
  143. package/node_modules/yaml/browser/dist/nodes/Alias.js +116 -0
  144. package/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
  145. package/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
  146. package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
  147. package/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
  148. package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
  149. package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
  150. package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
  151. package/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
  152. package/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
  153. package/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
  154. package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
  155. package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
  156. package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
  157. package/node_modules/yaml/browser/dist/parse/lexer.js +721 -0
  158. package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
  159. package/node_modules/yaml/browser/dist/parse/parser.js +975 -0
  160. package/node_modules/yaml/browser/dist/public-api.js +102 -0
  161. package/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
  162. package/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
  163. package/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
  164. package/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
  165. package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
  166. package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
  167. package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
  168. package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
  169. package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
  170. package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
  171. package/node_modules/yaml/browser/dist/schema/tags.js +96 -0
  172. package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
  173. package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
  174. package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
  175. package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
  176. package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +67 -0
  177. package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
  178. package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
  179. package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
  180. package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
  181. package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
  182. package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
  183. package/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
  184. package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
  185. package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
  186. package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
  187. package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +25 -0
  188. package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
  189. package/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
  190. package/node_modules/yaml/browser/dist/util.js +11 -0
  191. package/node_modules/yaml/browser/dist/visit.js +233 -0
  192. package/node_modules/yaml/browser/index.js +5 -0
  193. package/node_modules/yaml/browser/package.json +3 -0
  194. package/node_modules/yaml/dist/cli.d.ts +8 -0
  195. package/node_modules/yaml/dist/cli.mjs +201 -0
  196. package/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
  197. package/node_modules/yaml/dist/compose/compose-collection.js +90 -0
  198. package/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
  199. package/node_modules/yaml/dist/compose/compose-doc.js +45 -0
  200. package/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
  201. package/node_modules/yaml/dist/compose/compose-node.js +112 -0
  202. package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
  203. package/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
  204. package/node_modules/yaml/dist/compose/composer.d.ts +63 -0
  205. package/node_modules/yaml/dist/compose/composer.js +224 -0
  206. package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
  207. package/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
  208. package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
  209. package/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
  210. package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
  211. package/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
  212. package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
  213. package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
  214. package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
  215. package/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
  216. package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
  217. package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +227 -0
  218. package/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
  219. package/node_modules/yaml/dist/compose/resolve-props.js +148 -0
  220. package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
  221. package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
  222. package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
  223. package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
  224. package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
  225. package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
  226. package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
  227. package/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
  228. package/node_modules/yaml/dist/doc/Document.d.ts +141 -0
  229. package/node_modules/yaml/dist/doc/Document.js +337 -0
  230. package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
  231. package/node_modules/yaml/dist/doc/anchors.js +76 -0
  232. package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
  233. package/node_modules/yaml/dist/doc/applyReviver.js +57 -0
  234. package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
  235. package/node_modules/yaml/dist/doc/createNode.js +90 -0
  236. package/node_modules/yaml/dist/doc/directives.d.ts +49 -0
  237. package/node_modules/yaml/dist/doc/directives.js +178 -0
  238. package/node_modules/yaml/dist/errors.d.ts +21 -0
  239. package/node_modules/yaml/dist/errors.js +62 -0
  240. package/node_modules/yaml/dist/index.d.ts +25 -0
  241. package/node_modules/yaml/dist/index.js +50 -0
  242. package/node_modules/yaml/dist/log.d.ts +3 -0
  243. package/node_modules/yaml/dist/log.js +19 -0
  244. package/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
  245. package/node_modules/yaml/dist/nodes/Alias.js +118 -0
  246. package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
  247. package/node_modules/yaml/dist/nodes/Collection.js +151 -0
  248. package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
  249. package/node_modules/yaml/dist/nodes/Node.js +40 -0
  250. package/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
  251. package/node_modules/yaml/dist/nodes/Pair.js +39 -0
  252. package/node_modules/yaml/dist/nodes/Scalar.d.ts +47 -0
  253. package/node_modules/yaml/dist/nodes/Scalar.js +27 -0
  254. package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
  255. package/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
  256. package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
  257. package/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
  258. package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
  259. package/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
  260. package/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
  261. package/node_modules/yaml/dist/nodes/identity.js +53 -0
  262. package/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
  263. package/node_modules/yaml/dist/nodes/toJS.js +39 -0
  264. package/node_modules/yaml/dist/options.d.ts +350 -0
  265. package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
  266. package/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
  267. package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
  268. package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
  269. package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
  270. package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
  271. package/node_modules/yaml/dist/parse/cst.d.ts +109 -0
  272. package/node_modules/yaml/dist/parse/cst.js +112 -0
  273. package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
  274. package/node_modules/yaml/dist/parse/lexer.js +723 -0
  275. package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
  276. package/node_modules/yaml/dist/parse/line-counter.js +41 -0
  277. package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
  278. package/node_modules/yaml/dist/parse/parser.js +980 -0
  279. package/node_modules/yaml/dist/public-api.d.ts +44 -0
  280. package/node_modules/yaml/dist/public-api.js +107 -0
  281. package/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
  282. package/node_modules/yaml/dist/schema/Schema.js +39 -0
  283. package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
  284. package/node_modules/yaml/dist/schema/common/map.js +19 -0
  285. package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
  286. package/node_modules/yaml/dist/schema/common/null.js +17 -0
  287. package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
  288. package/node_modules/yaml/dist/schema/common/seq.js +19 -0
  289. package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
  290. package/node_modules/yaml/dist/schema/common/string.js +16 -0
  291. package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
  292. package/node_modules/yaml/dist/schema/core/bool.js +21 -0
  293. package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
  294. package/node_modules/yaml/dist/schema/core/float.js +47 -0
  295. package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
  296. package/node_modules/yaml/dist/schema/core/int.js +42 -0
  297. package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
  298. package/node_modules/yaml/dist/schema/core/schema.js +25 -0
  299. package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
  300. package/node_modules/yaml/dist/schema/json/schema.js +64 -0
  301. package/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
  302. package/node_modules/yaml/dist/schema/tags.d.ts +48 -0
  303. package/node_modules/yaml/dist/schema/tags.js +99 -0
  304. package/node_modules/yaml/dist/schema/types.d.ts +92 -0
  305. package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
  306. package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
  307. package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
  308. package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
  309. package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
  310. package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
  311. package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
  312. package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
  313. package/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
  314. package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +71 -0
  315. package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
  316. package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
  317. package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
  318. package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
  319. package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
  320. package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
  321. package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
  322. package/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
  323. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
  324. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
  325. package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
  326. package/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
  327. package/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
  328. package/node_modules/yaml/dist/stringify/stringify.js +132 -0
  329. package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
  330. package/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
  331. package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
  332. package/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
  333. package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
  334. package/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
  335. package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
  336. package/node_modules/yaml/dist/stringify/stringifyNumber.js +27 -0
  337. package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
  338. package/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
  339. package/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
  340. package/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
  341. package/node_modules/yaml/dist/test-events.d.ts +4 -0
  342. package/node_modules/yaml/dist/test-events.js +134 -0
  343. package/node_modules/yaml/dist/util.d.ts +16 -0
  344. package/node_modules/yaml/dist/util.js +28 -0
  345. package/node_modules/yaml/dist/visit.d.ts +102 -0
  346. package/node_modules/yaml/dist/visit.js +236 -0
  347. package/node_modules/yaml/package.json +97 -0
  348. package/node_modules/yaml/util.js +2 -0
  349. package/package.json +10 -4
@@ -0,0 +1,32 @@
1
+ /*!
2
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * 1. Redistributions of source code must retain the above copyright notice, this
9
+ * list of conditions and the following disclaimer.
10
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ * this list of conditions and the following disclaimer in the
12
+ * documentation and/or other materials provided with the distribution.
13
+ * 3. Neither the name of the copyright holder nor the names of its contributors
14
+ * may be used to endorse or promote products derived from this software without
15
+ * specific prior written permission.
16
+ *
17
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+ import { type IntegersAsBigInt } from './primitive.js';
29
+ import { type TomlTable, type TomlValue } from './util.js';
30
+ export declare function parseKey(str: string, ptr: number, end?: string): [string[], number];
31
+ export declare function parseInlineTable(str: string, ptr: number, depth: number, integersAsBigInt: IntegersAsBigInt): [TomlTable, number];
32
+ export declare function parseArray(str: string, ptr: number, depth: number, integersAsBigInt: IntegersAsBigInt): [TomlValue[], number];
@@ -0,0 +1,184 @@
1
+ /*!
2
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * 1. Redistributions of source code must retain the above copyright notice, this
9
+ * list of conditions and the following disclaimer.
10
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ * this list of conditions and the following disclaimer in the
12
+ * documentation and/or other materials provided with the distribution.
13
+ * 3. Neither the name of the copyright holder nor the names of its contributors
14
+ * may be used to endorse or promote products derived from this software without
15
+ * specific prior written permission.
16
+ *
17
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+ import { parseString } from './primitive.js';
29
+ import { extractValue } from './extract.js';
30
+ import { getStringEnd, indexOfNewline, skipComment, skipVoid } from './util.js';
31
+ import { TomlError } from './error.js';
32
+ let KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
33
+ export function parseKey(str, ptr, end = '=') {
34
+ let dot = ptr - 1;
35
+ let parsed = [];
36
+ let endPtr = str.indexOf(end, ptr);
37
+ if (endPtr < 0) {
38
+ throw new TomlError('incomplete key-value: cannot find end of key', {
39
+ toml: str,
40
+ ptr: ptr,
41
+ });
42
+ }
43
+ do {
44
+ let c = str[ptr = ++dot];
45
+ // If it's whitespace, ignore
46
+ if (c !== ' ' && c !== '\t') {
47
+ // If it's a string
48
+ if (c === '"' || c === '\'') {
49
+ if (c === str[ptr + 1] && c === str[ptr + 2]) {
50
+ throw new TomlError('multiline strings are not allowed in keys', {
51
+ toml: str,
52
+ ptr: ptr,
53
+ });
54
+ }
55
+ let eos = getStringEnd(str, ptr);
56
+ if (eos < 0) {
57
+ throw new TomlError('unfinished string encountered', {
58
+ toml: str,
59
+ ptr: ptr,
60
+ });
61
+ }
62
+ dot = str.indexOf('.', eos);
63
+ let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot);
64
+ let newLine = indexOfNewline(strEnd);
65
+ if (newLine > -1) {
66
+ throw new TomlError('newlines are not allowed in keys', {
67
+ toml: str,
68
+ ptr: ptr + dot + newLine,
69
+ });
70
+ }
71
+ if (strEnd.trimStart()) {
72
+ throw new TomlError('found extra tokens after the string part', {
73
+ toml: str,
74
+ ptr: eos,
75
+ });
76
+ }
77
+ if (endPtr < eos) {
78
+ endPtr = str.indexOf(end, eos);
79
+ if (endPtr < 0) {
80
+ throw new TomlError('incomplete key-value: cannot find end of key', {
81
+ toml: str,
82
+ ptr: ptr,
83
+ });
84
+ }
85
+ }
86
+ parsed.push(parseString(str, ptr, eos));
87
+ }
88
+ else {
89
+ // Normal raw key part consumption and validation
90
+ dot = str.indexOf('.', ptr);
91
+ let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot);
92
+ if (!KEY_PART_RE.test(part)) {
93
+ throw new TomlError('only letter, numbers, dashes and underscores are allowed in keys', {
94
+ toml: str,
95
+ ptr: ptr,
96
+ });
97
+ }
98
+ parsed.push(part.trimEnd());
99
+ }
100
+ }
101
+ // Until there's no more dot
102
+ } while (dot + 1 && dot < endPtr);
103
+ return [parsed, skipVoid(str, endPtr + 1, true, true)];
104
+ }
105
+ export function parseInlineTable(str, ptr, depth, integersAsBigInt) {
106
+ let res = {};
107
+ let seen = new Set();
108
+ let c;
109
+ ptr++;
110
+ while ((c = str[ptr++]) !== '}' && c) {
111
+ if (c === ',') {
112
+ throw new TomlError('expected value, found comma', {
113
+ toml: str,
114
+ ptr: ptr - 1,
115
+ });
116
+ }
117
+ else if (c === '#')
118
+ ptr = skipComment(str, ptr);
119
+ else if (c !== ' ' && c !== '\t' && c !== '\n' && c !== '\r') {
120
+ let k;
121
+ let t = res;
122
+ let hasOwn = false;
123
+ let [key, keyEndPtr] = parseKey(str, ptr - 1);
124
+ for (let i = 0; i < key.length; i++) {
125
+ if (i)
126
+ t = hasOwn ? t[k] : (t[k] = {});
127
+ k = key[i];
128
+ if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== 'object' || seen.has(t[k]))) {
129
+ throw new TomlError('trying to redefine an already defined value', {
130
+ toml: str,
131
+ ptr: ptr,
132
+ });
133
+ }
134
+ if (!hasOwn && k === '__proto__') {
135
+ Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
136
+ }
137
+ }
138
+ if (hasOwn) {
139
+ throw new TomlError('trying to redefine an already defined value', {
140
+ toml: str,
141
+ ptr: ptr,
142
+ });
143
+ }
144
+ let [value, valueEndPtr] = extractValue(str, keyEndPtr, '}', depth - 1, integersAsBigInt);
145
+ seen.add(value);
146
+ t[k] = value;
147
+ ptr = valueEndPtr;
148
+ }
149
+ }
150
+ if (!c) {
151
+ throw new TomlError('unfinished table encountered', {
152
+ toml: str,
153
+ ptr: ptr,
154
+ });
155
+ }
156
+ return [res, ptr];
157
+ }
158
+ export function parseArray(str, ptr, depth, integersAsBigInt) {
159
+ let res = [];
160
+ let c;
161
+ ptr++;
162
+ while ((c = str[ptr++]) !== ']' && c) {
163
+ if (c === ',') {
164
+ throw new TomlError('expected value, found comma', {
165
+ toml: str,
166
+ ptr: ptr - 1,
167
+ });
168
+ }
169
+ else if (c === '#')
170
+ ptr = skipComment(str, ptr);
171
+ else if (c !== ' ' && c !== '\t' && c !== '\n' && c !== '\r') {
172
+ let e = extractValue(str, ptr - 1, ']', depth - 1, integersAsBigInt);
173
+ res.push(e[0]);
174
+ ptr = e[1];
175
+ }
176
+ }
177
+ if (!c) {
178
+ throw new TomlError('unfinished array encountered', {
179
+ toml: str,
180
+ ptr: ptr,
181
+ });
182
+ }
183
+ return [res, ptr];
184
+ }
@@ -0,0 +1,42 @@
1
+ /*!
2
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * 1. Redistributions of source code must retain the above copyright notice, this
9
+ * list of conditions and the following disclaimer.
10
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ * this list of conditions and the following disclaimer in the
12
+ * documentation and/or other materials provided with the distribution.
13
+ * 3. Neither the name of the copyright holder nor the names of its contributors
14
+ * may be used to endorse or promote products derived from this software without
15
+ * specific prior written permission.
16
+ *
17
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+ import type { TomlDate } from './date.js';
29
+ export type TomlPrimitive = string | number | bigint | boolean | TomlDate;
30
+ export type TomlTable = {
31
+ [key: string]: TomlValue;
32
+ };
33
+ export type TomlValue = TomlPrimitive | TomlValue[] | TomlTable;
34
+ export type TomlTableWithoutBigInt = {
35
+ [key: string]: TomlValueWithoutBigInt;
36
+ };
37
+ export type TomlValueWithoutBigInt = Exclude<TomlPrimitive, bigint> | TomlValueWithoutBigInt[] | TomlTableWithoutBigInt;
38
+ export declare function indexOfNewline(str: string, start?: number, end?: number): number;
39
+ export declare function skipComment(str: string, ptr: number): number;
40
+ export declare function skipVoid(str: string, ptr: number, banNewLines?: boolean, banComments?: boolean): number;
41
+ export declare function skipUntil(str: string, ptr: number, sep: string, end?: string, banNewLines?: boolean): number;
42
+ export declare function getStringEnd(str: string, seek: number): number;
@@ -0,0 +1,111 @@
1
+ /*!
2
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * 1. Redistributions of source code must retain the above copyright notice, this
9
+ * list of conditions and the following disclaimer.
10
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ * this list of conditions and the following disclaimer in the
12
+ * documentation and/or other materials provided with the distribution.
13
+ * 3. Neither the name of the copyright holder nor the names of its contributors
14
+ * may be used to endorse or promote products derived from this software without
15
+ * specific prior written permission.
16
+ *
17
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+ import { TomlError } from './error.js';
29
+ function isEscaped(str, ptr) {
30
+ let i = 0;
31
+ while (str[ptr - ++i] === '\\')
32
+ ;
33
+ return --i && (i % 2);
34
+ }
35
+ export function indexOfNewline(str, start = 0, end = str.length) {
36
+ let idx = str.indexOf('\n', start);
37
+ if (str[idx - 1] === '\r')
38
+ idx--;
39
+ return idx <= end ? idx : -1;
40
+ }
41
+ export function skipComment(str, ptr) {
42
+ for (let i = ptr; i < str.length; i++) {
43
+ let c = str[i];
44
+ if (c === '\n')
45
+ return i;
46
+ if (c === '\r' && str[i + 1] === '\n')
47
+ return i + 1;
48
+ if ((c < '\x20' && c !== '\t') || c === '\x7f') {
49
+ throw new TomlError('control characters are not allowed in comments', {
50
+ toml: str,
51
+ ptr: ptr,
52
+ });
53
+ }
54
+ }
55
+ return str.length;
56
+ }
57
+ export function skipVoid(str, ptr, banNewLines, banComments) {
58
+ let c;
59
+ while (1) {
60
+ while ((c = str[ptr]) === ' ' || c === '\t' || (!banNewLines && (c === '\n' || c === '\r' && str[ptr + 1] === '\n')))
61
+ ptr++;
62
+ // Tucking the return statement here would save 5 characters >:)
63
+ // But TypeScript fails to detect there is no way to exit the loop so it complains about the lack of final return
64
+ if (banComments || c !== '#')
65
+ break;
66
+ ptr = skipComment(str, ptr);
67
+ }
68
+ return ptr;
69
+ }
70
+ export function skipUntil(str, ptr, sep, end, banNewLines = false) {
71
+ if (!end) {
72
+ ptr = indexOfNewline(str, ptr);
73
+ return ptr < 0 ? str.length : ptr;
74
+ }
75
+ for (let i = ptr; i < str.length; i++) {
76
+ let c = str[i];
77
+ if (c === '#') {
78
+ i = indexOfNewline(str, i);
79
+ }
80
+ else if (c === sep) {
81
+ return i + 1;
82
+ }
83
+ else if (c === end || (banNewLines && (c === '\n' || (c === '\r' && str[i + 1] === '\n')))) {
84
+ return i;
85
+ }
86
+ }
87
+ throw new TomlError('cannot find end of structure', {
88
+ toml: str,
89
+ ptr: ptr
90
+ });
91
+ }
92
+ export function getStringEnd(str, seek) {
93
+ let first = str[seek];
94
+ let target = first === str[seek + 1] && str[seek + 1] === str[seek + 2]
95
+ ? str.slice(seek, seek + 3)
96
+ : first;
97
+ seek += target.length - 1;
98
+ do
99
+ seek = str.indexOf(target, ++seek);
100
+ while (seek > -1 && first !== "'" && isEscaped(str, seek));
101
+ if (seek > -1) {
102
+ seek += target.length;
103
+ if (target.length > 1) {
104
+ if (str[seek] === first)
105
+ seek++;
106
+ if (str[seek] === first)
107
+ seek++;
108
+ }
109
+ }
110
+ return seek;
111
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "smol-toml",
3
+ "license": "BSD-3-Clause",
4
+ "version": "1.6.1",
5
+ "description": "A small, fast, and correct TOML parser/serializer",
6
+ "author": "Cynthia <cyyynthia@borkenware.com>",
7
+ "repository": "github:squirrelchat/smol-toml",
8
+ "bugs": "https://github.com/squirrelchat/smol-toml/issues",
9
+ "funding": "https://github.com/sponsors/cyyynthia",
10
+ "keywords": [
11
+ "toml",
12
+ "parser",
13
+ "serializer"
14
+ ],
15
+ "type": "module",
16
+ "engines": {
17
+ "node": ">= 18"
18
+ },
19
+ "devDependencies": {
20
+ "@iarna/toml": "3.0.0",
21
+ "@ltd/j-toml": "^1.38.0",
22
+ "@tsconfig/node-lts": "^24.0.0",
23
+ "@tsconfig/strictest": "^2.0.8",
24
+ "@types/node": "^25.5.0",
25
+ "@vitest/ui": "^4.1.1",
26
+ "esbuild": "^0.27.4",
27
+ "fast-toml": "^0.5.4",
28
+ "pin-github-action": "^3.4.0",
29
+ "typescript": "^5.9.3",
30
+ "vitest": "^4.1.1"
31
+ },
32
+ "main": "./dist/index.cjs",
33
+ "module": "./dist/index.js",
34
+ "types": "./dist/index.d.ts",
35
+ "exports": {
36
+ "types": "./dist/index.d.ts",
37
+ "import": "./dist/index.js",
38
+ "require": "./dist/index.cjs"
39
+ },
40
+ "files": [
41
+ "README.md",
42
+ "LICENSE",
43
+ "dist"
44
+ ],
45
+ "scripts": {
46
+ "test": "vitest",
47
+ "test-ui": "vitest --ui",
48
+ "bench": "vitest bench",
49
+ "build": "pnpm run build:mjs && pnpm run build:cjs && node test/package/package-test.mjs",
50
+ "build:mjs": "tsc",
51
+ "build:cjs": "esbuild dist/index.js --bundle --platform=node --target=node18 --format=cjs --outfile=dist/index.cjs",
52
+ "update-gha": "pin-github-action .github/workflows"
53
+ }
54
+ }
@@ -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",
@@ -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
+ })