aws-runtime-bridge 1.9.78 → 1.9.80

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 (596) hide show
  1. package/dist/adapter/AcodeSdkAdapter.d.ts +0 -1
  2. package/dist/adapter/AcodeSdkAdapter.js +11 -1986
  3. package/dist/adapter/AdapterRegistry.d.ts +0 -1
  4. package/dist/adapter/AdapterRegistry.js +2 -100
  5. package/dist/adapter/ClaudeSdkAdapter.d.ts +0 -1
  6. package/dist/adapter/ClaudeSdkAdapter.js +4 -1300
  7. package/dist/adapter/CodexSdkAdapter.d.ts +0 -1
  8. package/dist/adapter/CodexSdkAdapter.js +4 -836
  9. package/dist/adapter/OpencodeSdkAdapter.d.ts +0 -1
  10. package/dist/adapter/OpencodeSdkAdapter.js +4 -879
  11. package/dist/adapter/SdkProviderSpi.d.ts +0 -1
  12. package/dist/adapter/SdkProviderSpi.js +2 -55
  13. package/dist/adapter/acode-tool-names.d.ts +0 -1
  14. package/dist/adapter/acode-tool-names.js +2 -37
  15. package/dist/adapter/idle-poll-loop.d.ts +0 -1
  16. package/dist/adapter/idle-poll-loop.js +2 -59
  17. package/dist/adapter/index.d.ts +0 -1
  18. package/dist/adapter/index.js +2 -11
  19. package/dist/adapter/instance-ai-config-resolver.d.ts +0 -1
  20. package/dist/adapter/instance-ai-config-resolver.js +2 -46
  21. package/dist/adapter/types.d.ts +0 -1
  22. package/dist/adapter/types.js +2 -443
  23. package/dist/adapters/cc-switch/common.d.ts +0 -1
  24. package/dist/adapters/cc-switch/common.js +2 -61
  25. package/dist/adapters/cc-switch/index.d.ts +0 -1
  26. package/dist/adapters/cc-switch/index.js +2 -57
  27. package/dist/adapters/cc-switch/mcp-acode.d.ts +0 -1
  28. package/dist/adapters/cc-switch/mcp-acode.js +2 -71
  29. package/dist/adapters/cc-switch/mcp-claude.d.ts +0 -1
  30. package/dist/adapters/cc-switch/mcp-claude.js +2 -89
  31. package/dist/adapters/cc-switch/mcp-claudecode.d.ts +0 -1
  32. package/dist/adapters/cc-switch/mcp-claudecode.js +2 -77
  33. package/dist/adapters/cc-switch/mcp-codex.d.ts +0 -1
  34. package/dist/adapters/cc-switch/mcp-codex.js +11 -249
  35. package/dist/adapters/cc-switch/mcp-opencode.d.ts +0 -1
  36. package/dist/adapters/cc-switch/mcp-opencode.js +2 -97
  37. package/dist/adapters/cc-switch/mcp-placeholder.d.ts +0 -1
  38. package/dist/adapters/cc-switch/mcp-placeholder.js +2 -19
  39. package/dist/adapters/cc-switch/skill-acode.d.ts +0 -1
  40. package/dist/adapters/cc-switch/skill-acode.js +2 -12
  41. package/dist/adapters/cc-switch/skill-claude.d.ts +0 -1
  42. package/dist/adapters/cc-switch/skill-claude.js +2 -11
  43. package/dist/adapters/cc-switch/skill-claudecode.d.ts +0 -1
  44. package/dist/adapters/cc-switch/skill-claudecode.js +2 -11
  45. package/dist/adapters/cc-switch/skill-codex.d.ts +0 -1
  46. package/dist/adapters/cc-switch/skill-codex.js +2 -6
  47. package/dist/adapters/cc-switch/skill-directory.d.ts +0 -1
  48. package/dist/adapters/cc-switch/skill-directory.js +3 -137
  49. package/dist/adapters/cc-switch/skill-opencode.d.ts +0 -1
  50. package/dist/adapters/cc-switch/skill-opencode.js +2 -11
  51. package/dist/adapters/cc-switch/skill-placeholder.d.ts +0 -1
  52. package/dist/adapters/cc-switch/skill-placeholder.js +2 -19
  53. package/dist/config.d.ts +0 -1
  54. package/dist/config.js +2 -290
  55. package/dist/index.d.ts +0 -1
  56. package/dist/index.js +2 -573
  57. package/dist/middleware/auth.d.ts +0 -1
  58. package/dist/middleware/auth.js +2 -98
  59. package/dist/routes/acode-todos.d.ts +0 -1
  60. package/dist/routes/acode-todos.js +2 -75
  61. package/dist/routes/ai-sources.d.ts +0 -1
  62. package/dist/routes/ai-sources.js +2 -132
  63. package/dist/routes/dashboard.d.ts +0 -1
  64. package/dist/routes/dashboard.js +182 -649
  65. package/dist/routes/events.d.ts +0 -1
  66. package/dist/routes/events.js +2 -22
  67. package/dist/routes/file-browser.d.ts +0 -1
  68. package/dist/routes/file-browser.js +2 -781
  69. package/dist/routes/file-diff-rollback.d.ts +0 -1
  70. package/dist/routes/file-diff-rollback.js +2 -301
  71. package/dist/routes/file-snapshot.d.ts +0 -1
  72. package/dist/routes/file-snapshot.js +2 -156
  73. package/dist/routes/git.d.ts +0 -1
  74. package/dist/routes/git.js +28 -1900
  75. package/dist/routes/instance.d.ts +0 -1
  76. package/dist/routes/instance.js +3 -748
  77. package/dist/routes/mcp.d.ts +0 -1
  78. package/dist/routes/mcp.js +2 -196
  79. package/dist/routes/processes.d.ts +0 -1
  80. package/dist/routes/processes.js +2 -252
  81. package/dist/routes/properties.d.ts +0 -1
  82. package/dist/routes/properties.js +2 -72
  83. package/dist/routes/pty.d.ts +0 -1
  84. package/dist/routes/pty.js +6 -560
  85. package/dist/routes/runtime-binding.d.ts +0 -1
  86. package/dist/routes/runtime-binding.js +2 -263
  87. package/dist/routes/sessions.d.ts +0 -1
  88. package/dist/routes/sessions.js +2 -758
  89. package/dist/routes/skills.d.ts +0 -1
  90. package/dist/routes/skills.js +2 -187
  91. package/dist/routes/sub-agents.d.ts +0 -1
  92. package/dist/routes/sub-agents.js +20 -279
  93. package/dist/routes/system-metrics.d.ts +0 -1
  94. package/dist/routes/system-metrics.js +2 -20
  95. package/dist/routes/task-context.d.ts +0 -1
  96. package/dist/routes/task-context.js +2 -78
  97. package/dist/routes/terminal.d.ts +0 -1
  98. package/dist/routes/terminal.js +54 -2882
  99. package/dist/routes/yml.d.ts +0 -1
  100. package/dist/routes/yml.js +2 -223
  101. package/dist/services/acode-package.d.ts +0 -1
  102. package/dist/services/acode-package.js +2 -111
  103. package/dist/services/agent-event-store.d.ts +0 -1
  104. package/dist/services/agent-event-store.js +2 -81
  105. package/dist/services/agent-process-manager.d.ts +0 -1
  106. package/dist/services/agent-process-manager.js +2 -796
  107. package/dist/services/ai-source-apply.d.ts +0 -1
  108. package/dist/services/ai-source-apply.js +2 -83
  109. package/dist/services/auto-register.d.ts +0 -1
  110. package/dist/services/auto-register.js +2 -1053
  111. package/dist/services/aws-client-agent-mcp.d.ts +0 -1
  112. package/dist/services/aws-client-agent-mcp.js +3 -337
  113. package/dist/services/bridge-package-publish-hooks.d.ts +0 -1
  114. package/dist/services/bridge-package-publish-hooks.js +2 -115
  115. package/dist/services/cc-switch-sdk.d.ts +0 -1
  116. package/dist/services/cc-switch-sdk.js +2 -135
  117. package/dist/services/cli-commands.d.ts +6 -1
  118. package/dist/services/cli-commands.js +6 -645
  119. package/dist/services/event-delta-pusher.d.ts +0 -1
  120. package/dist/services/event-delta-pusher.js +2 -95
  121. package/dist/services/fileSnapshotStore.d.ts +0 -1
  122. package/dist/services/fileSnapshotStore.js +2 -500
  123. package/dist/services/instance-ai-config-service.d.ts +0 -1
  124. package/dist/services/instance-ai-config-service.js +2 -174
  125. package/dist/services/instance-init-service.d.ts +0 -1
  126. package/dist/services/instance-init-service.js +2 -193
  127. package/dist/services/instance-service.d.ts +0 -1
  128. package/dist/services/instance-service.js +2 -237
  129. package/dist/services/instance-state.d.ts +0 -1
  130. package/dist/services/instance-state.js +2 -94
  131. package/dist/services/legacy-path-migration.d.ts +0 -1
  132. package/dist/services/legacy-path-migration.js +2 -66
  133. package/dist/services/lifecycle-state.d.ts +0 -1
  134. package/dist/services/lifecycle-state.js +3 -110
  135. package/dist/services/mcp-launch-binding-queue.d.ts +0 -1
  136. package/dist/services/mcp-launch-binding-queue.js +2 -175
  137. package/dist/services/orphan-monitor.d.ts +0 -1
  138. package/dist/services/orphan-monitor.js +2 -382
  139. package/dist/services/panel-auth.d.ts +0 -1
  140. package/dist/services/panel-auth.js +2 -168
  141. package/dist/services/process-detector.d.ts +0 -1
  142. package/dist/services/process-detector.js +18 -1019
  143. package/dist/services/process-registry.d.ts +0 -1
  144. package/dist/services/process-registry.js +2 -375
  145. package/dist/services/ring-buffer.d.ts +0 -1
  146. package/dist/services/ring-buffer.js +2 -103
  147. package/dist/services/runtime-binding.d.ts +0 -1
  148. package/dist/services/runtime-binding.js +6 -363
  149. package/dist/services/runtime-lifecycle-policy.d.ts +0 -1
  150. package/dist/services/runtime-lifecycle-policy.js +2 -35
  151. package/dist/services/session-output.d.ts +0 -1
  152. package/dist/services/session-output.js +5 -539
  153. package/dist/services/startup-config-wizard.d.ts +0 -1
  154. package/dist/services/startup-config-wizard.js +14 -258
  155. package/dist/services/sub-agent-manager-instance.d.ts +0 -1
  156. package/dist/services/sub-agent-manager-instance.js +2 -12
  157. package/dist/services/system-metrics.d.ts +0 -1
  158. package/dist/services/system-metrics.js +2 -252
  159. package/dist/services/terminal-persistence.d.ts +0 -1
  160. package/dist/services/terminal-persistence.js +2 -176
  161. package/dist/services/tool-installer.d.ts +0 -1
  162. package/dist/services/tool-installer.js +5 -751
  163. package/dist/services/tunnel-client.d.ts +0 -1
  164. package/dist/services/tunnel-client.js +2 -402
  165. package/dist/services/windows-service-manager.d.ts +3 -2
  166. package/dist/services/windows-service-manager.js +2 -54
  167. package/dist/services/workspace-files.d.ts +0 -1
  168. package/dist/services/workspace-files.js +2 -1275
  169. package/dist/services/workspace-watch.d.ts +0 -1
  170. package/dist/services/workspace-watch.js +2 -123
  171. package/dist/services/workspaceTaskChangeWatcher.d.ts +0 -1
  172. package/dist/services/workspaceTaskChangeWatcher.js +2 -483
  173. package/dist/types.d.ts +0 -1
  174. package/dist/types.js +1 -1
  175. package/dist/utils/file-utils.d.ts +0 -1
  176. package/dist/utils/file-utils.js +3 -208
  177. package/dist/utils/instance-ai-config-debug-logger.d.ts +0 -1
  178. package/dist/utils/instance-ai-config-debug-logger.js +4 -63
  179. package/dist/utils/logger.d.ts +0 -1
  180. package/dist/utils/logger.js +2 -154
  181. package/dist/utils/mcp-utils.d.ts +0 -1
  182. package/dist/utils/mcp-utils.js +2 -187
  183. package/dist/utils/path-utils.d.ts +0 -1
  184. package/dist/utils/path-utils.js +2 -44
  185. package/dist/utils/sdk-package-loader.d.ts +0 -1
  186. package/dist/utils/sdk-package-loader.js +2 -78
  187. package/dist/utils/validation.d.ts +0 -1
  188. package/dist/utils/validation.js +2 -53
  189. package/dist/utils/yaml-utils.d.ts +0 -1
  190. package/dist/utils/yaml-utils.js +2 -312
  191. package/node_modules/@cc-switch/sdk/dist/constants.d.ts +0 -1
  192. package/node_modules/@cc-switch/sdk/dist/constants.js +2 -63
  193. package/node_modules/@cc-switch/sdk/dist/errors.d.ts +0 -1
  194. package/node_modules/@cc-switch/sdk/dist/errors.js +2 -8
  195. package/node_modules/@cc-switch/sdk/dist/index.d.ts +0 -1
  196. package/node_modules/@cc-switch/sdk/dist/index.js +2 -9
  197. package/node_modules/@cc-switch/sdk/dist/schemas.d.ts +0 -1
  198. package/node_modules/@cc-switch/sdk/dist/schemas.js +2 -38
  199. package/node_modules/@cc-switch/sdk/dist/sdk.d.ts +0 -1
  200. package/node_modules/@cc-switch/sdk/dist/sdk.js +2 -470
  201. package/node_modules/@cc-switch/sdk/dist/services/ai-config-service.d.ts +0 -1
  202. package/node_modules/@cc-switch/sdk/dist/services/ai-config-service.js +4 -307
  203. package/node_modules/@cc-switch/sdk/dist/services/mcp-model.d.ts +0 -1
  204. package/node_modules/@cc-switch/sdk/dist/services/mcp-model.js +2 -37
  205. package/node_modules/@cc-switch/sdk/dist/services/mcp-service.d.ts +0 -1
  206. package/node_modules/@cc-switch/sdk/dist/services/mcp-service.js +2 -9
  207. package/node_modules/@cc-switch/sdk/dist/services/skill-model.d.ts +0 -1
  208. package/node_modules/@cc-switch/sdk/dist/services/skill-model.js +2 -41
  209. package/node_modules/@cc-switch/sdk/dist/services/skill-service.d.ts +0 -1
  210. package/node_modules/@cc-switch/sdk/dist/services/skill-service.js +2 -9
  211. package/node_modules/@cc-switch/sdk/dist/state.d.ts +0 -1
  212. package/node_modules/@cc-switch/sdk/dist/state.js +2 -19
  213. package/node_modules/@cc-switch/sdk/dist/types.d.ts +0 -1
  214. package/node_modules/@cc-switch/sdk/dist/types.js +1 -1
  215. package/node_modules/@cc-switch/sdk/dist/utils/fs.d.ts +0 -1
  216. package/node_modules/@cc-switch/sdk/dist/utils/fs.js +3 -114
  217. package/node_modules/@cc-switch/sdk/dist/utils/id.d.ts +0 -1
  218. package/node_modules/@cc-switch/sdk/dist/utils/id.js +2 -12
  219. package/node_modules/@cc-switch/sdk/package.json +1 -1
  220. package/package/acode/dist/ask-user-question-tool.d.ts +0 -1
  221. package/package/acode/dist/ask-user-question-tool.js +4 -233
  222. package/package/acode/dist/built-in-file-tools.d.ts +0 -1
  223. package/package/acode/dist/built-in-file-tools.js +4 -966
  224. package/package/acode/dist/built-in-symbols-tool.d.ts +0 -1
  225. package/package/acode/dist/built-in-symbols-tool.js +2 -117
  226. package/package/acode/dist/builtins/commandArtifacts.d.ts +0 -1
  227. package/package/acode/dist/builtins/commandArtifacts.js +9 -97
  228. package/package/acode/dist/builtins/commandOutputEvents.d.ts +0 -1
  229. package/package/acode/dist/builtins/commandOutputEvents.js +2 -56
  230. package/package/acode/dist/builtins/shellCommandPreparation.d.ts +0 -1
  231. package/package/acode/dist/builtins/shellCommandPreparation.js +5 -44
  232. package/package/acode/dist/builtins/shellCommandResult.d.ts +0 -1
  233. package/package/acode/dist/builtins/shellCommandResult.js +2 -71
  234. package/package/acode/dist/builtins/shellCommandRunner.d.ts +0 -1
  235. package/package/acode/dist/builtins/shellCommandRunner.js +2 -115
  236. package/package/acode/dist/builtins/shellOutputDecoder.d.ts +0 -1
  237. package/package/acode/dist/builtins/shellOutputDecoder.js +2 -94
  238. package/package/acode/dist/cli.d.ts +0 -1
  239. package/package/acode/dist/cli.js +4 -38
  240. package/package/acode/dist/commands/commandLoader.d.ts +0 -1
  241. package/package/acode/dist/commands/commandLoader.js +2 -33
  242. package/package/acode/dist/commands/commandParser.d.ts +0 -1
  243. package/package/acode/dist/commands/commandParser.js +3 -77
  244. package/package/acode/dist/commands/commandRegistry.d.ts +0 -1
  245. package/package/acode/dist/commands/commandRegistry.js +2 -30
  246. package/package/acode/dist/compaction.d.ts +0 -1
  247. package/package/acode/dist/compaction.js +7 -919
  248. package/package/acode/dist/config.d.ts +0 -1
  249. package/package/acode/dist/config.js +5 -105
  250. package/package/acode/dist/fs-utils.d.ts +0 -1
  251. package/package/acode/dist/fs-utils.js +2 -79
  252. package/package/acode/dist/hooks/hookBus.d.ts +0 -1
  253. package/package/acode/dist/hooks/hookBus.js +2 -40
  254. package/package/acode/dist/index.d.ts +0 -1
  255. package/package/acode/dist/index.js +2 -19
  256. package/package/acode/dist/mcpToolNames.d.ts +0 -1
  257. package/package/acode/dist/mcpToolNames.js +2 -17
  258. package/package/acode/dist/parsers/ast-cache.d.ts +0 -1
  259. package/package/acode/dist/parsers/ast-cache.js +2 -76
  260. package/package/acode/dist/parsers/language-detector.d.ts +0 -1
  261. package/package/acode/dist/parsers/language-detector.js +2 -44
  262. package/package/acode/dist/parsers/language-queries.d.ts +0 -1
  263. package/package/acode/dist/parsers/language-queries.js +12 -602
  264. package/package/acode/dist/parsers/symbol-extractor.d.ts +0 -1
  265. package/package/acode/dist/parsers/symbol-extractor.js +3 -164
  266. package/package/acode/dist/parsers/tree-sitter-loader.d.ts +0 -1
  267. package/package/acode/dist/parsers/tree-sitter-loader.js +2 -64
  268. package/package/acode/dist/parsers/types.d.ts +0 -1
  269. package/package/acode/dist/parsers/types.js +1 -7
  270. package/package/acode/dist/runtime.d.ts +0 -1
  271. package/package/acode/dist/runtime.js +86 -3771
  272. package/package/acode/dist/skill-tool.d.ts +0 -1
  273. package/package/acode/dist/skill-tool.js +5 -174
  274. package/package/acode/dist/sub-agent-manager.d.ts +0 -1
  275. package/package/acode/dist/sub-agent-manager.js +2 -1159
  276. package/package/acode/dist/sub-agent-store.d.ts +0 -1
  277. package/package/acode/dist/sub-agent-store.js +4 -236
  278. package/package/acode/dist/sub-agent-tools.d.ts +0 -1
  279. package/package/acode/dist/sub-agent-tools.js +15 -369
  280. package/package/acode/dist/sub-agent-types.d.ts +0 -1
  281. package/package/acode/dist/sub-agent-types.js +1 -8
  282. package/package/acode/dist/todo-store.d.ts +0 -1
  283. package/package/acode/dist/todo-store.js +2 -73
  284. package/package/acode/dist/todo-tool.d.ts +0 -1
  285. package/package/acode/dist/todo-tool.js +5 -121
  286. package/package/acode/dist/types.d.ts +0 -1
  287. package/package/acode/dist/types.js +1 -1
  288. package/package/acode/package.json +2 -2
  289. package/package/aws-client-agent-mcp/dist/agent-client.d.ts +0 -1
  290. package/package/aws-client-agent-mcp/dist/agent-client.js +2 -890
  291. package/package/aws-client-agent-mcp/dist/agent-client.test.d.ts +0 -1
  292. package/package/aws-client-agent-mcp/dist/agent-client.test.js +0 -1
  293. package/package/aws-client-agent-mcp/dist/config.d.ts +0 -1
  294. package/package/aws-client-agent-mcp/dist/config.js +2 -243
  295. package/package/aws-client-agent-mcp/dist/config.test.d.ts +0 -1
  296. package/package/aws-client-agent-mcp/dist/config.test.js +0 -1
  297. package/package/aws-client-agent-mcp/dist/constants.d.ts +0 -1
  298. package/package/aws-client-agent-mcp/dist/constants.js +2 -24
  299. package/package/aws-client-agent-mcp/dist/context-manager.d.ts +0 -1
  300. package/package/aws-client-agent-mcp/dist/context-manager.js +2 -477
  301. package/package/aws-client-agent-mcp/dist/context-manager.test.d.ts +0 -1
  302. package/package/aws-client-agent-mcp/dist/context-manager.test.js +0 -1
  303. package/package/aws-client-agent-mcp/dist/http-client.d.ts +0 -1
  304. package/package/aws-client-agent-mcp/dist/http-client.js +2 -446
  305. package/package/aws-client-agent-mcp/dist/http-client.test.d.ts +0 -1
  306. package/package/aws-client-agent-mcp/dist/http-client.test.js +0 -1
  307. package/package/aws-client-agent-mcp/dist/index.d.ts +0 -1
  308. package/package/aws-client-agent-mcp/dist/index.js +2 -34
  309. package/package/aws-client-agent-mcp/dist/logger.d.ts +0 -1
  310. package/package/aws-client-agent-mcp/dist/logger.js +3 -178
  311. package/package/aws-client-agent-mcp/dist/logger.test.d.ts +0 -1
  312. package/package/aws-client-agent-mcp/dist/logger.test.js +0 -1
  313. package/package/aws-client-agent-mcp/dist/mcp-server.d.ts +0 -1
  314. package/package/aws-client-agent-mcp/dist/mcp-server.js +38 -2709
  315. package/package/aws-client-agent-mcp/dist/mcp-server.test.d.ts +0 -1
  316. package/package/aws-client-agent-mcp/dist/mcp-server.test.js +0 -1
  317. package/package/aws-client-agent-mcp/dist/mcp-tools.d.ts +0 -1
  318. package/package/aws-client-agent-mcp/dist/mcp-tools.js +22 -562
  319. package/package/aws-client-agent-mcp/dist/mcp-tools.test.d.ts +0 -1
  320. package/package/aws-client-agent-mcp/dist/mcp-tools.test.js +0 -1
  321. package/package/aws-client-agent-mcp/dist/memory-store.d.ts +0 -1
  322. package/package/aws-client-agent-mcp/dist/memory-store.js +4 -826
  323. package/package/aws-client-agent-mcp/dist/memory-store.test.d.ts +0 -1
  324. package/package/aws-client-agent-mcp/dist/memory-store.test.js +0 -1
  325. package/package/aws-client-agent-mcp/dist/memory-tools.d.ts +0 -1
  326. package/package/aws-client-agent-mcp/dist/memory-tools.js +31 -294
  327. package/package/aws-client-agent-mcp/dist/message-buffer.d.ts +0 -1
  328. package/package/aws-client-agent-mcp/dist/message-buffer.js +2 -288
  329. package/package/aws-client-agent-mcp/dist/message-buffer.test.d.ts +0 -1
  330. package/package/aws-client-agent-mcp/dist/message-buffer.test.js +0 -1
  331. package/package/aws-client-agent-mcp/dist/messageContent.d.ts +0 -1
  332. package/package/aws-client-agent-mcp/dist/messageContent.js +2 -125
  333. package/package/aws-client-agent-mcp/dist/runtime-launch-binding.d.ts +0 -1
  334. package/package/aws-client-agent-mcp/dist/runtime-launch-binding.js +2 -103
  335. package/package/aws-client-agent-mcp/dist/runtime-launch-binding.test.d.ts +0 -1
  336. package/package/aws-client-agent-mcp/dist/runtime-launch-binding.test.js +0 -1
  337. package/package/aws-client-agent-mcp/dist/server-memory-store.d.ts +0 -1
  338. package/package/aws-client-agent-mcp/dist/server-memory-store.js +2 -96
  339. package/package/aws-client-agent-mcp/dist/status-reporter.d.ts +0 -1
  340. package/package/aws-client-agent-mcp/dist/status-reporter.js +3 -327
  341. package/package/aws-client-agent-mcp/dist/status-reporter.test.d.ts +0 -1
  342. package/package/aws-client-agent-mcp/dist/status-reporter.test.js +0 -1
  343. package/package/aws-client-agent-mcp/dist/types.d.ts +0 -1
  344. package/package/aws-client-agent-mcp/dist/types.js +2 -9
  345. package/package/aws-client-agent-mcp/dist/websocket-client.d.ts +0 -1
  346. package/package/aws-client-agent-mcp/dist/websocket-client.js +2 -677
  347. package/package/aws-client-agent-mcp/dist/websocket-client.test.d.ts +0 -1
  348. package/package/aws-client-agent-mcp/dist/websocket-client.test.js +0 -1
  349. package/package/aws-client-agent-mcp/package.json +1 -1
  350. package/package/cc-switch-sdk/dist/constants.d.ts +0 -1
  351. package/package/cc-switch-sdk/dist/constants.js +2 -63
  352. package/package/cc-switch-sdk/dist/errors.d.ts +0 -1
  353. package/package/cc-switch-sdk/dist/errors.js +2 -8
  354. package/package/cc-switch-sdk/dist/index.d.ts +0 -1
  355. package/package/cc-switch-sdk/dist/index.js +2 -9
  356. package/package/cc-switch-sdk/dist/schemas.d.ts +0 -1
  357. package/package/cc-switch-sdk/dist/schemas.js +2 -38
  358. package/package/cc-switch-sdk/dist/sdk.d.ts +0 -1
  359. package/package/cc-switch-sdk/dist/sdk.js +2 -470
  360. package/package/cc-switch-sdk/dist/services/ai-config-service.d.ts +0 -1
  361. package/package/cc-switch-sdk/dist/services/ai-config-service.js +4 -307
  362. package/package/cc-switch-sdk/dist/services/mcp-model.d.ts +0 -1
  363. package/package/cc-switch-sdk/dist/services/mcp-model.js +2 -37
  364. package/package/cc-switch-sdk/dist/services/mcp-service.d.ts +0 -1
  365. package/package/cc-switch-sdk/dist/services/mcp-service.js +2 -9
  366. package/package/cc-switch-sdk/dist/services/skill-model.d.ts +0 -1
  367. package/package/cc-switch-sdk/dist/services/skill-model.js +2 -41
  368. package/package/cc-switch-sdk/dist/services/skill-service.d.ts +0 -1
  369. package/package/cc-switch-sdk/dist/services/skill-service.js +2 -9
  370. package/package/cc-switch-sdk/dist/state.d.ts +0 -1
  371. package/package/cc-switch-sdk/dist/state.js +2 -19
  372. package/package/cc-switch-sdk/dist/types.d.ts +0 -1
  373. package/package/cc-switch-sdk/dist/types.js +1 -1
  374. package/package/cc-switch-sdk/dist/utils/fs.d.ts +0 -1
  375. package/package/cc-switch-sdk/dist/utils/fs.js +3 -114
  376. package/package/cc-switch-sdk/dist/utils/id.d.ts +0 -1
  377. package/package/cc-switch-sdk/dist/utils/id.js +2 -12
  378. package/package/cc-switch-sdk/package.json +1 -1
  379. package/package.json +4 -2
  380. package/dist/adapter/AcodeSdkAdapter.d.ts.map +0 -1
  381. package/dist/adapter/AdapterRegistry.d.ts.map +0 -1
  382. package/dist/adapter/ClaudeSdkAdapter.d.ts.map +0 -1
  383. package/dist/adapter/CodexSdkAdapter.d.ts.map +0 -1
  384. package/dist/adapter/OpencodeSdkAdapter.d.ts.map +0 -1
  385. package/dist/adapter/SdkProviderSpi.d.ts.map +0 -1
  386. package/dist/adapter/acode-tool-names.d.ts.map +0 -1
  387. package/dist/adapter/idle-poll-loop.d.ts.map +0 -1
  388. package/dist/adapter/index.d.ts.map +0 -1
  389. package/dist/adapter/instance-ai-config-resolver.d.ts.map +0 -1
  390. package/dist/adapter/types.d.ts.map +0 -1
  391. package/dist/adapters/cc-switch/common.d.ts.map +0 -1
  392. package/dist/adapters/cc-switch/index.d.ts.map +0 -1
  393. package/dist/adapters/cc-switch/mcp-acode.d.ts.map +0 -1
  394. package/dist/adapters/cc-switch/mcp-claude.d.ts.map +0 -1
  395. package/dist/adapters/cc-switch/mcp-claudecode.d.ts.map +0 -1
  396. package/dist/adapters/cc-switch/mcp-codex.d.ts.map +0 -1
  397. package/dist/adapters/cc-switch/mcp-opencode.d.ts.map +0 -1
  398. package/dist/adapters/cc-switch/mcp-placeholder.d.ts.map +0 -1
  399. package/dist/adapters/cc-switch/skill-acode.d.ts.map +0 -1
  400. package/dist/adapters/cc-switch/skill-claude.d.ts.map +0 -1
  401. package/dist/adapters/cc-switch/skill-claudecode.d.ts.map +0 -1
  402. package/dist/adapters/cc-switch/skill-codex.d.ts.map +0 -1
  403. package/dist/adapters/cc-switch/skill-directory.d.ts.map +0 -1
  404. package/dist/adapters/cc-switch/skill-opencode.d.ts.map +0 -1
  405. package/dist/adapters/cc-switch/skill-placeholder.d.ts.map +0 -1
  406. package/dist/config.d.ts.map +0 -1
  407. package/dist/index.d.ts.map +0 -1
  408. package/dist/middleware/auth.d.ts.map +0 -1
  409. package/dist/routes/acode-todos.d.ts.map +0 -1
  410. package/dist/routes/ai-sources.d.ts.map +0 -1
  411. package/dist/routes/dashboard.d.ts.map +0 -1
  412. package/dist/routes/events.d.ts.map +0 -1
  413. package/dist/routes/file-browser.d.ts.map +0 -1
  414. package/dist/routes/file-diff-rollback.d.ts.map +0 -1
  415. package/dist/routes/file-snapshot.d.ts.map +0 -1
  416. package/dist/routes/git.d.ts.map +0 -1
  417. package/dist/routes/instance.d.ts.map +0 -1
  418. package/dist/routes/mcp.d.ts.map +0 -1
  419. package/dist/routes/processes.d.ts.map +0 -1
  420. package/dist/routes/properties.d.ts.map +0 -1
  421. package/dist/routes/pty.d.ts.map +0 -1
  422. package/dist/routes/runtime-binding.d.ts.map +0 -1
  423. package/dist/routes/sessions.d.ts.map +0 -1
  424. package/dist/routes/skills.d.ts.map +0 -1
  425. package/dist/routes/sub-agents.d.ts.map +0 -1
  426. package/dist/routes/system-metrics.d.ts.map +0 -1
  427. package/dist/routes/task-context.d.ts.map +0 -1
  428. package/dist/routes/terminal.d.ts.map +0 -1
  429. package/dist/routes/yml.d.ts.map +0 -1
  430. package/dist/services/acode-package.d.ts.map +0 -1
  431. package/dist/services/agent-event-store.d.ts.map +0 -1
  432. package/dist/services/agent-process-manager.d.ts.map +0 -1
  433. package/dist/services/ai-source-apply.d.ts.map +0 -1
  434. package/dist/services/auto-register.d.ts.map +0 -1
  435. package/dist/services/aws-client-agent-mcp.d.ts.map +0 -1
  436. package/dist/services/bridge-package-publish-hooks.d.ts.map +0 -1
  437. package/dist/services/cc-switch-sdk.d.ts.map +0 -1
  438. package/dist/services/cli-commands.d.ts.map +0 -1
  439. package/dist/services/event-delta-pusher.d.ts.map +0 -1
  440. package/dist/services/fileSnapshotStore.d.ts.map +0 -1
  441. package/dist/services/instance-ai-config-service.d.ts.map +0 -1
  442. package/dist/services/instance-init-service.d.ts.map +0 -1
  443. package/dist/services/instance-service.d.ts.map +0 -1
  444. package/dist/services/instance-state.d.ts.map +0 -1
  445. package/dist/services/legacy-path-migration.d.ts.map +0 -1
  446. package/dist/services/lifecycle-state.d.ts.map +0 -1
  447. package/dist/services/mcp-launch-binding-queue.d.ts.map +0 -1
  448. package/dist/services/orphan-monitor.d.ts.map +0 -1
  449. package/dist/services/panel-auth.d.ts.map +0 -1
  450. package/dist/services/process-detector.d.ts.map +0 -1
  451. package/dist/services/process-registry.d.ts.map +0 -1
  452. package/dist/services/ring-buffer.d.ts.map +0 -1
  453. package/dist/services/runtime-binding.d.ts.map +0 -1
  454. package/dist/services/runtime-lifecycle-policy.d.ts.map +0 -1
  455. package/dist/services/session-output.d.ts.map +0 -1
  456. package/dist/services/startup-config-wizard.d.ts.map +0 -1
  457. package/dist/services/sub-agent-manager-instance.d.ts.map +0 -1
  458. package/dist/services/system-metrics.d.ts.map +0 -1
  459. package/dist/services/terminal-persistence.d.ts.map +0 -1
  460. package/dist/services/tool-installer.d.ts.map +0 -1
  461. package/dist/services/tunnel-client.d.ts.map +0 -1
  462. package/dist/services/windows-service-manager.d.ts.map +0 -1
  463. package/dist/services/workspace-files.d.ts.map +0 -1
  464. package/dist/services/workspace-watch.d.ts.map +0 -1
  465. package/dist/services/workspaceTaskChangeWatcher.d.ts.map +0 -1
  466. package/dist/types.d.ts.map +0 -1
  467. package/dist/utils/file-utils.d.ts.map +0 -1
  468. package/dist/utils/instance-ai-config-debug-logger.d.ts.map +0 -1
  469. package/dist/utils/logger.d.ts.map +0 -1
  470. package/dist/utils/mcp-utils.d.ts.map +0 -1
  471. package/dist/utils/path-utils.d.ts.map +0 -1
  472. package/dist/utils/sdk-package-loader.d.ts.map +0 -1
  473. package/dist/utils/validation.d.ts.map +0 -1
  474. package/dist/utils/yaml-utils.d.ts.map +0 -1
  475. package/node_modules/@cc-switch/sdk/dist/constants.d.ts.map +0 -1
  476. package/node_modules/@cc-switch/sdk/dist/errors.d.ts.map +0 -1
  477. package/node_modules/@cc-switch/sdk/dist/index.d.ts.map +0 -1
  478. package/node_modules/@cc-switch/sdk/dist/schemas.d.ts.map +0 -1
  479. package/node_modules/@cc-switch/sdk/dist/sdk.d.ts.map +0 -1
  480. package/node_modules/@cc-switch/sdk/dist/services/ai-config-service.d.ts.map +0 -1
  481. package/node_modules/@cc-switch/sdk/dist/services/mcp-model.d.ts.map +0 -1
  482. package/node_modules/@cc-switch/sdk/dist/services/mcp-service.d.ts.map +0 -1
  483. package/node_modules/@cc-switch/sdk/dist/services/skill-model.d.ts.map +0 -1
  484. package/node_modules/@cc-switch/sdk/dist/services/skill-service.d.ts.map +0 -1
  485. package/node_modules/@cc-switch/sdk/dist/state.d.ts.map +0 -1
  486. package/node_modules/@cc-switch/sdk/dist/types.d.ts.map +0 -1
  487. package/node_modules/@cc-switch/sdk/dist/utils/fs.d.ts.map +0 -1
  488. package/node_modules/@cc-switch/sdk/dist/utils/id.d.ts.map +0 -1
  489. package/package/acode/dist/ask-user-question-tool.d.ts.map +0 -1
  490. package/package/acode/dist/built-in-file-tools.d.ts.map +0 -1
  491. package/package/acode/dist/built-in-symbols-tool.d.ts.map +0 -1
  492. package/package/acode/dist/builtins/commandArtifacts.d.ts.map +0 -1
  493. package/package/acode/dist/builtins/commandOutputEvents.d.ts.map +0 -1
  494. package/package/acode/dist/builtins/shellCommandPreparation.d.ts.map +0 -1
  495. package/package/acode/dist/builtins/shellCommandResult.d.ts.map +0 -1
  496. package/package/acode/dist/builtins/shellCommandRunner.d.ts.map +0 -1
  497. package/package/acode/dist/builtins/shellOutputDecoder.d.ts.map +0 -1
  498. package/package/acode/dist/cli.d.ts.map +0 -1
  499. package/package/acode/dist/commands/commandLoader.d.ts.map +0 -1
  500. package/package/acode/dist/commands/commandParser.d.ts.map +0 -1
  501. package/package/acode/dist/commands/commandRegistry.d.ts.map +0 -1
  502. package/package/acode/dist/compaction.d.ts.map +0 -1
  503. package/package/acode/dist/config.d.ts.map +0 -1
  504. package/package/acode/dist/fs-utils.d.ts.map +0 -1
  505. package/package/acode/dist/hooks/hookBus.d.ts.map +0 -1
  506. package/package/acode/dist/index.d.ts.map +0 -1
  507. package/package/acode/dist/mcpToolNames.d.ts.map +0 -1
  508. package/package/acode/dist/parsers/ast-cache.d.ts.map +0 -1
  509. package/package/acode/dist/parsers/language-detector.d.ts.map +0 -1
  510. package/package/acode/dist/parsers/language-queries.d.ts.map +0 -1
  511. package/package/acode/dist/parsers/symbol-extractor.d.ts.map +0 -1
  512. package/package/acode/dist/parsers/tree-sitter-loader.d.ts.map +0 -1
  513. package/package/acode/dist/parsers/types.d.ts.map +0 -1
  514. package/package/acode/dist/runtime.d.ts.map +0 -1
  515. package/package/acode/dist/skill-tool.d.ts.map +0 -1
  516. package/package/acode/dist/sub-agent-manager.d.ts.map +0 -1
  517. package/package/acode/dist/sub-agent-store.d.ts.map +0 -1
  518. package/package/acode/dist/sub-agent-tools.d.ts.map +0 -1
  519. package/package/acode/dist/sub-agent-types.d.ts.map +0 -1
  520. package/package/acode/dist/todo-store.d.ts.map +0 -1
  521. package/package/acode/dist/todo-tool.d.ts.map +0 -1
  522. package/package/acode/dist/types.d.ts.map +0 -1
  523. package/package/aws-client-agent-mcp/dist/agent-client.d.ts.map +0 -1
  524. package/package/aws-client-agent-mcp/dist/agent-client.js.map +0 -1
  525. package/package/aws-client-agent-mcp/dist/agent-client.test.d.ts.map +0 -1
  526. package/package/aws-client-agent-mcp/dist/agent-client.test.js.map +0 -1
  527. package/package/aws-client-agent-mcp/dist/config.d.ts.map +0 -1
  528. package/package/aws-client-agent-mcp/dist/config.js.map +0 -1
  529. package/package/aws-client-agent-mcp/dist/config.test.d.ts.map +0 -1
  530. package/package/aws-client-agent-mcp/dist/config.test.js.map +0 -1
  531. package/package/aws-client-agent-mcp/dist/constants.d.ts.map +0 -1
  532. package/package/aws-client-agent-mcp/dist/constants.js.map +0 -1
  533. package/package/aws-client-agent-mcp/dist/context-manager.d.ts.map +0 -1
  534. package/package/aws-client-agent-mcp/dist/context-manager.js.map +0 -1
  535. package/package/aws-client-agent-mcp/dist/context-manager.test.d.ts.map +0 -1
  536. package/package/aws-client-agent-mcp/dist/context-manager.test.js.map +0 -1
  537. package/package/aws-client-agent-mcp/dist/http-client.d.ts.map +0 -1
  538. package/package/aws-client-agent-mcp/dist/http-client.js.map +0 -1
  539. package/package/aws-client-agent-mcp/dist/http-client.test.d.ts.map +0 -1
  540. package/package/aws-client-agent-mcp/dist/http-client.test.js.map +0 -1
  541. package/package/aws-client-agent-mcp/dist/index.d.ts.map +0 -1
  542. package/package/aws-client-agent-mcp/dist/index.js.map +0 -1
  543. package/package/aws-client-agent-mcp/dist/logger.d.ts.map +0 -1
  544. package/package/aws-client-agent-mcp/dist/logger.js.map +0 -1
  545. package/package/aws-client-agent-mcp/dist/logger.test.d.ts.map +0 -1
  546. package/package/aws-client-agent-mcp/dist/logger.test.js.map +0 -1
  547. package/package/aws-client-agent-mcp/dist/mcp-server.d.ts.map +0 -1
  548. package/package/aws-client-agent-mcp/dist/mcp-server.js.map +0 -1
  549. package/package/aws-client-agent-mcp/dist/mcp-server.test.d.ts.map +0 -1
  550. package/package/aws-client-agent-mcp/dist/mcp-server.test.js.map +0 -1
  551. package/package/aws-client-agent-mcp/dist/mcp-tools.d.ts.map +0 -1
  552. package/package/aws-client-agent-mcp/dist/mcp-tools.js.map +0 -1
  553. package/package/aws-client-agent-mcp/dist/mcp-tools.test.d.ts.map +0 -1
  554. package/package/aws-client-agent-mcp/dist/mcp-tools.test.js.map +0 -1
  555. package/package/aws-client-agent-mcp/dist/memory-store.d.ts.map +0 -1
  556. package/package/aws-client-agent-mcp/dist/memory-store.js.map +0 -1
  557. package/package/aws-client-agent-mcp/dist/memory-store.test.d.ts.map +0 -1
  558. package/package/aws-client-agent-mcp/dist/memory-store.test.js.map +0 -1
  559. package/package/aws-client-agent-mcp/dist/memory-tools.d.ts.map +0 -1
  560. package/package/aws-client-agent-mcp/dist/memory-tools.js.map +0 -1
  561. package/package/aws-client-agent-mcp/dist/message-buffer.d.ts.map +0 -1
  562. package/package/aws-client-agent-mcp/dist/message-buffer.js.map +0 -1
  563. package/package/aws-client-agent-mcp/dist/message-buffer.test.d.ts.map +0 -1
  564. package/package/aws-client-agent-mcp/dist/message-buffer.test.js.map +0 -1
  565. package/package/aws-client-agent-mcp/dist/messageContent.d.ts.map +0 -1
  566. package/package/aws-client-agent-mcp/dist/messageContent.js.map +0 -1
  567. package/package/aws-client-agent-mcp/dist/runtime-launch-binding.d.ts.map +0 -1
  568. package/package/aws-client-agent-mcp/dist/runtime-launch-binding.js.map +0 -1
  569. package/package/aws-client-agent-mcp/dist/runtime-launch-binding.test.d.ts.map +0 -1
  570. package/package/aws-client-agent-mcp/dist/runtime-launch-binding.test.js.map +0 -1
  571. package/package/aws-client-agent-mcp/dist/server-memory-store.d.ts.map +0 -1
  572. package/package/aws-client-agent-mcp/dist/server-memory-store.js.map +0 -1
  573. package/package/aws-client-agent-mcp/dist/status-reporter.d.ts.map +0 -1
  574. package/package/aws-client-agent-mcp/dist/status-reporter.js.map +0 -1
  575. package/package/aws-client-agent-mcp/dist/status-reporter.test.d.ts.map +0 -1
  576. package/package/aws-client-agent-mcp/dist/status-reporter.test.js.map +0 -1
  577. package/package/aws-client-agent-mcp/dist/types.d.ts.map +0 -1
  578. package/package/aws-client-agent-mcp/dist/types.js.map +0 -1
  579. package/package/aws-client-agent-mcp/dist/websocket-client.d.ts.map +0 -1
  580. package/package/aws-client-agent-mcp/dist/websocket-client.js.map +0 -1
  581. package/package/aws-client-agent-mcp/dist/websocket-client.test.d.ts.map +0 -1
  582. package/package/aws-client-agent-mcp/dist/websocket-client.test.js.map +0 -1
  583. package/package/cc-switch-sdk/dist/constants.d.ts.map +0 -1
  584. package/package/cc-switch-sdk/dist/errors.d.ts.map +0 -1
  585. package/package/cc-switch-sdk/dist/index.d.ts.map +0 -1
  586. package/package/cc-switch-sdk/dist/schemas.d.ts.map +0 -1
  587. package/package/cc-switch-sdk/dist/sdk.d.ts.map +0 -1
  588. package/package/cc-switch-sdk/dist/services/ai-config-service.d.ts.map +0 -1
  589. package/package/cc-switch-sdk/dist/services/mcp-model.d.ts.map +0 -1
  590. package/package/cc-switch-sdk/dist/services/mcp-service.d.ts.map +0 -1
  591. package/package/cc-switch-sdk/dist/services/skill-model.d.ts.map +0 -1
  592. package/package/cc-switch-sdk/dist/services/skill-service.d.ts.map +0 -1
  593. package/package/cc-switch-sdk/dist/state.d.ts.map +0 -1
  594. package/package/cc-switch-sdk/dist/types.d.ts.map +0 -1
  595. package/package/cc-switch-sdk/dist/utils/fs.d.ts.map +0 -1
  596. package/package/cc-switch-sdk/dist/utils/id.d.ts.map +0 -1
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=websocket-client.test.d.ts.map
@@ -646,4 +646,3 @@ describe('WebSocketClient reconnect behavior', () => {
646
646
  }
647
647
  });
