@g1cloud/bpmn-modeler-next 5.0.0-beta.66 → 5.0.0-beta.68

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.
@@ -44,6 +44,11 @@ export type ApplyBatchOutcome =
44
44
  findings: GeometryFinding[];
45
45
  /** 간선 교차 계측(B-14 ⓐ) — 문서 전체, 하강 전/후. finding 이 아니다. */
46
46
  stats: ApplyBpmnOpsResult['stats'];
47
+ /**
48
+ * 이 배치가 bpmn-js 에 **무작위로 만들게 한 id** — 생성 순서 그대로(`recordGeneratedIds` 옵션일 때만).
49
+ * 열린 에디터의 턴 끝 재실행(G4 B′ · `replayAgentTurn`)이 같은 순서로 받아 써야 산출이 바이트로 같아진다.
50
+ */
51
+ generatedIds?: string[];
47
52
  } | {
48
53
  status: 'conflict';
49
54
  baseVersion: number;
@@ -60,6 +65,11 @@ export interface ApplyBpmnOpBatchOptions {
60
65
  * 로 문서 언어 전부를 받고, 없으면 평문만 받는다(`applyBpmnOps` 의 같은 옵션).
61
66
  */
62
67
  i18n?: BpmnDocumentLocales;
68
+ /**
69
+ * 생성 id 를 순서대로 기록해 `applied.generatedIds` 로 낸다(G4 B′) — 생성 자체는 바꾸지 않는다(관찰만).
70
+ * 서버 집행 코어가 GUI 채팅 턴의 배치에 켠다. 기본 끔(응답 형태 종전 그대로).
71
+ */
72
+ recordGeneratedIds?: boolean;
63
73
  }
64
74
  /**
65
75
  * 배치를 캔버스에 적용하고 영속 페이로드를 낸다.
@@ -70,4 +80,4 @@ export interface ApplyBpmnOpBatchOptions {
70
80
  * 적용은 단일 undo 에피소드다(`applyBpmnOps` → `command/undoEpisode`) — 배치 수십 op 가
71
81
  * 사용자 undo 1회로 되감긴다.
72
82
  */
73
- export declare function applyBpmnOpBatch(modeler: BpmnDocumentModelerLike, batch: BpmnOpBatch, { currentVersion, i18n }: ApplyBpmnOpBatchOptions): Promise<ApplyBatchOutcome>;
83
+ export declare function applyBpmnOpBatch(modeler: BpmnDocumentModelerLike, batch: BpmnOpBatch, { currentVersion, i18n, recordGeneratedIds: record }: ApplyBpmnOpBatchOptions): Promise<ApplyBatchOutcome>;
@@ -0,0 +1,36 @@
1
+ import { BpmnDocumentModelerLike } from '../core/modelerLike';
2
+ import { BpmnDocumentLocales } from '../adapter/i18n';
3
+ import { SymbolicOp } from './symbolicOp';
4
+ /** 턴의 배치 하나 — 서버가 커밋한 순서대로. `generatedIds` = 서버 `applied.generatedIds`(`recordGeneratedIds`). */
5
+ export interface BpmnReplayBatch {
6
+ ops: SymbolicOp[];
7
+ generatedIds: string[];
8
+ }
9
+ /**
10
+ * 재실행 결과. `diverged` 면 문서는 **재실행 전 상태로 되감겨 있다** — 호스트는 서버 XML 로 reload 한다.
11
+ * - `unsupported` — 이 modeler 에 헤드리스 동등 실행 환경이 없다(`HeadlessReplayModule` 미탑재) · 배치가 없다
12
+ * - `rejected` — 배치가 검증 · 하강에서 거부됐다(서버에서는 통과한 배치다 — 시작 상태가 이미 달랐다)
13
+ * - `ids` — 생성 id 를 다 못 받아 썼다 · 남았다(하강 경로가 서버와 갈렸다)
14
+ * - `xml` — 끝까지 갔지만 바이트가 다르다
15
+ * - `error` — 예외
16
+ * `ms` = 재실행 소요(비교 포함) — 폴백률 · 비용 관측용(결정 §7).
17
+ */
18
+ export type ReplayAgentTurnOutcome = {
19
+ status: 'replayed';
20
+ ms: number;
21
+ } | {
22
+ status: 'diverged';
23
+ reason: 'unsupported' | 'rejected' | 'ids' | 'xml' | 'error';
24
+ /** 사람이 읽을 단서(거부 issue 요약 · 예외 문장 · id 수). */
25
+ detail?: string;
26
+ ms: number;
27
+ };
28
+ export interface ReplayAgentTurnOptions {
29
+ /** 서버가 이 턴 마지막 배치로 커밋한 XML — 판정 기준. */
30
+ expectedXml: string;
31
+ /** 그룹 문서 언어(B-4 ④) — 서버와 같은 값이어야 같은 검증 · 하강을 탄다. */
32
+ i18n?: BpmnDocumentLocales;
33
+ }
34
+ export declare function replayAgentTurn(modeler: BpmnDocumentModelerLike & {
35
+ get<T>(name: string, strict?: boolean): T;
36
+ }, batches: readonly BpmnReplayBatch[], { expectedXml, i18n }: ReplayAgentTurnOptions): Promise<ReplayAgentTurnOutcome>;
@@ -0,0 +1,18 @@
1
+ import { BpmnModelerLike } from '../core/modelerLike';
2
+ /** `run` 동안 생성된 id 를 순서대로 모은다 — 생성 자체는 바꾸지 않는다(관찰만). */
3
+ export declare function recordGeneratedIds<T>(modeler: BpmnModelerLike, run: () => T): {
4
+ value: T;
5
+ generatedIds: string[];
6
+ };
7
+ /**
8
+ * `run` 동안 생성을 `generatedIds` 순서로 대신한다. 다음 id 가 없거나 · 접두가 다르거나 · 이미 쓰인 id 면
9
+ * **무작위 생성으로 떨어지고 `missed` 를 센다** — 하강을 멈추지 않는다(판정은 호출자가 바이트 비교로 한다).
10
+ *
11
+ * @returns `fed` = 주입한 수 · `missed` = 떨어진 수 · `remaining` = 쓰지 않고 남은 수(셋 다 0 · 0 · 0 이 아니면 갈렸다)
12
+ */
13
+ export declare function feedGeneratedIds<T>(modeler: BpmnModelerLike, generatedIds: readonly string[], run: () => T): {
14
+ value: T;
15
+ fed: number;
16
+ missed: number;
17
+ remaining: number;
18
+ };