@mmapp/react-compiler 0.1.0-alpha.16 → 0.1.0-alpha.18

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/dist/{chunk-UBDNXVL2.mjs → chunk-6LAII7OP.mjs} +82 -4
  2. package/dist/{chunk-GVCJJX7E.mjs → chunk-FPAMQXKB.mjs} +14 -18
  3. package/dist/{chunk-NUPJYPFU.mjs → chunk-GMW45YVD.mjs} +68 -1
  4. package/dist/cli/index.js +201 -72
  5. package/dist/cli/index.mjs +55 -8
  6. package/dist/dev-server.js +42 -65
  7. package/dist/dev-server.mjs +1 -1
  8. package/dist/index.js +42 -65
  9. package/dist/index.mjs +1 -1
  10. package/dist/{init-2CRSUGV5.mjs → init-CJCDWI33.mjs} +119 -0
  11. package/package.json +2 -2
  12. package/dist/chunk-26U577GB.mjs +0 -3465
  13. package/dist/chunk-2FBDFAX6.mjs +0 -2362
  14. package/dist/chunk-2L4QSMXG.mjs +0 -175
  15. package/dist/chunk-2REDFOER.mjs +0 -931
  16. package/dist/chunk-3USIFFE4.mjs +0 -2190
  17. package/dist/chunk-45YMGEVT.mjs +0 -186
  18. package/dist/chunk-46YKSHQR.mjs +0 -175
  19. package/dist/chunk-4FN2AISW.mjs +0 -148
  20. package/dist/chunk-4OPI5L7G.mjs +0 -2593
  21. package/dist/chunk-4RYTKOOJ.mjs +0 -186
  22. package/dist/chunk-4XHK6FWL.mjs +0 -2058
  23. package/dist/chunk-52XHYD2V.mjs +0 -214
  24. package/dist/chunk-5FTDWKHH.mjs +0 -244
  25. package/dist/chunk-5GUFFFGL.mjs +0 -148
  26. package/dist/chunk-5RKTOVR5.mjs +0 -244
  27. package/dist/chunk-5VNJ7C6N.mjs +0 -154
  28. package/dist/chunk-5YDMOO4X.mjs +0 -214
  29. package/dist/chunk-64ZWEMLJ.mjs +0 -148
  30. package/dist/chunk-6CQOAAMV.mjs +0 -1803
  31. package/dist/chunk-6SEVAAVT.mjs +0 -3516
  32. package/dist/chunk-6XP4KSWQ.mjs +0 -2190
  33. package/dist/chunk-6YLR5ZDA.mjs +0 -2829
  34. package/dist/chunk-72QWL54I.mjs +0 -175
  35. package/dist/chunk-7B4TRI7C.mjs +0 -4835
  36. package/dist/chunk-7JRAEFRB.mjs +0 -7510
  37. package/dist/chunk-7ZKGHTNB.mjs +0 -4952
  38. package/dist/chunk-AOGY2GK6.mjs +0 -3292
  39. package/dist/chunk-AXXUXRNA.mjs +0 -1434
  40. package/dist/chunk-CHLVKMQW.mjs +0 -175
  41. package/dist/chunk-CKGOZAB7.mjs +0 -939
  42. package/dist/chunk-D34RAZUX.mjs +0 -2223
  43. package/dist/chunk-DE3ZGQAC.mjs +0 -148
  44. package/dist/chunk-DMCY3BBG.mjs +0 -1933
  45. package/dist/chunk-DPIK3PJS.mjs +0 -244
  46. package/dist/chunk-E5IVH4RE.mjs +0 -186
  47. package/dist/chunk-E6FZNUR5.mjs +0 -4953
  48. package/dist/chunk-EJRBDQDP.mjs +0 -2607
  49. package/dist/chunk-ELO4TXJL.mjs +0 -186
  50. package/dist/chunk-EO6SYNCG.mjs +0 -175
  51. package/dist/chunk-EQGA6A6D.mjs +0 -121
  52. package/dist/chunk-EY2CSXYA.mjs +0 -822
  53. package/dist/chunk-FIQ65CDR.mjs +0 -925
  54. package/dist/chunk-FKRO52XH.mjs +0 -3446
  55. package/dist/chunk-FL4YAKU6.mjs +0 -4941
  56. package/dist/chunk-FOZXJFAR.mjs +0 -186
  57. package/dist/chunk-FX6URXWN.mjs +0 -186
  58. package/dist/chunk-FYT47UBU.mjs +0 -5076
  59. package/dist/chunk-G7SMOWOL.mjs +0 -828
  60. package/dist/chunk-GCLGPOJZ.mjs +0 -148
  61. package/dist/chunk-GGB4G5YY.mjs +0 -175
  62. package/dist/chunk-GXB4JOP7.mjs +0 -5072
  63. package/dist/chunk-HFXOUMTD.mjs +0 -175
  64. package/dist/chunk-HLRGCCIL.mjs +0 -4839
  65. package/dist/chunk-HOIUP6IF.mjs +0 -690
  66. package/dist/chunk-HRYR54PT.mjs +0 -175
  67. package/dist/chunk-HWIZ47US.mjs +0 -214
  68. package/dist/chunk-I3AU7GRD.mjs +0 -120
  69. package/dist/chunk-IB7MNPQL.mjs +0 -4953
  70. package/dist/chunk-ICSIHQCG.mjs +0 -148
  71. package/dist/chunk-ILFGMUVD.mjs +0 -1933
  72. package/dist/chunk-IPTX5MJU.mjs +0 -3223
  73. package/dist/chunk-ITGUSH2Z.mjs +0 -2783
  74. package/dist/chunk-IXHBCAMF.mjs +0 -3306
  75. package/dist/chunk-J7JUAHS4.mjs +0 -186
  76. package/dist/chunk-J7TWJ3TM.mjs +0 -2784
  77. package/dist/chunk-JDPLDGVF.mjs +0 -4810
  78. package/dist/chunk-JLA5VNQ3.mjs +0 -186
  79. package/dist/chunk-JQLWFCTM.mjs +0 -214
  80. package/dist/chunk-K53XP2DL.mjs +0 -148
  81. package/dist/chunk-K5HX2SVL.mjs +0 -1902
  82. package/dist/chunk-KFGYOOVS.mjs +0 -214
  83. package/dist/chunk-KFJJCQAL.mjs +0 -148
  84. package/dist/chunk-KFVVOS5N.mjs +0 -925
  85. package/dist/chunk-KJUIIEQE.mjs +0 -186
  86. package/dist/chunk-KNWTHRVQ.mjs +0 -175
  87. package/dist/chunk-KSG4XSZF.mjs +0 -175
  88. package/dist/chunk-L2OZ4CDV.mjs +0 -113
  89. package/dist/chunk-LF5N6DOU.mjs +0 -175
  90. package/dist/chunk-LJQCM2IM.mjs +0 -214
  91. package/dist/chunk-MIZV3TAN.mjs +0 -3293
  92. package/dist/chunk-NKKLQE5V.mjs +0 -148
  93. package/dist/chunk-NOW23XFZ.mjs +0 -186
  94. package/dist/chunk-NRXQKQ74.mjs +0 -148
  95. package/dist/chunk-NTB7OEX2.mjs +0 -2918
  96. package/dist/chunk-NW6555WJ.mjs +0 -186
  97. package/dist/chunk-O4AUS7EU.mjs +0 -148
  98. package/dist/chunk-OMZE6VLQ.mjs +0 -214
  99. package/dist/chunk-OPJKP747.mjs +0 -7506
  100. package/dist/chunk-OWI6XWCD.mjs +0 -3375
  101. package/dist/chunk-P4BR7WVO.mjs +0 -2190
  102. package/dist/chunk-PRUMNNDI.mjs +0 -3192
  103. package/dist/chunk-QQHVYH2X.mjs +0 -244
  104. package/dist/chunk-QTBD5B3F.mjs +0 -148
  105. package/dist/chunk-R57T26RR.mjs +0 -734
  106. package/dist/chunk-S5QLWLLT.mjs +0 -186
  107. package/dist/chunk-SCWGT2FY.mjs +0 -2190
  108. package/dist/chunk-SKSDPPNT.mjs +0 -3788
  109. package/dist/chunk-SMKJUSB3.mjs +0 -2190
  110. package/dist/chunk-SP2YUS33.mjs +0 -186
  111. package/dist/chunk-SU4E6E7B.mjs +0 -3153
  112. package/dist/chunk-SYUUKW5A.mjs +0 -3379
  113. package/dist/chunk-THFYE5ZX.mjs +0 -244
  114. package/dist/chunk-UDDTWG5J.mjs +0 -734
  115. package/dist/chunk-UL2XZEMA.mjs +0 -3128
  116. package/dist/chunk-VCAY2KGM.mjs +0 -175
  117. package/dist/chunk-VLTKQDJ3.mjs +0 -244
  118. package/dist/chunk-WBYMW4NQ.mjs +0 -3450
  119. package/dist/chunk-WECAV6QB.mjs +0 -148
  120. package/dist/chunk-WMKBXUCE.mjs +0 -3228
  121. package/dist/chunk-XAJ5BKKL.mjs +0 -4947
  122. package/dist/chunk-XG2X7AEA.mjs +0 -175
  123. package/dist/chunk-XG7Z23NQ.mjs +0 -148
  124. package/dist/chunk-XMWUHQVV.mjs +0 -939
  125. package/dist/chunk-XWZAOCQ7.mjs +0 -2607
  126. package/dist/chunk-XZNEDRGN.mjs +0 -3876
  127. package/dist/chunk-Y6FXYEAI.mjs +0 -10
  128. package/dist/chunk-Y6MA7ULW.mjs +0 -148
  129. package/dist/chunk-YFS6JMYO.mjs +0 -3342
  130. package/dist/chunk-YMS7Q7LG.mjs +0 -214
  131. package/dist/chunk-Z2G5RZ4H.mjs +0 -186
  132. package/dist/chunk-Z6AIQ4KL.mjs +0 -113
  133. package/dist/chunk-ZA37XTGA.mjs +0 -175
  134. package/dist/chunk-ZE3KCHBM.mjs +0 -2918
  135. package/dist/config-PL24KEWL.mjs +0 -219
  136. package/dist/dev-server-Bs_sz2DG.d.mts +0 -111
  137. package/dist/dev-server-Bs_sz2DG.d.ts +0 -111
  138. package/dist/dev-server-CjoufJ-u.d.mts +0 -109
  139. package/dist/dev-server-CjoufJ-u.d.ts +0 -109
  140. package/dist/dev-server-RmGHIntF.d.mts +0 -113
  141. package/dist/dev-server-RmGHIntF.d.ts +0 -113
  142. package/dist/engine-binary-QQUDACBJ.mjs +0 -455
  143. package/dist/envelope-DD7v0v6E.d.mts +0 -265
  144. package/dist/envelope-DD7v0v6E.d.ts +0 -265
  145. package/dist/envelope-vCVjrHlo.d.mts +0 -265
  146. package/dist/envelope-vCVjrHlo.d.ts +0 -265
  147. package/dist/index-B5gSgvnd.d.mts +0 -44
  148. package/dist/index-B5gSgvnd.d.ts +0 -44
  149. package/dist/index-Bs0MnR54.d.mts +0 -103
  150. package/dist/index-Bs0MnR54.d.ts +0 -103
  151. package/dist/index-DR0nNc_f.d.mts +0 -101
  152. package/dist/index-DR0nNc_f.d.ts +0 -101
  153. package/dist/index-revho_gS.d.mts +0 -104
  154. package/dist/index-revho_gS.d.ts +0 -104
  155. package/dist/init-7FJENUDK.mjs +0 -407
  156. package/dist/init-7JQMAAXS.mjs +0 -363
  157. package/dist/init-DQDX3QK6.mjs +0 -369
  158. package/dist/init-EHO4VQ22.mjs +0 -369
  159. package/dist/init-IXEE2RCF.mjs +0 -340
  160. package/dist/init-UC3FWPIW.mjs +0 -367
  161. package/dist/init-UNSMVKIK.mjs +0 -366
  162. package/dist/init-UNV5XIDE.mjs +0 -367
  163. package/dist/project-compiler-2P4N4DR7.mjs +0 -10
  164. package/dist/project-compiler-D2LCC27O.mjs +0 -10
  165. package/dist/project-compiler-EGJUTAJU.mjs +0 -10
  166. package/dist/project-compiler-EJ3GANJE.mjs +0 -10
  167. package/dist/project-compiler-LOQKVRZJ.mjs +0 -10
  168. package/dist/project-compiler-NNK32MPG.mjs +0 -10
  169. package/dist/project-compiler-OP2VVGJQ.mjs +0 -10
  170. package/dist/project-compiler-RQ6OQKRM.mjs +0 -10
  171. package/dist/project-compiler-VFR6CSDX.mjs +0 -10
  172. package/dist/project-compiler-VWNNCHGO.mjs +0 -10
  173. package/dist/project-compiler-XVAAU4C5.mjs +0 -10
  174. package/dist/project-compiler-YES5FGMD.mjs +0 -10
  175. package/dist/project-compiler-ZKMQDLGU.mjs +0 -10
  176. package/dist/project-decompiler-5GY2KSG4.mjs +0 -7
  177. package/dist/project-decompiler-FLXCEJHS.mjs +0 -7
  178. package/dist/project-decompiler-US7GAVIC.mjs +0 -7
  179. package/dist/project-decompiler-VLPR22QF.mjs +0 -7
  180. package/dist/pull-A2QUHW4K.mjs +0 -109
  181. package/dist/pull-FUS5QYZS.mjs +0 -109
  182. package/dist/pull-JBEQWVPE.mjs +0 -109
  183. package/dist/pull-LD5ENLGY.mjs +0 -109
  184. package/dist/pull-P44LDRWB.mjs +0 -109
  185. package/dist/verify-BYHUKARQ.mjs +0 -1833
  186. package/dist/verify-SEIXUGN4.mjs +0 -1833
