@simplysm/sd-cli 12.15.66 → 12.15.68
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/entry/SdCliAiCommand.js +40 -20
- package/package.json +5 -5
- package/src/entry/SdCliAiCommand.ts +43 -23
|
@@ -10,20 +10,30 @@ export class SdCliAiCommand {
|
|
|
10
10
|
await SdProcess.spawnAsync("git", ["add", "."]);
|
|
11
11
|
process.stdout.write(`컨텍스트 수집\n`);
|
|
12
12
|
const history = await SdProcess.spawnAsync("git", ["log", "-n", "3"]);
|
|
13
|
+
const stat = await SdProcess.spawnAsync("git", ["diff", "--staged", "--stat"]);
|
|
13
14
|
const diff = await SdProcess.spawnAsync("git", [
|
|
14
15
|
"diff",
|
|
15
|
-
"--no-textconv",
|
|
16
16
|
"--staged",
|
|
17
|
+
"--no-textconv",
|
|
17
18
|
"--find-renames",
|
|
19
|
+
"--find-copies",
|
|
18
20
|
"--diff-algorithm=histogram",
|
|
21
|
+
"--diff-filter=d",
|
|
19
22
|
"--",
|
|
20
23
|
".",
|
|
21
24
|
`:(exclude).*`,
|
|
22
25
|
`:(exclude)_*`,
|
|
23
26
|
`:(exclude)yarn.lock`,
|
|
27
|
+
`:(exclude)**/package.json`,
|
|
24
28
|
`:(exclude)packages/*/styles.css`,
|
|
25
|
-
`:(exclude)
|
|
26
|
-
|
|
29
|
+
`:(exclude)*.map`,
|
|
30
|
+
]);
|
|
31
|
+
// 삭제된 파일 목록만 따로
|
|
32
|
+
const deleted = await SdProcess.spawnAsync("git", [
|
|
33
|
+
"diff",
|
|
34
|
+
"--staged",
|
|
35
|
+
"--name-only",
|
|
36
|
+
"--diff-filter=D",
|
|
27
37
|
]);
|
|
28
38
|
if (StringUtils.isNullOrEmpty(diff.trim())) {
|
|
29
39
|
throw new Error("변경사항이 없습니다.");
|
|
@@ -36,25 +46,36 @@ export class SdCliAiCommand {
|
|
|
36
46
|
messages: [
|
|
37
47
|
{
|
|
38
48
|
role: "user",
|
|
39
|
-
content: `
|
|
40
|
-
|
|
49
|
+
content: `Git 변경사항을 분석하여 한국어 커밋 메시지를 생성해줘.
|
|
50
|
+
|
|
51
|
+
<format>
|
|
52
|
+
제목: 전체 변경을 아우르는 한 줄 요약 (50자 이내)
|
|
53
|
+
|
|
54
|
+
- [패키지명] 변경 내용 1
|
|
55
|
+
- [패키지명] 변경 내용 2
|
|
56
|
+
</format>
|
|
41
57
|
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
|
|
47
|
-
- 자세한 내용에는 모든 변경사항에 대한 설명이 누락 없이 표현되어야해
|
|
48
|
-
- 변경사항을 명확하고 간결하게 요약해야해
|
|
49
|
-
- 수동적인 표현 대신 능동적 표현을 사용해
|
|
50
|
-
- 가능하면 패키지별로 구분해서 표시되면 좋을것 같아. (여러패키지에 걸친 기능이면 어쩔 수 없고)
|
|
51
|
-
- 파일 하나하나 세부적으로 설명해줄 필요는 없어.
|
|
58
|
+
<rules>
|
|
59
|
+
- 능동태 사용 (예: "추가함", "수정함", "제거함")
|
|
60
|
+
- 파일 단위가 아닌 기능 단위로 설명
|
|
61
|
+
- 커밋 메시지만 출력 (부가 설명 없이)
|
|
62
|
+
</rules>
|
|
52
63
|
|
|
53
|
-
|
|
64
|
+
<history>
|
|
54
65
|
${history.trim()}
|
|
66
|
+
</history>
|
|
67
|
+
|
|
68
|
+
<stat>
|
|
69
|
+
${stat}
|
|
70
|
+
</stat>
|
|
71
|
+
|
|
72
|
+
<diff>
|
|
73
|
+
${diff}
|
|
74
|
+
</diff>
|
|
55
75
|
|
|
56
|
-
|
|
57
|
-
${
|
|
76
|
+
<deleted_files>
|
|
77
|
+
${deleted.trim() || "없음"}
|
|
78
|
+
</deleted_files>`,
|
|
58
79
|
},
|
|
59
80
|
],
|
|
60
81
|
});
|
|
@@ -64,8 +85,7 @@ ${diff}`,
|
|
|
64
85
|
process.stdout.write("\n\n-------------------------\n" +
|
|
65
86
|
message.content[0].text +
|
|
66
87
|
"\n-------------------------\n\n");
|
|
67
|
-
|
|
68
|
-
await SdProcess.spawnAsync("git", ["commit", "-m", commitMessage]);
|
|
88
|
+
await SdProcess.spawnAsync("git", ["commit", "-m", message.content[0].text]);
|
|
69
89
|
process.stdout.write("커밋이 완료되었습니다. 위 커밋메시지가 맘에들지 않을경우, 직접 커밋을 취소하세요.\n");
|
|
70
90
|
}
|
|
71
91
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysm/sd-cli",
|
|
3
|
-
"version": "12.15.
|
|
3
|
+
"version": "12.15.68",
|
|
4
4
|
"description": "심플리즘 패키지 - CLI",
|
|
5
5
|
"author": "김석래",
|
|
6
6
|
"repository": {
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"@angular/compiler-cli": "^20.3.15",
|
|
18
18
|
"@anthropic-ai/sdk": "^0.71.2",
|
|
19
19
|
"@electron/rebuild": "^4.0.2",
|
|
20
|
-
"@simplysm/sd-core-common": "12.15.
|
|
21
|
-
"@simplysm/sd-core-node": "12.15.
|
|
22
|
-
"@simplysm/sd-service-server": "12.15.
|
|
23
|
-
"@simplysm/sd-storage": "12.15.
|
|
20
|
+
"@simplysm/sd-core-common": "12.15.68",
|
|
21
|
+
"@simplysm/sd-core-node": "12.15.68",
|
|
22
|
+
"@simplysm/sd-service-server": "12.15.68",
|
|
23
|
+
"@simplysm/sd-storage": "12.15.68",
|
|
24
24
|
"browserslist": "^4.28.1",
|
|
25
25
|
"cordova": "^13.0.0",
|
|
26
26
|
"electron": "^33.4.11",
|
|
@@ -14,20 +14,31 @@ export class SdCliAiCommand {
|
|
|
14
14
|
process.stdout.write(`컨텍스트 수집\n`);
|
|
15
15
|
const history = await SdProcess.spawnAsync("git", ["log", "-n", "3"]);
|
|
16
16
|
|
|
17
|
+
const stat = await SdProcess.spawnAsync("git", ["diff", "--staged", "--stat"]);
|
|
17
18
|
const diff = await SdProcess.spawnAsync("git", [
|
|
18
19
|
"diff",
|
|
19
|
-
"--no-textconv",
|
|
20
20
|
"--staged",
|
|
21
|
+
"--no-textconv",
|
|
21
22
|
"--find-renames",
|
|
23
|
+
"--find-copies",
|
|
22
24
|
"--diff-algorithm=histogram",
|
|
25
|
+
"--diff-filter=d",
|
|
23
26
|
"--",
|
|
24
27
|
".",
|
|
25
28
|
`:(exclude).*`,
|
|
26
29
|
`:(exclude)_*`,
|
|
27
30
|
`:(exclude)yarn.lock`,
|
|
31
|
+
`:(exclude)**/package.json`,
|
|
28
32
|
`:(exclude)packages/*/styles.css`,
|
|
29
|
-
`:(exclude)
|
|
30
|
-
|
|
33
|
+
`:(exclude)*.map`,
|
|
34
|
+
]);
|
|
35
|
+
|
|
36
|
+
// 삭제된 파일 목록만 따로
|
|
37
|
+
const deleted = await SdProcess.spawnAsync("git", [
|
|
38
|
+
"diff",
|
|
39
|
+
"--staged",
|
|
40
|
+
"--name-only",
|
|
41
|
+
"--diff-filter=D",
|
|
31
42
|
]);
|
|
32
43
|
|
|
33
44
|
if (StringUtils.isNullOrEmpty(diff.trim())) {
|
|
@@ -43,25 +54,36 @@ export class SdCliAiCommand {
|
|
|
43
54
|
messages: [
|
|
44
55
|
{
|
|
45
56
|
role: "user",
|
|
46
|
-
content: `
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
content: `Git 변경사항을 분석하여 한국어 커밋 메시지를 생성해줘.
|
|
58
|
+
|
|
59
|
+
<format>
|
|
60
|
+
제목: 전체 변경을 아우르는 한 줄 요약 (50자 이내)
|
|
61
|
+
|
|
62
|
+
- [패키지명] 변경 내용 1
|
|
63
|
+
- [패키지명] 변경 내용 2
|
|
64
|
+
</format>
|
|
65
|
+
|
|
66
|
+
<rules>
|
|
67
|
+
- 능동태 사용 (예: "추가함", "수정함", "제거함")
|
|
68
|
+
- 파일 단위가 아닌 기능 단위로 설명
|
|
69
|
+
- 커밋 메시지만 출력 (부가 설명 없이)
|
|
70
|
+
</rules>
|
|
71
|
+
|
|
72
|
+
<history>
|
|
61
73
|
${history.trim()}
|
|
74
|
+
</history>
|
|
62
75
|
|
|
63
|
-
|
|
64
|
-
${
|
|
76
|
+
<stat>
|
|
77
|
+
${stat}
|
|
78
|
+
</stat>
|
|
79
|
+
|
|
80
|
+
<diff>
|
|
81
|
+
${diff}
|
|
82
|
+
</diff>
|
|
83
|
+
|
|
84
|
+
<deleted_files>
|
|
85
|
+
${deleted.trim() || "없음"}
|
|
86
|
+
</deleted_files>`,
|
|
65
87
|
},
|
|
66
88
|
],
|
|
67
89
|
});
|
|
@@ -75,9 +97,7 @@ ${diff}`,
|
|
|
75
97
|
"\n-------------------------\n\n",
|
|
76
98
|
);
|
|
77
99
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
await SdProcess.spawnAsync("git", ["commit", "-m", commitMessage]);
|
|
100
|
+
await SdProcess.spawnAsync("git", ["commit", "-m", message.content[0].text]);
|
|
81
101
|
process.stdout.write(
|
|
82
102
|
"커밋이 완료되었습니다. 위 커밋메시지가 맘에들지 않을경우, 직접 커밋을 취소하세요.\n",
|
|
83
103
|
);
|