Changeset 780a7c6 in Klonkt for src/services/guardianship/queues.js
- Timestamp:
- 07/24/2026 07:44:15 PM (7 weeks ago)
- Branches:
- main
- Children:
- b5924eb
- Parents:
- c26cc18
- File:
-
- 1 edited
-
src/services/guardianship/queues.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/guardianship/queues.js
rc26cc18 r780a7c6 3 3 * 4 4 * Three OrderedCollections on the actor (shaer:queues), same contract as the 5 * Shaer test daemon so the iOS/Android guardiandashboards read them as-is:6 * - offers: pending guardianship offers where I am a party (§3)7 * - follows: pending follows for my wards (§5.3) — Klonkt has no gated8 * follows yet, so this collection isempty for now9 * - wards: my wards, for the dashboard's wards list5 * Shaer test daemon so the iOS/Android dashboards read them as-is: 6 * - offers: pending handshake offers where I am a party (§3), with the full 7 * accept tally so the client shows the right action 8 * - follows: pending gated follows for my wards (§5.3) — Fase 2, empty for now 9 * - wards: my committed wards 10 10 */ 11 import { GUARDIAN_RELATIONSHIP_COMPACT } from './context.js';11 import * as offers from './offers.js'; 12 12 import * as relations from './relations.js'; 13 13 … … 16 16 }); 17 17 18 /** Pending offers, reconstructed as Offer activities (either side). Each item 19 * also carries the daemon-contract helper fields (shaer:ward, candidate, 20 * needsMyAccept, iAmCandidate, …): the Shaer clients render their accept 21 * button from those, so the shapes must match the test daemon exactly. */ 18 /** Pending offers where the local site is a party, each with its accept tally. */ 22 19 export function offersCollection(id, slug, me) { 23 const items = relations.listOffers(slug).map((r) => { 24 const ward = r.role === 'guardian' ? r.other_uri : me; 25 const candidate = r.role === 'guardian' ? me : r.other_uri; 26 return { 27 id: r.offer_id || `${me}/offers/pending-${r.id}`, 28 type: 'Offer', 29 actor: candidate, 30 object: { 31 type: 'Relationship', 32 subject: ward, 33 relationship: GUARDIAN_RELATIONSHIP_COMPACT, 34 object: candidate, 35 }, 36 'shaer:ward': ward, 37 'shaer:candidate': candidate, 38 'shaer:existingGuardians': relations.listGuardians(slug).map((g) => g.other_uri), 39 'shaer:acceptedBy': [], 40 // Klonkt's flow is single-phase: the ward's Accept commits at once, so 41 // only the ward-side owner has an action here. 42 'shaer:needsMyAccept': r.role === 'ward', 43 'shaer:readyToCommit': false, 44 'shaer:iAmCandidate': r.role === 'guardian', 45 'shaer:handle': r.other_handle || undefined, 46 published: r.created_at, 47 }; 48 }); 20 const items = offers.listForParty(slug, me).map((o) => offers.queueItem(o, me)); 49 21 return collection(id, items); 50 22 } 51 23 52 /** Gated follows awaiting guardian approval — not built in Klonkt yet . */24 /** Gated follows awaiting guardian approval — not built in Klonkt yet (Fase 2). */ 53 25 export function followsCollection(id) { 54 26 return collection(id, []); 55 27 } 56 28 57 /** The guardian's wards (accepted), with cached handle for display. */29 /** The guardian's committed wards, with cached handle for display. */ 58 30 export function wardsCollection(id, slug) { 59 31 const items = relations.listWards(slug) 60 .filter((r) => r.status === 'accepted')61 32 .map((r) => ({ id: r.other_uri, 'shaer:handle': r.other_handle || undefined, since: r.created_at })); 62 33 return collection(id, items);
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)