@dudousxd/nestjs-agent 1.6.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_RESOLVER10, 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
  }
@@ -863,13 +930,16 @@ AgentService = _ts_decorate2([
863
930
  _ts_param2(3, Inject2(AGENT_QUOTA_STORE2)),
864
931
  _ts_param2(4, Optional2()),
865
932
  _ts_param2(4, Inject2(AGENT_ATTACHMENT_STAGING)),
933
+ _ts_param2(5, Optional2()),
934
+ _ts_param2(5, Inject2(AGENT_MODEL_CATALOG)),
866
935
  _ts_metadata2("design:type", Function),
867
936
  _ts_metadata2("design:paramtypes", [
868
937
  typeof AgentRunner === "undefined" ? Object : AgentRunner,
869
938
  typeof AgentStore === "undefined" ? Object : AgentStore,
870
939
  typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
871
940
  Object,
872
- typeof AttachmentStagingStore === "undefined" ? Object : AttachmentStagingStore
941
+ typeof AttachmentStagingStore === "undefined" ? Object : AttachmentStagingStore,
942
+ typeof ModelCatalog === "undefined" ? Object : ModelCatalog
873
943
  ])
874
944
  ], AgentService);
875
945
 
@@ -1241,6 +1311,9 @@ var ChatController = class {
1241
1311
  } : {},
1242
1312
  ...body.transient === true ? {
1243
1313
  transient: true
1314
+ } : {},
1315
+ ...typeof body.model === "string" && body.model.length > 0 ? {
1316
+ model: body.model
1244
1317
  } : {}
1245
1318
  });
1246
1319
  await this.pipe(res, runId, this.agent.subscribe(runId), threadId);
@@ -1605,9 +1678,9 @@ MessagesController = _ts_decorate8([
1605
1678
  ])
1606
1679
  ], MessagesController);
1607
1680
 
1608
- // src/controller/quota.controller.ts
1681
+ // src/controller/models.controller.ts
1609
1682
  import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER5 } from "@dudousxd/nestjs-agent-core";
1610
- import { Controller as Controller6, Get as Get5, Inject as Inject8, Req as Req5 } from "@nestjs/common";
1683
+ import { Controller as Controller6, Get as Get5, Inject as Inject8, Query as Query3, Req as Req5 } from "@nestjs/common";
1611
1684
  function _ts_decorate9(decorators, target, key, desc) {
1612
1685
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1613
1686
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
@@ -1634,9 +1707,9 @@ function _ts_param8(paramIndex, decorator) {
1634
1707
  };
1635
1708
  }
1636
1709
  __name(_ts_param8, "_ts_param");
1637
- var QuotaController = class {
1710
+ var ModelsController = class {
1638
1711
  static {
1639
- __name(this, "QuotaController");
1712
+ __name(this, "ModelsController");
1640
1713
  }
1641
1714
  agent;
1642
1715
  actorResolver;
@@ -1644,33 +1717,39 @@ var QuotaController = class {
1644
1717
  this.agent = agent;
1645
1718
  this.actorResolver = actorResolver;
1646
1719
  }
1647
- async today(req) {
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) {
1648
1725
  const actor = await this.actorResolver.resolve(req);
1649
- return this.agent.quotaToday(actor.id);
1726
+ return this.agent.listModels(actor, agent);
1650
1727
  }
1651
1728
  };
1652
1729
  _ts_decorate9([
1653
- Get5("today"),
1730
+ Get5(),
1654
1731
  _ts_param8(0, Req5()),
1732
+ _ts_param8(1, Query3("agent")),
1655
1733
  _ts_metadata9("design:type", Function),
1656
1734
  _ts_metadata9("design:paramtypes", [
1657
- typeof Request === "undefined" ? Object : Request
1735
+ typeof Request === "undefined" ? Object : Request,
1736
+ String
1658
1737
  ]),
1659
1738
  _ts_metadata9("design:returntype", Promise)
1660
- ], QuotaController.prototype, "today", null);
1661
- QuotaController = _ts_decorate9([
1662
- Controller6("quota"),
1739
+ ], ModelsController.prototype, "list", null);
1740
+ ModelsController = _ts_decorate9([
1741
+ Controller6("models"),
1663
1742
  _ts_param8(1, Inject8(AGENT_ACTOR_RESOLVER5)),
1664
1743
  _ts_metadata9("design:type", Function),
1665
1744
  _ts_metadata9("design:paramtypes", [
1666
1745
  typeof AgentService === "undefined" ? Object : AgentService,
1667
1746
  typeof ActorResolver === "undefined" ? Object : ActorResolver
1668
1747
  ])
1669
- ], QuotaController);
1748
+ ], ModelsController);
1670
1749
 
1671
- // src/controller/skills.controller.ts
1672
- import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER6, AGENT_SKILLS as AGENT_SKILLS2, offerSkills } from "@dudousxd/nestjs-agent-core";
1673
- import { Controller as Controller7, Get as Get6, Inject as Inject9, Optional as Optional5, Query as Query3, Req as Req6 } from "@nestjs/common";
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";
1674
1753
  function _ts_decorate10(decorators, target, key, desc) {
1675
1754
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1676
1755
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
@@ -1697,6 +1776,69 @@ function _ts_param9(paramIndex, decorator) {
1697
1776
  };
1698
1777
  }
