ide-assi 0.695.0 → 0.699.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.
@@ -202488,15 +202488,12 @@ class IdeUtils
202488
202488
 
202489
202489
  if (!Array.isArray(paths)) paths = [paths];
202490
202490
 
202491
- let template = "";//await fetch(path).then(res => res.text());
202491
+ let template = "";
202492
202492
 
202493
202493
  for (let path of paths) {
202494
- //console.log(path);
202495
202494
  template += await fetch(path).then(res => res.text());
202496
202495
  }
202497
202496
 
202498
- //console.log(template);
202499
-
202500
202497
  return await new PromptTemplate({
202501
202498
  template,
202502
202499
  inputVariables: Object.keys(params),
@@ -202511,7 +202508,6 @@ class IdeUtils
202511
202508
  return match ? match[1].trim() : text;
202512
202509
  };
202513
202510
 
202514
-
202515
202511
  let r;
202516
202512
  switch (gptServer) {
202517
202513
  case "chatopenai":
@@ -202719,6 +202715,7 @@ class IdeAi
202719
202715
  #invoke = async (path, params) => {
202720
202716
 
202721
202717
  const prompt = await IdeUtils.generatePrompt(path, params);
202718
+ console.log(prompt);
202722
202719
 
202723
202720
  try {
202724
202721
  const response = await this.#model.invoke([
@@ -202484,15 +202484,12 @@ class IdeUtils
202484
202484
 
202485
202485
  if (!Array.isArray(paths)) paths = [paths];
202486
202486
 
202487
- let template = "";//await fetch(path).then(res => res.text());
202487
+ let template = "";
202488
202488
 
202489
202489
  for (let path of paths) {
202490
- //console.log(path);
202491
202490
  template += await fetch(path).then(res => res.text());
202492
202491
  }
202493
202492
 
202494
- //console.log(template);
202495
-
202496
202493
  return await new PromptTemplate({
202497
202494
  template,
202498
202495
  inputVariables: Object.keys(params),
@@ -202507,7 +202504,6 @@ class IdeUtils
202507
202504
  return match ? match[1].trim() : text;
202508
202505
  };
202509
202506
 
202510
-
202511
202507
  let r;
202512
202508
  switch (gptServer) {
202513
202509
  case "chatopenai":
@@ -202715,6 +202711,7 @@ class IdeAi
202715
202711
  #invoke = async (path, params) => {
202716
202712
 
202717
202713
  const prompt = await IdeUtils.generatePrompt(path, params);
202714
+ console.log(prompt);
202718
202715
 
202719
202716
  try {
202720
202717
  const response = await this.#model.invoke([
@@ -189,6 +189,7 @@ export class IdeAi
189
189
  #invoke = async (path, params) => {
190
190
 
191
191
  const prompt = await IdeUtils.generatePrompt(path, params);
192
+ console.log(prompt);
192
193
 
193
194
  try {
194
195
  const response = await this.#model.invoke([
@@ -10,15 +10,12 @@ export class IdeUtils
10
10
 
11
11
  if (!Array.isArray(paths)) paths = [paths];
12
12
 
13
- let template = "";//await fetch(path).then(res => res.text());
13
+ let template = "";
14
14
 
15
15
  for (let path of paths) {
16
- //console.log(path);
17
16
  template += await fetch(path).then(res => res.text());
18
17
  }
19
18
 
20
- //console.log(template);
21
-
22
19
  return await new PromptTemplate({
23
20
  template,
24
21
  inputVariables: Object.keys(params),
@@ -27,40 +24,12 @@ export class IdeUtils
27
24
 
28
25
  static extractResponse = (response, gptServer) => {
29
26
 
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
27
  const extractCodeSnippet = (text) => {
44
28
  const pattern = /```(?:json|jsx|xml|java)([\s\S]*?)```/;
45
29
  const match = text.match(pattern);
46
30
  return match ? match[1].trim() : text;
47
31
  };
48
32
 
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
33
  let r;
65
34
  switch (gptServer) {
66
35
  case "chatopenai":
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.695.0",
4
+ "version": "0.699.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -189,6 +189,7 @@ export class IdeAi
189
189
  #invoke = async (path, params) => {
190
190
 
191
191
  const prompt = await IdeUtils.generatePrompt(path, params);
192
+ console.log(prompt);
192
193
 
193
194
  try {
194
195
  const response = await this.#model.invoke([
@@ -10,15 +10,12 @@ export class IdeUtils
10
10
 
11
11
  if (!Array.isArray(paths)) paths = [paths];
12
12
 
13
- let template = "";//await fetch(path).then(res => res.text());
13
+ let template = "";
14
14
 
15
15
  for (let path of paths) {
16
- //console.log(path);
17
16
  template += await fetch(path).then(res => res.text());
18
17
  }
19
18
 
20
- //console.log(template);
21
-
22
19
  return await new PromptTemplate({
23
20
  template,
24
21
  inputVariables: Object.keys(params),
@@ -27,40 +24,12 @@ export class IdeUtils
27
24
 
28
25
  static extractResponse = (response, gptServer) => {
29
26
 
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
27
  const extractCodeSnippet = (text) => {
44
28
  const pattern = /```(?:json|jsx|xml|java)([\s\S]*?)```/;
45
29
  const match = text.match(pattern);
46
30
  return match ? match[1].trim() : text;
47
31
  };
48
32
 
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
33
  let r;
65
34
  switch (gptServer) {
66
35
  case "chatopenai":