likec4 1.59.4 → 1.61.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 (186) hide show
  1. package/README.md +2 -0
  2. package/__app__/codegen/react.mjs +4 -10
  3. package/__app__/codegen/webcomponent.mjs +6 -131
  4. package/__app__/index.html +15 -15
  5. package/__app__/src/aichat/index.mjs +11 -7
  6. package/__app__/src/chunks/AIChat.mjs +1355 -739
  7. package/__app__/src/chunks/ErrorComponent.mjs +444 -0
  8. package/__app__/src/chunks/Header.mjs +269 -0
  9. package/__app__/src/chunks/ViewReact.mjs +438 -0
  10. package/__app__/src/chunks/find.mjs +38 -0
  11. package/__app__/src/chunks/hooks.mjs +158 -472
  12. package/__app__/src/chunks/libs/@tabler/icons-react.mjs +340 -0
  13. package/__app__/src/chunks/libs/@tanstack-ai.mjs +11841 -1417
  14. package/__app__/src/chunks/libs/@tanstack.mjs +5110 -2404
  15. package/__app__/src/chunks/libs/fast-equals.mjs +507 -214
  16. package/__app__/src/chunks/libs/html-to-image.mjs +613 -0
  17. package/__app__/src/chunks/libs/nanostores.mjs +170 -0
  18. package/__app__/src/chunks/libs/react-resizable-panels.mjs +2792 -0
  19. package/__app__/src/chunks/react.mjs +22 -0
  20. package/__app__/src/chunks/rolldown-runtime.mjs +16 -29
  21. package/__app__/src/chunks/router.mjs +106 -0
  22. package/__app__/src/chunks/scope.mjs +106 -0
  23. package/__app__/src/chunks/searchParams.mjs +29 -0
  24. package/__app__/src/chunks/single-index.mjs +465 -0
  25. package/__app__/src/chunks/styled-system.mjs +1826 -2528
  26. package/__app__/src/chunks/useAsync.mjs +69 -0
  27. package/__app__/src/chunks/useSyncedRef.mjs +16 -0
  28. package/__app__/src/components/ColorSchemeToggle.mjs +124 -0
  29. package/__app__/src/components/CopyToClipboard.mjs +53 -0
  30. package/__app__/src/components/ErrorComponent.mjs +1 -0
  31. package/__app__/src/components/NavigationPanel.mjs +63 -0
  32. package/__app__/src/components/NotFound.mjs +155 -0
  33. package/__app__/src/components/ViewOutlet.mjs +9 -0
  34. package/__app__/src/components/model-diff/CompareModelProvider.mjs +44 -0
  35. package/__app__/src/components/model-diff/ModelDiffPanel.mjs +179 -0
  36. package/__app__/src/components/model-diff/compare-model.mjs +76 -0
  37. package/__app__/src/components/model-diff/state.mjs +45 -0
  38. package/__app__/src/components/search/OverviewSearch.mjs +92 -0
  39. package/__app__/src/components/search/OverviewSearchAdapter.mjs +94 -0
  40. package/__app__/src/components/sidebar/DiagramTree.css.mjs +48 -0
  41. package/__app__/src/components/sidebar/DiagramsTree.mjs +304 -0
  42. package/__app__/src/components/sidebar/Drawer.mjs +178 -0
  43. package/__app__/src/components/sidebar/SidebarBurger.mjs +28 -0
  44. package/__app__/src/components/sidebar/data.mjs +94 -0
  45. package/__app__/src/components/sidebar/state.mjs +16 -0
  46. package/__app__/src/components/view-page/Header.mjs +1 -0
  47. package/__app__/src/components/view-page/SelectProject.mjs +258 -0
  48. package/__app__/src/components/view-page/ShareModal.mjs +111 -0
  49. package/__app__/src/components/view-page/share-modal/AlertLocalhost.mjs +31 -0
  50. package/__app__/src/components/view-page/share-modal/CopyButtonChild.mjs +36 -0
  51. package/__app__/src/components/view-page/share-modal/EmbedPanel.mjs +100 -0
  52. package/__app__/src/components/view-page/share-modal/WebcomponentsPanel.mjs +264 -0
  53. package/__app__/src/components/view-page/state.mjs +17 -0
  54. package/__app__/src/context/LikeC4CustomizationContext.mjs +26 -0
  55. package/__app__/src/context/LikeC4IconRendererContext.mjs +29 -0
  56. package/__app__/src/context/LikeC4ModelContext.mjs +34 -0
  57. package/__app__/src/context/LikeC4ProjectsContext.mjs +40 -0
  58. package/__app__/src/context/ModelDiffsContext.mjs +33 -0
  59. package/__app__/src/context/safeCtx.mjs +14 -0
  60. package/__app__/src/fonts.css +112 -1
  61. package/__app__/src/hooks.mjs +1 -0
  62. package/__app__/src/main.mjs +6 -29151
  63. package/__app__/src/pages/EmbedPage.mjs +93 -0
  64. package/__app__/src/pages/ExportPage.mjs +691 -0
  65. package/__app__/src/pages/ProjectsOverview.mjs +23 -0
  66. package/__app__/src/pages/ViewAsD2.mjs +105 -0
  67. package/__app__/src/pages/ViewAsDot.mjs +65 -0
  68. package/__app__/src/pages/ViewAsMmd.mjs +109 -0
  69. package/__app__/src/pages/ViewAsPuml.mjs +105 -0
  70. package/__app__/src/pages/ViewEditor.mjs +220 -0
  71. package/__app__/src/pages/ViewReact.mjs +1 -0
  72. package/__app__/src/pages/export-layout.mjs +95 -0
  73. package/__app__/src/pages/export-page-params.mjs +9 -0
  74. package/__app__/src/pages/styles.css.mjs +23 -0
  75. package/__app__/src/routeTree.gen.mjs +105 -0
  76. package/__app__/src/router.mjs +1 -0
  77. package/__app__/src/routes/__root.mjs +65 -0
  78. package/__app__/src/routes/index.css.mjs +29 -0
  79. package/__app__/src/routes/index.mjs +32 -0
  80. package/__app__/src/routes/project._projectId/-components.mjs +100 -0
  81. package/__app__/src/routes/project._projectId/embed._viewId.mjs +5 -0
  82. package/__app__/src/routes/project._projectId/export._viewId.mjs +24 -0
  83. package/__app__/src/routes/project._projectId/index.mjs +14 -0
  84. package/__app__/src/routes/project._projectId/route.mjs +93 -0
  85. package/__app__/src/routes/project._projectId/view._viewId.d2.mjs +34 -0
  86. package/__app__/src/routes/project._projectId/view._viewId.dot.mjs +41 -0
  87. package/__app__/src/routes/project._projectId/view._viewId.index.mjs +7 -0
  88. package/__app__/src/routes/project._projectId/view._viewId.mjs +23 -0
  89. package/__app__/src/routes/project._projectId/view._viewId.mmd.mjs +39 -0
  90. package/__app__/src/routes/project._projectId/view._viewId.puml.mjs +34 -0
  91. package/__app__/src/routes/projects.mjs +36 -0
  92. package/__app__/src/routes/single-index.mjs +1 -0
  93. package/__app__/src/routes/webcomponent._.mjs +94 -0
  94. package/__app__/src/style.css +18497 -1
  95. package/config/schema.json +146 -97
  96. package/dist/app/render-view-client.css +1 -1
  97. package/dist/app/render-view-client.js +394 -238
  98. package/dist/chunks/enableServer.mjs +1 -1
  99. package/dist/chunks/filenames.mjs +25 -17
  100. package/dist/chunks/generate-likec4.mjs +5 -0
  101. package/dist/chunks/index.d.mts +255 -194
  102. package/dist/chunks/index2.d.mts +8246 -3610
  103. package/dist/chunks/libs/@chenglou/pretext.mjs +9 -0
  104. package/dist/chunks/libs/@chevrotain/gast.mjs +27 -1
  105. package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +81 -9
  106. package/dist/chunks/libs/@logtape/logtape.mjs +5 -4
  107. package/dist/chunks/libs/@lume/kiwi.mjs +1 -1
  108. package/dist/chunks/libs/@ts-graphviz/common.d.mts +2 -4
  109. package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -1
  110. package/dist/chunks/libs/birpc.mjs +1 -1
  111. package/dist/chunks/libs/chevrotain-allstar.mjs +2 -2
  112. package/dist/chunks/libs/chevrotain.mjs +88 -36
  113. package/dist/chunks/libs/clone.mjs +1 -0
  114. package/dist/chunks/libs/eventemitter3.mjs +1 -1
  115. package/dist/chunks/libs/fast-equals.mjs +1 -0
  116. package/dist/chunks/libs/fontkit.mjs +1 -0
  117. package/dist/chunks/libs/json5.mjs +4 -4
  118. package/dist/chunks/libs/langium.d.mts +6707 -6715
  119. package/dist/chunks/libs/langium.mjs +16 -24
  120. package/dist/chunks/libs/merge-error-cause.mjs +1 -1
  121. package/dist/chunks/libs/p-limit.mjs +1 -0
  122. package/dist/chunks/libs/p-queue.mjs +1 -1
  123. package/dist/chunks/libs/package-manager-detector.mjs +1 -1
  124. package/dist/chunks/libs/pako.mjs +1 -1
  125. package/dist/chunks/libs/pathe.mjs +1 -1
  126. package/dist/chunks/libs/pretty-ms.mjs +1 -1
  127. package/dist/chunks/libs/remeda.mjs +1 -1
  128. package/dist/chunks/libs/ufo.mjs +1 -1
  129. package/dist/chunks/libs/unstorage.mjs +1 -1
  130. package/dist/chunks/libs/which.mjs +1 -1
  131. package/dist/chunks/node.mjs +111 -77
  132. package/dist/chunks/rolldown-runtime.mjs +1 -1
  133. package/dist/chunks/sequence-view.mjs +1 -1
  134. package/dist/chunks/vite-plugin.mjs +185 -166
  135. package/dist/cli/index.mjs +254 -1306
  136. package/dist/config/index.d.mts +66 -5
  137. package/dist/config/index.mjs +1 -1
  138. package/dist/generators/likec4.d.mts +6530 -0
  139. package/dist/generators/likec4.mjs +1 -0
  140. package/dist/index.d.mts +2 -4
  141. package/dist/model/index.d.mts +0 -7
  142. package/dist/vite-plugin/index.d.mts +83 -58
  143. package/dist/vite-plugin/index.mjs +1 -1
  144. package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +8 -0
  145. package/dist/vite-plugin/internal/index.d.mts +92 -17
  146. package/dist/vite-plugin/internal/index.mjs +225 -126
  147. package/generators/likec4/package.json +4 -0
  148. package/package.json +134 -122
  149. package/react/index.d.mts +7496 -26659
  150. package/react/index.mjs +533 -63936
  151. package/react/rolldown-runtime-CfRud99p.js +1 -0
  152. package/skills/likec4-dsl/SKILL.md +474 -0
  153. package/skills/likec4-dsl/evals/evals-public.json +207 -0
  154. package/skills/likec4-dsl/evals/grading-spec.json +603 -0
  155. package/skills/likec4-dsl/references/bridge-leanix-drawio.md +42 -0
  156. package/skills/likec4-dsl/references/cli.md +168 -0
  157. package/skills/likec4-dsl/references/configuration.md +266 -0
  158. package/skills/likec4-dsl/references/deployment.md +160 -0
  159. package/skills/likec4-dsl/references/diffs.md +52 -0
  160. package/skills/likec4-dsl/references/dynamic-views.md +455 -0
  161. package/skills/likec4-dsl/references/examples.md +370 -0
  162. package/skills/likec4-dsl/references/identifier-validity.md +90 -0
  163. package/skills/likec4-dsl/references/include-predicates-wildcards.md +180 -0
  164. package/skills/likec4-dsl/references/model.md +182 -0
  165. package/skills/likec4-dsl/references/predicates.md +123 -0
  166. package/skills/likec4-dsl/references/relationships-bidirectional.md +176 -0
  167. package/skills/likec4-dsl/references/specification.md +79 -0
  168. package/skills/likec4-dsl/references/style-tokens-colors.md +150 -0
  169. package/skills/likec4-dsl/references/troubleshooting.md +101 -0
  170. package/skills/likec4-dsl/references/views.md +329 -0
  171. package/vite-plugin-modules.d.ts +126 -51
  172. package/__app__/src/chunks/LikeC4Styles.mjs +0 -2306
  173. package/__app__/src/chunks/ProjectsOverview.mjs +0 -537
  174. package/__app__/src/chunks/es.mjs +0 -439
  175. package/__app__/src/chunks/libs/@floating-ui.mjs +0 -2532
  176. package/__app__/src/chunks/libs/@mantine.mjs +0 -13868
  177. package/__app__/src/chunks/libs/@xstate/react.mjs +0 -2015
  178. package/__app__/src/chunks/libs/@xyflow/react.mjs +0 -5367
  179. package/__app__/src/chunks/libs/bezier-js.mjs +0 -1007
  180. package/__app__/src/chunks/libs/d3.mjs +0 -2817
  181. package/__app__/src/chunks/libs/framer.mjs +0 -5926
  182. package/__app__/src/chunks/libs/zod.mjs +0 -3176
  183. package/dist/chunks/libs/@chevrotain/types.d.mts +0 -108
  184. package/dist/chunks/libs/picomatch.mjs +0 -1
  185. package/dist/chunks/libs/zod.d.mts +0 -3840
  186. package/dist/chunks/libs/zod.mjs +0 -65
