@cline/core 0.0.69 → 0.0.70

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 (32) hide show
  1. package/dist/extensions/config/runtime-commands.d.ts +1 -0
  2. package/dist/extensions/context/compaction.d.ts +8 -0
  3. package/dist/extensions/index.d.ts +1 -1
  4. package/dist/extensions/plugin/plugin-config-loader.d.ts +1 -1
  5. package/dist/extensions/tools/command-guard-extension.d.ts +22 -0
  6. package/dist/extensions/tools/command-guard.d.ts +29 -0
  7. package/dist/extensions/tools/index.d.ts +1 -0
  8. package/dist/extensions/tools/presets.d.ts +4 -2
  9. package/dist/hub/client/session-client.d.ts +2 -0
  10. package/dist/hub/daemon/entry.js +180 -177
  11. package/dist/hub/index.js +171 -168
  12. package/dist/hub/server/handlers/connector-handlers.d.ts +8 -0
  13. package/dist/index.d.ts +6 -3
  14. package/dist/index.js +176 -173
  15. package/dist/runtime/host/local/agent-event-bridge.d.ts +11 -0
  16. package/dist/runtime/host/runtime-host.d.ts +17 -0
  17. package/dist/runtime/orchestration/session-runtime-orchestrator.d.ts +15 -0
  18. package/dist/services/connectors/connector-child-env.d.ts +14 -0
  19. package/dist/services/connectors/connector-cleanup.d.ts +20 -0
  20. package/dist/services/connectors/connector-supervisor.d.ts +134 -0
  21. package/dist/services/connectors/daemon-connector-reconnect.d.ts +12 -27
  22. package/dist/services/global-settings.d.ts +9 -0
  23. package/dist/services/llms/apihandler-agent-model-adapter.d.ts +1 -1
  24. package/dist/services/providers/local-provider-registry.d.ts +2 -6
  25. package/dist/services/session-data.d.ts +11 -1
  26. package/dist/services/telemetry/core-events.d.ts +19 -1
  27. package/dist/services/telemetry/index.js +1 -1
  28. package/dist/session/history-origin.d.ts +19 -0
  29. package/dist/session/models/session-row.d.ts +4 -0
  30. package/dist/session/stores/session-manifest-store.d.ts +10 -2
  31. package/dist/types/config.d.ts +7 -1
  32. package/package.json +4 -4
@@ -7,5 +7,6 @@ export type AvailableRuntimeCommand = {
7
7
  description?: string;
8
8
  kind: RuntimeCommandKind;
9
9
  };
10
+ export declare function normalizeRuntimeCommandName(name: string): string;
10
11
  export declare function listAvailableRuntimeCommandsFromWatcher(watcher: UserInstructionConfigWatcher): AvailableRuntimeCommand[];
11
12
  export declare function resolveRuntimeSlashCommandFromWatcher(input: string, watcher: UserInstructionConfigWatcher): string;
@@ -11,6 +11,14 @@ export interface ContextPipelinePrepareTurnInput {
11
11
  systemPrompt: string;
12
12
  tools: unknown[];
13
13
  model: CoreCompactionContext["model"];
14
+ /**
15
+ * Set by the runtime when the provider rejected the previous request as
16
+ * exceeding the model's context window. Forces a compaction regardless of
17
+ * the token-estimate trigger (the estimate just proved wrong) and uses the
18
+ * deterministic basic strategy — recovery must not depend on another
19
+ * successful LLM request.
20
+ */
21
+ overflowRecovery?: boolean;
14
22
  emitStatusNotice?: (message: string, metadata?: Record<string, unknown>) => void;
15
23
  }
