@theronap/agnoclast-mcp 0.9.280 → 0.9.282
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/bin/cortex-mcp.mjs +3 -3
- package/lib/capture_status.mjs +1 -1
- package/lib/channel.mjs +1 -1
- package/lib/diagnose.mjs +1 -1
- package/lib/doctor.mjs +3 -3
- package/lib/editors/antigravity.mjs +2 -2
- package/lib/editors/claude.mjs +1 -1
- package/lib/editors/codex.mjs +1 -1
- package/lib/install.mjs +1 -1
- package/lib/migrate_key.mjs +96 -3
- package/lib/publish_targets.mjs +3 -0
- package/lib/rename_notice.mjs +1 -1
- package/lib/server.mjs +14 -1
- package/lib/setup.mjs +4 -4
- package/lib/use_brain.mjs +1 -1
- package/package.json +1 -1
- package/skills/author-docs/SKILL.md +2 -2
- package/skills/log/SKILL.md +2 -2
package/bin/cortex-mcp.mjs
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* --help | -h
|
|
14
14
|
*
|
|
15
15
|
* Zero-install onboarding:
|
|
16
|
-
* npx -y @theronap/
|
|
16
|
+
* npx -y @theronap/agnoclast-mcp setup <your-token>
|
|
17
17
|
*
|
|
18
18
|
* Get your token from the Agnoclast console → Connect your AI.
|
|
19
19
|
*/
|
|
@@ -108,7 +108,7 @@ if (cmd === '--help' || cmd === '-h' || cmd === 'help') {
|
|
|
108
108
|
process.stdout.write(
|
|
109
109
|
`cortex-mcp ${VERSION} — connect your AI assistant to Agnoclast\n\n` +
|
|
110
110
|
`Onboard (one command, no token to copy):\n` +
|
|
111
|
-
` npx -y @theronap/
|
|
111
|
+
` npx -y @theronap/agnoclast-mcp login\n\n` +
|
|
112
112
|
`This opens your browser, you click Approve, and it wires everything up. Restart\n` +
|
|
113
113
|
`Claude Code after, and your AI sees your Agnoclast context while your sessions flow\n` +
|
|
114
114
|
`into the org automatically.\n\n` +
|
|
@@ -331,7 +331,7 @@ if (cmd === 'login') {
|
|
|
331
331
|
// transcripts — see the PreCompact block in lib/editors/claude.mjs for the measurement and control).
|
|
332
332
|
//
|
|
333
333
|
// Why this branch survives the removal: seats installed before this release still have
|
|
334
|
-
// `PreCompact: npx -y @theronap/
|
|
334
|
+
// `PreCompact: npx -y @theronap/agnoclast-mcp@latest precompact` in ~/.claude/settings.json, and @latest
|
|
335
335
|
// resolves to THIS build. Deleting the branch would turn a harmless no-op into an unknown-command
|
|
336
336
|
// error on every compaction for anyone who has not re-run install. mergeClaudeSettings unwires them
|
|
337
337
|
// on their next install/repair; drop this branch a release after that has had time to propagate.
|
package/lib/capture_status.mjs
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* @type {Record<string, (source: string) => string>} */
|
|
22
22
|
const FIX = {
|
|
23
23
|
tool: (source) => `call this tool again with brain=<brain> source="${source}"`,
|
|
24
|
-
cli: (source) => `npx -y @theronap/
|
|
24
|
+
cli: (source) => `npx -y @theronap/agnoclast-mcp use-brain "<brain>" --source ${source}`,
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/** @param {{defaults?: Array, held?: Array, brainCount?: number}} state
|
package/lib/channel.mjs
CHANGED
|
@@ -24,7 +24,7 @@ import { backupFile } from './editors/_fsutil.mjs'
|
|
|
24
24
|
|
|
25
25
|
export const CHANNELS = ['stable', 'latest']
|
|
26
26
|
export const DEFAULT_CHANNEL = 'stable'
|
|
27
|
-
const PKG = '@theronap/
|
|
27
|
+
const PKG = '@theronap/agnoclast-mcp'
|
|
28
28
|
|
|
29
29
|
/** Where the per-machine choice lives. ~/.cortex is the directory this package already owns. */
|
|
30
30
|
export const channelConfigPath = (home = homedir()) => join(home, '.cortex', 'config.json')
|
package/lib/diagnose.mjs
CHANGED
|
@@ -801,7 +801,7 @@ export async function fetchCortex(url, opts = {}, policy = {}) {
|
|
|
801
801
|
export async function checkToken(token, base, { probe = false } = {}) {
|
|
802
802
|
if (!token) {
|
|
803
803
|
return { ok: false, status: 0, diagnosis: { kind: 'config', retriable: false,
|
|
804
|
-
message: 'No CORTEX_TOKEN found. Run: npx -y @theronap/
|
|
804
|
+
message: 'No CORTEX_TOKEN found. Run: npx -y @theronap/agnoclast-mcp login (opens your browser; or `setup <token>` with a token from the console → Connect your AI)' } }
|
|
805
805
|
}
|
|
806
806
|
if (!isUuid(token)) {
|
|
807
807
|
return { ok: false, status: 0, diagnosis: { kind: 'config', retriable: false,
|
package/lib/doctor.mjs
CHANGED
|
@@ -21,7 +21,7 @@ function queueNotice(dir) {
|
|
|
21
21
|
try { return renderQueueNotice(queueStatus(dir ?? queueDir())) } catch { return [] }
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
// `npx @theronap/
|
|
24
|
+
// `npx @theronap/agnoclast-mcp doctor` — a live, one-command health check.
|
|
25
25
|
//
|
|
26
26
|
// This is the "is it ACTUALLY working?" tool that was missing: it reads your token, calls the
|
|
27
27
|
// real Agnoclast API, and prints a clear PASS/FAIL with the actual cause. No Claude Code restart
|
|
@@ -72,7 +72,7 @@ async function statusLine(out, { capturesStuck = false } = {}) {
|
|
|
72
72
|
const base = resolveBase(process.env.CORTEX_URL)
|
|
73
73
|
const { token } = resolveToken()
|
|
74
74
|
if (!token) {
|
|
75
|
-
out('Agnoclast: NOT connected — no token found. Run: npx -y @theronap/
|
|
75
|
+
out('Agnoclast: NOT connected — no token found. Run: npx -y @theronap/agnoclast-mcp login (opens your browser; or `setup <token>` with a token from the console → Connect your AI)')
|
|
76
76
|
return
|
|
77
77
|
}
|
|
78
78
|
try {
|
|
@@ -109,7 +109,7 @@ async function statusLine(out, { capturesStuck = false } = {}) {
|
|
|
109
109
|
const notice = renderRenameNotice(resolveToken().key)
|
|
110
110
|
if (notice) out(notice)
|
|
111
111
|
} else {
|
|
112
|
-
out(`Agnoclast: NOT connected — ${r.diagnosis?.message ?? 'check failed'}. Run: npx -y @theronap/
|
|
112
|
+
out(`Agnoclast: NOT connected — ${r.diagnosis?.message ?? 'check failed'}. Run: npx -y @theronap/agnoclast-mcp doctor`)
|
|
113
113
|
}
|
|
114
114
|
} catch (e) {
|
|
115
115
|
out(`Agnoclast: status check failed (${e?.message ?? String(e)}) — run doctor.`)
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// ($HOME/dev/cortex/packages/cortex-agent via `bun run src/index.ts antigravity-sync`). A coworker
|
|
10
10
|
// has no ~/dev/cortex, so Antigravity capture is bespoke to the author's machine and is NOT yet
|
|
11
11
|
// installable for a real seat. Making it portable requires a published `antigravity-sync` entrypoint
|
|
12
|
-
// (npx @theronap/
|
|
12
|
+
// (npx @theronap/agnoclast-mcp antigravity-sync, or a published cortex-agent) — a prerequisite this
|
|
13
13
|
// adapter cannot satisfy alone. Until then wire() writes the artifacts + returns a blocking warning.
|
|
14
14
|
import { homedir } from 'node:os'
|
|
15
15
|
import { writeFileSync, existsSync, mkdirSync, chmodSync } from 'node:fs'
|
|
@@ -76,7 +76,7 @@ if [ ! -d "$AGENT_DIR" ]; then echo "$(stamp) agent dir missing: $AGENT_DIR" >>
|
|
|
76
76
|
# secret out of this shell entirely: it goes from the resolver straight into the child environment.
|
|
77
77
|
# Exit 3 means "nothing wired", which is a skip rather than a failure.
|
|
78
78
|
cd "$AGENT_DIR" || exit 0
|
|
79
|
-
CORTEX_WATCH="$HOME/.cortex-agent" "$NPX" -y @theronap/
|
|
79
|
+
CORTEX_WATCH="$HOME/.cortex-agent" "$NPX" -y @theronap/agnoclast-mcp@stable with-token -- \
|
|
80
80
|
"$BUN" run src/index.ts antigravity-sync >> "$LOG" 2>&1
|
|
81
81
|
CODE=$?
|
|
82
82
|
if [ "$CODE" = "3" ]; then echo "$(stamp) no token wired, skipping" >> "$LOG"; exit 0; fi
|
package/lib/editors/claude.mjs
CHANGED
|
@@ -280,7 +280,7 @@ export function mergeClaudeSettings(existing, spec) {
|
|
|
280
280
|
// it, which is why this runs unconditionally instead of shipping as a separate migration.
|
|
281
281
|
if (Array.isArray(s.hooks.PreCompact)) {
|
|
282
282
|
for (const pg of s.hooks.PreCompact) {
|
|
283
|
-
if (Array.isArray(pg.hooks)) pg.hooks = pg.hooks.filter((h) => !/cortex-mcp(@[^ ]*)? precompact/.test(h.command ?? ''))
|
|
283
|
+
if (Array.isArray(pg.hooks)) pg.hooks = pg.hooks.filter((h) => !/(?:cortex|agnoclast)-mcp(@[^ ]*)? precompact/.test(h.command ?? ''))
|
|
284
284
|
}
|
|
285
285
|
// Drop groups we just emptied, then the key itself if no foreign hook remains — a bare
|
|
286
286
|
// `PreCompact: []` reads as "cortex wires this event" to the next person to open settings.json.
|
package/lib/editors/codex.mjs
CHANGED
|
@@ -44,7 +44,7 @@ export function mergeCodexHooks(existing, captureCmd) {
|
|
|
44
44
|
h.hooks.Stop = Array.isArray(h.hooks.Stop) ? h.hooks.Stop : []
|
|
45
45
|
for (const grp of h.hooks.Stop) {
|
|
46
46
|
if (Array.isArray(grp.hooks)) {
|
|
47
|
-
grp.hooks = grp.hooks.filter((c) => !/cortex-mcp.*capture|capture-session-cloud/.test(c.command ?? ''))
|
|
47
|
+
grp.hooks = grp.hooks.filter((c) => !/(?:cortex|agnoclast)-mcp.*capture|capture-session-cloud/.test(c.command ?? ''))
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
let grp = h.hooks.Stop.find((g) => (g.matcher ?? '') === '')
|
package/lib/install.mjs
CHANGED
|
@@ -77,7 +77,7 @@ export async function runInstall(argv, version) {
|
|
|
77
77
|
|
|
78
78
|
if (!token) {
|
|
79
79
|
process.stderr.write(
|
|
80
|
-
'Usage: npx @theronap/
|
|
80
|
+
'Usage: npx @theronap/agnoclast-mcp install [<CORTEX_TOKEN>] [--editor auto|all|<id,...>]\n\n' +
|
|
81
81
|
'No token was given and none is already wired.\n' +
|
|
82
82
|
'Get your token from the Agnoclast console → Connect your AI.\n',
|
|
83
83
|
)
|
package/lib/migrate_key.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { homedir } from 'node:os'
|
|
2
|
-
import { existsSync, readFileSync, writeFileSync } from 'node:fs'
|
|
2
|
+
import { existsSync, readFileSync, writeFileSync, readdirSync } from 'node:fs'
|
|
3
3
|
import { join } from 'node:path'
|
|
4
4
|
import { readJson, backupFile, ensureDir, writeJson } from './editors/_fsutil.mjs'
|
|
5
5
|
import { allowedToolsFor } from './editors/claude.mjs'
|
|
@@ -195,6 +195,96 @@ export function migrateOtherEditors({ home = homedir() } = {}) {
|
|
|
195
195
|
return changed
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
+
// ── The package name (ADR-0102). ─────────────────────────────────────────────────────────────
|
|
199
|
+
// `@theronap/cortex-mcp` is retired: 0.9.282 is its last release. Every command this package wrote
|
|
200
|
+
// onto a machine names it, so the build that runs on that machine rewrites them to the new name.
|
|
201
|
+
// Both names were the same build, so a rewritten command behaves identically. Only the package
|
|
202
|
+
// string changes; tags, versions and the managed marker are untouched.
|
|
203
|
+
export const OLD_PKG = '@theronap/cortex-mcp'
|
|
204
|
+
export const NEW_PKG = '@theronap/agnoclast-mcp'
|
|
205
|
+
const OLD_PKG_RE = /@theronap\/cortex-mcp(?![\w-])/g
|
|
206
|
+
|
|
207
|
+
/** PURE. The string with the old package name swapped; the same string when there is none. */
|
|
208
|
+
export const renamePkg = (str) => (typeof str === 'string' ? str.replace(OLD_PKG_RE, NEW_PKG) : str)
|
|
209
|
+
|
|
210
|
+
/** PURE. An mcpServers object with every entry's command/args renamed. Returns { servers, changed }. */
|
|
211
|
+
export function renamedServerPkgs(servers) {
|
|
212
|
+
let changed = false
|
|
213
|
+
const out = { ...(servers ?? {}) }
|
|
214
|
+
for (const [k, v] of Object.entries(out)) {
|
|
215
|
+
if (!v || typeof v !== 'object') continue
|
|
216
|
+
const args = Array.isArray(v.args) ? v.args.map(renamePkg) : v.args
|
|
217
|
+
const command = renamePkg(v.command)
|
|
218
|
+
if (command !== v.command || (Array.isArray(v.args) && args.some((a, i) => a !== v.args[i]))) {
|
|
219
|
+
out[k] = { ...v, command, args }
|
|
220
|
+
changed = true
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return { servers: out, changed }
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/** PURE. settings.json with hook and statusLine commands renamed. Allow rules that name the old
|
|
227
|
+
* package get a renamed twin ADDED (never replaced): a skill still on the old text keeps working. */
|
|
228
|
+
export function renamedSettingsPkgs(settings) {
|
|
229
|
+
if (!settings || typeof settings !== 'object') return { settings, changed: false }
|
|
230
|
+
let changed = false
|
|
231
|
+
const s = JSON.parse(JSON.stringify(settings))
|
|
232
|
+
for (const groups of Object.values(s.hooks ?? {})) {
|
|
233
|
+
if (!Array.isArray(groups)) continue
|
|
234
|
+
for (const g of groups) for (const h of g?.hooks ?? []) {
|
|
235
|
+
const next = renamePkg(h.command)
|
|
236
|
+
if (next !== h.command) { h.command = next; changed = true }
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
if (s.statusLine?.command) {
|
|
240
|
+
const next = renamePkg(s.statusLine.command)
|
|
241
|
+
if (next !== s.statusLine.command) { s.statusLine.command = next; changed = true }
|
|
242
|
+
}
|
|
243
|
+
const allow = s.permissions?.allow
|
|
244
|
+
if (Array.isArray(allow)) {
|
|
245
|
+
for (const rule of [...allow]) {
|
|
246
|
+
const twin = renamePkg(rule)
|
|
247
|
+
if (twin !== rule && !allow.includes(twin)) { allow.push(twin); changed = true }
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return { settings: s, changed }
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/** Rewrite every command this package wrote that still names the old package. Best-effort per file;
|
|
254
|
+
* a malformed file is left alone. Returns the files changed. Crontab is deliberately NOT edited:
|
|
255
|
+
* writing it can raise a macOS permission prompt, and nothing current writes cron lines — legacy ones
|
|
256
|
+
* keep working on the frozen 0.9.282. */
|
|
257
|
+
export function migratePackageName({ home = homedir() } = {}) {
|
|
258
|
+
const changed = []
|
|
259
|
+
const jsonFile = (path, fn) => {
|
|
260
|
+
try {
|
|
261
|
+
if (!existsSync(path)) return
|
|
262
|
+
const before = readJson(path)
|
|
263
|
+
const after = fn(before)
|
|
264
|
+
if (after) { backupFile(path); writeJson(path, after); changed.push(path) }
|
|
265
|
+
} catch { /* leave it */ }
|
|
266
|
+
}
|
|
267
|
+
const textFile = (path) => {
|
|
268
|
+
try {
|
|
269
|
+
if (!existsSync(path)) return
|
|
270
|
+
const before = readFileSync(path, 'utf8')
|
|
271
|
+
const after = renamePkg(before)
|
|
272
|
+
if (after !== before) { backupFile(path); writeFileSync(path, after); changed.push(path) }
|
|
273
|
+
} catch { /* leave it */ }
|
|
274
|
+
}
|
|
275
|
+
const servers = (cfg) => { const r = renamedServerPkgs(cfg?.mcpServers); return r.changed ? { ...cfg, mcpServers: r.servers } : null }
|
|
276
|
+
jsonFile(join(home, '.claude.json'), servers)
|
|
277
|
+
jsonFile(join(home, '.cursor', 'mcp.json'), servers)
|
|
278
|
+
jsonFile(join(home, '.claude', 'settings.json'), (s) => { const r = renamedSettingsPkgs(s); return r.changed ? r.settings : null })
|
|
279
|
+
textFile(join(home, '.codex', 'config.toml'))
|
|
280
|
+
textFile(join(home, '.codex', 'hooks.json'))
|
|
281
|
+
// Generated scripts and their launchd jobs (frozen at write time — this is what repairs them).
|
|
282
|
+
const listDir = (dir, keep) => { try { return readdirSync(dir).filter(keep).map((f) => join(dir, f)) } catch { return [] } }
|
|
283
|
+
for (const f of listDir(join(home, '.cortex'), (f) => f.endsWith('.sh'))) textFile(f)
|
|
284
|
+
for (const f of listDir(join(home, 'Library', 'LaunchAgents'), (f) => /^com\.(cortex|agnoclast)\..*\.plist$/.test(f))) textFile(f)
|
|
285
|
+
return changed
|
|
286
|
+
}
|
|
287
|
+
|
|
198
288
|
/** Run at every MCP server start (bin/cortex-mcp.mjs default branch) — the C2 activation that was
|
|
199
289
|
* planned in ADR-0033 and never wired, so seats that were told "it will happen for you" kept the
|
|
200
290
|
* `cortex` key for months. NEVER throws and NEVER writes stdout: stdout is the MCP stdio channel.
|
|
@@ -206,8 +296,11 @@ export function autoMigrateKeys({ home = homedir(), log = (m) => process.stderr.
|
|
|
206
296
|
if (res.status === 'migrated' || others.length) {
|
|
207
297
|
log(`agnoclast: renamed the \`${OLD_KEY}\` MCP entry to \`${NEW_KEY}\` (${[res.status === 'migrated' ? 'claude' : null, ...others].filter(Boolean).join(', ')}); takes effect next restart`)
|
|
208
298
|
}
|
|
209
|
-
|
|
299
|
+
// After the key flip, so the entry it renames is the one that survived.
|
|
300
|
+
const pkgFiles = migratePackageName({ home })
|
|
301
|
+
if (pkgFiles.length) log(`agnoclast: switched ${pkgFiles.length} file(s) from ${OLD_PKG} to ${NEW_PKG}; takes effect next restart`)
|
|
302
|
+
return { claude: res, others, pkgFiles }
|
|
210
303
|
} catch (e) {
|
|
211
|
-
return { claude: { status: 'aborted', step: 'unexpected', reason: e?.message }, others: [] }
|
|
304
|
+
return { claude: { status: 'aborted', step: 'unexpected', reason: e?.message }, others: [], pkgFiles: [] }
|
|
212
305
|
}
|
|
213
306
|
}
|
package/lib/publish_targets.mjs
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
// The names this package is published under, and how to derive each variant's package.json.
|
|
2
2
|
//
|
|
3
|
+
// ⚠ SUPERSEDED by ADR-0102 (2026-10-29): `cortex-mcp` is retired after 0.9.282, its last dual release,
|
|
4
|
+
// which rewrites every machine to the new name on start. The rest of this note is the ADR-0033 §3 history.
|
|
5
|
+
//
|
|
3
6
|
// ADR-0033 §3. Phase B publishes the SAME build under two names: `@theronap/agnoclast-mcp` going
|
|
4
7
|
// forward, and `@theronap/cortex-mcp` in perpetuity, because the old name is hardcoded in hook
|
|
5
8
|
// command strings and in generated launchd/cron scripts on machines we cannot reach. Generated
|
package/lib/rename_notice.mjs
CHANGED
|
@@ -27,5 +27,5 @@ export function renderRenameNotice(key, { active = RENAME_NOTICE_ACTIVE } = {})
|
|
|
27
27
|
if (key !== OLD_KEY) return null // already flipped, or nothing wired — nothing to warn about
|
|
28
28
|
return `Agnoclast: heads up — the MCP tools are being renamed from mcp__${OLD_KEY}__* to `
|
|
29
29
|
+ `mcp__${NEW_KEY}__*. If your CLAUDE.md names the old tools, update it when convenient. `
|
|
30
|
-
+ `Run \`npx -y @theronap/
|
|
30
|
+
+ `Run \`npx -y @theronap/agnoclast-mcp migrate-key\` to switch now, or wait and it will happen for you.`
|
|
31
31
|
}
|
package/lib/server.mjs
CHANGED
|
@@ -492,6 +492,13 @@ export async function runServer(version) {
|
|
|
492
492
|
const takesArgs = !!config?.inputSchema
|
|
493
493
|
const handle = registerTool(name, config, (...args) => runWithTool(name, async () => {
|
|
494
494
|
// A tool naming a confidential brain opens it first (the first-touch lock, above).
|
|
495
|
+
// Any call waits for a late lookup: a call naming a brain needs the list, and every call needs the AI-account
|
|
496
|
+
// header and, for a dedicated account, the brain already opened.
|
|
497
|
+
if (!confidentialSettled) await Promise.race([confidentialP, new Promise((r) => setTimeout(r, 20000).unref())])
|
|
498
|
+
if (confidential.dedicatedTo && !lockedInto) {
|
|
499
|
+
const refused = await openConfidential(confidential.dedicatedTo)
|
|
500
|
+
if (refused) return { content: [{ type: 'text', text: refused }], isError: true }
|
|
501
|
+
}
|
|
495
502
|
const named = confidential.brains.length && takesArgs ? confidentialBrainNamed(confidential.brains, args[0]?.brain) : null
|
|
496
503
|
if (named) {
|
|
497
504
|
const refused = await openConfidential(named.name)
|
|
@@ -8019,7 +8026,13 @@ function renderNudge(payload) {
|
|
|
8019
8026
|
|
|
8020
8027
|
applyRelease(toolHandles, await releaseStateWithin(releaseP))
|
|
8021
8028
|
lockedTools = applyLock(toolHandles, await lockStateWithin(lockP))
|
|
8022
|
-
|
|
8029
|
+
// Bounded so a slow lookup never holds up the handshake — but a lookup that is merely LATE still lands: until it
|
|
8030
|
+
// does, a tool naming a brain waits for it (the wrapper), so a cold start cannot make the confidential brains
|
|
8031
|
+
// look absent and send a request for one on the person's own token, which would lock the session OUT.
|
|
8032
|
+
// (Live 2026-10-29: a cold npx start missed the 5 s window, and the session locked out instead of in.)
|
|
8033
|
+
let confidentialSettled = false
|
|
8034
|
+
confidentialP.then((v) => { confidential = v; confidentialSettled = true })
|
|
8035
|
+
confidential = await Promise.race([confidentialP, new Promise((r) => setTimeout(() => r(confidential), 5000).unref())])
|
|
8023
8036
|
if (confidential.dedicatedTo) {
|
|
8024
8037
|
// An AI account dedicated to a confidential brain opens it before any tool runs. If it cannot, it reaches
|
|
8025
8038
|
// nothing: the server refuses its ordinary token too.
|
package/lib/setup.mjs
CHANGED
|
@@ -17,7 +17,7 @@ import { mergeCodexToml, mergeCodexHooks } from './editors/codex.mjs'
|
|
|
17
17
|
// merges into existing structures (never clobbers other MCP servers / hooks),
|
|
18
18
|
// and is idempotent (re-running just updates the cortex entries in place).
|
|
19
19
|
|
|
20
|
-
const PKG = '@theronap/
|
|
20
|
+
const PKG = '@theronap/agnoclast-mcp'
|
|
21
21
|
|
|
22
22
|
// mergeCodexToml / mergeCodexHooks moved to ./editors/codex.mjs (imported above, re-exported below).
|
|
23
23
|
|
|
@@ -72,7 +72,7 @@ export async function runSetup(argv, version) {
|
|
|
72
72
|
// frozen `@x.y.z` freezes the machine on that version forever (the 0.9.5→0.9.6 freeze that stranded a
|
|
73
73
|
// pilot install). A tag is re-resolved by npx against the registry, so machines pick up promoted
|
|
74
74
|
// releases on next launch without re-running setup. Promote a validated build with:
|
|
75
|
-
// npm dist-tag add @theronap/
|
|
75
|
+
// npm dist-tag add @theronap/agnoclast-mcp@<version> stable
|
|
76
76
|
// PRESERVE an intentional @latest (dogfood) pin across re-runs (repair/setup) — otherwise this
|
|
77
77
|
// silently knocks a dogfooder back to @stable. Fresh installs and existing @stable get @stable.
|
|
78
78
|
// The machine's RECORDED channel (`cortex-mcp channel latest`, ~/.cortex/config.json) outranks the
|
|
@@ -222,7 +222,7 @@ export async function runSetup(argv, version) {
|
|
|
222
222
|
log('')
|
|
223
223
|
log('⟳ IMPORTANT: fully quit and reopen Claude Code to load the Agnoclast server.')
|
|
224
224
|
log(' Then your AI sees your Agnoclast context and your sessions flow into the org.')
|
|
225
|
-
log(' Re-check anytime: npx -y @theronap/
|
|
225
|
+
log(' Re-check anytime: npx -y @theronap/agnoclast-mcp doctor')
|
|
226
226
|
log(` Console: ${base}`)
|
|
227
227
|
log('')
|
|
228
228
|
}
|
|
@@ -243,7 +243,7 @@ export async function runRepair(version) {
|
|
|
243
243
|
if (!token) {
|
|
244
244
|
process.stderr.write(
|
|
245
245
|
'No existing Agnoclast token found in ~/.claude.json or ~/.codex/config.toml.\n' +
|
|
246
|
-
'Run setup once with your token: npx -y @theronap/
|
|
246
|
+
'Run setup once with your token: npx -y @theronap/agnoclast-mcp setup <YOUR_TOKEN>\n',
|
|
247
247
|
)
|
|
248
248
|
process.exit(1)
|
|
249
249
|
}
|
package/lib/use_brain.mjs
CHANGED
|
@@ -45,7 +45,7 @@ export async function runUseBrain(args) {
|
|
|
45
45
|
const base = resolveBase(process.env.CORTEX_URL)
|
|
46
46
|
const { token } = resolveToken()
|
|
47
47
|
if (!token) {
|
|
48
|
-
out('Agnoclast: no token found. Run: npx -y @theronap/
|
|
48
|
+
out('Agnoclast: no token found. Run: npx -y @theronap/agnoclast-mcp login (opens your browser; or `setup <token>` with a token from the console → Connect your AI)')
|
|
49
49
|
return 1
|
|
50
50
|
}
|
|
51
51
|
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@ the doc and author a synthesis. Never dump raw markdown into a page.
|
|
|
21
21
|
|
|
22
22
|
## Steps
|
|
23
23
|
|
|
24
|
-
1. **Detect:** run `npx -y @theronap/
|
|
24
|
+
1. **Detect:** run `npx -y @theronap/agnoclast-mcp docs-scan --json`. If `pending` is empty, stop —
|
|
25
25
|
report nothing. (If no roots are registered and you just wrote docs somewhere, suggest
|
|
26
26
|
`docs-scan --add-root <dir>` to the user once; don't nag.)
|
|
27
27
|
2. **Triage each pending doc into exactly ONE of three dispositions.** Every pending doc gets one —
|
|
@@ -55,7 +55,7 @@ the doc and author a synthesis. Never dump raw markdown into a page.
|
|
|
55
55
|
page just to add a link back to a doc. Fan-in is queryable (`grep "[[hub]]"` = backlinks;
|
|
56
56
|
`read_page history:true` = the node's event ledger) — hub pages stay curated prose, and a doc
|
|
57
57
|
belongs on the hub only when a human-judged synthesis mentions it.
|
|
58
|
-
3. **Mark:** run `npx -y @theronap/
|
|
58
|
+
3. **Mark:** run `npx -y @theronap/agnoclast-mcp docs-scan --mark <path>` for every doc you AUTHORED or
|
|
59
59
|
judged ABSORBED. Never mark a doc whose `author` failed — it must stay pending for the next sweep.
|
|
60
60
|
4. **Verify before reporting.** For each doc you claim you authored, confirm the write actually landed
|
|
61
61
|
(`read_page` or `page_history`) — an `author` that returns "no change" when you intended an update
|
package/skills/log/SKILL.md
CHANGED
|
@@ -67,7 +67,7 @@ No arguments. Read the conversation context.
|
|
|
67
67
|
answers `NOT LOGGED — STAGED…` or `NOT LOGGED — the server skipped…` when no record was written; only a
|
|
68
68
|
message carrying a record id means it landed. (It previously printed "Logged … updated existing" for a
|
|
69
69
|
staged write, because `inserted` is merely falsy when nothing is recorded — an agent reported a session
|
|
70
|
-
as saved when it was not.) If it errors, tell the user to run `npx -y @theronap/
|
|
70
|
+
as saved when it was not.) If it errors, tell the user to run `npx -y @theronap/agnoclast-mcp doctor`.
|
|
71
71
|
|
|
72
72
|
If any record from this session should be confidential, prefer passing `privacy: "confidential"` on the
|
|
73
73
|
`log_session` call itself so it is tiered **at write time** rather than landing org-visible and being
|
|
@@ -82,7 +82,7 @@ No arguments. Read the conversation context.
|
|
|
82
82
|
nodes). This is a synthesis, not a transcript dump. Skip nodes you didn't actually advance. If you
|
|
83
83
|
already authored a node mid-session and nothing changed since, `author` will report "no change" —
|
|
84
84
|
that's fine.
|
|
85
|
-
7. **Sweep pending documentation** — run `npx -y @theronap/
|
|
85
|
+
7. **Sweep pending documentation** — run `npx -y @theronap/agnoclast-mcp docs-scan --json`; if any
|
|
86
86
|
docs are pending, follow the `agnoclast-author-docs` skill (author each into its page, then
|
|
87
87
|
`docs-scan --mark`). Specs/plans written to disk this session must not die on disk — a spec IS
|
|
88
88
|
a page. If no roots are registered or nothing is pending, skip silently.
|