diff --git a/.python-version b/.python-version deleted file mode 100644 index e4fba21..0000000 --- a/.python-version +++ /dev/null @@ -1 +0,0 @@ -3.12 diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index eb7580b..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,26 +0,0 @@ -[project] -name = "ekb-cli" -version = "0.1.0" -description = "Add your description here" -readme = "README.md" -authors = [ - { name = "yunyingk", email = "haoda2195176187@gmail.com" } -] -requires-python = ">=3.12" -dependencies = [ - "httpx[socks]>=0.28.1", - "pydantic>=2.12.5", - "questionary>=2.1.1", - "rich>=14.3.3", - "typer>=0.24.1", - # HTTP server 支持(ekb serve) - "fastapi>=0.115.0", - "uvicorn[standard]>=0.34.0", -] - -[project.scripts] -ekb = "ekb_cli:main" - -[build-system] -requires = ["uv_build>=0.10.12,<0.11.0"] -build-backend = "uv_build" diff --git a/scripts/find_http_nodes.py b/scripts/find_http_nodes.py deleted file mode 100644 index 47c742b..0000000 --- a/scripts/find_http_nodes.py +++ /dev/null @@ -1,123 +0,0 @@ -"""临时脚本:扫描所有自建应用下含 HTTP 节点的工作流并输出汇总表格。 - -用法: - .venv/bin/python scripts/find_http_nodes.py - -说明: -- 复用单个 EasoClient 扫所有平台,减少认证请求次数 -- 工作流列表接口已包含完整 tasks,无需逐一调详情接口 -- 自动处理分页(page_size=100) -""" - -from rich.console import Console -from rich.table import Table -from rich import print as rprint - -from ekb_cli.api.platform.easo_client import get_easo_client -from ekb_cli.api.platform.platform_api import list_platforms -from ekb_cli.api.platform.workflow_api import list_workflows -from ekb_cli.api import get_client - - -console = Console() - - -def collect_http_tasks(tasks: list) -> list: - """递归收集所有层级中 type='http' 的节点(含控制节点内的嵌套节点)""" - result = [] - for t in tasks: - if t.get("type") == "http": - result.append(t) - # 控制节点(every / condition 等)内部可嵌套子节点 - nested = t.get("tasks") - if nested and isinstance(nested, list): - result.extend(collect_http_tasks(nested)) - return result - - -def main(): - console.print("[bold]扫描所有自建应用下含 HTTP 节点的工作流...[/bold]\n") - - # 获取所有自建应用 - with get_client() as ekb_client: - platforms = list_platforms(ekb_client) - - console.print(f"共 {len(platforms)} 个自建应用,开始扫描工作流...\n") - - rows = [] # (platform_name, platform_id, wf_name, wf_id, http_count, http_urls) - - with get_easo_client() as easo_client: - for p in platforms: - console.print(f" 扫描 [cyan]{p.name}[/cyan] ({p.id}) ...", end=" ") - - # 一次拉完(应用内工作流数量有限,page_size=100 足够覆盖) - result = list_workflows(easo_client, p.id, page=1, page_size=100) - all_workflows = result.pipelineList - - console.print(f"{len(all_workflows)} 个工作流") - - for wf in all_workflows: - if wf.state != 1: # 只看启用的工作流 - continue - http_tasks = collect_http_tasks(wf.tasks) - if not http_tasks: - continue - # 提取 HTTP 节点的 URL(如有) - urls = [t.get("url", "") for t in http_tasks] - rows.append((p.name, p.id, wf.pipelineName, wf.id, len(http_tasks), urls)) - - console.print() - - if not rows: - rprint("[yellow]未找到含 HTTP 节点的工作流[/yellow]") - return - - # 汇总表格 - table = Table( - title=f"含 HTTP 节点的工作流(共 {len(rows)} 个)", - show_lines=True, - ) - table.add_column("自建应用", style="cyan") - table.add_column("工作流名称") - table.add_column("工作流 ID", style="dim") - table.add_column("HTTP 节点数", justify="center", style="bold yellow") - table.add_column("HTTP URL(节点顺序)") - - for platform_name, _, wf_name, wf_id, http_count, urls in rows: - table.add_row( - platform_name, - wf_name, - wf_id, - str(http_count), - "\n".join(u if u else "(未配置 URL)" for u in urls), - ) - - console.print(table) - - # 按应用汇总 - console.print() - summary = {} - for platform_name, _, _, _, http_count, _ in rows: - summary[platform_name] = summary.get(platform_name, 0) + http_count - - summary_table = Table(title="按自建应用汇总(HTTP 节点总数)") - summary_table.add_column("自建应用", style="cyan") - summary_table.add_column("涉及工作流数", justify="center") - summary_table.add_column("HTTP 节点总数", justify="center", style="bold") - - wf_count_by_platform = {} - for platform_name, _, _, _, _, _ in rows: - wf_count_by_platform[platform_name] = wf_count_by_platform.get(platform_name, 0) + 1 - - for platform_name, total_http in sorted(summary.items(), key=lambda x: -x[1]): - summary_table.add_row( - platform_name, - str(wf_count_by_platform[platform_name]), - str(total_http), - ) - - console.print(summary_table) - - -if __name__ == "__main__": - main() diff --git a/src/ekb_cli/__init__.py b/src/ekb_cli/__init__.py deleted file mode 100644 index 2b4695d..0000000 --- a/src/ekb_cli/__init__.py +++ /dev/null @@ -1,37 +0,0 @@ -"""ekb-cli:快报命令行工具 - -入口:注册所有命令组,统一捕获 EkbError 异常。 -""" - -import typer -from ekb_cli.commands import auth -from ekb_cli.commands.agent import app as agent_app -from ekb_cli.commands.sealai import app as sealai_app -from ekb_cli.commands.platform import app as platform_app -from ekb_cli.commands.help import cmd_commands -from ekb_cli.commands.serve import cmd_serve - -app = typer.Typer( - name="ekb", - help="快报(ekuaibao)命令行工具", - no_args_is_help=True, -) - -app.add_typer(auth.app, name="auth") -app.add_typer(agent_app, name="agent") -app.add_typer(sealai_app, name="sealai") -app.add_typer(platform_app, name="platform") -app.command("commands")(cmd_commands) -app.command("serve")(cmd_serve) - - -def main(): - """CLI 入口:统一捕获 EkbError,输出友好错误信息""" - from ekb_cli.errors import EkbError - from rich import print as rprint - - try: - app() - except EkbError as e: - rprint(f"[red]{e.message}[/red]") - raise SystemExit(1) diff --git a/src/ekb_cli/api/README.api.md b/src/ekb_cli/api/README.api.md deleted file mode 100644 index 26ea1f0..0000000 --- a/src/ekb_cli/api/README.api.md +++ /dev/null @@ -1,84 +0,0 @@ -# API 层说明(`ekb_cli/api/`) - -## 三层架构 - -``` -api/ -├── __init__.py # 第1层:HTTP 客户端(EkbClient)+ 统一 re-export -├── schemas.py # 第2层辅助:Pydantic 响应模型,所有接口响应在此校验 -├── agent.py # 第2层:Agent 相关接口封装 -└── rule.py # 第2层:Rule(审核规则)相关接口封装 -``` - -**commands 只从 `ekb_cli.api` 导入**,内部文件如何拆分对上层透明: - -```python -from ekb_cli.api import get_client, list_agents, get_agent, list_rules, ... -``` - ---- - -## `__init__.py` — HTTP 客户端 - -`EkbClient` 负责:带认证头(`accesstoken` / `corpid` / `staffid`)发 HTTP 请求,返回原始 JSON。它不理解业务。 - -| 方法 | 说明 | -|------|------| -| `get(path, **params)` | GET 请求,自动附加 `corpId` | -| `post(path, body, **params)` | POST 请求,body 为 JSON | - -`get_client()` 从 `~/.config/ekb-cli/config.json` 读取当前企业认证信息,构建 `EkbClient`。 - ---- - -## `schemas.py` — Pydantic 响应模型 - -所有模型使用 `extra="allow"`(允许快报新增字段,但已知字段强制类型校验)。API 格式变更时,Pydantic 会抛出 `ValidationError`,精确定位到字段名。 - -| 模型 | 用途 | -|------|------| -| `EkbResponse[T]` | 通用响应包装(`code` / `msg` / `data`) | -| `PageData[T]` | 通用分页(`totalItems` / `items`) | -| `AgentSummary` | Agent 列表中的摘要条目(无 `agentRule`) | -| `AgentDetail` | Agent 详情(含 `agentRule` 列表) | -| `AgentRuleRef` | `AgentDetail` 中内嵌的规则完整字段 | -| `Rule` | 规则新建/更新的响应体 | -| `RuleWithAgents` | 规则列表中的条目(含 `agents` 关联摘要) | -| `RuleAgentRef` | `RuleWithAgents` 中关联 Agent 摘要(`id/name/icon`) | - ---- - -## `agent.py` — Agent 接口 - -| 函数 | 方法 | 路径 | 返回 | -|------|------|------|------| -| `check_agent_name(client, name)` | GET | `/engine/hab/agent/checkName` | `bool`(`True`=可用) | -| `list_agents(client, page, size)` | GET | `/engine/hab/agent/list` | `PageData[AgentSummary]` | -| `get_agent(client, agent_id)` | GET | `/engine/hab/agent/detail` | `AgentDetail` | -| `save_agent(client, payload)` | POST | `/engine/hab/agent/save` | `AgentDetail` | - -> `save_agent` 同时承担新建(无 `id`)和更新(有 `id`)。 - ---- - -## `rule.py` — Rule 接口 - -| 函数 | 方法 | 路径 | 返回 | -|------|------|------|------| -| `list_rules(client, page, size)` | GET | `/engine/hab/agent/rule/list` | `PageData[RuleWithAgents]` | -| `save_rule(client, payload)` | POST | `/engine/hab/agent/rule/save` | `Rule` | -| `update_rule(client, payload)` | POST | `/engine/hab/agent/rule/update` | `Rule` | - ---- - -## 接口格式变更应对 - -快报前端更新后若接口格式改变,Pydantic 会在第一次调用时抛出 `ValidationError`,输出类似: - -``` -pydantic_core._pydantic_core.ValidationError: 1 validation error for AgentDetail -agentRule - Field required [type=missing, ...] -``` - -定位方式:字段名 → `schemas.py` 对应模型 → 对照实际响应 JSON 更新字段定义。 diff --git a/src/ekb_cli/api/__init__.py b/src/ekb_cli/api/__init__.py deleted file mode 100644 index cf515bc..0000000 --- a/src/ekb_cli/api/__init__.py +++ /dev/null @@ -1,110 +0,0 @@ -"""HTTP 客户端:封装对快报 API 的请求,使用 accesstoken + corpid + staffid 认证 - -异常约定: -- HTTP 401 → AuthenticationError -- HTTP 其他非 2xx → ApiResponseError -- 快报业务码非 200 → ApiResponseError -- 未登录(无配置)→ NotLoggedInError -""" - -import httpx -from typing import Any - -from ekb_cli.errors import AuthenticationError, ApiResponseError, NotLoggedInError - -BASE_URL = "https://app.ekuaibao.com" - - -class EkbClient: - def __init__(self, corp_id: str, access_token: str, staff_id: str): - self.corp_id = corp_id - self._client = httpx.Client( - base_url=BASE_URL, - headers={ - "accesstoken": access_token, - "corpid": corp_id, - "staffid": staff_id, - "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36", - "Accept": "application/json", - "Content-Type": "application/json", - "Accept-Language": "zh-CN,zh;q=0.9", - }, - timeout=30, - ) - - def get(self, path: str, **params) -> Any: - params["corpId"] = self.corp_id - try: - resp = self._client.get(f"/api{path}", params=params) - resp.raise_for_status() - except httpx.HTTPStatusError as e: - if e.response.status_code == 401: - raise AuthenticationError() - raise ApiResponseError(e.response.status_code, str(e)) - - data = resp.json() - # 快报 errorCode 结构(未登录等场景) - if isinstance(data, dict) and data.get("errorCode") == 401: - raise AuthenticationError(data.get("errorMessage", "认证失败")) - return data - - def post(self, path: str, body: dict = None, **params) -> Any: - params["corpId"] = self.corp_id - try: - resp = self._client.post(f"/api{path}", json=body or {}, params=params) - resp.raise_for_status() - except httpx.HTTPStatusError as e: - if e.response.status_code == 401: - raise AuthenticationError() - raise ApiResponseError(e.response.status_code, str(e)) - - data = resp.json() - if isinstance(data, dict) and data.get("errorCode") == 401: - raise AuthenticationError(data.get("errorMessage", "认证失败")) - return data - - def __enter__(self): - return self - - def __exit__(self, *args): - self._client.close() - - def close(self): - self._client.close() - - -def get_client() -> EkbClient: - """从当前配置获取已认证的客户端,未登录时抛出 NotLoggedInError""" - from ekb_cli import config - corp = config.get_current_corp() - if not corp: - raise NotLoggedInError() - corp_id = config.get_current_corp_id() - return EkbClient( - corp_id=corp_id, - access_token=corp["access_token"], - staff_id=corp["staff_id"], - ) - - -# ── 统一 re-export:commands / services 只从这里导入 ────────── -from ekb_cli.api.agent import ( # noqa: E402 - check_agent_name, - list_agents, - get_agent, - save_agent, - delete_agent, -) -from ekb_cli.api.rule import ( # noqa: E402 - list_rules, - get_rule_detail, - save_rule, - update_rule, - delete_rule, -) -from ekb_cli.api.platform import ( # noqa: E402 - list_platforms, - list_workflows, - get_workflow_stats, - get_workflow_charge, -) diff --git a/src/ekb_cli/api/agent.py b/src/ekb_cli/api/agent.py deleted file mode 100644 index 084d5ed..0000000 --- a/src/ekb_cli/api/agent.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Agent 相关 API 调用封装""" - -from ekb_cli.api import EkbClient -from ekb_cli.api.schemas import ( - AgentDetail, AgentSummary, EkbResponse, PageData -) - - -def check_agent_name(client: EkbClient, name: str) -> bool: - """检查名称是否可用:True=可用,False=已存在(接口 data=false 表示可用)""" - raw = client.get("/engine/hab/agent/checkName", name=name) - EkbResponse[bool].model_validate(raw) - return not raw.get("data", False) - - -def list_agents(client: EkbClient, page: int = 1, size: int = 1000) -> PageData[AgentSummary]: - raw = client.get("/engine/hab/agent/list", page=page, size=size) - resp = EkbResponse[PageData[AgentSummary]].model_validate(raw) - return resp.data - - -def get_agent(client: EkbClient, agent_id: str) -> AgentDetail: - raw = client.get("/engine/hab/agent/detail", id=agent_id) - resp = EkbResponse[AgentDetail].model_validate(raw) - return resp.data - - -def save_agent(client: EkbClient, payload: dict) -> AgentDetail: - raw = client.post("/engine/hab/agent/save", payload) - resp = EkbResponse[AgentDetail].model_validate(raw) - return resp.data - - -def delete_agent(client: EkbClient, agent_id: str) -> None: - """删除 Agent(state=2)""" - raw = client.get("/engine/hab/agent/active", id=agent_id, state=2) - EkbResponse[AgentDetail].model_validate(raw) diff --git a/src/ekb_cli/api/platform/README.platform.md b/src/ekb_cli/api/platform/README.platform.md deleted file mode 100644 index 1446377..0000000 --- a/src/ekb_cli/api/platform/README.platform.md +++ /dev/null @@ -1,25 +0,0 @@ -# api/platform — 自建应用域传输层 - -## 已实现 - -| 文件 | 说明 | -|---|---| -| `easo_client.py` | EASO 工作流客户端(`unity.ekuaibao.com` + Bearer JWT) | -| `platform_api.py` | 自建应用列表接口 | -| `workflow_api.py` | 工作流列表 / 统计 / 配额接口 | - -## 待实现(预留) - -以下模块接口尚未抓包或开发,待后续按需补充: - -| 模块 | 预估接口 | 说明 | -|---|---|---| -| **业务对象(Entity)** | `POST /api/v2/datalink/entity/platformId/$id` | 获取平台下的实体/数据表列表 | -| **页面设计器** | 待抓包 | 自定义页面配置相关接口 | -| **互联卡片** | 待抓包 | 卡片配置/联动相关接口 | -| **应用变量** | 待抓包 | 全局变量定义相关接口 | -| **应用扩展** | 待抓包 | 扩展能力配置接口 | -| **应用日志** | `GET /api/easo/pipelines/logs`(运行日志) | 与工作流列表同接口,参数不同 | -| **平台凭证(Realm)** | `GET /api/v2/datalink/platform/realm` | appKey / appSecret 查询 | - -新增接口时,在本目录创建对应 `xxx_api.py`,并在 `__init__.py` 补充 re-export。 diff --git a/src/ekb_cli/api/platform/__init__.py b/src/ekb_cli/api/platform/__init__.py deleted file mode 100644 index 62a7799..0000000 --- a/src/ekb_cli/api/platform/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -"""api/platform 子包:自建应用域传输层统一 re-export - -包含两类客户端: -- 快报主站 EkbClient(由父包 api/ 提供)→ 用于 platform_api -- EASO 客户端 EasoClient(本包提供)→ 用于 workflow_api - -commands / services 只从此处导入,内部文件拆分对上层透明。 -""" - -from ekb_cli.api.platform.schemas import ( # noqa: F401 - Platform, - Workflow, - WorkflowTask, - WorkflowPage, - WorkflowStats, - WorkflowCharge, -) -from ekb_cli.api.platform.easo_client import EasoClient, get_easo_client # noqa: F401 -from ekb_cli.api.platform.platform_api import list_platforms # noqa: F401 -from ekb_cli.api.platform.workflow_api import ( # noqa: F401 - list_workflows, - get_workflow_stats, - get_workflow_charge, -) diff --git a/src/ekb_cli/api/platform/easo_client.py b/src/ekb_cli/api/platform/easo_client.py deleted file mode 100644 index e135088..0000000 --- a/src/ekb_cli/api/platform/easo_client.py +++ /dev/null @@ -1,206 +0,0 @@ -"""EASO HTTP 客户端(传输层)。 - -与快报主站的 EkbClient 并列,同属 api/ 传输层。 -区别:EASO 工作流子域使用 Bearer realm token 认证,域名固定为 unity.ekuaibao.com。 - -EASO 完整认证链路(四步,均在 get_easo_client() 内自动完成): - 1. 主站 accessToken - → GET business-center.ekuaibao.com/auth/oauth2/grant/ekb/accessToken - → hose-access-token(长期 JWT,约 30 天) - - 2. 主站 accessToken + corpId/staffId Headers - → GET app.ekuaibao.com/api/engine/realm/$UNITY/actions/jwt - → UNITY Bearer JWT(约 2 小时,aud=UNITY) - - 3. UNITY JWT + hoseaccesstoken Header - → GET unity.ekuaibao.com/api/realms/EASO?corpId=... - → EASO realm accessToken(约 2 小时,短字符串) - - 4. EASO realm accessToken → Authorization: Bearer - → unity.ekuaibao.com 工作流接口(/api/easo/...) - -调用方无需关心上述细节,通过 get_easo_client() 直接获取可用的 EasoClient 实例。 -""" - -from __future__ import annotations -import httpx -from typing import Any - -from ekb_cli.errors import AuthenticationError, ApiResponseError, NotLoggedInError - -EASO_BASE_URL = "https://unity.ekuaibao.com" -_EKB_BASE_URL = "https://app.ekuaibao.com" -_BUSINESS_CENTER_URL = "https://business-center.ekuaibao.com" -_UA = ( - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) " - "AppleWebKit/537.36 (KHTML, like Gecko) " - "Chrome/147.0.0.0 Safari/537.36" -) - - -class EasoClient: - """EASO 工作流客户端(unity.ekuaibao.com),使用 EASO realm token 认证。""" - - def __init__( - self, - corp_id: str, - access_token: str, - easo_token: str, - hose_token: str, - ): - self.corp_id = corp_id - self._client = httpx.Client( - base_url=EASO_BASE_URL, - headers={ - "Authorization": f"Bearer {easo_token}", - "accesstoken": access_token, - "corporationid": corp_id, - "hoseaccesstoken": hose_token, - "Accept": "application/json", - "Content-Type": "application/json", - "User-Agent": _UA, - }, - cookies={"hose-access-token": hose_token}, - timeout=30, - ) - - def _handle_error(self, e: httpx.HTTPStatusError) -> None: - if e.response.status_code == 401: - raise AuthenticationError("EASO token 已过期,请重新登录") - raise ApiResponseError(e.response.status_code, str(e)) - - def get(self, path: str, **params) -> Any: - params["corpId"] = self.corp_id - try: - resp = self._client.get(path, params=params) - resp.raise_for_status() - except httpx.HTTPStatusError as e: - self._handle_error(e) - data = resp.json() - if isinstance(data, dict) and data.get("errorCode") == 401: - raise AuthenticationError(data.get("errorMessage", "认证失败")) - return data - - def __enter__(self): - return self - - def __exit__(self, *args): - self._client.close() - - def close(self): - self._client.close() - - -# ── 内部工具函数 ────────────────────────────────────────────── - -def _fetch_hose_token(access_token: str, corp_id: str) -> str: - """Step 1:用主站 accessToken 换取 hose-access-token(business-center JWT,约 30 天)。""" - resp = httpx.get( - f"{_BUSINESS_CENTER_URL}/auth/oauth2/grant/ekb/accessToken", - params={"corpId": corp_id, "ekbAccessToken": access_token, "environment": "app"}, - timeout=10, - ) - try: - resp.raise_for_status() - except httpx.HTTPStatusError as e: - raise ApiResponseError(e.response.status_code, f"hose-access-token 换取失败: {e}") - data = resp.json() - token = data.get("data", "") - if not token: - raise ApiResponseError(0, f"hose-access-token 换取失败,响应结构异常:{data}") - return token - - -def _fetch_unity_jwt(access_token: str, corp_id: str, staff_id: str) -> str: - """Step 2:换取 UNITY Bearer JWT(aud=UNITY,约 2 小时)。 - - 该 JWT 用于访问 unity.ekuaibao.com 基础接口(如 /api/store/me、/api/realms/EASO)。 - """ - resp = httpx.get( - f"{_EKB_BASE_URL}/api/engine/realm/$UNITY/actions/jwt", - params={"corpId": corp_id}, - headers={ - "accesstoken": access_token, - "corpid": corp_id, - "staffid": staff_id, - "Accept": "application/json", - "Content-Type": "application/json", - "User-Agent": _UA, - }, - timeout=30, - ) - try: - resp.raise_for_status() - except httpx.HTTPStatusError as e: - if e.response.status_code == 401: - raise AuthenticationError() - raise ApiResponseError(e.response.status_code, str(e)) - raw = resp.json() - if isinstance(raw, dict) and raw.get("errorCode") == 401: - raise AuthenticationError(raw.get("errorMessage", "认证已过期,请重新执行 `ekb auth add` 更新 token")) - unity_jwt = raw.get("id") or raw.get("value", "") - if not unity_jwt: - raise ApiResponseError(0, f"UNITY JWT 换取失败,响应结构异常:{raw}") - return unity_jwt - - -def _fetch_easo_realm_token(corp_id: str, unity_jwt: str, hose_token: str) -> str: - """Step 3:用 UNITY JWT 向 unity.ekuaibao.com 换取 EASO realm accessToken(约 2 小时)。 - - 这是实际用于 /api/easo/... 工作流接口的短字符串 Bearer token。 - """ - resp = httpx.get( - f"{EASO_BASE_URL}/api/realms/EASO", - params={"corpId": corp_id}, - headers={ - "Authorization": f"Bearer {unity_jwt}", - "hoseaccesstoken": hose_token, - "Accept": "application/json", - "Content-Type": "application/json", - "User-Agent": _UA, - }, - cookies={"hose-access-token": hose_token}, - timeout=30, - ) - try: - resp.raise_for_status() - except httpx.HTTPStatusError as e: - if e.response.status_code == 401: - raise AuthenticationError() - raise ApiResponseError(e.response.status_code, str(e)) - raw = resp.json() - if isinstance(raw, dict) and raw.get("errorCode") == 401: - raise AuthenticationError(raw.get("errorMessage", "EASO 认证失败")) - easo_token = (raw.get("value") or {}).get("accessToken", "") - if not easo_token: - raise ApiResponseError(0, f"EASO realm token 换取失败,响应结构异常:{raw}") - return easo_token - - -# ── 工厂函数 ───────────────────────────────────────────────── - -def get_easo_client() -> EasoClient: - """从当前配置创建 EasoClient,自动完成四步认证链路。 - - 调用方(services/platform 层)无需关心 hose-access-token、UNITY JWT 或 EASO realm token 细节。 - 未登录时抛出 NotLoggedInError。 - """ - from ekb_cli import config - - corp = config.get_current_corp() - if not corp: - raise NotLoggedInError() - corp_id = config.get_current_corp_id() - access_token = corp["access_token"] - staff_id = corp["staff_id"] - - hose_token = _fetch_hose_token(access_token, corp_id) - unity_jwt = _fetch_unity_jwt(access_token, corp_id, staff_id) - easo_token = _fetch_easo_realm_token(corp_id, unity_jwt, hose_token) - - return EasoClient( - corp_id=corp_id, - access_token=access_token, - easo_token=easo_token, - hose_token=hose_token, - ) diff --git a/src/ekb_cli/api/platform/piper_client.py b/src/ekb_cli/api/platform/piper_client.py deleted file mode 100644 index 4e193d5..0000000 --- a/src/ekb_cli/api/platform/piper_client.py +++ /dev/null @@ -1,156 +0,0 @@ -"""Piper HTTP 客户端(传输层)。 - -工作流配置(节点设计)子域,域名为 piper.ekuaibao.com。 - -认证方式与 unity.ekuaibao.com 不同: - - 使用 EASO JWT(aud=EASO,由 GET /api/engine/realm/$EASO/actions/jwt 换取) - - 需要 platformid Header(指定当前操作的自建应用 ID) - - hose-access-token Cookie - -三步认证链路(均在 get_piper_client() 内自动完成): - 1. accessToken → business-center.ekuaibao.com → hose-access-token - 2. accessToken → app.ekuaibao.com/api/engine/realm/$EASO/actions/jwt → EASO JWT - 3. EASO JWT → Authorization: Bearer → piper.ekuaibao.com 接口 - -调用时需传入 platform_id,因为不同自建应用的工作流接口需要对应的 platformid Header。 -""" - -from __future__ import annotations -import httpx -from typing import Any - -from ekb_cli.errors import AuthenticationError, ApiResponseError, NotLoggedInError - -PIPER_BASE_URL = "https://piper.ekuaibao.com" -_EKB_BASE_URL = "https://app.ekuaibao.com" -_BUSINESS_CENTER_URL = "https://business-center.ekuaibao.com" -_UA = ( - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) " - "AppleWebKit/537.36 (KHTML, like Gecko) " - "Chrome/147.0.0.0 Safari/537.36" -) - - -class PiperClient: - """Piper 工作流配置客户端(piper.ekuaibao.com),使用 EASO JWT 认证。""" - - def __init__(self, platform_id: str, easo_jwt: str, hose_token: str): - self.platform_id = platform_id - self._client = httpx.Client( - base_url=PIPER_BASE_URL, - headers={ - "Authorization": f"Bearer {easo_jwt}", - "platformid": platform_id, - "Accept": "application/json, text/plain, */*", - "User-Agent": _UA, - }, - cookies={"hose-access-token": hose_token}, - timeout=30, - ) - - def _handle_error(self, e: httpx.HTTPStatusError) -> None: - if e.response.status_code == 401: - raise AuthenticationError("Piper token 已过期,请重新登录") - raise ApiResponseError(e.response.status_code, str(e)) - - def get(self, path: str, **params) -> Any: - try: - resp = self._client.get(path, params=params or None) - resp.raise_for_status() - except httpx.HTTPStatusError as e: - self._handle_error(e) - data = resp.json() - if isinstance(data, dict) and data.get("errorCode") == 401: - raise AuthenticationError(data.get("errorMessage", "认证失败")) - return data - - def __enter__(self): - return self - - def __exit__(self, *args): - self._client.close() - - def close(self): - self._client.close() - - -# ── 内部工具函数 ────────────────────────────────────────────── - -def _fetch_hose_token(access_token: str, corp_id: str) -> str: - """Step 1:用主站 accessToken 换取 hose-access-token(约 30 天)。""" - resp = httpx.get( - f"{_BUSINESS_CENTER_URL}/auth/oauth2/grant/ekb/accessToken", - params={"corpId": corp_id, "ekbAccessToken": access_token, "environment": "app"}, - timeout=10, - ) - try: - resp.raise_for_status() - except httpx.HTTPStatusError as e: - raise ApiResponseError(e.response.status_code, f"hose-access-token 换取失败: {e}") - data = resp.json() - token = data.get("data", "") - if not token: - raise ApiResponseError(0, f"hose-access-token 换取失败,响应结构异常:{data}") - return token - - -def _fetch_easo_jwt(access_token: str, corp_id: str, staff_id: str) -> str: - """Step 2:换取 EASO JWT(aud=EASO,约 2 小时)。 - - 用于 piper.ekuaibao.com 的工作流配置接口。 - """ - resp = httpx.get( - f"{_EKB_BASE_URL}/api/engine/realm/$EASO/actions/jwt", - params={"corpId": corp_id}, - headers={ - "accesstoken": access_token, - "corpid": corp_id, - "staffid": staff_id, - "Accept": "application/json", - "Content-Type": "application/json", - "User-Agent": _UA, - }, - timeout=30, - ) - try: - resp.raise_for_status() - except httpx.HTTPStatusError as e: - if e.response.status_code == 401: - raise AuthenticationError() - raise ApiResponseError(e.response.status_code, str(e)) - raw = resp.json() - if isinstance(raw, dict) and raw.get("errorCode") == 401: - raise AuthenticationError(raw.get("errorMessage", "认证已过期,请重新执行 `ekb auth add` 更新 token")) - jwt = raw.get("id") or raw.get("value", "") - if not jwt: - raise ApiResponseError(0, f"EASO JWT 换取失败,响应结构异常:{raw}") - return jwt - - -# ── 工厂函数 ───────────────────────────────────────────────── - -def get_piper_client(platform_id: str) -> PiperClient: - """从当前配置创建 PiperClient,自动完成三步认证链路。 - - Args: - platform_id: 自建应用 ID,用于 platformid Header。 - - 未登录时抛出 NotLoggedInError。 - """ - from ekb_cli import config - - corp = config.get_current_corp() - if not corp: - raise NotLoggedInError() - corp_id = config.get_current_corp_id() - access_token = corp["access_token"] - staff_id = corp["staff_id"] - - hose_token = _fetch_hose_token(access_token, corp_id) - easo_jwt = _fetch_easo_jwt(access_token, corp_id, staff_id) - - return PiperClient( - platform_id=platform_id, - easo_jwt=easo_jwt, - hose_token=hose_token, - ) diff --git a/src/ekb_cli/api/platform/platform_api.py b/src/ekb_cli/api/platform/platform_api.py deleted file mode 100644 index 8a9f096..0000000 --- a/src/ekb_cli/api/platform/platform_api.py +++ /dev/null @@ -1,16 +0,0 @@ -"""自建应用(DataLink Platform)API 调用封装""" - -from typing import List - -from ekb_cli.api import EkbClient -from ekb_cli.api.platform.schemas import Platform - - -def list_platforms(client: EkbClient) -> List[Platform]: - """获取企业下所有启用的自建应用。 - - 对应接口:GET /api/v2/datalink/platform/search?scope=enable - 响应结构:{"items": [...]}(非 EkbResponse 包装) - """ - raw = client.get("/v2/datalink/platform/search", scope="enable") - return [Platform.model_validate(item) for item in raw.get("items", [])] diff --git a/src/ekb_cli/api/platform/schemas.py b/src/ekb_cli/api/platform/schemas.py deleted file mode 100644 index 54be619..0000000 --- a/src/ekb_cli/api/platform/schemas.py +++ /dev/null @@ -1,148 +0,0 @@ -"""api/platform 子域:自建应用与工作流 Pydantic 模型 - -包含两类模型: -- Platform:自建应用(DataLink Platform)摘要 -- Workflow / WorkflowPage / WorkflowStats / WorkflowCharge:工作流(EASO Pipeline)相关模型 - -设计原则: -- extra="allow" 兼容快报可能新增的字段 -- 该文件只存放 platform 子域专属模型;跨子域通用结构(EkbResponse / PageData)保留在父层 schemas.py -""" - -from typing import Any, List, Optional - -from pydantic import BaseModel, ConfigDict - -# 允许字段多于定义(快报可能新增字段),已知字段必须类型正确 -_cfg = ConfigDict(extra="allow") - - -# ── 自建应用(DataLink Platform)───────────────────────────── - -class Platform(BaseModel): - """自建应用(DataLink Platform)摘要 - - 对应快报「应用中心 → 自建应用」列表中的每一条记录。 - 接口:GET /api/v2/datalink/platform/search?scope=enable - 响应结构:{"items": [...]}(非 EkbResponse 包装) - """ - model_config = _cfg - id: str - name: str - nameSpell: str = "" - enName: Optional[str] = None - code: str = "" - corporationId: str - active: bool = True - type: str = "" # 固定为 DATA_LINK - groupType: str = "" # NORMAL / SPECIAL - platformType: str = "" # HAB - source: str = "" # CUSTOM_CREATE - adminIds: List[str] = [] - desc: Optional[str] = None - importMethod: List[str] = [] - createTime: int = 0 - updateTime: int = 0 - icon: Optional[Any] = None - - -# ── 工作流(EASO Pipeline)─────────────────────────────────── - -class WorkflowTask(BaseModel): - """工作流中的单个节点(trigger / action / control)""" - model_config = _cfg - name: str = "" - type: str = "" # clock / ekuaibao-ebot-trigger / http / stop / ... - label: str = "" - desc: Optional[str] = None - groupName: str = "" # trigger / action / control - orderIndex: int = 0 - status: str = "" # success / ... - - -class Workflow(BaseModel): - """工作流摘要(pipelineList 中的单条)""" - model_config = _cfg - id: str - pipelineName: str = "" - state: int = 0 # 0=停用 / 1=启用 - runningCount: int = 0 - errorCount: int = 0 - updateTime: str = "" - updateUser: Optional[str] = None - tasks: List[Any] = [] # 节点结构复杂,先用 Any 承接 - desc: Optional[str] = None - customDesc: Optional[str] = None - - -class WorkflowPage(BaseModel): - """工作流分页响应(EkbResponse.data)""" - model_config = _cfg - pipelineNum: int = 0 # 该应用下工作流总数 - runningNum: int = 0 - allRunCount: int = 0 - errorCount: int = 0 - number: int = 1 - size: int = 20 - totalPages: int = 0 - totalItems: int = 0 - pipelineList: List[Workflow] = [] - - -class WorkflowStats(BaseModel): - """工作流执行统计""" - model_config = _cfg - total: int = 0 - completed: int = 0 - failed: int = 0 - started: int = 0 - pipelineOpenCount: int = 0 - pipelineCloseCount: int = 0 - pipelineAllCount: int = 0 - - -class WorkflowAlarm(BaseModel): - """工作流告警配置""" - model_config = _cfg - alarmUser: List[Any] = [] - alarmType: List[str] = [] - active: bool = True - alarmScope: str = "" - - -class WorkflowDetail(BaseModel): - """工作流完整配置(piper.ekuaibao.com/api/easo/pipelines/{id}) - - 包含所有节点的完整配置,节点类型各异(trigger / action / control), - 通用字段由 WorkflowTask 描述,各节点特有字段通过 extra="allow" 兜住。 - """ - model_config = _cfg - id: str - label: str = "" # 工作流名称 - desc: Optional[str] = None - customDesc: Optional[str] = None - state: int = 0 # 0=停用 / 1=启用 - debugState: int = 0 - runTimes: int = 0 - errorTimes: int = 0 - updateTime: str = "" - updateUser: Optional[str] = None - staffName: Optional[str] = None - version: str = "" - dataLimit: int = 20 - source: int = 0 - queueJobs: bool = False - tasksVersion: int = 0 - tasks: List[WorkflowTask] = [] - alarm: Optional[WorkflowAlarm] = None - - -class WorkflowCharge(BaseModel): - """企业工作流资源包/配额""" - model_config = _cfg - corporationId: str = "" - status: str = "" # ACTIVED / ... - orderType: str = "" - total: int = 0 - used: int = 0 - remaining: int = 0 diff --git a/src/ekb_cli/api/platform/workflow_api.py b/src/ekb_cli/api/platform/workflow_api.py deleted file mode 100644 index fa5a6ee..0000000 --- a/src/ekb_cli/api/platform/workflow_api.py +++ /dev/null @@ -1,66 +0,0 @@ -"""工作流(EASO Pipeline)API 调用封装 - -两个域名: - - unity.ekuaibao.com(EasoClient):工作流列表 / 统计 / 配额 - - piper.ekuaibao.com(PiperClient):工作流详情(节点配置) - -认证方式见各 client 模块。 -响应:标准 EkbResponse 包装(code / msg / data) -""" - -from ekb_cli.api.platform.easo_client import EasoClient -from ekb_cli.api.platform.piper_client import PiperClient -from ekb_cli.api.schemas import EkbResponse -from ekb_cli.api.platform.schemas import WorkflowPage, WorkflowStats, WorkflowCharge, WorkflowDetail - - -def list_workflows( - client: EasoClient, - platform_id: str, - page: int = 1, - page_size: int = 20, -) -> WorkflowPage: - """分页获取指定自建应用下的工作流列表。 - - 对应接口:GET /api/easo/pipelines/logs - 参数:platformId / number(页码)/ pageSize - """ - raw = client.get( - "/api/easo/pipelines/logs", - platformId=platform_id, - number=page, - pageSize=page_size, - ) - resp = EkbResponse[WorkflowPage].model_validate(raw) - return resp.data - - -def get_workflow_stats(client: EasoClient, platform_id: str) -> WorkflowStats: - """获取指定自建应用的工作流执行统计(总数/成功/失败等)。 - - 对应接口:GET /api/easo/stats - """ - raw = client.get("/api/easo/stats", platformId=platform_id) - resp = EkbResponse[WorkflowStats].model_validate(raw) - return resp.data - - -def get_workflow_charge(client: EasoClient) -> WorkflowCharge: - """获取企业工作流资源包/配额信息。 - - 对应接口:GET /api/easo/charge - """ - raw = client.get("/api/easo/charge") - resp = EkbResponse[WorkflowCharge].model_validate(raw) - return resp.data - - -def get_workflow(client: PiperClient, pipeline_id: str) -> WorkflowDetail: - """获取指定工作流的完整配置(节点列表及各节点参数)。 - - 对应接口:GET piper.ekuaibao.com/api/easo/pipelines/{pipeline_id} - 认证:EASO JWT + platformid Header(由 PiperClient 持有) - """ - raw = client.get(f"/api/easo/pipelines/{pipeline_id}") - resp = EkbResponse[WorkflowDetail].model_validate(raw) - return resp.data diff --git a/src/ekb_cli/api/rule.py b/src/ekb_cli/api/rule.py deleted file mode 100644 index 7cd491d..0000000 --- a/src/ekb_cli/api/rule.py +++ /dev/null @@ -1,40 +0,0 @@ -"""Rule(审核规则)相关 API 调用封装""" - -from ekb_cli.api import EkbClient -from ekb_cli.api.schemas import ( - EkbResponse, PageData, Rule, RuleWithAgents -) - - -def list_rules(client: EkbClient, page: int = 1, size: int = 1000) -> PageData[RuleWithAgents]: - raw = client.get("/engine/hab/agent/rule/list", page=page, size=size) - resp = EkbResponse[PageData[RuleWithAgents]].model_validate(raw) - return resp.data - - -def get_rule_detail(client: EkbClient, rule_id: str) -> Rule: - """获取单条规则详情(比 list 多 staffId/staffName 字段)。 - 已逆向确认端点:GET /api/engine/hab/agent/rule/detail?id= - """ - raw = client.get("/engine/hab/agent/rule/detail", id=rule_id) - resp = EkbResponse[Rule].model_validate(raw) - return resp.data - - -def save_rule(client: EkbClient, payload: dict) -> Rule: - """新建规则:payload 包含 purpose / description / level""" - raw = client.post("/engine/hab/agent/rule/save", payload) - resp = EkbResponse[Rule].model_validate(raw) - return resp.data - - -def update_rule(client: EkbClient, payload: dict) -> Rule: - """更新规则:payload 包含 id / code / purpose / description / level""" - raw = client.post("/engine/hab/agent/rule/update", payload) - resp = EkbResponse[Rule].model_validate(raw) - return resp.data - - -def delete_rule(client: EkbClient, rule_id: str) -> None: - """删除规则。已逆向确认端点:POST /api/engine/hab/agent/rule/delete""" - client.post("/engine/hab/agent/rule/delete", {"id": rule_id}) diff --git a/src/ekb_cli/api/schemas.py b/src/ekb_cli/api/schemas.py deleted file mode 100644 index 52eaed4..0000000 --- a/src/ekb_cli/api/schemas.py +++ /dev/null @@ -1,185 +0,0 @@ -"""Pydantic 响应模型:快报 API 结构校验 + ekb-cli Server 请求/响应模型 - -分为两部分: -1. 快报 API 响应模型(EkbResponse / PageData / Rule / Agent 系列) -2. ekb-cli HTTP Server 的请求/响应模型(*Request / *Response / ApiResult) - -约定: -- 子域专属模型放在各自的 api//schemas.py(如 api/platform/schemas.py) -- 本文件只保留跨子域通用模型和 Server 请求/响应模型 -""" - -from typing import Any, Generic, List, Optional, TypeVar -from pydantic import BaseModel, ConfigDict - -# 允许字段多于定义(快报可能新增字段),已知字段必须类型正确 -_cfg = ConfigDict(extra="allow") - -T = TypeVar("T") - - -# ── 快报 API:通用分页响应 ───────────────────────────────────── - -class PageData(BaseModel, Generic[T]): - model_config = _cfg - number: int - size: int - totalPages: int - totalItems: int - items: List[T] - - -class EkbResponse(BaseModel, Generic[T]): - model_config = _cfg - code: int - msg: str = "" - data: Optional[T] = None - - -# ── 快报 API:Rule(审核规则)──────────────────────────────── - -class RuleAgentRef(BaseModel): - """规则列表中关联的 Agent 摘要(仅 id/name/icon)""" - model_config = _cfg - id: str - name: str - icon: str = "" - - -class Rule(BaseModel): - model_config = _cfg - id: str - corporationId: str - code: str - version: int - purpose: str - description: str - level: str - createTime: str - updateTime: str - active: bool - staffId: str = "" - staffName: str = "" - - -class RuleWithAgents(Rule): - """规则列表响应中的规则(含关联 Agent 列表)""" - agents: List[RuleAgentRef] = [] - freeflows: List[Any] = [] - - -# ── 快报 API:Agent(智能审核 Agent)───────────────────────── - -class AgentRuleRef(Rule): - """Agent 详情中内嵌的规则(完整规则字段,无 agents 字段)""" - pass - - -class AgentSummary(BaseModel): - """Agent 列表中的摘要(无 agentRule 字段)""" - model_config = _cfg - id: str - corporationId: str - version: int - name: str - description: str = "" - icon: str = "" - mode: int - samplingRate: int = 0 - agreeTerms: Optional[str] = None - rejectTerms: Optional[str] = None - exemptTerms: Optional[str] = None - reviewTerms: Optional[str] = None - createTime: str - updateTime: str - state: int - agentFlowRelations: List[Any] = [] - - -class AgentDetail(AgentSummary): - """Agent 详情(含关联规则列表)""" - agentRule: List[AgentRuleRef] = [] - enrichedContext: Optional[Any] = None - - -# ══════════════════════════════════════════════════════════════ -# ekb-cli HTTP Server 请求/响应模型 -# 这些模型用于 FastAPI 路由的请求体(*Request)和响应体(*Response) -# 与快报 API 的模型分开维护,避免耦合 -# ══════════════════════════════════════════════════════════════ - -DEFAULT_AGENT_ICON = "https://statics.ekuaibao.com/eui/eui-static/male5.png" - - -class ApiResult(BaseModel, Generic[T]): - """ekb-cli Server 统一响应包装 - - 成功时:{"success": true, "data": {...}} - 失败时:{"success": false, "error": "...", "code": 404} - """ - success: bool = True - data: Optional[T] = None - error: Optional[str] = None - code: int = 0 - - -# ── Server:Auth 请求/响应 ────────────────────────────────── - -class CorpAddRequest(BaseModel): - """添加企业认证的请求体""" - corp_id: str - name: str - access_token: str - staff_id: str - - -class CorpInfoResponse(BaseModel): - """企业信息响应(不含敏感 token)""" - corp_id: str - name: str - is_current: bool - - -# ── Server:Agent 请求 ────────────────────────────────────── - -class AgentCreateRequest(BaseModel): - """新建 Agent 的请求体""" - name: str - description: str = "" - mode: str = "assist" # auto / semi / assist - sampling_rate: int = 0 - agree_terms: str = "" - reject_terms: str = "" - exempt_terms: str = "" - review_terms: str = "" - rule_ids: List[str] = [] - icon: str = DEFAULT_AGENT_ICON - - -class AgentUpdateRequest(BaseModel): - """更新 Agent 的请求体(所有字段可选,只传需要改的)""" - name: Optional[str] = None - description: Optional[str] = None - mode: Optional[str] = None # auto / semi / assist - sampling_rate: Optional[int] = None - state: Optional[int] = None - agree_terms: Optional[str] = None - reject_terms: Optional[str] = None - exempt_terms: Optional[str] = None - review_terms: Optional[str] = None - - -# ── Server:Rule 请求 ─────────────────────────────────────── - -class RuleCreateRequest(BaseModel): - """新建规则的请求体""" - purpose: str - description: str - level: str = "严重" - - -class RuleUpdateRequest(BaseModel): - """更新规则的请求体(所有字段可选)""" - purpose: Optional[str] = None - description: Optional[str] = None - level: Optional[str] = None diff --git a/src/ekb_cli/api/sealai/README.sealai.md b/src/ekb_cli/api/sealai/README.sealai.md deleted file mode 100644 index e84a8f1..0000000 --- a/src/ekb_cli/api/sealai/README.sealai.md +++ /dev/null @@ -1,48 +0,0 @@ -# api/sealai/ — SealAI 传输层 - -## 职责边界 - -- **薄层封装**:只做 HTTP 请求发送和 Pydantic 响应解析,不做业务判断。 -- **不被上层直接调用**:仅供 `services/sealai/` 调用,commands 和 server 不得直接引用本层业务函数。 - -## 模块说明 - -| 模块 | 封装的 API | -|---|---| -| `client.py` | `SealAiClient`:Bearer JWT 认证的 httpx 客户端 | -| `schemas.py` | 所有 Pydantic 模型(响应模型 + Server 请求模型) | -| `auth_api.py` | `GET /api/v1/auth/me` → `get_me()` | -| `billing_api.py` | `GET /api/v1/billing/status` → `get_billing_status()` | -| `rules_api.py` | `/api/v1/rules` 系列(草稿 CRUD + 版本发布) | -| `preference_api.py` | `GET/POST /api/v1/agent/ai-approval/config` | -| `knowledge_api.py` | `/api/v1/knowledge/articles` 系列 | - -## SealAiClient - -```python -class SealAiClient: - base_url: str # https://{corp_id.lower()}.sealai.cc - bearer_token: str -``` - -所有 API 函数签名:`fn(client: SealAiClient, ...) -> ResponseModel` - -## schemas.py 结构 - -``` -schemas.py -├── 通用包装:SealAiResponse[T] -├── 认证:SealAiUser / SealAiTenant / MeData -├── 计费:Subscription / Feature / BillingStatusData -├── 审核规则草稿:DraftRule / DraftRulesData -├── 已发布版本:RuleSetVersion / PublishVersionData -├── 风格偏好:DecisionPreferences / AiApprovalConfig / AiApprovalSaveResult -├── 知识文档:KnowledgeArticle / KnowledgeArticleListData -└── Server 请求模型:RuleCreateRequest / RuleUpdateRequest / - PublishVersionRequest / DecisionPreferencesUpdateRequest / - ArticleCreateRequest / ArticleUpdateRequest -``` - -## 已知 API 路径 - -详见 `services/sealai/README.sealai.md` 及各 `*_api.py` 文件顶部 docstring。 diff --git a/src/ekb_cli/api/sealai/__init__.py b/src/ekb_cli/api/sealai/__init__.py deleted file mode 100644 index fef882b..0000000 --- a/src/ekb_cli/api/sealai/__init__.py +++ /dev/null @@ -1,45 +0,0 @@ -"""SealAI 传输层统一 re-export。 - -使用方(services/sealai/)只从这里导入,内部文件如何拆分对上层透明。 -""" - -from ekb_cli.api.sealai.client import SealAiClient -from ekb_cli.api.sealai.auth_api import get_me -from ekb_cli.api.sealai.billing_api import get_billing_status -from ekb_cli.api.sealai.rules_api import ( - list_rules, - create_rule, - update_rule, - delete_rule, - list_rule_set_versions, - publish_rule_set_version, -) -from ekb_cli.api.sealai.preference_api import ( - get_ai_approval_config, - save_ai_approval_config, -) -from ekb_cli.api.sealai.knowledge_api import ( - list_articles, - get_article, - create_article, - patch_article, -) - -__all__ = [ - "SealAiClient", - "get_me", - "get_billing_status", - "list_rules", - "create_rule", - "update_rule", - "delete_rule", - "list_rule_set_versions", - "publish_rule_set_version", - "get_ai_approval_config", - "save_ai_approval_config", - "list_articles", - "get_article", - "create_article", - "patch_article", -] - diff --git a/src/ekb_cli/api/sealai/auth_api.py b/src/ekb_cli/api/sealai/auth_api.py deleted file mode 100644 index 23a169a..0000000 --- a/src/ekb_cli/api/sealai/auth_api.py +++ /dev/null @@ -1,14 +0,0 @@ -"""SealAI 认证相关 API 封装(传输层)。 - -已逆向确认端点: - GET /api/v1/auth/me 当前用户及租户信息 -""" - -from ekb_cli.api.sealai.client import SealAiClient -from ekb_cli.api.sealai.schemas import MeData, SealAiResponse - - -def get_me(client: SealAiClient) -> MeData: - """获取当前登录用户及租户信息。""" - raw = client.get("/api/v1/auth/me") - return SealAiResponse[MeData].model_validate(raw).data diff --git a/src/ekb_cli/api/sealai/billing_api.py b/src/ekb_cli/api/sealai/billing_api.py deleted file mode 100644 index 7374bfe..0000000 --- a/src/ekb_cli/api/sealai/billing_api.py +++ /dev/null @@ -1,14 +0,0 @@ -"""SealAI 计费 / 订阅相关 API 封装(传输层)。 - -已逆向确认端点: - GET /api/v1/billing/status 订阅状态 + 功能配额列表 -""" - -from ekb_cli.api.sealai.client import SealAiClient -from ekb_cli.api.sealai.schemas import BillingStatusData, SealAiResponse - - -def get_billing_status(client: SealAiClient) -> BillingStatusData: - """获取订阅状态及各功能配额使用情况。""" - raw = client.get("/api/v1/billing/status") - return SealAiResponse[BillingStatusData].model_validate(raw).data diff --git a/src/ekb_cli/api/sealai/client.py b/src/ekb_cli/api/sealai/client.py deleted file mode 100644 index 9dfcff2..0000000 --- a/src/ekb_cli/api/sealai/client.py +++ /dev/null @@ -1,90 +0,0 @@ -"""SealAI HTTP 客户端(传输层)。 - -与快报主站的 EkbClient 并列,同属 api/ 传输层。 -区别:SealAI 用 Bearer JWT 认证,域名按企业 corpId 动态生成。 - -使用方:services/sealai/auth_service 通过 _get_or_create_client() 获取实例, -并由 _sealai_call 统一管理生命周期,外部不直接持有或关闭此对象。 -""" - -from __future__ import annotations -import httpx -from typing import Any - -from ekb_cli.errors import AuthenticationError, ApiResponseError - - -class SealAiClient: - """SealAI REST 客户端,所有请求携带 Authorization: Bearer {token}。""" - - def __init__(self, corp_id: str, bearer_token: str): - self.corp_id = corp_id - self._base_url = f"https://{corp_id.lower()}.sealai.cc" - self._client = httpx.Client( - base_url=self._base_url, - headers={ - "Authorization": f"Bearer {bearer_token}", - "Accept": "application/json", - "Content-Type": "application/json", - "User-Agent": ( - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) " - "AppleWebKit/537.36 (KHTML, like Gecko) " - "Chrome/146.0.0.0 Safari/537.36" - ), - }, - timeout=30, - ) - - def _handle_error(self, e: httpx.HTTPStatusError) -> None: - if e.response.status_code == 401: - raise AuthenticationError("SealAI token 已过期,请重新登录") - raise ApiResponseError(e.response.status_code, str(e)) - - def get(self, path: str, params: dict | None = None, **kwargs) -> Any: - try: - merged = {**(params or {}), **kwargs} or None - resp = self._client.get(path, params=merged) - resp.raise_for_status() - except httpx.HTTPStatusError as e: - self._handle_error(e) - return resp.json() - - def post(self, path: str, body: dict | None = None, **params) -> Any: - try: - resp = self._client.post(path, json=body or {}, params=params or None) - resp.raise_for_status() - except httpx.HTTPStatusError as e: - self._handle_error(e) - return resp.json() - - def put(self, path: str, body: dict | None = None) -> Any: - try: - resp = self._client.put(path, json=body or {}) - resp.raise_for_status() - except httpx.HTTPStatusError as e: - self._handle_error(e) - return resp.json() - - def patch(self, path: str, body: dict | None = None) -> Any: - try: - resp = self._client.patch(path, json=body or {}) - resp.raise_for_status() - except httpx.HTTPStatusError as e: - self._handle_error(e) - return resp.json() - - def delete(self, path: str) -> None: - try: - resp = self._client.delete(path) - resp.raise_for_status() - except httpx.HTTPStatusError as e: - self._handle_error(e) - - def __enter__(self): - return self - - def __exit__(self, *args): - self._client.close() - - def close(self): - self._client.close() diff --git a/src/ekb_cli/api/sealai/knowledge_api.py b/src/ekb_cli/api/sealai/knowledge_api.py deleted file mode 100644 index f6af399..0000000 --- a/src/ekb_cli/api/sealai/knowledge_api.py +++ /dev/null @@ -1,132 +0,0 @@ -"""SealAI 知识文档 API 封装(传输层)。 - -已逆向确认端点: - GET /api/v1/knowledge/articles 文档列表(场景过滤 + 分页 + 排序) - POST /api/v1/knowledge/articles 新建文档 - GET /api/v1/knowledge/articles/{id} 文档详情 - PATCH /api/v1/knowledge/articles/{id} 更新文档(请求体为 {attributes: {...}}) - -注意:PATCH 请求体有特殊包装:{"attributes": {改动字段}},与 POST 直接传字段不同。 -""" - -from typing import Optional -from ekb_cli.api.sealai.client import SealAiClient -from ekb_cli.api.sealai.schemas import ( - SealAiResponse, - KnowledgeArticle, - KnowledgeArticleListData, -) - - -def list_articles( - client: SealAiClient, - *, - scenarios: Optional[list[str]] = None, - offset: int = 0, - limit: int = 20, - sort_by: str = "createdAt", - sort_order: str = "desc", -) -> KnowledgeArticleListData: - """获取知识文档列表。 - - Args: - scenarios: 场景过滤,如 ["audit"]、["fill"],None 表示不过滤 - offset: 分页偏移量(默认 0) - limit: 每页数量(默认 20) - sort_by: 排序字段(默认 createdAt) - sort_order: 排序方向,"asc" | "desc"(默认 desc) - """ - # 构造 filter[scenarios][N]=xxx 风格的 query 参数 - params: dict = { - "offset": offset, - "limit": limit, - "sortBy": sort_by, - "sortOrder": sort_order, - } - if scenarios: - for i, s in enumerate(scenarios): - params[f"filter[scenarios][{i}]"] = s - - raw = client.get("/api/v1/knowledge/articles", params=params) - return SealAiResponse[KnowledgeArticleListData].model_validate(raw).data - - -def get_article(client: SealAiClient, article_id: str) -> KnowledgeArticle: - """获取单篇知识文档详情。""" - raw = client.get(f"/api/v1/knowledge/articles/{article_id}") - return SealAiResponse[KnowledgeArticle].model_validate(raw).data - - -def create_article( - client: SealAiClient, - *, - title: str, - purpose: str, - content: str, - content_type: str = "policy", - status: str = "published", - scenarios: Optional[list[str]] = None, - tags: Optional[list[str]] = None, -) -> KnowledgeArticle: - """新建知识文档。 - - Args: - title: 文档标题 - purpose: 适用说明 - content: 正文内容(Markdown 格式) - content_type: 内容类型,默认 "policy" - status: "published" | "draft",默认 "published" - scenarios: 适用场景列表,如 ["audit", "fill"] - tags: 标签列表,"__all__" 表示全适用 - """ - body = { - "title": title, - "purpose": purpose, - "contentType": content_type, - "content": content, - "status": status, - "scenarios": scenarios or [], - "tags": tags or [], - } - raw = client.post("/api/v1/knowledge/articles", body) - return SealAiResponse[KnowledgeArticle].model_validate(raw).data - - -def patch_article( - client: SealAiClient, - article_id: str, - *, - title: Optional[str] = None, - purpose: Optional[str] = None, - content: Optional[str] = None, - content_type: Optional[str] = None, - status: Optional[str] = None, - enabled: Optional[bool] = None, - scenarios: Optional[list[str]] = None, - tags: Optional[list[str]] = None, -) -> KnowledgeArticle: - """更新知识文档(Patch 式,只传改动字段)。 - - 注意:PATCH 请求体格式为 {"attributes": {改动字段}}, - 与 POST 的直传字段格式不同,这里已在传输层做好封装。 - """ - attributes: dict = {} - if title is not None: - attributes["title"] = title - if purpose is not None: - attributes["purpose"] = purpose - if content is not None: - attributes["content"] = content - if content_type is not None: - attributes["contentType"] = content_type - if status is not None: - attributes["status"] = status - if enabled is not None: - attributes["enabled"] = enabled - if scenarios is not None: - attributes["scenarios"] = scenarios - if tags is not None: - attributes["tags"] = tags - - raw = client.patch(f"/api/v1/knowledge/articles/{article_id}", {"attributes": attributes}) - return SealAiResponse[KnowledgeArticle].model_validate(raw).data diff --git a/src/ekb_cli/api/sealai/preference_api.py b/src/ekb_cli/api/sealai/preference_api.py deleted file mode 100644 index b8cb250..0000000 --- a/src/ekb_cli/api/sealai/preference_api.py +++ /dev/null @@ -1,41 +0,0 @@ -"""SealAI 风格偏好 API 封装(传输层)。 - -已逆向确认端点: - GET /api/v1/agent/ai-approval/config 获取 AI 审批配置(决策偏好 + 集成信息) - POST /api/v1/agent/ai-approval/config 保存 AI 审批配置(整体替换) - -注意:POST 是整体替换语义,需将完整配置对象回传, - 调用方(services 层)负责先 GET 再 merge,再 POST。 -""" - -from ekb_cli.api.sealai.client import SealAiClient -from ekb_cli.api.sealai.schemas import ( - SealAiResponse, - AiApprovalConfig, - AiApprovalSaveResult, -) - - -def get_ai_approval_config(client: SealAiClient) -> AiApprovalConfig: - """获取 AI 审批配置(风格偏好 + 集成系统信息)。""" - raw = client.get("/api/v1/agent/ai-approval/config") - return SealAiResponse[AiApprovalConfig].model_validate(raw).data - - -def save_ai_approval_config( - client: SealAiClient, - config: AiApprovalConfig, -) -> AiApprovalSaveResult: - """保存 AI 审批配置(整体替换)。 - - Args: - config: 完整的配置对象,需包含 decisionPreferences、 - integrationSystem、integrations 等所有字段。 - Returns: - AiApprovalSaveResult,含 success 标志。 - """ - raw = client.post( - "/api/v1/agent/ai-approval/config", - config.model_dump(exclude_none=False), - ) - return SealAiResponse[AiApprovalSaveResult].model_validate(raw).data diff --git a/src/ekb_cli/api/sealai/rules_api.py b/src/ekb_cli/api/sealai/rules_api.py deleted file mode 100644 index f1e8ae7..0000000 --- a/src/ekb_cli/api/sealai/rules_api.py +++ /dev/null @@ -1,90 +0,0 @@ -"""SealAI 审核规则 API 封装(传输层)。 - -已逆向确认端点: - GET /api/v1/rules 草稿规则列表 - POST /api/v1/rules 新建草稿规则 - PUT /api/v1/rules/{id} 更新草稿规则(partial,只传改动字段) - DELETE /api/v1/rules/{id} 删除草稿规则 - GET /api/v1/rule-set-versions 已发布版本历史列表 - POST /api/v1/rule-set-versions/publish 发布当前草稿为新版本 -""" - -from ekb_cli.api.sealai.client import SealAiClient -from ekb_cli.api.sealai.schemas import ( - SealAiResponse, - DraftRule, - DraftRulesData, - RuleSetVersion, - PublishVersionData, -) - - -def list_rules(client: SealAiClient) -> DraftRulesData: - """获取草稿区所有审核规则。""" - raw = client.get("/api/v1/rules") - return SealAiResponse[DraftRulesData].model_validate(raw).data - - -def create_rule( - client: SealAiClient, - description: str, - scope: str, - strictness: str, -) -> DraftRule: - """新建草稿审核规则。 - - Args: - description: 规则描述 - scope: 适用场景(费用类型等自由文本) - strictness: MUST_FOLLOW | SHOULD_FOLLOW | SUGGESTION - """ - raw = client.post("/api/v1/rules", { - "description": description, - "scope": scope, - "strictness": strictness, - }) - return SealAiResponse[DraftRule].model_validate(raw).data - - -def update_rule( - client: SealAiClient, - rule_id: str, - *, - description: str | None = None, - scope: str | None = None, - strictness: str | None = None, -) -> DraftRule: - """更新草稿规则(partial,只传改动字段)。""" - body = {} - if description is not None: - body["description"] = description - if scope is not None: - body["scope"] = scope - if strictness is not None: - body["strictness"] = strictness - raw = client.put(f"/api/v1/rules/{rule_id}", body) - return SealAiResponse[DraftRule].model_validate(raw).data - - -def delete_rule(client: SealAiClient, rule_id: str) -> None: - """删除草稿规则。""" - client.delete(f"/api/v1/rules/{rule_id}") - - -def list_rule_set_versions(client: SealAiClient) -> list[RuleSetVersion]: - """获取已发布的规则集版本历史(倒序,最新在前)。""" - raw = client.get("/api/v1/rule-set-versions") - return SealAiResponse[list[RuleSetVersion]].model_validate(raw).data - - -def publish_rule_set_version( - client: SealAiClient, - version_name: str, -) -> PublishVersionData: - """将当前草稿区规则发布为新版本。 - - Args: - version_name: 版本名称(如 "审核规则 版本5") - """ - raw = client.post("/api/v1/rule-set-versions/publish", {"versionName": version_name}) - return SealAiResponse[PublishVersionData].model_validate(raw).data diff --git a/src/ekb_cli/api/sealai/schemas.py b/src/ekb_cli/api/sealai/schemas.py deleted file mode 100644 index f7f3d33..0000000 --- a/src/ekb_cli/api/sealai/schemas.py +++ /dev/null @@ -1,351 +0,0 @@ -"""SealAI 平台的 Pydantic 响应模型。 - -SealAI({corpId}.sealai.cc)是独立于快报主站的 Next.js 平台, -认证使用 Bearer JWT,数据结构与快报 HAB 模块完全独立。 -""" - -from __future__ import annotations -from typing import Generic, Optional, TypeVar -from pydantic import BaseModel - -T = TypeVar("T") - - -# ── 通用包装 ────────────────────────────────────────────────────────────────── - -class SealAiResponse(BaseModel, Generic[T]): - """SealAI API 统一响应包装:{ data: T }""" - data: T - - class Config: - extra = "allow" - - -# ── 认证 ────────────────────────────────────────────────────────────────────── - -class HosecloudStaff(BaseModel): - staffId: str - name: str - code: str = "" - bindTime: int - - class Config: - extra = "allow" - - -class SealAiUser(BaseModel): - id: str - tenantId: str - name: str - isAdmin: bool - permissions: list[str] - providerUserId: str # 对应快报 staffId - hosecloudStaff: Optional[HosecloudStaff] = None - - class Config: - extra = "allow" - - -class HoseCorpConfig(BaseModel): - apiKey: str - corporationId: str - corporationName: str - - class Config: - extra = "allow" - - -class SealAiTenant(BaseModel): - id: str - name: str - tenantSlug: str # corpId 小写 - isDemo: bool - logoUrl: Optional[str] = None - hoseCorpConfig: HoseCorpConfig - - class Config: - extra = "allow" - - -class MeData(BaseModel): - user: SealAiUser - tenant: SealAiTenant - - class Config: - extra = "allow" - - -# ── 计费 ────────────────────────────────────────────────────────────────────── - -class Subscription(BaseModel): - id: str - tenantId: str - planId: str - status: str # "active" | "expired" - startDate: str - createdAt: str - updatedAt: str - - class Config: - extra = "allow" - - -class Feature(BaseModel): - """订阅功能项,三种形态:开关型 / 配额型 / 余额型""" - code: str - name: str - # 开关型 - enabled: Optional[bool] = None - # 配额型 - quota: Optional[int] = None - used: Optional[int] = None - remaining: Optional[int] = None - # 余额型 - balance: Optional[int] = None - totalQuota: Optional[int] = None - totalUsed: Optional[int] = None - nextResetDate: Optional[str] = None - - class Config: - extra = "allow" - - -class BillingStatusData(BaseModel): - subscriptions: list[Subscription] - features: list[Feature] - - class Config: - extra = "allow" - - def get_feature(self, code: str) -> Optional[Feature]: - for f in self.features: - if f.code == code: - return f - return None - - -# ── 审核规则草稿 ────────────────────────────────────────────────────────────── - -class DraftRule(BaseModel): - """草稿区单条审核规则。""" - id: str - tenantId: str - description: str # 规则描述 - scope: str # 适用场景(费用类型等) - strictness: str # MUST_FOLLOW / SHOULD_FOLLOW / SUGGESTION - status: str # DRAFT - createdAt: int - updatedAt: int - - class Config: - extra = "allow" - - -class DraftRulesData(BaseModel): - """GET /api/v1/rules 响应体 data 字段。""" - rules: list[DraftRule] - hasPendingDeletes: bool = False - - class Config: - extra = "allow" - - -# ── 已发布版本 ──────────────────────────────────────────────────────────────── - -class PublishedRuleSnapshot(BaseModel): - """版本快照内单条规则(无 id,不可变)。""" - description: str - scope: str - strictness: str - - class Config: - extra = "allow" - - -class RuleSetVersion(BaseModel): - """已发布的规则集版本快照。""" - id: str - tenantId: str - versionNumber: int - versionName: str - publishedBy: str - publishedByName: str - rules: list[PublishedRuleSnapshot] - publishedAt: int - createdAt: int - - class Config: - extra = "allow" - - -class PublishVersionData(BaseModel): - """POST /api/v1/rule-set-versions/publish 响应体 data 字段。""" - version: RuleSetVersion - rulesCount: int - - class Config: - extra = "allow" - - -# ── 风格偏好(AI 审批配置) ─────────────────────────────────────────────────── - -class DecisionPreferences(BaseModel): - """AI 审批四类决策场景的提示词配置。 - - Attributes: - explicitApprove: 明确通过的条件描述 - explicitReject: 明确拒绝的条件描述 - exemptApprove: 豁免通过的条件描述 - review: 转人工判断的条件描述 - """ - explicitApprove: str - explicitReject: str - exemptApprove: str - review: str - - class Config: - extra = "allow" - - -class AiApprovalIntegration(BaseModel): - """单个集成系统配置(快报 / 飞书 / 钉钉等)。""" - type: str # "hosecloud" 等 - mode: Optional[str] = None # "fully_automatic" | "semi_automatic" - autoApprovalRate: Optional[int] = None - - class Config: - extra = "allow" - - -class AiApprovalConfig(BaseModel): - """GET/POST /api/v1/agent/ai-approval/config 响应体 data 字段。 - - 风格偏好页面的完整配置,包含决策偏好和集成系统信息。 - 写入时需原样回传整个对象(整体替换语义)。 - """ - decisionPreferences: DecisionPreferences - integrationSystem: Optional[str] = None # "feishu" | "dingtalk" 等 - integrations: Optional[list[AiApprovalIntegration]] = None - - class Config: - extra = "allow" - - -class AiApprovalSaveResult(BaseModel): - """POST /api/v1/agent/ai-approval/config 响应体 data 字段。""" - success: bool - - class Config: - extra = "allow" - - -# ── 知识文档 ────────────────────────────────────────────────────────────────── - -class KnowledgeArticle(BaseModel): - """知识文档条目(新建/详情/列表元素)。 - - Attributes: - id: 文档唯一 ID - tenantId: 租户 ID - title: 文档标题 - purpose: 适用说明(适用场景文字描述) - contentType: 内容类型,如 "policy" - content: 正文内容(Markdown 格式) - status: "published" | "draft" - enabled: 是否启用 - scenarios: 适用场景列表,如 ["audit", "fill"] - tags: 标签列表,"__all__" 表示全适用 - category: 分类(可为 null) - categoryTags: 分类标签列表 - createdBy: 创建人 ID - createdByName: 创建人姓名 - createdAt: 创建时间(毫秒时间戳) - updatedAt: 更新时间(毫秒时间戳) - updatedBy: 最后更新人 ID - updatedByName: 最后更新人姓名 - isDeleted: 是否已删除 - """ - id: str - tenantId: str - title: str - purpose: str - contentType: str # "policy" 等 - content: str # Markdown 正文 - status: str # "published" | "draft" - enabled: bool = True - scenarios: list[str] = [] # ["audit", "fill"] 等 - tags: list[str] = [] # ["__all__"] 或具体标签 - category: Optional[str] = None - categoryTags: list[str] = [] - createdBy: Optional[str] = None - createdByName: Optional[str] = None - createdAt: Optional[int] = None - updatedAt: Optional[int] = None - updatedBy: Optional[str] = None - updatedByName: Optional[str] = None - isDeleted: bool = False - - class Config: - extra = "allow" - - -class KnowledgeArticleListData(BaseModel): - """GET /api/v1/knowledge/articles 响应体 data 字段。""" - articles: list[KnowledgeArticle] - total: Optional[int] = None - - class Config: - extra = "allow" - - -# ── Server 请求模型(FastAPI 路由入参,统一在此维护)────────────────────────── -# 命名规则:{功能}{动作}Request,只在 server/sealai_router.py 中引用。 - -class RuleCreateRequest(BaseModel): - """POST /sealai/rules 请求体""" - description: str - scope: str - strictness: str = "MUST_FOLLOW" - - -class RuleUpdateRequest(BaseModel): - """PUT /sealai/rules/{rule_id} 请求体(partial,字段均可选)""" - description: Optional[str] = None - scope: Optional[str] = None - strictness: Optional[str] = None - - -class PublishVersionRequest(BaseModel): - """POST /sealai/rule-set-versions/publish 请求体""" - version_name: str - - -class DecisionPreferencesUpdateRequest(BaseModel): - """PATCH /sealai/preference/decision 请求体(patch 式,字段均可选)""" - explicit_approve: Optional[str] = None - explicit_reject: Optional[str] = None - exempt_approve: Optional[str] = None - review: Optional[str] = None - - -class ArticleCreateRequest(BaseModel): - """POST /sealai/knowledge/articles 请求体""" - title: str - purpose: str - content: str - content_type: str = "policy" - status: str = "published" - scenarios: list[str] = [] - tags: list[str] = [] - - -class ArticleUpdateRequest(BaseModel): - """PATCH /sealai/knowledge/articles/{article_id} 请求体(partial,字段均可选)""" - title: Optional[str] = None - purpose: Optional[str] = None - content: Optional[str] = None - content_type: Optional[str] = None - status: Optional[str] = None - enabled: Optional[bool] = None - scenarios: Optional[list[str]] = None - tags: Optional[list[str]] = None diff --git a/src/ekb_cli/commands/README.commands.md b/src/ekb_cli/commands/README.commands.md deleted file mode 100644 index 50e9414..0000000 --- a/src/ekb_cli/commands/README.commands.md +++ /dev/null @@ -1,35 +0,0 @@ -# commands/ — CLI 表现层 - -## 职责边界 - -- **只做 I/O 适配**:参数解析(typer)、交互式输入、rich 格式化输出。 -- **不做业务编排**:调用 `services.*` 完成,不直接调用 `api.*`。 -- **不做异常处理**:让 `EkbError` 自然冒泡至 CLI 入口(`__init__.py`)的全局 handler; - 命令内部**不应**局部 catch 再重新打印,以免造成双重输出或消息漂移。 - -## 目录结构 - -``` -commands/ -├── auth.py # ekb auth 命令组(企业认证管理) -├── help.py # ekb commands(命令树速查) -├── serve.py # ekb serve(启动 HTTP API Server) -├── agent/ # ekb agent 命令组,见 README.agent.md / README.rule.md -└── sealai/ # ekb sealai 命令组,见 README.sealai.md -``` - -## 依赖约定 - -``` -commands/* → services/* ✅ 允许 -commands/* → api/* ❌ 禁止(边界穿透) -``` - -## 新增命令流程 - -1. 在对应子目录新建 `{verb}.py`,只写展示逻辑 -2. 在 `{dir}/__init__.py` 注册到 typer app -3. 在 `services/` 添加或复用业务函数 -4. 在 `server/` 对应 router 添加 HTTP 端点 -5. 更新 `help.py` 命令树 -6. 更新 `CLAUDE.md` 命令全图和接口对照表 diff --git a/src/ekb_cli/commands/__init__.py b/src/ekb_cli/commands/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/ekb_cli/commands/agent/README.agent.md b/src/ekb_cli/commands/agent/README.agent.md deleted file mode 100644 index 069cca5..0000000 --- a/src/ekb_cli/commands/agent/README.agent.md +++ /dev/null @@ -1,43 +0,0 @@ -# ekb agent 命令说明 - -## 枚举常量 - -**mode(审核模式)** - -| 值 | 含义 | 备注 | -|---|---|---| -| `0` | 全自动 | 无 samplingRate | -| `1` | 半自动 | samplingRate 0–100,表示抽检比例 | -| `2` | 辅助 | | - -**state(Agent 状态)** - -| 值 | 含义 | 备注 | -|---|---|---| -| `0` | 草稿 | 新建默认值,未发布 | -| `1` | 已发布 | 已关联审批流并生效 | -| `2` | 已删除 | 不可恢复 | - -## 四类条款语义(对应前端「AI审核决策偏好」) - -| 字段 | 前端标签 | AI 行为 | -|---|---|---| -| `agreeTerms` | 明确同意 | 满足 → 直接**通过** | -| `rejectTerms` | 明确驳回 | 满足 → 直接**拒绝** | -| `exemptTerms` | 理应驳回,但可豁免(即备注同意) | 满足 → **豁免**,备注同意 | -| `reviewTerms` | 建议复核,转人工 | 无法判断 → **转人工**处理 | - -## 命令速查 - -```bash -ekb agent list # 列出所有 Agent -ekb agent get # 查看 Agent 详情(含关联规则) -ekb agent get --full # 不截断规则字段 -ekb agent create --name <名称> --help # 新建 Agent,查看全部参数 -ekb agent copy # 复制 Agent(名称自动加「副本」) -ekb agent update --help # 查看可修改字段 -ekb agent update --mode assist # 切换模式(auto/semi/assist) -ekb agent delete # 删除 Agent(方向键交互确认) -ekb agent delete --ai # 删除 Agent(y/N 文字确认,AI/脚本友好) -ekb agent delete --yes # 删除 Agent(跳过确认,危险) -``` diff --git a/src/ekb_cli/commands/agent/README.rule.md b/src/ekb_cli/commands/agent/README.rule.md deleted file mode 100644 index 0e4b761..0000000 --- a/src/ekb_cli/commands/agent/README.rule.md +++ /dev/null @@ -1,38 +0,0 @@ -# ekb agent rule 命令说明 - -## 枚举常量 - -**level(风险等级)** - -| 值 | 含义 | 显示颜色 | -|---|---|---| -| `"严重"` | 高风险 | 红色 | -| `"一般"` | 普通风险 | 黄色 | - -## 关联关系 - -- 规则与 Agent 是多对多关系:一条规则可关联多个 Agent,一个 Agent 可关联多条规则 -- `rule/list` 响应中每条规则的 `agents[]` 字段列出当前关联的 Agent(id + name) -- `agent/detail` 响应中的 `agentRule[]` 字段列出当前 Agent 关联的规则 - -## 命令速查 - -```bash -ekb agent rules # 列出所有规则(截断版) -ekb agent rules --full # 列出所有规则(完整版) -ekb agent rules --level 严重 # 筛选严重等级 - -ekb agent rule-get <编码或ID> # 查看规则详情(含关联 Agent 列表) -# 编码支持多种写法:0001 / 01 / 1 / #0001(自动补零对齐) - -ekb agent rule-create --purpose <场景> --desc <描述> --level 严重 -# --level 默认严重,可选:严重 / 一般 -``` - -## 已知 API - -``` -GET /api/engine/hab/agent/rule/list # 拉取全部规则,支持 page/size -POST /api/engine/hab/agent/rule/save # 新建规则,body: {purpose, description, level} -POST /api/engine/hab/agent/rule/update # 更新规则,body: {id, code, purpose, description, level} -``` diff --git a/src/ekb_cli/commands/agent/__init__.py b/src/ekb_cli/commands/agent/__init__.py deleted file mode 100644 index 5db3c6d..0000000 --- a/src/ekb_cli/commands/agent/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -"""agent 子命令组""" - -import typer -from ekb_cli.commands.agent.list import cmd_list -from ekb_cli.commands.agent.detail import cmd_detail -from ekb_cli.commands.agent.logs import cmd_logs -from ekb_cli.commands.agent.update import cmd_update -from ekb_cli.commands.agent.create import cmd_create -from ekb_cli.commands.agent.copy import cmd_copy -from ekb_cli.commands.agent.rule_list import cmd_rule_list -from ekb_cli.commands.agent.rule_detail import cmd_rule_detail -from ekb_cli.commands.agent.rule_create import cmd_rule_create - -from ekb_cli.commands.agent.delete import cmd_delete - -app = typer.Typer(help="智能审核 Agent 管理") - -app.command("list")(cmd_list) -app.command("get")(cmd_detail) -app.command("create")(cmd_create) -app.command("copy")(cmd_copy) -app.command("update")(cmd_update) -app.command("delete")(cmd_delete) -app.command("logs")(cmd_logs) -app.command("rules")(cmd_rule_list) -app.command("rule-get")(cmd_rule_detail) -app.command("rule-create")(cmd_rule_create) diff --git a/src/ekb_cli/commands/agent/copy.py b/src/ekb_cli/commands/agent/copy.py deleted file mode 100644 index 4bdc1ff..0000000 --- a/src/ekb_cli/commands/agent/copy.py +++ /dev/null @@ -1,23 +0,0 @@ -"""ekb agent copy :复制智能审核 Agent(表现层) - -不导入 api 层;通过 services.copy_agent_cmd 复制 Agent。 -EkbError 由 CLI 入口全局 handler 统一处理,本层不 catch。 -""" - -import typer -from rich import print as rprint - -from ekb_cli.services import copy_agent_cmd, MODE_DISPLAY - - -def cmd_copy( - agent_id: str = typer.Argument(..., help="要复制的 Agent ID"), -): - """复制 Agent(新 Agent 名称为原名称加「(副本)」)""" - src, new = copy_agent_cmd(agent_id) - - rprint("[green]✓ Agent 复制成功[/green]") - rprint(f" 原 Agent:[dim]{src.name}[/dim] → 新 Agent:[bold]{new.name}[/bold]") - rprint(f" 新 ID:[dim]{new.id}[/dim]") - rprint(f" 模式:{MODE_DISPLAY.get(new.mode, str(new.mode))}") - rprint(f" 关联规则数:{len(new.agentRule)}") diff --git a/src/ekb_cli/commands/agent/create.py b/src/ekb_cli/commands/agent/create.py deleted file mode 100644 index 1368973..0000000 --- a/src/ekb_cli/commands/agent/create.py +++ /dev/null @@ -1,47 +0,0 @@ -"""ekb agent create:新建智能审核 Agent(表现层) - -不导入 api 层;通过 services.create_agent_cmd 创建 Agent。 -EkbError 由 CLI 入口全局 handler 统一处理,本层不 catch。 -""" - -from typing import Optional, List -import typer -from rich import print as rprint - -from ekb_cli.services import create_agent_cmd, AgentCreateInput, MODE_DISPLAY - - -def cmd_create( - name: str = typer.Option(..., "--name", "-n", help="Agent 名称(唯一)"), - description: str = typer.Option("", "--description", "-d", help="描述"), - mode: str = typer.Option("assist", "--mode", "-m", help="模式:auto / semi / assist"), - agree_terms: str = typer.Option("", "--agree-terms", help="明确同意条款"), - reject_terms: str = typer.Option("", "--reject-terms", help="明确驳回条款"), - exempt_terms: str = typer.Option("", "--exempt-terms", help="豁免(备注同意)条款"), - review_terms: str = typer.Option("", "--review-terms", help="转人工条款"), - rule_ids: Optional[List[str]] = typer.Option(None, "--rule-id", "-r", help="关联规则 ID(可多次传入)"), - icon: str = typer.Option("", "--icon", help="头像 URL(留空使用默认)"), -): - """新建智能审核 Agent""" - from ekb_cli.services.agent_service import DEFAULT_ICON - - inp = AgentCreateInput( - name=name, - description=description, - mode=mode, - agree_terms=agree_terms, - reject_terms=reject_terms, - exempt_terms=exempt_terms, - review_terms=review_terms, - rule_ids=rule_ids or [], - icon=icon or DEFAULT_ICON, - ) - - data = create_agent_cmd(inp) - - rprint("[green]✓ Agent 创建成功[/green]") - rprint(f" ID:[dim]{data.id}[/dim]") - rprint(f" 名称:[bold]{data.name}[/bold]") - rprint(f" 模式:{MODE_DISPLAY.get(data.mode, str(data.mode))}") - rprint(f" 关联规则数:{len(data.agentRule)}") - rprint(f" 创建时间:[dim]{data.createTime}[/dim]") diff --git a/src/ekb_cli/commands/agent/delete.py b/src/ekb_cli/commands/agent/delete.py deleted file mode 100644 index 4869a9c..0000000 --- a/src/ekb_cli/commands/agent/delete.py +++ /dev/null @@ -1,76 +0,0 @@ -"""ekb agent delete :删除智能审核 Agent(表现层) - -确认逻辑: -- 默认:终端可用时用方向键菜单(questionary),否则降级为文字输入 -- --ai:强制文字输入模式(适合 AI/脚本非交互式环境) -- --yes:跳过确认直接删除 - -不导入 api 层;通过 services.get_agent_cmd / delete_agent_cmd 操作。 -EkbError 由 CLI 入口全局 handler 统一处理,本层不 catch。 -""" - -import sys -import questionary -import typer -from rich import print as rprint -from rich.panel import Panel -from rich.console import Console - -from ekb_cli.services import get_agent_cmd, delete_agent_cmd - -console = Console() - -_CANCEL = "取消(默认安全)" -_CONFIRM = "确认删除" - - -def cmd_delete( - agent_id: str = typer.Argument(..., help="要删除的 Agent ID"), - yes: bool = typer.Option(False, "--yes", "-y", help="跳过确认直接删除(危险)"), - ai: bool = typer.Option(False, "--ai", help="AI/脚本模式:改用文字输入 y/N 确认"), -): - """删除 Agent(不可恢复,操作前会展示 Agent 信息并要求确认)""" - # 先拉详情用于展示(service 层已处理 NotFoundError) - d = get_agent_cmd(agent_id) - - rule_count = len(d.agentRule) - console.print(Panel( - "\n".join([ - f"[bold]名称[/bold] {d.name}", - f"[bold]ID[/bold] [dim]{d.id}[/dim]", - f"[bold]描述[/bold] {d.description or '(无)'}", - f"[bold]关联规则[/bold] {rule_count} 条{'(规则本身不会被删除)' if rule_count else ''}", - f"[bold]更新时间[/bold] {d.updateTime}", - ]), - title="[bold red]⚠ 即将删除以下 Agent[/bold red]", - border_style="red", - expand=False, - )) - - if not yes: - if ai or not sys.stdin.isatty(): - rprint(f"确认删除 Agent「{d.name}」?输入 y 确认,其他任意键取消:", end=" ") - answer = input().strip().lower() - if answer != "y": - rprint("[dim]已取消[/dim]") - raise typer.Exit(0) - else: - choice = questionary.select( - f"确认删除 Agent「{d.name}」?", - choices=[_CANCEL, _CONFIRM], - default=_CANCEL, - style=questionary.Style([ - ("selected", "fg:#ff5555 bold"), - ("pointer", "fg:#ff5555 bold"), - ("highlighted", "fg:#ff5555"), - ("question", "bold"), - ]), - ).ask() - - if choice != _CONFIRM: - rprint("[dim]已取消[/dim]") - raise typer.Exit(0) - - # 确认后执行删除 - delete_agent_cmd(agent_id) - rprint(f"[green]✓ Agent「{d.name}」已删除[/green]") diff --git a/src/ekb_cli/commands/agent/detail.py b/src/ekb_cli/commands/agent/detail.py deleted file mode 100644 index 5a62225..0000000 --- a/src/ekb_cli/commands/agent/detail.py +++ /dev/null @@ -1,87 +0,0 @@ -"""ekb agent get :查看 Agent 详情(表现层) - -不导入 api 层;通过 services.get_agent_cmd 获取数据。 -""" - -import typer -from rich.console import Console -from rich.panel import Panel -from rich.table import Table -from rich import print as rprint - -from ekb_cli.services import get_agent_cmd - -console = Console() -STATE_MAP = {0: "[dim]草稿[/dim]", 1: "[green]已发布[/green]"} -MODE_MAP = {0: "全自动", 1: "半自动", 2: "辅助"} - -DESC_MAX = 24 -PURPOSE_MAX = 16 - - -def cmd_detail( - agent_id: str = typer.Argument(..., help="Agent ID"), - full: bool = typer.Option(False, "--full", "-f", help="显示完整内容,不截断规则字段"), -): - """查看 Agent 详情""" - d = get_agent_cmd(agent_id) - - state = STATE_MAP.get(d.state, str(d.state)) - mode = MODE_MAP.get(d.mode, str(d.mode)) - if d.mode == 1: - mode += f"(抽检 {d.samplingRate}%)" - - content = "\n".join([ - f"[bold]ID[/bold] {d.id}", - f"[bold]名称[/bold] {d.name}", - f"[bold]状态[/bold] {state}", - f"[bold]模式[/bold] {mode}", - f"[bold]描述[/bold] {d.description or '(无)'}", - f"[bold]创建时间[/bold] {d.createTime}", - f"[bold]更新时间[/bold] {d.updateTime}", - "", - f"[bold cyan]明确同意[/bold cyan]\n{d.agreeTerms}", - "", - f"[bold red]明确驳回[/bold red]\n{d.rejectTerms}", - "", - f"[bold yellow]理应驳回,但可豁免(即备注同意)[/bold yellow]\n{d.exemptTerms}", - "", - f"[bold green]建议复核,转人工[/bold green]\n{d.reviewTerms}", - ]) - - console.print(Panel(content, title=f"[bold]{d.name}[/bold]", expand=False)) - - if d.agentRule: - table = Table(title="关联规则", show_lines=True) - if full: - table.add_column("规则描述") - table.add_column("规则编码", style="dim", no_wrap=True) - table.add_column("适用场景") - table.add_column("风险等级", no_wrap=True) - table.add_column("更新日期", style="dim", no_wrap=True) - table.add_column("ID", style="dim", no_wrap=True) - else: - table.add_column("规则描述", max_width=DESC_MAX, no_wrap=True) - table.add_column("规则编码", style="dim", no_wrap=True) - table.add_column("适用场景", max_width=PURPOSE_MAX, no_wrap=True) - table.add_column("风险等级", no_wrap=True) - table.add_column("更新日期", style="dim", no_wrap=True) - table.add_column("ID", style="dim", no_wrap=True) - - any_truncated = False - total_chars = 0 - for r in d.agentRule: - level_str = f"[red]{r.level}[/red]" if r.level == "严重" else f"[yellow]{r.level}[/yellow]" - update_date = r.updateTime[:10] - total_chars += len(r.description) + len(r.purpose) - if not full and (len(r.description) > DESC_MAX or len(r.purpose) > PURPOSE_MAX): - any_truncated = True - table.add_row(r.description, r.code, r.purpose, level_str, update_date, r.id) - - console.print(table) - - if any_truncated: - rprint(f"[yellow]⚠ 部分规则字段已截断,完整规则文本共 {total_chars} 字符[/yellow]") - rprint("[dim]使用 --full 参数获取完整内容:ekb agent get --full[/dim]") - else: - rprint("[dim](未关联任何规则)[/dim]") diff --git a/src/ekb_cli/commands/agent/list.py b/src/ekb_cli/commands/agent/list.py deleted file mode 100644 index 68500a1..0000000 --- a/src/ekb_cli/commands/agent/list.py +++ /dev/null @@ -1,38 +0,0 @@ -"""ekb agent list:列出所有智能审核 Agent(表现层)""" - -import typer -from rich.console import Console -from rich.table import Table -from rich import print as rprint - -from ekb_cli.services import list_agents_cmd - -console = Console() -STATE_MAP = {0: "[dim]草稿[/dim]", 1: "[green]已发布[/green]"} -MODE_MAP = {0: "全自动", 1: "半自动", 2: "辅助"} - - -def cmd_list(): - """列出所有智能审核 Agent""" - page = list_agents_cmd() - - if not page.items: - rprint("[yellow]暂无 Agent[/yellow]") - raise typer.Exit() - - table = Table(title="智能审核 Agent 列表") - table.add_column("ID", style="dim") - table.add_column("名称") - table.add_column("模式") - table.add_column("状态") - table.add_column("更新时间") - - for item in page.items: - table.add_row( - item.id, - item.name, - MODE_MAP.get(item.mode, str(item.mode)), - STATE_MAP.get(item.state, str(item.state)), - item.updateTime, - ) - console.print(table) diff --git a/src/ekb_cli/commands/agent/logs.py b/src/ekb_cli/commands/agent/logs.py deleted file mode 100644 index 79c516d..0000000 --- a/src/ekb_cli/commands/agent/logs.py +++ /dev/null @@ -1,8 +0,0 @@ -"""ekb agent logs :查看 Agent 审核日志(待实现)""" - -from rich import print as rprint - - -def cmd_logs(agent_id: str): - """查看 Agent 审核日志""" - rprint(f"[yellow]待实现:agent logs {agent_id}[/yellow]") diff --git a/src/ekb_cli/commands/agent/rule_create.py b/src/ekb_cli/commands/agent/rule_create.py deleted file mode 100644 index 68782f5..0000000 --- a/src/ekb_cli/commands/agent/rule_create.py +++ /dev/null @@ -1,28 +0,0 @@ -"""ekb agent rule-create:新建审核规则(表现层) - -不导入 api 层;通过 services.create_rule_cmd 新建规则。 -EkbError 由 CLI 入口全局 handler 统一处理,本层不 catch。 -""" - -import typer -from rich import print as rprint - -from ekb_cli.services import create_rule_cmd - - -def cmd_rule_create( - purpose: str = typer.Option(..., "--purpose", "-p", help="适用场景(规则名称)"), - description: str = typer.Option(..., "--desc", "-d", help="规则描述"), - level: str = typer.Option("严重", "--level", "-l", help="风险等级:严重 / 一般"), -): - """新建审核规则""" - rule = create_rule_cmd(purpose=purpose, description=description, level=level) - - rprint("[green]✓ 规则创建成功[/green]") - rprint(f" 编码:[bold]{rule.code}[/bold]") - rprint(f" ID:[dim]{rule.id}[/dim]") - rprint(f" 适用场景:{rule.purpose}") - rprint(f" 描述:{rule.description}") - level_tag = "red" if rule.level == "严重" else "yellow" - rprint(f" 风险等级:[{level_tag}]{rule.level}[/{level_tag}]") - rprint(f" 创建时间:[dim]{rule.createTime}[/dim]") diff --git a/src/ekb_cli/commands/agent/rule_detail.py b/src/ekb_cli/commands/agent/rule_detail.py deleted file mode 100644 index c98d506..0000000 --- a/src/ekb_cli/commands/agent/rule_detail.py +++ /dev/null @@ -1,48 +0,0 @@ -"""ekb agent rule-get:查看单条规则详情(表现层) - -不导入 api 层;通过 services.get_rule_cmd 获取数据。 -EkbError 由 CLI 入口全局 handler 统一处理,本层不 catch。 -""" - -import typer -from rich.console import Console -from rich.panel import Panel -from rich.table import Table -from rich import print as rprint - -from ekb_cli.services import get_rule_cmd - -console = Console() - - -def cmd_rule_detail( - rule_ref: str = typer.Argument(..., help="规则 ID 或编码(如 2040826... 或 #0001 或 0001)"), -): - """查看单条规则详情(含关联 Agent 列表)""" - rule = get_rule_cmd(rule_ref) - - level_color = "red" if rule.level == "严重" else "yellow" - level_str = f"[bold {level_color}]{rule.level}[/bold {level_color}]" - - meta = Table(box=None, show_header=False, padding=(0, 1)) - meta.add_column(style="dim", justify="right") - meta.add_column() - meta.add_row("编码", f"[cyan bold]{rule.code}[/cyan bold]") - meta.add_row("风险等级", level_str) - meta.add_row("ID", f"[dim]{rule.id}[/dim]") - meta.add_row("创建时间", f"[dim]{rule.createTime}[/dim]") - meta.add_row("更新时间", f"[dim]{rule.updateTime}[/dim]") - - console.print(Panel(meta, title=f"[bold {level_color}]{rule.code}[/bold {level_color}]", expand=False)) - console.print(Panel(rule.purpose or "(无)", title="[bold cyan]适用场景[/bold cyan]", expand=False)) - console.print(Panel(rule.description or "(无)", title="[bold cyan]规则描述[/bold cyan]", expand=False)) - - if rule.agents: - table = Table(title=f"关联 Agent(共 {len(rule.agents)} 个)", show_lines=True) - table.add_column("名称") - table.add_column("ID", style="dim", no_wrap=True) - for a in rule.agents: - table.add_row(a.name, a.id) - console.print(table) - else: - rprint("[dim](未关联任何 Agent)[/dim]") diff --git a/src/ekb_cli/commands/agent/rule_list.py b/src/ekb_cli/commands/agent/rule_list.py deleted file mode 100644 index 7f4aee6..0000000 --- a/src/ekb_cli/commands/agent/rule_list.py +++ /dev/null @@ -1,71 +0,0 @@ -"""ekb agent rules:列出企业所有审核规则(表现层) - -不导入 api 层;通过 services.list_rules_cmd 获取数据。 -EkbError 由 CLI 入口全局 handler 统一处理,本层不 catch。 -""" - -import typer -from rich.console import Console -from rich.table import Table -from rich import print as rprint - -from ekb_cli.services import list_rules_cmd - -console = Console() - -DESC_MAX = 20 -PURPOSE_MAX = 12 - - -def cmd_rule_list( - full: bool = typer.Option(False, "--full", "-f", help="显示完整内容,不截断描述字段"), - level: str = typer.Option(None, "--level", "-l", help="按风险等级筛选:严重 / 一般"), -): - """列出企业所有审核规则""" - page, items = list_rules_cmd(level=level) - - if not items: - rprint("[dim](暂无规则)[/dim]") - return - - title = ( - f"审核规则(共 {page.totalItems} 条,筛选:{level})" - if level else - f"审核规则(共 {page.totalItems} 条)" - ) - table = Table(title=title, show_lines=True) - table.add_column("规则编码", style="dim", no_wrap=True) - if full: - table.add_column("规则描述") - table.add_column("适用场景") - else: - table.add_column("规则描述", max_width=DESC_MAX, no_wrap=True) - table.add_column("适用场景", max_width=PURPOSE_MAX, no_wrap=True) - table.add_column("风险等级", no_wrap=True) - table.add_column("关联Agent", no_wrap=True) - table.add_column("更新日期", style="dim", no_wrap=True) - table.add_column("ID", style="dim", no_wrap=True) - - any_truncated = False - total_chars = 0 - for r in items: - level_str = f"[red]{r.level}[/red]" if r.level == "严重" else f"[yellow]{r.level}[/yellow]" - update_date = r.updateTime[:10] - total_chars += len(r.description) + len(r.purpose) - if not full and (len(r.description) > DESC_MAX or len(r.purpose) > PURPOSE_MAX): - any_truncated = True - table.add_row( - r.code, - r.description, - r.purpose, - level_str, - str(len(r.agents)), - update_date, - r.id, - ) - - console.print(table) - - if any_truncated: - rprint(f"[yellow]⚠ 部分字段已截断,完整规则文本共 {total_chars} 字符[/yellow]") - rprint("[dim]使用 --full 参数获取完整内容:ekb agent rules --full[/dim]") diff --git a/src/ekb_cli/commands/agent/update.py b/src/ekb_cli/commands/agent/update.py deleted file mode 100644 index 9256305..0000000 --- a/src/ekb_cli/commands/agent/update.py +++ /dev/null @@ -1,48 +0,0 @@ -"""ekb agent update :修改 Agent 配置(表现层) - -不导入 api 层;通过 services.update_agent_cmd 更新 Agent。 -EkbError 由 CLI 入口全局 handler 统一处理,本层不 catch。 -""" - -from typing import Optional -import typer -from rich import print as rprint - -from ekb_cli.services import update_agent_cmd, AgentUpdateInput, MODE_DISPLAY - -STATE_DISPLAY = {0: "启用", 1: "禁用"} - - -def cmd_update( - agent_id: str = typer.Argument(..., help="Agent ID"), - name: Optional[str] = typer.Option(None, "--name", "-n", help="名称"), - description: Optional[str] = typer.Option(None, "--description", "-d", help="描述"), - mode: Optional[str] = typer.Option(None, "--mode", "-m", help="模式:auto/semi/assist"), - sampling_rate: Optional[int] = typer.Option(None, "--sampling-rate", "-r", help="半自动抽检比例 0-100"), - state: Optional[int] = typer.Option(None, "--state", "-s", help="状态:0=启用 1=禁用"), - agree_terms: Optional[str] = typer.Option(None, "--agree-terms", help="同意条款"), - reject_terms: Optional[str] = typer.Option(None, "--reject-terms", help="拒绝条款"), - exempt_terms: Optional[str] = typer.Option(None, "--exempt-terms", help="豁免条款"), - review_terms: Optional[str] = typer.Option(None, "--review-terms", help="转人工条款"), -): - """修改 Agent 配置(只传需要修改的字段)""" - inp = AgentUpdateInput( - agent_id=agent_id, - name=name, - description=description, - mode=mode, - sampling_rate=sampling_rate, - state=state, - agree_terms=agree_terms, - reject_terms=reject_terms, - exempt_terms=exempt_terms, - review_terms=review_terms, - ) - - saved = update_agent_cmd(inp) - - rprint( - f"[green]✓[/green] 已更新 Agent [bold]{saved.name}[/bold]" - f" 模式={MODE_DISPLAY.get(saved.mode, str(saved.mode))}" - f" 状态={STATE_DISPLAY.get(saved.state, str(saved.state))}" - ) diff --git a/src/ekb_cli/commands/auth.py b/src/ekb_cli/commands/auth.py deleted file mode 100644 index f3b26de..0000000 --- a/src/ekb_cli/commands/auth.py +++ /dev/null @@ -1,84 +0,0 @@ -"""auth 命令:管理企业认证信息 - -表现层:只负责参数解析、交互式输入、rich 格式化输出。 -业务逻辑委托给 services.auth_service。 - -异常处理约定: - 所有命令不做局部捕获,让 EkbError 冒泡到 CLI 入口的全局 handler, - 由 __init__.py 统一以红字输出并 Exit(1)。 -""" - -import typer -from rich.console import Console -from rich.table import Table -from rich import print as rprint - -from ekb_cli.services import auth_service - -app = typer.Typer(help="管理企业认证") -console = Console() - - -@app.command("add") -def auth_add(): - """添加企业认证(从浏览器 F12 复制请求头中的 accesstoken / corpid / staffid)""" - console.print("\n[bold]添加企业认证[/bold]") - console.print("步骤:打开快报 → F12 → 任意 API 请求 → 请求头中找到以下三个字段\n") - - # 交互式输入留在 CLI 层,service 层不涉及 I/O - access_token = typer.prompt("accesstoken").strip() - corp_id = typer.prompt("corpid").strip() - staff_id = typer.prompt("staffid").strip() - - for label, val in [("accesstoken", access_token), ("corpid", corp_id), ("staffid", staff_id)]: - if not val: - rprint(f"[red]{label} 不能为空[/red]") - raise typer.Exit(1) - - name = typer.prompt("企业名称(方便识别)", default=corp_id).strip() - - corp = auth_service.add_corp(corp_id=corp_id, name=name, - access_token=access_token, staff_id=staff_id) - rprint(f"[green]✓[/green] 已添加企业 [bold]{corp.name}[/bold] ({corp.corp_id})") - - -@app.command("list") -def auth_list(): - """列出所有已添加的企业""" - corps = auth_service.list_corps() - - if not corps: - rprint("[yellow]尚未添加任何企业,请先执行 `ekb auth add`[/yellow]") - raise typer.Exit() - - table = Table(title="已配置的企业") - table.add_column("", width=2) - table.add_column("名称") - table.add_column("corpId") - - for c in corps: - marker = "[green]*[/green]" if c.is_current else "" - table.add_row(marker, c.name, c.corp_id) - - console.print(table) - - -@app.command("use") -def auth_use(corp_id: str = typer.Argument(..., help="要切换的企业 corpId")): - """切换当前使用的企业""" - corp = auth_service.use_corp(corp_id) - rprint(f"[green]✓[/green] 已切换到企业 [bold]{corp.name}[/bold] ({corp.corp_id})") - - -@app.command("remove") -def auth_remove(corp_id: str = typer.Argument(..., help="要删除的企业 corpId")): - """删除一个企业的认证信息""" - auth_service.remove_corp(corp_id) - rprint(f"[green]✓[/green] 已删除企业 {corp_id}") - - -@app.command("whoami") -def auth_whoami(): - """查看当前使用的企业""" - corp = auth_service.whoami() - rprint(f"当前企业:[bold]{corp.name}[/bold] ({corp.corp_id})") diff --git a/src/ekb_cli/commands/help.py b/src/ekb_cli/commands/help.py deleted file mode 100644 index 30e3586..0000000 --- a/src/ekb_cli/commands/help.py +++ /dev/null @@ -1,94 +0,0 @@ -"""ekb commands [GROUP]:查看命令树""" - -from typing import Optional -import typer -from rich.console import Console -from rich.tree import Tree - -console = Console() - -# 命令树定义:新增命令组/命令时在此同步维护 -COMMAND_TREE = { - "auth": { - "_help": "管理企业认证", - "add": "添加企业认证", - "list": "列出所有企业", - "use": "切换当前企业", - "remove": "删除企业", - "whoami": "查看当前企业", - }, - "agent": { - "_help": "智能审核 Agent 管理", - "list": "列出所有 Agent", - "get": "查看 Agent 详情 → ekb agent get --help", - "create": "新建 Agent → ekb agent create --help", - "copy": "复制 Agent(名称自动加「副本」) → ekb agent copy ", - "update": "修改 Agent 配置 → ekb agent update --help", - "delete": "删除 Agent(有二次确认) → ekb agent delete ", - "rules": "列出所有审核规则 → ekb agent rules --help", - "rule-get": "查看规则详情 → ekb agent rule-get ", - "rule-create": "新建审核规则 → ekb agent rule-create --help", - "logs": "查看审核日志", - }, - "serve": { - "_help": "启动 HTTP API Server", - "--host": "监听地址(默认 127.0.0.1)", - "--port": "监听端口(默认 9528)", - "--reload": "开发模式自动重载", - }, - "sealai": { - "_help": "SealAI 智能填单/审核平台管理", - "whoami": "查看当前 SealAI 用户身份及租户信息", - "billing": "查看当前企业 SealAI 订阅状态及功能配额", - "rules": "查看草稿区审核规则列表", - "rule-create": "新建草稿审核规则", - "rule-update": "更新草稿审核规则 → ekb sealai rule-update --help", - "rule-delete": "删除草稿审核规则 → ekb sealai rule-delete ", - "versions": "查看已发布规则集版本历史", - "knowledge-list": "查看知识文档列表 → ekb sealai knowledge-list --help", - "knowledge-get": "查看单篇知识文档详情 → ekb sealai knowledge-get ", - "knowledge-create": "新建知识文档 → ekb sealai knowledge-create --help", - "knowledge-update": "更新知识文档 → ekb sealai knowledge-update --help", - }, - "platform": { - "_help": "自建应用(DataLink Platform)管理", - "list": "列出当前企业所有启用的自建应用", - "workflow-list": "列出指定应用的工作流 → ekb platform workflow-list --help", - "workflow-stats": "查看工作流执行统计 → ekb platform workflow-stats ", - "workflow-charge": "查看企业工作流资源包配额", - }, -} - - -def cmd_commands(group: Optional[str] = typer.Argument(None, help="命令组名称,如 auth / agent / serve")): - """查看命令树(不带参数显示全树,带组名只看该分支)""" - if group is not None: - if group not in COMMAND_TREE: - console.print(f"[red]未知命令组:{group}[/red]") - raise typer.Exit(1) - _print_group(group, COMMAND_TREE[group]) - else: - root = Tree("[bold]ekb[/bold]") - for grp, cmds in COMMAND_TREE.items(): - _build_branch(root, grp, cmds) - console.print(root) - console.print("\n[dim]查看某组详情:ekb commands [/dim]") - console.print("[dim]查看命令参数:ekb --help[/dim]") - - -def _build_branch(parent, grp: str, cmds: dict): - branch = parent.add(f"[bold cyan]{grp}[/bold cyan] {cmds.get('_help', '')}") - for cmd, desc in cmds.items(): - if cmd == "_help": - continue - branch.add(f"[green]{cmd}[/green] {desc}") - - -def _print_group(grp: str, cmds: dict): - tree = Tree(f"[bold]ekb[/bold] [bold cyan]{grp}[/bold cyan] {cmds.get('_help', '')}") - for cmd, desc in cmds.items(): - if cmd == "_help": - continue - tree.add(f"[green]{cmd}[/green] {desc}") - console.print(tree) - console.print(f"\n[dim]查看命令参数:ekb {grp} --help[/dim]") diff --git a/src/ekb_cli/commands/platform/README.platform.md b/src/ekb_cli/commands/platform/README.platform.md deleted file mode 100644 index 8aa1900..0000000 --- a/src/ekb_cli/commands/platform/README.platform.md +++ /dev/null @@ -1,28 +0,0 @@ -# commands/platform — 自建应用命令层 - -## 命令一览 - -| 命令 | 说明 | -|---|---| -| `ekb platform list` | 列出当前企业所有启用的自建应用 | -| `ekb platform workflow-list ` | 分页列出指定应用的工作流 | -| `ekb platform workflow-stats ` | 查看工作流执行统计 | -| `ekb platform workflow-charge` | 查看企业工作流资源包配额 | - -## 文件说明 - -| 文件 | 对应命令 | -|---|---| -| `list.py` | `ekb platform list` | -| `workflow_list.py` | `ekb platform workflow-list` | -| `workflow_stats.py` | `ekb platform workflow-stats` | -| `workflow_charge.py` | `ekb platform workflow-charge` | - -## 待实现(预留) - -以下子模块待接口抓包后开发: - -| 命令(待建) | 对应业务 | -|---|---| -| `ekb platform entity-list ` | 业务对象(实体)列表 | -| `ekb platform page-list ` | 页面设计器列表 | diff --git a/src/ekb_cli/commands/platform/__init__.py b/src/ekb_cli/commands/platform/__init__.py deleted file mode 100644 index 662f49a..0000000 --- a/src/ekb_cli/commands/platform/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -"""platform 子命令组:自建应用管理""" - -import typer - -from ekb_cli.commands.platform.list import cmd_list -from ekb_cli.commands.platform.workflow_list import cmd_workflow_list -from ekb_cli.commands.platform.workflow_get import cmd_workflow_get -from ekb_cli.commands.platform.workflow_stats import cmd_workflow_stats -from ekb_cli.commands.platform.workflow_charge import cmd_workflow_charge -from ekb_cli.commands.platform.workflow_search import cmd_workflow_search - -app = typer.Typer(help="自建应用(DataLink Platform)管理") - -app.command("list")(cmd_list) -app.command("workflow-list")(cmd_workflow_list) -app.command("workflow-get")(cmd_workflow_get) -app.command("workflow-stats")(cmd_workflow_stats) -app.command("workflow-charge")(cmd_workflow_charge) -app.command("workflow-search")(cmd_workflow_search) diff --git a/src/ekb_cli/commands/platform/list.py b/src/ekb_cli/commands/platform/list.py deleted file mode 100644 index 58e36cb..0000000 --- a/src/ekb_cli/commands/platform/list.py +++ /dev/null @@ -1,36 +0,0 @@ -"""ekb platform list:列出当前企业下所有启用的自建应用""" - -from rich.console import Console -from rich.table import Table -from rich import print as rprint - -from ekb_cli.services.platform import list_platforms_cmd - -console = Console() - - -def cmd_list(): - """列出当前企业所有启用的自建应用""" - platforms = list_platforms_cmd() - - if not platforms: - rprint("[yellow]暂无自建应用[/yellow]") - return - - table = Table(title="自建应用列表") - table.add_column("ID", style="dim") - table.add_column("名称") - table.add_column("编码") - table.add_column("类型") - table.add_column("状态") - - for p in platforms: - table.add_row( - p.id, - p.name, - p.code, - p.platformType or p.groupType, - "[green]启用[/green]" if p.active else "[dim]停用[/dim]", - ) - - console.print(table) diff --git a/src/ekb_cli/commands/platform/workflow_charge.py b/src/ekb_cli/commands/platform/workflow_charge.py deleted file mode 100644 index ce424e5..0000000 --- a/src/ekb_cli/commands/platform/workflow_charge.py +++ /dev/null @@ -1,26 +0,0 @@ -"""ekb platform workflow-charge:查看企业工作流资源包/配额""" - -from rich.console import Console -from rich.table import Table - -from ekb_cli.services.platform import get_workflow_charge_cmd - -console = Console() - - -def cmd_workflow_charge(): - """查看企业工作流资源包配额""" - charge = get_workflow_charge_cmd() - - table = Table(title="工作流资源包配额") - table.add_column("指标") - table.add_column("数值", justify="right") - - table.add_row("企业 ID", charge.corporationId) - table.add_row("订购状态", charge.status) - table.add_row("套餐类型", charge.orderType) - table.add_row("总配额", str(charge.total)) - table.add_row("已使用", str(charge.used)) - table.add_row("剩余", str(charge.remaining)) - - console.print(table) diff --git a/src/ekb_cli/commands/platform/workflow_get.py b/src/ekb_cli/commands/platform/workflow_get.py deleted file mode 100644 index 85de014..0000000 --- a/src/ekb_cli/commands/platform/workflow_get.py +++ /dev/null @@ -1,54 +0,0 @@ -"""ekb platform workflow-get:查看工作流完整配置(节点列表)""" - -import typer -from rich.console import Console -from rich.table import Table -from rich import print as rprint - -from ekb_cli.services.platform import get_workflow_cmd - -console = Console() - -GROUP_LABEL = {"trigger": "触发", "action": "动作", "control": "控制"} -STATE_LABEL = {"success": "[green]✓[/green]", "error": "[red]✗[/red]", "": ""} - - -def cmd_workflow_get( - platform_id: str = typer.Argument(..., help="自建应用 ID"), - pipeline_id: str = typer.Argument(..., help="工作流 ID"), -): - """查看指定工作流的完整配置(触发器 + 节点列表)""" - wf = get_workflow_cmd(platform_id, pipeline_id) - - state_text = "[green]启用[/green]" if wf.state == 1 else "[dim]停用[/dim]" - console.print(f"\n[bold]{wf.label}[/bold] {state_text} [dim]v{wf.version}[/dim]") - if wf.desc: - console.print(f"[dim]{wf.desc}[/dim]") - console.print( - f"执行 {wf.runTimes} 次 / 失败 {wf.errorTimes} 次 " - f"更新:{wf.updateTime} 更新人:{wf.updateUser or '-'}\n" - ) - - if not wf.tasks: - rprint("[yellow]暂无节点[/yellow]") - return - - table = Table(title=f"节点列表(共 {len(wf.tasks)} 个)", show_lines=True) - table.add_column("步骤", style="bold", justify="right") - table.add_column("类型") - table.add_column("名称") - table.add_column("分组") - table.add_column("描述") - table.add_column("状态", justify="center") - - for task in wf.tasks: - table.add_row( - str(task.orderIndex), - task.type, - task.label, - GROUP_LABEL.get(task.groupName, task.groupName), - (task.desc or "")[:60], - STATE_LABEL.get(task.status, task.status), - ) - - console.print(table) diff --git a/src/ekb_cli/commands/platform/workflow_list.py b/src/ekb_cli/commands/platform/workflow_list.py deleted file mode 100644 index bcba378..0000000 --- a/src/ekb_cli/commands/platform/workflow_list.py +++ /dev/null @@ -1,47 +0,0 @@ -"""ekb platform workflow-list:列出指定自建应用下的工作流""" - -import typer -from rich.console import Console -from rich.table import Table -from rich import print as rprint - -from ekb_cli.services.platform import list_workflows_cmd - -console = Console() - -STATE_MAP = {0: "[dim]停用[/dim]", 1: "[green]启用[/green]"} - - -def cmd_workflow_list( - platform_id: str = typer.Argument(..., help="自建应用 ID"), - page: int = typer.Option(1, "--page", "-p", help="页码(从 1 开始)"), - page_size: int = typer.Option(20, "--page-size", "-s", help="每页数量"), -): - """列出指定自建应用下的工作流(分页)""" - result = list_workflows_cmd(platform_id, page=page, page_size=page_size) - - if not result.pipelineList: - rprint("[yellow]暂无工作流[/yellow]") - return - - table = Table( - title=f"工作流列表(应用 {platform_id},第 {result.number}/{result.totalPages} 页,共 {result.pipelineNum} 条)" - ) - table.add_column("ID", style="dim") - table.add_column("名称") - table.add_column("状态") - table.add_column("运行中") - table.add_column("失败") - table.add_column("更新时间") - - for wf in result.pipelineList: - table.add_row( - wf.id, - wf.pipelineName, - STATE_MAP.get(wf.state, str(wf.state)), - str(wf.runningCount), - str(wf.errorCount), - wf.updateTime, - ) - - console.print(table) diff --git a/src/ekb_cli/commands/platform/workflow_search.py b/src/ekb_cli/commands/platform/workflow_search.py deleted file mode 100644 index 60ce4f5..0000000 --- a/src/ekb_cli/commands/platform/workflow_search.py +++ /dev/null @@ -1,42 +0,0 @@ -"""ekb platform workflow-search:跨所有自建应用查找含指定节点类型的工作流""" - -import typer -from rich.console import Console -from rich.table import Table -from rich import print as rprint - -from ekb_cli.services.platform import find_workflows_by_task_type_cmd - -console = Console() - - -def cmd_workflow_search( - task_type: str = typer.Argument(..., help="节点类型,如 http / ekuaibao-ebot-trigger / stop"), - all_states: bool = typer.Option(False, "--all", "-a", help="包含已停用的工作流(默认只查启用)"), -): - """跨所有自建应用,查找含指定节点类型的工作流""" - enabled_only = not all_states - matches = find_workflows_by_task_type_cmd(task_type, enabled_only=enabled_only) - - if not matches: - rprint(f"[yellow]未找到含 [bold]{task_type}[/bold] 节点的工作流[/yellow]") - return - - table = Table( - title=f"含 {task_type} 节点的工作流(共 {len(matches)} 个)", - show_lines=True, - ) - table.add_column("自建应用", style="cyan") - table.add_column("工作流名称") - table.add_column("工作流 ID", style="dim") - table.add_column("节点数", justify="center", style="bold yellow") - - for m in matches: - table.add_row( - m.platform_name, - m.workflow_name, - m.workflow_id, - str(len(m.matched_tasks)), - ) - - console.print(table) diff --git a/src/ekb_cli/commands/platform/workflow_stats.py b/src/ekb_cli/commands/platform/workflow_stats.py deleted file mode 100644 index afcd276..0000000 --- a/src/ekb_cli/commands/platform/workflow_stats.py +++ /dev/null @@ -1,30 +0,0 @@ -"""ekb platform workflow-stats:查看指定自建应用的工作流执行统计""" - -import typer -from rich.console import Console -from rich.table import Table - -from ekb_cli.services.platform import get_workflow_stats_cmd - -console = Console() - - -def cmd_workflow_stats( - platform_id: str = typer.Argument(..., help="自建应用 ID"), -): - """查看指定自建应用的工作流执行统计""" - stats = get_workflow_stats_cmd(platform_id) - - table = Table(title=f"工作流执行统计(应用 {platform_id})") - table.add_column("指标") - table.add_column("数值", justify="right") - - table.add_row("总执行次数", str(stats.total)) - table.add_row("已完成", str(stats.completed)) - table.add_row("失败", str(stats.failed)) - table.add_row("进行中", str(stats.started)) - table.add_row("已启用工作流", str(stats.pipelineOpenCount)) - table.add_row("已停用工作流", str(stats.pipelineCloseCount)) - table.add_row("工作流总数", str(stats.pipelineAllCount)) - - console.print(table) diff --git a/src/ekb_cli/commands/sealai/README.sealai.md b/src/ekb_cli/commands/sealai/README.sealai.md deleted file mode 100644 index bcf34b8..0000000 --- a/src/ekb_cli/commands/sealai/README.sealai.md +++ /dev/null @@ -1,163 +0,0 @@ -# commands/sealai/ — SealAI 命令层说明 - -SealAI(`{corpId.lower()}.sealai.cc`)是独立于快报主站的 AI 填单/审批平台, -认证体系与快报 HAB 完全独立(Bearer JWT)。 - -本目录是 **表现层**,只负责 CLI 参数解析和 rich 输出,所有业务逻辑和 client -生命周期管理统一由 `services/sealai/` 承担。 - ---- - -## 目录分层 - -``` -api/sealai/ -├── client.py SealAiClient(httpx,Bearer JWT 认证) -├── schemas.py Pydantic 数据模型 -├── auth_api.py GET /api/v1/auth/me -├── billing_api.py GET /api/v1/billing/status -├── rules_api.py 草稿规则 CRUD + 已发布版本历史 -├── preference_api.py AI 审批风格偏好读写 -└── knowledge_api.py 知识文档 CRUD - -services/sealai/ -├── auth_service.py SSO token 换取 + 双层缓存 + 401 自动恢复 -├── billing_service.py 订阅状态查询 + 单功能配额查询 -├── rules_service.py 草稿规则 CRUD + 版本发布 -├── preference_service.py AI 审批风格偏好读写 -└── knowledge_service.py 知识文档 CRUD - -commands/sealai/(本目录) -├── whoami.py ekb sealai whoami -├── billing.py ekb sealai billing -├── rules.py ekb sealai rules -├── rule_create.py ekb sealai rule-create -├── rule_update.py ekb sealai rule-update -├── rule_delete.py ekb sealai rule-delete -├── versions.py ekb sealai versions -├── knowledge_list.py ekb sealai knowledge-list -├── knowledge_get.py ekb sealai knowledge-get -├── knowledge_create.py ekb sealai knowledge-create -└── knowledge_update.py ekb sealai knowledge-update - -server/sealai_router.py /sealai/* HTTP 路由(同 CLI 命令对应的 Server 端) -``` - ---- - -## 认证流程 - -``` -快报 accesstoken - → GET https://{corpId.lower()}.sealai.cc/api/auth/oauth2/session/oem-hosecloud - ?token={accesstoken}&returnToken=1 - → Bearer JWT - → 写入磁盘缓存 ~/.config/ekb-cli/sealai_tokens.json(TTL 1 小时) - → 构造 SealAiClient(corp_id, bearer_token),写入模块级内存缓存 - -内存缓存在 TTL 内复用(Server 复用连接池;CLI 进程结束自然回收) -401 时 _sealai_call 自动清除双层缓存并重试一次,调用方无感知 -``` - -- corpId 转小写作为子域名:`ID01Jdq2yIDnMr` → `id01jdq2yidnmr.sealai.cc` -- 磁盘缓存格式:`{ "corpId": { "token": "...", "fetched_at": 1712345678 } }` - ---- - -## 已知 API 路径 - -> `client.get/post/put/patch/delete(path)` 直接传完整路径(含 `/api` 前缀)。 - -``` -# 认证 -GET /api/v1/auth/me 当前用户身份(user + tenant) - -# 计费 -GET /api/v1/billing/status 订阅状态 + 各功能配额 - -# 审核规则(草稿区) -GET /api/v1/rules 草稿规则列表 -POST /api/v1/rules 新建草稿规则(description/scope/strictness) -PUT /api/v1/rules/{id} 更新草稿规则(partial) -DELETE /api/v1/rules/{id} 删除草稿规则 - -# 审核规则(已发布版本) -GET /api/v1/rule-set-versions 已发布版本列表(倒序) -POST /api/v1/rule-set-versions/publish 发布当前草稿为新版本 - -# AI 审批风格偏好 -GET /api/v1/ai-approval/config 读取完整偏好配置 -POST /api/v1/ai-approval/config 整体替换偏好配置 -PATCH /api/v1/ai-approval/config/decision-preferences Patch 式更新决策偏好 - -# 知识文档 -GET /api/v1/knowledge/articles 知识文档列表(支持场景过滤、分页、排序) -POST /api/v1/knowledge/articles 新建知识文档 -GET /api/v1/knowledge/articles/{id} 知识文档详情 -PATCH /api/v1/knowledge/articles/{id} 更新知识文档(partial) -``` - -### strictness 枚举值 - -| 值 | 含义 | -|----|------| -| `MUST_FOLLOW` | 必须遵守 | -| `SHOULD_FOLLOW` | 应当遵守 | -| `SUGGESTION` | 建议 | - ---- - -## 功能项(Feature)说明 - -| code | 名称 | 类型 | 说明 | -|------|------|------|------| -| `ai-approval` | AI 审批 | 余额型 | balance/totalQuota/totalUsed | -| `approval-rules` | 审核规则 | 配额型 | quota/used/remaining | -| `financial-policies` | 财务制度 | 配额型 | quota/used/remaining | -| `knowledge-documents` | 知识文档 | 配额型 | quota/used/remaining | -| `webhook` | Webhook | 开关型 | enabled | -| `openapi` | Open API | 开关型 | enabled | -| `private-model` | 私有模型接入 | 开关型 | enabled | -| `ai-fill` | AI 智能填单 | 开关型 | enabled | - ---- - -## CLI 命令速查 - -```bash -# 认证 / 身份 -ekb sealai whoami # 查看 SealAI 用户身份 + 租户信息 -ekb sealai whoami --refresh # 强制刷新 Bearer token 后查看 -ekb sealai whoami --corp # 查看指定企业 - -# 计费 -ekb sealai billing # 查看订阅状态 + 功能配额表 -ekb sealai billing --corp - -# 审核规则 -ekb sealai rules # 查看草稿区规则列表 -ekb sealai rule-create # 新建草稿规则(交互式) -ekb sealai rule-create --desc "..." --scope "..." --strictness MUST_FOLLOW -ekb sealai rule-update --desc "..." -ekb sealai rule-delete - -# 版本历史 -ekb sealai versions # 查看已发布版本列表 - -# 知识文档 -ekb sealai knowledge-list # 查看知识文档列表 -ekb sealai knowledge-list --scenario audit --scenario fill -ekb sealai knowledge-get # 查看文档详情 -ekb sealai knowledge-create # 新建文档(交互式) -ekb sealai knowledge-create --title "..." --purpose "..." --content "..." -ekb sealai knowledge-update --title "新标题" -ekb sealai knowledge-update --disable -``` - ---- - -## 调用约定 - -- `commands/sealai/*` 只传 `corp_id`,不持有也不传递 `SealAiClient` -- `SealAiClient` 的创建、缓存、关闭完全由 `services/sealai/auth_service.py` 管理 -- 详细缓存设计见 `services/sealai/README.sealai.md` diff --git a/src/ekb_cli/commands/sealai/__init__.py b/src/ekb_cli/commands/sealai/__init__.py deleted file mode 100644 index 15d357b..0000000 --- a/src/ekb_cli/commands/sealai/__init__.py +++ /dev/null @@ -1,43 +0,0 @@ -"""sealai 子命令组 - -对应 CLI 命令: - ekb sealai whoami → 查看当前 SealAI 用户身份及租户信息 - ekb sealai billing → 查看当前企业 SealAI 订阅状态及功能配额 - ekb sealai rules → 查看草稿区审核规则列表 - ekb sealai rule-create → 新建草稿审核规则 - ekb sealai rule-update → 更新草稿审核规则 - ekb sealai rule-delete → 删除草稿审核规则 - ekb sealai versions → 查看已发布规则集版本历史 - ekb sealai knowledge-list → 查看知识文档列表 - ekb sealai knowledge-get → 查看单篇知识文档详情 - ekb sealai knowledge-create → 新建知识文档 - ekb sealai knowledge-update → 更新知识文档 -""" - -import typer -from ekb_cli.commands.sealai.whoami import cmd_whoami -from ekb_cli.commands.sealai.billing import cmd_billing -from ekb_cli.commands.sealai.rules import cmd_rules -from ekb_cli.commands.sealai.rule_create import cmd_rule_create -from ekb_cli.commands.sealai.rule_update import cmd_rule_update -from ekb_cli.commands.sealai.rule_delete import cmd_rule_delete -from ekb_cli.commands.sealai.versions import cmd_versions -from ekb_cli.commands.sealai.knowledge_list import cmd_knowledge_list -from ekb_cli.commands.sealai.knowledge_get import cmd_knowledge_get -from ekb_cli.commands.sealai.knowledge_create import cmd_knowledge_create -from ekb_cli.commands.sealai.knowledge_update import cmd_knowledge_update - -app = typer.Typer(help="SealAI 智能填单/审核平台管理") - -app.command("whoami")(cmd_whoami) -app.command("billing")(cmd_billing) -app.command("rules")(cmd_rules) -app.command("rule-create")(cmd_rule_create) -app.command("rule-update")(cmd_rule_update) -app.command("rule-delete")(cmd_rule_delete) -app.command("versions")(cmd_versions) -app.command("knowledge-list")(cmd_knowledge_list) -app.command("knowledge-get")(cmd_knowledge_get) -app.command("knowledge-create")(cmd_knowledge_create) -app.command("knowledge-update")(cmd_knowledge_update) - diff --git a/src/ekb_cli/commands/sealai/billing.py b/src/ekb_cli/commands/sealai/billing.py deleted file mode 100644 index d4f24a9..0000000 --- a/src/ekb_cli/commands/sealai/billing.py +++ /dev/null @@ -1,63 +0,0 @@ -"""sealai billing:查看 SealAI 订阅状态及功能配额 - -表现层:只负责 rich 格式化输出。 -业务逻辑委托给 services.sealai.billing_service。 -不感知 SealAiClient,corp_id 由 service 层统一解析。 -""" - -import typer -from rich.console import Console -from rich.table import Table -from rich import print as rprint - -from ekb_cli.services.sealai import query_billing_status - -console = Console() - - -def cmd_billing( - corp_id: str = typer.Option(None, "--corp", "-c", help="指定企业 corpId,默认使用当前企业"), -): - """查看当前企业 SealAI 订阅状态及各功能配额""" - status = query_billing_status(corp_id=corp_id) - - # 订阅信息 - if status.subscriptions: - sub = status.subscriptions[0] - console.print(f"\n[bold]订阅信息[/bold]") - table = Table(show_header=False, box=None, padding=(0, 2)) - table.add_column("字段", style="dim") - table.add_column("值") - table.add_row("订阅 ID", sub.id) - table.add_row("状态", "[green]生效中[/green]" if sub.status == "active" else sub.status) - table.add_row("开始日期", sub.startDate) - console.print(table) - else: - rprint("[yellow]当前企业无有效订阅[/yellow]") - - # 功能配额表 - if not status.features: - return - - console.print(f"\n[bold]功能配额[/bold]") - feat_table = Table(show_header=True, header_style="bold") - feat_table.add_column("功能名称") - feat_table.add_column("code", style="dim") - feat_table.add_column("状态/用量", justify="right") - - for f in status.features: - if f.enabled is not None: - # 开关型 - usage = "[green]已开启[/green]" if f.enabled else "[red]未开启[/red]" - elif f.balance is not None: - # 余额型 - usage = f"余额 {f.balance}/{f.totalQuota}" - elif f.quota is not None: - # 配额型 - usage = f"已用 {f.used}/{f.quota}" - else: - usage = "-" - feat_table.add_row(f.name, f.code, usage) - - console.print(feat_table) - console.print() diff --git a/src/ekb_cli/commands/sealai/knowledge_create.py b/src/ekb_cli/commands/sealai/knowledge_create.py deleted file mode 100644 index 45152c6..0000000 --- a/src/ekb_cli/commands/sealai/knowledge_create.py +++ /dev/null @@ -1,56 +0,0 @@ -"""sealai knowledge-create:新建知识文档 - -表现层:交互式输入 + rich 输出。 -业务逻辑委托给 services.sealai.knowledge_service。 -不感知 SealAiClient,corp_id 由 service 层统一解析。 -""" - -import typer -from rich import print as rprint - -from ekb_cli.services.sealai import add_article - - -def cmd_knowledge_create( - corp_id: str = typer.Option(None, "--corp", "-c", help="指定企业 corpId,默认使用当前企业"), - title: str = typer.Option(None, "--title", "-t", help="文档标题"), - purpose: str = typer.Option(None, "--purpose", "-p", help="适用说明"), - content: str = typer.Option(None, "--content", help="正文内容(Markdown),不传则交互输入"), - content_type: str = typer.Option("policy", "--type", help="内容类型,默认 policy"), - status: str = typer.Option("published", "--status", help="状态:published / draft"), - scenarios: list[str] = typer.Option([], "--scenario", "-s", help="适用场景(可多次传),如 -s audit -s fill"), - tags: list[str] = typer.Option([], "--tag", help="标签(可多次传),如 --tag __all__"), -): - """新建知识文档""" - if title is None: - title = typer.prompt("文档标题").strip() - if purpose is None: - purpose = typer.prompt("适用说明").strip() - if not title or not purpose: - rprint("[red]标题和适用说明不能为空[/red]") - raise typer.Exit(1) - if content is None: - rprint("[dim]请输入正文内容(Markdown 格式),输入完毕后按 Enter 再输入 EOF 结束:[/dim]") - lines = [] - try: - while True: - line = input() - if line == "EOF": - break - lines.append(line) - except EOFError: - pass - content = "\n".join(lines) - - article = add_article( - corp_id=corp_id, - title=title, - purpose=purpose, - content=content, - content_type=content_type, - status=status, - scenarios=list(scenarios) or None, - tags=list(tags) or None, - ) - rprint(f"[green]✓[/green] 文档已创建:[bold]{article.title}[/bold]") - rprint(f" ID:[dim]{article.id}[/dim]") diff --git a/src/ekb_cli/commands/sealai/knowledge_get.py b/src/ekb_cli/commands/sealai/knowledge_get.py deleted file mode 100644 index c4e8c7f..0000000 --- a/src/ekb_cli/commands/sealai/knowledge_get.py +++ /dev/null @@ -1,63 +0,0 @@ -"""sealai knowledge-get:查看单篇知识文档详情 - -表现层:只负责 rich 格式化输出。 -业务逻辑委托给 services.sealai.knowledge_service。 -不感知 SealAiClient,corp_id 由 service 层统一解析。 -""" - -import typer -from datetime import datetime, timezone -from rich.console import Console -from rich.panel import Panel -from rich.markdown import Markdown -from rich.table import Table -from rich import print as rprint - -from ekb_cli.services.sealai import get_article_detail - -console = Console() - -_SCENARIO_LABEL = { - "audit": "审核", - "fill": "填单", -} -_STATUS_LABEL = { - "published": "[green]已发布[/green]", - "draft": "[yellow]草稿[/yellow]", -} - - -def cmd_knowledge_get( - article_id: str = typer.Argument(..., help="文档 ID"), - corp_id: str = typer.Option(None, "--corp", "-c", help="指定企业 corpId,默认使用当前企业"), -): - """查看单篇知识文档详情(含正文 Markdown 渲染)""" - a = get_article_detail(corp_id=corp_id, article_id=article_id) - - scenes = " / ".join(_SCENARIO_LABEL.get(s, s) for s in a.scenarios) - status = _STATUS_LABEL.get(a.status, a.status) - enabled = "[green]启用[/green]" if a.enabled else "[red]已禁用[/red]" - tags_str = "、".join(a.tags) if a.tags else "[dim]无[/dim]" - - # 元信息表格 - meta = Table.grid(padding=(0, 2)) - meta.add_column(style="dim") - meta.add_column() - meta.add_row("ID", a.id) - meta.add_row("标题", a.title) - meta.add_row("适用说明", a.purpose) - meta.add_row("内容类型", a.contentType) - meta.add_row("适用场景", scenes) - meta.add_row("标签", tags_str) - meta.add_row("状态", f"{status} {enabled}") - - if a.createdAt: - ts = datetime.fromtimestamp(a.createdAt / 1000, tz=timezone.utc).strftime("%Y-%m-%d %H:%M") - meta.add_row("创建时间", f"{ts} by {a.createdByName}") - if a.updatedAt: - ts = datetime.fromtimestamp(a.updatedAt / 1000, tz=timezone.utc).strftime("%Y-%m-%d %H:%M") - meta.add_row("更新时间", f"{ts} by {a.updatedByName}") - - console.print(meta) - console.print() - console.print(Panel(Markdown(a.content), title="[bold]正文内容[/bold]", border_style="dim")) diff --git a/src/ekb_cli/commands/sealai/knowledge_list.py b/src/ekb_cli/commands/sealai/knowledge_list.py deleted file mode 100644 index 355c24e..0000000 --- a/src/ekb_cli/commands/sealai/knowledge_list.py +++ /dev/null @@ -1,70 +0,0 @@ -"""sealai knowledge-list:查看知识文档列表 - -表现层:只负责 rich 格式化输出。 -业务逻辑委托给 services.sealai.knowledge_service。 -不感知 SealAiClient,corp_id 由 service 层统一解析。 -""" - -import typer -from datetime import datetime, timezone -from rich.console import Console -from rich.table import Table -from rich.panel import Panel -from rich.markdown import Markdown -from rich import print as rprint - -from ekb_cli.services.sealai import get_articles - -console = Console() - -_SCENARIO_LABEL = { - "audit": "审核", - "fill": "填单", -} -_STATUS_LABEL = { - "published": "[green]已发布[/green]", - "draft": "[yellow]草稿[/yellow]", -} - - -def cmd_knowledge_list( - corp_id: str = typer.Option(None, "--corp", "-c", help="指定企业 corpId,默认使用当前企业"), - scenario: str = typer.Option(None, "--scenario", "-s", help="按场景过滤:audit / fill"), - limit: int = typer.Option(20, "--limit", "-n", help="返回数量上限"), - detail: bool = typer.Option(False, "--detail", help="展开每篇文档的正文内容"), -): - """查看知识文档列表""" - scenarios = [scenario] if scenario else None - data = get_articles(corp_id=corp_id, scenarios=scenarios, limit=limit) - - if not data.articles: - rprint("[yellow]暂无知识文档[/yellow]") - raise typer.Exit() - - if not detail: - table = Table(title=f"知识文档(共 {data.total or len(data.articles)} 篇)", show_lines=True) - table.add_column("ID", style="dim", no_wrap=True) - table.add_column("标题") - table.add_column("适用说明", max_width=30) - table.add_column("场景") - table.add_column("状态") - table.add_column("更新时间") - - for a in data.articles: - scenes = " / ".join(_SCENARIO_LABEL.get(s, s) for s in a.scenarios) - status = _STATUS_LABEL.get(a.status, a.status) - ts = datetime.fromtimestamp(a.updatedAt / 1000, tz=timezone.utc).strftime("%Y-%m-%d %H:%M") if a.updatedAt else "-" - table.add_row(a.id[:8] + "…", a.title, a.purpose, scenes, status, ts) - - console.print(table) - console.print("[dim]查看正文内容:ekb sealai knowledge-list --detail[/dim]") - console.print("[dim]查看单篇详情:ekb sealai knowledge-get [/dim]") - else: - for a in data.articles: - scenes = " / ".join(_SCENARIO_LABEL.get(s, s) for s in a.scenarios) - status = _STATUS_LABEL.get(a.status, a.status) - console.print(Panel( - Markdown(a.content), - title=f"[bold]{a.title}[/bold] {status} [dim]{scenes}[/dim]", - subtitle=f"[dim]ID: {a.id}[/dim]", - )) diff --git a/src/ekb_cli/commands/sealai/knowledge_update.py b/src/ekb_cli/commands/sealai/knowledge_update.py deleted file mode 100644 index 1499910..0000000 --- a/src/ekb_cli/commands/sealai/knowledge_update.py +++ /dev/null @@ -1,48 +0,0 @@ -"""sealai knowledge-update:更新知识文档 - -表现层:只负责参数解析 + rich 输出。 -业务逻辑委托给 services.sealai.knowledge_service。 -不感知 SealAiClient,corp_id 由 service 层统一解析。 -""" - -import typer -from typing import Optional -from rich import print as rprint - -from ekb_cli.services.sealai import edit_article - - -def cmd_knowledge_update( - article_id: str = typer.Argument(..., help="文档 ID"), - corp_id: str = typer.Option(None, "--corp", "-c", help="指定企业 corpId,默认使用当前企业"), - title: str = typer.Option(None, "--title", "-t", help="新标题"), - purpose: str = typer.Option(None, "--purpose", "-p", help="新适用说明"), - content: str = typer.Option(None, "--content", help="新正文内容(Markdown)"), - content_type: str = typer.Option(None, "--type", help="新内容类型"), - status: str = typer.Option(None, "--status", help="新状态:published / draft"), - enable: bool = typer.Option(None, "--enable/--disable", help="启用或停用文档"), - scenarios: Optional[list[str]] = typer.Option(None, "--scenario", "-s", help="新适用场景(可多次传,会整体替换)"), - tags: Optional[list[str]] = typer.Option(None, "--tag", help="新标签(可多次传,会整体替换)"), -): - """更新知识文档(只传需要修改的字段)""" - # enable 是 Optional[bool],typer 的 --enable/--disable 未传时值为 None - any_field = any([title, purpose, content, content_type, status, scenarios, tags, enable is not None]) - if not any_field: - rprint("[yellow]未指定任何修改字段,无需更新[/yellow]") - raise typer.Exit() - - article = edit_article( - corp_id=corp_id, - article_id=article_id, - title=title, - purpose=purpose, - content=content, - content_type=content_type, - status=status, - enabled=enable, - scenarios=list(scenarios) if scenarios is not None else None, - tags=list(tags) if tags is not None else None, - ) - enabled_str = "[green]启用[/green]" if article.enabled else "[red]已停用[/red]" - rprint(f"[green]✓[/green] 文档已更新:[bold]{article.title}[/bold] {enabled_str}") - rprint(f" ID:[dim]{article.id}[/dim]") diff --git a/src/ekb_cli/commands/sealai/rule_create.py b/src/ekb_cli/commands/sealai/rule_create.py deleted file mode 100644 index 0d56dd1..0000000 --- a/src/ekb_cli/commands/sealai/rule_create.py +++ /dev/null @@ -1,35 +0,0 @@ -"""sealai rule-create:新建草稿审核规则 - -表现层:交互式输入 + rich 输出。 -业务逻辑委托给 services.sealai.rules_service。 -不感知 SealAiClient,corp_id 由 service 层统一解析。 -""" - -import typer -from rich import print as rprint - -from ekb_cli.services.sealai import add_draft_rule - -_STRICTNESS_CHOICES = ["MUST_FOLLOW", "SHOULD_FOLLOW", "SUGGESTION"] - - -def cmd_rule_create( - corp_id: str = typer.Option(None, "--corp", "-c", help="指定企业 corpId,默认使用当前企业"), - description: str = typer.Option(None, "--description", "-d", help="规则描述"), - scope: str = typer.Option(None, "--scope", "-s", help="适用场景(费用类型等)"), - strictness: str = typer.Option( - "MUST_FOLLOW", "--strictness", - help="严格程度:MUST_FOLLOW / SHOULD_FOLLOW / SUGGESTION", - ), -): - """新建草稿审核规则""" - if description is None: - description = typer.prompt("规则描述").strip() - if scope is None: - scope = typer.prompt("适用场景").strip() - if not description or not scope: - rprint("[red]描述和适用场景不能为空[/red]") - raise typer.Exit(1) - - rule = add_draft_rule(corp_id=corp_id, description=description, scope=scope, strictness=strictness) - rprint(f"[green]✓[/green] 规则已创建:[bold]{rule.description}[/bold](ID: {rule.id})") diff --git a/src/ekb_cli/commands/sealai/rule_delete.py b/src/ekb_cli/commands/sealai/rule_delete.py deleted file mode 100644 index 2fad472..0000000 --- a/src/ekb_cli/commands/sealai/rule_delete.py +++ /dev/null @@ -1,27 +0,0 @@ -"""sealai rule-delete:删除草稿审核规则 - -表现层:二次确认 + rich 输出。 -业务逻辑委托给 services.sealai.rules_service。 -不感知 SealAiClient,corp_id 由 service 层统一解析。 -""" - -import typer -from rich import print as rprint - -from ekb_cli.services.sealai import remove_draft_rule - - -def cmd_rule_delete( - rule_id: str = typer.Argument(..., help="草稿规则 ID"), - yes: bool = typer.Option(False, "--yes", "-y", help="跳过确认直接删除"), - corp_id: str = typer.Option(None, "--corp", "-c", help="指定企业 corpId,默认使用当前企业"), -): - """删除草稿审核规则""" - if not yes: - confirmed = typer.confirm(f"确定要删除规则 {rule_id}?") - if not confirmed: - rprint("[dim]已取消[/dim]") - raise typer.Exit() - - remove_draft_rule(corp_id=corp_id, rule_id=rule_id) - rprint(f"[green]✓[/green] 规则 {rule_id} 已删除") diff --git a/src/ekb_cli/commands/sealai/rule_update.py b/src/ekb_cli/commands/sealai/rule_update.py deleted file mode 100644 index a8329e8..0000000 --- a/src/ekb_cli/commands/sealai/rule_update.py +++ /dev/null @@ -1,35 +0,0 @@ -"""sealai rule-update:更新草稿审核规则 - -表现层:只负责参数解析 + rich 输出。 -业务逻辑委托给 services.sealai.rules_service。 -不感知 SealAiClient,corp_id 由 service 层统一解析。 -""" - -import typer -from rich import print as rprint - -from ekb_cli.services.sealai import edit_draft_rule - - -def cmd_rule_update( - rule_id: str = typer.Argument(..., help="草稿规则 ID"), - description: str = typer.Option(None, "--description", "-d", help="新描述"), - scope: str = typer.Option(None, "--scope", "-s", help="新适用场景"), - strictness: str = typer.Option( - None, "--strictness", - help="新严格程度:MUST_FOLLOW / SHOULD_FOLLOW / SUGGESTION", - ), - corp_id: str = typer.Option(None, "--corp", "-c", help="指定企业 corpId,默认使用当前企业"), -): - """更新草稿审核规则(只传要修改的字段)""" - if not any([description, scope, strictness]): - rprint("[yellow]未指定任何修改字段,无需更新[/yellow]") - raise typer.Exit() - - rule = edit_draft_rule( - corp_id=corp_id, rule_id=rule_id, - description=description, - scope=scope, - strictness=strictness, - ) - rprint(f"[green]✓[/green] 规则已更新:[bold]{rule.description}[/bold](ID: {rule.id})") diff --git a/src/ekb_cli/commands/sealai/rules.py b/src/ekb_cli/commands/sealai/rules.py deleted file mode 100644 index 1ebfe9e..0000000 --- a/src/ekb_cli/commands/sealai/rules.py +++ /dev/null @@ -1,46 +0,0 @@ -"""sealai rules:查看草稿规则列表 - -表现层:只负责 rich 格式化输出。 -业务逻辑委托给 services.sealai.rules_service。 -不感知 SealAiClient,corp_id 由 service 层统一解析。 -""" - -import typer -from rich.console import Console -from rich.table import Table -from rich import print as rprint - -from ekb_cli.services.sealai import get_draft_rules - -console = Console() - -_STRICTNESS_LABEL = { - "MUST_FOLLOW": "[red]必须遵守[/red]", - "SHOULD_FOLLOW": "[yellow]应当遵守[/yellow]", - "SUGGESTION": "[dim]建议[/dim]", -} - - -def cmd_rules( - corp_id: str = typer.Option(None, "--corp", "-c", help="指定企业 corpId,默认使用当前企业"), -): - """查看草稿区所有审核规则""" - data = get_draft_rules(corp_id=corp_id) - - if not data.rules: - rprint("[yellow]草稿区暂无审核规则[/yellow]") - raise typer.Exit() - - table = Table(title=f"草稿审核规则(共 {len(data.rules)} 条)", show_lines=True) - table.add_column("ID", style="dim", no_wrap=True) - table.add_column("描述") - table.add_column("适用场景") - table.add_column("严格程度") - - for r in data.rules: - label = _STRICTNESS_LABEL.get(r.strictness, r.strictness) - table.add_row(r.id[:8] + "…", r.description, r.scope, label) - - console.print(table) - if data.hasPendingDeletes: - rprint("[yellow]⚠ 草稿区有待删除规则,发布后生效[/yellow]") diff --git a/src/ekb_cli/commands/sealai/versions.py b/src/ekb_cli/commands/sealai/versions.py deleted file mode 100644 index 36a154d..0000000 --- a/src/ekb_cli/commands/sealai/versions.py +++ /dev/null @@ -1,66 +0,0 @@ -"""sealai versions:查看已发布规则集版本历史 - -表现层:只负责 rich 格式化输出。 -业务逻辑委托给 services.sealai.rules_service。 -不感知 SealAiClient,corp_id 由 service 层统一解析。 -""" - -import typer -from datetime import datetime, timezone -from rich.console import Console -from rich.table import Table -from rich.tree import Tree -from rich import print as rprint - -from ekb_cli.services.sealai import get_published_versions - -console = Console() - -_STRICTNESS_LABEL = { - "MUST_FOLLOW": "必须", - "SHOULD_FOLLOW": "应当", - "SUGGESTION": "建议", -} - - -def cmd_versions( - corp_id: str = typer.Option(None, "--corp", "-c", help="指定企业 corpId,默认使用当前企业"), - detail: bool = typer.Option(False, "--detail", help="展开每个版本的规则列表"), -): - """查看已发布规则集版本历史""" - versions = get_published_versions(corp_id=corp_id) - - if not versions: - rprint("[yellow]暂无已发布版本[/yellow]") - raise typer.Exit() - - if not detail: - table = Table(title=f"已发布版本(共 {len(versions)} 个)") - table.add_column("版本号", justify="right") - table.add_column("版本名称") - table.add_column("发布者") - table.add_column("规则数", justify="right") - table.add_column("发布时间") - - for v in versions: - ts = datetime.fromtimestamp(v.publishedAt / 1000, tz=timezone.utc).strftime("%Y-%m-%d %H:%M") - table.add_row( - str(v.versionNumber), - v.versionName, - v.publishedByName, - str(len(v.rules)), - ts, - ) - console.print(table) - console.print("[dim]查看规则详情:ekb sealai versions --detail[/dim]") - else: - for v in versions: - ts = datetime.fromtimestamp(v.publishedAt / 1000, tz=timezone.utc).strftime("%Y-%m-%d %H:%M") - tree = Tree( - f"[bold cyan]版本 {v.versionNumber}[/bold cyan] {v.versionName} " - f"[dim]{v.publishedByName} · {ts}[/dim]" - ) - for r in v.rules: - label = _STRICTNESS_LABEL.get(r.strictness, r.strictness) - tree.add(f"[green]{label}[/green] {r.description} [dim]({r.scope})[/dim]") - console.print(tree) diff --git a/src/ekb_cli/commands/sealai/whoami.py b/src/ekb_cli/commands/sealai/whoami.py deleted file mode 100644 index 36e7152..0000000 --- a/src/ekb_cli/commands/sealai/whoami.py +++ /dev/null @@ -1,47 +0,0 @@ -"""sealai whoami:查看当前 SealAI 用户身份 - -表现层:只负责 rich 格式化输出。 -业务逻辑(含 get_me 调用)完全委托给 services.sealai.get_whoami, -不直接导入 api 层任何函数。 -""" - -import typer -from rich.console import Console -from rich.table import Table - -from ekb_cli.services.sealai import get_whoami - -console = Console() - - -def cmd_whoami( - corp_id: str = typer.Option(None, "--corp", "-c", help="指定企业 corpId,默认使用当前企业"), - refresh: bool = typer.Option(False, "--refresh", help="强制刷新 SealAI Bearer token"), -): - """查看当前 SealAI 用户身份及租户信息""" - me = get_whoami(corp_id=corp_id, force_refresh=refresh) - - user = me.user - tenant = me.tenant - - # 用户信息 - console.print(f"\n[bold]SealAI 用户[/bold]") - table = Table(show_header=False, box=None, padding=(0, 2)) - table.add_column("字段", style="dim") - table.add_column("值") - table.add_row("姓名", user.name) - table.add_row("用户 ID", user.id) - table.add_row("是否管理员", "[green]是[/green]" if user.isAdmin else "否") - table.add_row("快报 staffId", user.providerUserId) - console.print(table) - - # 租户信息 - console.print(f"\n[bold]租户(企业)[/bold]") - table2 = Table(show_header=False, box=None, padding=(0, 2)) - table2.add_column("字段", style="dim") - table2.add_column("值") - table2.add_row("企业名称", tenant.name) - table2.add_row("租户 Slug", tenant.tenantSlug) - table2.add_row("企业 ID(快报)", tenant.hoseCorpConfig.corporationId) - console.print(table2) - console.print() diff --git a/src/ekb_cli/commands/serve.py b/src/ekb_cli/commands/serve.py deleted file mode 100644 index d03a526..0000000 --- a/src/ekb_cli/commands/serve.py +++ /dev/null @@ -1,38 +0,0 @@ -"""ekb serve:启动 HTTP API Server - -将 ekb-cli 的功能以 HTTP API 形式暴露, -供其他服务、AI Agent 或脚本调用,返回结构化 JSON 数据。 -""" - -import typer -from rich import print as rprint - - -def cmd_serve( - host: str = typer.Option("127.0.0.1", "--host", "-h", help="监听地址"), - port: int = typer.Option(9528, "--port", "-p", help="监听端口"), - reload: bool = typer.Option(False, "--reload", help="开发模式:文件变更时自动重载"), -): - """启动 HTTP API Server(FastAPI + uvicorn) - - 启动后可访问: - \b - - API 文档:http://:/docs - - 所有接口与 CLI 命令一一对应,返回结构化 JSON - """ - try: - import uvicorn - except ImportError: - rprint("[red]缺少 uvicorn,请执行:uv add uvicorn[standard][/red]") - raise typer.Exit(1) - - from ekb_cli.server import create_app - - rprint(f"[bold green]ekb-cli API Server[/bold green]") - rprint(f" 地址:http://{host}:{port}") - rprint(f" 文档:[link=http://{host}:{port}/docs]http://{host}:{port}/docs[/link]") - rprint(f" 模式:{'[yellow]开发(--reload)[/yellow]' if reload else '生产'}") - rprint("") - - app = create_app() - uvicorn.run(app, host=host, port=port, reload=reload) diff --git a/src/ekb_cli/config.py b/src/ekb_cli/config.py deleted file mode 100644 index e8b49a6..0000000 --- a/src/ekb_cli/config.py +++ /dev/null @@ -1,65 +0,0 @@ -"""配置管理:存储多企业认证信息到 ~/.config/ekb-cli/config.json""" - -import json -from pathlib import Path -from typing import Optional - -CONFIG_DIR = Path.home() / ".config" / "ekb-cli" -CONFIG_FILE = CONFIG_DIR / "config.json" - - -def _load() -> dict: - if not CONFIG_FILE.exists(): - return {"current": None, "corps": {}} - return json.loads(CONFIG_FILE.read_text()) - - -def _save(data: dict) -> None: - CONFIG_DIR.mkdir(parents=True, exist_ok=True) - CONFIG_FILE.write_text(json.dumps(data, indent=2, ensure_ascii=False)) - - -def get_all() -> dict: - return _load() - - -def get_current_corp_id() -> Optional[str]: - return _load().get("current") - - -def get_current_corp() -> Optional[dict]: - data = _load() - corp_id = data.get("current") - if not corp_id: - return None - return data["corps"].get(corp_id) - - -def get_corp(corp_id: str) -> Optional[dict]: - """按 corp_id 获取指定企业认证信息(不要求是当前企业)。""" - return _load()["corps"].get(corp_id) - - -def add_corp(corp_id: str, name: str, access_token: str, staff_id: str) -> None: - data = _load() - data["corps"][corp_id] = {"name": name, "access_token": access_token, "staff_id": staff_id} - if not data.get("current"): - data["current"] = corp_id - _save(data) - - -def use_corp(corp_id: str) -> None: - data = _load() - if corp_id not in data["corps"]: - raise ValueError(f"企业 {corp_id} 不存在,请先用 `ekb auth add` 添加") - data["current"] = corp_id - _save(data) - - -def remove_corp(corp_id: str) -> None: - data = _load() - data["corps"].pop(corp_id, None) - if data.get("current") == corp_id: - remaining = list(data["corps"].keys()) - data["current"] = remaining[0] if remaining else None - _save(data) diff --git a/src/ekb_cli/errors.py b/src/ekb_cli/errors.py deleted file mode 100644 index 678353f..0000000 --- a/src/ekb_cli/errors.py +++ /dev/null @@ -1,65 +0,0 @@ -"""统一业务异常体系 - -所有层(api / service / server / commands)统一使用此模块的异常类。 - -- CLI 层:捕获 EkbError,用 rich 红字输出并 Exit(1) -- Server 层:捕获 EkbError,转换为对应 HTTP 状态码的 JSON 响应 -- API 层:捕获 httpx 错误,转换为 AuthenticationError / ApiResponseError -""" - - -class EkbError(Exception): - """所有业务异常的基类""" - - def __init__(self, message: str, code: int = -1): - self.message = message - self.code = code - super().__init__(message) - - -class NotLoggedInError(EkbError): - """未登录/未配置认证。 - - 可传入自定义 message 说明具体是哪个企业未配置; - 不传则使用通用提示,引导用户执行 `ekb auth add`。 - """ - - _DEFAULT = "未登录,请先执行 `ekb auth add` 添加企业认证" - - def __init__(self, message: str | None = None) -> None: - super().__init__(message or self._DEFAULT, code=401) - - -class AuthenticationError(EkbError): - """认证失败:token 过期或无效(HTTP 401)""" - - def __init__(self, message: str = "认证已过期,请重新执行 `ekb auth add` 更新 token") -> None: - super().__init__(message, code=401) - - -class NotFoundError(EkbError): - """目标资源不存在(HTTP 404)""" - - def __init__(self, resource: str, ref: str) -> None: - super().__init__(f"{resource} 不存在:{ref}", code=404) - - -class ConflictError(EkbError): - """资源冲突,例如名称重复(HTTP 409)""" - - def __init__(self, message: str) -> None: - super().__init__(message, code=409) - - -class InputError(EkbError): - """参数/输入校验失败(HTTP 422)""" - - def __init__(self, message: str) -> None: - super().__init__(message, code=422) - - -class ApiResponseError(EkbError): - """快报 API 返回非 0 业务码""" - - def __init__(self, api_code: int, msg: str) -> None: - super().__init__(f"快报 API 错误 [{api_code}]: {msg}", code=api_code) diff --git a/src/ekb_cli/server/README.server.md b/src/ekb_cli/server/README.server.md deleted file mode 100644 index 425a471..0000000 --- a/src/ekb_cli/server/README.server.md +++ /dev/null @@ -1,47 +0,0 @@ -# server/ — HTTP API Server(表现层) - -## 职责边界 - -- **只做 HTTP 适配**:路由注册、Query/Body 参数绑定、JSON 序列化、HTTP 状态码映射。 -- **不做业务编排**:调用 `services.*` 完成,路由函数体保持简短。 -- **不定义请求/响应模型**:所有 `BaseModel` 子类统一放在对应的 `schemas.py` 中, - 路由文件只做 import,不在文件内 inline 定义。 - -## 目录结构 - -``` -server/ -├── __init__.py # create_app() 工厂;全局 EkbError → HTTP 异常处理器 -├── deps.py # FastAPI 依赖注入:ClientDep(EkbClient) -├── auth_router.py # /auth/* 路由 -├── agent_router.py # /agents/* 路由 -├── rule_router.py # /rules/* 路由 -└── sealai_router.py # /sealai/* 路由 -``` - -## 依赖约定 - -``` -server/* → services/* ✅ 允许 -server/deps.py → api.get_client ✅ 允许(专属基础设施职责) -server/* → api.*(业务函数) ❌ 禁止(边界穿透) -``` - -## 请求模型归属规则 - -| 模型类型 | 存放位置 | -|---|---| -| 快报 API 响应模型 | `api/schemas.py` | -| SealAI API 响应模型 | `api/sealai/schemas.py` | -| Server 请求/响应模型 | 同上,在文件末尾「Server 请求模型」节 | - -## 异常处理 - -`server/__init__.py` 中注册了全局 handler: - -- `EkbError` → `code` 字段映射 HTTP 状态码,`message` 字段作为 `detail` 返回 -- 路由函数内**不应**局部 catch `EkbError` - -## Swagger UI - -Server 启动后访问:`http://127.0.0.1:9528/docs` diff --git a/src/ekb_cli/server/__init__.py b/src/ekb_cli/server/__init__.py deleted file mode 100644 index fcfeed5..0000000 --- a/src/ekb_cli/server/__init__.py +++ /dev/null @@ -1,56 +0,0 @@ -"""FastAPI 应用工厂 - -create_app() 创建并返回完整配置的 FastAPI 实例: -- 注册 auth / agent / rule / sealai 四个路由组 -- 统一 EkbError 异常处理(转 HTTP 状态码 + JSON 响应) -""" - -from fastapi import FastAPI, Request -from fastapi.responses import JSONResponse - -from ekb_cli.errors import EkbError - - -def create_app() -> FastAPI: - """创建 FastAPI 应用实例""" - app = FastAPI( - title="ekb-cli API Server", - description=( - "快报(ekuaibao)命令行工具的 HTTP 中转站。\n\n" - "与 `ekb` CLI 共享同一套 service 层逻辑,接口和命令一一对应。\n\n" - "认证信息从 `~/.config/ekb-cli/config.json` 读取," - "启动前请确保已执行 `ekb auth add`。" - ), - version="0.1.0", - ) - - # ── 注册路由 ────────────────────────────────────────────── - from ekb_cli.server.auth_router import router as auth_router - from ekb_cli.server.agent_router import router as agent_router - from ekb_cli.server.rule_router import router as rule_router - from ekb_cli.server.sealai_router import router as sealai_router - from ekb_cli.server.platform_router import router as platform_router - - app.include_router(auth_router, prefix="/auth", tags=["auth"]) - app.include_router(agent_router, prefix="/agents", tags=["agent"]) - app.include_router(rule_router, prefix="/rules", tags=["rule"]) - app.include_router(sealai_router, prefix="/sealai", tags=["sealai"]) - app.include_router(platform_router, prefix="/platforms", tags=["platform"]) - - # ── 统一异常处理:EkbError → HTTP JSON ────────────────── - # code → HTTP status 的映射表 - _STATUS_MAP = {401: 401, 404: 404, 409: 409, 422: 422} - - @app.exception_handler(EkbError) - async def ekb_error_handler(request: Request, exc: EkbError) -> JSONResponse: - status = _STATUS_MAP.get(exc.code, 500) - return JSONResponse( - status_code=status, - content={"success": False, "error": exc.message, "code": exc.code}, - ) - - @app.get("/", include_in_schema=False) - async def root(): - return {"service": "ekb-cli API Server", "docs": "/docs"} - - return app diff --git a/src/ekb_cli/server/agent_router.py b/src/ekb_cli/server/agent_router.py deleted file mode 100644 index e983f09..0000000 --- a/src/ekb_cli/server/agent_router.py +++ /dev/null @@ -1,87 +0,0 @@ -"""Server:Agent 路由 - -对应 CLI 命令: - ekb agent list → GET /agents - ekb agent get → GET /agents/{agent_id} - ekb agent create → POST /agents - ekb agent copy → POST /agents/{agent_id}/copy - ekb agent update → PATCH /agents/{agent_id} - ekb agent delete → DELETE /agents/{agent_id} - -高阶接口(CLI 暂无对应命令): - GET /agents/dedup-rules → 所有 Agent 关联规则去重列表 -""" - -from fastapi import APIRouter - -from ekb_cli.server.deps import ClientDep -from ekb_cli.services import ( - list_agents, - get_agent, - create_agent, - copy_agent, - update_agent, - delete_agent, - get_dedup_rules_across_agents, - AgentCreateInput, - AgentUpdateInput, -) -from ekb_cli.api.schemas import AgentCreateRequest, AgentUpdateRequest - -router = APIRouter() - - -@router.get("", summary="列出所有 Agent") -def route_list_agents(client: ClientDep): - page = list_agents(client) - return {"total": page.totalItems, "items": [item.model_dump() for item in page.items]} - - -@router.get("/dedup-rules", summary="获取所有 Agent 关联的去重规则") -def route_dedup_rules(client: ClientDep): - """遍历所有 Agent,汇总其关联规则并去重(按首次出现顺序)""" - rules = get_dedup_rules_across_agents(client) - return {"total": len(rules), "items": [r.model_dump() for r in rules]} - - -@router.get("/{agent_id}", summary="获取 Agent 详情") -def route_get_agent(agent_id: str, client: ClientDep): - return get_agent(client, agent_id).model_dump() - - -@router.post("", summary="新建 Agent") -def route_create_agent(body: AgentCreateRequest, client: ClientDep): - inp = AgentCreateInput( - name=body.name, - description=body.description, - mode=body.mode, - sampling_rate=body.sampling_rate, - agree_terms=body.agree_terms, - reject_terms=body.reject_terms, - exempt_terms=body.exempt_terms, - review_terms=body.review_terms, - rule_ids=body.rule_ids, - icon=body.icon, - ) - return create_agent(client, inp).model_dump() - - -@router.post("/{agent_id}/copy", summary="复制 Agent") -def route_copy_agent(agent_id: str, client: ClientDep): - src, new = copy_agent(client, agent_id) - return {"source": src.model_dump(), "copy": new.model_dump()} - - -@router.patch("/{agent_id}", summary="更新 Agent(patch 式)") -def route_update_agent(agent_id: str, body: AgentUpdateRequest, client: ClientDep): - inp = AgentUpdateInput( - agent_id=agent_id, - **body.model_dump(exclude_unset=True), - ) - return update_agent(client, inp).model_dump() - - -@router.delete("/{agent_id}", summary="删除 Agent") -def route_delete_agent(agent_id: str, client: ClientDep): - detail = delete_agent(client, agent_id) - return {"success": True, "deleted": detail.model_dump()} diff --git a/src/ekb_cli/server/auth_router.py b/src/ekb_cli/server/auth_router.py deleted file mode 100644 index e13ed98..0000000 --- a/src/ekb_cli/server/auth_router.py +++ /dev/null @@ -1,54 +0,0 @@ -"""Server:Auth 路由 - -对应 CLI 命令: - ekb auth list → GET /auth/corps - ekb auth add → POST /auth/corps - ekb auth use → PUT /auth/corps/{corp_id}/use - ekb auth remove → DELETE /auth/corps/{corp_id} - ekb auth whoami → GET /auth/whoami - -注意:auth 接口不需要 EkbClient(操作本地配置文件), - 因此不注入 ClientDep。 -""" - -from fastapi import APIRouter - -from ekb_cli.services import auth_service -from ekb_cli.api.schemas import CorpAddRequest, CorpInfoResponse - -router = APIRouter() - - -@router.get("/corps", response_model=list[CorpInfoResponse], summary="列出所有已配置的企业") -def list_corps(): - corps = auth_service.list_corps() - return [CorpInfoResponse(corp_id=c.corp_id, name=c.name, is_current=c.is_current) for c in corps] - - -@router.post("/corps", response_model=CorpInfoResponse, summary="添加企业认证") -def add_corp(body: CorpAddRequest): - corp = auth_service.add_corp( - corp_id=body.corp_id, - name=body.name, - access_token=body.access_token, - staff_id=body.staff_id, - ) - return CorpInfoResponse(corp_id=corp.corp_id, name=corp.name, is_current=corp.is_current) - - -@router.put("/corps/{corp_id}/use", response_model=CorpInfoResponse, summary="切换当前企业") -def use_corp(corp_id: str): - corp = auth_service.use_corp(corp_id) - return CorpInfoResponse(corp_id=corp.corp_id, name=corp.name, is_current=corp.is_current) - - -@router.delete("/corps/{corp_id}", summary="删除企业认证") -def remove_corp(corp_id: str): - auth_service.remove_corp(corp_id) - return {"success": True, "corp_id": corp_id} - - -@router.get("/whoami", response_model=CorpInfoResponse, summary="查看当前企业") -def whoami(): - corp = auth_service.whoami() - return CorpInfoResponse(corp_id=corp.corp_id, name=corp.name, is_current=corp.is_current) diff --git a/src/ekb_cli/server/deps.py b/src/ekb_cli/server/deps.py deleted file mode 100644 index a679b88..0000000 --- a/src/ekb_cli/server/deps.py +++ /dev/null @@ -1,41 +0,0 @@ -"""FastAPI 依赖注入:获取已认证的 EkbClient / EasoClient - -用法: - from ekb_cli.server.deps import ClientDep, EasoClientDep - - @router.get("/foo") - def my_route(client: ClientDep): ... - - @router.get("/workflow") - def my_workflow_route(client: EasoClientDep): ... -""" - -from typing import Annotated, Generator - -from fastapi import Depends - -from ekb_cli.api import EkbClient, get_client -from ekb_cli.api.platform.easo_client import EasoClient, get_easo_client - - -def _get_ekb_client() -> Generator[EkbClient, None, None]: - """FastAPI 依赖:获取快报 HTTP 客户端,请求结束后自动关闭连接""" - client = get_client() # 未登录时抛出 NotLoggedInError → 被全局 handler 捕获 - try: - yield client - finally: - client.close() - - -def _get_easo_client() -> Generator[EasoClient, None, None]: - """FastAPI 依赖:获取 EASO 工作流客户端(Bearer JWT),请求结束后自动关闭连接""" - client = get_easo_client() - try: - yield client - finally: - client.close() - - -# 类型别名,路由函数用 `client: ClientDep` 即可,简洁且支持类型推断 -ClientDep = Annotated[EkbClient, Depends(_get_ekb_client)] -EasoClientDep = Annotated[EasoClient, Depends(_get_easo_client)] diff --git a/src/ekb_cli/server/platform_router.py b/src/ekb_cli/server/platform_router.py deleted file mode 100644 index 8e06b41..0000000 --- a/src/ekb_cli/server/platform_router.py +++ /dev/null @@ -1,108 +0,0 @@ -"""Server:Platform 路由 - -对应 CLI 命令: - ekb platform list → GET /platforms - ekb platform workflow-list → GET /platforms/{platform_id}/workflows - ekb platform workflow-get → GET /platforms/{platform_id}/workflows/{wf_id} - ekb platform workflow-stats → GET /platforms/{platform_id}/workflows/stats - ekb platform workflow-charge → GET /platforms/workflows/charge - -设计约定: -- 自建应用列表使用 EkbClient(主站认证) -- 工作流列表/统计/配额使用 EasoClient(EASO realm token) -- 工作流详情使用 PiperClient(EASO JWT + platformid Header) -""" - -from fastapi import APIRouter, Query - -from ekb_cli.server.deps import ClientDep, EasoClientDep -from ekb_cli.api.platform.piper_client import get_piper_client -from ekb_cli.services.platform import ( - list_platforms, - list_workflows, - get_workflow, - get_workflow_stats, - get_workflow_charge, - list_all_workflows, - find_workflows_by_task_type, -) - -router = APIRouter() - - -@router.get("", summary="列出所有自建应用") -def route_list_platforms(client: ClientDep): - """返回当前企业下所有启用的自建应用列表""" - platforms = list_platforms(client) - return {"total": len(platforms), "items": [p.model_dump() for p in platforms]} - - -@router.get("/workflows/charge", summary="企业工作流资源包配额") -def route_workflow_charge(client: EasoClientDep): - """获取企业工作流资源包总量/已用/剩余""" - return get_workflow_charge(client).model_dump() - - -@router.get("/workflows", summary="跨所有应用汇总工作流列表") -def route_list_all_workflows( - ekb_client: ClientDep, - easo_client: EasoClientDep, - enabled_only: bool = Query(True, description="只返回启用状态的工作流"), - task_type: str = Query(None, description="按节点类型过滤,如 http / stop"), -): - """聚合所有自建应用下的工作流;可选按节点类型过滤""" - if task_type: - matches = find_workflows_by_task_type(easo_client, ekb_client, task_type, enabled_only=enabled_only) - return { - "total": len(matches), - "task_type": task_type, - "items": [ - { - "platform_id": m.platform_id, - "platform_name": m.platform_name, - "workflow_id": m.workflow_id, - "workflow_name": m.workflow_name, - "matched_task_count": len(m.matched_tasks), - "matched_tasks": m.matched_tasks, - } - for m in matches - ], - } - items = list_all_workflows(easo_client, ekb_client, enabled_only=enabled_only) - return { - "total": len(items), - "items": [ - { - "platform_id": i.platform_id, - "platform_name": i.platform_name, - **i.workflow.model_dump(), - } - for i in items - ], - } - - -@router.get("/{platform_id}/workflows/stats", summary="工作流执行统计") -def route_workflow_stats(platform_id: str, client: EasoClientDep): - """获取指定自建应用的工作流执行统计(总数/成功/失败等)""" - return get_workflow_stats(client, platform_id).model_dump() - - -@router.get("/{platform_id}/workflows/{pipeline_id}", summary="工作流完整配置(节点列表)") -def route_get_workflow(platform_id: str, pipeline_id: str): - """获取指定工作流的完整配置,包含所有节点及其参数""" - with get_piper_client(platform_id) as client: - result = get_workflow(client, pipeline_id) - return result.model_dump() - - -@router.get("/{platform_id}/workflows", summary="列出指定应用的工作流") -def route_list_workflows( - platform_id: str, - client: EasoClientDep, - page: int = Query(1, ge=1, description="页码,从 1 开始"), - page_size: int = Query(20, ge=1, le=100, description="每页数量"), -): - """分页获取指定自建应用下的工作流列表""" - result = list_workflows(client, platform_id, page=page, page_size=page_size) - return result.model_dump() diff --git a/src/ekb_cli/server/rule_router.py b/src/ekb_cli/server/rule_router.py deleted file mode 100644 index 78956dd..0000000 --- a/src/ekb_cli/server/rule_router.py +++ /dev/null @@ -1,57 +0,0 @@ -"""Server:Rule 路由 - -对应 CLI 命令: - ekb agent rules → GET /rules - ekb agent rule-get → GET /rules/{rule_ref} - ekb agent rule-create → POST /rules - (暂无 CLI rule-update) → PATCH /rules/{rule_ref} -""" - -from typing import Optional - -from fastapi import APIRouter, Query - -from ekb_cli.server.deps import ClientDep -from ekb_cli.services import list_rules, get_rule, create_rule, update_rule -from ekb_cli.api.schemas import RuleCreateRequest, RuleUpdateRequest - -router = APIRouter() - - -@router.get("", summary="列出所有审核规则") -def route_list_rules( - client: ClientDep, - level: Optional[str] = Query(None, description="按风险等级筛选:严重 / 一般"), -): - page, items = list_rules(client, level=level) - return { - "total": page.totalItems, - "filtered": len(items), - "items": [r.model_dump() for r in items], - } - - -@router.get("/{rule_ref}", summary="获取单条规则详情(支持 ID 或编码)") -def route_get_rule(rule_ref: str, client: ClientDep): - """ - rule_ref 支持: - - 完整 ID(长字符串) - - 编码数字,如 "1" / "0001" / "#0001" - """ - return get_rule(client, rule_ref).model_dump() - - -@router.post("", summary="新建审核规则") -def route_create_rule(body: RuleCreateRequest, client: ClientDep): - return create_rule(client, body.purpose, body.description, body.level).model_dump() - - -@router.patch("/{rule_ref}", summary="更新审核规则(patch 式)") -def route_update_rule(rule_ref: str, body: RuleUpdateRequest, client: ClientDep): - return update_rule( - client, - rule_ref=rule_ref, - purpose=body.purpose, - description=body.description, - level=body.level, - ).model_dump() diff --git a/src/ekb_cli/server/sealai_router.py b/src/ekb_cli/server/sealai_router.py deleted file mode 100644 index 143e6b9..0000000 --- a/src/ekb_cli/server/sealai_router.py +++ /dev/null @@ -1,276 +0,0 @@ -"""Server:SealAI 路由 - -对应 CLI 命令: - ekb sealai whoami → GET /sealai/me - ekb sealai billing → GET /sealai/billing - ekb sealai rules → GET /sealai/rules - ekb sealai rule-create → POST /sealai/rules - ekb sealai rule-update → PUT /sealai/rules/{rule_id} - ekb sealai rule-delete → DELETE /sealai/rules/{rule_id} - ekb sealai versions → GET /sealai/rule-set-versions - —(Server 专属)— → GET /sealai/preference - —(Server 专属)— → POST /sealai/preference - —(Server 专属)— → PATCH /sealai/preference/decision - —(Server 专属)— → GET /sealai/knowledge/articles - —(Server 专属)— → POST /sealai/knowledge/articles - —(Server 专属)— → GET /sealai/knowledge/articles/{article_id} - —(Server 专属)— → PATCH /sealai/knowledge/articles/{article_id} - -设计约定: -- 路由函数不持有 SealAiClient,统一由 services.sealai 层管理(缓存、关闭、401 恢复) -- 路由函数只做参数绑定 + 调用 service 函数,返回值直接交给 FastAPI 序列化 -""" - -from typing import Optional -from fastapi import APIRouter, Query - -from ekb_cli.services.sealai import ( - get_whoami, - query_billing_status, - get_draft_rules, - add_draft_rule, - edit_draft_rule, - remove_draft_rule, - get_published_versions, - publish_draft_rules, - get_preference, - update_decision_preferences, - save_preference, - get_articles, - get_article_detail, - add_article, - edit_article, -) -from ekb_cli.api.sealai.schemas import ( - MeData, - BillingStatusData, - DraftRule, - DraftRulesData, - RuleSetVersion, - PublishVersionData, - AiApprovalConfig, - AiApprovalSaveResult, - KnowledgeArticle, - KnowledgeArticleListData, - # Server 请求模型 - RuleCreateRequest, - RuleUpdateRequest, - PublishVersionRequest, - DecisionPreferencesUpdateRequest, - ArticleCreateRequest, - ArticleUpdateRequest, -) - -router = APIRouter() - - -# ── 认证 / 计费 ──────────────────────────────────────────────────────────────── - -@router.get("/me", response_model=MeData, summary="查看当前 SealAI 用户身份及租户信息") -def sealai_whoami( - corp_id: str = Query(None, description="企业 corpId,不传则使用当前企业"), - refresh: bool = Query(False, description="强制刷新 Bearer token"), -): - return get_whoami(corp_id=corp_id, force_refresh=refresh) - - -@router.get("/billing", response_model=BillingStatusData, summary="查看 SealAI 订阅状态及功能配额") -def sealai_billing( - corp_id: str = Query(None, description="企业 corpId,不传则使用当前企业"), -): - return query_billing_status(corp_id=corp_id) - - -# ── 审核规则(草稿区) ───────────────────────────────────────────────────────── - -@router.get("/rules", response_model=DraftRulesData, summary="查看草稿区审核规则列表") -def sealai_list_rules( - corp_id: str = Query(None, description="企业 corpId,不传则使用当前企业"), -): - return get_draft_rules(corp_id=corp_id) - - -@router.post("/rules", response_model=DraftRule, summary="新建草稿审核规则") -def sealai_create_rule( - body: RuleCreateRequest, - corp_id: str = Query(None, description="企业 corpId,不传则使用当前企业"), -): - return add_draft_rule( - corp_id=corp_id, - description=body.description, - scope=body.scope, - strictness=body.strictness, - ) - - -@router.put("/rules/{rule_id}", response_model=DraftRule, summary="更新草稿审核规则(partial)") -def sealai_update_rule( - rule_id: str, - body: RuleUpdateRequest, - corp_id: str = Query(None, description="企业 corpId,不传则使用当前企业"), -): - return edit_draft_rule( - corp_id=corp_id, rule_id=rule_id, - description=body.description, - scope=body.scope, - strictness=body.strictness, - ) - - -@router.delete("/rules/{rule_id}", summary="删除草稿审核规则") -def sealai_delete_rule( - rule_id: str, - corp_id: str = Query(None, description="企业 corpId,不传则使用当前企业"), -): - remove_draft_rule(corp_id=corp_id, rule_id=rule_id) - return {"success": True, "rule_id": rule_id} - - -# ── 已发布版本历史 ───────────────────────────────────────────────────────────── - -@router.get( - "/rule-set-versions", - response_model=list[RuleSetVersion], - summary="查看已发布规则集版本历史", -) -def sealai_list_versions( - corp_id: str = Query(None, description="企业 corpId,不传则使用当前企业"), -): - return get_published_versions(corp_id=corp_id) - - -@router.post( - "/rule-set-versions/publish", - response_model=PublishVersionData, - summary="发布当前草稿规则为新版本", -) -def sealai_publish_version( - body: PublishVersionRequest, - corp_id: str = Query(None, description="企业 corpId,不传则使用当前企业"), -): - return publish_draft_rules(corp_id=corp_id, version_name=body.version_name) - - -# ── 风格偏好(AI 审批配置) ───────────────────────────────────────────────────── - -@router.get( - "/preference", - response_model=AiApprovalConfig, - summary="查看 AI 审批风格偏好配置(决策偏好 + 集成系统信息)", -) -def sealai_get_preference( - corp_id: str = Query(None, description="企业 corpId,不传则使用当前企业"), -): - return get_preference(corp_id=corp_id) - - -@router.post( - "/preference", - response_model=AiApprovalSaveResult, - summary="整体替换 AI 审批配置(需传完整配置对象)", -) -def sealai_save_preference( - body: AiApprovalConfig, - corp_id: str = Query(None, description="企业 corpId,不传则使用当前企业"), -): - return save_preference(corp_id=corp_id, config=body) - - -@router.patch( - "/preference/decision", - response_model=AiApprovalSaveResult, - summary="Patch 式更新决策偏好(只传需要改动的字段,其余保持不变)", -) -def sealai_patch_decision_preferences( - body: DecisionPreferencesUpdateRequest, - corp_id: str = Query(None, description="企业 corpId,不传则使用当前企业"), -): - return update_decision_preferences( - corp_id=corp_id, - explicit_approve=body.explicit_approve, - explicit_reject=body.explicit_reject, - exempt_approve=body.exempt_approve, - review=body.review, - ) - - -# ── 知识文档 ─────────────────────────────────────────────────────────────────── - -@router.get( - "/knowledge/articles", - response_model=KnowledgeArticleListData, - summary="查询知识文档列表(支持场景过滤、分页、排序)", -) -def sealai_list_articles( - corp_id: str = Query(None, description="企业 corpId,不传则使用当前企业"), - scenarios: Optional[list[str]] = Query(None, description="场景过滤,可选 audit / fill"), - offset: int = Query(0, description="分页偏移量"), - limit: int = Query(20, description="每页数量(最大建议 100)"), - sort_by: str = Query("createdAt", description="排序字段"), - sort_order: str = Query("desc", description="排序方向:asc | desc"), -): - return get_articles( - corp_id=corp_id, - scenarios=scenarios, - offset=offset, - limit=limit, - sort_by=sort_by, - sort_order=sort_order, - ) - - -@router.post( - "/knowledge/articles", - response_model=KnowledgeArticle, - summary="新建知识文档", -) -def sealai_create_article( - body: ArticleCreateRequest, - corp_id: str = Query(None, description="企业 corpId,不传则使用当前企业"), -): - return add_article( - corp_id=corp_id, - title=body.title, - purpose=body.purpose, - content=body.content, - content_type=body.content_type, - status=body.status, - scenarios=body.scenarios, - tags=body.tags, - ) - - -@router.get( - "/knowledge/articles/{article_id}", - response_model=KnowledgeArticle, - summary="查看知识文档详情", -) -def sealai_get_article( - article_id: str, - corp_id: str = Query(None, description="企业 corpId,不传则使用当前企业"), -): - return get_article_detail(corp_id=corp_id, article_id=article_id) - - -@router.patch( - "/knowledge/articles/{article_id}", - response_model=KnowledgeArticle, - summary="更新知识文档(只传需要改动的字段)", -) -def sealai_update_article( - article_id: str, - body: ArticleUpdateRequest, - corp_id: str = Query(None, description="企业 corpId,不传则使用当前企业"), -): - return edit_article( - corp_id=corp_id, - article_id=article_id, - title=body.title, - purpose=body.purpose, - content=body.content, - content_type=body.content_type, - status=body.status, - enabled=body.enabled, - scenarios=body.scenarios, - tags=body.tags, - ) diff --git a/src/ekb_cli/services/README.services.md b/src/ekb_cli/services/README.services.md deleted file mode 100644 index 6776863..0000000 --- a/src/ekb_cli/services/README.services.md +++ /dev/null @@ -1,56 +0,0 @@ -# services/ — 业务逻辑层 - -## 职责边界 - -- **唯一业务入口**:CLI 和 HTTP Server 共用这一层,所有业务编排在此完成。 -- **参数校验**:输入合法性检查(枚举值、范围、唯一性),不合法则抛 `EkbError` 子类。 -- **多步编排**:如 `check_name → save`、`get → merge → save` 等组合调用。 -- **不关心渲染**:只抛异常,不打印;不关心上层是 CLI 还是 Server。 - -## 目录结构 - -``` -services/ -├── __init__.py # 统一 re-export(快报主站 + SealAI 子域) -├── auth_service.py # 企业认证配置管理(~/.config/ekb-cli/config.json) -├── agent_service.py # Agent CRUD + 复制 + 高阶组合查询 + CLI _cmd 便捷函数 -├── rule_service.py # Rule 查询(按编码/ID)+ CRUD -└── sealai/ # SealAI 子平台服务,见 README.sealai.md -``` - -## 依赖约定 - -``` -services/* → api/* ✅ 允许 -services/* → config.py ✅ 允许 -services/* → errors.py ✅ 允许 -``` - -## 导入约定 - -上层(commands/server)统一从 `services` 顶层导入: - -```python -from ekb_cli.services import list_agents, list_agents_cmd -from ekb_cli.services.sealai import get_whoami -``` - -## CLI 便捷函数(`_cmd` 后缀) - -`agent_service.py` 提供 `list_agents_cmd()` 等便捷函数,内部自行管理 `EkbClient` -的创建和关闭,使 CLI 层无需 `import get_client`,保持边界清晰。 - -Server 端通过 FastAPI 依赖注入(`deps.py`)获取 client,不使用 `_cmd` 系列函数。 - -## 异常规范 - -只抛 `errors.py` 中的 `EkbError` 子类: - -| 场景 | 异常类 | -|---|---| -| 未登录/未配置 | `NotLoggedInError` | -| 认证过期 | `AuthenticationError` | -| 资源不存在 | `NotFoundError(resource, ref)` | -| 名称冲突 | `ConflictError(message)` | -| 参数校验失败 | `InputError(message)` | -| 快报 API 业务错误 | `ApiResponseError(api_code, msg)` | diff --git a/src/ekb_cli/services/__init__.py b/src/ekb_cli/services/__init__.py deleted file mode 100644 index dbc5cdf..0000000 --- a/src/ekb_cli/services/__init__.py +++ /dev/null @@ -1,88 +0,0 @@ -"""Service 层统一 re-export - -commands / server 从此处导入所有 service 函数, -内部模块拆分对上层透明。 - -导入约定: -- 快报主站服务:from ekb_cli.services import ... -- SealAI 服务: from ekb_cli.services import sealai_xxx 或 - from ekb_cli.services.sealai import xxx(子域直接导入亦可) -""" - -from ekb_cli.services.auth_service import ( # noqa: F401 - CorpInfo, - CorpDetail, - list_corps, - whoami, - add_corp, - use_corp, - remove_corp, -) -from ekb_cli.services.agent_service import ( # noqa: F401 - AgentCreateInput, - AgentUpdateInput, - MODE_NAMES, - MODE_DISPLAY, - DEFAULT_ICON, - list_agents, - get_agent, - create_agent, - copy_agent, - update_agent, - delete_agent, - get_dedup_rules_across_agents, - # CLI 便捷函数(自管 client 生命周期,commands/* 层使用) - list_agents_cmd, - get_agent_cmd, - create_agent_cmd, - copy_agent_cmd, - update_agent_cmd, - delete_agent_cmd, - get_dedup_rules_across_agents_cmd, -) -from ekb_cli.services.rule_service import ( # noqa: F401 - VALID_LEVELS, - list_rules, - get_rule, - create_rule, - update_rule, - # CLI 便捷函数(自管 client 生命周期,commands/* 层使用) - list_rules_cmd, - get_rule_cmd, - create_rule_cmd, -) -from ekb_cli.services.platform import ( # noqa: F401 - list_platforms, - list_platforms_cmd, - # 工作流 - list_workflows, - get_workflow_stats, - get_workflow_charge, - list_workflows_cmd, - get_workflow_stats_cmd, - get_workflow_charge_cmd, -) - -# SealAI 子域服务:通过 services.sealai 子包统一导出, -# commands/server 使用 `from ekb_cli.services.sealai import xxx` -# 此处仅做显式 re-export 以便 IDE 跳转和 import lint 检查。 -from ekb_cli.services.sealai import ( # noqa: F401 - get_bearer_token, - invalidate_token, - get_whoami, - query_billing_status, - get_feature_usage, - get_draft_rules, - add_draft_rule, - edit_draft_rule, - remove_draft_rule, - get_published_versions, - publish_draft_rules, - get_preference, - update_decision_preferences, - save_preference, - get_articles, - get_article_detail, - add_article, - edit_article, -) diff --git a/src/ekb_cli/services/agent_service.py b/src/ekb_cli/services/agent_service.py deleted file mode 100644 index 0bae82f..0000000 --- a/src/ekb_cli/services/agent_service.py +++ /dev/null @@ -1,263 +0,0 @@ -"""Service 层:Agent 业务逻辑 - -将原本散落在 commands/agent/*.py 中的编排逻辑集中到此处。 -CLI 和 Server 共用同一套逻辑,只有输出格式不同。 - -职责: -- 参数校验(mode 合法性、samplingRate 范围) -- 多步编排(check_name → save、get → merge → save) -- 高阶组合查询(获取所有 Agent 关联的去重规则) -- 统一抛出 EkbError 子类,不关心上层如何渲染 -""" - -from dataclasses import dataclass, field -from typing import Optional - -from ekb_cli.api import EkbClient, get_client -from ekb_cli.api import ( - check_agent_name as api_check_name, - list_agents as api_list_agents, - get_agent as api_get_agent, - save_agent as api_save_agent, - delete_agent as api_delete_agent, -) -from ekb_cli.api.schemas import AgentDetail, AgentSummary, AgentRuleRef, PageData -from ekb_cli.errors import NotFoundError, ConflictError, InputError - -# ── 枚举常量 ───────────────────────────────────────────────── - -#: 前端传入的模式字符串 → 快报 API 的 int 值 -MODE_NAMES: dict[str, int] = {"auto": 0, "semi": 1, "assist": 2} - -#: 快报 API int 值 → 可读中文 -MODE_DISPLAY: dict[int, str] = {0: "全自动", 1: "半自动", 2: "辅助"} - -DEFAULT_ICON = "https://statics.ekuaibao.com/eui/eui-static/male5.png" - - -# ── 输入数据类 ─────────────────────────────────────────────── - -@dataclass -class AgentCreateInput: - """新建 Agent 的输入参数""" - name: str - description: str = "" - mode: str = "assist" # "auto" / "semi" / "assist" - sampling_rate: int = 0 - agree_terms: str = "" - reject_terms: str = "" - exempt_terms: str = "" - review_terms: str = "" - rule_ids: list[str] = field(default_factory=list) - icon: str = DEFAULT_ICON - - -@dataclass -class AgentUpdateInput: - """更新 Agent 的输入参数(所有字段可选,None 表示不修改)""" - agent_id: str - name: Optional[str] = None - description: Optional[str] = None - mode: Optional[str] = None # "auto" / "semi" / "assist" - sampling_rate: Optional[int] = None - state: Optional[int] = None - agree_terms: Optional[str] = None - reject_terms: Optional[str] = None - exempt_terms: Optional[str] = None - review_terms: Optional[str] = None - - -# ── 查询 ───────────────────────────────────────────────────── - -def list_agents(client: EkbClient) -> PageData[AgentSummary]: - """列出所有 Agent(分页,默认 size=1000 拉全量)""" - return api_list_agents(client) - - -def get_agent(client: EkbClient, agent_id: str) -> AgentDetail: - """获取 Agent 详情,不存在时抛出 NotFoundError""" - detail = api_get_agent(client, agent_id) - if not detail: - raise NotFoundError("Agent", agent_id) - return detail - - -# ── 创建 ───────────────────────────────────────────────────── - -def create_agent(client: EkbClient, inp: AgentCreateInput) -> AgentDetail: - """新建 Agent - - 校验: - - mode 必须是 auto / semi / assist - - 名称不能与已有 Agent 重复 - """ - if inp.mode not in MODE_NAMES: - raise InputError(f"mode 必须是 auto / semi / assist,当前:{inp.mode}") - - if not api_check_name(client, inp.name): - raise ConflictError(f"名称「{inp.name}」已存在,请换一个") - - payload = { - "icon": inp.icon, - "name": inp.name, - "description": inp.description, - "mode": MODE_NAMES[inp.mode], - "agreeTerms": inp.agree_terms, - "rejectTerms": inp.reject_terms, - "exemptTerms": inp.exempt_terms, - "reviewTerms": inp.review_terms, - "state": 1, - "ruleIds": inp.rule_ids, - } - return api_save_agent(client, payload) - - -# ── 复制 ───────────────────────────────────────────────────── - -def copy_agent(client: EkbClient, agent_id: str) -> tuple[AgentDetail, AgentDetail]: - """复制 Agent,新 Agent 名称自动追加「(副本)」 - - Returns: - (源 Agent, 新 Agent) - """ - src = get_agent(client, agent_id) # 不存在会抛 NotFoundError - new_name = src.name + "(副本)" - - if not api_check_name(client, new_name): - raise ConflictError(f"名称「{new_name}」已存在,无法复制") - - payload = { - "icon": src.icon, - "name": new_name, - "description": src.description, - "mode": src.mode, - "agreeTerms": src.agreeTerms, - "rejectTerms": src.rejectTerms, - "exemptTerms": src.exemptTerms, - "reviewTerms": src.reviewTerms, - "state": 1, - "ruleIds": [r.id for r in src.agentRule], - } - # 半自动模式需带上抽检比例 - if src.mode == 1: - payload["samplingRate"] = src.samplingRate - - new = api_save_agent(client, payload) - return src, new - - -# ── 更新 ───────────────────────────────────────────────────── - -def update_agent(client: EkbClient, inp: AgentUpdateInput) -> AgentDetail: - """更新 Agent(patch 式:只改传入字段,其余保持原值) - - 校验: - - mode 若传入必须是 auto / semi / assist - - sampling_rate 若传入必须在 0-100 - """ - if inp.mode is not None and inp.mode not in MODE_NAMES: - raise InputError(f"mode 必须是 auto / semi / assist,当前:{inp.mode}") - if inp.sampling_rate is not None and not (0 <= inp.sampling_rate <= 100): - raise InputError("sampling-rate 范围是 0-100") - - # 先拉原始数据,再 merge - d = get_agent(client, inp.agent_id) - mode_val = MODE_NAMES[inp.mode] if inp.mode is not None else d.mode - - payload: dict = { - "id": d.id, - "icon": d.icon, - "name": inp.name if inp.name is not None else d.name, - "description": inp.description if inp.description is not None else d.description, - "mode": mode_val, - "agreeTerms": inp.agree_terms if inp.agree_terms is not None else d.agreeTerms, - "rejectTerms": inp.reject_terms if inp.reject_terms is not None else d.rejectTerms, - "exemptTerms": inp.exempt_terms if inp.exempt_terms is not None else d.exemptTerms, - "reviewTerms": inp.review_terms if inp.review_terms is not None else d.reviewTerms, - "state": inp.state if inp.state is not None else d.state, - "ruleIds": [r.id for r in d.agentRule], - } - if mode_val == 1: - payload["samplingRate"] = ( - inp.sampling_rate if inp.sampling_rate is not None else d.samplingRate - ) - - return api_save_agent(client, payload) - - -# ── 删除 ───────────────────────────────────────────────────── - -def delete_agent(client: EkbClient, agent_id: str) -> AgentDetail: - """删除 Agent(软删除:state=2),返回被删除的 Agent 用于确认展示""" - detail = get_agent(client, agent_id) - api_delete_agent(client, agent_id) - return detail - - -# ── 高阶组合接口 ───────────────────────────────────────────── - -def get_dedup_rules_across_agents(client: EkbClient) -> list[AgentRuleRef]: - """遍历所有 Agent,收集其关联规则并去重 - - 用途:统计企业内实际被引用的规则集合。 - Returns: - 去重后的规则列表(保持首次出现的顺序) - """ - page = api_list_agents(client) - seen: set[str] = set() - rules: list[AgentRuleRef] = [] - - for summary in page.items: - detail = api_get_agent(client, summary.id) - for r in detail.agentRule: - if r.id not in seen: - seen.add(r.id) - rules.append(r) - - return rules - - -# ── CLI 便捷函数(自管 client 生命周期)──────────────────────── -# commands/* 层调用这批函数,不需要自行 import get_client, -# 保持 commands → services → api 的依赖方向。 - -def list_agents_cmd() -> PageData[AgentSummary]: - """CLI 便捷函数:自动获取当前企业 client 并列出所有 Agent""" - with get_client() as client: - return list_agents(client) - - -def get_agent_cmd(agent_id: str) -> AgentDetail: - """CLI 便捷函数:自动获取当前企业 client 并获取 Agent 详情""" - with get_client() as client: - return get_agent(client, agent_id) - - -def create_agent_cmd(inp: AgentCreateInput) -> AgentDetail: - """CLI 便捷函数:自动获取当前企业 client 并新建 Agent""" - with get_client() as client: - return create_agent(client, inp) - - -def copy_agent_cmd(agent_id: str) -> tuple[AgentDetail, AgentDetail]: - """CLI 便捷函数:自动获取当前企业 client 并复制 Agent""" - with get_client() as client: - return copy_agent(client, agent_id) - - -def update_agent_cmd(inp: AgentUpdateInput) -> AgentDetail: - """CLI 便捷函数:自动获取当前企业 client 并更新 Agent""" - with get_client() as client: - return update_agent(client, inp) - - -def delete_agent_cmd(agent_id: str) -> AgentDetail: - """CLI 便捷函数:自动获取当前企业 client 并删除 Agent""" - with get_client() as client: - return delete_agent(client, agent_id) - - -def get_dedup_rules_across_agents_cmd() -> list[AgentRuleRef]: - """CLI 便捷函数:自动获取当前企业 client 并返回去重规则列表""" - with get_client() as client: - return get_dedup_rules_across_agents(client) diff --git a/src/ekb_cli/services/auth_service.py b/src/ekb_cli/services/auth_service.py deleted file mode 100644 index fae5edc..0000000 --- a/src/ekb_cli/services/auth_service.py +++ /dev/null @@ -1,81 +0,0 @@ -"""Service 层:认证/企业配置管理 - -职责:封装 config 模块的数据操作,向上提供类型化返回值。 -CLI 和 Server 都调用此层,不直接操作 config。 - -注意:auth add 的交互式输入逻辑(prompt)留在 CLI 层, - 此层只处理数据写入,不涉及 I/O。 -""" - -from dataclasses import dataclass -from typing import Optional - -from ekb_cli import config -from ekb_cli.errors import NotFoundError, NotLoggedInError - - -# ── 数据类 ──────────────────────────────────────────────────── - -@dataclass -class CorpInfo: - """企业信息(不含敏感 token,用于展示和返回)""" - corp_id: str - name: str - is_current: bool - - -@dataclass -class CorpDetail: - """企业完整信息(含 token,用于内部传递)""" - corp_id: str - name: str - access_token: str - staff_id: str - is_current: bool - - -# ── 查询 ────────────────────────────────────────────────────── - -def list_corps() -> list[CorpInfo]: - """列出所有已配置的企业""" - data = config.get_all() - current = data.get("current") - return [ - CorpInfo(corp_id=cid, name=info["name"], is_current=(cid == current)) - for cid, info in data.get("corps", {}).items() - ] - - -def whoami() -> CorpInfo: - """获取当前企业信息,未登录时抛出 NotLoggedInError""" - corp = config.get_current_corp() - corp_id = config.get_current_corp_id() - if not corp or not corp_id: - raise NotLoggedInError() - current = config.get_current_corp_id() - return CorpInfo(corp_id=corp_id, name=corp["name"], is_current=(corp_id == current)) - - -# ── 写操作 ──────────────────────────────────────────────────── - -def add_corp(corp_id: str, name: str, access_token: str, staff_id: str) -> CorpInfo: - """添加企业认证,返回添加后的企业信息""" - config.add_corp(corp_id=corp_id, name=name, access_token=access_token, staff_id=staff_id) - current = config.get_current_corp_id() - return CorpInfo(corp_id=corp_id, name=name, is_current=(current == corp_id)) - - -def use_corp(corp_id: str) -> CorpInfo: - """切换当前企业,企业不存在时抛出 NotFoundError""" - try: - config.use_corp(corp_id) - except ValueError: - raise NotFoundError("企业", corp_id) - data = config.get_all() - info = data["corps"][corp_id] - return CorpInfo(corp_id=corp_id, name=info["name"], is_current=True) - - -def remove_corp(corp_id: str) -> None: - """删除企业认证配置""" - config.remove_corp(corp_id) diff --git a/src/ekb_cli/services/platform/README.platform.md b/src/ekb_cli/services/platform/README.platform.md deleted file mode 100644 index 2345eb2..0000000 --- a/src/ekb_cli/services/platform/README.platform.md +++ /dev/null @@ -1,22 +0,0 @@ -# services/platform — 自建应用域服务层 - -## 已实现 - -| 文件 | 说明 | -|---|---| -| `__init__.py` | 自建应用列表(`list_platforms` / `list_platforms_cmd`) | -| `workflow_service.py` | 工作流列表 / 统计 / 配额(`list_workflows` / `get_workflow_stats` / `get_workflow_charge` 及对应 `_cmd`) | - -## 待实现(预留) - -以下模块服务层尚未开发,待接口确认后按需补充: - -| 文件(待建) | 对应业务 | 依赖 API | -|---|---|---| -| `entity_service.py` | 业务对象(实体/数据表)CRUD | `api/platform/entity_api.py`(待建) | -| `page_service.py` | 页面设计器 | 待抓包 | -| `card_service.py` | 互联卡片 | 待抓包 | -| `variable_service.py` | 应用变量 | 待抓包 | -| `log_service.py` | 应用日志 | `api/easo/pipelines/logs`(运行日志参数) | - -新增服务时,在本目录创建对应 `xxx_service.py`,并在 `__init__.py` 和父级 `services/__init__.py` 补充 re-export。 diff --git a/src/ekb_cli/services/platform/__init__.py b/src/ekb_cli/services/platform/__init__.py deleted file mode 100644 index d814f76..0000000 --- a/src/ekb_cli/services/platform/__init__.py +++ /dev/null @@ -1,49 +0,0 @@ -"""Service 层:自建应用(DataLink Platform)业务逻辑 - -职责: -- 列出当前企业下所有启用的自建应用 -- 统一抛出 EkbError 子类,不关心上层如何渲染 -""" - -from typing import List - -from ekb_cli.api import EkbClient, get_client -from ekb_cli.api.platform.schemas import Platform -from ekb_cli.api.platform.platform_api import list_platforms as api_list_platforms - - -# ── 查询 ───────────────────────────────────────────────────── - -def list_platforms(client: EkbClient) -> List[Platform]: - """列出所有启用的自建应用""" - return api_list_platforms(client) - - -# ── CLI 便捷函数(自管 client 生命周期)──────────────────────── -# commands/* 层调用这批函数,不需要自行 import get_client, -# 保持 commands → services → api 的依赖方向。 - -def list_platforms_cmd() -> List[Platform]: - """CLI 便捷函数:自动获取当前企业 client 并列出所有自建应用""" - with get_client() as client: - return list_platforms(client) - - -# ── 工作流子模块 re-export ──────────────────────────────────── -from ekb_cli.services.platform.workflow_service import ( # noqa: F401, E402 - list_workflows, - get_workflow, - get_workflow_stats, - get_workflow_charge, - list_all_workflows, - find_workflows_by_task_type, - WorkflowWithPlatform, - WorkflowTaskMatch, - list_workflows_cmd, - get_workflow_cmd, - get_workflow_stats_cmd, - get_workflow_charge_cmd, - list_all_workflows_cmd, - find_workflows_by_task_type_cmd, -) - diff --git a/src/ekb_cli/services/platform/workflow_service.py b/src/ekb_cli/services/platform/workflow_service.py deleted file mode 100644 index cdab83b..0000000 --- a/src/ekb_cli/services/platform/workflow_service.py +++ /dev/null @@ -1,195 +0,0 @@ -"""Service 层:工作流(EASO Pipeline)业务逻辑 - -域: - - unity.ekuaibao.com(EasoClient):列表 / 统计 / 配额 - - piper.ekuaibao.com(PiperClient):工作流配置详情 - -职责: -- 分页列出指定自建应用下的工作流 -- 获取单个工作流完整配置(节点列表) -- 查询工作流执行统计 -- 查询企业工作流配额 -- 跨应用聚合查询(按节点类型过滤) -- 统一抛出 EkbError 子类,不关心上层如何渲染 -""" - -from dataclasses import dataclass, field -from typing import Any, Dict, List, Optional - -from ekb_cli.api import get_client -from ekb_cli.api.platform.easo_client import EasoClient, get_easo_client -from ekb_cli.api.platform.piper_client import PiperClient, get_piper_client -from ekb_cli.api.platform.platform_api import list_platforms as api_list_platforms -from ekb_cli.api.platform.schemas import ( - Platform, - Workflow, - WorkflowPage, - WorkflowStats, - WorkflowCharge, - WorkflowDetail, -) -from ekb_cli.api.platform.workflow_api import ( - list_workflows as api_list_workflows, - get_workflow as api_get_workflow, - get_workflow_stats as api_get_workflow_stats, - get_workflow_charge as api_get_workflow_charge, -) - - -# ── 查询 ───────────────────────────────────────────────────── - -def list_workflows( - client: EasoClient, - platform_id: str, - page: int = 1, - page_size: int = 20, -) -> WorkflowPage: - """列出指定自建应用下的工作流(分页)""" - return api_list_workflows(client, platform_id, page, page_size) - - -def get_workflow(client: PiperClient, pipeline_id: str) -> WorkflowDetail: - """获取单个工作流的完整配置(包含所有节点及参数)""" - return api_get_workflow(client, pipeline_id) - - -def get_workflow_stats(client: EasoClient, platform_id: str) -> WorkflowStats: - """获取指定自建应用的工作流执行统计""" - return api_get_workflow_stats(client, platform_id) - - -def get_workflow_charge(client: EasoClient) -> WorkflowCharge: - """获取企业工作流资源包/配额""" - return api_get_workflow_charge(client) - - -# ── 跨应用聚合 ──────────────────────────────────────────────── - -@dataclass -class WorkflowWithPlatform: - """携带所属自建应用信息的工作流摘要""" - platform_id: str - platform_name: str - workflow: Workflow - - -@dataclass -class WorkflowTaskMatch: - """在工作流中匹配到的节点""" - platform_id: str - platform_name: str - workflow_id: str - workflow_name: str - matched_tasks: List[Dict[str, Any]] = field(default_factory=list) - - -def _collect_tasks_by_type(tasks: list, task_type: Optional[str]) -> List[Dict[str, Any]]: - """递归收集所有层级中匹配类型的节点(含控制节点内的嵌套节点)。 - task_type 为 None 时收集全部节点。 - """ - result = [] - for t in tasks: - t_type = t.get("type") if isinstance(t, dict) else getattr(t, "type", "") - if task_type is None or t_type == task_type: - result.append(t if isinstance(t, dict) else t.model_dump()) - nested = t.get("tasks") if isinstance(t, dict) else getattr(t, "tasks", None) - if nested and isinstance(nested, list): - result.extend(_collect_tasks_by_type(nested, task_type)) - return result - - -def list_all_workflows( - easo_client: EasoClient, - ekb_client, - enabled_only: bool = True, -) -> List[WorkflowWithPlatform]: - """聚合所有自建应用下的工作流,返回带平台信息的扁平列表。 - - enabled_only=True 时只返回 state=1 的工作流。 - """ - platforms: List[Platform] = api_list_platforms(ekb_client) - result: List[WorkflowWithPlatform] = [] - for p in platforms: - page = api_list_workflows(easo_client, p.id, page=1, page_size=100) - for wf in page.pipelineList: - if enabled_only and wf.state != 1: - continue - result.append(WorkflowWithPlatform( - platform_id=p.id, - platform_name=p.name, - workflow=wf, - )) - return result - - -def find_workflows_by_task_type( - easo_client: EasoClient, - ekb_client, - task_type: str, - enabled_only: bool = True, -) -> List[WorkflowTaskMatch]: - """跨所有自建应用,找出含指定节点类型的工作流。 - - 递归检查控制节点(every / condition 等)内的嵌套节点。 - 返回含匹配节点列表的结果,每条记录对应一个工作流。 - """ - all_wfs = list_all_workflows(easo_client, ekb_client, enabled_only=enabled_only) - matches: List[WorkflowTaskMatch] = [] - for item in all_wfs: - wf = item.workflow - matched = _collect_tasks_by_type(wf.tasks, task_type) - if matched: - matches.append(WorkflowTaskMatch( - platform_id=item.platform_id, - platform_name=item.platform_name, - workflow_id=wf.id, - workflow_name=wf.pipelineName, - matched_tasks=matched, - )) - return matches - - -# ── CLI 便捷函数(自管 client 生命周期)──────────────────────── -# commands/* 层调用这批函数,保持 commands → services → api 依赖方向。 - -def list_workflows_cmd( - platform_id: str, - page: int = 1, - page_size: int = 20, -) -> WorkflowPage: - """CLI 便捷函数:自动获取 EasoClient 并列出工作流""" - with get_easo_client() as client: - return list_workflows(client, platform_id, page, page_size) - - -def get_workflow_cmd(platform_id: str, pipeline_id: str) -> WorkflowDetail: - """CLI 便捷函数:自动获取 PiperClient 并查询工作流完整配置""" - with get_piper_client(platform_id) as client: - return get_workflow(client, pipeline_id) - - -def get_workflow_stats_cmd(platform_id: str) -> WorkflowStats: - """CLI 便捷函数:自动获取 EasoClient 并查询工作流统计""" - with get_easo_client() as client: - return get_workflow_stats(client, platform_id) - - -def get_workflow_charge_cmd() -> WorkflowCharge: - """CLI 便捷函数:自动获取 EasoClient 并查询工作流配额""" - with get_easo_client() as client: - return get_workflow_charge(client) - - -def list_all_workflows_cmd(enabled_only: bool = True) -> List[WorkflowWithPlatform]: - """CLI 便捷函数:跨所有应用汇总工作流""" - with get_client() as ekb_client, get_easo_client() as easo_client: - return list_all_workflows(easo_client, ekb_client, enabled_only=enabled_only) - - -def find_workflows_by_task_type_cmd( - task_type: str, - enabled_only: bool = True, -) -> List[WorkflowTaskMatch]: - """CLI 便捷函数:跨所有应用查找含指定节点类型的工作流""" - with get_client() as ekb_client, get_easo_client() as easo_client: - return find_workflows_by_task_type(easo_client, ekb_client, task_type, enabled_only=enabled_only) diff --git a/src/ekb_cli/services/rule_service.py b/src/ekb_cli/services/rule_service.py deleted file mode 100644 index 08eab59..0000000 --- a/src/ekb_cli/services/rule_service.py +++ /dev/null @@ -1,144 +0,0 @@ -"""Service 层:审核规则(Rule)业务逻辑 - -将原本散落在 commands/agent/rule_*.py 中的逻辑集中到此处。 -CLI 和 Server 共用同一套逻辑。 - -职责: -- 参数校验(level 合法性) -- 按编码/ID 查找单条规则(快报无直接 get 接口,需拉全量过滤) -- 规则 CRUD 编排 -""" - -from typing import Optional - -from ekb_cli.api import EkbClient, get_client -from ekb_cli.api.rule import ( - list_rules as api_list_rules, - save_rule as api_save_rule, - update_rule as api_update_rule, -) -from ekb_cli.api.schemas import PageData, Rule, RuleWithAgents -from ekb_cli.errors import NotFoundError, InputError - -# ── 枚举常量 ───────────────────────────────────────────────── - -VALID_LEVELS = {"严重", "一般"} - - -# ── 查询 ───────────────────────────────────────────────────── - -def list_rules( - client: EkbClient, - level: Optional[str] = None, -) -> tuple[PageData[RuleWithAgents], list[RuleWithAgents]]: - """列出所有规则,可按 level 筛选 - - Returns: - (原始分页数据, 筛选后的 items 列表) - 返回原始分页是为了让调用方能拿到 totalItems 等元数据 - """ - page = api_list_rules(client) - items = page.items - if level: - items = [r for r in items if r.level == level] - return page, items - - -def get_rule(client: EkbClient, rule_ref: str) -> RuleWithAgents: - """按 ID 或编码查找单条规则 - - rule_ref 支持以下格式: - - 完整 ID(长字符串) - - 编码数字,如 "1" / "0001" / "#0001" - - 快报无直接的 rule/detail 接口,因此拉全量后客户端过滤。 - """ - page = api_list_rules(client) - - # 纯数字且不超过 4 位 → 按编码匹配(补零对齐) - stripped = rule_ref.lstrip("#") - if stripped.isdigit() and len(stripped) <= 4: - code = f"#{stripped.zfill(4)}" - rule = next((r for r in page.items if r.code == code), None) - else: - rule = next((r for r in page.items if r.id == rule_ref), None) - - if not rule: - raise NotFoundError("规则", rule_ref) - return rule - - -# ── 创建 ───────────────────────────────────────────────────── - -def create_rule( - client: EkbClient, - purpose: str, - description: str, - level: str = "严重", -) -> Rule: - """新建审核规则 - - 校验:level 必须是 严重 / 一般 - """ - if level not in VALID_LEVELS: - raise InputError(f"--level 只接受 严重 / 一般,当前值:{level}") - - payload = {"purpose": purpose, "description": description, "level": level} - return api_save_rule(client, payload) - - -# ── 更新 ───────────────────────────────────────────────────── - -def update_rule( - client: EkbClient, - rule_ref: str, - purpose: Optional[str] = None, - description: Optional[str] = None, - level: Optional[str] = None, -) -> Rule: - """更新审核规则(patch 式) - - rule_ref 同 get_rule,支持 ID 或编码。 - 只传需要修改的字段,其余保持原值。 - """ - if level is not None and level not in VALID_LEVELS: - raise InputError(f"--level 只接受 严重 / 一般,当前值:{level}") - - current = get_rule(client, rule_ref) - - payload = { - "id": current.id, - "code": current.code, - "purpose": purpose if purpose is not None else current.purpose, - "description": description if description is not None else current.description, - "level": level if level is not None else current.level, - } - return api_update_rule(client, payload) - - -# ── CLI 便捷函数(自管 client 生命周期)──────────────────────── -# commands/* 层调用这批函数,不需要自行 import get_client, -# 保持 commands → services → api 的依赖方向。 - -def list_rules_cmd( - level: Optional[str] = None, -) -> tuple[PageData[RuleWithAgents], list[RuleWithAgents]]: - """CLI 便捷函数:自动获取当前企业 client 并列出所有规则""" - with get_client() as client: - return list_rules(client, level=level) - - -def get_rule_cmd(rule_ref: str) -> RuleWithAgents: - """CLI 便捷函数:自动获取当前企业 client 并查找单条规则""" - with get_client() as client: - return get_rule(client, rule_ref) - - -def create_rule_cmd( - purpose: str, - description: str, - level: str = "严重", -) -> Rule: - """CLI 便捷函数:自动获取当前企业 client 并新建规则""" - with get_client() as client: - return create_rule(client, purpose=purpose, description=description, level=level) diff --git a/src/ekb_cli/services/sealai/README.sealai.md b/src/ekb_cli/services/sealai/README.sealai.md deleted file mode 100644 index 1d6b328..0000000 --- a/src/ekb_cli/services/sealai/README.sealai.md +++ /dev/null @@ -1,72 +0,0 @@ -# services/sealai/ — SealAI 子平台业务逻辑层 - -## 职责边界 - -SealAI 是独立于快报主站的 Next.js 平台(`{corpId}.sealai.cc`),认证体系完全独立。 -本子包封装所有 SealAI 相关业务逻辑,对外隐藏 `api/sealai/` 传输层细节, -**同时隐藏 `SealAiClient` 的创建、缓存与关闭**。 - -## 模块说明 - -| 模块 | 职责 | -|---|---| -| `auth_service.py` | SSO token 换取 + 磁盘/内存双层缓存 + `_sealai_call` 统一调用入口(含 401 自动恢复) | -| `billing_service.py` | 订阅状态查询;单功能配额查询 | -| `rules_service.py` | 草稿区审核规则 CRUD;版本发布 | -| `preference_service.py` | AI 审批风格偏好读写 | -| `knowledge_service.py` | 知识文档(Articles)CRUD | - -## 认证与缓存设计 - -``` -快报 accesstoken(三 Header 认证) - → GET {corpId}.sealai.cc/api/auth/oauth2/session/oem-hosecloud?token=...&returnToken=1 - → Bearer JWT - -磁盘缓存(~/.config/ekb-cli/sealai_tokens.json,TTL 3600s): - { "ID01Jdq2yIDnMr": { "token": "...", "fetched_at": 1712345678 } } - → CLI / Server 进程间共享 - -内存缓存(模块级 _client_cache,TTL 同 token): - { "corp_id": (SealAiClient, fetched_at_float) } - → CLI 进程结束自动回收;Server 进程中长期保持,复用 httpx 连接池 -``` - -**401 自动恢复**:`_sealai_call` 捕获 `AuthenticationError` 后,同时清除内存 client -和磁盘 token,强制重新换取,然后单次重试。调用方无需感知这一过程。 - -## 调用方约定 - -- `commands/*` 和 `server/*` 只传 `corp_id`,不持有也不传递 `SealAiClient` -- `SealAiClient` 的创建和生命周期完全由 `auth_service` 管理 - -## 对外接口(统一从 `services.sealai` 导入) - -```python -from ekb_cli.services.sealai import ( - # 认证(调试 / 外部集成) - get_bearer_token, # 获取 Bearer JWT 字符串 - invalidate_token, # 强制清除缓存(磁盘 + 内存) - get_whoami, # 查询当前用户身份 - # 计费 - query_billing_status, - get_feature_usage, - # 审核规则 - get_draft_rules, add_draft_rule, edit_draft_rule, remove_draft_rule, - get_published_versions, publish_draft_rules, - # 风格偏好 - get_preference, update_decision_preferences, save_preference, - # 知识文档 - get_articles, get_article_detail, add_article, edit_article, -) -``` - -**不对外暴露**:`get_sealai_client`、`_sealai_call`、`_get_or_create_client` - -## 导入约定 - -``` -services/sealai/* → api/sealai/* ✅ 允许 -commands/* → api/sealai/* ❌ 禁止(必须通过 services 层) -server/* → api/sealai/* ❌ 禁止(必须通过 services 层) -``` diff --git a/src/ekb_cli/services/sealai/__init__.py b/src/ekb_cli/services/sealai/__init__.py deleted file mode 100644 index 8b1fc64..0000000 --- a/src/ekb_cli/services/sealai/__init__.py +++ /dev/null @@ -1,65 +0,0 @@ -"""SealAI 服务层统一 re-export。 - -对外约定 --------- -commands/* 和 server/* 只从此处(或 services 顶层)导入,不直接访问子模块。 - -不再对外暴露 get_sealai_client / _sealai_call 等内部函数: -- SealAiClient 的创建、缓存、关闭、401 恢复全部由 auth_service 内部承担 -- 调用方只需传 corp_id,无需感知 client 的存在 -""" - -from ekb_cli.services.sealai.auth_service import ( # noqa: F401 - invalidate_token, - get_bearer_token, - get_whoami, -) -from ekb_cli.services.sealai.billing_service import ( # noqa: F401 - query_billing_status, - get_feature_usage, -) -from ekb_cli.services.sealai.rules_service import ( # noqa: F401 - get_draft_rules, - add_draft_rule, - edit_draft_rule, - remove_draft_rule, - get_published_versions, - publish_draft_rules, -) -from ekb_cli.services.sealai.preference_service import ( # noqa: F401 - get_preference, - update_decision_preferences, - save_preference, -) -from ekb_cli.services.sealai.knowledge_service import ( # noqa: F401 - get_articles, - get_article_detail, - add_article, - edit_article, -) - -__all__ = [ - # 认证(仅保留对外有意义的操作) - "invalidate_token", - "get_bearer_token", - "get_whoami", - # 计费 - "query_billing_status", - "get_feature_usage", - # 审核规则 - "get_draft_rules", - "add_draft_rule", - "edit_draft_rule", - "remove_draft_rule", - "get_published_versions", - "publish_draft_rules", - # 风格偏好 - "get_preference", - "update_decision_preferences", - "save_preference", - # 知识文档 - "get_articles", - "get_article_detail", - "add_article", - "edit_article", -] diff --git a/src/ekb_cli/services/sealai/auth_service.py b/src/ekb_cli/services/sealai/auth_service.py deleted file mode 100644 index 33d7668..0000000 --- a/src/ekb_cli/services/sealai/auth_service.py +++ /dev/null @@ -1,239 +0,0 @@ -"""SealAI 认证业务逻辑层。 - -职责 ----- -1. SSO 换 Bearer token(快报 accesstoken → SealAI Bearer JWT) -2. Token 持久缓存(磁盘文件,CLI/Server 共用) -3. Client 对象内存缓存(模块级 dict,Server 连接池复用;CLI 进程结束自动回收) -4. 401 自动恢复:清除内存 client + 磁盘 token → 重取 → 单次重试 -5. 对上层(commands/server)隐藏 SealAiClient 的创建与关闭 - -对外接口 --------- -- get_whoami(corp_id, force_refresh) — 查询用户身份 -- invalidate_token(corp_id) — 强制清除缓存(外部显式调用场景) - -内部函数(服务层内部使用,不对外导出) --------------------------------------- -- _resolve_corp_id(corp_id) — 解析 corp_id,None 时用当前企业 -- _get_or_create_client(corp_id, force) — 带缓存的 client 工厂 -- _sealai_call(corp_id, fn, *args, **kwargs) — 调用 SealAI API,401 时自动恢复并重试 - -缓存设计 --------- -磁盘(~/.config/ekb-cli/sealai_tokens.json): - { "corpId": { "token": "...", "fetched_at": 1712345678 } } - → CLI 进程间共享,TTL = _TOKEN_TTL 秒 - -内存(模块级 _client_cache): - { "corpId": (SealAiClient, fetched_at_float) } - → 进程内复用 httpx 连接池;CLI 进程结束自然回收,Server 长期保持 - -两层缓存的 TTL 相同(_TOKEN_TTL)。token 刷新时同步驱逐内存 client,确保 -client 携带的 Authorization header 始终与最新 token 一致。 -""" - -from __future__ import annotations -import json -import time -from pathlib import Path -from typing import Any, Callable - -import httpx - -from ekb_cli import config as ekb_config -from ekb_cli.errors import NotLoggedInError, AuthenticationError, ApiResponseError -from ekb_cli.api.sealai.client import SealAiClient -from ekb_cli.api.sealai.auth_api import get_me as api_get_me -from ekb_cli.api.sealai.schemas import MeData - - -# ── 常量 ────────────────────────────────────────────────────────────────────── - -_TOKEN_CACHE_PATH = Path.home() / ".config" / "ekb-cli" / "sealai_tokens.json" -_TOKEN_TTL = 3600 # 保守 1 小时,到期前强制刷新 - - -# ── 内存 client 缓存 ────────────────────────────────────────────────────────── -# key: corp_id, value: (SealAiClient, fetched_at) -# CLI 进程结束自动回收;Server 进程中长期保持,复用 httpx 连接池。 - -_client_cache: dict[str, tuple[SealAiClient, float]] = {} - - -# ── 磁盘 token 缓存(私有) ─────────────────────────────────────────────────── - -def _load_token_cache() -> dict: - if _TOKEN_CACHE_PATH.exists(): - try: - return json.loads(_TOKEN_CACHE_PATH.read_text()) - except (json.JSONDecodeError, OSError): - pass - return {} - - -def _save_token_cache(cache: dict) -> None: - _TOKEN_CACHE_PATH.parent.mkdir(parents=True, exist_ok=True) - _TOKEN_CACHE_PATH.write_text(json.dumps(cache, indent=2, ensure_ascii=False)) - - -def _fetch_token(corp_id: str, access_token: str) -> str: - """用快报 accesstoken 向 SealAI 换取 Bearer JWT(SSO)。""" - url = f"https://{corp_id.lower()}.sealai.cc/api/auth/oauth2/session/oem-hosecloud" - try: - resp = httpx.get( - url, - params={"token": access_token, "returnToken": "1"}, - headers={"Accept": "application/json"}, - timeout=15, - follow_redirects=True, - ) - resp.raise_for_status() - except httpx.HTTPStatusError as e: - if e.response.status_code == 401: - raise AuthenticationError("快报 token 无效,无法登录 SealAI") - raise ApiResponseError(e.response.status_code, str(e)) - - data = resp.json() - # 响应:{ "token": "..." } 或 { "data": { "token": "..." } } - token = data.get("token") or (data.get("data") or {}).get("token") - if not token: - raise AuthenticationError(f"SealAI SSO 响应中未找到 token:{data}") - return token - - -def _get_bearer_token(corp_id: str, force_refresh: bool = False) -> str: - """获取 Bearer token(优先读磁盘缓存,过期或 force_refresh 时重新换取)。 - - 此函数为内部实现细节,外部不应直接调用。 - """ - cache = _load_token_cache() - entry = cache.get(corp_id, {}) - now = int(time.time()) - - if not force_refresh and entry.get("token") and (now - entry.get("fetched_at", 0)) < _TOKEN_TTL: - return entry["token"] - - corp = ekb_config.get_corp(corp_id) - if not corp: - raise NotLoggedInError(f"企业 {corp_id} 未配置快报认证,请先运行 ekb auth add") - - token = _fetch_token(corp_id, corp["access_token"]) - cache[corp_id] = {"token": token, "fetched_at": now} - _save_token_cache(cache) - return token - - -# ── 对外公共接口 ────────────────────────────────────────────────────────────── - -def invalidate_token(corp_id: str) -> None: - """清除指定企业的全部缓存(磁盘 token + 内存 client)。 - - 调用场景: - - 用户显式执行 --refresh 参数 - - 服务层内部在 401 后自动调用(见 _sealai_call) - - 清除内存 client 是必要的:client 构造时已将 token 写入 Authorization header, - token 失效后若继续复用 client,所有请求都会继续 401。 - """ - # 清磁盘 - cache = _load_token_cache() - cache.pop(corp_id, None) - _save_token_cache(cache) - # 清内存:同时 close 旧 client,释放 httpx 连接池(Server 长进程尤为重要) - old = _client_cache.pop(corp_id, None) - if old is not None: - old[0].close() - - -def get_bearer_token(corp_id: str, force_refresh: bool = False) -> str: - """获取当前企业的 Bearer JWT 字符串(主要供调试 / 外部集成使用)。 - - 正常业务调用应走 _sealai_call,不需要直接拿 token。 - """ - if corp_id is None: - corp_id = ekb_config.get_current_corp_id() - if not corp_id: - raise NotLoggedInError() - return _get_bearer_token(corp_id, force_refresh=force_refresh) - - -# ── 内部工具函数 ────────────────────────────────────────────────────────────── - -def _resolve_corp_id(corp_id: str | None) -> str: - """将 None 解析为当前配置企业的 corp_id,未登录时抛 NotLoggedInError。""" - if corp_id is not None: - return corp_id - resolved = ekb_config.get_current_corp_id() - if not resolved: - raise NotLoggedInError() - return resolved - - -def _get_or_create_client(corp_id: str, force_refresh: bool = False) -> SealAiClient: - """带 TTL 缓存的 SealAiClient 工厂。 - - 缓存命中条件: - - 内存中有该 corp_id 的 client - - 距创建时间未超过 _TOKEN_TTL - - 未强制刷新 - - 缓存未命中时:重新获取 token(走磁盘缓存或 SSO),创建新 client,写入内存缓存。 - """ - now = time.time() - - if not force_refresh: - cached = _client_cache.get(corp_id) - if cached: - client, fetched_at = cached - if now - fetched_at < _TOKEN_TTL: - return client - - # 缓存未命中或强制刷新:获取 token,构造新 client - # 若缓存里已有旧 client(TTL 到期),先 close 释放连接池,再替换 - token = _get_bearer_token(corp_id, force_refresh=force_refresh) - client = SealAiClient(corp_id=corp_id, bearer_token=token) - old = _client_cache.get(corp_id) - if old is not None: - old[0].close() - _client_cache[corp_id] = (client, now) - return client - - -def _sealai_call(corp_id: str, fn: Callable[..., Any], *args: Any, **kwargs: Any) -> Any: - """统一的 SealAI API 调用入口,内置 401 自动恢复与单次重试。 - - 调用流程: - 1. 从缓存获取(或新建)SealAiClient - 2. 调用 fn(client, *args, **kwargs) - 3. 若抛 AuthenticationError(401): - a. 清除内存 client + 磁盘 token(invalidate_token) - b. 强制重新获取 token,构造新 client - c. 重试一次 fn(new_client, *args, **kwargs) - d. 若仍然 401 则向上抛出 - - 所有 SealAI 业务函数都应通过此函数发起调用,不应自行管理 client。 - """ - client = _get_or_create_client(corp_id) - try: - return fn(client, *args, **kwargs) - except AuthenticationError: - # token 已被服务端吊销或提前失效,清缓存重试一次 - invalidate_token(corp_id) - client = _get_or_create_client(corp_id, force_refresh=True) - return fn(client, *args, **kwargs) - - -def get_whoami(corp_id: str | None = None, force_refresh: bool = False) -> MeData: - """查询当前 SealAI 用户身份及租户信息。 - - commands/server 调用此函数,无需感知 SealAiClient 的存在。 - - Args: - corp_id: 企业 ID,None 时使用当前配置企业 - force_refresh: 强制刷新 Bearer token(token 被手动吊销后使用) - """ - resolved = _resolve_corp_id(corp_id) - if force_refresh: - invalidate_token(resolved) - return _sealai_call(resolved, api_get_me) diff --git a/src/ekb_cli/services/sealai/billing_service.py b/src/ekb_cli/services/sealai/billing_service.py deleted file mode 100644 index 2509061..0000000 --- a/src/ekb_cli/services/sealai/billing_service.py +++ /dev/null @@ -1,39 +0,0 @@ -"""SealAI 计费 / 订阅业务逻辑层。 - -不接受 SealAiClient 参数,由 auth_service._sealai_call 统一管理 client 生命周期。 -调用方只需传 corp_id(None 表示使用当前企业)。 - -功能配额 code 参考 ------------------- - ai-approval AI 审批余额(balance 型) - approval-rules 审核规则配额(quota 型) - ai-fill AI 填单开关(enabled 型) - financial-policies 财务制度配额(quota 型) - knowledge-documents 知识文档配额(quota 型) -""" - -from ekb_cli.api.sealai import get_billing_status -from ekb_cli.api.sealai.schemas import BillingStatusData, Feature -from ekb_cli.services.sealai.auth_service import _resolve_corp_id, _sealai_call - - -def query_billing_status(corp_id: str | None = None) -> BillingStatusData: - """查询当前企业订阅状态及各功能配额。 - - Args: - corp_id: 企业 ID,None 时使用当前配置企业 - """ - resolved = _resolve_corp_id(corp_id) - return _sealai_call(resolved, get_billing_status) - - -def get_feature_usage(corp_id: str | None = None, code: str = "") -> Feature | None: - """查询单个功能项使用情况,不存在时返回 None。 - - Args: - corp_id: 企业 ID,None 时使用当前配置企业 - code: 功能 code,见模块 docstring - """ - resolved = _resolve_corp_id(corp_id) - status = _sealai_call(resolved, get_billing_status) - return status.get_feature(code) diff --git a/src/ekb_cli/services/sealai/knowledge_service.py b/src/ekb_cli/services/sealai/knowledge_service.py deleted file mode 100644 index d634376..0000000 --- a/src/ekb_cli/services/sealai/knowledge_service.py +++ /dev/null @@ -1,180 +0,0 @@ -"""SealAI 知识文档业务逻辑层。 - -管理知识文档的增删改查。 -知识文档是 AI 审批的训练素材,支持按场景(audit/fill)分类, -内容以 Markdown 格式存储,前端可渲染。 - -不接受 SealAiClient 参数,由 auth_service._sealai_call 统一管理 client 生命周期。 -调用方只需传 corp_id(None 表示使用当前企业)。 - -枚举常量 --------- -scenarios(适用场景): - "audit" —— AI 审批场景(审单、规则匹配) - "fill" —— AI 填单场景(智能填报) - -status(文档状态): - "published" —— 已发布,AI 可读取 - "draft" —— 草稿,AI 不读取 - -content_type(内容类型): - "policy" —— 公司政策(默认) - 其他值视 SealAI 平台支持情况而定 - -tags: - "__all__" —— 适用于全部分类(特殊保留值) -""" - -from typing import Optional -from ekb_cli.api.sealai.knowledge_api import ( - list_articles, - get_article, - create_article, - patch_article, -) -from ekb_cli.api.sealai.schemas import ( - KnowledgeArticle, - KnowledgeArticleListData, -) -from ekb_cli.services.sealai.auth_service import _resolve_corp_id, _sealai_call - -# 合法场景值 -_VALID_SCENARIOS = {"audit", "fill"} -# 合法状态值 -_VALID_STATUSES = {"published", "draft"} - - -def get_articles( - corp_id: str | None = None, - *, - scenarios: Optional[list[str]] = None, - offset: int = 0, - limit: int = 20, - sort_by: str = "createdAt", - sort_order: str = "desc", -) -> KnowledgeArticleListData: - """查询知识文档列表。 - - Args: - corp_id: 企业 ID,None 时使用当前配置企业 - scenarios: 按场景过滤,可选值 \"audit\" | \"fill\",None 表示不过滤 - offset: 分页偏移量(默认 0) - limit: 每页数量(默认 20,建议不超过 100) - sort_by: 排序字段(默认 createdAt) - sort_order: \"asc\" | \"desc\"(默认 desc,最新在前) - """ - if scenarios: - _validate_scenarios(scenarios) - resolved = _resolve_corp_id(corp_id) - return _sealai_call( - resolved, list_articles, - scenarios=scenarios, - offset=offset, - limit=limit, - sort_by=sort_by, - sort_order=sort_order, - ) - - -def get_article_detail(corp_id: str | None = None, article_id: str = "") -> KnowledgeArticle: - """查询单篇知识文档详情。 - - Args: - corp_id: 企业 ID,None 时使用当前配置企业 - article_id: 文档 ID - """ - resolved = _resolve_corp_id(corp_id) - return _sealai_call(resolved, get_article, article_id) - - -def add_article( - corp_id: str | None = None, - *, - title: str, - purpose: str, - content: str, - content_type: str = "policy", - status: str = "published", - scenarios: Optional[list[str]] = None, - tags: Optional[list[str]] = None, -) -> KnowledgeArticle: - """新建知识文档。 - - Args: - corp_id: 企业 ID,None 时使用当前配置企业 - title: 文档标题 - purpose: 适用说明 - content: 正文(Markdown 格式) - content_type: 内容类型,默认 \"policy\" - status: \"published\" | \"draft\",默认 \"published\" - scenarios: 适用场景,如 [\"audit\", \"fill\"] - tags: 标签列表,\"__all__\" 表示全部适用 - """ - if status not in _VALID_STATUSES: - from ekb_cli.errors import EkbError - raise EkbError(f"status 无效:{status!r},合法值为 {sorted(_VALID_STATUSES)}", code=422) - if scenarios: - _validate_scenarios(scenarios) - resolved = _resolve_corp_id(corp_id) - return _sealai_call( - resolved, create_article, - title=title, - purpose=purpose, - content=content, - content_type=content_type, - status=status, - scenarios=scenarios, - tags=tags, - ) - - -def edit_article( - corp_id: str | None = None, - article_id: str = "", - *, - title: Optional[str] = None, - purpose: Optional[str] = None, - content: Optional[str] = None, - content_type: Optional[str] = None, - status: Optional[str] = None, - enabled: Optional[bool] = None, - scenarios: Optional[list[str]] = None, - tags: Optional[list[str]] = None, -) -> KnowledgeArticle: - """更新知识文档(只传需要改动的字段)。 - - Args: - corp_id: 企业 ID,None 时使用当前配置企业 - article_id: 文档 ID - 其余参数: 对应字段的新值,不传则保持原值 - """ - if status is not None and status not in _VALID_STATUSES: - from ekb_cli.errors import EkbError - raise EkbError(f"status 无效:{status!r},合法值为 {sorted(_VALID_STATUSES)}", code=422) - if scenarios is not None: - _validate_scenarios(scenarios) - resolved = _resolve_corp_id(corp_id) - return _sealai_call( - resolved, patch_article, - article_id, - title=title, - purpose=purpose, - content=content, - content_type=content_type, - status=status, - enabled=enabled, - scenarios=scenarios, - tags=tags, - ) - - -# ── 内部校验 ────────────────────────────────────────────────────────────────── - -def _validate_scenarios(scenarios: list[str]) -> None: - invalid = set(scenarios) - _VALID_SCENARIOS - if invalid: - from ekb_cli.errors import EkbError - raise EkbError( - f"scenarios 包含无效值:{sorted(invalid)},合法值为 {sorted(_VALID_SCENARIOS)}", - code=422, - ) diff --git a/src/ekb_cli/services/sealai/preference_service.py b/src/ekb_cli/services/sealai/preference_service.py deleted file mode 100644 index b7559a2..0000000 --- a/src/ekb_cli/services/sealai/preference_service.py +++ /dev/null @@ -1,81 +0,0 @@ -"""SealAI 风格偏好业务逻辑层。 - -管理 AI 审批配置的读取与更新(决策场景提示词 + 集成系统信息)。 - -不接受 SealAiClient 参数,由 auth_service._sealai_call 统一管理 client 生命周期。 -调用方只需传 corp_id(None 表示使用当前企业)。 - -核心设计:POST 是整体替换语义,因此 update_decision_preferences() 会先 GET -当前配置,patch 指定字段,再整体 POST 回去——对上层调用方透明。 -""" - -from ekb_cli.api.sealai.preference_api import ( - get_ai_approval_config, - save_ai_approval_config, -) -from ekb_cli.api.sealai.schemas import ( - AiApprovalConfig, - AiApprovalSaveResult, - DecisionPreferences, -) -from ekb_cli.services.sealai.auth_service import _resolve_corp_id, _sealai_call - - -def get_preference(corp_id: str | None = None) -> AiApprovalConfig: - """查询当前 AI 审批配置(风格偏好 + 集成系统信息)。 - - Args: - corp_id: 企业 ID,None 时使用当前配置企业 - """ - resolved = _resolve_corp_id(corp_id) - return _sealai_call(resolved, get_ai_approval_config) - - -def update_decision_preferences( - corp_id: str | None = None, - *, - explicit_approve: str | None = None, - explicit_reject: str | None = None, - exempt_approve: str | None = None, - review: str | None = None, -) -> AiApprovalSaveResult: - """Patch 式更新决策偏好(只传需要改动的字段)。 - - 内部会先 GET 当前配置,合并改动后整体 POST 回去, - 确保 integrations 等无关字段不丢失。 - - Args: - corp_id: 企业 ID,None 时使用当前配置企业 - explicit_approve: 明确通过的条件描述(不传则保持不变) - explicit_reject: 明确拒绝的条件描述(不传则保持不变) - exempt_approve: 豁免通过的条件描述(不传则保持不变) - review: 转人工判断的条件描述(不传则保持不变) - Returns: - AiApprovalSaveResult,含 success 标志。 - """ - resolved = _resolve_corp_id(corp_id) - current = _sealai_call(resolved, get_ai_approval_config) - prefs = current.decisionPreferences - - new_prefs = DecisionPreferences( - explicitApprove=explicit_approve if explicit_approve is not None else prefs.explicitApprove, - explicitReject=explicit_reject if explicit_reject is not None else prefs.explicitReject, - exemptApprove=exempt_approve if exempt_approve is not None else prefs.exemptApprove, - review=review if review is not None else prefs.review, - ) - updated = current.model_copy(update={"decisionPreferences": new_prefs}) - return _sealai_call(resolved, save_ai_approval_config, updated) - - -def save_preference( - corp_id: str | None = None, - config: AiApprovalConfig | None = None, -) -> AiApprovalSaveResult: - """直接保存完整的 AI 审批配置(整体替换,适合高阶调用方)。 - - Args: - corp_id: 企业 ID,None 时使用当前配置企业 - config: 完整配置对象 - """ - resolved = _resolve_corp_id(corp_id) - return _sealai_call(resolved, save_ai_approval_config, config) diff --git a/src/ekb_cli/services/sealai/rules_service.py b/src/ekb_cli/services/sealai/rules_service.py deleted file mode 100644 index c852d40..0000000 --- a/src/ekb_cli/services/sealai/rules_service.py +++ /dev/null @@ -1,144 +0,0 @@ -"""SealAI 审核规则业务逻辑层。 - -管理草稿区规则的增删改查,以及已发布版本历史的查询和发布操作。 - -不接受 SealAiClient 参数,由 auth_service._sealai_call 统一管理 client 生命周期。 -调用方只需传 corp_id(None 表示使用当前企业)。 - -strictness 取值 ---------------- - MUST_FOLLOW 必须遵守(最严格,违规直接驳回) - SHOULD_FOLLOW 应该遵守(违规可提示但不强制驳回) - SUGGESTION 建议遵守(仅作为参考提示) -""" - -from ekb_cli.api.sealai.rules_api import ( - list_rules, - create_rule, - update_rule, - delete_rule, - list_rule_set_versions, - publish_rule_set_version, -) -from ekb_cli.api.sealai.schemas import ( - DraftRule, - DraftRulesData, - RuleSetVersion, - PublishVersionData, -) -from ekb_cli.services.sealai.auth_service import _resolve_corp_id, _sealai_call - - -# ── 草稿区规则 CRUD ──────────────────────────────────────────────────────────── - -def get_draft_rules(corp_id: str | None = None) -> DraftRulesData: - """查询草稿区所有审核规则。 - - Args: - corp_id: 企业 ID,None 时使用当前配置企业 - """ - resolved = _resolve_corp_id(corp_id) - return _sealai_call(resolved, list_rules) - - -def add_draft_rule( - corp_id: str | None = None, - *, - description: str, - scope: str, - strictness: str = "MUST_FOLLOW", -) -> DraftRule: - """新建草稿审核规则。 - - Args: - corp_id: 企业 ID,None 时使用当前配置企业 - description: 规则描述 - scope: 适用场景(费用类型等自由文本) - strictness: MUST_FOLLOW | SHOULD_FOLLOW | SUGGESTION,默认 MUST_FOLLOW - """ - _validate_strictness(strictness) - resolved = _resolve_corp_id(corp_id) - return _sealai_call( - resolved, create_rule, - description=description, scope=scope, strictness=strictness, - ) - - -def edit_draft_rule( - corp_id: str | None = None, - rule_id: str = "", - *, - description: str | None = None, - scope: str | None = None, - strictness: str | None = None, -) -> DraftRule: - """更新草稿规则(只传要改动的字段)。 - - Args: - corp_id: 企业 ID,None 时使用当前配置企业 - rule_id: 规则 ID - description: 新描述(不传则保持原值) - scope: 新适用场景(不传则保持原值) - strictness: 新严格度(不传则保持原值) - """ - if strictness is not None: - _validate_strictness(strictness) - resolved = _resolve_corp_id(corp_id) - return _sealai_call( - resolved, update_rule, - rule_id, description=description, scope=scope, strictness=strictness, - ) - - -def remove_draft_rule(corp_id: str | None = None, rule_id: str = "") -> None: - """删除草稿规则。 - - Args: - corp_id: 企业 ID,None 时使用当前配置企业 - rule_id: 规则 ID - """ - resolved = _resolve_corp_id(corp_id) - _sealai_call(resolved, delete_rule, rule_id) - - -# ── 已发布版本 ──────────────────────────────────────────────────────────────── - -def get_published_versions(corp_id: str | None = None) -> list[RuleSetVersion]: - """查询已发布的规则集版本历史(最新版本在前)。 - - Args: - corp_id: 企业 ID,None 时使用当前配置企业 - """ - resolved = _resolve_corp_id(corp_id) - return _sealai_call(resolved, list_rule_set_versions) - - -def publish_draft_rules( - corp_id: str | None = None, - *, - version_name: str, -) -> PublishVersionData: - """将当前草稿区规则发布为新版本。 - - Args: - corp_id: 企业 ID,None 时使用当前配置企业 - version_name: 版本名称,建议格式:\"审核规则 版本N\" - Returns: - PublishVersionData,含新版本快照和规则数量 - """ - resolved = _resolve_corp_id(corp_id) - return _sealai_call(resolved, publish_rule_set_version, version_name=version_name) - - -# ── 内部校验 ────────────────────────────────────────────────────────────────── - -_VALID_STRICTNESS = {"MUST_FOLLOW", "SHOULD_FOLLOW", "SUGGESTION"} - - -def _validate_strictness(value: str) -> None: - if value not in _VALID_STRICTNESS: - from ekb_cli.errors import EkbError - raise EkbError( - f"strictness 无效:{value!r},合法值为 {sorted(_VALID_STRICTNESS)}", - code=422, - ) diff --git a/tmp_test/raw_check.py b/tmp_test/raw_check.py deleted file mode 100644 index 404e995..0000000 --- a/tmp_test/raw_check.py +++ /dev/null @@ -1,8 +0,0 @@ -"""诊断脚本:直接看 API 返回的原始 JSON""" - -from ekb_cli.api import get_client - -with get_client() as client: - raw = client.get("/engine/hab/agent/list", page=1, size=5) - import json - print(json.dumps(raw, indent=2, ensure_ascii=False)) diff --git a/tmp_test/try_api.py b/tmp_test/try_api.py deleted file mode 100644 index 2bd4453..0000000 --- a/tmp_test/try_api.py +++ /dev/null @@ -1,30 +0,0 @@ -"""临时脚本:直接用 api 层,验证它能不能当 SDK 用。 - -任务:列出所有 Agent → 逐个拉详情拿关联规则 → 去重 → 返回结构化数据。 -""" - -import json -from ekb_cli.api import get_client, list_agents, get_agent - - -def get_all_linked_rules() -> list[dict]: - """拿到所有 Agent 关联的规则,去重,返回字典列表。""" - with get_client() as client: - agents = list_agents(client).items - - seen: set[str] = set() - rules: list[dict] = [] - - for a in agents: - detail = get_agent(client, a.id) - for r in detail.agentRule: - if r.id not in seen: - seen.add(r.id) - rules.append(r.model_dump()) - - return rules - - -if __name__ == "__main__": - result = get_all_linked_rules() - print(json.dumps(result, indent=2, ensure_ascii=False)) diff --git a/uv.lock b/uv.lock deleted file mode 100644 index 21493c5..0000000 --- a/uv.lock +++ /dev/null @@ -1,640 +0,0 @@ -version = 1 -revision = 3 -requires-python = ">=3.12" - -[[package]] -name = "annotated-doc" -version = "0.0.4" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/57/ba/046ceea27344560984e26a590f90bc7f4a75b06701f653222458922b558c/annotated_doc-0.0.4.tar.gz", hash = "sha256:fbcda96e87e9c92ad167c2e53839e57503ecfda18804ea28102353485033faa4", size = 7288, upload-time = "2025-11-10T22:07:42.062Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/1e/d3/26bf1008eb3d2daa8ef4cacc7f3bfdc11818d111f7e2d0201bc6e3b49d45/annotated_doc-0.0.4-py3-none-any.whl", hash = "sha256:571ac1dc6991c450b25a9c2d84a3705e2ae7a53467b5d111c24fa8baabbed320", size = 5303, upload-time = "2025-11-10T22:07:40.673Z" }, -] - -[[package]] -name = "annotated-types" -version = "0.7.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081, upload-time = "2024-05-20T21:33:25.928Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" }, -] - -[[package]] -name = "anyio" -version = "4.13.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "idna" }, - { name = "typing-extensions", marker = "python_full_version < '3.13'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/19/14/2c5dd9f512b66549ae92767a9c7b330ae88e1932ca57876909410251fe13/anyio-4.13.0.tar.gz", hash = "sha256:334b70e641fd2221c1505b3890c69882fe4a2df910cba14d97019b90b24439dc", size = 231622, upload-time = "2026-03-24T12:59:09.671Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/da/42/e921fccf5015463e32a3cf6ee7f980a6ed0f395ceeaa45060b61d86486c2/anyio-4.13.0-py3-none-any.whl", hash = "sha256:08b310f9e24a9594186fd75b4f73f4a4152069e3853f1ed8bfbf58369f4ad708", size = 114353, upload-time = "2026-03-24T12:59:08.246Z" }, -] - -[[package]] -name = "certifi" -version = "2026.2.25" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/af/2d/7bf41579a8986e348fa033a31cdd0e4121114f6bce2457e8876010b092dd/certifi-2026.2.25.tar.gz", hash = "sha256:e887ab5cee78ea814d3472169153c2d12cd43b14bd03329a39a9c6e2e80bfba7", size = 155029, upload-time = "2026-02-25T02:54:17.342Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/9a/3c/c17fb3ca2d9c3acff52e30b309f538586f9f5b9c9cf454f3845fc9af4881/certifi-2026.2.25-py3-none-any.whl", hash = "sha256:027692e4402ad994f1c42e52a4997a9763c646b73e4096e4d5d6db8af1d6f0fa", size = 153684, upload-time = "2026-02-25T02:54:15.766Z" }, -] - -[[package]] -name = "click" -version = "8.3.2" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "colorama", marker = "sys_platform == 'win32'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/57/75/31212c6bf2503fdf920d87fee5d7a86a2e3bcf444984126f13d8e4016804/click-8.3.2.tar.gz", hash = "sha256:14162b8b3b3550a7d479eafa77dfd3c38d9dc8951f6f69c78913a8f9a7540fd5", size = 302856, upload-time = "2026-04-03T19:14:45.118Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/e4/20/71885d8b97d4f3dde17b1fdb92dbd4908b00541c5a3379787137285f602e/click-8.3.2-py3-none-any.whl", hash = "sha256:1924d2c27c5653561cd2cae4548d1406039cb79b858b747cfea24924bbc1616d", size = 108379, upload-time = "2026-04-03T19:14:43.505Z" }, -] - -[[package]] -name = "colorama" -version = "0.4.6" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, -] - -[[package]] -name = "ekb-cli" -version = "0.1.0" -source = { editable = "." } -dependencies = [ - { name = "fastapi" }, - { name = "httpx", extra = ["socks"] }, - { name = "pydantic" }, - { name = "questionary" }, - { name = "rich" }, - { name = "typer" }, - { name = "uvicorn", extra = ["standard"] }, -] - -[package.metadata] -requires-dist = [ - { name = "fastapi", specifier = ">=0.115.0" }, - { name = "httpx", extras = ["socks"], specifier = ">=0.28.1" }, - { name = "pydantic", specifier = ">=2.12.5" }, - { name = "questionary", specifier = ">=2.1.1" }, - { name = "rich", specifier = ">=14.3.3" }, - { name = "typer", specifier = ">=0.24.1" }, - { name = "uvicorn", extras = ["standard"], specifier = ">=0.34.0" }, -] - -[[package]] -name = "fastapi" -version = "0.135.3" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "annotated-doc" }, - { name = "pydantic" }, - { name = "starlette" }, - { name = "typing-extensions" }, - { name = "typing-inspection" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/f7/e6/7adb4c5fa231e82c35b8f5741a9f2d055f520c29af5546fd70d3e8e1cd2e/fastapi-0.135.3.tar.gz", hash = "sha256:bd6d7caf1a2bdd8d676843cdcd2287729572a1ef524fc4d65c17ae002a1be654", size = 396524, upload-time = "2026-04-01T16:23:58.188Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/84/a4/5caa2de7f917a04ada20018eccf60d6cc6145b0199d55ca3711b0fc08312/fastapi-0.135.3-py3-none-any.whl", hash = "sha256:9b0f590c813acd13d0ab43dd8494138eb58e484bfac405db1f3187cfc5810d98", size = 117734, upload-time = "2026-04-01T16:23:59.328Z" }, -] - -[[package]] -name = "h11" -version = "0.16.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, -] - -[[package]] -name = "httpcore" -version = "1.0.9" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "certifi" }, - { name = "h11" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, -] - -[[package]] -name = "httptools" -version = "0.7.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b5/46/120a669232c7bdedb9d52d4aeae7e6c7dfe151e99dc70802e2fc7a5e1993/httptools-0.7.1.tar.gz", hash = "sha256:abd72556974f8e7c74a259655924a717a2365b236c882c3f6f8a45fe94703ac9", size = 258961, upload-time = "2025-10-10T03:55:08.559Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/53/7f/403e5d787dc4942316e515e949b0c8a013d84078a915910e9f391ba9b3ed/httptools-0.7.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:38e0c83a2ea9746ebbd643bdfb521b9aa4a91703e2cd705c20443405d2fd16a5", size = 206280, upload-time = "2025-10-10T03:54:39.274Z" }, - { url = "https://files.pythonhosted.org/packages/2a/0d/7f3fd28e2ce311ccc998c388dd1c53b18120fda3b70ebb022b135dc9839b/httptools-0.7.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f25bbaf1235e27704f1a7b86cd3304eabc04f569c828101d94a0e605ef7205a5", size = 110004, upload-time = "2025-10-10T03:54:40.403Z" }, - { url = "https://files.pythonhosted.org/packages/84/a6/b3965e1e146ef5762870bbe76117876ceba51a201e18cc31f5703e454596/httptools-0.7.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:2c15f37ef679ab9ecc06bfc4e6e8628c32a8e4b305459de7cf6785acd57e4d03", size = 517655, upload-time = "2025-10-10T03:54:41.347Z" }, - { url = "https://files.pythonhosted.org/packages/11/7d/71fee6f1844e6fa378f2eddde6c3e41ce3a1fb4b2d81118dd544e3441ec0/httptools-0.7.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7fe6e96090df46b36ccfaf746f03034e5ab723162bc51b0a4cf58305324036f2", size = 511440, upload-time = "2025-10-10T03:54:42.452Z" }, - { url = "https://files.pythonhosted.org/packages/22/a5/079d216712a4f3ffa24af4a0381b108aa9c45b7a5cc6eb141f81726b1823/httptools-0.7.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:f72fdbae2dbc6e68b8239defb48e6a5937b12218e6ffc2c7846cc37befa84362", size = 495186, upload-time = "2025-10-10T03:54:43.937Z" }, - { url = "https://files.pythonhosted.org/packages/e9/9e/025ad7b65278745dee3bd0ebf9314934c4592560878308a6121f7f812084/httptools-0.7.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e99c7b90a29fd82fea9ef57943d501a16f3404d7b9ee81799d41639bdaae412c", size = 499192, upload-time = "2025-10-10T03:54:45.003Z" }, - { url = "https://files.pythonhosted.org/packages/6d/de/40a8f202b987d43afc4d54689600ff03ce65680ede2f31df348d7f368b8f/httptools-0.7.1-cp312-cp312-win_amd64.whl", hash = "sha256:3e14f530fefa7499334a79b0cf7e7cd2992870eb893526fb097d51b4f2d0f321", size = 86694, upload-time = "2025-10-10T03:54:45.923Z" }, - { url = "https://files.pythonhosted.org/packages/09/8f/c77b1fcbfd262d422f12da02feb0d218fa228d52485b77b953832105bb90/httptools-0.7.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:6babce6cfa2a99545c60bfef8bee0cc0545413cb0018f617c8059a30ad985de3", size = 202889, upload-time = "2025-10-10T03:54:47.089Z" }, - { url = "https://files.pythonhosted.org/packages/0a/1a/22887f53602feaa066354867bc49a68fc295c2293433177ee90870a7d517/httptools-0.7.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:601b7628de7504077dd3dcb3791c6b8694bbd967148a6d1f01806509254fb1ca", size = 108180, upload-time = "2025-10-10T03:54:48.052Z" }, - { url = "https://files.pythonhosted.org/packages/32/6a/6aaa91937f0010d288d3d124ca2946d48d60c3a5ee7ca62afe870e3ea011/httptools-0.7.1-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:04c6c0e6c5fb0739c5b8a9eb046d298650a0ff38cf42537fc372b28dc7e4472c", size = 478596, upload-time = "2025-10-10T03:54:48.919Z" }, - { url = "https://files.pythonhosted.org/packages/6d/70/023d7ce117993107be88d2cbca566a7c1323ccbaf0af7eabf2064fe356f6/httptools-0.7.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:69d4f9705c405ae3ee83d6a12283dc9feba8cc6aaec671b412917e644ab4fa66", size = 473268, upload-time = "2025-10-10T03:54:49.993Z" }, - { url = "https://files.pythonhosted.org/packages/32/4d/9dd616c38da088e3f436e9a616e1d0cc66544b8cdac405cc4e81c8679fc7/httptools-0.7.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:44c8f4347d4b31269c8a9205d8a5ee2df5322b09bbbd30f8f862185bb6b05346", size = 455517, upload-time = "2025-10-10T03:54:51.066Z" }, - { url = "https://files.pythonhosted.org/packages/1d/3a/a6c595c310b7df958e739aae88724e24f9246a514d909547778d776799be/httptools-0.7.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:465275d76db4d554918aba40bf1cbebe324670f3dfc979eaffaa5d108e2ed650", size = 458337, upload-time = "2025-10-10T03:54:52.196Z" }, - { url = "https://files.pythonhosted.org/packages/fd/82/88e8d6d2c51edc1cc391b6e044c6c435b6aebe97b1abc33db1b0b24cd582/httptools-0.7.1-cp313-cp313-win_amd64.whl", hash = "sha256:322d00c2068d125bd570f7bf78b2d367dad02b919d8581d7476d8b75b294e3e6", size = 85743, upload-time = "2025-10-10T03:54:53.448Z" }, - { url = "https://files.pythonhosted.org/packages/34/50/9d095fcbb6de2d523e027a2f304d4551855c2f46e0b82befd718b8b20056/httptools-0.7.1-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:c08fe65728b8d70b6923ce31e3956f859d5e1e8548e6f22ec520a962c6757270", size = 203619, upload-time = "2025-10-10T03:54:54.321Z" }, - { url = "https://files.pythonhosted.org/packages/07/f0/89720dc5139ae54b03f861b5e2c55a37dba9a5da7d51e1e824a1f343627f/httptools-0.7.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:7aea2e3c3953521c3c51106ee11487a910d45586e351202474d45472db7d72d3", size = 108714, upload-time = "2025-10-10T03:54:55.163Z" }, - { url = "https://files.pythonhosted.org/packages/b3/cb/eea88506f191fb552c11787c23f9a405f4c7b0c5799bf73f2249cd4f5228/httptools-0.7.1-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:0e68b8582f4ea9166be62926077a3334064d422cf08ab87d8b74664f8e9058e1", size = 472909, upload-time = "2025-10-10T03:54:56.056Z" }, - { url = "https://files.pythonhosted.org/packages/e0/4a/a548bdfae6369c0d078bab5769f7b66f17f1bfaa6fa28f81d6be6959066b/httptools-0.7.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:df091cf961a3be783d6aebae963cc9b71e00d57fa6f149025075217bc6a55a7b", size = 470831, upload-time = "2025-10-10T03:54:57.219Z" }, - { url = "https://files.pythonhosted.org/packages/4d/31/14df99e1c43bd132eec921c2e7e11cda7852f65619bc0fc5bdc2d0cb126c/httptools-0.7.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:f084813239e1eb403ddacd06a30de3d3e09a9b76e7894dcda2b22f8a726e9c60", size = 452631, upload-time = "2025-10-10T03:54:58.219Z" }, - { url = "https://files.pythonhosted.org/packages/22/d2/b7e131f7be8d854d48cb6d048113c30f9a46dca0c9a8b08fcb3fcd588cdc/httptools-0.7.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:7347714368fb2b335e9063bc2b96f2f87a9ceffcd9758ac295f8bbcd3ffbc0ca", size = 452910, upload-time = "2025-10-10T03:54:59.366Z" }, - { url = "https://files.pythonhosted.org/packages/53/cf/878f3b91e4e6e011eff6d1fa9ca39f7eb17d19c9d7971b04873734112f30/httptools-0.7.1-cp314-cp314-win_amd64.whl", hash = "sha256:cfabda2a5bb85aa2a904ce06d974a3f30fb36cc63d7feaddec05d2050acede96", size = 88205, upload-time = "2025-10-10T03:55:00.389Z" }, -] - -[[package]] -name = "httpx" -version = "0.28.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "anyio" }, - { name = "certifi" }, - { name = "httpcore" }, - { name = "idna" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" }, -] - -[package.optional-dependencies] -socks = [ - { name = "socksio" }, -] - -[[package]] -name = "idna" -version = "3.11" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/6f/6d/0703ccc57f3a7233505399edb88de3cbd678da106337b9fcde432b65ed60/idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902", size = 194582, upload-time = "2025-10-12T14:55:20.501Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/0e/61/66938bbb5fc52dbdf84594873d5b51fb1f7c7794e9c0f5bd885f30bc507b/idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea", size = 71008, upload-time = "2025-10-12T14:55:18.883Z" }, -] - -[[package]] -name = "markdown-it-py" -version = "4.0.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "mdurl" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/5b/f5/4ec618ed16cc4f8fb3b701563655a69816155e79e24a17b651541804721d/markdown_it_py-4.0.0.tar.gz", hash = "sha256:cb0a2b4aa34f932c007117b194e945bd74e0ec24133ceb5bac59009cda1cb9f3", size = 73070, upload-time = "2025-08-11T12:57:52.854Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/94/54/e7d793b573f298e1c9013b8c4dade17d481164aa517d1d7148619c2cedbf/markdown_it_py-4.0.0-py3-none-any.whl", hash = "sha256:87327c59b172c5011896038353a81343b6754500a08cd7a4973bb48c6d578147", size = 87321, upload-time = "2025-08-11T12:57:51.923Z" }, -] - -[[package]] -name = "mdurl" -version = "0.1.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" }, -] - -[[package]] -name = "prompt-toolkit" -version = "3.0.52" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "wcwidth" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/a1/96/06e01a7b38dce6fe1db213e061a4602dd6032a8a97ef6c1a862537732421/prompt_toolkit-3.0.52.tar.gz", hash = "sha256:28cde192929c8e7321de85de1ddbe736f1375148b02f2e17edd840042b1be855", size = 434198, upload-time = "2025-08-27T15:24:02.057Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/84/03/0d3ce49e2505ae70cf43bc5bb3033955d2fc9f932163e84dc0779cc47f48/prompt_toolkit-3.0.52-py3-none-any.whl", hash = "sha256:9aac639a3bbd33284347de5ad8d68ecc044b91a762dc39b7c21095fcd6a19955", size = 391431, upload-time = "2025-08-27T15:23:59.498Z" }, -] - -[[package]] -name = "pydantic" -version = "2.12.5" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "annotated-types" }, - { name = "pydantic-core" }, - { name = "typing-extensions" }, - { name = "typing-inspection" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/69/44/36f1a6e523abc58ae5f928898e4aca2e0ea509b5aa6f6f392a5d882be928/pydantic-2.12.5.tar.gz", hash = "sha256:4d351024c75c0f085a9febbb665ce8c0c6ec5d30e903bdb6394b7ede26aebb49", size = 821591, upload-time = "2025-11-26T15:11:46.471Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/5a/87/b70ad306ebb6f9b585f114d0ac2137d792b48be34d732d60e597c2f8465a/pydantic-2.12.5-py3-none-any.whl", hash = "sha256:e561593fccf61e8a20fc46dfc2dfe075b8be7d0188df33f221ad1f0139180f9d", size = 463580, upload-time = "2025-11-26T15:11:44.605Z" }, -] - -[[package]] -name = "pydantic-core" -version = "2.41.5" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/71/70/23b021c950c2addd24ec408e9ab05d59b035b39d97cdc1130e1bce647bb6/pydantic_core-2.41.5.tar.gz", hash = "sha256:08daa51ea16ad373ffd5e7606252cc32f07bc72b28284b6bc9c6df804816476e", size = 460952, upload-time = "2025-11-04T13:43:49.098Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/5f/5d/5f6c63eebb5afee93bcaae4ce9a898f3373ca23df3ccaef086d0233a35a7/pydantic_core-2.41.5-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f41a7489d32336dbf2199c8c0a215390a751c5b014c2c1c5366e817202e9cdf7", size = 2110990, upload-time = "2025-11-04T13:39:58.079Z" }, - { url = "https://files.pythonhosted.org/packages/aa/32/9c2e8ccb57c01111e0fd091f236c7b371c1bccea0fa85247ac55b1e2b6b6/pydantic_core-2.41.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:070259a8818988b9a84a449a2a7337c7f430a22acc0859c6b110aa7212a6d9c0", size = 1896003, upload-time = "2025-11-04T13:39:59.956Z" }, - { url = "https://files.pythonhosted.org/packages/68/b8/a01b53cb0e59139fbc9e4fda3e9724ede8de279097179be4ff31f1abb65a/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e96cea19e34778f8d59fe40775a7a574d95816eb150850a85a7a4c8f4b94ac69", size = 1919200, upload-time = "2025-11-04T13:40:02.241Z" }, - { url = "https://files.pythonhosted.org/packages/38/de/8c36b5198a29bdaade07b5985e80a233a5ac27137846f3bc2d3b40a47360/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed2e99c456e3fadd05c991f8f437ef902e00eedf34320ba2b0842bd1c3ca3a75", size = 2052578, upload-time = "2025-11-04T13:40:04.401Z" }, - { url = "https://files.pythonhosted.org/packages/00/b5/0e8e4b5b081eac6cb3dbb7e60a65907549a1ce035a724368c330112adfdd/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:65840751b72fbfd82c3c640cff9284545342a4f1eb1586ad0636955b261b0b05", size = 2208504, upload-time = "2025-11-04T13:40:06.072Z" }, - { url = "https://files.pythonhosted.org/packages/77/56/87a61aad59c7c5b9dc8caad5a41a5545cba3810c3e828708b3d7404f6cef/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e536c98a7626a98feb2d3eaf75944ef6f3dbee447e1f841eae16f2f0a72d8ddc", size = 2335816, upload-time = "2025-11-04T13:40:07.835Z" }, - { url = "https://files.pythonhosted.org/packages/0d/76/941cc9f73529988688a665a5c0ecff1112b3d95ab48f81db5f7606f522d3/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eceb81a8d74f9267ef4081e246ffd6d129da5d87e37a77c9bde550cb04870c1c", size = 2075366, upload-time = "2025-11-04T13:40:09.804Z" }, - { url = "https://files.pythonhosted.org/packages/d3/43/ebef01f69baa07a482844faaa0a591bad1ef129253ffd0cdaa9d8a7f72d3/pydantic_core-2.41.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d38548150c39b74aeeb0ce8ee1d8e82696f4a4e16ddc6de7b1d8823f7de4b9b5", size = 2171698, upload-time = "2025-11-04T13:40:12.004Z" }, - { url = "https://files.pythonhosted.org/packages/b1/87/41f3202e4193e3bacfc2c065fab7706ebe81af46a83d3e27605029c1f5a6/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c23e27686783f60290e36827f9c626e63154b82b116d7fe9adba1fda36da706c", size = 2132603, upload-time = "2025-11-04T13:40:13.868Z" }, - { url = "https://files.pythonhosted.org/packages/49/7d/4c00df99cb12070b6bccdef4a195255e6020a550d572768d92cc54dba91a/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:482c982f814460eabe1d3bb0adfdc583387bd4691ef00b90575ca0d2b6fe2294", size = 2329591, upload-time = "2025-11-04T13:40:15.672Z" }, - { url = "https://files.pythonhosted.org/packages/cc/6a/ebf4b1d65d458f3cda6a7335d141305dfa19bdc61140a884d165a8a1bbc7/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:bfea2a5f0b4d8d43adf9d7b8bf019fb46fdd10a2e5cde477fbcb9d1fa08c68e1", size = 2319068, upload-time = "2025-11-04T13:40:17.532Z" }, - { url = "https://files.pythonhosted.org/packages/49/3b/774f2b5cd4192d5ab75870ce4381fd89cf218af999515baf07e7206753f0/pydantic_core-2.41.5-cp312-cp312-win32.whl", hash = "sha256:b74557b16e390ec12dca509bce9264c3bbd128f8a2c376eaa68003d7f327276d", size = 1985908, upload-time = "2025-11-04T13:40:19.309Z" }, - { url = "https://files.pythonhosted.org/packages/86/45/00173a033c801cacf67c190fef088789394feaf88a98a7035b0e40d53dc9/pydantic_core-2.41.5-cp312-cp312-win_amd64.whl", hash = "sha256:1962293292865bca8e54702b08a4f26da73adc83dd1fcf26fbc875b35d81c815", size = 2020145, upload-time = "2025-11-04T13:40:21.548Z" }, - { url = "https://files.pythonhosted.org/packages/f9/22/91fbc821fa6d261b376a3f73809f907cec5ca6025642c463d3488aad22fb/pydantic_core-2.41.5-cp312-cp312-win_arm64.whl", hash = "sha256:1746d4a3d9a794cacae06a5eaaccb4b8643a131d45fbc9af23e353dc0a5ba5c3", size = 1976179, upload-time = "2025-11-04T13:40:23.393Z" }, - { url = "https://files.pythonhosted.org/packages/87/06/8806241ff1f70d9939f9af039c6c35f2360cf16e93c2ca76f184e76b1564/pydantic_core-2.41.5-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:941103c9be18ac8daf7b7adca8228f8ed6bb7a1849020f643b3a14d15b1924d9", size = 2120403, upload-time = "2025-11-04T13:40:25.248Z" }, - { url = "https://files.pythonhosted.org/packages/94/02/abfa0e0bda67faa65fef1c84971c7e45928e108fe24333c81f3bfe35d5f5/pydantic_core-2.41.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:112e305c3314f40c93998e567879e887a3160bb8689ef3d2c04b6cc62c33ac34", size = 1896206, upload-time = "2025-11-04T13:40:27.099Z" }, - { url = "https://files.pythonhosted.org/packages/15/df/a4c740c0943e93e6500f9eb23f4ca7ec9bf71b19e608ae5b579678c8d02f/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cbaad15cb0c90aa221d43c00e77bb33c93e8d36e0bf74760cd00e732d10a6a0", size = 1919307, upload-time = "2025-11-04T13:40:29.806Z" }, - { url = "https://files.pythonhosted.org/packages/9a/e3/6324802931ae1d123528988e0e86587c2072ac2e5394b4bc2bc34b61ff6e/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:03ca43e12fab6023fc79d28ca6b39b05f794ad08ec2feccc59a339b02f2b3d33", size = 2063258, upload-time = "2025-11-04T13:40:33.544Z" }, - { url = "https://files.pythonhosted.org/packages/c9/d4/2230d7151d4957dd79c3044ea26346c148c98fbf0ee6ebd41056f2d62ab5/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dc799088c08fa04e43144b164feb0c13f9a0bc40503f8df3e9fde58a3c0c101e", size = 2214917, upload-time = "2025-11-04T13:40:35.479Z" }, - { url = "https://files.pythonhosted.org/packages/e6/9f/eaac5df17a3672fef0081b6c1bb0b82b33ee89aa5cec0d7b05f52fd4a1fa/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:97aeba56665b4c3235a0e52b2c2f5ae9cd071b8a8310ad27bddb3f7fb30e9aa2", size = 2332186, upload-time = "2025-11-04T13:40:37.436Z" }, - { url = "https://files.pythonhosted.org/packages/cf/4e/35a80cae583a37cf15604b44240e45c05e04e86f9cfd766623149297e971/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:406bf18d345822d6c21366031003612b9c77b3e29ffdb0f612367352aab7d586", size = 2073164, upload-time = "2025-11-04T13:40:40.289Z" }, - { url = "https://files.pythonhosted.org/packages/bf/e3/f6e262673c6140dd3305d144d032f7bd5f7497d3871c1428521f19f9efa2/pydantic_core-2.41.5-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b93590ae81f7010dbe380cdeab6f515902ebcbefe0b9327cc4804d74e93ae69d", size = 2179146, upload-time = "2025-11-04T13:40:42.809Z" }, - { url = "https://files.pythonhosted.org/packages/75/c7/20bd7fc05f0c6ea2056a4565c6f36f8968c0924f19b7d97bbfea55780e73/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:01a3d0ab748ee531f4ea6c3e48ad9dac84ddba4b0d82291f87248f2f9de8d740", size = 2137788, upload-time = "2025-11-04T13:40:44.752Z" }, - { url = "https://files.pythonhosted.org/packages/3a/8d/34318ef985c45196e004bc46c6eab2eda437e744c124ef0dbe1ff2c9d06b/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:6561e94ba9dacc9c61bce40e2d6bdc3bfaa0259d3ff36ace3b1e6901936d2e3e", size = 2340133, upload-time = "2025-11-04T13:40:46.66Z" }, - { url = "https://files.pythonhosted.org/packages/9c/59/013626bf8c78a5a5d9350d12e7697d3d4de951a75565496abd40ccd46bee/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:915c3d10f81bec3a74fbd4faebe8391013ba61e5a1a8d48c4455b923bdda7858", size = 2324852, upload-time = "2025-11-04T13:40:48.575Z" }, - { url = "https://files.pythonhosted.org/packages/1a/d9/c248c103856f807ef70c18a4f986693a46a8ffe1602e5d361485da502d20/pydantic_core-2.41.5-cp313-cp313-win32.whl", hash = "sha256:650ae77860b45cfa6e2cdafc42618ceafab3a2d9a3811fcfbd3bbf8ac3c40d36", size = 1994679, upload-time = "2025-11-04T13:40:50.619Z" }, - { url = "https://files.pythonhosted.org/packages/9e/8b/341991b158ddab181cff136acd2552c9f35bd30380422a639c0671e99a91/pydantic_core-2.41.5-cp313-cp313-win_amd64.whl", hash = "sha256:79ec52ec461e99e13791ec6508c722742ad745571f234ea6255bed38c6480f11", size = 2019766, upload-time = "2025-11-04T13:40:52.631Z" }, - { url = "https://files.pythonhosted.org/packages/73/7d/f2f9db34af103bea3e09735bb40b021788a5e834c81eedb541991badf8f5/pydantic_core-2.41.5-cp313-cp313-win_arm64.whl", hash = "sha256:3f84d5c1b4ab906093bdc1ff10484838aca54ef08de4afa9de0f5f14d69639cd", size = 1981005, upload-time = "2025-11-04T13:40:54.734Z" }, - { url = "https://files.pythonhosted.org/packages/ea/28/46b7c5c9635ae96ea0fbb779e271a38129df2550f763937659ee6c5dbc65/pydantic_core-2.41.5-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:3f37a19d7ebcdd20b96485056ba9e8b304e27d9904d233d7b1015db320e51f0a", size = 2119622, upload-time = "2025-11-04T13:40:56.68Z" }, - { url = "https://files.pythonhosted.org/packages/74/1a/145646e5687e8d9a1e8d09acb278c8535ebe9e972e1f162ed338a622f193/pydantic_core-2.41.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1d1d9764366c73f996edd17abb6d9d7649a7eb690006ab6adbda117717099b14", size = 1891725, upload-time = "2025-11-04T13:40:58.807Z" }, - { url = "https://files.pythonhosted.org/packages/23/04/e89c29e267b8060b40dca97bfc64a19b2a3cf99018167ea1677d96368273/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:25e1c2af0fce638d5f1988b686f3b3ea8cd7de5f244ca147c777769e798a9cd1", size = 1915040, upload-time = "2025-11-04T13:41:00.853Z" }, - { url = "https://files.pythonhosted.org/packages/84/a3/15a82ac7bd97992a82257f777b3583d3e84bdb06ba6858f745daa2ec8a85/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:506d766a8727beef16b7adaeb8ee6217c64fc813646b424d0804d67c16eddb66", size = 2063691, upload-time = "2025-11-04T13:41:03.504Z" }, - { url = "https://files.pythonhosted.org/packages/74/9b/0046701313c6ef08c0c1cf0e028c67c770a4e1275ca73131563c5f2a310a/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4819fa52133c9aa3c387b3328f25c1facc356491e6135b459f1de698ff64d869", size = 2213897, upload-time = "2025-11-04T13:41:05.804Z" }, - { url = "https://files.pythonhosted.org/packages/8a/cd/6bac76ecd1b27e75a95ca3a9a559c643b3afcd2dd62086d4b7a32a18b169/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2b761d210c9ea91feda40d25b4efe82a1707da2ef62901466a42492c028553a2", size = 2333302, upload-time = "2025-11-04T13:41:07.809Z" }, - { url = "https://files.pythonhosted.org/packages/4c/d2/ef2074dc020dd6e109611a8be4449b98cd25e1b9b8a303c2f0fca2f2bcf7/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:22f0fb8c1c583a3b6f24df2470833b40207e907b90c928cc8d3594b76f874375", size = 2064877, upload-time = "2025-11-04T13:41:09.827Z" }, - { url = "https://files.pythonhosted.org/packages/18/66/e9db17a9a763d72f03de903883c057b2592c09509ccfe468187f2a2eef29/pydantic_core-2.41.5-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c870e99878c634505236d81e5443092fba820f0373997ff75f90f68cd553", size = 2180680, upload-time = "2025-11-04T13:41:12.379Z" }, - { url = "https://files.pythonhosted.org/packages/d3/9e/3ce66cebb929f3ced22be85d4c2399b8e85b622db77dad36b73c5387f8f8/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:0177272f88ab8312479336e1d777f6b124537d47f2123f89cb37e0accea97f90", size = 2138960, upload-time = "2025-11-04T13:41:14.627Z" }, - { url = "https://files.pythonhosted.org/packages/a6/62/205a998f4327d2079326b01abee48e502ea739d174f0a89295c481a2272e/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:63510af5e38f8955b8ee5687740d6ebf7c2a0886d15a6d65c32814613681bc07", size = 2339102, upload-time = "2025-11-04T13:41:16.868Z" }, - { url = "https://files.pythonhosted.org/packages/3c/0d/f05e79471e889d74d3d88f5bd20d0ed189ad94c2423d81ff8d0000aab4ff/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:e56ba91f47764cc14f1daacd723e3e82d1a89d783f0f5afe9c364b8bb491ccdb", size = 2326039, upload-time = "2025-11-04T13:41:18.934Z" }, - { url = "https://files.pythonhosted.org/packages/ec/e1/e08a6208bb100da7e0c4b288eed624a703f4d129bde2da475721a80cab32/pydantic_core-2.41.5-cp314-cp314-win32.whl", hash = "sha256:aec5cf2fd867b4ff45b9959f8b20ea3993fc93e63c7363fe6851424c8a7e7c23", size = 1995126, upload-time = "2025-11-04T13:41:21.418Z" }, - { url = "https://files.pythonhosted.org/packages/48/5d/56ba7b24e9557f99c9237e29f5c09913c81eeb2f3217e40e922353668092/pydantic_core-2.41.5-cp314-cp314-win_amd64.whl", hash = "sha256:8e7c86f27c585ef37c35e56a96363ab8de4e549a95512445b85c96d3e2f7c1bf", size = 2015489, upload-time = "2025-11-04T13:41:24.076Z" }, - { url = "https://files.pythonhosted.org/packages/4e/bb/f7a190991ec9e3e0ba22e4993d8755bbc4a32925c0b5b42775c03e8148f9/pydantic_core-2.41.5-cp314-cp314-win_arm64.whl", hash = "sha256:e672ba74fbc2dc8eea59fb6d4aed6845e6905fc2a8afe93175d94a83ba2a01a0", size = 1977288, upload-time = "2025-11-04T13:41:26.33Z" }, - { url = "https://files.pythonhosted.org/packages/92/ed/77542d0c51538e32e15afe7899d79efce4b81eee631d99850edc2f5e9349/pydantic_core-2.41.5-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:8566def80554c3faa0e65ac30ab0932b9e3a5cd7f8323764303d468e5c37595a", size = 2120255, upload-time = "2025-11-04T13:41:28.569Z" }, - { url = "https://files.pythonhosted.org/packages/bb/3d/6913dde84d5be21e284439676168b28d8bbba5600d838b9dca99de0fad71/pydantic_core-2.41.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:b80aa5095cd3109962a298ce14110ae16b8c1aece8b72f9dafe81cf597ad80b3", size = 1863760, upload-time = "2025-11-04T13:41:31.055Z" }, - { url = "https://files.pythonhosted.org/packages/5a/f0/e5e6b99d4191da102f2b0eb9687aaa7f5bea5d9964071a84effc3e40f997/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3006c3dd9ba34b0c094c544c6006cc79e87d8612999f1a5d43b769b89181f23c", size = 1878092, upload-time = "2025-11-04T13:41:33.21Z" }, - { url = "https://files.pythonhosted.org/packages/71/48/36fb760642d568925953bcc8116455513d6e34c4beaa37544118c36aba6d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:72f6c8b11857a856bcfa48c86f5368439f74453563f951e473514579d44aa612", size = 2053385, upload-time = "2025-11-04T13:41:35.508Z" }, - { url = "https://files.pythonhosted.org/packages/20/25/92dc684dd8eb75a234bc1c764b4210cf2646479d54b47bf46061657292a8/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5cb1b2f9742240e4bb26b652a5aeb840aa4b417c7748b6f8387927bc6e45e40d", size = 2218832, upload-time = "2025-11-04T13:41:37.732Z" }, - { url = "https://files.pythonhosted.org/packages/e2/09/f53e0b05023d3e30357d82eb35835d0f6340ca344720a4599cd663dca599/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bd3d54f38609ff308209bd43acea66061494157703364ae40c951f83ba99a1a9", size = 2327585, upload-time = "2025-11-04T13:41:40Z" }, - { url = "https://files.pythonhosted.org/packages/aa/4e/2ae1aa85d6af35a39b236b1b1641de73f5a6ac4d5a7509f77b814885760c/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2ff4321e56e879ee8d2a879501c8e469414d948f4aba74a2d4593184eb326660", size = 2041078, upload-time = "2025-11-04T13:41:42.323Z" }, - { url = "https://files.pythonhosted.org/packages/cd/13/2e215f17f0ef326fc72afe94776edb77525142c693767fc347ed6288728d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d0d2568a8c11bf8225044aa94409e21da0cb09dcdafe9ecd10250b2baad531a9", size = 2173914, upload-time = "2025-11-04T13:41:45.221Z" }, - { url = "https://files.pythonhosted.org/packages/02/7a/f999a6dcbcd0e5660bc348a3991c8915ce6599f4f2c6ac22f01d7a10816c/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:a39455728aabd58ceabb03c90e12f71fd30fa69615760a075b9fec596456ccc3", size = 2129560, upload-time = "2025-11-04T13:41:47.474Z" }, - { url = "https://files.pythonhosted.org/packages/3a/b1/6c990ac65e3b4c079a4fb9f5b05f5b013afa0f4ed6780a3dd236d2cbdc64/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:239edca560d05757817c13dc17c50766136d21f7cd0fac50295499ae24f90fdf", size = 2329244, upload-time = "2025-11-04T13:41:49.992Z" }, - { url = "https://files.pythonhosted.org/packages/d9/02/3c562f3a51afd4d88fff8dffb1771b30cfdfd79befd9883ee094f5b6c0d8/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:2a5e06546e19f24c6a96a129142a75cee553cc018ffee48a460059b1185f4470", size = 2331955, upload-time = "2025-11-04T13:41:54.079Z" }, - { url = "https://files.pythonhosted.org/packages/5c/96/5fb7d8c3c17bc8c62fdb031c47d77a1af698f1d7a406b0f79aaa1338f9ad/pydantic_core-2.41.5-cp314-cp314t-win32.whl", hash = "sha256:b4ececa40ac28afa90871c2cc2b9ffd2ff0bf749380fbdf57d165fd23da353aa", size = 1988906, upload-time = "2025-11-04T13:41:56.606Z" }, - { url = "https://files.pythonhosted.org/packages/22/ed/182129d83032702912c2e2d8bbe33c036f342cc735737064668585dac28f/pydantic_core-2.41.5-cp314-cp314t-win_amd64.whl", hash = "sha256:80aa89cad80b32a912a65332f64a4450ed00966111b6615ca6816153d3585a8c", size = 1981607, upload-time = "2025-11-04T13:41:58.889Z" }, - { url = "https://files.pythonhosted.org/packages/9f/ed/068e41660b832bb0b1aa5b58011dea2a3fe0ba7861ff38c4d4904c1c1a99/pydantic_core-2.41.5-cp314-cp314t-win_arm64.whl", hash = "sha256:35b44f37a3199f771c3eaa53051bc8a70cd7b54f333531c59e29fd4db5d15008", size = 1974769, upload-time = "2025-11-04T13:42:01.186Z" }, - { url = "https://files.pythonhosted.org/packages/09/32/59b0c7e63e277fa7911c2fc70ccfb45ce4b98991e7ef37110663437005af/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:7da7087d756b19037bc2c06edc6c170eeef3c3bafcb8f532ff17d64dc427adfd", size = 2110495, upload-time = "2025-11-04T13:42:49.689Z" }, - { url = "https://files.pythonhosted.org/packages/aa/81/05e400037eaf55ad400bcd318c05bb345b57e708887f07ddb2d20e3f0e98/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:aabf5777b5c8ca26f7824cb4a120a740c9588ed58df9b2d196ce92fba42ff8dc", size = 1915388, upload-time = "2025-11-04T13:42:52.215Z" }, - { url = "https://files.pythonhosted.org/packages/6e/0d/e3549b2399f71d56476b77dbf3cf8937cec5cd70536bdc0e374a421d0599/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c007fe8a43d43b3969e8469004e9845944f1a80e6acd47c150856bb87f230c56", size = 1942879, upload-time = "2025-11-04T13:42:56.483Z" }, - { url = "https://files.pythonhosted.org/packages/f7/07/34573da085946b6a313d7c42f82f16e8920bfd730665de2d11c0c37a74b5/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:76d0819de158cd855d1cbb8fcafdf6f5cf1eb8e470abe056d5d161106e38062b", size = 2139017, upload-time = "2025-11-04T13:42:59.471Z" }, -] - -[[package]] -name = "pygments" -version = "2.20.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/c3/b2/bc9c9196916376152d655522fdcebac55e66de6603a76a02bca1b6414f6c/pygments-2.20.0.tar.gz", hash = "sha256:6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f", size = 4955991, upload-time = "2026-03-29T13:29:33.898Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/f4/7e/a72dd26f3b0f4f2bf1dd8923c85f7ceb43172af56d63c7383eb62b332364/pygments-2.20.0-py3-none-any.whl", hash = "sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176", size = 1231151, upload-time = "2026-03-29T13:29:30.038Z" }, -] - -[[package]] -name = "python-dotenv" -version = "1.2.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/82/ed/0301aeeac3e5353ef3d94b6ec08bbcabd04a72018415dcb29e588514bba8/python_dotenv-1.2.2.tar.gz", hash = "sha256:2c371a91fbd7ba082c2c1dc1f8bf89ca22564a087c2c287cd9b662adde799cf3", size = 50135, upload-time = "2026-03-01T16:00:26.196Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/0b/d7/1959b9648791274998a9c3526f6d0ec8fd2233e4d4acce81bbae76b44b2a/python_dotenv-1.2.2-py3-none-any.whl", hash = "sha256:1d8214789a24de455a8b8bd8ae6fe3c6b69a5e3d64aa8a8e5d68e694bbcb285a", size = 22101, upload-time = "2026-03-01T16:00:25.09Z" }, -] - -[[package]] -name = "pyyaml" -version = "6.0.3" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/d1/33/422b98d2195232ca1826284a76852ad5a86fe23e31b009c9886b2d0fb8b2/pyyaml-6.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196", size = 182063, upload-time = "2025-09-25T21:32:11.445Z" }, - { url = "https://files.pythonhosted.org/packages/89/a0/6cf41a19a1f2f3feab0e9c0b74134aa2ce6849093d5517a0c550fe37a648/pyyaml-6.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0", size = 173973, upload-time = "2025-09-25T21:32:12.492Z" }, - { url = "https://files.pythonhosted.org/packages/ed/23/7a778b6bd0b9a8039df8b1b1d80e2e2ad78aa04171592c8a5c43a56a6af4/pyyaml-6.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28", size = 775116, upload-time = "2025-09-25T21:32:13.652Z" }, - { url = "https://files.pythonhosted.org/packages/65/30/d7353c338e12baef4ecc1b09e877c1970bd3382789c159b4f89d6a70dc09/pyyaml-6.0.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c", size = 844011, upload-time = "2025-09-25T21:32:15.21Z" }, - { url = "https://files.pythonhosted.org/packages/8b/9d/b3589d3877982d4f2329302ef98a8026e7f4443c765c46cfecc8858c6b4b/pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc", size = 807870, upload-time = "2025-09-25T21:32:16.431Z" }, - { url = "https://files.pythonhosted.org/packages/05/c0/b3be26a015601b822b97d9149ff8cb5ead58c66f981e04fedf4e762f4bd4/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e", size = 761089, upload-time = "2025-09-25T21:32:17.56Z" }, - { url = "https://files.pythonhosted.org/packages/be/8e/98435a21d1d4b46590d5459a22d88128103f8da4c2d4cb8f14f2a96504e1/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea", size = 790181, upload-time = "2025-09-25T21:32:18.834Z" }, - { url = "https://files.pythonhosted.org/packages/74/93/7baea19427dcfbe1e5a372d81473250b379f04b1bd3c4c5ff825e2327202/pyyaml-6.0.3-cp312-cp312-win32.whl", hash = "sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5", size = 137658, upload-time = "2025-09-25T21:32:20.209Z" }, - { url = "https://files.pythonhosted.org/packages/86/bf/899e81e4cce32febab4fb42bb97dcdf66bc135272882d1987881a4b519e9/pyyaml-6.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b", size = 154003, upload-time = "2025-09-25T21:32:21.167Z" }, - { url = "https://files.pythonhosted.org/packages/1a/08/67bd04656199bbb51dbed1439b7f27601dfb576fb864099c7ef0c3e55531/pyyaml-6.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd", size = 140344, upload-time = "2025-09-25T21:32:22.617Z" }, - { url = "https://files.pythonhosted.org/packages/d1/11/0fd08f8192109f7169db964b5707a2f1e8b745d4e239b784a5a1dd80d1db/pyyaml-6.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8da9669d359f02c0b91ccc01cac4a67f16afec0dac22c2ad09f46bee0697eba8", size = 181669, upload-time = "2025-09-25T21:32:23.673Z" }, - { url = "https://files.pythonhosted.org/packages/b1/16/95309993f1d3748cd644e02e38b75d50cbc0d9561d21f390a76242ce073f/pyyaml-6.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2283a07e2c21a2aa78d9c4442724ec1eb15f5e42a723b99cb3d822d48f5f7ad1", size = 173252, upload-time = "2025-09-25T21:32:25.149Z" }, - { url = "https://files.pythonhosted.org/packages/50/31/b20f376d3f810b9b2371e72ef5adb33879b25edb7a6d072cb7ca0c486398/pyyaml-6.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee2922902c45ae8ccada2c5b501ab86c36525b883eff4255313a253a3160861c", size = 767081, upload-time = "2025-09-25T21:32:26.575Z" }, - { url = "https://files.pythonhosted.org/packages/49/1e/a55ca81e949270d5d4432fbbd19dfea5321eda7c41a849d443dc92fd1ff7/pyyaml-6.0.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a33284e20b78bd4a18c8c2282d549d10bc8408a2a7ff57653c0cf0b9be0afce5", size = 841159, upload-time = "2025-09-25T21:32:27.727Z" }, - { url = "https://files.pythonhosted.org/packages/74/27/e5b8f34d02d9995b80abcef563ea1f8b56d20134d8f4e5e81733b1feceb2/pyyaml-6.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6", size = 801626, upload-time = "2025-09-25T21:32:28.878Z" }, - { url = "https://files.pythonhosted.org/packages/f9/11/ba845c23988798f40e52ba45f34849aa8a1f2d4af4b798588010792ebad6/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f7057c9a337546edc7973c0d3ba84ddcdf0daa14533c2065749c9075001090e6", size = 753613, upload-time = "2025-09-25T21:32:30.178Z" }, - { url = "https://files.pythonhosted.org/packages/3d/e0/7966e1a7bfc0a45bf0a7fb6b98ea03fc9b8d84fa7f2229e9659680b69ee3/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:eda16858a3cab07b80edaf74336ece1f986ba330fdb8ee0d6c0d68fe82bc96be", size = 794115, upload-time = "2025-09-25T21:32:31.353Z" }, - { url = "https://files.pythonhosted.org/packages/de/94/980b50a6531b3019e45ddeada0626d45fa85cbe22300844a7983285bed3b/pyyaml-6.0.3-cp313-cp313-win32.whl", hash = "sha256:d0eae10f8159e8fdad514efdc92d74fd8d682c933a6dd088030f3834bc8e6b26", size = 137427, upload-time = "2025-09-25T21:32:32.58Z" }, - { url = "https://files.pythonhosted.org/packages/97/c9/39d5b874e8b28845e4ec2202b5da735d0199dbe5b8fb85f91398814a9a46/pyyaml-6.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:79005a0d97d5ddabfeeea4cf676af11e647e41d81c9a7722a193022accdb6b7c", size = 154090, upload-time = "2025-09-25T21:32:33.659Z" }, - { url = "https://files.pythonhosted.org/packages/73/e8/2bdf3ca2090f68bb3d75b44da7bbc71843b19c9f2b9cb9b0f4ab7a5a4329/pyyaml-6.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:5498cd1645aa724a7c71c8f378eb29ebe23da2fc0d7a08071d89469bf1d2defb", size = 140246, upload-time = "2025-09-25T21:32:34.663Z" }, - { url = "https://files.pythonhosted.org/packages/9d/8c/f4bd7f6465179953d3ac9bc44ac1a8a3e6122cf8ada906b4f96c60172d43/pyyaml-6.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:8d1fab6bb153a416f9aeb4b8763bc0f22a5586065f86f7664fc23339fc1c1fac", size = 181814, upload-time = "2025-09-25T21:32:35.712Z" }, - { url = "https://files.pythonhosted.org/packages/bd/9c/4d95bb87eb2063d20db7b60faa3840c1b18025517ae857371c4dd55a6b3a/pyyaml-6.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:34d5fcd24b8445fadc33f9cf348c1047101756fd760b4dacb5c3e99755703310", size = 173809, upload-time = "2025-09-25T21:32:36.789Z" }, - { url = "https://files.pythonhosted.org/packages/92/b5/47e807c2623074914e29dabd16cbbdd4bf5e9b2db9f8090fa64411fc5382/pyyaml-6.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:501a031947e3a9025ed4405a168e6ef5ae3126c59f90ce0cd6f2bfc477be31b7", size = 766454, upload-time = "2025-09-25T21:32:37.966Z" }, - { url = "https://files.pythonhosted.org/packages/02/9e/e5e9b168be58564121efb3de6859c452fccde0ab093d8438905899a3a483/pyyaml-6.0.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b3bc83488de33889877a0f2543ade9f70c67d66d9ebb4ac959502e12de895788", size = 836355, upload-time = "2025-09-25T21:32:39.178Z" }, - { url = "https://files.pythonhosted.org/packages/88/f9/16491d7ed2a919954993e48aa941b200f38040928474c9e85ea9e64222c3/pyyaml-6.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5", size = 794175, upload-time = "2025-09-25T21:32:40.865Z" }, - { url = "https://files.pythonhosted.org/packages/dd/3f/5989debef34dc6397317802b527dbbafb2b4760878a53d4166579111411e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7c6610def4f163542a622a73fb39f534f8c101d690126992300bf3207eab9764", size = 755228, upload-time = "2025-09-25T21:32:42.084Z" }, - { url = "https://files.pythonhosted.org/packages/d7/ce/af88a49043cd2e265be63d083fc75b27b6ed062f5f9fd6cdc223ad62f03e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5190d403f121660ce8d1d2c1bb2ef1bd05b5f68533fc5c2ea899bd15f4399b35", size = 789194, upload-time = "2025-09-25T21:32:43.362Z" }, - { url = "https://files.pythonhosted.org/packages/23/20/bb6982b26a40bb43951265ba29d4c246ef0ff59c9fdcdf0ed04e0687de4d/pyyaml-6.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:4a2e8cebe2ff6ab7d1050ecd59c25d4c8bd7e6f400f5f82b96557ac0abafd0ac", size = 156429, upload-time = "2025-09-25T21:32:57.844Z" }, - { url = "https://files.pythonhosted.org/packages/f4/f4/a4541072bb9422c8a883ab55255f918fa378ecf083f5b85e87fc2b4eda1b/pyyaml-6.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:93dda82c9c22deb0a405ea4dc5f2d0cda384168e466364dec6255b293923b2f3", size = 143912, upload-time = "2025-09-25T21:32:59.247Z" }, - { url = "https://files.pythonhosted.org/packages/7c/f9/07dd09ae774e4616edf6cda684ee78f97777bdd15847253637a6f052a62f/pyyaml-6.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:02893d100e99e03eda1c8fd5c441d8c60103fd175728e23e431db1b589cf5ab3", size = 189108, upload-time = "2025-09-25T21:32:44.377Z" }, - { url = "https://files.pythonhosted.org/packages/4e/78/8d08c9fb7ce09ad8c38ad533c1191cf27f7ae1effe5bb9400a46d9437fcf/pyyaml-6.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c1ff362665ae507275af2853520967820d9124984e0f7466736aea23d8611fba", size = 183641, upload-time = "2025-09-25T21:32:45.407Z" }, - { url = "https://files.pythonhosted.org/packages/7b/5b/3babb19104a46945cf816d047db2788bcaf8c94527a805610b0289a01c6b/pyyaml-6.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6adc77889b628398debc7b65c073bcb99c4a0237b248cacaf3fe8a557563ef6c", size = 831901, upload-time = "2025-09-25T21:32:48.83Z" }, - { url = "https://files.pythonhosted.org/packages/8b/cc/dff0684d8dc44da4d22a13f35f073d558c268780ce3c6ba1b87055bb0b87/pyyaml-6.0.3-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a80cb027f6b349846a3bf6d73b5e95e782175e52f22108cfa17876aaeff93702", size = 861132, upload-time = "2025-09-25T21:32:50.149Z" }, - { url = "https://files.pythonhosted.org/packages/b1/5e/f77dc6b9036943e285ba76b49e118d9ea929885becb0a29ba8a7c75e29fe/pyyaml-6.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c", size = 839261, upload-time = "2025-09-25T21:32:51.808Z" }, - { url = "https://files.pythonhosted.org/packages/ce/88/a9db1376aa2a228197c58b37302f284b5617f56a5d959fd1763fb1675ce6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:66e1674c3ef6f541c35191caae2d429b967b99e02040f5ba928632d9a7f0f065", size = 805272, upload-time = "2025-09-25T21:32:52.941Z" }, - { url = "https://files.pythonhosted.org/packages/da/92/1446574745d74df0c92e6aa4a7b0b3130706a4142b2d1a5869f2eaa423c6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:16249ee61e95f858e83976573de0f5b2893b3677ba71c9dd36b9cf8be9ac6d65", size = 829923, upload-time = "2025-09-25T21:32:54.537Z" }, - { url = "https://files.pythonhosted.org/packages/f0/7a/1c7270340330e575b92f397352af856a8c06f230aa3e76f86b39d01b416a/pyyaml-6.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4ad1906908f2f5ae4e5a8ddfce73c320c2a1429ec52eafd27138b7f1cbe341c9", size = 174062, upload-time = "2025-09-25T21:32:55.767Z" }, - { url = "https://files.pythonhosted.org/packages/f1/12/de94a39c2ef588c7e6455cfbe7343d3b2dc9d6b6b2f40c4c6565744c873d/pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b", size = 149341, upload-time = "2025-09-25T21:32:56.828Z" }, -] - -[[package]] -name = "questionary" -version = "2.1.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "prompt-toolkit" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/f6/45/eafb0bba0f9988f6a2520f9ca2df2c82ddfa8d67c95d6625452e97b204a5/questionary-2.1.1.tar.gz", hash = "sha256:3d7e980292bb0107abaa79c68dd3eee3c561b83a0f89ae482860b181c8bd412d", size = 25845, upload-time = "2025-08-28T19:00:20.851Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/3c/26/1062c7ec1b053db9e499b4d2d5bc231743201b74051c973dadeac80a8f43/questionary-2.1.1-py3-none-any.whl", hash = "sha256:a51af13f345f1cdea62347589fbb6df3b290306ab8930713bfae4d475a7d4a59", size = 36753, upload-time = "2025-08-28T19:00:19.56Z" }, -] - -[[package]] -name = "rich" -version = "14.3.3" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "markdown-it-py" }, - { name = "pygments" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/b3/c6/f3b320c27991c46f43ee9d856302c70dc2d0fb2dba4842ff739d5f46b393/rich-14.3.3.tar.gz", hash = "sha256:b8daa0b9e4eef54dd8cf7c86c03713f53241884e814f4e2f5fb342fe520f639b", size = 230582, upload-time = "2026-02-19T17:23:12.474Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/14/25/b208c5683343959b670dc001595f2f3737e051da617f66c31f7c4fa93abc/rich-14.3.3-py3-none-any.whl", hash = "sha256:793431c1f8619afa7d3b52b2cdec859562b950ea0d4b6b505397612db8d5362d", size = 310458, upload-time = "2026-02-19T17:23:13.732Z" }, -] - -[[package]] -name = "shellingham" -version = "1.5.4" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/58/15/8b3609fd3830ef7b27b655beb4b4e9c62313a4e8da8c676e142cc210d58e/shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de", size = 10310, upload-time = "2023-10-24T04:13:40.426Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" }, -] - -[[package]] -name = "socksio" -version = "1.0.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f8/5c/48a7d9495be3d1c651198fd99dbb6ce190e2274d0f28b9051307bdec6b85/socksio-1.0.0.tar.gz", hash = "sha256:f88beb3da5b5c38b9890469de67d0cb0f9d494b78b106ca1845f96c10b91c4ac", size = 19055, upload-time = "2020-04-17T15:50:34.664Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/37/c3/6eeb6034408dac0fa653d126c9204ade96b819c936e136c5e8a6897eee9c/socksio-1.0.0-py3-none-any.whl", hash = "sha256:95dc1f15f9b34e8d7b16f06d74b8ccf48f609af32ab33c608d08761c5dcbb1f3", size = 12763, upload-time = "2020-04-17T15:50:31.878Z" }, -] - -[[package]] -name = "starlette" -version = "1.0.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "anyio" }, - { name = "typing-extensions", marker = "python_full_version < '3.13'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/81/69/17425771797c36cded50b7fe44e850315d039f28b15901ab44839e70b593/starlette-1.0.0.tar.gz", hash = "sha256:6a4beaf1f81bb472fd19ea9b918b50dc3a77a6f2e190a12954b25e6ed5eea149", size = 2655289, upload-time = "2026-03-22T18:29:46.779Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/0b/c9/584bc9651441b4ba60cc4d557d8a547b5aff901af35bda3a4ee30c819b82/starlette-1.0.0-py3-none-any.whl", hash = "sha256:d3ec55e0bb321692d275455ddfd3df75fff145d009685eb40dc91fc66b03d38b", size = 72651, upload-time = "2026-03-22T18:29:45.111Z" }, -] - -[[package]] -name = "typer" -version = "0.24.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "annotated-doc" }, - { name = "click" }, - { name = "rich" }, - { name = "shellingham" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/f5/24/cb09efec5cc954f7f9b930bf8279447d24618bb6758d4f6adf2574c41780/typer-0.24.1.tar.gz", hash = "sha256:e39b4732d65fbdcde189ae76cf7cd48aeae72919dea1fdfc16593be016256b45", size = 118613, upload-time = "2026-02-21T16:54:40.609Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/4a/91/48db081e7a63bb37284f9fbcefda7c44c277b18b0e13fbc36ea2335b71e6/typer-0.24.1-py3-none-any.whl", hash = "sha256:112c1f0ce578bfb4cab9ffdabc68f031416ebcc216536611ba21f04e9aa84c9e", size = 56085, upload-time = "2026-02-21T16:54:41.616Z" }, -] - -[[package]] -name = "typing-extensions" -version = "4.15.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, -] - -[[package]] -name = "typing-inspection" -version = "0.4.2" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/55/e3/70399cb7dd41c10ac53367ae42139cf4b1ca5f36bb3dc6c9d33acdb43655/typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464", size = 75949, upload-time = "2025-10-01T02:14:41.687Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/dc/9b/47798a6c91d8bdb567fe2698fe81e0c6b7cb7ef4d13da4114b41d239f65d/typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7", size = 14611, upload-time = "2025-10-01T02:14:40.154Z" }, -] - -[[package]] -name = "uvicorn" -version = "0.44.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "click" }, - { name = "h11" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/5e/da/6eee1ff8b6cbeed47eeb5229749168e81eb4b7b999a1a15a7176e51410c9/uvicorn-0.44.0.tar.gz", hash = "sha256:6c942071b68f07e178264b9152f1f16dfac5da85880c4ce06366a96d70d4f31e", size = 86947, upload-time = "2026-04-06T09:23:22.826Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b7/23/a5bbd9600dd607411fa644c06ff4951bec3a4d82c4b852374024359c19c0/uvicorn-0.44.0-py3-none-any.whl", hash = "sha256:ce937c99a2cc70279556967274414c087888e8cec9f9c94644dfca11bd3ced89", size = 69425, upload-time = "2026-04-06T09:23:21.524Z" }, -] - -[package.optional-dependencies] -standard = [ - { name = "colorama", marker = "sys_platform == 'win32'" }, - { name = "httptools" }, - { name = "python-dotenv" }, - { name = "pyyaml" }, - { name = "uvloop", marker = "platform_python_implementation != 'PyPy' and sys_platform != 'cygwin' and sys_platform != 'win32'" }, - { name = "watchfiles" }, - { name = "websockets" }, -] - -[[package]] -name = "uvloop" -version = "0.22.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/06/f0/18d39dbd1971d6d62c4629cc7fa67f74821b0dc1f5a77af43719de7936a7/uvloop-0.22.1.tar.gz", hash = "sha256:6c84bae345b9147082b17371e3dd5d42775bddce91f885499017f4607fdaf39f", size = 2443250, upload-time = "2025-10-16T22:17:19.342Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/3d/ff/7f72e8170be527b4977b033239a83a68d5c881cc4775fca255c677f7ac5d/uvloop-0.22.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:fe94b4564e865d968414598eea1a6de60adba0c040ba4ed05ac1300de402cd42", size = 1359936, upload-time = "2025-10-16T22:16:29.436Z" }, - { url = "https://files.pythonhosted.org/packages/c3/c6/e5d433f88fd54d81ef4be58b2b7b0cea13c442454a1db703a1eea0db1a59/uvloop-0.22.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:51eb9bd88391483410daad430813d982010f9c9c89512321f5b60e2cddbdddd6", size = 752769, upload-time = "2025-10-16T22:16:30.493Z" }, - { url = "https://files.pythonhosted.org/packages/24/68/a6ac446820273e71aa762fa21cdcc09861edd3536ff47c5cd3b7afb10eeb/uvloop-0.22.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:700e674a166ca5778255e0e1dc4e9d79ab2acc57b9171b79e65feba7184b3370", size = 4317413, upload-time = "2025-10-16T22:16:31.644Z" }, - { url = "https://files.pythonhosted.org/packages/5f/6f/e62b4dfc7ad6518e7eff2516f680d02a0f6eb62c0c212e152ca708a0085e/uvloop-0.22.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b5b1ac819a3f946d3b2ee07f09149578ae76066d70b44df3fa990add49a82e4", size = 4426307, upload-time = "2025-10-16T22:16:32.917Z" }, - { url = "https://files.pythonhosted.org/packages/90/60/97362554ac21e20e81bcef1150cb2a7e4ffdaf8ea1e5b2e8bf7a053caa18/uvloop-0.22.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e047cc068570bac9866237739607d1313b9253c3051ad84738cbb095be0537b2", size = 4131970, upload-time = "2025-10-16T22:16:34.015Z" }, - { url = "https://files.pythonhosted.org/packages/99/39/6b3f7d234ba3964c428a6e40006340f53ba37993f46ed6e111c6e9141d18/uvloop-0.22.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:512fec6815e2dd45161054592441ef76c830eddaad55c8aa30952e6fe1ed07c0", size = 4296343, upload-time = "2025-10-16T22:16:35.149Z" }, - { url = "https://files.pythonhosted.org/packages/89/8c/182a2a593195bfd39842ea68ebc084e20c850806117213f5a299dfc513d9/uvloop-0.22.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:561577354eb94200d75aca23fbde86ee11be36b00e52a4eaf8f50fb0c86b7705", size = 1358611, upload-time = "2025-10-16T22:16:36.833Z" }, - { url = "https://files.pythonhosted.org/packages/d2/14/e301ee96a6dc95224b6f1162cd3312f6d1217be3907b79173b06785f2fe7/uvloop-0.22.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:1cdf5192ab3e674ca26da2eada35b288d2fa49fdd0f357a19f0e7c4e7d5077c8", size = 751811, upload-time = "2025-10-16T22:16:38.275Z" }, - { url = "https://files.pythonhosted.org/packages/b7/02/654426ce265ac19e2980bfd9ea6590ca96a56f10c76e63801a2df01c0486/uvloop-0.22.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6e2ea3d6190a2968f4a14a23019d3b16870dd2190cd69c8180f7c632d21de68d", size = 4288562, upload-time = "2025-10-16T22:16:39.375Z" }, - { url = "https://files.pythonhosted.org/packages/15/c0/0be24758891ef825f2065cd5db8741aaddabe3e248ee6acc5e8a80f04005/uvloop-0.22.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0530a5fbad9c9e4ee3f2b33b148c6a64d47bbad8000ea63704fa8260f4cf728e", size = 4366890, upload-time = "2025-10-16T22:16:40.547Z" }, - { url = "https://files.pythonhosted.org/packages/d2/53/8369e5219a5855869bcee5f4d317f6da0e2c669aecf0ef7d371e3d084449/uvloop-0.22.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:bc5ef13bbc10b5335792360623cc378d52d7e62c2de64660616478c32cd0598e", size = 4119472, upload-time = "2025-10-16T22:16:41.694Z" }, - { url = "https://files.pythonhosted.org/packages/f8/ba/d69adbe699b768f6b29a5eec7b47dd610bd17a69de51b251126a801369ea/uvloop-0.22.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:1f38ec5e3f18c8a10ded09742f7fb8de0108796eb673f30ce7762ce1b8550cad", size = 4239051, upload-time = "2025-10-16T22:16:43.224Z" }, - { url = "https://files.pythonhosted.org/packages/90/cd/b62bdeaa429758aee8de8b00ac0dd26593a9de93d302bff3d21439e9791d/uvloop-0.22.1-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:3879b88423ec7e97cd4eba2a443aa26ed4e59b45e6b76aabf13fe2f27023a142", size = 1362067, upload-time = "2025-10-16T22:16:44.503Z" }, - { url = "https://files.pythonhosted.org/packages/0d/f8/a132124dfda0777e489ca86732e85e69afcd1ff7686647000050ba670689/uvloop-0.22.1-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:4baa86acedf1d62115c1dc6ad1e17134476688f08c6efd8a2ab076e815665c74", size = 752423, upload-time = "2025-10-16T22:16:45.968Z" }, - { url = "https://files.pythonhosted.org/packages/a3/94/94af78c156f88da4b3a733773ad5ba0b164393e357cc4bd0ab2e2677a7d6/uvloop-0.22.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:297c27d8003520596236bdb2335e6b3f649480bd09e00d1e3a99144b691d2a35", size = 4272437, upload-time = "2025-10-16T22:16:47.451Z" }, - { url = "https://files.pythonhosted.org/packages/b5/35/60249e9fd07b32c665192cec7af29e06c7cd96fa1d08b84f012a56a0b38e/uvloop-0.22.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c1955d5a1dd43198244d47664a5858082a3239766a839b2102a269aaff7a4e25", size = 4292101, upload-time = "2025-10-16T22:16:49.318Z" }, - { url = "https://files.pythonhosted.org/packages/02/62/67d382dfcb25d0a98ce73c11ed1a6fba5037a1a1d533dcbb7cab033a2636/uvloop-0.22.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b31dc2fccbd42adc73bc4e7cdbae4fc5086cf378979e53ca5d0301838c5682c6", size = 4114158, upload-time = "2025-10-16T22:16:50.517Z" }, - { url = "https://files.pythonhosted.org/packages/f0/7a/f1171b4a882a5d13c8b7576f348acfe6074d72eaf52cccef752f748d4a9f/uvloop-0.22.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:93f617675b2d03af4e72a5333ef89450dfaa5321303ede6e67ba9c9d26878079", size = 4177360, upload-time = "2025-10-16T22:16:52.646Z" }, - { url = "https://files.pythonhosted.org/packages/79/7b/b01414f31546caf0919da80ad57cbfe24c56b151d12af68cee1b04922ca8/uvloop-0.22.1-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:37554f70528f60cad66945b885eb01f1bb514f132d92b6eeed1c90fd54ed6289", size = 1454790, upload-time = "2025-10-16T22:16:54.355Z" }, - { url = "https://files.pythonhosted.org/packages/d4/31/0bb232318dd838cad3fa8fb0c68c8b40e1145b32025581975e18b11fab40/uvloop-0.22.1-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:b76324e2dc033a0b2f435f33eb88ff9913c156ef78e153fb210e03c13da746b3", size = 796783, upload-time = "2025-10-16T22:16:55.906Z" }, - { url = "https://files.pythonhosted.org/packages/42/38/c9b09f3271a7a723a5de69f8e237ab8e7803183131bc57c890db0b6bb872/uvloop-0.22.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:badb4d8e58ee08dad957002027830d5c3b06aea446a6a3744483c2b3b745345c", size = 4647548, upload-time = "2025-10-16T22:16:57.008Z" }, - { url = "https://files.pythonhosted.org/packages/c1/37/945b4ca0ac27e3dc4952642d4c900edd030b3da6c9634875af6e13ae80e5/uvloop-0.22.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b91328c72635f6f9e0282e4a57da7470c7350ab1c9f48546c0f2866205349d21", size = 4467065, upload-time = "2025-10-16T22:16:58.206Z" }, - { url = "https://files.pythonhosted.org/packages/97/cc/48d232f33d60e2e2e0b42f4e73455b146b76ebe216487e862700457fbf3c/uvloop-0.22.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:daf620c2995d193449393d6c62131b3fbd40a63bf7b307a1527856ace637fe88", size = 4328384, upload-time = "2025-10-16T22:16:59.36Z" }, - { url = "https://files.pythonhosted.org/packages/e4/16/c1fd27e9549f3c4baf1dc9c20c456cd2f822dbf8de9f463824b0c0357e06/uvloop-0.22.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:6cde23eeda1a25c75b2e07d39970f3374105d5eafbaab2a4482be82f272d5a5e", size = 4296730, upload-time = "2025-10-16T22:17:00.744Z" }, -] - -[[package]] -name = "watchfiles" -version = "1.1.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "anyio" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/c2/c9/8869df9b2a2d6c59d79220a4db37679e74f807c559ffe5265e08b227a210/watchfiles-1.1.1.tar.gz", hash = "sha256:a173cb5c16c4f40ab19cecf48a534c409f7ea983ab8fed0741304a1c0a31b3f2", size = 94440, upload-time = "2025-10-14T15:06:21.08Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/74/d5/f039e7e3c639d9b1d09b07ea412a6806d38123f0508e5f9b48a87b0a76cc/watchfiles-1.1.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:8c89f9f2f740a6b7dcc753140dd5e1ab9215966f7a3530d0c0705c83b401bd7d", size = 404745, upload-time = "2025-10-14T15:04:46.731Z" }, - { url = "https://files.pythonhosted.org/packages/a5/96/a881a13aa1349827490dab2d363c8039527060cfcc2c92cc6d13d1b1049e/watchfiles-1.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bd404be08018c37350f0d6e34676bd1e2889990117a2b90070b3007f172d0610", size = 391769, upload-time = "2025-10-14T15:04:48.003Z" }, - { url = "https://files.pythonhosted.org/packages/4b/5b/d3b460364aeb8da471c1989238ea0e56bec24b6042a68046adf3d9ddb01c/watchfiles-1.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8526e8f916bb5b9a0a777c8317c23ce65de259422bba5b31325a6fa6029d33af", size = 449374, upload-time = "2025-10-14T15:04:49.179Z" }, - { url = "https://files.pythonhosted.org/packages/b9/44/5769cb62d4ed055cb17417c0a109a92f007114a4e07f30812a73a4efdb11/watchfiles-1.1.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2edc3553362b1c38d9f06242416a5d8e9fe235c204a4072e988ce2e5bb1f69f6", size = 459485, upload-time = "2025-10-14T15:04:50.155Z" }, - { url = "https://files.pythonhosted.org/packages/19/0c/286b6301ded2eccd4ffd0041a1b726afda999926cf720aab63adb68a1e36/watchfiles-1.1.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:30f7da3fb3f2844259cba4720c3fc7138eb0f7b659c38f3bfa65084c7fc7abce", size = 488813, upload-time = "2025-10-14T15:04:51.059Z" }, - { url = "https://files.pythonhosted.org/packages/c7/2b/8530ed41112dd4a22f4dcfdb5ccf6a1baad1ff6eed8dc5a5f09e7e8c41c7/watchfiles-1.1.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f8979280bdafff686ba5e4d8f97840f929a87ed9cdf133cbbd42f7766774d2aa", size = 594816, upload-time = "2025-10-14T15:04:52.031Z" }, - { url = "https://files.pythonhosted.org/packages/ce/d2/f5f9fb49489f184f18470d4f99f4e862a4b3e9ac2865688eb2099e3d837a/watchfiles-1.1.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dcc5c24523771db3a294c77d94771abcfcb82a0e0ee8efd910c37c59ec1b31bb", size = 475186, upload-time = "2025-10-14T15:04:53.064Z" }, - { url = "https://files.pythonhosted.org/packages/cf/68/5707da262a119fb06fbe214d82dd1fe4a6f4af32d2d14de368d0349eb52a/watchfiles-1.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1db5d7ae38ff20153d542460752ff397fcf5c96090c1230803713cf3147a6803", size = 456812, upload-time = "2025-10-14T15:04:55.174Z" }, - { url = "https://files.pythonhosted.org/packages/66/ab/3cbb8756323e8f9b6f9acb9ef4ec26d42b2109bce830cc1f3468df20511d/watchfiles-1.1.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:28475ddbde92df1874b6c5c8aaeb24ad5be47a11f87cde5a28ef3835932e3e94", size = 630196, upload-time = "2025-10-14T15:04:56.22Z" }, - { url = "https://files.pythonhosted.org/packages/78/46/7152ec29b8335f80167928944a94955015a345440f524d2dfe63fc2f437b/watchfiles-1.1.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:36193ed342f5b9842edd3532729a2ad55c4160ffcfa3700e0d54be496b70dd43", size = 622657, upload-time = "2025-10-14T15:04:57.521Z" }, - { url = "https://files.pythonhosted.org/packages/0a/bf/95895e78dd75efe9a7f31733607f384b42eb5feb54bd2eb6ed57cc2e94f4/watchfiles-1.1.1-cp312-cp312-win32.whl", hash = "sha256:859e43a1951717cc8de7f4c77674a6d389b106361585951d9e69572823f311d9", size = 272042, upload-time = "2025-10-14T15:04:59.046Z" }, - { url = "https://files.pythonhosted.org/packages/87/0a/90eb755f568de2688cb220171c4191df932232c20946966c27a59c400850/watchfiles-1.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:91d4c9a823a8c987cce8fa2690923b069966dabb196dd8d137ea2cede885fde9", size = 288410, upload-time = "2025-10-14T15:05:00.081Z" }, - { url = "https://files.pythonhosted.org/packages/36/76/f322701530586922fbd6723c4f91ace21364924822a8772c549483abed13/watchfiles-1.1.1-cp312-cp312-win_arm64.whl", hash = "sha256:a625815d4a2bdca61953dbba5a39d60164451ef34c88d751f6c368c3ea73d404", size = 278209, upload-time = "2025-10-14T15:05:01.168Z" }, - { url = "https://files.pythonhosted.org/packages/bb/f4/f750b29225fe77139f7ae5de89d4949f5a99f934c65a1f1c0b248f26f747/watchfiles-1.1.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:130e4876309e8686a5e37dba7d5e9bc77e6ed908266996ca26572437a5271e18", size = 404321, upload-time = "2025-10-14T15:05:02.063Z" }, - { url = "https://files.pythonhosted.org/packages/2b/f9/f07a295cde762644aa4c4bb0f88921d2d141af45e735b965fb2e87858328/watchfiles-1.1.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5f3bde70f157f84ece3765b42b4a52c6ac1a50334903c6eaf765362f6ccca88a", size = 391783, upload-time = "2025-10-14T15:05:03.052Z" }, - { url = "https://files.pythonhosted.org/packages/bc/11/fc2502457e0bea39a5c958d86d2cb69e407a4d00b85735ca724bfa6e0d1a/watchfiles-1.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:14e0b1fe858430fc0251737ef3824c54027bedb8c37c38114488b8e131cf8219", size = 449279, upload-time = "2025-10-14T15:05:04.004Z" }, - { url = "https://files.pythonhosted.org/packages/e3/1f/d66bc15ea0b728df3ed96a539c777acfcad0eb78555ad9efcaa1274688f0/watchfiles-1.1.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f27db948078f3823a6bb3b465180db8ebecf26dd5dae6f6180bd87383b6b4428", size = 459405, upload-time = "2025-10-14T15:05:04.942Z" }, - { url = "https://files.pythonhosted.org/packages/be/90/9f4a65c0aec3ccf032703e6db02d89a157462fbb2cf20dd415128251cac0/watchfiles-1.1.1-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:059098c3a429f62fc98e8ec62b982230ef2c8df68c79e826e37b895bc359a9c0", size = 488976, upload-time = "2025-10-14T15:05:05.905Z" }, - { url = "https://files.pythonhosted.org/packages/37/57/ee347af605d867f712be7029bb94c8c071732a4b44792e3176fa3c612d39/watchfiles-1.1.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bfb5862016acc9b869bb57284e6cb35fdf8e22fe59f7548858e2f971d045f150", size = 595506, upload-time = "2025-10-14T15:05:06.906Z" }, - { url = "https://files.pythonhosted.org/packages/a8/78/cc5ab0b86c122047f75e8fc471c67a04dee395daf847d3e59381996c8707/watchfiles-1.1.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:319b27255aacd9923b8a276bb14d21a5f7ff82564c744235fc5eae58d95422ae", size = 474936, upload-time = "2025-10-14T15:05:07.906Z" }, - { url = "https://files.pythonhosted.org/packages/62/da/def65b170a3815af7bd40a3e7010bf6ab53089ef1b75d05dd5385b87cf08/watchfiles-1.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c755367e51db90e75b19454b680903631d41f9e3607fbd941d296a020c2d752d", size = 456147, upload-time = "2025-10-14T15:05:09.138Z" }, - { url = "https://files.pythonhosted.org/packages/57/99/da6573ba71166e82d288d4df0839128004c67d2778d3b566c138695f5c0b/watchfiles-1.1.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:c22c776292a23bfc7237a98f791b9ad3144b02116ff10d820829ce62dff46d0b", size = 630007, upload-time = "2025-10-14T15:05:10.117Z" }, - { url = "https://files.pythonhosted.org/packages/a8/51/7439c4dd39511368849eb1e53279cd3454b4a4dbace80bab88feeb83c6b5/watchfiles-1.1.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:3a476189be23c3686bc2f4321dd501cb329c0a0469e77b7b534ee10129ae6374", size = 622280, upload-time = "2025-10-14T15:05:11.146Z" }, - { url = "https://files.pythonhosted.org/packages/95/9c/8ed97d4bba5db6fdcdb2b298d3898f2dd5c20f6b73aee04eabe56c59677e/watchfiles-1.1.1-cp313-cp313-win32.whl", hash = "sha256:bf0a91bfb5574a2f7fc223cf95eeea79abfefa404bf1ea5e339c0c1560ae99a0", size = 272056, upload-time = "2025-10-14T15:05:12.156Z" }, - { url = "https://files.pythonhosted.org/packages/1f/f3/c14e28429f744a260d8ceae18bf58c1d5fa56b50d006a7a9f80e1882cb0d/watchfiles-1.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:52e06553899e11e8074503c8e716d574adeeb7e68913115c4b3653c53f9bae42", size = 288162, upload-time = "2025-10-14T15:05:13.208Z" }, - { url = "https://files.pythonhosted.org/packages/dc/61/fe0e56c40d5cd29523e398d31153218718c5786b5e636d9ae8ae79453d27/watchfiles-1.1.1-cp313-cp313-win_arm64.whl", hash = "sha256:ac3cc5759570cd02662b15fbcd9d917f7ecd47efe0d6b40474eafd246f91ea18", size = 277909, upload-time = "2025-10-14T15:05:14.49Z" }, - { url = "https://files.pythonhosted.org/packages/79/42/e0a7d749626f1e28c7108a99fb9bf524b501bbbeb9b261ceecde644d5a07/watchfiles-1.1.1-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:563b116874a9a7ce6f96f87cd0b94f7faf92d08d0021e837796f0a14318ef8da", size = 403389, upload-time = "2025-10-14T15:05:15.777Z" }, - { url = "https://files.pythonhosted.org/packages/15/49/08732f90ce0fbbc13913f9f215c689cfc9ced345fb1bcd8829a50007cc8d/watchfiles-1.1.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:3ad9fe1dae4ab4212d8c91e80b832425e24f421703b5a42ef2e4a1e215aff051", size = 389964, upload-time = "2025-10-14T15:05:16.85Z" }, - { url = "https://files.pythonhosted.org/packages/27/0d/7c315d4bd5f2538910491a0393c56bf70d333d51bc5b34bee8e68e8cea19/watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ce70f96a46b894b36eba678f153f052967a0d06d5b5a19b336ab0dbbd029f73e", size = 448114, upload-time = "2025-10-14T15:05:17.876Z" }, - { url = "https://files.pythonhosted.org/packages/c3/24/9e096de47a4d11bc4df41e9d1e61776393eac4cb6eb11b3e23315b78b2cc/watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cb467c999c2eff23a6417e58d75e5828716f42ed8289fe6b77a7e5a91036ca70", size = 460264, upload-time = "2025-10-14T15:05:18.962Z" }, - { url = "https://files.pythonhosted.org/packages/cc/0f/e8dea6375f1d3ba5fcb0b3583e2b493e77379834c74fd5a22d66d85d6540/watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:836398932192dae4146c8f6f737d74baeac8b70ce14831a239bdb1ca882fc261", size = 487877, upload-time = "2025-10-14T15:05:20.094Z" }, - { url = "https://files.pythonhosted.org/packages/ac/5b/df24cfc6424a12deb41503b64d42fbea6b8cb357ec62ca84a5a3476f654a/watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:743185e7372b7bc7c389e1badcc606931a827112fbbd37f14c537320fca08620", size = 595176, upload-time = "2025-10-14T15:05:21.134Z" }, - { url = "https://files.pythonhosted.org/packages/8f/b5/853b6757f7347de4e9b37e8cc3289283fb983cba1ab4d2d7144694871d9c/watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:afaeff7696e0ad9f02cbb8f56365ff4686ab205fcf9c4c5b6fdfaaa16549dd04", size = 473577, upload-time = "2025-10-14T15:05:22.306Z" }, - { url = "https://files.pythonhosted.org/packages/e1/f7/0a4467be0a56e80447c8529c9fce5b38eab4f513cb3d9bf82e7392a5696b/watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3f7eb7da0eb23aa2ba036d4f616d46906013a68caf61b7fdbe42fc8b25132e77", size = 455425, upload-time = "2025-10-14T15:05:23.348Z" }, - { url = "https://files.pythonhosted.org/packages/8e/e0/82583485ea00137ddf69bc84a2db88bd92ab4a6e3c405e5fb878ead8d0e7/watchfiles-1.1.1-cp313-cp313t-musllinux_1_1_aarch64.whl", hash = "sha256:831a62658609f0e5c64178211c942ace999517f5770fe9436be4c2faeba0c0ef", size = 628826, upload-time = "2025-10-14T15:05:24.398Z" }, - { url = "https://files.pythonhosted.org/packages/28/9a/a785356fccf9fae84c0cc90570f11702ae9571036fb25932f1242c82191c/watchfiles-1.1.1-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:f9a2ae5c91cecc9edd47e041a930490c31c3afb1f5e6d71de3dc671bfaca02bf", size = 622208, upload-time = "2025-10-14T15:05:25.45Z" }, - { url = "https://files.pythonhosted.org/packages/c3/f4/0872229324ef69b2c3edec35e84bd57a1289e7d3fe74588048ed8947a323/watchfiles-1.1.1-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:d1715143123baeeaeadec0528bb7441103979a1d5f6fd0e1f915383fea7ea6d5", size = 404315, upload-time = "2025-10-14T15:05:26.501Z" }, - { url = "https://files.pythonhosted.org/packages/7b/22/16d5331eaed1cb107b873f6ae1b69e9ced582fcf0c59a50cd84f403b1c32/watchfiles-1.1.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:39574d6370c4579d7f5d0ad940ce5b20db0e4117444e39b6d8f99db5676c52fd", size = 390869, upload-time = "2025-10-14T15:05:27.649Z" }, - { url = "https://files.pythonhosted.org/packages/b2/7e/5643bfff5acb6539b18483128fdc0ef2cccc94a5b8fbda130c823e8ed636/watchfiles-1.1.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7365b92c2e69ee952902e8f70f3ba6360d0d596d9299d55d7d386df84b6941fb", size = 449919, upload-time = "2025-10-14T15:05:28.701Z" }, - { url = "https://files.pythonhosted.org/packages/51/2e/c410993ba5025a9f9357c376f48976ef0e1b1aefb73b97a5ae01a5972755/watchfiles-1.1.1-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bfff9740c69c0e4ed32416f013f3c45e2ae42ccedd1167ef2d805c000b6c71a5", size = 460845, upload-time = "2025-10-14T15:05:30.064Z" }, - { url = "https://files.pythonhosted.org/packages/8e/a4/2df3b404469122e8680f0fcd06079317e48db58a2da2950fb45020947734/watchfiles-1.1.1-cp314-cp314-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b27cf2eb1dda37b2089e3907d8ea92922b673c0c427886d4edc6b94d8dfe5db3", size = 489027, upload-time = "2025-10-14T15:05:31.064Z" }, - { url = "https://files.pythonhosted.org/packages/ea/84/4587ba5b1f267167ee715b7f66e6382cca6938e0a4b870adad93e44747e6/watchfiles-1.1.1-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:526e86aced14a65a5b0ec50827c745597c782ff46b571dbfe46192ab9e0b3c33", size = 595615, upload-time = "2025-10-14T15:05:32.074Z" }, - { url = "https://files.pythonhosted.org/packages/6a/0f/c6988c91d06e93cd0bb3d4a808bcf32375ca1904609835c3031799e3ecae/watchfiles-1.1.1-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:04e78dd0b6352db95507fd8cb46f39d185cf8c74e4cf1e4fbad1d3df96faf510", size = 474836, upload-time = "2025-10-14T15:05:33.209Z" }, - { url = "https://files.pythonhosted.org/packages/b4/36/ded8aebea91919485b7bbabbd14f5f359326cb5ec218cd67074d1e426d74/watchfiles-1.1.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5c85794a4cfa094714fb9c08d4a218375b2b95b8ed1666e8677c349906246c05", size = 455099, upload-time = "2025-10-14T15:05:34.189Z" }, - { url = "https://files.pythonhosted.org/packages/98/e0/8c9bdba88af756a2fce230dd365fab2baf927ba42cd47521ee7498fd5211/watchfiles-1.1.1-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:74d5012b7630714b66be7b7b7a78855ef7ad58e8650c73afc4c076a1f480a8d6", size = 630626, upload-time = "2025-10-14T15:05:35.216Z" }, - { url = "https://files.pythonhosted.org/packages/2a/84/a95db05354bf2d19e438520d92a8ca475e578c647f78f53197f5a2f17aaf/watchfiles-1.1.1-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:8fbe85cb3201c7d380d3d0b90e63d520f15d6afe217165d7f98c9c649654db81", size = 622519, upload-time = "2025-10-14T15:05:36.259Z" }, - { url = "https://files.pythonhosted.org/packages/1d/ce/d8acdc8de545de995c339be67711e474c77d643555a9bb74a9334252bd55/watchfiles-1.1.1-cp314-cp314-win32.whl", hash = "sha256:3fa0b59c92278b5a7800d3ee7733da9d096d4aabcfabb9a928918bd276ef9b9b", size = 272078, upload-time = "2025-10-14T15:05:37.63Z" }, - { url = "https://files.pythonhosted.org/packages/c4/c9/a74487f72d0451524be827e8edec251da0cc1fcf111646a511ae752e1a3d/watchfiles-1.1.1-cp314-cp314-win_amd64.whl", hash = "sha256:c2047d0b6cea13b3316bdbafbfa0c4228ae593d995030fda39089d36e64fc03a", size = 287664, upload-time = "2025-10-14T15:05:38.95Z" }, - { url = "https://files.pythonhosted.org/packages/df/b8/8ac000702cdd496cdce998c6f4ee0ca1f15977bba51bdf07d872ebdfc34c/watchfiles-1.1.1-cp314-cp314-win_arm64.whl", hash = "sha256:842178b126593addc05acf6fce960d28bc5fae7afbaa2c6c1b3a7b9460e5be02", size = 277154, upload-time = "2025-10-14T15:05:39.954Z" }, - { url = "https://files.pythonhosted.org/packages/47/a8/e3af2184707c29f0f14b1963c0aace6529f9d1b8582d5b99f31bbf42f59e/watchfiles-1.1.1-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:88863fbbc1a7312972f1c511f202eb30866370ebb8493aef2812b9ff28156a21", size = 403820, upload-time = "2025-10-14T15:05:40.932Z" }, - { url = "https://files.pythonhosted.org/packages/c0/ec/e47e307c2f4bd75f9f9e8afbe3876679b18e1bcec449beca132a1c5ffb2d/watchfiles-1.1.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:55c7475190662e202c08c6c0f4d9e345a29367438cf8e8037f3155e10a88d5a5", size = 390510, upload-time = "2025-10-14T15:05:41.945Z" }, - { url = "https://files.pythonhosted.org/packages/d5/a0/ad235642118090f66e7b2f18fd5c42082418404a79205cdfca50b6309c13/watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f53fa183d53a1d7a8852277c92b967ae99c2d4dcee2bfacff8868e6e30b15f7", size = 448408, upload-time = "2025-10-14T15:05:43.385Z" }, - { url = "https://files.pythonhosted.org/packages/df/85/97fa10fd5ff3332ae17e7e40e20784e419e28521549780869f1413742e9d/watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6aae418a8b323732fa89721d86f39ec8f092fc2af67f4217a2b07fd3e93c6101", size = 458968, upload-time = "2025-10-14T15:05:44.404Z" }, - { url = "https://files.pythonhosted.org/packages/47/c2/9059c2e8966ea5ce678166617a7f75ecba6164375f3b288e50a40dc6d489/watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f096076119da54a6080e8920cbdaac3dbee667eb91dcc5e5b78840b87415bd44", size = 488096, upload-time = "2025-10-14T15:05:45.398Z" }, - { url = "https://files.pythonhosted.org/packages/94/44/d90a9ec8ac309bc26db808a13e7bfc0e4e78b6fc051078a554e132e80160/watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:00485f441d183717038ed2e887a7c868154f216877653121068107b227a2f64c", size = 596040, upload-time = "2025-10-14T15:05:46.502Z" }, - { url = "https://files.pythonhosted.org/packages/95/68/4e3479b20ca305cfc561db3ed207a8a1c745ee32bf24f2026a129d0ddb6e/watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a55f3e9e493158d7bfdb60a1165035f1cf7d320914e7b7ea83fe22c6023b58fc", size = 473847, upload-time = "2025-10-14T15:05:47.484Z" }, - { url = "https://files.pythonhosted.org/packages/4f/55/2af26693fd15165c4ff7857e38330e1b61ab8c37d15dc79118cdba115b7a/watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c91ed27800188c2ae96d16e3149f199d62f86c7af5f5f4d2c61a3ed8cd3666c", size = 455072, upload-time = "2025-10-14T15:05:48.928Z" }, - { url = "https://files.pythonhosted.org/packages/66/1d/d0d200b10c9311ec25d2273f8aad8c3ef7cc7ea11808022501811208a750/watchfiles-1.1.1-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:311ff15a0bae3714ffb603e6ba6dbfba4065ab60865d15a6ec544133bdb21099", size = 629104, upload-time = "2025-10-14T15:05:49.908Z" }, - { url = "https://files.pythonhosted.org/packages/e3/bd/fa9bb053192491b3867ba07d2343d9f2252e00811567d30ae8d0f78136fe/watchfiles-1.1.1-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:a916a2932da8f8ab582f242c065f5c81bed3462849ca79ee357dd9551b0e9b01", size = 622112, upload-time = "2025-10-14T15:05:50.941Z" }, -] - -[[package]] -name = "wcwidth" -version = "0.6.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/35/a2/8e3becb46433538a38726c948d3399905a4c7cabd0df578ede5dc51f0ec2/wcwidth-0.6.0.tar.gz", hash = "sha256:cdc4e4262d6ef9a1a57e018384cbeb1208d8abbc64176027e2c2455c81313159", size = 159684, upload-time = "2026-02-06T19:19:40.919Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/68/5a/199c59e0a824a3db2b89c5d2dade7ab5f9624dbf6448dc291b46d5ec94d3/wcwidth-0.6.0-py3-none-any.whl", hash = "sha256:1a3a1e510b553315f8e146c54764f4fb6264ffad731b3d78088cdb1478ffbdad", size = 94189, upload-time = "2026-02-06T19:19:39.646Z" }, -] - -[[package]] -name = "websockets" -version = "16.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/04/24/4b2031d72e840ce4c1ccb255f693b15c334757fc50023e4db9537080b8c4/websockets-16.0.tar.gz", hash = "sha256:5f6261a5e56e8d5c42a4497b364ea24d94d9563e8fbd44e78ac40879c60179b5", size = 179346, upload-time = "2026-01-10T09:23:47.181Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/84/7b/bac442e6b96c9d25092695578dda82403c77936104b5682307bd4deb1ad4/websockets-16.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:71c989cbf3254fbd5e84d3bff31e4da39c43f884e64f2551d14bb3c186230f00", size = 177365, upload-time = "2026-01-10T09:22:46.787Z" }, - { url = "https://files.pythonhosted.org/packages/b0/fe/136ccece61bd690d9c1f715baaeefd953bb2360134de73519d5df19d29ca/websockets-16.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:8b6e209ffee39ff1b6d0fa7bfef6de950c60dfb91b8fcead17da4ee539121a79", size = 175038, upload-time = "2026-01-10T09:22:47.999Z" }, - { url = "https://files.pythonhosted.org/packages/40/1e/9771421ac2286eaab95b8575b0cb701ae3663abf8b5e1f64f1fd90d0a673/websockets-16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:86890e837d61574c92a97496d590968b23c2ef0aeb8a9bc9421d174cd378ae39", size = 175328, upload-time = "2026-01-10T09:22:49.809Z" }, - { url = "https://files.pythonhosted.org/packages/18/29/71729b4671f21e1eaa5d6573031ab810ad2936c8175f03f97f3ff164c802/websockets-16.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:9b5aca38b67492ef518a8ab76851862488a478602229112c4b0d58d63a7a4d5c", size = 184915, upload-time = "2026-01-10T09:22:51.071Z" }, - { url = "https://files.pythonhosted.org/packages/97/bb/21c36b7dbbafc85d2d480cd65df02a1dc93bf76d97147605a8e27ff9409d/websockets-16.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e0334872c0a37b606418ac52f6ab9cfd17317ac26365f7f65e203e2d0d0d359f", size = 186152, upload-time = "2026-01-10T09:22:52.224Z" }, - { url = "https://files.pythonhosted.org/packages/4a/34/9bf8df0c0cf88fa7bfe36678dc7b02970c9a7d5e065a3099292db87b1be2/websockets-16.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a0b31e0b424cc6b5a04b8838bbaec1688834b2383256688cf47eb97412531da1", size = 185583, upload-time = "2026-01-10T09:22:53.443Z" }, - { url = "https://files.pythonhosted.org/packages/47/88/4dd516068e1a3d6ab3c7c183288404cd424a9a02d585efbac226cb61ff2d/websockets-16.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:485c49116d0af10ac698623c513c1cc01c9446c058a4e61e3bf6c19dff7335a2", size = 184880, upload-time = "2026-01-10T09:22:55.033Z" }, - { url = "https://files.pythonhosted.org/packages/91/d6/7d4553ad4bf1c0421e1ebd4b18de5d9098383b5caa1d937b63df8d04b565/websockets-16.0-cp312-cp312-win32.whl", hash = "sha256:eaded469f5e5b7294e2bdca0ab06becb6756ea86894a47806456089298813c89", size = 178261, upload-time = "2026-01-10T09:22:56.251Z" }, - { url = "https://files.pythonhosted.org/packages/c3/f0/f3a17365441ed1c27f850a80b2bc680a0fa9505d733fe152fdf5e98c1c0b/websockets-16.0-cp312-cp312-win_amd64.whl", hash = "sha256:5569417dc80977fc8c2d43a86f78e0a5a22fee17565d78621b6bb264a115d4ea", size = 178693, upload-time = "2026-01-10T09:22:57.478Z" }, - { url = "https://files.pythonhosted.org/packages/cc/9c/baa8456050d1c1b08dd0ec7346026668cbc6f145ab4e314d707bb845bf0d/websockets-16.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:878b336ac47938b474c8f982ac2f7266a540adc3fa4ad74ae96fea9823a02cc9", size = 177364, upload-time = "2026-01-10T09:22:59.333Z" }, - { url = "https://files.pythonhosted.org/packages/7e/0c/8811fc53e9bcff68fe7de2bcbe75116a8d959ac699a3200f4847a8925210/websockets-16.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:52a0fec0e6c8d9a784c2c78276a48a2bdf099e4ccc2a4cad53b27718dbfd0230", size = 175039, upload-time = "2026-01-10T09:23:01.171Z" }, - { url = "https://files.pythonhosted.org/packages/aa/82/39a5f910cb99ec0b59e482971238c845af9220d3ab9fa76dd9162cda9d62/websockets-16.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:e6578ed5b6981005df1860a56e3617f14a6c307e6a71b4fff8c48fdc50f3ed2c", size = 175323, upload-time = "2026-01-10T09:23:02.341Z" }, - { url = "https://files.pythonhosted.org/packages/bd/28/0a25ee5342eb5d5f297d992a77e56892ecb65e7854c7898fb7d35e9b33bd/websockets-16.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:95724e638f0f9c350bb1c2b0a7ad0e83d9cc0c9259f3ea94e40d7b02a2179ae5", size = 184975, upload-time = "2026-01-10T09:23:03.756Z" }, - { url = "https://files.pythonhosted.org/packages/f9/66/27ea52741752f5107c2e41fda05e8395a682a1e11c4e592a809a90c6a506/websockets-16.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c0204dc62a89dc9d50d682412c10b3542d748260d743500a85c13cd1ee4bde82", size = 186203, upload-time = "2026-01-10T09:23:05.01Z" }, - { url = "https://files.pythonhosted.org/packages/37/e5/8e32857371406a757816a2b471939d51c463509be73fa538216ea52b792a/websockets-16.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:52ac480f44d32970d66763115edea932f1c5b1312de36df06d6b219f6741eed8", size = 185653, upload-time = "2026-01-10T09:23:06.301Z" }, - { url = "https://files.pythonhosted.org/packages/9b/67/f926bac29882894669368dc73f4da900fcdf47955d0a0185d60103df5737/websockets-16.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6e5a82b677f8f6f59e8dfc34ec06ca6b5b48bc4fcda346acd093694cc2c24d8f", size = 184920, upload-time = "2026-01-10T09:23:07.492Z" }, - { url = "https://files.pythonhosted.org/packages/3c/a1/3d6ccdcd125b0a42a311bcd15a7f705d688f73b2a22d8cf1c0875d35d34a/websockets-16.0-cp313-cp313-win32.whl", hash = "sha256:abf050a199613f64c886ea10f38b47770a65154dc37181bfaff70c160f45315a", size = 178255, upload-time = "2026-01-10T09:23:09.245Z" }, - { url = "https://files.pythonhosted.org/packages/6b/ae/90366304d7c2ce80f9b826096a9e9048b4bb760e44d3b873bb272cba696b/websockets-16.0-cp313-cp313-win_amd64.whl", hash = "sha256:3425ac5cf448801335d6fdc7ae1eb22072055417a96cc6b31b3861f455fbc156", size = 178689, upload-time = "2026-01-10T09:23:10.483Z" }, - { url = "https://files.pythonhosted.org/packages/f3/1d/e88022630271f5bd349ed82417136281931e558d628dd52c4d8621b4a0b2/websockets-16.0-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:8cc451a50f2aee53042ac52d2d053d08bf89bcb31ae799cb4487587661c038a0", size = 177406, upload-time = "2026-01-10T09:23:12.178Z" }, - { url = "https://files.pythonhosted.org/packages/f2/78/e63be1bf0724eeb4616efb1ae1c9044f7c3953b7957799abb5915bffd38e/websockets-16.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:daa3b6ff70a9241cf6c7fc9e949d41232d9d7d26fd3522b1ad2b4d62487e9904", size = 175085, upload-time = "2026-01-10T09:23:13.511Z" }, - { url = "https://files.pythonhosted.org/packages/bb/f4/d3c9220d818ee955ae390cf319a7c7a467beceb24f05ee7aaaa2414345ba/websockets-16.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:fd3cb4adb94a2a6e2b7c0d8d05cb94e6f1c81a0cf9dc2694fb65c7e8d94c42e4", size = 175328, upload-time = "2026-01-10T09:23:14.727Z" }, - { url = "https://files.pythonhosted.org/packages/63/bc/d3e208028de777087e6fb2b122051a6ff7bbcca0d6df9d9c2bf1dd869ae9/websockets-16.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:781caf5e8eee67f663126490c2f96f40906594cb86b408a703630f95550a8c3e", size = 185044, upload-time = "2026-01-10T09:23:15.939Z" }, - { url = "https://files.pythonhosted.org/packages/ad/6e/9a0927ac24bd33a0a9af834d89e0abc7cfd8e13bed17a86407a66773cc0e/websockets-16.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:caab51a72c51973ca21fa8a18bd8165e1a0183f1ac7066a182ff27107b71e1a4", size = 186279, upload-time = "2026-01-10T09:23:17.148Z" }, - { url = "https://files.pythonhosted.org/packages/b9/ca/bf1c68440d7a868180e11be653c85959502efd3a709323230314fda6e0b3/websockets-16.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:19c4dc84098e523fd63711e563077d39e90ec6702aff4b5d9e344a60cb3c0cb1", size = 185711, upload-time = "2026-01-10T09:23:18.372Z" }, - { url = "https://files.pythonhosted.org/packages/c4/f8/fdc34643a989561f217bb477cbc47a3a07212cbda91c0e4389c43c296ebf/websockets-16.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:a5e18a238a2b2249c9a9235466b90e96ae4795672598a58772dd806edc7ac6d3", size = 184982, upload-time = "2026-01-10T09:23:19.652Z" }, - { url = "https://files.pythonhosted.org/packages/dd/d1/574fa27e233764dbac9c52730d63fcf2823b16f0856b3329fc6268d6ae4f/websockets-16.0-cp314-cp314-win32.whl", hash = "sha256:a069d734c4a043182729edd3e9f247c3b2a4035415a9172fd0f1b71658a320a8", size = 177915, upload-time = "2026-01-10T09:23:21.458Z" }, - { url = "https://files.pythonhosted.org/packages/8a/f1/ae6b937bf3126b5134ce1f482365fde31a357c784ac51852978768b5eff4/websockets-16.0-cp314-cp314-win_amd64.whl", hash = "sha256:c0ee0e63f23914732c6d7e0cce24915c48f3f1512ec1d079ed01fc629dab269d", size = 178381, upload-time = "2026-01-10T09:23:22.715Z" }, - { url = "https://files.pythonhosted.org/packages/06/9b/f791d1db48403e1f0a27577a6beb37afae94254a8c6f08be4a23e4930bc0/websockets-16.0-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:a35539cacc3febb22b8f4d4a99cc79b104226a756aa7400adc722e83b0d03244", size = 177737, upload-time = "2026-01-10T09:23:24.523Z" }, - { url = "https://files.pythonhosted.org/packages/bd/40/53ad02341fa33b3ce489023f635367a4ac98b73570102ad2cdd770dacc9a/websockets-16.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:b784ca5de850f4ce93ec85d3269d24d4c82f22b7212023c974c401d4980ebc5e", size = 175268, upload-time = "2026-01-10T09:23:25.781Z" }, - { url = "https://files.pythonhosted.org/packages/74/9b/6158d4e459b984f949dcbbb0c5d270154c7618e11c01029b9bbd1bb4c4f9/websockets-16.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:569d01a4e7fba956c5ae4fc988f0d4e187900f5497ce46339c996dbf24f17641", size = 175486, upload-time = "2026-01-10T09:23:27.033Z" }, - { url = "https://files.pythonhosted.org/packages/e5/2d/7583b30208b639c8090206f95073646c2c9ffd66f44df967981a64f849ad/websockets-16.0-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:50f23cdd8343b984957e4077839841146f67a3d31ab0d00e6b824e74c5b2f6e8", size = 185331, upload-time = "2026-01-10T09:23:28.259Z" }, - { url = "https://files.pythonhosted.org/packages/45/b0/cce3784eb519b7b5ad680d14b9673a31ab8dcb7aad8b64d81709d2430aa8/websockets-16.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:152284a83a00c59b759697b7f9e9cddf4e3c7861dd0d964b472b70f78f89e80e", size = 186501, upload-time = "2026-01-10T09:23:29.449Z" }, - { url = "https://files.pythonhosted.org/packages/19/60/b8ebe4c7e89fb5f6cdf080623c9d92789a53636950f7abacfc33fe2b3135/websockets-16.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:bc59589ab64b0022385f429b94697348a6a234e8ce22544e3681b2e9331b5944", size = 186062, upload-time = "2026-01-10T09:23:31.368Z" }, - { url = "https://files.pythonhosted.org/packages/88/a8/a080593f89b0138b6cba1b28f8df5673b5506f72879322288b031337c0b8/websockets-16.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:32da954ffa2814258030e5a57bc73a3635463238e797c7375dc8091327434206", size = 185356, upload-time = "2026-01-10T09:23:32.627Z" }, - { url = "https://files.pythonhosted.org/packages/c2/b6/b9afed2afadddaf5ebb2afa801abf4b0868f42f8539bfe4b071b5266c9fe/websockets-16.0-cp314-cp314t-win32.whl", hash = "sha256:5a4b4cc550cb665dd8a47f868c8d04c8230f857363ad3c9caf7a0c3bf8c61ca6", size = 178085, upload-time = "2026-01-10T09:23:33.816Z" }, - { url = "https://files.pythonhosted.org/packages/9f/3e/28135a24e384493fa804216b79a6a6759a38cc4ff59118787b9fb693df93/websockets-16.0-cp314-cp314t-win_amd64.whl", hash = "sha256:b14dc141ed6d2dde437cddb216004bcac6a1df0935d79656387bd41632ba0bbd", size = 178531, upload-time = "2026-01-10T09:23:35.016Z" }, - { url = "https://files.pythonhosted.org/packages/6f/28/258ebab549c2bf3e64d2b0217b973467394a9cea8c42f70418ca2c5d0d2e/websockets-16.0-py3-none-any.whl", hash = "sha256:1637db62fad1dc833276dded54215f2c7fa46912301a24bd94d45d46a011ceec", size = 171598, upload-time = "2026-01-10T09:23:45.395Z" }, -]