16
24
  export interface ContextPipelinePrepareTurnResult {
@@ -1,5 +1,5 @@
1
1
  export type { ResolveAgentPluginPathsOptions } from "./plugin/plugin-config-loader";
2
- export { discoverPluginModulePaths, resolveAgentPluginPaths, resolveAndLoadAgentPlugins, resolvePluginConfigSearchPaths, resolvePluginSkillDirectoriesFromPaths, } from "./plugin/plugin-config-loader";
2
+ export { discoverPluginModulePaths, getPluginDisplayName, resolveAgentPluginPaths, resolveAndLoadAgentPlugins, resolvePluginConfigSearchPaths, resolvePluginSkillDirectoriesFromPaths, } from "./plugin/plugin-config-loader";
3
3
  export type { PluginInitializationFailure, PluginInitializationWarning, PluginLoadDiagnostics, } from "./plugin/plugin-load-report";
4
4
  export type { LoadAgentPluginFromPathOptions } from "./plugin/plugin-loader";
5
5
  export { loadAgentPluginFromPath, loadAgentPluginsFromPaths, loadAgentPluginsFromPathsWithDiagnostics, } from "./plugin/plugin-loader";
@@ -1,6 +1,7 @@
1
1
  import type { AgentConfig, PluginSetupContext, WorkspaceInfo } from "@cline/shared";
2
2
  import type { PluginLoadDiagnostics } from "./plugin-load-report";
3
3
  import type { PluginTargeting } from "./plugin-targeting";
4
+ export { getPluginDisplayName } from "@cline/shared/storage";
4
5
  type AgentPlugin = NonNullable<AgentConfig["extensions"]>[number];
5
6
  export declare function resolvePluginConfigSearchPaths(workspacePath?: string): string[];
6
7
  export declare function discoverPluginModulePaths(directoryPath: string): string[];
@@ -40,4 +41,3 @@ export declare function resolveAndLoadAgentPlugins(options?: ResolveAndLoadAgent
40
41
  pluginPaths: string[];
41
42
  shutdown?: () => Promise<void>;
42
43
  } & PluginLoadDiagnostics>;
43
- export {};
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Plan-Mode Command Guard Extension
3
+ *
4
+ * Runtime extension that enforces the plan-mode command blacklist
5
+ * (./command-guard.ts) as a `beforeTool` hook. The runtime builder registers
6
+ * it for plan-mode sessions, making command blocking session policy in one
7
+ * shared place: the hook fires for every `run_commands` tool in the runtime —
8
+ * the SDK built-in and host-provided replacements like the VS Code
9
+ * extension's terminal-backed tool — without threading a flag through each
10
+ * layer.
11
+ *
12
+ * Because `beforeTool` hooks run before tool policies and user approval,
13
+ * a blocked call is rejected up front: the user is never asked to approve a
14
+ * command that would only fail, and the model receives the plan-mode error
15
+ * as the tool result (`skip`, not `stop`, so the run continues).
16
+ */
17
+ import type { AgentExtension, ITelemetryService } from "@cline/shared";
18
+ export declare const PLAN_MODE_COMMAND_GUARD_EXTENSION_NAME = "core.plan-mode-command-guard";
19
+ export interface PlanModeCommandGuardOptions {
20
+ telemetry?: ITelemetryService;
21
+ }
22
+ export declare function createPlanModeCommandGuardExtension(options?: PlanModeCommandGuardOptions): AgentExtension;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Plan-mode command blacklist for run_commands.
3
+ *
4
+ * Plan mode keeps run_commands available for read-only investigation, but
5
+ * models (especially weaker ones) use it to edit files anyway. When the plan
6
+ * preset sets `blockFileEditingCommands`, createShellTool checks each command
7
+ * against this blacklist before executing and returns a tool error instead of
8
+ * running anything that looks like a file modification.
9
+ *
10
+ * This is a simple blacklist, not a shell interpreter. Commands are lightly
11
+ * preprocessed (quoted text, heredoc bodies, escapes, and comments are masked
12
+ * so they cannot false-positive), split on shell separators, and the leading
13
+ * command word of each part is compared against the lists below; output
14
+ * redirection to files is also rejected. It will not catch every possible
15
+ * mutation (e.g. `python -c "open(..., 'w')"` or commands hidden inside a
16
+ * quoted `bash -c` string) — it exists to stop the common ways models edit
17
+ * files from the shell, and entries are easy to add.
18
+ */
19
+ import type { StructuredCommandInput } from "./schemas";
20
+ /**
21
+ * Inspect a run_commands entry and return a short description of the first
22
+ * file-modifying construct found, or undefined when the command looks
23
+ * read-only.
24
+ */
25
+ export declare function findFileEditingCommand(command: string | StructuredCommandInput): string | undefined;
26
+ /**
27
+ * Tool error returned in place of executing a blocked command in plan mode.
28
+ */
29
+ export declare function formatPlanModeBlockedCommandError(reason: string): string;
@@ -4,6 +4,7 @@
4
4
  * This module provides a set of configurable default tools for agents.
5
5
  */
6
6
  export { validateWithZod, zodToJsonSchema } from "@cline/shared";
7
+ export { createPlanModeCommandGuardExtension, PLAN_MODE_COMMAND_GUARD_EXTENSION_NAME, type PlanModeCommandGuardOptions, } from "./command-guard-extension";
7
8
  export { ALL_DEFAULT_TOOL_NAMES, DefaultToolNames } from "./constants";
8
9
  export { createApplyPatchTool, createAskQuestionTool, createDefaultTools, createEditorTool, createReadFilesTool, createSearchTool, createShellTool, createSkillsTool, createSubmitAndExitTool, createWebFetchTool, } from "./definitions";
9
10
  export { type ApplyPatchExecutorOptions, CommandExitError, computePatchChanges, createApplyPatchExecutor, createDefaultExecutors, createDefaultShellExecutor, createEditorExecutor, createFileReadExecutor, createSearchExecutor, createShellExecutor, createWebFetchExecutor, type DefaultExecutorsOptions, type EditorExecutorOptions, type FileReadExecutorOptions, PATCH_MARKERS, PatchActionType, type PatchFileChange, type SearchExecutorOptions, type ShellExecutorOptions, type WebFetchExecutorOptions, } from "./executors/index";
@@ -31,8 +31,10 @@ export declare const ToolPresets: {
31
31
  readonly enableAgentTeams: true;
32
32
  };
33
33
  /**
34
- * Plan mode (read-only, no shell access)
35
- * Good for analysis and documentation agents
34
+ * Plan mode (read-only)
35
+ * Good for analysis and documentation agents. Shell access stays enabled
36
+ * for read-only investigation; file-editing commands are hard-blocked by
37
+ * the plan-mode command-guard hook the runtime builder registers.
36
38
  */
37
39
  readonly plan: {
38
40
  readonly enableReadFiles: true;
@@ -17,6 +17,8 @@ export interface HubSessionClientOptions {
17
17
  export interface HubSessionRow {
18
18
  sessionId: string;
19
19
  parentSessionId?: string;
20
+ /** Hub runtime status when the server provided one. */
21
+ status?: string;
20
22
  metadata?: Record<string, unknown>;
21
23
  messagesPath?: string;
22
24
  }