likec4 1.52.0 → 1.54.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 +43 -53
- package/__app__/src/routes/index.js +7 -0
- package/__app__/src/routes/single.js +30 -18
- package/__app__/src/style.css +1 -1
- package/__app__/src/vendors.js +5784 -4786
- package/config/schema.json +130 -89
- package/dist/THIRD-PARTY-LICENSES.md +10 -2
- package/dist/_chunks/filesystem.mjs +68 -68
- package/dist/_chunks/index.d.mts +10 -1
- package/dist/_chunks/index2.d.mts +76 -4
- package/dist/_chunks/libs/@chevrotain/cst-dts-gen.mjs +7 -7
- package/dist/_chunks/libs/@hono/mcp.mjs +35 -24
- package/dist/_chunks/libs/@hono/node-server.mjs +1 -1
- package/dist/_chunks/libs/@logtape/logtape.d.mts +1021 -0
- package/dist/_chunks/libs/@logtape/logtape.mjs +4 -6
- package/dist/_chunks/libs/@modelcontextprotocol/sdk.d.mts +796 -196
- package/dist/_chunks/libs/@modelcontextprotocol/sdk.mjs +6 -6
- package/dist/_chunks/libs/@nanostores/react.d.mts +22 -17
- package/dist/_chunks/libs/@nanostores/react.mjs +1 -1
- package/dist/_chunks/libs/defu.mjs +1 -1
- package/dist/_chunks/libs/destr.mjs +1 -0
- package/dist/_chunks/libs/fast-equals.mjs +1 -1
- package/dist/_chunks/libs/langium.mjs +1 -1
- package/dist/_chunks/libs/picomatch.mjs +1 -1
- package/dist/_chunks/libs/remeda.mjs +2 -2
- package/dist/_chunks/libs/tinyrainbow.mjs +1 -1
- package/dist/_chunks/libs/unstorage.mjs +1 -0
- package/dist/_chunks/node.mjs +1 -0
- package/dist/_chunks/sequence.mjs +1 -1
- package/dist/_chunks/src.mjs +14 -12
- package/dist/_chunks/src2.mjs +51 -51
- package/dist/cli/index.mjs +164 -84
- package/dist/index.d.mts +16 -819
- package/dist/index.mjs +1 -1
- package/dist/vite-plugin/index.mjs +1 -1
- package/dist/vite-plugin/internal.mjs +1 -1
- package/package.json +41 -40
- package/react/index.d.mts +30 -20
- package/react/index.mjs +995 -1736
- package/vite-plugin-modules.d.ts +5 -0
- package/dist/_chunks/LikeC4.mjs +0 -1
- package/dist/_chunks/libs/boxen.d.mts +0 -1
package/dist/_chunks/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as $strip, S as $strict, _ as ZodTransform, a as ZodBoolean, b as output, c as ZodEnum, d as ZodNumber, f as ZodObject, g as ZodString, h as ZodRecord, i as ZodArray, l as ZodInt, m as ZodPipe, o as ZodCustom, p as ZodOptional, r as ZodAny, s as ZodDefault, u as ZodLiteral, v as ZodUnion, x as $partial, y as input } 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
|
|
|
@@ -143,6 +143,13 @@ declare const LikeC4ProjectJsonConfigSchema: ZodObject<{
|
|
|
143
143
|
}, $strict>>;
|
|
144
144
|
inferTechnologyFromIcon: ZodOptional<ZodBoolean>;
|
|
145
145
|
implicitViews: ZodOptional<ZodBoolean>;
|
|
146
|
+
landingPage: ZodOptional<ZodUnion<readonly [ZodObject<{
|
|
147
|
+
redirect: ZodLiteral<true>;
|
|
148
|
+
}, $strict>, ZodObject<{
|
|
149
|
+
include: ZodArray<ZodString>;
|
|
150
|
+
}, $strict>, ZodObject<{
|
|
151
|
+
exclude: ZodArray<ZodString>;
|
|
152
|
+
}, $strict>]>>;
|
|
146
153
|
}, $strip>;
|
|
147
154
|
type LikeC4ProjectJsonConfig = input<typeof LikeC4ProjectJsonConfigSchema>;
|
|
148
155
|
/**
|
|
@@ -272,6 +279,8 @@ type LikeC4ProjectConfigInput = LikeC4ProjectJsonConfig & {
|
|
|
272
279
|
};
|
|
273
280
|
/**
|
|
274
281
|
* Validates Object into a LikeC4ProjectConfig object.
|
|
282
|
+
* Zod v4 can strip optional union keys (e.g. landingPage) from parse output;
|
|
283
|
+
* we validate landingPage once with LandingPageSchema and merge onto the result.
|
|
275
284
|
*/
|
|
276
285
|
declare function validateProjectConfig<C extends Record<string, unknown>>(config: C): LikeC4ProjectConfig;
|
|
277
286
|
/**
|
|
@@ -304,6 +304,7 @@ declare class GraphvizLayouter implements Disposable {
|
|
|
304
304
|
[Symbol.dispose](): void;
|
|
305
305
|
get graphvizPort(): GraphvizPort;
|
|
306
306
|
changePort(graphviz: GraphvizPort): void;
|
|
307
|
+
printToDot(params: LayoutTaskParams): DotSource;
|
|
307
308
|
dotToJson(dot: DotSource): Promise<GraphvizJson>;
|
|
308
309
|
layout<A extends AnyAux>(params: LayoutTaskParams<A>): Promise<LayoutResult<A>>;
|
|
309
310
|
svg<A extends AnyAux>(params: LayoutTaskParams<A>): Promise<{
|
|
@@ -557,11 +558,46 @@ type ManualLayoutsSnapshot = {
|
|
|
557
558
|
hash: string;
|
|
558
559
|
views: Record<ViewId$1, LayoutedView$1>;
|
|
559
560
|
};
|
|
561
|
+
type ManualLayoutUpdateEvent = {
|
|
562
|
+
updated: URI;
|
|
563
|
+
projectId: ProjectId$1;
|
|
564
|
+
viewId: ViewId$1;
|
|
565
|
+
} | {
|
|
566
|
+
removed: URI;
|
|
567
|
+
projectId: ProjectId$1;
|
|
568
|
+
/**
|
|
569
|
+
* Missing if triggered by FS event (file was deleted)
|
|
570
|
+
*/
|
|
571
|
+
viewId?: ViewId$1;
|
|
572
|
+
};
|
|
573
|
+
type ManualLayoutUpdateListener = (event: ManualLayoutUpdateEvent) => void;
|
|
560
574
|
interface LikeC4ManualLayouts {
|
|
575
|
+
/**
|
|
576
|
+
* Reads a single layouted view from the file system by its URI.
|
|
577
|
+
* Used by the language server to get the current layout state.
|
|
578
|
+
*/
|
|
579
|
+
readSnapshot(uri: URI): Promise<LayoutedView$1 | null>;
|
|
561
580
|
read(project: Project): Promise<ManualLayoutsSnapshot | null>;
|
|
562
581
|
write(project: Project, layouted: LayoutedView$1): Promise<Location>;
|
|
563
582
|
remove(project: Project, view: ViewId$1): Promise<Location | null>;
|
|
564
583
|
clearCaches(): void;
|
|
584
|
+
/**
|
|
585
|
+
* Registers a listener for manual layout updates.
|
|
586
|
+
* The listener will be called when a manual layout is created, updated, or deleted.
|
|
587
|
+
*/
|
|
588
|
+
onManualLayoutUpdate(listener: ManualLayoutUpdateListener): Disposable$1;
|
|
589
|
+
/**
|
|
590
|
+
* Handles file system updates for manual layouts.
|
|
591
|
+
* Used by the file system watcher to notify the manual layouts module of changes.
|
|
592
|
+
* @param event The file system event
|
|
593
|
+
*/
|
|
594
|
+
handleFileSystemUpdate(event: {
|
|
595
|
+
update: URI;
|
|
596
|
+
delete?: never;
|
|
597
|
+
} | {
|
|
598
|
+
delete: URI;
|
|
599
|
+
update?: never;
|
|
600
|
+
}): Promise<void>;
|
|
565
601
|
} //#endregion
|
|
566
602
|
//#region src/filesystem/noop.d.ts
|
|
567
603
|
//#endregion
|
|
@@ -676,6 +712,7 @@ type Id = 'deployment' | 'element' | 'group' | 'instance' | 'model' | 'node' | A
|
|
|
676
712
|
type LikeC4View = DeploymentView | DynamicView | ElementView;
|
|
677
713
|
declare const LikeC4View = "LikeC4View";
|
|
678
714
|
type LineOptions = 'dashed' | 'dotted' | 'solid';
|
|
715
|
+
type MetadataFilterValue = boolean | string;
|
|
679
716
|
type MetadataProperty = MetadataBody;
|
|
680
717
|
declare const MetadataProperty = "MetadataProperty";
|
|
681
718
|
type MetadataValue = MarkdownOrString | MetadataArray;
|
|
@@ -712,7 +749,7 @@ type ViewRule = ViewRuleAutoLayout | ViewRuleGlobalPredicateRef | ViewRuleGroup
|
|
|
712
749
|
declare const ViewRule = "ViewRule";
|
|
713
750
|
type ViewRuleStyleOrGlobalRef = ViewRuleGlobalStyle | ViewRuleStyle;
|
|
714
751
|
declare const ViewRuleStyleOrGlobalRef = "ViewRuleStyleOrGlobalRef";
|
|
715
|
-
type WhereElement = WhereElementKind | WhereElementTag;
|
|
752
|
+
type WhereElement = WhereElementKind | WhereElementMetadata | WhereElementTag;
|
|
716
753
|
declare const WhereElement = "WhereElement";
|
|
717
754
|
type WhereElementExpression = WhereBinaryExpression | WhereElement | WhereElementNegation;
|
|
718
755
|
declare const WhereElementExpression = "WhereElementExpression";
|
|
@@ -720,7 +757,9 @@ type WhereExpression = WhereElementExpression | WhereRelationExpression;
|
|
|
720
757
|
declare const WhereExpression = "WhereExpression";
|
|
721
758
|
type WhereKindEqual = WhereElementKind | WhereRelationKind | WhereRelationParticipantKind;
|
|
722
759
|
declare const WhereKindEqual = "WhereKindEqual";
|
|
723
|
-
type
|
|
760
|
+
type WhereMetadataEqual = WhereElementMetadata | WhereRelationMetadata | WhereRelationParticipantMetadata;
|
|
761
|
+
declare const WhereMetadataEqual = "WhereMetadataEqual";
|
|
762
|
+
type WhereRelation = WhereRelationKind | WhereRelationMetadata | WhereRelationParticipantKind | WhereRelationParticipantMetadata | WhereRelationParticipantTag | WhereRelationTag;
|
|
724
763
|
declare const WhereRelation = "WhereRelation";
|
|
725
764
|
type WhereRelationExpression = WhereBinaryExpression | WhereRelation | WhereRelationNegation;
|
|
726
765
|
declare const WhereRelationExpression = "WhereRelationExpression";
|
|
@@ -1251,8 +1290,9 @@ declare const MetadataArray = "MetadataArray";
|
|
|
1251
1290
|
interface MetadataAttribute extends AstNode {
|
|
1252
1291
|
readonly $container: MetadataBody;
|
|
1253
1292
|
readonly $type: 'MetadataAttribute';
|
|
1293
|
+
boolValue: boolean;
|
|
1254
1294
|
key: string;
|
|
1255
|
-
value
|
|
1295
|
+
value?: MetadataValue;
|
|
1256
1296
|
}
|
|
1257
1297
|
declare const MetadataAttribute = "MetadataAttribute";
|
|
1258
1298
|
interface MetadataBody extends AstNode {
|
|
@@ -1606,6 +1646,15 @@ interface WhereElementKind extends AstNode {
|
|
|
1606
1646
|
value: Reference<DeploymentNodeOrElementKind>;
|
|
1607
1647
|
}
|
|
1608
1648
|
declare const WhereElementKind = "WhereElementKind";
|
|
1649
|
+
interface WhereElementMetadata extends AstNode {
|
|
1650
|
+
readonly $container: FqnExprWhere | WhereBinaryExpression | WhereElementNegation;
|
|
1651
|
+
readonly $type: 'WhereElementMetadata';
|
|
1652
|
+
key: Id;
|
|
1653
|
+
not: boolean;
|
|
1654
|
+
operator?: 'is' | string;
|
|
1655
|
+
value?: MetadataFilterValue;
|
|
1656
|
+
}
|
|
1657
|
+
declare const WhereElementMetadata = "WhereElementMetadata";
|
|
1609
1658
|
interface WhereElementNegation extends AstNode {
|
|
1610
1659
|
readonly $container: FqnExprWhere | WhereBinaryExpression | WhereElementNegation;
|
|
1611
1660
|
readonly $type: 'WhereElementNegation';
|
|
@@ -1628,6 +1677,15 @@ interface WhereRelationKind extends AstNode {
|
|
|
1628
1677
|
value: Reference<RelationshipKind>;
|
|
1629
1678
|
}
|
|
1630
1679
|
declare const WhereRelationKind = "WhereRelationKind";
|
|
1680
|
+
interface WhereRelationMetadata extends AstNode {
|
|
1681
|
+
readonly $container: RelationExprWhere | WhereBinaryExpression | WhereRelationNegation;
|
|
1682
|
+
readonly $type: 'WhereRelationMetadata';
|
|
1683
|
+
key: Id;
|
|
1684
|
+
not: boolean;
|
|
1685
|
+
operator?: 'is' | string;
|
|
1686
|
+
value?: MetadataFilterValue;
|
|
1687
|
+
}
|
|
1688
|
+
declare const WhereRelationMetadata = "WhereRelationMetadata";
|
|
1631
1689
|
interface WhereRelationNegation extends AstNode {
|
|
1632
1690
|
readonly $container: RelationExprWhere | WhereBinaryExpression | WhereRelationNegation;
|
|
1633
1691
|
readonly $type: 'WhereRelationNegation';
|
|
@@ -1643,6 +1701,16 @@ interface WhereRelationParticipantKind extends AstNode {
|
|
|
1643
1701
|
value: Reference<DeploymentNodeOrElementKind>;
|
|
1644
1702
|
}
|
|
1645
1703
|
declare const WhereRelationParticipantKind = "WhereRelationParticipantKind";
|
|
1704
|
+
interface WhereRelationParticipantMetadata extends AstNode {
|
|
1705
|
+
readonly $container: RelationExprWhere | WhereBinaryExpression | WhereRelationNegation;
|
|
1706
|
+
readonly $type: 'WhereRelationParticipantMetadata';
|
|
1707
|
+
key: Id;
|
|
1708
|
+
not: boolean;
|
|
1709
|
+
operator?: 'is' | string;
|
|
1710
|
+
participant: Participant;
|
|
1711
|
+
value?: MetadataFilterValue;
|
|
1712
|
+
}
|
|
1713
|
+
declare const WhereRelationParticipantMetadata = "WhereRelationParticipantMetadata";
|
|
1646
1714
|
interface WhereRelationParticipantTag extends AstNode {
|
|
1647
1715
|
readonly $container: RelationExprWhere | WhereBinaryExpression | WhereRelationNegation;
|
|
1648
1716
|
readonly $type: 'WhereRelationParticipantTag';
|
|
@@ -1836,15 +1904,19 @@ type LikeC4AstType = {
|
|
|
1836
1904
|
WhereElement: WhereElement;
|
|
1837
1905
|
WhereElementExpression: WhereElementExpression;
|
|
1838
1906
|
WhereElementKind: WhereElementKind;
|
|
1907
|
+
WhereElementMetadata: WhereElementMetadata;
|
|
1839
1908
|
WhereElementNegation: WhereElementNegation;
|
|
1840
1909
|
WhereElementTag: WhereElementTag;
|
|
1841
1910
|
WhereExpression: WhereExpression;
|
|
1842
1911
|
WhereKindEqual: WhereKindEqual;
|
|
1912
|
+
WhereMetadataEqual: WhereMetadataEqual;
|
|
1843
1913
|
WhereRelation: WhereRelation;
|
|
1844
1914
|
WhereRelationExpression: WhereRelationExpression;
|
|
1845
1915
|
WhereRelationKind: WhereRelationKind;
|
|
1916
|
+
WhereRelationMetadata: WhereRelationMetadata;
|
|
1846
1917
|
WhereRelationNegation: WhereRelationNegation;
|
|
1847
1918
|
WhereRelationParticipantKind: WhereRelationParticipantKind;
|
|
1919
|
+
WhereRelationParticipantMetadata: WhereRelationParticipantMetadata;
|
|
1848
1920
|
WhereRelationParticipantTag: WhereRelationParticipantTag;
|
|
1849
1921
|
WhereRelationTag: WhereRelationTag;
|
|
1850
1922
|
WhereTagEqual: WhereTagEqual;
|
|
@@ -2364,7 +2436,7 @@ declare class LastSeenArtifacts {
|
|
|
2364
2436
|
model(projectId: c4.ProjectId): LikeC4Model.Computed | undefined;
|
|
2365
2437
|
} //#endregion
|
|
2366
2438
|
//#region src/model/model-builder.d.ts
|
|
2367
|
-
type ModelParsedListener = (docs: URI[]) => void;
|
|
2439
|
+
type ModelParsedListener = (projectId: ProjectId, docs: URI[]) => void;
|
|
2368
2440
|
interface LikeC4ModelBuilder extends Disposable$1 {
|
|
2369
2441
|
parseModel(projectId?: ProjectId | undefined, cancelToken?: CancellationToken$1): Promise<LikeC4Model<UnknownParsed> | null>;
|
|
2370
2442
|
unsafeSyncComputeModel(projectId: ProjectId): LikeC4Model<UnknownComputed>;
|