@dudousxd/nestjs-agent 1.25.1 → 1.26.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-Crf9uwum.cjs';
4
+ import { A as AgentDepsFactory, C as ChatQueueService, a as AgentSurface, b as AgentModuleOptions } from '../chat-queue.service-BN6Ljswx.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-ZQkqb1Yw.js';
4
+ import { A as AgentDepsFactory, C as ChatQueueService, a as AgentSurface, b as AgentModuleOptions } from '../chat-queue.service-DG44iDJA.js';
5
5
  import { DynamicModule } from '@nestjs/common';
6
6
  import '@dudousxd/nestjs-agent-core/genui';
7
7
  import '@standard-schema/spec';
@@ -1188,8 +1188,8 @@ AgentDurableModule = _ts_decorate4([
1188
1188
  ], AgentDurableModule);
1189
1189
 
1190
1190
  // src/agent.module.ts
1191
- import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER14, AGENT_APPROVAL_PORT, AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY9, AGENT_DURABLE_RUNNER as AGENT_DURABLE_RUNNER2, AGENT_MEMORY as AGENT_MEMORY3, AGENT_MODEL as AGENT_MODEL2, AGENT_MODEL_CATALOG as AGENT_MODEL_CATALOG3, AGENT_OPTIONS as AGENT_OPTIONS9, AGENT_PROMPT_CONTRIBUTORS as AGENT_PROMPT_CONTRIBUTORS3, AGENT_QUOTA_PROVIDER as AGENT_QUOTA_PROVIDER3, AGENT_REGISTRY as AGENT_REGISTRY6, AGENT_ROLES_POLICY as AGENT_ROLES_POLICY2, AGENT_RUNNER as AGENT_RUNNER2, AGENT_SINK as AGENT_SINK4, AGENT_SKILLS as AGENT_SKILLS3, AGENT_SKILL_SOURCES as AGENT_SKILL_SOURCES2, AGENT_STORE as AGENT_STORE9, AGENT_TOOL_REGISTRY as AGENT_TOOL_REGISTRY3, AgentRegistry as AgentRegistry6, ClosedRolesPolicy, DefaultRolesPolicy, InMemoryAgentStore, ToolRegistry as ToolRegistry3 } from "@dudousxd/nestjs-agent-core";
1192
- import { Global as Global2, Logger as Logger9, Module as Module3 } from "@nestjs/common";
1191
+ import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER14, AGENT_APPROVAL_PORT, AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY9, AGENT_DURABLE_RUNNER as AGENT_DURABLE_RUNNER2, AGENT_MEMORY as AGENT_MEMORY3, AGENT_MODEL as AGENT_MODEL3, AGENT_MODEL_CATALOG as AGENT_MODEL_CATALOG3, AGENT_OPTIONS as AGENT_OPTIONS10, AGENT_PROMPT_CONTRIBUTORS as AGENT_PROMPT_CONTRIBUTORS3, AGENT_QUOTA_PROVIDER as AGENT_QUOTA_PROVIDER3, AGENT_REGISTRY as AGENT_REGISTRY6, AGENT_ROLES_POLICY as AGENT_ROLES_POLICY2, AGENT_RUNNER as AGENT_RUNNER2, AGENT_SINK as AGENT_SINK4, AGENT_SKILLS as AGENT_SKILLS3, AGENT_SKILL_SOURCES as AGENT_SKILL_SOURCES2, AGENT_STORE as AGENT_STORE9, AGENT_TOOL_REGISTRY as AGENT_TOOL_REGISTRY3, AgentRegistry as AgentRegistry6, ClosedRolesPolicy, DefaultRolesPolicy, InMemoryAgentStore, ToolRegistry as ToolRegistry3 } from "@dudousxd/nestjs-agent-core";
1192
+ import { Global as Global2, Logger as Logger10, Module as Module3 } from "@nestjs/common";
1193
1193
  import { DiscoveryModule, ModulesContainer, RouterModule } from "@nestjs/core";
1194
1194
 
1195
1195
  // src/agent-deps.factory.ts
@@ -6181,10 +6181,9 @@ var LedgerQuotaProvider = class {
6181
6181
  }
6182
6182
  };
6183
6183
 
