@profullstack/board-saas 0.2.2 → 0.2.4
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 +1 -1
- package/package.json +1 -1
- package/public/icon.png +0 -0
- package/src/llm.js +13 -4
- package/src/mcp.js +8 -8
- package/src/server.js +10 -0
package/README.md
CHANGED
|
@@ -103,7 +103,7 @@ Node 22.6+ (uses `node:sqlite`). Configuration comes from the logicsrc vault
|
|
|
103
103
|
`profullstack/board-saas--prod` (synced into an env file by `deploy/deploy.sh`):
|
|
104
104
|
`C0MPUTE_API_KEY`, `C0MPUTE_MODELS`, `RESEND_API_KEY`, `BOARD_SAAS_ADMIN_KEY`,
|
|
105
105
|
`COINPAY_API_URL`, `COINPAY_BUSINESS_ID`, `COINPAY_API_KEY`, `COINPAY_WEBHOOK_SECRET`.
|
|
106
|
-
Optional: `C0MPUTE_SITE_URL` (the c0mpute-hosted copy of the front page), `PORT`,
|
|
106
|
+
Optional: `C0MPUTE_CONCURRENCY` (parallel c0mpute calls, default 2), `C0MPUTE_SITE_URL` (the c0mpute-hosted copy of the front page), `PORT`,
|
|
107
107
|
`BOARD_DB`, `PUBLIC_URL`.
|
|
108
108
|
|
|
109
109
|
```sh
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@profullstack/board-saas",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Board as a Service: paste a decision brief, five AI advisors (CFO, Growth, Operator, Founder-Time, Contrarian) debate it in three rounds and a chair writes the minutes. Web, HTTP API, CLI, TUI and MCP. Runs on c0mpute.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/public/icon.png
ADDED
|
Binary file
|
package/src/llm.js
CHANGED
|
@@ -5,14 +5,21 @@
|
|
|
5
5
|
import { C0mputeProvider } from '@profullstack/ai-providers';
|
|
6
6
|
import { extractJson } from './validate.js';
|
|
7
7
|
|
|
8
|
-
// The
|
|
9
|
-
//
|
|
8
|
+
// The 9B first, for quality: it answers in about 7-14 s on the network's funded GPU (a Vast RTX
|
|
9
|
+
// 3060), and the 4B models gave shallow minutes (a "strongest dissent" that agreed with the
|
|
10
|
+
// majority). The 4B CPU house models are the fallback when the 9B is busy or no node serves it.
|
|
10
11
|
const DEFAULT_MODELS = [
|
|
12
|
+
'eriktonon/qwen3.8-uncensored:9b',
|
|
11
13
|
'huihui_ai/qwen3.5-abliterated:4b',
|
|
12
14
|
'qwen3:4b',
|
|
13
|
-
'eriktonon/qwen3.8-uncensored:9b',
|
|
14
15
|
];
|
|
15
16
|
|
|
17
|
+
// Two calls at a time by default: the one 9B GPU runs two jobs in parallel (Ollama
|
|
18
|
+
// NUM_PARALLEL=2) and also writes OutreachGraph's emails, so five parallel round-1 calls would
|
|
19
|
+
// queue behind each other on it, spill onto CPU nodes at minutes per answer, and starve
|
|
20
|
+
// OutreachGraph. C0MPUTE_CONCURRENCY overrides it.
|
|
21
|
+
const DEFAULT_CONCURRENCY = 2;
|
|
22
|
+
|
|
16
23
|
export function createModel(env = process.env) {
|
|
17
24
|
const listed = (env.C0MPUTE_MODELS || '').split(',').map((s) => s.trim()).filter(Boolean);
|
|
18
25
|
const models = listed.length ? listed : DEFAULT_MODELS;
|
|
@@ -20,7 +27,7 @@ export function createModel(env = process.env) {
|
|
|
20
27
|
apiKey: env.C0MPUTE_API_KEY,
|
|
21
28
|
baseUrl: env.C0MPUTE_URL || undefined,
|
|
22
29
|
models,
|
|
23
|
-
concurrency: Number(env.C0MPUTE_CONCURRENCY) ||
|
|
30
|
+
concurrency: Number(env.C0MPUTE_CONCURRENCY) || DEFAULT_CONCURRENCY,
|
|
24
31
|
timeoutMs: Number(env.C0MPUTE_TIMEOUT_MS) || 540_000,
|
|
25
32
|
stallMs: Number(env.C0MPUTE_STALL_MS) || 120_000,
|
|
26
33
|
});
|
|
@@ -72,7 +79,9 @@ export async function askJson(model, { system, user, maxTokens, validate, log =
|
|
|
72
79
|
attempt === 1
|
|
73
80
|
? user
|
|
74
81
|
: `${user}\n\nYour previous reply could not be used: ${lastError}. Reply again with ONLY the JSON object, no prose, no code fences.`;
|
|
82
|
+
const t0 = Date.now();
|
|
75
83
|
const out = await generateWithPatience(model, { system, user: prompt, maxTokens, temperature: 0.4 }, { log, patienceMs });
|
|
84
|
+
log(`answered by ${out.model} in ${((Date.now() - t0) / 1000).toFixed(1)}s`);
|
|
76
85
|
lastRaw = out.text;
|
|
77
86
|
let parsed;
|
|
78
87
|
try {
|
package/src/mcp.js
CHANGED
|
@@ -9,17 +9,17 @@ export const TOOLS = [
|
|
|
9
9
|
title: 'Run a board meeting',
|
|
10
10
|
annotations: { title: 'Run a board meeting', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
11
11
|
description:
|
|
12
|
-
'
|
|
12
|
+
'Starts a board meeting on a decision brief: five AI advisors (CFO, Growth Marketer, Operator, Founder-Time Strategist, Contrarian Investor) give verdicts and debate, and a chair writes the minutes. Returns the meeting id, its status (queued, needs_clarification, awaiting_payment, running, done, failed) and its shareable URL. A meeting takes about 2 to 6 minutes. With status awaiting_payment the result carries a checkout_url for the $9 meeting fee (the first meeting per account is free); with needs_clarification it carries the chair\'s questions. The advisors are AI models, not real directors.',
|
|
13
13
|
inputSchema: {
|
|
14
14
|
type: 'object',
|
|
15
15
|
properties: {
|
|
16
16
|
brief: { type: 'string', description: 'The decision, the options (at least two; "do nothing" counts) and the constraints (budget, time, team).' },
|
|
17
17
|
company_data: {
|
|
18
18
|
description:
|
|
19
|
-
'Optional company
|
|
19
|
+
'Optional company figures every advisor reads with the brief: P&L and balance sheet totals, cash, burn, runway, MRR, churn, pipeline, headcount. Text or a JSON object, at most 12000 characters. Not shown on the shareable report.',
|
|
20
20
|
anyOf: [{ type: 'string' }, { type: 'object' }],
|
|
21
21
|
},
|
|
22
|
-
wait_seconds: { type: 'number', description: '
|
|
22
|
+
wait_seconds: { type: 'number', description: 'Seconds (at most 50) the call holds before returning, in case the meeting finishes sooner. Default 0.' },
|
|
23
23
|
},
|
|
24
24
|
required: ['brief'],
|
|
25
25
|
},
|
|
@@ -29,7 +29,7 @@ export const TOOLS = [
|
|
|
29
29
|
title: 'Get a board meeting',
|
|
30
30
|
annotations: { title: 'Get a board meeting', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
31
31
|
description:
|
|
32
|
-
'
|
|
32
|
+
'Reads a board meeting by id: status (queued, checking, needs_clarification, awaiting_payment, running, done, failed), progress, and when done the full meeting (five verdicts, the debate, the chair\'s minutes with vote, clashes, strongest dissent, recommendation and the one open question) plus report_url and download_url.',
|
|
33
33
|
inputSchema: {
|
|
34
34
|
type: 'object',
|
|
35
35
|
properties: {
|
|
@@ -43,14 +43,14 @@ export const TOOLS = [
|
|
|
43
43
|
name: 'list_meetings',
|
|
44
44
|
title: 'List board meetings',
|
|
45
45
|
annotations: { title: 'List board meetings', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
46
|
-
description: '
|
|
46
|
+
description: 'Lists the signed-in account\'s board meetings, newest first: id, status, created_at and the start of each brief.',
|
|
47
47
|
inputSchema: { type: 'object', properties: {} },
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
name: 'clarify_meeting',
|
|
51
51
|
title: 'Answer the chair',
|
|
52
52
|
annotations: { title: 'Answer the chair', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
53
|
-
description: '
|
|
53
|
+
description: 'Records answers to the chair\'s one round of questions on a meeting whose status is needs_clarification, and starts the meeting. Anything left unanswered becomes a written assumption. Returns the meeting\'s new status.',
|
|
54
54
|
inputSchema: {
|
|
55
55
|
type: 'object',
|
|
56
56
|
properties: {
|
|
@@ -64,7 +64,7 @@ export const TOOLS = [
|
|
|
64
64
|
name: 'get_account',
|
|
65
65
|
title: 'Get account',
|
|
66
66
|
annotations: { title: 'Get account', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
67
|
-
description: '
|
|
67
|
+
description: 'Returns the signed-in account: email, whether the free meeting is still available, paid credits left and the price of the next meeting.',
|
|
68
68
|
inputSchema: { type: 'object', properties: {} },
|
|
69
69
|
},
|
|
70
70
|
];
|
|
@@ -135,7 +135,7 @@ export function createMcpHandler(impl, { name = 'board-saas', version = '0.1.0'
|
|
|
135
135
|
protocolVersion: msg.params?.protocolVersion || PROTOCOL_VERSION,
|
|
136
136
|
capabilities: { tools: { listChanged: false } },
|
|
137
137
|
serverInfo: { name, version },
|
|
138
|
-
instructions: 'Board as a Service: run_meeting convenes five AI advisors (CFO, Growth Marketer, Operator, Founder-Time Strategist, Contrarian Investor) and a chair on a decision brief
|
|
138
|
+
instructions: 'Board as a Service: run_meeting convenes five AI advisors (CFO, Growth Marketer, Operator, Founder-Time Strategist, Contrarian Investor) and a chair on a decision brief. company_data takes the company\'s figures (summary P&L, cash, runway, MRR, churn) so the CFO works from real numbers. A meeting takes 2 to 6 minutes: get_meeting reads it until status is done. awaiting_payment means the user needs to open checkout_url; needs_clarification means the chair has questions for the user, answered with clarify_meeting. list_meetings lists past meetings. The advisors are AI models on the c0mpute network, not real directors.',
|
|
139
139
|
});
|
|
140
140
|
case 'notifications/initialized':
|
|
141
141
|
case 'notifications/cancelled':
|
package/src/server.js
CHANGED
|
@@ -19,6 +19,12 @@ const ROOT = fileURLToPath(new URL('..', import.meta.url));
|
|
|
19
19
|
const VERSION = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf8')).version;
|
|
20
20
|
const TYPES = { '.html': 'text/html; charset=utf-8', '.css': 'text/css; charset=utf-8', '.js': 'text/javascript; charset=utf-8', '.svg': 'image/svg+xml', '.json': 'application/json', '.txt': 'text/plain; charset=utf-8' };
|
|
21
21
|
const STATIC = new Set(['/index.html', '/style.css', '/app.js']);
|
|
22
|
+
const ICON_PNG = readFileSync(join(ROOT, 'public/icon.png'));
|
|
23
|
+
const ICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect width="32" height="32" rx="7" fill="#2f5bd3"/><circle cx="9" cy="12" r="3" fill="white"/><circle cx="16" cy="10" r="3" fill="white"/><circle cx="23" cy="12" r="3" fill="white"/><rect x="6" y="18" width="20" height="5" rx="2" fill="white"/></svg>`;
|
|
24
|
+
function sendIcon(res) {
|
|
25
|
+
res.writeHead(200, { 'content-type': 'image/png', 'content-length': ICON_PNG.length, 'cache-control': 'public, max-age=86400' });
|
|
26
|
+
res.end(ICON_PNG);
|
|
27
|
+
}
|
|
22
28
|
|
|
23
29
|
export const API_DOCS = {
|
|
24
30
|
name: 'Board as a Service API',
|
|
@@ -306,6 +312,10 @@ export function createApp({ env = process.env, db, model, mailer, fetchImpl = fe
|
|
|
306
312
|
return send(res, 200, `#!/bin/sh\n# Board as a Service CLI: board-saas\nset -e\ncommand -v npm >/dev/null 2>&1 || { echo "board-saas needs Node 22+ and npm: https://nodejs.org" >&2; exit 1; }\nnpm install -g @profullstack/board-saas\necho "installed: run 'board-saas login you@example.com' then 'board-saas meet \\"<brief>\\"'"\n`, { 'content-type': 'text/x-shellscript; charset=utf-8' });
|
|
307
313
|
}
|
|
308
314
|
|
|
315
|
+
// A fetchable icon for directories and browsers (the page itself uses an inline one).
|
|
316
|
+
if (path === '/favicon.ico' || path === '/icon.png' || path === '/apple-touch-icon.png') return sendIcon(res);
|
|
317
|
+
if (path === '/favicon.svg') return send(res, 200, ICON_SVG, { 'content-type': 'image/svg+xml', 'cache-control': 'public, max-age=86400' });
|
|
318
|
+
|
|
309
319
|
if (path === '/robots.txt') return send(res, 200, 'User-agent: *\nAllow: /\nDisallow: /m/\nDisallow: /api/\nDisallow: /oauth/\n', { 'content-type': 'text/plain' });
|
|
310
320
|
|
|
311
321
|
// OAuth discovery: RFC 9728 (resource) at the root and path forms, RFC 8414 (server).
|