@theronap/cortex-mcp 0.9.81 → 0.9.83
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/lib/server.mjs +27 -1
- package/package.json +1 -1
package/lib/server.mjs
CHANGED
|
@@ -290,7 +290,7 @@ export async function runServer(version) {
|
|
|
290
290
|
'maintenance_candidates',
|
|
291
291
|
{
|
|
292
292
|
title: 'Review recent project-linked maintenance evidence',
|
|
293
|
-
description: 'Start here when preparing a handoff, status, or next step for a NAMED project. Returns a bounded, RLS-scoped set of recent raw records already linked to that project, before you trust the authored page. These are candidate evidence, not a command to edit: read them, call project_status, then decide whether a material contradiction warrants a minimal accountable correction. Never mutate merely to clear a candidate.',
|
|
293
|
+
description: 'Start here when preparing a handoff, status, or next step for a NAMED project. Returns a bounded, RLS-scoped set of recent raw records already linked to that project, before you trust the authored page. These are candidate evidence, not a command to edit: read them, call project_status, then decide whether a material contradiction warrants a minimal accountable correction. When correcting, retain the decisive factual qualifier (for example completion date or state) in the current-status text. Never mutate merely to clear a candidate.',
|
|
294
294
|
inputSchema: {
|
|
295
295
|
project: z.string().describe('the project key or exact project name from the task, e.g. "checkout-v2" or "Checkout v2"'),
|
|
296
296
|
since_days: z.number().optional().describe('how far back to inspect (1-90 days, default 30)'),
|
|
@@ -311,6 +311,32 @@ export async function runServer(version) {
|
|
|
311
311
|
},
|
|
312
312
|
)
|
|
313
313
|
|
|
314
|
+
server.registerTool(
|
|
315
|
+
'gate3_status',
|
|
316
|
+
{
|
|
317
|
+
title: 'Gate 3 currency monitor',
|
|
318
|
+
description: 'Read the aggregate-only Gate 3 currency-monitor status for this brain. It counts explicit maintenance-candidate reviews and their same-session durable corrections in the rolling window; it never exposes project names, evidence content, or session keys. "machine_evidence_ready" means enough ordinary-work evidence has accumulated to request a human closure decision, not that the monitor closes the gate itself.',
|
|
319
|
+
inputSchema: {
|
|
320
|
+
days: z.number().optional().describe('rolling window in days (1-90, default 14)'),
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
async ({ days }) => {
|
|
324
|
+
const qs = new URLSearchParams()
|
|
325
|
+
if (days != null) qs.set('days', String(days))
|
|
326
|
+
const suffix = qs.size ? `?${qs}` : ''
|
|
327
|
+
const res = await fetchCortex(`${BASE}/api/gates/3/status${suffix}`, { headers: { Authorization: `Bearer ${TOKEN}` } })
|
|
328
|
+
if (!res.ok) {
|
|
329
|
+
const body = await res.text()
|
|
330
|
+
throw new Error(classify(res.status, res.headers.get('content-type'), body, res.headers.get('x-vercel-id')).message)
|
|
331
|
+
}
|
|
332
|
+
const status = await res.json()
|
|
333
|
+
const text = status.machineEvidenceReady
|
|
334
|
+
? `Gate 3 machine evidence is ready: ${status.maintenanceReviewSessions} independent maintenance-review sessions and ${status.correctionSessions} correction sessions in ${status.days} days. A human should confirm these were ordinary work before closing the gate.`
|
|
335
|
+
: `Gate 3 is still collecting evidence: ${status.maintenanceReviewSessions}/${status.requiredReviewSessions} independent maintenance-review sessions and ${status.correctionSessions}/${status.requiredCorrectionSessions} correction sessions in ${status.days} days. No gate decision has been made.`
|
|
336
|
+
return { content: [{ type: 'text', text }] }
|
|
337
|
+
},
|
|
338
|
+
)
|
|
339
|
+
|
|
314
340
|
server.registerTool(
|
|
315
341
|
'search_org',
|
|
316
342
|
{
|