@kaitranntt/ccs 8.4.0-dev.10 → 8.4.0-dev.12

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 (528) hide show
  1. package/README.md +4 -1
  2. package/dist/auth/profile-registry.d.ts.map +1 -1
  3. package/dist/auth/profile-registry.js +13 -12
  4. package/dist/auth/profile-registry.js.map +1 -1
  5. package/dist/cliproxy/accounts/account-safety.d.ts.map +1 -1
  6. package/dist/cliproxy/accounts/account-safety.js +56 -56
  7. package/dist/cliproxy/accounts/account-safety.js.map +1 -1
  8. package/dist/cliproxy/auth/antigravity-responsibility.d.ts.map +1 -1
  9. package/dist/cliproxy/auth/antigravity-responsibility.js +15 -15
  10. package/dist/cliproxy/auth/antigravity-responsibility.js.map +1 -1
  11. package/dist/cliproxy/auth/auth-token-manager.d.ts.map +1 -1
  12. package/dist/cliproxy/auth/auth-token-manager.js +2 -1
  13. package/dist/cliproxy/auth/auth-token-manager.js.map +1 -1
  14. package/dist/cliproxy/auth/auth-types.d.ts.map +1 -1
  15. package/dist/cliproxy/auth/auth-types.js +3 -2
  16. package/dist/cliproxy/auth/auth-types.js.map +1 -1
  17. package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
  18. package/dist/cliproxy/auth/oauth-handler.js +16 -5
  19. package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
  20. package/dist/cliproxy/auth/provider-refreshers/index.d.ts +2 -1
  21. package/dist/cliproxy/auth/provider-refreshers/index.d.ts.map +1 -1
  22. package/dist/cliproxy/auth/provider-refreshers/index.js +4 -2
  23. package/dist/cliproxy/auth/provider-refreshers/index.js.map +1 -1
  24. package/dist/cliproxy/auth/token-manager.d.ts +2 -1
  25. package/dist/cliproxy/auth/token-manager.d.ts.map +1 -1
  26. package/dist/cliproxy/auth/token-manager.js +2 -1
  27. package/dist/cliproxy/auth/token-manager.js.map +1 -1
  28. package/dist/cliproxy/config/model-config.d.ts.map +1 -1
  29. package/dist/cliproxy/config/model-config.js +32 -32
  30. package/dist/cliproxy/config/model-config.js.map +1 -1
  31. package/dist/cliproxy/executor/arg-parser.d.ts.map +1 -1
  32. package/dist/cliproxy/executor/arg-parser.js +26 -26
  33. package/dist/cliproxy/executor/arg-parser.js.map +1 -1
  34. package/dist/cliproxy/executor/auth-coordinator.d.ts.map +1 -1
  35. package/dist/cliproxy/executor/auth-coordinator.js +15 -14
  36. package/dist/cliproxy/executor/auth-coordinator.js.map +1 -1
  37. package/dist/cliproxy/executor/index.d.ts.map +1 -1
  38. package/dist/cliproxy/executor/index.js +17 -13
  39. package/dist/cliproxy/executor/index.js.map +1 -1
  40. package/dist/cliproxy/executor/lifecycle-manager.d.ts.map +1 -1
  41. package/dist/cliproxy/executor/lifecycle-manager.js +18 -16
  42. package/dist/cliproxy/executor/lifecycle-manager.js.map +1 -1
  43. package/dist/cliproxy/executor/model-warnings.d.ts.map +1 -1
  44. package/dist/cliproxy/executor/model-warnings.js +24 -13
  45. package/dist/cliproxy/executor/model-warnings.js.map +1 -1
  46. package/dist/cliproxy/executor/retry-handler.d.ts.map +1 -1
  47. package/dist/cliproxy/executor/retry-handler.js +13 -11
  48. package/dist/cliproxy/executor/retry-handler.js.map +1 -1
  49. package/dist/cliproxy/executor/session-bridge.d.ts.map +1 -1
  50. package/dist/cliproxy/executor/session-bridge.js +18 -10
  51. package/dist/cliproxy/executor/session-bridge.js.map +1 -1
  52. package/dist/cliproxy/management/remote-token-uploader.d.ts.map +1 -1
  53. package/dist/cliproxy/management/remote-token-uploader.js +11 -11
  54. package/dist/cliproxy/management/remote-token-uploader.js.map +1 -1
  55. package/dist/cliproxy/provider-capabilities.d.ts +6 -0
  56. package/dist/cliproxy/provider-capabilities.d.ts.map +1 -1
  57. package/dist/cliproxy/provider-capabilities.js +28 -3
  58. package/dist/cliproxy/provider-capabilities.js.map +1 -1
  59. package/dist/cliproxy/proxy/https-tunnel-proxy.d.ts +5 -1
  60. package/dist/cliproxy/proxy/https-tunnel-proxy.d.ts.map +1 -1
  61. package/dist/cliproxy/proxy/https-tunnel-proxy.js +22 -10
  62. package/dist/cliproxy/proxy/https-tunnel-proxy.js.map +1 -1
  63. package/dist/cliproxy/proxy/tool-sanitization-proxy.d.ts +0 -12
  64. package/dist/cliproxy/proxy/tool-sanitization-proxy.d.ts.map +1 -1
  65. package/dist/cliproxy/proxy/tool-sanitization-proxy.js +42 -72
  66. package/dist/cliproxy/proxy/tool-sanitization-proxy.js.map +1 -1
  67. package/dist/cliproxy/quota/quota-fetcher/account-quota-fetcher.d.ts +21 -0
  68. package/dist/cliproxy/quota/quota-fetcher/account-quota-fetcher.d.ts.map +1 -0
  69. package/dist/cliproxy/quota/quota-fetcher/account-quota-fetcher.js +154 -0
  70. package/dist/cliproxy/quota/quota-fetcher/account-quota-fetcher.js.map +1 -0
  71. package/dist/cliproxy/quota/quota-fetcher/all-accounts-fetcher.d.ts +35 -0
  72. package/dist/cliproxy/quota/quota-fetcher/all-accounts-fetcher.d.ts.map +1 -0
  73. package/dist/cliproxy/quota/quota-fetcher/all-accounts-fetcher.js +98 -0
  74. package/dist/cliproxy/quota/quota-fetcher/all-accounts-fetcher.js.map +1 -0
  75. package/dist/cliproxy/quota/quota-fetcher/auth-file-reader.d.ts +22 -0
  76. package/dist/cliproxy/quota/quota-fetcher/auth-file-reader.d.ts.map +1 -0
  77. package/dist/cliproxy/quota/quota-fetcher/auth-file-reader.js +111 -0
  78. package/dist/cliproxy/quota/quota-fetcher/auth-file-reader.js.map +1 -0
  79. package/dist/cliproxy/quota/quota-fetcher/available-models-fetcher.d.ts +17 -0
  80. package/dist/cliproxy/quota/quota-fetcher/available-models-fetcher.d.ts.map +1 -0
  81. package/dist/cliproxy/quota/quota-fetcher/available-models-fetcher.js +85 -0
  82. package/dist/cliproxy/quota/quota-fetcher/available-models-fetcher.js.map +1 -0
  83. package/dist/cliproxy/quota/quota-fetcher/constants.d.ts +25 -0
  84. package/dist/cliproxy/quota/quota-fetcher/constants.d.ts.map +1 -0
  85. package/dist/cliproxy/quota/quota-fetcher/constants.js +31 -0
  86. package/dist/cliproxy/quota/quota-fetcher/constants.js.map +1 -0
  87. package/dist/cliproxy/quota/quota-fetcher/http-client.d.ts +29 -0
  88. package/dist/cliproxy/quota/quota-fetcher/http-client.d.ts.map +1 -0
  89. package/dist/cliproxy/quota/quota-fetcher/http-client.js +199 -0
  90. package/dist/cliproxy/quota/quota-fetcher/http-client.js.map +1 -0
  91. package/dist/cliproxy/quota/quota-fetcher/project-lookup.d.ts +16 -0
  92. package/dist/cliproxy/quota/quota-fetcher/project-lookup.d.ts.map +1 -0
  93. package/dist/cliproxy/quota/quota-fetcher/project-lookup.js +89 -0
  94. package/dist/cliproxy/quota/quota-fetcher/project-lookup.js.map +1 -0
  95. package/dist/cliproxy/quota/quota-fetcher/status-classifier.d.ts +29 -0
  96. package/dist/cliproxy/quota/quota-fetcher/status-classifier.d.ts.map +1 -0
  97. package/dist/cliproxy/quota/quota-fetcher/status-classifier.js +168 -0
  98. package/dist/cliproxy/quota/quota-fetcher/status-classifier.js.map +1 -0
  99. package/dist/cliproxy/quota/quota-fetcher/types.d.ts +165 -0
  100. package/dist/cliproxy/quota/quota-fetcher/types.d.ts.map +1 -0
  101. package/dist/cliproxy/quota/quota-fetcher/types.js +9 -0
  102. package/dist/cliproxy/quota/quota-fetcher/types.js.map +1 -0
  103. package/dist/cliproxy/quota/quota-fetcher-claude.d.ts.map +1 -1
  104. package/dist/cliproxy/quota/quota-fetcher-claude.js +14 -3
  105. package/dist/cliproxy/quota/quota-fetcher-claude.js.map +1 -1
  106. package/dist/cliproxy/quota/quota-fetcher-codex.d.ts.map +1 -1
  107. package/dist/cliproxy/quota/quota-fetcher-codex.js +36 -9
  108. package/dist/cliproxy/quota/quota-fetcher-codex.js.map +1 -1
  109. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/auth-file-discovery.d.ts +26 -0
  110. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/auth-file-discovery.d.ts.map +1 -0
  111. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/auth-file-discovery.js +132 -0
  112. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/auth-file-discovery.js.map +1 -0
  113. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/bucket-building.d.ts +23 -0
  114. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/bucket-building.d.ts.map +1 -0
  115. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/bucket-building.js +54 -0
  116. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/bucket-building.js.map +1 -0
  117. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/constants.d.ts +26 -0
  118. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/constants.d.ts.map +1 -0
  119. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/constants.js +29 -0
  120. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/constants.js.map +1 -0
  121. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/error-parsing.d.ts +61 -0
  122. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/error-parsing.d.ts.map +1 -0
  123. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/error-parsing.js +259 -0
  124. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/error-parsing.js.map +1 -0
  125. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/index.d.ts +20 -0
  126. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/index.d.ts.map +1 -0
  127. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/index.js +38 -0
  128. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/index.js.map +1 -0
  129. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/managed-request.d.ts +82 -0
  130. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/managed-request.d.ts.map +1 -0
  131. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/managed-request.js +263 -0
  132. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/managed-request.js.map +1 -0
  133. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/quota-fetcher.d.ts +46 -0
  134. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/quota-fetcher.d.ts.map +1 -0
  135. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/quota-fetcher.js +188 -0
  136. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/quota-fetcher.js.map +1 -0
  137. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/shared-utils.d.ts +35 -0
  138. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/shared-utils.d.ts.map +1 -0
  139. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/shared-utils.js +65 -0
  140. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/shared-utils.js.map +1 -0
  141. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/supplementary-metadata.d.ts +37 -0
  142. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/supplementary-metadata.d.ts.map +1 -0
  143. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/supplementary-metadata.js +117 -0
  144. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/supplementary-metadata.js.map +1 -0
  145. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/token-parsing.d.ts +31 -0
  146. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/token-parsing.d.ts.map +1 -0
  147. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/token-parsing.js +77 -0
  148. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/token-parsing.js.map +1 -0
  149. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/types.d.ts +114 -0
  150. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/types.d.ts.map +1 -0
  151. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/types.js +10 -0
  152. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/types.js.map +1 -0
  153. package/dist/cliproxy/quota/quota-fetcher-gemini-cli.d.ts +13 -58
  154. package/dist/cliproxy/quota/quota-fetcher-gemini-cli.d.ts.map +1 -1
  155. package/dist/cliproxy/quota/quota-fetcher-gemini-cli.js +20 -819
  156. package/dist/cliproxy/quota/quota-fetcher-gemini-cli.js.map +1 -1
  157. package/dist/cliproxy/quota/quota-fetcher-ghcp.d.ts.map +1 -1
  158. package/dist/cliproxy/quota/quota-fetcher-ghcp.js +19 -4
  159. package/dist/cliproxy/quota/quota-fetcher-ghcp.js.map +1 -1
  160. package/dist/cliproxy/quota/quota-fetcher.d.ts +12 -108
  161. package/dist/cliproxy/quota/quota-fetcher.d.ts.map +1 -1
  162. package/dist/cliproxy/quota/quota-fetcher.js +23 -766
  163. package/dist/cliproxy/quota/quota-fetcher.js.map +1 -1
  164. package/dist/cliproxy/routing/routing-strategy.d.ts.map +1 -1
  165. package/dist/cliproxy/routing/routing-strategy.js +11 -3
  166. package/dist/cliproxy/routing/routing-strategy.js.map +1 -1
  167. package/dist/commands/cliproxy/quota-subcommand/claude-window-helpers.d.ts +26 -0
  168. package/dist/commands/cliproxy/quota-subcommand/claude-window-helpers.d.ts.map +1 -0
  169. package/dist/commands/cliproxy/quota-subcommand/claude-window-helpers.js +82 -0
  170. package/dist/commands/cliproxy/quota-subcommand/claude-window-helpers.js.map +1 -0
  171. package/dist/commands/cliproxy/quota-subcommand/codex-window-helpers.d.ts +41 -0
  172. package/dist/commands/cliproxy/quota-subcommand/codex-window-helpers.d.ts.map +1 -0
  173. package/dist/commands/cliproxy/quota-subcommand/codex-window-helpers.js +202 -0
  174. package/dist/commands/cliproxy/quota-subcommand/codex-window-helpers.js.map +1 -0
  175. package/dist/commands/cliproxy/quota-subcommand/format-helpers.d.ts +32 -0
  176. package/dist/commands/cliproxy/quota-subcommand/format-helpers.d.ts.map +1 -0
  177. package/dist/commands/cliproxy/quota-subcommand/format-helpers.js +90 -0
  178. package/dist/commands/cliproxy/quota-subcommand/format-helpers.js.map +1 -0
  179. package/dist/commands/cliproxy/quota-subcommand/handlers.d.ts +25 -0
  180. package/dist/commands/cliproxy/quota-subcommand/handlers.d.ts.map +1 -0
  181. package/dist/commands/cliproxy/quota-subcommand/handlers.js +245 -0
  182. package/dist/commands/cliproxy/quota-subcommand/handlers.js.map +1 -0
  183. package/dist/commands/cliproxy/quota-subcommand/profile-args.d.ts +10 -0
  184. package/dist/commands/cliproxy/quota-subcommand/profile-args.d.ts.map +1 -0
  185. package/dist/commands/cliproxy/quota-subcommand/profile-args.js +37 -0
  186. package/dist/commands/cliproxy/quota-subcommand/profile-args.js.map +1 -0
  187. package/dist/commands/cliproxy/quota-subcommand/provider-runtime.d.ts +12 -0
  188. package/dist/commands/cliproxy/quota-subcommand/provider-runtime.d.ts.map +1 -0
  189. package/dist/commands/cliproxy/quota-subcommand/provider-runtime.js +64 -0
  190. package/dist/commands/cliproxy/quota-subcommand/provider-runtime.js.map +1 -0
  191. package/dist/commands/cliproxy/quota-subcommand/quota-failure-display.d.ts +27 -0
  192. package/dist/commands/cliproxy/quota-subcommand/quota-failure-display.d.ts.map +1 -0
  193. package/dist/commands/cliproxy/quota-subcommand/quota-failure-display.js +74 -0
  194. package/dist/commands/cliproxy/quota-subcommand/quota-failure-display.js.map +1 -0
  195. package/dist/commands/cliproxy/quota-subcommand/sections/antigravity.d.ts +10 -0
  196. package/dist/commands/cliproxy/quota-subcommand/sections/antigravity.d.ts.map +1 -0
  197. package/dist/commands/cliproxy/quota-subcommand/sections/antigravity.js +46 -0
  198. package/dist/commands/cliproxy/quota-subcommand/sections/antigravity.js.map +1 -0
  199. package/dist/commands/cliproxy/quota-subcommand/sections/claude.d.ts +14 -0
  200. package/dist/commands/cliproxy/quota-subcommand/sections/claude.d.ts.map +1 -0
  201. package/dist/commands/cliproxy/quota-subcommand/sections/claude.js +68 -0
  202. package/dist/commands/cliproxy/quota-subcommand/sections/claude.js.map +1 -0
  203. package/dist/commands/cliproxy/quota-subcommand/sections/codex.d.ts +14 -0
  204. package/dist/commands/cliproxy/quota-subcommand/sections/codex.d.ts.map +1 -0
  205. package/dist/commands/cliproxy/quota-subcommand/sections/codex.js +82 -0
  206. package/dist/commands/cliproxy/quota-subcommand/sections/codex.js.map +1 -0
  207. package/dist/commands/cliproxy/quota-subcommand/sections/gemini-cli.d.ts +14 -0
  208. package/dist/commands/cliproxy/quota-subcommand/sections/gemini-cli.d.ts.map +1 -0
  209. package/dist/commands/cliproxy/quota-subcommand/sections/gemini-cli.js +61 -0
  210. package/dist/commands/cliproxy/quota-subcommand/sections/gemini-cli.js.map +1 -0
  211. package/dist/commands/cliproxy/quota-subcommand/sections/ghcp.d.ts +13 -0
  212. package/dist/commands/cliproxy/quota-subcommand/sections/ghcp.d.ts.map +1 -0
  213. package/dist/commands/cliproxy/quota-subcommand/sections/ghcp.js +63 -0
  214. package/dist/commands/cliproxy/quota-subcommand/sections/ghcp.js.map +1 -0
  215. package/dist/commands/cliproxy/quota-subcommand/test-exports.d.ts +19 -0
  216. package/dist/commands/cliproxy/quota-subcommand/test-exports.d.ts.map +1 -0
  217. package/dist/commands/cliproxy/quota-subcommand/test-exports.js +22 -0
  218. package/dist/commands/cliproxy/quota-subcommand/test-exports.js.map +1 -0
  219. package/dist/commands/cliproxy/quota-subcommand/types.d.ts +42 -0
  220. package/dist/commands/cliproxy/quota-subcommand/types.d.ts.map +1 -0
  221. package/dist/commands/cliproxy/quota-subcommand/types.js +9 -0
  222. package/dist/commands/cliproxy/quota-subcommand/types.js.map +1 -0
  223. package/dist/commands/cliproxy/quota-subcommand.d.ts +14 -36
  224. package/dist/commands/cliproxy/quota-subcommand.d.ts.map +1 -1
  225. package/dist/commands/cliproxy/quota-subcommand.js +21 -872
  226. package/dist/commands/cliproxy/quota-subcommand.js.map +1 -1
  227. package/dist/commands/command-catalog.js +1 -1
  228. package/dist/commands/command-catalog.js.map +1 -1
  229. package/dist/commands/persist-command/arg-parsing.d.ts +14 -0
  230. package/dist/commands/persist-command/arg-parsing.d.ts.map +1 -0
  231. package/dist/commands/persist-command/arg-parsing.js +84 -0
  232. package/dist/commands/persist-command/arg-parsing.js.map +1 -0
  233. package/dist/commands/persist-command/backup-rotation.d.ts +23 -0
  234. package/dist/commands/persist-command/backup-rotation.d.ts.map +1 -0
  235. package/dist/commands/persist-command/backup-rotation.js +260 -0
  236. package/dist/commands/persist-command/backup-rotation.js.map +1 -0
  237. package/dist/commands/persist-command/handler.d.ts +10 -0
  238. package/dist/commands/persist-command/handler.d.ts.map +1 -0
  239. package/dist/commands/persist-command/handler.js +267 -0
  240. package/dist/commands/persist-command/handler.js.map +1 -0
  241. package/dist/commands/persist-command/help.d.ts +9 -0
  242. package/dist/commands/persist-command/help.d.ts.map +1 -0
  243. package/dist/commands/persist-command/help.js +86 -0
  244. package/dist/commands/persist-command/help.js.map +1 -0
  245. package/dist/commands/persist-command/receipt.d.ts +13 -0
  246. package/dist/commands/persist-command/receipt.d.ts.map +1 -0
  247. package/dist/commands/persist-command/receipt.js +102 -0
  248. package/dist/commands/persist-command/receipt.js.map +1 -0
  249. package/dist/commands/persist-command/secret-detection.d.ts +11 -0
  250. package/dist/commands/persist-command/secret-detection.d.ts.map +1 -0
  251. package/dist/commands/persist-command/secret-detection.js +54 -0
  252. package/dist/commands/persist-command/secret-detection.js.map +1 -0
  253. package/dist/commands/persist-command/secure-file.d.ts +21 -0
  254. package/dist/commands/persist-command/secure-file.d.ts.map +1 -0
  255. package/dist/commands/persist-command/secure-file.js +231 -0
  256. package/dist/commands/persist-command/secure-file.js.map +1 -0
  257. package/dist/commands/persist-command/types.d.ts +42 -0
  258. package/dist/commands/persist-command/types.d.ts.map +1 -0
  259. package/dist/commands/persist-command/types.js +34 -0
  260. package/dist/commands/persist-command/types.js.map +1 -0
  261. package/dist/commands/persist-command.d.ts +7 -2
  262. package/dist/commands/persist-command.d.ts.map +1 -1
  263. package/dist/commands/persist-command.js +17 -933
  264. package/dist/commands/persist-command.js.map +1 -1
  265. package/dist/copilot/copilot-executor.js +25 -25
  266. package/dist/copilot/copilot-executor.js.map +1 -1
  267. package/dist/cursor/cursor-daemon-entry.d.ts.map +1 -1
  268. package/dist/cursor/cursor-daemon-entry.js +34 -9
  269. package/dist/cursor/cursor-daemon-entry.js.map +1 -1
  270. package/dist/cursor/cursor-daemon.d.ts.map +1 -1
  271. package/dist/cursor/cursor-daemon.js +1 -0
  272. package/dist/cursor/cursor-daemon.js.map +1 -1
  273. package/dist/cursor/cursor-profile-executor.d.ts.map +1 -1
  274. package/dist/cursor/cursor-profile-executor.js +18 -17
  275. package/dist/cursor/cursor-profile-executor.js.map +1 -1
  276. package/dist/delegation/delegation-handler.d.ts.map +1 -1
  277. package/dist/delegation/delegation-handler.js +29 -23
  278. package/dist/delegation/delegation-handler.js.map +1 -1
  279. package/dist/delegation/headless-executor.d.ts +1 -0
  280. package/dist/delegation/headless-executor.d.ts.map +1 -1
  281. package/dist/delegation/headless-executor.js +35 -14
  282. package/dist/delegation/headless-executor.js.map +1 -1
  283. package/dist/delegation/session-manager.d.ts.map +1 -1
  284. package/dist/delegation/session-manager.js +12 -4
  285. package/dist/delegation/session-manager.js.map +1 -1
  286. package/dist/dispatcher/cli-argument-parser.d.ts +1 -1
  287. package/dist/dispatcher/cli-argument-parser.d.ts.map +1 -1
  288. package/dist/dispatcher/cli-argument-parser.js +24 -23
  289. package/dist/dispatcher/cli-argument-parser.js.map +1 -1
  290. package/dist/dispatcher/flows/cliproxy-flow.d.ts.map +1 -1
  291. package/dist/dispatcher/flows/cliproxy-flow.js +12 -11
  292. package/dist/dispatcher/flows/cliproxy-flow.js.map +1 -1
  293. package/dist/dispatcher/flows/settings-flow.d.ts.map +1 -1
  294. package/dist/dispatcher/flows/settings-flow.js +27 -27
  295. package/dist/dispatcher/flows/settings-flow.js.map +1 -1
  296. package/dist/dispatcher/profile-resolver.d.ts.map +1 -1
  297. package/dist/dispatcher/profile-resolver.js +16 -16
  298. package/dist/dispatcher/profile-resolver.js.map +1 -1
  299. package/dist/docker/supervisord-lifecycle.d.ts.map +1 -1
  300. package/dist/docker/supervisord-lifecycle.js +5 -1
  301. package/dist/docker/supervisord-lifecycle.js.map +1 -1
  302. package/dist/errors/error-types.d.ts +26 -22
  303. package/dist/errors/error-types.d.ts.map +1 -1
  304. package/dist/errors/error-types.js +15 -12
  305. package/dist/errors/error-types.js.map +1 -1
  306. package/dist/errors/exit-codes.d.ts +20 -13
  307. package/dist/errors/exit-codes.d.ts.map +1 -1
  308. package/dist/errors/exit-codes.js +32 -28
  309. package/dist/errors/exit-codes.js.map +1 -1
  310. package/dist/glmt/delta-accumulator.d.ts +1 -0
  311. package/dist/glmt/delta-accumulator.d.ts.map +1 -1
  312. package/dist/glmt/delta-accumulator.js +12 -4
  313. package/dist/glmt/delta-accumulator.js.map +1 -1
  314. package/dist/glmt/glmt-proxy.d.ts.map +1 -1
  315. package/dist/glmt/glmt-proxy.js +39 -10
  316. package/dist/glmt/glmt-proxy.js.map +1 -1
  317. package/dist/glmt/glmt-transformer.d.ts.map +1 -1
  318. package/dist/glmt/glmt-transformer.js +1 -4
  319. package/dist/glmt/glmt-transformer.js.map +1 -1
  320. package/dist/glmt/pipeline/request-transformer.d.ts.map +1 -1
  321. package/dist/glmt/pipeline/request-transformer.js +5 -1
  322. package/dist/glmt/pipeline/request-transformer.js.map +1 -1
  323. package/dist/glmt/pipeline/response-builder.d.ts.map +1 -1
  324. package/dist/glmt/pipeline/response-builder.js +7 -3
  325. package/dist/glmt/pipeline/response-builder.js.map +1 -1
  326. package/dist/glmt/pipeline/stream-parser.d.ts.map +1 -1
  327. package/dist/glmt/pipeline/stream-parser.js +11 -5
  328. package/dist/glmt/pipeline/stream-parser.js.map +1 -1
  329. package/dist/glmt/pipeline/tool-call-handler.d.ts.map +1 -1
  330. package/dist/glmt/pipeline/tool-call-handler.js +7 -1
  331. package/dist/glmt/pipeline/tool-call-handler.js.map +1 -1
  332. package/dist/glmt/sse-parser.d.ts +1 -0
  333. package/dist/glmt/sse-parser.d.ts.map +1 -1
  334. package/dist/glmt/sse-parser.js +7 -3
  335. package/dist/glmt/sse-parser.js.map +1 -1
  336. package/dist/management/shared-manager/fs-helpers.d.ts +69 -0
  337. package/dist/management/shared-manager/fs-helpers.d.ts.map +1 -0
  338. package/dist/management/shared-manager/fs-helpers.js +241 -0
  339. package/dist/management/shared-manager/fs-helpers.js.map +1 -0
  340. package/dist/management/shared-manager/migrations.d.ts +21 -0
  341. package/dist/management/shared-manager/migrations.d.ts.map +1 -0
  342. package/dist/management/shared-manager/migrations.js +187 -0
  343. package/dist/management/shared-manager/migrations.js.map +1 -0
  344. package/dist/management/shared-manager/orchestrator.d.ts +87 -0
  345. package/dist/management/shared-manager/orchestrator.d.ts.map +1 -0
  346. package/dist/management/shared-manager/orchestrator.js +161 -0
  347. package/dist/management/shared-manager/orchestrator.js.map +1 -0
  348. package/dist/management/shared-manager/plugin-layout-internals.d.ts +42 -0
  349. package/dist/management/shared-manager/plugin-layout-internals.d.ts.map +1 -0
  350. package/dist/management/shared-manager/plugin-layout-internals.js +192 -0
  351. package/dist/management/shared-manager/plugin-layout-internals.js.map +1 -0
  352. package/dist/management/shared-manager/plugin-metadata-normalizer.d.ts +53 -0
  353. package/dist/management/shared-manager/plugin-metadata-normalizer.d.ts.map +1 -0
  354. package/dist/management/shared-manager/plugin-metadata-normalizer.js +253 -0
  355. package/dist/management/shared-manager/plugin-metadata-normalizer.js.map +1 -0
  356. package/dist/management/shared-manager/project-context-sync.d.ts +36 -0
  357. package/dist/management/shared-manager/project-context-sync.d.ts.map +1 -0
  358. package/dist/management/shared-manager/project-context-sync.js +204 -0
  359. package/dist/management/shared-manager/project-context-sync.js.map +1 -0
  360. package/dist/management/shared-manager/project-memory-sync.d.ts +21 -0
  361. package/dist/management/shared-manager/project-memory-sync.d.ts.map +1 -0
  362. package/dist/management/shared-manager/project-memory-sync.js +113 -0
  363. package/dist/management/shared-manager/project-memory-sync.js.map +1 -0
  364. package/dist/management/shared-manager/shared-dir-linker.d.ts +41 -0
  365. package/dist/management/shared-manager/shared-dir-linker.d.ts.map +1 -0
  366. package/dist/management/shared-manager/shared-dir-linker.js +227 -0
  367. package/dist/management/shared-manager/shared-dir-linker.js.map +1 -0
  368. package/dist/management/shared-manager/symlink-helpers.d.ts +61 -0
  369. package/dist/management/shared-manager/symlink-helpers.d.ts.map +1 -0
  370. package/dist/management/shared-manager/symlink-helpers.js +243 -0
  371. package/dist/management/shared-manager/symlink-helpers.js.map +1 -0
  372. package/dist/management/shared-manager/types.d.ts +45 -0
  373. package/dist/management/shared-manager/types.d.ts.map +1 -0
  374. package/dist/management/shared-manager/types.js +57 -0
  375. package/dist/management/shared-manager/types.js.map +1 -0
  376. package/dist/management/shared-manager.d.ts +13 -160
  377. package/dist/management/shared-manager.d.ts.map +1 -1
  378. package/dist/management/shared-manager.js +18 -1294
  379. package/dist/management/shared-manager.js.map +1 -1
  380. package/dist/proxy/proxy-daemon-entry.js +1 -1
  381. package/dist/proxy/proxy-daemon-entry.js.map +1 -1
  382. package/dist/proxy/transformers/sse-stream-transformer.d.ts.map +1 -1
  383. package/dist/proxy/transformers/sse-stream-transformer.js +12 -17
  384. package/dist/proxy/transformers/sse-stream-transformer.js.map +1 -1
  385. package/dist/services/logging/index.d.ts +1 -1
  386. package/dist/services/logging/index.d.ts.map +1 -1
  387. package/dist/services/logging/index.js +6 -1
  388. package/dist/services/logging/index.js.map +1 -1
  389. package/dist/services/logging/log-context.d.ts +27 -2
  390. package/dist/services/logging/log-context.d.ts.map +1 -1
  391. package/dist/services/logging/log-context.js +43 -4
  392. package/dist/services/logging/log-context.js.map +1 -1
  393. package/dist/services/logging/log-redaction.d.ts +9 -0
  394. package/dist/services/logging/log-redaction.d.ts.map +1 -1
  395. package/dist/services/logging/log-redaction.js +31 -3
  396. package/dist/services/logging/log-redaction.js.map +1 -1
  397. package/dist/services/logging/logger.js +2 -2
  398. package/dist/services/logging/logger.js.map +1 -1
  399. package/dist/targets/codex-adapter.d.ts.map +1 -1
  400. package/dist/targets/codex-adapter.js +11 -10
  401. package/dist/targets/codex-adapter.js.map +1 -1
  402. package/dist/targets/droid-adapter.d.ts.map +1 -1
  403. package/dist/targets/droid-adapter.js +12 -12
  404. package/dist/targets/droid-adapter.js.map +1 -1
  405. package/dist/ui/assets/{Trans-BXjW_Rw3.js → Trans-BwpUiqvP.js} +1 -1
  406. package/dist/ui/assets/{accounts-C7JMc-UL.js → accounts-CDeA-kae.js} +1 -1
  407. package/dist/ui/assets/{alert-dialog-BSSHnWG_.js → alert-dialog-BRkyiRHQ.js} +1 -1
  408. package/dist/ui/assets/{api-GzEZNvOJ.js → api-BRWfSjSD.js} +1 -1
  409. package/dist/ui/assets/{auth-section-B6k7LWIq.js → auth-section-Dld8SmBW.js} +1 -1
  410. package/dist/ui/assets/{backups-section-Cr3g01YN.js → backups-section-BjxUn_e_.js} +1 -1
  411. package/dist/ui/assets/{channels-CMyh1yhN.js → channels-DNygT5ch.js} +1 -1
  412. package/dist/ui/assets/{checkbox-BkqYXiER.js → checkbox-BJ0-bsxD.js} +1 -1
  413. package/dist/ui/assets/{claude-extension-BzYl3zcz.js → claude-extension-CC-wTNix.js} +1 -1
  414. package/dist/ui/assets/{cliproxy-DwzKzuZI.js → cliproxy-DetLHcry.js} +1 -1
  415. package/dist/ui/assets/{cliproxy-ai-providers-DL95SYNa.js → cliproxy-ai-providers-Bff5bWqv.js} +1 -1
  416. package/dist/ui/assets/{cliproxy-control-panel-Ba2Rgzdo.js → cliproxy-control-panel-Bn8hX4VV.js} +1 -1
  417. package/dist/ui/assets/{codex-ClTEGCnr.js → codex-CNpaciGy.js} +1 -1
  418. package/dist/ui/assets/{confirm-dialog-BPAO4ILr.js → confirm-dialog-COJMNkgP.js} +1 -1
  419. package/dist/ui/assets/{copilot-CymHD4gl.js → copilot-DEBijivg.js} +1 -1
  420. package/dist/ui/assets/{cursor-DAiPXs8h.js → cursor-C-dhAZ4z.js} +1 -1
  421. package/dist/ui/assets/{droid-CAhLWDOj.js → droid-BqDBIX3T.js} +1 -1
  422. package/dist/ui/assets/{globalenv-section-BK5x_uXG.js → globalenv-section-BgosEOku.js} +1 -1
  423. package/dist/ui/assets/{health-D_ErMvYv.js → health-7mnaGWzH.js} +1 -1
  424. package/dist/ui/assets/{index-BZMyk4bI.js → index-6pgCCA-E.js} +1 -1
  425. package/dist/ui/assets/{index-BcfwoMDm.js → index-8KxHfBTG.js} +36 -36
  426. package/dist/ui/assets/{index-BmbKPprT.js → index-C6UKtunR.js} +1 -1
  427. package/dist/ui/assets/{index-B4cUkPwc.js → index-fDjN779H.js} +1 -1
  428. package/dist/ui/assets/{index-CEjVNSjg.js → index-pqVnLYqm.js} +1 -1
  429. package/dist/ui/assets/{index-CFDjAXOB.js → index-qCqsxM4P.js} +1 -1
  430. package/dist/ui/assets/{index-DCC80SZ0.js → index-yHxwc_u3.js} +1 -1
  431. package/dist/ui/assets/{logs-DwhXr-9Y.js → logs-i-F9qaEH.js} +1 -1
  432. package/dist/ui/assets/{masked-input-DWJTe7jh.js → masked-input-D9UchwhD.js} +1 -1
  433. package/dist/ui/assets/{proxy-status-widget-CJXi8yui.js → proxy-status-widget-BaFIW7Op.js} +1 -1
  434. package/dist/ui/assets/{raw-json-settings-editor-panel-DWhAi0kI.js → raw-json-settings-editor-panel-sC8qxIaf.js} +1 -1
  435. package/dist/ui/assets/{searchable-select-CYC4Y8pS.js → searchable-select-C_x7EmF6.js} +1 -1
  436. package/dist/ui/assets/{separator-JhuNwVKE.js → separator-mNegtV2Z.js} +1 -1
  437. package/dist/ui/assets/{shared-Hpgs7l5G.js → shared-DpJUlkXs.js} +1 -1
  438. package/dist/ui/assets/{table-DDJTZfyL.js → table-CtEViMua.js} +1 -1
  439. package/dist/ui/assets/{updates-CtygOHUO.js → updates-RohG3ly8.js} +1 -1
  440. package/dist/ui/assets/{use-accounts-CaptC8AS.js → use-accounts-CVjvVzVy.js} +1 -1
  441. package/dist/ui/index.html +1 -1
  442. package/dist/utils/image-analysis/mcp-installer.d.ts.map +1 -1
  443. package/dist/utils/image-analysis/mcp-installer.js +16 -13
  444. package/dist/utils/image-analysis/mcp-installer.js.map +1 -1
  445. package/dist/utils/websearch/mcp-installer.d.ts.map +1 -1
  446. package/dist/utils/websearch/mcp-installer.js +14 -12
  447. package/dist/utils/websearch/mcp-installer.js.map +1 -1
  448. package/dist/web-server/middleware/request-logging-middleware.d.ts.map +1 -1
  449. package/dist/web-server/middleware/request-logging-middleware.js +14 -9
  450. package/dist/web-server/middleware/request-logging-middleware.js.map +1 -1
  451. package/dist/web-server/routes/bar-routes.d.ts.map +1 -1
  452. package/dist/web-server/routes/bar-routes.js +11 -2
  453. package/dist/web-server/routes/bar-routes.js.map +1 -1
  454. package/dist/web-server/routes/claude-extension-routes.d.ts.map +1 -1
  455. package/dist/web-server/routes/claude-extension-routes.js +3 -2
  456. package/dist/web-server/routes/claude-extension-routes.js.map +1 -1
  457. package/dist/web-server/routes/cliproxy-auth-routes.d.ts +1 -0
  458. package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +1 -1
  459. package/dist/web-server/routes/cliproxy-auth-routes.js +20 -5
  460. package/dist/web-server/routes/cliproxy-auth-routes.js.map +1 -1
  461. package/dist/web-server/routes/cliproxy-stats-routes/config-routes.d.ts +16 -0
  462. package/dist/web-server/routes/cliproxy-stats-routes/config-routes.d.ts.map +1 -0
  463. package/dist/web-server/routes/cliproxy-stats-routes/config-routes.js +219 -0
  464. package/dist/web-server/routes/cliproxy-stats-routes/config-routes.js.map +1 -0
  465. package/dist/web-server/routes/cliproxy-stats-routes/error-log-routes.d.ts +12 -0
  466. package/dist/web-server/routes/cliproxy-stats-routes/error-log-routes.d.ts.map +1 -0
  467. package/dist/web-server/routes/cliproxy-stats-routes/error-log-routes.js +153 -0
  468. package/dist/web-server/routes/cliproxy-stats-routes/error-log-routes.js.map +1 -0
  469. package/dist/web-server/routes/cliproxy-stats-routes/quota-helpers.d.ts +19 -0
  470. package/dist/web-server/routes/cliproxy-stats-routes/quota-helpers.d.ts.map +1 -0
  471. package/dist/web-server/routes/cliproxy-stats-routes/quota-helpers.js +38 -0
  472. package/dist/web-server/routes/cliproxy-stats-routes/quota-helpers.js.map +1 -0
  473. package/dist/web-server/routes/cliproxy-stats-routes/quota-routes.d.ts +13 -0
  474. package/dist/web-server/routes/cliproxy-stats-routes/quota-routes.d.ts.map +1 -0
  475. package/dist/web-server/routes/cliproxy-stats-routes/quota-routes.js +195 -0
  476. package/dist/web-server/routes/cliproxy-stats-routes/quota-routes.js.map +1 -0
  477. package/dist/web-server/routes/cliproxy-stats-routes/restart-route.d.ts +17 -0
  478. package/dist/web-server/routes/cliproxy-stats-routes/restart-route.d.ts.map +1 -0
  479. package/dist/web-server/routes/cliproxy-stats-routes/restart-route.js +34 -0
  480. package/dist/web-server/routes/cliproxy-stats-routes/restart-route.js.map +1 -0
  481. package/dist/web-server/routes/cliproxy-stats-routes/router.d.ts +10 -0
  482. package/dist/web-server/routes/cliproxy-stats-routes/router.d.ts.map +1 -0
  483. package/dist/web-server/routes/cliproxy-stats-routes/router.js +245 -0
  484. package/dist/web-server/routes/cliproxy-stats-routes/router.js.map +1 -0
  485. package/dist/web-server/routes/cliproxy-stats-routes/shared.d.ts +35 -0
  486. package/dist/web-server/routes/cliproxy-stats-routes/shared.d.ts.map +1 -0
  487. package/dist/web-server/routes/cliproxy-stats-routes/shared.js +59 -0
  488. package/dist/web-server/routes/cliproxy-stats-routes/shared.js.map +1 -0
  489. package/dist/web-server/routes/cliproxy-stats-routes/version-helpers.d.ts +44 -0
  490. package/dist/web-server/routes/cliproxy-stats-routes/version-helpers.d.ts.map +1 -0
  491. package/dist/web-server/routes/cliproxy-stats-routes/version-helpers.js +66 -0
  492. package/dist/web-server/routes/cliproxy-stats-routes/version-helpers.js.map +1 -0
  493. package/dist/web-server/routes/cliproxy-stats-routes.d.ts +16 -57
  494. package/dist/web-server/routes/cliproxy-stats-routes.d.ts.map +1 -1
  495. package/dist/web-server/routes/cliproxy-stats-routes.js +25 -926
  496. package/dist/web-server/routes/cliproxy-stats-routes.js.map +1 -1
  497. package/dist/web-server/routes/cliproxy-sync-routes.d.ts.map +1 -1
  498. package/dist/web-server/routes/cliproxy-sync-routes.js +9 -2
  499. package/dist/web-server/routes/cliproxy-sync-routes.js.map +1 -1
  500. package/dist/web-server/routes/copilot-settings-routes.d.ts.map +1 -1
  501. package/dist/web-server/routes/copilot-settings-routes.js +2 -1
  502. package/dist/web-server/routes/copilot-settings-routes.js.map +1 -1
  503. package/dist/web-server/routes/image-analysis-routes.d.ts.map +1 -1
  504. package/dist/web-server/routes/image-analysis-routes.js +2 -1
  505. package/dist/web-server/routes/image-analysis-routes.js.map +1 -1
  506. package/dist/web-server/routes/persist-routes.d.ts.map +1 -1
  507. package/dist/web-server/routes/persist-routes.js +8 -1
  508. package/dist/web-server/routes/persist-routes.js.map +1 -1
  509. package/dist/web-server/routes/proxy-routes.d.ts.map +1 -1
  510. package/dist/web-server/routes/proxy-routes.js +33 -5
  511. package/dist/web-server/routes/proxy-routes.js.map +1 -1
  512. package/dist/web-server/routes/route-helpers.d.ts.map +1 -1
  513. package/dist/web-server/routes/route-helpers.js +10 -6
  514. package/dist/web-server/routes/route-helpers.js.map +1 -1
  515. package/dist/web-server/routes/settings-routes.d.ts.map +1 -1
  516. package/dist/web-server/routes/settings-routes.js +7 -6
  517. package/dist/web-server/routes/settings-routes.js.map +1 -1
  518. package/dist/web-server/usage/aggregator.d.ts.map +1 -1
  519. package/dist/web-server/usage/aggregator.js +8 -8
  520. package/dist/web-server/usage/aggregator.js.map +1 -1
  521. package/dist/web-server/usage/handlers.d.ts.map +1 -1
  522. package/dist/web-server/usage/handlers.js +1 -1
  523. package/dist/web-server/usage/handlers.js.map +1 -1
  524. package/package.json +1 -1
  525. package/scripts/ci-parity-gate.sh +31 -0
  526. package/scripts/generate-throw-error-baseline.js +103 -0
  527. package/scripts/hardening-inventory.js +62 -4
  528. package/scripts/maintainability-metrics.js +356 -0
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ /**
3
+ * SharedManager - per-project memory directory synchronization.
4
+ *
5
+ * Extracted from project-context-sync.ts to keep each sync concern under
6
+ * the 400 LOC target. Owns the layout migration from per-instance
7
+ * projects/<project>/memory/ into the canonical shared memory root at
8
+ * ~/.ccs/shared/memory/<project>/.
9
+ */
10
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ var desc = Object.getOwnPropertyDescriptor(m, k);
13
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
14
+ desc = { enumerable: true, get: function() { return m[k]; } };
15
+ }
16
+ Object.defineProperty(o, k2, desc);
17
+ }) : (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ o[k2] = m[k];
20
+ }));
21
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
22
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
23
+ }) : function(o, v) {
24
+ o["default"] = v;
25
+ });
26
+ var __importStar = (this && this.__importStar) || function (mod) {
27
+ if (mod && mod.__esModule) return mod;
28
+ var result = {};
29
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
30
+ __setModuleDefault(result, mod);
31
+ return result;
32
+ };
33
+ Object.defineProperty(exports, "__esModule", { value: true });
34
+ exports.syncProjectMemories = void 0;
35
+ const fs = __importStar(require("fs"));
36
+ const path = __importStar(require("path"));
37
+ const ui_1 = require("../../utils/ui");
38
+ const fs_helpers_1 = require("./fs-helpers");
39
+ const symlink_helpers_1 = require("./symlink-helpers");
40
+ /**
41
+ * Ensure all project memory directories for an instance are shared.
42
+ *
43
+ * Source layout (isolated):
44
+ * ~/.ccs/instances/<profile>/projects/<project>/memory/
45
+ *
46
+ * Shared layout (canonical):
47
+ * ~/.ccs/shared/memory/<project>/
48
+ */
49
+ async function syncProjectMemories(roots, instancePath, deps) {
50
+ const projectsDir = path.join(instancePath, 'projects');
51
+ if (!(await (0, fs_helpers_1.pathExists)(projectsDir))) {
52
+ return;
53
+ }
54
+ await (0, fs_helpers_1.ensureDirectory)(roots.sharedDir);
55
+ const sharedMemoryRoot = path.join(roots.sharedDir, 'memory');
56
+ await (0, fs_helpers_1.ensureDirectory)(sharedMemoryRoot);
57
+ let projectEntries = [];
58
+ try {
59
+ projectEntries = await fs.promises.readdir(projectsDir, { withFileTypes: true });
60
+ }
61
+ catch (_err) {
62
+ return;
63
+ }
64
+ const projects = projectEntries.filter((entry) => entry.isDirectory());
65
+ if (projects.length === 0) {
66
+ return;
67
+ }
68
+ let migrated = 0;
69
+ let merged = 0;
70
+ let linked = 0;
71
+ const instanceName = path.basename(instancePath);
72
+ for (const project of projects) {
73
+ const projectDir = path.join(projectsDir, project.name);
74
+ const projectMemoryPath = path.join(projectDir, 'memory');
75
+ const sharedProjectMemoryPath = path.join(sharedMemoryRoot, project.name);
76
+ const projectMemoryStats = await (0, fs_helpers_1.getLstat)(projectMemoryPath);
77
+ if (!projectMemoryStats) {
78
+ if (await (0, symlink_helpers_1.ensureProjectMemoryLink)(projectMemoryPath, sharedProjectMemoryPath, deps)) {
79
+ linked++;
80
+ }
81
+ continue;
82
+ }
83
+ if (projectMemoryStats.isSymbolicLink()) {
84
+ if (await (0, symlink_helpers_1.isSymlinkTarget)(projectMemoryPath, sharedProjectMemoryPath)) {
85
+ continue;
86
+ }
87
+ await fs.promises.unlink(projectMemoryPath);
88
+ if (await (0, symlink_helpers_1.ensureProjectMemoryLink)(projectMemoryPath, sharedProjectMemoryPath, deps)) {
89
+ linked++;
90
+ }
91
+ continue;
92
+ }
93
+ if (!projectMemoryStats.isDirectory()) {
94
+ continue;
95
+ }
96
+ if (!(await (0, fs_helpers_1.pathExists)(sharedProjectMemoryPath))) {
97
+ await (0, fs_helpers_1.moveDirectory)(projectMemoryPath, sharedProjectMemoryPath);
98
+ migrated++;
99
+ }
100
+ else {
101
+ merged += await (0, symlink_helpers_1.mergeDirectoryWithConflictCopies)(projectMemoryPath, sharedProjectMemoryPath, instanceName);
102
+ await fs.promises.rm(projectMemoryPath, { recursive: true, force: true });
103
+ }
104
+ if (await (0, symlink_helpers_1.ensureProjectMemoryLink)(projectMemoryPath, sharedProjectMemoryPath, deps)) {
105
+ linked++;
106
+ }
107
+ }
108
+ if (migrated > 0 || merged > 0 || linked > 0) {
109
+ console.log((0, ui_1.ok)(`Synced shared project memory: ${migrated} migrated, ${merged} merged conflict(s), ${linked} linked`));
110
+ }
111
+ }
112
+ exports.syncProjectMemories = syncProjectMemories;
113
+ //# sourceMappingURL=project-memory-sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-memory-sync.js","sourceRoot":"","sources":["../../../src/management/shared-manager/project-memory-sync.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAE7B,uCAAoC;AACpC,6CAAoF;AACpF,uDAK2B;AAG3B;;;;;;;;GAQG;AACI,KAAK,UAAU,mBAAmB,CACvC,KAAuB,EACvB,YAAoB,EACpB,IAAuB;IAEvB,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACxD,IAAI,CAAC,CAAC,MAAM,IAAA,uBAAU,EAAC,WAAW,CAAC,CAAC,EAAE,CAAC;QACrC,OAAO;IACT,CAAC;IAED,MAAM,IAAA,4BAAe,EAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAEvC,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC9D,MAAM,IAAA,4BAAe,EAAC,gBAAgB,CAAC,CAAC;IAExC,IAAI,cAAc,GAAgB,EAAE,CAAC;IACrC,IAAI,CAAC;QACH,cAAc,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IACnF,CAAC;IAAC,OAAO,IAAI,EAAE,CAAC;QACd,OAAO;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AE,uBAAuB,EAAE,IAAI,CAAC,EAAE,CAAC;gBACpF,MAAM,EAAE,CAAC;YACX,CAAC;YACD,SAAS;QACX,CAAC;QAED,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,EAAE,CAAC;YACtC,SAAS;QACX,CAAC;QAED,IAAI,CAAC,CAAC,MAAM,IAAA,uBAAU,EAAC,uBAAuB,CAAC,CAAC,EAAE,CAAC;YACjD,MAAM,IAAA,0BAAa,EAAC,iBAAiB,EAAE,uBAAuB,CAAC,CAAC;YAChE,QAAQ,EAAE,CAAC;QACb,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,MAAM,IAAA,kDAAgC,EAC9C,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,CACb,CAAC;YACF,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,iBAAiB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5E,CAAC;QAED,IAAI,MAAM,IAAA,yCAAuB,EAAC,iBAAiB,EAAE,uBAAuB,EAAE,IAAI,CAAC,EAAE,CAAC;YACpF,MAAM,EAAE,CAAC;QACX,CAAC;IACH,CAAC;IAED,IAAI,QAAQ,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7C,OAAO,CAAC,GAAG,CACT,IAAA,OAAE,EACA,iCAAiC,QAAQ,cAAc,MAAM,wBAAwB,MAAM,SAAS,CACrG,CACF,CAAC;IACJ,CAAC;AACH,CAAC;AArFD,kDAqFC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * SharedManager - shared directory linking entrypoints.
3
+ *
4
+ * Extracted from the original monolithic shared-manager.ts. Owns the
5
+ * creation of the ~/.ccs/shared/* symlinks pointing at ~/.claude/* and
6
+ * the per-instance links for commands/skills/agents/plugins/settings.
7
+ *
8
+ * Plugin-layout internals (the four functions that operate on the plugins/
9
+ * subtree) live in plugin-layout-internals.ts. This file keeps only the
10
+ * high-level entrypoints and circular-symlink detection so each file stays
11
+ * focused and under the 400 LOC target.
12
+ *
13
+ * These functions take an explicit roots object so they remain decoupled
14
+ * from SharedManager instance state.
15
+ */
16
+ import type { PluginMetadataRoots } from './plugin-metadata-normalizer';
17
+ /**
18
+ * Roots for the shared-dir linker. Reuses PluginMetadataRoots because the
19
+ * linker operates on the same three roots.
20
+ */
21
+ export type LinkerRoots = PluginMetadataRoots;
22
+ /**
23
+ * Detect a circular symlink before creation. A symlink is circular when its
24
+ * target (raw or canonical) points back inside the shared root.
25
+ */
26
+ export declare function detectCircularSymlink(target: string, sharedDir: string): boolean;
27
+ /**
28
+ * Ensure shared directories exist as symlinks to ~/.claude/ and that the
29
+ * plugin layout default directories and registry files are present.
30
+ */
31
+ export declare function ensureSharedDirectories(roots: LinkerRoots): void;
32
+ /**
33
+ * Link shared directories into a specific instance path.
34
+ */
35
+ export declare function linkSharedDirectories(roots: LinkerRoots, instancePath: string): void;
36
+ /**
37
+ * Detach shared-directory symlinks from an instance, removing only entries
38
+ * that point back at the shared root.
39
+ */
40
+ export declare function detachSharedDirectories(roots: LinkerRoots, instancePath: string): void;
41
+ //# sourceMappingURL=shared-dir-linker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-dir-linker.d.ts","sourceRoot":"","sources":["../../../src/management/shared-manager/shared-dir-linker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAcH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAYxE;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,mBAAmB,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAsChF;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAuEhE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAwCpF;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAyBtF"}
@@ -0,0 +1,227 @@
1
+ "use strict";
2
+ /**
3
+ * SharedManager - shared directory linking entrypoints.
4
+ *
5
+ * Extracted from the original monolithic shared-manager.ts. Owns the
6
+ * creation of the ~/.ccs/shared/* symlinks pointing at ~/.claude/* and
7
+ * the per-instance links for commands/skills/agents/plugins/settings.
8
+ *
9
+ * Plugin-layout internals (the four functions that operate on the plugins/
10
+ * subtree) live in plugin-layout-internals.ts. This file keeps only the
11
+ * high-level entrypoints and circular-symlink detection so each file stays
12
+ * focused and under the 400 LOC target.
13
+ *
14
+ * These functions take an explicit roots object so they remain decoupled
15
+ * from SharedManager instance state.
16
+ */
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
+ desc = { enumerable: true, get: function() { return m[k]; } };
22
+ }
23
+ Object.defineProperty(o, k2, desc);
24
+ }) : (function(o, m, k, k2) {
25
+ if (k2 === undefined) k2 = k;
26
+ o[k2] = m[k];
27
+ }));
28
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
29
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
30
+ }) : function(o, v) {
31
+ o["default"] = v;
32
+ });
33
+ var __importStar = (this && this.__importStar) || function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ Object.defineProperty(exports, "__esModule", { value: true });
41
+ exports.detachSharedDirectories = exports.linkSharedDirectories = exports.ensureSharedDirectories = exports.detectCircularSymlink = void 0;
42
+ const fs = __importStar(require("fs"));
43
+ const path = __importStar(require("path"));
44
+ const ui_1 = require("../../utils/ui");
45
+ const fs_helpers_1 = require("./fs-helpers");
46
+ const plugin_metadata_normalizer_1 = require("./plugin-metadata-normalizer");
47
+ const plugin_layout_internals_1 = require("./plugin-layout-internals");
48
+ const types_1 = require("./types");
49
+ /**
50
+ * Detect a circular symlink before creation. A symlink is circular when its
51
+ * target (raw or canonical) points back inside the shared root.
52
+ */
53
+ function detectCircularSymlink(target, sharedDir) {
54
+ try {
55
+ const stats = fs.lstatSync(target);
56
+ if (!stats.isSymbolicLink()) {
57
+ return false;
58
+ }
59
+ const targetLink = fs.readlinkSync(target);
60
+ const resolvedTarget = path.resolve(path.dirname(target), targetLink);
61
+ const sharedDirPath = path.resolve(sharedDir);
62
+ // A raw target path pointing back into ~/.ccs/shared is already unsafe.
63
+ // Re-pointing ~/.ccs/shared/* to ~/.claude/* would turn it into a real
64
+ // loop, even if the current ~/.ccs/shared entry ultimately resolves to
65
+ // an external path.
66
+ if ((0, fs_helpers_1.isPathWithinDirectory)(resolvedTarget, sharedDirPath)) {
67
+ console.log((0, ui_1.warn)(`Circular symlink detected: ${target} → ${resolvedTarget}`));
68
+ return true;
69
+ }
70
+ // Only treat targets inside the managed shared root as circular.
71
+ // Existing shared symlinks may already resolve through ~/.claude/ to an
72
+ // external repo, which is a supported upgrade path rather than a loop.
73
+ const sharedDirCanonical = (0, fs_helpers_1.resolveCanonicalPath)(sharedDirPath);
74
+ const canonicalResolvedTarget = (0, fs_helpers_1.resolveCanonicalPath)(resolvedTarget);
75
+ if ((0, fs_helpers_1.isPathWithinDirectory)(canonicalResolvedTarget, sharedDirCanonical)) {
76
+ console.log((0, ui_1.warn)(`Circular symlink detected: ${target} → ${resolvedTarget}`));
77
+ return true;
78
+ }
79
+ }
80
+ catch (err) {
81
+ if (err.code === 'ENOENT') {
82
+ return false;
83
+ }
84
+ throw err;
85
+ }
86
+ return false;
87
+ }
88
+ exports.detectCircularSymlink = detectCircularSymlink;
89
+ /**
90
+ * Ensure shared directories exist as symlinks to ~/.claude/ and that the
91
+ * plugin layout default directories and registry files are present.
92
+ */
93
+ function ensureSharedDirectories(roots) {
94
+ const claudeDir = roots.claudeDir;
95
+ const sharedDir = roots.sharedDir;
96
+ if (!(0, fs_helpers_1.getLstatSync)(claudeDir)) {
97
+ console.log((0, ui_1.info)('Creating ~/.claude/ directory structure'));
98
+ fs.mkdirSync(claudeDir, { recursive: true, mode: 0o700 });
99
+ }
100
+ if (!(0, fs_helpers_1.getLstatSync)(sharedDir)) {
101
+ fs.mkdirSync(sharedDir, { recursive: true, mode: 0o700 });
102
+ }
103
+ (0, plugin_layout_internals_1.ensureSharedPluginLayoutDefaults)(claudeDir);
104
+ for (const item of types_1.SHARED_ITEMS) {
105
+ const claudePath = path.join(claudeDir, item.name);
106
+ const sharedPath = path.join(sharedDir, item.name);
107
+ if (!(0, fs_helpers_1.getLstatSync)(claudePath)) {
108
+ if (item.type === 'directory') {
109
+ fs.mkdirSync(claudePath, { recursive: true, mode: 0o700 });
110
+ }
111
+ else if (item.type === 'file') {
112
+ fs.writeFileSync(claudePath, JSON.stringify({}, null, 2), 'utf8');
113
+ }
114
+ }
115
+ if (detectCircularSymlink(claudePath, sharedDir)) {
116
+ console.log((0, ui_1.warn)(`Skipping ${item.name}: circular symlink detected`));
117
+ continue;
118
+ }
119
+ if ((0, fs_helpers_1.getLstatSync)(sharedPath)) {
120
+ try {
121
+ const stats = fs.lstatSync(sharedPath);
122
+ if (stats.isSymbolicLink()) {
123
+ const currentTarget = fs.readlinkSync(sharedPath);
124
+ const resolvedTarget = path.resolve(path.dirname(sharedPath), currentTarget);
125
+ if (resolvedTarget === claudePath) {
126
+ continue;
127
+ }
128
+ }
129
+ }
130
+ catch (_err) {
131
+ // Continue to recreate
132
+ }
133
+ if (item.type === 'directory') {
134
+ fs.rmSync(sharedPath, { recursive: true, force: true });
135
+ }
136
+ else {
137
+ fs.unlinkSync(sharedPath);
138
+ }
139
+ }
140
+ try {
141
+ const symlinkType = item.type === 'directory' ? 'dir' : 'file';
142
+ fs.symlinkSync(claudePath, sharedPath, symlinkType);
143
+ }
144
+ catch (_err) {
145
+ if (process.platform === 'win32') {
146
+ if (item.type === 'directory') {
147
+ (0, fs_helpers_1.copyDirectoryFallback)(claudePath, sharedPath);
148
+ }
149
+ else if (item.type === 'file') {
150
+ fs.copyFileSync(claudePath, sharedPath);
151
+ }
152
+ console.log((0, ui_1.warn)(`Symlink failed for ${item.name}, copied instead (enable Developer Mode)`));
153
+ }
154
+ else {
155
+ throw _err;
156
+ }
157
+ }
158
+ }
159
+ }
160
+ exports.ensureSharedDirectories = ensureSharedDirectories;
161
+ /**
162
+ * Link shared directories into a specific instance path.
163
+ */
164
+ function linkSharedDirectories(roots, instancePath) {
165
+ ensureSharedDirectories(roots);
166
+ const sharedDir = roots.sharedDir;
167
+ for (const item of types_1.SHARED_ITEMS) {
168
+ if (item.name === 'plugins') {
169
+ (0, plugin_layout_internals_1.linkInstancePlugins)(roots, instancePath);
170
+ continue;
171
+ }
172
+ const linkPath = path.join(instancePath, item.name);
173
+ const targetPath = path.join(sharedDir, item.name);
174
+ (0, fs_helpers_1.removeExistingPath)(linkPath, item.type);
175
+ try {
176
+ const symlinkType = item.type === 'directory' ? 'dir' : 'file';
177
+ fs.symlinkSync(targetPath, linkPath, symlinkType);
178
+ }
179
+ catch (_err) {
180
+ if (process.platform === 'win32') {
181
+ if (item.type === 'directory') {
182
+ (0, fs_helpers_1.copyDirectoryFallback)(targetPath, linkPath);
183
+ }
184
+ else if (item.type === 'file') {
185
+ fs.copyFileSync(targetPath, linkPath);
186
+ }
187
+ console.log((0, ui_1.warn)(`Symlink failed for ${item.name}, copied instead (enable Developer Mode)`));
188
+ }
189
+ else {
190
+ throw _err;
191
+ }
192
+ }
193
+ }
194
+ // Preserve original behavior: linkSharedDirectories always concludes by
195
+ // normalizing plugin + marketplace metadata for the freshly linked
196
+ // instance. migrateFromV311 relies on this side effect.
197
+ (0, plugin_metadata_normalizer_1.normalizePluginRegistryPaths)(roots, instancePath);
198
+ (0, plugin_metadata_normalizer_1.normalizeMarketplaceRegistryPaths)(roots, instancePath);
199
+ }
200
+ exports.linkSharedDirectories = linkSharedDirectories;
201
+ /**
202
+ * Detach shared-directory symlinks from an instance, removing only entries
203
+ * that point back at the shared root.
204
+ */
205
+ function detachSharedDirectories(roots, instancePath) {
206
+ ensureSharedDirectories(roots);
207
+ const sharedDir = roots.sharedDir;
208
+ for (const item of types_1.SHARED_ITEMS) {
209
+ const managedPath = path.join(instancePath, item.name);
210
+ if (!fs.existsSync(managedPath)) {
211
+ continue;
212
+ }
213
+ if (item.name === 'plugins') {
214
+ (0, plugin_layout_internals_1.detachManagedPluginLayout)(roots, instancePath);
215
+ continue;
216
+ }
217
+ const stats = fs.lstatSync(managedPath);
218
+ if (!stats.isSymbolicLink()) {
219
+ continue;
220
+ }
221
+ if ((0, fs_helpers_1.symlinkPointsTo)(managedPath, path.join(sharedDir, item.name))) {
222
+ (0, fs_helpers_1.removeExistingPath)(managedPath, item.type);
223
+ }
224
+ }
225
+ }
226
+ exports.detachSharedDirectories = detachSharedDirectories;
227
+ //# sourceMappingURL=shared-dir-linker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-dir-linker.js","sourceRoot":"","sources":["../../../src/management/shared-manager/shared-dir-linker.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAE7B,uCAA4C;AAC5C,6CAOsB;AAEtB,6EAGsC;AACtC,uEAImC;AACnC,mCAAuC;AAQvC;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,MAAc,EAAE,SAAiB;IACrE,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,EAAE,CAAC,SAA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K,SAAS,EAAE,CAAC;YAC5B,IAAA,mDAAyB,EAAC,KAAK,EAAE,YAAY,CAAC,CAAC;YAC/C,SAAS;QACX,CAAC;QAED,MAAM,KAAK,GAAG,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,EAAE,CAAC;YAC5B,SAAS;QACX,CAAC;QAED,IAAI,IAAA,4BAAe,EAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;YAClE,IAAA,+BAAkB,EAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;AACH,CAAC;AAzBD,0DAyBC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * SharedManager - async symlink and merge helpers.
3
+ *
4
+ * Extracted from the original monolithic shared-manager.ts. These functions
5
+ * handle the cross-platform symlink + recursive merge primitives that the
6
+ * project-context-sync and project-memory flows build on.
7
+ *
8
+ * Logging is dependency-injected via the SymlinkHelperDeps interface so this
9
+ * module stays free of imports from the UI layer. The orchestrator class is
10
+ * responsible for supplying `warn` from `../utils/ui`.
11
+ */
12
+ /**
13
+ * Dependencies that the orchestrator (SharedManager) must supply to the
14
+ * symlink helpers. Injected rather than imported so this module has no
15
+ * coupling to the UI layer.
16
+ */
17
+ export interface SymlinkHelperDeps {
18
+ warn: (message: string) => string;
19
+ }
20
+ /**
21
+ * Check whether a symlink points at an expected target. Returns false on any
22
+ * IO error or when the link is not a symlink.
23
+ */
24
+ export declare function isSymlinkTarget(linkPath: string, expectedTarget: string): Promise<boolean>;
25
+ /**
26
+ * Resolve a symlink to its absolute target path. Returns null on failure.
27
+ */
28
+ export declare function resolveSymlinkTargetPath(linkPath: string): Promise<string | null>;
29
+ /**
30
+ * Create a symlink from linkPath to targetPath, falling back to a recursive
31
+ * copy on Windows when symlink creation fails.
32
+ */
33
+ export declare function linkDirectoryWithFallback(targetPath: string, linkPath: string, deps: SymlinkHelperDeps): Promise<void>;
34
+ /**
35
+ * Ensure a symlink from linkPath to targetPath exists, creating the target
36
+ * directory first if needed. Returns true when a new link/copy was created
37
+ * or an existing incorrect link was replaced.
38
+ */
39
+ export declare function ensureProjectMemoryLink(linkPath: string, targetPath: string, deps: SymlinkHelperDeps): Promise<boolean>;
40
+ /**
41
+ * Merge sourceDir into targetDir recursively. On file conflicts the target
42
+ * is preserved and the source file is copied as
43
+ * "<name>.migrated-from-<instance>[-N]" to avoid data loss. Returns the
44
+ * number of conflict copies produced.
45
+ */
46
+ export declare function mergeDirectoryWithConflictCopies(sourceDir: string, targetDir: string, instanceName: string): Promise<number>;
47
+ /**
48
+ * Migrate legacy per-project memory symlinks that point into the shared
49
+ * memory root back to instance-local directories, preserving data via
50
+ * conflict-copy merge.
51
+ */
52
+ export declare function detachLegacySharedMemoryLinks(projectsPath: string, instanceName: string, sharedDir: string): Promise<void>;
53
+ /**
54
+ * Guard project merge operations to known CCS-managed roots only.
55
+ */
56
+ export declare function isSafeProjectsMergeSource(sourcePath: string, instanceName: string, sharedDir: string, instancesDir: string): boolean;
57
+ /**
58
+ * Guard advanced continuity merge operations to known CCS-managed roots only.
59
+ */
60
+ export declare function isSafeContinuityMergeSource(sourcePath: string, instanceName: string, artifactName: string, sharedDir: string, instancesDir: string): boolean;
61
+ //# sourceMappingURL=symlink-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"symlink-helpers.d.ts","sourceRoot":"","sources":["../../../src/management/shared-manager/symlink-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAeH;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;CACnC;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO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