@microwiseai/snapshot 0.3.32 → 0.3.36

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 (480) hide show
  1. package/dist/commands/install.d.ts +1 -0
  2. package/dist/commands/install.d.ts.map +1 -1
  3. package/dist/commands/install.js +101 -12
  4. package/dist/commands/install.js.map +1 -1
  5. package/dist/lib/access-sync.d.ts.map +1 -1
  6. package/dist/lib/access-sync.js +2 -3
  7. package/dist/lib/access-sync.js.map +1 -1
  8. package/dist/lib/config.d.ts +11 -7
  9. package/dist/lib/config.d.ts.map +1 -1
  10. package/dist/lib/config.js +22 -13
  11. package/dist/lib/config.js.map +1 -1
  12. package/dist/lib/config.test.d.ts +2 -0
  13. package/dist/lib/config.test.d.ts.map +1 -0
  14. package/dist/lib/config.test.js +186 -0
  15. package/dist/lib/config.test.js.map +1 -0
  16. package/dist/lib/gitlab.d.ts.map +1 -1
  17. package/dist/lib/gitlab.js +5 -13
  18. package/dist/lib/gitlab.js.map +1 -1
  19. package/dist/lib/package-resolver.js +2 -2
  20. package/dist/lib/package-resolver.js.map +1 -1
  21. package/dist/lib/session.d.ts +37 -0
  22. package/dist/lib/session.d.ts.map +1 -0
  23. package/dist/lib/session.js +77 -0
  24. package/dist/lib/session.js.map +1 -0
  25. package/dist/lib/skit-adapter.d.ts +5 -5
  26. package/dist/lib/skit-adapter.d.ts.map +1 -1
  27. package/dist/lib/skit-adapter.js +58 -21
  28. package/dist/lib/skit-adapter.js.map +1 -1
  29. package/dist/lib/transitive-resolver.d.ts +4 -1
  30. package/dist/lib/transitive-resolver.d.ts.map +1 -1
  31. package/dist/lib/transitive-resolver.js +13 -8
  32. package/dist/lib/transitive-resolver.js.map +1 -1
  33. package/dist/lib/transitive-resolver.test.d.ts +2 -0
  34. package/dist/lib/transitive-resolver.test.d.ts.map +1 -0
  35. package/dist/lib/transitive-resolver.test.js +279 -0
  36. package/dist/lib/transitive-resolver.test.js.map +1 -0
  37. package/node_modules/@isaacs/fs-minipass/LICENSE +15 -0
  38. package/node_modules/@isaacs/fs-minipass/README.md +71 -0
  39. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts +118 -0
  40. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts.map +1 -0
  41. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +430 -0
  42. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js.map +1 -0
  43. package/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +3 -0
  44. package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts +118 -0
  45. package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts.map +1 -0
  46. package/node_modules/@isaacs/fs-minipass/dist/esm/index.js +420 -0
  47. package/node_modules/@isaacs/fs-minipass/dist/esm/index.js.map +1 -0
  48. package/node_modules/@isaacs/fs-minipass/dist/esm/package.json +3 -0
  49. package/node_modules/@isaacs/fs-minipass/package.json +72 -0
  50. package/node_modules/@ist/registry-config/dist/index.d.ts +3 -0
  51. package/node_modules/@ist/registry-config/dist/index.js +3 -0
  52. package/node_modules/@ist/registry-config/dist/registry-url.d.ts +1 -0
  53. package/node_modules/@ist/registry-config/dist/registry-url.js +1 -0
  54. package/node_modules/@ist/registry-config/dist/scope-mapping.d.ts +6 -0
  55. package/node_modules/@ist/registry-config/dist/scope-mapping.js +7 -0
  56. package/node_modules/@ist/registry-config/dist/types.d.ts +4 -0
  57. package/node_modules/@ist/registry-config/dist/types.js +1 -0
  58. package/node_modules/@ist/registry-config/package.json +32 -0
  59. package/node_modules/@ist/skit/README.md +204 -0
  60. package/node_modules/@ist/skit/dist/commands/browse.d.ts +9 -0
  61. package/node_modules/@ist/skit/dist/commands/browse.d.ts.map +1 -0
  62. package/node_modules/@ist/skit/dist/commands/browse.js +127 -0
  63. package/node_modules/@ist/skit/dist/commands/browse.js.map +1 -0
  64. package/node_modules/@ist/skit/dist/commands/gitignore.d.ts +9 -0
  65. package/node_modules/@ist/skit/dist/commands/gitignore.d.ts.map +1 -0
  66. package/node_modules/@ist/skit/dist/commands/gitignore.js +59 -0
  67. package/node_modules/@ist/skit/dist/commands/gitignore.js.map +1 -0
  68. package/node_modules/@ist/skit/dist/commands/info.d.ts +9 -0
  69. package/node_modules/@ist/skit/dist/commands/info.d.ts.map +1 -0
  70. package/node_modules/@ist/skit/dist/commands/info.js +80 -0
  71. package/node_modules/@ist/skit/dist/commands/info.js.map +1 -0
  72. package/node_modules/@ist/skit/dist/commands/install.d.ts +13 -0
  73. package/node_modules/@ist/skit/dist/commands/install.d.ts.map +1 -0
  74. package/node_modules/@ist/skit/dist/commands/install.js +150 -0
  75. package/node_modules/@ist/skit/dist/commands/install.js.map +1 -0
  76. package/node_modules/@ist/skit/dist/commands/licenses.d.ts +9 -0
  77. package/node_modules/@ist/skit/dist/commands/licenses.d.ts.map +1 -0
  78. package/node_modules/@ist/skit/dist/commands/licenses.js +125 -0
  79. package/node_modules/@ist/skit/dist/commands/licenses.js.map +1 -0
  80. package/node_modules/@ist/skit/dist/commands/list.d.ts +12 -0
  81. package/node_modules/@ist/skit/dist/commands/list.d.ts.map +1 -0
  82. package/node_modules/@ist/skit/dist/commands/list.js +41 -0
  83. package/node_modules/@ist/skit/dist/commands/list.js.map +1 -0
  84. package/node_modules/@ist/skit/dist/commands/login.d.ts +10 -0
  85. package/node_modules/@ist/skit/dist/commands/login.d.ts.map +1 -0
  86. package/node_modules/@ist/skit/dist/commands/login.js +112 -0
  87. package/node_modules/@ist/skit/dist/commands/login.js.map +1 -0
  88. package/node_modules/@ist/skit/dist/commands/logout.d.ts +5 -0
  89. package/node_modules/@ist/skit/dist/commands/logout.d.ts.map +1 -0
  90. package/node_modules/@ist/skit/dist/commands/logout.js +30 -0
  91. package/node_modules/@ist/skit/dist/commands/logout.js.map +1 -0
  92. package/node_modules/@ist/skit/dist/commands/pack.d.ts +10 -0
  93. package/node_modules/@ist/skit/dist/commands/pack.d.ts.map +1 -0
  94. package/node_modules/@ist/skit/dist/commands/pack.js +185 -0
  95. package/node_modules/@ist/skit/dist/commands/pack.js.map +1 -0
  96. package/node_modules/@ist/skit/dist/commands/publish.d.ts +11 -0
  97. package/node_modules/@ist/skit/dist/commands/publish.d.ts.map +1 -0
  98. package/node_modules/@ist/skit/dist/commands/publish.js +108 -0
  99. package/node_modules/@ist/skit/dist/commands/publish.js.map +1 -0
  100. package/node_modules/@ist/skit/dist/commands/purchase.d.ts +9 -0
  101. package/node_modules/@ist/skit/dist/commands/purchase.d.ts.map +1 -0
  102. package/node_modules/@ist/skit/dist/commands/purchase.js +160 -0
  103. package/node_modules/@ist/skit/dist/commands/purchase.js.map +1 -0
  104. package/node_modules/@ist/skit/dist/commands/register.d.ts +10 -0
  105. package/node_modules/@ist/skit/dist/commands/register.d.ts.map +1 -0
  106. package/node_modules/@ist/skit/dist/commands/register.js +121 -0
  107. package/node_modules/@ist/skit/dist/commands/register.js.map +1 -0
  108. package/node_modules/@ist/skit/dist/commands/uninstall.d.ts +13 -0
  109. package/node_modules/@ist/skit/dist/commands/uninstall.d.ts.map +1 -0
  110. package/node_modules/@ist/skit/dist/commands/uninstall.js +138 -0
  111. package/node_modules/@ist/skit/dist/commands/uninstall.js.map +1 -0
  112. package/node_modules/@ist/skit/dist/commands/whoami.d.ts +9 -0
  113. package/node_modules/@ist/skit/dist/commands/whoami.d.ts.map +1 -0
  114. package/node_modules/@ist/skit/dist/commands/whoami.js +79 -0
  115. package/node_modules/@ist/skit/dist/commands/whoami.js.map +1 -0
  116. package/node_modules/@ist/skit/dist/index.d.ts +3 -0
  117. package/node_modules/@ist/skit/dist/index.d.ts.map +1 -0
  118. package/node_modules/@ist/skit/dist/index.js +69 -0
  119. package/node_modules/@ist/skit/dist/index.js.map +1 -0
  120. package/node_modules/@ist/skit/dist/lib.d.ts +144 -0
  121. package/node_modules/@ist/skit/dist/lib.d.ts.map +1 -0
  122. package/node_modules/@ist/skit/dist/lib.js +542 -0
  123. package/node_modules/@ist/skit/dist/lib.js.map +1 -0
  124. package/node_modules/@ist/skit/dist/types/skit.d.ts +155 -0
  125. package/node_modules/@ist/skit/dist/types/skit.d.ts.map +1 -0
  126. package/node_modules/@ist/skit/dist/types/skit.js +20 -0
  127. package/node_modules/@ist/skit/dist/types/skit.js.map +1 -0
  128. package/node_modules/@ist/skit/dist/utils/api.d.ts +18 -0
  129. package/node_modules/@ist/skit/dist/utils/api.d.ts.map +1 -0
  130. package/node_modules/@ist/skit/dist/utils/api.js +26 -0
  131. package/node_modules/@ist/skit/dist/utils/api.js.map +1 -0
  132. package/node_modules/@ist/skit/dist/utils/auth.d.ts +62 -0
  133. package/node_modules/@ist/skit/dist/utils/auth.d.ts.map +1 -0
  134. package/node_modules/@ist/skit/dist/utils/auth.js +172 -0
  135. package/node_modules/@ist/skit/dist/utils/auth.js.map +1 -0
  136. package/node_modules/@ist/skit/dist/utils/file-copy.d.ts +26 -0
  137. package/node_modules/@ist/skit/dist/utils/file-copy.d.ts.map +1 -0
  138. package/node_modules/@ist/skit/dist/utils/file-copy.js +219 -0
  139. package/node_modules/@ist/skit/dist/utils/file-copy.js.map +1 -0
  140. package/node_modules/@ist/skit/dist/utils/hook-installer.d.ts +21 -0
  141. package/node_modules/@ist/skit/dist/utils/hook-installer.d.ts.map +1 -0
  142. package/node_modules/@ist/skit/dist/utils/hook-installer.js +98 -0
  143. package/node_modules/@ist/skit/dist/utils/hook-installer.js.map +1 -0
  144. package/node_modules/@ist/skit/dist/utils/installed-registry.d.ts +50 -0
  145. package/node_modules/@ist/skit/dist/utils/installed-registry.d.ts.map +1 -0
  146. package/node_modules/@ist/skit/dist/utils/installed-registry.js +108 -0
  147. package/node_modules/@ist/skit/dist/utils/installed-registry.js.map +1 -0
  148. package/node_modules/@ist/skit/dist/utils/skit-parser.d.ts +10 -0
  149. package/node_modules/@ist/skit/dist/utils/skit-parser.d.ts.map +1 -0
  150. package/node_modules/@ist/skit/dist/utils/skit-parser.js +52 -0
  151. package/node_modules/@ist/skit/dist/utils/skit-parser.js.map +1 -0
  152. package/node_modules/@ist/skit/dist/utils/wrapper-generator.d.ts +74 -0
  153. package/node_modules/@ist/skit/dist/utils/wrapper-generator.d.ts.map +1 -0
  154. package/node_modules/@ist/skit/dist/utils/wrapper-generator.js +280 -0
  155. package/node_modules/@ist/skit/dist/utils/wrapper-generator.js.map +1 -0
  156. package/node_modules/@ist/skit/package.json +54 -0
  157. package/node_modules/chownr/LICENSE.md +63 -0
  158. package/node_modules/chownr/README.md +3 -0
  159. package/node_modules/chownr/dist/commonjs/index.d.ts +3 -0
  160. package/node_modules/chownr/dist/commonjs/index.d.ts.map +1 -0
  161. package/node_modules/chownr/dist/commonjs/index.js +93 -0
  162. package/node_modules/chownr/dist/commonjs/index.js.map +1 -0
  163. package/node_modules/chownr/dist/commonjs/package.json +3 -0
  164. package/node_modules/chownr/dist/esm/index.d.ts +3 -0
  165. package/node_modules/chownr/dist/esm/index.d.ts.map +1 -0
  166. package/node_modules/chownr/dist/esm/index.js +85 -0
  167. package/node_modules/chownr/dist/esm/index.js.map +1 -0
  168. package/node_modules/chownr/dist/esm/package.json +3 -0
  169. package/node_modules/chownr/package.json +69 -0
  170. package/node_modules/commander/LICENSE +22 -0
  171. package/node_modules/commander/Readme.md +1157 -0
  172. package/node_modules/commander/esm.mjs +16 -0
  173. package/node_modules/commander/index.js +24 -0
  174. package/node_modules/commander/lib/argument.js +149 -0
  175. package/node_modules/commander/lib/command.js +2509 -0
  176. package/node_modules/commander/lib/error.js +39 -0
  177. package/node_modules/commander/lib/help.js +520 -0
  178. package/node_modules/commander/lib/option.js +330 -0
  179. package/node_modules/commander/lib/suggestSimilar.js +101 -0
  180. package/node_modules/commander/package-support.json +16 -0
  181. package/node_modules/commander/package.json +84 -0
  182. package/node_modules/commander/typings/esm.d.mts +3 -0
  183. package/node_modules/commander/typings/index.d.ts +969 -0
  184. package/node_modules/minipass/LICENSE.md +55 -0
  185. package/node_modules/minipass/README.md +825 -0
  186. package/node_modules/minipass/dist/commonjs/index.d.ts +545 -0
  187. package/node_modules/minipass/dist/commonjs/index.d.ts.map +1 -0
  188. package/node_modules/minipass/dist/commonjs/index.js +1038 -0
  189. package/node_modules/minipass/dist/commonjs/index.js.map +1 -0
  190. package/node_modules/minipass/dist/commonjs/package.json +3 -0
  191. package/node_modules/minipass/dist/esm/index.d.ts +545 -0
  192. package/node_modules/minipass/dist/esm/index.d.ts.map +1 -0
  193. package/node_modules/minipass/dist/esm/index.js +1020 -0
  194. package/node_modules/minipass/dist/esm/index.js.map +1 -0
  195. package/node_modules/minipass/dist/esm/package.json +3 -0
  196. package/node_modules/minipass/package.json +77 -0
  197. package/node_modules/minizlib/LICENSE +26 -0
  198. package/node_modules/minizlib/README.md +64 -0
  199. package/node_modules/minizlib/dist/commonjs/constants.d.ts +2 -0
  200. package/node_modules/minizlib/dist/commonjs/constants.d.ts.map +1 -0
  201. package/node_modules/minizlib/dist/commonjs/constants.js +123 -0
  202. package/node_modules/minizlib/dist/commonjs/constants.js.map +1 -0
  203. package/node_modules/minizlib/dist/commonjs/index.d.ts +99 -0
  204. package/node_modules/minizlib/dist/commonjs/index.d.ts.map +1 -0
  205. package/node_modules/minizlib/dist/commonjs/index.js +416 -0
  206. package/node_modules/minizlib/dist/commonjs/index.js.map +1 -0
  207. package/node_modules/minizlib/dist/commonjs/package.json +3 -0
  208. package/node_modules/minizlib/dist/esm/constants.d.ts +2 -0
  209. package/node_modules/minizlib/dist/esm/constants.d.ts.map +1 -0
  210. package/node_modules/minizlib/dist/esm/constants.js +117 -0
  211. package/node_modules/minizlib/dist/esm/constants.js.map +1 -0
  212. package/node_modules/minizlib/dist/esm/index.d.ts +99 -0
  213. package/node_modules/minizlib/dist/esm/index.d.ts.map +1 -0
  214. package/node_modules/minizlib/dist/esm/index.js +363 -0
  215. package/node_modules/minizlib/dist/esm/index.js.map +1 -0
  216. package/node_modules/minizlib/dist/esm/package.json +3 -0
  217. package/node_modules/minizlib/package.json +80 -0
  218. package/node_modules/tar/LICENSE.md +55 -0
  219. package/node_modules/tar/README.md +1224 -0
  220. package/node_modules/tar/dist/commonjs/create.d.ts +3 -0
  221. package/node_modules/tar/dist/commonjs/create.d.ts.map +1 -0
  222. package/node_modules/tar/dist/commonjs/create.js +82 -0
  223. package/node_modules/tar/dist/commonjs/create.js.map +1 -0
  224. package/node_modules/tar/dist/commonjs/cwd-error.d.ts +8 -0
  225. package/node_modules/tar/dist/commonjs/cwd-error.d.ts.map +1 -0
  226. package/node_modules/tar/dist/commonjs/cwd-error.js +18 -0
  227. package/node_modules/tar/dist/commonjs/cwd-error.js.map +1 -0
  228. package/node_modules/tar/dist/commonjs/extract.d.ts +3 -0
  229. package/node_modules/tar/dist/commonjs/extract.d.ts.map +1 -0
  230. package/node_modules/tar/dist/commonjs/extract.js +88 -0
  231. package/node_modules/tar/dist/commonjs/extract.js.map +1 -0
  232. package/node_modules/tar/dist/commonjs/get-write-flag.d.ts +2 -0
  233. package/node_modules/tar/dist/commonjs/get-write-flag.d.ts.map +1 -0
  234. package/node_modules/tar/dist/commonjs/get-write-flag.js +32 -0
  235. package/node_modules/tar/dist/commonjs/get-write-flag.js.map +1 -0
  236. package/node_modules/tar/dist/commonjs/header.d.ts +53 -0
  237. package/node_modules/tar/dist/commonjs/header.d.ts.map +1 -0
  238. package/node_modules/tar/dist/commonjs/header.js +312 -0
  239. package/node_modules/tar/dist/commonjs/header.js.map +1 -0
  240. package/node_modules/tar/dist/commonjs/index.d.ts +20 -0
  241. package/node_modules/tar/dist/commonjs/index.d.ts.map +1 -0
  242. package/node_modules/tar/dist/commonjs/index.js +64 -0
  243. package/node_modules/tar/dist/commonjs/index.js.map +1 -0
  244. package/node_modules/tar/dist/commonjs/index.min.js +4 -0
  245. package/node_modules/tar/dist/commonjs/index.min.js.map +7 -0
  246. package/node_modules/tar/dist/commonjs/large-numbers.d.ts +3 -0
  247. package/node_modules/tar/dist/commonjs/large-numbers.d.ts.map +1 -0
  248. package/node_modules/tar/dist/commonjs/large-numbers.js +99 -0
  249. package/node_modules/tar/dist/commonjs/large-numbers.js.map +1 -0
  250. package/node_modules/tar/dist/commonjs/list.d.ts +7 -0
  251. package/node_modules/tar/dist/commonjs/list.d.ts.map +1 -0
  252. package/node_modules/tar/dist/commonjs/list.js +145 -0
  253. package/node_modules/tar/dist/commonjs/list.js.map +1 -0
  254. package/node_modules/tar/dist/commonjs/make-command.d.ts +49 -0
  255. package/node_modules/tar/dist/commonjs/make-command.d.ts.map +1 -0
  256. package/node_modules/tar/dist/commonjs/make-command.js +52 -0
  257. package/node_modules/tar/dist/commonjs/make-command.js.map +1 -0
  258. package/node_modules/tar/dist/commonjs/mkdir.d.ts +25 -0
  259. package/node_modules/tar/dist/commonjs/mkdir.d.ts.map +1 -0
  260. package/node_modules/tar/dist/commonjs/mkdir.js +187 -0
  261. package/node_modules/tar/dist/commonjs/mkdir.js.map +1 -0
  262. package/node_modules/tar/dist/commonjs/mode-fix.d.ts +2 -0
  263. package/node_modules/tar/dist/commonjs/mode-fix.d.ts.map +1 -0
  264. package/node_modules/tar/dist/commonjs/mode-fix.js +29 -0
  265. package/node_modules/tar/dist/commonjs/mode-fix.js.map +1 -0
  266. package/node_modules/tar/dist/commonjs/normalize-unicode.d.ts +2 -0
  267. package/node_modules/tar/dist/commonjs/normalize-unicode.d.ts.map +1 -0
  268. package/node_modules/tar/dist/commonjs/normalize-unicode.js +38 -0
  269. package/node_modules/tar/dist/commonjs/normalize-unicode.js.map +1 -0
  270. package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts +2 -0
  271. package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts.map +1 -0
  272. package/node_modules/tar/dist/commonjs/normalize-windows-path.js +12 -0
  273. package/node_modules/tar/dist/commonjs/normalize-windows-path.js.map +1 -0
  274. package/node_modules/tar/dist/commonjs/options.d.ts +596 -0
  275. package/node_modules/tar/dist/commonjs/options.d.ts.map +1 -0
  276. package/node_modules/tar/dist/commonjs/options.js +66 -0
  277. package/node_modules/tar/dist/commonjs/options.js.map +1 -0
  278. package/node_modules/tar/dist/commonjs/pack.d.ts +102 -0
  279. package/node_modules/tar/dist/commonjs/pack.d.ts.map +1 -0
  280. package/node_modules/tar/dist/commonjs/pack.js +511 -0
  281. package/node_modules/tar/dist/commonjs/pack.js.map +1 -0
  282. package/node_modules/tar/dist/commonjs/package.json +3 -0
  283. package/node_modules/tar/dist/commonjs/parse.d.ts +85 -0
  284. package/node_modules/tar/dist/commonjs/parse.d.ts.map +1 -0
  285. package/node_modules/tar/dist/commonjs/parse.js +610 -0
  286. package/node_modules/tar/dist/commonjs/parse.js.map +1 -0
  287. package/node_modules/tar/dist/commonjs/path-reservations.d.ts +11 -0
  288. package/node_modules/tar/dist/commonjs/path-reservations.d.ts.map +1 -0
  289. package/node_modules/tar/dist/commonjs/path-reservations.js +170 -0
  290. package/node_modules/tar/dist/commonjs/path-reservations.js.map +1 -0
  291. package/node_modules/tar/dist/commonjs/pax.d.ts +26 -0
  292. package/node_modules/tar/dist/commonjs/pax.d.ts.map +1 -0
  293. package/node_modules/tar/dist/commonjs/pax.js +158 -0
  294. package/node_modules/tar/dist/commonjs/pax.js.map +1 -0
  295. package/node_modules/tar/dist/commonjs/process-umask.d.ts +2 -0
  296. package/node_modules/tar/dist/commonjs/process-umask.d.ts.map +1 -0
  297. package/node_modules/tar/dist/commonjs/process-umask.js +7 -0
  298. package/node_modules/tar/dist/commonjs/process-umask.js.map +1 -0
  299. package/node_modules/tar/dist/commonjs/read-entry.d.ts +36 -0
  300. package/node_modules/tar/dist/commonjs/read-entry.d.ts.map +1 -0
  301. package/node_modules/tar/dist/commonjs/read-entry.js +136 -0
  302. package/node_modules/tar/dist/commonjs/read-entry.js.map +1 -0
  303. package/node_modules/tar/dist/commonjs/replace.d.ts +2 -0
  304. package/node_modules/tar/dist/commonjs/replace.d.ts.map +1 -0
  305. package/node_modules/tar/dist/commonjs/replace.js +227 -0
  306. package/node_modules/tar/dist/commonjs/replace.js.map +1 -0
  307. package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts +2 -0
  308. package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts.map +1 -0
  309. package/node_modules/tar/dist/commonjs/strip-absolute-path.js +29 -0
  310. package/node_modules/tar/dist/commonjs/strip-absolute-path.js.map +1 -0
  311. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts +2 -0
  312. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts.map +1 -0
  313. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.js +18 -0
  314. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.js.map +1 -0
  315. package/node_modules/tar/dist/commonjs/symlink-error.d.ts +9 -0
  316. package/node_modules/tar/dist/commonjs/symlink-error.d.ts.map +1 -0
  317. package/node_modules/tar/dist/commonjs/symlink-error.js +19 -0
  318. package/node_modules/tar/dist/commonjs/symlink-error.js.map +1 -0
  319. package/node_modules/tar/dist/commonjs/types.d.ts +7 -0
  320. package/node_modules/tar/dist/commonjs/types.d.ts.map +1 -0
  321. package/node_modules/tar/dist/commonjs/types.js +50 -0
  322. package/node_modules/tar/dist/commonjs/types.js.map +1 -0
  323. package/node_modules/tar/dist/commonjs/unpack.d.ts +101 -0
  324. package/node_modules/tar/dist/commonjs/unpack.d.ts.map +1 -0
  325. package/node_modules/tar/dist/commonjs/unpack.js +932 -0
  326. package/node_modules/tar/dist/commonjs/unpack.js.map +1 -0
  327. package/node_modules/tar/dist/commonjs/update.d.ts +2 -0
  328. package/node_modules/tar/dist/commonjs/update.d.ts.map +1 -0
  329. package/node_modules/tar/dist/commonjs/update.js +33 -0
  330. package/node_modules/tar/dist/commonjs/update.js.map +1 -0
  331. package/node_modules/tar/dist/commonjs/warn-method.d.ts +24 -0
  332. package/node_modules/tar/dist/commonjs/warn-method.d.ts.map +1 -0
  333. package/node_modules/tar/dist/commonjs/warn-method.js +31 -0
  334. package/node_modules/tar/dist/commonjs/warn-method.js.map +1 -0
  335. package/node_modules/tar/dist/commonjs/winchars.d.ts +3 -0
  336. package/node_modules/tar/dist/commonjs/winchars.d.ts.map +1 -0
  337. package/node_modules/tar/dist/commonjs/winchars.js +14 -0
  338. package/node_modules/tar/dist/commonjs/winchars.js.map +1 -0
  339. package/node_modules/tar/dist/commonjs/write-entry.d.ts +129 -0
  340. package/node_modules/tar/dist/commonjs/write-entry.d.ts.map +1 -0
  341. package/node_modules/tar/dist/commonjs/write-entry.js +698 -0
  342. package/node_modules/tar/dist/commonjs/write-entry.js.map +1 -0
  343. package/node_modules/tar/dist/esm/create.d.ts +3 -0
  344. package/node_modules/tar/dist/esm/create.d.ts.map +1 -0
  345. package/node_modules/tar/dist/esm/create.js +76 -0
  346. package/node_modules/tar/dist/esm/create.js.map +1 -0
  347. package/node_modules/tar/dist/esm/cwd-error.d.ts +8 -0
  348. package/node_modules/tar/dist/esm/cwd-error.d.ts.map +1 -0
  349. package/node_modules/tar/dist/esm/cwd-error.js +14 -0
  350. package/node_modules/tar/dist/esm/cwd-error.js.map +1 -0
  351. package/node_modules/tar/dist/esm/extract.d.ts +3 -0
  352. package/node_modules/tar/dist/esm/extract.d.ts.map +1 -0
  353. package/node_modules/tar/dist/esm/extract.js +49 -0
  354. package/node_modules/tar/dist/esm/extract.js.map +1 -0
  355. package/node_modules/tar/dist/esm/get-write-flag.d.ts +2 -0
  356. package/node_modules/tar/dist/esm/get-write-flag.d.ts.map +1 -0
  357. package/node_modules/tar/dist/esm/get-write-flag.js +26 -0
  358. package/node_modules/tar/dist/esm/get-write-flag.js.map +1 -0
  359. package/node_modules/tar/dist/esm/header.d.ts +53 -0
  360. package/node_modules/tar/dist/esm/header.d.ts.map +1 -0
  361. package/node_modules/tar/dist/esm/header.js +275 -0
  362. package/node_modules/tar/dist/esm/header.js.map +1 -0
  363. package/node_modules/tar/dist/esm/index.d.ts +20 -0
  364. package/node_modules/tar/dist/esm/index.d.ts.map +1 -0
  365. package/node_modules/tar/dist/esm/index.js +20 -0
  366. package/node_modules/tar/dist/esm/index.js.map +1 -0
  367. package/node_modules/tar/dist/esm/index.min.js +4 -0
  368. package/node_modules/tar/dist/esm/index.min.js.map +7 -0
  369. package/node_modules/tar/dist/esm/large-numbers.d.ts +3 -0
  370. package/node_modules/tar/dist/esm/large-numbers.d.ts.map +1 -0
  371. package/node_modules/tar/dist/esm/large-numbers.js +94 -0
  372. package/node_modules/tar/dist/esm/large-numbers.js.map +1 -0
  373. package/node_modules/tar/dist/esm/list.d.ts +7 -0
  374. package/node_modules/tar/dist/esm/list.d.ts.map +1 -0
  375. package/node_modules/tar/dist/esm/list.js +105 -0
  376. package/node_modules/tar/dist/esm/list.js.map +1 -0
  377. package/node_modules/tar/dist/esm/make-command.d.ts +49 -0
  378. package/node_modules/tar/dist/esm/make-command.d.ts.map +1 -0
  379. package/node_modules/tar/dist/esm/make-command.js +48 -0
  380. package/node_modules/tar/dist/esm/make-command.js.map +1 -0
  381. package/node_modules/tar/dist/esm/mkdir.d.ts +25 -0
  382. package/node_modules/tar/dist/esm/mkdir.d.ts.map +1 -0
  383. package/node_modules/tar/dist/esm/mkdir.js +179 -0
  384. package/node_modules/tar/dist/esm/mkdir.js.map +1 -0
  385. package/node_modules/tar/dist/esm/mode-fix.d.ts +2 -0
  386. package/node_modules/tar/dist/esm/mode-fix.d.ts.map +1 -0
  387. package/node_modules/tar/dist/esm/mode-fix.js +25 -0
  388. package/node_modules/tar/dist/esm/mode-fix.js.map +1 -0
  389. package/node_modules/tar/dist/esm/normalize-unicode.d.ts +2 -0
  390. package/node_modules/tar/dist/esm/normalize-unicode.d.ts.map +1 -0
  391. package/node_modules/tar/dist/esm/normalize-unicode.js +34 -0
  392. package/node_modules/tar/dist/esm/normalize-unicode.js.map +1 -0
  393. package/node_modules/tar/dist/esm/normalize-windows-path.d.ts +2 -0
  394. package/node_modules/tar/dist/esm/normalize-windows-path.d.ts.map +1 -0
  395. package/node_modules/tar/dist/esm/normalize-windows-path.js +9 -0
  396. package/node_modules/tar/dist/esm/normalize-windows-path.js.map +1 -0
  397. package/node_modules/tar/dist/esm/options.d.ts +596 -0
  398. package/node_modules/tar/dist/esm/options.d.ts.map +1 -0
  399. package/node_modules/tar/dist/esm/options.js +54 -0
  400. package/node_modules/tar/dist/esm/options.js.map +1 -0
  401. package/node_modules/tar/dist/esm/pack.d.ts +102 -0
  402. package/node_modules/tar/dist/esm/pack.d.ts.map +1 -0
  403. package/node_modules/tar/dist/esm/pack.js +469 -0
  404. package/node_modules/tar/dist/esm/pack.js.map +1 -0
  405. package/node_modules/tar/dist/esm/package.json +3 -0
  406. package/node_modules/tar/dist/esm/parse.d.ts +85 -0
  407. package/node_modules/tar/dist/esm/parse.d.ts.map +1 -0
  408. package/node_modules/tar/dist/esm/parse.js +606 -0
  409. package/node_modules/tar/dist/esm/parse.js.map +1 -0
  410. package/node_modules/tar/dist/esm/path-reservations.d.ts +11 -0
  411. package/node_modules/tar/dist/esm/path-reservations.d.ts.map +1 -0
  412. package/node_modules/tar/dist/esm/path-reservations.js +166 -0
  413. package/node_modules/tar/dist/esm/path-reservations.js.map +1 -0
  414. package/node_modules/tar/dist/esm/pax.d.ts +26 -0
  415. package/node_modules/tar/dist/esm/pax.d.ts.map +1 -0
  416. package/node_modules/tar/dist/esm/pax.js +154 -0
  417. package/node_modules/tar/dist/esm/pax.js.map +1 -0
  418. package/node_modules/tar/dist/esm/process-umask.d.ts +2 -0
  419. package/node_modules/tar/dist/esm/process-umask.d.ts.map +1 -0
  420. package/node_modules/tar/dist/esm/process-umask.js +3 -0
  421. package/node_modules/tar/dist/esm/process-umask.js.map +1 -0
  422. package/node_modules/tar/dist/esm/read-entry.d.ts +36 -0
  423. package/node_modules/tar/dist/esm/read-entry.d.ts.map +1 -0
  424. package/node_modules/tar/dist/esm/read-entry.js +132 -0
  425. package/node_modules/tar/dist/esm/read-entry.js.map +1 -0
  426. package/node_modules/tar/dist/esm/replace.d.ts +2 -0
  427. package/node_modules/tar/dist/esm/replace.d.ts.map +1 -0
  428. package/node_modules/tar/dist/esm/replace.js +221 -0
  429. package/node_modules/tar/dist/esm/replace.js.map +1 -0
  430. package/node_modules/tar/dist/esm/strip-absolute-path.d.ts +2 -0
  431. package/node_modules/tar/dist/esm/strip-absolute-path.d.ts.map +1 -0
  432. package/node_modules/tar/dist/esm/strip-absolute-path.js +25 -0
  433. package/node_modules/tar/dist/esm/strip-absolute-path.js.map +1 -0
  434. package/node_modules/tar/dist/esm/strip-trailing-slashes.d.ts +2 -0
  435. package/node_modules/tar/dist/esm/strip-trailing-slashes.d.ts.map +1 -0
  436. package/node_modules/tar/dist/esm/strip-trailing-slashes.js +14 -0
  437. package/node_modules/tar/dist/esm/strip-trailing-slashes.js.map +1 -0
  438. package/node_modules/tar/dist/esm/symlink-error.d.ts +9 -0
  439. package/node_modules/tar/dist/esm/symlink-error.d.ts.map +1 -0
  440. package/node_modules/tar/dist/esm/symlink-error.js +15 -0
  441. package/node_modules/tar/dist/esm/symlink-error.js.map +1 -0
  442. package/node_modules/tar/dist/esm/types.d.ts +7 -0
  443. package/node_modules/tar/dist/esm/types.d.ts.map +1 -0
  444. package/node_modules/tar/dist/esm/types.js +45 -0
  445. package/node_modules/tar/dist/esm/types.js.map +1 -0
  446. package/node_modules/tar/dist/esm/unpack.d.ts +101 -0
  447. package/node_modules/tar/dist/esm/unpack.d.ts.map +1 -0
  448. package/node_modules/tar/dist/esm/unpack.js +891 -0
  449. package/node_modules/tar/dist/esm/unpack.js.map +1 -0
  450. package/node_modules/tar/dist/esm/update.d.ts +2 -0
  451. package/node_modules/tar/dist/esm/update.d.ts.map +1 -0
  452. package/node_modules/tar/dist/esm/update.js +30 -0
  453. package/node_modules/tar/dist/esm/update.js.map +1 -0
  454. package/node_modules/tar/dist/esm/warn-method.d.ts +24 -0
  455. package/node_modules/tar/dist/esm/warn-method.d.ts.map +1 -0
  456. package/node_modules/tar/dist/esm/warn-method.js +27 -0
  457. package/node_modules/tar/dist/esm/warn-method.js.map +1 -0
  458. package/node_modules/tar/dist/esm/winchars.d.ts +3 -0
  459. package/node_modules/tar/dist/esm/winchars.d.ts.map +1 -0
  460. package/node_modules/tar/dist/esm/winchars.js +9 -0
  461. package/node_modules/tar/dist/esm/winchars.js.map +1 -0
  462. package/node_modules/tar/dist/esm/write-entry.d.ts +129 -0
  463. package/node_modules/tar/dist/esm/write-entry.d.ts.map +1 -0
  464. package/node_modules/tar/dist/esm/write-entry.js +656 -0
  465. package/node_modules/tar/dist/esm/write-entry.js.map +1 -0
  466. package/node_modules/tar/package.json +297 -0
  467. package/node_modules/yallist/LICENSE.md +63 -0
  468. package/node_modules/yallist/README.md +205 -0
  469. package/node_modules/yallist/dist/commonjs/index.d.ts +39 -0
  470. package/node_modules/yallist/dist/commonjs/index.d.ts.map +1 -0
  471. package/node_modules/yallist/dist/commonjs/index.js +384 -0
  472. package/node_modules/yallist/dist/commonjs/index.js.map +1 -0
  473. package/node_modules/yallist/dist/commonjs/package.json +3 -0
  474. package/node_modules/yallist/dist/esm/index.d.ts +39 -0
  475. package/node_modules/yallist/dist/esm/index.d.ts.map +1 -0
  476. package/node_modules/yallist/dist/esm/index.js +379 -0
  477. package/node_modules/yallist/dist/esm/index.js.map +1 -0
  478. package/node_modules/yallist/dist/esm/package.json +3 -0
  479. package/node_modules/yallist/package.json +68 -0
  480. package/package.json +9 -3
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Wrapper Script Generator
3
+ *
4
+ * Creates wrapper scripts that transparently invoke kits through the SDK
5
+ * for license checking and telemetry.
6
+ */
7
+ export interface SkitYamlManifest {
8
+ name: string;
9
+ version: string;
10
+ description?: string;
11
+ tier: 'free' | 'free_account' | 'subscription';
12
+ binary: string;
13
+ commands: Record<string, {
14
+ description: string;
15
+ license?: 'free' | 'free_account' | 'subscription';
16
+ }>;
17
+ }
18
+ /**
19
+ * Parse skit.yaml (simple YAML parser)
20
+ */
21
+ export declare function parseSkitYaml(content: string): SkitYamlManifest | null;
22
+ /**
23
+ * Check if a package has skit.yaml
24
+ */
25
+ export declare function hasSkitYaml(packageDir: string): Promise<boolean>;
26
+ /**
27
+ * Read and parse skit.yaml from package directory
28
+ */
29
+ export declare function readSkitYaml(packageDir: string): Promise<SkitYamlManifest | null>;
30
+ /**
31
+ * Get the CLI name from kit name
32
+ * Examples:
33
+ * devtools-kit -> devtools
34
+ * my-awesome-kit -> my-awesome
35
+ * simple -> simple
36
+ */
37
+ export declare function getCliName(kitName: string): string;
38
+ /**
39
+ * Install kit package to ~/.skit/packages/
40
+ */
41
+ export declare function installKitPackage(sourceDir: string, kitName: string): Promise<string>;
42
+ /**
43
+ * Create wrapper script in ~/.skit/bin/
44
+ */
45
+ export declare function createWrapper(kitName: string, kitPath: string): Promise<string>;
46
+ /**
47
+ * Remove wrapper script
48
+ */
49
+ export declare function removeWrapper(kitName: string): Promise<void>;
50
+ /**
51
+ * Remove kit package from ~/.skit/packages/
52
+ */
53
+ export declare function removeKitPackage(kitName: string): Promise<void>;
54
+ /**
55
+ * Get installation paths
56
+ */
57
+ export declare function getSkitPaths(): {
58
+ home: string;
59
+ bin: string;
60
+ packages: string;
61
+ };
62
+ /**
63
+ * Check if ~/.skit/bin is in PATH
64
+ */
65
+ export declare function isBinInPath(): boolean;
66
+ /**
67
+ * Get shell config file path
68
+ */
69
+ export declare function getShellConfigPath(): string;
70
+ /**
71
+ * Get PATH export command for shell
72
+ */
73
+ export declare function getPathExportCommand(): string;
74
+ //# sourceMappingURL=wrapper-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrapper-generator.d.ts","sourceRoot":"","sources":["../../src/utils/wrapper-generator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,cAAc,CAAC;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE;QACvB,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,cAAc,CAAC;KACpD,CAAC,CAAC;CACJ;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAgEtE;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOtE;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAOvF;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAElD;AAuED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAcjB;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAoBjB;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CASlE;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMrE;AAED;;GAEG;AACH,wBAAgB,YAAY;;;;EAM3B;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAGrC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAU3C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAQ7C"}
@@ -0,0 +1,280 @@
1
+ /**
2
+ * Wrapper Script Generator
3
+ *
4
+ * Creates wrapper scripts that transparently invoke kits through the SDK
5
+ * for license checking and telemetry.
6
+ */
7
+ import { mkdir, writeFile, chmod, rm, readFile } from 'node:fs/promises';
8
+ import { join } from 'node:path';
9
+ import { homedir } from 'node:os';
10
+ /** Base directory for skit installation */
11
+ const SKIT_HOME = join(homedir(), '.skit');
12
+ const SKIT_BIN = join(SKIT_HOME, 'bin');
13
+ const SKIT_PACKAGES = join(SKIT_HOME, 'packages');
14
+ /**
15
+ * Parse skit.yaml (simple YAML parser)
16
+ */
17
+ export function parseSkitYaml(content) {
18
+ try {
19
+ const lines = content.split('\n');
20
+ const result = {};
21
+ let currentSection = null;
22
+ let currentCommand = null;
23
+ for (const line of lines) {
24
+ const trimmed = line.trim();
25
+ if (!trimmed || trimmed.startsWith('#'))
26
+ continue;
27
+ const indent = line.search(/\S/);
28
+ // Top-level key
29
+ if (indent === 0 && trimmed.includes(':')) {
30
+ const [key, ...valueParts] = trimmed.split(':');
31
+ const value = valueParts.join(':').trim();
32
+ if (value) {
33
+ result[key] = value;
34
+ currentSection = null;
35
+ }
36
+ else {
37
+ currentSection = key;
38
+ if (key === 'commands') {
39
+ result[key] = {};
40
+ }
41
+ }
42
+ currentCommand = null;
43
+ }
44
+ // Second-level (commands section)
45
+ else if (indent === 2 && currentSection === 'commands' && trimmed.includes(':')) {
46
+ const [key, ...valueParts] = trimmed.split(':');
47
+ const value = valueParts.join(':').trim();
48
+ if (!value) {
49
+ currentCommand = key;
50
+ result.commands[key] = {};
51
+ }
52
+ }
53
+ // Third-level (command properties)
54
+ else if (indent === 4 && currentCommand && trimmed.includes(':')) {
55
+ const [key, ...valueParts] = trimmed.split(':');
56
+ const value = valueParts.join(':').trim();
57
+ const commands = result.commands;
58
+ commands[currentCommand][key] = value;
59
+ }
60
+ }
61
+ // Validate required fields
62
+ if (!result.name || !result.binary || !result.commands) {
63
+ return null;
64
+ }
65
+ return {
66
+ name: result.name,
67
+ version: result.version || '0.0.0',
68
+ description: result.description,
69
+ tier: result.tier || 'free',
70
+ binary: result.binary,
71
+ commands: result.commands,
72
+ };
73
+ }
74
+ catch {
75
+ return null;
76
+ }
77
+ }
78
+ /**
79
+ * Check if a package has skit.yaml
80
+ */
81
+ export async function hasSkitYaml(packageDir) {
82
+ try {
83
+ await readFile(join(packageDir, 'skit.yaml'), 'utf-8');
84
+ return true;
85
+ }
86
+ catch {
87
+ return false;
88
+ }
89
+ }
90
+ /**
91
+ * Read and parse skit.yaml from package directory
92
+ */
93
+ export async function readSkitYaml(packageDir) {
94
+ try {
95
+ const content = await readFile(join(packageDir, 'skit.yaml'), 'utf-8');
96
+ return parseSkitYaml(content);
97
+ }
98
+ catch {
99
+ return null;
100
+ }
101
+ }
102
+ /**
103
+ * Get the CLI name from kit name
104
+ * Examples:
105
+ * devtools-kit -> devtools
106
+ * my-awesome-kit -> my-awesome
107
+ * simple -> simple
108
+ */
109
+ export function getCliName(kitName) {
110
+ return kitName.replace(/-kit$/, '');
111
+ }
112
+ /**
113
+ * Generate wrapper script content
114
+ */
115
+ function generateWrapperScript(kitName, kitPath) {
116
+ return `#!/usr/bin/env node
117
+ /**
118
+ * Wrapper for ${kitName}
119
+ * Auto-generated by skit install
120
+ *
121
+ * This wrapper transparently handles:
122
+ * - License verification
123
+ * - Usage telemetry
124
+ * - Command execution
125
+ */
126
+
127
+ import { runKit } from '@skit/kit-sdk';
128
+
129
+ const kitPath = '${kitPath}';
130
+ const command = process.argv[2];
131
+ const args = process.argv.slice(3);
132
+
133
+ if (!command || command === '--help' || command === '-h') {
134
+ // Show help
135
+ import('@skit/kit-sdk').then(({ printKitHelp }) => {
136
+ printKitHelp(kitPath);
137
+ });
138
+ } else if (command === '--version' || command === '-v') {
139
+ // Show version
140
+ import('fs').then(({ readFileSync }) => {
141
+ try {
142
+ const yaml = readFileSync(kitPath + '/skit.yaml', 'utf-8');
143
+ const match = yaml.match(/version:\\s*([^\\n]+)/);
144
+ console.log(match ? match[1].trim() : 'unknown');
145
+ } catch {
146
+ console.log('unknown');
147
+ }
148
+ });
149
+ } else {
150
+ // Run command through wrapper
151
+ runKit({
152
+ kitPath,
153
+ command,
154
+ args,
155
+ }).then((result) => {
156
+ process.exit(result.exitCode);
157
+ }).catch((error) => {
158
+ console.error('Error:', error.message);
159
+ process.exit(1);
160
+ });
161
+ }
162
+ `;
163
+ }
164
+ /**
165
+ * Generate shell wrapper (for systems without Node.js in PATH)
166
+ */
167
+ function generateShellWrapper(kitName, kitPath) {
168
+ return `#!/bin/bash
169
+ # Wrapper for ${kitName}
170
+ # Auto-generated by skit install
171
+
172
+ SKIT_KIT_PATH="${kitPath}"
173
+ SKIT_SDK_PATH="${SKIT_HOME}/sdk"
174
+
175
+ # Run through Node.js wrapper
176
+ exec node "${SKIT_BIN}/.${kitName}-wrapper.mjs" "$@"
177
+ `;
178
+ }
179
+ /**
180
+ * Install kit package to ~/.skit/packages/
181
+ */
182
+ export async function installKitPackage(sourceDir, kitName) {
183
+ const targetDir = join(SKIT_PACKAGES, kitName);
184
+ // Create packages directory
185
+ await mkdir(SKIT_PACKAGES, { recursive: true });
186
+ // Remove existing installation
187
+ await rm(targetDir, { recursive: true, force: true });
188
+ // Copy package (using cp -r for simplicity)
189
+ const { execSync } = await import('node:child_process');
190
+ execSync(`cp -r "${sourceDir}" "${targetDir}"`, { stdio: 'pipe' });
191
+ return targetDir;
192
+ }
193
+ /**
194
+ * Create wrapper script in ~/.skit/bin/
195
+ */
196
+ export async function createWrapper(kitName, kitPath) {
197
+ const cliName = getCliName(kitName);
198
+ // Ensure bin directory exists
199
+ await mkdir(SKIT_BIN, { recursive: true });
200
+ // Generate Node.js wrapper module
201
+ const wrapperModulePath = join(SKIT_BIN, `.${cliName}-wrapper.mjs`);
202
+ const wrapperContent = generateWrapperScript(kitName, kitPath);
203
+ await writeFile(wrapperModulePath, wrapperContent, 'utf-8');
204
+ // Generate shell wrapper (main executable)
205
+ const wrapperPath = join(SKIT_BIN, cliName);
206
+ const shellWrapper = generateShellWrapper(kitName, kitPath);
207
+ await writeFile(wrapperPath, shellWrapper, 'utf-8');
208
+ // Make executable
209
+ await chmod(wrapperPath, 0o755);
210
+ return wrapperPath;
211
+ }
212
+ /**
213
+ * Remove wrapper script
214
+ */
215
+ export async function removeWrapper(kitName) {
216
+ const cliName = getCliName(kitName);
217
+ try {
218
+ await rm(join(SKIT_BIN, cliName), { force: true });
219
+ await rm(join(SKIT_BIN, `.${cliName}-wrapper.mjs`), { force: true });
220
+ }
221
+ catch {
222
+ // Ignore errors
223
+ }
224
+ }
225
+ /**
226
+ * Remove kit package from ~/.skit/packages/
227
+ */
228
+ export async function removeKitPackage(kitName) {
229
+ try {
230
+ await rm(join(SKIT_PACKAGES, kitName), { recursive: true, force: true });
231
+ }
232
+ catch {
233
+ // Ignore errors
234
+ }
235
+ }
236
+ /**
237
+ * Get installation paths
238
+ */
239
+ export function getSkitPaths() {
240
+ return {
241
+ home: SKIT_HOME,
242
+ bin: SKIT_BIN,
243
+ packages: SKIT_PACKAGES,
244
+ };
245
+ }
246
+ /**
247
+ * Check if ~/.skit/bin is in PATH
248
+ */
249
+ export function isBinInPath() {
250
+ const pathEnv = process.env.PATH || '';
251
+ return pathEnv.includes(SKIT_BIN) || pathEnv.includes('~/.skit/bin');
252
+ }
253
+ /**
254
+ * Get shell config file path
255
+ */
256
+ export function getShellConfigPath() {
257
+ const shell = process.env.SHELL || '/bin/bash';
258
+ if (shell.includes('zsh')) {
259
+ return join(homedir(), '.zshrc');
260
+ }
261
+ else if (shell.includes('fish')) {
262
+ return join(homedir(), '.config', 'fish', 'config.fish');
263
+ }
264
+ else {
265
+ return join(homedir(), '.bashrc');
266
+ }
267
+ }
268
+ /**
269
+ * Get PATH export command for shell
270
+ */
271
+ export function getPathExportCommand() {
272
+ const shell = process.env.SHELL || '/bin/bash';
273
+ if (shell.includes('fish')) {
274
+ return `set -gx PATH $HOME/.skit/bin $PATH`;
275
+ }
276
+ else {
277
+ return `export PATH="$HOME/.skit/bin:$PATH"`;
278
+ }
279
+ }
280
+ //# sourceMappingURL=wrapper-generator.js.map
@@ -0,0 +1 @@
1
+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;IAC1B,OAAO;QACL,IAAI,EAAE,SAAS;QACf,GAAG,EAAE,QAAQ;QACb,QAAQ,EAAE,aAAa;KACxB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;IACvC,OAAO,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;AACvE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,WAAW,CAAC;IAE/C,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC;IACnC,CAAC;SAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;IAC3D,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;IACpC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,WAAW,CAAC;IAE/C,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,OAAO,oCAAoC,CAAC;IAC9C,CAAC;SAAM,CAAC;QACN,OAAO,qCAAqC,CAAC;IAC/C,CAAC;AACH,CAAC"}
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@ist/skit",
3
+ "version": "0.1.16",
4
+ "description": "CLI and library for installing skit packages to correct component locations",
5
+ "type": "module",
6
+ "main": "./dist/lib.js",
7
+ "types": "./dist/lib.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ },
13
+ "./lib": {
14
+ "types": "./dist/lib.d.ts",
15
+ "default": "./dist/lib.js"
16
+ }
17
+ },
18
+ "bin": {
19
+ "skit": "./dist/index.js"
20
+ },
21
+ "scripts": {
22
+ "build": "tsc",
23
+ "dev": "tsc --watch",
24
+ "test": "vitest",
25
+ "test:run": "vitest run",
26
+ "prepublishOnly": "npm run build"
27
+ },
28
+ "files": [
29
+ "dist"
30
+ ],
31
+ "keywords": [
32
+ "skit",
33
+ "cli",
34
+ "session-kit",
35
+ "claude",
36
+ "library"
37
+ ],
38
+ "author": "Microature",
39
+ "license": "MIT",
40
+ "dependencies": {
41
+ "@ist/registry-config": "^0.1.1",
42
+ "chalk": "^5.3.0",
43
+ "commander": "^12.1.0",
44
+ "tar": "^7.5.12"
45
+ },
46
+ "devDependencies": {
47
+ "@types/node": "^20.11.0",
48
+ "typescript": "^5.7.3",
49
+ "vitest": "^3.0.4"
50
+ },
51
+ "engines": {
52
+ "node": ">=18.0.0"
53
+ }
54
+ }
@@ -0,0 +1,63 @@
1
+ All packages under `src/` are licensed according to the terms in
2
+ their respective `LICENSE` or `LICENSE.md` files.
3
+
4
+ The remainder of this project is licensed under the Blue Oak
5
+ Model License, as follows:
6
+
7
+ -----
8
+
9
+ # Blue Oak Model License
10
+
11
+ Version 1.0.0
12
+
13
+ ## Purpose
14
+
15
+ This license gives everyone as much permission to work with
16
+ this software as possible, while protecting contributors
17
+ from liability.
18
+
19
+ ## Acceptance
20
+
21
+ In order to receive this license, you must agree to its
22
+ rules. The rules of this license are both obligations
23
+ under that agreement and conditions to your license.
24
+ You must not do anything with this software that triggers
25
+ a rule that you cannot or will not follow.
26
+
27
+ ## Copyright
28
+
29
+ Each contributor licenses you to do everything with this
30
+ software that would otherwise infringe that contributor's
31
+ copyright in it.
32
+
33
+ ## Notices
34
+
35
+ You must ensure that everyone who gets a copy of
36
+ any part of this software from you, with or without
37
+ changes, also gets the text of this license or a link to
38
+ <https://blueoakcouncil.org/license/1.0.0>.
39
+
40
+ ## Excuse
41
+
42
+ If anyone notifies you in writing that you have not
43
+ complied with [Notices](#notices), you can keep your
44
+ license by taking all practical steps to comply within 30
45
+ days after the notice. If you do not do so, your license
46
+ ends immediately.
47
+
48
+ ## Patent
49
+
50
+ Each contributor licenses you to do everything with this
51
+ software that would otherwise infringe any patent claims
52
+ they can license or become able to license.
53
+
54
+ ## Reliability
55
+
56
+ No contributor can revoke this license.
57
+
58
+ ## No Liability
59
+
60
+ ***As far as the law allows, this software comes as is,
61
+ without any warranty or condition, and no contributor
62
+ will be liable to anyone for any damages related to this
63
+ software or this license, under any kind of legal claim.***
@@ -0,0 +1,3 @@
1
+ Like `chown -R`.
2
+
3
+ Takes the same arguments as `fs.chown()`
@@ -0,0 +1,3 @@
1
+ export declare const chownr: (p: string, uid: number, gid: number, cb: (er?: unknown) => any) => void;
2
+ export declare const chownrSync: (p: string, uid: number, gid: number) => void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AA0CA,eAAO,MAAM,MAAM,MACd,MAAM,OACJ,MAAM,OACN,MAAM,YACD,OAAO,KAAK,GAAG,SA0B1B,CAAA;AAcD,eAAO,MAAM,UAAU,MAAO,MAAM,OAAO,MAAM,OAAO,MAAM,SAiB7D,CAAA"}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.chownrSync = exports.chownr = void 0;
7
+ const node_fs_1 = __importDefault(require("node:fs"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
+ const lchownSync = (path, uid, gid) => {
10
+ try {
11
+ return node_fs_1.default.lchownSync(path, uid, gid);
12
+ }
13
+ catch (er) {
14
+ if (er?.code !== 'ENOENT')
15
+ throw er;
16
+ }
17
+ };
18
+ const chown = (cpath, uid, gid, cb) => {
19
+ node_fs_1.default.lchown(cpath, uid, gid, er => {
20
+ // Skip ENOENT error
21
+ cb(er && er?.code !== 'ENOENT' ? er : null);
22
+ });
23
+ };
24
+ const chownrKid = (p, child, uid, gid, cb) => {
25
+ if (child.isDirectory()) {
26
+ (0, exports.chownr)(node_path_1.default.resolve(p, child.name), uid, gid, (er) => {
27
+ if (er)
28
+ return cb(er);
29
+ const cpath = node_path_1.default.resolve(p, child.name);
30
+ chown(cpath, uid, gid, cb);
31
+ });
32
+ }
33
+ else {
34
+ const cpath = node_path_1.default.resolve(p, child.name);
35
+ chown(cpath, uid, gid, cb);
36
+ }
37
+ };
38
+ const chownr = (p, uid, gid, cb) => {
39
+ node_fs_1.default.readdir(p, { withFileTypes: true }, (er, children) => {
40
+ // any error other than ENOTDIR or ENOTSUP means it's not readable,
41
+ // or doesn't exist. give up.
42
+ if (er) {
43
+ if (er.code === 'ENOENT')
44
+ return cb();
45
+ else if (er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP')
46
+ return cb(er);
47
+ }
48
+ if (er || !children.length)
49
+ return chown(p, uid, gid, cb);
50
+ let len = children.length;
51
+ let errState = null;
52
+ const then = (er) => {
53
+ /* c8 ignore start */
54
+ if (errState)
55
+ return;
56
+ /* c8 ignore stop */
57
+ if (er)
58
+ return cb((errState = er));
59
+ if (--len === 0)
60
+ return chown(p, uid, gid, cb);
61
+ };
62
+ for (const child of children) {
63
+ chownrKid(p, child, uid, gid, then);
64
+ }
65
+ });
66
+ };
67
+ exports.chownr = chownr;
68
+ const chownrKidSync = (p, child, uid, gid) => {
69
+ if (child.isDirectory())
70
+ (0, exports.chownrSync)(node_path_1.default.resolve(p, child.name), uid, gid);
71
+ lchownSync(node_path_1.default.resolve(p, child.name), uid, gid);
72
+ };
73
+ const chownrSync = (p, uid, gid) => {
74
+ let children;
75
+ try {
76
+ children = node_fs_1.default.readdirSync(p, { withFileTypes: true });
77
+ }
78
+ catch (er) {
79
+ const e = er;
80
+ if (e?.code === 'ENOENT')
81
+ return;
82
+ else if (e?.code === 'ENOTDIR' || e?.code === 'ENOTSUP')
83
+ return lchownSync(p, uid, gid);
84
+ else
85
+ throw e;
86
+ }
87
+ for (const child of children) {
88
+ chownrKidSync(p, child, uid, gid);
89
+ }
90
+ return lchownSync(p, uid, gid);
91
+ };
92
+ exports.chownrSync = chownrSync;
93
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyC;AACzC,0DAA4B;AAE5B,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,GAAW,EAAE,GAAW,EAAE,EAAE;IAC5D,IAAI,CAAC;QACH,OAAO,iBAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;IACtC,CAAC;IAAC,OAAO,EAAE,EAAE,CAAC;QACZ,IAAK,EAA4B,EAAE,IAAI,KAAK,QAAQ;YAAE,MAAM,EAAE,CAAA;IAChE,CAAC;AACH,CAAC,CAAA;AAED,MAAM,KAAK,GAAG,CACZ,KAAa,EACb,GAAW,EACX,GAAW,EACX,EAAyB,EACzB,EAAE;IACF,iBAAE,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE;QAC9B,oBAAoB;QACpB,EAAE,CAAC,EAAE,IAAK,EAA4B,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IACxE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,CAChB,CAAS,EACT,KAAa,EACb,GAAW,EACX,GAAW,EACX,EAAyB,EACzB,EAAE;IACF,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vD,CAAC;IAAC,OAAO,EAAE,EAAE,CAAC;QACZ,MAAM,CAAC,GAAG,EAA2B,CAAA;QACrC,IAAI,CAAC,EAAE,IAAI,KAAK,QAAQ;YAAE,OAAM;aAC3B,IAAI,CAAC,EAAE,IAAI,KAAK,SAAS,IAAI,CAAC,EAAE,IAAI,KAAK,SAAS;YACrD,OAAO,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;;YAC3B,MAAM,CAAC,CAAA;IACd,CAAC;IAED,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;QAC7B,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;IACnC,CAAC;IAED,OAAO,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAChC,CAAC,CAAA;AAjBY,QAAA,UAAU,cAiBtB","sourcesContent":["import fs, { type Dirent } from 'node:fs'\nimport path from 'node:path'\n\nconst lchownSync = (path: string, uid: number, gid: number) => {\n try {\n return fs.lchownSync(path, uid, gid)\n } catch (er) {\n if ((er as NodeJS.ErrnoException)?.code !== 'ENOENT') throw er\n }\n}\n\nconst chown = (\n cpath: string,\n uid: number,\n gid: number,\n cb: (er?: unknown) => any,\n) => {\n fs.lchown(cpath, uid, gid, er => {\n // Skip ENOENT error\n cb(er && (er as NodeJS.ErrnoException)?.code !== 'ENOENT' ? er : null)\n })\n}\n\nconst chownrKid = (\n p: string,\n child: Dirent,\n uid: number,\n gid: number,\n cb: (er?: unknown) => any,\n) => {\n if (child.isDirectory()) {\n chownr(path.resolve(p, child.name), uid, gid, (er: unknown) => {\n if (er) return cb(er)\n const cpath = path.resolve(p, child.name)\n chown(cpath, uid, gid, cb)\n })\n } else {\n const cpath = path.resolve(p, child.name)\n chown(cpath, uid, gid, cb)\n }\n}\n\nexport const chownr = (\n p: string,\n uid: number,\n gid: number,\n cb: (er?: unknown) => any,\n) => {\n fs.readdir(p, { withFileTypes: true }, (er, children) => {\n // any error other than ENOTDIR or ENOTSUP means it's not readable,\n // or doesn't exist. give up.\n if (er) {\n if (er.code === 'ENOENT') return cb()\n else if (er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP')\n return cb(er)\n }\n if (er || !children.length) return chown(p, uid, gid, cb)\n\n let len = children.length\n let errState: null | NodeJS.ErrnoException = null\n const then = (er?: unknown) => {\n /* c8 ignore start */\n if (errState) return\n /* c8 ignore stop */\n if (er) return cb((errState = er as NodeJS.ErrnoException))\n if (--len === 0) return chown(p, uid, gid, cb)\n }\n\n for (const child of children) {\n chownrKid(p, child, uid, gid, then)\n }\n })\n}\n\nconst chownrKidSync = (\n p: string,\n child: Dirent,\n uid: number,\n gid: number,\n) => {\n if (child.isDirectory())\n chownrSync(path.resolve(p, child.name), uid, gid)\n\n lchownSync(path.resolve(p, child.name), uid, gid)\n}\n\nexport const chownrSync = (p: string, uid: number, gid: number) => {\n let children: Dirent[]\n try {\n children = fs.readdirSync(p, { withFileTypes: true })\n } catch (er) {\n const e = er as NodeJS.ErrnoException\n if (e?.code === 'ENOENT') return\n else if (e?.code === 'ENOTDIR' || e?.code === 'ENOTSUP')\n return lchownSync(p, uid, gid)\n else throw e\n }\n\n for (const child of children) {\n chownrKidSync(p, child, uid, gid)\n }\n\n return lchownSync(p, uid, gid)\n}\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,3 @@
1
+ export declare const chownr: (p: string, uid: number, gid: number, cb: (er?: unknown) => any) => void;
2
+ export declare const chownrSync: (p: string, uid: number, gid: number) => void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AA0CA,eAAO,MAAM,MAAM,MACd,MAAM,OACJ,MAAM,OACN,MAAM,YACD,OAAO,KAAK,GAAG,SA0B1B,CAAA;AAcD,eAAO,MAAM,UAAU,MAAO,MAAM,OAAO,MAAM,OAAO,MAAM,SAiB7D,CAAA"}