@cline/core 0.0.65 → 0.0.66

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/README.md +12 -0
  2. package/dist/cline-core/types.d.ts +5 -3
  3. package/dist/cron/service/schedule-service.d.ts +2 -1
  4. package/dist/cron/store/sqlite-cron-store.d.ts +5 -2
  5. package/dist/extensions/context/basic-compaction.d.ts +10 -1
  6. package/dist/extensions/context/compaction-shared.d.ts +20 -0
  7. package/dist/hub/client/index.d.ts +2 -0
  8. package/dist/hub/daemon/entry.d.ts +5 -1
  9. package/dist/hub/daemon/entry.js +261 -216
  10. package/dist/hub/index.js +255 -212
  11. package/dist/hub/server/handlers/connector-handlers.d.ts +0 -2
  12. package/dist/hub/server/hub-server-options.d.ts +6 -1
  13. package/dist/index.d.ts +10 -7
  14. package/dist/index.js +256 -213
  15. package/dist/runtime/host/local-runtime-host.d.ts +4 -1
  16. package/dist/runtime/host/runtime-host.d.ts +11 -3
  17. package/dist/services/connectors/active-connectors.d.ts +2 -0
  18. package/dist/services/connectors/connector-autostart.d.ts +33 -0
  19. package/dist/services/connectors/daemon-connector-reconnect.d.ts +30 -0
  20. package/dist/services/global-settings.d.ts +33 -0
  21. package/dist/services/llms/provider-settings.d.ts +1 -1
  22. package/dist/services/llms/runtime-registry.d.ts +1 -1
  23. package/dist/services/local-runtime-bootstrap.d.ts +5 -4
  24. package/dist/services/storage/sqlite-session-store.d.ts +5 -0
  25. package/dist/services/telemetry/OpenTelemetryProvider.d.ts +16 -0
  26. package/dist/services/telemetry/core-events.d.ts +20 -4
  27. package/dist/services/telemetry/index.js +1 -1
  28. package/dist/services/workspace/chat-workspace.d.ts +9 -0
  29. package/dist/types/chat-schema.d.ts +31 -0
  30. package/dist/types/config.d.ts +8 -0
  31. package/dist/types.d.ts +2 -2
  32. package/package.json +5 -4
package/README.md CHANGED
@@ -51,6 +51,15 @@ console.log(result.result?.text);
51
51
  await cline.dispose();
52
52
  ```
53
53
 
54
+ When both `cwd` and `workspaceRoot` are omitted, the execution host places
55
+ the session in the shared chat workspace at
56
+ `<cline-data-dir>/workspaces/chat` (by default
57
+ `~/.cline/data/workspaces/chat`), seeded with an `AGENTS.md` rules file that
58
+ tells the agent to treat the session as a chat and only create a named
59
+ project folder when the user asks for one.
60
+ Read the resolved paths from `result.manifest.cwd` and
61
+ `result.manifest.workspace_root`.
62
+
54
63
  ## Session Bootstrap
55
64
 
56
65
  `ClineCore.create(...)` also accepts `prepare(input)`.
@@ -60,6 +69,9 @@ session starts, then apply watcher/extensions/telemetry inputs through
60
69
  explicit `localRuntime` bootstrap fields without widening the shared host
61
70
  contract.
62
71
 
72
+ Preparation runs before the execution host resolves an omitted workspace, so
73
+ pathless starts expose neither `cwd` nor `workspaceRoot` to `prepare(input)`.
74
+
63
75
  ## Main APIs
64
76
 
65
77
  ### Runtime and Sessions
@@ -3,13 +3,13 @@ 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";
7
6
  import type { RuntimeCapabilities } from "../runtime/capabilities";
8
7
  import type { SessionHistoryListOptions } from "../runtime/host/history";
9
8
  import type { SessionBackend } from "../runtime/host/host";
10
9
  import type { LocalRuntimeStartOptions, RuntimeHostMode, StartSessionInput, StartSessionResult } from "../runtime/host/runtime-host";
11
10
  import type { FeatureFlagsService } from "../services/feature-flags";
12
- import type { CoreSessionConfig } from "../types/config";
11
+ import type { CheckpointWorkspaceCompareResult } from "../session/checkpoint-diff";
12
+ import type { ClineCoreStartConfig } from "../types/config";
13
13
  import type { SessionMessagesArtifactUploader } from "../types/session";
14
14
  export type { RuntimeHostMode } from "../runtime/host/runtime-host";
15
15
  export type { ClineCoreSettingsApi } from "../settings";
@@ -87,7 +87,7 @@ export interface ClineCoreAutomationApi {
87
87
  }
88
88
  export type ClineCoreListHistoryOptions = SessionHistoryListOptions;
89
89
  export interface ClineCoreStartInput extends Omit<StartSessionInput, "config" | "localRuntime"> {
90
- config: CoreSessionConfig;
90
+ config: ClineCoreStartConfig;
91
91
  localRuntime?: LocalRuntimeStartOptions;
92
92
  }
93
93
  export interface RestoreOptions {
@@ -225,6 +225,8 @@ export interface ClineCoreOptions {
225
225
  * Optional hook invoked before each session starts.
226
226
  * Use this to prepare workspace-scoped runtime state and then return an
227
227
  * adapter that mutates the shared session input before core starts the run.
228
+ * This runs before the execution host resolves an omitted workspace, so
229
+ * pathless starts expose neither `cwd` nor `workspaceRoot` to this hook.
228
230
  */
229
231
  prepare?: (input: ClineCoreStartInput) => Promise<StartSessionBootstrap | undefined> | StartSessionBootstrap | undefined;
230
232
  }
@@ -1,4 +1,4 @@
1
- import type { BasicLogger, ChatRunTurnRequest, ChatStartSessionArtifacts, ChatStartSessionRequest, HubScheduleCreateInput, HubScheduleUpdateInput, ScheduleExecutionRecord, ScheduleExecutionStatus, ScheduleRecord } from "@cline/shared";
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 { AutomationEventEnvelope, CronSpec, CronSpecExtensionKind, CronTriggerKind, HubScheduleCreateInput, HubScheduleUpdateInput } from "@cline/shared";
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
- hasOneOffRunForRevision(specId: string, revision: number): boolean;
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 { type BasicLogger } from "@cline/shared";
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: {
@@ -54,6 +54,8 @@ export declare class NodeHubClient {
54
54
  constructor(options: HubClientOptions);
55
55
  getClientId(): string;
56
56
  getUrl(): string;
57
+ isConnected(): boolean;
58
+ getConnectionError(): HubTransportError | null;
57
59
  connect(): Promise<void>;
58
60
  subscribe(listener: (event: HubEventEnvelope) => void, options?: {
59
61
  sessionId?: string;
@@ -1 +1,5 @@
1
- export {};
1
+ /**
2
+ * Resolves only after the daemon WebSocket server is listening and its process
3
+ * lifecycle handlers are installed.
4
+ */
5
+ export declare const hubDaemonReady: Promise<void>;