Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:memo: Require explicit requests for new endpoint documentation https://github.com/siyuan-note/siyuan/issues/19684

Danielc1a6b77fd025
diff --git a/AGENTS.md b/AGENTS.md
index 140bb06be8..76b05bae06 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -91,6 +91,7 @@ SiYuan repository guide. Module path `github.com/siyuan-note/siyuan`, license AG
- The menu `ignore` option controls conditional rendering and must not be used to opt an entry out of visibility or order configuration
10. **API contracts:**
- Follow [docs/API-CONTRACTS.md](docs/API-CONTRACTS.md) when adding or changing kernel HTTP APIs. Define new endpoints in `kernel/apicontract/` and bind their handlers through `contractHandler`; keep contracts synchronized when changing existing endpoints
+ - Do not automatically add newly implemented endpoints to `docs/API.md` or its localized versions (`docs/API.zh-CN.md`, `docs/API.ja.md`); add such documentation only when explicitly requested by the user. Continue maintaining API contracts, generated declarations, and required regression tests
- Preserve existing input compatibility, response variants, authorization, and encrypted notebook lease behavior; cover affected behavior with regression tests
- Remove migrated or deleted routes from `kernel/apicontract/legacy_routes.json`; never add new routes to this legacy list or bypass contract checks with `any` or type assertions
- After contract changes, run `pnpm run api:generate --petal ../../petal` and `pnpm run api:check --petal ../../petal` from `app/`; synchronize related public declarations in `petal` and do not hand-edit generated declarations or schemas
diff --git a/docs/API.ja.md b/docs/API.ja.md
index 2b19ebe872..08a4743b9c 100644
--- a/docs/API.ja.md
+++ b/docs/API.ja.md
@@ -90,8 +90,6 @@
* [HTTPフォワードプロキシ](#HTTPフォワードプロキシ)
* [WebSocketフォワードプロキシ](#WebSocketフォワードプロキシ)
* [EventSourceフォワードプロキシ](#EventSourceフォワードプロキシ)
-* [人工知能](#人工知能)
- * [判定モデルの接続テスト](#判定モデルの接続テスト)
* [システム](#システム)
* [起動進捗を取得](#起動進捗を取得)
* [システムバージョンを取得](#システムバージョンを取得)
@@ -1851,14 +1849,6 @@ if (response.code === 0 && response.data) {
* `t`: 任意。接続タイムアウトです。Goの`time.ParseDuration`形式を使用します。例は`30s`、`1500ms`です
* 戻り値: ターゲットサービスのHTTPステータスコードとレスポンス本文を直接ストリーミングし、`code`、`msg`、`data`ではラップしません。リクエストヘッダーに`Accept`がない場合は、`text/event-stream`を自動的に使用します。ターゲットのレスポンスヘッダーは`Siyuan-Proxy-`プレフィックス付きで返されます
-## 人工知能
-
-### 判定モデルの接続テスト
-
-`POST /api/ai/testDecisionModel` には認証と管理者権限が必要です。リクエスト本文は不要です。保存済みの `ai.decision` 設定を使い、固定サンプルで TypeSafe System One API をテストします。ノートの内容は読み取りません。判定モデルが無効でもテストできますが、AI 全体が無効の場合は拒否されます。プロバイダーの料金が発生する場合があります。
-
-有効な回答を受信すると、標準の成功レスポンスに `data: {"matched": true}` が含まれます。設定不足、通信失敗、無効なレスポンスの場合は、`code: 0` と `data: {"matched": false, "msg": "..."}` を返します。接続とレスポンス形式を確認するもので、モデルの精度を検証するものではありません。設定したタイムアウトが適用され、自動で再試行されません。
-
## システム
### 起動進捗を取得
diff --git a/docs/API.md b/docs/API.md
index 0ae6e4891d..4702a447c0 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -93,8 +93,6 @@ Plugin resource declarations, data authorization, and publishing APIs are docume
* [HTTP forward proxy](#HTTP-forward-proxy)
* [WebSocket forward proxy](#WebSocket-forward-proxy)
* [EventSource forward proxy](#EventSource-forward-proxy)
-* [AI](#AI)
- * [Test decision model](#Test-decision-model)
* [System](#System)
* [Get boot progress](#Get-boot-progress)
* [Get system version](#Get-system-version)
@@ -1861,14 +1859,6 @@ Note: To ensure data security, access to this interface is prohibited in Publish
* `t`: Optional, connection timeout in Go `time.ParseDuration` format, for example `30s` or `1500ms`
* Return value: Directly streams the target service HTTP status code and response body without wrapping them in `code`, `msg`, or `data`; if the request headers do not include `Accept`, `text/event-stream` is used automatically; target response headers are returned with the `Siyuan-Proxy-` prefix
-## AI
-
-### Test decision model
-
-`POST /api/ai/testDecisionModel` requires authentication and administrator access. No request body is needed. It tests the saved `ai.decision` configuration using a fixed sample with the TypeSafe System One API, without reading notes. The decision model can be disabled while testing; globally disabling AI rejects the request. A test may incur provider charges.
-
-The standard success envelope contains `data: {"matched": true}` when the provider returns a valid answer. An incomplete configuration, network failure or invalid provider response returns `data: {"matched": false, "msg": "..."}` with `code: 0`. This tests connectivity and response format, not model accuracy. The configured timeout applies, and the request is not retried automatically.
-
## System
### Get boot progress
diff --git a/docs/API.zh-CN.md b/docs/API.zh-CN.md
index 1ce1f18c5e..e454e174da 100644
--- a/docs/API.zh-CN.md
+++ b/docs/API.zh-CN.md
@@ -93,8 +93,6 @@
* [HTTP 正向代理](#HTTP-正向代理)
* [WebSocket 正向代理](#WebSocket-正向代理)
* [EventSource 正向代理](#EventSource-正向代理)
-* [人工智能](#人工智能)
- * [测试决策模型](#测试决策模型)
* [系统](#系统)
* [获取启动进度](#获取启动进度)
* [获取系统版本](#获取系统版本)
@@ -1857,14 +1855,6 @@ if (response.code === 0 && response.data) {
* `t`:可选,连接超时时间,使用 Go `time.ParseDuration` 格式,例如 `30s`、`1500ms`
* 返回值:直接流式返回目标服务的 HTTP 状态码和响应体,不封装 `code`、`msg`、`data`;如果请求标头中没有 `Accept`,会自动使用 `text/event-stream`;目标服务响应标头会添加 `Siyuan-Proxy-` 前缀后返回
-## 人工智能
-
-### 测试决策模型
-
-`POST /api/ai/testDecisionModel` 需要鉴权和管理员权限,无需请求体。使用已保存的 `ai.decision` 配置,以固定样例调用 TypeSafe System One 接口,不读取笔记内容。决策模型未启用时也可以测试;全局禁用人工智能时会拒绝请求。测试可能产生供应商费用。
-
-供应商返回有效答案时,标准成功响应中的数据为 `data: {"matched": true}`。配置不完整、网络失败或供应商响应无效时,返回 `data: {"matched": false, "msg": "..."}`,`code` 为 `0`。该接口验证连接和响应格式,不验证模型准确性。请求遵循配置的超时,不会自动重试。
-
## 系统
### 获取启动进度