@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.
Files changed (2) hide show
  1. package/lib/server.mjs +16 -6
  2. 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: { limit: z.number().optional().describe('max threads to return (default 20)') },
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 qs = typeof limit === 'number' ? `?limit=${limit}` : ''
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
- return `- ${t.threadKey} ${t.subject ?? '(no subject)'} · ${who || 'unknown participants'} · ${t.eventCount} msg · ${when}`
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
- return { content: [{ type: 'text', text: `Unattributed threads (${threads.length}) — attribute recognized ones with attribute_thread(threadKey, project):\n${lines.join('\n')}` }] }
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theronap/cortex-mcp",
3
- "version": "0.9.42",
3
+ "version": "0.9.43",
4
4
  "description": "Connect your AI assistant to Cortex — your org's projects, activity, gaps, and directives, scoped to you.",
5
5
  "type": "module",
6
6
  "bin": {