@walkeros/cli 4.7.0-next-1790245733116 → 4.7.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 +136 -48
- package/README.md +11 -5
- package/dist/cli.js +9186 -6548
- package/dist/dev.d.ts +7 -0
- package/dist/dev.js +17 -2
- package/dist/dev.js.map +1 -1
- package/dist/examples/README.md +47 -213
- package/dist/examples/customers/README.md +18 -0
- package/dist/examples/customers/cust-1001 +1 -0
- package/dist/examples/customers/cust-42 +1 -0
- package/dist/examples/flow-complete.json +4760 -592
- package/dist/examples/flow-complete.md +884 -225
- package/dist/examples/index.d.ts +2681 -1
- package/dist/examples/index.js +6882 -659
- package/dist/examples/index.js.map +1 -1
- package/dist/examples/shared/README.md +22 -0
- package/dist/index.d.ts +297 -24
- package/dist/index.js +2767 -884
- package/dist/index.js.map +1 -1
- package/examples/README.md +47 -213
- package/examples/customers/README.md +18 -0
- package/examples/customers/cust-1001 +1 -0
- package/examples/customers/cust-42 +1 -0
- package/examples/flow-complete.json +4760 -592
- package/examples/flow-complete.md +884 -225
- package/examples/shared/README.md +22 -0
- package/package.json +31 -8
- package/dist/examples/docker-compose.runner.yml +0 -44
- package/examples/docker-compose.runner.yml +0 -44
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# shared
|
|
2
|
+
|
|
3
|
+
Files the server flow of `flow-complete.json` serves first party.
|
|
4
|
+
|
|
5
|
+
- Root `include: ["./shared"]` ships this folder next to the server artifact.
|
|
6
|
+
- The `assets` store (`@walkeros/server-store-fs`,
|
|
7
|
+
`basePath: "$env.ASSETS_DIR:./shared"`) reads from it, and the `file`
|
|
8
|
+
transformer answers `GET /walker.js` with it.
|
|
9
|
+
- `walker.js` is generated, not committed. Build the web flow straight into this
|
|
10
|
+
folder (web builds ignore root `include`):
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
walkeros bundle packages/cli/examples/flow-complete.json -f web -o packages/cli/examples/shared/walker.js
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- Then build and start the server flow; the artifact carries its own copy of
|
|
17
|
+
this folder:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
walkeros bundle packages/cli/examples/flow-complete.json -f server -o dist/server.mjs
|
|
21
|
+
runneros start dist/server.mjs -p 8080 --env-file .env
|
|
22
|
+
```
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Flow, PreviewKey, Elb, Ingest, WalkerOS,
|
|
1
|
+
import { Flow, PreviewKey, Elb, Simulation, Ingest, WalkerOS, ObserveWeb } from '@walkeros/core';
|
|
2
2
|
export { Flow } from '@walkeros/core';
|
|
3
3
|
import { BuildOptions as BuildOptions$1 } from 'esbuild';
|
|
4
|
-
import { z,
|
|
5
|
-
export {
|
|
4
|
+
import { z, ValidateResult as ValidateResult$1, ValidationError as ValidationError$1, ValidationWarning as ValidationWarning$1, ValidationType } from '@walkeros/core/dev';
|
|
5
|
+
export { ValidationType, validateFlowStructure } from '@walkeros/core/dev';
|
|
6
6
|
import * as openapi_fetch from 'openapi-fetch';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -102,8 +102,9 @@ interface BuildOptions extends CLIBuildOptions {
|
|
|
102
102
|
*/
|
|
103
103
|
minifyOptions?: MinifyOptions;
|
|
104
104
|
/**
|
|
105
|
-
* Window property name for collector (web platform only).
|
|
106
|
-
*
|
|
105
|
+
* Window property name for collector (web platform only). Set from the
|
|
106
|
+
* flow's `config.settings.windowCollector`.
|
|
107
|
+
* @default "walkerOS"
|
|
107
108
|
*/
|
|
108
109
|
windowCollector?: string;
|
|
109
110
|
/**
|
|
@@ -267,7 +268,7 @@ interface BundleCommandOptions {
|
|
|
267
268
|
cache?: boolean;
|
|
268
269
|
verbose?: boolean;
|
|
269
270
|
silent?: boolean;
|
|
270
|
-
/**
|
|
271
|
+
/** Release id baked into config.collector.release. Beats an authored one. */
|
|
271
272
|
release?: string;
|
|
272
273
|
}
|
|
273
274
|
declare function bundleCommand(options: BundleCommandOptions): Promise<void>;
|
|
@@ -313,8 +314,9 @@ declare function bundle(configOrPath: unknown, options?: {
|
|
|
313
314
|
cache?: boolean;
|
|
314
315
|
flowName?: string;
|
|
315
316
|
/**
|
|
316
|
-
*
|
|
317
|
-
*
|
|
317
|
+
* Release id baked into `config.collector.release`, stamping this flow's
|
|
318
|
+
* entry in `event.source.release` at runtime. Beats an authored release;
|
|
319
|
+
* omitted, the release is a content id of config, packages and CLI.
|
|
318
320
|
*/
|
|
319
321
|
release?: string;
|
|
320
322
|
/**
|
|
@@ -432,6 +434,29 @@ interface PushCommandOptions {
|
|
|
432
434
|
* request decoder reads `ingest.url`). Forwarded to `simulateTransformer`.
|
|
433
435
|
*/
|
|
434
436
|
ingest?: Omit<Ingest, '_meta'>;
|
|
437
|
+
/**
|
|
438
|
+
* Raw `--ingest` flag value (JSON string, file path or URL). Loaded as a
|
|
439
|
+
* JSON object and used as `ingest` for transformer, collector and
|
|
440
|
+
* destination simulation.
|
|
441
|
+
*/
|
|
442
|
+
ingestSource?: string;
|
|
443
|
+
/**
|
|
444
|
+
* The collector's starting consent for a simulated transformer, collector
|
|
445
|
+
* or destination. Forwarded as `consent` (collector: `state.consent`).
|
|
446
|
+
*/
|
|
447
|
+
consent?: WalkerOS.Consent;
|
|
448
|
+
/**
|
|
449
|
+
* Raw `--consent` flag value (JSON string, file path or URL). Loaded as an
|
|
450
|
+
* object of booleans and used as `consent`.
|
|
451
|
+
*/
|
|
452
|
+
consentSource?: string;
|
|
453
|
+
/**
|
|
454
|
+
* `--command`: a simulated destination runs `collector.command(command,
|
|
455
|
+
* event)` instead of pushing the event (step examples with `command`).
|
|
456
|
+
*/
|
|
457
|
+
command?: Flow.StepCommand;
|
|
458
|
+
/** `--page-url`: the page URL of a simulated web source. */
|
|
459
|
+
pageUrl?: string;
|
|
435
460
|
}
|
|
436
461
|
/**
|
|
437
462
|
* Push execution result
|
|
@@ -443,6 +468,11 @@ interface PushResult {
|
|
|
443
468
|
networkCalls?: NetworkCall[];
|
|
444
469
|
duration: number;
|
|
445
470
|
error?: string;
|
|
471
|
+
/**
|
|
472
|
+
* One result per simulated step, in order (`--simulate`). A multi
|
|
473
|
+
* destination run stops at the first failure, which is the last entry.
|
|
474
|
+
*/
|
|
475
|
+
simulations?: Simulation.Result[];
|
|
446
476
|
}
|
|
447
477
|
|
|
448
478
|
/**
|
|
@@ -472,6 +502,15 @@ type PushOptions = z.infer<typeof PushOptionsSchema>;
|
|
|
472
502
|
* `runPushCommand` directly to avoid `process.exit` killing Jest workers.
|
|
473
503
|
*/
|
|
474
504
|
declare function pushCommand(options: PushCommandOptions): Promise<void>;
|
|
505
|
+
/**
|
|
506
|
+
* Text output of `walkeros push`: the outcome, the push result or one block
|
|
507
|
+
* per simulated step (its mapping, why nothing was sent, recorded calls), the
|
|
508
|
+
* error, the duration. Call arguments are scrubbed here (before their cut),
|
|
509
|
+
* masking `knownSecrets`; `pushCommand` scrubs the whole text at egress.
|
|
510
|
+
*/
|
|
511
|
+
declare function formatPushResult(result: PushResult, options?: {
|
|
512
|
+
knownSecrets?: readonly string[];
|
|
513
|
+
}): string;
|
|
475
514
|
/**
|
|
476
515
|
* High-level push function for programmatic usage.
|
|
477
516
|
*
|
|
@@ -499,6 +538,16 @@ declare function push(configOrPath: string | unknown, event: unknown, options?:
|
|
|
499
538
|
platform?: Platform;
|
|
500
539
|
mock?: string[];
|
|
501
540
|
snapshot?: string;
|
|
541
|
+
/**
|
|
542
|
+
* The config at `configOrPath`, already read by the caller: used as is,
|
|
543
|
+
* the path is not read again (it still anchors relative paths).
|
|
544
|
+
*/
|
|
545
|
+
raw?: unknown;
|
|
546
|
+
/**
|
|
547
|
+
* Values masked in the flow's logs. Defaults to the values of the
|
|
548
|
+
* secrets the config references (see `collectKnownSecrets`).
|
|
549
|
+
*/
|
|
550
|
+
knownSecrets?: readonly string[];
|
|
502
551
|
}): Promise<PushResult>;
|
|
503
552
|
/**
|
|
504
553
|
* Shared data-injection seam for all simulate functions.
|
|
@@ -522,12 +571,26 @@ interface SimulateDataOptions {
|
|
|
522
571
|
data?: Record<string, unknown>;
|
|
523
572
|
}
|
|
524
573
|
interface SimulateSourceOptions extends SimulateDataOptions {
|
|
574
|
+
/** Log to stderr so stdout carries only the result (`push --json`). */
|
|
575
|
+
json?: boolean;
|
|
525
576
|
sourceId: string;
|
|
526
577
|
bundlePath?: string;
|
|
527
578
|
flow?: string;
|
|
528
579
|
silent?: boolean;
|
|
529
580
|
verbose?: boolean;
|
|
530
581
|
snapshot?: string;
|
|
582
|
+
/**
|
|
583
|
+
* Web sources only: the absolute URL of the simulated page. Defaults to the
|
|
584
|
+
* input trigger's `options.url` when it is a string, else
|
|
585
|
+
* `http://localhost`.
|
|
586
|
+
*/
|
|
587
|
+
pageUrl?: string;
|
|
588
|
+
/**
|
|
589
|
+
* The collector's starting consent, handed to `startFlow` as its state
|
|
590
|
+
* (e.g. the consent a gated source such as the session source waits for).
|
|
591
|
+
* Never recorded as a call: only the source's own commands are.
|
|
592
|
+
*/
|
|
593
|
+
consent?: WalkerOS.Consent;
|
|
531
594
|
}
|
|
532
595
|
/**
|
|
533
596
|
* Self-contained source simulation.
|
|
@@ -541,6 +604,8 @@ interface SimulateSourceOptions extends SimulateDataOptions {
|
|
|
541
604
|
*/
|
|
542
605
|
declare function simulateSource(configOrPath: string | Flow.Json, input: unknown, options: SimulateSourceOptions): Promise<Simulation.Result>;
|
|
543
606
|
interface SimulateTransformerOptions extends SimulateDataOptions {
|
|
607
|
+
/** Log to stderr so stdout carries only the result (`push --json`). */
|
|
608
|
+
json?: boolean;
|
|
544
609
|
transformerId: string;
|
|
545
610
|
bundlePath?: string;
|
|
546
611
|
flow?: string;
|
|
@@ -554,6 +619,8 @@ interface SimulateTransformerOptions extends SimulateDataOptions {
|
|
|
554
619
|
* present; provide only the keys the step reads.
|
|
555
620
|
*/
|
|
556
621
|
ingest?: Omit<Ingest, '_meta'>;
|
|
622
|
+
/** The collector's starting consent, handed to `startFlow` as its state. */
|
|
623
|
+
consent?: WalkerOS.Consent;
|
|
557
624
|
}
|
|
558
625
|
/**
|
|
559
626
|
* Self-contained transformer simulation.
|
|
@@ -568,6 +635,8 @@ interface SimulateTransformerOptions extends SimulateDataOptions {
|
|
|
568
635
|
*/
|
|
569
636
|
declare function simulateTransformer(configOrPath: string | Flow.Json, event: WalkerOS.DeepPartialEvent, options: SimulateTransformerOptions): Promise<Simulation.Result>;
|
|
570
637
|
interface SimulateCollectorOptions extends SimulateDataOptions {
|
|
638
|
+
/** Log to stderr so stdout carries only the result (`push --json`). */
|
|
639
|
+
json?: boolean;
|
|
571
640
|
collectorName: string;
|
|
572
641
|
bundlePath?: string;
|
|
573
642
|
flow?: string;
|
|
@@ -582,6 +651,12 @@ interface SimulateCollectorOptions extends SimulateDataOptions {
|
|
|
582
651
|
globals?: WalkerOS.Properties;
|
|
583
652
|
timing?: number;
|
|
584
653
|
};
|
|
654
|
+
/**
|
|
655
|
+
* Pipeline context the collector's chain (`collector.next`) reads via
|
|
656
|
+
* `ctx.ingest`. Merged onto a fresh ingest so `_meta` is always the
|
|
657
|
+
* runtime's.
|
|
658
|
+
*/
|
|
659
|
+
ingest?: Omit<Ingest, '_meta'>;
|
|
585
660
|
}
|
|
586
661
|
/**
|
|
587
662
|
* Self-contained collector simulation.
|
|
@@ -595,6 +670,8 @@ interface SimulateCollectorOptions extends SimulateDataOptions {
|
|
|
595
670
|
*/
|
|
596
671
|
declare function simulateCollector(configOrPath: string | Flow.Json, event: WalkerOS.DeepPartialEvent, options: SimulateCollectorOptions): Promise<Simulation.Result>;
|
|
597
672
|
interface SimulateDestinationOptions extends SimulateDataOptions {
|
|
673
|
+
/** Log to stderr so stdout carries only the result (`push --json`). */
|
|
674
|
+
json?: boolean;
|
|
598
675
|
destinationId: string;
|
|
599
676
|
bundlePath?: string;
|
|
600
677
|
flow?: string;
|
|
@@ -602,18 +679,120 @@ interface SimulateDestinationOptions extends SimulateDataOptions {
|
|
|
602
679
|
silent?: boolean;
|
|
603
680
|
verbose?: boolean;
|
|
604
681
|
snapshot?: string;
|
|
682
|
+
/**
|
|
683
|
+
* Pipeline context the destination's `before` chain and push read via
|
|
684
|
+
* `ctx.ingest` (e.g. `userAgent` for a conversion API). Merged onto a
|
|
685
|
+
* fresh ingest so `_meta` is always the runtime's.
|
|
686
|
+
*/
|
|
687
|
+
ingest?: Omit<Ingest, '_meta'>;
|
|
688
|
+
/**
|
|
689
|
+
* The collector's starting consent: handed to `startFlow` as its initial
|
|
690
|
+
* state, which applies it pre-run as a consent command that only the target
|
|
691
|
+
* (the one registered destination) hears. A `require: ["consent"]`
|
|
692
|
+
* destination starts, the consent gate sees it, and a Consent Mode target
|
|
693
|
+
* records its consent update. The event's own consent still applies.
|
|
694
|
+
*/
|
|
695
|
+
consent?: WalkerOS.Consent;
|
|
696
|
+
/**
|
|
697
|
+
* Run `collector.command(command, event)` instead of pushing the event: a
|
|
698
|
+
* step example with `command` (e.g. `consent`), whose `in` is the command's
|
|
699
|
+
* data. With `consent`, the starting state applies first, then the command.
|
|
700
|
+
*/
|
|
701
|
+
command?: Flow.StepCommand;
|
|
605
702
|
}
|
|
606
703
|
/**
|
|
607
704
|
* Self-contained destination simulation.
|
|
608
705
|
*
|
|
609
706
|
* Takes a DeepPartialEvent, validates it with Zod, loads the flow config,
|
|
610
|
-
* bundles it, starts the flow
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
*
|
|
707
|
+
* bundles it, then starts the flow with ONLY the target destination (no
|
|
708
|
+
* other destination initializes against its real env) and `consent` as the
|
|
709
|
+
* collector's starting state. It pushes the event through the full pipeline
|
|
710
|
+
* (consent checks, event mapping, createEvent enrichment, before chains), or
|
|
711
|
+
* runs `command` with the event as its data. When nothing was sent, the
|
|
712
|
+
* result's `skipped` says why, from the collector's own records.
|
|
614
713
|
*/
|
|
615
|
-
declare function simulateDestination(configOrPath: string | Flow.Json, event: WalkerOS.DeepPartialEvent, options: SimulateDestinationOptions): Promise<Simulation.Result>;
|
|
714
|
+
declare function simulateDestination(configOrPath: string | Flow.Json, event: WalkerOS.DeepPartialEvent | Record<string, unknown>, options: SimulateDestinationOptions): Promise<Simulation.Result>;
|
|
616
715
|
|
|
716
|
+
/**
|
|
717
|
+
* Validate Command Schemas
|
|
718
|
+
*
|
|
719
|
+
* Zod schemas for validate command parameter validation.
|
|
720
|
+
*/
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Validate options schema.
|
|
724
|
+
*
|
|
725
|
+
* @remarks
|
|
726
|
+
* Options for the programmatic validate() API.
|
|
727
|
+
*/
|
|
728
|
+
declare const ValidateOptionsSchema: z.ZodObject<{
|
|
729
|
+
flow: z.ZodOptional<z.ZodString>;
|
|
730
|
+
path: z.ZodOptional<z.ZodString>;
|
|
731
|
+
strict: z.ZodOptional<z.ZodBoolean>;
|
|
732
|
+
offline: z.ZodOptional<z.ZodBoolean>;
|
|
733
|
+
configDir: z.ZodOptional<z.ZodString>;
|
|
734
|
+
}, z.core.$strip>;
|
|
735
|
+
type ValidateOptions = z.infer<typeof ValidateOptionsSchema>;
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* Every code an error, warning or skip of `validate` can carry. Agents and
|
|
739
|
+
* tests branch on these, never on message text.
|
|
740
|
+
*/
|
|
741
|
+
declare const VALIDATE_CODES: readonly ["INPUT_ERROR", "SERIALIZATION_ERROR", "OPTION_NOT_APPLICABLE", "FLOW_NOT_FOUND", "ENTRY_NOT_FOUND", "AMBIGUOUS_ENTRY", "UNSUPPORTED_SECTION", "INVALID_PATH", "SCHEMA_VALIDATION", "CONFIG_WARNING", "EMPTY_FLOWS", "UNKNOWN_KEY", "CONFLICT", "MISSING_PACKAGE", "OBSOLETE_CODE_STRING", "INVALID_IMPORT", "INVALID_CODE_SHAPE", "PACKAGE_VERSION_MISSING", "DEPRECATED_PACKAGE", "UNKNOWN_ROUTE_TARGET", "ROUTE_DEAD_CODE", "ROUTE_EMPTY_MANY", "ROUTE_SINGLE_MANY", "ROUTE_FIRST_MATCH", "INCOMPATIBLE_EXAMPLES", "EXAMPLES_INCOMPLETE", "CONTRACT_VIOLATION", "MAPPING_DOT_KEY", "FLOW_REF_WARNING", "FLOW_CYCLE", "VAR_CYCLE", "INVALID_COMPONENT_NAME", "INVALID_REFERENCE", "STORE_REFERENCE_NOT_FOUND", "UNRESOLVED_REFERENCE", "MISSING_ENV", "WEB_SECRET_REF", "UNRESOLVED_CONTRACT", "ENTRY_SCHEMA", "NO_CONTRACT_SECTION", "INVALID_CONTRACT", "FLAT_CONTRACT_SHAPE", "INVALID_CONTRACT_ENTRY", "UNKNOWN_CONTRACT_KEY", "INVALID_TAGGING", "INVALID_SCHEMA", "INVALID_EXTENDS", "INVALID_SECTION", "INVALID_EVENTS", "CIRCULAR_EXTENDS", "INVALID_ENTITY_KEY", "INVALID_ENTITY", "INVALID_ACTION_KEY", "INVALID_SCHEMA_ENTRY", "NOT_AN_OBJECT", "MISSING_EVENT_NAME", "EMPTY_EVENT_NAME", "INVALID_EVENT_NAME", "INVALID_MAPPING_TYPE", "INVALID_EVENT_PATTERN", "INVALID_RULE_TYPE", "CATCH_ALL_NOT_LAST", "GATED_BY_ERRORS", "CONTRACT_NOT_STATIC", "NO_PACKAGE", "NO_SETTINGS_SCHEMA", "SCHEMA_UNAVAILABLE"];
|
|
742
|
+
type ValidateCode = (typeof VALIDATE_CODES)[number];
|
|
743
|
+
/**
|
|
744
|
+
* Named checks a run includes (`details.scope.checks`). `file:` checks run
|
|
745
|
+
* on the whole file whatever `--flow` says; `flow:` checks run per flow in
|
|
746
|
+
* scope; `entry:` checks run per entry `--path` addressed.
|
|
747
|
+
*/
|
|
748
|
+
type ValidateCheck = 'file:schema' | 'file:contract' | 'flow:schema' | 'flow:steps' | 'flow:structure' | 'flow:package-versions' | 'flow:routes' | 'flow:examples' | 'flow:contract-examples' | 'flow:mapping-keys' | 'flow:resolve' | 'flow:package-settings' | 'entry:settings' | 'contract' | 'event' | 'mapping';
|
|
749
|
+
interface ValidateScopeEntry {
|
|
750
|
+
/** Section of the addressed entry, when the path or the match names one. */
|
|
751
|
+
section?: string;
|
|
752
|
+
key: string;
|
|
753
|
+
/** Flows that have the entry and were checked. */
|
|
754
|
+
flows: string[];
|
|
755
|
+
/** Flows searched for the entry. */
|
|
756
|
+
searchedFlows: string[];
|
|
757
|
+
}
|
|
758
|
+
/** What a run covered (C6). */
|
|
759
|
+
interface ValidateScope {
|
|
760
|
+
flows: string[];
|
|
761
|
+
entry?: ValidateScopeEntry;
|
|
762
|
+
checks: ValidateCheck[];
|
|
763
|
+
/** Set when `offline` removed the package settings check from `checks`. */
|
|
764
|
+
offline?: true;
|
|
765
|
+
}
|
|
766
|
+
/** A check the scope includes that did not run (C5). */
|
|
767
|
+
interface ValidateSkip {
|
|
768
|
+
path: string;
|
|
769
|
+
check: ValidateCheck;
|
|
770
|
+
reason: string;
|
|
771
|
+
code: ValidateCode;
|
|
772
|
+
}
|
|
773
|
+
/** A value known only at runtime, not schema-checked (info, not a skip). */
|
|
774
|
+
interface ValidateDeferred {
|
|
775
|
+
path: string;
|
|
776
|
+
reference: string;
|
|
777
|
+
}
|
|
778
|
+
interface ValidateDetails {
|
|
779
|
+
scope?: ValidateScope;
|
|
780
|
+
skipped?: ValidateSkip[];
|
|
781
|
+
deferred?: ValidateDeferred[];
|
|
782
|
+
[key: string]: unknown;
|
|
783
|
+
}
|
|
784
|
+
interface ValidationError extends ValidationError$1 {
|
|
785
|
+
/** The JSON Schema keyword of an ENTRY_SCHEMA error. */
|
|
786
|
+
keyword?: string;
|
|
787
|
+
}
|
|
788
|
+
interface ValidationWarning extends ValidationWarning$1 {
|
|
789
|
+
keyword?: string;
|
|
790
|
+
}
|
|
791
|
+
interface ValidateResult extends ValidateResult$1 {
|
|
792
|
+
errors: ValidationError[];
|
|
793
|
+
warnings: ValidationWarning[];
|
|
794
|
+
details: ValidateDetails;
|
|
795
|
+
}
|
|
617
796
|
interface ValidateCommandOptions {
|
|
618
797
|
type: ValidationType;
|
|
619
798
|
input?: string;
|
|
@@ -623,6 +802,8 @@ interface ValidateCommandOptions {
|
|
|
623
802
|
json?: boolean;
|
|
624
803
|
verbose?: boolean;
|
|
625
804
|
strict?: boolean;
|
|
805
|
+
/** Skip every package settings check (no network); named in the scope. */
|
|
806
|
+
offline?: boolean;
|
|
626
807
|
silent?: boolean;
|
|
627
808
|
}
|
|
628
809
|
|
|
@@ -632,11 +813,7 @@ interface ValidateCommandOptions {
|
|
|
632
813
|
*
|
|
633
814
|
* Accepts parsed objects, JSON strings, file paths, or URLs as input.
|
|
634
815
|
*/
|
|
635
|
-
declare function validate(type: ValidationType, input: unknown, options?:
|
|
636
|
-
flow?: string;
|
|
637
|
-
path?: string;
|
|
638
|
-
strict?: boolean;
|
|
639
|
-
}): Promise<ValidateResult>;
|
|
816
|
+
declare function validate(type: ValidationType, input: unknown, options?: ValidateOptions): Promise<ValidateResult>;
|
|
640
817
|
/**
|
|
641
818
|
* CLI command handler for validate command.
|
|
642
819
|
*/
|
|
@@ -15239,11 +15416,11 @@ declare const BuildResultSchema: z.ZodObject<{
|
|
|
15239
15416
|
}, z.core.$strip>>;
|
|
15240
15417
|
error: z.ZodOptional<z.ZodObject<{
|
|
15241
15418
|
code: z.ZodEnum<{
|
|
15419
|
+
WEB_SECRET_REF: "WEB_SECRET_REF";
|
|
15242
15420
|
INVALID_MANIFEST: "INVALID_MANIFEST";
|
|
15243
15421
|
TOOLCHAIN_MISMATCH: "TOOLCHAIN_MISMATCH";
|
|
15244
15422
|
INVALID_CONFIG: "INVALID_CONFIG";
|
|
15245
15423
|
MISSING_BUILD_ENV: "MISSING_BUILD_ENV";
|
|
15246
|
-
WEB_SECRET_REF: "WEB_SECRET_REF";
|
|
15247
15424
|
UNSUPPORTED_PACKAGE_SPEC: "UNSUPPORTED_PACKAGE_SPEC";
|
|
15248
15425
|
LOCAL_PATH_NOT_ALLOWED: "LOCAL_PATH_NOT_ALLOWED";
|
|
15249
15426
|
BUILD_FAILED: "BUILD_FAILED";
|
|
@@ -15255,6 +15432,26 @@ declare const BuildResultSchema: z.ZodObject<{
|
|
|
15255
15432
|
}, z.core.$strip>;
|
|
15256
15433
|
type BuildResult = z.infer<typeof BuildResultSchema>;
|
|
15257
15434
|
|
|
15435
|
+
/**
|
|
15436
|
+
* One retry policy for every network call of a manifest build: the manifest
|
|
15437
|
+
* download, a skeleton download and each PUT. A transient failure (the fetch
|
|
15438
|
+
* rejects, times out, or answers 5xx or 429) is retried; any other status
|
|
15439
|
+
* fails at once, since an expired or wrong presign never heals.
|
|
15440
|
+
*
|
|
15441
|
+
* Messages never carry the URL, its query or a header value: presigned
|
|
15442
|
+
* credentials live there.
|
|
15443
|
+
*/
|
|
15444
|
+
interface FetchRetryOptions {
|
|
15445
|
+
/** Names the call in warnings and errors, e.g. `Manifest download`. */
|
|
15446
|
+
label: string;
|
|
15447
|
+
/** Per-attempt timeout; each attempt gets a fresh signal. */
|
|
15448
|
+
timeoutMs: number;
|
|
15449
|
+
/** Called once per retry with a ready-to-print line. */
|
|
15450
|
+
warn?: (message: string) => void;
|
|
15451
|
+
/** Injectable for tests. */
|
|
15452
|
+
sleep?: (ms: number) => Promise<void>;
|
|
15453
|
+
}
|
|
15454
|
+
|
|
15258
15455
|
/**
|
|
15259
15456
|
* `walkeros bundle --manifest <source>`: build from a manifest.
|
|
15260
15457
|
*
|
|
@@ -15270,6 +15467,8 @@ type BuildResult = z.infer<typeof BuildResultSchema>;
|
|
|
15270
15467
|
|
|
15271
15468
|
/** Env var a bare `--manifest` reads its source from. */
|
|
15272
15469
|
declare const BUILD_MANIFEST_ENV = "BUILD_MANIFEST_URL";
|
|
15470
|
+
/** Retry hooks for the build's network calls; see `fetchWithRetry`. */
|
|
15471
|
+
type BuildRetryOptions = Pick<FetchRetryOptions, 'warn' | 'sleep'>;
|
|
15273
15472
|
interface RunBuildManifestResult {
|
|
15274
15473
|
result: BuildResult;
|
|
15275
15474
|
/** False when the result could not be PUT (or the manifest was unreadable). */
|
|
@@ -15278,8 +15477,10 @@ interface RunBuildManifestResult {
|
|
|
15278
15477
|
/**
|
|
15279
15478
|
* Run a manifest build end to end. Never throws: every failure becomes a
|
|
15280
15479
|
* result, and `reported` says whether that result reached `resultPutUrl`.
|
|
15480
|
+
* Each download and upload retries transient failures; `retry.warn` hears
|
|
15481
|
+
* about every retry.
|
|
15281
15482
|
*/
|
|
15282
|
-
declare function runBuildManifest(source: string): Promise<RunBuildManifestResult>;
|
|
15483
|
+
declare function runBuildManifest(source: string, retry?: BuildRetryOptions): Promise<RunBuildManifestResult>;
|
|
15283
15484
|
/** Resolve the `--manifest` value, falling back to the env for a bare flag. */
|
|
15284
15485
|
declare function resolveManifestSource(manifest: string | true, env?: Record<string, string | undefined>): string;
|
|
15285
15486
|
|
|
@@ -15424,9 +15625,9 @@ interface ClientContext {
|
|
|
15424
15625
|
/**
|
|
15425
15626
|
* Set the client context used to identify this process to the walkerOS app.
|
|
15426
15627
|
*
|
|
15427
|
-
* The CLI binary calls this at startup
|
|
15428
|
-
*
|
|
15429
|
-
*
|
|
15628
|
+
* The CLI binary calls this at startup and the MCP server calls it on boot.
|
|
15629
|
+
* The `WALKEROS_CLIENT_TYPE` env var overrides the resolved type (env wins
|
|
15630
|
+
* over `input.type`).
|
|
15430
15631
|
*/
|
|
15431
15632
|
declare function setClientContext(input: {
|
|
15432
15633
|
type?: ClientType;
|
|
@@ -15850,6 +16051,74 @@ declare function loadConfig<T = unknown>(input: string, options?: {
|
|
|
15850
16051
|
*/
|
|
15851
16052
|
declare function loadJsonConfig<T>(configPath: string): Promise<T>;
|
|
15852
16053
|
|
|
16054
|
+
/**
|
|
16055
|
+
* The values of every `$secret.NAME` the flow references, read from `env`.
|
|
16056
|
+
* Names that are unset or empty there are ignored. Hand the result to
|
|
16057
|
+
* `scrubSecrets(line, { known })` or the logger's `knownSecrets` so a secret
|
|
16058
|
+
* value is masked whatever its shape.
|
|
16059
|
+
*/
|
|
16060
|
+
declare function collectKnownSecrets(flow: Flow.Json, env?: NodeJS.ProcessEnv): string[];
|
|
16061
|
+
|
|
16062
|
+
/**
|
|
16063
|
+
* Shared resolver for the export name to import from a flow component's
|
|
16064
|
+
* package.
|
|
16065
|
+
*
|
|
16066
|
+
* Both `walkeros bundle` and `walkeros setup` need to know which named export
|
|
16067
|
+
* (or default) to pull off a package referenced by a flow component. The
|
|
16068
|
+
* precedence chain is:
|
|
16069
|
+
*
|
|
16070
|
+
* 1. `flow.<kind>.<id>.import` if set (named export selector at the step).
|
|
16071
|
+
* 2. `flow.config.bundle.packages[<package>].imports[0]` if set.
|
|
16072
|
+
* 3. Otherwise undefined; the caller falls back to the package's `default`
|
|
16073
|
+
* export.
|
|
16074
|
+
*
|
|
16075
|
+
* This lives in `cli/src/core/` so both `commands/bundle/*` and
|
|
16076
|
+
* `commands/setup/*` import the same function. Duplicating the chain is how
|
|
16077
|
+
* setup ended up out of sync with bundle (Bug F: `setup destination.pubsub`
|
|
16078
|
+
* routed through BigQuery's setup because it ignored the `code` field and
|
|
16079
|
+
* always grabbed `mod.default`).
|
|
16080
|
+
*/
|
|
16081
|
+
|
|
16082
|
+
type ComponentKind = 'source' | 'transformer' | 'destination' | 'store';
|
|
16083
|
+
type ResolveSource = 'import' | 'imports' | 'default';
|
|
16084
|
+
interface ResolvedExportName {
|
|
16085
|
+
/**
|
|
16086
|
+
* The named export to pull off the imported module, or `undefined` to
|
|
16087
|
+
* indicate the caller should use the package's `default` export.
|
|
16088
|
+
*/
|
|
16089
|
+
exportName: string | undefined;
|
|
16090
|
+
/** Which precedence step produced the result (useful for diagnostics). */
|
|
16091
|
+
source: ResolveSource;
|
|
16092
|
+
}
|
|
16093
|
+
/**
|
|
16094
|
+
* Resolve the export name to import for a flow component's package.
|
|
16095
|
+
*
|
|
16096
|
+
* See module docs for the precedence chain. Inline code (`code` is an object)
|
|
16097
|
+
* doesn't enter this resolver at all — setup rejects inline code at a higher
|
|
16098
|
+
* layer.
|
|
16099
|
+
*/
|
|
16100
|
+
declare function resolveExportName(flow: Flow, kind: ComponentKind, id: string): ResolvedExportName;
|
|
16101
|
+
|
|
16102
|
+
/**
|
|
16103
|
+
* Selects the dev examples of one export from a package's awaited `/dev`
|
|
16104
|
+
* module.
|
|
16105
|
+
*
|
|
16106
|
+
* A package with several exports (`walkerOS.exports` in its package.json)
|
|
16107
|
+
* ships `exportExamples`, a map from export name to that export's examples,
|
|
16108
|
+
* the default export included. A package with one export ships only
|
|
16109
|
+
* `examples`.
|
|
16110
|
+
*
|
|
16111
|
+
* - Map present, export named: `exportExamples[exportName]`. A name missing
|
|
16112
|
+
* from the map resolves to `undefined`, never to another export's examples.
|
|
16113
|
+
* - Map present, no export name (the step uses the default export):
|
|
16114
|
+
* `examples`, which by convention holds the default export's examples.
|
|
16115
|
+
* - No map: `examples`.
|
|
16116
|
+
*
|
|
16117
|
+
* `exportName` comes from `resolveExportName` (step `import`, else
|
|
16118
|
+
* `bundle.packages[pkg].imports[0]`, else default).
|
|
16119
|
+
*/
|
|
16120
|
+
declare function selectDevExamples(devModule: unknown, exportName: string | undefined): Record<string, unknown> | undefined;
|
|
16121
|
+
|
|
15853
16122
|
interface EmitterOptions {
|
|
15854
16123
|
/** Caller supplies the v4 source verbatim (type, platform, etc). */
|
|
15855
16124
|
source: WalkerOS.Source;
|
|
@@ -15975,6 +16244,8 @@ type PrepareInput = {
|
|
|
15975
16244
|
mock?: string[];
|
|
15976
16245
|
silent?: boolean;
|
|
15977
16246
|
verbose?: boolean;
|
|
16247
|
+
/** Log to stderr so stdout carries only the result. */
|
|
16248
|
+
json?: boolean;
|
|
15978
16249
|
} | {
|
|
15979
16250
|
mode: 'prebuilt';
|
|
15980
16251
|
bundlePath: string;
|
|
@@ -15984,6 +16255,8 @@ type PrepareInput = {
|
|
|
15984
16255
|
mock?: string[];
|
|
15985
16256
|
silent?: boolean;
|
|
15986
16257
|
verbose?: boolean;
|
|
16258
|
+
/** Log to stderr so stdout carries only the result. */
|
|
16259
|
+
json?: boolean;
|
|
15987
16260
|
};
|
|
15988
16261
|
interface PreparedFlow {
|
|
15989
16262
|
bundlePath: string;
|
|
@@ -16003,4 +16276,4 @@ declare module '@walkeros/core' {
|
|
|
16003
16276
|
}
|
|
16004
16277
|
}
|
|
16005
16278
|
|
|
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 };
|
|
16279
|
+
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, VALIDATE_CODES, VERSION, type ValidateCheck, type ValidateCode, type ValidateDeferred, type ValidateResult, type ValidateScope, type ValidateSkip, type ValidationError, type ValidationWarning, type WalkerOSConfig, type WrapSkeletonOptions, addThreadMessage, annotateErrorWithDrift, apiFetch, bakedContractHash, bakedContractVersion, buildDataPayload, bundle, bundleCommand, canonicalContractHash, classifyStepProperties, clearAuthFields, clientContextHeaders, collectKnownSecrets, 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, formatPushResult, 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, resolveExportName, resolveManifestSource, resolveToken, runBuildManifest, selectDevExamples, 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 };
|