likec4 1.50.0 → 1.52.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 (46) hide show
  1. package/__app__/src/ProjectsOverview.js +1 -1
  2. package/__app__/src/likec4.js +277 -164
  3. package/__app__/src/main.js +2 -56
  4. package/__app__/src/routes/index.js +85 -18
  5. package/__app__/src/routes/projects.js +1 -1
  6. package/__app__/src/routes/single.js +433 -53
  7. package/__app__/src/style.css +1 -1
  8. package/__app__/src/vendors.js +18646 -17381
  9. package/__app__/src/webcomponent.js +1 -1
  10. package/config/schema.json +1 -1
  11. package/dist/THIRD-PARTY-LICENSES.md +183 -285
  12. package/dist/_chunks/LikeC4.mjs +1 -1154
  13. package/dist/_chunks/filesystem.mjs +1229 -0
  14. package/dist/_chunks/index2.d.mts +49 -18
  15. package/dist/_chunks/libs/@hono/mcp.mjs +9 -9
  16. package/dist/_chunks/libs/@hono/node-server.mjs +1 -1
  17. package/dist/_chunks/libs/@logtape/logtape.mjs +1 -1
  18. package/dist/_chunks/libs/@modelcontextprotocol/sdk.d.mts +13 -13
  19. package/dist/_chunks/libs/ansi-align.mjs +2 -0
  20. package/dist/_chunks/libs/ansi-regex.mjs +1 -0
  21. package/dist/_chunks/libs/ansi-styles.mjs +1 -0
  22. package/dist/_chunks/libs/atomically.mjs +1 -1
  23. package/dist/_chunks/libs/boxen.d.mts +1 -0
  24. package/dist/_chunks/libs/boxen.mjs +22 -0
  25. package/dist/_chunks/libs/conf.mjs +1 -1
  26. package/dist/_chunks/libs/langium.d.mts +1 -1
  27. package/dist/_chunks/libs/langium.mjs +17 -17
  28. package/dist/_chunks/libs/remeda.mjs +2 -2
  29. package/dist/_chunks/libs/tinyrainbow.mjs +1 -1
  30. package/dist/_chunks/libs/vscode-languageserver.mjs +1 -0
  31. package/dist/_chunks/sequence.mjs +1 -1
  32. package/dist/_chunks/src.mjs +1 -1
  33. package/dist/_chunks/src2.mjs +64 -64
  34. package/dist/cli/index.mjs +84 -74
  35. package/dist/index.d.mts +836 -1
  36. package/dist/index.mjs +1 -1
  37. package/dist/vite-plugin/index.mjs +1 -1
  38. package/dist/vite-plugin/internal.mjs +1 -1
  39. package/package.json +23 -24
  40. package/react/index.d.mts +56 -2
  41. package/react/index.mjs +1575 -595
  42. package/dist/_chunks/binary.mjs +0 -72
  43. package/dist/_chunks/libs/@logtape/logtape.d.mts +0 -741
  44. package/dist/_chunks/libs/@msgpack/msgpack.mjs +0 -1
  45. package/dist/_chunks/libs/@smithy/is-array-buffer.mjs +0 -1
  46. package/dist/_chunks/libs/@smithy/util-base64.mjs +0 -1
