Changeset af5b79b in Klonkt for src/services/guardianship
- Timestamp:
- 07/25/2026 08:37:24 AM (7 weeks ago)
- Branches:
- main
- Children:
- 2b4252c
- Parents:
- 8f520e0
- Location:
- src/services/guardianship
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/services/guardianship/index.js
r8f520e0 raf5b79b 16 16 */ 17 17 export { SHAER_CONTEXT, GUARDIAN_RELATIONSHIP, GUARDIAN_RELATIONSHIP_COMPACT, isGuardianRelationship } from './context.js'; 18 export { helpRequestProps, isHelpRequest, waveProps, isWave } from './notes.js';18 export { helpRequestProps, isHelpRequest, waveProps, isWave, hasGuardiansProps, objectHasGuardians } from './notes.js'; 19 19 export { wireDelivery, c2sVisibility, deliverDirectNote } from './delivery.js'; 20 20 export { wireHandshake, handleOutbox as handleGuardianshipOutbox, handleInbox as handleGuardianshipInbox, parseRelationship } from './handshake.js'; -
src/services/guardianship/notes.js
r8f520e0 raf5b79b 5 5 * on direct notes. Everyone who does not speak shaer can ignore it. 6 6 */ 7 import { listGuardians } from './relations.js'; 8 9 /** 10 * shaer:hasGuardians (§2.2): an advisory OBJECT hint that the author is a ward, 11 * so a remote server can route interactions to the guardians WITHOUT fetching 12 * the actor. Stamped on every object a ward publishes; MUST be safely ignorable. 13 */ 14 export function hasGuardiansProps(slug) { 15 try { return (slug && listGuardians(slug).length) ? { 'shaer:hasGuardians': true } : {}; } 16 catch { return {}; } 17 } 18 19 /** True when an incoming object carries the ward hint (§2.2). Register-only for 20 * now; acted on later at reddings-boei / escalation routing. */ 21 export function objectHasGuardians(o) { 22 return !!o && (o['shaer:hasGuardians'] === true || o.hasGuardians === true); 23 } 7 24 8 25 /** Extra JSON-LD properties for an outgoing note built from an ap_outbox row. */ … … 31 48 } 32 49 33 export default { helpRequestProps, isHelpRequest, waveProps, isWave };50 export default { helpRequestProps, isHelpRequest, waveProps, isWave, hasGuardiansProps, objectHasGuardians };
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)