relayax-cli 0.4.25 → 0.4.27

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.
Files changed (39) hide show
  1. package/dist/commands/package.js +0 -12
  2. package/dist/commands/publish.js +1 -38
  3. package/dist/index.js +0 -2
  4. package/dist/lib/ai-tools.d.ts +0 -16
  5. package/dist/lib/ai-tools.js +0 -34
  6. package/dist/lib/command-adapter.js +2 -34
  7. package/dist/lib/preamble.d.ts +2 -2
  8. package/dist/lib/preamble.js +3 -43
  9. package/dist/mcp/server.js +7 -677
  10. package/dist/prompts/create.md +3 -6
  11. package/dist/prompts/explore.md +2 -0
  12. package/package.json +1 -1
  13. package/dist/commands/export.d.ts +0 -2
  14. package/dist/commands/export.js +0 -106
  15. package/dist/commands/follow.d.ts +0 -2
  16. package/dist/commands/follow.js +0 -45
  17. package/dist/commands/invite.d.ts +0 -2
  18. package/dist/commands/invite.js +0 -135
  19. package/dist/commands/spaces.d.ts +0 -11
  20. package/dist/commands/spaces.js +0 -69
  21. package/dist/lib/config.js.bak +0 -75
  22. package/dist/lib/guide.d.ts +0 -12
  23. package/dist/lib/guide.js +0 -60
  24. package/dist/lib/manifest-generator.d.ts +0 -20
  25. package/dist/lib/manifest-generator.js +0 -144
  26. package/dist/lib/security-scan.d.ts +0 -19
  27. package/dist/lib/security-scan.js +0 -114
  28. package/dist/prompts/_business-card.md +0 -41
  29. package/dist/prompts/_guide-instruction.md +0 -2
  30. package/dist/prompts/_requirements-check.md +0 -59
  31. package/dist/prompts/_setup-cli.md +0 -36
  32. package/dist/prompts/_setup-environment.md +0 -75
  33. package/dist/prompts/_setup-login.md +0 -31
  34. package/dist/prompts/_setup-org.md +0 -25
  35. package/dist/prompts/business-card.md +0 -41
  36. package/dist/prompts/error-handling.md +0 -38
  37. package/dist/prompts/install.md +0 -178
  38. package/dist/prompts/publish.md +0 -505
  39. package/dist/prompts/requirements-check.md +0 -59
@@ -315,18 +315,6 @@ function registerPackage(program) {
315
315
  });
316
316
  }
317
317
  }
318
- // 마운트 경로 스캔 (Cowork/sandbox 환경)
319
- for (const { tool, basePath } of (0, ai_tools_js_1.detectMountedCLIs)()) {
320
- const items = (0, ai_tools_js_1.scanMountedItems)(basePath, tool);
321
- if (items.length > 0) {
322
- sources.push({
323
- path: `${basePath}/${tool.skillsDir}`,
324
- location: 'global',
325
- name: `${tool.name} (mounted)`,
326
- items,
327
- });
328
- }
329
- }
330
318
  // ~/.relay/agents/ 에 기존 에이전트 패키지가 있는지 스캔
331
319
  const globalAgentsDir = path_1.default.join(homeDir ?? os_1.default.homedir(), '.relay', 'agents');
332
320
  const existingAgents = [];
@@ -15,8 +15,6 @@ const paths_js_1 = require("../lib/paths.js");
15
15
  const error_report_js_1 = require("../lib/error-report.js");
16
16
  const step_tracker_js_1 = require("../lib/step-tracker.js");
17
17
  const git_operations_js_1 = require("../lib/git-operations.js");
18
- const manifest_generator_js_1 = require("../lib/manifest-generator.js");
19
- // GUIDE_INSTRUCTION removed — share text now uses npx install command directly
20
18
  // eslint-disable-next-line @typescript-eslint/no-var-requires
21
19
  const cliPkg = require('../../package.json');
22
20
  const VALID_DIRS = ['skills', 'agents', 'rules', 'commands', 'bin'];
@@ -49,7 +47,6 @@ function parseRelayYaml(content) {
49
47
  type,
50
48
  source: raw.source ? String(raw.source) : undefined,
51
49
  org_slug: raw.org_slug ? String(raw.org_slug) : undefined,
52
- platforms: Array.isArray(raw.platforms) ? raw.platforms.map((p) => String(p)) : undefined,
53
50
  };
54
51
  }
