@cline/core 0.0.51 → 0.0.52-nightly.1782444026

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.
@@ -1,9 +1,9 @@
1
- import type { ClineCoreAutomationApi, ClineCoreListHistoryOptions, ClineCoreOptions, ClineCoreSettingsApi, ClineCoreStartInput, RestoreInput, RestoreResult } from "./cline-core/types";
1
+ import type { ClineCoreAutomationApi, ClineCoreListHistoryOptions, ClineCoreOptions, ClineCoreSettingsApi, ClineCoreStartInput, CompareCheckpointInput, CompareCheckpointResult, RestoreInput, RestoreResult } from "./cline-core/types";
2
2
  import type { PendingPromptsServiceApi, RuntimeHost, RuntimeHostSubscribeOptions, SessionModelRuntimeService, SessionUsageRuntimeService, StartSessionInput, StartSessionResult } from "./runtime/host/runtime-host";
3
3
  import { FeatureFlagsService } from "./services/feature-flags";
4
4
  import type { CoreSessionEvent } from "./types/events";
5
5
  import type { SessionHistoryRecord } from "./types/sessions";
6
- 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
+ export type { ClineAutomationEventIngressResult, ClineAutomationEventLog, ClineAutomationEventSuppression, ClineAutomationListEventsOptions, ClineAutomationListRunsOptions, ClineAutomationListSpecsOptions, ClineAutomationRun, ClineAutomationRunStatus, ClineAutomationSpec, ClineCoreAutomationApi, ClineCoreAutomationOptions, ClineCoreListHistoryOptions, ClineCoreOptions, ClineCoreSettingsApi, ClineCoreStartInput, HubOptions, RemoteOptions, CompareCheckpointInput, CompareCheckpointResult, RestoreInput, RestoreOptions, RestoreResult, RuntimeHostMode, StartSessionBootstrap, } from "./cline-core/types";
7
7
  /**
8
8
  * The primary entry point for the Cline Core SDK.
9
9
  *
@@ -236,6 +236,7 @@ export declare class ClineCore {
236
236
  */
237
237
  readMessages: RuntimeHost["readSessionMessages"];
238
238
  restore(input: RestoreInput): Promise<RestoreResult>;
239
+ compareCheckpoint(input: CompareCheckpointInput): Promise<CompareCheckpointResult>;
239
240
  /**
240
241
  * Handles hook events from the runtime environment.
241
242
  *
@@ -3,6 +3,7 @@ import type { AgentConfig, AutomationEventEnvelope, BasicLogger, ITelemetryServi
3
3
  import type { CronEventSuppression } from "../cron/events/cron-event-ingress";
4
4
  import type { CronEventLogRecord, CronRunRecord, CronSpecRecord } from "../cron/store/sqlite-cron-store";
5
5
  import type { CheckpointEntry } from "../hooks/checkpoint-hooks";
6
+ import type { CheckpointWorkspaceCompareResult } from "../session/checkpoint-diff";
6
7
  import type { RuntimeCapabilities } from "../runtime/capabilities";
7
8
  import type { SessionHistoryListOptions } from "../runtime/host/history";
8
9
  import type { SessionBackend } from "../runtime/host/host";
@@ -121,6 +122,12 @@ export interface RestoreResult {
121
122
  messages?: Message[];
122
123
  checkpoint: CheckpointEntry;
123
124
  }
125
+ export interface CompareCheckpointInput {
126
+ sessionId: string;
127
+ checkpointRunCount: number;
128
+ cwd?: string;
129
+ }
130
+ export type CompareCheckpointResult = CheckpointWorkspaceCompareResult;
124
131
  export interface ClineCoreOptions {
125
132
  /**
126
133
  * A human-readable name for this SDK client (e.g. `"my-app"`, `"acme-bot"`).
@@ -1,3 +1,4 @@
1
+ import type { BasicLogger } from "@cline/shared";
1
2
  import type { McpManager, McpServerOAuthState, McpServerOAuthStatus, McpServerRegistration } from "./types";
2
3
  export interface McpSettingsFile {
3
4
  mcpServers: Record<string, Omit<McpServerRegistration, "name">>;
@@ -13,13 +14,69 @@ export interface SetMcpServerDisabledOptions {
13
14
  name: string;
14
15
  disabled: boolean;
15
16
  }
17
+ export interface McpSettingsLockOptions {
18
+ /** Maximum time to wait for the lock before failing. Defaults to 10 seconds. */
19
+ timeoutMs?: number;
20
+ /** Optional host logger; stale-lock takeover is logged as severity=warn. */
21
+ logger?: BasicLogger;
22
+ }
23
+ export type McpSettingsMutator<T> = (settings: Record<string, unknown>) => T;
24
+ export declare class McpSettingsUpdateSkippedError extends Error {
25
+ constructor(message: string);
26
+ }
27
+ export declare class McpSettingsLockTimeoutError extends Error {
28
+ constructor(message: string);
29
+ }
30
+ export declare class McpSettingsMutatorPurityError extends Error {
31
+ constructor(message: string);
32
+ }
16
33
  export declare function resolveDefaultMcpSettingsPath(): string;
