@rotorsoft/act-diagram 0.1.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 (56) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +256 -0
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/@types/client/components/ActDiagram.d.ts +17 -0
  5. package/dist/@types/client/components/ActDiagram.d.ts.map +1 -0
  6. package/dist/@types/client/components/AiBar.d.ts +11 -0
  7. package/dist/@types/client/components/AiBar.d.ts.map +1 -0
  8. package/dist/@types/client/components/CodePreview.d.ts +10 -0
  9. package/dist/@types/client/components/CodePreview.d.ts.map +1 -0
  10. package/dist/@types/client/components/Diagram.d.ts +11 -0
  11. package/dist/@types/client/components/Diagram.d.ts.map +1 -0
  12. package/dist/@types/client/components/Logo.d.ts +6 -0
  13. package/dist/@types/client/components/Logo.d.ts.map +1 -0
  14. package/dist/@types/client/components/Tooltip.d.ts +16 -0
  15. package/dist/@types/client/components/Tooltip.d.ts.map +1 -0
  16. package/dist/@types/client/data/prompts.d.ts +5 -0
  17. package/dist/@types/client/data/prompts.d.ts.map +1 -0
  18. package/dist/@types/client/data/sample-files.d.ts +4 -0
  19. package/dist/@types/client/data/sample-files.d.ts.map +1 -0
  20. package/dist/@types/client/lib/build-model.d.ts +21 -0
  21. package/dist/@types/client/lib/build-model.d.ts.map +1 -0
  22. package/dist/@types/client/lib/evaluate.d.ts +6 -0
  23. package/dist/@types/client/lib/evaluate.d.ts.map +1 -0
  24. package/dist/@types/client/lib/layout.d.ts +76 -0
  25. package/dist/@types/client/lib/layout.d.ts.map +1 -0
  26. package/dist/@types/client/lib/mock-builders.d.ts +18 -0
  27. package/dist/@types/client/lib/mock-builders.d.ts.map +1 -0
  28. package/dist/@types/client/lib/navigate.d.ts +16 -0
  29. package/dist/@types/client/lib/navigate.d.ts.map +1 -0
  30. package/dist/@types/client/lib/sort.d.ts +4 -0
  31. package/dist/@types/client/lib/sort.d.ts.map +1 -0
  32. package/dist/@types/client/lib/strip-fences.d.ts +11 -0
  33. package/dist/@types/client/lib/strip-fences.d.ts.map +1 -0
  34. package/dist/@types/client/lib/validate.d.ts +4 -0
  35. package/dist/@types/client/lib/validate.d.ts.map +1 -0
  36. package/dist/@types/client/main.d.ts +2 -0
  37. package/dist/@types/client/main.d.ts.map +1 -0
  38. package/dist/@types/client/types/domain-model.d.ts +71 -0
  39. package/dist/@types/client/types/domain-model.d.ts.map +1 -0
  40. package/dist/@types/client/types/file-tab.d.ts +5 -0
  41. package/dist/@types/client/types/file-tab.d.ts.map +1 -0
  42. package/dist/@types/client/types/index.d.ts +5 -0
  43. package/dist/@types/client/types/index.d.ts.map +1 -0
  44. package/dist/@types/client/types/protocol.d.ts +29 -0
  45. package/dist/@types/client/types/protocol.d.ts.map +1 -0
  46. package/dist/@types/index.d.ts +15 -0
  47. package/dist/@types/index.d.ts.map +1 -0
  48. package/dist/@types/server/ai.d.ts +19 -0
  49. package/dist/@types/server/ai.d.ts.map +1 -0
  50. package/dist/@types/server/server.d.ts +2 -0
  51. package/dist/@types/server/server.d.ts.map +1 -0
  52. package/dist/index.cjs +2875 -0
  53. package/dist/index.cjs.map +1 -0
  54. package/dist/index.js +2844 -0
  55. package/dist/index.js.map +1 -0
  56. package/package.json +64 -0
@@ -0,0 +1,17 @@
1
+ import type { FileTab } from "../types/index.js";
2
+ import { type AiOptions } from "./AiBar.js";
3
+ type Props = {
4
+ /** Direct file injection */
5
+ files?: FileTab[];
6
+ /** Called when a diagram element is clicked — provides file:line:col and element type */
7
+ onNavigate?: (file: string, line: number, col: number, type?: string) => void;
8
+ /** Listen to postMessage for HostMessage updates */
9
+ usePostMessage?: boolean;
10
+ /** Optional AI callback */
11
+ onAiRequest?: (prompt: string, files: FileTab[], options: AiOptions) => void;
12
+ /** Whether AI is generating */
13
+ generating?: boolean;
14
+ };
15
+ export declare function ActDiagram({ files: propFiles, onNavigate, usePostMessage, onAiRequest, generating, }: Props): import("react/jsx-runtime").JSX.Element;
16
+ export {};
17
+ //# sourceMappingURL=ActDiagram.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActDiagram.d.ts","sourceRoot":"","sources":["../../../../src/client/components/ActDiagram.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,OAAO,EAGR,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAGnD,KAAK,KAAK,GAAG;IACX,4BAA4B;IAC5B,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;IAClB,yFAAyF;IACzF,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9E,oDAAoD;IACpD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,2BAA2B;IAC3B,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,SAAS,KAAK,IAAI,CAAC;IAC7E,+BAA+B;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,UAAU,CAAC,EACzB,KAAK,EAAE,SAAS,EAChB,UAAU,EACV,cAAc,EACd,WAAW,EACX,UAAU,GACX,EAAE,KAAK,2CAwFP"}
@@ -0,0 +1,11 @@
1
+ export type AiOptions = {
2
+ model: string;
3
+ maxTokens: number;
4
+ };
5
+ type Props = {
6
+ onSubmit: (prompt: string, options: AiOptions) => void;
7
+ generating?: boolean;
8
+ };
9
+ export declare function AiBar({ onSubmit, generating }: Props): import("react/jsx-runtime").JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=AiBar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AiBar.d.ts","sourceRoot":"","sources":["../../../../src/client/components/AiBar.tsx"],"names":[],"mappings":"AAgBA,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,KAAK,IAAI,CAAC;IACvD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,KAAK,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,KAAK,2CAmEpD"}
@@ -0,0 +1,10 @@
1
+ type Props = {
2
+ filePath: string;
3
+ content: string;
4
+ targetLine: number;
5
+ elementType?: string;
6
+ onClose: () => void;
7
+ };
8
+ export declare function CodePreview({ filePath, content, targetLine, elementType, onClose, }: Props): import("react/jsx-runtime").JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=CodePreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodePreview.d.ts","sourceRoot":"","sources":["../../../../src/client/components/CodePreview.tsx"],"names":[],"mappings":"AAYA,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,OAAO,EACP,UAAU,EACV,WAAW,EACX,OAAO,GACR,EAAE,KAAK,2CAiFP"}
@@ -0,0 +1,11 @@
1
+ import type { DomainModel, ValidationWarning } from "../types/index.js";
2
+ type Props = {
3
+ model: DomainModel;
4
+ warnings: ValidationWarning[];
5
+ onClickElement?: (name: string, type?: string, file?: string) => void;
6
+ onFixWithAi?: (prompt: string) => void;
7
+ toolbarExtra?: React.ReactNode;
8
+ };
9
+ export declare function Diagram({ model, warnings, onClickElement, onFixWithAi, toolbarExtra, }: Props): import("react/jsx-runtime").JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=Diagram.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Diagram.d.ts","sourceRoot":"","sources":["../../../../src/client/components/Diagram.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,WAAW,EAEX,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAmG3B,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAChC,CAAC;AAEF,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,cAAc,EACd,WAAW,EACX,YAAY,GACb,EAAE,KAAK,2CA0rBP"}
@@ -0,0 +1,6 @@
1
+ type LogoProps = {
2
+ size?: number;
3
+ };
4
+ export declare function Logo({ size }: LogoProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
6
+ //# sourceMappingURL=Logo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Logo.d.ts","sourceRoot":"","sources":["../../../../src/client/components/Logo.tsx"],"names":[],"mappings":"AAAA,KAAK,SAAS,GAAG;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,IAAI,CAAC,EAAE,IAAS,EAAE,EAAE,SAAS,2CAqE5C"}
@@ -0,0 +1,16 @@
1
+ import { type ReactNode } from "react";
2
+ type DetailItem = {
3
+ label: string;
4
+ text: string;
5
+ };
6
+ type Props = {
7
+ title: string;
8
+ description?: string;
9
+ details?: DetailItem[];
10
+ children: ReactNode;
11
+ position?: "top" | "bottom";
12
+ align?: "center" | "right" | "left";
13
+ };
14
+ export declare function Tooltip({ title, description, details, children, position, align, }: Props): import("react/jsx-runtime").JSX.Element;
15
+ export {};
16
+ //# sourceMappingURL=Tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../src/client/components/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtE,KAAK,UAAU,GAAG;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC5B,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;CACrC,CAAC;AAEF,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,WAAW,EACX,OAAO,EACP,QAAQ,EACR,QAAmB,EACnB,KAAgB,GACjB,EAAE,KAAK,2CAuFP"}
@@ -0,0 +1,5 @@
1
+ export declare const PROMPT_TEMPLATES: {
2
+ label: string;
3
+ prompt: string;
4
+ }[];
5
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../../src/client/data/prompts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;GAgB5B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { FileTab } from "../types/file-tab.js";
2
+ /** Sample Act app files for visual testing of the diagram */
3
+ export declare const SAMPLE_FILES: FileTab[];
4
+ //# sourceMappingURL=sample-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sample-files.d.ts","sourceRoot":"","sources":["../../../../src/client/data/sample-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,6DAA6D;AAC7D,eAAO,MAAM,YAAY,EAAE,OAAO,EAoGjC,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Bottom-up model builder: inventory → states → slices → act
3
+ *
4
+ * 1. Scan source for all state/slice/projection/act declarations (inventory)
5
+ * 2. Try to build each item independently from the raw mock results
6
+ * 3. Always show every item — with diagram on success, error on failure
7
+ */
8
+ import type { DomainModel, FileTab } from "../types/index.js";
9
+ export type ExecuteResult = {
10
+ states: any[];
11
+ slices: any[];
12
+ projections: any[];
13
+ acts: any[];
14
+ error?: string;
15
+ fileErrors: Map<string, string>;
16
+ };
17
+ export declare function buildModel(result: ExecuteResult, files: FileTab[], expectedSlices: Map<string, string>): {
18
+ model: DomainModel;
19
+ error?: string;
20
+ };
21
+ //# sourceMappingURL=build-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-model.d.ts","sourceRoot":"","sources":["../../../../src/client/lib/build-model.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAGV,WAAW,EAEX,OAAO,EAGR,MAAM,mBAAmB,CAAC;AAqF3B,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,WAAW,EAAE,GAAG,EAAE,CAAC;IACnB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC,CAAC;AAIF,wBAAgB,UAAU,CACxB,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,OAAO,EAAE,EAChB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAClC;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAyNxC"}
@@ -0,0 +1,6 @@
1
+ import type { DomainModel, FileTab } from "../types/index.js";
2
+ export declare function extractModel(files: FileTab[]): {
3
+ model: DomainModel;
4
+ error?: string;
5
+ };
6
+ //# sourceMappingURL=evaluate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../../../../src/client/lib/evaluate.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAmN9D,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG;IAC9C,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAsBA"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Pure layout computation for Act domain model diagrams.
3
+ *
4
+ * Extracted from Diagram.tsx so rendering rules can be unit-tested
5
+ * without React or DOM dependencies.
6
+ */
7
+ import type { DomainModel } from "../types/index.js";
8
+ export declare const W = 100, H = 36, STATE_W = 80, STATE_H = 80, GAP = 12, PAD = 10, SLICE_PAD = 24, SLICE_INNER = 16, SLICE_GAP = 20, MARGIN = 30;
9
+ declare const COLORS: {
10
+ action: {
11
+ bg: string;
12
+ border: string;
13
+ text: string;
14
+ };
15
+ event: {
16
+ bg: string;
17
+ border: string;
18
+ text: string;
19
+ };
20
+ state: {
21
+ bg: string;
22
+ border: string;
23
+ text: string;
24
+ };
25
+ reaction: {
26
+ bg: string;
27
+ border: string;
28
+ text: string;
29
+ };
30
+ projection: {
31
+ bg: string;
32
+ border: string;
33
+ text: string;
34
+ };
35
+ };
36
+ export type Pos = {
37
+ x: number;
38
+ y: number;
39
+ };
40
+ export type N = {
41
+ key: string;
42
+ pos: Pos;
43
+ type: keyof typeof COLORS;
44
+ label: string;
45
+ sub?: string;
46
+ file?: string;
47
+ projections?: string[];
48
+ guards?: string[];
49
+ reactions?: string[];
50
+ };
51
+ export type E = {
52
+ from: Pos;
53
+ to: Pos;
54
+ color: string;
55
+ dash?: boolean;
56
+ };
57
+ export type Box = {
58
+ label: string;
59
+ x: number;
60
+ y: number;
61
+ w: number;
62
+ h: number;
63
+ error?: string;
64
+ };
65
+ export type Layout = {
66
+ ns: N[];
67
+ es: E[];
68
+ boxes: Box[];
69
+ minX: number;
70
+ minY: number;
71
+ width: number;
72
+ height: number;
73
+ };
74
+ export declare function computeLayout(viewModel: DomainModel): Layout;
75
+ export {};
76
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/client/lib/layout.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,mBAAmB,CAAC;AAGhE,eAAO,MAAM,CAAC,MAAM,EAClB,CAAC,KAAK,EACN,OAAO,KAAK,EACZ,OAAO,KAAK,EACZ,GAAG,KAAK,EACR,GAAG,KAAK,EACR,SAAS,KAAK,EACd,WAAW,KAAK,EAChB,SAAS,KAAK,EACd,MAAM,KAAK,CAAC;AAEd,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;CAMX,CAAC;AAGF,MAAM,MAAM,GAAG,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC3C,MAAM,MAAM,CAAC,GAAG;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,EAAE,MAAM,OAAO,MAAM,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AACF,MAAM,MAAM,CAAC,GAAG;IAAE,IAAI,EAAE,GAAG,CAAC;IAAC,EAAE,EAAE,GAAG,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AACtE,MAAM,MAAM,GAAG,GAAG;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,MAAM,GAAG;IACnB,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,KAAK,EAAE,GAAG,EAAE,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA8MF,wBAAgB,aAAa,CAAC,SAAS,EAAE,WAAW,GAAG,MAAM,CA0kB5D"}
@@ -0,0 +1,18 @@
1
+ /** Shared no-op function used as Proxy targets (body is never reached through the proxy) */
2
+ export declare function proxyTarget(): void;
3
+ export declare function mockState(entry: Record<string, any>, onBuild?: (info: any) => void): {
4
+ init: (_initFn?: any) => {
5
+ emits(events: Record<string, any>): any;
6
+ };
7
+ };
8
+ export declare function mockSlice(onBuild?: (info: any) => void): any;
9
+ export declare function mockProjection(target?: string, onBuild?: (info: any) => void): any;
10
+ export declare function mockAct(onBuild?: (info: any) => void): any;
11
+ /** Module map for the evaluator's require() */
12
+ export declare const MODULES: Record<string, Record<string, unknown>>;
13
+ /**
14
+ * Returns a deep Proxy for unknown modules — any property access
15
+ * returns a no-op function that also acts as a Proxy.
16
+ */
17
+ export declare function unknownModuleProxy(): Record<string, unknown>;
18
+ //# sourceMappingURL=mock-builders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-builders.d.ts","sourceRoot":"","sources":["../../../../src/client/lib/mock-builders.ts"],"names":[],"mappings":"AAQA,4FAA4F;AAC5F,wBAAgB,WAAW,SAAK;AA2DhC,wBAAgB,SAAS,CACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI;qBAyCV,GAAG;sBACJ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;EAatC;AAoDD,wBAAgB,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,OAkDtD;AAED,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,OA8B5E;AAED,wBAAgB,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,OAsEpD;AAWD,+CAA+C;AAC/C,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAoB3D,CAAC;AAEF;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAmB5D"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Navigate from a diagram element click to the exact definition in code.
3
+ * Builds type-specific regex patterns, searches all .ts files, and
4
+ * returns the file path, line, and column of the match.
5
+ *
6
+ * Pure function — no side effects, no VS Code / Monaco dependency.
7
+ */
8
+ import type { FileTab } from "../types/index.js";
9
+ type NavigateResult = {
10
+ file: string;
11
+ line: number;
12
+ col: number;
13
+ };
14
+ export declare function navigateToCode(files: FileTab[], name: string, type?: string, targetFile?: string): NavigateResult | undefined;
15
+ export {};
16
+ //# sourceMappingURL=navigate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigate.d.ts","sourceRoot":"","sources":["../../../../src/client/lib/navigate.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAkIjD,KAAK,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAElE,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,EAAE,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,MAAM,GAClB,cAAc,GAAG,SAAS,CAqJ5B"}
@@ -0,0 +1,4 @@
1
+ import type { FileTab } from "../types/index.js";
2
+ /** Topological sort: files that are imported come before files that import them */
3
+ export declare function topoSort(tsFiles: FileTab[]): FileTab[];
4
+ //# sourceMappingURL=sort.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../../../src/client/lib/sort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,mFAAmF;AACnF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CA+DtD"}
@@ -0,0 +1,11 @@
1
+ import type { FileTab } from "../types/index.js";
2
+ /**
3
+ * Parse a multi-file AI response with path-annotated fenced blocks.
4
+ * Format: ```typescript:src/states.ts\n...code...\n```
5
+ * Falls back to a single src/app.ts file if no path annotations found.
6
+ */
7
+ export declare function parseMultiFileResponse(raw: string): FileTab[];
8
+ export declare function stripFences(code: string): string;
9
+ /** Derive a project name from the prompt or generated code */
10
+ export declare function deriveProjectName(prompt: string, code?: string): string;
11
+ //# sourceMappingURL=strip-fences.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strip-fences.d.ts","sourceRoot":"","sources":["../../../../src/client/lib/strip-fences.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,EAAE,CAmB7D;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAqBhD;AAED,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAiBvE"}
@@ -0,0 +1,4 @@
1
+ import type { DomainModel, ValidationWarning } from "../types/index.js";
2
+ /** Validate domain model — only critical issues */
3
+ export declare function validate(model: DomainModel): ValidationWarning[];
4
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/client/lib/validate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAExE,mDAAmD;AACnD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,iBAAiB,EAAE,CAiBhE"}
@@ -0,0 +1,2 @@
1
+ import "./styles.css";
2
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/client/main.tsx"],"names":[],"mappings":"AAOA,OAAO,cAAc,CAAC"}
@@ -0,0 +1,71 @@
1
+ /** Domain model extracted from Act builder code */
2
+ export type ActNode = {
3
+ slices: string[];
4
+ projections: string[];
5
+ states: string[];
6
+ line?: number;
7
+ };
8
+ export type EntryPoint = {
9
+ path: string;
10
+ states: StateNode[];
11
+ slices: SliceNode[];
12
+ projections: ProjectionNode[];
13
+ reactions: ReactionNode[];
14
+ };
15
+ export type DomainModel = {
16
+ entries: EntryPoint[];
17
+ states: StateNode[];
18
+ slices: SliceNode[];
19
+ projections: ProjectionNode[];
20
+ reactions: ReactionNode[];
21
+ orchestrator?: ActNode;
22
+ };
23
+ export type StateNode = {
24
+ name: string;
25
+ varName: string;
26
+ events: EventNode[];
27
+ actions: ActionNode[];
28
+ file?: string;
29
+ line?: number;
30
+ };
31
+ export type EventNode = {
32
+ name: string;
33
+ hasCustomPatch: boolean;
34
+ line?: number;
35
+ };
36
+ export type ActionNode = {
37
+ name: string;
38
+ emits: string[];
39
+ invariants: string[];
40
+ line?: number;
41
+ };
42
+ export type SliceNode = {
43
+ name: string;
44
+ states: string[];
45
+ stateVars: string[];
46
+ projections: string[];
47
+ reactions: ReactionNode[];
48
+ error?: string;
49
+ file?: string;
50
+ line?: number;
51
+ };
52
+ export type ProjectionNode = {
53
+ name: string;
54
+ varName: string;
55
+ handles: string[];
56
+ line?: number;
57
+ };
58
+ export type ReactionNode = {
59
+ event: string;
60
+ handlerName: string;
61
+ dispatches: string[];
62
+ isVoid: boolean;
63
+ line?: number;
64
+ };
65
+ export type ValidationWarning = {
66
+ message: string;
67
+ severity: "warning" | "error";
68
+ element?: string;
69
+ };
70
+ export declare function emptyModel(): DomainModel;
71
+ //# sourceMappingURL=domain-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain-model.d.ts","sourceRoot":"","sources":["../../../../src/client/types/domain-model.ts"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,SAAS,EAAE,YAAY,EAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,UAAU,EAAE,CAAC;IAEtB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wBAAgB,UAAU,IAAI,WAAW,CASxC"}
@@ -0,0 +1,5 @@
1
+ export type FileTab = {
2
+ path: string;
3
+ content: string;
4
+ };
5
+ //# sourceMappingURL=file-tab.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-tab.d.ts","sourceRoot":"","sources":["../../../../src/client/types/file-tab.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { emptyModel } from "./domain-model.js";
2
+ export type { ActNode, ActionNode, DomainModel, EntryPoint, EventNode, ProjectionNode, ReactionNode, SliceNode, StateNode, ValidationWarning, } from "./domain-model.js";
3
+ export type { FileTab } from "./file-tab.js";
4
+ export type { DiagramMessage, HostMessage } from "./protocol.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,YAAY,EACV,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,SAAS,EACT,SAAS,EACT,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { FileTab } from "./file-tab.js";
2
+ /** Messages from the host environment to the diagram */
3
+ export type HostMessage = {
4
+ type: "files";
5
+ files: FileTab[];
6
+ } | {
7
+ type: "fileAdded";
8
+ path: string;
9
+ content: string;
10
+ } | {
11
+ type: "fileChanged";
12
+ path: string;
13
+ content: string;
14
+ } | {
15
+ type: "fileDeleted";
16
+ path: string;
17
+ };
18
+ /** Messages from the diagram to the host environment */
19
+ export type DiagramMessage = {
20
+ type: "navigate";
21
+ file: string;
22
+ line: number;
23
+ col: number;
24
+ } | {
25
+ type: "aiRequest";
26
+ prompt: string;
27
+ files: FileTab[];
28
+ };
29
+ //# sourceMappingURL=protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../../src/client/types/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,wDAAwD;AACxD,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,EAAE,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACpD;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1C,wDAAwD;AACxD,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC7D;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,EAAE,CAAA;CAAE,CAAC"}
@@ -0,0 +1,15 @@
1
+ export { ActDiagram } from "./client/components/ActDiagram.js";
2
+ export { AiBar, type AiOptions } from "./client/components/AiBar.js";
3
+ export { Diagram } from "./client/components/Diagram.js";
4
+ export { Logo } from "./client/components/Logo.js";
5
+ export { Tooltip } from "./client/components/Tooltip.js";
6
+ export { extractModel } from "./client/lib/evaluate.js";
7
+ export { navigateToCode } from "./client/lib/navigate.js";
8
+ export { topoSort } from "./client/lib/sort.js";
9
+ export { deriveProjectName, parseMultiFileResponse, stripFences, } from "./client/lib/strip-fences.js";
10
+ export { validate } from "./client/lib/validate.js";
11
+ export { emptyModel } from "./client/types/domain-model.js";
12
+ export type { ActNode, ActionNode, DomainModel, EntryPoint, EventNode, ProjectionNode, ReactionNode, SliceNode, StateNode, ValidationWarning, } from "./client/types/domain-model.js";
13
+ export type { FileTab } from "./client/types/file-tab.js";
14
+ export type { DiagramMessage, HostMessage } from "./client/types/protocol.js";
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,WAAW,GACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,YAAY,EACV,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,SAAS,EACT,SAAS,EACT,iBAAiB,GAClB,MAAM,gCAAgC,CAAC;AACxC,YAAY,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,19 @@
1
+ export declare function buildSystemPrompt(currentFiles?: {
2
+ path: string;
3
+ content: string;
4
+ }[], refine?: boolean): string;
5
+ export declare const DEFAULT_MODELS: {
6
+ id: string;
7
+ label: string;
8
+ }[];
9
+ export declare function streamGenerate(input: {
10
+ prompt: string;
11
+ currentFiles?: {
12
+ path: string;
13
+ content: string;
14
+ }[];
15
+ maxTokens?: number;
16
+ model?: string;
17
+ refine?: boolean;
18
+ }, res: import("http").ServerResponse): void;
19
+ //# sourceMappingURL=ai.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../../src/server/ai.ts"],"names":[],"mappings":"AAuEA,wBAAgB,iBAAiB,CAC/B,YAAY,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,EAClD,MAAM,CAAC,EAAE,OAAO,GACf,MAAM,CAuBR;AAID,eAAO,MAAM,cAAc;;;GAI1B,CAAC;AAIF,wBAAgB,cAAc,CAC5B,KAAK,EAAE;IACL,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,EACD,GAAG,EAAE,OAAO,MAAM,EAAE,cAAc,QA0CnC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/server/server.ts"],"names":[],"mappings":""}