relayax-cli 0.3.41 → 0.3.43

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 (59) hide show
  1. package/dist/commands/access.js +12 -12
  2. package/dist/commands/changelog.js +2 -2
  3. package/dist/commands/check-update.js +12 -12
  4. package/dist/commands/create.js +46 -19
  5. package/dist/commands/deploy-record.js +2 -2
  6. package/dist/commands/diff.js +2 -2
  7. package/dist/commands/grant.d.ts +33 -0
  8. package/dist/commands/grant.js +190 -0
  9. package/dist/commands/init.js +13 -15
  10. package/dist/commands/install.js +69 -68
  11. package/dist/commands/join.js +3 -3
  12. package/dist/commands/list.js +15 -15
  13. package/dist/commands/login.js +10 -3
  14. package/dist/commands/orgs.js +1 -1
  15. package/dist/commands/outdated.js +7 -7
  16. package/dist/commands/package.d.ts +18 -0
  17. package/dist/commands/package.js +355 -146
  18. package/dist/commands/ping.js +5 -5
  19. package/dist/commands/publish.d.ts +1 -1
  20. package/dist/commands/publish.js +56 -48
  21. package/dist/commands/search.js +2 -2
  22. package/dist/commands/status.js +11 -11
  23. package/dist/commands/uninstall.js +27 -9
  24. package/dist/commands/update.js +22 -22
  25. package/dist/commands/versions.js +2 -2
  26. package/dist/index.js +2 -0
  27. package/dist/lib/ai-tools.d.ts +15 -0
  28. package/dist/lib/ai-tools.js +48 -1
  29. package/dist/lib/api.d.ts +7 -7
  30. package/dist/lib/api.js +11 -11
  31. package/dist/lib/command-adapter.d.ts +4 -3
  32. package/dist/lib/command-adapter.js +37 -688
  33. package/dist/lib/config.d.ts +1 -1
  34. package/dist/lib/config.js +2 -2
  35. package/dist/lib/guide.js +34 -79
  36. package/dist/lib/installer.d.ts +2 -2
  37. package/dist/lib/installer.js +4 -4
  38. package/dist/lib/preamble.d.ts +4 -4
  39. package/dist/lib/preamble.js +14 -14
  40. package/dist/lib/slug.d.ts +5 -0
  41. package/dist/lib/slug.js +49 -2
  42. package/dist/lib/update-cache.js +4 -4
  43. package/dist/lib/version-check.d.ts +3 -3
  44. package/dist/lib/version-check.js +13 -13
  45. package/dist/prompts/_business-card.md +41 -0
  46. package/dist/prompts/_error-handling.md +38 -0
  47. package/dist/prompts/_requirements-check.md +59 -0
  48. package/dist/prompts/_setup-cli.md +19 -0
  49. package/dist/prompts/_setup-login.md +7 -0
  50. package/dist/prompts/_setup-org.md +27 -0
  51. package/dist/prompts/business-card.md +41 -0
  52. package/dist/prompts/error-handling.md +38 -0
  53. package/dist/prompts/index.d.ts +7 -0
  54. package/dist/prompts/index.js +28 -0
  55. package/dist/prompts/install.md +191 -0
  56. package/dist/prompts/publish.md +448 -0
  57. package/dist/prompts/requirements-check.md +59 -0
  58. package/dist/types.d.ts +9 -9
  59. package/package.json +3 -3
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AI_TOOLS = void 0;
7
7
  exports.detectAgentCLIs = detectAgentCLIs;
8
8
  exports.detectGlobalCLIs = detectGlobalCLIs;
9
+ exports.scanLocalItems = scanLocalItems;
10
+ exports.scanGlobalItems = scanGlobalItems;
9
11
  const fs_1 = __importDefault(require("fs"));
10
12
  const os_1 = __importDefault(require("os"));
11
13
  const path_1 = __importDefault(require("path"));
