packages/server-shared/README.md
The shared type definitions for all server-side packages of Project AIRI.
ni @proj-airi/server-shared -D # from @antfu/ni, can be installed via `npm i -g @antfu/ni`
pnpm i @proj-airi/server-shared -D
yarn i @proj-airi/server-shared -D
npm i @proj-airi/server-shared -D
import type { WebSocketEvents } from '@proj-airi/server-shared'
spark:notify (kind=alarm, urgency=immediate, payload hp/location/gear, destinations=["character"]).spark:emit working ("Seen it").spark:command with interrupt=force and options (retreat vs push).spark:emit working ("Pillared up; healing") then done/blocked as it executes.context:update for summary/memory.spark:command to Minecraft (intent=plan, interrupt=soft, steps gather beds/pots/gear, fallback).context:update with tips (lane='game').spark:emit progress.spark:notify (alarm/immediate) to preempt.spark:command.spark:emit done + summary note.spark:notify (kind=reminder, urgency=soon, destinations=["character"]).spark:command (interrupt=soft, intent=plan: "gather food nearby").spark:emit queued/working then done.[!NOTE] Using
intent=plankeeps the loop alive even with un-finalized ideas—similar to TODO scaffolding in coding agents—while richer guidance is still being researched.
spark:command to Minecraft (interrupt=soft, intent=plan, steps to gather materials) so the agent keeps working.context:update (lane='game', hints/ideas) to enrich the sub-agent without preemption.spark:notify (alarm) → character responds with a short spark:emit working and a spark:command (interrupt=force) to handle it (e.g., retreat, block up).spark:command (intent=proposal (or action), interrupt=soft) with structured options/steps/fallbacks.spark:emit progress; when complete, character summarizes via spark:emit or context:update for memory.