@theronap/agnoclast-mcp 0.9.240 → 0.9.241
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/editors/claude.mjs +1 -1
- package/lib/server.mjs +44 -2
- package/package.json +1 -1
package/lib/editors/claude.mjs
CHANGED
|
@@ -30,7 +30,7 @@ export function mergeClaudeMcp(existing, spec, token) {
|
|
|
30
30
|
export const ALLOWED_TOOL_NAMES = [
|
|
31
31
|
// read surface
|
|
32
32
|
'grep', 'read_page', 'my_context', 'project_status', 'session_context', 'search_org',
|
|
33
|
-
'list_records', 'read_record', 'page_history', 'page_diff', 'timeline_pull', 'my_brains', 'my_sessions', 'writing_style',
|
|
33
|
+
'list_records', 'read_record', 'page_history', 'page_diff', 'timeline_pull', 'my_brains', 'my_sessions', 'token_activity', 'writing_style',
|
|
34
34
|
'code_graph_query', 'my_retier_notices', 'list_page_grants', 'list_project_members', 'file_requests',
|
|
35
35
|
// the questions agents used to answer with SQL (2026-10-07) — read-only, the caller's own view
|
|
36
36
|
'record_status', 'my_connectors', 'brain_stats', 'my_sends', 'find_arrivals',
|
package/lib/server.mjs
CHANGED
|
@@ -2364,7 +2364,9 @@ function renderNudge(payload) {
|
|
|
2364
2364
|
const revs = out.revisions ?? []
|
|
2365
2365
|
if (!revs.length) return { content: [{ type: 'text', text: `"${name}" (${k}) has no recorded version history yet.` }] }
|
|
2366
2366
|
const lines = revs.map((r) => {
|
|
2367
|
-
|
|
2367
|
+
// "Theron via Frack" — the label only ever reaches the token's owner (bdb2339b phase 2).
|
|
2368
|
+
const via = r.via_token_label ? ` via ${r.via_token_label}` : ''
|
|
2369
|
+
const who = r.actor_name ? ` · ${r.actor_name}${via}` : (via ? ` ·${via}` : '')
|
|
2368
2370
|
// change_kind first and bracketed so a column of [correct] is scannable — the whole point is
|
|
2369
2371
|
// that a page with repeated corrections looks different at a glance from one that only grew.
|
|
2370
2372
|
const what = r.change_kind ? ` · [${r.change_kind}]` : ''
|
|
@@ -2419,7 +2421,7 @@ function renderNudge(payload) {
|
|
|
2419
2421
|
? `# ${name} — rev ${d.to.revNo} (first version)`
|
|
2420
2422
|
: `# ${name} — rev ${d.from.revNo} → rev ${d.to.revNo}`
|
|
2421
2423
|
const meta = []
|
|
2422
|
-
meta.push(`${String(d.to.createdAt).slice(0, 10)} · ${d.to.op}${d.to.changeKind ? ` · [${d.to.changeKind}]` : ''}${d.to.actorName ? ` · ${d.to.actorName}` : ''}`)
|
|
2424
|
+
meta.push(`${String(d.to.createdAt).slice(0, 10)} · ${d.to.op}${d.to.changeKind ? ` · [${d.to.changeKind}]` : ''}${d.to.actorName ? ` · ${d.to.actorName}${d.to.viaTokenLabel ? ` via ${d.to.viaTokenLabel}` : ''}` : ''}`)
|
|
2423
2425
|
if (d.to.reason) meta.push(`reason: ${d.to.reason}`)
|
|
2424
2426
|
if (d.to.sessionKey) meta.push(`session: ${String(d.to.sessionKey).slice(0, 24)}`)
|
|
2425
2427
|
const body = []
|
|
@@ -5370,6 +5372,46 @@ function renderNudge(payload) {
|
|
|
5370
5372
|
},
|
|
5371
5373
|
)
|
|
5372
5374
|
|
|
5375
|
+
server.registerTool(
|
|
5376
|
+
'token_activity',
|
|
5377
|
+
{
|
|
5378
|
+
title: 'What this agent token has done',
|
|
5379
|
+
description: "Audit YOUR OWN recent activity through the token you are connected with: tool calls, wiki page edits, record placements and intake discards, newest first. Use it to report back what you did (\"what did I discard today?\"), or to check a run before handing off. Self-only: it reads the CALLING token's activity and never another agent's — the person audits all their tokens from Connect → Agent tokens. Discards are content-free by design, so they name the source, not the item. Errors if you are not connected with an agent token (console sessions have none).",
|
|
5380
|
+
inputSchema: {
|
|
5381
|
+
days: z.number().int().optional().describe('how far back (default 7, max 30)'),
|
|
5382
|
+
kinds: z.array(z.enum(['call', 'edit', 'placement', 'discard'])).optional().describe('only these kinds (default all)'),
|
|
5383
|
+
limit: z.number().int().optional().describe('max items (default 100, max 500)'),
|
|
5384
|
+
},
|
|
5385
|
+
},
|
|
5386
|
+
async ({ days, kinds, limit }) => {
|
|
5387
|
+
let res
|
|
5388
|
+
try {
|
|
5389
|
+
const qs = new URLSearchParams({
|
|
5390
|
+
...(days ? { days: String(days) } : {}), ...(limit ? { limit: String(limit) } : {}),
|
|
5391
|
+
...(kinds?.length ? { kinds: kinds.join(',') } : {}),
|
|
5392
|
+
})
|
|
5393
|
+
res = await fetchCortex(`${BASE}/api/me/token-activity?${qs}`, { headers: { Authorization: `Bearer ${TOKEN}` } })
|
|
5394
|
+
} catch (e) {
|
|
5395
|
+
return toolError(`Could not read this token's activity: ${e.message}`)
|
|
5396
|
+
}
|
|
5397
|
+
if (res.status === 400) return { content: [{ type: 'text', text: 'You are not connected with an agent token, so there is no per-token activity to show. The person can see every token\'s activity under Connect → Agent tokens.' }] }
|
|
5398
|
+
if (!res.ok) {
|
|
5399
|
+
const d = classify(res.status, res.headers.get('content-type'), await res.text(), res.headers.get('x-vercel-id'))
|
|
5400
|
+
return toolError(`Could not read this token's activity: ${d.message}`)
|
|
5401
|
+
}
|
|
5402
|
+
const out = await res.json()
|
|
5403
|
+
const name = out.token?.label ?? 'this token'
|
|
5404
|
+
const items = out.items ?? []
|
|
5405
|
+
if (!items.length) return { content: [{ type: 'text', text: `${name}: no activity in the last ${days ?? 7} day(s).` }] }
|
|
5406
|
+
const counts = {}
|
|
5407
|
+
for (const i of items) counts[i.kind] = (counts[i.kind] ?? 0) + 1
|
|
5408
|
+
const lines = items.map((i) =>
|
|
5409
|
+
`- ${String(i.at).slice(0, 16).replace('T', ' ')} · ${i.kind} · ${i.what ?? '—'}${i.detail ? ` · ${i.detail}` : ''}${i.reason ? ` — ${i.reason}` : ''}`)
|
|
5410
|
+
const summary = Object.entries(counts).map(([k, n]) => `${n} ${k}`).join(' · ')
|
|
5411
|
+
return { content: [{ type: 'text', text: `# ${name} — activity, last ${days ?? 7} day(s), newest first (UTC)\n${summary}\n\n${lines.join('\n')}` }] }
|
|
5412
|
+
},
|
|
5413
|
+
)
|
|
5414
|
+
|
|
5373
5415
|
server.registerTool(
|
|
5374
5416
|
'my_sessions',
|
|
5375
5417
|
{
|
package/package.json
CHANGED