@walkeros/core 2.1.0 → 2.2.0-next-1772811722420

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/dev.d.ts CHANGED
@@ -2923,6 +2923,29 @@ declare const DestinationReferenceSchema: z.ZodObject<{
2923
2923
  out: z.ZodOptional<z.ZodUnknown>;
2924
2924
  }, z.core.$strip>>>;
2925
2925
  }, z.core.$strip>;
2926
+ /**
2927
+ * Store package reference.
2928
+ *
2929
+ * @remarks
2930
+ * Stores are passive key-value infrastructure — no chain properties (next/before).
2931
+ * Consumed by other components via `$store:storeId` env wiring.
2932
+ */
2933
+ declare const StoreReferenceSchema: z.ZodObject<{
2934
+ package: z.ZodOptional<z.ZodString>;
2935
+ code: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
2936
+ push: z.ZodString;
2937
+ type: z.ZodOptional<z.ZodString>;
2938
+ init: z.ZodOptional<z.ZodString>;
2939
+ }, z.core.$strip>]>>;
2940
+ config: z.ZodOptional<z.ZodUnknown>;
2941
+ env: z.ZodOptional<z.ZodUnknown>;
2942
+ variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
2943
+ definitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2944
+ examples: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2945
+ in: z.ZodOptional<z.ZodUnknown>;
2946
+ out: z.ZodOptional<z.ZodUnknown>;
2947
+ }, z.core.$strip>>>;
2948
+ }, z.core.$strip>;
2926
2949
  /**
2927
2950
  * Contract schema entry — a JSON Schema object.
2928
2951
  * Passthrough to allow any valid JSON Schema keywords.
@@ -3003,6 +3026,22 @@ declare const ConfigSchema: z.ZodObject<{
3003
3026
  out: z.ZodOptional<z.ZodUnknown>;
3004
3027
  }, z.core.$strip>>>;
3005
3028
  }, z.core.$strip>>>;
3029
+ stores: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3030
+ package: z.ZodOptional<z.ZodString>;
3031
+ code: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
3032
+ push: z.ZodString;
3033
+ type: z.ZodOptional<z.ZodString>;
3034
+ init: z.ZodOptional<z.ZodString>;
3035
+ }, z.core.$strip>]>>;
3036
+ config: z.ZodOptional<z.ZodUnknown>;
3037
+ env: z.ZodOptional<z.ZodUnknown>;
3038
+ variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
3039
+ definitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3040
+ examples: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3041
+ in: z.ZodOptional<z.ZodUnknown>;
3042
+ out: z.ZodOptional<z.ZodUnknown>;
3043
+ }, z.core.$strip>>>;
3044
+ }, z.core.$strip>>>;
3006
3045
  collector: z.ZodOptional<z.ZodUnknown>;
3007
3046
  packages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3008
3047
  version: z.ZodOptional<z.ZodString>;
@@ -3076,6 +3115,22 @@ declare const SetupV2Schema: z.ZodObject<{
3076
3115
  out: z.ZodOptional<z.ZodUnknown>;
3077
3116
  }, z.core.$strip>>>;
3078
3117
  }, z.core.$strip>>>;
3118
+ stores: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3119
+ package: z.ZodOptional<z.ZodString>;
3120
+ code: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
3121
+ push: z.ZodString;
3122
+ type: z.ZodOptional<z.ZodString>;
3123
+ init: z.ZodOptional<z.ZodString>;
3124
+ }, z.core.$strip>]>>;
3125
+ config: z.ZodOptional<z.ZodUnknown>;
3126
+ env: z.ZodOptional<z.ZodUnknown>;
3127
+ variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
3128
+ definitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3129
+ examples: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3130
+ in: z.ZodOptional<z.ZodUnknown>;
3131
+ out: z.ZodOptional<z.ZodUnknown>;
3132
+ }, z.core.$strip>>>;
3133
+ }, z.core.$strip>>>;
3079
3134
  collector: z.ZodOptional<z.ZodUnknown>;
3080
3135
  packages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3081
3136
  version: z.ZodOptional<z.ZodString>;
@@ -3152,6 +3207,22 @@ declare const SetupSchema: z.ZodUnion<readonly [z.ZodObject<{
3152
3207
  out: z.ZodOptional<z.ZodUnknown>;
3153
3208
  }, z.core.$strip>>>;
3154
3209
  }, z.core.$strip>>>;
3210
+ stores: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3211
+ package: z.ZodOptional<z.ZodString>;
3212
+ code: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
3213
+ push: z.ZodString;
3214
+ type: z.ZodOptional<z.ZodString>;
3215
+ init: z.ZodOptional<z.ZodString>;
3216
+ }, z.core.$strip>]>>;
3217
+ config: z.ZodOptional<z.ZodUnknown>;
3218
+ env: z.ZodOptional<z.ZodUnknown>;
3219
+ variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
3220
+ definitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3221
+ examples: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3222
+ in: z.ZodOptional<z.ZodUnknown>;
3223
+ out: z.ZodOptional<z.ZodUnknown>;
3224
+ }, z.core.$strip>>>;
3225
+ }, z.core.$strip>>>;
3155
3226
  collector: z.ZodOptional<z.ZodUnknown>;
3156
3227
  packages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3157
3228
  version: z.ZodOptional<z.ZodString>;
@@ -3226,6 +3297,22 @@ declare const SetupSchema: z.ZodUnion<readonly [z.ZodObject<{
3226
3297
  out: z.ZodOptional<z.ZodUnknown>;
3227
3298
  }, z.core.$strip>>>;
3228
3299
  }, z.core.$strip>>>;
3300
+ stores: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3301
+ package: z.ZodOptional<z.ZodString>;
3302
+ code: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
3303
+ push: z.ZodString;
3304
+ type: z.ZodOptional<z.ZodString>;
3305
+ init: z.ZodOptional<z.ZodString>;
3306
+ }, z.core.$strip>]>>;
3307
+ config: z.ZodOptional<z.ZodUnknown>;
3308
+ env: z.ZodOptional<z.ZodUnknown>;
3309
+ variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
3310
+ definitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3311
+ examples: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3312
+ in: z.ZodOptional<z.ZodUnknown>;
3313
+ out: z.ZodOptional<z.ZodUnknown>;
3314
+ }, z.core.$strip>>>;
3315
+ }, z.core.$strip>>>;
3229
3316
  collector: z.ZodOptional<z.ZodUnknown>;
3230
3317
  packages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3231
3318
  version: z.ZodOptional<z.ZodString>;
@@ -3337,6 +3424,22 @@ declare function safeParseSetup(data: unknown): z.ZodSafeParseResult<{
3337
3424
  out?: unknown;
3338
3425
  }> | undefined;
3339
3426
  }> | undefined;
3427
+ stores?: Record<string, {
3428
+ package?: string | undefined;
3429
+ code?: string | {
3430
+ push: string;
3431
+ type?: string | undefined;
3432
+ init?: string | undefined;
3433
+ } | undefined;
3434
+ config?: unknown;
3435
+ env?: unknown;
3436
+ variables?: Record<string, string | number | boolean> | undefined;
3437
+ definitions?: Record<string, unknown> | undefined;
3438
+ examples?: Record<string, {
3439
+ in?: unknown;
3440
+ out?: unknown;
3441
+ }> | undefined;
3442
+ }> | undefined;
3340
3443
  collector?: unknown;
3341
3444
  packages?: Record<string, {
3342
3445
  version?: string | undefined;
@@ -3413,6 +3516,22 @@ declare function safeParseSetup(data: unknown): z.ZodSafeParseResult<{
3413
3516
  out?: unknown;
3414
3517
  }> | undefined;
3415
3518
  }> | undefined;
3519
+ stores?: Record<string, {
3520
+ package?: string | undefined;
3521
+ code?: string | {
3522
+ push: string;
3523
+ type?: string | undefined;
3524
+ init?: string | undefined;
3525
+ } | undefined;
3526
+ config?: unknown;
3527
+ env?: unknown;
3528
+ variables?: Record<string, string | number | boolean> | undefined;
3529
+ definitions?: Record<string, unknown> | undefined;
3530
+ examples?: Record<string, {
3531
+ in?: unknown;
3532
+ out?: unknown;
3533
+ }> | undefined;
3534
+ }> | undefined;
3416
3535
  collector?: unknown;
3417
3536
  packages?: Record<string, {
3418
3537
  version?: string | undefined;
@@ -3512,6 +3631,22 @@ declare function safeParseConfig(data: unknown): z.ZodSafeParseResult<{
3512
3631
  out?: unknown;
3513
3632
  }> | undefined;
3514
3633
  }> | undefined;
3634
+ stores?: Record<string, {
3635
+ package?: string | undefined;
3636
+ code?: string | {
3637
+ push: string;
3638
+ type?: string | undefined;
3639
+ init?: string | undefined;
3640
+ } | undefined;
3641
+ config?: unknown;
3642
+ env?: unknown;
3643
+ variables?: Record<string, string | number | boolean> | undefined;
3644
+ definitions?: Record<string, unknown> | undefined;
3645
+ examples?: Record<string, {
3646
+ in?: unknown;
3647
+ out?: unknown;
3648
+ }> | undefined;
3649
+ }> | undefined;
3515
3650
  collector?: unknown;
3516
3651
  packages?: Record<string, {
3517
3652
  version?: string | undefined;
@@ -3594,6 +3729,22 @@ declare const setupJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodUnion<re
3594
3729
  out: z.ZodOptional<z.ZodUnknown>;
3595
3730
  }, z.core.$strip>>>;
3596
3731
  }, z.core.$strip>>>;
3732
+ stores: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3733
+ package: z.ZodOptional<z.ZodString>;
3734
+ code: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
3735
+ push: z.ZodString;
3736
+ type: z.ZodOptional<z.ZodString>;
3737
+ init: z.ZodOptional<z.ZodString>;
3738
+ }, z.core.$strip>]>>;
3739
+ config: z.ZodOptional<z.ZodUnknown>;
3740
+ env: z.ZodOptional<z.ZodUnknown>;
3741
+ variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
3742
+ definitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3743
+ examples: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3744
+ in: z.ZodOptional<z.ZodUnknown>;
3745
+ out: z.ZodOptional<z.ZodUnknown>;
3746
+ }, z.core.$strip>>>;
3747
+ }, z.core.$strip>>>;
3597
3748
  collector: z.ZodOptional<z.ZodUnknown>;
3598
3749
  packages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3599
3750
  version: z.ZodOptional<z.ZodString>;
@@ -3668,6 +3819,22 @@ declare const setupJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodUnion<re
3668
3819
  out: z.ZodOptional<z.ZodUnknown>;
3669
3820
  }, z.core.$strip>>>;
3670
3821
  }, z.core.$strip>>>;
3822
+ stores: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3823
+ package: z.ZodOptional<z.ZodString>;
3824
+ code: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
3825
+ push: z.ZodString;
3826
+ type: z.ZodOptional<z.ZodString>;
3827
+ init: z.ZodOptional<z.ZodString>;
3828
+ }, z.core.$strip>]>>;
3829
+ config: z.ZodOptional<z.ZodUnknown>;
3830
+ env: z.ZodOptional<z.ZodUnknown>;
3831
+ variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
3832
+ definitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3833
+ examples: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3834
+ in: z.ZodOptional<z.ZodUnknown>;
3835
+ out: z.ZodOptional<z.ZodUnknown>;
3836
+ }, z.core.$strip>>>;
3837
+ }, z.core.$strip>>>;
3671
3838
  collector: z.ZodOptional<z.ZodUnknown>;
3672
3839
  packages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3673
3840
  version: z.ZodOptional<z.ZodString>;
@@ -3751,6 +3918,22 @@ declare const setupV2JsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject
3751
3918
  out: z.ZodOptional<z.ZodUnknown>;
3752
3919
  }, z.core.$strip>>>;
3753
3920
  }, z.core.$strip>>>;
3921
+ stores: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3922
+ package: z.ZodOptional<z.ZodString>;
3923
+ code: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
3924
+ push: z.ZodString;
3925
+ type: z.ZodOptional<z.ZodString>;
3926
+ init: z.ZodOptional<z.ZodString>;
3927
+ }, z.core.$strip>]>>;
3928
+ config: z.ZodOptional<z.ZodUnknown>;
3929
+ env: z.ZodOptional<z.ZodUnknown>;
3930
+ variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
3931
+ definitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3932
+ examples: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3933
+ in: z.ZodOptional<z.ZodUnknown>;
3934
+ out: z.ZodOptional<z.ZodUnknown>;
3935
+ }, z.core.$strip>>>;
3936
+ }, z.core.$strip>>>;
3754
3937
  collector: z.ZodOptional<z.ZodUnknown>;
3755
3938
  packages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3756
3939
  version: z.ZodOptional<z.ZodString>;
@@ -3799,6 +3982,15 @@ declare const destinationReferenceJsonSchema: z.core.ZodStandardJSONSchemaPayloa
3799
3982
  * @returns JSON Schema (Draft 7) representation of TransformerReferenceSchema
3800
3983
  */
3801
3984
  declare const transformerReferenceJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
3985
+ /**
3986
+ * Generate JSON Schema for StoreReference.
3987
+ *
3988
+ * @remarks
3989
+ * Used for validating store package references.
3990
+ *
3991
+ * @returns JSON Schema (Draft 7) representation of StoreReferenceSchema
3992
+ */
3993
+ declare const storeReferenceJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
3802
3994
 
3803
3995
  declare const flow_ConfigSchema: typeof ConfigSchema;
3804
3996
  declare const flow_ContractActionsSchema: typeof ContractActionsSchema;
@@ -3815,6 +4007,7 @@ declare const flow_SetupV2Schema: typeof SetupV2Schema;
3815
4007
  declare const flow_SourceReferenceSchema: typeof SourceReferenceSchema;
3816
4008
  declare const flow_StepExampleSchema: typeof StepExampleSchema;
3817
4009
  declare const flow_StepExamplesSchema: typeof StepExamplesSchema;
4010
+ declare const flow_StoreReferenceSchema: typeof StoreReferenceSchema;
3818
4011
  declare const flow_TransformerReferenceSchema: typeof TransformerReferenceSchema;
3819
4012
  declare const flow_VariablesSchema: typeof VariablesSchema;
3820
4013
  declare const flow_WebSchema: typeof WebSchema;
@@ -3827,9 +4020,10 @@ declare const flow_safeParseSetup: typeof safeParseSetup;
3827
4020
  declare const flow_setupJsonSchema: typeof setupJsonSchema;
3828
4021
  declare const flow_setupV2JsonSchema: typeof setupV2JsonSchema;
