hREA Integration
БесплатноБез исполняемых скриптовНе проверенThis skill should be used when working with hREA GraphQL integration, ValueFlows ontology mapping, proposal/intent creation, prerequisite management, or the…
от happenings-community★ 17 звёзд на GitHubОб этом скилле
hREA Integration
Patterns for the hREA (Holochain Resource-Event-Agent) GraphQL integration layer that maps local entities to ValueFlows economic ontology.
Key Reference Files
- hREA service:
ui/src/lib/services/hrea.service.ts - hREA store:
ui/src/lib/stores/hrea.store.svelte.ts - Request→Proposal mapper:
ui/src/lib/services/mappers/request-proposal.mapper.ts - Offer→Proposal mapper:
ui/src/lib/services/mappers/offer-proposal.mapper.ts - GraphQL queries:
ui/src/lib/graphql/queries/ - GraphQL mutations:
ui/src/lib/graphql/mutations/ - GraphQL fragments:
ui/src/lib/graphql/fragments/ - hREA types:
ui/src/lib/types/hrea.ts - hREA store test:
ui/tests/unit/stores/hrea.store.test.ts
Architecture Overview
Local Entities hREA Store (mapping layer) hREA DNA (GraphQL)
───────────── ────────────────────────── ──────────────────
UIUser → createPersonFromUser() → Agent
UIOrganization → createOrganizationFromOrg() → Agent
UIServiceType → createResourceSpecificationFromServiceType() → ResourceSpecification
UIMediumOfExch → createResourceSpecificationFromMediumOfExchange() → ResourceSpecification
UIRequest → createProposalFromRequest() → Proposal + Intents
UIOffer → createProposalFromOffer() → Proposal + Intents
The GraphQL layer uses @valueflows/vf-graphql-holochain + Apollo Client with SchemaLink.
Three Prerequisites for Proposals
Proposals require all three prerequisites to exist before creation:
- User agent — created when user is approved (
handleUserAcceptedevent) - Service type resource specs — created when service type is approved
- Medium of exchange resource specs — created when MoE is approved
If any prerequisite is missing, the request/offer is queued in pendingRequestQueue / pendingOfferQueue.
Pending Queue Mechanism
// When createProposalFromRequest fails due to missing prerequisites:
// → request is added to pendingRequestQueue
// → E.catchAll returns null (no error propagation)
// When ANY prerequisite is created (agent, resource spec):
// → retryPendingProposals() is called
// → all queued items are retried
// Event flow:
// user accepted → createPersonFromUser() → retryPendingProposals()
// service type approved → createResourceSpecificationFromServiceType() → retryPendingProposals()
// MoE approved → createResourceSpecificationFromMediumOfExchange() → retryPendingProposals()
Request→Proposal Mapping (Two-Intent Reciprocal Pattern)
Each request/offer creates a Proposal with one service intent per service type plus one payment intent:
Request "I need web development"
→ Proposal: name="Request: I need web development"
→ Service intent (primary, one per service type): action="work", receiver=requester's agent
resourceConformsTo = service type resource spec
→ Payment intent (reciprocal): action="transfer", provider=requester's agent
resourceConformsTo = medium of exchange resource spec
The intents are created first, then the proposal is created with publishes (primary intent IDs) and reciprocal (payment intent IDs); the adapter has no proposeIntent mutation.
Action Hash Reference Format
Mappings between local entities and hREA entities use note fields:
ref:user:<actionHash> — on Agent.note
ref:organization:<actionHash> — on Agent.note
ref:serviceType:<actionHash> — on ResourceSpecification.note
ref:mediumOfExchange:<actionHash> — on ResourceSpecification.note
Lookup: extractActionHashFromNote(note, entityType) extracts the hash.
Error Handling
- List queries: proposal and intent list queries are plain queries with no defensive
E.catchAll; errors propagate asHreaError - Prerequisite detection:
createProposalFromRequest/createProposalFromOfferuseE.catchAll(notE.tapError): queue on a missing-prerequisite error, returnnull - Initialization:
createPerson()callsinitialize()internally — don't call separately - GraphQL normalization: Responses need
normalizeIntentResponse()/normalizeProposalResponse()because GraphQL returns nested objects
Store State
// Mapping stores (local hash → hREA ID)
userAgentMappings: Map<string, string> // userHash → agentId
organizationAgentMappings: Map<string, string> // orgHash → agentId
serviceTypeResourceSpecMappings: Map<string, string> // stHash → resourceSpecId
mediumOfExchangeResourceSpecMappings: Map<string, string> // moeHash → resourceSpecId
requestProposalMappings: Map<string, string> // requestHash → proposalId
offerProposalMappings: Map<string, string> // offerHash → proposalId
// Entity arrays
agents: Agent[]
resourceSpecifications: ResourceSpecification[]
proposals: Proposal[]
intents: Intent[]
// Queue (pending it
Установить hREA Integration в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл hREA Integration?
This skill should be used when working with hREA GraphQL integration, ValueFlows ontology mapping, proposal/intent creation, prerequisite management, or the pending queue system
Как установить скилл hREA Integration?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл hREA Integration запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic