@likec4/language-server 1.37.0 → 1.38.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/LikeC4LanguageServices.d.ts +7 -4
- package/dist/LikeC4LanguageServices.js +12 -2
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +1 -1
- package/dist/bundled.mjs +4263 -3104
- package/dist/empty.d.ts +2 -0
- package/dist/empty.js +1 -0
- package/dist/filesystem/ChokidarWatcher.d.ts +14 -0
- package/dist/filesystem/ChokidarWatcher.js +64 -0
- package/dist/filesystem/FileSystemWatcher.d.ts +19 -0
- package/dist/filesystem/FileSystemWatcher.js +11 -0
- package/dist/filesystem/LikeC4FileSystem.d.ts +5 -0
- package/dist/filesystem/LikeC4FileSystem.js +56 -0
- package/dist/filesystem/index.d.ts +20 -0
- package/dist/filesystem/index.js +16 -0
- package/dist/index.d.ts +18 -4
- package/dist/index.js +23 -10
- package/dist/mcp/{sseserver/MCPServerFactory.d.ts → MCPServerFactory.d.ts} +1 -1
- package/dist/mcp/MCPServerFactory.js +69 -0
- package/dist/mcp/NoopLikeC4MCPServer.d.ts +4 -10
- package/dist/mcp/NoopLikeC4MCPServer.js +5 -10
- package/dist/mcp/interfaces.d.ts +7 -5
- package/dist/mcp/interfaces.js +4 -0
- package/dist/mcp/server/StdioLikeC4MCPServer.d.ts +16 -0
- package/dist/mcp/server/StdioLikeC4MCPServer.js +43 -0
- package/dist/mcp/{sseserver/MCPServer.d.ts → server/StreamableLikeC4MCPServer.d.ts} +3 -2
- package/dist/mcp/server/StreamableLikeC4MCPServer.js +156 -0
- package/dist/mcp/server/WithMCPServer.d.ts +2 -0
- package/dist/mcp/server/WithMCPServer.js +57 -0
- package/dist/mcp/tools/_common.d.ts +24 -5
- package/dist/mcp/tools/_common.js +31 -3
- package/dist/mcp/tools/find-relationships.d.ts +13 -0
- package/dist/mcp/tools/find-relationships.js +151 -0
- package/dist/mcp/tools/list-projects.js +40 -12
- package/dist/mcp/tools/open-view.d.ts +4 -3
- package/dist/mcp/tools/open-view.js +37 -14
- package/dist/mcp/tools/{read-project-elements.d.ts → read-deployment.d.ts} +6 -3
- package/dist/mcp/tools/read-deployment.js +130 -0
- package/dist/mcp/tools/read-element.d.ts +4 -3
- package/dist/mcp/tools/read-element.js +114 -51
- package/dist/mcp/tools/read-project-summary.d.ts +3 -2
- package/dist/mcp/tools/read-project-summary.js +139 -32
- package/dist/mcp/tools/read-view.d.ts +4 -3
- package/dist/mcp/tools/read-view.js +146 -105
- package/dist/mcp/tools/search-element.js +81 -30
- package/dist/mcp/utils.js +7 -4
- package/dist/module.d.ts +9 -9
- package/dist/module.js +24 -29
- package/dist/protocol.d.ts +1 -1
- package/dist/protocol.js +1 -1
- package/dist/test/testServices.js +3 -2
- package/dist/workspace/ProjectsManager.js +5 -2
- package/dist/workspace/WorkspaceManager.d.ts +9 -2
- package/dist/workspace/WorkspaceManager.js +30 -39
- package/package.json +14 -10
- package/dist/LikeC4FileSystem.d.ts +0 -14
- package/dist/LikeC4FileSystem.js +0 -39
- package/dist/mcp/sseserver/MCPServer.js +0 -80
- package/dist/mcp/sseserver/MCPServerFactory.js +0 -50
- package/dist/mcp/sseserver/WithMCPServer.d.ts +0 -9
- package/dist/mcp/sseserver/WithMCPServer.js +0 -53
- package/dist/mcp/tools/read-project-elements.js +0 -93
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { invariant } from "@likec4/core";
|
|
2
|
-
import z from "zod";
|
|
3
|
-
import { safeCall } from "../../utils/index.js";
|
|
4
|
-
import { ProjectsManager } from "../../workspace/index.js";
|
|
5
|
-
import { likec4Tool } from "../utils.js";
|
|
6
|
-
import { locationSchema } from "./_common.js";
|
|
7
|
-
const elementSchema = z.array(
|
|
8
|
-
z.discriminatedUnion("type", [
|
|
9
|
-
z.object({
|
|
10
|
-
type: z.literal("logical"),
|
|
11
|
-
id: z.string().describe("Element ID (FQN)"),
|
|
12
|
-
kind: z.string(),
|
|
13
|
-
title: z.string(),
|
|
14
|
-
description: z.string().nullish(),
|
|
15
|
-
technology: z.string().nullish(),
|
|
16
|
-
shape: z.string(),
|
|
17
|
-
tags: z.array(z.string()),
|
|
18
|
-
defaultView: z.string().nullish().describe("Name of the default view of this element"),
|
|
19
|
-
sourceLocation: locationSchema.nullish()
|
|
20
|
-
}),
|
|
21
|
-
z.object({
|
|
22
|
-
type: z.literal("deployment-node"),
|
|
23
|
-
id: z.string().describe("Deployment ID (FQN)"),
|
|
24
|
-
kind: z.string(),
|
|
25
|
-
title: z.string(),
|
|
26
|
-
description: z.string().nullish(),
|
|
27
|
-
technology: z.string().nullish(),
|
|
28
|
-
shape: z.string(),
|
|
29
|
-
tags: z.array(z.string()),
|
|
30
|
-
defaultView: z.string().nullish().describe("Name of the default view of this element"),
|
|
31
|
-
sourceLocation: locationSchema.nullish()
|
|
32
|
-
})
|
|
33
|
-
])
|
|
34
|
-
);
|
|
35
|
-
export const readProjectElements = likec4Tool({
|
|
36
|
-
name: "read-project-elements",
|
|
37
|
-
annotations: {
|
|
38
|
-
readOnlyHint: true
|
|
39
|
-
},
|
|
40
|
-
description: `
|
|
41
|
-
Returns array of all elements in the project:
|
|
42
|
-
- type (logical or deployment-node)
|
|
43
|
-
- id (FQN)
|
|
44
|
-
- kind
|
|
45
|
-
- title, description and technology
|
|
46
|
-
- shape
|
|
47
|
-
- assigned tags
|
|
48
|
-
- name of the default view of this element if any (applies to logical elements only)
|
|
49
|
-
- source location (where the element is defined, if running in the editor)
|
|
50
|
-
`,
|
|
51
|
-
inputSchema: {
|
|
52
|
-
project: z.string().optional().describe('Project name (optional, will use "default" if not specified)')
|
|
53
|
-
},
|
|
54
|
-
outputSchema: {
|
|
55
|
-
elements: elementSchema
|
|
56
|
-
}
|
|
57
|
-
}, async (languageServices, args) => {
|
|
58
|
-
const projectId = args.project ?? ProjectsManager.DefaultProjectId;
|
|
59
|
-
const project = languageServices.projects().find((p) => p.id === projectId);
|
|
60
|
-
invariant(project, `Project "${projectId}" not found`);
|
|
61
|
-
const model = await languageServices.computedModel(project.id);
|
|
62
|
-
const elements = [];
|
|
63
|
-
for (const el of model.elements()) {
|
|
64
|
-
elements.push({
|
|
65
|
-
type: "logical",
|
|
66
|
-
id: el.id,
|
|
67
|
-
title: el.title,
|
|
68
|
-
description: el.description.text,
|
|
69
|
-
technology: el.technology,
|
|
70
|
-
kind: el.kind,
|
|
71
|
-
tags: [...el.tags],
|
|
72
|
-
shape: el.shape,
|
|
73
|
-
defaultView: el.defaultView?.id,
|
|
74
|
-
sourceLocation: safeCall(() => languageServices.locate({ element: el.id, projectId }))
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
for (const el of model.deployment.nodes()) {
|
|
78
|
-
elements.push({
|
|
79
|
-
type: "deployment-node",
|
|
80
|
-
id: el.id,
|
|
81
|
-
title: el.title,
|
|
82
|
-
description: el.description.text,
|
|
83
|
-
technology: el.technology,
|
|
84
|
-
kind: el.kind,
|
|
85
|
-
tags: [...el.tags],
|
|
86
|
-
shape: el.shape,
|
|
87
|
-
sourceLocation: safeCall(() => languageServices.locate({ deployment: el.id, projectId }))
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
return {
|
|
91
|
-
elements
|
|
92
|
-
};
|
|
93
|
-
});
|