@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/dist/nine-mu.js +26 -32
- package/dist/nine-mu.js.map +1 -1
- package/dist/nine-mu.umd.js +3 -3
- package/dist/nine-mu.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/NineChat.js +2 -1
- package/src/components/NotificationHandler.js +44 -20
package/package.json
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
}
|