sleepcode 1.4.3 → 1.4.5

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.
@@ -13,7 +13,10 @@
13
13
  "Bash(NPM_TOKEN=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 npm publish:*)",
14
14
  "Bash(NPM_TOKEN=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 npm publish)",
15
15
  "Bash(git push:*)",
16
- "Bash(claude:*)"
16
+ "Bash(claude:*)",
17
+ "Bash(git reset:*)",
18
+ "Bash(NPM_TOKEN=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 npm publish --registry=https://registry.npmjs.org/)",
19
+ "Bash(npm publish --//registry.npmjs.org/:_authToken=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)"
17
20
  ]
18
21
  }
19
22
  }
package/.gitattributes ADDED
@@ -0,0 +1,4 @@
1
+ # Shell scripts must always use LF line endings
2
+ *.sh text eol=lf
3
+ *.py text eol=lf
4
+ *.md text eol=lf
package/bin/index.js CHANGED
@@ -279,6 +279,10 @@ 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
+ // Shell/Python 스크립트는 반드시 LF 줄바꿈 (Windows에서도)
283
+ if (file.endsWith('.sh') || file.endsWith('.py')) {
284
+ content = content.replace(/\r\n/g, '\n');
285
+ }
282
286
  // PowerShell은 UTF-8 BOM 필요 (한글 깨짐 방지)
283
287
  if (file.endsWith('.ps1')) content = '\uFEFF' + content;
284
288
  fs.writeFileSync(dest, content);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sleepcode",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "description": "AI codes while you sleep — Claude AI 야간 자동화 세팅 CLI",
5
5
  "bin": {
6
6
  "sleepcode": "./bin/index.js"
@@ -15,9 +15,11 @@ $tasks = Get-Content .sleepcode/tasks.md -Raw -Encoding UTF8
15
15
 
16
16
  $prompt = "$baseRules`n`n---`n`n$rules`n`n---`n`n$tasks"
17
17
 
18
- # stream-json + verbose: 토큰 단위 실시간 출력
19
- $prompt | claude -p --dangerously-skip-permissions --output-format stream-json --verbose 2>&1 |
20
- python .sleepcode/scripts/log_filter.py
18
+ # 프롬프트를 임시 파일에 저장 cmd 네이티브 파이프로 실시간 스트리밍
19
+ $tempFile = [System.IO.Path]::GetTempFileName()
20
+ [System.IO.File]::WriteAllText($tempFile, $prompt, [System.Text.Encoding]::UTF8)
21
+ cmd /c "type `"$tempFile`" | claude -p --dangerously-skip-permissions --output-format stream-json --verbose 2>&1 | python -u .sleepcode/scripts/log_filter.py"
22
+ Remove-Item $tempFile -ErrorAction SilentlyContinue
21
23
 
22
24
  $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
23
25
  Write-Host "[$timestamp] AI 단일 실행 종료"
@@ -6,7 +6,7 @@ Usage: claude ... --output-format stream-json | python3 .sleepcode/log_filter.py
6
6
  import sys
7
7
  import json
8
8
 
9
- for line in sys.stdin:
9
+ for line in iter(sys.stdin.readline, ''):
10
10
  line = line.strip()
11
11
  if not line:
12
12
  continue
@@ -44,11 +44,13 @@ while ($true) {
44
44
  $prompt = "$baseRules`n`n---`n`n$rules`n`n---`n`n$tasks"
45
45
 
46
46
  Log "claude 실행 중..."
47
- # stream-json -> log_filter.py 핵심 메시지만 추출
48
- $prompt | claude -p --dangerously-skip-permissions --output-format stream-json --verbose 2>&1 |
49
- python .sleepcode/scripts/log_filter.py |
47
+ # 프롬프트를 임시 파일에 저장 cmd 네이티브 파이프로 실시간 스트리밍
48
+ $tempFile = [System.IO.Path]::GetTempFileName()
49
+ [System.IO.File]::WriteAllText($tempFile, $prompt, [System.Text.Encoding]::UTF8)
50
+ cmd /c "type `"$tempFile`" | claude -p --dangerously-skip-permissions --output-format stream-json --verbose 2>&1 | python -u .sleepcode/scripts/log_filter.py" 2>&1 |
50
51
  Tee-Object -Append $logFile
51
52
  $exitCode = $LASTEXITCODE
53
+ Remove-Item $tempFile -ErrorAction SilentlyContinue
52
54
  Log "claude 종료 (exit code: $exitCode)"
53
55
 
54
56
  # 미커밋 변경사항 체크