@faapi/faapi 6.9.0 → 6.9.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
@@ -1505,6 +1505,13 @@ declare function loadEnv(rootDir: string): void;
1505
1505
  * 纯编程式不调本函数时 env 不生效。
1506
1506
  */
1507
1507
  declare function configureLogging(config?: LogConfig | boolean | undefined): void;
1508
+ /**
1509
+ * 刷盘文件日志缓冲(不结束流,flush 后可继续写)
1510
+ *
1511
+ * 优雅停机场景在 `lifecycle.onClose` 调用,确保缓冲中的条目落盘后再退出进程;
1512
+ * 测试场景断言文件内容前调用。无文件管道(未配置 `config.log.dir`)时为 no-op。
1513
+ */
1514
+ declare function flushLogging(): Promise<void>;
1508
1515
  /**
1509
1516
  * 创建日志器
1510
1517
  *
@@ -1713,4 +1720,4 @@ type ProdApp = AppBase;
1713
1720
  */
1714
1721
  declare function createProdApp(options?: CreateAppOptions): Promise<ProdApp>;
1715
1722
 
1716
- export { type AgentConfig, AgentCore, AgentMetadata, type AgentModule, type ProdApp as App, AppRegistries, CorsOptions, type CreateAppOptions, CreateLoggerOptions, type CronScheduler, type DevApp, type FaapiConfig, FaapiContext, FaapiError, FaapiMiddleware, type FaapiPlugin, type HandlerTypeInfo, HelmetOptions, type InjectOptions, type InjectResponse, InjectorMap, InternalError, type LifecycleContext, type LifecycleHooks, type LlmConfig, type LlmModelConfig, LogConfig, Logger, LoggerOptions, MethodNotAllowedError, ModuleLoadError, type PluginContext, type PluginDeclaration, type ProdApp, type PropertyType, type RequestHandler, type ResponseConfig, RouteManifest, RouteNotFoundError, type RouteSchemaSource, type RuntimeType, SchemaExtractionError, TASK_PATTERNS, type TaskBullMqOptions, TaskClient, type TaskConfig, TaskDriver, TaskFailedHandler, TaskManifest, type TaskPgBossOptions, TaskQueue, TaskRegistry, ToolMetadata, type ToolModule, type ToolSchemaModule, type TypeConstraint, type UpgradeHandler, ValidationError, type ValidationErrorCode, type ValidationIssue, type WsContext, type WsEventHandlers, type WsHandler, type WsSocket, clearAgentHandleFactory, collectRouteSchemaSources, configureLogging, createProdApp as createApp, createCronScheduler, createDevApp, createLogger, createProdApp, createProgram, createPrograms, createTaskQueue, extractTypeInfo, getAgent, getAgentEntry, getApp, getInputTypeForMethod, getSkill, getTool, getToolSchemaPath, hydrateSkillRegistry, invalidateProgramCache, listSkills, loadAgentModule, loadConfig, loadEnv, loadTaskDriver, loadToolModule, loadToolSchema, registerAgentHandleFactory, removeSkill, resolveAgentTools, resolveSubAgents, resolveTypeNode, scanTasks, upsertSkill };
1723
+ export { type AgentConfig, AgentCore, AgentMetadata, type AgentModule, type ProdApp as App, AppRegistries, CorsOptions, type CreateAppOptions, CreateLoggerOptions, type CronScheduler, type DevApp, type FaapiConfig, FaapiContext, FaapiError, FaapiMiddleware, type FaapiPlugin, type HandlerTypeInfo, HelmetOptions, type InjectOptions, type InjectResponse, InjectorMap, InternalError, type LifecycleContext, type LifecycleHooks, type LlmConfig, type LlmModelConfig, LogConfig, Logger, LoggerOptions, MethodNotAllowedError, ModuleLoadError, type PluginContext, type PluginDeclaration, type ProdApp, type PropertyType, type RequestHandler, type ResponseConfig, RouteManifest, RouteNotFoundError, type RouteSchemaSource, type RuntimeType, SchemaExtractionError, TASK_PATTERNS, type TaskBullMqOptions, TaskClient, type TaskConfig, TaskDriver, TaskFailedHandler, TaskManifest, type TaskPgBossOptions, TaskQueue, TaskRegistry, ToolMetadata, type ToolModule, type ToolSchemaModule, type TypeConstraint, type UpgradeHandler, ValidationError, type ValidationErrorCode, type ValidationIssue, type WsContext, type WsEventHandlers, type WsHandler, type WsSocket, clearAgentHandleFactory, collectRouteSchemaSources, configureLogging, createProdApp as createApp, createCronScheduler, createDevApp, createLogger, createProdApp, createProgram, createPrograms, createTaskQueue, extractTypeInfo, flushLogging, getAgent, getAgentEntry, getApp, getInputTypeForMethod, getSkill, getTool, getToolSchemaPath, hydrateSkillRegistry, invalidateProgramCache, listSkills, loadAgentModule, loadConfig, loadEnv, loadTaskDriver, loadToolModule, loadToolSchema, registerAgentHandleFactory, removeSkill, resolveAgentTools, resolveSubAgents, resolveTypeNode, scanTasks, upsertSkill };
package/dist/index.js CHANGED
@@ -2435,6 +2435,9 @@ function writeLogEntry(entry) {
2435
2435
  if (belowThreshold(entry.level, globalThreshold())) return;
2436
2436
  globalDispatch(entry);
2437
2437
  }
2438
+ function flushLogging() {
2439
+ return globalState.fileSink ? globalState.fileSink.flush() : Promise.resolve();
2440
+ }
2438
2441
  function isAccessLogPiped() {
2439
2442
  return !globalState.disabled && globalState.accessLog;
2440
2443
  }
@@ -7671,6 +7674,7 @@ export {
7671
7674
  createTaskRegistriesView,
7672
7675
  createTaskRegistry,
7673
7676
  extractTypeInfo,
7677
+ flushLogging,
7674
7678
  getAgent,
7675
7679
  getAgentEntry,
7676
7680
  getApp,