@cline/core 0.0.64 → 0.0.65-nightly.1784776435
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.
- package/dist/cron/service/schedule-service.d.ts +2 -1
- package/dist/cron/store/sqlite-cron-store.d.ts +5 -2
- package/dist/extensions/context/basic-compaction.d.ts +10 -1
- package/dist/extensions/context/compaction-shared.d.ts +20 -0
- package/dist/extensions/tools/definitions.d.ts +21 -3
- package/dist/extensions/tools/index.d.ts +8 -3
- package/dist/extensions/tools/team/delegated-agent.d.ts +1 -1
- package/dist/extensions/tools/types.d.ts +7 -0
- package/dist/hub/daemon/entry.js +235 -210
- package/dist/hub/index.js +231 -206
- package/dist/hub/server/hub-server-options.d.ts +6 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +232 -207
- package/dist/runtime/host/local-runtime-host.d.ts +3 -1
- package/dist/runtime/orchestration/session-runtime-orchestrator.d.ts +7 -0
- package/dist/services/local-runtime-bootstrap.d.ts +2 -1
- package/dist/services/telemetry/core-events.d.ts +30 -4
- package/dist/services/telemetry/index.js +1 -1
- package/package.json +5 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type BasicLogger, type ChatRunTurnRequest, type ChatStartSessionArtifacts, type ChatStartSessionRequest, type HubScheduleCreateInput, type HubScheduleUpdateInput, type ScheduleExecutionRecord, type ScheduleExecutionStatus, type ScheduleRecord } from "@cline/shared";
|
|
2
2
|
type HubScheduleTurnResult = {
|
|
3
3
|
text: string;
|
|
4
4
|
usage?: {
|
|
@@ -82,6 +82,7 @@ export declare class HubScheduleService {
|
|
|
82
82
|
getSchedule(scheduleId: string): ScheduleRecord | undefined;
|
|
83
83
|
listSchedules(options?: ListSchedulesOptions): ScheduleRecord[];
|
|
84
84
|
updateSchedule(scheduleId: string, updates: HubScheduleUpdateInput): ScheduleRecord | undefined;
|
|
85
|
+
private validateScheduleTiming;
|
|
85
86
|
deleteSchedule(scheduleId: string): boolean;
|
|
86
87
|
pauseSchedule(scheduleId: string): ScheduleRecord | undefined;
|
|
87
88
|
resumeSchedule(scheduleId: string): ScheduleRecord | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type AutomationEventEnvelope, type CronSpec, type CronSpecExtensionKind, type CronTriggerKind, type HubScheduleCreateInput, type HubScheduleUpdateInput } from "@cline/shared";
|
|
2
2
|
/**
|
|
3
3
|
* Generalized cron/automation store backed by `cron.db`. Sessions stay in
|
|
4
4
|
* their own database (see @cline/shared `ensureSessionSchema`). cron_runs
|
|
@@ -170,8 +170,10 @@ export declare class SqliteCronStore {
|
|
|
170
170
|
tags?: string[];
|
|
171
171
|
}): CronSpecRecord[];
|
|
172
172
|
updateHubSchedule(scheduleId: string, updates: HubScheduleUpdateInput): CronSpecRecord | undefined;
|
|
173
|
+
private initializeHubScheduleNextRun;
|
|
173
174
|
deleteHubSchedule(scheduleId: string): boolean;
|
|
174
175
|
enqueueHubScheduleRun(scheduleId: string, triggerKind?: "manual" | "retry"): CronRunRecord | undefined;
|
|
176
|
+
private consumeOneOffWithManualRun;
|
|
175
177
|
listEventSpecsForType(eventType: string): CronSpecRecord[];
|
|
176
178
|
upsertSpec(input: UpsertSpecInput): UpsertSpecResult;
|
|
177
179
|
private insertSpecRow;
|
|
@@ -217,9 +219,10 @@ export declare class SqliteCronStore {
|
|
|
217
219
|
triggerEventId: string;
|
|
218
220
|
scheduledFor: string;
|
|
219
221
|
}): CronRunRecord | undefined;
|
|
220
|
-
|
|
222
|
+
hasConsumedOneOffRevision(specId: string, revision: number): boolean;
|
|
221
223
|
enqueueRun(input: EnqueueRunInput): CronRunRecord;
|
|
222
224
|
cancelQueuedRunsForSpec(specId: string): number;
|
|
225
|
+
private cancelQueuedOneOffRunsForSpec;
|
|
223
226
|
claimDueRuns(options: ClaimRunOptions): ClaimedCronRun[];
|
|
224
227
|
renewClaim(runId: string, claimToken: string, leaseUntilAt: string): boolean;
|
|
225
228
|
completeRun(runId: string, update: {
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BasicLogger } from "@cline/shared";
|
|
2
2
|
import type { CoreCompactionContext, CoreCompactionResult } from "../../types/config";
|
|
3
3
|
import { type EstimateMessageTokens } from "./compaction-shared";
|
|
4
|
+
/**
|
|
5
|
+
* Fold the conversation history without a summarizer model. Typed user
|
|
6
|
+
* prompts always survive. The latest typed turn keeps its newest messages
|
|
7
|
+
* verbatim within the token target, dropping only the oldest ones (the
|
|
8
|
+
* kept suffix starts at an assistant message so no tool pair is split).
|
|
9
|
+
* Older turns keep their concluding assistant answer when it fits, newest
|
|
10
|
+
* turns first. Everything else is dropped and re-surfaced as dropped-work
|
|
11
|
+
* summaries attached to the surviving prompts.
|
|
12
|
+
*/
|
|
4
13
|
export declare function runBasicCompaction(options: {
|
|
5
14
|
context: CoreCompactionContext;
|
|
6
15
|
estimateMessageTokens: EstimateMessageTokens;
|
|
@@ -51,6 +51,26 @@ export declare function findCutIndex(messages: MessageWithMetadata[], preserveRe
|
|
|
51
51
|
export declare function collectPaths(value: unknown): string[];
|
|
52
52
|
export declare function mergeUnique(base: string[], next: Iterable<string>): string[];
|
|
53
53
|
export declare function extractFileOps(messages: MessageWithMetadata[]): FileOperationSummary;
|
|
54
|
+
/** Commands longer than this are truncated in dropped-work summaries. */
|
|
55
|
+
export declare const COMMAND_SUMMARY_CHAR_LIMIT = 100;
|
|
56
|
+
/**
|
|
57
|
+
* Compact record of the tool work performed inside a span of dropped
|
|
58
|
+
* messages: which files were read and edited (with line ranges when
|
|
59
|
+
* known) and which commands ran.
|
|
60
|
+
*/
|
|
61
|
+
export interface ToolActivitySummary {
|
|
62
|
+
readFiles: string[];
|
|
63
|
+
editedFiles: string[];
|
|
64
|
+
commands: string[];
|
|
65
|
+
}
|
|
66
|
+
export declare function hasToolActivity(summary: ToolActivitySummary): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Summarize the tool work inside a span of messages that compaction is
|
|
69
|
+
* dropping. Read ranges come from read_files inputs; edited ranges come
|
|
70
|
+
* from the numbered diff in the matching editor result when present.
|
|
71
|
+
*/
|
|
72
|
+
export declare function summarizeToolActivity(messages: MessageWithMetadata[]): ToolActivitySummary;
|
|
73
|
+
export declare function formatToolActivitySummary(summary: ToolActivitySummary): string;
|
|
54
74
|
export declare function renderFilesSection(fileOps: FileOperationSummary): string;
|
|
55
75
|
export declare function ensureFilesSection(summary: string, fileOps: FileOperationSummary): string;
|
|
56
76
|
export declare function buildSummaryRequest(options: {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Factory functions for creating the default tools.
|
|
5
5
|
*/
|
|
6
|
-
import { type AgentTool } from "@cline/shared";
|
|
6
|
+
import { type AgentTool, type ShellKind } from "@cline/shared";
|
|
7
7
|
import { type ApplyPatchInput, type AskQuestionInput, type EditFileInput, type FetchWebContentInput, type ReadFilesInput, type SearchCodebaseInput, type SkillsInput, type SubmitInput } from "./schemas";
|
|
8
8
|
import type { ApplyPatchExecutor, AskQuestionExecutor, CreateDefaultToolsOptions, DefaultToolsConfig, EditorExecutor, FileReadExecutor, SearchExecutor, ShellExecutor, SkillsExecutorWithMetadata, ToolOperationResult, VerifySubmitExecutor, WebFetchExecutor } from "./types";
|
|
9
9
|
/**
|
|
@@ -18,13 +18,31 @@ export declare function createReadFilesTool(executor: FileReadExecutor, config?:
|
|
|
18
18
|
* Performs regex pattern searches across the codebase.
|
|
19
19
|
*/
|
|
20
20
|
export declare function createSearchTool(executor: SearchExecutor, config?: Pick<DefaultToolsConfig, "cwd" | "searchTimeoutMs">): AgentTool<SearchCodebaseInput, ToolOperationResult[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Build the run_commands tool description for the shell that will actually
|
|
23
|
+
* execute the commands. The shell kind decides the syntax guidance (quoting,
|
|
24
|
+
* sequencing, heredocs), and isWindows adds environment context for POSIX
|
|
25
|
+
* shells running on a Windows host (e.g. Git Bash).
|
|
26
|
+
*/
|
|
27
|
+
export declare function buildRunCommandsDescription(shellKind: ShellKind, isWindows: boolean): string;
|
|
21
28
|
/**
|
|
22
29
|
* Create the run_commands shell tool for the current platform.
|
|
23
30
|
*
|
|
24
31
|
* This preserves the SDK's platform-specific prompting/schema choices while
|
|
25
|
-
* exposing a single generic shell-tool factory for host integrations.
|
|
32
|
+
* exposing a single generic shell-tool factory for host integrations. Pass
|
|
33
|
+
* config.shell (matching the executor's shell) so the syntax guidance in the
|
|
34
|
+
* tool description matches the shell that actually runs the commands.
|
|
35
|
+
*
|
|
36
|
+
* config.shell may be a provider function instead of a string. The runtime
|
|
37
|
+
* reads `description` when building each model request, so a provider is
|
|
38
|
+
* consulted at that boundary: a shell change made while the model is
|
|
39
|
+
* generating does not affect the request in flight, and the next request
|
|
40
|
+
* names the new shell. The provider must return the shell the executor will
|
|
41
|
+
* use for tool calls issued by that next request.
|
|
26
42
|
*/
|
|
27
|
-
export declare function createShellTool(executor: ShellExecutor, config?: Pick<DefaultToolsConfig, "cwd" | "bashTimeoutMs">
|
|
43
|
+
export declare function createShellTool(executor: ShellExecutor, config?: Pick<DefaultToolsConfig, "cwd" | "bashTimeoutMs"> & {
|
|
44
|
+
shell?: string | (() => string);
|
|
45
|
+
}): AgentTool<unknown, ToolOperationResult[]>;
|
|
28
46
|
/**
|
|
29
47
|
* Create the fetch_web_content tool
|
|
30
48
|
*
|
|
@@ -14,7 +14,7 @@ export { type BuiltinToolAvailabilityContext, getCoreAcpToolNames, getCoreBuilti
|
|
|
14
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";
|
|
15
15
|
export { TEAM_TOOL_NAMES } from "./team/team-tools";
|
|
16
16
|
export type { ApplyPatchExecutor, AskQuestionExecutor, CreateDefaultToolsOptions, DefaultToolName, DefaultToolsConfig, EditorExecutor, FileReadExecutor, SearchExecutor, ShellExecutor, SkillsExecutor, SkillsExecutorSkillMetadata, SkillsExecutorWithMetadata, ToolExecutors, ToolOperationResult, VerifySubmitExecutor, WebFetchExecutor, } from "./types";
|
|
17
|
-
import type
|
|
17
|
+
import { type AgentTool } from "@cline/shared";
|
|
18
18
|
import { type DefaultExecutorsOptions } from "./executors/index";
|
|
19
19
|
import type { CreateDefaultToolsOptions, ToolExecutors } from "./types";
|
|
20
20
|
/**
|
|
@@ -22,11 +22,16 @@ import type { CreateDefaultToolsOptions, ToolExecutors } from "./types";
|
|
|
22
22
|
*/
|
|
23
23
|
export interface CreateBuiltinToolsOptions extends Omit<CreateDefaultToolsOptions, "executors"> {
|
|
24
24
|
/**
|
|
25
|
-
* Configuration for the built-in executors
|
|
25
|
+
* Configuration for the built-in executors. `bash.shell` is used when the
|
|
26
|
+
* top-level `shell` option is not set; the top-level option takes precedence.
|
|
26
27
|
*/
|
|
27
28
|
executorOptions?: DefaultExecutorsOptions;
|
|
28
29
|
/**
|
|
29
|
-
* Optional executor overrides/additions for tools without built-ins
|
|
30
|
+
* Optional executor overrides/additions for tools without built-ins.
|
|
31
|
+
* An overriding `bash` executor replaces the built-in one wholesale: it
|
|
32
|
+
* decides its own shell, and the resolved `shell` option only shapes the
|
|
33
|
+
* run_commands description. Overriders must honor that shell themselves
|
|
34
|
+
* to keep the description truthful.
|
|
30
35
|
*/
|
|
31
36
|
executors?: Partial<ToolExecutors>;
|
|
32
37
|
}
|
|
@@ -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" | "reasoningEffort" | "thinkingBudgetTokens" | "maxTokensPerTurn" | "temperature">;
|
|
4
|
+
export type DelegatedAgentConnectionConfig = Pick<AgentConfig, "providerId" | "modelId" | "apiKey" | "baseUrl" | "headers" | "onAuthError" | "providerConfig" | "knownModels" | "thinking" | "reasoningEffort" | "thinkingBudgetTokens" | "maxTokensPerTurn" | "temperature">;
|
|
5
5
|
export interface DelegatedAgentRuntimeConfig extends DelegatedAgentConnectionConfig {
|
|
6
6
|
cwd?: string;
|
|
7
7
|
providerId: string;
|
|
@@ -201,6 +201,13 @@ export interface DefaultToolsConfig {
|
|
|
201
201
|
* Current working directory for tools that need it
|
|
202
202
|
*/
|
|
203
203
|
cwd?: string;
|
|
204
|
+
/**
|
|
205
|
+
* Shell executable (name or full path) the run_commands executor will use.
|
|
206
|
+
* The tool description tells the model which shell syntax to write, so this
|
|
207
|
+
* must match the shell configured on the executor.
|
|
208
|
+
* @default getDefaultShell(process.platform) — "/bin/bash" on Unix, "powershell" on Windows
|
|
209
|
+
*/
|
|
210
|
+
shell?: string;
|
|
204
211
|
/**
|
|
205
212
|
* Timeout for file read operations in milliseconds
|
|
206
213
|
* @default 10000
|