@@ -0,0 +1 @@
1
+ import{r as e}from"../chunks/rolldown-runtime.mjs";import{A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,R as _,S as v,T as y,U as b,V as x,W as S,X as C,Y as w,Z as T,_ as E,a as D,d as O,f as k,g as A,h as j,i as M,j as N,k as P,l as F,m as I,n as L,o as R,p as z,q as B,r as V,s as H,t as U,u as W,w as G,x as K,y as q,z as J}from"../chunks/generate-likec4.mjs";var Y=/* @__PURE__ */ e({base:()=>v,body:()=>r,deployment:()=>I,deploymentView:()=>D,deployments:()=>j,dynamicView:()=>R,eachOnFresh:()=>G,elementView:()=>H,eq:()=>y,expr:()=>E,expression:()=>A,foreach:()=>a,foreachNewLine:()=>i,guard:()=>h,indent:()=>P,inlineText:()=>t,join:()=>N,lazy:()=>p,likec4data:()=>M,lines:()=>m,markdown:()=>g,markdownOrString:()=>o,materialize:()=>l,merge:()=>f,model:()=>k,models:()=>z,newline:()=>_,noop:()=>J,print:()=>n,printProperty:()=>x,property:()=>c,props:()=>q,select:()=>b,separateComma:()=>S,separateNewLine:()=>s,separateWith:()=>d,space:()=>B,spaceBetween:()=>u,specification:()=>W,specifications:()=>O,text:()=>w,views:()=>F,when:()=>C,withctx:()=>T});export{U as generate,P as indent,l as materialize,Y as ops,L as print,V as printWithTabIndent,K as schemas,T as withctx};
package/dist/index.d.mts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { i as __name } from "./chunks/rolldown-runtime.mjs";
2
- import { n as writeDSL, r as LikeC4$1, t as WriteDSLOptions } from "./chunks/index2.mjs";
2
+ import { a as ast_d_exports, n as writeDSL, r as LikeC4$1, t as WriteDSLOptions } from "./chunks/index2.mjs";
3
3
  export type * from "@likec4/core/types";
