@utaba/ucm-mcp-server 6.6.0 → 6.7.0
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/dist/clients/UcmLocalApiClient.d.ts +48 -1
- package/dist/clients/UcmLocalApiClient.js +8 -0
- package/dist/index.js +1 -1
- package/dist/interfaces/IMcpTool.d.ts +2 -2
- package/dist/server/ToolRegistry.js +2 -0
- package/dist/tools/base/BaseToolController.d.ts +7 -4
- package/dist/tools/base/BaseToolController.js +28 -11
- package/dist/tools/core/MoveArtifactTool.d.ts +1 -1
- package/dist/tools/core/MoveArtifactTool.js +1 -1
- package/dist/tools/memory-graph/GraphCreateEntitiesTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphCreateEntitiesTool.js +2 -0
- package/dist/tools/memory-graph/GraphCreateRelationshipsTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphCreateRelationshipsTool.js +2 -0
- package/dist/tools/memory-graph/GraphCreateTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphCreateTool.js +2 -0
- package/dist/tools/memory-graph/GraphDeleteEntitiesTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphDeleteEntitiesTool.js +2 -0
- package/dist/tools/memory-graph/GraphDeleteRelationshipsTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphDeleteRelationshipsTool.js +2 -0
- package/dist/tools/memory-graph/GraphExploreTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphExploreTool.js +2 -0
- package/dist/tools/memory-graph/GraphFindEntitiesTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphFindEntitiesTool.js +2 -0
- package/dist/tools/memory-graph/GraphFindPathsTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphFindPathsTool.js +2 -0
- package/dist/tools/memory-graph/GraphGetEntityTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphGetEntityTool.js +2 -0
- package/dist/tools/memory-graph/GraphGetRelationshipsTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphGetRelationshipsTool.js +2 -0
- package/dist/tools/memory-graph/GraphListTemplatesTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphListTemplatesTool.js +2 -0
- package/dist/tools/memory-graph/GraphListTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphListTool.js +2 -0
- package/dist/tools/memory-graph/GraphOpenTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphOpenTool.js +3 -1
- package/dist/tools/memory-graph/GraphProposeVocabularyTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphProposeVocabularyTool.js +51 -6
- package/dist/tools/memory-graph/GraphSearchTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphSearchTool.js +2 -0
- package/dist/tools/memory-graph/GraphTraverseTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphTraverseTool.js +2 -0
- package/dist/tools/memory-graph/GraphUpdateEntitiesTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphUpdateEntitiesTool.js +2 -0
- package/dist/{mcp-server/tools/memory-graph/GraphSearchTool.d.ts → tools/memory-graph/GraphUpdateTool.d.ts} +4 -4
- package/dist/tools/memory-graph/GraphUpdateTool.js +59 -0
- package/dist/tools/memory-graph/KnowledgeSetListTool.d.ts +5 -2
- package/dist/tools/memory-graph/KnowledgeSetListTool.js +2 -0
- package/dist/tools/memory-graph/KnowledgeSetOpenTool.d.ts +5 -2
- package/dist/tools/memory-graph/KnowledgeSetOpenTool.js +2 -0
- package/package.json +1 -1
- package/package.json.backup +1 -1
- package/dist/clients/UcmApiClient.d.ts +0 -157
- package/dist/clients/UcmApiClient.js +0 -443
- package/dist/mcp-server/clients/UcmLocalApiClient.d.ts +0 -399
- package/dist/mcp-server/clients/UcmLocalApiClient.js +0 -719
- package/dist/mcp-server/index.d.ts +0 -3
- package/dist/mcp-server/index.js +0 -68
- package/dist/mcp-server/interfaces/ILogger.d.ts +0 -8
- package/dist/mcp-server/interfaces/ILogger.js +0 -4
- package/dist/mcp-server/interfaces/IMcpTool.d.ts +0 -7
- package/dist/mcp-server/interfaces/IMcpTool.js +0 -3
- package/dist/mcp-server/logging/ConsoleLogger.d.ts +0 -16
- package/dist/mcp-server/logging/ConsoleLogger.js +0 -45
- package/dist/mcp-server/logging/LoggerFactory.d.ts +0 -9
- package/dist/mcp-server/logging/LoggerFactory.js +0 -12
- package/dist/mcp-server/server/McpConfig.d.ts +0 -26
- package/dist/mcp-server/server/McpConfig.js +0 -90
- package/dist/mcp-server/server/McpHandler.d.ts +0 -12
- package/dist/mcp-server/server/McpHandler.js +0 -84
- package/dist/mcp-server/server/McpServer.d.ts +0 -15
- package/dist/mcp-server/server/McpServer.js +0 -49
- package/dist/mcp-server/server/ToolRegistry.d.ts +0 -23
- package/dist/mcp-server/server/ToolRegistry.js +0 -169
- package/dist/mcp-server/tools/authorization/ListAuthorizationsTool.d.ts +0 -21
- package/dist/mcp-server/tools/authorization/ListAuthorizationsTool.js +0 -146
- package/dist/mcp-server/tools/authorization/SignOutTool.d.ts +0 -23
- package/dist/mcp-server/tools/authorization/SignOutTool.js +0 -128
- package/dist/mcp-server/tools/base/BaseToolController.d.ts +0 -19
- package/dist/mcp-server/tools/base/BaseToolController.js +0 -58
- package/dist/mcp-server/tools/connections/AccessConnectionTool.d.ts +0 -21
- package/dist/mcp-server/tools/connections/AccessConnectionTool.js +0 -107
- package/dist/mcp-server/tools/connections/CallRemoteToolTool.d.ts +0 -22
- package/dist/mcp-server/tools/connections/CallRemoteToolTool.js +0 -124
- package/dist/mcp-server/tools/core/DeleteArtifactTool.d.ts +0 -11
- package/dist/mcp-server/tools/core/DeleteArtifactTool.js +0 -83
- package/dist/mcp-server/tools/core/EditArtifactMetadataTool.d.ts +0 -12
- package/dist/mcp-server/tools/core/EditArtifactMetadataTool.js +0 -173
- package/dist/mcp-server/tools/core/GetArtifactTool.d.ts +0 -13
- package/dist/mcp-server/tools/core/GetArtifactTool.js +0 -124
- package/dist/mcp-server/tools/core/GetArtifactVersionsTool.d.ts +0 -11
- package/dist/mcp-server/tools/core/GetArtifactVersionsTool.js +0 -63
- package/dist/mcp-server/tools/core/GetChunkTool.d.ts +0 -11
- package/dist/mcp-server/tools/core/GetChunkTool.js +0 -56
- package/dist/mcp-server/tools/core/ListArtifactsTool.d.ts +0 -11
- package/dist/mcp-server/tools/core/ListArtifactsTool.js +0 -84
- package/dist/mcp-server/tools/core/MoveArtifactTool.d.ts +0 -12
- package/dist/mcp-server/tools/core/MoveArtifactTool.js +0 -104
- package/dist/mcp-server/tools/core/PublishArtifactFromFileTool.d.ts +0 -15
- package/dist/mcp-server/tools/core/PublishArtifactFromFileTool.js +0 -277
- package/dist/mcp-server/tools/core/PublishArtifactTool.d.ts +0 -13
- package/dist/mcp-server/tools/core/PublishArtifactTool.js +0 -218
- package/dist/mcp-server/tools/core/SearchArtifactsTool.d.ts +0 -11
- package/dist/mcp-server/tools/core/SearchArtifactsTool.js +0 -137
- package/dist/mcp-server/tools/list/ListNamespaceController.d.ts +0 -1
- package/dist/mcp-server/tools/list/ListNamespaceController.js +0 -8
- package/dist/mcp-server/tools/memory-graph/GraphCreateEntitiesTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphCreateEntitiesTool.js +0 -58
- package/dist/mcp-server/tools/memory-graph/GraphCreateRelationshipsTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphCreateRelationshipsTool.js +0 -57
- package/dist/mcp-server/tools/memory-graph/GraphCreateTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphCreateTool.js +0 -64
- package/dist/mcp-server/tools/memory-graph/GraphDeleteEntitiesTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphDeleteEntitiesTool.js +0 -45
- package/dist/mcp-server/tools/memory-graph/GraphDeleteRelationshipsTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphDeleteRelationshipsTool.js +0 -45
- package/dist/mcp-server/tools/memory-graph/GraphExploreTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphExploreTool.js +0 -73
- package/dist/mcp-server/tools/memory-graph/GraphFindEntitiesTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphFindEntitiesTool.js +0 -68
- package/dist/mcp-server/tools/memory-graph/GraphFindPathsTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphFindPathsTool.js +0 -62
- package/dist/mcp-server/tools/memory-graph/GraphGetEntityTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphGetEntityTool.js +0 -49
- package/dist/mcp-server/tools/memory-graph/GraphGetRelationshipsTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphGetRelationshipsTool.js +0 -62
- package/dist/mcp-server/tools/memory-graph/GraphListTemplatesTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphListTemplatesTool.js +0 -34
- package/dist/mcp-server/tools/memory-graph/GraphListTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphListTool.js +0 -45
- package/dist/mcp-server/tools/memory-graph/GraphOpenTool.d.ts +0 -15
- package/dist/mcp-server/tools/memory-graph/GraphOpenTool.js +0 -50
- package/dist/mcp-server/tools/memory-graph/GraphProposeVocabularyTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphProposeVocabularyTool.js +0 -108
- package/dist/mcp-server/tools/memory-graph/GraphSearchTool.js +0 -94
- package/dist/mcp-server/tools/memory-graph/GraphTraverseTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphTraverseTool.js +0 -114
- package/dist/mcp-server/tools/memory-graph/GraphUpdateEntitiesTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphUpdateEntitiesTool.js +0 -58
- package/dist/mcp-server/tools/memory-graph/KnowledgeSetListTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/KnowledgeSetListTool.js +0 -25
- package/dist/mcp-server/tools/memory-graph/KnowledgeSetOpenTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/KnowledgeSetOpenTool.js +0 -31
- package/dist/mcp-server/tools/repository/CreateRepositoryTool.d.ts +0 -12
- package/dist/mcp-server/tools/repository/CreateRepositoryTool.js +0 -116
- package/dist/mcp-server/tools/repository/GetRepositoryTool.d.ts +0 -12
- package/dist/mcp-server/tools/repository/GetRepositoryTool.js +0 -85
- package/dist/mcp-server/tools/repository/UpdateRepositoryTool.d.ts +0 -12
- package/dist/mcp-server/tools/repository/UpdateRepositoryTool.js +0 -115
- package/dist/mcp-server/tools/sharepoint/SharePointListConnectionsTool.d.ts +0 -19
- package/dist/mcp-server/tools/sharepoint/SharePointListConnectionsTool.js +0 -90
- package/dist/mcp-server/tools/sharepoint/SharePointListFoldersTool.d.ts +0 -21
- package/dist/mcp-server/tools/sharepoint/SharePointListFoldersTool.js +0 -133
- package/dist/mcp-server/tools/sharepoint/SharePointReadFileTool.d.ts +0 -22
- package/dist/mcp-server/tools/sharepoint/SharePointReadFileTool.js +0 -146
- package/dist/mcp-server/tools/sharepoint/SharePointReadRelatedFileTool.d.ts +0 -18
- package/dist/mcp-server/tools/sharepoint/SharePointReadRelatedFileTool.js +0 -108
- package/dist/mcp-server/tools/sharepoint/SharePointSearchTool.d.ts +0 -22
- package/dist/mcp-server/tools/sharepoint/SharePointSearchTool.js +0 -125
- package/dist/mcp-server/tools/utility/AuthorIndexTool.d.ts +0 -11
- package/dist/mcp-server/tools/utility/AuthorIndexTool.js +0 -49
- package/dist/mcp-server/tools/utility/AuthorRecentsTool.d.ts +0 -11
- package/dist/mcp-server/tools/utility/AuthorRecentsTool.js +0 -49
- package/dist/mcp-server/tools/utility/ListRepositoriesTool.d.ts +0 -11
- package/dist/mcp-server/tools/utility/ListRepositoriesTool.js +0 -68
- package/dist/mcp-server/tools/utility/QuickstartTool.d.ts +0 -11
- package/dist/mcp-server/tools/utility/QuickstartTool.js +0 -36
- package/dist/mcp-server/types/UcmApiTypes.d.ts +0 -40
- package/dist/mcp-server/types/UcmApiTypes.js +0 -4
- package/dist/mcp-server/utils/McpErrorHandler.d.ts +0 -25
- package/dist/mcp-server/utils/McpErrorHandler.js +0 -67
- package/dist/mcp-server/utils/PathUtils.d.ts +0 -61
- package/dist/mcp-server/utils/PathUtils.js +0 -178
- package/dist/mcp-server/utils/ResponseChunker.d.ts +0 -25
- package/dist/mcp-server/utils/ResponseChunker.js +0 -79
- package/dist/mcp-server/utils/SharePointErrorHandler.d.ts +0 -34
- package/dist/mcp-server/utils/SharePointErrorHandler.js +0 -55
- package/dist/publish/package.json +0 -37
- package/dist/schemas/memory-graph-tool-schemas.d.ts +0 -789
- package/dist/schemas/memory-graph-tool-schemas.js +0 -181
- package/dist/tools/artifacts/GetArtifactController.d.ts +0 -34
- package/dist/tools/artifacts/GetArtifactController.js +0 -397
- package/dist/tools/artifacts/GetLatestController.d.ts +0 -39
- package/dist/tools/artifacts/GetLatestController.js +0 -469
- package/dist/tools/artifacts/ListVersionsController.d.ts +0 -43
- package/dist/tools/artifacts/ListVersionsController.js +0 -530
- package/dist/tools/artifacts/PublishArtifactController.d.ts +0 -37
- package/dist/tools/artifacts/PublishArtifactController.js +0 -605
- package/dist/tools/discovery/BrowseCategoriesController.d.ts +0 -25
- package/dist/tools/discovery/BrowseCategoriesController.js +0 -400
- package/dist/tools/discovery/FindByPurposeController.d.ts +0 -12
- package/dist/tools/discovery/FindByPurposeController.js +0 -131
- package/dist/tools/discovery/ListAuthorsController.d.ts +0 -20
- package/dist/tools/discovery/ListAuthorsController.js +0 -274
- package/dist/tools/discovery/SearchArtifactsController.d.ts +0 -14
- package/dist/tools/discovery/SearchArtifactsController.js +0 -226
- package/dist/tools/memory-graph/GraphGetStatsTool.d.ts +0 -11
- package/dist/tools/memory-graph/GraphGetStatsTool.js +0 -42
- package/dist/tools/memory-graph/GraphRemoveRelationshipsTool.d.ts +0 -11
- package/dist/tools/memory-graph/GraphRemoveRelationshipsTool.js +0 -47
- package/dist/tools/navigation/ExploreNamespaceController.d.ts +0 -35
- package/dist/tools/navigation/ExploreNamespaceController.js +0 -548
- package/dist/tools/repository/DeleteRepositoryGuidanceTool.d.ts +0 -13
- package/dist/tools/repository/DeleteRepositoryGuidanceTool.js +0 -93
- package/dist/tools/sharepoint/SharePointSignOutTool.d.ts +0 -22
- package/dist/tools/sharepoint/SharePointSignOutTool.js +0 -114
- package/dist/tools/utility/HealthCheckController.d.ts +0 -11
- package/dist/tools/utility/HealthCheckController.js +0 -60
- package/dist/tools/utility/SubmitFeedbackTool.d.ts +0 -16
- package/dist/tools/utility/SubmitFeedbackTool.js +0 -68
- package/dist/tools/utility/ValidatePathController.d.ts +0 -30
- package/dist/tools/utility/ValidatePathController.js +0 -465
- package/dist/utils/HttpsAgentFactory.d.ts +0 -21
- package/dist/utils/HttpsAgentFactory.js +0 -50
- package/dist/utils/ValidationUtils.d.ts +0 -10
- package/dist/utils/ValidationUtils.js +0 -50
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared Zod schemas for all Memory Graph and Knowledge Set MCP tools.
|
|
3
|
-
*
|
|
4
|
-
* Used by three MCP servers (Local, Remote, Agent) for runtime validation.
|
|
5
|
-
* Each schema defines the tool input shape (what the AI sends).
|
|
6
|
-
*/
|
|
7
|
-
import { z } from 'zod';
|
|
8
|
-
// ─── Common Fragments ───────────────────────────────────────────────
|
|
9
|
-
const memoryGraphId = z.string().describe('The Memory Graph ID');
|
|
10
|
-
const entityId = z.string().describe('The entity ID');
|
|
11
|
-
const detailLevel = z.enum(['brief', 'summary', 'full']);
|
|
12
|
-
const direction = z.enum(['outbound', 'inbound', 'both']);
|
|
13
|
-
const traversalDirection = z.enum(['out', 'in', 'both']);
|
|
14
|
-
const returnMode = z.enum(['terminal', 'all', 'paths']);
|
|
15
|
-
const graphScope = z.enum(['organization', 'personal', 'all']);
|
|
16
|
-
const createScope = z.enum(['personal', 'organization']);
|
|
17
|
-
const entityInput = z.object({
|
|
18
|
-
entityType: z.string().describe('Entity type (must exist in vocabulary)'),
|
|
19
|
-
label: z.string().describe('Human-readable label'),
|
|
20
|
-
summary: z.string().optional().describe('Brief summary/description'),
|
|
21
|
-
properties: z.record(z.unknown()).optional().describe('Entity properties (validated against vocabulary schema)'),
|
|
22
|
-
data: z.union([z.string(), z.record(z.unknown())]).optional().describe('Optional freeform data'),
|
|
23
|
-
});
|
|
24
|
-
const entityUpdateInput = z.object({
|
|
25
|
-
entityId: z.string().describe('The entity ID to update'),
|
|
26
|
-
label: z.string().optional().describe('New label'),
|
|
27
|
-
summary: z.string().optional().describe('New summary'),
|
|
28
|
-
properties: z.record(z.unknown()).optional().describe('Properties to update (merged with existing)'),
|
|
29
|
-
data: z.record(z.unknown()).optional().describe('Data to update (merged with existing)'),
|
|
30
|
-
});
|
|
31
|
-
const relationshipInput = z.object({
|
|
32
|
-
relationshipType: z.string().describe('Relationship type (must exist in vocabulary)'),
|
|
33
|
-
sourceEntityId: z.string().describe('Source entity ID'),
|
|
34
|
-
targetEntityId: z.string().describe('Target entity ID'),
|
|
35
|
-
properties: z.record(z.unknown()).optional().describe('Optional relationship properties'),
|
|
36
|
-
});
|
|
37
|
-
const propertyFilter = z.object({
|
|
38
|
-
key: z.string(),
|
|
39
|
-
operator: z.string().describe('eq, neq, gt, gte, lt, lte, contains, isNull, isNotNull'),
|
|
40
|
-
value: z.unknown().optional(),
|
|
41
|
-
});
|
|
42
|
-
const traversalStart = z.object({
|
|
43
|
-
entityId: z.string().optional().describe('Start from specific entity'),
|
|
44
|
-
entityType: z.string().optional().describe('Start from all entities of this type'),
|
|
45
|
-
filter: z.array(propertyFilter).optional().describe('Property filters on start entities'),
|
|
46
|
-
}).passthrough();
|
|
47
|
-
const traversalStep = z.object({
|
|
48
|
-
direction: traversalDirection.optional().describe('Hop direction'),
|
|
49
|
-
relationshipTypes: z.array(z.string()).optional().describe('Filter by relationship types'),
|
|
50
|
-
entityTypes: z.array(z.string()).optional().describe('Filter by entity types at this step'),
|
|
51
|
-
filter: z.array(propertyFilter).optional().describe('Property filters on entities at this step'),
|
|
52
|
-
repeat: z.object({
|
|
53
|
-
min: z.number().optional(),
|
|
54
|
-
max: z.number().optional(),
|
|
55
|
-
}).optional().describe('Repeat this step min to max times'),
|
|
56
|
-
}).passthrough();
|
|
57
|
-
const entityTypeProposal = z.object({
|
|
58
|
-
type: z.string().describe('Entity type name (PascalCase, singular)'),
|
|
59
|
-
description: z.string().describe('What this entity type represents'),
|
|
60
|
-
justification: z.string().describe('Why this entity type is needed'),
|
|
61
|
-
properties: z.array(z.object({
|
|
62
|
-
name: z.string().describe('Property name (camelCase)'),
|
|
63
|
-
type: z.enum(['string', 'number', 'boolean', 'date']).describe('Property data type'),
|
|
64
|
-
required: z.boolean().optional().describe('Whether the property is required'),
|
|
65
|
-
description: z.string().describe('What this property captures'),
|
|
66
|
-
embeddable: z.boolean().optional().describe('Include in embedding text for semantic search'),
|
|
67
|
-
})).optional().describe('Property definitions'),
|
|
68
|
-
}).passthrough();
|
|
69
|
-
const relationshipTypeProposal = z.object({
|
|
70
|
-
type: z.string().describe('Relationship type name (UPPER_SNAKE_CASE)'),
|
|
71
|
-
description: z.string().describe('What this relationship means'),
|
|
72
|
-
justification: z.string().describe('Why this relationship type is needed'),
|
|
73
|
-
allowedSourceTypes: z.array(z.string()).describe('Entity types that can be the source'),
|
|
74
|
-
allowedTargetTypes: z.array(z.string()).describe('Entity types that can be the target'),
|
|
75
|
-
bidirectional: z.boolean().optional().describe('Whether the relationship is bidirectional'),
|
|
76
|
-
properties: z.array(z.object({
|
|
77
|
-
name: z.string(),
|
|
78
|
-
type: z.enum(['string', 'number', 'boolean', 'date']),
|
|
79
|
-
required: z.boolean().optional(),
|
|
80
|
-
description: z.string(),
|
|
81
|
-
})).optional().describe('Relationship property definitions'),
|
|
82
|
-
}).passthrough();
|
|
83
|
-
// ─── Discovery Tool Schemas ─────────────────────────────────────────
|
|
84
|
-
export const GraphListSchema = z.object({
|
|
85
|
-
scope: graphScope.optional().describe('Filter by ownership scope (default: all)'),
|
|
86
|
-
});
|
|
87
|
-
export const GraphListTemplatesSchema = z.object({});
|
|
88
|
-
export const KnowledgeSetListSchema = z.object({});
|
|
89
|
-
export const KnowledgeSetOpenSchema = z.object({
|
|
90
|
-
knowledgeSetId: z.string().describe('The Knowledge Set ID to open'),
|
|
91
|
-
});
|
|
92
|
-
// ─── Graph Lifecycle Schemas ────────────────────────────────────────
|
|
93
|
-
export const GraphCreateSchema = z.object({
|
|
94
|
-
label: z.string().describe('Display name for the new Memory Graph'),
|
|
95
|
-
templateId: z.string().describe('Vocabulary template ID — call ucm_graph_list_templates first'),
|
|
96
|
-
description: z.string().optional().describe('What this graph is for'),
|
|
97
|
-
scope: createScope.optional().describe('personal (default) or organization (requires Owner role)'),
|
|
98
|
-
});
|
|
99
|
-
export const GraphOpenSchema = z.object({
|
|
100
|
-
memoryGraphId,
|
|
101
|
-
});
|
|
102
|
-
// ─── Read Tool Schemas ──────────────────────────────────────────────
|
|
103
|
-
export const GraphFindEntitiesSchema = z.object({
|
|
104
|
-
memoryGraphId,
|
|
105
|
-
searchTerm: z.string().optional().describe('Search term to match against entity labels'),
|
|
106
|
-
entityTypes: z.array(z.string()).optional().describe('Filter by entity types'),
|
|
107
|
-
detailLevel: detailLevel.optional().describe('Detail level (default: summary)'),
|
|
108
|
-
limit: z.number().optional().describe('Maximum results (default: 20, max: 100)'),
|
|
109
|
-
offset: z.number().optional().describe('Pagination offset (default: 0)'),
|
|
110
|
-
});
|
|
111
|
-
export const GraphGetEntitySchema = z.object({
|
|
112
|
-
memoryGraphId,
|
|
113
|
-
entityId,
|
|
114
|
-
detailLevel: detailLevel.optional().describe('Detail level (default: full)'),
|
|
115
|
-
});
|
|
116
|
-
export const GraphGetRelationshipsSchema = z.object({
|
|
117
|
-
memoryGraphId,
|
|
118
|
-
entityId,
|
|
119
|
-
relationshipTypes: z.array(z.string()).optional().describe('Filter by relationship types'),
|
|
120
|
-
direction: direction.optional().describe('Direction (default: both)'),
|
|
121
|
-
limit: z.number().optional().describe('Maximum results (default: 50)'),
|
|
122
|
-
});
|
|
123
|
-
export const GraphExploreSchema = z.object({
|
|
124
|
-
memoryGraphId,
|
|
125
|
-
entityId: z.string().describe('Starting entity ID'),
|
|
126
|
-
depth: z.number().optional().describe('Exploration depth: 1, 2, or 3 (default: 1)'),
|
|
127
|
-
relationshipTypes: z.array(z.string()).optional().describe('Filter by relationship types'),
|
|
128
|
-
entityTypes: z.array(z.string()).optional().describe('Filter by entity types'),
|
|
129
|
-
direction: direction.optional().describe('Direction (default: both)'),
|
|
130
|
-
limitPerType: z.number().optional().describe('Max results per type (default: 10)'),
|
|
131
|
-
});
|
|
132
|
-
export const GraphFindPathsSchema = z.object({
|
|
133
|
-
memoryGraphId,
|
|
134
|
-
sourceEntityId: z.string().describe('Starting entity ID'),
|
|
135
|
-
targetEntityId: z.string().describe('Target entity ID'),
|
|
136
|
-
maxDepth: z.number().optional().describe('Maximum path depth (default: 3, max: 5)'),
|
|
137
|
-
relationshipTypes: z.array(z.string()).optional().describe('Filter by relationship types'),
|
|
138
|
-
});
|
|
139
|
-
export const GraphTraverseSchema = z.object({
|
|
140
|
-
memoryGraphId,
|
|
141
|
-
start: traversalStart.describe('Start point specification'),
|
|
142
|
-
steps: z.array(traversalStep).describe('Ordered traversal steps (hops)'),
|
|
143
|
-
returnMode: returnMode.optional().describe('Return mode (default: terminal)'),
|
|
144
|
-
limit: z.number().optional().describe('Max results (default: 50)'),
|
|
145
|
-
detailLevel: detailLevel.optional().describe('Detail level (default: summary)'),
|
|
146
|
-
});
|
|
147
|
-
export const GraphSearchSchema = z.object({
|
|
148
|
-
memoryGraphId: z.string().optional().describe('Search a single graph (backwards compatible)'),
|
|
149
|
-
graphIds: z.array(z.string()).optional().describe('Search multiple graphs. Omit to search all accessible.'),
|
|
150
|
-
query: z.string().describe('Natural language search query'),
|
|
151
|
-
entityTypes: z.array(z.string()).optional().describe('Filter by entity types'),
|
|
152
|
-
limit: z.number().optional().describe('Per-graph result limit'),
|
|
153
|
-
similarityThreshold: z.number().optional().describe('Minimum similarity score (0-1)'),
|
|
154
|
-
});
|
|
155
|
-
// ─── Write Tool Schemas ─────────────────────────────────────────────
|
|
156
|
-
export const GraphCreateEntitiesSchema = z.object({
|
|
157
|
-
memoryGraphId,
|
|
158
|
-
entities: z.array(entityInput).min(1).describe('Array of entities to create'),
|
|
159
|
-
});
|
|
160
|
-
export const GraphUpdateEntitiesSchema = z.object({
|
|
161
|
-
memoryGraphId,
|
|
162
|
-
updates: z.array(entityUpdateInput).min(1).describe('Array of entity updates'),
|
|
163
|
-
});
|
|
164
|
-
export const GraphDeleteEntitiesSchema = z.object({
|
|
165
|
-
memoryGraphId,
|
|
166
|
-
entityIds: z.array(z.string()).min(1).describe('Array of entity IDs to delete'),
|
|
167
|
-
});
|
|
168
|
-
export const GraphCreateRelationshipsSchema = z.object({
|
|
169
|
-
memoryGraphId,
|
|
170
|
-
relationships: z.array(relationshipInput).min(1).describe('Array of relationships to create'),
|
|
171
|
-
});
|
|
172
|
-
export const GraphDeleteRelationshipsSchema = z.object({
|
|
173
|
-
memoryGraphId,
|
|
174
|
-
relationshipIds: z.array(z.string()).min(1).describe('Array of relationship IDs to delete'),
|
|
175
|
-
});
|
|
176
|
-
export const GraphProposeVocabularySchema = z.object({
|
|
177
|
-
memoryGraphId,
|
|
178
|
-
entityTypes: z.array(entityTypeProposal).optional().describe('Entity type proposals'),
|
|
179
|
-
relationshipTypes: z.array(relationshipTypeProposal).optional().describe('Relationship type proposals'),
|
|
180
|
-
});
|
|
181
|
-
//# sourceMappingURL=memory-graph-tool-schemas.js.map
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { BaseToolController } from '../base/BaseToolController.js';
|
|
2
|
-
import { UcmApiClient } from '../../clients/UcmLocalApiClient.js';
|
|
3
|
-
import { ILogger } from '../../interfaces/ILogger.js';
|
|
4
|
-
export declare class GetArtifactController extends BaseToolController {
|
|
5
|
-
constructor(ucmClient: UcmApiClient, logger: ILogger);
|
|
6
|
-
get name(): string;
|
|
7
|
-
get description(): string;
|
|
8
|
-
get inputSchema(): any;
|
|
9
|
-
protected handleExecute(params: any): Promise<any>;
|
|
10
|
-
private buildArtifactResponse;
|
|
11
|
-
private enrichMetadata;
|
|
12
|
-
private processExamples;
|
|
13
|
-
private enrichDependencies;
|
|
14
|
-
private getVersionHistory;
|
|
15
|
-
private getRelatedArtifacts;
|
|
16
|
-
private detectContentType;
|
|
17
|
-
private detectLanguage;
|
|
18
|
-
private getIncludedSections;
|
|
19
|
-
private isLatestVersion;
|
|
20
|
-
private calculateQualityScore;
|
|
21
|
-
private estimateComplexity;
|
|
22
|
-
private assessMaturityLevel;
|
|
23
|
-
private sanitizeExternalDependencies;
|
|
24
|
-
private checkDependencyResolution;
|
|
25
|
-
private findMissingDependencies;
|
|
26
|
-
private detectDependencyConflicts;
|
|
27
|
-
private generateChangesSummary;
|
|
28
|
-
private isBreakingChange;
|
|
29
|
-
private getDownloadCount;
|
|
30
|
-
private calculateRating;
|
|
31
|
-
private getLastAccessTime;
|
|
32
|
-
private calculateSimilarity;
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=GetArtifactController.d.ts.map
|
|
@@ -1,397 +0,0 @@
|
|
|
1
|
-
import { BaseToolController } from '../base/BaseToolController.js';
|
|
2
|
-
import { ValidationUtils } from '../../utils/ValidationUtils.js';
|
|
3
|
-
import { parsePath } from '../../utils/PathUtils.js';
|
|
4
|
-
export class GetArtifactController extends BaseToolController {
|
|
5
|
-
constructor(ucmClient, logger) {
|
|
6
|
-
super(ucmClient, logger);
|
|
7
|
-
}
|
|
8
|
-
get name() {
|
|
9
|
-
return 'mcp_ucm_get_artifact';
|
|
10
|
-
}
|
|
11
|
-
get description() {
|
|
12
|
-
return 'Retrieve a specific UCM artifact with its content, metadata, and optional examples';
|
|
13
|
-
}
|
|
14
|
-
get inputSchema() {
|
|
15
|
-
return {
|
|
16
|
-
type: 'object',
|
|
17
|
-
properties: {
|
|
18
|
-
path: {
|
|
19
|
-
type: 'string',
|
|
20
|
-
description: 'Full artifact path (e.g., "utaba/commands/create-user/typescript/1.0.0" or "utaba/commands/create-user/1.0.0")',
|
|
21
|
-
minLength: 5,
|
|
22
|
-
maxLength: 200
|
|
23
|
-
},
|
|
24
|
-
includeContent: {
|
|
25
|
-
type: 'boolean',
|
|
26
|
-
default: true,
|
|
27
|
-
description: 'Include the artifact source content in the response'
|
|
28
|
-
},
|
|
29
|
-
includeMetadata: {
|
|
30
|
-
type: 'boolean',
|
|
31
|
-
default: true,
|
|
32
|
-
description: 'Include comprehensive metadata about the artifact'
|
|
33
|
-
},
|
|
34
|
-
includeExamples: {
|
|
35
|
-
type: 'boolean',
|
|
36
|
-
default: false,
|
|
37
|
-
description: 'Include usage examples and documentation'
|
|
38
|
-
},
|
|
39
|
-
includeDependencies: {
|
|
40
|
-
type: 'boolean',
|
|
41
|
-
default: false,
|
|
42
|
-
description: 'Include detailed dependency information'
|
|
43
|
-
},
|
|
44
|
-
includeVersionHistory: {
|
|
45
|
-
type: 'boolean',
|
|
46
|
-
default: false,
|
|
47
|
-
description: 'Include version history for this artifact'
|
|
48
|
-
},
|
|
49
|
-
format: {
|
|
50
|
-
type: 'string',
|
|
51
|
-
enum: ['full', 'summary', 'content-only', 'metadata-only'],
|
|
52
|
-
default: 'full',
|
|
53
|
-
description: 'Response format level'
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
required: ['path']
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
async handleExecute(params) {
|
|
60
|
-
const { path, includeContent = true, includeMetadata = true, includeExamples = false, includeDependencies = false, includeVersionHistory = false, format = 'full' } = params;
|
|
61
|
-
// Validate and sanitize the artifact path
|
|
62
|
-
ValidationUtils.validateArtifactPath(path);
|
|
63
|
-
this.logger.debug('GetArtifactController', `Retrieving artifact: ${path}`);
|
|
64
|
-
try {
|
|
65
|
-
// Parse the path to get component parts
|
|
66
|
-
const parsed = parsePath(path);
|
|
67
|
-
// Get the artifact from UCM API
|
|
68
|
-
const artifact = await this.ucmClient.getArtifact(parsed.author, parsed.category, parsed.subcategory, parsed.filename, parsed.version);
|
|
69
|
-
if (!artifact) {
|
|
70
|
-
throw new Error(`Artifact not found at path: ${path}`);
|
|
71
|
-
}
|
|
72
|
-
// Build response based on requested format and includes
|
|
73
|
-
const response = await this.buildArtifactResponse(artifact, {
|
|
74
|
-
includeContent,
|
|
75
|
-
includeMetadata,
|
|
76
|
-
includeExamples,
|
|
77
|
-
includeDependencies,
|
|
78
|
-
includeVersionHistory,
|
|
79
|
-
format
|
|
80
|
-
});
|
|
81
|
-
this.logger.info('GetArtifactController', `Successfully retrieved artifact: ${path}`);
|
|
82
|
-
return response;
|
|
83
|
-
}
|
|
84
|
-
catch (error) {
|
|
85
|
-
this.logger.error('GetArtifactController', `Failed to retrieve artifact: ${path}`, '', error);
|
|
86
|
-
throw error;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
async buildArtifactResponse(artifact, options) {
|
|
90
|
-
const { includeContent, includeMetadata, includeExamples, includeDependencies, includeVersionHistory, format } = options;
|
|
91
|
-
// Base response structure
|
|
92
|
-
const response = {
|
|
93
|
-
path: artifact.path,
|
|
94
|
-
id: artifact.id
|
|
95
|
-
};
|
|
96
|
-
// Handle different format types
|
|
97
|
-
switch (format) {
|
|
98
|
-
case 'content-only':
|
|
99
|
-
if (artifact.content) {
|
|
100
|
-
response.content = artifact.content;
|
|
101
|
-
}
|
|
102
|
-
response.contentType = this.detectContentType(artifact);
|
|
103
|
-
break;
|
|
104
|
-
case 'metadata-only':
|
|
105
|
-
if (includeMetadata && artifact.metadata) {
|
|
106
|
-
response.metadata = this.enrichMetadata(artifact.metadata);
|
|
107
|
-
}
|
|
108
|
-
break;
|
|
109
|
-
case 'summary':
|
|
110
|
-
response.name = artifact.metadata?.name || 'Unknown';
|
|
111
|
-
response.description = artifact.metadata?.description || '';
|
|
112
|
-
response.author = artifact.metadata?.author || '';
|
|
113
|
-
response.category = artifact.metadata?.category || '';
|
|
114
|
-
response.version = artifact.metadata?.version || '';
|
|
115
|
-
response.lastUpdated = artifact.lastUpdated;
|
|
116
|
-
break;
|
|
117
|
-
default: // 'full'
|
|
118
|
-
// Include basic artifact information
|
|
119
|
-
response.name = artifact.metadata?.name || 'Unknown';
|
|
120
|
-
response.author = artifact.metadata?.author || '';
|
|
121
|
-
response.category = artifact.metadata?.category || '';
|
|
122
|
-
response.subcategory = artifact.metadata?.subcategory || '';
|
|
123
|
-
response.technology = artifact.metadata?.technology || null;
|
|
124
|
-
response.version = artifact.metadata?.version || '';
|
|
125
|
-
response.lastUpdated = artifact.lastUpdated;
|
|
126
|
-
response.publishedAt = artifact.publishedAt;
|
|
127
|
-
// Include content if requested
|
|
128
|
-
if (includeContent && artifact.content) {
|
|
129
|
-
response.content = artifact.content;
|
|
130
|
-
response.contentType = this.detectContentType(artifact);
|
|
131
|
-
response.contentSize = artifact.content.length;
|
|
132
|
-
}
|
|
133
|
-
// Include metadata if requested
|
|
134
|
-
if (includeMetadata && artifact.metadata) {
|
|
135
|
-
response.metadata = this.enrichMetadata(artifact.metadata);
|
|
136
|
-
}
|
|
137
|
-
// Include examples if requested
|
|
138
|
-
if (includeExamples && artifact.examples) {
|
|
139
|
-
response.examples = this.processExamples(artifact.examples);
|
|
140
|
-
}
|
|
141
|
-
// Include dependencies if requested
|
|
142
|
-
if (includeDependencies && artifact.metadata?.dependencies) {
|
|
143
|
-
response.dependencies = await this.enrichDependencies(artifact.metadata.dependencies);
|
|
144
|
-
}
|
|
145
|
-
// Include version history if requested
|
|
146
|
-
if (includeVersionHistory) {
|
|
147
|
-
response.versionHistory = await this.getVersionHistory(artifact.path);
|
|
148
|
-
}
|
|
149
|
-
// Add usage and statistics
|
|
150
|
-
response.usage = {
|
|
151
|
-
downloadCount: this.getDownloadCount(artifact),
|
|
152
|
-
rating: this.calculateRating(artifact),
|
|
153
|
-
lastAccessed: this.getLastAccessTime()
|
|
154
|
-
};
|
|
155
|
-
// Add related artifacts
|
|
156
|
-
response.related = await this.getRelatedArtifacts(artifact);
|
|
157
|
-
break;
|
|
158
|
-
}
|
|
159
|
-
// Add retrieval metadata
|
|
160
|
-
response.retrievalMetadata = {
|
|
161
|
-
timestamp: new Date().toISOString(),
|
|
162
|
-
format,
|
|
163
|
-
includedSections: this.getIncludedSections(options),
|
|
164
|
-
cacheable: true,
|
|
165
|
-
sourceApi: 'UCM-v1'
|
|
166
|
-
};
|
|
167
|
-
return response;
|
|
168
|
-
}
|
|
169
|
-
enrichMetadata(metadata) {
|
|
170
|
-
return {
|
|
171
|
-
...metadata,
|
|
172
|
-
// Add computed fields
|
|
173
|
-
isLatestVersion: this.isLatestVersion(metadata.version),
|
|
174
|
-
qualityScore: this.calculateQualityScore(metadata),
|
|
175
|
-
complexity: this.estimateComplexity(metadata),
|
|
176
|
-
maturityLevel: this.assessMaturityLevel(metadata),
|
|
177
|
-
// Sanitize sensitive data
|
|
178
|
-
dependencies: metadata.dependencies ? {
|
|
179
|
-
...metadata.dependencies,
|
|
180
|
-
// Remove any potential secrets from dependency configs
|
|
181
|
-
external: this.sanitizeExternalDependencies(metadata.dependencies.external)
|
|
182
|
-
} : undefined
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
processExamples(examples) {
|
|
186
|
-
return examples.map((example, index) => ({
|
|
187
|
-
id: index + 1,
|
|
188
|
-
title: example.title || `Example ${index + 1}`,
|
|
189
|
-
description: example.description || '',
|
|
190
|
-
code: example.code || example.content || '',
|
|
191
|
-
language: example.language || this.detectLanguage(example.code),
|
|
192
|
-
complexity: example.complexity || 'intermediate',
|
|
193
|
-
category: example.category || 'usage',
|
|
194
|
-
runnable: example.runnable !== false, // Default to true
|
|
195
|
-
dependencies: example.dependencies || []
|
|
196
|
-
}));
|
|
197
|
-
}
|
|
198
|
-
async enrichDependencies(dependencies) {
|
|
199
|
-
const enriched = {
|
|
200
|
-
services: dependencies.services || [],
|
|
201
|
-
commands: dependencies.commands || [],
|
|
202
|
-
external: dependencies.external || {}
|
|
203
|
-
};
|
|
204
|
-
// Add dependency resolution information
|
|
205
|
-
enriched.resolution = {
|
|
206
|
-
resolvable: await this.checkDependencyResolution(dependencies),
|
|
207
|
-
missing: await this.findMissingDependencies(dependencies),
|
|
208
|
-
conflicts: await this.detectDependencyConflicts(dependencies)
|
|
209
|
-
};
|
|
210
|
-
return enriched;
|
|
211
|
-
}
|
|
212
|
-
async getVersionHistory(artifactPath) {
|
|
213
|
-
try {
|
|
214
|
-
// Parse the path to get component parts
|
|
215
|
-
const parsed = parsePath(artifactPath);
|
|
216
|
-
const versions = await this.ucmClient.getArtifactVersions(parsed.author, parsed.category, parsed.subcategory);
|
|
217
|
-
return versions.map(version => ({
|
|
218
|
-
version: version.metadata?.version || '',
|
|
219
|
-
publishedAt: version.publishedAt,
|
|
220
|
-
contractVersion: version.metadata?.contractVersion,
|
|
221
|
-
changesSummary: this.generateChangesSummary(version),
|
|
222
|
-
isBreaking: this.isBreakingChange(version),
|
|
223
|
-
downloadCount: this.getDownloadCount(version)
|
|
224
|
-
}));
|
|
225
|
-
}
|
|
226
|
-
catch (error) {
|
|
227
|
-
this.logger.warn('GetArtifactController', 'Failed to get version history', '', error);
|
|
228
|
-
return [];
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
async getRelatedArtifacts(artifact) {
|
|
232
|
-
try {
|
|
233
|
-
// Find related artifacts based on category, author, and tags
|
|
234
|
-
const searchTerms = [
|
|
235
|
-
artifact.metadata?.category,
|
|
236
|
-
artifact.metadata?.subcategory,
|
|
237
|
-
...(artifact.metadata?.tags || [])
|
|
238
|
-
].filter(Boolean).join(' ');
|
|
239
|
-
if (!searchTerms)
|
|
240
|
-
return [];
|
|
241
|
-
const related = await this.ucmClient.searchArtifacts({
|
|
242
|
-
category: artifact.metadata?.category,
|
|
243
|
-
subcategory: artifact.metadata?.subcategory,
|
|
244
|
-
limit: 5
|
|
245
|
-
});
|
|
246
|
-
// Filter out the current artifact and format results
|
|
247
|
-
return related
|
|
248
|
-
.filter(rel => rel.path !== artifact.path)
|
|
249
|
-
.slice(0, 3)
|
|
250
|
-
.map(rel => ({
|
|
251
|
-
name: rel.metadata?.name || 'Unknown',
|
|
252
|
-
path: rel.path,
|
|
253
|
-
category: rel.metadata?.category,
|
|
254
|
-
description: rel.metadata?.description?.substring(0, 100) + '...' || '',
|
|
255
|
-
similarity: this.calculateSimilarity(artifact, rel)
|
|
256
|
-
}));
|
|
257
|
-
}
|
|
258
|
-
catch (error) {
|
|
259
|
-
this.logger.debug('GetArtifactController', 'Could not fetch related artifacts', '', error);
|
|
260
|
-
return [];
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
detectContentType(artifact) {
|
|
264
|
-
const path = artifact.path || '';
|
|
265
|
-
const content = artifact.content || '';
|
|
266
|
-
if (path.includes('/typescript/') || content.includes('interface ') || content.includes('export class')) {
|
|
267
|
-
return 'typescript';
|
|
268
|
-
}
|
|
269
|
-
if (path.includes('/javascript/') || content.includes('function ') || content.includes('const ')) {
|
|
270
|
-
return 'javascript';
|
|
271
|
-
}
|
|
272
|
-
if (path.includes('/python/') || content.includes('def ') || content.includes('import ')) {
|
|
273
|
-
return 'python';
|
|
274
|
-
}
|
|
275
|
-
if (content.includes('```') || content.includes('# ')) {
|
|
276
|
-
return 'markdown';
|
|
277
|
-
}
|
|
278
|
-
return 'text';
|
|
279
|
-
}
|
|
280
|
-
detectLanguage(code) {
|
|
281
|
-
if (!code)
|
|
282
|
-
return 'text';
|
|
283
|
-
if (code.includes('interface ') || code.includes('export class'))
|
|
284
|
-
return 'typescript';
|
|
285
|
-
if (code.includes('function ') || code.includes('const '))
|
|
286
|
-
return 'javascript';
|
|
287
|
-
if (code.includes('def ') || code.includes('import '))
|
|
288
|
-
return 'python';
|
|
289
|
-
if (code.includes('<?php'))
|
|
290
|
-
return 'php';
|
|
291
|
-
if (code.includes('public class'))
|
|
292
|
-
return 'java';
|
|
293
|
-
return 'text';
|
|
294
|
-
}
|
|
295
|
-
getIncludedSections(options) {
|
|
296
|
-
const sections = [];
|
|
297
|
-
if (options.includeContent)
|
|
298
|
-
sections.push('content');
|
|
299
|
-
if (options.includeMetadata)
|
|
300
|
-
sections.push('metadata');
|
|
301
|
-
if (options.includeExamples)
|
|
302
|
-
sections.push('examples');
|
|
303
|
-
if (options.includeDependencies)
|
|
304
|
-
sections.push('dependencies');
|
|
305
|
-
if (options.includeVersionHistory)
|
|
306
|
-
sections.push('versionHistory');
|
|
307
|
-
return sections;
|
|
308
|
-
}
|
|
309
|
-
// Helper methods for metadata enrichment
|
|
310
|
-
isLatestVersion(_version) {
|
|
311
|
-
// In a real implementation, this would check against the latest version
|
|
312
|
-
return true; // Simplified
|
|
313
|
-
}
|
|
314
|
-
calculateQualityScore(metadata) {
|
|
315
|
-
let score = 50; // Base score
|
|
316
|
-
if (metadata.description && metadata.description.length > 20)
|
|
317
|
-
score += 20;
|
|
318
|
-
if (metadata.tags && metadata.tags.length > 0)
|
|
319
|
-
score += 10;
|
|
320
|
-
if (metadata.dependencies)
|
|
321
|
-
score += 10;
|
|
322
|
-
if (metadata.contractVersion)
|
|
323
|
-
score += 10;
|
|
324
|
-
return Math.min(score, 100);
|
|
325
|
-
}
|
|
326
|
-
estimateComplexity(metadata) {
|
|
327
|
-
const depCount = (metadata.dependencies?.services?.length || 0) +
|
|
328
|
-
(metadata.dependencies?.commands?.length || 0);
|
|
329
|
-
if (depCount === 0)
|
|
330
|
-
return 'simple';
|
|
331
|
-
if (depCount <= 3)
|
|
332
|
-
return 'moderate';
|
|
333
|
-
return 'complex';
|
|
334
|
-
}
|
|
335
|
-
assessMaturityLevel(metadata) {
|
|
336
|
-
const version = metadata.version || '0.0.0';
|
|
337
|
-
const [major] = version.split('.');
|
|
338
|
-
if (parseInt(major) >= 1)
|
|
339
|
-
return 'stable';
|
|
340
|
-
if (version.startsWith('0.'))
|
|
341
|
-
return 'beta';
|
|
342
|
-
return 'alpha';
|
|
343
|
-
}
|
|
344
|
-
sanitizeExternalDependencies(external) {
|
|
345
|
-
if (!external)
|
|
346
|
-
return {};
|
|
347
|
-
const sanitized = {};
|
|
348
|
-
for (const [key, value] of Object.entries(external)) {
|
|
349
|
-
// Remove potential secrets from configuration
|
|
350
|
-
if (typeof value === 'string' && (key.toLowerCase().includes('secret') || key.toLowerCase().includes('key'))) {
|
|
351
|
-
sanitized[key] = '[REDACTED]';
|
|
352
|
-
}
|
|
353
|
-
else {
|
|
354
|
-
sanitized[key] = value;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
return sanitized;
|
|
358
|
-
}
|
|
359
|
-
// Simplified implementations for demo purposes
|
|
360
|
-
async checkDependencyResolution(_dependencies) {
|
|
361
|
-
return true; // Simplified
|
|
362
|
-
}
|
|
363
|
-
async findMissingDependencies(_dependencies) {
|
|
364
|
-
return []; // Simplified
|
|
365
|
-
}
|
|
366
|
-
async detectDependencyConflicts(_dependencies) {
|
|
367
|
-
return []; // Simplified
|
|
368
|
-
}
|
|
369
|
-
generateChangesSummary(_version) {
|
|
370
|
-
return 'Changes not tracked'; // Simplified
|
|
371
|
-
}
|
|
372
|
-
isBreakingChange(_version) {
|
|
373
|
-
return false; // Simplified
|
|
374
|
-
}
|
|
375
|
-
getDownloadCount(_artifact) {
|
|
376
|
-
return Math.floor(Math.random() * 1000); // Simulated
|
|
377
|
-
}
|
|
378
|
-
calculateRating(_artifact) {
|
|
379
|
-
return 3.0 + Math.random() * 2; // Simulated
|
|
380
|
-
}
|
|
381
|
-
getLastAccessTime() {
|
|
382
|
-
return new Date().toISOString();
|
|
383
|
-
}
|
|
384
|
-
calculateSimilarity(artifact1, artifact2) {
|
|
385
|
-
// Simple similarity calculation based on shared tags and category
|
|
386
|
-
let similarity = 0;
|
|
387
|
-
if (artifact1.metadata?.category === artifact2.metadata?.category) {
|
|
388
|
-
similarity += 0.4;
|
|
389
|
-
}
|
|
390
|
-
const tags1 = artifact1.metadata?.tags || [];
|
|
391
|
-
const tags2 = artifact2.metadata?.tags || [];
|
|
392
|
-
const sharedTags = tags1.filter((tag) => tags2.includes(tag));
|
|
393
|
-
similarity += (sharedTags.length / Math.max(tags1.length, tags2.length, 1)) * 0.6;
|
|
394
|
-
return Math.round(similarity * 100) / 100;
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
//# sourceMappingURL=GetArtifactController.js.map
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { BaseToolController } from '../base/BaseToolController.js';
|
|
2
|
-
import { UcmApiClient } from '../../clients/UcmLocalApiClient.js';
|
|
3
|
-
import { ILogger } from '../../interfaces/ILogger.js';
|
|
4
|
-
export declare class GetLatestController extends BaseToolController {
|
|
5
|
-
constructor(ucmClient: UcmApiClient, logger: ILogger);
|
|
6
|
-
get name(): string;
|
|
7
|
-
get description(): string;
|
|
8
|
-
get inputSchema(): any;
|
|
9
|
-
protected handleExecute(params: any): Promise<any>;
|
|
10
|
-
private validateBasePath;
|
|
11
|
-
private getMostRecentVersion;
|
|
12
|
-
private buildLatestResponse;
|
|
13
|
-
private getVersionComparison;
|
|
14
|
-
private getChangeLog;
|
|
15
|
-
private compareVersions;
|
|
16
|
-
private detectContentType;
|
|
17
|
-
private calculateQualityScore;
|
|
18
|
-
private assessMaturityLevel;
|
|
19
|
-
private assessStability;
|
|
20
|
-
private determineReleaseType;
|
|
21
|
-
private determineLifecycleStage;
|
|
22
|
-
private determineSupportStatus;
|
|
23
|
-
private predictNextVersion;
|
|
24
|
-
private getDownloadCount;
|
|
25
|
-
private calculateRating;
|
|
26
|
-
private getRecentAccessCount;
|
|
27
|
-
private calculateTrendingScore;
|
|
28
|
-
private shouldRecommendUpgrade;
|
|
29
|
-
private requiresMigration;
|
|
30
|
-
private getDeprecationWarnings;
|
|
31
|
-
private getSecurityAlerts;
|
|
32
|
-
private calculateVersionJump;
|
|
33
|
-
private calculateTimespan;
|
|
34
|
-
private detectBreakingChanges;
|
|
35
|
-
private detectNewFeatures;
|
|
36
|
-
private detectImprovements;
|
|
37
|
-
private generateEstimatedChanges;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=GetLatestController.d.ts.map
|