1699
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");
1700
1842
  var SkillsController = class {
1701
1843
  static {
1702
1844
  __name(this, "SkillsController");
@@ -1719,33 +1861,33 @@ var SkillsController = class {
1719
1861
  return offer.entries;
1720
1862
  }
1721
1863
  };
1722
- _ts_decorate10([
1723
- Get6(),
1724
- _ts_param9(0, Req6()),
1725
- _ts_param9(1, Query3("threadId")),
1726
- _ts_metadata10("design:type", Function),
1727
- _ts_metadata10("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", [
1728
1870
  typeof Request === "undefined" ? Object : Request,
1729
1871
  String
1730
1872
  ]),
1731
- _ts_metadata10("design:returntype", Promise)
1873
+ _ts_metadata11("design:returntype", Promise)
1732
1874
  ], SkillsController.prototype, "list", null);
1733
- SkillsController = _ts_decorate10([
1734
- Controller7("skills"),
1735
- _ts_param9(0, Inject9(AGENT_ACTOR_RESOLVER6)),
1736
- _ts_param9(1, Optional5()),
1737
- _ts_param9(1, Inject9(AGENT_SKILLS2)),
1738
- _ts_metadata10("design:type", Function),
1739
- _ts_metadata10("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", [
1740
1882
  typeof ActorResolver === "undefined" ? Object : ActorResolver,
1741
1883
  Object
1742
1884
  ])
1743
1885
  ], SkillsController);
1744
1886
 
1745
1887
  // src/controller/threads.controller.ts
1746
- import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER7 } from "@dudousxd/nestjs-agent-core";
1747
- import { Body as Body3, Controller as Controller8, Delete as Delete2, Get as Get7, Inject as Inject10, Param as Param4, Patch, Post as Post4, Req as Req7 } from "@nestjs/common";
1748
- function _ts_decorate11(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) {
1749
1891
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1750
1892
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
1751
1893
  r = Reflect.decorate(decorators, target, key, desc);
@@ -1758,19 +1900,19 @@ function _ts_decorate11(decorators, target, key, desc) {
1758
1900
  }
1759
1901
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1760
1902
  }
1761
- __name(_ts_decorate11, "_ts_decorate");
1762
- function _ts_metadata11(metadataKey, metadataValue) {
1903
+ __name(_ts_decorate12, "_ts_decorate");
1904
+ function _ts_metadata12(metadataKey, metadataValue) {
1763
1905
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
1764
1906
  return Reflect.metadata(metadataKey, metadataValue);
1765
1907
  }
1766
1908
  }
1767
- __name(_ts_metadata11, "_ts_metadata");
1768
- function _ts_param10(paramIndex, decorator) {
1909
+ __name(_ts_metadata12, "_ts_metadata");
1910
+ function _ts_param11(paramIndex, decorator) {
1769
1911
  return function(target, key) {
1770
1912
  decorator(target, key, paramIndex);
1771
1913
  };
1772
1914
  }
1773
- __name(_ts_param10, "_ts_param");
1915
+ __name(_ts_param11, "_ts_param");
1774
1916
  var ThreadsController = class {
1775
1917
  static {
1776
1918
  __name(this, "ThreadsController");
@@ -1813,6 +1955,9 @@ var ThreadsController = class {
1813
1955
  } : {},
1814
1956
  ..."defaultAgent" in body ? {
1815
1957
  defaultAgent: body.defaultAgent ?? null
1958
+ } : {},
1959
+ ..."model" in body ? {
1960
+ model: body.model ?? null
1816
1961
  } : {}
1817
1962
  });
1818
1963
  return {
@@ -1834,101 +1979,101 @@ var ThreadsController = class {
1834
1979
  };
1835
1980
  }
1836
1981
  };