4
- //#region src/LikeC4.d.ts
5
4
  type LikeC4Options = {
6
5
  /**
7
6
  * By default, if LikeC4 model is invalid, errors are printed to the console.
@@ -47,5 +46,4 @@ export declare namespace LikeC4 {
47
46
  */
48
47
  function fromWorkspace(path?: string, _opts?: LikeC4Options): Promise<LikeC4>;
49
48
  }
50
- //#endregion
51
- export { type LikeC4Options, type WriteDSLOptions, writeDSL };
49
+ export { type LikeC4Options, type WriteDSLOptions, type ast_d_exports as ast, writeDSL };
@@ -4,8 +4,6 @@ import { BBox, LayoutedDynamicView, NodeId, ViewId } from "@likec4/core/types";
4
4
  import { Connection, ConnectionModel, DeployedInstanceModel, DeploymentConnectionModel, DeploymentElementModel, DeploymentNodeModel, DeploymentRelationEndpoint, DeploymentRelationModel, EdgeModel, ElementModel, LikeC4DeploymentModel, LikeC4Model, LikeC4Model as LikeC4Model$1, LikeC4ViewModel, NodeModel, RelationshipModel, deploymentConnection, differenceConnections, findAscendingConnections, findDeepestNestedConnection, findDescendantConnections, hasSameSource, hasSameSourceTarget, hasSameTarget, isAnyInOut, isDeployedInstanceModel, isDeploymentElementModel, isDeploymentNodeModel, isDeploymentRelationModel, isEdgeModel, isElementModel, isIncoming, isLikeC4ViewModel, isNestedConnection, isNestedElementOfDeployedInstanceModel, isNodeModel, isOutgoing, isRelationModel, mergeConnections, modelConnection, sortConnectionsByBoundaryHierarchy, sortDeepestFirst } from "@likec4/core/model";
