refactor(auth): delegate access control to be-system

Remove Agent Desk users, roles, login sessions, tokens, and local permission persistence. Expose the backend as an embeddable ai-agent module with host-provided subject lookup and operation authorization callbacks, and complete the frontend/backend repository split.
This commit is contained in:
t
2026-08-21 00:41:07 +08:00
parent 3d47227fbd
commit 2bbf42b741
447 changed files with 1901 additions and 8920 deletions
+36
View File
@@ -0,0 +1,36 @@
package agentdesk
import (
"errors"
"net/http"
"code.tczkiot.com/wlw/ai-agent/identity"
"code.tczkiot.com/wlw/ai-agent/internal/bootstrap"
"code.tczkiot.com/wlw/ai-agent/internal/services"
)
type Options struct {
ConfigPath string
QuerySubjects identity.QuerySubjectsFunc
Authorize identity.AuthorizeFunc
}
// New initializes the customer-service business module. Authentication and
// authorization must already have been completed by the host system.
func New(options Options) (http.Handler, error) {
if options.QuerySubjects == nil {
return nil, errors.New("agent-desk: QuerySubjects is required")
}
if options.Authorize == nil {
return nil, errors.New("agent-desk: Authorize is required")
}
if options.ConfigPath == "" {
options.ConfigPath = "config/config.yaml"
}
services.SetQuerySubjects(options.QuerySubjects)
services.SetAuthorize(options.Authorize)
if err := bootstrap.Init(options.ConfigPath); err != nil {
return nil, err
}
return bootstrap.NewServer()
}
+1 -10
View File
@@ -1,7 +1,7 @@
package main package main
import ( import (
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"github.com/mlogclub/codegen" "github.com/mlogclub/codegen"
) )
@@ -19,19 +19,10 @@ func main() {
WebEdit: false, WebEdit: false,
}, },
codegen.GetGenerateStruct(&models.Migration{}), codegen.GetGenerateStruct(&models.Migration{}),
codegen.GetGenerateStruct(&models.User{}),
codegen.GetGenerateStruct(&models.UserIdentity{}),
codegen.GetGenerateStruct(&models.Company{}), codegen.GetGenerateStruct(&models.Company{}),
codegen.GetGenerateStruct(&models.Customer{}), codegen.GetGenerateStruct(&models.Customer{}),
codegen.GetGenerateStruct(&models.CustomerIdentity{}), codegen.GetGenerateStruct(&models.CustomerIdentity{}),
codegen.GetGenerateStruct(&models.CustomerContact{}), codegen.GetGenerateStruct(&models.CustomerContact{}),
codegen.GetGenerateStruct(&models.Role{}),
codegen.GetGenerateStruct(&models.Permission{}),
codegen.GetGenerateStruct(&models.UserRole{}),
codegen.GetGenerateStruct(&models.RolePermission{}),
codegen.GetGenerateStruct(&models.UserPermission{}),
codegen.GetGenerateStruct(&models.LoginSession{}),
codegen.GetGenerateStruct(&models.LoginCredentialLog{}),
codegen.GetGenerateStruct(&models.Asset{}), codegen.GetGenerateStruct(&models.Asset{}),
codegen.GetGenerateStruct(&models.Tag{}), codegen.GetGenerateStruct(&models.Tag{}),
codegen.GetGenerateStruct(&models.Conversation{}), codegen.GetGenerateStruct(&models.Conversation{}),
+3 -3
View File
@@ -3,9 +3,9 @@ package main
import ( import (
"log/slog" "log/slog"
"agent-desk/internal/bootstrap" "code.tczkiot.com/wlw/ai-agent/internal/bootstrap"
"agent-desk/internal/pkg/config" "code.tczkiot.com/wlw/ai-agent/internal/pkg/config"
"agent-desk/internal/pkg/logx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/logx"
) )
func main() { func main() {
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"flag" "flag"
"log/slog" "log/slog"
"agent-desk/internal/bootstrap" "code.tczkiot.com/wlw/ai-agent/internal/bootstrap"
"agent-desk/internal/pkg/config" "code.tczkiot.com/wlw/ai-agent/internal/pkg/config"
) )
func main() { func main() {
-200
View File
@@ -1,200 +0,0 @@
package agentteam
import (
"agent-desk/cmd/testdata/seedlang"
"agent-desk/cmd/testdata/seeds"
"agent-desk/internal/models"
"agent-desk/internal/pkg/constants"
"agent-desk/internal/pkg/enums"
"agent-desk/internal/repositories"
"fmt"
"time"
"github.com/mlogclub/simple/sqls"
"golang.org/x/crypto/bcrypt"
)
type InitResult struct {
TeamCreated bool
UsersCreated int
ProfilesCreated int
UpdatesApplied int
}
// Init 初始化客服组和客服用户
// 创建:
// 1. 客服组,组长为管理员用户
// 2. 客服A 用户
// 3. 客服B 用户
// 4. 为客服A和客服B创建客服档案,关联到该客服组
func Init(lang seedlang.Language) (*InitResult, error) {
result := &InitResult{}
// 获取管理员用户
adminUser := repositories.UserRepository.Take(
sqls.DB(),
"username = ?",
constants.BootstrapAdminUsername,
)
if adminUser == nil {
return result, fmt.Errorf("bootstrap admin user not found")
}
err := sqls.WithTransaction(func(ctx *sqls.TxContext) error {
return initTeamAndUsers(ctx, adminUser, result, lang)
})
if err != nil {
return result, fmt.Errorf("init team and users failed: %w", err)
}
return result, nil
}
func initTeamAndUsers(ctx *sqls.TxContext, leaderUser *models.User, result *InitResult, lang seedlang.Language) error {
teamName := seeds.AgentTeamName(lang)
now := time.Now()
team := repositories.AgentTeamRepository.Take(ctx.Tx, "name = ?", teamName)
if team != nil {
if err := ctx.Tx.Model(team).Updates(map[string]any{
"leader_user_id": leaderUser.ID,
"update_user_id": constants.SystemAuditUserID,
"update_user_name": constants.SystemAuditUserName,
"updated_at": now,
}).Error; err != nil {
return err
}
} else {
team = &models.AgentTeam{
Name: teamName,
LeaderUserID: leaderUser.ID,
Status: enums.StatusOk,
Description: "Local testdata seed - default service team",
AuditFields: models.AuditFields{
CreatedAt: now,
CreateUserID: constants.SystemAuditUserID,
CreateUserName: constants.SystemAuditUserName,
UpdatedAt: now,
UpdateUserID: constants.SystemAuditUserID,
UpdateUserName: constants.SystemAuditUserName,
},
}
if err := ctx.Tx.Create(team).Error; err != nil {
return err
}
result.TeamCreated = true
}
agentUsers := seeds.AgentUsers(lang, leaderUser.Username)
for _, agentUser := range agentUsers {
userID, userCreated, err := createOrGetUser(ctx, agentUser.Username, agentUser.Nickname)
if err != nil {
return err
}
if userCreated {
result.UsersCreated++
}
// 创建或更新客服档案
profileCreated, err := createOrUpdateProfile(ctx, userID, team.ID, agentUser.Code, agentUser.Nickname)
if err != nil {
return err
}
if profileCreated {
result.ProfilesCreated++
} else {
result.UpdatesApplied++
}
}
return nil
}
func createOrGetUser(ctx *sqls.TxContext, username, nickname string) (int64, bool, error) {
user := repositories.UserRepository.Take(
ctx.Tx,
"username = ?",
username,
)
if user != nil {
return user.ID, false, nil
}
// 创建新用户
hashedPassword, err := bcrypt.GenerateFromPassword([]byte(constants.BootstrapAdminPassword), bcrypt.DefaultCost)
if err != nil {
return 0, false, err
}
now := time.Now()
newUser := &models.User{
Username: username,
Nickname: nickname,
Password: string(hashedPassword),
Status: enums.StatusOk,
Remark: "Local testdata seed",
AuditFields: models.AuditFields{
CreatedAt: now,
CreateUserID: constants.SystemAuditUserID,
CreateUserName: constants.SystemAuditUserName,
UpdatedAt: now,
UpdateUserID: constants.SystemAuditUserID,
UpdateUserName: constants.SystemAuditUserName,
},
}
if err := ctx.Tx.Create(newUser).Error; err != nil {
return 0, false, err
}
return newUser.ID, true, nil
}
func createOrUpdateProfile(ctx *sqls.TxContext, userID, teamID int64, agentCode, displayName string) (bool, error) {
profile := repositories.AgentProfileRepository.Take(
ctx.Tx,
"user_id = ?",
userID,
)
now := time.Now()
if profile != nil {
// 档案已存在,更新关键信息
return false, ctx.Tx.Model(profile).Updates(map[string]any{
"team_id": teamID,
"agent_code": agentCode,
"display_name": displayName,
"status": enums.StatusOk,
"update_user_id": constants.SystemAuditUserID,
"update_user_name": constants.SystemAuditUserName,
"updated_at": now,
}).Error
}
// 创建新档案
newProfile := &models.AgentProfile{
UserID: userID,
TeamID: teamID,
AgentCode: agentCode,
DisplayName: displayName,
Avatar: "",
ServiceStatus: enums.ServiceStatusIdle,
MaxConcurrentCount: 5,
PriorityLevel: 10,
AutoAssignEnabled: true,
Status: enums.StatusOk,
Remark: "Local testdata seed",
AuditFields: models.AuditFields{
CreatedAt: now,
CreateUserID: constants.SystemAuditUserID,
CreateUserName: constants.SystemAuditUserName,
UpdatedAt: now,
UpdateUserID: constants.SystemAuditUserID,
UpdateUserName: constants.SystemAuditUserName,
},
}
return true, ctx.Tx.Create(newProfile).Error
}
-23
View File
@@ -1,23 +0,0 @@
package agentteam
import (
"agent-desk/cmd/testdata/seedlang"
"agent-desk/cmd/testdata/seeds"
"regexp"
"testing"
)
var hanTextPattern = regexp.MustCompile(`\p{Han}`)
func TestEnglishAgentTeamTextDoesNotContainChineseText(t *testing.T) {
values := []string{seeds.AgentTeamName(seedlang.English)}
for _, user := range seeds.AgentUsers(seedlang.English, "admin") {
values = append(values, user.Nickname)
}
for _, value := range values {
if hanTextPattern.MatchString(value) {
t.Fatalf("english agent team seed contains Chinese text: %q", value)
}
}
}
+6 -6
View File
@@ -1,12 +1,12 @@
package aiagent package aiagent
import ( import (
"agent-desk/cmd/testdata/seedlang" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
"agent-desk/cmd/testdata/seeds" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seeds"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/pkg/utils" "code.tczkiot.com/wlw/ai-agent/internal/pkg/utils"
"agent-desk/internal/repositories" "code.tczkiot.com/wlw/ai-agent/internal/repositories"
"fmt" "fmt"
"strings" "strings"
"time" "time"
+2 -2
View File
@@ -1,8 +1,8 @@
package aiagent package aiagent
import ( import (
"agent-desk/cmd/testdata/seedlang" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
"agent-desk/cmd/testdata/seeds" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seeds"
"regexp" "regexp"
"strings" "strings"
"testing" "testing"
+4 -4
View File
@@ -6,10 +6,10 @@ import (
"strings" "strings"
"time" "time"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/constants" "code.tczkiot.com/wlw/ai-agent/internal/pkg/constants"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/repositories" "code.tczkiot.com/wlw/ai-agent/internal/repositories"
"github.com/mlogclub/simple/sqls" "github.com/mlogclub/simple/sqls"
"gopkg.in/yaml.v3" "gopkg.in/yaml.v3"
+5 -5
View File
@@ -1,11 +1,11 @@
package channel package channel
import ( import (
"agent-desk/cmd/testdata/seedlang" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
"agent-desk/cmd/testdata/seeds" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seeds"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/repositories" "code.tczkiot.com/wlw/ai-agent/internal/repositories"
"fmt" "fmt"
"time" "time"
+2 -2
View File
@@ -1,8 +1,8 @@
package channel package channel
import ( import (
"agent-desk/cmd/testdata/seedlang" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
"agent-desk/cmd/testdata/seeds" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seeds"
"regexp" "regexp"
"testing" "testing"
) )
+6 -6
View File
@@ -1,12 +1,12 @@
package kb package kb
import ( import (
"agent-desk/cmd/testdata/seedlang" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
"agent-desk/cmd/testdata/seeds" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seeds"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/constants" "code.tczkiot.com/wlw/ai-agent/internal/pkg/constants"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/repositories" "code.tczkiot.com/wlw/ai-agent/internal/repositories"
"encoding/json" "encoding/json"
"time" "time"
+2 -2
View File
@@ -1,8 +1,8 @@
package kb package kb
import ( import (
"agent-desk/cmd/testdata/seedlang" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
"agent-desk/cmd/testdata/seeds" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seeds"
"regexp" "regexp"
"testing" "testing"
) )
+10 -21
View File
@@ -1,17 +1,16 @@
package main package main
import ( import (
"agent-desk/cmd/testdata/agentteam" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/aiagent"
"agent-desk/cmd/testdata/aiagent" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/aiconfig"
"agent-desk/cmd/testdata/aiconfig" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/channel"
"agent-desk/cmd/testdata/channel" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/kb"
"agent-desk/cmd/testdata/kb" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/quickreply"
"agent-desk/cmd/testdata/quickreply" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
"agent-desk/cmd/testdata/seedlang" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/skill"
"agent-desk/cmd/testdata/skill" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/tag"
"agent-desk/cmd/testdata/tag" "code.tczkiot.com/wlw/ai-agent/internal/bootstrap"
"agent-desk/internal/bootstrap" "code.tczkiot.com/wlw/ai-agent/internal/pkg/config"
"agent-desk/internal/pkg/config"
"flag" "flag"
"fmt" "fmt"
"log/slog" "log/slog"
@@ -94,16 +93,6 @@ func run() error {
} }
slog.Info("skill init success", slog.Int("created", skillResult.Created), slog.Int("updated", skillResult.Updated)) slog.Info("skill init success", slog.Int("created", skillResult.Created), slog.Int("updated", skillResult.Updated))
agentTeamResult, err := agentteam.Init(lang)
if err != nil {
return fmt.Errorf("init agent team failed: %w", err)
}
slog.Info("agent team init success", slog.Bool("teamCreated", agentTeamResult.TeamCreated),
slog.Int("usersCreated", agentTeamResult.UsersCreated),
slog.Int("profilesCreated", agentTeamResult.ProfilesCreated),
slog.Int("updatesApplied", agentTeamResult.UpdatesApplied),
)
aiAgentResult, err := aiagent.Init(lang) aiAgentResult, err := aiagent.Init(lang)
if err != nil { if err != nil {
return fmt.Errorf("init ai agent failed: %w", err) return fmt.Errorf("init ai agent failed: %w", err)
+4 -4
View File
@@ -1,10 +1,10 @@
package quickreply package quickreply
import ( import (
"agent-desk/cmd/testdata/seedlang" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
"agent-desk/cmd/testdata/seeds" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seeds"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/repositories" "code.tczkiot.com/wlw/ai-agent/internal/repositories"
"time" "time"
"github.com/mlogclub/simple/sqls" "github.com/mlogclub/simple/sqls"
+2 -2
View File
@@ -1,8 +1,8 @@
package quickreply package quickreply
import ( import (
"agent-desk/cmd/testdata/seedlang" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
"agent-desk/cmd/testdata/seeds" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seeds"
"regexp" "regexp"
"testing" "testing"
) )
+1 -1
View File
@@ -1,6 +1,6 @@
package seeds package seeds
import "agent-desk/cmd/testdata/seedlang" import "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
type AgentUserSeed struct { type AgentUserSeed struct {
Username string Username string
+2 -2
View File
@@ -1,8 +1,8 @@
package seeds package seeds
import ( import (
"agent-desk/cmd/testdata/seedlang" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
) )
type AIAgentSeed struct { type AIAgentSeed struct {
+3 -3
View File
@@ -1,9 +1,9 @@
package seeds package seeds
import ( import (
"agent-desk/cmd/testdata/seedlang" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
"agent-desk/internal/pkg/dto" "code.tczkiot.com/wlw/ai-agent/internal/pkg/dto"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"github.com/mlogclub/simple/common/jsons" "github.com/mlogclub/simple/common/jsons"
) )
+1 -2
View File
@@ -1,6 +1,6 @@
package seeds package seeds
import "agent-desk/cmd/testdata/seedlang" import "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
type KnowledgeBaseSeed struct { type KnowledgeBaseSeed struct {
Name string Name string
@@ -83,7 +83,6 @@ func chineseKnowledgeFAQSeeds() []KnowledgeFAQSeed {
{Question: "新成员加入后如何开通后台账号?", Answer: "企业管理员进入“组织设置-成员管理”,点击“新增成员”,填写姓名、邮箱、所属团队和角色后保存。系统会自动发送激活邮件,成员首次登录时设置密码即可。若你们开通了单点登录,也可以直接从企业身份系统同步成员。", SimilarQuestions: []string{"怎么给新客服开账号", "新增员工账号在哪里", "成员怎么加入后台"}, Remark: "成员管理"}, {Question: "新成员加入后如何开通后台账号?", Answer: "企业管理员进入“组织设置-成员管理”,点击“新增成员”,填写姓名、邮箱、所属团队和角色后保存。系统会自动发送激活邮件,成员首次登录时设置密码即可。若你们开通了单点登录,也可以直接从企业身份系统同步成员。", SimilarQuestions: []string{"怎么给新客服开账号", "新增员工账号在哪里", "成员怎么加入后台"}, Remark: "成员管理"},
{Question: "成员离职后如何停用账号?", Answer: "请在“组织设置-成员管理”中找到对应成员,点击“停用”即可。停用后该账号无法继续登录,但历史会话、工单处理记录和质检数据会保留,不会影响报表统计。若后续确认不再使用,也可以在完成交接后删除账号。", SimilarQuestions: []string{"离职员工账号怎么处理", "怎么禁用成员账号", "停用客服账号"}, Remark: "成员管理"}, {Question: "成员离职后如何停用账号?", Answer: "请在“组织设置-成员管理”中找到对应成员,点击“停用”即可。停用后该账号无法继续登录,但历史会话、工单处理记录和质检数据会保留,不会影响报表统计。若后续确认不再使用,也可以在完成交接后删除账号。", SimilarQuestions: []string{"离职员工账号怎么处理", "怎么禁用成员账号", "停用客服账号"}, Remark: "成员管理"},
{Question: "角色权限修改后多久生效?", Answer: "角色权限保存后通常即时生效。已在线的成员可能需要刷新页面或重新登录,才能拿到最新权限菜单和接口授权。如果修改后仍能访问原页面,请清理浏览器缓存后再试。", SimilarQuestions: []string{"权限修改什么时候生效", "调整角色后没变化", "角色更新后要重登吗"}, Remark: "成员管理"}, {Question: "角色权限修改后多久生效?", Answer: "角色权限保存后通常即时生效。已在线的成员可能需要刷新页面或重新登录,才能拿到最新权限菜单和接口授权。如果修改后仍能访问原页面,请清理浏览器缓存后再试。", SimilarQuestions: []string{"权限修改什么时候生效", "调整角色后没变化", "角色更新后要重登吗"}, Remark: "成员管理"},
{Question: "支持企业微信或钉钉单点登录吗?", Answer: "支持对接企业微信、钉钉和标准 SAML/OIDC 单点登录。开通后成员可通过企业身份系统直接登录平台,无需单独维护密码。具体配置需要管理员在“安全设置-单点登录”中填写回调地址、应用凭证并完成测试。", SimilarQuestions: []string{"能接企业微信登录吗", "支持钉钉 SSO 吗", "单点登录怎么接"}, Remark: "成员管理"},
{Question: "坐席在线、忙碌、离线状态有什么区别?", Answer: "在线表示可正常接待新会话,忙碌表示当前暂不分配新会话但仍可处理已有会话,离线表示不参与会话分配也不接收实时提醒。若开启自动状态切换,长时间无操作或退出登录后,系统会自动变更为离线。", SimilarQuestions: []string{"客服状态怎么理解", "在线忙碌离线区别", "坐席状态说明"}, Remark: "坐席接待"}, {Question: "坐席在线、忙碌、离线状态有什么区别?", Answer: "在线表示可正常接待新会话,忙碌表示当前暂不分配新会话但仍可处理已有会话,离线表示不参与会话分配也不接收实时提醒。若开启自动状态切换,长时间无操作或退出登录后,系统会自动变更为离线。", SimilarQuestions: []string{"客服状态怎么理解", "在线忙碌离线区别", "坐席状态说明"}, Remark: "坐席接待"},
{Question: "会话是怎么分配给坐席的?", Answer: "默认按技能组和轮询策略分配,也可结合坐席当前负载、最近响应时长和优先级规则进行智能分流。若客户命中了指定渠道、语言或标签条件,系统会优先路由到匹配该条件的团队或坐席。", SimilarQuestions: []string{"客户咨询怎么分配", "会话路由规则是什么", "新会话按什么分给客服"}, Remark: "坐席接待"}, {Question: "会话是怎么分配给坐席的?", Answer: "默认按技能组和轮询策略分配,也可结合坐席当前负载、最近响应时长和优先级规则进行智能分流。若客户命中了指定渠道、语言或标签条件,系统会优先路由到匹配该条件的团队或坐席。", SimilarQuestions: []string{"客户咨询怎么分配", "会话路由规则是什么", "新会话按什么分给客服"}, Remark: "坐席接待"},
{Question: "如何把会话转接给其他团队?", Answer: "在会话详情页点击“转接”,选择目标团队或指定坐席,并填写转接备注即可。转接后,原坐席仍可在历史记录中查看会话内容,但新消息会优先提醒接收方。若目标团队离线人数过多,建议先确认有人值班。", SimilarQuestions: []string{"会话怎么转给别的组", "转接客服在哪里", "咨询如何分配给其他团队"}, Remark: "坐席接待"}, {Question: "如何把会话转接给其他团队?", Answer: "在会话详情页点击“转接”,选择目标团队或指定坐席,并填写转接备注即可。转接后,原坐席仍可在历史记录中查看会话内容,但新消息会优先提醒接收方。若目标团队离线人数过多,建议先确认有人值班。", SimilarQuestions: []string{"会话怎么转给别的组", "转接客服在哪里", "咨询如何分配给其他团队"}, Remark: "坐席接待"},
+2 -2
View File
@@ -1,8 +1,8 @@
package seeds package seeds
import ( import (
"agent-desk/cmd/testdata/seedlang" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
) )
type QuickReplySeed struct { type QuickReplySeed struct {
+2 -2
View File
@@ -1,8 +1,8 @@
package seeds package seeds
import ( import (
"agent-desk/cmd/testdata/seedlang" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
) )
type SkillDefinitionSeed struct { type SkillDefinitionSeed struct {
+1 -1
View File
@@ -1,6 +1,6 @@
package seeds package seeds
import "agent-desk/cmd/testdata/seedlang" import "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
type TagSeed struct { type TagSeed struct {
ID int64 ID int64
+4 -4
View File
@@ -1,10 +1,10 @@
package skill package skill
import ( import (
"agent-desk/cmd/testdata/seedlang" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
"agent-desk/cmd/testdata/seeds" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seeds"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/repositories" "code.tczkiot.com/wlw/ai-agent/internal/repositories"
"fmt" "fmt"
"strings" "strings"
"time" "time"
+2 -2
View File
@@ -1,8 +1,8 @@
package skill package skill
import ( import (
"agent-desk/cmd/testdata/seedlang" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
"agent-desk/cmd/testdata/seeds" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seeds"
"regexp" "regexp"
"testing" "testing"
) )
+5 -5
View File
@@ -1,11 +1,11 @@
package tag package tag
import ( import (
"agent-desk/cmd/testdata/seedlang" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
"agent-desk/cmd/testdata/seeds" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seeds"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/repositories" "code.tczkiot.com/wlw/ai-agent/internal/repositories"
"time" "time"
"github.com/mlogclub/simple/sqls" "github.com/mlogclub/simple/sqls"
+2 -2
View File
@@ -1,8 +1,8 @@
package tag package tag
import ( import (
"agent-desk/cmd/testdata/seedlang" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seedlang"
"agent-desk/cmd/testdata/seeds" "code.tczkiot.com/wlw/ai-agent/cmd/testdata/seeds"
"regexp" "regexp"
"testing" "testing"
) )
+3 -51
View File
@@ -2,7 +2,7 @@ language: zh-CN
server: server:
port: 8083 port: 8083
# Public address of the independently deployed frontend. Login callbacks redirect here. # Public address of the independently deployed frontend.
frontendUrl: http://127.0.0.1:3000 frontendUrl: http://127.0.0.1:3000
cors: cors:
# Browser CORS allowlist. In production, replace this with the actual frontend or embedded-site domains, such as https://support.example.com. # Browser CORS allowlist. In production, replace this with the actual frontend or embedded-site domains, such as https://support.example.com.
@@ -34,25 +34,6 @@ logger:
format: text format: text
addSource: false addSource: false
auth:
# Login access token lifetime, in hours. Values <= 0 fall back to 12 hours.
# Applies to password login, OIDC login, and WeCom login sessions.
tokenTTLHours: 12
# Maximum failed password attempts allowed within the lock window.
# Values <= 0 disable credential lockout.
maxFailedAttempts: 5
# Failed-login lock window, in minutes. When maxFailedAttempts is reached within this window, login is temporarily blocked.
# Values <= 0 fall back to 15 minutes when lockout is enabled.
credentialLockMinute: 15
customerSession:
# Signing secret for customer service session tokens. Use a separate, high-entropy random string; do not reuse the channel userTokenSecret.
secret: ""
# Default lifetime for customer service session tokens, in minutes.
ttlMinutes: 120
# Automatically refresh the token when its remaining lifetime falls below this value, in minutes.
refreshThresholdMinutes: 30
storage: storage:
# Default file storage provider used for uploads. Supported values: local, oss. # Default file storage provider used for uploads. Supported values: local, oss.
# Empty value is treated as local by the backend. # Empty value is treated as local by the backend.
@@ -108,25 +89,9 @@ mcp:
# Extra HTTP headers sent to this MCP server on every request, for example Authorization or tenant headers. # Extra HTTP headers sent to this MCP server on every request, for example Authorization or tenant headers.
headers: {} headers: {}
oidc:
# Whether to enable OIDC login. This system acts as the OIDC client.
enabled: false
# OIDC provider issuer, for example https://idp.example.com/realms/demo.
issuer: ""
clientId: ""
clientSecret: ""
# Must exactly match the redirect_uri registered with the OIDC provider.
redirectUrl: "http://127.0.0.1:8083/api/auth/oidc_callback"
# Signing secret for the OIDC login state. If left empty, clientSecret is used as the fallback.
stateSecret: ""
scopes:
- openid
- profile
- email
wxWork: wxWork:
# Whether to enable WeCom features. # Whether to enable WeCom features.
# When set to false, the WeCom SDK is not initialized, and login, customer service callbacks, and app notifications are unavailable. # When set to false, the WeCom SDK is not initialized, and customer service callbacks and app notifications are unavailable.
enabled: false enabled: false
# WeCom corporate ID. # WeCom corporate ID.
# Example: wwxxxxxxxxxxxxxxxx, from the WeCom admin console. # Example: wwxxxxxxxxxxxxxxxx, from the WeCom admin console.
@@ -134,26 +99,13 @@ wxWork:
# WeCom app secret. # WeCom app secret.
# Used by the backend to obtain access tokens and user identities. Keep it confidential. # Used by the backend to obtain access tokens and user identities. Keep it confidential.
corpSecret: "" corpSecret: ""
# AgentID of the WeCom custom app. # AgentID of the WeCom custom app, used for app notifications.
# Used for web authorization when scope=snsapi_privateinfo.
agentId: agentId:
# WeCom web authorization callback URL.
# Must be a full URL pointing to the backend endpoint:
# Example: http://127.0.0.1:8083/api/auth/wxwork_callback
# In production, use an official domain that WeCom can access, and make sure the domain is configured in the WeCom admin console.
oauthRedirect: ""
# Signing secret for the WeCom login state.
# Used for tamper protection and replay protection. A separate random string is recommended.
# If left empty, the code falls back to corpSecret, but this is not recommended.
stateSecret: ""
# Private key for decrypting WeCom callbacks. # Private key for decrypting WeCom callbacks.
# Not used by the current login flow. Reserved for message callbacks and similar scenarios.
rsaPrivateKey: "" rsaPrivateKey: ""
# WeCom callback token. # WeCom callback token.
# Not used by the current login flow. Reserved for message callbacks and similar scenarios.
token: "" token: ""
# WeCom message encryption/decryption EncodingAESKey. # WeCom message encryption/decryption EncodingAESKey.
# Not used by the current login flow. Reserved for message callbacks and similar scenarios.
encodingAESKey: "" encodingAESKey: ""
notify: notify:
-13
View File
@@ -17,11 +17,6 @@ logger:
format: text format: text
addSource: false addSource: false
auth:
tokenTTLHours: 24
maxFailedAttempts: 5
credentialLockMinute: 30
storage: storage:
default: local default: local
maxUploadSizeMB: 5 maxUploadSizeMB: 5
@@ -58,11 +53,3 @@ mcp:
wxWork: wxWork:
enabled: false enabled: false
oidc:
enabled: false
customerSession:
secret: change-me
ttlMinutes: 120
refreshThresholdMinutes: 30
-24
View File
@@ -21,16 +21,6 @@ logger:
format: text format: text
addSource: false addSource: false
auth:
tokenTTLHours: 12
maxFailedAttempts: 5
credentialLockMinute: 15
customerSession:
secret: replace-with-a-random-secret
ttlMinutes: 120
refreshThresholdMinutes: 30
storage: storage:
default: local default: local
maxUploadSizeMB: 20 maxUploadSizeMB: 20
@@ -70,8 +60,6 @@ wxWork:
corpId: "" corpId: ""
corpSecret: "" corpSecret: ""
agentId: "" agentId: ""
oauthRedirect: ""
stateSecret: ""
rsaPrivateKey: "" rsaPrivateKey: ""
token: "" token: ""
encodingAESKey: "" encodingAESKey: ""
@@ -81,15 +69,3 @@ wxWork:
safe: false safe: false
enableDuplicateCheck: true enableDuplicateCheck: true
duplicateCheckInterval: 1800 duplicateCheckInterval: 1800
oidc:
enabled: false
issuer: ""
clientId: ""
clientSecret: ""
redirectUrl: http://127.0.0.1:8083/api/auth/oidc_callback
stateSecret: ""
scopes:
- openid
- profile
- email
-12
View File
@@ -22,16 +22,6 @@ logger:
format: text format: text
addSource: false addSource: false
auth:
tokenTTLHours: 12
maxFailedAttempts: 5
credentialLockMinute: 15
customerSession:
secret: replace-with-a-random-secret
ttlMinutes: 120
refreshThresholdMinutes: 30
storage: storage:
default: local default: local
maxUploadSizeMB: 20 maxUploadSizeMB: 20
@@ -72,8 +62,6 @@ wxWork:
corpId: "" corpId: ""
corpSecret: "" corpSecret: ""
agentId: "" agentId: ""
oauthRedirect: ""
stateSecret: ""
rsaPrivateKey: "" rsaPrivateKey: ""
token: "" token: ""
encodingAESKey: "" encodingAESKey: ""
+6 -9
View File
@@ -1,4 +1,4 @@
module agent-desk module code.tczkiot.com/wlw/ai-agent
go 1.26.0 go 1.26.0
@@ -6,12 +6,10 @@ require (
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible
github.com/cloudwego/eino v0.9.6 github.com/cloudwego/eino v0.9.6
github.com/cloudwego/eino-ext/components/model/openai v0.1.13 github.com/cloudwego/eino-ext/components/model/openai v0.1.13
github.com/coreos/go-oidc/v3 v3.18.0
github.com/eino-contrib/jsonschema v1.0.3 github.com/eino-contrib/jsonschema v1.0.3
github.com/gin-gonic/gin v1.12.0 github.com/gin-gonic/gin v1.12.0
github.com/glebarez/sqlite v1.11.0 github.com/glebarez/sqlite v1.11.0
github.com/go-playground/validator/v10 v10.30.1 github.com/go-playground/validator/v10 v10.30.1
github.com/golang-jwt/jwt/v5 v5.3.1
github.com/gomarkdown/markdown v0.0.0-20240328165702-4d01890c35c0 github.com/gomarkdown/markdown v0.0.0-20240328165702-4d01890c35c0
github.com/google/uuid v1.6.0 github.com/google/uuid v1.6.0
github.com/gorilla/schema v1.4.1 github.com/gorilla/schema v1.4.1
@@ -30,18 +28,17 @@ require (
github.com/wk8/go-ordered-map/v2 v2.1.8 github.com/wk8/go-ordered-map/v2 v2.1.8
github.com/xuri/excelize/v2 v2.10.1 github.com/xuri/excelize/v2 v2.10.1
github.com/yuin/goldmark v1.4.13 github.com/yuin/goldmark v1.4.13
golang.org/x/crypto v0.53.0
golang.org/x/net v0.56.0 golang.org/x/net v0.56.0
golang.org/x/oauth2 v0.36.0
golang.org/x/text v0.38.0
golang.org/x/tools v0.46.0 golang.org/x/tools v0.46.0
gopkg.in/yaml.v3 v3.0.1 gopkg.in/yaml.v3 v3.0.1
gorm.io/driver/mysql v1.5.7 gorm.io/driver/mysql v1.5.7
gorm.io/driver/postgres v1.5.9
gorm.io/gorm v1.25.12 gorm.io/gorm v1.25.12
) )
require ( require (
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgx/v5 v5.5.5 // indirect github.com/jackc/pgx/v5 v5.5.5 // indirect
@@ -52,14 +49,15 @@ require (
github.com/spf13/pflag v1.0.10 // indirect github.com/spf13/pflag v1.0.10 // indirect
github.com/subosito/gotenv v1.6.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect
gorm.io/driver/postgres v1.5.9 // indirect golang.org/x/crypto v0.53.0 // indirect
golang.org/x/oauth2 v0.36.0 // indirect
golang.org/x/text v0.38.0 // indirect
) )
require ( require (
github.com/apache/arrow/go/v17 v17.0.0 github.com/apache/arrow/go/v17 v17.0.0
github.com/aymerick/douceur v0.2.0 // indirect github.com/aymerick/douceur v0.2.0 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/bmatcuk/doublestar/v4 v4.10.0 // indirect
github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d // indirect github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d // indirect
github.com/buger/jsonparser v1.2.0 // indirect github.com/buger/jsonparser v1.2.0 // indirect
github.com/bytedance/gopkg v0.1.4 // indirect github.com/bytedance/gopkg v0.1.4 // indirect
@@ -75,7 +73,6 @@ require (
github.com/gabriel-vasile/mimetype v1.4.12 // indirect github.com/gabriel-vasile/mimetype v1.4.12 // indirect
github.com/gin-contrib/sse v1.1.0 // indirect github.com/gin-contrib/sse v1.1.0 // indirect
github.com/glebarez/go-sqlite v1.21.2 // indirect github.com/glebarez/go-sqlite v1.21.2 // indirect
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-redis/redis/v8 v8.11.5 // indirect github.com/go-redis/redis/v8 v8.11.5 // indirect
+1 -51
View File
@@ -12,29 +12,19 @@ github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd3
github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk=
github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg=
github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA=
github.com/bmatcuk/doublestar/v4 v4.10.0 h1:zU9WiOla1YA122oLM6i4EXvGW62DvKZVxIe6TYWexEs=
github.com/bmatcuk/doublestar/v4 v4.10.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d h1:pVrfxiGfwelyab6n21ZBkbkmbevaf+WvMIiR7sr97hw= github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d h1:pVrfxiGfwelyab6n21ZBkbkmbevaf+WvMIiR7sr97hw=
github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA= github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA=
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
github.com/buger/jsonparser v1.2.0 h1:4EFcvK1kD4jyj6YqNK6skK6w+y7FHHBR+XBCtxwu/6g= github.com/buger/jsonparser v1.2.0 h1:4EFcvK1kD4jyj6YqNK6skK6w+y7FHHBR+XBCtxwu/6g=
github.com/buger/jsonparser v1.2.0/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/buger/jsonparser v1.2.0/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
github.com/bugsnag/bugsnag-go v1.4.0/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= github.com/bugsnag/bugsnag-go v1.4.0/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8=
github.com/bugsnag/panicwrap v1.2.0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= github.com/bugsnag/panicwrap v1.2.0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE=
github.com/bytedance/gopkg v0.1.3 h1:TPBSwH8RsouGCBcMBktLt1AymVo2TVsBVCY4b6TnZ/M=
github.com/bytedance/gopkg v0.1.3/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM=
github.com/bytedance/gopkg v0.1.4 h1:oZnQwnX82KAIWb7033bEwtxvTqXcYMxDBaQxo5JJHWM= github.com/bytedance/gopkg v0.1.4 h1:oZnQwnX82KAIWb7033bEwtxvTqXcYMxDBaQxo5JJHWM=
github.com/bytedance/gopkg v0.1.4/go.mod h1:v1zWfPm21Fb+OsyXN2VAHdL6TBb2L88anLQgdyje6R4= github.com/bytedance/gopkg v0.1.4/go.mod h1:v1zWfPm21Fb+OsyXN2VAHdL6TBb2L88anLQgdyje6R4=
github.com/bytedance/mockey v1.3.0 h1:ONLRdvhqmCfr9rTasUB8ZKCfvbdD2tohOg4u+4Q/ed0= github.com/bytedance/mockey v1.3.0 h1:ONLRdvhqmCfr9rTasUB8ZKCfvbdD2tohOg4u+4Q/ed0=
github.com/bytedance/mockey v1.3.0/go.mod h1:1BPHF9sol5R1ud/+0VEHGQq/+i2lN+GTsr3O2Q9IENY= github.com/bytedance/mockey v1.3.0/go.mod h1:1BPHF9sol5R1ud/+0VEHGQq/+i2lN+GTsr3O2Q9IENY=
github.com/bytedance/sonic v1.15.0 h1:/PXeWFaR5ElNcVE84U0dOHjiMHQOwNIx3K4ymzh/uSE=
github.com/bytedance/sonic v1.15.0/go.mod h1:tFkWrPz0/CUCLEF4ri4UkHekCIcdnkqXw9VduqpJh0k=
github.com/bytedance/sonic v1.15.2 h1:90H+rcF/FwLXwfB1cudOLq/je83n683Utf4Cbp0xHCo= github.com/bytedance/sonic v1.15.2 h1:90H+rcF/FwLXwfB1cudOLq/je83n683Utf4Cbp0xHCo=
github.com/bytedance/sonic v1.15.2/go.mod h1:mT2NbXunuaEbnZ+mRIX/vYqKISmgEuHFDI4UzmKx2SA= github.com/bytedance/sonic v1.15.2/go.mod h1:mT2NbXunuaEbnZ+mRIX/vYqKISmgEuHFDI4UzmKx2SA=
github.com/bytedance/sonic/loader v0.5.0 h1:gXH3KVnatgY7loH5/TkeVyXPfESoqSBSBEiDd5VjlgE=
github.com/bytedance/sonic/loader v0.5.0/go.mod h1:AR4NYCk5DdzZizZ5djGqQ92eEhCCcdf5x77udYiSJRo=
github.com/bytedance/sonic/loader v0.5.1 h1:Ygpfa9zwRCCKSlrp5bBP/b/Xzc3VxsAW+5NIYXrOOpI= github.com/bytedance/sonic/loader v0.5.1 h1:Ygpfa9zwRCCKSlrp5bBP/b/Xzc3VxsAW+5NIYXrOOpI=
github.com/bytedance/sonic/loader v0.5.1/go.mod h1:AR4NYCk5DdzZizZ5djGqQ92eEhCCcdf5x77udYiSJRo= github.com/bytedance/sonic/loader v0.5.1/go.mod h1:AR4NYCk5DdzZizZ5djGqQ92eEhCCcdf5x77udYiSJRo=
github.com/certifi/gocertifi v0.0.0-20190105021004-abcd57078448/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4= github.com/certifi/gocertifi v0.0.0-20190105021004-abcd57078448/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4=
@@ -44,24 +34,14 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=
github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=
github.com/cloudwego/base64x v0.1.7 h1:NppS+Fgzg5ovhn4NkUXaDT3x9jldgH5ToMCqzBSi2zI= github.com/cloudwego/base64x v0.1.7 h1:NppS+Fgzg5ovhn4NkUXaDT3x9jldgH5ToMCqzBSi2zI=
github.com/cloudwego/base64x v0.1.7/go.mod h1:Cu1PV9zfrSf7ET2tIbWbbEy7jO7HHJ13q4X2SQ8aWYg= github.com/cloudwego/base64x v0.1.7/go.mod h1:Cu1PV9zfrSf7ET2tIbWbbEy7jO7HHJ13q4X2SQ8aWYg=
github.com/cloudwego/eino v0.8.7 h1:GlzrJa5hpovPdZ+loBvXs1W4D5gWC+a6PRqJmlj4iis=
github.com/cloudwego/eino v0.8.7/go.mod h1:+2N4nsMPxA6kGBHpH+75JuTfEcGprAMTdsZESrShKpU=
github.com/cloudwego/eino v0.9.6 h1:M3IRhIpDxNwIuQ2SRUX1yUTkC8lcMggRI5wtHZy8A5M= github.com/cloudwego/eino v0.9.6 h1:M3IRhIpDxNwIuQ2SRUX1yUTkC8lcMggRI5wtHZy8A5M=
github.com/cloudwego/eino v0.9.6/go.mod h1:OBD1mrkfkt/pJa4rkg1P0VnaMeOVl7l8IAdEqY//3IQ= github.com/cloudwego/eino v0.9.6/go.mod h1:OBD1mrkfkt/pJa4rkg1P0VnaMeOVl7l8IAdEqY//3IQ=
github.com/cloudwego/eino-ext/components/model/openai v0.1.11 h1:juf9kECfmxJBA0rJSxDT7XOUSgrbMHaGHgBwd06lYaI=
github.com/cloudwego/eino-ext/components/model/openai v0.1.11/go.mod h1:DBk44Dq1mhuoAacdUzzhZhSGeeBECDI2rIZnJFeVZoE=
github.com/cloudwego/eino-ext/components/model/openai v0.1.13 h1:5XHRTiTD5bt9KQrMHcfvuWNklEC3tpm3XHejdozt9vM= github.com/cloudwego/eino-ext/components/model/openai v0.1.13 h1:5XHRTiTD5bt9KQrMHcfvuWNklEC3tpm3XHejdozt9vM=
github.com/cloudwego/eino-ext/components/model/openai v0.1.13/go.mod h1:mgIoqYYOc0eECCqvLbEYpOJrQNTNxkwXzSJzFU+v5sQ= github.com/cloudwego/eino-ext/components/model/openai v0.1.13/go.mod h1:mgIoqYYOc0eECCqvLbEYpOJrQNTNxkwXzSJzFU+v5sQ=
github.com/cloudwego/eino-ext/libs/acl/openai v0.1.15 h1:LbdSG9+qWzzp9RFW6dSFkaUW171JvCoYn/K63zX6dQE=
github.com/cloudwego/eino-ext/libs/acl/openai v0.1.15/go.mod h1:p+l0zBB0GjjX8HTlbTs3g3KfUFwZC11bsCGZOXW/3L0=
github.com/cloudwego/eino-ext/libs/acl/openai v0.1.17 h1:EeVcR1TslRA2IdNW1h/2LaGbPlffwGhQm99jM3zWZiI= github.com/cloudwego/eino-ext/libs/acl/openai v0.1.17 h1:EeVcR1TslRA2IdNW1h/2LaGbPlffwGhQm99jM3zWZiI=
github.com/cloudwego/eino-ext/libs/acl/openai v0.1.17/go.mod h1:Zkcx6DPTR2NfWmtSXbhItswGw6hqUezNPhNcke0pOG8= github.com/cloudwego/eino-ext/libs/acl/openai v0.1.17/go.mod h1:Zkcx6DPTR2NfWmtSXbhItswGw6hqUezNPhNcke0pOG8=
github.com/coreos/go-oidc/v3 v3.18.0 h1:V9orjXynvu5wiC9SemFTWnG4F45v403aIcjWo0d41+A=
github.com/coreos/go-oidc/v3 v3.18.0/go.mod h1:DYCf24+ncYi+XkIH97GY1+dqoRlbaSI26KVTCI9SrY4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -94,8 +74,6 @@ github.com/glebarez/sqlite v1.11.0 h1:wSG0irqzP6VurnMEpFGer5Li19RpIRi2qvQz++w0GM
github.com/glebarez/sqlite v1.11.0/go.mod h1:h8/o8j5wiAsqSPoWELDUdJXhjAhsVliSn7bWZjOhrgQ= github.com/glebarez/sqlite v1.11.0/go.mod h1:h8/o8j5wiAsqSPoWELDUdJXhjAhsVliSn7bWZjOhrgQ=
github.com/go-check/check v0.0.0-20180628173108-788fd7840127 h1:0gkP6mzaMqkmpcJYCFOLkIBwI7xFExG03bbkOkCvUPI= github.com/go-check/check v0.0.0-20180628173108-788fd7840127 h1:0gkP6mzaMqkmpcJYCFOLkIBwI7xFExG03bbkOkCvUPI=
github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98=
github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA=
github.com/go-jose/go-jose/v4 v4.1.4/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
@@ -180,7 +158,6 @@ github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
@@ -202,8 +179,6 @@ github.com/lancedb/lancedb-go v0.1.2 h1:ucM+KNN5J886OilSh4MRdyBa1sinHyrisoaswNIS
github.com/lancedb/lancedb-go v0.1.2/go.mod h1:HzleylKfuw2HgfBBfrE3tb4LMKNdJ3/TQ1Ziyd+CLZk= github.com/lancedb/lancedb-go v0.1.2/go.mod h1:HzleylKfuw2HgfBBfrE3tb4LMKNdJ3/TQ1Ziyd+CLZk=
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/mailru/easyjson v0.9.2 h1:dX8U45hQsZpxd80nLvDGihsQ/OxlvTkVUXH2r/8cb2M= github.com/mailru/easyjson v0.9.2 h1:dX8U45hQsZpxd80nLvDGihsQ/OxlvTkVUXH2r/8cb2M=
github.com/mailru/easyjson v0.9.2/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/mailru/easyjson v0.9.2/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
@@ -212,8 +187,6 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/meguminnnnnnnnn/go-openai v0.1.2 h1:iXombGGjqjBrmE9WaSidUhhi3YQhf42QTHvHLMkgvCA=
github.com/meguminnnnnnnnn/go-openai v0.1.2/go.mod h1:qs96ysDmxhE4BZoU45I43zcyfnaYxU3X+aRzLko/htY=
github.com/meguminnnnnnnnn/go-openai v0.1.5 h1:K9XFfnEUj9E+9djustmfa4eIdg8Q2vWD4mGv+AHbQ2k= github.com/meguminnnnnnnnn/go-openai v0.1.5 h1:K9XFfnEUj9E+9djustmfa4eIdg8Q2vWD4mGv+AHbQ2k=
github.com/meguminnnnnnnnn/go-openai v0.1.5/go.mod h1:qs96ysDmxhE4BZoU45I43zcyfnaYxU3X+aRzLko/htY= github.com/meguminnnnnnnnn/go-openai v0.1.5/go.mod h1:qs96ysDmxhE4BZoU45I43zcyfnaYxU3X+aRzLko/htY=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4=
@@ -258,8 +231,6 @@ github.com/openai/openai-go/v3 v3.28.0 h1:2+FfrCVMdGXSQrBv1tLWtokm+BU7+3hJ/8rAHP
github.com/openai/openai-go/v3 v3.28.0/go.mod h1:cdufnVK14cWcT9qA1rRtrXx4FTRsgbDPW7Ia7SS5cZo= github.com/openai/openai-go/v3 v3.28.0/go.mod h1:cdufnVK14cWcT9qA1rRtrXx4FTRsgbDPW7Ia7SS5cZo=
github.com/panjf2000/ants/v2 v2.12.0 h1:u9JhESo83i/GkZnhfTNuFMMWcNt7mnV1bGJ6FT4wXH8= github.com/panjf2000/ants/v2 v2.12.0 h1:u9JhESo83i/GkZnhfTNuFMMWcNt7mnV1bGJ6FT4wXH8=
github.com/panjf2000/ants/v2 v2.12.0/go.mod h1:tSQuaNQ6r6NRhPt+IZVUevvDyFMTs+eS4ztZc52uJTY= github.com/panjf2000/ants/v2 v2.12.0/go.mod h1:tSQuaNQ6r6NRhPt+IZVUevvDyFMTs+eS4ztZc52uJTY=
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
github.com/pelletier/go-toml/v2 v2.3.1 h1:MYEvvGnQjeNkRF1qUuGolNtNExTDwct51yp7olPtrEc= github.com/pelletier/go-toml/v2 v2.3.1 h1:MYEvvGnQjeNkRF1qUuGolNtNExTDwct51yp7olPtrEc=
github.com/pelletier/go-toml/v2 v2.3.1/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= github.com/pelletier/go-toml/v2 v2.3.1/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
@@ -390,8 +361,6 @@ go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y=
go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU= go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU=
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
golang.org/x/arch v0.22.0 h1:c/Zle32i5ttqRXjdLyyHZESLD/bB90DCU1g9l/0YBDI=
golang.org/x/arch v0.22.0/go.mod h1:dNHoOeKiyja7GTvF9NJS1l3Z2yntpQNzgrjh1cU103A=
golang.org/x/arch v0.28.0 h1:wVwVdqsTuUbJvhYVCspQYwZXHNYeLSoZnmHD+ggddpQ= golang.org/x/arch v0.28.0 h1:wVwVdqsTuUbJvhYVCspQYwZXHNYeLSoZnmHD+ggddpQ=
golang.org/x/arch v0.28.0/go.mod h1:0X+GdSIP+kL5wPmpK7sdkEVTt2XoYP0cSjQSbZBwOi8= golang.org/x/arch v0.28.0/go.mod h1:0X+GdSIP+kL5wPmpK7sdkEVTt2XoYP0cSjQSbZBwOi8=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
@@ -399,19 +368,13 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4=
golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA=
golang.org/x/crypto v0.53.0 h1:QZ4Muo8THX6CizN2vPPd5fBGHyogrdK9fG4wLPFUsto= golang.org/x/crypto v0.53.0 h1:QZ4Muo8THX6CizN2vPPd5fBGHyogrdK9fG4wLPFUsto=
golang.org/x/crypto v0.53.0/go.mod h1:DNLU434OwVakk9PzuwV8w62mAJpRJL3vsgcfp4Qnsio= golang.org/x/crypto v0.53.0/go.mod h1:DNLU434OwVakk9PzuwV8w62mAJpRJL3vsgcfp4Qnsio=
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8=
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI=
golang.org/x/exp v0.0.0-20260611194520-c48552f49976 h1:X8Hz2ImujgbmetVuW+w2YkyZChE3cBpZi2P158rTG9M= golang.org/x/exp v0.0.0-20260611194520-c48552f49976 h1:X8Hz2ImujgbmetVuW+w2YkyZChE3cBpZi2P158rTG9M=
golang.org/x/exp v0.0.0-20260611194520-c48552f49976/go.mod h1:vnf4pv9iKZXY58sQE1L86zmNWJ4159e1RkcWiLCkeEY= golang.org/x/exp v0.0.0-20260611194520-c48552f49976/go.mod h1:vnf4pv9iKZXY58sQE1L86zmNWJ4159e1RkcWiLCkeEY=
golang.org/x/image v0.25.0 h1:Y6uW6rH1y5y/LK1J8BPWZtr6yZ7hrsy6hFrXjgsc2fQ= golang.org/x/image v0.25.0 h1:Y6uW6rH1y5y/LK1J8BPWZtr6yZ7hrsy6hFrXjgsc2fQ=
golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs= golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8=
golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w=
golang.org/x/mod v0.37.0 h1:vF1DjpVEshcIqoEaauuHebaLk1O1forxjxBaVn884JQ= golang.org/x/mod v0.37.0 h1:vF1DjpVEshcIqoEaauuHebaLk1O1forxjxBaVn884JQ=
golang.org/x/mod v0.37.0/go.mod h1:m8S8VeM9r4dzDwjrKO0a1sZP3YjeMamRRlD+fmR2Q/0= golang.org/x/mod v0.37.0/go.mod h1:m8S8VeM9r4dzDwjrKO0a1sZP3YjeMamRRlD+fmR2Q/0=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -421,8 +384,6 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.51.0 h1:94R/GTO7mt3/4wIKpcR5gkGmRLOuE/2hNGeWq/GBIFo=
golang.org/x/net v0.51.0/go.mod h1:aamm+2QF5ogm02fjy5Bb7CQ0WMt1/WVM7FtyaTLlA9Y=
golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o= golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o=
golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec= golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec=
golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs=
@@ -430,8 +391,6 @@ golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM=
golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -453,23 +412,16 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw=
golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/telemetry v0.0.0-20260209163413-e7419c687ee4 h1:bTLqdHv7xrGlFbvf5/TXNxy/iUwwdkjhqQTJDjW7aj0=
golang.org/x/telemetry v0.0.0-20260209163413-e7419c687ee4/go.mod h1:g5NllXBEermZrmR51cJDQxmJUHUOfRAaNyWBM+R+548=
golang.org/x/telemetry v0.0.0-20260610154732-fb80ec83bdd9 h1:FjUup8XrRy7lv+XHONi6KKUSizeF2NnVrTnz/HhbohQ= golang.org/x/telemetry v0.0.0-20260610154732-fb80ec83bdd9 h1:FjUup8XrRy7lv+XHONi6KKUSizeF2NnVrTnz/HhbohQ=
golang.org/x/telemetry v0.0.0-20260610154732-fb80ec83bdd9/go.mod h1:3AWMyWHS+caVoiEXpiq6+tzKA40J4vQT3MYr80ZtQpc= golang.org/x/telemetry v0.0.0-20260610154732-fb80ec83bdd9/go.mod h1:3AWMyWHS+caVoiEXpiq6+tzKA40J4vQT3MYr80ZtQpc=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU=
golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A=
golang.org/x/term v0.44.0 h1:0rLvDRCtNj0gZkyIXhCyOb2OAzEhLVqc4B+hrsBhrmc= golang.org/x/term v0.44.0 h1:0rLvDRCtNj0gZkyIXhCyOb2OAzEhLVqc4B+hrsBhrmc=
golang.org/x/term v0.44.0/go.mod h1:7ze4MdzUzLXpSAoFP1H0bOI9aXDqveSvatT5vKcFh2Y=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8=
golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA=
golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE= golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE=
golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4= golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4=
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
@@ -477,8 +429,6 @@ golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k=
golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0=
golang.org/x/tools v0.46.0 h1:7jTurBkPZu4moS/Uy4OQT1M+QBlsj3wejyZwsT8Z7rk= golang.org/x/tools v0.46.0 h1:7jTurBkPZu4moS/Uy4OQT1M+QBlsj3wejyZwsT8Z7rk=
golang.org/x/tools v0.46.0/go.mod h1:FrD85F8l+NWL+9XWBSyVSHO6Ne4jutsfIFba7AWQ5Ys= golang.org/x/tools v0.46.0/go.mod h1:FrD85F8l+NWL+9XWBSyVSHO6Ne4jutsfIFba7AWQ5Ys=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+46
View File
@@ -0,0 +1,46 @@
package identity
import "context"
type SubjectType string
const (
SubjectAdmin SubjectType = "admin"
SubjectAgent SubjectType = "agent"
SubjectCard SubjectType = "card"
SubjectDevice SubjectType = "device"
SubjectMallUser SubjectType = "mall_user"
)
type SubjectCategory string
const (
CategorySystem SubjectCategory = "system"
CategoryUser SubjectCategory = "user"
)
type Subject struct {
Type SubjectType `json:"type"`
Category SubjectCategory `json:"category"`
ID int64 `json:"id"`
Username string `json:"username"`
Name string `json:"name"`
Avatar string `json:"avatar"`
Identifier string `json:"identifier"`
Enabled bool `json:"enabled"`
Bindings map[string]string `json:"bindings,omitempty"`
}
type Query struct {
Types []SubjectType
IDs []int64
Keyword string
Current bool
EnabledOnly bool
}
type QuerySubjectsFunc func(ctx context.Context, query Query) ([]Subject, error)
// AuthorizeFunc delegates a customer-service operation to the host system.
// Returning a non-nil error denies the operation.
type AuthorizeFunc func(ctx context.Context, operation string) error
@@ -11,20 +11,20 @@ import (
"strings" "strings"
"time" "time"
ai "agent-desk/internal/ai" ai "code.tczkiot.com/wlw/ai-agent/internal/ai"
"agent-desk/internal/ai/runtime/instruction" "code.tczkiot.com/wlw/ai-agent/internal/ai/runtime/instruction"
"agent-desk/internal/ai/runtime/readtools" "code.tczkiot.com/wlw/ai-agent/internal/ai/runtime/readtools"
"agent-desk/internal/ai/runtime/retrievers" "code.tczkiot.com/wlw/ai-agent/internal/ai/runtime/retrievers"
runtimetooling "agent-desk/internal/ai/runtime/tooling" runtimetooling "code.tczkiot.com/wlw/ai-agent/internal/ai/runtime/tooling"
workflowexecutor "agent-desk/internal/ai/runtime/workflow" workflowexecutor "code.tczkiot.com/wlw/ai-agent/internal/ai/runtime/workflow"
aitooling "agent-desk/internal/ai/tooling" aitooling "code.tczkiot.com/wlw/ai-agent/internal/ai/tooling"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/dto/request" "code.tczkiot.com/wlw/ai-agent/internal/pkg/dto/request"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/pkg/errorsx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/errorsx"
"agent-desk/internal/pkg/toolx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/toolx"
"agent-desk/internal/pkg/utils" "code.tczkiot.com/wlw/ai-agent/internal/pkg/utils"
svc "agent-desk/internal/services" svc "code.tczkiot.com/wlw/ai-agent/internal/services"
"github.com/mlogclub/simple/sqls" "github.com/mlogclub/simple/sqls"
) )
@@ -6,11 +6,11 @@ import (
"strings" "strings"
"testing" "testing"
ai "agent-desk/internal/ai" ai "code.tczkiot.com/wlw/ai-agent/internal/ai"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/dto/request" "code.tczkiot.com/wlw/ai-agent/internal/pkg/dto/request"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
svc "agent-desk/internal/services" svc "code.tczkiot.com/wlw/ai-agent/internal/services"
"github.com/glebarez/sqlite" "github.com/glebarez/sqlite"
"github.com/mlogclub/simple/sqls" "github.com/mlogclub/simple/sqls"
@@ -5,11 +5,11 @@ import (
"fmt" "fmt"
"strings" "strings"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/pkg/toolx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/toolx"
"agent-desk/internal/pkg/utils" "code.tczkiot.com/wlw/ai-agent/internal/pkg/utils"
svc "agent-desk/internal/services" svc "code.tczkiot.com/wlw/ai-agent/internal/services"
) )
type agentLoopTurn struct { type agentLoopTurn struct {
@@ -4,9 +4,9 @@ import (
"context" "context"
"strings" "strings"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/pkg/errorsx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/errorsx"
svc "agent-desk/internal/services" svc "code.tczkiot.com/wlw/ai-agent/internal/services"
) )
// ApplicationRunInput identifies the persisted inputs for an Agent reply. // ApplicationRunInput identifies the persisted inputs for an Agent reply.
@@ -4,8 +4,8 @@ import (
"strings" "strings"
"testing" "testing"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"github.com/glebarez/sqlite" "github.com/glebarez/sqlite"
"github.com/mlogclub/simple/sqls" "github.com/mlogclub/simple/sqls"
@@ -8,8 +8,8 @@ import (
"strings" "strings"
"time" "time"
ai "agent-desk/internal/ai" ai "code.tczkiot.com/wlw/ai-agent/internal/ai"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
einoopenai "github.com/cloudwego/eino-ext/components/model/openai" einoopenai "github.com/cloudwego/eino-ext/components/model/openai"
einomodel "github.com/cloudwego/eino/components/model" einomodel "github.com/cloudwego/eino/components/model"
@@ -6,9 +6,9 @@ import (
"strconv" "strconv"
"strings" "strings"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/pkg/toolx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/toolx"
) )
// OfflineEvaluationCase is an isolated customer-service evaluation sample. // OfflineEvaluationCase is an isolated customer-service evaluation sample.
+3 -3
View File
@@ -6,9 +6,9 @@ import (
"strings" "strings"
"time" "time"
workflowexecutor "agent-desk/internal/ai/runtime/workflow" workflowexecutor "code.tczkiot.com/wlw/ai-agent/internal/ai/runtime/workflow"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/repositories" "code.tczkiot.com/wlw/ai-agent/internal/repositories"
"github.com/mlogclub/simple/sqls" "github.com/mlogclub/simple/sqls"
) )
+1 -1
View File
@@ -1,7 +1,7 @@
package runtime package runtime
import ( import (
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"time" "time"
) )
@@ -3,10 +3,10 @@ package runtime
import ( import (
"encoding/json" "encoding/json"
"agent-desk/internal/ai/workflow/dsl" "code.tczkiot.com/wlw/ai-agent/internal/ai/workflow/dsl"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/pkg/errorsx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/errorsx"
"agent-desk/internal/repositories" "code.tczkiot.com/wlw/ai-agent/internal/repositories"
"github.com/mlogclub/simple/sqls" "github.com/mlogclub/simple/sqls"
) )
+3 -3
View File
@@ -6,9 +6,9 @@ import (
openai "github.com/openai/openai-go/v3" openai "github.com/openai/openai-go/v3"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/pkg/errorsx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/errorsx"
) )
type EmbeddingResult struct { type EmbeddingResult struct {
+2 -2
View File
@@ -10,8 +10,8 @@ import (
openai "github.com/openai/openai-go/v3" openai "github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/shared" "github.com/openai/openai-go/v3/shared"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
) )
type ChatCompletionResult struct { type ChatCompletionResult struct {
+1 -1
View File
@@ -7,7 +7,7 @@ import (
openai "github.com/openai/openai-go/v3" openai "github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/shared" "github.com/openai/openai-go/v3/shared"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
) )
func TestApplyProviderSpecificChatParamsIncludesDashScopeThinkingFlag(t *testing.T) { func TestApplyProviderSpecificChatParamsIncludesDashScopeThinkingFlag(t *testing.T) {
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"strings" "strings"
"time" "time"
"agent-desk/internal/pkg/errorsx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/errorsx"
"agent-desk/internal/pkg/i18nx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/i18nx"
"github.com/modelcontextprotocol/go-sdk/mcp" "github.com/modelcontextprotocol/go-sdk/mcp"
) )
@@ -1,7 +1,7 @@
package providers package providers
import ( import (
"agent-desk/internal/pkg/config" "code.tczkiot.com/wlw/ai-agent/internal/pkg/config"
"context" "context"
"time" "time"
+1 -1
View File
@@ -1,7 +1,7 @@
package mcps package mcps
import ( import (
"agent-desk/internal/ai/mcps/providers" "code.tczkiot.com/wlw/ai-agent/internal/ai/mcps/providers"
"github.com/modelcontextprotocol/go-sdk/mcp" "github.com/modelcontextprotocol/go-sdk/mcp"
) )
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"context" "context"
"strings" "strings"
"agent-desk/internal/pkg/config" "code.tczkiot.com/wlw/ai-agent/internal/pkg/config"
"agent-desk/internal/pkg/errorsx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/errorsx"
) )
type RuntimeService struct { type RuntimeService struct {
+4 -4
View File
@@ -7,10 +7,10 @@ import (
openai "github.com/openai/openai-go/v3" openai "github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/option" "github.com/openai/openai-go/v3/option"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/pkg/errorsx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/errorsx"
"agent-desk/internal/repositories" "code.tczkiot.com/wlw/ai-agent/internal/repositories"
) )
func newOpenAIClient(config models.AIConfig) openai.Client { func newOpenAIClient(config models.AIConfig) openai.Client {
+8 -8
View File
@@ -8,14 +8,14 @@ import (
"github.com/mlogclub/simple/sqls" "github.com/mlogclub/simple/sqls"
"agent-desk/internal/ai" "code.tczkiot.com/wlw/ai-agent/internal/ai"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/dto" "code.tczkiot.com/wlw/ai-agent/internal/pkg/dto"
"agent-desk/internal/pkg/dto/request" "code.tczkiot.com/wlw/ai-agent/internal/pkg/dto/request"
"agent-desk/internal/pkg/dto/response" "code.tczkiot.com/wlw/ai-agent/internal/pkg/dto/response"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/pkg/errorsx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/errorsx"
"agent-desk/internal/repositories" "code.tczkiot.com/wlw/ai-agent/internal/repositories"
) )
type answer struct { type answer struct {
+3 -3
View File
@@ -3,9 +3,9 @@ package rag
import ( import (
"testing" "testing"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/dto/response" "code.tczkiot.com/wlw/ai-agent/internal/pkg/dto/response"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
) )
func TestBuildFallbackAnswer(t *testing.T) { func TestBuildFallbackAnswer(t *testing.T) {
+1 -1
View File
@@ -1,7 +1,7 @@
package chunk package chunk
import ( import (
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"context" "context"
) )
+1 -1
View File
@@ -1,7 +1,7 @@
package chunk package chunk
import ( import (
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"context" "context"
) )
+1 -1
View File
@@ -1,7 +1,7 @@
package chunk package chunk
import ( import (
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"context" "context"
"fmt" "fmt"
) )
+1 -1
View File
@@ -1,7 +1,7 @@
package chunk package chunk
import ( import (
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"context" "context"
"strings" "strings"
+1 -1
View File
@@ -1,6 +1,6 @@
package chunk package chunk
import "agent-desk/internal/pkg/enums" import "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
type ChunkRequest struct { type ChunkRequest struct {
KnowledgeBaseID int64 KnowledgeBaseID int64
+1 -1
View File
@@ -1,7 +1,7 @@
package chunk package chunk
import ( import (
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"crypto/sha256" "crypto/sha256"
"encoding/hex" "encoding/hex"
"strings" "strings"
+6 -6
View File
@@ -9,12 +9,12 @@ import (
"log/slog" "log/slog"
"time" "time"
"agent-desk/internal/ai" "code.tczkiot.com/wlw/ai-agent/internal/ai"
ragchunk "agent-desk/internal/ai/rag/chunk" ragchunk "code.tczkiot.com/wlw/ai-agent/internal/ai/rag/chunk"
"agent-desk/internal/ai/rag/vectordb" "code.tczkiot.com/wlw/ai-agent/internal/ai/rag/vectordb"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/repositories" "code.tczkiot.com/wlw/ai-agent/internal/repositories"
"github.com/google/uuid" "github.com/google/uuid"
"github.com/mlogclub/simple/sqls" "github.com/mlogclub/simple/sqls"
+3 -3
View File
@@ -5,9 +5,9 @@ import (
"fmt" "fmt"
"log/slog" "log/slog"
"agent-desk/internal/ai/rag/vectordb" "code.tczkiot.com/wlw/ai-agent/internal/ai/rag/vectordb"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/repositories" "code.tczkiot.com/wlw/ai-agent/internal/repositories"
"github.com/mlogclub/simple/common/strs" "github.com/mlogclub/simple/common/strs"
"github.com/mlogclub/simple/sqls" "github.com/mlogclub/simple/sqls"
+5 -5
View File
@@ -6,12 +6,12 @@ import (
"log/slog" "log/slog"
"time" "time"
ragchunk "agent-desk/internal/ai/rag/chunk" ragchunk "code.tczkiot.com/wlw/ai-agent/internal/ai/rag/chunk"
"agent-desk/internal/ai/rag/vectordb" "code.tczkiot.com/wlw/ai-agent/internal/ai/rag/vectordb"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/ai" "code.tczkiot.com/wlw/ai-agent/internal/ai"
) )
func (s *index) buildDocumentChunkRequest(document models.KnowledgeDocument, knowledgeBase models.KnowledgeBase) *ragchunk.ChunkRequest { func (s *index) buildDocumentChunkRequest(document models.KnowledgeDocument, knowledgeBase models.KnowledgeBase) *ragchunk.ChunkRequest {
+4 -4
View File
@@ -5,10 +5,10 @@ import (
"fmt" "fmt"
"time" "time"
"agent-desk/internal/ai" "code.tczkiot.com/wlw/ai-agent/internal/ai"
"agent-desk/internal/ai/rag/vectordb" "code.tczkiot.com/wlw/ai-agent/internal/ai/rag/vectordb"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
) )
func buildFAQChunkModel(knowledgeBase models.KnowledgeBase, faq models.KnowledgeFAQ, content string) (models.KnowledgeChunk, string) { func buildFAQChunkModel(knowledgeBase models.KnowledgeBase, faq models.KnowledgeFAQ, content string) (models.KnowledgeChunk, string) {
+3 -3
View File
@@ -4,9 +4,9 @@ import (
"fmt" "fmt"
"strings" "strings"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/repositories" "code.tczkiot.com/wlw/ai-agent/internal/repositories"
"github.com/mlogclub/simple/sqls" "github.com/mlogclub/simple/sqls"
) )
@@ -4,7 +4,7 @@ import (
"strings" "strings"
"testing" "testing"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
) )
func TestBuildFAQChunkContent(t *testing.T) { func TestBuildFAQChunkContent(t *testing.T) {
+4 -4
View File
@@ -5,10 +5,10 @@ import (
"fmt" "fmt"
"log/slog" "log/slog"
"agent-desk/internal/ai" "code.tczkiot.com/wlw/ai-agent/internal/ai"
"agent-desk/internal/ai/rag/vectordb" "code.tczkiot.com/wlw/ai-agent/internal/ai/rag/vectordb"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/repositories" "code.tczkiot.com/wlw/ai-agent/internal/repositories"
"github.com/mlogclub/simple/sqls" "github.com/mlogclub/simple/sqls"
) )
+3 -3
View File
@@ -3,9 +3,9 @@ package rag
import ( import (
"time" "time"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/repositories" "code.tczkiot.com/wlw/ai-agent/internal/repositories"
"github.com/mlogclub/simple/sqls" "github.com/mlogclub/simple/sqls"
) )
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"log/slog" "log/slog"
"agent-desk/internal/ai/rag/vectordb" "code.tczkiot.com/wlw/ai-agent/internal/ai/rag/vectordb"
) )
func (s *index) ensureCollection(ctx context.Context, provider vectordb.Provider, collectionName string, dimension int) error { func (s *index) ensureCollection(ctx context.Context, provider vectordb.Provider, collectionName string, dimension int) error {
+2 -2
View File
@@ -10,8 +10,8 @@ import (
"sort" "sort"
"time" "time"
"agent-desk/internal/ai" "code.tczkiot.com/wlw/ai-agent/internal/ai"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
) )
type rerank struct{} type rerank struct{}
+4 -4
View File
@@ -6,10 +6,10 @@ import (
"log/slog" "log/slog"
"strings" "strings"
"agent-desk/internal/ai/rag/vectordb" "code.tczkiot.com/wlw/ai-agent/internal/ai/rag/vectordb"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/repositories" "code.tczkiot.com/wlw/ai-agent/internal/repositories"
"github.com/mlogclub/simple/sqls" "github.com/mlogclub/simple/sqls"
) )
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"log/slog" "log/slog"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
) )
func newRetrieveTrace() *RetrieveTrace { func newRetrieveTrace() *RetrieveTrace {
+3 -3
View File
@@ -5,9 +5,9 @@ import (
"fmt" "fmt"
"time" "time"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/dto" "code.tczkiot.com/wlw/ai-agent/internal/pkg/dto"
"agent-desk/internal/pkg/dto/response" "code.tczkiot.com/wlw/ai-agent/internal/pkg/dto/response"
"github.com/google/uuid" "github.com/google/uuid"
"github.com/mlogclub/simple/sqls" "github.com/mlogclub/simple/sqls"
+5 -5
View File
@@ -8,11 +8,11 @@ import (
"strings" "strings"
"time" "time"
"agent-desk/internal/ai" "code.tczkiot.com/wlw/ai-agent/internal/ai"
"agent-desk/internal/ai/rag/vectordb" "code.tczkiot.com/wlw/ai-agent/internal/ai/rag/vectordb"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/repositories" "code.tczkiot.com/wlw/ai-agent/internal/repositories"
"github.com/mlogclub/simple/sqls" "github.com/mlogclub/simple/sqls"
) )
+1 -1
View File
@@ -3,7 +3,7 @@ package rag
import ( import (
"testing" "testing"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
) )
func TestResolveKnowledgeBaseSearchOptionsUsesKnowledgeBaseDefaults(t *testing.T) { func TestResolveKnowledgeBaseSearchOptionsUsesKnowledgeBaseDefaults(t *testing.T) {
+1 -1
View File
@@ -1,7 +1,7 @@
package rag package rag
import ( import (
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"strings" "strings"
"github.com/yuin/goldmark" "github.com/yuin/goldmark"
+2 -2
View File
@@ -1,8 +1,8 @@
package rag package rag
import ( import (
"agent-desk/internal/ai/rag/vectordb" "code.tczkiot.com/wlw/ai-agent/internal/ai/rag/vectordb"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"testing" "testing"
) )
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"agent-desk/internal/pkg/config" "code.tczkiot.com/wlw/ai-agent/internal/pkg/config"
"github.com/apache/arrow/go/v17/arrow" "github.com/apache/arrow/go/v17/arrow"
"github.com/apache/arrow/go/v17/arrow/array" "github.com/apache/arrow/go/v17/arrow/array"
+1 -1
View File
@@ -5,7 +5,7 @@ package vectordb
import ( import (
"fmt" "fmt"
"agent-desk/internal/pkg/config" "code.tczkiot.com/wlw/ai-agent/internal/pkg/config"
) )
func NewLanceDBProvider(_ *config.LanceDBVectorDBConfig) (Provider, error) { func NewLanceDBProvider(_ *config.LanceDBVectorDBConfig) (Provider, error) {
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"context" "context"
"testing" "testing"
"agent-desk/internal/pkg/config" "code.tczkiot.com/wlw/ai-agent/internal/pkg/config"
) )
func TestLanceDBProviderVectorLifecycle(t *testing.T) { func TestLanceDBProviderVectorLifecycle(t *testing.T) {
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"context" "context"
"fmt" "fmt"
"agent-desk/internal/pkg/config" "code.tczkiot.com/wlw/ai-agent/internal/pkg/config"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
) )
var defaultProvider Provider var defaultProvider Provider
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"strings" "strings"
"testing" "testing"
"agent-desk/internal/pkg/config" "code.tczkiot.com/wlw/ai-agent/internal/pkg/config"
) )
func TestInitLanceDBWithoutBuildTagReturnsActionableError(t *testing.T) { func TestInitLanceDBWithoutBuildTagReturnsActionableError(t *testing.T) {
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"github.com/qdrant/go-client/qdrant" "github.com/qdrant/go-client/qdrant"
"agent-desk/internal/pkg/config" "code.tczkiot.com/wlw/ai-agent/internal/pkg/config"
) )
type QdrantProvider struct { type QdrantProvider struct {
+8 -8
View File
@@ -5,14 +5,14 @@ import (
"fmt" "fmt"
"strings" "strings"
applicationruntime "agent-desk/internal/ai/application/runtime" applicationruntime "code.tczkiot.com/wlw/ai-agent/internal/ai/application/runtime"
"agent-desk/internal/ai/runtime/graphs" "code.tczkiot.com/wlw/ai-agent/internal/ai/runtime/graphs"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/dto/request" "code.tczkiot.com/wlw/ai-agent/internal/pkg/dto/request"
"agent-desk/internal/pkg/dto/response" "code.tczkiot.com/wlw/ai-agent/internal/pkg/dto/response"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/pkg/errorsx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/errorsx"
svc "agent-desk/internal/services" svc "code.tczkiot.com/wlw/ai-agent/internal/services"
) )
func init() { func init() {
+6 -6
View File
@@ -3,12 +3,12 @@ package runtime
import ( import (
"context" "context"
applicationruntime "agent-desk/internal/ai/application/runtime" applicationruntime "code.tczkiot.com/wlw/ai-agent/internal/ai/application/runtime"
"agent-desk/internal/pkg/dto/request" "code.tczkiot.com/wlw/ai-agent/internal/pkg/dto/request"
"agent-desk/internal/pkg/dto/response" "code.tczkiot.com/wlw/ai-agent/internal/pkg/dto/response"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/pkg/errorsx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/errorsx"
svc "agent-desk/internal/services" svc "code.tczkiot.com/wlw/ai-agent/internal/services"
) )
func init() { func init() {
@@ -6,8 +6,8 @@ import (
"fmt" "fmt"
"strings" "strings"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/services" "code.tczkiot.com/wlw/ai-agent/internal/services"
) )
type AnalyzeConversationInput struct { type AnalyzeConversationInput struct {
@@ -3,8 +3,8 @@ package graphs
import ( import (
"testing" "testing"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
) )
func TestBuildAnalyzeConversationResult_RecommendsHandoffForComplaint(t *testing.T) { func TestBuildAnalyzeConversationResult_RecommendsHandoffForComplaint(t *testing.T) {
@@ -6,12 +6,12 @@ import (
"fmt" "fmt"
"strings" "strings"
"agent-desk/internal/ai/runtime/tooling" "code.tczkiot.com/wlw/ai-agent/internal/ai/runtime/tooling"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/dto" "code.tczkiot.com/wlw/ai-agent/internal/pkg/dto"
"agent-desk/internal/pkg/dto/request" "code.tczkiot.com/wlw/ai-agent/internal/pkg/dto/request"
"agent-desk/internal/pkg/i18nx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/i18nx"
"agent-desk/internal/services" "code.tczkiot.com/wlw/ai-agent/internal/services"
componenttool "github.com/cloudwego/eino/components/tool" componenttool "github.com/cloudwego/eino/components/tool"
"github.com/cloudwego/eino/schema" "github.com/cloudwego/eino/schema"
+5 -5
View File
@@ -6,11 +6,11 @@ import (
"fmt" "fmt"
"strings" "strings"
"agent-desk/internal/ai/runtime/tooling" "code.tczkiot.com/wlw/ai-agent/internal/ai/runtime/tooling"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/i18nx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/i18nx"
"agent-desk/internal/pkg/tracex" "code.tczkiot.com/wlw/ai-agent/internal/pkg/tracex"
"agent-desk/internal/services" "code.tczkiot.com/wlw/ai-agent/internal/services"
componenttool "github.com/cloudwego/eino/components/tool" componenttool "github.com/cloudwego/eino/components/tool"
"github.com/cloudwego/eino/schema" "github.com/cloudwego/eino/schema"
@@ -7,10 +7,10 @@ import (
"testing" "testing"
"time" "time"
"agent-desk/internal/ai/runtime/tooling" "code.tczkiot.com/wlw/ai-agent/internal/ai/runtime/tooling"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/services" "code.tczkiot.com/wlw/ai-agent/internal/services"
"github.com/glebarez/sqlite" "github.com/glebarez/sqlite"
"github.com/mlogclub/simple/sqls" "github.com/mlogclub/simple/sqls"
+1 -1
View File
@@ -3,7 +3,7 @@ package graphs
import ( import (
"strings" "strings"
"agent-desk/internal/pkg/i18nx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/i18nx"
) )
const ( const (
@@ -6,9 +6,9 @@ import (
"fmt" "fmt"
"strings" "strings"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
"agent-desk/internal/services" "code.tczkiot.com/wlw/ai-agent/internal/services"
) )
type PrepareTicketDraftInput struct { type PrepareTicketDraftInput struct {
@@ -3,8 +3,8 @@ package graphs
import ( import (
"testing" "testing"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
) )
func TestBuildPrepareTicketDraftResult_UsesConversationFallbacks(t *testing.T) { func TestBuildPrepareTicketDraftResult_UsesConversationFallbacks(t *testing.T) {
@@ -6,8 +6,8 @@ import (
"fmt" "fmt"
"strings" "strings"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/services" "code.tczkiot.com/wlw/ai-agent/internal/services"
) )
type TriageServiceRequestInput struct { type TriageServiceRequestInput struct {
@@ -3,8 +3,8 @@ package graphs
import ( import (
"testing" "testing"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/enums" "code.tczkiot.com/wlw/ai-agent/internal/pkg/enums"
) )
func TestTriageServiceRequestResult_PrepareTicket(t *testing.T) { func TestTriageServiceRequestResult_PrepareTicket(t *testing.T) {
+3 -3
View File
@@ -5,9 +5,9 @@ import (
"fmt" "fmt"
"strings" "strings"
runtimetooling "agent-desk/internal/ai/runtime/tooling" runtimetooling "code.tczkiot.com/wlw/ai-agent/internal/ai/runtime/tooling"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/toolx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/toolx"
) )
func BuildSelectedSkillActivationInstruction(skill *models.SkillDefinition) string { func BuildSelectedSkillActivationInstruction(skill *models.SkillDefinition) string {
+3 -3
View File
@@ -1,9 +1,9 @@
package instruction package instruction
import ( import (
"agent-desk/internal/ai/runtime/tooling" "code.tczkiot.com/wlw/ai-agent/internal/ai/runtime/tooling"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/toolx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/toolx"
) )
type ToolAppendixProvider struct{} type ToolAppendixProvider struct{}
+2 -2
View File
@@ -3,8 +3,8 @@ package instruction
import ( import (
"strings" "strings"
runtimetooling "agent-desk/internal/ai/runtime/tooling" runtimetooling "code.tczkiot.com/wlw/ai-agent/internal/ai/runtime/tooling"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
) )
type Service struct { type Service struct {
@@ -9,11 +9,11 @@ import (
"strings" "strings"
"time" "time"
"agent-desk/internal/ai/runtime/graphs" "code.tczkiot.com/wlw/ai-agent/internal/ai/runtime/graphs"
"agent-desk/internal/ai/runtime/retrievers" "code.tczkiot.com/wlw/ai-agent/internal/ai/runtime/retrievers"
aitooling "agent-desk/internal/ai/tooling" aitooling "code.tczkiot.com/wlw/ai-agent/internal/ai/tooling"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/toolx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/toolx"
) )
func ExecuteGraphTool(ctx context.Context, conversation models.Conversation, toolCode string, arguments map[string]any, policy aitooling.Policy) (aitooling.Definition, string, error) { func ExecuteGraphTool(ctx context.Context, conversation models.Conversation, toolCode string, arguments map[string]any, policy aitooling.Policy) (aitooling.Definition, string, error) {
@@ -4,9 +4,9 @@ import (
"context" "context"
"testing" "testing"
aitooling "agent-desk/internal/ai/tooling" aitooling "code.tczkiot.com/wlw/ai-agent/internal/ai/tooling"
"agent-desk/internal/models" "code.tczkiot.com/wlw/ai-agent/internal/models"
"agent-desk/internal/pkg/toolx" "code.tczkiot.com/wlw/ai-agent/internal/pkg/toolx"
) )
func TestExecuteGraphToolRejectsDisallowedToolBeforeGraphExecution(t *testing.T) { func TestExecuteGraphToolRejectsDisallowedToolBeforeGraphExecution(t *testing.T) {

Some files were not shown because too many files have changed in this diff Show More