@jetta/cargo-stabilizer 0.1.0-8 → 0.1.0-9
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 -0
- package/build/core/candidates/candidate_validation.d.ts.map +1 -1
- package/build/core/candidates/candidate_validation.js +4 -0
- package/build/core/candidates/is_elevated_on_supporter_origin.d.ts +14 -0
- package/build/core/candidates/is_elevated_on_supporter_origin.d.ts.map +1 -0
- package/build/core/candidates/is_elevated_on_supporter_origin.js +28 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,7 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
12
12
|
- Organization gates: waypoint Z zones, macro delivery order (`preserve_tie_block_organization`), and milkrun wall reservation (`enforce_milkrun_wall_reservation`).
|
|
13
13
|
- Empty-space candidate discovery for floor and elevated slots via `@jetta/empty-spaces-manager`.
|
|
14
14
|
- Supporter-top candidate slots aligned to each stacked item footprint, included in beam expansion (`top_k ∪ supporter_top`).
|
|
15
|
+
- Elevated candidates must sit on a supporter `(x, z)` origin so stacked loose items copy the supporter footprint.
|
|
15
16
|
- Public contract exports: `parse_stabilizer_input`, `parse_stabilizer_output`, `safe_parse_stabilizer_input`, `safe_parse_stabilizer_output`, and related domain types.
|
|
16
17
|
|
|
17
18
|
### Changed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"candidate_validation.d.ts","sourceRoot":"","sources":["../../../src/core/candidates/candidate_validation.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"candidate_validation.d.ts","sourceRoot":"","sources":["../../../src/core/candidates/candidate_validation.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;AAGxE;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAC9B,OAAO,EAAE,0BAA0B,EACnC,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9C,OAAO,CAeT"}
|
|
@@ -3,6 +3,7 @@ import { has_overlap, is_fully_supported, is_inside_container } from '../geometr
|
|
|
3
3
|
import { is_position_in_zone } from '../waypoint/build_waypoint_zones.js';
|
|
4
4
|
import { is_position_in_milkrun_reserved_band } from '../waypoint/milkrun_wall_reservation.js';
|
|
5
5
|
import { resolve_item_waypoint_id } from '../waypoint/validate_waypoint_ids.js';
|
|
6
|
+
import { is_elevated_on_supporter_origin } from './is_elevated_on_supporter_origin.js';
|
|
6
7
|
/**
|
|
7
8
|
* Validates geometry and waypoint constraints for a candidate position.
|
|
8
9
|
* @param context - Candidate generation context.
|
|
@@ -14,6 +15,9 @@ export function is_candidate_valid(context, target_index, position) {
|
|
|
14
15
|
if (!is_candidate_geometry_valid(context, target_index, position)) {
|
|
15
16
|
return false;
|
|
16
17
|
}
|
|
18
|
+
if (!is_elevated_on_supporter_origin(context, target_index, position)) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
17
21
|
if (!is_candidate_milkrun_valid(context, target_index, position)) {
|
|
18
22
|
return false;
|
|
19
23
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CandidateGenerationContext } from './candidate_context.js';
|
|
2
|
+
/**
|
|
3
|
+
* Floor candidates stay free; elevated ones must copy a supporter (x, z) origin.
|
|
4
|
+
* @param context - Candidate generation context.
|
|
5
|
+
* @param target_index - Target container index.
|
|
6
|
+
* @param position - Candidate position.
|
|
7
|
+
* @returns True when the candidate is on the floor or on a supporter origin.
|
|
8
|
+
*/
|
|
9
|
+
export declare function is_elevated_on_supporter_origin(context: CandidateGenerationContext, target_index: number, position: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
z: number;
|
|
13
|
+
}): boolean;
|
|
14
|
+
//# sourceMappingURL=is_elevated_on_supporter_origin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is_elevated_on_supporter_origin.d.ts","sourceRoot":"","sources":["../../../src/core/candidates/is_elevated_on_supporter_origin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;AAIxE;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC3C,OAAO,EAAE,0BAA0B,EACnC,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9C,OAAO,CAQT"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const ORIGIN_EPSILON = 1e-6;
|
|
2
|
+
/**
|
|
3
|
+
* Floor candidates stay free; elevated ones must copy a supporter (x, z) origin.
|
|
4
|
+
* @param context - Candidate generation context.
|
|
5
|
+
* @param target_index - Target container index.
|
|
6
|
+
* @param position - Candidate position.
|
|
7
|
+
* @returns True when the candidate is on the floor or on a supporter origin.
|
|
8
|
+
*/
|
|
9
|
+
export function is_elevated_on_supporter_origin(context, target_index, position) {
|
|
10
|
+
if (position.y <= ORIGIN_EPSILON) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
const items = context.containers[target_index].items;
|
|
14
|
+
return items.some(item => matches_supporter_origin(item, context.loose.item_id, position));
|
|
15
|
+
}
|
|
16
|
+
function matches_supporter_origin(item, exclude_item_id, position) {
|
|
17
|
+
if (item.item_id === exclude_item_id) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
return is_same_origin(item, position) && is_supporter_top(item, position.y);
|
|
21
|
+
}
|
|
22
|
+
function is_same_origin(item, position) {
|
|
23
|
+
return Math.abs(item.x - position.x) <= ORIGIN_EPSILON
|
|
24
|
+
&& Math.abs(item.z - position.z) <= ORIGIN_EPSILON;
|
|
25
|
+
}
|
|
26
|
+
function is_supporter_top(item, candidate_y) {
|
|
27
|
+
return Math.abs(item.y + item.height - candidate_y) <= ORIGIN_EPSILON;
|
|
28
|
+
}
|