ide-assi 0.161.0 → 0.163.0
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/bundle.cjs.js
CHANGED
|
@@ -193327,30 +193327,23 @@ class IdeUtils
|
|
|
193327
193327
|
|
|
193328
193328
|
static extractResponse = (response, gptServer) => {
|
|
193329
193329
|
|
|
193330
|
-
const
|
|
193331
|
-
//
|
|
193332
|
-
|
|
193333
|
-
|
|
193334
|
-
|
|
193335
|
-
// 혹시라도 마크다운 코드 블록 외에 순수 JSON 문자열만 남았다면 그 부분을 반환
|
|
193336
|
-
// (이전 로직에서 JSON 블록만 추출하는 부분은 이제 필요 없을 가능성이 높습니다,
|
|
193337
|
-
// `replace`에서 이미 다 제거되었기 때문입니다.)
|
|
193338
|
-
// 하지만, 안전을 위해 만약 JSON이 아닌 다른 텍스트가 남았을 때도 처리할 수 있도록
|
|
193339
|
-
// 원본 텍스트에서 ```으로 감싸진 부분을 모두 제거하는 방식으로 변경합니다.
|
|
193340
|
-
return cleanedText;
|
|
193330
|
+
const extractJsonSnippet = (text) => {
|
|
193331
|
+
//return text.replace(/```[\s\S]*?```/g, '').trim();
|
|
193332
|
+
const match = text.match(/```json([\s\S]*?)```/);
|
|
193333
|
+
return match ? match[1].trim() : text;
|
|
193341
193334
|
};
|
|
193342
193335
|
|
|
193343
193336
|
|
|
193344
193337
|
let r;
|
|
193345
193338
|
switch (gptServer) {
|
|
193346
193339
|
case "openai":
|
|
193347
|
-
r =
|
|
193340
|
+
r = extractJsonSnippet(response.content.trim());
|
|
193348
193341
|
break;
|
|
193349
193342
|
case "gemini":
|
|
193350
|
-
r =
|
|
193343
|
+
r = extractJsonSnippet(response.content.trim());
|
|
193351
193344
|
break;
|
|
193352
193345
|
case "ollama":
|
|
193353
|
-
r =
|
|
193346
|
+
r = extractJsonSnippet(response);
|
|
193354
193347
|
break;
|
|
193355
193348
|
}
|
|
193356
193349
|
|
|
@@ -193552,6 +193545,8 @@ class IdeAi
|
|
|
193552
193545
|
#what = async (userPrompt) => {
|
|
193553
193546
|
const o = await this.#invoke('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
|
|
193554
193547
|
|
|
193548
|
+
console.log(o);
|
|
193549
|
+
|
|
193555
193550
|
if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
|
|
193556
193551
|
if (o.result === "0") throw new Error(o.reason);
|
|
193557
193552
|
}
|
package/dist/bundle.esm.js
CHANGED
|
@@ -193323,30 +193323,23 @@ class IdeUtils
|
|
|
193323
193323
|
|
|
193324
193324
|
static extractResponse = (response, gptServer) => {
|
|
193325
193325
|
|
|
193326
|
-
const
|
|
193327
|
-
//
|
|
193328
|
-
|
|
193329
|
-
|
|
193330
|
-
|
|
193331
|
-
// 혹시라도 마크다운 코드 블록 외에 순수 JSON 문자열만 남았다면 그 부분을 반환
|
|
193332
|
-
// (이전 로직에서 JSON 블록만 추출하는 부분은 이제 필요 없을 가능성이 높습니다,
|
|
193333
|
-
// `replace`에서 이미 다 제거되었기 때문입니다.)
|
|
193334
|
-
// 하지만, 안전을 위해 만약 JSON이 아닌 다른 텍스트가 남았을 때도 처리할 수 있도록
|
|
193335
|
-
// 원본 텍스트에서 ```으로 감싸진 부분을 모두 제거하는 방식으로 변경합니다.
|
|
193336
|
-
return cleanedText;
|
|
193326
|
+
const extractJsonSnippet = (text) => {
|
|
193327
|
+
//return text.replace(/```[\s\S]*?```/g, '').trim();
|
|
193328
|
+
const match = text.match(/```json([\s\S]*?)```/);
|
|
193329
|
+
return match ? match[1].trim() : text;
|
|
193337
193330
|
};
|
|
193338
193331
|
|
|
193339
193332
|
|
|
193340
193333
|
let r;
|
|
193341
193334
|
switch (gptServer) {
|
|
193342
193335
|
case "openai":
|
|
193343
|
-
r =
|
|
193336
|
+
r = extractJsonSnippet(response.content.trim());
|
|
193344
193337
|
break;
|
|
193345
193338
|
case "gemini":
|
|
193346
|
-
r =
|
|
193339
|
+
r = extractJsonSnippet(response.content.trim());
|
|
193347
193340
|
break;
|
|
193348
193341
|
case "ollama":
|
|
193349
|
-
r =
|
|
193342
|
+
r = extractJsonSnippet(response);
|
|
193350
193343
|
break;
|
|
193351
193344
|
}
|
|
193352
193345
|
|
|
@@ -193548,6 +193541,8 @@ class IdeAi
|
|
|
193548
193541
|
#what = async (userPrompt) => {
|
|
193549
193542
|
const o = await this.#invoke('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
|
|
193550
193543
|
|
|
193544
|
+
console.log(o);
|
|
193545
|
+
|
|
193551
193546
|
if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
|
|
193552
193547
|
if (o.result === "0") throw new Error(o.reason);
|
|
193553
193548
|
}
|
package/dist/components/ideAi.js
CHANGED
|
@@ -196,6 +196,8 @@ export class IdeAi
|
|
|
196
196
|
#what = async (userPrompt) => {
|
|
197
197
|
const o = await this.#invoke('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
|
|
198
198
|
|
|
199
|
+
console.log(o);
|
|
200
|
+
|
|
199
201
|
if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
|
|
200
202
|
if (o.result === "0") throw new Error(o.reason);
|
|
201
203
|
}
|
|
@@ -40,13 +40,13 @@ export class IdeUtils
|
|
|
40
40
|
let r;
|
|
41
41
|
switch (gptServer) {
|
|
42
42
|
case "openai":
|
|
43
|
-
r =
|
|
43
|
+
r = extractJsonSnippet(response.content.trim());
|
|
44
44
|
break;
|
|
45
45
|
case "gemini":
|
|
46
|
-
r =
|
|
46
|
+
r = extractJsonSnippet(response.content.trim());
|
|
47
47
|
break;
|
|
48
48
|
case "ollama":
|
|
49
|
-
r =
|
|
49
|
+
r = extractJsonSnippet(response);
|
|
50
50
|
break;
|
|
51
51
|
default:
|
|
52
52
|
break;
|
package/package.json
CHANGED
package/src/components/ideAi.js
CHANGED
|
@@ -196,6 +196,8 @@ export class IdeAi
|
|
|
196
196
|
#what = async (userPrompt) => {
|
|
197
197
|
const o = await this.#invoke('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
|
|
198
198
|
|
|
199
|
+
console.log(o);
|
|
200
|
+
|
|
199
201
|
if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
|
|
200
202
|
if (o.result === "0") throw new Error(o.reason);
|
|
201
203
|
}
|
|
@@ -40,13 +40,13 @@ export class IdeUtils
|
|
|
40
40
|
let r;
|
|
41
41
|
switch (gptServer) {
|
|
42
42
|
case "openai":
|
|
43
|
-
r =
|
|
43
|
+
r = extractJsonSnippet(response.content.trim());
|
|
44
44
|
break;
|
|
45
45
|
case "gemini":
|
|
46
|
-
r =
|
|
46
|
+
r = extractJsonSnippet(response.content.trim());
|
|
47
47
|
break;
|
|
48
48
|
case "ollama":
|
|
49
|
-
r =
|
|
49
|
+
r = extractJsonSnippet(response);
|
|
50
50
|
break;
|
|
51
51
|
default:
|
|
52
52
|
break;
|