@walkeros/cli 4.0.0-next-1773967844643 → 4.0.0-next-1777463920154

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,424 @@
1
1
  # @walkeros/cli
2
2
 
3
- ## 4.0.0-next-1773967844643
3
+ ## 4.0.0-next-1777463920154
4
+
5
+ ### Major Changes
6
+
7
+ - 0ffb1d3: Remove dead `bundleRemote()` and add OpenAPI drift detection.
8
+
9
+ Breaking changes:
10
+ - Removed `bundleRemote()` export from `@walkeros/cli`. The corresponding
11
+ `/api/bundle` endpoint was removed from the walkerOS app on 2026-04-08, so
12
+ this function had been silently broken in production for ~3 weeks. Local
13
+ bundling via `bundle()` is unaffected.
14
+ - Removed `remote` and `content` options from the MCP `flow_bundle` tool. The
15
+ tool now bundles locally only.
16
+
17
+ New:
18
+ - Added `npm run -w @walkeros/cli validate:openapi-spec` script that diffs the
19
+ checked-in `packages/cli/openapi/spec.json` against the live app's OpenAPI
20
+ document. Detects drift between the walkerOS-side type contract and the
21
+ actual API. Wired into PR-time CI, daily cron, and a pre-commit lint-staged
22
+ hook. All layers are gated on a `WALKEROS_APP_URL` secret and skip silently
23
+ when unset, so the change ships safely without configuration. To activate:
24
+ set `WALKEROS_APP_URL` in repo secrets pointing to a deployed app instance.
25
+
26
+ - 93ea9c4: Event model v4: breaking changes to the `Event`, `Source`, and
27
+ `Entity` shapes.
28
+ - `event.id` is now a W3C span_id (16 lowercase hex chars), generated by the
29
+ collector. Reference: W3C Trace Context (W3C Recommendation, January 2020).
30
+ - `event.version`, `event.group`, `event.count` are removed.
31
+ - `source.type` is now the source kind (e.g. `browser`, `gtag`, `mcp`, `cli`).
32
+ New `source.platform` holds the runtime (`web` | `server` | `app` | ...).
33
+ - `source.id` and `source.previous_id` are removed.
34
+ - Browser source now sets `source.url` and `source.referrer`.
35
+ - MCP source sets `source.tool` per emission. CLI source sets
36
+ `source.command`.
37
+ - `Entity.nested` and `Entity.context` are now optional. Root `event.nested`
38
+ and `event.context` remain required.
39
+ - Each source self-registers via TypeScript module augmentation of `SourceMap`
40
+ in `@walkeros/core`.
41
+ - App-side coordination (`/workspaces/developer/app`) is a follow-up plan, not
42
+ part of this release. Telemetry from v4 CLI/MCP will not validate against
43
+ the existing app schema until that follow-up ships.
44
+ - `Mapping.Rule.skip` is renamed to `Mapping.Rule.silent`. Customer flow.json
45
+ configs using `skip: true` in mapping rules must rename to `silent: true`.
46
+ Hard cut: no legacy alias, the field is gone.
47
+
48
+ - 942a7fe: Flow v4: type redesign and cross-flow references.
49
+
50
+ Breaking changes:
51
+ - Renamed `Flow.Settings` (single-flow shape) to `Flow`. The new
52
+ `Flow.Settings` is the arbitrary kv-bag inside `Flow.Config` (matches
53
+ `Destination.Settings` semantics).
54
+ - Renamed `Flow.Config` (root file shape) to `Flow.Json`.
55
+ - Removed `Flow.Web` and `Flow.Server`. Replaced by
56
+ `config.platform: 'web' | 'server'` (a string discriminator).
57
+ - Renamed `Flow.InlineCode` to `Flow.Code`.
58
+ - Renamed `Flow.SourceReference` / `DestinationReference` /
59
+ `TransformerReference` / `StoreReference` to `Flow.Source` / `Destination` /
60
+ `Transformer` / `Store` (Reference suffix dropped).
61
+ - Renamed `Flow.ContractEntry` to `Flow.ContractRule`.
62
+ - Lifted `bundle` and platform fields into the per-flow `config` block.
63
+ - `flow.json` `version` bumped from 3 to 4. v3 input is rejected (no compat
64
+ shim).
65
+
66
+ New:
67
+ - `$flow.X.Y` reference resolves to `flows.X.config.Y` in the same file.
68
+ Useful for linking a web flow's API destination to a server flow's deployed
69
+ URL without duplicating values.
70
+ - Per-flow `Flow.Config` block: `{ platform, url, settings, bundle }`.
71
+ - `walkeros validate` warns on unresolved `$flow.X.Y` (use `--strict` to
72
+ error). `walkeros bundle` and `walkeros deploy` always error on unresolved
73
+ refs.
74
+ - See `docs/migrating/v3-to-v4.mdx` on the website for the manual migration
75
+ steps. No automated codemod is shipped.
76
+
77
+ ### Minor Changes
78
+
79
+ - cfc7469: **Breaking — `@walkeros/core`:** `fetchPackage(name, { baseUrl })`
80
+ now expects the host app to expose the v2 `/api/packages/[name]` endpoint that
81
+ returns the merged `WalkerOSPackage` shape directly (single round-trip,
82
+ `?expand=all`). The previous two-fetch pattern (`?path=package.json` +
83
+ `?path=dist/walkerOS.json`) is removed. Hosts must serve the v2 shape; the
84
+ offline jsdelivr fallback is unchanged.
85
+
86
+ **Feature — CLI/MCP/explorer:** Outbound walkerOS-aware HTTP clients now
87
+ identify themselves to the configured app origin via
88
+ `X-Walkeros-Client: walkeros-{cli|mcp}/{version}`. `@walkeros/explorer`
89
+ exports `setPackageTypesBaseUrl(url?)` so host apps can proxy `.d.ts` through
90
+ their own origin (used by the walkerOS Tag Manager app to drop the jsdelivr
91
+ CDN allowance entirely).
92
+
93
+ - 8e06b1f: **BREAKING:** Unified reference syntax: `$store:id` and
94
+ `$secret:NAME` now use the dot separator: `$store.id` and `$secret.NAME`.
95
+
96
+ The coherent rule across every walkerOS reference is:
97
+ - **`.`** key or path (resolver looks up or walks what follows)
98
+ - **`:`** literal value or raw-code payload (resolver uses what follows
99
+ verbatim)
100
+
101
+ `$var.`, `$def.`, `$env.NAME[:default]`, `$contract.`, and `$code:(…)` are
102
+ unchanged, they already fit the rule.
103
+
104
+ Every shipped example, published `walkerOS.json` metadata, doc page, and skill
105
+ has been updated. A new canonical reference-syntax guide lives at
106
+ `/docs/guides/reference-syntax`. Regex constants (`REF_VAR`, `REF_DEF`,
107
+ `REF_ENV`, `REF_CONTRACT`, `REF_STORE`, `REF_SECRET`, `REF_CODE_PREFIX`) are
108
+ exported from `@walkeros/core` import these instead of hand-rolling regexes.
109
+
110
+ ### Upgrade
111
+
112
+ Search-and-replace across your flow configs:
113
+
114
+ ```
115
+ $store:<id> → $store.<id>
116
+ $secret:<NAME> → $secret.<NAME>
117
+ ```
118
+
119
+ Everything else stays the same. Your `$var.*`, `$def.*`, `$env.*`,
120
+ `$contract.*`, and `$code:*` references need no changes.
121
+
122
+ ### Patch Changes
123
+
124
+ - 6422b9b: Validate device-code and token responses from the auth server with
125
+ Zod schemas at the trust boundary in `login/index.ts`. Malformed responses now
126
+ surface as structured errors instead of being trusted into config writes or
127
+ browser launches. Replaces the hand-rolled type guards for Items 1 and 3 of
128
+ the cli-auth feedback review. No public API change.
129
+ - 78b651a: Explicit opt-in anonymous usage telemetry for CLI and MCP. Telemetry
130
+ is off by default; users opt in with `walkeros telemetry enable` and out with
131
+ `walkeros telemetry disable`. No persistent identifier is written before
132
+ opt-in. No ingest endpoint ships in this release: opting in records consent
133
+ locally; emission begins when a managed endpoint is released. The data
134
+ contract lives at `packages/cli/src/telemetry/flow.json`.
135
+ - 6422b9b: Add `flowId` filter to CLI `listDeployments` and redesign the MCP
136
+ `deploy_manage` tool around it.
137
+
138
+ **CLI (`@walkeros/cli`):**
139
+ - `listDeployments({ projectId?, type?, status?, flowId? })` now forwards
140
+ `flowId` as a query parameter to `GET /api/projects/{id}/deployments`.
141
+ - New helper `deleteDeploymentByFlowId({ projectId?, flowId, slug? })` deletes
142
+ the active deployment for a flow, surfacing a `DeploymentAmbiguityError`
143
+ (code `MULTIPLE_DEPLOYMENTS`, with a `details[]` list) when a flow has more
144
+ than one active deployment and no slug was supplied.
145
+
146
+ **MCP (`@walkeros/mcp`) breaking:**
147
+ - `deploy_manage`'s `get`, `delete`, and `list` actions now take
148
+ `{ projectId?, flowId, slug? }`. The old `id` parameter has been removed.
149
+ `flowId` is required for `get`/`delete` and optional for `list`.
150
+ Soft-deleted deployments are always excluded.
151
+ - When a flow has multiple active deployments and `slug` is not provided,
152
+ `get`/`delete` return a `MULTIPLE_DEPLOYMENTS` error with a `details[]` list
153
+ of `{ slug, type, status, updatedAt }` entries so the caller can pick one.
154
+ `deploy` action is unchanged.
155
+
156
+ - Updated dependencies [93ea9c4]
157
+ - Updated dependencies [942a7fe]
158
+ - Updated dependencies [cfc7469]
159
+ - Updated dependencies [8e06b1f]
160
+ - Updated dependencies [3d50dd6]
161
+ - @walkeros/core@4.0.0-next-1777463920154
162
+ - @walkeros/collector@4.0.0-next-1777463920154
163
+ - @walkeros/server-destination-api@4.0.0-next-1777463920154
164
+ - @walkeros/server-core@4.0.0-next-1777463920154
165
+
166
+ ## 3.4.2
167
+
168
+ ### Patch Changes
169
+
170
+ - 2d25eda: Replace `api` mega-tool with four focused management tools: `auth`
171
+ (device code login), `project_manage`, `flow_manage`, and `deploy_manage`.
172
+ Enforce strict CLI/MCP separation of concern — MCP no longer reads config
173
+ files or checks env vars directly. All tools are always registered regardless
174
+ of auth state.
175
+
176
+ CLI exports new functions: `requestDeviceCode`, `pollForToken`,
177
+ `setDefaultProject`, `getDefaultProject`, `listAllFlows`,
178
+ `setFeedbackPreference`, `getFeedbackPreference`, `resolveToken`,
179
+ `deleteConfig`.
180
+
181
+ Preview CRUD (`preview_list`, `preview_get`, `preview_create`,
182
+ `preview_delete`) is now part of `flow_manage` — previews are a flow-scoped
183
+ concern and belong alongside the flow lifecycle actions rather than in a
184
+ separate tool.
185
+
186
+ - cb4c069: Runtime fetchers (`fetchConfig`, `fetchSecrets`) now classify 401/403
187
+ responses from the app as a typed `RunnerAuthError` with a structured `reason`
188
+ (`'unauthorised' | 'flow' | 'scope' | 'forbidden'`) and the app's error `code`
189
+ (`FORBIDDEN_FLOW` / `FORBIDDEN_SCOPE`). Callers can log a specific reason
190
+ instead of a generic "token may have expired" message, and exit cleanly rather
191
+ than retry on scope/flow mismatches.
192
+ - @walkeros/core@3.4.2
193
+ - @walkeros/server-core@3.4.2
194
+
195
+ ## 3.4.1
196
+
197
+ ### Patch Changes
198
+
199
+ - caea905: Add `walkeros previews {list|get|create|delete}` commands for
200
+ managing preview bundles. `create` supports `--flow <name>` or
201
+ `--settings-id <id>` to target a flow settings entry, and `--url <siteUrl>` to
202
+ produce a ready-to-open activation URL. Use `--open` to launch it in your
203
+ default browser.
204
+ - caea905: Preview preflight now self-heals when a preview bundle is deleted.
205
+ Instead of injecting the preview script directly and letting it 404, the
206
+ preflight does a `fetch(HEAD)` first. If the bundle is missing, it clears the
207
+ `elbPreview` cookie and loads the production walker, so visitors never see
208
+ silent analytics breakage.
209
+ - Updated dependencies [12adf24]
210
+ - Updated dependencies [75aa26b]
211
+ - @walkeros/core@3.4.1
212
+ - @walkeros/server-core@3.4.1
213
+
214
+ ## 3.4.0
215
+
216
+ ### Minor Changes
217
+
218
+ - 1a0f8f2: Add `target` option to `bundle()`:
219
+ `cdn | cdn-skeleton | runner | simulate | push`. Replaces
220
+ `buildOverrides.skipWrapper` (deprecated) to stop dev schemas leaking into
221
+ production CDN bundles. Stage 2 entry generators gain `platform` option and
222
+ inject `env.window`/`env.document` for browser targets, fixing
223
+ `window.elbLayer` in deployed walker.js.
224
+ - 9f97bdd: Clients now send `User-Agent`, `X-WalkerOS-Client`, and
225
+ `X-WalkerOS-Client-Version` on every request to the walkerOS app. When the app
226
+ returns `426 Upgrade Required`, the CLI prints the required version + upgrade
227
+ instruction and exits with code 2; the MCP surfaces the same info in tool
228
+ errors. Set `WALKEROS_CLIENT_TYPE=runner` to have the CLI binary identify as a
229
+ long-lived runner instead of an interactive CLI (used by the runtime image so
230
+ runners are distinguishable from interactive sessions).
231
+
232
+ ### Patch Changes
233
+
234
+ - Updated dependencies [74940cc]
235
+ - Updated dependencies [525f5d9]
236
+ - @walkeros/core@3.4.0
237
+ - @walkeros/server-core@3.4.0
238
+
239
+ ## 3.3.1
240
+
241
+ ### Patch Changes
242
+
243
+ - 62f6a38: Force collector.run=true during push and simulate so flows with
244
+ run:false work in CLI
245
+ - @walkeros/server-core@3.3.1
246
+ - @walkeros/core@3.3.1
247
+
248
+ ## 3.3.0
249
+
250
+ ### Minor Changes
251
+
252
+ - 2849acb: **BREAKING CHANGE:** The `packages` block has moved from
253
+ `flow.<name>.packages` to `flow.<name>.bundle.packages`. Flow files using the
254
+ old shape fail fast with a migration error pointing to the new location.
255
+
256
+ Also adds `flow.<name>.bundle.overrides` — a `Record<string, string>` for
257
+ pinning transitive dependency versions, matching npm's `overrides` semantics.
258
+ Use this to resolve version conflicts when a transitive dependency's declared
259
+ range conflicts with another required version in the same tree (the original
260
+ motivating case: `@amplitude/engagement-browser` pins
261
+ `@amplitude/analytics-types@^1.0.0` while `@amplitude/analytics-browser`
262
+ transitively requires `analytics-types@2.11.1` exact — previously an
263
+ unresolvable bundler conflict).
264
+
265
+ **Migration:** move the existing `packages` block one level deeper into a new
266
+ `bundle` wrapper.
267
+
268
+ ```diff
269
+ {
270
+ "version": 3,
271
+ "flows": {
272
+ "default": {
273
+ "web": {},
274
+ - "packages": {
275
+ - "@walkeros/collector": {}
276
+ - },
277
+ + "bundle": {
278
+ + "packages": {
279
+ + "@walkeros/collector": {}
280
+ + }
281
+ + },
282
+ "sources": { },
283
+ "destinations": { }
284
+ }
285
+ }
286
+ }
287
+ ```
288
+
289
+ **Overrides example:**
290
+
291
+ ```json
292
+ {
293
+ "flows": {
294
+ "default": {
295
+ "web": {},
296
+ "bundle": {
297
+ "packages": {
298
+ "@walkeros/web-destination-amplitude": {}
299
+ },
300
+ "overrides": {
301
+ "@amplitude/analytics-types": "2.11.1"
302
+ }
303
+ }
304
+ }
305
+ }
306
+ }
307
+ ```
308
+
309
+ Overrides only substitute **transitive** dependencies during resolution —
310
+ direct package specs declared in `bundle.packages` always win. Overrides
311
+ targeting a direct local-path package emit a warning and are ignored. Peer
312
+ constraint mismatches against the chosen override emit a warning but do not
313
+ error (the override is an explicit user directive).
314
+
315
+ - 08c365a: Add preview mode preflight to web bundles
316
+ - `WrapSkeletonOptions` accepts optional `previewOrigin` and `previewScope`
317
+ fields
318
+ - `generateWrapEntry` injects a preflight snippet before `startFlow` when both
319
+ are set: checks `?elbPreview` param / cookie, loads preview bundle from
320
+ `{previewOrigin}/preview/{previewScope}/walker.{token}.js`, skips production
321
+ flow. Zero overhead when preview options are absent.
322
+ - Input validation rejects path-traversal in `previewScope` and special
323
+ characters in `previewOrigin`.
324
+
325
+ - 08c365a: Bundle /dev exports into stage 1 skeleton for environment-agnostic
326
+ simulation
327
+ - `/dev` exports from packages are included in the skipWrapper bundle as
328
+ `__devExports`
329
+ - Stage 2 production bundles tree-shake dev exports (no size impact)
330
+ - `prepareFlow()` accepts `Flow.Config` object or pre-built `bundlePath`
331
+ - Simulate functions read env/createTrigger from bundle instead of filesystem
332
+
333
+ ### Patch Changes
334
+
335
+ - ae02457: Fix bare filename resolution in bundle command —
336
+ `walkeros bundle flow.json` now resolves relative to cwd instead of CLI
337
+ examples directory. Add TTY hint when writing to stdout
338
+ - Updated dependencies [2849acb]
339
+ - Updated dependencies [08c365a]
340
+ - Updated dependencies [08c365a]
341
+ - Updated dependencies [08c365a]
342
+ - Updated dependencies [08c365a]
343
+ - @walkeros/core@3.3.0
344
+ - @walkeros/server-core@3.3.0
345
+
346
+ ## 3.2.0
347
+
348
+ ### Minor Changes
349
+
350
+ - eb865e1: Add chainPath to ingest metadata and support path-specific mocks via
351
+ --mock destination.ga4.before.redact='...'
352
+ - f007c9f: Wire initConfig.hooks into collector instance. Simulation uses
353
+ prePush/postDestinationPush hooks for event capture. Hooks are wired by
354
+ startFlow before events fire.
355
+ - da0b640: Add include/exclude destination filter to collector.push PushOptions.
356
+ Sources can now control which destinations receive their events. Destination
357
+ simulation uses the full collector pipeline with include filter, giving
358
+ production-identical event enrichment, consent, and mapping.
359
+ - a0b019f: Add --snapshot flag to push command for setting up global state
360
+ before bundle execution
361
+ - 431be04: Refactor bundler to two-step compilation: ESM code compilation +
362
+ platform wrapper. Config changes no longer require full rebuilds. Production
363
+ bundles carry zero dev/simulate code.
364
+ - 884527d: Unify simulation for sources, destinations, and transformers through
365
+ the push command.
366
+ - All step types simulate via `push` with auto-env loading and call tracking
367
+ - Add `--simulate transformer.X` to invoke a transformer directly with an
368
+ event
369
+ - Before chains run as mandatory preparation; next chains are skipped
370
+ - Source simulation captures at the collector.push boundary, preserving the
371
+ full before chain
372
+ - Hooks (prePush/postDestinationPush) capture events instead of manual
373
+ overrides
374
+ - Timer interception flushes setTimeout/setInterval deterministically for
375
+ async patterns (debounced batches, detached Promise chains)
376
+ - MCP migrated to the push-based simulation pipeline
377
+ - Legacy simulate code removed
378
+
379
+ ### Patch Changes
380
+
381
+ - f55fc1d: Unify duplicated CLI patterns for reliability and consistency
382
+ - Add unified event validator with graduated levels (strict/standard/minimal)
383
+ - Fix package resolution in simulate to respect packages.path from flow config
384
+ - Extract shared readStdinToTempFile utility, remove copy-paste dynamic
385
+ imports
386
+ - Standardize duration output to milliseconds (matching MCP schema contract)
387
+ - Fix temp file cleanup in run command (hot-swap accumulation, shutdown
388
+ handler)
389
+ - Fix simulator bare /tmp cleanup bug
390
+ - Unify URL fetching into shared fetchContentString, eliminate temp file
391
+ roundtrip
392
+ - Refactor loadJsonFromSource as thin wrapper around loadJsonConfig
393
+ - Remove unused downloadFromUrl function
394
+
395
+ - bbbeba1: Replace externalServer hack with typed sourceSettings override in
396
+ bundle wrapper
397
+ - 7d1a268: Polyfill fetch and navigator.sendBeacon in JSDOM during web
398
+ simulation to prevent throws and capture network calls
399
+ - 616b9b2: Resolve transitive dependencies from local path packages
400
+ automatically
401
+ - 91159be: Support path-based package: references on flow config components
402
+ - 2cc1b54: Support single .ts files and directories without package.json as
403
+ local packages in flow.json
404
+ - Updated dependencies [eb865e1]
405
+ - Updated dependencies [c0a53f9]
406
+ - Updated dependencies [f007c9f]
407
+ - Updated dependencies [bf2dc5b]
408
+ - Updated dependencies [da0b640]
409
+ - @walkeros/core@3.2.0
410
+ - @walkeros/server-core@3.2.0
411
+
412
+ ## 3.1.1
413
+
414
+ ### Patch Changes
415
+
416
+ - a5d98d2: Fix inline JSON config support in detectInput for MCP tools
417
+ (flow_simulate, flow_push)
418
+ - @walkeros/core@3.1.1
419
+ - @walkeros/server-core@3.1.1
420
+
421
+ ## 3.1.0
4
422
 
