updates on the ai and agent and all thse things awith onboarding

This commit is contained in:
2026-09-30 14:47:58 +05:30
parent 44ba33eda2
commit 0ac5d3d54f
37 changed files with 7755 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
package migrations
import (
"doormile/internal/ai/registry"
"doormile/models"
"doormile/utils"
"gorm.io/gorm"
@@ -60,6 +61,18 @@ func Migrate(db *gorm.DB) error {
&models.BookingStageEvent{},
&models.CustomerRefreshToken{},
&models.CustomerDevice{},
// AI agent registry (agent-platform-plan Phase 1). Five new tables,
// nothing existing touched.
&models.AIAgent{},
&models.AITool{},
&models.AISkill{},
&models.AISkillTool{},
&models.AIRegistryAudit{},
// Agent runs recorded from AI_engine telemetry (plan Phase 4). One new
// append-only table, pruned after 30 days.
&models.AIAgentRun{},
)
if err != nil {
@@ -69,6 +82,13 @@ func Migrate(db *gorm.DB) error {
utils.Info("✅ Database migration completed successfully!")
// Upsert the code-defined agent registry. A failure is logged, not fatal:
// the registry is read by Agent Studio and AI_engine, and neither is on a
// booking's path, so it must not stop the API from serving orders.
if err := registry.Seed(db); err != nil {
utils.Error("⚠️ AI registry seed failed", "error", err.Error())
}
if res := db.Exec(`ALTER TABLE agent_decisions ADD COLUMN IF NOT EXISTS context_embedding vector(1536)`); res.Error != nil {
utils.Error("❌ Failed to add context_embedding column", "error", res.Error)
} else {