648
648
  });
649
- //# sourceMappingURL=websocket-client.test.js.map
@@ -12,7 +12,7 @@
12
12
  "README.md"
13
13
  ],
14
14
  "scripts": {
15
- "build": "tsc",
15
+ "build": "tsc && node ../../scripts/minify-dist.mjs",
16
16
  "dev": "tsc --watch",
17
17
  "start": "node dist/index.js",
18
18
  "test": "npm run build && node --test dist",
@@ -6,4 +6,3 @@ export declare function resolvePaths(options?: SdkOptions): {
6
6
  paths: SdkPaths;
7
7
  skillSyncMethod: SkillSyncMethod;
8
8
  };
9
- //# sourceMappingURL=constants.d.ts.map
@@ -1,63 +1,2 @@
1
- import path from "node:path";
2
- import os from "node:os";
3
- export const ALL_APPS = [
4
- "acode",
5
- "claude",
6
- "claudecode",
7
- "codex",
8
- "gemini",
9
- "opencode",
10
- "openclaw",
11
- ];
12
- export const DEFAULT_APP_FLAGS = {
13
- acode: false,
14
- claude: false,
15
- claudecode: false,
16
- codex: false,
17
- gemini: false,
18
- opencode: false,
19
- openclaw: false,
20
- };
21
- export function normalizeAppFlags(flags) {
22
- return {
23
- acode: Boolean(flags?.acode),
24
- claude: false,
25
- claudecode: Boolean(flags?.claudecode) || Boolean(flags?.claude),
26
- codex: Boolean(flags?.codex),
27
- gemini: Boolean(flags?.gemini),
28
- opencode: Boolean(flags?.opencode),
29
- openclaw: Boolean(flags?.openclaw),
30
- };
31
- }
32
- export function resolvePaths(options = {}) {
33
- const rootDir = options.rootDir ?? path.join(os.homedir(), ".cc-switch-sdk-node");
34
- const paths = {
35
- stateFile: options.paths?.stateFile ?? path.join(rootDir, "state.json"),
36
- backupDir: options.paths?.backupDir ?? path.join(rootDir, "backups"),
37
- claudeConfigFile: options.paths?.claudeConfigFile ??
38
- path.join(os.homedir(), ".claude.json"),
39
- claudeSkillsDir: options.paths?.claudeSkillsDir ??
40
- path.join(os.homedir(), ".claude", "skills"),
41
- claudecodeConfigFile: options.paths?.claudecodeConfigFile ??
42
- path.join(os.homedir(), ".claudecode", "opencode.json"),
43
- claudecodeSkillsDir: options.paths?.claudecodeSkillsDir ??
44
- path.join(os.homedir(), ".claudecode", "skills"),
45
- codexConfigFile: options.paths?.codexConfigFile ??
46
- path.join(os.homedir(), ".codex", "config.toml"),
47
- codexSkillsDir: options.paths?.codexSkillsDir ??
48
- path.join(os.homedir(), ".codex", "skills"),
49
- acodeConfigFile: options.paths?.acodeConfigFile ??
50
- path.join(os.homedir(), ".acode", "config.json"),
51
- acodeSkillsDir: options.paths?.acodeSkillsDir ??
52
- path.join(os.homedir(), ".acode", "skills"),
53
- opencodeConfigFile: options.paths?.opencodeConfigFile ??
54
- path.join(os.homedir(), ".opencode", "config.json"),
55
- opencodeSkillsDir: options.paths?.opencodeSkillsDir ??
56
- path.join(os.homedir(), ".opencode", "skills"),
57
- ssotSkillsDir: options.paths?.ssotSkillsDir ?? path.join(rootDir, "skills"),
58
- };
59
- return {
60
- paths,
61
- skillSyncMethod: options.skillSyncMethod ?? "auto",
62
- };
63
- }
1
+ import o from"node:path";import l from"node:os";const n=["acode","claude","claudecode","codex","gemini","opencode","openclaw"],s={acode:!1,claude:!1,claudecode:!1,codex:!1,gemini:!1,opencode:!1,openclaw:!1};function r(e){return{acode:!!e?.acode,claude:!1,claudecode:!!e?.claudecode||!!e?.claude,codex:!!e?.codex,gemini:!!e?.gemini,opencode:!!e?.opencode,openclaw:!!e?.openclaw}}function t(e={}){const i=e.rootDir??o.join(l.homedir(),".cc-switch-sdk-node");return{paths:{stateFile:e.paths?.stateFile??o.join(i,"state.json"),backupDir:e.paths?.backupDir??o.join(i,"backups"),claudeConfigFile:e.paths?.claudeConfigFile??o.join(l.homedir(),".claude.json"),claudeSkillsDir:e.paths?.claudeSkillsDir??o.join(l.homedir(),".claude","skills"),claudecodeConfigFile:e.paths?.claudecodeConfigFile??o.join(l.homedir(),".claudecode","opencode.json"),claudecodeSkillsDir:e.paths?.claudecodeSkillsDir??o.join(l.homedir(),".claudecode","skills"),codexConfigFile:e.paths?.codexConfigFile??o.join(l.homedir(),".codex","config.toml"),codexSkillsDir:e.paths?.codexSkillsDir??o.join(l.homedir(),".codex","skills"),acodeConfigFile:e.paths?.acodeConfigFile??o.join(l.homedir(),".acode","config.json"),acodeSkillsDir:e.paths?.acodeSkillsDir??o.join(l.homedir(),".acode","skills"),opencodeConfigFile:e.paths?.opencodeConfigFile??o.join(l.homedir(),".opencode","config.json"),opencodeSkillsDir:e.paths?.opencodeSkillsDir??o.join(l.homedir(),".opencode","skills"),ssotSkillsDir:e.paths?.ssotSkillsDir??o.join(i,"skills")},skillSyncMethod:e.skillSyncMethod??"auto"}}export{n as ALL_APPS,s as DEFAULT_APP_FLAGS,r as normalizeAppFlags,t as resolvePaths};
2
+
@@ -3,4 +3,3 @@ export declare class SdkError extends Error {
3
3
  readonly details?: unknown;
4
4
  constructor(code: string, message: string, details?: unknown);
5
5
  }
6
- //# sourceMappingURL=errors.d.ts.map
@@ -1,8 +1,2 @@
1
- export class SdkError extends Error {
2
- constructor(code, message, details) {
3
- super(message);
4
- this.name = "SdkError";
5
- this.code = code;
6
- this.details = details;
7
- }
8
- }
1
+ class o extends Error{constructor(r,s,t){super(s),this.name="SdkError",this.code=r,this.details=t}}export{o as SdkError};
2
+
@@ -8,4 +8,3 @@ import type { AppId, AppFlags, McpServer, McpServerSpec, InstalledSkill, SkillSy
8
8
  import { CcSwitchSdk } from "./sdk.js";
9
9
  import { AiConfigService, buildToolSpecificAiConfig, type AiConfigTemplate, type ClaudeCodeConfig, type CodexConfig, type OpenCodeConfig, type AiConfigPaths } from "./services/ai-config-service.js";
10
10
  export { CcSwitchSdk, AiConfigService, buildToolSpecificAiConfig, type AppId, type AppFlags, type McpServer, type McpServerSpec, type InstalledSkill, type SkillSyncMethod, type SdkOptions, type SdkPaths, type SdkState, type IMcpAdapter, type ISkillAdapter, type AdapterOverrides, type AiConfigTemplate, type ClaudeCodeConfig, type CodexConfig, type OpenCodeConfig, type AiConfigPaths, };
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,9 +1,2 @@
1
- /**
2
- * @cc-switch/sdk - 纯配置管理 SDK
3
- *
4
- * 负责 MCP/Skill 的 CRUD 操作和状态管理。
5
- * 注意:adapters 需要外部注入,SDK 不提供默认实现。
6
- */
7
- import { CcSwitchSdk } from "./sdk.js";
8
- import { AiConfigService, buildToolSpecificAiConfig, } from "./services/ai-config-service.js";
9
- export { CcSwitchSdk, AiConfigService, buildToolSpecificAiConfig, };
1
+ import{CcSwitchSdk as i}from"./sdk.js";import{AiConfigService as o,buildToolSpecificAiConfig as r}from"./services/ai-config-service.js";export{o as AiConfigService,i as CcSwitchSdk,r as buildToolSpecificAiConfig};
2
+
@@ -5,4 +5,3 @@ export declare const mcpServerSpecSchema: z.ZodType<McpServerSpec>;
5
5
  export declare const mcpServerSchema: z.ZodType<McpServer>;
6
6
  export declare const installedSkillSchema: z.ZodType<InstalledSkill>;
7
7
  export declare const sdkStateSchema: z.ZodType<SdkState>;
8
- //# sourceMappingURL=schemas.d.ts.map
@@ -1,38 +1,2 @@
1
- import { z } from "zod";
2
- export const appFlagsSchema = z.object({
3
- acode: z.boolean(),
4
- claude: z.boolean(),
5
- claudecode: z.boolean(),
6
- codex: z.boolean(),
7
- gemini: z.boolean(),
8
- opencode: z.boolean(),
9
- openclaw: z.boolean(),
10
- });
11
- export const mcpServerSpecSchema = z.object({
12
- type: z.enum(["stdio", "sse", "http"]).optional(),
13
- command: z.string().optional(),
14
- args: z.array(z.string()).optional(),
15
- env: z.record(z.string(), z.string()).optional(),
16
- cwd: z.string().optional(),
17
- url: z.string().optional(),
18
- headers: z.record(z.string(), z.string()).optional(),
19
- });
20
- export const mcpServerSchema = z.object({
21
- id: z.string(),
22
- name: z.string(),
23
- server: mcpServerSpecSchema,
24
- description: z.string().optional(),
25
- apps: appFlagsSchema,
26
- });
27
- export const installedSkillSchema = z.object({
28
- id: z.string(),
29
- name: z.string(),
30
- directory: z.string(),
31
- description: z.string().optional(),
32
- apps: appFlagsSchema,
33
- installedAt: z.number(),
34
- });
35
- export const sdkStateSchema = z.object({
36
- mcpServers: z.record(z.string(), mcpServerSchema),
37
- skills: z.record(z.string(), installedSkillSchema),
38
- });
1
+ import{z as o}from"zod";const e=o.object({acode:o.boolean(),claude:o.boolean(),claudecode:o.boolean(),codex:o.boolean(),gemini:o.boolean(),opencode:o.boolean(),openclaw:o.boolean()}),t=o.object({type:o.enum(["stdio","sse","http"]).optional(),command:o.string().optional(),args:o.array(o.string()).optional(),env:o.record(o.string(),o.string()).optional(),cwd:o.string().optional(),url:o.string().optional(),headers:o.record(o.string(),o.string()).optional()}),n=o.object({id:o.string(),name:o.string(),server:t,description:o.string().optional(),apps:e}),r=o.object({id:o.string(),name:o.string(),directory:o.string(),description:o.string().optional(),apps:e,installedAt:o.number()}),a=o.object({mcpServers:o.record(o.string(),n),skills:o.record(o.string(),r)});export{e as appFlagsSchema,r as installedSkillSchema,n as mcpServerSchema,t as mcpServerSpecSchema,a as sdkStateSchema};
2
+
@@ -88,4 +88,3 @@ export declare class CcSwitchSdk {
88
88
  private createSkillWithAppFlag;
89
89
  getPaths(): SdkPaths;
90
90
  }
91
- //# sourceMappingURL=sdk.d.ts.map
@@ -1,470 +1,2 @@
1
- import path from "node:path";
2
- import { resolvePaths } from "./constants.js";
3
- import { loadState, saveState } from "./state.js";
4
- import { buildMcpFromInput, mergeMcp, applyMcpAppFlag, } from "./services/mcp-model.js";
5
- import { syncMcpServerToApps } from "./services/mcp-service.js";
6
- import { buildSkillFromInput, mergeSkill, applySkillAppFlag, skillSourceDir, } from "./services/skill-model.js";
7
- import { syncSkillToApps } from "./services/skill-service.js";
8
- import { copyDir, copyDirIfExists, copyFile, pathExists, removeIfExists, } from "./utils/fs.js";
9
- import { SdkError } from "./errors.js";
10
- /**
11
- * 导入时合并 App 标记
12
- * 注意:此函数移到 sdk.ts 中,因为它是导入逻辑的一部分
13
- */
14
- function mergeAppFlagOnImport(server, appId) {
15
- const canonicalAppId = appId === "claude" ? "claudecode" : appId;
16
- return {
17
- ...server,
18
- apps: {
19
- ...server.apps,
20
- [canonicalAppId]: true,
21
- claude: false,
22
- },
23
- };
24
- }
25
- export class CcSwitchSdk {
26
- /**
27
- * 创建 CcSwitchSdk 实例
28
- *
29
- * 注意:adapters 必须通过 options.adapters 注入,
30
- * cc-switch-sdk 不再提供默认的 adapter 实现。
31
- *
32
- * @param options - SDK 配置选项
33
- * @param options.adapters.mcp - MCP 适配器映射(必需)
34
- * @param options.adapters.skill - Skill 适配器映射(必需)
35
- */
36
- constructor(options) {
37
- this.state = { mcpServers: {}, skills: {} };
38
- this.operationQueue = Promise.resolve();
39
- if (!options.adapters?.mcp || !options.adapters?.skill) {
40
- throw new SdkError("ADAPTERS_REQUIRED", "Adapters are required. Please provide mcp and skill adapters via options.adapters.", { hasMcp: !!options.adapters?.mcp, hasSkill: !!options.adapters?.skill });
41
- }
42
- const resolved = resolvePaths(options);
43
- this.paths = resolved.paths;
44
- this.skillSyncMethod = resolved.skillSyncMethod;
45
- this.mcpAdapters = options.adapters.mcp;
46
- this.skillAdapters = options.adapters.skill;
47
- }
48
- async executeExclusive(operation) {
49
- const previous = this.operationQueue;
50
- let release;
51
- this.operationQueue = new Promise((resolve) => {
52
- release = resolve;
53
- });
54
- await previous;
55
- try {
56
- return await operation();
57
- }
58
- finally {
59
- release();
60
- }
61
- }
62
- async load() {
63
- this.state = await loadState(this.paths.stateFile);
64
- }
65
- async save() {
66
- await saveState(this.paths.stateFile, this.state);
67
- }
68
- getAiConfigPath(appId) {
69
- if (appId === "opencode") {
70
- return this.paths.opencodeConfigFile;
71
- }
72
- if (appId === "claudecode") {
73
- return this.paths.claudecodeConfigFile;
74
- }
75
- if (appId === "codex") {
76
- return this.paths.codexConfigFile;
77
- }
78
- return undefined;
79
- }
80
- getAiBackupPath(appId) {
81
- const extension = appId === "codex" ? "toml" : "json";
82
- return path.join(this.paths.backupDir, `${appId}.config.backup.${extension}`);
83
- }
84
- async backupAiConfigIfNeeded(appId) {
85
- const configPath = this.getAiConfigPath(appId);
86
- if (!configPath) {
87
- return;
88
- }
89
- const backupPath = this.getAiBackupPath(appId);
90
- if (await pathExists(backupPath)) {
91
- return;
92
- }
93
- if (await pathExists(configPath)) {
94
- await copyFile(configPath, backupPath);
95
- }
96
- }
97
- async backupBeforeMcpSyncByApps(apps) {
98
- const targets = ["acode", "opencode", "claudecode", "codex"];
99
- for (const appId of targets) {
100
- if (apps[appId]) {
101
- await this.backupAiConfigIfNeeded(appId);
102
- }
103
- }
104
- }
105
- async backupBeforeMcpSync(server) {
106
- await this.backupBeforeMcpSyncByApps(server.apps);
107
- }
108
- async backupAiConfigs(appIds = ["acode", "opencode", "claudecode", "codex"]) {
109
- for (const appId of appIds) {
110
- await this.backupAiConfigIfNeeded(appId);
111
- }
112
- }
113
- async restoreAiConfig(appId) {
114
- const configPath = this.getAiConfigPath(appId);
115
- if (!configPath) {
116
- return false;
117
- }
118
- const backupPath = this.getAiBackupPath(appId);
119
- if (!(await pathExists(backupPath))) {
120
- return false;
121
- }
122
- await copyFile(backupPath, configPath);
123
- return true;
124
- }
125
- async restoreAiConfigs(appIds = ["acode", "opencode", "claudecode", "codex"]) {
126
- const result = {};
127
- for (const appId of appIds) {
128
- result[appId] = await this.restoreAiConfig(appId);
129
- }
130
- return result;
131
- }
132
- getAllMcpServers() {
133
- return Object.values(this.state.mcpServers);
134
- }
135
- getMcpServerById(id) {
136
- return this.state.mcpServers[id];
137
- }
138
- async createMcpServer(input) {
139
- return this.executeExclusive(async () => {
140
- const server = buildMcpFromInput(input);
141
- this.state.mcpServers[server.id] = server;
142
- await this.backupBeforeMcpSync(server);
143
- await syncMcpServerToApps(server, this.mcpAdapters);
144
- await this.save();
145
- return server;
146
- });
147
- }
148
- async updateMcpServer(id, patch) {
149
- return this.executeExclusive(async () => {
150
- const current = this.state.mcpServers[id];
151
- if (!current) {
152
- throw new SdkError("MCP_NOT_FOUND", `MCP server not found: ${id}`, { id });
153
- }
154
- const updated = mergeMcp(current, patch);
155
- this.state.mcpServers[id] = updated;
156
- await this.backupBeforeMcpSync(updated);
157
- await syncMcpServerToApps(updated, this.mcpAdapters);
158
- await this.save();
159
- return updated;
160
- });
161
- }
162
- async deleteMcpServer(id) {
163
- return this.executeExclusive(async () => {
164
- const server = this.state.mcpServers[id];
165
- if (!server) {
166
- return;
167
- }
168
- const disabled = {
169
- ...server,
170
- apps: {
171
- claude: false,
172
- acode: false,
173
- claudecode: false,
174
- codex: false,
175
- gemini: false,
176
- opencode: false,
177
- openclaw: false,
178
- },
179
- };
180
- await syncMcpServerToApps(disabled, this.mcpAdapters);
181
- delete this.state.mcpServers[id];
182
- await this.save();
183
- });
184
- }
185
- async toggleMcpApp(serverId, appId, enabled) {
186
- return this.executeExclusive(async () => {
187
- const current = this.state.mcpServers[serverId];
188
- if (!current) {
189
- throw new SdkError("MCP_NOT_FOUND", `MCP server not found: ${serverId}`, {
190
- serverId,
191
- });
192
- }
193
- const updated = applyMcpAppFlag(current, appId, enabled);
194
- this.state.mcpServers[serverId] = updated;
195
- await this.backupBeforeMcpSyncByApps({ [appId]: enabled });
196
- await syncMcpServerToApps(updated, this.mcpAdapters);
197
- await this.save();
198
- return updated;
199
- });
200
- }
201
- async importMcpFromApps() {
202
- return this.executeExclusive(async () => {
203
- let count = 0;
204
- const apps = ["claude", "claudecode", "opencode", "codex", "gemini", "openclaw"];
205
- for (const appId of apps) {
206
- const imported = await this.mcpAdapters[appId].importServers();
207
- for (const imp of imported) {
208
- const existing = this.findMcpServerByName(imp.name);
209
- if (existing) {
210
- const merged = mergeAppFlagOnImport(existing, appId);
211
- this.state.mcpServers[existing.id] = merged;
212
- continue;
213
- }
214
- const withFlag = this.createMcpWithAppFlag(imp, appId);
215
- this.state.mcpServers[withFlag.id] = withFlag;
216
- count++;
217
- }
218
- }
219
- await this.save();
220
- return count;
221
- });
222
- }
223
- /**
224
- * 从单个应用导入 MCP 服务器
225
- */
226
- async importMcpFromApp(appId) {
227
- let count = 0;
228
- const imported = await this.mcpAdapters[appId].importServers();
229
- for (const imp of imported) {
230
- const isNew = await this.processImportedMcp(imp, appId);
231
- if (isNew) {
232
- count++;
233
- }
234
- }
235
- return count;
236
- }
237
- /**
238
- * 处理导入的 MCP 服务器(合并或创建)
239
- * @returns 是否为新创建的 MCP
240
- */
241
- async processImportedMcp(imp, appId) {
242
- const existing = this.findMcpServerByName(imp.name);
243
- if (existing) {
244
- const merged = mergeAppFlagOnImport(existing, appId);
245
- this.state.mcpServers[existing.id] = merged;
246
- await syncMcpServerToApps(merged, this.mcpAdapters);
247
- return false;
248
- }
249
- const withFlag = this.createMcpWithAppFlag(imp, appId);
250
- this.state.mcpServers[withFlag.id] = withFlag;
251
- await syncMcpServerToApps(withFlag, this.mcpAdapters);
252
- return true;
253
- }
254
- /**
255
- * 根据名称查找 MCP 服务器
256
- */
257
- findMcpServerByName(name) {
258
- return Object.values(this.state.mcpServers).find((s) => s.name === name);
259
- }
260
- /**
261
- * 创建带有应用标记的 MCP 服务器
262
- */
263
- createMcpWithAppFlag(imp, appId) {
264
- const canonicalAppId = appId === "claude" ? "claudecode" : appId;
265
- return {
266
- ...imp,
267
- apps: {
268
- acode: false,
269
- claude: false,
270
- claudecode: false,
271
- codex: false,
272
- gemini: false,
273
- opencode: false,
274
- openclaw: false,
275
- [canonicalAppId]: true,
276
- },
277
- };
278
- }
279
- getAllSkills() {
280
- return Object.values(this.state.skills);
281
- }
282
- getSkillById(id) {
283
- return this.state.skills[id];
284
- }
285
- async installSkill(input) {
286
- return this.executeExclusive(async () => {
287
- const ssotDir = this.paths.ssotSkillsDir;
288
- const skill = buildSkillFromInput(input);
289
- const targetSource = skillSourceDir(ssotDir, skill);
290
- await copyDir(input.sourceDir, targetSource);
291
- this.state.skills[skill.id] = skill;
292
- await syncSkillToApps(skill, targetSource, this.skillSyncMethod, this.skillAdapters);
293
- await this.save();
294
- return skill;
295
- });
296
- }
297
- async updateSkill(id, patch) {
298
- return this.executeExclusive(async () => {
299
- const current = this.state.skills[id];
300
- if (!current) {
301
- throw new SdkError("SKILL_NOT_FOUND", `Skill not found: ${id}`, { id });
302
- }
303
- const updated = mergeSkill(current, patch);
304
- this.state.skills[id] = updated;
305
- const source = skillSourceDir(this.paths.ssotSkillsDir, updated);
306
- await syncSkillToApps(updated, source, this.skillSyncMethod, this.skillAdapters);
307
- await this.save();
308
- return updated;
309
- });
310
- }
311
- async uninstallSkill(id) {
312
- return this.executeExclusive(async () => {
313
- const skill = this.state.skills[id];
314
- if (!skill) {
315
- return;
316
- }
317
- const disabled = {
318
- ...skill,
319
- apps: {
320
- acode: false,
321
- claude: false,
322
- claudecode: false,
323
- codex: false,
324
- gemini: false,
325
- opencode: false,
326
- openclaw: false,
327
- },
328
- };
329
- const source = skillSourceDir(this.paths.ssotSkillsDir, skill);
330
- await syncSkillToApps(disabled, source, this.skillSyncMethod, this.skillAdapters);
331
- delete this.state.skills[id];
332
- const sourceDir = skillSourceDir(this.paths.ssotSkillsDir, skill);
333
- await removeIfExists(sourceDir);
334
- await this.save();
335
- });
336
- }
337
- async toggleSkillApp(skillId, appId, enabled) {
338
- return this.executeExclusive(async () => {
339
- const current = this.state.skills[skillId];
340
- if (!current) {
341
- throw new SdkError("SKILL_NOT_FOUND", `Skill not found: ${skillId}`, {
342
- skillId,
343
- });
344
- }
345
- const updated = applySkillAppFlag(current, appId, enabled);
346
- this.state.skills[skillId] = updated;
347
- const source = skillSourceDir(this.paths.ssotSkillsDir, updated);
348
- await syncSkillToApps(updated, source, this.skillSyncMethod, this.skillAdapters);
349
- await this.save();
350
- return updated;
351
- });
352
- }
353
- async importSkillsFromApps() {
354
- return this.executeExclusive(async () => {
355
- let count = 0;
356
- const apps = ["claude", "claudecode", "opencode", "codex", "gemini", "openclaw"];
357
- for (const appId of apps) {
358
- const imported = await this.skillAdapters[appId].importSkills();
359
- for (const imp of imported) {
360
- const existing = this.findSkillByName(imp.name);
361
- if (existing) {
362
- if (!(await pathExists(imp.directory))) {
363
- continue;
364
- }
365
- const canonicalAppId = appId === "claude" ? "claudecode" : appId;
366
- const merged = {
367
- ...existing,
368
- apps: { ...existing.apps, [canonicalAppId]: true, claude: false },
369
- };
370
- this.state.skills[existing.id] = merged;
371
- continue;
372
- }
373
- const withFlag = this.createSkillWithAppFlag(imp, appId);
374
- const source = skillSourceDir(this.paths.ssotSkillsDir, withFlag);
375
- const copied = await copyDirIfExists(imp.directory, source);
376
- if (!copied) {
377
- continue;
378
- }
379
- this.state.skills[withFlag.id] = withFlag;
380
- count++;
381
- }
382
- }
383
- await this.save();
384
- return count;
385
- });
386
- }
387
- /**
388
- * 从单个应用导入 Skills
389
- */
390
- async importSkillsFromApp(appId) {
391
- let count = 0;
392
- const imported = await this.skillAdapters[appId].importSkills();
393
- for (const imp of imported) {
394
- const isNew = await this.processImportedSkill(imp, appId);
395
- if (isNew) {
396
- count++;
397
- }
398
- }
399
- return count;
400
- }
401
- /**
402
- * 处理导入的 Skill(合并或创建)
403
- * @returns 是否为新创建的 Skill
404
- */
405
- async processImportedSkill(imp, appId) {
406
- const existing = this.findSkillByName(imp.name);
407
- if (existing) {
408
- await this.mergeExistingSkill(existing, appId);
409
- return false;
410
- }
411
- await this.createNewImportedSkill(imp, appId);
412
- return true;
413
- }
414
- /**
415
- * 根据名称查找 Skill
416
- */
417
- findSkillByName(name) {
418
- return Object.values(this.state.skills).find((s) => s.name === name);
419
- }
420
- /**
421
- * 合并已存在的 Skill
422
- */
423
- async mergeExistingSkill(existing, appId) {
424
- const canonicalAppId = appId === "claude" ? "claudecode" : appId;
425
- const merged = {
426
- ...existing,
427
- apps: { ...existing.apps, [canonicalAppId]: true, claude: false },
428
- };
429
- this.state.skills[existing.id] = merged;
430
- const source = skillSourceDir(this.paths.ssotSkillsDir, merged);
431
- await syncSkillToApps(merged, source, this.skillSyncMethod, this.skillAdapters);
432
- }
433
- /**
434
- * 创建新导入的 Skill
435
- */
436
- async createNewImportedSkill(imp, appId) {
437
- const withFlag = this.createSkillWithAppFlag(imp, appId);
438
- this.state.skills[withFlag.id] = withFlag;
439
- const source = skillSourceDir(this.paths.ssotSkillsDir, withFlag);
440
- await copyDir(imp.directory, source);
441
- await syncSkillToApps(withFlag, source, this.skillSyncMethod, this.skillAdapters);
442
- }
443
- /**
444
- * 创建带有应用标记的 Skill
445
- */
446
- createSkillWithAppFlag(imp, appId) {
447
- const canonicalAppId = appId === "claude" ? "claudecode" : appId;
448
- const now = Date.now();
449
- return {
450
- id: imp.id,
451
- name: imp.name,
452
- directory: imp.directory,
453
- description: imp.description,
454
- apps: {
455
- acode: false,
456
- claude: false,
457
- claudecode: false,
458
- codex: false,
459
- gemini: false,
460
- opencode: false,
461
- openclaw: false,
462
- [canonicalAppId]: true,
463
- },
464
- installedAt: now,
465
- };
466
- }
467
- getPaths() {
468
- return this.paths;
469
- }
470
- }
1
+ import y from"node:path";import{resolvePaths as g}from"./constants.js";import{loadState as A,saveState as v}from"./state.js";import{buildMcpFromInput as x,mergeMcp as M,applyMcpAppFlag as F}from"./services/mcp-model.js";import{syncMcpServerToApps as l}from"./services/mcp-service.js";import{buildSkillFromInput as N,mergeSkill as D,applySkillAppFlag as b,skillSourceDir as r}from"./services/skill-model.js";import{syncSkillToApps as n}from"./services/skill-service.js";import{copyDir as f,copyDirIfExists as B,copyFile as m,pathExists as d,removeIfExists as E}from"./utils/fs.js";import{SdkError as p}from"./errors.js";function k(u,e){const t=e==="claude"?"claudecode":e;return{...u,apps:{...u.apps,[t]:!0,claude:!1}}}class L{constructor(e){if(this.state={mcpServers:{},skills:{}},this.operationQueue=Promise.resolve(),!e.adapters?.mcp||!e.adapters?.skill)throw new p("ADAPTERS_REQUIRED","Adapters are required. Please provide mcp and skill adapters via options.adapters.",{hasMcp:!!e.adapters?.mcp,hasSkill:!!e.adapters?.skill});const t=g(e);this.paths=t.paths,this.skillSyncMethod=t.skillSyncMethod,this.mcpAdapters=e.adapters.mcp,this.skillAdapters=e.adapters.skill}async executeExclusive(e){const t=this.operationQueue;let s;this.operationQueue=new Promise(i=>{s=i}),await t;try{return await e()}finally{s()}}async load(){this.state=await A(this.paths.stateFile)}async save(){await v(this.paths.stateFile,this.state)}getAiConfigPath(e){if(e==="opencode")return this.paths.opencodeConfigFile;if(e==="claudecode")return this.paths.claudecodeConfigFile;if(e==="codex")return this.paths.codexConfigFile}getAiBackupPath(e){const t=e==="codex"?"toml":"json";return y.join(this.paths.backupDir,`${e}.config.backup.${t}`)}async backupAiConfigIfNeeded(e){const t=this.getAiConfigPath(e);if(!t)return;const s=this.getAiBackupPath(e);await d(s)||await d(t)&&await m(t,s)}async backupBeforeMcpSyncByApps(e){const t=["acode","opencode","claudecode","codex"];for(const s of t)e[s]&&await this.backupAiConfigIfNeeded(s)}async backupBeforeMcpSync(e){await this.backupBeforeMcpSyncByApps(e.apps)}async backupAiConfigs(e=["acode","opencode","claudecode","codex"]){for(const t of e)await this.backupAiConfigIfNeeded(t)}async restoreAiConfig(e){const t=this.getAiConfigPath(e);if(!t)return!1;const s=this.getAiBackupPath(e);return await d(s)?(await m(s,t),!0):!1}async restoreAiConfigs(e=["acode","opencode","claudecode","codex"]){const t={};for(const s of e)t[s]=await this.restoreAiConfig(s);return t}getAllMcpServers(){return Object.values(this.state.mcpServers)}getMcpServerById(e){return this.state.mcpServers[e]}async createMcpServer(e){return this.executeExclusive(async()=>{const t=x(e);return this.state.mcpServers[t.id]=t,await this.backupBeforeMcpSync(t),await l(t,this.mcpAdapters),await this.save(),t})}async updateMcpServer(e,t){return this.executeExclusive(async()=>{const s=this.state.mcpServers[e];if(!s)throw new p("MCP_NOT_FOUND",`MCP server not found: ${e}`,{id:e});const i=M(s,t);return this.state.mcpServers[e]=i,await this.backupBeforeMcpSync(i),await l(i,this.mcpAdapters),await this.save(),i})}async deleteMcpServer(e){return this.executeExclusive(async()=>{const t=this.state.mcpServers[e];if(!t)return;const s={...t,apps:{claude:!1,acode:!1,claudecode:!1,codex:!1,gemini:!1,opencode:!1,openclaw:!1}};await l(s,this.mcpAdapters),delete this.state.mcpServers[e],await this.save()})}async toggleMcpApp(e,t,s){return this.executeExclusive(async()=>{const i=this.state.mcpServers[e];if(!i)throw new p("MCP_NOT_FOUND",`MCP server not found: ${e}`,{serverId:e});const a=F(i,t,s);return this.state.mcpServers[e]=a,await this.backupBeforeMcpSyncByApps({[t]:s}),await l(a,this.mcpAdapters),await this.save(),a})}async importMcpFromApps(){return this.executeExclusive(async()=>{let e=0;const t=["claude","claudecode","opencode","codex","gemini","openclaw"];for(const s of t){const i=await this.mcpAdapters[s].importServers();for(const a of i){const c=this.findMcpServerByName(a.name);if(c){const h=k(c,s);this.state.mcpServers[c.id]=h;continue}const o=this.createMcpWithAppFlag(a,s);this.state.mcpServers[o.id]=o,e++}}return await this.save(),e})}async importMcpFromApp(e){let t=0;const s=await this.mcpAdapters[e].importServers();for(const i of s)await this.processImportedMcp(i,e)&&t++;return t}async processImportedMcp(e,t){const s=this.findMcpServerByName(e.name);if(s){const a=k(s,t);return this.state.mcpServers[s.id]=a,await l(a,this.mcpAdapters),!1}const i=this.createMcpWithAppFlag(e,t);return this.state.mcpServers[i.id]=i,await l(i,this.mcpAdapters),!0}findMcpServerByName(e){return Object.values(this.state.mcpServers).find(t=>t.name===e)}createMcpWithAppFlag(e,t){return{...e,apps:{acode:!1,claude:!1,claudecode:!1,codex:!1,gemini:!1,opencode:!1,openclaw:!1,[t==="claude"?"claudecode":t]:!0}}}getAllSkills(){return Object.values(this.state.skills)}getSkillById(e){return this.state.skills[e]}async installSkill(e){return this.executeExclusive(async()=>{const t=this.paths.ssotSkillsDir,s=N(e),i=r(t,s);return await f(e.sourceDir,i),this.state.skills[s.id]=s,await n(s,i,this.skillSyncMethod,this.skillAdapters),await this.save(),s})}async updateSkill(e,t){return this.executeExclusive(async()=>{const s=this.state.skills[e];if(!s)throw new p("SKILL_NOT_FOUND",`Skill not found: ${e}`,{id:e});const i=D(s,t);this.state.skills[e]=i;const a=r(this.paths.ssotSkillsDir,i);return await n(i,a,this.skillSyncMethod,this.skillAdapters),await this.save(),i})}async uninstallSkill(e){return this.executeExclusive(async()=>{const t=this.state.skills[e];if(!t)return;const s={...t,apps:{acode:!1,claude:!1,claudecode:!1,codex:!1,gemini:!1,opencode:!1,openclaw:!1}},i=r(this.paths.ssotSkillsDir,t);await n(s,i,this.skillSyncMethod,this.skillAdapters),delete this.state.skills[e];const a=r(this.paths.ssotSkillsDir,t);await E(a),await this.save()})}async toggleSkillApp(e,t,s){return this.executeExclusive(async()=>{const i=this.state.skills[e];if(!i)throw new p("SKILL_NOT_FOUND",`Skill not found: ${e}`,{skillId:e});const a=b(i,t,s);this.state.skills[e]=a;const c=r(this.paths.ssotSkillsDir,a);return await n(a,c,this.skillSyncMethod,this.skillAdapters),await this.save(),a})}async importSkillsFromApps(){return this.executeExclusive(async()=>{let e=0;const t=["claude","claudecode","opencode","codex","gemini","openclaw"];for(const s of t){const i=await this.skillAdapters[s].importSkills();for(const a of i){const c=this.findSkillByName(a.name);if(c){if(!await d(a.directory))continue;const S=s==="claude"?"claudecode":s,w={...c,apps:{...c.apps,[S]:!0,claude:!1}};this.state.skills[c.id]=w;continue}const o=this.createSkillWithAppFlag(a,s),h=r(this.paths.ssotSkillsDir,o);await B(a.directory,h)&&(this.state.skills[o.id]=o,e++)}}return await this.save(),e})}async importSkillsFromApp(e){let t=0;const s=await this.skillAdapters[e].importSkills();for(const i of s)await this.processImportedSkill(i,e)&&t++;return t}async processImportedSkill(e,t){const s=this.findSkillByName(e.name);return s?(await this.mergeExistingSkill(s,t),!1):(await this.createNewImportedSkill(e,t),!0)}findSkillByName(e){return Object.values(this.state.skills).find(t=>t.name===e)}async mergeExistingSkill(e,t){const s=t==="claude"?"claudecode":t,i={...e,apps:{...e.apps,[s]:!0,claude:!1}};this.state.skills[e.id]=i;const a=r(this.paths.ssotSkillsDir,i);await n(i,a,this.skillSyncMethod,this.skillAdapters)}async createNewImportedSkill(e,t){const s=this.createSkillWithAppFlag(e,t);this.state.skills[s.id]=s;const i=r(this.paths.ssotSkillsDir,s);await f(e.directory,i),await n(s,i,this.skillSyncMethod,this.skillAdapters)}createSkillWithAppFlag(e,t){const s=t==="claude"?"claudecode":t,i=Date.now();return{id:e.id,name:e.name,directory:e.directory,description:e.description,apps:{acode:!1,claude:!1,claudecode:!1,codex:!1,gemini:!1,opencode:!1,openclaw:!1,[s]:!0},installedAt:i}}getPaths(){return this.paths}}export{L as CcSwitchSdk};
2
+
@@ -79,4 +79,3 @@ export declare class AiConfigService {
79
79
  opencode: OpenCodeConfig;
80
80
  } | null>;
81
81
  }
82
- //# sourceMappingURL=ai-config-service.d.ts.map