@theronap/agnoclast-mcp 0.9.275 โ 0.9.277
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/arrivals_notice.mjs +22 -2
- package/lib/editors/claude.mjs +7 -8
- package/lib/editors/codex.mjs +5 -5
- package/lib/editors/cursor.mjs +4 -3
- package/lib/release_gate.mjs +1 -1
- package/package.json +1 -1
package/lib/arrivals_notice.mjs
CHANGED
|
@@ -221,6 +221,19 @@ export function formatUnheld(groups, { more = false, shadow = false } = {}) {
|
|
|
221
221
|
return lines
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
+
/** Arrivals assigned to a session that may still lock into a confidential brain: shown, not to be touched yet. */
|
|
225
|
+
export function formatHeldForLock(groups) {
|
|
226
|
+
const n = groups.reduce((t, g) => t + (Number(g?.count) || 1), 0)
|
|
227
|
+
const lines = [`๐ฅ ${n} arrival${n === 1 ? ' is' : 's are'} assigned to this session โ LEAVE ${n === 1 ? 'IT' : 'THEM'} FOR NOW: do not file, claim or dispatch a filer this turn.`]
|
|
228
|
+
for (const g of groups.slice(0, MAX_ASSIGNED)) {
|
|
229
|
+
const many = Number(g?.count) > 1 ? ` ร${g.count}` : ''
|
|
230
|
+
lines.push(` ${g?.source ?? '?'}${many} โ ${g?.title ?? '(unreadable)'} ยท ${g?.hoursAgo ?? '?'}h`)
|
|
231
|
+
}
|
|
232
|
+
if (groups.length > MAX_ASSIGNED) lines.push(` โฆ and ${groups.length - MAX_ASSIGNED} more groups`)
|
|
233
|
+
lines.push(' This person has a ๐ confidential brain, and this session has not used Agnoclast yet. Filing would use an ordinary brain and lock the session out of the confidential one. Do the user\'s request first: if it uses the confidential brain, these pass to another session; otherwise they are shown again on the next prompt.')
|
|
234
|
+
return lines
|
|
235
|
+
}
|
|
236
|
+
|
|
224
237
|
export function formatNotice(signals) {
|
|
225
238
|
const lines = formatPressing(signals?.pressing)
|
|
226
239
|
const offers = signals?.settling?.offers ?? []
|
|
@@ -236,7 +249,14 @@ export function formatNotice(signals) {
|
|
|
236
249
|
const split = all.some((g) => typeof g?.held === 'boolean')
|
|
237
250
|
const assigned = split ? all.filter((g) => g?.held === true) : all
|
|
238
251
|
const unheld = split ? all.filter((g) => g?.held === false) : []
|
|
239
|
-
if (
|
|
252
|
+
if (all.length && signals?.holdForConfidentialLock === true) {
|
|
253
|
+
// CONFIDENTIAL BRAINS (web/lib/engine/confidential_lock.ts; Theron, 2026-10-28). The person holds a confidential
|
|
254
|
+
// seat and this session has not used Agnoclast yet. Filing an arrival โ inline or by the background filer โ is a
|
|
255
|
+
// use of an ordinary brain and would lock the session OUT of the confidential one before the person's own first
|
|
256
|
+
// request decides. So: name them, and leave them. If the session locks in, the server hands them to another
|
|
257
|
+
// session; if it locks out, the next prompt shows them as usual.
|
|
258
|
+
lines.push(...formatHeldForLock(all))
|
|
259
|
+
} else if (assigned.length) {
|
|
240
260
|
const n = assigned.reduce((t, g) => t + (Number(g?.count) || 1), 0)
|
|
241
261
|
lines.push(`๐ฅ ${n} arrival${n === 1 ? ' is' : 's are'} ASSIGNED TO THIS SESSION โ you are ${n === 1 ? 'its' : 'their'} only owner. Handle ${n === 1 ? 'it' : 'them'} before the user's request, then answer the user:`)
|
|
242
262
|
for (const g of assigned.slice(0, MAX_ASSIGNED)) {
|
|
@@ -247,7 +267,7 @@ export function formatNotice(signals) {
|
|
|
247
267
|
if (assigned.length > MAX_ASSIGNED) lines.push(` โฆ and ${assigned.length - MAX_ASSIGNED} more groups`)
|
|
248
268
|
lines.push(' `intake_claim {intakeItemIds}` โ `intake_materialize` (or `intake_discard` for junk) ยท `not_mine` hands one to the next session ยท only what only the user can decide โ `intake_defer`.')
|
|
249
269
|
}
|
|
250
|
-
if (unheld.length) lines.push(...formatUnheld(unheld, { more: assigned.length > 0, shadow: signals?.routineShadow === true }))
|
|
270
|
+
if (unheld.length && signals?.holdForConfidentialLock !== true) lines.push(...formatUnheld(unheld, { more: assigned.length > 0, shadow: signals?.routineShadow === true }))
|
|
251
271
|
if (delta) {
|
|
252
272
|
lines.push(`โก ${delta} new arrival${delta === 1 ? '' : 's'} in the pile since this session was last told.`)
|
|
253
273
|
}
|
package/lib/editors/claude.mjs
CHANGED
|
@@ -10,20 +10,19 @@ import { markCommand, isManagedSubcommand } from '../managed.mjs'
|
|
|
10
10
|
/** Merge the Agnoclast MCP server into a ~/.claude.json object. Pure + idempotent: sets only OUR
|
|
11
11
|
* entry (type:'stdio'), preserves every other server. `spec` = the package@dist-tag string.
|
|
12
12
|
*
|
|
13
|
-
* โ WHICH KEY:
|
|
13
|
+
* โ WHICH KEY: `agnoclast`, always. ADR-0033 C2 (`migrate-key`) moves `cortex` โ `agnoclast`. This
|
|
14
14
|
* used to write `cortex` unconditionally, so a re-run of setup on a migrated machine RE-CREATED a
|
|
15
15
|
* `cortex` entry beside the `agnoclast` one: two Agnoclast servers, and the new one at whatever tag
|
|
16
16
|
* setup picked โ which is how Theron's machine ended up with `agnoclast`@latest and `cortex`@stable
|
|
17
|
-
* (2026-10-23).
|
|
18
|
-
* `cortex`
|
|
19
|
-
*
|
|
17
|
+
* (2026-10-23). The 10-23 fix kept an existing duplicate as "the person's call"; Theron made that
|
|
18
|
+
* call (2026-10-28): the `cortex` server must not exist. So write `agnoclast` and DELETE `cortex`,
|
|
19
|
+
* on every machine. Safe on a fresh one too: mergeClaudeSettings adds the agnoclast allow rules
|
|
20
|
+
* (MANAGED_ALLOWED_TOOLS) in the same setup run. */
|
|
20
21
|
export function mergeClaudeMcp(existing, spec, token) {
|
|
21
22
|
const cfg = existing && typeof existing === 'object' ? { ...existing } : {}
|
|
22
23
|
cfg.mcpServers = cfg.mcpServers && typeof cfg.mcpServers === 'object' ? { ...cfg.mcpServers } : {}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
cfg.mcpServers[k] = { type: 'stdio', command: 'npx', args: ['-y', spec], env: { CORTEX_TOKEN: token } }
|
|
26
|
-
}
|
|
24
|
+
delete cfg.mcpServers.cortex
|
|
25
|
+
cfg.mcpServers.agnoclast = { type: 'stdio', command: 'npx', args: ['-y', spec], env: { CORTEX_TOKEN: token } }
|
|
27
26
|
return cfg
|
|
28
27
|
}
|
|
29
28
|
|
package/lib/editors/codex.mjs
CHANGED
|
@@ -7,11 +7,11 @@ import { join } from 'node:path'
|
|
|
7
7
|
import { readJson, backupFile, ensureDir, writeJson } from './_fsutil.mjs'
|
|
8
8
|
|
|
9
9
|
/** Merge the Agnoclast MCP server into a Codex config.toml. Pure + idempotent: strips any existing
|
|
10
|
-
* [mcp_servers.
|
|
10
|
+
* [mcp_servers.agnoclast] / [mcp_servers.cortex] tables (+ their .env) (so re-runs update in place rather than
|
|
11
11
|
* duplicating โ a duplicate TOML table would break Codex's parser), preserves every other table,
|
|
12
|
-
* and appends a fresh block. Only touches
|
|
12
|
+
* and appends a fresh `agnoclast` block (the legacy `cortex` one is dropped, 2026-10-28). Only touches those tables; never rewrites the user's config. */
|
|
13
13
|
export function mergeCodexToml(text, spec, token) {
|
|
14
|
-
const targets = new Set(['[mcp_servers.cortex]', '[mcp_servers.cortex.env]'])
|
|
14
|
+
const targets = new Set(['[mcp_servers.agnoclast]', '[mcp_servers.agnoclast.env]', '[mcp_servers.cortex]', '[mcp_servers.cortex.env]'])
|
|
15
15
|
const kept = []
|
|
16
16
|
let skipping = false
|
|
17
17
|
for (const line of (text || '').split('\n')) {
|
|
@@ -22,12 +22,12 @@ export function mergeCodexToml(text, spec, token) {
|
|
|
22
22
|
while (kept.length && kept[kept.length - 1].trim() === '') kept.pop() // drop trailing blanks
|
|
23
23
|
const block = [
|
|
24
24
|
'',
|
|
25
|
-
'[mcp_servers.
|
|
25
|
+
'[mcp_servers.agnoclast]',
|
|
26
26
|
'command = "npx"',
|
|
27
27
|
`args = ["-y", "${spec}"]`,
|
|
28
28
|
'startup_timeout_sec = 60', // first npx fetch can be slow; don't time out the server on cold start
|
|
29
29
|
'',
|
|
30
|
-
'[mcp_servers.
|
|
30
|
+
'[mcp_servers.agnoclast.env]',
|
|
31
31
|
`CORTEX_TOKEN = "${token}"`,
|
|
32
32
|
'',
|
|
33
33
|
]
|
package/lib/editors/cursor.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Editor adapter: Cursor. P0-b task 4 (+ review fixes).
|
|
2
|
-
// ~/.cursor/mcp.json uses the same mcpServers.
|
|
2
|
+
// ~/.cursor/mcp.json uses the same mcpServers.agnoclast shape as Claude (minus the `type` field the real
|
|
3
3
|
// Cursor config omits), so wiring Cursor is a pure JSON merge (mergeCursorMcp).
|
|
4
4
|
import { homedir } from 'node:os'
|
|
5
5
|
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs'
|
|
@@ -7,12 +7,13 @@ import { join } from 'node:path'
|
|
|
7
7
|
import { backupFile } from './_fsutil.mjs'
|
|
8
8
|
|
|
9
9
|
/** Merge the Agnoclast MCP server into a Cursor mcp.json object. Pure + idempotent: sets only the
|
|
10
|
-
* `cortex`
|
|
10
|
+
* `agnoclast` entry (deleting a legacy `cortex` one), preserves every other server. `spec` is the package@dist-tag STRING โ the same
|
|
11
11
|
* convention claude/codex/setup.mjs use, so one install driver can pass a single spec to every adapter. */
|
|
12
12
|
export function mergeCursorMcp(existing, spec, token) {
|
|
13
13
|
const cfg = existing && typeof existing === 'object' ? { ...existing } : {}
|
|
14
14
|
cfg.mcpServers = cfg.mcpServers && typeof cfg.mcpServers === 'object' ? { ...cfg.mcpServers } : {}
|
|
15
|
-
cfg.mcpServers.cortex
|
|
15
|
+
delete cfg.mcpServers.cortex
|
|
16
|
+
cfg.mcpServers.agnoclast = { command: 'npx', args: ['-y', spec], env: { CORTEX_TOKEN: token } }
|
|
16
17
|
return cfg
|
|
17
18
|
}
|
|
18
19
|
|
package/lib/release_gate.mjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// that web/lib/engine/release.test.ts pins to the server's registry.
|
|
6
6
|
|
|
7
7
|
/** Tools any release flag gates โ hidden when the server cannot be asked. Mirror of allGatedTools(). */
|
|
8
|
-
export const GATED_FALLBACK = ['attach_document', 'document_diff', 'export_page', 'find_documents', 'get_document', 'import_document_as_page', 'intake_shadow', 'list_documents', 'my_messages', 'pin_document', 'read_conversation', 'read_document', 'send_message', 'set_manager', 'upload_document_version']
|
|
8
|
+
export const GATED_FALLBACK = ['arrivals', 'attach_document', 'document_diff', 'export_page', 'file_arrival', 'find_documents', 'get_document', 'import_document_as_page', 'intake_shadow', 'list_documents', 'my_messages', 'pin_document', 'read_conversation', 'read_document', 'send_message', 'set_manager', 'upload_document_version']
|
|
9
9
|
|
|
10
10
|
export const RELEASE_FETCH_TIMEOUT_MS = 2500
|
|
11
11
|
|
package/package.json
CHANGED