@ouro.bot/cli 0.1.0-alpha.685 → 0.1.0-alpha.686
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.json +6 -0
- package/dist/heart/daemon/daemon.js +35 -2
- package/package.json +1 -1
package/changelog.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.686",
|
|
6
|
+
"changes": [
|
|
7
|
+
"Queue external-event payloads into private-runtime attention before dispatch."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
4
10
|
{
|
|
5
11
|
"version": "0.1.0-alpha.685",
|
|
6
12
|
"changes": [
|
|
@@ -1222,7 +1222,39 @@ class OuroDaemon {
|
|
|
1222
1222
|
}
|
|
1223
1223
|
return { type: "message", privateTurnDecision: decision };
|
|
1224
1224
|
}
|
|
1225
|
-
|
|
1225
|
+
queueExternalEventForPrivateRuntime(record) {
|
|
1226
|
+
const pendingDir = path.join(this.bundlesRoot, `${record.agent}.ouro`, "state", "pending", pending_1.PRIVATE_RUNTIME_PENDING.friendId, pending_1.PRIVATE_RUNTIME_PENDING.channel, pending_1.PRIVATE_RUNTIME_PENDING.key);
|
|
1227
|
+
const originKey = `${record.source}:${record.eventId}`;
|
|
1228
|
+
const parsedReceivedAt = Date.parse(record.receivedAt);
|
|
1229
|
+
(0, pending_1.queuePendingMessage)(pendingDir, {
|
|
1230
|
+
from: "ouro-external-event",
|
|
1231
|
+
friendId: "ouro-external-event",
|
|
1232
|
+
channel: "external-event",
|
|
1233
|
+
key: originKey,
|
|
1234
|
+
content: (0, router_1.buildExternalEventMessage)(record),
|
|
1235
|
+
timestamp: Number.isFinite(parsedReceivedAt) ? parsedReceivedAt : Date.now(),
|
|
1236
|
+
delegatedFrom: {
|
|
1237
|
+
friendId: "ouro-external-event",
|
|
1238
|
+
channel: "external-event",
|
|
1239
|
+
key: originKey,
|
|
1240
|
+
},
|
|
1241
|
+
obligationStatus: "pending",
|
|
1242
|
+
mode: "relay",
|
|
1243
|
+
});
|
|
1244
|
+
(0, runtime_1.emitNervesEvent)({
|
|
1245
|
+
component: "daemon",
|
|
1246
|
+
event: "daemon.external_event_private_runtime_queued",
|
|
1247
|
+
message: "queued external event for private-runtime attention",
|
|
1248
|
+
meta: {
|
|
1249
|
+
agent: record.agent,
|
|
1250
|
+
source: record.source,
|
|
1251
|
+
eventType: record.eventType,
|
|
1252
|
+
eventId: record.eventId,
|
|
1253
|
+
pendingDir,
|
|
1254
|
+
},
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1257
|
+
async handlePrivateRuntimeWake(command, beforeDispatch) {
|
|
1226
1258
|
if (!this.hasManagedPrivateRuntime(command.agent)) {
|
|
1227
1259
|
return {
|
|
1228
1260
|
ok: false,
|
|
@@ -1240,6 +1272,7 @@ class OuroDaemon {
|
|
|
1240
1272
|
data: { decision },
|
|
1241
1273
|
};
|
|
1242
1274
|
}
|
|
1275
|
+
await beforeDispatch?.(decision);
|
|
1243
1276
|
await this.processManager.startAgent(command.agent);
|
|
1244
1277
|
this.processManager.sendToAgent?.(command.agent, this.buildPrivateRuntimeWorkerWakeMessage(command, decision));
|
|
1245
1278
|
return {
|
|
@@ -1475,7 +1508,7 @@ class OuroDaemon {
|
|
|
1475
1508
|
});
|
|
1476
1509
|
let wake = null;
|
|
1477
1510
|
if (command.wake !== false) {
|
|
1478
|
-
wake = await this.handlePrivateRuntimeWake(this.buildExternalEventPrivateWakeCommand(command, receipt.id));
|
|
1511
|
+
wake = await this.handlePrivateRuntimeWake(this.buildExternalEventPrivateWakeCommand(command, receipt.id), () => this.queueExternalEventForPrivateRuntime(record));
|
|
1479
1512
|
}
|
|
1480
1513
|
return {
|
|
1481
1514
|
ok: true,
|