@walkeros/cli 4.6.1 → 4.7.0-next-1790245733116

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/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { Flow, PreviewKey, Elb, Ingest, WalkerOS, Simulation, ObserveWeb } from '@walkeros/core';
2
2
  export { Flow } from '@walkeros/core';
3
3
  import { BuildOptions as BuildOptions$1 } from 'esbuild';
4
- import { z } from '@walkeros/core/dev';
4
+ import { z, ValidationType, ValidateResult } from '@walkeros/core/dev';
5
+ export { ValidateResult, ValidationError, ValidationType, ValidationWarning, validateFlowStructure } from '@walkeros/core/dev';
5
6
  import * as openapi_fetch from 'openapi-fetch';
6
7
 
7
8
  /**
@@ -282,6 +283,7 @@ declare function bundleCommand(options: BundleCommandOptions): Promise<void>;
282
283
  * @param options.stats - Collect and return bundle statistics (default: false)
283
284
  * @param options.cache - Enable package caching (default: true)
284
285
  * @param options.flowName - Flow to use (required for multi-flow configs)
286
+ * @param options.buildEnv - Base env for web `$env` (default `process.env`)
285
287
  * @returns Bundle statistics if stats option is true, otherwise void
286
288
  *
287
289
  * @example
@@ -321,6 +323,13 @@ declare function bundle(configOrPath: unknown, options?: {
321
323
  */
322
324
  target?: BundleTarget;
323
325
  buildOverrides?: Partial<BuildOptions>;
326
+ /**
327
+ * Base environment web `$env` references resolve against, beneath the
328
+ * flow's declared `config.bundle.env`. Omitted, it is `process.env` (a
329
+ * local build). Pass `{}` for a hosted build, which then resolves against
330
+ * the declared values alone and never the building process's own env.
331
+ */
332
+ buildEnv?: Record<string, string | undefined>;
324
333
  }): Promise<BundleStats | void>;
325
334
 
326
335
  /**
@@ -551,16 +560,19 @@ interface SimulateTransformerOptions extends SimulateDataOptions {
551
560
  *
552
561
  * Takes a DeepPartialEvent, validates it with Zod, loads the flow config,
553
562
  * bundles it, starts the flow to get initialized transformers, then runs
554
- * the event through the target transformer (with optional before chain).
563
+ * the event from the target transformer on, exactly as the runtime does
564
+ * (`runTransformerSimulation`).
555
565
  *
556
- * Captured array: first entry = input event, subsequent entries = output event(s).
557
- * If the transformer drops the event (returns false), output event is null.
566
+ * Captured array: one entry per finished copy. When the event was dropped
567
+ * or stopped, a single `null` entry.
558
568
  */
559
569
  declare function simulateTransformer(configOrPath: string | Flow.Json, event: WalkerOS.DeepPartialEvent, options: SimulateTransformerOptions): Promise<Simulation.Result>;
560
570
  interface SimulateCollectorOptions extends SimulateDataOptions {
561
571
  collectorName: string;
562
572
  bundlePath?: string;
563
573
  flow?: string;
574
+ /** `collector.next.TRANSFORMER=VALUE` mocks for the collector's chain. */
575
+ mock?: string[];
564
576
  silent?: boolean;
565
577
  verbose?: boolean;
566
578
  snapshot?: string;
@@ -572,12 +584,14 @@ interface SimulateCollectorOptions extends SimulateDataOptions {
572
584
  };
573
585
  }
574
586
  /**
575
- * Self-contained collector enrichment simulation.
587
+ * Self-contained collector simulation.
576
588
  *
577
589
  * Takes a post-next `DeepPartialEvent` and an optional collector-state
578
- * snapshot, then returns the fully enriched event the runtime produces between
579
- * the pre-collector `next` chain and the post-collector `before` chain. Reuses
580
- * the runtime's own enrichment (`enrichEvent`); it does not reimplement it.
590
+ * snapshot, then returns what the runtime hands to the destination fan-out:
591
+ * the enriched event after the collector's own chain (`collector.next`), one
592
+ * entry per finished copy, or a single `null` entry when the chain dropped
593
+ * the event. Runs `runCollectorSimulation`; it does not reimplement the
594
+ * enrichment or the chain.
581
595
  */
582
596
  declare function simulateCollector(configOrPath: string | Flow.Json, event: WalkerOS.DeepPartialEvent, options: SimulateCollectorOptions): Promise<Simulation.Result>;
