@geekbeer/minion 3.30.0 → 3.32.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/core/llm-plugins/claude/stream.js +1 -1
- package/linux/minion-cli.sh +18 -3
- package/linux/routes/chat.js +31 -1
- package/package.json +1 -1
- package/win/minion-cli.ps1 +15 -1
- package/win/routes/chat.js +31 -1
- package/win/wsl-session-server.js +1 -1
|
@@ -35,7 +35,7 @@ function streamClaude(input, onEvent, ctx = {}) {
|
|
|
35
35
|
const child = spawn(bin, args, {
|
|
36
36
|
cwd: config.HOME_DIR,
|
|
37
37
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
38
|
-
timeout: input.timeoutMs ||
|
|
38
|
+
timeout: input.timeoutMs || 3600000, // 60 min default
|
|
39
39
|
env: {
|
|
40
40
|
...process.env,
|
|
41
41
|
HOME: config.HOME_DIR,
|
package/linux/minion-cli.sh
CHANGED
|
@@ -1096,13 +1096,28 @@ SUPEOF
|
|
|
1096
1096
|
HOSTNAME_VAL=$(hostname 2>/dev/null || echo "")
|
|
1097
1097
|
LAN_IP=$(detect_lan_ip)
|
|
1098
1098
|
|
|
1099
|
+
# Collect machine specs
|
|
1100
|
+
local CPU_MODEL CPU_CORES MEMORY_MB DISK_GB OS_INFO ARCH_INFO
|
|
1101
|
+
CPU_MODEL=$(grep -m1 'model name' /proc/cpuinfo 2>/dev/null | cut -d: -f2 | sed 's/^ //' || echo "unknown")
|
|
1102
|
+
CPU_CORES=$(nproc 2>/dev/null || grep -c '^processor' /proc/cpuinfo 2>/dev/null || echo "0")
|
|
1103
|
+
MEMORY_MB=$(awk '/MemTotal/ {printf "%.0f", $2/1024}' /proc/meminfo 2>/dev/null || echo "0")
|
|
1104
|
+
DISK_GB=$(df -BG / 2>/dev/null | awk 'NR==2 {gsub("G",""); print $2}' || echo "0")
|
|
1105
|
+
OS_INFO=$(. /etc/os-release 2>/dev/null && echo "${PRETTY_NAME}" || uname -s 2>/dev/null || echo "unknown")
|
|
1106
|
+
ARCH_INFO=$(uname -m 2>/dev/null || echo "unknown")
|
|
1107
|
+
|
|
1108
|
+
local MACHINE_SPECS
|
|
1109
|
+
MACHINE_SPECS=$(cat <<SPECEOF
|
|
1110
|
+
{"cpu_model":"${CPU_MODEL}","cpu_cores":${CPU_CORES},"memory_mb":${MEMORY_MB},"disk_gb":${DISK_GB},"os":"${OS_INFO}","arch":"${ARCH_INFO}"}
|
|
1111
|
+
SPECEOF
|
|
1112
|
+
)
|
|
1113
|
+
|
|
1099
1114
|
local BODY
|
|
1100
1115
|
if [ -f /.dockerenv ]; then
|
|
1101
|
-
BODY="{\"internal_ip_address\":\"${HOSTNAME_VAL}\"}"
|
|
1116
|
+
BODY="{\"internal_ip_address\":\"${HOSTNAME_VAL}\",\"machine_specs\":${MACHINE_SPECS}}"
|
|
1102
1117
|
elif [ -n "$LAN_IP" ]; then
|
|
1103
|
-
BODY="{\"internal_ip_address\":\"${LAN_IP}\",\"ip_address\":\"${LAN_IP}\"}"
|
|
1118
|
+
BODY="{\"internal_ip_address\":\"${LAN_IP}\",\"ip_address\":\"${LAN_IP}\",\"machine_specs\":${MACHINE_SPECS}}"
|
|
1104
1119
|
else
|
|
1105
|
-
BODY="{\"internal_ip_address\":\"${HOSTNAME_VAL}\"}"
|
|
1120
|
+
BODY="{\"internal_ip_address\":\"${HOSTNAME_VAL}\",\"machine_specs\":${MACHINE_SPECS}}"
|
|
1106
1121
|
fi
|
|
1107
1122
|
|
|
1108
1123
|
NOTIFY_RESPONSE=$(curl -sfL -X POST "${HQ_URL}/api/minion/setup-complete" \
|
package/linux/routes/chat.js
CHANGED
|
@@ -353,6 +353,36 @@ async function buildContextPrefix(message, context, sessionId, workspaceId) {
|
|
|
353
353
|
)
|
|
354
354
|
}
|
|
355
355
|
|
|
356
|
+
// Task planning guidance — instruct Claude to create TODOs before starting work
|
|
357
|
+
if (!sessionId) {
|
|
358
|
+
const port = require('../../core/config').config.AGENT_PORT
|
|
359
|
+
parts.push(
|
|
360
|
+
'[作業手順 — 必ず守ること]',
|
|
361
|
+
'依頼された作業に着手する**前に**、以下の手順を踏むこと:',
|
|
362
|
+
'',
|
|
363
|
+
'1. 依頼内容を分析し、必要なステップをToDoとして登録する',
|
|
364
|
+
'2. 各ステップを完了するたびに、ToDoのstatusを `done` に更新する',
|
|
365
|
+
'3. すべてのToDoが完了したら、ユーザーに完了報告する',
|
|
366
|
+
'',
|
|
367
|
+
'ToDo APIの使い方:',
|
|
368
|
+
'```bash',
|
|
369
|
+
'# ToDo作成(session_idは後でセッションIDが判明してから設定)',
|
|
370
|
+
`curl -X POST http://localhost:${port}/api/todos \\`,
|
|
371
|
+
' -H "Authorization: Bearer $API_TOKEN" -H "Content-Type: application/json" \\',
|
|
372
|
+
' -d \'{"title": "ステップの説明", "session_id": "SESSION_ID", "priority": "normal"}\'',
|
|
373
|
+
'',
|
|
374
|
+
'# ToDo完了',
|
|
375
|
+
`curl -X PUT http://localhost:${port}/api/todos/{id} \\`,
|
|
376
|
+
' -H "Authorization: Bearer $API_TOKEN" -H "Content-Type: application/json" \\',
|
|
377
|
+
' -d \'{"status": "done"}\'',
|
|
378
|
+
'```',
|
|
379
|
+
'',
|
|
380
|
+
'ToDoを先に作成する理由: チャットのコンテキストが圧縮されても、未完了のToDoは次のターンで自動的に再表示されます。',
|
|
381
|
+
'これにより、長時間の作業でも途中で何をすべきか見失うことがありません。',
|
|
382
|
+
''
|
|
383
|
+
)
|
|
384
|
+
}
|
|
385
|
+
|
|
356
386
|
if (context) {
|
|
357
387
|
switch (context.type) {
|
|
358
388
|
case 'skill':
|
|
@@ -568,7 +598,7 @@ function streamViaLegacyLlmCommand(res, prompt, sessionId, workspaceId, original
|
|
|
568
598
|
const child = spawn(binary, args, {
|
|
569
599
|
cwd: config.HOME_DIR,
|
|
570
600
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
571
|
-
timeout:
|
|
601
|
+
timeout: 3600000, // 60 min — allow long-running tasks to complete
|
|
572
602
|
})
|
|
573
603
|
|
|
574
604
|
// Track active child process for abort
|
package/package.json
CHANGED
package/win/minion-cli.ps1
CHANGED
|
@@ -1522,7 +1522,21 @@ function Invoke-Configure {
|
|
|
1522
1522
|
$bodyHash = @{}
|
|
1523
1523
|
if ($lanIp) { $bodyHash['ip_address'] = $lanIp; $bodyHash['internal_ip_address'] = $lanIp }
|
|
1524
1524
|
else { $bodyHash['internal_ip_address'] = [System.Net.Dns]::GetHostName() }
|
|
1525
|
-
|
|
1525
|
+
|
|
1526
|
+
# Collect machine specs
|
|
1527
|
+
$cpuInfo = Get-CimInstance Win32_Processor -ErrorAction SilentlyContinue | Select-Object -First 1
|
|
1528
|
+
$osInfo = Get-CimInstance Win32_OperatingSystem -ErrorAction SilentlyContinue
|
|
1529
|
+
$diskInfo = Get-CimInstance Win32_LogicalDisk -Filter "DeviceID='C:'" -ErrorAction SilentlyContinue
|
|
1530
|
+
$bodyHash['machine_specs'] = @{
|
|
1531
|
+
cpu_model = if ($cpuInfo) { $cpuInfo.Name } else { 'unknown' }
|
|
1532
|
+
cpu_cores = if ($cpuInfo) { $cpuInfo.NumberOfLogicalProcessors } else { 0 }
|
|
1533
|
+
memory_mb = if ($osInfo) { [math]::Round($osInfo.TotalVisibleMemorySize / 1024) } else { 0 }
|
|
1534
|
+
disk_gb = if ($diskInfo) { [math]::Round($diskInfo.Size / 1GB) } else { 0 }
|
|
1535
|
+
os = if ($osInfo) { $osInfo.Caption } else { 'Windows' }
|
|
1536
|
+
arch = $env:PROCESSOR_ARCHITECTURE
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
$body = $bodyHash | ConvertTo-Json -Depth 3
|
|
1526
1540
|
Invoke-RestMethod -Uri "$HqUrl/api/minion/setup-complete" -Method Post -Headers $headers -Body $body -ErrorAction Stop | Out-Null
|
|
1527
1541
|
Write-Detail "HQ notified"
|
|
1528
1542
|
}
|
package/win/routes/chat.js
CHANGED
|
@@ -416,6 +416,36 @@ async function buildContextPrefix(message, context, sessionId, workspaceId) {
|
|
|
416
416
|
)
|
|
417
417
|
}
|
|
418
418
|
|
|
419
|
+
// Task planning guidance — instruct Claude to create TODOs before starting work
|
|
420
|
+
if (!sessionId) {
|
|
421
|
+
const port = require('../../core/config').config.AGENT_PORT
|
|
422
|
+
parts.push(
|
|
423
|
+
'[作業手順 — 必ず守ること]',
|
|
424
|
+
'依頼された作業に着手する**前に**、以下の手順を踏むこと:',
|
|
425
|
+
'',
|
|
426
|
+
'1. 依頼内容を分析し、必要なステップをToDoとして登録する',
|
|
427
|
+
'2. 各ステップを完了するたびに、ToDoのstatusを `done` に更新する',
|
|
428
|
+
'3. すべてのToDoが完了したら、ユーザーに完了報告する',
|
|
429
|
+
'',
|
|
430
|
+
'ToDo APIの使い方:',
|
|
431
|
+
'```bash',
|
|
432
|
+
'# ToDo作成(session_idは後でセッションIDが判明してから設定)',
|
|
433
|
+
`curl -X POST http://localhost:${port}/api/todos \\`,
|
|
434
|
+
' -H "Authorization: Bearer $API_TOKEN" -H "Content-Type: application/json" \\',
|
|
435
|
+
' -d \'{"title": "ステップの説明", "session_id": "SESSION_ID", "priority": "normal"}\'',
|
|
436
|
+
'',
|
|
437
|
+
'# ToDo完了',
|
|
438
|
+
`curl -X PUT http://localhost:${port}/api/todos/{id} \\`,
|
|
439
|
+
' -H "Authorization: Bearer $API_TOKEN" -H "Content-Type: application/json" \\',
|
|
440
|
+
' -d \'{"status": "done"}\'',
|
|
441
|
+
'```',
|
|
442
|
+
'',
|
|
443
|
+
'ToDoを先に作成する理由: チャットのコンテキストが圧縮されても、未完了のToDoは次のターンで自動的に再表示されます。',
|
|
444
|
+
'これにより、長時間の作業でも途中で何をすべきか見失うことがありません。',
|
|
445
|
+
''
|
|
446
|
+
)
|
|
447
|
+
}
|
|
448
|
+
|
|
419
449
|
if (context) {
|
|
420
450
|
switch (context.type) {
|
|
421
451
|
case 'skill':
|
|
@@ -602,7 +632,7 @@ function streamViaLegacyLlmCommand(res, prompt, sessionId, workspaceId, original
|
|
|
602
632
|
const child = spawn(binary, args, {
|
|
603
633
|
cwd: config.HOME_DIR,
|
|
604
634
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
605
|
-
timeout:
|
|
635
|
+
timeout: 3600000, // 60 min — allow long-running tasks to complete
|
|
606
636
|
shell: true, // Required on Windows to resolve .cmd shims (e.g. claude.cmd)
|
|
607
637
|
})
|
|
608
638
|
|
|
@@ -187,7 +187,7 @@ function streamLlmResponse(res, prompt, sessionId) {
|
|
|
187
187
|
const child = spawn(binary, args, {
|
|
188
188
|
cwd: HOME_DIR,
|
|
189
189
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
190
|
-
timeout:
|
|
190
|
+
timeout: 3600000, // 60 min — allow long-running tasks to complete
|
|
191
191
|
shell: true,
|
|
192
192
|
})
|
|
193
193
|
|