social-autoposter 1.6.45 → 1.6.46

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/mcp/dist/index.js +17 -6
  2. package/package.json +1 -1
package/mcp/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import { z } from "zod";
16
16
  import os from "node:os";
17
17
  import path from "node:path";
18
18
  import fs from "node:fs";
19
- import { REPO_DIR, runPython, run, readPlan, writePlan, planPath, latestBatchId, } from "./repo.js";
19
+ import { REPO_DIR, runPython, run, readPlan, writePlan, planPath, } from "./repo.js";
20
20
  import { applySetup, resolveProject, hasReadyProject, listManagedProjectStatus, REQUIRED_FIELDS, RECOMMENDED_FIELDS, CONFIG_PATH, } from "./setup.js";
21
21
  import { xStatus, xConnect, summarizeXAuth } from "./twitterAuth.js";
22
22
  import { VERSION, versionStatus, latestPublishedVersion } from "./version.js";
@@ -207,6 +207,13 @@ async function produceDrafts(project, onProgress) {
207
207
  const env = {
208
208
  DRAFT_ONLY: "1",
209
209
  TWITTER_PAGE_GEN_RATE: "0",
210
+ // Interactive draft_cycle: launch the harness Chrome ON-SCREEN so the user
211
+ // can watch the scan/scrape happen live. Cron/autopilot do NOT set these, so
212
+ // background runs keep the off-screen default in twitter-backend.sh and don't
213
+ // hijack the screen. (Only affects a fresh Chrome launch; an already-running
214
+ // harness window keeps its current position.)
215
+ BH_WINDOW_POS: "60,60",
216
+ BH_WINDOW_SIZE: "1280,900",
210
217
  };
211
218
  if (project)
212
219
  env.SAPS_FORCE_PROJECT = project;
@@ -272,13 +279,17 @@ async function produceDrafts(project, onProgress) {
272
279
  if (blockedMarker && blockedMarker[1]) {
273
280
  return { batchId: null, blocked: blockedReasonMessage(blockedMarker[1]) };
274
281
  }
275
- const existing = latestBatchId();
276
- if (existing)
277
- return { batchId: existing };
282
+ // No `DRAFT_ONLY_PLAN=` marker from THIS run => this run produced no drafts.
283
+ // We MUST NOT fall back to the newest plan file on disk (`latestBatchId()`):
284
+ // that's a *previous* run's batch, so a 5-second empty cycle would echo an old
285
+ // 7-draft batch and report phantom success. Report 0 drafts honestly, with the
286
+ // pipeline's own reason (e.g. cold-start project with no seeded queries).
278
287
  return {
279
288
  batchId: null,
280
- blocked: `Draft cycle produced no plan (exit ${res.code}). This usually means scan ` +
281
- `found no fresh candidates, or the pipeline errored. Tail:\n` +
289
+ blocked: `This run produced no drafts (exit ${res.code}). The scan found no fresh ` +
290
+ `candidates for the selected project usually a cold-start project with ` +
291
+ `no seeded search queries/topics, or a pipeline error. This is NOT a ` +
292
+ `previous batch. Tail:\n` +
282
293
  res.stderr.split("\n").slice(-12).join("\n"),
283
294
  };
284
295
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "social-autoposter",
3
- "version": "1.6.45",
3
+ "version": "1.6.46",
4
4
  "description": "Automated social posting pipeline for Reddit, X/Twitter, LinkedIn, and Moltbook. Install as a Claude Code agent skill.",
5
5
  "bin": {
6
6
  "social-autoposter": "bin/cli.js"