@cline/core 0.0.60 → 0.0.61

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.
@@ -120,6 +120,7 @@ export declare class LocalRuntimeHost implements RuntimeHost {
120
120
  private prepareTurnInput;
121
121
  private ensureSessionPersisted;
122
122
  private markTurnRunning;
123
+ private refreshActiveSessionGitMetadata;
123
124
  private markTurnPending;
124
125
  private markTurnIdle;
125
126
  private persistSessionMetadata;
@@ -41,6 +41,10 @@ export declare const AuthSettingsSchema: z.ZodObject<{
41
41
  refreshToken: z.ZodOptional<z.ZodString>;
42
42
  expiresAt: z.ZodOptional<z.ZodNumber>;
43
43
  accountId: z.ZodOptional<z.ZodString>;
44
+ organizationId: z.ZodOptional<z.ZodString>;
45
+ organizationName: z.ZodOptional<z.ZodString>;
46
+ memberId: z.ZodOptional<z.ZodString>;
47
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
44
48
  }, z.core.$strip>;
45
49
  export type AuthSettings = z.infer<typeof AuthSettingsSchema>;
46
50
  export declare const ReasoningSettingsSchema: z.ZodObject<{
@@ -124,6 +128,10 @@ export declare const ProviderSettingsSchema: z.ZodObject<{
124
128
  refreshToken: z.ZodOptional<z.ZodString>;
125
129
  expiresAt: z.ZodOptional<z.ZodNumber>;
126
130
  accountId: z.ZodOptional<z.ZodString>;
131
+ organizationId: z.ZodOptional<z.ZodString>;
132
+ organizationName: z.ZodOptional<z.ZodString>;
133
+ memberId: z.ZodOptional<z.ZodString>;
134
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
127
135
  }, z.core.$strip>>;
128
136
  model: z.ZodOptional<z.ZodString>;
129
137
  protocol: z.ZodOptional<z.ZodEnum<{
@@ -6,6 +6,7 @@ import type { RuntimeBuilderInput } from "../runtime/orchestration/session-runti
6
6
  import type { CoreSessionConfig } from "../types/config";
7
7
  import { type ProviderConfig } from "../types/provider-settings";
8
8
  import type { ProviderSettingsManager } from "./storage/provider-settings-manager";
9
+ import type { GitWorkspaceState } from "./workspace/workspace-manifest";
9
10
  export interface PrepareLocalRuntimeBootstrapOptions {
10
11
  input: StartSessionInput;
11
12
  localRuntime?: LocalRuntimeStartOptions;
@@ -40,6 +41,7 @@ export interface LocalRuntimeBootstrap {
40
41
  workspaceMetadata: string;
41
42
  /** Structured git + path metadata generated alongside workspaceMetadata. */
42
43
  workspaceInfo: WorkspaceInfo;
44
+ gitState: GitWorkspaceState;
43
45
  extensions: AgentConfig["extensions"];
44
46
  hooks: AgentHooks | undefined;
45
47
  toolPolicies: AgentConfig["toolPolicies"];
@@ -274,7 +274,7 @@ export type TelemetryCompactionStrategy = "basic" | "agentic" | "custom";
274
274
  * Trigger mode for a compaction attempt.
275
275
  *
276
276
  * - `auto` — fired automatically by `createContextCompactionPrepareTurn`
277
- * when input tokens exceed the configured threshold.
277
+ * when input tokens reach the fixed compaction threshold.
278
278
  * - `manual` — user-initiated (e.g. CLI `/compact`).
279
279
  */
280
280
  export type TelemetryCompactionMode = "auto" | "manual";
@@ -285,6 +285,7 @@ export interface CaptureCompactionExecutedProperties {
285
285
  messagesBefore: number;
286
286
  messagesAfter: number;
287
287
  messagesRemoved: number;
288
+ /** Full-request token estimates, in the same units as the trigger and limit. */
288
289
  tokensBefore: number;
289
290
  tokensAfter: number;
290
291
  tokensSaved: number;
@@ -310,6 +311,7 @@ export interface CaptureCompactionSkippedProperties {
310
311
  * be introduced without changing the schema.
311
312
  */
312
313
  reason: string;
314
+ /** Full-request token estimate, in the same units as the trigger and limit. */
313
315
  tokensBefore: number;
314
316
  triggerTokens: number;
315
317
  maxInputTokens: number;
@@ -2,6 +2,7 @@ import type { WorkspaceInfo } from "@cline/shared";
2
2
  export interface WorkspaceInfoDiagnostics {
3
3
  info: WorkspaceInfo;
4
4
  vcsType: "git" | "none";
5
+ gitState: GitWorkspaceState;
5
6
  error?: {
6
7
  errorType: string;
7
8
  message: string;
@@ -12,14 +13,24 @@ export interface BuiltWorkspaceMetadata {
12
13
  workspaceMetadata: string;
13
14
  durationMs: number;
14
15
  vcsType: "git" | "none";
16
+ gitState: GitWorkspaceState;
15
17
  initError?: {
16
18
  errorType: string;
17
19
  message: string;
18
20
  };
19
21
  }
22
+ export interface GitWorkspaceState {
23
+ url?: string;
24
+ branch?: string;
25
+ }
26
+ export declare function readSessionGitMetadata(metadata: Record<string, unknown> | undefined): GitWorkspaceState;
27
+ export declare function withSessionGitMetadata(metadata: Record<string, unknown> | undefined, state: GitWorkspaceState): Record<string, unknown> | undefined;
28
+ export declare function hasCurrentSessionGitMetadata(metadata: Record<string, unknown> | undefined, state: GitWorkspaceState): boolean;
20
29
  export declare function normalizeWorkspacePath(workspacePath: string): string;
21
30
  export declare function generateWorkspaceInfo(workspacePath: string): Promise<WorkspaceInfo>;
22
31
  export declare function generateWorkspaceInfoWithDiagnostics(workspacePath: string): Promise<WorkspaceInfoDiagnostics>;
32
+ /** Read the mutable git identity persisted with an active session. */
33
+ export declare function readGitWorkspaceState(workspacePath: string): Promise<GitWorkspaceState | undefined>;
23
34
  export declare function buildWorkspaceMetadata(cwd: string): Promise<string>;
24
35
  /**
25
36
  * Generate workspace metadata as both a structured `WorkspaceInfo` object and
@@ -36,6 +36,31 @@ export interface CoreRuntimeFeatures {
36
36
  disableMcpSettingsTools?: boolean;
37
37
  yolo?: boolean;
38
38
  }
39
+ export type CoreCompactionMode = "auto" | "manual";
40
+ export interface CoreCompactionBudget {
41
+ request: {
42
+ /** Estimated tokens for the full provider request. */
43
+ inputTokens: number;
44
+ /** Effective provider input limit. */
45
+ maxInputTokens: number;
46
+ /** Full-request token count that triggers automatic compaction. */
47
+ triggerTokens: number;
48
+ /** Full-request token count the strategy output should fit within. */
49
+ targetTokens: number;
50
+ /** Fixed system-prompt, tool-definition, and request framing cost. */
51
+ overheadTokens: number;
52
+ thresholdRatio: number;
53
+ utilizationRatio: number;
54
+ };
55
+ messages: {
56
+ /** Estimated tokens in the compactable message transcript. */
57
+ inputTokens: number;
58
+ /** Message budget corresponding to the full-request trigger. */
59
+ triggerTokens: number;
60
+ /** Message budget the strategy should compact toward. */
61
+ targetTokens: number;
62
+ };
63
+ }
39
64
  export interface CoreCompactionContext {
40
65
  agentId: string;
41
66
  conversationId: string;
@@ -47,11 +72,8 @@ export interface CoreCompactionContext {
47
72
  provider: string;
48
73
  info?: ModelInfo;
49
74
  };
50
- maxInputTokens: number;
51
- triggerTokens: number;
52
- targetTokens?: number;
53
- thresholdRatio: number;
54
- utilizationRatio: number;
75
+ mode: CoreCompactionMode;
76
+ budget: CoreCompactionBudget;
55
77
  }
56
78
  export type CoreCompactionBudgetPolicyIntent = "agentic_summary" | "basic_compaction_projection" | "normal_provider_request";
57
79
  export type CoreCompactionLiveTailHandling = "included_verbatim" | "included_degraded" | "summarized_as_context" | "omitted_with_warning" | "preserved_out_of_band";
@@ -86,10 +108,7 @@ export type CoreCompactionStrategy = "basic" | "agentic";
86
108
  export interface CoreCompactionConfig {
87
109
  enabled?: boolean;
88
110
  strategy?: CoreCompactionStrategy;
89
- thresholdRatio?: number;
90
- reserveTokens?: number;
91
111
  preserveRecentTokens?: number;
92
- maxInputTokens?: number;
93
112
  summarizer?: CoreCompactionSummarizerConfig;
94
113
  compact?: (context: CoreCompactionContext) => Promise<CoreCompactionResult | undefined> | CoreCompactionResult | undefined;
95
114
  }
@@ -16,6 +16,10 @@ export interface SessionRecord extends SessionRef, Omit<SessionRuntimeRecordShap
16
16
  }
17
17
  export interface SessionHistoryMetadata extends Record<string, unknown> {
18
18
  title?: string;
19
+ git?: {
20
+ url?: string;
21
+ branch?: string;
22
+ };
19
23
  totalCost?: number;
20
24
  aggregatedAgentsCost?: number;
21
25
  usage?: SessionUsageMetadata;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cline/core",
3
3
  "description": "Cline Core SDK for Node Runtime",
4
- "version": "0.0.60",
4
+ "version": "0.0.61",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/cline/cline",
@@ -48,9 +48,9 @@
48
48
  "test:watch": "vitest --config vitest.config.ts"
49
49
  },
50
50
  "dependencies": {
51
- "@cline/agents": "0.0.60",
52
- "@cline/shared": "0.0.60",
53
- "@cline/llms": "0.0.60",
51
+ "@cline/agents": "0.0.61",
52
+ "@cline/shared": "0.0.61",
53
+ "@cline/llms": "0.0.61",
54
54
  "@modelcontextprotocol/sdk": "^1.29.0",
55
55
  "@opentelemetry/api": "^1.9.0",
56
56
  "@opentelemetry/api-logs": "^0.214.0",