@g1cloud/bpmn-modeler-next 5.0.0-alpha.99 → 5.0.0-beta.2

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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  - **패키지**: `@g1cloud/bpmn-modeler-next`
6
6
  - **스택**: TypeScript · Vue 3 · Vite(library mode) · Vitest 4(browser mode) · 캔버스 = **bpmn-js 18 래핑**
7
- - **상태**: `5.0.0-alpha.1` (활발한 개발 중)
7
+ - **상태**: beta (`5.0.0-beta.*`)
8
8
 
9
9
  ---
10
10
 
@@ -94,7 +94,9 @@ import {
94
94
  createHeadlessBpmnModeler, // 에디터 없는 하강용 modeler (Node + jsdom)
95
95
  APPLY_BPMN_OPS_SCHEMA, // applyOps 도구 input_schema (op 어휘의 JSON Schema 단일 출처)
96
96
  SYMBOLIC_OP_KINDS, // op 종류 17
97
- MVP_FLOW_NODE_TYPES, // MVP 노드 타입 9
97
+ IR_FLOW_NODE_TYPES, // describe 가 내는 노드 타입 12 (read)
98
+ ADDABLE_FLOW_NODE_TYPES, // op 로 만들 수 있는 노드 타입 10 (write · read 의 부분집합)
99
+ IR_EVENT_DEFINITIONS, // 이벤트 정의 — 'timer' (intermediateCatchEvent 전용)
98
100
  BWL_SIDES, // 주석 방위 8
99
101
  } from '@g1cloud/bpmn-modeler-next'
