@sema-agent/core 1.330.0 → 1.332.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/dist/agents/subagent.d.ts.map +1 -1
- package/dist/agents/subagent.js +68 -5
- package/dist/agents/subagent.js.map +1 -1
- package/dist/core/runner/prepare-task.d.ts +1 -1
- package/dist/core/runner/prepare-task.d.ts.map +1 -1
- package/dist/core/runner/runtask.d.ts.map +1 -1
- package/dist/core/runner/runtask.js +20 -9
- package/dist/core/runner/runtask.js.map +1 -1
- package/dist/core/task-notification.d.ts +1 -0
- package/dist/core/task-notification.d.ts.map +1 -1
- package/dist/core/task-notification.js.map +1 -1
- package/dist/core/task-registry.d.ts +38 -5
- package/dist/core/task-registry.d.ts.map +1 -1
- package/dist/core/task-registry.js +134 -21
- package/dist/core/task-registry.js.map +1 -1
- package/package.json +1 -1
|
@@ -652,27 +652,38 @@ export class Runner {
|
|
|
652
652
|
const deliver = item.priority === "later"
|
|
653
653
|
? notificationHarness.followUp(xml, { provenance: "engine-note" })
|
|
654
654
|
: notificationHarness.steer(xml, { provenance: "engine-note" });
|
|
655
|
-
void deliver.
|
|
655
|
+
void deliver.then(() => item.onDisposition?.("queued"), () => {
|
|
656
656
|
if (notificationSessionId !== undefined)
|
|
657
657
|
this.pendingSessionNotifications.pend(notificationSessionId, item.payload);
|
|
658
|
+
item.onDisposition?.("parked");
|
|
658
659
|
});
|
|
659
660
|
}
|
|
661
|
+
else {
|
|
662
|
+
if (notificationSessionId !== undefined)
|
|
663
|
+
this.pendingSessionNotifications.pend(notificationSessionId, item.payload);
|
|
664
|
+
item.onDisposition?.("parked");
|
|
665
|
+
}
|
|
660
666
|
});
|
|
661
667
|
const upstreamTaskNotification = internals?.onTaskNotification;
|
|
662
668
|
const deliveredAtTurnOpen = new Set();
|
|
663
669
|
const injectTaskNotification = (notification, opts) => {
|
|
664
670
|
if (deliveredAtTurnOpen.has(taskNotificationDedupKey(notification)))
|
|
665
|
-
return;
|
|
671
|
+
return Promise.resolve("dropped_duplicate");
|
|
666
672
|
if (!notificationLaneLive) {
|
|
667
673
|
if (notificationSessionId !== undefined)
|
|
668
674
|
this.pendingSessionNotifications.pend(notificationSessionId, notification);
|
|
669
|
-
return;
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
675
|
+
return Promise.resolve("parked");
|
|
676
|
+
}
|
|
677
|
+
return new Promise((resolve) => {
|
|
678
|
+
const accepted = taskNotificationQueue.enqueue({
|
|
679
|
+
kind: "task_notification",
|
|
680
|
+
priority: opts?.priority ?? "later",
|
|
681
|
+
dedupKey: taskNotificationDedupKey(notification),
|
|
682
|
+
payload: notification,
|
|
683
|
+
onDisposition: resolve,
|
|
684
|
+
});
|
|
685
|
+
if (!accepted)
|
|
686
|
+
resolve("queued");
|
|
676
687
|
});
|
|
677
688
|
};
|
|
678
689
|
const prepared = await prepareTask(spec, this.deps, this.sessions, prepareResume, memorySelector, {
|