5
423
  ### Minor Changes
6
424
 
@@ -35,8 +453,8 @@
35
453
  - Updated dependencies [bee8ba7]
36
454
  - Updated dependencies [966342b]
37
455
  - Updated dependencies [df990d4]
38
- - @walkeros/core@4.0.0-next-1773967844643
39
- - @walkeros/server-core@4.0.0-next-1773967844643
456
+ - @walkeros/core@3.1.0
457
+ - @walkeros/server-core@3.1.0
40
458
 
41
459
  ## 3.0.2
42
460
 
package/README.md CHANGED
@@ -8,7 +8,7 @@ flows.
8
8
  The walkerOS CLI is a developer tool that:
9
9
 
10
10
  - **Bundles** flow configurations into optimized JavaScript
11
- - **Simulates** event processing for testing
11
+ - **Simulates** event processing for testing (via `push --simulate`)
12
12
  - **Runs** flows locally without Docker daemon
13
13
 
14
14
  Think of it as your development toolchain for walkerOS - from config to running
@@ -46,7 +46,7 @@ npm install @walkeros/cli
46
46
  walkeros bundle flow.json
47
47
 
48
48
  # Test with simulated events (no real API calls)
49
- walkeros simulate flow.json --event '{"name":"product view"}'
49
+ walkeros push flow.json --event '{"name":"product view"}' --simulate destination.demo
50
50
 
