@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.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-DNslT7_J.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-DNslT7_J.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-DNslT7_J.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-DNslT7_J.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
@@ -1910,6 +1910,10 @@ function controllersFor(mountAttachments) {
1910
1910
  ] : BASE_CONTROLLERS;
1911
1911
  }
1912
1912
  __name(controllersFor, "controllersFor");
1913
+ function controllersForSurface(surface, mountAttachments) {
1914
+ return surface === "engine" ? [] : controllersFor(mountAttachments);
1915
+ }
1916
+ __name(controllersForSurface, "controllersForSurface");
1913
1917
  var GUARDS_METADATA = "__guards__";
1914
1918
  function applyGuards(guards) {
1915
1919
  const resolved = guards ?? [];
@@ -1955,7 +1959,7 @@ var AgentModule = class _AgentModule {
1955
1959
  DiscoveryModule,
1956
1960
  routerFor(path)
1957
1961
  ],
1958
- controllers: controllersFor(options.attachments?.upload === true),
1962
+ controllers: controllersForSurface(options.surface, options.attachments?.upload === true),
1959
1963
  providers: [
1960
1964
  {
1961
1965
  provide: AGENT_OPTIONS4,
@@ -1980,17 +1984,21 @@ var AgentModule = class _AgentModule {
1980
1984
  routerFor(path),
1981
1985
  ...options.imports ?? []
1982
1986
  ],
1983
- controllers: controllersFor(options.attachmentsUpload === true),
1987
+ controllers: controllersForSurface(options.surface, options.attachmentsUpload === true),
1984
1988
  providers: [
1985
1989
  {
1986
1990
  provide: AGENT_OPTIONS4,
1987
- // Stamp the STATIC wiring flags onto the factory result: `durable`/`dispatchedSteps` are
1988
- // authoritative on the async config object (they decided the actual wiring above), and
1989
- // `AgentDurableModule` derives the effective dispatched-steps value from AGENT_OPTIONS —
1990
- // 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.
1991
1998
  useFactory: /* @__PURE__ */ __name(async (...args) => ({
1992
1999
  ...await options.useFactory(...args),
1993
2000
  durable: options.durable ?? false,
2001
+ surface: options.surface ?? "both",
1994
2002
  ...options.dispatchedSteps !== void 0 ? {
1995
2003
  dispatchedSteps: options.dispatchedSteps
1996
2004
  } : {}