@hatiolab/things-scene 10.0.0-beta.126 → 10.0.0-beta.128

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.
Files changed (96) hide show
  1. package/dist-types/command/command-migrate.d.ts.map +1 -1
  2. package/dist-types/components/container-abstract.d.ts.map +1 -1
  3. package/dist-types/components/data/data.d.ts.map +1 -1
  4. package/dist-types/components/line.d.ts.map +1 -1
  5. package/dist-types/components/mixins/holdable.d.ts +12 -0
  6. package/dist-types/components/mixins/holdable.d.ts.map +1 -0
  7. package/dist-types/components/polyline.d.ts +6 -0
  8. package/dist-types/components/polyline.d.ts.map +1 -1
  9. package/dist-types/components/root-container.d.ts +0 -11
  10. package/dist-types/components/root-container.d.ts.map +1 -1
  11. package/dist-types/diagnostics/contract-inspector.d.ts +1 -1
  12. package/dist-types/diagnostics/contract-inspector.d.ts.map +1 -1
  13. package/dist-types/diagnostics/data-lag-tracker.d.ts +31 -25
  14. package/dist-types/diagnostics/data-lag-tracker.d.ts.map +1 -1
  15. package/dist-types/diagnostics/inspector.d.ts +15 -15
  16. package/dist-types/diagnostics/inspector.d.ts.map +1 -1
  17. package/dist-types/diagnostics/loading-overlay.d.ts.map +1 -1
  18. package/dist-types/flow/auto-route.d.ts +36 -0
  19. package/dist-types/flow/auto-route.d.ts.map +1 -0
  20. package/dist-types/flow/face-anchors.d.ts +26 -0
  21. package/dist-types/flow/face-anchors.d.ts.map +1 -0
  22. package/dist-types/flow/flow-engine.d.ts +122 -0
  23. package/dist-types/flow/flow-engine.d.ts.map +1 -0
  24. package/dist-types/flow/flow-graph-coordinator.d.ts +80 -0
  25. package/dist-types/flow/flow-graph-coordinator.d.ts.map +1 -0
  26. package/dist-types/flow/flow-graph-validator.d.ts +33 -0
  27. package/dist-types/flow/flow-graph-validator.d.ts.map +1 -0
  28. package/dist-types/flow/flow-graph.d.ts +76 -0
  29. package/dist-types/flow/flow-graph.d.ts.map +1 -0
  30. package/dist-types/flow/flow-introspection.d.ts +36 -0
  31. package/dist-types/flow/flow-introspection.d.ts.map +1 -0
  32. package/dist-types/flow/flow-node.d.ts +69 -0
  33. package/dist-types/flow/flow-node.d.ts.map +1 -0
  34. package/dist-types/flow/flow-orientation-coordinator.d.ts +13 -0
  35. package/dist-types/flow/flow-orientation-coordinator.d.ts.map +1 -0
  36. package/dist-types/flow/flow-orientation.d.ts +42 -0
  37. package/dist-types/flow/flow-orientation.d.ts.map +1 -0
  38. package/dist-types/flow/flow-trace.d.ts +5 -0
  39. package/dist-types/flow/flow-trace.d.ts.map +1 -0
  40. package/dist-types/flow/index.d.ts +16 -0
  41. package/dist-types/flow/index.d.ts.map +1 -0
  42. package/dist-types/flow/segment-topology.d.ts +225 -0
  43. package/dist-types/flow/segment-topology.d.ts.map +1 -0
  44. package/dist-types/flow/station-host-inference.d.ts +23 -0
  45. package/dist-types/flow/station-host-inference.d.ts.map +1 -0
  46. package/dist-types/items/arrangement/centering-queue-strategy.d.ts +10 -0
  47. package/dist-types/items/arrangement/centering-queue-strategy.d.ts.map +1 -0
  48. package/dist-types/items/arrangement/gravity-strategy.d.ts +9 -0
  49. package/dist-types/items/arrangement/gravity-strategy.d.ts.map +1 -0
  50. package/dist-types/items/arrangement/grid-strategy.d.ts +11 -0
  51. package/dist-types/items/arrangement/grid-strategy.d.ts.map +1 -0
  52. package/dist-types/items/arrangement/index.d.ts +7 -0
  53. package/dist-types/items/arrangement/index.d.ts.map +1 -0
  54. package/dist-types/items/arrangement/queue-strategy.d.ts +9 -0
  55. package/dist-types/items/arrangement/queue-strategy.d.ts.map +1 -0
  56. package/dist-types/items/arrangement/shelf-strategy.d.ts +11 -0
  57. package/dist-types/items/arrangement/shelf-strategy.d.ts.map +1 -0
  58. package/dist-types/items/arrangement/stack-strategy.d.ts +9 -0
  59. package/dist-types/items/arrangement/stack-strategy.d.ts.map +1 -0
  60. package/dist-types/items/capacity-mixin.d.ts +298 -0
  61. package/dist-types/items/capacity-mixin.d.ts.map +1 -0
  62. package/dist-types/items/capacity.d.ts +53 -0
  63. package/dist-types/items/capacity.d.ts.map +1 -0
  64. package/dist-types/items/index.d.ts +5 -0
  65. package/dist-types/items/index.d.ts.map +1 -0
  66. package/dist-types/items/items-data-binding.d.ts +79 -0
  67. package/dist-types/items/items-data-binding.d.ts.map +1 -0
  68. package/dist-types/items/slot-record.d.ts +23 -0
  69. package/dist-types/items/slot-record.d.ts.map +1 -0
  70. package/dist-types/layer/modeler/path-handler.d.ts.map +1 -1
  71. package/dist-types/layer/modeling-layer.d.ts +16 -0
  72. package/dist-types/layer/modeling-layer.d.ts.map +1 -1
  73. package/dist-types/things-scene/application-context.d.ts +6 -2
  74. package/dist-types/things-scene/application-context.d.ts.map +1 -1
  75. package/dist-types/things-scene/index.d.ts +5 -2
  76. package/dist-types/things-scene/index.d.ts.map +1 -1
  77. package/dist-types/threed/factories/floor-plate.d.ts.map +1 -1
  78. package/dist-types/threed/managers/vertex-gizmo-manager.d.ts.map +1 -1
  79. package/dist-types/threed/real-object.d.ts +12 -0
  80. package/dist-types/threed/real-object.d.ts.map +1 -1
  81. package/dist-types/threed/three-capability.d.ts +2 -2
  82. package/dist-types/threed/three-capability.d.ts.map +1 -1
  83. package/dist-types/transfer/container-capacity-helpers.d.ts +18 -0
  84. package/dist-types/transfer/container-capacity-helpers.d.ts.map +1 -0
  85. package/dist-types/transfer/container-capacity.d.ts +5 -374
  86. package/dist-types/transfer/container-capacity.d.ts.map +1 -1
  87. package/dist-types/transfer/index.d.ts +3 -0
  88. package/dist-types/transfer/index.d.ts.map +1 -1
  89. package/dist-types/transfer/transferable-mixin.d.ts +259 -0
  90. package/dist-types/transfer/transferable-mixin.d.ts.map +1 -0
  91. package/package.json +1 -1
  92. package/things-scene-min.js +11 -11
  93. package/things-scene-min.js.map +1 -1
  94. package/things-scene-transfer.mjs +3 -2
  95. package/things-scene.mjs +3 -3
  96. package/things-scene.mjs.map +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow-gra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AAgB,WAAW,CACzB,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,cAAc,EACrB,IAAI,EAAE,gBAAgB,EAAE,EACxB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,GAC3B,gBAAgB,CAsClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,eAAe,CAAA;CAAE,GAAG,MAAM,GAAG,IAAI,CAqC7G"}
