@likec4/language-server 1.49.0 → 1.50.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.
Files changed (41) hide show
  1. package/dist/_chunks/ConfigurableLayouter.mjs +1 -1
  2. package/dist/_chunks/LikeC4FileSystem.mjs +3 -3
  3. package/dist/_chunks/WithMCPServer.mjs +686 -13
  4. package/dist/_chunks/common-exports.mjs +0 -0
  5. package/dist/_chunks/libs/@msgpack/msgpack.mjs +1 -1
  6. package/dist/_chunks/libs/eventemitter3.mjs +1 -1
  7. package/dist/_chunks/libs/fast-equals.mjs +1 -1
  8. package/dist/_chunks/libs/p-queue.mjs +1 -1
  9. package/dist/_chunks/libs/picomatch.mjs +1 -1
  10. package/dist/_chunks/libs/pretty-ms.mjs +1 -1
  11. package/dist/_chunks/libs/remeda.mjs +2 -1
  12. package/dist/_chunks/libs/ufo.mjs +1 -1
  13. package/dist/_chunks/likec4lib.mjs +2 -0
  14. package/dist/_chunks/{index.d.mts → module.d.mts} +247 -7
  15. package/dist/_chunks/module.mjs +34 -0
  16. package/dist/_chunks/noop.mjs +1 -0
  17. package/dist/_chunks/protocol.d.mts +315 -0
  18. package/dist/_chunks/rolldown-runtime.mjs +1 -1
  19. package/dist/_chunks/utils.mjs +1 -1
  20. package/dist/_chunks/workspace.mjs +1 -0
  21. package/dist/browser/index.d.mts +7 -2
  22. package/dist/browser/index.mjs +1 -1
  23. package/dist/browser/worker.mjs +1 -1
  24. package/dist/bundled.d.mts +2 -2
  25. package/dist/bundled.mjs +1 -1
  26. package/dist/filesystem/index.d.mts +3 -2
  27. package/dist/filesystem/index.mjs +1 -1
  28. package/dist/index.d.mts +2 -38
  29. package/dist/index.mjs +1 -1
  30. package/dist/likec4lib.mjs +1 -1
  31. package/dist/mcp/index.d.mts +3 -2
  32. package/dist/mcp/index.mjs +1 -1
  33. package/dist/module.d.mts +2 -125
  34. package/dist/module.mjs +1 -1
  35. package/dist/protocol.d.mts +1 -314
  36. package/dist/protocol.mjs +1 -1
  37. package/package.json +15 -15
  38. package/dist/_chunks/LikeC4Views.mjs +0 -34
  39. package/dist/_chunks/ProjectsManager.mjs +0 -1
  40. package/dist/_chunks/icons.mjs +0 -2
  41. package/dist/_chunks/logger.mjs +0 -1
