@danielblomma/cortex-mcp 1.3.1 → 1.3.2
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/package.json +1 -1
- package/scaffold/scripts/doctor.sh +64 -10
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danielblomma/cortex-mcp",
|
|
3
3
|
"mcpName": "io.github.DanielBlomma/cortex",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.2",
|
|
5
5
|
"description": "Local, repo-scoped context platform for coding assistants. Semantic search, graph relationships, and architectural rule context.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": "Daniel Blomma",
|
|
@@ -221,19 +221,59 @@ if [[ -n "$ENTERPRISE_CONFIG" ]]; then
|
|
|
221
221
|
console.log(fields["policy.endpoint"] || "");
|
|
222
222
|
' "$ENTERPRISE_CONFIG" 2>/dev/null || echo "")
|
|
223
223
|
|
|
224
|
+
TELEMETRY_API_KEY=$(node -e '
|
|
225
|
+
const fs = require("node:fs");
|
|
226
|
+
const raw = fs.readFileSync(process.argv[1], "utf8");
|
|
227
|
+
let section = "", fields = {};
|
|
228
|
+
for (const line of raw.split("\n")) {
|
|
229
|
+
const t = line.trimEnd();
|
|
230
|
+
if (!t || t.startsWith("#")) continue;
|
|
231
|
+
const sm = t.match(/^(\w+):\s*$/);
|
|
232
|
+
if (sm) { section = sm[1]; continue; }
|
|
233
|
+
const kv = t.match(/^\s+(\w+):\s*(.+?)\s*$/);
|
|
234
|
+
if (kv && section) fields[section + "." + kv[1]] = kv[2].replace(/^["\x27]|["\x27]$/g, "");
|
|
235
|
+
}
|
|
236
|
+
console.log(fields["telemetry.api_key"] || "");
|
|
237
|
+
' "$ENTERPRISE_CONFIG" 2>/dev/null || echo "")
|
|
238
|
+
|
|
239
|
+
POLICY_API_KEY=$(node -e '
|
|
240
|
+
const fs = require("node:fs");
|
|
241
|
+
const raw = fs.readFileSync(process.argv[1], "utf8");
|
|
242
|
+
let section = "", fields = {};
|
|
243
|
+
for (const line of raw.split("\n")) {
|
|
244
|
+
const t = line.trimEnd();
|
|
245
|
+
if (!t || t.startsWith("#")) continue;
|
|
246
|
+
const sm = t.match(/^(\w+):\s*$/);
|
|
247
|
+
if (sm) { section = sm[1]; continue; }
|
|
248
|
+
const kv = t.match(/^\s+(\w+):\s*(.+?)\s*$/);
|
|
249
|
+
if (kv && section) fields[section + "." + kv[1]] = kv[2].replace(/^["\x27]|["\x27]$/g, "");
|
|
250
|
+
}
|
|
251
|
+
console.log(fields["policy.api_key"] || "");
|
|
252
|
+
' "$ENTERPRISE_CONFIG" 2>/dev/null || echo "")
|
|
253
|
+
|
|
224
254
|
# Telemetry
|
|
225
255
|
if [[ -n "$TELEMETRY_ENDPOINT" ]]; then
|
|
226
256
|
pass "Telemetry: endpoint configured"
|
|
227
|
-
|
|
228
|
-
-H "Content-Type: application/json"
|
|
229
|
-
|
|
230
|
-
|
|
257
|
+
TELEMETRY_CURL_ARGS=(-so /dev/null -w '%{http_code}' --max-time 5 -X POST \
|
|
258
|
+
-H "Content-Type: application/json" -d '{}')
|
|
259
|
+
if [[ -n "$TELEMETRY_API_KEY" ]]; then
|
|
260
|
+
TELEMETRY_CURL_ARGS+=(-H "Authorization: Bearer ${TELEMETRY_API_KEY}")
|
|
261
|
+
fi
|
|
262
|
+
HTTP_CODE=$(curl "${TELEMETRY_CURL_ARGS[@]}" "$TELEMETRY_ENDPOINT" 2>/dev/null | tail -c 3 || echo "000")
|
|
231
263
|
if [[ "$HTTP_CODE" == "000" ]]; then
|
|
232
264
|
fail "Telemetry: endpoint not reachable (timeout/DNS)"
|
|
233
265
|
elif [[ "$HTTP_CODE" =~ ^[23] ]]; then
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
266
|
+
if [[ -n "$TELEMETRY_API_KEY" ]]; then
|
|
267
|
+
pass "Telemetry: endpoint authenticated (HTTP ${HTTP_CODE})"
|
|
268
|
+
else
|
|
269
|
+
pass "Telemetry: endpoint reachable (HTTP ${HTTP_CODE})"
|
|
270
|
+
fi
|
|
271
|
+
elif [[ "$HTTP_CODE" == "401" || "$HTTP_CODE" == "403" ]]; then
|
|
272
|
+
if [[ -n "$TELEMETRY_API_KEY" ]]; then
|
|
273
|
+
fail "Telemetry: auth rejected (HTTP ${HTTP_CODE}) — check telemetry.api_key in enterprise.yaml"
|
|
274
|
+
else
|
|
275
|
+
pass "Telemetry: endpoint reachable (auth required — expected)"
|
|
276
|
+
fi
|
|
237
277
|
else
|
|
238
278
|
warn "Telemetry: endpoint returned HTTP ${HTTP_CODE}"
|
|
239
279
|
fi
|
|
@@ -258,11 +298,25 @@ if [[ -n "$ENTERPRISE_CONFIG" ]]; then
|
|
|
258
298
|
fi
|
|
259
299
|
|
|
260
300
|
if [[ -n "$POLICY_ENDPOINT" ]]; then
|
|
261
|
-
|
|
301
|
+
POLICY_CURL_ARGS=(-so /dev/null -w '%{http_code}' --max-time 5)
|
|
302
|
+
if [[ -n "$POLICY_API_KEY" ]]; then
|
|
303
|
+
POLICY_CURL_ARGS+=(-H "Authorization: Bearer ${POLICY_API_KEY}")
|
|
304
|
+
fi
|
|
305
|
+
POLICY_HTTP=$(curl "${POLICY_CURL_ARGS[@]}" "$POLICY_ENDPOINT" 2>/dev/null | tail -c 3 || echo "000")
|
|
262
306
|
if [[ "$POLICY_HTTP" == "000" ]]; then
|
|
263
307
|
fail "Policy: endpoint not reachable (timeout/DNS)"
|
|
264
|
-
elif [[ "$POLICY_HTTP" =~ ^[23] ]]
|
|
265
|
-
|
|
308
|
+
elif [[ "$POLICY_HTTP" =~ ^[23] ]]; then
|
|
309
|
+
if [[ -n "$POLICY_API_KEY" ]]; then
|
|
310
|
+
pass "Policy: endpoint authenticated (HTTP ${POLICY_HTTP})"
|
|
311
|
+
else
|
|
312
|
+
pass "Policy: endpoint reachable (HTTP ${POLICY_HTTP})"
|
|
313
|
+
fi
|
|
314
|
+
elif [[ "$POLICY_HTTP" == "401" || "$POLICY_HTTP" == "403" ]]; then
|
|
315
|
+
if [[ -n "$POLICY_API_KEY" ]]; then
|
|
316
|
+
fail "Policy: auth rejected (HTTP ${POLICY_HTTP}) — check policy.api_key in enterprise.yaml"
|
|
317
|
+
else
|
|
318
|
+
pass "Policy: endpoint reachable (auth required — expected)"
|
|
319
|
+
fi
|
|
266
320
|
else
|
|
267
321
|
warn "Policy: endpoint returned HTTP ${POLICY_HTTP}"
|
|
268
322
|
fi
|