@walkeros/cli 0.6.0 → 0.6.1-next-1766186076625

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 (263) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +53 -8
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.js +364 -194
  5. package/dist/index.js.map +1 -1
  6. package/dist/runtime/main.js +3 -2
  7. package/dist/runtime/main.js.map +1 -1
  8. package/package.json +2 -2
  9. package/dist/__tests__/bundle/bundler-helpers.test.d.ts +0 -2
  10. package/dist/__tests__/bundle/bundler-helpers.test.d.ts.map +0 -1
  11. package/dist/__tests__/bundle/bundler-helpers.test.js +0 -151
  12. package/dist/__tests__/bundle/bundler-helpers.test.js.map +0 -1
  13. package/dist/__tests__/bundle/bundler.test.d.ts +0 -2
  14. package/dist/__tests__/bundle/bundler.test.d.ts.map +0 -1
  15. package/dist/__tests__/bundle/bundler.test.js +0 -352
  16. package/dist/__tests__/bundle/bundler.test.js.map +0 -1
  17. package/dist/__tests__/bundle/programmatic.test.d.ts +0 -2
  18. package/dist/__tests__/bundle/programmatic.test.d.ts.map +0 -1
  19. package/dist/__tests__/bundle/programmatic.test.js +0 -148
  20. package/dist/__tests__/bundle/programmatic.test.js.map +0 -1
  21. package/dist/__tests__/cli-e2e.test.d.ts +0 -8
  22. package/dist/__tests__/cli-e2e.test.d.ts.map +0 -1
  23. package/dist/__tests__/cli-e2e.test.js +0 -145
  24. package/dist/__tests__/cli-e2e.test.js.map +0 -1
  25. package/dist/__tests__/cli.test.d.ts +0 -2
  26. package/dist/__tests__/cli.test.d.ts.map +0 -1
  27. package/dist/__tests__/cli.test.js +0 -179
  28. package/dist/__tests__/cli.test.js.map +0 -1
  29. package/dist/__tests__/config-loader.test.d.ts +0 -7
  30. package/dist/__tests__/config-loader.test.d.ts.map +0 -1
  31. package/dist/__tests__/config-loader.test.js +0 -414
  32. package/dist/__tests__/config-loader.test.js.map +0 -1
  33. package/dist/__tests__/core/asset-resolver.test.d.ts +0 -2
  34. package/dist/__tests__/core/asset-resolver.test.d.ts.map +0 -1
  35. package/dist/__tests__/core/asset-resolver.test.js +0 -14
  36. package/dist/__tests__/core/asset-resolver.test.js.map +0 -1
  37. package/dist/__tests__/core/build-cache.test.d.ts +0 -2
  38. package/dist/__tests__/core/build-cache.test.d.ts.map +0 -1
  39. package/dist/__tests__/core/build-cache.test.js +0 -55
  40. package/dist/__tests__/core/build-cache.test.js.map +0 -1
  41. package/dist/__tests__/core/cache-utils.test.d.ts +0 -2
  42. package/dist/__tests__/core/cache-utils.test.d.ts.map +0 -1
  43. package/dist/__tests__/core/cache-utils.test.js +0 -70
  44. package/dist/__tests__/core/cache-utils.test.js.map +0 -1
  45. package/dist/__tests__/core/config.test.d.ts +0 -2
  46. package/dist/__tests__/core/config.test.d.ts.map +0 -1
  47. package/dist/__tests__/core/config.test.js +0 -79
  48. package/dist/__tests__/core/config.test.js.map +0 -1
  49. package/dist/__tests__/core/logger.test.d.ts +0 -2
  50. package/dist/__tests__/core/logger.test.d.ts.map +0 -1
  51. package/dist/__tests__/core/logger.test.js +0 -53
  52. package/dist/__tests__/core/logger.test.js.map +0 -1
  53. package/dist/__tests__/integration/bundle-run.integration.test.d.ts +0 -8
  54. package/dist/__tests__/integration/bundle-run.integration.test.d.ts.map +0 -1
  55. package/dist/__tests__/integration/bundle-run.integration.test.js +0 -54
  56. package/dist/__tests__/integration/bundle-run.integration.test.js.map +0 -1
  57. package/dist/__tests__/push/push.test.d.ts +0 -7
  58. package/dist/__tests__/push/push.test.d.ts.map +0 -1
  59. package/dist/__tests__/push/push.test.js +0 -197
  60. package/dist/__tests__/push/push.test.js.map +0 -1
  61. package/dist/__tests__/simulate/env-loader.test.d.ts +0 -2
  62. package/dist/__tests__/simulate/env-loader.test.d.ts.map +0 -1
  63. package/dist/__tests__/simulate/env-loader.test.js +0 -47
  64. package/dist/__tests__/simulate/env-loader.test.js.map +0 -1
  65. package/dist/__tests__/simulate/node-executor.test.d.ts +0 -5
  66. package/dist/__tests__/simulate/node-executor.test.d.ts.map +0 -1
  67. package/dist/__tests__/simulate/node-executor.test.js +0 -25
  68. package/dist/__tests__/simulate/node-executor.test.js.map +0 -1
  69. package/dist/__tests__/simulate/server-simulate.integration.test.d.ts +0 -5
  70. package/dist/__tests__/simulate/server-simulate.integration.test.d.ts.map +0 -1
  71. package/dist/__tests__/simulate/server-simulate.integration.test.js +0 -58
  72. package/dist/__tests__/simulate/server-simulate.integration.test.js.map +0 -1
  73. package/dist/__tests__/smoke/production.smoke.test.d.ts +0 -8
  74. package/dist/__tests__/smoke/production.smoke.test.d.ts.map +0 -1
  75. package/dist/__tests__/smoke/production.smoke.test.js +0 -65
  76. package/dist/__tests__/smoke/production.smoke.test.js.map +0 -1
  77. package/dist/commands/bundle/bundler.d.ts +0 -32
  78. package/dist/commands/bundle/bundler.d.ts.map +0 -1
  79. package/dist/commands/bundle/bundler.js +0 -569
  80. package/dist/commands/bundle/bundler.js.map +0 -1
  81. package/dist/commands/bundle/index.d.ts +0 -59
  82. package/dist/commands/bundle/index.d.ts.map +0 -1
  83. package/dist/commands/bundle/index.js +0 -184
  84. package/dist/commands/bundle/index.js.map +0 -1
  85. package/dist/commands/bundle/package-manager.d.ts +0 -8
  86. package/dist/commands/bundle/package-manager.d.ts.map +0 -1
  87. package/dist/commands/bundle/package-manager.js +0 -220
  88. package/dist/commands/bundle/package-manager.js.map +0 -1
  89. package/dist/commands/bundle/stats.d.ts +0 -23
  90. package/dist/commands/bundle/stats.d.ts.map +0 -1
  91. package/dist/commands/bundle/stats.js +0 -52
  92. package/dist/commands/bundle/stats.js.map +0 -1
  93. package/dist/commands/cache.d.ts +0 -7
  94. package/dist/commands/cache.d.ts.map +0 -1
  95. package/dist/commands/cache.js +0 -68
  96. package/dist/commands/cache.js.map +0 -1
  97. package/dist/commands/push/index.d.ts +0 -7
  98. package/dist/commands/push/index.d.ts.map +0 -1
  99. package/dist/commands/push/index.js +0 -247
  100. package/dist/commands/push/index.js.map +0 -1
  101. package/dist/commands/push/types.d.ts +0 -22
  102. package/dist/commands/push/types.d.ts.map +0 -1
  103. package/dist/commands/push/types.js +0 -2
  104. package/dist/commands/push/types.js.map +0 -1
  105. package/dist/commands/run/__tests__/run.integration.test.d.ts +0 -7
  106. package/dist/commands/run/__tests__/run.integration.test.d.ts.map +0 -1
  107. package/dist/commands/run/__tests__/run.integration.test.js +0 -51
  108. package/dist/commands/run/__tests__/run.integration.test.js.map +0 -1
  109. package/dist/commands/run/__tests__/validators.test.d.ts +0 -2
  110. package/dist/commands/run/__tests__/validators.test.d.ts.map +0 -1
  111. package/dist/commands/run/__tests__/validators.test.js +0 -80
  112. package/dist/commands/run/__tests__/validators.test.js.map +0 -1
  113. package/dist/commands/run/execution.d.ts +0 -14
  114. package/dist/commands/run/execution.d.ts.map +0 -1
  115. package/dist/commands/run/execution.js +0 -41
  116. package/dist/commands/run/execution.js.map +0 -1
  117. package/dist/commands/run/index.d.ts +0 -38
  118. package/dist/commands/run/index.d.ts.map +0 -1
  119. package/dist/commands/run/index.js +0 -154
  120. package/dist/commands/run/index.js.map +0 -1
  121. package/dist/commands/run/types.d.ts +0 -65
  122. package/dist/commands/run/types.d.ts.map +0 -1
  123. package/dist/commands/run/types.js +0 -7
  124. package/dist/commands/run/types.js.map +0 -1
  125. package/dist/commands/run/utils.d.ts +0 -29
  126. package/dist/commands/run/utils.d.ts.map +0 -1
  127. package/dist/commands/run/utils.js +0 -52
  128. package/dist/commands/run/utils.js.map +0 -1
  129. package/dist/commands/run/validators.d.ts +0 -33
  130. package/dist/commands/run/validators.d.ts.map +0 -1
  131. package/dist/commands/run/validators.js +0 -58
  132. package/dist/commands/run/validators.js.map +0 -1
  133. package/dist/commands/simulate/env-loader.d.ts +0 -19
  134. package/dist/commands/simulate/env-loader.d.ts.map +0 -1
  135. package/dist/commands/simulate/env-loader.js +0 -44
  136. package/dist/commands/simulate/env-loader.js.map +0 -1
  137. package/dist/commands/simulate/index.d.ts +0 -48
  138. package/dist/commands/simulate/index.d.ts.map +0 -1
  139. package/dist/commands/simulate/index.js +0 -113
  140. package/dist/commands/simulate/index.js.map +0 -1
  141. package/dist/commands/simulate/jsdom-executor.d.ts +0 -37
  142. package/dist/commands/simulate/jsdom-executor.d.ts.map +0 -1
  143. package/dist/commands/simulate/jsdom-executor.js +0 -137
  144. package/dist/commands/simulate/jsdom-executor.js.map +0 -1
  145. package/dist/commands/simulate/node-executor.d.ts +0 -28
  146. package/dist/commands/simulate/node-executor.d.ts.map +0 -1
  147. package/dist/commands/simulate/node-executor.js +0 -94
  148. package/dist/commands/simulate/node-executor.js.map +0 -1
  149. package/dist/commands/simulate/simulator.d.ts +0 -14
  150. package/dist/commands/simulate/simulator.d.ts.map +0 -1
  151. package/dist/commands/simulate/simulator.js +0 -163
  152. package/dist/commands/simulate/simulator.js.map +0 -1
  153. package/dist/commands/simulate/tracker.d.ts +0 -30
  154. package/dist/commands/simulate/tracker.d.ts.map +0 -1
  155. package/dist/commands/simulate/tracker.js +0 -96
  156. package/dist/commands/simulate/tracker.js.map +0 -1
  157. package/dist/commands/simulate/types.d.ts +0 -20
  158. package/dist/commands/simulate/types.d.ts.map +0 -1
  159. package/dist/commands/simulate/types.js +0 -2
  160. package/dist/commands/simulate/types.js.map +0 -1
  161. package/dist/config/build-defaults.d.ts +0 -49
  162. package/dist/config/build-defaults.d.ts.map +0 -1
  163. package/dist/config/build-defaults.js +0 -68
  164. package/dist/config/build-defaults.js.map +0 -1
  165. package/dist/config/index.d.ts +0 -13
  166. package/dist/config/index.d.ts.map +0 -1
  167. package/dist/config/index.js +0 -15
  168. package/dist/config/index.js.map +0 -1
  169. package/dist/config/loader.d.ts +0 -81
  170. package/dist/config/loader.d.ts.map +0 -1
  171. package/dist/config/loader.js +0 -153
  172. package/dist/config/loader.js.map +0 -1
  173. package/dist/config/utils.d.ts +0 -101
  174. package/dist/config/utils.d.ts.map +0 -1
  175. package/dist/config/utils.js +0 -235
  176. package/dist/config/utils.js.map +0 -1
  177. package/dist/config/validators.d.ts +0 -52
  178. package/dist/config/validators.d.ts.map +0 -1
  179. package/dist/config/validators.js +0 -85
  180. package/dist/config/validators.js.map +0 -1
  181. package/dist/core/asset-resolver.d.ts +0 -34
  182. package/dist/core/asset-resolver.d.ts.map +0 -1
  183. package/dist/core/asset-resolver.js +0 -70
  184. package/dist/core/asset-resolver.js.map +0 -1
  185. package/dist/core/build-cache.d.ts +0 -23
  186. package/dist/core/build-cache.d.ts.map +0 -1
  187. package/dist/core/build-cache.js +0 -44
  188. package/dist/core/build-cache.js.map +0 -1
  189. package/dist/core/cache-utils.d.ts +0 -27
  190. package/dist/core/cache-utils.d.ts.map +0 -1
  191. package/dist/core/cache-utils.js +0 -60
  192. package/dist/core/cache-utils.js.map +0 -1
  193. package/dist/core/index.d.ts +0 -8
  194. package/dist/core/index.d.ts.map +0 -1
  195. package/dist/core/index.js +0 -8
  196. package/dist/core/index.js.map +0 -1
  197. package/dist/core/local-packages.d.ts +0 -19
  198. package/dist/core/local-packages.d.ts.map +0 -1
  199. package/dist/core/local-packages.js +0 -60
  200. package/dist/core/local-packages.js.map +0 -1
  201. package/dist/core/logger.d.ts +0 -30
  202. package/dist/core/logger.d.ts.map +0 -1
  203. package/dist/core/logger.js +0 -85
  204. package/dist/core/logger.js.map +0 -1
  205. package/dist/core/output.d.ts +0 -30
  206. package/dist/core/output.d.ts.map +0 -1
  207. package/dist/core/output.js +0 -46
  208. package/dist/core/output.js.map +0 -1
  209. package/dist/core/timer.d.ts +0 -14
  210. package/dist/core/timer.d.ts.map +0 -1
  211. package/dist/core/timer.js +0 -29
  212. package/dist/core/timer.js.map +0 -1
  213. package/dist/core/tmp.d.ts +0 -27
  214. package/dist/core/tmp.d.ts.map +0 -1
  215. package/dist/core/tmp.js +0 -36
  216. package/dist/core/tmp.js.map +0 -1
  217. package/dist/core/utils.d.ts +0 -10
  218. package/dist/core/utils.d.ts.map +0 -1
  219. package/dist/core/utils.js +0 -12
  220. package/dist/core/utils.js.map +0 -1
  221. package/dist/index.d.ts.map +0 -1
  222. package/dist/runtime/index.d.ts +0 -10
  223. package/dist/runtime/index.d.ts.map +0 -1
  224. package/dist/runtime/index.js +0 -10
  225. package/dist/runtime/index.js.map +0 -1
  226. package/dist/runtime/main.d.ts.map +0 -1
  227. package/dist/runtime/runner.d.ts +0 -20
  228. package/dist/runtime/runner.d.ts.map +0 -1
  229. package/dist/runtime/runner.js +0 -72
  230. package/dist/runtime/runner.js.map +0 -1
  231. package/dist/runtime/serve.d.ts +0 -19
  232. package/dist/runtime/serve.d.ts.map +0 -1
  233. package/dist/runtime/serve.js +0 -97
  234. package/dist/runtime/serve.js.map +0 -1
  235. package/dist/schemas/index.d.ts +0 -9
  236. package/dist/schemas/index.d.ts.map +0 -1
  237. package/dist/schemas/index.js +0 -9
  238. package/dist/schemas/index.js.map +0 -1
  239. package/dist/schemas/primitives.d.ts +0 -37
  240. package/dist/schemas/primitives.d.ts.map +0 -1
  241. package/dist/schemas/primitives.js +0 -43
  242. package/dist/schemas/primitives.js.map +0 -1
  243. package/dist/schemas/run.d.ts +0 -23
  244. package/dist/schemas/run.d.ts.map +0 -1
  245. package/dist/schemas/run.js +0 -20
  246. package/dist/schemas/run.js.map +0 -1
  247. package/dist/types/bundle.d.ts +0 -141
  248. package/dist/types/bundle.d.ts.map +0 -1
  249. package/dist/types/bundle.js +0 -10
  250. package/dist/types/bundle.js.map +0 -1
  251. package/dist/types/global.d.ts +0 -38
  252. package/dist/types/global.d.ts.map +0 -1
  253. package/dist/types/global.js +0 -24
  254. package/dist/types/global.js.map +0 -1
  255. package/dist/types/index.d.ts +0 -8
  256. package/dist/types/index.d.ts.map +0 -1
  257. package/dist/types/index.js +0 -8
  258. package/dist/types/index.js.map +0 -1
  259. package/dist/version.d.ts +0 -3
  260. package/dist/version.d.ts.map +0 -1
  261. package/dist/version.js +0 -27
  262. package/dist/version.js.map +0 -1
  263. package/dist/walker.js +0 -1
