@nine-lab/nine-mu 0.1.324 β†’ 0.1.325

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.324",
3
+ "version": "0.1.325",
4
4
  "description": "AI-Driven Full-Stack Code Fabrication Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/nine-mu.umd.js",
@@ -125,6 +125,7 @@ export class NineChat extends HTMLElement {
125
125
 
126
126
  const asis = await this.#manager.getRoutes();
127
127
 
128
+ /**
128
129
  if (parsed?.selected_tool === "generator-menu") {
129
130
  const hasCreated = parsed?.data.some(item => item.action === 'CREATE');
130
131
  const hasUpdated = parsed?.data.some(item => item.action === 'UPDATE');
@@ -140,7 +141,7 @@ export class NineChat extends HTMLElement {
140
141
  this.#showDiff(asis, tobe, "json");
141
142
  });
142
143
  }
143
- }
144
+ } */
144
145
 
145
146
  // πŸ’‘ λ§Œμ•½ intentκ°€ EXECUTE_TOOLμ΄κ±°λ‚˜ NAVIGATE일 λ•Œ ν”„λ‘ νŠΈμ—μ„œ
146
147
  // ν™”λ©΄ 이동(Routing)μ΄λ‚˜ μΆ”κ°€ μ•‘μ…˜μ„ ν•΄μ•Ό ν•œλ‹€λ©΄ μ—¬κΈ°μ„œ parsedData.target_path 등을 ν™œμš©ν•˜λ©΄ λ©λ‹ˆλ‹€!
@@ -36,31 +36,39 @@ export class NotificationHandler {
36
36
  // 2. 🚨 [λ‚˜μ€‘μ— 100μ‹œκ°„μ§œλ¦¬ 완벽을 μ±„μšΈ 핡심 κΈΈλͺ©]
37
37
  // 데이터에 μ†ŒμŠ€μ½”λ“œ μ•Œλ§Ήμ΄(data.source)λ‚˜ 메타데이터가 μ‹€λ € 내렀왔을 λ•Œμ˜ ν–‰μœ„λ₯Ό μ—¬κΈ°μ„œ 격리 μ²˜λ¦¬ν•©λ‹ˆλ‹€.
38
38
 
39
+ /**
39
40
  switch (logger) {
40
41
  case "generate-source-brain":
41
- //if (data && data.source) {
42
- //trace.log(`[μ‹œκ·Έλ„ 감지] 섀계 μ™„λ£Œ`, data);
43
- this.#generateSource(data);
44
- //}
42
+ this.#generateSource(data);
45
43
  break;
46
44
 
47
45
  case "modify-source-brain":
48
- if (data && data.source) {
49
- this.#collectModifySource(data);
50
- }
46
+ this.#collectModifySource(data);
51
47
  break;
52
48
 
53
49
  case "modify-source-brain-completed":
54
- //trace.log(`[μ‹œκ·Έλ„ 감지] 섀계 μ™„λ£Œ`, data);
55
50
  this.#openDiffPopup();
56
51
  break;
57
- }
52
+ } */
53
+
54
+ // μžλ°”μ˜ -> 처럼 μžλ°”μŠ€ν¬λ¦½νŠΈμ˜ => (ν™”μ‚΄ν‘œ ν•¨μˆ˜)λ₯Ό ν™œμš©ν•œ λ§€ν•‘
55
+ const runAction = {
56
+ "generate-menu-completed": () => this.#generateMenu(data),
57
+ "generate-source-brain": () => this.#generateSource(data),
58
+ "modify-source-brain": () => this.#collectModifySource(data),
59
+ "modify-source-brain-completed": () => this.#openDiffPopup(),
60
+ }[logger];
61
+
62
+ runAction?.();
58
63
  }
59
64
 
60
65
  /**
61
66
  * λ ˆμ΄μ–΄λ³„λ‘œ 순차 λ„μ°©ν•˜λŠ” νŒŒμΌλ“€μ„ μœ μ‹€ 없이 λ°°μ—΄ 버퍼에 μˆ˜μ§‘
62
67
  */
63
68
  #collectModifySource = (data) => {
69
+
70
+ if (!data || !data.source) return;
71
+
64
72
  const filePayload = {
65
73
  layer: data.layer || "Unknown",
66
74
  full_path: data.full_path || "unknown_file",
@@ -104,23 +112,39 @@ export class NotificationHandler {
104
112
  */
105
113
  #generateSource = async (data) => {
106
114
 
107
- trace.log(data);
108
-
109
- return;
110
-
111
- // μ†ŒμŠ€μ½”λ“œ 데이터가 μ •μƒμ μœΌλ‘œ ν™•λ³΄λ˜μ—ˆλŠ”μ§€ 1%의 λˆ„λ½ 검증
112
- if (data.layer) {
113
- //trace.warn("⚠️ μ†ŒμŠ€ λ˜λŠ” 파일λͺ… λˆ„λ½ 데이터 μˆ˜μ‹ λ¨", data);
114
- //return;
115
- }
115
+ if (!data.path || !data.source) return;
116
116
 
117
117
  const res = await api.post("/nine-mu/source/generateRealFileSingle", {
118
118
  //package_path: data.path,
119
119
  //file_name: data.file_name,
120
- currentPath: location.pathname,
120
+ currentPath: data.path,
121
121
  contents: data.source
122
122
  });
123
123
 
124
- trace.log(res)
124
+ trace.log(res);
125
+ }
126
+
127
+ #generateMenu = async (data) => {
128
+
129
+ //if (!data.path || !data.source) return;
130
+
131
+ trace.log(data);
132
+ /**
133
+ if (parsed?.selected_tool === "generator-menu") {
134
+ const hasCreated = parsed?.data.some(item => item.action === 'CREATE');
135
+ const hasUpdated = parsed?.data.some(item => item.action === 'UPDATE');
136
+ const hasDeleted = parsed?.data.some(item => item.action === 'DELETE');
137
+
138
+ if (hasUpdated || hasCreated || hasDeleted) {
139
+ // μ§„μ§œ 메뉴λͺ… λ³€κ²½μ΄λ‚˜ μ΄λ™λ§Œ μš”μ²­ν•œ 경우
140
+ nine.alert("메뉴 정리λ₯Ό μœ„ν•œ λΌμš°ν„° 정보 μ €μž₯ ν™”λ©΄μœΌλ‘œ μ΄λ™ν•©λ‹ˆλ‹€.").then(res => {
141
+ const tobe = (parsed?.data || [])
142
+ .filter(item => item.action !== 'DELETE')
143
+ .map(({ isNew, action, ...rest }) => rest);
144
+
145
+ this.#showDiff(asis, tobe, "json");
146
+ });
147
+ }
148
+ } */
125
149
  }
126
150
  }