@dev-sergeev/datalab-kit 0.1.2 → 0.1.4

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 (355) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +23 -5
  3. package/THIRD_PARTY_NOTICES.md +6 -2
  4. package/docs/adr/0001-user-settings-priority.md +2 -0
  5. package/docs/adr/0002-package-delivery.md +8 -0
  6. package/node_modules/@pi-plugins/elapsed/LICENSE +21 -0
  7. package/node_modules/@pi-plugins/elapsed/README.md +45 -0
  8. package/node_modules/@pi-plugins/elapsed/dist/index.d.mts +8 -0
  9. package/node_modules/@pi-plugins/elapsed/dist/index.d.mts.map +1 -0
  10. package/node_modules/@pi-plugins/elapsed/dist/index.mjs +47 -0
  11. package/node_modules/@pi-plugins/elapsed/dist/index.mjs.map +1 -0
  12. package/node_modules/@pi-plugins/elapsed/package.json +65 -0
  13. package/node_modules/@tifan/pi-recap/README.md +61 -0
  14. package/node_modules/@tifan/pi-recap/package.json +43 -0
  15. package/node_modules/@tifan/pi-recap/src/index.ts +586 -0
  16. package/node_modules/@tifan/pi-recap/src/model-picker.ts +234 -0
  17. package/node_modules/@tifan/pi-recap/src/models.ts +180 -0
  18. package/node_modules/@tifan/pi-recap/src/sanitize.ts +119 -0
  19. package/node_modules/@tifan/pi-recap/src/tui.ts +155 -0
  20. package/node_modules/@zigai/pi-extension-internals/README.md +24 -0
  21. package/node_modules/@zigai/pi-extension-internals/dist/editor-enhancer-registry.d.ts +21 -0
  22. package/node_modules/@zigai/pi-extension-internals/dist/editor-enhancer-registry.js +233 -0
  23. package/node_modules/@zigai/pi-extension-internals/dist/index.d.ts +6 -0
  24. package/node_modules/@zigai/pi-extension-internals/dist/index.js +3 -0
  25. package/node_modules/@zigai/pi-extension-internals/dist/linked-method-patch.d.ts +34 -0
  26. package/node_modules/@zigai/pi-extension-internals/dist/linked-method-patch.js +272 -0
  27. package/node_modules/@zigai/pi-extension-internals/dist/pi-internal-import.d.ts +11 -0
  28. package/node_modules/@zigai/pi-extension-internals/dist/pi-internal-import.js +139 -0
  29. package/node_modules/@zigai/pi-extension-internals/package.json +41 -0
  30. package/node_modules/@zigai/pi-extension-settings/LICENSE +21 -0
  31. package/node_modules/@zigai/pi-extension-settings/README.md +36 -0
  32. package/node_modules/@zigai/pi-extension-settings/dist/artifacts.d.ts +23 -0
  33. package/node_modules/@zigai/pi-extension-settings/dist/artifacts.d.ts.map +1 -0
  34. package/node_modules/@zigai/pi-extension-settings/dist/artifacts.js +75 -0
  35. package/node_modules/@zigai/pi-extension-settings/dist/artifacts.js.map +1 -0
  36. package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.d.ts +3 -0
  37. package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.d.ts.map +1 -0
  38. package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.js +5 -0
  39. package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.js.map +1 -0
  40. package/node_modules/@zigai/pi-extension-settings/dist/cli.d.ts +6 -0
  41. package/node_modules/@zigai/pi-extension-settings/dist/cli.d.ts.map +1 -0
  42. package/node_modules/@zigai/pi-extension-settings/dist/cli.js +87 -0
  43. package/node_modules/@zigai/pi-extension-settings/dist/cli.js.map +1 -0
  44. package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.d.ts +2 -0
  45. package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.d.ts.map +1 -0
  46. package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.js +2 -0
  47. package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.js.map +1 -0
  48. package/node_modules/@zigai/pi-extension-settings/dist/definition.d.ts +159 -0
  49. package/node_modules/@zigai/pi-extension-settings/dist/definition.d.ts.map +1 -0
  50. package/node_modules/@zigai/pi-extension-settings/dist/definition.js +248 -0
  51. package/node_modules/@zigai/pi-extension-settings/dist/definition.js.map +1 -0
  52. package/node_modules/@zigai/pi-extension-settings/dist/file-system.d.ts +10 -0
  53. package/node_modules/@zigai/pi-extension-settings/dist/file-system.d.ts.map +1 -0
  54. package/node_modules/@zigai/pi-extension-settings/dist/file-system.js +115 -0
  55. package/node_modules/@zigai/pi-extension-settings/dist/file-system.js.map +1 -0
  56. package/node_modules/@zigai/pi-extension-settings/dist/index.d.ts +2 -0
  57. package/node_modules/@zigai/pi-extension-settings/dist/index.d.ts.map +1 -0
  58. package/node_modules/@zigai/pi-extension-settings/dist/index.js +2 -0
  59. package/node_modules/@zigai/pi-extension-settings/dist/index.js.map +1 -0
  60. package/node_modules/@zigai/pi-extension-settings/dist/json-value.d.ts +18 -0
  61. package/node_modules/@zigai/pi-extension-settings/dist/json-value.d.ts.map +1 -0
  62. package/node_modules/@zigai/pi-extension-settings/dist/json-value.js +56 -0
  63. package/node_modules/@zigai/pi-extension-settings/dist/json-value.js.map +1 -0
  64. package/node_modules/@zigai/pi-extension-settings/dist/paths.d.ts +11 -0
  65. package/node_modules/@zigai/pi-extension-settings/dist/paths.d.ts.map +1 -0
  66. package/node_modules/@zigai/pi-extension-settings/dist/paths.js +23 -0
  67. package/node_modules/@zigai/pi-extension-settings/dist/paths.js.map +1 -0
  68. package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.d.ts +5 -0
  69. package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.d.ts.map +1 -0
  70. package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.js +21 -0
  71. package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.js.map +1 -0
  72. package/node_modules/@zigai/pi-extension-settings/dist/pi.d.ts +106 -0
  73. package/node_modules/@zigai/pi-extension-settings/dist/pi.d.ts.map +1 -0
  74. package/node_modules/@zigai/pi-extension-settings/dist/pi.js +122 -0
  75. package/node_modules/@zigai/pi-extension-settings/dist/pi.js.map +1 -0
  76. package/node_modules/@zigai/pi-extension-settings/dist/pi.ts +2537 -0
  77. package/node_modules/@zigai/pi-extension-settings/dist/pi.ts.map +7 -0
  78. package/node_modules/@zigai/pi-extension-settings/dist/projects.d.ts +10 -0
  79. package/node_modules/@zigai/pi-extension-settings/dist/projects.d.ts.map +1 -0
  80. package/node_modules/@zigai/pi-extension-settings/dist/projects.js +177 -0
  81. package/node_modules/@zigai/pi-extension-settings/dist/projects.js.map +1 -0
  82. package/node_modules/@zigai/pi-extension-settings/dist/runtime.d.ts +40 -0
  83. package/node_modules/@zigai/pi-extension-settings/dist/runtime.d.ts.map +1 -0
  84. package/node_modules/@zigai/pi-extension-settings/dist/runtime.js +158 -0
  85. package/node_modules/@zigai/pi-extension-settings/dist/runtime.js.map +1 -0
  86. package/node_modules/@zigai/pi-extension-settings/dist/runtime.ts +158 -0
  87. package/node_modules/@zigai/pi-extension-settings/dist/runtime.ts.map +7 -0
  88. package/node_modules/@zigai/pi-extension-settings/dist/schema-document.d.ts +19 -0
  89. package/node_modules/@zigai/pi-extension-settings/dist/schema-document.d.ts.map +1 -0
  90. package/node_modules/@zigai/pi-extension-settings/dist/schema-document.js +168 -0
  91. package/node_modules/@zigai/pi-extension-settings/dist/schema-document.js.map +1 -0
  92. package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.d.ts +9 -0
  93. package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.d.ts.map +1 -0
  94. package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.js +242 -0
  95. package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.js.map +1 -0
  96. package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.d.ts +59 -0
  97. package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.d.ts.map +1 -0
  98. package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.js +98 -0
  99. package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.js.map +1 -0
  100. package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.d.ts +80 -0
  101. package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.d.ts.map +1 -0
  102. package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.js +144 -0
  103. package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.js.map +1 -0
  104. package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.d.ts +5 -0
  105. package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.d.ts.map +1 -0
  106. package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.js +30 -0
  107. package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.js.map +1 -0
  108. package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.d.ts +10 -0
  109. package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.d.ts.map +1 -0
  110. package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.js +16 -0
  111. package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.js.map +1 -0
  112. package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.d.ts +54 -0
  113. package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.d.ts.map +1 -0
  114. package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.js +202 -0
  115. package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.js.map +1 -0
  116. package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.d.ts +5 -0
  117. package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.d.ts.map +1 -0
  118. package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.js +9 -0
  119. package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.js.map +1 -0
  120. package/node_modules/@zigai/pi-extension-settings/docs/generation.md +71 -0
  121. package/node_modules/@zigai/pi-extension-settings/docs/manual-setup.md +98 -0
  122. package/node_modules/@zigai/pi-extension-settings/docs/runtime.md +100 -0
  123. package/node_modules/@zigai/pi-extension-settings/docs/ui-controls.md +31 -0
  124. package/node_modules/@zigai/pi-extension-settings/package.json +97 -0
  125. package/node_modules/@zigai/pi-mention-anything/README.md +113 -0
  126. package/node_modules/@zigai/pi-mention-anything/config.schema.json +313 -0
  127. package/node_modules/@zigai/pi-mention-anything/docs/command-protocol.md +106 -0
  128. package/node_modules/@zigai/pi-mention-anything/docs/providers.md +128 -0
  129. package/node_modules/@zigai/pi-mention-anything/examples/query-command.mjs +96 -0
  130. package/node_modules/@zigai/pi-mention-anything/examples/recursive-tree.ts +28 -0
  131. package/node_modules/@zigai/pi-mention-anything/examples/static.ts +28 -0
  132. package/node_modules/@zigai/pi-mention-anything/examples/tmux.ts +90 -0
  133. package/node_modules/@zigai/pi-mention-anything/examples/tree-settings.json +25 -0
  134. package/node_modules/@zigai/pi-mention-anything/package.json +58 -0
  135. package/node_modules/@zigai/pi-mention-anything/src/api.ts +75 -0
  136. package/node_modules/@zigai/pi-mention-anything/src/autocomplete.ts +231 -0
  137. package/node_modules/@zigai/pi-mention-anything/src/chain-autocomplete.ts +596 -0
  138. package/node_modules/@zigai/pi-mention-anything/src/chain-syntax.ts +345 -0
  139. package/node_modules/@zigai/pi-mention-anything/src/command-provider.ts +291 -0
  140. package/node_modules/@zigai/pi-mention-anything/src/configured-source.ts +66 -0
  141. package/node_modules/@zigai/pi-mention-anything/src/editor.ts +180 -0
  142. package/node_modules/@zigai/pi-mention-anything/src/expand-mentions.ts +162 -0
  143. package/node_modules/@zigai/pi-mention-anything/src/index.ts +54 -0
  144. package/node_modules/@zigai/pi-mention-anything/src/initial-suggestions.ts +190 -0
  145. package/node_modules/@zigai/pi-mention-anything/src/list-provider.ts +71 -0
  146. package/node_modules/@zigai/pi-mention-anything/src/mention-hub.ts +307 -0
  147. package/node_modules/@zigai/pi-mention-anything/src/mention-resolution.ts +374 -0
  148. package/node_modules/@zigai/pi-mention-anything/src/mention-syntax.ts +105 -0
  149. package/node_modules/@zigai/pi-mention-anything/src/register-mention.ts +89 -0
  150. package/node_modules/@zigai/pi-mention-anything/src/rendering.ts +53 -0
  151. package/node_modules/@zigai/pi-mention-anything/src/selected-items.ts +21 -0
  152. package/node_modules/@zigai/pi-mention-anything/src/selection-history.ts +135 -0
  153. package/node_modules/@zigai/pi-mention-anything/src/settings-input.ts +317 -0
  154. package/node_modules/@zigai/pi-mention-anything/src/settings.prevalidated.ts +57 -0
  155. package/node_modules/@zigai/pi-mention-anything/src/settings.ts +52 -0
  156. package/node_modules/@zigai/pi-mention-anything/src/source-contract.ts +174 -0
  157. package/node_modules/@zigai/pi-mention-anything/src/source-controller.ts +1070 -0
  158. package/node_modules/@zigai/pi-mention-anything/src/source-runtime.ts +99 -0
  159. package/node_modules/@zigai/pi-mention-skill/README.md +60 -0
  160. package/node_modules/@zigai/pi-mention-skill/config.schema.json +81 -0
  161. package/node_modules/@zigai/pi-mention-skill/package.json +56 -0
  162. package/node_modules/@zigai/pi-mention-skill/src/index.ts +60 -0
  163. package/node_modules/@zigai/pi-mention-skill/src/settings-input.ts +74 -0
  164. package/node_modules/@zigai/pi-mention-skill/src/settings.prevalidated.ts +18 -0
  165. package/node_modules/@zigai/pi-mention-skill/src/settings.ts +54 -0
  166. package/node_modules/@zigai/pi-mention-skill/src/skill-commands.ts +18 -0
  167. package/node_modules/@zigai/pi-mention-skill/src/skill-content.ts +60 -0
  168. package/node_modules/@zigai/pi-mention-skill/src/skill-provider.ts +105 -0
  169. package/node_modules/@zigai/pi-mention-skill/src/slash-skill-filter.ts +29 -0
  170. package/node_modules/argparse/LICENSE +21 -0
  171. package/node_modules/argparse/README.md +257 -0
  172. package/node_modules/argparse/index.js +3 -0
  173. package/node_modules/argparse/lib/action/append/constant.js +47 -0
  174. package/node_modules/argparse/lib/action/append.js +53 -0
  175. package/node_modules/argparse/lib/action/count.js +40 -0
  176. package/node_modules/argparse/lib/action/help.js +47 -0
  177. package/node_modules/argparse/lib/action/store/constant.js +43 -0
  178. package/node_modules/argparse/lib/action/store/false.js +27 -0
  179. package/node_modules/argparse/lib/action/store/true.js +26 -0
  180. package/node_modules/argparse/lib/action/store.js +50 -0
  181. package/node_modules/argparse/lib/action/subparsers.js +149 -0
  182. package/node_modules/argparse/lib/action/version.js +47 -0
  183. package/node_modules/argparse/lib/action.js +146 -0
  184. package/node_modules/argparse/lib/action_container.js +482 -0
  185. package/node_modules/argparse/lib/argparse.js +14 -0
  186. package/node_modules/argparse/lib/argument/error.js +50 -0
  187. package/node_modules/argparse/lib/argument/exclusive.js +54 -0
  188. package/node_modules/argparse/lib/argument/group.js +75 -0
  189. package/node_modules/argparse/lib/argument_parser.js +1161 -0
  190. package/node_modules/argparse/lib/const.js +21 -0
  191. package/node_modules/argparse/lib/help/added_formatters.js +87 -0
  192. package/node_modules/argparse/lib/help/formatter.js +795 -0
  193. package/node_modules/argparse/lib/namespace.js +76 -0
  194. package/node_modules/argparse/lib/utils.js +57 -0
  195. package/node_modules/argparse/package.json +34 -0
  196. package/node_modules/esprima/LICENSE.BSD +21 -0
  197. package/node_modules/esprima/README.md +46 -0
  198. package/node_modules/esprima/bin/esparse.js +139 -0
  199. package/node_modules/esprima/bin/esvalidate.js +236 -0
  200. package/node_modules/esprima/dist/esprima.js +6709 -0
  201. package/node_modules/esprima/package.json +112 -0
  202. package/node_modules/extend-shallow/LICENSE +21 -0
  203. package/node_modules/extend-shallow/README.md +61 -0
  204. package/node_modules/extend-shallow/index.js +33 -0
  205. package/node_modules/extend-shallow/package.json +56 -0
  206. package/node_modules/graceful-fs/LICENSE +15 -0
  207. package/node_modules/graceful-fs/README.md +143 -0
  208. package/node_modules/graceful-fs/clone.js +23 -0
  209. package/node_modules/graceful-fs/graceful-fs.js +448 -0
  210. package/node_modules/graceful-fs/legacy-streams.js +118 -0
  211. package/node_modules/graceful-fs/package.json +53 -0
  212. package/node_modules/graceful-fs/polyfills.js +355 -0
  213. package/node_modules/gray-matter/LICENSE +21 -0
  214. package/node_modules/gray-matter/README.md +565 -0
  215. package/node_modules/gray-matter/gray-matter.d.ts +114 -0
  216. package/node_modules/gray-matter/index.js +228 -0
  217. package/node_modules/gray-matter/lib/defaults.js +18 -0
  218. package/node_modules/gray-matter/lib/engine.js +30 -0
  219. package/node_modules/gray-matter/lib/engines.js +54 -0
  220. package/node_modules/gray-matter/lib/excerpt.js +32 -0
  221. package/node_modules/gray-matter/lib/parse.js +13 -0
  222. package/node_modules/gray-matter/lib/stringify.js +56 -0
  223. package/node_modules/gray-matter/lib/to-file.js +43 -0
  224. package/node_modules/gray-matter/lib/utils.js +66 -0
  225. package/node_modules/gray-matter/package.json +127 -0
  226. package/node_modules/is-extendable/LICENSE +21 -0
  227. package/node_modules/is-extendable/README.md +72 -0
  228. package/node_modules/is-extendable/index.js +13 -0
  229. package/node_modules/is-extendable/package.json +51 -0
  230. package/node_modules/js-yaml/LICENSE +21 -0
  231. package/node_modules/js-yaml/README.md +302 -0
  232. package/node_modules/js-yaml/bin/js-yaml.js +132 -0
  233. package/node_modules/js-yaml/dist/js-yaml.js +4024 -0
  234. package/node_modules/js-yaml/dist/js-yaml.min.js +1 -0
  235. package/node_modules/js-yaml/index.js +7 -0
  236. package/node_modules/js-yaml/lib/js-yaml/common.js +59 -0
  237. package/node_modules/js-yaml/lib/js-yaml/dumper.js +850 -0
  238. package/node_modules/js-yaml/lib/js-yaml/exception.js +43 -0
  239. package/node_modules/js-yaml/lib/js-yaml/loader.js +1679 -0
  240. package/node_modules/js-yaml/lib/js-yaml/mark.js +76 -0
  241. package/node_modules/js-yaml/lib/js-yaml/schema/core.js +18 -0
  242. package/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +25 -0
  243. package/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +28 -0
  244. package/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +17 -0
  245. package/node_modules/js-yaml/lib/js-yaml/schema/json.js +25 -0
  246. package/node_modules/js-yaml/lib/js-yaml/schema.js +108 -0
  247. package/node_modules/js-yaml/lib/js-yaml/type/binary.js +138 -0
  248. package/node_modules/js-yaml/lib/js-yaml/type/bool.js +35 -0
  249. package/node_modules/js-yaml/lib/js-yaml/type/float.js +116 -0
  250. package/node_modules/js-yaml/lib/js-yaml/type/int.js +173 -0
  251. package/node_modules/js-yaml/lib/js-yaml/type/js/function.js +93 -0
  252. package/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +60 -0
  253. package/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +28 -0
  254. package/node_modules/js-yaml/lib/js-yaml/type/map.js +8 -0
  255. package/node_modules/js-yaml/lib/js-yaml/type/merge.js +12 -0
  256. package/node_modules/js-yaml/lib/js-yaml/type/null.js +34 -0
  257. package/node_modules/js-yaml/lib/js-yaml/type/omap.js +44 -0
  258. package/node_modules/js-yaml/lib/js-yaml/type/pairs.js +53 -0
  259. package/node_modules/js-yaml/lib/js-yaml/type/seq.js +8 -0
  260. package/node_modules/js-yaml/lib/js-yaml/type/set.js +29 -0
  261. package/node_modules/js-yaml/lib/js-yaml/type/str.js +8 -0
  262. package/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +88 -0
  263. package/node_modules/js-yaml/lib/js-yaml/type.js +61 -0
  264. package/node_modules/js-yaml/lib/js-yaml.js +39 -0
  265. package/node_modules/js-yaml/package.json +52 -0
  266. package/node_modules/kind-of/LICENSE +21 -0
  267. package/node_modules/kind-of/README.md +367 -0
  268. package/node_modules/kind-of/index.js +129 -0
  269. package/node_modules/kind-of/package.json +88 -0
  270. package/node_modules/node-addon-api/common 2.gypi +21 -0
  271. package/node_modules/node-addon-api/except 2.gypi +25 -0
  272. package/node_modules/node-addon-api/napi 2.h +3463 -0
  273. package/node_modules/node-addon-api/napi-inl 2.h +7250 -0
  274. package/node_modules/node-addon-api/napi-inl.deprecated 2.h +186 -0
  275. package/node_modules/node-addon-api/node_addon_api 2.gyp +42 -0
  276. package/node_modules/node-addon-api/node_api 2.gyp +9 -0
  277. package/node_modules/node-addon-api/noexcept 2.gypi +26 -0
  278. package/node_modules/node-addon-api/nothing 2.c +0 -0
  279. package/node_modules/pi-toggle-skills/README.md +213 -0
  280. package/node_modules/pi-toggle-skills/package.json +60 -0
  281. package/node_modules/pi-toggle-skills/src/index.ts +112 -0
  282. package/node_modules/pi-toggle-skills/src/skill-discovery.ts +258 -0
  283. package/node_modules/pi-toggle-skills/src/skill-selector.ts +435 -0
  284. package/node_modules/pi-toggle-skills/toggle-skills 2.ts +316 -0
  285. package/node_modules/pi-toggle-skills/toggle-skills.ts +316 -0
  286. package/node_modules/pi-toggle-skills/vitest.config 2.ts +15 -0
  287. package/node_modules/pi-toggle-skills/vitest.config.ts +15 -0
  288. package/node_modules/proper-lockfile/LICENSE +21 -0
  289. package/node_modules/proper-lockfile/README.md +183 -0
  290. package/node_modules/proper-lockfile/index.js +40 -0
  291. package/node_modules/proper-lockfile/lib/adapter.js +85 -0
  292. package/node_modules/proper-lockfile/lib/lockfile.js +342 -0
  293. package/node_modules/proper-lockfile/lib/mtime-precision.js +55 -0
  294. package/node_modules/proper-lockfile/node_modules/retry/.npmignore +3 -0
  295. package/node_modules/proper-lockfile/node_modules/retry/.travis.yml +15 -0
  296. package/node_modules/proper-lockfile/node_modules/retry/License +21 -0
  297. package/node_modules/proper-lockfile/node_modules/retry/Makefile +18 -0
  298. package/node_modules/proper-lockfile/node_modules/retry/README.md +227 -0
  299. package/node_modules/proper-lockfile/node_modules/retry/equation.gif +0 -0
  300. package/node_modules/proper-lockfile/node_modules/retry/example/dns.js +31 -0
  301. package/node_modules/proper-lockfile/node_modules/retry/example/stop.js +40 -0
  302. package/node_modules/proper-lockfile/node_modules/retry/index.js +1 -0
  303. package/node_modules/proper-lockfile/node_modules/retry/lib/retry.js +100 -0
  304. package/node_modules/proper-lockfile/node_modules/retry/lib/retry_operation.js +158 -0
  305. package/node_modules/proper-lockfile/node_modules/retry/package.json +32 -0
  306. package/node_modules/proper-lockfile/node_modules/retry/test/common.js +10 -0
  307. package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-forever.js +24 -0
  308. package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-retry-operation.js +258 -0
  309. package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-retry-wrap.js +101 -0
  310. package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-timeouts.js +69 -0
  311. package/node_modules/proper-lockfile/package.json +71 -0
  312. package/node_modules/section-matter/LICENSE +21 -0
  313. package/node_modules/section-matter/README.md +236 -0
  314. package/node_modules/section-matter/index.js +136 -0
  315. package/node_modules/section-matter/package.json +55 -0
  316. package/node_modules/signal-exit/LICENSE.txt +16 -0
  317. package/node_modules/signal-exit/README.md +39 -0
  318. package/node_modules/signal-exit/index.js +202 -0
  319. package/node_modules/signal-exit/package.json +38 -0
  320. package/node_modules/signal-exit/signals.js +53 -0
  321. package/node_modules/sprintf-js/.npmignore +1 -0
  322. package/node_modules/sprintf-js/.npmignore 2 +1 -0
  323. package/node_modules/sprintf-js/LICENSE +24 -0
  324. package/node_modules/sprintf-js/LICENSE 2 +24 -0
  325. package/node_modules/sprintf-js/README 2.md +88 -0
  326. package/node_modules/sprintf-js/README.md +88 -0
  327. package/node_modules/sprintf-js/bower 2.json +14 -0
  328. package/node_modules/sprintf-js/bower.json +14 -0
  329. package/node_modules/sprintf-js/demo/angular.html +20 -0
  330. package/node_modules/sprintf-js/dist/angular-sprintf.min.js +4 -0
  331. package/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +1 -0
  332. package/node_modules/sprintf-js/dist/angular-sprintf.min.map +1 -0
  333. package/node_modules/sprintf-js/dist/sprintf.min.js +4 -0
  334. package/node_modules/sprintf-js/dist/sprintf.min.js.map +1 -0
  335. package/node_modules/sprintf-js/dist/sprintf.min.map +1 -0
  336. package/node_modules/sprintf-js/gruntfile 2.js +36 -0
  337. package/node_modules/sprintf-js/gruntfile.js +36 -0
  338. package/node_modules/sprintf-js/package 2.json +22 -0
  339. package/node_modules/sprintf-js/package.json +22 -0
  340. package/node_modules/sprintf-js/src/angular-sprintf.js +18 -0
  341. package/node_modules/sprintf-js/src/sprintf.js +208 -0
  342. package/node_modules/sprintf-js/test/test.js +82 -0
  343. package/node_modules/strip-bom-string/LICENSE +21 -0
  344. package/node_modules/strip-bom-string/README.md +66 -0
  345. package/node_modules/strip-bom-string/index.js +15 -0
  346. package/node_modules/strip-bom-string/package.json +60 -0
  347. package/node_modules/tree-sitter-bash/tree-sitter-bash 2.wasm +0 -0
  348. package/node_modules/typebox/license 2 +23 -0
  349. package/node_modules/typebox/package 2.json +87 -0
  350. package/node_modules/typebox/readme 2.md +370 -0
  351. package/node_modules/zod/compile 2.cjs +96 -0
  352. package/node_modules/zod/compile 2.js +52 -0
  353. package/node_modules/zod/index 2.cjs +52 -0
  354. package/node_modules/zod/index 2.js +7 -0
  355. package/package.json +13 -4