34
+ /**
35
+ * Locked MCP settings read-modify-write that blocks the event loop (via
36
+ * `Atomics.wait`) while acquiring the lock.
37
+ *
38
+ * Prefer {@link updateMcpSettingsFile}: async acquisition keeps the event loop
39
+ * free and behaves identically otherwise.
40
+ *
41
+ * TODO: Delete once all callers migrate to {@link updateMcpSettingsFile}.
42
+ *
43
+ * The mutator is synchronous and may be called more than once with the same
44
+ * input to verify it is pure/deterministic. Compute any I/O, logging, network,
45
+ * timestamp, or random values before calling and close over them. Return a value
46
+ * only for a successful update; throw McpSettingsUpdateSkippedError to skip.
47
+ */
48
+ export declare function updateMcpSettingsFileSync<T>(filePath: string, mutator: McpSettingsMutator<T>, options?: McpSettingsLockOptions): T;
49
+ /**
50
+ * Locked MCP settings read-modify-write that yields the event loop while
51
+ * acquiring the lock, so concurrent work on the same loop keeps running.
52
+ *
53
+ * The mutator is synchronous and may be called more than once with the same
54
+ * input to verify it is pure/deterministic. Compute any I/O, logging, network,
55
+ * timestamp, or random values before calling and close over them. The lock is
56
+ * held only across the synchronous mutation, never across an `await`. Return a
57
+ * value only for a successful update; throw McpSettingsUpdateSkippedError to skip.
58
+ */
59
+ export declare function updateMcpSettingsFile<T>(filePath: string, mutator: McpSettingsMutator<T>, options?: McpSettingsLockOptions): Promise<T>;
17
60
  export declare function loadMcpSettingsFile(options?: LoadMcpSettingsOptions): McpSettingsFile;
18
61
  export declare function normalizeMcpServerOAuthState(value: McpServerOAuthState | undefined): McpServerOAuthState | undefined;
19
62
  export declare function hasMcpSettingsFile(options?: LoadMcpSettingsOptions): boolean;
20
63
  export declare function resolveMcpServerRegistrations(options?: LoadMcpSettingsOptions): McpServerRegistration[];
21
64
  export declare function setMcpServerDisabled(options: SetMcpServerDisabledOptions): void;
22
65
  export declare function getMcpServerOAuthState(serverName: string, options?: LoadMcpSettingsOptions): McpServerOAuthState | undefined;
66
+ /**
67
+ * Scoped read-modify-write of one server's `oauth` block that blocks the event
68
+ * loop while acquiring the lock.
69
+ *
70
+ * Prefer {@link updateMcpServerOAuthStateAsync}.
71
+ *
72
+ * TODO: Delete once all callers migrate to {@link updateMcpServerOAuthStateAsync}.
73
+ */
23
74
  export declare function updateMcpServerOAuthState(serverName: string, updater: (current: McpServerOAuthState) => McpServerOAuthState, options?: LoadMcpSettingsOptions): McpServerOAuthState;
75
+ /**
76
+ * Scoped read-modify-write of one server's `oauth` block that yields the event
77
+ * loop while acquiring the lock. The updater is synchronous and pure; it
78
+ * receives the server's current OAuth state and returns the next state.
79
+ */
80
+ export declare function updateMcpServerOAuthStateAsync(serverName: string, updater: (current: McpServerOAuthState) => McpServerOAuthState, options?: LoadMcpSettingsOptions): Promise<McpServerOAuthState>;
24
81
  export declare function listMcpServerOAuthStatuses(options?: LoadMcpSettingsOptions): McpServerOAuthStatus[];
