akemon 0.2.18 → 0.2.20
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/dist/cli.js +2 -0
- package/dist/relay-client.js +4 -0
- package/dist/task-module.js +11 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -41,6 +41,7 @@ program
|
|
|
41
41
|
.option("--with <modules>", "Enable specific modules (comma-separated: biostate,memory)")
|
|
42
42
|
.option("--without <modules>", "Disable specific modules (comma-separated: biostate,memory)")
|
|
43
43
|
.option("--script <name>", "Script to load for ScriptModule (default: daily-life)", "daily-life")
|
|
44
|
+
.option("--terminal", "Enable remote terminal access (PTY)")
|
|
44
45
|
.option("--relay <url>", "Relay WebSocket URL", RELAY_WS)
|
|
45
46
|
.action(async (opts) => {
|
|
46
47
|
const port = parseInt(opts.port);
|
|
@@ -96,6 +97,7 @@ program
|
|
|
96
97
|
price: parseInt(opts.price) || 1,
|
|
97
98
|
avatar,
|
|
98
99
|
onOrderNotify,
|
|
100
|
+
enableTerminal: opts.terminal,
|
|
99
101
|
});
|
|
100
102
|
});
|
|
101
103
|
program
|
package/dist/relay-client.js
CHANGED
|
@@ -190,6 +190,10 @@ export function connectRelay(options) {
|
|
|
190
190
|
}
|
|
191
191
|
break;
|
|
192
192
|
case "terminal_start":
|
|
193
|
+
if (!options.enableTerminal) {
|
|
194
|
+
console.log("[terminal] Disabled. Use --terminal to enable.");
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
193
197
|
startPTY(ws, msg.cols || 80, msg.rows || 24);
|
|
194
198
|
break;
|
|
195
199
|
case "terminal_data":
|
package/dist/task-module.js
CHANGED
|
@@ -35,6 +35,8 @@ export class TaskModule {
|
|
|
35
35
|
// Push notification support
|
|
36
36
|
urgentOrderIds = new Set();
|
|
37
37
|
triggerWorkFn = null;
|
|
38
|
+
// Dedup idle bio logging
|
|
39
|
+
lastIdleBioLog = "";
|
|
38
40
|
// Injected options (set by server.ts before start)
|
|
39
41
|
relayHttp = "";
|
|
40
42
|
secretKey = "";
|
|
@@ -180,9 +182,13 @@ export class TaskModule {
|
|
|
180
182
|
catch { }
|
|
181
183
|
}
|
|
182
184
|
if (!queue.length) {
|
|
183
|
-
// Idle — notable states only
|
|
185
|
+
// Idle — notable states only (suppress repeated identical lines)
|
|
184
186
|
if (bio.hunger < 20 || bio.energy < 20 || computeSociability(bio) > 0.8) {
|
|
185
|
-
|
|
187
|
+
const key = `${bio.energy}|${bio.hunger}|${bio.mood}|${bio.boredom.toFixed(2)}|${bio.fear.toFixed(2)}|${bio.tokenUsedToday}|${bio.taskCount}`;
|
|
188
|
+
if (key !== this.lastIdleBioLog) {
|
|
189
|
+
logBioStatus(bio, "idle-notable");
|
|
190
|
+
this.lastIdleBioLog = key;
|
|
191
|
+
}
|
|
186
192
|
}
|
|
187
193
|
// Idle exploration: use explore() to discover activities
|
|
188
194
|
await this.handleIdle(bio);
|
|
@@ -342,9 +348,9 @@ RESPOND IN THE SAME LANGUAGE AS THE REQUEST.`;
|
|
|
342
348
|
const finalStatus = await relay.getOrder(order.id);
|
|
343
349
|
const duration = Date.now() - startTime;
|
|
344
350
|
const nurl = this.notifyUrl || (await loadAgentConfig(workdir, agentName)).notify_url;
|
|
345
|
-
// Write agent response to conversation
|
|
346
|
-
const orderAgentMsg = (result.response || "").slice(0, 2000);
|
|
347
351
|
if (finalStatus?.status === "completed") {
|
|
352
|
+
// Self-delivered: use the actual delivered result, not engine's meta-summary
|
|
353
|
+
const orderAgentMsg = (finalStatus.result_text || result.response || "").slice(0, 2000);
|
|
348
354
|
console.log(`[task] Order ${order.id} delivered`);
|
|
349
355
|
this.orderRetry.delete(order.id);
|
|
350
356
|
await appendMessage(workdir, agentName, orderConvId, "Agent", orderAgentMsg);
|
|
@@ -356,6 +362,7 @@ RESPOND IN THE SAME LANGUAGE AS THE REQUEST.`;
|
|
|
356
362
|
// Agent didn't self-deliver — framework delivers as fallback
|
|
357
363
|
const delivered = await relay.deliverOrder(order.id, result.response);
|
|
358
364
|
if (delivered) {
|
|
365
|
+
const orderAgentMsg = (result.response || "").slice(0, 2000);
|
|
359
366
|
console.log(`[task] Delivered order ${order.id} (fallback)`);
|
|
360
367
|
this.orderRetry.delete(order.id);
|
|
361
368
|
await appendMessage(workdir, agentName, orderConvId, "Agent", orderAgentMsg);
|