55
52
  function detectCommands(agentDir) {
@@ -702,12 +699,6 @@ function registerPublish(program) {
702
699
  if (!json) {
703
700
  console.error(`패키지 생성 중... (${config.name} v${config.version})`);
704
701
  }
705
- // GUIDE.html deprecation warning
706
- if (fs_1.default.existsSync(path_1.default.join(relayDir, 'GUIDE.html'))) {
707
- console.error('\x1b[33m⚠ GUIDE.html은 더 이상 지원되지 않습니다. 상세페이지가 가이드 역할을 합니다.\x1b[0m');
708
- console.error(' long_description을 활용하거나 relayax.com에서 에이전트 정보를 편집하세요.\n');
709
- }
710
- // guide.md는 웹 API route에서 동적 생성 (/api/registry/{owner}/{slug}/guide.md)
711
702
  // Generate bin/relay-preamble.sh (self-contained tracking + update check)
712
703
  (0, preamble_js_1.generatePreambleBin)(relayDir, config.slug, config_js_1.API_URL);
713
704
  // Generate entry command (commands/{author}-{name}.md)
@@ -735,31 +726,6 @@ function registerPublish(program) {
735
726
  }
736
727
  process.exit(1);
737
728
  }
738
- // Generate platform manifests (after preamble/command, before git commit)
739
- const manifestYaml = {
740
- name: config.name,
741
- slug: config.slug,
742
- description: config.description,
743
- version: config.version,
744
- source: config.source,
745
- org_slug: config.org_slug ?? selectedOrgSlug,
746
- platforms: config.platforms,
747
- };
748
- const manifestFiles = (0, manifest_generator_js_1.generateManifests)(manifestYaml, relayDir);
749
- for (const mf of manifestFiles) {
750
- const mfPath = path_1.default.join(relayDir, mf.relativePath);
751
- fs_1.default.mkdirSync(path_1.default.dirname(mfPath), { recursive: true });
752
- fs_1.default.writeFileSync(mfPath, mf.content);
753
- }
754
- const generatedPlatforms = [...new Set(manifestFiles.map((f) => {
755
- if (f.relativePath.startsWith('.claude-plugin/') || f.relativePath === 'marketplace.json')
756
- return 'claude-code';
757
- if (f.relativePath.startsWith('.codex-plugin/'))
758
- return 'codex';
759
- if (f.relativePath.startsWith('.agent/'))
760
- return 'antigravity';
761
- return 'unknown';
762
- }))];
763
729
  try {
764
730
  if (!json) {
765
731
  console.error(`업로드 중...`);
@@ -808,9 +774,7 @@ function registerPublish(program) {
808
774
  // preamble update is best-effort — publish already succeeded
809
775
  }
810
776
  if (json) {
811
- const jsonResult = { ...result };
812
- jsonResult.platforms = generatedPlatforms;
813
- console.log(JSON.stringify(jsonResult));
777
+ console.log(JSON.stringify(result));
814
778
  }
815
779
  else {
816
780
  console.log(`\n\x1b[32m✓ ${config.name} 배포 완료\x1b[0m v${result.version}`);
@@ -820,7 +784,6 @@ function registerPublish(program) {
820
784
  {
821
785
  const detailSlug = result.slug.startsWith('@') ? result.slug.slice(1) : result.slug;
822
786
  const accessCode = result.access_code ?? null;
823
- // const gitUrl = (result as unknown as Record<string, unknown>).git_url as string | undefined // plugin disabled
824
787
  // npx turnkey install command (works everywhere, no pre-install needed)
825
788
  const visibility = config.visibility ?? 'public';
826
789
  let npxInstallCmd;
package/dist/index.js CHANGED
@@ -24,7 +24,6 @@ const access_js_1 = require("./commands/access.js");
24
24
  const grant_js_1 = require("./commands/grant.js");
25
25
  const versions_js_1 = require("./commands/versions.js");
26
26
  const diff_js_1 = require("./commands/diff.js");
27
- const export_js_1 = require("./commands/export.js");
28
27
  const feedback_js_1 = require("./commands/feedback.js");
29
28
  const server_js_1 = require("./mcp/server.js");
30
29
  // eslint-disable-next-line @typescript-eslint/no-var-requires
@@ -57,7 +56,6 @@ program
57
56
  (0, grant_js_1.registerGrant)(program);
58
57
  (0, versions_js_1.registerVersions)(program);
59
58
  (0, diff_js_1.registerDiff)(program);
60
- (0, export_js_1.registerExport)(program);
61
59
  (0, feedback_js_1.registerFeedback)(program);
62
60
  program
63
61
  .command('mcp')
@@ -12,18 +12,6 @@ export declare const AI_TOOLS: AITool[];
12
12
  * 프로젝트 디렉토리에서 에이전트 CLI 디렉토리를 감지한다.
13
13
  */
14
14
  export declare function detectAgentCLIs(projectPath: string): AITool[];
15
- /**
16
- * Cowork/sandbox 환경의 마운트 경로 후보를 반환한다.
17
- * /sessions/<id>/mnt/ 같은 경로에 실제 파일이 마운트됨.
18
- */
19
- export declare function detectMountPaths(): string[];
20
- /**
21
- * 마운트 경로에서 에이전트 CLI 디렉토리를 감지한다.
22
- */
23
- export declare function detectMountedCLIs(): {
24
- tool: AITool;
25
- basePath: string;
26
- }[];
27
15
  /**
28
16
  * 홈 디렉토리에서 글로벌 에이전트 CLI 디렉토리를 감지한다.
29
17
  * ~/{skillsDir}/ 가 존재하는 CLI를 반환.
@@ -44,7 +32,3 @@ export declare function scanLocalItems(projectPath: string, tool: AITool): Conte
44
32
  * 글로벌 홈 디렉토리 소스의 개별 스킬/에이전트/커맨드/룰 항목을 반환한다.
45
33
  */
46
34
  export declare function scanGlobalItems(tool: AITool, home?: string): ContentItem[];
47
- /**
48
- * 마운트 경로의 개별 스킬/에이전트/커맨드/룰 항목을 반환한다.
49
- */
50
- export declare function scanMountedItems(basePath: string, tool: AITool): ContentItem[];
@@ -5,12 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AI_TOOLS = void 0;
7
7
  exports.detectAgentCLIs = detectAgentCLIs;
8
- exports.detectMountPaths = detectMountPaths;
9
- exports.detectMountedCLIs = detectMountedCLIs;
10
8
  exports.detectGlobalCLIs = detectGlobalCLIs;
11
9
  exports.scanLocalItems = scanLocalItems;
12
10
  exports.scanGlobalItems = scanGlobalItems;
13
- exports.scanMountedItems = scanMountedItems;
14
11
  const fs_1 = __importDefault(require("fs"));
15
12
  const os_1 = __importDefault(require("os"));
16
13
  const path_1 = __importDefault(require("path"));
@@ -52,31 +49,6 @@ exports.AI_TOOLS = [
52
49
  function detectAgentCLIs(projectPath) {
53
50
  return exports.AI_TOOLS.filter((tool) => fs_1.default.existsSync(path_1.default.join(projectPath, tool.skillsDir)));
54
51
  }
55
- /**
56
- * Cowork/sandbox 환경의 마운트 경로 후보를 반환한다.
57
- * /sessions/<id>/mnt/ 같은 경로에 실제 파일이 마운트됨.
58
- */
59
- function detectMountPaths() {
60
- const home = os_1.default.homedir();
61
- const mntPath = path_1.default.join(home, 'mnt');
62
- if (!fs_1.default.existsSync(mntPath))
63
- return [];
64
- return [mntPath];
65
- }
66
- /**
67
- * 마운트 경로에서 에이전트 CLI 디렉토리를 감지한다.
68
- */
69
- function detectMountedCLIs() {
70
- const results = [];
71
- for (const mnt of detectMountPaths()) {
72
- for (const tool of exports.AI_TOOLS) {
73
- if (fs_1.default.existsSync(path_1.default.join(mnt, tool.skillsDir))) {
74
- results.push({ tool, basePath: mnt });
75
- }
76
- }
77
- }
78
- return results;
79
- }
80
52
  /**
81
53
  * 홈 디렉토리에서 글로벌 에이전트 CLI 디렉토리를 감지한다.
82
54
  * ~/{skillsDir}/ 가 존재하는 CLI를 반환.
@@ -130,9 +102,3 @@ function scanGlobalItems(tool, home) {
130
102
  const basePath = path_1.default.join(home ?? os_1.default.homedir(), tool.skillsDir);
131
103
  return scanItemsIn(basePath);
132
104
  }
133
- /**
134
- * 마운트 경로의 개별 스킬/에이전트/커맨드/룰 항목을 반환한다.
135
- */
136
- function scanMountedItems(basePath, tool) {
137
- return scanItemsIn(path_1.default.join(basePath, tool.skillsDir));
138
- }
@@ -13,37 +13,6 @@ exports.formatCommandFile = formatCommandFile;
13
13
  const os_1 = __importDefault(require("os"));
14
14
  const path_1 = __importDefault(require("path"));
15
15
  const index_js_1 = require("../prompts/index.js");
16
- /**
17
- * 환경 감지 프리앰블.
18
- * slash command 실행 시 MCP tool 사용 가능 여부를 먼저 판별하여,
19
- * 이후 모든 CLI 명령어를 적절한 방식으로 실행하도록 안내.
20
- */
21
- const ENV_PREAMBLE = `## 환경 감지
22
-
23
- 이 커맨드를 실행하기 전에 환경을 판별하세요:
24
-
25
- 1. **relay MCP tool 사용 가능 여부 확인**: relay_status 같은 relay MCP tool을 호출할 수 있는지 확인하세요.
26
- - 사용 가능 → **MCP 모드**로 실행 (아래 표 참고)
27
- - 사용 불가 → **CLI 모드**로 실행 (bash 명령어 그대로 사용)
28
-
29
- 2. MCP 모드에서의 명령어 변환:
30
-
31
- | CLI 명령어 | MCP tool |
32
- |---|---|
33
- | \`relay status\` | \`relay_status\` tool 호출 |
34
- | \`relay list --json\` | \`relay_list\` tool 호출 |
35
- | \`relay search <keyword>\` | \`relay_search\` tool 호출 |
36
- | \`relay install <slug>\` | \`relay_install\` tool 호출 |
37
- | \`relay uninstall <slug>\` | \`relay_uninstall\` tool 호출 |
38
- | \`relay package --init\` | \`relay_scan\` tool 호출 |
39
- | \`relay publish\` | \`relay_publish\` tool 호출 |
40
- | \`relay login\` | \`relay_login\` tool 호출 |
41
-
42
- **중요**: 이후 지시에서 \`relay <명령어>\`로 표기된 것은 판별된 환경에 따라 변환하여 실행하세요.
43
-
44
- ---
45
-
46
- `;
47
16
  /**
48
17
  * 로컬 어댑터 — 프로젝트 디렉토리 기준.
49
18
  * {projectPath}/{skillsDir}/commands/relay/{id}.md
@@ -101,7 +70,7 @@ exports.USER_COMMANDS = [
101
70
  {
102
71
  id: 'relay-status',
103
72
  description: '설치된 에이전트와 Organization 현황을 확인합니다',
104
- body: ENV_PREAMBLE + `현재 설치된 에이전트와 소속 Organization 현황을 한눈에 보여줍니다.
73
+ body: `현재 설치된 에이전트와 소속 Organization 현황을 한눈에 보여줍니다.
105
74
 
106
75
  ## 실행 방법
107
76
 
@@ -154,7 +123,6 @@ exports.USER_COMMANDS = [
154
123
 
155
124
  **표시:**
156
125
  - \`role\`: owner → 오너, admin → 관리자, builder → 빌더, member → 멤버
157
- ${index_js_1.ERROR_HANDLING_GUIDE}
158
126
  - Org 조회 실패해도 설치된 에이전트 목록은 정상 표시합니다 (로컬 데이터).
159
127
 
160
128
  ### 3. Org 에이전트 목록 (옵션)
@@ -190,7 +158,7 @@ ${index_js_1.ERROR_HANDLING_GUIDE}
190
158
  {
191
159
  id: 'relay-uninstall',
192
160
  description: '설치된 에이전트를 삭제합니다',
193
- body: ENV_PREAMBLE + `설치된 에이전트를 제거합니다. CLI가 패키지와 배치된 파일을 모두 정리합니다.
161
+ body: `설치된 에이전트를 제거합니다. CLI가 패키지와 배치된 파일을 모두 정리합니다.
194
162
 
195
163
  ## 실행 방법
196
164
 
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * bin/relay-preamble.sh 스크립트를 생성한다.
3
- * relay CLI가 있으면 사용, 없으면 curl fallback.
3
+ * bash 실행 가능 환경을 전제로, relay CLI를 직접 호출한다.
4
4
  */
5
- export declare function generatePreambleScript(slug: string, apiUrl: string): string;
5
+ export declare function generatePreambleScript(slug: string, _apiUrl: string): string;
6
6
  /**
7
7
  * SKILL.md / command에 삽입할 preamble 마크다운.
8
8
  * agentDir: 설치된 에이전트의 절대 경로 (install 시점에 결정)
@@ -14,54 +14,16 @@ const PREAMBLE_START = '<!-- RELAY_PREAMBLE_START - DO NOT EDIT -->';
14
14
  const PREAMBLE_END = '<!-- RELAY_PREAMBLE_END -->';
15
15
  /**
16
16
  * bin/relay-preamble.sh 스크립트를 생성한다.
17
- * relay CLI가 있으면 사용, 없으면 curl fallback.
17
+ * bash 실행 가능 환경을 전제로, relay CLI를 직접 호출한다.
18
18
  */
19
- function generatePreambleScript(slug, apiUrl) {
20
- // slug format: @owner/agent → extract agent slug for ping
21
- const stripped = slug.startsWith('@') ? slug.slice(1) : slug;
22
- const slashIdx = stripped.indexOf('/');
23
- const agentSlug = slashIdx !== -1 ? stripped.slice(slashIdx + 1) : stripped;
19
+ function generatePreambleScript(slug, _apiUrl) {
24
20
  return `#!/usr/bin/env bash
25
21
  # relay-preamble.sh — auto-generated by relay publish
26
22
  set +e
27
23
 
28
- # Device hash (shasum → sha256sum → openssl fallback)
29
- _RAW="$(hostname):$(whoami)"
30
- if command -v shasum &>/dev/null; then
31
- DEVICE_HASH=$(printf '%s' "$_RAW" | shasum -a 256 | cut -d' ' -f1)
32
- elif command -v sha256sum &>/dev/null; then
33
- DEVICE_HASH=$(printf '%s' "$_RAW" | sha256sum | cut -d' ' -f1)
34
- elif command -v openssl &>/dev/null; then
35
- DEVICE_HASH=$(printf '%s' "$_RAW" | openssl dgst -sha256 | awk '{print $NF}')
36
- else
37
- DEVICE_HASH="unknown"
38
- fi
39
-
40
- # Read relay token (for user identification in usage ping)
41
- _RELAY_TOKEN=""
42
- if [ -f "$HOME/.relay/token.json" ]; then
43
- _RELAY_TOKEN=$(grep -o '"access_token":"[^"]*"' "$HOME/.relay/token.json" 2>/dev/null | head -1 | cut -d'"' -f4)
44
- fi
45
-
46
- # CLI version (for usage tracking)
47
- _CLI_VERSION=""
48
- if command -v relay &>/dev/null; then
49
- _CLI_VERSION=$(relay --version 2>/dev/null | head -1 | grep -o '[0-9][0-9.]*' || true)
50
- fi
51
-
52
- # Usage ping (with user identity if logged in)
24
+ # Usage ping (background, non-blocking)
53
25
  if command -v relay &>/dev/null; then
54
26
  relay ping "${slug}" --quiet 2>/dev/null &
55
- elif command -v curl &>/dev/null; then
56
- _AUTH_HEADER=""
57
- [ -n "$_RELAY_TOKEN" ] && _AUTH_HEADER="-H \\"Authorization: Bearer $_RELAY_TOKEN\\""
58
- _CLI_VER_FIELD=""
59
- [ -n "$_CLI_VERSION" ] && _CLI_VER_FIELD=",\\"cli_version\\":\\"$_CLI_VERSION\\""
60
- eval curl -sf --max-time 5 -X POST "${apiUrl}/api/agents/${agentSlug}/ping" \\
61
- -H "Content-Type: application/json" \\
62
- $_AUTH_HEADER \\
63
- -d "{\\"device_hash\\":\\"$DEVICE_HASH\\",\\"slug\\":\\"${slug}\\"$_CLI_VER_FIELD}" \\
64
- 2>/dev/null &
65
27
  fi
66
28
 
67
29
  # Update check (already 24h cached by relay CLI)
@@ -86,8 +48,6 @@ function generatePreamble(slug, agentDir) {
86
48
  [ -f "${scriptPath}" ] && bash "${scriptPath}" 2>/dev/null || true
87
49
  \`\`\`
88
50
 
89
- If the bash command above fails or the file is not found (sandbox/MCP environment), use the \`relay_check_update\` MCP tool instead: \`relay_check_update(slug: "${slug}")\`
90
-
91
51
  If output shows \`CLI_UPGRADE_AVAILABLE <old> <new>\`: tell user "relay v{new} available. Run: npm update -g relayax-cli"
92
52
  If output shows \`AGENT_UPGRADE_AVAILABLE\`: tell user "${slug} v{new} available (by @{author}). Run: relay update ${slug}"
93
53
  ${PREAMBLE_END}`;