@@ -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 PrecomputedScopes, A as ValidationOptions, B as ReferenceDescription, C as CodeLensParams, Ct as TextEdit, D as SemanticTokensParams, E as SemanticTokensDeltaParams, F as MaybePromise, G as AstNode, H as WorkspaceCache, I as DefaultScopeProvider, J as Reference, K as AstNodeDescription, L as Scope, M as DefaultScopeComputation, N as DefaultValueConverter, O as SemanticTokensRangeParams, P as ValueType, Q as LangiumDocumentFactory, R as JSDocDocumentationProvider, S as CodeActionParams, St as SymbolKind, T as DocumentSymbolParams, U as AsyncDisposable, V as DefaultNameProvider, W as Disposable$1, X as DefaultLangiumDocuments, Y as ReferenceInfo, Z as LangiumDocument, _ as CodeLensProvider, _t as Hover, a as LangiumServices, at as CancellationToken$1, b as FileSelector, bt as SemanticTokens, c as AbstractSemanticTokenProvider, ct as CodeAction, d as AbstractFormatter, dt as CompletionItemKind, et as Stream, f as FormattingRegion, ft as Diagnostic, g as DefaultDocumentHighlightProvider, gt as FormattingOptions, h as DocumentLinkProvider, ht as DocumentSymbol, i as NextFeature, it as URI, j as DiagnosticInfo, k as DefaultDocumentValidator, l as SemanticTokenAcceptor, lt as CodeLens, m as NodeKindProvider, mt as DocumentLink, n as CompletionContext, nt as FileSystemProvider, o as LangiumSharedServices, ot as NotificationType, p as DocumentSymbolProvider, pt as DocumentHighlight, q as CstNode, r as DefaultCompletionProvider, rt as Keyword, s as DefaultWorkspaceSymbolProvider, st as RequestType, t as CompletionAcceptor, tt as FileSystemNode, u as AstNodeHoverProvider, ut as Command, v as CodeActionProvider, vt as Location, w as DocumentLinkParams, wt as WorkspaceFolder, x as BuildOptions, xt as SemanticTokensDelta, y as DefaultWorkspaceManager, yt as Range, z as DefaultIndexManager } from "./libs/langium.mjs";
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";
@@ -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,6 +348,11 @@ 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
@@ -375,8 +381,8 @@ declare class LikeC4DocumentationProvider extends JSDocDocumentationProvider {
375
381
  //#region src/workspace/ProjectsManager.d.ts
376
382
  type DocOrUri = LangiumDocument | string | URI;
377
383
  /**
378
- * A tagged string that represents a project folder URI
379
- * Always has trailing slash.
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.
380
386
  */
381
387
  type ProjectFolder = Tagged<string, 'ProjectFolder'>;
382
388
  declare function ProjectFolder(folder: URI | string): ProjectFolder;
@@ -497,6 +503,7 @@ declare class ProjectsManager {
497
503
  private getWorkspaceFolder;
498
504
  private notifyListeners;
499
505
  private updateIncludesExcludes;
506
+ private warnIfConfigOverride;
500
507
  } //#endregion
501
508
  //#region src/filesystem/types.d.ts
502
509
  interface FileNode extends FileSystemNode {
@@ -626,7 +633,7 @@ interface LikeC4MCPServerFactory {
626
633
  }
627
634
  //#endregion
628
635
  //#region src/generated/ast.d.ts
629
- type AnyProperty = DynamicViewProperty | ElementProperty | RelationProperty | StringProperty | ViewProperty;
636
+ type AnyProperty = DynamicViewProperty | ElementProperty | NavigateToProperty | NotationProperty | NotesProperty | RelationProperty | RelationshipStyleProperty | StringProperty | StyleProperty | ViewProperty;
630
637
  declare const AnyProperty = "AnyProperty";
631
638
  type ArrowType = 'crow' | 'diamond' | 'dot' | 'none' | 'normal' | 'odiamond' | 'odot' | 'onormal' | 'open' | 'vee';
632
639
  type BorderStyleValue = 'none' | LineOptions;
@@ -1998,7 +2005,6 @@ interface ParsedAstElementView {
1998
2005
  tags: c4.NonEmptyArray<c4.Tag> | null;
1999
2006
  links: c4.NonEmptyArray<c4.Link> | null;
2000
2007
  rules: c4.ElementViewRule[];
2001
- manualLayout?: c4.ViewManualLayout;
2002
2008
  }
2003
2009
  interface ParsedAstDynamicView {
2004
2010
  id: c4.ViewId;
@@ -2010,7 +2016,6 @@ interface ParsedAstDynamicView {
2010
2016
  steps: c4.DynamicViewStep[];
2011
2017
  rules: Array<c4.DynamicViewRule>;
2012
2018
  variant: c4.DynamicViewDisplayVariant | undefined;
2013
- manualLayout?: c4.ViewManualLayout;
2014
2019
  }
2015
2020
  interface ParsedAstDeploymentView {
2016
2021
  id: c4.ViewId;
@@ -2020,7 +2025,6 @@ interface ParsedAstDeploymentView {
2020
2025
  tags: c4.NonEmptyArray<c4.Tag> | null;
2021
2026
  links: c4.NonEmptyArray<c4.Link> | null;
2022
2027
  rules: Array<c4.DeploymentViewRule>;
2023
- manualLayout?: c4.ViewManualLayout;
2024
2028
  }
2025
2029
  type ParsedAstView = ParsedAstElementView | ParsedAstDynamicView | ParsedAstDeploymentView;
2026
2030
  interface AstNodeDescriptionWithFqn extends AstNodeDescription {
@@ -2509,7 +2513,7 @@ interface LikeC4Views {
2509
2513
  */
2510
2514
  adhocView(predicates: AdhocViewPredicate[], projectId?: ProjectId | undefined): Promise<LayoutedView>;
2511
2515
  } //#endregion
2512
- //#region src/index.d.ts
2516
+ //#region src/views/index.d.ts
2513
2517
  //#endregion
2514
2518
  //#region src/model/parser/Base.d.ts
2515
2519
  type ParserLevel = 'base' | 'model' | 'deployment' | 'fqnref' | 'relation' | 'views' | 'globals' | 'imports' | 'specification';
@@ -3310,7 +3314,42 @@ interface LikeC4LanguageServices {
3310
3314
  * Returns the location of the specified element, relation, view or deployment element
3311
3315
  */
3312
3316
  locate(params: Locate.Params): Locate.Res;
3317
+ /**
3318
+ * Formats documents and returns a map of document URI → formatted source text.
3319
+ *
3320
+ * Target selection uses union semantics:
3321
+ * - No options: formats all documents across all projects
3322
+ * - `projectIds`: includes all documents from those projects
3323
+ * - `documentUris`: includes specific documents
3324
+ * - Both: formats the union (deduplicated)
3325
+ */
3326
+ format(options?: FormatOptions): Promise<Map<string, string>>;
3313
3327
  dispose(): Promise<void>;
3328
+ }
3329
+ /**
3330
+ * Options for {@link LikeC4LanguageServices.format}.
3331
+ *
3332
+ * Target selection uses union semantics:
3333
+ * - Omit both `projectIds` and `documentUris` to format **all** documents.
3334
+ * - Provide `projectIds` to include all documents from those projects.
3335
+ * - Provide `documentUris` to include specific documents.
3336
+ * - Provide both to format the **union** of project documents and specified documents.
3337
+ */
3338
+ interface FormatOptions {
3339
+ /** Include all documents from these projects. */
3340
+ projectIds?: ReadonlyArray<ProjectId>;
3341
+ /** Include these specific documents (by URI string). */
3342
+ documentUris?: ReadonlyArray<string>;
3343
+ /** Size of a tab in spaces (default: 2). */
3344
+ tabSize?: number;
3345
+ /** Prefer spaces over tabs (default: true). */
3346
+ insertSpaces?: boolean;
3347
+ /** Trim trailing whitespace on a line. */
3348
+ trimTrailingWhitespace?: boolean;
3349
+ /** Insert a newline character at the end of the file if one does not exist. */
3350
+ insertFinalNewline?: boolean;
3351
+ /** Trim all newlines after the final newline at the end of the file. */
3352
+ trimFinalNewlines?: boolean;
3314
3353
  } //#endregion
3315
3354
  //#region src/lsp/CodeLensProvider.d.ts
3316
3355
  declare class LikeC4CodeLensProvider implements CodeLensProvider {
@@ -3417,7 +3456,7 @@ declare class LikeC4CodeActionProvider implements CodeActionProvider {
3417
3456
  * @throws `OperationCancelled` if cancellation is detected during execution
3418
3457
  * @throws `ResponseError` if an error is detected that should be sent as response to the client
3419
3458
  */
3420
- getCodeActions(document: LangiumDocument, params: CodeActionParams): CommandOrCodeAction[] | undefined;
3459
+ getCodeActions(_document: LangiumDocument, _params: CodeActionParams): CommandOrCodeAction[] | undefined;
3421
3460
  } //#endregion
3422
3461
  //#region src/lsp/SemanticTokenProvider.d.ts
3423
3462
  declare class LikeC4SemanticTokenProvider extends AbstractSemanticTokenProvider {
@@ -3425,10 +3464,6 @@ declare class LikeC4SemanticTokenProvider extends AbstractSemanticTokenProvider
3425
3464
  private rules;
3426
3465
  constructor(services: LikeC4Services);
3427
3466
  protected initRules(): void;
3428
- semanticHighlight(document: LangiumDocument, params: SemanticTokensParams, cancelToken?: CancellationToken$1): Promise<SemanticTokens>;
3429
- semanticHighlightRange(document: LangiumDocument, params: SemanticTokensRangeParams, cancelToken?: CancellationToken$1): Promise<SemanticTokens>;
3430
- semanticHighlightDelta(document: LangiumDocument, params: SemanticTokensDeltaParams, cancelToken?: CancellationToken$1): Promise<SemanticTokens | SemanticTokensDelta>;
3431
- protected ensureState(document: LangiumDocument, cancelToken: CancellationToken$1): Promise<void>;
3432
3467
  protected highlightElement(node: AstNode, acceptor: SemanticTokenAcceptor): void | undefined | 'prune';
3433
3468
  private highlightNameAndKind;
3434
3469
  private highlightView;
@@ -3492,6 +3527,7 @@ interface LikeC4AddedServices {
3492
3527
  likec4: {
3493
3528
  LanguageServices: LikeC4LanguageServices;
3494
3529
  Views: LikeC4Views;
3530
+ Graphviz: GraphvizPort;
3495
3531
  Layouter: QueueGraphvizLayoter;
3496
3532
  DeploymentsIndex: DeploymentsIndex;
3497
3533
  FqnIndex: FqnIndex;
@@ -3523,10 +3559,5 @@ interface LikeC4AddedServices {
3523
3559
  };
3524
3560
  }
3525
3561
  type LikeC4Services = LangiumServices & LikeC4AddedServices;
3526
- /**
3527
- * Most probably you don't need to use this function directly.
3528
- * Use {@link createLanguageServices} instead.
3529
- * @internal
3530
- */
3531
3562
  //#endregion
3532
3563
  export { LikeC4Views as a, LikeC4SharedServices as i, LikeC4ModelBuilder as n, ProjectsManager as o, LikeC4Services as r, LikeC4LanguageServices as t };