@theronap/cortex-mcp 0.9.42 → 0.9.43
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 +16 -6
- package/package.json +1 -1
package/lib/server.mjs
CHANGED
|
@@ -190,11 +190,17 @@ export async function runServer(version) {
|
|
|
190
190
|
'timeline_pull',
|
|
191
191
|
{
|
|
192
192
|
title: 'Pull unattributed messaging threads to triage',
|
|
193
|
-
description: "Surface messaging threads captured in the org (email, etc.) that AREN'T yet attributed to a project — the backlog awaiting your judgment. Call it as you work; when you recognize which KNOWN project a surfaced thread is about, attribute it with attribute_thread. Threads you don't recognize: leave them (they self-heal as the graph fills). Returns participants + subject + recency per thread — enough to recognize, not the message bodies.",
|
|
194
|
-
inputSchema: {
|
|
193
|
+
description: "Surface messaging threads captured in the org (email, etc.) that AREN'T yet attributed to a project — the backlog awaiting your judgment. Call it as you work; when you recognize which KNOWN project a surfaced thread is about, attribute it with attribute_thread. Threads you don't recognize: leave them (they self-heal as the graph fills). Pass a `project` you're working on to RANK the backlog by relevance (threads sharing participants with that project come first, marked ★). Returns participants + subject + recency per thread — enough to recognize, not the message bodies.",
|
|
194
|
+
inputSchema: {
|
|
195
|
+
limit: z.number().optional().describe('max threads to return (default 20)'),
|
|
196
|
+
project: z.string().optional().describe('optional KNOWN project slug to rank the backlog by relevance to what you are working on; omit for the whole backlog newest-first'),
|
|
197
|
+
},
|
|
195
198
|
},
|
|
196
|
-
async ({ limit }) => {
|
|
197
|
-
const
|
|
199
|
+
async ({ limit, project }) => {
|
|
200
|
+
const params = new URLSearchParams()
|
|
201
|
+
if (typeof limit === 'number') params.set('limit', String(limit))
|
|
202
|
+
if (typeof project === 'string' && project) params.set('project', project)
|
|
203
|
+
const qs = params.toString() ? `?${params}` : ''
|
|
198
204
|
const res = await fetchCortex(`${BASE}/api/timeline/pull${qs}`, { headers: { Authorization: `Bearer ${TOKEN}` } })
|
|
199
205
|
if (!res.ok) {
|
|
200
206
|
const body = await res.text()
|
|
@@ -205,9 +211,13 @@ export async function runServer(version) {
|
|
|
205
211
|
const lines = threads.map((t) => {
|
|
206
212
|
const who = (t.participants ?? []).map((p) => String(p).replace(/^email:/, '')).join(', ')
|
|
207
213
|
const when = t.lastAt ? String(t.lastAt).slice(0, 10) : '—'
|
|
208
|
-
|
|
214
|
+
const rel = t.relevance && t.relevance.score > 0 ? ` · ★${t.relevance.score} ${t.relevance.reason}` : ''
|
|
215
|
+
return `- ${t.threadKey} — ${t.subject ?? '(no subject)'} · ${who || 'unknown participants'} · ${t.eventCount} msg · ${when}${rel}`
|
|
209
216
|
})
|
|
210
|
-
|
|
217
|
+
const header = project
|
|
218
|
+
? `Unattributed threads (${threads.length}), ranked for project:${project} (★ = shares participants)`
|
|
219
|
+
: `Unattributed threads (${threads.length})`
|
|
220
|
+
return { content: [{ type: 'text', text: `${header} — attribute recognized ones with attribute_thread(threadKey, project):\n${lines.join('\n')}` }] }
|
|
211
221
|
},
|
|
212
222
|
)
|
|
213
223
|
|