@walkeros/cli 4.0.0-next-1777463920154 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +143 -5
- package/dist/cli.js +502 -368
- package/dist/examples/flow-complete.json +1 -1
- package/dist/examples/index.d.ts +42 -0
- package/dist/examples/index.js +1020 -0
- package/dist/examples/index.js.map +1 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.js +228 -116
- package/dist/index.js.map +1 -1
- package/examples/flow-complete.json +1 -1
- package/package.json +11 -7
- package/src/telemetry/flow.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as _walkeros_core from '@walkeros/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Typed re-exports of bundled example flow configurations.
|
|
5
|
+
*
|
|
6
|
+
* Importing JSON files via `resolveJsonModule` produces a deeply structural
|
|
7
|
+
* type whose literals are widened (`version: number` instead of `4`,
|
|
8
|
+
* `platform: string` instead of `'web' | 'server'`). That widened shape is
|
|
9
|
+
* not assignable to `Flow.Json` and forces every consumer to cast away to
|
|
10
|
+
* `Record<string, unknown>`, losing all type information about the example.
|
|
11
|
+
*
|
|
12
|
+
* Routing the imports through `validateFlowConfig` (a real type guard backed
|
|
13
|
+
* by the canonical Zod schema in `@walkeros/core`) launders the JSON into a
|
|
14
|
+
* proper `Flow.Json` value with no `as` cast at any call site:
|
|
15
|
+
*
|
|
16
|
+
* - The Zod parser checks the structure at module load time. If an example
|
|
17
|
+
* drifts away from the schema, the package fails to load loudly instead
|
|
18
|
+
* of producing a silently broken value.
|
|
19
|
+
* - The return type is `Flow.Json` (the canonical interface), not the Zod
|
|
20
|
+
* inferred shape, because `validateFlowConfig` uses `isFlowConfig` as a
|
|
21
|
+
* `data is Flow.Json` type predicate.
|
|
22
|
+
*
|
|
23
|
+
* Pattern choice (`: Flow.Json` annotation via runtime validator) was picked
|
|
24
|
+
* over `satisfies Flow.Json` and `as const satisfies Flow.Json` because:
|
|
25
|
+
*
|
|
26
|
+
* - `: Flow.Json` annotation alone fails: the JSON's widened literals do
|
|
27
|
+
* not satisfy the literal constraints (`version: 4`, platform unions).
|
|
28
|
+
* - `satisfies Flow.Json` fails for the same reason.
|
|
29
|
+
* - `as const satisfies Flow.Json` cannot be applied to a JSON import
|
|
30
|
+
* (TypeScript does not support `as const` on imported values).
|
|
31
|
+
* - A wrapper-function or runtime-validator approach is the only pattern
|
|
32
|
+
* that produces a `Flow.Json`-typed value without an `as` cast anywhere
|
|
33
|
+
* in the chain. It also gives consumers a load-time correctness check
|
|
34
|
+
* for free.
|
|
35
|
+
*
|
|
36
|
+
* Cost: one Zod parse per example at module init. Examples are loaded by
|
|
37
|
+
* tests, MCP servers, and dev seed scripts. None are perf-critical.
|
|
38
|
+
*/
|
|
39
|
+
declare const flowComplete: _walkeros_core.Flow.Json;
|
|
40
|
+
declare const flowSimple: _walkeros_core.Flow.Json;
|
|
41
|
+
|
|
42
|
+
export { flowComplete, flowSimple };
|