3829
4022
  declare const flow_sourceReferenceJsonSchema: typeof sourceReferenceJsonSchema;
4023
+ declare const flow_storeReferenceJsonSchema: typeof storeReferenceJsonSchema;
3830
4024
  declare const flow_transformerReferenceJsonSchema: typeof transformerReferenceJsonSchema;
3831
4025
  declare namespace flow {
3832
- export { flow_ConfigSchema as ConfigSchema, flow_ContractActionsSchema as ContractActionsSchema, flow_ContractSchema as ContractSchema, flow_ContractSchemaEntry as ContractSchemaEntry, flow_DefinitionsSchema as DefinitionsSchema, flow_DestinationReferenceSchema as DestinationReferenceSchema, flow_InlineCodeSchema as InlineCodeSchema, flow_PackagesSchema as PackagesSchema, flow_PrimitiveSchema as PrimitiveSchema, flow_ServerSchema as ServerSchema, flow_SetupSchema as SetupSchema, flow_SetupV2Schema as SetupV2Schema, flow_SourceReferenceSchema as SourceReferenceSchema, flow_StepExampleSchema as StepExampleSchema, flow_StepExamplesSchema as StepExamplesSchema, flow_TransformerReferenceSchema as TransformerReferenceSchema, flow_VariablesSchema as VariablesSchema, flow_WebSchema as WebSchema, flow_configJsonSchema as configJsonSchema, flow_destinationReferenceJsonSchema as destinationReferenceJsonSchema, flow_parseConfig as parseConfig, flow_parseSetup as parseSetup, flow_safeParseConfig as safeParseConfig, flow_safeParseSetup as safeParseSetup, flow_setupJsonSchema as setupJsonSchema, flow_setupV2JsonSchema as setupV2JsonSchema, flow_sourceReferenceJsonSchema as sourceReferenceJsonSchema, flow_transformerReferenceJsonSchema as transformerReferenceJsonSchema };
4026
+ export { flow_ConfigSchema as ConfigSchema, flow_ContractActionsSchema as ContractActionsSchema, flow_ContractSchema as ContractSchema, flow_ContractSchemaEntry as ContractSchemaEntry, flow_DefinitionsSchema as DefinitionsSchema, flow_DestinationReferenceSchema as DestinationReferenceSchema, flow_InlineCodeSchema as InlineCodeSchema, flow_PackagesSchema as PackagesSchema, flow_PrimitiveSchema as PrimitiveSchema, flow_ServerSchema as ServerSchema, flow_SetupSchema as SetupSchema, flow_SetupV2Schema as SetupV2Schema, flow_SourceReferenceSchema as SourceReferenceSchema, flow_StepExampleSchema as StepExampleSchema, flow_StepExamplesSchema as StepExamplesSchema, flow_StoreReferenceSchema as StoreReferenceSchema, flow_TransformerReferenceSchema as TransformerReferenceSchema, flow_VariablesSchema as VariablesSchema, flow_WebSchema as WebSchema, flow_configJsonSchema as configJsonSchema, flow_destinationReferenceJsonSchema as destinationReferenceJsonSchema, flow_parseConfig as parseConfig, flow_parseSetup as parseSetup, flow_safeParseConfig as safeParseConfig, flow_safeParseSetup as safeParseSetup, flow_setupJsonSchema as setupJsonSchema, flow_setupV2JsonSchema as setupV2JsonSchema, flow_sourceReferenceJsonSchema as sourceReferenceJsonSchema, flow_storeReferenceJsonSchema as storeReferenceJsonSchema, flow_transformerReferenceJsonSchema as transformerReferenceJsonSchema };
3833
4027
  }
3834
4028
 
