gcf-board 0.27.0 → 0.28.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/dist/server/app.js +25 -8
- package/dist/server/runs.js +34 -4
- package/dist/server/talks.js +18 -13
- package/dist/web/assets/index-CcsKtA2D.js +119 -0
- package/dist/web/index.html +1 -1
- package/node_modules/gcf-session/lib/chat.js +12 -0
- package/node_modules/gcf-session/lib/usage.js +8 -0
- package/node_modules/gcf-session/package.json +1 -1
- package/package.json +2 -2
- package/dist/web/assets/index-Ds32enMs.js +0 -116
package/dist/web/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
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-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-CcsKtA2D.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-BCfiz95-.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
@@ -100,6 +100,9 @@ function refusedBy(deny, call) {
|
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
/** A call's error text when a deny rule refused it: a path rule's, or a command rule's. */
|
|
104
|
+
const DENIED_TEXT = /denied by your permission settings|Permission to use .+ has been denied/;
|
|
105
|
+
|
|
103
106
|
/** How long a question waits for the operator when neither the flag nor the config says. */
|
|
104
107
|
export const CHAT_TIMEOUT_MIN = 15;
|
|
105
108
|
|
|
@@ -852,6 +855,9 @@ const SEEN = {
|
|
|
852
855
|
// stays out of the chat. The session's rule that holds for it, and the rule's group, say what
|
|
853
856
|
// refused it (refusedBy).
|
|
854
857
|
refused: (c, e) => {
|
|
858
|
+
// One refusal comes as the system event and as its call's error text: it posts once.
|
|
859
|
+
if (c.refusedIds.has(e.id)) return;
|
|
860
|
+
c.refusedIds.add(e.id);
|
|
855
861
|
const call = c.calls.get(e.id);
|
|
856
862
|
const why = typeof call?.input?.description === 'string' ? call.input.description : '';
|
|
857
863
|
post(c, {
|
|
@@ -873,6 +879,11 @@ const SEEN = {
|
|
|
873
879
|
if (!e.sub && m) c.proposals.set(e.id, { move: m[1].replaceAll('_', '-'), fields: e.input });
|
|
874
880
|
},
|
|
875
881
|
tool_result: (c, e) => {
|
|
882
|
+
// A deny rule on a path refuses in the tool's own input check: claude sends no
|
|
883
|
+
// permission_denied then, only this error text (spike in docs/Session-Engine.md).
|
|
884
|
+
const call = c.calls.get(e.id);
|
|
885
|
+
if (e.error && call && DENIED_TEXT.test(e.text))
|
|
886
|
+
SEEN.refused(c, { type: 'refused', id: e.id, tool: call.tool, reason: e.text });
|
|
876
887
|
c.calls.delete(e.id);
|
|
877
888
|
const p = c.proposals.get(e.id);
|
|
878
889
|
if (!p) return;
|
|
@@ -1029,6 +1040,7 @@ function chatState(opts) {
|
|
|
1029
1040
|
...{ sent: 0, read: 0, cards: new Map(), wait: null, defaulted: false, closed: false },
|
|
1030
1041
|
...{ stopped: false, stopWait: false, grace: null, idle: false, inTurn: true, tasks: [] },
|
|
1031
1042
|
...{ proposals: new Map(), calls: new Map(), heard: false, summary: null, wanted: null },
|
|
1043
|
+
refusedIds: new Set(),
|
|
1032
1044
|
// When each task's last progress reached the chat; the last one it held back since.
|
|
1033
1045
|
taskAt: new Map(),
|
|
1034
1046
|
taskHeld: new Map(),
|
|
@@ -167,6 +167,7 @@ const fresh = (r, maxAgeMs, now) =>
|
|
|
167
167
|
Boolean(r?.at) && now - Date.parse(r.at) < maxAgeMs && !r.failed;
|
|
168
168
|
|
|
169
169
|
// One ask a process: a second caller waits for it (claim gives the lock to its own pid again).
|
|
170
|
+
/** @type {ReturnType<typeof askShared> | null} */
|
|
170
171
|
let inFlight = null;
|
|
171
172
|
|
|
172
173
|
/**
|
|
@@ -248,6 +249,11 @@ const scopedTo = (limit, model) => {
|
|
|
248
249
|
);
|
|
249
250
|
};
|
|
250
251
|
|
|
252
|
+
/**
|
|
253
|
+
* @typedef {{go: true} | {wait: true, until: Date, reserve: true}
|
|
254
|
+
* | {stop: true, why: string, reserve: {weekly?: boolean, until?: string | null}}} Reserve
|
|
255
|
+
*/
|
|
256
|
+
|
|
251
257
|
/**
|
|
252
258
|
* The reserve's gate over a reading (`usage.json`): a failed ask is no reading, so it goes
|
|
253
259
|
* (Hold-Plan d10), as does none.
|
|
@@ -255,6 +261,7 @@ const scopedTo = (limit, model) => {
|
|
|
255
261
|
* @param {string | null | undefined} model
|
|
256
262
|
* @param {number} pct
|
|
257
263
|
* @param {number} [now]
|
|
264
|
+
* @returns {Reserve}
|
|
258
265
|
*/
|
|
259
266
|
export const reserveOfReading = (reading, model, pct, now = Date.now()) =>
|
|
260
267
|
reading && !reading.failed ? reserveOf(reading.limits, model, pct, now) : { go: true };
|
|
@@ -267,6 +274,7 @@ export const reserveOfReading = (reading, model, pct, now = Date.now()) =>
|
|
|
267
274
|
* @param {string | null | undefined} model
|
|
268
275
|
* @param {number} pct
|
|
269
276
|
* @param {number} [now]
|
|
277
|
+
* @returns {Reserve}
|
|
270
278
|
*/
|
|
271
279
|
export function reserveOf(limits, model, pct, now = Date.now()) {
|
|
272
280
|
if (!limits?.length) return { go: true };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gcf-session",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.2",
|
|
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.28.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",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"vite": "^8.3.4"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@modelcontextprotocol/server": "2.
|
|
56
|
+
"@modelcontextprotocol/server": "2.4.0",
|
|
57
57
|
"gcf-session": "file:../gcf-session"
|
|
58
58
|
},
|
|
59
59
|
"bundleDependencies": [
|