@whispering233/ai-editor-server 0.0.50 → 0.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client-dist/index.html
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
// localStorage 不可用(隐私模式等)时静默跳过,默认浅色
|
|
14
14
|
}
|
|
15
15
|
</script>
|
|
16
|
-
<script type="module" crossorigin src="/assets/index-
|
|
16
|
+
<script type="module" crossorigin src="/assets/index-JrTZv8BF.js"></script>
|
|
17
17
|
<link rel="stylesheet" crossorigin href="/assets/index-Dim9IXQC.css">
|
|
18
18
|
</head>
|
|
19
19
|
<body>
|
package/dist/index.js
CHANGED
|
@@ -308,7 +308,7 @@ export function parsePortEnv(value) {
|
|
|
308
308
|
// 直接与 import.meta.url 比较会误判为「非直接执行」导致进程静默退出(无输出、exit 0)。
|
|
309
309
|
// 因此两侧都经 realpathSync 归一化后再比较。
|
|
310
310
|
//
|
|
311
|
-
// 桌面版(Electron 主进程 import 本模块,2026-
|
|
311
|
+
// 桌面版(Electron 主进程 import 本模块,2026-09 实测):Electron 的 process.argv[1] 是**命令行开关**
|
|
312
312
|
// (如 `--no-sandbox`)而非脚本路径 → 未做防护的 realpathSync 抛 ENOENT 打挂整个主进程。
|
|
313
313
|
// 故判定包一层 try/catch:路径不存在/不可解析一律判否(bin 语义不变,只是不再抛错)。
|
|
314
314
|
function isDirectExecution() {
|
package/dist/routes/entity.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// (软删级联)、(时间轴事件:全局线性序 sort_order,仅 event 使用)、
|
|
5
5
|
// G2 修订(时间标签点实体化:timepoint 全局线性序 + occurs_at 挂载 + 跨组拖拽复合端点)。
|
|
6
|
-
// reference 特例(2026-
|
|
6
|
+
// reference 特例(2026-09,docs/api/30-api-entity.md):正文是块文档——`data.content` 拆写进
|
|
7
7
|
// document_records(owner_kind='reference',单事务),详情再装回;列表摘要读 content_text 投影。
|
|
8
8
|
// 错误映射(对照 错误码):
|
|
9
9
|
// type 参数非法 / 参数校验失败 → 400 VALIDATION_ERROR(zod 抛错由 errorHandler 统一映射,含 fields)
|
|
@@ -48,7 +48,7 @@ function parseBlockContent(content) {
|
|
|
48
48
|
return parsed;
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
* reference 的 data.content 拆分(2026-
|
|
51
|
+
* reference 的 data.content 拆分(2026-09 装载拆分,docs/api/30-api-entity.md「reference 特例」):
|
|
52
52
|
* `content` 是**端点对外字段名**,真相落 `document_records` ⇒ 返回的 data 已剔除 content。
|
|
53
53
|
* - content 未携带(字段不存在或非对象 data)→ `content` 为 null = **正文保持不动**
|
|
54
54
|
* (行内改标题/分类/标签场景,旧「先写文件后写库」链路的替代语义)
|
|
@@ -130,7 +130,7 @@ entityRoutes.get("/:type", (c) => {
|
|
|
130
130
|
}));
|
|
131
131
|
});
|
|
132
132
|
// GET /api/v1/entity/:type/:id —— 详情(含紧邻 relations + deltaCount)
|
|
133
|
-
// reference 特例(2026-
|
|
133
|
+
// reference 特例(2026-09):`data.content` 不在 entities.data 里,从 document_records 装回
|
|
134
134
|
// (写入侧拆分的逆操作)——库内无行(从未写过正文)→ 不附加 content 键(详情不凭空造空文档)
|
|
135
135
|
entityRoutes.get("/:type/:id", (c) => {
|
|
136
136
|
const project = requireCurrentProject();
|
|
@@ -168,7 +168,7 @@ entityRoutes.get("/:type/:id", (c) => {
|
|
|
168
168
|
}));
|
|
169
169
|
});
|
|
170
170
|
// POST /api/v1/entity/:type —— 创建(name 必填 1-100;data 按类型精确校验;201)
|
|
171
|
-
// reference 特例(2026-
|
|
171
|
+
// reference 特例(2026-09,docs/api/30-api-entity.md):`data.content`(块数组 JSON 字符串)
|
|
172
172
|
// **不进 entities.data**,与实体行同一事务拆写进 `document_records`(owner_kind='reference',
|
|
173
173
|
// 服务端派生 content_text 投影);未携带 content = 允许先建条目后写正文(不落文档行);
|
|
174
174
|
// url 可选(纯本地笔记不需外源链接)。
|
|
@@ -206,7 +206,7 @@ entityRoutes.post("/:type", async (c) => {
|
|
|
206
206
|
}), 201);
|
|
207
207
|
});
|
|
208
208
|
// PUT /api/v1/entity/:type/:id —— 部分更新(仅合并传入字段;data 浅合并)
|
|
209
|
-
// reference 特例(2026-
|
|
209
|
+
// reference 特例(2026-09):`data.content` 传入 → 与实体行同一事务整篇覆盖文档行(单事务,
|
|
210
210
|
// 无「先写文件后写库」的先后性与自愈问题);**未携带 content 时正文保持不动**——
|
|
211
211
|
// 行内编辑标题/分类/标签不碰正文,也不再随写文件联动;存量行的遗留 `data.content` 旧键随本次写入剔除。
|
|
212
212
|
entityRoutes.put("/:type/:id", async (c) => {
|
|
@@ -378,7 +378,7 @@ entityRoutes.post("/event/:id/move_to", async (c) => {
|
|
|
378
378
|
}
|
|
379
379
|
});
|
|
380
380
|
// DELETE /api/v1/entity/:type/:id —— 软删(级联软删关系与 Delta,本体保留可还原)
|
|
381
|
-
// reference 特例(2026-
|
|
381
|
+
// reference 特例(2026-09):正文行(document_records)**保留**——软删期间端点 404 不可见,
|
|
382
382
|
// 还原后原样可见;purge 时才随实体物理删(trash 路由)。此前「文件移入 references/.trash/」的
|
|
383
383
|
// 文件联动已随本卡移除(原属 12.7b 范围)。
|
|
384
384
|
entityRoutes.delete("/:type/:id", (c) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@whispering233/ai-editor-server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.52",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Hono API 服务端(单进程:API + SPA 静态托管)",
|
|
6
6
|
"type": "module",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"@earendil-works/pi-ai": "0.85.1",
|
|
35
35
|
"@earendil-works/pi-coding-agent": "0.85.1",
|
|
36
36
|
"@hono/node-server": "^2.0.12",
|
|
37
|
-
"@whispering233/ai-editor-agent": "0.0.
|
|
38
|
-
"@whispering233/ai-editor-db": "0.0.
|
|
39
|
-
"@whispering233/ai-editor-shared": "0.0.
|
|
40
|
-
"@whispering233/ai-editor-tools": "0.0.
|
|
37
|
+
"@whispering233/ai-editor-agent": "0.0.52",
|
|
38
|
+
"@whispering233/ai-editor-db": "0.0.52",
|
|
39
|
+
"@whispering233/ai-editor-shared": "0.0.52",
|
|
40
|
+
"@whispering233/ai-editor-tools": "0.0.52",
|
|
41
41
|
"fflate": "^0.8.3",
|
|
42
42
|
"hono": "^4.7.0",
|
|
43
43
|
"undici": "8.5.0",
|