51
51
  # Push real events to destinations
52
52
  walkeros push flow.json --event '{"name":"product view"}'
@@ -99,41 +99,11 @@ walkeros bundle flow.json --dockerfile Dockerfile.custom
99
99
  The output path uses convention-based defaults: `./dist/bundle.mjs` for server,
100
100
  `./dist/walker.js` for web.
101
101
 
102
- ### simulate
103
-
104
- Test event processing with simulated events. The config JSON gets bundled and
105
- executed with destination mocking.
106
-
107
- ```bash
108
- walkeros simulate <config> --event '{"name":"page view"}' [options]
109
- ```
110
-
111
- **Options:**
112
-
113
- - `-e, --event <json>` - Event to simulate (JSON string, file path, or URL)
114
- - `--flow <name>` - Flow name for multi-flow configs
115
- - `-p, --platform <platform>` - Platform override (`web` or `server`)
116
- - `--json` - Output as JSON
117
- - `-v, --verbose` - Verbose output
118
- - `-s, --silent` - Suppress output
119
-
120
- **Examples:**
121
-
122
- ```bash
123
- # Simulate with config (auto-bundled)
124
- walkeros simulate examples/web-serve.json \
125
- --event '{"name":"page view","data":{"title":"Home"}}' \
126
- --json
127
-
128
- # Simulate specific flow from multi-flow config
129
- walkeros simulate flow.json --flow server --event '{"name":"test"}'
130
- ```
131
-
132
102
  ### push