@@ -1,315 +1,2 @@
1
- import { DiagnosticSeverity, DocumentUri, Location, Position, Range, URI } from "vscode-languageserver-types";
2
- import { ColorLiteral, ComputedLikeC4ModelData, DeploymentFqn, DiagramView, Fqn, LayoutedLikeC4ModelData, LayoutedProjectsView, NonEmptyArray, ProjectId, RelationId, ViewChange, ViewId } from "@likec4/core";
3
- import { LikeC4ProjectJsonConfig } from "@likec4/config";
4
- import { NotificationType, NotificationType0, RequestType, RequestType0 } from "vscode-jsonrpc";
5
-
6
- //#region src/protocol.d.ts
7
- declare namespace DidChangeModelNotification {
8
- const type: NotificationType<string>;
9
- type Type = typeof type;
10
- }
11
- /**
12
- * Triggered by the language server when projects changed
13
- * (number of projects changed, names changed, etc)
14
- */
15
- declare namespace DidChangeProjectsNotification {
16
- const type: NotificationType0;
17
- type Type = typeof type;
18
- }
19
- /**
20
- * When the snapshot of a manual layout changes
21
- * Send by the editor to the language server
22
- */
23
- declare namespace DidChangeSnapshotNotification {
24
- type Params = {
25
- snapshotUri: DocumentUri;
26
- };
27
- const Method: "likec4/onDidChangeSnapshot";
28
- const type: NotificationType<Params>;
29
- type Type = typeof type;
30
- }
31
- /**
32
- * When server requests to open a likec4 preview panel
33
- * (available only in the editor).
34
- * (not the best place, but seems to be working)
35
- */
36
- declare namespace DidRequestOpenViewNotification {
37
- type Params = {
38
- viewId: ViewId;
39
- projectId: ProjectId;
40
- };
41
- const type: NotificationType<Params>;
42
- type Type = typeof type;
43
- }
44
- /**
45
- * Request to fetch the computed model data
46
- * If LSP has multiple projects, the projectId is required.
47
- * otherwise throws an error.
48
- */
49
- declare namespace FetchComputedModel {
50
- type Params = {
51
- projectId?: string | undefined;
52
- cleanCaches?: boolean | undefined;
53
- };
54
- type Res = {
55
- model: ComputedLikeC4ModelData | null;
56
- };
57
- const req: RequestType<Params, Res, void>;
58
- type Req = typeof req;
59
- }
60
- /**
61
- * Request to fetch all views of all projects
62
- */
63
- declare namespace FetchViewsFromAllProjects {
64
- type Res = {
65
- views: Array<{
66
- id: ViewId;
67
- title: string;
68
- projectId: ProjectId;
69
- }>;
70
- };
71
- const req: RequestType0<Res, void>;
72
- type Req = typeof req;
73
- }
74
- /**
75
- * Request to fetch the layouted model data
76
- * If LSP has multiple projects, the projectId is required.
77
- * otherwise throws an error.
78
- */
79
- declare namespace FetchLayoutedModel {
80
- type Params = {
81
- projectId?: string | undefined;
82
- };
83
- type Res = {
84
- model: LayoutedLikeC4ModelData | null;
85
- };
86
- const req: RequestType<Params, Res, void>;
87
- type Req = typeof req;
88
- }
89
- /**
90
- * Request to layout a view.
91
- * If LSP has multiple projects, the projectId is required.
92
- */
93
- declare namespace LayoutView {
94
- type Params = {
95
- viewId: ViewId;
96
- projectId?: string | undefined;
97
- layoutType?: 'auto' | 'manual' | undefined;
98
- };
99
- type Res = {
100
- result: {
101
- dot: string;
102
- diagram: DiagramView;
103
- } | null;
104
- };
105
- const req: RequestType<Params, Res, void>;
106
- type Req = typeof req;
107
- }
108
- /**
109
- * Request to validate all views
110
- * If projects ID is provided, it will validate only the views of that project.
111
- */
112
- declare namespace ValidateLayout {
113
- type Params = {
114
- projectId?: string;
115
- };
116
- type Res = {
117
- result: {
118
- uri: string;
119
- viewId: ViewId;
120
- message: string;
121
- severity: DiagnosticSeverity;
122
- range: {
123
- start: Position;
124
- end: Position;
125
- };
126
- }[] | null;
127
- };
128
- const req: RequestType<Params, Res, void>;
129
- type Req = typeof req;
130
- }
131
- /**
132
- * Request to reload projects.
133
- */
134
- declare namespace ReloadProjects {
135
- type Params = never;
136
- type Res = void;
137
- const req: RequestType0<void, void>;
138
- type Req = typeof req;
139
- }
140
- /**
141
- * Fetch all non-empty projects.
142
- */
143
- declare namespace FetchProjects {
144
- type Params = never;
145
- type Res = {
146
- projects: {
147
- [projectId: ProjectId]: {
148
- folder: URI;
149
- config: {
150
- name: string;
151
- title?: string | undefined;
152
- };
153
- docs: NonEmptyArray<DocumentUri>;
154
- };
155
- };
156
- };
157
- const req: RequestType0<Res, void>;
158
- type Req = typeof req;
159
- }
160
- /**
161
- * Request from the client to register a project.
162
- */
163
- declare namespace RegisterProject {
164
- type Params = {
165
- folderUri: URI;
166
- config: LikeC4ProjectJsonConfig;
167
- configUri?: never;
168
- } | {
169
- configUri: URI;
170
- folderUri?: never;
171
- config?: never;
172
- };
173
- type Res = {
174
- id: ProjectId;
175
- };
176
- const req: RequestType<Params, Res, void>;
177
- type Req = typeof req;
178
- }
179
- /**
180
- * Request to build documents.
181
- */
182
- declare namespace BuildDocuments {
183
- type Params = {
184
- docs: DocumentUri[];
185
- };
186
- const req: RequestType<Params, void, void>;
187
- type Req = typeof req;
188
- }
189
- /**
190
- * Request to locate an element, relation, deployment or view.
191
- * If LSP has multiple projects, the projectId is required.
192
- */
193
- declare namespace Locate {
194
- type Params =
195
- /**
196
- * Locate an element by its fqn
197
- */
198
- {
199
- element: Fqn;
200
- projectId?: string | undefined;
201
- property?: string;
202
- }
203
- /**
204
- * Locate a relation by its id
205
- */
206
- | {
207
- projectId?: string | undefined;
208
- relation: RelationId;
209
- }
210
- /**
211
- * Locate a deployment by its fqn
212
- */
213
- | {
214
- deployment: DeploymentFqn;
215
- projectId?: string | undefined;
216
- property?: string;
217
- }
218
- /**
219
- * Locate a step in a dynamic view by its astPath
220
- */
221
- | {
222
- view: ViewId;
223
- astPath: string;
224
- projectId?: string | undefined;
225
- }
226
- /**
227
- * Locate a view by its id
228
- */
229
- | {
230
- view: ViewId;
231
- projectId?: string | undefined;
232
- };
233
- type Res = Location | null;
234
- const req: RequestType<Params, Res, void>;
235
- type Req = typeof req;
236
- }
237
- /**
238
- * Request to change the view
239
- * If LSP has multiple projects, the projectId is required.
240
- */
241
- declare namespace ChangeView {
242
- type Params = {
243
- viewId: ViewId;
244
- change: ViewChange;
245
- projectId?: string | undefined;
246
- };
247
- type Res = {
248
- success: true;
249
- location: Location | null;
250
- } | {
251
- success: false;
252
- location?: Location | null;
253
- error: string;
254
- };
255
- const req: RequestType<Params, Res, void>;
256
- type Req = typeof req;
257
- }
258
- /**
259
- * Request to fetch telemetry metrics
260
- */
261
- declare namespace FetchTelemetryMetrics {
262
- type Res = {
263
- metrics: null | {
264
- elementKinds: number;
265
- deploymentKinds: number;
266
- relationshipKinds: number;
267
- tags: number;
268
- customColors: number;
269
- elements: number;
270
- deploymentNodes: number;
271
- relationships: number;
272
- views: number;
273
- projects: number;
274
- };
275
- };
276
- const req: RequestType0<Res, void>;
277
- type Req = typeof req;
278
- }
279
- /**
280
- * Request to fetch all tags of a document
281
- */
282
- declare namespace GetDocumentTags {
283
- type Params = {
284
- documentUri: DocumentUri;
285
- };
286
- type Res = {
287
- /**
288
- * Project ID this document belongs to (if any)
289
- */
290
- projectId: ProjectId;
291
- /**
292
- * Used tags in the document
293
- */
294
- tags: Array<{
295
- name: string;
296
- range: Range;
297
- color: ColorLiteral;
298
- isSpecification?: boolean;
299
- }>;
300
- };
301
- const req: RequestType<Params, Res, void>;
302
- type Req = typeof req;
303
- }
304
- /**
305
- * Request to fetch projects overview diagram
306
- */
307
- declare namespace FetchProjectsOverview {
308
- type Res = {
309
- projectsView: LayoutedProjectsView | null;
310
- };
311
- const req: RequestType0<Res, void>;
312
- type Req = typeof req;
313
- }
314
- //#endregion
1
+ import { _ as ReloadProjects, a as DidChangeSnapshotNotification, c as FetchLayoutedModel, d as FetchTelemetryMetrics, f as FetchViewsFromAllProjects, g as RegisterProject, h as Locate, i as DidChangeProjectsNotification, l as FetchProjects, m as LayoutView, n as ChangeView, o as DidRequestOpenViewNotification, p as GetDocumentTags, r as DidChangeModelNotification, s as FetchComputedModel, t as BuildDocuments, u as FetchProjectsOverview, v as ValidateLayout } from "./_chunks/protocol.mjs";
315
2
  export { BuildDocuments, ChangeView, DidChangeModelNotification, DidChangeProjectsNotification, DidChangeSnapshotNotification, DidRequestOpenViewNotification, FetchComputedModel, FetchLayoutedModel, FetchProjects, FetchProjectsOverview, FetchTelemetryMetrics, FetchViewsFromAllProjects, GetDocumentTags, LayoutView, Locate, RegisterProject, ReloadProjects, ValidateLayout };
