mocode-ai 0.4.0 → 0.4.1
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/core.js +61 -11
- package/dist/config/index.js +10 -1
- package/dist/context/budget.js +225 -0
- package/dist/context/index.js +5 -2
- package/dist/context/lifecycle.js +384 -0
- package/dist/context/relevance.js +284 -0
- package/dist/repl/index.js +64 -11
- package/dist/session/compact.js +120 -12
- package/dist/session/index.js +5 -0
- package/dist/session/scheduler.js +172 -0
- package/dist/tools/builtins/ask-human.js +42 -3
- package/dist/tools/builtins/grep.js +52 -15
- package/dist/tools/builtins/read-file.js +15 -5
- package/dist/tools/constants.js +17 -0
- package/package.json +1 -1
package/dist/tools/constants.js
CHANGED
|
@@ -22,6 +22,23 @@ export const GC_DAYS = 90;
|
|
|
22
22
|
/** memory_search 结果(召回的记忆正文)的放宽上限:指令性内容,中截破坏语义,对齐 use_skill。 */
|
|
23
23
|
export const MAX_MEMORY_RESULT = 64000;
|
|
24
24
|
export const IGNORE = ['**/node_modules/**', '**/.git/**'];
|
|
25
|
+
// ── Context Budget Scheduler(五区分账)────────────────────────────────────
|
|
26
|
+
/** Hot/Cold 划分:当前 step 起往前 N 个 user turn 之内的工具结果视为 Hot(绝对不压),
|
|
27
|
+
* 之外的视为 Cold(可调度器压)。默认 4 = 跨过 4 个用户问题仍生效。 */
|
|
28
|
+
export const HOT_TURN_WINDOW = 4;
|
|
29
|
+
/** Cold 区内可被就地 stub 的 tool 消息最低 age(经过的消费者 push 数)。默认 2,
|
|
30
|
+
* 与 lifecycle.ts DEFAULT_AGE_THRESHOLD 对齐。 */
|
|
31
|
+
export const TOOL_OLD_AGE = 2;
|
|
32
|
+
/** 五区预算占比(总和 0.95,留 5% 给 Reserve)。对齐 user 修正版:
|
|
33
|
+
* System 15 / History 20 / Hot Tool 25 / Cold Tool 25 / Summary 10。 */
|
|
34
|
+
export const BUDGET_RATIO = {
|
|
35
|
+
system: 0.15,
|
|
36
|
+
history: 0.20,
|
|
37
|
+
toolRecent: 0.25,
|
|
38
|
+
toolOld: 0.25,
|
|
39
|
+
summary: 0.10,
|
|
40
|
+
reserve: 0.05,
|
|
41
|
+
};
|
|
25
42
|
// ── plan 模式(只读规划,不执行)──────────────────────────────────────────────
|
|
26
43
|
/**
|
|
27
44
|
* plan 模式下从工具 schema 里剔除的工具(模型根本看不到 → 调不到):
|