Releases: Tosd0/ReiStandard
Release list
@rei-standard/amsg-server@2.6.0-next.5
Minor Changes
-
ca31c9e: onBeforeFire 新增
{ skip: true }出口:在第一次 LLM 调用之前结束本次 fire宿主在 fire 时刻就能判断这条消息已经多余(比如排程之后对话又有了新进展)时,
onBeforeFire返回{ skip: true }即可作废本次触发。这次 fire 算作一次零推送的成功投递(status: 'skipped'):一次性任务照删、循环任务照推进到下次,且不调用 LLM、不消耗 token。返回
null的既有语义不变(回退到排程时冻结的 completePrompt 老链路)。 -
81133e4:
GET /messages每条任务额外返回charId/clientTaskId(取自任务 metadata 的charId/amsgClientTaskId,缺省为 null),供宿主按角色归属筛选任务。metadata 的其余字段不回传,凭据类字段照旧不回传。
@rei-standard/amsg-server@2.6.0-next.4
Minor Changes
-
f13f2f1: fire 级 scratch:hook 之间传上下文不再自己维护 Map
单次 fire 开始时库创建一个空对象,
onBeforeFire的 fireCtx 和同一次 fire 里每轮onLLMOutput/executeToolCalls的 sessionCtx 都拿到同一个scratch引用;fire 结束(finish / skip-push / 抛错 / 轮数超限)后随之丢弃。不落库、不进日志、不跨 fire 共享。amsg-shared 的buildSessionContext新增可选scratch参数(不传则字段缺席,amsg-instant 行为不变)。 -
f13f2f1:
GET /capabilities特性探测端点 + 客户端getCapabilities()worker 部署版本落后时,新功能只是「探测不到」而不是静默失效。单用户 worker 新增
GET /capabilities,返回{ serverVersion, features }(feature 名如client-state/client-state-chunking/agentic-hooks,随版本演进追加;表达代码能力,不反映部署配置);鉴权与/vapid-public-key一致。客户端 SDK 新增getCapabilities():打到没有该路由的老 worker(404)返回null不抛错,前端可据此在设置里提示「worker 需要重新部署」。 -
f13f2f1: client_state 大值透明分块 + 整批局部失败(单用户 worker)
PUT /client-state单条 value 不再受 200KB 整批 413 的限制:超过 200KB 的值由服务端切片跨行存储,GET /client-state与 hook 的ctx.readState()返回拼好的原值,客户端和 hook 作者无感。单条总上限默认 5MB,工厂配置maxStateValueBytes可调。切片在码点边界(中文 / emoji 不会被劈开);覆盖写变小不残留旧切片;块不齐全(写到一半断了)时该 key 视为不存在,读方走自己的兜底。- 整批局部失败:批里某条超限 / 非法只拒它自己,其余照常入库。有拒绝时响应带
data.rejected: [{ index, namespace, key, code, message }];全部成功时响应形状与之前完全一致。 - namespace / key 里的控制字符(
\u0000-\u001f)为库内部保留,逐条拒绝。 - adapter 的
upsertClientState新增可选第三参cleanups与返回值outcomes;自定义 adapter 不实现也能工作(只损失存储卫生,不影响正确性)。 DELETE /client-state返回的deleted计数包含内部切片行(有分块值时会大于逻辑条目数)。
Patch Changes
- Updated dependencies [f13f2f1]
- @rei-standard/amsg-shared@0.4.0-next.1
@rei-standard/amsg-client@2.9.0-next.4
Minor Changes
-
f13f2f1:
GET /capabilities特性探测端点 + 客户端getCapabilities()worker 部署版本落后时,新功能只是「探测不到」而不是静默失效。单用户 worker 新增
GET /capabilities,返回{ serverVersion, features }(feature 名如client-state/client-state-chunking/agentic-hooks,随版本演进追加;表达代码能力,不反映部署配置);鉴权与/vapid-public-key一致。客户端 SDK 新增getCapabilities():打到没有该路由的老 worker(404)返回null不抛错,前端可据此在设置里提示「worker 需要重新部署」。
Patch Changes
- Updated dependencies [f13f2f1]
- @rei-standard/amsg-shared@0.4.0-next.1
@rei-standard/amsg-sw@2.3.3-next.0
@rei-standard/amsg-server@2.6.0-next.3
Minor Changes
-
914ddcf: 单用户 / Cloudflare 模式新增「fire 时刻现场生成」能力:
- 新表
client_state(init-tenant 幂等建表)+ 三个端点:PUT /client-state批量上传状态(按updatedAtlast-write-wins,单条 value ≤ 200KB)、GET /client-state?namespace=读取、DELETE /client-state清空。value 用 per-user key 加密落库,鉴权与加密头沿用现有端点。 createSingleUserCloudflareWorker的 config 接受可选hooks: { onBeforeFire, onLLMOutput, executeToolCalls }与maxToolIterations(默认 5)、totalTimeoutMs(默认 240000,两者都可在 onBeforeFire 返回值里按次覆盖)。配置后,AI 类任务在触发时由 onBeforeFire 现场组装 messages(可经ctx.readState(namespace)读 client_state),工具在 worker 内就地执行、多轮循环闭环后推送成品;onLLMOutput 的 ctx 与 decision 契约与@rei-standard/amsg-instant的同名 hook 一致,instant 的 classifier 可直接复用(tool-request同时接受toolCalls直传与 tool_request pushPayloads 两种形状)。- 不配 hooks、或 onBeforeFire 返回 null 时,任务照走排程时冻结的 completePrompt 老链路;固定文本任务永远走老链路。hook ctx 不含 apiKey / pushSubscription / VAPID。多租户入口(Netlify/Neon)行为不变。
- 新表
Patch Changes
- Updated dependencies [914ddcf]
- @rei-standard/amsg-shared@0.4.0-next.0
@rei-standard/amsg-instant@0.10.1-next.0
Patch Changes
- 914ddcf: amsg-shared 新增 agentic 循环契约工具:
buildSessionContext、extractAssistantMessage、assertValidDecision(新增inlineToolCalls选项,允许tool-request直接携带toolCalls,供服务端就地执行工具的场景用)、extractToolCallsFromDecision。amsg-instant 的 SessionContext 构建与 decision 校验改为从 amsg-shared 复用同一实现,对外行为与错误信息不变。 - Updated dependencies [914ddcf]
- @rei-standard/amsg-shared@0.4.0-next.0
@rei-standard/amsg-client@2.9.0-next.3
Minor Changes
-
a26b797: 新增 client_state 三方法,对接单用户 worker 的云端状态镜像(amsg-server 2.6.0 的
/client-state端点)。putClientState(entries):批量 upsert。一次请求发完全部变更(照顾 iOS 切后台前只有几秒的存活窗口);请求体走既有加密链路(需先init()),服务端按updatedAt最后写赢,重发旧批次无害。getClientState(namespace):取一个 namespace 的全部条目,自动解密响应 envelope(同listMessages)。clearClientState():清空该用户全部云端状态(给设置页「清除云端状态」这类入口用)。
配了
serverToken时三个方法都带X-Client-Token。