relayax-cli 0.4.18 → 0.4.20
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/commands/create.js +8 -8
- package/dist/commands/publish.js +64 -36
- package/dist/lib/git-operations.js +15 -4
- package/dist/prompts/create.md +3 -3
- package/package.json +1 -1
package/dist/commands/create.js
CHANGED
|
@@ -80,9 +80,9 @@ function registerCreate(program) {
|
|
|
80
80
|
message: '공개 범위를 선택하세요.',
|
|
81
81
|
fix: `relay create ${name} --description "${description}" --visibility <visibility> --json`,
|
|
82
82
|
options: [
|
|
83
|
-
{ value: 'public', label: '공개 — 누구나 설치' },
|
|
84
|
-
{ value: 'private', label: '
|
|
85
|
-
{ value: 'internal', label: '
|
|
83
|
+
{ value: 'public', label: '공개 — 누구나 검색 및 설치 가능' },
|
|
84
|
+
{ value: 'private', label: '비공개 — 허가 코드 등록자만 사용 가능' },
|
|
85
|
+
{ value: 'internal', label: '내부 — 조직 내의 누구나 사용 가능' },
|
|
86
86
|
],
|
|
87
87
|
}));
|
|
88
88
|
process.exit(1);
|
|
@@ -94,8 +94,8 @@ function registerCreate(program) {
|
|
|
94
94
|
fix: `visibility는 public, private, internal 중 하나여야 합니다.`,
|
|
95
95
|
options: [
|
|
96
96
|
{ value: 'public', label: '공개' },
|
|
97
|
-
{ value: 'private', label: '
|
|
98
|
-
{ value: 'internal', label: '
|
|
97
|
+
{ value: 'private', label: '비공개' },
|
|
98
|
+
{ value: 'internal', label: '내부' },
|
|
99
99
|
],
|
|
100
100
|
}));
|
|
101
101
|
process.exit(1);
|
|
@@ -136,9 +136,9 @@ function registerCreate(program) {
|
|
|
136
136
|
visibility = await promptSelect({
|
|
137
137
|
message: '공개 범위:',
|
|
138
138
|
choices: [
|
|
139
|
-
{ name: '공개', value: 'public' },
|
|
140
|
-
{ name: '
|
|
141
|
-
{ name: '
|
|
139
|
+
{ name: '공개 — 누구나 검색 및 설치 가능', value: 'public' },
|
|
140
|
+
{ name: '비공개 — 허가 코드 등록자만 사용 가능', value: 'private' },
|
|
141
|
+
{ name: '내부 — 조직 내의 누구나 사용 가능', value: 'internal' },
|
|
142
142
|
],
|
|
143
143
|
});
|
|
144
144
|
}
|
package/dist/commands/publish.js
CHANGED
|
@@ -351,16 +351,16 @@ function registerPublish(program) {
|
|
|
351
351
|
const visibility = await promptSelect({
|
|
352
352
|
message: '공개 범위:',
|
|
353
353
|
choices: [
|
|
354
|
-
{ name: '공개 — 누구나 설치', value: 'public' },
|
|
355
|
-
{ name: '
|
|
356
|
-
{ name: '
|
|
354
|
+
{ name: '공개 — 누구나 검색 및 설치 가능', value: 'public' },
|
|
355
|
+
{ name: '비공개 — 허가 코드 등록자만 사용 가능', value: 'private' },
|
|
356
|
+
{ name: '내부 — 조직 내의 누구나 사용 가능', value: 'internal' },
|
|
357
357
|
],
|
|
358
358
|
});
|
|
359
359
|
if (visibility === 'private') {
|
|
360
|
-
console.error('\x1b[2m💡
|
|
360
|
+
console.error('\x1b[2m💡 비공개 에이전트는 웹 대시보드에서 허가된 사용자를 관리하세요: www.relayax.com/dashboard\x1b[0m');
|
|
361
361
|
}
|
|
362
362
|
else if (visibility === 'internal') {
|
|
363
|
-
console.error('\x1b[2m💡
|
|
363
|
+
console.error('\x1b[2m💡 내부 에이전트는 조직 멤버 전체가 사용할 수 있습니다: www.relayax.com/dashboard/agents\x1b[0m');
|
|
364
364
|
}
|
|
365
365
|
console.error('');
|
|
366
366
|
const tags = tagsRaw
|
|
@@ -561,19 +561,30 @@ function registerPublish(program) {
|
|
|
561
561
|
if (isTTY) {
|
|
562
562
|
const { select: promptSelect } = await import('@inquirer/prompts');
|
|
563
563
|
console.error(`\n\x1b[33m⚠ relay.yaml에 visibility가 설정되지 않았습니다.\x1b[0m (기본값: ${defaultVisibility === 'public' ? '공개' : '비공개'})`);
|
|
564
|
-
const visChoices =
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
564
|
+
const visChoices = hasOrg
|
|
565
|
+
? [
|
|
566
|
+
{
|
|
567
|
+
name: `공개 — 조직 밖의 누구나 사용 가능${defaultVisibility === 'public' ? ' ✓ 추천' : ''}`,
|
|
568
|
+
value: 'public',
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
name: '비공개 — 조직 내의 허가된 사용자만 사용 가능',
|
|
572
|
+
value: 'private',
|
|
573
|
+
},
|
|
574
|
+
]
|
|
575
|
+
: [
|
|
576
|
+
{
|
|
577
|
+
name: `공개 — 누구나 검색 및 설치 가능${defaultVisibility === 'public' ? ' ✓ 추천' : ''}`,
|
|
578
|
+
value: 'public',
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
name: '비공개 — 허가 코드 등록자만 사용 가능',
|
|
582
|
+
value: 'private',
|
|
583
|
+
},
|
|
584
|
+
];
|
|
574
585
|
if (hasOrg) {
|
|
575
586
|
visChoices.push({
|
|
576
|
-
name: '
|
|
587
|
+
name: '내부 — 조직 내의 누구나 사용 가능',
|
|
577
588
|
value: 'internal',
|
|
578
589
|
});
|
|
579
590
|
}
|
|
@@ -590,12 +601,17 @@ function registerPublish(program) {
|
|
|
590
601
|
}
|
|
591
602
|
else {
|
|
592
603
|
(0, error_report_js_1.reportCliError)('publish', 'MISSING_VISIBILITY', 'visibility not set in relay.yaml');
|
|
593
|
-
const visOptions =
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
604
|
+
const visOptions = hasOrg
|
|
605
|
+
? [
|
|
606
|
+
{ value: 'public', label: '공개 — 조직 밖의 누구나 사용 가능' },
|
|
607
|
+
{ value: 'private', label: '비공개 — 조직 내의 허가된 사용자만 사용 가능' },
|
|
608
|
+
]
|
|
609
|
+
: [
|
|
610
|
+
{ value: 'public', label: '공개 — 누구나 검색 및 설치 가능' },
|
|
611
|
+
{ value: 'private', label: '비공개 — 허가 코드 등록자만 사용 가능' },
|
|
612
|
+
];
|
|
597
613
|
if (hasOrg) {
|
|
598
|
-
visOptions.push({ value: 'internal', label: '
|
|
614
|
+
visOptions.push({ value: 'internal', label: '내부 — 조직 내의 누구나 사용 가능' });
|
|
599
615
|
}
|
|
600
616
|
console.error(JSON.stringify({
|
|
601
617
|
error: 'MISSING_VISIBILITY',
|
|
@@ -612,23 +628,34 @@ function registerPublish(program) {
|
|
|
612
628
|
const { select: promptConfirmVis } = await import('@inquirer/prompts');
|
|
613
629
|
const visLabelMap = {
|
|
614
630
|
public: '공개',
|
|
615
|
-
private: '
|
|
616
|
-
internal: '
|
|
631
|
+
private: '비공개',
|
|
632
|
+
internal: '내부',
|
|
617
633
|
};
|
|
618
634
|
const currentVisLabel = visLabelMap[config.visibility ?? 'public'] ?? config.visibility;
|
|
619
|
-
const confirmVisChoices =
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
635
|
+
const confirmVisChoices = hasOrg
|
|
636
|
+
? [
|
|
637
|
+
{
|
|
638
|
+
name: `공개 — 조직 밖의 누구나 사용 가능${defaultVisibility === 'public' ? ' ✓ 추천' : ''}`,
|
|
639
|
+
value: 'public',
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
name: '비공개 — 조직 내의 허가된 사용자만 사용 가능',
|
|
643
|
+
value: 'private',
|
|
644
|
+
},
|
|
645
|
+
]
|
|
646
|
+
: [
|
|
647
|
+
{
|
|
648
|
+
name: `공개 — 누구나 검색 및 설치 가능${defaultVisibility === 'public' ? ' ✓ 추천' : ''}`,
|
|
649
|
+
value: 'public',
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
name: '비공개 — 허가 코드 등록자만 사용 가능',
|
|
653
|
+
value: 'private',
|
|
654
|
+
},
|
|
655
|
+
];
|
|
629
656
|
if (hasOrg) {
|
|
630
657
|
confirmVisChoices.push({
|
|
631
|
-
name: '
|
|
658
|
+
name: '내부 — 조직 내의 누구나 사용 가능',
|
|
632
659
|
value: 'internal',
|
|
633
660
|
});
|
|
634
661
|
}
|
|
@@ -747,8 +774,9 @@ function registerPublish(program) {
|
|
|
747
774
|
}
|
|
748
775
|
const result = await publishToApi(token, tarPath, metadata);
|
|
749
776
|
// Git push: commit and push to git server (required)
|
|
750
|
-
const
|
|
751
|
-
if (
|
|
777
|
+
const gitUrlRaw = result.git_url;
|
|
778
|
+
if (gitUrlRaw) {
|
|
779
|
+
const gitUrl = (0, git_operations_js_1.buildGitUrl)(gitUrlRaw, { token });
|
|
752
780
|
if (!json) {
|
|
753
781
|
console.error('git 저장소에 푸시 중...');
|
|
754
782
|
}
|
|
@@ -36,6 +36,17 @@ function checkGitInstalled() {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
// ─── Core Git Operations ───
|
|
39
|
+
// Credential helper/askpass를 비활성화하여 URL에 포함된 토큰만 사용.
|
|
40
|
+
// Cursor/VSCode가 GIT_ASKPASS를 주입하면 relay 토큰 대신 IDE 인증을 시도하여 실패함.
|
|
41
|
+
const GIT_ENV = {
|
|
42
|
+
...process.env,
|
|
43
|
+
GIT_TERMINAL_PROMPT: '0',
|
|
44
|
+
GIT_ASKPASS: '',
|
|
45
|
+
GIT_CONFIG_NOSYSTEM: '1',
|
|
46
|
+
GIT_CONFIG_COUNT: '1',
|
|
47
|
+
GIT_CONFIG_KEY_0: 'credential.helper',
|
|
48
|
+
GIT_CONFIG_VALUE_0: '',
|
|
49
|
+
};
|
|
39
50
|
function gitInit(dir) {
|
|
40
51
|
(0, child_process_1.execFileSync)('git', ['init'], { cwd: dir, stdio: 'pipe' });
|
|
41
52
|
}
|
|
@@ -47,7 +58,7 @@ function gitClone(url, destDir, opts) {
|
|
|
47
58
|
args.push(url, destDir);
|
|
48
59
|
(0, child_process_1.execFileSync)('git', args, {
|
|
49
60
|
stdio: 'pipe',
|
|
50
|
-
env:
|
|
61
|
+
env: GIT_ENV,
|
|
51
62
|
timeout: 30000,
|
|
52
63
|
});
|
|
53
64
|
}
|
|
@@ -68,13 +79,13 @@ function gitPush(dir, remote, refspec) {
|
|
|
68
79
|
if (refspec)
|
|
69
80
|
args.push(refspec);
|
|
70
81
|
args.push('--tags');
|
|
71
|
-
(0, child_process_1.execFileSync)('git', args, { cwd: dir, stdio: 'pipe' });
|
|
82
|
+
(0, child_process_1.execFileSync)('git', args, { cwd: dir, stdio: 'pipe', env: GIT_ENV });
|
|
72
83
|
}
|
|
73
84
|
function gitFetch(dir) {
|
|
74
|
-
(0, child_process_1.execFileSync)('git', ['fetch', '--tags'], { cwd: dir, stdio: 'pipe' });
|
|
85
|
+
(0, child_process_1.execFileSync)('git', ['fetch', '--tags'], { cwd: dir, stdio: 'pipe', env: GIT_ENV });
|
|
75
86
|
}
|
|
76
87
|
function gitCheckout(dir, ref) {
|
|
77
|
-
(0, child_process_1.execFileSync)('git', ['checkout', ref], { cwd: dir, stdio: 'pipe' });
|
|
88
|
+
(0, child_process_1.execFileSync)('git', ['checkout', ref], { cwd: dir, stdio: 'pipe', env: GIT_ENV });
|
|
78
89
|
}
|
|
79
90
|
function gitDiff(dir, from, to) {
|
|
80
91
|
return (0, child_process_1.execFileSync)('git', ['diff', `${from}..${to}`], {
|
package/dist/prompts/create.md
CHANGED
|
@@ -91,9 +91,9 @@ relay.yaml이 없으면 새로 만들고, 있으면 변경사항을 반영합니
|
|
|
91
91
|
선택에 따라 **사용자에게 질문하여 visibility를 물어봅니다:**
|
|
92
92
|
- **Org 없이 배포**: `public`, `private` (2개)
|
|
93
93
|
- **Org에 배포**: `public`, `private`, `internal` (3개)
|
|
94
|
-
- `public` — 누구나 설치
|
|
95
|
-
- `private` —
|
|
96
|
-
- `internal` —
|
|
94
|
+
- `public` — 누구나 검색 및 설치 가능 (Org: 조직 밖의 누구나 사용 가능)
|
|
95
|
+
- `private` — 허가 코드 등록자만 사용 가능 (Org: 조직 내의 허가된 사용자만 사용 가능)
|
|
96
|
+
- `internal` — 조직 내의 누구나 사용 가능 (Org 배포 시에만 선택 가능)
|
|
97
97
|
|
|
98
98
|
### 5. relay.yaml 작성 & 배포
|
|
99
99
|
|