claude-world-studio 1.0.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.
Files changed (46) hide show
  1. package/.env.example +30 -0
  2. package/.mcp.json +51 -0
  3. package/README.md +224 -0
  4. package/client/App.tsx +446 -0
  5. package/client/components/ChatWindow.tsx +790 -0
  6. package/client/components/FileExplorer.tsx +218 -0
  7. package/client/components/FilePreviewModal.tsx +179 -0
  8. package/client/components/PublishDialog.tsx +307 -0
  9. package/client/components/SettingsPage.tsx +452 -0
  10. package/client/components/Sidebar.tsx +198 -0
  11. package/client/components/ToolUseBlock.tsx +140 -0
  12. package/client/index.html +12 -0
  13. package/client/index.tsx +10 -0
  14. package/client/styles/globals.css +48 -0
  15. package/demo/01-welcome.png +0 -0
  16. package/demo/02-pipeline-cards.png +0 -0
  17. package/demo/03-custom-topic-fill.png +0 -0
  18. package/demo/04-topic-typed.png +0 -0
  19. package/demo/05-loading-state.png +0 -0
  20. package/demo/06-tool-calls.png +0 -0
  21. package/demo/07-history-rich.png +0 -0
  22. package/demo/09-en-cards.png +0 -0
  23. package/demo/10-ja-cards.png +0 -0
  24. package/demo/capture-remaining.mjs +73 -0
  25. package/demo/capture.mjs +110 -0
  26. package/demo/demo-walkthrough-2.webm +0 -0
  27. package/demo/demo-walkthrough.webm +0 -0
  28. package/package.json +48 -0
  29. package/postcss.config.js +6 -0
  30. package/scripts/threads_api.py +536 -0
  31. package/server/ai-client.ts +356 -0
  32. package/server/db.ts +299 -0
  33. package/server/mcp-config.ts +85 -0
  34. package/server/routes/accounts.ts +88 -0
  35. package/server/routes/files.ts +175 -0
  36. package/server/routes/publish.ts +77 -0
  37. package/server/routes/sessions.ts +59 -0
  38. package/server/routes/settings.ts +220 -0
  39. package/server/server.ts +261 -0
  40. package/server/services/social-publisher.ts +74 -0
  41. package/server/services/studio-mcp.ts +107 -0
  42. package/server/session.ts +167 -0
  43. package/server/types.ts +86 -0
  44. package/tailwind.config.js +8 -0
  45. package/tsconfig.json +16 -0
  46. package/vite.config.ts +19 -0