package/dist/protocol.mjs CHANGED
@@ -1 +1 @@
1
- import{NotificationType,NotificationType0,RequestType,RequestType0}from"vscode-jsonrpc";let DidChangeModelNotification;(function(t){t.type=new NotificationType(`likec4/onDidChangeModel`)})(DidChangeModelNotification||={});let DidChangeProjectsNotification;(function(e){e.type=new NotificationType0(`likec4/onDidChangeProjects`)})(DidChangeProjectsNotification||={});let DidChangeSnapshotNotification;(function(t){t.type=new NotificationType(t.Method=`likec4/onDidChangeSnapshot`)})(DidChangeSnapshotNotification||={});let DidRequestOpenViewNotification;(function(t){t.type=new NotificationType(`likec4/onRequestOpenView`)})(DidRequestOpenViewNotification||={});let FetchComputedModel;(function(e){e.req=new RequestType(`likec4/fetchComputedModel`)})(FetchComputedModel||={});let FetchViewsFromAllProjects;(function(e){e.req=new RequestType0(`likec4/fetchViewsFromAllProjects`)})(FetchViewsFromAllProjects||={});let FetchLayoutedModel;(function(e){e.req=new RequestType(`likec4/fetchLayoutedModel`)})(FetchLayoutedModel||={});let LayoutView;(function(e){e.req=new RequestType(`likec4/layout-view`)})(LayoutView||={});let ValidateLayout;(function(e){e.req=new RequestType(`likec4/validate-layout`)})(ValidateLayout||={});let ReloadProjects;(function(e){e.req=new RequestType0(`likec4/reload-projects`)})(ReloadProjects||={});let FetchProjects;(function(e){e.req=new RequestType0(`likec4/fetch-projects`)})(FetchProjects||={});let RegisterProject;(function(e){e.req=new RequestType(`likec4/register-project`)})(RegisterProject||={});let BuildDocuments;(function(e){e.req=new RequestType(`likec4/build`)})(BuildDocuments||={});let Locate;(function(e){e.req=new RequestType(`likec4/locate`)})(Locate||={});let ChangeView;(function(e){e.req=new RequestType(`likec4/change-view`)})(ChangeView||={});let FetchTelemetryMetrics;(function(e){e.req=new RequestType0(`likec4/metrics`)})(FetchTelemetryMetrics||={});let GetDocumentTags;(function(e){e.req=new RequestType(`likec4/document-tags`)})(GetDocumentTags||={});let FetchProjectsOverview;(function(e){e.req=new RequestType0(`likec4/fetch-projects-overview`)})(FetchProjectsOverview||={});export{BuildDocuments,ChangeView,DidChangeModelNotification,DidChangeProjectsNotification,DidChangeSnapshotNotification,DidRequestOpenViewNotification,FetchComputedModel,FetchLayoutedModel,FetchProjects,FetchProjectsOverview,FetchTelemetryMetrics,FetchViewsFromAllProjects,GetDocumentTags,LayoutView,Locate,RegisterProject,ReloadProjects,ValidateLayout};
1
+ import{NotificationType as e,NotificationType0 as t,RequestType as n,RequestType0 as r}from"vscode-jsonrpc";let i;(function(t){t.type=new e(`likec4/onDidChangeModel`)})(i||={});let a;(function(e){e.type=new t(`likec4/onDidChangeProjects`)})(a||={});let o;(function(t){t.type=new e(t.Method=`likec4/onDidChangeSnapshot`)})(o||={});let s;(function(t){t.type=new e(`likec4/onRequestOpenView`)})(s||={});let c;(function(e){e.req=new n(`likec4/fetchComputedModel`)})(c||={});let l;(function(e){e.req=new r(`likec4/fetchViewsFromAllProjects`)})(l||={});let u;(function(e){e.req=new n(`likec4/fetchLayoutedModel`)})(u||={});let d;(function(e){e.req=new n(`likec4/layout-view`)})(d||={});let f;(function(e){e.req=new n(`likec4/validate-layout`)})(f||={});let p;(function(e){e.req=new r(`likec4/reload-projects`)})(p||={});let m;(function(e){e.req=new r(`likec4/fetch-projects`)})(m||={});let h;(function(e){e.req=new n(`likec4/register-project`)})(h||={});let g;(function(e){e.req=new n(`likec4/build`)})(g||={});let _;(function(e){e.req=new n(`likec4/locate`)})(_||={});let v;(function(e){e.req=new n(`likec4/change-view`)})(v||={});let y;(function(e){e.req=new r(`likec4/metrics`)})(y||={});let b;(function(e){e.req=new n(`likec4/document-tags`)})(b||={});let x;(function(e){e.req=new r(`likec4/fetch-projects-overview`)})(x||={});export{g as BuildDocuments,v as ChangeView,i as DidChangeModelNotification,a as DidChangeProjectsNotification,o as DidChangeSnapshotNotification,s as DidRequestOpenViewNotification,c as FetchComputedModel,u as FetchLayoutedModel,m as FetchProjects,x as FetchProjectsOverview,y as FetchTelemetryMetrics,l as FetchViewsFromAllProjects,b as GetDocumentTags,d as LayoutView,_ as Locate,h as RegisterProject,p as ReloadProjects,f as ValidateLayout};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@likec4/language-server",
3
3
  "description": "LikeC4 Language Server",