6184
- // src/proposals/action-proposal-worker.service.ts
6185
- import { randomUUID as randomUUID2 } from "crypto";
6186
- import { AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY7, AGENT_OPTIONS as AGENT_OPTIONS8, AGENT_STORE as AGENT_STORE7, ActionProposalExecutor, ActionProposalWorker, assertIndependentActionCapabilities as assertIndependentActionCapabilities2 } from "@dudousxd/nestjs-agent-core";
6187
- import { Inject as Inject25, Injectable as Injectable12, Logger as Logger7 } from "@nestjs/common";
6184
+ // src/pricing-boot.service.ts
6185
+ import { AGENT_MODEL as AGENT_MODEL2, AGENT_OPTIONS as AGENT_OPTIONS8, AGENT_PRICING_STORE as AGENT_PRICING_STORE2, ensureModelPricing } from "@dudousxd/nestjs-agent-core";
6186
+ import { Inject as Inject25, Injectable as Injectable12, Logger as Logger7, Optional as Optional11 } from "@nestjs/common";
6188
6187
  function _ts_decorate27(decorators, target, key, desc) {
6189
6188
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6190
6189
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
@@ -6211,6 +6210,96 @@ function _ts_param25(paramIndex, decorator) {
6211
6210
  };
6212
6211
  }
6213
6212
  __name(_ts_param25, "_ts_param");