@@ -1,219 +0,0 @@
1
- import "./chunk-CIESM3BP.mjs";
2
-
3
- // src/cli/config.ts
4
- import { existsSync, readFileSync, writeFileSync } from "fs";
5
- import { resolve, join } from "path";
6
- var DEFAULT_CONFIG = {
7
- dev: {
8
- port: 5199,
9
- apiPort: 4200,
10
- db: "sqlite://mm-dev.db",
11
- redis: "",
12
- api: "http://localhost:4200/api/v1",
13
- seed: false,
14
- open: false
15
- },
16
- build: {
17
- mode: "infer",
18
- outDir: "dist/workflows",
19
- skipTypeCheck: false
20
- },
21
- test: {
22
- minCoverage: 80,
23
- minMutationScore: 60,
24
- integration: false
25
- },
26
- environments: {
27
- local: { apiUrl: "http://localhost:4200/api/v1" },
28
- dev: { apiUrl: "https://dev.mindmatrix.club/api/v1" }
29
- },
30
- defaultTarget: "dev"
31
- };
32
- function isPlainObject(val) {
33
- return typeof val === "object" && val !== null && !Array.isArray(val);
34
- }
35
- function deepMerge(target, source) {
36
- const result = { ...target };
37
- for (const key of Object.keys(source)) {
38
- const srcVal = source[key];
39
- const tgtVal = target[key];
40
- if (isPlainObject(srcVal) && isPlainObject(tgtVal)) {
41
- result[key] = deepMerge(tgtVal, srcVal);
42
- } else if (srcVal !== void 0) {
43
- result[key] = srcVal;
44
- }
45
- }
46
- return result;
47
- }
48
- function findConfigPath(startDir) {
49
- let dir = startDir ?? process.cwd();
50
- const root = resolve("/");
51
- while (true) {
52
- for (const name of ["mmrc.config.ts", "mmrc.config.json"]) {
53
- const candidate = join(dir, name);
54
- if (existsSync(candidate)) return candidate;
55
- }
56
- const parent = resolve(dir, "..");
57
- if (parent === dir || parent === root) break;
58
- dir = parent;
59
- }
60
- return null;
61
- }
62
- function loadConfigFromFile(configPath) {
63
- const content = readFileSync(configPath, "utf-8");
64
- if (configPath.endsWith(".json")) {
65
- try {
66
- return JSON.parse(content);
67
- } catch {
68
- return {};
69
- }
70
- }
71
- let js = content.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(?<![:'"])\/\/.*$/gm, "").replace(/^import\s+.*$/gm, "").replace(/^export\s+default\s+/m, "module.exports = ").replace(/^export\s+/gm, "").replace(/:\s*MmrcConfig/g, "").replace(/as\s+const/g, "").replace(/satisfies\s+\w+/g, "");
72
- js = `function defineMmrc(c) { return c; }
73
- ${js}`;
74
- try {
75
- const m = {};
76
- const fn = new Function("module", "exports", "require", js);
77
- fn(m, m, () => ({}));
78
- const exported = m.exports ?? m;
79
- return isPlainObject(exported) ? exported : {};
80
- } catch {
81
- return {};
82
- }
83
- }
84
- function getConfig(startDir) {
85
- const configPath = findConfigPath(startDir);
86
- if (!configPath) return { ...DEFAULT_CONFIG };
87
- const userConfig = loadConfigFromFile(configPath);
88
- return deepMerge(DEFAULT_CONFIG, userConfig);
89
- }
90
- function getConfigValue(config, key) {
91
- const parts = key.split(".");
92
- let current = config;
93
- for (const part of parts) {
94
- if (!isPlainObject(current)) return void 0;
95
- current = current[part];
96
- }
97
- return current;
98
- }
99
- function setConfigValue(config, key, value) {
100
- const parts = key.split(".");
101
- let current = config;
102
- for (let i = 0; i < parts.length - 1; i++) {
103
- const part = parts[i];
104
- if (!isPlainObject(current[part])) {
105
- current[part] = {};
106
- }
107
- current = current[part];
108
- }
109
- const last = parts[parts.length - 1];
110
- if (value === "true") current[last] = true;
111
- else if (value === "false") current[last] = false;
112
- else if (/^\d+$/.test(value)) current[last] = parseInt(value, 10);
113
- else current[last] = value;
114
- }
115
- function flattenConfig(obj, prefix = "") {
116
- const entries = [];
117
- if (!isPlainObject(obj)) {
118
- entries.push([prefix, String(obj)]);
119
- return entries;
120
- }
121
- for (const [key, val] of Object.entries(obj)) {
122
- const fullKey = prefix ? `${prefix}.${key}` : key;
123
- if (isPlainObject(val)) {
124
- entries.push(...flattenConfig(val, fullKey));
125
- } else {
126
- entries.push([fullKey, String(val)]);
127
- }
128
- }
129
- return entries;
130
- }
131
- function writeConfigFile(configPath, config) {
132
- const json = JSON.stringify(config, null, 2);
133
- const content = `/**
134
- * mmrc.config.ts \u2014 MindMatrix React Compiler configuration.
135
- *
136
- * Configures the mmrc CLI for local dev, builds, tests, and deploy targets.
137
- * Edit directly or run \`mmrc config set <key> <value>\`.
138
- */
139
-
140
- const config = ${json};
141
-
142
- export default config;
143
- `;
144
- writeFileSync(configPath, content, "utf-8");
145
- }
146
- function resolveTarget(targetName, config, fallbackApiUrl) {
147
- if (!config || !config.environments) {
148
- return { name: targetName ?? "default", apiUrl: fallbackApiUrl, token: null };
149
- }
150
- const name = targetName ?? config.defaultTarget ?? "local";
151
- const env = config.environments[name];
152
- if (!env) {
153
- const available = Object.keys(config.environments).join(", ");
154
- throw new Error(`Unknown target "${name}". Available environments: ${available}`);
155
- }
156
- return { name, apiUrl: env.apiUrl, token: env.token ?? null };
157
- }
158
- function generateMmrcConfig() {
159
- return `/**
160
- * mmrc.config.ts \u2014 MindMatrix React Compiler configuration.
161
- *
162
- * Configures the mmrc CLI for local dev, builds, tests, and deploy targets.
163
- * Edit directly or run \`mmrc config set <key> <value>\`.
164
- */
165
-
166
- const config = {
167
- dev: {
168
- port: 5199,
169
- apiPort: 4200,
170
- db: 'sqlite://mm-dev.db',
171
- redis: '',
172
- api: 'https://dev.mindmatrix.club/api/v1',
173
- seed: false,
174
- open: false,
175
- },
176
-
177
- build: {
178
- mode: 'infer',
179
- outDir: 'dist/workflows',
180
- skipTypeCheck: false,
181
- },
182
-
183
- test: {
184
- minCoverage: 80,
185
- minMutationScore: 60,
186
- integration: false,
187
- },
188
-
189
- environments: {
190
- local: { apiUrl: 'http://localhost:4200/api/v1' },
191
- dev: { apiUrl: 'https://dev.mindmatrix.club/api/v1' },
192
- },
193
-
194
- defaultTarget: 'dev',
195
- };
196
-
197
- export default config;
198
- `;
199
- }
200
- function loadMmrcConfig(dir) {
201
- const path = findConfigPath(dir);
202
- if (!path) return null;
203
- const partial = loadConfigFromFile(path);
204
- return deepMerge(DEFAULT_CONFIG, partial);
205
- }
206
- export {
207
- DEFAULT_CONFIG,
208
- deepMerge,
209
- findConfigPath,
210
- flattenConfig,
211
- generateMmrcConfig,
212
- getConfig,
213
- getConfigValue,
214
- loadConfigFromFile,
215
- loadMmrcConfig,
216
- resolveTarget,
217
- setConfigValue,
218
- writeConfigFile
219
- };
@@ -1,111 +0,0 @@
1
- import { ViteDevServer } from 'vite';
2
- import { IRWorkflowDefinition } from '@mindmatrix/player-core';
3
-
4
- /**
5
- * CLI Build Command — compiles workflow files to Pure Form JSON.
6
- *
7
- * Supports three file types:
8
- * - *.workflow.tsx — React workflow components
9
- * - models/*.ts — TypeScript model files
10
- * - *.server.ts — Server action files
11
- *
12
- * Produces:
13
- * - *.workflow.json — IR (Pure Form)
14
- * - *.json — Engine-compatible definition
15
- * - envelope.json — Source envelope with file manifest
16
- */
17
-
18
- interface BuildOptions {
19
- src?: string;
20
- outDir?: string;
21
- mode?: 'strict' | 'infer';
22
- /** Generate source envelope. */
23
- envelope?: boolean;
24
- /** Blueprint slug for envelope. */
25
- slug?: string;
26
- /** Blueprint version for envelope. */
27
- version?: string;
28
- /** Skip TypeScript type checking (not recommended). */
29
- skipTypeCheck?: boolean;
30
- }
31
- interface BuildResult {
32
- compiled: number;
33
- errors: number;
34
- warnings: number;
35
- definitions: IRWorkflowDefinition[];
36
- errorDetails: {
37
- file: string;
38
- message: string;
39
- line?: number;
40
- }[];
41
- }
42
- declare function build(options?: BuildOptions): Promise<BuildResult>;
43
-
44
- /**
45
- * Dev Server — Vite-based development server for MindMatrix React workflows.
46
- *
47
- * Uses the Vite plugin to watch .workflow.tsx files. On file change:
48
- * 1. Compile through Babel plugin → extract IR
49
- * 2. Diff IR against last known state
50
- * 3. Notify connected frontends via WebSocket
51
- * 4. Optionally seed definitions to the dev API
52
- *
53
- * Usage (programmatic):
54
- * import { createDevServer } from '@mindmatrix/react-compiler';
55
- * const server = await createDevServer({ port: 5199 });
56
- * // ... server.close() to stop
57
- *
58
- * Usage (CLI):
59
- * mmrc dev --port 5199 --src src/workflows --seed
60
- */
61
-
62
- /** Minimal WebSocket interface — avoids requiring @types/ws at compile time */
63
- interface WsClient {
64
- readyState: number;
65
- send(data: string): void;
66
- close(): void;
67
- on(event: string, listener: (...args: unknown[]) => void): void;
68
- }
69
- interface DevServerOptions {
70
- /** Port for the dev server. Default: 5199 */
71
- port?: number;
72
- /** Source directory to watch. Default: 'src/workflows' */
73
- src?: string;
74
- /** Compilation mode. Default: 'infer' */
75
- mode?: 'strict' | 'infer';
76
- /** Glob patterns for workflow files. Default: ['**\/*.workflow.tsx'] */
77
- include?: string[];
78
- /** Output directory for .workflow.json sidecar files. Default: 'dist/workflows' */
79
- outDir?: string;
80
- /** Seed compiled definitions to the dev API on change. Default: false */
81
- seed?: boolean;
82
- /** Dev API base URL. Default: 'http://localhost:4200/api/v1' */
83
- apiUrl?: string;
84
- /** Auth token for dev API. Default: reads from MINDMATRIX_TOKEN env */
85
- authToken?: string;
86
- /** Enable WebSocket notification channel. Default: true */
87
- ws?: boolean;
88
- /** Open browser on start. Default: false */
89
- open?: boolean;
90
- }
91
- interface DevServerInstance {
92
- /** The underlying Vite dev server */
93
- vite: ViteDevServer;
94
- /** Port the server is running on */
95
- port: number;
96
- /** Connected WebSocket clients */
97
- clients: Set<WsClient>;
98
- /** Trigger a full rebuild of all workflow files */
99
- rebuild: () => Promise<BuildResult>;
100
- /** Stop the dev server */
101
- close: () => Promise<void>;
102
- }
103
- /**
104
- * Create and start a MindMatrix dev server.
105
- *
106
- * This is a thin Vite server configured with the mindmatrixReact plugin,
107
- * plus a WebSocket channel that pushes compile events to connected editors.
108
- */
109
- declare function createDevServer(options?: DevServerOptions): Promise<DevServerInstance>;
110
-
111
- export { type BuildOptions as B, type DevServerOptions as D, type DevServerInstance as a, build as b, createDevServer as c, type BuildResult as d };
@@ -1,111 +0,0 @@
1
- import { ViteDevServer } from 'vite';
2
- import { IRWorkflowDefinition } from '@mindmatrix/player-core';
3
-
4
- /**
5
- * CLI Build Command — compiles workflow files to Pure Form JSON.
6
- *
7
- * Supports three file types:
8
- * - *.workflow.tsx — React workflow components
9
- * - models/*.ts — TypeScript model files
10
- * - *.server.ts — Server action files
11
- *
12
- * Produces:
13
- * - *.workflow.json — IR (Pure Form)
14
- * - *.json — Engine-compatible definition
15
- * - envelope.json — Source envelope with file manifest
16
- */
17
-
18
- interface BuildOptions {
19
- src?: string;
20
- outDir?: string;
21
- mode?: 'strict' | 'infer';
22
- /** Generate source envelope. */
23
- envelope?: boolean;
24
- /** Blueprint slug for envelope. */
25
- slug?: string;
26
- /** Blueprint version for envelope. */
27
- version?: string;
28
- /** Skip TypeScript type checking (not recommended). */
29
- skipTypeCheck?: boolean;
30
- }
31
- interface BuildResult {
32
- compiled: number;
33
- errors: number;
34
- warnings: number;
35
- definitions: IRWorkflowDefinition[];
36
- errorDetails: {
37
- file: string;
38
- message: string;
39
- line?: number;
40
- }[];
41
- }
42
- declare function build(options?: BuildOptions): Promise<BuildResult>;
43
-
44
- /**
45
- * Dev Server — Vite-based development server for MindMatrix React workflows.
46
- *
47
- * Uses the Vite plugin to watch .workflow.tsx files. On file change:
48
- * 1. Compile through Babel plugin → extract IR
49
- * 2. Diff IR against last known state
50
- * 3. Notify connected frontends via WebSocket
51
- * 4. Optionally seed definitions to the dev API
52
- *
53
- * Usage (programmatic):
54
- * import { createDevServer } from '@mindmatrix/react-compiler';
55
- * const server = await createDevServer({ port: 5199 });
56
- * // ... server.close() to stop
57
- *
58
- * Usage (CLI):
59
- * mmrc dev --port 5199 --src src/workflows --seed
60
- */
61
-
62
- /** Minimal WebSocket interface — avoids requiring @types/ws at compile time */
63
- interface WsClient {
64
- readyState: number;
65
- send(data: string): void;
66
- close(): void;
67
- on(event: string, listener: (...args: unknown[]) => void): void;
68
- }
69
- interface DevServerOptions {
70
- /** Port for the dev server. Default: 5199 */
71
- port?: number;
72
- /** Source directory to watch. Default: 'src/workflows' */
73
- src?: string;
74
- /** Compilation mode. Default: 'infer' */
75
- mode?: 'strict' | 'infer';
76
- /** Glob patterns for workflow files. Default: ['**\/*.workflow.tsx'] */
77
- include?: string[];
78
- /** Output directory for .workflow.json sidecar files. Default: 'dist/workflows' */
79
- outDir?: string;
80
- /** Seed compiled definitions to the dev API on change. Default: false */
81
- seed?: boolean;
82
- /** Dev API base URL. Default: 'http://localhost:4200/api/v1' */
83
- apiUrl?: string;
84
- /** Auth token for dev API. Default: reads from MINDMATRIX_TOKEN env */
85
- authToken?: string;
86
- /** Enable WebSocket notification channel. Default: true */
87
- ws?: boolean;
88
- /** Open browser on start. Default: false */
89
- open?: boolean;
90
- }
91
- interface DevServerInstance {
92
- /** The underlying Vite dev server */
93
- vite: ViteDevServer;
94
- /** Port the server is running on */
95
- port: number;
96
- /** Connected WebSocket clients */
97
- clients: Set<WsClient>;
98
- /** Trigger a full rebuild of all workflow files */
99
- rebuild: () => Promise<BuildResult>;
100
- /** Stop the dev server */
101
- close: () => Promise<void>;
102
- }
103
- /**
104
- * Create and start a MindMatrix dev server.
105
- *
106
- * This is a thin Vite server configured with the mindmatrixReact plugin,
107
- * plus a WebSocket channel that pushes compile events to connected editors.
108
- */
109
- declare function createDevServer(options?: DevServerOptions): Promise<DevServerInstance>;
110
-
111
- export { type BuildOptions as B, type DevServerOptions as D, type DevServerInstance as a, build as b, createDevServer as c, type BuildResult as d };
@@ -1,109 +0,0 @@
1
- import { ViteDevServer } from 'vite';
2
- import { IRWorkflowDefinition } from '@mindmatrix/player-core';
3
-
4
- /**
5
- * CLI Build Command — compiles workflow files to Pure Form JSON.
6
- *
7
- * Supports three file types:
8
- * - *.workflow.tsx — React workflow components
9
- * - models/*.ts — TypeScript model files
10
- * - *.server.ts — Server action files
11
- *
12
- * Produces:
13
- * - *.workflow.json — IR (Pure Form)
14
- * - *.json — Engine-compatible definition
15
- * - envelope.json — Source envelope with file manifest
16
- */
17
-
18
- interface BuildOptions {
19
- src?: string;
20
- outDir?: string;
21
- mode?: 'strict' | 'infer';
22
- /** Generate source envelope. */
23
- envelope?: boolean;
24
- /** Blueprint slug for envelope. */
25
- slug?: string;
26
- /** Blueprint version for envelope. */
27
- version?: string;
28
- }
29
- interface BuildResult {
30
- compiled: number;
31
- errors: number;
32
- warnings: number;
33
- definitions: IRWorkflowDefinition[];
34
- errorDetails: {
35
- file: string;
36
- message: string;
37
- line?: number;
38
- }[];
39
- }
40
- declare function build(options?: BuildOptions): Promise<BuildResult>;
41
-
42
- /**
43
- * Dev Server — Vite-based development server for MindMatrix React workflows.
44
- *
45
- * Uses the Vite plugin to watch .workflow.tsx files. On file change:
46
- * 1. Compile through Babel plugin → extract IR
47
- * 2. Diff IR against last known state
48
- * 3. Notify connected frontends via WebSocket
49
- * 4. Optionally seed definitions to the dev API
50
- *
51
- * Usage (programmatic):
52
- * import { createDevServer } from '@mindmatrix/react-compiler';
53
- * const server = await createDevServer({ port: 5199 });
54
- * // ... server.close() to stop
55
- *
56
- * Usage (CLI):
57
- * mmrc dev --port 5199 --src src/workflows --seed
58
- */
59
-
60
- /** Minimal WebSocket interface — avoids requiring @types/ws at compile time */
61
- interface WsClient {
62
- readyState: number;
63
- send(data: string): void;
64
- close(): void;
65
- on(event: string, listener: (...args: unknown[]) => void): void;
66
- }
67
- interface DevServerOptions {
68
- /** Port for the dev server. Default: 5199 */
69
- port?: number;
70
- /** Source directory to watch. Default: 'src/workflows' */
71
- src?: string;
72
- /** Compilation mode. Default: 'infer' */
73
- mode?: 'strict' | 'infer';
74
- /** Glob patterns for workflow files. Default: ['**\/*.workflow.tsx'] */
75
- include?: string[];
76
- /** Output directory for .workflow.json sidecar files. Default: 'dist/workflows' */
77
- outDir?: string;
78
- /** Seed compiled definitions to the dev API on change. Default: false */
79
- seed?: boolean;
80
- /** Dev API base URL. Default: 'http://localhost:4200/api/v1' */
81
- apiUrl?: string;
82
- /** Auth token for dev API. Default: reads from MINDMATRIX_TOKEN env */
83
- authToken?: string;
84
- /** Enable WebSocket notification channel. Default: true */
85
- ws?: boolean;
86
- /** Open browser on start. Default: false */
87
- open?: boolean;
88
- }
89
- interface DevServerInstance {
90
- /** The underlying Vite dev server */
91
- vite: ViteDevServer;
92
- /** Port the server is running on */
93
- port: number;
94
- /** Connected WebSocket clients */
95
- clients: Set<WsClient>;
96
- /** Trigger a full rebuild of all workflow files */
97
- rebuild: () => Promise<BuildResult>;
98
- /** Stop the dev server */
99
- close: () => Promise<void>;
100
- }
101
- /**
102
- * Create and start a MindMatrix dev server.
103
- *
104
- * This is a thin Vite server configured with the mindmatrixReact plugin,
105
- * plus a WebSocket channel that pushes compile events to connected editors.
106
- */
107
- declare function createDevServer(options?: DevServerOptions): Promise<DevServerInstance>;
108
-
109
- export { type BuildOptions as B, type DevServerOptions as D, type DevServerInstance as a, build as b, createDevServer as c, type BuildResult as d };
@@ -1,109 +0,0 @@
1
- import { ViteDevServer } from 'vite';
2
- import { IRWorkflowDefinition } from '@mindmatrix/player-core';
3
-
4
- /**
5
- * CLI Build Command — compiles workflow files to Pure Form JSON.
6
- *
7
- * Supports three file types:
8
- * - *.workflow.tsx — React workflow components
9
- * - models/*.ts — TypeScript model files
10
- * - *.server.ts — Server action files
11
- *
12
- * Produces:
13
- * - *.workflow.json — IR (Pure Form)
14
- * - *.json — Engine-compatible definition
15
- * - envelope.json — Source envelope with file manifest
16
- */
17
-
18
- interface BuildOptions {
19
- src?: string;
20
- outDir?: string;
21
- mode?: 'strict' | 'infer';
22
- /** Generate source envelope. */
23
- envelope?: boolean;
24
- /** Blueprint slug for envelope. */
25
- slug?: string;
26
- /** Blueprint version for envelope. */
27
- version?: string;
28
- }
29
- interface BuildResult {
30
- compiled: number;
31
- errors: number;
32
- warnings: number;
33
- definitions: IRWorkflowDefinition[];
34
- errorDetails: {
35
- file: string;
36
- message: string;
37
- line?: number;
38
- }[];
39
- }
40
- declare function build(options?: BuildOptions): Promise<BuildResult>;
41
-
42
- /**
43
- * Dev Server — Vite-based development server for MindMatrix React workflows.
44
- *
45
- * Uses the Vite plugin to watch .workflow.tsx files. On file change:
46
- * 1. Compile through Babel plugin → extract IR
47
- * 2. Diff IR against last known state
48
- * 3. Notify connected frontends via WebSocket
49
- * 4. Optionally seed definitions to the dev API
50
- *
51
- * Usage (programmatic):
52
- * import { createDevServer } from '@mindmatrix/react-compiler';
53
- * const server = await createDevServer({ port: 5199 });
54
- * // ... server.close() to stop
55
- *
56
- * Usage (CLI):
57
- * mmrc dev --port 5199 --src src/workflows --seed
58
- */
59
-
60
- /** Minimal WebSocket interface — avoids requiring @types/ws at compile time */
61
- interface WsClient {
62
- readyState: number;
63
- send(data: string): void;
64
- close(): void;
65
- on(event: string, listener: (...args: unknown[]) => void): void;
66
- }
67
- interface DevServerOptions {
68
- /** Port for the dev server. Default: 5199 */
69
- port?: number;
70
- /** Source directory to watch. Default: 'src/workflows' */
71
- src?: string;
72
- /** Compilation mode. Default: 'infer' */
73
- mode?: 'strict' | 'infer';
74
- /** Glob patterns for workflow files. Default: ['**\/*.workflow.tsx'] */
75
- include?: string[];
76
- /** Output directory for .workflow.json sidecar files. Default: 'dist/workflows' */
77
- outDir?: string;
78
- /** Seed compiled definitions to the dev API on change. Default: false */
79
- seed?: boolean;
80
- /** Dev API base URL. Default: 'http://localhost:4200/api/v1' */
81
- apiUrl?: string;
82
- /** Auth token for dev API. Default: reads from MINDMATRIX_TOKEN env */
83
- authToken?: string;
84
- /** Enable WebSocket notification channel. Default: true */
85
- ws?: boolean;
86
- /** Open browser on start. Default: false */
87
- open?: boolean;
88
- }
89
- interface DevServerInstance {
90
- /** The underlying Vite dev server */
91
- vite: ViteDevServer;
92
- /** Port the server is running on */
93
- port: number;
94
- /** Connected WebSocket clients */
95
- clients: Set<WsClient>;
96
- /** Trigger a full rebuild of all workflow files */
97
- rebuild: () => Promise<BuildResult>;
98
- /** Stop the dev server */
99
- close: () => Promise<void>;
100
- }
101
- /**
102
- * Create and start a MindMatrix dev server.
103
- *
104
- * This is a thin Vite server configured with the mindmatrixReact plugin,
105
- * plus a WebSocket channel that pushes compile events to connected editors.
106
- */
107
- declare function createDevServer(options?: DevServerOptions): Promise<DevServerInstance>;
108
-
109
- export { type BuildOptions as B, type DevServerOptions as D, type DevServerInstance as a, build as b, createDevServer as c, type BuildResult as d };