@@ -0,0 +1,76 @@
1
+ /**
2
+ * class Namespace
3
+ *
4
+ * Simple object for storing attributes. Implements equality by attribute names
5
+ * and values, and provides a simple string representation.
6
+ *
7
+ * See also [original guide][1]
8
+ *
9
+ * [1]:http://docs.python.org/dev/library/argparse.html#the-namespace-object
10
+ **/
11
+ 'use strict';
12
+
13
+ var $$ = require('./utils');
14
+
15
+ /**
16
+ * new Namespace(options)
17
+ * - options(object): predefined propertis for result object
18
+ *
19
+ **/
20
+ var Namespace = module.exports = function Namespace(options) {
21
+ $$.extend(this, options);
22
+ };
23
+
24
+ /**
25
+ * Namespace#isset(key) -> Boolean
26
+ * - key (string|number): property name
27
+ *
28
+ * Tells whenever `namespace` contains given `key` or not.
29
+ **/
30
+ Namespace.prototype.isset = function (key) {
31
+ return $$.has(this, key);
32
+ };
33
+
34
+ /**
35
+ * Namespace#set(key, value) -> self
36
+ * -key (string|number|object): propery name
37
+ * -value (mixed): new property value
38
+ *
39
+ * Set the property named key with value.
40
+ * If key object then set all key properties to namespace object
41
+ **/
42
+ Namespace.prototype.set = function (key, value) {
43
+ if (typeof (key) === 'object') {
44
+ $$.extend(this, key);
45
+ } else {
46
+ this[key] = value;
47
+ }
48
+ return this;
49
+ };
50
+
51
+ /**
52
+ * Namespace#get(key, defaultValue) -> mixed
53
+ * - key (string|number): property name
54
+ * - defaultValue (mixed): default value
55
+ *
56
+ * Return the property key or defaulValue if not set
57
+ **/
58
+ Namespace.prototype.get = function (key, defaultValue) {
59
+ return !this[key] ? defaultValue : this[key];
60
+ };
61
+
62
+ /**
63
+ * Namespace#unset(key, defaultValue) -> mixed
64
+ * - key (string|number): property name
65
+ * - defaultValue (mixed): default value
66
+ *
67
+ * Return data[key](and delete it) or defaultValue
68
+ **/
69
+ Namespace.prototype.unset = function (key, defaultValue) {
70
+ var value = this[key];
71
+ if (value !== null) {
72
+ delete this[key];
73
+ return value;
74
+ }
75
+ return defaultValue;
76
+ };
@@ -0,0 +1,57 @@
1
+ 'use strict';
2
+
3
+ exports.repeat = function (str, num) {
4
+ var result = '';
5
+ for (var i = 0; i < num; i++) { result += str; }
6
+ return result;
7
+ };
8
+
9
+ exports.arrayEqual = function (a, b) {
10
+ if (a.length !== b.length) { return false; }
11
+ for (var i = 0; i < a.length; i++) {
12
+ if (a[i] !== b[i]) { return false; }
13
+ }
14
+ return true;
15
+ };
16
+
17
+ exports.trimChars = function (str, chars) {
18
+ var start = 0;
19
+ var end = str.length - 1;
20
+ while (chars.indexOf(str.charAt(start)) >= 0) { start++; }
21
+ while (chars.indexOf(str.charAt(end)) >= 0) { end--; }
22
+ return str.slice(start, end + 1);
23
+ };
24
+
25
+ exports.capitalize = function (str) {
26
+ return str.charAt(0).toUpperCase() + str.slice(1);
27
+ };
28
+
29
+ exports.arrayUnion = function () {
30
+ var result = [];
31
+ for (var i = 0, values = {}; i < arguments.length; i++) {
32
+ var arr = arguments[i];
33
+ for (var j = 0; j < arr.length; j++) {
34
+ if (!values[arr[j]]) {
35
+ values[arr[j]] = true;
36
+ result.push(arr[j]);
37
+ }
38
+ }
39
+ }
40
+ return result;
41
+ };
42
+
43
+ function has(obj, key) {
44
+ return Object.prototype.hasOwnProperty.call(obj, key);
45
+ }
46
+
47
+ exports.has = has;
48
+
49
+ exports.extend = function (dest, src) {
50
+ for (var i in src) {
51
+ if (has(src, i)) { dest[i] = src[i]; }
52
+ }
53
+ };
54
+
55
+ exports.trimEnd = function (str) {
56
+ return str.replace(/\s+$/g, '');
57
+ };
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "argparse",
3
+ "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library",
4
+ "version": "1.0.10",
5
+ "keywords": [
6
+ "cli",
7
+ "parser",
8
+ "argparse",
9
+ "option",
10
+ "args"
11
+ ],
12
+ "contributors": [
13
+ "Eugene Shkuropat",
14
+ "Paul Jacobson"
15
+ ],
16
+ "files": [
17
+ "index.js",
18
+ "lib/"
19
+ ],
20
+ "license": "MIT",
21
+ "repository": "nodeca/argparse",
22
+ "scripts": {
23
+ "test": "make test"
24
+ },
25
+ "dependencies": {
26
+ "sprintf-js": "~1.0.2"
27
+ },
28
+ "devDependencies": {
29
+ "eslint": "^2.13.1",
30
+ "istanbul": "^0.4.5",
31
+ "mocha": "^3.1.0",
32
+ "ndoc": "^5.0.1"
33
+ }
34
+ }
@@ -0,0 +1,21 @@
1
+ Copyright JS Foundation and other contributors, https://js.foundation/
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions are met:
5
+
6
+ * Redistributions of source code must retain the above copyright
7
+ notice, this list of conditions and the following disclaimer.
8
+ * Redistributions in binary form must reproduce the above copyright
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
16
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
17
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
18
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,46 @@
1
+ [![NPM version](https://img.shields.io/npm/v/esprima.svg)](https://www.npmjs.com/package/esprima)
2
+ [![npm download](https://img.shields.io/npm/dm/esprima.svg)](https://www.npmjs.com/package/esprima)
3
+ [![Build Status](https://img.shields.io/travis/jquery/esprima/master.svg)](https://travis-ci.org/jquery/esprima)
4
+ [![Coverage Status](https://img.shields.io/codecov/c/github/jquery/esprima/master.svg)](https://codecov.io/github/jquery/esprima)
5
+
6
+ **Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance,
7
+ standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)
8
+ parser written in ECMAScript (also popularly known as
9
+ [JavaScript](https://en.wikipedia.org/wiki/JavaScript)).
10
+ Esprima is created and maintained by [Ariya Hidayat](https://twitter.com/ariyahidayat),
11
+ with the help of [many contributors](https://github.com/jquery/esprima/contributors).
12
+
13
+ ### Features
14
+
15
+ - Full support for ECMAScript 2017 ([ECMA-262 8th Edition](http://www.ecma-international.org/publications/standards/Ecma-262.htm))
16
+ - Sensible [syntax tree format](https://github.com/estree/estree/blob/master/es5.md) as standardized by [ESTree project](https://github.com/estree/estree)
17
+ - Experimental support for [JSX](https://facebook.github.io/jsx/), a syntax extension for [React](https://facebook.github.io/react/)
18
+ - Optional tracking of syntax node location (index-based and line-column)
19
+ - [Heavily tested](http://esprima.org/test/ci.html) (~1500 [unit tests](https://github.com/jquery/esprima/tree/master/test/fixtures) with [full code coverage](https://codecov.io/github/jquery/esprima))
20
+
21
+ ### API
22
+
23
+ Esprima can be used to perform [lexical analysis](https://en.wikipedia.org/wiki/Lexical_analysis) (tokenization) or [syntactic analysis](https://en.wikipedia.org/wiki/Parsing) (parsing) of a JavaScript program.
24
+
25
+ A simple example on Node.js REPL:
26
+
27
+ ```javascript
28
+ > var esprima = require('esprima');
29
+ > var program = 'const answer = 42';
30
+
31
+ > esprima.tokenize(program);
32
+ [ { type: 'Keyword', value: 'const' },
33
+ { type: 'Identifier', value: 'answer' },
34
+ { type: 'Punctuator', value: '=' },
35
+ { type: 'Numeric', value: '42' } ]
36
+
37
+ > esprima.parseScript(program);
38
+ { type: 'Program',
39
+ body:
40
+ [ { type: 'VariableDeclaration',
41
+ declarations: [Object],
42
+ kind: 'const' } ],
43
+ sourceType: 'script' }
44
+ ```
45
+
46
+ For more information, please read the [complete documentation](http://esprima.org/doc).
@@ -0,0 +1,139 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ Copyright JS Foundation and other contributors, https://js.foundation/
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
+ * Redistributions of source code must retain the above copyright
9
+ notice, this list of conditions and the following disclaimer.
10
+ * Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in the
12
+ documentation and/or other materials provided with the distribution.
13
+
14
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
+ ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
18
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
+ */
25
+
26
+ /*jslint sloppy:true node:true rhino:true */
27
+
28
+ var fs, esprima, fname, forceFile, content, options, syntax;
29
+
30
+ if (typeof require === 'function') {
31
+ fs = require('fs');
32
+ try {
33
+ esprima = require('esprima');
34
+ } catch (e) {
35
+ esprima = require('../');
36
+ }
37
+ } else if (typeof load === 'function') {
38
+ try {
39
+ load('esprima.js');
40
+ } catch (e) {
41
+ load('../esprima.js');
42
+ }
43
+ }
44
+
45
+ // Shims to Node.js objects when running under Rhino.
46
+ if (typeof console === 'undefined' && typeof process === 'undefined') {
47
+ console = { log: print };
48
+ fs = { readFileSync: readFile };
49
+ process = { argv: arguments, exit: quit };
50
+ process.argv.unshift('esparse.js');
51
+ process.argv.unshift('rhino');
52
+ }
53
+
54
+ function showUsage() {
55
+ console.log('Usage:');
56
+ console.log(' esparse [options] [file.js]');
57
+ console.log();
58
+ console.log('Available options:');
59
+ console.log();
60
+ console.log(' --comment Gather all line and block comments in an array');
61
+ console.log(' --loc Include line-column location info for each syntax node');
62
+ console.log(' --range Include index-based range for each syntax node');
63
+ console.log(' --raw Display the raw value of literals');
64
+ console.log(' --tokens List all tokens in an array');
65
+ console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)');
66
+ console.log(' -v, --version Shows program version');
67
+ console.log();
68
+ process.exit(1);
69
+ }
70
+
71
+ options = {};
72
+
73
+ process.argv.splice(2).forEach(function (entry) {
74
+
75
+ if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') {
76
+ if (typeof fname === 'string') {
77
+ console.log('Error: more than one input file.');
78
+ process.exit(1);
79
+ } else {
80
+ fname = entry;
81
+ }
82
+ } else if (entry === '-h' || entry === '--help') {
83
+ showUsage();
84
+ } else if (entry === '-v' || entry === '--version') {
85
+ console.log('ECMAScript Parser (using Esprima version', esprima.version, ')');
86
+ console.log();
87
+ process.exit(0);
88
+ } else if (entry === '--comment') {
89
+ options.comment = true;
90
+ } else if (entry === '--loc') {
91
+ options.loc = true;
92
+ } else if (entry === '--range') {
93
+ options.range = true;
94
+ } else if (entry === '--raw') {
95
+ options.raw = true;
96
+ } else if (entry === '--tokens') {
97
+ options.tokens = true;
98
+ } else if (entry === '--tolerant') {
99
+ options.tolerant = true;
100
+ } else if (entry === '--') {
101
+ forceFile = true;
102
+ } else {
103
+ console.log('Error: unknown option ' + entry + '.');
104
+ process.exit(1);
105
+ }
106
+ });
107
+
108
+ // Special handling for regular expression literal since we need to
109
+ // convert it to a string literal, otherwise it will be decoded
110
+ // as object "{}" and the regular expression would be lost.
111
+ function adjustRegexLiteral(key, value) {
112
+ if (key === 'value' && value instanceof RegExp) {
113
+ value = value.toString();
114
+ }
115
+ return value;
116
+ }
117
+
118
+ function run(content) {
119
+ syntax = esprima.parse(content, options);
120
+ console.log(JSON.stringify(syntax, adjustRegexLiteral, 4));
121
+ }
122
+
123
+ try {
124
+ if (fname && (fname !== '-' || forceFile)) {
125
+ run(fs.readFileSync(fname, 'utf-8'));
126
+ } else {
127
+ var content = '';
128
+ process.stdin.resume();
129
+ process.stdin.on('data', function(chunk) {
130
+ content += chunk;
131
+ });
132
+ process.stdin.on('end', function() {
133
+ run(content);
134
+ });
135
+ }
136
+ } catch (e) {
137
+ console.log('Error: ' + e.message);
138
+ process.exit(1);
139
+ }
@@ -0,0 +1,236 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ Copyright JS Foundation and other contributors, https://js.foundation/
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
+ * Redistributions of source code must retain the above copyright
9
+ notice, this list of conditions and the following disclaimer.
10
+ * Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in the
12
+ documentation and/or other materials provided with the distribution.
13
+
14
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
+ ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
18
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
+ */
25
+
26
+ /*jslint sloppy:true plusplus:true node:true rhino:true */
27
+ /*global phantom:true */
28
+
29
+ var fs, system, esprima, options, fnames, forceFile, count;
30
+
31
+ if (typeof esprima === 'undefined') {
32
+ // PhantomJS can only require() relative files
33
+ if (typeof phantom === 'object') {
34
+ fs = require('fs');
35
+ system = require('system');
36
+ esprima = require('./esprima');
37
+ } else if (typeof require === 'function') {
38
+ fs = require('fs');
39
+ try {
40
+ esprima = require('esprima');
41
+ } catch (e) {
42
+ esprima = require('../');
43
+ }
44
+ } else if (typeof load === 'function') {
45
+ try {
46
+ load('esprima.js');
47
+ } catch (e) {
48
+ load('../esprima.js');
49
+ }
50
+ }
51
+ }
52
+
53
+ // Shims to Node.js objects when running under PhantomJS 1.7+.
54
+ if (typeof phantom === 'object') {
55
+ fs.readFileSync = fs.read;
56
+ process = {
57
+ argv: [].slice.call(system.args),
58
+ exit: phantom.exit,
59
+ on: function (evt, callback) {
60
+ callback();
61
+ }
62
+ };
63
+ process.argv.unshift('phantomjs');
64
+ }
65
+
66
+ // Shims to Node.js objects when running under Rhino.
67
+ if (typeof console === 'undefined' && typeof process === 'undefined') {
68
+ console = { log: print };
69
+ fs = { readFileSync: readFile };
70
+ process = {
71
+ argv: arguments,
72
+ exit: quit,
73
+ on: function (evt, callback) {
74
+ callback();
75
+ }
76
+ };
77
+ process.argv.unshift('esvalidate.js');
78
+ process.argv.unshift('rhino');
79
+ }
80
+
81
+ function showUsage() {
82
+ console.log('Usage:');
83
+ console.log(' esvalidate [options] [file.js...]');
84
+ console.log();
85
+ console.log('Available options:');
86
+ console.log();
87
+ console.log(' --format=type Set the report format, plain (default) or junit');
88
+ console.log(' -v, --version Print program version');
89
+ console.log();
90
+ process.exit(1);
91
+ }
92
+
93
+ options = {
94
+ format: 'plain'
95
+ };
96
+
97
+ fnames = [];
98
+
99
+ process.argv.splice(2).forEach(function (entry) {
100
+
101
+ if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') {
102
+ fnames.push(entry);
103
+ } else if (entry === '-h' || entry === '--help') {
104
+ showUsage();
105
+ } else if (entry === '-v' || entry === '--version') {
106
+ console.log('ECMAScript Validator (using Esprima version', esprima.version, ')');
107
+ console.log();
108
+ process.exit(0);
109
+ } else if (entry.slice(0, 9) === '--format=') {
110
+ options.format = entry.slice(9);
111
+ if (options.format !== 'plain' && options.format !== 'junit') {
112
+ console.log('Error: unknown report format ' + options.format + '.');
113
+ process.exit(1);
114
+ }
115
+ } else if (entry === '--') {
116
+ forceFile = true;
117
+ } else {
118
+ console.log('Error: unknown option ' + entry + '.');
119
+ process.exit(1);
120
+ }
121
+ });
122
+
123
+ if (fnames.length === 0) {
124
+ fnames.push('');
125
+ }
126
+
127
+ if (options.format === 'junit') {
128
+ console.log('<?xml version="1.0" encoding="UTF-8"?>');
129
+ console.log('<testsuites>');
130
+ }
131
+
132
+ count = 0;
133
+
134
+ function run(fname, content) {
135
+ var timestamp, syntax, name;
136
+ try {
137
+ if (typeof content !== 'string') {
138
+ throw content;
139
+ }
140
+
141
+ if (content[0] === '#' && content[1] === '!') {
142
+ content = '//' + content.substr(2, content.length);
143
+ }
144
+
145
+ timestamp = Date.now();
146
+ syntax = esprima.parse(content, { tolerant: true });
147
+
148
+ if (options.format === 'junit') {
149
+
150
+ name = fname;
151
+ if (name.lastIndexOf('/') >= 0) {
152
+ name = name.slice(name.lastIndexOf('/') + 1);
153
+ }
154
+
155
+ console.log('<testsuite name="' + fname + '" errors="0" ' +
156
+ ' failures="' + syntax.errors.length + '" ' +
157
+ ' tests="' + syntax.errors.length + '" ' +
158
+ ' time="' + Math.round((Date.now() - timestamp) / 1000) +
159
+ '">');
160
+
161
+ syntax.errors.forEach(function (error) {
162
+ var msg = error.message;
163
+ msg = msg.replace(/^Line\ [0-9]*\:\ /, '');
164
+ console.log(' <testcase name="Line ' + error.lineNumber + ': ' + msg + '" ' +
165
+ ' time="0">');
166
+ console.log(' <error type="SyntaxError" message="' + error.message + '">' +
167
+ error.message + '(' + name + ':' + error.lineNumber + ')' +
168
+ '</error>');
169
+ console.log(' </testcase>');
170
+ });
171
+
172
+ console.log('</testsuite>');
173
+
174
+ } else if (options.format === 'plain') {
175
+
176
+ syntax.errors.forEach(function (error) {
177
+ var msg = error.message;
178
+ msg = msg.replace(/^Line\ [0-9]*\:\ /, '');
179
+ msg = fname + ':' + error.lineNumber + ': ' + msg;
180
+ console.log(msg);
181
+ ++count;
182
+ });
183
+
184
+ }
185
+ } catch (e) {
186
+ ++count;
187
+ if (options.format === 'junit') {
188
+ console.log('<testsuite name="' + fname + '" errors="1" failures="0" tests="1" ' +
189
+ ' time="' + Math.round((Date.now() - timestamp) / 1000) + '">');
190
+ console.log(' <testcase name="' + e.message + '" ' + ' time="0">');
191
+ console.log(' <error type="ParseError" message="' + e.message + '">' +
192
+ e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') +
193
+ ')</error>');
194
+ console.log(' </testcase>');
195
+ console.log('</testsuite>');
196
+ } else {
197
+ console.log(fname + ':' + e.lineNumber + ': ' + e.message.replace(/^Line\ [0-9]*\:\ /, ''));
198
+ }
199
+ }
200
+ }
201
+
202
+ fnames.forEach(function (fname) {
203
+ var content = '';
204
+ try {
205
+ if (fname && (fname !== '-' || forceFile)) {
206
+ content = fs.readFileSync(fname, 'utf-8');
207
+ } else {
208
+ fname = '';
209
+ process.stdin.resume();
210
+ process.stdin.on('data', function(chunk) {
211
+ content += chunk;
212
+ });
213
+ process.stdin.on('end', function() {
214
+ run(fname, content);
215
+ });
216
+ return;
217
+ }
218
+ } catch (e) {
219
+ content = e;
220
+ }
221
+ run(fname, content);
222
+ });
223
+
224
+ process.on('exit', function () {
225
+ if (options.format === 'junit') {
226
+ console.log('</testsuites>');
227
+ }
228
+
229
+ if (count > 0) {
230
+ process.exit(1);
231
+ }
232
+
233
+ if (count === 0 && typeof phantom === 'object') {
234
+ process.exit(0);
235
+ }
236
+ });