@clinebot/core 0.0.35 → 0.0.37-nightly.1777939956

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 (563) hide show
  1. package/README.md +12 -3
  2. package/dist/ClineCore.d.ts +245 -118
  3. package/dist/account/cline-account-service.d.ts +0 -1
  4. package/dist/account/index.d.ts +1 -2
  5. package/dist/account/rpc.d.ts +6 -7
  6. package/dist/account/types.d.ts +0 -1
  7. package/dist/auth/bounded-ttl-cache.d.ts +0 -1
  8. package/dist/auth/client.d.ts +0 -1
  9. package/dist/auth/cline.d.ts +0 -1
  10. package/dist/auth/codex.d.ts +0 -1
  11. package/dist/auth/oca.d.ts +0 -1
  12. package/dist/auth/server.d.ts +0 -1
  13. package/dist/auth/types.d.ts +0 -1
  14. package/dist/auth/utils.d.ts +0 -1
  15. package/dist/cline-core/automation.d.ts +34 -0
  16. package/dist/cline-core/runtime-services.d.ts +5 -0
  17. package/dist/cline-core/start-input.d.ts +10 -0
  18. package/dist/cline-core/telemetry.d.ts +10 -0
  19. package/dist/cline-core/types.d.ts +221 -0
  20. package/dist/cron/events/cron-event-ingress.d.ts +37 -0
  21. package/dist/cron/reports/cron-report-writer.d.ts +40 -0
  22. package/dist/cron/runner/cron-materializer.d.ts +35 -0
  23. package/dist/cron/runner/cron-runner.d.ts +45 -0
  24. package/dist/cron/runner/resource-limiter.d.ts +8 -0
  25. package/dist/cron/schedule/scheduler.d.ts +12 -0
  26. package/dist/cron/service/cron-service.d.ts +56 -0
  27. package/dist/cron/service/schedule-command-service.d.ts +9 -0
  28. package/dist/cron/service/schedule-service.d.ts +98 -0
  29. package/dist/cron/specs/cron-reconciler.d.ts +61 -0
  30. package/dist/cron/specs/cron-spec-parser.d.ts +26 -0
  31. package/dist/cron/specs/cron-watcher.d.ts +22 -0
  32. package/dist/cron/store/cron-schema.d.ts +2 -0
  33. package/dist/cron/store/sqlite-cron-store.d.ts +240 -0
  34. package/dist/extensions/config/index.d.ts +4 -7
  35. package/dist/extensions/config/runtime-commands.d.ts +1 -1
  36. package/dist/extensions/config/skill-frontmatter-toggle.d.ts +11 -0
  37. package/dist/extensions/config/unified-config-file-watcher.d.ts +0 -1
  38. package/dist/extensions/config/user-instruction-config-loader.d.ts +1 -1
  39. package/dist/extensions/config/user-instruction-plugin.d.ts +25 -0
  40. package/dist/extensions/config/user-instruction-service.d.ts +23 -0
  41. package/dist/extensions/context/agentic-compaction.d.ts +2 -3
  42. package/dist/extensions/context/basic-compaction.d.ts +0 -1
  43. package/dist/extensions/context/compaction-shared.d.ts +5 -5
  44. package/dist/extensions/context/compaction.d.ts +0 -1
  45. package/dist/extensions/index.d.ts +0 -1
  46. package/dist/extensions/mcp/client.d.ts +0 -1
  47. package/dist/extensions/mcp/config-loader.d.ts +0 -1
  48. package/dist/extensions/mcp/index.d.ts +0 -1
  49. package/dist/extensions/mcp/manager.d.ts +0 -1
  50. package/dist/extensions/mcp/name-transform.d.ts +0 -1
  51. package/dist/extensions/mcp/policies.d.ts +0 -1
  52. package/dist/extensions/mcp/tools.d.ts +2 -3
  53. package/dist/extensions/mcp/types.d.ts +3 -4
  54. package/dist/extensions/plugin/plugin-config-loader.d.ts +15 -3
  55. package/dist/extensions/plugin/plugin-load-report.d.ts +0 -1
  56. package/dist/extensions/plugin/plugin-loader.d.ts +13 -8
  57. package/dist/extensions/plugin/plugin-module-import.d.ts +0 -1
  58. package/dist/extensions/plugin/plugin-sandbox.d.ts +21 -3
  59. package/dist/extensions/plugin/plugin-targeting.d.ts +6 -0
  60. package/dist/extensions/plugin-sandbox-bootstrap.js +1 -485
  61. package/dist/extensions/tools/constants.d.ts +1 -1
  62. package/dist/extensions/tools/definitions.d.ts +15 -17
  63. package/dist/extensions/tools/executors/apply-patch-parser.d.ts +0 -1
  64. package/dist/extensions/tools/executors/apply-patch.d.ts +3 -2
  65. package/dist/extensions/tools/executors/bash.d.ts +0 -1
  66. package/dist/extensions/tools/executors/editor.d.ts +0 -1
  67. package/dist/extensions/tools/executors/file-read.d.ts +0 -1
  68. package/dist/extensions/tools/executors/index.d.ts +0 -1
  69. package/dist/extensions/tools/executors/search.d.ts +1 -2
  70. package/dist/extensions/tools/executors/web-fetch.d.ts +0 -1
  71. package/dist/extensions/tools/helpers.d.ts +1 -1
  72. package/dist/extensions/tools/index.d.ts +5 -5
  73. package/dist/extensions/tools/model-tool-routing.d.ts +0 -1
  74. package/dist/extensions/tools/presets.d.ts +30 -48
  75. package/dist/extensions/tools/runtime.d.ts +24 -0
  76. package/dist/extensions/tools/schemas.d.ts +25 -4
  77. package/dist/extensions/tools/team/delegated-agent.d.ts +4 -5
  78. package/dist/extensions/tools/team/index.d.ts +0 -1
  79. package/dist/extensions/tools/team/multi-agent.d.ts +7 -4
  80. package/dist/extensions/tools/team/projections.d.ts +0 -1
  81. package/dist/extensions/tools/team/runtime.d.ts +0 -1
  82. package/dist/extensions/tools/team/spawn-agent-tool.d.ts +4 -5
  83. package/dist/extensions/tools/team/subagent-prompts.d.ts +0 -1
  84. package/dist/extensions/tools/team/team-tools.d.ts +8 -8
  85. package/dist/extensions/tools/types.d.ts +11 -17
  86. package/dist/hooks/checkpoint-hooks.d.ts +9 -2
  87. package/dist/hooks/hook-extension.d.ts +2 -0
  88. package/dist/{extensions/config/hooks-config-loader.d.ts → hooks/hook-file-config.d.ts} +1 -2
  89. package/dist/hooks/hook-file-hooks.d.ts +7 -3
  90. package/dist/hooks/index.d.ts +3 -2
  91. package/dist/hooks/subprocess-runner.d.ts +0 -1
  92. package/dist/hooks/subprocess.d.ts +8 -2
  93. package/dist/hub/client/connect.d.ts +14 -0
  94. package/dist/hub/client/index.d.ts +82 -0
  95. package/dist/hub/client/session-client.d.ts +118 -0
  96. package/dist/hub/client/ui-client.d.ts +45 -0
  97. package/dist/hub/daemon/entry.d.ts +1 -0
  98. package/dist/hub/daemon/entry.js +720 -0
  99. package/dist/hub/daemon/index.d.ts +8 -0
  100. package/dist/hub/daemon/runtime-handlers.d.ts +12 -0
  101. package/dist/hub/daemon/start-shared-server.d.ts +18 -0
  102. package/dist/hub/discovery/defaults.d.ts +16 -0
  103. package/dist/hub/discovery/index.d.ts +30 -0
  104. package/dist/hub/discovery/workspace.d.ts +3 -0
  105. package/dist/hub/index.d.ts +32 -0
  106. package/dist/hub/index.js +717 -0
  107. package/dist/hub/runtime-host/hub-runtime-host.d.ts +74 -0
  108. package/dist/hub/runtime-host/remote-runtime-host.d.ts +9 -0
  109. package/dist/hub/server/browser-websocket.d.ts +17 -0
  110. package/dist/hub/server/command-transport.d.ts +7 -0
  111. package/dist/hub/server/handlers/approval-handlers.d.ts +17 -0
  112. package/dist/hub/server/handlers/capability-handlers.d.ts +12 -0
  113. package/dist/hub/server/handlers/client-handlers.d.ts +6 -0
  114. package/dist/hub/server/handlers/context.d.ts +56 -0
  115. package/dist/hub/server/handlers/run-handlers.d.ts +5 -0
  116. package/dist/hub/server/handlers/session-event-projector.d.ts +7 -0
  117. package/dist/hub/server/handlers/session-handlers.d.ts +20 -0
  118. package/dist/hub/server/hub-client-contributions.d.ts +19 -0
  119. package/dist/hub/server/hub-notifications.d.ts +7 -0
  120. package/dist/hub/server/hub-schedule-events.d.ts +2 -0
  121. package/dist/hub/server/hub-server-logging.d.ts +2 -0
  122. package/dist/hub/server/hub-server-options.d.ts +55 -0
  123. package/dist/hub/server/hub-server-transport.d.ts +34 -0
  124. package/dist/hub/server/hub-session-records.d.ts +8 -0
  125. package/dist/hub/server/hub-websocket-server.d.ts +6 -0
  126. package/dist/hub/server/index.d.ts +4 -0
  127. package/dist/hub/server/native-transport.d.ts +16 -0
  128. package/dist/index.d.ts +59 -36
  129. package/dist/index.js +477 -824
  130. package/dist/runtime/capabilities/index.d.ts +2 -0
  131. package/dist/runtime/capabilities/normalize-runtime-capabilities.d.ts +2 -0
  132. package/dist/runtime/capabilities/runtime-capabilities.d.ts +6 -0
  133. package/dist/runtime/config/agent-message-codec.d.ts +6 -0
  134. package/dist/runtime/config/agent-runtime-config-builder.d.ts +85 -0
  135. package/dist/runtime/host/history.d.ts +18 -0
  136. package/dist/runtime/host/host.d.ts +7 -0
  137. package/dist/runtime/host/local/agent-event-bridge.d.ts +29 -0
  138. package/dist/runtime/host/local/session-record.d.ts +6 -0
  139. package/dist/runtime/host/local/session-service-invoker.d.ts +4 -0
  140. package/dist/runtime/host/local/spawn-tool.d.ts +15 -0
  141. package/dist/runtime/host/local/user-files.d.ts +1 -0
  142. package/dist/runtime/host/local-runtime-host.d.ts +118 -0
  143. package/dist/{transports → runtime/host}/runtime-host-support.d.ts +4 -5
  144. package/dist/runtime/host/runtime-host.d.ts +162 -0
  145. package/dist/runtime/{runtime-builder.d.ts → orchestration/runtime-builder.d.ts} +0 -1
  146. package/dist/runtime/orchestration/runtime-event-adapter.d.ts +101 -0
  147. package/dist/runtime/{runtime-oauth-token-manager.d.ts → orchestration/runtime-oauth-token-manager.d.ts} +1 -2
  148. package/dist/runtime/orchestration/session-runtime-orchestrator.d.ts +215 -0
  149. package/dist/runtime/orchestration/session-runtime.d.ts +58 -0
  150. package/dist/runtime/orchestration/user-input-builder.d.ts +15 -0
  151. package/dist/runtime/safety/loop-detection.d.ts +58 -0
  152. package/dist/runtime/safety/mistake-tracker.d.ts +68 -0
  153. package/dist/runtime/{rules.d.ts → safety/rules.d.ts} +2 -2
  154. package/dist/runtime/{subprocess-sandbox.d.ts → tools/subprocess-sandbox.d.ts} +15 -1
  155. package/dist/runtime/{tool-approval.d.ts → tools/tool-approval.d.ts} +0 -1
  156. package/dist/runtime/turn-queue/pending-prompt-service.d.ts +64 -0
  157. package/dist/services/agent-events.d.ts +1 -2
  158. package/dist/services/config.d.ts +0 -1
  159. package/dist/services/global-settings.d.ts +18 -0
  160. package/dist/services/llms/cline-recommended-models.d.ts +19 -0
  161. package/dist/services/llms/configured-provider-registry.d.ts +27 -0
  162. package/dist/services/llms/handler-factory.d.ts +3 -0
  163. package/dist/services/llms/provider-defaults.d.ts +26 -0
  164. package/dist/services/llms/provider-settings.d.ts +244 -0
  165. package/dist/services/llms/runtime-config.d.ts +3 -0
  166. package/dist/services/llms/runtime-registry.d.ts +19 -0
  167. package/dist/services/llms/runtime-types.d.ts +84 -0
  168. package/dist/services/local-runtime-bootstrap.d.ts +14 -10
  169. package/dist/services/plugin-tools.d.ts +15 -0
  170. package/dist/services/providers/local-provider-registry.d.ts +199 -24
  171. package/dist/services/providers/local-provider-service.d.ts +15 -14
  172. package/dist/services/session-artifacts.d.ts +0 -1
  173. package/dist/services/session-data.d.ts +2 -3
  174. package/dist/services/session-telemetry.d.ts +7 -3
  175. package/dist/services/storage/file-team-store.d.ts +0 -1
  176. package/dist/services/storage/provider-settings-legacy-migration.d.ts +1 -2
  177. package/dist/services/storage/provider-settings-manager.d.ts +1 -1
  178. package/dist/services/storage/sqlite-session-store.d.ts +0 -1
  179. package/dist/services/storage/sqlite-team-store.d.ts +0 -1
  180. package/dist/services/storage/team-store.d.ts +0 -1
  181. package/dist/services/telemetry/ITelemetryAdapter.d.ts +0 -1
  182. package/dist/services/telemetry/OpenTelemetryAdapter.d.ts +0 -1
  183. package/dist/services/telemetry/OpenTelemetryProvider.d.ts +32 -1
  184. package/dist/services/telemetry/TelemetryLoggerSink.d.ts +0 -1
  185. package/dist/services/telemetry/TelemetryService.d.ts +0 -1
  186. package/dist/services/telemetry/core-events.d.ts +43 -2
  187. package/dist/services/telemetry/distinct-id.d.ts +0 -1
  188. package/dist/services/telemetry/index.d.ts +1 -2
  189. package/dist/services/telemetry/index.js +1 -15
  190. package/dist/services/usage.d.ts +3 -2
  191. package/dist/services/workspace/file-indexer.d.ts +0 -1
  192. package/dist/services/workspace/index.d.ts +0 -1
  193. package/dist/services/workspace/mention-enricher.d.ts +0 -1
  194. package/dist/{session → services/workspace}/workspace-manager.d.ts +0 -1
  195. package/dist/services/workspace/workspace-manifest.d.ts +31 -0
  196. package/dist/services/workspace/workspace-telemetry.d.ts +18 -0
  197. package/dist/session/checkpoint-restore.d.ts +20 -0
  198. package/dist/session/{session-graph.d.ts → models/session-graph.d.ts} +2 -3
  199. package/dist/session/{session-manifest.d.ts → models/session-manifest.d.ts} +1 -2
  200. package/dist/session/{session-service.d.ts → models/session-row.d.ts} +13 -35
  201. package/dist/session/{file-session-service.d.ts → services/file-session-service.d.ts} +1 -2
  202. package/dist/session/services/message-builder.d.ts +56 -0
  203. package/dist/session/{persistence-service.d.ts → services/persistence-service.d.ts} +14 -27
  204. package/dist/session/services/session-service.d.ts +13 -0
  205. package/dist/session/session-snapshot.d.ts +57 -0
  206. package/dist/session/session-versioning-service.d.ts +48 -0
  207. package/dist/session/stores/conversation-store.d.ts +29 -0
  208. package/dist/session/stores/session-manifest-store.d.ts +21 -0
  209. package/dist/session/stores/team-persistence-store.d.ts +23 -0
  210. package/dist/session/team/index.d.ts +2 -0
  211. package/dist/session/team/team-child-session-manager.d.ts +35 -0
  212. package/dist/session/{session-team-coordination.d.ts → team/team-session-coordinator.d.ts} +3 -4
  213. package/dist/settings/index.d.ts +2 -0
  214. package/dist/settings/settings-service.d.ts +6 -0
  215. package/dist/settings/types.d.ts +42 -0
  216. package/dist/types/chat-schema.d.ts +33 -18
  217. package/dist/types/common.d.ts +0 -1
  218. package/dist/types/config.d.ts +19 -10
  219. package/dist/types/events.d.ts +15 -7
  220. package/dist/types/provider-settings.d.ts +4 -6
  221. package/dist/types/session.d.ts +26 -6
  222. package/dist/types/sessions.d.ts +0 -1
  223. package/dist/types/storage.d.ts +0 -1
  224. package/dist/types.d.ts +24 -14
  225. package/dist/version.d.ts +0 -1
  226. package/package.json +26 -8
  227. package/dist/ClineCore.d.ts.map +0 -1
  228. package/dist/account/cline-account-service.d.ts.map +0 -1
  229. package/dist/account/index.d.ts.map +0 -1
  230. package/dist/account/rpc.d.ts.map +0 -1
  231. package/dist/account/types.d.ts.map +0 -1
  232. package/dist/auth/bounded-ttl-cache.d.ts.map +0 -1
  233. package/dist/auth/client.d.ts.map +0 -1
  234. package/dist/auth/cline.d.ts.map +0 -1
  235. package/dist/auth/codex.d.ts.map +0 -1
  236. package/dist/auth/oca.d.ts.map +0 -1
  237. package/dist/auth/server.d.ts.map +0 -1
  238. package/dist/auth/types.d.ts.map +0 -1
  239. package/dist/auth/utils.d.ts.map +0 -1
  240. package/dist/extensions/config/agent-config-loader.d.ts +0 -19
  241. package/dist/extensions/config/agent-config-loader.d.ts.map +0 -1
  242. package/dist/extensions/config/agent-config-parser.d.ts +0 -29
  243. package/dist/extensions/config/agent-config-parser.d.ts.map +0 -1
  244. package/dist/extensions/config/hooks-config-loader.d.ts.map +0 -1
  245. package/dist/extensions/config/index.d.ts.map +0 -1
  246. package/dist/extensions/config/runtime-commands.d.ts.map +0 -1
  247. package/dist/extensions/config/unified-config-file-watcher.d.ts.map +0 -1
  248. package/dist/extensions/config/user-instruction-config-loader.d.ts.map +0 -1
  249. package/dist/extensions/context/agentic-compaction.d.ts.map +0 -1
  250. package/dist/extensions/context/basic-compaction.d.ts.map +0 -1
  251. package/dist/extensions/context/compaction-shared.d.ts.map +0 -1
  252. package/dist/extensions/context/compaction.d.ts.map +0 -1
  253. package/dist/extensions/index.d.ts.map +0 -1
  254. package/dist/extensions/mcp/client.d.ts.map +0 -1
  255. package/dist/extensions/mcp/config-loader.d.ts.map +0 -1
  256. package/dist/extensions/mcp/index.d.ts.map +0 -1
  257. package/dist/extensions/mcp/manager.d.ts.map +0 -1
  258. package/dist/extensions/mcp/name-transform.d.ts.map +0 -1
  259. package/dist/extensions/mcp/policies.d.ts.map +0 -1
  260. package/dist/extensions/mcp/tools.d.ts.map +0 -1
  261. package/dist/extensions/mcp/types.d.ts.map +0 -1
  262. package/dist/extensions/plugin/plugin-config-loader.d.ts.map +0 -1
  263. package/dist/extensions/plugin/plugin-load-report.d.ts.map +0 -1
  264. package/dist/extensions/plugin/plugin-loader.d.ts.map +0 -1
  265. package/dist/extensions/plugin/plugin-module-import.d.ts.map +0 -1
  266. package/dist/extensions/plugin/plugin-sandbox.d.ts.map +0 -1
  267. package/dist/extensions/tools/constants.d.ts.map +0 -1
  268. package/dist/extensions/tools/definitions.d.ts.map +0 -1
  269. package/dist/extensions/tools/executors/apply-patch-parser.d.ts.map +0 -1
  270. package/dist/extensions/tools/executors/apply-patch.d.ts.map +0 -1
  271. package/dist/extensions/tools/executors/bash.d.ts.map +0 -1
  272. package/dist/extensions/tools/executors/editor.d.ts.map +0 -1
  273. package/dist/extensions/tools/executors/file-read.d.ts.map +0 -1
  274. package/dist/extensions/tools/executors/index.d.ts.map +0 -1
  275. package/dist/extensions/tools/executors/search.d.ts.map +0 -1
  276. package/dist/extensions/tools/executors/web-fetch.d.ts.map +0 -1
  277. package/dist/extensions/tools/helpers.d.ts.map +0 -1
  278. package/dist/extensions/tools/index.d.ts.map +0 -1
  279. package/dist/extensions/tools/model-tool-routing.d.ts.map +0 -1
  280. package/dist/extensions/tools/presets.d.ts.map +0 -1
  281. package/dist/extensions/tools/schemas.d.ts.map +0 -1
  282. package/dist/extensions/tools/team/delegated-agent.d.ts.map +0 -1
  283. package/dist/extensions/tools/team/index.d.ts.map +0 -1
  284. package/dist/extensions/tools/team/multi-agent.d.ts.map +0 -1
  285. package/dist/extensions/tools/team/projections.d.ts.map +0 -1
  286. package/dist/extensions/tools/team/runtime.d.ts.map +0 -1
  287. package/dist/extensions/tools/team/spawn-agent-tool.d.ts.map +0 -1
  288. package/dist/extensions/tools/team/subagent-prompts.d.ts.map +0 -1
  289. package/dist/extensions/tools/team/team-tools.d.ts.map +0 -1
  290. package/dist/extensions/tools/types.d.ts.map +0 -1
  291. package/dist/hooks/checkpoint-hooks.d.ts.map +0 -1
  292. package/dist/hooks/hook-file-hooks.d.ts.map +0 -1
  293. package/dist/hooks/index.d.ts.map +0 -1
  294. package/dist/hooks/persistent.d.ts +0 -64
  295. package/dist/hooks/persistent.d.ts.map +0 -1
  296. package/dist/hooks/subprocess-runner.d.ts.map +0 -1
  297. package/dist/hooks/subprocess.d.ts.map +0 -1
  298. package/dist/index.d.ts.map +0 -1
  299. package/dist/runtime/history.d.ts +0 -4
  300. package/dist/runtime/history.d.ts.map +0 -1
  301. package/dist/runtime/host.d.ts +0 -9
  302. package/dist/runtime/host.d.ts.map +0 -1
  303. package/dist/runtime/rpc-runtime-ensure.d.ts +0 -65
  304. package/dist/runtime/rpc-runtime-ensure.d.ts.map +0 -1
  305. package/dist/runtime/rpc-spawn-lease.d.ts +0 -8
  306. package/dist/runtime/rpc-spawn-lease.d.ts.map +0 -1
  307. package/dist/runtime/rules.d.ts.map +0 -1
  308. package/dist/runtime/runtime-builder.d.ts.map +0 -1
  309. package/dist/runtime/runtime-host.d.ts +0 -105
  310. package/dist/runtime/runtime-host.d.ts.map +0 -1
  311. package/dist/runtime/runtime-oauth-token-manager.d.ts.map +0 -1
  312. package/dist/runtime/session-runtime.d.ts +0 -61
  313. package/dist/runtime/session-runtime.d.ts.map +0 -1
  314. package/dist/runtime/subprocess-sandbox.d.ts.map +0 -1
  315. package/dist/runtime/tool-approval.d.ts.map +0 -1
  316. package/dist/services/agent-events.d.ts.map +0 -1
  317. package/dist/services/config.d.ts.map +0 -1
  318. package/dist/services/local-runtime-bootstrap.d.ts.map +0 -1
  319. package/dist/services/providers/local-provider-registry.d.ts.map +0 -1
  320. package/dist/services/providers/local-provider-service.d.ts.map +0 -1
  321. package/dist/services/session-artifacts.d.ts.map +0 -1
  322. package/dist/services/session-data.d.ts.map +0 -1
  323. package/dist/services/session-telemetry.d.ts.map +0 -1
  324. package/dist/services/storage/file-team-store.d.ts.map +0 -1
  325. package/dist/services/storage/provider-settings-legacy-migration.d.ts.map +0 -1
  326. package/dist/services/storage/provider-settings-manager.d.ts.map +0 -1
  327. package/dist/services/storage/sqlite-session-store.d.ts.map +0 -1
  328. package/dist/services/storage/sqlite-team-store.d.ts.map +0 -1
  329. package/dist/services/storage/team-store.d.ts.map +0 -1
  330. package/dist/services/telemetry/ITelemetryAdapter.d.ts.map +0 -1
  331. package/dist/services/telemetry/OpenTelemetryAdapter.d.ts.map +0 -1
  332. package/dist/services/telemetry/OpenTelemetryProvider.d.ts.map +0 -1
  333. package/dist/services/telemetry/TelemetryLoggerSink.d.ts.map +0 -1
  334. package/dist/services/telemetry/TelemetryService.d.ts.map +0 -1
  335. package/dist/services/telemetry/core-events.d.ts.map +0 -1
  336. package/dist/services/telemetry/distinct-id.d.ts.map +0 -1
  337. package/dist/services/telemetry/index.d.ts.map +0 -1
  338. package/dist/services/usage.d.ts.map +0 -1
  339. package/dist/services/workspace/file-indexer.d.ts.map +0 -1
  340. package/dist/services/workspace/index.d.ts.map +0 -1
  341. package/dist/services/workspace/mention-enricher.d.ts.map +0 -1
  342. package/dist/services/workspace-manifest.d.ts +0 -5
  343. package/dist/services/workspace-manifest.d.ts.map +0 -1
  344. package/dist/session/file-session-service.d.ts.map +0 -1
  345. package/dist/session/persistence-service.d.ts.map +0 -1
  346. package/dist/session/rpc-session-service.d.ts +0 -16
  347. package/dist/session/rpc-session-service.d.ts.map +0 -1
  348. package/dist/session/session-graph.d.ts.map +0 -1
  349. package/dist/session/session-manifest.d.ts.map +0 -1
  350. package/dist/session/session-service.d.ts.map +0 -1
  351. package/dist/session/session-team-coordination.d.ts.map +0 -1
  352. package/dist/session/sqlite-rpc-session-backend.d.ts +0 -31
  353. package/dist/session/sqlite-rpc-session-backend.d.ts.map +0 -1
  354. package/dist/session/workspace-manager.d.ts.map +0 -1
  355. package/dist/transports/local.d.ts +0 -105
  356. package/dist/transports/local.d.ts.map +0 -1
  357. package/dist/transports/rpc.d.ts +0 -51
  358. package/dist/transports/rpc.d.ts.map +0 -1
  359. package/dist/transports/runtime-host-support.d.ts.map +0 -1
  360. package/dist/types/chat-schema.d.ts.map +0 -1
  361. package/dist/types/common.d.ts.map +0 -1
  362. package/dist/types/config.d.ts.map +0 -1
  363. package/dist/types/events.d.ts.map +0 -1
  364. package/dist/types/provider-settings.d.ts.map +0 -1
  365. package/dist/types/session.d.ts.map +0 -1
  366. package/dist/types/sessions.d.ts.map +0 -1
  367. package/dist/types/storage.d.ts.map +0 -1
  368. package/dist/types.d.ts.map +0 -1
  369. package/dist/version.d.ts.map +0 -1
  370. package/src/ClineCore.test.ts +0 -226
  371. package/src/ClineCore.ts +0 -313
  372. package/src/account/cline-account-service.test.ts +0 -185
  373. package/src/account/cline-account-service.ts +0 -300
  374. package/src/account/featurebase-token.test.ts +0 -175
  375. package/src/account/index.ts +0 -24
  376. package/src/account/rpc.test.ts +0 -63
  377. package/src/account/rpc.ts +0 -185
  378. package/src/account/types.ts +0 -108
  379. package/src/auth/bounded-ttl-cache.test.ts +0 -38
  380. package/src/auth/bounded-ttl-cache.ts +0 -53
  381. package/src/auth/client.test.ts +0 -69
  382. package/src/auth/client.ts +0 -46
  383. package/src/auth/cline.test.ts +0 -267
  384. package/src/auth/cline.ts +0 -724
  385. package/src/auth/codex.test.ts +0 -170
  386. package/src/auth/codex.ts +0 -491
  387. package/src/auth/oca.test.ts +0 -340
  388. package/src/auth/oca.ts +0 -588
  389. package/src/auth/server.test.ts +0 -287
  390. package/src/auth/server.ts +0 -265
  391. package/src/auth/types.ts +0 -110
  392. package/src/auth/utils.test.ts +0 -128
  393. package/src/auth/utils.ts +0 -247
  394. package/src/extensions/config/agent-config-loader.test.ts +0 -236
  395. package/src/extensions/config/agent-config-loader.ts +0 -104
  396. package/src/extensions/config/agent-config-parser.ts +0 -198
  397. package/src/extensions/config/hooks-config-loader.test.ts +0 -20
  398. package/src/extensions/config/hooks-config-loader.ts +0 -117
  399. package/src/extensions/config/index.ts +0 -77
  400. package/src/extensions/config/runtime-commands.test.ts +0 -115
  401. package/src/extensions/config/runtime-commands.ts +0 -76
  402. package/src/extensions/config/unified-config-file-watcher.test.ts +0 -196
  403. package/src/extensions/config/unified-config-file-watcher.ts +0 -496
  404. package/src/extensions/config/user-instruction-config-loader.test.ts +0 -246
  405. package/src/extensions/config/user-instruction-config-loader.ts +0 -548
  406. package/src/extensions/context/agentic-compaction.ts +0 -131
  407. package/src/extensions/context/basic-compaction.ts +0 -300
  408. package/src/extensions/context/compaction-shared.ts +0 -458
  409. package/src/extensions/context/compaction.test.ts +0 -483
  410. package/src/extensions/context/compaction.ts +0 -226
  411. package/src/extensions/index.ts +0 -18
  412. package/src/extensions/mcp/client.ts +0 -420
  413. package/src/extensions/mcp/config-loader.test.ts +0 -238
  414. package/src/extensions/mcp/config-loader.ts +0 -219
  415. package/src/extensions/mcp/index.ts +0 -42
  416. package/src/extensions/mcp/manager.test.ts +0 -105
  417. package/src/extensions/mcp/manager.ts +0 -260
  418. package/src/extensions/mcp/name-transform.ts +0 -33
  419. package/src/extensions/mcp/policies.ts +0 -47
  420. package/src/extensions/mcp/tools.ts +0 -47
  421. package/src/extensions/mcp/types.ts +0 -116
  422. package/src/extensions/plugin/plugin-config-loader.test.ts +0 -184
  423. package/src/extensions/plugin/plugin-config-loader.ts +0 -105
  424. package/src/extensions/plugin/plugin-load-report.ts +0 -20
  425. package/src/extensions/plugin/plugin-loader.test.ts +0 -292
  426. package/src/extensions/plugin/plugin-loader.ts +0 -160
  427. package/src/extensions/plugin/plugin-module-import.ts +0 -278
  428. package/src/extensions/plugin/plugin-sandbox-bootstrap.ts +0 -458
  429. package/src/extensions/plugin/plugin-sandbox.test.ts +0 -423
  430. package/src/extensions/plugin/plugin-sandbox.ts +0 -442
  431. package/src/extensions/tools/constants.ts +0 -35
  432. package/src/extensions/tools/definitions.test.ts +0 -780
  433. package/src/extensions/tools/definitions.ts +0 -748
  434. package/src/extensions/tools/executors/apply-patch-parser.ts +0 -520
  435. package/src/extensions/tools/executors/apply-patch.ts +0 -359
  436. package/src/extensions/tools/executors/bash.test.ts +0 -87
  437. package/src/extensions/tools/executors/bash.ts +0 -207
  438. package/src/extensions/tools/executors/editor.test.ts +0 -35
  439. package/src/extensions/tools/executors/editor.ts +0 -219
  440. package/src/extensions/tools/executors/file-read.test.ts +0 -125
  441. package/src/extensions/tools/executors/file-read.ts +0 -135
  442. package/src/extensions/tools/executors/index.ts +0 -87
  443. package/src/extensions/tools/executors/search.ts +0 -278
  444. package/src/extensions/tools/executors/web-fetch.ts +0 -259
  445. package/src/extensions/tools/helpers.ts +0 -130
  446. package/src/extensions/tools/index.ts +0 -174
  447. package/src/extensions/tools/model-tool-routing.test.ts +0 -86
  448. package/src/extensions/tools/model-tool-routing.ts +0 -134
  449. package/src/extensions/tools/presets.test.ts +0 -70
  450. package/src/extensions/tools/presets.ts +0 -205
  451. package/src/extensions/tools/schemas.ts +0 -346
  452. package/src/extensions/tools/team/delegated-agent.ts +0 -131
  453. package/src/extensions/tools/team/index.ts +0 -5
  454. package/src/extensions/tools/team/multi-agent.lifecycle.test.ts +0 -455
  455. package/src/extensions/tools/team/multi-agent.ts +0 -1729
  456. package/src/extensions/tools/team/projections.ts +0 -283
  457. package/src/extensions/tools/team/runtime.ts +0 -54
  458. package/src/extensions/tools/team/spawn-agent-tool.test.ts +0 -381
  459. package/src/extensions/tools/team/spawn-agent-tool.ts +0 -201
  460. package/src/extensions/tools/team/subagent-prompts.ts +0 -41
  461. package/src/extensions/tools/team/team-tools.test.ts +0 -918
  462. package/src/extensions/tools/team/team-tools.ts +0 -821
  463. package/src/extensions/tools/types.ts +0 -360
  464. package/src/hooks/checkpoint-hooks.test.ts +0 -168
  465. package/src/hooks/checkpoint-hooks.ts +0 -238
  466. package/src/hooks/hook-file-hooks.test.ts +0 -311
  467. package/src/hooks/hook-file-hooks.ts +0 -873
  468. package/src/hooks/index.ts +0 -25
  469. package/src/hooks/persistent.ts +0 -661
  470. package/src/hooks/subprocess-runner.ts +0 -196
  471. package/src/hooks/subprocess.ts +0 -460
  472. package/src/index.ts +0 -587
  473. package/src/runtime/history.test.ts +0 -114
  474. package/src/runtime/history.ts +0 -237
  475. package/src/runtime/host.test.ts +0 -230
  476. package/src/runtime/host.ts +0 -362
  477. package/src/runtime/index.ts +0 -22
  478. package/src/runtime/rpc-runtime-ensure.test.ts +0 -123
  479. package/src/runtime/rpc-runtime-ensure.ts +0 -659
  480. package/src/runtime/rpc-spawn-lease.test.ts +0 -81
  481. package/src/runtime/rpc-spawn-lease.ts +0 -156
  482. package/src/runtime/rules.ts +0 -37
  483. package/src/runtime/runtime-builder.team-persistence.test.ts +0 -245
  484. package/src/runtime/runtime-builder.test.ts +0 -615
  485. package/src/runtime/runtime-builder.ts +0 -742
  486. package/src/runtime/runtime-host.ts +0 -178
  487. package/src/runtime/runtime-oauth-token-manager.test.ts +0 -137
  488. package/src/runtime/runtime-oauth-token-manager.ts +0 -272
  489. package/src/runtime/runtime-parity.test.ts +0 -143
  490. package/src/runtime/session-runtime.ts +0 -79
  491. package/src/runtime/subprocess-sandbox.ts +0 -255
  492. package/src/runtime/tool-approval.ts +0 -102
  493. package/src/services/agent-events.ts +0 -256
  494. package/src/services/config.ts +0 -5
  495. package/src/services/local-runtime-bootstrap.ts +0 -280
  496. package/src/services/providers/local-provider-registry.ts +0 -240
  497. package/src/services/providers/local-provider-service.test.ts +0 -1062
  498. package/src/services/providers/local-provider-service.ts +0 -707
  499. package/src/services/session-artifacts.ts +0 -138
  500. package/src/services/session-data.test.ts +0 -160
  501. package/src/services/session-data.ts +0 -390
  502. package/src/services/session-telemetry.ts +0 -98
  503. package/src/services/storage/artifact-store.ts +0 -1
  504. package/src/services/storage/file-team-store.ts +0 -254
  505. package/src/services/storage/index.ts +0 -11
  506. package/src/services/storage/provider-settings-legacy-migration.test.ts +0 -424
  507. package/src/services/storage/provider-settings-legacy-migration.ts +0 -826
  508. package/src/services/storage/provider-settings-manager.test.ts +0 -191
  509. package/src/services/storage/provider-settings-manager.ts +0 -152
  510. package/src/services/storage/session-store.ts +0 -1
  511. package/src/services/storage/sqlite-session-store.ts +0 -270
  512. package/src/services/storage/sqlite-team-store.ts +0 -541
  513. package/src/services/storage/team-store.ts +0 -36
  514. package/src/services/telemetry/ITelemetryAdapter.ts +0 -94
  515. package/src/services/telemetry/OpenTelemetryAdapter.test.ts +0 -157
  516. package/src/services/telemetry/OpenTelemetryAdapter.ts +0 -348
  517. package/src/services/telemetry/OpenTelemetryProvider.test.ts +0 -326
  518. package/src/services/telemetry/OpenTelemetryProvider.ts +0 -415
  519. package/src/services/telemetry/TelemetryLoggerSink.test.ts +0 -42
  520. package/src/services/telemetry/TelemetryLoggerSink.ts +0 -121
  521. package/src/services/telemetry/TelemetryService.test.ts +0 -134
  522. package/src/services/telemetry/TelemetryService.ts +0 -139
  523. package/src/services/telemetry/core-events.ts +0 -400
  524. package/src/services/telemetry/distinct-id.test.ts +0 -57
  525. package/src/services/telemetry/distinct-id.ts +0 -58
  526. package/src/services/telemetry/index.ts +0 -20
  527. package/src/services/usage.ts +0 -32
  528. package/src/services/workspace/file-indexer.d.ts +0 -11
  529. package/src/services/workspace/file-indexer.test.ts +0 -156
  530. package/src/services/workspace/file-indexer.ts +0 -351
  531. package/src/services/workspace/index.ts +0 -7
  532. package/src/services/workspace/mention-enricher.test.ts +0 -106
  533. package/src/services/workspace/mention-enricher.ts +0 -122
  534. package/src/services/workspace-manifest.ts +0 -54
  535. package/src/session/file-session-service.ts +0 -282
  536. package/src/session/index.ts +0 -53
  537. package/src/session/persistence-service.test.ts +0 -300
  538. package/src/session/persistence-service.ts +0 -944
  539. package/src/session/rpc-session-service.ts +0 -114
  540. package/src/session/session-graph.ts +0 -92
  541. package/src/session/session-manifest.ts +0 -29
  542. package/src/session/session-service.team-persistence.test.ts +0 -48
  543. package/src/session/session-service.ts +0 -683
  544. package/src/session/session-team-coordination.ts +0 -240
  545. package/src/session/sqlite-rpc-session-backend.ts +0 -301
  546. package/src/session/workspace-manager.ts +0 -100
  547. package/src/transports/local.e2e.test.ts +0 -380
  548. package/src/transports/local.test.ts +0 -2559
  549. package/src/transports/local.ts +0 -1500
  550. package/src/transports/rpc.test.ts +0 -82
  551. package/src/transports/rpc.ts +0 -665
  552. package/src/transports/runtime-host-support.ts +0 -86
  553. package/src/types/chat-schema.ts +0 -82
  554. package/src/types/common.ts +0 -26
  555. package/src/types/config.ts +0 -210
  556. package/src/types/events.ts +0 -78
  557. package/src/types/index.ts +0 -23
  558. package/src/types/provider-settings.ts +0 -43
  559. package/src/types/session.ts +0 -110
  560. package/src/types/sessions.ts +0 -37
  561. package/src/types/storage.ts +0 -56
  562. package/src/types.ts +0 -127
  563. package/src/version.ts +0 -3
