social-autoposter 1.6.170 → 1.6.172
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/mcp/dist/index.js +65 -0
- package/mcp/dist/version.json +2 -2
- package/mcp/manifest.json +2 -2
- package/mcp/package.json +1 -1
- package/package.json +1 -1
package/mcp/dist/index.js
CHANGED
|
@@ -2516,6 +2516,66 @@ function ensureWorkerFolderTrusted() {
|
|
|
2516
2516
|
console.error(`[queue-worker] ensureWorkerFolderTrusted error: ${e?.message || e}`);
|
|
2517
2517
|
}
|
|
2518
2518
|
}
|
|
2519
|
+
// Register this .mcpb server into ~/.claude.json `mcpServers` so the embedded
|
|
2520
|
+
// Cowork/Code agent discovers S4L too. The Chat tab loads S4L via Desktop's
|
|
2521
|
+
// LocalMcpServerManager (.mcpb extensions); the Cowork/Code tab is a SEPARATE,
|
|
2522
|
+
// real `claude-code` binary launched with `--setting-sources=user,project,local`
|
|
2523
|
+
// that only reads MCP servers from its setting sources + plugin dirs and NEVER
|
|
2524
|
+
// sees .mcpb extensions. So S4L shows up in Chat but is absent in Cowork no matter
|
|
2525
|
+
// how many restarts — the two surfaces don't share MCP state (confirmed
|
|
2526
|
+
// 2026-06-30 from the embedded process args on the box: empty user `mcpServers`,
|
|
2527
|
+
// S4L only present as a .mcpb). Writing a user-scoped `mcpServers` entry is the
|
|
2528
|
+
// path `--setting-sources=user` honors, so Cowork picks it up on its next session.
|
|
2529
|
+
// We point the entry at THIS running server's own dist/index.js (absolute,
|
|
2530
|
+
// install-location-agnostic) so both npm and .mcpb installs self-register the
|
|
2531
|
+
// correct path. Idempotent (writes only when missing/drifted), atomic (every CLI
|
|
2532
|
+
// session reads this file; a torn write would brick Claude Code), never throws.
|
|
2533
|
+
// Runs on every boot, so a box whose ~/.claude.json didn't exist yet self-heals on
|
|
2534
|
+
// the next restart once a Code/Cowork session has created it. Kill switch:
|
|
2535
|
+
// SAPS_COWORK_MCP=0.
|
|
2536
|
+
function ensureCoworkMcpRegistered() {
|
|
2537
|
+
try {
|
|
2538
|
+
if (process.env.SAPS_COWORK_MCP === "0")
|
|
2539
|
+
return;
|
|
2540
|
+
const home = process.env.HOME || os.homedir();
|
|
2541
|
+
const cfgPath = path.join(home, ".claude.json");
|
|
2542
|
+
if (!fs.existsSync(cfgPath))
|
|
2543
|
+
return; // Claude Code not initialised yet; retry next boot
|
|
2544
|
+
let cfg;
|
|
2545
|
+
try {
|
|
2546
|
+
cfg = JSON.parse(fs.readFileSync(cfgPath, "utf-8"));
|
|
2547
|
+
}
|
|
2548
|
+
catch (e) {
|
|
2549
|
+
console.error(`[cowork-mcp] ~/.claude.json unparseable; skip register: ${e?.message || e}`);
|
|
2550
|
+
return;
|
|
2551
|
+
}
|
|
2552
|
+
if (typeof cfg !== "object" || Array.isArray(cfg) || cfg === null)
|
|
2553
|
+
return;
|
|
2554
|
+
const servers = (cfg.mcpServers ??= {});
|
|
2555
|
+
if (typeof servers !== "object" || Array.isArray(servers))
|
|
2556
|
+
return;
|
|
2557
|
+
const serverEntry = path.join(DIST_DIR, "index.js");
|
|
2558
|
+
const desired = {
|
|
2559
|
+
command: "node",
|
|
2560
|
+
args: [serverEntry],
|
|
2561
|
+
env: { PATH: "/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" },
|
|
2562
|
+
};
|
|
2563
|
+
const current = servers["social-autoposter"];
|
|
2564
|
+
// Skip the write when the entry already matches, to avoid churning a file every
|
|
2565
|
+
// CLI session reads. Re-write when missing or drifted (install moved, older
|
|
2566
|
+
// version registered a different path/env).
|
|
2567
|
+
if (current && JSON.stringify(current) === JSON.stringify(desired))
|
|
2568
|
+
return;
|
|
2569
|
+
servers["social-autoposter"] = desired;
|
|
2570
|
+
const tmp = `${cfgPath}.s4l-cowork.${process.pid}.tmp`;
|
|
2571
|
+
fs.writeFileSync(tmp, JSON.stringify(cfg, null, 2) + "\n", "utf-8");
|
|
2572
|
+
fs.renameSync(tmp, cfgPath);
|
|
2573
|
+
console.error(`[cowork-mcp] registered S4L in ~/.claude.json mcpServers -> ${serverEntry}`);
|
|
2574
|
+
}
|
|
2575
|
+
catch (e) {
|
|
2576
|
+
console.error(`[cowork-mcp] ensureCoworkMcpRegistered error: ${e?.message || e}`);
|
|
2577
|
+
}
|
|
2578
|
+
}
|
|
2519
2579
|
// ---- launchd kicker: run the REAL pipeline in DRAFT_ONLY + queue mode --------
|
|
2520
2580
|
// Reinstates com.m13v.social-twitter-cycle as the customer-box kicker. It runs
|
|
2521
2581
|
// run-twitter-cycle.sh straight through (scan -> score -> draft -> link-gen) but
|
|
@@ -3754,6 +3814,11 @@ async function main() {
|
|
|
3754
3814
|
catch (e) {
|
|
3755
3815
|
console.error("[social-autoposter-mcp] short-links heal failed:", e?.message || e);
|
|
3756
3816
|
}
|
|
3817
|
+
// Make S4L visible in the Cowork/Code tab, not just the Chat tab: register this
|
|
3818
|
+
// server into ~/.claude.json `mcpServers` so the embedded claude-code (launched
|
|
3819
|
+
// with --setting-sources=user) discovers it. Synchronous, idempotent, atomic,
|
|
3820
|
+
// best-effort; never blocks boot. See ensureCoworkMcpRegistered for the why.
|
|
3821
|
+
ensureCoworkMcpRegistered();
|
|
3757
3822
|
const transport = new StdioServerTransport();
|
|
3758
3823
|
await server.connect(transport);
|
|
3759
3824
|
console.error(`[social-autoposter-mcp] connected. v=${VERSION} repo=${repoDir()}`);
|
package/mcp/dist/version.json
CHANGED
package/mcp/manifest.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"dxt_version": "0.1",
|
|
3
3
|
"name": "social-autoposter",
|
|
4
4
|
"display_name": "S4L",
|
|
5
|
-
"version": "1.6.
|
|
5
|
+
"version": "1.6.172",
|
|
6
6
|
"description": "Draft, review, approve, and autopilot X/Twitter posts.",
|
|
7
|
-
"long_description": "The disclaimer above is generic Claude boilerplate. S4L is an open source product developed by Mediar.ai Incorporated, a VC-backed San Francisco-based startup.\n\nTo get started:\n\n1\\. Copy this prompt: **Set me up on S4L plugin end to end**\n\n2\\. Quit with CMD+Q, reopen Claude, paste into a new chat
|
|
7
|
+
"long_description": "The disclaimer above is generic Claude boilerplate. S4L is an open source product developed by Mediar.ai Incorporated, a VC-backed San Francisco-based startup.\n\nTo get started:\n\n1\\. Copy this prompt: **Set me up on S4L plugin end to end**\n\n2\\. Quit with CMD+Q, reopen Claude, paste into a new chat.",
|
|
8
8
|
"author": {
|
|
9
9
|
"name": "S4L.ai",
|
|
10
10
|
"email": "i@m13v.com",
|
package/mcp/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m13v/social-autoposter-mcp",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.172",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Desktop MCP client for social-autoposter (X/Twitter rail): manual draft/review/approve loop, autopilot control, and stats. Thin wrapper over the existing pipeline scripts.",
|
|
6
6
|
"license": "MIT",
|
package/package.json
CHANGED