@qilin-agent/repeat-tool-reminder 0.0.0-stage → 3.1.3
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/LICENSE +21 -0
- package/README.i18n.yaml +85 -0
- package/README.md +184 -2
- package/README.zh.md +185 -0
- package/lib/index.js +2221 -0
- package/lib/types/index.d.ts +51 -0
- package/package.json +47 -3
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Advisory per-agent repeat-call detector. It enriches post-execute decisions
|
|
3
|
+
* with logged model context without vetoing or rewriting calls. Configuration
|
|
4
|
+
* and chain semantics live in the package README; rationale lives in the
|
|
5
|
+
* repeat-tool-reminder Agent Note.
|
|
6
|
+
* @module @qilin-agent/repeat-tool-reminder
|
|
7
|
+
*/
|
|
8
|
+
import type { Context } from '@qilin-agent/kylin';
|
|
9
|
+
import z from '@qilin-agent/schemastery';
|
|
10
|
+
import type { ContextFormed } from '@qilin-agent/llm';
|
|
11
|
+
declare module '@qilin-agent/llm' {
|
|
12
|
+
interface MessageSourceMap {
|
|
13
|
+
'repeat-tool-reminder': {
|
|
14
|
+
kind: 'repeat-tool-reminder';
|
|
15
|
+
} & ContextFormed;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export declare const name = "repeat-tool-reminder";
|
|
19
|
+
/**
|
|
20
|
+
* Plugin config, validated by the same-named schemastery schema plus the
|
|
21
|
+
* load-time checks in `apply` (misconfiguration fails loud: an empty
|
|
22
|
+
* `thresholds` list, a non-integer, a value below 2, or a duplicate throws at
|
|
23
|
+
* plugin load, never a silent fall-back). `include`/`exclude` entries are
|
|
24
|
+
* `*`-wildcard predicates over tool names at call time, not references to
|
|
25
|
+
* registry entries — a pattern matching no currently registered tool is valid
|
|
26
|
+
* (`exclude: [mcp_*]` must stay legal in a deployment that loads no MCP tools).
|
|
27
|
+
*/
|
|
28
|
+
export interface Config {
|
|
29
|
+
/** Consecutive-repeat counts that trigger a reminder (default `[3, 5, 8]`). */
|
|
30
|
+
thresholds?: number[];
|
|
31
|
+
/** Tool-name patterns to track; empty means every tool is tracked. */
|
|
32
|
+
include?: string[];
|
|
33
|
+
/** Tool-name patterns transparent to the chain (neither count nor reset). */
|
|
34
|
+
exclude?: string[];
|
|
35
|
+
/**
|
|
36
|
+
* Maximum characters of canonical arguments quoted in the DETAILED reminder
|
|
37
|
+
* (default 500). Large payloads (a `write` body, a long command) would
|
|
38
|
+
* otherwise ride into the next request unbounded — precisely in a loop
|
|
39
|
+
* scenario; the cap bounds the reminder, never the detection (the chain key
|
|
40
|
+
* always compares the FULL canonical string).
|
|
41
|
+
*/
|
|
42
|
+
argumentsPreviewChars?: number;
|
|
43
|
+
}
|
|
44
|
+
export declare const Config: z<Config>;
|
|
45
|
+
/**
|
|
46
|
+
* Install the guard's listeners.
|
|
47
|
+
* @param ctx - plugin context; listeners are scoped to it and disposed with it.
|
|
48
|
+
* @param config - validated {@link Config}; `thresholds` is re-checked fail-loud here.
|
|
49
|
+
*/
|
|
50
|
+
export declare function apply(ctx: Context, config: Config): void;
|
|
51
|
+
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qilin-agent/repeat-tool-reminder",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"description": "Repeat-tool-call guard plugin: advisory reminders when an agent loops on identical tool calls",
|
|
4
|
+
"version": "3.1.3",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/kkutysllb/QiLin.git",
|
|
11
|
+
"directory": "packages/guard/repeat-tool-reminder"
|
|
12
|
+
},
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
15
|
+
},
|
|
16
|
+
"type": "module",
|
|
17
|
+
"main": "lib/index.js",
|
|
18
|
+
"types": "lib/types/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./lib/types/index.d.ts",
|
|
22
|
+
"default": "./lib/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./src/*": "./src/*",
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"lib/index.js",
|
|
29
|
+
"lib/types/**/*.d.ts"
|
|
30
|
+
],
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@qilin-agent/schemastery": "~3.18.3"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@qilin-agent/tools": "3.1.3",
|
|
37
|
+
"@qilin-agent/agent": "3.1.3",
|
|
38
|
+
"@qilin-agent/kylin": "~4.0.3"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@qilin-agent/agent": "3.1.3",
|
|
42
|
+
"@qilin-agent/agent-loop-testkit": "3.1.3",
|
|
43
|
+
"@qilin-agent/llm": "3.1.3",
|
|
44
|
+
"@qilin-agent/session": "3.1.3",
|
|
45
|
+
"@qilin-agent/agent-loop": "3.1.3",
|
|
46
|
+
"@qilin-agent/tools": "3.1.3",
|
|
47
|
+
"@qilin-agent/kylin": "~4.0.3",
|
|
48
|
+
"@qilin-agent/session-projection": "3.1.3"
|
|
49
|
+
}
|
|
6
50
|
}
|