@cline/core 0.0.73 → 0.0.74

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.
@@ -31,4 +31,29 @@ export declare function extractAgentEventMetadata(event: AgentEvent): {
31
31
  parentAgentId?: string;
32
32
  };
33
33
  export declare function buildTelemetryAgentIdentity(context: AgentTelemetryContextOverrides): TelemetryAgentIdentityProperties | undefined;
34
+ /**
35
+ * `task.tokens` telemetry contract (inherited from the legacy extension):
36
+ * one event per completed model request, carrying that request's token/cost
37
+ * deltas as DISJOINT buckets — `tokensIn` is uncached input only, with cache
38
+ * reads/writes reported in their own attributes, so
39
+ * `sum(tokensIn + cacheReadTokens + cacheWriteTokens)` equals total input.
40
+ *
41
+ * SDK usage events follow the AI SDK convention instead: `event.inputTokens`
42
+ * is the FULL request input, cache reads/writes included. Emitting it as
43
+ * `tokensIn` unchanged re-reports the whole (mostly cached) conversation
44
+ * context on every request, so per-task sums re-count the same context
45
+ * tokens once per request. This helper translates to the legacy disjoint
46
+ * buckets (mirroring the webview's `normalizeUsageEvent`). The clamp keeps
47
+ * ApiHandler-backed providers — whose `inputTokens` is already uncached-only
48
+ * — from going negative.
49
+ */
50
+ export declare function legacyTokenUsageFromUsageEvent(event: Extract<AgentEvent, {
51
+ type: "usage";
52
+ }>): {
53
+ tokensIn: number;
54
+ tokensOut: number;
55
+ cacheWriteTokens: number;
56
+ cacheReadTokens: number;
57
+ totalCost?: number;
58
+ };
34
59
  export declare function handleAgentEvent(ctx: AgentEventContext, event: AgentEvent, overrides?: AgentTelemetryContextOverrides): void;
@@ -220,11 +220,14 @@ export declare function captureConversationTurnEvent(telemetry: ITelemetryServic
220
220
  } & Partial<TelemetryAgentIdentityProperties>): void;
221
221
  export declare function captureTokenUsage(telemetry: ITelemetryService | undefined, properties: {
222
222
  ulid: string;
223
+ /** Uncached input tokens only — disjoint from the cache buckets. */
223
224
  tokensIn: number;
224
225
  tokensOut: number;
225
226
  cacheWriteTokens?: number;
226
227
  cacheReadTokens?: number;
228
+ /** This request's cost delta, not a running total. */
227
229
  totalCost?: number;
230
+ provider?: string;
228
231
  model: string;
229
232
  } & Partial<TelemetryAgentIdentityProperties>): void;
230
233
  export declare function captureModeSwitch(telemetry: ITelemetryService | undefined, ulid: string, mode?: string): void;
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.73",
4
+ "version": "0.0.74",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/cline/cline",
@@ -49,9 +49,9 @@
49
49
  "test:watch": "vitest --config vitest.config.ts"
50
50
  },
51
51
  "dependencies": {
52
- "@cline/agents": "0.0.73",
53
- "@cline/shared": "0.0.73",
54
- "@cline/llms": "0.0.73",
52
+ "@cline/agents": "0.0.74",
53
+ "@cline/shared": "0.0.74",
54
+ "@cline/llms": "0.0.74",
55
55
  "@modelcontextprotocol/sdk": "^1.29.0",
56
56
  "@opentelemetry/api": "^1.9.0",
57
57
  "@opentelemetry/api-logs": "^0.214.0",
@@ -1,13 +0,0 @@
1
- /**
2
- * Kept below the daemon retirement wait. A normal graceful shutdown should
3
- * finish first; if Bun leaves node:http's close callback pending after a
4
- * WebSocket upgrade, the daemon must still release its process promptly.
5
- */
6
- export declare const HUB_DAEMON_SHUTDOWN_DEADLINE_MS = 2000;
7
- export interface HubDaemonShutdownWatchdogOptions {
8
- deadlineMs: number;
9
- exitCode: number;
10
- onTimeout?: () => void;
11
- exit?: (code: number) => void;
12
- }
13
- export declare function armHubDaemonShutdownWatchdog(options: HubDaemonShutdownWatchdogOptions): void;