@dudousxd/nestjs-agent 1.27.0 → 1.28.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,7 +1,7 @@
1
1
  import { AgentStore, AgentRunInput, AgentLoopResult, LlmStepEnvelope, BufferedModelTurnResult, ToolStepEnvelope, AgentRunner, TokenStreamSink, AgentRunStartOptions, HumanReply } from '@dudousxd/nestjs-agent-core';
2
2
  import { WorkflowService } from '@dudousxd/nestjs-durable';
3
3
  import { RunGateway, WorkflowCtx } from '@dudousxd/nestjs-durable-core';
4
- import { A as AgentDepsFactory, C as ChatQueueService, a as AgentSurface, b as AgentModuleOptions } from '../chat-queue.service-Cu2nJpXz.cjs';
4
+ import { A as AgentDepsFactory, C as ChatQueueService, a as AgentSurface, b as AgentModuleOptions } from '../chat-queue.service-Bk7DCKGV.cjs';
5
5
  import { DynamicModule } from '@nestjs/common';
6
6
  import '@dudousxd/nestjs-agent-core/genui';
7
7
  import '@standard-schema/spec';
@@ -1,7 +1,7 @@
1
1
  import { AgentStore, AgentRunInput, AgentLoopResult, LlmStepEnvelope, BufferedModelTurnResult, ToolStepEnvelope, AgentRunner, TokenStreamSink, AgentRunStartOptions, HumanReply } from '@dudousxd/nestjs-agent-core';
2
2
  import { WorkflowService } from '@dudousxd/nestjs-durable';
3
3
  import { RunGateway, WorkflowCtx } from '@dudousxd/nestjs-durable-core';
4
- import { A as AgentDepsFactory, C as ChatQueueService, a as AgentSurface, b as AgentModuleOptions } from '../chat-queue.service-uD1vR8fs.js';
4
+ import { A as AgentDepsFactory, C as ChatQueueService, a as AgentSurface, b as AgentModuleOptions } from '../chat-queue.service-B-fVOJGf.js';
5
5
  import { DynamicModule } from '@nestjs/common';
6
6
  import '@dudousxd/nestjs-agent-core/genui';
7
7
  import '@standard-schema/spec';
@@ -1199,7 +1199,7 @@ import { AGENT_OPTIONS } from "@dudousxd/nestjs-agent-core";
1199
1199
  import { BadRequestException, Inject as Inject5, Injectable as Injectable4, Optional as Optional3 } from "@nestjs/common";
1200
1200
 
1201
1201
  // src/genui/agent-genui.module.ts
1202
- import { defineCatalog, genuiTools } from "@dudousxd/nestjs-agent-core/genui";
1202
+ import { defineCatalog, defineSandbox, genuiTools } from "@dudousxd/nestjs-agent-core/genui";
1203
1203
  import { Inject as Inject4, Module as Module2 } from "@nestjs/common";
1204
1204
 
1205
1205
  // src/functional-tool.ts
@@ -1262,7 +1262,7 @@ function resolverProviders(resolver) {
1262
1262
  }
1263
1263
  __name(resolverProviders, "resolverProviders");
1264
1264
  function toolOptions(options, resolver) {
1265
- const { catalog: _catalog, ...rest } = options;
1265
+ const { catalog: _catalog, sandbox: _sandbox, ...rest } = options;
1266
1266
  return {
1267
1267
  ...rest,
1268
1268
  ...resolver !== void 0 ? {
@@ -1271,11 +1271,19 @@ function toolOptions(options, resolver) {
1271
1271
  };
1272
1272
  }
1273
1273
  __name(toolOptions, "toolOptions");
1274
+ function withSandbox(options) {
1275
+ const base = options.catalog ?? defineCatalog([]);
1276
+ const { sandbox } = options;
1277
+ return sandbox === void 0 || sandbox === false ? base : base.extend([
1278
+ defineSandbox(sandbox === true ? {} : sandbox)
1279
+ ]);
1280
+ }
1281
+ __name(withSandbox, "withSandbox");
1274
1282
  function coreProviders(resolver) {
1275
1283
  return [
1276
1284
  {
1277
1285
  provide: GENUI_CATALOG,
1278
- useFactory: /* @__PURE__ */ __name((options) => options.catalog ?? defineCatalog([]), "useFactory"),
1286
+ useFactory: /* @__PURE__ */ __name((options) => withSandbox(options), "useFactory"),
1279
1287
  inject: [
1280
1288
  GENUI_OPTIONS
1281
1289
  ]
@@ -1734,6 +1742,9 @@ AgentDepsFactory2 = _ts_decorate6([
1734
1742
  ])
1735
1743
  ], AgentDepsFactory2);
1736
1744
 
1745
+ // src/agent-service.token.ts
1746
+ var AGENT_SERVICE = /* @__PURE__ */ Symbol.for("@dudousxd/nestjs-agent:agent-service");
1747
+
1737
1748
  // src/agent.service.ts
1738
1749
  import { AGENT_ATTACHMENT_STAGING as AGENT_ATTACHMENT_STAGING2, AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY4, AGENT_MODEL_CATALOG, AGENT_OPTIONS as AGENT_OPTIONS4, AGENT_QUOTA_PROVIDER as AGENT_QUOTA_PROVIDER2, AGENT_RUNNER, AGENT_STORE as AGENT_STORE6, DEFAULT_TEXT_ACTION_PROPOSAL_VOCABULARY as DEFAULT_TEXT_ACTION_PROPOSAL_VOCABULARY2, REQUESTER_APPROVER, findCatalogModel, mayDecideApproval as mayDecideApproval2, readElicitationQuestions, settleDeadRun as settleDeadRun2, textActionProposalReply as textActionProposalReply2, validateElicitationAnswer } from "@dudousxd/nestjs-agent-core";
1739
1750
  import { BadRequestException as BadRequestException2, ConflictException as ConflictException2, ForbiddenException as ForbiddenException2, GoneException, HttpException, HttpStatus, Inject as Inject8, Injectable as Injectable7, NotFoundException as NotFoundException2, NotImplementedException as NotImplementedException3, Optional as Optional5, PayloadTooLargeException, UnsupportedMediaTypeException } from "@nestjs/common";
@@ -7310,6 +7321,10 @@ function sharedProviders(durable, engine) {
7310
7321
  },
7311
7322
  InlineAgentRunner,
7312
7323
  AgentService,
7324
+ {
7325
+ provide: AGENT_SERVICE,
7326
+ useExisting: AgentService
7327
+ },
7313
7328
  ActionProposalService,
7314
7329
  ActionProposalWorkerService,
7315
7330
  // Bound ALWAYS (durable or inline) — the console's cross-thread approvals inbox routes decisions
@@ -7377,6 +7392,7 @@ function exportsFor(engine) {
7377
7392
  AGENT_DEPS_FACTORY9,
7378
7393
  AgentDepsFactory2,
7379
7394
  AgentService,
7395
+ AGENT_SERVICE,
7380
7396
  ActionProposalService,
7381
7397
  ActionProposalWorkerService,
7382
7398
  ChatQueueService2,