runwork 0.15.0 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (403) hide show
  1. package/dist/index.js +19272 -116
  2. package/package.json +4 -4
  3. package/dist/__tests__/curl-parser.test.d.ts +0 -1
  4. package/dist/__tests__/curl-parser.test.js +0 -250
  5. package/dist/__tests__/install-scripts.test.d.ts +0 -1
  6. package/dist/__tests__/install-scripts.test.js +0 -280
  7. package/dist/__tests__/types-manager.test.d.ts +0 -1
  8. package/dist/__tests__/types-manager.test.js +0 -89
  9. package/dist/agents/__tests__/chatgpt-registry.test.d.ts +0 -1
  10. package/dist/agents/__tests__/chatgpt-registry.test.js +0 -61
  11. package/dist/agents/__tests__/claude-code-managed-block.test.d.ts +0 -1
  12. package/dist/agents/__tests__/claude-code-managed-block.test.js +0 -97
  13. package/dist/agents/__tests__/claude-code-plugin.test.d.ts +0 -1
  14. package/dist/agents/__tests__/claude-code-plugin.test.js +0 -47
  15. package/dist/agents/__tests__/claude-code-stats.test.d.ts +0 -1
  16. package/dist/agents/__tests__/claude-code-stats.test.js +0 -390
  17. package/dist/agents/__tests__/claude-desktop-memory.test.d.ts +0 -1
  18. package/dist/agents/__tests__/claude-desktop-memory.test.js +0 -154
  19. package/dist/agents/__tests__/claude-desktop-plugin-tree.test.d.ts +0 -1
  20. package/dist/agents/__tests__/claude-desktop-plugin-tree.test.js +0 -161
  21. package/dist/agents/__tests__/claude-desktop-plugin.test.d.ts +0 -1
  22. package/dist/agents/__tests__/claude-desktop-plugin.test.js +0 -117
  23. package/dist/agents/__tests__/claude-desktop-rpm.test.d.ts +0 -1
  24. package/dist/agents/__tests__/claude-desktop-rpm.test.js +0 -126
  25. package/dist/agents/__tests__/claude-desktop-stats.test.d.ts +0 -1
  26. package/dist/agents/__tests__/claude-desktop-stats.test.js +0 -280
  27. package/dist/agents/__tests__/codex-instructions.test.d.ts +0 -1
  28. package/dist/agents/__tests__/codex-instructions.test.js +0 -57
  29. package/dist/agents/__tests__/codex-minimum-permissions.test.d.ts +0 -1
  30. package/dist/agents/__tests__/codex-minimum-permissions.test.js +0 -82
  31. package/dist/agents/__tests__/codex-stats.test.d.ts +0 -1
  32. package/dist/agents/__tests__/codex-stats.test.js +0 -370
  33. package/dist/agents/__tests__/cursor-merge.test.d.ts +0 -1
  34. package/dist/agents/__tests__/cursor-merge.test.js +0 -66
  35. package/dist/agents/__tests__/cursor-stats.test.d.ts +0 -1
  36. package/dist/agents/__tests__/cursor-stats.test.js +0 -183
  37. package/dist/agents/__tests__/defaults-merge.test.d.ts +0 -1
  38. package/dist/agents/__tests__/defaults-merge.test.js +0 -268
  39. package/dist/agents/__tests__/detection.test.d.ts +0 -1
  40. package/dist/agents/__tests__/detection.test.js +0 -89
  41. package/dist/agents/__tests__/graceful-degradation.test.d.ts +0 -1
  42. package/dist/agents/__tests__/graceful-degradation.test.js +0 -129
  43. package/dist/agents/__tests__/instruction-hint.test.d.ts +0 -1
  44. package/dist/agents/__tests__/instruction-hint.test.js +0 -69
  45. package/dist/agents/__tests__/intro-skill.test.d.ts +0 -1
  46. package/dist/agents/__tests__/intro-skill.test.js +0 -193
  47. package/dist/agents/__tests__/schema-validation.test.d.ts +0 -1
  48. package/dist/agents/__tests__/schema-validation.test.js +0 -212
  49. package/dist/agents/__tests__/skill-slug.test.d.ts +0 -1
  50. package/dist/agents/__tests__/skill-slug.test.js +0 -77
  51. package/dist/agents/claude-code.d.ts +0 -53
  52. package/dist/agents/claude-code.js +0 -754
  53. package/dist/agents/claude-desktop-plugin-tree.d.ts +0 -59
  54. package/dist/agents/claude-desktop-plugin-tree.js +0 -143
  55. package/dist/agents/claude-desktop.d.ts +0 -47
  56. package/dist/agents/claude-desktop.js +0 -684
  57. package/dist/agents/cline.d.ts +0 -15
  58. package/dist/agents/cline.js +0 -130
  59. package/dist/agents/codex.d.ts +0 -44
  60. package/dist/agents/codex.js +0 -453
  61. package/dist/agents/conversation-skills.d.ts +0 -18
  62. package/dist/agents/conversation-skills.js +0 -229
  63. package/dist/agents/cursor.d.ts +0 -48
  64. package/dist/agents/cursor.js +0 -324
  65. package/dist/agents/default-config.d.ts +0 -30
  66. package/dist/agents/default-config.js +0 -67
  67. package/dist/agents/defaults-merge.d.ts +0 -72
  68. package/dist/agents/defaults-merge.js +0 -131
  69. package/dist/agents/detect.d.ts +0 -4
  70. package/dist/agents/detect.js +0 -67
  71. package/dist/agents/detection.d.ts +0 -18
  72. package/dist/agents/detection.js +0 -94
  73. package/dist/agents/gemini.d.ts +0 -15
  74. package/dist/agents/gemini.js +0 -122
  75. package/dist/agents/generic-adapter.d.ts +0 -25
  76. package/dist/agents/generic-adapter.js +0 -151
  77. package/dist/agents/intro-skill.d.ts +0 -45
  78. package/dist/agents/intro-skill.js +0 -447
  79. package/dist/agents/registry-data.d.ts +0 -192
  80. package/dist/agents/registry-data.js +0 -669
  81. package/dist/agents/registry.d.ts +0 -13
  82. package/dist/agents/registry.js +0 -36
  83. package/dist/agents/runtime-detection.d.ts +0 -82
  84. package/dist/agents/runtime-detection.js +0 -271
  85. package/dist/agents/session-start-hook.d.ts +0 -37
  86. package/dist/agents/session-start-hook.js +0 -159
  87. package/dist/agents/types.d.ts +0 -171
  88. package/dist/agents/types.js +0 -75
  89. package/dist/agents/utils/instruction-hint.d.ts +0 -21
  90. package/dist/agents/utils/instruction-hint.js +0 -108
  91. package/dist/agents/utils/json-config.d.ts +0 -19
  92. package/dist/agents/utils/json-config.js +0 -69
  93. package/dist/agents/utils/toml-config.d.ts +0 -8
  94. package/dist/agents/utils/toml-config.js +0 -27
  95. package/dist/agents/windsurf.d.ts +0 -14
  96. package/dist/agents/windsurf.js +0 -102
  97. package/dist/api/__tests__/client.test.d.ts +0 -1
  98. package/dist/api/__tests__/client.test.js +0 -272
  99. package/dist/api/client.d.ts +0 -326
  100. package/dist/api/client.js +0 -427
  101. package/dist/auth/__tests__/login-flow.test.d.ts +0 -1
  102. package/dist/auth/__tests__/login-flow.test.js +0 -101
  103. package/dist/auth/__tests__/store.test.d.ts +0 -1
  104. package/dist/auth/__tests__/store.test.js +0 -132
  105. package/dist/auth/login-flow.d.ts +0 -26
  106. package/dist/auth/login-flow.js +0 -137
  107. package/dist/auth/store.d.ts +0 -5
  108. package/dist/auth/store.js +0 -62
  109. package/dist/commands/__tests__/clone-args.test.d.ts +0 -1
  110. package/dist/commands/__tests__/clone-args.test.js +0 -51
  111. package/dist/commands/__tests__/clone-source-result.test.d.ts +0 -1
  112. package/dist/commands/__tests__/clone-source-result.test.js +0 -45
  113. package/dist/commands/__tests__/info-merge.test.d.ts +0 -1
  114. package/dist/commands/__tests__/info-merge.test.js +0 -55
  115. package/dist/commands/__tests__/mcp-entries.test.d.ts +0 -1
  116. package/dist/commands/__tests__/mcp-entries.test.js +0 -48
  117. package/dist/commands/__tests__/setup-persona.test.d.ts +0 -1
  118. package/dist/commands/__tests__/setup-persona.test.js +0 -31
  119. package/dist/commands/__tests__/setup.test.d.ts +0 -1
  120. package/dist/commands/__tests__/setup.test.js +0 -81
  121. package/dist/commands/__tests__/sync-redetect.test.d.ts +0 -1
  122. package/dist/commands/__tests__/sync-redetect.test.js +0 -96
  123. package/dist/commands/__tests__/sync-telemetry.test.d.ts +0 -1
  124. package/dist/commands/__tests__/sync-telemetry.test.js +0 -281
  125. package/dist/commands/__tests__/upgrade.test.d.ts +0 -1
  126. package/dist/commands/__tests__/upgrade.test.js +0 -157
  127. package/dist/commands/agents.d.ts +0 -2
  128. package/dist/commands/agents.js +0 -160
  129. package/dist/commands/api-keys.d.ts +0 -2
  130. package/dist/commands/api-keys.js +0 -95
  131. package/dist/commands/apps.d.ts +0 -2
  132. package/dist/commands/apps.js +0 -82
  133. package/dist/commands/build-plugin.d.ts +0 -2
  134. package/dist/commands/build-plugin.js +0 -135
  135. package/dist/commands/clone.d.ts +0 -60
  136. package/dist/commands/clone.js +0 -271
  137. package/dist/commands/components.d.ts +0 -2
  138. package/dist/commands/components.js +0 -43
  139. package/dist/commands/deploy.d.ts +0 -2
  140. package/dist/commands/deploy.js +0 -279
  141. package/dist/commands/dev.d.ts +0 -11
  142. package/dist/commands/dev.js +0 -1011
  143. package/dist/commands/doctor.d.ts +0 -2
  144. package/dist/commands/doctor.js +0 -230
  145. package/dist/commands/endpoints.d.ts +0 -2
  146. package/dist/commands/endpoints.js +0 -189
  147. package/dist/commands/entities.d.ts +0 -2
  148. package/dist/commands/entities.js +0 -198
  149. package/dist/commands/files.d.ts +0 -2
  150. package/dist/commands/files.js +0 -193
  151. package/dist/commands/inbox.d.ts +0 -11
  152. package/dist/commands/inbox.js +0 -60
  153. package/dist/commands/info.d.ts +0 -178
  154. package/dist/commands/info.js +0 -455
  155. package/dist/commands/init.d.ts +0 -21
  156. package/dist/commands/init.js +0 -185
  157. package/dist/commands/integrations.d.ts +0 -2
  158. package/dist/commands/integrations.js +0 -233
  159. package/dist/commands/login.d.ts +0 -2
  160. package/dist/commands/login.js +0 -44
  161. package/dist/commands/logout.d.ts +0 -2
  162. package/dist/commands/logout.js +0 -13
  163. package/dist/commands/logs.d.ts +0 -2
  164. package/dist/commands/logs.js +0 -232
  165. package/dist/commands/mcp-entries.d.ts +0 -13
  166. package/dist/commands/mcp-entries.js +0 -26
  167. package/dist/commands/mcp.d.ts +0 -2
  168. package/dist/commands/mcp.js +0 -245
  169. package/dist/commands/open.d.ts +0 -2
  170. package/dist/commands/open.js +0 -53
  171. package/dist/commands/resume.d.ts +0 -2
  172. package/dist/commands/resume.js +0 -289
  173. package/dist/commands/save-convo.d.ts +0 -8
  174. package/dist/commands/save-convo.js +0 -20
  175. package/dist/commands/schedules.d.ts +0 -2
  176. package/dist/commands/schedules.js +0 -221
  177. package/dist/commands/setup.d.ts +0 -27
  178. package/dist/commands/setup.js +0 -177
  179. package/dist/commands/share-convo.d.ts +0 -24
  180. package/dist/commands/share-convo.js +0 -167
  181. package/dist/commands/skills.d.ts +0 -2
  182. package/dist/commands/skills.js +0 -352
  183. package/dist/commands/sync-telemetry.d.ts +0 -33
  184. package/dist/commands/sync-telemetry.js +0 -186
  185. package/dist/commands/sync.d.ts +0 -37
  186. package/dist/commands/sync.js +0 -702
  187. package/dist/commands/uninstall.d.ts +0 -2
  188. package/dist/commands/uninstall.js +0 -145
  189. package/dist/commands/upgrade.d.ts +0 -14
  190. package/dist/commands/upgrade.js +0 -217
  191. package/dist/commands/validate.d.ts +0 -2
  192. package/dist/commands/validate.js +0 -89
  193. package/dist/commands/welcome.d.ts +0 -1
  194. package/dist/commands/welcome.js +0 -86
  195. package/dist/commands/workflows.d.ts +0 -2
  196. package/dist/commands/workflows.js +0 -187
  197. package/dist/deploy/__tests__/deploy-state.test.d.ts +0 -1
  198. package/dist/deploy/__tests__/deploy-state.test.js +0 -80
  199. package/dist/deploy/__tests__/deploy-status.test.d.ts +0 -1
  200. package/dist/deploy/__tests__/deploy-status.test.js +0 -41
  201. package/dist/deploy/__tests__/detach-args.test.d.ts +0 -1
  202. package/dist/deploy/__tests__/detach-args.test.js +0 -30
  203. package/dist/deploy/deploy-state.d.ts +0 -36
  204. package/dist/deploy/deploy-state.js +0 -63
  205. package/dist/deploy/deploy-status.d.ts +0 -21
  206. package/dist/deploy/deploy-status.js +0 -36
  207. package/dist/deploy/detach.d.ts +0 -32
  208. package/dist/deploy/detach.js +0 -71
  209. package/dist/dev/__tests__/attach.test.d.ts +0 -1
  210. package/dist/dev/__tests__/attach.test.js +0 -296
  211. package/dist/dev/__tests__/detach.test.d.ts +0 -1
  212. package/dist/dev/__tests__/detach.test.js +0 -404
  213. package/dist/dev/__tests__/preview-url-poller.test.d.ts +0 -1
  214. package/dist/dev/__tests__/preview-url-poller.test.js +0 -149
  215. package/dist/dev/__tests__/session.test.d.ts +0 -1
  216. package/dist/dev/__tests__/session.test.js +0 -446
  217. package/dist/dev/__tests__/startup-sync.test.d.ts +0 -1
  218. package/dist/dev/__tests__/startup-sync.test.js +0 -32
  219. package/dist/dev/__tests__/stop.test.d.ts +0 -1
  220. package/dist/dev/__tests__/stop.test.js +0 -172
  221. package/dist/dev/attach.d.ts +0 -120
  222. package/dist/dev/attach.js +0 -269
  223. package/dist/dev/detach.d.ts +0 -187
  224. package/dist/dev/detach.js +0 -292
  225. package/dist/dev/preview-url-poller.d.ts +0 -35
  226. package/dist/dev/preview-url-poller.js +0 -50
  227. package/dist/dev/session.d.ts +0 -175
  228. package/dist/dev/session.js +0 -258
  229. package/dist/dev/startup-sync.d.ts +0 -23
  230. package/dist/dev/startup-sync.js +0 -14
  231. package/dist/dev/stop.d.ts +0 -52
  232. package/dist/dev/stop.js +0 -101
  233. package/dist/devtools/registry-data.d.ts +0 -46
  234. package/dist/devtools/registry-data.js +0 -40
  235. package/dist/generated/bundled-types.d.ts +0 -1
  236. package/dist/generated/bundled-types.js +0 -46
  237. package/dist/generated/version.d.ts +0 -1
  238. package/dist/generated/version.js +0 -2
  239. package/dist/git/__tests__/auto-commit.test.d.ts +0 -1
  240. package/dist/git/__tests__/auto-commit.test.js +0 -431
  241. package/dist/git/__tests__/classify-sync-error.test.d.ts +0 -1
  242. package/dist/git/__tests__/classify-sync-error.test.js +0 -57
  243. package/dist/git/__tests__/credential-helper-e2e.test.d.ts +0 -21
  244. package/dist/git/__tests__/credential-helper-e2e.test.js +0 -195
  245. package/dist/git/__tests__/credentials.test.d.ts +0 -1
  246. package/dist/git/__tests__/credentials.test.js +0 -141
  247. package/dist/git/__tests__/deploy-guard.test.d.ts +0 -1
  248. package/dist/git/__tests__/deploy-guard.test.js +0 -61
  249. package/dist/git/__tests__/ensure-git-credential-helper.test.d.ts +0 -1
  250. package/dist/git/__tests__/ensure-git-credential-helper.test.js +0 -133
  251. package/dist/git/__tests__/ensure-runwork-remote.test.d.ts +0 -1
  252. package/dist/git/__tests__/ensure-runwork-remote.test.js +0 -109
  253. package/dist/git/__tests__/identity.test.d.ts +0 -1
  254. package/dist/git/__tests__/identity.test.js +0 -146
  255. package/dist/git/__tests__/manifest.test.d.ts +0 -1
  256. package/dist/git/__tests__/manifest.test.js +0 -446
  257. package/dist/git/__tests__/preflight-resolution.test.d.ts +0 -1
  258. package/dist/git/__tests__/preflight-resolution.test.js +0 -366
  259. package/dist/git/__tests__/preflight.test.d.ts +0 -1
  260. package/dist/git/__tests__/preflight.test.js +0 -36
  261. package/dist/git/__tests__/repo-config.test.d.ts +0 -1
  262. package/dist/git/__tests__/repo-config.test.js +0 -26
  263. package/dist/git/__tests__/sync.test.d.ts +0 -1
  264. package/dist/git/__tests__/sync.test.js +0 -405
  265. package/dist/git/auto-commit.d.ts +0 -35
  266. package/dist/git/auto-commit.js +0 -293
  267. package/dist/git/classify-sync-error.d.ts +0 -21
  268. package/dist/git/classify-sync-error.js +0 -111
  269. package/dist/git/credentials.d.ts +0 -75
  270. package/dist/git/credentials.js +0 -164
  271. package/dist/git/critical-files.d.ts +0 -20
  272. package/dist/git/critical-files.js +0 -68
  273. package/dist/git/deploy-guard.d.ts +0 -53
  274. package/dist/git/deploy-guard.js +0 -78
  275. package/dist/git/identity.d.ts +0 -44
  276. package/dist/git/identity.js +0 -133
  277. package/dist/git/preflight.d.ts +0 -57
  278. package/dist/git/preflight.js +0 -276
  279. package/dist/git/remote.d.ts +0 -37
  280. package/dist/git/remote.js +0 -75
  281. package/dist/git/repo-config.d.ts +0 -8
  282. package/dist/git/repo-config.js +0 -29
  283. package/dist/git/sync.d.ts +0 -15
  284. package/dist/git/sync.js +0 -159
  285. package/dist/health/__tests__/checks.test.d.ts +0 -1
  286. package/dist/health/__tests__/checks.test.js +0 -357
  287. package/dist/health/__tests__/cli-distribution-checks.test.d.ts +0 -1
  288. package/dist/health/__tests__/cli-distribution-checks.test.js +0 -196
  289. package/dist/health/__tests__/fix.test.d.ts +0 -1
  290. package/dist/health/__tests__/fix.test.js +0 -72
  291. package/dist/health/__tests__/runner-filter.test.d.ts +0 -1
  292. package/dist/health/__tests__/runner-filter.test.js +0 -61
  293. package/dist/health/checks.d.ts +0 -42
  294. package/dist/health/checks.js +0 -636
  295. package/dist/health/fix.d.ts +0 -22
  296. package/dist/health/fix.js +0 -62
  297. package/dist/health/runner.d.ts +0 -8
  298. package/dist/health/runner.js +0 -47
  299. package/dist/health/types.d.ts +0 -12
  300. package/dist/health/types.js +0 -1
  301. package/dist/index.d.ts +0 -1
  302. package/dist/logs/__tests__/tailer-format.test.d.ts +0 -1
  303. package/dist/logs/__tests__/tailer-format.test.js +0 -43
  304. package/dist/logs/tailer.d.ts +0 -17
  305. package/dist/logs/tailer.js +0 -217
  306. package/dist/sync/__tests__/change-detect.test.d.ts +0 -1
  307. package/dist/sync/__tests__/change-detect.test.js +0 -123
  308. package/dist/sync/__tests__/hash.test.d.ts +0 -1
  309. package/dist/sync/__tests__/hash.test.js +0 -18
  310. package/dist/sync/change-detect.d.ts +0 -19
  311. package/dist/sync/change-detect.js +0 -136
  312. package/dist/sync/conflict-ui.d.ts +0 -5
  313. package/dist/sync/conflict-ui.js +0 -78
  314. package/dist/sync/executor.d.ts +0 -23
  315. package/dist/sync/executor.js +0 -102
  316. package/dist/sync/hash.d.ts +0 -1
  317. package/dist/sync/hash.js +0 -4
  318. package/dist/sync/types.d.ts +0 -24
  319. package/dist/sync/types.js +0 -1
  320. package/dist/template/manifest.d.ts +0 -17
  321. package/dist/template/manifest.js +0 -145
  322. package/dist/tools/types.d.ts +0 -52
  323. package/dist/tools/types.js +0 -8
  324. package/dist/types-manager.d.ts +0 -1
  325. package/dist/types-manager.js +0 -35
  326. package/dist/types.d.ts +0 -349
  327. package/dist/types.js +0 -1
  328. package/dist/ui/__tests__/banner.test.d.ts +0 -1
  329. package/dist/ui/__tests__/banner.test.js +0 -98
  330. package/dist/ui/__tests__/colors.test.d.ts +0 -1
  331. package/dist/ui/__tests__/colors.test.js +0 -22
  332. package/dist/ui/__tests__/keyboard.test.d.ts +0 -1
  333. package/dist/ui/__tests__/keyboard.test.js +0 -34
  334. package/dist/ui/__tests__/status-line.test.d.ts +0 -1
  335. package/dist/ui/__tests__/status-line.test.js +0 -54
  336. package/dist/ui/banner.d.ts +0 -29
  337. package/dist/ui/banner.js +0 -153
  338. package/dist/ui/colors.d.ts +0 -4
  339. package/dist/ui/colors.js +0 -7
  340. package/dist/ui/keyboard.d.ts +0 -12
  341. package/dist/ui/keyboard.js +0 -61
  342. package/dist/ui/status-line.d.ts +0 -6
  343. package/dist/ui/status-line.js +0 -53
  344. package/dist/utils/__tests__/format-error.test.d.ts +0 -1
  345. package/dist/utils/__tests__/format-error.test.js +0 -43
  346. package/dist/utils/__tests__/help-json.test.d.ts +0 -1
  347. package/dist/utils/__tests__/help-json.test.js +0 -39
  348. package/dist/utils/__tests__/http.test.d.ts +0 -1
  349. package/dist/utils/__tests__/http.test.js +0 -381
  350. package/dist/utils/__tests__/ignore-matcher.test.d.ts +0 -1
  351. package/dist/utils/__tests__/ignore-matcher.test.js +0 -205
  352. package/dist/utils/__tests__/output.test.d.ts +0 -1
  353. package/dist/utils/__tests__/output.test.js +0 -38
  354. package/dist/utils/__tests__/prompt.test.d.ts +0 -1
  355. package/dist/utils/__tests__/prompt.test.js +0 -27
  356. package/dist/utils/__tests__/resolve.test.d.ts +0 -1
  357. package/dist/utils/__tests__/resolve.test.js +0 -95
  358. package/dist/utils/__tests__/sqlite.test.d.ts +0 -1
  359. package/dist/utils/__tests__/sqlite.test.js +0 -89
  360. package/dist/utils/agent-guidance.d.ts +0 -47
  361. package/dist/utils/agent-guidance.js +0 -128
  362. package/dist/utils/app-info.d.ts +0 -70
  363. package/dist/utils/app-info.js +0 -167
  364. package/dist/utils/curl-parser.d.ts +0 -12
  365. package/dist/utils/curl-parser.js +0 -162
  366. package/dist/utils/data-input.d.ts +0 -1
  367. package/dist/utils/data-input.js +0 -38
  368. package/dist/utils/format-error.d.ts +0 -10
  369. package/dist/utils/format-error.js +0 -38
  370. package/dist/utils/fs.d.ts +0 -5
  371. package/dist/utils/fs.js +0 -23
  372. package/dist/utils/help-json.d.ts +0 -70
  373. package/dist/utils/help-json.js +0 -88
  374. package/dist/utils/http.d.ts +0 -46
  375. package/dist/utils/http.js +0 -421
  376. package/dist/utils/ignore-matcher.d.ts +0 -47
  377. package/dist/utils/ignore-matcher.js +0 -132
  378. package/dist/utils/output.d.ts +0 -17
  379. package/dist/utils/output.js +0 -27
  380. package/dist/utils/prompt.d.ts +0 -5
  381. package/dist/utils/prompt.js +0 -42
  382. package/dist/utils/resolve.d.ts +0 -12
  383. package/dist/utils/resolve.js +0 -52
  384. package/dist/utils/setup-state.d.ts +0 -3
  385. package/dist/utils/setup-state.js +0 -19
  386. package/dist/utils/sqlite-adapter.d.ts +0 -48
  387. package/dist/utils/sqlite-adapter.js +0 -147
  388. package/dist/utils/sqlite.d.ts +0 -14
  389. package/dist/utils/sqlite.js +0 -14
  390. package/dist/utils/subprocess.d.ts +0 -19
  391. package/dist/utils/subprocess.js +0 -27
  392. package/dist/utils/which.d.ts +0 -14
  393. package/dist/utils/which.js +0 -47
  394. package/dist/utils/zip.d.ts +0 -7
  395. package/dist/utils/zip.js +0 -42
  396. package/dist/validate/__tests__/validate.test.d.ts +0 -1
  397. package/dist/validate/__tests__/validate.test.js +0 -42
  398. package/dist/validate/freshness.d.ts +0 -28
  399. package/dist/validate/freshness.js +0 -48
  400. package/dist/validate/preview.d.ts +0 -21
  401. package/dist/validate/preview.js +0 -39
  402. package/dist/workspace/resolve.d.ts +0 -19
  403. package/dist/workspace/resolve.js +0 -100