3835
4029
  /**
@@ -4221,6 +4415,7 @@ declare const index_SourceReferenceSchema: typeof SourceReferenceSchema;
4221
4415
  declare const index_SourceSchema: typeof SourceSchema;
4222
4416
  declare const index_SourceTypeSchema: typeof SourceTypeSchema;
4223
4417
  declare const index_SourcesMapConfig: typeof SourcesMapConfig;
4418
+ declare const index_StoreReferenceSchema: typeof StoreReferenceSchema;
4224
4419
  declare const index_TaggingVersion: typeof TaggingVersion;
4225
4420
  declare const index_Timestamp: typeof Timestamp;
4226
4421
  declare const index_UserSchema: typeof UserSchema;
@@ -4261,6 +4456,7 @@ declare const index_setupJsonSchema: typeof setupJsonSchema;
4261
4456
  declare const index_setupV2JsonSchema: typeof setupV2JsonSchema;
4262
4457
  declare const index_sourceReferenceJsonSchema: typeof sourceReferenceJsonSchema;
4263
4458
  declare const index_sourceTypeJsonSchema: typeof sourceTypeJsonSchema;
4459
+ declare const index_storeReferenceJsonSchema: typeof storeReferenceJsonSchema;
4264
4460
  declare const index_userJsonSchema: typeof userJsonSchema;
4265
4461
  declare const index_validateFlowSetup: typeof validateFlowSetup;
4266
4462
  declare const index_valueConfigJsonSchema: typeof valueConfigJsonSchema;
@@ -4268,7 +4464,7 @@ declare const index_valueJsonSchema: typeof valueJsonSchema;
4268
4464
  declare const index_z: typeof z;
4269
4465
  declare const index_zodToSchema: typeof zodToSchema;
4270
4466
  declare namespace index {
4271
- export { index_BaseContextConfig as BaseContextConfig, index_BatchConfig as BatchConfig, collector as CollectorSchemas, index_ConsentSchema as ConsentSchema, index_ContractActionsSchema as ContractActionsSchema, index_ContractSchema as ContractSchema, index_ContractSchemaEntry as ContractSchemaEntry, index_Counter as Counter, index_DeepPartialEventSchema as DeepPartialEventSchema, index_DestinationReferenceSchema as DestinationReferenceSchema, destination as DestinationSchemas, index_DestinationsMapConfig as DestinationsMapConfig, index_EntitiesSchema as EntitiesSchema, index_EntitySchema as EntitySchema, index_EventSchema as EventSchema, ConfigSchema as FlowConfigSchema, flow as FlowSchemas, index_GenericEnvConfig as GenericEnvConfig, index_GenericSettingsConfig as GenericSettingsConfig, index_HandlersConfig as HandlersConfig, index_IdConfig as IdConfig, index_Identifier as Identifier, index_InitConfig as InitConfig, type index_IntelliSenseContext as IntelliSenseContext, type index_JSONSchema as JSONSchema, index_LoopSchema as LoopSchema, index_MapSchema as MapSchema, ResultSchema$1 as MappingResultSchema, mapping as MappingSchemas, index_OptionalPrimitiveValue as OptionalPrimitiveValue, index_OrderedPropertiesSchema as OrderedPropertiesSchema, type index_PackageInfo as PackageInfo, index_PartialEventSchema as PartialEventSchema, index_PolicySchema as PolicySchema, index_PrimaryConfig as PrimaryConfig, index_PrimitiveSchema as PrimitiveSchema, index_PrimitiveValue as PrimitiveValue, index_ProcessingControlConfig as ProcessingControlConfig, index_PropertiesSchema as PropertiesSchema, type index_PropertyDef as PropertyDef, index_PropertySchema as PropertySchema, index_PropertyTypeSchema as PropertyTypeSchema, index_QueueConfig as QueueConfig, index_RequiredBoolean as RequiredBoolean, index_RequiredNumber as RequiredNumber, index_RequiredString as RequiredString, index_RuleSchema as RuleSchema, index_RulesSchema as RulesSchema, index_RuntimeInstanceConfig as RuntimeInstanceConfig, index_SetSchema as SetSchema, index_SetupSchema as SetupSchema, index_SetupV2Schema as SetupV2Schema, index_SourceReferenceSchema as SourceReferenceSchema, index_SourceSchema as SourceSchema, source as SourceSchemas, index_SourceTypeSchema as SourceTypeSchema, index_SourcesMapConfig as SourcesMapConfig, index_TaggingVersion as TaggingVersion, index_Timestamp as Timestamp, index_UserSchema as UserSchema, utilities as UtilitySchemas, type index_ValidationIssue as ValidationIssue, type index_ValidationResult as ValidationResult, index_ValueConfigSchema as ValueConfigSchema, index_ValueSchema as ValueSchema, index_ValuesSchema as ValuesSchema, index_VerboseConfig as VerboseConfig, index_VersionSchema as VersionSchema, walkeros as WalkerOSSchemas, index_configJsonSchema as configJsonSchema, index_consentJsonSchema as consentJsonSchema, index_createArraySchema as createArraySchema, index_createConsentConfig as createConsentConfig, index_createDataTransformationConfig as createDataTransformationConfig, index_createEnumSchema as createEnumSchema, index_createMappingRulesConfig as createMappingRulesConfig, index_createObjectSchema as createObjectSchema, index_createPolicyConfig as createPolicyConfig, index_createTupleSchema as createTupleSchema, index_destinationReferenceJsonSchema as destinationReferenceJsonSchema, index_entityJsonSchema as entityJsonSchema, index_eventJsonSchema as eventJsonSchema, index_loopJsonSchema as loopJsonSchema, index_mapJsonSchema as mapJsonSchema, index_orderedPropertiesJsonSchema as orderedPropertiesJsonSchema, index_parseConfig as parseConfig, index_parseSetup as parseSetup, index_partialEventJsonSchema as partialEventJsonSchema, index_policyJsonSchema as policyJsonSchema, index_propertiesJsonSchema as propertiesJsonSchema, index_ruleJsonSchema as ruleJsonSchema, index_rulesJsonSchema as rulesJsonSchema, index_safeParseConfig as safeParseConfig, index_safeParseSetup as safeParseSetup, index_setJsonSchema as setJsonSchema, index_setupJsonSchema as setupJsonSchema, index_setupV2JsonSchema as setupV2JsonSchema, index_sourceReferenceJsonSchema as sourceReferenceJsonSchema, index_sourceTypeJsonSchema as sourceTypeJsonSchema, index_userJsonSchema as userJsonSchema, index_validateFlowSetup as validateFlowSetup, index_valueConfigJsonSchema as valueConfigJsonSchema, index_valueJsonSchema as valueJsonSchema, index_z as z, index_zodToSchema as zodToSchema };
4467
+ export { index_BaseContextConfig as BaseContextConfig, index_BatchConfig as BatchConfig, collector as CollectorSchemas, index_ConsentSchema as ConsentSchema, index_ContractActionsSchema as ContractActionsSchema, index_ContractSchema as ContractSchema, index_ContractSchemaEntry as ContractSchemaEntry, index_Counter as Counter, index_DeepPartialEventSchema as DeepPartialEventSchema, index_DestinationReferenceSchema as DestinationReferenceSchema, destination as DestinationSchemas, index_DestinationsMapConfig as DestinationsMapConfig, index_EntitiesSchema as EntitiesSchema, index_EntitySchema as EntitySchema, index_EventSchema as EventSchema, ConfigSchema as FlowConfigSchema, flow as FlowSchemas, index_GenericEnvConfig as GenericEnvConfig, index_GenericSettingsConfig as GenericSettingsConfig, index_HandlersConfig as HandlersConfig, index_IdConfig as IdConfig, index_Identifier as Identifier, index_InitConfig as InitConfig, type index_IntelliSenseContext as IntelliSenseContext, type index_JSONSchema as JSONSchema, index_LoopSchema as LoopSchema, index_MapSchema as MapSchema, ResultSchema$1 as MappingResultSchema, mapping as MappingSchemas, index_OptionalPrimitiveValue as OptionalPrimitiveValue, index_OrderedPropertiesSchema as OrderedPropertiesSchema, type index_PackageInfo as PackageInfo, index_PartialEventSchema as PartialEventSchema, index_PolicySchema as PolicySchema, index_PrimaryConfig as PrimaryConfig, index_PrimitiveSchema as PrimitiveSchema, index_PrimitiveValue as PrimitiveValue, index_ProcessingControlConfig as ProcessingControlConfig, index_PropertiesSchema as PropertiesSchema, type index_PropertyDef as PropertyDef, index_PropertySchema as PropertySchema, index_PropertyTypeSchema as PropertyTypeSchema, index_QueueConfig as QueueConfig, index_RequiredBoolean as RequiredBoolean, index_RequiredNumber as RequiredNumber, index_RequiredString as RequiredString, index_RuleSchema as RuleSchema, index_RulesSchema as RulesSchema, index_RuntimeInstanceConfig as RuntimeInstanceConfig, index_SetSchema as SetSchema, index_SetupSchema as SetupSchema, index_SetupV2Schema as SetupV2Schema, index_SourceReferenceSchema as SourceReferenceSchema, index_SourceSchema as SourceSchema, source as SourceSchemas, index_SourceTypeSchema as SourceTypeSchema, index_SourcesMapConfig as SourcesMapConfig, index_StoreReferenceSchema as StoreReferenceSchema, index_TaggingVersion as TaggingVersion, index_Timestamp as Timestamp, index_UserSchema as UserSchema, utilities as UtilitySchemas, type index_ValidationIssue as ValidationIssue, type index_ValidationResult as ValidationResult, index_ValueConfigSchema as ValueConfigSchema, index_ValueSchema as ValueSchema, index_ValuesSchema as ValuesSchema, index_VerboseConfig as VerboseConfig, index_VersionSchema as VersionSchema, walkeros as WalkerOSSchemas, index_configJsonSchema as configJsonSchema, index_consentJsonSchema as consentJsonSchema, index_createArraySchema as createArraySchema, index_createConsentConfig as createConsentConfig, index_createDataTransformationConfig as createDataTransformationConfig, index_createEnumSchema as createEnumSchema, index_createMappingRulesConfig as createMappingRulesConfig, index_createObjectSchema as createObjectSchema, index_createPolicyConfig as createPolicyConfig, index_createTupleSchema as createTupleSchema, index_destinationReferenceJsonSchema as destinationReferenceJsonSchema, index_entityJsonSchema as entityJsonSchema, index_eventJsonSchema as eventJsonSchema, index_loopJsonSchema as loopJsonSchema, index_mapJsonSchema as mapJsonSchema, index_orderedPropertiesJsonSchema as orderedPropertiesJsonSchema, index_parseConfig as parseConfig, index_parseSetup as parseSetup, index_partialEventJsonSchema as partialEventJsonSchema, index_policyJsonSchema as policyJsonSchema, index_propertiesJsonSchema as propertiesJsonSchema, index_ruleJsonSchema as ruleJsonSchema, index_rulesJsonSchema as rulesJsonSchema, index_safeParseConfig as safeParseConfig, index_safeParseSetup as safeParseSetup, index_setJsonSchema as setJsonSchema, index_setupJsonSchema as setupJsonSchema, index_setupV2JsonSchema as setupV2JsonSchema, index_sourceReferenceJsonSchema as sourceReferenceJsonSchema, index_sourceTypeJsonSchema as sourceTypeJsonSchema, index_storeReferenceJsonSchema as storeReferenceJsonSchema, index_userJsonSchema as userJsonSchema, index_validateFlowSetup as validateFlowSetup, index_valueConfigJsonSchema as valueConfigJsonSchema, index_valueJsonSchema as valueJsonSchema, index_z as z, index_zodToSchema as zodToSchema };
4272
4468
  }
4273
4469
 
4274
4470
  export { type JSONSchema, index as schemas, zodToSchema };
package/dist/dev.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,r=(e,i)=>{for(var t in i)n(e,t,{get:i[t],enumerable:!0})},a={};r(a,{schemas:()=>s,z:()=>c.z,zodToSchema:()=>Oi}),module.exports=(e=a,((e,r,a,s)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let c of t(r))o.call(e,c)||c===a||n(e,c,{get:()=>r[c],enumerable:!(s=i(r,c))||s.enumerable});return e})(n({},"__esModule",{value:!0}),e));var s={};r(s,{BaseContextConfig:()=>B,BatchConfig:()=>A,CollectorSchemas:()=>un,ConsentSchema:()=>ne,ContractActionsSchema:()=>ni,ContractSchema:()=>ii,ContractSchemaEntry:()=>ei,Counter:()=>f,DeepPartialEventSchema:()=>le,DestinationReferenceSchema:()=>Zn,DestinationSchemas:()=>Ue,DestinationsMapConfig:()=>G,EntitiesSchema:()=>ae,EntitySchema:()=>re,EventSchema:()=>se,FlowConfigSchema:()=>ti,FlowSchemas:()=>Wn,GenericEnvConfig:()=>q,GenericSettingsConfig:()=>T,HandlersConfig:()=>D,IdConfig:()=>R,Identifier:()=>m,InitConfig:()=>L,LoopSchema:()=>ye,MapSchema:()=>ke,MappingResultSchema:()=>Ee,MappingSchemas:()=>ze,OptionalPrimitiveValue:()=>z,OrderedPropertiesSchema:()=>Z,PartialEventSchema:()=>ce,PolicySchema:()=>Ce,PrimaryConfig:()=>N,PrimitiveSchema:()=>$n,PrimitiveValue:()=>h,ProcessingControlConfig:()=>F,PropertiesSchema:()=>Y,PropertySchema:()=>X,PropertyTypeSchema:()=>K,QueueConfig:()=>O,RequiredBoolean:()=>u,RequiredNumber:()=>p,RequiredString:()=>d,RuleSchema:()=>xe,RulesSchema:()=>Pe,RuntimeInstanceConfig:()=>$,SetSchema:()=>we,SetupSchema:()=>si,SetupV2Schema:()=>ai,SourceReferenceSchema:()=>Xn,SourceSchema:()=>oe,SourceSchemas:()=>Pn,SourceTypeSchema:()=>ee,SourcesMapConfig:()=>H,TaggingVersion:()=>g,Timestamp:()=>b,UserSchema:()=>ie,UtilitySchemas:()=>v,ValueConfigSchema:()=>je,ValueSchema:()=>ve,ValuesSchema:()=>Se,VerboseConfig:()=>I,VersionSchema:()=>te,WalkerOSSchemas:()=>Q,configJsonSchema:()=>bi,consentJsonSchema:()=>he,createArraySchema:()=>Ei,createConsentConfig:()=>W,createDataTransformationConfig:()=>M,createEnumSchema:()=>Di,createMappingRulesConfig:()=>U,createObjectSchema:()=>Pi,createPolicyConfig:()=>V,createTupleSchema:()=>Ii,destinationReferenceJsonSchema:()=>gi,entityJsonSchema:()=>fe,eventJsonSchema:()=>de,loopJsonSchema:()=>Oe,mapJsonSchema:()=>Le,orderedPropertiesJsonSchema:()=>be,parseConfig:()=>di,parseSetup:()=>ci,partialEventJsonSchema:()=>pe,policyJsonSchema:()=>Ne,propertiesJsonSchema:()=>me,ruleJsonSchema:()=>Te,rulesJsonSchema:()=>qe,safeParseConfig:()=>pi,safeParseSetup:()=>li,setJsonSchema:()=>Re,setupJsonSchema:()=>ui,setupV2JsonSchema:()=>mi,sourceReferenceJsonSchema:()=>fi,sourceTypeJsonSchema:()=>ge,userJsonSchema:()=>ue,validateFlowSetup:()=>zi,valueConfigJsonSchema:()=>Ie,valueJsonSchema:()=>De,z:()=>c.z,zodToSchema:()=>Oi});var c=require("zod");function l(e,n,i="draft-7"){return c.z.toJSONSchema(e,{target:i})}var d=c.z.string(),p=c.z.number(),u=c.z.boolean(),m=c.z.string().min(1),b=c.z.number().int().positive(),f=c.z.number().int().nonnegative(),g=c.z.number().describe("Tagging version number"),h=c.z.union([c.z.string(),c.z.number(),c.z.boolean()]),z=h.optional(),v={};r(v,{ErrorHandlerSchema:()=>w,HandlerSchema:()=>j,LogHandlerSchema:()=>k,StorageSchema:()=>y,StorageTypeSchema:()=>S,errorHandlerJsonSchema:()=>P,handlerJsonSchema:()=>E,logHandlerJsonSchema:()=>J,storageJsonSchema:()=>x,storageTypeJsonSchema:()=>C});var S=c.z.enum(["local","session","cookie"]).describe("Storage mechanism: local, session, or cookie"),y=c.z.object({Local:c.z.literal("local"),Session:c.z.literal("session"),Cookie:c.z.literal("cookie")}).describe("Storage type constants for type-safe references"),w=c.z.any().describe("Error handler function: (error, state?) => void"),k=c.z.any().describe("Log handler function: (message, verbose?) => void"),j=c.z.object({Error:w.describe("Error handler function"),Log:k.describe("Log handler function")}).describe("Handler interface with error and log functions"),C=l(S),x=l(y),P=l(w),J=l(k),E=l(j),D=c.z.object({onError:w.optional().describe("Error handler function: (error, state?) => void"),onLog:k.optional().describe("Log handler function: (message, verbose?) => void")}).partial(),I=c.z.object({verbose:c.z.boolean().describe("Enable verbose logging for debugging").optional()}).partial(),O=c.z.object({queue:c.z.boolean().describe("Whether to queue events when consent is not granted").optional()}).partial(),R=c.z.object({}).partial(),L=c.z.object({init:c.z.boolean().describe("Whether to initialize immediately").optional(),loadScript:c.z.boolean().describe("Whether to load external script (for web destinations)").optional()}).partial(),N=c.z.object({primary:c.z.boolean().describe("Mark as primary (only one can be primary)").optional()}).partial(),T=c.z.object({settings:c.z.any().optional().describe("Implementation-specific configuration")}).partial(),q=c.z.object({env:c.z.any().optional().describe("Environment dependencies (platform-specific)")}).partial();function M(e,n){return c.z.object({data:c.z.union([e,n]).optional().describe("Data transformation rules")}).partial()}function U(e){return c.z.object({mapping:e.optional().describe("Event mapping rules")}).partial()}function V(e){return c.z.object({policy:e.optional().describe("Pre-processing policy rules")}).partial()}function W(e){return c.z.object({consent:e.optional().describe("Required consent states")}).partial()}var $=c.z.object({type:c.z.string().optional().describe("Instance type identifier"),config:c.z.unknown().describe("Instance configuration")}).partial(),B=c.z.object({collector:c.z.unknown().describe("Collector instance (runtime object)"),config:c.z.unknown().describe("Configuration"),env:c.z.unknown().describe("Environment dependencies")}).partial(),A=c.z.object({batch:c.z.number().optional().describe("Batch size: bundle N events for batch processing"),batched:c.z.unknown().optional().describe("Batch of events to be processed")}).partial(),F=c.z.object({ignore:c.z.boolean().describe("Set to true to skip processing").optional(),condition:c.z.string().optional().describe("Condition function: return true to process")}).partial(),H=c.z.object({sources:c.z.record(c.z.string(),c.z.unknown()).describe("Map of source instances")}).partial(),G=c.z.object({destinations:c.z.record(c.z.string(),c.z.unknown()).describe("Map of destination instances")}).partial(),Q={};r(Q,{ConsentSchema:()=>ne,DeepPartialEventSchema:()=>le,EntitiesSchema:()=>ae,EntitySchema:()=>re,EventSchema:()=>se,OrderedPropertiesSchema:()=>Z,PartialEventSchema:()=>ce,PropertiesSchema:()=>Y,PropertySchema:()=>X,PropertyTypeSchema:()=>K,SourceSchema:()=>oe,SourceTypeSchema:()=>ee,UserSchema:()=>ie,VersionSchema:()=>te,consentJsonSchema:()=>he,entityJsonSchema:()=>fe,eventJsonSchema:()=>de,orderedPropertiesJsonSchema:()=>be,partialEventJsonSchema:()=>pe,propertiesJsonSchema:()=>me,sourceTypeJsonSchema:()=>ge,userJsonSchema:()=>ue});var _,K=c.z.lazy(()=>c.z.union([c.z.boolean(),c.z.string(),c.z.number(),c.z.record(c.z.string(),X)])),X=c.z.lazy(()=>c.z.union([K,c.z.array(K)])),Y=c.z.record(c.z.string(),X.optional()).describe("Flexible property collection with optional values"),Z=c.z.record(c.z.string(),c.z.tuple([X,c.z.number()]).optional()).describe("Ordered properties with [value, order] tuples for priority control"),ee=c.z.union([c.z.enum(["web","server","app","other"]),c.z.string()]).describe("Source type: web, server, app, other, or custom"),ne=c.z.record(c.z.string(),c.z.boolean()).describe("Consent requirement mapping (group name → state)"),ie=Y.and(c.z.object({id:c.z.string().optional().describe("User identifier"),device:c.z.string().optional().describe("Device identifier"),session:c.z.string().optional().describe("Session identifier"),hash:c.z.string().optional().describe("Hashed identifier"),address:c.z.string().optional().describe("User address"),email:c.z.string().email().optional().describe("User email address"),phone:c.z.string().optional().describe("User phone number"),userAgent:c.z.string().optional().describe("Browser user agent string"),browser:c.z.string().optional().describe("Browser name"),browserVersion:c.z.string().optional().describe("Browser version"),deviceType:c.z.string().optional().describe("Device type (mobile, desktop, tablet)"),os:c.z.string().optional().describe("Operating system"),osVersion:c.z.string().optional().describe("Operating system version"),screenSize:c.z.string().optional().describe("Screen dimensions"),language:c.z.string().optional().describe("User language"),country:c.z.string().optional().describe("User country"),region:c.z.string().optional().describe("User region/state"),city:c.z.string().optional().describe("User city"),zip:c.z.string().optional().describe("User postal code"),timezone:c.z.string().optional().describe("User timezone"),ip:c.z.string().optional().describe("User IP address"),internal:c.z.boolean().optional().describe("Internal user flag (employee, test user)")})).describe("User identification and properties"),te=Y.and(c.z.object({source:d.describe('Walker implementation version (e.g., "2.0.0")'),tagging:g})).describe("Walker version information"),oe=Y.and(c.z.object({type:ee.describe("Source type identifier"),id:d.describe("Source identifier (typically URL on web)"),previous_id:d.describe("Previous source identifier (typically referrer on web)")})).describe("Event source information"),re=c.z.lazy(()=>c.z.object({entity:c.z.string().describe("Entity name"),data:Y.describe("Entity-specific properties"),nested:c.z.array(re).describe("Nested child entities"),context:Z.describe("Entity context data")})).describe("Nested entity structure with recursive nesting support"),ae=c.z.array(re).describe("Array of nested entities"),se=c.z.object({name:c.z.string().describe('Event name in "entity action" format (e.g., "page view", "product add")'),data:Y.describe("Event-specific properties"),context:Z.describe("Ordered context properties with priorities"),globals:Y.describe("Global properties shared across events"),custom:Y.describe("Custom implementation-specific properties"),user:ie.describe("User identification and attributes"),nested:ae.describe("Related nested entities"),consent:ne.describe("Consent states at event time"),id:m.describe("Unique event identifier (timestamp-based)"),trigger:d.describe("Event trigger identifier"),entity:d.describe("Parsed entity from event name"),action:d.describe("Parsed action from event name"),timestamp:b.describe("Unix timestamp in milliseconds since epoch"),timing:p.describe("Event processing timing information"),group:d.describe("Event grouping identifier"),count:f.describe("Event count in session"),version:te.describe("Walker version information"),source:oe.describe("Event source information")}).describe("Complete walkerOS event structure"),ce=se.partial().describe("Partial event structure with all fields optional"),le=se.partial().describe("Partial event structure with all top-level fields optional"),de=l(se),pe=l(ce),ue=l(ie),me=l(Y),be=l(Z),fe=l(re),ge=l(ee),he=l(ne),ze={};r(ze,{ConfigSchema:()=>Je,LoopSchema:()=>ye,MapSchema:()=>ke,PolicySchema:()=>Ce,ResultSchema:()=>Ee,RuleSchema:()=>xe,RulesSchema:()=>Pe,SetSchema:()=>we,ValueConfigSchema:()=>je,ValueSchema:()=>ve,ValuesSchema:()=>Se,configJsonSchema:()=>Me,loopJsonSchema:()=>Oe,mapJsonSchema:()=>Le,policyJsonSchema:()=>Ne,ruleJsonSchema:()=>Te,rulesJsonSchema:()=>qe,setJsonSchema:()=>Re,valueConfigJsonSchema:()=>Ie,valueJsonSchema:()=>De});var ve=c.z.lazy(()=>c.z.union([c.z.string().describe('String value or property path (e.g., "data.id")'),c.z.number().describe("Numeric value"),c.z.boolean().describe("Boolean value"),c.z.lazy(()=>_),c.z.array(ve).describe("Array of values")])),Se=c.z.array(ve).describe("Array of transformation values"),ye=c.z.lazy(()=>c.z.tuple([ve,ve]).describe("Loop transformation: [source, transform] tuple for array processing")),we=c.z.lazy(()=>c.z.array(ve).describe("Set: Array of values for selection or combination")),ke=c.z.lazy(()=>c.z.record(c.z.string(),ve).describe("Map: Object mapping keys to transformation values")),je=_=c.z.object({key:c.z.string().optional().describe('Property path to extract from event (e.g., "data.id", "user.email")'),value:c.z.union([c.z.string(),c.z.number(),c.z.boolean()]).optional().describe("Static primitive value"),fn:c.z.string().optional().describe("Custom transformation function as string (serialized)"),map:ke.optional().describe("Object mapping: transform event data to structured output"),loop:ye.optional().describe("Loop transformation: [source, transform] for array processing"),set:we.optional().describe("Set of values: combine or select from multiple values"),consent:ne.optional().describe("Required consent states to include this value"),condition:c.z.string().optional().describe("Condition function as string: return true to include value"),validate:c.z.string().optional().describe("Validation function as string: return true if value is valid")}).refine(e=>Object.keys(e).length>0,{message:"ValueConfig must have at least one property"}).describe("Value transformation configuration with multiple strategies"),Ce=c.z.record(c.z.string(),ve).describe("Policy rules for event pre-processing (key → value mapping)"),xe=c.z.object({batch:c.z.number().optional().describe("Batch size: bundle N events for batch processing"),condition:c.z.string().optional().describe("Condition function as string: return true to process event"),consent:ne.optional().describe("Required consent states to process this event"),settings:c.z.any().optional().describe("Destination-specific settings for this event mapping"),data:c.z.union([ve,Se]).optional().describe("Data transformation rules for event"),ignore:c.z.boolean().optional().describe("Set to true to skip processing this event"),name:c.z.string().optional().describe('Custom event name override (e.g., "view_item" for "product view")'),policy:Ce.optional().describe("Event-level policy overrides (applied after config-level policy)")}).describe("Mapping rule for specific entity-action combination"),Pe=c.z.record(c.z.string(),c.z.record(c.z.string(),c.z.union([xe,c.z.array(xe)])).optional()).describe("Nested mapping rules: { entity: { action: Rule | Rule[] } } with wildcard support"),Je=c.z.object({consent:ne.optional().describe("Required consent states to process any events"),data:c.z.union([ve,Se]).optional().describe("Global data transformation applied to all events"),mapping:Pe.optional().describe("Entity-action specific mapping rules"),policy:Ce.optional().describe("Pre-processing policy rules applied before mapping")}).describe("Shared mapping configuration for sources and destinations"),Ee=c.z.object({eventMapping:xe.optional().describe("Resolved mapping rule for event"),mappingKey:c.z.string().optional().describe('Mapping key used (e.g., "product.view")')}).describe("Mapping resolution result"),De=l(ve),Ie=l(je),Oe=l(ye),Re=l(we),Le=l(ke),Ne=l(Ce),Te=l(xe),qe=l(Pe),Me=l(Je),Ue={};r(Ue,{BatchSchema:()=>Qe,ConfigSchema:()=>Ve,ContextSchema:()=>Be,DLQSchema:()=>on,DataSchema:()=>_e,DestinationPolicySchema:()=>$e,DestinationsSchema:()=>Ze,InitDestinationsSchema:()=>Ye,InitSchema:()=>Xe,InstanceSchema:()=>Ke,PartialConfigSchema:()=>We,PushBatchContextSchema:()=>Fe,PushContextSchema:()=>Ae,PushEventSchema:()=>He,PushEventsSchema:()=>Ge,PushResultSchema:()=>nn,RefSchema:()=>en,ResultSchema:()=>tn,batchJsonSchema:()=>ln,configJsonSchema:()=>rn,contextJsonSchema:()=>sn,instanceJsonSchema:()=>dn,partialConfigJsonSchema:()=>an,pushContextJsonSchema:()=>cn,resultJsonSchema:()=>pn});var Ve=c.z.object({consent:ne.optional().describe("Required consent states to send events to this destination"),settings:c.z.any().describe("Implementation-specific configuration").optional(),data:c.z.union([ve,Se]).optional().describe("Global data transformation applied to all events for this destination"),env:c.z.any().describe("Environment dependencies (platform-specific)").optional(),id:m.describe("Destination instance identifier (defaults to destination key)").optional(),init:c.z.boolean().describe("Whether to initialize immediately").optional(),loadScript:c.z.boolean().describe("Whether to load external script (for web destinations)").optional(),mapping:Pe.optional().describe("Entity-action specific mapping rules for this destination"),policy:Ce.optional().describe("Pre-processing policy rules applied before event mapping"),queue:c.z.boolean().describe("Whether to queue events when consent is not granted").optional(),verbose:c.z.boolean().describe("Enable verbose logging for debugging").optional(),onError:w.optional(),onLog:k.optional()}).describe("Destination configuration"),We=Ve.partial().describe("Partial destination configuration with all fields optional"),$e=Ce.describe("Destination policy rules for event pre-processing"),Be=c.z.object({collector:c.z.unknown().describe("Collector instance (runtime object)"),config:Ve.describe("Destination configuration"),data:c.z.union([c.z.unknown(),c.z.array(c.z.unknown())]).optional().describe("Transformed event data"),env:c.z.unknown().describe("Environment dependencies")}).describe("Destination context for init and push functions"),Ae=Be.extend({mapping:xe.optional().describe("Resolved mapping rule for this specific event")}).describe("Push context with event-specific mapping"),Fe=Ae.describe("Batch push context with event-specific mapping"),He=c.z.object({event:se.describe("The event to process"),mapping:xe.optional().describe("Mapping rule for this event")}).describe("Event with optional mapping for batch processing"),Ge=c.z.array(He).describe("Array of events with mappings"),Qe=c.z.object({key:c.z.string().describe('Batch key (usually mapping key like "product.view")'),events:c.z.array(se).describe("Array of events in batch"),data:c.z.array(c.z.union([c.z.unknown(),c.z.array(c.z.unknown())]).optional()).describe("Transformed data for each event"),mapping:xe.optional().describe("Shared mapping rule for batch")}).describe("Batch of events grouped by mapping key"),_e=c.z.union([c.z.unknown(),c.z.array(c.z.unknown())]).optional().describe("Transformed event data (Property, undefined, or array)"),Ke=c.z.object({config:Ve.describe("Destination configuration"),queue:c.z.array(se).optional().describe("Queued events awaiting consent"),dlq:c.z.array(c.z.tuple([se,c.z.unknown()])).optional().describe("Dead letter queue (failed events with errors)"),type:c.z.string().optional().describe("Destination type identifier"),env:c.z.unknown().optional().describe("Environment dependencies"),init:c.z.unknown().optional().describe("Initialization function"),push:c.z.unknown().describe("Push function for single events"),pushBatch:c.z.unknown().optional().describe("Batch push function"),on:c.z.unknown().optional().describe("Event lifecycle hook function")}).describe("Destination instance (runtime object with functions)"),Xe=c.z.object({code:Ke.describe("Destination instance with implementation"),config:We.optional().describe("Partial configuration overrides"),env:c.z.unknown().optional().describe("Partial environment overrides")}).describe("Destination initialization configuration"),Ye=c.z.record(c.z.string(),Xe).describe("Map of destination IDs to initialization configurations"),Ze=c.z.record(c.z.string(),Ke).describe("Map of destination IDs to runtime instances"),en=c.z.object({type:c.z.string().describe('Destination type ("gtag", "meta", "bigquery")'),data:c.z.unknown().optional().describe("Response from push()"),error:c.z.unknown().optional().describe("Error if failed")}).describe("Destination reference with type and response data"),nn=c.z.object({queue:c.z.array(se).optional().describe("Events queued (awaiting consent)"),error:c.z.unknown().optional().describe("Error if push failed")}).describe("Push operation result"),tn=c.z.object({ok:c.z.boolean().describe("True if nothing failed"),event:c.z.unknown().optional().describe("The processed event"),done:c.z.record(c.z.string(),en).optional().describe("Destinations that processed successfully"),queued:c.z.record(c.z.string(),en).optional().describe("Destinations that queued events"),failed:c.z.record(c.z.string(),en).optional().describe("Destinations that failed to process")}).describe("Push result with destination outcomes"),on=c.z.array(c.z.tuple([se,c.z.unknown()])).describe("Dead letter queue: [(event, error), ...]"),rn=l(Ve),an=l(We),sn=l(Be),cn=l(Ae),ln=l(Qe),dn=l(Ke),pn=l(tn),un={};r(un,{CommandTypeSchema:()=>mn,ConfigSchema:()=>bn,DestinationsSchema:()=>vn,InitConfigSchema:()=>gn,InstanceSchema:()=>Sn,PushContextSchema:()=>hn,SessionDataSchema:()=>fn,SourcesSchema:()=>zn,commandTypeJsonSchema:()=>yn,configJsonSchema:()=>wn,initConfigJsonSchema:()=>jn,instanceJsonSchema:()=>xn,pushContextJsonSchema:()=>Cn,sessionDataJsonSchema:()=>kn});var mn=c.z.union([c.z.enum(["action","config","consent","context","destination","elb","globals","hook","init","link","run","user","walker"]),c.z.string()]).describe("Collector command type: standard commands or custom string for extensions"),bn=c.z.object({run:c.z.boolean().describe("Whether to run collector automatically on initialization").optional(),tagging:g,globalsStatic:Y.describe("Static global properties that persist across collector runs"),sessionStatic:c.z.record(c.z.string(),c.z.unknown()).describe("Static session data that persists across collector runs"),verbose:c.z.boolean().describe("Enable verbose logging for debugging"),onError:w.optional(),onLog:k.optional()}).describe("Core collector configuration"),fn=Y.and(c.z.object({isStart:c.z.boolean().describe("Whether this is a new session start"),storage:c.z.boolean().describe("Whether storage is available"),id:m.describe("Session identifier").optional(),start:b.describe("Session start timestamp").optional(),marketing:c.z.literal(!0).optional().describe("Marketing attribution flag"),updated:b.describe("Last update timestamp").optional(),isNew:c.z.boolean().describe("Whether this is a new session").optional(),device:m.describe("Device identifier").optional(),count:f.describe("Event count in session").optional(),runs:f.describe("Number of runs").optional()})).describe("Session state and tracking data"),gn=bn.partial().extend({consent:ne.optional().describe("Initial consent state"),user:ie.optional().describe("Initial user data"),globals:Y.optional().describe("Initial global properties"),sources:c.z.unknown().optional().describe("Source configurations"),destinations:c.z.unknown().optional().describe("Destination configurations"),custom:Y.optional().describe("Initial custom implementation-specific properties")}).describe("Collector initialization configuration with initial state"),hn=c.z.object({mapping:Je.optional().describe("Source-level mapping configuration")}).describe("Push context with optional source mapping"),zn=c.z.record(c.z.string(),c.z.unknown()).describe("Map of source IDs to source instances"),vn=c.z.record(c.z.string(),c.z.unknown()).describe("Map of destination IDs to destination instances"),Sn=c.z.object({push:c.z.unknown().describe("Push function for processing events"),command:c.z.unknown().describe("Command function for walker commands"),allowed:c.z.boolean().describe("Whether event processing is allowed"),config:bn.describe("Current collector configuration"),consent:ne.describe("Current consent state"),count:c.z.number().describe("Event count (increments with each event)"),custom:Y.describe("Custom implementation-specific properties"),sources:zn.describe("Registered source instances"),destinations:vn.describe("Registered destination instances"),globals:Y.describe("Current global properties"),group:c.z.string().describe("Event grouping identifier"),hooks:c.z.unknown().describe("Lifecycle hook functions"),on:c.z.unknown().describe("Event lifecycle configuration"),queue:c.z.array(se).describe("Queued events awaiting processing"),round:c.z.number().describe("Collector run count (increments with each run)"),session:c.z.union([fn]).describe("Current session state"),timing:c.z.number().describe("Event processing timing information"),user:ie.describe("Current user data"),version:c.z.string().describe("Walker implementation version")}).describe("Collector instance with state and methods"),yn=l(mn),wn=l(bn),kn=l(fn),jn=l(gn),Cn=l(hn),xn=l(Sn),Pn={};r(Pn,{BaseEnvSchema:()=>Jn,ConfigSchema:()=>En,InitSchema:()=>On,InitSourceSchema:()=>Rn,InitSourcesSchema:()=>Ln,InstanceSchema:()=>In,PartialConfigSchema:()=>Dn,baseEnvJsonSchema:()=>Nn,configJsonSchema:()=>Tn,initSourceJsonSchema:()=>Un,initSourcesJsonSchema:()=>Vn,instanceJsonSchema:()=>Mn,partialConfigJsonSchema:()=>qn});var Jn=c.z.object({push:c.z.unknown().describe("Collector push function"),command:c.z.unknown().describe("Collector command function"),sources:c.z.unknown().optional().describe("Map of registered source instances"),elb:c.z.unknown().describe("Public API function (alias for collector.push)")}).catchall(c.z.unknown()).describe("Base environment for dependency injection - platform-specific sources extend this"),En=Je.extend({settings:c.z.any().describe("Implementation-specific configuration").optional(),env:Jn.optional().describe("Environment dependencies (platform-specific)"),id:m.describe("Source identifier (defaults to source key)").optional(),onError:w.optional(),primary:c.z.boolean().describe("Mark as primary (only one can be primary)").optional()}).describe("Source configuration with mapping and environment"),Dn=En.partial().describe("Partial source configuration with all fields optional"),In=c.z.object({type:c.z.string().describe('Source type identifier (e.g., "browser", "dataLayer")'),config:En.describe("Current source configuration"),push:c.z.any().describe("Push function - THE HANDLER (flexible signature for platform compatibility)"),destroy:c.z.any().optional().describe("Cleanup function called when source is removed"),on:c.z.unknown().optional().describe("Lifecycle hook function for event types")}).describe("Source instance with push handler and lifecycle methods"),On=c.z.any().describe("Source initialization function: (config, env) => Instance | Promise<Instance>"),Rn=c.z.object({code:On.describe("Source initialization function"),config:Dn.optional().describe("Partial configuration overrides"),env:Jn.partial().optional().describe("Partial environment overrides"),primary:c.z.boolean().optional().describe("Mark as primary source (only one can be primary)")}).describe("Source initialization configuration"),Ln=c.z.record(c.z.string(),Rn).describe("Map of source IDs to initialization configurations"),Nn=l(Jn),Tn=l(En),qn=l(Dn),Mn=l(In),Un=l(Rn),Vn=l(Ln),Wn={};r(Wn,{ConfigSchema:()=>ti,ContractActionsSchema:()=>ni,ContractSchema:()=>ii,ContractSchemaEntry:()=>ei,DefinitionsSchema:()=>An,DestinationReferenceSchema:()=>Zn,InlineCodeSchema:()=>Qn,PackagesSchema:()=>Fn,PrimitiveSchema:()=>$n,ServerSchema:()=>Gn,SetupSchema:()=>si,SetupV2Schema:()=>ai,SourceReferenceSchema:()=>Xn,StepExampleSchema:()=>_n,StepExamplesSchema:()=>Kn,TransformerReferenceSchema:()=>Yn,VariablesSchema:()=>Bn,WebSchema:()=>Hn,configJsonSchema:()=>bi,destinationReferenceJsonSchema:()=>gi,parseConfig:()=>di,parseSetup:()=>ci,safeParseConfig:()=>pi,safeParseSetup:()=>li,setupJsonSchema:()=>ui,setupV2JsonSchema:()=>mi,sourceReferenceJsonSchema:()=>fi,transformerReferenceJsonSchema:()=>hi});var $n=c.z.union([c.z.string(),c.z.number(),c.z.boolean()]).describe("Primitive value: string, number, or boolean"),Bn=c.z.record(c.z.string(),$n).describe("Variables for interpolation"),An=c.z.record(c.z.string(),c.z.unknown()).describe("Reusable configuration definitions"),Fn=c.z.record(c.z.string(),c.z.object({version:c.z.string().optional(),imports:c.z.array(c.z.string()).optional(),path:c.z.string().optional()})).describe("NPM packages to bundle"),Hn=c.z.object({windowCollector:c.z.string().optional().default("collector").describe('Window property name for the collector instance (default: "collector")'),windowElb:c.z.string().optional().default("elb").describe('Window property name for the elb command queue (default: "elb")')}).describe("Web platform configuration"),Gn=c.z.object({}).passthrough().describe("Server platform configuration (reserved for future options)"),Qn=c.z.object({push:c.z.string().min(1,"Push function cannot be empty").describe('JavaScript function for processing events. Must start with "$code:" prefix. Example: "$code:(event) => { console.log(event); }"'),type:c.z.string().optional().describe("Optional type identifier for the inline instance"),init:c.z.string().optional().describe("Optional initialization function. Use $code: prefix for inline JavaScript.")}).describe("Inline code for custom sources/transformers/destinations"),_n=c.z.object({in:c.z.unknown().optional().describe("Input to the step"),out:c.z.unknown().optional().describe("Expected output from the step")}).describe("Named example with input/output pair"),Kn=c.z.record(c.z.string(),_n).describe("Named step examples for testing and documentation"),Xn=c.z.object({package:c.z.string().min(1,"Package name cannot be empty").optional().describe('Package specifier with optional version (e.g., "@walkeros/web-source-browser@2.0.0")'),code:c.z.union([c.z.string(),Qn]).optional().describe('Either a named export string (e.g., "sourceExpress") or an inline code object with push function'),config:c.z.unknown().optional().describe("Source-specific configuration object"),env:c.z.unknown().optional().describe("Source environment configuration"),primary:c.z.boolean().optional().describe("Mark as primary source (provides main elb). Only one source should be primary."),variables:Bn.optional().describe("Source-level variables (highest priority in cascade)"),definitions:An.optional().describe("Source-level definitions (highest priority in cascade)"),next:c.z.union([c.z.string(),c.z.array(c.z.string())]).optional().describe("First transformer in post-source chain. If omitted, events route directly to collector."),examples:Kn.optional().describe("Named step examples for testing and documentation (stripped during bundling)")}).describe("Source package reference with configuration"),Yn=c.z.object({package:c.z.string().min(1,"Package name cannot be empty").optional().describe('Package specifier with optional version (e.g., "@walkeros/transformer-enricher@1.0.0")'),code:c.z.union([c.z.string(),Qn]).optional().describe('Either a named export string (e.g., "transformerEnricher") or an inline code object with push function'),config:c.z.unknown().optional().describe("Transformer-specific configuration object"),env:c.z.unknown().optional().describe("Transformer environment configuration"),next:c.z.union([c.z.string(),c.z.array(c.z.string())]).optional().describe("Next transformer in chain. If omitted: pre-collector routes to collector, post-collector routes to destination."),variables:Bn.optional().describe("Transformer-level variables (highest priority in cascade)"),definitions:An.optional().describe("Transformer-level definitions (highest priority in cascade)"),examples:Kn.optional().describe("Named step examples for testing and documentation (stripped during bundling)")}).describe("Transformer package reference with configuration"),Zn=c.z.object({package:c.z.string().min(1,"Package name cannot be empty").optional().describe('Package specifier with optional version (e.g., "@walkeros/web-destination-gtag@2.0.0")'),code:c.z.union([c.z.string(),Qn]).optional().describe('Either a named export string (e.g., "destinationAnalytics") or an inline code object with push function'),config:c.z.unknown().optional().describe("Destination-specific configuration object"),env:c.z.unknown().optional().describe("Destination environment configuration"),variables:Bn.optional().describe("Destination-level variables (highest priority in cascade)"),definitions:An.optional().describe("Destination-level definitions (highest priority in cascade)"),before:c.z.union([c.z.string(),c.z.array(c.z.string())]).optional().describe("First transformer in pre-destination chain. If omitted, events are sent directly from collector."),examples:Kn.optional().describe("Named step examples for testing and documentation (stripped during bundling)")}).describe("Destination package reference with configuration"),ei=c.z.record(c.z.string(),c.z.unknown()).describe("JSON Schema object for event validation with description/examples annotations"),ni=c.z.record(c.z.string(),ei).describe("Action-level contract entries"),ii=c.z.record(c.z.string(),c.z.union([ni,c.z.number()])).describe("Data contract: entity-action keyed JSON Schema with additive inheritance"),ti=c.z.object({web:Hn.optional().describe("Web platform configuration (browser-based tracking). Mutually exclusive with server."),server:Gn.optional().describe("Server platform configuration (Node.js). Mutually exclusive with web."),contract:ii.optional().describe("Flow-level data contract (merges on top of Setup-level contract)"),sources:c.z.record(c.z.string(),Xn).optional().describe("Source configurations (data capture) keyed by unique identifier"),destinations:c.z.record(c.z.string(),Zn).optional().describe("Destination configurations (data output) keyed by unique identifier"),transformers:c.z.record(c.z.string(),Yn).optional().describe("Transformer configurations (event transformation) keyed by unique identifier"),collector:c.z.unknown().optional().describe("Collector configuration for event processing (uses Collector.InitConfig)"),packages:Fn.optional().describe("NPM packages to bundle"),variables:Bn.optional().describe("Flow-level variables (override Setup.variables, overridden by source/destination variables)"),definitions:An.optional().describe("Flow-level definitions (extend Setup.definitions, overridden by source/destination definitions)")}).refine(e=>{const n=void 0!==e.web,i=void 0!==e.server;return(n||i)&&!(n&&i)},{message:'Exactly one of "web" or "server" must be present'}).describe("Single flow configuration for one deployment target"),oi=c.z.object({$schema:c.z.string().url("Schema URL must be a valid URL").optional().describe('JSON Schema reference for IDE validation (e.g., "https://walkeros.io/schema/flow/v2.json")'),include:c.z.array(c.z.string()).optional().describe("Folders to include in the bundle output"),variables:Bn.optional().describe("Shared variables for interpolation across all flows (use $var.name syntax)"),definitions:An.optional().describe("Reusable configuration definitions (use $def.name syntax)"),flows:c.z.record(c.z.string(),ti).refine(e=>Object.keys(e).length>0,{message:"At least one flow is required"}).describe("Named flow configurations (e.g., production, staging, development)")}),ri=oi.extend({version:c.z.literal(1).describe("Configuration schema version 1")}).describe("walkerOS v1 configuration"),ai=oi.extend({version:c.z.literal(2).describe("Configuration schema version 2"),contract:ii.optional().describe("Data contract: entity-action keyed JSON Schema with additive inheritance")}).describe("walkerOS v2 configuration with data contracts"),si=c.z.union([ri,ai]).describe("Complete multi-flow walkerOS configuration (walkeros.config.json)");function ci(e){return si.parse(e)}function li(e){return si.safeParse(e)}function di(e){return ti.parse(e)}function pi(e){return ti.safeParse(e)}var ui=c.z.toJSONSchema(si,{target:"draft-7"}),mi=c.z.toJSONSchema(ai,{target:"draft-7"}),bi=l(ti),fi=l(Xn),gi=l(Zn),hi=l(Yn);function zi(e){let n;try{n=JSON.parse(e)}catch(n){const{line:i,column:t}=function(e,n){if(e instanceof SyntaxError){const i=e.message.match(/position\s+(\d+)/);if(i){return vi(n,parseInt(i[1],10))}const t=e.message.match(/line\s+(\d+)\s+column\s+(\d+)/);if(t)return{line:parseInt(t[1],10),column:parseInt(t[2],10)}}return{line:1,column:1}}(n,e);return{valid:!1,errors:[{message:n instanceof Error?n.message:"Invalid JSON",severity:"error",line:i,column:t}],warnings:[]}}const i=[],t=[],o=si.safeParse(n);if(!o.success)for(const n of o.error.issues){const t=n.path.join("."),o=yi(e,n.path);i.push({message:n.message,severity:"error",path:t||"root",...o})}const r=function(e){if(!(wi(e)&&"version"in e&&"flows"in e&&wi(e.flows)))return;const n={},i={},t=[],o=[],r=[],a=[],s=[];let c;ji(n,e.variables),Ci(i,e.definitions),xi(s,e.contract);for(const l of Object.values(e.flows))if(wi(l)){c||("web"in l?c="web":"server"in l&&(c="server")),ji(n,l.variables),Ci(i,l.definitions),xi(s,l.contract);for(const e of["sources","destinations","transformers"]){const s="sources"===e?"source":"destinations"===e?"destination":"transformer",d="sources"===e?t:"destinations"===e?o:r;if(wi(l[e]))for(const[t,o]of Object.entries(l[e]))d.push(t),wi(o)&&(ji(n,o.variables),Ci(i,o.definitions),"string"==typeof o.package&&a.push({package:o.package,shortName:t,type:s,platform:c||"web"}))}}const l={variables:n,definitions:i,stepNames:{sources:t,destinations:o,transformers:r}};c&&(l.platform=c);a.length>0&&(l.packages=a);s.length>0&&(l.contract=s);return l}(n);if(r){const n=function(e,n){const i=[];if(n.variables){const t=/\$var\.(\w+)/g;let o;for(;null!==(o=t.exec(e));)if(!(o[1]in n.variables)){const t=Si(e,o.index,o[0].length);i.push({message:`Unknown variable "$var.${o[1]}". Defined: ${Object.keys(n.variables).join(", ")||"none"}`,severity:"warning",path:`$var.${o[1]}`,...t})}}if(n.definitions){const t=/\$def\.(\w+)/g;let o;for(;null!==(o=t.exec(e));)if(!(o[1]in n.definitions)){const t=Si(e,o.index,o[0].length);i.push({message:`Unknown definition "$def.${o[1]}". Defined: ${Object.keys(n.definitions).join(", ")||"none"}`,severity:"warning",path:`$def.${o[1]}`,...t})}}return i}(e,r);t.push(...n)}return{valid:0===i.length,errors:i,warnings:t,context:r}}function vi(e,n){let i=1,t=1;for(let o=0;o<n&&o<e.length;o++)"\n"===e[o]?(i++,t=1):t++;return{line:i,column:t}}function Si(e,n,i){const t=vi(e,n),o=vi(e,n+i);return{line:t.line,column:t.column,endLine:o.line,endColumn:o.column}}function yi(e,n){if(0===n.length)return{line:1,column:1};const i=n[n.length-1];if("string"==typeof i){const n=`"${i}"`,t=e.lastIndexOf(n);if(-1!==t)return vi(e,t)}return{line:1,column:1}}function wi(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function ki(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e}function ji(e,n){if(wi(n))for(const[i,t]of Object.entries(n))ki(t)&&(e[i]=t)}function Ci(e,n){if(wi(n))for(const[i,t]of Object.entries(n))e[i]=t}function xi(e,n){if(wi(n))for(const[i,t]of Object.entries(n)){if(i.startsWith("$")||!wi(t))continue;const n=e.find(e=>e.entity===i),o=Object.keys(t);if(n)for(const e of o)n.actions.includes(e)||n.actions.push(e);else e.push({entity:i,actions:o})}}function Pi(e,n){const i=[],t={};for(const[n,o]of Object.entries(e)){o.required&&i.push(n);const e={type:o.type};if(o.description&&(e.description=o.description),o.pattern&&(e.pattern=o.pattern),void 0!==o.minLength&&(e.minLength=o.minLength),void 0!==o.maxLength&&(e.maxLength=o.maxLength),void 0!==o.minimum&&(e.minimum=o.minimum),void 0!==o.maximum&&(e.maximum=o.maximum),o.enum&&(e.enum=[...o.enum]),void 0!==o.default&&(e.default=o.default),"object"===o.type&&o.properties){const n={};for(const[e,i]of Object.entries(o.properties))n[e]=Ji(i);e.properties=n}"array"===o.type&&o.items&&(e.items=Ji(o.items)),t[n]=e}const o={type:"object",properties:t};return n&&(o.title=n),i.length>0&&(o.required=i),o}function Ji(e){const n={type:e.type};if(e.description&&(n.description=e.description),e.pattern&&(n.pattern=e.pattern),void 0!==e.minLength&&(n.minLength=e.minLength),void 0!==e.maxLength&&(n.maxLength=e.maxLength),void 0!==e.minimum&&(n.minimum=e.minimum),void 0!==e.maximum&&(n.maximum=e.maximum),e.enum&&(n.enum=[...e.enum]),void 0!==e.default&&(n.default=e.default),"object"===e.type&&e.properties){const i={};for(const[n,t]of Object.entries(e.properties))i[n]=Ji(t);n.properties=i}return"array"===e.type&&e.items&&(n.items=Ji(e.items)),n}function Ei(e,n){const i={type:"array",items:Ji(e)};return void 0!==n?.minItems&&(i.minItems=n.minItems),void 0!==n?.maxItems&&(i.maxItems=n.maxItems),n?.description&&(i.description=n.description),n?.title&&(i.title=n.title),i}function Di(e,n="string",i){const t={type:n,enum:[...e]};return i?.description&&(t.description=i.description),i?.title&&(t.title=i.title),t}function Ii(e,n,i){return Ei({type:"object"},{minItems:2,maxItems:2,description:i||"Tuple with exactly 2 elements [source, transform]"})}function Oi(e){return c.z.toJSONSchema(e,{target:"draft-7"})}//# sourceMappingURL=dev.js.map
1
+ "use strict";var e,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,r=(e,i)=>{for(var t in i)n(e,t,{get:i[t],enumerable:!0})},a={};r(a,{schemas:()=>s,z:()=>c.z,zodToSchema:()=>Li}),module.exports=(e=a,((e,r,a,s)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let c of t(r))o.call(e,c)||c===a||n(e,c,{get:()=>r[c],enumerable:!(s=i(r,c))||s.enumerable});return e})(n({},"__esModule",{value:!0}),e));var s={};r(s,{BaseContextConfig:()=>B,BatchConfig:()=>A,CollectorSchemas:()=>un,ConsentSchema:()=>ne,ContractActionsSchema:()=>ii,ContractSchema:()=>ti,ContractSchemaEntry:()=>ni,Counter:()=>f,DeepPartialEventSchema:()=>le,DestinationReferenceSchema:()=>Zn,DestinationSchemas:()=>Ue,DestinationsMapConfig:()=>G,EntitiesSchema:()=>ae,EntitySchema:()=>re,EventSchema:()=>se,FlowConfigSchema:()=>oi,FlowSchemas:()=>Wn,GenericEnvConfig:()=>T,GenericSettingsConfig:()=>q,HandlersConfig:()=>D,IdConfig:()=>R,Identifier:()=>m,InitConfig:()=>L,LoopSchema:()=>ye,MapSchema:()=>ke,MappingResultSchema:()=>Ee,MappingSchemas:()=>ze,OptionalPrimitiveValue:()=>z,OrderedPropertiesSchema:()=>Z,PartialEventSchema:()=>ce,PolicySchema:()=>Ce,PrimaryConfig:()=>N,PrimitiveSchema:()=>$n,PrimitiveValue:()=>h,ProcessingControlConfig:()=>F,PropertiesSchema:()=>Y,PropertySchema:()=>X,PropertyTypeSchema:()=>K,QueueConfig:()=>O,RequiredBoolean:()=>u,RequiredNumber:()=>p,RequiredString:()=>d,RuleSchema:()=>xe,RulesSchema:()=>Pe,RuntimeInstanceConfig:()=>$,SetSchema:()=>we,SetupSchema:()=>ci,SetupV2Schema:()=>si,SourceReferenceSchema:()=>Xn,SourceSchema:()=>oe,SourceSchemas:()=>Pn,SourceTypeSchema:()=>ee,SourcesMapConfig:()=>H,StoreReferenceSchema:()=>ei,TaggingVersion:()=>g,Timestamp:()=>b,UserSchema:()=>ie,UtilitySchemas:()=>v,ValueConfigSchema:()=>je,ValueSchema:()=>ve,ValuesSchema:()=>Se,VerboseConfig:()=>I,VersionSchema:()=>te,WalkerOSSchemas:()=>Q,configJsonSchema:()=>fi,consentJsonSchema:()=>he,createArraySchema:()=>Ii,createConsentConfig:()=>W,createDataTransformationConfig:()=>M,createEnumSchema:()=>Oi,createMappingRulesConfig:()=>U,createObjectSchema:()=>Ei,createPolicyConfig:()=>V,createTupleSchema:()=>Ri,destinationReferenceJsonSchema:()=>hi,entityJsonSchema:()=>fe,eventJsonSchema:()=>de,loopJsonSchema:()=>Oe,mapJsonSchema:()=>Le,orderedPropertiesJsonSchema:()=>be,parseConfig:()=>pi,parseSetup:()=>li,partialEventJsonSchema:()=>pe,policyJsonSchema:()=>Ne,propertiesJsonSchema:()=>me,ruleJsonSchema:()=>qe,rulesJsonSchema:()=>Te,safeParseConfig:()=>ui,safeParseSetup:()=>di,setJsonSchema:()=>Re,setupJsonSchema:()=>mi,setupV2JsonSchema:()=>bi,sourceReferenceJsonSchema:()=>gi,sourceTypeJsonSchema:()=>ge,storeReferenceJsonSchema:()=>vi,userJsonSchema:()=>ue,validateFlowSetup:()=>Si,valueConfigJsonSchema:()=>Ie,valueJsonSchema:()=>De,z:()=>c.z,zodToSchema:()=>Li});var c=require("zod");function l(e,n,i="draft-7"){return c.z.toJSONSchema(e,{target:i})}var d=c.z.string(),p=c.z.number(),u=c.z.boolean(),m=c.z.string().min(1),b=c.z.number().int().positive(),f=c.z.number().int().nonnegative(),g=c.z.number().describe("Tagging version number"),h=c.z.union([c.z.string(),c.z.number(),c.z.boolean()]),z=h.optional(),v={};r(v,{ErrorHandlerSchema:()=>w,HandlerSchema:()=>j,LogHandlerSchema:()=>k,StorageSchema:()=>y,StorageTypeSchema:()=>S,errorHandlerJsonSchema:()=>P,handlerJsonSchema:()=>E,logHandlerJsonSchema:()=>J,storageJsonSchema:()=>x,storageTypeJsonSchema:()=>C});var S=c.z.enum(["local","session","cookie"]).describe("Storage mechanism: local, session, or cookie"),y=c.z.object({Local:c.z.literal("local"),Session:c.z.literal("session"),Cookie:c.z.literal("cookie")}).describe("Storage type constants for type-safe references"),w=c.z.any().describe("Error handler function: (error, state?) => void"),k=c.z.any().describe("Log handler function: (message, verbose?) => void"),j=c.z.object({Error:w.describe("Error handler function"),Log:k.describe("Log handler function")}).describe("Handler interface with error and log functions"),C=l(S),x=l(y),P=l(w),J=l(k),E=l(j),D=c.z.object({onError:w.optional().describe("Error handler function: (error, state?) => void"),onLog:k.optional().describe("Log handler function: (message, verbose?) => void")}).partial(),I=c.z.object({verbose:c.z.boolean().describe("Enable verbose logging for debugging").optional()}).partial(),O=c.z.object({queue:c.z.boolean().describe("Whether to queue events when consent is not granted").optional()}).partial(),R=c.z.object({}).partial(),L=c.z.object({init:c.z.boolean().describe("Whether to initialize immediately").optional(),loadScript:c.z.boolean().describe("Whether to load external script (for web destinations)").optional()}).partial(),N=c.z.object({primary:c.z.boolean().describe("Mark as primary (only one can be primary)").optional()}).partial(),q=c.z.object({settings:c.z.any().optional().describe("Implementation-specific configuration")}).partial(),T=c.z.object({env:c.z.any().optional().describe("Environment dependencies (platform-specific)")}).partial();function M(e,n){return c.z.object({data:c.z.union([e,n]).optional().describe("Data transformation rules")}).partial()}function U(e){return c.z.object({mapping:e.optional().describe("Event mapping rules")}).partial()}function V(e){return c.z.object({policy:e.optional().describe("Pre-processing policy rules")}).partial()}function W(e){return c.z.object({consent:e.optional().describe("Required consent states")}).partial()}var $=c.z.object({type:c.z.string().optional().describe("Instance type identifier"),config:c.z.unknown().describe("Instance configuration")}).partial(),B=c.z.object({collector:c.z.unknown().describe("Collector instance (runtime object)"),config:c.z.unknown().describe("Configuration"),env:c.z.unknown().describe("Environment dependencies")}).partial(),A=c.z.object({batch:c.z.number().optional().describe("Batch size: bundle N events for batch processing"),batched:c.z.unknown().optional().describe("Batch of events to be processed")}).partial(),F=c.z.object({ignore:c.z.boolean().describe("Set to true to skip processing").optional(),condition:c.z.string().optional().describe("Condition function: return true to process")}).partial(),H=c.z.object({sources:c.z.record(c.z.string(),c.z.unknown()).describe("Map of source instances")}).partial(),G=c.z.object({destinations:c.z.record(c.z.string(),c.z.unknown()).describe("Map of destination instances")}).partial(),Q={};r(Q,{ConsentSchema:()=>ne,DeepPartialEventSchema:()=>le,EntitiesSchema:()=>ae,EntitySchema:()=>re,EventSchema:()=>se,OrderedPropertiesSchema:()=>Z,PartialEventSchema:()=>ce,PropertiesSchema:()=>Y,PropertySchema:()=>X,PropertyTypeSchema:()=>K,SourceSchema:()=>oe,SourceTypeSchema:()=>ee,UserSchema:()=>ie,VersionSchema:()=>te,consentJsonSchema:()=>he,entityJsonSchema:()=>fe,eventJsonSchema:()=>de,orderedPropertiesJsonSchema:()=>be,partialEventJsonSchema:()=>pe,propertiesJsonSchema:()=>me,sourceTypeJsonSchema:()=>ge,userJsonSchema:()=>ue});var _,K=c.z.lazy(()=>c.z.union([c.z.boolean(),c.z.string(),c.z.number(),c.z.record(c.z.string(),X)])),X=c.z.lazy(()=>c.z.union([K,c.z.array(K)])),Y=c.z.record(c.z.string(),X.optional()).describe("Flexible property collection with optional values"),Z=c.z.record(c.z.string(),c.z.tuple([X,c.z.number()]).optional()).describe("Ordered properties with [value, order] tuples for priority control"),ee=c.z.union([c.z.enum(["web","server","app","other"]),c.z.string()]).describe("Source type: web, server, app, other, or custom"),ne=c.z.record(c.z.string(),c.z.boolean()).describe("Consent requirement mapping (group name → state)"),ie=Y.and(c.z.object({id:c.z.string().optional().describe("User identifier"),device:c.z.string().optional().describe("Device identifier"),session:c.z.string().optional().describe("Session identifier"),hash:c.z.string().optional().describe("Hashed identifier"),address:c.z.string().optional().describe("User address"),email:c.z.string().email().optional().describe("User email address"),phone:c.z.string().optional().describe("User phone number"),userAgent:c.z.string().optional().describe("Browser user agent string"),browser:c.z.string().optional().describe("Browser name"),browserVersion:c.z.string().optional().describe("Browser version"),deviceType:c.z.string().optional().describe("Device type (mobile, desktop, tablet)"),os:c.z.string().optional().describe("Operating system"),osVersion:c.z.string().optional().describe("Operating system version"),screenSize:c.z.string().optional().describe("Screen dimensions"),language:c.z.string().optional().describe("User language"),country:c.z.string().optional().describe("User country"),region:c.z.string().optional().describe("User region/state"),city:c.z.string().optional().describe("User city"),zip:c.z.string().optional().describe("User postal code"),timezone:c.z.string().optional().describe("User timezone"),ip:c.z.string().optional().describe("User IP address"),internal:c.z.boolean().optional().describe("Internal user flag (employee, test user)")})).describe("User identification and properties"),te=Y.and(c.z.object({source:d.describe('Walker implementation version (e.g., "2.0.0")'),tagging:g})).describe("Walker version information"),oe=Y.and(c.z.object({type:ee.describe("Source type identifier"),id:d.describe("Source identifier (typically URL on web)"),previous_id:d.describe("Previous source identifier (typically referrer on web)")})).describe("Event source information"),re=c.z.lazy(()=>c.z.object({entity:c.z.string().describe("Entity name"),data:Y.describe("Entity-specific properties"),nested:c.z.array(re).describe("Nested child entities"),context:Z.describe("Entity context data")})).describe("Nested entity structure with recursive nesting support"),ae=c.z.array(re).describe("Array of nested entities"),se=c.z.object({name:c.z.string().describe('Event name in "entity action" format (e.g., "page view", "product add")'),data:Y.describe("Event-specific properties"),context:Z.describe("Ordered context properties with priorities"),globals:Y.describe("Global properties shared across events"),custom:Y.describe("Custom implementation-specific properties"),user:ie.describe("User identification and attributes"),nested:ae.describe("Related nested entities"),consent:ne.describe("Consent states at event time"),id:m.describe("Unique event identifier (timestamp-based)"),trigger:d.describe("Event trigger identifier"),entity:d.describe("Parsed entity from event name"),action:d.describe("Parsed action from event name"),timestamp:b.describe("Unix timestamp in milliseconds since epoch"),timing:p.describe("Event processing timing information"),group:d.describe("Event grouping identifier"),count:f.describe("Event count in session"),version:te.describe("Walker version information"),source:oe.describe("Event source information")}).describe("Complete walkerOS event structure"),ce=se.partial().describe("Partial event structure with all fields optional"),le=se.partial().describe("Partial event structure with all top-level fields optional"),de=l(se),pe=l(ce),ue=l(ie),me=l(Y),be=l(Z),fe=l(re),ge=l(ee),he=l(ne),ze={};r(ze,{ConfigSchema:()=>Je,LoopSchema:()=>ye,MapSchema:()=>ke,PolicySchema:()=>Ce,ResultSchema:()=>Ee,RuleSchema:()=>xe,RulesSchema:()=>Pe,SetSchema:()=>we,ValueConfigSchema:()=>je,ValueSchema:()=>ve,ValuesSchema:()=>Se,configJsonSchema:()=>Me,loopJsonSchema:()=>Oe,mapJsonSchema:()=>Le,policyJsonSchema:()=>Ne,ruleJsonSchema:()=>qe,rulesJsonSchema:()=>Te,setJsonSchema:()=>Re,valueConfigJsonSchema:()=>Ie,valueJsonSchema:()=>De});var ve=c.z.lazy(()=>c.z.union([c.z.string().describe('String value or property path (e.g., "data.id")'),c.z.number().describe("Numeric value"),c.z.boolean().describe("Boolean value"),c.z.lazy(()=>_),c.z.array(ve).describe("Array of values")])),Se=c.z.array(ve).describe("Array of transformation values"),ye=c.z.lazy(()=>c.z.tuple([ve,ve]).describe("Loop transformation: [source, transform] tuple for array processing")),we=c.z.lazy(()=>c.z.array(ve).describe("Set: Array of values for selection or combination")),ke=c.z.lazy(()=>c.z.record(c.z.string(),ve).describe("Map: Object mapping keys to transformation values")),je=_=c.z.object({key:c.z.string().optional().describe('Property path to extract from event (e.g., "data.id", "user.email")'),value:c.z.union([c.z.string(),c.z.number(),c.z.boolean()]).optional().describe("Static primitive value"),fn:c.z.string().optional().describe("Custom transformation function as string (serialized)"),map:ke.optional().describe("Object mapping: transform event data to structured output"),loop:ye.optional().describe("Loop transformation: [source, transform] for array processing"),set:we.optional().describe("Set of values: combine or select from multiple values"),consent:ne.optional().describe("Required consent states to include this value"),condition:c.z.string().optional().describe("Condition function as string: return true to include value"),validate:c.z.string().optional().describe("Validation function as string: return true if value is valid")}).refine(e=>Object.keys(e).length>0,{message:"ValueConfig must have at least one property"}).describe("Value transformation configuration with multiple strategies"),Ce=c.z.record(c.z.string(),ve).describe("Policy rules for event pre-processing (key → value mapping)"),xe=c.z.object({batch:c.z.number().optional().describe("Batch size: bundle N events for batch processing"),condition:c.z.string().optional().describe("Condition function as string: return true to process event"),consent:ne.optional().describe("Required consent states to process this event"),settings:c.z.any().optional().describe("Destination-specific settings for this event mapping"),data:c.z.union([ve,Se]).optional().describe("Data transformation rules for event"),ignore:c.z.boolean().optional().describe("Set to true to skip processing this event"),name:c.z.string().optional().describe('Custom event name override (e.g., "view_item" for "product view")'),policy:Ce.optional().describe("Event-level policy overrides (applied after config-level policy)")}).describe("Mapping rule for specific entity-action combination"),Pe=c.z.record(c.z.string(),c.z.record(c.z.string(),c.z.union([xe,c.z.array(xe)])).optional()).describe("Nested mapping rules: { entity: { action: Rule | Rule[] } } with wildcard support"),Je=c.z.object({consent:ne.optional().describe("Required consent states to process any events"),data:c.z.union([ve,Se]).optional().describe("Global data transformation applied to all events"),mapping:Pe.optional().describe("Entity-action specific mapping rules"),policy:Ce.optional().describe("Pre-processing policy rules applied before mapping")}).describe("Shared mapping configuration for sources and destinations"),Ee=c.z.object({eventMapping:xe.optional().describe("Resolved mapping rule for event"),mappingKey:c.z.string().optional().describe('Mapping key used (e.g., "product.view")')}).describe("Mapping resolution result"),De=l(ve),Ie=l(je),Oe=l(ye),Re=l(we),Le=l(ke),Ne=l(Ce),qe=l(xe),Te=l(Pe),Me=l(Je),Ue={};r(Ue,{BatchSchema:()=>Qe,ConfigSchema:()=>Ve,ContextSchema:()=>Be,DLQSchema:()=>on,DataSchema:()=>_e,DestinationPolicySchema:()=>$e,DestinationsSchema:()=>Ze,InitDestinationsSchema:()=>Ye,InitSchema:()=>Xe,InstanceSchema:()=>Ke,PartialConfigSchema:()=>We,PushBatchContextSchema:()=>Fe,PushContextSchema:()=>Ae,PushEventSchema:()=>He,PushEventsSchema:()=>Ge,PushResultSchema:()=>nn,RefSchema:()=>en,ResultSchema:()=>tn,batchJsonSchema:()=>ln,configJsonSchema:()=>rn,contextJsonSchema:()=>sn,instanceJsonSchema:()=>dn,partialConfigJsonSchema:()=>an,pushContextJsonSchema:()=>cn,resultJsonSchema:()=>pn});var Ve=c.z.object({consent:ne.optional().describe("Required consent states to send events to this destination"),settings:c.z.any().describe("Implementation-specific configuration").optional(),data:c.z.union([ve,Se]).optional().describe("Global data transformation applied to all events for this destination"),env:c.z.any().describe("Environment dependencies (platform-specific)").optional(),id:m.describe("Destination instance identifier (defaults to destination key)").optional(),init:c.z.boolean().describe("Whether to initialize immediately").optional(),loadScript:c.z.boolean().describe("Whether to load external script (for web destinations)").optional(),mapping:Pe.optional().describe("Entity-action specific mapping rules for this destination"),policy:Ce.optional().describe("Pre-processing policy rules applied before event mapping"),queue:c.z.boolean().describe("Whether to queue events when consent is not granted").optional(),verbose:c.z.boolean().describe("Enable verbose logging for debugging").optional(),onError:w.optional(),onLog:k.optional()}).describe("Destination configuration"),We=Ve.partial().describe("Partial destination configuration with all fields optional"),$e=Ce.describe("Destination policy rules for event pre-processing"),Be=c.z.object({collector:c.z.unknown().describe("Collector instance (runtime object)"),config:Ve.describe("Destination configuration"),data:c.z.union([c.z.unknown(),c.z.array(c.z.unknown())]).optional().describe("Transformed event data"),env:c.z.unknown().describe("Environment dependencies")}).describe("Destination context for init and push functions"),Ae=Be.extend({mapping:xe.optional().describe("Resolved mapping rule for this specific event")}).describe("Push context with event-specific mapping"),Fe=Ae.describe("Batch push context with event-specific mapping"),He=c.z.object({event:se.describe("The event to process"),mapping:xe.optional().describe("Mapping rule for this event")}).describe("Event with optional mapping for batch processing"),Ge=c.z.array(He).describe("Array of events with mappings"),Qe=c.z.object({key:c.z.string().describe('Batch key (usually mapping key like "product.view")'),events:c.z.array(se).describe("Array of events in batch"),data:c.z.array(c.z.union([c.z.unknown(),c.z.array(c.z.unknown())]).optional()).describe("Transformed data for each event"),mapping:xe.optional().describe("Shared mapping rule for batch")}).describe("Batch of events grouped by mapping key"),_e=c.z.union([c.z.unknown(),c.z.array(c.z.unknown())]).optional().describe("Transformed event data (Property, undefined, or array)"),Ke=c.z.object({config:Ve.describe("Destination configuration"),queue:c.z.array(se).optional().describe("Queued events awaiting consent"),dlq:c.z.array(c.z.tuple([se,c.z.unknown()])).optional().describe("Dead letter queue (failed events with errors)"),type:c.z.string().optional().describe("Destination type identifier"),env:c.z.unknown().optional().describe("Environment dependencies"),init:c.z.unknown().optional().describe("Initialization function"),push:c.z.unknown().describe("Push function for single events"),pushBatch:c.z.unknown().optional().describe("Batch push function"),on:c.z.unknown().optional().describe("Event lifecycle hook function")}).describe("Destination instance (runtime object with functions)"),Xe=c.z.object({code:Ke.describe("Destination instance with implementation"),config:We.optional().describe("Partial configuration overrides"),env:c.z.unknown().optional().describe("Partial environment overrides")}).describe("Destination initialization configuration"),Ye=c.z.record(c.z.string(),Xe).describe("Map of destination IDs to initialization configurations"),Ze=c.z.record(c.z.string(),Ke).describe("Map of destination IDs to runtime instances"),en=c.z.object({type:c.z.string().describe('Destination type ("gtag", "meta", "bigquery")'),data:c.z.unknown().optional().describe("Response from push()"),error:c.z.unknown().optional().describe("Error if failed")}).describe("Destination reference with type and response data"),nn=c.z.object({queue:c.z.array(se).optional().describe("Events queued (awaiting consent)"),error:c.z.unknown().optional().describe("Error if push failed")}).describe("Push operation result"),tn=c.z.object({ok:c.z.boolean().describe("True if nothing failed"),event:c.z.unknown().optional().describe("The processed event"),done:c.z.record(c.z.string(),en).optional().describe("Destinations that processed successfully"),queued:c.z.record(c.z.string(),en).optional().describe("Destinations that queued events"),failed:c.z.record(c.z.string(),en).optional().describe("Destinations that failed to process")}).describe("Push result with destination outcomes"),on=c.z.array(c.z.tuple([se,c.z.unknown()])).describe("Dead letter queue: [(event, error), ...]"),rn=l(Ve),an=l(We),sn=l(Be),cn=l(Ae),ln=l(Qe),dn=l(Ke),pn=l(tn),un={};r(un,{CommandTypeSchema:()=>mn,ConfigSchema:()=>bn,DestinationsSchema:()=>vn,InitConfigSchema:()=>gn,InstanceSchema:()=>Sn,PushContextSchema:()=>hn,SessionDataSchema:()=>fn,SourcesSchema:()=>zn,commandTypeJsonSchema:()=>yn,configJsonSchema:()=>wn,initConfigJsonSchema:()=>jn,instanceJsonSchema:()=>xn,pushContextJsonSchema:()=>Cn,sessionDataJsonSchema:()=>kn});var mn=c.z.union([c.z.enum(["action","config","consent","context","destination","elb","globals","hook","init","link","run","user","walker"]),c.z.string()]).describe("Collector command type: standard commands or custom string for extensions"),bn=c.z.object({run:c.z.boolean().describe("Whether to run collector automatically on initialization").optional(),tagging:g,globalsStatic:Y.describe("Static global properties that persist across collector runs"),sessionStatic:c.z.record(c.z.string(),c.z.unknown()).describe("Static session data that persists across collector runs"),verbose:c.z.boolean().describe("Enable verbose logging for debugging"),onError:w.optional(),onLog:k.optional()}).describe("Core collector configuration"),fn=Y.and(c.z.object({isStart:c.z.boolean().describe("Whether this is a new session start"),storage:c.z.boolean().describe("Whether storage is available"),id:m.describe("Session identifier").optional(),start:b.describe("Session start timestamp").optional(),marketing:c.z.literal(!0).optional().describe("Marketing attribution flag"),updated:b.describe("Last update timestamp").optional(),isNew:c.z.boolean().describe("Whether this is a new session").optional(),device:m.describe("Device identifier").optional(),count:f.describe("Event count in session").optional(),runs:f.describe("Number of runs").optional()})).describe("Session state and tracking data"),gn=bn.partial().extend({consent:ne.optional().describe("Initial consent state"),user:ie.optional().describe("Initial user data"),globals:Y.optional().describe("Initial global properties"),sources:c.z.unknown().optional().describe("Source configurations"),destinations:c.z.unknown().optional().describe("Destination configurations"),custom:Y.optional().describe("Initial custom implementation-specific properties")}).describe("Collector initialization configuration with initial state"),hn=c.z.object({mapping:Je.optional().describe("Source-level mapping configuration")}).describe("Push context with optional source mapping"),zn=c.z.record(c.z.string(),c.z.unknown()).describe("Map of source IDs to source instances"),vn=c.z.record(c.z.string(),c.z.unknown()).describe("Map of destination IDs to destination instances"),Sn=c.z.object({push:c.z.unknown().describe("Push function for processing events"),command:c.z.unknown().describe("Command function for walker commands"),allowed:c.z.boolean().describe("Whether event processing is allowed"),config:bn.describe("Current collector configuration"),consent:ne.describe("Current consent state"),count:c.z.number().describe("Event count (increments with each event)"),custom:Y.describe("Custom implementation-specific properties"),sources:zn.describe("Registered source instances"),destinations:vn.describe("Registered destination instances"),globals:Y.describe("Current global properties"),group:c.z.string().describe("Event grouping identifier"),hooks:c.z.unknown().describe("Lifecycle hook functions"),on:c.z.unknown().describe("Event lifecycle configuration"),queue:c.z.array(se).describe("Queued events awaiting processing"),round:c.z.number().describe("Collector run count (increments with each run)"),session:c.z.union([fn]).describe("Current session state"),timing:c.z.number().describe("Event processing timing information"),user:ie.describe("Current user data"),version:c.z.string().describe("Walker implementation version")}).describe("Collector instance with state and methods"),yn=l(mn),wn=l(bn),kn=l(fn),jn=l(gn),Cn=l(hn),xn=l(Sn),Pn={};r(Pn,{BaseEnvSchema:()=>Jn,ConfigSchema:()=>En,InitSchema:()=>On,InitSourceSchema:()=>Rn,InitSourcesSchema:()=>Ln,InstanceSchema:()=>In,PartialConfigSchema:()=>Dn,baseEnvJsonSchema:()=>Nn,configJsonSchema:()=>qn,initSourceJsonSchema:()=>Un,initSourcesJsonSchema:()=>Vn,instanceJsonSchema:()=>Mn,partialConfigJsonSchema:()=>Tn});var Jn=c.z.object({push:c.z.unknown().describe("Collector push function"),command:c.z.unknown().describe("Collector command function"),sources:c.z.unknown().optional().describe("Map of registered source instances"),elb:c.z.unknown().describe("Public API function (alias for collector.push)")}).catchall(c.z.unknown()).describe("Base environment for dependency injection - platform-specific sources extend this"),En=Je.extend({settings:c.z.any().describe("Implementation-specific configuration").optional(),env:Jn.optional().describe("Environment dependencies (platform-specific)"),id:m.describe("Source identifier (defaults to source key)").optional(),onError:w.optional(),primary:c.z.boolean().describe("Mark as primary (only one can be primary)").optional()}).describe("Source configuration with mapping and environment"),Dn=En.partial().describe("Partial source configuration with all fields optional"),In=c.z.object({type:c.z.string().describe('Source type identifier (e.g., "browser", "dataLayer")'),config:En.describe("Current source configuration"),push:c.z.any().describe("Push function - THE HANDLER (flexible signature for platform compatibility)"),destroy:c.z.any().optional().describe("Cleanup function called when source is removed"),on:c.z.unknown().optional().describe("Lifecycle hook function for event types")}).describe("Source instance with push handler and lifecycle methods"),On=c.z.any().describe("Source initialization function: (config, env) => Instance | Promise<Instance>"),Rn=c.z.object({code:On.describe("Source initialization function"),config:Dn.optional().describe("Partial configuration overrides"),env:Jn.partial().optional().describe("Partial environment overrides"),primary:c.z.boolean().optional().describe("Mark as primary source (only one can be primary)")}).describe("Source initialization configuration"),Ln=c.z.record(c.z.string(),Rn).describe("Map of source IDs to initialization configurations"),Nn=l(Jn),qn=l(En),Tn=l(Dn),Mn=l(In),Un=l(Rn),Vn=l(Ln),Wn={};r(Wn,{ConfigSchema:()=>oi,ContractActionsSchema:()=>ii,ContractSchema:()=>ti,ContractSchemaEntry:()=>ni,DefinitionsSchema:()=>An,DestinationReferenceSchema:()=>Zn,InlineCodeSchema:()=>Qn,PackagesSchema:()=>Fn,PrimitiveSchema:()=>$n,ServerSchema:()=>Gn,SetupSchema:()=>ci,SetupV2Schema:()=>si,SourceReferenceSchema:()=>Xn,StepExampleSchema:()=>_n,StepExamplesSchema:()=>Kn,StoreReferenceSchema:()=>ei,TransformerReferenceSchema:()=>Yn,VariablesSchema:()=>Bn,WebSchema:()=>Hn,configJsonSchema:()=>fi,destinationReferenceJsonSchema:()=>hi,parseConfig:()=>pi,parseSetup:()=>li,safeParseConfig:()=>ui,safeParseSetup:()=>di,setupJsonSchema:()=>mi,setupV2JsonSchema:()=>bi,sourceReferenceJsonSchema:()=>gi,storeReferenceJsonSchema:()=>vi,transformerReferenceJsonSchema:()=>zi});var $n=c.z.union([c.z.string(),c.z.number(),c.z.boolean()]).describe("Primitive value: string, number, or boolean"),Bn=c.z.record(c.z.string(),$n).describe("Variables for interpolation"),An=c.z.record(c.z.string(),c.z.unknown()).describe("Reusable configuration definitions"),Fn=c.z.record(c.z.string(),c.z.object({version:c.z.string().optional(),imports:c.z.array(c.z.string()).optional(),path:c.z.string().optional()})).describe("NPM packages to bundle"),Hn=c.z.object({windowCollector:c.z.string().optional().default("collector").describe('Window property name for the collector instance (default: "collector")'),windowElb:c.z.string().optional().default("elb").describe('Window property name for the elb command queue (default: "elb")')}).describe("Web platform configuration"),Gn=c.z.object({}).passthrough().describe("Server platform configuration (reserved for future options)"),Qn=c.z.object({push:c.z.string().min(1,"Push function cannot be empty").describe('JavaScript function for processing events. Must start with "$code:" prefix. Example: "$code:(event) => { console.log(event); }"'),type:c.z.string().optional().describe("Optional type identifier for the inline instance"),init:c.z.string().optional().describe("Optional initialization function. Use $code: prefix for inline JavaScript.")}).describe("Inline code for custom sources/transformers/destinations"),_n=c.z.object({in:c.z.unknown().optional().describe("Input to the step"),out:c.z.unknown().optional().describe("Expected output from the step")}).describe("Named example with input/output pair"),Kn=c.z.record(c.z.string(),_n).describe("Named step examples for testing and documentation"),Xn=c.z.object({package:c.z.string().min(1,"Package name cannot be empty").optional().describe('Package specifier with optional version (e.g., "@walkeros/web-source-browser@2.0.0")'),code:c.z.union([c.z.string(),Qn]).optional().describe('Either a named export string (e.g., "sourceExpress") or an inline code object with push function'),config:c.z.unknown().optional().describe("Source-specific configuration object"),env:c.z.unknown().optional().describe("Source environment configuration"),primary:c.z.boolean().optional().describe("Mark as primary source (provides main elb). Only one source should be primary."),variables:Bn.optional().describe("Source-level variables (highest priority in cascade)"),definitions:An.optional().describe("Source-level definitions (highest priority in cascade)"),next:c.z.union([c.z.string(),c.z.array(c.z.string())]).optional().describe("First transformer in post-source chain. If omitted, events route directly to collector."),examples:Kn.optional().describe("Named step examples for testing and documentation (stripped during bundling)")}).describe("Source package reference with configuration"),Yn=c.z.object({package:c.z.string().min(1,"Package name cannot be empty").optional().describe('Package specifier with optional version (e.g., "@walkeros/transformer-enricher@1.0.0")'),code:c.z.union([c.z.string(),Qn]).optional().describe('Either a named export string (e.g., "transformerEnricher") or an inline code object with push function'),config:c.z.unknown().optional().describe("Transformer-specific configuration object"),env:c.z.unknown().optional().describe("Transformer environment configuration"),next:c.z.union([c.z.string(),c.z.array(c.z.string())]).optional().describe("Next transformer in chain. If omitted: pre-collector routes to collector, post-collector routes to destination."),variables:Bn.optional().describe("Transformer-level variables (highest priority in cascade)"),definitions:An.optional().describe("Transformer-level definitions (highest priority in cascade)"),examples:Kn.optional().describe("Named step examples for testing and documentation (stripped during bundling)")}).describe("Transformer package reference with configuration"),Zn=c.z.object({package:c.z.string().min(1,"Package name cannot be empty").optional().describe('Package specifier with optional version (e.g., "@walkeros/web-destination-gtag@2.0.0")'),code:c.z.union([c.z.string(),Qn]).optional().describe('Either a named export string (e.g., "destinationAnalytics") or an inline code object with push function'),config:c.z.unknown().optional().describe("Destination-specific configuration object"),env:c.z.unknown().optional().describe("Destination environment configuration"),variables:Bn.optional().describe("Destination-level variables (highest priority in cascade)"),definitions:An.optional().describe("Destination-level definitions (highest priority in cascade)"),before:c.z.union([c.z.string(),c.z.array(c.z.string())]).optional().describe("First transformer in pre-destination chain. If omitted, events are sent directly from collector."),examples:Kn.optional().describe("Named step examples for testing and documentation (stripped during bundling)")}).describe("Destination package reference with configuration"),ei=c.z.object({package:c.z.string().min(1,"Package name cannot be empty").optional().describe("Store package specifier with optional version"),code:c.z.union([c.z.string(),Qn]).optional().describe("Named export string or inline code definition"),config:c.z.unknown().optional().describe("Store-specific configuration object"),env:c.z.unknown().optional().describe("Store environment configuration"),variables:Bn.optional().describe("Store-level variables (highest priority in cascade)"),definitions:An.optional().describe("Store-level definitions (highest priority in cascade)"),examples:Kn.optional().describe("Named step examples for testing and documentation (stripped during bundling)")}).describe("Store package reference with configuration"),ni=c.z.record(c.z.string(),c.z.unknown()).describe("JSON Schema object for event validation with description/examples annotations"),ii=c.z.record(c.z.string(),ni).describe("Action-level contract entries"),ti=c.z.record(c.z.string(),c.z.union([ii,c.z.number()])).describe("Data contract: entity-action keyed JSON Schema with additive inheritance"),oi=c.z.object({web:Hn.optional().describe("Web platform configuration (browser-based tracking). Mutually exclusive with server."),server:Gn.optional().describe("Server platform configuration (Node.js). Mutually exclusive with web."),contract:ti.optional().describe("Flow-level data contract (merges on top of Setup-level contract)"),sources:c.z.record(c.z.string(),Xn).optional().describe("Source configurations (data capture) keyed by unique identifier"),destinations:c.z.record(c.z.string(),Zn).optional().describe("Destination configurations (data output) keyed by unique identifier"),transformers:c.z.record(c.z.string(),Yn).optional().describe("Transformer configurations (event transformation) keyed by unique identifier"),stores:c.z.record(c.z.string(),ei).optional().describe("Store configurations (key-value storage) keyed by unique identifier"),collector:c.z.unknown().optional().describe("Collector configuration for event processing (uses Collector.InitConfig)"),packages:Fn.optional().describe("NPM packages to bundle"),variables:Bn.optional().describe("Flow-level variables (override Setup.variables, overridden by source/destination variables)"),definitions:An.optional().describe("Flow-level definitions (extend Setup.definitions, overridden by source/destination definitions)")}).refine(e=>{const n=void 0!==e.web,i=void 0!==e.server;return(n||i)&&!(n&&i)},{message:'Exactly one of "web" or "server" must be present'}).describe("Single flow configuration for one deployment target"),ri=c.z.object({$schema:c.z.string().url("Schema URL must be a valid URL").optional().describe('JSON Schema reference for IDE validation (e.g., "https://walkeros.io/schema/flow/v2.json")'),include:c.z.array(c.z.string()).optional().describe("Folders to include in the bundle output"),variables:Bn.optional().describe("Shared variables for interpolation across all flows (use $var.name syntax)"),definitions:An.optional().describe("Reusable configuration definitions (use $def.name syntax)"),flows:c.z.record(c.z.string(),oi).refine(e=>Object.keys(e).length>0,{message:"At least one flow is required"}).describe("Named flow configurations (e.g., production, staging, development)")}),ai=ri.extend({version:c.z.literal(1).describe("Configuration schema version 1")}).describe("walkerOS v1 configuration"),si=ri.extend({version:c.z.literal(2).describe("Configuration schema version 2"),contract:ti.optional().describe("Data contract: entity-action keyed JSON Schema with additive inheritance")}).describe("walkerOS v2 configuration with data contracts"),ci=c.z.union([ai,si]).describe("Complete multi-flow walkerOS configuration (walkeros.config.json)");function li(e){return ci.parse(e)}function di(e){return ci.safeParse(e)}function pi(e){return oi.parse(e)}function ui(e){return oi.safeParse(e)}var mi=c.z.toJSONSchema(ci,{target:"draft-7"}),bi=c.z.toJSONSchema(si,{target:"draft-7"}),fi=l(oi),gi=l(Xn),hi=l(Zn),zi=l(Yn),vi=l(ei);function Si(e){let n;try{n=JSON.parse(e)}catch(n){const{line:i,column:t}=function(e,n){if(e instanceof SyntaxError){const i=e.message.match(/position\s+(\d+)/);if(i){return yi(n,parseInt(i[1],10))}const t=e.message.match(/line\s+(\d+)\s+column\s+(\d+)/);if(t)return{line:parseInt(t[1],10),column:parseInt(t[2],10)}}return{line:1,column:1}}(n,e);return{valid:!1,errors:[{message:n instanceof Error?n.message:"Invalid JSON",severity:"error",line:i,column:t}],warnings:[]}}const i=[],t=[],o=ci.safeParse(n);if(!o.success)for(const n of o.error.issues){const t=n.path.join("."),o=ki(e,n.path);i.push({message:n.message,severity:"error",path:t||"root",...o})}const r=function(e){if(!(ji(e)&&"version"in e&&"flows"in e&&ji(e.flows)))return;const n={},i={},t=[],o=[],r=[],a=[],s=[];let c;xi(n,e.variables),Pi(i,e.definitions),Ji(s,e.contract);for(const l of Object.values(e.flows))if(ji(l)){c||("web"in l?c="web":"server"in l&&(c="server")),xi(n,l.variables),Pi(i,l.definitions),Ji(s,l.contract);for(const e of["sources","destinations","transformers"]){const s="sources"===e?"source":"destinations"===e?"destination":"transformer",d="sources"===e?t:"destinations"===e?o:r;if(ji(l[e]))for(const[t,o]of Object.entries(l[e]))d.push(t),ji(o)&&(xi(n,o.variables),Pi(i,o.definitions),"string"==typeof o.package&&a.push({package:o.package,shortName:t,type:s,platform:c||"web"}))}}const l={variables:n,definitions:i,stepNames:{sources:t,destinations:o,transformers:r}};c&&(l.platform=c);a.length>0&&(l.packages=a);s.length>0&&(l.contract=s);return l}(n);if(r){const n=function(e,n){const i=[];if(n.variables){const t=/\$var\.(\w+)/g;let o;for(;null!==(o=t.exec(e));)if(!(o[1]in n.variables)){const t=wi(e,o.index,o[0].length);i.push({message:`Unknown variable "$var.${o[1]}". Defined: ${Object.keys(n.variables).join(", ")||"none"}`,severity:"warning",path:`$var.${o[1]}`,...t})}}if(n.definitions){const t=/\$def\.(\w+)/g;let o;for(;null!==(o=t.exec(e));)if(!(o[1]in n.definitions)){const t=wi(e,o.index,o[0].length);i.push({message:`Unknown definition "$def.${o[1]}". Defined: ${Object.keys(n.definitions).join(", ")||"none"}`,severity:"warning",path:`$def.${o[1]}`,...t})}}return i}(e,r);t.push(...n)}return{valid:0===i.length,errors:i,warnings:t,context:r}}function yi(e,n){let i=1,t=1;for(let o=0;o<n&&o<e.length;o++)"\n"===e[o]?(i++,t=1):t++;return{line:i,column:t}}function wi(e,n,i){const t=yi(e,n),o=yi(e,n+i);return{line:t.line,column:t.column,endLine:o.line,endColumn:o.column}}function ki(e,n){if(0===n.length)return{line:1,column:1};const i=n[n.length-1];if("string"==typeof i){const n=`"${i}"`,t=e.lastIndexOf(n);if(-1!==t)return yi(e,t)}return{line:1,column:1}}function ji(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Ci(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e}function xi(e,n){if(ji(n))for(const[i,t]of Object.entries(n))Ci(t)&&(e[i]=t)}function Pi(e,n){if(ji(n))for(const[i,t]of Object.entries(n))e[i]=t}function Ji(e,n){if(ji(n))for(const[i,t]of Object.entries(n)){if(i.startsWith("$")||!ji(t))continue;const n=e.find(e=>e.entity===i),o=Object.keys(t);if(n)for(const e of o)n.actions.includes(e)||n.actions.push(e);else e.push({entity:i,actions:o})}}function Ei(e,n){const i=[],t={};for(const[n,o]of Object.entries(e)){o.required&&i.push(n);const e={type:o.type};if(o.description&&(e.description=o.description),o.pattern&&(e.pattern=o.pattern),void 0!==o.minLength&&(e.minLength=o.minLength),void 0!==o.maxLength&&(e.maxLength=o.maxLength),void 0!==o.minimum&&(e.minimum=o.minimum),void 0!==o.maximum&&(e.maximum=o.maximum),o.enum&&(e.enum=[...o.enum]),void 0!==o.default&&(e.default=o.default),"object"===o.type&&o.properties){const n={};for(const[e,i]of Object.entries(o.properties))n[e]=Di(i);e.properties=n}"array"===o.type&&o.items&&(e.items=Di(o.items)),t[n]=e}const o={type:"object",properties:t};return n&&(o.title=n),i.length>0&&(o.required=i),o}function Di(e){const n={type:e.type};if(e.description&&(n.description=e.description),e.pattern&&(n.pattern=e.pattern),void 0!==e.minLength&&(n.minLength=e.minLength),void 0!==e.maxLength&&(n.maxLength=e.maxLength),void 0!==e.minimum&&(n.minimum=e.minimum),void 0!==e.maximum&&(n.maximum=e.maximum),e.enum&&(n.enum=[...e.enum]),void 0!==e.default&&(n.default=e.default),"object"===e.type&&e.properties){const i={};for(const[n,t]of Object.entries(e.properties))i[n]=Di(t);n.properties=i}return"array"===e.type&&e.items&&(n.items=Di(e.items)),n}function Ii(e,n){const i={type:"array",items:Di(e)};return void 0!==n?.minItems&&(i.minItems=n.minItems),void 0!==n?.maxItems&&(i.maxItems=n.maxItems),n?.description&&(i.description=n.description),n?.title&&(i.title=n.title),i}function Oi(e,n="string",i){const t={type:n,enum:[...e]};return i?.description&&(t.description=i.description),i?.title&&(t.title=i.title),t}function Ri(e,n,i){return Ii({type:"object"},{minItems:2,maxItems:2,description:i||"Tuple with exactly 2 elements [source, transform]"})}function Li(e){return c.z.toJSONSchema(e,{target:"draft-7"})}//# sourceMappingURL=dev.js.map