@theronap/cortex-mcp 0.9.82 → 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 +26 -0
- package/package.json +1 -1
package/lib/server.mjs
CHANGED
|
@@ -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
|
{
|