archgraph-argo-beta 0.27.0-beta.1 → 0.27.0-beta.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.
|
@@ -420,6 +420,13 @@ async function callTool(name, args = {}, progressToken = null, dependencies = un
|
|
|
420
420
|
tool: name,
|
|
421
421
|
args,
|
|
422
422
|
});
|
|
423
|
+
// getSystemArchitecture declares an outputSchema, so its result MUST carry
|
|
424
|
+
// matching structuredContent even on the cross-project path (which bypasses
|
|
425
|
+
// the systemarchitecture module's own toolResult). A missing
|
|
426
|
+
// structuredContent makes the MCP client reject the call with -32600.
|
|
427
|
+
if (name === 'getSystemArchitecture') {
|
|
428
|
+
return toolResult(result, systemArchitectureMcp.buildGetSystemArchitectureStructuredContent(result));
|
|
429
|
+
}
|
|
423
430
|
return toolResult(result);
|
|
424
431
|
}
|
|
425
432
|
if (name === 'initializeWorkspace') {
|
|
@@ -678,7 +685,7 @@ function normalizeRelativePath(value) {
|
|
|
678
685
|
return String(value).replace(/\\/g, '/');
|
|
679
686
|
}
|
|
680
687
|
|
|
681
|
-
function toolResult(payload) {
|
|
688
|
+
function toolResult(payload, structuredContent = undefined) {
|
|
682
689
|
return {
|
|
683
690
|
content: [
|
|
684
691
|
{
|
|
@@ -686,6 +693,7 @@ function toolResult(payload) {
|
|
|
686
693
|
text: JSON.stringify(payload, null, 2),
|
|
687
694
|
},
|
|
688
695
|
],
|
|
696
|
+
...(structuredContent === undefined ? {} : { structuredContent }),
|
|
689
697
|
isError: payload.status === 'failed',
|
|
690
698
|
};
|
|
691
699
|
}
|
|
@@ -2699,15 +2699,51 @@ function compactMutationResponse(payload) {
|
|
|
2699
2699
|
return compact;
|
|
2700
2700
|
}
|
|
2701
2701
|
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2702
|
+
// The typed getSystemArchitecture output contract (see
|
|
2703
|
+
// GET_SYSTEM_ARCHITECTURE_OUTPUT_SCHEMA). The error variant allows only the
|
|
2704
|
+
// listed keys, so any error (local or mirrored from a cross-project read) is
|
|
2705
|
+
// projected onto that shape with category + message guaranteed. Exposed so the
|
|
2706
|
+
// argo MCP server can build the SAME structuredContent for a cross-project read
|
|
2707
|
+
// (which bypasses this module's callTool) instead of returning a result without
|
|
2708
|
+
// structuredContent — which violates the declared outputSchema (-32600).
|
|
2709
|
+
const GET_SYSTEM_ARCHITECTURE_ERROR_KEYS = Object.freeze([
|
|
2710
|
+
'category', 'message', 'action', 'fullSnapshotFallback', 'state',
|
|
2711
|
+
'canonicalVersion', 'contentVersion', 'indexVersion',
|
|
2712
|
+
'completedChannels', 'missingChannels', 'mismatchedChannels',
|
|
2713
|
+
]);
|
|
2714
|
+
|
|
2715
|
+
function normalizeGetSystemArchitectureError(error) {
|
|
2716
|
+
const source = error && typeof error === 'object' ? error : {};
|
|
2717
|
+
const normalized = {};
|
|
2718
|
+
for (const key of GET_SYSTEM_ARCHITECTURE_ERROR_KEYS) {
|
|
2719
|
+
if (Object.prototype.hasOwnProperty.call(source, key) && source[key] !== undefined) {
|
|
2720
|
+
normalized[key] = source[key];
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
if (typeof normalized.category !== 'string' || normalized.category === '') {
|
|
2724
|
+
normalized.category = 'GET_SYSTEM_ARCHITECTURE_ERROR';
|
|
2725
|
+
}
|
|
2726
|
+
if (typeof normalized.message !== 'string' || normalized.message === '') {
|
|
2727
|
+
normalized.message = typeof source.reason === 'string' && source.reason !== ''
|
|
2728
|
+
? source.reason
|
|
2729
|
+
: 'getSystemArchitecture failed';
|
|
2730
|
+
}
|
|
2731
|
+
return normalized;
|
|
2732
|
+
}
|
|
2733
|
+
|
|
2734
|
+
function buildGetSystemArchitectureStructuredContent(payload) {
|
|
2735
|
+
const failed = Boolean(payload) && payload.status === 'failed';
|
|
2736
|
+
return {
|
|
2705
2737
|
version: '1.0',
|
|
2706
2738
|
mode: failed ? 'error' : 'semantic-query',
|
|
2707
|
-
document: failed ? null : (payload.document === undefined ? null : payload.document),
|
|
2708
|
-
query: failed ? null : (payload.query || null),
|
|
2709
|
-
error: failed ? payload.error : null,
|
|
2710
|
-
}
|
|
2739
|
+
document: failed ? null : (payload && payload.document === undefined ? null : payload.document),
|
|
2740
|
+
query: failed ? null : ((payload && payload.query) || null),
|
|
2741
|
+
error: failed ? normalizeGetSystemArchitectureError(payload.error) : null,
|
|
2742
|
+
};
|
|
2743
|
+
}
|
|
2744
|
+
|
|
2745
|
+
function getSystemArchitectureResult(payload) {
|
|
2746
|
+
return toolResult(payload, buildGetSystemArchitectureStructuredContent(payload));
|
|
2711
2747
|
}
|
|
2712
2748
|
|
|
2713
2749
|
async function callTool(name, args = {}, dependencies = undefined) {
|
|
@@ -4488,6 +4524,7 @@ if (require.main === module) {
|
|
|
4488
4524
|
|
|
4489
4525
|
module.exports = {
|
|
4490
4526
|
GET_SYSTEM_ARCHITECTURE_OUTPUT_SCHEMA,
|
|
4527
|
+
buildGetSystemArchitectureStructuredContent,
|
|
4491
4528
|
TOOLS,
|
|
4492
4529
|
applyMutations,
|
|
4493
4530
|
buildBusinessSemanticSummary,
|
package/package.json
CHANGED