terminal-smart-cli 0.97.16 → 0.97.17

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.
Files changed (2) hide show
  1. package/lib/meta.js +8 -6
  2. package/package.json +1 -1
package/lib/meta.js CHANGED
@@ -45,18 +45,20 @@ function toolsForMetaItem(item, goal) {
45
45
 
46
46
  // Connect each checklist item to a concrete artifact. Planner criteria have
47
47
  // priority; deterministic fallbacks cover later items that exceed the criteria cap.
48
- function artifactForMetaItem(item, st) {
49
- const list = Array.isArray(st && st.checklist) ? st.checklist : [];
50
- const index = Math.max(0, list.indexOf(item));
51
- const criterion = Array.isArray(st && st.criteria) ? st.criteria[index] : null;
52
- if (criterion && ['file_exists', 'file_contains'].includes(criterion.type) && criterion.path) return String(criterion.path);
48
+ function artifactForMetaItem(item, st, dir = '') {
53
49
  const d = String(item && item.desc || '').toLowerCase();
50
+ const criteria = Array.isArray(st && st.criteria) ? st.criteria : [];
51
+ const namedCriterion = criteria.find(c => c && c.path && d.includes(path.basename(String(c.path)).toLowerCase()));
52
+ if (namedCriterion) return String(namedCriterion.path);
54
53
  if (/controller.*8 dire|8 dire.*controller/.test(d)) return 'src/player_controller.gd';
55
54
  if (/combate b[aá]sico|sistema de combate/.test(d)) return 'src/combat_system.gd';
56
55
  if (/interface|\bui\b|\bhud\b/.test(d)) return 'docs/UI_SPEC.md';
57
56
  if (/80-100 monstros|lista.*monstros/.test(d)) return 'data/monsters.json';
58
57
  if (/economia|zeny|vending/.test(d)) return 'docs/ECONOMY.md';
59
58
  if (/prioriza|\bmvp\b.*alpha|roadmap/.test(d)) return 'docs/ROADMAP.md';
59
+ // Em projeto web de arquivo único, itens funcionais/visuais alteram o app real.
60
+ // Critérios globais não correspondem por posição aos itens do checklist.
61
+ if (dir && fs.existsSync(path.join(dir, 'index.html')) && !/readme|instru[çc][õo]es|documenta[çc][ãa]o/.test(d)) return 'index.html';
60
62
  return `artifacts/${String(item && item.id || 'item').replace(/[^a-z0-9_-]/gi, '_')}.md`;
61
63
  }
62
64
 
@@ -1366,7 +1368,7 @@ async function run(goal, opts = {}) {
1366
1368
  }
1367
1369
 
1368
1370
  const item = pend[0];
1369
- const expectedArtifact = artifactForMetaItem(item, st);
1371
+ const expectedArtifact = artifactForMetaItem(item, st, dir);
1370
1372
  // A process can be interrupted after a read-only round but before the
1371
1373
  // no-artifact branch persists `directArtifact`. Recover that evidence on
1372
1374
  // resume instead of repeating the same exploratory attempt.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "terminal-smart-cli",
3
- "version": "0.97.16",
3
+ "version": "0.97.17",
4
4
  "description": "Terminal Smart no seu terminal — pergunte, analise logs por pipe e orquestre agentes de IA. Comando: ts",
5
5
  "bin": {
6
6
  "ts": "bin/ts.js"