@tansr/serve 0.8.0 → 0.8.1
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/README.md +19 -1
- package/dist/index.d.ts +602 -514
- package/dist/index.js +136 -140
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,6 +32,24 @@ npm install @tansr/serve
|
|
|
32
32
|
(`@tansr/protocol`、`@tansr/i18n`、`@tansr/kernel`、`@tansr/providers`、
|
|
33
33
|
`@tansr/sdk`)已编译内联,恒不外泄安装面。
|
|
34
34
|
|
|
35
|
+
## 系统媒体工具 / System media tools
|
|
36
|
+
|
|
37
|
+
图像生成、视频生成、语音转文字和文字转语音均由内核系统工具执行,工具名为
|
|
38
|
+
`ImageGen`、`VideoGen`、`SpeechToText`、`TextToSpeech`。平台内置会话工厂根据应用能力
|
|
39
|
+
装配它们,并使用 SDK 的平台提供方调用授权模型;`capabilities.platform` 表示平台服务
|
|
40
|
+
授权,不表示独立的“平台工具”类别。平台令牌、模型权限、配额、计费及运行时权限继续生效。
|
|
41
|
+
|
|
42
|
+
Android/iOS 经 `/v2` 会话连接时,模型与系统媒体工具运行在开发者的 serve 进程中,
|
|
43
|
+
手机负责提交输入和展示真实工具事件/媒体产物,不因此取得服务端文件或终端命令权限。
|
|
44
|
+
用户主动录音转写、朗读使用既有音频直连端点;它们与模型调用媒体工具并存,不自动进入聊天历史。
|
|
45
|
+
SDK 进程内集成仍须通过 `tools.builtin` 显式选择四媒体;这与 serve 平台工厂按应用授权装配的入口不同。
|
|
46
|
+
|
|
47
|
+
Image generation, video generation, transcription, and speech synthesis are built-in system tools.
|
|
48
|
+
The platform session factory assembles the authorized tools with platform-backed providers.
|
|
49
|
+
`capabilities.platform` retains its service-authorization meaning. On Android and iOS, these tools
|
|
50
|
+
run in the serve process; the mobile client renders their events and artifacts. User-triggered audio
|
|
51
|
+
operations use the separate direct endpoints and do not fabricate model tool events or chat history.
|
|
52
|
+
|
|
35
53
|
## 集成骨架
|
|
36
54
|
|
|
37
55
|
```ts
|
|
@@ -586,7 +604,7 @@ build.upstreamStats?.(); // { tokenMinter: { inflight, queued, mints,
|
|
|
586
604
|
同批铸出的令牌不再同刻进入刷新窗;某 endUser 铸造失败后窗内不再出网(直接回同一错),
|
|
587
605
|
刷新失败但旧令牌仍在时效内直接沿用旧令牌;`warm(endUserIds)` 可在启动期预热。
|
|
588
606
|
- **令牌失效反馈(十王修案 FX-C-15 / R-02)**:平台对携 `x-tansr-app-token` 的请求(模型 exchange / bundle /
|
|
589
|
-
|
|
607
|
+
系统工具的平台提供方)回 `401 { error: { code: 'unauthorized', detail: { reason } } }` 时,刷新 fetch 在**同一请求内**
|
|
590
608
|
`minter.invalidate`(仅当缓存现值仍是本次所携令牌)→ 重铸 → 重发**恰一次**;重试仍 401 则原样交回(每请求至多
|
|
591
609
|
一次重铸,恒不循环)。`reason === 'check_unavailable'`(平台校验依赖瞬态不可用)不失效、不重铸;其余码 /
|
|
592
610
|
403 / 无信封亦不触发。此前吊销令牌后 serve 拿旧令牌 ≈ 55 min 恒 401。计数:`stats().invalidations{reason}`
|