@astrosheep/square 0.3.103 → 0.3.104
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.
|
@@ -8,7 +8,9 @@ export declare function renderPendingAtBoundary(inbox: PendingMembership[]): str
|
|
|
8
8
|
* `lookup` returns the session's memberships for this boundary. It may reuse an observation it has
|
|
9
9
|
* verified against the current presence binding and artifact revision; the boundary still projects
|
|
10
10
|
* presentation evidence live. Every item is claimed and revalidated before the batch sink;
|
|
11
|
-
* after success, captured-seat commits record
|
|
11
|
+
* after success, captured-seat commits record the winning batch, including budget omissions as
|
|
12
|
+
* clipped (no consumption receipt), without an eligibility veto. Coverage is conservative if a
|
|
13
|
+
* competing claim's removal lets a previously omitted body fit in the final preview.
|
|
12
14
|
* A source that cannot verify its reuse must read the inbox again.
|
|
13
15
|
*/
|
|
14
16
|
export declare function presentPendingAtBoundary<T>(identity: Owner, present: (context: string, delivered: PendingMembership[]) => T | Promise<T>, lookup?: (identity: Owner, env?: NodeJS.ProcessEnv, signal?: AbortSignal) => Promise<PendingMembership[]> | PendingMembership[], env?: NodeJS.ProcessEnv, signal?: AbortSignal): Promise<T | undefined>;
|
|
@@ -17,11 +17,14 @@ function renderBoundary(inbox) {
|
|
|
17
17
|
const agoraBlocks = [];
|
|
18
18
|
const deliveries = [];
|
|
19
19
|
let remainingAgora = queued.filter(({ notification }) => notification.delivery?.mode !== 'direct').length;
|
|
20
|
-
const
|
|
20
|
+
const entries = [];
|
|
21
21
|
let omitted = 0;
|
|
22
22
|
const omission = (count) => `${count} more ${count === 1 ? 'activity' : 'activities'} not shown.`;
|
|
23
23
|
for (const entry of queued) {
|
|
24
24
|
const { membership, notification } = entry;
|
|
25
|
+
// The omission line represents the rest of this batch too, but never consumes its bodies.
|
|
26
|
+
const coverage = { membership, actIndex: notification.actIndex, markSeen: false };
|
|
27
|
+
entries.push(coverage);
|
|
25
28
|
const block = renderAttentionPreview({
|
|
26
29
|
squarePath: membership.location,
|
|
27
30
|
actIndex: notification.actIndex,
|
|
@@ -43,15 +46,11 @@ function renderBoundary(inbox) {
|
|
|
43
46
|
}
|
|
44
47
|
blocks.push(block);
|
|
45
48
|
deliveries.push(notification.delivery);
|
|
46
|
-
|
|
47
|
-
membership,
|
|
48
|
-
actIndex: notification.actIndex,
|
|
49
|
-
markSeen: !attentionBodyIsClipped(notification.body, notification.delivery),
|
|
50
|
-
});
|
|
49
|
+
coverage.markSeen = !attentionBodyIsClipped(notification.body, notification.delivery);
|
|
51
50
|
}
|
|
52
51
|
return {
|
|
53
52
|
context: renderSquareReminder([...blocks, ...(omitted > 0 ? [omission(omitted)] : [])], deliveries),
|
|
54
|
-
|
|
53
|
+
entries,
|
|
55
54
|
};
|
|
56
55
|
}
|
|
57
56
|
async function presentPendingAtBoundaryUnlocked(identity, present, lookup = sessionInbox, env = process.env, signal) {
|
|
@@ -66,7 +65,7 @@ async function presentPendingAtBoundaryUnlocked(identity, present, lookup = sess
|
|
|
66
65
|
try {
|
|
67
66
|
try {
|
|
68
67
|
// Enumeration owns discovery/connections only; returned handles belong to the common runner.
|
|
69
|
-
for (const entry of renderBoundary(pending).
|
|
68
|
+
for (const entry of renderBoundary(pending).entries) {
|
|
70
69
|
const { location, seat } = entry.membership;
|
|
71
70
|
let artifact = artifacts.get(location);
|
|
72
71
|
if (artifact === undefined) {
|
|
@@ -90,10 +89,7 @@ async function presentPendingAtBoundaryUnlocked(identity, present, lookup = sess
|
|
|
90
89
|
const delivered = pending.map(membership => ({ ...membership,
|
|
91
90
|
notifications: membership.notifications.filter(note => eligible.has(pendingKey(membership, note.actIndex))),
|
|
92
91
|
})).filter(membership => membership.notifications.length > 0);
|
|
93
|
-
|
|
94
|
-
const included = new Set(fresh.complete.map(entry => pendingKey(entry.membership, entry.actIndex)));
|
|
95
|
-
return { payload: { context: fresh.context, delivered },
|
|
96
|
-
included: claims.filter(({ key }) => included.has(key)).map(({ claim }) => claim) };
|
|
92
|
+
return { payload: { context: renderBoundary(delivered).context, delivered }, included: eligibleClaims };
|
|
97
93
|
}, payload => present(payload.context, payload.delivered), { signal });
|
|
98
94
|
if (report.observation.kind === 'threw')
|
|
99
95
|
throw report.observation.error;
|
|
@@ -112,7 +108,9 @@ async function presentPendingAtBoundaryUnlocked(identity, present, lookup = sess
|
|
|
112
108
|
* `lookup` returns the session's memberships for this boundary. It may reuse an observation it has
|
|
113
109
|
* verified against the current presence binding and artifact revision; the boundary still projects
|
|
114
110
|
* presentation evidence live. Every item is claimed and revalidated before the batch sink;
|
|
115
|
-
* after success, captured-seat commits record
|
|
111
|
+
* after success, captured-seat commits record the winning batch, including budget omissions as
|
|
112
|
+
* clipped (no consumption receipt), without an eligibility veto. Coverage is conservative if a
|
|
113
|
+
* competing claim's removal lets a previously omitted body fit in the final preview.
|
|
116
114
|
* A source that cannot verify its reuse must read the inbox again.
|
|
117
115
|
*/
|
|
118
116
|
export async function presentPendingAtBoundary(identity, present, lookup = sessionInbox, env = process.env, signal) {
|
|
@@ -10,7 +10,10 @@ Pi injection and external wake injection acquire mutually exclusive artifact-own
|
|
|
10
10
|
An accepted or uncertain Paseo wake suppresses native Pi reinjection without asserting presentation
|
|
11
11
|
or consumption. Only proven failed/released attempts can return to the automatic queue. Missing
|
|
12
12
|
landing events, thrown sinks and expired claims do not authorize replay. Renderer details describe
|
|
13
|
-
only the batch that won custody, not the earlier observed inbox.
|
|
13
|
+
only the batch that won custody, not the earlier observed inbox. Budget-omitted activities belong to
|
|
14
|
+
that same delivered batch: the omission line settles their presentation as `clipped`, without a
|
|
15
|
+
full-consumption receipt. They stay available to explicit catch, but never get paged into later
|
|
16
|
+
model completions or replayed on extension reload. See `delivery-primitives.md`.
|
|
14
17
|
|
|
15
18
|
For independent existing-session delivery, opt into its local receiver:
|
|
16
19
|
|
package/package.json
CHANGED