Documentation
¶
Index ¶
- type ActionIntent
- type Clock
- type Engine
- func (e *Engine) AppendRecentEvent(state *WorldState, evt WorldEvent, maxRecent int)
- func (e *Engine) ApplyIntent(state *WorldState, npc *NPCState, intent ActionIntent) WorldDelta
- func (e *Engine) BuildUserEvent(state *WorldState, input, locationID, actorID string) WorldEvent
- func (e *Engine) EnsureNPCState(blueprint NPCBlueprint, state NPCState) NPCState
- func (e *Engine) EnsureWorld(state *WorldState)
- func (e *Engine) NextTick(state *WorldState) int64
- func (e *Engine) Snapshot(state WorldState, npcStates map[string]NPCState, recentEvents []WorldEvent, ...) SnapshotSummary
- func (e *Engine) VisibleEventsForNPC(state WorldState, npc NPCState, events []WorldEvent, scope int) []WorldEvent
- type Entity
- type EntityPlacement
- type GoalSet
- type Location
- type NPCBlueprint
- type NPCState
- type PlayerState
- type QuestState
- type RenderedResult
- type RoomState
- type SnapshotSummary
- type Store
- func (s *Store) AppendWorldEvent(evt WorldEvent) error
- func (s *Store) Events(limit int) ([]WorldEvent, error)
- func (s *Store) LoadNPCStates() (map[string]NPCState, error)
- func (s *Store) LoadWorldState() (WorldState, error)
- func (s *Store) SaveNPCState(id string, state NPCState) error
- func (s *Store) SaveNPCStates(items map[string]NPCState) error
- func (s *Store) SaveWorldState(state WorldState) error
- type WorldDelta
- type WorldEvent
- type WorldState
- type WorldTickRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionIntent ¶
type ActionIntent struct {
ActorID string `json:"actor_id"`
Action string `json:"action"`
TargetLocation string `json:"target_location,omitempty"`
TargetEntity string `json:"target_entity,omitempty"`
TargetAgent string `json:"target_agent,omitempty"`
Speech string `json:"speech,omitempty"`
InternalReasoningSummary string `json:"internal_reasoning_summary,omitempty"`
ProposedEffects map[string]interface{} `json:"proposed_effects,omitempty"`
}
type Engine ¶
type Engine struct{}
func (*Engine) AppendRecentEvent ¶
func (e *Engine) AppendRecentEvent(state *WorldState, evt WorldEvent, maxRecent int)
func (*Engine) ApplyIntent ¶
func (e *Engine) ApplyIntent(state *WorldState, npc *NPCState, intent ActionIntent) WorldDelta
func (*Engine) BuildUserEvent ¶
func (e *Engine) BuildUserEvent(state *WorldState, input, locationID, actorID string) WorldEvent
func (*Engine) EnsureNPCState ¶
func (e *Engine) EnsureNPCState(blueprint NPCBlueprint, state NPCState) NPCState
func (*Engine) EnsureWorld ¶
func (e *Engine) EnsureWorld(state *WorldState)
func (*Engine) NextTick ¶
func (e *Engine) NextTick(state *WorldState) int64
func (*Engine) Snapshot ¶
func (e *Engine) Snapshot(state WorldState, npcStates map[string]NPCState, recentEvents []WorldEvent, pendingIntents int, limit int) SnapshotSummary
func (*Engine) VisibleEventsForNPC ¶
func (e *Engine) VisibleEventsForNPC(state WorldState, npc NPCState, events []WorldEvent, scope int) []WorldEvent
type EntityPlacement ¶
type NPCBlueprint ¶
type NPCBlueprint struct {
NPCID string `json:"npc_id"`
DisplayName string `json:"display_name,omitempty"`
Kind string `json:"kind,omitempty"`
Role string `json:"role,omitempty"`
Persona string `json:"persona,omitempty"`
Traits []string `json:"traits,omitempty"`
Faction string `json:"faction,omitempty"`
HomeLocation string `json:"home_location,omitempty"`
DefaultGoals []string `json:"default_goals,omitempty"`
PerceptionScope int `json:"perception_scope,omitempty"`
ScheduleHint string `json:"schedule_hint,omitempty"`
WorldTags []string `json:"world_tags,omitempty"`
MemoryNamespace string `json:"memory_namespace,omitempty"`
PromptFile string `json:"prompt_file,omitempty"`
}
type NPCState ¶
type NPCState struct {
NPCID string `json:"npc_id"`
ProfileRef string `json:"profile_ref,omitempty"`
CurrentLocation string `json:"current_location,omitempty"`
Goals GoalSet `json:"goals,omitempty"`
Beliefs map[string]string `json:"beliefs,omitempty"`
Mood string `json:"mood,omitempty"`
Relationships map[string]string `json:"relationships,omitempty"`
Inventory map[string]int `json:"inventory,omitempty"`
Assets map[string]interface{} `json:"assets,omitempty"`
PrivateMemorySummary string `json:"private_memory_summary,omitempty"`
Status string `json:"status,omitempty"`
LastActiveTick int64 `json:"last_active_tick,omitempty"`
CurrentRoomID string `json:"current_room_id,omitempty"`
}
type PlayerState ¶
type QuestState ¶
type RenderedResult ¶
type RenderedResult struct {
Text string `json:"text,omitempty"`
Tick int64 `json:"tick,omitempty"`
Intents []ActionIntent `json:"intents,omitempty"`
RecentEvents []WorldEvent `json:"recent_events,omitempty"`
}
type RoomState ¶
type RoomState struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Kind string `json:"kind,omitempty"`
Status string `json:"status,omitempty"`
LocationID string `json:"location_id,omitempty"`
Model string `json:"model,omitempty"`
TaskSummary string `json:"task_summary,omitempty"`
LinkedQuestID string `json:"linked_quest_id,omitempty"`
AssignedNPCIDs []string `json:"assigned_npc_ids,omitempty"`
CreatedTick int64 `json:"created_tick,omitempty"`
UpdatedTick int64 `json:"updated_tick,omitempty"`
ReleaseOnFinish bool `json:"release_on_finish,omitempty"`
}
type SnapshotSummary ¶
type SnapshotSummary struct {
WorldID string `json:"world_id,omitempty"`
Tick int64 `json:"tick,omitempty"`
SimTimeUnix int64 `json:"sim_time_unix,omitempty"`
Player PlayerState `json:"player,omitempty"`
Locations map[string]Location `json:"locations,omitempty"`
Entities map[string]Entity `json:"entities,omitempty"`
NPCCount int `json:"npc_count,omitempty"`
ActiveNPCs []string `json:"active_npcs,omitempty"`
Quests []QuestState `json:"quests,omitempty"`
Rooms []RoomState `json:"rooms,omitempty"`
RecentEvents []WorldEvent `json:"recent_events,omitempty"`
PendingIntentCount int `json:"pending_intent_count,omitempty"`
Occupancy map[string][]string `json:"occupancy,omitempty"`
EntityOccupancy map[string][]string `json:"entity_occupancy,omitempty"`
RoomOccupancy map[string][]string `json:"room_occupancy,omitempty"`
NPCStates map[string]NPCState `json:"npc_states,omitempty"`
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AppendWorldEvent ¶
func (s *Store) AppendWorldEvent(evt WorldEvent) error
func (*Store) LoadWorldState ¶
func (s *Store) LoadWorldState() (WorldState, error)
func (*Store) SaveWorldState ¶
func (s *Store) SaveWorldState(state WorldState) error
type WorldDelta ¶
type WorldDelta struct {
Applied bool `json:"applied"`
Reason string `json:"reason,omitempty"`
Intent ActionIntent `json:"intent"`
Event *WorldEvent `json:"event,omitempty"`
NPCStateChanged bool `json:"npc_state_changed,omitempty"`
}
type WorldEvent ¶
type WorldEvent struct {
ID string `json:"id"`
Type string `json:"type"`
Source string `json:"source,omitempty"`
ActorID string `json:"actor_id,omitempty"`
LocationID string `json:"location_id,omitempty"`
Content string `json:"content,omitempty"`
VisibleTo []string `json:"visible_to,omitempty"`
Payload map[string]interface{} `json:"payload,omitempty"`
Tick int64 `json:"tick"`
CreatedAt int64 `json:"created_at"`
}
type WorldState ¶
type WorldState struct {
WorldID string `json:"world_id"`
Clock Clock `json:"clock"`
Player PlayerState `json:"player"`
Locations map[string]Location `json:"locations,omitempty"`
GlobalFacts map[string]interface{} `json:"global_facts,omitempty"`
Entities map[string]Entity `json:"entities,omitempty"`
Rooms map[string]RoomState `json:"rooms,omitempty"`
ActiveQuests map[string]QuestState `json:"active_quests,omitempty"`
RecentEvents []WorldEvent `json:"recent_events,omitempty"`
}
func DefaultWorldState ¶
func DefaultWorldState() WorldState
type WorldTickRequest ¶
type WorldTickRequest struct {
Source string `json:"source,omitempty"`
ActorID string `json:"actor_id,omitempty"`
UserInput string `json:"user_input,omitempty"`
LocationID string `json:"location_id,omitempty"`
ForceStep bool `json:"force_step,omitempty"`
CatchUpTicks int `json:"catch_up_ticks,omitempty"`
MaxNPCPerTick int `json:"max_npc_per_tick,omitempty"`
VisibleEvents []WorldEvent `json:"visible_events,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.