@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,105 @@
1
+ import path from "node:path";
2
+
3
+ import { createListProvider, type Candidate, type Provider } from "@zigai/pi-mention-anything/api";
4
+ import { Type, type Static } from "typebox";
5
+ import { Value } from "typebox/value";
6
+
7
+ import {
8
+ formatSkillBlock,
9
+ type SkillExpansionLoader,
10
+ type SkillExpansionTarget,
11
+ } from "./skill-content.ts";
12
+ import { skillName, type SkillCommand } from "./skill-commands.ts";
13
+
14
+ const skillCandidateDataSchema = Type.Object(
15
+ {
16
+ name: Type.String(),
17
+ location: Type.String(),
18
+ baseDir: Type.String(),
19
+ },
20
+ { additionalProperties: false },
21
+ );
22
+
23
+ type SkillCandidateData = Static<typeof skillCandidateDataSchema>;
24
+
25
+ type SkillProviderOptions = {
26
+ readonly projectSkillsFirst: boolean;
27
+ };
28
+
29
+ function candidateData(candidate: Candidate): SkillCandidateData {
30
+ return Value.Parse(skillCandidateDataSchema, candidate.data);
31
+ }
32
+
33
+ function skillCandidate(command: SkillCommand): Candidate {
34
+ const name = skillName(command);
35
+ const data: SkillCandidateData = {
36
+ name,
37
+ location: command.sourceInfo.path,
38
+ baseDir: path.dirname(command.sourceInfo.path),
39
+ };
40
+
41
+ return {
42
+ id: command.name,
43
+ label: name,
44
+ segment: name,
45
+ description: command.description,
46
+ searchText: `${name} ${command.description}`,
47
+ selectable: true,
48
+ navigable: false,
49
+ data,
50
+ };
51
+ }
52
+
53
+ export async function resolveSkillCandidate(
54
+ candidatePath: readonly Candidate[],
55
+ loadSkillExpansion: SkillExpansionLoader,
56
+ signal?: AbortSignal,
57
+ ): Promise<string> {
58
+ signal?.throwIfAborted();
59
+ const target = candidatePath.at(-1);
60
+ if (target === undefined) throw new Error("Skill mention resolved without a target.");
61
+
62
+ const expansionTarget: SkillExpansionTarget = candidateData(target);
63
+ const expansion = await loadSkillExpansion(expansionTarget);
64
+ signal?.throwIfAborted();
65
+ return formatSkillBlock(expansion);
66
+ }
67
+
68
+ export function createSkillProvider(
69
+ loadCommands: () => SkillCommand[],
70
+ loadSkillExpansion: SkillExpansionLoader,
71
+ options: SkillProviderOptions,
72
+ ): Provider {
73
+ const provider = createListProvider(async (request) => {
74
+ request.signal.throwIfAborted();
75
+ const commands = loadCommands();
76
+ if (options.projectSkillsFirst) {
77
+ commands.sort((left, right) => {
78
+ const leftProject = left.sourceInfo.scope === "project";
79
+ const rightProject = right.sourceInfo.scope === "project";
80
+ if (leftProject === rightProject) return 0;
81
+ if (leftProject) return -1;
82
+ return 1;
83
+ });
84
+ }
85
+
86
+ return commands.map(skillCandidate);
87
+ });
88
+
89
+ return {
90
+ ...provider,
91
+ async resolve(request) {
92
+ const resolution = await provider.resolve(request);
93
+ if (resolution.status === "unresolved") return resolution;
94
+
95
+ return {
96
+ ...resolution,
97
+ replacement: await resolveSkillCandidate(
98
+ resolution.path,
99
+ loadSkillExpansion,
100
+ request.signal,
101
+ ),
102
+ };
103
+ },
104
+ };
105
+ }
@@ -0,0 +1,29 @@
1
+ import type { AutocompleteProvider, AutocompleteSuggestions } from "@earendil-works/pi-tui";
2
+
3
+ const SKILL_COMMAND_PREFIX = "skill:";
4
+
5
+ function withoutSlashSkills(
6
+ suggestions: AutocompleteSuggestions | null,
7
+ ): AutocompleteSuggestions | null {
8
+ if (suggestions === null || !suggestions.prefix.startsWith("/")) return suggestions;
9
+
10
+ const items = suggestions.items.filter((item) => !item.value.startsWith(SKILL_COMMAND_PREFIX));
11
+ if (items.length === suggestions.items.length) return suggestions;
12
+ if (items.length === 0) return null;
13
+ return { ...suggestions, items };
14
+ }
15
+
16
+ /** Preserve the active autocomplete provider while removing slash-skill rows. */
17
+ export function createSlashSkillFilter(current: AutocompleteProvider): AutocompleteProvider {
18
+ return {
19
+ triggerCharacters: current.triggerCharacters,
20
+ async getSuggestions(lines, cursorLine, cursorCol, options) {
21
+ return withoutSlashSkills(
22
+ await current.getSuggestions(lines, cursorLine, cursorCol, options),
23
+ );
24
+ },
25
+ applyCompletion(lines, cursorLine, cursorCol, item, prefix) {
26
+ return current.applyCompletion(lines, cursorLine, cursorCol, item, prefix);
27
+ },
28
+ };
29
+ }
@@ -0,0 +1,21 @@
1
+ (The MIT License)
2
+
3
+ Copyright (C) 2012 by Vitaly Puzrin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,257 @@
1
+ argparse
2
+ ========
3
+
4
+ [![Build Status](https://secure.travis-ci.org/nodeca/argparse.svg?branch=master)](http://travis-ci.org/nodeca/argparse)
5
+ [![NPM version](https://img.shields.io/npm/v/argparse.svg)](https://www.npmjs.org/package/argparse)
6
+
7
+ CLI arguments parser for node.js. Javascript port of python's
8
+ [argparse](http://docs.python.org/dev/library/argparse.html) module
9
+ (original version 3.2). That's a full port, except some very rare options,
10
+ recorded in issue tracker.
11
+
12
+ **NB. Difference with original.**
13
+
14
+ - Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/).
15
+ - Use `defaultValue` instead of `default`.
16
+ - Use `argparse.Const.REMAINDER` instead of `argparse.REMAINDER`, and
17
+ similarly for constant values `OPTIONAL`, `ZERO_OR_MORE`, and `ONE_OR_MORE`
18
+ (aliases for `nargs` values `'?'`, `'*'`, `'+'`, respectively), and
19
+ `SUPPRESS`.
20
+
21
+
22
+ Example
23
+ =======
24
+
25
+ test.js file:
26
+
27
+ ```javascript
28
+ #!/usr/bin/env node
29
+ 'use strict';
30
+
31
+ var ArgumentParser = require('../lib/argparse').ArgumentParser;
32
+ var parser = new ArgumentParser({
33
+ version: '0.0.1',
34
+ addHelp:true,
35
+ description: 'Argparse example'
36
+ });
37
+ parser.addArgument(
38
+ [ '-f', '--foo' ],
39
+ {
40
+ help: 'foo bar'
41
+ }
42
+ );
43
+ parser.addArgument(
44
+ [ '-b', '--bar' ],
45
+ {
46
+ help: 'bar foo'
47
+ }
48
+ );
49
+ parser.addArgument(
50
+ '--baz',
51
+ {
52
+ help: 'baz bar'
53
+ }
54
+ );
55
+ var args = parser.parseArgs();
56
+ console.dir(args);
57
+ ```
58
+
59
+ Display help:
60
+
61
+ ```
62
+ $ ./test.js -h
63
+ usage: example.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ]
64
+
65
+ Argparse example
66
+
67
+ Optional arguments:
68
+ -h, --help Show this help message and exit.
69
+ -v, --version Show program's version number and exit.
70
+ -f FOO, --foo FOO foo bar
71
+ -b BAR, --bar BAR bar foo
72
+ --baz BAZ baz bar
73
+ ```
74
+
75
+ Parse arguments:
76
+
77
+ ```
78
+ $ ./test.js -f=3 --bar=4 --baz 5
79
+ { foo: '3', bar: '4', baz: '5' }
80
+ ```
81
+
82
+ More [examples](https://github.com/nodeca/argparse/tree/master/examples).
83
+
84
+
85
+ ArgumentParser objects
86
+ ======================
87
+
88
+ ```
89
+ new ArgumentParser({parameters hash});
90
+ ```
91
+
92
+ Creates a new ArgumentParser object.
93
+
94
+ **Supported params:**
95
+
96
+ - ```description``` - Text to display before the argument help.
97
+ - ```epilog``` - Text to display after the argument help.
98
+ - ```addHelp``` - Add a -h/–help option to the parser. (default: true)
99
+ - ```argumentDefault``` - Set the global default value for arguments. (default: null)
100
+ - ```parents``` - A list of ArgumentParser objects whose arguments should also be included.
101
+ - ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘)
102
+ - ```formatterClass``` - A class for customizing the help output.
103
+ - ```prog``` - The name of the program (default: `path.basename(process.argv[1])`)
104
+ - ```usage``` - The string describing the program usage (default: generated)
105
+ - ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals.
106
+
107
+ **Not supported yet**
108
+
109
+ - ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read.
110
+
111
+
112
+ Details in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects)
113
+
114
+
115
+ addArgument() method
116
+ ====================
117
+
118
+ ```
119
+ ArgumentParser.addArgument(name or flag or [name] or [flags...], {options})
120
+ ```
121
+
122
+ Defines how a single command-line argument should be parsed.
123
+
124
+ - ```name or flag or [name] or [flags...]``` - Either a positional name
125
+ (e.g., `'foo'`), a single option (e.g., `'-f'` or `'--foo'`), an array
126
+ of a single positional name (e.g., `['foo']`), or an array of options
127
+ (e.g., `['-f', '--foo']`).
128
+
129
+ Options:
130
+
131
+ - ```action``` - The basic type of action to be taken when this argument is encountered at the command line.
132
+ - ```nargs```- The number of command-line arguments that should be consumed.
133
+ - ```constant``` - A constant value required by some action and nargs selections.
134
+ - ```defaultValue``` - The value produced if the argument is absent from the command line.
135
+ - ```type``` - The type to which the command-line argument should be converted.
136
+ - ```choices``` - A container of the allowable values for the argument.
137
+ - ```required``` - Whether or not the command-line option may be omitted (optionals only).
138
+ - ```help``` - A brief description of what the argument does.
139
+ - ```metavar``` - A name for the argument in usage messages.
140
+ - ```dest``` - The name of the attribute to be added to the object returned by parseArgs().
141
+
142
+ Details in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method)
143
+
144
+
145
+ Action (some details)
146
+ ================
147
+
148
+ ArgumentParser objects associate command-line arguments with actions.
149
+ These actions can do just about anything with the command-line arguments associated
150
+ with them, though most actions simply add an attribute to the object returned by
151
+ parseArgs(). The action keyword argument specifies how the command-line arguments
152
+ should be handled. The supported actions are:
153
+
154
+ - ```store``` - Just stores the argument’s value. This is the default action.
155
+ - ```storeConst``` - Stores value, specified by the const keyword argument.
156
+ (Note that the const keyword argument defaults to the rather unhelpful None.)
157
+ The 'storeConst' action is most commonly used with optional arguments, that
158
+ specify some sort of flag.
159
+ - ```storeTrue``` and ```storeFalse``` - Stores values True and False
160
+ respectively. These are special cases of 'storeConst'.
161
+ - ```append``` - Stores a list, and appends each argument value to the list.
162
+ This is useful to allow an option to be specified multiple times.
163
+ - ```appendConst``` - Stores a list, and appends value, specified by the
164
+ const keyword argument to the list. (Note, that the const keyword argument defaults
165
+ is None.) The 'appendConst' action is typically used when multiple arguments need
166
+ to store constants to the same list.
167
+ - ```count``` - Counts the number of times a keyword argument occurs. For example,
168
+ used for increasing verbosity levels.
169
+ - ```help``` - Prints a complete help message for all the options in the current
170
+ parser and then exits. By default a help action is automatically added to the parser.
171
+ See ArgumentParser for details of how the output is created.
172
+ - ```version``` - Prints version information and exit. Expects a `version=`
173
+ keyword argument in the addArgument() call.
174
+
175
+ Details in [original action guide](http://docs.python.org/dev/library/argparse.html#action)
176
+
177
+
178
+ Sub-commands
179
+ ============
180
+
181
+ ArgumentParser.addSubparsers()
182
+
183
+ Many programs split their functionality into a number of sub-commands, for
184
+ example, the svn program can invoke sub-commands like `svn checkout`, `svn update`,
185
+ and `svn commit`. Splitting up functionality this way can be a particularly good
186
+ idea when a program performs several different functions which require different
187
+ kinds of command-line arguments. `ArgumentParser` supports creation of such
188
+ sub-commands with `addSubparsers()` method. The `addSubparsers()` method is
189
+ normally called with no arguments and returns an special action object.
190
+ This object has a single method `addParser()`, which takes a command name and
191
+ any `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object
192
+ that can be modified as usual.
193
+
194
+ Example:
195
+
196
+ sub_commands.js
197
+ ```javascript
198
+ #!/usr/bin/env node
199
+ 'use strict';
200
+
201
+ var ArgumentParser = require('../lib/argparse').ArgumentParser;
202
+ var parser = new ArgumentParser({
203
+ version: '0.0.1',
204
+ addHelp:true,
205
+ description: 'Argparse examples: sub-commands',
206
+ });
207
+
208
+ var subparsers = parser.addSubparsers({
209
+ title:'subcommands',
210
+ dest:"subcommand_name"
211
+ });
212
+
213
+ var bar = subparsers.addParser('c1', {addHelp:true});
214
+ bar.addArgument(
215
+ [ '-f', '--foo' ],
216
+ {
217
+ action: 'store',
218
+ help: 'foo3 bar3'
219
+ }
220
+ );
221
+ var bar = subparsers.addParser(
222
+ 'c2',
223
+ {aliases:['co'], addHelp:true}
224
+ );
225
+ bar.addArgument(
226
+ [ '-b', '--bar' ],
227
+ {
228
+ action: 'store',
229
+ type: 'int',
230
+ help: 'foo3 bar3'
231
+ }
232
+ );
233
+
234
+ var args = parser.parseArgs();
235
+ console.dir(args);
236
+
237
+ ```
238
+
239
+ Details in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands)
240
+
241
+
242
+ Contributors
243
+ ============
244
+
245
+ - [Eugene Shkuropat](https://github.com/shkuropat)
246
+ - [Paul Jacobson](https://github.com/hpaulj)
247
+
248
+ [others](https://github.com/nodeca/argparse/graphs/contributors)
249
+
250
+ License
251
+ =======
252
+
253
+ Copyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin).
254
+ Released under the MIT license. See
255
+ [LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details.
256
+
257
+
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = require('./lib/argparse');
@@ -0,0 +1,47 @@
1
+ /*:nodoc:*
2
+ * class ActionAppendConstant
3
+ *
4
+ * This stores a list, and appends the value specified by
5
+ * the const keyword argument to the list.
6
+ * (Note that the const keyword argument defaults to null.)
7
+ * The 'appendConst' action is typically useful when multiple
8
+ * arguments need to store constants to the same list.
9
+ *
10
+ * This class inherited from [[Action]]
11
+ **/
12
+
13
+ 'use strict';
14
+
15
+ var util = require('util');
16
+
17
+ var Action = require('../../action');
18
+
19
+ /*:nodoc:*
20
+ * new ActionAppendConstant(options)
21
+ * - options (object): options hash see [[Action.new]]
22
+ *
23
+ **/
24
+ var ActionAppendConstant = module.exports = function ActionAppendConstant(options) {
25
+ options = options || {};
26
+ options.nargs = 0;
27
+ if (typeof options.constant === 'undefined') {
28
+ throw new Error('constant option is required for appendAction');
29
+ }
30
+ Action.call(this, options);
31
+ };
32
+ util.inherits(ActionAppendConstant, Action);
33
+
34
+ /*:nodoc:*
35
+ * ActionAppendConstant#call(parser, namespace, values, optionString) -> Void
36
+ * - parser (ArgumentParser): current parser
37
+ * - namespace (Namespace): namespace for output data
38
+ * - values (Array): parsed values
39
+ * - optionString (Array): input option string(not parsed)
40
+ *
41
+ * Call the action. Save result in namespace object
42
+ **/
43
+ ActionAppendConstant.prototype.call = function (parser, namespace) {
44
+ var items = [].concat(namespace[this.dest] || []);
45
+ items.push(this.constant);
46
+ namespace.set(this.dest, items);
47
+ };
@@ -0,0 +1,53 @@
1
+ /*:nodoc:*
2
+ * class ActionAppend
3
+ *
4
+ * This action stores a list, and appends each argument value to the list.
5
+ * This is useful to allow an option to be specified multiple times.
6
+ * This class inherided from [[Action]]
7
+ *
8
+ **/
9
+
10
+ 'use strict';
11
+
12
+ var util = require('util');
13
+
14
+ var Action = require('../action');
15
+
16
+ // Constants
17
+ var c = require('../const');
18
+
19
+ /*:nodoc:*
20
+ * new ActionAppend(options)
21
+ * - options (object): options hash see [[Action.new]]
22
+ *
23
+ * Note: options.nargs should be optional for constants
24
+ * and more then zero for other
25
+ **/
26
+ var ActionAppend = module.exports = function ActionAppend(options) {
27
+ options = options || {};
28
+ if (this.nargs <= 0) {
29
+ throw new Error('nargs for append actions must be > 0; if arg ' +
30
+ 'strings are not supplying the value to append, ' +
31
+ 'the append const action may be more appropriate');
32
+ }
33
+ if (!!this.constant && this.nargs !== c.OPTIONAL) {
34
+ throw new Error('nargs must be OPTIONAL to supply const');
35
+ }
36
+ Action.call(this, options);
37
+ };
38
+ util.inherits(ActionAppend, Action);
39
+
40
+ /*:nodoc:*
41
+ * ActionAppend#call(parser, namespace, values, optionString) -> Void
42
+ * - parser (ArgumentParser): current parser
43
+ * - namespace (Namespace): namespace for output data
44
+ * - values (Array): parsed values
45
+ * - optionString (Array): input option string(not parsed)
46
+ *
47
+ * Call the action. Save result in namespace object
48
+ **/
49
+ ActionAppend.prototype.call = function (parser, namespace, values) {
50
+ var items = (namespace[this.dest] || []).slice();
51
+ items.push(values);
52
+ namespace.set(this.dest, items);
53
+ };
@@ -0,0 +1,40 @@
1
+ /*:nodoc:*
2
+ * class ActionCount
3
+ *
4
+ * This counts the number of times a keyword argument occurs.
5
+ * For example, this is useful for increasing verbosity levels
6
+ *
7
+ * This class inherided from [[Action]]
8
+ *
9
+ **/
10
+ 'use strict';
11
+
12
+ var util = require('util');
13
+
14
+ var Action = require('../action');
15
+
16
+ /*:nodoc:*
17
+ * new ActionCount(options)
18
+ * - options (object): options hash see [[Action.new]]
19
+ *
20
+ **/
21
+ var ActionCount = module.exports = function ActionCount(options) {
22
+ options = options || {};
23
+ options.nargs = 0;
24
+
25
+ Action.call(this, options);
26
+ };
27
+ util.inherits(ActionCount, Action);
28
+
29
+ /*:nodoc:*
30
+ * ActionCount#call(parser, namespace, values, optionString) -> Void
31
+ * - parser (ArgumentParser): current parser
32
+ * - namespace (Namespace): namespace for output data
33
+ * - values (Array): parsed values
34
+ * - optionString (Array): input option string(not parsed)
35
+ *
36
+ * Call the action. Save result in namespace object
37
+ **/
38
+ ActionCount.prototype.call = function (parser, namespace) {
39
+ namespace.set(this.dest, (namespace[this.dest] || 0) + 1);
40
+ };
@@ -0,0 +1,47 @@
1
+ /*:nodoc:*
2
+ * class ActionHelp
3
+ *
4
+ * Support action for printing help
5
+ * This class inherided from [[Action]]
6
+ **/
7
+ 'use strict';
8
+
9
+ var util = require('util');
10
+
11
+ var Action = require('../action');
12
+
13
+ // Constants
14
+ var c = require('../const');
15
+
16
+ /*:nodoc:*
17
+ * new ActionHelp(options)
18
+ * - options (object): options hash see [[Action.new]]
19
+ *
20
+ **/
21
+ var ActionHelp = module.exports = function ActionHelp(options) {
22
+ options = options || {};
23
+ if (options.defaultValue !== null) {
24
+ options.defaultValue = options.defaultValue;
25
+ } else {
26
+ options.defaultValue = c.SUPPRESS;
27
+ }
28
+ options.dest = (options.dest !== null ? options.dest : c.SUPPRESS);
29
+ options.nargs = 0;
30
+ Action.call(this, options);
31
+
32
+ };
33
+ util.inherits(ActionHelp, Action);
34
+
35
+ /*:nodoc:*
36
+ * ActionHelp#call(parser, namespace, values, optionString)
37
+ * - parser (ArgumentParser): current parser
38
+ * - namespace (Namespace): namespace for output data
39
+ * - values (Array): parsed values
40
+ * - optionString (Array): input option string(not parsed)
41
+ *
42
+ * Print help and exit
43
+ **/
44
+ ActionHelp.prototype.call = function (parser) {
45
+ parser.printHelp();
46
+ parser.exit();
47
+ };
@@ -0,0 +1,43 @@
1
+ /*:nodoc:*
2
+ * class ActionStoreConstant
3
+ *
4
+ * This action stores the value specified by the const keyword argument.
5
+ * (Note that the const keyword argument defaults to the rather unhelpful null.)
6
+ * The 'store_const' action is most commonly used with optional
7
+ * arguments that specify some sort of flag.
8
+ *
9
+ * This class inherited from [[Action]]
10
+ **/
11
+ 'use strict';
12
+
13
+ var util = require('util');
14
+
15
+ var Action = require('../../action');
16
+
17
+ /*:nodoc:*
18
+ * new ActionStoreConstant(options)
19
+ * - options (object): options hash see [[Action.new]]
20
+ *
21
+ **/
22
+ var ActionStoreConstant = module.exports = function ActionStoreConstant(options) {
23
+ options = options || {};
24
+ options.nargs = 0;
25
+ if (typeof options.constant === 'undefined') {
26
+ throw new Error('constant option is required for storeAction');
27
+ }
28
+ Action.call(this, options);
29
+ };
30
+ util.inherits(ActionStoreConstant, Action);
31
+
32
+ /*:nodoc:*
33
+ * ActionStoreConstant#call(parser, namespace, values, optionString) -> Void
34
+ * - parser (ArgumentParser): current parser
35
+ * - namespace (Namespace): namespace for output data
36
+ * - values (Array): parsed values
37
+ * - optionString (Array): input option string(not parsed)
38
+ *
39
+ * Call the action. Save result in namespace object
40
+ **/
41
+ ActionStoreConstant.prototype.call = function (parser, namespace) {
42
+ namespace.set(this.dest, this.constant);
43
+ };
@@ -0,0 +1,27 @@
1
+ /*:nodoc:*
2
+ * class ActionStoreFalse
3
+ *
4
+ * This action store the values False respectively.
5
+ * This is special cases of 'storeConst'
6
+ *
7
+ * This class inherited from [[Action]]
8
+ **/
9
+
10
+ 'use strict';
11
+
12
+ var util = require('util');
13
+
14
+ var ActionStoreConstant = require('./constant');
15
+
16
+ /*:nodoc:*
17
+ * new ActionStoreFalse(options)
18
+ * - options (object): hash of options see [[Action.new]]
19
+ *
20
+ **/
21
+ var ActionStoreFalse = module.exports = function ActionStoreFalse(options) {
22
+ options = options || {};
23
+ options.constant = false;
24
+ options.defaultValue = options.defaultValue !== null ? options.defaultValue : true;
25
+ ActionStoreConstant.call(this, options);
26
+ };
27
+ util.inherits(ActionStoreFalse, ActionStoreConstant);