Documentation
¶
Index ¶
- Variables
- type AgentInfo
- type Anomaly
- type Base
- type BaseMarketItem
- type BestPrice
- type BuildMaterial
- type CargoEntry
- type CatalogItem
- type Config
- type ConnectionMetrics
- type DangerZone
- type DepletingResource
- type Experience
- type Facility
- type KnowledgeExport
- type KnowledgeExportMeta
- type MapSystemData
- type MarketAnalysis
- type MarketListing
- type MarketSnapshot
- type MemoryKB
- func (kb *MemoryKB) AddExperience(ctx context.Context, agentID, expType, description, outcome, location string) error
- func (kb *MemoryKB) AnalyzePriceTrends(ctx context.Context, itemID, stationID string, windowHours int) (*PriceTrend, error)
- func (kb *MemoryKB) Close() error
- func (kb *MemoryKB) ExportKnowledge(ctx context.Context, description string, agentID string) (*KnowledgeExport, error)
- func (kb *MemoryKB) FindBestPrices(ctx context.Context, itemID string, listingType string, limit int) ([]BestPrice, error)
- func (kb *MemoryKB) FindCheapestRoute(ctx context.Context, fromSystem, toSystem string, maxHops int) ([]string, float64, error)
- func (kb *MemoryKB) GetActiveAnomalies(ctx context.Context, systemID string) ([]Anomaly, error)
- func (kb *MemoryKB) GetAnomaliesByType(ctx context.Context, anomalyType, severity string, limit int) ([]Anomaly, error)
- func (kb *MemoryKB) GetBase(ctx context.Context, baseID string) (*SpaceBase, error)
- func (kb *MemoryKB) GetBaseByPOI(ctx context.Context, poiID string) (*SpaceBase, error)
- func (kb *MemoryKB) GetDangerZones(ctx context.Context, minDangerLevel int) ([]DangerZone, error)
- func (kb *MemoryKB) GetDepletingResources(ctx context.Context, threshold float64) ([]DepletingResource, error)
- func (kb *MemoryKB) GetItem(ctx context.Context, itemID string) (*CatalogItem, error)
- func (kb *MemoryKB) GetItems(ctx context.Context) ([]CatalogItem, error)
- func (kb *MemoryKB) GetItemsByCategory(ctx context.Context, category string) ([]CatalogItem, error)
- func (kb *MemoryKB) GetLatestMarketAnalysis(ctx context.Context, systemID, stationID string) (*MarketAnalysis, error)
- func (kb *MemoryKB) GetLatestMarketSnapshot(ctx context.Context, systemID, stationID string) (*MarketSnapshot, error)
- func (kb *MemoryKB) GetLatestShipListings(ctx context.Context, systemID, stationID string) (*ShipListings, error)
- func (kb *MemoryKB) GetMarketAnalysisHistory(ctx context.Context, systemID, stationID string, limit int) ([]MarketAnalysis, error)
- func (kb *MemoryKB) GetMarketItems(ctx context.Context, itemType string) ([]string, error)
- func (kb *MemoryKB) GetMarketSnapshots(ctx context.Context, systemID, stationID string, limit int) ([]MarketSnapshot, error)
- func (kb *MemoryKB) GetMissionTemplates(ctx context.Context, baseID string) ([]MissionTemplate, error)
- func (kb *MemoryKB) GetOptimalRoute(ctx context.Context, fromSystem, toSystem string) (*ConnectionMetrics, error)
- func (kb *MemoryKB) GetPOIs(ctx context.Context, systemID string) ([]POI, error)
- func (kb *MemoryKB) GetPlayer(ctx context.Context, playerID string) (*PlayerRecord, error)
- func (kb *MemoryKB) GetPlayerShips(ctx context.Context, playerID string) ([]ShipRecord, error)
- func (kb *MemoryKB) GetPlayerSkills(ctx context.Context, playerID string) ([]PlayerSkillRecord, error)
- func (kb *MemoryKB) GetPriceHistory(ctx context.Context, itemID, stationID string, limit int) ([]PricePoint, error)
- func (kb *MemoryKB) GetRecentExperiences(ctx context.Context, agentID string, limit int) ([]Experience, error)
- func (kb *MemoryKB) GetRecipe(ctx context.Context, recipeID string) (*RecipeDef, error)
- func (kb *MemoryKB) GetRecipes(ctx context.Context) ([]RecipeDef, error)
- func (kb *MemoryKB) GetRecipesByCategory(ctx context.Context, category string) ([]RecipeDef, error)
- func (kb *MemoryKB) GetResourceHistory(ctx context.Context, poiID, resourceID string, limit int) ([]ResourceHistory, error)
- func (kb *MemoryKB) GetShip(ctx context.Context, shipID string) (*ShipRecord, error)
- func (kb *MemoryKB) GetShipClass(ctx context.Context, classID string) (*ShipClassDef, error)
- func (kb *MemoryKB) GetShipClasses(ctx context.Context) ([]ShipClassDef, error)
- func (kb *MemoryKB) GetShipClassesByCategory(ctx context.Context, category string) ([]ShipClassDef, error)
- func (kb *MemoryKB) GetShipListings(ctx context.Context, systemID, stationID string, limit int) ([]ShipListings, error)
- func (kb *MemoryKB) GetSkill(id string) (*Skill, error)
- func (kb *MemoryKB) GetSkills() []Skill
- func (kb *MemoryKB) GetSystem(ctx context.Context, systemID string) (*System, error)
- func (kb *MemoryKB) GetSystemDanger(ctx context.Context, systemID string) (*DangerZone, error)
- func (kb *MemoryKB) GetSystems() []System
- func (kb *MemoryKB) GetUnknownConnections(ctx context.Context, systemID string) ([]string, error)
- func (kb *MemoryKB) HasMarketSnapshotToday(ctx context.Context, systemID, stationID string) (bool, error)
- func (kb *MemoryKB) HasShipListingsToday(ctx context.Context, systemID, stationID string) (bool, error)
- func (kb *MemoryKB) ImportKnowledge(ctx context.Context, exportData string) error
- func (kb *MemoryKB) ListExports(ctx context.Context) ([]KnowledgeExportMeta, error)
- func (kb *MemoryKB) RecordAnomaly(ctx context.Context, anomaly Anomaly) error
- func (kb *MemoryKB) RecordHostileEncounter(ctx context.Context, systemID string, encounterType string, details string) error
- func (kb *MemoryKB) RecordJourney(ctx context.Context, fromSystem, toSystem string, fuelCost, travelTime float64, ...) error
- func (kb *MemoryKB) RecordResourceState(ctx context.Context, poiID, resourceID string, richness, remaining float64, ...) error
- func (kb *MemoryKB) RegisterAgent(ctx context.Context, agentID, name, role, empire string, personality []byte) error
- func (kb *MemoryKB) RememberBase(ctx context.Context, base SpaceBase) error
- func (kb *MemoryKB) RememberConnection(ctx context.Context, fromSystem, toSystem string) error
- func (kb *MemoryKB) RememberPOI(ctx context.Context, poi POI) error
- func (kb *MemoryKB) RememberSystem(ctx context.Context, sys System) error
- func (kb *MemoryKB) ResolveAnomaly(ctx context.Context, anomalyID int64, status string) error
- func (kb *MemoryKB) StoreItems(ctx context.Context, items []CatalogItem) error
- func (kb *MemoryKB) StoreMarketAnalysis(ctx context.Context, analysis MarketAnalysis, agentID string) error
- func (kb *MemoryKB) StoreMarketSnapshot(ctx context.Context, snapshot MarketSnapshot, agentID string) error
- func (kb *MemoryKB) StoreMissionTemplates(ctx context.Context, baseID string, missions []MissionTemplate) error
- func (kb *MemoryKB) StorePlayer(ctx context.Context, player PlayerRecord) error
- func (kb *MemoryKB) StorePlayerSkills(ctx context.Context, playerID string, skills []PlayerSkillRecord) error
- func (kb *MemoryKB) StoreRecipes(ctx context.Context, recipes []RecipeDef) error
- func (kb *MemoryKB) StoreShip(ctx context.Context, ship ShipRecord) error
- func (kb *MemoryKB) StoreShipClasses(ctx context.Context, classes []ShipClassDef) error
- func (kb *MemoryKB) StoreShipListings(ctx context.Context, listings ShipListings, agentID string) error
- func (kb *MemoryKB) StoreSkills(ctx context.Context, skills []Skill) error
- type Migration
- type MissionObjectiveRecord
- type MissionTemplate
- type POI
- type PlayerRecord
- type PlayerSkillRecord
- type PlayerStatsRecord
- type PricePoint
- type PriceTrend
- type RecipeDef
- type RecipeIngredient
- type RecipeProduct
- type ResourceHistory
- type SQLiteKB
- func (kb *SQLiteKB) AddExperience(ctx context.Context, agentID, expType, description, outcome, location string) error
- func (kb *SQLiteKB) AnalyzePriceTrends(ctx context.Context, itemID, stationID string, windowHours int) (*PriceTrend, error)
- func (kb *SQLiteKB) Close() error
- func (kb *SQLiteKB) ExportKnowledge(ctx context.Context, description string, agentID string) (*KnowledgeExport, error)
- func (kb *SQLiteKB) FindBestPrices(ctx context.Context, itemID string, listingType string, limit int) ([]BestPrice, error)
- func (kb *SQLiteKB) FindCheapestRoute(ctx context.Context, fromSystem, toSystem string, maxHops int) ([]string, float64, error)
- func (kb *SQLiteKB) GetActiveAnomalies(ctx context.Context, systemID string) ([]Anomaly, error)
- func (kb *SQLiteKB) GetAnomaliesByType(ctx context.Context, anomalyType, severity string, limit int) ([]Anomaly, error)
- func (kb *SQLiteKB) GetBase(ctx context.Context, baseID string) (*SpaceBase, error)
- func (kb *SQLiteKB) GetBaseByPOI(ctx context.Context, poiID string) (*SpaceBase, error)
- func (kb *SQLiteKB) GetDangerZones(ctx context.Context, minDangerLevel int) ([]DangerZone, error)
- func (kb *SQLiteKB) GetDepletingResources(ctx context.Context, threshold float64) ([]DepletingResource, error)
- func (kb *SQLiteKB) GetItem(ctx context.Context, itemID string) (*CatalogItem, error)
- func (kb *SQLiteKB) GetItems(ctx context.Context) ([]CatalogItem, error)
- func (kb *SQLiteKB) GetItemsByCategory(ctx context.Context, category string) ([]CatalogItem, error)
- func (kb *SQLiteKB) GetLatestMarketAnalysis(ctx context.Context, systemID, stationID string) (*MarketAnalysis, error)
- func (kb *SQLiteKB) GetLatestMarketSnapshot(ctx context.Context, systemID, stationID string) (*MarketSnapshot, error)
- func (kb *SQLiteKB) GetLatestShipListings(ctx context.Context, systemID, stationID string) (*ShipListings, error)
- func (kb *SQLiteKB) GetMarketAnalysisHistory(ctx context.Context, systemID, stationID string, limit int) ([]MarketAnalysis, error)
- func (kb *SQLiteKB) GetMarketItems(ctx context.Context, itemType string) ([]string, error)
- func (kb *SQLiteKB) GetMarketSnapshots(ctx context.Context, systemID, stationID string, limit int) ([]MarketSnapshot, error)
- func (kb *SQLiteKB) GetMissionTemplates(ctx context.Context, baseID string) ([]MissionTemplate, error)
- func (kb *SQLiteKB) GetOptimalRoute(ctx context.Context, fromSystem, toSystem string) (*ConnectionMetrics, error)
- func (kb *SQLiteKB) GetPOIs(ctx context.Context, systemID string) ([]POI, error)
- func (kb *SQLiteKB) GetPlayer(ctx context.Context, playerID string) (*PlayerRecord, error)
- func (kb *SQLiteKB) GetPlayerShips(ctx context.Context, playerID string) ([]ShipRecord, error)
- func (kb *SQLiteKB) GetPlayerSkills(ctx context.Context, playerID string) ([]PlayerSkillRecord, error)
- func (kb *SQLiteKB) GetPriceHistory(ctx context.Context, itemID, stationID string, limit int) ([]PricePoint, error)
- func (kb *SQLiteKB) GetRecentExperiences(ctx context.Context, agentID string, limit int) ([]Experience, error)
- func (kb *SQLiteKB) GetRecipe(ctx context.Context, recipeID string) (*RecipeDef, error)
- func (kb *SQLiteKB) GetRecipes(ctx context.Context) ([]RecipeDef, error)
- func (kb *SQLiteKB) GetRecipesByCategory(ctx context.Context, category string) ([]RecipeDef, error)
- func (kb *SQLiteKB) GetResourceHistory(ctx context.Context, poiID, resourceID string, limit int) ([]ResourceHistory, error)
- func (kb *SQLiteKB) GetShip(ctx context.Context, shipID string) (*ShipRecord, error)
- func (kb *SQLiteKB) GetShipClass(ctx context.Context, classID string) (*ShipClassDef, error)
- func (kb *SQLiteKB) GetShipClasses(ctx context.Context) ([]ShipClassDef, error)
- func (kb *SQLiteKB) GetShipClassesByCategory(ctx context.Context, category string) ([]ShipClassDef, error)
- func (kb *SQLiteKB) GetShipListings(ctx context.Context, systemID, stationID string, limit int) ([]ShipListings, error)
- func (kb *SQLiteKB) GetSkill(id string) (*Skill, error)
- func (kb *SQLiteKB) GetSkills() []Skill
- func (kb *SQLiteKB) GetSystem(ctx context.Context, systemID string) (*System, error)
- func (kb *SQLiteKB) GetSystemDanger(ctx context.Context, systemID string) (*DangerZone, error)
- func (kb *SQLiteKB) GetSystems() []System
- func (kb *SQLiteKB) GetUnknownConnections(ctx context.Context, systemID string) ([]string, error)
- func (kb *SQLiteKB) HasMarketSnapshotToday(ctx context.Context, systemID, stationID string) (bool, error)
- func (kb *SQLiteKB) HasShipListingsToday(ctx context.Context, systemID, stationID string) (bool, error)
- func (kb *SQLiteKB) ImportKnowledge(ctx context.Context, exportData string) error
- func (kb *SQLiteKB) ListExports(ctx context.Context) ([]KnowledgeExportMeta, error)
- func (kb *SQLiteKB) RecordAnomaly(ctx context.Context, anomaly Anomaly) error
- func (kb *SQLiteKB) RecordHostileEncounter(ctx context.Context, systemID string, encounterType string, details string) error
- func (kb *SQLiteKB) RecordJourney(ctx context.Context, fromSystem, toSystem string, fuelCost, travelTime float64, ...) error
- func (kb *SQLiteKB) RecordResourceState(ctx context.Context, poiID, resourceID string, richness, remaining float64, ...) error
- func (kb *SQLiteKB) RegisterAgent(ctx context.Context, agentID, name, role, empire string, personality []byte) error
- func (kb *SQLiteKB) RememberBase(ctx context.Context, base SpaceBase) error
- func (kb *SQLiteKB) RememberConnection(ctx context.Context, fromSystem, toSystem string) error
- func (kb *SQLiteKB) RememberPOI(ctx context.Context, poi POI) error
- func (kb *SQLiteKB) RememberSystem(ctx context.Context, sys System) error
- func (kb *SQLiteKB) ResolveAnomaly(ctx context.Context, anomalyID int64, status string) error
- func (kb *SQLiteKB) StoreItems(ctx context.Context, items []CatalogItem) error
- func (kb *SQLiteKB) StoreMarketAnalysis(ctx context.Context, analysis MarketAnalysis, agentID string) error
- func (kb *SQLiteKB) StoreMarketSnapshot(ctx context.Context, snapshot MarketSnapshot, agentID string) error
- func (kb *SQLiteKB) StoreMissionTemplates(ctx context.Context, baseID string, missions []MissionTemplate) error
- func (kb *SQLiteKB) StorePlayer(ctx context.Context, player PlayerRecord) error
- func (kb *SQLiteKB) StorePlayerSkills(ctx context.Context, playerID string, skills []PlayerSkillRecord) error
- func (kb *SQLiteKB) StoreRecipes(ctx context.Context, recipes []RecipeDef) error
- func (kb *SQLiteKB) StoreShip(ctx context.Context, ship ShipRecord) error
- func (kb *SQLiteKB) StoreShipClasses(ctx context.Context, classes []ShipClassDef) error
- func (kb *SQLiteKB) StoreShipListings(ctx context.Context, listings ShipListings, agentID string) error
- func (kb *SQLiteKB) StoreSkills(ctx context.Context, skills []Skill) error
- func (kb *SQLiteKB) UpsertSystemFromMap(ctx context.Context, data MapSystemData) error
- type ShipClassDef
- type ShipListing
- type ShipListings
- type ShipModuleRecord
- type ShipRecord
- type Skill
- type SpaceBase
- type System
- type SystemConnection
Constants ¶
This section is empty.
Variables ¶
var FacilityCategoryMapping = map[string]Facility{
"grand_solarian_exchange": {ID: "grand_solarian_exchange", Name: "Grand Solarian Exchange", Category: "service", Level: 5},
"sol_admin_bureau": {ID: "sol_admin_bureau", Name: "Solarian Admin Bureau", Category: "service", Level: 5},
"sol_bonded_warehouse": {ID: "sol_bonded_warehouse", Name: "Solarian Bonded Warehouse", Category: "service", Level: 5},
"sol_precision_drydock": {ID: "sol_precision_drydock", Name: "Precision Drydock", Category: "service", Level: 5},
"sol_naval_shipyard": {ID: "sol_naval_shipyard", Name: "Naval Shipyard", Category: "service", Level: 5},
"sol_research_labs": {ID: "sol_research_labs", Name: "Research Labs", Category: "service", Level: 5},
"solarian_fusion_plant": {ID: "solarian_fusion_plant", Name: "Solarian Fusion Plant", Category: "infrastructure", Level: 5},
"solarian_life_support": {ID: "solarian_life_support", Name: "Solarian Life Support", Category: "infrastructure", Level: 5},
"iron_refinery": {ID: "iron_refinery", Name: "Iron Refinery", Category: "production", Level: 1},
"circuit_fabricator": {ID: "circuit_fabricator", Name: "Circuit Fabricator", Category: "production", Level: 1},
"copper_wire_mill": {ID: "copper_wire_mill", Name: "Copper Wire Mill", Category: "production", Level: 1},
"polymer_synthesizer": {ID: "polymer_synthesizer", Name: "Polymer Synthesizer", Category: "production", Level: 1},
"fuel_cell_plant": {ID: "fuel_cell_plant", Name: "Fuel Cell Plant", Category: "production", Level: 1},
"repair_kit_factory": {ID: "repair_kit_factory", Name: "Repair Kit Factory", Category: "production", Level: 1},
"power_cell_assembler": {ID: "power_cell_assembler", Name: "Power Cell Assembler", Category: "production", Level: 1},
"sensor_assembly": {ID: "sensor_assembly", Name: "Sensor Assembly", Category: "production", Level: 2},
"sol_galley": {ID: "sol_galley", Name: "Solarian Galley", Category: "production", Level: 1},
"sol_fuel_grid": {ID: "sol_fuel_grid", Name: "Solarian Fuel Grid", Category: "production", Level: 5},
"haven_grand_bazaar": {ID: "haven_grand_bazaar", Name: "Grand Bazaar", Category: "service", Level: 5},
"haven_promenade": {ID: "haven_promenade", Name: "Promenade", Category: "service", Level: 5},
"haven_repair_complex": {ID: "haven_repair_complex", Name: "Repair Complex", Category: "service", Level: 5},
"haven_fuel_plaza": {ID: "haven_fuel_plaza", Name: "Fuel Plaza", Category: "service", Level: 5},
"haven_ship_showroom": {ID: "haven_ship_showroom", Name: "Ship Showroom", Category: "service", Level: 5},
"haven_makers_market": {ID: "haven_makers_market", Name: "Makers Market", Category: "service", Level: 5},
"haven_trade_commission": {ID: "haven_trade_commission", Name: "Trade Commission", Category: "service", Level: 5},
"haven_premium_storage": {ID: "haven_premium_storage", Name: "Premium Storage", Category: "service", Level: 5},
"trade_cipher_foundry": {ID: "trade_cipher_foundry", Name: "Trade Cipher Foundry", Category: "service", Level: 5},
"nebula_solar_array": {ID: "nebula_solar_array", Name: "Nebula Solar Array", Category: "infrastructure", Level: 5},
"nebula_life_support": {ID: "nebula_life_support", Name: "Nebula Life Support", Category: "infrastructure", Level: 5},
"void_nexus_exchange": {ID: "void_nexus_exchange", Name: "Void Nexus Exchange", Category: "service", Level: 5},
"null_energy_tap": {ID: "null_energy_tap", Name: "Null Energy Tap", Category: "infrastructure", Level: 5},
"voidborn_atmosphere": {ID: "voidborn_atmosphere", Name: "Voidborn Atmosphere", Category: "infrastructure", Level: 5},
"voidborn_dimensional_vault": {ID: "voidborn_dimensional_vault", Name: "Dimensional Vault", Category: "infrastructure", Level: 5},
"voidborn_energy_dispenser": {ID: "voidborn_energy_dispenser", Name: "Energy Dispenser", Category: "infrastructure", Level: 5},
"voidborn_neural_foundry": {ID: "voidborn_neural_foundry", Name: "Neural Forge", Category: "infrastructure", Level: 5},
"voidborn_reconstruction_matrix": {ID: "voidborn_reconstruction_matrix", Name: "Reconstruction Matrix", Category: "infrastructure", Level: 5},
"voidborn_pattern_council": {ID: "voidborn_pattern_council", Name: "Pattern Council", Category: "faction", Level: 5},
"voidborn_crystalline_cradle": {ID: "voidborn_crystalline_cradle", Name: "Crystalline Cradle", Category: "faction", Level: 5},
"voidborn_shaping_chamber": {ID: "voidborn_shaping_chamber", Name: "Shaping Chamber", Category: "faction", Level: 5},
"crystal_refinery": {ID: "crystal_refinery", Name: "Crystal Refinery", Category: "production", Level: 5},
"null_matter_processor": {ID: "null_matter_processor", Name: "Null Matter Processor", Category: "production", Level: 5},
"crimson_fleet_command": {ID: "crimson_fleet_command", Name: "Crimson Fleet Command", Category: "service", Level: 5},
"war_market": {ID: "war_market", Name: "War Market", Category: "service", Level: 5},
"crimson_life_support": {ID: "crimson_life_support", Name: "Crimson Life Support", Category: "infrastructure", Level: 5},
"crimson_reactor": {ID: "crimson_reactor", Name: "Crimson Reactor", Category: "infrastructure", Level: 5},
"alloy_foundry": {ID: "alloy_foundry", Name: "Alloy Foundry", Category: "production", Level: 5},
"crimson_armor_works": {ID: "crimson_armor_works", Name: "Crimson Armor Works", Category: "production", Level: 5},
"crimson_distillery": {ID: "crimson_distillery", Name: "Crimson Distillery", Category: "production", Level: 5},
"crimson_fuel_bunker": {ID: "crimson_fuel_bunker", Name: "Crimson Fuel Bunker", Category: "production", Level: 5},
"crimson_munitions_vault": {ID: "crimson_munitions_vault", Name: "Munitions Vault", Category: "production", Level: 5},
"crimson_war_forge": {ID: "crimson_war_forge", Name: "Crimson War Forge", Category: "production", Level: 5},
"crimson_weapons_forge": {ID: "crimson_weapons_forge", Name: "Weapons Forge", Category: "production", Level: 5},
"frontier_exchange": {ID: "frontier_exchange", Name: "Frontier Exchange", Category: "service", Level: 1},
"frontier_notice_board": {ID: "frontier_notice_board", Name: "Notice Board", Category: "service", Level: 1},
"frontier_still": {ID: "frontier_still", Name: "Still", Category: "service", Level: 1},
"frontier_fuel_siphon": {ID: "frontier_fuel_siphon", Name: "Fuel Siphon", Category: "infrastructure", Level: 1},
"frontier_life_support": {ID: "frontier_life_support", Name: "Life Support", Category: "infrastructure", Level: 1},
"frontier_salvage_reactor": {ID: "frontier_salvage_reactor", Name: "Salvage Reactor", Category: "infrastructure", Level: 1},
"frontier_hull_lockers": {ID: "frontier_hull_lockers", Name: "Hull Lockers", Category: "production", Level: 1},
"frontier_machine_shop": {ID: "frontier_machine_shop", Name: "Machine Shop", Category: "production", Level: 1},
"frontier_salvage_yard": {ID: "frontier_salvage_yard", Name: "Salvage Yard", Category: "production", Level: 1},
"frontier_weld_shop": {ID: "frontier_weld_shop", Name: "Weld Shop", Category: "production", Level: 1},
}
FacilityCategoryMapping maps facility IDs to their metadata This is populated from game data since the API doesn't provide categories
Functions ¶
This section is empty.
Types ¶
type Anomaly ¶
type Anomaly struct {
ID int64
Type string // 'rich_deposit', 'hostile_zone', 'rare_resource', 'empty_station', 'price_anomaly'
Severity string // 'info', 'warning', 'critical', 'opportunity'
SystemID string
POIID string
Description string
Details string // JSON with additional data
DetectedAt time.Time
DetectedBy string
Status string // 'active', 'resolved', 'obsolete'
LastUpdatedTick int64
}
Anomaly represents an unusual or noteworthy discovery
type Base ¶
type Base interface {
Close() error
RememberSystem(ctx context.Context, sys System) error
GetSystem(ctx context.Context, systemID string) (*System, error)
GetUnknownConnections(ctx context.Context, systemID string) ([]string, error)
RememberConnection(ctx context.Context, fromSystem, toSystem string) error
RememberPOI(ctx context.Context, poi POI) error
GetPOIs(ctx context.Context, systemID string) ([]POI, error)
RememberBase(ctx context.Context, base SpaceBase) error
GetBase(ctx context.Context, baseID string) (*SpaceBase, error)
GetBaseByPOI(ctx context.Context, poiID string) (*SpaceBase, error)
AddExperience(ctx context.Context, agentID, expType, description, outcome, location string) error
GetRecentExperiences(ctx context.Context, agentID string, limit int) ([]Experience, error)
RegisterAgent(ctx context.Context, agentID, name, role, faction string, personality []byte) error
// GetSystems returns all known systems
// Note: This method does not take a context for API compatibility with existing callers
GetSystems() []System
// Market data methods
StoreMarketSnapshot(ctx context.Context, snapshot MarketSnapshot, agentID string) error
GetMarketSnapshots(ctx context.Context, systemID, stationID string, limit int) ([]MarketSnapshot, error)
GetLatestMarketSnapshot(ctx context.Context, systemID, stationID string) (*MarketSnapshot, error)
GetMarketItems(ctx context.Context, itemType string) ([]string, error)
HasMarketSnapshotToday(ctx context.Context, systemID, stationID string) (bool, error)
// Market analysis methods
StoreMarketAnalysis(ctx context.Context, analysis MarketAnalysis, agentID string) error
GetLatestMarketAnalysis(ctx context.Context, systemID, stationID string) (*MarketAnalysis, error)
GetMarketAnalysisHistory(ctx context.Context, systemID, stationID string, limit int) ([]MarketAnalysis, error)
// Ship listings methods
StoreShipListings(ctx context.Context, listings ShipListings, agentID string) error
GetShipListings(ctx context.Context, systemID, stationID string, limit int) ([]ShipListings, error)
GetLatestShipListings(ctx context.Context, systemID, stationID string) (*ShipListings, error)
HasShipListingsToday(ctx context.Context, systemID, stationID string) (bool, error)
// Resource depletion tracking
RecordResourceState(ctx context.Context, poiID, resourceID string, richness, remaining float64, gameTick int64, agentID string) error
GetResourceHistory(ctx context.Context, poiID, resourceID string, limit int) ([]ResourceHistory, error)
GetDepletingResources(ctx context.Context, threshold float64) ([]DepletingResource, error)
// Route optimization
RecordJourney(ctx context.Context, fromSystem, toSystem string, fuelCost, travelTime float64, agentID string) error
GetOptimalRoute(ctx context.Context, fromSystem, toSystem string) (*ConnectionMetrics, error)
FindCheapestRoute(ctx context.Context, fromSystem, toSystem string, maxHops int) ([]string, float64, error)
// Anomaly detection
RecordAnomaly(ctx context.Context, anomaly Anomaly) error
GetActiveAnomalies(ctx context.Context, systemID string) ([]Anomaly, error)
GetAnomaliesByType(ctx context.Context, anomalyType, severity string, limit int) ([]Anomaly, error)
ResolveAnomaly(ctx context.Context, anomalyID int64, status string) error
// Market price analytics
AnalyzePriceTrends(ctx context.Context, itemID, stationID string, windowHours int) (*PriceTrend, error)
FindBestPrices(ctx context.Context, itemID string, listingType string, limit int) ([]BestPrice, error)
GetPriceHistory(ctx context.Context, itemID, stationID string, limit int) ([]PricePoint, error)
// Danger zone tracking
RecordHostileEncounter(ctx context.Context, systemID string, encounterType string, details string) error
GetDangerZones(ctx context.Context, minDangerLevel int) ([]DangerZone, error)
GetSystemDanger(ctx context.Context, systemID string) (*DangerZone, error)
// Knowledge export/import
ExportKnowledge(ctx context.Context, description string, agentID string) (*KnowledgeExport, error)
ImportKnowledge(ctx context.Context, exportData string) error
ListExports(ctx context.Context) ([]KnowledgeExportMeta, error)
// Skills
GetSkill(id string) (*Skill, error)
GetSkills() []Skill
StoreSkills(ctx context.Context, skills []Skill) error
// Catalog: Items
StoreItems(ctx context.Context, items []CatalogItem) error
GetItem(ctx context.Context, itemID string) (*CatalogItem, error)
GetItems(ctx context.Context) ([]CatalogItem, error)
GetItemsByCategory(ctx context.Context, category string) ([]CatalogItem, error)
// Catalog: Ship Classes
StoreShipClasses(ctx context.Context, classes []ShipClassDef) error
GetShipClass(ctx context.Context, classID string) (*ShipClassDef, error)
GetShipClasses(ctx context.Context) ([]ShipClassDef, error)
GetShipClassesByCategory(ctx context.Context, category string) ([]ShipClassDef, error)
// Catalog: Recipes
StoreRecipes(ctx context.Context, recipes []RecipeDef) error
GetRecipe(ctx context.Context, recipeID string) (*RecipeDef, error)
GetRecipes(ctx context.Context) ([]RecipeDef, error)
GetRecipesByCategory(ctx context.Context, category string) ([]RecipeDef, error)
// Player State
StorePlayer(ctx context.Context, player PlayerRecord) error
GetPlayer(ctx context.Context, playerID string) (*PlayerRecord, error)
StorePlayerSkills(ctx context.Context, playerID string, skills []PlayerSkillRecord) error
GetPlayerSkills(ctx context.Context, playerID string) ([]PlayerSkillRecord, error)
StoreShip(ctx context.Context, ship ShipRecord) error
GetShip(ctx context.Context, shipID string) (*ShipRecord, error)
GetPlayerShips(ctx context.Context, playerID string) ([]ShipRecord, error)
StoreMissionTemplates(ctx context.Context, baseID string, missions []MissionTemplate) error
GetMissionTemplates(ctx context.Context, baseID string) ([]MissionTemplate, error)
}
Base provides the KB interface for both SQLite and in-memory implementations
type BaseMarketItem ¶
BaseMarketItem represents an item for sale at a base market
type BestPrice ¶
type BestPrice struct {
ItemID string
StationID string
StationName string
SystemID string
SystemName string
Price float64
Quantity float64
ListingType string
CapturedAt time.Time
}
BestPrice identifies the best buy/sell opportunity for an item
type BuildMaterial ¶
BuildMaterial represents a material required to build a ship class.
type CargoEntry ¶
CargoEntry represents an item in a ship's cargo hold.
type CatalogItem ¶
type CatalogItem struct {
ID string
Name string
Description string
Category string
Rarity string
Size int
BaseValue int
Stackable bool
Tradeable bool
}
CatalogItem represents an item from the game catalog.
type Config ¶
type Config struct {
DBPath string // Path to SQLite database file
WAL bool // Enable WAL mode for better concurrency
MaxOpenConns int // Maximum open connections
MaxIdleConns int // Maximum idle connections
BusyTimeout time.Duration // Timeout for busy database
}
Config holds configuration for SQLite knowledge base
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a config with sensible defaults
type ConnectionMetrics ¶
type ConnectionMetrics struct {
FromSystem string
ToSystem string
TravelCount int
AvgFuelCost float64
AvgTravelTime float64
LastTraveled time.Time
TraveledBy string
}
ConnectionMetrics stores route optimization data
type DangerZone ¶
type DangerZone struct {
SystemID string
SystemName string
DangerLevel int // 0-10 scale
HostileEncounters int
PlayerKills int
NPCKills int
LastIncident time.Time
LastUpdated time.Time
}
DangerZone tracks hostile activity in a system
type DepletingResource ¶
type DepletingResource struct {
POIID string
POIName string
SystemID string
SystemName string
ResourceID string
CurrentRem float64
PreviousRem float64
DepletionRate float64 // per game tick
EstimatedLife int64 // ticks until exhausted
}
DepletingResource identifies resources running low
type Experience ¶
type Experience struct {
Time string
Type string
Description string
Outcome string
Location string
LastUpdatedTick int64
}
Experience represents a significant event
type Facility ¶
type Facility struct {
ID string // Facility ID (e.g., "grand_solarian_exchange")
Name string // Display name
Category string // Category: "service", "infrastructure", "production", "faction", "personal"
Level int // Facility level (1-5)
LastUpdated int64 // Last updated tick for data freshness tracking
}
Facility represents a facility at a base with category and level information
type KnowledgeExport ¶
type KnowledgeExport struct {
ID string
CreatedAt time.Time
CreatedBy string
Description string
SystemsCount int
POIsCount int
ExperiencesCount int
ExportData string // JSON snapshot
}
KnowledgeExport represents exported knowledge bundle
type KnowledgeExportMeta ¶
type KnowledgeExportMeta struct {
ID string
CreatedAt time.Time
CreatedBy string
Description string
SystemsCount int
POIsCount int
ExperiencesCount int
}
KnowledgeExportMeta is metadata about an export
type MapSystemData ¶
type MapSystemData struct {
ID string
Name string
Empire string
PositionX float64
PositionY float64
IsStronghold bool
Connections []string
}
MapSystemData contains the subset of system data available from map imports. Used by UpsertSystemFromMap to perform partial upserts that preserve richer explorer-collected data (police_level, description, last_updated_tick).
type MarketAnalysis ¶
type MarketAnalysis struct {
SystemID string
SystemName string
StationID string
StationName string
GameTick int64
CapturedAt time.Time
Mode string
SkillLevel int
ScanningRange string
StationsInRange int
ItemsScanned int
TopInsights []map[string]any
TotalItems int
TotalPages int
Page int
Hint string
XPGained map[string]any
AnalysisData map[string]any
}
MarketAnalysis represents AI-generated market insights from analyze_market
type MarketListing ¶
type MarketListing struct {
ItemID string
ItemType string
Quantity float64
PricePerUnit float64
TotalPrice float64
Type string // 'buy' or 'sell'
ListedBy string
}
MarketListing represents a single market listing
type MarketSnapshot ¶
type MarketSnapshot struct {
SystemID string
SystemName string
StationID string
StationName string
GameTick int64
Listings []MarketListing
CapturedAt time.Time
}
MarketSnapshot represents a captured market state
type MemoryKB ¶
type MemoryKB struct {
// contains filtered or unexported fields
}
MemoryKB is an in-memory knowledge base for MVP
func (*MemoryKB) AddExperience ¶
func (kb *MemoryKB) AddExperience(ctx context.Context, agentID, expType, description, outcome, location string) error
AddExperience logs an agent experience
func (*MemoryKB) AnalyzePriceTrends ¶
func (*MemoryKB) ExportKnowledge ¶
func (*MemoryKB) FindBestPrices ¶
func (*MemoryKB) FindCheapestRoute ¶
func (*MemoryKB) GetActiveAnomalies ¶
func (*MemoryKB) GetAnomaliesByType ¶
func (*MemoryKB) GetBaseByPOI ¶
GetBaseByPOI retrieves a base by its POI ID
func (*MemoryKB) GetDangerZones ¶
func (*MemoryKB) GetDepletingResources ¶
func (*MemoryKB) GetItems ¶
func (kb *MemoryKB) GetItems(ctx context.Context) ([]CatalogItem, error)
func (*MemoryKB) GetItemsByCategory ¶
func (*MemoryKB) GetLatestMarketAnalysis ¶
func (*MemoryKB) GetLatestMarketSnapshot ¶
func (kb *MemoryKB) GetLatestMarketSnapshot(ctx context.Context, systemID, stationID string) (*MarketSnapshot, error)
GetLatestMarketSnapshot retrieves the most recent market snapshot
func (*MemoryKB) GetLatestShipListings ¶
func (kb *MemoryKB) GetLatestShipListings(ctx context.Context, systemID, stationID string) (*ShipListings, error)
GetLatestShipListings retrieves the most recent ship listings
func (*MemoryKB) GetMarketAnalysisHistory ¶
func (*MemoryKB) GetMarketItems ¶
GetMarketItems retrieves unique item IDs optionally filtered by type
func (*MemoryKB) GetMarketSnapshots ¶
func (kb *MemoryKB) GetMarketSnapshots(ctx context.Context, systemID, stationID string, limit int) ([]MarketSnapshot, error)
GetMarketSnapshots retrieves historical market snapshots
func (*MemoryKB) GetMissionTemplates ¶
func (*MemoryKB) GetOptimalRoute ¶
func (*MemoryKB) GetPlayerShips ¶
func (*MemoryKB) GetPlayerSkills ¶
func (*MemoryKB) GetPriceHistory ¶
func (*MemoryKB) GetRecentExperiences ¶
func (kb *MemoryKB) GetRecentExperiences(ctx context.Context, agentID string, limit int) ([]Experience, error)
GetRecentExperiences retrieves recent experiences for an agent
func (*MemoryKB) GetRecipes ¶
func (*MemoryKB) GetRecipesByCategory ¶
func (*MemoryKB) GetResourceHistory ¶
func (*MemoryKB) GetShipClass ¶
func (*MemoryKB) GetShipClasses ¶
func (kb *MemoryKB) GetShipClasses(ctx context.Context) ([]ShipClassDef, error)
func (*MemoryKB) GetShipClassesByCategory ¶
func (*MemoryKB) GetShipListings ¶
func (kb *MemoryKB) GetShipListings(ctx context.Context, systemID, stationID string, limit int) ([]ShipListings, error)
GetShipListings retrieves historical ship listings
func (*MemoryKB) GetSystemDanger ¶
func (*MemoryKB) GetSystems ¶
GetSystems returns all known systems
func (*MemoryKB) GetUnknownConnections ¶
GetUnknownConnections finds unexplored connections from a system
func (*MemoryKB) HasMarketSnapshotToday ¶
func (kb *MemoryKB) HasMarketSnapshotToday(ctx context.Context, systemID, stationID string) (bool, error)
HasMarketSnapshotToday checks if a market snapshot was captured today for a station
func (*MemoryKB) HasShipListingsToday ¶
func (kb *MemoryKB) HasShipListingsToday(ctx context.Context, systemID, stationID string) (bool, error)
HasShipListingsToday checks if ship listings were captured today for a station
func (*MemoryKB) ImportKnowledge ¶
func (*MemoryKB) ListExports ¶
func (kb *MemoryKB) ListExports(ctx context.Context) ([]KnowledgeExportMeta, error)
func (*MemoryKB) RecordAnomaly ¶
func (*MemoryKB) RecordHostileEncounter ¶
func (*MemoryKB) RecordJourney ¶
func (*MemoryKB) RecordResourceState ¶
func (*MemoryKB) RegisterAgent ¶
func (kb *MemoryKB) RegisterAgent(ctx context.Context, agentID, name, role, empire string, personality []byte) error
RegisterAgent registers an agent in the knowledge base
func (*MemoryKB) RememberBase ¶
RememberBase stores or updates space base knowledge
func (*MemoryKB) RememberConnection ¶
RememberConnection stores a system connection (with deduplication)
func (*MemoryKB) RememberPOI ¶
RememberPOI stores or updates POI knowledge
func (*MemoryKB) RememberSystem ¶
RememberSystem stores or updates system knowledge
func (*MemoryKB) ResolveAnomaly ¶
func (*MemoryKB) StoreItems ¶
func (kb *MemoryKB) StoreItems(ctx context.Context, items []CatalogItem) error
func (*MemoryKB) StoreMarketAnalysis ¶
func (*MemoryKB) StoreMarketSnapshot ¶
func (kb *MemoryKB) StoreMarketSnapshot(ctx context.Context, snapshot MarketSnapshot, agentID string) error
StoreMarketSnapshot stores a market snapshot with its listings
func (*MemoryKB) StoreMissionTemplates ¶
func (*MemoryKB) StorePlayer ¶
func (kb *MemoryKB) StorePlayer(ctx context.Context, player PlayerRecord) error
func (*MemoryKB) StorePlayerSkills ¶
func (*MemoryKB) StoreRecipes ¶
func (*MemoryKB) StoreShip ¶
func (kb *MemoryKB) StoreShip(ctx context.Context, ship ShipRecord) error
func (*MemoryKB) StoreShipClasses ¶
func (kb *MemoryKB) StoreShipClasses(ctx context.Context, classes []ShipClassDef) error
func (*MemoryKB) StoreShipListings ¶
func (kb *MemoryKB) StoreShipListings(ctx context.Context, listings ShipListings, agentID string) error
StoreShipListings stores ship listings at a station
type Migration ¶
type Migration struct {
// contains filtered or unexported fields
}
Migration represents a database schema migration
type MissionObjectiveRecord ¶
MissionObjectiveRecord represents a single objective in a mission template.
type MissionTemplate ¶
type MissionTemplate struct {
ID string
Title string
Description string
Type string
Difficulty int
BaseID string
GiverName string
GiverTitle string
DialogOffer string
ChainNext string
ExpiresInTicks int
RewardsCredits int
RewardsSkillXP map[string]int
Requirements map[string]any
Objectives []MissionObjectiveRecord
LastUpdatedTick int64
}
MissionTemplate represents an available mission from a mission board.
type POI ¶
type POI struct {
ID string
SystemID string
Name string
Type string
Description string
Position game.Position
Services []string
Resources []game.POIResource
LastUpdatedTick int64
}
POI represents knowledge about a Point of Interest Extends game.POI with exploration metadata
type PlayerRecord ¶
type PlayerRecord struct {
ID string
Username string
Empire string
Credits float64
CurrentSystem string
CurrentPOI string
CurrentShipID string
HomeBase string
DockedAtBase string
FactionID string
FactionRank string
Experience int64
Stats PlayerStatsRecord
LastUpdatedTick int64
}
PlayerRecord represents a player's core data stored in the knowledge base.
type PlayerSkillRecord ¶
PlayerSkillRecord represents a player's progress in a specific skill.
type PlayerStatsRecord ¶
type PlayerStatsRecord struct {
ShipsDestroyed int
TimesDestroyed int
OreMined float64
CreditsEarned float64
CreditsSpent float64
TradesCompleted int
SystemsDiscovered int
ItemsCrafted int
MissionsCompleted int
BasesDestroyed int
DistanceTraveled int64
PiratesDestroyed int
ShipsLost int
TimePlayed int64
LastUpdatedTick int64
}
PlayerStatsRecord holds player statistics.
type PricePoint ¶
PricePoint represents a single price observation
type PriceTrend ¶
type PriceTrend struct {
ItemID string
ItemType string
StationID string
SystemID string
ListingType string // 'buy' or 'sell'
AvgPrice float64
MinPrice float64
MaxPrice float64
CurrentPrice float64
PriceChange float64 // percentage change
SampleCount int
WindowStart time.Time
WindowEnd time.Time
}
PriceTrend represents aggregate price data over a time window
type RecipeDef ¶
type RecipeDef struct {
ID string
Name string
Description string
Category string
CraftingTime int
BaseQuality int
SkillQualityMod int
RequiredSkills map[string]int
Inputs []RecipeIngredient
Outputs []RecipeProduct
LastUpdatedTick int64
}
RecipeDef represents a crafting recipe stored in the knowledge base.
type RecipeIngredient ¶
RecipeIngredient represents an input item for a recipe.
type RecipeProduct ¶
RecipeProduct represents an output item from a recipe.
type ResourceHistory ¶
type ResourceHistory struct {
POIID string
ResourceID string
Richness float64
Remaining float64
GameTick int64
RecordedAt time.Time
AgentID string
}
ResourceHistory tracks resource depletion over time
type SQLiteKB ¶
type SQLiteKB struct {
// contains filtered or unexported fields
}
SQLiteKB implements Base interface using SQLite backend
func NewSQLiteKB ¶
NewSQLiteKB creates a new SQLite-backed knowledge base
func (*SQLiteKB) AddExperience ¶
func (kb *SQLiteKB) AddExperience(ctx context.Context, agentID, expType, description, outcome, location string) error
AddExperience logs an agent experience
func (*SQLiteKB) AnalyzePriceTrends ¶
func (kb *SQLiteKB) AnalyzePriceTrends(ctx context.Context, itemID, stationID string, windowHours int) (*PriceTrend, error)
AnalyzePriceTrends calculates price trends for an item at a station
func (*SQLiteKB) ExportKnowledge ¶
func (kb *SQLiteKB) ExportKnowledge(ctx context.Context, description string, agentID string) (*KnowledgeExport, error)
ExportKnowledge creates a JSON export of the knowledge base
func (*SQLiteKB) FindBestPrices ¶
func (kb *SQLiteKB) FindBestPrices(ctx context.Context, itemID string, listingType string, limit int) ([]BestPrice, error)
FindBestPrices finds the best buy/sell prices for an item across all stations
func (*SQLiteKB) FindCheapestRoute ¶
func (kb *SQLiteKB) FindCheapestRoute(ctx context.Context, fromSystem, toSystem string, maxHops int) ([]string, float64, error)
FindCheapestRoute finds the most fuel-efficient multi-hop route
func (*SQLiteKB) GetActiveAnomalies ¶
GetActiveAnomalies retrieves active anomalies in a system
func (*SQLiteKB) GetAnomaliesByType ¶
func (kb *SQLiteKB) GetAnomaliesByType(ctx context.Context, anomalyType, severity string, limit int) ([]Anomaly, error)
GetAnomaliesByType retrieves anomalies filtered by type and severity
func (*SQLiteKB) GetBaseByPOI ¶
GetBaseByPOI retrieves a base by its POI ID
func (*SQLiteKB) GetDangerZones ¶
GetDangerZones retrieves systems with high danger levels
func (*SQLiteKB) GetDepletingResources ¶
func (kb *SQLiteKB) GetDepletingResources(ctx context.Context, threshold float64) ([]DepletingResource, error)
GetDepletingResources finds resources that are depleting rapidly
func (*SQLiteKB) GetItems ¶
func (kb *SQLiteKB) GetItems(ctx context.Context) ([]CatalogItem, error)
GetItems retrieves all catalog items.
func (*SQLiteKB) GetItemsByCategory ¶
GetItemsByCategory retrieves items filtered by category.
func (*SQLiteKB) GetLatestMarketAnalysis ¶
func (kb *SQLiteKB) GetLatestMarketAnalysis(ctx context.Context, systemID, stationID string) (*MarketAnalysis, error)
GetLatestMarketAnalysis retrieves the most recent market analysis
func (*SQLiteKB) GetLatestMarketSnapshot ¶
func (kb *SQLiteKB) GetLatestMarketSnapshot(ctx context.Context, systemID, stationID string) (*MarketSnapshot, error)
GetLatestMarketSnapshot retrieves the most recent market snapshot
func (*SQLiteKB) GetLatestShipListings ¶
func (kb *SQLiteKB) GetLatestShipListings(ctx context.Context, systemID, stationID string) (*ShipListings, error)
GetLatestShipListings retrieves the most recent ship listings
func (*SQLiteKB) GetMarketAnalysisHistory ¶
func (kb *SQLiteKB) GetMarketAnalysisHistory(ctx context.Context, systemID, stationID string, limit int) ([]MarketAnalysis, error)
GetMarketAnalysisHistory retrieves historical market analyses
func (*SQLiteKB) GetMarketItems ¶
GetMarketItems retrieves unique item IDs optionally filtered by type
func (*SQLiteKB) GetMarketSnapshots ¶
func (kb *SQLiteKB) GetMarketSnapshots(ctx context.Context, systemID, stationID string, limit int) ([]MarketSnapshot, error)
GetMarketSnapshots retrieves historical market snapshots
func (*SQLiteKB) GetMissionTemplates ¶
func (kb *SQLiteKB) GetMissionTemplates(ctx context.Context, baseID string) ([]MissionTemplate, error)
GetMissionTemplates retrieves mission templates for a given base.
func (*SQLiteKB) GetOptimalRoute ¶
func (kb *SQLiteKB) GetOptimalRoute(ctx context.Context, fromSystem, toSystem string) (*ConnectionMetrics, error)
GetOptimalRoute finds the best known route between two systems
func (*SQLiteKB) GetPlayerShips ¶
GetPlayerShips retrieves all ships owned by a player.
func (*SQLiteKB) GetPlayerSkills ¶
func (kb *SQLiteKB) GetPlayerSkills(ctx context.Context, playerID string) ([]PlayerSkillRecord, error)
GetPlayerSkills retrieves a player's skill progress.
func (*SQLiteKB) GetPriceHistory ¶
func (kb *SQLiteKB) GetPriceHistory(ctx context.Context, itemID, stationID string, limit int) ([]PricePoint, error)
GetPriceHistory retrieves historical price points for an item
func (*SQLiteKB) GetRecentExperiences ¶
func (kb *SQLiteKB) GetRecentExperiences(ctx context.Context, agentID string, limit int) ([]Experience, error)
GetRecentExperiences retrieves recent experiences for an agent
func (*SQLiteKB) GetRecipes ¶
GetRecipes retrieves all recipes.
func (*SQLiteKB) GetRecipesByCategory ¶
GetRecipesByCategory retrieves recipes filtered by category.
func (*SQLiteKB) GetResourceHistory ¶
func (kb *SQLiteKB) GetResourceHistory(ctx context.Context, poiID, resourceID string, limit int) ([]ResourceHistory, error)
GetResourceHistory retrieves historical resource data
func (*SQLiteKB) GetShipClass ¶
GetShipClass retrieves a single ship class by ID.
func (*SQLiteKB) GetShipClasses ¶
func (kb *SQLiteKB) GetShipClasses(ctx context.Context) ([]ShipClassDef, error)
GetShipClasses retrieves all ship classes.
func (*SQLiteKB) GetShipClassesByCategory ¶
func (kb *SQLiteKB) GetShipClassesByCategory(ctx context.Context, category string) ([]ShipClassDef, error)
GetShipClassesByCategory retrieves ship classes filtered by class (e.g., "Mining", "Fighter").
func (*SQLiteKB) GetShipListings ¶
func (kb *SQLiteKB) GetShipListings(ctx context.Context, systemID, stationID string, limit int) ([]ShipListings, error)
GetShipListings retrieves historical ship listings
func (*SQLiteKB) GetSkill ¶
GetSkill retrieves a single skill by ID, reading from the database first and falling back to static data if no skills are stored.
func (*SQLiteKB) GetSkills ¶
GetSkills retrieves all skills, reading from the database first and falling back to static data if no skills are stored.
func (*SQLiteKB) GetSystemDanger ¶
GetSystemDanger retrieves danger information for a specific system
func (*SQLiteKB) GetSystems ¶
GetSystems returns all known systems
func (*SQLiteKB) GetUnknownConnections ¶
GetUnknownConnections finds unexplored connections from a system
func (*SQLiteKB) HasMarketSnapshotToday ¶
func (kb *SQLiteKB) HasMarketSnapshotToday(ctx context.Context, systemID, stationID string) (bool, error)
HasMarketSnapshotToday checks if a market snapshot was captured today for a station
func (*SQLiteKB) HasShipListingsToday ¶
func (kb *SQLiteKB) HasShipListingsToday(ctx context.Context, systemID, stationID string) (bool, error)
HasShipListingsToday checks if ship listings were captured today for a station
func (*SQLiteKB) ImportKnowledge ¶
ImportKnowledge imports data from a JSON export
func (*SQLiteKB) ListExports ¶
func (kb *SQLiteKB) ListExports(ctx context.Context) ([]KnowledgeExportMeta, error)
ListExports retrieves metadata for all knowledge exports
func (*SQLiteKB) RecordAnomaly ¶
RecordAnomaly logs an unusual discovery or event
func (*SQLiteKB) RecordHostileEncounter ¶
func (kb *SQLiteKB) RecordHostileEncounter(ctx context.Context, systemID string, encounterType string, details string) error
RecordHostileEncounter logs a hostile encounter in a system
func (*SQLiteKB) RecordJourney ¶
func (kb *SQLiteKB) RecordJourney(ctx context.Context, fromSystem, toSystem string, fuelCost, travelTime float64, agentID string) error
RecordJourney logs a journey between systems for route optimization
func (*SQLiteKB) RecordResourceState ¶
func (kb *SQLiteKB) RecordResourceState(ctx context.Context, poiID, resourceID string, richness, remaining float64, gameTick int64, agentID string) error
RecordResourceState tracks resource levels over time
func (*SQLiteKB) RegisterAgent ¶
func (kb *SQLiteKB) RegisterAgent(ctx context.Context, agentID, name, role, empire string, personality []byte) error
RegisterAgent registers an agent in the knowledge base
func (*SQLiteKB) RememberBase ¶
RememberBase stores or updates space base knowledge
func (*SQLiteKB) RememberConnection ¶
RememberConnection stores a system connection (with deduplication)
func (*SQLiteKB) RememberPOI ¶
RememberPOI stores or updates POI knowledge
func (*SQLiteKB) RememberSystem ¶
RememberSystem stores or updates system knowledge
func (*SQLiteKB) ResolveAnomaly ¶
ResolveAnomaly marks an anomaly as resolved or obsolete
func (*SQLiteKB) StoreItems ¶
func (kb *SQLiteKB) StoreItems(ctx context.Context, items []CatalogItem) error
StoreItems stores or replaces all items in the catalog.
func (*SQLiteKB) StoreMarketAnalysis ¶
func (kb *SQLiteKB) StoreMarketAnalysis(ctx context.Context, analysis MarketAnalysis, agentID string) error
StoreMarketAnalysis stores a market analysis snapshot
func (*SQLiteKB) StoreMarketSnapshot ¶
func (kb *SQLiteKB) StoreMarketSnapshot(ctx context.Context, snapshot MarketSnapshot, agentID string) error
StoreMarketSnapshot stores a market snapshot with its listings
func (*SQLiteKB) StoreMissionTemplates ¶
func (kb *SQLiteKB) StoreMissionTemplates(ctx context.Context, baseID string, missions []MissionTemplate) error
StoreMissionTemplates stores mission templates for a given base, replacing any existing ones.
func (*SQLiteKB) StorePlayer ¶
func (kb *SQLiteKB) StorePlayer(ctx context.Context, player PlayerRecord) error
StorePlayer stores or updates a player record and their stats.
func (*SQLiteKB) StorePlayerSkills ¶
func (kb *SQLiteKB) StorePlayerSkills(ctx context.Context, playerID string, skills []PlayerSkillRecord) error
StorePlayerSkills stores a player's skill progress.
func (*SQLiteKB) StoreRecipes ¶
StoreRecipes stores or replaces all recipes in the catalog.
func (*SQLiteKB) StoreShip ¶
func (kb *SQLiteKB) StoreShip(ctx context.Context, ship ShipRecord) error
StoreShip stores or updates a ship record with its cargo and modules.
func (*SQLiteKB) StoreShipClasses ¶
func (kb *SQLiteKB) StoreShipClasses(ctx context.Context, classes []ShipClassDef) error
StoreShipClasses stores or replaces all ship classes in the catalog.
func (*SQLiteKB) StoreShipListings ¶
func (kb *SQLiteKB) StoreShipListings(ctx context.Context, listings ShipListings, agentID string) error
StoreShipListings stores ship listings at a station
func (*SQLiteKB) StoreSkills ¶
StoreSkills stores or replaces all skills in the catalog.
func (*SQLiteKB) UpsertSystemFromMap ¶
func (kb *SQLiteKB) UpsertSystemFromMap(ctx context.Context, data MapSystemData) error
UpsertSystemFromMap inserts or updates a system using map data only. Unlike RememberSystem, this preserves richer data (police_level, description, last_updated_tick) that may have been collected by explorers. It only updates fields that the map data provides: name, position, empire (when non-empty), is_stronghold, and connections.
type ShipClassDef ¶
type ShipClassDef struct {
ID string
Name string
Class string
Category string
Description string
Lore string
Faction string
Tier int
Scale int
Price int
BaseHull int
BaseShield int
BaseShieldRecharge int
BaseArmor int
BaseSpeed int
BaseFuel int
CargoCapacity int
CPUCapacity int
PowerCapacity int
WeaponSlots int
DefenseSlots int
UtilitySlots int
BuildTime int
ShipyardTier int
StarterShip bool
TowSpeedBonus int
RequiredSkills map[string]int
DefaultModules []string
FlavorTags []string
BuildMaterials []BuildMaterial
LastUpdatedTick int64
}
ShipClassDef represents a ship class definition stored in the knowledge base.
type ShipListing ¶
type ShipListing struct {
ShipClass string
ShipName string
BasePrice float64
Description string
CargoSpace int
ModuleSlots int
UtilitySlots int
WeaponSlots int
}
ShipListing represents a single ship listing at a station
type ShipListings ¶
type ShipListings struct {
SystemID string
SystemName string
StationID string
StationName string
GameTick int64
Listings []ShipListing
CapturedAt time.Time
}
ShipListings represents captured ship listings at a station
type ShipModuleRecord ¶
type ShipModuleRecord struct {
ID string
TypeID string
Name string
Type string
CPUUsage int
PowerUsage int
Quality float64
QualityGrade string
Wear float64
WearStatus string
LastUpdatedTick int64
}
ShipModuleRecord represents a module fitted on a ship.
type ShipRecord ¶
type ShipRecord struct {
ID string
OwnerID string
ClassID string
Name string
Hull float64
MaxHull float64
Shield float64
MaxShield float64
ShieldRecharge float64
Armor float64
Speed float64
Fuel float64
MaxFuel float64
CargoUsed float64
CargoCapacity float64
CPUUsed float64
CPUCapacity float64
PowerUsed float64
PowerCapacity float64
WeaponSlots int
DefenseSlots int
UtilitySlots int
DockedAtBase string
Cargo []CargoEntry
Modules []ShipModuleRecord
LastUpdatedTick int64
}
ShipRecord represents a player-owned ship stored in the knowledge base.
type Skill ¶
type Skill struct {
ID string `json:"id"`
Name string `json:"name"`
Category string `json:"category"`
Description string `json:"description"`
MaxLevel int `json:"max_level"`
TrainingSource string `json:"training_source,omitempty"`
XPPerLevel []int `json:"xp_per_level"`
BonusPerLevel map[string]int `json:"bonus_per_level,omitempty"`
RequiredSkills map[string]int `json:"required_skills,omitempty"`
}
Skill represents a skill in SpaceMolt with its XP requirements
func (*Skill) GetNextLevelXP ¶
GetNextLevelXP returns the XP required to reach the next level from current level
func (*Skill) GetXPForLevel ¶
GetXPForLevel returns the XP required to reach a specific level (1-indexed)
type SpaceBase ¶
type SpaceBase struct {
ID string
POIID string // The POI this base is located at
Name string
Description string
Empire string
DefenseLevel int
HasDrones bool
PublicAccess bool
Services map[string]bool
Facilities []Facility // Facilities with category and level information
Market []BaseMarketItem
LastUpdatedTick int64
}
SpaceBase represents knowledge about a space station, outpost, base, or fortress
func BaseDataFromRawJSON ¶
func BaseDataFromRawJSON(rawJSON []byte, discoveredBy string, lastUpdatedTick int64) (*SpaceBase, error)
BaseDataFromRawJSON extracts base information from raw get_base response JSON Returns a SpaceBase that can be saved to the knowledge base
Example usage in an agent:
rawJSON := client.GetRawJSON("base")
if rawJSON != nil {
base, err := knowledge.BaseDataFromRawJSON(rawJSON, agentID, state.GetTick())
if err != nil {
logger.Printf("Failed to parse base data: %v", err)
return err
}
if err := kb.RememberBase(ctx, *base); err != nil {
logger.Printf("Failed to save base to knowledge base: %v", err)
return err
}
}
type System ¶
type System struct {
ID string
Name string
Description string
Position game.Position
PoliceLevel int // Security level 0-3 (0=none, 1=low, 2=medium, 3=high)
SecurityStatus string // e.g. "high_sec", "low_sec", "null_sec"
Empire string
IsStronghold bool
Connections []SystemConnection
POIs []string
LastUpdatedTick int64
}
System represents knowledge about a solar system Wraps game.SystemData with exploration metadata
type SystemConnection ¶
SystemConnection pairs a connected system ID with the jump distance.