ucode-agent 1.45.0 → 1.47.0

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.
@@ -16,6 +16,7 @@
16
16
 
17
17
  import { promises as fs } from 'node:fs';
18
18
  import path from 'node:path';
19
+ import { writeTracked } from '../tools/shared.js';
19
20
 
20
21
  /** Relative href/src only — absolute paths, URLs, data: and anchors are left alone. */
21
22
  const ASSET_REF = /\b(href|src)=("|')(?!https?:|\/\/|\/|data:|#|mailto:|tel:)([^"']+)\2/g;
@@ -53,7 +54,7 @@ export async function unprefixOwnFolder(root, files) {
53
54
 
54
55
  if (!hits) continue;
55
56
  try {
56
- await fs.writeFile(abs, next, 'utf8');
57
+ await writeTracked(abs, next);
57
58
  fixed.push(`${rel} (${hits})`);
58
59
  } catch { /* unwritable: leave it, and say nothing that is not true */ }
59
60
  }
@@ -20,7 +20,7 @@ import { promises as fs } from 'node:fs';
20
20
  import path from 'node:path';
21
21
  import { fileURLToPath } from 'node:url';
22
22
  import { ToolFailure } from '../core/failure.js';
23
- import { resolveIn, guard, result } from './shared.js';
23
+ import { resolveIn, guard, result, writeTracked } from './shared.js';
24
24
 
25
25
  const BLOCKS = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', '..', 'templates', 'blocks');
26
26
 
@@ -193,7 +193,7 @@ export async function addBlock({ name, folder = '.' }) {
193
193
  }
194
194
 
195
195
  await fs.mkdir(path.dirname(dest), { recursive: true });
196
- await fs.writeFile(dest, source, 'utf8');
196
+ await writeTracked(dest, source);
197
197
 
198
198
  const first = catalogue[wanted].exports.split(',')[0].trim();
199
199
  return result(