6213
+ var logger = new Logger7("AgentPricing");
6214
+ var PricingBootService = class {
6215
+ static {
6216
+ __name(this, "PricingBootService");
6217
+ }
6218
+ options;
6219
+ model;
6220
+ pricingStore;
6221
+ #run = null;
6222
+ constructor(options, model, pricingStore) {
6223
+ this.options = options;
6224
+ this.model = model;
6225
+ this.pricingStore = pricingStore;
6226
+ }
6227
+ onApplicationBootstrap() {
6228
+ this.#run = this.check();
6229
+ }
6230
+ /** Awaits a check still in flight, so a test (or a fast shutdown) never leaks it. */
6231
+ async onApplicationShutdown() {
6232
+ await this.#run;
6233
+ this.#run = null;
6234
+ }
6235
+ /** The check itself; resolves once it is done (exposed for tests). */
6236
+ async check() {
6237
+ let models;
6238
+ try {
6239
+ models = this.model?.describeModels?.() ?? [];
6240
+ } catch (error) {
6241
+ logger.warn(`describeModels() threw; boot pricing skipped: ${String(error)}`);
6242
+ return;
6243
+ }
6244
+ if (models.length === 0) return;
6245
+ const catalog = this.options.priceCatalog;
6246
+ if (catalog === void 0 && process.env.NODE_ENV === "test") return;
6247
+ await ensureModelPricing({
6248
+ models,
6249
+ pricingStore: this.pricingStore,
6250
+ catalog: catalog ?? {},
6251
+ log: {
6252
+ info: /* @__PURE__ */ __name((message) => logger.log(message), "info"),
6253
+ warn: /* @__PURE__ */ __name((message) => logger.warn(message), "warn")
6254
+ }
6255
+ }).catch(() => void 0);
6256
+ }
6257
+ };
6258
+ PricingBootService = _ts_decorate27([
6259
+ Injectable12(),
6260
+ _ts_param25(0, Inject25(AGENT_OPTIONS8)),
6261
+ _ts_param25(1, Optional11()),
6262
+ _ts_param25(1, Inject25(AGENT_MODEL2)),
6263
+ _ts_param25(2, Optional11()),
6264
+ _ts_param25(2, Inject25(AGENT_PRICING_STORE2)),
6265
+ _ts_metadata25("design:type", Function),
6266
+ _ts_metadata25("design:paramtypes", [
6267
+ typeof AgentModuleOptions === "undefined" ? Object : AgentModuleOptions,
6268
+ Object,
6269
+ Object
6270
+ ])
6271
+ ], PricingBootService);
6272
+
6273
+ // src/proposals/action-proposal-worker.service.ts
6274
+ import { randomUUID as randomUUID2 } from "crypto";
6275
+ import { AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY7, AGENT_OPTIONS as AGENT_OPTIONS9, AGENT_STORE as AGENT_STORE7, ActionProposalExecutor, ActionProposalWorker, assertIndependentActionCapabilities as assertIndependentActionCapabilities2 } from "@dudousxd/nestjs-agent-core";
6276
+ import { Inject as Inject26, Injectable as Injectable13, Logger as Logger8 } from "@nestjs/common";
6277
+ function _ts_decorate28(decorators, target, key, desc) {
6278
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6279
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
6280
+ r = Reflect.decorate(decorators, target, key, desc);
6281
+ } else {
6282
+ for (var i = decorators.length - 1; i >= 0; i--) {
6283
+ if (d = decorators[i]) {
6284
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6285
+ }
6286
+ }
6287
+ }
6288
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6289
+ }
6290
+ __name(_ts_decorate28, "_ts_decorate");
6291
+ function _ts_metadata26(metadataKey, metadataValue) {
6292
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
6293
+ return Reflect.metadata(metadataKey, metadataValue);
6294
+ }
6295
+ }
6296
+ __name(_ts_metadata26, "_ts_metadata");
6297
+ function _ts_param26(paramIndex, decorator) {
6298
+ return function(target, key) {
6299
+ decorator(target, key, paramIndex);
6300
+ };
6301
+ }
6302
+ __name(_ts_param26, "_ts_param");
6214
6303
  var ActionProposalWorkerService = class _ActionProposalWorkerService {
6215
6304
  static {
6216
6305
  __name(this, "ActionProposalWorkerService");
@@ -6219,7 +6308,7 @@ var ActionProposalWorkerService = class _ActionProposalWorkerService {
6219
6308
  options;
6220
6309
  deps;
6221
6310
  worker;
6222
- logger = new Logger7(_ActionProposalWorkerService.name);
6311
+ logger = new Logger8(_ActionProposalWorkerService.name);
6223
6312
  settledListeners = /* @__PURE__ */ new Set();
6224
6313
  /**
6225
6314
  * Run `listener` after every proposal this process's worker settles — how a module relays an
@@ -6288,13 +6377,13 @@ var ActionProposalWorkerService = class _ActionProposalWorkerService {
6288
6377
  await this.worker?.stop();
6289
6378
  }
6290
6379
  };
6291
- ActionProposalWorkerService = _ts_decorate27([
6292
- Injectable12(),
6293
- _ts_param25(0, Inject25(AGENT_STORE7)),
6294
- _ts_param25(1, Inject25(AGENT_OPTIONS8)),
6295
- _ts_param25(2, Inject25(AGENT_DEPS_FACTORY7)),
6296
- _ts_metadata25("design:type", Function),
6297
- _ts_metadata25("design:paramtypes", [
6380
+ ActionProposalWorkerService = _ts_decorate28([
6381
+ Injectable13(),
6382
+ _ts_param26(0, Inject26(AGENT_STORE7)),
6383
+ _ts_param26(1, Inject26(AGENT_OPTIONS9)),
6384
+ _ts_param26(2, Inject26(AGENT_DEPS_FACTORY7)),
6385
+ _ts_metadata26("design:type", Function),
6386
+ _ts_metadata26("design:paramtypes", [
6298
6387
  typeof AgentStore === "undefined" ? Object : AgentStore,
6299
6388
  typeof AgentModuleOptions === "undefined" ? Object : AgentModuleOptions,
6300
6389
  typeof AgentDepsFactory2 === "undefined" ? Object : AgentDepsFactory2
@@ -6303,8 +6392,8 @@ ActionProposalWorkerService = _ts_decorate27([
6303
6392
 
6304
6393
  // src/proposals/action-proposal.controller.ts
6305
6394
  import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER13, validateActionProposalListQuery } from "@dudousxd/nestjs-agent-core";
6306
- import { BadRequestException as BadRequestException7, Body as Body6, Controller as Controller14, Get as Get12, Inject as Inject26, Param as Param6, Post as Post7, Query as Query6, Req as Req13, Res as Res2 } from "@nestjs/common";
6307
- function _ts_decorate28(decorators, target, key, desc) {
6395
+ import { BadRequestException as BadRequestException7, Body as Body6, Controller as Controller14, Get as Get12, Inject as Inject27, Param as Param6, Post as Post7, Query as Query6, Req as Req13, Res as Res2 } from "@nestjs/common";
6396
+ function _ts_decorate29(decorators, target, key, desc) {
6308
6397
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6309
6398
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
6310
6399
  r = Reflect.decorate(decorators, target, key, desc);
@@ -6317,19 +6406,19 @@ function _ts_decorate28(decorators, target, key, desc) {
6317
6406
  }
6318
6407
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6319
6408
  }
6320
- __name(_ts_decorate28, "_ts_decorate");
6321
- function _ts_metadata26(metadataKey, metadataValue) {
6409
+ __name(_ts_decorate29, "_ts_decorate");
6410
+ function _ts_metadata27(metadataKey, metadataValue) {
6322
6411
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
6323
6412
  return Reflect.metadata(metadataKey, metadataValue);
6324
6413
  }
6325
6414
  }
6326
- __name(_ts_metadata26, "_ts_metadata");
6327
- function _ts_param26(paramIndex, decorator) {
6415
+ __name(_ts_metadata27, "_ts_metadata");
6416
+ function _ts_param27(paramIndex, decorator) {
6328
6417
  return function(target, key) {
6329
6418
  decorator(target, key, paramIndex);
6330
6419
  };
6331
6420
  }
6332
- __name(_ts_param26, "_ts_param");
6421
+ __name(_ts_param27, "_ts_param");
6333
6422
  function bodyFields(body, field) {
6334
6423
  if (body === void 0) return {};
6335
6424
  if (typeof body !== "object" || body === null || Array.isArray(body) || Object.keys(body).some((key) => key !== field)) throw new BadRequestException7(`Only ${field} is accepted`);
@@ -6388,58 +6477,58 @@ var ActionProposalController = class {
6388
6477
  });
6389
6478
  }
6390
6479
  };
6391
- _ts_decorate28([
6480
+ _ts_decorate29([
6392
6481
  Get12(),
6393
- _ts_param26(0, Param6("threadId")),
6394
- _ts_param26(1, Req13()),
6395
- _ts_param26(2, Query6("after")),
6396
- _ts_param26(3, Res2({
6482
+ _ts_param27(0, Param6("threadId")),
6483
+ _ts_param27(1, Req13()),
6484
+ _ts_param27(2, Query6("after")),
6485
+ _ts_param27(3, Res2({
6397
6486
  passthrough: true
6398
6487
  })),
6399
- _ts_metadata26("design:type", Function),
6400
- _ts_metadata26("design:paramtypes", [
6488
+ _ts_metadata27("design:type", Function),
6489
+ _ts_metadata27("design:paramtypes", [
6401
6490
  String,
6402
6491
  typeof Request === "undefined" ? Object : Request,
6403
6492
  Object,
6404
6493
  typeof Response === "undefined" ? Object : Response
6405
6494
  ]),
6406
- _ts_metadata26("design:returntype", Promise)
6495
+ _ts_metadata27("design:returntype", Promise)
6407
6496
  ], ActionProposalController.prototype, "list", null);
6408
- _ts_decorate28([
6497
+ _ts_decorate29([
6409
6498
  Post7(":proposalId/approve"),
6410
- _ts_param26(0, Param6("threadId")),
6411
- _ts_param26(1, Param6("proposalId")),
6412
- _ts_param26(2, Req13()),
6413
- _ts_param26(3, Body6()),
6414
- _ts_metadata26("design:type", Function),
6415
- _ts_metadata26("design:paramtypes", [
6499
+ _ts_param27(0, Param6("threadId")),
6500
+ _ts_param27(1, Param6("proposalId")),
6501
+ _ts_param27(2, Req13()),
6502
+ _ts_param27(3, Body6()),
6503
+ _ts_metadata27("design:type", Function),
6504
+ _ts_metadata27("design:paramtypes", [
6416
6505
  String,
6417
6506
  String,
6418
6507
  typeof Request === "undefined" ? Object : Request,
6419
6508
  Object
6420
6509
  ]),
6421
- _ts_metadata26("design:returntype", Promise)
6510
+ _ts_metadata27("design:returntype", Promise)
6422
6511
  ], ActionProposalController.prototype, "approve", null);
6423
- _ts_decorate28([
6512
+ _ts_decorate29([
6424
6513
  Post7(":proposalId/reject"),
6425
- _ts_param26(0, Param6("threadId")),
6426
- _ts_param26(1, Param6("proposalId")),
6427
- _ts_param26(2, Req13()),
6428
- _ts_param26(3, Body6()),
6429
- _ts_metadata26("design:type", Function),
6430
- _ts_metadata26("design:paramtypes", [
6514
+ _ts_param27(0, Param6("threadId")),
6515
+ _ts_param27(1, Param6("proposalId")),
6516
+ _ts_param27(2, Req13()),
6517
+ _ts_param27(3, Body6()),
6518
+ _ts_metadata27("design:type", Function),
6519
+ _ts_metadata27("design:paramtypes", [
6431
6520
  String,
6432
6521
  String,
6433
6522
  typeof Request === "undefined" ? Object : Request,
6434
6523
  Object
6435
6524
  ]),
6436
- _ts_metadata26("design:returntype", Promise)
6525
+ _ts_metadata27("design:returntype", Promise)
6437
6526
  ], ActionProposalController.prototype, "reject", null);
6438
- ActionProposalController = _ts_decorate28([
6527
+ ActionProposalController = _ts_decorate29([
6439
6528
  Controller14("threads/:threadId/action-proposals"),
6440
- _ts_param26(1, Inject26(AGENT_ACTOR_RESOLVER13)),
6441
- _ts_metadata26("design:type", Function),
6442
- _ts_metadata26("design:paramtypes", [
6529
+ _ts_param27(1, Inject27(AGENT_ACTOR_RESOLVER13)),
6530
+ _ts_metadata27("design:type", Function),
6531
+ _ts_metadata27("design:paramtypes", [
6443
6532
  typeof ActionProposalService === "undefined" ? Object : ActionProposalService,
6444
6533
  typeof ActorResolver === "undefined" ? Object : ActorResolver
6445
6534
  ])
@@ -6447,8 +6536,8 @@ ActionProposalController = _ts_decorate28([
6447
6536
 
6448
6537
  // src/runner/inline-agent-runner.ts
6449
6538
  import { AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY8, AGENT_STORE as AGENT_STORE8, RUN_ENDED_BEFORE_TOOL_CALL as RUN_ENDED_BEFORE_TOOL_CALL2, RunCancelledError as RunCancelledError2, agentFailureCode as agentFailureCode2, encodeStreamEvent as encodeStreamEvent5, publishAgentRunFailed as publishAgentRunFailed2, releaseThreadRun as releaseThreadRun3, runAgentLoop as runAgentLoop2, settleAll as settleAll2, settleUnsettledDelegation as settleUnsettledDelegation3, streamFailure as streamFailure3 } from "@dudousxd/nestjs-agent-core";
6450
- import { Inject as Inject27, Injectable as Injectable13, Logger as Logger8, Optional as Optional11 } from "@nestjs/common";
6451
- function _ts_decorate29(decorators, target, key, desc) {
6539
+ import { Inject as Inject28, Injectable as Injectable14, Logger as Logger9, Optional as Optional12 } from "@nestjs/common";
6540
+ function _ts_decorate30(decorators, target, key, desc) {
6452
6541
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6453
6542
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
6454
6543
  r = Reflect.decorate(decorators, target, key, desc);
@@ -6461,19 +6550,19 @@ function _ts_decorate29(decorators, target, key, desc) {
6461
6550
  }
6462
6551
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6463
6552
  }
6464
- __name(_ts_decorate29, "_ts_decorate");
6465
- function _ts_metadata27(metadataKey, metadataValue) {
6553
+ __name(_ts_decorate30, "_ts_decorate");
6554
+ function _ts_metadata28(metadataKey, metadataValue) {
6466
6555
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
6467
6556
  return Reflect.metadata(metadataKey, metadataValue);
6468
6557
  }
6469
6558
  }
6470
- __name(_ts_metadata27, "_ts_metadata");
6471
- function _ts_param27(paramIndex, decorator) {
6559
+ __name(_ts_metadata28, "_ts_metadata");
6560
+ function _ts_param28(paramIndex, decorator) {
6472
6561
  return function(target, key) {
6473
6562
  decorator(target, key, paramIndex);
6474
6563
  };
6475
6564
  }
6476
- __name(_ts_param27, "_ts_param");
6565
+ __name(_ts_param28, "_ts_param");
6477
6566
  var InlineAgentRunner = class _InlineAgentRunner {
6478
6567
  static {
6479
6568
  __name(this, "InlineAgentRunner");
@@ -6481,7 +6570,7 @@ var InlineAgentRunner = class _InlineAgentRunner {
6481
6570
  factory;
6482
6571
  store;
6483
6572
  queue;
6484
- logger = new Logger8(_InlineAgentRunner.name);
6573
+ logger = new Logger9(_InlineAgentRunner.name);
6485
6574
  pending = /* @__PURE__ */ new Map();
6486
6575
  /**
6487
6576
  * Runs someone has asked to stop. In-process, like `pending`, and for the same reason: this runner
@@ -6950,13 +7039,13 @@ var InlineAgentRunner = class _InlineAgentRunner {
6950
7039
  }
6951
7040
  }
6952
7041
  };
6953
- InlineAgentRunner = _ts_decorate29([
6954
- Injectable13(),
6955
- _ts_param27(0, Inject27(AGENT_DEPS_FACTORY8)),
6956
- _ts_param27(1, Inject27(AGENT_STORE8)),
6957
- _ts_param27(2, Optional11()),
6958
- _ts_metadata27("design:type", Function),
6959
- _ts_metadata27("design:paramtypes", [
7042
+ InlineAgentRunner = _ts_decorate30([
7043
+ Injectable14(),
7044
+ _ts_param28(0, Inject28(AGENT_DEPS_FACTORY8)),
7045
+ _ts_param28(1, Inject28(AGENT_STORE8)),
7046
+ _ts_param28(2, Optional12()),
7047
+ _ts_metadata28("design:type", Function),
7048
+ _ts_metadata28("design:paramtypes", [
6960
7049
  typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
6961
7050
  typeof AgentStore === "undefined" ? Object : AgentStore,
6962
7051
  typeof ChatQueueService2 === "undefined" ? Object : ChatQueueService2
@@ -7006,7 +7095,7 @@ function resolveSkillsConfig(options, declared) {
7006
7095
  __name(resolveSkillsConfig, "resolveSkillsConfig");
7007
7096
 
7008
7097
  // src/agent.module.ts
7009
- function _ts_decorate30(decorators, target, key, desc) {
7098
+ function _ts_decorate31(decorators, target, key, desc) {
7010
7099
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
7011
7100
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
7012
7101
  r = Reflect.decorate(decorators, target, key, desc);
@@ -7019,9 +7108,9 @@ function _ts_decorate30(decorators, target, key, desc) {
7019
7108
  }
7020
7109
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7021
7110
  }
7022
- __name(_ts_decorate30, "_ts_decorate");
7111
+ __name(_ts_decorate31, "_ts_decorate");
7023
7112
  var DEFAULT_PATH = "agent";
7024
- var logger = new Logger9("AgentModule");
7113
+ var logger2 = new Logger10("AgentModule");
7025
7114
  function externalWrapper(modules, token) {
7026
7115
  for (const module of modules.values()) {
7027
7116
  if (module.metatype === AgentModule) continue;
@@ -7055,7 +7144,7 @@ function resolveStore(options, modules) {
7055
7144
  if (options.store !== void 0) return options.store;
7056
7145
  const external = externalWrapper(modules, AGENT_STORE9);
7057
7146
  if (external !== void 0) return forwardingStore(external);
7058
- logger.warn("No `store` configured and no store module imported \u2014 using the in-memory store. Threads are lost on restart and not shared between processes: not for production. Pass `store`, or import a store module (e.g. MikroOrmAgentStoreModule.forFeature()).");
7147
+ logger2.warn("No `store` configured and no store module imported \u2014 using the in-memory store. Threads are lost on restart and not shared between processes: not for production. Pass `store`, or import a store module (e.g. MikroOrmAgentStoreModule.forFeature()).");
7059
7148
  return new InMemoryAgentStore();
7060
7149
  }
7061
7150
  __name(resolveStore, "resolveStore");
@@ -7063,7 +7152,7 @@ function resolveRolesPolicy(options, modules) {
7063
7152
  const external = externalWrapper(modules, AGENT_ROLES_POLICY2);
7064
7153
  if (options.rolesPolicy !== void 0) {
7065
7154
  if (external !== void 0) {
7066
- logger.warn("Both a `rolesPolicy` option and a module binding AGENT_ROLES_POLICY (e.g. AgentAuthzModule) are configured \u2014 the `rolesPolicy` option wins.");
7155
+ logger2.warn("Both a `rolesPolicy` option and a module binding AGENT_ROLES_POLICY (e.g. AgentAuthzModule) are configured \u2014 the `rolesPolicy` option wins.");
7067
7156
  }
7068
7157
  return options.rolesPolicy;
7069
7158
  }
@@ -7122,7 +7211,7 @@ function sharedProviders(durable, engine) {
7122
7211
  provide: AGENT_SKILLS3,
7123
7212
  useFactory: /* @__PURE__ */ __name((options, declared) => resolveSkillsConfig(options.skills, declared), "useFactory"),
7124
7213
  inject: [
7125
- AGENT_OPTIONS9,
7214
+ AGENT_OPTIONS10,
7126
7215
  AGENT_SKILL_SOURCES2
7127
7216
  ]
7128
7217
  },
@@ -7132,21 +7221,21 @@ function sharedProviders(durable, engine) {
7132
7221
  provide: AGENT_MEMORY3,
7133
7222
  useFactory: /* @__PURE__ */ __name((options) => options.memory, "useFactory"),
7134
7223
  inject: [
7135
- AGENT_OPTIONS9
7224
+ AGENT_OPTIONS10
7136
7225
  ]
7137
7226
  },
7138
7227
  {
7139
7228
  provide: AGENT_SINK4,
7140
7229
  useFactory: /* @__PURE__ */ __name((options) => options.sink ?? new InProcessTokenStreamSink(), "useFactory"),
7141
7230
  inject: [
7142
- AGENT_OPTIONS9
7231
+ AGENT_OPTIONS10
7143
7232
  ]
7144
7233
  },
7145
7234
  {
7146
7235
  provide: AGENT_ROLES_POLICY2,
7147
7236
  useFactory: /* @__PURE__ */ __name((options, modules) => resolveRolesPolicy(options, modules), "useFactory"),
7148
7237
  inject: [
7149
- AGENT_OPTIONS9,
7238
+ AGENT_OPTIONS10,
7150
7239
  ModulesContainer
7151
7240
  ]
7152
7241
  },
@@ -7154,18 +7243,18 @@ function sharedProviders(durable, engine) {
7154
7243
  provide: AGENT_ACTOR_RESOLVER14,
7155
7244
  useFactory: /* @__PURE__ */ __name((options) => {
7156
7245
  if (options.actorResolver !== void 0) return options.actorResolver;
7157
- logger.warn("No `actorResolver` configured \u2014 the agent endpoints are PUBLIC: every browser gets its own anonymous identity (an HttpOnly cookie). Set `actorResolver: requestUserActorResolver()` (or your own) to require login.");
7246
+ logger2.warn("No `actorResolver` configured \u2014 the agent endpoints are PUBLIC: every browser gets its own anonymous identity (an HttpOnly cookie). Set `actorResolver: requestUserActorResolver()` (or your own) to require login.");
7158
7247
  return new AnonymousActorResolver();
7159
7248
  }, "useFactory"),
7160
7249
  inject: [
7161
- AGENT_OPTIONS9
7250
+ AGENT_OPTIONS10
7162
7251
  ]
7163
7252
  },
7164
7253
  {
7165
- provide: AGENT_MODEL2,
7254
+ provide: AGENT_MODEL3,
7166
7255
  useFactory: /* @__PURE__ */ __name((o) => o.model, "useFactory"),
7167
7256
  inject: [
7168
- AGENT_OPTIONS9
7257
+ AGENT_OPTIONS10
7169
7258
  ]
7170
7259
  },
7171
7260
  {
@@ -7176,7 +7265,7 @@ function sharedProviders(durable, engine) {
7176
7265
  warnAt: o.quota.warnAt
7177
7266
  } : {}), "useFactory"),
7178
7267
  inject: [
7179
- AGENT_OPTIONS9,
7268
+ AGENT_OPTIONS10,
7180
7269
  AGENT_STORE9
7181
7270
  ]
7182
7271
  },
