@likec4/language-server 1.37.0 → 1.38.1
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 +8 -4
- package/dist/LikeC4LanguageServices.js +12 -2
- package/dist/Rpc.js +2 -2
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +1 -1
- package/dist/bundled.mjs +4259 -3106
- 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/model/builder/MergedSpecification.d.ts +1 -1
- package/dist/model/builder/buildModel.d.ts +1 -1
- 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/LangiumDocuments.d.ts +4 -1
- package/dist/workspace/LangiumDocuments.js +15 -0
- package/dist/workspace/ProjectsManager.d.ts +1 -1
- package/dist/workspace/ProjectsManager.js +18 -19
- package/dist/workspace/WorkspaceManager.d.ts +9 -2
- package/dist/workspace/WorkspaceManager.js +30 -39
- package/package.json +16 -12
- 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
|
@@ -19,15 +19,17 @@ export interface LikeC4LanguageServices {
|
|
|
19
19
|
id: ProjectId;
|
|
20
20
|
folder: URI;
|
|
21
21
|
title: string;
|
|
22
|
-
documents:
|
|
22
|
+
documents: ReadonlyArray<URI>;
|
|
23
23
|
}>;
|
|
24
24
|
/**
|
|
25
25
|
* Returns project by ID
|
|
26
|
+
* If no project ID is specified, returns default project
|
|
26
27
|
*/
|
|
27
|
-
project(projectId
|
|
28
|
+
project(projectId?: ProjectId): {
|
|
28
29
|
id: ProjectId;
|
|
29
30
|
folder: URI;
|
|
30
31
|
title: string;
|
|
32
|
+
documents: ReadonlyArray<URI>;
|
|
31
33
|
};
|
|
32
34
|
/**
|
|
33
35
|
* Returns diagrams (i.e. views with layout computed) for the specified project
|
|
@@ -44,6 +46,7 @@ export interface LikeC4LanguageServices {
|
|
|
44
46
|
}>;
|
|
45
47
|
/**
|
|
46
48
|
* Notifies the language server about changes in the workspace
|
|
49
|
+
* @deprecated use watcher instead
|
|
47
50
|
*/
|
|
48
51
|
notifyUpdate(update: {
|
|
49
52
|
changed?: string;
|
|
@@ -72,12 +75,13 @@ export declare class DefaultLikeC4LanguageServices implements LikeC4LanguageServ
|
|
|
72
75
|
id: ProjectId;
|
|
73
76
|
folder: URI;
|
|
74
77
|
title: string;
|
|
75
|
-
documents:
|
|
78
|
+
documents: ReadonlyArray<URI>;
|
|
76
79
|
}>;
|
|
77
|
-
project(projectId
|
|
80
|
+
project(projectId?: ProjectId): {
|
|
78
81
|
id: ProjectId;
|
|
79
82
|
folder: URI;
|
|
80
83
|
title: string;
|
|
84
|
+
documents: ReadonlyArray<URI>;
|
|
81
85
|
};
|
|
82
86
|
/**
|
|
83
87
|
* Diagram is a computed view, layouted using Graphviz
|
|
@@ -43,20 +43,30 @@ export class DefaultLikeC4LanguageServices {
|
|
|
43
43
|
return projectsWithDocs;
|
|
44
44
|
}
|
|
45
45
|
const { folderUri, config } = projectsManager.getProject(ProjectsManager.DefaultProjectId);
|
|
46
|
+
const documents = map(
|
|
47
|
+
this.services.shared.workspace.LangiumDocuments.projectDocuments(ProjectsManager.DefaultProjectId).toArray(),
|
|
48
|
+
prop("uri")
|
|
49
|
+
);
|
|
46
50
|
return [{
|
|
47
51
|
id: ProjectsManager.DefaultProjectId,
|
|
48
52
|
folder: folderUri,
|
|
49
53
|
title: config.title ?? config.name,
|
|
50
|
-
documents
|
|
54
|
+
documents
|
|
51
55
|
}];
|
|
52
56
|
}
|
|
53
57
|
project(projectId) {
|
|
58
|
+
projectId = this.projectsManager.ensureProjectId(projectId);
|
|
54
59
|
const projectsManager = this.services.shared.workspace.ProjectsManager;
|
|
55
60
|
const { folderUri, config } = projectsManager.getProject(projectId);
|
|
61
|
+
const documents = map(
|
|
62
|
+
this.services.shared.workspace.LangiumDocuments.projectDocuments(projectId).toArray(),
|
|
63
|
+
prop("uri")
|
|
64
|
+
);
|
|
56
65
|
return {
|
|
57
66
|
id: projectId,
|
|
58
67
|
folder: folderUri,
|
|
59
|
-
title: config.title ?? config.name
|
|
68
|
+
title: config.title ?? config.name,
|
|
69
|
+
documents
|
|
60
70
|
};
|
|
61
71
|
}
|
|
62
72
|
/**
|
package/dist/Rpc.js
CHANGED
|
@@ -65,8 +65,8 @@ export class Rpc extends ADisposable {
|
|
|
65
65
|
connection.onRequest(FetchComputedModel.req, async ({ projectId, cleanCaches }, cancelToken) => {
|
|
66
66
|
logger.debug`received request ${"fetchComputedModel"} for project ${projectId}`;
|
|
67
67
|
if (cleanCaches) {
|
|
68
|
-
const docs = projectId ? LangiumDocuments.projectDocuments(projectId) : LangiumDocuments.
|
|
69
|
-
const uris = docs.map((d) => d.uri)
|
|
68
|
+
const docs = projectId ? LangiumDocuments.projectDocuments(projectId) : LangiumDocuments.allExcludingBuiltin;
|
|
69
|
+
const uris = docs.toArray().map((d) => d.uri);
|
|
70
70
|
await DocumentBuilder.update(uris, [], cancelToken);
|
|
71
71
|
}
|
|
72
72
|
const likec4model = await modelBuilder.buildLikeC4Model(projectId, cancelToken);
|
package/dist/browser.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type LikeC4Services, type LikeC4SharedServices } from './module';
|
|
|
2
2
|
export { logger as lspLogger } from './logger';
|
|
3
3
|
export type { DocumentParser, LikeC4ModelBuilder, LikeC4ModelLocator, LikeC4ModelParser } from './model';
|
|
4
4
|
export type { LikeC4LanguageServices } from './LikeC4LanguageServices';
|
|
5
|
-
export {
|
|
5
|
+
export { createLanguageServices } from './module';
|
|
6
6
|
export type { LikeC4Services, LikeC4SharedServices } from './module';
|
|
7
7
|
export type { LikeC4Views } from './views';
|
|
8
8
|
export declare function startLanguageServer(port: MessagePort | DedicatedWorkerGlobalScope): {
|
package/dist/browser.js
CHANGED
|
@@ -3,7 +3,7 @@ import { startLanguageServer as startLanguim } from "langium/lsp";
|
|
|
3
3
|
import { BrowserMessageReader, BrowserMessageWriter, createConnection } from "vscode-languageserver/browser";
|
|
4
4
|
import { createLanguageServices } from "./module.js";
|
|
5
5
|
export { logger as lspLogger } from "./logger.js";
|
|
6
|
-
export {
|
|
6
|
+
export { createLanguageServices } from "./module.js";
|
|
7
7
|
export function startLanguageServer(port) {
|
|
8
8
|
const messageReader = new BrowserMessageReader(port);
|
|
9
9
|
const messageWriter = new BrowserMessageWriter(port);
|