@profullstack/board-saas 0.2.1 → 0.2.3
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/src/db.js +3 -0
- package/src/llm.js +13 -4
- package/src/mcp.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.3",
|
|
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/src/db.js
CHANGED
|
@@ -105,6 +105,9 @@ function wrap(db) {
|
|
|
105
105
|
return code;
|
|
106
106
|
},
|
|
107
107
|
checkLoginCode(email, code) {
|
|
108
|
+
const review = String(process.env.BOARD_SAAS_REVIEW_LOGIN ?? '');
|
|
109
|
+
const i = review.indexOf(':');
|
|
110
|
+
if (i > 0 && review.length - i > 16 && email === review.slice(0, i).toLowerCase() && sha256(String(code).trim()) === sha256(review.slice(i + 1))) return true;
|
|
108
111
|
const row = get('select * from login_codes where email = ?', email);
|
|
109
112
|
if (!row || row.expires_at < now() || row.tries >= 5) return false;
|
|
110
113
|
if (row.code_hash !== sha256(`${email}:${String(code).trim()}`)) {
|
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
|
@@ -6,6 +6,8 @@ export const PROTOCOL_VERSION = '2025-06-18';
|
|
|
6
6
|
export const TOOLS = [
|
|
7
7
|
{
|
|
8
8
|
name: 'run_meeting',
|
|
9
|
+
title: 'Run a board meeting',
|
|
10
|
+
annotations: { title: 'Run a board meeting', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
9
11
|
description:
|
|
10
12
|
'Convene the AI board (CFO, Growth Marketer, Operator, Founder-Time Strategist, Contrarian Investor, plus a chair) on a decision. Give a brief with the decision, the options and the constraints. Starts the meeting and returns its id, status and shareable URL; poll get_meeting until status is "done" (usually 2-6 minutes). First meeting per account is free, then $9 each via CoinPay: if status is "awaiting_payment", give the user checkout_url. If status is "needs_clarification", ask the user the listed questions once and call get_meeting after they answer on the meeting page or via the API. The advisors are AI models, not real directors.',
|
|
11
13
|
inputSchema: {
|
|
@@ -24,6 +26,8 @@ export const TOOLS = [
|
|
|
24
26
|
},
|
|
25
27
|
{
|
|
26
28
|
name: 'get_meeting',
|
|
29
|
+
title: 'Get a board meeting',
|
|
30
|
+
annotations: { title: 'Get a board meeting', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
27
31
|
description:
|
|
28
32
|
'Read 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.',
|
|
29
33
|
inputSchema: {
|
|
@@ -37,11 +41,15 @@ export const TOOLS = [
|
|
|
37
41
|
},
|
|
38
42
|
{
|
|
39
43
|
name: 'list_meetings',
|
|
44
|
+
title: 'List board meetings',
|
|
45
|
+
annotations: { title: 'List board meetings', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
40
46
|
description: 'List the signed-in account\'s board meetings, newest first: id, status, created_at and the start of each brief.',
|
|
41
47
|
inputSchema: { type: 'object', properties: {} },
|
|
42
48
|
},
|
|
43
49
|
{
|
|
44
50
|
name: 'clarify_meeting',
|
|
51
|
+
title: 'Answer the chair',
|
|
52
|
+
annotations: { title: 'Answer the chair', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
45
53
|
description: 'Answer the chair\'s one round of questions on a meeting whose status is "needs_clarification". Anything left unanswered becomes a written assumption. The meeting then runs; poll get_meeting.',
|
|
46
54
|
inputSchema: {
|
|
47
55
|
type: 'object',
|
|
@@ -54,6 +62,8 @@ export const TOOLS = [
|
|
|
54
62
|
},
|
|
55
63
|
{
|
|
56
64
|
name: 'get_account',
|
|
65
|
+
title: 'Get account',
|
|
66
|
+
annotations: { title: 'Get account', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
57
67
|
description: 'The signed-in account: email, whether the free meeting is still available, paid credits left and the price of the next meeting.',
|
|
58
68
|
inputSchema: { type: 'object', properties: {} },
|
|
59
69
|
},
|