@dudousxd/nestjs-agent 1.8.0 → 1.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.
@@ -1,6 +1,6 @@
1
1
  import { AgentStore, AgentRunInput, AgentLoopResult, LlmStepEnvelope, BufferedModelTurnResult, ToolStepEnvelope, AgentRunner, TokenStreamSink, HumanReply } from '@dudousxd/nestjs-agent-core';
2
2
  import { RunGateway, WorkflowCtx } from '@dudousxd/nestjs-durable-core';
3
- import { A as AgentDepsFactory, a as AgentSurface, b as AgentModuleOptions } from '../agent-deps.factory-Cus_RqwJ.cjs';
3
+ import { A as AgentDepsFactory, a as AgentSurface, b as AgentModuleOptions } from '../agent-deps.factory-DuTy1UyU.cjs';
4
4
  import { WorkflowService } from '@dudousxd/nestjs-durable';
5
5
  import { DynamicModule } from '@nestjs/common';
6
6
  import '@standard-schema/spec';
@@ -1,6 +1,6 @@
1
1
  import { AgentStore, AgentRunInput, AgentLoopResult, LlmStepEnvelope, BufferedModelTurnResult, ToolStepEnvelope, AgentRunner, TokenStreamSink, HumanReply } from '@dudousxd/nestjs-agent-core';
2
2
  import { RunGateway, WorkflowCtx } from '@dudousxd/nestjs-durable-core';
3
- import { A as AgentDepsFactory, a as AgentSurface, b as AgentModuleOptions } from '../agent-deps.factory-Cus_RqwJ.js';
3
+ import { A as AgentDepsFactory, a as AgentSurface, b as AgentModuleOptions } from '../agent-deps.factory-DuTy1UyU.js';
4
4
  import { WorkflowService } from '@dudousxd/nestjs-durable';
5
5
  import { DynamicModule } from '@nestjs/common';
6
6
  import '@standard-schema/spec';
@@ -72,7 +72,14 @@ var AgentRunSteps = class {
72
72
  const tools = withMemoryTool({
73
73
  tools: withSkillTool({
74
74
  tools: withAskTool({
75
- tools: await deps.registry.definitionsFor(input.actor, deps.rolesPolicy, deps.toolAllowList),
75
+ tools: await deps.registry.definitionsFor(input.actor, deps.rolesPolicy, deps.toolAllowList, {
76
+ ...input.threadId !== void 0 ? {
77
+ threadId: input.threadId
78
+ } : {},
79
+ ...input.agentName !== void 0 ? {
80
+ agentName: input.agentName
81
+ } : {}
82
+ }),
76
83
  ask: deps.ask
77
84
  }),
78
85
  enabled: deps.skills !== void 0
@@ -3469,6 +3476,14 @@ var AiToolDiscoveryService = class _AiToolDiscoveryService {
3469
3476
  if (instance === null || instance === void 0 || typeof instance !== "object") {
3470
3477
  continue;
3471
3478
  }
3479
+ if (Array.isArray(instance) && instance.length > 0 && instance.every((each) => typeof each === "object" && each !== null && isBrandedFunctionalTool(each))) {
3480
+ for (const tool of instance) {
3481
+ if (this.registerFunctionalTool(tool)) {
3482
+ functional += 1;
3483
+ }
3484
+ }
3485
+ continue;
3486
+ }
3472
3487
  if (isBrandedFunctionalTool(instance)) {
3473
3488
  if (this.registerFunctionalTool(instance)) {
3474
3489
  functional += 1;
@@ -3516,6 +3531,9 @@ var AiToolDiscoveryService = class _AiToolDiscoveryService {
3516
3531
  } : {},
3517
3532
  ...typeof handler.canUse === "function" ? {
3518
3533
  canUse: /* @__PURE__ */ __name((actor) => instance.canUse(actor), "canUse")
3534
+ } : {},
3535
+ ...typeof handler.describe === "function" ? {
3536
+ describe: /* @__PURE__ */ __name((scope) => instance.describe(scope), "describe")
3519
3537
  } : {}
3520
3538
  });
3521
3539
  count += 1;