5
5
  import { ComputedProjectEdge, ComputedProjectNode, ComputedProjectsView, LayoutedProjectEdge, LayoutedProjectNode, LayoutedProjectsView } from "@likec4/core/compute-view";
6
6
  export type * from "@likec4/core/types";
7
- //#region ../layouts/dist/sequence/index.d.mts
8
- //#region src/sequence/_types.d.ts
9
7
  interface SequenceActorStepPort {
10
8
  id: string;
11
9
  cx: number;
@@ -46,15 +44,10 @@ interface SequenceViewLayout {
46
44
  parallelAreas: Array<SequenceParallelArea>;
47
45
  bounds: BBox;
48
46
  }
49
- //#endregion
50
- //#region src/sequence/sequence-view.d.ts
51
47
  export declare function calcSequenceLayout(view: LayoutedDynamicView): LayoutedDynamicView.Sequence.Layout;
52
- //#endregion
53
- //#region src/model/index.d.ts
54
48
  export type UnknownLayouted = types.UnknownLayouted;
55
49
  /**
56
50
  * Used by vite plugin to generate `virtual:likec4/model`
57
51
  */
58
52
  export declare function createLikeC4Model(model: any): LikeC4Model$1<UnknownLayouted>;
59
- //#endregion
60
53
  export { type ComputedProjectEdge, type ComputedProjectNode, type ComputedProjectsView, Connection, ConnectionModel, DeployedInstanceModel, DeploymentConnectionModel, type DeploymentElementModel, DeploymentNodeModel, type DeploymentRelationEndpoint, DeploymentRelationModel, EdgeModel, ElementModel, type LayoutedProjectEdge, type LayoutedProjectNode, type LayoutedProjectsView, LikeC4DeploymentModel, LikeC4Model, LikeC4ViewModel, NodeModel, RelationshipModel, type SequenceViewLayout, deploymentConnection, differenceConnections, findAscendingConnections, findDeepestNestedConnection, findDescendantConnections, hasSameSource, hasSameSourceTarget, hasSameTarget, isAnyInOut, isDeployedInstanceModel, isDeploymentElementModel, isDeploymentNodeModel, isDeploymentRelationModel, isEdgeModel, isElementModel, isIncoming, isLikeC4ViewModel, isNestedConnection, isNestedElementOfDeployedInstanceModel, isNodeModel, isOutgoing, isRelationModel, mergeConnections, modelConnection, sortConnectionsByBoundaryHierarchy, sortDeepestFirst, type types };
@@ -1,35 +1,50 @@
1
1
  import { i as __name } from "../chunks/rolldown-runtime.mjs";
2
- import "../chunks/index.mjs";
3
2
  import { i as LikeC4LanguageServices } from "../chunks/index2.mjs";
4
- import "@likec4/core";
3
+ import z from "zod/v4";
5
4
  import { PluginOption } from "vite";
6
5
  import { AnyTextAdapter } from "@tanstack/ai";
7
- //#region ../vite-plugin/dist/index.d.mts
8
- //#region src/virtuals/app-config.d.ts
9
- interface AppConfig {
6
+ /**
7
+ * Options of the LikeC4 application, shared by the Vite plugin and the app config of the CLI.
8
+ *
9
+ * @experimental
10
+ */
11
+ declare const LikeC4AppOptionsSchema: z.ZodObject<{
12
+ title: z.ZodDefault<z.ZodString>;
13
+ theme: z.ZodOptional<z.ZodEnum<{
14
+ light: "light";
15
+ dark: "dark";
16
+ }>>;
17
+ useHashHistory: z.ZodDefault<z.ZodBoolean>;
18
+ webcomponentPrefix: z.ZodDefault<z.ZodString>;
19
+ customization: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strip>;
21
+ /**
22
+ * Options of the LikeC4 application as written by the user, see {@link LikeC4AppOptionsSchema}
23
+ *
24
+ * @experimental
25
+ */
26
+ type LikeC4AppOptions = z.input<typeof LikeC4AppOptionsSchema>;
27
+ /**
28
+ * @deprecated Use {@link LikeC4AppOptions} at the top level of the plugin options
29
+ */
30
+ interface LikeC4AppConfig {
10
31
  /**
11
- * Webcomponent prefix for likec4 webcomponents
12
- * @default 'likec4'
32
+ * @deprecated Use `webcomponentPrefix` at the top level of the plugin options
13
33
  */
14
34
  webcomponentPrefix?: string;
15
35
  /**
16
- * Page title for the application
17
- * @default 'LikeC4'
36
+ * @deprecated Use `title` at the top level of the plugin options
18
37
  */
19
38
  pageTitle?: string;
20
39
  /**
21
- * Whether to use hash history for the application
22
- * @default false
40
+ * @deprecated Use `useHashHistory` at the top level of the plugin options
23
41
  */
24
42
  useHashHistory?: boolean | undefined;
25
43
  /**
26
- * Default color scheme for the application
27
- * @default 'auto'
44
+ * @deprecated Use `theme` at the top level of the plugin options
28
45
  */
29
46
  theme?: 'light' | 'dark' | undefined;
30
47
  }
31
- //#endregion
32
- //#region src/plugin.d.ts
33
48
  interface AIOptions<TAdapter extends AnyTextAdapter = AnyTextAdapter> {
34
49
  /**
35
50
  * The AI adapter to use
@@ -55,45 +70,12 @@ interface AIOptions<TAdapter extends AnyTextAdapter = AnyTextAdapter> {
55
70
  modelOptions?: TAdapter['~types']['providerOptions'];
56
71
  maxTokens?: number;
57
72
  }
58
- type SharedOptions = {
73
+ type LikeC4WorkspaceOptions = {
59
74
  /**
60
- * AI configuration, by default enabled with automatic detection based on environment variables.
61
- * You can also provide explicit configuration.
62
- * Or set to `disabled` to disable AI.
75
+ * Initialize LikeC4 from the specified workspace path.
76
+ * If not provided, vite project root will be used.
63
77
  *
64
- * @default 'auto' (automatic detection based on environment variables)
65
- *
66
- * @see https://tanstack.com/ai/latest/docs/getting-started/overview#adapters
67
- * @example
68
- * ```ts
69
- * import { openRouterText } from '@tanstack/ai-openrouter'
70
- *
71
- * export default defineConfig({
72
- * plugins: [
73
- * likec4VitePlugin({
74
- * ai: {
75
- * adapter: openRouterText("openai/gpt-5")
76
- * },
77
- * }),
78
- * ],
79
- * })
80
- * ```
81
- */
82
- ai?: 'disabled' | 'auto' | AIOptions | undefined;
83
- /**
84
- * Define vite environments where this plugin should be active
85
- * By default, the plugin is active in all environments
86
- */
87
- environments?: string | string[];
88
- /**
89
- * Configuration for the static application
90
- */
91
- appConfig?: AppConfig;
92
- };
93
- type LikeC4VitePluginOptions = SharedOptions & ({
94
- /**
95
- * Initializes a LikeC4 instance from the specified workspace path.
96
- * By default it is vite project root.
78
+ * As alternative you can provide {@link LikeC4LanguageServices} instance via `languageServices` option.
97
79
  */
98
80
  workspace?: string;
99
81
  /**
@@ -124,11 +106,14 @@ type LikeC4VitePluginOptions = SharedOptions & ({
124
106
  * @default 'warning'
125
107
  */
126
108
  logLevel?: 'trace' | 'debug' | 'info' | 'warning' | 'error' | undefined;
109
+ /**
110
+ * Either provide path to {@link LikeC4WorkspaceOptions.workspace} or {@link LikeC4LanguageServices} instance.
111
+ */
127
112
  languageServices?: never;
128
113
  } | {
129
114
  /**
130
- * If you have instance of {@link LikeC4LanguageServices}
131
- * you can pass `languageServices` from it.
115
+ * If you have instance of {@link LikeC4LanguageServices}, pass it directly.
116
+ * None of the options below are applied when this option is used.
132
117
  */
133
118
  languageServices: LikeC4LanguageServices;
134
119
  workspace?: never;
@@ -137,7 +122,47 @@ type LikeC4VitePluginOptions = SharedOptions & ({
137
122
  graphviz?: never;
138
123
  watch?: never;
139
124
  logLevel?: never;
140
- });
141
- export declare function LikeC4VitePlugin({ environments, appConfig, ai: _ai, ...pluginOpts }: LikeC4VitePluginOptions): PluginOption;
142
- //#endregion
143
- export type { LikeC4VitePluginOptions };
125
+ };
126
+ /**
127
+ * Configuration for the LikeC4 Vite plugin
128
+ *
129
+ * @see {@link LikeC4WorkspaceOptions} for workspace options (language services)
130
+ * @see {@link LikeC4AppOptions} for application-specific options
131
+ */
132
+ type LikeC4VitePluginOptions = LikeC4WorkspaceOptions & LikeC4AppOptions & {
133
+ /**
134
+ * AI configuration, by default enabled with automatic detection based on environment variables.
135
+ * You can also provide explicit configuration.
136
+ * Or set to `disabled` to disable AI.
137
+ *
138
+ * @default 'auto' (automatic detection based on environment variables)
139
+ *
140
+ * @see https://tanstack.com/ai/latest/docs/getting-started/overview#adapters
141
+ * @example
142
+ * ```ts
143
+ * import { openRouterText } from '@tanstack/ai-openrouter'
144
+ *
145
+ * export default defineConfig({
146
+ * plugins: [
147
+ * likec4VitePlugin({
148
+ * ai: {
149
+ * adapter: openRouterText("openai/gpt-5")
150
+ * },
151
+ * }),
152
+ * ],
153
+ * })
154
+ * ```
155
+ */
156
+ ai?: 'disabled' | 'auto' | AIOptions | undefined;
157
+ /**
158
+ * Define vite environments where this plugin should be active
159
+ * By default, the plugin is active in all environments
160
+ */
161
+ environments?: string | string[];
162
+ /**
163
+ * @deprecated Use the options at the top level: `title`, `theme`, `useHashHistory`, `webcomponentPrefix`
164
+ */
165
+ appConfig?: LikeC4AppConfig | undefined;
166
+ };
167
+ export declare function LikeC4VitePlugin({ environments, appConfig, title, theme, useHashHistory, webcomponentPrefix, customization, ai: _ai, ...pluginOpts }: LikeC4VitePluginOptions): PluginOption;
168
+ export type { LikeC4AppConfig, LikeC4AppOptions, LikeC4VitePluginOptions };
@@ -1 +1 @@
1
- import{t as e}from"../chunks/vite-plugin.mjs";export{e as LikeC4VitePlugin};
1
+ export{t as LikeC4VitePlugin}from"../chunks/vite-plugin.mjs";
@@ -0,0 +1,8 @@
1
+ // \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __name = (target, value) => __defProp(target, "name", {
4
+ value,
5
+ configurable: true
6
+ });
7
+
8
+ export { __name as t };
@@ -1,9 +1,75 @@
1
- import { LikeC4Model } from "@likec4/core/model";
1
+ import { t as __name } from "./chunks/rolldown-runtime.mjs";
2
2
  import { DependencyList } from "react";
3
+ import { LikeC4Model } from "@likec4/core/model";
3
4
  import { LayoutedElementView, LayoutedLikeC4ModelData, LayoutedView, ProjectId, ViewChange, ViewId } from "@likec4/core/types";
4
5
  import { AdhocViewPredicate } from "@likec4/core/compute-view";
5
- //#region ../vite-plugin/dist/internal/index.d.mts
6
- //#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/atom/index.d.ts
6
+ import "@likec4/core/builder";
7
+ import * as c4 from "@likec4/core";
8
+ import "zod/v4";
9
+ import "type-fest";
10
+ import "@likec4/core/utils";
11
+ import "@likec4/core/styles";
12
+ import "chokidar";
13
+ import "@tanstack/ai";
14
+ declare module 'langium' {
15
+ interface LangiumDocument {
16
+ likec4ProjectId?: c4.ProjectId;
17
+ }
18
+ interface AstNodeDescription {
19
+ likec4ProjectId?: c4.ProjectId;
20
+ }
21
+ }
22
+ declare const idattr: unique symbol;
23
+ declare module './generated/ast' {
24
+ interface Element {
25
+ [idattr]?: c4.Fqn | undefined;
26
+ }
27
+ interface ElementView {
28
+ [idattr]?: c4.ViewId | undefined;
29
+ }
30
+ interface DynamicView {
31
+ [idattr]?: c4.ViewId | undefined;
32
+ }
33
+ interface DeploymentView {
34
+ [idattr]?: c4.ViewId | undefined;
35
+ }
36
+ interface DeploymentNode {
37
+ [idattr]?: c4.Fqn | undefined;
38
+ }
39
+ interface DeployedInstance {
40
+ [idattr]?: c4.Fqn | undefined;
41
+ }
42
+ }
43
+ /**
44
+ * @hidden
45
+ */
46
+ declare type $keywords<T extends string> = { [key in T]: key; };
47
+ declare module 'ts-graphviz' {
48
+ namespace GraphAttributeKey {
49
+ interface $values extends $keywords<'likec4_viewId'> {}
50
+ }
51
+ namespace ClusterSubgraphAttributeKey {
52
+ interface $values extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_level' | 'likec4_depth'> {}
53
+ }
54
+ namespace NodeAttributeKey {
55
+ interface $values extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_project' | 'likec4_level'> {}
56
+ }
57
+ namespace EdgeAttributeKey {
58
+ interface $values extends $keywords<'likec4_id' | 'likec4_project'> {}
59
+ }
60
+ namespace Attribute {
61
+ interface $keys extends $keywords<'likec4_viewId' | 'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_project' | 'likec4_level' | 'likec4_depth'> {}
62
+ interface $types {
63
+ likec4_viewId: string;
64
+ likec4_type: 'folder' | 'file' | 'view';
65
+ likec4_path: string;
66
+ likec4_id: string;
67
+ likec4_project: string;
68
+ likec4_level: number;
69
+ likec4_depth: number;
70
+ }
71
+ }
72
+ }
7
73
  type AllKeys<T> = T extends any ? keyof T : never;
8
74
  type Primitive = boolean | number | string;
9
75
  type ReadonlyIfObject<Value> = Value extends undefined ? Value : Value extends ((...args: any) => any) ? Value : Value extends Primitive ? Value : Value extends object ? Readonly<Value> : Value;
@@ -142,8 +208,6 @@ type Atom<Value = any> = ReadableAtom<Value> | WritableAtom<Value>;
142
208
  * @returns The store object with methods to subscribe.
143
209
  */
144
210
  export declare function atom<Value, StoreExt = object>(...args: undefined extends Value ? [] | [Value] : [Value]): PreinitializedWritableAtom<Value> & StoreExt;
145
- //#endregion
146
- //#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/map/index.d.ts
147
211
  type KeyofBase = keyof any;
148
212
  type Get<T, K extends KeyofBase> = T extends any ? K extends keyof T ? T[K] : never : never;
149
213
  type HasIndexSignature<T> = string extends keyof T ? true : false;
@@ -256,13 +320,9 @@ export declare function map<Value extends object, StoreExt extends object = obje
256
320
  * @returns The store object with methods to subscribe.
257
321
  */
258
322
  export declare function map<Value extends object, StoreExt extends object = object>(value?: Value): PreinitializedMapStore<Partial<Value>> & StoreExt;
259
- //#endregion
260
- //#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/task/index.d.ts
261
323
  interface Task<Value> extends Promise<Value> {
262
324
  t: true;
263
325
  }
264
- //#endregion
265
- //#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/computed/index.d.ts
266
326
  type StoreValues<Stores extends readonly Gettable[]> = { -readonly [Index in keyof Stores]: StoreValue<Stores[Index]>; };
267
327
  interface Computed {
268
328
  /**
@@ -311,8 +371,6 @@ interface Batched {
311
371
  <Value, OriginStores extends readonly Store[]>(stores: readonly [...OriginStores], cb: (...values: StoreValues<OriginStores>) => Task<Value> | Value): ReadableAtom<Value>;
312
372
  }
313
373
  export declare const batched: Batched;
314
- //#endregion
315
- //#region src/rpc/protocol.d.ts
316
374
  interface LikeC4VitePluginRpc {
317
375
  /**
318
376
  * Apply semantic layout (if AI is available)
@@ -342,8 +400,6 @@ interface LikeC4VitePluginRpc {
342
400
  predicates: AdhocViewPredicate[];
343
401
  }): Promise<LayoutedElementView>;
344
402
  }
345
- //#endregion
346
- //#region ../../node_modules/.pnpm/@nanostores+react@1.1.0_nanostores@1.5.3_react@19.2.8/node_modules/@nanostores/react/index.d.ts
347
403
  type StoreKeys<T> = T extends {
348
404
  setKey: (k: infer K, v: any) => unknown;
349
405
  } ? K : never;
@@ -390,8 +446,27 @@ interface UseStoreOptions<SomeStore> {
390
446
  * @returns Store value.
391
447
  */
392
448
  export declare function useStore<SomeStore extends Store>(store: SomeStore, options?: UseStoreOptions<SomeStore>): StoreValue<SomeStore>;
393
- //#endregion
394
- //#region src/internal.d.ts
449
+ /**
450
+ * @deprecated Use {@link LikeC4AppOptions} at the top level of the plugin options
451
+ */
452
+ interface LikeC4AppConfig {
453
+ /**
454
+ * @deprecated Use `webcomponentPrefix` at the top level of the plugin options
455
+ */
456
+ webcomponentPrefix?: string;
457
+ /**
458
+ * @deprecated Use `title` at the top level of the plugin options
459
+ */
460
+ pageTitle?: string;
461
+ /**
462
+ * @deprecated Use `useHashHistory` at the top level of the plugin options
463
+ */
464
+ useHashHistory?: boolean | undefined;
465
+ /**
466
+ * @deprecated Use `theme` at the top level of the plugin options
467
+ */
468
+ theme?: 'light' | 'dark' | undefined;
469
+ }
395
470
  export interface LikeC4VitePluginRpcOptions {
396
471
  /**
397
472
  * Function to post raw message
@@ -413,6 +488,6 @@ export declare function createHooksForModel($atom: WritableAtom<LayoutedLikeC4Mo
413
488
  useLikeC4Model: () => LikeC4Model.Layouted;
414
489
  useLikeC4Views: () => ReadonlyArray<LayoutedView>;
415
490
  useLikeC4View: (viewId: string) => LayoutedView | null;
491
+ isLikeC4ViewId: (id: unknown) => id is string;
416
492
  };
417
- //#endregion
418
- export type { Atom, LikeC4VitePluginRpc, ReadableAtom, WritableAtom };
493
+ export type { Atom, LikeC4AppConfig, LikeC4VitePluginRpc, ReadableAtom, WritableAtom };