25
82
  export declare function registerMcpServersFromSettingsFile(manager: Pick<McpManager, "registerServer">, options?: RegisterMcpServersFromSettingsOptions): Promise<McpServerRegistration[]>;
@@ -1,7 +1,7 @@
1
1
  export type { DefaultMcpServerClientFactoryOptions } from "./client";
2
2
  export { createDefaultMcpServerClientFactory } from "./client";
3
- export type { LoadMcpSettingsOptions, McpSettingsFile, RegisterMcpServersFromSettingsOptions, SetMcpServerDisabledOptions, } from "./config-loader";
4
- export { getMcpServerOAuthState, hasMcpSettingsFile, listMcpServerOAuthStatuses, loadMcpSettingsFile, registerMcpServersFromSettingsFile, resolveDefaultMcpSettingsPath, resolveMcpServerRegistrations, setMcpServerDisabled, updateMcpServerOAuthState, } from "./config-loader";
3
+ export type { LoadMcpSettingsOptions, McpSettingsLockOptions, McpSettingsMutator, McpSettingsFile, RegisterMcpServersFromSettingsOptions, SetMcpServerDisabledOptions, } from "./config-loader";
4
+ export { getMcpServerOAuthState, hasMcpSettingsFile, listMcpServerOAuthStatuses, loadMcpSettingsFile, registerMcpServersFromSettingsFile, resolveDefaultMcpSettingsPath, resolveMcpServerRegistrations, setMcpServerDisabled, updateMcpServerOAuthState, updateMcpServerOAuthStateAsync, updateMcpSettingsFile, updateMcpSettingsFileSync, McpSettingsLockTimeoutError, McpSettingsMutatorPurityError, McpSettingsUpdateSkippedError, } from "./config-loader";
5
5
  export { InMemoryMcpManager } from "./manager";
6
6
  export type { AuthorizeMcpServerOAuthOptions, AuthorizeMcpServerOAuthResult, CreateMcpOAuthProviderContextOptions, McpOAuthProviderContext, } from "./oauth";
7
7
  export { authorizeMcpServerOAuth } from "./oauth";
@@ -4,8 +4,8 @@
4
4
  * Factory functions for creating the default tools.
5
5
  */
6
6
  import { type AgentTool } from "@cline/shared";
7
- import { type ApplyPatchInput, type AskQuestionInput, type EditFileInput, type FetchWebContentInput, type ReadFilesInput, type RunCommandsInput, type SearchCodebaseInput, type SkillsInput, type StructuredCommandInput, type SubmitInput } from "./schemas";
8
- import type { ApplyPatchExecutor, AskQuestionExecutor, BashExecutor, CreateDefaultToolsOptions, DefaultToolsConfig, EditorExecutor, FileReadExecutor, SearchExecutor, SkillsExecutorWithMetadata, ToolOperationResult, VerifySubmitExecutor, WebFetchExecutor } from "./types";
7
+ import { type ApplyPatchInput, type AskQuestionInput, type EditFileInput, type FetchWebContentInput, type ReadFilesInput, type SearchCodebaseInput, type SkillsInput, type SubmitInput } from "./schemas";
8
+ import type { ApplyPatchExecutor, AskQuestionExecutor, CreateDefaultToolsOptions, DefaultToolsConfig, EditorExecutor, FileReadExecutor, SearchExecutor, ShellExecutor, SkillsExecutorWithMetadata, ToolOperationResult, VerifySubmitExecutor, WebFetchExecutor } from "./types";
9
9
  /**
10
10
  * Create the read_files tool
11
11
  *
@@ -19,17 +19,12 @@ export declare function createReadFilesTool(executor: FileReadExecutor, config?:
19
19
  */
20
20
  export declare function createSearchTool(executor: SearchExecutor, config?: Pick<DefaultToolsConfig, "cwd" | "searchTimeoutMs">): AgentTool<SearchCodebaseInput, ToolOperationResult[]>;
21
21
  /**
22
- * Create the run_commands tool
22
+ * Create the run_commands shell tool for the current platform.
23
23
  *
24
- * Executes shell commands in the project directory.
24
+ * This preserves the SDK's platform-specific prompting/schema choices while
25
+ * exposing a single generic shell-tool factory for host integrations.
25
26
  */
