@walkeros/cli 4.8.0 → 4.8.1-next-1792019907609

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.
@@ -0,0 +1,93 @@
1
+ import { z, ValidateResult as ValidateResult$1, ValidationError as ValidationError$1, ValidationWarning as ValidationWarning$1, ValidationType } from '@walkeros/core/dev';
2
+ export { ValidationType } from '@walkeros/core/dev';
3
+
4
+ /**
5
+ * Validate Command Schemas
6
+ *
7
+ * Zod schemas for validate command parameter validation.
8
+ */
9
+
10
+ /**
11
+ * Validate options schema.
12
+ *
13
+ * @remarks
14
+ * Options for the programmatic validate() API.
15
+ */
16
+ declare const ValidateOptionsSchema: z.ZodObject<{
17
+ flow: z.ZodOptional<z.ZodString>;
18
+ path: z.ZodOptional<z.ZodString>;
19
+ strict: z.ZodOptional<z.ZodBoolean>;
20
+ offline: z.ZodOptional<z.ZodBoolean>;
21
+ configDir: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strip>;
23
+ type ValidateOptions = z.infer<typeof ValidateOptionsSchema>;
24
+
25
+ /**
26
+ * Every code an error, warning or skip of `validate` can carry. Agents and
27
+ * tests branch on these, never on message text.
28
+ */
29
+ 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", "STATE_STORE_UNKNOWN", "STATE_STORE_FILE", "TRANSFORMER_MAPPING_NO_OP", "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"];
30
+ type ValidateCode = (typeof VALIDATE_CODES)[number];
31
+ /**
32
+ * Named checks a run includes (`details.scope.checks`). `file:` checks run
33
+ * on the whole file whatever `--flow` says; `flow:` checks run per flow in
34
+ * scope; `entry:` checks run per entry `--path` addressed.
35
+ */
36
+ 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';
37
+ interface ValidateScopeEntry {
38
+ /** Section of the addressed entry, when the path or the match names one. */
39
+ section?: string;
40
+ key: string;
41
+ /** Flows that have the entry and were checked. */
42
+ flows: string[];
43
+ /** Flows searched for the entry. */
44
+ searchedFlows: string[];
45
+ }
46
+ /** What a run covered (C6). */
47
+ interface ValidateScope {
48
+ flows: string[];
49
+ entry?: ValidateScopeEntry;
50
+ checks: ValidateCheck[];
51
+ /** Set when `offline` removed the package settings check from `checks`. */
52
+ offline?: true;
53
+ }
54
+ /** A check the scope includes that did not run (C5). */
55
+ interface ValidateSkip {
56
+ path: string;
57
+ check: ValidateCheck;
58
+ reason: string;
59
+ code: ValidateCode;
60
+ }
61
+ /** A value known only at runtime, not schema-checked (info, not a skip). */
62
+ interface ValidateDeferred {
63
+ path: string;
64
+ reference: string;
65
+ }
66
+ interface ValidateDetails {
67
+ scope?: ValidateScope;
68
+ skipped?: ValidateSkip[];
69
+ deferred?: ValidateDeferred[];
70
+ [key: string]: unknown;
71
+ }
72
+ interface ValidationError extends ValidationError$1 {
73
+ /** The JSON Schema keyword of an ENTRY_SCHEMA error. */
74
+ keyword?: string;
75
+ }
76
+ interface ValidationWarning extends ValidationWarning$1 {
77
+ keyword?: string;
78
+ }
79
+ interface ValidateResult extends ValidateResult$1 {
80
+ errors: ValidationError[];
81
+ warnings: ValidationWarning[];
82
+ details: ValidateDetails;
83
+ }
84
+
85
+ /**
86
+ * Programmatic API for validation.
87
+ * Can be called directly from code or MCP server.
88
+ *
89
+ * Accepts parsed objects, JSON strings, file paths, or URLs as input.
90
+ */
91
+ declare function validate(type: ValidationType, input: unknown, options?: ValidateOptions): Promise<ValidateResult>;
92
+
93
+ export { VALIDATE_CODES, type ValidateCheck, type ValidateCode, type ValidateDeferred, type ValidateOptions, type ValidateResult, type ValidateScope, type ValidateSkip, type ValidationError, type ValidationWarning, validate };