@prplkane/roundtable 0.6.4 → 0.6.6

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/src/notes.js CHANGED
@@ -1,9 +1,11 @@
1
1
  // Note sources are declared by the client, not authenticated identities. Keep legacy human
2
- // strings readable while retaining attribution on notes submitted by the agent client.
2
+ // strings readable while retaining attribution on notes submitted by the agent client:
3
+ // 'agent' is the assistant's own note, 'relayed' the user's answers as the assistant reported them.
4
+ export const SOURCES = ['human', 'agent', 'relayed'];
3
5
  export function noteRecord(note) {
4
6
  return {
5
7
  text: typeof note === 'string' ? note : String(note?.text || ''),
6
- source: note?.source === 'agent' ? 'agent' : 'human',
8
+ source: SOURCES.includes(note?.source) ? note.source : 'human',
7
9
  };
8
10
  }
9
11
 
@@ -12,5 +14,7 @@ export function storedNote(note) {
12
14
  return record.source === 'human' ? record.text : record;
13
15
  }
14
16
 
15
- export const noteAuthor = (note) => noteRecord(note).source === 'agent' ? 'Agent coordinator' : 'Human';
16
- export const noteLabel = (note) => noteRecord(note).source === 'agent' ? 'Agent note' : 'You said';
17
+ const AUTHORS = { human: 'Human', agent: 'Agent coordinator', relayed: 'Human (relayed by the assistant)' };
18
+ const LABELS = { human: 'You said', agent: 'Agent note', relayed: 'You said, via your assistant' };
19
+ export const noteAuthor = (note) => AUTHORS[noteRecord(note).source];
20
+ export const noteLabel = (note) => LABELS[noteRecord(note).source];
package/src/prompts.js CHANGED
@@ -102,7 +102,7 @@ export function statelessPrefix({ fieldNotes, lens, mood, seatCount, unattended
102
102
  export function notesBlock(notes) {
103
103
  const list = (notes || []).filter((n) => n?.text && n.text.trim());
104
104
  if (!list.length) return [];
105
- return ['### Discussion notes (agent notes are not human answers)', ...list.map((n, i) => inputRecord('note', n.text, {
105
+ return ['### Discussion notes (a relayed note is the human\'s answer as their assistant reported it; an agent note is the assistant\'s own and not a human answer)', ...list.map((n, i) => inputRecord('note', n.text, {
106
106
  author: noteAuthor(n), source: noteRecord(n).source, round: n.round,
107
107
  after: n.round < 0 ? 'Before round 0' : `After round ${n.round}`, latest: i === list.length - 1,
108
108
  })), ''];
@@ -15,13 +15,15 @@ export function groupQuestions(questions = []) {
15
15
  return [...groups.values()];
16
16
  }
17
17
 
18
- export function answerMessage(questions, answers = [], note = '') {
18
+ // attributed: each answer line says whether the assistant relayed the user's words or wrote its own.
19
+ const ANSWER_LABEL = { user: "Answer (the user's words, relayed by the assistant)", assistant: "Answer (the assistant's own, not the user's)" };
20
+ export function answerMessage(questions, answers = [], note = '', { attributed = false } = {}) {
19
21
  const groups = groupQuestions(questions), seen = new Set(), lines = [];
20
22
  for (const answer of answers) {
21
23
  const group = groups.find((q) => q.id === answer.id);
22
24
  if (!group || seen.has(answer.id)) throw Object.assign(new Error('The question list changed. Review the current questions before sending your answers.'), { status: 409 });
23
25
  seen.add(answer.id);
24
- if (answer.text.trim()) lines.push(`Question (${group.sources.join(', ')}): ${group.question}\nAnswer: ${answer.text.trim()}`);
26
+ if (answer.text.trim()) lines.push(`Question (${group.sources.join(', ')}): ${group.question}\n${attributed ? ANSWER_LABEL[answer.from] || ANSWER_LABEL.assistant : 'Answer'}: ${answer.text.trim()}`);
25
27
  }
26
28
  if (note.trim()) lines.push(note.trim());
27
29
  return lines.join('\n\n');
package/src/seats.js CHANGED
@@ -93,7 +93,7 @@ export const COLOURS = ['rust', 'olive', 'teal', 'dusk', 'steel'];
93
93
  // First use starts small. Prefer ready default logins; one ready vendor can fill both seats.
94
94
  // With no ready result yet, show two editable CLI choices and their status lamps.
95
95
  export function initialSeatVendors(vendors, checks = []) {
96
- const cli = vendors.filter((v) => v.kind !== 'api').map((v) => v.vendor);
96
+ const cli = vendors.filter((v) => v.kind !== 'api' && v.kind !== 'acp').map((v) => v.vendor);
97
97
  const ready = cli.filter((v) => checks.some((p) => p.key === v && p.state === 'ok'));
98
98
  const choices = ready.length ? ready : cli;
99
99
  return choices.length ? [choices[0], choices[1] || choices[0]] : [];
@@ -123,6 +123,14 @@ export function normaliseAccount(raw) {
123
123
  return name;
124
124
  }
125
125
 
126
+ export function agentLinkProfile(raw) {
127
+ const name = typeof raw === 'string' ? raw.trim() : '';
128
+ if (!/^[a-z0-9][a-z0-9_-]{0,63}$/.test(name) || /^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/.test(name)) {
129
+ throw new Error('An ACP seat needs a valid saved AgentLink profile: 1-64 lowercase letters, digits, underscores or hyphens; no reserved device names.');
130
+ }
131
+ return name;
132
+ }
133
+
126
134
  // The one line a seat sees about how to approach the question. Custom text wins when given.
127
135
  export function moodLine(mood) {
128
136
  if (!mood) return MOODS[DEFAULT_MOOD];
@@ -200,6 +208,7 @@ export function hostKey(url) {
200
208
  // What the card and the record say about where a seat runs: the CLI on a subscription, an API
201
209
  // on this machine, or an API that bills per token.
202
210
  export function seatKind(vendorRow, endpoint = null) {
211
+ if (vendorRow?.kind === 'acp') return 'ACP · profile billing';
203
212
  if (vendorRow?.kind !== 'api') return 'CLI · subscription';
204
213
  let u; try { u = new URL(String(endpoint || '')); } catch { return 'API'; }
205
214
  return privateHost(u.hostname) ? 'API · local' : 'API · pay-per-token';
@@ -215,6 +224,12 @@ function normaliseEndpoint(raw, label) {
215
224
  return { endpoint, keyEnv: keyEnv || undefined, model, account: hostKey(endpoint) };
216
225
  }
217
226
 
227
+ // For ACP the existing account field selects an AgentLink profile, not a login
228
+ // directory or a command. Keep pool identity and saved review records consistent.
229
+ function seatAccount(raw, row) {
230
+ return row.kind === 'acp' ? agentLinkProfile(raw.account) : normaliseAccount(raw.account);
231
+ }
232
+
218
233
  // vendors: { [vendor]: { label, effortLevels } } (the adapter table). efforts may widen a
219
234
  // vendor's levels from the catalogue (agy's come from its model ids); models is the
220
235
  // catalogue's model list per vendor, for the lightest model a hidden mood runs on.
@@ -243,7 +258,7 @@ export function normaliseSeats(input, { vendors, efforts = {}, models = {}, hidd
243
258
  mood,
244
259
  model: locked ? locked.model : ep ? ep.model : raw.model ? String(raw.model).trim() : undefined,
245
260
  effort: locked ? locked.effort : effort || undefined,
246
- account: ep ? ep.account : normaliseAccount(raw.account),
261
+ account: ep ? ep.account : seatAccount(raw, vendors[raw.vendor]),
247
262
  ...(ep ? { endpoint: ep.endpoint, keyEnv: ep.keyEnv } : {}),
248
263
  // the vendor's colour (adapters config) unless the board sent one; positions as a fallback
249
264
  colour: COLOURS.includes(raw.colour) ? raw.colour : (vendors[raw.vendor].colour || COLOURS[seats.length % COLOURS.length]),
@@ -253,7 +268,7 @@ export function normaliseSeats(input, { vendors, efforts = {}, models = {}, hidd
253
268
  // Human-side label only: "Codex 2" when a vendor is seated more than once; an endpoint seat
254
269
  // is named by its host ("API localhost-11434"). Never in a prompt.
255
270
  const perBase = {};
256
- for (const s of seats) { s.base = s.endpoint ? `API ${s.account}` : vendors[s.vendor].label; perBase[s.base] = (perBase[s.base] || 0) + 1; }
271
+ for (const s of seats) { s.base = s.endpoint ? `API ${s.account}` : vendors[s.vendor].kind === 'acp' ? `ACP ${s.account}` : vendors[s.vendor].label; perBase[s.base] = (perBase[s.base] || 0) + 1; }
257
272
  const seen2 = {};
258
273
  for (const s of seats) { seen2[s.base] = (seen2[s.base] || 0) + 1; s.label = perBase[s.base] > 1 ? `${s.base} ${seen2[s.base]}` : s.base; delete s.base; }
259
274
  return seats;
@@ -268,5 +283,5 @@ export function normaliseChairman(raw, { vendors, efforts = {}, role = 'Chairman
268
283
  if (effort && !allowed.includes(effort)) throw new Error(`${role}: ${vendors[vendor].label}${raw.model ? ` ${String(raw.model).trim()}` : ''} does not accept effort "${effort}".`);
269
284
  const ep = vendors[vendor].kind === 'api' ? normaliseEndpoint(raw, role) : null;
270
285
  return { vendor, colour: vendors[vendor].colour || undefined, model: ep ? ep.model : raw.model ? String(raw.model).trim() : undefined, effort: effort || undefined,
271
- account: ep ? ep.account : normaliseAccount(raw.account), ...(ep ? { endpoint: ep.endpoint, keyEnv: ep.keyEnv } : {}) };
286
+ account: ep ? ep.account : seatAccount(raw, vendors[vendor]), ...(ep ? { endpoint: ep.endpoint, keyEnv: ep.keyEnv } : {}) };
272
287
  }
package/src/server.js CHANGED
@@ -7,6 +7,7 @@ import { readFile } from 'node:fs/promises';
7
7
  import path from 'node:path';
8
8
  import { fileURLToPath } from 'node:url';
9
9
  import { adapters, ADAPTERS, quotaReaders, poolsByAccount } from './adapters/index.js';
10
+ import { agentLinkBinary } from './adapters/acp.js';
10
11
  import { profileHome, killAll, liveChildren, resolveBinary, runProcess, cleanEnv } from './adapters/spawn.js';
11
12
  import { checkPool, STATUS, endpointLamp, createPreflightCache } from './preflight.js';
12
13
  import { retired, quotaGroup } from './adapters/models.js';
@@ -24,7 +25,7 @@ import { answerMessage } from './review-view.js';
24
25
  import { createSettingsStore } from './settings.js';
25
26
  import { createTermsRecord, termsRefusal } from './terms.js';
26
27
  import { noteRecord, storedNote } from './notes.js';
27
- import { reviewSnapshot } from './snapshot.js';
28
+ import { reviewSnapshot, clock } from './snapshot.js';
28
29
  import { pickFolder } from './folder-picker.js';
29
30
  import { dataDirectory, legacyHistory, acquireDataLock, checkedHistoryPath, removeHistory, createUsageStore, createHistoryIndex } from './history.js';
30
31
  import { VERSION } from './version.js';
@@ -310,6 +311,15 @@ async function preflight(keys, { refresh = false, fresh = false, endpoints = {}
310
311
  return Promise.all(keys.map(async (key) => {
311
312
  const vendor = poolVendor(key), account = poolAccount(key);
312
313
  if (!Object.hasOwn(ADAPTERS, vendor)) return { key, state: 'danger', kind: 'missing', note: `unknown vendor ${vendor}` };
314
+ if (ADAPTERS[vendor].kind === 'acp') {
315
+ // No bridge is started or installed by a background readiness check.
316
+ if (FAKE) return { key, vendor, account, installed: null, loggedIn: null, quota: null, state: 'ok', kind: 'demo', note: 'Scripted demo; no AgentLink or vendor process is used' };
317
+ try {
318
+ agentLinkBinary();
319
+ return { key, vendor, account, installed: true, loggedIn: null, quota: null, state: 'warn', kind: 'unknown',
320
+ note: account ? 'AgentLink found; profile, login and ACP support are checked on the first call' : 'Choose a saved AgentLink profile' };
321
+ } catch (e) { return { key, vendor, account, installed: false, loggedIn: null, quota: null, state: 'danger', kind: 'missing', note: e.message }; }
322
+ }
313
323
  if (ADAPTERS[vendor].kind === 'api') {
314
324
  const ep = refresh ? endpoints[key] || {} : {};
315
325
  const url = typeof ep.url === 'string' ? ep.url.slice(0, 500) : '', keyEnv = typeof ep.keyEnv === 'string' ? ep.keyEnv.slice(0, 64) : null;
@@ -482,7 +492,7 @@ function prepareDebate(raw, { board = false } = {}) {
482
492
  if (unacknowledged) throw unacknowledged;
483
493
  if (!FAKE && !body.options.allowLimitedIsolation && [...seats, chairman, body.options.research].some((s) => s && ADAPTERS[s.vendor]?.limitedIsolation)) {
484
494
  // the board sends this whenever a card it shows runs on Antigravity; an agent must send it
485
- throw Object.assign(new Error('Antigravity cannot be fully isolated. Send options.allowLimitedIsolation: true once the person accepts that, or choose another provider.'), { status: 400 });
495
+ throw Object.assign(new Error('Antigravity and ACP profiles cannot be fully isolated. Send options.allowLimitedIsolation: true once the person accepts the selected provider limits, or choose another provider.'), { status: 400 });
486
496
  }
487
497
  const options = { ...DEFAULTS, ...body.options };
488
498
  // the board always names the searcher's settings, even "default"; an agent may leave them out
@@ -555,6 +565,7 @@ function attachEngine(d, { fieldNotes, seats, chairman, options, resume = null,
555
565
  const call = FAKE ? fakeRunner({ consensus: FAKE_CONSENSUS }) : (vendor, prompt, sessionId, opts) =>
556
566
  adapters[vendor](prompt, sessionId, {
557
567
  cwd: store.seatDir(opts.seat?.id || 'chairman'), home: opts.seat?.account && ADAPTERS[vendor].home ? profileHome(vendor, opts.seat.account) : null,
568
+ account: opts.seat?.account, signal: opts.signal,
558
569
  endpoint: opts.seat?.endpoint ? { url: opts.seat.endpoint, keyEnv: opts.seat.keyEnv || null } : null, // an API seat: where to send the round
559
570
  timeoutMs: opts.timeoutMs, prevCost: opts.prevCost, prevUsage: opts.prevUsage, model: opts.model || undefined, effort: opts.effort || undefined, tag: d.slug,
560
571
  allowLimitedIsolation: opts.allowLimitedIsolation,
@@ -791,7 +802,7 @@ const server = http.createServer(async (req, res) => {
791
802
  const body = refresh ? await readBody(req) : { pools: String(url.searchParams.get('pools') || '').split(',') };
792
803
  if (body.fresh != null && typeof body.fresh !== 'boolean') throw new Error('fresh must be a boolean.');
793
804
  const list = Array.isArray(body.pools) ? body.pools : String(body.pools || '').split(',');
794
- const keys = [...new Set(list.map((k) => String(k).trim()).filter((k) => /^[a-z]+(@[a-z0-9][a-z0-9_.-]{0,39})?$/i.test(k)))].slice(0, 12);
805
+ const keys = [...new Set(list.map((k) => String(k).trim()).filter((k) => /^acp@[a-z0-9][a-z0-9_-]{0,63}$/.test(k) || /^[a-z]+(@[a-z0-9][a-z0-9_.-]{0,39})?$/i.test(k)))].slice(0, 12);
795
806
  const endpoints = req.method === 'POST' && body.endpoints && typeof body.endpoints === 'object' ? body.endpoints : {};
796
807
  return json(res, 200, { pools: await preflight(keys, { refresh, fresh: body.fresh === true, endpoints }) });
797
808
  }
@@ -840,7 +851,13 @@ const server = http.createServer(async (req, res) => {
840
851
  return requestError(res, 400, 'More time does not submit answers or notes. Use Continue or agent answer to send them.', 'hold');
841
852
  if (body.answers?.length) {
842
853
  if (!d.pending) return requestError(res, 409, 'The review is not waiting for answers. Your draft was not sent.', m[2]);
843
- body.message = validateMessage({ message: answerMessage(d.pending.info.questions, body.answers, body.message) }).message;
854
+ // An agent submission is credited to the person only when every answer is declared as the
855
+ // user's own words and nothing else rides along; otherwise each line says whose it is.
856
+ // The declaration comes from the client and is shown, not verified.
857
+ const given = body.answers.filter((a) => a.text.trim());
858
+ const relayed = body.source === 'agent' && given.length > 0 && given.every((a) => a.from === 'user') && !body.message.trim();
859
+ body.message = validateMessage({ message: answerMessage(d.pending.info.questions, body.answers, body.message, { attributed: body.source === 'agent' && !relayed }) }).message;
860
+ if (relayed) body.source = 'relayed';
844
861
  }
845
862
  if (m[2] === 'resume') { resumeDebate(d, body); return json(res, 200, { ok: true }); }
846
863
  if (m[2] === 'synthesize') { synthesizeDebate(d, body); return json(res, 200, { ok: true }); }
@@ -861,7 +878,7 @@ const server = http.createServer(async (req, res) => {
861
878
  if (m[2] === 'hold') {
862
879
  if (!d.pending) return requestError(res, 409, 'The response window has closed. Read the current state before requesting more time.', 'hold');
863
880
  const deadline = scheduleGate(d, d.pending.info.questionWaitMs || DEFAULTS.questionWaitMs, true);
864
- return json(res, 200, { ok: true, autoContinueAt: deadline });
881
+ return json(res, 200, { ok: true, autoContinueAt: deadline, ...clock('autoContinue', deadline) });
865
882
  }
866
883
  }
867
884
  res.writeHead(404); res.end('not found');
package/src/snapshot.js CHANGED
@@ -40,6 +40,13 @@ function researchSnapshot(research) {
40
40
  ...(integerWithin(research.searches, 0, 9) ? { searches: research.searches } : {}) };
41
41
  }
42
42
 
43
+ // Epoch milliseconds are easy to misread across time zones, so every deadline also carries an
44
+ // ISO timestamp and the whole seconds left, both taken when the snapshot is built.
45
+ export const clock = (name, at) => at == null ? {} : {
46
+ [`${name}AtIso`]: new Date(at).toISOString(),
47
+ [`secondsUntil${name[0].toUpperCase()}${name.slice(1)}`]: Math.max(0, Math.ceil((at - Date.now()) / 1000)),
48
+ };
49
+
43
50
  // One compact, read-only view for local clients. Raw provider output and launch tokens stay out.
44
51
  export function reviewSnapshot(d) {
45
52
  const state = d.debate?.state || d.rebuilt;
@@ -59,7 +66,7 @@ export function reviewSnapshot(d) {
59
66
  attemptedCritiqueRounds: rounds.slice(1).filter((r) => r?.length === state.seats.length).length,
60
67
  completedRounds: rounds.filter((r) => hasUsableRound([r], state.seats.length)).length,
61
68
  completedCritiqueRounds: rounds.slice(1).filter((r) => hasUsableRound([r], state.seats.length)).length },
62
- deadlineAt: state.deadlineAt, stopReason: state.stopReason || null,
69
+ deadlineAt: state.deadlineAt, ...clock('deadline', state.deadlineAt), stopReason: state.stopReason || null,
63
70
  ...(state.research ? { research: researchSnapshot(state.research) } : {}),
64
71
  ...(state.stopReason ? { explanation: stopExplanation(state.stopReason, state.stopContext) } : {}),
65
72
  actions: d.finished ? (!verdict || verdict.failed || verdict.skipped) && hasUsableRound(rounds, state.seats.length) ? ['verdict'] : []
@@ -67,11 +74,11 @@ export function reviewSnapshot(d) {
67
74
  // reopenCalls: the seats already agree, so empty answers end the discussion; any answer text
68
75
  // or message runs one more round at this many calls. Absent when answering cannot reopen.
69
76
  gate: gate ? { round: gate.round, mode: gate.mode, reason: gate.reason, stop: gate.stop, questions: groupQuestions(gate.questions),
70
- autoContinueAt: d.pending.autoContinueAt ?? null, timeoutBehavior: 'continue_without_answers',
77
+ autoContinueAt: d.pending.autoContinueAt ?? null, ...clock('autoContinue', d.pending.autoContinueAt), timeoutBehavior: 'continue_without_answers',
71
78
  ...(gate.reopenable ? { reopenCalls: (state.seats || []).length } : {}) } : null,
72
79
  nextAction: gate?.questions.length ? {
73
80
  type: 'ask_user',
74
- instruction: 'Ask gate.questions using your available user-input tool. If there is no form, ask in chat. Group overlapping questions without losing their IDs. Do not invent answers. Tell the user when the response window closes; unanswered questions remain unknown. Read status before submitting a reply because the review may have continued.',
81
+ instruction: 'Ask gate.questions using your available user-input tool. If there is no form, ask in chat. Group overlapping questions without losing their IDs. Do not invent answers. Tell the user when the response window closes (gate.secondsUntilAutoContinue); unanswered questions remain unknown. Read status before submitting a reply because the review may have continued. Mark each answer from: "user" only when it is the user\'s own reply; from: "assistant" when you supplied it yourself with the user\'s permission.',
75
82
  answerTemplate: { round: gate.round, answers: groupQuestions(gate.questions).map((q) => ({ id: q.id, text: '' })) },
76
83
  } : { type: gate || ['researching', 'running', 'verdict'].includes(status) ? 'wait'
77
84
  : status === 'done' && sections ? 'report_result' : 'report_incomplete',
package/src/ui/app.js CHANGED
@@ -128,6 +128,7 @@ const ENDPOINT_PRESETS = [
128
128
  { label: 'OpenAI', url: 'https://api.openai.com/v1', keyEnv: 'OPENAI_API_KEY' },
129
129
  ];
130
130
  const isApi = (vendor) => VENDOR_META[vendor]?.kind === 'api';
131
+ const isAcp = (vendor) => VENDOR_META[vendor]?.kind === 'acp';
131
132
  // The pool a drafted seat draws on: a CLI's login profile, or an endpoint's host.
132
133
  const seatAccount = (s) => (isApi(s.vendor) ? hostKey(s.endpoint || '') : (s.account || '').trim());
133
134
  const chairAccount = () => (isApi($('chairman').value) ? hostKey($('chairman-endpoint').value) : $('chairman-account').value.trim());
@@ -441,6 +442,7 @@ function poolLamp(vendor, account, model = '') {
441
442
  const seatHidden = (s) => (s.mood === 'custom' ? hiddenMood(s.moodText) : null);
442
443
  function lockHidden(s) {
443
444
  if (!seatHidden(s)) return;
445
+ if (isAcp(s.vendor)) { s.effort = ''; return; }
444
446
  s.customModel = false;
445
447
  const lightest = lightestModel(s.vendor, VENDOR_META[s.vendor]?.catalogue?.models);
446
448
  if (lightest) s.model = lightest;
@@ -463,7 +465,7 @@ function seatRow(s, i) {
463
465
  <div class="seat-hd">
464
466
  <span class="avatar" title="${esc(s.mood === 'custom' ? 'custom mood' : s.mood)}">${avatar(hidden ? hidden.art : s.mood === 'custom' ? 'custom' : s.mood, hidden?.sprite)}</span>
465
467
  <div class="seat-id">
466
- <span class="chair-title"><select class="flat vendor" aria-label="Vendor">${Object.keys(VENDOR_META).map((v) => `<option value="${v}" ${v === s.vendor ? 'selected' : ''}>${esc(VENDOR_LABEL[v])}</option>`).join('')}</select>${n ? `<span class="seat-note">${n.trim()}</span>` : ''}<span class="kind-tag ${api ? 'api' : ''}" title="${api ? 'Billed by the endpoint, not a subscription' : 'The vendor CLI on your subscription'}">${esc(seatKind(VENDOR_META[s.vendor], s.endpoint))}</span></span>
468
+ <span class="chair-title"><select class="flat vendor" aria-label="Vendor">${Object.keys(VENDOR_META).map((v) => `<option value="${v}" ${v === s.vendor ? 'selected' : ''}>${esc(VENDOR_LABEL[v])}</option>`).join('')}</select>${n ? `<span class="seat-note">${n.trim()}</span>` : ''}<span class="kind-tag ${api ? 'api' : ''}" title="${api ? 'Billed by the endpoint, not a subscription' : isAcp(s.vendor) ? 'Billing belongs to the selected AgentLink profile' : 'The vendor CLI on your subscription'}">${esc(seatKind(VENDOR_META[s.vendor], s.endpoint))}</span></span>
467
469
  ${hidden && !api ? picker.html.replace('<select', '<select disabled title="Locked to the lightest model"') : picker.html}<input class="flat model" aria-label="Model id" list="models-${s.vendor}" value="${esc(s.model)}" placeholder="${api ? 'model id (required)' : 'model id'}" ${picker.other ? '' : 'hidden'}>
468
470
  </div>
469
471
  <span class="lamp ${lamp.cls}" title="${esc(lamp.note)}"></span>
@@ -481,7 +483,7 @@ function seatRow(s, i) {
481
483
  <div class="f"><span class="label help-label" data-help="effort" tabindex="0" aria-describedby="help-effort">Effort</span><span class="pips ${hidden ? 'locked' : ''}">${pipsHtml(s.vendor, s.effort, s.model)}</span><select class="effort" hidden>${effortOptions(s.vendor, s.effort, s.model)}</select></div>
482
484
  <span class="seat-note lamp-note ${lamp.cls === 'danger' || lamp.cls === 'warn' ? lamp.cls : ''}" title="${esc(lamp.note)}" tabindex="0">${esc(lamp.note)}</span>
483
485
  ${cardNotices(s.vendor)}
484
- ${api ? '' : `<details class="seat-more"><summary>Login profile${s.account ? `: ${esc(s.account)}` : ''}</summary><input class="flat account" aria-label="Login profile" value="${esc(s.account || '')}" placeholder="none: your usual login" title="A second login of this CLI, for example a work subscription; node src/doctor.js shows how to log a profile in"></details>`}
486
+ ${api ? '' : `<details class="seat-more" ${isAcp(s.vendor) ? 'open' : ''}><summary>${isAcp(s.vendor) ? 'AgentLink profile (required)' : 'Login profile'}${s.account ? `: ${esc(s.account)}` : ''}</summary><input class="flat account" aria-label="${isAcp(s.vendor) ? 'AgentLink profile' : 'Login profile'}" value="${esc(s.account || '')}" placeholder="${isAcp(s.vendor) ? 'saved profile name' : 'none: your usual login'}" title="${isAcp(s.vendor) ? 'A profile already configured centrally in AgentLink' : 'A second login of this CLI; node src/doctor.js shows how to log a profile in'}"></details>`}
485
487
  </div>
486
488
  </article>`;
487
489
  }
@@ -567,6 +569,10 @@ function renderChair() {
567
569
  $('chair-kind').textContent = seatKind(VENDOR_META[v], $('chairman-endpoint').value);
568
570
  $('chair-kind').classList.toggle('api', api);
569
571
  $('chair-api').hidden = !api; $('chair-profile').hidden = api;
572
+ $('chair-profile').querySelector('summary').textContent = isAcp(v) ? 'AgentLink profile (required)' : 'Login profile';
573
+ $('chair-profile').open = isAcp(v);
574
+ $('chairman-account').placeholder = isAcp(v) ? 'saved profile name' : 'none: your usual login';
575
+ $('chairman-account').setAttribute('aria-label', isAcp(v) ? 'Chairman AgentLink profile' : 'Chairman login profile');
570
576
  const picker = api ? { html: '', other: true } : modelPicker(v, $('chairman-model').value.trim(), 'id="chair-model-pick"', S.customChairModel);
571
577
  $('chair-model-slot').innerHTML = picker.html;
572
578
  $('chairman-model').hidden = !picker.other;
@@ -581,7 +587,8 @@ function renderChair() {
581
587
  // its tip explains, and choosing it there is the consent the board sends (isolationAccepted).
582
588
  // An agent request has no card, so it must send options.allowLimitedIsolation itself.
583
589
  const isoNote = (vendor) => (VENDOR_META[vendor]?.limitedIsolation
584
- ? '<span class="seat-note warn iso-note help-label" data-help="isolation" tabindex="0" aria-describedby="help-isolation">Limited isolation: your Antigravity customizations and MCP servers still load</span>' : '');
590
+ ? isAcp(vendor) ? '<span class="seat-note warn iso-note">Limited isolation: the profile owns tools, customization and billing. Use a trusted profile with tools disabled. Stateless memory only; missing token usage stops further seat calls.</span>'
591
+ : '<span class="seat-note warn iso-note help-label" data-help="isolation" tabindex="0" aria-describedby="help-isolation">Limited isolation: your Antigravity customizations and MCP servers still load</span>' : '');
585
592
  const isolationAccepted = () => [...draftSeats(), draftChairman(), searcherOn() ? draftSearcher() : null].some((s) => VENDOR_META[s?.vendor]?.limitedIsolation);
586
593
 
587
594
  // A vendor whose own docs say wrapping its CLI is unsupported on some plans (config.js terms,
@@ -1505,12 +1512,15 @@ function renderGate() {
1505
1512
  const chairDown = S.verdict?.seat && seatDown(S.verdict.seat);
1506
1513
  // the CLI vendors by name; an endpoint only as a seat already at this table (its URL, key
1507
1514
  // variable and model are the seat's), since the endpoint vendor alone names no server
1508
- const pickable = Object.keys(VENDOR_LABEL).filter((v) => !isApi(v) && !Object.values(S.down).some((x) => x.vendor === v && !x.account && !x.group));
1509
- const apiSeats = S.seats.filter((s) => s.endpoint && !seatDown(s)).map((s) => ({ value: `seat:${s.id}`, label: `${s.label} (${s.model})` }));
1515
+ const pickable = Object.keys(VENDOR_LABEL).filter((v) => !isApi(v) && !isAcp(v) && !Object.values(S.down).some((x) => x.vendor === v && !x.account && !x.group));
1516
+ const apiSeats = S.seats.filter((s) => (s.endpoint || isAcp(s.vendor) && s.account) && !seatDown(s)).map((s) => ({ value: `seat:${s.id}`, label: `${s.label} (${s.model || s.account})` }));
1510
1517
  const savedChair = S.configuredChairman || S.chairman;
1511
- const first = chairDown || ['quota', 'auth', 'missing'].includes(S.verdict?.errorKind) ? pickable.find((v) => v !== S.verdict?.seat?.vendor) || pickable[0] : (savedChair?.vendor || pickable[0]);
1518
+ if (isAcp(savedChair?.vendor) && savedChair.account && !seatDown(savedChair)) apiSeats.unshift({ value: 'chair:acp', label: `ACP ${savedChair.account} (chairman)` });
1519
+ const first = chairDown || ['quota', 'auth', 'missing'].includes(S.verdict?.errorKind)
1520
+ ? (isAcp(savedChair?.vendor) ? apiSeats[0]?.value : null) || pickable.find((v) => v !== S.verdict?.seat?.vendor) || pickable[0]
1521
+ : isAcp(savedChair?.vendor) ? 'chair:acp' : (savedChair?.vendor || pickable[0]);
1512
1522
  const synth = S.status === 'done' && S.synthesis && S.synthesis !== 'done' && canFinish
1513
- ? ` <span class="synth">Write the verdict with <select id="synth-chair" aria-label="Chairman for the verdict">${pickable.map((v) => `<option value="${v}" ${v === first ? 'selected' : ''}>${esc(VENDOR_LABEL[v])}${v === savedChair?.vendor ? esc([savedChair.model, savedChair.effort, savedChair.account].filter(Boolean).map((s) => ` · ${s}`).join('')) : ''}</option>`).join('')}${apiSeats.map((o) => `<option value="${esc(o.value)}">${esc(o.label)}</option>`).join('')}</select> <button class="btn btn-small" id="synthesize" type="button" ${S.actionPending ? 'disabled' : ''}>${S.actionPending === 'synthesize' ? 'Starting…' : 'Write'}</button></span>` : '';
1523
+ ? ` <span class="synth">Write the verdict with <select id="synth-chair" aria-label="Chairman for the verdict">${pickable.map((v) => `<option value="${v}" ${v === first ? 'selected' : ''}>${esc(VENDOR_LABEL[v])}${v === savedChair?.vendor ? esc([savedChair.model, savedChair.effort, savedChair.account].filter(Boolean).map((s) => ` · ${s}`).join('')) : ''}</option>`).join('')}${apiSeats.map((o) => `<option value="${esc(o.value)}" ${o.value === first ? 'selected' : ''}>${esc(o.label)}</option>`).join('')}</select> <button class="btn btn-small" id="synthesize" type="button" ${S.actionPending ? 'disabled' : ''}>${S.actionPending === 'synthesize' ? 'Starting…' : 'Write'}</button></span>` : '';
1514
1524
  const focused = st.contains(document.activeElement) ? document.activeElement.id : null;
1515
1525
  st.innerHTML = link + (S.status === 'done' ? `<span class="status ${S.synthesis === 'done' ? 'ok' : 'warn'}">${S.synthesis === 'done' ? 'Review finished' : S.stopReason === 'human' ? 'Review stopped' : 'Review ended without a verdict'}</span> ${esc(stopExplanation(S.stopReason, S.stopContext))}${synth} Record saved locally.${S.exported ? ' Decision record exported.' : ''}${S.exportError ? ` <span class="danger">Export failed: ${esc(S.exportError)}</span>` : ''}${S.replayed ? ' <span class="muted">saved review</span>' : ''}`
1516
1526
  : interrupted ? `<span class="status warn">interrupted</span> ${S.interrupted?.round ? `after round ${S.interrupted.round - 1}` : 'before round 0 finished'}${S.interrupted?.partialRound != null ? `, round ${S.interrupted.partialRound} will be re-run` : ''}. Add a note or resume.`
@@ -1791,7 +1801,7 @@ $('gate-status').addEventListener('click', async (ev) => {
1791
1801
  const pick = $('synth-chair').value;
1792
1802
  const seat = pick.startsWith('seat:') && S.seats.find((s) => s.id === pick.slice(5));
1793
1803
  const savedChair = S.configuredChairman || S.chairman;
1794
- const chosen = seat || (pick === savedChair?.vendor ? savedChair : { vendor: pick });
1804
+ const chosen = seat || (pick === 'chair:acp' || pick === savedChair?.vendor ? savedChair : { vendor: pick });
1795
1805
  const chairman = Object.fromEntries(['vendor', 'endpoint', 'keyEnv', 'model', 'effort', 'account'].filter((key) => chosen[key] != null).map((key) => [key, chosen[key]]));
1796
1806
  await boardAction('synthesize', { chairman });
1797
1807
  if (revision === viewRevision) $('synthesize')?.focus({ preventScroll: true });
@@ -1,91 +1,91 @@
1
- /* Signature preset: Dusk, version 1.
2
- Load after tokens.css. The Ink & paper structure (warm paper, IBM Plex, square tags, LED
3
- status lights, hard shadows) with purple where Ink & paper has blue: aubergine chrome, a plum
4
- action colour, orchid (the Dusk accent) for brand marks. Green appears only for success.
5
- Light theme "Plum paper", dark theme "Night plum". First used by Roundtable. All text pairs
6
- checked with design_lint.py --contrast at 4.5:1 or better; border-strong at 3:1 (marks). */
7
-
8
- :root {
9
- --knob-accent: #c79ad0;
10
- --knob-accent-manual: #7d4a8a;
11
- }
12
-
13
- :root,
14
- :root[data-theme="paper"],
15
- :root[data-theme="manual"] {
16
- color-scheme: light;
17
- --color-bg: #f6f2ea;
18
- --color-surface: #fdfbf7;
19
- --color-surface-raised: #fffdfa;
20
- --color-border: #ddd3d6;
21
- --color-border-strong: #8c7f8f;
22
- --color-text: #241c2b;
23
- --color-text-muted: #645a6c;
24
- --color-accent: var(--knob-accent-manual);
25
- --color-logo-ink: #2b1d38;
26
- --color-action: #5b3478;
27
- --color-on-action: #ffffff;
28
- --color-selection: #ece3f0;
29
- --color-ok: #3f6b3a;
30
- --color-warn: #8f5a00;
31
- --color-danger: #a8402d;
32
- --color-info: #5b3478;
33
- --color-focus: #5b3478;
34
- --color-chrome: #2b1d38;
35
- --color-chrome-text: #f1eaf4;
36
- --color-chrome-muted: #c3b3cc;
37
- --color-chrome-accent: #c79ad0;
38
- }
39
-
40
- :root[data-theme="night"],
41
- :root[data-theme="terminal"] {
42
- color-scheme: dark;
43
- --color-bg: #16111c;
44
- --color-surface: #1d1724;
45
- --color-surface-raised: #251d2e;
46
- --color-border: #352a40;
47
- --color-border-strong: #6e5d7d;
48
- --color-text: #ece5f1;
49
- --color-text-muted: #a597b0;
50
- --color-accent: var(--knob-accent);
51
- --color-logo-ink: #0f0b14;
52
- --color-action: #c9a3e6;
53
- --color-on-action: #16111c;
54
- --color-selection: #2a2035;
55
- --color-ok: #8fbf86;
56
- --color-warn: #d9a45a;
57
- --color-danger: #e58a78;
58
- --color-info: #c9a3e6;
59
- --color-focus: #c9a3e6;
60
- --color-chrome: #0f0b14;
61
- --color-chrome-text: #ece5f1;
62
- --color-chrome-muted: #a597b0;
63
- --color-chrome-accent: #c79ad0;
64
- }
65
-
66
- @media (prefers-color-scheme: dark) {
67
- :root:not([data-theme]) {
68
- color-scheme: dark;
69
- --color-bg: #16111c;
70
- --color-surface: #1d1724;
71
- --color-surface-raised: #251d2e;
72
- --color-border: #352a40;
73
- --color-border-strong: #6e5d7d;
74
- --color-text: #ece5f1;
75
- --color-text-muted: #a597b0;
76
- --color-accent: var(--knob-accent);
77
- --color-logo-ink: #0f0b14;
78
- --color-action: #c9a3e6;
79
- --color-on-action: #16111c;
80
- --color-selection: #2a2035;
81
- --color-ok: #8fbf86;
82
- --color-warn: #d9a45a;
83
- --color-danger: #e58a78;
84
- --color-info: #c9a3e6;
85
- --color-focus: #c9a3e6;
86
- --color-chrome: #0f0b14;
87
- --color-chrome-text: #ece5f1;
88
- --color-chrome-muted: #a597b0;
89
- --color-chrome-accent: #c79ad0;
90
- }
91
- }
1
+ /* Signature preset: Dusk, version 1.
2
+ Load after tokens.css. The Ink & paper structure (warm paper, IBM Plex, square tags, LED
3
+ status lights, hard shadows) with purple where Ink & paper has blue: aubergine chrome, a plum
4
+ action colour, orchid (the Dusk accent) for brand marks. Green appears only for success.
5
+ Light theme "Plum paper", dark theme "Night plum". First used by Roundtable. All text pairs
6
+ checked with design_lint.py --contrast at 4.5:1 or better; border-strong at 3:1 (marks). */
7
+
8
+ :root {
9
+ --knob-accent: #c79ad0;
10
+ --knob-accent-manual: #7d4a8a;
11
+ }
12
+
13
+ :root,
14
+ :root[data-theme="paper"],
15
+ :root[data-theme="manual"] {
16
+ color-scheme: light;
17
+ --color-bg: #f6f2ea;
18
+ --color-surface: #fdfbf7;
19
+ --color-surface-raised: #fffdfa;
20
+ --color-border: #ddd3d6;
21
+ --color-border-strong: #8c7f8f;
22
+ --color-text: #241c2b;
23
+ --color-text-muted: #645a6c;
24
+ --color-accent: var(--knob-accent-manual);
25
+ --color-logo-ink: #2b1d38;
26
+ --color-action: #5b3478;
27
+ --color-on-action: #ffffff;
28
+ --color-selection: #ece3f0;
29
+ --color-ok: #3f6b3a;
30
+ --color-warn: #8f5a00;
31
+ --color-danger: #a8402d;
32
+ --color-info: #5b3478;
33
+ --color-focus: #5b3478;
34
+ --color-chrome: #2b1d38;
35
+ --color-chrome-text: #f1eaf4;
36
+ --color-chrome-muted: #c3b3cc;
37
+ --color-chrome-accent: #c79ad0;
38
+ }
39
+
40
+ :root[data-theme="night"],
41
+ :root[data-theme="terminal"] {
42
+ color-scheme: dark;
43
+ --color-bg: #16111c;
44
+ --color-surface: #1d1724;
45
+ --color-surface-raised: #251d2e;
46
+ --color-border: #352a40;
47
+ --color-border-strong: #6e5d7d;
48
+ --color-text: #ece5f1;
49
+ --color-text-muted: #a597b0;
50
+ --color-accent: var(--knob-accent);
51
+ --color-logo-ink: #0f0b14;
52
+ --color-action: #c9a3e6;
53
+ --color-on-action: #16111c;
54
+ --color-selection: #2a2035;
55
+ --color-ok: #8fbf86;
56
+ --color-warn: #d9a45a;
57
+ --color-danger: #e58a78;
58
+ --color-info: #c9a3e6;
59
+ --color-focus: #c9a3e6;
60
+ --color-chrome: #0f0b14;
61
+ --color-chrome-text: #ece5f1;
62
+ --color-chrome-muted: #a597b0;
63
+ --color-chrome-accent: #c79ad0;
64
+ }
65
+
66
+ @media (prefers-color-scheme: dark) {
67
+ :root:not([data-theme]) {
68
+ color-scheme: dark;
69
+ --color-bg: #16111c;
70
+ --color-surface: #1d1724;
71
+ --color-surface-raised: #251d2e;
72
+ --color-border: #352a40;
73
+ --color-border-strong: #6e5d7d;
74
+ --color-text: #ece5f1;
75
+ --color-text-muted: #a597b0;
76
+ --color-accent: var(--knob-accent);
77
+ --color-logo-ink: #0f0b14;
78
+ --color-action: #c9a3e6;
79
+ --color-on-action: #16111c;
80
+ --color-selection: #2a2035;
81
+ --color-ok: #8fbf86;
82
+ --color-warn: #d9a45a;
83
+ --color-danger: #e58a78;
84
+ --color-info: #c9a3e6;
85
+ --color-focus: #c9a3e6;
86
+ --color-chrome: #0f0b14;
87
+ --color-chrome-text: #ece5f1;
88
+ --color-chrome-muted: #a597b0;
89
+ --color-chrome-accent: #c79ad0;
90
+ }
91
+ }