feat(shipping-notice): 增强订单抽取功能,添加进度事件和诊断运行管理,优化数据模型和访问控制
This commit is contained in:
1 parent
ce26d6d0c4
commit
c4095b08da
175 files changed
+13064
-1814
No files matched your search
@@ -258,7 +258,7 @@ flask db upgrade
|
||||
| --- | --- | --- | --- |
|
||||
| `agent_code` | `String(64)` | `'generic'` | 非 UNIQUE |
|
||||
| `runtime_provider` | `String(32)` | `'dify'` | dify \| builtin \| hybrid \| iframe |
|
||||
| `conversation_mode` | `String(32)` | `'chat'` | chat \| task_chat \| embedded |
|
||||
| `conversation_mode` | `String(32)` | `'chat'` | chat \| task_chat \| embedded;internal Provider 历史保留但运行时忽略 |
|
||||
| `dify_app_type` | `String(20)` | `'chatflow'` | chatflow \| workflow |
|
||||
| `iframe_url` | `String(500)` | NULL | |
|
||||
| `category` | `String(64)` | NULL | |
|
||||
@@ -318,6 +318,9 @@ def resolve_runtime_provider(agent) -> str:
|
||||
def resolve_conversation_mode(agent) -> str:
|
||||
"""只读 agents.conversation_mode 列;缺省 chat。"""
|
||||
|
||||
def resolve_effective_role(agent) -> str:
|
||||
"""exposure_mode=internal 时返回 internal_executor,否则返回 user_agent。"""
|
||||
|
||||
def resolve_capabilities(agent) -> dict:
|
||||
"""只读 agents.capabilities 列;NULL 时 DEFAULT_CAPABILITIES。"""
|
||||
|
||||
@@ -626,6 +629,25 @@ Intent Router **不**替代 `runtime_provider`;仅在 `completions` 内先于
|
||||
|
||||
### 8.4 迁移退出(代码已完成,环境待 backfill)
|
||||
|
||||
### 8.5 内部执行器历史兼容
|
||||
|
||||
- 旧客户端仍可读写 `conversation_mode`、`exposure_mode`、`type`、`extra_config` 和 Runtime Binding `enabled`;结构化列优先,`extra_config` 不参与运行时兜底。
|
||||
- 历史 `exposure_mode=internal` Provider 的 `conversation_mode` 原值保留,但运行时忽略;不得批量改为 `workspace`。
|
||||
- 新建 internal 记录强制为 `dify + workflow`;历史非法组合允许读取和编辑,但不能新建绑定或执行新 Run。
|
||||
- 迁移只允许先 dry-run 诊断,再由管理员逐项修正;不得按名称猜测订单抽取 Provider,也不得自动切换已有绑定。
|
||||
- 历史 Run 继续使用冻结的 Provider 身份;API Key 不冻结,允许轮换。App ID、Base URL 或协议漂移继续触发执行身份门禁。
|
||||
- 内部执行器不持久化业务服务编码;业务能力用途以 Runtime Binding 的 `capability_code` 为权威来源。
|
||||
|
||||
### 8.6 管理端双页签
|
||||
|
||||
- `应用` 页签调用 `/api/admin/agents?scope=applications`,只展示 workspace 用户入口。
|
||||
- `内部执行器` 页签调用 `/api/admin/agents?scope=executors`,只展示 internal Provider。
|
||||
- 应用表单不显示内部服务类型;内部执行器表单不显示应用类型、对话形态、应用可见性、用户权限及聊天配置。
|
||||
- `exposure_mode` 由创建入口固定,已有资源禁止在两种角色之间转换。
|
||||
- 用户管理、权限矩阵、常用问题、热点和应用资料选择器显式请求 `scope=applications`;旧客户端无 scope 返回全部仅用于管理兼容,不得用于用户授权。
|
||||
- 后端统一通过 `agent_user_access` 策略阻断 internal ID:授权写入明确失败,公开/工作台/详情/指南/收藏/快捷问题/普通 Chat 防御性过滤或拒绝,管理员用户入口不例外。
|
||||
- 迁移 `a62b3c4d5e6f` 清理内部执行器的用户授权、收藏、首页默认关系及 `users.default_agent_id`,并拒绝尚未处理的内部执行器权限申请;历史内容与已审批记录保留用于审计。
|
||||
|
||||
**代码变更(已合入)**:
|
||||
|
||||
| 步骤 | 文件 | 状态 |
|
||||
|
||||
Reference in new issue
Block a user