@prplkane/roundtable 0.6.4 → 0.7.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/CHANGELOG.md +604 -529
- package/README.md +184 -189
- package/SECURITY.md +324 -299
- package/docs/workflow.md +1475 -1344
- package/package.json +2 -2
- package/scripts/agent.mjs +2 -2
- package/scripts/mcp.mjs +179 -175
- package/skills/roundtable/SKILL.md +62 -57
- package/src/adapters/acp.js +318 -0
- package/src/adapters/catalogue.js +37 -18
- package/src/adapters/common.js +1 -1
- package/src/adapters/config.js +18 -9
- package/src/adapters/index.js +2 -1
- package/src/adapters/models.js +32 -19
- package/src/adapters/spawn.js +3 -1
- package/src/agent-client.js +131 -108
- package/src/cli.js +21 -3
- package/src/diagnostics.js +1 -0
- package/src/doctor.js +7 -0
- package/src/engine.js +11 -7
- package/src/local-http.js +2 -2
- package/src/local-server.js +110 -110
- package/src/notes.js +8 -4
- package/src/preflight.js +26 -6
- package/src/prompts.js +1 -1
- package/src/review-view.js +15 -2
- package/src/seats.js +368 -272
- package/src/server.js +1010 -928
- package/src/snapshot.js +10 -3
- package/src/ui/app.js +2142 -1967
- package/src/ui/design/app.css +2 -1
- package/src/ui/index.html +276 -272
- package/src/validate.js +14 -4
package/src/validate.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// the seats module or the exporter sees it. Pure, so it is unit tested.
|
|
4
4
|
|
|
5
5
|
import { researchSettings } from './research.js';
|
|
6
|
+
import { agentLinkProfile } from './seats.js';
|
|
6
7
|
|
|
7
8
|
export const LIMITS = {
|
|
8
9
|
decision: 2000, option: 200, options: [2, 12], field: 4000, exportTo: 1024, seats: [2, 8], message: 4000,
|
|
@@ -71,6 +72,7 @@ export function validateDebateRequest(body, { adapters }) {
|
|
|
71
72
|
// an endpoint seat has no thread at the vendor to continue, so `resume` prompts would reach it
|
|
72
73
|
// with no context: refuse the table rather than run it on half-prompts
|
|
73
74
|
if (options_.memory === 'resume' && [...body.seats, body.chairman].some((s) => s && adapters[s.vendor]?.kind === 'api')) fail('memory', 'resume needs a session to continue, and an API endpoint seat has none; use stateless');
|
|
75
|
+
if (options_.memory === 'resume' && [...body.seats, body.chairman].some((s) => s && adapters[s.vendor]?.kind === 'acp')) fail('memory', 'ACP seats currently use fresh sessions; choose stateless');
|
|
74
76
|
if (o.strictTools != null) { if (o.strictTools !== true) fail('strictTools', 'the debate tool guard cannot be disabled'); options_.strictTools = true; }
|
|
75
77
|
if (o.allowLimitedIsolation != null) { if (typeof o.allowLimitedIsolation !== 'boolean') fail('allowLimitedIsolation', 'true or false'); options_.allowLimitedIsolation = o.allowLimitedIsolation; }
|
|
76
78
|
if (o.acknowledgeTermsRisk != null) { if (typeof o.acknowledgeTermsRisk !== 'boolean') fail('acknowledgeTermsRisk', 'true or false'); options_.acknowledgeTermsRisk = o.acknowledgeTermsRisk; }
|
|
@@ -78,11 +80,17 @@ export function validateDebateRequest(body, { adapters }) {
|
|
|
78
80
|
if (o.budget != null) {
|
|
79
81
|
if (typeof o.budget !== 'object' || Array.isArray(o.budget)) fail('budget', 'an object');
|
|
80
82
|
options_.budget = {};
|
|
81
|
-
for (const [
|
|
83
|
+
for (const [key, cap] of Object.entries(o.budget)) {
|
|
84
|
+
// a bare vendor caps every seat of that vendor; `acp@profile` caps one AgentLink profile
|
|
85
|
+
const at = key.indexOf('@'), vendor = at < 0 ? key : key.slice(0, at), profile = at < 0 ? null : key.slice(at + 1);
|
|
82
86
|
if (!adapters[vendor]) fail('budget', `unknown vendor ${vendor}`);
|
|
83
|
-
|
|
87
|
+
if (profile != null) {
|
|
88
|
+
if (adapters[vendor].kind !== 'acp') fail('budget', `${adapters[vendor].label} takes one budget for all its seats; use "${vendor}"`);
|
|
89
|
+
try { agentLinkProfile(profile); } catch (e) { fail('budget', `${key}: ${e.message}`); }
|
|
90
|
+
}
|
|
91
|
+
const tokens = amount(cap?.tokens, `${key} token cap`), usd = amount(cap?.usd, `${key} dollar cap`);
|
|
84
92
|
if (usd > 0 && !adapters[vendor].paths?.cost) fail('budget', `${adapters[vendor].label} does not report cost, so it cannot take a dollar cap`);
|
|
85
|
-
options_.budget[
|
|
93
|
+
options_.budget[key] = { ...(tokens != null ? { tokens } : {}), ...(usd != null ? { usd } : {}) };
|
|
86
94
|
}
|
|
87
95
|
}
|
|
88
96
|
return { fieldNotes, seats: body.seats, chairman: body.chairman ?? null, options: options_ };
|
|
@@ -98,7 +106,9 @@ export function validateMessage(body) {
|
|
|
98
106
|
if (body.answers != null) {
|
|
99
107
|
if (!Array.isArray(body.answers) || body.answers.length > LIMITS.answers) fail('answers', `a list of at most ${LIMITS.answers} answers`);
|
|
100
108
|
if (body.round == null) fail('round', 'required with answers');
|
|
101
|
-
out.answers = body.answers.map((a) => ({ id: str(a?.id, 'question id', LIMITS.questionId, { required: true }), text: str(a?.text, 'answer', LIMITS.answer)
|
|
109
|
+
out.answers = body.answers.map((a) => ({ id: str(a?.id, 'question id', LIMITS.questionId, { required: true }), text: str(a?.text, 'answer', LIMITS.answer),
|
|
110
|
+
// who wrote the answer: declared by an agent client, defaulting to the assistant itself
|
|
111
|
+
from: a?.from == null ? 'assistant' : ['user', 'assistant'].includes(a.from) ? a.from : fail('from', 'user or assistant') }));
|
|
102
112
|
}
|
|
103
113
|
return out;
|
|
104
114
|
}
|