@@ -0,0 +1,33 @@
1
+ import type { FlowGraph } from './flow-graph.js';
2
+ export type IssueSeverity = 'error' | 'warning';
3
+ export type IssueCode = 'orphan-source' | 'dead-end' | 'cycle' | 'unreachable-target' | 'invalid-weight';
4
+ export interface FlowGraphIssue {
5
+ severity: IssueSeverity;
6
+ code: IssueCode;
7
+ nodeId?: string;
8
+ /** cycle 의 경우 노드 체인 (정렬: 시작 = lexically min id, 결정론). */
9
+ cycle?: string[];
10
+ message: string;
11
+ }
12
+ export interface ValidateOptions {
13
+ /**
14
+ * 의도 cycle 자격 — 해당 노드 id 의 cycle 은 skip (예: LoopSorter / LoopConveyor).
15
+ * 호출자가 root walk 로 isLoop capability 식별 후 전달. validator 자체는 순수.
16
+ */
17
+ loopCapableIds?: ReadonlySet<string>;
18
+ /**
19
+ * RoutingTarget 자격 노드 id 목록 — sink (dead-end 자격 면제) 판단 + unreachable 검사.
20
+ * coordinator 의 destToSinks 키로 도출 가능.
21
+ */
22
+ routingTargetIds?: ReadonlySet<string>;
23
+ /**
24
+ * (Phase B1) routingWeight 추출 결과 — nodeId → weight. 미선언/default 1 인 노드는
25
+ * 생략 가능. validator 가 weight ≤ 0 의 invalid-weight warning 검출.
26
+ */
27
+ routingWeights?: ReadonlyMap<string, number>;
28
+ }
29
+ /**
30
+ * graph 의 invariants 검증. 같은 입력 → 같은 결과 (결정론).
31
+ */
32
+ export declare function validate(graph: FlowGraph, opts?: ValidateOptions): FlowGraphIssue[];
33
+ //# sourceMappingURL=flow-graph-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow-graph-validator.d.ts","sourceRoot":"","sources":["../../src/flow/flow-graph-validator.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,CAAA;AAC/C,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG,UAAU,GAAG,OAAO,GAAG,oBAAoB,GAAG,gBAAgB,CAAA;AAExG,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,aAAa,CAAA;IACvB,IAAI,EAAE,SAAS,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAEpC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAEtC;;;OAGG;IACH,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC7C;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,GAAE,eAAoB,GAAG,cAAc,EAAE,CA8FvF"}
@@ -0,0 +1,76 @@
1
+ import { type SegmentTopology, type SegmentBounds, type MatchTolerance } from './segment-topology.js';
2
+ /** 그래프 노드 입력 — collectAdjacentSegments 출력과 동일 shape. */
3
+ export interface FlowGraphNode {
4
+ id: string;
5
+ topology: SegmentTopology;
6
+ bounds?: SegmentBounds;
7
+ /**
8
+ * 명시 링크 — 사용자가 *명시 id* 로 지정한 그래프 엣지. 인접(기하) 자동연결로는
9
+ * 못 잇는 *떨어진 타겟*(예: 슈트 → 멀리 있는 StockPile)을 연결. 인접 엣지에 *추가*
10
+ * (대체 아님). coordinator 가 RoutingLinks capability 에서 채운다. refid 아님(시스템
11
+ * auto-link 와 별개) — 사용자 명시 id.
12
+ */
13
+ links?: {
14
+ /** 이 노드 → target 노드 id(들). */
15
+ downstream?: string[];
16
+ /** source 노드 id(들) → 이 노드. */
17
+ upstream?: string[];
18
+ };
19
+ }
20
+ /** 산출된 방향 그래프. */
21
+ export interface FlowGraph {
22
+ /** id → 노드. */
23
+ nodes: Map<string, FlowGraphNode>;
24
+ /** id → outbound 별 연결 대상 id (없으면 null). index = outbound 순서. */
25
+ out: Map<string, Array<string | null>>;
26
+ /** 말단(outbound 연결 0) — 목적지 후보. */
27
+ sinks: Set<string>;
28
+ /** 진입원(inbound 연결 0). */
29
+ sources: Set<string>;
30
+ }
31
+ /**
32
+ * 노드 목록 → 방향 그래프. 간선은 matchOutbounds(anchor 정밀 + footprint 배달)
33
+ * 재사용 — 컨베이어 자동연결과 *동일 판정*이라 그래프가 실제 흐름과 일치.
34
+ */
35
+ export declare function buildFlowGraph(nodes: ReadonlyArray<FlowGraphNode>, tolerance?: MatchTolerance): FlowGraph;
36
+ /**
37
+ * fromId 의 *각 outbound* 에서 도달 가능한 노드 집합. 반환 index = outbound 순서.
38
+ * 연결 없는 outbound = 빈 집합. 분기점 next-hop 선택의 1차 재료.
39
+ */
40
+ export declare function reachableByOutbound(graph: FlowGraph, fromId: string): Set<string>[];
41
+ /**
42
+ * fromId 에서 destId 로 가까워지는 *outbound index 목록*, **최단 hop 우선 정렬**.
43
+ * 동률은 index 순(결정적). 여러 개면 상위(resolver)가 capacity 등으로 tie-break.
44
+ * 빈 배열 = 도달 불가(이 노드에선 막힘).
45
+ */
46
+ export declare function nextHops(graph: FlowGraph, fromId: string, destId: string): number[];
47
+ /**
48
+ * fromId 에서 destId 로 가는 *최단 outbound index 1개* (없으면 -1). resolver 가
49
+ * capacity 무관할 때의 기본 선택. capacity-reactive 는 nextHops 전체를 받아 거른다.
50
+ */
51
+ export declare function nextHop(graph: FlowGraph, fromId: string, destId: string): number;
52
+ /** fromId 가 destId 에 도달 가능한가 (어느 outbound 로든). dispatcher canReach 의 망 판정. */
53
+ export declare function canReach(graph: FlowGraph, fromId: string, destId: string): boolean;
54
+ /** fromId 에서 도달 가능한 *말단(sink) 노드 집합*. generator 가 보낼 수 있는 목적지 후보. */
55
+ export declare function reachableSinks(graph: FlowGraph, fromId: string): Set<string>;
56
+ /**
57
+ * fromId 에서 *목적지 값을 담당하는 여러 sink 중 아무거나* 로 가까워지는 outbound
58
+ * index 목록 (최단 hop 우선). 논리 목적지를 담당하는 물리 sink 가 여럿일 때
59
+ * (= 부하분산 여지). destIds = 그 목적지를 담당하는 sink 노드 id 들.
60
+ */
61
+ export declare function nextHopsToAny(graph: FlowGraph, fromId: string, destIds: Iterable<string>): number[];
62
+ /** Outbound 후보 — Phase B2 balancing 정책에서 hops 동률 그룹 + target sink id 사용. */
63
+ export interface NextHopCandidate {
64
+ /** outbound port index (FlowGraphNode.topology.outbounds 의 index, = graph.out 의 index). */
65
+ index: number;
66
+ /** 이 outbound 의 *_가까운 sink_* 까지의 최단 hop 수 (자기 포함 = 1). */
67
+ hops: number;
68
+ /** 그 hop 의 *_가까운 sink id_* (동률 시 lexical first — 결정론). */
69
+ target: string;
70
+ }
71
+ /**
72
+ * nextHopsToAny 의 *_상세 버전_* — index + hops + target sink id. balancing 정책이
73
+ * *_같은 hops 동률 그룹화_* + *_target sink 의 routingWeight 조회_* 등에 사용 (Phase B2).
74
+ */
75
+ export declare function nextHopsToAnyDetailed(graph: FlowGraph, fromId: string, destIds: Iterable<string>): NextHopCandidate[];
76
+ //# sourceMappingURL=flow-graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow-graph.d.ts","sourceRoot":"","sources":["../../src/flow/flow-graph.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AAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAGhF;AAED,8EAA8E;AAC9E,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAGlF;AAED,qEAAqE;AACrE,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAM5E;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAEnG;AAED,4EAA4E;AAC5E,MAAM,WAAW,gBAAgB;IAC/B,2FAA2F;IAC3F,KAAK,EAAE,MAAM,CAAA;IACb,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAA;IACZ,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,GACxB,gBAAgB,EAAE,CAwBpB"}
@@ -0,0 +1,36 @@
1
+ export interface DataScenario {
2
+ /** 이 시나리오의 carrier data — 경로의 모든 constraint AND merge. */
3
+ data: Record<string, any>;
4
+ /** sampling weight — default 1 (= 균등). 향후 demand-driven 등 확장. */
5
+ weight: number;
6
+ /** debug — 경로의 segment id 들. */
7
+ pathIds?: string[];
8
+ /**
9
+ * 경로의 *종착 sink id* (= carrier 의 최종 목적지). generator 가 carrier.meta.
10
+ * destination 에 주입 → 분기점이 목적지 지향 next-hop 라우팅(flow-graph.canReach)
11
+ * 으로 분기하게 될 토대. 미상이면 undefined (= 목적지 없는 carrier).
12
+ */
13
+ destination?: string;
14
+ }
15
+ interface SegmentLike {
16
+ state?: {
17
+ id?: string;
18
+ };
19
+ parent?: any;
20
+ rootModel?: any;
21
+ root?: any;
22
+ getSegmentTopology?: () => any;
23
+ }
24
+ /**
25
+ * 생성기 (= source) 부터 BFS — RoutingCapability 의 constraints 누적 + sink 도달
26
+ * 시 시나리오 추가. 결과: 가능 data 시나리오 list.
27
+ *
28
+ * @returns 데이터 시나리오 list (균등 weight). 빈 list = downstream 추론 실패.
29
+ */
30
+ export declare function enumerateDataScenarios(source: SegmentLike, maxDepth?: number): DataScenario[];
31
+ /**
32
+ * AND merge — 두 constraint 의 key-value 합치기. key 충돌 (= 다른 value) 시 null.
33
+ */
34
+ export declare function mergeConstraints(base: Record<string, any>, add: Record<string, any>): Record<string, any> | null;
35
+ export {};
36
+ //# sourceMappingURL=flow-introspection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow-introspection.d.ts","sourceRoot":"","sources":["../../src/flow/flow-introspection.ts"],"names":[],"mappings":"AAoCA,MAAM,WAAW,YAAY;IAC3B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAA;IACd,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACvB,MAAM,CAAC,EAAE,GAAG,CAAA;IACZ,SAAS,CAAC,EAAE,GAAG,CAAA;IACf,IAAI,CAAC,EAAE,GAAG,CAAA;IACV,kBAAkB,CAAC,EAAE,MAAM,GAAG,CAAA;CAC/B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,WAAW,EACnB,QAAQ,SAAK,GACZ,YAAY,EAAE,CAmGhB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACvB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAO5B"}
@@ -0,0 +1,69 @@
1
+ import type Component from '../components/component.js';
2
+ type Constructor<T = {}> = new (...args: any[]) => T;
3
+ /** 3D position. */
4
+ export type Vec3 = {
5
+ x: number;
6
+ y: number;
7
+ z: number;
8
+ };
9
+ /**
10
+ * Port — flow graph 의 edge endpoint (inbound / outbound).
11
+ * 그래프 측 routing / FlowEngine 이 활용.
12
+ */
13
+ export interface Port {
14
+ /** Port id (node 안 유일). */
15
+ id: string;
16
+ /** 위치 (node-local). 도메인 측 routing / 시각화 활용. */
17
+ position?: Vec3;
18
+ /** 진행 방향 (node-local). 그래프 측 tangent. */
19
+ direction?: Vec3;
20
+ /** 도메인 메타데이터 (label / capability tag 등). */
21
+ meta?: Record<string, any>;
22
+ }
23
+ /**
24
+ * SlotInfo — node 안 세분 위치 (slot / cell 등).
25
+ *
26
+ * 3 capability 가 query 로 활용:
27
+ * - Dwellable.attachPointFor(item, { slotId }) — slot.attach 활용
28
+ * - Transferable.receive(item, { slotId }) — slot 별 receive
29
+ * - Operable.transform(inputs, outputs, { slotId }) — slot 별 변화
30
+ */
31
+ export interface SlotInfo {
32
+ /** node-local 위치. */
33
+ position: Vec3;
34
+ /** node-local size (옵션). */
35
+ size?: {
36
+ width: number;
37
+ height: number;
38
+ depth: number;
39
+ };
40
+ /** 3D scene-graph attach point (옵션). holder 의 _realObject 자손 object3d. */
41
+ attach?: any;
42
+ /** 도메인 메타데이터. */
43
+ meta?: Record<string, any>;
44
+ }
45
+ /**
46
+ * FlowNode capability — flow graph 의 노드 (구조 + flow). 보유는 Holdable 위임.
47
+ *
48
+ * 모든 자식 (Transferable / Dwellable / Operable) 의 base. Dwellable 적용 안 한 node
49
+ * 도 Holdable 로 _items 사용 가능 — 정책 (capacity 등) 만 추가 layer.
50
+ *
51
+ * Phase D-4 (2026-06-20): ItemsDataBinding 자동 합류 — 모든 FlowNode 자손이
52
+ * `holder.data` 표준 entry 자동 보유.
53
+ */
54
+ export default function FlowNode<T extends Constructor<Component>>(superclass: T): any;
55
+ /** Type guard. */
56
+ export declare function isFlowNode(c: any): c is {
57
+ isFlowNode: true;
58
+ inboundPorts(): Port[];
59
+ outboundPorts(): Port[];
60
+ slotIds?(): string[];
61
+ slotAt?(slotId: string): SlotInfo | null;
62
+ _items: any[];
63
+ addItem: (h: any, o?: any) => void;
64
+ removeItem: (h: any, silent?: boolean) => void;
65
+ handoverIn: (c: any, o?: any) => void;
66
+ handoverOut: (c: any) => void;
67
+ };
68
+ export {};
69
+ //# sourceMappingURL=flow-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow-node.d.ts","sourceRoot":"","sources":["../../src/flow/flow-node.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,SAAS,MAAM,4BAA4B,CAAA;AA0BvD,KAAK,WAAW,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;AAEpD,mBAAmB;AACnB,MAAM,MAAM,IAAI,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEtD;;;GAGG;AACH,MAAM,WAAW,IAAI;IACnB,2BAA2B;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,IAAI,CAAA;IACf,yCAAyC;IACzC,SAAS,CAAC,EAAE,IAAI,CAAA;IAChB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC3B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,QAAQ;IACvB,qBAAqB;IACrB,QAAQ,EAAE,IAAI,CAAA;IACd,4BAA4B;IAC5B,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IACvD,0EAA0E;IAC1E,MAAM,CAAC,EAAE,GAAG,CAAA;IACZ,iBAAiB;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC3B;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,CAAC,SAAS,WAAW,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,GAAG,CA2FrF;AAED,kBAAkB;AAClB,wBAAgB,UAAU,CACxB,CAAC,EAAE,GAAG,GACL,CAAC,IAAI;IACN,UAAU,EAAE,IAAI,CAAA;IAChB,YAAY,IAAI,IAAI,EAAE,CAAA;IACtB,aAAa,IAAI,IAAI,EAAE,CAAA;IACvB,OAAO,CAAC,IAAI,MAAM,EAAE,CAAA;IACpB,MAAM,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAAA;IACxC,MAAM,EAAE,GAAG,EAAE,CAAA;IACb,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;IAClC,UAAU,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9C,UAAU,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;IACrC,WAAW,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;CAC9B,CAEA"}
@@ -0,0 +1,13 @@
1
+ import { type FlowDir } from './flow-orientation.js';
2
+ /** 트리에서 segment/anchor/hub 수집 → 흐름 방향 map. */
3
+ export declare function computeFlowMap(root: any): Map<string, FlowDir>;
4
+ /**
5
+ * 컨베이어가 자기 흐름 방향(reverse 여부)을 조회 — getSegmentTopology 에서 호출.
6
+ * true=reverse, false=forward, undefined=미결정(override 안 함, 수동값 유지).
7
+ *
8
+ * 흐름 방향은 *정적 레이아웃의 함수*라 시뮬 중엔 안 바뀐다 → root 당 *1회*만 computeFlowMap
9
+ * 하고 캐시 (per-call 전체 트리 스캔 제거 = 성능 핵심). 첫 조회는 모델 빌드 완료 후 발생하고,
10
+ * 모델 재로드 시 root(model_layer)가 새로 생겨 캐시도 자연히 비므로 별도 무효화 불필요.
11
+ */
12
+ export declare function flowReverseFor(self: any): boolean | undefined;
13
+ //# sourceMappingURL=flow-orientation-coordinator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow-orientation-coordinator.d.ts","sourceRoot":"","sources":["../../src/flow/flow-orientation-coordinator.ts"],"names":[],"mappings":"AAoBA,OAAO,EAA+D,KAAK,OAAO,EAAa,MAAM,uBAAuB,CAAA;AAuC5H,8CAA8C;AAC9C,wBAAgB,cAAc,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAkF9D;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,GAAG,SAAS,CAkB7D"}
@@ -0,0 +1,42 @@
1
+ export interface Vec2 {
2
+ x: number;
3
+ z: number;
4
+ }
5
+ /** 방향 추론 대상 segment — start→end 가 intrinsic forward. */
6
+ export interface FlowSegmentInput {
7
+ id: string;
8
+ start: Vec2;
9
+ end: Vec2;
10
+ }
11
+ /** 방향 기준점 — 연결 지점(세그먼트 끝점과 매칭)에서의 소스/싱크. */
12
+ export interface FlowAnchor {
13
+ pos: Vec2;
14
+ /** 'source' = 여기서 흘려보냄(연결 세그먼트의 진입), 'sink' = 여기로 빨아들임(진출). */
15
+ kind: 'source' | 'sink';
16
+ }
17
+ /** forward = start→end, reverse = end→start, unknown = 미결정(anchor 미도달). */
18
+ export type FlowDir = 'forward' | 'reverse' | 'unknown';
19
+ export interface FlowResult {
20
+ /** segment id → 흐름 방향. */
21
+ directions: Map<string, FlowDir>;
22
+ /** anchor 불일치로 충돌한 segment id 들. */
23
+ conflicts: string[];
24
+ }
25
+ /**
26
+ * 연결된 segment 들의 흐름 방향을 anchor 에서 전파해 추론.
27
+ * @param tolerance 끝점 일치(연결) 판정 거리 (scene unit). default 5.
28
+ * @param hubs joint 처럼 *여러 컨베이어를 잇는 허브* — 한 그룹의 위치들은 단일
29
+ * 연결점으로 병합돼 그 사이로 흐름이 전파/보존된다 (2-way joint=통과, 3+=분기).
30
+ * @param anchorTolerance anchor(소스/싱크)→세그먼트 끝점 매칭 거리. 소스(generator)는
31
+ * 컨베이어와 *면 overlap*(~halfSpan) 으로 연결돼 점거리가 클 수 있어 endpoint
32
+ * 클러스터(tolerance)보다 넉넉해야 한다. default = tolerance.
33
+ */
34
+ /** hub 입력 — 위치 그룹(기존) 또는 source/sink 성격을 가진 hub.
35
+ * kind 'sink' = drain(연결 세그먼트 모두 hub 로 흘러듦), 'source' = spring(모두 나감).
36
+ * joint 가 chute(sink)/generator(source) 를 footprint 에 품으면 그 kind 로 표시. */
37
+ export type FlowHub = ReadonlyArray<Vec2> | {
38
+ positions: ReadonlyArray<Vec2>;
39
+ kind?: 'source' | 'sink';
40
+ };
41
+ export declare function inferFlowDirections(segments: ReadonlyArray<FlowSegmentInput>, anchors: ReadonlyArray<FlowAnchor>, tolerance?: number, hubs?: ReadonlyArray<FlowHub>, anchorTolerance?: number): FlowResult;
42
+ //# sourceMappingURL=flow-orientation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow-orientation.d.ts","sourceRoot":"","sources":["../../src/flow/flow-orientation.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,IAAI;IACnB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED,wDAAwD;AACxD,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,IAAI,CAAA;IACX,GAAG,EAAE,IAAI,CAAA;CACV;AAED,4CAA4C;AAC5C,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,IAAI,CAAA;IACT,+DAA+D;IAC/D,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAA;CACxB;AAED,2EAA2E;AAC3E,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;AAEvD,MAAM,WAAW,UAAU;IACzB,0BAA0B;IAC1B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,oCAAoC;IACpC,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB;AAMD;;;;;;;;GAQG;AACH;;2EAE2E;AAC3E,MAAM,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,GAAG;IAAE,SAAS,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAA;CAAE,CAAA;AAExG,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,aAAa,CAAC,gBAAgB,CAAC,EACzC,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,EAClC,SAAS,SAAI,EACb,IAAI,GAAE,aAAa,CAAC,OAAO,CAAM,EACjC,eAAe,SAAY,GAC1B,UAAU,CAyPZ"}
@@ -0,0 +1,5 @@
1
+ export declare const FLOW_TRACE = false;
2
+ export declare function ftrace(...args: unknown[]): void;
3
+ /** 컴포넌트 식별자 — state.id 우선, refid fallback. */
4
+ export declare function ftId(c: any): string;
5
+ //# sourceMappingURL=flow-trace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow-trace.d.ts","sourceRoot":"","sources":["../../src/flow/flow-trace.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU,QAAQ,CAAA;AAK/B,wBAAgB,MAAM,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAM/C;AAED,8CAA8C;AAC9C,wBAAgB,IAAI,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAEnC"}
@@ -0,0 +1,16 @@
1
+ export { anchorsConnect, deliversInto, matchOutbounds, pointInRotatedRect, rayAbsDistanceToRect, straightSegmentTopology, straightSegmentEndpoints, arcSegmentTopology, straightSegmentMultiInbound, type Anchor2D, type SegmentTopology, type SegmentBounds, type MatchTolerance } from './segment-topology.js';
2
+ export { rectFaceAnchors, type FaceAnchor } from './face-anchors.js';
3
+ export { buildFlowGraph, nextHops, nextHop, nextHopsToAny, nextHopsToAnyDetailed, canReach, reachableSinks, reachableByOutbound, type FlowGraph, type FlowGraphNode, type NextHopCandidate } from './flow-graph.js';
4
+ export { validate as validateFlowGraph } from './flow-graph-validator.js';
5
+ export type { IssueSeverity, IssueCode, ValidateOptions, FlowGraphIssue } from './flow-graph-validator.js';
6
+ export { inferDownstreamId, collectAdjacentSegments } from './auto-route.js';
7
+ export { enumerateDataScenarios, type DataScenario } from './flow-introspection.js';
8
+ export { inferFlowDirections, type FlowAnchor, type FlowSegmentInput, type FlowDir, type Vec2 } from './flow-orientation.js';
9
+ export { computeFlowMap, flowReverseFor } from './flow-orientation-coordinator.js';
10
+ export { ftrace, ftId } from './flow-trace.js';
11
+ export { next, downstream, reachableDestinations, reachableDestinationsFrom, reachableDestinationsWeightedFrom, pickWeightedDestination, graphFor, validate, FlowEngine, type RoutingResult, type WeightedDestination } from './flow-engine.js';
12
+ export { flowGraphFor, resolveNextHop, flowGraphIssues, sinksForDestination, componentForNode, nodeIdOf, allDestinations, applyPolicy, isRoutingTarget, type RoutingTarget, type BalancingPolicy, type BalancingState } from './flow-graph-coordinator.js';
13
+ export { findNearestStationHost, isStationHost, type StationHostCandidate } from './station-host-inference.js';
14
+ export { default as FlowNode, isFlowNode } from './flow-node.js';
15
+ export type { Port, SlotInfo, Vec3 } from './flow-node.js';
16
+ //# sourceMappingURL=index.d.ts.map
@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R,QAAQ,EACR,UAAU,EACV,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,YAAY,EACZ,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,QAAQ,EACR,eAAe,EACf,WAAW,EACX,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,cAAc,EACpB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAI9G,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,225 @@
1
+ import { rectFaceAnchors } from './face-anchors.js';
2
+ export { rectFaceAnchors };
3
+ /** XZ 평면 vector (= scene world 좌표의 X/Z, Y 는 floor-level 무시). */
4
+ export interface Anchor2D {
5
+ /** scene world position (x = state.left + offset, z = state.top + offset). */
6
+ worldPos: {
7
+ x: number;
8
+ z: number;
9
+ };
10
+ /** 진행 방향 단위 vector (carrier 의 속도 vector 와 일치). */
11
+ direction: {
12
+ x: number;
13
+ z: number;
14
+ };
15
+ /**
16
+ * 면(face) 의 절반 길이 — anchor 가 *면* 에서 유래한 경우. anchorsConnect 가
17
+ * 접선 방향 판정을 중심 거리 근사가 아닌 *면 segment 겹침* 으로 수행하는 데
18
+ * 사용. 미지정 (점 anchor) 시 기존 중심 거리 판정 fallback.
19
+ */
20
+ halfSpan?: number;
21
+ }
22
+ /** Segment 의 입출구 anchor 들. inbound/outbound 각 1개 이상. */
23
+ export interface SegmentTopology {
24
+ /** 입구 anchor 들. carrier 가 들어올 수 있는 면. 미구현 segment = 빈 배열. */
25
+ inbounds: Anchor2D[];
26
+ /** 출구 anchor 들. carrier 가 나갈 수 있는 면. 미구현 segment = 빈 배열. */
27
+ outbounds: Anchor2D[];
28
+ }
29
+ /** Anchor 매칭 tolerance (= 자동 연결 판정 기준). */
30
+ export interface MatchTolerance {
31
+ /** 좌표 distance 임계 (scene unit). default 5. */
32
+ distance?: number;
33
+ /** 방향 dot product 임계 (= cosine). 1 = 완전 일치, 0.95 ≈ 18° 이내. default 0.9. */
34
+ cosine?: number;
35
+ /** sink(outbound 없는 종착: StockPile/Dock 등) footprint-배달 margin. default 30 —
36
+ * 딱 안 붙어도 인접하면 자동링크. 흐름연속 후보는 영향 없음(6 고정). */
37
+ sinkMargin?: number;
38
+ }
39
+ /**
40
+ * State 기반 *_straight segment_* 의 topology. 가장 흔한 케이스 — Conveyor /
41
+ * cross-belt-line / induct-station 등. orientation 자동 추정 (horizontal /
42
+ * vertical / auto by aspect).
43
+ *
44
+ * 가정:
45
+ * - state.left/top = 좌상단, width/height = 크기
46
+ * - rotation = 중심 기준 회전 (radian, CW positive — things-scene 표준)
47
+ * - 흐름 방향 = *_긴 축_* (orientation auto 시 width vs height 비교)
48
+ * - status='reverse' 시 흐름 반대 (= inbound/outbound swap)
49
+ *
50
+ * 결과:
51
+ * - inbound = 시작 짧은 면의 중앙
52
+ * - outbound = 끝 짧은 면의 중앙
53
+ * - direction = 시작 → 끝 단위 vector
54
+ */
55
+ export declare function straightSegmentTopology(state: {
56
+ left?: number;
57
+ top?: number;
58
+ width?: number;
59
+ height?: number;
60
+ rotation?: number;
61
+ orientation?: 'horizontal' | 'vertical' | '';
62
+ status?: string;
63
+ }, reverseOverride?: boolean): SegmentTopology;
64
+ /**
65
+ * Straight segment 의 *기하 끝점* (start/end) — status/reverse 무관. flow-orientation
66
+ * 이 흐름 방향을 추론할 때 순환(현재 reverse 가 다음 추론에 영향) 을 피하려 *고정된*
67
+ * 기하 끝점이 필요. straightSegmentTopology 의 startPos/endPos 와 동일 좌표.
68
+ * 반환: { start, end } — start→end 가 intrinsic forward (reverse=false 일 때 흐름).
69
+ */
70
+ export declare function straightSegmentEndpoints(state: {
71
+ left?: number;
72
+ top?: number;
73
+ width?: number;
74
+ height?: number;
75
+ rotation?: number;
76
+ orientation?: 'horizontal' | 'vertical' | '';
77
+ }): {
78
+ start: {
79
+ x: number;
80
+ z: number;
81
+ };
82
+ end: {
83
+ x: number;
84
+ z: number;
85
+ };
86
+ } | null;
87
+ /**
88
+ * Arc (curve) segment topology — cross-belt-curve / conveyor-join 같은 *_도넛
89
+ * 섹터_* segment. carrier 가 호 위를 따라 시작→끝 각도로 흐름.
90
+ *
91
+ * State shape (도넛 섹터):
92
+ * - cx, cy: 호 중심 (scene absolute 좌표)
93
+ * - rx, ry: 외측 반지름 (x/y 다름 = ellipse 호 가능)
94
+ * - ratio (0..100): 내측 반지름 비율 (innerRx = rx * ratio/100)
95
+ * - startAngle, endAngle: 시작/끝 각도 (radian, things-scene 컨벤션)
96
+ *
97
+ * 호 위 점 공식 (line 348 의 ConveyorJoin.controls 와 일치):
98
+ * P(θ) = (cx + r*sin(θ), cy - r*cos(θ))
99
+ * tangent (carrier 진행 방향) = (cos(θ), sin(θ))
100
+ *
101
+ * Anchor:
102
+ * - inbound at startAngle: midR 거리 + 진행 방향 (= θ 증가 방향)
103
+ * - outbound at endAngle: midR 거리 + 진행 방향
104
+ * - reverse 시 swap + direction 반전
105
+ */
106
+ export declare function arcSegmentTopology(state: {
107
+ cx?: number;
108
+ cy?: number;
109
+ rx?: number;
110
+ ry?: number;
111
+ ratio?: number;
112
+ startAngle?: number;
113
+ endAngle?: number;
114
+ status?: string;
115
+ }): SegmentTopology;
116
+ /**
117
+ * Multi-inbound straight segment — 합류 (merger) 의 토대. 흐름축은 그대로 (1
118
+ * outbound 한 면) 인데, *_나머지 모든 면이 inbound_* (= 어느 옆 conveyor 가
119
+ * 와도 합류 가능).
120
+ *
121
+ * - outbounds = straightSegmentTopology(state).outbounds (= 1 face)
122
+ * - inbounds = 직교 (흐름축 시작 + 양 perpendicular) + 측면 사선 (45° 전진 편향)
123
+ *
124
+ * 사선 anchor — 실물 merger 는 양쪽에서 *사선* 으로 모이는 Y자 합류가 통상.
125
+ * 측면 (흐름과 perpendicular) inbound 마다 본선 진행방향으로 45° 기운 anchor 를
126
+ * 추가 선언 — 회전시킨 일반 conveyor 가 비스듬히 닿으면 자동 연결 (새 컴포넌트
127
+ * 불요). 가로 본선 기준 top 면은 ↘, bottom 면은 ↗ 로 자연 분리돼 양쪽 사선
128
+ * 합류가 성립. 직교 anchor 보존 (직교 합류도 유효).
129
+ *
130
+ * Direction 검사 가 *_같은 방향만 매칭_* 보장 — 옆 conveyor 가 방향 일치
131
+ * (직교 또는 사선) 시에만 자동 매칭. 의도 안 한 합류 차단.
132
+ */
133
+ export declare function straightSegmentMultiInbound(state: {
134
+ left?: number;
135
+ top?: number;
136
+ width?: number;
137
+ height?: number;
138
+ rotation?: number;
139
+ orientation?: 'horizontal' | 'vertical' | '';
140
+ status?: string;
141
+ }): SegmentTopology;
142
+ /**
143
+ * 두 anchor 가 연결 가능한지 (= 자동 routing 후보). A 의 outbound 가 B 의
144
+ * inbound 와 *_위치 + 방향_* 일치하면 true.
145
+ *
146
+ * - 위치: distance <= tolerance.distance
147
+ * - 방향: outbound.direction · inbound.direction >= tolerance.cosine
148
+ * (둘 다 *_carrier 의 진행 방향_*이므로 같은 방향이어야 함)
149
+ */
150
+ export declare function anchorsConnect(out: Anchor2D, inn: Anchor2D, tolerance?: MatchTolerance): boolean;
151
+ /** 컴포넌트의 board footprint (rotation 포함). matchOutbounds 의 배달 판정용. */
152
+ export interface SegmentBounds {
153
+ left?: number;
154
+ top?: number;
155
+ width?: number;
156
+ height?: number;
157
+ rotation?: number;
158
+ }
159
+ /**
160
+ * 점 (px, pz) 가 회전된 사각 footprint 안인지 — margin 만큼 확장.
161
+ * board (x = left, z = top) 좌표계.
162
+ */
163
+ export declare function pointInRotatedRect(px: number, pz: number, b: SegmentBounds, margin?: number): boolean;
164
+ /**
165
+ * Ray-rectangle 절대값 거리 — chute 출구점을 통과하는 face normal 의 *_양방향 직선_*
166
+ * 과 사각형의 가장 가까운 교점까지 거리. 광선이 사각형 안에서 출발하면 (겹침) 가까운
167
+ * face 쪽 거리. 교차 없으면 Infinity.
168
+ *
169
+ * # 왜 이 metric 인가 (2026-06-17 사용자 통찰)
170
+ *
171
+ * 이전 matchOutbounds 의 ② 단계 tie-break = *_chute 출구점 ↔ stockpile center 의 유클리드
172
+ * 거리_*. 단점:
173
+ * - 큰 stockpile 의 center 가 *_chute face 와 평행하지만 멀게_* 측정됨
174
+ * - chute 가 *_정면으로_* 향한 stockpile 이 *_center 가 우연히 가까운_* 다른 sink 에 밀림
175
+ *
176
+ * 직교거리 (face normal 방향 ray cast) 가 *_물리적으로 자연_*:
177
+ * - "chute 가 정면으로 가까운 face" 가 정확히 측정됨
178
+ * - 큰 stockpile 의 긴 face 가 *_chute face 와 평행_* 일 때 hit 거리 짧음
179
+ * - 컴포넌트 center 위치와 무관 — center 왜곡 제거
180
+ *
181
+ * # 절대값 (양방향) 이유
182
+ * chute 출구점이 stockpile 영역 안 (겹침) 인 경우도 자연스럽게 처리. 정방향 hit 가 더 멀어도
183
+ * 역방향에 더 가까운 face 가 있으면 그 거리. 진행 방향 의존성 제거.
184
+ */
185
+ export declare function rayAbsDistanceToRect(origin: {
186
+ x: number;
187
+ z: number;
188
+ }, direction: {
189
+ x: number;
190
+ z: number;
191
+ }, rect: SegmentBounds): number;
192
+ /**
193
+ * source 배출 anchor 가 target footprint 로 *배달* 되는지 — anchor 끝-끝
194
+ * 매칭의 보완. 사용자가 컴포넌트를 (회전·겹침 포함) 손으로 놓아 배출 끝점이
195
+ * 상대 입구를 파고들어도 (= 겹침) 자동 연결되도록.
196
+ *
197
+ * - 끝점이 footprint 안 (+ margin) — 물리적으로 들이밀고 있음
198
+ * - 방향이 전진 호환 — candidateFlow (target 흐름) 와 dot ≥ 0 (역류 차단).
199
+ * flow 없으면 (sink) footprint 중심을 향하는지로 대체.
200
+ *
201
+ * 끝-끝 정밀 매칭 (anchorsConnect) 의 거리 tolerance(5) 가 hand-place 겹침
202
+ * (10~25 unit) 을 갭으로 거부하던 결함 보완 (2026-06-08 보고).
203
+ */
204
+ export declare function deliversInto(out: Anchor2D, bounds: SegmentBounds, candidateFlow?: {
205
+ x: number;
206
+ z: number;
207
+ }, margin?: number): boolean;
208
+ /**
209
+ * 자기 outbound 각각에 대해 *_연결 가능한 인근 segment_* 의 id 를 매칭.
210
+ *
211
+ * - candidates: scene 안 모든 segment (자기 자신 제외). 각 항목은
212
+ * { id, topology } — pure helper 라 component 객체가 아닌 추출 정보만.
213
+ * - 결과: outbound index → matched candidate id (또는 null). 자기 outbound
214
+ * 수 만큼.
215
+ *
216
+ * 매칭 우선순위:
217
+ * - 정확 일치 후보가 여럿이면 *_가장 가까운 worldPos_*.
218
+ * - 그래도 동률이면 id 사전순 (결정성).
219
+ */
220
+ export declare function matchOutbounds(selfTopology: SegmentTopology, candidates: ReadonlyArray<{
221
+ id: string;
222
+ topology: SegmentTopology;
223
+ bounds?: SegmentBounds;
224
+ }>, tolerance?: MatchTolerance): Array<string | null>;
225
+ //# sourceMappingURL=segment-topology.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segment-topology.d.ts","sourceRoot":"","sources":["../../src/flow/segment-topology.ts"],"names":[],"mappings":"AAgDA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,CAAA;AAE1B,gEAAgE;AAChE,MAAM,WAAW,QAAQ;IACvB,8EAA8E;IAC9E,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAClC,kDAAkD;IAClD,SAAS,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACnC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,wDAAwD;AACxD,MAAM,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E,aAAa,EAAE,MAAM,SAAI,GAAG,OAAO,CAehG;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EAChC,SAAS,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EACnC,IAAI,EAAE,aAAa,GAClB,MAAM,CAsDR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,aAAa,EACrB,aAAa,CAAC,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EACxC,MAAM,SAAI,GACT,OAAO,CAOT;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAC5B,YAAY,EAAE,eAAe,EAC7B,UAAU,EAAE,aAAa,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,eAAe,CAAC;IAAC,MAAM,CAAC,EAAE,aAAa,CAAA;CAAE,CAAC,EAC5F,SAAS,CAAC,EAAE,cAAc,GACzB,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CA4CtB"}
@@ -0,0 +1,23 @@
1
+ export interface StationHostCandidate {
2
+ id: string;
3
+ component: any;
4
+ distance: number;
5
+ }
6
+ /**
7
+ * StationHost 자격 duck — *_register_*_* 메서드 보유로 sorter 류만 매칭 (chute 처럼
8
+ * routingLinks 만 가진 노드는 제외).
9
+ */
10
+ export declare function isStationHost(c: any): boolean;
11
+ /**
12
+ * 가까운 StationHost 자동 발견 — root 트리를 walk 하며 StationHost 자격 노드 중 입구
13
+ * 거리 최소. 동률은 id lexical order — 결정론 보장. 미발견 시 null.
14
+ *
15
+ * @param entry chute/induct 의 입구 좌표 (board frame)
16
+ * @param root root component
17
+ * @param exclude self (자기 자신 제외)
18
+ */
19
+ export declare function findNearestStationHost(entry: {
20
+ x: number;
21
+ y: number;
22
+ }, root: any, exclude?: any): StationHostCandidate | null;
23
+ //# sourceMappingURL=station-host-inference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"station-host-inference.d.ts","sourceRoot":"","sources":["../../src/flow/station-host-inference.ts"],"names":[],"mappings":"AAqBA,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,GAAG,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;CACjB;AASD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,GAAG,GAAG,OAAO,CAO7C;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EAC/B,IAAI,EAAE,GAAG,EACT,OAAO,CAAC,EAAE,GAAG,GACZ,oBAAoB,GAAG,IAAI,CAmB7B"}
@@ -0,0 +1,10 @@
1
+ import type { ArrangementStrategy, SlotDef, Vec3 } from '../../transfer/types.js';
2
+ export declare class CenteringQueueStrategy implements ArrangementStrategy {
3
+ private readonly owner;
4
+ private readonly itemSpacing;
5
+ private readonly axis;
6
+ constructor(owner: any, itemSpacing?: number, axis?: 'horizontal' | 'vertical');
7
+ positionAt(index: number, slotDef: SlotDef, _occupantCount: number, component?: any): Vec3 | null;
8
+ capacity(slotDef: SlotDef): number;
9
+ }
10
+ //# sourceMappingURL=centering-queue-strategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"centering-queue-strategy.d.ts","sourceRoot":"","sources":["../../../src/items/arrangement/centering-queue-strategy.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAEjF,qBAAa,sBAAuB,YAAW,mBAAmB;IAE9D,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAFJ,KAAK,EAAE,GAAG,EACV,WAAW,SAAI,EACf,IAAI,GAAE,YAAY,GAAG,UAAyB;IAGjE,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI;IA0BjG,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM;CAGnC"}
@@ -0,0 +1,9 @@
1
+ import type { ArrangementStrategy, SlotDef, Vec3 } from '../../transfer/types.js';
2
+ export declare class GravityStrategy implements ArrangementStrategy {
3
+ /** Height of a single item; determines vertical stacking step (scene units). */
4
+ readonly itemHeight: number;
5
+ constructor(itemHeight?: number);
6
+ positionAt(index: number, slotDef: SlotDef, _occupantCount: number): Vec3 | null;
7
+ capacity(slotDef: SlotDef): number;
8
+ }
9
+ //# sourceMappingURL=gravity-strategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gravity-strategy.d.ts","sourceRoot":"","sources":["../../../src/items/arrangement/gravity-strategy.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAEjF,qBAAa,eAAgB,YAAW,mBAAmB;IACzD,gFAAgF;IAChF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;gBAEf,UAAU,SAAI;IAI1B,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAahF,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM;CAGnC"}