@robosystems/core 0.5.7 → 0.5.9
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.
|
@@ -407,6 +407,8 @@ export function ConsoleContent({ config }) {
|
|
|
407
407
|
};
|
|
408
408
|
const showMcpSetup = async () => {
|
|
409
409
|
addSystemMessage('Creating MCP API key...', true);
|
|
410
|
+
const apiUrl = process.env.NEXT_PUBLIC_ROBOSYSTEMS_API_URL ||
|
|
411
|
+
'https://api.robosystems.ai';
|
|
410
412
|
try {
|
|
411
413
|
const { createUserApiKey } = await import('@robosystems/client/sdk');
|
|
412
414
|
const response = await createUserApiKey({
|
|
@@ -418,39 +420,45 @@ export function ConsoleContent({ config }) {
|
|
|
418
420
|
throw new Error('Failed to create API key');
|
|
419
421
|
}
|
|
420
422
|
const apiKey = response.data.key;
|
|
421
|
-
const apiUrl = process.env.NEXT_PUBLIC_ROBOSYSTEMS_API_URL ||
|
|
422
|
-
'https://api.robosystems.ai';
|
|
423
423
|
const { mcp } = config;
|
|
424
|
+
const contextId = graphId || mcp.contextIdFallback;
|
|
425
|
+
// The graph id lives in the URL path and never becomes a tool argument,
|
|
426
|
+
// so one connector is anchored to exactly one graph. Multi-graph users
|
|
427
|
+
// add one connector per graph, which is why the name carries the id.
|
|
428
|
+
const mcpUrl = `${apiUrl}/v1/graphs/${contextId}/mcp`;
|
|
429
|
+
const connectorName = `${mcp.serverName}-${contextId}`;
|
|
424
430
|
const exampleLines = mcp.exampleQuestions
|
|
425
431
|
.map((q) => ` • "${q}"`)
|
|
426
432
|
.join('\n');
|
|
427
433
|
addSystemMessage(`MCP Setup Instructions:\n` +
|
|
428
434
|
`═══════════════════════════════════════════════════════════════\n\n` +
|
|
429
435
|
`API Key Created Successfully!\n\n` +
|
|
430
|
-
`
|
|
431
|
-
` {\n` +
|
|
432
|
-
`
|
|
433
|
-
`
|
|
434
|
-
`
|
|
435
|
-
`
|
|
436
|
-
`
|
|
437
|
-
`
|
|
438
|
-
`
|
|
439
|
-
`
|
|
440
|
-
`
|
|
441
|
-
`
|
|
442
|
-
`
|
|
443
|
-
`
|
|
444
|
-
`
|
|
436
|
+
`One URL, one header — no install required.\n\n` +
|
|
437
|
+
` URL: ${mcpUrl}\n` +
|
|
438
|
+
` Header: X-API-Key: ${apiKey}\n\n` +
|
|
439
|
+
`Claude (claude.ai / Desktop)\n` +
|
|
440
|
+
` Settings → Connectors → Add custom connector, then paste the URL\n` +
|
|
441
|
+
` above and add the header.\n\n` +
|
|
442
|
+
`Claude Code\n` +
|
|
443
|
+
` claude mcp add --transport http ${connectorName} \\\n` +
|
|
444
|
+
` ${mcpUrl} \\\n` +
|
|
445
|
+
` --header "X-API-Key: ${apiKey}"\n\n` +
|
|
446
|
+
`Cursor / VS Code (mcp.json)\n` +
|
|
447
|
+
` "${connectorName}": {\n` +
|
|
448
|
+
` "url": "${mcpUrl}",\n` +
|
|
449
|
+
` "headers": { "X-API-Key": "${apiKey}" }\n` +
|
|
450
|
+
` }\n\n` +
|
|
445
451
|
`Once connected, ask Claude questions like:\n` +
|
|
446
452
|
`${exampleLines}\n\n` +
|
|
453
|
+
`Clients without HTTP transport support can use the legacy stdio\n` +
|
|
454
|
+
`bridge: https://github.com/RoboFinSystems/robosystems-mcp-client\n\n` +
|
|
447
455
|
`Keep this API key secure! It has full access to your account.`, true);
|
|
448
456
|
}
|
|
449
457
|
catch (error) {
|
|
450
458
|
addErrorMessage(`Failed to create API key: ${error.message || 'Unknown error'}\n\n` +
|
|
451
|
-
`You can
|
|
452
|
-
`
|
|
453
|
-
`
|
|
459
|
+
`You can create an API key in Settings and connect with:\n` +
|
|
460
|
+
` URL: ${apiUrl}/v1/graphs/${graphId || config.mcp.contextIdFallback}/mcp\n` +
|
|
461
|
+
` Header: X-API-Key: <your key>`);
|
|
454
462
|
}
|
|
455
463
|
};
|
|
456
464
|
const handleCommand = async (command) => {
|
|
@@ -35,7 +35,9 @@ export declare const EXAMPLE_SETS: Record<GraphExampleKind, GraphExampleSet>;
|
|
|
35
35
|
* @param preferredKind Tiebreak used only when a graph carries more than one
|
|
36
36
|
* entity extension (e.g. both roboledger and roboinvestor). Pass the app's
|
|
37
37
|
* own lens (a RoboLedger app passes 'roboledger') so a dual-extension graph
|
|
38
|
-
* shows the examples that fit the app the user is in.
|
|
38
|
+
* shows the examples that fit the app the user is in. With no lens — the
|
|
39
|
+
* brand-neutral RoboSystems console — a graph carrying the roboledger schema
|
|
40
|
+
* gets ledger examples, never portfolio ones.
|
|
39
41
|
*/
|
|
40
42
|
export declare function getGraphExampleKind(graph: GraphInfo | undefined, preferredKind?: GraphExampleKind): GraphExampleKind;
|
|
41
43
|
/** App-specific branding merged with the graph-derived example set. */
|
|
@@ -50,7 +52,8 @@ export interface ConsoleBranding {
|
|
|
50
52
|
closingMessage: string;
|
|
51
53
|
mcp: {
|
|
52
54
|
serverName: string;
|
|
53
|
-
|
|
55
|
+
/** @deprecated Unused since the remote MCP transport landed. */
|
|
56
|
+
packageName?: string;
|
|
54
57
|
contextIdFallback: string;
|
|
55
58
|
};
|
|
56
59
|
/** Defaults to "Example Cypher Queries:". */
|
|
@@ -333,7 +333,9 @@ export const EXAMPLE_SETS = {
|
|
|
333
333
|
* @param preferredKind Tiebreak used only when a graph carries more than one
|
|
334
334
|
* entity extension (e.g. both roboledger and roboinvestor). Pass the app's
|
|
335
335
|
* own lens (a RoboLedger app passes 'roboledger') so a dual-extension graph
|
|
336
|
-
* shows the examples that fit the app the user is in.
|
|
336
|
+
* shows the examples that fit the app the user is in. With no lens — the
|
|
337
|
+
* brand-neutral RoboSystems console — a graph carrying the roboledger schema
|
|
338
|
+
* gets ledger examples, never portfolio ones.
|
|
337
339
|
*/
|
|
338
340
|
export function getGraphExampleKind(graph, preferredKind) {
|
|
339
341
|
var _a;
|
|
@@ -347,7 +349,7 @@ export function getGraphExampleKind(graph, preferredKind) {
|
|
|
347
349
|
if (hasInvestor && hasLedger) {
|
|
348
350
|
return preferredKind === 'roboledger' || preferredKind === 'roboinvestor'
|
|
349
351
|
? preferredKind
|
|
350
|
-
: '
|
|
352
|
+
: 'roboledger';
|
|
351
353
|
}
|
|
352
354
|
if (hasInvestor)
|
|
353
355
|
return 'roboinvestor';
|
|
@@ -27,10 +27,15 @@ export interface ConsoleHeaderConfig {
|
|
|
27
27
|
gradientTo: string;
|
|
28
28
|
}
|
|
29
29
|
export interface ConsoleMcpConfig {
|
|
30
|
-
/**
|
|
30
|
+
/** Connector name prefix, e.g. "robosystems". The graph id is appended, so
|
|
31
|
+
* each of a user's graphs gets a distinctly named connector. */
|
|
31
32
|
serverName: string;
|
|
32
|
-
/**
|
|
33
|
-
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated Unused since the remote MCP transport landed — `/mcp` now emits
|
|
35
|
+
* a URL + `X-API-Key` header instead of an npx stdio config. Kept optional so
|
|
36
|
+
* consuming apps can drop it on their own schedule.
|
|
37
|
+
*/
|
|
38
|
+
packageName?: string;
|
|
34
39
|
/** Example questions shown after MCP setup */
|
|
35
40
|
exampleQuestions: string[];
|
|
36
41
|
/** Fallback text for graph ID placeholder, e.g. "your_graph_id" */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@robosystems/core",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.9",
|
|
4
4
|
"description": "Shared RoboSystems frontend core library (auth, contexts, task monitoring, UI components) for the RoboSystems Next.js apps",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"tailwind-merge": "^3"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@robosystems/client": ">=0.6.2 <
|
|
30
|
+
"@robosystems/client": ">=0.6.2 <2",
|
|
31
31
|
"flowbite-react": "^0.12.5",
|
|
32
32
|
"next": ">=15 <17",
|
|
33
33
|
"react": ">=18 <20",
|