@cerebriline/agents 4.100.247 → 4.100.248
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/agent-runtime.d.ts +37 -0
- package/dist/agent-runtime.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -43
- package/dist/reasoning-repetition.d.ts +11 -0
- package/dist/reasoning-repetition.d.ts.map +1 -1
- package/dist/tool-intent-guard.d.ts +75 -0
- package/dist/tool-intent-guard.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -62,6 +62,17 @@ export interface RepetitionMeasurement {
|
|
|
62
62
|
* judge (too short, or no prose in it at all).
|
|
63
63
|
*/
|
|
64
64
|
export declare function measureReasoningRepetition(text: string, config?: ReasoningRepetitionConfig): RepetitionMeasurement | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* A removal, written so it can be checked afterwards.
|
|
67
|
+
*
|
|
68
|
+
* Removing looped reasoning deletes the only copy, and the log said
|
|
69
|
+
* "98320 chars removed" and nothing else. The user had watched that turn
|
|
70
|
+
* scroll past and had not seen a passage repeat 15 times (pandorum, zhy7n,
|
|
71
|
+
* 2026-10-12): the copies were spread through 341 paragraphs, not back to
|
|
72
|
+
* back, and nothing kept could show that. So: the counts, where in the turn
|
|
73
|
+
* each copy began, and the passage.
|
|
74
|
+
*/
|
|
75
|
+
export declare function describeRepetitionForLog(text: string, measurement: RepetitionMeasurement): string;
|
|
65
76
|
/** Whether a measurement crosses both thresholds. */
|
|
66
77
|
export declare function isRepetitionLoop(measurement: RepetitionMeasurement | undefined, config?: ReasoningRepetitionConfig): boolean;
|
|
67
78
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reasoning-repetition.d.ts","sourceRoot":"","sources":["../src/reasoning-repetition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO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call does. A model that has stopped
|
|
5
|
+
* using its reasoning channel does its reasoning there instead: session x8yap
|
|
6
|
+
* (pandorum, 2026-10-12, v9-agentic on xOllama) wrote an `editor` call whose
|
|
7
|
+
* `intent` began "Fix bracket imbalance ..." and went on "Wait, let's
|
|
8
|
+
* re-examine line 110 ..." for 82,325 characters. The call could not be read
|
|
9
|
+
* and nothing ran; the turn cost 28,120 tokens and 5m48s. The next two went
|
|
10
|
+
* the same way for 45,943 and 43,274 tokens. The intents of the calls that
|
|
11
|
+
* worked in that run were 60 to 250 characters.
|
|
12
|
+
*
|
|
13
|
+
* Length is the signal here, unlike the reasoning guard next door: reasoning
|
|
14
|
+
* has no sane upper bound and an `intent` does. Only `intent` is measured.
|
|
15
|
+
* `new_text` and its like are payload and can rightly be a whole file.
|
|
16
|
+
*
|
|
17
|
+
* One rule for every model. The call may arrive as JSON arguments from a
|
|
18
|
+
* provider that streams them, or in a model's own notation from a server that
|
|
19
|
+
* passes the call through as it is written (xOllama's `tool_call_progress`:
|
|
20
|
+
* gemma4's `call:NAME{key:<|"|>...}`, qwen's `<parameter=key>`, and whatever
|
|
21
|
+
* comes next). Reading each notation would mean a guard that exists for some
|
|
22
|
+
* models and not for others, and nobody remembers which. So nothing here
|
|
23
|
+
* reads a notation. It knows the names of the tools' arguments, and the rule
|
|
24
|
+
* is: once `intent` has begun, another argument must begin within the limit.
|
|
25
|
+
* An argument's name standing where a key stands looks alike in all of them.
|
|
26
|
+
*
|
|
27
|
+
* It can only act where the call's text arrives while it is being written. A
|
|
28
|
+
* server that holds the reply back until the call is complete gives it
|
|
29
|
+
* nothing to read until there is nothing left to save.
|
|
30
|
+
*/
|
|
31
|
+
/** Past any `intent` a working call has carried, and well short of the damage. */
|
|
32
|
+
export declare const DEFAULT_TOOL_INTENT_MAX_CHARS = 2000;
|
|
33
|
+
export interface ToolIntentLimitConfig {
|
|
34
|
+
/** Characters an `intent` may run to before the call is cut. */
|
|
35
|
+
maxChars: number;
|
|
36
|
+
}
|
|
37
|
+
export interface ToolIntentOverrun {
|
|
38
|
+
toolCallId: string;
|
|
39
|
+
toolName?: string;
|
|
40
|
+
/** Characters read since `intent` began when the call was cut. */
|
|
41
|
+
chars: number;
|
|
42
|
+
maxChars: number;
|
|
43
|
+
}
|
|
44
|
+
export declare function setToolIntentGuardEnabled(enabled: boolean): void;
|
|
45
|
+
export declare function isToolIntentGuardEnabled(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Reads tool-call text as it arrives, one call at a time, and answers the
|
|
48
|
+
* first time a call has gone the limit past the start of `intent` without
|
|
49
|
+
* beginning another argument.
|
|
50
|
+
*
|
|
51
|
+
* `argumentNames` is every argument of every tool the model may call. Without
|
|
52
|
+
* it nothing is measured: a call whose `intent` comes first and whose payload
|
|
53
|
+
* is a whole file would look exactly like the call this exists to cut.
|
|
54
|
+
*
|
|
55
|
+
* `toolNames` only serves the message: the last one written before `intent`
|
|
56
|
+
* begins is the tool the model is told about.
|
|
57
|
+
*/
|
|
58
|
+
export declare class ToolIntentGuard {
|
|
59
|
+
private readonly maxChars;
|
|
60
|
+
private readonly calls;
|
|
61
|
+
private readonly intentKey;
|
|
62
|
+
private readonly otherKey;
|
|
63
|
+
private readonly toolName;
|
|
64
|
+
private readonly tailChars;
|
|
65
|
+
constructor(config?: Partial<ToolIntentLimitConfig> & {
|
|
66
|
+
argumentNames?: Iterable<string>;
|
|
67
|
+
toolNames?: Iterable<string>;
|
|
68
|
+
});
|
|
69
|
+
push(toolCallId: string, text: string, toolName?: string): ToolIntentOverrun | undefined;
|
|
70
|
+
}
|
|
71
|
+
/** What stands in the assistant's turn where the cut call was being written. */
|
|
72
|
+
export declare function describeToolIntentOverrunStub(overrun: ToolIntentOverrun): string;
|
|
73
|
+
/** What the model is told about it. */
|
|
74
|
+
export declare function buildToolIntentOverrunNudge(overrun: ToolIntentOverrun): string;
|
|
75
|
+
//# sourceMappingURL=tool-intent-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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R;AAED,uCAAuC;AACvC,wBAAgB,2BAA2B,CAC1C,OAAO,EAAE,iBAAiB,GACxB,MAAM,CAIR"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cerebriline/agents",
|
|
3
|
-
"version": "4.100.
|
|
3
|
+
"version": "4.100.248",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/mann1x/cline.git",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"nanoid": "^5.1.7",
|
|
12
|
-
"@cerebriline/llms": "4.100.
|
|
13
|
-
"@cerebriline/shared": "4.100.
|
|
12
|
+
"@cerebriline/llms": "4.100.248",
|
|
13
|
+
"@cerebriline/shared": "4.100.248"
|
|
14
14
|
},
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|