50c 1.2.0 → 1.4.1

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 (3) hide show
  1. package/README.md +65 -4
  2. package/bin/50c.js +52 -66
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -153,24 +153,85 @@ When run without arguments, starts JSON-RPC server on stdin/stdout.
153
153
 
154
154
  ---
155
155
 
156
- ## HTTP API
156
+ ## Unified API: genxis.one
157
157
 
158
- Direct access at `https://genxis.one`:
158
+ **One bare root. Every capability. Streaming-first.**
159
+
160
+ `https://genxis.one` is the unified gateway—no versioned paths, no fragmented endpoints. Just POST to root.
161
+
162
+ ### Why This Matters
163
+
164
+ Traditional APIs scatter functionality across dozens of endpoints. We plant the flag for the future: **one URL, infinite capabilities, streaming by default.**
165
+
166
+ ```
167
+ POST https://genxis.one
168
+ ```
169
+
170
+ That's it. The body determines everything.
171
+
172
+ ### Single Tool Call
159
173
 
160
174
  ```bash
161
175
  curl -X POST https://genxis.one \
162
176
  -H "Content-Type: application/json" \
163
177
  -d '{"m": "genius", "q": "your problem"}'
178
+ ```
164
179
 
165
- # Recipe chains
180
+ ### Recipe Chains (Composable AI)
181
+
182
+ Chain multiple tools in one request. Output flows through each step:
183
+
184
+ ```bash
166
185
  curl -X POST https://genxis.one \
186
+ -H "Content-Type: application/json" \
167
187
  -d '{"chain": ["vibe", "hints+"], "q": "your idea"}'
188
+ ```
189
+
190
+ ### Parallel Execution
191
+
192
+ Run multiple tools simultaneously:
193
+
194
+ ```bash
195
+ curl -X POST https://genxis.one \
196
+ -H "Content-Type: application/json" \
197
+ -d '{"parallel": ["hints", "vibe"], "q": "your idea"}'
198
+ ```
199
+
200
+ ### Streaming (SSE)
201
+
202
+ Add `"stream": true` to any request for server-sent events:
203
+
204
+ ```bash
205
+ curl -X POST https://genxis.one \
206
+ -H "Content-Type: application/json" \
207
+ -d '{"m": "genius", "q": "problem", "stream": true}'
208
+ ```
209
+
210
+ ### OpenAI-Compatible
211
+
212
+ Drop-in replacement for existing integrations:
168
213
 
169
- # OpenAI-compatible
214
+ ```bash
170
215
  curl -X POST https://genxis.one/v1/chat/completions \
216
+ -H "Content-Type: application/json" \
171
217
  -d '{"model": "50c-genius", "messages": [{"role": "user", "content": "problem"}]}'
172
218
  ```
173
219
 
220
+ ### Available Models
221
+
222
+ | Model | Cost | Use Case |
223
+ |-------|------|----------|
224
+ | `genius` | $0.50 | Deep problem solving |
225
+ | `hints` | $0.05 | 5 brutal 2-word hints |
226
+ | `hints+` | $0.10 | 10 expanded 4-word hints |
227
+ | `vibe` | $0.05 | 3 unconventional ideas |
228
+ | `one-liner` | $0.02 | 8-word elevator pitch |
229
+ | `roast` | $0.05 | Brutal code review |
230
+ | `name-it` | $0.03 | 5 names + domain check |
231
+ | `price-it` | $0.05 | SaaS pricing strategy |
232
+ | `compute` | $0.02 | Execute Python code |
233
+ | `mind-opener` | $0.08 | 5 curious angles |
234
+
174
235
  ---
175
236
 
176
237
  ## Environment Variables
package/bin/50c.js CHANGED
@@ -2,7 +2,7 @@
2
2
  const https = require('https');
3
3
  const readline = require('readline');
4
4
 
5
- const API_ENDPOINT = process.env.FIFTYC_ENDPOINT || 'https://genxis.one';
5
+ const API_ENDPOINT = process.env.FIFTYC_ENDPOINT || 'https://50c.ai';
6
6
  const MCP_ENDPOINT = API_ENDPOINT + '/mcp';
7
7
  const API_KEY = process.env.FIFTYC_API_KEY;
8
8
 
@@ -12,7 +12,7 @@ if (process.argv.includes('--version') || process.argv.includes('-v')) {
12
12
  process.exit(0);
13
13
  }
14
14
 
