@bli-cockpit/mcp 0.1.50 → 0.1.52
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 +4 -2
- package/dist/brief-write-tools.js +70 -0
- package/dist/careers-tools.js +18 -8
- package/dist/verb-census.js +13 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ about what an agent can reach.
|
|
|
34
34
|
|
|
35
35
|
<!-- BEGIN GENERATED verb census — `npm run mcp:readme` -->
|
|
36
36
|
|
|
37
|
-
**
|
|
37
|
+
**103 of 108 Tower verbs have an MCP twin.**
|
|
38
38
|
Each tool goes through the SAME door its CLI verb calls, with the same
|
|
39
39
|
collector device token — never a second route and never a service-role
|
|
40
40
|
reader. `src/verb-census.test.ts` fails when a verb is in none of the
|
|
@@ -42,10 +42,12 @@ three tables below.
|
|
|
42
42
|
|
|
43
43
|
| CLI verb | MCP tool | Door |
|
|
44
44
|
| --- | --- | --- |
|
|
45
|
+
| `cockpit brief done` | `brief_done` | `POST /api/jarvis/ticks` |
|
|
45
46
|
| `cockpit brief history` | `brief_history` | `GET /api/jarvis/brief?history=1` |
|
|
46
47
|
| `cockpit brief read` | `brief_read` | `GET /api/jarvis/brief` |
|
|
47
48
|
| `cockpit brief rewrite` | `brief_rewrite` | `POST /api/jarvis/recompile` |
|
|
48
49
|
| `cockpit brief status` | `brief_status` | `GET /api/ops/brief-status` |
|
|
50
|
+
| `cockpit brief undone` | `brief_undone` | `POST /api/jarvis/ticks` |
|
|
49
51
|
| `cockpit cal calendars` | `cal_calendars` | `GET /api/cal/calendars` |
|
|
50
52
|
| `cockpit cal create` | `cal_create` | `POST /api/cal/events` |
|
|
51
53
|
| `cockpit cal detach` | `cal_detach` | `DELETE /api/cal/calendars` |
|
|
@@ -57,7 +59,7 @@ three tables below.
|
|
|
57
59
|
| `cockpit cal week` | `cal_week` | `GET /api/cal/week` |
|
|
58
60
|
| `cockpit careers decide` | `careers_decide` | `POST /api/careers/applications/[id]/decide` |
|
|
59
61
|
| `cockpit careers grade` | `careers_grade` | `POST /api/careers/applications/[id]/grade` |
|
|
60
|
-
| `cockpit careers
|
|
62
|
+
| `cockpit careers send-takehome` | `careers_send_takehome` | `POST /api/careers/applications/[id]/invite` |
|
|
61
63
|
| `cockpit careers list` | `careers_list` | `GET /api/careers/applications` |
|
|
62
64
|
| `cockpit careers rescreen` | `careers_rescreen` | `POST /api/careers/applications/[id]/rescreen` |
|
|
63
65
|
| `cockpit careers settings set` | `careers_settings_set` | `PUT /api/careers/settings` |
|
|
@@ -175,4 +175,74 @@ export function registerBriefWriteTools(server, deps) {
|
|
|
175
175
|
link: filed.link ?? null,
|
|
176
176
|
});
|
|
177
177
|
}));
|
|
178
|
+
// BLI-3605: the board's done checkbox. Two tools rather than one with a
|
|
179
|
+
// boolean, for the same reason the CLI has two verbs: "mark it done" and
|
|
180
|
+
// "put it back" are different intentions, and a model picking a flag wrong
|
|
181
|
+
// silently un-finishes somebody's work.
|
|
182
|
+
registerTick(register, deps, "brief_done", true);
|
|
183
|
+
registerTick(register, deps, "brief_undone", false);
|
|
184
|
+
}
|
|
185
|
+
/** The item a tick is about, in the two spellings a board row can have. */
|
|
186
|
+
const TICK_ITEM = z
|
|
187
|
+
.string()
|
|
188
|
+
.min(1)
|
|
189
|
+
.max(200)
|
|
190
|
+
.describe("The board row: a ticket exactly as the board writes it (BLI-3511), or a claim id from brief_read({claims: true}) for a row with no ticket.");
|
|
191
|
+
const TICKET_IDENTIFIER = /^[A-Z][A-Z0-9]{1,9}-\d+$/;
|
|
192
|
+
/**
|
|
193
|
+
* One tick tool. `brief_done` and `brief_undone` differ by one boolean and
|
|
194
|
+
* nothing else, so they are built once here rather than written twice.
|
|
195
|
+
*
|
|
196
|
+
* The page is read first and the item looked for in it, exactly as
|
|
197
|
+
* `brief_correct` refuses an unknown claim id before writing: a key naming
|
|
198
|
+
* nothing would sit in the table forever, ticked against a row nobody can
|
|
199
|
+
* find. There is no `subject` argument on purpose, a tick is the caller's own
|
|
200
|
+
* working state, and the door has no way to accept one for anybody else.
|
|
201
|
+
*/
|
|
202
|
+
function registerTick(register, deps, name, done) {
|
|
203
|
+
register(name, {
|
|
204
|
+
title: done
|
|
205
|
+
? "Tick one Tower DO THIS FIRST item off as done"
|
|
206
|
+
: "Put one Tower DO THIS FIRST item back on the board",
|
|
207
|
+
description: done
|
|
208
|
+
? "Marks ONE row of the daily page's DO THIS FIRST board done, the website's checkbox and `cockpit brief done`, "
|
|
209
|
+
+ "same door. A row with a ticket stays ticked across every recompile. Your own board only; a tick is private "
|
|
210
|
+
+ "working state and cannot be made on anybody else's behalf."
|
|
211
|
+
: "Takes back a tick on ONE row of the DO THIS FIRST board, `cockpit brief undone`, same door. The row goes "
|
|
212
|
+
+ "back to open. Your own board only.",
|
|
213
|
+
inputSchema: { item: TICK_ITEM },
|
|
214
|
+
}, async (args) => withSession(deps, async (session) => {
|
|
215
|
+
const item = String(args.item ?? "").trim();
|
|
216
|
+
const page = await readPage(deps, session, new URLSearchParams({ claims: "1" }));
|
|
217
|
+
if (!page.ok)
|
|
218
|
+
return errorResult(page.text);
|
|
219
|
+
const claims = page.body.claims ?? [];
|
|
220
|
+
const isTicket = TICKET_IDENTIFIER.test(item);
|
|
221
|
+
const line = isTicket
|
|
222
|
+
? claims.find((candidate) => (candidate.text ?? "").includes(item))
|
|
223
|
+
: claims.find((candidate) => candidate.claimId === item);
|
|
224
|
+
if (!line) {
|
|
225
|
+
return errorResult(`Refused (unknown_item): nothing on your page is called “${item}”. `
|
|
226
|
+
+ "Call brief_read with `claims: true` to see the ids, or name the ticket exactly as the board writes "
|
|
227
|
+
+ "it. Nothing was recorded.");
|
|
228
|
+
}
|
|
229
|
+
const response = await callAgentDoor(session, deps.fetchImpl, "POST", "/api/jarvis/ticks", {
|
|
230
|
+
item_key: item,
|
|
231
|
+
ticket_identifier: isTicket ? item : null,
|
|
232
|
+
claim_id: line.claimId ?? null,
|
|
233
|
+
page_id: page.body.page?.pageId ?? null,
|
|
234
|
+
done,
|
|
235
|
+
}, QUEUE_DEADLINE_MS);
|
|
236
|
+
if (!response.ok)
|
|
237
|
+
return errorResult(doorFailureText(name, response));
|
|
238
|
+
const body = response.body;
|
|
239
|
+
if (!body.ok)
|
|
240
|
+
return errorResult(body.reply ?? body.error ?? "Tower did not record that.");
|
|
241
|
+
return textResult(done ? `[x] ${item} is done.` : `[ ] ${item} is back on the board.`, {
|
|
242
|
+
ok: true,
|
|
243
|
+
itemKey: body.item_key ?? item,
|
|
244
|
+
done,
|
|
245
|
+
tickedAt: body.ticked_at ?? null,
|
|
246
|
+
});
|
|
247
|
+
}));
|
|
178
248
|
}
|
package/dist/careers-tools.js
CHANGED
|
@@ -26,14 +26,24 @@ export function registerCareersTools(server, deps) {
|
|
|
26
26
|
const answer = await callAgentDoor(session, deps.fetchImpl, action === 'show' ? 'GET' : 'POST', `/api/careers/applications/${encodeURIComponent(String(args.id))}${action === 'rescreen' ? '/rescreen' : ''}`, undefined, 60_000);
|
|
27
27
|
return answer.ok ? textResult('Application', answer.body) : errorResult(doorFailureText(`careers_${action}`, answer));
|
|
28
28
|
}));
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
// Two names, ONE door (BLI-4460 follow-up). Tower's button says "Send
|
|
30
|
+
// take-home" and this tool said `invite`, so an agent reading the screen and
|
|
31
|
+
// an agent reading the tool list were looking for different words for the
|
|
32
|
+
// same act. `careers_send_takehome` is the spelling the button uses and the
|
|
33
|
+
// one the census and the README teach; `careers_invite` stays registered
|
|
34
|
+
// because anything that already learned it keeps working.
|
|
35
|
+
for (const [tool, description] of [
|
|
36
|
+
['careers_send_takehome', 'Send the take-home invitation to one applicant (the button labelled Send take-home). Same door as careers_invite. Super-admin only. Sends that role\'s take-home from the configured mailbox, whatever the screening scored. Only a row still at the `screened` stage; a row already invited is refused.'],
|
|
37
|
+
['careers_invite', 'Super-admin only. Sends that role\'s take-home invitation from the configured mailbox, whatever the screening scored. Only a row still at the `screened` stage; a row already invited is refused. The same door as careers_send_takehome, which is the name the button uses.'],
|
|
38
|
+
])
|
|
39
|
+
register(tool, {
|
|
40
|
+
title: 'Send the take-home',
|
|
41
|
+
description,
|
|
42
|
+
inputSchema: { id: z.string().uuid() },
|
|
43
|
+
}, async (args) => withSession(deps, async (session) => {
|
|
44
|
+
const answer = await callAgentDoor(session, deps.fetchImpl, 'POST', `/api/careers/applications/${encodeURIComponent(String(args.id))}/invite`, undefined, 60_000);
|
|
45
|
+
return answer.ok ? textResult('Invitation sent', answer.body) : errorResult(doorFailureText(tool, answer));
|
|
46
|
+
}));
|
|
37
47
|
register('careers_grade', {
|
|
38
48
|
title: 'Re-queue a take-home for grading',
|
|
39
49
|
description: 'Super-admin only. Puts one submitted or graded application back in the take-home grader\'s queue. The grader runs on Railway every 15 minutes because it clones a repository and reads a video; `now` is answered honestly rather than run here.',
|
package/dist/verb-census.js
CHANGED
|
@@ -212,7 +212,12 @@ export const MCP_TWINS = {
|
|
|
212
212
|
"careers list": { tool: "careers_list", door: "GET /api/careers/applications" },
|
|
213
213
|
"careers show": { tool: "careers_show", door: "GET /api/careers/applications/[id]" },
|
|
214
214
|
"careers rescreen": { tool: "careers_rescreen", door: "POST /api/careers/applications/[id]/rescreen" },
|
|
215
|
-
|
|
215
|
+
// The parser's action is `invite`; what a person types is `careers
|
|
216
|
+
// send-takehome`, the words on Tower's own button, and the tool is named to
|
|
217
|
+
// match (TYPED_SPELLING below carries that spelling into this row of the
|
|
218
|
+
// README). `cockpit careers invite` and `careers_invite` are the older words
|
|
219
|
+
// for the identical door, and both still work.
|
|
220
|
+
"careers invite": { tool: "careers_send_takehome", door: "POST /api/careers/applications/[id]/invite" },
|
|
216
221
|
"careers decide": { tool: "careers_decide", door: "POST /api/careers/applications/[id]/decide" },
|
|
217
222
|
"careers grade": { tool: "careers_grade", door: "POST /api/careers/applications/[id]/grade" },
|
|
218
223
|
"careers takehome-show": { tool: "careers_takehome_show", door: "GET /api/careers/takehomes/[role]" },
|
|
@@ -261,6 +266,10 @@ export const MCP_TWINS = {
|
|
|
261
266
|
"brief history": { tool: "brief_history", door: "GET /api/jarvis/brief?history=1" },
|
|
262
267
|
"brief status": { tool: "brief_status", door: "GET /api/ops/brief-status" },
|
|
263
268
|
"brief rewrite": { tool: "brief_rewrite", door: "POST /api/jarvis/recompile" },
|
|
269
|
+
// BLI-3605: the DO THIS FIRST done checkbox. One door, two verbs, because
|
|
270
|
+
// "mark it done" and "put it back" are different intentions.
|
|
271
|
+
"brief done": { tool: "brief_done", door: "POST /api/jarvis/ticks" },
|
|
272
|
+
"brief undone": { tool: "brief_undone", door: "POST /api/jarvis/ticks" },
|
|
264
273
|
correct: { tool: "brief_correct", door: "POST /api/jarvis/corrections" },
|
|
265
274
|
"notes folders": { tool: "notes_folders", door: "GET /api/notes/folders" },
|
|
266
275
|
"notes mkdir": { tool: "notes_mkdir", door: "POST /api/notes/folders" },
|
|
@@ -346,6 +355,9 @@ export const MCP_TWINS = {
|
|
|
346
355
|
* shorter this map is, the closer the census keys are to the product.
|
|
347
356
|
*/
|
|
348
357
|
export const TYPED_SPELLING = {
|
|
358
|
+
// The action is `invite`; the button, the help wall and the docs all say
|
|
359
|
+
// send-takehome, so that is what a stranger is told to type.
|
|
360
|
+
"careers invite": "careers send-takehome",
|
|
349
361
|
"careers takehome-show": "careers takehome show",
|
|
350
362
|
"careers takehome-set": "careers takehome set",
|
|
351
363
|
"careers settings-show": "careers settings show",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bli-cockpit/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.52",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "bli-tower: an MCP server over BLI Cockpit's agent doors: JARVIS (jarvis_*), documents (docs_*), channels (msg_*), issues (work_*), the daily page (brief_*), meeting notes (notes_*), the ops board (ops_status/slack_*), settings/team/model, Scout and the workbook, plus the legacy event-stream tools (emit_event, get_ticket_timeline, get_active_tickets).",
|
|
6
6
|
"type": "module",
|