@theronap/cortex-mcp 0.9.100 → 0.9.101
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 +37 -1
- package/package.json +2 -2
package/lib/server.mjs
CHANGED
|
@@ -662,6 +662,7 @@ export async function runServer(version) {
|
|
|
662
662
|
inputSchema: {
|
|
663
663
|
claimKind: z.enum(['relevance', 'cleanup']).optional().describe('default relevance'),
|
|
664
664
|
limit: z.number().optional().describe('max items (default 10). Ignored when intakeItemIds is given.'),
|
|
665
|
+
leaseMinutes: z.number().optional().describe('lease length in minutes, 5-60 (default 30). Prefer intake_look for read-only inspection — a short lease is only for briefly exclusive work.'),
|
|
665
666
|
intakeItemIds: z.array(z.string()).optional().describe(
|
|
666
667
|
'claim these specific units instead of the head of the queue (max 50). Without it you get FIFO, ' +
|
|
667
668
|
'so reaching one known unit means claiming everything ahead of it. Ids come from intake_changes ' +
|
|
@@ -673,7 +674,7 @@ export async function runServer(version) {
|
|
|
673
674
|
),
|
|
674
675
|
},
|
|
675
676
|
},
|
|
676
|
-
async ({ claimKind, limit, intakeItemIds }) => {
|
|
677
|
+
async ({ claimKind, limit, intakeItemIds, leaseMinutes }) => {
|
|
677
678
|
const res = await fetchCortex(`${BASE}/api/intake/claim`, {
|
|
678
679
|
method: 'POST',
|
|
679
680
|
headers: { Authorization: `Bearer ${TOKEN}`, 'Content-Type': 'application/json' },
|
|
@@ -681,6 +682,7 @@ export async function runServer(version) {
|
|
|
681
682
|
claimKind: claimKind ?? 'relevance',
|
|
682
683
|
limit,
|
|
683
684
|
includePayload: true,
|
|
685
|
+
...(leaseMinutes ? { leaseMinutes } : {}),
|
|
684
686
|
// Forwarded only when present. An empty array is a real request to claim nothing and must
|
|
685
687
|
// survive as one; sending `[]` where the caller sent nothing would silently switch a FIFO
|
|
686
688
|
// claim into a no-op.
|
|
@@ -883,6 +885,40 @@ export async function runServer(version) {
|
|
|
883
885
|
},
|
|
884
886
|
)
|
|
885
887
|
|
|
888
|
+
server.registerTool(
|
|
889
|
+
'intake_look',
|
|
890
|
+
{
|
|
891
|
+
title: 'Read an intake unit without claiming it',
|
|
892
|
+
description:
|
|
893
|
+
'Read a PENDING intake unit\'s FULL decrypted body without taking a lease — a read RECEIPT, not a claim (ADR-0035). Use it when the settling feed\'s headline + candidate identifiers cannot tell you whether the unit belongs to your current work; looking is non-exclusive (any number of sessions may inspect the same unit) and always logged, so look freely rather than guessing from the headline — diligence is subsidized here. After looking: claim it if it is yours to process, or simply move on — no release needed, you never held it. The response includes how many sessions have looked (`looks`/`distinctLookers`): several looks and no claim is a sign the unit needs the triage agent or the owner, not another look. Resolved units are refused — read those as records.',
|
|
894
|
+
inputSchema: {
|
|
895
|
+
intakeItemId: z.string().describe('intake item uuid, from the settling feed (intake_changes) or intake_claim'),
|
|
896
|
+
workingIdentifiers: z.array(z.string()).optional().describe('the identifiers your current work touches (repo:…, file:…, project:…) — stored on the receipt; feeds look→claim conversion analysis'),
|
|
897
|
+
},
|
|
898
|
+
},
|
|
899
|
+
async ({ intakeItemId, workingIdentifiers }) => {
|
|
900
|
+
let res
|
|
901
|
+
try {
|
|
902
|
+
res = await fetchCortex(`${BASE}/api/intake/look`, {
|
|
903
|
+
method: 'POST',
|
|
904
|
+
headers: { Authorization: `Bearer ${TOKEN}`, 'Content-Type': 'application/json' },
|
|
905
|
+
body: JSON.stringify({ intakeItemId, workingIdentifiers: workingIdentifiers ?? [] }),
|
|
906
|
+
})
|
|
907
|
+
} catch (e) {
|
|
908
|
+
return toolError(`Could not look: ${e.message}`)
|
|
909
|
+
}
|
|
910
|
+
const out = await res.json().catch(() => null)
|
|
911
|
+
if (!res.ok) {
|
|
912
|
+
if (out?.error === 'not_lookable') {
|
|
913
|
+
return toolError(`Not lookable: the unit is ${out?.state ?? 'resolved'} — resolved units are read as records, not looks.`)
|
|
914
|
+
}
|
|
915
|
+
if (out?.error === 'not_found') return toolError('No such intake unit in your account.')
|
|
916
|
+
return toolError(`Could not look: ${out?.error ?? res.status}${out?.detail ? ` — ${out.detail}` : ''}`)
|
|
917
|
+
}
|
|
918
|
+
return { content: [{ type: 'text', text: JSON.stringify(out, null, 2) }] }
|
|
919
|
+
},
|
|
920
|
+
)
|
|
921
|
+
|
|
886
922
|
server.registerTool(
|
|
887
923
|
'intake_cleanup_status',
|
|
888
924
|
{
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theronap/cortex-mcp",
|
|
3
|
-
"version": "0.9.
|
|
4
|
-
"description": "Connect your AI assistant to Cortex
|
|
3
|
+
"version": "0.9.101",
|
|
4
|
+
"description": "Connect your AI assistant to Cortex \u2014 your org's projects, activity, gaps, and directives, scoped to you.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"cortex-mcp": "bin/cortex-mcp.mjs"
|