@dudousxd/nestjs-agent 0.13.0 → 1.0.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.cjs CHANGED
@@ -3054,18 +3054,11 @@ function routerFor(path) {
3054
3054
  ]);
3055
3055
  }
3056
3056
  __name(routerFor, "routerFor");
3057
- function assertDispatchedStepsRequiresDurable(dispatchedSteps, durable) {
3058
- if (dispatchedSteps && !durable) {
3059
- throw new Error("AgentModule dispatchedSteps: true requires durable: true \u2014 dispatched steps are routed durable steps (AgentRunSteps.llm/tool) with no in-process equivalent.");
3060
- }
3061
- }
3062
- __name(assertDispatchedStepsRequiresDurable, "assertDispatchedStepsRequiresDurable");
3063
3057
  var AgentModule = class _AgentModule {
3064
3058
  static {
3065
3059
  __name(this, "AgentModule");
3066
3060
  }
3067
3061
  static forRoot(options) {
3068
- assertDispatchedStepsRequiresDurable(options.dispatchedSteps ?? false, options.durable ?? false);
3069
3062
  const path = options.path ?? DEFAULT_PATH;
3070
3063
  const includeStore = options.store !== void 0;
3071
3064
  applyGuards(options.guards);
@@ -3089,7 +3082,6 @@ var AgentModule = class _AgentModule {
3089
3082
  };
3090
3083
  }
3091
3084
  static forRootAsync(options) {
3092
- assertDispatchedStepsRequiresDurable(options.dispatchedSteps ?? false, options.durable ?? false);
3093
3085
  const path = options.path ?? DEFAULT_PATH;
3094
3086
  const includeStore = options.externalStore !== true;
3095
3087
  applyGuards(options.guards);
@@ -3105,20 +3097,16 @@ var AgentModule = class _AgentModule {
3105
3097
  providers: [
3106
3098
  {
3107
3099
  provide: import_nestjs_agent_core19.AGENT_OPTIONS,
3108
- // Stamp the STATIC wiring flags onto the factory result: `durable`/`dispatchedSteps`/
3109
- // `surface` are authoritative on the async config object (they decided the actual wiring
3110
- // above), and `AgentDurableModule` derives the effective dispatched-steps value from
3111
- // AGENT_OPTIONS — without this stamp, an async host would get in-process localSteps
3112
- // despite durable: true. `surface` isn't read back by anything today (AgentDurableModule
3113
- // takes its own mirror option — see its doc for why), but it's stamped here too so the
3114
- // EFFECTIVE value is always observable off AGENT_OPTIONS, sync or async alike.
3100
+ // Stamp the STATIC wiring flags onto the factory result: `durable`/`surface` are
3101
+ // authoritative on the async config object (they decided the actual wiring above), and
3102
+ // the durable module reads `durable` back off AGENT_OPTIONS. `surface` isn't read back by
3103
+ // anything today (AgentDurableModule takes its own mirror option — see its doc for why),
3104
+ // but it's stamped here too so the EFFECTIVE value is always observable off
3105
+ // AGENT_OPTIONS, sync or async alike.
3115
3106
  useFactory: /* @__PURE__ */ __name(async (...args) => ({
3116
3107
  ...await options.useFactory(...args),
3117
3108
  durable: options.durable ?? false,
3118
- surface: options.surface ?? "both",
3119
- ...options.dispatchedSteps !== void 0 ? {
3120
- dispatchedSteps: options.dispatchedSteps
3121
- } : {}
3109
+ surface: options.surface ?? "both"
3122
3110
  }), "useFactory"),
3123
3111
  inject: options.inject ?? []
3124
3112
  },