@cliphijack/santaclaude 1.0.18 → 1.0.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/santaclaude.js +7 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cliphijack/santaclaude",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "publishConfig": { "access": "public" },
5
5
  "description": "SantaClaude 커넥터 — 클라우드 예약을 내 로컬 Claude(tmux)에 발사",
6
6
  "bin": { "santaclaude": "./santaclaude.js" },
package/santaclaude.js CHANGED
@@ -76,8 +76,8 @@ function listWindows(session) {
76
76
  }
77
77
  // 각 루돌프(탭) 화면 캡처 — 웹 미러용 (마지막 ~30줄)
78
78
  function captureWindow(session, name) {
79
- // -e: ANSI 색상 보존(웹에서 터미널 색 재현), -S -40: 최근 40
80
- try { return execFileSync('tmux', ['capture-pane', '-t', session + ':' + name, '-p', '-e', '-S', '-500'], { encoding: 'utf8' }).replace(/\n+$/, '').slice(-60000); }
79
+ // -e: ANSI 색상 보존(웹에서 터미널 색 재현), -S -2000: 최근 2000(스크롤백 깊게)
80
+ try { return execFileSync('tmux', ['capture-pane', '-t', session + ':' + name, '-p', '-e', '-S', '-2000'], { encoding: 'utf8' }).replace(/\n+$/, '').slice(-120000); }
81
81
  catch (e) { return ''; }
82
82
  }
83
83
  // 🔍 로컬 스킬 발견 — ~/.claude/skills + 각 루돌프 프로젝트 .claude/skills 스캔 (등록 누를 때만 1회)
@@ -333,6 +333,7 @@ async function run(conf) {
333
333
  let txState = { until: 0, off: 0, file: null, win: '' }; // 💬 루돌프톡 라이브: 무장시각·읽은 오프셋·세션파일·창
334
334
 
335
335
  cleanOldImages();
336
+ try { execFileSync('tmux', ['set-option', '-g', 'history-limit', '50000'], { stdio: 'ignore' }); } catch (e) {} // 새로 띄우는 루돌프 pane은 스크롤백 5만줄(기존 pane은 유지)
336
337
  console.log(`🛷 SantaClaude 커넥터 가동 — pane=${pane} · ${every / 1000}s 폴링 · ${api}`);
337
338
  if (paneExists(pane)) {
338
339
  // 기존(고객) 세션엔 사람이 안 붙어있을 때만 리사이즈 — 직접 쓰고 있으면 화면 절대 안 건드림
@@ -370,13 +371,11 @@ async function run(conf) {
370
371
  let r; try { r = await fetch(api + '/api/skill/get?token=' + encodeURIComponent(token) + '&id=' + encodeURIComponent(cmd.skillId || '')); } catch (e) { console.warn(' 스킬 받기 실패'); return; }
371
372
  if (!r.ok) { console.warn(' 스킬 없음'); return; }
372
373
  const sk = await r.json();
373
- // 창의 작업 폴더 (없으면 )
374
- let cwd = os.homedir();
375
- try { const pc = execFileSync('tmux', ['display-message', '-t', w, '-p', '#{pane_current_path}'], { encoding: 'utf8' }).trim(); if (pc) cwd = pc; } catch (e) {}
374
+ // 전역 스킬 박스 받은 스킬은 ~/.claude/skills/ 에 둬서 모든 루돌프·폴더에서 바로 쓰게 ( 확정: 전역 기본)
376
375
  // 폴더 네임스페이스 — santa-{퍼블리셔}-{스킬}: 충돌 방지 + 마켓 출처 식별. SKILL.md 파일명은 표준 고정
377
376
  const pub = String(sk.publisher || 'me').replace(/[^a-zA-Z0-9-]/g, '').toLowerCase() || 'me';
378
377
  const folder = ('santa-' + pub + '-' + sk.name).replace(/[^a-zA-Z0-9._-]/g, '-').slice(0, 80);
379
- const sdir = path.join(cwd, '.claude', 'skills', folder);
378
+ const sdir = path.join(os.homedir(), '.claude', 'skills', folder);
380
379
  let cnt = 0;
381
380
  for (const f of (sk.files || [])) {
382
381
  const safe = String(f.path || '').replace(/\\/g, '/').replace(/(^|\/)\.\.(\/|$)/g, '/').replace(/^\/+/, '');
@@ -385,8 +384,8 @@ async function run(conf) {
385
384
  if (!fp.startsWith(sdir)) continue; // 경로 탈출 방지
386
385
  try { fs.mkdirSync(path.dirname(fp), { recursive: true }); fs.writeFileSync(fp, String(f.content || '')); cnt++; } catch (e) {}
387
386
  }
388
- console.log(` 🧩 스킬 "${sk.name}" ${cnt}개 파일 이식 → ${sdir}`);
389
- const msg = (sk.prompt && sk.prompt.trim() ? sk.prompt.trim() + ' ' : '') + '(스킬 "' + sk.name + '"이 .claude/skills/' + folder + '/ 에 이식됨 — SKILL.md 읽고 적용)';
387
+ console.log(` 🧩 스킬 "${sk.name}" ${cnt}개 파일 → ${sdir} (전역)`);
388
+ const msg = (sk.prompt && sk.prompt.trim() ? sk.prompt.trim() + ' ' : '') + '(스킬 "' + sk.name + '"이 ~/.claude/skills/' + folder + '/ 에 이식됨 — 전역이라 모든 세션에서 사용 가능. SKILL.md 읽고 적용)';
390
389
  execFileSync('tmux', ['send-keys', '-t', w, '-l', msg]);
391
390
  setTimeout(() => { try { execFileSync('tmux', ['send-keys', '-t', w, 'Enter']); } catch (e) {} }, 300);
392
391
  return;