100
102
  ```
@@ -7,7 +7,11 @@ export interface IrOmission {
7
7
  /** bpmn $type 원형 (예: `bpmn:BoundaryEvent`) */
8
8
  type: string;
9
9
  reason:
10
- /** IR 타입 집합 밖 (intermediate 이벤트·dataObject 등 — 승격 시 자동 해소) */
10
+ /**
11
+ * IR 타입 집합 밖 (intermediateThrowEvent·dataObject 등 — 승격 시 자동 해소). 🔴 **어휘 밖 변형도
12
+ * 여기다** — `intermediateCatchEvent` 는 timer 만 표현하므로 message·signal·정의 없음·다중 정의는
13
+ * 타입이 집합 안이어도 이 사유로 나간다(B-87 ⓑ 부분 · 판정 = 타입 + eventDefinition).
14
+ */
11
15
  'type-outside-mvp'
12
16
  /**
13
17
  * 승격된 컨테이너(subProcess) **내부**라 표현하지 않음 (B-87 ⓐ = 불투명 승격).
@@ -1,4 +1,5 @@
1
1
  import { default as ElementRegistry } from 'diagram-js/lib/core/ElementRegistry';
2
+ import { IrEventDefinition } from '../../core/ir';
2
3
  /** 검증이 구분하는 요소 카테고리 — bpmn $type 을 참조 적합성 판단 단위로 접는다. */
3
4
  export type ElementCategory = 'participant' | 'lane' | 'flowNode' | 'sequenceFlow' | 'messageFlow' | 'dataStore' | 'dataAssociation' | 'annotation' | 'association' | 'group' | 'other';
4
5
  export interface DocumentIndex {
@@ -19,6 +20,12 @@ export interface DocumentIndex {
19
20
  source?: string;
20
21
  target?: string;
21
22
  } | undefined;
23
+ /**
24
+ * 플로우 노드의 IR 이벤트 정의 (B-87 ⓑ 부분) — 문서의 **기존** 타이머 catch 이벤트를 메시지 끝점으로
25
+ * 지목하는 op 를 거부하려면 정의를 알아야 한다(배치 노드는 op 선언으로 안다). 이벤트가 아니거나
26
+ * 어휘 밖 정의면 undefined.
27
+ */
28
+ eventDefinitionOf(nodeId: string): IrEventDefinition | undefined;
22
29
  }
23
30
  /** elementRegistry 어댑터 — 하강 직전 실문서 상태를 대변한다. */
24
31
  export declare function buildRegistryIndex(registry: ElementRegistry): DocumentIndex;
@@ -114,6 +114,31 @@ export type ResolveIssue =
114
114
  id: string;
115
115
  type: string;
116
116
  }
117
+ /**
118
+ * `type` 과 `eventDefinition` 의 짝이 어긋남 (B-87 ⓑ 부분 · 2026-09-30) — `intermediateCatchEvent` 인데
119
+ * 정의가 없거나, 다른 타입에 정의를 줬다. 🔴 **앞쪽이 더 위험하다** — 정의 없는 중간 catch 이벤트는 read 가
120
+ * 표현하지 않는 변형이라, 만들면 **다음 describe 에서 그 노드와 붙은 간선이 사라진다**(`type-outside-mvp`
121
+ * · `endpoint-outside-mvp`). `node.update` 는 같은 op 안에서 type 과 함께 줄 때만 받는다.
122
+ */
123
+ | {
124
+ kind: 'event-definition-mismatch';
125
+ opIndex: number;
126
+ id: string;
127
+ type?: string;
128
+ eventDefinition?: string;
129
+ }
130
+ /**
131
+ * 메시지 플로우의 끝점이 **타이머 catch 이벤트** (B-87 ⓑ 부분). 타이머는 시간이 지나야 진행하는 대기라
132
+ * 메시지를 주고받지 않는다 — bpmn-js 규칙(`canConnectMessageFlow`)도 거부하는 형상이고, resolver 는
133
+ * `modeling.connect` 로 규칙을 거치지 않으므로 여기서 막지 않으면 **무효 BPMN 이 그대로 저장된다**.
134
+ * 메시지를 기다리는 자리는 `receiveTask` 로 그린다(playbook §3.5-1b-1).
135
+ */
136
+ | {
137
+ kind: 'message-flow-timer-endpoint';
138
+ opIndex: number;
139
+ id: string;
140
+ ref: string;
141
+ }
117
142
  /** lanes 재선언이 기존 레인을 누락 — 레인 축소는 미실증 축(B-0)이라 거부 (세션 ②-b 판단) */
118
143
  | {
119
144
  kind: 'lane-shrink-unsupported';
@@ -127,6 +152,21 @@ export type ResolveIssue =
127
152
  opIndex: number;
128
153
  participant: string;
129
154
  }
155
+ /**
156
+ * `node.update{type}` 전환이 **다른 요소를 지웠다** — 배치 전체를 롤백하고 거부한다 (B-128 · 2026-09-30).
157
+ * bpmn-js 는 새 타입이 못 가지는 연결(게이트웨이·종료 이벤트의 메시지 · 시작 이벤트의 시퀀스 유입 · 타이머의 메시지)과
158
+ * 붙은 경계 이벤트를 **알림 없이 지운다** — 막지 않으면 `ok: true` 인 채 문서가 잘려 나간다. `dropped` 가 지워질 뻔한
159
+ * 요소 id 다. 교정 = 그 연결을 먼저 옮기거나(재배선), 지워야 한다면 사람 승인을 받아 `element.remove` 로 명시하거나,
160
+ * 그것을 가질 수 있는 타입을 고른다. ⚠ validator 가 아니라 **하강에서** 낸다 — bpmn-js 규칙을 옮겨 적지 않고
161
+ * 실제로 지운 것을 대조하기 때문이다.
162
+ */
163
+ | {
164
+ kind: 'type-change-drops-elements';
165
+ opIndex: number;
166
+ id: string;
167
+ type: string;
168
+ dropped: string[];
169
+ }
130
170
  /** 하강 실행 중 실패 — 실행분은 롤백됨(원자성 2차 방어) */
131
171
  | {
132
172
  kind: 'lower-failed';
@@ -9,6 +9,7 @@ import { default as BpmnReplace } from 'bpmn-js/lib/features/replace/BpmnReplace
9
9
  import { default as SpaceTool } from 'diagram-js/lib/features/space-tool/SpaceTool';
10
10
  import { Shape } from 'bpmn-js/lib/model/Types';
11
11
  import { SymbolicOp } from '../symbolicOp';
12
+ import { ResolveIssue } from './issues';
12
13
  import { BwlSide } from '../../core/hints';
13
14
  import { GeometryFinding, GeometryScene } from '../geometryAudit';
14
15
  /** resolver 가 대면하는 bpmn-js 서비스 표면 — 하강은 이 묶음만 사용한다. */
@@ -61,6 +62,14 @@ export declare function annotationSpot(elementRegistry: ElementRegistry, anchor:
61
62
  x: number;
62
63
  y: number;
63
64
  };
65
+ /**
66
+ * 하강 중에야 드러나는 거부를 **구조화된 issue 로** 올린다 — `applyBpmnOps` 가 자유 문장 `lower-failed` 대신
67
+ * 이 issue 를 그대로 낸다(LLM 교정 루프가 읽을 수 있게). 롤백은 다른 throw 와 같다(undo 에피소드가 되감는다).
68
+ */
69
+ export declare class LowerIssueError extends Error {
70
+ readonly issue: ResolveIssue;
71
+ constructor(issue: ResolveIssue);
72
+ }
64
73
  /** 검증 통과가 전제 — 참조 해소 실패는 여기서 프로그래밍 오류로 throw 되고 applyBpmnOps 가 롤백한다. */
65
74
  export declare function lowerOps(ops: readonly SymbolicOp[], services: ResolverServices): void;
66
75
  /** 주석 도형이 소유자로 등장할 수 있는 finding 의 소유 도형 id. */
@@ -300,8 +300,11 @@ export declare function planLabelBesideOwnLine(edge: GeometryEdge, scene: Geomet
300
300
  * — 공유 구간 검사 + 미끄럼 후보를 더한 판도 이득 0) · base 에서 이미 표류한 라벨(선 기하가 안 바뀌어 이 가지에 안 온다).
301
301
  */
302
302
  export declare function followMovedEdgeLabels(services: Pick<ResolverServices, 'elementRegistry' | 'modeling'>, before: ReadonlyMap<string, EdgeLabelSnapshot>): void;
303
- /** 이 배치가 **새로 만든** 간선의 라벨을 선·경계선에서 뗀다(맨 마지막 — 라벨 귀속 보정 뒤). 선재 라벨은 불가침. */
304
- export declare function repairIntroducedLabelLines(services: Pick<ResolverServices, 'elementRegistry' | 'modeling'>, beforeEdgeIds: ReadonlySet<string>): void;
303
+ /**
304
+ * 이 배치가 **새로 만든** 간선의 라벨을 선·경계선에서 뗀다(맨 마지막 — 라벨 귀속 보정 뒤). 선재 라벨은 불가침 —
305
+ * 단 `reroutedEdgeIds`(이 배치가 끝점을 바꿔 경로를 다시 깐 선재 간선)는 대상이다(B-114 ⓔ ⓑ).
306
+ */
307
+ export declare function repairIntroducedLabelLines(services: Pick<ResolverServices, 'elementRegistry' | 'modeling'>, beforeEdgeIds: ReadonlySet<string>, reroutedEdgeIds?: ReadonlySet<string>): void;
305
308
  /**
306
309
  * 이 배치가 **새로 만든** 간선의 라벨 귀속 문제를 고친다(하강 직후, undo 에피소드 안, 경로 보정들 뒤).
307
310
  * 선재 간선의 라벨은 사람이 놓았을 수 있어 손대지 않는다(안전 성질 2).
@@ -1,5 +1,5 @@
1
1
  import { BwlAfterColumn, BwlBand, BwlPlacement, BwlPoolOrder } from '../core/hints';
2
- import { IrAssociation, IrDataAssociation, IrDataStore, AddableFlowNodeType, IrFlowCondition, IrGroup, IrLane, IrMessageFlow, IrNode, IrParticipant, IrSequenceFlow, IrTextAnnotation } from '../core/ir';
2
+ import { IrAssociation, IrDataAssociation, IrDataStore, AddableFlowNodeType, IrEventDefinition, IrFlowCondition, IrGroup, IrLane, IrMessageFlow, IrNode, IrParticipant, IrSequenceFlow, IrTextAnnotation } from '../core/ir';
3
3
  /** LLM 이 산출하는 단일 심볼릭 op. `kind` 로 판별한다. */
4
4
  export type SymbolicOp =
5
5
  /** 풀 추가. `order` = 풀 세로 순서 힌트(생략 시 op 순서가 곧 배치 순서). */
@@ -61,13 +61,15 @@ export type SymbolicOp =
61
61
  }
62
62
  /** `lane` = 레인 재배정(이동). `type` = 태스크/이벤트 타입 전환(bpmn-js replace 하강 — 외래 확장 속성 유실 가능성은 불변식 2 가 완충). */
63
63
  /** 노드 갱신. `band` = 기존 노드의 행 재지정(B-72 ⓐ 승격) — 기존 컨테이너에서 band 는 **행 identity** 다. */
64
- /** ⚠ `type` 은 **만들 수 있는 집합**으로 좁다 — read 집합(11)이 아니다(B-87 ⓐ). 타입이 0차 방어다. */
64
+ /** ⚠ `type` 은 **만들 수 있는 집합**으로 좁다 — read 집합이 아니다(B-87 ⓐ). 타입이 0차 방어다. */
65
+ /** `eventDefinition` = `type: 'intermediateCatchEvent'` 로 전환할 때 **함께 필수**다(`node.add` 의 `node.eventDefinition` 과 같은 짝 규칙). */
65
66
  | {
66
67
  kind: 'node.update';
67
68
  id: string;
68
69
  name?: string | null;
69
70
  lane?: string;
70
71
  type?: AddableFlowNodeType;
72
+ eventDefinition?: IrEventDefinition;
71
73
  band?: BwlBand;
72
74
  }
73
75
  /**