@cline/core 0.0.82 → 0.0.83

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 (65) hide show
  1. package/dist/ClineCore.d.ts +9 -0
  2. package/dist/account/index.d.ts +1 -0
  3. package/dist/account/telemetry.d.ts +22 -0
  4. package/dist/cron/events/cron-event-ingress.d.ts +4 -2
  5. package/dist/cron/runner/cron-runner.d.ts +5 -2
  6. package/dist/cron/service/cron-service.d.ts +2 -1
  7. package/dist/cron/service/schedule-service.d.ts +2 -1
  8. package/dist/cron/store/sqlite-cron-store.d.ts +7 -1
  9. package/dist/extensions/agent-plugin/agent-skill.d.ts +21 -0
  10. package/dist/extensions/agent-plugin/index.d.ts +4 -0
  11. package/dist/extensions/agent-plugin/loader.d.ts +10 -0
  12. package/dist/extensions/agent-plugin/types.d.ts +67 -0
  13. package/dist/extensions/config/index.d.ts +1 -1
  14. package/dist/extensions/config/user-instruction-config-loader.d.ts +9 -0
  15. package/dist/extensions/config/user-instruction-plugin.d.ts +1 -0
  16. package/dist/extensions/config/user-instruction-service.d.ts +7 -1
  17. package/dist/extensions/context/compaction.d.ts +20 -0
  18. package/dist/extensions/index.d.ts +2 -0
  19. package/dist/extensions/mcp/client.d.ts +2 -0
  20. package/dist/extensions/mcp/oauth.d.ts +6 -0
  21. package/dist/extensions/tools/definitions.d.ts +5 -5
  22. package/dist/hooks/checkpoint-hooks.d.ts +23 -1
  23. package/dist/hub/client/index.d.ts +10 -0
  24. package/dist/hub/daemon/entry.js +434 -457
  25. package/dist/hub/daemon/index.d.ts +9 -8
  26. package/dist/hub/index.js +303 -327
  27. package/dist/hub/runtime-host/hub-runtime-host.d.ts +3 -2
  28. package/dist/hub/server/handlers/session-handlers.d.ts +5 -1
  29. package/dist/index.d.ts +10 -7
  30. package/dist/index.js +271 -249
  31. package/dist/remote/remote-environments.d.ts +155 -0
  32. package/dist/remote/remote-helper-entry.d.ts +1 -0
  33. package/dist/remote/remote-helper-entry.js +5 -0
  34. package/dist/remote/remote-helper.d.ts +29 -0
  35. package/dist/remote/remote-helper.js +4 -0
  36. package/dist/remote/shell-path.d.ts +88 -0
  37. package/dist/runtime/host/local-runtime-host.d.ts +2 -2
  38. package/dist/runtime/host/runtime-host.d.ts +11 -1
  39. package/dist/runtime/orchestration/session-runtime.d.ts +3 -0
  40. package/dist/services/global-settings.d.ts +6 -0
  41. package/dist/services/llms/provider-defaults.d.ts +1 -1
  42. package/dist/services/llms/provider-settings.d.ts +20 -18
  43. package/dist/services/local-runtime-bootstrap.d.ts +7 -0
  44. package/dist/services/providers/local-provider-registry.d.ts +3 -3
  45. package/dist/services/providers/local-provider-service.d.ts +3 -1
  46. package/dist/services/providers/provider-config-fields.d.ts +11 -0
  47. package/dist/services/session-import/claude-code.d.ts +1 -1
  48. package/dist/services/session-import/paths.d.ts +9 -0
  49. package/dist/services/telemetry/core-events.d.ts +29 -5
  50. package/dist/services/telemetry/index.d.ts +1 -0
  51. package/dist/services/telemetry/index.js +1 -1
  52. package/dist/services/telemetry/scoped-telemetry.d.ts +31 -0
  53. package/dist/services/workspace/workspace-telemetry.d.ts +5 -0
  54. package/dist/session/models/session-manifest.d.ts +1 -1
  55. package/dist/session/services/persistence-service.d.ts +3 -1
  56. package/dist/session/session-versioning-service.d.ts +8 -0
  57. package/dist/settings/types.d.ts +8 -0
  58. package/dist/tasks/agenda-task-tool.d.ts +1 -1
  59. package/dist/tasks/task-tool.d.ts +3 -3
  60. package/dist/types/chat-schema.d.ts +2 -2
  61. package/dist/types/config.d.ts +5 -0
  62. package/dist/types/session.d.ts +2 -0
  63. package/dist/types.d.ts +4 -4
  64. package/package.json +12 -4
  65. package/dist/cron/runner/resource-limiter.d.ts +0 -8