26
- export declare function createBashTool(executor: BashExecutor, config?: Pick<DefaultToolsConfig, "cwd" | "bashTimeoutMs">): AgentTool<RunCommandsInput, ToolOperationResult[]>;
27
- /**
28
- * Create the run_commands tool
29
- *
30
- * Executes shell commands in the project directory.
31
- */
32
- export declare function createWindowsShellTool(executor: BashExecutor, config?: Pick<DefaultToolsConfig, "cwd" | "bashTimeoutMs">): AgentTool<StructuredCommandInput, ToolOperationResult[]>;
27
+ export declare function createShellTool(executor: ShellExecutor, config?: Pick<DefaultToolsConfig, "cwd" | "bashTimeoutMs">): AgentTool<unknown, ToolOperationResult[]>;
33
28
  /**
34
29
  * Create the fetch_web_content tool
35
30
  *
@@ -3,16 +3,16 @@
3
3
  *
4
4
  * Built-in implementation for running shell commands using Node.js spawn.
5
5
  */
6
- import type { BashExecutor } from "../types";
6
+ import type { ShellExecutor } from "../types";
7
7
  export declare class CommandExitError extends Error {
8
8
  readonly exitCode: number;
9
9
  readonly output: string;
10
10
  constructor(exitCode: number, output: string);
11
11
  }
12
12
  /**
13
- * Options for the bash executor
13
+ * Options for the shell executor
14
14
  */
