@nine-lab/nine-mu 0.1.280 → 0.1.281

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nine-lab/nine-mu",
3
- "version": "0.1.280",
3
+ "version": "0.1.281",
4
4
  "description": "AI-Driven Full-Stack Code Fabrication Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/nine-mu.umd.js",
@@ -3,6 +3,7 @@ import { api } from "@nine-lab/nine-util";
3
3
 
4
4
  export class NotificationHandler {
5
5
  #owner;
6
+ #collectedFiles = [];
6
7
 
7
8
  constructor(owner) {
8
9
  this.#owner = owner; // 웹 컴포넌트나 UI DOM 인스턴스
@@ -52,17 +53,53 @@ export class NotificationHandler {
52
53
  break;
53
54
 
54
55
  case "modify-source-brain":
56
+ if (data && data.source) {
57
+ this.#collectModifySource(data);
58
+ }
59
+ break;
60
+
61
+ case "modify-source-brain-completed":
55
62
  if (data && data.source) {
56
63
  //trace.log(`[시그널 감지] 설계 완료`, data);
57
- this.#modifySource(data);
64
+ this.#openDiffPopup();
58
65
  }
59
66
  break;
60
67
  }
61
-
62
68
  }
63
69
 
64
- #modifySource = async (data) => {
65
- console.log(data);
70
+ /**
71
+ * 레이어별로 순차 도착하는 파일들을 유실 없이 배열 버퍼에 수집
72
+ */
73
+ #collectModifySource = (data) => {
74
+ const filePayload = {
75
+ layer: data.layer || "Unknown",
76
+ full_path: data.full_path || "unknown_file",
77
+ asis_source: data.asis_source || "",
78
+ source: data.source || ""
79
+ };
80
+ this.#collectedFiles.push(filePayload);
81
+ };
82
+
83
+ /**
84
+ * 최종 조립이 끝나 시그널이 도달했을 때 딱 한 번 팝업을 열어 일괄 주입
85
+ */
86
+ #openDiffPopup = () => {
87
+ if (this.#collectedFiles.length === 0) return;
88
+
89
+ // DOM 상에 싱글톤 팝업 인스턴스 레이아웃 추출 및 빌드
90
+ let $popup = document.querySelector('nine-diff-popup');
91
+ if (!$popup) {
92
+ $popup = document.createElement('nine-diff-popup');
93
+ $popup.setAttribute('package-name', this.#owner.getAttribute('package-name') || '');
94
+ document.body.appendChild($popup);
95
+ }
96
+
97
+ // 팝업 내부 맵 저장소에 수집된 멀티 탭 소스 리스트 주입 및 모달 디스플레이
98
+ $popup.data([...this.#collectedFiles]);
99
+ $popup.popup();
100
+
101
+ // 다음 수정 세션을 대비하여 핸들러 내부 전역 버퍼 완전 초기화
102
+ this.#collectedFiles = [];
66
103
  };
67
104
 
68
105
  /**