feat: Go模块路径迁移 + Docker生产部署适配 + ethend Docker兼容
- 所有Go模块路径从 github.com/yourname/cyrene-ai 迁移到 git.yeij.top/AskaEth/Cyrene - 5个Go Dockerfile添加 GOPROXY=https://goproxy.cn,direct 解决国内构建问题 - ai-core go.mod 添加 pkg/plugins replace 指令 - Caddyfile 简化为 http:// 通配 + handle 保留 /api 前缀 - ethend Dockerfile 适配 (npm install + 仅 COPY package.json) - ethend 新增 RUNNING_IN_DOCKER 环境变量,健康检查改用Docker服务名 - ethend 数据库状态检查支持Docker hostname (postgres/redis/qdrant/minio) - process-manager 新增 CONTAINER_SVC_MAP + Docker模式自动检测 - 统一 docker-compose.dev.db.yml 卷名 (pg_data/redis_data/qdrant_data/minio_data) - docker-compose.yml ethend服务挂载docker.sock + 端口变量化 - 清理 .env 统一后的残留文件与提示信息 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
# Caddyfile — Cyrene AI 助手平台反向代理
|
||||
# Caddy version: 2.x
|
||||
# 环境变量: DOMAIN, ACME_EMAIL
|
||||
|
||||
{
|
||||
email {$ACME_EMAIL:admin@localhost}
|
||||
admin off
|
||||
}
|
||||
|
||||
# 站点(DOMAIN 未设置时回退到 :80 HTTP)
|
||||
{$DOMAIN::80} {
|
||||
http:// {
|
||||
log {
|
||||
output stdout
|
||||
format json
|
||||
@@ -19,18 +15,15 @@
|
||||
X-Frame-Options "DENY"
|
||||
X-XSS-Protection "1; mode=block"
|
||||
Referrer-Policy "strict-origin-when-cross-origin"
|
||||
# 生产环境有域名时取消注释
|
||||
# Strict-Transport-Security "max-age=31536000; includeSubDomains"
|
||||
Strict-Transport-Security "max-age=31536000; includeSubDomains"
|
||||
}
|
||||
|
||||
# WebSocket 路由
|
||||
handle_path /ws/* {
|
||||
handle /ws/* {
|
||||
reverse_proxy gateway:8080
|
||||
}
|
||||
|
||||
# API 路由 → Gateway
|
||||
handle_path /api/* {
|
||||
handle /api/* {
|
||||
reverse_proxy gateway:8080 {
|
||||
header_up Host {http.request.host}
|
||||
header_up X-Forwarded-For {http.request.remote.host}
|
||||
|
||||
@@ -10,6 +10,7 @@ COPY backend/ai-core/ ./backend/ai-core/
|
||||
COPY backend/pkg/ ./backend/pkg/
|
||||
|
||||
WORKDIR /app/backend/ai-core
|
||||
ENV GOPROXY=https://goproxy.cn,direct
|
||||
RUN go mod download
|
||||
|
||||
# 编译 (静态链接)
|
||||
|
||||
+25
-25
@@ -15,32 +15,32 @@ import (
|
||||
|
||||
"github.com/joho/godotenv"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/background"
|
||||
aiConfig "github.com/yourname/cyrene-ai/ai-core/internal/config"
|
||||
ctxbuild "github.com/yourname/cyrene-ai/ai-core/internal/context"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/host"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/llm"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/memory"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/orchestrator"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/persona"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/rag"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/subsession"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/tools"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/background"
|
||||
aiConfig "git.yeij.top/AskaEth/Cyrene/ai-core/internal/config"
|
||||
ctxbuild "git.yeij.top/AskaEth/Cyrene/ai-core/internal/context"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/host"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/llm"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/memory"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/orchestrator"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/persona"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/rag"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/subsession"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/tools"
|
||||
|
||||
plgManager "github.com/yourname/cyrene-ai/pkg/plugins/manager"
|
||||
plgSDK "github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
pluginCalc "github.com/yourname/cyrene-ai/pkg/plugins/calculator"
|
||||
pluginCrypto "github.com/yourname/cyrene-ai/pkg/plugins/crypto"
|
||||
pluginDate "github.com/yourname/cyrene-ai/pkg/plugins/datetime"
|
||||
pluginFile "github.com/yourname/cyrene-ai/pkg/plugins/file"
|
||||
pluginHTTP "github.com/yourname/cyrene-ai/pkg/plugins/http"
|
||||
pluginJSON "github.com/yourname/cyrene-ai/pkg/plugins/json"
|
||||
pluginMD "github.com/yourname/cyrene-ai/pkg/plugins/markdown"
|
||||
pluginRand "github.com/yourname/cyrene-ai/pkg/plugins/random"
|
||||
pluginText "github.com/yourname/cyrene-ai/pkg/plugins/text"
|
||||
pluginWF "github.com/yourname/cyrene-ai/pkg/plugins/web_fetch"
|
||||
pluginWS "github.com/yourname/cyrene-ai/pkg/plugins/web_search"
|
||||
plgManager "git.yeij.top/AskaEth/Cyrene/pkg/plugins/manager"
|
||||
plgSDK "git.yeij.top/AskaEth/Cyrene/pkg/plugins/sdk"
|
||||
pluginCalc "git.yeij.top/AskaEth/Cyrene/pkg/plugins/calculator"
|
||||
pluginCrypto "git.yeij.top/AskaEth/Cyrene/pkg/plugins/crypto"
|
||||
pluginDate "git.yeij.top/AskaEth/Cyrene/pkg/plugins/datetime"
|
||||
pluginFile "git.yeij.top/AskaEth/Cyrene/pkg/plugins/file"
|
||||
pluginHTTP "git.yeij.top/AskaEth/Cyrene/pkg/plugins/http"
|
||||
pluginJSON "git.yeij.top/AskaEth/Cyrene/pkg/plugins/json"
|
||||
pluginMD "git.yeij.top/AskaEth/Cyrene/pkg/plugins/markdown"
|
||||
pluginRand "git.yeij.top/AskaEth/Cyrene/pkg/plugins/random"
|
||||
pluginText "git.yeij.top/AskaEth/Cyrene/pkg/plugins/text"
|
||||
pluginWF "git.yeij.top/AskaEth/Cyrene/pkg/plugins/web_fetch"
|
||||
pluginWS "git.yeij.top/AskaEth/Cyrene/pkg/plugins/web_search"
|
||||
)
|
||||
|
||||
var cfg Config
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
module github.com/yourname/cyrene-ai/ai-core
|
||||
module git.yeij.top/AskaEth/Cyrene/ai-core
|
||||
|
||||
go 1.26.2
|
||||
|
||||
require (
|
||||
github.com/joho/godotenv v1.5.1
|
||||
github.com/lib/pq v1.10.9
|
||||
github.com/yourname/cyrene-ai/pkg/logger v0.0.0
|
||||
git.yeij.top/AskaEth/Cyrene/pkg/logger v0.0.0
|
||||
git.yeij.top/AskaEth/Cyrene/pkg/plugins v0.0.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
)
|
||||
|
||||
replace github.com/yourname/cyrene-ai/pkg/logger => ../pkg/logger
|
||||
replace (
|
||||
git.yeij.top/AskaEth/Cyrene/pkg/logger => ../pkg/logger
|
||||
git.yeij.top/AskaEth/Cyrene/pkg/plugins => ../pkg/plugins
|
||||
)
|
||||
|
||||
@@ -11,15 +11,15 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
ctxbuild "github.com/yourname/cyrene-ai/ai-core/internal/context"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/llm"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/memory"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/persona"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/tools"
|
||||
ctxbuild "git.yeij.top/AskaEth/Cyrene/ai-core/internal/context"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/llm"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/memory"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/persona"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/tools"
|
||||
|
||||
plgManager "github.com/yourname/cyrene-ai/pkg/plugins/manager"
|
||||
plgSDK "github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
plgManager "git.yeij.top/AskaEth/Cyrene/pkg/plugins/manager"
|
||||
plgSDK "git.yeij.top/AskaEth/Cyrene/pkg/plugins/sdk"
|
||||
)
|
||||
|
||||
// PendingThought 待推送的后台思考
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package bus
|
||||
|
||||
import (
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package bus
|
||||
|
||||
import (
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ import (
|
||||
|
||||
_ "github.com/lib/pq"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/memory"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/persona"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/memory"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/persona"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
)
|
||||
|
||||
// IoTDeviceSummary IoT设备摘要接口(避免循环依赖)
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"io"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
)
|
||||
|
||||
// Adapter LLM适配器接口
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
)
|
||||
|
||||
// OpenAIConfig OpenAI适配器配置
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/config"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/config"
|
||||
)
|
||||
|
||||
// ModelPurpose identifies the kind of LLM task.
|
||||
|
||||
@@ -6,11 +6,11 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
)
|
||||
|
||||
// Client 记忆服务 HTTP 客户端
|
||||
|
||||
@@ -4,10 +4,10 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"strings"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
)
|
||||
|
||||
// Extractor 记忆提取器 —— 从对话中提取结构化记忆
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
)
|
||||
|
||||
// MemoryEntry 记忆条目别名(避免与model包冲突)
|
||||
|
||||
@@ -4,11 +4,11 @@ import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
_ "github.com/lib/pq"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"strings"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/llm"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/llm"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
)
|
||||
|
||||
// IntentAnalyzer 意图分析器
|
||||
|
||||
@@ -3,23 +3,23 @@ package orchestrator
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/cache"
|
||||
ctxbuild "github.com/yourname/cyrene-ai/ai-core/internal/context"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/llm"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/memory"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/persona"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/subsession"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/cache"
|
||||
ctxbuild "git.yeij.top/AskaEth/Cyrene/ai-core/internal/context"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/llm"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/memory"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/persona"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/subsession"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/bus"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/scheduler"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/bus"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/scheduler"
|
||||
|
||||
plgManager "github.com/yourname/cyrene-ai/pkg/plugins/manager"
|
||||
plgManager "git.yeij.top/AskaEth/Cyrene/pkg/plugins/manager"
|
||||
)
|
||||
|
||||
// Orchestrator 对话编排器 v2.0
|
||||
|
||||
@@ -3,7 +3,7 @@ package orchestrator
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
)
|
||||
|
||||
func TestParseReviewMessages(t *testing.T) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
)
|
||||
|
||||
// codeBlockPattern matches fenced code blocks: ```lang\n...\n```
|
||||
|
||||
@@ -7,11 +7,11 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/llm"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
plgManager "github.com/yourname/cyrene-ai/pkg/plugins/manager"
|
||||
plgSDK "github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/llm"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
plgManager "git.yeij.top/AskaEth/Cyrene/pkg/plugins/manager"
|
||||
plgSDK "git.yeij.top/AskaEth/Cyrene/pkg/plugins/sdk"
|
||||
)
|
||||
|
||||
// Synthesizer 主会话综合器
|
||||
|
||||
@@ -3,12 +3,12 @@ package subsession
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/llm"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/persona"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/llm"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/persona"
|
||||
)
|
||||
|
||||
// GeneralProvider 通用对话子会话提供者
|
||||
|
||||
@@ -3,13 +3,13 @@ package subsession
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/persona"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/tools"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/persona"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/tools"
|
||||
)
|
||||
|
||||
// IoTDeviceProvider IoT 设备查询接口
|
||||
|
||||
@@ -5,9 +5,9 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/rag"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/rag"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
)
|
||||
|
||||
// KnowledgeProvider searches the knowledge base for relevant information.
|
||||
|
||||
@@ -4,12 +4,12 @@ import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"sync"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/bus"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/llm"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/bus"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/llm"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
)
|
||||
|
||||
// Manager 子会话管理器
|
||||
|
||||
@@ -7,10 +7,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/llm"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/memory"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/llm"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/memory"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
)
|
||||
|
||||
// MemoryRetriever 记忆检索接口
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/llm"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/persona"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/llm"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/persona"
|
||||
)
|
||||
|
||||
// Provider 子会话提供者接口
|
||||
|
||||
@@ -3,12 +3,12 @@ package subsession
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
)
|
||||
|
||||
// ReviewProvider 最终审查子会话提供者
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/host"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/host"
|
||||
)
|
||||
|
||||
// HostExecTool allows the AI to execute commands in a sandboxed environment.
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"net/http"
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/rag"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/rag"
|
||||
)
|
||||
|
||||
// KnowledgeSearchTool searches the knowledge base.
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/host"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/host"
|
||||
)
|
||||
|
||||
// OSExecTool allows the AI to execute arbitrary commands in a full OS
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/host"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/host"
|
||||
)
|
||||
|
||||
func TestOSExecToolWSL(t *testing.T) {
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/host"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/rag"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/host"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/rag"
|
||||
)
|
||||
|
||||
func TestHostExecToolDefinition(t *testing.T) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
)
|
||||
|
||||
// ToolDefinition 工具定义(用于 LLM function calling)
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/llm"
|
||||
"github.com/yourname/cyrene-ai/ai-core/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/llm"
|
||||
"git.yeij.top/AskaEth/Cyrene/ai-core/internal/model"
|
||||
)
|
||||
|
||||
// VisionTool enables image understanding via multimodal LLM.
|
||||
|
||||
@@ -10,6 +10,7 @@ COPY backend/gateway/ ./backend/gateway/
|
||||
COPY backend/pkg/ ./backend/pkg/
|
||||
|
||||
WORKDIR /app/backend/gateway
|
||||
ENV GOPROXY=https://goproxy.cn,direct
|
||||
RUN go mod download
|
||||
|
||||
# 编译 (静态链接)
|
||||
|
||||
@@ -2,7 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/signal"
|
||||
@@ -13,13 +13,13 @@ import (
|
||||
"github.com/joho/godotenv"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/config"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/engine"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/handler"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/middleware"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/router"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/store"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/ws"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/config"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/engine"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/handler"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/middleware"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/router"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/store"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/ws"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module github.com/yourname/cyrene-ai/gateway
|
||||
module git.yeij.top/AskaEth/Cyrene/gateway
|
||||
|
||||
go 1.26.2
|
||||
|
||||
@@ -31,7 +31,7 @@ require (
|
||||
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||
github.com/ugorji/go/codec v1.2.12 // indirect
|
||||
github.com/yourname/cyrene-ai/pkg/logger v0.0.0
|
||||
git.yeij.top/AskaEth/Cyrene/pkg/logger v0.0.0
|
||||
golang.org/x/arch v0.8.0 // indirect
|
||||
golang.org/x/net v0.25.0 // indirect
|
||||
golang.org/x/sys v0.20.0 // indirect
|
||||
@@ -40,4 +40,4 @@ require (
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
||||
replace github.com/yourname/cyrene-ai/pkg/logger => ../pkg/logger
|
||||
replace git.yeij.top/AskaEth/Cyrene/pkg/logger => ../pkg/logger
|
||||
|
||||
@@ -6,15 +6,15 @@ import (
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/store"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/ws"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/store"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/ws"
|
||||
)
|
||||
|
||||
// TriggerConfig 触发器配置
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/middleware"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/middleware"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
_ "github.com/lib/pq"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/config"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/store"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/config"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/store"
|
||||
)
|
||||
|
||||
// usernameRegex 用户名格式校验:仅允许字母、数字、下划线,长度 3-32
|
||||
|
||||
@@ -4,14 +4,14 @@ import (
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/engine"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/middleware"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/store"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/engine"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/middleware"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/store"
|
||||
)
|
||||
|
||||
// AutomationHandler 自动化处理器
|
||||
|
||||
@@ -18,10 +18,10 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gorilla/websocket"
|
||||
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/config"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/store"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/ws"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/config"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/store"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/ws"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
)
|
||||
|
||||
// queuedMsg 队列中的待处理消息
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"image/jpeg"
|
||||
"image/png"
|
||||
"io"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -21,8 +21,8 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/middleware"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/store"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/middleware"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/store"
|
||||
)
|
||||
|
||||
// FileHandler 文件管理处理器
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
_ "image/jpeg"
|
||||
_ "image/png"
|
||||
"io"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"net/http"
|
||||
"os"
|
||||
"sort"
|
||||
@@ -19,9 +19,9 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/config"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/middleware"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/store"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/config"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/middleware"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/store"
|
||||
)
|
||||
|
||||
// ImageHandler 图片分析处理器
|
||||
|
||||
@@ -2,15 +2,15 @@ package handler
|
||||
|
||||
import (
|
||||
"html"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/middleware"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/store"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/middleware"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/store"
|
||||
)
|
||||
|
||||
// KnowledgeHandler 知识库处理器
|
||||
|
||||
@@ -6,13 +6,13 @@ import (
|
||||
"fmt"
|
||||
"html"
|
||||
"io"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/middleware"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/middleware"
|
||||
)
|
||||
|
||||
// MemoryHandler 记忆查询处理器 — 代理到 Memory-Service
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/config"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/config"
|
||||
)
|
||||
|
||||
// ModelConfigHandler exposes admin CRUD endpoints for model configuration.
|
||||
|
||||
@@ -2,14 +2,14 @@ package handler
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/config"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/ws"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/config"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/ws"
|
||||
)
|
||||
|
||||
// NotificationHandler 通知推送处理器
|
||||
|
||||
@@ -3,16 +3,16 @@ package handler
|
||||
import (
|
||||
"encoding/json"
|
||||
"html"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/middleware"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/store"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/ws"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/middleware"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/store"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/ws"
|
||||
)
|
||||
|
||||
// ReminderHandler 提醒处理器
|
||||
|
||||
@@ -4,16 +4,16 @@ import (
|
||||
"crypto/rand"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/middleware"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/store"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/ws"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/middleware"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/store"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/ws"
|
||||
)
|
||||
|
||||
// SessionHandler 会话管理处理器
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/config"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/config"
|
||||
)
|
||||
|
||||
// ThinkingScheduleHandler handles CRUD for the thinking schedule config.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
|
||||
@@ -8,15 +8,15 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/config"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/ws"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/config"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/ws"
|
||||
)
|
||||
|
||||
// WebhookHandler 副对话系统处理器(第三方平台接入)
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/config"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/config"
|
||||
)
|
||||
|
||||
// Auth 用户键值在context中的key
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
@@ -6,12 +6,12 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/config"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/engine"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/handler"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/middleware"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/store"
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/ws"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/config"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/engine"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/handler"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/middleware"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/store"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/ws"
|
||||
)
|
||||
|
||||
// Setup 注册所有路由
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package store
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"crypto/rand"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
@@ -3,7 +3,7 @@ package store
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package store
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"time"
|
||||
|
||||
_ "github.com/lib/pq"
|
||||
|
||||
@@ -2,7 +2,7 @@ package ws
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"time"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
|
||||
@@ -3,14 +3,14 @@ package ws
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/gateway/internal/store"
|
||||
"git.yeij.top/AskaEth/Cyrene/gateway/internal/store"
|
||||
)
|
||||
|
||||
// SessionState 会话状态
|
||||
|
||||
@@ -10,6 +10,7 @@ COPY backend/iot-debug-service/ ./backend/iot-debug-service/
|
||||
COPY backend/pkg/ ./backend/pkg/
|
||||
|
||||
WORKDIR /app/backend/iot-debug-service
|
||||
ENV GOPROXY=https://goproxy.cn,direct
|
||||
RUN go mod download
|
||||
|
||||
# 编译 (静态链接)
|
||||
|
||||
@@ -3,7 +3,7 @@ package main
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
@@ -2,6 +2,6 @@ module cyrene/iot-debug-service
|
||||
|
||||
go 1.21
|
||||
|
||||
replace github.com/yourname/cyrene-ai/pkg/logger => ../pkg/logger
|
||||
replace git.yeij.top/AskaEth/Cyrene/pkg/logger => ../pkg/logger
|
||||
|
||||
require github.com/yourname/cyrene-ai/pkg/logger v0.0.0
|
||||
require git.yeij.top/AskaEth/Cyrene/pkg/logger v0.0.0
|
||||
|
||||
@@ -10,6 +10,7 @@ COPY backend/memory-service/ ./backend/memory-service/
|
||||
COPY backend/pkg/ ./backend/pkg/
|
||||
|
||||
WORKDIR /app/backend/memory-service
|
||||
ENV GOPROXY=https://goproxy.cn,direct
|
||||
RUN go mod download
|
||||
|
||||
# 编译 (静态链接)
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
|
||||
"github.com/yourname/cyrene-ai/memory-service/internal/config"
|
||||
"github.com/yourname/cyrene-ai/memory-service/internal/handler"
|
||||
"github.com/yourname/cyrene-ai/memory-service/internal/service"
|
||||
"github.com/yourname/cyrene-ai/memory-service/internal/store"
|
||||
"git.yeij.top/AskaEth/Cyrene/memory-service/internal/config"
|
||||
"git.yeij.top/AskaEth/Cyrene/memory-service/internal/handler"
|
||||
"git.yeij.top/AskaEth/Cyrene/memory-service/internal/service"
|
||||
"git.yeij.top/AskaEth/Cyrene/memory-service/internal/store"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
module github.com/yourname/cyrene-ai/memory-service
|
||||
module git.yeij.top/AskaEth/Cyrene/memory-service
|
||||
|
||||
go 1.26.2
|
||||
|
||||
require (
|
||||
github.com/lib/pq v1.10.9
|
||||
github.com/yourname/cyrene-ai/pkg/logger v0.0.0
|
||||
git.yeij.top/AskaEth/Cyrene/pkg/logger v0.0.0
|
||||
)
|
||||
|
||||
replace github.com/yourname/cyrene-ai/pkg/logger => ../pkg/logger
|
||||
replace git.yeij.top/AskaEth/Cyrene/pkg/logger => ../pkg/logger
|
||||
|
||||
@@ -2,12 +2,12 @@ package handler
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/yourname/cyrene-ai/memory-service/internal/model"
|
||||
"github.com/yourname/cyrene-ai/memory-service/internal/service"
|
||||
"git.yeij.top/AskaEth/Cyrene/memory-service/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/memory-service/internal/service"
|
||||
)
|
||||
|
||||
// MemoryHandler HTTP API 处理器
|
||||
|
||||
@@ -3,11 +3,11 @@ package service
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"strings"
|
||||
|
||||
"github.com/yourname/cyrene-ai/memory-service/internal/model"
|
||||
"github.com/yourname/cyrene-ai/memory-service/internal/store"
|
||||
"git.yeij.top/AskaEth/Cyrene/memory-service/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/memory-service/internal/store"
|
||||
)
|
||||
|
||||
// deDupThreshold 去重相似度阈值
|
||||
|
||||
@@ -4,11 +4,11 @@ import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"github.com/yourname/cyrene-ai/pkg/logger"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/logger"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/memory-service/internal/model"
|
||||
"git.yeij.top/AskaEth/Cyrene/memory-service/internal/model"
|
||||
_ "github.com/lib/pq"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module github.com/yourname/cyrene-ai/pkg/logger
|
||||
module git.yeij.top/AskaEth/Cyrene/pkg/logger
|
||||
|
||||
go 1.21
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/plugins/sdk"
|
||||
)
|
||||
|
||||
type CalculatorPlugin struct {
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"hash"
|
||||
"net/url"
|
||||
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/plugins/sdk"
|
||||
)
|
||||
|
||||
type CryptoPlugin struct{ sdk.BasePlugin }
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/plugins/sdk"
|
||||
)
|
||||
|
||||
type DatetimePlugin struct{ sdk.BasePlugin }
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/plugins/sdk"
|
||||
)
|
||||
|
||||
type FilePlugin struct {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module github.com/yourname/cyrene-ai/pkg/plugins
|
||||
module git.yeij.top/AskaEth/Cyrene/pkg/plugins
|
||||
|
||||
go 1.21
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/plugins/sdk"
|
||||
)
|
||||
|
||||
type HTTPPlugin struct {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/plugins/sdk"
|
||||
)
|
||||
|
||||
// IoTController extends IoTClient with control operations.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/plugins/sdk"
|
||||
)
|
||||
|
||||
// IoTClient is the interface for IoT device access.
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/plugins/sdk"
|
||||
)
|
||||
|
||||
type JSONPlugin struct{ sdk.BasePlugin }
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/plugins/sdk"
|
||||
)
|
||||
|
||||
// PluginManager manages the lifecycle of all plugins and their tools.
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/plugins/sdk"
|
||||
)
|
||||
|
||||
// CallLogRecord 工具调用记录
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/plugins/sdk"
|
||||
)
|
||||
|
||||
type MarkdownPlugin struct{ sdk.BasePlugin }
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
mathrand "math/rand"
|
||||
"strings"
|
||||
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/plugins/sdk"
|
||||
)
|
||||
|
||||
type RandomPlugin struct{ sdk.BasePlugin }
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/plugins/sdk"
|
||||
)
|
||||
|
||||
type TextPlugin struct{ sdk.BasePlugin }
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/plugins/sdk"
|
||||
)
|
||||
|
||||
type WebFetchPlugin struct {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
"git.yeij.top/AskaEth/Cyrene/pkg/plugins/sdk"
|
||||
)
|
||||
|
||||
type WebSearchPlugin struct {
|
||||
|
||||
@@ -11,17 +11,17 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
discordstub "github.com/yourname/cyrene-ai/platform-bridge/internal/adapter/discord"
|
||||
feishustub "github.com/yourname/cyrene-ai/platform-bridge/internal/adapter/feishu"
|
||||
qqadapter "github.com/yourname/cyrene-ai/platform-bridge/internal/adapter/qq"
|
||||
telegramadapter "github.com/yourname/cyrene-ai/platform-bridge/internal/adapter/telegram"
|
||||
wechatstub "github.com/yourname/cyrene-ai/platform-bridge/internal/adapter/wechat"
|
||||
webhookadapter "github.com/yourname/cyrene-ai/platform-bridge/internal/adapter/webhook"
|
||||
"github.com/yourname/cyrene-ai/platform-bridge/internal/bridge"
|
||||
"github.com/yourname/cyrene-ai/platform-bridge/internal/config"
|
||||
"github.com/yourname/cyrene-ai/platform-bridge/internal/handler"
|
||||
"github.com/yourname/cyrene-ai/platform-bridge/internal/logging"
|
||||
"github.com/yourname/cyrene-ai/platform-bridge/internal/permissions"
|
||||
discordstub "git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/adapter/discord"
|
||||
feishustub "git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/adapter/feishu"
|
||||
qqadapter "git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/adapter/qq"
|
||||
telegramadapter "git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/adapter/telegram"
|
||||
wechatstub "git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/adapter/wechat"
|
||||
webhookadapter "git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/adapter/webhook"
|
||||
"git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/bridge"
|
||||
"git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/config"
|
||||
"git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/handler"
|
||||
"git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/logging"
|
||||
"git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/permissions"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module github.com/yourname/cyrene-ai/platform-bridge
|
||||
module git.yeij.top/AskaEth/Cyrene/platform-bridge
|
||||
|
||||
go 1.26.2
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/yourname/cyrene-ai/platform-bridge/internal/bridge"
|
||||
"git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/bridge"
|
||||
)
|
||||
|
||||
// Adapter implements PlatformAdapter for Discord Bot API.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/yourname/cyrene-ai/platform-bridge/internal/bridge"
|
||||
"git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/bridge"
|
||||
)
|
||||
|
||||
// Adapter implements PlatformAdapter for Feishu (Lark Open API).
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
|
||||
"github.com/yourname/cyrene-ai/platform-bridge/internal/bridge"
|
||||
"git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/bridge"
|
||||
)
|
||||
|
||||
var upgrader = websocket.Upgrader{
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/platform-bridge/internal/bridge"
|
||||
"git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/bridge"
|
||||
)
|
||||
|
||||
// Adapter implements PlatformAdapter for Telegram Bot API.
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/platform-bridge/internal/bridge"
|
||||
"git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/bridge"
|
||||
)
|
||||
|
||||
// WebhookPayload is the standard webhook request body.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/yourname/cyrene-ai/platform-bridge/internal/bridge"
|
||||
"git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/bridge"
|
||||
)
|
||||
|
||||
// Adapter implements PlatformAdapter for WeChat (Enterprise WeChat / Personal Hook).
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/yourname/cyrene-ai/platform-bridge/internal/permissions"
|
||||
"git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/permissions"
|
||||
)
|
||||
|
||||
// IdentityMapper maps platform identities to Cyrene users.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/yourname/cyrene-ai/platform-bridge/internal/permissions"
|
||||
"git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/permissions"
|
||||
)
|
||||
|
||||
// PlatformRouter manages all platform adapters and routes messages.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/yourname/cyrene-ai/platform-bridge/internal/bridge"
|
||||
"git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/bridge"
|
||||
)
|
||||
|
||||
// BridgeHandler exposes the Platform Bridge REST API.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user