@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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FaapiMiddleware, A as AppRegistries, R as RouteManifest, a as FaapiContext, C as CorsOptions, T as TaskClient, H as HelmetOptions, L as LogConfig, I as InjectorMap, b as TaskFailedHandler, c as TaskQueueDeps, d as TaskQueue, e as TaskDriver, f as TaskRegistry, g as TaskManifest, h as ToolMetadata, i as AgentCore, j as AgentMetadata, k as CreateLoggerOptions, l as Logger, W as WsRouteManifest } from './routeTypes-m9wZHWyo.js';
2
- export { m as AgentHandleFactory, n as AgentHandleStore, o as AgentPathMeta, p as AgentRegistry, q as AgentToolDescriptor, r as FaapiContextConfig, s as FaapiTaskMeta, t as FailOptions, u as Injector, v as LogEntry, w as LogLevel, x as LogSink, y as RouteInfo, z as RouteInputSchema, B as RouteOutputSchema, D as RouteParamSchema, S as SkillRegistry, E as SseEvent, G as SseWriter, J as TaskContext, K as TaskDriverJob, M as TaskDriverProcess, N as TaskDriverRecord, O as TaskFailedInfo, P as TaskJob, Q as TaskJobStatus, U as TaskMetadata, V as TaskModule, X as TaskRegistriesSnapshot, Y as TaskRegistriesView, Z as ToolCore, _ as ToolPathMeta, $ as ToolRegistry, a0 as cors, a1 as createAppRegistries, a2 as createTaskRegistriesView, a3 as createTaskRegistry, a4 as helmet } from './routeTypes-m9wZHWyo.js';
1
+ import { F as FaapiMiddleware, A as AppRegistries, R as RouteManifest, a as FaapiContext, C as CorsOptions, T as TaskClient, H as HelmetOptions, L as LogConfig, I as InjectorMap, b as TaskFailedHandler, c as TaskQueueDeps, d as TaskQueue, e as TaskDriver, f as TaskRegistry, g as TaskManifest, h as ToolMetadata, i as AgentCore, j as AgentMetadata, k as CreateLoggerOptions, l as Logger, W as WsRouteManifest } from './routeTypes-C7yHYxPg.js';
2
+ export { m as AgentHandleFactory, n as AgentHandleStore, o as AgentPathMeta, p as AgentRegistry, q as AgentToolDescriptor, r as FaapiContextConfig, s as FaapiTaskMeta, t as FailOptions, u as Injector, v as LogEntry, w as LogLevel, x as LogSink, y as RouteInfo, z as RouteInputSchema, B as RouteOutputSchema, D as RouteParamSchema, S as SkillRegistry, E as SseEvent, G as SseWriter, J as TaskContext, K as TaskDriverJob, M as TaskDriverProcess, N as TaskDriverRecord, O as TaskFailedInfo, P as TaskJob, Q as TaskJobStatus, U as TaskMetadata, V as TaskModule, X as TaskRegistriesSnapshot, Y as TaskRegistriesView, Z as ToolCore, _ as ToolPathMeta, $ as ToolRegistry, a0 as cors, a1 as createAppRegistries, a2 as createTaskRegistriesView, a3 as createTaskRegistry, a4 as helmet } from './routeTypes-C7yHYxPg.js';
3
3
  import * as node_http from 'node:http';
4
4
  import { Server, IncomingMessage, ServerResponse } from 'node:http';
5
5
  import { Socket } from 'node:net';
package/dist/index.js CHANGED
@@ -4633,7 +4633,9 @@ function createSseWriter() {
4633
4633
  headers: {
4634
4634
  "Content-Type": "text/event-stream",
4635
4635
  "Cache-Control": "no-cache",
4636
- Connection: "keep-alive"
4636
+ Connection: "keep-alive",
4637
+ // nginx 认到该头后按响应跳过 proxy_buffering;其他反代/客户端忽略,无副作用
4638
+ "X-Accel-Buffering": "no"
4637
4639
  }
4638
4640
  });
4639
4641
  const writer = {
@@ -6300,7 +6302,7 @@ function extractAgentMetadata(program, filePath, pathMeta) {
6300
6302
  const jsDoc = getJSDocFromNode(configFound.jsDocOwner);
6301
6303
  const description = extractDescription(jsDoc);
6302
6304
  const agentNameOverride = extractJSDocTagValue(jsDoc, "agent");
6303
- const { systemPrompt, tools, agents, model, maxTurns } = extractConfigFields(
6305
+ const { systemPrompt, tools, agents, model, maxTurns, inputDescription } = extractConfigFields(
6304
6306
  objectLiteral,
6305
6307
  sourceFile
6306
6308
  );
@@ -6313,7 +6315,8 @@ function extractAgentMetadata(program, filePath, pathMeta) {
6313
6315
  tools,
6314
6316
  agents,
6315
6317
  model,
6316
- maxTurns
6318
+ maxTurns,
6319
+ inputDescription
6317
6320
  };
6318
6321
  }
6319
6322
  function findConfigExport(sourceFile) {
@@ -6362,6 +6365,7 @@ function extractConfigFields(objLit, sourceFile) {
6362
6365
  let agents;
6363
6366
  let model;
6364
6367
  let maxTurns;
6368
+ let inputDescription;
6365
6369
  for (const prop of objLit.properties) {
6366
6370
  if (ts10.isSpreadAssignment(prop)) continue;
6367
6371
  if (!ts10.isPropertyAssignment(prop)) {
@@ -6392,11 +6396,14 @@ function extractConfigFields(objLit, sourceFile) {
6392
6396
  case "maxTurns":
6393
6397
  maxTurns = requireNumberValue(prop, "maxTurns", sourceFile);
6394
6398
  break;
6399
+ case "inputDescription":
6400
+ inputDescription = requireStringValue(prop, "inputDescription", sourceFile);
6401
+ break;
6395
6402
  default:
6396
6403
  throw SchemaExtractionError.at(
6397
6404
  prop,
6398
6405
  `config.${propName}`,
6399
- "\u672A\u77E5 config \u5B57\u6BB5\u2014\u2014\u4EC5\u652F\u6301 systemPrompt / tools / agents / model / maxTurns",
6406
+ "\u672A\u77E5 config \u5B57\u6BB5\u2014\u2014\u4EC5\u652F\u6301 systemPrompt / tools / agents / model / maxTurns / inputDescription",
6400
6407
  sourceFile
6401
6408
  );
6402
6409
  }
@@ -6409,7 +6416,7 @@ function extractConfigFields(objLit, sourceFile) {
6409
6416
  sourceFile
6410
6417
  );
6411
6418
  }
6412
- return { systemPrompt, tools, agents, model, maxTurns };
6419
+ return { systemPrompt, tools, agents, model, maxTurns, inputDescription };
6413
6420
  }
6414
6421
  function getPropertyName(name) {
6415
6422
  if (ts10.isIdentifier(name)) return name.text;