likec4 1.49.0 → 1.51.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/__app__/src/likec4.js +33 -62
- package/__app__/src/main.js +2 -56
- package/__app__/src/routes/index.js +81 -16
- package/__app__/src/routes/single.js +43 -23
- package/__app__/src/style.css +1 -1
- package/__app__/src/vendors.js +17891 -17752
- package/config/schema.json +16 -0
- package/dist/THIRD-PARTY-LICENSES.md +192 -62
- package/dist/_chunks/LikeC4.mjs +1 -0
- package/dist/_chunks/filesystem.mjs +1230 -0
- package/dist/_chunks/index.d.mts +11 -12
- package/dist/_chunks/index2.d.mts +173 -84
- package/dist/_chunks/libs/@chevrotain/cst-dts-gen.mjs +30 -0
- package/dist/_chunks/libs/@chevrotain/regexp-to-ast.mjs +8 -8
- package/dist/_chunks/libs/@chevrotain/types.d.mts +1 -0
- package/dist/_chunks/libs/@chevrotain/utils.mjs +1 -1
- package/dist/_chunks/libs/@hono/mcp.mjs +8 -8
- package/dist/_chunks/libs/@hono/node-server.mjs +1 -1
- package/dist/_chunks/libs/@logtape/logtape.mjs +3 -3
- package/dist/_chunks/libs/@lume/kiwi.mjs +1 -1
- package/dist/_chunks/libs/@modelcontextprotocol/sdk.d.mts +114 -14
- package/dist/_chunks/libs/@modelcontextprotocol/sdk.mjs +7 -7
- package/dist/_chunks/libs/@msgpack/msgpack.mjs +1 -1
- package/dist/_chunks/libs/@nanostores/react.d.mts +61 -1
- package/dist/_chunks/libs/@nanostores/react.mjs +1 -1
- package/dist/_chunks/libs/@smithy/is-array-buffer.mjs +1 -0
- package/dist/_chunks/libs/@smithy/util-base64.mjs +1 -1
- package/dist/_chunks/libs/ajv.mjs +1 -1
- package/dist/_chunks/libs/ansi-align.mjs +2 -0
- package/dist/_chunks/libs/ansi-regex.mjs +1 -0
- package/dist/_chunks/libs/ansi-styles.mjs +1 -0
- package/dist/_chunks/libs/atomically.mjs +1 -1
- package/dist/_chunks/libs/birpc.mjs +1 -1
- package/dist/_chunks/libs/boxen.d.mts +1 -0
- package/dist/_chunks/libs/boxen.mjs +22 -0
- package/dist/_chunks/libs/chevrotain-allstar.mjs +2 -2
- package/dist/_chunks/libs/chevrotain.mjs +35 -35
- package/dist/_chunks/libs/conf.mjs +1 -1
- package/dist/_chunks/libs/defu.mjs +1 -1
- package/dist/_chunks/libs/esm-env.mjs +1 -1
- package/dist/_chunks/libs/eventemitter3.mjs +1 -1
- package/dist/_chunks/libs/fast-equals.mjs +1 -1
- package/dist/_chunks/libs/find-up-simple.mjs +1 -1
- package/dist/_chunks/libs/get-port.mjs +1 -1
- package/dist/_chunks/libs/is-docker.mjs +1 -1
- package/dist/_chunks/libs/is-error-instance.mjs +1 -1
- package/dist/_chunks/libs/is-inside-container.mjs +1 -1
- package/dist/_chunks/libs/is-plain-obj.mjs +1 -1
- package/dist/_chunks/libs/isexe.mjs +1 -1
- package/dist/_chunks/libs/json5.mjs +10 -10
- package/dist/_chunks/libs/khroma.mjs +1 -1
- package/dist/_chunks/libs/ky.mjs +2 -2
- package/dist/_chunks/libs/langium.d.mts +5 -4
- package/dist/_chunks/libs/langium.mjs +20 -19
- package/dist/_chunks/libs/merge-error-cause.mjs +2 -2
- package/dist/_chunks/libs/p-limit.mjs +1 -1
- package/dist/_chunks/libs/p-queue.mjs +1 -1
- package/dist/_chunks/libs/package-manager-detector.mjs +1 -1
- package/dist/_chunks/libs/package-up.mjs +1 -1
- package/dist/_chunks/libs/pako.mjs +1 -0
- package/dist/_chunks/libs/parse-ms.mjs +1 -1
- package/dist/_chunks/libs/pathe.mjs +1 -1
- package/dist/_chunks/libs/picomatch.mjs +1 -1
- package/dist/_chunks/libs/pretty-ms.mjs +1 -1
- package/dist/_chunks/libs/remeda.mjs +2 -1
- package/dist/_chunks/libs/safe-stringify.mjs +1 -1
- package/dist/_chunks/libs/strip-indent.mjs +1 -1
- package/dist/_chunks/libs/tinyrainbow.mjs +1 -1
- package/dist/_chunks/libs/ts-graphviz.mjs +3 -3
- package/dist/_chunks/libs/ufo.mjs +1 -1
- package/dist/_chunks/libs/vscode-languageserver.mjs +1 -0
- package/dist/_chunks/libs/which.mjs +1 -1
- package/dist/_chunks/libs/word-wrap.mjs +2 -2
- package/dist/_chunks/rolldown-runtime.mjs +1 -1
- package/dist/_chunks/sequence.mjs +1 -0
- package/dist/_chunks/src.mjs +15 -0
- package/dist/_chunks/src2.mjs +499 -0
- package/dist/cli/index.mjs +84 -231
- package/dist/config/index.mjs +1 -1
- package/dist/index.d.mts +810 -4
- package/dist/index.mjs +1 -1
- package/dist/model/index.mjs +1 -1
- package/dist/vite-plugin/index.d.mts +3 -0
- package/dist/vite-plugin/index.mjs +1 -1
- package/dist/vite-plugin/internal.d.mts +1 -2
- package/dist/vite-plugin/internal.mjs +1 -1
- package/package.json +28 -29
- package/react/index.d.mts +2 -2
- package/react/index.mjs +52 -76
- package/vite-plugin-modules.d.ts +5 -0
- package/dist/_chunks/GraphvizBinaryAdapter.mjs +0 -72
- package/dist/_chunks/filenames.mjs +0 -14
- package/dist/_chunks/libs/@chevrotain/gast.mjs +0 -1
- package/dist/_chunks/libs/@logtape/logtape.d.mts +0 -741
- package/dist/_chunks/libs/nanostores.d.mts +0 -63
- package/dist/_chunks/libs/nanostores.mjs +0 -1
- package/dist/_chunks/node.mjs +0 -481
- package/dist/_chunks/plugin.mjs +0 -322
- package/dist/_chunks/sequence-view.mjs +0 -1
package/dist/_chunks/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { S as $strip, _ as ZodUnion, a as ZodBoolean, b as $partial, c as ZodEnum, d as ZodObject, f as ZodOptional, g as ZodTransform, h as ZodString, i as ZodArray, l as ZodInt, m as ZodRecord, o as ZodCustom, p as ZodPipe, r as ZodAny, s as ZodDefault, u as ZodNumber, v as input, x as $strict, y as output } from "./libs/@modelcontextprotocol/sdk.mjs";
|
|
2
2
|
import { DeploymentElementModel, DeploymentRelationModel, ElementModel, LikeC4Model, LikeC4ViewModel, RelationshipModel } from "@likec4/core/model";
|
|
3
3
|
import { LikeC4ProjectStylesConfig, LikeC4ProjectTheme, ProjectId, ThemeColorValues as ThemeColorValues$1, aux } from "@likec4/core/types";
|
|
4
4
|
|
|
@@ -25,6 +25,7 @@ declare const LikeC4ProjectJsonConfigSchema: ZodObject<{
|
|
|
25
25
|
extends: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
|
|
26
26
|
title: ZodOptional<ZodString>;
|
|
27
27
|
contactPerson: ZodOptional<ZodString>;
|
|
28
|
+
metadata: ZodOptional<ZodRecord<ZodString, ZodAny>>;
|
|
28
29
|
styles: ZodOptional<ZodPipe<ZodObject<{
|
|
29
30
|
theme: ZodOptional<ZodPipe<ZodObject<{
|
|
30
31
|
colors: ZodOptional<ZodPipe<ZodRecord<ZodPipe<ZodUnion<[ZodEnum<{
|
|
@@ -140,6 +141,8 @@ declare const LikeC4ProjectJsonConfigSchema: ZodObject<{
|
|
|
140
141
|
manualLayouts: ZodOptional<ZodObject<{
|
|
141
142
|
outDir: ZodDefault<ZodString>;
|
|
142
143
|
}, $strict>>;
|
|
144
|
+
inferTechnologyFromIcon: ZodOptional<ZodBoolean>;
|
|
145
|
+
implicitViews: ZodOptional<ZodBoolean>;
|
|
143
146
|
}, $strip>;
|
|
144
147
|
type LikeC4ProjectJsonConfig = input<typeof LikeC4ProjectJsonConfigSchema>;
|
|
145
148
|
/**
|
|
@@ -458,21 +461,17 @@ declare const LikeC4StylesConfigSchema: ZodPipe<ZodObject<{
|
|
|
458
461
|
interface LikeC4StylesConfig extends output<typeof LikeC4StylesConfigSchema> {}
|
|
459
462
|
type LikeC4StylesConfigInput = input<typeof LikeC4StylesConfigSchema>; //#endregion
|
|
460
463
|
//#region src/filenames.d.ts
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
declare
|
|
464
|
+
/** All known LikeC4 config filenames (JSON and non-JSON). */
|
|
465
|
+
/** Returns true if the **basename** of the given path matches a known config filename. */
|
|
466
|
+
declare function isLikeC4JsonConfig(filename: string): boolean;
|
|
464
467
|
/**
|
|
465
|
-
*
|
|
468
|
+
* Returns true if the **basename** of the given path matches a known non-JSON config filename (JS, MJS, TS, MTS).
|
|
466
469
|
*/
|
|
467
|
-
declare function
|
|
470
|
+
declare function isLikeC4NonJsonConfig(filename: string): boolean;
|
|
468
471
|
/**
|
|
469
|
-
*
|
|
472
|
+
* Returns true if the **basename** of the given path matches a known LikeC4 config file (JSON or non-JSON).
|
|
470
473
|
*/
|
|
471
|
-
declare function
|
|
472
|
-
/**
|
|
473
|
-
* Checks if the given filename is a LikeC4 config file (JSON or non-JSON)
|
|
474
|
-
*/
|
|
475
|
-
declare function isLikeC4Config(filename: string): filename is typeof ConfigFilenames[number]; //#endregion
|
|
474
|
+
declare function isLikeC4Config(filename: string): boolean; //#endregion
|
|
476
475
|
//#region src/define-config.d.ts
|
|
477
476
|
/**
|
|
478
477
|
* Defines LikeC4 Project, allows custom generators that can be executed using CLI:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as ServerOptions, t as McpServer } from "./libs/@modelcontextprotocol/sdk.mjs";
|
|
2
2
|
import { a as LikeC4ProjectConfig, i as IncludeConfig, o as LikeC4ProjectConfigInput } from "./index.mjs";
|
|
3
|
-
import { $ as
|
|
3
|
+
import { $ as FileSystemProvider, A as DefaultValueConverter, B as AsyncDisposable, C as CodeLensParams, D as ValidationOptions, E as DefaultDocumentValidator, F as JSDocDocumentationProvider, G as Reference, H as AstNode, I as DefaultIndexManager, J as LangiumDocument, K as ReferenceInfo, L as ReferenceDescription, M as MaybePromise, N as DefaultScopeProvider, O as DiagnosticInfo, P as Scope, Q as FileSystemNode, R as DefaultNameProvider, S as CodeActionParams, T as DocumentSymbolParams, U as AstNodeDescription, V as Disposable$1, W as CstNode, X as PrecomputedScopes, Y as LangiumDocumentFactory, Z as Stream, _ as CodeLensProvider, _t as SymbolKind, a as LangiumServices, at as CodeAction, b as FileSelector, c as AbstractSemanticTokenProvider, ct as CompletionItemKind, d as AbstractFormatter, dt as DocumentLink, et as Keyword, f as FormattingRegion, ft as DocumentSymbol, g as DefaultDocumentHighlightProvider, gt as Range, h as DocumentLinkProvider, ht as Location, i as NextFeature, it as RequestType, j as ValueType, k as DefaultScopeComputation, l as SemanticTokenAcceptor, lt as Diagnostic, m as NodeKindProvider, mt as Hover, n as CompletionContext, nt as CancellationToken$1, o as LangiumSharedServices, ot as CodeLens, p as DocumentSymbolProvider, pt as FormattingOptions, q as DefaultLangiumDocuments, r as DefaultCompletionProvider, rt as NotificationType, s as DefaultWorkspaceSymbolProvider, st as Command, t as CompletionAcceptor, tt as URI, u as AstNodeHoverProvider, ut as DocumentHighlight, v as CodeActionProvider, vt as TextEdit, w as DocumentLinkParams, x as BuildOptions, y as DefaultWorkspaceManager, yt as WorkspaceFolder, z as WorkspaceCache } from "./libs/langium.mjs";
|
|
4
4
|
import { t as $keywords } from "./libs/ts-graphviz.mjs";
|
|
5
5
|
import { ElementModel, LikeC4Model } from "@likec4/core/model";
|
|
6
6
|
import * as c4 from "@likec4/core";
|
|
@@ -12,7 +12,7 @@ import { AdhocViewPredicate, ComputedProjectsView, LayoutedProjectsView } from "
|
|
|
12
12
|
import * as type_fest0 from "type-fest";
|
|
13
13
|
import { ConditionalPick, MergeExclusive, Simplify, Tagged, ValueOf, Writable } from "type-fest";
|
|
14
14
|
|
|
15
|
-
//#region ../language-server/dist/protocol.d.mts
|
|
15
|
+
//#region ../language-server/dist/_chunks/protocol.d.mts
|
|
16
16
|
/**
|
|
17
17
|
* When server requests to open a likec4 preview panel
|
|
18
18
|
* (available only in the editor).
|
|
@@ -281,6 +281,7 @@ declare namespace GraphvizJson {
|
|
|
281
281
|
} //#endregion
|
|
282
282
|
//#region src/graphviz/GraphvizLayoter.d.ts
|
|
283
283
|
interface GraphvizPort extends Disposable {
|
|
284
|
+
get name(): string;
|
|
284
285
|
get concurrency(): number;
|
|
285
286
|
unflatten(dot: DotSource): Promise<DotSource>;
|
|
286
287
|
acyclic(dot: DotSource): Promise<DotSource>;
|
|
@@ -347,96 +348,41 @@ declare class QueueGraphvizLayoter extends GraphvizLayouter {
|
|
|
347
348
|
onSuccess?: (task: LayoutTaskParams<A>, result: LayoutResult<A>) => void;
|
|
348
349
|
onError?: (task: LayoutTaskParams<A>, error: unknown) => void;
|
|
349
350
|
}): Promise<LayoutResult<A>[]>;
|
|
351
|
+
/**
|
|
352
|
+
* Custom backpressure
|
|
353
|
+
* (basically allow same amount of tasks to be in queue as concurrency)
|
|
354
|
+
*/
|
|
355
|
+
private waitForQueueToShrink;
|
|
350
356
|
dispose(): void;
|
|
351
357
|
} //#endregion
|
|
352
358
|
//#region src/graphviz/wasm/GraphvizWasmAdapter.d.ts
|
|
353
359
|
//#endregion
|
|
354
|
-
//#region ../language-server/dist/module.d.mts
|
|
355
|
-
|
|
356
|
-
lsp: {
|
|
357
|
-
NodeKindProvider: NodeKindProvider$1;
|
|
358
|
-
WorkspaceSymbolProvider: WorkspaceSymbolProvider;
|
|
359
|
-
};
|
|
360
|
-
workspace: {
|
|
361
|
-
Cache: WorkspaceCache<string, any>;
|
|
362
|
-
ProjectsManager: ProjectsManager;
|
|
363
|
-
IndexManager: IndexManager;
|
|
364
|
-
LangiumDocuments: LangiumDocuments;
|
|
365
|
-
WorkspaceManager: LikeC4WorkspaceManager;
|
|
366
|
-
FileSystemProvider: FileSystemProvider$1;
|
|
367
|
-
FileSystemWatcher: FileSystemWatcher;
|
|
368
|
-
ManualLayouts: LikeC4ManualLayouts;
|
|
369
|
-
};
|
|
370
|
-
}
|
|
371
|
-
type LikeC4SharedServices = LangiumSharedServices & LikeC4AddedSharedServices;
|
|
372
|
-
/**
|
|
373
|
-
* Declaration of custom services - add your own service classes here.
|
|
374
|
-
*/
|
|
375
|
-
interface LikeC4AddedServices {
|
|
376
|
-
documentation: {
|
|
377
|
-
DocumentationProvider: LikeC4DocumentationProvider;
|
|
378
|
-
};
|
|
379
|
-
validation: {
|
|
380
|
-
DocumentValidator: LikeC4DocumentValidator;
|
|
381
|
-
};
|
|
382
|
-
Rpc: Rpc;
|
|
383
|
-
mcp: {
|
|
384
|
-
Server: LikeC4MCPServer;
|
|
385
|
-
ServerFactory: LikeC4MCPServerFactory;
|
|
386
|
-
};
|
|
387
|
-
likec4: {
|
|
388
|
-
LanguageServices: LikeC4LanguageServices;
|
|
389
|
-
Views: LikeC4Views;
|
|
390
|
-
Layouter: QueueGraphvizLayoter;
|
|
391
|
-
DeploymentsIndex: DeploymentsIndex;
|
|
392
|
-
FqnIndex: FqnIndex;
|
|
393
|
-
ModelParser: LikeC4ModelParser;
|
|
394
|
-
ModelBuilder: LikeC4ModelBuilder;
|
|
395
|
-
ModelLocator: LikeC4ModelLocator;
|
|
396
|
-
ModelChanges: LikeC4ModelChanges;
|
|
397
|
-
LastSeen: LastSeenArtifacts;
|
|
398
|
-
};
|
|
399
|
-
lsp: {
|
|
400
|
-
CompletionProvider: LikeC4CompletionProvider;
|
|
401
|
-
DocumentHighlightProvider: LikeC4DocumentHighlightProvider;
|
|
402
|
-
DocumentSymbolProvider: LikeC4DocumentSymbolProvider;
|
|
403
|
-
SemanticTokenProvider: LikeC4SemanticTokenProvider;
|
|
404
|
-
HoverProvider: LikeC4HoverProvider;
|
|
405
|
-
CodeLensProvider: LikeC4CodeLensProvider;
|
|
406
|
-
DocumentLinkProvider: LikeC4DocumentLinkProvider;
|
|
407
|
-
Formatter: LikeC4Formatter;
|
|
408
|
-
CodeActionProvider: LikeC4CodeActionProvider;
|
|
409
|
-
};
|
|
410
|
-
references: {
|
|
411
|
-
NameProvider: LikeC4NameProvider;
|
|
412
|
-
ScopeComputation: LikeC4ScopeComputation;
|
|
413
|
-
ScopeProvider: LikeC4ScopeProvider;
|
|
414
|
-
};
|
|
415
|
-
shared?: LikeC4SharedServices;
|
|
416
|
-
parser: {
|
|
417
|
-
ValueConverter: LikeC4ValueConverter;
|
|
418
|
-
};
|
|
419
|
-
}
|
|
420
|
-
type LikeC4Services = LangiumServices & LikeC4AddedServices;
|
|
360
|
+
//#region ../language-server/dist/_chunks/module.d.mts
|
|
361
|
+
//#region src/documentation/documentation-provider.d.ts
|
|
421
362
|
/**
|
|
422
|
-
*
|
|
423
|
-
*
|
|
424
|
-
* @internal
|
|
363
|
+
* Provides documentation for LikeC4 AST nodes, extending JSDoc parsing
|
|
364
|
+
* with specialized formatting for deployment nodes, deployed instances, and elements.
|
|
425
365
|
*/
|
|
426
|
-
//#endregion
|
|
427
|
-
//#region ../language-server/dist/_chunks/index.d.mts
|
|
428
|
-
//#region src/documentation/documentation-provider.d.ts
|
|
429
366
|
declare class LikeC4DocumentationProvider extends JSDocDocumentationProvider {
|
|
430
367
|
private parser;
|
|
431
368
|
private locator;
|
|
369
|
+
/**
|
|
370
|
+
* Creates a new documentation provider.
|
|
371
|
+
* @param services - The LikeC4 language services.
|
|
372
|
+
*/
|
|
432
373
|
constructor(services: LikeC4Services);
|
|
374
|
+
/**
|
|
375
|
+
* Returns documentation for the given AST node (deployment nodes, deployed instances, elements, or JSDoc fallback).
|
|
376
|
+
* @param node - The AST node to document.
|
|
377
|
+
* @returns Formatted documentation string, or undefined if none.
|
|
378
|
+
*/
|
|
433
379
|
getDocumentation(node: AstNode): string | undefined;
|
|
434
380
|
} //#endregion
|
|
435
381
|
//#region src/workspace/ProjectsManager.d.ts
|
|
436
382
|
type DocOrUri = LangiumDocument | string | URI;
|
|
437
383
|
/**
|
|
438
|
-
* A tagged string that represents a project folder URI
|
|
439
|
-
*
|
|
384
|
+
* A tagged string that represents a project folder URI (with trailing slash).
|
|
385
|
+
* Used in `startsWith` checks to determine if a document belongs to a project.
|
|
440
386
|
*/
|
|
441
387
|
type ProjectFolder = Tagged<string, 'ProjectFolder'>;
|
|
442
388
|
declare function ProjectFolder(folder: URI | string): ProjectFolder;
|
|
@@ -557,6 +503,7 @@ declare class ProjectsManager {
|
|
|
557
503
|
private getWorkspaceFolder;
|
|
558
504
|
private notifyListeners;
|
|
559
505
|
private updateIncludesExcludes;
|
|
506
|
+
private warnIfConfigOverride;
|
|
560
507
|
} //#endregion
|
|
561
508
|
//#region src/filesystem/types.d.ts
|
|
562
509
|
interface FileNode extends FileSystemNode {
|
|
@@ -686,7 +633,7 @@ interface LikeC4MCPServerFactory {
|
|
|
686
633
|
}
|
|
687
634
|
//#endregion
|
|
688
635
|
//#region src/generated/ast.d.ts
|
|
689
|
-
type AnyProperty = DynamicViewProperty | ElementProperty | RelationProperty | StringProperty | ViewProperty;
|
|
636
|
+
type AnyProperty = DynamicViewProperty | ElementProperty | NavigateToProperty | NotationProperty | NotesProperty | RelationProperty | RelationshipStyleProperty | StringProperty | StyleProperty | ViewProperty;
|
|
690
637
|
declare const AnyProperty = "AnyProperty";
|
|
691
638
|
type ArrowType = 'crow' | 'diamond' | 'dot' | 'none' | 'normal' | 'odiamond' | 'odot' | 'onormal' | 'open' | 'vee';
|
|
692
639
|
type BorderStyleValue = 'none' | LineOptions;
|
|
@@ -2332,7 +2279,10 @@ declare class MergedSpecification {
|
|
|
2332
2279
|
readonly globals: c4.ModelGlobals;
|
|
2333
2280
|
readonly imports: MultiMap<c4.ProjectId, c4.Fqn, Set<c4.Fqn>>;
|
|
2334
2281
|
readonly projectId: c4.ProjectId | undefined;
|
|
2335
|
-
|
|
2282
|
+
readonly inferTechFromIcon: boolean;
|
|
2283
|
+
constructor(docs: ReadonlyArray<ParsedLikeC4LangiumDocument>, opts?: {
|
|
2284
|
+
inferTechFromIcon?: boolean;
|
|
2285
|
+
});
|
|
2336
2286
|
/**
|
|
2337
2287
|
* Converts a parsed model into a C4 model element.
|
|
2338
2288
|
*/
|
|
@@ -2385,10 +2335,35 @@ declare class MergedSpecification {
|
|
|
2385
2335
|
declare class LastSeenArtifacts {
|
|
2386
2336
|
#private;
|
|
2387
2337
|
constructor(services: LikeC4Services);
|
|
2338
|
+
/**
|
|
2339
|
+
* Cache the last successful merged specification for its project.
|
|
2340
|
+
* @param specification - MergedSpecification to store (by projectId).
|
|
2341
|
+
* @returns The same specification (stores in internal map when projectId is set).
|
|
2342
|
+
*/
|
|
2388
2343
|
rememberSpecification(specification: MergedSpecification): MergedSpecification;
|
|
2344
|
+
/**
|
|
2345
|
+
* Cache the last successful computed model and its styles for the project.
|
|
2346
|
+
* @param model - LikeC4Model.Computed to store (by projectId).
|
|
2347
|
+
* @returns The same model (stores model and styles in internal maps).
|
|
2348
|
+
*/
|
|
2389
2349
|
rememberModel<M extends LikeC4Model.Computed>(model: M): M;
|
|
2350
|
+
/**
|
|
2351
|
+
* Returns the last seen merged specification for the given project, if available.
|
|
2352
|
+
* @param projectId - Project id to look up.
|
|
2353
|
+
* @returns MergedSpecification or undefined.
|
|
2354
|
+
*/
|
|
2390
2355
|
specification(projectId: c4.ProjectId): MergedSpecification | undefined;
|
|
2356
|
+
/**
|
|
2357
|
+
* Returns the last seen styles for the given project, if available.
|
|
2358
|
+
* @param projectId - Project id to look up.
|
|
2359
|
+
* @returns LikeC4Styles or undefined.
|
|
2360
|
+
*/
|
|
2391
2361
|
styles(projectId: c4.ProjectId): LikeC4Styles$1 | undefined;
|
|
2362
|
+
/**
|
|
2363
|
+
* Returns the last seen computed model for the given project, if available.
|
|
2364
|
+
* @param projectId - Project id to look up.
|
|
2365
|
+
* @returns LikeC4Model.Computed or undefined.
|
|
2366
|
+
*/
|
|
2392
2367
|
model(projectId: c4.ProjectId): LikeC4Model.Computed | undefined;
|
|
2393
2368
|
} //#endregion
|
|
2394
2369
|
//#region src/model/model-builder.d.ts
|
|
@@ -2401,11 +2376,16 @@ interface LikeC4ModelBuilder extends Disposable$1 {
|
|
|
2401
2376
|
clearCache(): void;
|
|
2402
2377
|
} //#endregion
|
|
2403
2378
|
//#region src/model/model-locator.d.ts
|
|
2379
|
+
/** Result of locating a view: document, view AST, and view block node. */
|
|
2404
2380
|
type ViewLocateResult = {
|
|
2405
2381
|
doc: ParsedLikeC4LangiumDocument;
|
|
2406
2382
|
view: ParsedAstView;
|
|
2407
2383
|
viewAst: LikeC4View;
|
|
2408
2384
|
};
|
|
2385
|
+
/**
|
|
2386
|
+
* Locates elements, views, and documents in the LikeC4 model by FQN or AST node.
|
|
2387
|
+
* Used by LSP features (hover, go-to-definition, document tags, etc.).
|
|
2388
|
+
*/
|
|
2409
2389
|
declare class LikeC4ModelLocator {
|
|
2410
2390
|
private services;
|
|
2411
2391
|
private fqnIndex;
|
|
@@ -2418,16 +2398,33 @@ declare class LikeC4ModelLocator {
|
|
|
2418
2398
|
* Returns the parsed documents
|
|
2419
2399
|
*/
|
|
2420
2400
|
private documents;
|
|
2401
|
+
/**
|
|
2402
|
+
* Get parsed element by AST node or by FQN (and optional projectId).
|
|
2403
|
+
* @param args - Either [element AST], [fqn], or [fqn, projectId]
|
|
2404
|
+
* @returns { projectId, element, document } or null if not found
|
|
2405
|
+
*/
|
|
2421
2406
|
getParsedElement(...args: [Element] | [c4.Fqn] | [c4.Fqn, c4.ProjectId]): null | {
|
|
2422
2407
|
projectId: c4.ProjectId;
|
|
2423
2408
|
element: ParsedAstElement;
|
|
2424
2409
|
document: LangiumDocument;
|
|
2425
2410
|
};
|
|
2426
2411
|
private findParsedElementByFqnIn;
|
|
2412
|
+
/**
|
|
2413
|
+
* Get LSP Location for an element by FQN (and optional projectId).
|
|
2414
|
+
* @param fqn - Fully qualified name (may include project prefix)
|
|
2415
|
+
* @param projectId - Optional project scope
|
|
2416
|
+
* @returns Location or null
|
|
2417
|
+
*/
|
|
2427
2418
|
locateElement(fqn: c4.Fqn, projectId?: c4.ProjectId | undefined): Location | null;
|
|
2428
2419
|
locateDeploymentElement(deploymentFqn: c4.DeploymentFqn, projectId?: c4.ProjectId | undefined): Location | null;
|
|
2429
2420
|
locateRelation(relationId: c4.RelationId, projectId?: c4.ProjectId): Location | null;
|
|
2430
2421
|
locateViewAst(viewId: c4.ViewId, projectId?: c4.ProjectId | undefined): null | ViewLocateResult;
|
|
2422
|
+
/**
|
|
2423
|
+
* Get LSP Location for a view by id (and optional projectId).
|
|
2424
|
+
* @param viewId - View id
|
|
2425
|
+
* @param projectId - Optional project scope
|
|
2426
|
+
* @returns Location or null
|
|
2427
|
+
*/
|
|
2431
2428
|
locateView(viewId: c4.ViewId, projectId?: c4.ProjectId): Location | null;
|
|
2432
2429
|
/**
|
|
2433
2430
|
* Returns an array of tags with their name, color, range and whether they are defined in the specification or not.
|
|
@@ -2519,6 +2516,8 @@ interface LikeC4Views {
|
|
|
2519
2516
|
*/
|
|
2520
2517
|
adhocView(predicates: AdhocViewPredicate[], projectId?: ProjectId | undefined): Promise<LayoutedView>;
|
|
2521
2518
|
} //#endregion
|
|
2519
|
+
//#region src/views/index.d.ts
|
|
2520
|
+
//#endregion
|
|
2522
2521
|
//#region src/model/parser/Base.d.ts
|
|
2523
2522
|
type ParserLevel = 'base' | 'model' | 'deployment' | 'fqnref' | 'relation' | 'views' | 'globals' | 'imports' | 'specification';
|
|
2524
2523
|
declare class BaseParser {
|
|
@@ -3379,15 +3378,41 @@ declare class LikeC4DocumentSymbolProvider implements DocumentSymbolProvider {
|
|
|
3379
3378
|
protected symbolKind(node: AstNode): SymbolKind;
|
|
3380
3379
|
} //#endregion
|
|
3381
3380
|
//#region src/lsp/HoverProvider.d.ts
|
|
3381
|
+
/**
|
|
3382
|
+
* Provides hover content for LikeC4 AST nodes (elements, tags, relations, etc.)
|
|
3383
|
+
* in the language server. Resolves model references and formats markdown hover text.
|
|
3384
|
+
*/
|
|
3382
3385
|
declare class LikeC4HoverProvider extends AstNodeHoverProvider {
|
|
3383
3386
|
protected services: LikeC4Services;
|
|
3384
3387
|
private parser;
|
|
3385
3388
|
private locator;
|
|
3389
|
+
/** @param services - LikeC4 language services (parser, locator, etc.) */
|
|
3386
3390
|
constructor(services: LikeC4Services);
|
|
3387
3391
|
protected getAstNodeHoverContent(node: AstNode): MaybePromise<Hover | undefined>;
|
|
3392
|
+
/**
|
|
3393
|
+
* Builds hover content for an element node (title, summary, model details and view links).
|
|
3394
|
+
* @param node - The element AST node to generate hover content for.
|
|
3395
|
+
* @returns Hover information with markdown content, or undefined if element not found.
|
|
3396
|
+
*/
|
|
3388
3397
|
protected getElementHover(node: Element): MaybePromise<Hover | undefined>;
|
|
3398
|
+
/**
|
|
3399
|
+
* Builds markdown hover content for an element model (relationship counts and links to views).
|
|
3400
|
+
* @param model - The element model containing relationship and view information.
|
|
3401
|
+
* @param projectId - The project identifier for constructing view links.
|
|
3402
|
+
* @returns Markdown string with model details, or undefined if no details available.
|
|
3403
|
+
*/
|
|
3389
3404
|
protected getElementModelHover(model: ElementModel, projectId: ProjectId): string | undefined;
|
|
3405
|
+
/**
|
|
3406
|
+
* Builds hover content for a deployment node (id, title, kind, summary).
|
|
3407
|
+
* @param node - The deployment node AST node to generate hover content for.
|
|
3408
|
+
* @returns Hover information with markdown content.
|
|
3409
|
+
*/
|
|
3390
3410
|
protected getDeploymentNodeHover(node: DeploymentNode): MaybePromise<Hover | undefined>;
|
|
3411
|
+
/**
|
|
3412
|
+
* Builds hover content for a deployed instance (instance id, element ref, title and kind).
|
|
3413
|
+
* @param node - The deployed instance AST node to generate hover content for.
|
|
3414
|
+
* @returns Hover information with markdown content showing instance details.
|
|
3415
|
+
*/
|
|
3391
3416
|
protected getDeployedInstanceHover(node: DeployedInstance): MaybePromise<Hover | undefined>;
|
|
3392
3417
|
} //#endregion
|
|
3393
3418
|
//#region src/lsp/CodeActionProvider.d.ts
|
|
@@ -3407,10 +3432,6 @@ declare class LikeC4SemanticTokenProvider extends AbstractSemanticTokenProvider
|
|
|
3407
3432
|
private rules;
|
|
3408
3433
|
constructor(services: LikeC4Services);
|
|
3409
3434
|
protected initRules(): void;
|
|
3410
|
-
semanticHighlight(document: LangiumDocument, params: SemanticTokensParams, cancelToken?: CancellationToken$1): Promise<SemanticTokens>;
|
|
3411
|
-
semanticHighlightRange(document: LangiumDocument, params: SemanticTokensRangeParams, cancelToken?: CancellationToken$1): Promise<SemanticTokens>;
|
|
3412
|
-
semanticHighlightDelta(document: LangiumDocument, params: SemanticTokensDeltaParams, cancelToken?: CancellationToken$1): Promise<SemanticTokens | SemanticTokensDelta>;
|
|
3413
|
-
protected ensureState(document: LangiumDocument, cancelToken: CancellationToken$1): Promise<void>;
|
|
3414
3435
|
protected highlightElement(node: AstNode, acceptor: SemanticTokenAcceptor): void | undefined | 'prune';
|
|
3415
3436
|
private highlightNameAndKind;
|
|
3416
3437
|
private highlightView;
|
|
@@ -3438,5 +3459,73 @@ declare class NodeKindProvider$1 implements NodeKindProvider {
|
|
|
3438
3459
|
} //#endregion
|
|
3439
3460
|
//#region src/shared/WorkspaceSymbolProvider.d.ts
|
|
3440
3461
|
declare class WorkspaceSymbolProvider extends DefaultWorkspaceSymbolProvider {} //#endregion
|
|
3462
|
+
//#region src/module.d.ts
|
|
3463
|
+
interface LikeC4AddedSharedServices {
|
|
3464
|
+
lsp: {
|
|
3465
|
+
NodeKindProvider: NodeKindProvider$1;
|
|
3466
|
+
WorkspaceSymbolProvider: WorkspaceSymbolProvider;
|
|
3467
|
+
};
|
|
3468
|
+
workspace: {
|
|
3469
|
+
Cache: WorkspaceCache<string, any>;
|
|
3470
|
+
ProjectsManager: ProjectsManager;
|
|
3471
|
+
IndexManager: IndexManager;
|
|
3472
|
+
LangiumDocuments: LangiumDocuments;
|
|
3473
|
+
WorkspaceManager: LikeC4WorkspaceManager;
|
|
3474
|
+
FileSystemProvider: FileSystemProvider$1;
|
|
3475
|
+
FileSystemWatcher: FileSystemWatcher;
|
|
3476
|
+
ManualLayouts: LikeC4ManualLayouts;
|
|
3477
|
+
};
|
|
3478
|
+
}
|
|
3479
|
+
type LikeC4SharedServices = LangiumSharedServices & LikeC4AddedSharedServices;
|
|
3480
|
+
/**
|
|
3481
|
+
* Declaration of custom services - add your own service classes here.
|
|
3482
|
+
*/
|
|
3483
|
+
interface LikeC4AddedServices {
|
|
3484
|
+
documentation: {
|
|
3485
|
+
DocumentationProvider: LikeC4DocumentationProvider;
|
|
3486
|
+
};
|
|
3487
|
+
validation: {
|
|
3488
|
+
DocumentValidator: LikeC4DocumentValidator;
|
|
3489
|
+
};
|
|
3490
|
+
Rpc: Rpc;
|
|
3491
|
+
mcp: {
|
|
3492
|
+
Server: LikeC4MCPServer;
|
|
3493
|
+
ServerFactory: LikeC4MCPServerFactory;
|
|
3494
|
+
};
|
|
3495
|
+
likec4: {
|
|
3496
|
+
LanguageServices: LikeC4LanguageServices;
|
|
3497
|
+
Views: LikeC4Views;
|
|
3498
|
+
Graphviz: GraphvizPort;
|
|
3499
|
+
Layouter: QueueGraphvizLayoter;
|
|
3500
|
+
DeploymentsIndex: DeploymentsIndex;
|
|
3501
|
+
FqnIndex: FqnIndex;
|
|
3502
|
+
ModelParser: LikeC4ModelParser;
|
|
3503
|
+
ModelBuilder: LikeC4ModelBuilder;
|
|
3504
|
+
ModelLocator: LikeC4ModelLocator;
|
|
3505
|
+
ModelChanges: LikeC4ModelChanges;
|
|
3506
|
+
LastSeen: LastSeenArtifacts;
|
|
3507
|
+
};
|
|
3508
|
+
lsp: {
|
|
3509
|
+
CompletionProvider: LikeC4CompletionProvider;
|
|
3510
|
+
DocumentHighlightProvider: LikeC4DocumentHighlightProvider;
|
|
3511
|
+
DocumentSymbolProvider: LikeC4DocumentSymbolProvider;
|
|
3512
|
+
SemanticTokenProvider: LikeC4SemanticTokenProvider;
|
|
3513
|
+
HoverProvider: LikeC4HoverProvider;
|
|
3514
|
+
CodeLensProvider: LikeC4CodeLensProvider;
|
|
3515
|
+
DocumentLinkProvider: LikeC4DocumentLinkProvider;
|
|
3516
|
+
Formatter: LikeC4Formatter;
|
|
3517
|
+
CodeActionProvider: LikeC4CodeActionProvider;
|
|
3518
|
+
};
|
|
3519
|
+
references: {
|
|
3520
|
+
NameProvider: LikeC4NameProvider;
|
|
3521
|
+
ScopeComputation: LikeC4ScopeComputation;
|
|
3522
|
+
ScopeProvider: LikeC4ScopeProvider;
|
|
3523
|
+
};
|
|
3524
|
+
shared?: LikeC4SharedServices;
|
|
3525
|
+
parser: {
|
|
3526
|
+
ValueConverter: LikeC4ValueConverter;
|
|
3527
|
+
};
|
|
3528
|
+
}
|
|
3529
|
+
type LikeC4Services = LangiumServices & LikeC4AddedServices;
|
|
3441
3530
|
//#endregion
|
|
3442
|
-
export {
|
|
3531
|
+
export { LikeC4Views as a, LikeC4SharedServices as i, LikeC4ModelBuilder as n, ProjectsManager as o, LikeC4Services as r, LikeC4LanguageServices as t };
|