terminal-smart-cli 0.97.24 → 0.97.25

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 +10 -2
  2. package/package.json +1 -1
package/lib/meta.js CHANGED
@@ -1400,6 +1400,12 @@ async function run(goal, opts = {}) {
1400
1400
  ? (path.isAbsolute(expectedArtifact) ? expectedArtifact : path.resolve(dir, expectedArtifact))
1401
1401
  : null;
1402
1402
  const expectedBeforeHash = expectedOnDisk ? artifactHash(expectedOnDisk) : null;
1403
+ // Persist the starting fingerprint so a successful edit made immediately
1404
+ // before a pause is still provable in the next clean window.
1405
+ if (!item.artifactBaselineHash && expectedBeforeHash) {
1406
+ item.artifactBaselineHash = expectedBeforeHash;
1407
+ save(st, dir);
1408
+ }
1403
1409
  if (!item.directArtifact && (item.attempts || 0) > 0 && expectedOnDisk && !fs.existsSync(expectedOnDisk)) {
1404
1410
  item.directArtifact = true;
1405
1411
  item.directModel = item.directModel || 'glm-5.2';
@@ -1656,7 +1662,9 @@ async function run(goal, opts = {}) {
1656
1662
  const expectedNow = String(expectedArtifact || '').replace(/\\/g, '/').toLowerCase();
1657
1663
  const expectedAfterHash = expectedOnDisk ? artifactHash(expectedOnDisk) : null;
1658
1664
  const expectedChangedNow = !!expectedAfterHash && expectedAfterHash !== expectedBeforeHash;
1659
- const wroteExpectedNow = expectedChangedNow || (out.actions || []).some(a => {
1665
+ const expectedChangedSinceBaseline = !!expectedAfterHash && !!item.artifactBaselineHash
1666
+ && expectedAfterHash !== item.artifactBaselineHash;
1667
+ const wroteExpectedNow = expectedChangedNow || expectedChangedSinceBaseline || (out.actions || []).some(a => {
1660
1668
  if (!['escrever_arquivo', 'editar_arquivo'].includes(a && a.name)) return false;
1661
1669
  const target = String(a.target || '').replace(/\\/g, '/').toLowerCase();
1662
1670
  return target === expectedNow || target.endsWith('/' + expectedNow);
@@ -1701,7 +1709,7 @@ async function run(goal, opts = {}) {
1701
1709
  // A confined command may legitimately edit the project (formatter, codemod,
1702
1710
  // migration script). Hash evidence ties that mutation to the exact expected
1703
1711
  // artifact instead of trusting the command narrative.
1704
- if (expectedChangedNow && expectedArtifact) written.push(String(expectedArtifact));
1712
+ if ((expectedChangedNow || expectedChangedSinceBaseline) && expectedArtifact) written.push(String(expectedArtifact));
1705
1713
  const _basename = (p) => String(p).replace(/\\/g, '/').split('/').pop().toLowerCase();
1706
1714
  const _fileHints = (txt) => (String(txt).match(/[\w.\-]+\.(kt|java|xml|gradle|json|md|txt|kts|properties|pro|png|webp|py|gd|js|ts|html|css|sh)\b/gi) || []).map(s => s.toLowerCase());
1707
1715
  const itemFiles = _fileHints(item.desc);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "terminal-smart-cli",
3
- "version": "0.97.24",
3
+ "version": "0.97.25",
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"