@theronap/agnoclast-mcp 0.9.282 → 0.9.283

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.
@@ -181,3 +181,15 @@ export function lockStateLine({ lockedInto = null, lock = null, brains = [] } =
181
181
  return `🔒 Confidential (a session works in one of these ALONE): ${names}\n` +
182
182
  ' This session is NOT locked yet. Pass the name as `brain` to any tool to lock the session to it; using any other brain first locks these away from the session instead.'
183
183
  }
184
+
185
+ const NOT_FOUND_RE = /^(No authored page named|No matches for|No page named|No records? (found|match))/m
186
+
187
+ /**
188
+ * In a locked-in session, a "not found" only means not found IN the confidential brain — a page can exist in a brain
189
+ * the lock hides, and the ordinary not-found text suggests authoring it (Theron's test, 2026-10-29: "author a new page"
190
+ * for a meal plan that sat in Personal). Returns the warning to put FIRST in such a result, or null.
191
+ */
192
+ export function lockedNotFoundNote(text, lockedInto) {
193
+ if (!lockedInto || !NOT_FOUND_RE.test(String(text ?? ''))) return null
194
+ return `⚠ Not found in "${lockedInto}" — and only there. This session is locked to that confidential brain, so it cannot see your other brains; what you asked for may exist in one of them. Do NOT author a page here to stand in for it. To reach other brains, start a new session.`
195
+ }
package/lib/server.mjs CHANGED
@@ -12,7 +12,7 @@ import { folderClaimLine } from './folder_claims.mjs'
12
12
  import { renderFolderClaimOffers, renderIdentifierResolution, renderUnroutedPathStamps } from './identifier_routes.mjs'
13
13
  import { renderDeclines, renderFolderDecisionsApplied, renderFolderQuestions } from './folder_decisions.mjs'
14
14
  import { resolveSessionKey, resolveLogSessionId } from './session_key.mjs'
15
- import { aiAccountOf, confidentialBrainNamed, fetchMyConfidential, gatherAgentProof, lockStateLine, markLockedIn, requestSeatToken } from './confidential_session.mjs'
15
+ import { aiAccountOf, confidentialBrainNamed, fetchMyConfidential, gatherAgentProof, lockStateLine, lockedNotFoundNote, markLockedIn, requestSeatToken } from './confidential_session.mjs'
16
16
  import { runSendImessage } from './imessage_send.mjs'
17
17
  import { formatGrepHits } from './grep_cli.mjs'
18
18
  import { buildProposal, renderProposal, withAskNotice } from './propose_obligation.mjs'
@@ -514,7 +514,9 @@ export async function runServer(version) {
514
514
  const result = await handler(...args)
515
515
  // Locked in: every result says so (Theron, 2026-10-28), so an AI never mistakes which state the session is in.
516
516
  if (lockedInto && Array.isArray(result?.content)) {
517
- return { ...result, content: [...result.content, { type: 'text', text: lockStateLine({ lockedInto }) }] }
517
+ const text = result.content.map((c) => (c?.type === 'text' ? c.text : '')).join('\n')
518
+ const warn = lockedNotFoundNote(text, lockedInto)
519
+ return { ...result, content: [...(warn ? [{ type: 'text', text: warn }] : []), ...result.content, { type: 'text', text: lockStateLine({ lockedInto }) }] }
518
520
  }
519
521
  return result
520
522
  }))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theronap/agnoclast-mcp",
3
- "version": "0.9.282",
3
+ "version": "0.9.283",
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": {