terminal-smart-cli 0.97.45 → 0.97.46
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/lib/agent.js +10 -2
- package/package.json +1 -1
package/lib/agent.js
CHANGED
|
@@ -1066,8 +1066,16 @@ async function run(task, opts = {}) {
|
|
|
1066
1066
|
// própria conta e injeta a memória daquele projeto; consulta vaga continua
|
|
1067
1067
|
// isolada na pasta atual para não contaminar trabalhos diferentes.
|
|
1068
1068
|
const strongestCurrent = _busRecords.reduce((best, record) => Math.max(best, Number(record.score || 0)), 0);
|
|
1069
|
-
|
|
1070
|
-
|
|
1069
|
+
const isNewProjectUpdate = /\b(guarde|registre|registr[ae]|crie|criar|novo projeto|vamos criar|decis[aã]o)\b/i.test(taskText);
|
|
1070
|
+
if (strongestCurrent < 0.6 && !isNewProjectUpdate) {
|
|
1071
|
+
const currentProjectId = _memoryBus.projectId(_scopeRoot);
|
|
1072
|
+
const candidates = (await _memoryBus.discoverProjects(token, { query: taskText, limit: 8 }))
|
|
1073
|
+
// A memória automática criada pela pergunta corrente não representa
|
|
1074
|
+
// uma retomada; ela só repete a própria pergunta. Nunca a use como
|
|
1075
|
+
// candidato para evitar que ela oculte o projeto realmente citado.
|
|
1076
|
+
.filter(candidate => candidate.projectId !== currentProjectId
|
|
1077
|
+
&& candidate.workstreamId !== _workstreamId)
|
|
1078
|
+
.slice(0, 2);
|
|
1071
1079
|
const winner = candidates[0];
|
|
1072
1080
|
const runnerUp = candidates[1];
|
|
1073
1081
|
if (winner && Number(winner.score || 0) >= 0.5 && (!runnerUp || Number(winner.score || 0) - Number(runnerUp.score || 0) >= 0.12)) {
|