package/README.md CHANGED
@@ -57,7 +57,8 @@ await cline.dispose();
57
57
 
58
58
  Use it when a host needs to prepare workspace-scoped runtime state before each
59
59
  session starts, then apply watcher/extensions/telemetry inputs through
60
- `localRuntime.configOverrides` without widening the shared host contract.
60
+ explicit `localRuntime` bootstrap fields without widening the shared host
61
+ contract.
61
62
 
62
63
  ## Main APIs
63
64
 
@@ -68,8 +69,17 @@ Use `@clinebot/core` for host-facing runtime assembly:
68
69
  - `ClineCore.create(...)`
69
70
  - `createRuntimeHost(...)`
70
71
  - `LocalRuntimeHost`
72
+ - `HubRuntimeHost` and `RemoteRuntimeHost`
71
73
  - `DefaultRuntimeBuilder`
72
74
 
75
+ `ClineCore` is the app-facing session API. The lower-level `RuntimeHost`
76
+ boundary uses runtime-primitive names such as `startSession` and `runTurn` so
77
+ transport adapters stay distinct from product methods like `start` and `send`.
78
+ Service-style operations such as pending prompt edits, accumulated usage lookup,
79
+ and active-session model switching are exposed through `ClineCore` when the
80
+ selected transport supports them rather than being part of the minimal host
81
+ primitive vocabulary.
82
+
73
83
  ### Default Tools
