@dudousxd/nestjs-agent 0.9.0 → 0.10.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
@@ -1961,6 +1961,10 @@ function controllersFor(mountAttachments) {
1961
1961
  ] : BASE_CONTROLLERS;
1962
1962
  }
1963
1963
  __name(controllersFor, "controllersFor");
1964
+ function controllersForSurface(surface, mountAttachments) {
1965
+ return surface === "engine" ? [] : controllersFor(mountAttachments);
1966
+ }
1967
+ __name(controllersForSurface, "controllersForSurface");
1964
1968
  var GUARDS_METADATA = "__guards__";
1965
1969
  function applyGuards(guards) {
1966
1970
  const resolved = guards ?? [];
@@ -2006,7 +2010,7 @@ var AgentModule = class _AgentModule {
2006
2010
  import_core3.DiscoveryModule,
2007
2011
  routerFor(path)
2008
2012
  ],
2009
- controllers: controllersFor(options.attachments?.upload === true),
2013
+ controllers: controllersForSurface(options.surface, options.attachments?.upload === true),
2010
2014
  providers: [
2011
2015
  {
2012
2016
  provide: import_nestjs_agent_core14.AGENT_OPTIONS,
@@ -2031,17 +2035,21 @@ var AgentModule = class _AgentModule {
2031
2035
  routerFor(path),
2032
2036
  ...options.imports ?? []
2033
2037
  ],
2034
- controllers: controllersFor(options.attachmentsUpload === true),
2038
+ controllers: controllersForSurface(options.surface, options.attachmentsUpload === true),
2035
2039
  providers: [
2036
2040
  {
2037
2041
  provide: import_nestjs_agent_core14.AGENT_OPTIONS,
2038
- // Stamp the STATIC wiring flags onto the factory result: `durable`/`dispatchedSteps` are
2039
- // authoritative on the async config object (they decided the actual wiring above), and
2040
- // `AgentDurableModule` derives the effective dispatched-steps value from AGENT_OPTIONS —
2041
- // without this stamp, an async host would get in-process localSteps despite durable: true.
2042
+ // Stamp the STATIC wiring flags onto the factory result: `durable`/`dispatchedSteps`/
2043
+ // `surface` are authoritative on the async config object (they decided the actual wiring
2044
+ // above), and `AgentDurableModule` derives the effective dispatched-steps value from
2045
+ // AGENT_OPTIONS — without this stamp, an async host would get in-process localSteps
2046
+ // despite durable: true. `surface` isn't read back by anything today (AgentDurableModule
2047
+ // takes its own mirror option — see its doc for why), but it's stamped here too so the
2048
+ // EFFECTIVE value is always observable off AGENT_OPTIONS, sync or async alike.
2042
2049
  useFactory: /* @__PURE__ */ __name(async (...args) => ({
2043
2050
  ...await options.useFactory(...args),
2044
2051
  durable: options.durable ?? false,
2052
+ surface: options.surface ?? "both",
2045
2053
  ...options.dispatchedSteps !== void 0 ? {
2046
2054
  dispatchedSteps: options.dispatchedSteps
2047
2055
  } : {}