@onepointfour-packs/flaredeck-agent 0.2.15 → 0.2.21
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/agent.js +14 -1
- package/dist/agent.js.map +1 -1
- package/dist/automode.js +4 -2
- package/dist/automode.js.map +1 -1
- package/dist/browser.js +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/connect.js +6 -6
- package/dist/connect.js.map +1 -1
- package/dist/engine-antigravity.js +1 -1
- package/dist/flaredeck-proxy.d.ts +6 -0
- package/dist/flaredeck-proxy.js +6 -0
- package/dist/flaredeck-proxy.js.map +1 -1
- package/dist/jevguard.d.ts +5 -0
- package/dist/jevguard.js +12 -5
- package/dist/jevguard.js.map +1 -1
- package/dist/localmcp.js +1 -1
- package/dist/main.js +22 -11
- package/dist/main.js.map +1 -1
- package/dist/oauth.js +11 -1
- package/dist/oauth.js.map +1 -1
- package/dist/preflight.js +44 -2
- package/dist/preflight.js.map +1 -1
- package/dist/runs.d.ts +43 -14
- package/dist/runs.js +91 -50
- package/dist/runs.js.map +1 -1
- package/dist/serve.js +57 -23
- package/dist/serve.js.map +1 -1
- package/dist/team.js +3 -3
- package/dist/team.js.map +1 -1
- package/dist/ui.d.ts +1 -1
- package/package.json +1 -1
package/dist/runs.js
CHANGED
|
@@ -5,22 +5,42 @@ import { sdkServer } from './localmcp.js';
|
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { flaredeckDecider } from './approval.js';
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Being stuck, as one tool.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* An agent that cannot get further has exactly one thing to reach for, and what it puts in the
|
|
11
|
+
* call decides what a person sees. Without a script it is a question: the card is flagged, the
|
|
12
|
+
* board's named answerer is told, and the session ends until somebody clears it. With a script
|
|
13
|
+
* it is a request: the script goes on the card as an approval, a person reads it and taps, and
|
|
14
|
+
* if they approve THE HARNESS runs it and hands the output back — the agent carries on in the
|
|
15
|
+
* same turn, holding no credential and having executed nothing itself.
|
|
15
16
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
17
|
+
* This was two tools, and the split was the problem rather than the solution. `set-needs-human`
|
|
18
|
+
* was the only escalation most agents ever saw, because the other one was mounted only on a
|
|
19
|
+
* machine with a production target configured — and none were. So an agent that needed one
|
|
20
|
+
* command run asked a person to go and type it on two machines, and waited. One tool with an
|
|
21
|
+
* optional script cannot have that failure: the script path is always there, and a shell on this
|
|
22
|
+
* machine is a target without anybody configuring one.
|
|
23
|
+
*
|
|
24
|
+
* What a person approves is what runs. The script is bound to the approval by its hash, and
|
|
25
|
+
* where it is an UPDATE or DELETE with a WHERE clause the harness derives a COUNT from that same
|
|
26
|
+
* clause and runs it first, so "would touch N rows" sits beside the script while they decide.
|
|
27
|
+
* That count is the harness's, from the agent's clause — the agent's own description of its own
|
|
28
|
+
* script is never enough on its own.
|
|
29
|
+
*/
|
|
30
|
+
export const RUN_TOOL_NAMES = ['mcp__human__set-needs-human'];
|
|
31
|
+
/** The wire name on the approval request: what a lead reviews and what a restart resumes. */
|
|
32
|
+
export const SCRIPT_REQUEST = 'run_script';
|
|
33
|
+
/**
|
|
34
|
+
* The target every machine has without anybody configuring one. No cwd, so it runs in the
|
|
35
|
+
* checkout of the card being worked — and a script may still leave it, because a person read
|
|
36
|
+
* the script before it ran.
|
|
22
37
|
*/
|
|
23
|
-
export const
|
|
38
|
+
export const SHELL = {
|
|
39
|
+
command: ['bash', '-lc', '{script}'],
|
|
40
|
+
about: 'a shell on this machine, starting in your checkout',
|
|
41
|
+
};
|
|
42
|
+
/** Configured targets, plus the shell. A configured `shell` wins — the machine's owner meant it. */
|
|
43
|
+
export const allTargets = (configured = {}) => ({ shell: SHELL, ...configured });
|
|
24
44
|
/** Long enough for a person on a phone; a run that nobody answers is not run. */
|
|
25
45
|
const RUN_APPROVAL_MS = 60 * 60 * 1000;
|
|
26
46
|
const OUTPUT_CAP = 6000;
|
|
@@ -100,7 +120,7 @@ export async function resumeApprovedRuns(targets, deck, cwd, log) {
|
|
|
100
120
|
return 0;
|
|
101
121
|
}
|
|
102
122
|
for (const a of owed) {
|
|
103
|
-
if (a.tool_name !==
|
|
123
|
+
if (a.tool_name !== SCRIPT_REQUEST)
|
|
104
124
|
continue;
|
|
105
125
|
const desc = a.description || '';
|
|
106
126
|
const name = desc.split('"')[1] ?? a.request_id;
|
|
@@ -124,54 +144,70 @@ export async function resumeApprovedRuns(targets, deck, cwd, log) {
|
|
|
124
144
|
}
|
|
125
145
|
return n;
|
|
126
146
|
}
|
|
127
|
-
export function runTools(
|
|
128
|
-
/** This agent's lead, when it has one:
|
|
147
|
+
export function runTools(configured, current, deck, log, human,
|
|
148
|
+
/** This agent's lead, when it has one: a script goes there first, and a person is asked only if the lead endorses it. */
|
|
129
149
|
lead = () => null,
|
|
130
150
|
/** The pane, told when a request is posted and when it is answered. */
|
|
131
151
|
onAsk = () => { }) {
|
|
152
|
+
const targets = allTargets(configured);
|
|
132
153
|
const names = Object.keys(targets);
|
|
133
154
|
const list = names.map((n) => ` · ${n}${targets[n].about ? ` — ${targets[n].about}` : ''}`).join('\n');
|
|
134
155
|
const server = sdkServer({
|
|
135
|
-
name: '
|
|
156
|
+
name: 'human',
|
|
136
157
|
version: '1.0.0',
|
|
137
158
|
tools: [
|
|
138
|
-
tool('
|
|
139
|
-
'
|
|
140
|
-
'
|
|
141
|
-
'
|
|
142
|
-
'
|
|
143
|
-
'
|
|
144
|
-
'it is
|
|
145
|
-
'
|
|
146
|
-
'
|
|
147
|
-
'
|
|
148
|
-
'
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
159
|
+
tool('set-needs-human', 'Stop and involve a person. This is the ONLY way to do that, and what you put in it ' +
|
|
160
|
+
'decides what they get.\n\n' +
|
|
161
|
+
'Without `script` it is a question. The card is flagged, whoever the board names for this ' +
|
|
162
|
+
'kind of thing is told, and your turn ends — you are not waiting, and you do not carry on ' +
|
|
163
|
+
'without the answer. Use it for what only a person can supply: a decision, a credential, ' +
|
|
164
|
+
'access that does not exist.\n\n' +
|
|
165
|
+
'With `script` it is a request to RUN something. A person reads the script itself and ' +
|
|
166
|
+
'approves or denies it; if they approve, the HARNESS runs it and gives you the output, and ' +
|
|
167
|
+
'you carry on in this same turn. Use it when the thing you need is a command, in a place ' +
|
|
168
|
+
'you cannot reach — a live database, a deployed service, a checkout that is not yours. ' +
|
|
169
|
+
'You never hold the credential and you never run it. If you report to a lead, the lead ' +
|
|
170
|
+
'reads the script first and only an endorsed request reaches a person. A denial is final ' +
|
|
171
|
+
'for that script: do not send it again unchanged.\n\n' +
|
|
172
|
+
'What does NOT belong here: anything inside your own checkout. Installing dependencies, ' +
|
|
173
|
+
'building, running the tests, starting the app — you have the shell, do it yourself. ' +
|
|
174
|
+
'Asking a person to type a command you could have typed costs them an hour and you the ' +
|
|
175
|
+
'card.\n\nPlaces a script can run:\n' + list, {
|
|
176
|
+
reason: z.string().describe('What you need and why, in plain sentences, for the person reading it.'),
|
|
177
|
+
kind: z
|
|
178
|
+
.enum(['technical', 'product', 'access', 'information', 'business'])
|
|
179
|
+
.describe('What sort of thing this is, so it reaches the right person: technical, product, access, information, or business.'),
|
|
180
|
+
script: z.string().optional().describe('The exact script, when what you need is something RUN. What is approved is what runs, byte for byte. Leave it out if you are asking a question.'),
|
|
181
|
+
where: z.string().optional().describe(`Which place the script runs in. One of: ${names.join(', ')}. Defaults to shell.`),
|
|
182
|
+
expected_effect: z.string().optional().describe('With a script: what you expect it to change or return, e.g. "1 row inserted" or "returns ~5 rows".'),
|
|
183
|
+
}, async ({ reason, kind, script, where, expected_effect }) => {
|
|
158
184
|
const cur = current();
|
|
159
185
|
if (!cur)
|
|
160
|
-
return say('There is no card being worked, so there is
|
|
186
|
+
return say('There is no card being worked, so there is nobody to ask about it.', true);
|
|
161
187
|
if (!deck)
|
|
162
|
-
return say('This harness has no FlareDeck credentials of its own, so it cannot
|
|
163
|
-
const body = script.trim();
|
|
164
|
-
|
|
165
|
-
|
|
188
|
+
return say('This harness has no FlareDeck credentials of its own, so it cannot reach a person.', true);
|
|
189
|
+
const body = (script ?? '').trim();
|
|
190
|
+
// A question. The card is flagged and the turn is over — nothing here waits.
|
|
191
|
+
if (!body) {
|
|
192
|
+
const told = await human.flag(reason, kind);
|
|
193
|
+
return say(`Flagged for a person.${told ? ` ${told}` : ''}\n\nEnd your turn now. You are not waiting for ` +
|
|
194
|
+
`this — the card comes back to you when somebody clears it, and whatever you have done so ` +
|
|
195
|
+
`far should be committed and said on the card before you stop.`);
|
|
196
|
+
}
|
|
197
|
+
const name = where?.trim() || 'shell';
|
|
198
|
+
const t = targets[name];
|
|
199
|
+
if (!t)
|
|
200
|
+
return say(`There is no place called "${name}" to run a script. Places: ${names.join(', ')}.`, true);
|
|
166
201
|
if (body.length > 18_000)
|
|
167
202
|
return say(`The script is ${body.length} characters; the approval record holds 18,000. Split it into smaller runs, each reviewed on its own.`, true);
|
|
168
203
|
const hash = createHash('sha256').update(body).digest('hex').slice(0, 12);
|
|
204
|
+
const label = reason.trim().split('\n')[0].slice(0, 60);
|
|
169
205
|
// The harness's own check, before anyone is asked. Read-only by construction.
|
|
170
206
|
let previewNote = '';
|
|
171
207
|
let previewLine = '';
|
|
172
208
|
const preview = previewFor(body);
|
|
173
209
|
if (preview) {
|
|
174
|
-
log(`preview for ${
|
|
210
|
+
log(`preview for ${label}: ${preview}`);
|
|
175
211
|
const p = await exec(t, preview, cur.cwd);
|
|
176
212
|
previewLine = p.code === 0
|
|
177
213
|
? `would touch: ${p.out.split('\n').slice(-1)[0]?.trim() || '?'}`
|
|
@@ -180,6 +216,9 @@ onAsk = () => { }) {
|
|
|
180
216
|
? `-- harness preview (${preview}):\n-- ${p.out.split('\n').slice(-3).join(' | ')}\n\n`
|
|
181
217
|
: `-- harness preview FAILED (exit ${p.code}): ${p.out.split('\n').slice(0, 2).join(' ')}\n\n`;
|
|
182
218
|
}
|
|
219
|
+
// Flagged as well as asked. The approval raises its own push, but the flag is what puts
|
|
220
|
+
// the card in a person's "Needs you" list — which is where they actually look.
|
|
221
|
+
const told = await human.flag(reason, kind);
|
|
183
222
|
// Same request shape and same wait loop as every other approval: renders with
|
|
184
223
|
// Approve/Deny, raises the push, and accepts a typed `approve <id>`.
|
|
185
224
|
const leadId = lead();
|
|
@@ -190,24 +229,26 @@ onAsk = () => { }) {
|
|
|
190
229
|
}, (p) => {
|
|
191
230
|
posted = p;
|
|
192
231
|
onAsk({
|
|
193
|
-
kind: 'asking', requestId: p.request_id, commentId: p.comment_id, name, target,
|
|
194
|
-
purpose:
|
|
232
|
+
kind: 'asking', requestId: p.request_id, commentId: p.comment_id, name: label, target: name,
|
|
233
|
+
purpose: reason.trim(), ...(previewLine ? { preview: previewLine } : {}), script: body, withLead: !!leadId,
|
|
195
234
|
});
|
|
196
235
|
});
|
|
197
|
-
log(leadId ? `asking the lead to review ${name}` : `asking for approval
|
|
236
|
+
log(leadId ? `asking the lead to review a script on ${name}` : `asking for approval to run a script on ${name}${told ? ` · ${told}` : ''}`);
|
|
198
237
|
const verdict = await ask({
|
|
199
|
-
toolName:
|
|
238
|
+
toolName: SCRIPT_REQUEST,
|
|
200
239
|
input: {
|
|
201
|
-
description: `
|
|
240
|
+
description: `SCRIPT "${label}" on ${name} — ${reason.trim()}${expected_effect ? ` Expected: ${expected_effect.trim()}` : ''} [${hash}]`,
|
|
202
241
|
command: `${previewNote}${body}`,
|
|
203
242
|
whole: true,
|
|
204
243
|
},
|
|
205
244
|
}, { signal: new AbortController().signal });
|
|
206
245
|
onAsk({ kind: 'answered', requestId: hash });
|
|
246
|
+
// Answered either way, so the card is no longer waiting on anybody.
|
|
247
|
+
await human.unflag();
|
|
207
248
|
if (!verdict.allow)
|
|
208
249
|
return say(`Not run. ${verdict.reason}`, true);
|
|
209
|
-
const r = await runAndReport(t, { commentId: posted?.comment_id ?? '', card: cur.card, cwd: cur.cwd, name, target, script: body, hash }, deck, log);
|
|
210
|
-
return say(`${r.code === 0 ? 'Ran' : `FAILED (exit ${r.code})`}
|
|
250
|
+
const r = await runAndReport(t, { commentId: posted?.comment_id ?? '', card: cur.card, cwd: cur.cwd, name: label, target: name, script: body, hash }, deck, log);
|
|
251
|
+
return say(`${r.code === 0 ? 'Ran' : `FAILED (exit ${r.code})`} on ${name}. Output:\n${r.out || '(no output)'}`, r.code !== 0);
|
|
211
252
|
}),
|
|
212
253
|
],
|
|
213
254
|
});
|
package/dist/runs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../src/runs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAIjD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,mCAAmC,CAAC,CAAC;AAEpE,iFAAiF;AACjF,MAAM,eAAe,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACvC,MAAM,UAAU,GAAG,IAAI,CAAC;AASxB,MAAM,GAAG,GAAG,CAAC,IAAY,EAAE,OAAO,GAAG,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAA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EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;gBACjK,OAAO,GAAG,CACR,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,IAAI,GAAG,OAAO,IAAI,cAAc,CAAC,CAAC,GAAG,IAAI,aAAa,EAAE,EACpG,CAAC,CAAC,IAAI,KAAK,CAAC,CACb,CAAC;YACJ,CAAC,CACF;SACF;KACF,CAAC,CAAC;IACH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;AAC/C,CAAC"}
|
package/dist/serve.js
CHANGED
|
@@ -7,8 +7,8 @@ import { pushStatus, StatusTracker } from './status.js';
|
|
|
7
7
|
import { fetchTeam, myTeam, teamTools, TEAM_TOOL_NAMES } from './team.js';
|
|
8
8
|
import { scheduleTools, SCHEDULE_TOOL_NAMES } from './schedules.js';
|
|
9
9
|
import { preflightFlaredeck } from './flaredeck-check.js';
|
|
10
|
-
import { NOT_FOR_WORKERS, callFlaredeckTool, flaredeckProxy } from './flaredeck-proxy.js';
|
|
11
|
-
import { resumeApprovedRuns, runTools } from './runs.js';
|
|
10
|
+
import { NOT_FOR_WORKERS, REPLACED_BY_HARNESS, callFlaredeckTool, flaredeckProxy } from './flaredeck-proxy.js';
|
|
11
|
+
import { SCRIPT_REQUEST, allTargets, resumeApprovedRuns, runTools } from './runs.js';
|
|
12
12
|
import { deliverDecision, flaredeckDecider } from './approval.js';
|
|
13
13
|
import { CouldNotWork, engineFor } from './engine.js';
|
|
14
14
|
import { jevGuard } from './jevguard.js';
|
|
@@ -246,7 +246,7 @@ export async function serve(opts) {
|
|
|
246
246
|
// themselves. The card being worked is what the approval is asked on.
|
|
247
247
|
let onCard = null;
|
|
248
248
|
/**
|
|
249
|
-
* The pane's list of
|
|
249
|
+
* The pane's list of script requests waiting on a person: this agent's own request and, on a
|
|
250
250
|
* lead's pane, its team's. Read from the server — the one place every request and verdict
|
|
251
251
|
* lands — and refreshed whenever the stream says something changed, never on a timer worth
|
|
252
252
|
* noticing. Rows a person answered here are marked until the next refresh drops them.
|
|
@@ -260,7 +260,7 @@ export async function serve(opts) {
|
|
|
260
260
|
if (refreshing)
|
|
261
261
|
return refreshing;
|
|
262
262
|
refreshing = reader.pendingApprovals().then((all) => {
|
|
263
|
-
const mine = all.filter((a) => a.tool_name ===
|
|
263
|
+
const mine = all.filter((a) => a.tool_name === SCRIPT_REQUEST);
|
|
264
264
|
state.approvals = mine.map((a) => {
|
|
265
265
|
const lines = (a.input_preview || '').split('\n');
|
|
266
266
|
const preview = lines.find((l) => l.startsWith('-- RAN') || /would_touch/.test(l))?.replace(/^-- /, '').replace(/^harness preview.*?:\s*/, '');
|
|
@@ -304,7 +304,7 @@ export async function serve(opts) {
|
|
|
304
304
|
* The ask now goes where the person already is — posted on the card being worked, as the same
|
|
305
305
|
* Approve/Deny the production-run flow uses (web, phone, push) — and the turn waits for the
|
|
306
306
|
* verdict. Nobody has to be at this keyboard. It is routed through the lead first when this
|
|
307
|
-
* agent has one, exactly as a
|
|
307
|
+
* agent has one, exactly as a script request is.
|
|
308
308
|
*
|
|
309
309
|
* With no card to ask on (a pane question, the idle sweep) there is nowhere to post, so it
|
|
310
310
|
* falls back to the configured decider and the old refusal stands.
|
|
@@ -342,8 +342,26 @@ export async function serve(opts) {
|
|
|
342
342
|
log('tool', jevKey
|
|
343
343
|
? 'jev guard on — irreversible commands are refused, the rest run'
|
|
344
344
|
: 'jev guard on, with NO OpenRouter key — every risky command will interrupt a person. Set one: flaredeck-agent providers --openrouter <key>');
|
|
345
|
-
|
|
346
|
-
|
|
345
|
+
// Always mounted, never conditional: being stuck is not a thing some machines have. The
|
|
346
|
+
// configured production targets are added to the shell every machine already has.
|
|
347
|
+
const runsSet = opts.deck
|
|
348
|
+
? runTools(config.runs ?? {}, () => onCard, opts.deck, (t) => log('tool', t), {
|
|
349
|
+
flag: async (reason, kind) => {
|
|
350
|
+
const cur = onCard;
|
|
351
|
+
if (!cur)
|
|
352
|
+
return null;
|
|
353
|
+
return flagCard({ card: cur.card, board: cur.board, code: cur.code }, reason, kind);
|
|
354
|
+
},
|
|
355
|
+
unflag: async () => {
|
|
356
|
+
const cur = onCard;
|
|
357
|
+
if (!cur)
|
|
358
|
+
return;
|
|
359
|
+
await callFlaredeckTool(config.mcpUrl, await opts.auth(), 'clear-needs-human', {
|
|
360
|
+
card_id: cur.code || cur.card,
|
|
361
|
+
...(cur.board ? { board_id: cur.board } : {}),
|
|
362
|
+
}).catch((e) => log('warn', `could not clear needs-human: ${e instanceof Error ? e.message : String(e)}`));
|
|
363
|
+
},
|
|
364
|
+
}, () => leadId, onAsk)
|
|
347
365
|
: undefined;
|
|
348
366
|
// Answering from this keyboard: the person's own login decides, through the same endpoint the
|
|
349
367
|
// phone uses, so the agent waiting on it sees the verdict as any other.
|
|
@@ -367,9 +385,9 @@ export async function serve(opts) {
|
|
|
367
385
|
// Anything a person approved while this harness was not waiting runs now, before the first
|
|
368
386
|
// event — so the approval the pane showed as "picking it up" is actually picked up.
|
|
369
387
|
if (runsSet && opts.deck) {
|
|
370
|
-
void resumeApprovedRuns(config.runs, opts.deck, config.repo, (t) => log('tool', t))
|
|
388
|
+
void resumeApprovedRuns(allTargets(config.runs), opts.deck, config.repo, (t) => log('tool', t))
|
|
371
389
|
.then((n) => { if (n) {
|
|
372
|
-
log('event', `ran ${n} approved
|
|
390
|
+
log('event', `ran ${n} approved script(s) owed from before this restart`);
|
|
373
391
|
void refreshApprovals();
|
|
374
392
|
} });
|
|
375
393
|
}
|
|
@@ -408,12 +426,12 @@ export async function serve(opts) {
|
|
|
408
426
|
}))
|
|
409
427
|
.sort((x, y) => x.name.localeCompare(y.name));
|
|
410
428
|
};
|
|
411
|
-
/** Who this agent reports to, when it is a worker on a team:
|
|
429
|
+
/** Who this agent reports to, when it is a worker on a team: script requests go there first. */
|
|
412
430
|
let leadId = null;
|
|
413
431
|
let leadName = '';
|
|
414
432
|
/** A lead's surface is wider than a worker's, so the tool list is too. */
|
|
415
433
|
let isLead = false;
|
|
416
|
-
const keepTool = (name) => isLead || !NOT_FOR_WORKERS.includes(name);
|
|
434
|
+
const keepTool = (name) => !REPLACED_BY_HARNESS.includes(name) && (isLead || !NOT_FOR_WORKERS.includes(name));
|
|
417
435
|
/** Cards already handed to the lead, so a retried tool call does not assign or message twice. */
|
|
418
436
|
const handedBack = new Set();
|
|
419
437
|
try {
|
|
@@ -917,28 +935,37 @@ export async function serve(opts) {
|
|
|
917
935
|
* needs-human" over the top of it. An agent said it had asked for help, a person was never told,
|
|
918
936
|
* and the card sat.
|
|
919
937
|
*/
|
|
920
|
-
const
|
|
921
|
-
const label =
|
|
938
|
+
const flagCard = async (ref, reason, kind) => {
|
|
939
|
+
const label = ref.code || ref.card || 'card';
|
|
922
940
|
try {
|
|
923
941
|
const out = await callFlaredeckTool(config.mcpUrl, await opts.auth(), 'set-needs-human', {
|
|
924
942
|
// The code when there is one — it resolves on its own. The board always goes with the key.
|
|
925
|
-
card_id:
|
|
926
|
-
...(
|
|
943
|
+
card_id: ref.code || ref.card,
|
|
944
|
+
...(ref.board ? { board_id: ref.board } : {}),
|
|
927
945
|
reason,
|
|
928
946
|
...(kind ? { kind } : {}),
|
|
929
947
|
});
|
|
930
|
-
if (out.trimStart().startsWith('
|
|
931
|
-
log('warn', `${label}: FlareDeck did not flag this card
|
|
932
|
-
return;
|
|
948
|
+
if (out.trimStart().startsWith('\u274c') || out.trimStart().startsWith('\ud83d\udeab')) {
|
|
949
|
+
log('warn', `${label}: FlareDeck did not flag this card \u2014 ${out.split('\n')[0]}`);
|
|
950
|
+
return null;
|
|
933
951
|
}
|
|
934
952
|
// Say who was told, which the tool reports back, so the pane shows whether anyone heard it.
|
|
935
|
-
const told = out.split('\n').find((l) => l.startsWith('**Told**'));
|
|
936
|
-
log('warn', `${label}: flagged needs-human
|
|
953
|
+
const told = out.split('\n').find((l) => l.startsWith('**Told**'))?.replace(/\*\*/g, '') ?? null;
|
|
954
|
+
log('warn', `${label}: flagged needs-human \u2014 ${reason.split('.')[0]}${told ? ` \u00b7 ${told}` : ''}`);
|
|
955
|
+
return told;
|
|
937
956
|
}
|
|
938
957
|
catch (e) {
|
|
939
|
-
log('warn', `${label}: could not flag the card (${e instanceof Error ? e.message : String(e)})
|
|
958
|
+
log('warn', `${label}: could not flag the card (${e instanceof Error ? e.message : String(e)}) \u2014 ${reason}`);
|
|
959
|
+
return null;
|
|
940
960
|
}
|
|
941
961
|
};
|
|
962
|
+
const flagForHuman = async (event, reason, kind) => {
|
|
963
|
+
await flagCard({
|
|
964
|
+
card: event.cardKey ?? '',
|
|
965
|
+
...(event.boardKey ? { board: event.boardKey } : {}),
|
|
966
|
+
...(event.cardCode ? { code: event.cardCode } : {}),
|
|
967
|
+
}, reason, kind);
|
|
968
|
+
};
|
|
942
969
|
async function handle(event) {
|
|
943
970
|
// A scheduled run that sat in the queue past its window (this machine was off, the pane was
|
|
944
971
|
// busy) is dropped, not run late: a "7am summary" at noon is worse than none. Acknowledged by
|
|
@@ -1179,7 +1206,14 @@ export async function serve(opts) {
|
|
|
1179
1206
|
if (!resume && event.cardKey && event.event !== 'review' && event.event !== 'ask') {
|
|
1180
1207
|
await startOnBoard(event.cardCode || event.cardKey);
|
|
1181
1208
|
}
|
|
1182
|
-
onCard = event.cardKey
|
|
1209
|
+
onCard = event.cardKey
|
|
1210
|
+
? {
|
|
1211
|
+
card: event.cardKey,
|
|
1212
|
+
cwd,
|
|
1213
|
+
...(event.boardKey ? { board: event.boardKey } : {}),
|
|
1214
|
+
...(event.cardCode ? { code: event.cardCode } : {}),
|
|
1215
|
+
}
|
|
1216
|
+
: null;
|
|
1183
1217
|
job = tree
|
|
1184
1218
|
? {
|
|
1185
1219
|
cwd,
|
|
@@ -1630,7 +1664,7 @@ function prompt(event) {
|
|
|
1630
1664
|
'Read the card with get-card-details. The request is the newest comment carrying an approval,',
|
|
1631
1665
|
'with its comment id, the script, the worker\'s own account of it, and the harness\'s row-count',
|
|
1632
1666
|
'preview. Check that the WHERE clause matches the stated purpose and that the preview matches',
|
|
1633
|
-
'the expected effect. Then call
|
|
1667
|
+
'the expected effect. Then call review_script with that comment id: endorse, and the',
|
|
1634
1668
|
'people who can approve it are asked; reject, and the worker is refused with your note. Do not',
|
|
1635
1669
|
'dispatch, re-assign, or change anything else — this is a review, not a card to work.',
|
|
1636
1670
|
].join('\n');
|