133
103
 
134
- Execute your flow with real API calls to configured destinations. Unlike
135
- `simulate` which mocks API calls, `push` performs actual HTTP requests. Accepts
136
- either a config JSON (which gets bundled) or a pre-built bundle.
104
+ Execute your flow with real API calls, or simulate specific steps with
105
+ `--simulate`. Accepts either a config JSON (which gets bundled) or a pre-built
106
+ bundle.
137
107
 
138
108
  ```bash
139
109
  walkeros push <input> --event '<json>' [options]
@@ -149,9 +119,15 @@ The CLI auto-detects the input type by attempting to parse as JSON.
149
119
  **Options:**
150
120
 
151
121
  - `-e, --event <source>` - Event to push (JSON string, file path, or URL)
152
- **Required**
122
+ **Required** (unless simulating a source)
153
123
  - `--flow <name>` - Flow name (for multi-flow configs)
154
124
  - `-p, --platform <platform>` - Platform override (`web` or `server`)
125
+ - `--simulate <step>` - Simulate a step (repeatable). Mocks the step's push,
126
+ captures result. Use `destination.NAME` or `source.NAME`.
127
+ - `--mock <step=value>` - Mock a step with a specific return value (repeatable).
128
+ Use `destination.NAME=VALUE`.
129
+ - `--snapshot <source>` - JS file to eval before execution. Sets global state
130
+ (`window.dataLayer`, `process.env`, etc.).
155
131
  - `--json` - Output results as JSON
156
132
  - `-v, --verbose` - Verbose output
157
133
  - `-s, --silent` - Suppress output (for CI/CD)
@@ -169,6 +145,19 @@ walkeros push flow.json --event ./events/order.json
169
145
  walkeros push flow.json --event https://example.com/sample-event.json
170
146
  ```
