auxilo-mcp 0.9.24 → 0.9.25

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/mcp-server.js CHANGED
@@ -198,7 +198,7 @@ async function postBulkChunks(headers, decisions) {
198
198
  }
199
199
 
200
200
  const server = new Server(
201
- { name: 'auxilo', version: '0.9.24' },
201
+ { name: 'auxilo', version: '0.9.25' },
202
202
  {
203
203
  capabilities: { tools: {} },
204
204
  instructions: `You are connected to Auxilo, a knowledge marketplace where AI agents buy and sell operational learnings.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auxilo-mcp",
3
- "version": "0.9.24",
3
+ "version": "0.9.25",
4
4
  "mcpName": "io.github.silent-architects/auxilo",
5
5
  "description": "MCP server for Auxilo. Your agent stops solving the same problem twice: auto-extracted learnings, free self-unlocks, and earnings when other agents unlock yours.",
6
6
  "main": "mcp-server.js",
@@ -218,8 +218,9 @@ const SCRUBBED_CLIENT_ENV_VARS = Object.freeze([
218
218
  // of the identical contents. 0.9.15 (EXTRACTION-CHILD-HOOKS) appends
219
219
  // SETTING_SOURCES_ARGS to both — the child loads none of user/project/local
220
220
  // settings, so the operator's own SessionStart hooks never fire.
221
- const EXTRACT_MODE_ARGV = Object.freeze(['-p', '--no-session-persistence', '--tools', '', ...SETTING_SOURCES_ARGS]);
222
- const JUDGE_MODE_ARGV = Object.freeze(['-p', '--output-format', 'json', '--no-session-persistence', '--tools', '', ...SETTING_SOURCES_ARGS]);
221
+ // Strict mode with no --mcp-config also excludes account-connected MCP servers.
222
+ const EXTRACT_MODE_ARGV = Object.freeze(['-p', '--no-session-persistence', '--tools', '', ...SETTING_SOURCES_ARGS, '--strict-mcp-config']);
223
+ const JUDGE_MODE_ARGV = Object.freeze(['-p', '--output-format', 'json', '--no-session-persistence', '--tools', '', ...SETTING_SOURCES_ARGS, '--strict-mcp-config']);
223
224
 
224
225
  /**
225
226
  * Build the subscription-auth-only environment shared by BOTH the extraction and
@@ -228,9 +229,23 @@ const JUDGE_MODE_ARGV = Object.freeze(['-p', '--output-format', 'json', '--no-se
228
229
  function claudeChildEnv() {
229
230
  const childEnv = { ...process.env, AUXILO_EXTRACTING: '1' };
230
231
  for (const key of SCRUBBED_CLIENT_ENV_VARS) delete childEnv[key];
232
+ childEnv.ENABLE_CLAUDEAI_MCP_SERVERS = 'false';
231
233
  return childEnv;
232
234
  }
233
235
 
236
+ // A managed-config refusal is observed after spawn. Keep it out of the
237
+ // pre-spawn skip and provider-fallback sets; never expose the CLI's message.
238
+ function enterpriseMcpRefusal(res, authStatus) {
239
+ if (!Number.isInteger(res.status) || res.status === 0) return null;
240
+ const phrase = 'You cannot use --strict-mcp-config when an enterprise MCP config is present';
241
+ if (![res.stdout, res.stderr].some(value => String(value || '').includes(phrase))) return null;
242
+ return {
243
+ ok: false, text: '', usage: null,
244
+ reason: 'Claude Code refused MCP isolation with managed configuration',
245
+ reasonCode: 'isolation-unverified', authStatus,
246
+ };
247
+ }
248
+
234
249
  // ─── Billing-helper detector ────────────────────────────────────────────────
235
250
  //
236
251
  // NOT scrubbable via env: settings.json `apiKeyHelper`, `awsAuthRefresh`,
@@ -489,6 +504,8 @@ function runExtractMode(opts) {
489
504
  if (res.error) {
490
505
  return { ok: false, text: '', usage: null, reason: `spawn failed (${bin}): ${res.error.message}`, reasonCode: 'unknown', authStatus, argv, cliVersion };
491
506
  }
507
+ const mcpRefusal = enterpriseMcpRefusal(res, authStatus);
508
+ if (mcpRefusal) return { ...mcpRefusal, argv, cliVersion };
492
509
  // Claude prints auth failures ("API Error: 401 ... Please run /login") to stdout.
493
510
  if (/Please run \/login|authentication_error|401/i.test(out) || /Please run \/login|authentication_error/i.test(String(res.stderr || ''))) {
494
511
  return {
@@ -570,6 +587,8 @@ function runJudgeMode(opts) {
570
587
  if (res.error) {
571
588
  return { ok: false, text: '', usage: null, reason: `judge spawn failed (${bin}): ${res.error.message}`, reasonCode: 'unknown', authStatus: 'unknown', argv, cliVersion };
572
589
  }
590
+ const mcpRefusal = enterpriseMcpRefusal(res, 'unknown');
591
+ if (mcpRefusal) return { ...mcpRefusal, argv, cliVersion };
573
592
  if (/Please run \/login|authentication_error|401/i.test(stdout) || /Please run \/login|authentication_error/i.test(String(res.stderr || ''))) {
574
593
  return { ok: false, text: '', usage: null, reason: 'local judge model is not authenticated', reasonCode: 'cli-unauthenticated', authStatus: 'unknown', argv, cliVersion };
575
594
  }
@@ -589,7 +608,18 @@ function runJudgeMode(opts) {
589
608
  try {
590
609
  wrapper = JSON.parse(stdout);
591
610
  } catch {
592
- return { ok: false, text: '', usage: null, reason: 'local judge returned malformed JSON wrapper', reasonCode: 'model-error', authStatus: 'unknown', argv, cliVersion };
611
+ // Some CLI builds append a non-JSON MCP SDK diagnostic to stdout. Recover
612
+ // only a single result value; an extra JSON value of ANY type is ambiguous.
613
+ const values = [];
614
+ for (const rawLine of stdout.split('\n')) {
615
+ const line = rawLine.trim();
616
+ if (!line) continue;
617
+ try { values.push(JSON.parse(line)); } catch { /* discard non-JSON noise */ }
618
+ }
619
+ if (values.length !== 1 || !values[0] || typeof values[0] !== 'object' || values[0].type !== 'result') {
620
+ return { ok: false, text: '', usage: null, reason: 'local judge returned malformed JSON wrapper', reasonCode: 'model-error', authStatus: 'unknown', argv, cliVersion };
621
+ }
622
+ [wrapper] = values;
593
623
  }
594
624
  if (!wrapper || typeof wrapper.result !== 'string' || wrapper.is_error === true) {
595
625
  return { ok: false, text: '', usage: null, reason: 'local judge returned no successful result', reasonCode: 'model-error', authStatus: 'unknown', argv, cliVersion };
@@ -380,6 +380,13 @@ function invoke(opts, mode) {
380
380
  const stdout = String(res.stdout || '');
381
381
  const stderr = String(res.stderr || '');
382
382
  const events = parseJsonlEvents(stdout);
383
+ if (eventAuthMessages(events).some(message => message.includes('invalid_json_schema'))) {
384
+ return {
385
+ ok: false, text: '', usage: null,
386
+ reason: 'codex rejected the output schema (invalid_json_schema)',
387
+ reasonCode: 'output-schema-rejected', authStatus: 'unknown',
388
+ };
389
+ }
383
390
  if (AUTH_FAILURE_RE.test(stderr) || eventAuthMessages(events).some((message) => AUTH_FAILURE_RE.test(message))) {
384
391
  return { ok: false, text: '', usage: null, reason: 'codex CLI reported it is not authenticated', reasonCode: 'cli-unauthenticated', authStatus: 'unknown' };
385
392
  }
@@ -61,7 +61,7 @@
61
61
  * are not required to estimate on the caller's behalf.
62
62
  * @property {string} [reasonCode] - Machine-matchable failure/skip classifier
63
63
  * (e.g. 'cli-unauthenticated', 'cli-billing-helper-configured', 'model-error',
64
- * 'isolation-precondition', 'isolation-unverified', 'isolation-violation',
64
+ * 'isolation-precondition', 'isolation-unverified', 'isolation-violation', 'output-schema-rejected',
65
65
  * 'unknown'). Present on both success and failure paths where applicable.
66
66
  * @property {string|null} [reason] - Human-readable reason, present when !ok.
67
67
  * @property {string} [authStatus] - 'logged-in' | 'logged-out' | 'unknown', when
@@ -1,42 +1,53 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$comment": "EXTRACT-PER-CLIENT W1 PART B passed to `codex exec --output-schema` for mode:'extract'. Mirrors scripts/extract-local.js's parseExtractionOutput (line 252) and normalizeLearningArray (line 208, title>=10 chars / body>=50 chars gate at the filter on line ~211-212) exactly as they exist at this wave's base. A bare array of the same learning shape is ALSO accepted by the parser (parseExtractionOutput's Array.isArray(value) branch) — hence the oneOf. This file is a HINT to codex, not the parser: extract-local.js's extractJsonValue + parseExtractionOutput remain the actual source of truth and are model-agnostic already. Keep this file in sync if that shape ever changes; a schema/parser drift fails soft (codex ignores an unmet hint, parseExtractionOutput still runs) rather than throwing.",
4
- "oneOf": [
5
- { "type": "array", "items": { "$ref": "#/definitions/learning" } },
6
- {
7
- "type": "object",
8
- "properties": {
9
- "learnings": { "type": "array", "items": { "$ref": "#/definitions/learning" } },
10
- "dedup_drops": { "type": "array", "items": {} }
11
- },
12
- "required": ["learnings"]
3
+ "$comment": "CODEX-OUTPUT-SCHEMA-REJECTED strict output transport for codex exec. The API validates this schema before generation. parseExtractionOutput and normalizeLearningArray remain authoritative for length, scope, quality and normalization; legacy bare arrays remain accepted by the parser only.",
4
+ "type": "object",
5
+ "properties": {
6
+ "learnings": { "type": "array", "items": { "$ref": "#/$defs/learning" } },
7
+ "dedup_drops": {
8
+ "type": "array",
9
+ "items": {
10
+ "type": "object",
11
+ "properties": {
12
+ "candidate": { "$ref": "#/$defs/learning" },
13
+ "matched_index_id": { "type": "string" },
14
+ "matched_title": { "type": "string" }
15
+ },
16
+ "required": ["candidate", "matched_index_id", "matched_title"],
17
+ "additionalProperties": false
18
+ }
13
19
  }
14
- ],
15
- "definitions": {
20
+ },
21
+ "required": ["dedup_drops", "learnings"],
22
+ "additionalProperties": false,
23
+ "$defs": {
16
24
  "learning": {
17
25
  "type": "object",
18
26
  "properties": {
19
- "title": { "type": "string", "minLength": 10 },
20
- "body": { "type": "string", "minLength": 50 },
27
+ "title": { "type": "string" },
28
+ "body": { "type": "string" },
21
29
  "category": {
22
30
  "type": "string",
23
31
  "enum": ["data-processing", "web-interaction", "code-execution", "storage-state", "payment-financial", "monitoring", "non-technical"]
24
32
  },
25
- "tags": { "type": "array", "items": { "type": "string" }, "maxItems": 8 },
26
- "task_context": { "type": "string" },
27
- "outcome": { "type": "string", "enum": ["success", "partial", "failure", "workaround"] },
33
+ "tags": { "type": ["array", "null"], "items": { "type": "string" } },
34
+ "task_context": { "type": ["string", "null"] },
35
+ "outcome": { "type": ["string", "null"], "enum": ["success", "partial", "failure", "workaround", null] },
28
36
  "quality_self_assessment": {
29
- "type": "object",
37
+ "type": ["object", "null"],
30
38
  "properties": {
31
- "specificity": { "type": "integer", "minimum": 1, "maximum": 5 },
32
- "actionability": { "type": "integer", "minimum": 1, "maximum": 5 },
33
- "novelty": { "type": "integer", "minimum": 1, "maximum": 5 },
34
- "completeness": { "type": "integer", "minimum": 1, "maximum": 5 },
39
+ "specificity": { "type": "integer" },
40
+ "actionability": { "type": "integer" },
41
+ "novelty": { "type": "integer" },
42
+ "completeness": { "type": "integer" },
35
43
  "total": { "type": "integer" }
36
- }
44
+ },
45
+ "required": ["actionability", "completeness", "novelty", "specificity", "total"],
46
+ "additionalProperties": false
37
47
  }
38
48
  },
39
- "required": ["title", "body", "category"]
49
+ "required": ["body", "category", "outcome", "quality_self_assessment", "tags", "task_context", "title"],
50
+ "additionalProperties": false
40
51
  }
41
52
  }
42
53
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$comment": "EXTRACT-PER-CLIENT W1 PART B passed to `codex exec --output-schema` for mode:'judge'. Mirrors scripts/extract-local.js's parseJudgeDecisions (line 447): one decision object per candidate, keyed by candidate_index, matched_index_id only meaningful when duplicate:true. The 'required id must be inside the candidate's own top-K rankings list' rule and the 'exactly one decision per candidate, no duplicate indices' rule are enforced by parseJudgeDecisions itself, not expressible in JSON Schema — a schema-conformant response can still fail the parser. This file is a HINT to codex; parseJudgeDecisions remains the source of truth.",
3
+ "$comment": "CODEX-OUTPUT-SCHEMA-REJECTEDstrict output transport for judge mode. parseJudgeDecisions enforces candidate bounds, unique indices, decision count and duplicate ids within the candidate's top-K list. A null matched_index_id on a nonduplicate is equivalent to omission in that parser.",
4
4
  "type": "object",
5
5
  "properties": {
6
6
  "decisions": {
@@ -8,13 +8,15 @@
8
8
  "items": {
9
9
  "type": "object",
10
10
  "properties": {
11
- "candidate_index": { "type": "integer", "minimum": 0 },
11
+ "candidate_index": { "type": "integer" },
12
12
  "duplicate": { "type": "boolean" },
13
- "matched_index_id": { "type": "string" }
13
+ "matched_index_id": { "type": ["string", "null"] }
14
14
  },
15
- "required": ["candidate_index", "duplicate"]
15
+ "required": ["candidate_index", "duplicate", "matched_index_id"],
16
+ "additionalProperties": false
16
17
  }
17
18
  }
18
19
  },
19
- "required": ["decisions"]
20
+ "required": ["decisions"],
21
+ "additionalProperties": false
20
22
  }