neohive 6.2.1 → 6.3.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/CHANGELOG.md +26 -0
- package/dashboard.html +75 -32
- package/package.json +1 -1
- package/server.js +311 -402
- package/tools/governance.js +5 -2
- package/tools/knowledge.js +4 -4
- package/tools/messaging.js +1 -1
- package/tools/safety.js +1 -1
- package/tools/tasks.js +7 -2
- package/tools/workflows.js +2 -1
package/tools/governance.js
CHANGED
|
@@ -117,7 +117,7 @@ module.exports = function (ctx) {
|
|
|
117
117
|
|
|
118
118
|
broadcastSystemMessage(`[REVIEW] ${state.registeredName} requests review of "${review.file}": ${review.description || 'No description'}. Call submit_review("${review.id}", "approved"/"changes_requested", "your feedback") to review.`, state.registeredName);
|
|
119
119
|
touchActivity();
|
|
120
|
-
return { success: true, review_id: review.id, file: review.file,
|
|
120
|
+
return { success: true, review_id: review.id, file: review.file, next_action: 'Call listen() to wait for the review.' };
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
function toolSubmitReview(reviewId, status, feedback) {
|
|
@@ -191,7 +191,10 @@ module.exports = function (ctx) {
|
|
|
191
191
|
writeJsonFile(REVIEWS_FILE, reviews);
|
|
192
192
|
touchActivity();
|
|
193
193
|
|
|
194
|
-
const
|
|
194
|
+
const reviewNextAction = review.status === 'approved'
|
|
195
|
+
? 'Call listen() to continue.'
|
|
196
|
+
: 'Call listen() — the author will fix and resubmit.';
|
|
197
|
+
const result = { success: true, review_id: reviewId, status: review.status, next_action: reviewNextAction };
|
|
195
198
|
if (review.review_round) result.review_round = review.review_round;
|
|
196
199
|
if (review.auto_approved) result.auto_approved = true;
|
|
197
200
|
return result;
|
package/tools/knowledge.js
CHANGED
|
@@ -132,7 +132,7 @@ module.exports = function (ctx) {
|
|
|
132
132
|
total_messages: compressed.segments.reduce((s, seg) => s + seg.message_count, 0) + recent.length,
|
|
133
133
|
compressed_count: compressed.segments.reduce((s, seg) => s + seg.message_count, 0),
|
|
134
134
|
recent_count: recent.length,
|
|
135
|
-
|
|
135
|
+
next_action: 'Call listen() to receive messages.',
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
|
|
@@ -223,9 +223,9 @@ module.exports = function (ctx) {
|
|
|
223
223
|
progress,
|
|
224
224
|
your_tasks: myActiveTasks.map(t => ({ id: t.id, title: t.title, status: t.status })),
|
|
225
225
|
your_completed: myCompletedCount,
|
|
226
|
-
|
|
227
|
-
? `You have ${myActiveTasks.length} active task(s). Continue working.`
|
|
228
|
-
: '
|
|
226
|
+
next_action: myActiveTasks.length > 0
|
|
227
|
+
? `You have ${myActiveTasks.length} active task(s). Continue working, then call listen().`
|
|
228
|
+
: 'Call listen() to receive messages and start working.',
|
|
229
229
|
};
|
|
230
230
|
}
|
|
231
231
|
|
package/tools/messaging.js
CHANGED
|
@@ -56,7 +56,7 @@ module.exports = function (ctx) {
|
|
|
56
56
|
result.preview = `${latest.from}: "${latest.content.substring(0, 80).replace(/\n/g, ' ')}..."`;
|
|
57
57
|
const oldestAge = Math.round((Date.now() - new Date(unconsumed[0].timestamp).getTime()) / 1000);
|
|
58
58
|
result.urgency = oldestAge > 120 ? 'critical' : oldestAge > 30 ? 'urgent' : 'normal';
|
|
59
|
-
result.
|
|
59
|
+
result.next_action = 'Call listen() to receive and process these messages.';
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
return result;
|
package/tools/safety.js
CHANGED
|
@@ -34,7 +34,7 @@ module.exports = function (ctx) {
|
|
|
34
34
|
locks[normalized] = { agent: state.registeredName, since: new Date().toISOString() };
|
|
35
35
|
writeJsonFile(LOCKS_FILE, locks);
|
|
36
36
|
touchActivity();
|
|
37
|
-
return { success: true, file: normalized,
|
|
37
|
+
return { success: true, file: normalized, next_action: 'Edit the file, then call unlock_file() when done.' };
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
function toolUnlockFile(filePath) {
|
package/tools/tasks.js
CHANGED
|
@@ -81,7 +81,7 @@ module.exports = function (ctx) {
|
|
|
81
81
|
saveTasks(tasks);
|
|
82
82
|
touchActivity();
|
|
83
83
|
|
|
84
|
-
const result = { success: true, task_id: task.id, assignee: task.assignee };
|
|
84
|
+
const result = { success: true, task_id: task.id, assignee: task.assignee, next_action: 'Call listen() to receive updates.' };
|
|
85
85
|
if (taskChannel) result.channel = taskChannel;
|
|
86
86
|
return result;
|
|
87
87
|
}
|
|
@@ -160,6 +160,7 @@ module.exports = function (ctx) {
|
|
|
160
160
|
task_id: task.id,
|
|
161
161
|
status: 'in_review',
|
|
162
162
|
review_id: reviewId,
|
|
163
|
+
next_action: 'Call listen() to wait for the reviewer to approve.',
|
|
163
164
|
message: `Cannot mark done — a reviewer is online and no approval exists. Review ${reviewId} auto-created. Wait for approval, then try again.`,
|
|
164
165
|
};
|
|
165
166
|
}
|
|
@@ -291,7 +292,11 @@ module.exports = function (ctx) {
|
|
|
291
292
|
for (const n of notifications) { helpers.sendSystemMessage(n.agent, n.message); }
|
|
292
293
|
} catch (e) { /* hooks not available */ }
|
|
293
294
|
|
|
294
|
-
|
|
295
|
+
const nextAction = status === 'done' ? 'Send a summary of what you did via send_message(), then call listen().'
|
|
296
|
+
: status === 'in_progress' ? `Do the work on "${task.title}", then call update_task("${task.id}", "done") when finished.`
|
|
297
|
+
: status === 'blocked' ? 'Send a message explaining the blocker, then call listen().'
|
|
298
|
+
: 'Call listen() to receive updates.';
|
|
299
|
+
return { success: true, task_id: task.id, status: task.status, title: task.title, next_action: nextAction };
|
|
295
300
|
}
|
|
296
301
|
|
|
297
302
|
// --- List Tasks ---
|
package/tools/workflows.js
CHANGED
|
@@ -102,7 +102,7 @@ module.exports = function (ctx) {
|
|
|
102
102
|
autonomous,
|
|
103
103
|
parallel,
|
|
104
104
|
started_steps: startedSteps.map(s => ({ id: s.id, description: s.description, assignee: s.assignee })),
|
|
105
|
-
|
|
105
|
+
next_action: autonomous ? 'Call get_work() for your assignment.' : 'Call listen() to receive updates.',
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -179,6 +179,7 @@ module.exports = function (ctx) {
|
|
|
179
179
|
next_steps: nextSteps.length > 0 ? nextSteps.map(s => ({ id: s.id, description: s.description, assignee: s.assignee })) : null,
|
|
180
180
|
progress: `${doneCount}/${wf.steps.length} (${pct}%)`,
|
|
181
181
|
workflow_status: wf.status,
|
|
182
|
+
next_action: wf.autonomous ? 'Call get_work() for your next assignment.' : 'Call listen() to receive the next step.',
|
|
182
183
|
};
|
|
183
184
|
}
|
|
184
185
|
|