171
147
 
148
+ **Simulation examples:**
149
+
150
+ ```bash
151
+ # Simulate a destination (mock its push, capture API calls)
152
+ walkeros push flow.json -e event.json --simulate destination.ga4
153
+
154
+ # Simulate a source (capture events, disable all destinations)
155
+ walkeros push flow.json --simulate source.browser
156
+
157
+ # Mock a destination with a specific return value
158
+ walkeros push flow.json -e event.json --mock destination.ga4='{"status":"ok"}'
159
+ ```
160
+
172
161
  **Bundle input:**
173
162
 
174
163
  ```bash
@@ -179,16 +168,16 @@ walkeros push dist/bundle.mjs --event '{"name":"order complete"}'
179
168
  walkeros push dist/bundle.js --platform server --event '{"name":"order complete"}'
180
169
  ```
181
170
 
182
- **Push vs Simulate:**
171
+ **Push modes:**
183
172
 
184
- | Feature | `push` | `simulate` |
185
- | ------------ | ----------------------------------- | ------------------ |
186
- | API Calls | Real HTTP requests | Mocked (captured) |
187
- | Use Case | Integration testing | Safe local testing |
188
- | Side Effects | Full (writes to DBs, sends to APIs) | None |
173
+ | Mode | Flag | API Calls | Use Case |
174
+ | ---- | ---- | --------- | -------- |
175
+ | Real | (none) | Real HTTP requests | Integration testing |
176
+ | Simulate | `--simulate` | Mocked (captured) | Safe local testing |
177
+ | Mock | `--mock` | Returns mock value | Controlled testing |
189
178
 
