@clinebot/core 0.0.20 → 0.0.22

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 (356) hide show
  1. package/dist/account/cline-account-service.d.ts +3 -2
  2. package/dist/account/cline-account-service.d.ts.map +1 -0
  3. package/dist/account/index.d.ts +1 -0
  4. package/dist/account/index.d.ts.map +1 -0
  5. package/dist/account/rpc.d.ts +1 -0
  6. package/dist/account/rpc.d.ts.map +1 -0
  7. package/dist/account/types.d.ts +1 -0
  8. package/dist/account/types.d.ts.map +1 -0
  9. package/dist/agents/agent-config-loader.d.ts +1 -0
  10. package/dist/agents/agent-config-loader.d.ts.map +1 -0
  11. package/dist/agents/agent-config-parser.d.ts +1 -0
  12. package/dist/agents/agent-config-parser.d.ts.map +1 -0
  13. package/dist/agents/hooks-config-loader.d.ts +1 -0
  14. package/dist/agents/hooks-config-loader.d.ts.map +1 -0
  15. package/dist/agents/index.d.ts +1 -0
  16. package/dist/agents/index.d.ts.map +1 -0
  17. package/dist/agents/plugin-config-loader.d.ts +1 -0
  18. package/dist/agents/plugin-config-loader.d.ts.map +1 -0
  19. package/dist/agents/plugin-loader.d.ts +1 -0
  20. package/dist/agents/plugin-loader.d.ts.map +1 -0
  21. package/dist/agents/plugin-sandbox.d.ts +1 -0
  22. package/dist/agents/plugin-sandbox.d.ts.map +1 -0
  23. package/dist/agents/unified-config-file-watcher.d.ts +1 -0
  24. package/dist/agents/unified-config-file-watcher.d.ts.map +1 -0
  25. package/dist/agents/user-instruction-config-loader.d.ts +1 -0
  26. package/dist/agents/user-instruction-config-loader.d.ts.map +1 -0
  27. package/dist/auth/client.d.ts +1 -0
  28. package/dist/auth/client.d.ts.map +1 -0
  29. package/dist/auth/cline.d.ts +1 -0
  30. package/dist/auth/cline.d.ts.map +1 -0
  31. package/dist/auth/codex.d.ts +1 -0
  32. package/dist/auth/codex.d.ts.map +1 -0
  33. package/dist/auth/oca.d.ts +1 -0
  34. package/dist/auth/oca.d.ts.map +1 -0
  35. package/dist/auth/server.d.ts +1 -0
  36. package/dist/auth/server.d.ts.map +1 -0
  37. package/dist/auth/types.d.ts +1 -0
  38. package/dist/auth/types.d.ts.map +1 -0
  39. package/dist/auth/utils.d.ts +1 -0
  40. package/dist/auth/utils.d.ts.map +1 -0
  41. package/dist/chat/chat-schema.d.ts +13 -12
  42. package/dist/chat/chat-schema.d.ts.map +1 -0
  43. package/dist/index.d.ts +3 -1
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.node.d.ts +2 -0
  46. package/dist/index.node.d.ts.map +1 -0
  47. package/dist/index.node.js +303 -302
  48. package/dist/input/file-indexer.d.ts +1 -0
  49. package/dist/input/file-indexer.d.ts.map +1 -0
  50. package/dist/input/index.d.ts +1 -0
  51. package/dist/input/index.d.ts.map +1 -0
  52. package/dist/input/mention-enricher.d.ts +1 -0
  53. package/dist/input/mention-enricher.d.ts.map +1 -0
  54. package/dist/mcp/config-loader.d.ts +1 -0
  55. package/dist/mcp/config-loader.d.ts.map +1 -0
  56. package/dist/mcp/index.d.ts +1 -0
  57. package/dist/mcp/index.d.ts.map +1 -0
  58. package/dist/mcp/manager.d.ts +1 -0
  59. package/dist/mcp/manager.d.ts.map +1 -0
  60. package/dist/mcp/types.d.ts +1 -0
  61. package/dist/mcp/types.d.ts.map +1 -0
  62. package/dist/providers/local-provider-registry.d.ts +36 -0
  63. package/dist/providers/local-provider-registry.d.ts.map +1 -0
  64. package/dist/providers/local-provider-service.d.ts +2 -1
  65. package/dist/providers/local-provider-service.d.ts.map +1 -0
  66. package/dist/runtime/commands.d.ts +1 -0
  67. package/dist/runtime/commands.d.ts.map +1 -0
  68. package/dist/runtime/hook-file-hooks.d.ts +1 -0
  69. package/dist/runtime/hook-file-hooks.d.ts.map +1 -0
  70. package/dist/runtime/rules.d.ts +1 -0
  71. package/dist/runtime/rules.d.ts.map +1 -0
  72. package/dist/runtime/runtime-builder.d.ts +1 -0
  73. package/dist/runtime/runtime-builder.d.ts.map +1 -0
  74. package/dist/runtime/sandbox/subprocess-sandbox.d.ts +1 -0
  75. package/dist/runtime/sandbox/subprocess-sandbox.d.ts.map +1 -0
  76. package/dist/runtime/session-runtime.d.ts +2 -0
  77. package/dist/runtime/session-runtime.d.ts.map +1 -0
  78. package/dist/runtime/skills.d.ts +1 -0
  79. package/dist/runtime/skills.d.ts.map +1 -0
  80. package/dist/runtime/tool-approval.d.ts +1 -0
  81. package/dist/runtime/tool-approval.d.ts.map +1 -0
  82. package/dist/runtime/workflows.d.ts +1 -0
  83. package/dist/runtime/workflows.d.ts.map +1 -0
  84. package/dist/session/default-session-manager.d.ts +4 -0
  85. package/dist/session/default-session-manager.d.ts.map +1 -0
  86. package/dist/session/file-session-service.d.ts +1 -0
  87. package/dist/session/file-session-service.d.ts.map +1 -0
  88. package/dist/session/rpc-session-service.d.ts +1 -0
  89. package/dist/session/rpc-session-service.d.ts.map +1 -0
  90. package/dist/session/rpc-spawn-lease.d.ts +1 -0
  91. package/dist/session/rpc-spawn-lease.d.ts.map +1 -0
  92. package/dist/session/runtime-oauth-token-manager.d.ts +1 -0
  93. package/dist/session/runtime-oauth-token-manager.d.ts.map +1 -0
  94. package/dist/session/session-agent-events.d.ts +20 -1
  95. package/dist/session/session-agent-events.d.ts.map +1 -0
  96. package/dist/session/session-artifacts.d.ts +1 -0
  97. package/dist/session/session-artifacts.d.ts.map +1 -0
  98. package/dist/session/session-config-builder.d.ts +1 -0
  99. package/dist/session/session-config-builder.d.ts.map +1 -0
  100. package/dist/session/session-graph.d.ts +1 -0
  101. package/dist/session/session-graph.d.ts.map +1 -0
  102. package/dist/session/session-host.d.ts +1 -0
  103. package/dist/session/session-host.d.ts.map +1 -0
  104. package/dist/session/session-manager.d.ts +1 -0
  105. package/dist/session/session-manager.d.ts.map +1 -0
  106. package/dist/session/session-manifest.d.ts +2 -1
  107. package/dist/session/session-manifest.d.ts.map +1 -0
  108. package/dist/session/session-service.d.ts +1 -0
  109. package/dist/session/session-service.d.ts.map +1 -0
  110. package/dist/session/session-team-coordination.d.ts +1 -0
  111. package/dist/session/session-team-coordination.d.ts.map +1 -0
  112. package/dist/session/session-telemetry.d.ts +3 -1
  113. package/dist/session/session-telemetry.d.ts.map +1 -0
  114. package/dist/session/sqlite-rpc-session-backend.d.ts +1 -0
  115. package/dist/session/sqlite-rpc-session-backend.d.ts.map +1 -0
  116. package/dist/session/unified-session-persistence-service.d.ts +1 -0
  117. package/dist/session/unified-session-persistence-service.d.ts.map +1 -0
  118. package/dist/session/utils/helpers.d.ts +1 -0
  119. package/dist/session/utils/helpers.d.ts.map +1 -0
  120. package/dist/session/utils/types.d.ts +1 -0
  121. package/dist/session/utils/types.d.ts.map +1 -0
  122. package/dist/session/utils/usage.d.ts +1 -0
  123. package/dist/session/utils/usage.d.ts.map +1 -0
  124. package/dist/session/workspace-manager.d.ts +1 -0
  125. package/dist/session/workspace-manager.d.ts.map +1 -0
  126. package/dist/session/workspace-manifest.d.ts +1 -0
  127. package/dist/session/workspace-manifest.d.ts.map +1 -0
  128. package/dist/storage/file-team-store.d.ts +1 -0
  129. package/dist/storage/file-team-store.d.ts.map +1 -0
  130. package/dist/storage/provider-settings-legacy-migration.d.ts +1 -0
  131. package/dist/storage/provider-settings-legacy-migration.d.ts.map +1 -0
  132. package/dist/storage/provider-settings-manager.d.ts +1 -0
  133. package/dist/storage/provider-settings-manager.d.ts.map +1 -0
  134. package/dist/storage/sqlite-session-store.d.ts +1 -0
  135. package/dist/storage/sqlite-session-store.d.ts.map +1 -0
  136. package/dist/storage/sqlite-team-store.d.ts +1 -0
  137. package/dist/storage/sqlite-team-store.d.ts.map +1 -0
  138. package/dist/storage/team-store.d.ts +1 -0
  139. package/dist/storage/team-store.d.ts.map +1 -0
  140. package/dist/team/index.d.ts +1 -0
  141. package/dist/team/index.d.ts.map +1 -0
  142. package/dist/team/projections.d.ts +1 -0
  143. package/dist/team/projections.d.ts.map +1 -0
  144. package/dist/telemetry/ITelemetryAdapter.d.ts +1 -0
  145. package/dist/telemetry/ITelemetryAdapter.d.ts.map +1 -0
  146. package/dist/telemetry/LoggerTelemetryAdapter.d.ts +1 -0
  147. package/dist/telemetry/LoggerTelemetryAdapter.d.ts.map +1 -0
  148. package/dist/telemetry/OpenTelemetryAdapter.d.ts +1 -0
  149. package/dist/telemetry/OpenTelemetryAdapter.d.ts.map +1 -0
  150. package/dist/telemetry/OpenTelemetryProvider.d.ts +1 -0
  151. package/dist/telemetry/OpenTelemetryProvider.d.ts.map +1 -0
  152. package/dist/telemetry/TelemetryService.d.ts +1 -0
  153. package/dist/telemetry/TelemetryService.d.ts.map +1 -0
  154. package/dist/telemetry/core-events.d.ts +55 -22
  155. package/dist/telemetry/core-events.d.ts.map +1 -0
  156. package/dist/telemetry/opentelemetry.d.ts +1 -0
  157. package/dist/telemetry/opentelemetry.d.ts.map +1 -0
  158. package/dist/tools/constants.d.ts +1 -0
  159. package/dist/tools/constants.d.ts.map +1 -0
  160. package/dist/tools/definitions.d.ts +8 -1
  161. package/dist/tools/definitions.d.ts.map +1 -0
  162. package/dist/tools/executors/apply-patch-parser.d.ts +1 -0
  163. package/dist/tools/executors/apply-patch-parser.d.ts.map +1 -0
  164. package/dist/tools/executors/apply-patch.d.ts +1 -0
  165. package/dist/tools/executors/apply-patch.d.ts.map +1 -0
  166. package/dist/tools/executors/bash.d.ts +2 -1
  167. package/dist/tools/executors/bash.d.ts.map +1 -0
  168. package/dist/tools/executors/editor.d.ts +1 -0
  169. package/dist/tools/executors/editor.d.ts.map +1 -0
  170. package/dist/tools/executors/file-read.d.ts +1 -0
  171. package/dist/tools/executors/file-read.d.ts.map +1 -0
  172. package/dist/tools/executors/index.d.ts +14 -7
  173. package/dist/tools/executors/index.d.ts.map +1 -0
  174. package/dist/tools/executors/search.d.ts +1 -0
  175. package/dist/tools/executors/search.d.ts.map +1 -0
  176. package/dist/tools/executors/web-fetch.d.ts +1 -0
  177. package/dist/tools/executors/web-fetch.d.ts.map +1 -0
  178. package/dist/tools/helpers.d.ts +15 -0
  179. package/dist/tools/helpers.d.ts.map +1 -0
  180. package/dist/tools/index.d.ts +2 -1
  181. package/dist/tools/index.d.ts.map +1 -0
  182. package/dist/tools/model-tool-routing.d.ts +1 -0
  183. package/dist/tools/model-tool-routing.d.ts.map +1 -0
  184. package/dist/tools/presets.d.ts +1 -0
  185. package/dist/tools/presets.d.ts.map +1 -0
  186. package/dist/tools/schemas.d.ts +41 -0
  187. package/dist/tools/schemas.d.ts.map +1 -0
  188. package/dist/tools/types.d.ts +3 -2
  189. package/dist/tools/types.d.ts.map +1 -0
  190. package/dist/types/common.d.ts +1 -0
  191. package/dist/types/common.d.ts.map +1 -0
  192. package/dist/types/config.d.ts +1 -0
  193. package/dist/types/config.d.ts.map +1 -0
  194. package/dist/types/events.d.ts +1 -0
  195. package/dist/types/events.d.ts.map +1 -0
  196. package/dist/types/provider-settings.d.ts +1 -0
  197. package/dist/types/provider-settings.d.ts.map +1 -0
  198. package/dist/types/sessions.d.ts +1 -0
  199. package/dist/types/sessions.d.ts.map +1 -0
  200. package/dist/types/storage.d.ts +1 -0
  201. package/dist/types/storage.d.ts.map +1 -0
  202. package/dist/types/workspace.d.ts +1 -0
  203. package/dist/types/workspace.d.ts.map +1 -0
  204. package/dist/types.d.ts +1 -0
  205. package/dist/types.d.ts.map +1 -0
  206. package/package.json +8 -6
  207. package/src/account/cline-account-service.test.ts +0 -101
  208. package/src/account/cline-account-service.ts +0 -287
  209. package/src/account/index.ts +0 -22
  210. package/src/account/rpc.test.ts +0 -62
  211. package/src/account/rpc.ts +0 -172
  212. package/src/account/types.ts +0 -98
  213. package/src/agents/agent-config-loader.test.ts +0 -236
  214. package/src/agents/agent-config-loader.ts +0 -108
  215. package/src/agents/agent-config-parser.ts +0 -198
  216. package/src/agents/hooks-config-loader.test.ts +0 -20
  217. package/src/agents/hooks-config-loader.ts +0 -118
  218. package/src/agents/index.ts +0 -85
  219. package/src/agents/plugin-config-loader.test.ts +0 -140
  220. package/src/agents/plugin-config-loader.ts +0 -97
  221. package/src/agents/plugin-loader.test.ts +0 -228
  222. package/src/agents/plugin-loader.ts +0 -172
  223. package/src/agents/plugin-sandbox-bootstrap.ts +0 -445
  224. package/src/agents/plugin-sandbox.test.ts +0 -317
  225. package/src/agents/plugin-sandbox.ts +0 -341
  226. package/src/agents/unified-config-file-watcher.test.ts +0 -196
  227. package/src/agents/unified-config-file-watcher.ts +0 -483
  228. package/src/agents/user-instruction-config-loader.test.ts +0 -158
  229. package/src/agents/user-instruction-config-loader.ts +0 -438
  230. package/src/auth/client.test.ts +0 -40
  231. package/src/auth/client.ts +0 -25
  232. package/src/auth/cline.test.ts +0 -130
  233. package/src/auth/cline.ts +0 -420
  234. package/src/auth/codex.test.ts +0 -170
  235. package/src/auth/codex.ts +0 -491
  236. package/src/auth/oca.test.ts +0 -215
  237. package/src/auth/oca.ts +0 -573
  238. package/src/auth/server.ts +0 -216
  239. package/src/auth/types.ts +0 -81
  240. package/src/auth/utils.test.ts +0 -128
  241. package/src/auth/utils.ts +0 -247
  242. package/src/chat/chat-schema.ts +0 -82
  243. package/src/index.node.ts +0 -285
  244. package/src/index.ts +0 -211
  245. package/src/input/file-indexer.d.ts +0 -11
  246. package/src/input/file-indexer.test.ts +0 -127
  247. package/src/input/file-indexer.ts +0 -327
  248. package/src/input/index.ts +0 -7
  249. package/src/input/mention-enricher.test.ts +0 -85
  250. package/src/input/mention-enricher.ts +0 -122
  251. package/src/mcp/config-loader.test.ts +0 -238
  252. package/src/mcp/config-loader.ts +0 -219
  253. package/src/mcp/index.ts +0 -26
  254. package/src/mcp/manager.test.ts +0 -106
  255. package/src/mcp/manager.ts +0 -262
  256. package/src/mcp/types.ts +0 -88
  257. package/src/providers/local-provider-service.ts +0 -608
  258. package/src/runtime/commands.test.ts +0 -98
  259. package/src/runtime/commands.ts +0 -83
  260. package/src/runtime/hook-file-hooks.test.ts +0 -237
  261. package/src/runtime/hook-file-hooks.ts +0 -859
  262. package/src/runtime/index.ts +0 -37
  263. package/src/runtime/rules.ts +0 -34
  264. package/src/runtime/runtime-builder.team-persistence.test.ts +0 -202
  265. package/src/runtime/runtime-builder.test.ts +0 -371
  266. package/src/runtime/runtime-builder.ts +0 -589
  267. package/src/runtime/runtime-parity.test.ts +0 -143
  268. package/src/runtime/sandbox/subprocess-sandbox.ts +0 -231
  269. package/src/runtime/session-runtime.ts +0 -46
  270. package/src/runtime/skills.ts +0 -44
  271. package/src/runtime/tool-approval.ts +0 -104
  272. package/src/runtime/workflows.test.ts +0 -119
  273. package/src/runtime/workflows.ts +0 -45
  274. package/src/session/default-session-manager.e2e.test.ts +0 -384
  275. package/src/session/default-session-manager.test.ts +0 -1741
  276. package/src/session/default-session-manager.ts +0 -1233
  277. package/src/session/file-session-service.ts +0 -280
  278. package/src/session/index.ts +0 -42
  279. package/src/session/rpc-session-service.ts +0 -107
  280. package/src/session/rpc-spawn-lease.test.ts +0 -49
  281. package/src/session/rpc-spawn-lease.ts +0 -122
  282. package/src/session/runtime-oauth-token-manager.test.ts +0 -137
  283. package/src/session/runtime-oauth-token-manager.ts +0 -272
  284. package/src/session/session-agent-events.ts +0 -159
  285. package/src/session/session-artifacts.ts +0 -106
  286. package/src/session/session-config-builder.ts +0 -113
  287. package/src/session/session-graph.ts +0 -92
  288. package/src/session/session-host.test.ts +0 -29
  289. package/src/session/session-host.ts +0 -242
  290. package/src/session/session-manager.ts +0 -69
  291. package/src/session/session-manifest.ts +0 -29
  292. package/src/session/session-service.team-persistence.test.ts +0 -48
  293. package/src/session/session-service.ts +0 -673
  294. package/src/session/session-team-coordination.ts +0 -229
  295. package/src/session/session-telemetry.ts +0 -95
  296. package/src/session/sqlite-rpc-session-backend.ts +0 -303
  297. package/src/session/unified-session-persistence-service.test.ts +0 -85
  298. package/src/session/unified-session-persistence-service.ts +0 -996
  299. package/src/session/utils/helpers.ts +0 -139
  300. package/src/session/utils/types.ts +0 -57
  301. package/src/session/utils/usage.ts +0 -32
  302. package/src/session/workspace-manager.ts +0 -98
  303. package/src/session/workspace-manifest.ts +0 -100
  304. package/src/storage/artifact-store.ts +0 -1
  305. package/src/storage/file-team-store.ts +0 -257
  306. package/src/storage/index.ts +0 -11
  307. package/src/storage/provider-settings-legacy-migration.test.ts +0 -307
  308. package/src/storage/provider-settings-legacy-migration.ts +0 -689
  309. package/src/storage/provider-settings-manager.test.ts +0 -145
  310. package/src/storage/provider-settings-manager.ts +0 -150
  311. package/src/storage/session-store.ts +0 -1
  312. package/src/storage/sqlite-session-store.ts +0 -275
  313. package/src/storage/sqlite-team-store.ts +0 -454
  314. package/src/storage/team-store.ts +0 -40
  315. package/src/team/index.ts +0 -4
  316. package/src/team/projections.ts +0 -285
  317. package/src/telemetry/ITelemetryAdapter.ts +0 -94
  318. package/src/telemetry/LoggerTelemetryAdapter.test.ts +0 -42
  319. package/src/telemetry/LoggerTelemetryAdapter.ts +0 -114
  320. package/src/telemetry/OpenTelemetryAdapter.test.ts +0 -157
  321. package/src/telemetry/OpenTelemetryAdapter.ts +0 -348
  322. package/src/telemetry/OpenTelemetryProvider.test.ts +0 -113
  323. package/src/telemetry/OpenTelemetryProvider.ts +0 -322
  324. package/src/telemetry/TelemetryService.test.ts +0 -134
  325. package/src/telemetry/TelemetryService.ts +0 -141
  326. package/src/telemetry/core-events.ts +0 -344
  327. package/src/telemetry/opentelemetry.ts +0 -20
  328. package/src/tools/constants.ts +0 -35
  329. package/src/tools/definitions.test.ts +0 -658
  330. package/src/tools/definitions.ts +0 -726
  331. package/src/tools/executors/apply-patch-parser.ts +0 -520
  332. package/src/tools/executors/apply-patch.ts +0 -359
  333. package/src/tools/executors/bash.ts +0 -205
  334. package/src/tools/executors/editor.test.ts +0 -35
  335. package/src/tools/executors/editor.ts +0 -219
  336. package/src/tools/executors/file-read.test.ts +0 -49
  337. package/src/tools/executors/file-read.ts +0 -110
  338. package/src/tools/executors/index.ts +0 -75
  339. package/src/tools/executors/search.ts +0 -278
  340. package/src/tools/executors/web-fetch.ts +0 -259
  341. package/src/tools/index.ts +0 -168
  342. package/src/tools/model-tool-routing.test.ts +0 -86
  343. package/src/tools/model-tool-routing.ts +0 -132
  344. package/src/tools/presets.test.ts +0 -62
  345. package/src/tools/presets.ts +0 -168
  346. package/src/tools/schemas.ts +0 -284
  347. package/src/tools/types.ts +0 -328
  348. package/src/types/common.ts +0 -14
  349. package/src/types/config.ts +0 -84
  350. package/src/types/events.ts +0 -74
  351. package/src/types/index.ts +0 -24
  352. package/src/types/provider-settings.ts +0 -43
  353. package/src/types/sessions.ts +0 -16
  354. package/src/types/storage.ts +0 -64
  355. package/src/types/workspace.ts +0 -7
  356. package/src/types.ts +0 -128
