@opengeni/core 0.4.5 → 0.4.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/core",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "OpenGeni framework-agnostic core: the domain, access, and billing layers (neutral access, off-HTTP V2 surface). Behavior-preserving extraction from apps/api — keeps Hono's HTTPException for error throwing (typed-errors cleanup deferred).",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -43,8 +43,8 @@
43
43
  "@opengeni/db": "^0.6.1",
44
44
  "@opengeni/documents": "^0.2.8",
45
45
  "@opengeni/events": "^0.2.8",
46
- "@opengeni/observability": "^0.2.1",
47
- "@opengeni/runtime": "^0.6.0",
46
+ "@opengeni/observability": "^0.3.0",
47
+ "@opengeni/runtime": "^0.6.1",
48
48
  "@opengeni/storage": "^0.2.8",
49
49
  "hono": "^4.12.18"
50
50
  }
@@ -436,7 +436,7 @@ export async function validateMcpCapabilityConnection(
436
436
  };
437
437
  } catch (error) {
438
438
  throw new HTTPException(422, {
439
- message: `MCP capability "${item.name}" could not be enabled because OpenGeni could not initialize ${item.endpointUrl}: ${mcpProbeErrorMessage(error)}`,
439
+ message: `MCP capability "${item.name}" could not be enabled because ${mcpProbeErrorMessage(error, item.endpointUrl)}`,
440
440
  });
441
441
  }
442
442
  }
@@ -461,9 +461,16 @@ async function probeStreamableHttpMcpServer(input: McpCapabilityProbeInput): Pro
461
461
  }
462
462
  }
463
463
 
464
- function mcpProbeErrorMessage(error: unknown): string {
464
+ function mcpProbeErrorMessage(error: unknown, endpointUrl: string): string {
465
465
  const message = error instanceof Error ? error.message : String(error);
466
- return message.replace(/\s+/g, " ").trim().slice(0, 500) || "unknown error";
466
+ const normalized = message.replace(/\s+/g, " ").trim();
467
+ if (
468
+ /404|405|not found|unexpected token|not valid json|invalid json|failed to parse|streamable http error|unable to connect|fetch failed|econnrefused|enotfound|timeout|aborted/i
469
+ .test(normalized)
470
+ ) {
471
+ return `OpenGeni could not reach a valid Streamable HTTP MCP server at ${endpointUrl}. Check the endpoint URL or choose a different catalog entry.`;
472
+ }
473
+ return `OpenGeni could not initialize ${endpointUrl}: ${normalized.slice(0, 500) || "unknown error"}`;
467
474
  }
468
475
 
469
476
  export async function disableCapability(input: {