@@ -50,6 +52,51 @@ function detectAgentCLIs(projectPath) {
50
52
  * ~/{skillsDir}/ 가 존재하는 CLI를 반환.
51
53
  */
52
54
  function detectGlobalCLIs() {
53
- const home = path_1.default.join(os_1.default.homedir());
55
+ const home = os_1.default.homedir();
54
56
  return exports.AI_TOOLS.filter((tool) => fs_1.default.existsSync(path_1.default.join(home, tool.skillsDir)));
55
57
  }
58
+ const CONTENT_DIRS = [
59
+ { dir: 'skills', type: 'skill' },
60
+ { dir: 'agents', type: 'agent' },
61
+ { dir: 'commands', type: 'command' },
62
+ { dir: 'rules', type: 'rule' },
63
+ ];
64
+ const EXCLUDE_SUBDIRS = ['relay'];
65
+ /**
66
+ * 소스 디렉토리(basePath) 안의 skills/, agents/, commands/, rules/에서
67
+ * 개별 항목을 스캔하여 반환한다.
68
+ */
69
+ function scanItemsIn(basePath) {
70
+ const items = [];
71
+ for (const { dir, type } of CONTENT_DIRS) {
72
+ const fullDir = path_1.default.join(basePath, dir);
73
+ if (!fs_1.default.existsSync(fullDir))
74
+ continue;
75
+ for (const entry of fs_1.default.readdirSync(fullDir, { withFileTypes: true })) {
76
+ if (entry.name.startsWith('.'))
77
+ continue;
78
+ if (entry.isDirectory() && EXCLUDE_SUBDIRS.includes(entry.name))
79
+ continue;
80
+ items.push({
81
+ name: entry.name.replace(/\.\w+$/, ''), // 파일이면 확장자 제거
82
+ type,
83
+ relativePath: path_1.default.join(dir, entry.name),
84
+ });
85
+ }
86
+ }
87
+ return items;
88
+ }
89
+ /**
90
+ * 프로젝트 로컬 소스의 개별 스킬/에이전트/커맨드/룰 항목을 반환한다.
91
+ */
92
+ function scanLocalItems(projectPath, tool) {
93
+ const basePath = path_1.default.join(projectPath, tool.skillsDir);
94
+ return scanItemsIn(basePath);
95
+ }
96
+ /**
97
+ * 글로벌 홈 디렉토리 소스의 개별 스킬/에이전트/커맨드/룰 항목을 반환한다.
98
+ */
99
+ function scanGlobalItems(tool) {
100
+ const basePath = path_1.default.join(os_1.default.homedir(), tool.skillsDir);
101
+ return scanItemsIn(basePath);
102
+ }
package/dist/lib/api.d.ts CHANGED
@@ -1,24 +1,24 @@
1
- import type { TeamRegistryInfo, SearchResult } from '../types.js';
1
+ import type { AgentRegistryInfo, SearchResult } from '../types.js';
2
2
  export declare function fetchMyOrgs(): Promise<{
3
3
  id: string;
4
4
  slug: string;
5
5
  name: string;
6
6
  role: string;
7
7
  }[]>;
8
- export declare function fetchTeamInfo(slug: string): Promise<TeamRegistryInfo>;
9
- export declare function searchTeams(query: string, tag?: string): Promise<SearchResult[]>;
10
- export interface TeamVersionInfo {
8
+ export declare function fetchAgentInfo(slug: string): Promise<AgentRegistryInfo>;
9
+ export declare function searchAgents(query: string, tag?: string): Promise<SearchResult[]>;
10
+ export interface AgentVersionInfo {
11
11
  version: string;
12
12
  changelog: string | null;
13
13
  created_at: string;
14
14
  }
15
- export declare function fetchTeamVersions(slug: string): Promise<TeamVersionInfo[]>;
16
- export declare function reportInstall(teamId: string, slug: string, version?: string): Promise<void>;
15
+ export declare function fetchAgentVersions(slug: string): Promise<AgentVersionInfo[]>;
16
+ export declare function reportInstall(agentId: string, slug: string, version?: string): Promise<void>;
17
17
  export interface ResolvedSlug {
18
18
  owner: string;
19
19
  name: string;
20
20
  full: string;
21
21
  }
22
22
  export declare function resolveSlugFromServer(name: string): Promise<ResolvedSlug[]>;
23
- export declare function sendUsagePing(teamId: string, slug: string, version?: string): Promise<void>;
23
+ export declare function sendUsagePing(agentId: string, slug: string, version?: string): Promise<void>;
24
24
  export declare function followBuilder(username: string): Promise<void>;
package/dist/lib/api.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fetchMyOrgs = fetchMyOrgs;
4
- exports.fetchTeamInfo = fetchTeamInfo;
5
- exports.searchTeams = searchTeams;
6
- exports.fetchTeamVersions = fetchTeamVersions;
4
+ exports.fetchAgentInfo = fetchAgentInfo;
5
+ exports.searchAgents = searchAgents;
6
+ exports.fetchAgentVersions = fetchAgentVersions;
7
7
  exports.reportInstall = reportInstall;
8
8
  exports.resolveSlugFromServer = resolveSlugFromServer;
9
9
  exports.sendUsagePing = sendUsagePing;
@@ -21,17 +21,17 @@ async function fetchMyOrgs() {
21
21
  return [];
22
22
  return res.json();
23
23
  }
24
- async function fetchTeamInfo(slug) {
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
27
  const res = await fetch(url);
28
28
  if (!res.ok) {
29
29
  const body = await res.text();
30
- throw new Error(`팀 정보 조회 실패 (${res.status}): ${body}`);
30
+ throw new Error(`에이전트 정보 조회 실패 (${res.status}): ${body}`);
31
31
  }
32
32
  return res.json();
33
33
  }
34
- async function searchTeams(query, tag) {
34
+ async function searchAgents(query, tag) {
35
35
  const params = new URLSearchParams({ q: query });
36
36
  if (tag)
37
37
  params.set('tag', tag);
@@ -44,7 +44,7 @@ async function searchTeams(query, tag) {
44
44
  const data = (await res.json());
45
45
  return data.results;
46
46
  }
47
- async function fetchTeamVersions(slug) {
47
+ async function fetchAgentVersions(slug) {
48
48
  const registrySlug = slug.startsWith('@') ? slug.slice(1) : slug;
49
49
  const url = `${config_js_1.API_URL}/api/registry/${registrySlug}/versions`;
50
50
  const res = await fetch(url);
@@ -54,8 +54,8 @@ async function fetchTeamVersions(slug) {
54
54
  }
55
55
  return res.json();
56
56
  }
57
- async function reportInstall(teamId, slug, version) {
58
- const url = `${config_js_1.API_URL}/api/teams/${teamId}/install`;
57
+ async function reportInstall(agentId, slug, version) {
58
+ const url = `${config_js_1.API_URL}/api/agents/${agentId}/install`;
59
59
  const headers = { 'Content-Type': 'application/json' };
60
60
  const body = { slug };
61
61
  if (version)
@@ -88,13 +88,13 @@ async function resolveSlugFromServer(name) {
88
88
  const data = (await res.json());
89
89
  return data.results;
90
90
  }
91
- async function sendUsagePing(teamId, slug, version) {
91
+ async function sendUsagePing(agentId, slug, version) {
92
92
  const { createHash } = await import('crypto');
93
93
  const { hostname, userInfo } = await import('os');
94
94
  const deviceHash = createHash('sha256')
95
95
  .update(`${hostname()}:${userInfo().username}`)
96
96
  .digest('hex');
97
- const url = `${config_js_1.API_URL}/api/teams/${teamId}/ping`;
97
+ const url = `${config_js_1.API_URL}/api/agents/${agentId}/ping`;
98
98
  const payload = { device_hash: deviceHash, slug };
99
99
  if (version)
100
100
  payload.installed_version = version;
@@ -15,12 +15,13 @@ export interface ToolCommandAdapter {
15
15
  */
16
16
  export declare function createAdapter(tool: AITool): ToolCommandAdapter;
17
17
  /**
18
- * 글로벌 슬래시 커맨드 파일 경로 (Claude Code 기본).
19
- * ~/.claude/commands/relay/{id}.md
18
+ * @deprecated getGlobalCommandPathForTool(skillsDir, commandId)를 사용하세요.
19
+ * Claude Code 전용 경로. 멀티 에이전트 지원 시 ForTool 버전 사용 필요.
20
20
  */
21
21
  export declare function getGlobalCommandPath(commandId: string): string;
22
22
  /**
23
- * 글로벌 슬래시 커맨드 디렉토리 (Claude Code 기본).
23
+ * @deprecated getGlobalCommandDirForTool(skillsDir)를 사용하세요.
24
+ * Claude Code 전용 경로. 멀티 에이전트 지원 시 ForTool 버전 사용 필요.
24
25
  */
25
26
  export declare function getGlobalCommandDir(): string;
26
27
  /**