@dudousxd/nestjs-agent 0.8.2 → 0.10.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.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DynamicModule, OnModuleInit, Type, OnApplicationBootstrap } from '@nestjs/common';
2
- import { a as AgentModuleOptions, b as AgentModuleAsyncOptions, A as AgentDepsFactory } from './agent-deps.factory-BlC9tumI.cjs';
3
- export { c as AGENT_TOOL_BRAND, d as AgentAttachmentsOptions, e as AgentDeps, F as FunctionalTool, f as delegateToolName, p as provideAgentTool, u as utcDay } from './agent-deps.factory-BlC9tumI.cjs';
2
+ import { b as AgentModuleOptions, c as AgentModuleAsyncOptions, A as AgentDepsFactory } from './agent-deps.factory-D7GdhqdK.cjs';
3
+ export { d as AGENT_TOOL_BRAND, e as AgentAttachmentsOptions, f as AgentDeps, a as AgentSurface, F as FunctionalTool, g as delegateToolName, p as provideAgentTool, u as utcDay } from './agent-deps.factory-D7GdhqdK.cjs';
4
4
  import { AgentRunner, AgentStore, QuotaStore, Actor, MessageAttachment, PageContext, Decision, ThreadSummary, ThreadDetail, UpdateThreadInput, QuotaView, AgentApprovalPort, ActorResolver, AttachmentStagingStore, ToolRegistry, AgentRegistry, PromptContributor, AgentRunInput, TokenStreamSink, SinkWriter, QuotaState } from '@dudousxd/nestjs-agent-core';
5
5
  export * from '@dudousxd/nestjs-agent-core';
6
6
  import { Request } from 'express';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DynamicModule, OnModuleInit, Type, OnApplicationBootstrap } from '@nestjs/common';
2
- import { a as AgentModuleOptions, b as AgentModuleAsyncOptions, A as AgentDepsFactory } from './agent-deps.factory-BlC9tumI.js';
3
- export { c as AGENT_TOOL_BRAND, d as AgentAttachmentsOptions, e as AgentDeps, F as FunctionalTool, f as delegateToolName, p as provideAgentTool, u as utcDay } from './agent-deps.factory-BlC9tumI.js';
2
+ import { b as AgentModuleOptions, c as AgentModuleAsyncOptions, A as AgentDepsFactory } from './agent-deps.factory-D7GdhqdK.js';
3
+ export { d as AGENT_TOOL_BRAND, e as AgentAttachmentsOptions, f as AgentDeps, a as AgentSurface, F as FunctionalTool, g as delegateToolName, p as provideAgentTool, u as utcDay } from './agent-deps.factory-D7GdhqdK.js';
4
4
  import { AgentRunner, AgentStore, QuotaStore, Actor, MessageAttachment, PageContext, Decision, ThreadSummary, ThreadDetail, UpdateThreadInput, QuotaView, AgentApprovalPort, ActorResolver, AttachmentStagingStore, ToolRegistry, AgentRegistry, PromptContributor, AgentRunInput, TokenStreamSink, SinkWriter, QuotaState } from '@dudousxd/nestjs-agent-core';
5
5
  export * from '@dudousxd/nestjs-agent-core';
6
6
  import { Request } from 'express';
package/dist/index.js CHANGED
@@ -111,6 +111,9 @@ var AgentDepsFactory2 = class {
111
111
  ...this.options.toolTimeoutMs !== void 0 ? {
112
112
  toolTimeoutMs: this.options.toolTimeoutMs
113
113
  } : {},
114
+ ...this.options.toolTransientRetry !== void 0 ? {
115
+ toolTransientRetry: this.options.toolTransientRetry
116
+ } : {},
114
117
  ...followUpsCount !== void 0 ? {
115
118
  followUpsCount
116
119
  } : {},
@@ -1907,6 +1910,10 @@ function controllersFor(mountAttachments) {
1907
1910
  ] : BASE_CONTROLLERS;
1908
1911
  }
1909
1912
  __name(controllersFor, "controllersFor");
1913
+ function controllersForSurface(surface, mountAttachments) {
1914
+ return surface === "engine" ? [] : controllersFor(mountAttachments);
1915
+ }
1916
+ __name(controllersForSurface, "controllersForSurface");
1910
1917
  var GUARDS_METADATA = "__guards__";
1911
1918
  function applyGuards(guards) {
1912
1919
  const resolved = guards ?? [];
@@ -1952,7 +1959,7 @@ var AgentModule = class _AgentModule {
1952
1959
  DiscoveryModule,
1953
1960
  routerFor(path)
1954
1961
  ],
1955
- controllers: controllersFor(options.attachments?.upload === true),
1962
+ controllers: controllersForSurface(options.surface, options.attachments?.upload === true),
1956
1963
  providers: [
1957
1964
  {
1958
1965
  provide: AGENT_OPTIONS4,
@@ -1977,17 +1984,21 @@ var AgentModule = class _AgentModule {
1977
1984
  routerFor(path),
1978
1985
  ...options.imports ?? []
1979
1986
  ],
1980
- controllers: controllersFor(options.attachmentsUpload === true),
1987
+ controllers: controllersForSurface(options.surface, options.attachmentsUpload === true),
1981
1988
  providers: [
1982
1989
  {
1983
1990
  provide: AGENT_OPTIONS4,
1984
- // Stamp the STATIC wiring flags onto the factory result: `durable`/`dispatchedSteps` are
1985
- // authoritative on the async config object (they decided the actual wiring above), and
1986
- // `AgentDurableModule` derives the effective dispatched-steps value from AGENT_OPTIONS —
1987
- // without this stamp, an async host would get in-process localSteps despite durable: true.
1991
+ // Stamp the STATIC wiring flags onto the factory result: `durable`/`dispatchedSteps`/
1992
+ // `surface` are authoritative on the async config object (they decided the actual wiring
1993
+ // above), and `AgentDurableModule` derives the effective dispatched-steps value from
1994
+ // AGENT_OPTIONS — without this stamp, an async host would get in-process localSteps
1995
+ // despite durable: true. `surface` isn't read back by anything today (AgentDurableModule
1996
+ // takes its own mirror option — see its doc for why), but it's stamped here too so the
1997
+ // EFFECTIVE value is always observable off AGENT_OPTIONS, sync or async alike.
1988
1998
  useFactory: /* @__PURE__ */ __name(async (...args) => ({
1989
1999
  ...await options.useFactory(...args),
1990
2000
  durable: options.durable ?? false,
2001
+ surface: options.surface ?? "both",
1991
2002
  ...options.dispatchedSteps !== void 0 ? {
1992
2003
  dispatchedSteps: options.dispatchedSteps
1993
2004
  } : {}