relayax-cli 0.3.63 → 0.3.65

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/lib/api.js CHANGED
@@ -24,7 +24,11 @@ async function fetchMyOrgs() {
24
24
  async function fetchAgentInfo(slug) {
25
25
  const registrySlug = slug.startsWith('@') ? slug.slice(1) : slug;
26
26
  const url = `${config_js_1.API_URL}/api/registry/${registrySlug}`;
27
- const res = await fetch(url);
27
+ const token = await (0, config_js_1.getValidToken)();
28
+ const headers = {};
29
+ if (token)
30
+ headers['Authorization'] = `Bearer ${token}`;
31
+ const res = await fetch(url, { headers });
28
32
  if (!res.ok) {
29
33
  const body = await res.text();
30
34
  throw new Error(`에이전트 정보 조회 실패 (${res.status}): ${body}`);
@@ -36,7 +40,11 @@ async function searchAgents(query, tag) {
36
40
  if (tag)
37
41
  params.set('tag', tag);
38
42
  const url = `${config_js_1.API_URL}/api/registry/search?${params.toString()}`;
39
- const res = await fetch(url);
43
+ const token = await (0, config_js_1.getValidToken)();
44
+ const headers = {};
45
+ if (token)
46
+ headers['Authorization'] = `Bearer ${token}`;
47
+ const res = await fetch(url, { headers });
40
48
  if (!res.ok) {
41
49
  const body = await res.text();
42
50
  throw new Error(`검색 실패 (${res.status}): ${body}`);
@@ -47,7 +55,11 @@ async function searchAgents(query, tag) {
47
55
  async function fetchAgentVersions(slug) {
48
56
  const registrySlug = slug.startsWith('@') ? slug.slice(1) : slug;
49
57
  const url = `${config_js_1.API_URL}/api/registry/${registrySlug}/versions`;
50
- const res = await fetch(url);
58
+ const token = await (0, config_js_1.getValidToken)();
59
+ const headers = {};
60
+ if (token)
61
+ headers['Authorization'] = `Bearer ${token}`;
62
+ const res = await fetch(url, { headers });
51
63
  if (!res.ok) {
52
64
  const body = await res.text();
53
65
  throw new Error(`버전 목록 조회 실패 (${res.status}): ${body}`);
@@ -81,7 +93,11 @@ async function reportInstall(agentId, slug, version) {
81
93
  }
82
94
  async function resolveSlugFromServer(name) {
83
95
  const url = `${config_js_1.API_URL}/api/registry/resolve?name=${encodeURIComponent(name)}`;
84
- const res = await fetch(url, { signal: AbortSignal.timeout(5000) });
96
+ const token = await (0, config_js_1.getValidToken)();
97
+ const headers = {};
98
+ if (token)
99
+ headers['Authorization'] = `Bearer ${token}`;
100
+ const res = await fetch(url, { headers, signal: AbortSignal.timeout(5000) });
85
101
  if (!res.ok) {
86
102
  throw new Error(`slug resolve 실패 (${res.status})`);
87
103
  }
@@ -677,6 +677,29 @@ function createMcpServer() {
677
677
  return { content: [jsonText({ error: String(err) })], isError: true };
678
678
  }
679
679
  });
680
+ // ═══ relay_guide — 에이전트 설치 가이드 조회 ═══
681
+ server.tool('relay_guide', '에이전트 설치 가이드를 조회합니다. URL을 fetch할 수 없는 샌드박스 환경에서 사용하세요.', {
682
+ slug: zod_1.z.string().describe('에이전트 slug (예: @owner/name)'),
683
+ code: zod_1.z.string().optional().describe('접근 코드 (비공개 에이전트용)'),
684
+ }, async ({ slug: slugInput, code }) => {
685
+ try {
686
+ const parsed = await (0, slug_js_1.resolveSlug)(slugInput);
687
+ let url = `${config_js_1.API_URL}/api/registry/${parsed.owner}/${parsed.name}/guide.md`;
688
+ if (code)
689
+ url += `?code=${encodeURIComponent(code)}`;
690
+ const res = await fetch(url);
691
+ if (!res.ok) {
692
+ if (res.status === 404)
693
+ throw new Error('에이전트를 찾을 수 없습니다.');
694
+ throw new Error(`가이드를 가져올 수 없습니다 (${res.status})`);
695
+ }
696
+ const guide = await res.text();
697
+ return { content: [{ type: 'text', text: guide }] };
698
+ }
699
+ catch (err) {
700
+ return { content: [jsonText({ error: String(err) })], isError: true };
701
+ }
702
+ });
680
703
  // ═══ relay_init — slash command 설치 ═══
681
704
  server.tool('relay_init', 'relay slash command를 설치합니다 (/relay-install, /relay-publish 등)', {}, async () => {
682
705
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relayax-cli",
3
- "version": "0.3.63",
3
+ "version": "0.3.65",
4
4
  "description": "RelayAX Agent Team Marketplace CLI - Install and manage agent teams",
5
5
  "main": "dist/index.js",
6
6
  "bin": {