gcf-board 0.11.0 → 0.16.2

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.
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>GCF board</title>
7
- <script type="module" crossorigin src="/assets/index-9AdVt1Kf.js"></script>
8
- <link rel="stylesheet" crossorigin href="/assets/index-xG2PuBXE.css">
7
+ <script type="module" crossorigin src="/assets/index-C9MtdvLc.js"></script>
8
+ <link rel="stylesheet" crossorigin href="/assets/index-BKzKQnZ5.css">
9
9
  </head>
10
10
  <body>
11
11
  <div id="root"></div>
@@ -219,12 +219,17 @@ export const claude = {
219
219
  .join(' '),
220
220
  /**
221
221
  * What an operator picks a session's model and effort from (Board-PRD decision 24); another
222
- * plain word goes too, and none leaves the choice to claude.
222
+ * plain word goes too.
223
223
  */
224
224
  presets: {
225
- model: ['opus', 'sonnet', 'haiku'],
225
+ model: ['fable', 'opus', 'sonnet', 'haiku'],
226
226
  effort: ['low', 'medium', 'high', 'xhigh', 'max'],
227
227
  },
228
+ /**
229
+ * What a session runs on when neither it nor the project picks (Board-PRD decision 36): aliases,
230
+ * never versions, so the machine's or the account's default never decides.
231
+ */
232
+ defaults: { model: 'opus', effort: 'high' },
228
233
  /** The flags of a picked model and effort (`{model?, effort?}`, plain words). */
229
234
  pickFlags: (pick) => PICKS.flatMap((k) => (pick?.[k] ? [`--${k} ${pick[k]}`] : [])).join(' '),
230
235
  /** The env a session adds: the guards read the session's own checkout. */
@@ -22,6 +22,7 @@ export const raw = {
22
22
  claude.command({ agent, flags, chat, prompt }),
23
23
  // An unknown command takes no claude flags of a model or effort.
24
24
  presets: { model: [], effort: [] },
25
+ defaults: {},
25
26
  pickFlags: () => '',
26
27
  };
27
28
 
@@ -31,9 +32,15 @@ export const raw = {
31
32
  */
32
33
  export const adapterFor = (command) =>
33
34
  /^claude(\s|$)/.test(command) ||
34
- (process.env.GCF_SESSION_AGENT && command === process.env.GCF_SESSION_AGENT)
35
+ // The stand-in with flags (a run's `--model opus`) is still the stand-in.
36
+ (process.env.GCF_SESSION_AGENT &&
37
+ (command === process.env.GCF_SESSION_AGENT ||
38
+ command.startsWith(`${process.env.GCF_SESSION_AGENT} `)))
35
39
  ? claude
36
40
  : raw;
37
41
 
38
42
  /** What an operator picks the model and effort of `command`'s sessions from. */
39
43
  export const presetsOf = (command) => adapterFor(command).presets;
44
+
45
+ /** What `command`'s sessions run on when neither they nor the project pick, `{model?, effort?}`. */
46
+ export const defaultsOf = (command) => adapterFor(command).defaults;
@@ -734,7 +734,7 @@ export function openChat(opts) {
734
734
  // A session that ended under a write to its stdin breaks the pipe: the end is its close.
735
735
  c.stdin.on('error', () => {});
736
736
  const from = opts.summary ? { summary: opts.summary } : {};
737
- // A project chat's session says the model and effort it was started with (null: the agent's).
737
+ // A project chat's session says the model and effort it was started with (null: none passed).
738
738
  const picked = opts.pick
739
739
  ? { model: opts.pick.model ?? null, effort: opts.pick.effort ?? null }
740
740
  : {};
@@ -31,7 +31,7 @@ export {
31
31
  export { addCost, beyond } from './cost.js';
32
32
  export { claim, clearDead, create, dead } from './lock.js';
33
33
  export { WIN, alive, byLine, killTree, sessions, spawnAgent, stopWithSessions } from './proc.js';
34
- export { adapterFor, presetsOf, raw } from './adapter/index.js';
34
+ export { adapterFor, defaultsOf, presetsOf, raw } from './adapter/index.js';
35
35
  export {
36
36
  NO_SESSION,
37
37
  PICKS,
@@ -78,6 +78,7 @@ const markOf = (dir, kind, key) => path.join(chatsDir(dir), kind, key);
78
78
  export function readThread(dir, t) {
79
79
  return {
80
80
  entry: null,
81
+ start: null,
81
82
  ...JSON.parse(readFileSync(path.join(threadDir(dir, t), 'thread.json'), 'utf8')),
82
83
  };
83
84
  }
@@ -100,12 +101,12 @@ function keepTrying(dir, t, rec) {
100
101
  // A picked model or effort goes into the agent's shell command: one plain word, no flag.
101
102
  const PICK_WORD = /^[A-Za-z0-9][\w.-]*$/;
102
103
 
103
- // The pick that leaves the choice to the agent.
104
+ // The pick that takes the thread's own off: the project's then holds, else the agent's defaults.
104
105
  const AGENT_DEFAULT = 'default';
105
106
 
106
107
  const pickFile = (td) => path.join(td, 'agent.json');
107
108
 
108
- /** A pick's word, or null for the agent's own: none, `default`, or a word that is not plain. */
109
+ /** A pick's word, or null for none of its own: none, `default`, or a word that is not plain. */
109
110
  const wordOf = (v) =>
110
111
  typeof v === 'string' && v !== AGENT_DEFAULT && PICK_WORD.test(v) ? v : null;
111
112
 
@@ -122,12 +123,15 @@ function pickIn(td) {
122
123
  }
123
124
  }
124
125
 
125
- /** The model and effort thread `t`'s sessions run on, `{model?, effort?}`; none: the agent's. */
126
+ /**
127
+ * The model and effort thread `t` picked, `{model?, effort?}`; none: the project's, else the
128
+ * agent's defaults (Board-PRD decision 36).
129
+ */
126
130
  export const threadAgent = (dir, t) => pickIn(threadDir(dir, t));
127
131
 
128
132
  /**
129
133
  * Pick the model and effort of thread `t` (Board-PRD decision 24): each a plain word, `default`
130
- * or null the agent's own choice, one left out kept as it is. Its next session takes them (a
134
+ * or null takes the thread's own off, one left out kept as it is. Its next session takes them (a
131
135
  * resume or a fresh agent); the live one keeps its own. Returns the pick kept. A word that is not
132
136
  * plain is a RangeError.
133
137
  * @param {{model?: string | null, effort?: string | null}} pick
@@ -211,10 +215,13 @@ function markOnce(dir, [kind, key], t, last = false) {
211
215
  /**
212
216
  * A new thread, its id; bound to `item` or to inbox `entry`, the one it already has (AD-46).
213
217
  * Ids and the marks are made exclusively: two at once never take one id, nor give an item or an
214
- * entry two threads. Both `item` and `entry` is a RangeError.
218
+ * entry two threads. Both `item` and `entry` is a RangeError. `start` is what the caller started
219
+ * the thread for (a board's design start, `{id, …}`), kept in the record as given: every session
220
+ * of the thread, a handoff's too, runs by it. A started thread is bound to nothing.
215
221
  */
216
- export function createThread(dir, { item = null, entry = null } = {}) {
222
+ export function createThread(dir, { item = null, entry = null, start = null } = {}) {
217
223
  if (item && entry) throw new RangeError('a thread is bound to an item or an entry, not both');
224
+ if (start && (item || entry)) throw new RangeError('a started thread is bound to nothing');
218
225
  const [kind, key] = item ? ['items', item] : ['entries', entry];
219
226
  const had = key ? boundTo(dir, kind, key) : null;
220
227
  if (had) return had;
@@ -224,7 +231,7 @@ export function createThread(dir, { item = null, entry = null } = {}) {
224
231
  if (won !== t) return won;
225
232
 
226
233
  const now = new Date().toISOString();
227
- writeThread(dir, t, { id: t, item, entry, sessions: [], created_at: now, in_at: 0 });
234
+ writeThread(dir, t, { id: t, item, entry, start, sessions: [], created_at: now, in_at: 0 });
228
235
 
229
236
  return t;
230
237
  }
@@ -344,7 +351,8 @@ function flagsOf({ dir, td, spec, adapter }, settings) {
344
351
  * sessions (AD-41), each resumed from the one before, a fresh one after a handoff (AD-42).
345
352
  * `spec` (its `spec.json`): `agent`, `rules` `{deny, ask, allow}`, `mcp` (config files),
346
353
  * `answerMin`, `handoffPct`, `window`, `skill`, `mainLock`, `timeoutMin`, `pick` (the project's
347
- * model and effort, under the thread's own). `stopped()` says the operator stopped it.
354
+ * model and effort, under the thread's own, over the agent's defaults). `stopped()` says the
355
+ * operator stopped it.
348
356
  * @param {{stopped?: () => boolean}} [opts]
349
357
  */
350
358
  export async function runThread(dir, t, spec, opts = {}) {
@@ -580,8 +588,9 @@ function jobOf(s, record) {
580
588
  prompt: (kind, _caps, rec) => (rec?.ended === 'limit' ? AFTER_LIMIT : null),
581
589
  // The flags come before the chat of each session (job.js): the chat says what they picked.
582
590
  flags: (kind) => {
583
- // The thread's own pick over the project's (`spec.pick`, as the thread's agent started).
584
- s.pick = { ...wordsOf(spec.pick), ...pickIn(s.td) };
591
+ // The thread's own pick over the project's (`spec.pick`, as the thread's agent started),
592
+ // over the agent's defaults (Board-PRD decision 36).
593
+ s.pick = { ...s.adapter.defaults, ...wordsOf(spec.pick), ...pickIn(s.td) };
585
594
 
586
595
  return s.flags(kind, s.summary, s.pick);
587
596
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gcf-session",
3
- "version": "0.14.0",
3
+ "version": "0.17.0",
4
4
  "private": true,
5
5
  "description": "The session engine of GCF: one agent session and a run as a chain of them, the chat protocol, the provider adapters. Bundled by gcf-harness-aif-ext and gcf-board, never published.",
6
6
  "type": "module",
@@ -15,7 +15,7 @@ export type ChatEvent = At &
15
15
  kind: 'start' | 'resume' | 'handoff';
16
16
  v?: number;
17
17
  summary?: string;
18
- /** A project chat's: the model and effort it started with; null, the agent's own. */
18
+ /** A project chat's: the model and effort it started with; null, the agent's own default. */
19
19
  model?: string | null;
20
20
  effort?: string | null;
21
21
  }
@@ -136,11 +136,19 @@ export interface Thread {
136
136
  item: string | null;
137
137
  /** The inbox entry the thread drafts an item from (Draft with agent); null for none. */
138
138
  entry: string | null;
139
+ /** What the thread was started for (a board's design start); null for none. */
140
+ start: ThreadStart | null;
139
141
  sessions: { session_id?: string; ended: string; kind: string; summary?: string }[];
140
142
  created_at: string;
141
143
  in_at: number;
142
144
  }
143
145
 
146
+ /** A start a thread runs by: its id, and what the caller gave it (a file, a unit, a text). */
147
+ export interface ThreadStart {
148
+ id: string;
149
+ [key: string]: string;
150
+ }
151
+
144
152
  /** How a thread runs, `chats/<t>/spec.json`: the center writes it. */
145
153
  export interface ThreadSpec {
146
154
  agent: string;
@@ -156,7 +164,10 @@ export interface ThreadSpec {
156
164
  pick?: AgentPick;
157
165
  }
158
166
 
159
- /** The model and effort an operator picked, `chats/<t>/agent.json`: none, the agent's own. */
167
+ /**
168
+ * The model and effort an operator picked, `chats/<t>/agent.json`: none, the project's, else the
169
+ * agent's defaults (`defaultsOf`, Board-PRD decision 36).
170
+ */
160
171
  export interface AgentPick {
161
172
  model?: string;
162
173
  effort?: string;
@@ -175,9 +186,11 @@ export declare function setThreadAgent(
175
186
  pick: { model?: string | null; effort?: string | null },
176
187
  ): AgentPick;
177
188
  export declare function presetsOf(agent: string): AgentPresets;
189
+ /** What `agent`'s sessions run on when neither they nor the project pick (decision 36). */
190
+ export declare function defaultsOf(agent: string): AgentPick;
178
191
  export declare function createThread(
179
192
  dir: string,
180
- opts?: { item?: string | null; entry?: string | null },
193
+ opts?: { item?: string | null; entry?: string | null; start?: ThreadStart | null },
181
194
  ): string;
182
195
  export declare function threadOf(dir: string, item: string): string | null;
183
196
  export declare function threadOfEntry(dir: string, entry: string): string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gcf-board",
3
- "version": "0.11.0",
3
+ "version": "0.16.2",
4
4
  "description": "A local web board for GCF game projects: shows `gcf board --json` and runs the same ai-factory gcf commands an operator runs in a console",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -22,6 +22,7 @@
22
22
  },
23
23
  "files": [
24
24
  "dist",
25
+ "themes",
25
26
  "README.md"
26
27
  ],
27
28
  "engines": {
@@ -0,0 +1,41 @@
1
+ {
2
+ "gcf_theme": 1,
3
+ "name": "Cream · medium",
4
+ "scheme": "light",
5
+ "tokens": {
6
+ "bg": "oklch(0.932 0.019 80)",
7
+ "s1": "oklch(0.95 0.016 80)",
8
+ "s2": "oklch(0.968 0.012 82)",
9
+ "s3": "oklch(0.905 0.022 78)",
10
+ "line": "oklch(0.865 0.022 76)",
11
+ "line-2": "oklch(0.76 0.028 74)",
12
+ "text": "oklch(0.27 0.02 60)",
13
+ "text-2": "oklch(0.39 0.022 60)",
14
+ "text-3": "oklch(0.465 0.02 60)",
15
+ "focus": "oklch(0.5 0.13 215)",
16
+ "scrim": "oklch(0.3 0.03 60 / 0.32)",
17
+ "shadow": "oklch(0.4 0.04 60 / 16%)",
18
+ "on-accent": "oklch(0.985 0.01 80)",
19
+ "ready": "oklch(0.465 0.07 255)",
20
+ "running": "oklch(0.44 0.11 172)",
21
+ "blocked": "oklch(0.47 0.12 68)",
22
+ "needs": "oklch(0.48 0.18 355)",
23
+ "unplayed": "oklch(0.475 0.13 312)",
24
+ "parked": "oklch(0.465 0.012 75)",
25
+ "queued": "oklch(0.465 0.012 75)",
26
+ "neutral": "oklch(0.46 0.045 235)",
27
+ "verified": "oklch(0.45 0.12 150)",
28
+ "error": "oklch(0.475 0.18 28)",
29
+ "warn": "oklch(0.47 0.12 68)",
30
+ "ok": "oklch(0.45 0.12 150)",
31
+ "accent": "oklch(0.44 0.11 172)",
32
+ "gate-verdict": "oklch(0.47 0.1 290)",
33
+ "gate-auto": "oklch(0.46 0.06 222)",
34
+ "gate-decision": "oklch(0.46 0.1 95)",
35
+ "sev-critical": "oklch(0.475 0.18 28)",
36
+ "sev-high": "oklch(0.475 0.15 48)",
37
+ "sev-medium": "oklch(0.39 0.022 60)",
38
+ "sev-low": "oklch(0.465 0.02 60)",
39
+ "agent": "oklch(0.49 0.13 255)"
40
+ }
41
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "gcf_theme": 1,
3
+ "name": "Dusk · soft dark",
4
+ "scheme": "dark",
5
+ "tokens": {
6
+ "bg": "oklch(0.245 0.01 65)",
7
+ "s1": "oklch(0.275 0.011 65)",
8
+ "s2": "oklch(0.305 0.012 66)",
9
+ "s3": "oklch(0.345 0.013 66)",
10
+ "line": "oklch(0.37 0.012 66)",
11
+ "line-2": "oklch(0.47 0.015 68)",
12
+ "text": "oklch(0.89 0.012 80)",
13
+ "text-2": "oklch(0.8 0.014 78)",
14
+ "text-3": "oklch(0.76 0.02 80)",
15
+ "focus": "oklch(0.84 0.1 172)",
16
+ "scrim": "oklch(0.1 0.01 65 / 0.55)",
17
+ "shadow": "oklch(0.08 0.01 65 / 40%)",
18
+ "on-accent": "oklch(0.2 0.02 172)",
19
+ "ready": "oklch(0.78 0.053 255)",
20
+ "running": "oklch(0.77 0.083 172)",
21
+ "blocked": "oklch(0.785 0.09 68)",
22
+ "needs": "oklch(0.795 0.135 355)",
23
+ "unplayed": "oklch(0.79 0.098 312)",
24
+ "parked": "oklch(0.78 0.009 75)",
25
+ "queued": "oklch(0.78 0.009 75)",
26
+ "neutral": "oklch(0.78 0.034 235)",
27
+ "verified": "oklch(0.77 0.09 150)",
28
+ "error": "oklch(0.795 0.135 28)",
29
+ "warn": "oklch(0.785 0.09 68)",
30
+ "ok": "oklch(0.77 0.09 150)",
31
+ "accent": "oklch(0.77 0.083 172)",
32
+ "gate-verdict": "oklch(0.785 0.075 290)",
33
+ "gate-auto": "oklch(0.775 0.045 222)",
34
+ "gate-decision": "oklch(0.78 0.075 95)",
35
+ "sev-critical": "oklch(0.795 0.135 28)",
36
+ "sev-high": "oklch(0.79 0.112 48)",
37
+ "sev-medium": "oklch(0.8 0.014 78)",
38
+ "sev-low": "oklch(0.76 0.02 80)",
39
+ "agent": "oklch(0.79 0.1 250)"
40
+ }
41
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "gcf_theme": 1,
3
+ "name": "Paper · soft",
4
+ "scheme": "light",
5
+ "tokens": {
6
+ "bg": "oklch(0.945 0.013 88)",
7
+ "s1": "oklch(0.958 0.011 88)",
8
+ "s2": "oklch(0.97 0.009 88)",
9
+ "s3": "oklch(0.925 0.015 86)",
10
+ "line": "oklch(0.89 0.014 84)",
11
+ "line-2": "oklch(0.8 0.018 80)",
12
+ "text": "oklch(0.34 0.02 70)",
13
+ "text-2": "oklch(0.44 0.02 70)",
14
+ "text-3": "oklch(0.475 0.02 70)",
15
+ "focus": "oklch(0.5 0.13 215)",
16
+ "scrim": "oklch(0.3 0.03 68 / 0.32)",
17
+ "shadow": "oklch(0.4 0.04 68 / 16%)",
18
+ "on-accent": "oklch(0.985 0.01 88)",
19
+ "ready": "oklch(0.47 0.056 255)",
20
+ "running": "oklch(0.46 0.088 172)",
21
+ "blocked": "oklch(0.475 0.096 68)",
22
+ "needs": "oklch(0.49 0.144 355)",
23
+ "unplayed": "oklch(0.485 0.104 312)",
24
+ "parked": "oklch(0.475 0.01 75)",
25
+ "queued": "oklch(0.475 0.01 75)",
26
+ "neutral": "oklch(0.47 0.036 235)",
27
+ "verified": "oklch(0.46 0.096 150)",
28
+ "error": "oklch(0.485 0.144 28)",
29
+ "warn": "oklch(0.475 0.096 68)",
30
+ "ok": "oklch(0.46 0.096 150)",
31
+ "accent": "oklch(0.46 0.088 172)",
32
+ "gate-verdict": "oklch(0.48 0.08 290)",
33
+ "gate-auto": "oklch(0.47 0.048 222)",
34
+ "gate-decision": "oklch(0.47 0.08 95)",
35
+ "sev-critical": "oklch(0.485 0.144 28)",
36
+ "sev-high": "oklch(0.48 0.12 48)",
37
+ "sev-medium": "oklch(0.44 0.02 70)",
38
+ "sev-low": "oklch(0.475 0.02 70)",
39
+ "agent": "oklch(0.5 0.12 255)"
40
+ }
41
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "gcf_theme": 1,
3
+ "name": "Sand · contrast",
4
+ "scheme": "light",
5
+ "tokens": {
6
+ "bg": "oklch(0.9 0.03 74)",
7
+ "s1": "oklch(0.928 0.025 76)",
8
+ "s2": "oklch(0.958 0.017 80)",
9
+ "s3": "oklch(0.87 0.033 72)",
10
+ "line": "oklch(0.82 0.033 70)",
11
+ "line-2": "oklch(0.68 0.04 68)",
12
+ "text": "oklch(0.2 0.02 55)",
13
+ "text-2": "oklch(0.33 0.025 55)",
14
+ "text-3": "oklch(0.44 0.02 55)",
15
+ "focus": "oklch(0.5 0.13 215)",
16
+ "scrim": "oklch(0.3 0.03 52 / 0.32)",
17
+ "shadow": "oklch(0.4 0.04 52 / 16%)",
18
+ "on-accent": "oklch(0.985 0.01 72)",
19
+ "ready": "oklch(0.44 0.081 255)",
20
+ "running": "oklch(0.405 0.127 172)",
21
+ "blocked": "oklch(0.445 0.138 68)",
22
+ "needs": "oklch(0.435 0.207 355)",
23
+ "unplayed": "oklch(0.455 0.149 312)",
24
+ "parked": "oklch(0.44 0.014 75)",
25
+ "queued": "oklch(0.44 0.014 75)",
26
+ "neutral": "oklch(0.435 0.052 235)",
27
+ "verified": "oklch(0.415 0.138 150)",
28
+ "error": "oklch(0.43 0.207 28)",
29
+ "warn": "oklch(0.445 0.138 68)",
30
+ "ok": "oklch(0.415 0.138 150)",
31
+ "accent": "oklch(0.405 0.127 172)",
32
+ "gate-verdict": "oklch(0.45 0.115 290)",
33
+ "gate-auto": "oklch(0.435 0.069 222)",
34
+ "gate-decision": "oklch(0.44 0.115 95)",
35
+ "sev-critical": "oklch(0.43 0.207 28)",
36
+ "sev-high": "oklch(0.45 0.172 48)",
37
+ "sev-medium": "oklch(0.33 0.025 55)",
38
+ "sev-low": "oklch(0.44 0.02 55)",
39
+ "agent": "oklch(0.45 0.145 258)"
40
+ }
41
+ }