autocrew 0.3.6 → 0.3.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autocrew",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "One-person content studio powered by AI — from trending topics to published posts",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -36,7 +36,26 @@ export const cmd: CommandDef = {
36
36
  return;
37
37
  }
38
38
 
39
- console.log(`Auto-fix complete for "${resolved.title}" (${resolved.source})`);
39
+ // Write fixed text back to source file
40
+ const fixedText = (result.autoFixedText || result.fixedText || "") as string;
41
+ if (fixedText && resolved.source.startsWith("file:")) {
42
+ const fs = await import("node:fs/promises");
43
+ const filePath = resolved.source.replace("file:", "");
44
+ await fs.writeFile(filePath, fixedText, "utf-8");
45
+ console.log(`Auto-fix complete for "${resolved.title}" — saved back to ${filePath}`);
46
+ } else if (fixedText && resolved.source.startsWith("pipeline:")) {
47
+ const fs = await import("node:fs/promises");
48
+ const { findProject } = await import("../../storage/pipeline-store.js");
49
+ const slug = resolved.source.replace("pipeline:", "");
50
+ const found = await findProject(slug);
51
+ if (found) {
52
+ const path = await import("node:path");
53
+ await fs.writeFile(path.join(found.dir, "draft.md"), fixedText, "utf-8");
54
+ console.log(`Auto-fix complete for "${resolved.title}" — saved back to draft.md`);
55
+ }
56
+ } else {
57
+ console.log(`Auto-fix complete for "${resolved.title}" (${resolved.source})`);
58
+ }
40
59
  console.log(` Sensitive words fixed: ${result.sensitiveWordsFixed || 0}`);
41
60
  console.log(` AI traces fixed: ${result.aiFixesApplied || 0}`);
42
61
  return;