@@ -300,6 +300,15 @@ export declare class ClineCore {
300
300
  * ```
301
301
  */
302
302
  subscribe(listener: (event: CoreSessionEvent) => void, options?: RuntimeHostSubscribeOptions): () => void;
303
+ /**
304
+ * Whether this instance is subscribed to a session's live events.
305
+ *
306
+ * In hub mode ClineCore subscribes to a session when it starts, sends to,
307
+ * or lists pending prompts for it, and unsubscribes on stop. A client that
308
+ * also observes the hub directly can use this to render one copy of the
309
+ * session's events instead of both.
310
+ */
311
+ hasSessionSubscription(sessionId: string): boolean;
303
312
  /**
304
313
  * Updates the AI model used by an active session.
305
314
  *
@@ -1,3 +1,4 @@
1
1
  export { ClineAccountService, type ClineAccountServiceOptions, } from "./cline-account-service";
2
2
  export { type ClineAccountOperations, executeClineAccountAction, isClineAccountActionRequest, type ProviderActionExecutor, RpcClineAccountService, } from "./rpc";
3
+ export { type ClineAccountTelemetryIdentity, persistClineAccountTelemetryIdentity, resolveClineAccountTelemetryIdentity, } from "./telemetry";
3
4
  export type { ClineAccountBalance, ClineAccountOrganization, ClineAccountOrganizationBalance, ClineAccountOrganizationUsageTransaction, ClineAccountPaymentTransaction, ClineAccountUsageTransaction, ClineAccountUser, ClineOrganization, ClineSubscriptionPlan, FeaturebaseTokenResponse, UserCurrentPlan, UserRemoteConfigOrganization, UserRemoteConfigResponse, } from "./types";
@@ -0,0 +1,22 @@
1
+ import type { ProviderSettingsManager } from "../services/storage/provider-settings-manager";
2
+ import type { ClineAccountUser } from "./types";
3
+ /** Account identity shared by telemetry and feature-flag integrations. */
4
+ export interface ClineAccountTelemetryIdentity {
5
+ id: string;
6
+ email?: string;
7
+ provider: "cline";
8
+ organizationId?: string;
9
+ organizationName?: string;
10
+ memberId?: string;
11
+ }
12
+ /**
13
+ * Resolve the authenticated user and active organization once so every client
14
+ * applies the same cross-surface account dimensions.
15
+ */
16
+ export declare function resolveClineAccountTelemetryIdentity(user: ClineAccountUser): ClineAccountTelemetryIdentity;
17
+ /**
18
+ * Persist the latest active organization alongside OAuth settings. Detached
19
+ * runtime processes (notably the shared Hub) can then enrich task telemetry
20
+ * without making their own account API request.
21
+ */
22
+ export declare function persistClineAccountTelemetryIdentity(manager: Pick<ProviderSettingsManager, "getProviderSettings" | "saveProviderSettings">, identity: ClineAccountTelemetryIdentity): boolean;
@@ -3,8 +3,9 @@ import type { CronEventLogRecord, CronRunRecord, CronSpecRecord, SqliteCronStore
3
3
  /**
4
4
  * Durable ingress for normalized automation events.
5
5
  *
6
- * This layer persists the incoming event before matching, then materializes
7
- * queued `cron_runs` for matching event specs. It deliberately does not
6
+ * This layer atomically persists the incoming event and materializes queued
7
+ * `cron_runs` for matching event specs. Failed acceptance rolls back so the
8
+ * same event can be redelivered without partial fan-out. It deliberately does not
8
9
  * execute agents; the normal runner claim loop owns execution.
9
10
  */
10
11
  export interface CronEventIngressOptions {
@@ -33,5 +34,6 @@ export declare class CronEventIngress {
33
34
  private readonly logger?;
34
35
  constructor(options: CronEventIngressOptions);
35
36
  ingestEvent(event: AutomationEventEnvelope): CronEventIngressResult;
37
+ private materializeEvent;
36
38
  private materializeForSpec;
37
39
  }
@@ -1,4 +1,4 @@
1
- import type { BasicLogger } from "@cline/shared";
1
+ import type { BasicLogger, ITelemetryService } from "@cline/shared";
2
2
  import type { ResolveCronSpecsDirOptions } from "@cline/shared/storage";
3
3
  import type { HubScheduleRuntimeHandlers } from "../service/schedule-service";
4
4
  import type { CronRunRecord, CronSpecRecord, SqliteCronStore } from "../store/sqlite-cron-store";
@@ -26,6 +26,7 @@ export interface CronRunnerOptions {
26
26
  /** Cron spec source/report location. Defaults to global `~/.cline/cron`. */
27
27
  specs?: ResolveCronSpecsDirOptions;
28
28
  logger?: BasicLogger;
29
+ telemetry?: ITelemetryService;
29
30
  pollIntervalMs?: number;
30
31
  claimLeaseSeconds?: number;
31
32
  globalMaxConcurrency?: number;
@@ -34,7 +35,6 @@ export declare class CronRunner {
34
35
  private readonly store;
35
36
  private readonly materializer;
36
37
  private readonly options;
37
- private readonly limiter;
38
38
  private readonly claimLeaseMs;
39
39
  private timer;
40
40
  private started;
@@ -42,6 +42,7 @@ export declare class CronRunner {
42
42
  private disposed;
43
43
  private stopping;
44
44
  private readonly activeRuns;
45
+ private readonly executions;
45
46
  constructor(options: CronRunnerOptions);
46
47
  start(): Promise<void>;
47
48
  stop(): Promise<void>;
@@ -52,6 +53,8 @@ export declare class CronRunner {
52
53
  sessionId?: string;
53
54
  }>;
54
55
  private executeClaim;
56
+ private writeReport;
57
+ private cleanupSession;
55
58
  private publishScheduleExecutionEvent;
56
59
  private buildPrompt;
57
60
  private startClaimLeaseHeartbeat;
@@ -1,4 +1,4 @@
1
- import type { AutomationEventEnvelope, BasicLogger } from "@cline/shared";
1
+ import type { AutomationEventEnvelope, BasicLogger, ITelemetryService } from "@cline/shared";
2
2
  import type { ResolveCronSpecsDirOptions } from "@cline/shared/storage";
3
3
  import { type CronEventIngressResult } from "../events/cron-event-ingress";
4
4
  import type { CronRunRecord, CronSpecRecord, ListEventLogsOptions, ListRunsOptions, ListSpecsOptions } from "../store/sqlite-cron-store";
@@ -25,6 +25,7 @@ export interface CronServiceOptions {
25
25
  runtimeHandlers: HubScheduleRuntimeHandlers;
26
26
  dbPath?: string;
27
27
  logger?: BasicLogger;
28
+ telemetry?: ITelemetryService;
28
29
  pollIntervalMs?: number;
29
30
  claimLeaseSeconds?: number;
30
31
  globalMaxConcurrency?: number;
@@ -1,4 +1,4 @@
1
- import { type BasicLogger, type ChatRunTurnRequest, type ChatStartSessionArtifacts, type ChatStartSessionRequest, type HubScheduleCreateInput, type HubScheduleUpdateInput, type ScheduleExecutionRecord, type ScheduleExecutionStatus, type ScheduleRecord } from "@cline/shared";
1
+ import { type BasicLogger, type ChatRunTurnRequest, type ChatStartSessionArtifacts, type ChatStartSessionRequest, type HubScheduleCreateInput, type HubScheduleUpdateInput, type ITelemetryService, type ScheduleExecutionRecord, type ScheduleExecutionStatus, type ScheduleRecord } from "@cline/shared";
2
2
  import type { ResolveCronSpecsDirOptions } from "@cline/shared/storage";
3
3
  type HubScheduleTurnResult = {
4
4
  text: string;
@@ -56,6 +56,7 @@ export interface HubScheduleServiceOptions {
56
56
  runtimeHandlers: HubScheduleRuntimeHandlers;
57
57
  eventPublisher?: (eventType: string, payload: Record<string, unknown>) => void;
58
58
  logger?: BasicLogger;
59
+ telemetry?: ITelemetryService;
59
60
  dbPath?: string;
60
61
  /**
61
62
  * Cron spec source/report location forwarded to the runner. Defaults to
@@ -128,6 +128,8 @@ export interface ListRunsOptions {
128
128
  limit?: number;
129
129
  }
130
130
  export interface ClaimRunOptions {
131
+ /** Database-wide concurrency limit; defaults to 10. Per-spec limits always apply. */
132
+ maxConcurrency?: number;
131
133
  nowIso: string;
132
134
  leaseMs: number;
133
135
  limit?: number;
@@ -206,6 +208,8 @@ export declare class SqliteCronStore {
206
208
  * for an unknown run.
207
209
  */
208
210
  getRunOrdinal(runId: string): number | undefined;
211
+ /** Execute synchronous event acceptance and materialization as one atomic write. */
212
+ eventTransaction<T>(work: () => T): T;
209
213
  insertEventLog(event: AutomationEventEnvelope, options?: {
210
214
  receivedAtIso?: string;
211
215
  }): InsertEventLogResult;
@@ -254,8 +258,10 @@ export declare class SqliteCronStore {
254
258
  requeueRun(update: ClaimBoundUpdate & {
255
259
  error?: string;
256
260
  scheduledFor?: string;
261
+ /** Undo the claim's attempt increment when execution never started. */
262
+ releaseAttempt?: boolean;
257
263
  }): boolean;
258
- attachSessionIdToRun(runId: string, sessionId: string): void;
264
+ attachSessionIdToRun(runId: string, sessionId: string, claimToken: string): boolean;
259
265
  attachReportPathToRun(runId: string, reportPath: string): void;
260
266
  }
261
267
  export {};
@@ -0,0 +1,21 @@
1
+ export interface AgentSkillMetadata {
2
+ name: string;
3
+ description: string;
4
+ license?: string;
5
+ compatibility?: string;
6
+ metadata?: Record<string, string>;
7
+ "allowed-tools"?: string;
8
+ }
9
+ export interface ParsedAgentSkill {
10
+ metadata: AgentSkillMetadata;
11
+ instructions: string;
12
+ frontmatter: Record<string, unknown>;
13
+ }
14
+ /**
15
+ * Parse and validate one Agent Skills specification `SKILL.md` document.
16
+ *
17
+ * Cline's own skill files intentionally remain backwards-compatible and more
18
+ * permissive. Agent Plugin skills go through this strict path because the
19
+ * Agent Plugins contract requires an invalid skill to be skipped in isolation.
20
+ */
21
+ export declare function parseAgentSkillMarkdown(content: string, directoryName: string): ParsedAgentSkill;
@@ -0,0 +1,4 @@
1
+ export type { AgentSkillMetadata, ParsedAgentSkill } from "./agent-skill";
2
+ export { parseAgentSkillMarkdown } from "./agent-skill";
3
+ export { AGENT_PLUGINS_V1_MANIFEST_SCHEMA, AGENT_PLUGINS_V1_MCP_SCHEMA, getAgentPluginPackageDisplayName, loadAgentPluginPackages, } from "./loader";
4
+ export type { AgentPluginPackageDiagnostic, AgentPluginPackageDiagnosticScope, AgentPluginPackageLoadReport, AgentPluginPackageManifest, AgentPluginPackageMcpServer, AgentPluginPackageSkill, LoadAgentPluginPackagesOptions, LoadedAgentPluginPackage, } from "./types";
@@ -0,0 +1,10 @@
1
+ import type { AgentPluginPackageLoadReport, LoadAgentPluginPackagesOptions } from "./types";
2
+ export declare const AGENT_PLUGINS_V1_MANIFEST_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
3
+ export declare const AGENT_PLUGINS_V1_MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json";
4
+ /**
5
+ * Discover and load Agent Plugins v1 from runtime-host-local filesystem paths.
6
+ * No schema is fetched over the network: canonical identifiers select the
7
+ * validation code bundled with this SDK build.
8
+ */
9
+ export declare function loadAgentPluginPackages(options?: LoadAgentPluginPackagesOptions): Promise<AgentPluginPackageLoadReport>;
10
+ export declare function getAgentPluginPackageDisplayName(path: string): string;
@@ -0,0 +1,67 @@
1
+ import type { McpServerRegistration } from "../mcp";
2
+ import type { AgentSkillMetadata } from "./agent-skill";
3
+ export interface AgentPluginPackageManifest {
4
+ $schema: string;
5
+ name: string;
6
+ version?: string;
7
+ description?: string;
8
+ author?: {
9
+ name?: string;
10
+ email?: string;
11
+ url?: string;
12
+ };
13
+ homepage?: string;
14
+ repository?: string;
15
+ license?: string;
16
+ keywords?: string[];
17
+ extensions?: Record<string, unknown>;
18
+ }
19
+ export interface AgentPluginPackageSkill {
20
+ pluginName: string;
21
+ pluginRoot: string;
22
+ directoryPath: string;
23
+ filePath: string;
24
+ metadata: AgentSkillMetadata;
25
+ }
26
+ export interface AgentPluginPackageMcpServer {
27
+ pluginName: string;
28
+ pluginRoot: string;
29
+ pluginDataPath?: string;
30
+ serverName: string;
31
+ registration: McpServerRegistration;
32
+ }
33
+ export type AgentPluginPackageDiagnosticScope = "plugin" | "manifest" | "skills" | "skill" | "mcp" | "mcp-server";
34
+ export interface AgentPluginPackageDiagnostic {
35
+ level: "warning" | "error";
36
+ scope: AgentPluginPackageDiagnosticScope;
37
+ pluginPath: string;
38
+ pluginName?: string;
39
+ componentPath?: string;
40
+ componentName?: string;
41
+ message: string;
42
+ }
43
+ export interface LoadedAgentPluginPackage {
44
+ rootPath: string;
45
+ manifestPath: string;
46
+ manifest: AgentPluginPackageManifest;
47
+ skills: AgentPluginPackageSkill[];
48
+ mcpServers: AgentPluginPackageMcpServer[];
49
+ }
50
+ export interface AgentPluginPackageLoadReport {
51
+ plugins: LoadedAgentPluginPackage[];
52
+ skills: AgentPluginPackageSkill[];
53
+ mcpServers: AgentPluginPackageMcpServer[];
54
+ diagnostics: AgentPluginPackageDiagnostic[];
55
+ }
56
+ export interface LoadAgentPluginPackagesOptions {
57
+ /** Explicit plugin roots, resolved on the runtime host relative to `cwd`. */
58
+ pluginPaths?: ReadonlyArray<string>;
59
+ /** Base directory for resolving relative explicit plugin paths. */
60
+ cwd?: string;
61
+ /** Override automatic search roots. Primarily useful to embedded hosts/tests. */
62
+ searchPaths?: ReadonlyArray<string>;
63
+ /** Override the client-managed persistent Agent Plugin data root. */
64
+ pluginDataRoot?: string;
65
+ /** Manifest names disabled by the runtime host. Disabled names still reserve precedence. */
66
+ disabledPluginNames?: ReadonlyArray<string>;
67
+ }
@@ -4,4 +4,4 @@ export { UnifiedConfigFileWatcher } from "./unified-config-file-watcher";
4
4
  export type { CreateInstructionWatcherOptions, CreateRulesConfigDefinitionOptions, CreateSkillsConfigDefinitionOptions, CreateWorkflowsConfigDefinitionOptions, ParseMarkdownFrontmatterResult, RuleConfig, SkillConfig, UserInstructionConfig, UserInstructionConfigType, WorkflowConfig, } from "./user-instruction-config-loader";
5
5
  export { createRulesConfigDefinition, createSkillsConfigDefinition, createWorkflowsConfigDefinition, parseRuleConfigFromMarkdown, parseSkillConfigFromMarkdown, parseWorkflowConfigFromMarkdown, RULES_CONFIG_DIRECTORY_NAME, resolveRulesConfigSearchPaths, resolveSkillsConfigSearchPaths, resolveWorkflowsConfigSearchPaths, SKILLS_CONFIG_DIRECTORY_NAME, WORKFLOWS_CONFIG_DIRECTORY_NAME, } from "./user-instruction-config-loader";
6
6
  export type { CreateUserInstructionConfigServiceOptions, UserInstructionConfigRecord, UserInstructionConfigService, } from "./user-instruction-service";
7
- export { createUserInstructionConfigService } from "./user-instruction-service";
7
+ export { combineUserInstructionConfigServices, createUserInstructionConfigService, } from "./user-instruction-service";
@@ -1,4 +1,5 @@
1
1
  import { RULES_CONFIG_DIRECTORY_NAME, SKILLS_CONFIG_DIRECTORY_NAME, WORKFLOWS_CONFIG_DIRECTORY_NAME } from "@cline/shared/storage";
2
+ import { type AgentPluginPackageSkill } from "../agent-plugin";
2
3
  import { type UnifiedConfigDefinition, UnifiedConfigFileWatcher, type UnifiedConfigWatcherEvent } from "./unified-config-file-watcher";
3
4
  export { RULES_CONFIG_DIRECTORY_NAME, SKILLS_CONFIG_DIRECTORY_NAME, WORKFLOWS_CONFIG_DIRECTORY_NAME, };
4
5
  export interface ParseMarkdownFrontmatterResult {
@@ -13,6 +14,13 @@ export interface SkillConfig {
13
14
  disabled?: boolean;
14
15
  instructions: string;
15
16
  frontmatter: Record<string, unknown>;
17
+ source?: {
18
+ type: "agent-plugin";
19
+ pluginName: string;
20
+ pluginRoot: string;
21
+ skillRoot: string;
22
+ filePath: string;
23
+ };
16
24
  }
17
25
  export interface RuleConfig {
18
26
  name: string;
@@ -40,6 +48,7 @@ export interface CreateSkillsConfigDefinitionOptions {
40
48
  workspacePath?: string;
41
49
  includePluginSkills?: boolean;
42
50
  pluginSkillDirectories?: ReadonlyArray<string>;
51
+ agentPluginSkills?: ReadonlyArray<AgentPluginPackageSkill>;
43
52
  pluginPaths?: ReadonlyArray<string>;
44
53
  cwd?: string;
45
54
  }
@@ -10,6 +10,7 @@ type SkillsExecutorMetadataItem = {
10
10
  type ConfiguredSkill = SkillsExecutorMetadataItem & {
11
11
  skill: SkillConfig;
12
12
  };
13
+ export declare function formatSkillInvocation(skill: Pick<SkillConfig, "name" | "description" | "instructions" | "source">, args?: string): string;
13
14
  export interface CreateUserInstructionPluginOptions {
14
15
  watcher: UserInstructionConfigWatcher;
15
16
  watcherReady?: Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import type { AgentExtension } from "@cline/shared";
2
- import type { SkillsExecutorWithMetadata } from "../tools";
2
+ import { type SkillsExecutorWithMetadata } from "../tools";
3
3
  import { type AvailableRuntimeCommand, type ResolveRuntimeSlashCommandOptions } from "./runtime-commands";
4
4
  import { type CreateUserInstructionConfigWatcherOptions, type UserInstructionConfig, type UserInstructionConfigType } from "./user-instruction-config-loader";
5
5
  import { type CreateUserInstructionPluginOptions } from "./user-instruction-plugin";
@@ -22,4 +22,10 @@ export interface UserInstructionConfigService {
22
22
  createSkillsExecutor?(allowedSkillNames?: ReadonlyArray<string>): SkillsExecutorWithMetadata;
23
23
  createExtension(options: Omit<CreateUserInstructionPluginOptions, "watcher" | "watcherReady">): AgentExtension;
24
24
  }
25
+ /**
26
+ * Present multiple instruction sources as one extension/tool surface. This is
27
+ * used by the hub to overlay host-local Agent Plugin skills on a client-owned
28
+ * instruction snapshot without moving package discovery into each client.
29
+ */
30
+ export declare function combineUserInstructionConfigServices(services: ReadonlyArray<UserInstructionConfigService>): UserInstructionConfigService;
25
31
  export declare function createUserInstructionConfigService(options?: CreateUserInstructionConfigServiceOptions): UserInstructionConfigService;
@@ -45,6 +45,26 @@ export interface ContextCompactionPrepareTurnOptions {
45
45
  * plugin/hook pipelines must be instrumented separately.
46
46
  */
47
47
  export declare function createContextCompactionPrepareTurn(config: Pick<CoreSessionConfig, "providerConfig" | "providerId" | "modelId" | "compaction" | "logger" | "telemetry" | "sessionId">, options?: ContextCompactionPrepareTurnOptions): ((context: ContextPipelinePrepareTurnInput) => Promise<ContextPipelinePrepareTurnResult | undefined>) | undefined;
48
+ /**
49
+ * Compaction policy for resuming a session imported from another coding agent.
50
+ * The imported transcript keeps that agent's tool names and input schemas
51
+ * verbatim, which a model continuing it may try to call, so the first turn
52
+ * folds the whole foreign history into a summary before the model request
53
+ * (manual mode, agentic strategy, nothing preserved but the new prompt).
54
+ * Runs regardless of the session's auto-compaction setting, tags its status
55
+ * notices with `importedFrom` so clients can label the wait, and on failure
56
+ * falls back to the raw transcript. It makes one attempt per session start
57
+ * (an aborted attempt does not count) and stands down once the working
58
+ * context already opens with a compaction summary, which is how a resumed
59
+ * sidecar presents; every other turn defers to `next`, the session's normal
60
+ * compaction (if any).
61
+ */
62
+ export declare function createImportedHistoryCompactionPrepareTurn(input: {
63
+ config: Parameters<typeof createContextCompactionPrepareTurn>[0];
64
+ /** Source tool id from the session's `importedFrom` metadata. */
65
+ importedFrom: string;
66
+ next?: ContextPipelinePrepareTurn;
67
+ }): ContextPipelinePrepareTurn;
48
68
  export declare function createCompactionStateAwarePrepareTurn(input: {
49
69
  compact?: ContextPipelinePrepareTurn;
50
70
  getState?: () => SessionCompactionState | undefined;
@@ -1,3 +1,5 @@
1
+ export type { AgentPluginPackageDiagnostic, AgentPluginPackageDiagnosticScope, AgentPluginPackageLoadReport, AgentPluginPackageManifest, AgentPluginPackageMcpServer, AgentPluginPackageSkill, AgentSkillMetadata, LoadAgentPluginPackagesOptions, LoadedAgentPluginPackage, ParsedAgentSkill, } from "./agent-plugin";
2
+ export { AGENT_PLUGINS_V1_MANIFEST_SCHEMA, AGENT_PLUGINS_V1_MCP_SCHEMA, loadAgentPluginPackages, parseAgentSkillMarkdown, } from "./agent-plugin";
1
3
  export type { ResolveAgentPluginPathsOptions } from "./plugin/plugin-config-loader";
2
4
  export { discoverPluginModulePaths, getPluginDisplayName, resolveAgentPluginPaths, resolveAndLoadAgentPlugins, resolvePluginConfigSearchPaths, resolvePluginSkillDirectoriesFromPaths, } from "./plugin/plugin-config-loader";
3
5
  export type { PluginInitializationFailure, PluginInitializationWarning, PluginLoadDiagnostics, } from "./plugin/plugin-load-report";
@@ -7,6 +7,8 @@ export interface DefaultMcpServerClientFactoryOptions {
7
7
  clientName?: string;
8
8
  clientVersion?: string;
9
9
  fetch?: FetchLike;
10
+ /** Keep literal configured headers on the declared MCP origin only. */
11
+ restrictConfiguredHeadersToOrigin?: boolean;
10
12
  }
11
13
  export interface ProbeMcpServerConnectionOptions extends Omit<DefaultMcpServerClientFactoryOptions, "settingsPath"> {
12
14
  serverName: string;
@@ -6,6 +6,11 @@ import type { FetchLike } from "@modelcontextprotocol/sdk/shared/transport.js";
6
6
  import { type OAuthServerCloseInfo, type OAuthServerListeningInfo } from "../../auth/server";
7
7
  import type { McpServerOAuthClientConfig, McpServerRegistration } from "./types";
8
8
  export type McpSdkAuthCapableTransport = SSEClientTransport | StreamableHTTPClientTransport;
9
+ export declare function createOriginBoundMcpHeadersFetch(input: {
10
+ endpointUrl: string;
11
+ configuredHeaders: Record<string, string>;
12
+ baseFetch?: FetchLike;
13
+ }): FetchLike;
9
14
  export interface CreateMcpOAuthProviderContextOptions {
10
15
  settingsPath?: string;
11
16
  serverName: string;
@@ -50,6 +55,7 @@ export declare function createMcpSdkTransport(input: {
50
55
  registration: McpServerRegistration;
51
56
  oauthProvider?: OAuthClientProvider;
52
57
  fetch?: FetchLike;
58
+ restrictConfiguredHeadersToOrigin?: boolean;
53
59
  }): McpSdkAuthCapableTransport;
54
60
  /**
55
61
  * Recognizes a 401 from a remote MCP server across transports. The streamable
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Factory functions for creating the default tools.
5
5
  */
6
- import { type AgentTool, type ShellKind } from "@cline/shared";
6
+ import { type AgentTool } 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
  /**
@@ -20,11 +20,11 @@ export declare function createReadFilesTool(executor: FileReadExecutor, config?:
20
20
  export declare function createSearchTool(executor: SearchExecutor, config?: Pick<DefaultToolsConfig, "cwd" | "searchTimeoutMs">): AgentTool<SearchCodebaseInput, ToolOperationResult[]>;
21
21
  /**
22
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).
23
+ * execute the commands. Derive the edition and wrapper guidance from the
24
+ * same executable, without probing a version or adding volatile prompt text.
25
+ * isWindows describes the host, not the shell's edition.
26
26
  */
27
- export declare function buildRunCommandsDescription(shellKind: ShellKind, isWindows: boolean): string;
27
+ export declare function buildRunCommandsDescription(shell: string, isWindows: boolean): string;
28
28
  /**
29
29
  * Create the run_commands shell tool for the current platform.
30
30
  *
@@ -1,5 +1,20 @@
1
- import type { AgentHooks, BasicLogger } from "@cline/shared";
1
+ import type { AgentHooks, BasicLogger, ITelemetryService } from "@cline/shared";
2
2
  export declare function isCheckpointStashMessage(message: string): boolean;
3
+ /**
4
+ * Per-session scratch directory holding the persistent `GIT_INDEX_FILE` used
5
+ * to snapshot untracked files. Persisting the index across turns lets git's
6
+ * stat cache skip re-reading (and re-hashing) untracked files that have not
7
+ * changed since the previous checkpoint — without it, every turn re-hashes
8
+ * every untracked byte in the workspace.
9
+ *
10
+ * Lives under the user's Cline data dir (never the world-shared OS tmpdir:
11
+ * the index and pathspec files enumerate workspace paths) and is keyed by a
12
+ * hash of cwd + session id: hashing avoids sanitization collisions between
13
+ * distinct ids, and folding in cwd keeps a session restored against a
14
+ * different workspace from inheriting a foreign index. Removed by
15
+ * `deleteCheckpointRefs` and by the age-based reaper.
16
+ */
17
+ export declare function checkpointScratchDir(cwd: string, sessionId: string): string;
3
18
  export interface CheckpointEntry {
4
19
  ref: string;
5
20
  createdAt: number;
@@ -26,6 +41,13 @@ type CreateCheckpointHooksOptions = {
26
41
  sessionId: string;
27
42
  runCount: number;
28
43
  }) => Promise<CheckpointEntry | undefined> | CheckpointEntry | undefined;
44
+ /**
45
+ * Emits one `checkpoint.snapshot` event per built-in snapshot attempt so
46
+ * snapshot cost and degradations (HEAD fallbacks, skipped turns) are
47
+ * observable in the field, not only in local logs. Properties carry
48
+ * outcome and duration — never file paths or contents.
49
+ */
50
+ telemetry?: Pick<ITelemetryService, "capture">;
29
51
  };
30
52
  /**
31
53
  * Deletes all private git refs under refs/cline/checkpoints/{sessionId}/ that
@@ -7,7 +7,15 @@ export interface HubClientOptions {
7
7
  displayName?: string;
8
8
  workspaceRoot?: string;
9
9
  cwd?: string;
10
+ /** Hub token sent with the `cline-hub-auth.*` WebSocket subprotocol. */
10
11
  authToken?: string;
12
+ /**
13
+ * Resolves HTTP headers for each new WebSocket, including reconnects.
14
+ * This Node-only transport option is mutually exclusive with `authToken`.
15
+ * Resolver failures are surfaced by `connect()` and `getConnectionError()`;
16
+ * `Sec-WebSocket-Protocol` must be configured through `authToken` instead.
17
+ */
18
+ resolveConnectionHeaders?: () => Readonly<Record<string, string>> | Promise<Readonly<Record<string, string>>>;
11
19
  capabilities?: HubClientRegistration["capabilities"];
12
20
  }
13
21
  export interface LocalHubResolutionOptions {
@@ -57,6 +65,7 @@ export declare class NodeHubClient {
57
65
  private reconnectTimer;
58
66
  private reconnectAttempt;
59
67
  private closedByClient;
68
+ private connectGeneration;
60
69
  private lastCloseError;
61
70
  private sawSocketClose;
62
71
  private registered;
@@ -68,6 +77,7 @@ export declare class NodeHubClient {
68
77
  getConnectionError(): HubTransportError | null;
69
78
  updateCapabilities(capabilities: NonNullable<HubClientRegistration["capabilities"]>): Promise<void>;
70
79
  connect(): Promise<void>;
80
+ private openSocket;
71
81
  subscribe(listener: (event: HubEventEnvelope) => void, options?: {
72
82
  sessionId?: string;
73
83
  }): () => void;