15
- // Help (only show if explicitly requested or if running interactively with no args)
15
+ // Help
16
16
  if (process.argv.includes('--help') || process.argv.includes('-h')) {
17
17
  showHelp();
18
18
  process.exit(0);
@@ -23,7 +23,7 @@ function showHelp() {
23
23
  50c - AI Augmentation CLI & MCP Server
24
24
 
25
25
  USAGE:
26
- 50c <command> <input> Direct CLI mode (for agents)
26
+ 50c <command> <input> Direct CLI mode
27
27
  50c MCP mode (JSON-RPC via stdin)
28
28
 
29
29
  COMMANDS:
@@ -31,37 +31,44 @@ COMMANDS:
31
31
  hints <topic> 5 brutal 2-word hints ($0.05)
32
32
  hints+ <topic> 10 expanded hints ($0.10)
33
33
  vibe <working_on> 3 unconventional ideas ($0.05)
34
+ one-liner <product> Elevator pitch in 8 words ($0.02)
35
+ roast <code> Brutal code review ($0.05)
36
+ name-it <does> 5 names + domain check ($0.03)
37
+ price-it <product> SaaS pricing strategy ($0.05)
38
+ compute <code> Execute Python code ($0.02)
34
39
 
35
40
  EXAMPLES:
36
41
  50c genius "How do I scale PostgreSQL?"
37
42
  50c hints "api design"
38
- 50c hints+ "microservices"
39
- 50c vibe "building a CLI tool"
43
+ 50c one-liner "habit tracker with friends"
44
+ 50c roast "const x = localStorage.getItem('jwt')"
45
+ 50c name-it "AI that writes emails"
46
+ 50c price-it "email automation SaaS"
40
47
 
41
48
  ENVIRONMENT:
42
49
  FIFTYC_API_KEY Your API key (required)
43
- FIFTYC_ENDPOINT Custom endpoint (optional)
50
+ FIFTYC_ENDPOINT Custom endpoint (default: https://50c.ai)
44
51
 
45
52
  MCP MODE:
46
- When run without arguments, starts JSON-RPC server on stdin/stdout
47
- for IDE integration (Claude Desktop, Cursor, VS Code, etc.)
53
+ Run without arguments for IDE integration (Claude Desktop, Cursor, etc.)
48
54
  `);
49
55
  }
50
56
 
51
57
  // Check API key
52
58
  if (!API_KEY) {
53
59
  console.error('Error: FIFTYC_API_KEY environment variable required');
60
+ console.error('Get your key at: https://50c.ai');
54
61
  process.exit(1);
55
62
  }
56
63
 
57
- // CLI mode - direct commands
64
+ // CLI commands
65
+ const COMMANDS = ['genius', 'hints', 'hints+', 'vibe', 'compute', 'one-liner', 'roast', 'name-it', 'price-it', 'mind-opener'];
58
66
  const command = process.argv[2];
59
67
  const input = process.argv.slice(3).join(' ');
60
68
 
61
- if (command && ['genius', 'hints', 'hints+', 'vibe'].includes(command)) {
69
+ if (command && COMMANDS.includes(command)) {
62
70
  if (!input) {
63
71
  console.error(`Error: ${command} requires input`);
64
- console.error(`Usage: 50c ${command} "your input here"`);
65
72
  process.exit(1);
66
73
  }
67
74
 
@@ -73,68 +80,46 @@ if (command && ['genius', 'hints', 'hints+', 'vibe'].includes(command)) {
73
80
  process.exit(1);
74
81
  });
75
82
  } else if (command) {
76
- // Unknown command - maybe MCP mode with piped input
77
- // Fall through to MCP mode
78
83
  startMCPMode();
79
84
  } else {
80
- // No command - MCP mode
81
85
  startMCPMode();
82
86
  }
83
87
 
84
88
  async function runCLI(cmd, query) {
85
- const modelMap = {
86
- 'genius': 'genius',
87
- 'hints': 'hints',
88
- 'hints+': 'hints+',
89
- 'vibe': 'vibe'
89
+ // Map CLI commands to MCP tool names
90
+ const toolMap = {
91
+ 'genius': { name: 'genius', arg: 'problem' },
92
+ 'hints': { name: 'hints', arg: 'query' },
93
+ 'hints+': { name: 'hints_plus', arg: 'query' },
94
+ 'vibe': { name: 'quick_vibe', arg: 'working_on' },
95
+ 'compute': { name: 'compute', arg: 'code' },
96
+ 'one-liner': { name: 'one_liner', arg: 'product' },
97
+ 'roast': { name: 'roast', arg: 'code' },
98
+ 'name-it': { name: 'name_it', arg: 'does' },
99
+ 'price-it': { name: 'price_it', arg: 'product' },
100
+ 'mind-opener': { name: 'mind_opener', arg: 'problem' }
90
101
  };
91
102
 
92
- const body = { m: modelMap[cmd], q: query };
103
+ const tool = toolMap[cmd];
104
+ if (!tool) throw new Error(`Unknown command: ${cmd}`);
93
105
 
94
- return new Promise((resolve, reject) => {
95
- const url = new URL(API_ENDPOINT);
96
- const postData = JSON.stringify(body);
97
-
98
- const options = {
99
- hostname: url.hostname,
100
- port: url.port || 443,
101
- path: '/',
102
- method: 'POST',
103
- headers: {
104
- 'Content-Type': 'application/json',
105
- 'Content-Length': Buffer.byteLength(postData),
106
- 'Authorization': `Bearer ${API_KEY}`
107
- }
108
- };
109
-
110
- const req = https.request(options, (res) => {
111
- let data = '';
112
- res.on('data', chunk => data += chunk);
113
- res.on('end', () => {
114
- try {
115
- const json = JSON.parse(data);
116
- if (json.error) {
117
- reject(new Error(json.error));
118
- } else if (json.out) {
119
- resolve(json.out);
120
- } else {
121
- resolve(JSON.stringify(json, null, 2));
122
- }
123
- } catch (e) {
124
- reject(new Error(`Invalid response: ${data.substring(0, 200)}`));
125
- }
126
- });
127
- });
128
-
129
- req.setTimeout(60000, () => {
130
- req.destroy();
131
- reject(new Error('Request timeout'));
132
- });
133
-
134
- req.on('error', reject);
135
- req.write(postData);
136
- req.end();
137
- });
106
+ const request = {
107
+ jsonrpc: '2.0',
108
+ id: 1,
109
+ method: 'tools/call',
110
+ params: {
111
+ name: tool.name,
112
+ arguments: { [tool.arg]: query }
113
+ }
114
+ };
115
+
116
+ const response = await callRemoteMCP(request);
117
+
118
+ if (response.error) {
119
+ throw new Error(response.error.message || JSON.stringify(response.error));
120
+ }
121
+
122
+ return response.result?.content?.[0]?.text || 'No output';
138
123
  }
139
124
 
140
125
  function startMCPMode() {
@@ -170,7 +155,8 @@ function callRemoteMCP(request) {
170
155
  headers: {
171
156
  'Content-Type': 'application/json',
172
157
  'Content-Length': Buffer.byteLength(postData),
173
- 'Authorization': `Bearer ${API_KEY}`
158
+ 'Authorization': `Bearer ${API_KEY}`,
159
+ 'User-Agent': '50c-cli/1.4.0'
174
160
  }
175
161
  };
176
162
 
@@ -186,7 +172,7 @@ function callRemoteMCP(request) {
186
172
  });
187
173
  });
188
174
 
189
- req.setTimeout(60000, () => {
175
+ req.setTimeout(120000, () => {
190
176
  req.destroy();
191
177
  reject(new Error('Request timeout'));
192
178
  });
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "50c",
3
- "version": "1.2.0",
4
- "description": "AI augmentation CLI & MCP server. genius=$0.50, hints=$0.05, hints+=$0.10, vibe=$0.05.",
3
+ "version": "1.4.1",
4
+ "description": "AI augmentation CLI & MCP server. genius, hints, roast, one-liner, name-it, price-it + more.",
5
5
  "bin": {
6
6
  "50c": "./bin/50c.js"
7
7
  },
8
8
  "scripts": {
9
9
  "postinstall": "node -e \"console.log('\\n50c installed. Set FIFTYC_API_KEY env var.\\n')\""
10
10
  },
11
- "keywords": ["mcp", "ai", "llm", "cli", "agent", "genxis", "50c", "intelligence", "problem-solving", "hints", "genius"],
11
+ "keywords": ["mcp", "ai", "llm", "cli", "agent", "genxis", "50c", "intelligence", "problem-solving", "hints", "genius", "compute"],
12
12
  "author": "genxis",
13
13
  "license": "SEE LICENSE IN LICENSE",
14
- "homepage": "https://genxis.one",
14
+ "homepage": "https://50c.ai",
15
15
  "engines": {
16
16
  "node": ">=18.0.0"
17
17
  },