@theronap/agnoclast-mcp 0.9.329 → 0.9.330

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.
@@ -22,7 +22,7 @@ const SOURCE_LABEL = {
22
22
  handoff: 'Transcript or document', meeting: 'Meeting',
23
23
  // Every remote connector's saves, not only claude.ai's: which AI made one is rec.capturedBy (header line below).
24
24
  'claude-connector': 'Saved through a connector',
25
- // An agent's text conversation, summarised into a session (web/lib/engine/agent_conversation_log.ts).
25
+ // An agent's text conversation, kept word for word as a session (web/lib/engine/agent_conversation_log.ts).
26
26
  'agent-chat': 'Agent conversation',
27
27
  }
28
28
 
package/lib/server.mjs CHANGED
@@ -2411,12 +2411,14 @@ function renderNudge(payload) {
2411
2411
  history: z.boolean().optional().describe('node names only: return the node\'s TIMELINE (events joined via its [[repo:…]] stamps, reverse-chron, viewer-visible) instead of the page body. The page is the present; this is the history.'),
2412
2412
  version: z.string().optional().describe('read a HISTORICAL version of this page instead of the current one: a rev_no (e.g. "3") or a content_hash from page_history. Use page_history first to see the versions, then rollback_page to restore one.'),
2413
2413
  ref: z.string().optional().describe('the page\'s ref (read_page prints it as `ref:`). Addresses exactly one page, so use it when a name exists in more than one brain — history and version reads refuse an ambiguous name and list the refs to choose from.'),
2414
+ brain: z.string().optional().describe('a brain name from my_brains: read only THAT brain\'s page when the same name exists in several brains. Naming a 🔒 confidential brain also locks this session to it.'),
2414
2415
  },
2415
2416
  },
