/** * [ref] A9 域模块 —— memory 导出/同步 + 只读策略面。 * * 路由:`GET /v1/memory/export`、`POST /v1/memory/sync/:scope`、`GET /v1/policy`。 * owner 门 = 「本人 user scope / 显式 operator / `org:` 键的目录成员」(见 {@link gateMemoryScope}), * 越界一律 404(零存在性 oracle)。本域零可变状态。 */ import type { IncomingMessage, ServerResponse } from "node:http"; import type { RouteCtx, RouteMatch, RouteIdsOf } from "../route-ctx.js"; /** * [ref] 件3([ref] A2 车立的欠账,[ref] 我方认领)—— `GET /v1/memory/export` 的 keyset 分页上限。 * * 在此之前本面是**整盘导出**:一个几千条目的盘就是一个几 MB 的响应体,壳侧(sema-web-admin 只读页) * 无从分次要 —— 那是它真实撞到的天花板。分页是 **additive** 的:`?limit=` 缺席 ⇒ 旧契约逐字不变 * (全量数组、响应键一个不多),所以现行消费端零破坏;要分页的调用方自己带 `limit` 进来。 * * ⚠️ 诚实记档:本面的分页封的是**回体**(wire 天花板),不是 DB 读 —— reader * (`exportMemoryScope`)仍是整 scope 一次读出。真正的下推需要 core 的 `MemoryBackend.listHeaders` * 长出分页参数(上游接缝,源头修复纪律:不在本层用别的口硬凑)。壳侧的痛点(响应体大小/首屏)由 * 本形解决,库侧的读放大另案。 */ export declare const MEMORY_EXPORT_MAX_LIMIT = 500; /** 路由体 = 从 `server.ts` 的 `handle()` 里**整段剪切**过来的原文(唯一改动:统一去缩进两格)。裸 `return;` * 的语义原样 =「本域已应答」;走到函数尾才是「没匹配上」,置 `miss.fell` 交回装配器继续下一个域。 * 跨域的东西(deps / 助手 / 单域状态)一律在首行解构出来,于是下面每一行都逐字不变。 */ export declare function handleMemoryPolicy(req: IncomingMessage, res: ServerResponse, match: RouteMatch, ctx: RouteCtx): Promise; export declare const MEMORY_POLICY_ROUTES: readonly [{ readonly id: "memory-export"; readonly path: "/v1/memory/export"; readonly methods: readonly ["GET"]; }, { readonly id: "policy"; readonly path: "/v1/policy"; readonly methods: readonly ["GET"]; }, { readonly id: "memory-sync-scope"; readonly pattern: RegExp; readonly label: "/v1/memory/sync/:scope"; readonly methods: readonly ["POST"]; }]; /** 本域可分派行的 `id` 闭集 —— handler 的 `switch` 按它判穷尽(漏一口 = 编译红)。 */ export type MemoryPolicyRouteId = RouteIdsOf; //# sourceMappingURL=memory-policy.d.ts.map