@riconext/hermes-repo 0.15.0 → 0.15.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/CHANGELOG.md +22 -0
- package/dist/cli.js +48 -1
- package/dist/cli.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.15.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 修复 needsLlm 判断逻辑,增强 LLM 升级触发条件
|
|
8
|
+
|
|
9
|
+
**问题修复**:
|
|
10
|
+
|
|
11
|
+
- 新增 toolCalls 判断:工具调用 >= 8 次触发 LLM 升级
|
|
12
|
+
- 新增强信号判断:强信号(约定、决策)直接触发 LLM 升级
|
|
13
|
+
- 新增组合条件:覆盖中等复杂度场景
|
|
14
|
+
- messages >= 10 && toolCalls >= 5
|
|
15
|
+
- medium 信号 && fileChanges >= 2
|
|
16
|
+
- toolCalls >= 5 && fileChanges >= 1
|
|
17
|
+
- 新增综合分数判断:score >= 55 触发升级
|
|
18
|
+
|
|
19
|
+
**改进效果**:
|
|
20
|
+
|
|
21
|
+
- 重要约定和决策会被 LLM 提炼
|
|
22
|
+
- 复杂分析类会话(高工具调用、低文件修改)会被升级
|
|
23
|
+
- 中等复杂度会话不再被忽略
|
|
24
|
+
|
|
3
25
|
## 0.15.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/dist/cli.js
CHANGED
|
@@ -1095,13 +1095,60 @@ function isCursorInjectHook(hook) {
|
|
|
1095
1095
|
return name === "sessionstart";
|
|
1096
1096
|
}
|
|
1097
1097
|
|
|
1098
|
+
// src/capture/signalStrength.ts
|
|
1099
|
+
var STRONG_SIGNAL_RE = /改成|不对|错了|应该是|决定用|约定是|必须|架构/i;
|
|
1100
|
+
var MEDIUM_SIGNAL_RE = /考虑|也许|可能|试试|我们可以|看起来|似乎|建议|优化/i;
|
|
1101
|
+
var WEAK_SIGNAL_RE = /为什么|怎样|怎么|什么时候|哪里|如何/i;
|
|
1102
|
+
function getSignalStrength(text) {
|
|
1103
|
+
if (STRONG_SIGNAL_RE.test(text)) {
|
|
1104
|
+
return "strong";
|
|
1105
|
+
}
|
|
1106
|
+
if (MEDIUM_SIGNAL_RE.test(text)) {
|
|
1107
|
+
return "medium";
|
|
1108
|
+
}
|
|
1109
|
+
if (WEAK_SIGNAL_RE.test(text)) {
|
|
1110
|
+
return "weak";
|
|
1111
|
+
}
|
|
1112
|
+
return "none";
|
|
1113
|
+
}
|
|
1114
|
+
function computeSignalScore(session) {
|
|
1115
|
+
let score = 0;
|
|
1116
|
+
const strength = getSignalStrength(session.text);
|
|
1117
|
+
if (strength === "strong") {
|
|
1118
|
+
score += 30;
|
|
1119
|
+
} else if (strength === "medium") {
|
|
1120
|
+
score += 15;
|
|
1121
|
+
} else if (strength === "weak") {
|
|
1122
|
+
score += 5;
|
|
1123
|
+
}
|
|
1124
|
+
const messageBonus = Math.min(30, (session.messages.length - 2) * 5);
|
|
1125
|
+
score += Math.max(0, messageBonus);
|
|
1126
|
+
const toolBonus = Math.min(20, session.toolCalls * 2);
|
|
1127
|
+
score += toolBonus;
|
|
1128
|
+
const fileBonus = Math.min(20, session.fileChanges * 5);
|
|
1129
|
+
score += fileBonus;
|
|
1130
|
+
return Math.min(100, score);
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1098
1133
|
// src/capture/needsLlm.ts
|
|
1099
1134
|
var ARCHITECTURE_SIGNAL_RE = /约定|必须|架构|决策|规范|根因|migration|refactor|convention|root cause/i;
|
|
1100
1135
|
function hasArchitectureSignal(text) {
|
|
1101
1136
|
return ARCHITECTURE_SIGNAL_RE.test(text);
|
|
1102
1137
|
}
|
|
1103
1138
|
function needsLlm(session) {
|
|
1104
|
-
|
|
1139
|
+
if (session.messages.length >= 20) return true;
|
|
1140
|
+
if (session.fileChanges >= 3) return true;
|
|
1141
|
+
if (session.toolCalls >= 8) return true;
|
|
1142
|
+
const strength = getSignalStrength(session.text);
|
|
1143
|
+
if (strength === "strong") return true;
|
|
1144
|
+
if (hasArchitectureSignal(session.text)) return true;
|
|
1145
|
+
if (hasUserCorrection(session)) return true;
|
|
1146
|
+
if (session.messages.length >= 10 && session.toolCalls >= 5) return true;
|
|
1147
|
+
if (strength === "medium" && session.fileChanges >= 2) return true;
|
|
1148
|
+
if (session.toolCalls >= 5 && session.fileChanges >= 1) return true;
|
|
1149
|
+
const score = computeSignalScore(session);
|
|
1150
|
+
if (score >= 55) return true;
|
|
1151
|
+
return false;
|
|
1105
1152
|
}
|
|
1106
1153
|
|
|
1107
1154
|
// src/capture/sessionsIndex.ts
|