relayax-cli 0.4.17 → 0.4.18
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/commands/install.js +21 -35
- package/dist/commands/publish.js +16 -12
- package/dist/mcp/server.js +9 -11
- package/package.json +1 -1
package/dist/commands/install.js
CHANGED
|
@@ -240,47 +240,33 @@ function registerInstall(program) {
|
|
|
240
240
|
process.exit(1);
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
// 3. Download package
|
|
243
|
+
// 3. Download package via git clone
|
|
244
244
|
const requestedVersion = versionMatch ? versionMatch[2] : undefined;
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
(
|
|
249
|
-
const gitUrl = (0, git_operations_js_1.buildGitUrl)(resolvedAgent.git_url, { code: _opts.code });
|
|
250
|
-
await (0, storage_js_1.clonePackage)(gitUrl, agentDir, requestedVersion);
|
|
251
|
-
usedGit = true;
|
|
245
|
+
if (!resolvedAgent.git_url) {
|
|
246
|
+
const errMsg = '이 에이전트는 재publish가 필요합니다. 빌더에게 문의하세요.';
|
|
247
|
+
if (json) {
|
|
248
|
+
console.log(JSON.stringify({ error: 'NO_GIT_URL', message: errMsg }));
|
|
252
249
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
if (!json) {
|
|
256
|
-
console.error(`\x1b[33m⚠ git clone 실패, tar.gz로 설치합니다: ${gitMsg}\x1b[0m`);
|
|
257
|
-
}
|
|
250
|
+
else {
|
|
251
|
+
console.error(`\x1b[31m✖ ${errMsg}\x1b[0m`);
|
|
258
252
|
}
|
|
253
|
+
process.exit(1);
|
|
259
254
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
255
|
+
(0, git_operations_js_1.checkGitInstalled)();
|
|
256
|
+
const gitUrl = (0, git_operations_js_1.buildGitUrl)(resolvedAgent.git_url, { code: _opts.code });
|
|
257
|
+
await (0, storage_js_1.clonePackage)(gitUrl, agentDir, requestedVersion);
|
|
258
|
+
// Verify clone has actual files (not just .git)
|
|
259
|
+
const clonedEntries = fs_1.default.readdirSync(agentDir).filter((f) => f !== '.git');
|
|
260
|
+
if (clonedEntries.length === 0) {
|
|
261
|
+
fs_1.default.rmSync(agentDir, { recursive: true, force: true });
|
|
262
|
+
const errMsg = '에이전트 패키지가 비어있습니다. 빌더에게 재publish를 요청하세요.';
|
|
263
|
+
if (json) {
|
|
264
|
+
console.log(JSON.stringify({ error: 'EMPTY_PACKAGE', message: errMsg }));
|
|
265
265
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
if (dlMsg.includes('403') || dlMsg.includes('expired')) {
|
|
269
|
-
if (!json) {
|
|
270
|
-
console.error('\x1b[33m⚙ 다운로드 URL 만료, 재시도 중...\x1b[0m');
|
|
271
|
-
}
|
|
272
|
-
resolvedAgent = await (0, api_js_1.fetchAgentInfo)(slug);
|
|
273
|
-
tarPath = await (0, storage_js_1.downloadPackage)(resolvedAgent.package_url, tempDir);
|
|
274
|
-
}
|
|
275
|
-
else {
|
|
276
|
-
throw dlErr;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
if (fs_1.default.existsSync(agentDir)) {
|
|
280
|
-
fs_1.default.rmSync(agentDir, { recursive: true, force: true });
|
|
266
|
+
else {
|
|
267
|
+
console.error(`\x1b[31m✖ ${errMsg}\x1b[0m`);
|
|
281
268
|
}
|
|
282
|
-
|
|
283
|
-
await (0, storage_js_1.extractPackage)(tarPath, agentDir);
|
|
269
|
+
process.exit(1);
|
|
284
270
|
}
|
|
285
271
|
// 4.5. Inject preamble (update check) into SKILL.md and commands
|
|
286
272
|
(0, preamble_js_1.injectPreambleToAgent)(agentDir, slug);
|
package/dist/commands/publish.js
CHANGED
|
@@ -746,13 +746,13 @@ function registerPublish(program) {
|
|
|
746
746
|
console.error(`업로드 중...`);
|
|
747
747
|
}
|
|
748
748
|
const result = await publishToApi(token, tarPath, metadata);
|
|
749
|
-
// Git push: commit and push to git server (
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
if (
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
749
|
+
// Git push: commit and push to git server (required)
|
|
750
|
+
const gitUrl = result.git_url;
|
|
751
|
+
if (gitUrl) {
|
|
752
|
+
if (!json) {
|
|
753
|
+
console.error('git 저장소에 푸시 중...');
|
|
754
|
+
}
|
|
755
|
+
try {
|
|
756
756
|
const isFirstPublish = !result.is_update;
|
|
757
757
|
if (isFirstPublish) {
|
|
758
758
|
await (0, git_operations_js_1.gitPublishInit)(relayDir, gitUrl, config.version);
|
|
@@ -761,12 +761,16 @@ function registerPublish(program) {
|
|
|
761
761
|
await (0, git_operations_js_1.gitPublishUpdate)(relayDir, gitUrl, config.version);
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
|
-
|
|
765
|
-
catch (gitPushErr) {
|
|
766
|
-
// Git push failure is non-fatal — tar.gz upload already succeeded
|
|
767
|
-
if (!json) {
|
|
764
|
+
catch (gitPushErr) {
|
|
768
765
|
const gpMsg = gitPushErr instanceof Error ? gitPushErr.message : String(gitPushErr);
|
|
769
|
-
|
|
766
|
+
if (json) {
|
|
767
|
+
console.log(JSON.stringify({ error: 'GIT_PUSH_FAILED', message: `git push 실패: ${gpMsg}` }));
|
|
768
|
+
}
|
|
769
|
+
else {
|
|
770
|
+
console.error(`\x1b[31m✖ git push 실패: ${gpMsg}\x1b[0m`);
|
|
771
|
+
console.error('\x1b[33m 재시도하려면 relay publish를 다시 실행하세요.\x1b[0m');
|
|
772
|
+
}
|
|
773
|
+
process.exit(1);
|
|
770
774
|
}
|
|
771
775
|
}
|
|
772
776
|
// Update entry command preamble with scoped slug from server (non-fatal)
|
package/dist/mcp/server.js
CHANGED
|
@@ -126,18 +126,16 @@ function createMcpServer() {
|
|
|
126
126
|
const tempDir = (0, storage_js_1.makeTempDir)();
|
|
127
127
|
try {
|
|
128
128
|
const agentDir = path_1.default.join(projectPath, '.relay', 'agents', parsed.owner, parsed.name);
|
|
129
|
-
if (agent.git_url) {
|
|
130
|
-
|
|
131
|
-
(0, git_operations_js_1.checkGitInstalled)();
|
|
132
|
-
await (0, storage_js_1.clonePackage)(agent.git_url, agentDir);
|
|
129
|
+
if (!agent.git_url) {
|
|
130
|
+
return { content: [jsonText({ error: 'NO_GIT_URL', message: '이 에이전트는 재publish가 필요합니다. 빌더에게 문의하세요.' })], isError: true };
|
|
133
131
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
fs_1.default.
|
|
140
|
-
|
|
132
|
+
(0, git_operations_js_1.checkGitInstalled)();
|
|
133
|
+
await (0, storage_js_1.clonePackage)(agent.git_url, agentDir);
|
|
134
|
+
// Verify clone has actual files
|
|
135
|
+
const clonedEntries = fs_1.default.readdirSync(agentDir).filter((f) => f !== '.git');
|
|
136
|
+
if (clonedEntries.length === 0) {
|
|
137
|
+
fs_1.default.rmSync(agentDir, { recursive: true, force: true });
|
|
138
|
+
return { content: [jsonText({ error: 'EMPTY_PACKAGE', message: '에이전트 패키지가 비어있습니다. 빌더에게 재publish를 요청하세요.' })], isError: true };
|
|
141
139
|
}
|
|
142
140
|
(0, preamble_js_1.injectPreambleToAgent)(agentDir, fullSlug);
|
|
143
141
|
const installed = (0, config_js_1.loadInstalled)();
|