@walkeros/cli 4.0.0-next-1776095573328 → 4.0.0-next-1777882869103

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,364 @@
1
1
  # @walkeros/cli
2
2
 
3
- ## 4.0.0-next-1776095573328
3
+ ## 4.0.0-next-1777882869103
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
+ - 1ef33d9: **BREAKING:** Unified callback signatures across mapping and on.\*
78
+ subscriptions.
79
+
80
+ Every callback in walkerOS now reads `(data, context) => result`. Sources,
81
+ transformers, destinations, and stores already conformed; mapping and on.\*
82
+ join the family in v4.1.
83
+
84
+ ### Mapping callbacks
85
+
86
+ `fn`, `condition`, and `validate` now share a single shape:
87
+
88
+ `(value, context: Mapping.Context) => result`
89
+
90
+ `Mapping.Options` is removed. Replaced by `Mapping.Context`:
91
+
92
+ ```ts
93
+ interface Context {
94
+ event: WalkerOS.DeepPartialEvent;
95
+ mapping: Value | Rule;
96
+ collector: Collector.Instance; // required
97
+ logger: Logger.Instance; // required
98
+ consent?: WalkerOS.Consent; // resolved consent
99
+ }
100
+ ```
101
+
102
+ Rule-level `condition` is now `(event, context) => boolean`.
103
+ `Mapping.Options.props` is removed (no production callers).
104
+
105
+ #### Mapping upgrade
106
+
107
+ ```ts
108
+ // before
109
+ const fn: Mapping.Fn = (value, mapping, options) => /* … */;
110
+ const cond: Mapping.Condition = (value, mapping, collector) => /* … */;
111
+ const val: Mapping.Validate = (value) => /* … */;
112
+
113
+ // after
114
+ const fn: Mapping.Fn = (value, context) => /* … */;
115
+ const cond: Mapping.Condition = (value, context) => /* … */;
116
+ const val: Mapping.Validate = (value, context) => /* … */;
117
+ ```
118
+
119
+ In `$code:` strings (flow.json):
120
+
121
+ ```json
122
+ // before
123
+ "fn": "$code:(value, mapping, options) => …"
124
+ "condition": "$code:(value, mapping, collector) => …"
125
+
126
+ // after
127
+ "fn": "$code:(value, context) => …"
128
+ "condition": "$code:(value, context) => …"
129
+ ```
130
+
131
+ `context.mapping` replaces the second positional arg; `context.collector`,
132
+ `context.logger`, and `context.consent` are all available.
133
+
134
+ One-arg callbacks like `(value) => value.toUpperCase()` continue to work
135
+ unchanged.
136
+
137
+ ### On.\* subscription callbacks
138
+
139
+ `walker.on('consent', …)`, `walker.on('ready', …)`, etc. now receive
140
+ `(data, context: On.Context) => void | Promise<void>`. The legacy `Context`
141
+ interface, `*Config` aliases, and `Options` discriminated union are removed.
142
+
143
+ ```ts
144
+ interface Context {
145
+ collector: Collector.Instance; // required
146
+ logger: Logger.Instance; // required
147
+ }
148
+
149
+ type Fn<TData = unknown> = (
150
+ data: TData,
151
+ context: Context,
152
+ ) => void | Promise<void>;
153
+
154
+ type ConsentFn = Fn<WalkerOS.Consent>;
155
+ type SessionFn = Fn<Collector.SessionData | undefined>;
156
+ type UserFn = Fn<WalkerOS.User>;
157
+ type ReadyFn = Fn<void>;
158
+ type RunFn = Fn<void>;
159
+ type GenericFn = Fn<unknown>;
160
+ ```
161
+
162
+ The new `On.Subscription` alias is the registerable union for
163
+ `walker.on(action, X)`.
164
+
165
+ #### On.\* upgrade
166
+
167
+ ```ts
168
+ // before
169
+ walker.on('consent', { marketing: (collector, consent) => /* … */ });
170
+ walker.on('ready', (collector) => /* … */);
171
+ walker.on('session', (collector, session) => /* … */);
172
+
173
+ // after
174
+ walker.on('consent', { marketing: (consent, ctx) => /* … */ });
175
+ walker.on('ready', (_, ctx) => /* … */);
176
+ walker.on('session', (session, ctx) => /* … */);
177
+ ```
178
+
179
+ `ctx.collector` replaces the positional first arg; `ctx.logger` is also
180
+ available.
181
+
182
+ ### Why both at once
183
+
184
+ Both refactors follow the same `(data, context)` pattern. Shipping them in one
185
+ release means consumers do one search-and-replace pass instead of two, and the
186
+ codebase reaches full callback-signature consistency in v4.1.
187
+
188
+ ### Minor Changes
189
+
190
+ - cfc7469: **Breaking — `@walkeros/core`:** `fetchPackage(name, { baseUrl })`
191
+ now expects the host app to expose the v2 `/api/packages/[name]` endpoint that
192
+ returns the merged `WalkerOSPackage` shape directly (single round-trip,
193
+ `?expand=all`). The previous two-fetch pattern (`?path=package.json` +
194
+ `?path=dist/walkerOS.json`) is removed. Hosts must serve the v2 shape; the
195
+ offline jsdelivr fallback is unchanged.
196
+
197
+ **Feature — CLI/MCP/explorer:** Outbound walkerOS-aware HTTP clients now
198
+ identify themselves to the configured app origin via
199
+ `X-Walkeros-Client: walkeros-{cli|mcp}/{version}`. `@walkeros/explorer`
200
+ exports `setPackageTypesBaseUrl(url?)` so host apps can proxy `.d.ts` through
201
+ their own origin (used by the walkerOS Tag Manager app to drop the jsdelivr
202
+ CDN allowance entirely).
203
+
204
+ - 8e06b1f: **BREAKING:** Unified reference syntax: `$store:id` and
205
+ `$secret:NAME` now use the dot separator: `$store.id` and `$secret.NAME`.
206
+
207
+ The coherent rule across every walkerOS reference is:
208
+ - **`.`** key or path (resolver looks up or walks what follows)
209
+ - **`:`** literal value or raw-code payload (resolver uses what follows
210
+ verbatim)
211
+
212
+ `$var.`, `$def.`, `$env.NAME[:default]`, `$contract.`, and `$code:(…)` are
213
+ unchanged, they already fit the rule.
214
+
215
+ Every shipped example, published `walkerOS.json` metadata, doc page, and skill
216
+ has been updated. A new canonical reference-syntax guide lives at
217
+ `/docs/guides/reference-syntax`. Regex constants (`REF_VAR`, `REF_DEF`,
218
+ `REF_ENV`, `REF_CONTRACT`, `REF_STORE`, `REF_SECRET`, `REF_CODE_PREFIX`) are
219
+ exported from `@walkeros/core` import these instead of hand-rolling regexes.
220
+
221
+ ### Upgrade
222
+
223
+ Search-and-replace across your flow configs:
224
+
225
+ ```
226
+ $store:<id> → $store.<id>
227
+ $secret:<NAME> → $secret.<NAME>
228
+ ```
229
+
230
+ Everything else stays the same. Your `$var.*`, `$def.*`, `$env.*`,
231
+ `$contract.*`, and `$code:*` references need no changes.
232
+
233
+ ### Patch Changes
234
+
235
+ - 6422b9b: Validate device-code and token responses from the auth server with
236
+ Zod schemas at the trust boundary in `login/index.ts`. Malformed responses now
237
+ surface as structured errors instead of being trusted into config writes or
238
+ browser launches. Replaces the hand-rolled type guards for Items 1 and 3 of
239
+ the cli-auth feedback review. No public API change.
240
+ - 78b651a: Explicit opt-in anonymous usage telemetry for CLI and MCP. Telemetry
241
+ is off by default; users opt in with `walkeros telemetry enable` and out with
242
+ `walkeros telemetry disable`. No persistent identifier is written before
243
+ opt-in. No ingest endpoint ships in this release: opting in records consent
244
+ locally; emission begins when a managed endpoint is released. The data
245
+ contract lives at `packages/cli/src/telemetry/flow.json`.
246
+ - 6422b9b: Add `flowId` filter to CLI `listDeployments` and redesign the MCP
247
+ `deploy_manage` tool around it.
248
+
249
+ **CLI (`@walkeros/cli`):**
250
+ - `listDeployments({ projectId?, type?, status?, flowId? })` now forwards
251
+ `flowId` as a query parameter to `GET /api/projects/{id}/deployments`.
252
+ - New helper `deleteDeploymentByFlowId({ projectId?, flowId, slug? })` deletes
253
+ the active deployment for a flow, surfacing a `DeploymentAmbiguityError`
254
+ (code `MULTIPLE_DEPLOYMENTS`, with a `details[]` list) when a flow has more
255
+ than one active deployment and no slug was supplied.
256
+
257
+ **MCP (`@walkeros/mcp`) breaking:**
258
+ - `deploy_manage`'s `get`, `delete`, and `list` actions now take
259
+ `{ projectId?, flowId, slug? }`. The old `id` parameter has been removed.
260
+ `flowId` is required for `get`/`delete` and optional for `list`.
261
+ Soft-deleted deployments are always excluded.
262
+ - When a flow has multiple active deployments and `slug` is not provided,
263
+ `get`/`delete` return a `MULTIPLE_DEPLOYMENTS` error with a `details[]` list
264
+ of `{ slug, type, status, updatedAt }` entries so the caller can pick one.
265
+ `deploy` action is unchanged.
266
+
267
+ - Updated dependencies [93ea9c4]
268
+ - Updated dependencies [465775c]
269
+ - Updated dependencies [942a7fe]
270
+ - Updated dependencies [cfc7469]
271
+ - Updated dependencies [8e06b1f]
272
+ - Updated dependencies [3d50dd6]
273
+ - Updated dependencies [1ef33d9]
274
+ - @walkeros/core@4.0.0-next-1777882869103
275
+ - @walkeros/collector@4.0.0-next-1777882869103
276
+ - @walkeros/server-destination-api@4.0.0-next-1777882869103
277
+ - @walkeros/server-core@4.0.0-next-1777882869103
278
+
279
+ ## 3.4.2
280
+
281
+ ### Patch Changes
282
+
283
+ - 2d25eda: Replace `api` mega-tool with four focused management tools: `auth`
284
+ (device code login), `project_manage`, `flow_manage`, and `deploy_manage`.
285
+ Enforce strict CLI/MCP separation of concern — MCP no longer reads config
286
+ files or checks env vars directly. All tools are always registered regardless
287
+ of auth state.
288
+
289
+ CLI exports new functions: `requestDeviceCode`, `pollForToken`,
290
+ `setDefaultProject`, `getDefaultProject`, `listAllFlows`,
291
+ `setFeedbackPreference`, `getFeedbackPreference`, `resolveToken`,
292
+ `deleteConfig`.
293
+
294
+ Preview CRUD (`preview_list`, `preview_get`, `preview_create`,
295
+ `preview_delete`) is now part of `flow_manage` — previews are a flow-scoped
296
+ concern and belong alongside the flow lifecycle actions rather than in a
297
+ separate tool.
298
+
299
+ - cb4c069: Runtime fetchers (`fetchConfig`, `fetchSecrets`) now classify 401/403
300
+ responses from the app as a typed `RunnerAuthError` with a structured `reason`
301
+ (`'unauthorised' | 'flow' | 'scope' | 'forbidden'`) and the app's error `code`
302
+ (`FORBIDDEN_FLOW` / `FORBIDDEN_SCOPE`). Callers can log a specific reason
303
+ instead of a generic "token may have expired" message, and exit cleanly rather
304
+ than retry on scope/flow mismatches.
305
+ - @walkeros/core@3.4.2
306
+ - @walkeros/server-core@3.4.2
307
+
308
+ ## 3.4.1
309
+
310
+ ### Patch Changes
311
+
312
+ - caea905: Add `walkeros previews {list|get|create|delete}` commands for
313
+ managing preview bundles. `create` supports `--flow <name>` or
314
+ `--settings-id <id>` to target a flow settings entry, and `--url <siteUrl>` to
315
+ produce a ready-to-open activation URL. Use `--open` to launch it in your
316
+ default browser.
317
+ - caea905: Preview preflight now self-heals when a preview bundle is deleted.
318
+ Instead of injecting the preview script directly and letting it 404, the
319
+ preflight does a `fetch(HEAD)` first. If the bundle is missing, it clears the
320
+ `elbPreview` cookie and loads the production walker, so visitors never see
321
+ silent analytics breakage.
322
+ - Updated dependencies [12adf24]
323
+ - Updated dependencies [75aa26b]
324
+ - @walkeros/core@3.4.1
325
+ - @walkeros/server-core@3.4.1
326
+
327
+ ## 3.4.0
328
+
329
+ ### Minor Changes
330
+
331
+ - 1a0f8f2: Add `target` option to `bundle()`:
332
+ `cdn | cdn-skeleton | runner | simulate | push`. Replaces
333
+ `buildOverrides.skipWrapper` (deprecated) to stop dev schemas leaking into
334
+ production CDN bundles. Stage 2 entry generators gain `platform` option and
335
+ inject `env.window`/`env.document` for browser targets, fixing
336
+ `window.elbLayer` in deployed walker.js.
337
+ - 9f97bdd: Clients now send `User-Agent`, `X-WalkerOS-Client`, and
338
+ `X-WalkerOS-Client-Version` on every request to the walkerOS app. When the app
339
+ returns `426 Upgrade Required`, the CLI prints the required version + upgrade
340
+ instruction and exits with code 2; the MCP surfaces the same info in tool
341
+ errors. Set `WALKEROS_CLIENT_TYPE=runner` to have the CLI binary identify as a
342
+ long-lived runner instead of an interactive CLI (used by the runtime image so
343
+ runners are distinguishable from interactive sessions).
344
+
345
+ ### Patch Changes
346
+
347
+ - Updated dependencies [74940cc]
348
+ - Updated dependencies [525f5d9]
349
+ - @walkeros/core@3.4.0
350
+ - @walkeros/server-core@3.4.0
351
+
352
+ ## 3.3.1
353
+
354
+ ### Patch Changes
355
+
356
+ - 62f6a38: Force collector.run=true during push and simulate so flows with
357
+ run:false work in CLI
358
+ - @walkeros/server-core@3.3.1
359
+ - @walkeros/core@3.3.1
360
+
361
+ ## 3.3.0
4
362
 
5
363
  ### Minor Changes
6
364
 
@@ -95,8 +453,8 @@
95
453
  - Updated dependencies [08c365a]
96
454
  - Updated dependencies [08c365a]
97
455
  - Updated dependencies [08c365a]
98
- - @walkeros/core@4.0.0-next-1776095573328
99
- - @walkeros/server-core@4.0.0-next-1776095573328
456
+ - @walkeros/core@3.3.0
457
+ - @walkeros/server-core@3.3.0
100
458
 
101
459
  ## 3.2.0
102
460