@wrongstack/tools 0.5.0 → 0.5.3

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/dist/pack.js CHANGED
@@ -891,6 +891,12 @@ var editTool = {
891
891
  await atomicWrite(absPath, newFile, { mode: stat9.mode & 511 });
892
892
  const updated = await fs9.stat(absPath);
893
893
  ctx.recordRead(absPath, updated.mtimeMs);
894
+ ctx.session.recordFileChange({
895
+ path: absPath,
896
+ action: "modified",
897
+ before: original,
898
+ after: newFile
899
+ });
894
900
  const diff = unifiedDiff(original, newFile, {
895
901
  fromFile: input.path,
896
902
  toFile: input.path
@@ -4277,6 +4283,12 @@ var writeTool = {
4277
4283
  + (new file, ${input.content.split("\n").length} lines)`;
4278
4284
  const stat9 = await fs9.stat(absPath);
4279
4285
  ctx.recordRead(absPath, stat9.mtimeMs);
4286
+ ctx.session.recordFileChange({
4287
+ path: absPath,
4288
+ action: existed ? "modified" : "created",
4289
+ before: existed ? prev : null,
4290
+ after: input.content
4291
+ });
4280
4292
  return {
4281
4293
  path: absPath,
4282
4294
  bytes_written: Buffer.byteLength(input.content, "utf8"),