@theronap/agnoclast-mcp 0.9.164 → 0.9.165
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 +40 -3
- package/package.json +1 -1
package/lib/server.mjs
CHANGED
|
@@ -285,6 +285,43 @@ function renderArrival(payload) {
|
|
|
285
285
|
` — \`staged_records\` lists them. Not offered to you, just counted; \`ignore_arrivals\` if this is noise right now.`
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
+
function renderSettling(payload) {
|
|
289
|
+
const feed = payload?.settling
|
|
290
|
+
const offers = Array.isArray(feed?.offers) ? feed.offers : []
|
|
291
|
+
if (!offers.length) return ''
|
|
292
|
+
const total = Number(feed?.total ?? offers.length)
|
|
293
|
+
|
|
294
|
+
const lines = offers.map((x) => {
|
|
295
|
+
const why = x.via?.length ? ` — matches ${x.via.map((v) => `\`${v}\``).join(', ')}` : ''
|
|
296
|
+
// Looks without claims is evidence about the UNIT, not about the sessions that walked away.
|
|
297
|
+
const looked = x.looks > 0 ? ` [looked at ${x.looks}x, still unclaimed]` : ''
|
|
298
|
+
return ` - ${x.source} · ${x.hoursAgo}h ago · ${x.intakeItemId}${why}${looked}`
|
|
299
|
+
})
|
|
300
|
+
|
|
301
|
+
// ⚠ SAY THE TRUE TOTAL, NOT THE PAGE SIZE. Measured 2026-09-22: one identifier matched 113 settling
|
|
302
|
+
// units against a cap of 12. A block that says "here are 12" when there are 113 is claiming
|
|
303
|
+
// certainty it does not have — and renders identically every turn, which teaches the reader that
|
|
304
|
+
// it never changes and can be skipped.
|
|
305
|
+
const more = total > offers.length
|
|
306
|
+
? `\n— Showing ${offers.length} of ${total}. \`intake_changes\` lists the rest; this is a sample, not the queue.`
|
|
307
|
+
: ''
|
|
308
|
+
|
|
309
|
+
// ⚠ CONTENTION IS STATED, exactly as the record nudge states `k`. Measured the same day: THREE live
|
|
310
|
+
// sessions each matched the SAME 113 units on one identifier. Silent about that, each would claim
|
|
311
|
+
// the same units and learn about the race from a failed lease.
|
|
312
|
+
const maxHolders = offers.reduce((m, x) => Math.max(m, Number(x.holders ?? 1)), 1)
|
|
313
|
+
const who = maxHolders > 1
|
|
314
|
+
? `\n— ⚠ ${maxHolders} live sessions of yours hold a matching identifier, so these are offered to all of them. \`intake_claim\` takes a lease — claim before you work, not after, or two sessions judge the same arrival.`
|
|
315
|
+
: `\n— No other live session of yours holds a matching identifier, so nobody else is looking at these.`
|
|
316
|
+
|
|
317
|
+
return `\n\n⚡ ARRIVALS SETTLING — yours alone, and no one else can see these yet:\n${lines.join('\n')}\n` +
|
|
318
|
+
`— These are unjudged ARRIVALS, not records. Since automatic materialization was deleted, nothing files them for you.\n` +
|
|
319
|
+
`— \`intake_look <id>\` reads the full body without claiming it — looking is free, non-exclusive and logged, so look rather than guess from the headline.\n` +
|
|
320
|
+
`— Then \`intake_claim\` and \`intake_materialize\` into the brain and pages it belongs to, or \`intake_discard\`, or \`intake_defer\` with a question when only the owner can decide.` +
|
|
321
|
+
more + who +
|
|
322
|
+
`\n— If none are yours, leave them: they stay settling for your other sessions, and become everyone's business once the window closes.`
|
|
323
|
+
}
|
|
324
|
+
|
|
288
325
|
function renderNudge(payload) {
|
|
289
326
|
const n = Array.isArray(payload?.nudge) ? payload.nudge : []
|
|
290
327
|
if (!n.length) return ''
|
|
@@ -1389,7 +1426,7 @@ function renderNudge(payload) {
|
|
|
1389
1426
|
throw new Error(classify(res.status, res.headers.get('content-type'), body, res.headers.get('x-vercel-id')).message)
|
|
1390
1427
|
}
|
|
1391
1428
|
const payload = await res.json()
|
|
1392
|
-
return { content: [{ type: 'text', text: formatGrepHits(payload, query) + renderArrival(payload) + renderNudge(payload) }] }
|
|
1429
|
+
return { content: [{ type: 'text', text: formatGrepHits(payload, query) + renderArrival(payload) + renderNudge(payload) + renderSettling(payload) }] }
|
|
1393
1430
|
},
|
|
1394
1431
|
)
|
|
1395
1432
|
|
|
@@ -1698,7 +1735,7 @@ function renderNudge(payload) {
|
|
|
1698
1735
|
// `k` is stated rather than hidden. "Only you" and "you and two others" call for different
|
|
1699
1736
|
// behaviour, and a nudge that claimed certainty it did not have is how an agent learns to stop
|
|
1700
1737
|
// reading them.
|
|
1701
|
-
const nudgeBlock = renderArrival(page) + renderNudge(page)
|
|
1738
|
+
const nudgeBlock = renderArrival(page) + renderNudge(page) + renderSettling(page)
|
|
1702
1739
|
|
|
1703
1740
|
if (matches.length === 1) {
|
|
1704
1741
|
return { content: [{ type: 'text', text: renderMatch(matches[0], false) + nudgeBlock }] }
|
|
@@ -3449,7 +3486,7 @@ function renderNudge(payload) {
|
|
|
3449
3486
|
return toolError(`Could not list records: ${d.message}`)
|
|
3450
3487
|
}
|
|
3451
3488
|
const payload = await res.json()
|
|
3452
|
-
return { content: [{ type: 'text', text: (payload?.text ?? '') + renderArrival(payload) + renderNudge(payload) }] }
|
|
3489
|
+
return { content: [{ type: 'text', text: (payload?.text ?? '') + renderArrival(payload) + renderNudge(payload) + renderSettling(payload) }] }
|
|
3453
3490
|
},
|
|
3454
3491
|
)
|
|
3455
3492
|
|
package/package.json
CHANGED