@theronap/agnoclast-mcp 0.9.213 → 0.9.214
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/diagnose.mjs +9 -2
- package/lib/doctor.mjs +1 -1
- package/package.json +1 -1
package/lib/diagnose.mjs
CHANGED
|
@@ -679,7 +679,14 @@ export async function fetchCortex(url, opts = {}, policy = {}) {
|
|
|
679
679
|
|
|
680
680
|
// Live health probe: hit /api/mcp-context with the token and classify the result.
|
|
681
681
|
// Returns { ok, status, projectCount?, requestId?, diagnosis? }.
|
|
682
|
-
|
|
682
|
+
//
|
|
683
|
+
// `probe: true` (the SessionStart status line) asks the server for the token check and the capture
|
|
684
|
+
// notice ONLY, not the context. That hook fires at the same moment as `snapshot-context`, which fetches
|
|
685
|
+
// the full context, so without it every session start assembled the context twice, concurrently, on a
|
|
686
|
+
// max:1 pool: a ~1.6 s start measured ~5 s in prod (2026-10-06). doctor/setup/install keep the full
|
|
687
|
+
// fetch on purpose; they exist to prove the context itself comes back. An older server ignores the
|
|
688
|
+
// parameter and returns the full context, which this still parses, so the two can ship in either order.
|
|
689
|
+
export async function checkToken(token, base, { probe = false } = {}) {
|
|
683
690
|
if (!token) {
|
|
684
691
|
return { ok: false, status: 0, diagnosis: { kind: 'config', retriable: false,
|
|
685
692
|
message: 'No CORTEX_TOKEN found. Run: npx -y @theronap/cortex-mcp login (opens your browser; or `setup <token>` with a token from the console → Connect your AI)' } }
|
|
@@ -689,7 +696,7 @@ export async function checkToken(token, base) {
|
|
|
689
696
|
message: `Token "${String(token).slice(0, 8)}…" is not a valid Agnoclast token (expected a UUID). ` +
|
|
690
697
|
`Re-run setup with the token from the console.` } }
|
|
691
698
|
}
|
|
692
|
-
const url = `${(base ?? CANONICAL_BASE).replace(/\/$/, '')}/api/mcp-context`
|
|
699
|
+
const url = `${(base ?? CANONICAL_BASE).replace(/\/$/, '')}/api/mcp-context${probe ? '?probe=1' : ''}`
|
|
693
700
|
let res
|
|
694
701
|
try {
|
|
695
702
|
res = await fetchCortex(url, { headers: { Authorization: `Bearer ${token}` } })
|
package/lib/doctor.mjs
CHANGED
|
@@ -71,7 +71,7 @@ async function statusLine(out, { capturesStuck = false } = {}) {
|
|
|
71
71
|
return
|
|
72
72
|
}
|
|
73
73
|
try {
|
|
74
|
-
const r = await checkToken(token, base)
|
|
74
|
+
const r = await checkToken(token, base, { probe: true })
|
|
75
75
|
if (r.ok) {
|
|
76
76
|
// ⚠ THE NOTICE REPLACES THE HAPPY LINE RATHER THAN FOLLOWING IT.
|
|
77
77
|
// "connected — sessions on this machine are captured to your org" was printed truthfully to
|
package/package.json
CHANGED