Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

docs: treat /api/openapi.json as a reachability probe

tianma-if6d6b1704a024
diff --git a/README.ja.md b/README.ja.md
index a5bb9015..6895bc28 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -170,7 +170,7 @@ EdgeEver の Web とデスクトップはプラグインと、コードなしテ
- iOS アプリ: `apps/ios` のネイティブ SwiftUI(iOS 17+)。同梱の TipTap EditorBundle、GRDB のローカルミラー / outbox、Android に揃えたシェル。
- ネイティブデスクトップ: Electron + Rust sidecar。横断プラットフォームの操作感と、速いローカルデータ。SQLite でオフライン編集、復帰後の差分同期、ローカルバックアップ。
- Web Clipper: Manifest V3、Mozilla Readability、Turndown。Chrome、Microsoft Edge、Firefox。
-- バックエンド: Hono / Zod の業務アプリ 1 式。REST API、OpenAPI、Remote MCP。Cloudflare は Workers / D1 / R2、Docker は Bun / SQLite / ローカルファイルまたは S3。
+- バックエンド: Hono / Zod の業務アプリ 1 式。REST API と Remote MCP。Cloudflare は Workers / D1 / R2、Docker は Bun / SQLite / ローカルファイルまたは S3。
- 公式サイト: `apps/site` の Astro 静的サイト。Cloudflare Pages に出せます。
## クイックスタート
@@ -187,7 +187,7 @@ bun run dev
```text
apps/web Vite + React フロントエンド、PWA、オフライン下書き、同期キュー
apps/extension Chrome/Edge/Firefox Manifest V3 Web Clipper
-apps/api Cloudflare Worker + Hono API、OpenAPI、MCP
+apps/api Cloudflare Worker + Hono API、MCP
apps/mobile Expo + React Native の Android アプリ
apps/ios ネイティブ SwiftUI の iOS アプリ(TipTap EditorBundle、GRDB)
apps/desktop Electron のデスクトップシェル、preload、ネイティブ梱包
@@ -198,7 +198,7 @@ crates/desktop-sidecar
ローカル SQLite、オフラインデータ、バックアップ、リソースの Rust sidecar
scripts Wrangler ラッパ、パスワード hash、CLI、MCP stdio、Evernote ENEX 取り込み
migrations D1/SQLite 共用の、追加のみの migration
-docs OpenAPI、アーキテクチャ、移行、導入の文書
+docs アーキテクチャ、移行、導入の文書
.github/workflows Web、モバイル、iOS、デスクトップ梱包、導入、Release の CI
wrangler.toml Cloudflare Workers、Assets、D1、R2 の設定
```
@@ -215,16 +215,6 @@ content_text 検索、要約、索引
**プロフィール** -> **インポートとエクスポート** から EdgeEver ZIP を書き出し、または取り込めます。`notes/` は Markdown として読め、持ち出せます。構造化データは EdgeEver インスタンス間の完全復元に使います。取り込みは関係ない対象データを残し、同じ EdgeEver ID の記録は上書きします。
-## API
-
-OpenAPI schema:
-
-```text
-https://your-domain/api/openapi.json
-```
-
-リポジトリ内: [docs/openapi.json](docs/openapi.json)。
-
## MCP
**プロフィール** -> **MCP 設定** で API トークンを作り、AI Agent に渡してください。Agent はアカウントの権限の範囲で知識ベースを扱えます。テキストノートと図のノート(マインドマップ、フローチャート、アーキテクチャ図)の CRUD、ノートテンプレートと AI 指示の管理、Notion データベースや Feishu Bitable との接続に対応します。
diff --git a/README.md b/README.md
index 5489efe5..65d85121 100644
--- a/README.md
+++ b/README.md
@@ -178,7 +178,7 @@ EdgeEver supports plugins and code-free themes on Web and desktop, installable f
- iOS app: Native SwiftUI in `apps/ios` (iOS 17+), with a packaged TipTap EditorBundle, GRDB local mirror/outbox, and Android-aligned shell chrome.
- Native desktop app: Electron + Rust sidecar combines a consistent cross-platform experience with high-performance local data services; SQLite enables offline editing, incremental sync when back online, and local backups.
- Web clipper: Manifest V3, Mozilla Readability, and Turndown for Chrome, Microsoft Edge, and Firefox.
-- Backend: one Hono/Zod business application with REST API, OpenAPI, and Remote MCP; Cloudflare uses Workers/D1/R2, while Docker uses Bun/SQLite/local files or S3.
+- Backend: one Hono/Zod business application with REST API and Remote MCP; Cloudflare uses Workers/D1/R2, while Docker uses Bun/SQLite/local files or S3.
- Official site: Astro static site in `apps/site`, deployable to Cloudflare Pages.
## Quick Start
@@ -195,7 +195,7 @@ Local development signs in automatically; fresh databases use `owner` / `edgeeve
```text
apps/web Vite + React frontend, PWA, offline drafts, and sync queue
apps/extension Chrome/Edge/Firefox Manifest V3 web clipper
-apps/api Cloudflare Worker + Hono API, OpenAPI, MCP endpoint
+apps/api Cloudflare Worker + Hono API, MCP endpoint
apps/mobile Expo + React Native Android app
apps/ios Native SwiftUI iOS app (TipTap EditorBundle, GRDB)
apps/desktop Electron desktop shell, preload bridge, and native packaging
@@ -206,7 +206,7 @@ crates/desktop-sidecar
Rust sidecar for local SQLite, offline data, backups, and resources
scripts Wrangler wrapper, password hash, CLI, MCP stdio bridge, Evernote ENEX import
migrations Shared append-only D1/SQLite database migrations
-docs OpenAPI schema, architecture, migration, and deployment docs
+docs Architecture, migration, and deployment docs
.github/workflows CI for web, mobile, iOS, desktop packaging, deployment, and releases
wrangler.toml Cloudflare Workers, Assets, D1, R2 configuration
```
@@ -223,16 +223,6 @@ content_text Search, summary, and indexing text
Open **Profile** -> **Import and export** to export or import an EdgeEver ZIP. Its `notes/` directory is directly readable and portable as Markdown, while its structured data supports complete recovery between EdgeEver instances. Import preserves unrelated target data and overwrites records with matching EdgeEver IDs.
-## API
-
-OpenAPI schema:
-
-```text
-https://your-domain/api/openapi.json
-```
-
-Repository file: [docs/openapi.json](docs/openapi.json).
-
## MCP
Create an API token in **Profile** -> **MCP settings** and give it to your AI Agent. The Agent can then securely manage your knowledge base within your account permissions. It supports both text notes and diagram notes (including mind maps, flowcharts, and architecture diagrams) with full CRUD capabilities. The Agent can also manage note templates and AI instructions, and connect with tools such as Notion databases and Feishu Bitable.
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 7824447e..4e9ec4eb 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -176,7 +176,7 @@ EdgeEver 的 Web 与桌面端支持插件和无代码主题,可从插件市场
- iOS App:`apps/ios` 中的原生 SwiftUI(iOS 17+),内置 TipTap EditorBundle、GRDB 本地镜像/outbox,界面与 Android 壳层对齐。
- 原生桌面端:Electron + Rust sidecar,兼顾跨平台一致体验与高性能本地数据服务;基于 SQLite 支持离线编辑、联网后增量同步与本地备份。
- 网页裁剪:Manifest V3、Mozilla Readability、Turndown,支持 Chrome、Microsoft Edge 与 Firefox。
-- 后端:一套基于 Hono/Zod 的业务应用,提供 REST API、OpenAPI 与 Remote MCP;Cloudflare 使用 Workers/D1/R2,Docker 使用 Bun/SQLite/本地文件或 S3。
+- 后端:一套基于 Hono/Zod 的业务应用,提供 REST API 与 Remote MCP;Cloudflare 使用 Workers/D1/R2,Docker 使用 Bun/SQLite/本地文件或 S3。
- 官网:Astro 静态站点,位于 `apps/site`,可独立构建并部署到 Cloudflare Pages。
## 快速开始
@@ -193,7 +193,7 @@ bun run dev
```text
apps/web Vite + React 前端、PWA、离线草稿与同步队列
apps/extension Chrome/Edge/Firefox Manifest V3 网页裁剪插件
-apps/api Cloudflare Worker + Hono API、OpenAPI、MCP endpoint
+apps/api Cloudflare Worker + Hono API、MCP endpoint
apps/mobile Expo + React Native Android App
apps/ios 原生 SwiftUI iOS App(TipTap EditorBundle、GRDB)
apps/desktop Electron 桌面端壳层、preload bridge 与原生打包配置
@@ -204,7 +204,7 @@ crates/desktop-sidecar
Rust sidecar,负责本地 SQLite、离线数据、备份与资源服务
scripts Wrangler 封装、密码 hash、CLI、MCP stdio bridge、Evernote ENEX 导入
migrations D1/SQLite 共用、只增不改的数据库 migration
-docs OpenAPI schema、架构、迁移与部署文档
+docs 架构、迁移与部署文档
.github/workflows Web、移动端、iOS、桌面端打包、部署与 Release 的 CI
wrangler.toml Cloudflare Workers、Assets、D1、R2 配置
```
@@ -221,16 +221,6 @@ content_text 搜索、摘要和索引使用
请打开 **我的** -> **导入与导出**,导出或导入 EdgeEver ZIP。压缩包中的 `notes/` 目录可直接作为 Markdown 阅读和迁移,结构化数据则用于在 EdgeEver 实例之间完整恢复;导入时目标实例中的无关数据会保留,相同 EdgeEver ID 的内容会被覆盖。
-## API 文档
-
-OpenAPI schema:
-
-```text
-https://你的域名/api/openapi.json
-```
-
-仓库内文件:[docs/openapi.json](docs/openapi.json)。
-
## MCP
在 **个人中心** -> **MCP 设置** 中创建 API Token 并交给 AI Agent,即可让 Agent 在账号授权范围内安全地管理你的知识库。系统同时支持文本笔记与图表笔记(涵盖思维导图、流程图和架构图三种),支持对这些笔记进行完整的增删改查;同时还可管理笔记模板与 AI 指令,并与 Notion Database、飞书多维表格等工具联动。
diff --git a/README.zh-TW.md b/README.zh-TW.md
index 9efec1f7..1537e390 100644
--- a/README.zh-TW.md
+++ b/README.zh-TW.md
@@ -176,7 +176,7 @@ EdgeEver 的 Web 與桌面版支援外掛和無程式碼主題,可從外掛市
- iOS App:`apps/ios` 中的原生 SwiftUI(iOS 17+),內建 TipTap EditorBundle、GRDB 本機鏡像/outbox,介面與 Android 殼層對齊。
- 原生桌面版:Electron + Rust sidecar,兼顧跨平台一致體驗與高效能本機資料服務;基於 SQLite 支援離線編輯、連網後增量同步與本機備份。
- 網頁擷取:Manifest V3、Mozilla Readability、Turndown,支援 Chrome、Microsoft Edge 與 Firefox。
-- 後端:一套基於 Hono/Zod 的業務應用,提供 REST API、OpenAPI 與 Remote MCP;Cloudflare 使用 Workers/D1/R2,Docker 使用 Bun/SQLite/本機檔案或 S3。
+- 後端:一套基於 Hono/Zod 的業務應用,提供 REST API 與 Remote MCP;Cloudflare 使用 Workers/D1/R2,Docker 使用 Bun/SQLite/本機檔案或 S3。
- 官網:Astro 靜態網站,位於 `apps/site`,可獨立建置並部署到 Cloudflare Pages。
## 快速開始
@@ -193,7 +193,7 @@ bun run dev
```text
apps/web Vite + React 前端、PWA、離線草稿與同步佇列
apps/extension Chrome/Edge/Firefox Manifest V3 網頁擷取擴充功能
-apps/api Cloudflare Worker + Hono API、OpenAPI、MCP endpoint
+apps/api Cloudflare Worker + Hono API、MCP endpoint
apps/mobile Expo + React Native Android App
apps/ios 原生 SwiftUI iOS App(TipTap EditorBundle、GRDB)
apps/desktop Electron 桌面版殼層、preload bridge 與原生打包設定
@@ -204,7 +204,7 @@ crates/desktop-sidecar
Rust sidecar,負責本機 SQLite、離線資料、備份與資源服務
scripts Wrangler 封裝、密碼雜湊、CLI、MCP stdio bridge、Evernote ENEX 匯入
migrations D1/SQLite 共用、只增不改的資料庫 migration
-docs OpenAPI schema、架構、遷移與部署文件
+docs 架構、遷移與部署文件
.github/workflows Web、行動端、iOS、桌面版打包、部署與 Release 的 CI
wrangler.toml Cloudflare Workers、Assets、D1、R2 設定
```
@@ -221,16 +221,6 @@ content_text 搜尋、摘要和索引使用
請開啟 **我的** -> **匯入與匯出**,匯出或匯入 EdgeEver ZIP。壓縮檔中的 `notes/` 目錄可直接作為 Markdown 閱讀和遷移,結構化資料則用於在 EdgeEver 實例之間完整還原;匯入時目標實例中的無關資料會保留,相同 EdgeEver ID 的內容會被覆蓋。
-## API 文件
-
-OpenAPI schema:
-
-```text
-https://你的網域/api/openapi.json
-```
-
-儲存庫內檔案:[docs/openapi.json](docs/openapi.json)。
-
## MCP
在 **個人中心** -> **MCP 設定** 中建立 API Token 並交給 AI Agent,即可讓 Agent 在帳號授權範圍內安全地管理你的知識庫。系統同時支援文字筆記與圖表筆記(涵蓋心智圖、流程圖和架構圖三種),支援對這些筆記進行完整的增刪改查;同時還可管理筆記範本與 AI 指令,並與 Notion Database、飛書多維表格等工具聯動。
diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts
index 118d2f8c..04640b84 100644
--- a/apps/api/src/index.ts
+++ b/apps/api/src/index.ts
@@ -7,7 +7,7 @@ import {
import { Hono } from "hono";
import { cors } from "hono/cors";
import { resolveContainerImageSource } from "./container-image-source";
-import openApiSpec from "../../../docs/openapi.json";
+import apiProbe from "../../../docs/openapi.json";
import releaseSummary from "../../../release-summary.json";
import {
authenticateRequest,
@@ -241,7 +241,8 @@ app.get("/api/health", async (c) => {
});
});
-app.get("/api/openapi.json", (c) => c.json(openApiSpec));
+// Reachability probe only. Not an API catalog. Agents should use MCP.
+app.get("/api/openapi.json", (c) => c.json(apiProbe));
registerPublicShareRoutes(app);
diff --git a/apps/site/src/content/blog/why-build-edgeever.md b/apps/site/src/content/blog/why-build-edgeever.md
index e6c1c40b..eab3d69b 100644
--- a/apps/site/src/content/blog/why-build-edgeever.md
+++ b/apps/site/src/content/blog/why-build-edgeever.md
@@ -138,7 +138,7 @@ EdgeEver 不想成为一个包办一切的超级应用。
- 保留经典三栏体验
- 支持富文本、图片、嵌套笔记本和历史版本
- 可以部署在 Cloudflare 上
-- 数据模型清晰,支持 REST API、OpenAPI 和 MCP
+- 数据模型清晰,支持 REST API 和 MCP
- 对个人用户尽量低成本
- 对 AI Agent 足够友好
diff --git a/apps/site/src/content/blog_en/why-build-edgeever.md b/apps/site/src/content/blog_en/why-build-edgeever.md
index 49a288f6..be155aa2 100644
--- a/apps/site/src/content/blog_en/why-build-edgeever.md
+++ b/apps/site/src/content/blog_en/why-build-edgeever.md
@@ -138,7 +138,7 @@ It is meant to be an open, lightweight, long-lived personal notes foundation:
- Classic three-pane workflow
- Rich text, images, nested notebooks, and revision history
- Cloudflare-native deployment
-- Clear data model with REST API, OpenAPI, and MCP
+- Clear data model with REST API and MCP
- Low cost for individual users
- Friendly to AI agents
diff --git a/apps/site/src/i18n-ja.ts b/apps/site/src/i18n-ja.ts
index ac4c7259..1b7a294a 100644
--- a/apps/site/src/i18n-ja.ts
+++ b/apps/site/src/i18n-ja.ts
@@ -198,7 +198,7 @@ export const jaSiteCopy = {
},
{
title: "ネイティブな AI Agent とエディタ内の複数モデル",
- summary: "REST API、OpenAPI、Remote MCP、複数モデル接続で、AI をノートの相棒にします。",
+ summary: "REST API、Remote MCP、複数モデル接続で、AI をノートの相棒にします。",
points: [
"Remote MCP: Antigravity、Claude Code、Codex に読み取り、要約、整理を任せられます。",
"自分のモデル: OpenAI、Anthropic Claude、Google Gemini、DeepSeek、互換エンドポイント。",
diff --git a/apps/site/src/i18n.ts b/apps/site/src/i18n.ts
index ecbb9f64..2e8ca252 100644
--- a/apps/site/src/i18n.ts
+++ b/apps/site/src/i18n.ts
@@ -276,7 +276,7 @@ export const siteCopy = {
},
{
title: "原生 AI Agent 联动与编辑器内置多模型",
- summary: "内置 REST API、OpenAPI schema、Remote MCP endpoint 与多模型集成,让 AI 真正成为个人知识库的智能副驾驶。",
+ summary: "内置 REST API、Remote MCP endpoint 与多模型集成,让 AI 真正成为个人知识库的智能副驾驶。",
points: [
"内置 Remote MCP endpoint:直接授权 Antigravity、Claude Code、Codex 等 AI Agent 读取、生成与整理笔记。",
"支持接入自己的 AI 模型:无缝配置 OpenAI、Anthropic Claude、Google Gemini、DeepSeek 及自定义兼容接口。",
@@ -547,7 +547,7 @@ export const siteCopy = {
},
{
title: "Native AI Agent Synergy & In-Editor Multi-Model Assistants",
- summary: "Built-in REST API, OpenAPI schema, Remote MCP endpoint, and multi-model integration turn AI into a true copilot for your notes.",
+ summary: "Built-in REST API, Remote MCP endpoint, and multi-model integration turn AI into a true copilot for your notes.",
points: [
"Remote MCP Endpoint: Authorize Antigravity, Claude Code, and Codex to read, summarize, and organize your knowledge base.",
"Connect Your Own AI Models: Support for OpenAI, Anthropic Claude, Google Gemini, DeepSeek, and custom compatible endpoints.",
diff --git a/apps/site/src/pages/en/index.astro b/apps/site/src/pages/en/index.astro
index 0a291536..21242af1 100644
--- a/apps/site/src/pages/en/index.astro
+++ b/apps/site/src/pages/en/index.astro
@@ -32,7 +32,7 @@ const homeJsonLd = [
operatingSystem: "macOS, Windows, Linux, iOS, Android, Web, Chrome, Edge, Firefox",
isAccessibleForFree: true,
description:
- "EdgeEver is an open-source, AI-native, self-hosted Evernote alternative with a classic three-pane workflow, apps across macOS, Windows, Linux, iOS, Android and browsers, plus a REST API, OpenAPI schema, and MCP endpoint.",
+ "EdgeEver is an open-source, AI-native, self-hosted Evernote alternative with a classic three-pane workflow, apps across macOS, Windows, Linux, iOS, Android and browsers, plus a REST API and MCP endpoint.",
keywords: ["Evernote alternative", "open-source notes app", "self-hosted notes app", "AI notes app"],
},
];
diff --git a/apps/site/src/pages/index.astro b/apps/site/src/pages/index.astro
index 294b6914..43231a44 100644
--- a/apps/site/src/pages/index.astro
+++ b/apps/site/src/pages/index.astro
@@ -29,7 +29,7 @@ const homeJsonLd = [
operatingSystem: "macOS, Windows, Linux, iOS, Android, Web, Chrome, Edge, Firefox",
isAccessibleForFree: true,
description:
- "EdgeEver 是开源、原生支持 AI 的自托管笔记工作区,保留经典印象笔记三栏体验,覆盖 macOS、Windows、Linux、iOS、Android 与浏览器插件,并提供 REST API、OpenAPI schema 和 MCP endpoint。",
+ "EdgeEver 是开源、原生支持 AI 的自托管笔记工作区,保留经典印象笔记三栏体验,覆盖 macOS、Windows、Linux、iOS、Android 与浏览器插件,并提供 REST API 和 MCP endpoint。",
},
];
---
diff --git a/apps/site/src/pages/ja/index.astro b/apps/site/src/pages/ja/index.astro
index b94a88a5..92acc0ef 100644
--- a/apps/site/src/pages/ja/index.astro
+++ b/apps/site/src/pages/ja/index.astro
@@ -32,7 +32,7 @@ const homeJsonLd = [
operatingSystem: "macOS, Windows, Linux, iOS, Android, Web, Chrome, Edge, Firefox",
isAccessibleForFree: true,
description:
- "EdgeEver はオープンソース、AI ネイティブなセルフホスト型 Evernote 代替です。三ペインのノート作業領域、全プラットフォームのクライアント、REST API、OpenAPI、MCP を備えています。",
+ "EdgeEver はオープンソース、AI ネイティブなセルフホスト型 Evernote 代替です。三ペインのノート作業領域、全プラットフォームのクライアント、REST API と MCP を備えています。",
keywords: ["Evernote 代替", "オープンソース ノート", "セルフホスト ノート", "AI ノート"],
},
];
diff --git a/docs/agent-deploy-cloudflare.md b/docs/agent-deploy-cloudflare.md
index 2dce1c4e..9036739f 100644
--- a/docs/agent-deploy-cloudflare.md
+++ b/docs/agent-deploy-cloudflare.md
@@ -39,7 +39,7 @@ This document defines the standard operating specifications and conventions for
6. **Start Initial Build & Verify Service**
- Trigger the initial build. Once deployed, run the following automated verifications:
- Check `https://<your-worker-domain>/api/health` returns HTTP `200` with JSON `{"ok": true}`.
- - Check `https://<your-worker-domain>/api/openapi.json` loads the OpenAPI schema properly.
+ - Check `https://<your-worker-domain>/api/openapi.json` is reachable and returns JSON `{"ok": true}`.
- Verify login API using username `admin` and `EDGE_EVER_AUTH_PASSWORD`.
7. **Verify Upstream Update Channel**
diff --git a/docs/agent-deploy-cloudflare.zh-CN.md b/docs/agent-deploy-cloudflare.zh-CN.md
index bfc5232a..a126daae 100644
--- a/docs/agent-deploy-cloudflare.zh-CN.md
+++ b/docs/agent-deploy-cloudflare.zh-CN.md
@@ -39,7 +39,7 @@
6. **启动首次构建与服务验证**
- 触发启动首次构建,待构建部署完成后,进行如下自动化验证:
- 检查 `https://<你的 Worker 域名>/api/health` 返回 `200` 状态码且 JSON 内容为 `{"ok": true}`。
- - 检查 `https://<你的 Worker 域名>/api/openapi.json` 能够正常加载 OpenAPI 规范。
+ - 检查 `https://<你的 Worker 域名>/api/openapi.json` 可以访问,且 JSON 含 `"ok": true`。
- 使用用户名 `admin` 和 `EDGE_EVER_AUTH_PASSWORD` 验证登录 API。
7. **验证上游更新通道**
diff --git a/docs/deploy-docker.md b/docs/deploy-docker.md
index a3a09674..3e9b950d 100644
--- a/docs/deploy-docker.md
+++ b/docs/deploy-docker.md
@@ -1,7 +1,7 @@
# Deploy EdgeEver with Docker
EdgeEver uses the same web application, Hono routes, services, authentication,
-OpenAPI document, MCP implementation, and append-only migrations on Cloudflare
+MCP implementation, and append-only migrations on Cloudflare
and Docker. Only the thin runtime and infrastructure adapters differ: Docker
uses Bun with SQLite and local files (or S3-compatible object storage), while
Cloudflare uses Workers with D1 and R2.
diff --git a/docs/deploy-docker.zh-CN.md b/docs/deploy-docker.zh-CN.md
index e024082b..8d1a4e5e 100644
--- a/docs/deploy-docker.zh-CN.md
+++ b/docs/deploy-docker.zh-CN.md
@@ -1,7 +1,7 @@
# 使用 Docker 部署 EdgeEver
EdgeEver 在 Cloudflare 与 Docker 中共用同一套 Web 应用、Hono 路由、业务服务、
-鉴权、OpenAPI、MCP 实现和只增不改的 migration。两种部署仅有薄运行入口和基础
+鉴权、MCP 实现和只增不改的 migration。两种部署仅有薄运行入口和基础
设施适配器不同:Docker 使用 Bun + SQLite + 本地文件(或 S3 兼容对象存储),
Cloudflare 使用 Workers + D1 + R2。
diff --git a/docs/manual-deploy.md b/docs/manual-deploy.md
index b88f6c37..4b613757 100644
--- a/docs/manual-deploy.md
+++ b/docs/manual-deploy.md
@@ -23,7 +23,7 @@ For local CLI deployment, set `EDGE_EVER_DEPLOYMENT_URL=https://<your-worker-dom
After deployment, confirm:
- `/api/health` returns `200` with `"ok": true`
-- `/api/openapi.json` is reachable
+- `/api/openapi.json` is reachable (probe only, not an API catalog)
- `admin` can log in with the password supplied through `EDGE_EVER_PASSWORD`
## Create resources manually
diff --git a/docs/manual-deploy.zh-CN.md b/docs/manual-deploy.zh-CN.md
index d0d9f851..590c95e6 100644
--- a/docs/manual-deploy.zh-CN.md
+++ b/docs/manual-deploy.zh-CN.md
@@ -23,7 +23,7 @@
部署完成后,确认:
- `/api/health` 返回 `200` 和 `"ok": true`
-- `/api/openapi.json` 可以访问
+- `/api/openapi.json` 可以访问(仅探活,不是 API 目录)
- `admin` 可以使用通过 `EDGE_EVER_PASSWORD` 提供的密码登录
## 手动创建资源
diff --git a/docs/openapi.json b/docs/openapi.json
index 57265703..c8528aa3 100644
--- a/docs/openapi.json
+++ b/docs/openapi.json
@@ -1,3257 +1,4 @@
{
- "openapi": "3.1.0",
- "info": {
- "title": "EdgeEver API",
- "version": "0.1.0",
- "description": "REST API for EdgeEver notebooks, memos, resources, API tokens, and Agent integrations."
- },
- "servers": [
- {
- "url": "/"
- }
- ],
- "security": [
- {
- "bearerAuth": []
- },
- {
- "cookieAuth": []
- }
- ],
- "paths": {
- "/api/health": {
- "get": {
- "summary": "Health check",
- "security": [],
- "responses": {
- "200": {
- "description": "Runtime health",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "ok": {
- "type": "boolean"
- },
- "name": {
- "type": "string"
- },
- "runtime": {
- "type": "string"
- },
- "containerImageSource": {
- "type": "string",
- "enum": ["official-ghcr", "official-cn-mirror", "custom", "unknown"],
- "description": "Current container image repository classification for Docker deployments. Custom repository addresses are not exposed."
- },
- "authMode": {
- "type": "string",
- "enum": ["required", "disabled"]
- },
- "deployment": {
- "type": "object",
- "description": "Deployment trigger and execution method reported by the running instance.",
- "properties": {
- "trigger": {
- "type": "string",
- "enum": ["github_release", "main_push", "manual", "unknown"]
- },
- "method": {
- "type": "string",
- "enum": ["github_actions", "cloudflare_workers_builds", "local_cli", "unknown"]
- }
- },
- "required": ["trigger", "method"]
- }
- },
- "required": ["ok", "name", "runtime", "authMode", "deployment"]
- }
- }
- }
- },
- "503": {
- "$ref": "#/components/responses/Error"
- }
- }
- }
- },
- "/api/openapi.json": {
- "get": {
- "summary": "OpenAPI schema",
- "security": [],
- "responses": {
- "200": {
- "description": "OpenAPI 3.1 schema"
- }
- }
- }
- },
- "/api/v1/ai/settings": {
- "get": {
- "summary": "List AI providers, their models, and the workspace default model",
- "responses": {
- "200": {
- "description": "AI settings with all API keys omitted",
- "content": {
- "application/json": {
- "schema": { "$ref": "#/components/schemas/AiSettings" }
- }
- }
- },
- "401": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/ai/providers": {
- "post": {
- "summary": "Add an AI provider service",
- "requestBody": {
- "required": true,
- "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AiProviderCreateInput" } } }
- },
- "responses": {
- "201": { "description": "Provider created" },
- "400": { "$ref": "#/components/responses/Error" },
- "401": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/ai/providers/{providerConfigId}": {
- "parameters": [{ "name": "providerConfigId", "in": "path", "required": true, "schema": { "type": "string" } }],
- "put": {
- "summary": "Update or enable/disable an AI provider service",
- "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AiProviderUpdateInput" } } } },
- "responses": {
- "200": { "description": "Provider updated" },
- "400": { "$ref": "#/components/responses/Error" },
- "401": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" },
- "404": { "$ref": "#/components/responses/Error" }
- }
- },
- "delete": {
- "summary": "Delete an AI provider and all of its models",
- "responses": {
- "200": { "description": "Provider deleted" },
- "401": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" },
- "404": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/ai/providers/{providerConfigId}/test": {
- "post": {
- "summary": "Test a saved AI provider with a model ID",
- "parameters": [{ "name": "providerConfigId", "in": "path", "required": true, "schema": { "type": "string" } }],
- "requestBody": {
- "required": true,
- "content": { "application/json": { "schema": { "type": "object", "properties": { "modelId": { "type": "string", "minLength": 1, "maxLength": 200 } }, "required": ["modelId"] } } }
- },
- "responses": {
- "200": { "description": "The model endpoint responded successfully" },
- "400": { "$ref": "#/components/responses/Error" },
- "401": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/ai/providers/{providerConfigId}/discover-models": {
- "post": {
- "summary": "Discover models exposed by a saved provider service",
- "parameters": [{ "name": "providerConfigId", "in": "path", "required": true, "schema": { "type": "string" } }],
- "responses": {
- "200": { "description": "Discovered models" },
- "400": { "$ref": "#/components/responses/Error" },
- "401": { "$ref": "#/components/responses/Error" },
- "404": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/ai/providers/{providerConfigId}/models": {
- "post": {
- "summary": "Add a model to an AI provider service",
- "parameters": [{ "name": "providerConfigId", "in": "path", "required": true, "schema": { "type": "string" } }],
- "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AiModelCreateInput" } } } },
- "responses": {
- "201": { "description": "Model added" },
- "400": { "$ref": "#/components/responses/Error" },
- "401": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" },
- "404": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/ai/providers/{providerConfigId}/models/{modelConfigId}": {
- "delete": {
- "summary": "Remove a model from an AI provider service",
- "parameters": [
- { "name": "providerConfigId", "in": "path", "required": true, "schema": { "type": "string" } },
- { "name": "modelConfigId", "in": "path", "required": true, "schema": { "type": "string" } }
- ],
- "responses": {
- "200": { "description": "Model removed" },
- "401": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" },
- "404": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/ai/default-model": {
- "put": {
- "summary": "Choose or clear the workspace default AI model",
- "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "modelConfigId": { "type": ["string", "null"] } }, "required": ["modelConfigId"] } } } },
- "responses": {
- "200": { "description": "Default model updated" },
- "400": { "$ref": "#/components/responses/Error" },
- "401": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/ai/direct-target": {
- "get": {
- "summary": "Return the default model endpoint without credentials",
- "description": "Used by the web app to probe whether the model host allows CORS before requesting a decrypted API key.",
- "responses": {
- "200": {
- "description": "Provider, base URL, and model ID for the workspace default model",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "provider": { "type": "string", "enum": ["openai-compatible", "anthropic", "google"] },
- "baseUrl": { "type": "string" },
- "modelId": { "type": "string" }
- },
- "required": ["provider", "baseUrl", "modelId"]
- }
- }
- }
- },
- "401": { "$ref": "#/components/responses/Error" },
- "409": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/ai/generate/prepare": {
- "post": {
- "summary": "Resolve a note AI action into a provider request for native, desktop, or CORS-capable web clients",
- "description": "Returns the decrypted workspace model credentials and the resolved prompt. Native and desktop clients always use this, then call the model API directly. The web app uses it only after a CORS probe succeeds; otherwise it keeps using /api/v1/ai/generate so the API key stays off the page.",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "action": { "type": "string", "enum": ["summarize", "extract-key-points", "extract-todos", "rewrite-proofread", "translate", "improve-writing", "fix-spelling-grammar", "make-shorter", "make-longer", "simplify-language", "change-tone", "continue-writing", "custom"] },
- "promptId": { "type": "string", "minLength": 1, "maxLength": 200 },
- "locale": { "type": "string", "maxLength": 35 },
- "title": { "type": "string", "maxLength": 160 },
- "contentMarkdown": { "type": "string", "maxLength": 300000 },
- "stream": { "type": "boolean", "default": false },
- "targetLanguage": { "type": "string", "enum": ["en", "zh-CN", "zh-TW", "ja", "ko", "es", "fr", "de", "pt"] },
- "tone": { "type": "string", "enum": ["professional", "friendly", "casual", "direct"] },
- "instruction": { "type": "string", "minLength": 1, "maxLength": 2000 }
- },
- "required": ["action", "title", "contentMarkdown"]
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Prepared provider request, including the decrypted API key",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "provider": { "type": "string", "enum": ["openai-compatible", "anthropic", "google"] },
- "baseUrl": { "type": "string" },
- "apiKey": { "type": "string" },
- "modelId": { "type": "string" },
- "system": { "type": "string" },
- "prompt": { "type": "string" },
- "maxOutputTokens": { "type": "integer" },
- "resultBoundary": {
- "type": "object",
- "properties": {
- "start": { "type": "string" },
- "end": { "type": "string" }
- },
- "required": ["start", "end"]
- }
- },
- "required": ["provider", "baseUrl", "apiKey", "modelId", "system", "prompt", "maxOutputTokens", "resultBoundary"]
- }
- }
- }
- },
- "400": { "$ref": "#/components/responses/Error" },
- "401": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" },
- "404": { "$ref": "#/components/responses/Error" },
- "409": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/ai/generate": {
- "post": {
- "summary": "Run a note AI action using the current workspace model",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "action": { "type": "string", "enum": ["summarize", "extract-key-points", "extract-todos", "rewrite-proofread", "translate", "improve-writing", "fix-spelling-grammar", "make-shorter", "make-longer", "simplify-language", "change-tone", "continue-writing", "custom"] },
- "promptId": { "type": "string", "minLength": 1, "maxLength": 200, "description": "Saved prompt to resolve inside the authenticated workspace" },
- "locale": { "type": "string", "maxLength": 35 },
- "title": { "type": "string", "maxLength": 160 },
- "contentMarkdown": { "type": "string", "maxLength": 300000 },
- "stream": { "type": "boolean", "default": false, "description": "Stream normalized text deltas when enabled; disabled by default for lower Worker CPU usage" },
- "targetLanguage": { "type": "string", "enum": ["en", "zh-CN", "zh-TW", "ja", "ko", "es", "fr", "de", "pt"], "description": "Required when the action or selected prompt requests a target language" },
- "tone": { "type": "string", "enum": ["professional", "friendly", "casual", "direct"] },
- "instruction": { "type": "string", "minLength": 1, "maxLength": 2000, "description": "Freeform instruction; ignored when promptId is supplied" }
- },
- "required": ["action", "title", "contentMarkdown"]
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Server-sent events containing start, text-delta, finish, or error events",
- "content": { "text/event-stream": { "schema": { "type": "string" } } }
- },
- "400": { "$ref": "#/components/responses/Error" },
- "401": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" },
- "404": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/ai/prompts": {
- "get": {
- "summary": "List the current workspace prompt library",
- "parameters": [{ "name": "locale", "in": "query", "schema": { "type": "string" } }],
- "responses": {
- "200": {
- "description": "Localized prompt templates",
- "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/AiPromptTemplate" } } }, "required": ["prompts"] } } }
- },
- "401": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" }
- }
- },
- "post": {
- "summary": "Create a reusable prompt",
- "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AiPromptCreateInput" } } } },
- "responses": {
- "201": { "description": "Prompt created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AiPromptResponse" } } } },
- "400": { "$ref": "#/components/responses/Error" },
- "401": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/ai/prompts/{promptId}": {
- "parameters": [{ "name": "promptId", "in": "path", "required": true, "schema": { "type": "string" } }],
- "patch": {
- "summary": "Update prompt text or execution behavior",
- "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AiPromptUpdateInput" } } } },
- "responses": {
- "200": { "description": "Prompt updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AiPromptResponse" } } } },
- "400": { "$ref": "#/components/responses/Error" },
- "401": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" },
- "404": { "$ref": "#/components/responses/Error" }
- }
- },
- "delete": {
- "summary": "Delete a prompt",
- "responses": {
- "200": { "$ref": "#/components/responses/Ok" },
- "401": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" },
- "404": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/ai/prompts/restore-defaults": {
- "post": {
- "summary": "Restore missing factory prompts without overwriting edits",
- "parameters": [{ "name": "locale", "in": "query", "schema": { "type": "string" } }],
- "responses": {
- "200": { "description": "Updated prompt list and restored count" },
- "401": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/restores/json/ai-prompts": {
- "post": {
- "summary": "Restore prompt templates from an EdgeEver ZIP backup",
- "requestBody": {
- "required": true,
- "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "maxItems": 100, "items": { "$ref": "#/components/schemas/AiPromptTemplate" } } }, "required": ["prompts"] } } }
- },
- "responses": {
- "200": { "$ref": "#/components/responses/Ok" },
- "400": { "$ref": "#/components/responses/Error" },
- "401": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/auth/session": {
- "get": {
- "summary": "Read interactive session",
- "security": [],
- "responses": {
- "200": {
- "description": "Current session",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/AuthSession"
- }
- }
- }
- },
- "503": {
- "$ref": "#/components/responses/Error"
- }
- }
- }
- },
- "/api/v1/auth/sessions": {
- "get": {
- "summary": "List the current user's active login sessions",
- "responses": {
- "200": {
- "description": "Active login sessions ordered by latest activity",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "sessions": {
- "type": "array",
- "items": { "$ref": "#/components/schemas/LoginDeviceSession" }
- }
- },
- "required": ["sessions"]
- }
- }
- }
- },
- "401": {
- "$ref": "#/components/responses/Error"
- }
- }
- },
- "delete": {
- "summary": "Revoke all login sessions except the current session",
- "responses": {
- "200": {
- "description": "Other sessions revoked",
- "content": {
- "application/json": {
- "schema": { "$ref": "#/components/schemas/Ok" }
- }
- }
- },
- "401": {
- "$ref": "#/components/responses/Error"
- }
- }
- },
- "patch": {
- "summary": "Update a login device label",
- "parameters": [
- {
- "name": "sessionId",
- "in": "path",
- "required": true,
- "schema": { "type": "string" }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": { "label": { "type": ["string", "null"], "maxLength": 80 } },
- "required": ["label"]
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Device label updated",
- "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Ok" } } }
- },
- "401": { "$ref": "#/components/responses/Error" },
- "404": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/auth/sessions/{sessionId}": {
- "delete": {
- "summary": "Revoke one of the current user's other login sessions",
- "parameters": [
- {
- "name": "sessionId",
- "in": "path",
- "required": true,
- "schema": { "type": "string" }
- }
- ],
- "responses": {
- "200": {
- "description": "Session revoked",
- "content": {
- "application/json": {
- "schema": { "$ref": "#/components/schemas/Ok" }
- }
- }
- },
- "400": {
- "$ref": "#/components/responses/Error"
- },
- "401": {
- "$ref": "#/components/responses/Error"
- },
- "404": {
- "$ref": "#/components/responses/Error"
- }
- }
- }
- },
- "/api/v1/auth/login": {
- "post": {
- "summary": "Create interactive session",
- "security": [],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/LoginInput"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Authenticated session",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/AuthSession"
- }
- }
- }
- },
- "401": {
- "$ref": "#/components/responses/Error"
- },
- "429": {
- "$ref": "#/components/responses/Error"
- },
- "503": {
- "$ref": "#/components/responses/Error"
- }
- }
- }
- },
- "/api/v1/auth/change-password": {
- "post": {
- "summary": "Change the current user's password",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ChangePasswordInput"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Password changed",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Ok"
- }
- }
- }
- },
- "400": {
- "$ref": "#/components/responses/Error"
- },
- "401": {
- "$ref": "#/components/responses/Error"
- }
- }
- }
- },
- "/api/v1/auth/logout": {
- "post": {
- "summary": "Revoke interactive session",
- "responses": {
- "200": {
- "description": "Logout result",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Ok"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/users": {
- "get": {
- "summary": "List instance users (owner only)",
- "responses": {
- "200": {
- "description": "Instance user list",
- "content": { "application/json": { "schema": {
- "type": "object",
- "properties": { "users": { "type": "array", "items": { "$ref": "#/components/schemas/InstanceUser" } } },
- "required": ["users"]
- } } }
- },
- "403": { "$ref": "#/components/responses/Error" }
- }
- },
- "post": {
- "summary": "Create an isolated user workspace (owner only)",
- "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserCreateInput" } } } },
- "responses": {
- "201": { "description": "Created user", "content": { "application/json": { "schema": {
- "type": "object", "properties": { "user": { "$ref": "#/components/schemas/InstanceUser" } }, "required": ["user"]
- } } } },
- "403": { "$ref": "#/components/responses/Error" },
- "409": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/users/{id}": {
- "patch": {
- "summary": "Update, disable, or reset a user (owner only)",
- "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
- "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserUpdateInput" } } } },
- "responses": {
- "200": { "description": "Updated user", "content": { "application/json": { "schema": {
- "type": "object", "properties": { "user": { "$ref": "#/components/schemas/InstanceUser" } }, "required": ["user"]
- } } } },
- "403": { "$ref": "#/components/responses/Error" },
- "404": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/instance/object-storage": {
- "get": {
- "summary": "Read instance object storage settings (owner only)",
- "responses": {
- "200": { "description": "Active and saved external object storage settings", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ObjectStorageSettingsResponse" } } } },
- "403": { "$ref": "#/components/responses/Error" }
- }
- },
- "put": {
- "summary": "Test and update instance object storage settings (owner only)",
- "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ObjectStorageSettingsUpdateInput" } } } },
- "responses": {
- "200": { "description": "Updated object storage settings", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ObjectStorageSettingsResponse" } } } },
- "400": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/instance/object-storage/test": {
- "post": {
- "summary": "Test S3-compatible object storage with an upload/read/delete probe (owner only)",
- "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ObjectStorageConnectionTestInput" } } } },
- "responses": {
- "200": { "$ref": "#/components/responses/Ok" },
- "400": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/notebooks": {
- "get": {
- "summary": "List notebooks",
- "responses": {
- "200": {
- "description": "Notebook list",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "notebooks": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Notebook"
- }
- }
- },
- "required": ["notebooks"]
- }
- }
- }
- }
- }
- },
- "post": {
- "summary": "Create notebook",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/NotebookCreateInput"
- }
- }
- }
- },
- "responses": {
- "201": {
- "$ref": "#/components/responses/NotebookResponse"
- }
- }
- }
- },
- "/api/v1/notebooks/{id}": {
- "parameters": [
- {
- "$ref": "#/components/parameters/NotebookId"
- }
- ],
- "patch": {
- "summary": "Update notebook",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/NotebookUpdateInput"
- }
- }
- }
- },
- "responses": {
- "200": {
- "$ref": "#/components/responses/NotebookResponse"
- },
- "409": {
- "$ref": "#/components/responses/Error"
- }
- }
- },
- "delete": {
- "summary": "Soft-delete empty notebook",
- "responses": {
- "200": {
- "$ref": "#/components/responses/Ok"
- },
- "409": {
- "$ref": "#/components/responses/Error"
- }
- }
- }
- },
- "/api/v1/scheduled-tasks": {
- "get": {
- "summary": "List scheduled plugin commands",
- "parameters": [{ "name": "executorDeviceId", "in": "query", "schema": { "type": "string" } }],
- "responses": {
- "200": {
- "description": "Scheduled task list",
- "content": { "application/json": { "schema": {
- "type": "object",
- "properties": { "tasks": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduledTask" } } },
- "required": ["tasks"]
- } } }
- },
- "403": { "$ref": "#/components/responses/Error" }
- }
- },
- "post": {
- "summary": "Create a device-bound scheduled plugin command",
- "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduledTaskCreateInput" } } } },
- "responses": {
- "201": { "description": "Created scheduled task", "content": { "application/json": { "schema": { "type": "object", "properties": { "task": { "$ref": "#/components/schemas/ScheduledTask" } }, "required": ["task"] } } } },
- "400": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/scheduled-task-runs": {
- "get": {
- "summary": "List system-wide scheduled task execution history",
- "parameters": [
- { "name": "offset", "in": "query", "schema": { "type": "integer", "minimum": 0, "default": 0 } },
- { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } }
- ],
- "responses": {
- "200": {
- "description": "Workspace scheduled task execution history",
- "content": { "application/json": { "schema": {
- "type": "object",
- "properties": {
- "runs": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduledTaskRunHistoryItem" } },
- "totalCount": { "type": "integer" },
- "nextOffset": { "type": ["integer", "null"] }
- },
- "required": ["runs", "totalCount", "nextOffset"]
- } } }
- },
- "403": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/scheduled-tasks/{id}": {
- "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
- "patch": {
- "summary": "Update a scheduled plugin command",
- "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduledTaskUpdateInput" } } } },
- "responses": { "200": { "description": "Updated scheduled task" }, "404": { "$ref": "#/components/responses/Error" } }
- },
- "delete": {
- "summary": "Delete a scheduled plugin command",
- "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/Error" } }
- }
- },
- "/api/v1/scheduled-tasks/plugin-upsert": {
- "post": {
- "summary": "Idempotently create or update a plugin-owned schedule",
- "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PluginScheduleUpsertInput" } } } },
- "responses": {
- "200": { "description": "Plugin-owned scheduled task", "content": { "application/json": { "schema": { "type": "object", "properties": { "task": { "$ref": "#/components/schemas/ScheduledTask" } }, "required": ["task"] } } } },
- "400": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/scheduled-tasks/plugin/{pluginId}": {
- "parameters": [{ "name": "pluginId", "in": "path", "required": true, "schema": { "type": "string" } }],
- "get": {
- "summary": "List schedules owned by one plugin",
- "responses": { "200": { "description": "Plugin schedule list" }, "403": { "$ref": "#/components/responses/Error" } }
- }
- },
- "/api/v1/scheduled-tasks/plugin/{pluginId}/{scheduleKey}": {
- "parameters": [
- { "name": "pluginId", "in": "path", "required": true, "schema": { "type": "string" } },
- { "name": "scheduleKey", "in": "path", "required": true, "schema": { "type": "string" } }
- ],
- "delete": {
- "summary": "Delete a schedule owned by one plugin",
- "responses": { "200": { "$ref": "#/components/responses/Ok" }, "404": { "$ref": "#/components/responses/Error" } }
- }
- },
- "/api/v1/scheduled-tasks/{id}/runs/claim": {
- "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
- "post": {
- "summary": "Atomically claim one scheduled occurrence",
- "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduledTaskClaimInput" } } } },
- "responses": { "201": { "description": "Claimed task run" }, "409": { "$ref": "#/components/responses/Error" } }
- }
- },
- "/api/v1/scheduled-tasks/{id}/runs": {
- "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
- "get": {
- "summary": "List execution history for a scheduled task",
- "parameters": [
- { "name": "offset", "in": "query", "schema": { "type": "integer", "minimum": 0, "default": 0 } },
- { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } }
- ],
- "responses": {
- "200": {
- "description": "Scheduled task execution history",
- "content": { "application/json": { "schema": {
- "type": "object",
- "properties": {
- "runs": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduledTaskRun" } },
- "totalCount": { "type": "integer" },
- "nextOffset": { "type": ["integer", "null"] }
- },
- "required": ["runs", "totalCount", "nextOffset"]
- } } }
- },
- "404": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/scheduled-tasks/{taskId}/runs/{runId}/finish": {
- "parameters": [
- { "name": "taskId", "in": "path", "required": true, "schema": { "type": "string" } },
- { "name": "runId", "in": "path", "required": true, "schema": { "type": "string" } }
- ],
- "post": {
- "summary": "Finish a scheduled task run",
- "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduledTaskFinishInput" } } } },
- "responses": { "200": { "description": "Finished task run" }, "409": { "$ref": "#/components/responses/Error" } }
- }
- },
- "/api/v1/workspace-extensions": {
- "get": {
- "summary": "List the workspace plugin and theme install catalog",
- "responses": {
- "200": {
- "description": "Workspace extension catalog, including tombstones",
- "content": { "application/json": { "schema": {
- "type": "object",
- "properties": { "extensions": { "type": "array", "items": { "$ref": "#/components/schemas/WorkspaceExtension" } } },
- "required": ["extensions"]
- } } }
- },
- "403": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/workspace-extensions/{extensionId}": {
- "parameters": [{ "name": "extensionId", "in": "path", "required": true, "schema": { "type": "string" } }],
- "put": {
- "summary": "Create or update one workspace extension catalog entry",
- "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkspaceExtensionUpsertInput" } } } },
- "responses": {
- "200": { "description": "Upserted workspace extension", "content": { "application/json": { "schema": { "type": "object", "properties": { "extension": { "$ref": "#/components/schemas/WorkspaceExtension" } }, "required": ["extension"] } } } },
- "400": { "$ref": "#/components/responses/Error" },
- "403": { "$ref": "#/components/responses/Error" }
- }
- },
- "delete": {
- "summary": "Tombstone a workspace extension catalog entry",
- "responses": {
- "200": { "description": "Tombstoned workspace extension", "content": { "application/json": { "schema": { "type": "object", "properties": { "extension": { "$ref": "#/components/schemas/WorkspaceExtension" } }, "required": ["extension"] } } } },
- "403": { "$ref": "#/components/responses/Error" },
- "404": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/tags": {
- "get": {
- "summary": "List tag summaries",
- "responses": {
- "200": {
- "description": "Tag summaries",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "tags": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/TagSummary"
- }
- }
- },
- "required": ["tags"]
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/tags/{tag}": {
- "parameters": [
- {
- "name": "tag",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string"
- }
- }
- ],
- "patch": {
- "summary": "Rename tag across active memos",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/TagRenameInput"
- }
- }
- }
- },
- "responses": {
- "200": {
- "$ref": "#/components/responses/UpdatedCount"
- }
- }
- },
- "delete": {
- "summary": "Remove tag across active memos",
- "responses": {
- "200": {
- "$ref": "#/components/responses/UpdatedCount"
- }
- }
- }
- },
- "/api/v1/api-tokens": {
- "get": {
- "summary": "List API tokens",
- "responses": {
- "200": {
- "description": "API token list",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "apiTokens": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ApiToken"
- }
- },
- "availableScopes": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- },
- "required": ["apiTokens", "availableScopes"]
- }
- }
- }
- }
- }
- },
- "post": {
- "summary": "Create API token",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiTokenCreateInput"
- }
- }
- }
- },
- "responses": {
- "201": {
- "description": "Created token; plaintext token is shown once",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CreatedApiToken"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/api-tokens/{id}": {
- "parameters": [
- {
- "$ref": "#/components/parameters/ApiTokenId"
- }
- ],
- "delete": {
- "summary": "Revoke API token",
- "responses": {
- "200": {
- "$ref": "#/components/responses/Ok"
- }
- }
- }
- },
- "/api/v1/memos": {
- "get": {
- "summary": "List or search memos",
- "parameters": [
- {
- "name": "notebookId",
- "in": "query",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "includeDescendants",
- "in": "query",
- "description": "Include memos from all descendant notebooks when notebookId is set.",
- "schema": {
- "type": "string",
- "enum": ["1"]
- }
- },
- {
- "name": "q",
- "in": "query",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "trash",
- "in": "query",
- "schema": {
- "type": "string",
- "enum": ["1"]
- }
- },
- {
- "name": "limit",
- "in": "query",
- "schema": {
- "type": "integer",
- "minimum": 1,
- "maximum": 200,
- "default": 100
- }
- },
- {
- "name": "cursor",
- "in": "query",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "sort",
- "in": "query",
- "schema": {
- "type": "string",
- "enum": ["updated-desc", "created-desc", "title-asc"],
- "default": "updated-desc"
- }
- },
- {
- "name": "filter",
- "in": "query",
- "schema": {
- "type": "string",
- "enum": ["all", "tagged", "untagged", "pinned"],
- "default": "all"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Memo summaries",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "memos": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/MemoSummary"
- }
- },
- "totalCount": {
- "type": "integer",
- "minimum": 0
- },
- "nextCursor": {
- "type": ["string", "null"]
- }
- },
- "required": ["memos", "totalCount", "nextCursor"]
- }
- }
- }
- }
- }
- },
- "post": {
- "summary": "Create memo",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/MemoCreateInput"
- }
- }
- }
- },
- "responses": {
- "201": {
- "$ref": "#/components/responses/MemoResponse"
- }
- }
- }
- },
- "/api/v1/memos/batch/move": {
- "post": {
- "summary": "Move memos to notebook",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/MoveMemosInput"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Move result",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "ok": {
- "type": "boolean"
- },
- "moved": {
- "type": "integer"
- }
- },
- "required": ["ok", "moved"]
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/memos/batch/delete": {
- "post": {
- "summary": "Delete memos",
- "description": "Soft-deletes active memos, or permanently deletes trashed memos when permanent is true.",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/DeleteMemosInput"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Delete result",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "ok": {
- "type": "boolean"
- },
- "deleted": {
- "type": "integer"
- }
- },
- "required": ["ok", "deleted"]
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/memos/trash/empty": {
- "delete": {
- "summary": "Empty trash",
- "description": "Permanently deletes all trashed memos and their remaining resource objects.",
- "responses": {
- "200": {
- "description": "Empty trash result",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "ok": {
- "type": "boolean"
- },
- "deleted": {
- "type": "integer"
- }
- },
- "required": ["ok", "deleted"]
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/memos/merge": {
- "post": {
- "summary": "Merge memos",
- "description": "Creates a new memo, joins source Markdown with separators, soft-deletes source memos, and re-points resources to the new memo.",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/MergeMemosInput"
- }
- }
- }
- },
- "responses": {
- "201": {
- "$ref": "#/components/responses/MemoResponse"
- }
- }
- }
- },
- "/api/v1/memos/{id}": {
- "parameters": [
- {
- "$ref": "#/components/parameters/MemoId"
- }
- ],
- "get": {
- "summary": "Get memo detail",
- "parameters": [
- {
- "name": "includeDeleted",
- "in": "query",
- "schema": {
- "type": "string",
- "enum": ["1"]
- }
- }
- ],
- "responses": {
- "200": {
- "$ref": "#/components/responses/MemoResponse"
- }
- }
- },
- "patch": {
- "summary": "Update memo",
- "description": "Use expectedRevision for optimistic concurrency. A mismatch returns revision_conflict.",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/MemoUpdateInput"
- }
- }
- }
- },
- "responses": {
- "200": {
- "$ref": "#/components/responses/MemoResponse"
- },
- "409": {
- "$ref": "#/components/responses/Error"
- }
- }
- },
- "delete": {
- "summary": "Soft-delete or permanently delete memo",
- "parameters": [
- {
- "name": "permanent",
- "in": "query",
- "schema": {
- "type": "string",
- "enum": ["1"]
- }
- }
- ],
- "responses": {
- "200": {
- "$ref": "#/components/responses/Ok"
- }
- }
- }
- },
- "/api/v1/memos/{id}/edit-sessions": {
- "parameters": [
- {
- "$ref": "#/components/parameters/MemoId"
- }
- ],
- "post": {
- "summary": "Start a bound memo edit session",
- "description": "Binds an edit session to the memo id, current revision, current content hash, and authenticated actor.",
- "responses": {
- "200": {
- "description": "Bound edit session",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "editSession": {
- "$ref": "#/components/schemas/MemoEditSession"
- }
- },
- "required": ["editSession"]
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/memos/{id}/share": {
- "parameters": [
- {
- "$ref": "#/components/parameters/MemoId"
- }
- ],
- "get": {
- "summary": "Read the active public share for a memo",
- "responses": {
- "200": {
- "description": "Current share status",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "share": {
- "oneOf": [
- { "$ref": "#/components/schemas/MemoShare" },
- { "type": "null" }
- ]
- }
- },
- "required": ["share"]
- }
- }
- }
- }
- }
- },
- "post": {
- "summary": "Create or return a public read-only share link",
- "responses": {
- "200": {
- "description": "Existing share",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": { "share": { "$ref": "#/components/schemas/MemoShare" } },
- "required": ["share"]
- }
- }
- }
- },
- "201": {
- "description": "Share created",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": { "share": { "$ref": "#/components/schemas/MemoShare" } },
- "required": ["share"]
- }
- }
- }
- }
- }
- },
- "delete": {
- "summary": "Revoke a public memo share",
- "responses": {
- "200": { "$ref": "#/components/responses/Ok" },
- "404": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/memos/{id}/restore": {
- "parameters": [
- {
- "$ref": "#/components/parameters/MemoId"
- }
- ],
- "post": {
- "summary": "Restore memo from trash",
- "responses": {
- "200": {
- "$ref": "#/components/responses/MemoResponse"
- }
- }
- }
- },
- "/api/v1/memos/{id}/revisions": {
- "parameters": [
- {
- "$ref": "#/components/parameters/MemoId"
- }
- ],
- "get": {
- "summary": "List memo revisions",
- "parameters": [
- {
- "name": "limit",
- "in": "query",
- "schema": {
- "type": "integer",
- "minimum": 1,
- "maximum": 100,
- "default": 50
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Memo revisions",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "revisions": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/MemoRevision"
- }
- }
- },
- "required": ["revisions"]
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/memos/{id}/revisions/{revisionId}/restore": {
- "parameters": [
- {
- "$ref": "#/components/parameters/MemoId"
- },
- {
- "name": "revisionId",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string"
- }
- }
- ],
- "post": {
- "summary": "Restore a memo revision",
- "responses": {
- "200": {
- "$ref": "#/components/responses/MemoResponse"
- }
- }
- }
- },
- "/api/v1/memos/{id}/resources": {
- "parameters": [
- {
- "$ref": "#/components/parameters/MemoId"
- }
- ],
- "post": {
- "summary": "Upload an image or attachment resource for a memo",
- "description": "Legacy single-request upload for files up to 100 MiB. New clients should use the resumable multipart upload endpoints. Images are stored as provided; server-side compression is disabled.",
- "requestBody": {
- "required": true,
- "content": {
- "multipart/form-data": {
- "schema": {
- "type": "object",
- "properties": {
- "file": {
- "type": "string",
- "format": "binary"
- }
- },
- "required": ["file"]
- }
- }
- }
- },
- "responses": {
- "201": {
- "description": "Uploaded resource",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "resource": {
- "$ref": "#/components/schemas/Resource"
- }
- },
- "required": ["resource"]
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/memos/{id}/resource-uploads": {
- "parameters": [
- {
- "$ref": "#/components/parameters/MemoId"
- }
- ],
- "post": {
- "summary": "Initialize a resumable resource upload",
- "description": "Creates an 8 MiB-part upload session. Attachments support up to 1 GiB; images support up to 100 MiB to keep decoding and previews bounded. The session expires after 24 hours.",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "filename": { "type": "string" },
- "mimeType": { "type": "string" },
- "byteSize": { "type": "integer", "minimum": 1, "maximum": 1073741824 }
- },
- "required": ["filename", "mimeType", "byteSize"]
- }
- }
- }
- },
- "responses": {
- "201": {
- "description": "Initialized upload",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "upload": { "$ref": "#/components/schemas/ResourceUpload" }
- },
- "required": ["upload"]
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/resource-uploads/{uploadId}/parts/{partNumber}": {
- "parameters": [
- { "name": "uploadId", "in": "path", "required": true, "schema": { "type": "string" } },
- { "name": "partNumber", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 1 } }
- ],
- "put": {
- "summary": "Upload or replace one resource part",
- "description": "Streams one exact-sized part to object storage. Repeating a part number safely replaces that part.",
- "requestBody": {
- "required": true,
- "content": {
- "application/octet-stream": {
- "schema": { "type": "string", "format": "binary" }
- }
- }
- },
- "responses": {
- "200": { "description": "Part stored" }
- }
- }
- },
- "/api/v1/resource-uploads/{uploadId}/complete": {
- "parameters": [
- { "name": "uploadId", "in": "path", "required": true, "schema": { "type": "string" } }
- ],
- "post": {
- "summary": "Complete a resource upload",
- "responses": {
- "201": {
- "description": "Completed resource",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": { "resource": { "$ref": "#/components/schemas/Resource" } },
- "required": ["resource"]
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/resource-uploads/{uploadId}": {
- "parameters": [
- { "name": "uploadId", "in": "path", "required": true, "schema": { "type": "string" } }
- ],
- "delete": {
- "summary": "Abort a resource upload",
- "responses": {
- "200": { "description": "Upload aborted" }
- }
- }
- },
- "/api/v1/exports/markdown": {
- "get": {
- "summary": "Read a page of Markdown export data",
- "description": "Returns active memo details and their resource metadata for browser-side Markdown ZIP generation. Requires read:memos and read:resources scopes.",
- "parameters": [
- {
- "name": "offset",
- "in": "query",
- "schema": {
- "type": "integer",
- "minimum": 0,
- "default": 0
- }
- },
- {
- "name": "limit",
- "in": "query",
- "schema": {
- "type": "integer",
- "minimum": 1,
- "maximum": 100,
- "default": 50
- }
- }
- ],
- "responses": {
- "200": {
- "description": "A page of active memos and related resources",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "memos": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/MemoDetail"
- }
- },
- "resources": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Resource"
- }
- },
- "totalCount": {
- "type": "integer"
- },
- "nextOffset": {
- "type": ["integer", "null"]
- }
- },
- "required": ["memos", "resources", "totalCount", "nextOffset"]
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/backups/json": {
- "get": {
- "summary": "Read a page of EdgeEver ZIP recovery data",
- "description": "Returns active memo details, revision history, and resource metadata for browser-side EdgeEver ZIP generation. The resulting archive also contains human-readable Markdown. Trash is excluded.",
- "parameters": [
- { "name": "offset", "in": "query", "schema": { "type": "integer", "minimum": 0, "default": 0 } },
- { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 25 } }
- ],
- "responses": {
- "200": {
- "description": "A page of logical backup data",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "memos": { "type": "array", "items": { "$ref": "#/components/schemas/MemoDetail" } },
- "resources": { "type": "array", "items": { "$ref": "#/components/schemas/Resource" } },
- "revisions": { "type": "array", "items": { "type": "object", "additionalProperties": true } },
- "totalCount": { "type": "integer" },
- "nextOffset": { "type": ["integer", "null"] }
- },
- "required": ["memos", "resources", "revisions", "totalCount", "nextOffset"]
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/restores/json/notebooks": {
- "post": {
- "summary": "Import a batch of notebooks from an EdgeEver ZIP",
- "description": "Interactive-user-only merge restore. Matching EdgeEver notebook IDs are overwritten.",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": { "notebooks": { "type": "array", "minItems": 1, "maxItems": 100, "items": { "type": "object", "additionalProperties": true } } },
- "required": ["notebooks"]
- }
- }
- }
- },
- "responses": { "200": { "$ref": "#/components/responses/Ok" } }
- }
- },
- "/api/v1/restores/json/memos": {
- "post": {
- "summary": "Import a batch of memos from an EdgeEver ZIP",
- "description": "Interactive-user-only merge restore, including current content and revision history. Matching EdgeEver memo IDs are overwritten.",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": { "memos": { "type": "array", "minItems": 1, "maxItems": 10, "items": { "type": "object", "additionalProperties": true } } },
- "required": ["memos"]
- }
- }
- }
- },
- "responses": { "200": { "$ref": "#/components/responses/Ok" } }
- }
- },
- "/api/v1/restores/json/resources/{id}/uploads": {
- "parameters": [
- { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
- ],
- "post": {
- "summary": "Initialize a resumable resource restore",
- "description": "Interactive-user-only restore session that preserves the resource ID from an EdgeEver ZIP. The client streams decompressed bytes through the shared 8 MiB multipart endpoints, supporting attachments up to 1 GiB without buffering the resource or archive in memory.",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": { "type": "object", "additionalProperties": true }
- }
- }
- },
- "responses": {
- "201": {
- "description": "Initialized restore upload",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": { "upload": { "$ref": "#/components/schemas/ResourceUpload" } },
- "required": ["upload"]
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/restores/json/resources/{id}": {
- "parameters": [
- { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
- ],
- "put": {
- "summary": "Import one small resource from an EdgeEver ZIP (legacy)",
- "description": "Interactive-user-only compatibility endpoint for resources up to 100 MiB. Larger restores use the resumable restore session so request parsing remains memory-bounded.",
- "requestBody": {
- "required": true,
- "content": {
- "multipart/form-data": {
- "schema": {
- "type": "object",
- "properties": {
- "metadata": { "type": "string" },
- "file": { "type": "string", "format": "binary" }
- },
- "required": ["metadata", "file"]
- }
- }
- }
- },
- "responses": { "200": { "$ref": "#/components/responses/Ok" } }
- }
- },
- "/api/v1/resources": {
- "get": {
- "summary": "List resources and storage summary",
- "parameters": [
- {
- "name": "limit",
- "in": "query",
- "schema": {
- "type": "integer",
- "minimum": 1,
- "maximum": 500,
- "default": 500
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Resource list",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "resources": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ResourceListItem"
- }
- },
- "summary": {
- "$ref": "#/components/schemas/ResourceStorageSummary"
- }
- },
- "required": ["resources", "summary"]
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/resources/{id}": {
- "parameters": [
- {
- "name": "id",
- "in": "path",
- "required": true,
- "schema": { "type": "string" }
- }
- ],
- "patch": {
- "summary": "Rename a resource",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": { "filename": { "type": "string", "minLength": 1, "maxLength": 160 } },
- "required": ["filename"]
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Renamed resource",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": { "resource": { "$ref": "#/components/schemas/Resource" } },
- "required": ["resource"]
- }
- }
- }
- },
- "404": { "$ref": "#/components/responses/Error" }
- }
- },
- "delete": {
- "summary": "Delete a resource",
- "responses": {
- "200": { "$ref": "#/components/responses/Ok" },
- "404": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/v1/resources/{id}/blob": {
- "parameters": [
- {
- "name": "id",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string"
- }
- }
- ],
- "get": {
- "summary": "Read resource bytes",
- "responses": {
- "200": {
- "description": "Resource blob"
- }
- }
- }
- },
- "/api/public/shares/{token}": {
- "parameters": [
- {
- "name": "token",
- "in": "path",
- "required": true,
- "schema": { "type": "string" }
- }
- ],
- "get": {
- "summary": "Read a publicly shared note",
- "security": [],
- "responses": {
- "200": {
- "description": "Public read-only note",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": { "share": { "$ref": "#/components/schemas/PublicMemoShare" } },
- "required": ["share"]
- }
- }
- }
- },
- "404": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/api/public/shares/{token}/resources/{resourceId}/blob": {
- "parameters": [
- {
- "name": "token",
- "in": "path",
- "required": true,
- "schema": { "type": "string" }
- },
- {
- "name": "resourceId",
- "in": "path",
- "required": true,
- "schema": { "type": "string" }
- }
- ],
- "get": {
- "summary": "Read an attachment belonging to a publicly shared note",
- "security": [],
- "responses": {
- "200": { "description": "Shared resource blob" },
- "404": { "$ref": "#/components/responses/Error" }
- }
- }
- },
- "/mcp": {
- "get": {
- "summary": "Describe MCP endpoint",
- "security": [],
- "responses": {
- "200": {
- "description": "MCP endpoint metadata"
- }
- }
- },
- "post": {
- "summary": "MCP Streamable HTTP JSON-RPC endpoint",
- "description": "Supports initialize, tools/list, tools/call, notifications/initialized, and batch requests.",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/JsonRpcRequest"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/JsonRpcRequest"
- }
- }
- ]
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "JSON-RPC response"
- },
- "204": {
- "description": "Notification accepted"
- }
- }
- }
- }
- },
- "components": {
- "securitySchemes": {
- "bearerAuth": {
- "type": "http",
- "scheme": "bearer"
- },
- "cookieAuth": {
- "type": "apiKey",
- "in": "cookie",
- "name": "edgeever_session"
- }
- },
- "parameters": {
- "NotebookId": {
- "name": "id",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- "MemoId": {
- "name": "id",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- "ApiTokenId": {
- "name": "id",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string"
- }
- }
- },
- "responses": {
- "Ok": {
- "description": "OK",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Ok"
- }
- }
- }
- },
- "Error": {
- "description": "API error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ApiError"
- }
- }
- }
- },
- "NotebookResponse": {
- "description": "Notebook response",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "notebook": {
- "$ref": "#/components/schemas/Notebook"
- }
- },
- "required": ["notebook"]
- }
- }
- }
- },
- "MemoResponse": {
- "description": "Memo response",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "memo": {
- "$ref": "#/components/schemas/MemoDetail"
- }
- },
- "required": ["memo"]
- }
- }
- }
- },
- "UpdatedCount": {
- "description": "Updated count",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "ok": {
- "type": "boolean"
- },
- "updated": {
- "type": "integer"
- }
- },
- "required": ["ok", "updated"]
- }
- }
- }
- }
- },
- "schemas": {
- "Ok": {
- "type": "object",
- "properties": {
- "ok": {
- "type": "boolean"
- }
- },
- "required": ["ok"]
- },
- "ScheduledTaskRun": {
- "type": "object",
- "properties": {
- "id": { "type": "string" },
- "taskId": { "type": "string" },
- "scheduledFor": { "type": "string", "format": "date-time" },
- "executorDeviceId": { "type": "string" },
- "status": { "type": "string", "enum": ["running", "succeeded", "failed"] },
- "errorMessage": { "type": ["string", "null"] },
- "startedAt": { "type": "string", "format": "date-time" },
- "finishedAt": { "type": ["string", "null"], "format": "date-time" }
- },
- "required": ["id", "taskId", "scheduledFor", "executorDeviceId", "status", "errorMessage", "startedAt", "finishedAt"]
- },
- "ScheduledTaskRunHistoryItem": {
- "allOf": [
- { "$ref": "#/components/schemas/ScheduledTaskRun" },
- {
- "type": "object",
- "properties": {
- "taskName": { "type": "string" },
- "pluginId": { "type": "string" },
- "ownerPluginId": { "type": ["string", "null"] },
- "pluginScheduleKey": { "type": ["string", "null"] }
- },
- "required": ["taskName", "pluginId", "ownerPluginId", "pluginScheduleKey"]
- }
- ]
- },
- "ScheduledTask": {
- "type": "object",
- "properties": {
- "id": { "type": "string" },
- "name": { "type": "string" },
- "taskType": { "type": "string", "const": "plugin-command" },
- "taskPayload": { "$ref": "#/components/schemas/ScheduledTaskPayload" },
- "ownerPluginId": { "type": ["string", "null"] },
- "pluginScheduleKey": { "type": ["string", "null"] },
- "cronExpression": { "type": "string" },
- "timezone": { "type": "string" },
- "executorDeviceId": { "type": "string" },
- "missedRunPolicy": { "type": "string", "enum": ["run-once", "skip"] },
- "isEnabled": { "type": "boolean" },
- "createdAt": { "type": "string", "format": "date-time" },
- "updatedAt": { "type": "string", "format": "date-time" },
- "lastRun": { "oneOf": [{ "$ref": "#/components/schemas/ScheduledTaskRun" }, { "type": "null" }] }
- },
- "required": ["id", "name", "taskType", "taskPayload", "ownerPluginId", "pluginScheduleKey", "cronExpression", "timezone", "executorDeviceId", "missedRunPolicy", "isEnabled", "createdAt", "updatedAt", "lastRun"]
- },
- "ScheduledTaskPayload": {
- "type": "object",
- "properties": { "pluginId": { "type": "string" }, "commandId": { "type": "string" } },
- "required": ["pluginId", "commandId"]
- },
- "ScheduledTaskCreateInput": {
- "type": "object",
- "properties": {
- "name": { "type": "string", "maxLength": 120 },
- "taskType": { "type": "string", "const": "plugin-command" },
- "taskPayload": { "$ref": "#/components/schemas/ScheduledTaskPayload" },
- "cronExpression": { "type": "string", "maxLength": 160 },
- "timezone": { "type": "string", "maxLength": 80 },
- "executorDeviceId": { "type": "string" },
- "missedRunPolicy": { "type": "string", "enum": ["run-once", "skip"], "default": "run-once" },
- "isEnabled": { "type": "boolean", "default": true }
- },
- "required": ["name", "taskType", "taskPayload", "cronExpression", "timezone", "executorDeviceId"]
- },
- "ScheduledTaskUpdateInput": {
- "type": "object",
- "properties": {
- "name": { "type": "string", "maxLength": 120 },
- "taskPayload": { "$ref": "#/components/schemas/ScheduledTaskPayload" },
- "cronExpression": { "type": "string", "maxLength": 160 },
- "timezone": { "type": "string", "maxLength": 80 },
- "executorDeviceId": { "type": "string" },
- "missedRunPolicy": { "type": "string", "enum": ["run-once", "skip"] },
- "isEnabled": { "type": "boolean" }
- }
- },
- "PluginScheduleUpsertInput": {
- "type": "object",
- "properties": {
- "pluginId": { "type": "string" },
- "scheduleKey": { "type": "string", "maxLength": 120 },
- "name": { "type": "string", "maxLength": 120 },
- "commandId": { "type": "string", "maxLength": 200 },
- "cronExpression": { "type": "string", "maxLength": 160 },
- "timezone": { "type": "string", "maxLength": 80 },
- "executorDeviceId": { "type": "string" },
- "missedRunPolicy": { "type": "string", "enum": ["run-once", "skip"], "default": "run-once" },
- "isEnabled": { "type": "boolean" }
- },
- "required": ["pluginId", "scheduleKey", "name", "commandId", "cronExpression", "timezone", "executorDeviceId"]
- },
- "ScheduledTaskClaimInput": {
- "type": "object",
- "properties": { "scheduledFor": { "type": "string", "format": "date-time" }, "executorDeviceId": { "type": "string" } },
- "required": ["scheduledFor", "executorDeviceId"]
- },
- "ScheduledTaskFinishInput": {
- "type": "object",
- "properties": {
- "executorDeviceId": { "type": "string" },
- "status": { "type": "string", "enum": ["succeeded", "failed"] },
- "errorMessage": { "type": ["string", "null"], "maxLength": 2000 }
- },
- "required": ["executorDeviceId", "status"]
- },
- "WorkspaceExtension": {
- "type": "object",
- "properties": {
- "extensionId": { "type": "string" },
- "type": { "type": "string", "enum": ["plugin", "theme"] },
- "version": { "type": "string" },
- "enabled": { "type": "boolean" },
- "installedAt": { "type": "string", "format": "date-time" },
- "updatedAt": { "type": "string", "format": "date-time" },
- "deletedAt": { "type": ["string", "null"], "format": "date-time" },
- "manifestUrl": { "type": "string", "format": "uri" },
- "sourceKind": { "type": "string", "enum": ["marketplace", "github", "manifest"] },
- "verified": { "type": "boolean" },
- "repositoryUrl": { "type": ["string", "null"], "format": "uri" },
- "releaseTag": { "type": ["string", "null"] },
- "publisher": { "type": ["string", "null"], "enum": ["edgeever", null] }
- },
- "required": ["extensionId", "type", "version", "enabled", "installedAt", "updatedAt", "deletedAt", "manifestUrl", "sourceKind", "verified", "repositoryUrl", "releaseTag", "publisher"]
- },
- "WorkspaceExtensionUpsertInput": {
- "type": "object",
- "properties": {
- "type": { "type": "string", "enum": ["plugin", "theme"] },
- "version": { "type": "string" },
- "enabled": { "type": "boolean" },
- "installedAt": { "type": "string", "format": "date-time" },
- "manifestUrl": { "type": "string", "format": "uri" },
- "sourceKind": { "type": "string", "enum": ["marketplace", "github", "manifest"] },
- "verified": { "type": "boolean" },
- "repositoryUrl": { "type": ["string", "null"], "format": "uri" },
- "releaseTag": { "type": ["string", "null"] },
- "publisher": { "type": ["string", "null"], "enum": ["edgeever", null] }
- },
- "required": ["type", "version", "enabled", "installedAt", "manifestUrl", "sourceKind", "verified"]
- },
- "ApiError": {
- "type": "object",
- "properties": {
- "error": {
- "type": "object",
- "properties": {
- "code": {
- "type": "string"
- },
- "message": {
- "type": "string"
- },
- "details": {}
- },
- "required": ["code", "message"]
- }
- },
- "required": ["error"]
- },
- "AuthSession": {
- "type": "object",
- "properties": {
- "authRequired": {
- "type": "boolean"
- },
- "authenticated": {
- "type": "boolean"
- },
- "demoMode": {
- "type": "boolean"
- },
- "user": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/AuthUser"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "required": ["authRequired", "authenticated", "demoMode", "user"]
- },
- "LoginDeviceSession": {
- "type": "object",
- "properties": {
- "id": { "type": "string" },
- "userAgent": { "type": ["string", "null"] },
- "label": { "type": ["string", "null"] },
- "ipAddress": { "type": ["string", "null"] },
- "ipCountry": { "type": ["string", "null"] },
- "ipRegion": { "type": ["string", "null"] },
- "isCurrent": { "type": "boolean" },
- "createdAt": { "type": "string", "format": "date-time" },
- "lastSeenAt": { "type": "string", "format": "date-time" },
- "expiresAt": { "type": "string", "format": "date-time" }
- },
- "required": ["id", "userAgent", "label", "ipAddress", "ipCountry", "ipRegion", "isCurrent", "createdAt", "lastSeenAt", "expiresAt"]
- },
- "AuthUser": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "username": {
- "type": "string"
- },
- "displayName": {
- "type": ["string", "null"]
- },
- "role": {
- "type": "string",
- "enum": ["owner", "member"]
- }
- },
- "required": ["id", "username", "displayName", "role"]
- },
- "InstanceUser": {
- "allOf": [
- { "$ref": "#/components/schemas/AuthUser" },
- {
- "type": "object",
- "properties": {
- "isDisabled": { "type": "boolean" },
- "lastLoginAt": { "type": ["string", "null"], "format": "date-time" },
- "createdAt": { "type": "string", "format": "date-time" }
- },
- "required": ["isDisabled", "lastLoginAt", "createdAt"]
- }
- ]
- },
- "UserCreateInput": {
- "type": "object",
- "properties": {
- "username": { "type": "string", "minLength": 1, "maxLength": 80 },
- "displayName": { "type": ["string", "null"], "maxLength": 80 },
- "password": { "type": "string", "minLength": 8, "maxLength": 512 }
- },
- "required": ["username", "password"]
- },
- "UserUpdateInput": {
- "type": "object",
- "properties": {
- "displayName": { "type": ["string", "null"], "maxLength": 80 },
- "password": { "type": "string", "minLength": 8, "maxLength": 512 },
- "isDisabled": { "type": "boolean" }
- },
- "minProperties": 1
- },
- "ObjectStorageSettings": {
- "type": "object",
- "properties": {
- "provider": { "type": "string", "enum": ["builtin", "s3"] },
- "displayName": { "type": "string" },
- "endpoint": { "type": ["string", "null"] },
- "region": { "type": ["string", "null"] },
- "bucket": { "type": ["string", "null"] },
- "accessKeyId": { "type": ["string", "null"] },
- "hasSecretAccessKey": { "type": "boolean" },
- "forcePathStyle": { "type": "boolean" },
- "objectPrefix": { "type": "string" },
- "encryptionConfigured": { "type": "boolean" }
- },
- "required": ["provider", "displayName", "endpoint", "region", "bucket", "accessKeyId", "hasSecretAccessKey", "forcePathStyle", "objectPrefix", "encryptionConfigured"]
- },
- "ObjectStorageSettingsResponse": {
- "type": "object",
- "properties": {
- "settings": { "$ref": "#/components/schemas/ObjectStorageSettings" },
- "externalSettings": { "oneOf": [{ "$ref": "#/components/schemas/ObjectStorageSettings" }, { "type": "null" }] }
- },
- "required": ["settings"]
- },
- "ObjectStorageS3Input": {
- "type": "object",
- "properties": {
- "endpoint": { "type": "string", "format": "uri", "maxLength": 500 },
- "region": { "type": "string", "minLength": 1, "maxLength": 80 },
- "bucket": { "type": "string", "minLength": 1, "maxLength": 255 },
- "accessKeyId": { "type": "string", "minLength": 1, "maxLength": 256 },
- "secretAccessKey": { "type": "string", "minLength": 1, "maxLength": 1024 },
- "forcePathStyle": { "type": "boolean", "default": true },
- "objectPrefix": { "type": "string", "maxLength": 500, "default": "" }
- },
- "required": ["endpoint", "region", "bucket", "accessKeyId"]
- },
- "ObjectStorageConnectionTestInput": {
- "$ref": "#/components/schemas/ObjectStorageS3Input"
- },
- "ObjectStorageSettingsUpdateInput": {
- "oneOf": [
- { "type": "object", "properties": { "provider": { "const": "builtin" } }, "required": ["provider"] },
- { "allOf": [
- { "$ref": "#/components/schemas/ObjectStorageS3Input" },
- { "type": "object", "properties": { "provider": { "const": "s3" }, "displayName": { "type": "string", "minLength": 1, "maxLength": 80 } }, "required": ["provider", "displayName"] }
- ] }
- ]
- },
- "AiModel": {
- "type": "object",
- "properties": {
- "id": { "type": "string" },
- "providerConfigId": { "type": "string" },
- "modelId": { "type": "string" },
- "displayName": { "type": "string" }
- },
- "required": ["id", "providerConfigId", "modelId", "displayName"]
- },
- "AiProvider": {
- "type": "object",
- "properties": {
- "id": { "type": "string" },
- "provider": { "type": "string", "enum": ["openai-compatible", "anthropic", "google"] },
- "displayName": { "type": "string" },
- "baseUrl": { "type": "string", "format": "uri" },
- "isEnabled": { "type": "boolean" },
- "hasApiKey": { "type": "boolean" },
- "models": { "type": "array", "items": { "$ref": "#/components/schemas/AiModel" } }
- },
- "required": ["id", "provider", "displayName", "baseUrl", "isEnabled", "hasApiKey", "models"]
- },
- "AiSettings": {
- "type": "object",
- "properties": {
- "providers": { "type": "array", "items": { "$ref": "#/components/schemas/AiProvider" } },
- "defaultModelId": { "type": ["string", "null"] },
- "encryptionConfigured": { "type": "boolean" },
- "readOnly": { "type": "boolean" }
- },
- "required": ["providers", "defaultModelId", "encryptionConfigured", "readOnly"]
- },
- "AiProviderCreateInput": {
- "type": "object",
- "properties": {
- "provider": { "type": "string", "enum": ["openai-compatible", "anthropic", "google"] },
- "displayName": { "type": "string", "minLength": 1, "maxLength": 80 },
- "baseUrl": { "type": "string", "format": "uri", "maxLength": 500 },
- "apiKey": { "type": "string", "minLength": 1, "maxLength": 4096 },
- "isEnabled": { "type": "boolean", "default": true },
- "initialModelId": { "type": "string", "minLength": 1, "maxLength": 200 }
- },
- "required": ["provider", "displayName", "baseUrl", "apiKey"]
- },
- "AiProviderUpdateInput": {
- "type": "object",
- "properties": {
- "provider": { "type": "string", "enum": ["openai-compatible", "anthropic", "google"] },
- "displayName": { "type": "string", "minLength": 1, "maxLength": 80 },
- "baseUrl": { "type": "string", "format": "uri", "maxLength": 500 },
- "apiKey": { "type": "string", "minLength": 1, "maxLength": 4096 },
- "isEnabled": { "type": "boolean", "default": true }
- },
- "required": ["provider", "displayName", "baseUrl"]
- },
- "AiModelCreateInput": {
- "type": "object",
- "properties": {
- "modelId": { "type": "string", "minLength": 1, "maxLength": 200 },
- "displayName": { "type": "string", "minLength": 1, "maxLength": 200 }
- },
- "required": ["modelId"]
- },
- "AiPromptTemplate": {
- "type": "object",
- "properties": {
- "id": { "type": "string" },
- "origin": { "type": "string", "enum": ["default", "custom"] },
- "seedKey": { "type": ["string", "null"] },
- "action": { "type": "string", "enum": ["summarize", "extract-key-points", "extract-todos", "rewrite-proofread", "translate", "improve-writing", "fix-spelling-grammar", "make-shorter", "make-longer", "simplify-language", "change-tone", "continue-writing", "custom"] },
- "parameterKind": { "type": "string", "enum": ["none", "target-language", "tone"] },
- "resultMode": { "type": "string", "enum": ["append", "replace", "both"] },
- "nameCustomized": { "type": "boolean" },
- "descriptionCustomized": { "type": "boolean" },
- "instructionCustomized": { "type": "boolean" },
- "name": { "type": "string", "minLength": 1, "maxLength": 80 },
- "description": { "type": ["string", "null"], "maxLength": 200 },
- "instruction": { "type": "string", "minLength": 1, "maxLength": 2000 },
- "createdAt": { "type": "string", "format": "date-time" },
- "updatedAt": { "type": "string", "format": "date-time" }
- },
- "required": ["id", "origin", "seedKey", "action", "parameterKind", "resultMode", "nameCustomized", "descriptionCustomized", "instructionCustomized", "name", "description", "instruction", "createdAt", "updatedAt"]
- },
- "AiPromptCreateInput": {
- "type": "object",
- "properties": {
- "name": { "type": "string", "minLength": 1, "maxLength": 80 },
- "description": { "type": "string", "maxLength": 200 },
- "instruction": { "type": "string", "minLength": 1, "maxLength": 2000 },
- "parameterKind": { "type": "string", "enum": ["none", "target-language", "tone"], "default": "none" },
- "resultMode": { "type": "string", "enum": ["append", "replace", "both"], "default": "both" }
- },
- "required": ["name", "instruction"]
- },
- "AiPromptUpdateInput": {
- "type": "object",
- "minProperties": 1,
- "properties": {
- "name": { "type": "string", "minLength": 1, "maxLength": 80 },
- "description": { "type": ["string", "null"], "maxLength": 200 },
- "instruction": { "type": "string", "minLength": 1, "maxLength": 2000 },
- "parameterKind": { "type": "string", "enum": ["none", "target-language", "tone"] },
- "resultMode": { "type": "string", "enum": ["append", "replace", "both"] }
- }
- },
- "AiPromptResponse": {
- "type": "object",
- "properties": { "prompt": { "$ref": "#/components/schemas/AiPromptTemplate" } },
- "required": ["prompt"]
- },
- "LoginInput": {
- "type": "object",
- "properties": {
- "username": {
- "type": "string"
- },
- "password": {
- "type": "string"
- },
- "deviceId": {
- "type": "string",
- "minLength": 16,
- "maxLength": 160,
- "description": "Stable client installation identifier used to replace older sessions from the same device"
- }
- },
- "required": ["username", "password"]
- },
- "ChangePasswordInput": {
- "type": "object",
- "properties": {
- "currentPassword": {
- "type": "string",
- "minLength": 1,
- "maxLength": 512
- },
- "newPassword": {
- "type": "string",
- "minLength": 8,
- "maxLength": 512
- },
- "confirmPassword": {
- "type": "string",
- "minLength": 8,
- "maxLength": 512
- }
- },
- "required": ["currentPassword", "newPassword", "confirmPassword"]
- },
- "Notebook": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "parentId": {
- "type": ["string", "null"]
- },
- "name": {
- "type": "string"
- },
- "slug": {
- "type": ["string", "null"]
- },
- "icon": {
- "type": ["string", "null"]
- },
- "color": {
- "type": ["string", "null"]
- },
- "sortOrder": {
- "type": "integer"
- },
- "memoCount": {
- "type": "integer"
- },
- "lastMemoUpdatedAt": {
- "type": ["string", "null"],
- "format": "date-time"
- },
- "createdAt": {
- "type": "string",
- "format": "date-time"
- },
- "updatedAt": {
- "type": "string",
- "format": "date-time"
- }
- },
- "required": ["id", "parentId", "name", "slug", "icon", "color", "sortOrder", "memoCount", "lastMemoUpdatedAt", "createdAt", "updatedAt"]
- },
- "NotebookCreateInput": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "minLength": 1,
- "maxLength": 80
- },
- "parentId": {
- "type": ["string", "null"]
- }
- },
- "required": ["name"]
- },
- "NotebookUpdateInput": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "minLength": 1,
- "maxLength": 80
- },
- "parentId": {
- "type": ["string", "null"]
- },
- "sortOrder": {
- "type": "integer"
- }
- }
- },
- "MemoSummary": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "notebookId": {
- "type": "string"
- },
- "title": {
- "type": ["string", "null"]
- },
- "excerpt": {
- "type": "string"
- },
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "isPinned": {
- "type": "boolean"
- },
- "isArchived": {
- "type": "boolean"
- },
- "isDeleted": {
- "type": "boolean"
- },
- "revision": {
- "type": "integer"
- },
- "createdAt": {
- "type": "string",
- "format": "date-time"
- },
- "updatedAt": {
- "type": "string",
- "format": "date-time"
- },
- "deletedAt": {
- "type": ["string", "null"],
- "format": "date-time"
- }
- },
- "required": ["id", "notebookId", "title", "excerpt", "tags", "isPinned", "isArchived", "isDeleted", "revision", "createdAt", "updatedAt", "deletedAt"]
- },
- "MemoDetail": {
- "allOf": [
- {
- "$ref": "#/components/schemas/MemoSummary"
- },
- {
- "type": "object",
- "properties": {
- "contentJson": {
- "$ref": "#/components/schemas/TiptapDoc"
- },
- "contentMarkdown": {
- "type": "string"
- },
- "contentText": {
- "type": "string"
- },
- "contentHash": {
- "type": "string",
- "minLength": 64,
- "maxLength": 64
- },
- "sourceMemoIds": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "mergeSourceCount": {
- "type": "integer"
- },
- "mergedIntoMemoId": {
- "type": ["string", "null"]
- }
- },
- "required": ["contentJson", "contentMarkdown", "contentText", "contentHash", "sourceMemoIds", "mergeSourceCount", "mergedIntoMemoId"]
- }
- ]
- },
- "MemoShare": {
- "type": "object",
- "properties": {
- "memoId": { "type": "string" },
- "token": { "type": "string" },
- "createdAt": { "type": "string", "format": "date-time" },
- "updatedAt": { "type": "string", "format": "date-time" }
- },
- "required": ["memoId", "token", "createdAt", "updatedAt"]
- },
- "PublicMemoShare": {
- "type": "object",
- "properties": {
- "title": { "type": ["string", "null"] },
- "contentJson": { "$ref": "#/components/schemas/TiptapDoc" },
- "contentMarkdown": { "type": "string" },
- "tags": { "type": "array", "items": { "type": "string" } },
- "updatedAt": { "type": "string", "format": "date-time" }
- },
- "required": ["title", "contentJson", "contentMarkdown", "tags", "updatedAt"]
- },
- "MemoCreateInput": {
- "type": "object",
- "properties": {
- "notebookId": {
- "type": "string"
- },
- "title": {
- "type": "string",
- "maxLength": 160
- },
- "contentMarkdown": {
- "type": "string"
- },
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- },
- "required": ["notebookId"]
- },
- "MemoUpdateInput": {
- "type": "object",
- "properties": {
- "expectedRevision": {
- "type": "integer",
- "minimum": 0
- },
- "expectedContentHash": {
- "type": "string",
- "minLength": 64,
- "maxLength": 64
- },
- "editSessionId": {
- "type": "string"
- },
- "notebookId": {
- "type": "string"
- },
- "title": {
- "type": "string",
- "maxLength": 160
- },
- "isPinned": {
- "type": "boolean"
- },
- "contentJson": {
- "$ref": "#/components/schemas/TiptapDoc"
- },
- "contentMarkdown": {
- "type": "string"
- },
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- },
- "MemoEditSession": {
- "type": "object",
- "properties": {
- "id": { "type": "string" },
- "memoId": { "type": "string" },
- "baseRevision": { "type": "integer", "minimum": 0 },
- "baseContentHash": { "type": "string", "minLength": 64, "maxLength": 64 },
- "expiresAt": { "type": "string", "format": "date-time" }
- },
- "required": ["id", "memoId", "baseRevision", "baseContentHash", "expiresAt"]
- },
- "MoveMemosInput": {
- "type": "object",
- "properties": {
- "memoIds": {
- "type": "array",
- "minItems": 1,
- "maxItems": 100,
- "items": {
- "type": "string"
- }
- },
- "notebookId": {
- "type": "string"
- }
- },
- "required": ["memoIds", "notebookId"]
- },
- "DeleteMemosInput": {
- "type": "object",
- "properties": {
- "memoIds": {
- "type": "array",
- "minItems": 1,
- "maxItems": 100,
- "items": {
- "type": "string"
- }
- },
- "permanent": {
- "type": "boolean"
- }
- },
- "required": ["memoIds"]
- },
- "MergeMemosInput": {
- "type": "object",
- "properties": {
- "memoIds": {
- "type": "array",
- "minItems": 2,
- "maxItems": 50,
- "items": {
- "type": "string"
- }
- },
- "notebookId": {
- "type": "string"
- },
- "title": {
- "type": "string",
- "maxLength": 160
- }
- },
- "required": ["memoIds"]
- },
- "MemoRevision": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "memoId": {
- "type": "string"
- },
- "revision": {
- "type": "integer"
- },
- "title": {
- "type": ["string", "null"]
- },
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "contentMarkdown": {
- "type": "string"
- },
- "contentText": {
- "type": "string"
- },
- "contentHash": {
- "type": "string"
- },
- "createdBy": {
- "type": "string"
- },
- "createdAt": {
- "type": "string",
- "format": "date-time"
- }
- },
- "required": ["id", "memoId", "revision", "title", "tags", "contentMarkdown", "contentText", "contentHash", "createdBy", "createdAt"]
- },
- "TagSummary": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string"
- },
- "memoCount": {
- "type": "integer"
- },
- "updatedAt": {
- "type": ["string", "null"],
- "format": "date-time"
- }
- },
- "required": ["name", "memoCount", "updatedAt"]
- },
- "TagRenameInput": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "minLength": 1,
- "maxLength": 80
- }
- },
- "required": ["name"]
- },
- "ApiToken": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "token": {
- "type": ["string", "null"]
- },
- "scopes": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "lastUsedAt": {
- "type": ["string", "null"],
- "format": "date-time"
- },
- "expiresAt": {
- "type": ["string", "null"],
- "format": "date-time"
- },
- "isRevoked": {
- "type": "boolean"
- },
- "createdAt": {
- "type": "string",
- "format": "date-time"
- }
- },
- "required": ["id", "name", "token", "scopes", "lastUsedAt", "expiresAt", "isRevoked", "createdAt"]
- },
- "ApiTokenCreateInput": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "minLength": 1,
- "maxLength": 80
- },
- "scopes": {
- "type": "array",
- "minItems": 1,
- "maxItems": 32,
- "items": {
- "type": "string"
- }
- },
- "expiresAt": {
- "type": ["string", "null"],
- "format": "date-time"
- }
- },
- "required": ["name", "scopes"]
- },
- "CreatedApiToken": {
- "type": "object",
- "properties": {
- "token": {
- "type": "string"
- },
- "apiToken": {
- "$ref": "#/components/schemas/ApiToken"
- }
- },
- "required": ["token", "apiToken"]
- },
- "Resource": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "memoId": {
- "type": "string"
- },
- "originalMemoId": {
- "type": ["string", "null"]
- },
- "kind": {
- "type": "string",
- "enum": ["image", "attachment"]
- },
- "mimeType": {
- "type": ["string", "null"]
- },
- "filename": {
- "type": ["string", "null"]
- },
- "byteSize": {
- "type": "integer"
- },
- "sha256": {
- "type": ["string", "null"]
- },
- "width": {
- "type": ["integer", "null"]
- },
- "height": {
- "type": ["integer", "null"]
- },
- "createdAt": {
- "type": "string",
- "format": "date-time"
- },
- "updatedAt": {
- "type": "string",
- "format": "date-time"
- },
- "url": {
- "type": "string"
- }
- },
- "required": ["id", "memoId", "originalMemoId", "kind", "mimeType", "filename", "byteSize", "sha256", "width", "height", "createdAt", "updatedAt", "url"]
- },
- "ResourceUpload": {
- "type": "object",
- "properties": {
- "id": { "type": "string" },
- "resourceId": { "type": "string" },
- "partSize": { "type": "integer", "const": 8388608 },
- "partCount": { "type": "integer", "minimum": 1, "maximum": 50 },
- "byteSize": { "type": "integer", "minimum": 1, "maximum": 1073741824 },
- "expiresAt": { "type": "string", "format": "date-time" }
- },
- "required": ["id", "resourceId", "partSize", "partCount", "byteSize", "expiresAt"]
- },
- "ResourceListItem": {
- "allOf": [
- {
- "$ref": "#/components/schemas/Resource"
- },
- {
- "type": "object",
- "properties": {
- "memoTitle": {
- "type": ["string", "null"]
- },
- "memoExcerpt": {
- "type": ["string", "null"]
- },
- "memoDeleted": {
- "type": "boolean"
- }
- },
- "required": ["memoTitle", "memoExcerpt", "memoDeleted"]
- }
- ]
- },
- "ResourceStorageSummary": {
- "type": "object",
- "properties": {
- "totalCount": {
- "type": "integer"
- },
- "totalBytes": {
- "type": "integer"
- },
- "imageCount": {
- "type": "integer"
- },
- "attachmentCount": {
- "type": "integer"
- }
- },
- "required": ["totalCount", "totalBytes", "imageCount", "attachmentCount"]
- },
- "TiptapDoc": {
- "type": "object",
- "additionalProperties": true,
- "properties": {
- "type": {
- "type": "string",
- "const": "doc"
- },
- "content": {
- "type": "array",
- "items": {
- "type": "object",
- "additionalProperties": true
- }
- }
- },
- "required": ["type", "content"]
- },
- "JsonRpcRequest": {
- "type": "object",
- "properties": {
- "jsonrpc": {
- "type": "string",
- "const": "2.0"
- },
- "id": {
- "type": ["string", "number", "null"]
- },
- "method": {
- "type": "string"
- },
- "params": {}
- },
- "required": ["jsonrpc", "method"]
- }
- }
- }
+ "ok": true,
+ "probe": "api"
}
diff --git a/docs/self-hosting-architecture.md b/docs/self-hosting-architecture.md
index 8fd350a0..19652ae9 100644
--- a/docs/self-hosting-architecture.md
+++ b/docs/self-hosting-architecture.md
@@ -52,7 +52,7 @@ ambiguous.
## Compatibility requirements
-- Keep `/api/*`, `/mcp`, `/api/openapi.json`, and `/api/health` unchanged.
+- Keep `/api/*`, `/mcp`, `/api/health`, and the `/api/openapi.json` reachability probe unchanged. `/api/openapi.json` is not an API catalog.
- Keep the current migration files append-only; do not fork the schema for
Docker.
- Keep root secrets in environment variables or Docker secrets, never in the
diff --git a/docs/self-hosting-architecture.zh-CN.md b/docs/self-hosting-architecture.zh-CN.md
index ab0c362e..cf6b2fb3 100644
--- a/docs/self-hosting-architecture.zh-CN.md
+++ b/docs/self-hosting-architecture.zh-CN.md
@@ -45,7 +45,7 @@ S3 兼容对象存储两种后端。
## 兼容性要求
-- 保持 `/api/*`、`/mcp`、`/api/openapi.json` 和 `/api/health` 不变。
+- 保持 `/api/*`、`/mcp`、`/api/health` 以及探活用的 `/api/openapi.json` 不变。`/api/openapi.json` 不是 API 目录。
- 继续追加 `migrations/*.sql`,禁止为 Docker 分叉数据库结构。
- 根密钥必须通过环境变量或 Docker secrets 注入,不能写入镜像或数据库。自托管运行入口可以把副本写在 `/data`(SQLite 之外),以便 NAS/GUI 升级丢掉容器环境变量后仍能加密凭据。Cloudflare 继续只使用 Worker Secret。对象存储 Secret 与个人 AI 模型 API Key 默认从已有实例认证 Secret 派生各自用途的专用密钥;高级 AI 密钥轮换场景可选用 `EDGE_EVER_CREDENTIALS_ENCRYPTION_KEY` 覆盖。所有凭据在数据库中只能保存为 AES-GCM 密文。
- 将 `/data` 作为唯一必需的应用持久化路径,方便 NAS 用户备份一个卷。