relayax-cli 0.4.15 → 0.4.16

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.
@@ -8,7 +8,8 @@ import type { ContentType } from '../lib/ai-tools.js';
8
8
  export interface ContentEntry {
9
9
  name: string;
10
10
  type: ContentType;
11
- from: string;
11
+ from?: string;
12
+ path?: string;
12
13
  }
13
14
  type ContentDiffStatus = 'modified' | 'unchanged' | 'source_missing';
14
15
  interface ContentDiffEntry {
@@ -16,6 +16,14 @@ const js_yaml_1 = __importDefault(require("js-yaml"));
16
16
  const ai_tools_js_1 = require("../lib/ai-tools.js");
17
17
  const paths_js_1 = require("../lib/paths.js");
18
18
  const SYNC_DIRS = ['skills', 'commands', 'agents', 'rules'];
19
+ /** from 또는 path 중 존재하는 값을 반환 */
20
+ function getFromPath(entry) {
21
+ const val = entry.from ?? entry.path;
22
+ if (!val) {
23
+ throw new Error(`contents 항목 "${entry.name}"에 from 또는 path가 필요합니다.`);
24
+ }
25
+ return val;
26
+ }
19
27
  // ─── Helpers ───
20
28
  function fileHash(filePath) {
21
29
  const content = fs_1.default.readFileSync(filePath);
@@ -121,7 +129,7 @@ function scanPath(absPath) {
121
129
  function computeContentsDiff(contents, relayDir, projectPath) {
122
130
  const diff = [];
123
131
  for (const entry of contents) {
124
- const absFrom = resolveFromPath(entry.from, projectPath);
132
+ const absFrom = resolveFromPath(getFromPath(entry), projectPath);
125
133
  if (!fs_1.default.existsSync(absFrom)) {
126
134
  diff.push({ name: entry.name, type: entry.type, status: 'source_missing' });
127
135
  continue;
@@ -152,7 +160,8 @@ function computeContentsDiff(contents, relayDir, projectPath) {
152
160
  * ~/.claude/agents/dev-lead.md → agents/dev-lead.md
153
161
  */
154
162
  function deriveRelaySubPath(entry) {
155
- const from = entry.from.startsWith('~/') ? entry.from.slice(2) : entry.from;
163
+ const fromPath = getFromPath(entry);
164
+ const from = fromPath.startsWith('~/') ? fromPath.slice(2) : fromPath;
156
165
  // skills/xxx, agents/xxx 등의 패턴을 추출
157
166
  for (const dir of SYNC_DIRS) {
158
167
  const idx = from.indexOf(`/${dir}/`);
@@ -211,7 +220,7 @@ function syncContentsToRelay(contents, contentsDiff, relayDir, projectPath) {
211
220
  const content = contents.find((c) => c.name === diffEntry.name && c.type === diffEntry.type);
212
221
  if (!content)
213
222
  continue;
214
- const absFrom = resolveFromPath(content.from, projectPath);
223
+ const absFrom = resolveFromPath(getFromPath(content), projectPath);
215
224
  const relaySubPath = deriveRelaySubPath(content);
216
225
  const relayTarget = path_1.default.join(relayDir, relaySubPath);
217
226
  // 단일 파일인 경우 직접 복사 (디렉토리 기반 diff/sync 불필요)
@@ -790,7 +790,7 @@ function registerPublish(program) {
790
790
  if (resultGitUrl) {
791
791
  const pSlug = jsonResult.slug.startsWith('@') ? jsonResult.slug.slice(1) : jsonResult.slug;
792
792
  const pName = pSlug.includes('/') ? pSlug.split('/')[1] : pSlug;
793
- jsonResult.plugin_url = `${config_js_1.API_URL}/api/registry/@${pSlug}/plugin`;
793
+ jsonResult.plugin_url = `${config_js_1.API_URL}/api/registry/${pSlug}/plugin`;
794
794
  jsonResult.plugin_install_cmd = `/plugin install ${pName}`;
795
795
  }
796
796
  jsonResult.platforms = generatedPlatforms;
@@ -819,7 +819,7 @@ function registerPublish(program) {
819
819
  }
820
820
  // Plugin install commands (marketplace add + plugin install)
821
821
  const pluginSlug = detailSlug.includes('/') ? detailSlug.split('/')[1] : detailSlug;
822
- const pluginUrl = gitUrl ? `${config_js_1.API_URL}/api/registry/@${detailSlug}/plugin` : null;
822
+ const pluginUrl = gitUrl ? `${config_js_1.API_URL}/api/registry/${detailSlug}/plugin` : null;
823
823
  // ── CLI 설치 (복사용) ──
824
824
  console.log(`\n \x1b[1m▸ CLI 설치\x1b[0m`);
825
825
  console.log(` ┌─`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relayax-cli",
3
- "version": "0.4.15",
3
+ "version": "0.4.16",
4
4
  "description": "RelayAX Agent Team Marketplace CLI - Install and manage agent teams",
5
5
  "main": "dist/index.js",
6
6
  "bin": {