1837
- _ts_decorate11([
1838
- Get7(),
1839
- _ts_param10(0, Req7()),
1840
- _ts_metadata11("design:type", Function),
1841
- _ts_metadata11("design:paramtypes", [
1982
+ _ts_decorate12([
1983
+ Get8(),
1984
+ _ts_param11(0, Req8()),
1985
+ _ts_metadata12("design:type", Function),
1986
+ _ts_metadata12("design:paramtypes", [
1842
1987
  typeof Request === "undefined" ? Object : Request
1843
1988
  ]),
1844
- _ts_metadata11("design:returntype", Promise)
1989
+ _ts_metadata12("design:returntype", Promise)
1845
1990
  ], ThreadsController.prototype, "list", null);
1846
- _ts_decorate11([
1847
- Get7(":id"),
1848
- _ts_param10(0, Req7()),
1849
- _ts_param10(1, Param4("id")),
1850
- _ts_metadata11("design:type", Function),
1851
- _ts_metadata11("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", [
1852
1997
  typeof Request === "undefined" ? Object : Request,
1853
1998
  String
1854
1999
  ]),
1855
- _ts_metadata11("design:returntype", Promise)
2000
+ _ts_metadata12("design:returntype", Promise)
1856
2001
  ], ThreadsController.prototype, "detail", null);
1857
- _ts_decorate11([
2002
+ _ts_decorate12([
1858
2003
  Delete2(":id"),
1859
- _ts_param10(0, Req7()),
1860
- _ts_param10(1, Param4("id")),
1861
- _ts_metadata11("design:type", Function),
1862
- _ts_metadata11("design:paramtypes", [
2004
+ _ts_param11(0, Req8()),
2005
+ _ts_param11(1, Param4("id")),
2006
+ _ts_metadata12("design:type", Function),
2007
+ _ts_metadata12("design:paramtypes", [
1863
2008
  typeof Request === "undefined" ? Object : Request,
1864
2009
  String
1865
2010
  ]),
1866
- _ts_metadata11("design:returntype", Promise)
2011
+ _ts_metadata12("design:returntype", Promise)
1867
2012
  ], ThreadsController.prototype, "remove", null);
1868
- _ts_decorate11([
2013
+ _ts_decorate12([
1869
2014
  Post4(":id/fork-from/:messageId"),
1870
- _ts_param10(0, Req7()),
1871
- _ts_param10(1, Param4("id")),
1872
- _ts_param10(2, Param4("messageId")),
1873
- _ts_metadata11("design:type", Function),
1874
- _ts_metadata11("design:paramtypes", [
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", [
1875
2020
  typeof Request === "undefined" ? Object : Request,
1876
2021
  String,
1877
2022
  String
1878
2023
  ]),
1879
- _ts_metadata11("design:returntype", Promise)
2024
+ _ts_metadata12("design:returntype", Promise)
1880
2025
  ], ThreadsController.prototype, "fork", null);
1881
- _ts_decorate11([
2026
+ _ts_decorate12([
1882
2027
  Patch(":id"),
1883
- _ts_param10(0, Req7()),
1884
- _ts_param10(1, Param4("id")),
1885
- _ts_param10(2, Body3()),
1886
- _ts_metadata11("design:type", Function),
1887
- _ts_metadata11("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", [
1888
2033
  typeof Request === "undefined" ? Object : Request,
1889
2034
  String,
1890
2035
  typeof UpdateThreadBody === "undefined" ? Object : UpdateThreadBody
1891
2036
  ]),
1892
- _ts_metadata11("design:returntype", Promise)
2037
+ _ts_metadata12("design:returntype", Promise)
1893
2038
  ], ThreadsController.prototype, "update", null);
1894
- _ts_decorate11([
2039
+ _ts_decorate12([
1895
2040
  Post4(":id/promote"),
1896
- _ts_param10(0, Req7()),
1897
- _ts_param10(1, Param4("id")),
1898
- _ts_metadata11("design:type", Function),
1899
- _ts_metadata11("design:paramtypes", [
2041
+ _ts_param11(0, Req8()),
2042
+ _ts_param11(1, Param4("id")),
2043
+ _ts_metadata12("design:type", Function),
2044
+ _ts_metadata12("design:paramtypes", [
1900
2045
  typeof Request === "undefined" ? Object : Request,
1901
2046
  String
1902
2047
  ]),
1903
- _ts_metadata11("design:returntype", Promise)
2048
+ _ts_metadata12("design:returntype", Promise)
1904
2049
  ], ThreadsController.prototype, "promote", null);
1905
- _ts_decorate11([
2050
+ _ts_decorate12([
1906
2051
  Delete2(":id/from/:messageId"),
1907
- _ts_param10(0, Req7()),
1908
- _ts_param10(1, Param4("id")),
1909
- _ts_param10(2, Param4("messageId")),
1910
- _ts_metadata11("design:type", Function),
1911
- _ts_metadata11("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", [
1912
2057
  typeof Request === "undefined" ? Object : Request,
1913
2058
  String,
1914
2059
  String
1915
2060
  ]),
1916
- _ts_metadata11("design:returntype", Promise)
2061
+ _ts_metadata12("design:returntype", Promise)
1917
2062
  ], ThreadsController.prototype, "truncateFrom", null);
1918
- ThreadsController = _ts_decorate11([
1919
- Controller8("threads"),
1920
- _ts_param10(1, Inject10(AGENT_ACTOR_RESOLVER7)),
1921
- _ts_metadata11("design:type", Function),
1922
- _ts_metadata11("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", [
1923
2068
  typeof AgentService === "undefined" ? Object : AgentService,
1924
2069
  typeof ActorResolver === "undefined" ? Object : ActorResolver
1925
2070
  ])
1926
2071
  ], ThreadsController);
1927
2072
 
1928
2073
  // src/controller/tool-call.controller.ts
1929
- import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER8 } from "@dudousxd/nestjs-agent-core";
1930
- import { BadRequestException as BadRequestException4, Body as Body4, Controller as Controller9, Inject as Inject11, Post as Post5, Req as Req8 } from "@nestjs/common";
1931
- function _ts_decorate12(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) {
1932
2077
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1933
2078
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
1934
2079
  r = Reflect.decorate(decorators, target, key, desc);
@@ -1941,19 +2086,19 @@ function _ts_decorate12(decorators, target, key, desc) {
1941
2086
  }
1942
2087
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1943
2088
  }
1944
- __name(_ts_decorate12, "_ts_decorate");
1945
- function _ts_metadata12(metadataKey, metadataValue) {
2089
+ __name(_ts_decorate13, "_ts_decorate");
2090
+ function _ts_metadata13(metadataKey, metadataValue) {
1946
2091
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
1947
2092
  return Reflect.metadata(metadataKey, metadataValue);
1948
2093
  }
1949
2094
  }
1950
- __name(_ts_metadata12, "_ts_metadata");
1951
- function _ts_param11(paramIndex, decorator) {
2095
+ __name(_ts_metadata13, "_ts_metadata");
2096
+ function _ts_param12(paramIndex, decorator) {
1952
2097
  return function(target, key) {
1953
2098
  decorator(target, key, paramIndex);
1954
2099
  };
1955
2100
  }
1956
- __name(_ts_param11, "_ts_param");
2101
+ __name(_ts_param12, "_ts_param");
1957
2102
  var MAX_ANSWERED_QUESTIONS = 100;
1958
2103
  var MAX_VALUES_PER_QUESTION = 100;
1959
2104
  var MAX_ANSWER_VALUE_LENGTH = 4096;
@@ -2082,64 +2227,64 @@ var ToolCallController = class {
2082
2227
  };
2083
2228
  }
2084
2229
  };
2085
- _ts_decorate12([
2230
+ _ts_decorate13([
2086
2231
  Post5("approve"),
2087
- _ts_param11(0, Req8()),
2088
- _ts_param11(1, Body4()),
2089
- _ts_metadata12("design:type", Function),
2090
- _ts_metadata12("design:paramtypes", [
2232
+ _ts_param12(0, Req9()),
2233
+ _ts_param12(1, Body4()),
2234
+ _ts_metadata13("design:type", Function),
2235
+ _ts_metadata13("design:paramtypes", [
2091
2236
  typeof Request === "undefined" ? Object : Request,
2092
2237
  typeof ApproveBody === "undefined" ? Object : ApproveBody
2093
2238
  ]),
2094
- _ts_metadata12("design:returntype", Promise)
2239
+ _ts_metadata13("design:returntype", Promise)
2095
2240
  ], ToolCallController.prototype, "approve", null);
2096
- _ts_decorate12([
2241
+ _ts_decorate13([
2097
2242
  Post5("reject"),
2098
- _ts_param11(0, Req8()),
2099
- _ts_param11(1, Body4()),
2100
- _ts_metadata12("design:type", Function),
2101
- _ts_metadata12("design:paramtypes", [
2243
+ _ts_param12(0, Req9()),
2244
+ _ts_param12(1, Body4()),
2245
+ _ts_metadata13("design:type", Function),
2246
+ _ts_metadata13("design:paramtypes", [
2102
2247
  typeof Request === "undefined" ? Object : Request,
2103
2248
  typeof RejectBody === "undefined" ? Object : RejectBody
2104
2249
  ]),
2105
- _ts_metadata12("design:returntype", Promise)
2250
+ _ts_metadata13("design:returntype", Promise)
2106
2251
  ], ToolCallController.prototype, "reject", null);
2107
- _ts_decorate12([
2252
+ _ts_decorate13([
2108
2253
  Post5("answer"),
2109
- _ts_param11(0, Req8()),
2110
- _ts_param11(1, Body4()),
2111
- _ts_metadata12("design:type", Function),
2112
- _ts_metadata12("design:paramtypes", [
2254
+ _ts_param12(0, Req9()),
2255
+ _ts_param12(1, Body4()),
2256
+ _ts_metadata13("design:type", Function),
2257
+ _ts_metadata13("design:paramtypes", [
2113
2258
  typeof Request === "undefined" ? Object : Request,
2114
2259
  typeof AnswerBody === "undefined" ? Object : AnswerBody
2115
2260
  ]),
2116
- _ts_metadata12("design:returntype", Promise)
2261
+ _ts_metadata13("design:returntype", Promise)
2117
2262
  ], ToolCallController.prototype, "answer", null);
2118
- _ts_decorate12([
2263
+ _ts_decorate13([
2119
2264
  Post5("skip"),
2120
- _ts_param11(0, Req8()),
2121
- _ts_param11(1, Body4()),
2122
- _ts_metadata12("design:type", Function),
2123
- _ts_metadata12("design:paramtypes", [
2265
+ _ts_param12(0, Req9()),
2266
+ _ts_param12(1, Body4()),
2267
+ _ts_metadata13("design:type", Function),
2268
+ _ts_metadata13("design:paramtypes", [
2124
2269
  typeof Request === "undefined" ? Object : Request,
2125
2270
  Object
2126
2271
  ]),
2127
- _ts_metadata12("design:returntype", Promise)
2272
+ _ts_metadata13("design:returntype", Promise)
2128
2273
  ], ToolCallController.prototype, "skip", null);
2129
- ToolCallController = _ts_decorate12([
2130
- Controller9("tool-call"),
2131
- _ts_param11(1, Inject11(AGENT_ACTOR_RESOLVER8)),
2132
- _ts_metadata12("design:type", Function),
2133
- _ts_metadata12("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", [
2134
2279
  typeof AgentService === "undefined" ? Object : AgentService,
2135
2280
  typeof ActorResolver === "undefined" ? Object : ActorResolver
2136
2281
  ])
2137
2282
  ], ToolCallController);
2138
2283
 
2139
2284
  // src/controller/tools.controller.ts
2140
- import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER9, AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY3, AGENT_REGISTRY as AGENT_REGISTRY3, AgentRegistry as AgentRegistry4 } from "@dudousxd/nestjs-agent-core";
2141
- import { Controller as Controller10, Get as Get8, Inject as Inject12, NotFoundException as NotFoundException3, Query as Query4, Req as Req9 } from "@nestjs/common";
2142
- function _ts_decorate13(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) {
2143
2288
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2144
2289
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
2145
2290
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2152,19 +2297,19 @@ function _ts_decorate13(decorators, target, key, desc) {
2152
2297
  }
2153
2298
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2154
2299
  }
2155
- __name(_ts_decorate13, "_ts_decorate");
2156
- function _ts_metadata13(metadataKey, metadataValue) {
2300
+ __name(_ts_decorate14, "_ts_decorate");
2301
+ function _ts_metadata14(metadataKey, metadataValue) {
2157
2302
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
2158
2303
  return Reflect.metadata(metadataKey, metadataValue);
2159
2304
  }
2160
2305
  }
2161
- __name(_ts_metadata13, "_ts_metadata");
2162
- function _ts_param12(paramIndex, decorator) {
2306
+ __name(_ts_metadata14, "_ts_metadata");
2307
+ function _ts_param13(paramIndex, decorator) {
2163
2308
  return function(target, key) {
2164
2309
  decorator(target, key, paramIndex);
2165
2310
  };
2166
2311
  }
2167
- __name(_ts_param12, "_ts_param");
2312
+ __name(_ts_param13, "_ts_param");
2168
2313
  var ToolsController = class {
2169
2314
  static {
2170
2315
  __name(this, "ToolsController");
@@ -2193,24 +2338,24 @@ var ToolsController = class {
2193
2338
  }));
2194
2339
  }
2195
2340
  };
2196
- _ts_decorate13([
2197
- Get8(),
2198
- _ts_param12(0, Req9()),
2199
- _ts_param12(1, Query4("agent")),
2200
- _ts_metadata13("design:type", Function),
2201
- _ts_metadata13("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", [
2202
2347
  typeof Request === "undefined" ? Object : Request,
2203
2348
  String
2204
2349
  ]),
2205
- _ts_metadata13("design:returntype", Promise)
2350
+ _ts_metadata14("design:returntype", Promise)
2206
2351
  ], ToolsController.prototype, "list", null);
2207
- ToolsController = _ts_decorate13([
2208
- Controller10("tools"),
2209
- _ts_param12(0, Inject12(AGENT_ACTOR_RESOLVER9)),
2210
- _ts_param12(1, Inject12(AGENT_DEPS_FACTORY3)),
2211
- _ts_param12(2, Inject12(AGENT_REGISTRY3)),
2212
- _ts_metadata13("design:type", Function),
2213
- _ts_metadata13("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", [
2214
2359
  typeof ActorResolver === "undefined" ? Object : ActorResolver,
2215
2360
  typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
2216
2361
  typeof AgentRegistry4 === "undefined" ? Object : AgentRegistry4
@@ -2219,7 +2364,7 @@ ToolsController = _ts_decorate13([
2219
2364
 
2220
2365
  // src/discovery/agent-discovery.service.ts
2221
2366
  import { AGENT_PROMPT_CONTRIBUTORS as AGENT_PROMPT_CONTRIBUTORS2, AGENT_REGISTRY as AGENT_REGISTRY4, AgentRegistry as AgentRegistry5 } from "@dudousxd/nestjs-agent-core";
2222
- import { Inject as Inject13, Injectable as Injectable4, Logger } from "@nestjs/common";
2367
+ import { Inject as Inject14, Injectable as Injectable4, Logger } from "@nestjs/common";
2223
2368
  import { DiscoveryService, MetadataScanner } from "@nestjs/core";
2224
2369
 
2225
2370
  // src/decorator/agent.decorator.ts
@@ -2254,7 +2399,7 @@ function SystemPromptContributor() {
2254
2399
  __name(SystemPromptContributor, "SystemPromptContributor");
2255
2400
 
2256
2401
  // src/discovery/agent-discovery.service.ts
2257
- function _ts_decorate14(decorators, target, key, desc) {
2402
+ function _ts_decorate15(decorators, target, key, desc) {
2258
2403
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2259
2404
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
2260
2405
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2267,19 +2412,19 @@ function _ts_decorate14(decorators, target, key, desc) {
2267
2412
  }
2268
2413
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2269
2414
  }
2270
- __name(_ts_decorate14, "_ts_decorate");
2271
- function _ts_metadata14(metadataKey, metadataValue) {
2415
+ __name(_ts_decorate15, "_ts_decorate");
2416
+ function _ts_metadata15(metadataKey, metadataValue) {
2272
2417
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
2273
2418
  return Reflect.metadata(metadataKey, metadataValue);
2274
2419
  }
2275
2420
  }
2276
- __name(_ts_metadata14, "_ts_metadata");
2277
- function _ts_param13(paramIndex, decorator) {
2421
+ __name(_ts_metadata15, "_ts_metadata");
2422
+ function _ts_param14(paramIndex, decorator) {
2278
2423
  return function(target, key) {
2279
2424
  decorator(target, key, paramIndex);
2280
2425
  };
2281
2426
  }
2282
- __name(_ts_param13, "_ts_param");
2427
+ __name(_ts_param14, "_ts_param");
2283
2428
  var AgentDiscoveryService = class _AgentDiscoveryService {
2284
2429
  static {
2285
2430
  __name(this, "AgentDiscoveryService");
@@ -2406,12 +2551,12 @@ var AgentDiscoveryService = class _AgentDiscoveryService {
2406
2551
  return (ctx) => candidate.call(instance, ctx);
2407
2552
  }
2408
2553
  };
2409
- AgentDiscoveryService = _ts_decorate14([
2554
+ AgentDiscoveryService = _ts_decorate15([
2410
2555
  Injectable4(),
2411
- _ts_param13(2, Inject13(AGENT_REGISTRY4)),
2412
- _ts_param13(3, Inject13(AGENT_PROMPT_CONTRIBUTORS2)),
2413
- _ts_metadata14("design:type", Function),
2414
- _ts_metadata14("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", [
2415
2560
  typeof DiscoveryService === "undefined" ? Object : DiscoveryService,
2416
2561
  typeof MetadataScanner === "undefined" ? Object : MetadataScanner,
2417
2562
  typeof AgentRegistry5 === "undefined" ? Object : AgentRegistry5,
@@ -2421,7 +2566,7 @@ AgentDiscoveryService = _ts_decorate14([
2421
2566
 
2422
2567
  // src/discovery/ai-tool-discovery.service.ts
2423
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";
2424
- import { Inject as Inject14, Injectable as Injectable5, Logger as Logger2 } from "@nestjs/common";
2569
+ import { Inject as Inject15, Injectable as Injectable5, Logger as Logger2 } from "@nestjs/common";
2425
2570
  import { DiscoveryService as DiscoveryService2 } from "@nestjs/core";
2426
2571
  import { z } from "zod";
2427
2572
 
@@ -2470,7 +2615,7 @@ function provideAgentTool(factoryOrTool, inject) {
2470
2615
  __name(provideAgentTool, "provideAgentTool");
2471
2616
 
2472
2617
  // src/discovery/ai-tool-discovery.service.ts
2473
- function _ts_decorate15(decorators, target, key, desc) {
2618
+ function _ts_decorate16(decorators, target, key, desc) {
2474
2619
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2475
2620
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
2476
2621
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2483,19 +2628,19 @@ function _ts_decorate15(decorators, target, key, desc) {
2483
2628
  }
2484
2629
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2485
2630
  }
2486
- __name(_ts_decorate15, "_ts_decorate");
2487
- function _ts_metadata15(metadataKey, metadataValue) {
2631
+ __name(_ts_decorate16, "_ts_decorate");
2632
+ function _ts_metadata16(metadataKey, metadataValue) {
2488
2633
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
2489
2634
  return Reflect.metadata(metadataKey, metadataValue);
2490
2635
  }
2491
2636
  }
2492
- __name(_ts_metadata15, "_ts_metadata");
2493
- function _ts_param14(paramIndex, decorator) {
2637
+ __name(_ts_metadata16, "_ts_metadata");
2638
+ function _ts_param15(paramIndex, decorator) {
2494
2639
  return function(target, key) {
2495
2640
  decorator(target, key, paramIndex);
2496
2641
  };
2497
2642
  }
2498
- __name(_ts_param14, "_ts_param");
2643
+ __name(_ts_param15, "_ts_param");
2499
2644
  var AiToolDiscoveryService = class _AiToolDiscoveryService {
2500
2645
  static {
2501
2646
  __name(this, "AiToolDiscoveryService");
@@ -2628,13 +2773,13 @@ var AiToolDiscoveryService = class _AiToolDiscoveryService {
2628
2773
  return true;
2629
2774
  }
2630
2775
  };
2631
- AiToolDiscoveryService = _ts_decorate15([
2776
+ AiToolDiscoveryService = _ts_decorate16([
2632
2777
  Injectable5(),
2633
- _ts_param14(1, Inject14(AGENT_TOOL_REGISTRY2)),
2634
- _ts_param14(2, Inject14(AGENT_REGISTRY5)),
2635
- _ts_param14(3, Inject14(AGENT_OPTIONS3)),
2636
- _ts_metadata15("design:type", Function),
2637
- _ts_metadata15("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", [
2638
2783
  typeof DiscoveryService2 === "undefined" ? Object : DiscoveryService2,
2639
2784
  typeof ToolRegistry === "undefined" ? Object : ToolRegistry,
2640
2785
  typeof AgentRegistry === "undefined" ? Object : AgentRegistry,
@@ -2644,7 +2789,7 @@ AiToolDiscoveryService = _ts_decorate15([
2644
2789
 
2645
2790
  // src/discovery/skill-discovery.service.ts
2646
2791
  import { AGENT_SKILL_SOURCES } from "@dudousxd/nestjs-agent-core";
2647
- import { Inject as Inject15, Injectable as Injectable6, Logger as Logger3 } from "@nestjs/common";
2792
+ import { Inject as Inject16, Injectable as Injectable6, Logger as Logger3 } from "@nestjs/common";
2648
2793
  import { DiscoveryService as DiscoveryService3 } from "@nestjs/core";
2649
2794
 
2650
2795
  // src/decorator/skill.decorator.ts
@@ -2667,7 +2812,7 @@ function skillScope(options) {
2667
2812
  __name(skillScope, "skillScope");
2668
2813
 
2669
2814
  // src/discovery/skill-discovery.service.ts
2670
- function _ts_decorate16(decorators, target, key, desc) {
2815
+ function _ts_decorate17(decorators, target, key, desc) {
2671
2816
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2672
2817
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
2673
2818
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2680,19 +2825,19 @@ function _ts_decorate16(decorators, target, key, desc) {
2680
2825
  }
2681
2826
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2682
2827
  }
2683
- __name(_ts_decorate16, "_ts_decorate");
2684
- function _ts_metadata16(metadataKey, metadataValue) {
2828
+ __name(_ts_decorate17, "_ts_decorate");
2829
+ function _ts_metadata17(metadataKey, metadataValue) {
2685
2830
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
2686
2831
  return Reflect.metadata(metadataKey, metadataValue);
2687
2832
  }
2688
2833
  }
2689
- __name(_ts_metadata16, "_ts_metadata");
2690
- function _ts_param15(paramIndex, decorator) {
2834
+ __name(_ts_metadata17, "_ts_metadata");
2835
+ function _ts_param16(paramIndex, decorator) {
2691
2836
  return function(target, key) {
2692
2837
  decorator(target, key, paramIndex);
2693
2838
  };
2694
2839
  }
2695
- __name(_ts_param15, "_ts_param");
2840
+ __name(_ts_param16, "_ts_param");
2696
2841
  var SkillDiscoveryService = class _SkillDiscoveryService {
2697
2842
  static {
2698
2843
  __name(this, "SkillDiscoveryService");
@@ -2736,11 +2881,11 @@ var SkillDiscoveryService = class _SkillDiscoveryService {
2736
2881
  return flat === void 0 ? void 0 : () => flat;
2737
2882
  }
2738
2883
  };
2739
- SkillDiscoveryService = _ts_decorate16([
2884
+ SkillDiscoveryService = _ts_decorate17([
2740
2885
  Injectable6(),
2741
- _ts_param15(1, Inject15(AGENT_SKILL_SOURCES)),
2742
- _ts_metadata16("design:type", Function),
2743
- _ts_metadata16("design:paramtypes", [
2886
+ _ts_param16(1, Inject16(AGENT_SKILL_SOURCES)),
2887
+ _ts_metadata17("design:type", Function),
2888
+ _ts_metadata17("design:paramtypes", [
2744
2889
  typeof DiscoveryService3 === "undefined" ? Object : DiscoveryService3,
2745
2890
  Array
2746
2891
  ])
@@ -2839,8 +2984,8 @@ var LedgerQuotaStore = class {
2839
2984
 
2840
2985
  // src/runner/inline-agent-runner.ts
2841
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";
2842
- import { Inject as Inject16, Injectable as Injectable7, Logger as Logger4 } from "@nestjs/common";
2843
- function _ts_decorate17(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) {
2844
2989
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2845
2990
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
2846
2991
  r = Reflect.decorate(decorators, target, key, desc);
@@ -2853,19 +2998,19 @@ function _ts_decorate17(decorators, target, key, desc) {
2853
2998
  }
2854
2999
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2855
3000
  }
2856
- __name(_ts_decorate17, "_ts_decorate");
2857
- function _ts_metadata17(metadataKey, metadataValue) {
3001
+ __name(_ts_decorate18, "_ts_decorate");
3002
+ function _ts_metadata18(metadataKey, metadataValue) {
2858
3003
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
2859
3004
  return Reflect.metadata(metadataKey, metadataValue);
2860
3005
  }
2861
3006
  }
2862
- __name(_ts_metadata17, "_ts_metadata");
2863
- function _ts_param16(paramIndex, decorator) {
3007
+ __name(_ts_metadata18, "_ts_metadata");
3008
+ function _ts_param17(paramIndex, decorator) {
2864
3009
  return function(target, key) {
2865
3010
  decorator(target, key, paramIndex);
2866
3011
  };
2867
3012
  }
2868
- __name(_ts_param16, "_ts_param");
3013
+ __name(_ts_param17, "_ts_param");
2869
3014
  var InlineAgentRunner = class _InlineAgentRunner {
2870
3015
  static {
2871
3016
  __name(this, "InlineAgentRunner");
@@ -3246,12 +3391,12 @@ var InlineAgentRunner = class _InlineAgentRunner {
3246
3391
  }
3247
3392
  }
3248
3393
  };
3249
- InlineAgentRunner = _ts_decorate17([
3394
+ InlineAgentRunner = _ts_decorate18([
3250
3395
  Injectable7(),
3251
- _ts_param16(0, Inject16(AGENT_DEPS_FACTORY4)),
3252
- _ts_param16(1, Inject16(AGENT_STORE3)),
3253
- _ts_metadata17("design:type", Function),
3254
- _ts_metadata17("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", [
3255
3400
  typeof AgentDepsFactory === "undefined" ? Object : AgentDepsFactory,
3256
3401
  typeof AgentStore === "undefined" ? Object : AgentStore
3257
3402
  ])
@@ -3296,7 +3441,7 @@ function resolveSkillsConfig(options, declared) {
3296
3441
  __name(resolveSkillsConfig, "resolveSkillsConfig");
3297
3442
 
3298
3443
  // src/agent.module.ts
3299
- function _ts_decorate18(decorators, target, key, desc) {
3444
+ function _ts_decorate19(decorators, target, key, desc) {
3300
3445
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3301
3446
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
3302
3447
  r = Reflect.decorate(decorators, target, key, desc);
@@ -3309,7 +3454,7 @@ function _ts_decorate18(decorators, target, key, desc) {
3309
3454
  }
3310
3455
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3311
3456
  }
3312
- __name(_ts_decorate18, "_ts_decorate");
3457
+ __name(_ts_decorate19, "_ts_decorate");
3313
3458
  var DEFAULT_PATH = "agent";
3314
3459
  function sharedProviders(durable, includeStore) {
3315
3460
  const providers = [
@@ -3368,7 +3513,7 @@ function sharedProviders(durable, includeStore) {
3368
3513
  ]
3369
3514
  },
3370
3515
  {
3371
- provide: AGENT_ACTOR_RESOLVER10,
3516
+ provide: AGENT_ACTOR_RESOLVER11,
3372
3517
  useFactory: /* @__PURE__ */ __name((options) => options.actorResolver, "useFactory"),
3373
3518
  inject: [
3374
3519
  AGENT_OPTIONS4
@@ -3392,6 +3537,13 @@ function sharedProviders(durable, includeStore) {
3392
3537
  AGENT_STORE4
3393
3538
  ]
3394
3539
  },
3540
+ {
3541
+ provide: AGENT_MODEL_CATALOG2,
3542
+ useFactory: /* @__PURE__ */ __name((o) => o.models, "useFactory"),
3543
+ inject: [
3544
+ AGENT_OPTIONS4
3545
+ ]
3546
+ },
3395
3547
  AgentDepsFactory2,
3396
3548
  {
3397
3549
  provide: AGENT_DEPS_FACTORY5,
@@ -3453,12 +3605,13 @@ function exportsFor(includeStore) {
3453
3605
  AGENT_REGISTRY6,
3454
3606
  AGENT_SINK2,
3455
3607
  AGENT_ROLES_POLICY2,
3456
- AGENT_ACTOR_RESOLVER10,
3608
+ AGENT_ACTOR_RESOLVER11,
3457
3609
  AGENT_MODEL2,
3458
3610
  ...includeStore ? [
3459
3611
  AGENT_STORE4
3460
3612
  ] : [],
3461
3613
  AGENT_QUOTA_STORE3,
3614
+ AGENT_MODEL_CATALOG2,
3462
3615
  AGENT_PROMPT_CONTRIBUTORS3,
3463
3616
  AGENT_SKILLS3,
3464
3617
  AGENT_MEMORY3,
@@ -3479,7 +3632,8 @@ var BASE_CONTROLLERS = [
3479
3632
  SkillsController,
3480
3633
  MemoriesController,
3481
3634
  ToolsController,
3482
- MessagesController
3635
+ MessagesController,
3636
+ ModelsController
3483
3637
  ];
3484
3638
  var GUARDABLE_CONTROLLERS = [
3485
3639
  ...BASE_CONTROLLERS,
@@ -3582,7 +3736,7 @@ var AgentModule = class _AgentModule {
3582
3736
  };
3583
3737
  }
3584
3738
  };
3585
- AgentModule = _ts_decorate18([
3739
+ AgentModule = _ts_decorate19([
3586
3740
  Global(),
3587
3741
  Module({})
3588
3742
  ], AgentModule);
@@ -3642,6 +3796,7 @@ export {
3642
3796
  LedgerQuotaStore,
3643
3797
  MemoriesController,
3644
3798
  MessagesController,
3799
+ ModelsController,
3645
3800
  SKILL_METADATA,
3646
3801
  SYSTEM_PROMPT_CONTRIBUTOR_METADATA,
3647
3802
  SYSTEM_PROMPT_METADATA,