@jetta/cargo-stabilizer 0.1.0-15 → 0.1.0-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -35
- package/README.md +16 -62
- package/build/core/adapters/axle_adapter.d.ts +4 -5
- package/build/core/adapters/axle_adapter.d.ts.map +1 -1
- package/build/core/adapters/axle_adapter.js +23 -6
- package/build/core/adapters/coordinate_mapper.d.ts +5 -5
- package/build/core/adapters/coordinate_mapper.d.ts.map +1 -1
- package/build/core/adapters/coordinate_mapper.js +13 -13
- package/build/core/adapters/stability_adapter.d.ts +1 -1
- package/build/core/adapters/stability_adapter.d.ts.map +1 -1
- package/build/core/adapters/stability_adapter.js +1 -1
- package/build/core/candidates/build_candidate_context.d.ts +1 -1
- package/build/core/candidates/build_candidate_context.d.ts.map +1 -1
- package/build/core/candidates/build_candidate_context.js +1 -3
- package/build/core/candidates/candidate_context.d.ts +1 -4
- package/build/core/candidates/candidate_context.d.ts.map +1 -1
- package/build/core/candidates/candidate_generator.d.ts +1 -1
- package/build/core/candidates/candidate_generator.d.ts.map +1 -1
- package/build/core/candidates/candidate_generator.js +16 -33
- package/build/core/candidates/candidate_validation.d.ts +12 -0
- package/build/core/candidates/candidate_validation.d.ts.map +1 -1
- package/build/core/candidates/candidate_validation.js +26 -40
- package/build/core/candidates/rank_candidates.d.ts.map +1 -1
- package/build/core/candidates/rank_candidates.js +0 -3
- package/build/core/evaluation/evaluation_context.d.ts +1 -3
- package/build/core/evaluation/evaluation_context.d.ts.map +1 -1
- package/build/core/evaluation/state_evaluator.d.ts +10 -13
- package/build/core/evaluation/state_evaluator.d.ts.map +1 -1
- package/build/core/evaluation/state_evaluator.js +15 -19
- package/build/core/factory/read_stabilizer_config.d.ts +2 -5
- package/build/core/factory/read_stabilizer_config.d.ts.map +1 -1
- package/build/core/factory/read_stabilizer_config.js +25 -6
- package/build/core/filters/loose_item_filter.d.ts +2 -2
- package/build/core/filters/loose_item_filter.d.ts.map +1 -1
- package/build/core/filters/loose_item_filter.js +3 -3
- package/build/core/geometry/box_geometry.d.ts +1 -17
- package/build/core/geometry/box_geometry.d.ts.map +1 -1
- package/build/core/geometry/box_geometry.js +2 -67
- package/build/core/move/apply_move.d.ts +1 -3
- package/build/core/move/apply_move.d.ts.map +1 -1
- package/build/core/move/apply_move.js +1 -1
- package/build/core/orchestration/StabilizerFlow.d.ts +1 -2
- package/build/core/orchestration/StabilizerFlow.d.ts.map +1 -1
- package/build/core/orchestration/StabilizerFlow.js +1 -1
- package/build/core/orchestration/build_reorder_context.d.ts +1 -1
- package/build/core/orchestration/build_reorder_context.d.ts.map +1 -1
- package/build/core/orchestration/build_reorder_context.js +12 -10
- package/build/core/strategies/reorder/BeamSearchReorder.d.ts +1 -1
- package/build/core/strategies/reorder/BeamSearchReorder.d.ts.map +1 -1
- package/build/core/strategies/reorder/BeamSearchReorder.js +16 -15
- package/build/core/strategies/reorder/GeneticReorder.d.ts +1 -1
- package/build/core/strategies/reorder/GeneticReorder.d.ts.map +1 -1
- package/build/core/strategies/reorder/GeneticReorder.js +1 -2
- package/build/core/strategies/reorder/GravityCompaction.d.ts +1 -1
- package/build/core/strategies/reorder/GravityCompaction.d.ts.map +1 -1
- package/build/core/strategies/reorder/GravityCompaction.js +2 -2
- package/build/core/strategies/reorder/GreedyReorder.d.ts +1 -1
- package/build/core/strategies/reorder/GreedyReorder.d.ts.map +1 -1
- package/build/core/strategies/reorder/ReorderStrategy.d.ts +1 -3
- package/build/core/strategies/reorder/ReorderStrategy.d.ts.map +1 -1
- package/build/core/strategies/reorder/SimulatedAnnealingReorder.d.ts +1 -1
- package/build/core/strategies/reorder/SimulatedAnnealingReorder.d.ts.map +1 -1
- package/build/core/strategies/reorder/SimulatedAnnealingReorder.js +5 -14
- package/build/core/strategies/reorder/anneal_helpers.d.ts +1 -1
- package/build/core/strategies/reorder/anneal_helpers.d.ts.map +1 -1
- package/build/core/strategies/reorder/anneal_helpers.js +1 -1
- package/build/core/strategies/reorder/apply_if_gates_pass.d.ts +1 -1
- package/build/core/strategies/reorder/apply_if_gates_pass.d.ts.map +1 -1
- package/build/core/strategies/reorder/beam_context.d.ts +1 -2
- package/build/core/strategies/reorder/beam_context.d.ts.map +1 -1
- package/build/core/strategies/reorder/genetic/Chromosome.d.ts +1 -1
- package/build/core/strategies/reorder/genetic/Chromosome.d.ts.map +1 -1
- package/build/core/strategies/reorder/genetic/Chromosome.js +2 -2
- package/build/core/strategies/reorder/greedy_improvement.d.ts +1 -1
- package/build/core/strategies/reorder/greedy_improvement.d.ts.map +1 -1
- package/build/core/strategies/reorder/greedy_improvement.js +4 -5
- package/build/core/validation/parse_stabilizer_input.d.ts +8 -0
- package/build/core/validation/parse_stabilizer_input.d.ts.map +1 -0
- package/build/core/validation/parse_stabilizer_input.js +20 -0
- package/build/core/validation/schemas/stabilizer_config_schema.d.ts +2 -6
- package/build/core/validation/schemas/stabilizer_config_schema.d.ts.map +1 -1
- package/build/core/validation/schemas/stabilizer_config_schema.js +2 -6
- package/build/core/validation/schemas/stabilizer_input_schema.d.ts +110 -0
- package/build/core/validation/schemas/stabilizer_input_schema.d.ts.map +1 -0
- package/build/core/validation/schemas/stabilizer_input_schema.js +34 -0
- package/build/core/validation/schemas/stabilizer_output_schema.d.ts +13 -0
- package/build/core/validation/schemas/stabilizer_output_schema.d.ts.map +1 -0
- package/build/core/validation/schemas/stabilizer_output_schema.js +6 -0
- package/build/core/waypoint/build_waypoint_zones.d.ts +1 -1
- package/build/core/waypoint/build_waypoint_zones.d.ts.map +1 -1
- package/build/core/waypoint/build_waypoint_zones.js +2 -2
- package/build/core/waypoint/preserves_waypoint_order.d.ts +1 -1
- package/build/core/waypoint/preserves_waypoint_order.d.ts.map +1 -1
- package/build/core/waypoint/validate_waypoint_ids.d.ts +1 -1
- package/build/core/waypoint/validate_waypoint_ids.d.ts.map +1 -1
- package/build/index.d.ts +7 -15
- package/build/index.d.ts.map +1 -1
- package/build/index.js +11 -42
- package/package.json +10 -12
- package/build/core/adapters/axle_load_evaluation.d.ts +0 -8
- package/build/core/adapters/axle_load_evaluation.d.ts.map +0 -1
- package/build/core/adapters/axle_load_evaluation.js +0 -1
- package/build/core/adapters/build_axle_request.d.ts +0 -8
- package/build/core/adapters/build_axle_request.d.ts.map +0 -1
- package/build/core/adapters/build_axle_request.js +0 -67
- package/build/core/adapters/compute_axle_excess_kg.d.ts +0 -8
- package/build/core/adapters/compute_axle_excess_kg.d.ts.map +0 -1
- package/build/core/adapters/compute_axle_excess_kg.js +0 -19
- package/build/core/adapters/empty_space_adapter.d.ts +0 -10
- package/build/core/adapters/empty_space_adapter.d.ts.map +0 -1
- package/build/core/adapters/empty_space_adapter.js +0 -24
- package/build/core/adapters/evaluate_axle_load.d.ts +0 -10
- package/build/core/adapters/evaluate_axle_load.d.ts.map +0 -1
- package/build/core/adapters/evaluate_axle_load.js +0 -32
- package/build/core/adapters/map_item_to_positioned_cube.d.ts +0 -9
- package/build/core/adapters/map_item_to_positioned_cube.d.ts.map +0 -1
- package/build/core/adapters/map_item_to_positioned_cube.js +0 -16
- package/build/core/adapters/map_item_to_stacking_item.d.ts +0 -14
- package/build/core/adapters/map_item_to_stacking_item.d.ts.map +0 -1
- package/build/core/adapters/map_item_to_stacking_item.js +0 -40
- package/build/core/adapters/run_axle_calculator.d.ts +0 -16
- package/build/core/adapters/run_axle_calculator.d.ts.map +0 -1
- package/build/core/adapters/run_axle_calculator.js +0 -37
- package/build/core/candidates/collect_container_slots.d.ts +0 -16
- package/build/core/candidates/collect_container_slots.d.ts.map +0 -1
- package/build/core/candidates/collect_container_slots.js +0 -20
- package/build/core/candidates/enumerate_empty_space_slots.d.ts +0 -15
- package/build/core/candidates/enumerate_empty_space_slots.d.ts.map +0 -1
- package/build/core/candidates/enumerate_empty_space_slots.js +0 -44
- package/build/core/candidates/enumerate_supporter_top_slots.d.ts +0 -11
- package/build/core/candidates/enumerate_supporter_top_slots.d.ts.map +0 -1
- package/build/core/candidates/enumerate_supporter_top_slots.js +0 -36
- package/build/core/candidates/is_candidate_stacking_valid.d.ts +0 -14
- package/build/core/candidates/is_candidate_stacking_valid.d.ts.map +0 -1
- package/build/core/candidates/is_candidate_stacking_valid.js +0 -43
- package/build/core/candidates/is_elevated_on_supporter_origin.d.ts +0 -14
- package/build/core/candidates/is_elevated_on_supporter_origin.d.ts.map +0 -1
- package/build/core/candidates/is_elevated_on_supporter_origin.js +0 -28
- package/build/core/constants/TieRatioOrientation.d.ts +0 -6
- package/build/core/constants/TieRatioOrientation.d.ts.map +0 -1
- package/build/core/constants/TieRatioOrientation.js +0 -5
- package/build/core/evaluation/compare_search_states.d.ts +0 -12
- package/build/core/evaluation/compare_search_states.d.ts.map +0 -1
- package/build/core/evaluation/compare_search_states.js +0 -12
- package/build/core/evaluation/compute_reorder_objective.d.ts +0 -13
- package/build/core/evaluation/compute_reorder_objective.d.ts.map +0 -1
- package/build/core/evaluation/compute_reorder_objective.js +0 -13
- package/build/core/evaluation/evaluate_search_gates.d.ts +0 -18
- package/build/core/evaluation/evaluate_search_gates.d.ts.map +0 -1
- package/build/core/evaluation/evaluate_search_gates.js +0 -30
- package/build/core/evaluation/evaluation_result.d.ts +0 -15
- package/build/core/evaluation/evaluation_result.d.ts.map +0 -1
- package/build/core/evaluation/evaluation_result.js +0 -1
- package/build/core/evaluation/genetic_fitness.d.ts +0 -9
- package/build/core/evaluation/genetic_fitness.d.ts.map +0 -1
- package/build/core/evaluation/genetic_fitness.js +0 -16
- package/build/core/evaluation/is_non_axle_gates_pass.d.ts +0 -8
- package/build/core/evaluation/is_non_axle_gates_pass.d.ts.map +0 -1
- package/build/core/evaluation/is_non_axle_gates_pass.js +0 -8
- package/build/core/evaluation/is_search_trial_admissible.d.ts +0 -10
- package/build/core/evaluation/is_search_trial_admissible.d.ts.map +0 -1
- package/build/core/evaluation/is_search_trial_admissible.js +0 -17
- package/build/core/evaluation/is_waypoint_order_valid.d.ts +0 -10
- package/build/core/evaluation/is_waypoint_order_valid.d.ts.map +0 -1
- package/build/core/evaluation/is_waypoint_order_valid.js +0 -14
- package/build/core/exceptions/AxleCalculationError.d.ts +0 -4
- package/build/core/exceptions/AxleCalculationError.d.ts.map +0 -1
- package/build/core/exceptions/AxleCalculationError.js +0 -6
- package/build/core/exceptions/InvalidStabilizerOutputError.d.ts +0 -4
- package/build/core/exceptions/InvalidStabilizerOutputError.d.ts.map +0 -1
- package/build/core/exceptions/InvalidStabilizerOutputError.js +0 -6
- package/build/core/factory/read_stabilizer_config_helpers.d.ts +0 -32
- package/build/core/factory/read_stabilizer_config_helpers.d.ts.map +0 -1
- package/build/core/factory/read_stabilizer_config_helpers.js +0 -73
- package/build/core/filters/collect_movable_items.d.ts +0 -18
- package/build/core/filters/collect_movable_items.d.ts.map +0 -1
- package/build/core/filters/collect_movable_items.js +0 -53
- package/build/core/filters/collect_pinned_floor_tie_ratio_group_ids.d.ts +0 -8
- package/build/core/filters/collect_pinned_floor_tie_ratio_group_ids.d.ts.map +0 -1
- package/build/core/filters/collect_pinned_floor_tie_ratio_group_ids.js +0 -41
- package/build/core/filters/is_item_on_cm_floor.d.ts +0 -8
- package/build/core/filters/is_item_on_cm_floor.d.ts.map +0 -1
- package/build/core/filters/is_item_on_cm_floor.js +0 -9
- package/build/core/geometry/has_penetrating_overlap.d.ts +0 -9
- package/build/core/geometry/has_penetrating_overlap.d.ts.map +0 -1
- package/build/core/geometry/has_penetrating_overlap.js +0 -27
- package/build/core/orchestration/build_milkrun_bands_from_config.d.ts +0 -13
- package/build/core/orchestration/build_milkrun_bands_from_config.d.ts.map +0 -1
- package/build/core/orchestration/build_milkrun_bands_from_config.js +0 -14
- package/build/core/orchestration/read_primary_env.d.ts +0 -9
- package/build/core/orchestration/read_primary_env.d.ts.map +0 -1
- package/build/core/orchestration/read_primary_env.js +0 -13
- package/build/core/strategies/reorder/append_admitted_trial.d.ts +0 -11
- package/build/core/strategies/reorder/append_admitted_trial.d.ts.map +0 -1
- package/build/core/strategies/reorder/append_admitted_trial.js +0 -22
- package/build/core/strategies/reorder/is_improving_greedy_trial.d.ts +0 -10
- package/build/core/strategies/reorder/is_improving_greedy_trial.d.ts.map +0 -1
- package/build/core/strategies/reorder/is_improving_greedy_trial.js +0 -17
- package/build/core/strategies/reorder/select_beam_expansion_candidates.d.ts +0 -9
- package/build/core/strategies/reorder/select_beam_expansion_candidates.d.ts.map +0 -1
- package/build/core/strategies/reorder/select_beam_expansion_candidates.js +0 -28
- package/build/core/strategies/reorder/select_surviving_beam.d.ts +0 -11
- package/build/core/strategies/reorder/select_surviving_beam.d.ts.map +0 -1
- package/build/core/strategies/reorder/select_surviving_beam.js +0 -13
- package/build/core/validation/contract/cargo_movement_wire_field_map.d.ts +0 -71
- package/build/core/validation/contract/cargo_movement_wire_field_map.d.ts.map +0 -1
- package/build/core/validation/contract/cargo_movement_wire_field_map.js +0 -77
- package/build/core/validation/contract/cargo_movement_wire_mapper.d.ts +0 -14
- package/build/core/validation/contract/cargo_movement_wire_mapper.d.ts.map +0 -1
- package/build/core/validation/contract/cargo_movement_wire_mapper.js +0 -43
- package/build/core/validation/contract/format_zod_error.d.ts +0 -8
- package/build/core/validation/contract/format_zod_error.d.ts.map +0 -1
- package/build/core/validation/contract/format_zod_error.js +0 -11
- package/build/core/validation/contract/index.d.ts +0 -9
- package/build/core/validation/contract/index.d.ts.map +0 -1
- package/build/core/validation/contract/index.js +0 -8
- package/build/core/validation/contract/map_contract_to_wire_shape.d.ts +0 -3
- package/build/core/validation/contract/map_contract_to_wire_shape.d.ts.map +0 -1
- package/build/core/validation/contract/map_contract_to_wire_shape.js +0 -33
- package/build/core/validation/contract/map_input_config.d.ts +0 -9
- package/build/core/validation/contract/map_input_config.d.ts.map +0 -1
- package/build/core/validation/contract/map_input_config.js +0 -40
- package/build/core/validation/contract/map_wire_input_to_contract_shape.d.ts +0 -2
- package/build/core/validation/contract/map_wire_input_to_contract_shape.d.ts.map +0 -1
- package/build/core/validation/contract/map_wire_input_to_contract_shape.js +0 -66
- package/build/core/validation/contract/map_wire_item_stacking.d.ts +0 -7
- package/build/core/validation/contract/map_wire_item_stacking.d.ts.map +0 -1
- package/build/core/validation/contract/map_wire_item_stacking.js +0 -40
- package/build/core/validation/contract/map_wire_item_to_contract.d.ts +0 -8
- package/build/core/validation/contract/map_wire_item_to_contract.d.ts.map +0 -1
- package/build/core/validation/contract/map_wire_item_to_contract.js +0 -51
- package/build/core/validation/contract/parse_stabilizer_input.d.ts +0 -90
- package/build/core/validation/contract/parse_stabilizer_input.d.ts.map +0 -1
- package/build/core/validation/contract/parse_stabilizer_input.js +0 -28
- package/build/core/validation/contract/parse_stabilizer_output.d.ts +0 -79
- package/build/core/validation/contract/parse_stabilizer_output.d.ts.map +0 -1
- package/build/core/validation/contract/parse_stabilizer_output.js +0 -24
- package/build/core/validation/contract/reject_forbidden_input_fields.d.ts +0 -6
- package/build/core/validation/contract/reject_forbidden_input_fields.d.ts.map +0 -1
- package/build/core/validation/contract/reject_forbidden_input_fields.js +0 -53
- package/build/core/validation/contract/stabilizer_domain_schema.d.ts +0 -72
- package/build/core/validation/contract/stabilizer_domain_schema.d.ts.map +0 -1
- package/build/core/validation/contract/stabilizer_domain_schema.js +0 -42
- package/build/core/validation/contract/stabilizer_env_schema.d.ts +0 -112
- package/build/core/validation/contract/stabilizer_env_schema.d.ts.map +0 -1
- package/build/core/validation/contract/stabilizer_env_schema.js +0 -38
- package/build/core/validation/contract/stabilizer_input_schema.d.ts +0 -80
- package/build/core/validation/contract/stabilizer_input_schema.d.ts.map +0 -1
- package/build/core/validation/contract/stabilizer_input_schema.js +0 -11
- package/build/core/validation/contract/stabilizer_item_schema.d.ts +0 -25
- package/build/core/validation/contract/stabilizer_item_schema.d.ts.map +0 -1
- package/build/core/validation/contract/stabilizer_item_schema.js +0 -23
- package/build/core/validation/contract/stabilizer_output_schema.d.ts +0 -134
- package/build/core/validation/contract/stabilizer_output_schema.d.ts.map +0 -1
- package/build/core/validation/contract/stabilizer_output_schema.js +0 -16
- package/build/core/validation/contract/uniquify_contract_item_ids.d.ts +0 -14
- package/build/core/validation/contract/uniquify_contract_item_ids.d.ts.map +0 -1
- package/build/core/validation/contract/uniquify_contract_item_ids.js +0 -54
- package/build/core/validation/contract/wire_mapper_record_utils.d.ts +0 -34
- package/build/core/validation/contract/wire_mapper_record_utils.d.ts.map +0 -1
- package/build/core/validation/contract/wire_mapper_record_utils.js +0 -66
- package/build/core/waypoint/milkrun_wall_reservation.d.ts +0 -24
- package/build/core/waypoint/milkrun_wall_reservation.d.ts.map +0 -1
- package/build/core/waypoint/milkrun_wall_reservation.js +0 -57
- package/build/core/waypoint/milkrun_wall_reservation_helpers.d.ts +0 -15
- package/build/core/waypoint/milkrun_wall_reservation_helpers.d.ts.map +0 -1
- package/build/core/waypoint/milkrun_wall_reservation_helpers.js +0 -48
- package/build/core/waypoint/milkrun_wall_reservation_types.d.ts +0 -16
- package/build/core/waypoint/milkrun_wall_reservation_types.d.ts.map +0 -1
- package/build/core/waypoint/milkrun_wall_reservation_types.js +0 -1
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { format_zod_error } from './format_zod_error.js';
|
|
2
|
-
export { ITEM_WIRE_TO_CONTRACT, CONTAINER_WIRE_TO_CONTRACT, ENV_WIRE_TO_CONTRACT, CONTRACT_TO_ITEM_WIRE, CONTRACT_TO_CONTAINER_WIRE, CONTRACT_TO_ENV_WIRE } from './cargo_movement_wire_field_map.js';
|
|
3
|
-
export { map_wire_input_to_contract, map_contract_to_wire_output } from './cargo_movement_wire_mapper.js';
|
|
4
|
-
export { stabilizer_item_schema, stabilizer_container_schema, stabilizer_env_schema, stabilizer_cargo_state_schema, validate_primary_env_waypoints, type StabilizerItem, type StabilizerContainer, type StabilizerEnv, type StabilizerCargoState } from './stabilizer_domain_schema.js';
|
|
5
|
-
export { stabilizer_input_schema, type StabilizerInput } from './stabilizer_input_schema.js';
|
|
6
|
-
export { stabilizer_response_schema, stabilizer_success_response_schema, stabilizer_error_response_schema, type StabilizerResponse, type StabilizerSuccessResponse, type StabilizerErrorResponse } from './stabilizer_output_schema.js';
|
|
7
|
-
export { parse_stabilizer_input, safe_parse_stabilizer_input } from './parse_stabilizer_input.js';
|
|
8
|
-
export { parse_stabilizer_output, safe_parse_stabilizer_output } from './parse_stabilizer_output.js';
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/contract/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EACH,qBAAqB,EACrB,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,oBAAoB,EACvB,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EACH,0BAA0B,EAC1B,2BAA2B,EAC9B,MAAM,iCAAiC,CAAA;AACxC,OAAO,EACH,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,EACrB,6BAA6B,EAC7B,8BAA8B,EAC9B,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EAC5B,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,uBAAuB,EAAE,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC5F,OAAO,EACH,0BAA0B,EAC1B,kCAAkC,EAClC,gCAAgC,EAChC,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC/B,MAAM,+BAA+B,CAAA;AACtC,OAAO,EACH,sBAAsB,EACtB,2BAA2B,EAC9B,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACH,uBAAuB,EACvB,4BAA4B,EAC/B,MAAM,8BAA8B,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { format_zod_error } from './format_zod_error.js';
|
|
2
|
-
export { ITEM_WIRE_TO_CONTRACT, CONTAINER_WIRE_TO_CONTRACT, ENV_WIRE_TO_CONTRACT, CONTRACT_TO_ITEM_WIRE, CONTRACT_TO_CONTAINER_WIRE, CONTRACT_TO_ENV_WIRE } from './cargo_movement_wire_field_map.js';
|
|
3
|
-
export { map_wire_input_to_contract, map_contract_to_wire_output } from './cargo_movement_wire_mapper.js';
|
|
4
|
-
export { stabilizer_item_schema, stabilizer_container_schema, stabilizer_env_schema, stabilizer_cargo_state_schema, validate_primary_env_waypoints } from './stabilizer_domain_schema.js';
|
|
5
|
-
export { stabilizer_input_schema } from './stabilizer_input_schema.js';
|
|
6
|
-
export { stabilizer_response_schema, stabilizer_success_response_schema, stabilizer_error_response_schema } from './stabilizer_output_schema.js';
|
|
7
|
-
export { parse_stabilizer_input, safe_parse_stabilizer_input } from './parse_stabilizer_input.js';
|
|
8
|
-
export { parse_stabilizer_output, safe_parse_stabilizer_output } from './parse_stabilizer_output.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"map_contract_to_wire_shape.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/contract/map_contract_to_wire_shape.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AAIzE,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,oBAAoB,GAAG,OAAO,CAKlF"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { CONTRACT_TO_AXLE_WIRE, CONTRACT_TO_CONTAINER_WIRE, CONTRACT_TO_ITEM_WIRE, CONTRACT_TO_VEHICLE_WIRE } from './cargo_movement_wire_field_map.js';
|
|
2
|
-
import { omit_keys, rename_keys } from './wire_mapper_record_utils.js';
|
|
3
|
-
import { strip_uniquify_suffix } from './uniquify_contract_item_ids.js';
|
|
4
|
-
export function map_cargo_state_to_wire(cargo_state) {
|
|
5
|
-
return {
|
|
6
|
-
envs: cargo_state.envs.map(map_env_to_wire)
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
function map_env_to_wire(env) {
|
|
10
|
-
const wire = env.vehicle === undefined
|
|
11
|
-
? {}
|
|
12
|
-
: rename_keys(env.vehicle, CONTRACT_TO_VEHICLE_WIRE);
|
|
13
|
-
wire.containers = env.containers.map(map_container_to_wire);
|
|
14
|
-
if (env.axles !== undefined) {
|
|
15
|
-
wire.eixos = env.axles.map(axle => rename_keys(axle, CONTRACT_TO_AXLE_WIRE));
|
|
16
|
-
}
|
|
17
|
-
return wire;
|
|
18
|
-
}
|
|
19
|
-
function map_container_to_wire(container) {
|
|
20
|
-
const modelled = omit_keys(container, ['items']);
|
|
21
|
-
const wire = rename_keys(modelled, CONTRACT_TO_CONTAINER_WIRE);
|
|
22
|
-
wire.items = container.items.map(map_item_to_wire);
|
|
23
|
-
return wire;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Emits a contract item to CM wire keys. Position stays in contract axes
|
|
27
|
-
* for English items; CM `w`-shaped callers swap y/z before parse.
|
|
28
|
-
* @param item - Contract item.
|
|
29
|
-
* @returns Wire item.
|
|
30
|
-
*/
|
|
31
|
-
function map_item_to_wire(item) {
|
|
32
|
-
return rename_keys({ ...item, item_id: strip_uniquify_suffix(item.item_id) }, CONTRACT_TO_ITEM_WIRE);
|
|
33
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Maps envelope plus cargo-profile algoritmo maps onto English stabilizer config.
|
|
3
|
-
* English config objects are returned unchanged for strict Zod checking.
|
|
4
|
-
* @param envelope_config - Envelope config from wire or English input.
|
|
5
|
-
* @param wire_cargo_state - Wire cargo state that may hold profile algoritmo.
|
|
6
|
-
* @returns Raw English config, or the original English object.
|
|
7
|
-
*/
|
|
8
|
-
export declare function map_envelope_config(envelope_config: unknown, wire_cargo_state: unknown): unknown;
|
|
9
|
-
//# sourceMappingURL=map_input_config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"map_input_config.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/contract/map_input_config.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAgBhG"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { is_record } from './wire_mapper_record_utils.js';
|
|
2
|
-
import { merge_algoritmo_maps, read_raw_stabilizer_config } from '../../factory/read_stabilizer_config_helpers.js';
|
|
3
|
-
const ALGORITMO_PREFIX = 'cargo_stabilizer.';
|
|
4
|
-
/**
|
|
5
|
-
* Maps envelope plus cargo-profile algoritmo maps onto English stabilizer config.
|
|
6
|
-
* English config objects are returned unchanged for strict Zod checking.
|
|
7
|
-
* @param envelope_config - Envelope config from wire or English input.
|
|
8
|
-
* @param wire_cargo_state - Wire cargo state that may hold profile algoritmo.
|
|
9
|
-
* @returns Raw English config, or the original English object.
|
|
10
|
-
*/
|
|
11
|
-
export function map_envelope_config(envelope_config, wire_cargo_state) {
|
|
12
|
-
if (envelope_config === undefined && !has_profile_algoritmo(wire_cargo_state)) {
|
|
13
|
-
return undefined;
|
|
14
|
-
}
|
|
15
|
-
if (is_algoritmo_shaped(envelope_config) || has_profile_algoritmo(wire_cargo_state)) {
|
|
16
|
-
return read_raw_stabilizer_config(merge_algoritmo_maps(as_record(envelope_config), { config: read_wire_profile_config(wire_cargo_state) }));
|
|
17
|
-
}
|
|
18
|
-
return envelope_config;
|
|
19
|
-
}
|
|
20
|
-
function is_algoritmo_shaped(config) {
|
|
21
|
-
if (!is_record(config)) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
if (is_record(config.algoritmo)) {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
return Object.keys(config).some(key => key.startsWith(ALGORITMO_PREFIX));
|
|
28
|
-
}
|
|
29
|
-
function has_profile_algoritmo(wire_cargo_state) {
|
|
30
|
-
return is_record(read_wire_profile_config(wire_cargo_state)?.algoritmo);
|
|
31
|
-
}
|
|
32
|
-
function read_wire_profile_config(wire_cargo_state) {
|
|
33
|
-
if (!is_record(wire_cargo_state) || !is_record(wire_cargo_state.config)) {
|
|
34
|
-
return undefined;
|
|
35
|
-
}
|
|
36
|
-
return wire_cargo_state.config;
|
|
37
|
-
}
|
|
38
|
-
function as_record(value) {
|
|
39
|
-
return is_record(value) ? value : undefined;
|
|
40
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"map_wire_input_to_contract_shape.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/contract/map_wire_input_to_contract_shape.ts"],"names":[],"mappings":"AAkBA,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAYnE"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { AXLE_WIRE_TO_CONTRACT, CONTAINER_WIRE_TO_CONTRACT, ENV_WIRE_TO_CONTRACT, VEHICLE_WIRE_TO_CONTRACT } from './cargo_movement_wire_field_map.js';
|
|
2
|
-
import { map_wire_item_to_contract } from './map_wire_item_to_contract.js';
|
|
3
|
-
import { uniquify_contract_item_ids } from './uniquify_contract_item_ids.js';
|
|
4
|
-
import { is_record, pick_keys, rename_keys } from './wire_mapper_record_utils.js';
|
|
5
|
-
const CONTAINER_CONTRACT_KEYS = [
|
|
6
|
-
'sequence', 'width', 'height', 'length', 'kingpin_distance',
|
|
7
|
-
'container_distance_ahead', 'max_supported_weight', 'tare', 'cargo_weight', 'grouper'
|
|
8
|
-
];
|
|
9
|
-
const ENV_CONTRACT_KEYS = ['axles', 'vehicle'];
|
|
10
|
-
const VEHICLE_CONTRACT_KEYS = Object.values(VEHICLE_WIRE_TO_CONTRACT);
|
|
11
|
-
const AXLE_CONTRACT_KEYS = Object.values(AXLE_WIRE_TO_CONTRACT);
|
|
12
|
-
export function map_cargo_state_to_contract(value) {
|
|
13
|
-
if (!is_record(value)) {
|
|
14
|
-
return value;
|
|
15
|
-
}
|
|
16
|
-
const mapped = {};
|
|
17
|
-
if (Array.isArray(value.envs)) {
|
|
18
|
-
mapped.envs = value.envs.map(map_env_to_contract);
|
|
19
|
-
}
|
|
20
|
-
return mapped;
|
|
21
|
-
}
|
|
22
|
-
function map_env_to_contract(value) {
|
|
23
|
-
if (!is_record(value)) {
|
|
24
|
-
return value;
|
|
25
|
-
}
|
|
26
|
-
const mapped = rename_keys(value, ENV_WIRE_TO_CONTRACT);
|
|
27
|
-
if (Array.isArray(value.containers)) {
|
|
28
|
-
mapped.containers = value.containers.map(map_container_to_contract);
|
|
29
|
-
}
|
|
30
|
-
if (Array.isArray(mapped.axles)) {
|
|
31
|
-
mapped.axles = mapped.axles.map(map_axle_to_contract);
|
|
32
|
-
}
|
|
33
|
-
const vehicle = map_vehicle_to_contract(value);
|
|
34
|
-
if (vehicle !== undefined) {
|
|
35
|
-
mapped.vehicle = vehicle;
|
|
36
|
-
}
|
|
37
|
-
return pick_env_contract_keys(mapped);
|
|
38
|
-
}
|
|
39
|
-
function map_container_to_contract(value) {
|
|
40
|
-
if (!is_record(value)) {
|
|
41
|
-
return value;
|
|
42
|
-
}
|
|
43
|
-
const mapped = rename_keys(value, CONTAINER_WIRE_TO_CONTRACT);
|
|
44
|
-
if (Array.isArray(value.items)) {
|
|
45
|
-
mapped.items = uniquify_contract_item_ids(value.items.map(map_wire_item_to_contract));
|
|
46
|
-
}
|
|
47
|
-
return pick_keys(mapped, [...CONTAINER_CONTRACT_KEYS, 'items']);
|
|
48
|
-
}
|
|
49
|
-
function map_axle_to_contract(value) {
|
|
50
|
-
if (!is_record(value)) {
|
|
51
|
-
return value;
|
|
52
|
-
}
|
|
53
|
-
return pick_keys(rename_keys(value, AXLE_WIRE_TO_CONTRACT), AXLE_CONTRACT_KEYS);
|
|
54
|
-
}
|
|
55
|
-
function map_vehicle_to_contract(env) {
|
|
56
|
-
const source = is_record(env.vehicle) ? env.vehicle : env;
|
|
57
|
-
const mapped = pick_keys(rename_keys(source, VEHICLE_WIRE_TO_CONTRACT), VEHICLE_CONTRACT_KEYS);
|
|
58
|
-
return Object.keys(mapped).length > 0 ? mapped : undefined;
|
|
59
|
-
}
|
|
60
|
-
function pick_env_contract_keys(source) {
|
|
61
|
-
const picked = pick_keys(source, ENV_CONTRACT_KEYS);
|
|
62
|
-
if (Array.isArray(source.containers)) {
|
|
63
|
-
picked.containers = source.containers;
|
|
64
|
-
}
|
|
65
|
-
return picked;
|
|
66
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lifts nested CM stacking and restriction fields onto the contract item.
|
|
3
|
-
* @param contract - Contract item being filled.
|
|
4
|
-
* @param source - Wire or English item record.
|
|
5
|
-
*/
|
|
6
|
-
export declare function assign_stacking_fields(contract: Record<string, unknown>, source: Record<string, unknown>): void;
|
|
7
|
-
//# sourceMappingURL=map_wire_item_stacking.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"map_wire_item_stacking.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/contract/map_wire_item_stacking.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,sBAAsB,CAClC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,IAAI,CAYN"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { is_record } from './wire_mapper_record_utils.js';
|
|
2
|
-
/**
|
|
3
|
-
* Lifts nested CM stacking and restriction fields onto the contract item.
|
|
4
|
-
* @param contract - Contract item being filled.
|
|
5
|
-
* @param source - Wire or English item record.
|
|
6
|
-
*/
|
|
7
|
-
export function assign_stacking_fields(contract, source) {
|
|
8
|
-
assign_nested_stacking(contract, source.stacking);
|
|
9
|
-
assign_restriction_flags(contract, source.restrictions ?? source.restricoes);
|
|
10
|
-
if (typeof source.pesoMaxSuportado === 'number' && contract.supported_weight === undefined) {
|
|
11
|
-
contract.supported_weight = source.pesoMaxSuportado;
|
|
12
|
-
}
|
|
13
|
-
if (typeof source.stackingUnit === 'string' && contract.stacking_unit === undefined) {
|
|
14
|
-
contract.stacking_unit = source.stackingUnit;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function assign_nested_stacking(contract, stacking) {
|
|
18
|
-
if (!is_record(stacking)) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
if (typeof stacking.family === 'string' && contract.family === undefined) {
|
|
22
|
-
contract.family = stacking.family;
|
|
23
|
-
}
|
|
24
|
-
if (Array.isArray(stacking.supported_families) && contract.supported_families === undefined) {
|
|
25
|
-
contract.supported_families = stacking.supported_families;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function assign_restriction_flags(contract, restrictions) {
|
|
29
|
-
if (!is_record(restrictions)) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
assign_boolean_if_absent(contract, 'stack_families', restrictions.empilharFamilias);
|
|
33
|
-
assign_boolean_if_absent(contract, 'stack_same_item', restrictions.empilharItemIgual);
|
|
34
|
-
assign_boolean_if_absent(contract, 'stack_same_area', restrictions.empilharAreaIgual);
|
|
35
|
-
}
|
|
36
|
-
function assign_boolean_if_absent(contract, key, value) {
|
|
37
|
-
if (typeof value === 'boolean' && contract[key] === undefined) {
|
|
38
|
-
contract[key] = value;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Maps a cargo-movement wire item to the stabilizer contract shape.
|
|
3
|
-
* Only modelled fields are copied; leftover SKU keys are dropped.
|
|
4
|
-
* @param value - Raw wire item.
|
|
5
|
-
* @returns Contract item, or the input unchanged when it is not a record.
|
|
6
|
-
*/
|
|
7
|
-
export declare function map_wire_item_to_contract(value: unknown): unknown;
|
|
8
|
-
//# sourceMappingURL=map_wire_item_to_contract.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"map_wire_item_to_contract.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/contract/map_wire_item_to_contract.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAUjE"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { ITEM_CONTRACT_WIRE_KEYS, ITEM_POSITION_KEYS } from './cargo_movement_wire_field_map.js';
|
|
2
|
-
import { assign_stacking_fields } from './map_wire_item_stacking.js';
|
|
3
|
-
import { is_record, omit_keys, read_first_present } from './wire_mapper_record_utils.js';
|
|
4
|
-
/**
|
|
5
|
-
* Maps a cargo-movement wire item to the stabilizer contract shape.
|
|
6
|
-
* Only modelled fields are copied; leftover SKU keys are dropped.
|
|
7
|
-
* @param value - Raw wire item.
|
|
8
|
-
* @returns Contract item, or the input unchanged when it is not a record.
|
|
9
|
-
*/
|
|
10
|
-
export function map_wire_item_to_contract(value) {
|
|
11
|
-
if (!is_record(value)) {
|
|
12
|
-
return value;
|
|
13
|
-
}
|
|
14
|
-
const contract = read_contract_item_fields(value);
|
|
15
|
-
assign_stacking_fields(contract, omit_keys(value, ITEM_POSITION_KEYS));
|
|
16
|
-
return contract;
|
|
17
|
-
}
|
|
18
|
-
function read_contract_item_fields(source) {
|
|
19
|
-
const contract = read_contract_position(source);
|
|
20
|
-
for (const [contract_key, wire_keys] of Object.entries(ITEM_CONTRACT_WIRE_KEYS)) {
|
|
21
|
-
const value = read_first_present(source, wire_keys);
|
|
22
|
-
if (value !== undefined) {
|
|
23
|
-
contract[contract_key] = normalize_contract_field(contract_key, value);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return contract;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* BWA `to_json` stores length on `y` and height on `z`. Candidate geometry
|
|
30
|
-
* uses the opposite (y = height, z = length), so CM wire items are swapped.
|
|
31
|
-
* @param source - Wire or English item record.
|
|
32
|
-
* @returns Contract x/y/z.
|
|
33
|
-
*/
|
|
34
|
-
function read_contract_position(source) {
|
|
35
|
-
if (typeof source.w === 'number') {
|
|
36
|
-
return { x: source.x, y: source.z, z: source.y };
|
|
37
|
-
}
|
|
38
|
-
return { x: source.x, y: source.y, z: source.z };
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Coerces blocks-wall numeric group ids to the string contract type.
|
|
42
|
-
* @param contract_key - English contract field name.
|
|
43
|
-
* @param value - Wire value.
|
|
44
|
-
* @returns String group id when a finite number was provided; otherwise the value.
|
|
45
|
-
*/
|
|
46
|
-
function normalize_contract_field(contract_key, value) {
|
|
47
|
-
if (contract_key === 'group_id' && typeof value === 'number' && Number.isFinite(value)) {
|
|
48
|
-
return String(value);
|
|
49
|
-
}
|
|
50
|
-
return value;
|
|
51
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { format_zod_error } from './format_zod_error.js';
|
|
2
|
-
import { type StabilizerInput } from './stabilizer_input_schema.js';
|
|
3
|
-
/**
|
|
4
|
-
* Safely parses stabilizer input after wire mapping.
|
|
5
|
-
* @param input_data - Unknown wire payload.
|
|
6
|
-
* @returns Zod safe parse result.
|
|
7
|
-
*/
|
|
8
|
-
export declare function safe_parse_stabilizer_input(input_data: unknown): import("zod").ZodSafeParseResult<{
|
|
9
|
-
cargo_state: {
|
|
10
|
-
envs: {
|
|
11
|
-
containers: {
|
|
12
|
-
width: number;
|
|
13
|
-
height: number;
|
|
14
|
-
length: number;
|
|
15
|
-
items: {
|
|
16
|
-
item_id: string;
|
|
17
|
-
x: number;
|
|
18
|
-
y: number;
|
|
19
|
-
z: number;
|
|
20
|
-
width: number;
|
|
21
|
-
height: number;
|
|
22
|
-
depth: number;
|
|
23
|
-
group_id?: string | null | undefined;
|
|
24
|
-
waypoint_id?: string | undefined;
|
|
25
|
-
weight?: number | undefined;
|
|
26
|
-
tie_ratio_orientation?: string | undefined;
|
|
27
|
-
family?: string | undefined;
|
|
28
|
-
supported_families?: string[] | undefined;
|
|
29
|
-
constraint?: string | undefined;
|
|
30
|
-
stack_families?: boolean | undefined;
|
|
31
|
-
stack_same_item?: boolean | undefined;
|
|
32
|
-
stack_same_area?: boolean | undefined;
|
|
33
|
-
stacking_unit?: string | undefined;
|
|
34
|
-
supported_weight?: number | undefined;
|
|
35
|
-
priority?: number | undefined;
|
|
36
|
-
}[];
|
|
37
|
-
sequence?: number | undefined;
|
|
38
|
-
kingpin_distance?: number | undefined;
|
|
39
|
-
container_distance_ahead?: number | undefined;
|
|
40
|
-
max_supported_weight?: number | undefined;
|
|
41
|
-
tare?: number | undefined;
|
|
42
|
-
cargo_weight?: number | undefined;
|
|
43
|
-
grouper?: number | undefined;
|
|
44
|
-
}[];
|
|
45
|
-
axles?: {
|
|
46
|
-
distance_from_origin?: number | undefined;
|
|
47
|
-
max_supported_weight?: number | undefined;
|
|
48
|
-
dnit_weight?: number | undefined;
|
|
49
|
-
tare?: number | undefined;
|
|
50
|
-
container_sequence?: number | undefined;
|
|
51
|
-
sequence?: number | undefined;
|
|
52
|
-
}[] | undefined;
|
|
53
|
-
vehicle?: {
|
|
54
|
-
vehicle_id?: string | number | undefined;
|
|
55
|
-
vehicle_type?: number | undefined;
|
|
56
|
-
version_type?: number | undefined;
|
|
57
|
-
suspension_type?: string | undefined;
|
|
58
|
-
first_axle?: number | undefined;
|
|
59
|
-
tare?: number | undefined;
|
|
60
|
-
max_supported_weight?: number | undefined;
|
|
61
|
-
quantity?: number | undefined;
|
|
62
|
-
} | undefined;
|
|
63
|
-
}[];
|
|
64
|
-
};
|
|
65
|
-
id?: string | number | undefined;
|
|
66
|
-
company?: string | number | undefined;
|
|
67
|
-
config?: {
|
|
68
|
-
reorder_strategy: string;
|
|
69
|
-
transport_stability_floor: number;
|
|
70
|
-
max_iteration: number;
|
|
71
|
-
genetic_population: number;
|
|
72
|
-
genetic_generations: number;
|
|
73
|
-
genetic_mutation_rate: number;
|
|
74
|
-
beam_width: number;
|
|
75
|
-
beam_top_k: number;
|
|
76
|
-
axle_load_margin_percent: number;
|
|
77
|
-
preserve_tie_block_organization: boolean;
|
|
78
|
-
pin_tie_ratio_blocks: boolean;
|
|
79
|
-
enforce_milkrun_wall_reservation: boolean;
|
|
80
|
-
number_of_wall_to_allocate_from_last_waypoints: number;
|
|
81
|
-
} | undefined;
|
|
82
|
-
}>;
|
|
83
|
-
/**
|
|
84
|
-
* Parses stabilizer input at the public boundary.
|
|
85
|
-
* @param input_data - Unknown wire payload.
|
|
86
|
-
* @returns Validated stabilizer input in English contract shape.
|
|
87
|
-
*/
|
|
88
|
-
export declare function parse_stabilizer_input(input_data: unknown): StabilizerInput;
|
|
89
|
-
export { format_zod_error };
|
|
90
|
-
//# sourceMappingURL=parse_stabilizer_input.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse_stabilizer_input.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/contract/parse_stabilizer_input.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAE5F;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAI9D;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,OAAO,GAAG,eAAe,CAU3E;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { InvalidStabilizerInputError } from '../../exceptions/InvalidStabilizerInputError.js';
|
|
2
|
-
import { map_wire_input_to_contract } from './cargo_movement_wire_mapper.js';
|
|
3
|
-
import { format_zod_error } from './format_zod_error.js';
|
|
4
|
-
import { reject_forbidden_input_fields } from './reject_forbidden_input_fields.js';
|
|
5
|
-
import { stabilizer_input_schema } from './stabilizer_input_schema.js';
|
|
6
|
-
/**
|
|
7
|
-
* Safely parses stabilizer input after wire mapping.
|
|
8
|
-
* @param input_data - Unknown wire payload.
|
|
9
|
-
* @returns Zod safe parse result.
|
|
10
|
-
*/
|
|
11
|
-
export function safe_parse_stabilizer_input(input_data) {
|
|
12
|
-
const contract_payload = map_wire_input_to_contract(input_data);
|
|
13
|
-
return stabilizer_input_schema.safeParse(contract_payload);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Parses stabilizer input at the public boundary.
|
|
17
|
-
* @param input_data - Unknown wire payload.
|
|
18
|
-
* @returns Validated stabilizer input in English contract shape.
|
|
19
|
-
*/
|
|
20
|
-
export function parse_stabilizer_input(input_data) {
|
|
21
|
-
reject_forbidden_input_fields(input_data);
|
|
22
|
-
const result = safe_parse_stabilizer_input(input_data);
|
|
23
|
-
if (!result.success) {
|
|
24
|
-
throw new InvalidStabilizerInputError(format_zod_error(result.error));
|
|
25
|
-
}
|
|
26
|
-
return result.data;
|
|
27
|
-
}
|
|
28
|
-
export { format_zod_error };
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { format_zod_error } from './format_zod_error.js';
|
|
2
|
-
import { type StabilizerResponse } from './stabilizer_output_schema.js';
|
|
3
|
-
/**
|
|
4
|
-
* Safely parses stabilizer output envelope.
|
|
5
|
-
* @param output_data - Unknown response payload.
|
|
6
|
-
* @returns Zod safe parse result.
|
|
7
|
-
*/
|
|
8
|
-
export declare function safe_parse_stabilizer_output(output_data: unknown): import("zod").ZodSafeParseResult<{
|
|
9
|
-
status: "success";
|
|
10
|
-
data: {
|
|
11
|
-
envs: {
|
|
12
|
-
containers: {
|
|
13
|
-
width: number;
|
|
14
|
-
height: number;
|
|
15
|
-
length: number;
|
|
16
|
-
items: {
|
|
17
|
-
item_id: string;
|
|
18
|
-
x: number;
|
|
19
|
-
y: number;
|
|
20
|
-
z: number;
|
|
21
|
-
width: number;
|
|
22
|
-
height: number;
|
|
23
|
-
depth: number;
|
|
24
|
-
group_id?: string | null | undefined;
|
|
25
|
-
waypoint_id?: string | undefined;
|
|
26
|
-
weight?: number | undefined;
|
|
27
|
-
tie_ratio_orientation?: string | undefined;
|
|
28
|
-
family?: string | undefined;
|
|
29
|
-
supported_families?: string[] | undefined;
|
|
30
|
-
constraint?: string | undefined;
|
|
31
|
-
stack_families?: boolean | undefined;
|
|
32
|
-
stack_same_item?: boolean | undefined;
|
|
33
|
-
stack_same_area?: boolean | undefined;
|
|
34
|
-
stacking_unit?: string | undefined;
|
|
35
|
-
supported_weight?: number | undefined;
|
|
36
|
-
priority?: number | undefined;
|
|
37
|
-
}[];
|
|
38
|
-
sequence?: number | undefined;
|
|
39
|
-
kingpin_distance?: number | undefined;
|
|
40
|
-
container_distance_ahead?: number | undefined;
|
|
41
|
-
max_supported_weight?: number | undefined;
|
|
42
|
-
tare?: number | undefined;
|
|
43
|
-
cargo_weight?: number | undefined;
|
|
44
|
-
grouper?: number | undefined;
|
|
45
|
-
}[];
|
|
46
|
-
axles?: {
|
|
47
|
-
distance_from_origin?: number | undefined;
|
|
48
|
-
max_supported_weight?: number | undefined;
|
|
49
|
-
dnit_weight?: number | undefined;
|
|
50
|
-
tare?: number | undefined;
|
|
51
|
-
container_sequence?: number | undefined;
|
|
52
|
-
sequence?: number | undefined;
|
|
53
|
-
}[] | undefined;
|
|
54
|
-
vehicle?: {
|
|
55
|
-
vehicle_id?: string | number | undefined;
|
|
56
|
-
vehicle_type?: number | undefined;
|
|
57
|
-
version_type?: number | undefined;
|
|
58
|
-
suspension_type?: string | undefined;
|
|
59
|
-
first_axle?: number | undefined;
|
|
60
|
-
tare?: number | undefined;
|
|
61
|
-
max_supported_weight?: number | undefined;
|
|
62
|
-
quantity?: number | undefined;
|
|
63
|
-
} | undefined;
|
|
64
|
-
}[];
|
|
65
|
-
};
|
|
66
|
-
messages: string[];
|
|
67
|
-
} | {
|
|
68
|
-
status: "error";
|
|
69
|
-
data: string;
|
|
70
|
-
messages: string[];
|
|
71
|
-
}>;
|
|
72
|
-
/**
|
|
73
|
-
* Parses stabilizer output at the public boundary.
|
|
74
|
-
* @param output_data - Unknown response payload.
|
|
75
|
-
* @returns Validated stabilizer response in English contract shape.
|
|
76
|
-
*/
|
|
77
|
-
export declare function parse_stabilizer_output(output_data: unknown): StabilizerResponse;
|
|
78
|
-
export { format_zod_error };
|
|
79
|
-
//# sourceMappingURL=parse_stabilizer_output.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse_stabilizer_output.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/contract/parse_stabilizer_output.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAEH,KAAK,kBAAkB,EAC1B,MAAM,+BAA+B,CAAA;AAEtC;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,WAAW,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAGhE;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,OAAO,GAAG,kBAAkB,CAShF;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { InvalidStabilizerOutputError } from '../../exceptions/InvalidStabilizerOutputError.js';
|
|
2
|
-
import { format_zod_error } from './format_zod_error.js';
|
|
3
|
-
import { stabilizer_response_schema } from './stabilizer_output_schema.js';
|
|
4
|
-
/**
|
|
5
|
-
* Safely parses stabilizer output envelope.
|
|
6
|
-
* @param output_data - Unknown response payload.
|
|
7
|
-
* @returns Zod safe parse result.
|
|
8
|
-
*/
|
|
9
|
-
export function safe_parse_stabilizer_output(output_data) {
|
|
10
|
-
return stabilizer_response_schema.safeParse(output_data);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Parses stabilizer output at the public boundary.
|
|
14
|
-
* @param output_data - Unknown response payload.
|
|
15
|
-
* @returns Validated stabilizer response in English contract shape.
|
|
16
|
-
*/
|
|
17
|
-
export function parse_stabilizer_output(output_data) {
|
|
18
|
-
const result = safe_parse_stabilizer_output(output_data);
|
|
19
|
-
if (!result.success) {
|
|
20
|
-
throw new InvalidStabilizerOutputError(format_zod_error(result.error));
|
|
21
|
-
}
|
|
22
|
-
return result.data;
|
|
23
|
-
}
|
|
24
|
-
export { format_zod_error };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Rejects dropped contract bags (`original_input`, item `attributes`) before mapping.
|
|
3
|
-
* @param input_data - Raw stabilizer input.
|
|
4
|
-
*/
|
|
5
|
-
export declare function reject_forbidden_input_fields(input_data: unknown): void;
|
|
6
|
-
//# sourceMappingURL=reject_forbidden_input_fields.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reject_forbidden_input_fields.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/contract/reject_forbidden_input_fields.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI,CAWvE"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { InvalidStabilizerInputError } from '../../exceptions/InvalidStabilizerInputError.js';
|
|
2
|
-
/**
|
|
3
|
-
* Rejects dropped contract bags (`original_input`, item `attributes`) before mapping.
|
|
4
|
-
* @param input_data - Raw stabilizer input.
|
|
5
|
-
*/
|
|
6
|
-
export function reject_forbidden_input_fields(input_data) {
|
|
7
|
-
if (typeof input_data !== 'object' || input_data === null) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
if ('original_input' in input_data) {
|
|
11
|
-
throw new InvalidStabilizerInputError('original_input is not part of the stabilizer contract');
|
|
12
|
-
}
|
|
13
|
-
reject_item_attributes(input_data);
|
|
14
|
-
}
|
|
15
|
-
function reject_item_attributes(input_data) {
|
|
16
|
-
const cargo_state = input_data.cargo_state;
|
|
17
|
-
if (typeof cargo_state !== 'object' || cargo_state === null) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const envs = cargo_state.envs;
|
|
21
|
-
if (!Array.isArray(envs)) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
for (const env of envs) {
|
|
25
|
-
reject_env_item_attributes(env);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function reject_env_item_attributes(env) {
|
|
29
|
-
if (typeof env !== 'object' || env === null) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const containers = env.containers;
|
|
33
|
-
if (!Array.isArray(containers)) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
for (const container of containers) {
|
|
37
|
-
reject_container_item_attributes(container);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function reject_container_item_attributes(container) {
|
|
41
|
-
if (typeof container !== 'object' || container === null) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
const items = container.items;
|
|
45
|
-
if (!Array.isArray(items)) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
for (const item of items) {
|
|
49
|
-
if (typeof item === 'object' && item !== null && 'attributes' in item) {
|
|
50
|
-
throw new InvalidStabilizerInputError('item attributes is not part of the stabilizer contract');
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|