@dudousxd/nestjs-agent 1.5.0 → 1.7.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.js CHANGED
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
 
4
4
  // src/agent.module.ts
5
- import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER9, AGENT_APPROVAL_PORT, AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY5, AGENT_DURABLE_RUNNER, AGENT_MEMORY as AGENT_MEMORY3, AGENT_MODEL as AGENT_MODEL2, AGENT_OPTIONS as AGENT_OPTIONS4, AGENT_PROMPT_CONTRIBUTORS as AGENT_PROMPT_CONTRIBUTORS3, AGENT_QUOTA_STORE as AGENT_QUOTA_STORE3, AGENT_REGISTRY as AGENT_REGISTRY6, AGENT_ROLES_POLICY as AGENT_ROLES_POLICY2, AGENT_RUNNER as AGENT_RUNNER2, AGENT_SINK as AGENT_SINK2, AGENT_SKILLS as AGENT_SKILLS3, AGENT_SKILL_SOURCES as AGENT_SKILL_SOURCES2, AGENT_STORE as AGENT_STORE4, AGENT_TOOL_REGISTRY as AGENT_TOOL_REGISTRY3, AgentRegistry as AgentRegistry6, DefaultRolesPolicy, ToolRegistry as ToolRegistry3 } from "@dudousxd/nestjs-agent-core";
5
+ import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER11, AGENT_APPROVAL_PORT, AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY5, AGENT_DURABLE_RUNNER, AGENT_MEMORY as AGENT_MEMORY3, AGENT_MODEL as AGENT_MODEL2, AGENT_MODEL_CATALOG as AGENT_MODEL_CATALOG2, AGENT_OPTIONS as AGENT_OPTIONS4, AGENT_PROMPT_CONTRIBUTORS as AGENT_PROMPT_CONTRIBUTORS3, AGENT_QUOTA_STORE as AGENT_QUOTA_STORE3, AGENT_REGISTRY as AGENT_REGISTRY6, AGENT_ROLES_POLICY as AGENT_ROLES_POLICY2, AGENT_RUNNER as AGENT_RUNNER2, AGENT_SINK as AGENT_SINK2, AGENT_SKILLS as AGENT_SKILLS3, AGENT_SKILL_SOURCES as AGENT_SKILL_SOURCES2, AGENT_STORE as AGENT_STORE4, AGENT_TOOL_REGISTRY as AGENT_TOOL_REGISTRY3, AgentRegistry as AgentRegistry6, DefaultRolesPolicy, ToolRegistry as ToolRegistry3 } from "@dudousxd/nestjs-agent-core";
6
6
  import { Global, Module } from "@nestjs/common";
7
7
  import { DiscoveryModule, RouterModule } from "@nestjs/core";
8
8
 
@@ -272,7 +272,7 @@ AgentDepsFactory2 = _ts_decorate([
272
272
  ], AgentDepsFactory2);
273
273
 
274
274
  // src/agent.service.ts
275
- import { AGENT_ATTACHMENT_STAGING, AGENT_DEPS_FACTORY, AGENT_QUOTA_STORE as AGENT_QUOTA_STORE2, AGENT_RUNNER, AGENT_STORE as AGENT_STORE2, REQUESTER_APPROVER, mayDecideApproval, readElicitationQuestions, validateElicitationAnswer } from "@dudousxd/nestjs-agent-core";
275
+ import { AGENT_ATTACHMENT_STAGING, AGENT_DEPS_FACTORY, AGENT_MODEL_CATALOG, AGENT_QUOTA_STORE as AGENT_QUOTA_STORE2, AGENT_RUNNER, AGENT_STORE as AGENT_STORE2, REQUESTER_APPROVER, findCatalogModel, mayDecideApproval, readElicitationQuestions, validateElicitationAnswer } from "@dudousxd/nestjs-agent-core";
276
276
  import { BadRequestException, ForbiddenException, GoneException, Inject as Inject2, Injectable as Injectable2, NotFoundException, NotImplementedException, Optional as Optional2 } from "@nestjs/common";
277
277
 
278
278
  // src/agent-deps.ts
