@theronap/agnoclast-mcp 0.9.245 → 0.9.246
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 +47 -0
- package/package.json +1 -1
package/lib/server.mjs
CHANGED
|
@@ -5057,6 +5057,53 @@ function renderNudge(payload) {
|
|
|
5057
5057
|
},
|
|
5058
5058
|
)
|
|
5059
5059
|
|
|
5060
|
+
// share_page — a read-only link to one wiki page (ADR-0090; Theron, 2026-10-19). Same shape as share_record:
|
|
5061
|
+
// NOT auto-allowed (a disclosure, so it prompts), and only when the person asks. Never a confidential page.
|
|
5062
|
+
server.registerTool(
|
|
5063
|
+
'share_page',
|
|
5064
|
+
{
|
|
5065
|
+
title: 'Make a share link for a wiki page',
|
|
5066
|
+
description:
|
|
5067
|
+
'Make a read-only link (agnoclast.com/p/…) to ONE wiki page, for anyone — including people outside Agnoclast. ' +
|
|
5068
|
+
'They see the page as it is when they open it: its title and sections; links to other pages show as plain text, ' +
|
|
5069
|
+
'and nothing else in the brain is shared. Signed-in viewers can save their own copy; others can join free. ' +
|
|
5070
|
+
'Allowed for a page you own, or an accessible page you can edit; never a confidential page. Name the page by ' +
|
|
5071
|
+
'node kind + ref (what read_page shows), optionally its tier. The link is shown ONCE — give it to the person ' +
|
|
5072
|
+
'straight away. Only when the person asks to share; never on your own initiative.',
|
|
5073
|
+
inputSchema: {
|
|
5074
|
+
kind: z.string().describe('the page node kind (project, person, org, user, …)'),
|
|
5075
|
+
ref: z.string().describe('the page node ref (uuid)'),
|
|
5076
|
+
tier: z.enum(['accessible', 'scoped', 'reports', 'peers', 'down']).optional().describe('which version, when the node has several'),
|
|
5077
|
+
label: z.string().max(80).optional().describe('a label only you see'),
|
|
5078
|
+
expires_in_days: z.number().int().min(1).max(3650).optional().describe('how long the link works; default: no expiry'),
|
|
5079
|
+
},
|
|
5080
|
+
},
|
|
5081
|
+
async ({ kind, ref, tier, label, expires_in_days }) => {
|
|
5082
|
+
let res
|
|
5083
|
+
try {
|
|
5084
|
+
res = await fetchCortex(`${BASE}/api/brain/page-shares`, {
|
|
5085
|
+
method: 'POST',
|
|
5086
|
+
headers: { Authorization: `Bearer ${TOKEN}`, 'Content-Type': 'application/json' },
|
|
5087
|
+
body: JSON.stringify({ kind, ref, ...(tier ? { tier } : {}), ...(label ? { label } : {}), ...(expires_in_days ? { expiresInDays: expires_in_days } : {}) }),
|
|
5088
|
+
})
|
|
5089
|
+
} catch (e) {
|
|
5090
|
+
return toolError(`Could not make a share link: ${e.message}`)
|
|
5091
|
+
}
|
|
5092
|
+
if ([403, 404, 409].includes(res.status)) {
|
|
5093
|
+
const b = await res.json().catch(() => null)
|
|
5094
|
+
return toolError(`Not shared: ${b?.detail ?? b?.error ?? 'refused'}`)
|
|
5095
|
+
}
|
|
5096
|
+
if (!res.ok) {
|
|
5097
|
+
const d = classify(res.status, res.headers.get('content-type'), await res.text(), res.headers.get('x-vercel-id'))
|
|
5098
|
+
return toolError(`Could not make a share link: ${d.message}`)
|
|
5099
|
+
}
|
|
5100
|
+
const out = await res.json()
|
|
5101
|
+
return { content: [{ type: 'text', text:
|
|
5102
|
+
`Share link for the page "${out.title}":\n${out.url}\n` +
|
|
5103
|
+
`Read-only, live (they see the page as it is when they open it). This link is shown only once. share id: ${out.share.id}` }] }
|
|
5104
|
+
},
|
|
5105
|
+
)
|
|
5106
|
+
|
|
5060
5107
|
// set_record_notes — write the NOTES layer of one of your own transcripts (Theron, 2026-10-08: "two
|
|
5061
5108
|
// layers … a summary and notes from the transcript … the full transcript"). The server keeps the
|
|
5062
5109
|
// before-state in record history and refuses anything that is not your own kept transcript.
|
package/package.json
CHANGED