@@ -7184,7 +7273,7 @@ function sharedProviders(durable, engine) {
7184
7273
  provide: AGENT_MODEL_CATALOG3,
7185
7274
  useFactory: /* @__PURE__ */ __name((o) => resolveCatalog(o), "useFactory"),
7186
7275
  inject: [
7187
- AGENT_OPTIONS9
7276
+ AGENT_OPTIONS10
7188
7277
  ]
7189
7278
  },
7190
7279
  AgentDepsFactory2,
@@ -7192,6 +7281,9 @@ function sharedProviders(durable, engine) {
7192
7281
  provide: AGENT_DEPS_FACTORY9,
7193
7282
  useExisting: AgentDepsFactory2
7194
7283
  },
7284
+ // Seeds a configured model's missing price row from models.dev and warns about one that would
7285
+ // record no cost (`priceCatalog`), once the app has bootstrapped.
7286
+ PricingBootService,
7195
7287
  // Populates the registry + contributors (onModuleInit) BEFORE AiToolDiscoveryService synthesizes
7196
7288
  // handoff tools (onApplicationBootstrap) reads the registry.
7197
7289
  AgentDiscoveryService,
@@ -7220,7 +7312,7 @@ function sharedProviders(durable, engine) {
7220
7312
  provide: AGENT_STORE9,
7221
7313
  useFactory: /* @__PURE__ */ __name((o, modules) => resolveStore(o, modules), "useFactory"),
7222
7314
  inject: [
7223
- AGENT_OPTIONS9,
7315
+ AGENT_OPTIONS10,
7224
7316
  ModulesContainer
7225
7317
  ]
7226
7318
  });