@@ -327,15 +327,72 @@ var AgentService = class {
327
327
  deps;
328
328
  quota;
329
329
  staging;
330
- constructor(runner, store, deps, quota, staging) {
330
+ models;
331
+ constructor(runner, store, deps, quota, staging, models) {
331
332
  this.runner = runner;
332
333
  this.store = store;
333
334
  this.deps = deps;
334
335
  this.quota = quota;
335
336
  this.staging = staging;
337
+ this.models = models;
338
+ }
339
+ /**
340
+ * The models `actor` may pick for `agent` (`GET <base>/models`). An empty catalog when none is
341
+ * bound, so a picker simply has nothing to offer.
342
+ */
343
+ async listModels(actor, agent) {
344
+ if (this.models === void 0) {
345
+ return {
346
+ providers: [],
347
+ default: null
348
+ };
349
+ }
350
+ return this.models.list({
351
+ actor,
352
+ ...agent !== void 0 ? {
353
+ agent
354
+ } : {}
355
+ });
356
+ }
357
+ /**
358
+ * `model` if the catalog offers it to this actor and agent right now, else a 400 naming why. The
359
+ * one gate every model choice passes — a send's own, and a thread's pinned one at the moment it is
360
+ * pinned and again at every turn that runs on it (availability can change in between).
361
+ */
362
+ async assertModelAllowed(actor, agent, model) {
363
+ if (this.models === void 0) {
364
+ throw new BadRequestException(`model "${model}" cannot be selected: no ModelCatalog is configured (AgentModule.forRoot({ models }))`);
365
+ }
366
+ const entry = findCatalogModel(await this.models.list({
367
+ actor,
368
+ agent
369
+ }), model);
370
+ if (entry === void 0) {
371
+ throw new BadRequestException(`model "${model}" is not offered`);
372
+ }
373
+ if (!entry.available) {
374
+ throw new BadRequestException(`model "${model}" is not available${entry.unavailableReason ? `: ${entry.unavailableReason}` : ""}`);
375
+ }
376
+ return entry.id;
377
+ }
378
+ /** The model a turn runs on: the send's own, else the thread's pinned one, else none. */
379
+ async resolveModel(actor, agent, requested, threadId) {
380
+ const model = requested ?? (threadId !== void 0 ? await this.threadModel(threadId) : null);
381
+ if (model === null || model === void 0) {
382
+ return void 0;
383
+ }
384
+ return this.assertModelAllowed(actor, agent, model);
385
+ }
386
+ async threadModel(threadId) {
387
+ const projecting = this.store;
388
+ if (typeof projecting.modelForThread === "function") {
389
+ return projecting.modelForThread(threadId);
390
+ }
391
+ return (await this.store.getThread(threadId))?.model ?? null;
336
392
  }
337
393
  async chat(params) {
338
394
  const agentName = await this.resolveAgentName(params.agentName, params.threadId);
395
+ const model = await this.resolveModel(params.actor, agentName, params.model, params.threadId);
339
396
  const attachments = await this.resolveAttachments(params.actor, params.attachments ?? []);
340
397
  let threadId = params.threadId;
341
398
  if (threadId === void 0) {
@@ -366,6 +423,9 @@ var AgentService = class {
366
423
  } : {},
367
424
  ...params.pageContext !== void 0 ? {
368
425
  pageContext: params.pageContext
426
+ } : {},
427
+ ...model !== void 0 ? {
428
+ model
369
429
  } : {}
370
430
  };
371
431
  const { runId } = await this.runner.start(input);
@@ -536,20 +596,26 @@ var AgentService = class {
536
596
  async updateThread(actor, threadId, patch) {
537
597
  const title = patch.title !== void 0 ? this.validateTitle(patch.title) : void 0;
538
598
  await this.assertOwnsThread(actor, threadId);
539
- if (patch.defaultAgent === void 0) {
599
+ if (patch.defaultAgent === void 0 && patch.model === void 0) {
540
600
  if (title !== void 0) {
541
601
  await this.store.setTitle(threadId, title);
542
602
  }
543
603
  return;
544
604
  }
545
605
  if (this.store.updateThread === void 0) {
546
- throw new NotImplementedException("Setting a thread's defaultAgent requires an AgentStore that implements updateThread(); the bound store does not support it.");
606
+ throw new NotImplementedException("Setting a thread's defaultAgent or model requires an AgentStore that implements updateThread(); the bound store does not support it.");
547
607
  }
608
+ const model = patch.model === void 0 || patch.model === null ? patch.model : await this.assertModelAllowed(actor, patch.defaultAgent ?? await this.resolveAgentName(void 0, threadId), patch.model);
548
609
  await this.store.updateThread(threadId, {
549
610
  ...title !== void 0 ? {
550
611
  title
551
612
  } : {},
552
- defaultAgent: patch.defaultAgent
613
+ ...patch.defaultAgent !== void 0 ? {
614
+ defaultAgent: patch.defaultAgent
615
+ } : {},
616
+ ...model !== void 0 ? {
617
+ model
618
+ } : {}
553
619
  });
554
620
  }
555
621
  validateTitle(title) {
@@ -596,6 +662,7 @@ var AgentService = class {
596
662
  return {
597
663
  ...thread,
598
664
  defaultAgent: thread.defaultAgent ?? null,
665
+ model: thread.model ?? null,
599
666
  activeRunId: await this.store.activeRunForThread?.(thread.id) ?? null
600
667
  };
601
668
  }
@@ -623,6 +690,40 @@ var AgentService = class {
623
690
  return this.store.truncateFrom(threadId, messageId);
624
691
  }
625
692
  /**
693
+ * Rate a message in one of `actor`'s threads: `'up'`/`'down'` with an optional comment, or `null`
694
+ * to clear the rating. Answers `404` for an unknown message, `403` for another actor's, and `501`
695
+ * on a store without `threadOfMessage` + `setMessageFeedback`.
696
+ */
697
+ async setMessageFeedback(actor, messageId, input) {
698
+ if (input.value !== null && input.value !== "up" && input.value !== "down") {
699
+ throw new BadRequestException("value must be 'up', 'down' or null");
700
+ }
701
+ if (input.comment !== void 0 && typeof input.comment !== "string") {
702
+ throw new BadRequestException("comment must be a string");
703
+ }
704
+ const comment = input.comment?.trim();
705
+ if (comment !== void 0 && comment.length > 2e3) {
706
+ throw new BadRequestException("comment must be at most 2000 characters");
707
+ }
708
+ if (this.store.threadOfMessage === void 0 || this.store.setMessageFeedback === void 0) {
709
+ throw new NotImplementedException("Message feedback requires an AgentStore that implements threadOfMessage() and setMessageFeedback(); the bound store does not support it.");
710
+ }
711
+ const threadId = await this.store.threadOfMessage(messageId);
712
+ if (threadId === null) {
713
+ throw new NotFoundException(`message ${messageId} not found`);
714
+ }
715
+ await this.assertOwnsThread(actor, threadId);
716
+ const feedback = input.value === null ? null : {
717
+ value: input.value,
718
+ ...comment !== void 0 && comment.length > 0 ? {
719
+ comment
720
+ } : {},
721
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
722
+ };
723
+ await this.store.setMessageFeedback(messageId, feedback);
724
+ return feedback;
725
+ }
726
+ /**
626
727
  * Every file this actor has staged, newest first — across threads, including uploads that were
627
728
  * never sent, which nothing else on this surface can see.
628
729
  *
@@ -829,13 +930,16 @@ AgentService = _ts_decorate2([
829
930
  _ts_param2(3, Inject2(AGENT_QUOTA_STORE2)),
830
931
  _ts_param2(4, Optional2()),
831
932
  _ts_param2(4, Inject2(AGENT_ATTACHMENT_STAGING)),
933
+ _ts_param2(5, Optional2()),
934
+ _ts_param2(5, Inject2(AGENT_MODEL_CATALOG)),
832
935
  _ts_metadata2("design:type", Function),
833
936
  _ts_metadata2("design:paramtypes", [
834
937
  typeof AgentRunner === "undefined" ? Object : AgentRunner,
835
938
  typeof AgentStore === "undefined" ? Object : AgentStore,
836
939
  typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
837
940
  Object,
838
- typeof AttachmentStagingStore === "undefined" ? Object : AttachmentStagingStore
941
+ typeof AttachmentStagingStore === "undefined" ? Object : AttachmentStagingStore,
942
+ typeof ModelCatalog === "undefined" ? Object : ModelCatalog
839
943
  ])
840
944
  ], AgentService);
841
945
 
@@ -1122,7 +1226,7 @@ AttachmentsController = _ts_decorate5([
1122
1226
 
1123
1227
  // src/controller/chat.controller.ts
1124
1228
  import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER2, AgentStreamError } from "@dudousxd/nestjs-agent-core";
1125
- import { BadRequestException as BadRequestException3, Body, Controller as Controller3, Get as Get3, Inject as Inject5, Param, Post as Post2, Req as Req2, Res } from "@nestjs/common";
1229
+ import { BadRequestException as BadRequestException3, Body, Controller as Controller3, Get as Get3, Inject as Inject5, Param, Post as Post2, Query, Req as Req2, Res } from "@nestjs/common";
1126
1230
  function _ts_decorate6(decorators, target, key, desc) {
1127
1231
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1128
1232
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
@@ -1207,13 +1311,22 @@ var ChatController = class {
1207
1311
  } : {},
1208
1312
  ...body.transient === true ? {
1209
1313
  transient: true
1314
+ } : {},
1315
+ ...typeof body.model === "string" && body.model.length > 0 ? {
1316
+ model: body.model
1210
1317
  } : {}
1211
1318
  });
1212
1319
  await this.pipe(res, runId, this.agent.subscribe(runId), threadId);
1213
1320
  }
1214
- async stream(req, runId, res) {
1321
+ /**
1322
+ * Attach to a run's stream: every buffered frame, then live ones. `?after=<seq>` (or the SSE
1323
+ * `Last-Event-ID` header a browser `EventSource` sends on its own) skips the frames a reconnecting
1324
+ * client already has — see {@link pipe} for how frames are numbered.
1325
+ */
1326
+ async stream(req, runId, res, after) {
1215
1327
  const actor = await this.actorResolver.resolve(req);
1216
- await this.pipe(res, runId, await this.agent.subscribeAs(actor, runId));
1328
+ const cursor = parseCursor(after) ?? parseCursor(req.headers["last-event-id"]) ?? 0;
1329
+ await this.pipe(res, runId, await this.agent.subscribeAs(actor, runId), void 0, cursor);
1217
1330
  }
1218
1331
  async cancel(req, runId) {
1219
1332
  const actor = await this.actorResolver.resolve(req);
@@ -1222,7 +1335,15 @@ var ChatController = class {
1222
1335
  aborted: true
1223
1336
  };
1224
1337
  }
1225
- async pipe(res, runId, events, threadId) {
1338
+ /**
1339
+ * Every `data:` frame carries an SSE `id:` — its 1-based sequence number within the run. The
1340
+ * number is a pure function of the run's buffered stream (every sink replays a run from its first
1341
+ * chunk, in write order), so the same frame gets the same number on the POST that started the run
1342
+ * and on any later `GET …/stream`, whichever replica serves it. A reconnecting client passes the
1343
+ * last one it saw as `?after=`; frames at or below it are read off the sink but not re-sent.
1344
+ * `meta`, `done` and `error` carry no id: `meta` is re-sent on every attach, the terminals once.
1345
+ */
1346
+ async pipe(res, runId, events, threadId, after = 0) {
1226
1347
  res.setHeader("Content-Type", "text/event-stream");
1227
1348
  res.setHeader("Cache-Control", "no-cache");
1228
1349
  res.setHeader("Connection", "keep-alive");
@@ -1239,6 +1360,16 @@ data: ${JSON.stringify({
1239
1360
  `);
1240
1361
  const decoder = new TextDecoder();
1241
1362
  let buffer = "";
1363
+ let seq = 0;
1364
+ const forward = /* @__PURE__ */ __name((line) => {
1365
+ seq += 1;
1366
+ if (seq > after) {
1367
+ res.write(`id: ${seq}
1368
+ data: ${line}
1369
+
1370
+ `);
1371
+ }
1372
+ }, "forward");
1242
1373
  try {
1243
1374
  for await (const chunk of events) {
1244
1375
  buffer += decoder.decode(chunk, {
@@ -1249,17 +1380,13 @@ data: ${JSON.stringify({
1249
1380
  const line = buffer.slice(0, newline);
1250
1381
  buffer = buffer.slice(newline + 1);
1251
1382
  if (line.length > 0) {
1252
- res.write(`data: ${line}
1253
-
1254
- `);
1383
+ forward(line);
1255
1384
  }
1256
1385
  newline = buffer.indexOf("\n");
1257
1386
  }
1258
1387
  }
1259
1388
  if (buffer.length > 0) {
1260
- res.write(`data: ${buffer}
1261
-
1262
- `);
1389
+ forward(buffer);
1263
1390
  }
1264
1391
  res.write("event: done\ndata: {}\n\n");
1265
1392
  } catch (error) {
@@ -1296,11 +1423,13 @@ _ts_decorate6([
1296
1423
  _ts_param5(0, Req2()),
1297
1424
  _ts_param5(1, Param("runId")),
1298
1425
  _ts_param5(2, Res()),
1426
+ _ts_param5(3, Query("after")),
1299
1427
  _ts_metadata6("design:type", Function),
1300
1428
  _ts_metadata6("design:paramtypes", [
1301
1429
  typeof Request === "undefined" ? Object : Request,
1302
1430
  String,
1303
- typeof Response === "undefined" ? Object : Response
1431
+ typeof Response === "undefined" ? Object : Response,
1432
+ String
1304
1433
  ]),
1305
1434
  _ts_metadata6("design:returntype", Promise)
1306
1435
  ], ChatController.prototype, "stream", null);
@@ -1324,10 +1453,19 @@ ChatController = _ts_decorate6([
1324
1453
  typeof ActorResolver === "undefined" ? Object : ActorResolver
1325
1454
  ])
1326
1455
  ], ChatController);
1456
+ function parseCursor(raw) {
1457
+ const value = Array.isArray(raw) ? raw[0] : raw;
1458
+ if (typeof value !== "string" || !/^\d+$/.test(value.trim())) {
1459
+ return void 0;
1460
+ }
1461
+ const parsed = Number(value.trim());
1462
+ return Number.isSafeInteger(parsed) ? parsed : void 0;
1463
+ }
1464
+ __name(parseCursor, "parseCursor");
1327
1465
 
1328
1466
  // src/controller/memories.controller.ts
1329
1467
  import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER3, AGENT_MEMORY as AGENT_MEMORY2, memoryForgetVerdict, offerMemories } from "@dudousxd/nestjs-agent-core";
1330
- import { Controller as Controller4, Delete, ForbiddenException as ForbiddenException2, Get as Get4, Inject as Inject6, NotFoundException as NotFoundException2, Optional as Optional4, Param as Param2, Query, Req as Req3 } from "@nestjs/common";
1468
+ import { Controller as Controller4, Delete, ForbiddenException as ForbiddenException2, Get as Get4, Inject as Inject6, NotFoundException as NotFoundException2, Optional as Optional4, Param as Param2, Query as Query2, Req as Req3 } from "@nestjs/common";
1331
1469
  function _ts_decorate7(decorators, target, key, desc) {
1332
1470
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1333
1471
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
@@ -1429,7 +1567,7 @@ var MemoriesController = class {
1429
1567
  _ts_decorate7([
1430
1568
  Get4(),
1431
1569
  _ts_param6(0, Req3()),
1432
- _ts_param6(1, Query("threadId")),
1570
+ _ts_param6(1, Query2("threadId")),
1433
1571
  _ts_metadata7("design:type", Function),
1434
1572
  _ts_metadata7("design:paramtypes", [
1435
1573
  typeof Request === "undefined" ? Object : Request,
@@ -1460,9 +1598,9 @@ MemoriesController = _ts_decorate7([
1460
1598
  ])
1461
1599
  ], MemoriesController);
1462
1600
 
1463
- // src/controller/quota.controller.ts
1601
+ // src/controller/messages.controller.ts
1464
1602
  import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER4 } from "@dudousxd/nestjs-agent-core";
1465
- import { Controller as Controller5, Get as Get5, Inject as Inject7, Req as Req4 } from "@nestjs/common";
1603
+ import { Body as Body2, Controller as Controller5, HttpCode, Inject as Inject7, Param as Param3, Post as Post3, Req as Req4 } from "@nestjs/common";
1466
1604
  function _ts_decorate8(decorators, target, key, desc) {
1467
1605
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1468
1606
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
@@ -1489,9 +1627,9 @@ function _ts_param7(paramIndex, decorator) {
1489
1627
  };
1490
1628
  }
1491
1629
  __name(_ts_param7, "_ts_param");
1492
- var QuotaController = class {
1630
+ var MessagesController = class {
1493
1631
  static {
1494
- __name(this, "QuotaController");
1632
+ __name(this, "MessagesController");
1495
1633
  }
1496
1634
  agent;
1497
1635
  actorResolver;
@@ -1499,33 +1637,50 @@ var QuotaController = class {
1499
1637
  this.agent = agent;
1500
1638
  this.actorResolver = actorResolver;
1501
1639
  }
1502
- async today(req) {
1640
+ /**
1641
+ * Rate a message: `{ value: 'up' | 'down' | null, comment? }`. Answers the stored rating
1642
+ * (`{ feedback: null }` once cleared). Only the thread's owner may rate its messages.
1643
+ */
1644
+ async feedback(req, id, body) {
1503
1645
  const actor = await this.actorResolver.resolve(req);
1504
- return this.agent.quotaToday(actor.id);
1646
+ const feedback = await this.agent.setMessageFeedback(actor, id, {
1647
+ value: body?.value ?? null,
1648
+ ...body?.comment !== void 0 ? {
1649
+ comment: body.comment
1650
+ } : {}
1651
+ });
1652
+ return {
1653
+ feedback
1654
+ };
1505
1655
  }
1506
1656
  };
1507
1657
  _ts_decorate8([
1508
- Get5("today"),
1658
+ Post3(":id/feedback"),
1659
+ HttpCode(200),
1509
1660
  _ts_param7(0, Req4()),
1661
+ _ts_param7(1, Param3("id")),
1662
+ _ts_param7(2, Body2()),
1510
1663
  _ts_metadata8("design:type", Function),
1511
1664
  _ts_metadata8("design:paramtypes", [
1512
- typeof Request === "undefined" ? Object : Request
1665
+ typeof Request === "undefined" ? Object : Request,
1666
+ String,
1667
+ typeof FeedbackBody === "undefined" ? Object : FeedbackBody
1513
1668
  ]),
1514
1669
  _ts_metadata8("design:returntype", Promise)
1515
- ], QuotaController.prototype, "today", null);
1516
- QuotaController = _ts_decorate8([
1517
- Controller5("quota"),
1670
+ ], MessagesController.prototype, "feedback", null);
1671
+ MessagesController = _ts_decorate8([
1672
+ Controller5("messages"),
1518
1673
  _ts_param7(1, Inject7(AGENT_ACTOR_RESOLVER4)),
1519
1674
  _ts_metadata8("design:type", Function),
1520
1675
  _ts_metadata8("design:paramtypes", [
1521
1676
  typeof AgentService === "undefined" ? Object : AgentService,
1522
1677
  typeof ActorResolver === "undefined" ? Object : ActorResolver
1523
1678
  ])
1524
- ], QuotaController);
1679
+ ], MessagesController);
1525
1680
 
1526
- // src/controller/skills.controller.ts
1527
- import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER5, AGENT_SKILLS as AGENT_SKILLS2, offerSkills } from "@dudousxd/nestjs-agent-core";
1528
- import { Controller as Controller6, Get as Get6, Inject as Inject8, Optional as Optional5, Query as Query2, Req as Req5 } from "@nestjs/common";
1681
+ // src/controller/models.controller.ts
1682
+ import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER5 } from "@dudousxd/nestjs-agent-core";
1683
+ import { Controller as Controller6, Get as Get5, Inject as Inject8, Query as Query3, Req as Req5 } from "@nestjs/common";
1529
1684
  function _ts_decorate9(decorators, target, key, desc) {
1530
1685
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1531
1686
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
@@ -1552,6 +1707,138 @@ function _ts_param8(paramIndex, decorator) {
1552
1707
  };
1553
1708
  }
1554
1709
  __name(_ts_param8, "_ts_param");
1710
+ var ModelsController = class {
1711
+ static {
1712
+ __name(this, "ModelsController");
1713
+ }
1714
+ agent;
1715
+ actorResolver;
1716
+ constructor(agent, actorResolver) {
1717
+ this.agent = agent;
1718
+ this.actorResolver = actorResolver;
1719
+ }
1720
+ /**
1721
+ * The models the caller may pick for `agent` (the default agent when omitted), grouped by
1722
+ * provider, with badges and availability — the bound `ModelCatalog`'s answer, or an empty one.
1723
+ */
1724
+ async list(req, agent) {
1725
+ const actor = await this.actorResolver.resolve(req);
1726
+ return this.agent.listModels(actor, agent);
1727
+ }
1728
+ };
1729
+ _ts_decorate9([
1730
+ Get5(),
1731
+ _ts_param8(0, Req5()),
1732
+ _ts_param8(1, Query3("agent")),
1733
+ _ts_metadata9("design:type", Function),
1734
+ _ts_metadata9("design:paramtypes", [
1735
+ typeof Request === "undefined" ? Object : Request,
1736
+ String
1737
+ ]),
1738
+ _ts_metadata9("design:returntype", Promise)
1739
+ ], ModelsController.prototype, "list", null);
1740
+ ModelsController = _ts_decorate9([
1741
+ Controller6("models"),
1742
+ _ts_param8(1, Inject8(AGENT_ACTOR_RESOLVER5)),
1743
+ _ts_metadata9("design:type", Function),
1744
+ _ts_metadata9("design:paramtypes", [
1745
+ typeof AgentService === "undefined" ? Object : AgentService,
1746
+ typeof ActorResolver === "undefined" ? Object : ActorResolver
1747
+ ])
1748
+ ], ModelsController);
1749
+
1750
+ // src/controller/quota.controller.ts
1751
+ import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER6 } from "@dudousxd/nestjs-agent-core";
1752
+ import { Controller as Controller7, Get as Get6, Inject as Inject9, Req as Req6 } from "@nestjs/common";
1753
+ function _ts_decorate10(decorators, target, key, desc) {
1754
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1755
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
1756
+ r = Reflect.decorate(decorators, target, key, desc);
1757
+ } else {
1758
+ for (var i = decorators.length - 1; i >= 0; i--) {
1759
+ if (d = decorators[i]) {
1760
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1761
+ }
1762
+ }
1763
+ }
1764
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1765
+ }
1766
+ __name(_ts_decorate10, "_ts_decorate");
1767
+ function _ts_metadata10(metadataKey, metadataValue) {
1768
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
1769
+ return Reflect.metadata(metadataKey, metadataValue);
1770
+ }
1771
+ }
1772
+ __name(_ts_metadata10, "_ts_metadata");
1773
+ function _ts_param9(paramIndex, decorator) {
1774
+ return function(target, key) {
1775
+ decorator(target, key, paramIndex);
1776
+ };
1777
+ }
1778
+ __name(_ts_param9, "_ts_param");
1779
+ var QuotaController = class {
1780
+ static {
1781
+ __name(this, "QuotaController");
1782
+ }
1783
+ agent;
1784
+ actorResolver;
1785
+ constructor(agent, actorResolver) {
1786
+ this.agent = agent;
1787
+ this.actorResolver = actorResolver;
1788
+ }
1789
+ async today(req) {
1790
+ const actor = await this.actorResolver.resolve(req);
1791
+ return this.agent.quotaToday(actor.id);
1792
+ }
1793
+ };
1794
+ _ts_decorate10([
1795
+ Get6("today"),
1796
+ _ts_param9(0, Req6()),
1797
+ _ts_metadata10("design:type", Function),
1798
+ _ts_metadata10("design:paramtypes", [
1799
+ typeof Request === "undefined" ? Object : Request
1800
+ ]),
1801
+ _ts_metadata10("design:returntype", Promise)
1802
+ ], QuotaController.prototype, "today", null);
1803
+ QuotaController = _ts_decorate10([
1804
+ Controller7("quota"),
1805
+ _ts_param9(1, Inject9(AGENT_ACTOR_RESOLVER6)),
1806
+ _ts_metadata10("design:type", Function),
1807
+ _ts_metadata10("design:paramtypes", [
1808
+ typeof AgentService === "undefined" ? Object : AgentService,
1809
+ typeof ActorResolver === "undefined" ? Object : ActorResolver
1810
+ ])
1811
+ ], QuotaController);
1812
+
1813
+ // src/controller/skills.controller.ts
1814
+ import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER7, AGENT_SKILLS as AGENT_SKILLS2, offerSkills } from "@dudousxd/nestjs-agent-core";
1815
+ import { Controller as Controller8, Get as Get7, Inject as Inject10, Optional as Optional5, Query as Query4, Req as Req7 } from "@nestjs/common";
1816
+ function _ts_decorate11(decorators, target, key, desc) {
1817
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1818
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
1819
+ r = Reflect.decorate(decorators, target, key, desc);
1820
+ } else {
1821
+ for (var i = decorators.length - 1; i >= 0; i--) {
1822
+ if (d = decorators[i]) {
1823
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1824
+ }
1825
+ }
1826
+ }
1827
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1828
+ }
1829
+ __name(_ts_decorate11, "_ts_decorate");
1830
+ function _ts_metadata11(metadataKey, metadataValue) {
1831
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
1832
+ return Reflect.metadata(metadataKey, metadataValue);
1833
+ }
1834
+ }
1835
+ __name(_ts_metadata11, "_ts_metadata");
1836
+ function _ts_param10(paramIndex, decorator) {
1837
+ return function(target, key) {
1838
+ decorator(target, key, paramIndex);
1839
+ };
1840
+ }
1841
+ __name(_ts_param10, "_ts_param");
1555
1842
  var SkillsController = class {
1556
1843
  static {
1557
1844
  __name(this, "SkillsController");
@@ -1574,33 +1861,33 @@ var SkillsController = class {
1574
1861
  return offer.entries;
1575
1862
  }
1576
1863
  };
1577
- _ts_decorate9([
1578
- Get6(),
1579
- _ts_param8(0, Req5()),
1580
- _ts_param8(1, Query2("threadId")),
1581
- _ts_metadata9("design:type", Function),
1582
- _ts_metadata9("design:paramtypes", [
1864
+ _ts_decorate11([
1865
+ Get7(),
1866
+ _ts_param10(0, Req7()),
1867
+ _ts_param10(1, Query4("threadId")),
1868
+ _ts_metadata11("design:type", Function),
1869
+ _ts_metadata11("design:paramtypes", [
1583
1870
  typeof Request === "undefined" ? Object : Request,
1584
1871
  String
1585
1872
  ]),
1586
- _ts_metadata9("design:returntype", Promise)
1873
+ _ts_metadata11("design:returntype", Promise)
1587
1874
  ], SkillsController.prototype, "list", null);
1588
- SkillsController = _ts_decorate9([
1589
- Controller6("skills"),
1590
- _ts_param8(0, Inject8(AGENT_ACTOR_RESOLVER5)),
1591
- _ts_param8(1, Optional5()),
1592
- _ts_param8(1, Inject8(AGENT_SKILLS2)),
1593
- _ts_metadata9("design:type", Function),
1594
- _ts_metadata9("design:paramtypes", [
1875
+ SkillsController = _ts_decorate11([
1876
+ Controller8("skills"),
1877
+ _ts_param10(0, Inject10(AGENT_ACTOR_RESOLVER7)),
1878
+ _ts_param10(1, Optional5()),
1879
+ _ts_param10(1, Inject10(AGENT_SKILLS2)),
1880
+ _ts_metadata11("design:type", Function),
1881
+ _ts_metadata11("design:paramtypes", [
1595
1882
  typeof ActorResolver === "undefined" ? Object : ActorResolver,
1596
1883
  Object
1597
1884
  ])
1598
1885
  ], SkillsController);
1599
1886
 
1600
1887
  // src/controller/threads.controller.ts
1601
- import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER6 } from "@dudousxd/nestjs-agent-core";
1602
- import { Body as Body2, Controller as Controller7, Delete as Delete2, Get as Get7, Inject as Inject9, Param as Param3, Patch, Post as Post3, Req as Req6 } from "@nestjs/common";
1603
- function _ts_decorate10(decorators, target, key, desc) {
1888
+ import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER8 } from "@dudousxd/nestjs-agent-core";
1889
+ import { Body as Body3, Controller as Controller9, Delete as Delete2, Get as Get8, Inject as Inject11, Param as Param4, Patch, Post as Post4, Req as Req8 } from "@nestjs/common";
1890
+ function _ts_decorate12(decorators, target, key, desc) {
1604
1891
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1605
1892
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
1606
1893
  r = Reflect.decorate(decorators, target, key, desc);
@@ -1613,19 +1900,19 @@ function _ts_decorate10(decorators, target, key, desc) {
1613
1900
  }
1614
1901
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1615
1902
  }
1616
- __name(_ts_decorate10, "_ts_decorate");
1617
- function _ts_metadata10(metadataKey, metadataValue) {
1903
+ __name(_ts_decorate12, "_ts_decorate");
1904
+ function _ts_metadata12(metadataKey, metadataValue) {
1618
1905
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
1619
1906
  return Reflect.metadata(metadataKey, metadataValue);
1620
1907
  }
1621
1908
  }
1622
- __name(_ts_metadata10, "_ts_metadata");
1623
- function _ts_param9(paramIndex, decorator) {
1909
+ __name(_ts_metadata12, "_ts_metadata");
1910
+ function _ts_param11(paramIndex, decorator) {
1624
1911
  return function(target, key) {
1625
1912
  decorator(target, key, paramIndex);
1626
1913
  };
1627
1914
  }
1628
- __name(_ts_param9, "_ts_param");
1915
+ __name(_ts_param11, "_ts_param");
1629
1916
  var ThreadsController = class {
1630
1917
  static {
1631
1918
  __name(this, "ThreadsController");
@@ -1668,6 +1955,9 @@ var ThreadsController = class {
1668
1955
  } : {},
1669
1956
  ..."defaultAgent" in body ? {
1670
1957
  defaultAgent: body.defaultAgent ?? null
1958
+ } : {},
1959
+ ..."model" in body ? {
1960
+ model: body.model ?? null
1671
1961
  } : {}
1672
1962
  });
1673
1963
  return {
@@ -1689,101 +1979,101 @@ var ThreadsController = class {
1689
1979
  };
1690
1980
  }
1691
1981
  };
1692
- _ts_decorate10([
1693
- Get7(),
1694
- _ts_param9(0, Req6()),
1695
- _ts_metadata10("design:type", Function),
1696
- _ts_metadata10("design:paramtypes", [
1982
+ _ts_decorate12([
1983
+ Get8(),
1984
+ _ts_param11(0, Req8()),
1985
+ _ts_metadata12("design:type", Function),
1986
+ _ts_metadata12("design:paramtypes", [
1697
1987
  typeof Request === "undefined" ? Object : Request
1698
1988
  ]),
1699
- _ts_metadata10("design:returntype", Promise)
1989
+ _ts_metadata12("design:returntype", Promise)
1700
1990
  ], ThreadsController.prototype, "list", null);
1701
- _ts_decorate10([
1702
- Get7(":id"),
1703
- _ts_param9(0, Req6()),
1704
- _ts_param9(1, Param3("id")),
1705
- _ts_metadata10("design:type", Function),
1706
- _ts_metadata10("design:paramtypes", [
1991
+ _ts_decorate12([
1992
+ Get8(":id"),
1993
+ _ts_param11(0, Req8()),
1994
+ _ts_param11(1, Param4("id")),
1995
+ _ts_metadata12("design:type", Function),
1996
+ _ts_metadata12("design:paramtypes", [
1707
1997
  typeof Request === "undefined" ? Object : Request,
1708
1998
  String
1709
1999
  ]),
1710
- _ts_metadata10("design:returntype", Promise)
2000
+ _ts_metadata12("design:returntype", Promise)
1711
2001
  ], ThreadsController.prototype, "detail", null);
1712
- _ts_decorate10([
2002
+ _ts_decorate12([
1713
2003
  Delete2(":id"),
1714
- _ts_param9(0, Req6()),
1715
- _ts_param9(1, Param3("id")),
1716
- _ts_metadata10("design:type", Function),
1717
- _ts_metadata10("design:paramtypes", [
2004
+ _ts_param11(0, Req8()),
2005
+ _ts_param11(1, Param4("id")),
2006
+ _ts_metadata12("design:type", Function),
2007
+ _ts_metadata12("design:paramtypes", [
1718
2008
  typeof Request === "undefined" ? Object : Request,
1719
2009
  String
1720
2010
  ]),
1721
- _ts_metadata10("design:returntype", Promise)
2011
+ _ts_metadata12("design:returntype", Promise)
1722
2012
  ], ThreadsController.prototype, "remove", null);
1723
- _ts_decorate10([
1724
- Post3(":id/fork-from/:messageId"),
1725
- _ts_param9(0, Req6()),
1726
- _ts_param9(1, Param3("id")),
1727
- _ts_param9(2, Param3("messageId")),
1728
- _ts_metadata10("design:type", Function),
1729
- _ts_metadata10("design:paramtypes", [
2013
+ _ts_decorate12([
2014
+ Post4(":id/fork-from/:messageId"),
2015
+ _ts_param11(0, Req8()),
2016
+ _ts_param11(1, Param4("id")),
2017
+ _ts_param11(2, Param4("messageId")),
2018
+ _ts_metadata12("design:type", Function),
2019
+ _ts_metadata12("design:paramtypes", [
1730
2020
  typeof Request === "undefined" ? Object : Request,
1731
2021
  String,
1732
2022
  String
1733
2023
  ]),
1734
- _ts_metadata10("design:returntype", Promise)
2024
+ _ts_metadata12("design:returntype", Promise)
1735
2025
  ], ThreadsController.prototype, "fork", null);
1736
- _ts_decorate10([
2026
+ _ts_decorate12([
1737
2027
  Patch(":id"),
1738
- _ts_param9(0, Req6()),
1739
- _ts_param9(1, Param3("id")),
1740
- _ts_param9(2, Body2()),
1741
- _ts_metadata10("design:type", Function),
1742
- _ts_metadata10("design:paramtypes", [
2028
+ _ts_param11(0, Req8()),
2029
+ _ts_param11(1, Param4("id")),
2030
+ _ts_param11(2, Body3()),
2031
+ _ts_metadata12("design:type", Function),
2032
+ _ts_metadata12("design:paramtypes", [
1743
2033
  typeof Request === "undefined" ? Object : Request,
1744
2034
  String,
1745
2035
  typeof UpdateThreadBody === "undefined" ? Object : UpdateThreadBody
1746
2036
  ]),
1747
- _ts_metadata10("design:returntype", Promise)
2037
+ _ts_metadata12("design:returntype", Promise)
1748
2038
  ], ThreadsController.prototype, "update", null);
1749
- _ts_decorate10([
1750
- Post3(":id/promote"),
1751
- _ts_param9(0, Req6()),
1752
- _ts_param9(1, Param3("id")),
1753
- _ts_metadata10("design:type", Function),
1754
- _ts_metadata10("design:paramtypes", [
2039
+ _ts_decorate12([
2040
+ Post4(":id/promote"),
2041
+ _ts_param11(0, Req8()),
2042
+ _ts_param11(1, Param4("id")),
2043
+ _ts_metadata12("design:type", Function),
2044
+ _ts_metadata12("design:paramtypes", [
1755
2045
  typeof Request === "undefined" ? Object : Request,
1756
2046
  String
1757
2047
  ]),
1758
- _ts_metadata10("design:returntype", Promise)
2048
+ _ts_metadata12("design:returntype", Promise)
1759
2049
  ], ThreadsController.prototype, "promote", null);
1760
- _ts_decorate10([
2050
+ _ts_decorate12([
1761
2051
  Delete2(":id/from/:messageId"),
1762
- _ts_param9(0, Req6()),
1763
- _ts_param9(1, Param3("id")),
1764
- _ts_param9(2, Param3("messageId")),
1765
- _ts_metadata10("design:type", Function),
1766
- _ts_metadata10("design:paramtypes", [
2052
+ _ts_param11(0, Req8()),
2053
+ _ts_param11(1, Param4("id")),
2054
+ _ts_param11(2, Param4("messageId")),
2055
+ _ts_metadata12("design:type", Function),
2056
+ _ts_metadata12("design:paramtypes", [
1767
2057
  typeof Request === "undefined" ? Object : Request,
1768
2058
  String,
1769
2059
  String
1770
2060
  ]),
1771
- _ts_metadata10("design:returntype", Promise)
2061
+ _ts_metadata12("design:returntype", Promise)
1772
2062
  ], ThreadsController.prototype, "truncateFrom", null);
1773
- ThreadsController = _ts_decorate10([
1774
- Controller7("threads"),
1775
- _ts_param9(1, Inject9(AGENT_ACTOR_RESOLVER6)),
1776
- _ts_metadata10("design:type", Function),
1777
- _ts_metadata10("design:paramtypes", [
2063
+ ThreadsController = _ts_decorate12([
2064
+ Controller9("threads"),
2065
+ _ts_param11(1, Inject11(AGENT_ACTOR_RESOLVER8)),
2066
+ _ts_metadata12("design:type", Function),
2067
+ _ts_metadata12("design:paramtypes", [
1778
2068
  typeof AgentService === "undefined" ? Object : AgentService,
1779
2069
  typeof ActorResolver === "undefined" ? Object : ActorResolver
1780
2070
  ])
1781
2071
  ], ThreadsController);
1782
2072
 
1783
2073
  // src/controller/tool-call.controller.ts
1784
- import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER7 } from "@dudousxd/nestjs-agent-core";
1785
- import { BadRequestException as BadRequestException4, Body as Body3, Controller as Controller8, Inject as Inject10, Post as Post4, Req as Req7 } from "@nestjs/common";
1786
- function _ts_decorate11(decorators, target, key, desc) {
2074
+ import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER9 } from "@dudousxd/nestjs-agent-core";
2075
+ import { BadRequestException as BadRequestException4, Body as Body4, Controller as Controller10, Inject as Inject12, Post as Post5, Req as Req9 } from "@nestjs/common";
2076
+ function _ts_decorate13(decorators, target, key, desc) {
1787
2077
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1788
2078
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
1789
2079
  r = Reflect.decorate(decorators, target, key, desc);
@@ -1796,19 +2086,19 @@ function _ts_decorate11(decorators, target, key, desc) {
1796
2086
  }
1797
2087
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1798
2088
  }
1799
- __name(_ts_decorate11, "_ts_decorate");
1800
- function _ts_metadata11(metadataKey, metadataValue) {
2089
+ __name(_ts_decorate13, "_ts_decorate");
2090
+ function _ts_metadata13(metadataKey, metadataValue) {
1801
2091
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
1802
2092
  return Reflect.metadata(metadataKey, metadataValue);
1803
2093
  }
1804
2094
  }
1805
- __name(_ts_metadata11, "_ts_metadata");
1806
- function _ts_param10(paramIndex, decorator) {
2095
+ __name(_ts_metadata13, "_ts_metadata");
2096
+ function _ts_param12(paramIndex, decorator) {
1807
2097
  return function(target, key) {
1808
2098
  decorator(target, key, paramIndex);
1809
2099
  };
1810
2100
  }
1811
- __name(_ts_param10, "_ts_param");
2101
+ __name(_ts_param12, "_ts_param");
1812
2102
  var MAX_ANSWERED_QUESTIONS = 100;
1813
2103
  var MAX_VALUES_PER_QUESTION = 100;
1814
2104
  var MAX_ANSWER_VALUE_LENGTH = 4096;
@@ -1937,64 +2227,64 @@ var ToolCallController = class {
1937
2227
  };
1938
2228
  }
1939
2229
  };
1940
- _ts_decorate11([
1941
- Post4("approve"),
1942
- _ts_param10(0, Req7()),
1943
- _ts_param10(1, Body3()),
1944
- _ts_metadata11("design:type", Function),
1945
- _ts_metadata11("design:paramtypes", [
2230
+ _ts_decorate13([
2231
+ Post5("approve"),
2232
+ _ts_param12(0, Req9()),
2233
+ _ts_param12(1, Body4()),
2234
+ _ts_metadata13("design:type", Function),
2235
+ _ts_metadata13("design:paramtypes", [
1946
2236
  typeof Request === "undefined" ? Object : Request,
1947
2237
  typeof ApproveBody === "undefined" ? Object : ApproveBody
1948
2238
  ]),
1949
- _ts_metadata11("design:returntype", Promise)
2239
+ _ts_metadata13("design:returntype", Promise)
1950
2240
  ], ToolCallController.prototype, "approve", null);
1951
- _ts_decorate11([
1952
- Post4("reject"),
1953
- _ts_param10(0, Req7()),
1954
- _ts_param10(1, Body3()),
1955
- _ts_metadata11("design:type", Function),
1956
- _ts_metadata11("design:paramtypes", [
2241
+ _ts_decorate13([
2242
+ Post5("reject"),
2243
+ _ts_param12(0, Req9()),
2244
+ _ts_param12(1, Body4()),
2245
+ _ts_metadata13("design:type", Function),
2246
+ _ts_metadata13("design:paramtypes", [
1957
2247
  typeof Request === "undefined" ? Object : Request,
1958
2248
  typeof RejectBody === "undefined" ? Object : RejectBody
1959
2249
  ]),
1960
- _ts_metadata11("design:returntype", Promise)
2250
+ _ts_metadata13("design:returntype", Promise)
1961
2251
  ], ToolCallController.prototype, "reject", null);
1962
- _ts_decorate11([
1963
- Post4("answer"),
1964
- _ts_param10(0, Req7()),
1965
- _ts_param10(1, Body3()),
1966
- _ts_metadata11("design:type", Function),
1967
- _ts_metadata11("design:paramtypes", [
2252
+ _ts_decorate13([
2253
+ Post5("answer"),
2254
+ _ts_param12(0, Req9()),
2255
+ _ts_param12(1, Body4()),
2256
+ _ts_metadata13("design:type", Function),
2257
+ _ts_metadata13("design:paramtypes", [
1968
2258
  typeof Request === "undefined" ? Object : Request,
1969
2259
  typeof AnswerBody === "undefined" ? Object : AnswerBody
1970
2260
  ]),
1971
- _ts_metadata11("design:returntype", Promise)
2261
+ _ts_metadata13("design:returntype", Promise)
1972
2262
  ], ToolCallController.prototype, "answer", null);
1973
- _ts_decorate11([
1974
- Post4("skip"),
1975
- _ts_param10(0, Req7()),
1976
- _ts_param10(1, Body3()),
1977
- _ts_metadata11("design:type", Function),
1978
- _ts_metadata11("design:paramtypes", [
2263
+ _ts_decorate13([
2264
+ Post5("skip"),
2265
+ _ts_param12(0, Req9()),
2266
+ _ts_param12(1, Body4()),
2267
+ _ts_metadata13("design:type", Function),
2268
+ _ts_metadata13("design:paramtypes", [
1979
2269
  typeof Request === "undefined" ? Object : Request,
1980
2270
  Object
1981
2271
  ]),
1982
- _ts_metadata11("design:returntype", Promise)
2272
+ _ts_metadata13("design:returntype", Promise)
1983
2273
  ], ToolCallController.prototype, "skip", null);
1984
- ToolCallController = _ts_decorate11([
1985
- Controller8("tool-call"),
1986
- _ts_param10(1, Inject10(AGENT_ACTOR_RESOLVER7)),
1987
- _ts_metadata11("design:type", Function),
1988
- _ts_metadata11("design:paramtypes", [
2274
+ ToolCallController = _ts_decorate13([
2275
+ Controller10("tool-call"),
2276
+ _ts_param12(1, Inject12(AGENT_ACTOR_RESOLVER9)),
2277
+ _ts_metadata13("design:type", Function),
2278
+ _ts_metadata13("design:paramtypes", [
1989
2279
  typeof AgentService === "undefined" ? Object : AgentService,
1990
2280
  typeof ActorResolver === "undefined" ? Object : ActorResolver
1991
2281
  ])
1992
2282
  ], ToolCallController);
1993
2283
 
1994
2284
  // src/controller/tools.controller.ts
1995
- import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER8, AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY3, AGENT_REGISTRY as AGENT_REGISTRY3, AgentRegistry as AgentRegistry4 } from "@dudousxd/nestjs-agent-core";
1996
- import { Controller as Controller9, Get as Get8, Inject as Inject11, NotFoundException as NotFoundException3, Query as Query3, Req as Req8 } from "@nestjs/common";
1997
- function _ts_decorate12(decorators, target, key, desc) {
2285
+ import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER10, AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY3, AGENT_REGISTRY as AGENT_REGISTRY3, AgentRegistry as AgentRegistry4 } from "@dudousxd/nestjs-agent-core";
2286
+ import { Controller as Controller11, Get as Get9, Inject as Inject13, NotFoundException as NotFoundException3, Query as Query5, Req as Req10 } from "@nestjs/common";
2287
+ function _ts_decorate14(decorators, target, key, desc) {
1998
2288
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1999
2289
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
2000
2290
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2007,19 +2297,19 @@ function _ts_decorate12(decorators, target, key, desc) {
2007
2297
  }
2008
2298
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2009
2299
  }
2010
- __name(_ts_decorate12, "_ts_decorate");
2011
- function _ts_metadata12(metadataKey, metadataValue) {
2300
+ __name(_ts_decorate14, "_ts_decorate");
2301
+ function _ts_metadata14(metadataKey, metadataValue) {
2012
2302
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
2013
2303
  return Reflect.metadata(metadataKey, metadataValue);
2014
2304
  }
2015
2305
  }
2016
- __name(_ts_metadata12, "_ts_metadata");
2017
- function _ts_param11(paramIndex, decorator) {
2306
+ __name(_ts_metadata14, "_ts_metadata");
2307
+ function _ts_param13(paramIndex, decorator) {
2018
2308
  return function(target, key) {
2019
2309
  decorator(target, key, paramIndex);
2020
2310
  };
2021
2311
  }
2022
- __name(_ts_param11, "_ts_param");
2312
+ __name(_ts_param13, "_ts_param");
2023
2313
  var ToolsController = class {
2024
2314
  static {
2025
2315
  __name(this, "ToolsController");
@@ -2048,24 +2338,24 @@ var ToolsController = class {
2048
2338
  }));
2049
2339
  }
2050
2340
  };
2051
- _ts_decorate12([
2052
- Get8(),
2053
- _ts_param11(0, Req8()),
2054
- _ts_param11(1, Query3("agent")),
2055
- _ts_metadata12("design:type", Function),
2056
- _ts_metadata12("design:paramtypes", [
2341
+ _ts_decorate14([
2342
+ Get9(),
2343
+ _ts_param13(0, Req10()),
2344
+ _ts_param13(1, Query5("agent")),
2345
+ _ts_metadata14("design:type", Function),
2346
+ _ts_metadata14("design:paramtypes", [
2057
2347
  typeof Request === "undefined" ? Object : Request,
2058
2348
  String
2059
2349
  ]),
2060
- _ts_metadata12("design:returntype", Promise)
2350
+ _ts_metadata14("design:returntype", Promise)
2061
2351
  ], ToolsController.prototype, "list", null);
2062
- ToolsController = _ts_decorate12([
2063
- Controller9("tools"),
2064
- _ts_param11(0, Inject11(AGENT_ACTOR_RESOLVER8)),
2065
- _ts_param11(1, Inject11(AGENT_DEPS_FACTORY3)),
2066
- _ts_param11(2, Inject11(AGENT_REGISTRY3)),
2067
- _ts_metadata12("design:type", Function),
2068
- _ts_metadata12("design:paramtypes", [
2352
+ ToolsController = _ts_decorate14([
2353
+ Controller11("tools"),
2354
+ _ts_param13(0, Inject13(AGENT_ACTOR_RESOLVER10)),
2355
+ _ts_param13(1, Inject13(AGENT_DEPS_FACTORY3)),
2356
+ _ts_param13(2, Inject13(AGENT_REGISTRY3)),
2357
+ _ts_metadata14("design:type", Function),
2358
+ _ts_metadata14("design:paramtypes", [
2069
2359
  typeof ActorResolver === "undefined" ? Object : ActorResolver,
2070
2360
  typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
2071
2361
  typeof AgentRegistry4 === "undefined" ? Object : AgentRegistry4
@@ -2074,7 +2364,7 @@ ToolsController = _ts_decorate12([
2074
2364
 
2075
2365
  // src/discovery/agent-discovery.service.ts
2076
2366
  import { AGENT_PROMPT_CONTRIBUTORS as AGENT_PROMPT_CONTRIBUTORS2, AGENT_REGISTRY as AGENT_REGISTRY4, AgentRegistry as AgentRegistry5 } from "@dudousxd/nestjs-agent-core";
2077
- import { Inject as Inject12, Injectable as Injectable4, Logger } from "@nestjs/common";
2367
+ import { Inject as Inject14, Injectable as Injectable4, Logger } from "@nestjs/common";
2078
2368
  import { DiscoveryService, MetadataScanner } from "@nestjs/core";
2079
2369
 
2080
2370
  // src/decorator/agent.decorator.ts
@@ -2109,7 +2399,7 @@ function SystemPromptContributor() {
2109
2399
  __name(SystemPromptContributor, "SystemPromptContributor");
2110
2400
 
2111
2401
  // src/discovery/agent-discovery.service.ts
2112
- function _ts_decorate13(decorators, target, key, desc) {
2402
+ function _ts_decorate15(decorators, target, key, desc) {
2113
2403
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2114
2404
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
2115
2405
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2122,19 +2412,19 @@ function _ts_decorate13(decorators, target, key, desc) {
2122
2412
  }
2123
2413
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2124
2414
  }
2125
- __name(_ts_decorate13, "_ts_decorate");
2126
- function _ts_metadata13(metadataKey, metadataValue) {
2415
+ __name(_ts_decorate15, "_ts_decorate");
2416
+ function _ts_metadata15(metadataKey, metadataValue) {
2127
2417
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
2128
2418
  return Reflect.metadata(metadataKey, metadataValue);
2129
2419
  }
2130
2420
  }
2131
- __name(_ts_metadata13, "_ts_metadata");
2132
- function _ts_param12(paramIndex, decorator) {
2421
+ __name(_ts_metadata15, "_ts_metadata");
2422
+ function _ts_param14(paramIndex, decorator) {
2133
2423
  return function(target, key) {
2134
2424
  decorator(target, key, paramIndex);
2135
2425
  };
2136
2426
  }
2137
- __name(_ts_param12, "_ts_param");
2427
+ __name(_ts_param14, "_ts_param");
2138
2428
  var AgentDiscoveryService = class _AgentDiscoveryService {
2139
2429
  static {
2140
2430
  __name(this, "AgentDiscoveryService");
@@ -2261,12 +2551,12 @@ var AgentDiscoveryService = class _AgentDiscoveryService {
2261
2551
  return (ctx) => candidate.call(instance, ctx);
2262
2552
  }
2263
2553
  };
2264
- AgentDiscoveryService = _ts_decorate13([
2554
+ AgentDiscoveryService = _ts_decorate15([
2265
2555
  Injectable4(),
2266
- _ts_param12(2, Inject12(AGENT_REGISTRY4)),
2267
- _ts_param12(3, Inject12(AGENT_PROMPT_CONTRIBUTORS2)),
2268
- _ts_metadata13("design:type", Function),
2269
- _ts_metadata13("design:paramtypes", [
2556
+ _ts_param14(2, Inject14(AGENT_REGISTRY4)),
2557
+ _ts_param14(3, Inject14(AGENT_PROMPT_CONTRIBUTORS2)),
2558
+ _ts_metadata15("design:type", Function),
2559
+ _ts_metadata15("design:paramtypes", [
2270
2560
  typeof DiscoveryService === "undefined" ? Object : DiscoveryService,
2271
2561
  typeof MetadataScanner === "undefined" ? Object : MetadataScanner,
2272
2562
  typeof AgentRegistry5 === "undefined" ? Object : AgentRegistry5,
@@ -2276,7 +2566,7 @@ AgentDiscoveryService = _ts_decorate13([
2276
2566
 
2277
2567
  // src/discovery/ai-tool-discovery.service.ts
2278
2568
  import { AGENT_OPTIONS as AGENT_OPTIONS3, AGENT_REGISTRY as AGENT_REGISTRY5, AGENT_TOOL_REGISTRY as AGENT_TOOL_REGISTRY2, normalizeDelegation as normalizeDelegation2 } from "@dudousxd/nestjs-agent-core";
2279
- import { Inject as Inject13, Injectable as Injectable5, Logger as Logger2 } from "@nestjs/common";
2569
+ import { Inject as Inject15, Injectable as Injectable5, Logger as Logger2 } from "@nestjs/common";
2280
2570
  import { DiscoveryService as DiscoveryService2 } from "@nestjs/core";
2281
2571
  import { z } from "zod";
2282
2572
 
@@ -2325,7 +2615,7 @@ function provideAgentTool(factoryOrTool, inject) {
2325
2615
  __name(provideAgentTool, "provideAgentTool");
2326
2616
 
2327
2617
  // src/discovery/ai-tool-discovery.service.ts
2328
- function _ts_decorate14(decorators, target, key, desc) {
2618
+ function _ts_decorate16(decorators, target, key, desc) {
2329
2619
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2330
2620
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
2331
2621
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2338,19 +2628,19 @@ function _ts_decorate14(decorators, target, key, desc) {
2338
2628
  }
2339
2629
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2340
2630
  }
2341
- __name(_ts_decorate14, "_ts_decorate");
2342
- function _ts_metadata14(metadataKey, metadataValue) {
2631
+ __name(_ts_decorate16, "_ts_decorate");
2632
+ function _ts_metadata16(metadataKey, metadataValue) {
2343
2633
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
2344
2634
  return Reflect.metadata(metadataKey, metadataValue);
2345
2635
  }
2346
2636
  }
2347
- __name(_ts_metadata14, "_ts_metadata");
2348
- function _ts_param13(paramIndex, decorator) {
2637
+ __name(_ts_metadata16, "_ts_metadata");
2638
+ function _ts_param15(paramIndex, decorator) {
2349
2639
  return function(target, key) {
2350
2640
  decorator(target, key, paramIndex);
2351
2641
  };
2352
2642
  }
2353
- __name(_ts_param13, "_ts_param");
2643
+ __name(_ts_param15, "_ts_param");
2354
2644
  var AiToolDiscoveryService = class _AiToolDiscoveryService {
2355
2645
  static {
2356
2646
  __name(this, "AiToolDiscoveryService");
@@ -2483,13 +2773,13 @@ var AiToolDiscoveryService = class _AiToolDiscoveryService {
2483
2773
  return true;
2484
2774
  }
2485
2775
  };
2486
- AiToolDiscoveryService = _ts_decorate14([
2776
+ AiToolDiscoveryService = _ts_decorate16([
2487
2777
  Injectable5(),
2488
- _ts_param13(1, Inject13(AGENT_TOOL_REGISTRY2)),
2489
- _ts_param13(2, Inject13(AGENT_REGISTRY5)),
2490
- _ts_param13(3, Inject13(AGENT_OPTIONS3)),
2491
- _ts_metadata14("design:type", Function),
2492
- _ts_metadata14("design:paramtypes", [
2778
+ _ts_param15(1, Inject15(AGENT_TOOL_REGISTRY2)),
2779
+ _ts_param15(2, Inject15(AGENT_REGISTRY5)),
2780
+ _ts_param15(3, Inject15(AGENT_OPTIONS3)),
2781
+ _ts_metadata16("design:type", Function),
2782
+ _ts_metadata16("design:paramtypes", [
2493
2783
  typeof DiscoveryService2 === "undefined" ? Object : DiscoveryService2,
2494
2784
  typeof ToolRegistry === "undefined" ? Object : ToolRegistry,
2495
2785
  typeof AgentRegistry === "undefined" ? Object : AgentRegistry,
@@ -2499,7 +2789,7 @@ AiToolDiscoveryService = _ts_decorate14([
2499
2789
 
2500
2790
  // src/discovery/skill-discovery.service.ts
2501
2791
  import { AGENT_SKILL_SOURCES } from "@dudousxd/nestjs-agent-core";
2502
- import { Inject as Inject14, Injectable as Injectable6, Logger as Logger3 } from "@nestjs/common";
2792
+ import { Inject as Inject16, Injectable as Injectable6, Logger as Logger3 } from "@nestjs/common";
2503
2793
  import { DiscoveryService as DiscoveryService3 } from "@nestjs/core";
2504
2794
 
2505
2795
  // src/decorator/skill.decorator.ts
@@ -2522,7 +2812,7 @@ function skillScope(options) {
2522
2812
  __name(skillScope, "skillScope");
2523
2813
 
2524
2814
  // src/discovery/skill-discovery.service.ts
2525
- function _ts_decorate15(decorators, target, key, desc) {
2815
+ function _ts_decorate17(decorators, target, key, desc) {
2526
2816
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2527
2817
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
2528
2818
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2535,19 +2825,19 @@ function _ts_decorate15(decorators, target, key, desc) {
2535
2825
  }
2536
2826
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2537
2827
  }
2538
- __name(_ts_decorate15, "_ts_decorate");
2539
- function _ts_metadata15(metadataKey, metadataValue) {
2828
+ __name(_ts_decorate17, "_ts_decorate");
2829
+ function _ts_metadata17(metadataKey, metadataValue) {
2540
2830
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
2541
2831
  return Reflect.metadata(metadataKey, metadataValue);
2542
2832
  }
2543
2833
  }
2544
- __name(_ts_metadata15, "_ts_metadata");
2545
- function _ts_param14(paramIndex, decorator) {
2834
+ __name(_ts_metadata17, "_ts_metadata");
2835
+ function _ts_param16(paramIndex, decorator) {
2546
2836
  return function(target, key) {
2547
2837
  decorator(target, key, paramIndex);
2548
2838
  };
2549
2839
  }
2550
- __name(_ts_param14, "_ts_param");
2840
+ __name(_ts_param16, "_ts_param");
2551
2841
  var SkillDiscoveryService = class _SkillDiscoveryService {
2552
2842
  static {
2553
2843
  __name(this, "SkillDiscoveryService");
@@ -2591,11 +2881,11 @@ var SkillDiscoveryService = class _SkillDiscoveryService {
2591
2881
  return flat === void 0 ? void 0 : () => flat;
2592
2882
  }
2593
2883
  };
2594
- SkillDiscoveryService = _ts_decorate15([
2884
+ SkillDiscoveryService = _ts_decorate17([
2595
2885
  Injectable6(),
2596
- _ts_param14(1, Inject14(AGENT_SKILL_SOURCES)),
2597
- _ts_metadata15("design:type", Function),
2598
- _ts_metadata15("design:paramtypes", [
2886
+ _ts_param16(1, Inject16(AGENT_SKILL_SOURCES)),
2887
+ _ts_metadata17("design:type", Function),
2888
+ _ts_metadata17("design:paramtypes", [
2599
2889
  typeof DiscoveryService3 === "undefined" ? Object : DiscoveryService3,
2600
2890
  Array
2601
2891
  ])
@@ -2694,8 +2984,8 @@ var LedgerQuotaStore = class {
2694
2984
 
2695
2985
  // src/runner/inline-agent-runner.ts
2696
2986
  import { AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY4, AGENT_STORE as AGENT_STORE3, RunCancelledError, agentFailureCode, encodeStreamEvent, publishAgentRunFailed, runAgentLoop, settleAll, settleUnsettledDelegation } from "@dudousxd/nestjs-agent-core";
2697
- import { Inject as Inject15, Injectable as Injectable7, Logger as Logger4 } from "@nestjs/common";
2698
- function _ts_decorate16(decorators, target, key, desc) {
2987
+ import { Inject as Inject17, Injectable as Injectable7, Logger as Logger4 } from "@nestjs/common";
2988
+ function _ts_decorate18(decorators, target, key, desc) {
2699
2989
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2700
2990
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
2701
2991
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2708,19 +2998,19 @@ function _ts_decorate16(decorators, target, key, desc) {
2708
2998
  }
2709
2999
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2710
3000
  }
2711
- __name(_ts_decorate16, "_ts_decorate");
2712
- function _ts_metadata16(metadataKey, metadataValue) {
3001
+ __name(_ts_decorate18, "_ts_decorate");
3002
+ function _ts_metadata18(metadataKey, metadataValue) {
2713
3003
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
2714
3004
  return Reflect.metadata(metadataKey, metadataValue);
2715
3005
  }
2716
3006
  }
2717
- __name(_ts_metadata16, "_ts_metadata");
2718
- function _ts_param15(paramIndex, decorator) {
3007
+ __name(_ts_metadata18, "_ts_metadata");
3008
+ function _ts_param17(paramIndex, decorator) {
2719
3009
  return function(target, key) {
2720
3010
  decorator(target, key, paramIndex);
2721
3011
  };
2722
3012
  }
2723
- __name(_ts_param15, "_ts_param");
3013
+ __name(_ts_param17, "_ts_param");
2724
3014
  var InlineAgentRunner = class _InlineAgentRunner {
2725
3015
  static {
2726
3016
  __name(this, "InlineAgentRunner");
@@ -3101,12 +3391,12 @@ var InlineAgentRunner = class _InlineAgentRunner {
3101
3391
  }
3102
3392
  }
3103
3393
  };
3104
- InlineAgentRunner = _ts_decorate16([
3394
+ InlineAgentRunner = _ts_decorate18([
3105
3395
  Injectable7(),
3106
- _ts_param15(0, Inject15(AGENT_DEPS_FACTORY4)),
3107
- _ts_param15(1, Inject15(AGENT_STORE3)),
3108
- _ts_metadata16("design:type", Function),
3109
- _ts_metadata16("design:paramtypes", [
3396
+ _ts_param17(0, Inject17(AGENT_DEPS_FACTORY4)),
3397
+ _ts_param17(1, Inject17(AGENT_STORE3)),
3398
+ _ts_metadata18("design:type", Function),
3399
+ _ts_metadata18("design:paramtypes", [
3110
3400
  typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
3111
3401
  typeof AgentStore === "undefined" ? Object : AgentStore
3112
3402
  ])
@@ -3151,7 +3441,7 @@ function resolveSkillsConfig(options, declared) {
3151
3441
  __name(resolveSkillsConfig, "resolveSkillsConfig");
3152
3442
 
3153
3443
  // src/agent.module.ts
3154
- function _ts_decorate17(decorators, target, key, desc) {
3444
+ function _ts_decorate19(decorators, target, key, desc) {
3155
3445
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3156
3446
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
3157
3447
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3164,7 +3454,7 @@ function _ts_decorate17(decorators, target, key, desc) {
3164
3454
  }
3165
3455
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3166
3456
  }
3167
- __name(_ts_decorate17, "_ts_decorate");
3457
+ __name(_ts_decorate19, "_ts_decorate");
3168
3458
  var DEFAULT_PATH = "agent";
3169
3459
  function sharedProviders(durable, includeStore) {
3170
3460
  const providers = [
@@ -3223,7 +3513,7 @@ function sharedProviders(durable, includeStore) {
3223
3513
  ]
3224
3514
  },
3225
3515
  {
3226
- provide: AGENT_ACTOR_RESOLVER9,
3516
+ provide: AGENT_ACTOR_RESOLVER11,
3227
3517
  useFactory: /* @__PURE__ */ __name((options) => options.actorResolver, "useFactory"),
3228
3518
  inject: [
3229
3519
  AGENT_OPTIONS4
@@ -3247,6 +3537,13 @@ function sharedProviders(durable, includeStore) {
3247
3537
  AGENT_STORE4
3248
3538
  ]
3249
3539
  },
3540
+ {
3541
+ provide: AGENT_MODEL_CATALOG2,
3542
+ useFactory: /* @__PURE__ */ __name((o) => o.models, "useFactory"),
3543
+ inject: [
3544
+ AGENT_OPTIONS4
3545
+ ]
3546
+ },
3250
3547
  AgentDepsFactory2,
3251
3548
  {
3252
3549
  provide: AGENT_DEPS_FACTORY5,
@@ -3308,12 +3605,13 @@ function exportsFor(includeStore) {
3308
3605
  AGENT_REGISTRY6,
3309
3606
  AGENT_SINK2,
3310
3607
  AGENT_ROLES_POLICY2,
3311
- AGENT_ACTOR_RESOLVER9,
3608
+ AGENT_ACTOR_RESOLVER11,
3312
3609
  AGENT_MODEL2,
3313
3610
  ...includeStore ? [
3314
3611
  AGENT_STORE4
3315
3612
  ] : [],
3316
3613
  AGENT_QUOTA_STORE3,
3614
+ AGENT_MODEL_CATALOG2,
3317
3615
  AGENT_PROMPT_CONTRIBUTORS3,
3318
3616
  AGENT_SKILLS3,
3319
3617
  AGENT_MEMORY3,
@@ -3333,7 +3631,9 @@ var BASE_CONTROLLERS = [
3333
3631
  AgentsController,
3334
3632
  SkillsController,
3335
3633
  MemoriesController,
3336
- ToolsController
3634
+ ToolsController,
3635
+ MessagesController,
3636
+ ModelsController
3337
3637
  ];
3338
3638
  var GUARDABLE_CONTROLLERS = [
3339
3639
  ...BASE_CONTROLLERS,
@@ -3436,7 +3736,7 @@ var AgentModule = class _AgentModule {
3436
3736
  };
3437
3737
  }
3438
3738
  };
3439
- AgentModule = _ts_decorate17([
3739
+ AgentModule = _ts_decorate19([
3440
3740
  Global(),
3441
3741
  Module({})
3442
3742
  ], AgentModule);
@@ -3495,6 +3795,8 @@ export {
3495
3795
  InlineAgentRunner,
3496
3796
  LedgerQuotaStore,
3497
3797
  MemoriesController,
3798
+ MessagesController,
3799
+ ModelsController,
3498
3800
  SKILL_METADATA,
3499
3801
  SYSTEM_PROMPT_CONTRIBUTOR_METADATA,
3500
3802
  SYSTEM_PROMPT_METADATA,