15
- export interface BashExecutorOptions {
15
+ export interface ShellExecutorOptions {
16
16
  /**
17
17
  * Shell to use for execution
18
18
  * @default "/bin/bash" on Unix, "powershell" on Windows
@@ -48,16 +48,16 @@ export interface BashExecutorOptions {
48
48
  combineOutput?: boolean;
49
49
  }
50
50
  /**
51
- * Create a bash executor using Node.js spawn
51
+ * Create a shell executor using Node.js spawn
52
52
  *
53
53
  * @example
54
54
  * ```typescript
55
- * const bash = createBashExecutor({
55
+ * const shell = createShellExecutor({
56
56
  * timeoutMs: 60000, // 1 minute timeout
57
57
  * shell: "/bin/zsh",
58
58
  * })
59
59
  *
60
- * const output = await bash("ls -la", "/path/to/project", context)
60
+ * const output = await shell("ls -la", "/path/to/project", context)
61
61
  * ```
62
62
  */
63
- export declare function createBashExecutor(options?: BashExecutorOptions): BashExecutor;
63
+ export declare function createShellExecutor(options?: ShellExecutorOptions): ShellExecutor;
@@ -7,13 +7,13 @@
7
7
  */
8
8
  import type { ToolExecutors } from "../types";
9
9
  import { type ApplyPatchExecutorOptions } from "./apply-patch";
10
- import { type BashExecutorOptions } from "./bash";
10
+ import { type ShellExecutorOptions } from "./bash";
11
11
  import { type EditorExecutorOptions } from "./editor";
12
12
  import { type FileReadExecutorOptions } from "./file-read";
13
13
  import { type SearchExecutorOptions } from "./search";
14
14
  import { type WebFetchExecutorOptions } from "./web-fetch";
15
15
  export { type ApplyPatchExecutorOptions, createApplyPatchExecutor, } from "./apply-patch";
16
- export { type BashExecutorOptions, createBashExecutor, } from "./bash";
16
+ export { type ShellExecutorOptions, createShellExecutor, } from "./bash";
17
17
  export { createEditorExecutor, type EditorExecutorOptions } from "./editor";
18
18
  export { createFileReadExecutor, type FileReadExecutorOptions, } from "./file-read";
19
19
  export { createSearchExecutor, type SearchExecutorOptions } from "./search";
@@ -24,11 +24,19 @@ export { createWebFetchExecutor, type WebFetchExecutorOptions, } from "./web-fet
24
24
  export interface DefaultExecutorsOptions {
25
25
  fileRead?: FileReadExecutorOptions;
26
26
  search?: SearchExecutorOptions;
27
- bash?: BashExecutorOptions;
27
+ bash?: ShellExecutorOptions;
28
28
  webFetch?: WebFetchExecutorOptions;
29
29
  applyPatch?: ApplyPatchExecutorOptions;
30
30
  editor?: EditorExecutorOptions;
31
31
  }
32
+ /**
33
+ * Create the default shell executor for the current platform.
34
+ *
35
+ * This is factored out from {@link createDefaultExecutors} so host integrations
36
+ * can reuse the SDK's cross-platform shell selection while supplying their own
37
+ * tool wrapper.
38
+ */
39
+ export declare function createDefaultShellExecutor(options?: ShellExecutorOptions): import("..").ShellExecutor;
32
40
  /**
33
41
  * Create all default executors with optional configuration
34
42
  *
@@ -15,6 +15,10 @@
15
15
  */
16
16
  /** Max characters of command output kept; beyond this the middle is elided. */
17
17
  export declare const MAX_COMMAND_OUTPUT_CHARS = 48000;
18
+ export declare function truncateCommandOutput(text: string, options?: {
19
+ maxChars?: number;
20
+ totalChars?: number;
21
+ }): string;
18
22
  /** Max lines returned per file read when the range is larger or absent. */
19
23
  export declare const MAX_READ_LINES = 2000;
20
24
  /** Max characters kept per line in file reads (defangs minified files). */
@@ -5,14 +5,15 @@
5
5
  */
6
6
  export { validateWithZod, zodToJsonSchema } from "@cline/shared";
7
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";
8
+ export { createApplyPatchTool, createAskQuestionTool, createDefaultTools, createEditorTool, createReadFilesTool, createSearchTool, createShellTool, createSkillsTool, createSubmitAndExitTool, createWebFetchTool, } from "./definitions";
9
+ export { type ApplyPatchExecutorOptions, createApplyPatchExecutor, createDefaultExecutors, createDefaultShellExecutor, createEditorExecutor, createFileReadExecutor, createSearchExecutor, createShellExecutor, createWebFetchExecutor, type DefaultExecutorsOptions, type EditorExecutorOptions, type FileReadExecutorOptions, type SearchExecutorOptions, type ShellExecutorOptions, type WebFetchExecutorOptions, } from "./executors/index";
10
+ export { MAX_COMMAND_OUTPUT_CHARS, truncateCommandOutput, } from "./executors/output-limits";
10
11
  export { DEFAULT_MODEL_TOOL_ROUTING_RULES, resolveToolRoutingConfig, type ToolRoutingRule, } from "./model-tool-routing";
11
12
  export { createDefaultToolsWithPreset, createToolPoliciesWithPreset, resolveToolPresetName, type ToolPolicyPresetName, type ToolPresetName, ToolPresets, } from "./presets";
12
13
  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 { 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 StructuredCommandInput, StructuredCommandInputSchema, type SubmitInput, SubmitInputSchema, type WebFetchRequest, WebFetchRequestSchema, } from "./schemas";
14
15
  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
+ export type { ApplyPatchExecutor, AskQuestionExecutor, CreateDefaultToolsOptions, DefaultToolName, DefaultToolsConfig, EditorExecutor, FileReadExecutor, SearchExecutor, ShellExecutor, SkillsExecutor, SkillsExecutorSkillMetadata, SkillsExecutorWithMetadata, ToolExecutors, ToolOperationResult, VerifySubmitExecutor, WebFetchExecutor, } from "./types";
16
17
  import type { AgentTool } from "@cline/shared";
17
18
  import { type DefaultExecutorsOptions } from "./executors/index";
18
19
  import type { CreateDefaultToolsOptions, ToolExecutors } from "./types";
@@ -89,24 +89,6 @@ export declare const SearchCodebaseUnionInputSchema: z.ZodUnion<readonly [z.ZodO
89
89
  }, z.core.$strip>, z.ZodArray<z.ZodString>, z.ZodString, z.ZodObject<{
90
90
  queries: z.ZodString;
91
91
  }, z.core.$strip>]>;
92
- /**
93
- * Schema for run_commands tool input
94
- */
95
- export declare const RunCommandsInputSchema: z.ZodObject<{
96
- commands: z.ZodArray<z.ZodString>;
97
- }, z.core.$strip>;
98
- /**
99
- * Union schema for run_commands tool input. More flexible.
100
- */
101
- export declare const RunCommandsInputUnionSchema: z.ZodUnion<readonly [z.ZodObject<{
102
- commands: z.ZodArray<z.ZodString>;
103
- }, z.core.$strip>, z.ZodObject<{
104
- commands: z.ZodString;
105
- }, z.core.$strip>, z.ZodObject<{
106
- command: z.ZodString;
107
- }, z.core.$strip>, z.ZodObject<{
108
- cmd: z.ZodString;
109
- }, z.core.$strip>, z.ZodArray<z.ZodString>, z.ZodString]>;
110
92
  export declare const StructuredCommandInputSchema: z.ZodObject<{
111
93
  command: z.ZodString;
112
94
  args: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -116,9 +98,13 @@ export declare const StructuredCommandEntrySchema: z.ZodUnion<readonly [z.ZodStr
116
98
  args: z.ZodOptional<z.ZodArray<z.ZodString>>;
117
99
  }, z.core.$strip>]>;
118
100
  /**
119
- * Schema for run_commands tool input
101
+ * Schema for run_commands tool input.
102
+ *
103
+ * Supports both shell strings and direct structured `{ command, args }` entries
104
+ * on every platform. Plain strings are interpreted by the active shell;
105
+ * structured entries bypass shell parsing and execute the command directly.
120
106
  */
121
- export declare const StructuredCommandsInputSchema: z.ZodObject<{
107
+ export declare const RunCommandsInputSchema: z.ZodObject<{
122
108
  commands: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
123
109
  command: z.ZodString;
124
110
  args: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -127,9 +113,7 @@ export declare const StructuredCommandsInputSchema: z.ZodObject<{
127
113
  /**
128
114
  * Union schema for run_commands tool input. More flexible.
129
115
  */
130
- export declare const StructuredCommandsInputUnionSchema: z.ZodUnion<readonly [z.ZodObject<{
131
- commands: z.ZodArray<z.ZodString>;
132
- }, z.core.$strip>, z.ZodObject<{
116
+ export declare const RunCommandsInputUnionSchema: z.ZodUnion<readonly [z.ZodObject<{
133
117
  commands: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
134
118
  command: z.ZodString;
135
119
  args: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1,7 +1,7 @@
1
1
  import type { AgentConfig, AgentEvent, AgentHooks, AgentTool, BasicLogger, HookErrorMode, ITelemetryService, ToolApprovalRequest, ToolApprovalResult } from "@cline/shared";
2
2
  import { SessionRuntime } from "../../../runtime/orchestration/session-runtime-orchestrator";
3
3
  type AgentExtension = NonNullable<AgentConfig["extensions"]>[number];
4
- export type DelegatedAgentConnectionConfig = Pick<AgentConfig, "providerId" | "modelId" | "apiKey" | "baseUrl" | "headers" | "providerConfig" | "knownModels" | "thinking">;
4
+ export type DelegatedAgentConnectionConfig = Pick<AgentConfig, "providerId" | "modelId" | "apiKey" | "baseUrl" | "headers" | "providerConfig" | "knownModels" | "thinking" | "maxTokensPerTurn">;
5
5
  export interface DelegatedAgentRuntimeConfig extends DelegatedAgentConnectionConfig {
6
6
  cwd?: string;
7
7
  providerId: string;
@@ -46,7 +46,7 @@ export type SearchExecutor = (query: string, cwd: string, context: AgentToolCont
46
46
  * @param context - Tool execution context
47
47
  * @returns Command output (stdout)
48
48
  */
49
- export type BashExecutor = (command: string | StructuredCommandInput, cwd: string, context: AgentToolContext) => Promise<string>;
49
+ export type ShellExecutor = (command: string | StructuredCommandInput, cwd: string, context: AgentToolContext) => Promise<string>;
50
50
  /**
51
51
  * Executor for fetching web content
52
52
  *
@@ -130,7 +130,7 @@ export interface ToolExecutors {
130
130
  /** Codebase search implementation */
131
131
  search?: SearchExecutor;
132
132
  /** Shell command execution implementation */
133
- bash?: BashExecutor;
133
+ bash?: ShellExecutor;
134
134
  /** Web content fetching implementation */
135
135
  webFetch?: WebFetchExecutor;
136
136
  /** Filesystem editor implementation */