sleepcode 1.4.0 → 1.4.2

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.
@@ -12,7 +12,8 @@
12
12
  "Bash(npm version:*)",
13
13
  "Bash(NPM_TOKEN=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 npm publish:*)",
14
14
  "Bash(NPM_TOKEN=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 npm publish)",
15
- "Bash(git push:*)"
15
+ "Bash(git push:*)",
16
+ "Bash(claude:*)"
16
17
  ]
17
18
  }
18
19
  }
package/bin/index.js CHANGED
@@ -279,6 +279,8 @@ function generateFiles(targetDir, { typeKey, projectName, role, buildCmd, testCm
279
279
  if (fs.existsSync(src)) {
280
280
  let content = fs.readFileSync(src, 'utf-8');
281
281
  content = content.replace(/\{\{SLEEP_INTERVAL\}\}/g, sleepInterval);
282
+ // PowerShell은 UTF-8 BOM 필요 (한글 깨짐 방지)
283
+ if (file.endsWith('.ps1')) content = '\uFEFF' + content;
282
284
  fs.writeFileSync(dest, content);
283
285
  }
284
286
  }
@@ -527,12 +529,17 @@ function generateTasks() {
527
529
 
528
530
  tasks.md 내용만 출력하세요. 다른 설명은 하지 마세요.`;
529
531
 
532
+ // claude 중첩 세션 방지: CLAUDECODE 환경변수 제거
533
+ const env = { ...process.env };
534
+ delete env.CLAUDECODE;
535
+
530
536
  try {
531
537
  const result = execSync(
532
538
  'claude -p --output-format text',
533
539
  {
534
540
  input: prompt,
535
541
  cwd: targetDir,
542
+ env,
536
543
  stdio: ['pipe', 'pipe', 'pipe'],
537
544
  timeout: 300000,
538
545
  maxBuffer: 1024 * 1024,
@@ -547,7 +554,10 @@ tasks.md 내용만 출력하세요. 다른 설명은 하지 마세요.`;
547
554
  console.log(` ${C.cyan}npx sleepcode run${C.reset} ${C.dim}# 1회 실행${C.reset}`);
548
555
  console.log(` ${C.cyan}npx sleepcode run --loop${C.reset} ${C.dim}# 무한 루프${C.reset}`);
549
556
  } catch (e) {
550
- console.error(`${C.red}태스크 생성 실패: ${e.message}${C.reset}`);
557
+ const stderr = e.stderr ? e.stderr.toString().trim() : '';
558
+ console.error(`${C.red}태스크 생성 실패:${C.reset}`);
559
+ if (stderr) console.error(stderr);
560
+ else console.error(e.message);
551
561
  process.exit(1);
552
562
  }
553
563
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sleepcode",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "AI codes while you sleep — Claude AI 야간 자동화 세팅 CLI",
5
5
  "bin": {
6
6
  "sleepcode": "./bin/index.js"
@@ -1,6 +1,8 @@
1
1
  # AI Worker - 1회 실행 스크립트 (Windows PowerShell)
2
2
  # run_forever.ps1 (무한 루프) 대신 수동으로 1회만 돌릴 때 사용
3
3
 
4
+ [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
5
+ $OutputEncoding = [System.Text.Encoding]::UTF8
4
6
  $ErrorActionPreference = "Stop"
5
7
  Set-Location (Split-Path (Split-Path $PSScriptRoot -Parent) -Parent)
6
8
 
@@ -1,6 +1,8 @@
1
1
  # AI Night Worker - 감시자 스크립트 (Windows PowerShell)
2
2
  # 사용법: powershell -File .\.sleepcode\scripts\run_forever.ps1
3
3
 
4
+ [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
5
+ $OutputEncoding = [System.Text.Encoding]::UTF8
4
6
  $ErrorActionPreference = "Continue"
5
7
  Set-Location (Split-Path (Split-Path $PSScriptRoot -Parent) -Parent)
6
8