@microwiseai/snapshot 0.9.0 → 0.9.2

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 (477) hide show
  1. package/dist/build-info.json +1 -1
  2. package/dist/commands/install.d.ts.map +1 -1
  3. package/dist/commands/install.js +20 -81
  4. package/dist/commands/install.js.map +1 -1
  5. package/dist/commands/publish.d.ts.map +1 -1
  6. package/dist/commands/publish.js +7 -0
  7. package/dist/commands/publish.js.map +1 -1
  8. package/dist/lib/prerequisites.d.ts.map +1 -1
  9. package/dist/lib/prerequisites.js +2 -1
  10. package/dist/lib/prerequisites.js.map +1 -1
  11. package/dist/lib/proxy-index-refresh.d.ts +40 -0
  12. package/dist/lib/proxy-index-refresh.d.ts.map +1 -0
  13. package/dist/lib/proxy-index-refresh.js +66 -0
  14. package/dist/lib/proxy-index-refresh.js.map +1 -0
  15. package/dist/lib/proxy-userconfig.d.ts +45 -0
  16. package/dist/lib/proxy-userconfig.d.ts.map +1 -0
  17. package/dist/lib/proxy-userconfig.js +94 -0
  18. package/dist/lib/proxy-userconfig.js.map +1 -0
  19. package/node_modules/@microwiseai/skit/LICENSE +21 -0
  20. package/node_modules/@microwiseai/skit/README.md +137 -93
  21. package/node_modules/@microwiseai/skit/dist/__tests__/setup/hermetic-config.d.ts +2 -0
  22. package/node_modules/@microwiseai/skit/dist/__tests__/setup/hermetic-config.d.ts.map +1 -0
  23. package/node_modules/@microwiseai/skit/dist/commands/browse.d.ts +47 -3
  24. package/node_modules/@microwiseai/skit/dist/commands/browse.d.ts.map +1 -1
  25. package/node_modules/@microwiseai/skit/dist/commands/config.d.ts +5 -0
  26. package/node_modules/@microwiseai/skit/dist/commands/config.d.ts.map +1 -0
  27. package/node_modules/@microwiseai/skit/dist/commands/install.d.ts +14 -2
  28. package/node_modules/@microwiseai/skit/dist/commands/install.d.ts.map +1 -1
  29. package/node_modules/@microwiseai/skit/dist/commands/orphans.d.ts +16 -0
  30. package/node_modules/@microwiseai/skit/dist/commands/orphans.d.ts.map +1 -0
  31. package/node_modules/@microwiseai/skit/dist/commands/pack.d.ts.map +1 -1
  32. package/node_modules/@microwiseai/skit/dist/commands/prompt.d.ts +25 -0
  33. package/node_modules/@microwiseai/skit/dist/commands/prompt.d.ts.map +1 -0
  34. package/node_modules/@microwiseai/skit/dist/commands/publish.d.ts.map +1 -1
  35. package/node_modules/@microwiseai/skit/dist/commands/uninstall.d.ts.map +1 -1
  36. package/node_modules/@microwiseai/skit/dist/distkit/install-directive.d.ts +48 -0
  37. package/node_modules/@microwiseai/skit/dist/distkit/install-directive.d.ts.map +1 -0
  38. package/node_modules/@microwiseai/skit/dist/distkit/kit-executor.d.ts +46 -0
  39. package/node_modules/@microwiseai/skit/dist/distkit/kit-executor.d.ts.map +1 -0
  40. package/node_modules/@microwiseai/skit/dist/distkit/resolve-from.d.ts +37 -0
  41. package/node_modules/@microwiseai/skit/dist/distkit/resolve-from.d.ts.map +1 -0
  42. package/node_modules/@microwiseai/skit/dist/index.d.ts +0 -1
  43. package/node_modules/@microwiseai/skit/dist/index.js +52519 -68
  44. package/node_modules/@microwiseai/skit/dist/lib.d.ts +657 -5
  45. package/node_modules/@microwiseai/skit/dist/lib.d.ts.map +1 -1
  46. package/node_modules/@microwiseai/skit/dist/lib.js +48417 -554
  47. package/node_modules/@microwiseai/skit/dist/types/skit.d.ts +189 -12
  48. package/node_modules/@microwiseai/skit/dist/types/skit.d.ts.map +1 -1
  49. package/node_modules/@microwiseai/skit/dist/utils/dep-plan.d.ts +150 -0
  50. package/node_modules/@microwiseai/skit/dist/utils/dep-plan.d.ts.map +1 -0
  51. package/node_modules/@microwiseai/skit/dist/utils/file-copy.d.ts +10 -5
  52. package/node_modules/@microwiseai/skit/dist/utils/file-copy.d.ts.map +1 -1
  53. package/node_modules/@microwiseai/skit/dist/utils/gitlab-registry.d.ts +91 -0
  54. package/node_modules/@microwiseai/skit/dist/utils/gitlab-registry.d.ts.map +1 -0
  55. package/node_modules/@microwiseai/skit/dist/utils/installed-registry.d.ts +59 -3
  56. package/node_modules/@microwiseai/skit/dist/utils/installed-registry.d.ts.map +1 -1
  57. package/node_modules/@microwiseai/skit/dist/utils/npm-auth.d.ts +99 -0
  58. package/node_modules/@microwiseai/skit/dist/utils/npm-auth.d.ts.map +1 -0
  59. package/node_modules/@microwiseai/skit/dist/utils/profile-permissions.d.ts +54 -0
  60. package/node_modules/@microwiseai/skit/dist/utils/profile-permissions.d.ts.map +1 -0
  61. package/node_modules/@microwiseai/skit/dist/utils/skit-config.d.ts +41 -0
  62. package/node_modules/@microwiseai/skit/dist/utils/skit-config.d.ts.map +1 -0
  63. package/node_modules/@microwiseai/skit/dist/utils/skit-parser.d.ts +5 -0
  64. package/node_modules/@microwiseai/skit/dist/utils/skit-parser.d.ts.map +1 -1
  65. package/node_modules/@microwiseai/skit/dist/utils/temp-npmrc.d.ts +70 -0
  66. package/node_modules/@microwiseai/skit/dist/utils/temp-npmrc.d.ts.map +1 -0
  67. package/node_modules/@microwiseai/skit/package.json +40 -10
  68. package/package.json +2 -2
  69. package/node_modules/@isaacs/fs-minipass/LICENSE +0 -15
  70. package/node_modules/@isaacs/fs-minipass/README.md +0 -71
  71. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts +0 -118
  72. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts.map +0 -1
  73. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +0 -430
  74. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js.map +0 -1
  75. package/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +0 -3
  76. package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts +0 -118
  77. package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts.map +0 -1
  78. package/node_modules/@isaacs/fs-minipass/dist/esm/index.js +0 -420
  79. package/node_modules/@isaacs/fs-minipass/dist/esm/index.js.map +0 -1
  80. package/node_modules/@isaacs/fs-minipass/dist/esm/package.json +0 -3
  81. package/node_modules/@isaacs/fs-minipass/package.json +0 -72
  82. package/node_modules/@ist/registry-config/dist/index.d.ts +0 -3
  83. package/node_modules/@ist/registry-config/dist/index.js +0 -3
  84. package/node_modules/@ist/registry-config/dist/registry-url.d.ts +0 -1
  85. package/node_modules/@ist/registry-config/dist/registry-url.js +0 -1
  86. package/node_modules/@ist/registry-config/dist/scope-mapping.d.ts +0 -6
  87. package/node_modules/@ist/registry-config/dist/scope-mapping.js +0 -7
  88. package/node_modules/@ist/registry-config/dist/types.d.ts +0 -4
  89. package/node_modules/@ist/registry-config/dist/types.js +0 -1
  90. package/node_modules/@ist/registry-config/package.json +0 -32
  91. package/node_modules/@microwiseai/skit/dist/commands/browse.js +0 -127
  92. package/node_modules/@microwiseai/skit/dist/commands/browse.js.map +0 -1
  93. package/node_modules/@microwiseai/skit/dist/commands/gitignore.js +0 -59
  94. package/node_modules/@microwiseai/skit/dist/commands/gitignore.js.map +0 -1
  95. package/node_modules/@microwiseai/skit/dist/commands/info.js +0 -80
  96. package/node_modules/@microwiseai/skit/dist/commands/info.js.map +0 -1
  97. package/node_modules/@microwiseai/skit/dist/commands/install.js +0 -150
  98. package/node_modules/@microwiseai/skit/dist/commands/install.js.map +0 -1
  99. package/node_modules/@microwiseai/skit/dist/commands/licenses.d.ts +0 -9
  100. package/node_modules/@microwiseai/skit/dist/commands/licenses.d.ts.map +0 -1
  101. package/node_modules/@microwiseai/skit/dist/commands/licenses.js +0 -125
  102. package/node_modules/@microwiseai/skit/dist/commands/licenses.js.map +0 -1
  103. package/node_modules/@microwiseai/skit/dist/commands/list.js +0 -41
  104. package/node_modules/@microwiseai/skit/dist/commands/list.js.map +0 -1
  105. package/node_modules/@microwiseai/skit/dist/commands/login.d.ts +0 -10
  106. package/node_modules/@microwiseai/skit/dist/commands/login.d.ts.map +0 -1
  107. package/node_modules/@microwiseai/skit/dist/commands/login.js +0 -112
  108. package/node_modules/@microwiseai/skit/dist/commands/login.js.map +0 -1
  109. package/node_modules/@microwiseai/skit/dist/commands/logout.d.ts +0 -5
  110. package/node_modules/@microwiseai/skit/dist/commands/logout.d.ts.map +0 -1
  111. package/node_modules/@microwiseai/skit/dist/commands/logout.js +0 -30
  112. package/node_modules/@microwiseai/skit/dist/commands/logout.js.map +0 -1
  113. package/node_modules/@microwiseai/skit/dist/commands/pack.js +0 -185
  114. package/node_modules/@microwiseai/skit/dist/commands/pack.js.map +0 -1
  115. package/node_modules/@microwiseai/skit/dist/commands/publish.js +0 -108
  116. package/node_modules/@microwiseai/skit/dist/commands/publish.js.map +0 -1
  117. package/node_modules/@microwiseai/skit/dist/commands/purchase.d.ts +0 -9
  118. package/node_modules/@microwiseai/skit/dist/commands/purchase.d.ts.map +0 -1
  119. package/node_modules/@microwiseai/skit/dist/commands/purchase.js +0 -160
  120. package/node_modules/@microwiseai/skit/dist/commands/purchase.js.map +0 -1
  121. package/node_modules/@microwiseai/skit/dist/commands/register.d.ts +0 -10
  122. package/node_modules/@microwiseai/skit/dist/commands/register.d.ts.map +0 -1
  123. package/node_modules/@microwiseai/skit/dist/commands/register.js +0 -121
  124. package/node_modules/@microwiseai/skit/dist/commands/register.js.map +0 -1
  125. package/node_modules/@microwiseai/skit/dist/commands/uninstall.js +0 -138
  126. package/node_modules/@microwiseai/skit/dist/commands/uninstall.js.map +0 -1
  127. package/node_modules/@microwiseai/skit/dist/commands/whoami.d.ts +0 -9
  128. package/node_modules/@microwiseai/skit/dist/commands/whoami.d.ts.map +0 -1
  129. package/node_modules/@microwiseai/skit/dist/commands/whoami.js +0 -79
  130. package/node_modules/@microwiseai/skit/dist/commands/whoami.js.map +0 -1
  131. package/node_modules/@microwiseai/skit/dist/index.js.map +0 -1
  132. package/node_modules/@microwiseai/skit/dist/lib.js.map +0 -1
  133. package/node_modules/@microwiseai/skit/dist/types/skit.js +0 -20
  134. package/node_modules/@microwiseai/skit/dist/types/skit.js.map +0 -1
  135. package/node_modules/@microwiseai/skit/dist/utils/api.d.ts +0 -18
  136. package/node_modules/@microwiseai/skit/dist/utils/api.d.ts.map +0 -1
  137. package/node_modules/@microwiseai/skit/dist/utils/api.js +0 -26
  138. package/node_modules/@microwiseai/skit/dist/utils/api.js.map +0 -1
  139. package/node_modules/@microwiseai/skit/dist/utils/auth.d.ts +0 -62
  140. package/node_modules/@microwiseai/skit/dist/utils/auth.d.ts.map +0 -1
  141. package/node_modules/@microwiseai/skit/dist/utils/auth.js +0 -172
  142. package/node_modules/@microwiseai/skit/dist/utils/auth.js.map +0 -1
  143. package/node_modules/@microwiseai/skit/dist/utils/file-copy.js +0 -219
  144. package/node_modules/@microwiseai/skit/dist/utils/file-copy.js.map +0 -1
  145. package/node_modules/@microwiseai/skit/dist/utils/hook-installer.js +0 -98
  146. package/node_modules/@microwiseai/skit/dist/utils/hook-installer.js.map +0 -1
  147. package/node_modules/@microwiseai/skit/dist/utils/installed-registry.js +0 -108
  148. package/node_modules/@microwiseai/skit/dist/utils/installed-registry.js.map +0 -1
  149. package/node_modules/@microwiseai/skit/dist/utils/skit-parser.js +0 -52
  150. package/node_modules/@microwiseai/skit/dist/utils/skit-parser.js.map +0 -1
  151. package/node_modules/@microwiseai/skit/dist/utils/wrapper-generator.d.ts +0 -74
  152. package/node_modules/@microwiseai/skit/dist/utils/wrapper-generator.d.ts.map +0 -1
  153. package/node_modules/@microwiseai/skit/dist/utils/wrapper-generator.js +0 -280
  154. package/node_modules/@microwiseai/skit/dist/utils/wrapper-generator.js.map +0 -1
  155. package/node_modules/chownr/LICENSE.md +0 -63
  156. package/node_modules/chownr/README.md +0 -3
  157. package/node_modules/chownr/dist/commonjs/index.d.ts +0 -3
  158. package/node_modules/chownr/dist/commonjs/index.d.ts.map +0 -1
  159. package/node_modules/chownr/dist/commonjs/index.js +0 -93
  160. package/node_modules/chownr/dist/commonjs/index.js.map +0 -1
  161. package/node_modules/chownr/dist/commonjs/package.json +0 -3
  162. package/node_modules/chownr/dist/esm/index.d.ts +0 -3
  163. package/node_modules/chownr/dist/esm/index.d.ts.map +0 -1
  164. package/node_modules/chownr/dist/esm/index.js +0 -85
  165. package/node_modules/chownr/dist/esm/index.js.map +0 -1
  166. package/node_modules/chownr/dist/esm/package.json +0 -3
  167. package/node_modules/chownr/package.json +0 -69
  168. package/node_modules/commander/LICENSE +0 -22
  169. package/node_modules/commander/Readme.md +0 -1157
  170. package/node_modules/commander/esm.mjs +0 -16
  171. package/node_modules/commander/index.js +0 -24
  172. package/node_modules/commander/lib/argument.js +0 -149
  173. package/node_modules/commander/lib/command.js +0 -2509
  174. package/node_modules/commander/lib/error.js +0 -39
  175. package/node_modules/commander/lib/help.js +0 -520
  176. package/node_modules/commander/lib/option.js +0 -330
  177. package/node_modules/commander/lib/suggestSimilar.js +0 -101
  178. package/node_modules/commander/package-support.json +0 -16
  179. package/node_modules/commander/package.json +0 -84
  180. package/node_modules/commander/typings/esm.d.mts +0 -3
  181. package/node_modules/commander/typings/index.d.ts +0 -969
  182. package/node_modules/minipass/LICENSE.md +0 -55
  183. package/node_modules/minipass/README.md +0 -825
  184. package/node_modules/minipass/dist/commonjs/index.d.ts +0 -545
  185. package/node_modules/minipass/dist/commonjs/index.d.ts.map +0 -1
  186. package/node_modules/minipass/dist/commonjs/index.js +0 -1038
  187. package/node_modules/minipass/dist/commonjs/index.js.map +0 -1
  188. package/node_modules/minipass/dist/commonjs/package.json +0 -3
  189. package/node_modules/minipass/dist/esm/index.d.ts +0 -545
  190. package/node_modules/minipass/dist/esm/index.d.ts.map +0 -1
  191. package/node_modules/minipass/dist/esm/index.js +0 -1020
  192. package/node_modules/minipass/dist/esm/index.js.map +0 -1
  193. package/node_modules/minipass/dist/esm/package.json +0 -3
  194. package/node_modules/minipass/package.json +0 -77
  195. package/node_modules/minizlib/LICENSE +0 -26
  196. package/node_modules/minizlib/README.md +0 -64
  197. package/node_modules/minizlib/dist/commonjs/constants.d.ts +0 -2
  198. package/node_modules/minizlib/dist/commonjs/constants.d.ts.map +0 -1
  199. package/node_modules/minizlib/dist/commonjs/constants.js +0 -123
  200. package/node_modules/minizlib/dist/commonjs/constants.js.map +0 -1
  201. package/node_modules/minizlib/dist/commonjs/index.d.ts +0 -99
  202. package/node_modules/minizlib/dist/commonjs/index.d.ts.map +0 -1
  203. package/node_modules/minizlib/dist/commonjs/index.js +0 -416
  204. package/node_modules/minizlib/dist/commonjs/index.js.map +0 -1
  205. package/node_modules/minizlib/dist/commonjs/package.json +0 -3
  206. package/node_modules/minizlib/dist/esm/constants.d.ts +0 -2
  207. package/node_modules/minizlib/dist/esm/constants.d.ts.map +0 -1
  208. package/node_modules/minizlib/dist/esm/constants.js +0 -117
  209. package/node_modules/minizlib/dist/esm/constants.js.map +0 -1
  210. package/node_modules/minizlib/dist/esm/index.d.ts +0 -99
  211. package/node_modules/minizlib/dist/esm/index.d.ts.map +0 -1
  212. package/node_modules/minizlib/dist/esm/index.js +0 -363
  213. package/node_modules/minizlib/dist/esm/index.js.map +0 -1
  214. package/node_modules/minizlib/dist/esm/package.json +0 -3
  215. package/node_modules/minizlib/package.json +0 -80
  216. package/node_modules/tar/LICENSE.md +0 -55
  217. package/node_modules/tar/README.md +0 -1224
  218. package/node_modules/tar/dist/commonjs/create.d.ts +0 -3
  219. package/node_modules/tar/dist/commonjs/create.d.ts.map +0 -1
  220. package/node_modules/tar/dist/commonjs/create.js +0 -82
  221. package/node_modules/tar/dist/commonjs/create.js.map +0 -1
  222. package/node_modules/tar/dist/commonjs/cwd-error.d.ts +0 -8
  223. package/node_modules/tar/dist/commonjs/cwd-error.d.ts.map +0 -1
  224. package/node_modules/tar/dist/commonjs/cwd-error.js +0 -18
  225. package/node_modules/tar/dist/commonjs/cwd-error.js.map +0 -1
  226. package/node_modules/tar/dist/commonjs/extract.d.ts +0 -3
  227. package/node_modules/tar/dist/commonjs/extract.d.ts.map +0 -1
  228. package/node_modules/tar/dist/commonjs/extract.js +0 -88
  229. package/node_modules/tar/dist/commonjs/extract.js.map +0 -1
  230. package/node_modules/tar/dist/commonjs/get-write-flag.d.ts +0 -2
  231. package/node_modules/tar/dist/commonjs/get-write-flag.d.ts.map +0 -1
  232. package/node_modules/tar/dist/commonjs/get-write-flag.js +0 -32
  233. package/node_modules/tar/dist/commonjs/get-write-flag.js.map +0 -1
  234. package/node_modules/tar/dist/commonjs/header.d.ts +0 -53
  235. package/node_modules/tar/dist/commonjs/header.d.ts.map +0 -1
  236. package/node_modules/tar/dist/commonjs/header.js +0 -312
  237. package/node_modules/tar/dist/commonjs/header.js.map +0 -1
  238. package/node_modules/tar/dist/commonjs/index.d.ts +0 -20
  239. package/node_modules/tar/dist/commonjs/index.d.ts.map +0 -1
  240. package/node_modules/tar/dist/commonjs/index.js +0 -64
  241. package/node_modules/tar/dist/commonjs/index.js.map +0 -1
  242. package/node_modules/tar/dist/commonjs/index.min.js +0 -4
  243. package/node_modules/tar/dist/commonjs/index.min.js.map +0 -7
  244. package/node_modules/tar/dist/commonjs/large-numbers.d.ts +0 -3
  245. package/node_modules/tar/dist/commonjs/large-numbers.d.ts.map +0 -1
  246. package/node_modules/tar/dist/commonjs/large-numbers.js +0 -99
  247. package/node_modules/tar/dist/commonjs/large-numbers.js.map +0 -1
  248. package/node_modules/tar/dist/commonjs/list.d.ts +0 -7
  249. package/node_modules/tar/dist/commonjs/list.d.ts.map +0 -1
  250. package/node_modules/tar/dist/commonjs/list.js +0 -145
  251. package/node_modules/tar/dist/commonjs/list.js.map +0 -1
  252. package/node_modules/tar/dist/commonjs/make-command.d.ts +0 -49
  253. package/node_modules/tar/dist/commonjs/make-command.d.ts.map +0 -1
  254. package/node_modules/tar/dist/commonjs/make-command.js +0 -52
  255. package/node_modules/tar/dist/commonjs/make-command.js.map +0 -1
  256. package/node_modules/tar/dist/commonjs/mkdir.d.ts +0 -25
  257. package/node_modules/tar/dist/commonjs/mkdir.d.ts.map +0 -1
  258. package/node_modules/tar/dist/commonjs/mkdir.js +0 -187
  259. package/node_modules/tar/dist/commonjs/mkdir.js.map +0 -1
  260. package/node_modules/tar/dist/commonjs/mode-fix.d.ts +0 -2
  261. package/node_modules/tar/dist/commonjs/mode-fix.d.ts.map +0 -1
  262. package/node_modules/tar/dist/commonjs/mode-fix.js +0 -29
  263. package/node_modules/tar/dist/commonjs/mode-fix.js.map +0 -1
  264. package/node_modules/tar/dist/commonjs/normalize-unicode.d.ts +0 -2
  265. package/node_modules/tar/dist/commonjs/normalize-unicode.d.ts.map +0 -1
  266. package/node_modules/tar/dist/commonjs/normalize-unicode.js +0 -38
  267. package/node_modules/tar/dist/commonjs/normalize-unicode.js.map +0 -1
  268. package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts +0 -2
  269. package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts.map +0 -1
  270. package/node_modules/tar/dist/commonjs/normalize-windows-path.js +0 -12
  271. package/node_modules/tar/dist/commonjs/normalize-windows-path.js.map +0 -1
  272. package/node_modules/tar/dist/commonjs/options.d.ts +0 -596
  273. package/node_modules/tar/dist/commonjs/options.d.ts.map +0 -1
  274. package/node_modules/tar/dist/commonjs/options.js +0 -66
  275. package/node_modules/tar/dist/commonjs/options.js.map +0 -1
  276. package/node_modules/tar/dist/commonjs/pack.d.ts +0 -102
  277. package/node_modules/tar/dist/commonjs/pack.d.ts.map +0 -1
  278. package/node_modules/tar/dist/commonjs/pack.js +0 -511
  279. package/node_modules/tar/dist/commonjs/pack.js.map +0 -1
  280. package/node_modules/tar/dist/commonjs/package.json +0 -3
  281. package/node_modules/tar/dist/commonjs/parse.d.ts +0 -85
  282. package/node_modules/tar/dist/commonjs/parse.d.ts.map +0 -1
  283. package/node_modules/tar/dist/commonjs/parse.js +0 -610
  284. package/node_modules/tar/dist/commonjs/parse.js.map +0 -1
  285. package/node_modules/tar/dist/commonjs/path-reservations.d.ts +0 -11
  286. package/node_modules/tar/dist/commonjs/path-reservations.d.ts.map +0 -1
  287. package/node_modules/tar/dist/commonjs/path-reservations.js +0 -170
  288. package/node_modules/tar/dist/commonjs/path-reservations.js.map +0 -1
  289. package/node_modules/tar/dist/commonjs/pax.d.ts +0 -26
  290. package/node_modules/tar/dist/commonjs/pax.d.ts.map +0 -1
  291. package/node_modules/tar/dist/commonjs/pax.js +0 -158
  292. package/node_modules/tar/dist/commonjs/pax.js.map +0 -1
  293. package/node_modules/tar/dist/commonjs/process-umask.d.ts +0 -2
  294. package/node_modules/tar/dist/commonjs/process-umask.d.ts.map +0 -1
  295. package/node_modules/tar/dist/commonjs/process-umask.js +0 -7
  296. package/node_modules/tar/dist/commonjs/process-umask.js.map +0 -1
  297. package/node_modules/tar/dist/commonjs/read-entry.d.ts +0 -36
  298. package/node_modules/tar/dist/commonjs/read-entry.d.ts.map +0 -1
  299. package/node_modules/tar/dist/commonjs/read-entry.js +0 -136
  300. package/node_modules/tar/dist/commonjs/read-entry.js.map +0 -1
  301. package/node_modules/tar/dist/commonjs/replace.d.ts +0 -2
  302. package/node_modules/tar/dist/commonjs/replace.d.ts.map +0 -1
  303. package/node_modules/tar/dist/commonjs/replace.js +0 -227
  304. package/node_modules/tar/dist/commonjs/replace.js.map +0 -1
  305. package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts +0 -2
  306. package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts.map +0 -1
  307. package/node_modules/tar/dist/commonjs/strip-absolute-path.js +0 -29
  308. package/node_modules/tar/dist/commonjs/strip-absolute-path.js.map +0 -1
  309. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts +0 -2
  310. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts.map +0 -1
  311. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.js +0 -18
  312. package/node_modules/tar/dist/commonjs/strip-trailing-slashes.js.map +0 -1
  313. package/node_modules/tar/dist/commonjs/symlink-error.d.ts +0 -9
  314. package/node_modules/tar/dist/commonjs/symlink-error.d.ts.map +0 -1
  315. package/node_modules/tar/dist/commonjs/symlink-error.js +0 -19
  316. package/node_modules/tar/dist/commonjs/symlink-error.js.map +0 -1
  317. package/node_modules/tar/dist/commonjs/types.d.ts +0 -7
  318. package/node_modules/tar/dist/commonjs/types.d.ts.map +0 -1
  319. package/node_modules/tar/dist/commonjs/types.js +0 -50
  320. package/node_modules/tar/dist/commonjs/types.js.map +0 -1
  321. package/node_modules/tar/dist/commonjs/unpack.d.ts +0 -101
  322. package/node_modules/tar/dist/commonjs/unpack.d.ts.map +0 -1
  323. package/node_modules/tar/dist/commonjs/unpack.js +0 -932
  324. package/node_modules/tar/dist/commonjs/unpack.js.map +0 -1
  325. package/node_modules/tar/dist/commonjs/update.d.ts +0 -2
  326. package/node_modules/tar/dist/commonjs/update.d.ts.map +0 -1
  327. package/node_modules/tar/dist/commonjs/update.js +0 -33
  328. package/node_modules/tar/dist/commonjs/update.js.map +0 -1
  329. package/node_modules/tar/dist/commonjs/warn-method.d.ts +0 -24
  330. package/node_modules/tar/dist/commonjs/warn-method.d.ts.map +0 -1
  331. package/node_modules/tar/dist/commonjs/warn-method.js +0 -31
  332. package/node_modules/tar/dist/commonjs/warn-method.js.map +0 -1
  333. package/node_modules/tar/dist/commonjs/winchars.d.ts +0 -3
  334. package/node_modules/tar/dist/commonjs/winchars.d.ts.map +0 -1
  335. package/node_modules/tar/dist/commonjs/winchars.js +0 -14
  336. package/node_modules/tar/dist/commonjs/winchars.js.map +0 -1
  337. package/node_modules/tar/dist/commonjs/write-entry.d.ts +0 -129
  338. package/node_modules/tar/dist/commonjs/write-entry.d.ts.map +0 -1
  339. package/node_modules/tar/dist/commonjs/write-entry.js +0 -698
  340. package/node_modules/tar/dist/commonjs/write-entry.js.map +0 -1
  341. package/node_modules/tar/dist/esm/create.d.ts +0 -3
  342. package/node_modules/tar/dist/esm/create.d.ts.map +0 -1
  343. package/node_modules/tar/dist/esm/create.js +0 -76
  344. package/node_modules/tar/dist/esm/create.js.map +0 -1
  345. package/node_modules/tar/dist/esm/cwd-error.d.ts +0 -8
  346. package/node_modules/tar/dist/esm/cwd-error.d.ts.map +0 -1
  347. package/node_modules/tar/dist/esm/cwd-error.js +0 -14
  348. package/node_modules/tar/dist/esm/cwd-error.js.map +0 -1
  349. package/node_modules/tar/dist/esm/extract.d.ts +0 -3
  350. package/node_modules/tar/dist/esm/extract.d.ts.map +0 -1
  351. package/node_modules/tar/dist/esm/extract.js +0 -49
  352. package/node_modules/tar/dist/esm/extract.js.map +0 -1
  353. package/node_modules/tar/dist/esm/get-write-flag.d.ts +0 -2
  354. package/node_modules/tar/dist/esm/get-write-flag.d.ts.map +0 -1
  355. package/node_modules/tar/dist/esm/get-write-flag.js +0 -26
  356. package/node_modules/tar/dist/esm/get-write-flag.js.map +0 -1
  357. package/node_modules/tar/dist/esm/header.d.ts +0 -53
  358. package/node_modules/tar/dist/esm/header.d.ts.map +0 -1
  359. package/node_modules/tar/dist/esm/header.js +0 -275
  360. package/node_modules/tar/dist/esm/header.js.map +0 -1
  361. package/node_modules/tar/dist/esm/index.d.ts +0 -20
  362. package/node_modules/tar/dist/esm/index.d.ts.map +0 -1
  363. package/node_modules/tar/dist/esm/index.js +0 -20
  364. package/node_modules/tar/dist/esm/index.js.map +0 -1
  365. package/node_modules/tar/dist/esm/index.min.js +0 -4
  366. package/node_modules/tar/dist/esm/index.min.js.map +0 -7
  367. package/node_modules/tar/dist/esm/large-numbers.d.ts +0 -3
  368. package/node_modules/tar/dist/esm/large-numbers.d.ts.map +0 -1
  369. package/node_modules/tar/dist/esm/large-numbers.js +0 -94
  370. package/node_modules/tar/dist/esm/large-numbers.js.map +0 -1
  371. package/node_modules/tar/dist/esm/list.d.ts +0 -7
  372. package/node_modules/tar/dist/esm/list.d.ts.map +0 -1
  373. package/node_modules/tar/dist/esm/list.js +0 -105
  374. package/node_modules/tar/dist/esm/list.js.map +0 -1
  375. package/node_modules/tar/dist/esm/make-command.d.ts +0 -49
  376. package/node_modules/tar/dist/esm/make-command.d.ts.map +0 -1
  377. package/node_modules/tar/dist/esm/make-command.js +0 -48
  378. package/node_modules/tar/dist/esm/make-command.js.map +0 -1
  379. package/node_modules/tar/dist/esm/mkdir.d.ts +0 -25
  380. package/node_modules/tar/dist/esm/mkdir.d.ts.map +0 -1
  381. package/node_modules/tar/dist/esm/mkdir.js +0 -179
  382. package/node_modules/tar/dist/esm/mkdir.js.map +0 -1
  383. package/node_modules/tar/dist/esm/mode-fix.d.ts +0 -2
  384. package/node_modules/tar/dist/esm/mode-fix.d.ts.map +0 -1
  385. package/node_modules/tar/dist/esm/mode-fix.js +0 -25
  386. package/node_modules/tar/dist/esm/mode-fix.js.map +0 -1
  387. package/node_modules/tar/dist/esm/normalize-unicode.d.ts +0 -2
  388. package/node_modules/tar/dist/esm/normalize-unicode.d.ts.map +0 -1
  389. package/node_modules/tar/dist/esm/normalize-unicode.js +0 -34
  390. package/node_modules/tar/dist/esm/normalize-unicode.js.map +0 -1
  391. package/node_modules/tar/dist/esm/normalize-windows-path.d.ts +0 -2
  392. package/node_modules/tar/dist/esm/normalize-windows-path.d.ts.map +0 -1
  393. package/node_modules/tar/dist/esm/normalize-windows-path.js +0 -9
  394. package/node_modules/tar/dist/esm/normalize-windows-path.js.map +0 -1
  395. package/node_modules/tar/dist/esm/options.d.ts +0 -596
  396. package/node_modules/tar/dist/esm/options.d.ts.map +0 -1
  397. package/node_modules/tar/dist/esm/options.js +0 -54
  398. package/node_modules/tar/dist/esm/options.js.map +0 -1
  399. package/node_modules/tar/dist/esm/pack.d.ts +0 -102
  400. package/node_modules/tar/dist/esm/pack.d.ts.map +0 -1
  401. package/node_modules/tar/dist/esm/pack.js +0 -469
  402. package/node_modules/tar/dist/esm/pack.js.map +0 -1
  403. package/node_modules/tar/dist/esm/package.json +0 -3
  404. package/node_modules/tar/dist/esm/parse.d.ts +0 -85
  405. package/node_modules/tar/dist/esm/parse.d.ts.map +0 -1
  406. package/node_modules/tar/dist/esm/parse.js +0 -606
  407. package/node_modules/tar/dist/esm/parse.js.map +0 -1
  408. package/node_modules/tar/dist/esm/path-reservations.d.ts +0 -11
  409. package/node_modules/tar/dist/esm/path-reservations.d.ts.map +0 -1
  410. package/node_modules/tar/dist/esm/path-reservations.js +0 -166
  411. package/node_modules/tar/dist/esm/path-reservations.js.map +0 -1
  412. package/node_modules/tar/dist/esm/pax.d.ts +0 -26
  413. package/node_modules/tar/dist/esm/pax.d.ts.map +0 -1
  414. package/node_modules/tar/dist/esm/pax.js +0 -154
  415. package/node_modules/tar/dist/esm/pax.js.map +0 -1
  416. package/node_modules/tar/dist/esm/process-umask.d.ts +0 -2
  417. package/node_modules/tar/dist/esm/process-umask.d.ts.map +0 -1
  418. package/node_modules/tar/dist/esm/process-umask.js +0 -3
  419. package/node_modules/tar/dist/esm/process-umask.js.map +0 -1
  420. package/node_modules/tar/dist/esm/read-entry.d.ts +0 -36
  421. package/node_modules/tar/dist/esm/read-entry.d.ts.map +0 -1
  422. package/node_modules/tar/dist/esm/read-entry.js +0 -132
  423. package/node_modules/tar/dist/esm/read-entry.js.map +0 -1
  424. package/node_modules/tar/dist/esm/replace.d.ts +0 -2
  425. package/node_modules/tar/dist/esm/replace.d.ts.map +0 -1
  426. package/node_modules/tar/dist/esm/replace.js +0 -221
  427. package/node_modules/tar/dist/esm/replace.js.map +0 -1
  428. package/node_modules/tar/dist/esm/strip-absolute-path.d.ts +0 -2
  429. package/node_modules/tar/dist/esm/strip-absolute-path.d.ts.map +0 -1
  430. package/node_modules/tar/dist/esm/strip-absolute-path.js +0 -25
  431. package/node_modules/tar/dist/esm/strip-absolute-path.js.map +0 -1
  432. package/node_modules/tar/dist/esm/strip-trailing-slashes.d.ts +0 -2
  433. package/node_modules/tar/dist/esm/strip-trailing-slashes.d.ts.map +0 -1
  434. package/node_modules/tar/dist/esm/strip-trailing-slashes.js +0 -14
  435. package/node_modules/tar/dist/esm/strip-trailing-slashes.js.map +0 -1
  436. package/node_modules/tar/dist/esm/symlink-error.d.ts +0 -9
  437. package/node_modules/tar/dist/esm/symlink-error.d.ts.map +0 -1
  438. package/node_modules/tar/dist/esm/symlink-error.js +0 -15
  439. package/node_modules/tar/dist/esm/symlink-error.js.map +0 -1
  440. package/node_modules/tar/dist/esm/types.d.ts +0 -7
  441. package/node_modules/tar/dist/esm/types.d.ts.map +0 -1
  442. package/node_modules/tar/dist/esm/types.js +0 -45
  443. package/node_modules/tar/dist/esm/types.js.map +0 -1
  444. package/node_modules/tar/dist/esm/unpack.d.ts +0 -101
  445. package/node_modules/tar/dist/esm/unpack.d.ts.map +0 -1
  446. package/node_modules/tar/dist/esm/unpack.js +0 -891
  447. package/node_modules/tar/dist/esm/unpack.js.map +0 -1
  448. package/node_modules/tar/dist/esm/update.d.ts +0 -2
  449. package/node_modules/tar/dist/esm/update.d.ts.map +0 -1
  450. package/node_modules/tar/dist/esm/update.js +0 -30
  451. package/node_modules/tar/dist/esm/update.js.map +0 -1
  452. package/node_modules/tar/dist/esm/warn-method.d.ts +0 -24
  453. package/node_modules/tar/dist/esm/warn-method.d.ts.map +0 -1
  454. package/node_modules/tar/dist/esm/warn-method.js +0 -27
  455. package/node_modules/tar/dist/esm/warn-method.js.map +0 -1
  456. package/node_modules/tar/dist/esm/winchars.d.ts +0 -3
  457. package/node_modules/tar/dist/esm/winchars.d.ts.map +0 -1
  458. package/node_modules/tar/dist/esm/winchars.js +0 -9
  459. package/node_modules/tar/dist/esm/winchars.js.map +0 -1
  460. package/node_modules/tar/dist/esm/write-entry.d.ts +0 -129
  461. package/node_modules/tar/dist/esm/write-entry.d.ts.map +0 -1
  462. package/node_modules/tar/dist/esm/write-entry.js +0 -656
  463. package/node_modules/tar/dist/esm/write-entry.js.map +0 -1
  464. package/node_modules/tar/package.json +0 -297
  465. package/node_modules/yallist/LICENSE.md +0 -63
  466. package/node_modules/yallist/README.md +0 -205
  467. package/node_modules/yallist/dist/commonjs/index.d.ts +0 -39
  468. package/node_modules/yallist/dist/commonjs/index.d.ts.map +0 -1
  469. package/node_modules/yallist/dist/commonjs/index.js +0 -384
  470. package/node_modules/yallist/dist/commonjs/index.js.map +0 -1
  471. package/node_modules/yallist/dist/commonjs/package.json +0 -3
  472. package/node_modules/yallist/dist/esm/index.d.ts +0 -39
  473. package/node_modules/yallist/dist/esm/index.d.ts.map +0 -1
  474. package/node_modules/yallist/dist/esm/index.js +0 -379
  475. package/node_modules/yallist/dist/esm/index.js.map +0 -1
  476. package/node_modules/yallist/dist/esm/package.json +0 -3
  477. package/node_modules/yallist/package.json +0 -68
