@theronap/agnoclast-mcp 0.9.276 → 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.
@@ -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: the one already there. ADR-0033 C2 (`migrate-key`) moves `cortex` → `agnoclast`. This
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). Now: update whichever of the two keys exist; only a machine with neither gets
18
- * `cortex` (fresh installs are still pre-C2). Never deletes a key — removing a duplicate is the
19
- * person's call, not a side effect of setup. */
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
- const keys = ['agnoclast', 'cortex'].filter((k) => cfg.mcpServers[k])
24
- for (const k of keys.length ? keys : ['cortex']) {
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
 
@@ -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.cortex] / [mcp_servers.cortex.env] tables (so re-runs update in place rather than
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 the cortex tables; never rewrites the user's config. */
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.cortex]',
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.cortex.env]',
30
+ '[mcp_servers.agnoclast.env]',
31
31
  `CORTEX_TOKEN = "${token}"`,
32
32
  '',
33
33
  ]
@@ -1,5 +1,5 @@
1
1
  // Editor adapter: Cursor. P0-b task 4 (+ review fixes).
2
- // ~/.cursor/mcp.json uses the same mcpServers.cortex shape as Claude (minus the `type` field the real
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` entry, preserves every other server. `spec` is the package@dist-tag STRING — the same
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 = { command: 'npx', args: ['-y', spec], env: { CORTEX_TOKEN: token } }
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
 
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theronap/agnoclast-mcp",
3
- "version": "0.9.276",
3
+ "version": "0.9.277",
4
4
  "description": "Connect your AI assistant to Cortex — your org's projects, activity, gaps, and directives, scoped to you.",
5
5
  "type": "module",
6
6
  "bin": {