@@ -1,67 +0,0 @@
1
- /**
2
- * Baked-in default permission rules that `runwork sync` injects into each
3
- * supported agent's configuration.
4
- *
5
- * Defaults are user-scope only. They merge with team-managed rules from the
6
- * workspace admin and are tracked in `~/.runwork/setup.json` under
7
- * `agentDefaults[slug]` so that:
8
- * 1. Removals stick: if a user deletes an injected entry, it never returns.
9
- * 2. Newly added defaults flow in: CLI upgrades that ship more defaults
10
- * auto-apply on the next sync.
11
- * 3. Removed defaults disappear: shrinking the set here also removes the
12
- * entries from users' on-disk config on next sync.
13
- * 4. Tool removal resets state: `runwork agents remove <slug>` clears the
14
- * per-agent state, so re-adding the tool starts from a clean bootstrap.
15
- *
16
- * Only agents whose permission model maps cleanly to command-pattern allow/deny
17
- * lists appear here. Codex, Gemini, Cline, and Claude Desktop are intentionally
18
- * absent (their config formats are toggle-based or tool-name-based and do not
19
- * fit). Network domain allowlisting for those agents is handled separately via
20
- * AgentConfigOverride.networkAllowlist in sync.ts.
21
- */
22
- export const RUNWORK_AGENT_DEFAULTS = {
23
- 'claude-code': {
24
- allow: [
25
- 'Bash(runwork *)',
26
- 'Bash(runwork-cli *)',
27
- 'Bash(git status)',
28
- 'Bash(git diff:*)',
29
- 'Bash(git log:*)',
30
- 'Bash(git branch:*)',
31
- 'Bash(git show:*)',
32
- 'Bash(ls:*)',
33
- 'Bash(pwd)',
34
- 'Bash(cat:*)',
35
- ],
36
- deny: [
37
- 'Bash(rm -rf *)',
38
- 'Bash(rm -rf /*)',
39
- 'Bash(sudo rm *)',
40
- ],
41
- },
42
- 'cursor': {
43
- allow: [
44
- 'runwork',
45
- 'runwork *',
46
- 'runwork-cli',
47
- 'runwork-cli *',
48
- 'git status',
49
- 'git diff',
50
- 'git log',
51
- 'git branch',
52
- 'ls',
53
- 'pwd',
54
- 'cat',
55
- ],
56
- deny: [
57
- 'rm -rf *',
58
- 'sudo *',
59
- ],
60
- },
61
- };
62
- /** Schema version recorded in setup.json. Bump when default-injection semantics change. */
63
- export const AGENT_DEFAULTS_SCHEMA_VERSION = 1;
64
- /** Slugs that have baked-in defaults. */
65
- export function hasBakedDefaults(slug) {
66
- return slug in RUNWORK_AGENT_DEFAULTS;
67
- }
@@ -1,72 +0,0 @@
1
- /**
2
- * Pure functions for the default-rules merge algorithm.
3
- *
4
- * The sync loop (commands/sync.ts) wires these together with per-adapter I/O.
5
- * Keeping the logic side-effect-free here makes it cheap to unit-test the
6
- * tricky lifecycle (bootstrap, opt-out detection, set shrinking) without
7
- * mocking filesystem layers.
8
- */
9
- import type { AgentDefaultsState } from '../types.js';
10
- import type { BakedDefaults } from './default-config.js';
11
- /** Items present in `lastInjected` but not in `onDisk`. These are entries the user removed since the previous sync. */
12
- export declare function detectRemovals(lastInjected: string[], onDisk: string[]): string[];
13
- /** Defaults filtered to exclude anything the user has opted out of. */
14
- export declare function computeApplicable(baked: string[], optOuts: string[]): string[];
15
- /**
16
- * Dedupe-silently merge of defaults and team rules. Team rules appear after
17
- * defaults in the output (the marker block's team-managed half), and dedupe
18
- * keeps the team-positioned copy when a default and a team rule are identical
19
- * strings. Stable ordering is preserved.
20
- */
21
- export declare function mergeAllow(applicableDefaults: string[], teamRules: string[]): string[];
22
- export declare function unique(items: string[]): string[];
23
- /** True if no per-agent state has ever been recorded — first sync after upgrade or fresh install. */
24
- export declare function isBootstrap(state: AgentDefaultsState | undefined): boolean;
25
- export interface ResolveResult {
26
- /**
27
- * Final merged list to write into the managed block.
28
- * For marker-based agents (Claude Code): goes after the marker.
29
- * For markerless agents (Cursor): becomes part of the array,
30
- * with `baseline` used by the adapter to identify and preserve user entries.
31
- */
32
- managedAllow: string[];
33
- managedDeny: string[];
34
- /** Defaults that we actually injected this sync. Stored as next sync's lastInjected. */
35
- applicableAllow: string[];
36
- applicableDeny: string[];
37
- /** New sticky opt-out set. Stored as next sync's userOptOuts. */
38
- newOptOutsAllow: string[];
39
- newOptOutsDeny: string[];
40
- /** Diagnostic counts for the sync log. */
41
- removalsThisSync: {
42
- allow: number;
43
- deny: number;
44
- };
45
- /** True when this sync is the bootstrap pass and skipped default injection. */
46
- bootstrapped: boolean;
47
- }
48
- export interface ResolveInput {
49
- baked: BakedDefaults | undefined;
50
- state: AgentDefaultsState | undefined;
51
- onDisk: {
52
- allow?: string[];
53
- deny?: string[];
54
- } | undefined;
55
- team: {
56
- allow?: string[];
57
- deny?: string[];
58
- } | undefined;
59
- }
60
- /**
61
- * Single-call resolver for one agent. Consumes the full input set and emits
62
- * the merged managed lists plus the next-sync state values. Pure: no I/O.
63
- *
64
- * Cases:
65
- * 1. No baked defaults for this agent → emits team rules only (no defaults
66
- * logic kicks in). State stays undefined.
67
- * 2. Bootstrap (state undefined) → applies team rules but does NOT inject
68
- * defaults this sync. Caller initializes empty state for next time.
69
- * 3. Normal → detects removals against lastInjected, accumulates opt-outs,
70
- * filters baked by opt-outs, merges with team rules.
71
- */
72
- export declare function resolveAgentDefaults(input: ResolveInput): ResolveResult;
@@ -1,131 +0,0 @@
1
- /**
2
- * Pure functions for the default-rules merge algorithm.
3
- *
4
- * The sync loop (commands/sync.ts) wires these together with per-adapter I/O.
5
- * Keeping the logic side-effect-free here makes it cheap to unit-test the
6
- * tricky lifecycle (bootstrap, opt-out detection, set shrinking) without
7
- * mocking filesystem layers.
8
- */
9
- /** Items present in `lastInjected` but not in `onDisk`. These are entries the user removed since the previous sync. */
10
- export function detectRemovals(lastInjected, onDisk) {
11
- const onDiskSet = new Set(onDisk);
12
- return lastInjected.filter((item) => !onDiskSet.has(item));
13
- }
14
- /** Defaults filtered to exclude anything the user has opted out of. */
15
- export function computeApplicable(baked, optOuts) {
16
- const optOutSet = new Set(optOuts);
17
- return baked.filter((item) => !optOutSet.has(item));
18
- }
19
- /**
20
- * Dedupe-silently merge of defaults and team rules. Team rules appear after
21
- * defaults in the output (the marker block's team-managed half), and dedupe
22
- * keeps the team-positioned copy when a default and a team rule are identical
23
- * strings. Stable ordering is preserved.
24
- */
25
- export function mergeAllow(applicableDefaults, teamRules) {
26
- const teamSet = new Set(teamRules);
27
- const result = [];
28
- for (const item of applicableDefaults) {
29
- if (!teamSet.has(item))
30
- result.push(item);
31
- }
32
- for (const item of teamRules) {
33
- result.push(item);
34
- }
35
- return result;
36
- }
37
- export function unique(items) {
38
- const seen = new Set();
39
- const out = [];
40
- for (const item of items) {
41
- if (!seen.has(item)) {
42
- seen.add(item);
43
- out.push(item);
44
- }
45
- }
46
- return out;
47
- }
48
- /** True if no per-agent state has ever been recorded — first sync after upgrade or fresh install. */
49
- export function isBootstrap(state) {
50
- return state === undefined;
51
- }
52
- /**
53
- * Single-call resolver for one agent. Consumes the full input set and emits
54
- * the merged managed lists plus the next-sync state values. Pure: no I/O.
55
- *
56
- * Cases:
57
- * 1. No baked defaults for this agent → emits team rules only (no defaults
58
- * logic kicks in). State stays undefined.
59
- * 2. Bootstrap (state undefined) → applies team rules but does NOT inject
60
- * defaults this sync. Caller initializes empty state for next time.
61
- * 3. Normal → detects removals against lastInjected, accumulates opt-outs,
62
- * filters baked by opt-outs, merges with team rules.
63
- */
64
- export function resolveAgentDefaults(input) {
65
- const team = input.team ?? {};
66
- const teamAllow = team.allow ?? [];
67
- const teamDeny = team.deny ?? [];
68
- // Case 1: no baked defaults — emit team rules unchanged, no state to track.
69
- if (!input.baked) {
70
- return {
71
- managedAllow: unique(teamAllow),
72
- managedDeny: unique(teamDeny),
73
- applicableAllow: [],
74
- applicableDeny: [],
75
- newOptOutsAllow: [],
76
- newOptOutsDeny: [],
77
- removalsThisSync: { allow: 0, deny: 0 },
78
- bootstrapped: false,
79
- };
80
- }
81
- // Case 2: bootstrap — do not inject defaults this pass.
82
- if (isBootstrap(input.state)) {
83
- return {
84
- managedAllow: unique(teamAllow),
85
- managedDeny: unique(teamDeny),
86
- applicableAllow: [],
87
- applicableDeny: [],
88
- newOptOutsAllow: [],
89
- newOptOutsDeny: [],
90
- removalsThisSync: { allow: 0, deny: 0 },
91
- bootstrapped: true,
92
- };
93
- }
94
- // Case 3: normal merge.
95
- const state = input.state;
96
- const lastInjectedAllow = state.lastInjected.allow ?? [];
97
- const lastInjectedDeny = state.lastInjected.deny ?? [];
98
- const existingOptOutsAllow = state.userOptOuts.allow ?? [];
99
- const existingOptOutsDeny = state.userOptOuts.deny ?? [];
100
- // Removal detection requires a reliable on-disk read. Markerless adapters
101
- // (Cursor) cannot distinguish injected entries from user entries on disk, so
102
- // they return `undefined` from readManagedBlock. Treating `undefined` as an
103
- // empty array would fabricate a "user removed everything" signal on every
104
- // subsequent sync and incorrectly convert every default into a sticky opt-out.
105
- // When we cannot read managed state, we trust the baseline mechanism in the
106
- // adapter and skip removal detection for this sync.
107
- const canDetectRemovals = input.onDisk !== undefined;
108
- const newRemovalsAllow = canDetectRemovals
109
- ? detectRemovals(lastInjectedAllow, input.onDisk?.allow ?? [])
110
- : [];
111
- const newRemovalsDeny = canDetectRemovals
112
- ? detectRemovals(lastInjectedDeny, input.onDisk?.deny ?? [])
113
- : [];
114
- const newOptOutsAllow = unique([...existingOptOutsAllow, ...newRemovalsAllow]);
115
- const newOptOutsDeny = unique([...existingOptOutsDeny, ...newRemovalsDeny]);
116
- const applicableAllow = computeApplicable(input.baked.allow, newOptOutsAllow);
117
- const applicableDeny = computeApplicable(input.baked.deny, newOptOutsDeny);
118
- return {
119
- managedAllow: mergeAllow(applicableAllow, teamAllow),
120
- managedDeny: mergeAllow(applicableDeny, teamDeny),
121
- applicableAllow,
122
- applicableDeny,
123
- newOptOutsAllow,
124
- newOptOutsDeny,
125
- removalsThisSync: {
126
- allow: newRemovalsAllow.length,
127
- deny: newRemovalsDeny.length,
128
- },
129
- bootstrapped: false,
130
- };
131
- }
@@ -1,4 +0,0 @@
1
- import type { AgentAdapter } from './types.js';
2
- export declare function detectAgents(): Promise<AgentAdapter[]>;
3
- export declare function getAdapterBySlug(slug: string): AgentAdapter | undefined;
4
- export declare function printNoAgentsMessage(): void;
@@ -1,67 +0,0 @@
1
- import { ClaudeCodeAdapter } from './claude-code.js';
2
- import { ClaudeDesktopAdapter } from './claude-desktop.js';
3
- import { CursorAdapter } from './cursor.js';
4
- import { WindsurfAdapter } from './windsurf.js';
5
- import { CodexAdapter, CodexDesktopAdapter } from './codex.js';
6
- import { ClineAdapter } from './cline.js';
7
- import { GeminiAdapter } from './gemini.js';
8
- import { GenericAgentAdapter } from './generic-adapter.js';
9
- import { getRegistryAgents, getCustomAdapterSlugs } from './registry.js';
10
- /**
11
- * Agents with custom adapter implementations (plugin systems, special formats).
12
- * These override the generic adapter for their slug.
13
- */
14
- const CUSTOM_ADAPTERS = [
15
- new ClaudeCodeAdapter(),
16
- new ClaudeDesktopAdapter(),
17
- new CursorAdapter(),
18
- new WindsurfAdapter(),
19
- new CodexAdapter(),
20
- new CodexDesktopAdapter(),
21
- new ClineAdapter(),
22
- new GeminiAdapter(),
23
- ];
24
- const customSlugs = getCustomAdapterSlugs();
25
- const customMap = new Map(CUSTOM_ADAPTERS.map(a => [a.slug, a]));
26
- /**
27
- * Build the full list of adapters: custom adapters for special agents,
28
- * generic adapters for everything else in the registry.
29
- */
30
- function buildAllAdapters() {
31
- const adapters = [...CUSTOM_ADAPTERS];
32
- for (const def of getRegistryAgents()) {
33
- if (customSlugs.has(def.slug))
34
- continue;
35
- adapters.push(new GenericAgentAdapter(def));
36
- }
37
- return adapters;
38
- }
39
- const ALL_ADAPTERS = buildAllAdapters();
40
- export async function detectAgents() {
41
- const results = await Promise.all(ALL_ADAPTERS.map(async (adapter) => {
42
- try {
43
- const detected = await adapter.detect();
44
- return detected ? adapter : null;
45
- }
46
- catch {
47
- return null;
48
- }
49
- }));
50
- return results.filter((a) => a !== null);
51
- }
52
- export function getAdapterBySlug(slug) {
53
- // Check custom adapters first, then fall back to generic
54
- if (customMap.has(slug))
55
- return customMap.get(slug);
56
- return ALL_ADAPTERS.find(a => a.slug === slug);
57
- }
58
- export function printNoAgentsMessage() {
59
- console.log('No supported AI coding agents detected.\n');
60
- console.log('Install one to get started:\n');
61
- console.log(' Claude Code: npm i -g @anthropic-ai/claude-code');
62
- console.log(' Cursor: https://cursor.com');
63
- console.log(' Codex CLI: npm i -g @openai/codex');
64
- console.log(' Gemini CLI: https://github.com/google-gemini/gemini-cli');
65
- console.log(' Windsurf: https://windsurf.com');
66
- console.log('');
67
- }
@@ -1,18 +0,0 @@
1
- /**
2
- * Shared agent-installation detection used by the generic adapter and by
3
- * custom adapters that opt in to the registry's declared detection rules
4
- * (e.g. Codex Desktop, which detects via `/Applications/Codex.app` on macOS
5
- * and the AppX package on Windows rather than a `codex` binary on PATH).
6
- *
7
- * Mirrors the desktop's agent-detection.ts logic but uses Node APIs instead
8
- * of Tauri plugins.
9
- */
10
- import type { AgentDetection } from './registry-data.js';
11
- /**
12
- * Detection — returns true when the agent is installed according to its
13
- * registry `detection` rules. Supports `binary`, `path`, `windows-appx`,
14
- * `windows-start-app`, and nested `any` combinators. PowerShell-backed
15
- * Windows probes run in parallel so a multi-target `any { windows-appx }`
16
- * pays one PowerShell startup, not N.
17
- */
18
- export declare function runAgentDetection(detection: AgentDetection): Promise<boolean>;
@@ -1,94 +0,0 @@
1
- /**
2
- * Shared agent-installation detection used by the generic adapter and by
3
- * custom adapters that opt in to the registry's declared detection rules
4
- * (e.g. Codex Desktop, which detects via `/Applications/Codex.app` on macOS
5
- * and the AppX package on Windows rather than a `codex` binary on PATH).
6
- *
7
- * Mirrors the desktop's agent-detection.ts logic but uses Node APIs instead
8
- * of Tauri plugins.
9
- */
10
- import { execFile } from 'child_process';
11
- import { existsSync } from 'fs';
12
- import { homedir, platform } from 'os';
13
- import { isAbsolute, join } from 'path';
14
- import { promisify } from 'util';
15
- import { whichBinary } from '../utils/which.js';
16
- import { resolvePlatformString } from './registry.js';
17
- const execFileAsync = promisify(execFile);
18
- function isWindows() {
19
- return platform() === 'win32';
20
- }
21
- function powershellQuote(value) {
22
- return `'${value.replace(/'/g, "''")}'`;
23
- }
24
- function toList(value) {
25
- return Array.isArray(value) ? value : [value];
26
- }
27
- async function runPowerShell(script) {
28
- try {
29
- await execFileAsync('powershell', ['-NoProfile', '-Command', script]);
30
- return true;
31
- }
32
- catch {
33
- return false;
34
- }
35
- }
36
- function checkPath(target) {
37
- const resolved = resolvePlatformString(target);
38
- if (!resolved)
39
- return false;
40
- if (isAbsolute(resolved))
41
- return existsSync(resolved);
42
- return existsSync(join(homedir(), resolved));
43
- }
44
- async function checkWindowsAppxPackage(target) {
45
- if (!isWindows())
46
- return false;
47
- // Probe all candidate package names in parallel; resolve true on first hit.
48
- const probes = toList(target).map((pkg) => {
49
- const script = `$p = Get-AppxPackage -Name ${powershellQuote(pkg)} -ErrorAction SilentlyContinue; if ($null -ne $p) { exit 0 } exit 1`;
50
- return runPowerShell(script);
51
- });
52
- const results = await Promise.all(probes);
53
- return results.some(Boolean);
54
- }
55
- async function checkWindowsStartApp(target) {
56
- if (!isWindows())
57
- return false;
58
- const probes = toList(target).map((pattern) => {
59
- const script = `$a = Get-StartApps -Name ${powershellQuote(pattern)} -ErrorAction SilentlyContinue | Select-Object -First 1; if ($null -ne $a) { exit 0 } exit 1`;
60
- return runPowerShell(script);
61
- });
62
- const results = await Promise.all(probes);
63
- return results.some(Boolean);
64
- }
65
- /**
66
- * Detection — returns true when the agent is installed according to its
67
- * registry `detection` rules. Supports `binary`, `path`, `windows-appx`,
68
- * `windows-start-app`, and nested `any` combinators. PowerShell-backed
69
- * Windows probes run in parallel so a multi-target `any { windows-appx }`
70
- * pays one PowerShell startup, not N.
71
- */
72
- export async function runAgentDetection(detection) {
73
- switch (detection.method) {
74
- case 'binary': {
75
- const target = resolvePlatformString(detection.target);
76
- return !!target && !!whichBinary(target);
77
- }
78
- case 'path':
79
- return checkPath(detection.target);
80
- case 'windows-appx':
81
- return checkWindowsAppxPackage(detection.target);
82
- case 'windows-start-app':
83
- return checkWindowsStartApp(detection.target);
84
- case 'any': {
85
- const probes = await Promise.all(detection.target.map((p) => runAgentDetection(p)));
86
- return probes.some(Boolean);
87
- }
88
- case 'always':
89
- // Web-only agents have no local footprint; always treated as available.
90
- return true;
91
- default:
92
- return false;
93
- }
94
- }
@@ -1,15 +0,0 @@
1
- import type { AgentAdapter, AgentConfigOverride, CleanupManifest, McpServerEntry, SkillFile } from './types.js';
2
- export declare class GeminiAdapter implements AgentAdapter {
3
- name: string;
4
- slug: string;
5
- mcpProvidesSkills: boolean;
6
- detect(): Promise<boolean>;
7
- supportsMcpScope(scope: 'project' | 'user'): boolean;
8
- supportsSkills(): boolean;
9
- writeMcpServers(servers: McpServerEntry[], _scope: 'project' | 'user'): Promise<void>;
10
- writeSkills(skills: SkillFile[], scope: 'project' | 'user'): Promise<void>;
11
- writeInstructionHint(hint: string, scope: 'project' | 'user'): Promise<void>;
12
- writeTeamInstructions(instructions: string, scope: 'project' | 'user'): Promise<void>;
13
- writeAgentConfig(config: AgentConfigOverride, scope: 'project' | 'user'): Promise<void>;
14
- cleanup(scope: 'project' | 'user', manifest?: CleanupManifest): Promise<void>;
15
- }
@@ -1,122 +0,0 @@
1
- import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'fs';
2
- import { join } from 'path';
3
- import { homedir } from 'os';
4
- import { whichBinary } from '../utils/which.js';
5
- import { buildSkillMd } from './types.js';
6
- import { writeHintToFile, writeTeamInstructionsToFile, removeHintFromFile, removeTeamInstructionsFromFile } from './utils/instruction-hint.js';
7
- import { mergeJsonMcpServers, removeRunworkMcpServers } from './utils/json-config.js';
8
- export class GeminiAdapter {
9
- name = 'Gemini CLI';
10
- slug = 'gemini';
11
- mcpProvidesSkills = true;
12
- async detect() {
13
- return !!whichBinary('gemini');
14
- }
15
- supportsMcpScope(scope) {
16
- return scope === 'user';
17
- }
18
- supportsSkills() {
19
- return true;
20
- }
21
- async writeMcpServers(servers, _scope) {
22
- const configPath = join(homedir(), '.gemini', 'settings.json');
23
- const entries = {};
24
- for (const s of servers) {
25
- entries[s.name] = {
26
- url: s.url,
27
- ...(s.headers ? { headers: s.headers } : {}),
28
- };
29
- }
30
- mergeJsonMcpServers(configPath, entries, 'mcpServers');
31
- }
32
- async writeSkills(skills, scope) {
33
- const baseDir = scope === 'project'
34
- ? join(process.cwd(), '.gemini', 'skills')
35
- : join(homedir(), '.gemini', 'skills');
36
- for (const skill of skills) {
37
- if (skill.name !== skill.filename) {
38
- const oldDir = join(baseDir, skill.name);
39
- if (existsSync(oldDir)) {
40
- try {
41
- rmSync(oldDir, { recursive: true, force: true });
42
- }
43
- catch { /* best-effort */ }
44
- }
45
- }
46
- const skillDir = join(baseDir, skill.filename);
47
- mkdirSync(skillDir, { recursive: true });
48
- writeFileSync(join(skillDir, 'SKILL.md'), buildSkillMd(skill));
49
- }
50
- }
51
- async writeInstructionHint(hint, scope) {
52
- const filePath = scope === 'project'
53
- ? join(process.cwd(), 'GEMINI.md')
54
- : join(homedir(), '.gemini', 'GEMINI.md');
55
- writeHintToFile(filePath, hint);
56
- }
57
- async writeTeamInstructions(instructions, scope) {
58
- const filePath = scope === 'project'
59
- ? join(process.cwd(), 'GEMINI.md')
60
- : join(homedir(), '.gemini', 'GEMINI.md');
61
- writeTeamInstructionsToFile(filePath, instructions);
62
- }
63
- // ── Agent config (settings.json) ──────────────────────────────────
64
- async writeAgentConfig(config, scope) {
65
- const settingsPath = scope === 'project'
66
- ? join(process.cwd(), '.gemini', 'settings.json')
67
- : join(homedir(), '.gemini', 'settings.json');
68
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
69
- let settings = {};
70
- if (existsSync(settingsPath)) {
71
- try {
72
- settings = JSON.parse(readFileSync(settingsPath, 'utf-8'));
73
- }
74
- catch { /* start fresh */ }
75
- }
76
- if (config.modelPreference) {
77
- if (!settings.model)
78
- settings.model = {};
79
- settings.model.name = config.modelPreference;
80
- }
81
- if (config.permissionRules?.allow) {
82
- if (!settings.tools)
83
- settings.tools = {};
84
- settings.tools.allowed = config.permissionRules.allow;
85
- }
86
- if (config.permissionRules?.deny) {
87
- if (!settings.tools)
88
- settings.tools = {};
89
- settings.tools.exclude = config.permissionRules.deny;
90
- }
91
- mkdirSync(join(settingsPath, '..'), { recursive: true });
92
- writeFileSync(settingsPath, JSON.stringify(settings, null, 2));
93
- }
94
- // ── Cleanup (uninstall) ────────────────────────────────────────────
95
- async cleanup(scope, manifest) {
96
- // 1. Remove MCP entries (user scope only)
97
- if (scope === 'user') {
98
- removeRunworkMcpServers(join(homedir(), '.gemini', 'settings.json'), 'mcpServers');
99
- }
100
- // 2. Remove only skill directories that we synced (listed in manifest)
101
- const skillsDir = scope === 'project'
102
- ? join(process.cwd(), '.gemini', 'skills')
103
- : join(homedir(), '.gemini', 'skills');
104
- if (existsSync(skillsDir) && manifest?.skillFilenames.length) {
105
- const allowed = new Set(manifest.skillFilenames);
106
- for (const entry of readdirSync(skillsDir)) {
107
- if (!allowed.has(entry))
108
- continue;
109
- try {
110
- rmSync(join(skillsDir, entry), { recursive: true, force: true });
111
- }
112
- catch { /* best-effort */ }
113
- }
114
- }
115
- // 3. Remove instruction hints and team instructions
116
- const instructionFile = scope === 'project'
117
- ? join(process.cwd(), 'GEMINI.md')
118
- : join(homedir(), '.gemini', 'GEMINI.md');
119
- removeHintFromFile(instructionFile);
120
- removeTeamInstructionsFromFile(instructionFile);
121
- }
122
- }
@@ -1,25 +0,0 @@
1
- import type { AgentAdapter, CleanupManifest, McpServerEntry, SkillFile } from './types.js';
2
- import type { AgentDefinition } from './registry.js';
3
- /**
4
- * Generic adapter that handles any agent from the registry using its
5
- * skillsPaths, mcpConfigPath, and instructionFile metadata.
6
- *
7
- * This covers the long tail of community agents. Agents with custom behavior
8
- * (plugin systems, special config formats, usage stats reading) use their
9
- * own dedicated adapter classes instead.
10
- */
11
- export declare class GenericAgentAdapter implements AgentAdapter {
12
- name: string;
13
- slug: string;
14
- mcpProvidesSkills: boolean;
15
- private def;
16
- constructor(def: AgentDefinition);
17
- detect(): Promise<boolean>;
18
- supportsMcpScope(scope: 'project' | 'user'): boolean;
19
- supportsSkills(): boolean;
20
- writeMcpServers(servers: McpServerEntry[], _scope: 'project' | 'user'): Promise<void>;
21
- writeSkills(skills: SkillFile[], scope: 'project' | 'user'): Promise<void>;
22
- writeInstructionHint(hint: string, scope: 'project' | 'user'): Promise<void>;
23
- writeTeamInstructions(instructions: string, scope: 'project' | 'user'): Promise<void>;
24
- cleanup(scope: 'project' | 'user', manifest?: CleanupManifest): Promise<void>;
25
- }