74
84
 
75
85
  `@clinebot/core` owns the built-in host tools and executors:
@@ -84,13 +94,12 @@ The package also exports storage and settings helpers such as:
84
94
 
85
95
  - `ProviderSettingsManager`
86
96
  - `SqliteTeamStore`
87
- - SQLite RPC session backend helpers from `@clinebot/core`
97
+ - SQLite-backed local session stores and artifacts through `@clinebot/core`
88
98
 
89
99
  ## Related Packages
90
100
 
91
101
  - `@clinebot/agents`: stateless agent loop and tool primitives
92
102
  - `@clinebot/llms`: provider/model configuration and handlers
93
- - `@clinebot/rpc`: remote session and runtime transport
94
103
 
95
104
  ## More Examples
96
105
 
@@ -1,155 +1,282 @@
1
- import type { AgentConfig, BasicLogger, ITelemetryService, ToolApprovalRequest, ToolApprovalResult } from "@clinebot/shared";
2
- import type { ToolExecutors } from "./extensions/tools";
3
- import type { SessionBackend } from "./runtime/host";
4
- import type { LocalRuntimeStartOptions, RuntimeHost, RuntimeHostMode, StartSessionInput, StartSessionResult } from "./runtime/runtime-host";
5
- import type { TeamToolsFactory } from "./runtime/session-runtime";
6
- import type { CoreSessionConfig } from "./types/config";
7
- import type { SessionMessagesArtifactUploader } from "./types/session";
8
- /** Advanced options for connecting to or spawning the Cline RPC server. */
9
- export interface RpcOptions {
1
+ import type { ClineCoreAutomationApi, ClineCoreListHistoryOptions, ClineCoreOptions, ClineCoreSettingsApi, ClineCoreStartInput, RestoreInput, RestoreResult } from "./cline-core/types";
2
+ import type { PendingPromptsServiceApi, RuntimeHost, RuntimeHostSubscribeOptions, SessionModelRuntimeService, SessionUsageRuntimeService, StartSessionInput, StartSessionResult } from "./runtime/host/runtime-host";
3
+ import type { CoreSessionEvent } from "./types/events";
4
+ import type { SessionHistoryRecord } from "./types/sessions";
5
+ export type { ClineAutomationEventIngressResult, ClineAutomationEventLog, ClineAutomationEventSuppression, ClineAutomationListEventsOptions, ClineAutomationListRunsOptions, ClineAutomationListSpecsOptions, ClineAutomationRun, ClineAutomationRunStatus, ClineAutomationSpec, ClineCoreAutomationApi, ClineCoreAutomationOptions, ClineCoreListHistoryOptions, ClineCoreOptions, ClineCoreSettingsApi, ClineCoreStartInput, HubOptions, RemoteOptions, RestoreInput, RestoreOptions, RestoreResult, RuntimeHostMode, StartSessionBootstrap, } from "./cline-core/types";
6
+ /**
7
+ * The primary entry point for the Cline Core SDK.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * import { ClineCore } from "@clinebot/core";
12
+ *
13
+ * const cline = await ClineCore.create({ clientName: "my-app" });
14
+ * const session = await cline.start({ ... });
15
+ * ```
16
+ */
17
+ export declare class ClineCore {
18
+ readonly clientName: string | undefined;
19
+ readonly runtimeAddress: string | undefined;
20
+ readonly automation: ClineCoreAutomationApi;
21
+ readonly settings: ClineCoreSettingsApi;
22
+ readonly pendingPrompts: PendingPromptsServiceApi;
23
+ private readonly host;
24
+ private readonly prepare;
25
+ private readonly capabilities;
26
+ private readonly logger;
27
+ private readonly telemetry;
28
+ private readonly distinctId;
29
+ private readonly automationService;
30
+ private readonly activeSessionBootstraps;
31
+ private readonly unsubscribeBootstrapCleanup;
32
+ private constructor();
10
33
  /**
11
- * The address of the Cline RPC server to connect to.
12
- * Defaults to the `CLINE_RPC_ADDRESS` env var, or the SDK default address if unset.
34
+ * Creates a new ClineCore instance.
35
+ *
36
+ * This is the primary factory method for initializing the SDK. It sets up the runtime
37
+ * host (local, hub, or remote) based on the provided options and prepares the SDK for
38
+ * starting sessions.
39
+ *
40
+ * @param options Configuration options for the SDK instance
41
+ * @returns A promise that resolves to a new ClineCore instance
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * const cline = await ClineCore.create({
46
+ * clientName: "my-app",
47
+ * backendMode: "local",
48
+ * });
49
+ * ```
13
50
  */
14
- address?: string;
51
+ static create(options?: ClineCoreOptions): Promise<ClineCore>;
52
+ private disposeSessionBootstrap;
15
53
  /**
16
- * When `true` (default), automatically spawns a background RPC server process if one is
17
- * not already running.
54
+ * Starts a new Cline session with the provided configuration.
55
+ *
56
+ * This method initializes and begins a new agent session. It handles session setup,
57
+ * runs any preparation hooks, and returns session metadata along with event streams.
58
+ * The session continues to run until explicitly stopped or aborted.
59
+ *
60
+ * @param input The session configuration and startup parameters
61
+ * @returns A promise that resolves to session metadata and event stream
62
+ *
63
+ * @example
64
+ * ```ts
65
+ * const result = await cline.start({
66
+ * config: {
67
+ * providerId: "anthropic",
68
+ * modelId: "claude-opus-4-1",
69
+ * },
70
+ * });
71
+ *
72
+ * // Subscribe to session events
73
+ * result.subscribe((event) => {
74
+ * console.log("Session event:", event);
75
+ * });
76
+ * ```
18
77
  */
19
- autoStart?: boolean;
78
+ start(input: StartSessionInput): Promise<StartSessionResult>;
20
79
  /**
21
- * Number of connection attempts made to the RPC server after it is spawned.
22
- * Defaults to `5`.
80
+ * Starts a new Cline session with extended core-specific configuration.
81
+ * This overload allows specifying local runtime options and config overrides.
23
82
  */
24
- connectAttempts?: number;
83
+ start(input: ClineCoreStartInput): Promise<StartSessionResult>;
25
84
  /**
26
- * Milliseconds to wait between RPC connection attempts. Defaults to `100`.
85
+ * Sends a message or command to an active session.
86
+ *
87
+ * This method communicates with a running session, allowing you to send user messages,
88
+ * tool responses, or other session input while the session is in progress.
89
+ *
90
+ * @example
91
+ * ```ts
92
+ * await cline.send(sessionId, {
93
+ * type: "user_message",
94
+ * text: "Please implement the login feature",
95
+ * });
96
+ * ```
27
97
  */
28
- connectDelayMs?: number;
29
- }
30
- export type { RuntimeHostMode };
31
- export interface ClineCoreStartInput extends Omit<StartSessionInput, "config" | "localRuntime"> {
32
- config: CoreSessionConfig;
33
- localRuntime?: LocalRuntimeStartOptions;
34
- }
35
- export interface ClineCoreOptions {
98
+ send: RuntimeHost["runTurn"];
36
99
  /**
37
- * A human-readable name for this SDK client (e.g. `"my-app"`, `"acme-bot"`).
38
- * Used to identify the consumer in telemetry and logs.
100
+ * Retrieves accumulated token and cost usage for a session.
101
+ *
102
+ * Returns metrics about the session's resource consumption, including tokens used
103
+ * across different API providers and associated costs. Useful for monitoring and billing.
104
+ *
105
+ * @example
106
+ * ```ts
107
+ * const usage = await cline.getAccumulatedUsage(sessionId);
108
+ * console.log(`Total cost: $${usage.totalCost}`);
109
+ * ```
39
110
  */
40
- clientName?: string;
111
+ getAccumulatedUsage: SessionUsageRuntimeService["getAccumulatedUsage"];
41
112
  /**
42
- * A stable identifier for this machine or user, used for telemetry attribution.
43
- * Defaults to the system machine ID, falling back to a generated `cl-<nanoid>` persisted
44
- * at `~/.cline/data/machine-id`.
113
+ * Aborts an in-flight tool execution without stopping the session.
114
+ *
115
+ * Interrupts the current tool operation (e.g., file read, shell command) while keeping
116
+ * the session alive. The session can continue processing after the abort. Use this for
117
+ * cancelling long-running operations.
118
+ *
119
+ * @example
120
+ * ```ts
121
+ * // Stop the current operation but keep the session running
122
+ * await cline.abort(sessionId);
123
+ * ```
45
124
  */
46
- distinctId?: string;
125
+ abort: RuntimeHost["abort"];
47
126
  /**
48
- * Controls how the runtime host is selected:
49
- * - `"auto"` (default) — connects to a running RPC server if available, starts one in the
50
- * background if `rpc.autoStart` is true, and falls back to local in-process execution.
51
- * - `"rpc"` requires an RPC runtime server; throws if one is not reachable.
52
- * - `"local"` — always uses local in-process execution and local SQLite/file storage.
127
+ * Stops an active session gracefully.
128
+ *
129
+ * Terminates the session and cleans up associated resources. Unlike abort, this
130
+ * completely ends the session. The session cannot be resumed after stopping.
131
+ *
132
+ * @example
133
+ * ```ts
134
+ * // Cleanly shutdown the session
135
+ * await cline.stop(sessionId);
136
+ * ```
53
137
  */
54
- backendMode?: RuntimeHostMode;
138
+ stop: RuntimeHost["stopSession"];
55
139
  /**
56
- * RPC server connection options. Only relevant when `backendMode` is `"auto"` or `"rpc"`.
140
+ * Disposes the ClineCore instance and all associated resources.
141
+ *
142
+ * Shuts down the runtime host, closes connections, and cleans up all active sessions
143
+ * and bootstraps. Call this when you're done using the SDK instance, typically at
144
+ * application shutdown. After calling dispose, the instance cannot be reused.
145
+ *
146
+ * @example
147
+ * ```ts
148
+ * // Clean up when done
149
+ * await cline.dispose();
150
+ * ```
57
151
  */
58
- rpc?: RpcOptions;
152
+ dispose: RuntimeHost["dispose"];
59
153
  /**
60
- * Override one or more default tool executors (e.g. file I/O, shell, browser).
61
- * Partial — only the keys you supply are replaced; the rest use built-in implementations.
154
+ * Retrieves information about a specific session by ID.
155
+ *
156
+ * Fetches the current metadata and state of a session, including configuration,
157
+ * status, and other session details.
158
+ *
159
+ * @example
160
+ * ```ts
161
+ * const session = await cline.get(sessionId);
162
+ * console.log("Session status:", session?.status);
163
+ * ```
62
164
  */
63
- defaultToolExecutors?: Partial<ToolExecutors>;
165
+ get: RuntimeHost["getSession"];
64
166
  /**
65
- * Telemetry service instance to use for capturing events and usage.
66
- * If omitted, telemetry is a no-op.
167
+ * Lists recent sessions through the shared history-listing path.
67
168
  */
68
- telemetry?: ITelemetryService;
169
+ listHistory: (options?: ClineCoreListHistoryOptions) => Promise<SessionHistoryRecord[]>;
69
170
  /**
70
- * Optional structured logger for core-side operational diagnostics such as
71
- * RPC backend startup, reuse, and fallback decisions.
171
+ * Lists recent sessions with inferred history display metadata.
172
+ *
173
+ * Retrieves a paginated list of recent sessions, optionally limited by the
174
+ * provided count.
175
+ *
176
+ * @param limit Maximum number of sessions to return (defaults to 200)
177
+ * @returns A promise resolving to an array of session history records
178
+ *
179
+ * @example
180
+ * ```ts
181
+ * const sessions = await cline.list(50);
182
+ * sessions.forEach((session) => {
183
+ * console.log(`Session ${session.sessionId}: ${session.metadata?.title}`);
184
+ * });
185
+ * ```
72
186
  */
73
- logger?: BasicLogger;
187
+ list: (limit?: number, options?: Omit<ClineCoreListHistoryOptions, "limit">) => Promise<SessionHistoryRecord[]>;
74
188
  /**
75
- * Per-tool approval policies that control whether a tool runs automatically,
76
- * requires user confirmation, or is blocked entirely.
189
+ * Permanently deletes a session and all its associated data.
190
+ *
191
+ * Removes the session from storage and cleans up any related resources. This is
192
+ * a destructive operation that cannot be undone.
193
+ *
194
+ * @param sessionId The ID of the session to delete
195
+ * @returns A promise that resolves to true if the session was deleted, false if not found
196
+ *
197
+ * @example
198
+ * ```ts
199
+ * const deleted = await cline.delete(sessionId);
200
+ * if (deleted) {
201
+ * console.log("Session deleted successfully");
202
+ * }
203
+ * ```
77
204
  */
78
- toolPolicies?: AgentConfig["toolPolicies"];
205
+ delete: RuntimeHost["deleteSession"];
79
206
  /**
80
- * Called before any tool is executed that requires explicit user approval.
81
- * Return `{ approved: true }` to allow or `{ approved: false }` to deny.
82
- * If omitted, all approval-required tools are auto-denied.
207
+ * Updates an existing session's metadata.
208
+ *
209
+ * Modifies session properties like title or other mutable metadata while preserving
210
+ * message history and other session data.
211
+ *
212
+ * @example
213
+ * ```ts
214
+ * await cline.update(sessionId, {
215
+ * title: "Updated session title",
216
+ * });
217
+ * ```
83
218
  */
84
- requestToolApproval?: (request: ToolApprovalRequest) => Promise<ToolApprovalResult>;
219
+ update: RuntimeHost["updateSession"];
85
220
  /**
86
- * Optional hook invoked after `messages.json` is persisted to disk.
87
- * Consumers can use this to mirror session transcripts into remote storage.
221
+ * Reads message history for a session.
222
+ *
223
+ * Retrieves the full message transcript for a specific session, including all
224
+ * user messages, agent responses, and tool interactions.
225
+ *
226
+ * @example
227
+ * ```ts
228
+ * const messages = await cline.readMessages(sessionId);
229
+ * messages.forEach((msg) => {
230
+ * console.log(`${msg.role}: ${msg.content}`);
231
+ * });
232
+ * ```
88
233
  */
89
- messagesArtifactUploader?: SessionMessagesArtifactUploader;
234
+ readMessages: RuntimeHost["readSessionMessages"];
235
+ restore(input: RestoreInput): Promise<RestoreResult>;
90
236
  /**
91
- * An already-constructed session backend to use instead of resolving one automatically.
92
- * Intended for testing or embedding a custom persistence layer.
237
+ * Handles hook events from the runtime environment.
238
+ *
239
+ * Processes system or environment events (e.g., workspace changes, external signals)
240
+ * that may affect the current session. This is typically called by the host environment
241
+ * rather than directly by consumer code.
242
+ *
93
243
  * @internal
94
244
  */
95
- sessionService?: SessionBackend;
245
+ ingestHookEvent: RuntimeHost["dispatchHookEvent"];
96
246
  /**
97
- * Factory that creates team management tools for the multi-agent team system.
98
- * When provided, team tools are registered whenever `enableAgentTeams` is `true`
99
- * on a session config.
247
+ * Subscribes to session events.
248
+ *
249
+ * Registers a listener for all session events (messages, state changes, errors, etc.).
250
+ * Returns an unsubscribe function to stop listening.
100
251
  *
101
- * Consumers that depend on `@clinebot/enterprise` can pass
102
- * `bootstrapAgentTeams` here directly.
252
+ * @param listener Callback function invoked for each event
253
+ * @param options Optional configuration for the subscription
254
+ * @returns An unsubscribe function
255
+ *
256
+ * @example
257
+ * ```ts
258
+ * const unsubscribe = cline.subscribe((event) => {
259
+ * if (event.type === "message") {
260
+ * console.log("New message:", event.payload.message);
261
+ * }
262
+ * });
263
+ *
264
+ * // Later, stop listening
265
+ * unsubscribe();
266
+ * ```
103
267
  */
104
- teamToolsFactory?: TeamToolsFactory;
268
+ subscribe(listener: (event: CoreSessionEvent) => void, options?: RuntimeHostSubscribeOptions): () => void;
105
269
  /**
106
- * Optional hook invoked before each session starts.
107
- * Use this to prepare workspace-scoped runtime state and then return an
108
- * adapter that mutates the shared session input before core starts the run.
270
+ * Updates the AI model used by an active session.
271
+ *
272
+ * Switches the session to use a different AI model while maintaining the session state
273
+ * and message history. This allows you to continue a conversation with a different model.
274
+ *
275
+ * @example
276
+ * ```ts
277
+ * // Switch to a different model mid-session
278
+ * await cline.updateSessionModel(sessionId, "claude-opus-4-1");
279
+ * ```
109
280
  */
110
- prepare?: (input: ClineCoreStartInput) => Promise<StartSessionBootstrap | undefined> | StartSessionBootstrap | undefined;
111
- }
112
- export interface StartSessionBootstrap {
113
- applyToStartSessionInput(input: ClineCoreStartInput): Promise<ClineCoreStartInput> | ClineCoreStartInput;
114
- dispose?(): Promise<void> | void;
115
- }
116
- /**
117
- * The primary entry point for the Cline Core SDK.
118
- *
119
- * @example
120
- * ```ts
121
- * import { ClineCore } from "@clinebot/core";
122
- *
123
- * const cline = await ClineCore.create({ clientName: "my-app" });
124
- * const session = await cline.start({ ... });
125
- * ```
126
- */
127
- export declare class ClineCore implements RuntimeHost {
128
- readonly clientName: string | undefined;
129
- readonly runtimeAddress: string | undefined;
130
- private readonly host;
131
- private readonly prepare;
132
- private readonly activeSessionBootstraps;
133
- private readonly unsubscribeBootstrapCleanup;
134
- private constructor();
135
- static create(options?: ClineCoreOptions): Promise<ClineCore>;
136
- private disposeSessionBootstrap;
137
- private toClineCoreStartInput;
138
- private normalizeStartInput;
139
- start(input: StartSessionInput): Promise<StartSessionResult>;
140
- start(input: ClineCoreStartInput): Promise<StartSessionResult>;
141
- send: RuntimeHost["send"];
142
- getAccumulatedUsage: RuntimeHost["getAccumulatedUsage"];
143
- abort: RuntimeHost["abort"];
144
- stop: RuntimeHost["stop"];
145
- dispose: RuntimeHost["dispose"];
146
- get: RuntimeHost["get"];
147
- list: RuntimeHost["list"];
148
- delete: RuntimeHost["delete"];
149
- update: RuntimeHost["update"];
150
- readMessages: RuntimeHost["readMessages"];
151
- handleHookEvent: RuntimeHost["handleHookEvent"];
152
- subscribe: RuntimeHost["subscribe"];
153
- updateSessionModel: RuntimeHost["updateSessionModel"];
281
+ updateSessionModel: SessionModelRuntimeService["updateSessionModel"];
154
282
  }
155
- //# sourceMappingURL=ClineCore.d.ts.map
@@ -35,4 +35,3 @@ export declare class ClineAccountService {
35
35
  private resolveOrganizationMemberId;
36
36
  private request;
37
37
  }
38
- //# sourceMappingURL=cline-account-service.d.ts.map
@@ -1,4 +1,3 @@
1
1
  export { ClineAccountService, type ClineAccountServiceOptions, } from "./cline-account-service";
2
- export { type ClineAccountOperations, executeRpcClineAccountAction, isRpcClineAccountActionRequest, RpcClineAccountService, type RpcProviderActionExecutor, } from "./rpc";
2
+ export { type ClineAccountOperations, executeClineAccountAction, isClineAccountActionRequest, type ProviderActionExecutor, RpcClineAccountService, } from "./rpc";
3
3
  export type { ClineAccountBalance, ClineAccountOrganization, ClineAccountOrganizationBalance, ClineAccountOrganizationUsageTransaction, ClineAccountPaymentTransaction, ClineAccountUsageTransaction, ClineAccountUser, ClineOrganization, FeaturebaseTokenResponse, UserRemoteConfigOrganization, UserRemoteConfigResponse, } from "./types";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { RpcClineAccountActionRequest, RpcProviderActionRequest } from "@clinebot/shared";
1
+ import type { ClineAccountActionRequest, ProviderActionRequest } from "@clinebot/shared";
2
2
  import type { ClineAccountBalance, ClineAccountOrganization, ClineAccountOrganizationBalance, ClineAccountOrganizationUsageTransaction, ClineAccountPaymentTransaction, ClineAccountUsageTransaction, ClineAccountUser, FeaturebaseTokenResponse } from "./types";
3
3
  export interface ClineAccountOperations {
4
4
  fetchMe(): Promise<ClineAccountUser>;
@@ -14,16 +14,16 @@ export interface ClineAccountOperations {
14
14
  switchAccount(organizationId?: string | null): Promise<void>;
15
15
  fetchFeaturebaseToken?(): Promise<FeaturebaseTokenResponse | undefined>;
16
16
  }
17
- export declare function isRpcClineAccountActionRequest(request: RpcProviderActionRequest): request is RpcClineAccountActionRequest;
18
- export declare function executeRpcClineAccountAction(request: RpcClineAccountActionRequest, service: ClineAccountOperations): Promise<unknown>;
19
- export interface RpcProviderActionExecutor {
20
- runProviderAction(request: RpcProviderActionRequest): Promise<{
17
+ export declare function isClineAccountActionRequest(request: ProviderActionRequest): request is ClineAccountActionRequest;
18
+ export declare function executeClineAccountAction(request: ClineAccountActionRequest, service: ClineAccountOperations): Promise<unknown>;
19
+ export interface ProviderActionExecutor {
20
+ runProviderAction(request: ProviderActionRequest): Promise<{
21
21
  result: unknown;
22
22
  }>;
23
23
  }
24
24
  export declare class RpcClineAccountService implements ClineAccountOperations {
25
25
  private readonly executor;
26
- constructor(executor: RpcProviderActionExecutor);
26
+ constructor(executor: ProviderActionExecutor);
27
27
  fetchMe(): Promise<ClineAccountUser>;
28
28
  fetchBalance(userId?: string): Promise<ClineAccountBalance>;
29
29
  fetchUsageTransactions(userId?: string): Promise<ClineAccountUsageTransaction[]>;
@@ -38,4 +38,3 @@ export declare class RpcClineAccountService implements ClineAccountOperations {
38
38
  fetchFeaturebaseToken(): Promise<FeaturebaseTokenResponse | undefined>;
39
39
  private request;
40
40
  }
41
- //# sourceMappingURL=rpc.d.ts.map
@@ -96,4 +96,3 @@ export interface ClineAccountOrganizationUsageTransaction {
96
96
  totalTokens: number;
97
97
  userId: string;
98
98
  }
99
- //# sourceMappingURL=types.d.ts.map
@@ -11,4 +11,3 @@ export declare class BoundedTtlCache {
11
11
  set(key: string, value: string, now?: number, ttlMsOverride?: number): void;
12
12
  private pruneExpired;
13
13
  }
14
- //# sourceMappingURL=bounded-ttl-cache.d.ts.map
@@ -28,4 +28,3 @@ export interface OAuthClientCallbacksOptions {
28
28
  onServerClose?: (info: OAuthServerCloseInfo) => void | Promise<void>;
29
29
  }
30
30
  export declare function createOAuthClientCallbacks(options: OAuthClientCallbacksOptions): OAuthLoginCallbacks;
31
- //# sourceMappingURL=client.d.ts.map
@@ -66,4 +66,3 @@ export declare function refreshClineToken(current: ClineOAuthCredentials, option
66
66
  export declare function getValidClineCredentials(currentCredentials: ClineOAuthCredentials | null, providerOptions: ClineOAuthProviderOptions, options?: ClineTokenResolution): Promise<ClineOAuthCredentials | null>;
67
67
  export declare function createClineOAuthProvider(options: ClineOAuthProviderOptions): OAuthProviderInterface;
68
68
  export {};
69
- //# sourceMappingURL=cline.d.ts.map
@@ -41,4 +41,3 @@ export declare function getValidOpenAICodexCredentials(currentCredentials: OAuth
41
41
  export declare function isOpenAICodexTokenExpired(credentials: OAuthCredentials, refreshBufferMs?: number): boolean;
42
42
  export declare function normalizeOpenAICodexCredentials(credentials: OAuthCredentials): OAuthCredentials;
43
43
  export declare const openaiCodexOAuthProvider: OAuthProviderInterface;
44
- //# sourceMappingURL=codex.d.ts.map
@@ -26,4 +26,3 @@ export declare function createOcaRequestHeaders(input: {
26
26
  taskId: string;
27
27
  metadata?: OcaClientMetadata;
28
28
  }): Promise<Record<string, string>>;
29
- //# sourceMappingURL=oca.d.ts.map
@@ -52,4 +52,3 @@ export interface LocalOAuthServer {
52
52
  close: () => void;
53
53
  }
54
54
  export declare function startLocalOAuthServer(options: LocalOAuthServerOptions): Promise<LocalOAuthServer>;
55
- //# sourceMappingURL=server.d.ts.map
@@ -101,4 +101,3 @@ export interface OcaTokenResolution {
101
101
  refreshBufferMs?: number;
102
102
  retryableTokenGraceMs?: number;
103
103
  }
104
- //# sourceMappingURL=types.d.ts.map
@@ -30,4 +30,3 @@ export declare function resolveAuthorizationCodeInput(input: {
30
30
  }): Promise<ParsedAuthorizationInput & {
31
31
  error?: string;
32
32
  }>;
33
- //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1,34 @@
1
+ import type { AutomationEventEnvelope, BasicLogger, ExtensionContext, ITelemetryService } from "@clinebot/shared";
2
+ import type { CronService } from "../cron/service/cron-service";
3
+ import type { HubScheduleRuntimeHandlers } from "../cron/service/schedule-service";
4
+ import type { RuntimeHost } from "../runtime/host/runtime-host";
5
+ import type { ClineAutomationEventIngressResult, ClineAutomationEventLog, ClineAutomationListEventsOptions, ClineAutomationListRunsOptions, ClineAutomationListSpecsOptions, ClineAutomationRun, ClineAutomationSpec, ClineCoreAutomationApi, ClineCoreAutomationOptions } from "./types";
6
+ export declare function normalizeAutomationOptions(options: ClineCoreAutomationOptions | boolean | undefined): ClineCoreAutomationOptions | undefined;
7
+ export declare function normalizeAutomationCronScope(scope: ClineCoreAutomationOptions["cronScope"]): "global" | "workspace" | undefined;
8
+ export declare class ClineCoreAutomationController implements ClineCoreAutomationApi {
9
+ private readonly getService;
10
+ constructor(getService: () => CronService);
11
+ start(): Promise<void>;
12
+ stop(): Promise<void>;
13
+ reconcileNow(): Promise<void>;
14
+ ingestEvent(event: AutomationEventEnvelope): ClineAutomationEventIngressResult;
15
+ listEvents(options?: ClineAutomationListEventsOptions): ClineAutomationEventLog[];
16
+ getEvent(eventId: string): ClineAutomationEventLog | undefined;
17
+ listSpecs(options?: ClineAutomationListSpecsOptions): ClineAutomationSpec[];
18
+ listRuns(options?: ClineAutomationListRunsOptions): ClineAutomationRun[];
19
+ }
20
+ export interface ClineCoreAutomationRuntimeHandlersInput {
21
+ host: RuntimeHost;
22
+ getExtensionContext(): ExtensionContext | undefined;
23
+ }
24
+ export declare function createClineCoreAutomationRuntimeHandlers(input: ClineCoreAutomationRuntimeHandlersInput): HubScheduleRuntimeHandlers;
25
+ export interface ClineCoreAutomationExtensionContextInput {
26
+ automationService?: CronService;
27
+ automation: ClineCoreAutomationApi;
28
+ context?: ExtensionContext;
29
+ clientName?: string;
30
+ distinctId?: string;
31
+ logger?: BasicLogger;
32
+ telemetry?: ITelemetryService;
33
+ }
34
+ export declare function createClineCoreAutomationExtensionContext(input: ClineCoreAutomationExtensionContextInput): ExtensionContext | undefined;
@@ -0,0 +1,5 @@
1
+ import type { PendingPromptsRuntimeService, PendingPromptsServiceApi, RuntimeHost, SessionModelRuntimeService, SessionUsageRuntimeService } from "../runtime/host/runtime-host";
2
+ import { type ClineCoreSettingsApi } from "../settings";
3
+ export type RuntimeHostServiceExtensions = RuntimeHost & Partial<PendingPromptsRuntimeService & SessionUsageRuntimeService & SessionModelRuntimeService>;
4
+ export declare function createClineCoreSettingsApi(host: RuntimeHost): ClineCoreSettingsApi;
5
+ export declare function createClineCorePendingPromptsApi(host: RuntimeHost): PendingPromptsServiceApi;
@@ -0,0 +1,10 @@
1
+ import type { ExtensionContext } from "@clinebot/shared";
2
+ import type { RuntimeCapabilities } from "../runtime/capabilities";
3
+ import type { StartSessionInput } from "../runtime/host/runtime-host";
4
+ import type { ClineCoreStartInput } from "./types";
5
+ export declare function toClineCoreStartInput(input: StartSessionInput | ClineCoreStartInput): ClineCoreStartInput;
6
+ export interface NormalizeClineCoreStartInputOptions {
7
+ defaultCapabilities?: RuntimeCapabilities;
8
+ withExtensionContext?: (context?: ExtensionContext) => ExtensionContext | undefined;
9
+ }
10
+ export declare function normalizeClineCoreStartInput(input: ClineCoreStartInput, options?: NormalizeClineCoreStartInputOptions): StartSessionInput;
@@ -0,0 +1,10 @@
1
+ import type { ITelemetryService } from "@clinebot/shared";
2
+ import type { ClineCoreStartInput } from "./types";
3
+ export interface EmitSessionStartedTelemetryInput {
4
+ input: ClineCoreStartInput;
5
+ sessionId: string;
6
+ telemetry?: ITelemetryService;
7
+ clientName?: string;
8
+ runtimeAddress?: string;
9
+ }
10
+ export declare function emitSessionStartedTelemetry(input: EmitSessionStartedTelemetryInput): void;