@faapi/faapi 6.17.0 → 6.18.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/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-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';
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-BAhPIzcG.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-BAhPIzcG.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';
@@ -1601,6 +1601,13 @@ interface ValidationIssue {
1601
1601
  }
1602
1602
  type ValidationErrorCode = 'TYPE_MISMATCH' | 'MISSING_FIELD' | 'INVALID_FORMAT' | 'INVALID_VALUE' | 'COERCE_FAILED';
1603
1603
 
1604
+ /**
1605
+ * 无服务器注入(app.inject)的 mock HTTP 实现
1606
+ *
1607
+ * 从 createAppCore 拆出——约 110 行「手工模拟 IncomingMessage/ServerResponse + 走
1608
+ * 真实 request listener」的实现与编排主流程无关。真实请求链路(中间件/路由/校验/
1609
+ * handler)不受影响:mock 只替换传输层。
1610
+ */
1604
1611
  interface InjectOptions {
1605
1612
  method?: string;
1606
1613
  path?: string;
@@ -1629,6 +1636,7 @@ interface InjectResponse {
1629
1636
  */
1630
1637
  body: unknown;
1631
1638
  }
1639
+
1632
1640
  /**
1633
1641
  * 获取当前 faapi app 单例
1634
1642
  *
@@ -1657,6 +1665,7 @@ interface InjectResponse {
1657
1665
  * ```
1658
1666
  */
1659
1667
  declare function getApp(): AppBase;
1668
+
1660
1669
  interface CreateAppOptions {
1661
1670
  /** 项目根目录,默认 process.cwd() */
1662
1671
  rootDir?: string;
@@ -1696,7 +1705,7 @@ interface AppBase {
1696
1705
  inject(options?: InjectOptions): Promise<InjectResponse>;
1697
1706
  }
1698
1707
 
1699
- /** dev 应用接口(AppBase + reloadRoutes/reloadTools/reloadAgents 热替换) */
1708
+ /** dev 应用接口(AppBase + reloadRoutes/reloadTools/reloadAgents/reloadTasks/reloadAll 热替换) */
1700
1709
  interface DevApp extends AppBase {
1701
1710
  /** 重新水合路由清单 + 清 schema 缓存 + 更新 server 路由引用(dev 热替换用) */
1702
1711
  reloadRoutes(): Promise<void>;
@@ -1706,6 +1715,11 @@ interface DevApp extends AppBase {
1706
1715
  reloadAgents(): Promise<void>;
1707
1716
  /** 重新扫描 tasks + 重编译任务源码 + 重生成 faapi-tasks.js + 清队列缓存(dev 热替换用) */
1708
1717
  reloadTasks(): Promise<void>;
1718
+ /**
1719
+ * 一轮 watcher 重建的批量热替换:依次执行四个 reload*,但 Program 缓存只在
1720
+ * 开头失效一次(watcher 专用——逐个直调 reload* 时各自失效,语义不变)
1721
+ */
1722
+ reloadAll(): Promise<void>;
1709
1723
  }
1710
1724
  /**
1711
1725
  * dev 模式应用启动 API