Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Bug report
description: 报告可复现的功能异常
title: "[Bug]: "
labels: [bug]
body:
- type: markdown
attributes:
value: 感谢反馈。请勿在 Issue 中粘贴 API Key、订单隐私数据或其他敏感信息。

- type: textarea
id: description
attributes:
label: 问题描述
description: 清楚说明实际发生了什么。
validations:
required: true

- type: textarea
id: steps
attributes:
label: 复现步骤
placeholder: |
1. 启动后端和前端
2. 输入……
3. 观察到……
validations:
required: true

- type: textarea
id: expected
attributes:
label: 预期行为
validations:
required: true

- type: input
id: environment
attributes:
label: 运行环境
placeholder: macOS 15 / Node.js 22 / pnpm 11
validations:
required: true

- type: textarea
id: logs
attributes:
label: 脱敏后的日志或截图
description: 请移除 API Key、用户身份信息和订单隐私数据。
render: shell
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Security vulnerability
url: https://github.com/ACCS-0521/EcommerceAgent/security/advisories/new
about: 请通过私密安全公告报告漏洞,不要创建公开 Issue。
44 changes: 44 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Feature request
description: 提议符合当前项目阶段的新功能
title: "[Feature]: "
labels: [enhancement]
body:
- type: markdown
attributes:
value: 当前项目优先保持 MVP 简洁,请说明功能解决的具体问题。

- type: textarea
id: problem
attributes:
label: 要解决的问题
validations:
required: true

- type: textarea
id: solution
attributes:
label: 建议方案
validations:
required: true

- type: dropdown
id: area
attributes:
label: 影响范围
options:
- Agent / Tool Calling
- Express API
- React UI
- Mock 数据
- 测试与工程化
- 文档
validations:
required: true

- type: checkboxes
id: scope
attributes:
label: MVP 边界确认
options:
- label: 该建议不要求引入数据库、登录、RAG、后台管理或多 Agent。
required: true
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
day: monday
time: "09:00"
timezone: Asia/Shanghai
open-pull-requests-limit: 5

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
day: monday
time: "09:30"
timezone: Asia/Shanghai
open-pull-requests-limit: 5
25 changes: 25 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## 变更说明

<!-- 简要说明本 PR 修改了什么,以及为什么需要修改。 -->

## 影响范围

- [ ] Agent / Tool Calling
- [ ] Express API
- [ ] React UI
- [ ] Mock 数据
- [ ] 测试或文档

## 验证

- [ ] `pnpm test`
- [ ] `pnpm typecheck`
- [ ] `pnpm test:web`
- [ ] `pnpm build:web`

## 检查清单

- [ ] 业务数据仍全部来自 `data/`
- [ ] DeepSeek 调用仍统一经过 `server/services/llmService.ts`
- [ ] 未提交 `.env`、API Key 或真实用户数据
- [ ] 未引入数据库、登录、RAG、后台管理或多 Agent
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
test-and-build:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout repository
uses: actions/checkout@v7

- name: Install pnpm
uses: pnpm/action-setup@v6
with:
version: 11.5.3

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Test backend
run: pnpm test

- name: Type-check backend
run: pnpm typecheck

- name: Build backend
run: pnpm build

- name: Test frontend
run: pnpm test:web

- name: Build frontend
run: pnpm build:web
39 changes: 39 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Contributor Covenant Code of Conduct

## Our pledge

我们承诺为所有参与者提供开放、友好、尊重和无骚扰的协作环境,无论其年龄、体型、可见或不可见的残障、族裔、性别特征、性别认同与表达、经验水平、教育程度、社会经济地位、国籍、个人外貌、种族、宗教或性取向如何。

## Our standards

有助于营造积极环境的行为包括:

- 使用友好、包容的语言;
- 尊重不同观点和经验;
- 给予和接受建设性反馈;
- 关注对社区最有利的事情;
- 对其他社区成员表现出同理心。

不可接受的行为包括:

- 性化语言或图像,以及不受欢迎的性关注;
- 挑衅、侮辱、贬损评论或人身攻击;
- 公开或私下骚扰;
- 未经明确许可公开他人的私人信息;
- 其他在专业环境中不适当的行为。

## Enforcement responsibilities

项目维护者负责澄清和执行行为准则,并可以删除、编辑或拒绝不符合本准则的评论、提交、代码、Issue、PR 或其他贡献。

## Scope

本准则适用于项目空间,也适用于个人代表项目或社区时的公开空间。

## Enforcement

如需报告违反行为准则的行为,请通过仓库维护者提供的安全或联系渠道进行。所有投诉都会被认真审查,并在合理范围内保护报告人的隐私。

## Attribution

