@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,219 @@
1
+ import { copyFile, mkdir, readFile, writeFile, cp } from 'node:fs/promises';
2
+ import { join, dirname } from 'node:path';
3
+ import { homedir } from 'node:os';
4
+ import { PERMISSION_PACKS_PATH, PROFILE_PROMPTS_PATH } from '../types/skit.js';
5
+ /**
6
+ * Expand ~ to home directory
7
+ */
8
+ export function expandPath(path) {
9
+ if (path.startsWith('~/')) {
10
+ return join(homedir(), path.slice(2));
11
+ }
12
+ return path;
13
+ }
14
+ /**
15
+ * Get install path for a component type
16
+ */
17
+ export function getInstallPath(manifest, componentType, defaultPaths) {
18
+ const customPath = manifest.install?.[componentType];
19
+ const path = customPath || defaultPaths[componentType];
20
+ return expandPath(path);
21
+ }
22
+ /**
23
+ * Install a single component
24
+ */
25
+ export async function installComponent(stagingDir, targetDir, componentFile, componentType, componentName) {
26
+ const sourcePath = join(stagingDir, componentFile);
27
+ // Preserve nested folder structure: remove first folder (e.g., 'prompts/') and keep the rest
28
+ const relativePath = componentFile.replace(/^[^/]+\//, '');
29
+ const targetPath = join(targetDir, relativePath);
30
+ try {
31
+ // Ensure target directory exists (including nested folders)
32
+ await mkdir(dirname(targetPath), { recursive: true });
33
+ // Copy file
34
+ await copyFile(sourcePath, targetPath);
35
+ return {
36
+ component: { name: componentName, file: componentFile },
37
+ type: componentType,
38
+ sourcePath,
39
+ targetPath,
40
+ success: true,
41
+ };
42
+ }
43
+ catch (error) {
44
+ return {
45
+ component: { name: componentName, file: componentFile },
46
+ type: componentType,
47
+ sourcePath,
48
+ targetPath,
49
+ success: false,
50
+ error: error instanceof Error ? error.message : String(error),
51
+ };
52
+ }
53
+ }
54
+ /**
55
+ * Read and parse permission-packs.json, returns empty structure if not exists
56
+ */
57
+ async function readPermissionPacks() {
58
+ const packsPath = expandPath(PERMISSION_PACKS_PATH);
59
+ try {
60
+ const content = await readFile(packsPath, 'utf-8');
61
+ return JSON.parse(content);
62
+ }
63
+ catch {
64
+ // Return empty structure if file doesn't exist
65
+ return { packs: {} };
66
+ }
67
+ }
68
+ /**
69
+ * Write permission-packs.json
70
+ */
71
+ async function writePermissionPacks(data) {
72
+ const packsPath = expandPath(PERMISSION_PACKS_PATH);
73
+ await mkdir(dirname(packsPath), { recursive: true });
74
+ await writeFile(packsPath, JSON.stringify(data, null, 2), 'utf-8');
75
+ }
76
+ /**
77
+ * Install a single pack by merging into permission-packs.json
78
+ */
79
+ export async function installPack(stagingDir, packFile, packName) {
80
+ const sourcePath = join(stagingDir, packFile);
81
+ const targetPath = expandPath(PERMISSION_PACKS_PATH);
82
+ try {
83
+ // Read pack data from source file
84
+ const packContent = await readFile(sourcePath, 'utf-8');
85
+ const packData = JSON.parse(packContent);
86
+ // Read existing permission-packs.json
87
+ const existingPacks = await readPermissionPacks();
88
+ // Merge new pack
89
+ existingPacks.packs[packName] = packData;
90
+ // Write back
91
+ await writePermissionPacks(existingPacks);
92
+ return {
93
+ component: { name: packName, file: packFile },
94
+ type: 'packs',
95
+ sourcePath,
96
+ targetPath,
97
+ success: true,
98
+ };
99
+ }
100
+ catch (error) {
101
+ return {
102
+ component: { name: packName, file: packFile },
103
+ type: 'packs',
104
+ sourcePath,
105
+ targetPath,
106
+ success: false,
107
+ error: error instanceof Error ? error.message : String(error),
108
+ };
109
+ }
110
+ }
111
+ /**
112
+ * Install a state directory (copies entire directory: state.json + *.md files)
113
+ */
114
+ export async function installStateDirectory(stagingDir, targetBaseDir, stateDir, stateName) {
115
+ const sourcePath = join(stagingDir, stateDir);
116
+ const targetPath = join(targetBaseDir, stateName);
117
+ try {
118
+ // Ensure target directory exists
119
+ await mkdir(targetPath, { recursive: true });
120
+ // Copy entire directory recursively
121
+ await cp(sourcePath, targetPath, { recursive: true });
122
+ return {
123
+ component: { name: stateName, file: stateDir },
124
+ type: 'states',
125
+ sourcePath,
126
+ targetPath,
127
+ success: true,
128
+ };
129
+ }
130
+ catch (error) {
131
+ return {
132
+ component: { name: stateName, file: stateDir },
133
+ type: 'states',
134
+ sourcePath,
135
+ targetPath,
136
+ success: false,
137
+ error: error instanceof Error ? error.message : String(error),
138
+ };
139
+ }
140
+ }
141
+ /**
142
+ * Build map of prompt name -> profile name for scoped prompts
143
+ */
144
+ function buildScopedPromptsMap(profiles) {
145
+ const scopedPrompts = new Map();
146
+ if (!profiles)
147
+ return scopedPrompts;
148
+ for (const profile of profiles) {
149
+ if (profile.prompts) {
150
+ for (const promptName of profile.prompts) {
151
+ scopedPrompts.set(promptName, profile.name);
152
+ }
153
+ }
154
+ }
155
+ return scopedPrompts;
156
+ }
157
+ /**
158
+ * Install all components from a manifest
159
+ */
160
+ export async function installAllComponents(manifest, stagingDir, defaultPaths) {
161
+ const results = [];
162
+ // Build map of scoped prompts (prompt name -> profile name)
163
+ const scopedPrompts = buildScopedPromptsMap(manifest.components.profiles);
164
+ // Install profiles
165
+ const profiles = manifest.components.profiles;
166
+ if (profiles && profiles.length > 0) {
167
+ const targetDir = getInstallPath(manifest, 'profiles', defaultPaths);
168
+ for (const profile of profiles) {
169
+ const result = await installComponent(stagingDir, targetDir, profile.file, 'profiles', profile.name);
170
+ results.push(result);
171
+ }
172
+ }
173
+ // Install prompts (global or profile-scoped)
174
+ const prompts = manifest.components.prompts;
175
+ if (prompts && prompts.length > 0) {
176
+ const globalPromptsDir = getInstallPath(manifest, 'prompts', defaultPaths);
177
+ for (const prompt of prompts) {
178
+ const scopedToProfile = scopedPrompts.get(prompt.name);
179
+ let targetDir;
180
+ if (scopedToProfile) {
181
+ // Install to profile-specific directory
182
+ targetDir = join(expandPath(PROFILE_PROMPTS_PATH), scopedToProfile);
183
+ }
184
+ else {
185
+ // Install to global prompts directory
186
+ targetDir = globalPromptsDir;
187
+ }
188
+ const result = await installComponent(stagingDir, targetDir, prompt.file, 'prompts', prompt.name);
189
+ results.push(result);
190
+ }
191
+ }
192
+ // Install packs (JSON merge into permission-packs.json)
193
+ const packs = manifest.components.packs;
194
+ if (packs && packs.length > 0) {
195
+ for (const pack of packs) {
196
+ const result = await installPack(stagingDir, pack.file, pack.name);
197
+ results.push(result);
198
+ }
199
+ }
200
+ // Install states (directory copy to ~/.ist/state/profiles/)
201
+ const states = manifest.components.states;
202
+ if (states && states.length > 0) {
203
+ const targetDir = getInstallPath(manifest, 'states', defaultPaths);
204
+ for (const state of states) {
205
+ const result = await installStateDirectory(stagingDir, targetDir, state.file, state.name);
206
+ results.push(result);
207
+ }
208
+ }
209
+ const successCount = results.filter(r => r.success).length;
210
+ return {
211
+ packageName: manifest.name,
212
+ version: manifest.version,
213
+ results,
214
+ totalComponents: results.length,
215
+ successCount,
216
+ failCount: results.length - successCount,
217
+ };
218
+ }
219
+ //# sourceMappingURL=file-copy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":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,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAED,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;IAE3D,OAAO;QACL,WAAW,EAAE,QAAQ,CAAC,IAAI;QAC1B,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,OAAO;QACP,eAAe,EAAE,OAAO,CAAC,MAAM;QAC/B,YAAY;QACZ,SAAS,EAAE,OAAO,CAAC,MAAM,GAAG,YAAY;KACzC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Hook installer for skit
3
+ *
4
+ * Installs chook, dhook, phook components
5
+ */
6
+ import type { SkitHook } from '../types/skit.js';
7
+ export interface HookInstallOptions {
8
+ verbose?: boolean;
9
+ dryRun?: boolean;
10
+ }
11
+ export interface HookInstallResult {
12
+ hook: SkitHook;
13
+ success: boolean;
14
+ targetPath: string;
15
+ error?: string;
16
+ }
17
+ /**
18
+ * Install all hooks from a skit package
19
+ */
20
+ export declare function installHooks(hooks: SkitHook[], sourceDir: string, options: HookInstallOptions): Promise<HookInstallResult[]>;
21
+ //# sourceMappingURL=hook-installer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hook-installer.d.ts","sourceRoot":"","sources":["../../src/utils/hook-installer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,kBAAkB,CAAC;AAqB3D,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA8CD;;GAEG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,QAAQ,EAAE,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAqC9B"}
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Hook installer for skit
3
+ *
4
+ * Installs chook, dhook, phook components
5
+ */
6
+ import { cp, mkdir } from 'node:fs/promises';
7
+ import { join } from 'node:path';
8
+ import { homedir } from 'node:os';
9
+ import chalk from 'chalk';
10
+ /**
11
+ * Hook install paths by type
12
+ */
13
+ const HOOK_INSTALL_PATHS = {
14
+ chook: '~/.chook/hooks/',
15
+ dhook: '~/.dhook/hooks/',
16
+ phook: '~/.phook/hooks/',
17
+ };
18
+ /**
19
+ * Expand ~ to home directory
20
+ */
21
+ function expandPath(path) {
22
+ if (path.startsWith('~/')) {
23
+ return join(homedir(), path.slice(2));
24
+ }
25
+ return path;
26
+ }
27
+ /**
28
+ * Install a single hook
29
+ */
30
+ async function installHook(hook, sourceDir, options) {
31
+ const { verbose = false, dryRun = false } = options;
32
+ const basePath = HOOK_INSTALL_PATHS[hook.type];
33
+ const targetDir = expandPath(join(basePath, hook.name));
34
+ const sourceHookDir = join(sourceDir, hook.file);
35
+ try {
36
+ if (!dryRun) {
37
+ // Create target directory
38
+ await mkdir(targetDir, { recursive: true });
39
+ // Copy hook directory
40
+ await cp(sourceHookDir, targetDir, { recursive: true });
41
+ // TODO: Register hook with corresponding CLI
42
+ // For chook: chook register <name>
43
+ // For dhook: dhook register <name>
44
+ // For phook: phook register <name>
45
+ // Currently these commands don't exist, so we just copy files
46
+ }
47
+ return {
48
+ hook,
49
+ success: true,
50
+ targetPath: targetDir,
51
+ };
52
+ }
53
+ catch (error) {
54
+ return {
55
+ hook,
56
+ success: false,
57
+ targetPath: targetDir,
58
+ error: error instanceof Error ? error.message : String(error),
59
+ };
60
+ }
61
+ }
62
+ /**
63
+ * Install all hooks from a skit package
64
+ */
65
+ export async function installHooks(hooks, sourceDir, options) {
66
+ const { verbose = false, dryRun = false } = options;
67
+ if (hooks.length === 0) {
68
+ return [];
69
+ }
70
+ console.log(chalk.dim(` Installing ${hooks.length} hook${hooks.length === 1 ? '' : 's'}...`));
71
+ const results = [];
72
+ for (const hook of hooks) {
73
+ if (verbose) {
74
+ console.log(chalk.dim(` → ${hook.name} (${hook.type})`));
75
+ }
76
+ if (dryRun) {
77
+ const basePath = HOOK_INSTALL_PATHS[hook.type];
78
+ console.log(chalk.yellow(` [dry-run] Would install ${hook.name} to ${basePath}${hook.name}/`));
79
+ results.push({
80
+ hook,
81
+ success: true,
82
+ targetPath: expandPath(join(basePath, hook.name)),
83
+ });
84
+ }
85
+ else {
86
+ const result = await installHook(hook, sourceDir, options);
87
+ results.push(result);
88
+ if (result.success) {
89
+ console.log(chalk.green(` ✓ ${hook.name}`), chalk.dim(`(${hook.type})`));
90
+ }
91
+ else {
92
+ console.log(chalk.red(` ✗ ${hook.name}: ${result.error}`));
93
+ }
94
+ }
95
+ }
96
+ return results;
97
+ }
98
+ //# sourceMappingURL=hook-installer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hook-installer.js","sourceRoot":"","sources":["../../src/utils/hook-installer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B;;GAEG;AACH,MAAM,kBAAkB,GAA6B;IACnD,KAAK,EAAE,iBAAiB;IACxB,KAAK,EAAE,iBAAiB;IACxB,KAAK,EAAE,iBAAiB;CACzB,CAAC;AAEF;;GAEG;AACH,SAAS,UAAU,CAAC,IAAY;IAC9B,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,OAAO,IAAI,CAA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,CAAC,CAAC;YAErB,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACnB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;YAC9E,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAChE,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Registry for tracking installed skit packages
3
+ */
4
+ /**
5
+ * Installed kit entry
6
+ */
7
+ export interface InstalledKit {
8
+ version: string;
9
+ installedAt: string;
10
+ files: string[];
11
+ }
12
+ /**
13
+ * Registry structure
14
+ */
15
+ export interface InstalledRegistry {
16
+ [packageName: string]: InstalledKit;
17
+ }
18
+ /**
19
+ * Contract path to use ~ for home directory
20
+ */
21
+ export declare function contractPath(path: string): string;
22
+ /**
23
+ * Read the installed kits registry
24
+ */
25
+ export declare function readRegistry(): Promise<InstalledRegistry>;
26
+ /**
27
+ * Write the installed kits registry
28
+ */
29
+ export declare function writeRegistry(registry: InstalledRegistry): Promise<void>;
30
+ /**
31
+ * Get installed kit info
32
+ */
33
+ export declare function getInstalledKit(packageName: string): Promise<InstalledKit | null>;
34
+ /**
35
+ * Register an installed kit
36
+ */
37
+ export declare function registerInstalledKit(packageName: string, version: string, files: string[]): Promise<void>;
38
+ /**
39
+ * Unregister a kit
40
+ */
41
+ export declare function unregisterKit(packageName: string): Promise<void>;
42
+ /**
43
+ * Remove files from previous installation
44
+ */
45
+ export declare function cleanPreviousInstall(packageName: string): Promise<string[]>;
46
+ /**
47
+ * List all installed kits
48
+ */
49
+ export declare function listInstalledKits(): Promise<InstalledRegistry>;
50
+ //# sourceMappingURL=installed-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installed-registry.d.ts","sourceRoot":"","sources":["../../src/utils/installed-registry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,CAAC;CACrC;AAYD;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMjD;AASD;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAQ/D;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAI9E;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAGvF;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EAAE,GACd,OAAO,CAAC,IAAI,CAAC,CAUf;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAItE;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAmBjF;AAED;;GAEG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAEpE"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Registry for tracking installed skit packages
3
+ */
4
+ import { readFile, writeFile, mkdir, rm } from 'node:fs/promises';
5
+ import { join, dirname } from 'node:path';
6
+ import { homedir } from 'node:os';
7
+ const REGISTRY_PATH = '~/.ist/installed-kits.json';
8
+ /**
9
+ * Expand ~ to home directory
10
+ */
11
+ function expandPath(path) {
12
+ if (path.startsWith('~/')) {
13
+ return join(homedir(), path.slice(2));
14
+ }
15
+ return path;
16
+ }
17
+ /**
18
+ * Contract path to use ~ for home directory
19
+ */
20
+ export function contractPath(path) {
21
+ const home = homedir();
22
+ if (path.startsWith(home)) {
23
+ return '~' + path.slice(home.length);
24
+ }
25
+ return path;
26
+ }
27
+ /**
28
+ * Get the registry file path
29
+ */
30
+ function getRegistryPath() {
31
+ return expandPath(REGISTRY_PATH);
32
+ }
33
+ /**
34
+ * Read the installed kits registry
35
+ */
36
+ export async function readRegistry() {
37
+ const registryPath = getRegistryPath();
38
+ try {
39
+ const content = await readFile(registryPath, 'utf-8');
40
+ return JSON.parse(content);
41
+ }
42
+ catch {
43
+ return {};
44
+ }
45
+ }
46
+ /**
47
+ * Write the installed kits registry
48
+ */
49
+ export async function writeRegistry(registry) {
50
+ const registryPath = getRegistryPath();
51
+ await mkdir(dirname(registryPath), { recursive: true });
52
+ await writeFile(registryPath, JSON.stringify(registry, null, 2), 'utf-8');
53
+ }
54
+ /**
55
+ * Get installed kit info
56
+ */
57
+ export async function getInstalledKit(packageName) {
58
+ const registry = await readRegistry();
59
+ return registry[packageName] || null;
60
+ }
61
+ /**
62
+ * Register an installed kit
63
+ */
64
+ export async function registerInstalledKit(packageName, version, files) {
65
+ const registry = await readRegistry();
66
+ registry[packageName] = {
67
+ version,
68
+ installedAt: new Date().toISOString(),
69
+ files: files.map(contractPath),
70
+ };
71
+ await writeRegistry(registry);
72
+ }
73
+ /**
74
+ * Unregister a kit
75
+ */
76
+ export async function unregisterKit(packageName) {
77
+ const registry = await readRegistry();
78
+ delete registry[packageName];
79
+ await writeRegistry(registry);
80
+ }
81
+ /**
82
+ * Remove files from previous installation
83
+ */
84
+ export async function cleanPreviousInstall(packageName) {
85
+ const kit = await getInstalledKit(packageName);
86
+ if (!kit) {
87
+ return [];
88
+ }
89
+ const removedFiles = [];
90
+ for (const file of kit.files) {
91
+ const expandedPath = expandPath(file);
92
+ try {
93
+ await rm(expandedPath, { force: true });
94
+ removedFiles.push(file);
95
+ }
96
+ catch {
97
+ // Ignore errors for files that don't exist
98
+ }
99
+ }
100
+ return removedFiles;
101
+ }
102
+ /**
103
+ * List all installed kits
104
+ */
105
+ export async function listInstalledKits() {
106
+ return readRegistry();
107
+ }
108
+ //# sourceMappingURL=installed-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installed-registry.js","sourceRoot":"","sources":["../../src/utils/installed-registry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAU,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,aAAa,GAAG,4BAA4B,CAAC;AAkBnD;;GAEG;AACH,SAAS,UAAU,CAAC,IAAY;IAC9B,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,OAAO,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,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a,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,WAAmB;IACrD,MAAM,QAAQ,GAAG,MAAM,YAAY,EAAE,CAAC;IACtC,OAAO,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC7B,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,WAAmB;IAC5D,MAAM,GAAG,GAAG,MAAM,eAAe,CAAC,WAAW,CAAC,CAAC;IAC/C,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,YAAY,GAAa,EAAE,CAAC;IAElC,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;QAC7B,MAAM,YAAY,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACxC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QAAC,MAAM,CAAC;YACP,2CAA2C;QAC7C,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,OAAO,YAAY,EAAE,CAAC;AACxB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { SkitManifest } from '../types/skit.js';
2
+ /**
3
+ * Parse skit.json from a staging directory
4
+ */
5
+ export declare function parseSkitManifest(stagingDir: string): Promise<SkitManifest>;
6
+ /**
7
+ * Count total components in a manifest
8
+ */
9
+ export declare function countComponents(manifest: SkitManifest): number;
10
+ //# sourceMappingURL=skit-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skit-parser.d.ts","sourceRoot":"","sources":["../../src/utils/skit-parser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CA+BjF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAU9D"}
@@ -0,0 +1,52 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { join } from 'node:path';
3
+ /**
4
+ * Parse skit.json from a staging directory
5
+ */
6
+ export async function parseSkitManifest(stagingDir) {
7
+ const manifestPath = join(stagingDir, 'skit.json');
8
+ try {
9
+ const content = await readFile(manifestPath, 'utf-8');
10
+ const manifest = JSON.parse(content);
11
+ // Validate required fields
12
+ if (!manifest.name) {
13
+ throw new Error('skit.json missing required field: name');
14
+ }
15
+ if (!manifest.version) {
16
+ throw new Error('skit.json missing required field: version');
17
+ }
18
+ if (!manifest.components) {
19
+ throw new Error('skit.json missing required field: components');
20
+ }
21
+ if (manifest.type !== 'skit') {
22
+ throw new Error(`Invalid package type: ${manifest.type}. Expected "skit"`);
23
+ }
24
+ return manifest;
25
+ }
26
+ catch (error) {
27
+ if (error instanceof SyntaxError) {
28
+ throw new Error(`Invalid JSON in skit.json: ${error.message}`);
29
+ }
30
+ if (error.code === 'ENOENT') {
31
+ throw new Error(`skit.json not found in ${stagingDir}`);
32
+ }
33
+ throw error;
34
+ }
35
+ }
36
+ /**
37
+ * Count total components in a manifest
38
+ */
39
+ export function countComponents(manifest) {
40
+ const { components } = manifest;
41
+ let count = 0;
42
+ if (components.clis)
43
+ count += components.clis.length;
44
+ if (components.profiles)
45
+ count += components.profiles.length;
46
+ if (components.prompts)
47
+ count += components.prompts.length;
48
+ if (components.packs)
49
+ count += components.packs.length;
50
+ return count;
51
+ }
52
+ //# sourceMappingURL=skit-parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skit-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