4
- "version": "1.49.0",
4
+ "version": "1.50.0",
5
5
  "license": "MIT",
6
6
  "bugs": "https://github.com/likec4/likec4/issues",
7
7
  "homepage": "https://likec4.dev",
@@ -126,13 +126,13 @@
126
126
  "dependencies": {
127
127
  "@hono/mcp": "^0.2.3",
128
128
  "@hono/node-server": "^1.19.9",
129
- "hono": "^4.11.9",
129
+ "hono": "^4.11.10",
130
130
  "@hpcc-js/wasm-graphviz": "1.21.0",
131
131
  "@smithy/util-base64": "^4.3.0",
132
132
  "chokidar": "^5.0.0",
133
133
  "defu": "^6.1.4",
134
134
  "fdir": "6.4.0",
135
- "immer": "^11.1.3",
135
+ "immer": "^11.1.4",
136
136
  "json5": "^2.2.3",
137
137
  "langium": "3.5.0",
138
138
  "nano-spawn": "^2.0.0",
@@ -146,13 +146,13 @@
146
146
  "vscode-uri": "3.1.0",
147
147
  "which": "^5.0.0",
148
148
  "zod": "^3.25.76",
149
- "@likec4/config": "1.49.0",
150
- "@likec4/layouts": "1.49.0",
151
- "@likec4/core": "1.49.0",
152
- "@likec4/log": "1.49.0"
149
+ "@likec4/config": "1.50.0",
150
+ "@likec4/log": "1.50.0",
151
+ "@likec4/layouts": "1.50.0",
152
+ "@likec4/core": "1.50.0"
153
153
  },