本行为准则改编自 [Contributor Covenant](https://www.contributor-covenant.org/),版本 2.1。
42 changes: 42 additions & 0 deletions CONTENT_NOTICE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 内容、数据、AI 与隐私说明

## 项目性质

EcommerceAgent 是一个用于学习、演示和软件开发验证的智能电商客服 Agent MVP。它不连接真实电商平台,不处理真实订单,不代表任何商家、物流公司、支付机构或售后服务方。

## Mock 数据边界

当前版本的业务数据全部来自仓库内的 `data/` 目录,包括商品、订单、用户、物流、优惠券、FAQ 和售后规则等 JSON 文件。

- 商品价格、库存、规格、订单状态、物流状态、优惠券和售后规则仅用于功能演示。
- 数据不应被视为真实交易、真实履约或真实客服承诺。
- 维护数据时,请不要提交真实姓名、手机号、地址、身份证号、真实订单号、真实物流单号或其他个人信息。
- 如果后续接入真实业务系统,应在上线前补充正式的数据处理说明、权限控制、审计、脱敏和删除机制。

## AI 输出边界

项目通过 DeepSeek Tool Calling 演示客服对话流程。模型回复可能存在误判、遗漏或表达不准确。

本项目已通过 Tool 与安全规则降低幻觉风险,但仍应遵循以下边界:

- 商品、订单、物流、优惠券和售后信息必须来自 Tool 返回结果,不能由模型自行编造。
- 投诉、赔偿、法律、账号异常、金额争议和连续失败场景应转人工处理。
- 演示回复不能替代真实商家客服、法律意见、财务结算或平台官方规则。
- 生产环境接入前需要增加更严格的权限、日志、风控、监控和人工复核机制。

## DeepSeek API 与外部传输

本地运行时,如果配置了 `DEEPSEEK_API_KEY`,聊天内容会发送到配置的 DeepSeek API 地址用于生成回复和 Tool Calling 决策。

请注意:

- 不要在演示中输入真实个人敏感信息或真实商业机密。
- 不要提交 `.env`、API Key、访问令牌、私钥或调试日志。
- `.env.example` 只用于说明配置项,不应包含真实密钥。
- 如果面向真实用户开放服务,应提供正式隐私政策,并明确第三方模型服务的数据处理方式。

## 软件许可证边界

根目录的 MIT License 适用于本仓库的程序源代码。Mock 数据、品牌名称、第三方服务名称、模型服务名称和任何外部链接的相关权利仍归其各自权利人所有。

如发现仓库中包含不应公开的数据、密钥或侵权内容,请按 [SECURITY.md](SECURITY.md) 的方式私密报告,或通过 Issue 提供可核验的信息。
75 changes: 75 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Contributing

感谢你愿意改进 EcommerceAgent。这个项目当前目标是先跑通智能电商客服 MVP,因此贡献也应保持小而清晰,避免把第二、三、四阶段能力提前塞进来。

## 开发原则

- 不引入数据库、登录系统、JWT、RAG、后台管理、多 Agent、Docker 或消息队列。
- 所有业务数据从 `data/` 读取,禁止在业务代码中硬编码商品、订单、物流、优惠券或售后结果。
- 所有大模型调用必须统一经过 `server/services/llmService.ts`。
- Tool 需要可测试,错误返回要明确、可解释。
- UI 以简洁可用为主,不为了视觉效果牺牲 MVP 稳定性。

## 本地开发

```bash
pnpm install
cp .env.example .env
```

在 `.env` 中配置自己的 DeepSeek API Key:

```env
DEEPSEEK_API_KEY=your_deepseek_api_key
DEEPSEEK_MODEL=deepseek-v4-flash
```

不要提交 `.env`、API Key、真实订单、真实用户数据或本地调试日志。

启动后端:

```bash
pnpm dev
```

启动前端:

```bash
pnpm dev:web
```

## 提交前检查

请尽量在提交前运行:

```bash
pnpm test
pnpm typecheck
pnpm build
pnpm test:web
pnpm build:web
```

普通测试不会调用真实 DeepSeek API。只有 `pnpm test:live-intents` 会使用真实模型服务并产生 API 用量。

## Pull Request 规范

PR 请尽量保持一个清晰主题,并说明:

- 修改了什么;
- 为什么需要修改;
- 如何验证;
- 是否影响 DeepSeek 配置、Tool 行为、Mock 数据或前端交互。

如果 PR 修改了 `data/`、Tool schema、系统提示词或安全策略,请同步补充或更新测试用例。

## Issue 规范

提交 Bug 时,请尽量提供:

- 复现步骤;
- 期望结果和实际结果;
- 运行环境;
- 已脱敏的错误日志或截图。

安全问题、密钥泄露和隐私数据暴露请不要发公开 Issue,请阅读 [SECURITY.md](SECURITY.md)。
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 ACCS-0521

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading