makecc 0.2.8 → 0.2.11
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/client/assets/{index-C2Yw-VLu.js → index-lpZin4sA.js} +45 -45
- package/dist/client/index.html +1 -1
- package/dist/server/index.js +13 -1
- package/dist/server/services/skillGeneratorService.js +21 -8
- package/dist/server/services/workflowAIService.js +21 -16
- package/package.json +1 -1
- package/server/index.ts +13 -1
- package/server/services/skillGeneratorService.ts +24 -8
- package/server/services/workflowAIService.ts +24 -16
package/dist/client/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>vite-temp</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-lpZin4sA.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-v9IFpWkA.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/dist/server/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import 'dotenv
|
|
1
|
+
import dotenv from 'dotenv';
|
|
2
2
|
import express from 'express';
|
|
3
3
|
import { createServer } from 'http';
|
|
4
4
|
import { Server } from 'socket.io';
|
|
@@ -6,6 +6,18 @@ import cors from 'cors';
|
|
|
6
6
|
import { join, dirname } from 'path';
|
|
7
7
|
import { fileURLToPath } from 'url';
|
|
8
8
|
import { existsSync, promises as fs } from 'fs';
|
|
9
|
+
// 프로젝트 경로의 .env 파일을 명시적으로 로드
|
|
10
|
+
// npx makecc 실행 시 MAKECC_PROJECT_PATH가 사용자 프로젝트 경로를 가리킴
|
|
11
|
+
const projectPath = process.env.MAKECC_PROJECT_PATH || process.cwd();
|
|
12
|
+
const envPath = join(projectPath, '.env');
|
|
13
|
+
if (existsSync(envPath)) {
|
|
14
|
+
dotenv.config({ path: envPath });
|
|
15
|
+
console.log(`Loaded .env from: ${envPath}`);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
// 폴백: 현재 디렉토리에서 로드 시도
|
|
19
|
+
dotenv.config();
|
|
20
|
+
}
|
|
9
21
|
import { ClaudeService } from './services/claudeService';
|
|
10
22
|
import { fileService } from './services/fileService';
|
|
11
23
|
import { workflowAIService } from './services/workflowAIService';
|
|
@@ -66,20 +66,33 @@ export class SkillGeneratorService {
|
|
|
66
66
|
this.projectRoot = projectRoot || process.env.MAKECC_PROJECT_PATH || process.cwd();
|
|
67
67
|
}
|
|
68
68
|
getClient(settings) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (settings?.
|
|
69
|
+
const DEFAULT_ANTHROPIC_URL = 'https://api.anthropic.com';
|
|
70
|
+
// 1. 프록시 우선: proxyUrl이 설정되어 있고, 기본 Anthropic URL이 아닌 경우
|
|
71
|
+
// 프록시 서버가 API 키를 관리하므로 클라이언트는 키 불필요
|
|
72
|
+
if (settings?.proxyUrl && settings.proxyUrl !== DEFAULT_ANTHROPIC_URL) {
|
|
73
|
+
console.log(`Using proxy server: ${settings.proxyUrl}`);
|
|
73
74
|
return new Anthropic({
|
|
74
75
|
baseURL: settings.proxyUrl,
|
|
75
|
-
apiKey:
|
|
76
|
+
apiKey: 'proxy-mode', // 프록시 서버가 실제 키를 관리
|
|
76
77
|
});
|
|
77
78
|
}
|
|
79
|
+
// 2. 환경변수에 API 키가 있으면 직접 호출
|
|
78
80
|
const envApiKey = process.env.ANTHROPIC_API_KEY;
|
|
79
|
-
if (
|
|
80
|
-
|
|
81
|
+
if (envApiKey) {
|
|
82
|
+
console.log('Using API key from environment variable');
|
|
83
|
+
return new Anthropic({ apiKey: envApiKey });
|
|
84
|
+
}
|
|
85
|
+
// 3. UI에서 direct 모드로 API 키를 직접 입력한 경우
|
|
86
|
+
if (settings?.apiMode === 'direct' && settings.apiKey) {
|
|
87
|
+
console.log('Using API key from UI settings');
|
|
88
|
+
return new Anthropic({ apiKey: settings.apiKey });
|
|
81
89
|
}
|
|
82
|
-
|
|
90
|
+
// 4. 아무것도 없으면 에러
|
|
91
|
+
throw new Error('API 키가 설정되지 않았습니다.\n' +
|
|
92
|
+
'해결 방법:\n' +
|
|
93
|
+
'1. 프록시 서버 URL을 설정하거나\n' +
|
|
94
|
+
'2. 프로젝트 .env 파일에 ANTHROPIC_API_KEY를 추가하거나\n' +
|
|
95
|
+
'3. 설정에서 Direct 모드로 API 키를 직접 입력하세요.');
|
|
83
96
|
}
|
|
84
97
|
async generate(prompt, settings, onProgress) {
|
|
85
98
|
const progress = onProgress || (() => { });
|
|
@@ -124,28 +124,33 @@ ${AVAILABLE_TOOLS.join(', ')}
|
|
|
124
124
|
`;
|
|
125
125
|
export class WorkflowAIService {
|
|
126
126
|
getClient(settings) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
// 2. Proxy mode with custom base URL
|
|
134
|
-
if (settings?.apiMode === 'proxy' && settings.proxyUrl) {
|
|
127
|
+
const DEFAULT_ANTHROPIC_URL = 'https://api.anthropic.com';
|
|
128
|
+
// 1. 프록시 우선: proxyUrl이 설정되어 있고, 기본 Anthropic URL이 아닌 경우
|
|
129
|
+
// 프록시 서버가 API 키를 관리하므로 클라이언트는 키 불필요
|
|
130
|
+
if (settings?.proxyUrl && settings.proxyUrl !== DEFAULT_ANTHROPIC_URL) {
|
|
131
|
+
console.log(`Using proxy server: ${settings.proxyUrl}`);
|
|
135
132
|
return new Anthropic({
|
|
136
133
|
baseURL: settings.proxyUrl,
|
|
137
|
-
//
|
|
138
|
-
apiKey: process.env.ANTHROPIC_API_KEY || 'proxy-mode',
|
|
134
|
+
apiKey: 'proxy-mode', // 프록시 서버가 실제 키를 관리
|
|
139
135
|
});
|
|
140
136
|
}
|
|
141
|
-
//
|
|
137
|
+
// 2. 환경변수에 API 키가 있으면 직접 호출
|
|
142
138
|
const envApiKey = process.env.ANTHROPIC_API_KEY;
|
|
143
|
-
if (
|
|
144
|
-
|
|
139
|
+
if (envApiKey) {
|
|
140
|
+
console.log('Using API key from environment variable');
|
|
141
|
+
return new Anthropic({ apiKey: envApiKey });
|
|
145
142
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
143
|
+
// 3. UI에서 direct 모드로 API 키를 직접 입력한 경우
|
|
144
|
+
if (settings?.apiMode === 'direct' && settings.apiKey) {
|
|
145
|
+
console.log('Using API key from UI settings');
|
|
146
|
+
return new Anthropic({ apiKey: settings.apiKey });
|
|
147
|
+
}
|
|
148
|
+
// 4. 아무것도 없으면 에러
|
|
149
|
+
throw new Error('API 키가 설정되지 않았습니다.\n' +
|
|
150
|
+
'해결 방법:\n' +
|
|
151
|
+
'1. 프록시 서버 URL을 설정하거나\n' +
|
|
152
|
+
'2. 프로젝트 .env 파일에 ANTHROPIC_API_KEY를 추가하거나\n' +
|
|
153
|
+
'3. 설정에서 Direct 모드로 API 키를 직접 입력하세요.');
|
|
149
154
|
}
|
|
150
155
|
async generate(prompt, settings) {
|
|
151
156
|
const client = this.getClient(settings);
|
package/package.json
CHANGED
package/server/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import 'dotenv
|
|
1
|
+
import dotenv from 'dotenv';
|
|
2
2
|
import express from 'express';
|
|
3
3
|
import { createServer } from 'http';
|
|
4
4
|
import { Server } from 'socket.io';
|
|
@@ -6,6 +6,18 @@ import cors from 'cors';
|
|
|
6
6
|
import { join, dirname } from 'path';
|
|
7
7
|
import { fileURLToPath } from 'url';
|
|
8
8
|
import { existsSync, promises as fs } from 'fs';
|
|
9
|
+
|
|
10
|
+
// 프로젝트 경로의 .env 파일을 명시적으로 로드
|
|
11
|
+
// npx makecc 실행 시 MAKECC_PROJECT_PATH가 사용자 프로젝트 경로를 가리킴
|
|
12
|
+
const projectPath = process.env.MAKECC_PROJECT_PATH || process.cwd();
|
|
13
|
+
const envPath = join(projectPath, '.env');
|
|
14
|
+
if (existsSync(envPath)) {
|
|
15
|
+
dotenv.config({ path: envPath });
|
|
16
|
+
console.log(`Loaded .env from: ${envPath}`);
|
|
17
|
+
} else {
|
|
18
|
+
// 폴백: 현재 디렉토리에서 로드 시도
|
|
19
|
+
dotenv.config();
|
|
20
|
+
}
|
|
9
21
|
import { ClaudeService } from './services/claudeService';
|
|
10
22
|
import { fileService } from './services/fileService';
|
|
11
23
|
import { workflowAIService } from './services/workflowAIService';
|
|
@@ -107,23 +107,39 @@ export class SkillGeneratorService {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
private getClient(settings?: ApiSettings): Anthropic {
|
|
110
|
-
|
|
111
|
-
return new Anthropic({ apiKey: settings.apiKey });
|
|
112
|
-
}
|
|
110
|
+
const DEFAULT_ANTHROPIC_URL = 'https://api.anthropic.com';
|
|
113
111
|
|
|
114
|
-
|
|
112
|
+
// 1. 프록시 우선: proxyUrl이 설정되어 있고, 기본 Anthropic URL이 아닌 경우
|
|
113
|
+
// 프록시 서버가 API 키를 관리하므로 클라이언트는 키 불필요
|
|
114
|
+
if (settings?.proxyUrl && settings.proxyUrl !== DEFAULT_ANTHROPIC_URL) {
|
|
115
|
+
console.log(`Using proxy server: ${settings.proxyUrl}`);
|
|
115
116
|
return new Anthropic({
|
|
116
117
|
baseURL: settings.proxyUrl,
|
|
117
|
-
apiKey:
|
|
118
|
+
apiKey: 'proxy-mode', // 프록시 서버가 실제 키를 관리
|
|
118
119
|
});
|
|
119
120
|
}
|
|
120
121
|
|
|
122
|
+
// 2. 환경변수에 API 키가 있으면 직접 호출
|
|
121
123
|
const envApiKey = process.env.ANTHROPIC_API_KEY;
|
|
122
|
-
if (
|
|
123
|
-
|
|
124
|
+
if (envApiKey) {
|
|
125
|
+
console.log('Using API key from environment variable');
|
|
126
|
+
return new Anthropic({ apiKey: envApiKey });
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// 3. UI에서 direct 모드로 API 키를 직접 입력한 경우
|
|
130
|
+
if (settings?.apiMode === 'direct' && settings.apiKey) {
|
|
131
|
+
console.log('Using API key from UI settings');
|
|
132
|
+
return new Anthropic({ apiKey: settings.apiKey });
|
|
124
133
|
}
|
|
125
134
|
|
|
126
|
-
|
|
135
|
+
// 4. 아무것도 없으면 에러
|
|
136
|
+
throw new Error(
|
|
137
|
+
'API 키가 설정되지 않았습니다.\n' +
|
|
138
|
+
'해결 방법:\n' +
|
|
139
|
+
'1. 프록시 서버 URL을 설정하거나\n' +
|
|
140
|
+
'2. 프로젝트 .env 파일에 ANTHROPIC_API_KEY를 추가하거나\n' +
|
|
141
|
+
'3. 설정에서 Direct 모드로 API 키를 직접 입력하세요.'
|
|
142
|
+
);
|
|
127
143
|
}
|
|
128
144
|
|
|
129
145
|
async generate(
|
|
@@ -165,31 +165,39 @@ ${AVAILABLE_TOOLS.join(', ')}
|
|
|
165
165
|
|
|
166
166
|
export class WorkflowAIService {
|
|
167
167
|
private getClient(settings?: ApiSettings): Anthropic {
|
|
168
|
-
|
|
169
|
-
if (settings?.apiMode === 'direct' && settings.apiKey) {
|
|
170
|
-
return new Anthropic({
|
|
171
|
-
apiKey: settings.apiKey,
|
|
172
|
-
});
|
|
173
|
-
}
|
|
168
|
+
const DEFAULT_ANTHROPIC_URL = 'https://api.anthropic.com';
|
|
174
169
|
|
|
175
|
-
//
|
|
176
|
-
|
|
170
|
+
// 1. 프록시 우선: proxyUrl이 설정되어 있고, 기본 Anthropic URL이 아닌 경우
|
|
171
|
+
// 프록시 서버가 API 키를 관리하므로 클라이언트는 키 불필요
|
|
172
|
+
if (settings?.proxyUrl && settings.proxyUrl !== DEFAULT_ANTHROPIC_URL) {
|
|
173
|
+
console.log(`Using proxy server: ${settings.proxyUrl}`);
|
|
177
174
|
return new Anthropic({
|
|
178
175
|
baseURL: settings.proxyUrl,
|
|
179
|
-
//
|
|
180
|
-
apiKey: process.env.ANTHROPIC_API_KEY || 'proxy-mode',
|
|
176
|
+
apiKey: 'proxy-mode', // 프록시 서버가 실제 키를 관리
|
|
181
177
|
});
|
|
182
178
|
}
|
|
183
179
|
|
|
184
|
-
//
|
|
180
|
+
// 2. 환경변수에 API 키가 있으면 직접 호출
|
|
185
181
|
const envApiKey = process.env.ANTHROPIC_API_KEY;
|
|
186
|
-
if (
|
|
187
|
-
|
|
182
|
+
if (envApiKey) {
|
|
183
|
+
console.log('Using API key from environment variable');
|
|
184
|
+
return new Anthropic({ apiKey: envApiKey });
|
|
188
185
|
}
|
|
189
186
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
187
|
+
// 3. UI에서 direct 모드로 API 키를 직접 입력한 경우
|
|
188
|
+
if (settings?.apiMode === 'direct' && settings.apiKey) {
|
|
189
|
+
console.log('Using API key from UI settings');
|
|
190
|
+
return new Anthropic({ apiKey: settings.apiKey });
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// 4. 아무것도 없으면 에러
|
|
194
|
+
throw new Error(
|
|
195
|
+
'API 키가 설정되지 않았습니다.\n' +
|
|
196
|
+
'해결 방법:\n' +
|
|
197
|
+
'1. 프록시 서버 URL을 설정하거나\n' +
|
|
198
|
+
'2. 프로젝트 .env 파일에 ANTHROPIC_API_KEY를 추가하거나\n' +
|
|
199
|
+
'3. 설정에서 Direct 모드로 API 키를 직접 입력하세요.'
|
|
200
|
+
);
|
|
193
201
|
}
|
|
194
202
|
|
|
195
203
|
async generate(prompt: string, settings?: ApiSettings): Promise<AIWorkflowResult> {
|