154
154
  "peerDependencies": {
155
- "@modelcontextprotocol/sdk": "^1.26.0",
155
+ "@modelcontextprotocol/sdk": "^1.27.0",
156
156
  "bundle-require": "^5.1.0",
157
157
  "esbuild": "0.27.3"
158
158
  },
@@ -168,10 +168,10 @@
168
168
  }
169
169
  },
170
170
  "devDependencies": {
171
- "@modelcontextprotocol/sdk": "^1.26.0",
171
+ "@modelcontextprotocol/sdk": "^1.27.0",
172
172
  "@msgpack/msgpack": "^3.1.2",
173
173
  "@types/natural-compare-lite": "^1.4.2",
174
- "@types/node": "~22.19.10",
174
+ "@types/node": "~22.19.11",
175
175
  "@types/picomatch": "^4.0.2",
176
176
  "@types/vscode": "^1.106.1",
177
177
  "@types/which": "^3.0.4",
@@ -180,23 +180,23 @@
180
180
  "fast-equals": "^6.0.0",
181
181
  "indent-string": "^5.0.0",
182
182
  "langium-cli": "3.5.2",
183
- "obuild": "^0.4.27",
183
+ "obuild": "^0.4.31",
184
184
  "oxlint": "1.43.0",
185
185
  "p-debounce": "5.1.0",
186
186
  "p-queue": "8.1.1",
187
- "p-timeout": "6.1.4",
187
+ "p-timeout": "7.0.1",
188
188
  "picomatch": "^4.0.3",
189
189
  "pretty-ms": "^9.3.0",
190
190
  "remeda": "^2.33.5",
191
191
  "strip-indent": "^4.1.1",
192
192
  "tsx": "4.21.0",
193
- "turbo": "2.8.3",
193
+ "turbo": "2.8.10",
194
194
  "typescript": "5.9.3",
195
195
  "ufo": "1.6.3",
196
196
  "vitest": "4.0.18",
197
197
  "@likec4/devops": "1.42.0",
198
- "@likec4/tsconfig": "1.49.0",
199
- "@likec4/icons": "1.46.4"
198
+ "@likec4/icons": "1.46.4",
199
+ "@likec4/tsconfig": "1.50.0"
200
200
  },
201
201
  "scripts": {
202
202
  "typecheck": "tsc -b --verbose",