2416
- async ({ name, kind, expand, history, version, ref }) => {
2417
+ async ({ name, kind, expand, history, version, ref, brain }) => {
2417
2418
  const k = kind ?? 'project'
2418
- // A ref addresses exactly one page; a name can match one page in each of several brains.
2419
- const address = (extra = {}) => new URLSearchParams(ref ? { ref, ...extra } : { kind: k, key: name, ...extra })
2419
+ // A ref addresses exactly one page; a name can match one page in each of several brains. `brain`
2420
+ // narrows to one brain's copy (dry-run bug 4: before 0.9.x it only ever opened confidential brains).
2421
+ const address = (extra = {}) => new URLSearchParams({ ...(ref ? { ref } : { kind: k, key: name }), ...(brain ? { brain } : {}), ...extra })
2420
2422
  // PAGE HISTORY (Part A): a specific version reads one historical body, resolved within this page's
2421
2423
  // own history. Not for identifier-shaped names (those are join keys, handled below).
2422
2424
  if (version && !/^[a-z][a-z0-9_-]*:.+/i.test(name)) {
@@ -2521,6 +2523,7 @@ function renderNudge(payload) {
2521
2523
  } catch (e) {
2522
2524
  return toolError(`Could not read "${name}": ${e.message}`)
2523
2525
  }
2526
+ if (res.status === 400 && brain) return { content: [{ type: 'text', text: `"${brain}" is not one of your brains. my_brains lists them.` }] }
2524
2527
  if (res.status === 404) {
2525
2528
  return { content: [{ type: 'text', text: `No ${k} page named "${name}". If it's a person or team, pass kind (person/org).${await redLinkTriage(BASE, TOKEN, name)}` }] }
2526
2529
  }
@@ -2538,6 +2541,9 @@ function renderNudge(payload) {
2538
2541
  if (!matches.length && page?.authored && Array.isArray(page.tiers) && page.tiers.length) {
2539
2542
  matches = [{ brain: null, authored: true, ref: page.ref, title: page.title, tiers: page.tiers }]
2540
2543
  }
2544
+ if (!matches.length && brain) {
2545
+ return { content: [{ type: 'text', text: `No authored page named "${name}" in the brain "${brain}". Leave out \`brain\` to search every brain you belong to.` }] }
2546
+ }
2541
2547
  if (!matches.length) {
2542
2548
  // ⚠ This used to say: `No authored ${k} page named "X" ... If it's a person or team, pass
2543
2549
  // kind (person/org).` Both halves misled. resolveNodeByTitle matches EVERY kind and uses the
@@ -2644,7 +2650,7 @@ function renderNudge(payload) {
2644
2650
  if (matches.length === 1) {
2645
2651
  return { content: [{ type: 'text', text: renderMatch(matches[0], false) + nudgeBlock }] }
2646
2652
  }
2647
- const header = `"${name}" is authored in ${matches.length} of your brains — all shown (each tagged with its brain, newest tier first):`
2653
+ const header = `"${name}" is authored in ${matches.length} of your brains — all shown (each tagged with its brain, newest tier first). They are DIFFERENT pages: to read or change one, pass its \`ref\` (or \`brain\`).`
2648
2654
  return { content: [{ type: 'text', text: [header, ...matches.map((m) => renderMatch(m, true))].join('\n\n═══════════════════\n\n') + nudgeBlock }] }
2649
2655
  },
2650
2656
  )
@@ -2658,18 +2664,30 @@ function renderNudge(payload) {
2658
2664
  name: z.string().describe('the canonical node name exactly as written (e.g. "Agnoclast", "Ben")'),
2659
2665
  kind: z.enum(['project', 'person', 'org', 'user']).optional().describe('node kind (default project)'),
2660
2666
  limit: z.number().int().optional().describe('how many recent versions to show (default 20, max 200)'),
2667
+ ref: z.string().optional().describe('the page\'s ref (read_page prints it as `ref:`). Addresses exactly one page — use it when the name exists in more than one brain.'),
2668
+ brain: z.string().optional().describe('a brain name from my_brains: that brain\'s page, when the same name exists in several brains'),
2661
2669
  },
2662
2670
  },
2663
- async ({ name, kind, limit }) => {
2671
+ async ({ name, kind, limit, ref, brain }) => {
2664
2672
  const k = kind ?? 'project'
2665
2673
  let res
2666
2674
  try {
2667
- const qs = new URLSearchParams({ kind: k, key: name, ...(limit ? { limit: String(limit) } : {}) })
2675
+ // Dry-run bug 4 (2026-11-07): this sent only the name, so for a name in several brains the server
2676
+ // picked one — the Hermes lane asked for its results page and got the Grok lane's history.
2677
+ const qs = new URLSearchParams({ kind: k, key: name, ...(ref ? { ref } : {}), ...(brain ? { brain } : {}), ...(limit ? { limit: String(limit) } : {}) })
2668
2678
  res = await fetchCortex(`${BASE}/api/brain/page-history?${qs}`, { headers: { Authorization: `Bearer ${TOKEN}` } })
2669
2679
  } catch (e) {
2670
2680
  return toolError(`Could not read history for "${name}": ${e.message}`)
2671
2681
  }
2672
- if (res.status === 404) return { content: [{ type: 'text', text: `No ${k} named "${name}". Pass kind (person/org) if it isn't a project.` }] }
2682
+ if (res.status === 409) {
2683
+ const body = await res.json().catch(() => null)
2684
+ const c = Array.isArray(body?.candidates) ? body.candidates : []
2685
+ return { content: [{ type: 'text', text: c.length
2686
+ ? [`"${name}" names a page in ${c.length} of your brains, and one history list can only be one page's — call page_history again with the ref of the one you mean:`, ...c.map((m) => ` - in ${m.brain} — ref: ${m.ref}`)].join('\n')
2687
+ : await ambiguousPageHint(BASE, TOKEN, k, name) }] }
2688
+ }
2689
+ if (res.status === 400 && brain) return { content: [{ type: 'text', text: `"${brain}" is not one of your brains. my_brains lists them.` }] }
2690
+ if (res.status === 404) return { content: [{ type: 'text', text: brain ? `No ${k} "${name}" in the brain "${brain}".` : `No ${k} named "${name}". Pass kind (person/org) if it isn't a project.` }] }
2673
2691
  if (!res.ok) {
2674
2692
  const d = classify(res.status, res.headers.get('content-type'), await res.text(), res.headers.get('x-vercel-id'))
2675
2693
  return toolError(`Could not read history for "${name}": ${d.message}`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theronap/agnoclast-mcp",
3
- "version": "0.9.329",
3
+ "version": "0.9.330",
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": {