gcf-board 0.20.0 → 0.22.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/README.md +5 -0
- package/dist/server/app.js +59 -4
- package/dist/server/cli.js +17 -8
- package/dist/server/events.js +15 -6
- package/dist/server/runs.js +89 -12
- package/dist/shared/board.js +2 -0
- package/dist/web/assets/index-D7HJ7-ko.css +1 -0
- package/dist/web/assets/index-Dhh107oY.js +113 -0
- package/dist/web/index.html +2 -2
- package/node_modules/gcf-session/lib/activity.js +9 -5
- package/node_modules/gcf-session/lib/chat.js +16 -3
- package/node_modules/gcf-session/lib/session.js +3 -1
- package/node_modules/gcf-session/package.json +1 -1
- package/package.json +1 -1
- package/dist/web/assets/index-7axl-gEt.js +0 -95
- package/dist/web/assets/index-B_28Lkc9.css +0 -1
package/dist/web/index.html
CHANGED
|
@@ -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-
|
|
8
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-Dhh107oY.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/assets/index-D7HJ7-ko.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="root"></div>
|
|
@@ -27,6 +27,7 @@ const whole = (text) => {
|
|
|
27
27
|
? `${line.slice(0, LOG_MAX)}… (${line.length - LOG_MAX} more characters)`
|
|
28
28
|
: line;
|
|
29
29
|
};
|
|
30
|
+
|
|
30
31
|
const LOG_MAX = 8000;
|
|
31
32
|
|
|
32
33
|
/** The first `n` non-empty lines of a text, trimmed, on one line. */
|
|
@@ -148,13 +149,16 @@ export function activity(line, now = new Date()) {
|
|
|
148
149
|
function logged(e, now) {
|
|
149
150
|
const at = `[${clock(now)}]`;
|
|
150
151
|
const content = Array.isArray(e.message?.content) ? e.message.content : [];
|
|
152
|
+
// A subagent's lines say whose they are.
|
|
153
|
+
const sub = e.parent_tool_use_id != null;
|
|
151
154
|
if (e.type === 'system') return system(e, at);
|
|
152
|
-
if (e.type === 'assistant') return { ...said(content, at), ...contextOf(e) };
|
|
155
|
+
if (e.type === 'assistant') return { ...said(content, at, sub), ...contextOf(e) };
|
|
153
156
|
if (e.type === 'user') {
|
|
154
157
|
const errors = content.filter((b) => b.type === 'tool_result' && b.is_error);
|
|
158
|
+
const head = sub ? 'subagent tool error' : 'tool error';
|
|
155
159
|
|
|
156
160
|
return {
|
|
157
|
-
lines: errors.map((b) => `${at}
|
|
161
|
+
lines: errors.map((b) => `${at} ${head}: ${whole(resultText(b.content))}`),
|
|
158
162
|
// A refused or failed call wrote nothing: its write does not count.
|
|
159
163
|
...(errors.length ? { failed: errors.map((b) => String(b.tool_use_id)) } : {}),
|
|
160
164
|
};
|
|
@@ -415,16 +419,16 @@ function contextOf(e) {
|
|
|
415
419
|
}
|
|
416
420
|
|
|
417
421
|
/** An assistant turn: its tool calls and its text, which may be the usage-limit message. */
|
|
418
|
-
function said(content, at) {
|
|
422
|
+
function said(content, at, sub) {
|
|
419
423
|
const texts = content.filter((b) => b.type === 'text').map((b) => b.text);
|
|
420
424
|
|
|
421
425
|
return {
|
|
422
426
|
...(texts.map((t) => limitIn(t)).find((l) => l.limit) ?? {}),
|
|
423
427
|
lines: content.flatMap((b) => {
|
|
424
|
-
if (b.type === 'tool_use') return [`${at} ${toolLine(b)}`];
|
|
428
|
+
if (b.type === 'tool_use') return [`${at} ${sub ? 'subagent ' : ''}${toolLine(b)}`];
|
|
425
429
|
const text = b.type === 'text' ? cut(firstLines(b.text, 2), 300) : '';
|
|
426
430
|
|
|
427
|
-
return text ? [`${at} agent: ${text}`] : [];
|
|
431
|
+
return text ? [`${at} ${sub ? 'subagent' : 'agent'}: ${text}`] : [];
|
|
428
432
|
}),
|
|
429
433
|
};
|
|
430
434
|
}
|
|
@@ -198,11 +198,12 @@ function readRaw(file, from, to) {
|
|
|
198
198
|
|
|
199
199
|
/**
|
|
200
200
|
* A question card's answers past the timeout: each one's recommended option, or `fallback`.
|
|
201
|
+
* `picks: false`: `fallback` alone, for a question only the operator may answer.
|
|
201
202
|
*/
|
|
202
|
-
export function defaultAnswers(questions = [], fallback = DEFAULT_ANSWER) {
|
|
203
|
+
export function defaultAnswers(questions = [], fallback = DEFAULT_ANSWER, { picks = true } = {}) {
|
|
203
204
|
return Object.fromEntries(
|
|
204
205
|
questions.map((q) => {
|
|
205
|
-
const pick = (q.options ?? []).find((o) => RECOMMENDED.test(o.label ?? ''));
|
|
206
|
+
const pick = picks && (q.options ?? []).find((o) => RECOMMENDED.test(o.label ?? ''));
|
|
206
207
|
|
|
207
208
|
return [q.question, pick ? pick.label.replace(RECOMMENDED, '') : fallback];
|
|
208
209
|
}),
|
|
@@ -684,7 +685,13 @@ function waitCards(c) {
|
|
|
684
685
|
waitFor(c, 'card', () => {
|
|
685
686
|
for (const [rid, card] of [...c.cards])
|
|
686
687
|
if (card.approval) void decided(c, rid, { allow: false, by: 'timeout' });
|
|
687
|
-
else
|
|
688
|
+
else
|
|
689
|
+
answer(
|
|
690
|
+
c,
|
|
691
|
+
rid,
|
|
692
|
+
defaultAnswers(card.questions, c.defaultAnswer, { picks: c.silencePicks }),
|
|
693
|
+
'timeout',
|
|
694
|
+
);
|
|
688
695
|
});
|
|
689
696
|
}
|
|
690
697
|
|
|
@@ -756,12 +763,15 @@ export function taskGate(c, e, now, later) {
|
|
|
756
763
|
|
|
757
764
|
return false;
|
|
758
765
|
}
|
|
766
|
+
|
|
759
767
|
c.taskAt.set(e.id, now);
|
|
760
768
|
}
|
|
769
|
+
|
|
761
770
|
if (held) {
|
|
762
771
|
clearTimeout(held.timer);
|
|
763
772
|
c.taskHeld.delete(e.id);
|
|
764
773
|
}
|
|
774
|
+
|
|
765
775
|
if (e.phase === 'end') c.taskAt.delete(e.id);
|
|
766
776
|
|
|
767
777
|
return true;
|
|
@@ -845,6 +855,7 @@ const SEEN = {
|
|
|
845
855
|
const last = flushed(c, e.id);
|
|
846
856
|
if (!c.closed) SEEN.task(c, last);
|
|
847
857
|
};
|
|
858
|
+
|
|
848
859
|
if (!taskGate(c, e, Date.now(), later)) return;
|
|
849
860
|
const prompt = e.phase === 'start' ? e.prompt : null;
|
|
850
861
|
post(c, {
|
|
@@ -954,6 +965,8 @@ const CHAT_DEFAULTS = {
|
|
|
954
965
|
graceMs: READ_GRACE_MS,
|
|
955
966
|
steps: { see: () => [] },
|
|
956
967
|
defaultAnswer: DEFAULT_ANSWER,
|
|
968
|
+
// Whether silence on a question takes its recommended option.
|
|
969
|
+
silencePicks: true,
|
|
957
970
|
askNone: ASK_NONE,
|
|
958
971
|
encode: claudeInput,
|
|
959
972
|
approvals: false,
|
|
@@ -41,7 +41,8 @@ function absorb(seen, a) {
|
|
|
41
41
|
* flags the session past its share or at a compaction (`handoff.flag`), and calls `stop` once it
|
|
42
42
|
* works on past more. `windowOf(model)` is the window the share is taken of. A run's `fresh`
|
|
43
43
|
* session (no resume) over the share at its first reading starts there: a fresh one after it,
|
|
44
|
-
* on the same prompt, would too, so the share does not hand it over (a live run at 10%, 2026-11-03:
|
|
44
|
+
* on the same prompt, would too, so the share does not hand it over (a live run at 10%, 2026-11-03:
|
|
45
|
+
* three sessions of 19% each
|
|
45
46
|
* handed over before any work, and the item blocked); a compaction still does.
|
|
46
47
|
*/
|
|
47
48
|
function handoffWatch(handoff, windowOf, write, { stop, onFlag, fresh = false }) {
|
|
@@ -84,6 +85,7 @@ function handoffWatch(handoff, windowOf, write, { stop, onFlag, fresh = false })
|
|
|
84
85
|
`context_handoff_pct ${handoff.pct}: a fresh session would start there too; raise it`,
|
|
85
86
|
]);
|
|
86
87
|
}
|
|
88
|
+
|
|
87
89
|
if (!w.flagged && (compacted || (share >= handoff.pct && !w.under))) flag(win, pct, compacted);
|
|
88
90
|
// A project chat hands over by its summary turn, which goes on past the flag (AD-42).
|
|
89
91
|
if (handoff.soft) return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gcf-session",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.1",
|
|
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",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gcf-board",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
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",
|