ide-assi 0.694.0 → 0.698.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 +1 -2
- package/dist/bundle.esm.js +1 -2
- package/dist/components/ideUtils.js +1 -29
- package/package.json +1 -1
- package/src/components/ideUtils.js +1 -29
package/dist/bundle.cjs.js
CHANGED
|
@@ -202495,7 +202495,7 @@ class IdeUtils
|
|
|
202495
202495
|
template += await fetch(path).then(res => res.text());
|
|
202496
202496
|
}
|
|
202497
202497
|
|
|
202498
|
-
|
|
202498
|
+
console.log(template);
|
|
202499
202499
|
|
|
202500
202500
|
return await new PromptTemplate({
|
|
202501
202501
|
template,
|
|
@@ -202511,7 +202511,6 @@ class IdeUtils
|
|
|
202511
202511
|
return match ? match[1].trim() : text;
|
|
202512
202512
|
};
|
|
202513
202513
|
|
|
202514
|
-
|
|
202515
202514
|
let r;
|
|
202516
202515
|
switch (gptServer) {
|
|
202517
202516
|
case "chatopenai":
|
package/dist/bundle.esm.js
CHANGED
|
@@ -202491,7 +202491,7 @@ class IdeUtils
|
|
|
202491
202491
|
template += await fetch(path).then(res => res.text());
|
|
202492
202492
|
}
|
|
202493
202493
|
|
|
202494
|
-
|
|
202494
|
+
console.log(template);
|
|
202495
202495
|
|
|
202496
202496
|
return await new PromptTemplate({
|
|
202497
202497
|
template,
|
|
@@ -202507,7 +202507,6 @@ class IdeUtils
|
|
|
202507
202507
|
return match ? match[1].trim() : text;
|
|
202508
202508
|
};
|
|
202509
202509
|
|
|
202510
|
-
|
|
202511
202510
|
let r;
|
|
202512
202511
|
switch (gptServer) {
|
|
202513
202512
|
case "chatopenai":
|
|
@@ -17,7 +17,7 @@ export class IdeUtils
|
|
|
17
17
|
template += await fetch(path).then(res => res.text());
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
console.log(template);
|
|
21
21
|
|
|
22
22
|
return await new PromptTemplate({
|
|
23
23
|
template,
|
|
@@ -27,40 +27,12 @@ export class IdeUtils
|
|
|
27
27
|
|
|
28
28
|
static extractResponse = (response, gptServer) => {
|
|
29
29
|
|
|
30
|
-
const extractJsonSnippet1 = (text) => {
|
|
31
|
-
|
|
32
|
-
//return text.replace(/```[\s\S]*?```/g, '').trim();
|
|
33
|
-
//const match = text.match(/```json([\s\S]*?)```/);
|
|
34
|
-
//return match ? match[1].trim() : text;
|
|
35
|
-
let match = text.match(/```json([\s\S]*?)```/);
|
|
36
|
-
if (!match) match = text.match(/```jsx([\s\S]*?)```/);
|
|
37
|
-
if (!match) match = text.match(/```xml([\s\S]*?)```/);
|
|
38
|
-
if (!match) match = text.match(/```java([\s\S]*?)```/);
|
|
39
|
-
|
|
40
|
-
return match ? match[1].trim() : text;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
30
|
const extractCodeSnippet = (text) => {
|
|
44
31
|
const pattern = /```(?:json|jsx|xml|java)([\s\S]*?)```/;
|
|
45
32
|
const match = text.match(pattern);
|
|
46
33
|
return match ? match[1].trim() : text;
|
|
47
34
|
};
|
|
48
35
|
|
|
49
|
-
|
|
50
|
-
const extractSnippet = (text) => {
|
|
51
|
-
// 모든 종류의 마크다운 코드 블록 (```언어명 ... ```)을 제거
|
|
52
|
-
// 언어명 없는 순수 ``` 블록도 포함
|
|
53
|
-
const cleanedText = text.replace(/```(?:json|jsx|[\s\S]*?)?\s*([\s\S]*?)```/g, '').trim();
|
|
54
|
-
|
|
55
|
-
// 혹시라도 마크다운 코드 블록 외에 순수 JSON 문자열만 남았다면 그 부분을 반환
|
|
56
|
-
// (이전 로직에서 JSON 블록만 추출하는 부분은 이제 필요 없을 가능성이 높습니다,
|
|
57
|
-
// `replace`에서 이미 다 제거되었기 때문입니다.)
|
|
58
|
-
// 하지만, 안전을 위해 만약 JSON이 아닌 다른 텍스트가 남았을 때도 처리할 수 있도록
|
|
59
|
-
// 원본 텍스트에서 ```으로 감싸진 부분을 모두 제거하는 방식으로 변경합니다.
|
|
60
|
-
return cleanedText;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
|
|
64
36
|
let r;
|
|
65
37
|
switch (gptServer) {
|
|
66
38
|
case "chatopenai":
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ export class IdeUtils
|
|
|
17
17
|
template += await fetch(path).then(res => res.text());
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
console.log(template);
|
|
21
21
|
|
|
22
22
|
return await new PromptTemplate({
|
|
23
23
|
template,
|
|
@@ -27,40 +27,12 @@ export class IdeUtils
|
|
|
27
27
|
|
|
28
28
|
static extractResponse = (response, gptServer) => {
|
|
29
29
|
|
|
30
|
-
const extractJsonSnippet1 = (text) => {
|
|
31
|
-
|
|
32
|
-
//return text.replace(/```[\s\S]*?```/g, '').trim();
|
|
33
|
-
//const match = text.match(/```json([\s\S]*?)```/);
|
|
34
|
-
//return match ? match[1].trim() : text;
|
|
35
|
-
let match = text.match(/```json([\s\S]*?)```/);
|
|
36
|
-
if (!match) match = text.match(/```jsx([\s\S]*?)```/);
|
|
37
|
-
if (!match) match = text.match(/```xml([\s\S]*?)```/);
|
|
38
|
-
if (!match) match = text.match(/```java([\s\S]*?)```/);
|
|
39
|
-
|
|
40
|
-
return match ? match[1].trim() : text;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
30
|
const extractCodeSnippet = (text) => {
|
|
44
31
|
const pattern = /```(?:json|jsx|xml|java)([\s\S]*?)```/;
|
|
45
32
|
const match = text.match(pattern);
|
|
46
33
|
return match ? match[1].trim() : text;
|
|
47
34
|
};
|
|
48
35
|
|
|
49
|
-
|
|
50
|
-
const extractSnippet = (text) => {
|
|
51
|
-
// 모든 종류의 마크다운 코드 블록 (```언어명 ... ```)을 제거
|
|
52
|
-
// 언어명 없는 순수 ``` 블록도 포함
|
|
53
|
-
const cleanedText = text.replace(/```(?:json|jsx|[\s\S]*?)?\s*([\s\S]*?)```/g, '').trim();
|
|
54
|
-
|
|
55
|
-
// 혹시라도 마크다운 코드 블록 외에 순수 JSON 문자열만 남았다면 그 부분을 반환
|
|
56
|
-
// (이전 로직에서 JSON 블록만 추출하는 부분은 이제 필요 없을 가능성이 높습니다,
|
|
57
|
-
// `replace`에서 이미 다 제거되었기 때문입니다.)
|
|
58
|
-
// 하지만, 안전을 위해 만약 JSON이 아닌 다른 텍스트가 남았을 때도 처리할 수 있도록
|
|
59
|
-
// 원본 텍스트에서 ```으로 감싸진 부분을 모두 제거하는 방식으로 변경합니다.
|
|
60
|
-
return cleanedText;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
|
|
64
36
|
let r;
|
|
65
37
|
switch (gptServer) {
|
|
66
38
|
case "chatopenai":
|