relayax-cli 0.2.27 → 0.2.29

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.
@@ -150,8 +150,9 @@ function registerInit(program) {
150
150
  (0, config_js_1.saveInstalled)(installed);
151
151
  }
152
152
  // ── 2. 로컬 Builder 커맨드 (팀 프로젝트인 경우) ──
153
+ // relay-publish가 글로벌로 승격되어 BUILDER_COMMANDS가 비어있으면 스킵
153
154
  const localResults = [];
154
- if (isBuilder) {
155
+ if (isBuilder && command_adapter_js_1.BUILDER_COMMANDS.length > 0) {
155
156
  // 도구 선택
156
157
  let targetToolIds;
157
158
  if (opts.update) {
@@ -377,14 +377,16 @@ ${LOGIN_JIT_GUIDE}
377
377
  → relay uninstall @alice/doc-writer --json 실행
378
378
  → "✓ @alice/doc-writer 삭제 완료 (12개 파일 제거)"`,
379
379
  },
380
- ];
381
- // ─── Builder Commands (로컬 설치) ───
382
- exports.BUILDER_COMMANDS = [
383
380
  {
384
381
  id: 'relay-publish',
385
382
  description: '현재 팀 패키지를 포트폴리오와 함께 relay 마켓플레이스에 배포합니다',
386
383
  body: `현재 디렉토리의 에이전트 팀(.relay/)을 분석하고, 보안 점검 및 requirements를 구성한 뒤, 사용가이드와 포트폴리오를 생성하고 relay 마켓플레이스에 배포합니다.
387
384
 
385
+ ## 사전 확인
386
+
387
+ 이 커맨드는 빌더 프로젝트(.relay/ 디렉토리)에서만 실행할 수 있습니다.
388
+ .relay/ 디렉토리가 없으면: "이 프로젝트에는 .relay/ 디렉토리가 없습니다. \`relay create <name>\`으로 팀을 먼저 만들어주세요." 안내 후 종료합니다.
389
+
388
390
  ## 사전 준비 (자동)
389
391
 
390
392
  ### 0-1. 인증 확인
@@ -643,3 +645,7 @@ ${BUSINESS_CARD_FORMAT}
643
645
  → 온보딩 가이드 코드블록 표시`,
644
646
  },
645
647
  ];
648
+ // ─── Builder Commands (로컬 설치) ───
649
+ // relay-publish가 글로벌로 승격되어 현재 비어있음.
650
+ // relay init --update만 실행하면 모든 커맨드가 한번에 업데이트됨.
651
+ exports.BUILDER_COMMANDS = [];
@@ -1,11 +1,11 @@
1
1
  /**
2
- * bin/relay-preamble.sh 스크립트 콘텐츠를 생성한다.
3
- * relay CLI가 있으면 사용하고, 없으면 curl 직접 ping.
2
+ * bin/relay-preamble.sh 스크립트를 생성한다.
3
+ * relay CLI가 있으면 사용, 없으면 curl fallback.
4
4
  */
5
5
  export declare function generatePreambleScript(slug: string, apiUrl: string): string;
6
6
  /**
7
- * SKILL.md / command에 삽입할 preamble 마크다운을 생성한다.
8
- * bin/relay-preamble.sh를 호출하는 구조.
7
+ * SKILL.md / command에 삽입할 preamble 마크다운.
8
+ * 단순히 relay ping을 호출한다.
9
9
  */
10
10
  export declare function generatePreamble(slug: string): string;
11
11
  /**
@@ -14,13 +14,9 @@ export declare function generatePreamble(slug: string): string;
14
14
  export declare function generatePreambleBin(teamDir: string, slug: string, apiUrl: string): void;
15
15
  /**
16
16
  * frontmatter(---...---) 뒤에 preamble을 삽입한다.
17
- * frontmatter가 없으면 파일 맨 앞에 삽입한다.
18
17
  */
19
18
  export declare function injectPreamble(filePath: string, slug: string): void;
20
19
  /**
21
20
  * 팀의 사용자 진입점 파일에 preamble을 주입한다.
22
- * - 루트 SKILL.md
23
- * - user-invocable: true인 서브 스킬 SKILL.md
24
- * - commands/*.md
25
21
  */
26
22
  export declare function injectPreambleToTeam(teamDir: string, slug: string): number;
@@ -13,60 +13,47 @@ const path_1 = __importDefault(require("path"));
13
13
  const PREAMBLE_START = '<!-- RELAY_PREAMBLE_START - DO NOT EDIT -->';
14
14
  const PREAMBLE_END = '<!-- RELAY_PREAMBLE_END -->';
15
15
  /**
16
- * bin/relay-preamble.sh 스크립트 콘텐츠를 생성한다.
17
- * relay CLI가 있으면 사용하고, 없으면 curl 직접 ping.
16
+ * bin/relay-preamble.sh 스크립트를 생성한다.
17
+ * relay CLI가 있으면 사용, 없으면 curl fallback.
18
18
  */
19
19
  function generatePreambleScript(slug, apiUrl) {
20
20
  const registrySlug = slug.startsWith('@') ? slug.slice(1) : slug;
21
21
  return `#!/usr/bin/env bash
22
22
  # relay-preamble.sh — auto-generated by relay publish
23
- # Usage tracking + update check for ${slug}
24
- set +e # preamble 실패가 팀 사용을 막으면 안 됨
23
+ set +e
25
24
 
26
- SLUG="${slug}"
27
- REGISTRY_SLUG="${registrySlug}"
28
- API_URL="${apiUrl}"
29
- SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
30
- STATE_DIR="$HOME/.relay"
31
- CACHE_FILE="$STATE_DIR/last-update-check"
32
-
33
- # ─── Device hash (privacy-safe) ───
34
25
  DEVICE_HASH=$(echo "$HOSTNAME:$USER" | shasum -a 256 | cut -d' ' -f1)
35
26
 
36
- # ─── Usage ping (fire-and-forget) ───
27
+ # Usage ping
37
28
  if command -v relay &>/dev/null; then
38
- relay ping "$SLUG" --quiet 2>/dev/null &
29
+ relay ping "${slug}" --quiet 2>/dev/null &
39
30
  else
40
- curl -sf -X POST "$API_URL/api/registry/$REGISTRY_SLUG/ping" \\
31
+ curl -sf -X POST "${apiUrl}/api/registry/${registrySlug}/ping" \\
41
32
  -H "Content-Type: application/json" \\
42
33
  -d "{\\"device_hash\\":\\"$DEVICE_HASH\\"}" \\
43
34
  2>/dev/null &
44
35
  fi
45
36
 
46
- # ─── Update check (cached) ───
47
- mkdir -p "$STATE_DIR"
37
+ # Update check
48
38
  if command -v relay &>/dev/null; then
49
- _UPD=$(relay check-update "$SLUG" --quiet 2>/dev/null || true)
39
+ _UPD=$(relay check-update "${slug}" --quiet 2>/dev/null || true)
50
40
  [ -n "$_UPD" ] && echo "$_UPD" || true
51
41
  fi
52
42
 
53
- # ─── Ready signal ───
54
- echo "RELAY_READY: $SLUG"
43
+ echo "RELAY_READY: ${slug}"
55
44
  `;
56
45
  }
57
46
  /**
58
- * SKILL.md / command에 삽입할 preamble 마크다운을 생성한다.
59
- * bin/relay-preamble.sh를 호출하는 구조.
47
+ * SKILL.md / command에 삽입할 preamble 마크다운.
48
+ * 단순히 relay ping을 호출한다.
60
49
  */
61
50
  function generatePreamble(slug) {
51
+ const teamPath = slug.startsWith('@') ? slug.slice(1) : slug;
62
52
  return `${PREAMBLE_START}
63
53
  ## Preamble (run first)
64
54
 
65
55
  \`\`\`bash
66
- _DIR="$(cd "$(dirname "$0")" 2>/dev/null && pwd)" || _DIR=""
67
- _PREAMBLE="$_DIR/bin/relay-preamble.sh"
68
- [ ! -f "$_PREAMBLE" ] && _PREAMBLE="$HOME/.relay/teams/${slug.startsWith('@') ? slug.slice(1) : slug}/bin/relay-preamble.sh"
69
- [ -f "$_PREAMBLE" ] && bash "$_PREAMBLE" 2>/dev/null || echo "RELAY_READY: ${slug}"
56
+ bash "$HOME/.relay/teams/${teamPath}/bin/relay-preamble.sh" 2>/dev/null || true
70
57
  \`\`\`
71
58
 
72
59
  If output shows \`CLI_UPGRADE_AVAILABLE <old> <new>\`: tell user "relay v{new} available. Run: npm update -g relayax-cli"
@@ -87,7 +74,6 @@ function generatePreambleBin(teamDir, slug, apiUrl) {
87
74
  }
88
75
  /**
89
76
  * frontmatter(---...---) 뒤에 preamble을 삽입한다.
90
- * frontmatter가 없으면 파일 맨 앞에 삽입한다.
91
77
  */
92
78
  function injectPreamble(filePath, slug) {
93
79
  const content = fs_1.default.readFileSync(filePath, 'utf-8');
@@ -118,19 +104,10 @@ function injectPreamble(filePath, slug) {
118
104
  }
119
105
  /**
120
106
  * 팀의 사용자 진입점 파일에 preamble을 주입한다.
121
- * - 루트 SKILL.md
122
- * - user-invocable: true인 서브 스킬 SKILL.md
123
- * - commands/*.md
124
107
  */
125
108
  function injectPreambleToTeam(teamDir, slug) {
126
109
  let count = 0;
127
- // 1. 루트 SKILL.md
128
- const rootSkill = path_1.default.join(teamDir, 'SKILL.md');
129
- if (fs_1.default.existsSync(rootSkill)) {
130
- injectPreamble(rootSkill, slug);
131
- count++;
132
- }
133
- // 2. user-invocable 서브 스킬 SKILL.md만 (skills/**/SKILL.md)
110
+ // 1. user-invocable 서브 스킬 SKILL.md
134
111
  const skillsDir = path_1.default.join(teamDir, 'skills');
135
112
  if (fs_1.default.existsSync(skillsDir)) {
136
113
  function walkSkills(dir) {
@@ -150,7 +127,7 @@ function injectPreambleToTeam(teamDir, slug) {
150
127
  }
151
128
  walkSkills(skillsDir);
152
129
  }
153
- // 3. commands/*.md
130
+ // 2. commands/*.md
154
131
  const commandsDir = path_1.default.join(teamDir, 'commands');
155
132
  if (fs_1.default.existsSync(commandsDir)) {
156
133
  for (const entry of fs_1.default.readdirSync(commandsDir, { withFileTypes: true })) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relayax-cli",
3
- "version": "0.2.27",
3
+ "version": "0.2.29",
4
4
  "description": "RelayAX Agent Team Marketplace CLI - Install and manage agent teams",
5
5
  "main": "dist/index.js",
6
6
  "bin": {