@@ -7257,13 +7349,13 @@ __name(sharedProviders, "sharedProviders");
7257
7349
  function exportsFor(engine) {
7258
7350
  return [
7259
7351
  ...engine?.exports ?? [],
7260
- AGENT_OPTIONS9,
7352
+ AGENT_OPTIONS10,
7261
7353
  AGENT_TOOL_REGISTRY3,
7262
7354
  AGENT_REGISTRY6,
7263
7355
  AGENT_SINK4,
7264
7356
  AGENT_ROLES_POLICY2,
7265
7357
  AGENT_ACTOR_RESOLVER14,
7266
- AGENT_MODEL2,
7358
+ AGENT_MODEL3,
7267
7359
  AGENT_STORE9,
7268
7360
  AGENT_MODEL_CATALOG3,
7269
7361
  AGENT_QUOTA_PROVIDER3,
@@ -7367,7 +7459,7 @@ var AgentModule = class _AgentModule {
7367
7459
  controllers: controllersForSurface(options.surface, options.adapters, options.engine),
7368
7460
  providers: [
7369
7461
  {
7370
- provide: AGENT_OPTIONS9,
7462
+ provide: AGENT_OPTIONS10,
7371
7463
  useValue: options
7372
7464
  },
7373
7465
  ...sharedProviders(options.durable ?? false, options.engine),
@@ -7397,7 +7489,7 @@ var AgentModule = class _AgentModule {
7397
7489
  controllers: controllersForSurface(options.surface, options.adapters, options.engine),
7398
7490
  providers: [
7399
7491
  {
7400
- provide: AGENT_OPTIONS9,
7492
+ provide: AGENT_OPTIONS10,
7401
7493
  // Stamp the STATIC wiring flags onto the factory result: `durable`/`surface` are
7402
7494
  // authoritative on the async config object (they decided the actual wiring above), and
7403
7495
  // the durable module reads `durable` back off AGENT_OPTIONS. `surface` isn't read back by
@@ -7426,7 +7518,7 @@ var AgentModule = class _AgentModule {
7426
7518
  };
7427
7519
  }
7428
7520
  };
7429
- AgentModule = _ts_decorate30([
7521
+ AgentModule = _ts_decorate31([
7430
7522
  Global2(),
7431
7523
  Module3({})
7432
7524
  ], AgentModule);