@cline/shared 0.0.92 → 0.0.93-nightly.1792117748

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.
@@ -6,11 +6,34 @@
6
6
  */
7
7
  export declare const CHARS_PER_TOKEN = 3;
8
8
  export declare function estimateTokens(chars: number): number;
9
+ /**
10
+ * Flat per-image token cost used in place of the char-based estimate for an
11
+ * image block's base64 payload. Real vision-model costs depend on pixel
12
+ * dimensions, not encoded byte size, and top out around ~1.6k tokens even
13
+ * for a large image; this sits comfortably above typical per-image cost
14
+ * without scaling with the base64 string length.
15
+ */
16
+ export declare const ESTIMATED_TOKENS_PER_IMAGE = 1600;
9
17
  export interface TokenEstimatedRequest {
10
18
  systemPrompt?: string;
11
19
  messages: readonly unknown[];
12
20
  tools?: readonly unknown[];
13
21
  }
22
+ /**
23
+ * Build a JSON.stringify replacer that blanks an image node's base64
24
+ * payload wherever it's nested in the serialized value, so it's never
25
+ * billed at CHARS_PER_TOKEN. Two image shapes reach this replacer:
26
+ * `ImageContent { type: "image", data: string }` (compaction's
27
+ * `MessageWithMetadata`) and `AgentImagePart { type: "image", image:
28
+ * string | Uint8Array | ArrayBuffer | URL }` (the gateway's
29
+ * `AgentMessage`). Returns the replacer alongside an `imageCount`
30
+ * accessor so the caller can add a flat per-image token cost back in
31
+ * afterwards.
32
+ */
33
+ export declare function createImageAwareReplacer(): {
34
+ replacer: (key: string, value: unknown) => unknown;
35
+ imageCount: () => number;
36
+ };
14
37
  /**
15
38
  * Estimate the complete provider request payload so request execution and
16
39
  * pre-request policies use the same definition of input utilization.
@@ -1,2 +1,6 @@
1
- /** Canonical default model for the Cline provider. */
2
- export declare const CLINE_DEFAULT_MODEL_ID = "anthropic/claude-sonnet-5";
1
+ /**
2
+ * Fallback default model for the Cline provider. The `cline` provider manifest
3
+ * in `@cline/llms` prefers the first entry of the Cline recommended-models list
4
+ * and falls back to this id when that list is empty.
5
+ */
6
+ export declare const CLINE_DEFAULT_MODEL_ID = "anthropic/claude-sonnet-5.5";