@sctg/cline-core 3.84.0-beta.20260524130712

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 (230) hide show
  1. package/README.md +110 -0
  2. package/dist/ClineCore.d.ts +283 -0
  3. package/dist/account/cline-account-service.d.ts +37 -0
  4. package/dist/account/index.d.ts +3 -0
  5. package/dist/account/rpc.d.ts +40 -0
  6. package/dist/account/types.d.ts +98 -0
  7. package/dist/auth/bounded-ttl-cache.d.ts +13 -0
  8. package/dist/auth/client.d.ts +30 -0
  9. package/dist/auth/cline.d.ts +64 -0
  10. package/dist/auth/codex.d.ts +43 -0
  11. package/dist/auth/oca.d.ts +28 -0
  12. package/dist/auth/server.d.ts +54 -0
  13. package/dist/auth/types.d.ts +103 -0
  14. package/dist/auth/utils.d.ts +32 -0
  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 +47 -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 +7 -0
  35. package/dist/extensions/config/runtime-commands.d.ts +11 -0
  36. package/dist/extensions/config/skill-frontmatter-toggle.d.ts +11 -0
  37. package/dist/extensions/config/unified-config-file-watcher.d.ts +77 -0
  38. package/dist/extensions/config/user-instruction-config-loader.d.ts +64 -0
  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 +12 -0
  42. package/dist/extensions/context/basic-compaction.d.ts +8 -0
  43. package/dist/extensions/context/compaction-shared.d.ts +61 -0
  44. package/dist/extensions/context/compaction.d.ts +38 -0
  45. package/dist/extensions/index.d.ts +5 -0
  46. package/dist/extensions/mcp/client.d.ts +9 -0
  47. package/dist/extensions/mcp/config-loader.d.ts +25 -0
  48. package/dist/extensions/mcp/index.d.ts +11 -0
  49. package/dist/extensions/mcp/manager.d.ts +23 -0
  50. package/dist/extensions/mcp/name-transform.d.ts +2 -0
  51. package/dist/extensions/mcp/oauth.d.ts +48 -0
  52. package/dist/extensions/mcp/policies.d.ts +14 -0
  53. package/dist/extensions/mcp/tools.d.ts +3 -0
  54. package/dist/extensions/mcp/types.d.ts +111 -0
  55. package/dist/extensions/plugin/plugin-config-loader.d.ts +40 -0
  56. package/dist/extensions/plugin/plugin-load-report.d.ts +18 -0
  57. package/dist/extensions/plugin/plugin-loader.d.ts +22 -0
  58. package/dist/extensions/plugin/plugin-module-import.d.ts +4 -0
  59. package/dist/extensions/plugin/plugin-sandbox.d.ts +36 -0
  60. package/dist/extensions/plugin/plugin-targeting.d.ts +6 -0
  61. package/dist/extensions/plugin-sandbox-bootstrap.js +1 -0
  62. package/dist/extensions/tools/constants.d.ts +24 -0
  63. package/dist/extensions/tools/definitions.d.ts +102 -0
  64. package/dist/extensions/tools/executors/apply-patch-parser.d.ts +68 -0
  65. package/dist/extensions/tools/executors/apply-patch.d.ts +28 -0
  66. package/dist/extensions/tools/executors/bash.d.ts +49 -0
  67. package/dist/extensions/tools/executors/editor.d.ts +31 -0
  68. package/dist/extensions/tools/executors/file-read.d.ts +40 -0
  69. package/dist/extensions/tools/executors/index.d.ts +50 -0
  70. package/dist/extensions/tools/executors/search.d.ts +50 -0
  71. package/dist/extensions/tools/executors/web-fetch.d.ts +58 -0
  72. package/dist/extensions/tools/helpers.d.ts +15 -0
  73. package/dist/extensions/tools/index.d.ts +59 -0
  74. package/dist/extensions/tools/model-tool-routing.d.ts +33 -0
  75. package/dist/extensions/tools/presets.d.ts +132 -0
  76. package/dist/extensions/tools/runtime.d.ts +24 -0
  77. package/dist/extensions/tools/schemas.d.ts +241 -0
  78. package/dist/extensions/tools/team/delegated-agent.d.ts +43 -0
  79. package/dist/extensions/tools/team/index.d.ts +2 -0
  80. package/dist/extensions/tools/team/multi-agent.d.ts +230 -0
  81. package/dist/extensions/tools/team/projections.d.ts +8 -0
  82. package/dist/extensions/tools/team/runtime.d.ts +4 -0
  83. package/dist/extensions/tools/team/spawn-agent-tool.d.ts +84 -0
  84. package/dist/extensions/tools/team/subagent-prompts.d.ts +3 -0
  85. package/dist/extensions/tools/team/team-tools.d.ts +35 -0
  86. package/dist/extensions/tools/types.d.ts +254 -0
  87. package/dist/hooks/checkpoint-hooks.d.ts +45 -0
  88. package/dist/hooks/hook-extension.d.ts +2 -0
  89. package/dist/hooks/hook-file-config.d.ts +24 -0
  90. package/dist/hooks/hook-file-hooks.d.ts +21 -0
  91. package/dist/hooks/index.d.ts +5 -0
  92. package/dist/hooks/subprocess-runner.d.ts +21 -0
  93. package/dist/hooks/subprocess.d.ts +68 -0
  94. package/dist/hub/client/connect.d.ts +14 -0
  95. package/dist/hub/client/index.d.ts +88 -0
  96. package/dist/hub/client/session-client.d.ts +118 -0
  97. package/dist/hub/client/ui-client.d.ts +45 -0
  98. package/dist/hub/daemon/entry.d.ts +1 -0
  99. package/dist/hub/daemon/entry.js +722 -0
  100. package/dist/hub/daemon/index.d.ts +9 -0
  101. package/dist/hub/daemon/runtime-handlers.d.ts +12 -0
  102. package/dist/hub/daemon/start-shared-server.d.ts +18 -0
  103. package/dist/hub/discovery/defaults.d.ts +16 -0
  104. package/dist/hub/discovery/index.d.ts +30 -0
  105. package/dist/hub/discovery/workspace.d.ts +3 -0
  106. package/dist/hub/index.d.ts +32 -0
  107. package/dist/hub/index.js +719 -0
  108. package/dist/hub/runtime-host/hub-runtime-host.d.ts +76 -0
  109. package/dist/hub/runtime-host/remote-runtime-host.d.ts +9 -0
  110. package/dist/hub/server/browser-websocket.d.ts +19 -0
  111. package/dist/hub/server/command-transport.d.ts +7 -0
  112. package/dist/hub/server/handlers/approval-handlers.d.ts +17 -0
  113. package/dist/hub/server/handlers/capability-handlers.d.ts +12 -0
  114. package/dist/hub/server/handlers/client-handlers.d.ts +6 -0
  115. package/dist/hub/server/handlers/context.d.ts +57 -0
  116. package/dist/hub/server/handlers/run-handlers.d.ts +5 -0
  117. package/dist/hub/server/handlers/session-event-projector.d.ts +7 -0
  118. package/dist/hub/server/handlers/session-handlers.d.ts +20 -0
  119. package/dist/hub/server/hub-client-contributions.d.ts +19 -0
  120. package/dist/hub/server/hub-notifications.d.ts +7 -0
  121. package/dist/hub/server/hub-schedule-events.d.ts +2 -0
  122. package/dist/hub/server/hub-server-logging.d.ts +2 -0
  123. package/dist/hub/server/hub-server-options.d.ts +55 -0
  124. package/dist/hub/server/hub-server-transport.d.ts +37 -0
  125. package/dist/hub/server/hub-session-records.d.ts +9 -0
  126. package/dist/hub/server/hub-websocket-server.d.ts +6 -0
  127. package/dist/hub/server/index.d.ts +4 -0
  128. package/dist/hub/server/native-transport.d.ts +16 -0
  129. package/dist/index.d.ts +104 -0
  130. package/dist/index.js +717 -0
  131. package/dist/remote-config/integration.d.ts +17 -0
  132. package/dist/runtime/capabilities/index.d.ts +2 -0
  133. package/dist/runtime/capabilities/normalize-runtime-capabilities.d.ts +2 -0
  134. package/dist/runtime/capabilities/runtime-capabilities.d.ts +6 -0
  135. package/dist/runtime/config/agent-message-codec.d.ts +6 -0
  136. package/dist/runtime/config/agent-runtime-config-builder.d.ts +80 -0
  137. package/dist/runtime/host/history.d.ts +19 -0
  138. package/dist/runtime/host/host.d.ts +7 -0
  139. package/dist/runtime/host/local/agent-event-bridge.d.ts +30 -0
  140. package/dist/runtime/host/local/session-record.d.ts +6 -0
  141. package/dist/runtime/host/local/session-service-invoker.d.ts +4 -0
  142. package/dist/runtime/host/local/spawn-tool.d.ts +15 -0
  143. package/dist/runtime/host/local/user-files.d.ts +1 -0
  144. package/dist/runtime/host/local-runtime-host.d.ts +127 -0
  145. package/dist/runtime/host/runtime-host-support.d.ts +20 -0
  146. package/dist/runtime/host/runtime-host.d.ts +169 -0
  147. package/dist/runtime/orchestration/runtime-builder.d.ts +6 -0
  148. package/dist/runtime/orchestration/runtime-event-adapter.d.ts +101 -0
  149. package/dist/runtime/orchestration/runtime-oauth-token-manager.d.ts +30 -0
  150. package/dist/runtime/orchestration/session-runtime-orchestrator.d.ts +218 -0
  151. package/dist/runtime/orchestration/session-runtime.d.ts +58 -0
  152. package/dist/runtime/orchestration/user-input-builder.d.ts +15 -0
  153. package/dist/runtime/safety/loop-detection.d.ts +58 -0
  154. package/dist/runtime/safety/mistake-tracker.d.ts +68 -0
  155. package/dist/runtime/safety/rules.d.ts +6 -0
  156. package/dist/runtime/tools/subprocess-sandbox.d.ts +43 -0
  157. package/dist/runtime/tools/tool-approval.d.ts +9 -0
  158. package/dist/runtime/turn-queue/pending-prompt-service.d.ts +69 -0
  159. package/dist/services/agent-events.d.ts +34 -0
  160. package/dist/services/config.d.ts +2 -0
  161. package/dist/services/global-settings.d.ts +34 -0
  162. package/dist/services/llms/cline-recommended-models.d.ts +19 -0
  163. package/dist/services/llms/configured-provider-registry.d.ts +27 -0
  164. package/dist/services/llms/handler-factory.d.ts +3 -0
  165. package/dist/services/llms/provider-defaults.d.ts +28 -0
  166. package/dist/services/llms/provider-settings.d.ts +250 -0
  167. package/dist/services/llms/runtime-config.d.ts +3 -0
  168. package/dist/services/llms/runtime-registry.d.ts +19 -0
  169. package/dist/services/llms/runtime-types.d.ts +84 -0
  170. package/dist/services/local-runtime-bootstrap.d.ts +45 -0
  171. package/dist/services/plugin-tools.d.ts +28 -0
  172. package/dist/services/providers/local-provider-registry.d.ts +230 -0
  173. package/dist/services/providers/local-provider-service.d.ts +70 -0
  174. package/dist/services/providers/model-source.d.ts +3 -0
  175. package/dist/services/providers/provider-config-fields.d.ts +37 -0
  176. package/dist/services/session-artifacts.d.ts +17 -0
  177. package/dist/services/session-data.d.ts +51 -0
  178. package/dist/services/session-telemetry.d.ts +15 -0
  179. package/dist/services/storage/file-team-store.d.ts +28 -0
  180. package/dist/services/storage/provider-settings-legacy-migration.d.ts +38 -0
  181. package/dist/services/storage/provider-settings-manager.d.ts +23 -0
  182. package/dist/services/storage/sqlite-session-store.d.ts +30 -0
  183. package/dist/services/storage/sqlite-team-store.d.ts +34 -0
  184. package/dist/services/storage/team-store.d.ts +15 -0
  185. package/dist/services/telemetry/ITelemetryAdapter.d.ts +54 -0
  186. package/dist/services/telemetry/OpenTelemetryAdapter.d.ts +43 -0
  187. package/dist/services/telemetry/OpenTelemetryProvider.d.ts +83 -0
  188. package/dist/services/telemetry/TelemetryLoggerSink.d.ts +27 -0
  189. package/dist/services/telemetry/TelemetryService.d.ts +34 -0
  190. package/dist/services/telemetry/core-events.d.ts +276 -0
  191. package/dist/services/telemetry/distinct-id.d.ts +1 -0
  192. package/dist/services/telemetry/index.d.ts +3 -0
  193. package/dist/services/telemetry/index.js +1 -0
  194. package/dist/services/usage.d.ts +19 -0
  195. package/dist/services/workspace/file-indexer.d.ts +5 -0
  196. package/dist/services/workspace/index.d.ts +4 -0
  197. package/dist/services/workspace/mention-enricher.d.ts +13 -0
  198. package/dist/services/workspace/workspace-manager.d.ts +27 -0
  199. package/dist/services/workspace/workspace-manifest.d.ts +31 -0
  200. package/dist/services/workspace/workspace-telemetry.d.ts +18 -0
  201. package/dist/session/checkpoint-restore.d.ts +20 -0
  202. package/dist/session/models/session-graph.d.ts +15 -0
  203. package/dist/session/models/session-manifest.d.ts +31 -0
  204. package/dist/session/models/session-row.d.ts +92 -0
  205. package/dist/session/services/file-session-service.d.ts +10 -0
  206. package/dist/session/services/message-builder.d.ts +66 -0
  207. package/dist/session/services/persistence-service.d.ts +59 -0
  208. package/dist/session/services/session-service.d.ts +15 -0
  209. package/dist/session/session-snapshot.d.ts +59 -0
  210. package/dist/session/session-versioning-service.d.ts +48 -0
  211. package/dist/session/stores/conversation-store.d.ts +29 -0
  212. package/dist/session/stores/session-manifest-store.d.ts +23 -0
  213. package/dist/session/stores/team-persistence-store.d.ts +23 -0
  214. package/dist/session/team/index.d.ts +2 -0
  215. package/dist/session/team/team-child-session-manager.d.ts +35 -0
  216. package/dist/session/team/team-session-coordinator.d.ts +13 -0
  217. package/dist/settings/index.d.ts +2 -0
  218. package/dist/settings/settings-service.d.ts +6 -0
  219. package/dist/settings/types.d.ts +43 -0
  220. package/dist/types/chat-schema.d.ts +163 -0
  221. package/dist/types/common.d.ts +24 -0
  222. package/dist/types/config.d.ts +167 -0
  223. package/dist/types/events.d.ts +89 -0
  224. package/dist/types/provider-settings.d.ts +19 -0
  225. package/dist/types/session.d.ts +122 -0
  226. package/dist/types/sessions.d.ts +38 -0
  227. package/dist/types/storage.d.ts +36 -0
  228. package/dist/types.d.ts +32 -0
  229. package/dist/version.d.ts +1 -0
  230. package/package.json +80 -0
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Default Tools
3
+ *
4
+ * This module provides a set of configurable default tools for agents.
5
+ */
6
+ export { validateWithZod, zodToJsonSchema } from "@cline/shared";
7
+ export { ALL_DEFAULT_TOOL_NAMES, DefaultToolNames } from "./constants";
8
+ export { createApplyPatchTool, createAskQuestionTool, createBashTool, createDefaultTools, createEditorTool, createReadFilesTool, createSearchTool, createSkillsTool, createSubmitAndExitTool, createWebFetchTool, createWindowsShellTool, } from "./definitions";
9
+ export { type ApplyPatchExecutorOptions, type BashExecutorOptions, createApplyPatchExecutor, createBashExecutor, createDefaultExecutors, createEditorExecutor, createFileReadExecutor, createSearchExecutor, createWebFetchExecutor, type DefaultExecutorsOptions, type EditorExecutorOptions, type FileReadExecutorOptions, type SearchExecutorOptions, type WebFetchExecutorOptions, } from "./executors/index";
10
+ export { DEFAULT_MODEL_TOOL_ROUTING_RULES, resolveToolRoutingConfig, type ToolRoutingRule, } from "./model-tool-routing";
11
+ export { createDefaultToolsWithPreset, createToolPoliciesWithPreset, resolveToolPresetName, type ToolPolicyPresetName, type ToolPresetName, ToolPresets, } from "./presets";
12
+ export { type BuiltinToolAvailabilityContext, getCoreAcpToolNames, getCoreBuiltinToolCatalog, getCoreDefaultEnabledToolIds, getCoreHeadlessToolNames, resolveCoreSelectedToolIds, type ToolCatalogEntry, } from "./runtime";
13
+ export { type ApplyPatchInput, ApplyPatchInputSchema, type AskQuestionInput, AskQuestionInputSchema, type EditFileInput, EditFileInputSchema, type FetchWebContentInput, FetchWebContentInputSchema, type ReadFileRequest, ReadFileRequestSchema, type ReadFilesInput, ReadFilesInputSchema, type RunCommandsInput, RunCommandsInputSchema, type SearchCodebaseInput, SearchCodebaseInputSchema, type SkillsInput, SkillsInputSchema, type SubmitInput, SubmitInputSchema, type WebFetchRequest, WebFetchRequestSchema, } from "./schemas";
14
+ export { TEAM_TOOL_NAMES } from "./team/team-tools";
15
+ export type { ApplyPatchExecutor, AskQuestionExecutor, BashExecutor, CreateDefaultToolsOptions, DefaultToolName, DefaultToolsConfig, EditorExecutor, FileReadExecutor, SearchExecutor, SkillsExecutor, SkillsExecutorSkillMetadata, SkillsExecutorWithMetadata, ToolExecutors, ToolOperationResult, VerifySubmitExecutor, WebFetchExecutor, } from "./types";
16
+ import type { AgentTool } from "@cline/shared";
17
+ import { type DefaultExecutorsOptions } from "./executors/index";
18
+ import type { CreateDefaultToolsOptions, ToolExecutors } from "./types";
19
+ /**
20
+ * Options for creating default tools with built-in executors
21
+ */
22
+ export interface CreateBuiltinToolsOptions extends Omit<CreateDefaultToolsOptions, "executors"> {
23
+ /**
24
+ * Configuration for the built-in executors
25
+ */
26
+ executorOptions?: DefaultExecutorsOptions;
27
+ /**
28
+ * Optional executor overrides/additions for tools without built-ins
29
+ */
30
+ executors?: Partial<ToolExecutors>;
31
+ }
32
+ /**
33
+ * Create default tools with built-in Node.js executors
34
+ *
35
+ * This is a convenience function that creates the default tools with
36
+ * working implementations using Node.js built-in modules.
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * import { Agent, createBuiltinTools } from "@cline/core"
41
+ *
42
+ * const tools = createBuiltinTools({
43
+ * cwd: "/path/to/project",
44
+ * enableBash: true,
45
+ * enableWebFetch: false, // Disable web fetching
46
+ * executorOptions: {
47
+ * bash: { timeoutMs: 60000 },
48
+ * },
49
+ * })
50
+ *
51
+ * const agent = new Agent({
52
+ * providerId: "anthropic",
53
+ * modelId: "claude-sonnet-4-20250514",
54
+ * systemPrompt: "You are a coding assistant.",
55
+ * tools,
56
+ * })
57
+ * ```
58
+ */
59
+ export declare function createBuiltinTools(options?: CreateBuiltinToolsOptions): AgentTool[];
@@ -0,0 +1,33 @@
1
+ import type { CoreAgentMode } from "../../types/config";
2
+ import type { DefaultToolName, DefaultToolsConfig } from "./types";
3
+ export interface ToolRoutingRule {
4
+ /**
5
+ * Optional rule label for debugging and logs.
6
+ */
7
+ name?: string;
8
+ /**
9
+ * Which mode the rule applies to.
10
+ * @default "any"
11
+ */
12
+ mode?: CoreAgentMode | "any";
13
+ /**
14
+ * Case-insensitive substrings that must match the model ID.
15
+ * When omitted/empty, the rule is not constrained by model ID.
16
+ */
17
+ modelIdIncludes?: string[];
18
+ /**
19
+ * Case-insensitive substrings that must match the provider ID.
20
+ * When omitted/empty, the rule is not constrained by provider ID.
21
+ */
22
+ providerIdIncludes?: string[];
23
+ /**
24
+ * Enable these tools when the rule matches.
25
+ */
26
+ enableTools?: DefaultToolName[];
27
+ /**
28
+ * Disable these tools when the rule matches.
29
+ */
30
+ disableTools?: DefaultToolName[];
31
+ }
32
+ export declare const DEFAULT_MODEL_TOOL_ROUTING_RULES: ToolRoutingRule[];
33
+ export declare function resolveToolRoutingConfig(providerId: string, modelId: string, mode: CoreAgentMode, rules: ToolRoutingRule[] | undefined): Partial<DefaultToolsConfig>;
@@ -0,0 +1,132 @@
1
+ /**
2
+ * AgentTool Presets
3
+ *
4
+ * Pre-configured tool combinations for common use cases.
5
+ */
6
+ import type { AgentMode, AgentTool, ToolPolicy } from "@cline/shared";
7
+ import type { CreateDefaultToolsOptions, DefaultToolsConfig } from "./types";
8
+ export interface ToolPresetConfig extends DefaultToolsConfig {
9
+ enableSpawnAgent?: boolean;
10
+ enableAgentTeams?: boolean;
11
+ }
12
+ /**
13
+ * Preset configurations for common use cases
14
+ */
15
+ export declare const ToolPresets: {
16
+ /**
17
+ * Act mode (full development tools)
18
+ * Good for coding assistants and task automation
19
+ */
20
+ readonly act: {
21
+ readonly enableReadFiles: true;
22
+ readonly enableSearch: true;
23
+ readonly enableBash: true;
24
+ readonly enableWebFetch: true;
25
+ readonly enableApplyPatch: false;
26
+ readonly enableEditor: true;
27
+ readonly enableSkills: true;
28
+ readonly enableAskQuestion: true;
29
+ readonly enableSubmitAndExit: false;
30
+ readonly enableSpawnAgent: true;
31
+ readonly enableAgentTeams: true;
32
+ };
33
+ /**
34
+ * Plan mode (read-only, no shell access)
35
+ * Good for analysis and documentation agents
36
+ */
37
+ readonly plan: {
38
+ readonly enableReadFiles: true;
39
+ readonly enableSearch: true;
40
+ readonly enableBash: true;
41
+ readonly enableWebFetch: true;
42
+ readonly enableApplyPatch: false;
43
+ readonly enableEditor: false;
44
+ readonly enableSkills: true;
45
+ readonly enableAskQuestion: true;
46
+ readonly enableSubmitAndExit: false;
47
+ readonly enableSpawnAgent: true;
48
+ readonly enableAgentTeams: true;
49
+ };
50
+ /**
51
+ * Search-focused tools (read_files + search_codebase)
52
+ * Good for code exploration and analysis agents
53
+ */
54
+ readonly search: {
55
+ readonly enableReadFiles: true;
56
+ readonly enableSearch: true;
57
+ readonly enableBash: false;
58
+ readonly enableWebFetch: false;
59
+ readonly enableApplyPatch: false;
60
+ readonly enableEditor: false;
61
+ readonly enableSkills: false;
62
+ readonly enableAskQuestion: false;
63
+ readonly enableSubmitAndExit: false;
64
+ readonly enableSpawnAgent: true;
65
+ readonly enableAgentTeams: true;
66
+ };
67
+ /**
68
+ * Minimal tools for focused tasks
69
+ */
70
+ readonly minimal: {
71
+ readonly enableReadFiles: false;
72
+ readonly enableSearch: false;
73
+ readonly enableBash: true;
74
+ readonly enableWebFetch: false;
75
+ readonly enableApplyPatch: false;
76
+ readonly enableEditor: false;
77
+ readonly enableSkills: false;
78
+ readonly enableAskQuestion: false;
79
+ readonly enableSubmitAndExit: false;
80
+ readonly enableSpawnAgent: true;
81
+ readonly enableAgentTeams: false;
82
+ };
83
+ /**
84
+ * YOLO mode (automation-focused tools + no approval required)
85
+ * Good for trusted local automation workflows.
86
+ */
87
+ readonly yolo: {
88
+ readonly enableReadFiles: true;
89
+ readonly enableSearch: false;
90
+ readonly enableBash: true;
91
+ readonly enableWebFetch: false;
92
+ readonly enableApplyPatch: false;
93
+ readonly enableEditor: true;
94
+ readonly enableSkills: false;
95
+ readonly enableAskQuestion: false;
96
+ readonly enableSubmitAndExit: true;
97
+ readonly enableSpawnAgent: false;
98
+ readonly enableAgentTeams: false;
99
+ };
100
+ };
101
+ /**
102
+ * Type for preset names
103
+ */
104
+ export type ToolPresetName = keyof typeof ToolPresets;
105
+ export declare function resolveToolPresetName(options: {
106
+ mode?: AgentMode;
107
+ }): ToolPresetName;
108
+ /**
109
+ * AgentTool policy preset names
110
+ */
111
+ export type ToolPolicyPresetName = "default" | "yolo";
112
+ /**
113
+ * Build tool policies for a preset.
114
+ * `yolo` guarantees tool policies are enabled and auto-approved.
115
+ */
116
+ export declare function createToolPoliciesWithPreset(presetName: ToolPolicyPresetName): Record<string, ToolPolicy>;
117
+ /**
118
+ * Create default tools using a preset configuration
119
+ *
120
+ * @example
121
+ * ```typescript
122
+ * const tools = createDefaultToolsWithPreset("plan", {
123
+ * executors: {
124
+ * readFile: async ({ path }) => fs.readFile(path, "utf-8"),
125
+ * search: async (query, cwd) => searchFiles(query, cwd),
126
+ * webFetch: async (url, prompt) => fetchAndAnalyze(url, prompt),
127
+ * },
128
+ * cwd: "/path/to/project",
129
+ * })
130
+ * ```
131
+ */
132
+ export declare function createDefaultToolsWithPreset(presetName: ToolPresetName, options: Omit<CreateDefaultToolsOptions, keyof DefaultToolsConfig> & Partial<DefaultToolsConfig>): AgentTool[];
@@ -0,0 +1,24 @@
1
+ import type { CoreAgentMode } from "../../types/config";
2
+ export interface ToolCatalogEntry {
3
+ id: string;
4
+ description: string;
5
+ defaultEnabled: boolean;
6
+ headlessToolNames: string[];
7
+ }
8
+ export interface BuiltinToolAvailabilityContext {
9
+ mode?: CoreAgentMode;
10
+ providerId?: string;
11
+ modelId?: string;
12
+ enableSpawnAgent?: boolean;
13
+ enableAgentTeams?: boolean;
14
+ disabledToolIds?: ReadonlySet<string>;
15
+ }
16
+ export declare function getCoreBuiltinToolCatalog(context?: BuiltinToolAvailabilityContext): ToolCatalogEntry[];
17
+ export declare function getCoreDefaultEnabledToolIds(context?: BuiltinToolAvailabilityContext): string[];
18
+ export declare function resolveCoreSelectedToolIds(input: {
19
+ enabled: boolean;
20
+ allowlist?: string[];
21
+ availabilityContext?: BuiltinToolAvailabilityContext;
22
+ }): Set<string>;
23
+ export declare function getCoreHeadlessToolNames(selectedToolIds: ReadonlySet<string>, context?: BuiltinToolAvailabilityContext): string[];
24
+ export declare function getCoreAcpToolNames(selectedToolIds: ReadonlySet<string>, context?: BuiltinToolAvailabilityContext): string[];
@@ -0,0 +1,241 @@
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
+ import { z } from "zod";
8
+ export declare const INPUT_ARG_CHAR_LIMIT = 6000;
9
+ export declare const ReadFileLineRangeSchema: z.ZodObject<{
10
+ start_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
11
+ end_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
12
+ }, z.core.$strip>;
13
+ export declare const ReadFileRequestSchema: z.ZodObject<{
14
+ path: z.ZodString;
15
+ start_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
16
+ end_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
17
+ }, z.core.$strip>;
18
+ /**
19
+ * Schema for read_files tool input
20
+ */
21
+ export declare const ReadFilesInputSchema: z.ZodObject<{
22
+ files: z.ZodArray<z.ZodObject<{
23
+ path: z.ZodString;
24
+ start_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
25
+ end_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
26
+ }, z.core.$strip>>;
27
+ }, z.core.$strip>;
28
+ /**
29
+ * Union schema for read_files tool input, allowing either a single string, an array of strings, or the full object schema
30
+ */
31
+ export declare const ReadFilesInputUnionSchema: z.ZodUnion<readonly [z.ZodObject<{
32
+ files: z.ZodArray<z.ZodObject<{
33
+ path: z.ZodString;
34
+ start_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
35
+ end_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
36
+ }, z.core.$strip>>;
37
+ }, z.core.$strip>, z.ZodObject<{
38
+ path: z.ZodString;
39
+ start_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
40
+ end_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
41
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
42
+ path: z.ZodString;
43
+ start_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
44
+ end_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
45
+ }, z.core.$strip>>, z.ZodArray<z.ZodString>, z.ZodString, z.ZodObject<{
46
+ files: z.ZodObject<{
47
+ path: z.ZodString;
48
+ start_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
49
+ end_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
50
+ }, z.core.$strip>;
51
+ }, z.core.$strip>, z.ZodObject<{
52
+ file_paths: z.ZodArray<z.ZodString>;
53
+ }, z.core.$strip>, z.ZodObject<{
54
+ file_paths: z.ZodString;
55
+ }, z.core.$strip>, z.ZodObject<{
56
+ paths: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
57
+ path: z.ZodString;
58
+ start_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
59
+ end_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
60
+ }, z.core.$strip>]>>;
61
+ }, z.core.$strip>, z.ZodObject<{
62
+ paths: z.ZodObject<{
63
+ path: z.ZodString;
64
+ start_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
65
+ end_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
66
+ }, z.core.$strip>;
67
+ }, z.core.$strip>, z.ZodObject<{
68
+ paths: z.ZodString;
69
+ }, z.core.$strip>]>;
70
+ /**
71
+ * Schema for search_codebase tool input
72
+ */
73
+ export declare const SearchCodebaseInputSchema: z.ZodObject<{
74
+ queries: z.ZodArray<z.ZodString>;
75
+ }, z.core.$strip>;
76
+ /**
77
+ * Union schema for search_codebase tool input, allowing either a single string, an array of strings, or the full object schema
78
+ */
79
+ export declare const SearchCodebaseUnionInputSchema: z.ZodUnion<readonly [z.ZodObject<{
80
+ queries: z.ZodArray<z.ZodString>;
81
+ }, z.core.$strip>, z.ZodArray<z.ZodString>, z.ZodString, z.ZodObject<{
82
+ queries: z.ZodString;
83
+ }, z.core.$strip>]>;
84
+ /**
85
+ * Schema for run_commands tool input
86
+ */
87
+ export declare const RunCommandsInputSchema: z.ZodObject<{
88
+ commands: z.ZodArray<z.ZodString>;
89
+ }, z.core.$strip>;
90
+ /**
91
+ * Union schema for run_commands tool input. More flexible.
92
+ */
93
+ export declare const RunCommandsInputUnionSchema: z.ZodUnion<readonly [z.ZodObject<{
94
+ commands: z.ZodArray<z.ZodString>;
95
+ }, z.core.$strip>, z.ZodObject<{
96
+ commands: z.ZodString;
97
+ }, z.core.$strip>, z.ZodObject<{
98
+ command: z.ZodString;
99
+ }, z.core.$strip>, z.ZodObject<{
100
+ cmd: z.ZodString;
101
+ }, z.core.$strip>, z.ZodArray<z.ZodString>, z.ZodString]>;
102
+ export declare const StructuredCommandInputSchema: z.ZodObject<{
103
+ command: z.ZodString;
104
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
105
+ }, z.core.$strip>;
106
+ export declare const StructuredCommandEntrySchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
107
+ command: z.ZodString;
108
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
109
+ }, z.core.$strip>]>;
110
+ /**
111
+ * Schema for run_commands tool input
112
+ */
113
+ export declare const StructuredCommandsInputSchema: z.ZodObject<{
114
+ commands: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
115
+ command: z.ZodString;
116
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
117
+ }, z.core.$strip>]>>;
118
+ }, z.core.$strip>;
119
+ /**
120
+ * Union schema for run_commands tool input. More flexible.
121
+ */
122
+ export declare const StructuredCommandsInputUnionSchema: z.ZodUnion<readonly [z.ZodObject<{
123
+ commands: z.ZodArray<z.ZodString>;
124
+ }, z.core.$strip>, z.ZodObject<{
125
+ commands: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
126
+ command: z.ZodString;
127
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
128
+ }, z.core.$strip>]>>;
129
+ }, z.core.$strip>, z.ZodObject<{
130
+ commands: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
131
+ command: z.ZodString;
132
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
133
+ }, z.core.$strip>]>;
134
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
135
+ command: z.ZodString;
136
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
137
+ }, z.core.$strip>>, z.ZodObject<{
138
+ command: z.ZodString;
139
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
140
+ }, z.core.$strip>, z.ZodObject<{
141
+ command: z.ZodString;
142
+ }, z.core.$strip>, z.ZodObject<{
143
+ cmd: z.ZodString;
144
+ }, z.core.$strip>, z.ZodArray<z.ZodString>, z.ZodString]>;
145
+ /**
146
+ * Schema for a single web fetch request
147
+ */
148
+ export declare const WebFetchRequestSchema: z.ZodObject<{
149
+ url: z.ZodString;
150
+ prompt: z.ZodString;
151
+ }, z.core.$strip>;
152
+ /**
153
+ * Schema for fetch_web_content tool input
154
+ */
155
+ export declare const FetchWebContentInputSchema: z.ZodObject<{
156
+ requests: z.ZodArray<z.ZodObject<{
157
+ url: z.ZodString;
158
+ prompt: z.ZodString;
159
+ }, z.core.$strip>>;
160
+ }, z.core.$strip>;
161
+ /**
162
+ * Schema for editor tool input
163
+ */
164
+ export declare const EditFileInputSchema: z.ZodObject<{
165
+ path: z.ZodString;
166
+ old_text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
167
+ new_text: z.ZodString;
168
+ insert_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
169
+ }, z.core.$strip>;
170
+ /**
171
+ * Schema for apply_patch tool input
172
+ */
173
+ export declare const ApplyPatchInputSchema: z.ZodObject<{
174
+ input: z.ZodString;
175
+ }, z.core.$strip>;
176
+ export declare const ApplyPatchInputUnionSchema: z.ZodUnion<readonly [z.ZodObject<{
177
+ input: z.ZodString;
178
+ }, z.core.$strip>, z.ZodString]>;
179
+ /**
180
+ * Schema for skills tool input
181
+ */
182
+ export declare const SkillsInputSchema: z.ZodObject<{
183
+ skill: z.ZodString;
184
+ args: z.ZodOptional<z.ZodNullable<z.ZodString>>;
185
+ }, z.core.$strip>;
186
+ /**
187
+ * Schema for ask_followup_question tool input
188
+ */
189
+ export declare const AskQuestionInputSchema: z.ZodObject<{
190
+ question: z.ZodString;
191
+ options: z.ZodArray<z.ZodString>;
192
+ }, z.core.$strip>;
193
+ export declare const SubmitInputSchema: z.ZodObject<{
194
+ summary: z.ZodString;
195
+ verified: z.ZodBoolean;
196
+ }, z.core.$strip>;
197
+ /**
198
+ * Input for a single file read request
199
+ */
200
+ export type ReadFileRequest = z.infer<typeof ReadFileRequestSchema>;
201
+ /**
202
+ * Input for the read_files tool
203
+ */
204
+ export type ReadFilesInput = z.infer<typeof ReadFilesInputSchema>;
205
+ /**
206
+ * Input for the search_codebase tool
207
+ */
208
+ export type SearchCodebaseInput = z.infer<typeof SearchCodebaseInputSchema>;
209
+ /**
210
+ * Input for the run_commands tool
211
+ */
212
+ export type RunCommandsInput = z.infer<typeof RunCommandsInputSchema>;
213
+ export type StructuredCommandInput = z.infer<typeof StructuredCommandInputSchema>;
214
+ /**
215
+ * Web fetch request parameters
216
+ */
217
+ export type WebFetchRequest = z.infer<typeof WebFetchRequestSchema>;
218
+ /**
219
+ * Input for the fetch_web_content tool
220
+ */
221
+ export type FetchWebContentInput = z.infer<typeof FetchWebContentInputSchema>;
222
+ /**
223
+ * Input for the editor tool
224
+ */
225
+ export type EditFileInput = z.infer<typeof EditFileInputSchema>;
226
+ /**
227
+ * Input for the apply_patch tool
228
+ */
229
+ export type ApplyPatchInput = z.infer<typeof ApplyPatchInputSchema>;
230
+ /**
231
+ * Input for the skills tool
232
+ */
233
+ export type SkillsInput = z.infer<typeof SkillsInputSchema>;
234
+ /**
235
+ * Input for the ask_followup_question tool
236
+ */
237
+ export type AskQuestionInput = z.infer<typeof AskQuestionInputSchema>;
238
+ /**
239
+ * Input for the submit and exit tool
240
+ */
241
+ export type SubmitInput = z.infer<typeof SubmitInputSchema>;
@@ -0,0 +1,43 @@
1
+ import type { AgentConfig, AgentEvent, AgentHooks, AgentTool, BasicLogger, HookErrorMode, ITelemetryService, ToolApprovalRequest, ToolApprovalResult } from "@cline/shared";
2
+ import { SessionRuntime } from "../../../runtime/orchestration/session-runtime-orchestrator";
3
+ type AgentExtension = NonNullable<AgentConfig["extensions"]>[number];
4
+ export type DelegatedAgentConnectionConfig = Pick<AgentConfig, "providerId" | "modelId" | "apiKey" | "baseUrl" | "headers" | "providerConfig" | "knownModels" | "thinking">;
5
+ export interface DelegatedAgentRuntimeConfig extends DelegatedAgentConnectionConfig {
6
+ cwd?: string;
7
+ providerId: string;
8
+ clinePlatform?: string;
9
+ clineIdeName?: string;
10
+ maxIterations?: number;
11
+ hooks?: AgentHooks;
12
+ extensions?: AgentExtension[];
13
+ logger?: BasicLogger;
14
+ telemetry?: ITelemetryService;
15
+ workspaceMetadata?: string;
16
+ }
17
+ export interface DelegatedAgentConfigProvider {
18
+ getRuntimeConfig(): DelegatedAgentRuntimeConfig;
19
+ getConnectionConfig(): DelegatedAgentConnectionConfig;
20
+ updateConnectionDefaults(overrides: Partial<DelegatedAgentConnectionConfig>): void;
21
+ }
22
+ export type DelegatedAgentKind = "subagent" | "teammate";
23
+ export interface BuildDelegatedAgentConfigOptions {
24
+ kind: DelegatedAgentKind;
25
+ prompt: string;
26
+ tools: AgentTool[];
27
+ configProvider: DelegatedAgentConfigProvider;
28
+ parentAgentId?: string;
29
+ maxIterations?: number;
30
+ abortSignal?: AbortSignal;
31
+ onEvent?: (event: AgentEvent) => void;
32
+ hookErrorMode?: HookErrorMode;
33
+ toolPolicies?: AgentConfig["toolPolicies"];
34
+ requestToolApproval?: (request: ToolApprovalRequest) => Promise<ToolApprovalResult> | ToolApprovalResult;
35
+ role?: string;
36
+ cwd?: string;
37
+ }
38
+ export declare function createDelegatedAgentConfigProvider(initialConfig: DelegatedAgentRuntimeConfig): DelegatedAgentConfigProvider;
39
+ export declare function buildDelegatedAgentConfig(options: BuildDelegatedAgentConfigOptions): AgentConfig & {
40
+ role?: string;
41
+ };
42
+ export declare function createDelegatedAgent(options: BuildDelegatedAgentConfigOptions): SessionRuntime;
43
+ export {};
@@ -0,0 +1,2 @@
1
+ export { buildTeamProgressSummary, toTeamProgressLifecycleEvent, } from "./projections";
2
+ export * from "./runtime";