@m13v/s4l 1.7.2-rc.7 → 1.7.2-rc.9
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 +11 -1
- package/mcp/dist/version.json +2 -2
- package/mcp/manifest.json +1 -1
- package/mcp/menubar/s4l_menubar.py +5 -0
- package/mcp/menubar/s4l_state.py +39 -0
- package/mcp/package.json +1 -1
- package/package.json +1 -1
package/mcp/dist/index.js
CHANGED
|
@@ -2244,7 +2244,17 @@ tool("post_drafts", {
|
|
|
2244
2244
|
return;
|
|
2245
2245
|
}
|
|
2246
2246
|
c.terminal = true;
|
|
2247
|
-
|
|
2247
|
+
// Preserve a more specific reason the menu bar already stamped locally
|
|
2248
|
+
// (store_stamp_decision writes "human_rejected" for a card reject,
|
|
2249
|
+
// discard_all_pending writes "human_discarded_all" for the bulk-discard
|
|
2250
|
+
// button) BEFORE this loopback call ever fires, so by the time it lands
|
|
2251
|
+
// here the local reason is already the more informative one. Only
|
|
2252
|
+
// default to "rejected" when nothing more specific got there first
|
|
2253
|
+
// (e.g. a reject driven straight from chat, with no menu-bar card
|
|
2254
|
+
// involved at all).
|
|
2255
|
+
if (!c.terminal_reason) {
|
|
2256
|
+
c.terminal_reason = "rejected";
|
|
2257
|
+
}
|
|
2248
2258
|
c.approved = false;
|
|
2249
2259
|
rejected.push(n);
|
|
2250
2260
|
});
|
package/mcp/dist/version.json
CHANGED
package/mcp/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"dxt_version": "0.1",
|
|
3
3
|
"name": "social-autoposter",
|
|
4
4
|
"display_name": "S4L",
|
|
5
|
-
"version": "1.7.2-rc.
|
|
5
|
+
"version": "1.7.2-rc.9",
|
|
6
6
|
"description": "Draft, review, approve, and autopilot X/Twitter posts.",
|
|
7
7
|
"long_description": "## **⚠️ The disclaimer above is generic Claude boilerplate.** Anthropic shows the same warning on every plugin regardless of what it does; any plugin has the same level of access as any app you download from the internet.\n\nS4L 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.\n\nWhat happens next:\n\n* About every 5 minutes S4L scans X for posts that match your topics and drafts replies in your voice.\n* Drafts show up as review cards, usually the first within a few minutes. Nothing is posted automatically; you approve each one.\n* Posting autopilot stays off until you explicitly turn it on.",
|
|
8
8
|
"author": {
|
|
@@ -2930,12 +2930,17 @@ class S4LMenuBar(rumps.App):
|
|
|
2930
2930
|
self._alert("Discard failed", str(e)[:200])
|
|
2931
2931
|
return
|
|
2932
2932
|
ns = [d.get("n") for d in drafts if d.get("n") is not None]
|
|
2933
|
+
cids = [d.get("candidate_id") for d in drafts if d.get("candidate_id") is not None]
|
|
2933
2934
|
|
|
2934
2935
|
def _persist_discard():
|
|
2935
2936
|
try:
|
|
2936
2937
|
st.post_drafts(batch, reject=ns, timeout=60)
|
|
2937
2938
|
except Exception:
|
|
2938
2939
|
pass
|
|
2940
|
+
try:
|
|
2941
|
+
st.flip_discarded_candidates_skipped(cids)
|
|
2942
|
+
except Exception:
|
|
2943
|
+
pass
|
|
2939
2944
|
|
|
2940
2945
|
threading.Thread(target=_persist_discard, daemon=True).start()
|
|
2941
2946
|
try:
|
package/mcp/menubar/s4l_state.py
CHANGED
|
@@ -803,6 +803,45 @@ def discard_all_pending(drafts):
|
|
|
803
803
|
return _store_update(mutate) or 0
|
|
804
804
|
|
|
805
805
|
|
|
806
|
+
def flip_discarded_candidates_skipped(candidate_ids):
|
|
807
|
+
"""Flip each bulk-discarded candidate's twitter_candidates row to
|
|
808
|
+
status='skipped', skip_reason='human_discarded_all' — the same DB effect a
|
|
809
|
+
normal reject gets for free as a side effect of its review-events insert
|
|
810
|
+
(see review-events/route.ts). The bulk-discard path deliberately never
|
|
811
|
+
ships a review event (that's the whole point — it must not reach the
|
|
812
|
+
feedback digest), so without this direct call the row would stay
|
|
813
|
+
'pending' until the independent age-based freshness gate happens to expire
|
|
814
|
+
it, wide open to re-discovery/re-drafting of the exact draft a human just
|
|
815
|
+
discarded. One PATCH per candidate via the SAME direct-HTTP path
|
|
816
|
+
flush_review_events already uses (http_api), so this never touches
|
|
817
|
+
review_events. Best-effort: a candidate that already expired/posted by the
|
|
818
|
+
time this runs (404, no longer 'pending') is a no-op, not a failure."""
|
|
819
|
+
if not candidate_ids:
|
|
820
|
+
return
|
|
821
|
+
try:
|
|
822
|
+
from http_api import api_patch
|
|
823
|
+
except Exception as err:
|
|
824
|
+
sys.stderr.write(
|
|
825
|
+
f"[s4l-state] flip_discarded_candidates_skipped: http_api unavailable "
|
|
826
|
+
f"({type(err).__name__}: {err}); {len(candidate_ids)} candidate(s) left 'pending'\n"
|
|
827
|
+
)
|
|
828
|
+
sys.stderr.flush()
|
|
829
|
+
return
|
|
830
|
+
for cid in candidate_ids:
|
|
831
|
+
try:
|
|
832
|
+
api_patch(
|
|
833
|
+
"/api/v1/twitter-candidates/by-id",
|
|
834
|
+
{"id": cid, "action": "mark_skipped", "reason": "human_discarded_all"},
|
|
835
|
+
ok_on_404=True,
|
|
836
|
+
)
|
|
837
|
+
except Exception as err:
|
|
838
|
+
sys.stderr.write(
|
|
839
|
+
f"[s4l-state] flip_discarded_candidates_skipped: PATCH failed for "
|
|
840
|
+
f"candidate_id={cid} ({type(err).__name__}: {err})\n"
|
|
841
|
+
)
|
|
842
|
+
sys.stderr.flush()
|
|
843
|
+
|
|
844
|
+
|
|
806
845
|
def store_mark_post_failed(batch, n, candidate_id=None, error=None):
|
|
807
846
|
"""A decided post that FAILED surfaces via notification/dashboard, not by
|
|
808
847
|
re-presenting the card and not by endless resume retries."""
|
package/mcp/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m13v/s4l-mcp",
|
|
3
|
-
"version": "1.7.2-rc.
|
|
3
|
+
"version": "1.7.2-rc.9",
|
|
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