@cline/core 0.0.49 → 0.0.50
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.
- package/dist/hub/daemon/entry.js +158 -146
- package/dist/hub/index.js +145 -133
- package/dist/index.d.ts +1 -0
- package/dist/index.js +149 -137
- package/dist/session/services/message-builder.d.ts +33 -6
- package/package.json +4 -4
|
@@ -9,14 +9,28 @@
|
|
|
9
9
|
* Per-instance caches make this host state.
|
|
10
10
|
*/
|
|
11
11
|
import { type MediaBudgetOptions, type Message } from "@cline/shared";
|
|
12
|
+
export declare const DEFAULT_MAX_TOOL_RESULT_CHARS = 8000;
|
|
13
|
+
export declare const DEFAULT_MAX_FILE_CONTENT_CHARS = 50000;
|
|
14
|
+
export declare const DEFAULT_MAX_TOTAL_TEXT_BYTES = 6000000;
|
|
15
|
+
export declare const DEFAULT_MAX_ASSISTANT_TEXT_CHARS = 200000;
|
|
16
|
+
export declare const DEFAULT_MAX_ASSISTANT_TOOL_MARKUP_CHARS = 12000;
|
|
17
|
+
export declare const MESSAGE_BUILDER_LIMIT_ENV: {
|
|
18
|
+
readonly maxToolResultChars: "CLINE_MESSAGE_BUILDER_MAX_TOOL_RESULT_CHARS";
|
|
19
|
+
readonly maxTotalTextBytes: "CLINE_MESSAGE_BUILDER_MAX_TOTAL_TEXT_BYTES";
|
|
20
|
+
};
|
|
21
|
+
export interface MessageBuilderOptions {
|
|
22
|
+
maxToolResultChars?: number;
|
|
23
|
+
maxFileContentChars?: number;
|
|
24
|
+
maxTotalTextBytes?: number;
|
|
25
|
+
mediaBudget?: MediaBudgetOptions;
|
|
26
|
+
maxAssistantTextChars?: number;
|
|
27
|
+
maxAssistantToolMarkupChars?: number;
|
|
28
|
+
}
|
|
29
|
+
export declare function getMessageBuilderOptionsFromEnv(env?: Record<string, string | undefined>): MessageBuilderOptions;
|
|
12
30
|
/**
|
|
13
31
|
* Builds an API-safe message copy without mutating original conversation history.
|
|
14
32
|
*/
|
|
15
33
|
export declare class MessageBuilder {
|
|
16
|
-
private readonly maxToolResultChars;
|
|
17
|
-
private readonly targetToolNames;
|
|
18
|
-
private readonly maxTotalTextBytes;
|
|
19
|
-
private readonly mediaBudget;
|
|
20
34
|
private indexedMessageCount;
|
|
21
35
|
private indexedTailRef;
|
|
22
36
|
private readonly toolNameByIdCache;
|
|
@@ -24,7 +38,13 @@ export declare class MessageBuilder {
|
|
|
24
38
|
private readonly latestReadToolUseByLocatorCache;
|
|
25
39
|
private readonly latestFullContentOwnerByPathCache;
|
|
26
40
|
private readResultLocatorCache;
|
|
27
|
-
|
|
41
|
+
private readonly maxToolResultChars;
|
|
42
|
+
private readonly maxFileContentChars;
|
|
43
|
+
private readonly maxTotalTextBytes;
|
|
44
|
+
private readonly mediaBudget;
|
|
45
|
+
private readonly maxAssistantTextChars;
|
|
46
|
+
private readonly maxAssistantToolMarkupChars;
|
|
47
|
+
constructor(options?: MessageBuilderOptions);
|
|
28
48
|
buildForApi(messages: Message[]): Message[];
|
|
29
49
|
private transformBlock;
|
|
30
50
|
private reindex;
|
|
@@ -58,7 +78,12 @@ export declare class MessageBuilder {
|
|
|
58
78
|
private replaceOutdatedInString;
|
|
59
79
|
private replaceOutdatedReadEntry;
|
|
60
80
|
private isReadTool;
|
|
61
|
-
|
|
81
|
+
/**
|
|
82
|
+
* Tool results can outlive their paired tool_use block (compacted or
|
|
83
|
+
* imported histories), so fall back to the name carried on the result
|
|
84
|
+
* itself when the id lookup misses.
|
|
85
|
+
*/
|
|
86
|
+
private resolveToolName;
|
|
62
87
|
private truncateToolResultContent;
|
|
63
88
|
/**
|
|
64
89
|
* Deep-truncates string values inside structured tool outputs (e.g.
|
|
@@ -68,6 +93,8 @@ export declare class MessageBuilder {
|
|
|
68
93
|
*/
|
|
69
94
|
private truncateNestedStrings;
|
|
70
95
|
private truncateMiddle;
|
|
96
|
+
private truncateAssistantText;
|
|
97
|
+
private hasRepeatedToolCallMarkup;
|
|
71
98
|
private truncateToTotalTextBudget;
|
|
72
99
|
private countMessageTextBytes;
|
|
73
100
|
private collectTruncationCandidates;
|
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.
|
|
4
|
+
"version": "0.0.50",
|
|
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.
|
|
52
|
-
"@cline/shared": "0.0.
|
|
53
|
-
"@cline/llms": "0.0.
|
|
51
|
+
"@cline/agents": "0.0.50",
|
|
52
|
+
"@cline/shared": "0.0.50",
|
|
53
|
+
"@cline/llms": "0.0.50",
|
|
54
54
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
55
55
|
"@opentelemetry/api": "^1.9.0",
|
|
56
56
|
"@opentelemetry/api-logs": "^0.214.0",
|