parawatch 0.3.12 → 0.3.13
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/core/ops.js +26 -2
- package/package.json +1 -1
package/dist/core/ops.js
CHANGED
|
@@ -719,7 +719,7 @@ export function inboxScope(opts, session) {
|
|
|
719
719
|
// A lead waiting on its project from a session: what other live sessions own is theirs. It
|
|
720
720
|
// takes over the project cursor once, so it does not hear again what that wait delivered.
|
|
721
721
|
const mine = readCursor(consumer);
|
|
722
|
-
const merged = furthest(mine, readCursor(opts.project));
|
|
722
|
+
const merged = furthest(Object.keys(mine).length ? mine : bornAt(session), readCursor(opts.project));
|
|
723
723
|
if (JSON.stringify(merged) !== JSON.stringify(mine))
|
|
724
724
|
writeCursor(consumer, merged);
|
|
725
725
|
return { consumer, filter: { session, project: opts.project } };
|
|
@@ -728,12 +728,36 @@ export function inboxScope(opts, session) {
|
|
|
728
728
|
// A session that used to wait on its project starts where that wait stopped, so moving to its
|
|
729
729
|
// own cursor does not bring back news it has already handled.
|
|
730
730
|
if (claim && !Object.keys(readCursor(consumer)).length) {
|
|
731
|
-
const from = readCursor(claim.project);
|
|
731
|
+
const from = furthest(bornAt(session), readCursor(claim.project));
|
|
732
732
|
if (Object.keys(from).length)
|
|
733
733
|
writeCursor(consumer, from);
|
|
734
734
|
}
|
|
735
735
|
return { consumer, filter: { session, project: claim?.project } };
|
|
736
736
|
}
|
|
737
|
+
/**
|
|
738
|
+
* Where a session's first wait starts: just before the session first shows in the log (a claim,
|
|
739
|
+
* a card it opened, a pull request linked to it, something handed to it). Nothing before that was
|
|
740
|
+
* its to act on, and a lead starting at the top of the log would hear every old pull request and
|
|
741
|
+
* answer of the project again. A session the log has not seen starts at the top; it has nothing
|
|
742
|
+
* of its own and no project yet.
|
|
743
|
+
*/
|
|
744
|
+
export function bornAt(session, events = readEvents()) {
|
|
745
|
+
const i = events.findIndex((ev) => {
|
|
746
|
+
switch (ev.type) {
|
|
747
|
+
case "run.claim":
|
|
748
|
+
return sameSession(ev.claim.session, session);
|
|
749
|
+
case "card.open":
|
|
750
|
+
return sameSession(ev.card.session, session);
|
|
751
|
+
case "pr.link":
|
|
752
|
+
return sameSession(ev.link.session, session);
|
|
753
|
+
case "card.hand":
|
|
754
|
+
return sameSession(ev.session, session);
|
|
755
|
+
default:
|
|
756
|
+
return false;
|
|
757
|
+
}
|
|
758
|
+
});
|
|
759
|
+
return i < 0 ? {} : advance({}, events.slice(0, i));
|
|
760
|
+
}
|
|
737
761
|
export function readInbox(consumer, filter, move) {
|
|
738
762
|
const events = readEvents();
|
|
739
763
|
const pos = readCursor(consumer);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "parawatch",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.13",
|
|
4
4
|
"description": "A control tower for people running many AI coding agents in parallel: see what is running, what needs you, and wake the right agent when you answer.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agents",
|