triflux 7.4.0 → 7.5.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triflux",
3
- "version": "7.4.0",
3
+ "version": "7.5.0",
4
4
  "description": "CLI-first multi-model orchestrator for Claude Code — route tasks to Codex, Gemini, and Claude",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,54 @@
1
+ param(
2
+ [Parameter(ValueFromRemainingArguments=$true)]
3
+ [string[]]$ClaudeArgs
4
+ )
5
+
6
+ $LogDir = "$HOME\Desktop\Projects\triflux\logs"
7
+ $LogFile = "$LogDir\claude-sessions.log"
8
+
9
+ if (-not (Test-Path $LogDir)) {
10
+ New-Item -ItemType Directory -Force -Path $LogDir | Out-Null
11
+ }
12
+
13
+ function Write-Log {
14
+ param([string]$Level, [string]$Message)
15
+ $ts = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
16
+ $line = "[$ts] [$Level] $Message"
17
+ Write-Host $line
18
+ Add-Content -Path $LogFile -Value $line -Encoding UTF8
19
+ }
20
+
21
+ $SessionId = "{0}-{1}" -f (Get-Date -Format "yyyyMMddHHmmss"), $PID
22
+
23
+ Write-Log "INFO" "=== Claude Code 세션 시작 [ID: $SessionId] | 인자: $($ClaudeArgs -join " ") ==="
24
+
25
+ $StartTime = Get-Date
26
+
27
+ try {
28
+ if ($ClaudeArgs -and $ClaudeArgs.Count -gt 0) {
29
+ & claude @ClaudeArgs
30
+ } else {
31
+ & claude
32
+ }
33
+ $ExitCode = $LASTEXITCODE
34
+ } catch {
35
+ $ExitCode = -1
36
+ Write-Log "ERROR" "Claude 실행 실패: $_"
37
+ }
38
+
39
+ $EndTime = Get-Date
40
+ $Elapsed = [math]::Round(($EndTime - $StartTime).TotalSeconds, 1)
41
+
42
+ $Reason = switch ($ExitCode) {
43
+ 0 { "정상 종료" }
44
+ 1 { "일반 오류" }
45
+ -1 { "실행 실패 (명령 없음)" }
46
+ default { "비정상 종료" }
47
+ }
48
+
49
+ if ($ExitCode -eq -1073741510) { $Reason = "사용자 인터럽트 (Ctrl+C)" }
50
+
51
+ Write-Log "INFO" "세션 종료 | exit=$ExitCode | 실행시간=${Elapsed}s | 원인=$Reason"
52
+ Write-Log "INFO" "=== Claude Code 세션 종료 [ID: $SessionId] ==="
53
+
54
+ exit $ExitCode