social-duo 0.1.0

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/README.md ADDED
@@ -0,0 +1,118 @@
1
+ # social-duo
2
+
3
+ A production-quality Python CLI where two AI agents collaborate to draft, critique, revise, and reply to social media content. The tool maintains a local workspace with config, history, and exports.
4
+
5
+ **Highlights**
6
+ - Two agents: Writer and Editor/Responder
7
+ - Iterative loop with PASS/FAIL gating
8
+ - Platform constraints and brand voice
9
+ - SQLite history with export
10
+ - JSON and rich CLI output
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ cd social-duo
16
+ python -m venv .venv
17
+ source .venv/bin/activate
18
+ pip install -e .
19
+ ```
20
+
21
+ Or with `pipx`:
22
+
23
+ ```bash
24
+ pipx install -e .
25
+ ```
26
+
27
+ ## Setup
28
+
29
+ ```bash
30
+ cp .env.example .env
31
+ export OPENAI_API_KEY=your_key_here
32
+ # Optional
33
+ export OPENAI_BASE_URL=https://api.openai.com/v1
34
+ export OPENAI_MODEL=gpt-4o-mini
35
+ ```
36
+
37
+ Initialize the workspace:
38
+
39
+ ```bash
40
+ social_duo init
41
+ ```
42
+
43
+ ## Examples
44
+
45
+ LinkedIn post about agentic workflows:
46
+
47
+ ```bash
48
+ social_duo post --platform linkedin --goal educate --topic "agentic workflows" --audience "engineering leaders" --tone "confident" --length medium
49
+ ```
50
+
51
+ X thread of 5 tweets about vector databases for semantic search:
52
+
53
+ ```bash
54
+ social_duo post --platform x --thread 5 --goal educate --topic "vector databases for semantic search" --audience "ML engineers" --tone technical --length short
55
+ ```
56
+
57
+ Replies to a critical comment (polite + direct):
58
+
59
+ ```bash
60
+ social_duo reply --text "This feels like vaporware." --platform x --style polite --stance neutral
61
+ social_duo reply --text "This feels like vaporware." --platform x --style direct --stance disagree
62
+ ```
63
+
64
+ Autonomous discuss mode (no topic provided):
65
+
66
+ ```bash
67
+ social_duo discuss --platform x --turns 10 --verbose
68
+ ```
69
+
70
+ MOLTBOOK-LITE simulation:
71
+
72
+ ```bash
73
+ social_duo molt run --turns 25
74
+ social_duo molt watch --run-id <id>
75
+ social_duo molt export --run-id <id> --format md
76
+ ```
77
+
78
+ Resume session via history and chat:
79
+
80
+ ```bash
81
+ social_duo history --list
82
+ social_duo history --show 3
83
+ social_duo chat --session 3
84
+ ```
85
+
86
+ ## Commands
87
+
88
+ - `social_duo init`
89
+ - `social_duo post`
90
+ - `social_duo reply`
91
+ - `social_duo discuss`
92
+ - `social_duo molt`
93
+ - `social_duo chat`
94
+ - `social_duo history`
95
+ - `social_duo config`
96
+
97
+ ## Troubleshooting
98
+
99
+ - Missing key: set `OPENAI_API_KEY` in your environment.
100
+ - Base URL errors: set `OPENAI_BASE_URL` (default is `https://api.openai.com/v1`).
101
+ - Model errors: set `OPENAI_MODEL` to a valid chat model name for your provider.
102
+
103
+ ## Notes
104
+
105
+ - All artifacts are stored in `.social-duo/` in the current directory.
106
+ - Use `--json` for machine-readable output.
107
+ - Use `--verbose` to see full agent exchanges.
108
+
109
+ ## NPM Wrapper
110
+
111
+ If you want an npm package that installs the Python CLI from GitHub:
112
+
113
+ ```bash
114
+ npm i -g social-duo
115
+ social-duo --help
116
+ ```
117
+
118
+ This uses the GitHub repo as the install source and creates a venv under `~/.social-duo/venv`.
package/npm/install.js ADDED
@@ -0,0 +1,44 @@
1
+ const { execFileSync } = require("child_process");
2
+ const fs = require("fs");
3
+ const os = require("os");
4
+ const path = require("path");
5
+
6
+ const REPO_URL = "https://github.com/ethnmcl/social-duo.git";
7
+ const HOME = os.homedir();
8
+ const BASE_DIR = path.join(HOME, ".social-duo");
9
+ const VENV_DIR = path.join(BASE_DIR, "venv");
10
+
11
+ function ensureDir(p) {
12
+ if (!fs.existsSync(p)) {
13
+ fs.mkdirSync(p, { recursive: true });
14
+ }
15
+ }
16
+
17
+ function getPython() {
18
+ return process.platform === "win32" ? "python" : "python3";
19
+ }
20
+
21
+ function venvBin() {
22
+ return process.platform === "win32" ? path.join(VENV_DIR, "Scripts") : path.join(VENV_DIR, "bin");
23
+ }
24
+
25
+ function run(cmd, args) {
26
+ execFileSync(cmd, args, { stdio: "inherit" });
27
+ }
28
+
29
+ function main() {
30
+ ensureDir(BASE_DIR);
31
+
32
+ const python = getPython();
33
+ if (!fs.existsSync(VENV_DIR)) {
34
+ run(python, ["-m", "venv", VENV_DIR]);
35
+ }
36
+
37
+ const binDir = venvBin();
38
+ const pip = process.platform === "win32" ? path.join(binDir, "pip.exe") : path.join(binDir, "pip");
39
+
40
+ // Install/upgrade from GitHub repo
41
+ run(pip, ["install", "--upgrade", `git+${REPO_URL}`]);
42
+ }
43
+
44
+ main();
package/npm/run.js ADDED
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ const { spawnSync } = require("child_process");
3
+ const os = require("os");
4
+ const path = require("path");
5
+ const fs = require("fs");
6
+
7
+ const HOME = os.homedir();
8
+ const BASE_DIR = path.join(HOME, ".social-duo");
9
+ const VENV_DIR = path.join(BASE_DIR, "venv");
10
+
11
+ function venvBin() {
12
+ return process.platform === "win32" ? path.join(VENV_DIR, "Scripts") : path.join(VENV_DIR, "bin");
13
+ }
14
+
15
+ function main() {
16
+ const binDir = venvBin();
17
+ const exe = process.platform === "win32" ? "social_duo.exe" : "social_duo";
18
+ const cli = path.join(binDir, exe);
19
+
20
+ if (!fs.existsSync(cli)) {
21
+ console.error("social-duo is not installed. Try reinstalling the npm package.");
22
+ process.exit(1);
23
+ }
24
+
25
+ const args = process.argv.slice(2);
26
+ const result = spawnSync(cli, args, { stdio: "inherit" });
27
+ process.exit(result.status ?? 0);
28
+ }
29
+
30
+ main();
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "social-duo",
3
+ "version": "0.1.0",
4
+ "description": "MyVillage Network - Python CLI wrapper",
5
+ "bin": {
6
+ "social-duo": "npm/run.js"
7
+ },
8
+ "scripts": {
9
+ "postinstall": "node npm/install.js"
10
+ },
11
+ "files": [
12
+ "npm/**"
13
+ ],
14
+ "license": "MIT"
15
+ }