@theronap/agnoclast-mcp 0.9.343 → 0.9.344
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/intake_batch_render.mjs +15 -0
- package/lib/server.mjs +9 -5
- package/package.json +1 -1
|
@@ -40,3 +40,18 @@ export function renderPreviewBatch(results) {
|
|
|
40
40
|
`${results.length - refuse.length} would file as sent, ${refuse.length} would not.\n` +
|
|
41
41
|
results.map((r) => `\n── ${r.id}\n${r.ok ? r.line : `✗ preview failed — ${r.detail}`}`).join('\n')
|
|
42
42
|
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* ADR-0112: the keep-current blocks a batch's records came back with, each distinct block once (a text
|
|
46
|
+
* conversation's units land on the same pages, so they repeat word for word), at most three.
|
|
47
|
+
*/
|
|
48
|
+
export function batchKeepCurrent(results, max = 3) {
|
|
49
|
+
const seen = []
|
|
50
|
+
for (const r of results) {
|
|
51
|
+
const k = typeof r?.body?.keepCurrent === 'string' ? r.body.keepCurrent.trim() : ''
|
|
52
|
+
if (k && !seen.includes(k)) seen.push(k)
|
|
53
|
+
}
|
|
54
|
+
if (!seen.length) return ''
|
|
55
|
+
const more = seen.length > max ? `\n\n(${seen.length - max} more record(s) in this batch landed on other pages worth checking.)` : ''
|
|
56
|
+
return `\n\n${seen.slice(0, max).join('\n\n')}${more}`
|
|
57
|
+
}
|
package/lib/server.mjs
CHANGED
|
@@ -28,7 +28,7 @@ import { spawnObligationWorker } from './obligations_worker.mjs'
|
|
|
28
28
|
import { renderObligations, renderPageObligations, tierReads, who, holdLine } from './obligations_render.mjs'
|
|
29
29
|
import { renderLeaveQuestion, renderLeft, renderRemovalQuestion, renderRemoved } from './member_remove_render.mjs'
|
|
30
30
|
import { renderSettings } from './settings_render.mjs'
|
|
31
|
-
import { renderConversationOffer, renderMaterializeBatch, renderPreviewBatch } from './intake_batch_render.mjs'
|
|
31
|
+
import { batchKeepCurrent, renderConversationOffer, renderMaterializeBatch, renderPreviewBatch } from './intake_batch_render.mjs'
|
|
32
32
|
import { batchUnitBody, batchUnitMap, unusedFolderDecisions } from './intake_batch.mjs'
|
|
33
33
|
import { intakeIdFrom, requireIntakeId, INTAKE_ID_ALIAS_NOTE } from './intake_id_alias.mjs'
|
|
34
34
|
import { obligationsForUnits, renderFilingObligations, renderObligationItems, filingObligationsBrief, OBLIGATIONS_UNANSWERED_TEXT } from './filing_obligations.mjs'
|
|
@@ -1644,7 +1644,7 @@ function renderNudge(payload) {
|
|
|
1644
1644
|
...(unused.length ? [`⚠ folderDecisions applied by NO unit in this batch (check the identifiers): ${unused.map((x) => `\`${x}\``).join(', ')}`] : []),
|
|
1645
1645
|
]
|
|
1646
1646
|
// The per-unit map, machine-readable: which record each unit became (2026-10-23 trial).
|
|
1647
|
-
return { content: [{ type: 'text', text: `${renderMaterializeBatch(results)}${notes.length ? `\n${notes.join('\n')}` : ''}\n\nunits: ${JSON.stringify(batchUnitMap(results))}` }] }
|
|
1647
|
+
return { content: [{ type: 'text', text: `${renderMaterializeBatch(results)}${notes.length ? `\n${notes.join('\n')}` : ''}${batchKeepCurrent(results)}\n\nunits: ${JSON.stringify(batchUnitMap(results))}` }] }
|
|
1648
1648
|
}
|
|
1649
1649
|
// A preview goes to its OWN route: a server too old to know it answers 404, where the materialize
|
|
1650
1650
|
// route would ignore a `mode` it does not know and publish.
|
|
@@ -1775,9 +1775,13 @@ function renderNudge(payload) {
|
|
|
1775
1775
|
} else if (body?.contained === false) {
|
|
1776
1776
|
lines.push('Already inside the container named at capture (no change).')
|
|
1777
1777
|
}
|
|
1778
|
+
// ADR-0112: the pages it landed on — people first — with what to fold in. Rendered as text, not left in the JSON.
|
|
1779
|
+
const keep = typeof body?.keepCurrent === 'string' ? body.keepCurrent.trim() : ''
|
|
1780
|
+
const shown = keep ? { ...body, keepCurrent: '(shown above)' } : body
|
|
1781
|
+
if (keep) lines.push(keep)
|
|
1778
1782
|
const text = lines.length
|
|
1779
|
-
? `${lines.join('\n')}\n\n${JSON.stringify(
|
|
1780
|
-
: JSON.stringify(
|
|
1783
|
+
? `${lines.join('\n')}\n\n${JSON.stringify(shown, null, 2)}`
|
|
1784
|
+
: JSON.stringify(shown, null, 2)
|
|
1781
1785
|
return { content: [{ type: 'text', text }] }
|
|
1782
1786
|
},
|
|
1783
1787
|
)
|
|
@@ -7433,7 +7437,7 @@ function renderNudge(payload) {
|
|
|
7433
7437
|
}
|
|
7434
7438
|
if (!res.ok) return toolError(`Could not route record: ${out?.error ?? res.status}${out?.detail ? ` — ${out.detail}` : ''}`)
|
|
7435
7439
|
if (park) return { content: [{ type: 'text', text: 'Parked. It stays visible and unrouted rather than badly attached.' }] }
|
|
7436
|
-
return { content: [{ type: 'text', text: `Routed — attached to ${out?.attached?.length ?? 0} page(s). Recorded as a session judgment, not a rule match
|
|
7440
|
+
return { content: [{ type: 'text', text: `Routed — attached to ${out?.attached?.length ?? 0} page(s). Recorded as a session judgment, not a rule match.${typeof out?.keepCurrent === 'string' ? out.keepCurrent : ''}` }] }
|
|
7437
7441
|
},
|
|
7438
7442
|
)
|
|
7439
7443
|
|
package/package.json
CHANGED