143 lines
2.6 KiB
Python
Executable File
143 lines
2.6 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""
|
|
GOAP (Goal-Oriented Action Planning) Autonomy System for Allegro-Primus Child
|
|
|
|
This package provides true autonomous behavior for the Child through:
|
|
- Goal management (hunger, safety, learning, social, growth)
|
|
- Action library with preconditions and effects
|
|
- A* search-based planning
|
|
- Plan execution with monitoring
|
|
- Full integration with existing monitoring infrastructure
|
|
|
|
Usage:
|
|
from goap import SelfGOAP
|
|
|
|
goap = SelfGOAP()
|
|
await goap.run()
|
|
"""
|
|
|
|
__version__ = "1.0.0"
|
|
__author__ = "Allegro-Primus"
|
|
|
|
# Core components
|
|
from .goals import (
|
|
Goal,
|
|
GoalManager,
|
|
GoalState,
|
|
GoalCategory,
|
|
GoalPriority,
|
|
# Specific goals
|
|
ResourceAcquisitionGoal,
|
|
EfficiencyGoal,
|
|
SystemHealthGoal,
|
|
SecurityGoal,
|
|
DataIntegrityGoal,
|
|
KnowledgeAcquisitionGoal,
|
|
SkillDevelopmentGoal,
|
|
AdaptationGoal,
|
|
UserEngagementGoal,
|
|
RelationshipBuildingGoal,
|
|
CollaborationGoal,
|
|
SelfImprovementGoal,
|
|
ExplorationGoal,
|
|
# Singleton
|
|
goal_manager
|
|
)
|
|
|
|
from .actions import (
|
|
Action,
|
|
ActionResult,
|
|
ActionStatus,
|
|
ActionLibrary,
|
|
# Specific actions
|
|
CheckSystemHealth,
|
|
CleanupResources,
|
|
RestartService,
|
|
BackupData,
|
|
ResearchTopic,
|
|
IndexKnowledge,
|
|
LearnFromInteraction,
|
|
PracticeSkill,
|
|
AcquireNewSkill,
|
|
SendMessage,
|
|
ProactiveCheckIn,
|
|
ShareKnowledge,
|
|
SelfAnalysis,
|
|
Experiment,
|
|
# Singleton
|
|
action_library
|
|
)
|
|
|
|
from .planner import (
|
|
Plan,
|
|
PlanStatus,
|
|
GOAPPlanner,
|
|
PlanOptimizer,
|
|
PlanLibrary,
|
|
HeuristicCalculator,
|
|
# Singleton
|
|
planner
|
|
)
|
|
|
|
from .executor import (
|
|
PlanExecutor,
|
|
ExecutionContext,
|
|
ExecutionReport,
|
|
ExecutionMode,
|
|
ExecutionScheduler,
|
|
ExecutionMonitor,
|
|
# Singleton
|
|
executor
|
|
)
|
|
|
|
from .self_goap import (
|
|
SelfGOAP,
|
|
ChildState,
|
|
WorldStateCollector,
|
|
# Singleton
|
|
self_goap
|
|
)
|
|
|
|
__all__ = [
|
|
# Core classes
|
|
'SelfGOAP',
|
|
'ChildState',
|
|
'WorldStateCollector',
|
|
|
|
# Goals
|
|
'Goal',
|
|
'GoalManager',
|
|
'GoalState',
|
|
'GoalCategory',
|
|
'GoalPriority',
|
|
|
|
# Actions
|
|
'Action',
|
|
'ActionResult',
|
|
'ActionStatus',
|
|
'ActionLibrary',
|
|
|
|
# Planning
|
|
'Plan',
|
|
'PlanStatus',
|
|
'GOAPPlanner',
|
|
'PlanOptimizer',
|
|
'PlanLibrary',
|
|
'HeuristicCalculator',
|
|
|
|
# Execution
|
|
'PlanExecutor',
|
|
'ExecutionContext',
|
|
'ExecutionReport',
|
|
'ExecutionMode',
|
|
'ExecutionScheduler',
|
|
'ExecutionMonitor',
|
|
|
|
# Singletons
|
|
'self_goap',
|
|
'goal_manager',
|
|
'action_library',
|
|
'planner',
|
|
'executor',
|
|
]
|