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