package/.env.example ADDED
@@ -0,0 +1,30 @@
1
+ # Claude World Studio Configuration
2
+ # Copy to .env and fill in your values
3
+
4
+ # ─── Server ───
5
+ PORT=3001
6
+
7
+ # ─── MCP Servers (see Setup Guide in README) ───
8
+ # All are optional — the app works with any combination
9
+
10
+ # trend-pulse: real-time trends from 20 sources (zero auth needed)
11
+ # Setup: git clone + pip install
12
+ TREND_PULSE_PYTHON=/path/to/trend-pulse/.venv/bin/python
13
+
14
+ # cf-browser: Cloudflare Browser Rendering for JS pages
15
+ # Setup: git clone + Cloudflare Worker deploy
16
+ CF_BROWSER_PYTHON=/path/to/cf-browser/mcp-server/.venv/bin/python
17
+ CF_BROWSER_URL=https://your-cf-browser.workers.dev
18
+ CF_BROWSER_API_KEY=your-api-key
19
+
20
+ # notebooklm-skill: Google NotebookLM research + podcast/slides/video
21
+ # Setup: git clone + pip install + Google login
22
+ NOTEBOOKLM_SERVER_PATH=/path/to/notebooklm-skill/mcp-server/server.py
23
+
24
+ # ─── Social Publishing (optional) ───
25
+ # Configure via Settings UI instead of .env for easier management
26
+ # THREADS_TOKEN=your-threads-token
27
+ # THREADS_USER_ID=your-user-id
28
+
29
+ # ─── Workspace ───
30
+ DEFAULT_WORKSPACE=/path/to/your/workspace
package/.mcp.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "mcpServers": {
3
+ "filesystem": {
4
+ "type": "stdio",
5
+ "command": "npx",
6
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "."],
7
+ "env": {}
8
+ },
9
+ "sequential-thinking": {
10
+ "type": "stdio",
11
+ "command": "npx",
12
+ "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"],
13
+ "env": {}
14
+ },
15
+ "memory": {
16
+ "type": "stdio",
17
+ "command": "npx",
18
+ "args": ["-y", "@modelcontextprotocol/server-memory"],
19
+ "env": {
20
+ "MEMORY_FILE_PATH": "/Users/longweiwang/github/claude-code-community/.claude/memory.jsonl"
21
+ }
22
+ },
23
+ "agent-state": {
24
+ "type": "stdio",
25
+ "command": "node",
26
+ "args": ["agent-state/dist/index.js"],
27
+ "env": {
28
+ "AGENT_STATE_DB": ".claude/agent-state.db"
29
+ }
30
+ },
31
+ "richman": {
32
+ "type": "stdio",
33
+ "command": "npx",
34
+ "args": ["tsx", "06-demos/richman-mcp/src/index.ts"],
35
+ "env": {}
36
+ },
37
+ "playwright": {
38
+ "type": "stdio",
39
+ "command": "npx",
40
+ "args": ["-y", "@playwright/mcp@latest"],
41
+ "env": {}
42
+ },
43
+ "trend-pulse": {
44
+ "type": "stdio",
45
+ "command": "/Users/longweiwang/github/claude-code-community/trend-pulse/.venv/bin/python",
46
+ "args": ["-m", "trend_pulse.server"],
47
+ "env": {}
48
+
49
+ }
50
+ }
51
+ }
package/README.md ADDED
@@ -0,0 +1,224 @@
1
+ # Claude World Studio
2
+
3
+ AI-powered content pipeline: from trend discovery to social publishing.
4
+
5
+ Built with **Claude Agent SDK + MCP** (Model Context Protocol), featuring 3 integrated MCP servers for real-time trends, web scraping, and research automation.
6
+
7
+ ![Welcome Screen](demo/01-welcome.png)
8
+
9
+ ## Features
10
+
11
+ ### One-Stop Pipeline
12
+
13
+ Three clear entry points — no complex menus, just pick and go:
14
+
15
+ ![Pipeline Cards](demo/02-pipeline-cards.png)
16
+
17
+ | Card | Action | What happens |
18
+ |------|--------|-------------|
19
+ | **Freestyle** | One click, zero input | Auto: trends → read source → verify timeline → patent score → publish |
20
+ | **Custom Topic** | Type your topic | Deep research → score → publish |
21
+ | **Custom + Media** | Type your topic | Research → NotebookLM slides/video/podcast → publish |
22
+
23
+ ### Smart Input Fill
24
+
25
+ Click "Custom Topic" and the input auto-fills with a template prompt. A hint guides what to type:
26
+
27
+ ![Custom Topic](demo/03-custom-topic-fill.png)
28
+
29
+ ### Live Agent Execution
30
+
31
+ Watch Claude work in real-time — tool calls shown as collapsible blocks with MCP server badges. Loading state keeps the Stop button visible throughout long operations:
32
+
33
+ ![Loading State](demo/05-loading-state.png)
34
+
35
+ ![Tool Calls](demo/06-tool-calls.png)
36
+
37
+ - **trend-pulse** (green) — 20 real-time trend sources, zero auth
38
+ - **cf-browser** (blue) — Cloudflare Browser Rendering for JS pages
39
+ - **notebooklm** (purple) — Research + artifact generation (podcast/slides/video)
40
+
41
+ ### Rich Markdown Responses
42
+
43
+ Full markdown rendering with syntax highlighting, clickable source links, cost/duration tracking, and inline file path previews:
44
+
45
+ ![Rich Content](demo/07-history-rich.png)
46
+
47
+ ### Multi-Language (i18n)
48
+
49
+ Full support for Traditional Chinese, English, and Japanese — all pipeline cards, chips, UI labels, system prompts, and placeholder text adapt:
50
+
51
+ <table>
52
+ <tr>
53
+ <td><img src="demo/09-en-cards.png" alt="EN" width="400"/></td>
54
+ <td><img src="demo/10-ja-cards.png" alt="JA" width="400"/></td>
55
+ </tr>
56
+ <tr>
57
+ <td align="center">English</td>
58
+ <td align="center">Japanese</td>
59
+ </tr>
60
+ </table>
61
+
62
+ ### Social Publishing
63
+
64
+ Built-in publish flow with Meta's patent-based scoring. Every post is checked against 5 ranking dimensions before publishing:
65
+
66
+ | Dimension | Patent | What it checks |
67
+ |-----------|--------|---------------|
68
+ | Hook Power | EdgeRank | First line has number or contrast? (10-45 chars) |
69
+ | Engagement Trigger | Dear Algo | CTA anyone can answer? |
70
+ | Conversation Durability | 72hr window | Has both sides / contrast? |
71
+ | Velocity Potential | Andromeda | Short enough? Timely? |
72
+ | Format Score | Multi-modal | Mobile-scannable? |
73
+
74
+ Quality gates: Overall >= 70, Conversation Durability >= 55. Supports `--poll` for native polls, `--link-comment` to avoid URL reach penalty.
75
+
76
+ ### Source Verification & Timeline Rules
77
+
78
+ Content integrity is enforced at the system level:
79
+
80
+ - **Read original sources** — Never write from titles/metadata alone. At least 1 primary source per topic, 2+ for controversial topics.
81
+ - **Timeline verification** — Every fact gets a verified timestamp. Time words are mapped by age (today = "just now", 1-3 days = "recently", etc.).
82
+ - **No AI filler** — System prompt blocks generic phrases like "in today's world" / "it's worth noting".
83
+
84
+ ## Architecture
85
+
86
+ ```
87
+ ┌─────────────┐ ┌──────────────────┐ ┌─────────────────┐
88
+ │ React UI │────▶│ Express + WS │────▶│ Claude Agent │
89
+ │ (Vite) │◀────│ Server │◀────│ SDK │
90
+ └─────────────┘ └──────────────────┘ └────────┬────────┘
91
+
92
+ ┌──────────────────────────┤
93
+ │ │ │
94
+ ┌──────▼──┐ ┌──────▼───┐ ┌─────▼──────┐
95
+ │ trend- │ │ cf- │ │ notebooklm │
96
+ │ pulse │ │ browser │ │ │
97
+ │ (MCP) │ │ (MCP) │ │ (MCP) │
98
+ └─────────┘ └──────────┘ └────────────┘
99
+ 20 sources Cloudflare Podcast/Slides
100
+ zero auth Browser /Video/Report
101
+ ```
102
+
103
+ ## Tech Stack
104
+
105
+ | Layer | Tech |
106
+ |-------|------|
107
+ | Frontend | React 18 + Vite + Tailwind CSS |
108
+ | Backend | Express + WebSocket + Claude Agent SDK |
109
+ | AI Model | Claude Sonnet 4.6 |
110
+ | MCP Servers | trend-pulse, cf-browser, notebooklm |
111
+ | Database | SQLite (better-sqlite3) |
112
+ | Markdown | react-markdown + rehype-sanitize |
113
+
114
+ ## Prerequisites
115
+
116
+ - **Node.js** >= 18
117
+ - **Claude Code CLI** installed and authenticated (`npm install -g @anthropic-ai/claude-code`)
118
+ - **Python** 3.10+ (for MCP servers)
119
+
120
+ ## Setup Guide
121
+
122
+ ### Step 1: Install Claude World Studio
123
+
124
+ ```bash
125
+ git clone https://github.com/claude-world/claude-world-studio.git
126
+ cd claude-world-studio
127
+ npm install
128
+ cp .env.example .env
129
+ ```
130
+
131
+ ### Step 2: Set Up MCP Servers
132
+
133
+ The app uses 3 MCP servers — **all optional**, the app works with any combination. Set up what you need:
134
+
135
+ #### trend-pulse (Trend Discovery) — Recommended
136
+
137
+ Real-time trends from 20 sources (Google Trends, HN, Reddit, GitHub, etc). **Zero API keys needed.**
138
+
139
+ ```bash
140
+ git clone https://github.com/claude-world/trend-pulse.git
141
+ cd trend-pulse
142
+ python3 -m venv .venv
143
+ .venv/bin/pip install -e ".[mcp]"
144
+ ```
145
+
146
+ Add to `.env`:
147
+ ```
148
+ TREND_PULSE_PYTHON=/absolute/path/to/trend-pulse/.venv/bin/python
149
+ ```
150
+
151
+ #### cf-browser (Web Scraping) — Recommended
152
+
153
+ Cloudflare Browser Rendering for reading JS-rendered pages. Requires a free Cloudflare account.
154
+
155
+ ```bash
156
+ git clone https://github.com/claude-world/cf-browser.git
157
+ cd cf-browser
158
+ bash setup.sh # Deploys Worker + installs MCP server
159
+ ```
160
+
161
+ Add to `.env`:
162
+ ```
163
+ CF_BROWSER_PYTHON=/absolute/path/to/cf-browser/mcp-server/.venv/bin/python
164
+ CF_BROWSER_URL=https://your-cf-browser.workers.dev
165
+ CF_BROWSER_API_KEY=your-api-key
166
+ ```
167
+
168
+ See [cf-browser README](https://github.com/claude-world/cf-browser) for Cloudflare Worker setup.
169
+
170
+ #### notebooklm-skill (Research + Media) — Optional
171
+
172
+ Google NotebookLM integration for podcast, slides, video generation. Requires a Google account.
173
+
174
+ ```bash
175
+ git clone https://github.com/claude-world/notebooklm-skill.git
176
+ cd notebooklm-skill
177
+ pip install -r requirements.txt
178
+ python3 scripts/auth_helper.py # One-time Google login
179
+ ```
180
+
181
+ Add to `.env`:
182
+ ```
183
+ NOTEBOOKLM_SERVER_PATH=/absolute/path/to/notebooklm-skill/mcp-server/server.py
184
+ ```
185
+
186
+ ### Step 3: Start
187
+
188
+ ```bash
189
+ npm run dev
190
+ # Frontend: http://localhost:5173
191
+ # Backend: http://127.0.0.1:3001
192
+ ```
193
+
194
+ The app auto-detects which MCP servers are configured and enables them. Unconfigured servers are silently skipped.
195
+
196
+ ### Step 4: Configure Social Accounts (Optional)
197
+
198
+ To publish to Threads/Instagram, add accounts via **Settings > Social Accounts** in the UI. You'll need:
199
+ - A Meta Developer App with Threads/Instagram API access
200
+ - An access token (60-day expiry, renewable via OAuth)
201
+
202
+ ## Security
203
+
204
+ This is a **local-only development tool**. It runs Claude with full tool access on your machine.
205
+
206
+ - Binds to `127.0.0.1` only (not exposed to network)
207
+ - WebSocket origin verification (exact port whitelist)
208
+ - CORS restricted to localhost dev ports
209
+ - File API: async realpath + workspace containment check (TOCTOU-safe)
210
+ - Path traversal rejected on both client and server
211
+ - XSS protection via `rehype-sanitize`
212
+ - Session isolation: WS messages filtered by sessionId
213
+ - Idle session eviction (30min TTL)
214
+ - Query cancellation via AbortController on interrupt/eviction
215
+
216
+ > **Warning**: Do NOT expose this server to the internet. The AI agent has `Bash`, `Read`, `Write`, and `Edit` access to your filesystem.
217
+
218
+ ## Contributing
219
+
220
+ Issues and PRs welcome. Please open an issue first to discuss major changes.
221
+
222
+ ## License
223
+
224
+ MIT