@faapi/faapi 6.12.0 → 6.14.0
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/dist/cli/index.js +12 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/dist/{routeTypes-m9wZHWyo.d.ts → routeTypes-C7yHYxPg.d.ts} +13 -2
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +3 -1
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
|
@@ -86,6 +86,15 @@ interface AgentCore {
|
|
|
86
86
|
model?: string;
|
|
87
87
|
/** 最大对话轮数(config 块字面量提取),未声明时为 `undefined`;声明了但非数字字面量在构建期抛错 */
|
|
88
88
|
maxTurns?: number;
|
|
89
|
+
/**
|
|
90
|
+
* agent-as-tool 派发交接单说明(config 块字面量提取),未声明时为 `undefined`;
|
|
91
|
+
* 声明了但非字面量在构建期抛错
|
|
92
|
+
*
|
|
93
|
+
* 该 agent 被其他 agent 当 tool 派发时(`agents` 列表引用),工具 `input` 字段的
|
|
94
|
+
* schema description——告诉主控 LLM 该传什么样的交接单;未声明时 `@faapi/agent`
|
|
95
|
+
* 的 `buildToolDefinitions` 用框架默认文案
|
|
96
|
+
*/
|
|
97
|
+
inputDescription?: string;
|
|
89
98
|
}
|
|
90
99
|
/**
|
|
91
100
|
* Agent 完整元数据(文件型 agent)
|
|
@@ -105,7 +114,7 @@ interface AgentCore {
|
|
|
105
114
|
* - `name` — `@agent` JSDoc 覆盖值,或 `pathMeta.name`(目录推导)
|
|
106
115
|
* - `filePath` / `hasRun` — 由 `pathMeta` 透传
|
|
107
116
|
* - `description` — JSDoc 注释块自由文本(对 LLM 可见)
|
|
108
|
-
* - `systemPrompt` / `tools` / `agents` / `model` / `maxTurns` — config 块字面量提取
|
|
117
|
+
* - `systemPrompt` / `tools` / `agents` / `model` / `maxTurns` / `inputDescription` — config 块字面量提取
|
|
109
118
|
*/
|
|
110
119
|
interface AgentMetadata extends AgentCore {
|
|
111
120
|
/** 源码相对路径(从 `pathMeta` 透传),`loadAgentModule` 据此加载 `handler.js` 提取 `run` */
|
|
@@ -752,7 +761,9 @@ type TaskFailedHandler = (info: TaskFailedInfo) => Promise<void> | void;
|
|
|
752
761
|
*
|
|
753
762
|
* 设计要点:
|
|
754
763
|
* - writer 内部用 ReadableStream + TextEncoder,send 时 enqueue,close 时 close controller
|
|
755
|
-
* - response 预设 text/event-stream、no-cache、keep-alive 头,状态码默认 200
|
|
764
|
+
* - response 预设 text/event-stream、no-cache、keep-alive、X-Accel-Buffering: no 头,状态码默认 200
|
|
765
|
+
* (X-Accel-Buffering: no 让 nginx 按响应跳过 proxy_buffering,SSE 小包不被攒到流结束才下发;
|
|
766
|
+
* 非 nginx 反代不识别该头,当普通自定义头透传)
|
|
756
767
|
* - close 后再 send 静默忽略,避免 handler 异步流程中误写已关闭的流
|
|
757
768
|
* - sendError 向流写入 event: error 后关闭,用于流式输出中报错的优雅终止
|
|
758
769
|
*
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as FaapiContext, F as FaapiMiddleware, I as InjectorMap, R as RouteManifest, W as WsRouteManifest, C as CorsOptions, H as HelmetOptions } from './routeTypes-
|
|
1
|
+
import { a as FaapiContext, F as FaapiMiddleware, I as InjectorMap, R as RouteManifest, W as WsRouteManifest, C as CorsOptions, H as HelmetOptions } from './routeTypes-C7yHYxPg.js';
|
|
2
2
|
import { Server } from 'node:http';
|
|
3
3
|
import { WebSocket } from 'ws';
|
|
4
4
|
|
package/dist/testing.js
CHANGED
|
@@ -123,7 +123,9 @@ function createSseWriter() {
|
|
|
123
123
|
headers: {
|
|
124
124
|
"Content-Type": "text/event-stream",
|
|
125
125
|
"Cache-Control": "no-cache",
|
|
126
|
-
Connection: "keep-alive"
|
|
126
|
+
Connection: "keep-alive",
|
|
127
|
+
// nginx 认到该头后按响应跳过 proxy_buffering;其他反代/客户端忽略,无副作用
|
|
128
|
+
"X-Accel-Buffering": "no"
|
|
127
129
|
}
|
|
128
130
|
});
|
|
129
131
|
const writer = {
|