claude-code-kr 0.3.17 → 0.3.19
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/bin/cc-kr.js +11 -0
- package/lib/patches/fragile.js +5 -0
- package/package.json +1 -1
package/bin/cc-kr.js
CHANGED
|
@@ -6,6 +6,7 @@ const { execSync } = require('child_process');
|
|
|
6
6
|
const patcher = require('../lib/patcher');
|
|
7
7
|
const mappings = require('../lib/mappings');
|
|
8
8
|
const hooks = require('../lib/hooks');
|
|
9
|
+
const commands = require('../lib/commands');
|
|
9
10
|
const pkg = require('../package.json');
|
|
10
11
|
|
|
11
12
|
// 실제로 설치된 cckr 디렉토리가 쓰기 가능한지 체크
|
|
@@ -98,6 +99,9 @@ switch (cmd) {
|
|
|
98
99
|
break;
|
|
99
100
|
}
|
|
100
101
|
if (result.ok) {
|
|
102
|
+
// hook 자동 재설치 — restore로 제거됐을 수 있음
|
|
103
|
+
try { hooks.install(); } catch {}
|
|
104
|
+
|
|
101
105
|
console.log(`🎉 ${result.count}개 커맨드 한글화 완료`);
|
|
102
106
|
console.log(`✅ 안정 패치: ${result.stable.applied}/${result.stable.total}`);
|
|
103
107
|
console.log(`⚡ 가변 패치: ${result.fragile.applied}/${result.fragile.total}`);
|
|
@@ -144,6 +148,13 @@ switch (cmd) {
|
|
|
144
148
|
const result = patcher.restore();
|
|
145
149
|
if (result.ok) {
|
|
146
150
|
console.log('✅ 원본 복원 완료');
|
|
151
|
+
// hook 제거 — 새 세션에서 자동 재패치 안 되도록
|
|
152
|
+
try {
|
|
153
|
+
hooks.uninstall();
|
|
154
|
+
console.log('✅ 자동 재패치 hook 제거 (다시 적용하려면 cckr apply)');
|
|
155
|
+
} catch (e) {
|
|
156
|
+
console.log(`⚠️ hook 제거 스킵: ${e.message}`);
|
|
157
|
+
}
|
|
147
158
|
} else {
|
|
148
159
|
console.error(`❌ ${result.error}`);
|
|
149
160
|
process.exit(1);
|
package/lib/patches/fragile.js
CHANGED
|
@@ -119,6 +119,11 @@ const patches = [
|
|
|
119
119
|
[/(\w+)<1000\?`\$\{\1\}ms`:\1<60000\?`\$\{Math\.floor\(\1\/1000\)\}s`:`\$\{Math\.floor\(\1\/60000\)\}m \$\{Math\.floor\(\1%60000\/1000\)\}s`/,
|
|
120
120
|
'$1<1000?`${$1}밀리초`:$1<60000?`${Math.floor($1/1000)}초`:`${Math.floor($1/60000)}분 ${Math.floor($1%60000/1000)}초`'],
|
|
121
121
|
|
|
122
|
+
// login 입력에 onPaste 핸들러 주입 (CC 본체 미지원 보완)
|
|
123
|
+
// 사용자가 OAuth 코드를 paste할 수 있게
|
|
124
|
+
['createElement(d4,{value:w,onChange:$,onSubmit:(f)=>X(f,_.url),cursorOffset:j,onChangeCursorOffset:H,columns:J,mask:"*"})',
|
|
125
|
+
'createElement(d4,{value:w,onChange:$,onSubmit:(f)=>X(f,_.url),cursorOffset:j,onChangeCursorOffset:H,columns:J,mask:"*",onPaste:(P)=>{let N=w.slice(0,j)+P+w.slice(j);$(N);H(j+P.length)}})'],
|
|
126
|
+
|
|
122
127
|
// 도구 실행/연결 시간 표시 — Math.floor(var/1000)}s 형식
|
|
123
128
|
// 컨텍스트별로 안전하게 매칭
|
|
124
129
|
[/(\w+)=`\$\{Math\.floor\((\w+)\/1000\)\}s`;F8/g, '$1=`${Math.floor($2/1000)}초`;F8'],
|