@geekbeer/minion 2.70.2 → 3.4.7
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/db.js +297 -0
- package/core/lib/thread-watcher.js +3 -6
- package/core/routes/daily-logs.js +17 -11
- package/core/routes/memory.js +16 -10
- package/core/stores/chat-store.js +138 -76
- package/core/stores/daily-log-store.js +84 -105
- package/core/stores/execution-store.js +59 -84
- package/core/stores/memory-store.js +84 -177
- package/core/stores/routine-store.js +55 -72
- package/core/stores/workflow-store.js +52 -69
- package/docs/api-reference.md +6 -2
- package/linux/minion-cli.sh +203 -254
- package/linux/routes/chat.js +54 -7
- package/linux/server.js +3 -1
- package/package.json +3 -2
- package/roles/engineer.md +12 -0
- package/roles/pm.md +16 -0
- package/rules/core.md +66 -0
- package/win/lib/process-manager.js +115 -220
- package/win/minion-cli.ps1 +882 -675
- package/win/routes/chat.js +54 -7
- package/win/server.js +2 -0
- package/win/vendor/README.md +13 -0
- package/win/vendor/nssm.exe +0 -0
package/win/routes/chat.js
CHANGED
|
@@ -66,19 +66,48 @@ async function chatRoutes(fastify) {
|
|
|
66
66
|
reply.code(401)
|
|
67
67
|
return { success: false, error: 'Unauthorized' }
|
|
68
68
|
}
|
|
69
|
-
const session =
|
|
69
|
+
const session = chatStore.load()
|
|
70
70
|
if (!session) return { success: true, session: null }
|
|
71
71
|
return {
|
|
72
72
|
success: true,
|
|
73
73
|
session: {
|
|
74
74
|
session_id: session.session_id,
|
|
75
75
|
messages: session.messages,
|
|
76
|
+
turn_count: session.turn_count,
|
|
76
77
|
created_at: session.created_at,
|
|
77
78
|
updated_at: session.updated_at,
|
|
78
79
|
},
|
|
79
80
|
}
|
|
80
81
|
})
|
|
81
82
|
|
|
83
|
+
// GET /api/chat/sessions - List all sessions (metadata only)
|
|
84
|
+
fastify.get('/api/chat/sessions', async (request, reply) => {
|
|
85
|
+
if (!verifyToken(request)) {
|
|
86
|
+
reply.code(401)
|
|
87
|
+
return { success: false, error: 'Unauthorized' }
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const limit = parseInt(request.query?.limit) || 50
|
|
91
|
+
const sessions = chatStore.listSessions(limit)
|
|
92
|
+
return { success: true, sessions }
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
// GET /api/chat/sessions/:sessionId - Get a specific session with messages
|
|
96
|
+
fastify.get('/api/chat/sessions/:sessionId', async (request, reply) => {
|
|
97
|
+
if (!verifyToken(request)) {
|
|
98
|
+
reply.code(401)
|
|
99
|
+
return { success: false, error: 'Unauthorized' }
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const session = chatStore.loadById(request.params.sessionId)
|
|
103
|
+
if (!session) {
|
|
104
|
+
reply.code(404)
|
|
105
|
+
return { success: false, error: 'Session not found' }
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return { success: true, session }
|
|
109
|
+
})
|
|
110
|
+
|
|
82
111
|
fastify.post('/api/chat/clear', async (request, reply) => {
|
|
83
112
|
if (!verifyToken(request)) {
|
|
84
113
|
reply.code(401)
|
|
@@ -166,16 +195,34 @@ async function chatRoutes(fastify) {
|
|
|
166
195
|
async function buildContextPrefix(message, context, sessionId) {
|
|
167
196
|
const parts = []
|
|
168
197
|
|
|
169
|
-
// Tell the LLM
|
|
198
|
+
// Tell the LLM how to access memory and daily logs via API
|
|
170
199
|
if (!sessionId) {
|
|
171
|
-
const
|
|
172
|
-
const
|
|
200
|
+
const port = require('../../core/config').config.AGENT_PORT
|
|
201
|
+
const baseUrl = `http://localhost:${port}`
|
|
173
202
|
parts.push(
|
|
174
203
|
'[長期記憶・デイリーログについて]',
|
|
175
204
|
'あなたには長期記憶(メモリ)とデイリーログがあります。内容は毎回読み込まれません。',
|
|
176
|
-
'
|
|
177
|
-
|
|
178
|
-
|
|
205
|
+
'必要なときは以下のAPIで検索・取得してください(認証ヘッダー必須):',
|
|
206
|
+
'',
|
|
207
|
+
'```bash',
|
|
208
|
+
'# メモリ検索(キーワードで全文検索)',
|
|
209
|
+
`curl -H "Authorization: Bearer $API_TOKEN" "${baseUrl}/api/memory?search=キーワード"`,
|
|
210
|
+
'',
|
|
211
|
+
'# メモリ一覧',
|
|
212
|
+
`curl -H "Authorization: Bearer $API_TOKEN" ${baseUrl}/api/memory`,
|
|
213
|
+
'',
|
|
214
|
+
'# メモリ詳細(IDを指定)',
|
|
215
|
+
`curl -H "Authorization: Bearer $API_TOKEN" ${baseUrl}/api/memory/{id}`,
|
|
216
|
+
'',
|
|
217
|
+
'# デイリーログ検索',
|
|
218
|
+
`curl -H "Authorization: Bearer $API_TOKEN" "${baseUrl}/api/daily-logs?search=キーワード"`,
|
|
219
|
+
'',
|
|
220
|
+
'# デイリーログ一覧',
|
|
221
|
+
`curl -H "Authorization: Bearer $API_TOKEN" ${baseUrl}/api/daily-logs`,
|
|
222
|
+
'',
|
|
223
|
+
'# 特定日のデイリーログ取得',
|
|
224
|
+
`curl -H "Authorization: Bearer $API_TOKEN" ${baseUrl}/api/daily-logs/YYYY-MM-DD`,
|
|
225
|
+
'```',
|
|
179
226
|
'',
|
|
180
227
|
'参照すべきタイミング:',
|
|
181
228
|
'- 過去の作業や決定事項を思い出す必要があるとき',
|
package/win/server.js
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# NSSM (Non-Sucking Service Manager)
|
|
2
|
+
|
|
3
|
+
This directory contains `nssm.exe` for Windows Service management.
|
|
4
|
+
|
|
5
|
+
## Download
|
|
6
|
+
|
|
7
|
+
Download NSSM 2.24 (64-bit) from https://nssm.cc/release/nssm-2.24.zip
|
|
8
|
+
and place `win64/nssm.exe` in this directory.
|
|
9
|
+
|
|
10
|
+
## License
|
|
11
|
+
|
|
12
|
+
NSSM is public domain software.
|
|
13
|
+
See https://nssm.cc for details.
|
|
Binary file
|