7c67256f87
CI / Go · build + vet + test (pull_request) Failing after 30m3s
CI / Frontend · tsc (sundynix-admin) (pull_request) Failing after 9m42s
CI / Frontend · tsc (sundynix-desktop/frontend) (pull_request) Failing after 16m53s
CI / Frontend · tsc (sundynix-web) (pull_request) Has been cancelled
CI / mcp-py · sandbox guard (pull_request) Has been cancelled
SaaS P3 收口第二刀(设计见 SAAS_DESIGN.md §8)。第三个产品面:desktop=用户 工作产品、admin=平台超管控制塔、web=租户客户的自助柜台——做「装桌面端之前 就要能用」的那些事,三者不合并。 - 骨架抄 admin(HashRouter+路由注册表+me()/sdx:logout 鉴权门+vite/vitest 单文件配置);UI 整目录搬 desktop 的 ui/ 组件+ink/brand 主题 token(亮暗 双主题),品牌观感与桌面端一致;api.ts 抄 desktop 的 auth/tenant/usage 段 (纯 fetch 零 Wails 依赖),成员管理/建组织打新的租户自助接口。 - 页面:登录注册(一页两态)/概览(组织+角色+余额+桌面端下载指引)/团队(名册+ 邀请+改角色+移除,写控件按角色显隐、真闸在后端)/组织(列表+自助新建+切换)/ 用量与账单(余额 hero+趋势+合计+最近消耗,数据全来自现成 /me/usage;充值 只放说明占位,支付 P5 再接,不做假入口)。 - 工程:vite :5175、launch.json 配置、make webface、ci.yml web 矩阵纳入。 - 测试:tsc 干净;vitest 3 例(fmtCredits 去尾零——测试先行抓出 1.50 毛刺; ASSIGNABLE_ROLES 不含 owner)。浏览器 live 全流程:甲(owner)登录→概览→ 团队邀请乙→乙(member)登录写控件全隐藏、名册只读,组织/用量页真数据渲染。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
70 lines
2.9 KiB
Makefile
70 lines
2.9 KiB
Makefile
.PHONY: infra infra-down devnats demo e2e test test-go test-web test-py gateway dispatcher mcp-go mcp-py mcp-py-setup web admin webface desktop desktop-build tidy
|
||
|
||
infra: ## 启动基础设施 (NATS / Postgres / Redis / Milvus / Neo4j)
|
||
docker compose up -d
|
||
|
||
infra-down:
|
||
docker compose down
|
||
|
||
devnats: ## 启动内嵌 JetStream NATS(无 Docker 本地联调)
|
||
cd sundynix-shared && go run ./cmd/devnats
|
||
|
||
demo: ## 一键演示 Gateway→NATS→Dispatcher 任务流(无需 Docker)
|
||
bash scripts/demo.sh
|
||
|
||
e2e: ## 跑共享 bus 的端到端测试(内嵌 NATS):任务流 / 工具调用 / Token 流
|
||
cd sundynix-shared && go test ./bus/ -run 'TestTaskRoundTrip|TestToolCallRoundTrip|TestTokenStreamRoundTrip' -v
|
||
|
||
test: test-go test-web ## 跑全部测试(后端各模块 go test + 前端类型检查)
|
||
|
||
test-go: ## 各 Go 模块单测(DB 集成测试无 MEMORY_TEST_DSN 自动跳过)
|
||
cd sundynix-shared && go test ./...
|
||
cd sundynix-gateway && go test ./...
|
||
cd sundynix-dispatcher && go test ./...
|
||
cd sundynix-mcp-go && go test ./...
|
||
|
||
test-web: ## 前端 TypeScript 类型检查
|
||
cd sundynix-desktop/frontend && npx tsc --noEmit
|
||
|
||
test-py: ## mcp-py 沙箱守卫测试(需 venv;缺 pytest 用内置 harness 兜底)
|
||
cd sundynix-mcp-py && ( PYTHONPATH=src:tests .venv/bin/python -m pytest tests/ -q 2>/dev/null \
|
||
|| PYTHONPATH=src:tests .venv/bin/python -c "import test_sandbox as t; \
|
||
fns=[getattr(t,n) for n in dir(t) if n.startswith('test_')]; \
|
||
[ (f(),print('PASS',f.__name__)) for f in fns ]; print(f'{len(fns)} passed')" )
|
||
|
||
gateway:
|
||
cd sundynix-gateway && go run ./cmd/server
|
||
|
||
dispatcher:
|
||
cd sundynix-dispatcher && go run ./cmd/dispatcher
|
||
|
||
mcp-go:
|
||
cd sundynix-mcp-go && go run ./cmd/server
|
||
|
||
mcp-py-setup: ## 创建 venv 并安装 mcp-py 依赖(首次运行 mcp-py 前执行)
|
||
cd sundynix-mcp-py && python3 -m venv .venv && .venv/bin/pip install -q -e .
|
||
|
||
mcp-py: ## 运行 Python 算法型 MCP 工具服务(缺 venv 则自动 setup)
|
||
cd sundynix-mcp-py && [ -x .venv/bin/python ] || $(MAKE) mcp-py-setup
|
||
cd sundynix-mcp-py && .venv/bin/python -m sundynix_mcp_py.main
|
||
|
||
web: ## 桌面端前端 dev(Vite :5173,连本地 Gateway:8080)
|
||
cd sundynix-desktop/frontend && npm install && npm run dev
|
||
|
||
admin: ## 运维控制台 dev(Vite :5174,配置 LLM 模型等控制面)
|
||
cd sundynix-admin && npm install && npm run dev
|
||
|
||
webface: ## 薄 Web 面 dev(Vite :5175,租户自助:注册/组织/团队/账单)
|
||
cd sundynix-web && npm install && npm run dev
|
||
|
||
desktop: ## 真实桌面端开发模式(Wails 原生窗口 + 热重载;需先 make infra + 后端 + 配模型)
|
||
cd sundynix-desktop && GOWORK=off wails3 dev
|
||
|
||
desktop-build: ## 打包桌面端为原生 .app(产物在 sundynix-desktop/bin/)
|
||
cd sundynix-desktop && GOWORK=off wails3 package
|
||
|
||
tidy:
|
||
cd sundynix-gateway && go mod tidy
|
||
cd sundynix-dispatcher && go mod tidy
|
||
cd sundynix-mcp-go && go mod tidy
|