583
597
  interface SimulateDestinationOptions extends SimulateDataOptions {
@@ -600,87 +614,6 @@ interface SimulateDestinationOptions extends SimulateDataOptions {
600
614
  */
601
615
  declare function simulateDestination(configOrPath: string | Flow.Json, event: WalkerOS.DeepPartialEvent, options: SimulateDestinationOptions): Promise<Simulation.Result>;
602
616
 
603
- /**
604
- * Run Command Types
605
- *
606
- * Types for running walkerOS flows via CLI or Docker.
607
- */
608
- /**
609
- * CLI command options for `walkeros run`
610
- */
611
- interface RunCommandOptions {
612
- /** Flow configuration file path (.json or pre-built .mjs) */
613
- config?: string;
614
- /** Server port (overrides flow config) */
615
- port?: number;
616
- /** Flow name for multi-flow configs */
617
- flow?: string;
618
- /** API flow ID (enables heartbeat, polling, secrets) */
619
- flowId?: string;
620
- /** Deployment ID (for heartbeat tracking) */
621
- deploymentId?: string;
622
- /** Project ID */
623
- project?: string;
624
- /** Opt-in dotenv file to load into process.env before config resolution */
625
- envFile?: string;
626
- /** Enable JSON output */
627
- json?: boolean;
628
- /** Verbose logging */
629
- verbose?: boolean;
630
- /** Suppress output */
631
- silent?: boolean;
632
- }
633
- /**
634
- * Programmatic run options
635
- */
636
- interface RunOptions {
637
- /** Flow configuration file path (.json or pre-built .mjs) */
638
- config?: string;
639
- /** Server port */
640
- port?: number;
641
- /** Flow name for multi-flow configs */
642
- flow?: string;
643
- /** API flow ID (enables heartbeat, polling, secrets) */
644
- flowId?: string;
645
- /** Project ID */
646
- project?: string;
647
- /** Verbose logging */
648
- verbose?: boolean;
649
- /** Suppress output */
650
- silent?: boolean;
651
- }
652
- /**
653
- * Result from running a flow
654
- */
655
- interface RunResult {
656
- /** Whether the flow ran successfully */
657
- success: boolean;
658
- /** Exit code */
659
- exitCode: number;
660
- /** Error message if failed */
661
- error?: string;
662
- /** Execution duration in milliseconds */
663
- duration: number;
664
- }
665
-
666
- /**
667
- * Run Command
668
- *
669
- * Unified entry point for running walkerOS flows.
670
- * Used by both `walkeros run` (CLI) and Docker containers.
671
- */
672
-
673
- /**
674
- * CLI command function for `walkeros run`
675
- */
676
- declare function runCommand(options: RunCommandOptions): Promise<void>;
677
- /**
678
- * Programmatic run function
679
- */
680
- declare function run(options: RunOptions): Promise<RunResult>;
681
-
682
- type ValidationType = 'contract' | 'event' | 'flow' | 'mapping';
683
- type ValidateResultType = ValidationType | 'entry';
684
617
  interface ValidateCommandOptions {
685
618
  type: ValidationType;
686
619
  input?: string;
@@ -692,25 +625,6 @@ interface ValidateCommandOptions {
692
625
  strict?: boolean;
693
626
  silent?: boolean;
694
627
  }
695
- interface ValidationError {
696
- path: string;
697
- message: string;
698
- value?: unknown;
699
- code?: string;
700
- }
701
- interface ValidationWarning {
702
- path: string;
703
- message: string;
704
- suggestion?: string;
705
- code?: string;
706
- }
707
- interface ValidateResult {
708
- valid: boolean;
709
- type: ValidateResultType;
710
- errors: ValidationError[];
711
- warnings: ValidationWarning[];
712
- details: Record<string, unknown>;
713
- }
714
628
 
715
629
  /**
716
630
  * Programmatic API for validation.
@@ -5005,15 +4919,15 @@ interface paths {
5005
4919
  put?: never;
5006
4920
  /**
5007
4921
  * Bundle flow
5008
- * @description Bundle a flow using CLI. Returns bundleId (content-hash). Use ?output=download to redirect to presigned S3 URL.
4922
+ * @description Bundle a flow for deploy or download. Requires ?output=download: bearer callers get a 302 to a presigned S3 URL, session callers get the bundle bytes streamed. A POST without output=download returns 400.
5009
4923
  */
5010
4924
  post: {
5011
4925
  parameters: {
5012
- query?: {
4926
+ query: {
5013
4927
  /** @description Named flow to bundle (required for multi-settings flows) */
5014
4928
  flow?: string;
5015
- /** @description Set to "download" to redirect to the bundle file */
5016
- output?: 'download';
4929
+ /** @description Required. Must be "download" */
4930
+ output: 'download';
5017
4931
  };
5018
4932
  header?: never;
5019
4933
  path: {
@@ -5024,33 +4938,22 @@ interface paths {
5024
4938
  };
5025
4939
  requestBody?: never;
5026
4940
  responses: {
5027
- /** @description Bundle result */
4941
+ /** @description Bundle file streamed (session callers) */
5028
4942
  200: {
5029
4943
  headers: {
5030
4944
  [name: string]: unknown;
5031
4945
  };
5032
- content: {
5033
- 'application/json': components['schemas']['BundleResponse'];
5034
- };
4946
+ content?: never;
5035
4947
  };
5036
- /** @description Redirect to presigned bundle URL (when output=download) */
4948
+ /** @description Redirect to presigned bundle URL (bearer callers) */
5037
4949
  302: {
5038
4950
  headers: {
5039
4951
  [name: string]: unknown;
5040
4952
  };
5041
4953
  content?: never;
5042
4954
  };
5043
- /** @description Unauthorized */
5044
- 401: {
5045
- headers: {
5046
- [name: string]: unknown;
5047
- };
5048
- content: {
5049
- 'application/json': components['schemas']['ErrorResponse'];
5050
- };
5051
- };
5052
- /** @description Not found */
5053
- 404: {
4955
+ /** @description Validation error */
4956
+ 400: {
5054
4957
  headers: {
5055
4958
  [name: string]: unknown;
5056
4959
  };
@@ -5058,52 +4961,6 @@ interface paths {
5058
4961
  'application/json': components['schemas']['ErrorResponse'];
5059
4962
  };
5060
4963
  };
5061
- };
5062
- };
5063
- delete?: never;
5064
- options?: never;
5065
- head?: never;
5066
- patch?: never;
5067
- trace?: never;
5068
- };
5069
- '/api/projects/{projectId}/flows/{flowId}/simulate': {
5070
- parameters: {
5071
- query?: never;
5072
- header?: never;
5073
- path?: never;
5074
- cookie?: never;
5075
- };
5076
- get?: never;
5077
- put?: never;
5078
- /**
5079
- * Simulate a flow step
5080
- * @description Execute a simulation against a pre-built bundle. Requires bundleId from the bundle endpoint.
5081
- */
5082
- post: {
5083
- parameters: {
5084
- query?: never;
5085
- header?: never;
5086
- path: {
5087
- projectId: string;
5088
- flowId: string;
5089
- };
5090
- cookie?: never;
5091
- };
5092
- requestBody?: {
5093
- content: {
5094
- 'application/json': components['schemas']['SimulateRequest'];
5095
- };
5096
- };
5097
- responses: {
5098
- /** @description Simulation result */
5099
- 200: {
5100
- headers: {
5101
- [name: string]: unknown;
5102
- };
5103
- content: {
5104
- 'application/json': components['schemas']['SimulateResponse'];
5105
- };
5106
- };
5107
4964
  /** @description Unauthorized */
5108
4965
  401: {
5109
4966
  headers: {
@@ -5122,7 +4979,7 @@ interface paths {
5122
4979
  'application/json': components['schemas']['ErrorResponse'];
5123
4980
  };
5124
4981
  };
5125
- /** @description Simulation container error */
4982
+ /** @description Bundle upstream unavailable */
5126
4983
  502: {
5127
4984
  headers: {
5128
4985
  [name: string]: unknown;
@@ -14268,37 +14125,6 @@ interface components {
14268
14125
  /** @example 90 */
14269
14126
  expiresInDays: 30 | 90 | 180 | 365;
14270
14127
  };
14271
- BundleResponse: {
14272
- bundleId: string;
14273
- cached: boolean;
14274
- };
14275
- SimulateResponse: {
14276
- success: boolean;
14277
- result?: {
14278
- /** @enum {string} */
14279
- step: 'source' | 'transformer' | 'destination';
14280
- name: string;
14281
- events: {
14282
- [key: string]: unknown;
14283
- }[];
14284
- calls: {
14285
- fn: string;
14286
- args: unknown[];
14287
- ts: number;
14288
- }[];
14289
- duration: number;
14290
- };
14291
- };
14292
- SimulateRequest: {
14293
- bundleId: string;
14294
- config: {
14295
- [key: string]: unknown;
14296
- };
14297
- event: {
14298
- [key: string]: unknown;
14299
- };
14300
- step: string;
14301
- };
14302
14128
  RegisterRuntimeRequest: {
14303
14129
  flowId: string;
14304
14130
  bundlePath: string;
@@ -15026,26 +14852,6 @@ declare function classifyStepProperties(step: Record<string, unknown>): {
15026
14852
  dataProps: Record<string, unknown>;
15027
14853
  };
15028
14854
 
15029
- /**
15030
- * Pure structural validation of a flow config — the exact checks the bundler
15031
- * runs at codegen time, BEFORE any esbuild compile or package/archive fetch.
15032
- *
15033
- * Runs synchronously and never touches the network, the filesystem, or
15034
- * esbuild. Aggregates every structural problem instead of throwing on the
15035
- * first one, so a single call surfaces all issues in a config.
15036
- *
15037
- * Checks performed per flow:
15038
- * - component names are valid JavaScript identifiers (they become generated
15039
- * property names),
15040
- * - each source/destination/store reference specifies exactly one of
15041
- * package or code, and each transformer entry is a closed, valid shape,
15042
- * - every `$store.` reference points at a defined store.
15043
- *
15044
- * Intended for fast deploy preflight: catch a bad flow config in well under a
15045
- * second without spinning up a container or compiling anything.
15046
- */
15047
- declare function validateFlowStructure(flowConfig: Flow.Json): ValidateResult;
15048
-
15049
14855
  /**
15050
14856
  * Publish-time wrap step.
15051
14857
  *
@@ -15117,6 +14923,366 @@ interface WrapSkeletonOptions {
15117
14923
  }
15118
14924
  declare function wrapSkeleton(options: WrapSkeletonOptions): Promise<void>;
15119
14925
 
14926
+ /**
14927
+ * Build Manifest Schemas
14928
+ *
14929
+ * The contract of `walkeros bundle --manifest`: a build orchestrator writes a
14930
+ * manifest, the CLI builds every requested artifact, PUTs each output to its
14931
+ * own URL, then PUTs a structured result to `resultPutUrl`. Any orchestrator
14932
+ * can drive it (a CI job, a hosted build job, a self-hoster's script); nothing
14933
+ * in it is specific to one.
14934
+ *
14935
+ * Evolution rule: unknown TOP-LEVEL keys are tolerated and ignored, so an
14936
+ * orchestrator can add a field for its own bookkeeping without a CLI release.
14937
+ * A field the CLI must ACT on needs a CLI release, and `toolchain` makes the
14938
+ * CLI refuse a manifest written for a different version rather than silently
14939
+ * ignoring what it does not understand. Artifact entries and wrap options are
14940
+ * strict for the same reason: an ignored option there would change the bytes.
14941
+ *
14942
+ * Build env: web `$env.NAME` resolves against `buildEnv` with the flow's
14943
+ * `config.bundle.env` on top (declared wins), never against the CLI process's
14944
+ * own environment. `config.bundle.env` values are taken as literals: a
14945
+ * reference inside one (`"$env.X"`) is not resolved at build time and must
14946
+ * not be relied on. A `$flow.<sibling>` reference resolves against the ENTRY
14947
+ * flow's declared env, never the sibling's own `config.bundle.env`, so a
14948
+ * value the sibling declares for itself is `MISSING_BUILD_ENV` here.
14949
+ *
14950
+ * Local paths: a manifest build refuses every config-chosen filesystem input
14951
+ * (local step packages, `bundle.packages.<name>.path`, `bundle.traceInclude`,
14952
+ * `include`) with `LOCAL_PATH_NOT_ALLOWED`, before anything is fetched.
14953
+ */
14954
+
14955
+ /** Current manifest format version. */
14956
+ declare const BUILD_MANIFEST_VERSION = 1;
14957
+ declare const BuildBundleArtifactSchema: z.ZodObject<{
14958
+ outputName: z.ZodString;
14959
+ putUrl: z.ZodURL;
14960
+ contentType: z.ZodOptional<z.ZodString>;
14961
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
14962
+ target: z.ZodEnum<{
14963
+ runner: "runner";
14964
+ push: "push";
14965
+ cdn: "cdn";
14966
+ "cdn-skeleton": "cdn-skeleton";
14967
+ simulate: "simulate";
14968
+ }>;
14969
+ }, z.core.$strict>;
14970
+ declare const BuildWrapOptionsSchema: z.ZodObject<{
14971
+ windowCollector: z.ZodOptional<z.ZodString>;
14972
+ windowElb: z.ZodOptional<z.ZodString>;
14973
+ preview: z.ZodOptional<z.ZodObject<{
14974
+ enabled: z.ZodBoolean;
14975
+ keyring: z.ZodArray<z.ZodObject<{
14976
+ kid: z.ZodString;
14977
+ spki: z.ZodString;
14978
+ }, z.core.$strict>>;
14979
+ iss: z.ZodString;
14980
+ pb: z.ZodOptional<z.ZodString>;
14981
+ acceptForeign: z.ZodOptional<z.ZodBoolean>;
14982
+ demoAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
14983
+ previewOrigin: z.ZodString;
14984
+ }, z.core.$strict>>;
14985
+ previewGrantTargets: z.ZodOptional<z.ZodArray<z.ZodString>>;
14986
+ observe: z.ZodOptional<z.ZodObject<{
14987
+ url: z.ZodString;
14988
+ binding: z.ZodString;
14989
+ flowId: z.ZodOptional<z.ZodString>;
14990
+ level: z.ZodOptional<z.ZodEnum<{
14991
+ standard: "standard";
14992
+ trace: "trace";
14993
+ off: "off";
14994
+ }>>;
14995
+ sample: z.ZodOptional<z.ZodNumber>;
14996
+ }, z.core.$strict>>;
14997
+ minify: z.ZodOptional<z.ZodBoolean>;
14998
+ minifyOptions: z.ZodOptional<z.ZodObject<{
14999
+ identifiers: z.ZodOptional<z.ZodBoolean>;
15000
+ syntax: z.ZodOptional<z.ZodBoolean>;
15001
+ whitespace: z.ZodOptional<z.ZodBoolean>;
15002
+ keepNames: z.ZodOptional<z.ZodBoolean>;
15003
+ legalComments: z.ZodOptional<z.ZodEnum<{
15004
+ external: "external";
15005
+ none: "none";
15006
+ inline: "inline";
15007
+ eof: "eof";
15008
+ linked: "linked";
15009
+ }>>;
15010
+ }, z.core.$strict>>;
15011
+ target: z.ZodOptional<z.ZodString>;
15012
+ }, z.core.$strict>;
15013
+ declare const BuildWrapArtifactSchema: z.ZodObject<{
15014
+ outputName: z.ZodString;
15015
+ putUrl: z.ZodURL;
15016
+ contentType: z.ZodOptional<z.ZodString>;
15017
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
15018
+ target: z.ZodLiteral<"wrap">;
15019
+ platform: z.ZodEnum<{
15020
+ browser: "browser";
15021
+ node: "node";
15022
+ }>;
15023
+ skeleton: z.ZodUnion<readonly [z.ZodObject<{
15024
+ url: z.ZodURL;
15025
+ }, z.core.$strict>, z.ZodObject<{
15026
+ artifact: z.ZodString;
15027
+ }, z.core.$strict>]>;
15028
+ options: z.ZodOptional<z.ZodObject<{
15029
+ windowCollector: z.ZodOptional<z.ZodString>;
15030
+ windowElb: z.ZodOptional<z.ZodString>;
15031
+ preview: z.ZodOptional<z.ZodObject<{
15032
+ enabled: z.ZodBoolean;
15033
+ keyring: z.ZodArray<z.ZodObject<{
15034
+ kid: z.ZodString;
15035
+ spki: z.ZodString;
15036
+ }, z.core.$strict>>;
15037
+ iss: z.ZodString;
15038
+ pb: z.ZodOptional<z.ZodString>;
15039
+ acceptForeign: z.ZodOptional<z.ZodBoolean>;
15040
+ demoAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
15041
+ previewOrigin: z.ZodString;
15042
+ }, z.core.$strict>>;
15043
+ previewGrantTargets: z.ZodOptional<z.ZodArray<z.ZodString>>;
15044
+ observe: z.ZodOptional<z.ZodObject<{
15045
+ url: z.ZodString;
15046
+ binding: z.ZodString;
15047
+ flowId: z.ZodOptional<z.ZodString>;
15048
+ level: z.ZodOptional<z.ZodEnum<{
15049
+ standard: "standard";
15050
+ trace: "trace";
15051
+ off: "off";
15052
+ }>>;
15053
+ sample: z.ZodOptional<z.ZodNumber>;
15054
+ }, z.core.$strict>>;
15055
+ minify: z.ZodOptional<z.ZodBoolean>;
15056
+ minifyOptions: z.ZodOptional<z.ZodObject<{
15057
+ identifiers: z.ZodOptional<z.ZodBoolean>;
15058
+ syntax: z.ZodOptional<z.ZodBoolean>;
15059
+ whitespace: z.ZodOptional<z.ZodBoolean>;
15060
+ keepNames: z.ZodOptional<z.ZodBoolean>;
15061
+ legalComments: z.ZodOptional<z.ZodEnum<{
15062
+ external: "external";
15063
+ none: "none";
15064
+ inline: "inline";
15065
+ eof: "eof";
15066
+ linked: "linked";
15067
+ }>>;
15068
+ }, z.core.$strict>>;
15069
+ target: z.ZodOptional<z.ZodString>;
15070
+ }, z.core.$strict>>;
15071
+ }, z.core.$strict>;
15072
+ declare const BuildArtifactSchema: z.ZodUnion<readonly [z.ZodObject<{
15073
+ outputName: z.ZodString;
15074
+ putUrl: z.ZodURL;
15075
+ contentType: z.ZodOptional<z.ZodString>;
15076
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
15077
+ target: z.ZodEnum<{
15078
+ runner: "runner";
15079
+ push: "push";
15080
+ cdn: "cdn";
15081
+ "cdn-skeleton": "cdn-skeleton";
15082
+ simulate: "simulate";
15083
+ }>;
15084
+ }, z.core.$strict>, z.ZodObject<{
15085
+ outputName: z.ZodString;
15086
+ putUrl: z.ZodURL;
15087
+ contentType: z.ZodOptional<z.ZodString>;
15088
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
15089
+ target: z.ZodLiteral<"wrap">;
15090
+ platform: z.ZodEnum<{
15091
+ browser: "browser";
15092
+ node: "node";
15093
+ }>;
15094
+ skeleton: z.ZodUnion<readonly [z.ZodObject<{
15095
+ url: z.ZodURL;
15096
+ }, z.core.$strict>, z.ZodObject<{
15097
+ artifact: z.ZodString;
15098
+ }, z.core.$strict>]>;
15099
+ options: z.ZodOptional<z.ZodObject<{
15100
+ windowCollector: z.ZodOptional<z.ZodString>;
15101
+ windowElb: z.ZodOptional<z.ZodString>;
15102
+ preview: z.ZodOptional<z.ZodObject<{
15103
+ enabled: z.ZodBoolean;
15104
+ keyring: z.ZodArray<z.ZodObject<{
15105
+ kid: z.ZodString;
15106
+ spki: z.ZodString;
15107
+ }, z.core.$strict>>;
15108
+ iss: z.ZodString;
15109
+ pb: z.ZodOptional<z.ZodString>;
15110
+ acceptForeign: z.ZodOptional<z.ZodBoolean>;
15111
+ demoAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
15112
+ previewOrigin: z.ZodString;
15113
+ }, z.core.$strict>>;
15114
+ previewGrantTargets: z.ZodOptional<z.ZodArray<z.ZodString>>;
15115
+ observe: z.ZodOptional<z.ZodObject<{
15116
+ url: z.ZodString;
15117
+ binding: z.ZodString;
15118
+ flowId: z.ZodOptional<z.ZodString>;
15119
+ level: z.ZodOptional<z.ZodEnum<{
15120
+ standard: "standard";
15121
+ trace: "trace";
15122
+ off: "off";
15123
+ }>>;
15124
+ sample: z.ZodOptional<z.ZodNumber>;
15125
+ }, z.core.$strict>>;
15126
+ minify: z.ZodOptional<z.ZodBoolean>;
15127
+ minifyOptions: z.ZodOptional<z.ZodObject<{
15128
+ identifiers: z.ZodOptional<z.ZodBoolean>;
15129
+ syntax: z.ZodOptional<z.ZodBoolean>;
15130
+ whitespace: z.ZodOptional<z.ZodBoolean>;
15131
+ keepNames: z.ZodOptional<z.ZodBoolean>;
15132
+ legalComments: z.ZodOptional<z.ZodEnum<{
15133
+ external: "external";
15134
+ none: "none";
15135
+ inline: "inline";
15136
+ eof: "eof";
15137
+ linked: "linked";
15138
+ }>>;
15139
+ }, z.core.$strict>>;
15140
+ target: z.ZodOptional<z.ZodString>;
15141
+ }, z.core.$strict>>;
15142
+ }, z.core.$strict>]>;
15143
+ declare const BuildManifestSchema: z.ZodObject<{
15144
+ version: z.ZodLiteral<1>;
15145
+ toolchain: z.ZodString;
15146
+ flowConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
15147
+ flowName: z.ZodOptional<z.ZodString>;
15148
+ buildEnv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
15149
+ artifacts: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
15150
+ outputName: z.ZodString;
15151
+ putUrl: z.ZodURL;
15152
+ contentType: z.ZodOptional<z.ZodString>;
15153
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
15154
+ target: z.ZodEnum<{
15155
+ runner: "runner";
15156
+ push: "push";
15157
+ cdn: "cdn";
15158
+ "cdn-skeleton": "cdn-skeleton";
15159
+ simulate: "simulate";
15160
+ }>;
15161
+ }, z.core.$strict>, z.ZodObject<{
15162
+ outputName: z.ZodString;
15163
+ putUrl: z.ZodURL;
15164
+ contentType: z.ZodOptional<z.ZodString>;
15165
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
15166
+ target: z.ZodLiteral<"wrap">;
15167
+ platform: z.ZodEnum<{
15168
+ browser: "browser";
15169
+ node: "node";
15170
+ }>;
15171
+ skeleton: z.ZodUnion<readonly [z.ZodObject<{
15172
+ url: z.ZodURL;
15173
+ }, z.core.$strict>, z.ZodObject<{
15174
+ artifact: z.ZodString;
15175
+ }, z.core.$strict>]>;
15176
+ options: z.ZodOptional<z.ZodObject<{
15177
+ windowCollector: z.ZodOptional<z.ZodString>;
15178
+ windowElb: z.ZodOptional<z.ZodString>;
15179
+ preview: z.ZodOptional<z.ZodObject<{
15180
+ enabled: z.ZodBoolean;
15181
+ keyring: z.ZodArray<z.ZodObject<{
15182
+ kid: z.ZodString;
15183
+ spki: z.ZodString;
15184
+ }, z.core.$strict>>;
15185
+ iss: z.ZodString;
15186
+ pb: z.ZodOptional<z.ZodString>;
15187
+ acceptForeign: z.ZodOptional<z.ZodBoolean>;
15188
+ demoAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
15189
+ previewOrigin: z.ZodString;
15190
+ }, z.core.$strict>>;
15191
+ previewGrantTargets: z.ZodOptional<z.ZodArray<z.ZodString>>;
15192
+ observe: z.ZodOptional<z.ZodObject<{
15193
+ url: z.ZodString;
15194
+ binding: z.ZodString;
15195
+ flowId: z.ZodOptional<z.ZodString>;
15196
+ level: z.ZodOptional<z.ZodEnum<{
15197
+ standard: "standard";
15198
+ trace: "trace";
15199
+ off: "off";
15200
+ }>>;
15201
+ sample: z.ZodOptional<z.ZodNumber>;
15202
+ }, z.core.$strict>>;
15203
+ minify: z.ZodOptional<z.ZodBoolean>;
15204
+ minifyOptions: z.ZodOptional<z.ZodObject<{
15205
+ identifiers: z.ZodOptional<z.ZodBoolean>;
15206
+ syntax: z.ZodOptional<z.ZodBoolean>;
15207
+ whitespace: z.ZodOptional<z.ZodBoolean>;
15208
+ keepNames: z.ZodOptional<z.ZodBoolean>;
15209
+ legalComments: z.ZodOptional<z.ZodEnum<{
15210
+ external: "external";
15211
+ none: "none";
15212
+ inline: "inline";
15213
+ eof: "eof";
15214
+ linked: "linked";
15215
+ }>>;
15216
+ }, z.core.$strict>>;
15217
+ target: z.ZodOptional<z.ZodString>;
15218
+ }, z.core.$strict>>;
15219
+ }, z.core.$strict>]>>;
15220
+ resultPutUrl: z.ZodURL;
15221
+ }, z.core.$loose>;
15222
+ type BuildManifest = z.infer<typeof BuildManifestSchema>;
15223
+ type BuildArtifact = z.infer<typeof BuildArtifactSchema>;
15224
+ type BuildWrapOptions = z.infer<typeof BuildWrapOptionsSchema>;
15225
+ /**
15226
+ * Error codes a result can carry. User-config codes first, then build and
15227
+ * infrastructure codes.
15228
+ */
15229
+ declare const BUILD_ERROR_CODES: readonly ["INVALID_MANIFEST", "TOOLCHAIN_MISMATCH", "INVALID_CONFIG", "MISSING_BUILD_ENV", "WEB_SECRET_REF", "UNSUPPORTED_PACKAGE_SPEC", "LOCAL_PATH_NOT_ALLOWED", "BUILD_FAILED", "UPLOAD_FAILED"];
15230
+ type BuildErrorCode = (typeof BUILD_ERROR_CODES)[number];
15231
+ declare const BuildResultSchema: z.ZodObject<{
15232
+ ok: z.ZodBoolean;
15233
+ toolchain: z.ZodString;
15234
+ artifacts: z.ZodArray<z.ZodObject<{
15235
+ target: z.ZodString;
15236
+ outputName: z.ZodString;
15237
+ bytes: z.ZodNumber;
15238
+ sha256: z.ZodString;
15239
+ }, z.core.$strip>>;
15240
+ error: z.ZodOptional<z.ZodObject<{
15241
+ code: z.ZodEnum<{
15242
+ INVALID_MANIFEST: "INVALID_MANIFEST";
15243
+ TOOLCHAIN_MISMATCH: "TOOLCHAIN_MISMATCH";
15244
+ INVALID_CONFIG: "INVALID_CONFIG";
15245
+ MISSING_BUILD_ENV: "MISSING_BUILD_ENV";
15246
+ WEB_SECRET_REF: "WEB_SECRET_REF";
15247
+ UNSUPPORTED_PACKAGE_SPEC: "UNSUPPORTED_PACKAGE_SPEC";
15248
+ LOCAL_PATH_NOT_ALLOWED: "LOCAL_PATH_NOT_ALLOWED";
15249
+ BUILD_FAILED: "BUILD_FAILED";
15250
+ UPLOAD_FAILED: "UPLOAD_FAILED";
15251
+ }>;
15252
+ message: z.ZodString;
15253
+ outputName: z.ZodOptional<z.ZodString>;
15254
+ }, z.core.$strip>>;
15255
+ }, z.core.$strip>;
15256
+ type BuildResult = z.infer<typeof BuildResultSchema>;
15257
+
15258
+ /**
15259
+ * `walkeros bundle --manifest <source>`: build from a manifest.
15260
+ *
15261
+ * Fetches a manifest (see `schemas/build-manifest.ts`), refuses it unless its
15262
+ * `toolchain` is this CLI's exact version, builds each artifact in order,
15263
+ * PUTs every output to its own URL, and finally PUTs a structured result to
15264
+ * `resultPutUrl`. Web `$env` resolves against `manifest.buildEnv` plus the
15265
+ * flow's `config.bundle.env`, never against this process's environment.
15266
+ *
15267
+ * Messages are written for the orchestrator to show a user, so they never
15268
+ * carry a URL query string (presigned credentials live there).
15269
+ */
15270
+
15271
+ /** Env var a bare `--manifest` reads its source from. */
15272
+ declare const BUILD_MANIFEST_ENV = "BUILD_MANIFEST_URL";
15273
+ interface RunBuildManifestResult {
15274
+ result: BuildResult;
15275
+ /** False when the result could not be PUT (or the manifest was unreadable). */
15276
+ reported: boolean;
15277
+ }
15278
+ /**
15279
+ * Run a manifest build end to end. Never throws: every failure becomes a
15280
+ * result, and `reported` says whether that result reached `resultPutUrl`.
15281
+ */
15282
+ declare function runBuildManifest(source: string): Promise<RunBuildManifestResult>;
15283
+ /** Resolve the `--manifest` value, falling back to the env for a bare flag. */
15284
+ declare function resolveManifestSource(manifest: string | true, env?: Record<string, string | undefined>): string;
15285
+
15120
15286
  interface DeviceAuthorization {
15121
15287
  deviceCode: string;
15122
15288
  userCode: string;
@@ -15684,41 +15850,6 @@ declare function loadConfig<T = unknown>(input: string, options?: {
15684
15850
  */
15685
15851
  declare function loadJsonConfig<T>(configPath: string): Promise<T>;
15686
15852
 
15687
- type StepType = 'source' | 'transformer' | 'destination';
15688
- interface ExampleLookupResult {
15689
- stepType: StepType;
15690
- stepName: string;
15691
- exampleName: string;
15692
- example: {
15693
- in?: unknown;
15694
- mapping?: unknown;
15695
- out?: unknown;
15696
- };
15697
- }
15698
- /**
15699
- * Find a named example in a flow config.
15700
- *
15701
- * Searches sources, transformers, and destinations for a matching example.
15702
- * If --step is provided (e.g. "destination.gtag"), looks only in that step.
15703
- * If not, searches all steps and errors if ambiguous.
15704
- *
15705
- * @param config - Raw (unresolved) flow config with examples intact
15706
- * @param exampleName - Name of the example to find
15707
- * @param stepTarget - Optional step target in "type.name" format
15708
- * @returns The found example with its location
15709
- */
15710
- declare function findExample(config: Flow, exampleName: string, stepTarget?: string): ExampleLookupResult;
15711
-
15712
- /**
15713
- * Compare simulation output against expected example output.
15714
- */
15715
- declare function compareOutput(expected: unknown, actual: unknown): {
15716
- expected: unknown;
15717
- actual: unknown;
15718
- match: boolean;
15719
- diff?: string;
15720
- };
15721
-
15722
15853
  interface EmitterOptions {
15723
15854
  /** Caller supplies the v4 source verbatim (type, platform, etc). */
15724
15855
  source: WalkerOS.Source;
@@ -15872,4 +16003,4 @@ declare module '@walkeros/core' {
15872
16003
  }
15873
16004
  }
15874
16005
 
15875
- export { type AddThreadMessageOptions, ApiError, type ApiErrorDetail, type BuildOptions, type BundleStats, type CLIBuildOptions, type ClientContext, type ClientType, type CompareContractInput, type CompleteDeviceLoginOptions, type ContractComparison, type ContractVerdict, type CreatePreviewOptions, type CreateSecretOptions, type CreateThreadOptions, type DeletePreviewOptions, type DeleteSecretOptions, type DeployOptions, DeploymentAmbiguityError, type DeploymentSummaryForFlow, type DeviceAuthorization, type DeviceLoginResult, type EndObserveSessionOptions, type ExampleLookupResult, type FeedbackOptions, type GetFrameOptions, type GetObserveSessionOptions, type GetPreviewOptions, type GetReleaseOptions, type GlobalOptions, type HealthResult, type ListDeploymentsOptions, type ListFlowsOptions, type ListFramesOptions, type ListJourneysOptions, type ListKnowledgeOptions, type ListPageFramesOptions, type ListPreviewsOptions, type ListProjectsOptions, type ListReleasesOptions, type ListSecretsOptions, type ListStepHistoryOptions, type ListThreadsOptions, type LoginOptions, type LoginResult, type MinifyOptions, type PrepareInput, type PreparedFlow, type ProjectFlows, type PushResult, type RegrantPreviewOptions, type ReleaseDetailResponse, type ReleaseDiffResponse, type ReleaseIndexResponse, type ReleaseRationaleSummary, type ReleaseRef, type RunCommandOptions, type RunOptions, type RunResult, type SSEEvent, type SSEParseResult, type SetReleaseRationaleOptions, type SimulateCollectorOptions, type SimulateDataOptions, type SimulateDestinationOptions, type SimulateSourceOptions, type SimulateTransformerOptions, type StartObserveSessionOptions, type ThreadAnchorType, type ThreadStatus, type UpdateSecretOptions, VERSION, type ValidateResult, type ValidationError, type ValidationType, type ValidationWarning, type WalkerOSConfig, type WrapSkeletonOptions, addThreadMessage, annotateErrorWithDrift, apiFetch, bakedContractHash, bakedContractVersion, buildDataPayload, bundle, bundleCommand, canonicalContractHash, classifyStepProperties, clearAuthFields, clientContextHeaders, compareContract, compareOutput, completeDeviceLogin, containsCodeMarkers, createApiClient, createDeployCommand, createDeployment, createDeploymentCommand, createFlow, createFlowCommand, createPreview, createProject, createProjectCommand, createSecret, createThread, credentialSource, deleteConfig, deleteDeployment, deleteDeploymentByFlowId, deleteDeploymentCommand, deleteFlow, deleteFlowCommand, deletePreview, deleteProject, deleteProjectCommand, deleteSecret, deploy, deployCommand, deployFetch, duplicateFlow, duplicateFlowCommand, endObserveSession, feedback, feedbackCommand, fetchHealth, findExample, getAuthHeaders, getClientContext, getDefaultProject, getDeployment, getDeploymentBySlug, getDeploymentBySlugCommand, getDeploymentCommand, getFeedbackPreference, getFlow, getFlowCommand, getFrame, getObserveSession, getPreview, getProject, getProjectCommand, getRelease, listAllFlows, listDeployments, listDeploymentsCommand, listFlows, listFlowsCommand, listFrames, listJourneys, listKnowledge, listPageFrames, listPreviews, listProjects, listProjectsCommand, listReleases, listSecrets, listStepHistory, listThreads, loadConfig, loadJsonConfig, login, loginCommand, logout, logoutCommand, mergeAuthHeaders, parseSSEEvents, publicFetch, push, pushCommand, readConfig, regrantPreview, requireProjectId, resetClientContext, resolveAccessToken, resolveAppUrl, resolveToken, run, runCommand, setClientContext, setDefaultProject, setFeedbackPreference, setReleaseRationale, simulateCollector, simulateDestination, simulateSource, simulateTransformer, startDeviceAuthorization, startObserveSession, index as telemetry, telemetryDisableCommand, telemetryEnableCommand, telemetryStatusCommand, throwApiError, updateFlow, updateFlowCommand, updateProject, updateProjectCommand, updateSecret, validate, validateCommand, validateFlowStructure, whoami, whoamiCommand, wrapSkeleton, writeConfig };
16006
+ export { type AddThreadMessageOptions, ApiError, type ApiErrorDetail, BUILD_ERROR_CODES, BUILD_MANIFEST_ENV, BUILD_MANIFEST_VERSION, type BuildArtifact, BuildArtifactSchema, BuildBundleArtifactSchema, type BuildErrorCode, type BuildManifest, BuildManifestSchema, type BuildOptions, type BuildResult, BuildResultSchema, BuildWrapArtifactSchema, type BuildWrapOptions, BuildWrapOptionsSchema, type BundleStats, type CLIBuildOptions, type ClientContext, type ClientType, type CompareContractInput, type CompleteDeviceLoginOptions, type ContractComparison, type ContractVerdict, type CreatePreviewOptions, type CreateSecretOptions, type CreateThreadOptions, type DeletePreviewOptions, type DeleteSecretOptions, type DeployOptions, DeploymentAmbiguityError, type DeploymentSummaryForFlow, type DeviceAuthorization, type DeviceLoginResult, type EndObserveSessionOptions, type FeedbackOptions, type GetFrameOptions, type GetObserveSessionOptions, type GetPreviewOptions, type GetReleaseOptions, type GlobalOptions, type HealthResult, type ListDeploymentsOptions, type ListFlowsOptions, type ListFramesOptions, type ListJourneysOptions, type ListKnowledgeOptions, type ListPageFramesOptions, type ListPreviewsOptions, type ListProjectsOptions, type ListReleasesOptions, type ListSecretsOptions, type ListStepHistoryOptions, type ListThreadsOptions, type LoginOptions, type LoginResult, type MinifyOptions, type PrepareInput, type PreparedFlow, type ProjectFlows, type PushResult, type RegrantPreviewOptions, type ReleaseDetailResponse, type ReleaseDiffResponse, type ReleaseIndexResponse, type ReleaseRationaleSummary, type ReleaseRef, type RunBuildManifestResult, type SSEEvent, type SSEParseResult, type SetReleaseRationaleOptions, type SimulateCollectorOptions, type SimulateDataOptions, type SimulateDestinationOptions, type SimulateSourceOptions, type SimulateTransformerOptions, type StartObserveSessionOptions, type ThreadAnchorType, type ThreadStatus, type UpdateSecretOptions, VERSION, type WalkerOSConfig, type WrapSkeletonOptions, addThreadMessage, annotateErrorWithDrift, apiFetch, bakedContractHash, bakedContractVersion, buildDataPayload, bundle, bundleCommand, canonicalContractHash, classifyStepProperties, clearAuthFields, clientContextHeaders, compareContract, completeDeviceLogin, containsCodeMarkers, createApiClient, createDeployCommand, createDeployment, createDeploymentCommand, createFlow, createFlowCommand, createPreview, createProject, createProjectCommand, createSecret, createThread, credentialSource, deleteConfig, deleteDeployment, deleteDeploymentByFlowId, deleteDeploymentCommand, deleteFlow, deleteFlowCommand, deletePreview, deleteProject, deleteProjectCommand, deleteSecret, deploy, deployCommand, deployFetch, duplicateFlow, duplicateFlowCommand, endObserveSession, feedback, feedbackCommand, fetchHealth, getAuthHeaders, getClientContext, getDefaultProject, getDeployment, getDeploymentBySlug, getDeploymentBySlugCommand, getDeploymentCommand, getFeedbackPreference, getFlow, getFlowCommand, getFrame, getObserveSession, getPreview, getProject, getProjectCommand, getRelease, listAllFlows, listDeployments, listDeploymentsCommand, listFlows, listFlowsCommand, listFrames, listJourneys, listKnowledge, listPageFrames, listPreviews, listProjects, listProjectsCommand, listReleases, listSecrets, listStepHistory, listThreads, loadConfig, loadJsonConfig, login, loginCommand, logout, logoutCommand, mergeAuthHeaders, parseSSEEvents, publicFetch, push, pushCommand, readConfig, regrantPreview, requireProjectId, resetClientContext, resolveAccessToken, resolveAppUrl, resolveManifestSource, resolveToken, runBuildManifest, setClientContext, setDefaultProject, setFeedbackPreference, setReleaseRationale, simulateCollector, simulateDestination, simulateSource, simulateTransformer, startDeviceAuthorization, startObserveSession, index as telemetry, telemetryDisableCommand, telemetryEnableCommand, telemetryStatusCommand, throwApiError, updateFlow, updateFlowCommand, updateProject, updateProjectCommand, updateSecret, validate, validateCommand, whoami, whoamiCommand, wrapSkeleton, writeConfig };