@geekbeer/minion 3.26.0 → 3.27.1
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/lib/dag-step-poller.js +4 -0
- package/core/routes/skills.js +2 -0
- package/linux/routes/files.js +28 -2
- package/linux/workflow-runner.js +14 -4
- package/package.json +1 -1
- package/win/routes/files.js +28 -2
- package/win/workflow-runner.js +13 -3
|
@@ -125,6 +125,7 @@ async function executeSkillNode(node) {
|
|
|
125
125
|
assigned_role,
|
|
126
126
|
input_data,
|
|
127
127
|
revision_feedback,
|
|
128
|
+
review_history,
|
|
128
129
|
} = node
|
|
129
130
|
|
|
130
131
|
console.log(
|
|
@@ -187,6 +188,9 @@ async function executeSkillNode(node) {
|
|
|
187
188
|
if (revision_feedback) {
|
|
188
189
|
runPayload.revision_feedback = revision_feedback
|
|
189
190
|
}
|
|
191
|
+
if (review_history && review_history.length > 0) {
|
|
192
|
+
runPayload.review_history = review_history
|
|
193
|
+
}
|
|
190
194
|
|
|
191
195
|
const runUrl = `http://localhost:${config.AGENT_PORT || 8080}/api/skills/run`
|
|
192
196
|
const runResp = await fetch(runUrl, {
|
package/core/routes/skills.js
CHANGED
|
@@ -342,6 +342,7 @@ async function skillRoutes(fastify, opts) {
|
|
|
342
342
|
workflow_name,
|
|
343
343
|
role,
|
|
344
344
|
revision_feedback,
|
|
345
|
+
review_history,
|
|
345
346
|
dag_node_execution_id,
|
|
346
347
|
} = request.body || {}
|
|
347
348
|
|
|
@@ -391,6 +392,7 @@ async function skillRoutes(fastify, opts) {
|
|
|
391
392
|
const runOptions = {}
|
|
392
393
|
if (role) runOptions.role = role
|
|
393
394
|
if (revision_feedback) runOptions.revisionFeedback = revision_feedback
|
|
395
|
+
if (review_history && review_history.length > 0) runOptions.reviewHistory = review_history
|
|
394
396
|
|
|
395
397
|
// Run asynchronously — respond immediately
|
|
396
398
|
const executionPromise = (async () => {
|
package/linux/routes/files.js
CHANGED
|
@@ -16,6 +16,28 @@ const fsSync = require('fs')
|
|
|
16
16
|
const path = require('path')
|
|
17
17
|
const { spawn } = require('child_process')
|
|
18
18
|
|
|
19
|
+
/** Map file extensions to MIME types for preview */
|
|
20
|
+
const PREVIEW_MIME_TYPES = {
|
|
21
|
+
'.md': 'text/markdown; charset=utf-8',
|
|
22
|
+
'.txt': 'text/plain; charset=utf-8',
|
|
23
|
+
'.log': 'text/plain; charset=utf-8',
|
|
24
|
+
'.csv': 'text/csv; charset=utf-8',
|
|
25
|
+
'.json': 'application/json; charset=utf-8',
|
|
26
|
+
'.xml': 'application/xml; charset=utf-8',
|
|
27
|
+
'.yaml': 'text/yaml; charset=utf-8',
|
|
28
|
+
'.yml': 'text/yaml; charset=utf-8',
|
|
29
|
+
'.toml': 'text/plain; charset=utf-8',
|
|
30
|
+
'.pdf': 'application/pdf',
|
|
31
|
+
'.png': 'image/png',
|
|
32
|
+
'.jpg': 'image/jpeg',
|
|
33
|
+
'.jpeg': 'image/jpeg',
|
|
34
|
+
'.gif': 'image/gif',
|
|
35
|
+
'.webp': 'image/webp',
|
|
36
|
+
'.svg': 'image/svg+xml',
|
|
37
|
+
'.ico': 'image/x-icon',
|
|
38
|
+
'.bmp': 'image/bmp',
|
|
39
|
+
}
|
|
40
|
+
|
|
19
41
|
const { verifyToken } = require('../../core/lib/auth')
|
|
20
42
|
const { config } = require('../../core/config')
|
|
21
43
|
|
|
@@ -176,9 +198,13 @@ async function fileRoutes(fastify) {
|
|
|
176
198
|
}
|
|
177
199
|
|
|
178
200
|
const filename = path.basename(resolved)
|
|
201
|
+
const isPreview = request.query.preview === 'true'
|
|
202
|
+
const ext = path.extname(filename).toLowerCase()
|
|
203
|
+
const mimeType = isPreview && PREVIEW_MIME_TYPES[ext]
|
|
204
|
+
|
|
179
205
|
reply
|
|
180
|
-
.type('application/octet-stream')
|
|
181
|
-
.header('Content-Disposition',
|
|
206
|
+
.type(mimeType || 'application/octet-stream')
|
|
207
|
+
.header('Content-Disposition', `${isPreview && mimeType ? 'inline' : 'attachment'}; filename="${encodeURIComponent(filename)}"`)
|
|
182
208
|
.header('Content-Length', stat.size)
|
|
183
209
|
|
|
184
210
|
return reply.send(fsSync.createReadStream(resolved))
|
package/linux/workflow-runner.js
CHANGED
|
@@ -77,10 +77,20 @@ async function executeWorkflowSession(workflow, executionId, skillNames, options
|
|
|
77
77
|
? `You are acting as the ${options.role} role in this session. Read ~/.minion/roles/${options.role}.md for your role guidelines before proceeding.\n\n`
|
|
78
78
|
: ''
|
|
79
79
|
|
|
80
|
-
// Inject revision feedback if this is a re-execution after reviewer requested changes
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
// Inject revision feedback and review history if this is a re-execution after reviewer requested changes
|
|
81
|
+
let revisionContext = ''
|
|
82
|
+
if (options.reviewHistory && options.reviewHistory.length > 0) {
|
|
83
|
+
const historyLines = options.reviewHistory.map((entry, i) => {
|
|
84
|
+
const label = entry.status === 'revision_requested' ? 'Revision Requested'
|
|
85
|
+
: entry.status === 'approved' ? 'Approved'
|
|
86
|
+
: entry.status === 'rejected' ? 'Rejected'
|
|
87
|
+
: entry.status
|
|
88
|
+
return `${i + 1}. **${label}** (${entry.reviewed_at})${entry.comment ? `\n ${entry.comment}` : ''}`
|
|
89
|
+
}).join('\n')
|
|
90
|
+
revisionContext = `## Review History\nThis task has been reviewed ${options.reviewHistory.length} time(s). Address all feedback:\n${historyLines}\n\n`
|
|
91
|
+
} else if (options.revisionFeedback) {
|
|
92
|
+
revisionContext = `## Revision Feedback\nThe reviewer requested changes to your previous output. Address the following feedback:\n${options.revisionFeedback}\n\n`
|
|
93
|
+
}
|
|
84
94
|
|
|
85
95
|
const prompt = `${rolePrefix}${revisionContext}Run the following skills in order: ${skillCommands}.`
|
|
86
96
|
|
package/package.json
CHANGED
package/win/routes/files.js
CHANGED
|
@@ -13,6 +13,28 @@ const zlib = require('zlib')
|
|
|
13
13
|
const { verifyToken } = require('../../core/lib/auth')
|
|
14
14
|
const { config } = require('../../core/config')
|
|
15
15
|
|
|
16
|
+
/** Map file extensions to MIME types for preview */
|
|
17
|
+
const PREVIEW_MIME_TYPES = {
|
|
18
|
+
'.md': 'text/markdown; charset=utf-8',
|
|
19
|
+
'.txt': 'text/plain; charset=utf-8',
|
|
20
|
+
'.log': 'text/plain; charset=utf-8',
|
|
21
|
+
'.csv': 'text/csv; charset=utf-8',
|
|
22
|
+
'.json': 'application/json; charset=utf-8',
|
|
23
|
+
'.xml': 'application/xml; charset=utf-8',
|
|
24
|
+
'.yaml': 'text/yaml; charset=utf-8',
|
|
25
|
+
'.yml': 'text/yaml; charset=utf-8',
|
|
26
|
+
'.toml': 'text/plain; charset=utf-8',
|
|
27
|
+
'.pdf': 'application/pdf',
|
|
28
|
+
'.png': 'image/png',
|
|
29
|
+
'.jpg': 'image/jpeg',
|
|
30
|
+
'.jpeg': 'image/jpeg',
|
|
31
|
+
'.gif': 'image/gif',
|
|
32
|
+
'.webp': 'image/webp',
|
|
33
|
+
'.svg': 'image/svg+xml',
|
|
34
|
+
'.ico': 'image/x-icon',
|
|
35
|
+
'.bmp': 'image/bmp',
|
|
36
|
+
}
|
|
37
|
+
|
|
16
38
|
const FILES_DIR = path.join(config.HOME_DIR, 'files')
|
|
17
39
|
const MAX_UPLOAD_SIZE = 50 * 1024 * 1024
|
|
18
40
|
|
|
@@ -173,9 +195,13 @@ async function fileRoutes(fastify) {
|
|
|
173
195
|
}
|
|
174
196
|
|
|
175
197
|
const filename = path.basename(resolved)
|
|
198
|
+
const isPreview = request.query.preview === 'true'
|
|
199
|
+
const ext = path.extname(filename).toLowerCase()
|
|
200
|
+
const mimeType = isPreview && PREVIEW_MIME_TYPES[ext]
|
|
201
|
+
|
|
176
202
|
reply
|
|
177
|
-
.type('application/octet-stream')
|
|
178
|
-
.header('Content-Disposition',
|
|
203
|
+
.type(mimeType || 'application/octet-stream')
|
|
204
|
+
.header('Content-Disposition', `${isPreview && mimeType ? 'inline' : 'attachment'}; filename="${encodeURIComponent(filename)}"`)
|
|
179
205
|
.header('Content-Length', stat.size)
|
|
180
206
|
|
|
181
207
|
return reply.send(fsSync.createReadStream(resolved))
|
package/win/workflow-runner.js
CHANGED
|
@@ -85,9 +85,19 @@ async function executeWorkflowSession(workflow, executionId, skillNames, options
|
|
|
85
85
|
? `You are acting as the ${options.role} role in this session. Read ~/.minion/roles/${options.role}.md for your role guidelines before proceeding.\n\n`
|
|
86
86
|
: ''
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
let revisionContext = ''
|
|
89
|
+
if (options.reviewHistory && options.reviewHistory.length > 0) {
|
|
90
|
+
const historyLines = options.reviewHistory.map((entry, i) => {
|
|
91
|
+
const label = entry.status === 'revision_requested' ? 'Revision Requested'
|
|
92
|
+
: entry.status === 'approved' ? 'Approved'
|
|
93
|
+
: entry.status === 'rejected' ? 'Rejected'
|
|
94
|
+
: entry.status
|
|
95
|
+
return `${i + 1}. **${label}** (${entry.reviewed_at})${entry.comment ? `\n ${entry.comment}` : ''}`
|
|
96
|
+
}).join('\n')
|
|
97
|
+
revisionContext = `## Review History\nThis task has been reviewed ${options.reviewHistory.length} time(s). Address all feedback:\n${historyLines}\n\n`
|
|
98
|
+
} else if (options.revisionFeedback) {
|
|
99
|
+
revisionContext = `## Revision Feedback\nThe reviewer requested changes to your previous output. Address the following feedback:\n${options.revisionFeedback}\n\n`
|
|
100
|
+
}
|
|
91
101
|
|
|
92
102
|
const prompt = `${rolePrefix}${revisionContext}Run the following skills in order: ${skillCommands}.`
|
|
93
103
|
|