@theronap/cortex-mcp 0.9.116 → 0.9.117

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 +33 -0
  2. package/package.json +1 -1
package/lib/server.mjs CHANGED
@@ -1749,6 +1749,39 @@ export async function runServer(version) {
1749
1749
  },
1750
1750
  )
1751
1751
 
1752
+ server.registerTool(
1753
+ 'snooze_routing_claim',
1754
+ {
1755
+ title: 'Stop surfacing one unclaimed source',
1756
+ description: "Silence one identifier in the `Sources nothing has claimed` block at session start. Use it when a recurring source genuinely belongs nowhere — a scratch repo, a bot channel, someone else's project that happens to cc you. NOT for something you simply have not got to yet: that is what leaving it alone does. A snooze silences the NOTICE and routes nothing; the events keep landing exactly where they land today. The block already has a volume floor that keeps one-off identifiers out, so anything you see there is recurring by construction — which is precisely why no threshold can tell 'not yet decided' from 'decided: nowhere', and why this exists. Bounded to at most a year and defaulting to 90 days, because a repo that was noise in August may be the centre of the work by November. Identity namespaces (`email:`, `thread:`) are refused: they are never surfaced as claimable in the first place, so there is nothing to snooze.",
1757
+ inputSchema: {
1758
+ identifier: z.string().describe('the identifier exactly as the context block prints it, e.g. `repo:owner/name`'),
1759
+ brain: z.string().optional().describe('which brain to stop surfacing it in. Required when you belong to more than one — the call refuses rather than picking.'),
1760
+ days: z.number().optional().describe('how long to stay quiet (1-365, default 90).'),
1761
+ reason: z.string().optional().describe('why it belongs nowhere, in one phrase — the next person to see it resurface will want this.'),
1762
+ },
1763
+ },
1764
+ async ({ identifier, brain, days, reason }) => {
1765
+ let res
1766
+ try {
1767
+ res = await fetchCortex(`${BASE}/api/brain/snooze-routing-claim`, {
1768
+ method: 'POST',
1769
+ headers: { Authorization: `Bearer ${TOKEN}`, 'Content-Type': 'application/json' },
1770
+ body: JSON.stringify({ identifier, ...(brain ? { brain } : {}), ...(days ? { days } : {}), ...(reason ? { reason } : {}) }),
1771
+ })
1772
+ } catch (e) {
1773
+ return toolError(`Could not snooze ${identifier}: ${e.message}`)
1774
+ }
1775
+ const out = await res.json().catch(() => null)
1776
+ if (!res.ok) {
1777
+ const extra = Array.isArray(out?.brains) ? `\nyour brains: ${out.brains.join(' · ')}` : ''
1778
+ const hint = out?.hint ? `\n${out.hint}` : ''
1779
+ return toolError(`Could not snooze ${identifier}: ${out?.error ?? res.status}${extra}${hint}`)
1780
+ }
1781
+ return { content: [{ type: 'text', text: `${out.note}\nIf it should route somewhere after all, \`set_routing_identifier\` on the owning page overrides this — a claim always beats a snooze.` }] }
1782
+ },
1783
+ )
1784
+
1752
1785
  server.registerTool(
1753
1786
  'set_summary',
1754
1787
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theronap/cortex-mcp",
3
- "version": "0.9.116",
3
+ "version": "0.9.117",
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": {