claude-code-kr 0.3.14 โ†’ 0.3.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.
package/bin/cc-kr.js CHANGED
@@ -59,6 +59,44 @@ switch (cmd) {
59
59
  console.log(`๐Ÿ‡ฐ๐Ÿ‡ท ํŒจ์น˜: ${s.patched ? '์ ์šฉ๋จ โœ…' : '๋ฏธ์ ์šฉ โŒ'}`);
60
60
  console.log(`๐Ÿ“ฆ cckr ๋ฒ„์ „: ${pkg.version}`);
61
61
  console.log(`๐Ÿ”ท CC ๋ฒ„์ „: ${s.ccVersion || '์•Œ ์ˆ˜ ์—†์Œ'}`);
62
+
63
+ // ํ˜„์žฌ ์„ธ์…˜์˜ in-memory ๋ฒ„์ „
64
+ // !cckr status: claude (C) โ†’ bash (PPID=C) โ†’ node (PPID=bash)
65
+ // ์„ธ์…˜ ํŒŒ์ผ์€ claude PID๋กœ ์ €์žฅ๋˜๋ฏ€๋กœ grandparent๋ฅผ ์ฐพ์•„์•ผ ํ•จ
66
+ function getGrandparentPid(pid) {
67
+ try {
68
+ if (process.platform === 'linux') {
69
+ const stat = fs.readFileSync(`/proc/${pid}/status`, 'utf8');
70
+ const m = stat.match(/^PPid:\s*(\d+)/m);
71
+ return m ? m[1] : null;
72
+ } else if (process.platform === 'darwin') {
73
+ return execSync(`ps -o ppid= -p ${pid}`, { encoding: 'utf8' }).trim();
74
+ }
75
+ } catch {}
76
+ return null;
77
+ }
78
+ try {
79
+ // process.ppid (bash) ์™€ grandparent (claude) ๋‘˜ ๋‹ค ์‹œ๋„
80
+ const candidates = [process.ppid.toString()];
81
+ const grand = getGrandparentPid(process.ppid);
82
+ if (grand) candidates.push(grand);
83
+
84
+ for (const pid of candidates) {
85
+ const sessionFile = `/tmp/cckr-session-${pid}.json`;
86
+ if (fs.existsSync(sessionFile)) {
87
+ const session = JSON.parse(fs.readFileSync(sessionFile, 'utf8'));
88
+ const inSession = session.sessionCckrVersion;
89
+ const installed = pkg.version;
90
+ if (inSession === installed) {
91
+ console.log(`๐ŸŽฏ ์ด ์„ธ์…˜: cckr ${inSession} (๋””์Šคํฌ์™€ ๋™์ผ)`);
92
+ } else {
93
+ console.log(`๐ŸŽฏ ์ด ์„ธ์…˜: cckr ${inSession} โš ๏ธ (๋””์Šคํฌ: ${installed} โ€” ์ƒˆ ์„ธ์…˜ ์‹œ์ž‘ ์‹œ ๋ณ€๊ฒฝ ์ ์šฉ)`);
94
+ }
95
+ break;
96
+ }
97
+ }
98
+ } catch {}
99
+
62
100
  if (!s.patched) {
63
101
  const sudo = needsSudo() ? 'sudo ' : '';
64
102
  console.log('\n๐Ÿ‘‰ ํŒจ์น˜ ์ ์šฉ:');
package/lib/commands.js CHANGED
@@ -1,53 +1,22 @@
1
+ // 0.3.16 ์ด์ „ ๋ฒ„์ „์ด ์„ค์น˜ํ•œ ~/.claude/commands/cckr.md ์ž๋™ ์ •๋ฆฌ.
2
+ // 0.3.16๋ถ€ํ„ฐ๋Š” !cckr status ํ•œ ์ค„๋กœ ์ถฉ๋ถ„ํ•ด์„œ ์Šฌ๋ž˜์‹œ ์ปค๋งจ๋“œ deprecated.
1
3
  const fs = require('fs');
2
4
  const path = require('path');
3
5
  const os = require('os');
4
6
 
5
- const COMMANDS_DIR = path.join(os.homedir(), '.claude', 'commands');
6
- const TARGET_FILE = path.join(COMMANDS_DIR, 'cckr.md');
7
- const SOURCE_FILE = path.join(__dirname, 'cckr-command.md');
7
+ const TARGET_FILE = path.join(os.homedir(), '.claude', 'commands', 'cckr.md');
8
8
  const MARKER = 'managed-by: claude-code-kr';
9
9
 
10
- // /cckr ์Šฌ๋ž˜์‹œ ์ปค๋งจ๋“œ ์„ค์น˜
11
- function install() {
12
- try {
13
- if (!fs.existsSync(SOURCE_FILE)) {
14
- return { ok: false, error: 'cckr-command.md ์›๋ณธ ํŒŒ์ผ ์—†์Œ' };
15
- }
16
-
17
- // ~/.claude/commands/ ๋””๋ ‰ํ† ๋ฆฌ ์ƒ์„ฑ
18
- if (!fs.existsSync(COMMANDS_DIR)) {
19
- fs.mkdirSync(COMMANDS_DIR, { recursive: true });
20
- }
21
-
22
- // ๊ธฐ์กด ํŒŒ์ผ์ด ์žˆ๊ณ  marker๊ฐ€ ์—†์œผ๋ฉด ์‚ฌ์šฉ์ž ์ •์˜ โ€” ๊ฑด๋“œ๋ฆฌ์ง€ ์•Š์Œ
23
- if (fs.existsSync(TARGET_FILE)) {
24
- const existing = fs.readFileSync(TARGET_FILE, 'utf8');
25
- if (!existing.includes(MARKER)) {
26
- return { ok: true, skipped: true, reason: 'user-customized' };
27
- }
28
- }
29
-
30
- // ๋ณต์‚ฌ
31
- fs.copyFileSync(SOURCE_FILE, TARGET_FILE);
32
- return { ok: true };
33
- } catch (e) {
34
- return { ok: false, error: e.message };
35
- }
36
- }
37
-
38
- // /cckr ์Šฌ๋ž˜์‹œ ์ปค๋งจ๋“œ ์ œ๊ฑฐ
39
10
  function uninstall() {
40
11
  try {
41
12
  if (!fs.existsSync(TARGET_FILE)) {
42
13
  return { ok: true, skipped: true, reason: 'not-found' };
43
14
  }
44
-
45
- // marker๊ฐ€ ์žˆ๋Š” ์šฐ๋ฆฌ ํŒŒ์ผ๋งŒ ์ œ๊ฑฐ
15
+ // marker๊ฐ€ ์žˆ๋Š” ์šฐ๋ฆฌ ํŒŒ์ผ๋งŒ ์ œ๊ฑฐ (์‚ฌ์šฉ์ž customize ๋ณดํ˜ธ)
46
16
  const content = fs.readFileSync(TARGET_FILE, 'utf8');
47
17
  if (!content.includes(MARKER)) {
48
18
  return { ok: true, skipped: true, reason: 'user-customized' };
49
19
  }
50
-
51
20
  fs.unlinkSync(TARGET_FILE);
52
21
  return { ok: true };
53
22
  } catch (e) {
@@ -55,4 +24,4 @@ function uninstall() {
55
24
  }
56
25
  }
57
26
 
58
- module.exports = { install, uninstall, TARGET_FILE };
27
+ module.exports = { uninstall, TARGET_FILE };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-kr",
3
- "version": "0.3.14",
3
+ "version": "0.3.16",
4
4
  "description": "Claude Code ํ•œ๊ธ€ ํŒจ์น˜ CLI โ€” /btw โ†’ /๊ทผ๋ฐ, /help โ†’ /๋„์›€, /compact โ†’ /์••์ถ•",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -36,22 +36,17 @@ try {
36
36
  console.log(` โš ๏ธ hook ๋“ฑ๋ก ์Šคํ‚ต: ${e.message}`);
37
37
  }
38
38
 
39
- // 3. /cckr ์Šฌ๋ž˜์‹œ ์ปค๋งจ๋“œ ์„ค์น˜
39
+ // 3. /cckr ์Šฌ๋ž˜์‹œ ์ปค๋งจ๋“œ ์ •๋ฆฌ (0.3.16๋ถ€ํ„ฐ deprecated โ€” !cckr status ์‚ฌ์šฉ)
40
+ // ์ด์ „ ๋ฒ„์ „์—์„œ ์„ค์น˜ํ•œ ~/.claude/commands/cckr.md ์ž๋™ ์ œ๊ฑฐ
40
41
  try {
41
- const cmdResult = commands.install();
42
+ const cmdResult = commands.uninstall();
42
43
  if (cmdResult.ok && !cmdResult.skipped) {
43
- console.log(' โœ… /cckr ์Šฌ๋ž˜์‹œ ์ปค๋งจ๋“œ ์„ค์น˜');
44
- } else if (cmdResult.skipped) {
45
- console.log(` โญ๏ธ /cckr ์ปค๋งจ๋“œ ์Šคํ‚ต (${cmdResult.reason})`);
46
- } else {
47
- console.log(` โš ๏ธ /cckr ์ปค๋งจ๋“œ ์„ค์น˜ ์Šคํ‚ต: ${cmdResult.error}`);
44
+ console.log(' ๐Ÿงน ์˜› /cckr ์Šฌ๋ž˜์‹œ ์ปค๋งจ๋“œ ์ •๋ฆฌ (์ด์ œ !cckr status ์‚ฌ์šฉ)');
48
45
  }
49
- } catch (e) {
50
- console.log(` โš ๏ธ /cckr ์ปค๋งจ๋“œ ์„ค์น˜ ์Šคํ‚ต: ${e.message}`);
51
- }
46
+ } catch {}
52
47
 
53
48
  console.log('\n๐ŸŽ‰ ์„ค์น˜ ์™„๋ฃŒ! ์ƒˆ ์„ธ์…˜์—์„œ /๋„์›€, /๊ทผ๋ฐ, /์••์ถ• ๋“ฑ์„ ์‚ฌ์šฉํ•˜์„ธ์š”');
54
- console.log(' /cckr ์ž…๋ ฅ์œผ๋กœ cckr ๋ฒ„์ „ ํ™•์ธ ๊ฐ€๋Šฅ');
49
+ console.log(' !cckr status โ€” claude ์•ˆ์—์„œ cckr ์ƒํƒœ ํ™•์ธ');
55
50
  } catch (e) {
56
51
  // postinstall ์‹คํŒจ๊ฐ€ npm install์„ ๋ง‰์œผ๋ฉด ์•ˆ ๋จ
57
52
  console.log(`โš ๏ธ claude-code-kr ์„ค์ • ์Šคํ‚ต: ${e.message}`);
@@ -1,12 +0,0 @@
1
- ---
2
- description: cckr ํ•œ๊ธ€ ํŒจ์น˜ ๋ฒ„์ „ ํ™•์ธ
3
- ---
4
- <!-- managed-by: claude-code-kr -->
5
-
6
- ์ด ์„ธ์…˜์— ์ ์šฉ๋œ cckr ๋ฒ„์ „๊ณผ ๋””์Šคํฌ ์ƒํƒœ๋ฅผ ํ•จ๊ป˜ ๋ณด์—ฌ์ค˜. ๋‹ค์Œ bash ํ•œ ๋ฒˆ๋งŒ ์‹คํ–‰ํ•˜๊ณ  ๊ฒฐ๊ณผ๋ฅผ ๊ทธ๋Œ€๋กœ ์ถœ๋ ฅ:
7
-
8
- ```bash
9
- echo "=== ์ด ์„ธ์…˜ ==="; cat /tmp/cckr-session-$PPID.json 2>/dev/null || echo "(์„ธ์…˜ ์ •๋ณด ์—†์Œ โ€” ์ƒˆ ์„ธ์…˜์„ ์‹œ์ž‘ํ•˜์„ธ์š”)"; echo ""; echo "=== ๋””์Šคํฌ (ํ˜„์žฌ cli.js) ==="; cckr status
10
- ```
11
-
12
- ์ถ”๊ฐ€ ํ•ด์„/์š”์•ฝ ์—†์ด ์ถœ๋ ฅ๋งŒ ๊ทธ๋Œ€๋กœ.