@@ -1,284 +0,0 @@
1
- /**
2
- * Zod Schemas for Default Tool Inputs
3
- *
4
- * These schemas define the input structure for each default tool
5
- * and are used for both validation and JSON Schema generation.
6
- */
7
-
8
- import { z } from "zod";
9
-
10
- export const INPUT_ARG_CHAR_LIMIT = 6000;
11
-
12
- /**
13
- * Schema for read tool input
14
- */
15
- const AbsolutePath = z
16
- .string()
17
- .describe("The absolute file path of a text file to read content from");
18
-
19
- export const ReadFileLineRangeSchema = z
20
- .object({
21
- start_line: z
22
- .number()
23
- .int()
24
- .positive()
25
- .nullable()
26
- .optional()
27
- .describe(
28
- "Optional one-based starting line number to read from; use null or omit for the start of the file",
29
- ),
30
- end_line: z
31
- .number()
32
- .int()
33
- .positive()
34
- .nullable()
35
- .optional()
36
- .describe(
37
- "Optional one-based ending line number to read through; use null or omit for the end of the file",
38
- ),
39
- })
40
- .refine(
41
- ({ start_line, end_line }) =>
42
- start_line == null || end_line == null || start_line <= end_line,
43
- {
44
- message: "start_line must be less than or equal to end_line",
45
- path: ["end_line"],
46
- },
47
- );
48
-
49
- export const ReadFileRequestSchema = z
50
- .object({
51
- path: AbsolutePath,
52
- start_line: ReadFileLineRangeSchema.shape.start_line,
53
- end_line: ReadFileLineRangeSchema.shape.end_line,
54
- })
55
- .refine(
56
- ({ start_line, end_line }) =>
57
- start_line == null || end_line == null || start_line <= end_line,
58
- {
59
- message: "start_line must be less than or equal to end_line",
60
- path: ["end_line"],
61
- },
62
- );
63
-
64
- /**
65
- * Schema for read_files tool input
66
- */
67
- export const ReadFilesInputSchema = z.object({
68
- files: z
69
- .array(ReadFileRequestSchema)
70
- .describe(
71
- "Array of file read requests. Omit start_line/end_line or set them to null to return the full file content boundaries; provide integers to return only that inclusive one-based line range. Prefer this tool over running terminal command to get file content for better performance and reliability.",
72
- ),
73
- });
74
-
75
- /**
76
- * Union schema for read_files tool input, allowing either a single string, an array of strings, or the full object schema
77
- */
78
- export const ReadFilesInputUnionSchema = z.union([
79
- ReadFilesInputSchema,
80
- ReadFileRequestSchema,
81
- z.array(ReadFileRequestSchema),
82
- z.array(z.string()),
83
- z.string(),
84
- z.object({ files: ReadFileRequestSchema }),
85
- z.object({ file_paths: z.array(AbsolutePath) }),
86
- z.object({ file_paths: z.string() }),
87
- ]);
88
-
89
- /**
90
- * Schema for search_codebase tool input
91
- */
92
- export const SearchCodebaseInputSchema = z.object({
93
- queries: z
94
- .array(z.string())
95
- .describe("Array of regex search queries to execute"),
96
- });
97
-
98
- /**
99
- * Union schema for search_codebase tool input, allowing either a single string, an array of strings, or the full object schema
100
- */
101
- export const SearchCodebaseUnionInputSchema = z.union([
102
- SearchCodebaseInputSchema,
103
- z.array(z.string()),
104
- z.string(),
105
- z.object({ queries: z.string() }),
106
- ]);
107
-
108
- const CommandInputSchema = z
109
- .string()
110
- .describe(
111
- `The non-interactive shell command to execute - MUST keep input short and concise (within ${INPUT_ARG_CHAR_LIMIT * 2} characters) to avoid timeouts.`,
112
- );
113
- /**
114
- * Schema for run_commands tool input
115
- */
116
- export const RunCommandsInputSchema = z.object({
117
- commands: z
118
- .array(CommandInputSchema)
119
- .describe("Array of shell commands to execute"),
120
- });
121
-
122
- /**
123
- * Union schema for run_commands tool input. More flexible.
124
- */
125
- export const RunCommandsInputUnionSchema = z.union([
126
- RunCommandsInputSchema,
127
- z.object({ commands: CommandInputSchema }),
128
- z.array(z.string()),
129
- z.string(),
130
- ]);
131
-
132
- /**
133
- * Schema for a single web fetch request
134
- */
135
- export const WebFetchRequestSchema = z.object({
136
- url: z.string().describe("The URL to fetch"),
137
- prompt: z.string().min(2).describe("Analysis prompt for the fetched content"),
138
- });
139
-
140
- /**
141
- * Schema for fetch_web_content tool input
142
- */
143
- export const FetchWebContentInputSchema = z.object({
144
- requests: z
145
- .array(WebFetchRequestSchema)
146
- .describe("Array of the URLs for the web fetch requests"),
147
- });
148
-
149
- /**
150
- * Schema for editor tool input
151
- */
152
- export const EditFileInputSchema = z
153
- .object({
154
- path: z
155
- .string()
156
- .min(1)
157
- .describe("The absolute file path for the action to be performed on"),
158
- old_text: z
159
- .string()
160
- .nullable()
161
- .optional()
162
- .describe(
163
- `Exact text to replace (must match exactly once). Omit this when creating a missing file or inserting via insert_line. Keep this at or below ${INPUT_ARG_CHAR_LIMIT} characters when possible; larger payloads should be split across multiple tool calls to avoid timeouts.`,
164
- ),
165
- new_text: z
166
- .string()
167
- .describe(
168
- `The new content to write when creating a missing file, the replacement text for edits, or the inserted text when insert_line is provided. Keep this at or below ${INPUT_ARG_CHAR_LIMIT} characters when possible; for large edits, use multiple calls with small chunks of old_text and new_text to iteratively edit the file.`,
169
- ),
170
- insert_line: z
171
- .number()
172
- .int()
173
- .nullable()
174
- .optional()
175
- .describe(
176
- "Optional one-based line index. When provided, the tool inserts new_text at that line instead of performing a replacement edit.",
177
- ),
178
- })
179
- .describe(
180
- "Edit a text file by replacing old_text with new_text, create the file with new_text if it does not exist, or insert new_text at insert_line when insert_line is provided. Prefer using this tool for file edits over shell commands. IMPORTANT: large edits can time out, so use small chunks and multiple calls when possible.",
181
- );
182
-
183
- /**
184
- * Schema for apply_patch tool input
185
- */
186
- export const ApplyPatchInputSchema = z
187
- .object({
188
- input: z
189
- .string()
190
- .min(1)
191
- .describe("The apply_patch text payload, including patch instructions"),
192
- })
193
- .describe(
194
- "Modify or create a text file by applying patches. Prefer using this tool for file edits over shell commands. IMPORTANT: large patches can time out, so use small chunks and multiple calls when possible.",
195
- );
196
- export const ApplyPatchInputUnionSchema = z.union([
197
- ApplyPatchInputSchema,
198
- z.string(),
199
- ]);
200
-
201
- /**
202
- * Schema for skills tool input
203
- */
204
- export const SkillsInputSchema = z.object({
205
- skill: z.string().min(1).describe("Name of the skill to execute."),
206
- args: z
207
- .string()
208
- .nullable()
209
- .optional()
210
- .describe("Arguments for the skill; use null when omitted"),
211
- });
212
-
213
- /**
214
- * Schema for ask_followup_question tool input
215
- */
216
- export const AskQuestionInputSchema = z.object({
217
- question: z
218
- .string()
219
- .min(1)
220
- .describe(
221
- 'The single question to ask the user. E.g. "How can I help you?"',
222
- ),
223
- options: z
224
- .array(z.string().min(1))
225
- .min(2)
226
- .max(5)
227
- .describe(
228
- "Array of 2-5 user-selectable answer options for the single question",
229
- ),
230
- });
231
-
232
- // =============================================================================
233
- // Type Definitions (derived from Zod schemas)
234
- // =============================================================================
235
-
236
- /**
237
- * Input for a single file read request
238
- */
239
- export type ReadFileRequest = z.infer<typeof ReadFileRequestSchema>;
240
-
241
- /**
242
- * Input for the read_files tool
243
- */
244
- export type ReadFilesInput = z.infer<typeof ReadFilesInputSchema>;
245
-
246
- /**
247
- * Input for the search_codebase tool
248
- */
249
- export type SearchCodebaseInput = z.infer<typeof SearchCodebaseInputSchema>;
250
-
251
- /**
252
- * Input for the run_commands tool
253
- */
254
- export type RunCommandsInput = z.infer<typeof RunCommandsInputSchema>;
255
-
256
- /**
257
- * Web fetch request parameters
258
- */
259
- export type WebFetchRequest = z.infer<typeof WebFetchRequestSchema>;
260
-
261
- /**
262
- * Input for the fetch_web_content tool
263
- */
264
- export type FetchWebContentInput = z.infer<typeof FetchWebContentInputSchema>;
265
-
266
- /**
267
- * Input for the editor tool
268
- */
269
- export type EditFileInput = z.infer<typeof EditFileInputSchema>;
270
-
271
- /**
272
- * Input for the apply_patch tool
273
- */
274
- export type ApplyPatchInput = z.infer<typeof ApplyPatchInputSchema>;
275
-
276
- /**
277
- * Input for the skills tool
278
- */
279
- export type SkillsInput = z.infer<typeof SkillsInputSchema>;
280
-
281
- /**
282
- * Input for the ask_followup_question tool
283
- */
284
- export type AskQuestionInput = z.infer<typeof AskQuestionInputSchema>;
@@ -1,328 +0,0 @@
1
- /**
2
- * Types for Default Tools
3
- *
4
- * Type definitions for executors, configuration, and results.
5
- */
6
-
7
- import type { ToolContext } from "@clinebot/agents";
8
- import type {
9
- ApplyPatchInput,
10
- EditFileInput,
11
- ReadFileRequest,
12
- } from "./schemas";
13
-
14
- // =============================================================================
15
- // Tool Result Types
16
- // =============================================================================
17
-
18
- /**
19
- * Result from a single tool operation
20
- */
21
- export interface ToolOperationResult {
22
- /** The query/input that was executed */
23
- query: string;
24
- /** The result content (if successful) */
25
- result: string;
26
- /** Error message (if failed) */
27
- error?: string;
28
- /** Whether the operation succeeded */
29
- success: boolean;
30
- /** Duration in MS */
31
- duration?: number;
32
- }
33
-
34
- // =============================================================================
35
- // Executor Interfaces
36
- // =============================================================================
37
-
38
- /**
39
- * Executor for reading files
40
- *
41
- * @param request - File path and optional inclusive line range to read
42
- * @param context - Tool execution context
43
- * @returns The file content as a string
44
- */
45
- export type FileReadExecutor = (
46
- request: ReadFileRequest,
47
- context: ToolContext,
48
- ) => Promise<string>;
49
-
50
- /**
51
- * Executor for searching the codebase
52
- *
53
- * @param query - Regex pattern to search for
54
- * @param cwd - Current working directory for the search
55
- * @param context - Tool execution context
56
- * @returns Search results as a formatted string
57
- */
58
- export type SearchExecutor = (
59
- query: string,
60
- cwd: string,
61
- context: ToolContext,
62
- ) => Promise<string>;
63
-
64
- /**
65
- * Executor for running shell commands
66
- *
67
- * @param command - Shell command to execute
68
- * @param cwd - Current working directory for execution
69
- * @param context - Tool execution context
70
- * @returns Command output (stdout)
71
- */
72
- export type BashExecutor = (
73
- command: string,
74
- cwd: string,
75
- context: ToolContext,
76
- ) => Promise<string>;
77
-
78
- /**
79
- * Executor for fetching web content
80
- *
81
- * @param url - URL to fetch
82
- * @param prompt - Analysis prompt for the content
83
- * @param context - Tool execution context
84
- * @returns Analyzed/extracted content
85
- */
86
- export type WebFetchExecutor = (
87
- url: string,
88
- prompt: string,
89
- context: ToolContext,
90
- ) => Promise<string>;
91
-
92
- /**
93
- * Executor for editing files
94
- *
95
- * @param input - Editor command input
96
- * @param cwd - Current working directory for filesystem operations
97
- * @param context - Tool execution context
98
- * @returns A formatted operation result string
99
- */
100
- export type EditorExecutor = (
101
- input: EditFileInput,
102
- cwd: string,
103
- context: ToolContext,
104
- ) => Promise<string>;
105
-
106
- /**
107
- * Executor for apply_patch operations
108
- *
109
- * @param input - apply_patch command payload
110
- * @param cwd - Current working directory for filesystem operations
111
- * @param context - Tool execution context
112
- * @returns A formatted operation result string
113
- */
114
- export type ApplyPatchExecutor = (
115
- input: ApplyPatchInput,
116
- cwd: string,
117
- context: ToolContext,
118
- ) => Promise<string>;
119
-
120
- /**
121
- * Executor for invoking configured skills
122
- *
123
- * @param skill - Skill name to invoke
124
- * @param args - Optional arguments for the skill
125
- * @param context - Tool execution context
126
- * @returns Skill loading/invocation result
127
- */
128
- export type SkillsExecutor = (
129
- skill: string,
130
- args: string | undefined,
131
- context: ToolContext,
132
- ) => Promise<string>;
133
-
134
- /**
135
- * Executor for asking a single follow-up question with selectable options
136
- *
137
- * @param question - Single clarifying question for the user
138
- * @param options - 2-5 selectable answer options
139
- * @param context - Tool execution context
140
- * @returns Executor-specific result payload
141
- */
142
- export type AskQuestionExecutor = (
143
- question: string,
144
- options: string[],
145
- context: ToolContext,
146
- ) => Promise<string>;
147
-
148
- /**
149
- * Skill metadata exposed by SkillsExecutor for clients/UI
150
- */
151
- export interface SkillsExecutorSkillMetadata {
152
- /** Normalized skill id (usually lowercased name) */
153
- id: string;
154
- /** Display name for the skill */
155
- name: string;
156
- /** Optional short description */
157
- description?: string;
158
- /** True when configured but intentionally disabled */
159
- disabled: boolean;
160
- }
161
-
162
- /**
163
- * A callable executor that can also expose configured skill metadata.
164
- */
165
- export interface SkillsExecutorWithMetadata {
166
- (
167
- skill: string,
168
- args: string | undefined,
169
- context: ToolContext,
170
- ): Promise<string>;
171
- configuredSkills?: SkillsExecutorSkillMetadata[];
172
- }
173
-
174
- /**
175
- * Collection of all tool executors
176
- */
177
- export interface ToolExecutors {
178
- /** File reading implementation */
179
- readFile?: FileReadExecutor;
180
- /** Codebase search implementation */
181
- search?: SearchExecutor;
182
- /** Shell command execution implementation */
183
- bash?: BashExecutor;
184
- /** Web content fetching implementation */
185
- webFetch?: WebFetchExecutor;
186
- /** Filesystem editor implementation */
187
- editor?: EditorExecutor;
188
- /** Apply patch implementation */
189
- applyPatch?: ApplyPatchExecutor;
190
- /** Skill invocation implementation */
191
- skills?: SkillsExecutorWithMetadata;
192
- /** Follow-up question implementation */
193
- askQuestion?: AskQuestionExecutor;
194
- }
195
-
196
- // =============================================================================
197
- // Tool Configuration
198
- // =============================================================================
199
-
200
- /**
201
- * Names of available default tools
202
- */
203
- export type DefaultToolName =
204
- | "read_files"
205
- | "search_codebase"
206
- | "run_commands"
207
- | "fetch_web_content"
208
- | "apply_patch"
209
- | "editor"
210
- | "skills"
211
- | "ask_question";
212
-
213
- /**
214
- * Configuration for enabling/disabling default tools
215
- */
216
- export interface DefaultToolsConfig {
217
- /**
218
- * Enable the read_files tool
219
- * @default true
220
- */
221
- enableReadFiles?: boolean;
222
-
223
- /**
224
- * Enable the search_codebase tool
225
- * @default true
226
- */
227
- enableSearch?: boolean;
228
-
229
- /**
230
- * Enable the run_commands tool
231
- * @default true
232
- */
233
- enableBash?: boolean;
234
-
235
- /**
236
- * Enable the fetch_web_content tool
237
- * @default true
238
- */
239
- enableWebFetch?: boolean;
240
-
241
- /**
242
- * Enable the apply_patch tool
243
- * @default true
244
- */
245
- enableApplyPatch?: boolean;
246
-
247
- /**
248
- * Enable the editor tool
249
- * @default true
250
- */
251
- enableEditor?: boolean;
252
-
253
- /**
254
- * Enable the skills tool
255
- * @default true
256
- */
257
- enableSkills?: boolean;
258
-
259
- /**
260
- * Enable the ask_followup_question tool
261
- * @default true
262
- */
263
- enableAskQuestion?: boolean;
264
-
265
- /**
266
- * Current working directory for tools that need it
267
- */
268
- cwd?: string;
269
-
270
- /**
271
- * Timeout for file read operations in milliseconds
272
- * @default 10000
273
- */
274
- fileReadTimeoutMs?: number;
275
-
276
- /**
277
- * Timeout for bash command execution in milliseconds
278
- * @default 30000
279
- */
280
- bashTimeoutMs?: number;
281
-
282
- /**
283
- * Timeout for web fetch operations in milliseconds
284
- * @default 30000
285
- */
286
- webFetchTimeoutMs?: number;
287
-
288
- /**
289
- * Timeout for search operations in milliseconds
290
- * @default 30000
291
- */
292
- searchTimeoutMs?: number;
293
-
294
- /**
295
- * Timeout for apply_patch operations in milliseconds
296
- * @default 30000
297
- */
298
- applyPatchTimeoutMs?: number;
299
-
300
- /**
301
- * Timeout for editor operations in milliseconds
302
- * @default 30000
303
- */
304
- editorTimeoutMs?: number;
305
-
306
- /**
307
- * Timeout for skills operations in milliseconds
308
- * @default 15000
309
- */
310
- skillsTimeoutMs?: number;
311
-
312
- /**
313
- * Timeout for ask_followup_question operations in milliseconds
314
- * @default 15000
315
- */
316
- askQuestionTimeoutMs?: number;
317
- }
318
-
319
- /**
320
- * Options for creating default tools
321
- */
322
- export interface CreateDefaultToolsOptions extends DefaultToolsConfig {
323
- /**
324
- * Executor implementations for the tools
325
- * Only tools with provided executors will be available
326
- */
327
- executors: ToolExecutors;
328
- }
@@ -1,14 +0,0 @@
1
- import { SESSION_STATUS_VALUES } from "@clinebot/shared";
2
-
3
- export const SESSION_STATUSES = SESSION_STATUS_VALUES;
4
-
5
- export type SessionStatus = (typeof SESSION_STATUSES)[number];
6
-
7
- export enum SessionSource {
8
- CLI = "cli",
9
- CLI_SUBAGENT = "cli-subagent",
10
- CORE = "core",
11
- CORE_SUBAGENT = "core-subagent",
12
- DESKTOP = "desktop",
13
- DESKTOP_CHAT = "desktop-chat",
14
- }
@@ -1,84 +0,0 @@
1
- import type {
2
- AgentConfig,
3
- AgentHooks,
4
- ConsecutiveMistakeLimitContext,
5
- ConsecutiveMistakeLimitDecision,
6
- HookErrorMode,
7
- TeamEvent,
8
- Tool,
9
- } from "@clinebot/agents";
10
- import type { LlmsProviders } from "@clinebot/llms";
11
- import type {
12
- AgentMode,
13
- BasicLogger,
14
- ITelemetryService,
15
- SessionExecutionConfig,
16
- SessionPromptConfig,
17
- SessionWorkspaceConfig,
18
- } from "@clinebot/shared";
19
- import type { ToolRoutingRule } from "../tools/model-tool-routing.js";
20
-
21
- export type CoreAgentMode = AgentMode;
22
-
23
- export interface CoreModelConfig {
24
- providerId: string;
25
- modelId: string;
26
- apiKey?: string;
27
- baseUrl?: string;
28
- headers?: Record<string, string>;
29
- providerConfig?: LlmsProviders.ProviderConfig;
30
- knownModels?: Record<string, LlmsProviders.ModelInfo>;
31
- /**
32
- * Request model-side thinking/reasoning when supported.
33
- */
34
- thinking?: boolean;
35
- /**
36
- * Explicit reasoning effort override for capable models.
37
- */
38
- reasoningEffort?: LlmsProviders.ProviderConfig["reasoningEffort"];
39
- }
40
-
41
- export interface CoreRuntimeFeatures {
42
- enableTools: boolean;
43
- enableSpawnAgent: boolean;
44
- enableAgentTeams: boolean;
45
- }
46
-
47
- export interface CoreSessionConfig
48
- extends CoreModelConfig,
49
- CoreRuntimeFeatures,
50
- Omit<SessionWorkspaceConfig, "workspaceRoot">,
51
- Omit<SessionPromptConfig, "systemPrompt">,
52
- Omit<
53
- SessionExecutionConfig,
54
- | "enableTools"
55
- | "teamName"
56
- | "missionLogIntervalSteps"
57
- | "missionLogIntervalMs"
58
- > {
59
- sessionId?: string;
60
- workspaceRoot?: string;
61
- systemPrompt: string;
62
- teamName?: string;
63
- missionLogIntervalSteps?: number;
64
- missionLogIntervalMs?: number;
65
- hooks?: AgentHooks;
66
- hookErrorMode?: HookErrorMode;
67
- logger?: BasicLogger;
68
- telemetry?: ITelemetryService;
69
- extraTools?: Tool[];
70
- pluginPaths?: string[];
71
- extensions?: AgentConfig["extensions"];
72
- onTeamEvent?: (event: TeamEvent) => void;
73
- onConsecutiveMistakeLimitReached?: (
74
- context: ConsecutiveMistakeLimitContext,
75
- ) =>
76
- | Promise<ConsecutiveMistakeLimitDecision>
77
- | ConsecutiveMistakeLimitDecision;
78
- toolRoutingRules?: ToolRoutingRule[];
79
- /**
80
- * Optional skill allowlist for the `skills` tool. When provided, only these
81
- * skills are surfaced in tool metadata and invocable by name.
82
- */
83
- skills?: string[];
84
- }