@theronap/agnoclast-mcp 0.9.224 → 0.9.225
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 +14 -4
- package/package.json +1 -1
package/lib/server.mjs
CHANGED
|
@@ -5270,13 +5270,14 @@ function renderNudge(payload) {
|
|
|
5270
5270
|
'set_routing_identifier',
|
|
5271
5271
|
{
|
|
5272
5272
|
title: 'Claim a routing identifier on a page',
|
|
5273
|
-
description: 'Declare that a page is a Gate 4 attach HOME for an identifier (repo:owner/name or file:owner/name:path). Body [[repo:…]] stamps are navigation only and do NOT drive attach — use this instead. Prefer the narrowest id: mother pages own repo:; feature pages own file: paths. Do not copy every body mention into a routing claim.'
|
|
5273
|
+
description: 'Declare that a page is a Gate 4 attach HOME for an identifier (repo:owner/name or file:owner/name:path). Body [[repo:…]] stamps are navigation only and do NOT drive attach — use this instead. Prefer the narrowest id: mother pages own repo:; feature pages own file: paths. Do not copy every body mention into a routing claim. ' +
|
|
5274
|
+
'PRIVATE CONTACT CLAIMS (ADR-0079): on a PERSON page you may claim `phone:<number>` (normalized to E.164, US default — `phone:(801) 636-7505` stores `phone:+18016367505`) or `email:<address>` (lowercased). These are visible ONLY to you — never in the page body, grep, or to other brain members — and they make your captured texts / mail from that contact propose that person page. This is the right place for a contact\'s number; never put it in page text.',
|
|
5274
5275
|
inputSchema: {
|
|
5275
5276
|
kind: z.enum(['project', 'person', 'org', 'user']).describe('the page kind'),
|
|
5276
5277
|
name: z.string().optional().describe('page title (or pass ref)'),
|
|
5277
5278
|
ref: z.string().optional().describe('node ref from read_page — prefer over name when available'),
|
|
5278
5279
|
brain: z.string().optional().describe('brain label when the title is ambiguous across brains'),
|
|
5279
|
-
identifier: z.string().describe('canonical identifier, e.g. repo:theronap/cortex
|
|
5280
|
+
identifier: z.string().describe('canonical identifier, e.g. repo:theronap/cortex, file:theronap/cortex:web/lib/engine/github_intake.ts, or on a person page phone:+18015550123 / email:someone@example.com (private to you)'),
|
|
5280
5281
|
},
|
|
5281
5282
|
},
|
|
5282
5283
|
async ({ kind, name, ref, brain, identifier }) => {
|
|
@@ -5292,7 +5293,12 @@ function renderNudge(payload) {
|
|
|
5292
5293
|
return toolError(`Could not set routing identifier: ${e.message}`)
|
|
5293
5294
|
}
|
|
5294
5295
|
const out = await res.json().catch(() => null)
|
|
5295
|
-
if (!res.ok)
|
|
5296
|
+
if (!res.ok) {
|
|
5297
|
+
// A per-identifier refusal arrives in `errors[]` with a top-level 400 — name it, not just the status.
|
|
5298
|
+
const why = out?.error ?? out?.errors?.map((e) => e.error).join(', ') ?? res.status
|
|
5299
|
+
const hint = /phone_claims_person_pages_only/.test(String(why)) ? ' A phone: claim goes on the PERSON page for that contact (kind: person).' : ''
|
|
5300
|
+
return toolError(`Could not set routing identifier: ${why}.${hint}`)
|
|
5301
|
+
}
|
|
5296
5302
|
const set = out?.set?.join(', ') ?? identifier
|
|
5297
5303
|
// ⚠ SAY WHAT ALREADY HAPPENED, NOT ONLY WHAT WILL. The claim heals history in the same
|
|
5298
5304
|
// statement, so by the time this renders, existing records are ALREADY attached. The previous
|
|
@@ -5306,7 +5312,11 @@ function renderNudge(payload) {
|
|
|
5306
5312
|
: healed > 0
|
|
5307
5313
|
? ` ${healed} existing record(s) ALREADY attached to this page as a result.`
|
|
5308
5314
|
: ' 0 existing records attached — either nothing carries this identifier yet, or records do but belong to another owner (an identity claim only attaches your own).'
|
|
5309
|
-
|
|
5315
|
+
const isContact = /^(phone|email):/.test(String(out?.set?.[0] ?? identifier).toLowerCase())
|
|
5316
|
+
const privacyLine = isContact
|
|
5317
|
+
? ' This contact claim is PRIVATE to you: no other brain member can see it, and it is never rendered in the page. Your captured texts/mail from this contact will now propose this page.'
|
|
5318
|
+
: ''
|
|
5319
|
+
return { content: [{ type: 'text', text: `Routing identifier set on document ${out?.documentId ?? '?'}: ${set}.${healedLine} Future matching events will attach here too (body mentions alone will not).${privacyLine}` }] }
|
|
5310
5320
|
},
|
|
5311
5321
|
)
|
|
5312
5322
|
|
package/package.json
CHANGED