190
- Use `simulate` first to validate configuration safely, then `push` to verify
191
- real integrations.
179
+ Use `--simulate` first to validate safely, then push without flags for real
180
+ integrations.
192
181
 
193
182
  ### run
194
183
 
@@ -503,7 +492,7 @@ See [examples/](./examples/) for complete working configurations.
503
492
  Use commands programmatically:
504
493
 
505
494
  ```typescript
506
- import { bundle, simulate, runCommand } from '@walkeros/cli';
495
+ import { bundle, push, runCommand } from '@walkeros/cli';
507
496
 
508
497
  // Bundle
509
498
  await bundle({
@@ -511,11 +500,18 @@ await bundle({
511
500
  stats: true,
512
501
  });
513
502
 
514
- // Simulate
515
- const result = await simulate(
503
+ // Push with simulation
504
+ const result = await push(
505
+ './flow.json',
506
+ { name: 'page view', data: { title: 'Test' } },
507
+ { simulate: ['destination.ga4'], json: true },
508
+ );
509
+ // result.usage = API call tracking data
510
+
511
+ // Push for real
512
+ await push(
516
513
  './flow.json',
517
514
  { name: 'page view', data: { title: 'Test' } },
518
- { json: true },
519
515
  );
520
516
 
521
517
  // Run
@@ -542,9 +538,10 @@ Try them:
542
538
  walkeros bundle examples/server-collect.json --stats
543
539
 
544
540
  # Simulate
545
- walkeros simulate \
541
+ walkeros push \
546
542
  examples/web-serve.json \
547
- --event '{"name":"product view","data":{"id":"P123"}}'
543
+ --event '{"name":"product view","data":{"id":"P123"}}' \
544
+ --simulate destination.demo
548
545
 
549
546
  # Run server
550
547
  walkeros run examples/server-collect.json --port 3000
@@ -559,9 +556,10 @@ Typical development cycle:
559
556
  vim my-flow.json
560
557
 
561
558
  # 2. Test with simulation (no real API calls)
562
- walkeros simulate \
559
+ walkeros push \
563
560
  my-flow.json \
564
561
  --event '{"name":"product view"}' \
562
+ --simulate destination.demo \
565
563
  --verbose
566
564
 
567
565
  # 3. Bundle and check stats
@@ -581,7 +579,7 @@ curl -X POST http://localhost:3000/collect \
581
579
  ```
582
580
  CLI (downloads packages + bundles with esbuild)
583
581
  ├─ Bundle → optimized .mjs file
584
- ├─ Simulatetest bundle with events
582
+ ├─ Pushexecute bundle (with optional --simulate for testing)
585
583
  └─ Run → execute bundle with built-in runtime
586
584
  ```
587
585