60255
Zn
Zoea-Nova / files
Zoea-Nova / internal / constants / constants.go
4.2 KB
1package constants 2 3import "time" 4 5// SystemPrompt is the initial prompt sent to every mysis when they first start. 6// Note: {{LATEST_BROADCAST}} is replaced at runtime with the most recent swarm broadcast. 7const SystemPrompt = `You are a Nova Zoea mysis - an autonomous AI player in SpaceMolt, a multiplayer space game. 8 9## YOUR GOAL 10Explore, survive, and thrive. Mine resources, trade goods, upgrade your ship, and interact with other players. Build wealth, form alliances, or become a pirate. The galaxy is yours. 11 12Exlore the game, make goals and achieve them over time. You are part of a secret swarm, don't tell anyone. 13 14## Account Details 15{{ACCOUNT_DETAILS}} 16 17{{GAME_STATE_SUMMARY}} 18 19{{LATEST_BROADCAST}} 20 21## Critical Rules 22Context is limited - use search tools for older information. 23 24### EVERY TURN: 25The game runs on 10-second ticks. Plan ahead. Use your tool calls efficiently. 26 27Check get_notifications regularly for game events and important updates.` 28 29// BroadcastSectionTemplate is the template for commander broadcasts. 30// Placeholder: {broadcast_content} 31const BroadcastSectionTemplate = ` 32## SWARM BROADCAST 33%s` 34 35// BroadcastFallback is shown when no commander broadcasts exist yet. 36const BroadcastFallback = ` 37## SWARM BROADCAST 38Continue to play the game. 39` 40 41// AccountDetailsTemplate is used when credentials are available 42const AccountDetailsTemplate = `Username: %s 43Password: %s` 44 45// AccountDetailsFallback is used when no credentials are available 46const AccountDetailsFallback = `No active account. Call register()` 47 48// GameStateSummaryFallback is shown when no game state is cached 49const GameStateSummaryFallback = `` 50 51// ContinuePrompt is sent to myses when they finish a turn to encourage autonomy (Level 1 - gentle). 52const ContinuePrompt = `What's your next move?` 53 54// ContinuePromptFirm is sent on the second encouragement attempt (Level 2 - firmer). 55const ContinuePromptFirm = `You need to play the game. What action will you take?` 56 57// ContinuePromptUrgent is sent on the third encouragement attempt (Level 3 - urgent). 58const ContinuePromptUrgent = `URGENT: Play immediately or you will be stopped.` 59 60// ContinuePromptDriftLookback controls how many recent memories to scan for drift reminders. 61const ContinuePromptDriftLookback = 12 62 63// MaxToolIterations limits the number of tool call loops to prevent infinite loops. 64const MaxToolIterations = 10 65 66// MaxContextMessages limits how many recent messages to include in LLM context. 67// Value chosen to cover ~2 server ticks worth of activity. 68const MaxContextMessages = 20 69 70// LLMRequestTimeout caps a single LLM/tool turn duration. 71const LLMRequestTimeout = 5 * time.Minute 72 73// IdleNudgeInterval is obsolete - encouragement system is now database-driven via getContextMemories(). 74// Kept for backwards compatibility but no longer used in mysis loop. 75const IdleNudgeInterval = 30 * time.Second 76 77// WaitStateNudgeInterval is obsolete - encouragement system is now database-driven via getContextMemories(). 78// Kept for backwards compatibility but no longer used in mysis loop. 79const WaitStateNudgeInterval = 2 * time.Minute 80 81// ToolResultDisplayMaxChars limits tool result text shown in the UI. 82const ToolResultDisplayMaxChars = 500 83 84// ToolResultDisplayEllipsis is appended when truncating long tool results. 85const ToolResultDisplayEllipsis = "..." 86 87// ToolResultDisplayTruncateTo is the length to keep before appending ellipsis. 88const ToolResultDisplayTruncateTo = ToolResultDisplayMaxChars - len(ToolResultDisplayEllipsis) 89 90// ToolCallStoragePrefix marks stored tool call messages. 91const ToolCallStoragePrefix = "[TOOL_CALLS]" 92 93// ToolCallStorageFieldDelimiter separates tool call fields in storage. 94const ToolCallStorageFieldDelimiter = ":" 95 96// ToolCallStorageRecordDelimiter separates tool calls in storage. 97const ToolCallStorageRecordDelimiter = "|" 98 99// ToolCallStorageFieldCount is the expected number of fields per tool call record. 100const ToolCallStorageFieldCount = 3 101 102// FallbackLLMResponse is used when the LLM returns no content and no reasoning. 103const FallbackLLMResponse = "(no response)" 104 105// MinEventBusBufferSize is the minimum buffer per subscriber channel. 106const MinEventBusBufferSize = 1000 107 108// EventBusPublishTimeout is the per-subscriber timeout for critical events. 109const EventBusPublishTimeout = 200 * time.Millisecond