@@ -1,172 +0,0 @@
1
- import { readFile, writeFile, mkdir, unlink } from 'node:fs/promises';
2
- import { join } from 'node:path';
3
- import { homedir } from 'node:os';
4
- import { getMarketplaceApiUrl } from './api.js';
5
- const AUTH_DIR = join(homedir(), '.ist');
6
- const AUTH_FILE = join(AUTH_DIR, 'auth.json');
7
- /**
8
- * Load auth data from ~/.ist/auth.json
9
- */
10
- export async function loadAuth() {
11
- try {
12
- const content = await readFile(AUTH_FILE, 'utf-8');
13
- const data = JSON.parse(content);
14
- return data;
15
- }
16
- catch {
17
- return null;
18
- }
19
- }
20
- /**
21
- * Save auth data to ~/.ist/auth.json
22
- */
23
- export async function saveAuth(data) {
24
- await mkdir(AUTH_DIR, { recursive: true });
25
- await writeFile(AUTH_FILE, JSON.stringify(data, null, 2), 'utf-8');
26
- }
27
- /**
28
- * Clear auth data (logout)
29
- */
30
- export async function clearAuth() {
31
- try {
32
- await unlink(AUTH_FILE);
33
- }
34
- catch {
35
- // Ignore if file doesn't exist
36
- }
37
- }
38
- /**
39
- * Check if user is logged in
40
- */
41
- export async function isLoggedIn() {
42
- const auth = await loadAuth();
43
- return auth !== null;
44
- }
45
- /**
46
- * Check if token is expired or about to expire (within 5 minutes)
47
- */
48
- export function isTokenExpired(expiresAt, bufferSeconds = 300) {
49
- const now = Math.floor(Date.now() / 1000);
50
- return now >= expiresAt - bufferSeconds;
51
- }
52
- /**
53
- * Refresh access token if expired or about to expire
54
- */
55
- export async function refreshTokenIfNeeded() {
56
- const auth = await loadAuth();
57
- if (!auth) {
58
- return null;
59
- }
60
- // Check if token needs refresh (expired or expiring in 5 minutes)
61
- if (!isTokenExpired(auth.expiresAt)) {
62
- return auth;
63
- }
64
- // Try to refresh
65
- try {
66
- const response = await fetch(`${getMarketplaceApiUrl()}/auth/refresh`, {
67
- method: 'POST',
68
- headers: {
69
- 'Content-Type': 'application/json',
70
- },
71
- body: JSON.stringify({ refreshToken: auth.refreshToken }),
72
- });
73
- if (!response.ok) {
74
- // Refresh failed, clear auth and return null
75
- await clearAuth();
76
- return null;
77
- }
78
- const data = await response.json();
79
- await saveAuth(data);
80
- return data;
81
- }
82
- catch {
83
- // Network error, keep existing auth for offline use
84
- return auth;
85
- }
86
- }
87
- /**
88
- * Get valid auth data with automatic refresh
89
- */
90
- export async function getValidAuth() {
91
- return refreshTokenIfNeeded();
92
- }
93
- /**
94
- * Login with email and password
95
- */
96
- export async function login(email, password) {
97
- const response = await fetch(`${getMarketplaceApiUrl()}/auth/login`, {
98
- method: 'POST',
99
- headers: {
100
- 'Content-Type': 'application/json',
101
- },
102
- body: JSON.stringify({ email, password }),
103
- });
104
- if (!response.ok) {
105
- const error = await response.json();
106
- throw new Error(error.message || error.error || 'Login failed');
107
- }
108
- const data = await response.json();
109
- await saveAuth(data);
110
- return data;
111
- }
112
- /**
113
- * Register a new user
114
- */
115
- export async function registerUser(email, password, name) {
116
- const response = await fetch(`${getMarketplaceApiUrl()}/auth/register`, {
117
- method: 'POST',
118
- headers: {
119
- 'Content-Type': 'application/json',
120
- },
121
- body: JSON.stringify({ email, password, name }),
122
- });
123
- if (!response.ok) {
124
- const error = await response.json();
125
- throw new Error(error.message || error.error || 'Registration failed');
126
- }
127
- const data = await response.json();
128
- await saveAuth(data);
129
- return data;
130
- }
131
- /**
132
- * Get current user info from API
133
- */
134
- export async function getCurrentUser() {
135
- const auth = await getValidAuth();
136
- if (!auth) {
137
- return null;
138
- }
139
- try {
140
- const response = await fetch(`${getMarketplaceApiUrl()}/auth/me`, {
141
- headers: {
142
- 'Authorization': `Bearer ${auth.accessToken}`,
143
- },
144
- });
145
- if (!response.ok) {
146
- return null;
147
- }
148
- return await response.json();
149
- }
150
- catch {
151
- // Return cached user if API fails
152
- return auth.user;
153
- }
154
- }
155
- /**
156
- * Make authenticated API request to marketplace
157
- */
158
- export async function marketplaceFetch(path, options = {}) {
159
- const auth = await getValidAuth();
160
- if (!auth) {
161
- throw new Error('Not logged in. Please run: skit login');
162
- }
163
- const headers = new Headers(options.headers);
164
- headers.set('Authorization', `Bearer ${auth.accessToken}`);
165
- return fetch(`${getMarketplaceApiUrl()}${path}`, {
166
- ...options,
167
- headers,
168
- });
169
- }
170
- // Backward compatibility alias
171
- export const authFetch = marketplaceFetch;
172
- //# sourceMappingURL=auth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/utils/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;AACzC,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAqB9C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ;IAC5B,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACnD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAa,CAAC;QAC7C,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAAc;IAC3C,MAAM,KAAK,CAAC,QAAQ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ACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,IAAY,EACZ,UAAuB,EAAE;IAEzB,MAAM,IAAI,GAAG,MAAM,YAAY,EAAE,CAAC;IAClC,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAE3D,OAAO,KAAK,CAAC,GAAG,oBAAoB,EAAE,GAAG,IAAI,EAAE,EAAE;QAC/C,GAAG,OAAO;QACV,OAAO;KACR,CAAC,CAAC;AACL,CAAC;AAED,+BAA+B;AAC/B,MAAM,CAAC,MAAM,SAAS,GAAG,gBAAgB,CAAC"}
@@ -1,219 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-copy.js","sourceRoot":"","sources":["../../src/utils/file-copy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAW,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAY,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAWlC,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE/E;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,OAAO,IAAI,CAA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: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
@@ -1 +0,0 @@
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,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAcD;;GAEG;AACH,KAAK,UAAU,WAAW,CACxB,IAAc,EACd,SAAiB,EACjB,OAA2B;IAE3B,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,MAAM,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;IAEpD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,M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,EAAE,CAAC,CAAC,CAAC;YAChE,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,108 +0,0 @@
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
@@ -1 +0,0 @@
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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