@@ -1,154 +0,0 @@
1
- /**
2
- * Run Command
3
- *
4
- * Runs walkerOS flows using local runtime
5
- */
6
- import path from 'path';
7
- import { createCommandLogger, createTimer, getErrorMessage, } from '../../core/index.js';
8
- import { validateMode, validateFlowFile, validatePort } from './validators.js';
9
- import { prepareBundleForRun, isPreBuiltConfig } from './utils.js';
10
- import { executeRunLocal } from './execution.js';
11
- /**
12
- * CLI command function for `walkeros run`
13
- *
14
- * @param mode - Run mode (collect | serve)
15
- * @param options - Command options
16
- */
17
- export async function runCommand(mode, options) {
18
- const timer = createTimer();
19
- timer.start();
20
- const logger = createCommandLogger(options);
21
- try {
22
- // Step 1: Validate inputs
23
- validateMode(mode);
24
- const configPath = validateFlowFile(options.config);
25
- if (options.port !== undefined) {
26
- validatePort(options.port);
27
- }
28
- // Step 2: Determine if config is pre-built or needs bundling
29
- const isPreBuilt = isPreBuiltConfig(configPath);
30
- let flowPath = null;
31
- if (mode === 'collect') {
32
- if (isPreBuilt) {
33
- // Use pre-built bundle directly
34
- flowPath = path.resolve(configPath);
35
- logger.debug(`Using pre-built flow: ${path.basename(flowPath)}`);
36
- }
37
- else {
38
- // Bundle JSON config first
39
- logger.debug('Building flow bundle');
40
- flowPath = await prepareBundleForRun(configPath, {
41
- verbose: options.verbose,
42
- silent: options.json || options.silent,
43
- });
44
- logger.debug('Bundle ready');
45
- }
46
- }
47
- // Step 3: Execute locally
48
- // Handle dry-run
49
- if (options.dryRun) {
50
- logger.log(`[DRY-RUN] Would execute locally: run ${mode}`);
51
- return;
52
- }
53
- // Execute locally using runtime module
54
- const modeLabel = mode === 'collect' ? 'Collector' : 'Server';
55
- logger.log(`Starting ${modeLabel}...`);
56
- await executeRunLocal(mode, flowPath, {
57
- port: options.port,
58
- host: options.host,
59
- serveName: options.serveName,
60
- servePath: options.servePath,
61
- });
62
- // Note: Server runs forever, so we won't reach here unless it fails
63
- }
64
- catch (error) {
65
- const duration = timer.getElapsed() / 1000;
66
- const errorMessage = getErrorMessage(error);
67
- if (options.json) {
68
- logger.json({
69
- success: false,
70
- mode,
71
- error: errorMessage,
72
- duration,
73
- });
74
- }
75
- else {
76
- logger.error(`Error: ${errorMessage}`);
77
- }
78
- process.exit(1);
79
- }
80
- }
81
- /**
82
- * Programmatic run function
83
- *
84
- * @param mode - Run mode (collect | serve)
85
- * @param options - Run options
86
- * @returns Run result
87
- *
88
- * @example
89
- * ```typescript
90
- * // Run with JSON config (bundles automatically)
91
- * await run('collect', {
92
- * config: './flow.json',
93
- * port: 8080
94
- * });
95
- *
96
- * // Run with pre-built bundle
97
- * await run('collect', {
98
- * config: './flow.mjs',
99
- * port: 8080
100
- * });
101
- * ```
102
- */
103
- export async function run(mode, options) {
104
- const startTime = Date.now();
105
- try {
106
- // Validate inputs
107
- validateMode(mode);
108
- let flowFile;
109
- if (typeof options.config === 'string') {
110
- flowFile = validateFlowFile(options.config);
111
- }
112
- else {
113
- throw new Error('Programmatic run() requires config file path');
114
- }
115
- if (options.port !== undefined) {
116
- validatePort(options.port);
117
- }
118
- // Determine if config is pre-built or needs bundling
119
- const isPreBuilt = isPreBuiltConfig(flowFile);
120
- let flowPath;
121
- if (isPreBuilt) {
122
- flowPath = path.resolve(flowFile);
123
- }
124
- else {
125
- // Bundle JSON config
126
- flowPath = await prepareBundleForRun(flowFile, {
127
- verbose: options.verbose,
128
- silent: true,
129
- });
130
- }
131
- // Run the flow using local runtime
132
- await executeRunLocal(mode, flowPath, {
133
- port: options.port,
134
- host: options.host,
135
- serveName: options.serveName,
136
- servePath: options.servePath,
137
- });
138
- // Success (though server runs forever, so we typically don't reach here)
139
- return {
140
- success: true,
141
- exitCode: 0,
142
- duration: Date.now() - startTime,
143
- };
144
- }
145
- catch (error) {
146
- return {
147
- success: false,
148
- exitCode: 1,
149
- duration: Date.now() - startTime,
150
- error: getErrorMessage(error),
151
- };
152
- }
153
- }
154
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/run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AE,OAAO,CAAC,SAAS;SAC7B,CAAC,CAAC;QAEH,yEAAyE;QACzE,OAAO;YACL,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,CAAC;YACX,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;SACjC,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,CAAC;YACX,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;YAChC,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC;SAC9B,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,65 +0,0 @@
1
- /**
2
- * Run Command Types
3
- *
4
- * Types for running walkerOS flows via CLI using local runtime
5
- */
6
- /**
7
- * Run mode - determines which execution mode to use
8
- */
9
- export type RunMode = 'collect' | 'serve';
10
- /**
11
- * CLI command options for `walkeros run`
12
- */
13
- export interface RunCommandOptions {
14
- /** Flow configuration file path (.json or pre-built .mjs) */
15
- config: string;
16
- /** Server port (overrides flow config) */
17
- port?: number;
18
- /** Server host (default: 0.0.0.0) */
19
- host?: string;
20
- /** Serve path (URL directory path, e.g., 'libs/v1') */
21
- servePath?: string;
22
- /** Serve name (filename in URL, default: walker.js) */
23
- serveName?: string;
24
- /** Enable JSON output */
25
- json?: boolean;
26
- /** Verbose logging */
27
- verbose?: boolean;
28
- /** Dry-run mode */
29
- dryRun?: boolean;
30
- /** Suppress output */
31
- silent?: boolean;
32
- }
33
- /**
34
- * Programmatic run options (subset of CLI options)
35
- */
36
- export interface RunOptions {
37
- /** Flow configuration file path (.json or pre-built .mjs) */
38
- config: string | unknown;
39
- /** Server port */
40
- port?: number;
41
- /** Server host */
42
- host?: string;
43
- /** Serve path (URL directory path, e.g., 'libs/v1') */
44
- servePath?: string;
45
- /** Serve name (filename in URL, default: walker.js) */
46
- serveName?: string;
47
- /** Suppress output */
48
- silent?: boolean;
49
- /** Verbose logging */
50
- verbose?: boolean;
51
- }
52
- /**
53
- * Result from running a flow
54
- */
55
- export interface RunResult {
56
- /** Whether the flow ran successfully */
57
- success: boolean;
58
- /** Exit code */
59
- exitCode: number;
60
- /** Error message if failed */
61
- error?: string;
62
- /** Execution duration in milliseconds */
63
- duration: number;
64
- }
65
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/commands/run/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IAEf,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,yBAAyB;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,sBAAsB;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,mBAAmB;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,sBAAsB;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,6DAA6D;IAC7D,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IAEzB,kBAAkB;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,kBAAkB;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,sBAAsB;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,sBAAsB;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,wCAAwC;IACxC,OAAO,EAAE,OAAO,CAAC;IAEjB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAC;IAEjB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;CAClB"}
@@ -1,7 +0,0 @@
1
- /**
2
- * Run Command Types
3
- *
4
- * Types for running walkerOS flows via CLI using local runtime
5
- */
6
- export {};
7
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/commands/run/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -1,29 +0,0 @@
1
- /**
2
- * Run Command Utilities
3
- *
4
- * Shared utilities for the run command
5
- */
6
- /**
7
- * Prepares a JSON config file for execution by bundling it to a temporary location.
8
- *
9
- * Creates bundle in .tmp/ directory relative to config file (not /tmp)
10
- * so Node.js module resolution finds node_modules.
11
- *
12
- * @param configPath - Path to the JSON configuration file
13
- * @param options - Bundle options
14
- * @param options.verbose - Enable verbose logging
15
- * @param options.silent - Suppress output
16
- * @returns Path to the bundled output file
17
- */
18
- export declare function prepareBundleForRun(configPath: string, options: {
19
- verbose?: boolean;
20
- silent?: boolean;
21
- }): Promise<string>;
22
- /**
23
- * Checks if a config file is pre-built or needs bundling
24
- *
25
- * @param configPath - Path to configuration file
26
- * @returns True if file is pre-built (js/mjs/cjs), false if needs bundling (json)
27
- */
28
- export declare function isPreBuiltConfig(configPath: string): boolean;
29
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/commands/run/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE;IACP,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GACA,OAAO,CAAC,MAAM,CAAC,CA0BjB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAM5D"}
@@ -1,52 +0,0 @@
1
- /**
2
- * Run Command Utilities
3
- *
4
- * Shared utilities for the run command
5
- */
6
- import path from 'path';
7
- import fs from 'fs-extra';
8
- import { bundle } from '../bundle/index.js';
9
- /**
10
- * Prepares a JSON config file for execution by bundling it to a temporary location.
11
- *
12
- * Creates bundle in .tmp/ directory relative to config file (not /tmp)
13
- * so Node.js module resolution finds node_modules.
14
- *
15
- * @param configPath - Path to the JSON configuration file
16
- * @param options - Bundle options
17
- * @param options.verbose - Enable verbose logging
18
- * @param options.silent - Suppress output
19
- * @returns Path to the bundled output file
20
- */
21
- export async function prepareBundleForRun(configPath, options) {
22
- // Create temp directory relative to config (ensures node_modules is findable)
23
- const configDir = path.dirname(path.resolve(configPath));
24
- const tempDir = path.join(configDir, '.tmp', `run-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`);
25
- await fs.ensureDir(tempDir);
26
- // Generate output path in temp directory
27
- const tempPath = path.join(tempDir, 'bundle.mjs');
28
- // Bundle with proper output override
29
- await bundle(configPath, {
30
- cache: true,
31
- verbose: options.verbose,
32
- silent: options.silent,
33
- buildOverrides: {
34
- output: tempPath,
35
- format: 'esm',
36
- platform: 'node',
37
- },
38
- });
39
- return tempPath;
40
- }
41
- /**
42
- * Checks if a config file is pre-built or needs bundling
43
- *
44
- * @param configPath - Path to configuration file
45
- * @returns True if file is pre-built (js/mjs/cjs), false if needs bundling (json)
46
- */
47
- export function isPreBuiltConfig(configPath) {
48
- return (configPath.endsWith('.mjs') ||
49
- configPath.endsWith('.js') ||
50
- configPath.endsWith('.cjs'));
51
- }
52
- //# sourceMappingURL=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Q,CAAC,KAAK,CAAC;QAC1B,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAC5B,CAAC;AACJ,CAAC"}
@@ -1,33 +0,0 @@
1
- /**
2
- * Run Command Validators
3
- *
4
- * Validation logic for run command inputs.
5
- * Uses Zod schemas for type-safe validation.
6
- */
7
- import { type RunMode } from '../../schemas/index.js';
8
- /**
9
- * Validates run mode using Zod schema.
10
- *
11
- * @param mode - Mode to validate
12
- * @throws Error if mode is invalid
13
- */
14
- export declare function validateMode(mode: string): asserts mode is RunMode;
15
- /**
16
- * Validates flow file exists.
17
- *
18
- * @remarks
19
- * File existence cannot be validated by Zod, so this remains a custom check.
20
- *
21
- * @param filePath - Path to flow configuration file (bare name, relative, or absolute)
22
- * @returns Absolute path to flow file
23
- * @throws Error if file doesn't exist
24
- */
25
- export declare function validateFlowFile(filePath: string): string;
26
- /**
27
- * Validates port number using Zod schema.
28
- *
29
- * @param port - Port number to validate
30
- * @throws Error if port is invalid
31
- */
32
- export declare function validatePort(port: number): void;
33
- //# sourceMappingURL=validators.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../src/commands/run/validators.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,wBAAwB,CAAC;AAEhC;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CASlE;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAazD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAS/C"}
@@ -1,58 +0,0 @@
1
- /**
2
- * Run Command Validators
3
- *
4
- * Validation logic for run command inputs.
5
- * Uses Zod schemas for type-safe validation.
6
- */
7
- import { existsSync } from 'fs';
8
- import { resolveAsset } from '../../core/asset-resolver.js';
9
- import { RunModeSchema, PortSchema, } from '../../schemas/index.js';
10
- /**
11
- * Validates run mode using Zod schema.
12
- *
13
- * @param mode - Mode to validate
14
- * @throws Error if mode is invalid
15
- */
16
- export function validateMode(mode) {
17
- const result = RunModeSchema.safeParse(mode);
18
- if (!result.success) {
19
- throw new Error(`Invalid mode: "${mode}"\n` +
20
- ` Valid modes: collect, serve\n` +
21
- ` Example: walkeros run collect ./flow.json`);
22
- }
23
- }
24
- /**
25
- * Validates flow file exists.
26
- *
27
- * @remarks
28
- * File existence cannot be validated by Zod, so this remains a custom check.
29
- *
30
- * @param filePath - Path to flow configuration file (bare name, relative, or absolute)
31
- * @returns Absolute path to flow file
32
- * @throws Error if file doesn't exist
33
- */
34
- export function validateFlowFile(filePath) {
35
- // Use asset resolver to handle bare names, relative paths, and absolute paths
36
- const absolutePath = resolveAsset(filePath, 'bundle');
37
- if (!existsSync(absolutePath)) {
38
- throw new Error(`Flow file not found: ${filePath}\n` +
39
- ` Resolved path: ${absolutePath}\n` +
40
- ` Make sure the file exists and the path is correct`);
41
- }
42
- return absolutePath;
43
- }
44
- /**
45
- * Validates port number using Zod schema.
46
- *
47
- * @param port - Port number to validate
48
- * @throws Error if port is invalid
49
- */
50
- export function validatePort(port) {
51
- const result = PortSchema.safeParse(port);
52
- if (!result.success) {
53
- throw new Error(`Invalid port: ${port}\n` +
54
- ` Port must be an integer between 1 and 65535\n` +
55
- ` Example: --port 8080`);
56
- }
57
- }
58
- //# sourceMappingURL=validators.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../src/commands/run/validators.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EACL,aAAa,EACb,UAAU,GAEX,MAAM,wBAAwB,CAAC;AAEhC;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,kBAAkB,IAAI,KAAK;YACzB,kCAAkC;YAClC,8CAA8C,CACjD,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,8EAA8E;IAC9E,MAAM,YAAY,GAAG,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAEtD,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CACb,wBAAwB,QAAQ,IAAI;YAClC,qBAAqB,YAAY,IAAI;YACrC,sDAAsD,CACzD,CAAC;IACJ,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,iBAAiB,IAAI,IAAI;YACvB,kDAAkD;YAClD,yBAAyB,CAC5B,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,19 +0,0 @@
1
- interface DestinationEnv {
2
- init?: Record<string, unknown>;
3
- push: Record<string, unknown>;
4
- simulation?: string[];
5
- }
6
- /**
7
- * Dynamically loads env examples from destination packages.
8
- *
9
- * Imports from `/dev` subpath (e.g., '@walkeros/web-destination-gtag/dev')
10
- * and extracts the `env` object which contains:
11
- * - push: Mock environment with API functions (gtag, fbq, etc.)
12
- * - simulation: Array of tracking paths for call verification
13
- *
14
- * @param destinations - Destination configuration from flow config
15
- * @returns Map of destination key to env object
16
- */
17
- export declare function loadDestinationEnvs(destinations: Record<string, unknown>): Promise<Record<string, DestinationEnv>>;
18
- export {};
19
- //# sourceMappingURL=env-loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"env-loader.d.ts","sourceRoot":"","sources":["../../../src/commands/simulate/env-loader.ts"],"names":[],"mappings":"AAAA,UAAU,cAAc;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAOD;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACvC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACpC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAqCzC"}
@@ -1,44 +0,0 @@
1
- /**
2
- * Dynamically loads env examples from destination packages.
3
- *
4
- * Imports from `/dev` subpath (e.g., '@walkeros/web-destination-gtag/dev')
5
- * and extracts the `env` object which contains:
6
- * - push: Mock environment with API functions (gtag, fbq, etc.)
7
- * - simulation: Array of tracking paths for call verification
8
- *
9
- * @param destinations - Destination configuration from flow config
10
- * @returns Map of destination key to env object
11
- */
12
- export async function loadDestinationEnvs(destinations) {
13
- const envs = {};
14
- for (const [destKey, destConfig] of Object.entries(destinations)) {
15
- const typedConfig = destConfig;
16
- // Skip if no package field
17
- if (!typedConfig.package) {
18
- continue;
19
- }
20
- try {
21
- // Determine import path
22
- const packageName = typedConfig.package;
23
- const isDemoPackage = packageName.includes('-demo');
24
- const importPath = isDemoPackage ? packageName : `${packageName}/dev`;
25
- // Dynamic import
26
- const module = await import(importPath);
27
- // Extract env from examples
28
- const examplesModule = module.examples || module.default?.examples;
29
- const envModule = examplesModule?.env;
30
- if (envModule?.push) {
31
- envs[destKey] = {
32
- init: envModule.init,
33
- push: envModule.push,
34
- simulation: envModule.simulation || [],
35
- };
36
- }
37
- }
38
- catch {
39
- // Silently skip destinations without env or invalid packages
40
- }
41
- }
42
- return envs;
43
- }
44
- //# sourceMappingURL=env-loader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"env-loader.js","sourceRoot":"","sources":["../../../src/commands/simulate/env-loader.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,YAAqC;IAErC,MAAM,IAAI,GAAmC,EAAE,CAAC;IAEhD,KAAK,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QACjE,MAAM,WAAW,GAAG,UAA+B,CAAC;QAEpD,2BAA2B;QAC3B,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;YACzB,SAAS;QACX,CAAC;QAED,IAAI,CAAC;YACH,wBAAwB;YACxB,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC;YACxC,MAAM,aAAa,GAAG,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACpD,MAAM,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,MAAM,CAAC;YAEtE,iBAAiB;YACjB,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;YAExC,4BAA4B;YAC5B,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;YACnE,MAAM,SAAS,GAAG,cAAc,EAAE,GAAG,CAAC;YAEtC,IAAI,SAAS,EAAE,IAAI,EAAE,CAAC;gBACpB,IAAI,CAAC,OAAO,CAAC,GAAG;oBACd,IAAI,EAAE,SAAS,CAAC,IAAI;oBACpB,IAAI,EAAE,SAAS,CAAC,IAAI;oBACpB,UAAU,EAAE,SAAS,CAAC,UAAU,IAAI,EAAE;iBACvC,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,6DAA6D;QAC/D,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,48 +0,0 @@
1
- import type { SimulateCommandOptions } from './types.js';
2
- /**
3
- * CLI command handler for simulate command
4
- */
5
- export declare function simulateCommand(options: SimulateCommandOptions): Promise<void>;
6
- /**
7
- * High-level simulate function for programmatic usage.
8
- *
9
- * Handles configuration loading internally and returns structured results.
10
- *
11
- * @param configOrPath - Bundle configuration object or path to config file
12
- * @param event - Event object to simulate
13
- * @param options - Simulation options
14
- * @param options.silent - Suppress all output (default: false)
15
- * @param options.verbose - Enable verbose logging (default: false)
16
- * @param options.json - Format output as JSON (default: false)
17
- * @returns Simulation result with success status, elb result, and usage data
18
- *
19
- * @example
20
- * ```typescript
21
- * // With config file
22
- * const result = await simulate('./walker.config.json', {
23
- * name: 'page view',
24
- * data: { title: 'Home Page', path: '/', url: 'https://example.com' }
25
- * });
26
- *
27
- * // With config object
28
- * const result = await simulate(
29
- * {
30
- * platform: 'web',
31
- * packages: { '@walkeros/collector': { imports: ['startFlow'] } },
32
- * code: '...',
33
- * output: './bundle.js'
34
- * },
35
- * { name: 'page view' },
36
- * { silent: true }
37
- * );
38
- * ```
39
- */
40
- export declare function simulate(configOrPath: string | unknown, event: unknown, options?: {
41
- silent?: boolean;
42
- verbose?: boolean;
43
- json?: boolean;
44
- }): Promise<import('./types').SimulationResult>;
45
- export * from './types.js';
46
- export * from './simulator.js';
47
- export { executeInNode } from './node-executor.js';
48
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/simulate/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD;;GAEG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC,CA6Df;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,QAAQ,CAC5B,YAAY,EAAE,MAAM,GAAG,OAAO,EAC9B,KAAK,EAAE,OAAO,EACd,OAAO,GAAE;IACP,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;CACX,GACL,OAAO,CAAC,OAAO,SAAS,EAAE,gBAAgB,CAAC,CAgB7C;AAGD,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}